@kadoa/node-sdk 0.0.2

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.
@@ -0,0 +1,879 @@
1
+ import { AxiosInstance, AxiosError } from 'axios';
2
+ import { EventEmitter } from 'events';
3
+
4
+ /**
5
+ * Kadoa API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: 3.0.0
9
+ * Contact: support@kadoa.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ interface ConfigurationParameters {
16
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
17
+ username?: string;
18
+ password?: string;
19
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
20
+ basePath?: string;
21
+ serverIndex?: number;
22
+ baseOptions?: any;
23
+ formDataCtor?: new () => any;
24
+ }
25
+ declare class Configuration {
26
+ /**
27
+ * parameter for apiKey security
28
+ * @param name security name
29
+ * @memberof Configuration
30
+ */
31
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
32
+ /**
33
+ * parameter for basic security
34
+ *
35
+ * @type {string}
36
+ * @memberof Configuration
37
+ */
38
+ username?: string;
39
+ /**
40
+ * parameter for basic security
41
+ *
42
+ * @type {string}
43
+ * @memberof Configuration
44
+ */
45
+ password?: string;
46
+ /**
47
+ * parameter for oauth2 security
48
+ * @param name security name
49
+ * @param scopes oauth2 scope
50
+ * @memberof Configuration
51
+ */
52
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
53
+ /**
54
+ * override base path
55
+ *
56
+ * @type {string}
57
+ * @memberof Configuration
58
+ */
59
+ basePath?: string;
60
+ /**
61
+ * override server index
62
+ *
63
+ * @type {number}
64
+ * @memberof Configuration
65
+ */
66
+ serverIndex?: number;
67
+ /**
68
+ * base options for axios calls
69
+ *
70
+ * @type {any}
71
+ * @memberof Configuration
72
+ */
73
+ baseOptions?: any;
74
+ /**
75
+ * The FormData constructor that will be used to create multipart form data
76
+ * requests. You can inject this here so that execution environments that
77
+ * do not support the FormData class can still run the generated client.
78
+ *
79
+ * @type {new () => FormData}
80
+ */
81
+ formDataCtor?: new () => any;
82
+ constructor(param?: ConfigurationParameters);
83
+ /**
84
+ * Check if the given MIME is a JSON MIME.
85
+ * JSON MIME examples:
86
+ * application/json
87
+ * application/json; charset=UTF8
88
+ * APPLICATION/JSON
89
+ * application/vnd.company+json
90
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
91
+ * @return True if the given MIME is JSON, false otherwise.
92
+ */
93
+ isJsonMime(mime: string): boolean;
94
+ }
95
+
96
+ /**
97
+ * Kadoa API
98
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
99
+ *
100
+ * The version of the OpenAPI document: 3.0.0
101
+ * Contact: support@kadoa.com
102
+ *
103
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
104
+ * https://openapi-generator.tech
105
+ * Do not edit the class manually.
106
+ */
107
+ /**
108
+ * Scraping location configuration
109
+ * @export
110
+ * @interface V4WorkflowsGet200ResponseWorkflowsInnerLocation
111
+ */
112
+ interface V4WorkflowsGet200ResponseWorkflowsInnerLocation {
113
+ /**
114
+ *
115
+ * @type {string}
116
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerLocation
117
+ */
118
+ 'type'?: V4WorkflowsGet200ResponseWorkflowsInnerLocationTypeEnum;
119
+ /**
120
+ *
121
+ * @type {string}
122
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerLocation
123
+ */
124
+ 'isoCode'?: V4WorkflowsGet200ResponseWorkflowsInnerLocationIsoCodeEnum;
125
+ }
126
+ declare const V4WorkflowsGet200ResponseWorkflowsInnerLocationTypeEnum: {
127
+ readonly Auto: "auto";
128
+ readonly Manual: "manual";
129
+ };
130
+ type V4WorkflowsGet200ResponseWorkflowsInnerLocationTypeEnum = typeof V4WorkflowsGet200ResponseWorkflowsInnerLocationTypeEnum[keyof typeof V4WorkflowsGet200ResponseWorkflowsInnerLocationTypeEnum];
131
+ declare const V4WorkflowsGet200ResponseWorkflowsInnerLocationIsoCodeEnum: {
132
+ readonly De: "DE";
133
+ readonly Us: "US";
134
+ readonly Gb: "GB";
135
+ readonly Nl: "NL";
136
+ readonly Ca: "CA";
137
+ };
138
+ type V4WorkflowsGet200ResponseWorkflowsInnerLocationIsoCodeEnum = typeof V4WorkflowsGet200ResponseWorkflowsInnerLocationIsoCodeEnum[keyof typeof V4WorkflowsGet200ResponseWorkflowsInnerLocationIsoCodeEnum];
139
+
140
+ /**
141
+ * Kadoa API
142
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
143
+ *
144
+ * The version of the OpenAPI document: 3.0.0
145
+ * Contact: support@kadoa.com
146
+ *
147
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
148
+ * https://openapi-generator.tech
149
+ * Do not edit the class manually.
150
+ */
151
+ /**
152
+ *
153
+ * @export
154
+ * @interface V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInner
155
+ */
156
+ interface V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInner {
157
+ /**
158
+ *
159
+ * @type {string}
160
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInner
161
+ */
162
+ 'fieldName'?: string;
163
+ /**
164
+ *
165
+ * @type {string}
166
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInner
167
+ */
168
+ 'operator'?: V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInnerOperatorEnum;
169
+ }
170
+ declare const V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInnerOperatorEnum: {
171
+ readonly Changed: "changed";
172
+ readonly Added: "added";
173
+ readonly Removed: "removed";
174
+ };
175
+ type V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInnerOperatorEnum = typeof V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInnerOperatorEnum[keyof typeof V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInnerOperatorEnum];
176
+
177
+ /**
178
+ * Kadoa API
179
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
180
+ *
181
+ * The version of the OpenAPI document: 3.0.0
182
+ * Contact: support@kadoa.com
183
+ *
184
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
185
+ * https://openapi-generator.tech
186
+ * Do not edit the class manually.
187
+ */
188
+
189
+ /**
190
+ * Monitoring configuration
191
+ * @export
192
+ * @interface V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfig
193
+ */
194
+ interface V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfig {
195
+ /**
196
+ *
197
+ * @type {boolean}
198
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfig
199
+ */
200
+ 'enabled'?: boolean;
201
+ /**
202
+ *
203
+ * @type {Array<V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInner>}
204
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfig
205
+ */
206
+ 'fields'?: Array<V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfigFieldsInner>;
207
+ }
208
+
209
+ /**
210
+ * Kadoa API
211
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
212
+ *
213
+ * The version of the OpenAPI document: 3.0.0
214
+ * Contact: support@kadoa.com
215
+ *
216
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
217
+ * https://openapi-generator.tech
218
+ * Do not edit the class manually.
219
+ */
220
+ /**
221
+ *
222
+ * @export
223
+ * @interface V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner
224
+ */
225
+ interface V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner {
226
+ /**
227
+ *
228
+ * @type {string}
229
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner
230
+ */
231
+ 'name'?: string;
232
+ /**
233
+ *
234
+ * @type {string}
235
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner
236
+ */
237
+ 'description'?: string;
238
+ /**
239
+ *
240
+ * @type {string}
241
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner
242
+ */
243
+ 'example'?: string;
244
+ /**
245
+ *
246
+ * @type {string}
247
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner
248
+ */
249
+ 'dataType'?: V4WorkflowsGet200ResponseWorkflowsInnerSchemaInnerDataTypeEnum;
250
+ /**
251
+ *
252
+ * @type {boolean}
253
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner
254
+ */
255
+ 'isPrimaryKey'?: boolean;
256
+ /**
257
+ *
258
+ * @type {boolean}
259
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner
260
+ */
261
+ 'isRequired'?: boolean;
262
+ /**
263
+ *
264
+ * @type {boolean}
265
+ * @memberof V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner
266
+ */
267
+ 'isUnique'?: boolean;
268
+ }
269
+ declare const V4WorkflowsGet200ResponseWorkflowsInnerSchemaInnerDataTypeEnum: {
270
+ readonly String: "STRING";
271
+ readonly Number: "NUMBER";
272
+ readonly Boolean: "BOOLEAN";
273
+ readonly Date: "DATE";
274
+ readonly Datetime: "DATETIME";
275
+ readonly Currency: "CURRENCY";
276
+ readonly Image: "IMAGE";
277
+ readonly Link: "LINK";
278
+ readonly Object: "OBJECT";
279
+ readonly Array: "ARRAY";
280
+ };
281
+ type V4WorkflowsGet200ResponseWorkflowsInnerSchemaInnerDataTypeEnum = typeof V4WorkflowsGet200ResponseWorkflowsInnerSchemaInnerDataTypeEnum[keyof typeof V4WorkflowsGet200ResponseWorkflowsInnerSchemaInnerDataTypeEnum];
282
+
283
+ /**
284
+ * Kadoa API
285
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
286
+ *
287
+ * The version of the OpenAPI document: 3.0.0
288
+ * Contact: support@kadoa.com
289
+ *
290
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
291
+ * https://openapi-generator.tech
292
+ * Do not edit the class manually.
293
+ */
294
+
295
+ declare const WorkflowWithExistingSchemaNavigationModeEnum: {
296
+ readonly SinglePage: "single-page";
297
+ readonly PaginatedPage: "paginated-page";
298
+ readonly PageAndDetail: "page-and-detail";
299
+ readonly AgenticNavigation: "agentic-navigation";
300
+ };
301
+ type WorkflowWithExistingSchemaNavigationModeEnum = typeof WorkflowWithExistingSchemaNavigationModeEnum[keyof typeof WorkflowWithExistingSchemaNavigationModeEnum];
302
+
303
+ /**
304
+ * Kadoa API
305
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
306
+ *
307
+ * The version of the OpenAPI document: 3.0.0
308
+ * Contact: support@kadoa.com
309
+ *
310
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
311
+ * https://openapi-generator.tech
312
+ * Do not edit the class manually.
313
+ */
314
+ /**
315
+ *
316
+ * @export
317
+ * @interface V4WorkflowsWorkflowIdGet200ResponseDataLinking
318
+ */
319
+ interface V4WorkflowsWorkflowIdGet200ResponseDataLinking {
320
+ /**
321
+ *
322
+ * @type {boolean}
323
+ * @memberof V4WorkflowsWorkflowIdGet200ResponseDataLinking
324
+ */
325
+ 'enabled'?: boolean;
326
+ /**
327
+ *
328
+ * @type {Array<string>}
329
+ * @memberof V4WorkflowsWorkflowIdGet200ResponseDataLinking
330
+ */
331
+ 'linkingColumns'?: Array<string>;
332
+ }
333
+
334
+ /**
335
+ * Kadoa API
336
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
337
+ *
338
+ * The version of the OpenAPI document: 3.0.0
339
+ * Contact: support@kadoa.com
340
+ *
341
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
342
+ * https://openapi-generator.tech
343
+ * Do not edit the class manually.
344
+ */
345
+ /**
346
+ * Data validation configuration
347
+ * @export
348
+ * @interface V4WorkflowsWorkflowIdGet200ResponseDataValidation
349
+ */
350
+ interface V4WorkflowsWorkflowIdGet200ResponseDataValidation {
351
+ /**
352
+ * Whether data validation is enabled
353
+ * @type {boolean}
354
+ * @memberof V4WorkflowsWorkflowIdGet200ResponseDataValidation
355
+ */
356
+ 'enabled'?: boolean;
357
+ }
358
+
359
+ /**
360
+ * Kadoa API
361
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
362
+ *
363
+ * The version of the OpenAPI document: 3.0.0
364
+ * Contact: support@kadoa.com
365
+ *
366
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
367
+ * https://openapi-generator.tech
368
+ * Do not edit the class manually.
369
+ */
370
+ /**
371
+ * Validation statistics
372
+ * @export
373
+ * @interface V4WorkflowsWorkflowIdGet200ResponseValidationStatistics
374
+ */
375
+ interface V4WorkflowsWorkflowIdGet200ResponseValidationStatistics {
376
+ /**
377
+ * Overall validation score
378
+ * @type {number}
379
+ * @memberof V4WorkflowsWorkflowIdGet200ResponseValidationStatistics
380
+ */
381
+ 'count'?: number;
382
+ /**
383
+ * Change in validation score since last validation
384
+ * @type {number}
385
+ * @memberof V4WorkflowsWorkflowIdGet200ResponseValidationStatistics
386
+ */
387
+ 'change'?: number;
388
+ }
389
+
390
+ /**
391
+ * Kadoa API
392
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
393
+ *
394
+ * The version of the OpenAPI document: 3.0.0
395
+ * Contact: support@kadoa.com
396
+ *
397
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
398
+ * https://openapi-generator.tech
399
+ * Do not edit the class manually.
400
+ */
401
+
402
+ /**
403
+ *
404
+ * @export
405
+ * @interface V4WorkflowsWorkflowIdGet200Response
406
+ */
407
+ interface V4WorkflowsWorkflowIdGet200Response {
408
+ /**
409
+ * Unique identifier for the workflow
410
+ * @type {string}
411
+ * @memberof V4WorkflowsWorkflowIdGet200Response
412
+ */
413
+ '_id'?: string;
414
+ /**
415
+ * Name of the workflow
416
+ * @type {string}
417
+ * @memberof V4WorkflowsWorkflowIdGet200Response
418
+ */
419
+ 'name'?: string;
420
+ /**
421
+ * Description of the workflow
422
+ * @type {string}
423
+ * @memberof V4WorkflowsWorkflowIdGet200Response
424
+ */
425
+ 'description'?: string;
426
+ /**
427
+ * Current state of the workflow
428
+ * @type {string}
429
+ * @memberof V4WorkflowsWorkflowIdGet200Response
430
+ */
431
+ 'state'?: V4WorkflowsWorkflowIdGet200ResponseStateEnum;
432
+ /**
433
+ * Display state for frontend
434
+ * @type {string}
435
+ * @memberof V4WorkflowsWorkflowIdGet200Response
436
+ */
437
+ 'displayState'?: V4WorkflowsWorkflowIdGet200ResponseDisplayStateEnum;
438
+ /**
439
+ * ID of the user who owns the workflow
440
+ * @type {string}
441
+ * @memberof V4WorkflowsWorkflowIdGet200Response
442
+ */
443
+ 'userId'?: string;
444
+ /**
445
+ * Timestamp when the workflow was created
446
+ * @type {string}
447
+ * @memberof V4WorkflowsWorkflowIdGet200Response
448
+ */
449
+ 'createdAt'?: string;
450
+ /**
451
+ * Update frequency
452
+ * @type {string}
453
+ * @memberof V4WorkflowsWorkflowIdGet200Response
454
+ */
455
+ 'updateInterval'?: string;
456
+ /**
457
+ * Cron schedules for updates
458
+ * @type {Array<string>}
459
+ * @memberof V4WorkflowsWorkflowIdGet200Response
460
+ */
461
+ 'schedules'?: Array<string>;
462
+ /**
463
+ * Next scheduled execution time
464
+ * @type {string}
465
+ * @memberof V4WorkflowsWorkflowIdGet200Response
466
+ */
467
+ 'nextInvocation'?: string;
468
+ /**
469
+ * Whether monitoring is enabled
470
+ * @type {boolean}
471
+ * @memberof V4WorkflowsWorkflowIdGet200Response
472
+ */
473
+ 'monitoring'?: boolean;
474
+ /**
475
+ *
476
+ * @type {V4WorkflowsGet200ResponseWorkflowsInnerLocation}
477
+ * @memberof V4WorkflowsWorkflowIdGet200Response
478
+ */
479
+ 'location'?: V4WorkflowsGet200ResponseWorkflowsInnerLocation;
480
+ /**
481
+ * Tags associated with the workflow
482
+ * @type {Array<string>}
483
+ * @memberof V4WorkflowsWorkflowIdGet200Response
484
+ */
485
+ 'tags'?: Array<string>;
486
+ /**
487
+ * Name of the template used
488
+ * @type {string}
489
+ * @memberof V4WorkflowsWorkflowIdGet200Response
490
+ */
491
+ 'templateName'?: string;
492
+ /**
493
+ * ID of the template used
494
+ * @type {string}
495
+ * @memberof V4WorkflowsWorkflowIdGet200Response
496
+ */
497
+ 'templateId'?: string;
498
+ /**
499
+ * ID of the last job
500
+ * @type {string}
501
+ * @memberof V4WorkflowsWorkflowIdGet200Response
502
+ */
503
+ 'jobId'?: string;
504
+ /**
505
+ * When the last job finished
506
+ * @type {string}
507
+ * @memberof V4WorkflowsWorkflowIdGet200Response
508
+ */
509
+ 'finishedAt'?: string;
510
+ /**
511
+ * When the last job started
512
+ * @type {string}
513
+ * @memberof V4WorkflowsWorkflowIdGet200Response
514
+ */
515
+ 'startedAt'?: string;
516
+ /**
517
+ * Protocol information from last job
518
+ * @type {string}
519
+ * @memberof V4WorkflowsWorkflowIdGet200Response
520
+ */
521
+ 'protocol'?: string;
522
+ /**
523
+ * Database key for the workflow data
524
+ * @type {string}
525
+ * @memberof V4WorkflowsWorkflowIdGet200Response
526
+ */
527
+ 'dataKey'?: string;
528
+ /**
529
+ * Cost of the last job run in credits
530
+ * @type {number}
531
+ * @memberof V4WorkflowsWorkflowIdGet200Response
532
+ */
533
+ 'runCosts'?: number;
534
+ /**
535
+ * State of the last job run
536
+ * @type {string}
537
+ * @memberof V4WorkflowsWorkflowIdGet200Response
538
+ */
539
+ 'runState'?: string;
540
+ /**
541
+ * Total number of records extracted
542
+ * @type {number}
543
+ * @memberof V4WorkflowsWorkflowIdGet200Response
544
+ */
545
+ 'totalRecords'?: number;
546
+ /**
547
+ * Primary URL being scraped
548
+ * @type {string}
549
+ * @memberof V4WorkflowsWorkflowIdGet200Response
550
+ */
551
+ 'url'?: string;
552
+ /**
553
+ * List of URLs being scraped
554
+ * @type {Array<string>}
555
+ * @memberof V4WorkflowsWorkflowIdGet200Response
556
+ */
557
+ 'urls'?: Array<string>;
558
+ /**
559
+ * Extraction schema fields
560
+ * @type {Array<V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner>}
561
+ * @memberof V4WorkflowsWorkflowIdGet200Response
562
+ */
563
+ 'schema'?: Array<V4WorkflowsGet200ResponseWorkflowsInnerSchemaInner>;
564
+ /**
565
+ * Raw schema without processing
566
+ * @type {Array<object>}
567
+ * @memberof V4WorkflowsWorkflowIdGet200Response
568
+ */
569
+ 'rawSchema'?: Array<object>;
570
+ /**
571
+ * Type of schema (deprecated)
572
+ * @type {string}
573
+ * @memberof V4WorkflowsWorkflowIdGet200Response
574
+ */
575
+ 'schemaType'?: V4WorkflowsWorkflowIdGet200ResponseSchemaTypeEnum;
576
+ /**
577
+ * Entity information
578
+ * @type {object}
579
+ * @memberof V4WorkflowsWorkflowIdGet200Response
580
+ */
581
+ 'entity'?: object;
582
+ /**
583
+ * Whether the schema can be edited
584
+ * @type {boolean}
585
+ * @memberof V4WorkflowsWorkflowIdGet200Response
586
+ */
587
+ 'isSchemaEditable'?: boolean;
588
+ /**
589
+ * Maximum number of items to scrape
590
+ * @type {number}
591
+ * @memberof V4WorkflowsWorkflowIdGet200Response
592
+ */
593
+ 'limit'?: number;
594
+ /**
595
+ * Additional static data for the workflow
596
+ * @type {object}
597
+ * @memberof V4WorkflowsWorkflowIdGet200Response
598
+ */
599
+ 'additionalData'?: object;
600
+ /**
601
+ *
602
+ * @type {V4WorkflowsWorkflowIdGet200ResponseDataValidation}
603
+ * @memberof V4WorkflowsWorkflowIdGet200Response
604
+ */
605
+ 'dataValidation'?: V4WorkflowsWorkflowIdGet200ResponseDataValidation;
606
+ /**
607
+ * Columns configured for data linking
608
+ * @type {Array<string>}
609
+ * @memberof V4WorkflowsWorkflowIdGet200Response
610
+ */
611
+ 'linkingColumns'?: Array<string>;
612
+ /**
613
+ *
614
+ * @type {V4WorkflowsWorkflowIdGet200ResponseDataLinking}
615
+ * @memberof V4WorkflowsWorkflowIdGet200Response
616
+ */
617
+ 'dataLinking'?: V4WorkflowsWorkflowIdGet200ResponseDataLinking;
618
+ /**
619
+ *
620
+ * @type {V4WorkflowsWorkflowIdGet200ResponseValidationStatistics}
621
+ * @memberof V4WorkflowsWorkflowIdGet200Response
622
+ */
623
+ 'validationStatistics'?: V4WorkflowsWorkflowIdGet200ResponseValidationStatistics;
624
+ /**
625
+ *
626
+ * @type {V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfig}
627
+ * @memberof V4WorkflowsWorkflowIdGet200Response
628
+ */
629
+ 'notificationConfig'?: V4WorkflowsGet200ResponseWorkflowsInnerNotificationConfig;
630
+ }
631
+ declare const V4WorkflowsWorkflowIdGet200ResponseStateEnum: {
632
+ readonly Active: "ACTIVE";
633
+ readonly Error: "ERROR";
634
+ readonly Paused: "PAUSED";
635
+ readonly NotSupported: "NOT_SUPPORTED";
636
+ readonly Preview: "PREVIEW";
637
+ readonly ComplianceReview: "COMPLIANCE_REVIEW";
638
+ readonly ComplianceRejected: "COMPLIANCE_REJECTED";
639
+ readonly Queued: "QUEUED";
640
+ readonly Setup: "SETUP";
641
+ readonly Deleted: "DELETED";
642
+ };
643
+ type V4WorkflowsWorkflowIdGet200ResponseStateEnum = typeof V4WorkflowsWorkflowIdGet200ResponseStateEnum[keyof typeof V4WorkflowsWorkflowIdGet200ResponseStateEnum];
644
+ declare const V4WorkflowsWorkflowIdGet200ResponseDisplayStateEnum: {
645
+ readonly Active: "ACTIVE";
646
+ readonly Error: "ERROR";
647
+ readonly Paused: "PAUSED";
648
+ readonly NotSupported: "NOT_SUPPORTED";
649
+ readonly Preview: "PREVIEW";
650
+ readonly ComplianceReview: "COMPLIANCE_REVIEW";
651
+ readonly ComplianceRejected: "COMPLIANCE_REJECTED";
652
+ readonly Queued: "QUEUED";
653
+ readonly Setup: "SETUP";
654
+ readonly Running: "RUNNING";
655
+ };
656
+ type V4WorkflowsWorkflowIdGet200ResponseDisplayStateEnum = typeof V4WorkflowsWorkflowIdGet200ResponseDisplayStateEnum[keyof typeof V4WorkflowsWorkflowIdGet200ResponseDisplayStateEnum];
657
+ declare const V4WorkflowsWorkflowIdGet200ResponseSchemaTypeEnum: {
658
+ readonly Detail: "DETAIL";
659
+ readonly Directory: "DIRECTORY";
660
+ };
661
+ type V4WorkflowsWorkflowIdGet200ResponseSchemaTypeEnum = typeof V4WorkflowsWorkflowIdGet200ResponseSchemaTypeEnum[keyof typeof V4WorkflowsWorkflowIdGet200ResponseSchemaTypeEnum];
662
+
663
+ type EntityEventPayloads = {
664
+ "entity:detected": {
665
+ /** Name of the detected entity type (e.g., "Product", "Article", "Job Listing") */
666
+ entity: string;
667
+ /** Data fields detected for the entity */
668
+ fields: Array<{
669
+ name: string;
670
+ description: string;
671
+ example: string;
672
+ dataType: string | Record<string, unknown>;
673
+ isPrimaryKey?: boolean;
674
+ }>;
675
+ /** URL that was analyzed for entity detection */
676
+ url: string;
677
+ };
678
+ };
679
+ type ExtractionEventPayloads = {
680
+ "extraction:started": {
681
+ /** Unique ID of the extraction process */
682
+ workflowId: string;
683
+ /** Name given to this extraction */
684
+ name: string;
685
+ /** URLs to extract data from */
686
+ urls: string[];
687
+ };
688
+ "extraction:status_changed": {
689
+ /** Unique ID of the extraction process */
690
+ workflowId: string;
691
+ /** Previous processing state */
692
+ previousState?: string;
693
+ /** Previous execution status */
694
+ previousRunState?: string;
695
+ /** Current processing state */
696
+ currentState?: string;
697
+ /** Current execution status */
698
+ currentRunState?: string;
699
+ };
700
+ "extraction:data_available": {
701
+ /** Unique ID of the extraction process */
702
+ workflowId: string;
703
+ /** Number of data records retrieved */
704
+ recordCount: number;
705
+ /** Whether this is a partial data set */
706
+ isPartial: boolean;
707
+ };
708
+ "extraction:completed": {
709
+ /** Unique ID of the extraction process */
710
+ workflowId: string;
711
+ /** Whether the extraction completed successfully */
712
+ success: boolean;
713
+ /** Final execution status */
714
+ finalRunState?: string;
715
+ /** Final processing state */
716
+ finalState?: string;
717
+ /** Number of records extracted (if successful) */
718
+ recordCount?: number;
719
+ /** Error message (if failed) */
720
+ error?: string;
721
+ };
722
+ };
723
+ type EventPayloadMap = EntityEventPayloads & ExtractionEventPayloads;
724
+
725
+ /**
726
+ * Unified event structure with discriminated union
727
+ */
728
+ interface KadoaEvent<T extends keyof EventPayloadMap = keyof EventPayloadMap> {
729
+ /** Event type identifier */
730
+ type: T;
731
+ /** ISO timestamp when the event occurred */
732
+ timestamp: Date;
733
+ /** Module or component that emitted the event */
734
+ source: string;
735
+ /** Event-specific payload */
736
+ payload: EventPayloadMap[T];
737
+ /** Optional metadata for debugging and tracking */
738
+ metadata?: Record<string, unknown>;
739
+ }
740
+ /**
741
+ * Type aliases for convenience
742
+ */
743
+ type KadoaEventName = keyof EventPayloadMap;
744
+ type KadoaEventPayload<T extends KadoaEventName> = EventPayloadMap[T];
745
+ type AnyKadoaEvent = KadoaEvent<KadoaEventName>;
746
+ /**
747
+ * Simplified type-safe event emitter for Kadoa SDK events
748
+ */
749
+ declare class KadoaEventEmitter extends EventEmitter {
750
+ /**
751
+ * Emit a typed SDK event
752
+ */
753
+ emit<T extends KadoaEventName>(eventName: T, payload: EventPayloadMap[T], source?: string, metadata?: Record<string, unknown>): boolean;
754
+ /**
755
+ * Subscribe to SDK events
756
+ */
757
+ onEvent(listener: (event: AnyKadoaEvent) => void): this;
758
+ /**
759
+ * Subscribe to SDK events (once)
760
+ */
761
+ onceEvent(listener: (event: AnyKadoaEvent) => void): this;
762
+ /**
763
+ * Unsubscribe from SDK events
764
+ */
765
+ offEvent(listener: (event: AnyKadoaEvent) => void): this;
766
+ /**
767
+ * Remove all event listeners
768
+ */
769
+ removeAllEventListeners(): this;
770
+ }
771
+
772
+ interface KadoaSDK {
773
+ configuration: Configuration;
774
+ axiosInstance: AxiosInstance;
775
+ baseUrl: string;
776
+ events: KadoaEventEmitter;
777
+ emit: <T extends KadoaEventName>(eventName: T, payload: EventPayloadMap[T], source?: string, metadata?: Record<string, unknown>) => void;
778
+ onEvent: (listener: (event: AnyKadoaEvent) => void) => void;
779
+ offEvent: (listener: (event: AnyKadoaEvent) => void) => void;
780
+ }
781
+ interface KadoaConfig {
782
+ apiKey: string;
783
+ baseUrl?: string;
784
+ timeout?: number;
785
+ }
786
+ /**
787
+ * Initialize a Kadoa SDK instance
788
+ * @param config Configuration options for the Kadoa SDK
789
+ * @returns Initialized KadoaSDK instance
790
+ *
791
+ * @example
792
+ * ```typescript
793
+ * import { initializeApp } from '@kadoa/sdk';
794
+ *
795
+ * const sdkInstance = initializeApp({
796
+ * apiKey: 'your-api-key'
797
+ * });
798
+ * ```
799
+ */
800
+ declare function initializeSdk(config: KadoaConfig): KadoaSDK;
801
+ /**
802
+ * Dispose of a KadoaApp instance and clean up resources
803
+ * @param sdkInstance The KadoaApp instance to dispose
804
+ *
805
+ * @example
806
+ * ```typescript
807
+ * const sdkInstance = initializeSdk({ apiKey, enableEvents: true });
808
+ * // ... use the app
809
+ * dispose(sdkInstance); // Clean up when done
810
+ * ```
811
+ */
812
+ declare function dispose(sdkInstance: KadoaSDK): void;
813
+
814
+ type ExtractionOptions = {
815
+ urls: string[];
816
+ navigationMode?: WorkflowWithExistingSchemaNavigationModeEnum;
817
+ name?: string;
818
+ location?: {
819
+ type: string;
820
+ };
821
+ pollingInterval?: number;
822
+ maxWaitTime?: number;
823
+ };
824
+ type ExtractionResult = {
825
+ workflowId: string | undefined;
826
+ workflow?: V4WorkflowsWorkflowIdGet200Response;
827
+ data?: Array<object>;
828
+ };
829
+
830
+ /**
831
+ * Run extraction workflow using dynamic entity detection
832
+ */
833
+ declare function runExtraction(sdkInstance: KadoaSDK, options: ExtractionOptions): Promise<ExtractionResult>;
834
+
835
+ type KadoaErrorCode = "UNKNOWN" | "CONFIG_ERROR" | "AUTH_ERROR" | "VALIDATION_ERROR" | "NOT_FOUND" | "RATE_LIMITED" | "TIMEOUT" | "NETWORK_ERROR" | "HTTP_ERROR" | "INTERNAL_ERROR";
836
+ type KadoaSdkExceptionOptions = {
837
+ code?: KadoaErrorCode;
838
+ details?: Record<string, unknown>;
839
+ cause?: unknown;
840
+ };
841
+ declare class KadoaSdkException extends Error {
842
+ readonly code: KadoaErrorCode;
843
+ readonly details?: Record<string, unknown>;
844
+ readonly cause?: unknown;
845
+ constructor(message: string, options?: KadoaSdkExceptionOptions);
846
+ static from(error: unknown, details?: Record<string, unknown>): KadoaSdkException;
847
+ toJSON(): Record<string, unknown>;
848
+ toString(): string;
849
+ }
850
+
851
+ type KadoaHttpExceptionOptions = {
852
+ httpStatus?: number;
853
+ requestId?: string;
854
+ endpoint?: string;
855
+ method?: string;
856
+ responseBody?: unknown;
857
+ details?: Record<string, unknown>;
858
+ code?: KadoaErrorCode;
859
+ cause?: unknown;
860
+ };
861
+ declare class KadoaHttpException extends KadoaSdkException {
862
+ readonly httpStatus?: number;
863
+ readonly requestId?: string;
864
+ readonly endpoint?: string;
865
+ readonly method?: string;
866
+ readonly responseBody?: unknown;
867
+ constructor(message: string, options?: KadoaHttpExceptionOptions);
868
+ static fromAxiosError(error: AxiosError, extra?: {
869
+ message?: string;
870
+ details?: Record<string, unknown>;
871
+ }): KadoaHttpException;
872
+ toJSON(): Record<string, unknown>;
873
+ private static mapStatusToCode;
874
+ }
875
+
876
+ declare function isKadoaSdkException(error: unknown): error is KadoaSdkException;
877
+ declare function isKadoaHttpException(error: unknown): error is KadoaHttpException;
878
+
879
+ export { type AnyKadoaEvent, type ExtractionOptions, type ExtractionResult, type KadoaConfig, type KadoaErrorCode, type KadoaEvent, KadoaEventEmitter, type KadoaEventName, type KadoaEventPayload, KadoaHttpException, type KadoaHttpExceptionOptions, type KadoaSDK, KadoaSdkException, type KadoaSdkExceptionOptions, dispose, initializeSdk, isKadoaHttpException, isKadoaSdkException, runExtraction };