@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/dist/index.mjs CHANGED
@@ -2249,15 +2249,13 @@ var V5NotificationsSettingsGetEventTypeEnum = {
2249
2249
  var SchemasApiAxiosParamCreator = function(configuration) {
2250
2250
  return {
2251
2251
  /**
2252
- *
2253
- * @summary Get all schemas
2254
- * @param {string} [xApiKey] API key for authorization
2255
- * @param {string} [authorization] Bearer token for authorization
2252
+ * Retrieve all schemas accessible by the authenticated user
2253
+ * @summary List all schemas
2256
2254
  * @param {*} [options] Override http request option.
2257
2255
  * @throws {RequiredError}
2258
2256
  */
2259
- v4SchemasGet: async (xApiKey, authorization, options = {}) => {
2260
- const localVarPath = `/v4/schemas`;
2257
+ v4SchemasGet: async (options = {}) => {
2258
+ const localVarPath = `/v4/schemas/`;
2261
2259
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2262
2260
  let baseOptions;
2263
2261
  if (configuration) {
@@ -2267,13 +2265,6 @@ var SchemasApiAxiosParamCreator = function(configuration) {
2267
2265
  const localVarHeaderParameter = {};
2268
2266
  const localVarQueryParameter = {};
2269
2267
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
2270
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
2271
- if (xApiKey != null) {
2272
- localVarHeaderParameter["x-api-key"] = String(xApiKey);
2273
- }
2274
- if (authorization != null) {
2275
- localVarHeaderParameter["Authorization"] = String(authorization);
2276
- }
2277
2268
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2278
2269
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2279
2270
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -2283,17 +2274,14 @@ var SchemasApiAxiosParamCreator = function(configuration) {
2283
2274
  };
2284
2275
  },
2285
2276
  /**
2286
- *
2287
- * @summary Create a new schema
2288
- * @param {V4SchemasPostRequest} v4SchemasPostRequest
2289
- * @param {string} [xApiKey] API key for authorization
2290
- * @param {string} [authorization] Bearer token for authorization
2277
+ * Create a new data schema with specified fields and entity type
2278
+ * @summary Create new schema
2279
+ * @param {CreateSchemaBody} [createSchemaBody] Body
2291
2280
  * @param {*} [options] Override http request option.
2292
2281
  * @throws {RequiredError}
2293
2282
  */
2294
- v4SchemasPost: async (v4SchemasPostRequest, xApiKey, authorization, options = {}) => {
2295
- assertParamExists("v4SchemasPost", "v4SchemasPostRequest", v4SchemasPostRequest);
2296
- const localVarPath = `/v4/schemas`;
2283
+ v4SchemasPost: async (createSchemaBody, options = {}) => {
2284
+ const localVarPath = `/v4/schemas/`;
2297
2285
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2298
2286
  let baseOptions;
2299
2287
  if (configuration) {
@@ -2303,33 +2291,24 @@ var SchemasApiAxiosParamCreator = function(configuration) {
2303
2291
  const localVarHeaderParameter = {};
2304
2292
  const localVarQueryParameter = {};
2305
2293
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
2306
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
2307
2294
  localVarHeaderParameter["Content-Type"] = "application/json";
2308
- if (xApiKey != null) {
2309
- localVarHeaderParameter["x-api-key"] = String(xApiKey);
2310
- }
2311
- if (authorization != null) {
2312
- localVarHeaderParameter["Authorization"] = String(authorization);
2313
- }
2314
2295
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2315
2296
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2316
2297
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2317
- localVarRequestOptions.data = serializeDataIfNeeded(v4SchemasPostRequest, localVarRequestOptions, configuration);
2298
+ localVarRequestOptions.data = serializeDataIfNeeded(createSchemaBody, localVarRequestOptions, configuration);
2318
2299
  return {
2319
2300
  url: toPathString(localVarUrlObj),
2320
2301
  options: localVarRequestOptions
2321
2302
  };
2322
2303
  },
2323
2304
  /**
2324
- *
2325
- * @summary Delete a schema
2326
- * @param {string} schemaId ID of the schema to delete
2327
- * @param {string} [xApiKey] API key for authorization
2328
- * @param {string} [authorization] Bearer token for authorization
2305
+ * Delete a schema and all its revisions
2306
+ * @summary Delete schema
2307
+ * @param {string} schemaId Schema ID
2329
2308
  * @param {*} [options] Override http request option.
2330
2309
  * @throws {RequiredError}
2331
2310
  */
2332
- v4SchemasSchemaIdDelete: async (schemaId, xApiKey, authorization, options = {}) => {
2311
+ v4SchemasSchemaIdDelete: async (schemaId, options = {}) => {
2333
2312
  assertParamExists("v4SchemasSchemaIdDelete", "schemaId", schemaId);
2334
2313
  const localVarPath = `/v4/schemas/{schemaId}`.replace(`{${"schemaId"}}`, encodeURIComponent(String(schemaId)));
2335
2314
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -2341,13 +2320,6 @@ var SchemasApiAxiosParamCreator = function(configuration) {
2341
2320
  const localVarHeaderParameter = {};
2342
2321
  const localVarQueryParameter = {};
2343
2322
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
2344
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
2345
- if (xApiKey != null) {
2346
- localVarHeaderParameter["x-api-key"] = String(xApiKey);
2347
- }
2348
- if (authorization != null) {
2349
- localVarHeaderParameter["Authorization"] = String(authorization);
2350
- }
2351
2323
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2352
2324
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2353
2325
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -2357,15 +2329,13 @@ var SchemasApiAxiosParamCreator = function(configuration) {
2357
2329
  };
2358
2330
  },
2359
2331
  /**
2360
- *
2361
- * @summary Get a specific schema by ID
2362
- * @param {string} schemaId ID of the schema to retrieve
2363
- * @param {string} [xApiKey] API key for authorization
2364
- * @param {string} [authorization] Bearer token for authorization
2332
+ * Retrieve a specific schema by its unique identifier
2333
+ * @summary Get schema by ID
2334
+ * @param {string} schemaId Schema ID
2365
2335
  * @param {*} [options] Override http request option.
2366
2336
  * @throws {RequiredError}
2367
2337
  */
2368
- v4SchemasSchemaIdGet: async (schemaId, xApiKey, authorization, options = {}) => {
2338
+ v4SchemasSchemaIdGet: async (schemaId, options = {}) => {
2369
2339
  assertParamExists("v4SchemasSchemaIdGet", "schemaId", schemaId);
2370
2340
  const localVarPath = `/v4/schemas/{schemaId}`.replace(`{${"schemaId"}}`, encodeURIComponent(String(schemaId)));
2371
2341
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -2377,13 +2347,6 @@ var SchemasApiAxiosParamCreator = function(configuration) {
2377
2347
  const localVarHeaderParameter = {};
2378
2348
  const localVarQueryParameter = {};
2379
2349
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
2380
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
2381
- if (xApiKey != null) {
2382
- localVarHeaderParameter["x-api-key"] = String(xApiKey);
2383
- }
2384
- if (authorization != null) {
2385
- localVarHeaderParameter["Authorization"] = String(authorization);
2386
- }
2387
2350
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2388
2351
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2389
2352
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -2393,18 +2356,15 @@ var SchemasApiAxiosParamCreator = function(configuration) {
2393
2356
  };
2394
2357
  },
2395
2358
  /**
2396
- *
2397
- * @summary Update an existing schema
2398
- * @param {string} schemaId ID of the schema to update
2399
- * @param {V4SchemasSchemaIdPutRequest} v4SchemasSchemaIdPutRequest
2400
- * @param {string} [xApiKey] API key for authorization
2401
- * @param {string} [authorization] Bearer token for authorization
2359
+ * Update schema metadata or create a new revision with updated fields
2360
+ * @summary Update existing schema
2361
+ * @param {string} schemaId Schema ID
2362
+ * @param {UpdateSchemaBody} [updateSchemaBody] Body
2402
2363
  * @param {*} [options] Override http request option.
2403
2364
  * @throws {RequiredError}
2404
2365
  */
2405
- v4SchemasSchemaIdPut: async (schemaId, v4SchemasSchemaIdPutRequest, xApiKey, authorization, options = {}) => {
2366
+ v4SchemasSchemaIdPut: async (schemaId, updateSchemaBody, options = {}) => {
2406
2367
  assertParamExists("v4SchemasSchemaIdPut", "schemaId", schemaId);
2407
- assertParamExists("v4SchemasSchemaIdPut", "v4SchemasSchemaIdPutRequest", v4SchemasSchemaIdPutRequest);
2408
2368
  const localVarPath = `/v4/schemas/{schemaId}`.replace(`{${"schemaId"}}`, encodeURIComponent(String(schemaId)));
2409
2369
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2410
2370
  let baseOptions;
@@ -2415,18 +2375,11 @@ var SchemasApiAxiosParamCreator = function(configuration) {
2415
2375
  const localVarHeaderParameter = {};
2416
2376
  const localVarQueryParameter = {};
2417
2377
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
2418
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
2419
2378
  localVarHeaderParameter["Content-Type"] = "application/json";
2420
- if (xApiKey != null) {
2421
- localVarHeaderParameter["x-api-key"] = String(xApiKey);
2422
- }
2423
- if (authorization != null) {
2424
- localVarHeaderParameter["Authorization"] = String(authorization);
2425
- }
2426
2379
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2427
2380
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2428
2381
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2429
- localVarRequestOptions.data = serializeDataIfNeeded(v4SchemasSchemaIdPutRequest, localVarRequestOptions, configuration);
2382
+ localVarRequestOptions.data = serializeDataIfNeeded(updateSchemaBody, localVarRequestOptions, configuration);
2430
2383
  return {
2431
2384
  url: toPathString(localVarUrlObj),
2432
2385
  options: localVarRequestOptions
@@ -2438,76 +2391,66 @@ var SchemasApiFp = function(configuration) {
2438
2391
  const localVarAxiosParamCreator = SchemasApiAxiosParamCreator(configuration);
2439
2392
  return {
2440
2393
  /**
2441
- *
2442
- * @summary Get all schemas
2443
- * @param {string} [xApiKey] API key for authorization
2444
- * @param {string} [authorization] Bearer token for authorization
2394
+ * Retrieve all schemas accessible by the authenticated user
2395
+ * @summary List all schemas
2445
2396
  * @param {*} [options] Override http request option.
2446
2397
  * @throws {RequiredError}
2447
2398
  */
2448
- async v4SchemasGet(xApiKey, authorization, options) {
2449
- const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasGet(xApiKey, authorization, options);
2399
+ async v4SchemasGet(options) {
2400
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasGet(options);
2450
2401
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2451
2402
  const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasGet"]?.[localVarOperationServerIndex]?.url;
2452
2403
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
2453
2404
  },
2454
2405
  /**
2455
- *
2456
- * @summary Create a new schema
2457
- * @param {V4SchemasPostRequest} v4SchemasPostRequest
2458
- * @param {string} [xApiKey] API key for authorization
2459
- * @param {string} [authorization] Bearer token for authorization
2406
+ * Create a new data schema with specified fields and entity type
2407
+ * @summary Create new schema
2408
+ * @param {CreateSchemaBody} [createSchemaBody] Body
2460
2409
  * @param {*} [options] Override http request option.
2461
2410
  * @throws {RequiredError}
2462
2411
  */
2463
- async v4SchemasPost(v4SchemasPostRequest, xApiKey, authorization, options) {
2464
- const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasPost(v4SchemasPostRequest, xApiKey, authorization, options);
2412
+ async v4SchemasPost(createSchemaBody, options) {
2413
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasPost(createSchemaBody, options);
2465
2414
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2466
2415
  const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasPost"]?.[localVarOperationServerIndex]?.url;
2467
2416
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
2468
2417
  },
2469
2418
  /**
2470
- *
2471
- * @summary Delete a schema
2472
- * @param {string} schemaId ID of the schema to delete
2473
- * @param {string} [xApiKey] API key for authorization
2474
- * @param {string} [authorization] Bearer token for authorization
2419
+ * Delete a schema and all its revisions
2420
+ * @summary Delete schema
2421
+ * @param {string} schemaId Schema ID
2475
2422
  * @param {*} [options] Override http request option.
2476
2423
  * @throws {RequiredError}
2477
2424
  */
2478
- async v4SchemasSchemaIdDelete(schemaId, xApiKey, authorization, options) {
2479
- const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdDelete(schemaId, xApiKey, authorization, options);
2425
+ async v4SchemasSchemaIdDelete(schemaId, options) {
2426
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdDelete(schemaId, options);
2480
2427
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2481
2428
  const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasSchemaIdDelete"]?.[localVarOperationServerIndex]?.url;
2482
2429
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
2483
2430
  },
2484
2431
  /**
2485
- *
2486
- * @summary Get a specific schema by ID
2487
- * @param {string} schemaId ID of the schema to retrieve
2488
- * @param {string} [xApiKey] API key for authorization
2489
- * @param {string} [authorization] Bearer token for authorization
2432
+ * Retrieve a specific schema by its unique identifier
2433
+ * @summary Get schema by ID
2434
+ * @param {string} schemaId Schema ID
2490
2435
  * @param {*} [options] Override http request option.
2491
2436
  * @throws {RequiredError}
2492
2437
  */
2493
- async v4SchemasSchemaIdGet(schemaId, xApiKey, authorization, options) {
2494
- const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdGet(schemaId, xApiKey, authorization, options);
2438
+ async v4SchemasSchemaIdGet(schemaId, options) {
2439
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdGet(schemaId, options);
2495
2440
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2496
2441
  const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasSchemaIdGet"]?.[localVarOperationServerIndex]?.url;
2497
2442
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
2498
2443
  },
2499
2444
  /**
2500
- *
2501
- * @summary Update an existing schema
2502
- * @param {string} schemaId ID of the schema to update
2503
- * @param {V4SchemasSchemaIdPutRequest} v4SchemasSchemaIdPutRequest
2504
- * @param {string} [xApiKey] API key for authorization
2505
- * @param {string} [authorization] Bearer token for authorization
2445
+ * Update schema metadata or create a new revision with updated fields
2446
+ * @summary Update existing schema
2447
+ * @param {string} schemaId Schema ID
2448
+ * @param {UpdateSchemaBody} [updateSchemaBody] Body
2506
2449
  * @param {*} [options] Override http request option.
2507
2450
  * @throws {RequiredError}
2508
2451
  */
2509
- async v4SchemasSchemaIdPut(schemaId, v4SchemasSchemaIdPutRequest, xApiKey, authorization, options) {
2510
- const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdPut(schemaId, v4SchemasSchemaIdPutRequest, xApiKey, authorization, options);
2452
+ async v4SchemasSchemaIdPut(schemaId, updateSchemaBody, options) {
2453
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4SchemasSchemaIdPut(schemaId, updateSchemaBody, options);
2511
2454
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
2512
2455
  const localVarOperationServerBasePath = operationServerMap["SchemasApi.v4SchemasSchemaIdPut"]?.[localVarOperationServerIndex]?.url;
2513
2456
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
@@ -2516,54 +2459,53 @@ var SchemasApiFp = function(configuration) {
2516
2459
  };
2517
2460
  var SchemasApi = class extends BaseAPI {
2518
2461
  /**
2519
- *
2520
- * @summary Get all schemas
2521
- * @param {SchemasApiV4SchemasGetRequest} requestParameters Request parameters.
2462
+ * Retrieve all schemas accessible by the authenticated user
2463
+ * @summary List all schemas
2522
2464
  * @param {*} [options] Override http request option.
2523
2465
  * @throws {RequiredError}
2524
2466
  */
2525
- v4SchemasGet(requestParameters = {}, options) {
2526
- return SchemasApiFp(this.configuration).v4SchemasGet(requestParameters.xApiKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2467
+ v4SchemasGet(options) {
2468
+ return SchemasApiFp(this.configuration).v4SchemasGet(options).then((request) => request(this.axios, this.basePath));
2527
2469
  }
2528
2470
  /**
2529
- *
2530
- * @summary Create a new schema
2471
+ * Create a new data schema with specified fields and entity type
2472
+ * @summary Create new schema
2531
2473
  * @param {SchemasApiV4SchemasPostRequest} requestParameters Request parameters.
2532
2474
  * @param {*} [options] Override http request option.
2533
2475
  * @throws {RequiredError}
2534
2476
  */
2535
- v4SchemasPost(requestParameters, options) {
2536
- return SchemasApiFp(this.configuration).v4SchemasPost(requestParameters.v4SchemasPostRequest, requestParameters.xApiKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2477
+ v4SchemasPost(requestParameters = {}, options) {
2478
+ return SchemasApiFp(this.configuration).v4SchemasPost(requestParameters.createSchemaBody, options).then((request) => request(this.axios, this.basePath));
2537
2479
  }
2538
2480
  /**
2539
- *
2540
- * @summary Delete a schema
2481
+ * Delete a schema and all its revisions
2482
+ * @summary Delete schema
2541
2483
  * @param {SchemasApiV4SchemasSchemaIdDeleteRequest} requestParameters Request parameters.
2542
2484
  * @param {*} [options] Override http request option.
2543
2485
  * @throws {RequiredError}
2544
2486
  */
2545
2487
  v4SchemasSchemaIdDelete(requestParameters, options) {
2546
- return SchemasApiFp(this.configuration).v4SchemasSchemaIdDelete(requestParameters.schemaId, requestParameters.xApiKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2488
+ return SchemasApiFp(this.configuration).v4SchemasSchemaIdDelete(requestParameters.schemaId, options).then((request) => request(this.axios, this.basePath));
2547
2489
  }
2548
2490
  /**
2549
- *
2550
- * @summary Get a specific schema by ID
2491
+ * Retrieve a specific schema by its unique identifier
2492
+ * @summary Get schema by ID
2551
2493
  * @param {SchemasApiV4SchemasSchemaIdGetRequest} requestParameters Request parameters.
2552
2494
  * @param {*} [options] Override http request option.
2553
2495
  * @throws {RequiredError}
2554
2496
  */
2555
2497
  v4SchemasSchemaIdGet(requestParameters, options) {
2556
- return SchemasApiFp(this.configuration).v4SchemasSchemaIdGet(requestParameters.schemaId, requestParameters.xApiKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2498
+ return SchemasApiFp(this.configuration).v4SchemasSchemaIdGet(requestParameters.schemaId, options).then((request) => request(this.axios, this.basePath));
2557
2499
  }
2558
2500
  /**
2559
- *
2560
- * @summary Update an existing schema
2501
+ * Update schema metadata or create a new revision with updated fields
2502
+ * @summary Update existing schema
2561
2503
  * @param {SchemasApiV4SchemasSchemaIdPutRequest} requestParameters Request parameters.
2562
2504
  * @param {*} [options] Override http request option.
2563
2505
  * @throws {RequiredError}
2564
2506
  */
2565
2507
  v4SchemasSchemaIdPut(requestParameters, options) {
2566
- return SchemasApiFp(this.configuration).v4SchemasSchemaIdPut(requestParameters.schemaId, requestParameters.v4SchemasSchemaIdPutRequest, requestParameters.xApiKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
2508
+ return SchemasApiFp(this.configuration).v4SchemasSchemaIdPut(requestParameters.schemaId, requestParameters.updateSchemaBody, options).then((request) => request(this.axios, this.basePath));
2567
2509
  }
2568
2510
  };
2569
2511
  var WorkflowsApiAxiosParamCreator = function(configuration) {
@@ -2724,15 +2666,14 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
2724
2666
  };
2725
2667
  },
2726
2668
  /**
2727
- *
2669
+ * Create a new workflow with schema, custom fields, or agentic navigation mode
2728
2670
  * @summary Create a new workflow
2729
- * @param {V4WorkflowsPostRequest} v4WorkflowsPostRequest
2671
+ * @param {CreateWorkflowBody} [createWorkflowBody] Body
2730
2672
  * @param {*} [options] Override http request option.
2731
2673
  * @throws {RequiredError}
2732
2674
  */
2733
- v4WorkflowsPost: async (v4WorkflowsPostRequest, options = {}) => {
2734
- assertParamExists("v4WorkflowsPost", "v4WorkflowsPostRequest", v4WorkflowsPostRequest);
2735
- const localVarPath = `/v4/workflows`;
2675
+ v4WorkflowsPost: async (createWorkflowBody, options = {}) => {
2676
+ const localVarPath = `/v4/workflows/`;
2736
2677
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2737
2678
  let baseOptions;
2738
2679
  if (configuration) {
@@ -2742,12 +2683,11 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
2742
2683
  const localVarHeaderParameter = {};
2743
2684
  const localVarQueryParameter = {};
2744
2685
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
2745
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
2746
2686
  localVarHeaderParameter["Content-Type"] = "application/json";
2747
2687
  setSearchParams(localVarUrlObj, localVarQueryParameter);
2748
2688
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2749
2689
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
2750
- localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsPostRequest, localVarRequestOptions, configuration);
2690
+ localVarRequestOptions.data = serializeDataIfNeeded(createWorkflowBody, localVarRequestOptions, configuration);
2751
2691
  return {
2752
2692
  url: toPathString(localVarUrlObj),
2753
2693
  options: localVarRequestOptions
@@ -3517,14 +3457,14 @@ var WorkflowsApiFp = function(configuration) {
3517
3457
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
3518
3458
  },
3519
3459
  /**
3520
- *
3460
+ * Create a new workflow with schema, custom fields, or agentic navigation mode
3521
3461
  * @summary Create a new workflow
3522
- * @param {V4WorkflowsPostRequest} v4WorkflowsPostRequest
3462
+ * @param {CreateWorkflowBody} [createWorkflowBody] Body
3523
3463
  * @param {*} [options] Override http request option.
3524
3464
  * @throws {RequiredError}
3525
3465
  */
3526
- async v4WorkflowsPost(v4WorkflowsPostRequest, options) {
3527
- const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsPost(v4WorkflowsPostRequest, options);
3466
+ async v4WorkflowsPost(createWorkflowBody, options) {
3467
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsPost(createWorkflowBody, options);
3528
3468
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
3529
3469
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsPost"]?.[localVarOperationServerIndex]?.url;
3530
3470
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios5, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
@@ -3861,14 +3801,14 @@ var WorkflowsApi = class extends BaseAPI {
3861
3801
  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));
3862
3802
  }
3863
3803
  /**
3864
- *
3804
+ * Create a new workflow with schema, custom fields, or agentic navigation mode
3865
3805
  * @summary Create a new workflow
3866
3806
  * @param {WorkflowsApiV4WorkflowsPostRequest} requestParameters Request parameters.
3867
3807
  * @param {*} [options] Override http request option.
3868
3808
  * @throws {RequiredError}
3869
3809
  */
3870
- v4WorkflowsPost(requestParameters, options) {
3871
- return WorkflowsApiFp(this.configuration).v4WorkflowsPost(requestParameters.v4WorkflowsPostRequest, options).then((request) => request(this.axios, this.basePath));
3810
+ v4WorkflowsPost(requestParameters = {}, options) {
3811
+ return WorkflowsApiFp(this.configuration).v4WorkflowsPost(requestParameters.createWorkflowBody, options).then((request) => request(this.axios, this.basePath));
3872
3812
  }
3873
3813
  /**
3874
3814
  *
@@ -4106,7 +4046,7 @@ var Configuration = class {
4106
4046
  };
4107
4047
 
4108
4048
  // src/version.ts
4109
- var SDK_VERSION = "0.11.0";
4049
+ var SDK_VERSION = "0.12.1";
4110
4050
  var SDK_NAME = "kadoa-node-sdk";
4111
4051
  var SDK_LANGUAGE = "node";
4112
4052
 
@@ -4328,7 +4268,15 @@ var ExtractionModule = class {
4328
4268
  * @param options Extraction configuration options including optional notification settings
4329
4269
  * @returns ExtractionResult containing workflow ID, workflow details, and first page of extracted data
4330
4270
  *
4331
- * @example
4271
+ * @example Simple extraction with AI detection
4272
+ * ```typescript
4273
+ * const result = await client.extraction.run({
4274
+ * urls: ['https://example.com'],
4275
+ * name: 'My Extraction'
4276
+ * });
4277
+ * ```
4278
+ *
4279
+ * @example With notifications
4332
4280
  * ```typescript
4333
4281
  * const result = await client.extraction.run({
4334
4282
  * urls: ['https://example.com'],
@@ -4342,6 +4290,8 @@ var ExtractionModule = class {
4342
4290
  * }
4343
4291
  * });
4344
4292
  * ```
4293
+ *
4294
+ * @see {@link KadoaClient.extract} For more flexible extraction configuration using the builder API
4345
4295
  */
4346
4296
  async run(options) {
4347
4297
  return await this.extractionService.executeExtraction({
@@ -4368,6 +4318,8 @@ var ExtractionModule = class {
4368
4318
  * }
4369
4319
  * });
4370
4320
  * ```
4321
+ *
4322
+ * @see {@link KadoaClient.extract} For more flexible extraction configuration using the builder API
4371
4323
  */
4372
4324
  async submit(options) {
4373
4325
  return await this.extractionService.executeExtraction({
@@ -4730,13 +4682,7 @@ var ExtractionService = class {
4730
4682
  const result = await this.workflowsCoreService.create({
4731
4683
  ...config,
4732
4684
  entity: resolvedEntity.entity,
4733
- fields: resolvedEntity.fields.map((field) => ({
4734
- name: field.name,
4735
- description: field.description,
4736
- example: field.example,
4737
- // todo: there is missmatch in kadoa-api so we need to cast
4738
- dataType: field.dataType
4739
- }))
4685
+ fields: resolvedEntity.fields
4740
4686
  });
4741
4687
  workflowId = result.id;
4742
4688
  if (hasNotifications) {
@@ -5205,7 +5151,6 @@ var WorkflowsCoreService = class {
5205
5151
  navigationMode: input.navigationMode,
5206
5152
  entity: input.entity,
5207
5153
  fields: input.fields,
5208
- //todo: fix this
5209
5154
  bypassPreview: input.bypassPreview ?? true,
5210
5155
  tags: input.tags,
5211
5156
  interval: input.interval,
@@ -5215,7 +5160,7 @@ var WorkflowsCoreService = class {
5215
5160
  schedules: input.schedules
5216
5161
  };
5217
5162
  const response = await this.workflowsApi.v4WorkflowsPost({
5218
- v4WorkflowsPostRequest: request
5163
+ createWorkflowBody: request
5219
5164
  });
5220
5165
  const workflowId = response.data?.workflowId;
5221
5166
  if (!workflowId) {
@@ -5914,6 +5859,187 @@ var EntityResolverService = class {
5914
5859
  }
5915
5860
  }
5916
5861
  };
5862
+
5863
+ // src/internal/domains/extraction/builders/extraction-builder.ts
5864
+ var ExtractionBuilder = class {
5865
+ constructor() {
5866
+ this.fields = [];
5867
+ }
5868
+ /**
5869
+ * Start defining a custom schema with fields
5870
+ * @param name - The entity name (e.g., "Product", "Article")
5871
+ */
5872
+ schema(name) {
5873
+ if (this.schemaId) {
5874
+ throw new KadoaSdkException(
5875
+ "Cannot use schema() after useSchema() - they are mutually exclusive",
5876
+ { code: "VALIDATION_ERROR" }
5877
+ );
5878
+ }
5879
+ this.schemaName = name;
5880
+ return new SchemaBuilder(this);
5881
+ }
5882
+ /**
5883
+ * Use an existing schema by ID
5884
+ * @param schemaId - The schema ID to reference
5885
+ */
5886
+ useSchema(schemaId) {
5887
+ if (this.schemaName || this.fields.length > 0) {
5888
+ throw new KadoaSdkException(
5889
+ "Cannot use useSchema() after schema() or field definitions - they are mutually exclusive",
5890
+ { code: "VALIDATION_ERROR" }
5891
+ );
5892
+ }
5893
+ this.schemaId = schemaId;
5894
+ return this;
5895
+ }
5896
+ /**
5897
+ * Extract raw page content without transformation
5898
+ * @param format - Raw content format(s): "html", "markdown", or "url"
5899
+ */
5900
+ raw(format) {
5901
+ const formats = Array.isArray(format) ? format : [format];
5902
+ const nameMap = {
5903
+ html: "rawHtml",
5904
+ markdown: "rawMarkdown",
5905
+ url: "rawUrl"
5906
+ };
5907
+ const metadataKeyMap = {
5908
+ html: "HTML",
5909
+ markdown: "MARKDOWN",
5910
+ url: "PAGE_URL"
5911
+ };
5912
+ for (const f of formats) {
5913
+ const fieldName = nameMap[f];
5914
+ if (this.fields.some((field) => field.name === fieldName)) {
5915
+ continue;
5916
+ }
5917
+ this.fields.push({
5918
+ name: fieldName,
5919
+ description: `Raw page content in ${f.toUpperCase()} format`,
5920
+ fieldType: "METADATA",
5921
+ metadataKey: metadataKeyMap[f]
5922
+ });
5923
+ }
5924
+ return this;
5925
+ }
5926
+ /**
5927
+ * Get the fields array (internal use)
5928
+ */
5929
+ getFields() {
5930
+ return this.fields;
5931
+ }
5932
+ /**
5933
+ * Get the schema name (internal use)
5934
+ */
5935
+ getSchemaName() {
5936
+ return this.schemaName;
5937
+ }
5938
+ /**
5939
+ * Get the schema ID (internal use)
5940
+ */
5941
+ getSchemaId() {
5942
+ return this.schemaId;
5943
+ }
5944
+ };
5945
+ var _SchemaBuilder = class _SchemaBuilder extends ExtractionBuilder {
5946
+ constructor(parentBuilder) {
5947
+ super();
5948
+ this.fields = parentBuilder.getFields();
5949
+ this.schemaName = parentBuilder.getSchemaName();
5950
+ this.schemaId = parentBuilder.getSchemaId();
5951
+ }
5952
+ /**
5953
+ * Add a structured field to the schema
5954
+ * @param name - Field name (alphanumeric only)
5955
+ * @param description - Field description
5956
+ * @param dataType - Data type (STRING, NUMBER, BOOLEAN, etc.)
5957
+ * @param options - Optional field configuration
5958
+ */
5959
+ field(name, description, dataType, options) {
5960
+ if (!_SchemaBuilder.FIELD_NAME_PATTERN.test(name)) {
5961
+ throw new KadoaSdkException(
5962
+ `Field name "${name}" must be alphanumeric only (no underscores or special characters)`,
5963
+ {
5964
+ code: "VALIDATION_ERROR",
5965
+ details: { name, pattern: "^[A-Za-z0-9]+$" }
5966
+ }
5967
+ );
5968
+ }
5969
+ const lowerName = name.toLowerCase();
5970
+ if (this.fields.some((f) => f.name.toLowerCase() === lowerName)) {
5971
+ throw new KadoaSdkException(`Duplicate field name: "${name}"`, {
5972
+ code: "VALIDATION_ERROR",
5973
+ details: { name }
5974
+ });
5975
+ }
5976
+ const requiresExample = _SchemaBuilder.TYPES_REQUIRING_EXAMPLE.includes(dataType);
5977
+ if (requiresExample && !options?.example) {
5978
+ throw new KadoaSdkException(
5979
+ `Field "${name}" with type ${dataType} requires an example`,
5980
+ { code: "VALIDATION_ERROR", details: { name, dataType } }
5981
+ );
5982
+ }
5983
+ this.fields.push({
5984
+ name,
5985
+ description,
5986
+ dataType,
5987
+ fieldType: "SCHEMA",
5988
+ example: options?.example,
5989
+ isKey: options?.isKey
5990
+ });
5991
+ return this;
5992
+ }
5993
+ /**
5994
+ * Add a classification field to categorize content
5995
+ * @param name - Field name (alphanumeric only)
5996
+ * @param description - Field description
5997
+ * @param categories - Array of category definitions
5998
+ */
5999
+ classify(name, description, categories) {
6000
+ if (!_SchemaBuilder.FIELD_NAME_PATTERN.test(name)) {
6001
+ throw new KadoaSdkException(
6002
+ `Field name "${name}" must be alphanumeric only (no underscores or special characters)`,
6003
+ {
6004
+ code: "VALIDATION_ERROR",
6005
+ details: { name, pattern: "^[A-Za-z0-9]+$" }
6006
+ }
6007
+ );
6008
+ }
6009
+ const lowerName = name.toLowerCase();
6010
+ if (this.fields.some((f) => f.name.toLowerCase() === lowerName)) {
6011
+ throw new KadoaSdkException(`Duplicate field name: "${name}"`, {
6012
+ code: "VALIDATION_ERROR",
6013
+ details: { name }
6014
+ });
6015
+ }
6016
+ this.fields.push({
6017
+ name,
6018
+ description,
6019
+ fieldType: "CLASSIFICATION",
6020
+ categories
6021
+ });
6022
+ return this;
6023
+ }
6024
+ /**
6025
+ * Add raw page content alongside structured fields
6026
+ * @param format - Raw content format(s): "html", "markdown", or "url"
6027
+ */
6028
+ raw(format) {
6029
+ return super.raw(format);
6030
+ }
6031
+ };
6032
+ _SchemaBuilder.FIELD_NAME_PATTERN = /^[A-Za-z0-9]+$/;
6033
+ _SchemaBuilder.TYPES_REQUIRING_EXAMPLE = [
6034
+ "STRING",
6035
+ "IMAGE",
6036
+ "LINK",
6037
+ "OBJECT",
6038
+ "ARRAY"
6039
+ ];
6040
+ var SchemaBuilder = _SchemaBuilder;
6041
+
6042
+ // src/internal/domains/extraction/services/extraction-builder.service.ts
5917
6043
  var debug7 = logger.extraction;
5918
6044
  var ExtractionBuilderService = class {
5919
6045
  constructor(workflowsCoreService, entityResolverService, dataFetcherService, notificationSetupService) {
@@ -5945,14 +6071,30 @@ var ExtractionBuilderService = class {
5945
6071
  name,
5946
6072
  description,
5947
6073
  navigationMode,
5948
- entity
6074
+ extraction
5949
6075
  }) {
6076
+ let entity = "ai-detection";
6077
+ if (extraction) {
6078
+ const builder = extraction(new ExtractionBuilder());
6079
+ const schemaId = builder.getSchemaId();
6080
+ const schemaName = builder.getSchemaName();
6081
+ const fields = builder.getFields();
6082
+ if (schemaId) {
6083
+ entity = { schemId: schemaId };
6084
+ } else if (schemaName && fields.length > 0) {
6085
+ entity = { name: schemaName, fields };
6086
+ } else if (fields.length > 0 && !schemaName) {
6087
+ entity = { name: "RawExtraction", fields };
6088
+ } else {
6089
+ entity = "ai-detection";
6090
+ }
6091
+ }
5950
6092
  this._options = {
5951
6093
  urls,
5952
6094
  name,
5953
6095
  description,
5954
6096
  navigationMode: navigationMode || "single-page",
5955
- entity: entity || "ai-detection",
6097
+ entity,
5956
6098
  bypassPreview: false
5957
6099
  };
5958
6100
  return this;
@@ -5993,6 +6135,12 @@ var ExtractionBuilderService = class {
5993
6135
  location: this._options.location,
5994
6136
  navigationMode
5995
6137
  });
6138
+ if (!resolvedEntity) {
6139
+ throw new KadoaSdkException(ERROR_MESSAGES.ENTITY_FETCH_FAILED, {
6140
+ code: "VALIDATION_ERROR",
6141
+ details: { entity }
6142
+ });
6143
+ }
5996
6144
  const workflow = await this.workflowsCoreService.create({
5997
6145
  urls,
5998
6146
  name,
@@ -6000,8 +6148,8 @@ var ExtractionBuilderService = class {
6000
6148
  navigationMode,
6001
6149
  monitoring: this._monitoringOptions,
6002
6150
  schemaId: typeof entity === "object" && "schemId" in entity ? entity.schemId : void 0,
6003
- entity: resolvedEntity?.entity,
6004
- fields: resolvedEntity?.fields,
6151
+ entity: resolvedEntity.entity,
6152
+ fields: resolvedEntity.fields,
6005
6153
  autoStart: false,
6006
6154
  interval: this._options.interval,
6007
6155
  schedules: this._options.schedules
@@ -6217,6 +6365,41 @@ var KadoaClient = class {
6217
6365
  get realtime() {
6218
6366
  return this._realtime;
6219
6367
  }
6368
+ /**
6369
+ * Create a prepared extraction using the fluent builder API
6370
+ *
6371
+ * @param options - Extraction options including URLs and optional extraction builder
6372
+ * @returns PreparedExtraction that can be configured with notifications, monitoring, etc.
6373
+ *
6374
+ * @example Auto-detection
6375
+ * ```typescript
6376
+ * const extraction = await client.extract({
6377
+ * urls: ["https://example.com"],
6378
+ * name: "My Extraction"
6379
+ * }).create();
6380
+ * ```
6381
+ *
6382
+ * @example Raw extraction
6383
+ * ```typescript
6384
+ * const extraction = await client.extract({
6385
+ * urls: ["https://example.com"],
6386
+ * name: "My Extraction",
6387
+ * extraction: builder => builder.raw("markdown")
6388
+ * }).create();
6389
+ * ```
6390
+ *
6391
+ * @example Custom schema
6392
+ * ```typescript
6393
+ * const extraction = await client.extract({
6394
+ * urls: ["https://example.com"],
6395
+ * name: "My Extraction",
6396
+ * extraction: builder => builder
6397
+ * .schema("Product")
6398
+ * .field("title", "Product name", "STRING", { example: "Example" })
6399
+ * .field("price", "Product price", "CURRENCY")
6400
+ * }).create();
6401
+ * ```
6402
+ */
6220
6403
  extract(options) {
6221
6404
  return this._extractionBuilderService.extract(options);
6222
6405
  }