Socket
Socket
Sign inDemoInstall

@intuned/runner-types

Package Overview
Dependencies
Maintainers
4
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@intuned/runner-types - npm Package Compare versions

Comparing version 0.6.2-beta-6 to 0.6.2-beta-7

246

index.d.ts
declare module '@intuned/runner' {
declare module '@intuned/runner' {
declare module '@intuned/runner' {
// Generated by dts-bundle-generator v8.0.1
import { PutObjectCommandInput, S3Client } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
import { BrowserContext, Download, Locator, Page } from '@intuned/playwright-core';
export type ObjectExtractor = Record<string, AbsoluteValueSelector | null>;
export interface AbsoluteValueSelector {
value: string;
type: "xpath" | "css";
property: "direct-text" | "all-text" | {
attribute: string;
};
backupSelectors?: AbsoluteValueSelector[];
regex?: string;
extractionType?: "string" | "string-list";
}
export interface AbsoluteElementSelector {
value: string;
type: "xpath" | "css";
backupSelectors?: AbsoluteElementSelector[];
}
export type RelativeValueSelector = {
value: string;
type: "relative-css" | "relative-xpath";
property: "direct-text" | "all-text" | {
attribute: string;
};
regex?: string;
backupSelectors?: RelativeValueSelector[];
extractionType?: "sting" | "string-list";
};
export interface BasicListInfo {
containerSelector: AbsoluteElementSelector;
nodeSplit: {
itemTagsToBeFlitteredOut: string[];
numberOfElementsPerItem: number;
};
}
export interface ListStaticExtractor {
containerSelector: AbsoluteElementSelector;
nodeSplit?: BasicListInfo["nodeSplit"] & {
numberOfElementsPerItem?: number;
};
propertySelectors: Record<string, RelativeValueSelector & {
indexOfNodeInsideListItem?: number;
}>;
}
export type JSONSchemaType = "object" | "array" | "string" | "number" | "integer" | "boolean";
export interface JSONSchema {
type: JSONSchemaType | JSONSchemaType[];
properties?: {
[key: string]: JSONSchema;
};
items?: JSONSchema | JSONSchema[];
required?: string[];
enum?: any[];
description?: string;
}
export type ObjectJSONSchema = {
properties: Record<string, {
description: string;
primary?: boolean;
}>;
};
export interface ExecutionInfo {
runId: string;
jobStartTime?: string;
}
export interface ExecutionHelpers {
getExecutionInfo: () => ExecutionInfo;
extendJobPayload: (payloadItem: PayloadItem) => void;
}
export interface PayloadItem {
apiName: string;
parameters: Record<string, any>;
}
export type ExtractObjectUsingStaticSelectorsReturnType<T extends ObjectExtractor> = {
[K in keyof T]: T[K] extends {
extractionType?: "string-list";
} ? string[] | null : string | null;
};
export type ExtractListObjectsUsingStaticSelectorsReturnType<T extends ListStaticExtractor> = {
[K in keyof T["propertySelectors"]]: T["propertySelectors"][K] extends {
extractionType?: "string-list";
} ? string[] | null : string | null;
}[];
export type ExtractObjectDynamicExtractorReturnType<T extends ObjectJSONSchema> = Record<keyof T["properties"], string | null>;
export type ExtractListDynamicExtractorReturnType<T extends ObjectJSONSchema> = Record<keyof T["properties"], string | null>[];
export interface InputFieldsInfo {
fieldType: "select" | "text-input" | "checkbox" | "radiogroup" | "submit-button";
ariaLabel: string | null;
fieldLabelText: string | null;
id: string | null;
name: string | null;
options?: {
value: string | null;
label: string | null;
name?: string;
id?: string;
disabled?: boolean | null;
visible?: boolean | null;
}[];
visible?: boolean | null;
disabled?: boolean | null;
selector: AbsoluteElementSelector;
}
export type FieldSelector = {
selector: string;
type: "css" | "xpath";
};
export type InputFieldType = "text-input" | "select" | "checkbox" | "radiogroup" | "submit-button" | "auto-complete";
export type StaticFormDataItem = {
fieldSelector: FieldSelector;
fieldType: InputFieldType;
value: {
type: "static";
value: string | boolean | number;
};
};
export type DynamicFormDataItem = {
fieldSelector: FieldSelector;
fieldType: InputFieldType;
value: {
type: "dynamic";
source: string | object;
};
};
export type FormDataItem = DynamicFormDataItem | StaticFormDataItem;
export interface FillFormConfigs {
didFormSucceed: (formLocator: Locator, page: EnhancedPlaywrightPage) => Promise<boolean>;
submitForm: (formLocator: Locator, page: EnhancedPlaywrightPage) => Promise<void>;
autoRecovery?: {
enabled: boolean;
input: object;
maskFields?: FieldSelector[];
maxRetries?: number;
};
generateDataToUnblockForm?: {
prompt: string;
enabled: boolean;
maxRetries?: number;
maskFields?: FieldSelector[];
};
}
export interface FillFormOptions {
timeout?: number;
fillFieldTimeout?: number;
waitTimeBetweenFill?: number;
}
export type IntunedPageGoToOptions = Parameters<Page["goto"]>[1] & {
/**
* Whether to throw if the page.goto times out. Defaults to `false`.
*/
throwOnTimeout?: boolean;
};
class IntunedExtendedPage {
private page;
private constructor();
private getLocatorFromRegionElementSelector;
private ـgetVisiblePageHtml;
goto(url: string, options?: IntunedPageGoToOptions): ReturnType<Page["goto"]>;
fillForm(formLocator: AbsoluteElementSelector | Locator, formFields: FormDataItem[], configs: FillFormConfigs, options?: FillFormOptions): Promise<boolean>;
getFormFields(formLocator: Locator): Promise<InputFieldsInfo[]>;
getAbsoluteElementReliableSelectors(element: Locator): Promise<string[]>;
getRelativeElementReliableSelectors(anchorElement: Locator, relativeSelector: string): Promise<string[]>;
extractDataUsingAiFromPage<T = any>(entityName: string, jsonSchema: JSONSchema, searchRegion?: AbsoluteElementSelector | Locator): Promise<T>;
extractDataUsingAiFromImage<T = any>(entityName: string, jsonSchema: JSONSchema, searchRegion?: Locator): Promise<T>;
extractDataUsingAiFromText<T = any>(entityName: string, jsonSchema: JSONSchema, text: string): Promise<T>;
extractObjectDynamicExtractor<T extends ObjectJSONSchema>(entityName: string, jsonSchema: T, searchRegion?: AbsoluteElementSelector | Locator): Promise<ExtractObjectDynamicExtractorReturnType<T>>;
private findXpathForLocator;
extractListDynamicExtractor<T extends ObjectJSONSchema>(entityName: string, jsonSchema: T, searchRegion?: AbsoluteElementSelector | Locator): Promise<ExtractListDynamicExtractorReturnType<T>>;
extractObjectUsingStaticSelectors<T extends ObjectExtractor>(extractor: T): Promise<ExtractObjectUsingStaticSelectorsReturnType<T>>;
extractListObjectsUsingStaticSelectors<T extends ListStaticExtractor>(listExtractor: T): Promise<ExtractListObjectsUsingStaticSelectorsReturnType<T>>;
static create(page: Page): EnhancedPlaywrightPage;
}
export type EnhancedPlaywrightPage = IntunedExtendedPage & Page;
class IntunedExtendedBrowserContext {
private context;
constructor(context: BrowserContext);
newPage(): Promise<EnhancedPlaywrightPage>;
static create(context: BrowserContext): Promise<EnhancedPlaywrightBrowserContext>;
}
export type EnhancedPlaywrightBrowserContext = IntunedExtendedBrowserContext & BrowserContext;
const PRIVATE_KEY: unique symbol;
export interface RequestMoreInfoReturnTypeBase {
[PRIVATE_KEY]: true;
action: "request_more_info";
}
export interface RequestMultipleChoiceReturnType extends RequestMoreInfoReturnTypeBase {
messageToUser: string;
choices: string[];
requestType: "multiple_choice";
}
export interface RequestOtpReturnType extends RequestMoreInfoReturnTypeBase {
messageToUser: string;
requestType: "otp";
}
export function requestOTP(messageToUser: string): RequestOtpReturnType;
export function requestMultipleChoice(messageToUser: string, choices: string[]): RequestMultipleChoiceReturnType;
export interface IntunedErrorOptions {
retry: false;
}
export class IntunedError extends Error {
options: IntunedErrorOptions;
constructor(message: string, options?: IntunedErrorOptions);
}
export type PersistFileConfigs = {
type: "DownloadByOpeningNewTab";
trigger: ((page: EnhancedPlaywrightPage) => Promise<void>) | Locator;
} | {
type: "DownloadByDirectLink";
trigger: ((page: EnhancedPlaywrightPage) => Promise<void>) | Locator;
} | {
type: "ThirdPartyFileViewer";
link: string;
downloadAction: (page: EnhancedPlaywrightPage) => Promise<void>;
};
class File {
private key;
private s3Configs;
private s3Client;
constructor(key: string, s3Configs: S3Configs, s3Client: S3Client);
urlDescriptor(): string;
generateSignedUrl(options?: Parameters<typeof getSignedUrl>[2]): Promise<string>;
}
export interface S3Configs {
bucket: string;
region: string;
accessKeyId: string;
secretAccessKey: string;
}
export class S3FileUploadHelpers {
private s3Client;
private executionInfo;
private context;
private page;
private configs;
constructor(page: EnhancedPlaywrightPage, context: EnhancedPlaywrightBrowserContext, executionHelpers: ExecutionHelpers, config?: S3Configs);
uploadFile(fileName: string, file: PutObjectCommandInput["Body"]): Promise<File>;
uploadDownloadedFile(fileName: string, download: Download): Promise<File>;
waitForPdfPreviewAndDownload(): Promise<Download>;
persistFile(fileName: string, configs: PersistFileConfigs): Promise<File>;
}
export {};
}

2

package.json
{
"name": "@intuned/runner-types",
"version": "0.6.2-beta-6",
"version": "0.6.2-beta-7",
"description": "intuned runner types",

@@ -5,0 +5,0 @@ "author": "Intuned Team",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc