@kadoa/node-sdk 0.11.0 → 0.12.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/README.md +225 -188
- package/dist/browser/index.global.js +13 -13
- package/dist/browser/index.global.js.map +1 -1
- package/dist/index.d.mts +1265 -813
- package/dist/index.d.ts +1265 -813
- package/dist/index.js +336 -153
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +336 -153
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2257,15 +2257,13 @@ var V5NotificationsSettingsGetEventTypeEnum = {
|
|
|
2257
2257
|
var SchemasApiAxiosParamCreator = function(configuration) {
|
|
2258
2258
|
return {
|
|
2259
2259
|
/**
|
|
2260
|
-
*
|
|
2261
|
-
* @summary
|
|
2262
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2263
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2260
|
+
* Retrieve all schemas accessible by the authenticated user
|
|
2261
|
+
* @summary List all schemas
|
|
2264
2262
|
* @param {*} [options] Override http request option.
|
|
2265
2263
|
* @throws {RequiredError}
|
|
2266
2264
|
*/
|
|
2267
|
-
v4SchemasGet: async (
|
|
2268
|
-
const localVarPath = `/v4/schemas
|
|
2265
|
+
v4SchemasGet: async (options = {}) => {
|
|
2266
|
+
const localVarPath = `/v4/schemas/`;
|
|
2269
2267
|
const localVarUrlObj = new url.URL(localVarPath, DUMMY_BASE_URL);
|
|
2270
2268
|
let baseOptions;
|
|
2271
2269
|
if (configuration) {
|
|
@@ -2275,13 +2273,6 @@ var SchemasApiAxiosParamCreator = function(configuration) {
|
|
|
2275
2273
|
const localVarHeaderParameter = {};
|
|
2276
2274
|
const localVarQueryParameter = {};
|
|
2277
2275
|
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
2278
|
-
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2279
|
-
if (xApiKey != null) {
|
|
2280
|
-
localVarHeaderParameter["x-api-key"] = String(xApiKey);
|
|
2281
|
-
}
|
|
2282
|
-
if (authorization != null) {
|
|
2283
|
-
localVarHeaderParameter["Authorization"] = String(authorization);
|
|
2284
|
-
}
|
|
2285
2276
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2286
2277
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2287
2278
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -2291,17 +2282,14 @@ var SchemasApiAxiosParamCreator = function(configuration) {
|
|
|
2291
2282
|
};
|
|
2292
2283
|
},
|
|
2293
2284
|
/**
|
|
2294
|
-
*
|
|
2295
|
-
* @summary Create
|
|
2296
|
-
* @param {
|
|
2297
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2298
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2285
|
+
* Create a new data schema with specified fields and entity type
|
|
2286
|
+
* @summary Create new schema
|
|
2287
|
+
* @param {CreateSchemaBody} [createSchemaBody] Body
|
|
2299
2288
|
* @param {*} [options] Override http request option.
|
|
2300
2289
|
* @throws {RequiredError}
|
|
2301
2290
|
*/
|
|
2302
|
-
v4SchemasPost: async (
|
|
2303
|
-
|
|
2304
|
-
const localVarPath = `/v4/schemas`;
|
|
2291
|
+
v4SchemasPost: async (createSchemaBody, options = {}) => {
|
|
2292
|
+
const localVarPath = `/v4/schemas/`;
|
|
2305
2293
|
const localVarUrlObj = new url.URL(localVarPath, DUMMY_BASE_URL);
|
|
2306
2294
|
let baseOptions;
|
|
2307
2295
|
if (configuration) {
|
|
@@ -2311,33 +2299,24 @@ var SchemasApiAxiosParamCreator = function(configuration) {
|
|
|
2311
2299
|
const localVarHeaderParameter = {};
|
|
2312
2300
|
const localVarQueryParameter = {};
|
|
2313
2301
|
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
2314
|
-
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2315
2302
|
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
2316
|
-
if (xApiKey != null) {
|
|
2317
|
-
localVarHeaderParameter["x-api-key"] = String(xApiKey);
|
|
2318
|
-
}
|
|
2319
|
-
if (authorization != null) {
|
|
2320
|
-
localVarHeaderParameter["Authorization"] = String(authorization);
|
|
2321
|
-
}
|
|
2322
2303
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2323
2304
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2324
2305
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
2325
|
-
localVarRequestOptions.data = serializeDataIfNeeded(
|
|
2306
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createSchemaBody, localVarRequestOptions, configuration);
|
|
2326
2307
|
return {
|
|
2327
2308
|
url: toPathString(localVarUrlObj),
|
|
2328
2309
|
options: localVarRequestOptions
|
|
2329
2310
|
};
|
|
2330
2311
|
},
|
|
2331
2312
|
/**
|
|
2332
|
-
*
|
|
2333
|
-
* @summary Delete
|
|
2334
|
-
* @param {string} schemaId ID
|
|
2335
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2336
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2313
|
+
* Delete a schema and all its revisions
|
|
2314
|
+
* @summary Delete schema
|
|
2315
|
+
* @param {string} schemaId Schema ID
|
|
2337
2316
|
* @param {*} [options] Override http request option.
|
|
2338
2317
|
* @throws {RequiredError}
|
|
2339
2318
|
*/
|
|
2340
|
-
v4SchemasSchemaIdDelete: async (schemaId,
|
|
2319
|
+
v4SchemasSchemaIdDelete: async (schemaId, options = {}) => {
|
|
2341
2320
|
assertParamExists("v4SchemasSchemaIdDelete", "schemaId", schemaId);
|
|
2342
2321
|
const localVarPath = `/v4/schemas/{schemaId}`.replace(`{${"schemaId"}}`, encodeURIComponent(String(schemaId)));
|
|
2343
2322
|
const localVarUrlObj = new url.URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -2349,13 +2328,6 @@ var SchemasApiAxiosParamCreator = function(configuration) {
|
|
|
2349
2328
|
const localVarHeaderParameter = {};
|
|
2350
2329
|
const localVarQueryParameter = {};
|
|
2351
2330
|
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
2352
|
-
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2353
|
-
if (xApiKey != null) {
|
|
2354
|
-
localVarHeaderParameter["x-api-key"] = String(xApiKey);
|
|
2355
|
-
}
|
|
2356
|
-
if (authorization != null) {
|
|
2357
|
-
localVarHeaderParameter["Authorization"] = String(authorization);
|
|
2358
|
-
}
|
|
2359
2331
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2360
2332
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2361
2333
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -2365,15 +2337,13 @@ var SchemasApiAxiosParamCreator = function(configuration) {
|
|
|
2365
2337
|
};
|
|
2366
2338
|
},
|
|
2367
2339
|
/**
|
|
2368
|
-
*
|
|
2369
|
-
* @summary Get
|
|
2370
|
-
* @param {string} schemaId ID
|
|
2371
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2372
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2340
|
+
* Retrieve a specific schema by its unique identifier
|
|
2341
|
+
* @summary Get schema by ID
|
|
2342
|
+
* @param {string} schemaId Schema ID
|
|
2373
2343
|
* @param {*} [options] Override http request option.
|
|
2374
2344
|
* @throws {RequiredError}
|
|
2375
2345
|
*/
|
|
2376
|
-
v4SchemasSchemaIdGet: async (schemaId,
|
|
2346
|
+
v4SchemasSchemaIdGet: async (schemaId, options = {}) => {
|
|
2377
2347
|
assertParamExists("v4SchemasSchemaIdGet", "schemaId", schemaId);
|
|
2378
2348
|
const localVarPath = `/v4/schemas/{schemaId}`.replace(`{${"schemaId"}}`, encodeURIComponent(String(schemaId)));
|
|
2379
2349
|
const localVarUrlObj = new url.URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -2385,13 +2355,6 @@ var SchemasApiAxiosParamCreator = function(configuration) {
|
|
|
2385
2355
|
const localVarHeaderParameter = {};
|
|
2386
2356
|
const localVarQueryParameter = {};
|
|
2387
2357
|
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
2388
|
-
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2389
|
-
if (xApiKey != null) {
|
|
2390
|
-
localVarHeaderParameter["x-api-key"] = String(xApiKey);
|
|
2391
|
-
}
|
|
2392
|
-
if (authorization != null) {
|
|
2393
|
-
localVarHeaderParameter["Authorization"] = String(authorization);
|
|
2394
|
-
}
|
|
2395
2358
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2396
2359
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2397
2360
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -2401,18 +2364,15 @@ var SchemasApiAxiosParamCreator = function(configuration) {
|
|
|
2401
2364
|
};
|
|
2402
2365
|
},
|
|
2403
2366
|
/**
|
|
2404
|
-
*
|
|
2405
|
-
* @summary Update
|
|
2406
|
-
* @param {string} schemaId ID
|
|
2407
|
-
* @param {
|
|
2408
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2409
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2367
|
+
* Update schema metadata or create a new revision with updated fields
|
|
2368
|
+
* @summary Update existing schema
|
|
2369
|
+
* @param {string} schemaId Schema ID
|
|
2370
|
+
* @param {UpdateSchemaBody} [updateSchemaBody] Body
|
|
2410
2371
|
* @param {*} [options] Override http request option.
|
|
2411
2372
|
* @throws {RequiredError}
|
|
2412
2373
|
*/
|
|
2413
|
-
v4SchemasSchemaIdPut: async (schemaId,
|
|
2374
|
+
v4SchemasSchemaIdPut: async (schemaId, updateSchemaBody, options = {}) => {
|
|
2414
2375
|
assertParamExists("v4SchemasSchemaIdPut", "schemaId", schemaId);
|
|
2415
|
-
assertParamExists("v4SchemasSchemaIdPut", "v4SchemasSchemaIdPutRequest", v4SchemasSchemaIdPutRequest);
|
|
2416
2376
|
const localVarPath = `/v4/schemas/{schemaId}`.replace(`{${"schemaId"}}`, encodeURIComponent(String(schemaId)));
|
|
2417
2377
|
const localVarUrlObj = new url.URL(localVarPath, DUMMY_BASE_URL);
|
|
2418
2378
|
let baseOptions;
|
|
@@ -2423,18 +2383,11 @@ var SchemasApiAxiosParamCreator = function(configuration) {
|
|
|
2423
2383
|
const localVarHeaderParameter = {};
|
|
2424
2384
|
const localVarQueryParameter = {};
|
|
2425
2385
|
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
2426
|
-
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2427
2386
|
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
2428
|
-
if (xApiKey != null) {
|
|
2429
|
-
localVarHeaderParameter["x-api-key"] = String(xApiKey);
|
|
2430
|
-
}
|
|
2431
|
-
if (authorization != null) {
|
|
2432
|
-
localVarHeaderParameter["Authorization"] = String(authorization);
|
|
2433
|
-
}
|
|
2434
2387
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2435
2388
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2436
2389
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
2437
|
-
localVarRequestOptions.data = serializeDataIfNeeded(
|
|
2390
|
+
localVarRequestOptions.data = serializeDataIfNeeded(updateSchemaBody, localVarRequestOptions, configuration);
|
|
2438
2391
|
return {
|
|
2439
2392
|
url: toPathString(localVarUrlObj),
|
|
2440
2393
|
options: localVarRequestOptions
|
|
@@ -2446,76 +2399,66 @@ var SchemasApiFp = function(configuration) {
|
|
|
2446
2399
|
const localVarAxiosParamCreator = SchemasApiAxiosParamCreator(configuration);
|
|
2447
2400
|
return {
|
|
2448
2401
|
/**
|
|
2449
|
-
*
|
|
2450
|
-
* @summary
|
|
2451
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2452
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2402
|
+
* Retrieve all schemas accessible by the authenticated user
|
|
2403
|
+
* @summary List all schemas
|
|
2453
2404
|
* @param {*} [options] Override http request option.
|
|
2454
2405
|
* @throws {RequiredError}
|
|
2455
2406
|
*/
|
|
2456
|
-
async v4SchemasGet(
|
|
2457
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasGet(
|
|
2407
|
+
async v4SchemasGet(options) {
|
|
2408
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasGet(options);
|
|
2458
2409
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2459
2410
|
const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasGet"]?.[localVarOperationServerIndex]?.url;
|
|
2460
2411
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5__default.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
2461
2412
|
},
|
|
2462
2413
|
/**
|
|
2463
|
-
*
|
|
2464
|
-
* @summary Create
|
|
2465
|
-
* @param {
|
|
2466
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2467
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2414
|
+
* Create a new data schema with specified fields and entity type
|
|
2415
|
+
* @summary Create new schema
|
|
2416
|
+
* @param {CreateSchemaBody} [createSchemaBody] Body
|
|
2468
2417
|
* @param {*} [options] Override http request option.
|
|
2469
2418
|
* @throws {RequiredError}
|
|
2470
2419
|
*/
|
|
2471
|
-
async v4SchemasPost(
|
|
2472
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasPost(
|
|
2420
|
+
async v4SchemasPost(createSchemaBody, options) {
|
|
2421
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasPost(createSchemaBody, options);
|
|
2473
2422
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2474
2423
|
const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasPost"]?.[localVarOperationServerIndex]?.url;
|
|
2475
2424
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5__default.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
2476
2425
|
},
|
|
2477
2426
|
/**
|
|
2478
|
-
*
|
|
2479
|
-
* @summary Delete
|
|
2480
|
-
* @param {string} schemaId ID
|
|
2481
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2482
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2427
|
+
* Delete a schema and all its revisions
|
|
2428
|
+
* @summary Delete schema
|
|
2429
|
+
* @param {string} schemaId Schema ID
|
|
2483
2430
|
* @param {*} [options] Override http request option.
|
|
2484
2431
|
* @throws {RequiredError}
|
|
2485
2432
|
*/
|
|
2486
|
-
async v4SchemasSchemaIdDelete(schemaId,
|
|
2487
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdDelete(schemaId,
|
|
2433
|
+
async v4SchemasSchemaIdDelete(schemaId, options) {
|
|
2434
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdDelete(schemaId, options);
|
|
2488
2435
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2489
2436
|
const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasSchemaIdDelete"]?.[localVarOperationServerIndex]?.url;
|
|
2490
2437
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5__default.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
2491
2438
|
},
|
|
2492
2439
|
/**
|
|
2493
|
-
*
|
|
2494
|
-
* @summary Get
|
|
2495
|
-
* @param {string} schemaId ID
|
|
2496
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2497
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2440
|
+
* Retrieve a specific schema by its unique identifier
|
|
2441
|
+
* @summary Get schema by ID
|
|
2442
|
+
* @param {string} schemaId Schema ID
|
|
2498
2443
|
* @param {*} [options] Override http request option.
|
|
2499
2444
|
* @throws {RequiredError}
|
|
2500
2445
|
*/
|
|
2501
|
-
async v4SchemasSchemaIdGet(schemaId,
|
|
2502
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdGet(schemaId,
|
|
2446
|
+
async v4SchemasSchemaIdGet(schemaId, options) {
|
|
2447
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdGet(schemaId, options);
|
|
2503
2448
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2504
2449
|
const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasSchemaIdGet"]?.[localVarOperationServerIndex]?.url;
|
|
2505
2450
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5__default.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
2506
2451
|
},
|
|
2507
2452
|
/**
|
|
2508
|
-
*
|
|
2509
|
-
* @summary Update
|
|
2510
|
-
* @param {string} schemaId ID
|
|
2511
|
-
* @param {
|
|
2512
|
-
* @param {string} [xApiKey] API key for authorization
|
|
2513
|
-
* @param {string} [authorization] Bearer token for authorization
|
|
2453
|
+
* Update schema metadata or create a new revision with updated fields
|
|
2454
|
+
* @summary Update existing schema
|
|
2455
|
+
* @param {string} schemaId Schema ID
|
|
2456
|
+
* @param {UpdateSchemaBody} [updateSchemaBody] Body
|
|
2514
2457
|
* @param {*} [options] Override http request option.
|
|
2515
2458
|
* @throws {RequiredError}
|
|
2516
2459
|
*/
|
|
2517
|
-
async v4SchemasSchemaIdPut(schemaId,
|
|
2518
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdPut(schemaId,
|
|
2460
|
+
async v4SchemasSchemaIdPut(schemaId, updateSchemaBody, options) {
|
|
2461
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdPut(schemaId, updateSchemaBody, options);
|
|
2519
2462
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2520
2463
|
const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasSchemaIdPut"]?.[localVarOperationServerIndex]?.url;
|
|
2521
2464
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5__default.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
@@ -2524,54 +2467,53 @@ var SchemasApiFp = function(configuration) {
|
|
|
2524
2467
|
};
|
|
2525
2468
|
var SchemasApi = class extends BaseAPI {
|
|
2526
2469
|
/**
|
|
2527
|
-
*
|
|
2528
|
-
* @summary
|
|
2529
|
-
* @param {SchemasApiV4SchemasGetRequest} requestParameters Request parameters.
|
|
2470
|
+
* Retrieve all schemas accessible by the authenticated user
|
|
2471
|
+
* @summary List all schemas
|
|
2530
2472
|
* @param {*} [options] Override http request option.
|
|
2531
2473
|
* @throws {RequiredError}
|
|
2532
2474
|
*/
|
|
2533
|
-
v4SchemasGet(
|
|
2534
|
-
return SchemasApiFp(this.configuration).v4SchemasGet(
|
|
2475
|
+
v4SchemasGet(options) {
|
|
2476
|
+
return SchemasApiFp(this.configuration).v4SchemasGet(options).then((request) => request(this.axios, this.basePath));
|
|
2535
2477
|
}
|
|
2536
2478
|
/**
|
|
2537
|
-
*
|
|
2538
|
-
* @summary Create
|
|
2479
|
+
* Create a new data schema with specified fields and entity type
|
|
2480
|
+
* @summary Create new schema
|
|
2539
2481
|
* @param {SchemasApiV4SchemasPostRequest} requestParameters Request parameters.
|
|
2540
2482
|
* @param {*} [options] Override http request option.
|
|
2541
2483
|
* @throws {RequiredError}
|
|
2542
2484
|
*/
|
|
2543
|
-
v4SchemasPost(requestParameters, options) {
|
|
2544
|
-
return SchemasApiFp(this.configuration).v4SchemasPost(requestParameters.
|
|
2485
|
+
v4SchemasPost(requestParameters = {}, options) {
|
|
2486
|
+
return SchemasApiFp(this.configuration).v4SchemasPost(requestParameters.createSchemaBody, options).then((request) => request(this.axios, this.basePath));
|
|
2545
2487
|
}
|
|
2546
2488
|
/**
|
|
2547
|
-
*
|
|
2548
|
-
* @summary Delete
|
|
2489
|
+
* Delete a schema and all its revisions
|
|
2490
|
+
* @summary Delete schema
|
|
2549
2491
|
* @param {SchemasApiV4SchemasSchemaIdDeleteRequest} requestParameters Request parameters.
|
|
2550
2492
|
* @param {*} [options] Override http request option.
|
|
2551
2493
|
* @throws {RequiredError}
|
|
2552
2494
|
*/
|
|
2553
2495
|
v4SchemasSchemaIdDelete(requestParameters, options) {
|
|
2554
|
-
return SchemasApiFp(this.configuration).v4SchemasSchemaIdDelete(requestParameters.schemaId,
|
|
2496
|
+
return SchemasApiFp(this.configuration).v4SchemasSchemaIdDelete(requestParameters.schemaId, options).then((request) => request(this.axios, this.basePath));
|
|
2555
2497
|
}
|
|
2556
2498
|
/**
|
|
2557
|
-
*
|
|
2558
|
-
* @summary Get
|
|
2499
|
+
* Retrieve a specific schema by its unique identifier
|
|
2500
|
+
* @summary Get schema by ID
|
|
2559
2501
|
* @param {SchemasApiV4SchemasSchemaIdGetRequest} requestParameters Request parameters.
|
|
2560
2502
|
* @param {*} [options] Override http request option.
|
|
2561
2503
|
* @throws {RequiredError}
|
|
2562
2504
|
*/
|
|
2563
2505
|
v4SchemasSchemaIdGet(requestParameters, options) {
|
|
2564
|
-
return SchemasApiFp(this.configuration).v4SchemasSchemaIdGet(requestParameters.schemaId,
|
|
2506
|
+
return SchemasApiFp(this.configuration).v4SchemasSchemaIdGet(requestParameters.schemaId, options).then((request) => request(this.axios, this.basePath));
|
|
2565
2507
|
}
|
|
2566
2508
|
/**
|
|
2567
|
-
*
|
|
2568
|
-
* @summary Update
|
|
2509
|
+
* Update schema metadata or create a new revision with updated fields
|
|
2510
|
+
* @summary Update existing schema
|
|
2569
2511
|
* @param {SchemasApiV4SchemasSchemaIdPutRequest} requestParameters Request parameters.
|
|
2570
2512
|
* @param {*} [options] Override http request option.
|
|
2571
2513
|
* @throws {RequiredError}
|
|
2572
2514
|
*/
|
|
2573
2515
|
v4SchemasSchemaIdPut(requestParameters, options) {
|
|
2574
|
-
return SchemasApiFp(this.configuration).v4SchemasSchemaIdPut(requestParameters.schemaId, requestParameters.
|
|
2516
|
+
return SchemasApiFp(this.configuration).v4SchemasSchemaIdPut(requestParameters.schemaId, requestParameters.updateSchemaBody, options).then((request) => request(this.axios, this.basePath));
|
|
2575
2517
|
}
|
|
2576
2518
|
};
|
|
2577
2519
|
var WorkflowsApiAxiosParamCreator = function(configuration) {
|
|
@@ -2732,15 +2674,14 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
|
|
|
2732
2674
|
};
|
|
2733
2675
|
},
|
|
2734
2676
|
/**
|
|
2735
|
-
*
|
|
2677
|
+
* Create a new workflow with schema, custom fields, or agentic navigation mode
|
|
2736
2678
|
* @summary Create a new workflow
|
|
2737
|
-
* @param {
|
|
2679
|
+
* @param {CreateWorkflowBody} [createWorkflowBody] Body
|
|
2738
2680
|
* @param {*} [options] Override http request option.
|
|
2739
2681
|
* @throws {RequiredError}
|
|
2740
2682
|
*/
|
|
2741
|
-
v4WorkflowsPost: async (
|
|
2742
|
-
|
|
2743
|
-
const localVarPath = `/v4/workflows`;
|
|
2683
|
+
v4WorkflowsPost: async (createWorkflowBody, options = {}) => {
|
|
2684
|
+
const localVarPath = `/v4/workflows/`;
|
|
2744
2685
|
const localVarUrlObj = new url.URL(localVarPath, DUMMY_BASE_URL);
|
|
2745
2686
|
let baseOptions;
|
|
2746
2687
|
if (configuration) {
|
|
@@ -2750,12 +2691,11 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
|
|
|
2750
2691
|
const localVarHeaderParameter = {};
|
|
2751
2692
|
const localVarQueryParameter = {};
|
|
2752
2693
|
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
2753
|
-
await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2754
2694
|
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
2755
2695
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2756
2696
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2757
2697
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
2758
|
-
localVarRequestOptions.data = serializeDataIfNeeded(
|
|
2698
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createWorkflowBody, localVarRequestOptions, configuration);
|
|
2759
2699
|
return {
|
|
2760
2700
|
url: toPathString(localVarUrlObj),
|
|
2761
2701
|
options: localVarRequestOptions
|
|
@@ -3525,14 +3465,14 @@ var WorkflowsApiFp = function(configuration) {
|
|
|
3525
3465
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5__default.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
3526
3466
|
},
|
|
3527
3467
|
/**
|
|
3528
|
-
*
|
|
3468
|
+
* Create a new workflow with schema, custom fields, or agentic navigation mode
|
|
3529
3469
|
* @summary Create a new workflow
|
|
3530
|
-
* @param {
|
|
3470
|
+
* @param {CreateWorkflowBody} [createWorkflowBody] Body
|
|
3531
3471
|
* @param {*} [options] Override http request option.
|
|
3532
3472
|
* @throws {RequiredError}
|
|
3533
3473
|
*/
|
|
3534
|
-
async v4WorkflowsPost(
|
|
3535
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsPost(
|
|
3474
|
+
async v4WorkflowsPost(createWorkflowBody, options) {
|
|
3475
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsPost(createWorkflowBody, options);
|
|
3536
3476
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
3537
3477
|
const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsPost"]?.[localVarOperationServerIndex]?.url;
|
|
3538
3478
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5__default.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
@@ -3869,14 +3809,14 @@ var WorkflowsApi = class extends BaseAPI {
|
|
|
3869
3809
|
return WorkflowsApiFp(this.configuration).v4WorkflowsGet(requestParameters.search, requestParameters.skip, requestParameters.limit, requestParameters.state, requestParameters.tags, requestParameters.monitoring, requestParameters.updateInterval, requestParameters.templateId, requestParameters.includeDeleted, requestParameters.format, options).then((request) => request(this.axios, this.basePath));
|
|
3870
3810
|
}
|
|
3871
3811
|
/**
|
|
3872
|
-
*
|
|
3812
|
+
* Create a new workflow with schema, custom fields, or agentic navigation mode
|
|
3873
3813
|
* @summary Create a new workflow
|
|
3874
3814
|
* @param {WorkflowsApiV4WorkflowsPostRequest} requestParameters Request parameters.
|
|
3875
3815
|
* @param {*} [options] Override http request option.
|
|
3876
3816
|
* @throws {RequiredError}
|
|
3877
3817
|
*/
|
|
3878
|
-
v4WorkflowsPost(requestParameters, options) {
|
|
3879
|
-
return WorkflowsApiFp(this.configuration).v4WorkflowsPost(requestParameters.
|
|
3818
|
+
v4WorkflowsPost(requestParameters = {}, options) {
|
|
3819
|
+
return WorkflowsApiFp(this.configuration).v4WorkflowsPost(requestParameters.createWorkflowBody, options).then((request) => request(this.axios, this.basePath));
|
|
3880
3820
|
}
|
|
3881
3821
|
/**
|
|
3882
3822
|
*
|
|
@@ -4114,7 +4054,7 @@ var Configuration = class {
|
|
|
4114
4054
|
};
|
|
4115
4055
|
|
|
4116
4056
|
// src/version.ts
|
|
4117
|
-
var SDK_VERSION = "0.
|
|
4057
|
+
var SDK_VERSION = "0.12.1";
|
|
4118
4058
|
var SDK_NAME = "kadoa-node-sdk";
|
|
4119
4059
|
var SDK_LANGUAGE = "node";
|
|
4120
4060
|
|
|
@@ -4336,7 +4276,15 @@ var ExtractionModule = class {
|
|
|
4336
4276
|
* @param options Extraction configuration options including optional notification settings
|
|
4337
4277
|
* @returns ExtractionResult containing workflow ID, workflow details, and first page of extracted data
|
|
4338
4278
|
*
|
|
4339
|
-
* @example
|
|
4279
|
+
* @example Simple extraction with AI detection
|
|
4280
|
+
* ```typescript
|
|
4281
|
+
* const result = await client.extraction.run({
|
|
4282
|
+
* urls: ['https://example.com'],
|
|
4283
|
+
* name: 'My Extraction'
|
|
4284
|
+
* });
|
|
4285
|
+
* ```
|
|
4286
|
+
*
|
|
4287
|
+
* @example With notifications
|
|
4340
4288
|
* ```typescript
|
|
4341
4289
|
* const result = await client.extraction.run({
|
|
4342
4290
|
* urls: ['https://example.com'],
|
|
@@ -4350,6 +4298,8 @@ var ExtractionModule = class {
|
|
|
4350
4298
|
* }
|
|
4351
4299
|
* });
|
|
4352
4300
|
* ```
|
|
4301
|
+
*
|
|
4302
|
+
* @see {@link KadoaClient.extract} For more flexible extraction configuration using the builder API
|
|
4353
4303
|
*/
|
|
4354
4304
|
async run(options) {
|
|
4355
4305
|
return await this.extractionService.executeExtraction({
|
|
@@ -4376,6 +4326,8 @@ var ExtractionModule = class {
|
|
|
4376
4326
|
* }
|
|
4377
4327
|
* });
|
|
4378
4328
|
* ```
|
|
4329
|
+
*
|
|
4330
|
+
* @see {@link KadoaClient.extract} For more flexible extraction configuration using the builder API
|
|
4379
4331
|
*/
|
|
4380
4332
|
async submit(options) {
|
|
4381
4333
|
return await this.extractionService.executeExtraction({
|
|
@@ -4738,13 +4690,7 @@ var ExtractionService = class {
|
|
|
4738
4690
|
const result = await this.workflowsCoreService.create({
|
|
4739
4691
|
...config,
|
|
4740
4692
|
entity: resolvedEntity.entity,
|
|
4741
|
-
fields: resolvedEntity.fields
|
|
4742
|
-
name: field.name,
|
|
4743
|
-
description: field.description,
|
|
4744
|
-
example: field.example,
|
|
4745
|
-
// todo: there is missmatch in kadoa-api so we need to cast
|
|
4746
|
-
dataType: field.dataType
|
|
4747
|
-
}))
|
|
4693
|
+
fields: resolvedEntity.fields
|
|
4748
4694
|
});
|
|
4749
4695
|
workflowId = result.id;
|
|
4750
4696
|
if (hasNotifications) {
|
|
@@ -5213,7 +5159,6 @@ var WorkflowsCoreService = class {
|
|
|
5213
5159
|
navigationMode: input.navigationMode,
|
|
5214
5160
|
entity: input.entity,
|
|
5215
5161
|
fields: input.fields,
|
|
5216
|
-
//todo: fix this
|
|
5217
5162
|
bypassPreview: input.bypassPreview ?? true,
|
|
5218
5163
|
tags: input.tags,
|
|
5219
5164
|
interval: input.interval,
|
|
@@ -5223,7 +5168,7 @@ var WorkflowsCoreService = class {
|
|
|
5223
5168
|
schedules: input.schedules
|
|
5224
5169
|
};
|
|
5225
5170
|
const response = await this.workflowsApi.v4WorkflowsPost({
|
|
5226
|
-
|
|
5171
|
+
createWorkflowBody: request
|
|
5227
5172
|
});
|
|
5228
5173
|
const workflowId = response.data?.workflowId;
|
|
5229
5174
|
if (!workflowId) {
|
|
@@ -5922,6 +5867,187 @@ var EntityResolverService = class {
|
|
|
5922
5867
|
}
|
|
5923
5868
|
}
|
|
5924
5869
|
};
|
|
5870
|
+
|
|
5871
|
+
// src/internal/domains/extraction/builders/extraction-builder.ts
|
|
5872
|
+
var ExtractionBuilder = class {
|
|
5873
|
+
constructor() {
|
|
5874
|
+
this.fields = [];
|
|
5875
|
+
}
|
|
5876
|
+
/**
|
|
5877
|
+
* Start defining a custom schema with fields
|
|
5878
|
+
* @param name - The entity name (e.g., "Product", "Article")
|
|
5879
|
+
*/
|
|
5880
|
+
schema(name) {
|
|
5881
|
+
if (this.schemaId) {
|
|
5882
|
+
throw new KadoaSdkException(
|
|
5883
|
+
"Cannot use schema() after useSchema() - they are mutually exclusive",
|
|
5884
|
+
{ code: "VALIDATION_ERROR" }
|
|
5885
|
+
);
|
|
5886
|
+
}
|
|
5887
|
+
this.schemaName = name;
|
|
5888
|
+
return new SchemaBuilder(this);
|
|
5889
|
+
}
|
|
5890
|
+
/**
|
|
5891
|
+
* Use an existing schema by ID
|
|
5892
|
+
* @param schemaId - The schema ID to reference
|
|
5893
|
+
*/
|
|
5894
|
+
useSchema(schemaId) {
|
|
5895
|
+
if (this.schemaName || this.fields.length > 0) {
|
|
5896
|
+
throw new KadoaSdkException(
|
|
5897
|
+
"Cannot use useSchema() after schema() or field definitions - they are mutually exclusive",
|
|
5898
|
+
{ code: "VALIDATION_ERROR" }
|
|
5899
|
+
);
|
|
5900
|
+
}
|
|
5901
|
+
this.schemaId = schemaId;
|
|
5902
|
+
return this;
|
|
5903
|
+
}
|
|
5904
|
+
/**
|
|
5905
|
+
* Extract raw page content without transformation
|
|
5906
|
+
* @param format - Raw content format(s): "html", "markdown", or "url"
|
|
5907
|
+
*/
|
|
5908
|
+
raw(format) {
|
|
5909
|
+
const formats = Array.isArray(format) ? format : [format];
|
|
5910
|
+
const nameMap = {
|
|
5911
|
+
html: "rawHtml",
|
|
5912
|
+
markdown: "rawMarkdown",
|
|
5913
|
+
url: "rawUrl"
|
|
5914
|
+
};
|
|
5915
|
+
const metadataKeyMap = {
|
|
5916
|
+
html: "HTML",
|
|
5917
|
+
markdown: "MARKDOWN",
|
|
5918
|
+
url: "PAGE_URL"
|
|
5919
|
+
};
|
|
5920
|
+
for (const f of formats) {
|
|
5921
|
+
const fieldName = nameMap[f];
|
|
5922
|
+
if (this.fields.some((field) => field.name === fieldName)) {
|
|
5923
|
+
continue;
|
|
5924
|
+
}
|
|
5925
|
+
this.fields.push({
|
|
5926
|
+
name: fieldName,
|
|
5927
|
+
description: `Raw page content in ${f.toUpperCase()} format`,
|
|
5928
|
+
fieldType: "METADATA",
|
|
5929
|
+
metadataKey: metadataKeyMap[f]
|
|
5930
|
+
});
|
|
5931
|
+
}
|
|
5932
|
+
return this;
|
|
5933
|
+
}
|
|
5934
|
+
/**
|
|
5935
|
+
* Get the fields array (internal use)
|
|
5936
|
+
*/
|
|
5937
|
+
getFields() {
|
|
5938
|
+
return this.fields;
|
|
5939
|
+
}
|
|
5940
|
+
/**
|
|
5941
|
+
* Get the schema name (internal use)
|
|
5942
|
+
*/
|
|
5943
|
+
getSchemaName() {
|
|
5944
|
+
return this.schemaName;
|
|
5945
|
+
}
|
|
5946
|
+
/**
|
|
5947
|
+
* Get the schema ID (internal use)
|
|
5948
|
+
*/
|
|
5949
|
+
getSchemaId() {
|
|
5950
|
+
return this.schemaId;
|
|
5951
|
+
}
|
|
5952
|
+
};
|
|
5953
|
+
var _SchemaBuilder = class _SchemaBuilder extends ExtractionBuilder {
|
|
5954
|
+
constructor(parentBuilder) {
|
|
5955
|
+
super();
|
|
5956
|
+
this.fields = parentBuilder.getFields();
|
|
5957
|
+
this.schemaName = parentBuilder.getSchemaName();
|
|
5958
|
+
this.schemaId = parentBuilder.getSchemaId();
|
|
5959
|
+
}
|
|
5960
|
+
/**
|
|
5961
|
+
* Add a structured field to the schema
|
|
5962
|
+
* @param name - Field name (alphanumeric only)
|
|
5963
|
+
* @param description - Field description
|
|
5964
|
+
* @param dataType - Data type (STRING, NUMBER, BOOLEAN, etc.)
|
|
5965
|
+
* @param options - Optional field configuration
|
|
5966
|
+
*/
|
|
5967
|
+
field(name, description, dataType, options) {
|
|
5968
|
+
if (!_SchemaBuilder.FIELD_NAME_PATTERN.test(name)) {
|
|
5969
|
+
throw new KadoaSdkException(
|
|
5970
|
+
`Field name "${name}" must be alphanumeric only (no underscores or special characters)`,
|
|
5971
|
+
{
|
|
5972
|
+
code: "VALIDATION_ERROR",
|
|
5973
|
+
details: { name, pattern: "^[A-Za-z0-9]+$" }
|
|
5974
|
+
}
|
|
5975
|
+
);
|
|
5976
|
+
}
|
|
5977
|
+
const lowerName = name.toLowerCase();
|
|
5978
|
+
if (this.fields.some((f) => f.name.toLowerCase() === lowerName)) {
|
|
5979
|
+
throw new KadoaSdkException(`Duplicate field name: "${name}"`, {
|
|
5980
|
+
code: "VALIDATION_ERROR",
|
|
5981
|
+
details: { name }
|
|
5982
|
+
});
|
|
5983
|
+
}
|
|
5984
|
+
const requiresExample = _SchemaBuilder.TYPES_REQUIRING_EXAMPLE.includes(dataType);
|
|
5985
|
+
if (requiresExample && !options?.example) {
|
|
5986
|
+
throw new KadoaSdkException(
|
|
5987
|
+
`Field "${name}" with type ${dataType} requires an example`,
|
|
5988
|
+
{ code: "VALIDATION_ERROR", details: { name, dataType } }
|
|
5989
|
+
);
|
|
5990
|
+
}
|
|
5991
|
+
this.fields.push({
|
|
5992
|
+
name,
|
|
5993
|
+
description,
|
|
5994
|
+
dataType,
|
|
5995
|
+
fieldType: "SCHEMA",
|
|
5996
|
+
example: options?.example,
|
|
5997
|
+
isKey: options?.isKey
|
|
5998
|
+
});
|
|
5999
|
+
return this;
|
|
6000
|
+
}
|
|
6001
|
+
/**
|
|
6002
|
+
* Add a classification field to categorize content
|
|
6003
|
+
* @param name - Field name (alphanumeric only)
|
|
6004
|
+
* @param description - Field description
|
|
6005
|
+
* @param categories - Array of category definitions
|
|
6006
|
+
*/
|
|
6007
|
+
classify(name, description, categories) {
|
|
6008
|
+
if (!_SchemaBuilder.FIELD_NAME_PATTERN.test(name)) {
|
|
6009
|
+
throw new KadoaSdkException(
|
|
6010
|
+
`Field name "${name}" must be alphanumeric only (no underscores or special characters)`,
|
|
6011
|
+
{
|
|
6012
|
+
code: "VALIDATION_ERROR",
|
|
6013
|
+
details: { name, pattern: "^[A-Za-z0-9]+$" }
|
|
6014
|
+
}
|
|
6015
|
+
);
|
|
6016
|
+
}
|
|
6017
|
+
const lowerName = name.toLowerCase();
|
|
6018
|
+
if (this.fields.some((f) => f.name.toLowerCase() === lowerName)) {
|
|
6019
|
+
throw new KadoaSdkException(`Duplicate field name: "${name}"`, {
|
|
6020
|
+
code: "VALIDATION_ERROR",
|
|
6021
|
+
details: { name }
|
|
6022
|
+
});
|
|
6023
|
+
}
|
|
6024
|
+
this.fields.push({
|
|
6025
|
+
name,
|
|
6026
|
+
description,
|
|
6027
|
+
fieldType: "CLASSIFICATION",
|
|
6028
|
+
categories
|
|
6029
|
+
});
|
|
6030
|
+
return this;
|
|
6031
|
+
}
|
|
6032
|
+
/**
|
|
6033
|
+
* Add raw page content alongside structured fields
|
|
6034
|
+
* @param format - Raw content format(s): "html", "markdown", or "url"
|
|
6035
|
+
*/
|
|
6036
|
+
raw(format) {
|
|
6037
|
+
return super.raw(format);
|
|
6038
|
+
}
|
|
6039
|
+
};
|
|
6040
|
+
_SchemaBuilder.FIELD_NAME_PATTERN = /^[A-Za-z0-9]+$/;
|
|
6041
|
+
_SchemaBuilder.TYPES_REQUIRING_EXAMPLE = [
|
|
6042
|
+
"STRING",
|
|
6043
|
+
"IMAGE",
|
|
6044
|
+
"LINK",
|
|
6045
|
+
"OBJECT",
|
|
6046
|
+
"ARRAY"
|
|
6047
|
+
];
|
|
6048
|
+
var SchemaBuilder = _SchemaBuilder;
|
|
6049
|
+
|
|
6050
|
+
// src/internal/domains/extraction/services/extraction-builder.service.ts
|
|
5925
6051
|
var debug7 = logger.extraction;
|
|
5926
6052
|
var ExtractionBuilderService = class {
|
|
5927
6053
|
constructor(workflowsCoreService, entityResolverService, dataFetcherService, notificationSetupService) {
|
|
@@ -5953,14 +6079,30 @@ var ExtractionBuilderService = class {
|
|
|
5953
6079
|
name,
|
|
5954
6080
|
description,
|
|
5955
6081
|
navigationMode,
|
|
5956
|
-
|
|
6082
|
+
extraction
|
|
5957
6083
|
}) {
|
|
6084
|
+
let entity = "ai-detection";
|
|
6085
|
+
if (extraction) {
|
|
6086
|
+
const builder = extraction(new ExtractionBuilder());
|
|
6087
|
+
const schemaId = builder.getSchemaId();
|
|
6088
|
+
const schemaName = builder.getSchemaName();
|
|
6089
|
+
const fields = builder.getFields();
|
|
6090
|
+
if (schemaId) {
|
|
6091
|
+
entity = { schemId: schemaId };
|
|
6092
|
+
} else if (schemaName && fields.length > 0) {
|
|
6093
|
+
entity = { name: schemaName, fields };
|
|
6094
|
+
} else if (fields.length > 0 && !schemaName) {
|
|
6095
|
+
entity = { name: "RawExtraction", fields };
|
|
6096
|
+
} else {
|
|
6097
|
+
entity = "ai-detection";
|
|
6098
|
+
}
|
|
6099
|
+
}
|
|
5958
6100
|
this._options = {
|
|
5959
6101
|
urls,
|
|
5960
6102
|
name,
|
|
5961
6103
|
description,
|
|
5962
6104
|
navigationMode: navigationMode || "single-page",
|
|
5963
|
-
entity
|
|
6105
|
+
entity,
|
|
5964
6106
|
bypassPreview: false
|
|
5965
6107
|
};
|
|
5966
6108
|
return this;
|
|
@@ -6001,6 +6143,12 @@ var ExtractionBuilderService = class {
|
|
|
6001
6143
|
location: this._options.location,
|
|
6002
6144
|
navigationMode
|
|
6003
6145
|
});
|
|
6146
|
+
if (!resolvedEntity) {
|
|
6147
|
+
throw new KadoaSdkException(ERROR_MESSAGES.ENTITY_FETCH_FAILED, {
|
|
6148
|
+
code: "VALIDATION_ERROR",
|
|
6149
|
+
details: { entity }
|
|
6150
|
+
});
|
|
6151
|
+
}
|
|
6004
6152
|
const workflow = await this.workflowsCoreService.create({
|
|
6005
6153
|
urls,
|
|
6006
6154
|
name,
|
|
@@ -6008,8 +6156,8 @@ var ExtractionBuilderService = class {
|
|
|
6008
6156
|
navigationMode,
|
|
6009
6157
|
monitoring: this._monitoringOptions,
|
|
6010
6158
|
schemaId: typeof entity === "object" && "schemId" in entity ? entity.schemId : void 0,
|
|
6011
|
-
entity: resolvedEntity
|
|
6012
|
-
fields: resolvedEntity
|
|
6159
|
+
entity: resolvedEntity.entity,
|
|
6160
|
+
fields: resolvedEntity.fields,
|
|
6013
6161
|
autoStart: false,
|
|
6014
6162
|
interval: this._options.interval,
|
|
6015
6163
|
schedules: this._options.schedules
|
|
@@ -6225,6 +6373,41 @@ var KadoaClient = class {
|
|
|
6225
6373
|
get realtime() {
|
|
6226
6374
|
return this._realtime;
|
|
6227
6375
|
}
|
|
6376
|
+
/**
|
|
6377
|
+
* Create a prepared extraction using the fluent builder API
|
|
6378
|
+
*
|
|
6379
|
+
* @param options - Extraction options including URLs and optional extraction builder
|
|
6380
|
+
* @returns PreparedExtraction that can be configured with notifications, monitoring, etc.
|
|
6381
|
+
*
|
|
6382
|
+
* @example Auto-detection
|
|
6383
|
+
* ```typescript
|
|
6384
|
+
* const extraction = await client.extract({
|
|
6385
|
+
* urls: ["https://example.com"],
|
|
6386
|
+
* name: "My Extraction"
|
|
6387
|
+
* }).create();
|
|
6388
|
+
* ```
|
|
6389
|
+
*
|
|
6390
|
+
* @example Raw extraction
|
|
6391
|
+
* ```typescript
|
|
6392
|
+
* const extraction = await client.extract({
|
|
6393
|
+
* urls: ["https://example.com"],
|
|
6394
|
+
* name: "My Extraction",
|
|
6395
|
+
* extraction: builder => builder.raw("markdown")
|
|
6396
|
+
* }).create();
|
|
6397
|
+
* ```
|
|
6398
|
+
*
|
|
6399
|
+
* @example Custom schema
|
|
6400
|
+
* ```typescript
|
|
6401
|
+
* const extraction = await client.extract({
|
|
6402
|
+
* urls: ["https://example.com"],
|
|
6403
|
+
* name: "My Extraction",
|
|
6404
|
+
* extraction: builder => builder
|
|
6405
|
+
* .schema("Product")
|
|
6406
|
+
* .field("title", "Product name", "STRING", { example: "Example" })
|
|
6407
|
+
* .field("price", "Product price", "CURRENCY")
|
|
6408
|
+
* }).create();
|
|
6409
|
+
* ```
|
|
6410
|
+
*/
|
|
6228
6411
|
extract(options) {
|
|
6229
6412
|
return this._extractionBuilderService.extract(options);
|
|
6230
6413
|
}
|