@kadoa/node-sdk 0.18.1 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.global.js +15 -15
- package/dist/browser/index.global.js.map +1 -1
- package/dist/index.d.mts +75 -12
- package/dist/index.d.ts +75 -12
- package/dist/index.js +110 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +110 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -377,19 +377,10 @@ interface MonitoringConfig {
|
|
|
377
377
|
*/
|
|
378
378
|
'channels'?: Array<any | null>;
|
|
379
379
|
/**
|
|
380
|
-
*
|
|
380
|
+
* Condition group with logical operator and conditions
|
|
381
381
|
*/
|
|
382
|
-
'conditions'?:
|
|
383
|
-
/**
|
|
384
|
-
* Logical operator for conditions
|
|
385
|
-
*/
|
|
386
|
-
'logicalOperator'?: MonitoringConfigLogicalOperatorEnum;
|
|
382
|
+
'conditions'?: any;
|
|
387
383
|
}
|
|
388
|
-
declare const MonitoringConfigLogicalOperatorEnum: {
|
|
389
|
-
readonly And: "AND";
|
|
390
|
-
readonly Or: "OR";
|
|
391
|
-
};
|
|
392
|
-
type MonitoringConfigLogicalOperatorEnum = typeof MonitoringConfigLogicalOperatorEnum[keyof typeof MonitoringConfigLogicalOperatorEnum];
|
|
393
384
|
|
|
394
385
|
/**
|
|
395
386
|
* Kadoa API
|
|
@@ -648,6 +639,22 @@ interface AgenticWorkflow {
|
|
|
648
639
|
* Additional data for the workflow (e.g. IDs from your system to link data)
|
|
649
640
|
*/
|
|
650
641
|
'additionalData'?: any | null;
|
|
642
|
+
/**
|
|
643
|
+
* Maximum pages to crawl (default: 10,000, max: 100,000). Only used when navigationMode is \'all-pages\'
|
|
644
|
+
*/
|
|
645
|
+
'maxPages'?: number;
|
|
646
|
+
/**
|
|
647
|
+
* Maximum crawl depth (default: 50, max: 200). Only used when navigationMode is \'all-pages\'
|
|
648
|
+
*/
|
|
649
|
+
'maxDepth'?: number;
|
|
650
|
+
/**
|
|
651
|
+
* Regex patterns to include specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
652
|
+
*/
|
|
653
|
+
'pathsFilterIn'?: Array<string>;
|
|
654
|
+
/**
|
|
655
|
+
* Regex patterns to exclude specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
656
|
+
*/
|
|
657
|
+
'pathsFilterOut'?: Array<string>;
|
|
651
658
|
/**
|
|
652
659
|
* Natural language instructions for the AI agent (10-5000 characters). Describe what data to extract and how to navigate the site
|
|
653
660
|
*/
|
|
@@ -1168,6 +1175,22 @@ interface WorkflowWithEntityAndFields {
|
|
|
1168
1175
|
* Additional data for the workflow (e.g. IDs from your system to link data)
|
|
1169
1176
|
*/
|
|
1170
1177
|
'additionalData'?: any | null;
|
|
1178
|
+
/**
|
|
1179
|
+
* Maximum pages to crawl (default: 10,000, max: 100,000). Only used when navigationMode is \'all-pages\'
|
|
1180
|
+
*/
|
|
1181
|
+
'maxPages'?: number;
|
|
1182
|
+
/**
|
|
1183
|
+
* Maximum crawl depth (default: 50, max: 200). Only used when navigationMode is \'all-pages\'
|
|
1184
|
+
*/
|
|
1185
|
+
'maxDepth'?: number;
|
|
1186
|
+
/**
|
|
1187
|
+
* Regex patterns to include specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
1188
|
+
*/
|
|
1189
|
+
'pathsFilterIn'?: Array<string>;
|
|
1190
|
+
/**
|
|
1191
|
+
* Regex patterns to exclude specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
1192
|
+
*/
|
|
1193
|
+
'pathsFilterOut'?: Array<string>;
|
|
1171
1194
|
/**
|
|
1172
1195
|
* Entity name for extraction (e.g., \'Product\', \'JobListing\')
|
|
1173
1196
|
*/
|
|
@@ -1182,6 +1205,7 @@ declare const WorkflowWithEntityAndFieldsNavigationModeEnum: {
|
|
|
1182
1205
|
readonly PaginatedPage: "paginated-page";
|
|
1183
1206
|
readonly PageAndDetail: "page-and-detail";
|
|
1184
1207
|
readonly AgenticNavigation: "agentic-navigation";
|
|
1208
|
+
readonly AllPages: "all-pages";
|
|
1185
1209
|
};
|
|
1186
1210
|
type WorkflowWithEntityAndFieldsNavigationModeEnum = typeof WorkflowWithEntityAndFieldsNavigationModeEnum[keyof typeof WorkflowWithEntityAndFieldsNavigationModeEnum];
|
|
1187
1211
|
declare const WorkflowWithEntityAndFieldsIntervalEnum: {
|
|
@@ -1276,6 +1300,22 @@ interface WorkflowWithExistingSchema {
|
|
|
1276
1300
|
* Additional data for the workflow (e.g. IDs from your system to link data)
|
|
1277
1301
|
*/
|
|
1278
1302
|
'additionalData'?: any | null;
|
|
1303
|
+
/**
|
|
1304
|
+
* Maximum pages to crawl (default: 10,000, max: 100,000). Only used when navigationMode is \'all-pages\'
|
|
1305
|
+
*/
|
|
1306
|
+
'maxPages'?: number;
|
|
1307
|
+
/**
|
|
1308
|
+
* Maximum crawl depth (default: 50, max: 200). Only used when navigationMode is \'all-pages\'
|
|
1309
|
+
*/
|
|
1310
|
+
'maxDepth'?: number;
|
|
1311
|
+
/**
|
|
1312
|
+
* Regex patterns to include specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
1313
|
+
*/
|
|
1314
|
+
'pathsFilterIn'?: Array<string>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Regex patterns to exclude specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
1317
|
+
*/
|
|
1318
|
+
'pathsFilterOut'?: Array<string>;
|
|
1279
1319
|
/**
|
|
1280
1320
|
* ID of an existing schema configuration. Use this to reference a previously defined schema without re-defining extraction fields
|
|
1281
1321
|
*/
|
|
@@ -1286,6 +1326,7 @@ declare const WorkflowWithExistingSchemaNavigationModeEnum: {
|
|
|
1286
1326
|
readonly PaginatedPage: "paginated-page";
|
|
1287
1327
|
readonly PageAndDetail: "page-and-detail";
|
|
1288
1328
|
readonly AgenticNavigation: "agentic-navigation";
|
|
1329
|
+
readonly AllPages: "all-pages";
|
|
1289
1330
|
};
|
|
1290
1331
|
type WorkflowWithExistingSchemaNavigationModeEnum = typeof WorkflowWithExistingSchemaNavigationModeEnum[keyof typeof WorkflowWithExistingSchemaNavigationModeEnum];
|
|
1291
1332
|
declare const WorkflowWithExistingSchemaIntervalEnum: {
|
|
@@ -3641,6 +3682,22 @@ interface V4WorkflowsWorkflowIdMetadataPutRequest {
|
|
|
3641
3682
|
* Additional static data for the workflow
|
|
3642
3683
|
*/
|
|
3643
3684
|
'additionalData'?: object;
|
|
3685
|
+
/**
|
|
3686
|
+
* Maximum pages to crawl (only for crawler workflows)
|
|
3687
|
+
*/
|
|
3688
|
+
'maxPages'?: number;
|
|
3689
|
+
/**
|
|
3690
|
+
* Maximum crawl depth (only for crawler workflows)
|
|
3691
|
+
*/
|
|
3692
|
+
'maxDepth'?: number;
|
|
3693
|
+
/**
|
|
3694
|
+
* Regex patterns to include specific paths (only for crawler workflows)
|
|
3695
|
+
*/
|
|
3696
|
+
'pathsFilterIn'?: Array<string>;
|
|
3697
|
+
/**
|
|
3698
|
+
* Regex patterns to exclude specific paths (only for crawler workflows)
|
|
3699
|
+
*/
|
|
3700
|
+
'pathsFilterOut'?: Array<string>;
|
|
3644
3701
|
}
|
|
3645
3702
|
declare const V4WorkflowsWorkflowIdMetadataPutRequestUpdateIntervalEnum: {
|
|
3646
3703
|
readonly OnlyOnce: "ONLY_ONCE";
|
|
@@ -6020,6 +6077,7 @@ interface CreateWorkflowInput {
|
|
|
6020
6077
|
autoStart?: boolean;
|
|
6021
6078
|
schedules?: string[];
|
|
6022
6079
|
additionalData?: Record<string, unknown>;
|
|
6080
|
+
userPrompt?: string;
|
|
6023
6081
|
}
|
|
6024
6082
|
declare const TERMINAL_JOB_STATES: Set<JobStateEnum>;
|
|
6025
6083
|
declare const TERMINAL_RUN_STATES: Set<string>;
|
|
@@ -6075,6 +6133,7 @@ interface ExtractionOptionsInternal {
|
|
|
6075
6133
|
notifications?: NotificationOptions;
|
|
6076
6134
|
autoStart?: boolean;
|
|
6077
6135
|
additionalData?: Record<string, unknown>;
|
|
6136
|
+
userPrompt?: string;
|
|
6078
6137
|
}
|
|
6079
6138
|
type ExtractionOptions = {
|
|
6080
6139
|
urls: string[];
|
|
@@ -6250,7 +6309,7 @@ declare class SchemaBuilder {
|
|
|
6250
6309
|
|
|
6251
6310
|
interface ExtractOptionsInternal {
|
|
6252
6311
|
urls: string[];
|
|
6253
|
-
name
|
|
6312
|
+
name?: string;
|
|
6254
6313
|
description?: string;
|
|
6255
6314
|
navigationMode: NavigationMode;
|
|
6256
6315
|
entity: EntityConfig;
|
|
@@ -6259,6 +6318,7 @@ interface ExtractOptionsInternal {
|
|
|
6259
6318
|
schedules?: string[];
|
|
6260
6319
|
location?: LocationConfig;
|
|
6261
6320
|
additionalData?: Record<string, unknown>;
|
|
6321
|
+
userPrompt?: string;
|
|
6262
6322
|
}
|
|
6263
6323
|
interface ExtractOptions extends Omit<ExtractOptionsInternal, "navigationMode" | "entity"> {
|
|
6264
6324
|
navigationMode?: NavigationMode;
|
|
@@ -6277,6 +6337,7 @@ interface PreparedExtraction {
|
|
|
6277
6337
|
}) => PreparedExtraction;
|
|
6278
6338
|
bypassPreview: () => PreparedExtraction;
|
|
6279
6339
|
setLocation: (options: LocationConfig) => PreparedExtraction;
|
|
6340
|
+
withPrompt: (prompt: string) => PreparedExtraction;
|
|
6280
6341
|
create: () => Promise<CreatedExtraction>;
|
|
6281
6342
|
}
|
|
6282
6343
|
interface RunWorkflowOptions {
|
|
@@ -6314,6 +6375,7 @@ declare class ExtractionBuilderService {
|
|
|
6314
6375
|
private _jobId;
|
|
6315
6376
|
private _notificationOptions;
|
|
6316
6377
|
private _monitoringOptions;
|
|
6378
|
+
private _userPrompt;
|
|
6317
6379
|
get options(): ExtractOptionsInternal;
|
|
6318
6380
|
get notificationOptions(): NotificationOptions | undefined;
|
|
6319
6381
|
get monitoringOptions(): WorkflowMonitoringConfig | undefined;
|
|
@@ -6330,6 +6392,7 @@ declare class ExtractionBuilderService {
|
|
|
6330
6392
|
schedules: string[];
|
|
6331
6393
|
}): PreparedExtraction;
|
|
6332
6394
|
setLocation(options: LocationConfig): PreparedExtraction;
|
|
6395
|
+
withPrompt(prompt: string): PreparedExtraction;
|
|
6333
6396
|
create(): Promise<CreatedExtraction>;
|
|
6334
6397
|
waitForReady(options?: WaitForReadyOptions): Promise<GetWorkflowResponse>;
|
|
6335
6398
|
run(options?: RunWorkflowOptions): Promise<FinishedExtraction>;
|
package/dist/index.d.ts
CHANGED
|
@@ -377,19 +377,10 @@ interface MonitoringConfig {
|
|
|
377
377
|
*/
|
|
378
378
|
'channels'?: Array<any | null>;
|
|
379
379
|
/**
|
|
380
|
-
*
|
|
380
|
+
* Condition group with logical operator and conditions
|
|
381
381
|
*/
|
|
382
|
-
'conditions'?:
|
|
383
|
-
/**
|
|
384
|
-
* Logical operator for conditions
|
|
385
|
-
*/
|
|
386
|
-
'logicalOperator'?: MonitoringConfigLogicalOperatorEnum;
|
|
382
|
+
'conditions'?: any;
|
|
387
383
|
}
|
|
388
|
-
declare const MonitoringConfigLogicalOperatorEnum: {
|
|
389
|
-
readonly And: "AND";
|
|
390
|
-
readonly Or: "OR";
|
|
391
|
-
};
|
|
392
|
-
type MonitoringConfigLogicalOperatorEnum = typeof MonitoringConfigLogicalOperatorEnum[keyof typeof MonitoringConfigLogicalOperatorEnum];
|
|
393
384
|
|
|
394
385
|
/**
|
|
395
386
|
* Kadoa API
|
|
@@ -648,6 +639,22 @@ interface AgenticWorkflow {
|
|
|
648
639
|
* Additional data for the workflow (e.g. IDs from your system to link data)
|
|
649
640
|
*/
|
|
650
641
|
'additionalData'?: any | null;
|
|
642
|
+
/**
|
|
643
|
+
* Maximum pages to crawl (default: 10,000, max: 100,000). Only used when navigationMode is \'all-pages\'
|
|
644
|
+
*/
|
|
645
|
+
'maxPages'?: number;
|
|
646
|
+
/**
|
|
647
|
+
* Maximum crawl depth (default: 50, max: 200). Only used when navigationMode is \'all-pages\'
|
|
648
|
+
*/
|
|
649
|
+
'maxDepth'?: number;
|
|
650
|
+
/**
|
|
651
|
+
* Regex patterns to include specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
652
|
+
*/
|
|
653
|
+
'pathsFilterIn'?: Array<string>;
|
|
654
|
+
/**
|
|
655
|
+
* Regex patterns to exclude specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
656
|
+
*/
|
|
657
|
+
'pathsFilterOut'?: Array<string>;
|
|
651
658
|
/**
|
|
652
659
|
* Natural language instructions for the AI agent (10-5000 characters). Describe what data to extract and how to navigate the site
|
|
653
660
|
*/
|
|
@@ -1168,6 +1175,22 @@ interface WorkflowWithEntityAndFields {
|
|
|
1168
1175
|
* Additional data for the workflow (e.g. IDs from your system to link data)
|
|
1169
1176
|
*/
|
|
1170
1177
|
'additionalData'?: any | null;
|
|
1178
|
+
/**
|
|
1179
|
+
* Maximum pages to crawl (default: 10,000, max: 100,000). Only used when navigationMode is \'all-pages\'
|
|
1180
|
+
*/
|
|
1181
|
+
'maxPages'?: number;
|
|
1182
|
+
/**
|
|
1183
|
+
* Maximum crawl depth (default: 50, max: 200). Only used when navigationMode is \'all-pages\'
|
|
1184
|
+
*/
|
|
1185
|
+
'maxDepth'?: number;
|
|
1186
|
+
/**
|
|
1187
|
+
* Regex patterns to include specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
1188
|
+
*/
|
|
1189
|
+
'pathsFilterIn'?: Array<string>;
|
|
1190
|
+
/**
|
|
1191
|
+
* Regex patterns to exclude specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
1192
|
+
*/
|
|
1193
|
+
'pathsFilterOut'?: Array<string>;
|
|
1171
1194
|
/**
|
|
1172
1195
|
* Entity name for extraction (e.g., \'Product\', \'JobListing\')
|
|
1173
1196
|
*/
|
|
@@ -1182,6 +1205,7 @@ declare const WorkflowWithEntityAndFieldsNavigationModeEnum: {
|
|
|
1182
1205
|
readonly PaginatedPage: "paginated-page";
|
|
1183
1206
|
readonly PageAndDetail: "page-and-detail";
|
|
1184
1207
|
readonly AgenticNavigation: "agentic-navigation";
|
|
1208
|
+
readonly AllPages: "all-pages";
|
|
1185
1209
|
};
|
|
1186
1210
|
type WorkflowWithEntityAndFieldsNavigationModeEnum = typeof WorkflowWithEntityAndFieldsNavigationModeEnum[keyof typeof WorkflowWithEntityAndFieldsNavigationModeEnum];
|
|
1187
1211
|
declare const WorkflowWithEntityAndFieldsIntervalEnum: {
|
|
@@ -1276,6 +1300,22 @@ interface WorkflowWithExistingSchema {
|
|
|
1276
1300
|
* Additional data for the workflow (e.g. IDs from your system to link data)
|
|
1277
1301
|
*/
|
|
1278
1302
|
'additionalData'?: any | null;
|
|
1303
|
+
/**
|
|
1304
|
+
* Maximum pages to crawl (default: 10,000, max: 100,000). Only used when navigationMode is \'all-pages\'
|
|
1305
|
+
*/
|
|
1306
|
+
'maxPages'?: number;
|
|
1307
|
+
/**
|
|
1308
|
+
* Maximum crawl depth (default: 50, max: 200). Only used when navigationMode is \'all-pages\'
|
|
1309
|
+
*/
|
|
1310
|
+
'maxDepth'?: number;
|
|
1311
|
+
/**
|
|
1312
|
+
* Regex patterns to include specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
1313
|
+
*/
|
|
1314
|
+
'pathsFilterIn'?: Array<string>;
|
|
1315
|
+
/**
|
|
1316
|
+
* Regex patterns to exclude specific paths during crawling. Only used when navigationMode is \'all-pages\'
|
|
1317
|
+
*/
|
|
1318
|
+
'pathsFilterOut'?: Array<string>;
|
|
1279
1319
|
/**
|
|
1280
1320
|
* ID of an existing schema configuration. Use this to reference a previously defined schema without re-defining extraction fields
|
|
1281
1321
|
*/
|
|
@@ -1286,6 +1326,7 @@ declare const WorkflowWithExistingSchemaNavigationModeEnum: {
|
|
|
1286
1326
|
readonly PaginatedPage: "paginated-page";
|
|
1287
1327
|
readonly PageAndDetail: "page-and-detail";
|
|
1288
1328
|
readonly AgenticNavigation: "agentic-navigation";
|
|
1329
|
+
readonly AllPages: "all-pages";
|
|
1289
1330
|
};
|
|
1290
1331
|
type WorkflowWithExistingSchemaNavigationModeEnum = typeof WorkflowWithExistingSchemaNavigationModeEnum[keyof typeof WorkflowWithExistingSchemaNavigationModeEnum];
|
|
1291
1332
|
declare const WorkflowWithExistingSchemaIntervalEnum: {
|
|
@@ -3641,6 +3682,22 @@ interface V4WorkflowsWorkflowIdMetadataPutRequest {
|
|
|
3641
3682
|
* Additional static data for the workflow
|
|
3642
3683
|
*/
|
|
3643
3684
|
'additionalData'?: object;
|
|
3685
|
+
/**
|
|
3686
|
+
* Maximum pages to crawl (only for crawler workflows)
|
|
3687
|
+
*/
|
|
3688
|
+
'maxPages'?: number;
|
|
3689
|
+
/**
|
|
3690
|
+
* Maximum crawl depth (only for crawler workflows)
|
|
3691
|
+
*/
|
|
3692
|
+
'maxDepth'?: number;
|
|
3693
|
+
/**
|
|
3694
|
+
* Regex patterns to include specific paths (only for crawler workflows)
|
|
3695
|
+
*/
|
|
3696
|
+
'pathsFilterIn'?: Array<string>;
|
|
3697
|
+
/**
|
|
3698
|
+
* Regex patterns to exclude specific paths (only for crawler workflows)
|
|
3699
|
+
*/
|
|
3700
|
+
'pathsFilterOut'?: Array<string>;
|
|
3644
3701
|
}
|
|
3645
3702
|
declare const V4WorkflowsWorkflowIdMetadataPutRequestUpdateIntervalEnum: {
|
|
3646
3703
|
readonly OnlyOnce: "ONLY_ONCE";
|
|
@@ -6020,6 +6077,7 @@ interface CreateWorkflowInput {
|
|
|
6020
6077
|
autoStart?: boolean;
|
|
6021
6078
|
schedules?: string[];
|
|
6022
6079
|
additionalData?: Record<string, unknown>;
|
|
6080
|
+
userPrompt?: string;
|
|
6023
6081
|
}
|
|
6024
6082
|
declare const TERMINAL_JOB_STATES: Set<JobStateEnum>;
|
|
6025
6083
|
declare const TERMINAL_RUN_STATES: Set<string>;
|
|
@@ -6075,6 +6133,7 @@ interface ExtractionOptionsInternal {
|
|
|
6075
6133
|
notifications?: NotificationOptions;
|
|
6076
6134
|
autoStart?: boolean;
|
|
6077
6135
|
additionalData?: Record<string, unknown>;
|
|
6136
|
+
userPrompt?: string;
|
|
6078
6137
|
}
|
|
6079
6138
|
type ExtractionOptions = {
|
|
6080
6139
|
urls: string[];
|
|
@@ -6250,7 +6309,7 @@ declare class SchemaBuilder {
|
|
|
6250
6309
|
|
|
6251
6310
|
interface ExtractOptionsInternal {
|
|
6252
6311
|
urls: string[];
|
|
6253
|
-
name
|
|
6312
|
+
name?: string;
|
|
6254
6313
|
description?: string;
|
|
6255
6314
|
navigationMode: NavigationMode;
|
|
6256
6315
|
entity: EntityConfig;
|
|
@@ -6259,6 +6318,7 @@ interface ExtractOptionsInternal {
|
|
|
6259
6318
|
schedules?: string[];
|
|
6260
6319
|
location?: LocationConfig;
|
|
6261
6320
|
additionalData?: Record<string, unknown>;
|
|
6321
|
+
userPrompt?: string;
|
|
6262
6322
|
}
|
|
6263
6323
|
interface ExtractOptions extends Omit<ExtractOptionsInternal, "navigationMode" | "entity"> {
|
|
6264
6324
|
navigationMode?: NavigationMode;
|
|
@@ -6277,6 +6337,7 @@ interface PreparedExtraction {
|
|
|
6277
6337
|
}) => PreparedExtraction;
|
|
6278
6338
|
bypassPreview: () => PreparedExtraction;
|
|
6279
6339
|
setLocation: (options: LocationConfig) => PreparedExtraction;
|
|
6340
|
+
withPrompt: (prompt: string) => PreparedExtraction;
|
|
6280
6341
|
create: () => Promise<CreatedExtraction>;
|
|
6281
6342
|
}
|
|
6282
6343
|
interface RunWorkflowOptions {
|
|
@@ -6314,6 +6375,7 @@ declare class ExtractionBuilderService {
|
|
|
6314
6375
|
private _jobId;
|
|
6315
6376
|
private _notificationOptions;
|
|
6316
6377
|
private _monitoringOptions;
|
|
6378
|
+
private _userPrompt;
|
|
6317
6379
|
get options(): ExtractOptionsInternal;
|
|
6318
6380
|
get notificationOptions(): NotificationOptions | undefined;
|
|
6319
6381
|
get monitoringOptions(): WorkflowMonitoringConfig | undefined;
|
|
@@ -6330,6 +6392,7 @@ declare class ExtractionBuilderService {
|
|
|
6330
6392
|
schedules: string[];
|
|
6331
6393
|
}): PreparedExtraction;
|
|
6332
6394
|
setLocation(options: LocationConfig): PreparedExtraction;
|
|
6395
|
+
withPrompt(prompt: string): PreparedExtraction;
|
|
6333
6396
|
create(): Promise<CreatedExtraction>;
|
|
6334
6397
|
waitForReady(options?: WaitForReadyOptions): Promise<GetWorkflowResponse>;
|
|
6335
6398
|
run(options?: RunWorkflowOptions): Promise<FinishedExtraction>;
|
package/dist/index.js
CHANGED
|
@@ -4427,19 +4427,41 @@ var ExtractionService = class {
|
|
|
4427
4427
|
);
|
|
4428
4428
|
}
|
|
4429
4429
|
let workflowId;
|
|
4430
|
-
const
|
|
4431
|
-
|
|
4432
|
-
{
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4430
|
+
const isAgenticNavigation = config.navigationMode === "agentic-navigation";
|
|
4431
|
+
if (isAgenticNavigation) {
|
|
4432
|
+
if (!config.userPrompt) {
|
|
4433
|
+
throw new KadoaSdkException(
|
|
4434
|
+
"userPrompt is required when navigationMode is 'agentic-navigation'",
|
|
4435
|
+
{
|
|
4436
|
+
code: "VALIDATION_ERROR",
|
|
4437
|
+
details: { navigationMode: config.navigationMode }
|
|
4438
|
+
}
|
|
4439
|
+
);
|
|
4436
4440
|
}
|
|
4437
|
-
|
|
4441
|
+
}
|
|
4442
|
+
let resolvedEntity;
|
|
4443
|
+
if (isAgenticNavigation) {
|
|
4444
|
+
const entityConfig = options.entity || "ai-detection";
|
|
4445
|
+
resolvedEntity = {
|
|
4446
|
+
entity: typeof entityConfig === "object" && "name" in entityConfig ? entityConfig.name : void 0,
|
|
4447
|
+
fields: typeof entityConfig === "object" && "fields" in entityConfig ? entityConfig.fields : []
|
|
4448
|
+
};
|
|
4449
|
+
} else {
|
|
4450
|
+
resolvedEntity = await this.entityResolverService.resolveEntity(
|
|
4451
|
+
options.entity || "ai-detection",
|
|
4452
|
+
{
|
|
4453
|
+
link: config.urls[0],
|
|
4454
|
+
location: config.location,
|
|
4455
|
+
navigationMode: config.navigationMode
|
|
4456
|
+
}
|
|
4457
|
+
);
|
|
4458
|
+
}
|
|
4438
4459
|
const hasNotifications = !!config.notifications;
|
|
4439
4460
|
const workflowRequest = {
|
|
4440
4461
|
...config,
|
|
4441
4462
|
fields: resolvedEntity.fields,
|
|
4442
|
-
...resolvedEntity.entity !== void 0 ? { entity: resolvedEntity.entity } : {}
|
|
4463
|
+
...resolvedEntity.entity !== void 0 ? { entity: resolvedEntity.entity } : {},
|
|
4464
|
+
...config.userPrompt ? { userPrompt: config.userPrompt } : {}
|
|
4443
4465
|
};
|
|
4444
4466
|
const result = await this.workflowsCoreService.create(workflowRequest);
|
|
4445
4467
|
workflowId = result.id;
|
|
@@ -4627,20 +4649,46 @@ var ExtractionBuilderService = class {
|
|
|
4627
4649
|
this._options.location = options;
|
|
4628
4650
|
return this;
|
|
4629
4651
|
}
|
|
4652
|
+
withPrompt(prompt) {
|
|
4653
|
+
assert__default.default(this._options, "Options are not set");
|
|
4654
|
+
this._userPrompt = prompt;
|
|
4655
|
+
this._options.userPrompt = prompt;
|
|
4656
|
+
return this;
|
|
4657
|
+
}
|
|
4630
4658
|
async create() {
|
|
4631
4659
|
assert__default.default(this._options, "Options are not set");
|
|
4632
4660
|
const { urls, name, description, navigationMode, entity } = this.options;
|
|
4661
|
+
const isAgenticNavigation = navigationMode === "agentic-navigation";
|
|
4662
|
+
if (isAgenticNavigation) {
|
|
4663
|
+
if (!this._userPrompt) {
|
|
4664
|
+
throw new KadoaSdkException(
|
|
4665
|
+
"userPrompt is required when navigationMode is 'agentic-navigation'",
|
|
4666
|
+
{
|
|
4667
|
+
code: "VALIDATION_ERROR",
|
|
4668
|
+
details: { navigationMode }
|
|
4669
|
+
}
|
|
4670
|
+
);
|
|
4671
|
+
}
|
|
4672
|
+
}
|
|
4633
4673
|
const isRealTime = this._options.interval === "REAL_TIME";
|
|
4634
4674
|
const useSelectorMode = isRealTime && entity === "ai-detection";
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
{
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4675
|
+
let resolvedEntity;
|
|
4676
|
+
if (isAgenticNavigation) {
|
|
4677
|
+
resolvedEntity = {
|
|
4678
|
+
entity: typeof entity === "object" && "name" in entity ? entity.name : void 0,
|
|
4679
|
+
fields: typeof entity === "object" && "fields" in entity ? entity.fields : []
|
|
4680
|
+
};
|
|
4681
|
+
} else {
|
|
4682
|
+
resolvedEntity = await this.entityResolverService.resolveEntity(
|
|
4683
|
+
entity,
|
|
4684
|
+
{
|
|
4685
|
+
link: urls[0],
|
|
4686
|
+
location: this._options.location,
|
|
4687
|
+
navigationMode,
|
|
4688
|
+
selectorMode: useSelectorMode
|
|
4689
|
+
}
|
|
4690
|
+
);
|
|
4691
|
+
}
|
|
4644
4692
|
const workflow = await this.workflowsCoreService.create({
|
|
4645
4693
|
urls,
|
|
4646
4694
|
name,
|
|
@@ -4654,7 +4702,8 @@ var ExtractionBuilderService = class {
|
|
|
4654
4702
|
interval: this._options.interval,
|
|
4655
4703
|
schedules: this._options.schedules,
|
|
4656
4704
|
additionalData: this._options.additionalData,
|
|
4657
|
-
bypassPreview: this._options.bypassPreview
|
|
4705
|
+
bypassPreview: this._options.bypassPreview,
|
|
4706
|
+
userPrompt: this._userPrompt
|
|
4658
4707
|
});
|
|
4659
4708
|
if (this._notificationOptions) {
|
|
4660
4709
|
await this.notificationSetupService.setup({
|
|
@@ -5178,7 +5227,7 @@ var WSS_API_URI = process.env.KADOA_WSS_API_URI ?? "wss://realtime.kadoa.com";
|
|
|
5178
5227
|
var REALTIME_API_URI = process.env.KADOA_REALTIME_API_URI ?? "https://realtime.kadoa.com";
|
|
5179
5228
|
|
|
5180
5229
|
// src/version.ts
|
|
5181
|
-
var SDK_VERSION = "0.
|
|
5230
|
+
var SDK_VERSION = "0.19.1";
|
|
5182
5231
|
var SDK_NAME = "kadoa-node-sdk";
|
|
5183
5232
|
var SDK_LANGUAGE = "node";
|
|
5184
5233
|
|
|
@@ -5783,6 +5832,48 @@ var WorkflowsCoreService = class {
|
|
|
5783
5832
|
async create(input) {
|
|
5784
5833
|
validateAdditionalData(input.additionalData);
|
|
5785
5834
|
const domainName = new URL(input.urls[0]).hostname;
|
|
5835
|
+
if (input.navigationMode === "agentic-navigation") {
|
|
5836
|
+
if (!input.userPrompt) {
|
|
5837
|
+
throw new KadoaSdkException(
|
|
5838
|
+
"userPrompt is required when navigationMode is 'agentic-navigation'",
|
|
5839
|
+
{
|
|
5840
|
+
code: "VALIDATION_ERROR",
|
|
5841
|
+
details: { navigationMode: input.navigationMode }
|
|
5842
|
+
}
|
|
5843
|
+
);
|
|
5844
|
+
}
|
|
5845
|
+
const agenticRequest = {
|
|
5846
|
+
urls: input.urls,
|
|
5847
|
+
navigationMode: "agentic-navigation",
|
|
5848
|
+
name: input.name ?? domainName,
|
|
5849
|
+
description: input.description,
|
|
5850
|
+
userPrompt: input.userPrompt,
|
|
5851
|
+
schemaId: input.schemaId,
|
|
5852
|
+
entity: input.entity,
|
|
5853
|
+
fields: input.fields,
|
|
5854
|
+
bypassPreview: input.bypassPreview ?? true,
|
|
5855
|
+
tags: input.tags,
|
|
5856
|
+
interval: input.interval,
|
|
5857
|
+
monitoring: input.monitoring,
|
|
5858
|
+
location: input.location,
|
|
5859
|
+
autoStart: input.autoStart,
|
|
5860
|
+
schedules: input.schedules,
|
|
5861
|
+
additionalData: input.additionalData
|
|
5862
|
+
};
|
|
5863
|
+
const response2 = await this.workflowsApi.v4WorkflowsPost({
|
|
5864
|
+
createWorkflowBody: agenticRequest
|
|
5865
|
+
});
|
|
5866
|
+
const workflowId2 = response2.data?.workflowId;
|
|
5867
|
+
if (!workflowId2) {
|
|
5868
|
+
throw new KadoaSdkException(ERROR_MESSAGES.NO_WORKFLOW_ID, {
|
|
5869
|
+
code: "INTERNAL_ERROR",
|
|
5870
|
+
details: {
|
|
5871
|
+
response: response2.data
|
|
5872
|
+
}
|
|
5873
|
+
});
|
|
5874
|
+
}
|
|
5875
|
+
return { id: workflowId2 };
|
|
5876
|
+
}
|
|
5786
5877
|
const request = {
|
|
5787
5878
|
urls: input.urls,
|
|
5788
5879
|
name: input.name ?? domainName,
|