@intuned/runner-types
Advanced tools
Comparing version 0.19.1 to 0.19.2
773
index.d.ts
@@ -1,13 +0,760 @@ | ||
export { EnhancedPlaywrightPage } from "./shared/EnhancedPlaywrightPage"; | ||
export { EnhancedPlaywrightBrowserContext } from "./shared/EnhancedPlaywrightBrowserContext"; | ||
export { requestMultipleChoice, requestOTP, RequestOtpReturnType, RequestMultipleChoiceReturnType, } from "./shared/requestMoreInfo"; | ||
export { IntunedError, IntunedErrorOptions } from "./shared/intunedErrors"; | ||
export { ExecutionHelpers } from "./shared/types"; | ||
export { FormDataItem } from "./shared/formHelpers/fillForm"; | ||
export { default as S3FileUploadHelpers } from "./shared/S3FileUploadHelpers"; | ||
export { searchPdf } from "./shared/FileHelpers/searchPdf"; | ||
export { pdfPageToText } from "./shared/FileHelpers/pdfToText"; | ||
export { extractFromPdfImproved as extractFromPdfV2 } from "./shared/FileHelpers/extractInfoFromPdfImproved"; | ||
export type { FileExtractionProperties, FileExtractionPropertyType, PdfSource, ExcelSource, } from "./shared/FileHelpers/typesAndSchema"; | ||
export { FileHelpers } from "./shared/FileHelpers"; | ||
export { extractTablesFromPdf } from "./shared/FileHelpers/extractTablesFromPdf"; | ||
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 as PlaywrightDownload, Locator, Page } from '@intuned/playwright-core'; | ||
import * as z from 'zod'; | ||
export type ClassificationCategories = { | ||
categoryName: string; | ||
categoryDescription: string; | ||
}[]; | ||
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; | ||
regexMatchIndex?: number; | ||
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; | ||
regexMatchIndex?: number; | ||
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 type OpenAiModels = "gpt4" | "gpt4-turbo" | "gpt3.5-turbo"; | ||
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; | ||
} | ||
const strategySchema: z.ZodDefault<z.ZodOptional<z.ZodObject<{ | ||
model: z.ZodEnum<[ | ||
"claude-3-opus", | ||
"claude-3-sonnet", | ||
"claude-3-haiku", | ||
"gpt4-turbo", | ||
"gpt3.5-turbo" | ||
]>; | ||
type: z.ZodLiteral<"HTML">; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "HTML"; | ||
model: "gpt4-turbo" | "gpt3.5-turbo" | "claude-3-opus" | "claude-3-sonnet" | "claude-3-haiku"; | ||
}, { | ||
type: "HTML"; | ||
model: "gpt4-turbo" | "gpt3.5-turbo" | "claude-3-opus" | "claude-3-sonnet" | "claude-3-haiku"; | ||
}>>>; | ||
export type ExtractionStrategy = z.infer<typeof strategySchema>; | ||
export type ExtractionResultObject = Record<string, string | null> | null; | ||
export type InvalidatorFunction = (result: ExtractionResultObject) => string[]; | ||
export interface DynamicObjectExtractorOptions { | ||
entityName: string; | ||
entityDescription?: string; | ||
properties: Record<string, { | ||
description: string; | ||
required?: boolean; | ||
visible?: boolean; | ||
type?: "string"; | ||
}>; | ||
searchRegion?: Locator; | ||
optionalPropertiesInvalidator?: InvalidatorFunction; | ||
variantKey?: string; | ||
strategy?: ExtractionStrategy; | ||
} | ||
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 type ExtractionResultList = Record<string, string>[]; | ||
export type ListInvalidatorFunction = (result: ExtractionResultList) => string[]; | ||
const listPropertiesInputSchema: z.ZodEffects<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{ | ||
primary: z.ZodOptional<z.ZodBoolean>; | ||
description: z.ZodString; | ||
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; | ||
visible: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; | ||
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"string">>>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "string"; | ||
visible: boolean; | ||
description: string; | ||
required: boolean; | ||
primary?: boolean | undefined; | ||
}, { | ||
description: string; | ||
primary?: boolean | undefined; | ||
required?: boolean | undefined; | ||
visible?: boolean | undefined; | ||
type?: "string" | undefined; | ||
}>>, Record<string, { | ||
type: "string"; | ||
visible: boolean; | ||
description: string; | ||
required: boolean; | ||
primary?: boolean | undefined; | ||
}>, Record<string, { | ||
description: string; | ||
primary?: boolean | undefined; | ||
required?: boolean | undefined; | ||
visible?: boolean | undefined; | ||
type?: "string" | undefined; | ||
}>>, Record<string, { | ||
type: "string"; | ||
visible: boolean; | ||
description: string; | ||
required: boolean; | ||
primary?: boolean | undefined; | ||
}>, Record<string, { | ||
description: string; | ||
primary?: boolean | undefined; | ||
required?: boolean | undefined; | ||
visible?: boolean | undefined; | ||
type?: "string" | undefined; | ||
}>>; | ||
const dynamicListExtractorOptionsSchema: z.ZodObject<{ | ||
listEntityName: z.ZodString; | ||
listEntityDescription: z.ZodOptional<z.ZodString>; | ||
variantKey: z.ZodOptional<z.ZodString>; | ||
optionalPropertiesInvalidator: z.ZodOptional<z.ZodFunction<z.ZodTuple<[ | ||
], z.ZodUnknown>, z.ZodUnknown>>; | ||
strategy: z.ZodDefault<z.ZodOptional<z.ZodObject<{ | ||
model: z.ZodEnum<[ | ||
"claude-3-opus", | ||
"claude-3-sonnet", | ||
"claude-3-haiku", | ||
"gpt4-turbo", | ||
"gpt3.5-turbo" | ||
]>; | ||
type: z.ZodLiteral<"HTML">; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "HTML"; | ||
model: "gpt4-turbo" | "gpt3.5-turbo" | "claude-3-opus" | "claude-3-sonnet" | "claude-3-haiku"; | ||
}, { | ||
type: "HTML"; | ||
model: "gpt4-turbo" | "gpt3.5-turbo" | "claude-3-opus" | "claude-3-sonnet" | "claude-3-haiku"; | ||
}>>>; | ||
}, "strip", z.ZodTypeAny, { | ||
listEntityName: string; | ||
strategy: { | ||
type: "HTML"; | ||
model: "gpt4-turbo" | "gpt3.5-turbo" | "claude-3-opus" | "claude-3-sonnet" | "claude-3-haiku"; | ||
}; | ||
listEntityDescription?: string | undefined; | ||
variantKey?: string | undefined; | ||
optionalPropertiesInvalidator?: ((...args: unknown[]) => unknown) | undefined; | ||
}, { | ||
listEntityName: string; | ||
listEntityDescription?: string | undefined; | ||
variantKey?: string | undefined; | ||
optionalPropertiesInvalidator?: ((...args: unknown[]) => unknown) | undefined; | ||
strategy?: { | ||
type: "HTML"; | ||
model: "gpt4-turbo" | "gpt3.5-turbo" | "claude-3-opus" | "claude-3-sonnet" | "claude-3-haiku"; | ||
} | undefined; | ||
}>; | ||
export interface DynamicListExtractorOptions extends Omit<z.infer<typeof dynamicListExtractorOptionsSchema>, "container" | "optionalPropertiesInvalidator"> { | ||
searchRegion?: Locator; | ||
optionalPropertiesInvalidator?: ListInvalidatorFunction; | ||
properties: z.input<typeof listPropertiesInputSchema>; | ||
} | ||
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; | ||
convertToMarkdown(locator?: Locator | AbsoluteElementSelector): Promise<string>; | ||
/** | ||
* can be called like page['__saveSnapshotWithExamples']() | ||
* @param snapshotName | ||
* @param examples | ||
* @param s3Configs | ||
* @returns | ||
*/ | ||
private __saveSnapshotWithExamples; | ||
private ـgetVisiblePageHtml; | ||
private ـgetVisiblePageHtmlImpl; | ||
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, model?: OpenAiModels): Promise<T>; | ||
classifyUsingAi(categories: ClassificationCategories): Promise<{ | ||
status: "failed" | "success"; | ||
result: any; | ||
}>; | ||
extractDataUsingAiFromImage<T = any>(entityName: string, jsonSchema: JSONSchema, searchRegion?: Locator): Promise<T>; | ||
dynamicObjectExtractor(identifier: string, options: DynamicObjectExtractorOptions): Promise<ExtractionResultObject | undefined>; | ||
dynamicListExtractor(identifier: string, options: DynamicListExtractorOptions): Promise<ExtractionResultList | undefined>; | ||
extractDataUsingAiFromText<T = any>(entityName: string, jsonSchema: JSONSchema, text: string, model?: OpenAiModels): Promise<T>; | ||
extractObjectDynamicExtractor<T extends ObjectJSONSchema>(entityName: string, jsonSchema: T, searchRegion?: AbsoluteElementSelector | Locator, InvalidatePropertyIfEmpty?: boolean): Promise<ExtractObjectDynamicExtractorReturnType<T>>; | ||
private findXpathForLocator; | ||
extractListDynamicExtractor<T extends ObjectJSONSchema>(entityName: string, jsonSchema: T, searchRegion?: AbsoluteElementSelector | Locator, InvalidatePropertyIfEmpty?: boolean): 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; | ||
status_code?: number; | ||
error_code?: string; | ||
} | ||
export class IntunedError extends Error { | ||
options: IntunedErrorOptions; | ||
constructor(message: string, options?: IntunedErrorOptions); | ||
} | ||
export type Download = Pick<PlaywrightDownload, "delete" | "path" | "suggestedFilename">; | ||
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>; | ||
} | { | ||
type: "DirectLink"; | ||
link: string; | ||
}; | ||
class File { | ||
private folderName; | ||
private fileName; | ||
private s3Configs; | ||
private s3Client; | ||
constructor(folderName: string, fileName: 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>; | ||
waitForPdfPreviewAndDownloadNewPage(): Promise<Download>; | ||
waitForPdfPreviewAndDownload(newPage: Page): Promise<Download>; | ||
persistFile(fileName: string, configs: PersistFileConfigs): Promise<File | undefined>; | ||
} | ||
export interface SearchPdfConfigs { | ||
contextWindow?: number; | ||
matchCase?: boolean; | ||
wholeWord?: boolean; | ||
} | ||
export type SearchPdfResult = { | ||
context: string; | ||
page: number; | ||
found: true; | ||
} | { | ||
found: false; | ||
}; | ||
export function searchPdf(dataBuffer: Buffer, search: string, options?: SearchPdfConfigs): Promise<SearchPdfResult>; | ||
export function pdfPageToText(dataBuffer: Buffer, pageNumbers: number[]): Promise<{ | ||
results: { | ||
text: string; | ||
pageNumber: number; | ||
}[]; | ||
totalPages: number; | ||
}>; | ||
const pdfSourceSchema: z.ZodObject<{ | ||
type: z.ZodLiteral<"pdf">; | ||
pageNumbers: z.ZodUnion<[ | ||
z.ZodArray<z.ZodNumber, "many">, | ||
z.ZodLiteral<"*"> | ||
]>; | ||
location: z.ZodUnion<[ | ||
z.ZodObject<{ | ||
type: z.ZodLiteral<"Buffer">; | ||
buffer: z.ZodType<Buffer, z.ZodTypeDef, Buffer>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "Buffer"; | ||
buffer: Buffer; | ||
}, { | ||
type: "Buffer"; | ||
buffer: Buffer; | ||
}>, | ||
z.ZodObject<{ | ||
type: z.ZodLiteral<"Url">; | ||
url: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "Url"; | ||
url: string; | ||
}, { | ||
type: "Url"; | ||
url: string; | ||
}> | ||
]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "pdf"; | ||
pageNumbers: (number[] | "*") & (number[] | "*" | undefined); | ||
location: { | ||
type: "Buffer"; | ||
buffer: Buffer; | ||
} | { | ||
type: "Url"; | ||
url: string; | ||
}; | ||
}, { | ||
type: "pdf"; | ||
pageNumbers: (number[] | "*") & (number[] | "*" | undefined); | ||
location: { | ||
type: "Buffer"; | ||
buffer: Buffer; | ||
} | { | ||
type: "Url"; | ||
url: string; | ||
}; | ||
}>; | ||
export type PdfSource = z.infer<typeof pdfSourceSchema>; | ||
const excelSourceSchema: z.ZodObject<{ | ||
type: z.ZodLiteral<"excel">; | ||
location: z.ZodUnion<[ | ||
z.ZodObject<{ | ||
type: z.ZodLiteral<"Buffer">; | ||
buffer: z.ZodType<Buffer, z.ZodTypeDef, Buffer>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "Buffer"; | ||
buffer: Buffer; | ||
}, { | ||
type: "Buffer"; | ||
buffer: Buffer; | ||
}>, | ||
z.ZodObject<{ | ||
type: z.ZodLiteral<"Url">; | ||
url: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "Url"; | ||
url: string; | ||
}, { | ||
type: "Url"; | ||
url: string; | ||
}> | ||
]>; | ||
sheetsNames: z.ZodUnion<[ | ||
z.ZodArray<z.ZodString, "many">, | ||
z.ZodLiteral<"*"> | ||
]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "excel"; | ||
location: { | ||
type: "Buffer"; | ||
buffer: Buffer; | ||
} | { | ||
type: "Url"; | ||
url: string; | ||
}; | ||
sheetsNames: (string[] | "*") & (string[] | "*" | undefined); | ||
}, { | ||
type: "excel"; | ||
location: { | ||
type: "Buffer"; | ||
buffer: Buffer; | ||
} | { | ||
type: "Url"; | ||
url: string; | ||
}; | ||
sheetsNames: (string[] | "*") & (string[] | "*" | undefined); | ||
}>; | ||
export type ExcelSource = z.infer<typeof excelSourceSchema>; | ||
const fileExtractionPropertiesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[ | ||
z.ZodObject<{ | ||
type: z.ZodLiteral<"array">; | ||
description: z.ZodString; | ||
required: z.ZodOptional<z.ZodBoolean>; | ||
items: z.ZodUnion<[ | ||
z.ZodObject<{ | ||
type: z.ZodUnion<[ | ||
z.ZodLiteral<"number">, | ||
z.ZodLiteral<"string">, | ||
z.ZodLiteral<"boolean"> | ||
]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "string" | "number" | "boolean"; | ||
}, { | ||
type: "string" | "number" | "boolean"; | ||
}>, | ||
z.ZodObject<{ | ||
type: z.ZodLiteral<"object">; | ||
properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{ | ||
description: z.ZodString; | ||
required: z.ZodOptional<z.ZodBoolean>; | ||
exact: z.ZodOptional<z.ZodBoolean>; | ||
type: z.ZodUnion<[ | ||
z.ZodLiteral<"string">, | ||
z.ZodLiteral<"boolean">, | ||
z.ZodLiteral<"number"> | ||
]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "object"; | ||
properties: Record<string, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>; | ||
}, { | ||
type: "object"; | ||
properties: Record<string, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>; | ||
}> | ||
]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "array"; | ||
description: string; | ||
items: { | ||
type: "string" | "number" | "boolean"; | ||
} | { | ||
type: "object"; | ||
properties: Record<string, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>; | ||
}; | ||
required?: boolean | undefined; | ||
}, { | ||
type: "array"; | ||
description: string; | ||
items: { | ||
type: "string" | "number" | "boolean"; | ||
} | { | ||
type: "object"; | ||
properties: Record<string, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>; | ||
}; | ||
required?: boolean | undefined; | ||
}>, | ||
z.ZodObject<{ | ||
type: z.ZodLiteral<"object">; | ||
description: z.ZodString; | ||
required: z.ZodOptional<z.ZodBoolean>; | ||
properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{ | ||
description: z.ZodString; | ||
required: z.ZodOptional<z.ZodBoolean>; | ||
exact: z.ZodOptional<z.ZodBoolean>; | ||
type: z.ZodUnion<[ | ||
z.ZodLiteral<"string">, | ||
z.ZodLiteral<"boolean">, | ||
z.ZodLiteral<"number"> | ||
]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "object"; | ||
properties: Record<string, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>; | ||
description: string; | ||
required?: boolean | undefined; | ||
}, { | ||
type: "object"; | ||
properties: Record<string, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>; | ||
description: string; | ||
required?: boolean | undefined; | ||
}>, | ||
z.ZodEffects<z.ZodObject<{ | ||
description: z.ZodString; | ||
required: z.ZodOptional<z.ZodBoolean>; | ||
exact: z.ZodOptional<z.ZodBoolean>; | ||
type: z.ZodUnion<[ | ||
z.ZodLiteral<"string">, | ||
z.ZodLiteral<"boolean">, | ||
z.ZodLiteral<"number"> | ||
]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}>, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}, { | ||
type: "string" | "number" | "boolean"; | ||
description: string; | ||
required?: boolean | undefined; | ||
exact?: boolean | undefined; | ||
}> | ||
]>>; | ||
export type FileExtractionProperties = z.infer<typeof fileExtractionPropertiesSchema>; | ||
export type FileExtractionPropertyType = FileExtractionProperties[keyof FileExtractionProperties]; | ||
function extractFromPdfImproved(entityName: string, sourceInput: PdfSource, fileExtractionPropertiesInput: FileExtractionProperties): Promise<any>; | ||
function extractTablesFromExcel(source: Omit<ExcelSource, "type">): Promise<{ | ||
pages: { | ||
title: string | undefined; | ||
content: (string | undefined | number | Date)[][]; | ||
}[][]; | ||
}>; | ||
export function extractTablesFromPdf(source: Omit<PdfSource, "type">): Promise<{ | ||
pages: { | ||
title: string | undefined; | ||
content: (string | undefined)[][]; | ||
}[][]; | ||
}>; | ||
export class FileHelpers { | ||
static searchPdf(...params: Parameters<typeof searchPdf>): Promise<{ | ||
context: string; | ||
page: number; | ||
found: true; | ||
} | { | ||
found: false; | ||
}>; | ||
static pdfPageToText(...pdfPageToTextParams: Parameters<typeof pdfPageToText>): Promise<{ | ||
results: { | ||
text: string; | ||
pageNumber: number; | ||
}[]; | ||
totalPages: number; | ||
}>; | ||
static extractTablesFromPdf(...extractTablesFromPdfParams: Parameters<typeof extractTablesFromPdf>): Promise<{ | ||
pages: { | ||
title: string | undefined; | ||
content: (string | undefined)[][]; | ||
}[][]; | ||
}>; | ||
static extractTablesFromExcel(...extractTablesFromExcelParams: Parameters<typeof extractTablesFromExcel>): Promise<{ | ||
pages: { | ||
title: string | undefined; | ||
content: (string | number | Date | undefined)[][]; | ||
}[][]; | ||
}>; | ||
static getPdfPagesCount(pdf: Buffer): Promise<number>; | ||
} | ||
export { | ||
extractFromPdfImproved as extractFromPdfV2, | ||
}; | ||
export {}; | ||
} | ||
} | ||
} |
{ | ||
"name": "@intuned/runner-types", | ||
"version": "0.19.1", | ||
"version": "0.19.2", | ||
"description": "intuned runner types", | ||
@@ -5,0 +5,0 @@ "author": "Intuned Team", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24219
3
770