@kadoa/node-sdk 0.3.0 → 0.5.0

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
@@ -1,9 +1,8 @@
1
1
  import { EventEmitter } from 'events';
2
- import globalAxios2, { AxiosError } from 'axios';
3
- import { merge } from 'es-toolkit/object';
4
- import { URL as URL$1, URLSearchParams } from 'url';
2
+ import globalAxios3, { isAxiosError } from 'axios';
3
+ import { URL, URLSearchParams } from 'url';
5
4
 
6
- // src/events/index.ts
5
+ // src/core/events/event-emitter.ts
7
6
  var KadoaEventEmitter = class extends EventEmitter {
8
7
  /**
9
8
  * Emit a typed SDK event
@@ -44,8 +43,8 @@ var KadoaEventEmitter = class extends EventEmitter {
44
43
  }
45
44
  };
46
45
 
47
- // src/exceptions/kadoa-sdk.exception.ts
48
- var KadoaSdkException = class _KadoaSdkException extends Error {
46
+ // src/core/exceptions/base.exception.ts
47
+ var _KadoaSdkException = class _KadoaSdkException extends Error {
49
48
  constructor(message, options) {
50
49
  super(message);
51
50
  this.name = "KadoaSdkException";
@@ -74,9 +73,54 @@ var KadoaSdkException = class _KadoaSdkException extends Error {
74
73
  toString() {
75
74
  return [this.name, this.code, this.message].filter(Boolean).join(": ");
76
75
  }
76
+ toDetailedString() {
77
+ const parts = [`${this.name}: ${this.message}`, `Code: ${this.code}`];
78
+ if (this.details && Object.keys(this.details).length > 0) {
79
+ parts.push(`Details: ${JSON.stringify(this.details, null, 2)}`);
80
+ }
81
+ if (this.cause) {
82
+ parts.push(`Cause: ${this.cause}`);
83
+ }
84
+ return parts.join("\n");
85
+ }
86
+ static isInstance(error) {
87
+ return error instanceof _KadoaSdkException;
88
+ }
89
+ static wrap(error, extra) {
90
+ if (error instanceof _KadoaSdkException) return error;
91
+ const message = extra?.message || (error instanceof Error ? error.message : typeof error === "string" ? error : "Unexpected error");
92
+ return new _KadoaSdkException(message, {
93
+ code: "UNKNOWN",
94
+ details: extra?.details,
95
+ cause: error
96
+ });
97
+ }
77
98
  };
78
-
79
- // src/exceptions/http.exception.ts
99
+ _KadoaSdkException.ERROR_MESSAGES = {
100
+ // General errors
101
+ CONFIG_ERROR: "Invalid configuration provided",
102
+ AUTH_FAILED: "Authentication failed. Please check your API key",
103
+ RATE_LIMITED: "Rate limit exceeded. Please try again later",
104
+ NETWORK_ERROR: "Network error occurred",
105
+ SERVER_ERROR: "Server error occurred",
106
+ PARSE_ERROR: "Failed to parse response",
107
+ // Workflow specific errors
108
+ NO_WORKFLOW_ID: "Failed to start extraction process - no ID received",
109
+ WORKFLOW_CREATE_FAILED: "Failed to create workflow",
110
+ WORKFLOW_TIMEOUT: "Workflow processing timed out",
111
+ WORKFLOW_UNEXPECTED_STATUS: "Extraction completed with unexpected status",
112
+ PROGRESS_CHECK_FAILED: "Failed to check extraction progress",
113
+ DATA_FETCH_FAILED: "Failed to retrieve extracted data from workflow",
114
+ // Extraction specific errors
115
+ NO_URLS: "At least one URL is required for extraction",
116
+ NO_API_KEY: "API key is required for entity detection",
117
+ LINK_REQUIRED: "Link is required for entity field detection",
118
+ NO_PREDICTIONS: "No entity predictions returned from the API",
119
+ EXTRACTION_FAILED: "Data extraction failed for the provided URLs",
120
+ ENTITY_FETCH_FAILED: "Failed to fetch entity fields"
121
+ };
122
+ var KadoaSdkException = _KadoaSdkException;
123
+ var ERROR_MESSAGES = KadoaSdkException.ERROR_MESSAGES;
80
124
  var KadoaHttpException = class _KadoaHttpException extends KadoaSdkException {
81
125
  constructor(message, options) {
82
126
  super(message, {
@@ -117,10 +161,43 @@ var KadoaHttpException = class _KadoaHttpException extends KadoaSdkException {
117
161
  responseBody: this.responseBody
118
162
  };
119
163
  }
120
- static mapStatusToCode(error) {
121
- const status = error.response?.status;
164
+ toDetailedString() {
165
+ const parts = [`${this.name}: ${this.message}`, `Code: ${this.code}`];
166
+ if (this.httpStatus) {
167
+ parts.push(`HTTP Status: ${this.httpStatus}`);
168
+ }
169
+ if (this.method && this.endpoint) {
170
+ parts.push(`Request: ${this.method} ${this.endpoint}`);
171
+ }
172
+ if (this.requestId) {
173
+ parts.push(`Request ID: ${this.requestId}`);
174
+ }
175
+ if (this.responseBody) {
176
+ parts.push(
177
+ `Response Body: ${JSON.stringify(this.responseBody, null, 2)}`
178
+ );
179
+ }
180
+ if (this.details && Object.keys(this.details).length > 0) {
181
+ parts.push(`Details: ${JSON.stringify(this.details, null, 2)}`);
182
+ }
183
+ if (this.cause) {
184
+ parts.push(`Cause: ${this.cause}`);
185
+ }
186
+ return parts.join("\n");
187
+ }
188
+ static wrap(error, extra) {
189
+ if (error instanceof _KadoaHttpException) return error;
190
+ if (error instanceof KadoaSdkException) return error;
191
+ if (isAxiosError(error)) {
192
+ return _KadoaHttpException.fromAxiosError(error, extra);
193
+ }
194
+ return KadoaSdkException.wrap(error, extra);
195
+ }
196
+ static mapStatusToCode(errorOrStatus) {
197
+ const status = typeof errorOrStatus === "number" ? errorOrStatus : errorOrStatus.response?.status;
122
198
  if (!status) {
123
- return error.code === "ECONNABORTED" ? "TIMEOUT" : error.request ? "NETWORK_ERROR" : "UNKNOWN";
199
+ if (typeof errorOrStatus === "number") return "UNKNOWN";
200
+ return errorOrStatus.code === "ECONNABORTED" ? "TIMEOUT" : errorOrStatus.request ? "NETWORK_ERROR" : "UNKNOWN";
124
201
  }
125
202
  if (status === 401 || status === 403) return "AUTH_ERROR";
126
203
  if (status === 404) return "NOT_FOUND";
@@ -131,56 +208,9 @@ var KadoaHttpException = class _KadoaHttpException extends KadoaSdkException {
131
208
  return "UNKNOWN";
132
209
  }
133
210
  };
134
- function isKadoaSdkException(error) {
135
- return error instanceof KadoaSdkException;
136
- }
137
- function isKadoaHttpException(error) {
138
- return error instanceof KadoaHttpException;
139
- }
140
- function wrapKadoaError(error, extra) {
141
- if (error instanceof AxiosError)
142
- return KadoaHttpException.fromAxiosError(error, extra);
143
- return KadoaSdkException.from(error, extra?.details);
144
- }
145
-
146
- // src/extraction/constants.ts
147
- var DEFAULT_OPTIONS = {
148
- pollingInterval: 5e3,
149
- maxWaitTime: 3e5,
150
- navigationMode: "single-page",
151
- location: { type: "auto" },
152
- name: "Untitled Workflow",
153
- maxRecords: 99999
154
- };
155
- var TERMINAL_RUN_STATES = /* @__PURE__ */ new Set([
156
- "FINISHED",
157
- "SUCCESS",
158
- "FAILED",
159
- "ERROR",
160
- "STOPPED",
161
- "CANCELLED"
162
- ]);
163
- var SUCCESSFUL_RUN_STATES = /* @__PURE__ */ new Set(["FINISHED", "SUCCESS"]);
164
- var ENTITY_API_ENDPOINT = "/v4/entity";
165
- var DEFAULT_API_BASE_URL = "https://api.kadoa.com";
166
- var ERROR_MESSAGES = {
167
- NO_URLS: "At least one URL is required for extraction",
168
- NO_API_KEY: "API key is required for entity detection",
169
- LINK_REQUIRED: "Link is required for entity field detection",
170
- NO_WORKFLOW_ID: "Failed to start extraction process - no ID received",
171
- NO_PREDICTIONS: "No entity predictions returned from the API",
172
- PARSE_ERROR: "Failed to parse entity response",
173
- NETWORK_ERROR: "Network error while fetching entity fields",
174
- AUTH_FAILED: "Authentication failed. Please check your API key",
175
- RATE_LIMITED: "Rate limit exceeded. Please try again later",
176
- SERVER_ERROR: "Server error while fetching entity fields",
177
- DATA_FETCH_FAILED: "Failed to retrieve extracted data from workflow",
178
- PROGRESS_CHECK_FAILED: "Failed to check extraction progress",
179
- EXTRACTION_FAILED: "Data extraction failed for the provided URLs"
180
- };
181
211
  var BASE_PATH = "https://api.kadoa.com".replace(/\/+$/, "");
182
212
  var BaseAPI = class {
183
- constructor(configuration, basePath = BASE_PATH, axios2 = globalAxios2) {
213
+ constructor(configuration, basePath = BASE_PATH, axios2 = globalAxios3) {
184
214
  this.basePath = basePath;
185
215
  this.axios = axios2;
186
216
  if (configuration) {
@@ -246,180 +276,95 @@ var serializeDataIfNeeded = function(value, requestOptions, configuration) {
246
276
  var toPathString = function(url) {
247
277
  return url.pathname + url.search + url.hash;
248
278
  };
249
- var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
250
- return (axios2 = globalAxios3, basePath = BASE_PATH2) => {
279
+ var createRequestFunction = function(axiosArgs, globalAxios4, BASE_PATH2, configuration) {
280
+ return (axios2 = globalAxios4, basePath = BASE_PATH2) => {
251
281
  const axiosRequestArgs = { ...axiosArgs.options, url: (axios2.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
252
282
  return axios2.request(axiosRequestArgs);
253
283
  };
254
284
  };
255
- var WorkflowsApiAxiosParamCreator = function(configuration) {
285
+ var CrawlApiAxiosParamCreator = function(configuration) {
256
286
  return {
257
287
  /**
258
- *
259
- * @summary Get data change by ID
260
- * @param {string} changeId ID of the workflow change to retrieve
261
- * @param {string} [xApiKey] API key for authorization
262
- * @param {string} [authorization] Bearer token for authorization
288
+ * Pauses a currently active crawling session identified by the provided session ID.
289
+ * @summary Pause an active crawling session
290
+ * @param {string} xApiKey API key for authentication
291
+ * @param {V4CrawlPausePostRequest} v4CrawlPausePostRequest
263
292
  * @param {*} [options] Override http request option.
264
293
  * @throws {RequiredError}
265
294
  */
266
- v4ChangesChangeIdGet: async (changeId, xApiKey, authorization, options = {}) => {
267
- assertParamExists("v4ChangesChangeIdGet", "changeId", changeId);
268
- const localVarPath = `/v4/changes/{changeId}`.replace(`{${"changeId"}}`, encodeURIComponent(String(changeId)));
269
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
295
+ v4CrawlPausePost: async (xApiKey, v4CrawlPausePostRequest, options = {}) => {
296
+ assertParamExists("v4CrawlPausePost", "xApiKey", xApiKey);
297
+ assertParamExists("v4CrawlPausePost", "v4CrawlPausePostRequest", v4CrawlPausePostRequest);
298
+ const localVarPath = `/v4/crawl/pause`;
299
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
270
300
  let baseOptions;
271
301
  if (configuration) {
272
302
  baseOptions = configuration.baseOptions;
273
303
  }
274
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
304
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
275
305
  const localVarHeaderParameter = {};
276
306
  const localVarQueryParameter = {};
277
307
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
278
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
308
+ localVarHeaderParameter["Content-Type"] = "application/json";
279
309
  if (xApiKey != null) {
280
310
  localVarHeaderParameter["x-api-key"] = String(xApiKey);
281
311
  }
282
- if (authorization != null) {
283
- localVarHeaderParameter["Authorization"] = String(authorization);
284
- }
285
312
  setSearchParams(localVarUrlObj, localVarQueryParameter);
286
313
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
287
314
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
315
+ localVarRequestOptions.data = serializeDataIfNeeded(v4CrawlPausePostRequest, localVarRequestOptions, configuration);
288
316
  return {
289
317
  url: toPathString(localVarUrlObj),
290
318
  options: localVarRequestOptions
291
319
  };
292
320
  },
293
321
  /**
294
- *
295
- * @summary Get all data changes
296
- * @param {string} [xApiKey] API key for authorization
297
- * @param {string} [authorization] Bearer token for authorization
298
- * @param {string} [workflowIds] Comma-separated list of workflow IDs. If not provided, returns changes for all ACTIVE workflows
299
- * @param {string} [startDate] Start date to filter changes (ISO format)
300
- * @param {string} [endDate] End date to filter changes (ISO format)
301
- * @param {number} [skip] Number of records to skip for pagination
302
- * @param {number} [limit] Number of records to return for pagination
322
+ * Initiates a crawling session with the specified URL and optional filters for paths.
323
+ * @summary Start a new crawling session
324
+ * @param {string} xApiKey API key for authentication
325
+ * @param {V4CrawlPostRequest} v4CrawlPostRequest
303
326
  * @param {*} [options] Override http request option.
304
327
  * @throws {RequiredError}
305
328
  */
306
- v4ChangesGet: async (xApiKey, authorization, workflowIds, startDate, endDate, skip, limit, options = {}) => {
307
- const localVarPath = `/v4/changes`;
308
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
329
+ v4CrawlPost: async (xApiKey, v4CrawlPostRequest, options = {}) => {
330
+ assertParamExists("v4CrawlPost", "xApiKey", xApiKey);
331
+ assertParamExists("v4CrawlPost", "v4CrawlPostRequest", v4CrawlPostRequest);
332
+ const localVarPath = `/v4/crawl`;
333
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
309
334
  let baseOptions;
310
335
  if (configuration) {
311
336
  baseOptions = configuration.baseOptions;
312
337
  }
313
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
338
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
314
339
  const localVarHeaderParameter = {};
315
340
  const localVarQueryParameter = {};
316
341
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
317
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
318
- if (workflowIds !== void 0) {
319
- localVarQueryParameter["workflowIds"] = workflowIds;
320
- }
321
- if (startDate !== void 0) {
322
- localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString() : startDate;
323
- }
324
- if (endDate !== void 0) {
325
- localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString() : endDate;
326
- }
327
- if (skip !== void 0) {
328
- localVarQueryParameter["skip"] = skip;
329
- }
330
- if (limit !== void 0) {
331
- localVarQueryParameter["limit"] = limit;
332
- }
342
+ localVarHeaderParameter["Content-Type"] = "application/json";
333
343
  if (xApiKey != null) {
334
344
  localVarHeaderParameter["x-api-key"] = String(xApiKey);
335
345
  }
336
- if (authorization != null) {
337
- localVarHeaderParameter["Authorization"] = String(authorization);
338
- }
339
- setSearchParams(localVarUrlObj, localVarQueryParameter);
340
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
341
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
342
- return {
343
- url: toPathString(localVarUrlObj),
344
- options: localVarRequestOptions
345
- };
346
- },
347
- /**
348
- * Retrieves a list of workflows with pagination and search capabilities
349
- * @summary Get a list of workflows
350
- * @param {string} [search] Search term to filter workflows by name or URL
351
- * @param {number} [skip] Number of items to skip
352
- * @param {number} [limit] Maximum number of items to return
353
- * @param {V4WorkflowsGetStateEnum} [state] Filter workflows by state
354
- * @param {Array<string>} [tags] Filter workflows by tags
355
- * @param {V4WorkflowsGetMonitoringEnum} [monitoring] Filter workflows by monitoring status
356
- * @param {V4WorkflowsGetUpdateIntervalEnum} [updateInterval] Filter workflows by update interval
357
- * @param {string} [templateId] Filter workflows by template ID (DEPRECATED - templates replaced by schemas)
358
- * @param {V4WorkflowsGetIncludeDeletedEnum} [includeDeleted] Include deleted workflows (for compliance officers)
359
- * @param {V4WorkflowsGetFormatEnum} [format] Response format (json or csv for export)
360
- * @param {*} [options] Override http request option.
361
- * @throws {RequiredError}
362
- */
363
- v4WorkflowsGet: async (search, skip, limit, state, tags, monitoring, updateInterval, templateId, includeDeleted, format, options = {}) => {
364
- const localVarPath = `/v4/workflows`;
365
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
366
- let baseOptions;
367
- if (configuration) {
368
- baseOptions = configuration.baseOptions;
369
- }
370
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
371
- const localVarHeaderParameter = {};
372
- const localVarQueryParameter = {};
373
- await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
374
- if (search !== void 0) {
375
- localVarQueryParameter["search"] = search;
376
- }
377
- if (skip !== void 0) {
378
- localVarQueryParameter["skip"] = skip;
379
- }
380
- if (limit !== void 0) {
381
- localVarQueryParameter["limit"] = limit;
382
- }
383
- if (state !== void 0) {
384
- localVarQueryParameter["state"] = state;
385
- }
386
- if (tags) {
387
- localVarQueryParameter["tags"] = tags;
388
- }
389
- if (monitoring !== void 0) {
390
- localVarQueryParameter["monitoring"] = monitoring;
391
- }
392
- if (updateInterval !== void 0) {
393
- localVarQueryParameter["updateInterval"] = updateInterval;
394
- }
395
- if (templateId !== void 0) {
396
- localVarQueryParameter["templateId"] = templateId;
397
- }
398
- if (includeDeleted !== void 0) {
399
- localVarQueryParameter["includeDeleted"] = includeDeleted;
400
- }
401
- if (format !== void 0) {
402
- localVarQueryParameter["format"] = format;
403
- }
404
346
  setSearchParams(localVarUrlObj, localVarQueryParameter);
405
347
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
406
348
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
349
+ localVarRequestOptions.data = serializeDataIfNeeded(v4CrawlPostRequest, localVarRequestOptions, configuration);
407
350
  return {
408
351
  url: toPathString(localVarUrlObj),
409
352
  options: localVarRequestOptions
410
353
  };
411
354
  },
412
355
  /**
413
- *
414
- * @summary Create a new workflow
415
- * @param {V4WorkflowsPostRequest} v4WorkflowsPostRequest
356
+ * Resumes a previously paused crawling session identified by the provided session ID.
357
+ * @summary Resume a paused crawling session
358
+ * @param {string} xApiKey API key for authentication
359
+ * @param {V4CrawlResumePostRequest} v4CrawlResumePostRequest
416
360
  * @param {*} [options] Override http request option.
417
361
  * @throws {RequiredError}
418
362
  */
419
- v4WorkflowsPost: async (v4WorkflowsPostRequest, options = {}) => {
420
- assertParamExists("v4WorkflowsPost", "v4WorkflowsPostRequest", v4WorkflowsPostRequest);
421
- const localVarPath = `/v4/workflows`;
422
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
363
+ v4CrawlResumePost: async (xApiKey, v4CrawlResumePostRequest, options = {}) => {
364
+ assertParamExists("v4CrawlResumePost", "xApiKey", xApiKey);
365
+ assertParamExists("v4CrawlResumePost", "v4CrawlResumePostRequest", v4CrawlResumePostRequest);
366
+ const localVarPath = `/v4/crawl/resume`;
367
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
423
368
  let baseOptions;
424
369
  if (configuration) {
425
370
  baseOptions = configuration.baseOptions;
@@ -428,90 +373,110 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
428
373
  const localVarHeaderParameter = {};
429
374
  const localVarQueryParameter = {};
430
375
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
431
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
432
376
  localVarHeaderParameter["Content-Type"] = "application/json";
377
+ if (xApiKey != null) {
378
+ localVarHeaderParameter["x-api-key"] = String(xApiKey);
379
+ }
433
380
  setSearchParams(localVarUrlObj, localVarQueryParameter);
434
381
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
435
382
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
436
- localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsPostRequest, localVarRequestOptions, configuration);
383
+ localVarRequestOptions.data = serializeDataIfNeeded(v4CrawlResumePostRequest, localVarRequestOptions, configuration);
437
384
  return {
438
385
  url: toPathString(localVarUrlObj),
439
386
  options: localVarRequestOptions
440
387
  };
441
388
  },
442
389
  /**
443
- *
444
- * @summary Edit an existing workflow
445
- * @param {V4WorkflowsSetupEditPostRequest} v4WorkflowsSetupEditPostRequest Updated information to edit an existing workflow
390
+ * Fetches paginated data of crawled pages for a specific crawling session.
391
+ * @summary Retrieve crawled pages from a crawling session
392
+ * @param {string} xApiKey API key for authentication
393
+ * @param {string} sessionId Unique ID of the crawling session
394
+ * @param {number} [currentPage] Current page number for pagination
395
+ * @param {number} [pageSize] Number of items per page for pagination
446
396
  * @param {*} [options] Override http request option.
447
397
  * @throws {RequiredError}
448
398
  */
449
- v4WorkflowsSetupEditPost: async (v4WorkflowsSetupEditPostRequest, options = {}) => {
450
- assertParamExists("v4WorkflowsSetupEditPost", "v4WorkflowsSetupEditPostRequest", v4WorkflowsSetupEditPostRequest);
451
- const localVarPath = `/v4/workflows/setup/edit`;
452
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
399
+ v4CrawlSessionIdPagesGet: async (xApiKey, sessionId, currentPage, pageSize, options = {}) => {
400
+ assertParamExists("v4CrawlSessionIdPagesGet", "xApiKey", xApiKey);
401
+ assertParamExists("v4CrawlSessionIdPagesGet", "sessionId", sessionId);
402
+ const localVarPath = `/v4/crawl/{sessionId}/pages`.replace(`{${"sessionId"}}`, encodeURIComponent(String(sessionId)));
403
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
453
404
  let baseOptions;
454
405
  if (configuration) {
455
406
  baseOptions = configuration.baseOptions;
456
407
  }
457
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
408
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
458
409
  const localVarHeaderParameter = {};
459
410
  const localVarQueryParameter = {};
460
411
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
461
- localVarHeaderParameter["Content-Type"] = "application/json";
412
+ if (currentPage !== void 0) {
413
+ localVarQueryParameter["currentPage"] = currentPage;
414
+ }
415
+ if (pageSize !== void 0) {
416
+ localVarQueryParameter["pageSize"] = pageSize;
417
+ }
418
+ if (xApiKey != null) {
419
+ localVarHeaderParameter["x-api-key"] = String(xApiKey);
420
+ }
462
421
  setSearchParams(localVarUrlObj, localVarQueryParameter);
463
422
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
464
423
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
465
- localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsSetupEditPostRequest, localVarRequestOptions, configuration);
466
424
  return {
467
425
  url: toPathString(localVarUrlObj),
468
426
  options: localVarRequestOptions
469
427
  };
470
428
  },
471
429
  /**
472
- *
473
- * @summary Set up a new workflow
474
- * @param {V4WorkflowsSetupPostRequest} v4WorkflowsSetupPostRequest Required information to set up a new workflow
430
+ * Fetches data for a specific page from a crawling session by page ID, optionally allowing format specification.
431
+ * @summary Retrieve detailed data for a specific crawled page
432
+ * @param {string} xApiKey API key for authentication
433
+ * @param {string} sessionId Unique ID of the crawling session
434
+ * @param {string} pageId Unique ID of the crawled page
435
+ * @param {string} [format] Desired format for the page data
475
436
  * @param {*} [options] Override http request option.
476
437
  * @throws {RequiredError}
477
438
  */
478
- v4WorkflowsSetupPost: async (v4WorkflowsSetupPostRequest, options = {}) => {
479
- assertParamExists("v4WorkflowsSetupPost", "v4WorkflowsSetupPostRequest", v4WorkflowsSetupPostRequest);
480
- const localVarPath = `/v4/workflows/setup`;
481
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
439
+ v4CrawlSessionIdPagesPageIdGet: async (xApiKey, sessionId, pageId, format, options = {}) => {
440
+ assertParamExists("v4CrawlSessionIdPagesPageIdGet", "xApiKey", xApiKey);
441
+ assertParamExists("v4CrawlSessionIdPagesPageIdGet", "sessionId", sessionId);
442
+ assertParamExists("v4CrawlSessionIdPagesPageIdGet", "pageId", pageId);
443
+ const localVarPath = `/v4/crawl/{sessionId}/pages/{pageId}`.replace(`{${"sessionId"}}`, encodeURIComponent(String(sessionId))).replace(`{${"pageId"}}`, encodeURIComponent(String(pageId)));
444
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
482
445
  let baseOptions;
483
446
  if (configuration) {
484
447
  baseOptions = configuration.baseOptions;
485
448
  }
486
- const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
449
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
487
450
  const localVarHeaderParameter = {};
488
451
  const localVarQueryParameter = {};
489
452
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
490
- localVarHeaderParameter["Content-Type"] = "application/json";
453
+ if (format !== void 0) {
454
+ localVarQueryParameter["format"] = format;
455
+ }
456
+ if (xApiKey != null) {
457
+ localVarHeaderParameter["x-api-key"] = String(xApiKey);
458
+ }
491
459
  setSearchParams(localVarUrlObj, localVarQueryParameter);
492
460
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
493
461
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
494
- localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsSetupPostRequest, localVarRequestOptions, configuration);
495
462
  return {
496
463
  url: toPathString(localVarUrlObj),
497
464
  options: localVarRequestOptions
498
465
  };
499
466
  },
500
467
  /**
501
- *
502
- * @summary Get workflow audit log entries
503
- * @param {string} workflowId ID of the workflow to retrieve audit logs from
504
- * @param {string} [xApiKey] API key for authorization
505
- * @param {string} [authorization] Bearer token for authorization
506
- * @param {number} [page] Page number for pagination
507
- * @param {number} [limit] Number of items per page
468
+ * Fetches the current status of a specified crawling session using the session ID.
469
+ * @summary Retrieve the status of a crawling session
470
+ * @param {string} xApiKey API key for authentication
471
+ * @param {string} sessionId Unique ID of the crawling session
508
472
  * @param {*} [options] Override http request option.
509
473
  * @throws {RequiredError}
510
474
  */
511
- v4WorkflowsWorkflowIdAuditlogGet: async (workflowId, xApiKey, authorization, page, limit, options = {}) => {
512
- assertParamExists("v4WorkflowsWorkflowIdAuditlogGet", "workflowId", workflowId);
513
- const localVarPath = `/v4/workflows/{workflowId}/auditlog`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
514
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
475
+ v4CrawlSessionIdStatusGet: async (xApiKey, sessionId, options = {}) => {
476
+ assertParamExists("v4CrawlSessionIdStatusGet", "xApiKey", xApiKey);
477
+ assertParamExists("v4CrawlSessionIdStatusGet", "sessionId", sessionId);
478
+ const localVarPath = `/v4/crawl/{sessionId}/status`.replace(`{${"sessionId"}}`, encodeURIComponent(String(sessionId)));
479
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
515
480
  let baseOptions;
516
481
  if (configuration) {
517
482
  baseOptions = configuration.baseOptions;
@@ -520,19 +485,9 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
520
485
  const localVarHeaderParameter = {};
521
486
  const localVarQueryParameter = {};
522
487
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
523
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
524
- if (page !== void 0) {
525
- localVarQueryParameter["page"] = page;
526
- }
527
- if (limit !== void 0) {
528
- localVarQueryParameter["limit"] = limit;
529
- }
530
488
  if (xApiKey != null) {
531
489
  localVarHeaderParameter["x-api-key"] = String(xApiKey);
532
490
  }
533
- if (authorization != null) {
534
- localVarHeaderParameter["Authorization"] = String(authorization);
535
- }
536
491
  setSearchParams(localVarUrlObj, localVarQueryParameter);
537
492
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
538
493
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -540,28 +495,194 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
540
495
  url: toPathString(localVarUrlObj),
541
496
  options: localVarRequestOptions
542
497
  };
498
+ }
499
+ };
500
+ };
501
+ var CrawlApiFp = function(configuration) {
502
+ const localVarAxiosParamCreator = CrawlApiAxiosParamCreator(configuration);
503
+ return {
504
+ /**
505
+ * Pauses a currently active crawling session identified by the provided session ID.
506
+ * @summary Pause an active crawling session
507
+ * @param {string} xApiKey API key for authentication
508
+ * @param {V4CrawlPausePostRequest} v4CrawlPausePostRequest
509
+ * @param {*} [options] Override http request option.
510
+ * @throws {RequiredError}
511
+ */
512
+ async v4CrawlPausePost(xApiKey, v4CrawlPausePostRequest, options) {
513
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4CrawlPausePost(xApiKey, v4CrawlPausePostRequest, options);
514
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
515
+ const localVarOperationServerBasePath = operationServerMap["CrawlApi.v4CrawlPausePost"]?.[localVarOperationServerIndex]?.url;
516
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
543
517
  },
544
518
  /**
545
- *
546
- * @summary Approve workflow for compliance
547
- * @param {string} workflowId ID of the workflow to approve
548
- * @param {string} [xApiKey] API key for authorization
549
- * @param {string} [authorization] Bearer token for authorization
519
+ * Initiates a crawling session with the specified URL and optional filters for paths.
520
+ * @summary Start a new crawling session
521
+ * @param {string} xApiKey API key for authentication
522
+ * @param {V4CrawlPostRequest} v4CrawlPostRequest
550
523
  * @param {*} [options] Override http request option.
551
524
  * @throws {RequiredError}
552
525
  */
553
- v4WorkflowsWorkflowIdComplianceApprovePut: async (workflowId, xApiKey, authorization, options = {}) => {
554
- assertParamExists("v4WorkflowsWorkflowIdComplianceApprovePut", "workflowId", workflowId);
555
- const localVarPath = `/v4/workflows/{workflowId}/compliance-approve`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
556
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
526
+ async v4CrawlPost(xApiKey, v4CrawlPostRequest, options) {
527
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4CrawlPost(xApiKey, v4CrawlPostRequest, options);
528
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
529
+ const localVarOperationServerBasePath = operationServerMap["CrawlApi.v4CrawlPost"]?.[localVarOperationServerIndex]?.url;
530
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
531
+ },
532
+ /**
533
+ * Resumes a previously paused crawling session identified by the provided session ID.
534
+ * @summary Resume a paused crawling session
535
+ * @param {string} xApiKey API key for authentication
536
+ * @param {V4CrawlResumePostRequest} v4CrawlResumePostRequest
537
+ * @param {*} [options] Override http request option.
538
+ * @throws {RequiredError}
539
+ */
540
+ async v4CrawlResumePost(xApiKey, v4CrawlResumePostRequest, options) {
541
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4CrawlResumePost(xApiKey, v4CrawlResumePostRequest, options);
542
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
543
+ const localVarOperationServerBasePath = operationServerMap["CrawlApi.v4CrawlResumePost"]?.[localVarOperationServerIndex]?.url;
544
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
545
+ },
546
+ /**
547
+ * Fetches paginated data of crawled pages for a specific crawling session.
548
+ * @summary Retrieve crawled pages from a crawling session
549
+ * @param {string} xApiKey API key for authentication
550
+ * @param {string} sessionId Unique ID of the crawling session
551
+ * @param {number} [currentPage] Current page number for pagination
552
+ * @param {number} [pageSize] Number of items per page for pagination
553
+ * @param {*} [options] Override http request option.
554
+ * @throws {RequiredError}
555
+ */
556
+ async v4CrawlSessionIdPagesGet(xApiKey, sessionId, currentPage, pageSize, options) {
557
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4CrawlSessionIdPagesGet(xApiKey, sessionId, currentPage, pageSize, options);
558
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
559
+ const localVarOperationServerBasePath = operationServerMap["CrawlApi.v4CrawlSessionIdPagesGet"]?.[localVarOperationServerIndex]?.url;
560
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
561
+ },
562
+ /**
563
+ * Fetches data for a specific page from a crawling session by page ID, optionally allowing format specification.
564
+ * @summary Retrieve detailed data for a specific crawled page
565
+ * @param {string} xApiKey API key for authentication
566
+ * @param {string} sessionId Unique ID of the crawling session
567
+ * @param {string} pageId Unique ID of the crawled page
568
+ * @param {string} [format] Desired format for the page data
569
+ * @param {*} [options] Override http request option.
570
+ * @throws {RequiredError}
571
+ */
572
+ async v4CrawlSessionIdPagesPageIdGet(xApiKey, sessionId, pageId, format, options) {
573
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4CrawlSessionIdPagesPageIdGet(xApiKey, sessionId, pageId, format, options);
574
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
575
+ const localVarOperationServerBasePath = operationServerMap["CrawlApi.v4CrawlSessionIdPagesPageIdGet"]?.[localVarOperationServerIndex]?.url;
576
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
577
+ },
578
+ /**
579
+ * Fetches the current status of a specified crawling session using the session ID.
580
+ * @summary Retrieve the status of a crawling session
581
+ * @param {string} xApiKey API key for authentication
582
+ * @param {string} sessionId Unique ID of the crawling session
583
+ * @param {*} [options] Override http request option.
584
+ * @throws {RequiredError}
585
+ */
586
+ async v4CrawlSessionIdStatusGet(xApiKey, sessionId, options) {
587
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4CrawlSessionIdStatusGet(xApiKey, sessionId, options);
588
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
589
+ const localVarOperationServerBasePath = operationServerMap["CrawlApi.v4CrawlSessionIdStatusGet"]?.[localVarOperationServerIndex]?.url;
590
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
591
+ }
592
+ };
593
+ };
594
+ var CrawlApi = class extends BaseAPI {
595
+ /**
596
+ * Pauses a currently active crawling session identified by the provided session ID.
597
+ * @summary Pause an active crawling session
598
+ * @param {CrawlApiV4CrawlPausePostRequest} requestParameters Request parameters.
599
+ * @param {*} [options] Override http request option.
600
+ * @throws {RequiredError}
601
+ * @memberof CrawlApi
602
+ */
603
+ v4CrawlPausePost(requestParameters, options) {
604
+ return CrawlApiFp(this.configuration).v4CrawlPausePost(requestParameters.xApiKey, requestParameters.v4CrawlPausePostRequest, options).then((request) => request(this.axios, this.basePath));
605
+ }
606
+ /**
607
+ * Initiates a crawling session with the specified URL and optional filters for paths.
608
+ * @summary Start a new crawling session
609
+ * @param {CrawlApiV4CrawlPostRequest} requestParameters Request parameters.
610
+ * @param {*} [options] Override http request option.
611
+ * @throws {RequiredError}
612
+ * @memberof CrawlApi
613
+ */
614
+ v4CrawlPost(requestParameters, options) {
615
+ return CrawlApiFp(this.configuration).v4CrawlPost(requestParameters.xApiKey, requestParameters.v4CrawlPostRequest, options).then((request) => request(this.axios, this.basePath));
616
+ }
617
+ /**
618
+ * Resumes a previously paused crawling session identified by the provided session ID.
619
+ * @summary Resume a paused crawling session
620
+ * @param {CrawlApiV4CrawlResumePostRequest} requestParameters Request parameters.
621
+ * @param {*} [options] Override http request option.
622
+ * @throws {RequiredError}
623
+ * @memberof CrawlApi
624
+ */
625
+ v4CrawlResumePost(requestParameters, options) {
626
+ return CrawlApiFp(this.configuration).v4CrawlResumePost(requestParameters.xApiKey, requestParameters.v4CrawlResumePostRequest, options).then((request) => request(this.axios, this.basePath));
627
+ }
628
+ /**
629
+ * Fetches paginated data of crawled pages for a specific crawling session.
630
+ * @summary Retrieve crawled pages from a crawling session
631
+ * @param {CrawlApiV4CrawlSessionIdPagesGetRequest} requestParameters Request parameters.
632
+ * @param {*} [options] Override http request option.
633
+ * @throws {RequiredError}
634
+ * @memberof CrawlApi
635
+ */
636
+ v4CrawlSessionIdPagesGet(requestParameters, options) {
637
+ return CrawlApiFp(this.configuration).v4CrawlSessionIdPagesGet(requestParameters.xApiKey, requestParameters.sessionId, requestParameters.currentPage, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
638
+ }
639
+ /**
640
+ * Fetches data for a specific page from a crawling session by page ID, optionally allowing format specification.
641
+ * @summary Retrieve detailed data for a specific crawled page
642
+ * @param {CrawlApiV4CrawlSessionIdPagesPageIdGetRequest} requestParameters Request parameters.
643
+ * @param {*} [options] Override http request option.
644
+ * @throws {RequiredError}
645
+ * @memberof CrawlApi
646
+ */
647
+ v4CrawlSessionIdPagesPageIdGet(requestParameters, options) {
648
+ return CrawlApiFp(this.configuration).v4CrawlSessionIdPagesPageIdGet(requestParameters.xApiKey, requestParameters.sessionId, requestParameters.pageId, requestParameters.format, options).then((request) => request(this.axios, this.basePath));
649
+ }
650
+ /**
651
+ * Fetches the current status of a specified crawling session using the session ID.
652
+ * @summary Retrieve the status of a crawling session
653
+ * @param {CrawlApiV4CrawlSessionIdStatusGetRequest} requestParameters Request parameters.
654
+ * @param {*} [options] Override http request option.
655
+ * @throws {RequiredError}
656
+ * @memberof CrawlApi
657
+ */
658
+ v4CrawlSessionIdStatusGet(requestParameters, options) {
659
+ return CrawlApiFp(this.configuration).v4CrawlSessionIdStatusGet(requestParameters.xApiKey, requestParameters.sessionId, options).then((request) => request(this.axios, this.basePath));
660
+ }
661
+ };
662
+ var WorkflowsApiAxiosParamCreator = function(configuration) {
663
+ return {
664
+ /**
665
+ *
666
+ * @summary Get data change by ID
667
+ * @param {string} changeId ID of the workflow change to retrieve
668
+ * @param {string} [xApiKey] API key for authorization
669
+ * @param {string} [authorization] Bearer token for authorization
670
+ * @param {*} [options] Override http request option.
671
+ * @throws {RequiredError}
672
+ */
673
+ v4ChangesChangeIdGet: async (changeId, xApiKey, authorization, options = {}) => {
674
+ assertParamExists("v4ChangesChangeIdGet", "changeId", changeId);
675
+ const localVarPath = `/v4/changes/{changeId}`.replace(`{${"changeId"}}`, encodeURIComponent(String(changeId)));
676
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
557
677
  let baseOptions;
558
678
  if (configuration) {
559
679
  baseOptions = configuration.baseOptions;
560
680
  }
561
- const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
681
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
562
682
  const localVarHeaderParameter = {};
563
683
  const localVarQueryParameter = {};
564
684
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
685
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
565
686
  if (xApiKey != null) {
566
687
  localVarHeaderParameter["x-api-key"] = String(xApiKey);
567
688
  }
@@ -578,28 +699,44 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
578
699
  },
579
700
  /**
580
701
  *
581
- * @summary Reject workflow for compliance
582
- * @param {string} workflowId ID of the workflow to reject
583
- * @param {V4WorkflowsWorkflowIdComplianceRejectPutRequest} v4WorkflowsWorkflowIdComplianceRejectPutRequest
702
+ * @summary Get all data changes
584
703
  * @param {string} [xApiKey] API key for authorization
585
704
  * @param {string} [authorization] Bearer token for authorization
705
+ * @param {string} [workflowIds] Comma-separated list of workflow IDs. If not provided, returns changes for all ACTIVE workflows
706
+ * @param {string} [startDate] Start date to filter changes (ISO format)
707
+ * @param {string} [endDate] End date to filter changes (ISO format)
708
+ * @param {number} [skip] Number of records to skip for pagination
709
+ * @param {number} [limit] Number of records to return for pagination
586
710
  * @param {*} [options] Override http request option.
587
711
  * @throws {RequiredError}
588
712
  */
589
- v4WorkflowsWorkflowIdComplianceRejectPut: async (workflowId, v4WorkflowsWorkflowIdComplianceRejectPutRequest, xApiKey, authorization, options = {}) => {
590
- assertParamExists("v4WorkflowsWorkflowIdComplianceRejectPut", "workflowId", workflowId);
591
- assertParamExists("v4WorkflowsWorkflowIdComplianceRejectPut", "v4WorkflowsWorkflowIdComplianceRejectPutRequest", v4WorkflowsWorkflowIdComplianceRejectPutRequest);
592
- const localVarPath = `/v4/workflows/{workflowId}/compliance-reject`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
593
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
713
+ v4ChangesGet: async (xApiKey, authorization, workflowIds, startDate, endDate, skip, limit, options = {}) => {
714
+ const localVarPath = `/v4/changes`;
715
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
594
716
  let baseOptions;
595
717
  if (configuration) {
596
718
  baseOptions = configuration.baseOptions;
597
719
  }
598
- const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
720
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
599
721
  const localVarHeaderParameter = {};
600
722
  const localVarQueryParameter = {};
601
723
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
602
- localVarHeaderParameter["Content-Type"] = "application/json";
724
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
725
+ if (workflowIds !== void 0) {
726
+ localVarQueryParameter["workflowIds"] = workflowIds;
727
+ }
728
+ if (startDate !== void 0) {
729
+ localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString() : startDate;
730
+ }
731
+ if (endDate !== void 0) {
732
+ localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString() : endDate;
733
+ }
734
+ if (skip !== void 0) {
735
+ localVarQueryParameter["skip"] = skip;
736
+ }
737
+ if (limit !== void 0) {
738
+ localVarQueryParameter["limit"] = limit;
739
+ }
603
740
  if (xApiKey != null) {
604
741
  localVarHeaderParameter["x-api-key"] = String(xApiKey);
605
742
  }
@@ -609,35 +746,30 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
609
746
  setSearchParams(localVarUrlObj, localVarQueryParameter);
610
747
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
611
748
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
612
- localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsWorkflowIdComplianceRejectPutRequest, localVarRequestOptions, configuration);
613
749
  return {
614
750
  url: toPathString(localVarUrlObj),
615
751
  options: localVarRequestOptions
616
752
  };
617
753
  },
618
754
  /**
619
- *
620
- * @summary Get workflow data by ID
621
- * @param {string} workflowId ID of the workflow to retrieve data from
622
- * @param {string} [xApiKey] API key for authorization
623
- * @param {string} [authorization] Bearer token for authorization
624
- * @param {string} [runId] ID of a specific run to retrieve data from
625
- * @param {V4WorkflowsWorkflowIdDataGetFormatEnum} [format] Format of the response data
626
- * @param {string} [sortBy] Field to sort the results by
627
- * @param {V4WorkflowsWorkflowIdDataGetOrderEnum} [order] Sort order (ascending or descending)
628
- * @param {string} [filters] JSON-encoded array of filter objects
629
- * @param {number} [page] Page number for pagination
630
- * @param {number} [limit] Number of items per page (0 for streaming all data)
631
- * @param {boolean} [gzip] Enable gzip compression for the response
632
- * @param {string} [rowIds] Filter results by specific row IDs (comma-separated or JSON array)
633
- * @param {boolean} [includeAnomalies] Include validation anomalies for each row in the response
755
+ * Retrieves a list of workflows with pagination and search capabilities
756
+ * @summary Get a list of workflows
757
+ * @param {string} [search] Search term to filter workflows by name or URL
758
+ * @param {number} [skip] Number of items to skip
759
+ * @param {number} [limit] Maximum number of items to return
760
+ * @param {V4WorkflowsGetStateEnum} [state] Filter workflows by state
761
+ * @param {Array<string>} [tags] Filter workflows by tags
762
+ * @param {V4WorkflowsGetMonitoringEnum} [monitoring] Filter workflows by monitoring status
763
+ * @param {V4WorkflowsGetUpdateIntervalEnum} [updateInterval] Filter workflows by update interval
764
+ * @param {string} [templateId] Filter workflows by template ID (DEPRECATED - templates replaced by schemas)
765
+ * @param {V4WorkflowsGetIncludeDeletedEnum} [includeDeleted] Include deleted workflows (for compliance officers)
766
+ * @param {V4WorkflowsGetFormatEnum} [format] Response format (json or csv for export)
634
767
  * @param {*} [options] Override http request option.
635
768
  * @throws {RequiredError}
636
769
  */
637
- v4WorkflowsWorkflowIdDataGet: async (workflowId, xApiKey, authorization, runId, format, sortBy, order, filters, page, limit, gzip, rowIds, includeAnomalies, options = {}) => {
638
- assertParamExists("v4WorkflowsWorkflowIdDataGet", "workflowId", workflowId);
639
- const localVarPath = `/v4/workflows/{workflowId}/data`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
640
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
770
+ v4WorkflowsGet: async (search, skip, limit, state, tags, monitoring, updateInterval, templateId, includeDeleted, format, options = {}) => {
771
+ const localVarPath = `/v4/workflows`;
772
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
641
773
  let baseOptions;
642
774
  if (configuration) {
643
775
  baseOptions = configuration.baseOptions;
@@ -646,42 +778,35 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
646
778
  const localVarHeaderParameter = {};
647
779
  const localVarQueryParameter = {};
648
780
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
649
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
650
- if (runId !== void 0) {
651
- localVarQueryParameter["runId"] = runId;
652
- }
653
- if (format !== void 0) {
654
- localVarQueryParameter["format"] = format;
655
- }
656
- if (sortBy !== void 0) {
657
- localVarQueryParameter["sortBy"] = sortBy;
658
- }
659
- if (order !== void 0) {
660
- localVarQueryParameter["order"] = order;
661
- }
662
- if (filters !== void 0) {
663
- localVarQueryParameter["filters"] = filters;
781
+ if (search !== void 0) {
782
+ localVarQueryParameter["search"] = search;
664
783
  }
665
- if (page !== void 0) {
666
- localVarQueryParameter["page"] = page;
784
+ if (skip !== void 0) {
785
+ localVarQueryParameter["skip"] = skip;
667
786
  }
668
787
  if (limit !== void 0) {
669
788
  localVarQueryParameter["limit"] = limit;
670
789
  }
671
- if (gzip !== void 0) {
672
- localVarQueryParameter["gzip"] = gzip;
790
+ if (state !== void 0) {
791
+ localVarQueryParameter["state"] = state;
673
792
  }
674
- if (rowIds !== void 0) {
675
- localVarQueryParameter["rowIds"] = rowIds;
793
+ if (tags) {
794
+ localVarQueryParameter["tags"] = tags;
676
795
  }
677
- if (includeAnomalies !== void 0) {
678
- localVarQueryParameter["includeAnomalies"] = includeAnomalies;
796
+ if (monitoring !== void 0) {
797
+ localVarQueryParameter["monitoring"] = monitoring;
679
798
  }
680
- if (xApiKey != null) {
681
- localVarHeaderParameter["x-api-key"] = String(xApiKey);
799
+ if (updateInterval !== void 0) {
800
+ localVarQueryParameter["updateInterval"] = updateInterval;
682
801
  }
683
- if (authorization != null) {
684
- localVarHeaderParameter["Authorization"] = String(authorization);
802
+ if (templateId !== void 0) {
803
+ localVarQueryParameter["templateId"] = templateId;
804
+ }
805
+ if (includeDeleted !== void 0) {
806
+ localVarQueryParameter["includeDeleted"] = includeDeleted;
807
+ }
808
+ if (format !== void 0) {
809
+ localVarQueryParameter["format"] = format;
685
810
  }
686
811
  setSearchParams(localVarUrlObj, localVarQueryParameter);
687
812
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -693,53 +818,58 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
693
818
  },
694
819
  /**
695
820
  *
696
- * @summary Delete a workflow
697
- * @param {string} workflowId The ID of the workflow to delete
821
+ * @summary Create a new workflow
822
+ * @param {V4WorkflowsPostRequest} v4WorkflowsPostRequest
698
823
  * @param {*} [options] Override http request option.
699
824
  * @throws {RequiredError}
700
825
  */
701
- v4WorkflowsWorkflowIdDelete: async (workflowId, options = {}) => {
702
- assertParamExists("v4WorkflowsWorkflowIdDelete", "workflowId", workflowId);
703
- const localVarPath = `/v4/workflows/{workflowId}`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
704
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
826
+ v4WorkflowsPost: async (v4WorkflowsPostRequest, options = {}) => {
827
+ assertParamExists("v4WorkflowsPost", "v4WorkflowsPostRequest", v4WorkflowsPostRequest);
828
+ const localVarPath = `/v4/workflows`;
829
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
705
830
  let baseOptions;
706
831
  if (configuration) {
707
832
  baseOptions = configuration.baseOptions;
708
833
  }
709
- const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
834
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
710
835
  const localVarHeaderParameter = {};
711
836
  const localVarQueryParameter = {};
712
837
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
838
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
839
+ localVarHeaderParameter["Content-Type"] = "application/json";
713
840
  setSearchParams(localVarUrlObj, localVarQueryParameter);
714
841
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
715
842
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
843
+ localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsPostRequest, localVarRequestOptions, configuration);
716
844
  return {
717
845
  url: toPathString(localVarUrlObj),
718
846
  options: localVarRequestOptions
719
847
  };
720
848
  },
721
849
  /**
722
- * Retrieves detailed information about a specific workflow. This endpoint requires authentication and proper team access permissions.
723
- * @summary Get workflow by ID
724
- * @param {string} workflowId ID of the workflow to retrieve
850
+ *
851
+ * @summary Edit an existing workflow
852
+ * @param {V4WorkflowsSetupEditPostRequest} v4WorkflowsSetupEditPostRequest Updated information to edit an existing workflow
725
853
  * @param {*} [options] Override http request option.
726
854
  * @throws {RequiredError}
727
855
  */
728
- v4WorkflowsWorkflowIdGet: async (workflowId, options = {}) => {
729
- assertParamExists("v4WorkflowsWorkflowIdGet", "workflowId", workflowId);
730
- const localVarPath = `/v4/workflows/{workflowId}`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
731
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
856
+ v4WorkflowsSetupEditPost: async (v4WorkflowsSetupEditPostRequest, options = {}) => {
857
+ assertParamExists("v4WorkflowsSetupEditPost", "v4WorkflowsSetupEditPostRequest", v4WorkflowsSetupEditPostRequest);
858
+ const localVarPath = `/v4/workflows/setup/edit`;
859
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
732
860
  let baseOptions;
733
861
  if (configuration) {
734
862
  baseOptions = configuration.baseOptions;
735
863
  }
736
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
864
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
737
865
  const localVarHeaderParameter = {};
738
866
  const localVarQueryParameter = {};
739
867
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
868
+ localVarHeaderParameter["Content-Type"] = "application/json";
740
869
  setSearchParams(localVarUrlObj, localVarQueryParameter);
741
870
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
742
871
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
872
+ localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsSetupEditPostRequest, localVarRequestOptions, configuration);
743
873
  return {
744
874
  url: toPathString(localVarUrlObj),
745
875
  options: localVarRequestOptions
@@ -747,26 +877,28 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
747
877
  },
748
878
  /**
749
879
  *
750
- * @summary Get the workflow run history
751
- * @param {string} workflowId The unique identifier of the workflow whose runs history is to be retrieved
880
+ * @summary Set up a new workflow
881
+ * @param {V4WorkflowsSetupPostRequest} v4WorkflowsSetupPostRequest Required information to set up a new workflow
752
882
  * @param {*} [options] Override http request option.
753
883
  * @throws {RequiredError}
754
884
  */
755
- v4WorkflowsWorkflowIdHistoryGet: async (workflowId, options = {}) => {
756
- assertParamExists("v4WorkflowsWorkflowIdHistoryGet", "workflowId", workflowId);
757
- const localVarPath = `/v4/workflows/{workflowId}/history`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
758
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
885
+ v4WorkflowsSetupPost: async (v4WorkflowsSetupPostRequest, options = {}) => {
886
+ assertParamExists("v4WorkflowsSetupPost", "v4WorkflowsSetupPostRequest", v4WorkflowsSetupPostRequest);
887
+ const localVarPath = `/v4/workflows/setup`;
888
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
759
889
  let baseOptions;
760
890
  if (configuration) {
761
891
  baseOptions = configuration.baseOptions;
762
892
  }
763
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
893
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
764
894
  const localVarHeaderParameter = {};
765
895
  const localVarQueryParameter = {};
766
896
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
897
+ localVarHeaderParameter["Content-Type"] = "application/json";
767
898
  setSearchParams(localVarUrlObj, localVarQueryParameter);
768
899
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
769
900
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
901
+ localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsSetupPostRequest, localVarRequestOptions, configuration);
770
902
  return {
771
903
  url: toPathString(localVarUrlObj),
772
904
  options: localVarRequestOptions
@@ -774,30 +906,43 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
774
906
  },
775
907
  /**
776
908
  *
777
- * @summary Update workflow metadata
778
- * @param {string} workflowId ID of the workflow to update
779
- * @param {V4WorkflowsWorkflowIdMetadataPutRequest} v4WorkflowsWorkflowIdMetadataPutRequest
909
+ * @summary Get workflow audit log entries
910
+ * @param {string} workflowId ID of the workflow to retrieve audit logs from
911
+ * @param {string} [xApiKey] API key for authorization
912
+ * @param {string} [authorization] Bearer token for authorization
913
+ * @param {number} [page] Page number for pagination
914
+ * @param {number} [limit] Number of items per page
780
915
  * @param {*} [options] Override http request option.
781
916
  * @throws {RequiredError}
782
917
  */
783
- v4WorkflowsWorkflowIdMetadataPut: async (workflowId, v4WorkflowsWorkflowIdMetadataPutRequest, options = {}) => {
784
- assertParamExists("v4WorkflowsWorkflowIdMetadataPut", "workflowId", workflowId);
785
- assertParamExists("v4WorkflowsWorkflowIdMetadataPut", "v4WorkflowsWorkflowIdMetadataPutRequest", v4WorkflowsWorkflowIdMetadataPutRequest);
786
- const localVarPath = `/v4/workflows/{workflowId}/metadata`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
787
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
918
+ v4WorkflowsWorkflowIdAuditlogGet: async (workflowId, xApiKey, authorization, page, limit, options = {}) => {
919
+ assertParamExists("v4WorkflowsWorkflowIdAuditlogGet", "workflowId", workflowId);
920
+ const localVarPath = `/v4/workflows/{workflowId}/auditlog`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
921
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
788
922
  let baseOptions;
789
923
  if (configuration) {
790
924
  baseOptions = configuration.baseOptions;
791
925
  }
792
- const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
926
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
793
927
  const localVarHeaderParameter = {};
794
928
  const localVarQueryParameter = {};
795
929
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
796
- localVarHeaderParameter["Content-Type"] = "application/json";
797
- setSearchParams(localVarUrlObj, localVarQueryParameter);
798
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
930
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
931
+ if (page !== void 0) {
932
+ localVarQueryParameter["page"] = page;
933
+ }
934
+ if (limit !== void 0) {
935
+ localVarQueryParameter["limit"] = limit;
936
+ }
937
+ if (xApiKey != null) {
938
+ localVarHeaderParameter["x-api-key"] = String(xApiKey);
939
+ }
940
+ if (authorization != null) {
941
+ localVarHeaderParameter["Authorization"] = String(authorization);
942
+ }
943
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
944
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
799
945
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
800
- localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsWorkflowIdMetadataPutRequest, localVarRequestOptions, configuration);
801
946
  return {
802
947
  url: toPathString(localVarUrlObj),
803
948
  options: localVarRequestOptions
@@ -805,15 +950,17 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
805
950
  },
806
951
  /**
807
952
  *
808
- * @summary Pause a workflow
809
- * @param {string} workflowId The ID of the workflow to pause
953
+ * @summary Approve workflow for compliance
954
+ * @param {string} workflowId ID of the workflow to approve
955
+ * @param {string} [xApiKey] API key for authorization
956
+ * @param {string} [authorization] Bearer token for authorization
810
957
  * @param {*} [options] Override http request option.
811
958
  * @throws {RequiredError}
812
959
  */
813
- v4WorkflowsWorkflowIdPausePut: async (workflowId, options = {}) => {
814
- assertParamExists("v4WorkflowsWorkflowIdPausePut", "workflowId", workflowId);
815
- const localVarPath = `/v4/workflows/{workflowId}/pause`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
816
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
960
+ v4WorkflowsWorkflowIdComplianceApprovePut: async (workflowId, xApiKey, authorization, options = {}) => {
961
+ assertParamExists("v4WorkflowsWorkflowIdComplianceApprovePut", "workflowId", workflowId);
962
+ const localVarPath = `/v4/workflows/{workflowId}/compliance-approve`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
963
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
817
964
  let baseOptions;
818
965
  if (configuration) {
819
966
  baseOptions = configuration.baseOptions;
@@ -822,6 +969,12 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
822
969
  const localVarHeaderParameter = {};
823
970
  const localVarQueryParameter = {};
824
971
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
972
+ if (xApiKey != null) {
973
+ localVarHeaderParameter["x-api-key"] = String(xApiKey);
974
+ }
975
+ if (authorization != null) {
976
+ localVarHeaderParameter["Authorization"] = String(authorization);
977
+ }
825
978
  setSearchParams(localVarUrlObj, localVarQueryParameter);
826
979
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
827
980
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -831,16 +984,20 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
831
984
  };
832
985
  },
833
986
  /**
834
- * Resumes a paused, preview, or error workflow. If the user\'s team/organization or any of the user\'s organizations has the COMPLIANCE_REVIEW rule enabled, the workflow will be sent for compliance review instead of being directly activated.
835
- * @summary Resume a workflow
836
- * @param {string} workflowId The ID of the workflow to resume
987
+ *
988
+ * @summary Reject workflow for compliance
989
+ * @param {string} workflowId ID of the workflow to reject
990
+ * @param {V4WorkflowsWorkflowIdComplianceRejectPutRequest} v4WorkflowsWorkflowIdComplianceRejectPutRequest
991
+ * @param {string} [xApiKey] API key for authorization
992
+ * @param {string} [authorization] Bearer token for authorization
837
993
  * @param {*} [options] Override http request option.
838
994
  * @throws {RequiredError}
839
995
  */
840
- v4WorkflowsWorkflowIdResumePut: async (workflowId, options = {}) => {
841
- assertParamExists("v4WorkflowsWorkflowIdResumePut", "workflowId", workflowId);
842
- const localVarPath = `/v4/workflows/{workflowId}/resume`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
843
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
996
+ v4WorkflowsWorkflowIdComplianceRejectPut: async (workflowId, v4WorkflowsWorkflowIdComplianceRejectPutRequest, xApiKey, authorization, options = {}) => {
997
+ assertParamExists("v4WorkflowsWorkflowIdComplianceRejectPut", "workflowId", workflowId);
998
+ assertParamExists("v4WorkflowsWorkflowIdComplianceRejectPut", "v4WorkflowsWorkflowIdComplianceRejectPutRequest", v4WorkflowsWorkflowIdComplianceRejectPutRequest);
999
+ const localVarPath = `/v4/workflows/{workflowId}/compliance-reject`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1000
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
844
1001
  let baseOptions;
845
1002
  if (configuration) {
846
1003
  baseOptions = configuration.baseOptions;
@@ -849,9 +1006,17 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
849
1006
  const localVarHeaderParameter = {};
850
1007
  const localVarQueryParameter = {};
851
1008
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1009
+ localVarHeaderParameter["Content-Type"] = "application/json";
1010
+ if (xApiKey != null) {
1011
+ localVarHeaderParameter["x-api-key"] = String(xApiKey);
1012
+ }
1013
+ if (authorization != null) {
1014
+ localVarHeaderParameter["Authorization"] = String(authorization);
1015
+ }
852
1016
  setSearchParams(localVarUrlObj, localVarQueryParameter);
853
1017
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
854
1018
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1019
+ localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsWorkflowIdComplianceRejectPutRequest, localVarRequestOptions, configuration);
855
1020
  return {
856
1021
  url: toPathString(localVarUrlObj),
857
1022
  options: localVarRequestOptions
@@ -859,23 +1024,72 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
859
1024
  },
860
1025
  /**
861
1026
  *
862
- * @summary Run a workflow
863
- * @param {string} workflowId The ID of the workflow to run
1027
+ * @summary Get workflow data by ID
1028
+ * @param {string} workflowId ID of the workflow to retrieve data from
1029
+ * @param {string} [xApiKey] API key for authorization
1030
+ * @param {string} [authorization] Bearer token for authorization
1031
+ * @param {string} [runId] ID of a specific run to retrieve data from
1032
+ * @param {V4WorkflowsWorkflowIdDataGetFormatEnum} [format] Format of the response data
1033
+ * @param {string} [sortBy] Field to sort the results by
1034
+ * @param {V4WorkflowsWorkflowIdDataGetOrderEnum} [order] Sort order (ascending or descending)
1035
+ * @param {string} [filters] JSON-encoded array of filter objects
1036
+ * @param {number} [page] Page number for pagination
1037
+ * @param {number} [limit] Number of items per page (0 for streaming all data)
1038
+ * @param {boolean} [gzip] Enable gzip compression for the response
1039
+ * @param {string} [rowIds] Filter results by specific row IDs (comma-separated or JSON array)
1040
+ * @param {boolean} [includeAnomalies] Include validation anomalies for each row in the response
864
1041
  * @param {*} [options] Override http request option.
865
1042
  * @throws {RequiredError}
866
1043
  */
867
- v4WorkflowsWorkflowIdRunPut: async (workflowId, options = {}) => {
868
- assertParamExists("v4WorkflowsWorkflowIdRunPut", "workflowId", workflowId);
869
- const localVarPath = `/v4/workflows/{workflowId}/run`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
870
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
1044
+ v4WorkflowsWorkflowIdDataGet: async (workflowId, xApiKey, authorization, runId, format, sortBy, order, filters, page, limit, gzip, rowIds, includeAnomalies, options = {}) => {
1045
+ assertParamExists("v4WorkflowsWorkflowIdDataGet", "workflowId", workflowId);
1046
+ const localVarPath = `/v4/workflows/{workflowId}/data`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1047
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
871
1048
  let baseOptions;
872
1049
  if (configuration) {
873
1050
  baseOptions = configuration.baseOptions;
874
1051
  }
875
- const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
1052
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
876
1053
  const localVarHeaderParameter = {};
877
1054
  const localVarQueryParameter = {};
878
1055
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1056
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1057
+ if (runId !== void 0) {
1058
+ localVarQueryParameter["runId"] = runId;
1059
+ }
1060
+ if (format !== void 0) {
1061
+ localVarQueryParameter["format"] = format;
1062
+ }
1063
+ if (sortBy !== void 0) {
1064
+ localVarQueryParameter["sortBy"] = sortBy;
1065
+ }
1066
+ if (order !== void 0) {
1067
+ localVarQueryParameter["order"] = order;
1068
+ }
1069
+ if (filters !== void 0) {
1070
+ localVarQueryParameter["filters"] = filters;
1071
+ }
1072
+ if (page !== void 0) {
1073
+ localVarQueryParameter["page"] = page;
1074
+ }
1075
+ if (limit !== void 0) {
1076
+ localVarQueryParameter["limit"] = limit;
1077
+ }
1078
+ if (gzip !== void 0) {
1079
+ localVarQueryParameter["gzip"] = gzip;
1080
+ }
1081
+ if (rowIds !== void 0) {
1082
+ localVarQueryParameter["rowIds"] = rowIds;
1083
+ }
1084
+ if (includeAnomalies !== void 0) {
1085
+ localVarQueryParameter["includeAnomalies"] = includeAnomalies;
1086
+ }
1087
+ if (xApiKey != null) {
1088
+ localVarHeaderParameter["x-api-key"] = String(xApiKey);
1089
+ }
1090
+ if (authorization != null) {
1091
+ localVarHeaderParameter["Authorization"] = String(authorization);
1092
+ }
879
1093
  setSearchParams(localVarUrlObj, localVarQueryParameter);
880
1094
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
881
1095
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -886,48 +1100,42 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
886
1100
  },
887
1101
  /**
888
1102
  *
889
- * @summary Schedule a workflow
890
- * @param {string} workflowId The ID of the workflow to schedule
891
- * @param {V4WorkflowsWorkflowIdSchedulePutRequest} v4WorkflowsWorkflowIdSchedulePutRequest ISO date (attention its timezone UTC) string required in request body
1103
+ * @summary Delete a workflow
1104
+ * @param {string} workflowId The ID of the workflow to delete
892
1105
  * @param {*} [options] Override http request option.
893
1106
  * @throws {RequiredError}
894
1107
  */
895
- v4WorkflowsWorkflowIdSchedulePut: async (workflowId, v4WorkflowsWorkflowIdSchedulePutRequest, options = {}) => {
896
- assertParamExists("v4WorkflowsWorkflowIdSchedulePut", "workflowId", workflowId);
897
- assertParamExists("v4WorkflowsWorkflowIdSchedulePut", "v4WorkflowsWorkflowIdSchedulePutRequest", v4WorkflowsWorkflowIdSchedulePutRequest);
898
- const localVarPath = `/v4/workflows/{workflowId}/schedule`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
899
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
1108
+ v4WorkflowsWorkflowIdDelete: async (workflowId, options = {}) => {
1109
+ assertParamExists("v4WorkflowsWorkflowIdDelete", "workflowId", workflowId);
1110
+ const localVarPath = `/v4/workflows/{workflowId}`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1111
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
900
1112
  let baseOptions;
901
1113
  if (configuration) {
902
1114
  baseOptions = configuration.baseOptions;
903
1115
  }
904
- const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
1116
+ const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
905
1117
  const localVarHeaderParameter = {};
906
1118
  const localVarQueryParameter = {};
907
1119
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
908
- localVarHeaderParameter["Content-Type"] = "application/json";
909
1120
  setSearchParams(localVarUrlObj, localVarQueryParameter);
910
1121
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
911
1122
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
912
- localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsWorkflowIdSchedulePutRequest, localVarRequestOptions, configuration);
913
1123
  return {
914
1124
  url: toPathString(localVarUrlObj),
915
1125
  options: localVarRequestOptions
916
1126
  };
917
1127
  },
918
1128
  /**
919
- *
920
- * @summary Get data change by ID (PostgreSQL)
921
- * @param {string} changeId ID of the workflow change to retrieve
922
- * @param {string} [xApiKey] API key for authorization
923
- * @param {string} [authorization] Bearer token for authorization
1129
+ * Retrieves detailed information about a specific workflow. This endpoint requires authentication and proper team access permissions.
1130
+ * @summary Get workflow by ID
1131
+ * @param {string} workflowId ID of the workflow to retrieve
924
1132
  * @param {*} [options] Override http request option.
925
1133
  * @throws {RequiredError}
926
1134
  */
927
- v5ChangesChangeIdGet: async (changeId, xApiKey, authorization, options = {}) => {
928
- assertParamExists("v5ChangesChangeIdGet", "changeId", changeId);
929
- const localVarPath = `/v5/changes/{changeId}`.replace(`{${"changeId"}}`, encodeURIComponent(String(changeId)));
930
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
1135
+ v4WorkflowsWorkflowIdGet: async (workflowId, options = {}) => {
1136
+ assertParamExists("v4WorkflowsWorkflowIdGet", "workflowId", workflowId);
1137
+ const localVarPath = `/v4/workflows/{workflowId}`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1138
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
931
1139
  let baseOptions;
932
1140
  if (configuration) {
933
1141
  baseOptions = configuration.baseOptions;
@@ -936,13 +1144,6 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
936
1144
  const localVarHeaderParameter = {};
937
1145
  const localVarQueryParameter = {};
938
1146
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
939
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
940
- if (xApiKey != null) {
941
- localVarHeaderParameter["x-api-key"] = String(xApiKey);
942
- }
943
- if (authorization != null) {
944
- localVarHeaderParameter["Authorization"] = String(authorization);
945
- }
946
1147
  setSearchParams(localVarUrlObj, localVarQueryParameter);
947
1148
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
948
1149
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -953,20 +1154,15 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
953
1154
  },
954
1155
  /**
955
1156
  *
956
- * @summary Get all data changes (PostgreSQL)
957
- * @param {string} [xApiKey] API key for authorization
958
- * @param {string} [authorization] Bearer token for authorization
959
- * @param {string} [workflowIds] Comma-separated list of workflow IDs. If not provided, returns changes for all ACTIVE workflows
960
- * @param {string} [startDate] Start date to filter changes (ISO format)
961
- * @param {string} [endDate] End date to filter changes (ISO format)
962
- * @param {number} [skip] Number of records to skip for pagination
963
- * @param {number} [limit] Number of records to return for pagination
1157
+ * @summary Get the workflow run history
1158
+ * @param {string} workflowId The unique identifier of the workflow whose runs history is to be retrieved
964
1159
  * @param {*} [options] Override http request option.
965
1160
  * @throws {RequiredError}
966
1161
  */
967
- v5ChangesGet: async (xApiKey, authorization, workflowIds, startDate, endDate, skip, limit, options = {}) => {
968
- const localVarPath = `/v5/changes`;
969
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
1162
+ v4WorkflowsWorkflowIdHistoryGet: async (workflowId, options = {}) => {
1163
+ assertParamExists("v4WorkflowsWorkflowIdHistoryGet", "workflowId", workflowId);
1164
+ const localVarPath = `/v4/workflows/{workflowId}/history`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1165
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
970
1166
  let baseOptions;
971
1167
  if (configuration) {
972
1168
  baseOptions = configuration.baseOptions;
@@ -975,28 +1171,6 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
975
1171
  const localVarHeaderParameter = {};
976
1172
  const localVarQueryParameter = {};
977
1173
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
978
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
979
- if (workflowIds !== void 0) {
980
- localVarQueryParameter["workflowIds"] = workflowIds;
981
- }
982
- if (startDate !== void 0) {
983
- localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString() : startDate;
984
- }
985
- if (endDate !== void 0) {
986
- localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString() : endDate;
987
- }
988
- if (skip !== void 0) {
989
- localVarQueryParameter["skip"] = skip;
990
- }
991
- if (limit !== void 0) {
992
- localVarQueryParameter["limit"] = limit;
993
- }
994
- if (xApiKey != null) {
995
- localVarHeaderParameter["x-api-key"] = String(xApiKey);
996
- }
997
- if (authorization != null) {
998
- localVarHeaderParameter["Authorization"] = String(authorization);
999
- }
1000
1174
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1001
1175
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1002
1176
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -1006,53 +1180,55 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
1006
1180
  };
1007
1181
  },
1008
1182
  /**
1009
- * Permanently deletes a workflow and its associated tags
1010
- * @summary Delete a workflow
1011
- * @param {string} id The ID of the workflow to delete
1183
+ *
1184
+ * @summary Update workflow metadata
1185
+ * @param {string} workflowId ID of the workflow to update
1186
+ * @param {V4WorkflowsWorkflowIdMetadataPutRequest} v4WorkflowsWorkflowIdMetadataPutRequest
1012
1187
  * @param {*} [options] Override http request option.
1013
1188
  * @throws {RequiredError}
1014
1189
  */
1015
- v5WorkflowsIdDelete: async (id, options = {}) => {
1016
- assertParamExists("v5WorkflowsIdDelete", "id", id);
1017
- const localVarPath = `/v5/workflows/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(id)));
1018
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
1190
+ v4WorkflowsWorkflowIdMetadataPut: async (workflowId, v4WorkflowsWorkflowIdMetadataPutRequest, options = {}) => {
1191
+ assertParamExists("v4WorkflowsWorkflowIdMetadataPut", "workflowId", workflowId);
1192
+ assertParamExists("v4WorkflowsWorkflowIdMetadataPut", "v4WorkflowsWorkflowIdMetadataPutRequest", v4WorkflowsWorkflowIdMetadataPutRequest);
1193
+ const localVarPath = `/v4/workflows/{workflowId}/metadata`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1194
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1019
1195
  let baseOptions;
1020
1196
  if (configuration) {
1021
1197
  baseOptions = configuration.baseOptions;
1022
1198
  }
1023
- const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
1199
+ const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
1024
1200
  const localVarHeaderParameter = {};
1025
1201
  const localVarQueryParameter = {};
1026
1202
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1027
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
1203
+ localVarHeaderParameter["Content-Type"] = "application/json";
1028
1204
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1029
1205
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1030
1206
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1207
+ localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsWorkflowIdMetadataPutRequest, localVarRequestOptions, configuration);
1031
1208
  return {
1032
1209
  url: toPathString(localVarUrlObj),
1033
1210
  options: localVarRequestOptions
1034
1211
  };
1035
1212
  },
1036
1213
  /**
1037
- * Retrieves a specific workflow and its associated tags by ID
1038
- * @summary Get workflow by ID
1039
- * @param {string} id The ID of the workflow to retrieve
1214
+ *
1215
+ * @summary Pause a workflow
1216
+ * @param {string} workflowId The ID of the workflow to pause
1040
1217
  * @param {*} [options] Override http request option.
1041
1218
  * @throws {RequiredError}
1042
1219
  */
1043
- v5WorkflowsIdGet: async (id, options = {}) => {
1044
- assertParamExists("v5WorkflowsIdGet", "id", id);
1045
- const localVarPath = `/v5/workflows/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(id)));
1046
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
1220
+ v4WorkflowsWorkflowIdPausePut: async (workflowId, options = {}) => {
1221
+ assertParamExists("v4WorkflowsWorkflowIdPausePut", "workflowId", workflowId);
1222
+ const localVarPath = `/v4/workflows/{workflowId}/pause`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1223
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1047
1224
  let baseOptions;
1048
1225
  if (configuration) {
1049
1226
  baseOptions = configuration.baseOptions;
1050
1227
  }
1051
- const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
1228
+ const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
1052
1229
  const localVarHeaderParameter = {};
1053
1230
  const localVarQueryParameter = {};
1054
1231
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1055
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
1056
1232
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1057
1233
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1058
1234
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
@@ -1062,18 +1238,16 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
1062
1238
  };
1063
1239
  },
1064
1240
  /**
1065
- * Updates an existing workflow\'s properties
1066
- * @summary Update a workflow
1067
- * @param {string} id The ID of the workflow to update
1068
- * @param {V5WorkflowsIdPutRequest} v5WorkflowsIdPutRequest
1241
+ * Resumes a paused, preview, or error workflow. If the user\'s team/organization or any of the user\'s organizations has the COMPLIANCE_REVIEW rule enabled, the workflow will be sent for compliance review instead of being directly activated.
1242
+ * @summary Resume a workflow
1243
+ * @param {string} workflowId The ID of the workflow to resume
1069
1244
  * @param {*} [options] Override http request option.
1070
1245
  * @throws {RequiredError}
1071
1246
  */
1072
- v5WorkflowsIdPut: async (id, v5WorkflowsIdPutRequest, options = {}) => {
1073
- assertParamExists("v5WorkflowsIdPut", "id", id);
1074
- assertParamExists("v5WorkflowsIdPut", "v5WorkflowsIdPutRequest", v5WorkflowsIdPutRequest);
1075
- const localVarPath = `/v5/workflows/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(id)));
1076
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
1247
+ v4WorkflowsWorkflowIdResumePut: async (workflowId, options = {}) => {
1248
+ assertParamExists("v4WorkflowsWorkflowIdResumePut", "workflowId", workflowId);
1249
+ const localVarPath = `/v4/workflows/{workflowId}/resume`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1250
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1077
1251
  let baseOptions;
1078
1252
  if (configuration) {
1079
1253
  baseOptions = configuration.baseOptions;
@@ -1082,28 +1256,261 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
1082
1256
  const localVarHeaderParameter = {};
1083
1257
  const localVarQueryParameter = {};
1084
1258
  await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1085
- await setBearerAuthToObject(localVarHeaderParameter, configuration);
1086
- localVarHeaderParameter["Content-Type"] = "application/json";
1087
1259
  setSearchParams(localVarUrlObj, localVarQueryParameter);
1088
1260
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1089
1261
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1090
- localVarRequestOptions.data = serializeDataIfNeeded(v5WorkflowsIdPutRequest, localVarRequestOptions, configuration);
1091
1262
  return {
1092
1263
  url: toPathString(localVarUrlObj),
1093
1264
  options: localVarRequestOptions
1094
1265
  };
1095
1266
  },
1096
1267
  /**
1097
- * Creates a new workflow in pending state
1098
- * @summary Create a new workflow
1099
- * @param {V5WorkflowsPostRequest} v5WorkflowsPostRequest
1268
+ *
1269
+ * @summary Run a workflow
1270
+ * @param {string} workflowId The ID of the workflow to run
1100
1271
  * @param {*} [options] Override http request option.
1101
1272
  * @throws {RequiredError}
1102
1273
  */
1103
- v5WorkflowsPost: async (v5WorkflowsPostRequest, options = {}) => {
1104
- assertParamExists("v5WorkflowsPost", "v5WorkflowsPostRequest", v5WorkflowsPostRequest);
1105
- const localVarPath = `/v5/workflows`;
1106
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
1274
+ v4WorkflowsWorkflowIdRunPut: async (workflowId, options = {}) => {
1275
+ assertParamExists("v4WorkflowsWorkflowIdRunPut", "workflowId", workflowId);
1276
+ const localVarPath = `/v4/workflows/{workflowId}/run`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1277
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1278
+ let baseOptions;
1279
+ if (configuration) {
1280
+ baseOptions = configuration.baseOptions;
1281
+ }
1282
+ const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
1283
+ const localVarHeaderParameter = {};
1284
+ const localVarQueryParameter = {};
1285
+ await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1286
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1287
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1288
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1289
+ return {
1290
+ url: toPathString(localVarUrlObj),
1291
+ options: localVarRequestOptions
1292
+ };
1293
+ },
1294
+ /**
1295
+ *
1296
+ * @summary Schedule a workflow
1297
+ * @param {string} workflowId The ID of the workflow to schedule
1298
+ * @param {V4WorkflowsWorkflowIdSchedulePutRequest} v4WorkflowsWorkflowIdSchedulePutRequest ISO date (attention its timezone UTC) string required in request body
1299
+ * @param {*} [options] Override http request option.
1300
+ * @throws {RequiredError}
1301
+ */
1302
+ v4WorkflowsWorkflowIdSchedulePut: async (workflowId, v4WorkflowsWorkflowIdSchedulePutRequest, options = {}) => {
1303
+ assertParamExists("v4WorkflowsWorkflowIdSchedulePut", "workflowId", workflowId);
1304
+ assertParamExists("v4WorkflowsWorkflowIdSchedulePut", "v4WorkflowsWorkflowIdSchedulePutRequest", v4WorkflowsWorkflowIdSchedulePutRequest);
1305
+ const localVarPath = `/v4/workflows/{workflowId}/schedule`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1306
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1307
+ let baseOptions;
1308
+ if (configuration) {
1309
+ baseOptions = configuration.baseOptions;
1310
+ }
1311
+ const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
1312
+ const localVarHeaderParameter = {};
1313
+ const localVarQueryParameter = {};
1314
+ await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1315
+ localVarHeaderParameter["Content-Type"] = "application/json";
1316
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1317
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1318
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1319
+ localVarRequestOptions.data = serializeDataIfNeeded(v4WorkflowsWorkflowIdSchedulePutRequest, localVarRequestOptions, configuration);
1320
+ return {
1321
+ url: toPathString(localVarUrlObj),
1322
+ options: localVarRequestOptions
1323
+ };
1324
+ },
1325
+ /**
1326
+ *
1327
+ * @summary Get data change by ID (PostgreSQL)
1328
+ * @param {string} changeId ID of the workflow change to retrieve
1329
+ * @param {string} [xApiKey] API key for authorization
1330
+ * @param {string} [authorization] Bearer token for authorization
1331
+ * @param {*} [options] Override http request option.
1332
+ * @throws {RequiredError}
1333
+ */
1334
+ v5ChangesChangeIdGet: async (changeId, xApiKey, authorization, options = {}) => {
1335
+ assertParamExists("v5ChangesChangeIdGet", "changeId", changeId);
1336
+ const localVarPath = `/v5/changes/{changeId}`.replace(`{${"changeId"}}`, encodeURIComponent(String(changeId)));
1337
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1338
+ let baseOptions;
1339
+ if (configuration) {
1340
+ baseOptions = configuration.baseOptions;
1341
+ }
1342
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
1343
+ const localVarHeaderParameter = {};
1344
+ const localVarQueryParameter = {};
1345
+ await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1346
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1347
+ if (xApiKey != null) {
1348
+ localVarHeaderParameter["x-api-key"] = String(xApiKey);
1349
+ }
1350
+ if (authorization != null) {
1351
+ localVarHeaderParameter["Authorization"] = String(authorization);
1352
+ }
1353
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1354
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1355
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1356
+ return {
1357
+ url: toPathString(localVarUrlObj),
1358
+ options: localVarRequestOptions
1359
+ };
1360
+ },
1361
+ /**
1362
+ *
1363
+ * @summary Get all data changes (PostgreSQL)
1364
+ * @param {string} [xApiKey] API key for authorization
1365
+ * @param {string} [authorization] Bearer token for authorization
1366
+ * @param {string} [workflowIds] Comma-separated list of workflow IDs. If not provided, returns changes for all ACTIVE workflows
1367
+ * @param {string} [startDate] Start date to filter changes (ISO format)
1368
+ * @param {string} [endDate] End date to filter changes (ISO format)
1369
+ * @param {number} [skip] Number of records to skip for pagination
1370
+ * @param {number} [limit] Number of records to return for pagination
1371
+ * @param {*} [options] Override http request option.
1372
+ * @throws {RequiredError}
1373
+ */
1374
+ v5ChangesGet: async (xApiKey, authorization, workflowIds, startDate, endDate, skip, limit, options = {}) => {
1375
+ const localVarPath = `/v5/changes`;
1376
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1377
+ let baseOptions;
1378
+ if (configuration) {
1379
+ baseOptions = configuration.baseOptions;
1380
+ }
1381
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
1382
+ const localVarHeaderParameter = {};
1383
+ const localVarQueryParameter = {};
1384
+ await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1385
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1386
+ if (workflowIds !== void 0) {
1387
+ localVarQueryParameter["workflowIds"] = workflowIds;
1388
+ }
1389
+ if (startDate !== void 0) {
1390
+ localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString() : startDate;
1391
+ }
1392
+ if (endDate !== void 0) {
1393
+ localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString() : endDate;
1394
+ }
1395
+ if (skip !== void 0) {
1396
+ localVarQueryParameter["skip"] = skip;
1397
+ }
1398
+ if (limit !== void 0) {
1399
+ localVarQueryParameter["limit"] = limit;
1400
+ }
1401
+ if (xApiKey != null) {
1402
+ localVarHeaderParameter["x-api-key"] = String(xApiKey);
1403
+ }
1404
+ if (authorization != null) {
1405
+ localVarHeaderParameter["Authorization"] = String(authorization);
1406
+ }
1407
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1408
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1409
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1410
+ return {
1411
+ url: toPathString(localVarUrlObj),
1412
+ options: localVarRequestOptions
1413
+ };
1414
+ },
1415
+ /**
1416
+ * Permanently deletes a workflow and its associated tags
1417
+ * @summary Delete a workflow
1418
+ * @param {string} id The ID of the workflow to delete
1419
+ * @param {*} [options] Override http request option.
1420
+ * @throws {RequiredError}
1421
+ */
1422
+ v5WorkflowsIdDelete: async (id, options = {}) => {
1423
+ assertParamExists("v5WorkflowsIdDelete", "id", id);
1424
+ const localVarPath = `/v5/workflows/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(id)));
1425
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1426
+ let baseOptions;
1427
+ if (configuration) {
1428
+ baseOptions = configuration.baseOptions;
1429
+ }
1430
+ const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
1431
+ const localVarHeaderParameter = {};
1432
+ const localVarQueryParameter = {};
1433
+ await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1434
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1435
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1436
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1437
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1438
+ return {
1439
+ url: toPathString(localVarUrlObj),
1440
+ options: localVarRequestOptions
1441
+ };
1442
+ },
1443
+ /**
1444
+ * Retrieves a specific workflow and its associated tags by ID
1445
+ * @summary Get workflow by ID
1446
+ * @param {string} id The ID of the workflow to retrieve
1447
+ * @param {*} [options] Override http request option.
1448
+ * @throws {RequiredError}
1449
+ */
1450
+ v5WorkflowsIdGet: async (id, options = {}) => {
1451
+ assertParamExists("v5WorkflowsIdGet", "id", id);
1452
+ const localVarPath = `/v5/workflows/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(id)));
1453
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1454
+ let baseOptions;
1455
+ if (configuration) {
1456
+ baseOptions = configuration.baseOptions;
1457
+ }
1458
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
1459
+ const localVarHeaderParameter = {};
1460
+ const localVarQueryParameter = {};
1461
+ await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1462
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1463
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1464
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1465
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1466
+ return {
1467
+ url: toPathString(localVarUrlObj),
1468
+ options: localVarRequestOptions
1469
+ };
1470
+ },
1471
+ /**
1472
+ * Updates an existing workflow\'s properties
1473
+ * @summary Update a workflow
1474
+ * @param {string} id The ID of the workflow to update
1475
+ * @param {V5WorkflowsIdPutRequest} v5WorkflowsIdPutRequest
1476
+ * @param {*} [options] Override http request option.
1477
+ * @throws {RequiredError}
1478
+ */
1479
+ v5WorkflowsIdPut: async (id, v5WorkflowsIdPutRequest, options = {}) => {
1480
+ assertParamExists("v5WorkflowsIdPut", "id", id);
1481
+ assertParamExists("v5WorkflowsIdPut", "v5WorkflowsIdPutRequest", v5WorkflowsIdPutRequest);
1482
+ const localVarPath = `/v5/workflows/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(id)));
1483
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1484
+ let baseOptions;
1485
+ if (configuration) {
1486
+ baseOptions = configuration.baseOptions;
1487
+ }
1488
+ const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
1489
+ const localVarHeaderParameter = {};
1490
+ const localVarQueryParameter = {};
1491
+ await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
1492
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
1493
+ localVarHeaderParameter["Content-Type"] = "application/json";
1494
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1495
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1496
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1497
+ localVarRequestOptions.data = serializeDataIfNeeded(v5WorkflowsIdPutRequest, localVarRequestOptions, configuration);
1498
+ return {
1499
+ url: toPathString(localVarUrlObj),
1500
+ options: localVarRequestOptions
1501
+ };
1502
+ },
1503
+ /**
1504
+ * Creates a new workflow in pending state
1505
+ * @summary Create a new workflow
1506
+ * @param {V5WorkflowsPostRequest} v5WorkflowsPostRequest
1507
+ * @param {*} [options] Override http request option.
1508
+ * @throws {RequiredError}
1509
+ */
1510
+ v5WorkflowsPost: async (v5WorkflowsPostRequest, options = {}) => {
1511
+ assertParamExists("v5WorkflowsPost", "v5WorkflowsPostRequest", v5WorkflowsPostRequest);
1512
+ const localVarPath = `/v5/workflows`;
1513
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1107
1514
  let baseOptions;
1108
1515
  if (configuration) {
1109
1516
  baseOptions = configuration.baseOptions;
@@ -1137,7 +1544,7 @@ var WorkflowsApiAxiosParamCreator = function(configuration) {
1137
1544
  v5WorkflowsWorkflowIdAuditlogGet: async (workflowId, xApiKey, authorization, page, limit, options = {}) => {
1138
1545
  assertParamExists("v5WorkflowsWorkflowIdAuditlogGet", "workflowId", workflowId);
1139
1546
  const localVarPath = `/v5/workflows/{workflowId}/auditlog`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
1140
- const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
1547
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1141
1548
  let baseOptions;
1142
1549
  if (configuration) {
1143
1550
  baseOptions = configuration.baseOptions;
@@ -1185,7 +1592,7 @@ var WorkflowsApiFp = function(configuration) {
1185
1592
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4ChangesChangeIdGet(changeId, xApiKey, authorization, options);
1186
1593
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1187
1594
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4ChangesChangeIdGet"]?.[localVarOperationServerIndex]?.url;
1188
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1595
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1189
1596
  },
1190
1597
  /**
1191
1598
  *
@@ -1204,7 +1611,7 @@ var WorkflowsApiFp = function(configuration) {
1204
1611
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4ChangesGet(xApiKey, authorization, workflowIds, startDate, endDate, skip, limit, options);
1205
1612
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1206
1613
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4ChangesGet"]?.[localVarOperationServerIndex]?.url;
1207
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1614
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1208
1615
  },
1209
1616
  /**
1210
1617
  * Retrieves a list of workflows with pagination and search capabilities
@@ -1226,7 +1633,7 @@ var WorkflowsApiFp = function(configuration) {
1226
1633
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsGet(search, skip, limit, state, tags, monitoring, updateInterval, templateId, includeDeleted, format, options);
1227
1634
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1228
1635
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsGet"]?.[localVarOperationServerIndex]?.url;
1229
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1636
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1230
1637
  },
1231
1638
  /**
1232
1639
  *
@@ -1239,7 +1646,7 @@ var WorkflowsApiFp = function(configuration) {
1239
1646
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsPost(v4WorkflowsPostRequest, options);
1240
1647
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1241
1648
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsPost"]?.[localVarOperationServerIndex]?.url;
1242
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1649
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1243
1650
  },
1244
1651
  /**
1245
1652
  *
@@ -1252,7 +1659,7 @@ var WorkflowsApiFp = function(configuration) {
1252
1659
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsSetupEditPost(v4WorkflowsSetupEditPostRequest, options);
1253
1660
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1254
1661
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsSetupEditPost"]?.[localVarOperationServerIndex]?.url;
1255
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1662
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1256
1663
  },
1257
1664
  /**
1258
1665
  *
@@ -1265,7 +1672,7 @@ var WorkflowsApiFp = function(configuration) {
1265
1672
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsSetupPost(v4WorkflowsSetupPostRequest, options);
1266
1673
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1267
1674
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsSetupPost"]?.[localVarOperationServerIndex]?.url;
1268
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1675
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1269
1676
  },
1270
1677
  /**
1271
1678
  *
@@ -1282,7 +1689,7 @@ var WorkflowsApiFp = function(configuration) {
1282
1689
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdAuditlogGet(workflowId, xApiKey, authorization, page, limit, options);
1283
1690
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1284
1691
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdAuditlogGet"]?.[localVarOperationServerIndex]?.url;
1285
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1692
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1286
1693
  },
1287
1694
  /**
1288
1695
  *
@@ -1297,7 +1704,7 @@ var WorkflowsApiFp = function(configuration) {
1297
1704
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdComplianceApprovePut(workflowId, xApiKey, authorization, options);
1298
1705
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1299
1706
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdComplianceApprovePut"]?.[localVarOperationServerIndex]?.url;
1300
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1707
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1301
1708
  },
1302
1709
  /**
1303
1710
  *
@@ -1313,7 +1720,7 @@ var WorkflowsApiFp = function(configuration) {
1313
1720
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdComplianceRejectPut(workflowId, v4WorkflowsWorkflowIdComplianceRejectPutRequest, xApiKey, authorization, options);
1314
1721
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1315
1722
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdComplianceRejectPut"]?.[localVarOperationServerIndex]?.url;
1316
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1723
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1317
1724
  },
1318
1725
  /**
1319
1726
  *
@@ -1338,7 +1745,7 @@ var WorkflowsApiFp = function(configuration) {
1338
1745
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdDataGet(workflowId, xApiKey, authorization, runId, format, sortBy, order, filters, page, limit, gzip, rowIds, includeAnomalies, options);
1339
1746
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1340
1747
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdDataGet"]?.[localVarOperationServerIndex]?.url;
1341
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1748
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1342
1749
  },
1343
1750
  /**
1344
1751
  *
@@ -1351,7 +1758,7 @@ var WorkflowsApiFp = function(configuration) {
1351
1758
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdDelete(workflowId, options);
1352
1759
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1353
1760
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdDelete"]?.[localVarOperationServerIndex]?.url;
1354
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1761
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1355
1762
  },
1356
1763
  /**
1357
1764
  * Retrieves detailed information about a specific workflow. This endpoint requires authentication and proper team access permissions.
@@ -1364,7 +1771,7 @@ var WorkflowsApiFp = function(configuration) {
1364
1771
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdGet(workflowId, options);
1365
1772
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1366
1773
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdGet"]?.[localVarOperationServerIndex]?.url;
1367
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1774
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1368
1775
  },
1369
1776
  /**
1370
1777
  *
@@ -1377,7 +1784,7 @@ var WorkflowsApiFp = function(configuration) {
1377
1784
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdHistoryGet(workflowId, options);
1378
1785
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1379
1786
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdHistoryGet"]?.[localVarOperationServerIndex]?.url;
1380
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1787
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1381
1788
  },
1382
1789
  /**
1383
1790
  *
@@ -1391,7 +1798,7 @@ var WorkflowsApiFp = function(configuration) {
1391
1798
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdMetadataPut(workflowId, v4WorkflowsWorkflowIdMetadataPutRequest, options);
1392
1799
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1393
1800
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdMetadataPut"]?.[localVarOperationServerIndex]?.url;
1394
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1801
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1395
1802
  },
1396
1803
  /**
1397
1804
  *
@@ -1404,7 +1811,7 @@ var WorkflowsApiFp = function(configuration) {
1404
1811
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdPausePut(workflowId, options);
1405
1812
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1406
1813
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdPausePut"]?.[localVarOperationServerIndex]?.url;
1407
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1814
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1408
1815
  },
1409
1816
  /**
1410
1817
  * Resumes a paused, preview, or error workflow. If the user\'s team/organization or any of the user\'s organizations has the COMPLIANCE_REVIEW rule enabled, the workflow will be sent for compliance review instead of being directly activated.
@@ -1417,7 +1824,7 @@ var WorkflowsApiFp = function(configuration) {
1417
1824
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdResumePut(workflowId, options);
1418
1825
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1419
1826
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdResumePut"]?.[localVarOperationServerIndex]?.url;
1420
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1827
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1421
1828
  },
1422
1829
  /**
1423
1830
  *
@@ -1430,7 +1837,7 @@ var WorkflowsApiFp = function(configuration) {
1430
1837
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdRunPut(workflowId, options);
1431
1838
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1432
1839
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdRunPut"]?.[localVarOperationServerIndex]?.url;
1433
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1840
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1434
1841
  },
1435
1842
  /**
1436
1843
  *
@@ -1444,7 +1851,7 @@ var WorkflowsApiFp = function(configuration) {
1444
1851
  const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdSchedulePut(workflowId, v4WorkflowsWorkflowIdSchedulePutRequest, options);
1445
1852
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1446
1853
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdSchedulePut"]?.[localVarOperationServerIndex]?.url;
1447
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1854
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1448
1855
  },
1449
1856
  /**
1450
1857
  *
@@ -1459,7 +1866,7 @@ var WorkflowsApiFp = function(configuration) {
1459
1866
  const localVarAxiosArgs = await localVarAxiosParamCreator.v5ChangesChangeIdGet(changeId, xApiKey, authorization, options);
1460
1867
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1461
1868
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v5ChangesChangeIdGet"]?.[localVarOperationServerIndex]?.url;
1462
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1869
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1463
1870
  },
1464
1871
  /**
1465
1872
  *
@@ -1478,7 +1885,7 @@ var WorkflowsApiFp = function(configuration) {
1478
1885
  const localVarAxiosArgs = await localVarAxiosParamCreator.v5ChangesGet(xApiKey, authorization, workflowIds, startDate, endDate, skip, limit, options);
1479
1886
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1480
1887
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v5ChangesGet"]?.[localVarOperationServerIndex]?.url;
1481
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1888
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1482
1889
  },
1483
1890
  /**
1484
1891
  * Permanently deletes a workflow and its associated tags
@@ -1491,7 +1898,7 @@ var WorkflowsApiFp = function(configuration) {
1491
1898
  const localVarAxiosArgs = await localVarAxiosParamCreator.v5WorkflowsIdDelete(id, options);
1492
1899
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1493
1900
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v5WorkflowsIdDelete"]?.[localVarOperationServerIndex]?.url;
1494
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1901
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1495
1902
  },
1496
1903
  /**
1497
1904
  * Retrieves a specific workflow and its associated tags by ID
@@ -1504,7 +1911,7 @@ var WorkflowsApiFp = function(configuration) {
1504
1911
  const localVarAxiosArgs = await localVarAxiosParamCreator.v5WorkflowsIdGet(id, options);
1505
1912
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1506
1913
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v5WorkflowsIdGet"]?.[localVarOperationServerIndex]?.url;
1507
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1914
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1508
1915
  },
1509
1916
  /**
1510
1917
  * Updates an existing workflow\'s properties
@@ -1518,7 +1925,7 @@ var WorkflowsApiFp = function(configuration) {
1518
1925
  const localVarAxiosArgs = await localVarAxiosParamCreator.v5WorkflowsIdPut(id, v5WorkflowsIdPutRequest, options);
1519
1926
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1520
1927
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v5WorkflowsIdPut"]?.[localVarOperationServerIndex]?.url;
1521
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1928
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1522
1929
  },
1523
1930
  /**
1524
1931
  * Creates a new workflow in pending state
@@ -1531,7 +1938,7 @@ var WorkflowsApiFp = function(configuration) {
1531
1938
  const localVarAxiosArgs = await localVarAxiosParamCreator.v5WorkflowsPost(v5WorkflowsPostRequest, options);
1532
1939
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1533
1940
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v5WorkflowsPost"]?.[localVarOperationServerIndex]?.url;
1534
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1941
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1535
1942
  },
1536
1943
  /**
1537
1944
  *
@@ -1548,7 +1955,7 @@ var WorkflowsApiFp = function(configuration) {
1548
1955
  const localVarAxiosArgs = await localVarAxiosParamCreator.v5WorkflowsWorkflowIdAuditlogGet(workflowId, xApiKey, authorization, page, limit, options);
1549
1956
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1550
1957
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v5WorkflowsWorkflowIdAuditlogGet"]?.[localVarOperationServerIndex]?.url;
1551
- return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1958
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios3, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1552
1959
  }
1553
1960
  };
1554
1961
  };
@@ -1863,404 +2270,691 @@ var Configuration = class {
1863
2270
  }
1864
2271
  };
1865
2272
 
1866
- // src/api-client.ts
1867
- var workflowsApiCache = /* @__PURE__ */ new WeakMap();
1868
- function getWorkflowsApi(sdk) {
1869
- let api = workflowsApiCache.get(sdk);
1870
- if (!api) {
1871
- api = new WorkflowsApi(sdk.configuration, sdk.baseUrl, sdk.axiosInstance);
1872
- workflowsApiCache.set(sdk, api);
1873
- }
1874
- return api;
1875
- }
1876
-
1877
- // src/extraction/data-fetcher.ts
1878
- async function fetchWorkflowData(sdkInstance, workflowId, limit = DEFAULT_OPTIONS.dataLimit) {
1879
- const workflowsApi = getWorkflowsApi(sdkInstance);
1880
- try {
1881
- const response = await workflowsApi.v4WorkflowsWorkflowIdDataGet({
1882
- workflowId,
1883
- limit
1884
- });
1885
- return response.data.data ?? [];
1886
- } catch (error) {
1887
- throw wrapKadoaError(error, {
1888
- message: ERROR_MESSAGES.DATA_FETCH_FAILED,
1889
- details: { workflowId, limit }
1890
- });
1891
- }
1892
- }
2273
+ // src/core/patterns/command.ts
2274
+ var Command = class {
2275
+ };
1893
2276
 
1894
- // src/extraction/entity-detector.ts
1895
- function validateEntityOptions(options) {
1896
- if (!options.link) {
1897
- throw new KadoaSdkException(ERROR_MESSAGES.LINK_REQUIRED, {
1898
- code: "VALIDATION_ERROR",
1899
- details: { options }
1900
- });
2277
+ // src/core/pagination/paginator.ts
2278
+ var PagedIterator = class {
2279
+ constructor(fetchPage) {
2280
+ this.fetchPage = fetchPage;
1901
2281
  }
1902
- }
1903
- async function buildRequestHeaders(config) {
1904
- const headers = {
1905
- "Content-Type": "application/json",
1906
- Accept: "application/json"
1907
- };
1908
- if (config?.apiKey) {
1909
- if (typeof config.apiKey === "function") {
1910
- const apiKeyValue = await config.apiKey("X-API-Key");
1911
- if (apiKeyValue) {
1912
- headers["X-API-Key"] = apiKeyValue;
1913
- }
1914
- } else if (typeof config.apiKey === "string") {
1915
- headers["X-API-Key"] = config.apiKey;
2282
+ /**
2283
+ * Fetch all items across all pages
2284
+ * @param options Base options (page will be overridden)
2285
+ * @returns Array of all items
2286
+ */
2287
+ async fetchAll(options = {}) {
2288
+ const allItems = [];
2289
+ let currentPage = 1;
2290
+ let hasMore = true;
2291
+ while (hasMore) {
2292
+ const result = await this.fetchPage({ ...options, page: currentPage });
2293
+ allItems.push(...result.data);
2294
+ const pagination = result.pagination;
2295
+ hasMore = pagination.page !== void 0 && pagination.totalPages !== void 0 && pagination.page < pagination.totalPages;
2296
+ currentPage++;
1916
2297
  }
1917
- } else {
1918
- throw new KadoaSdkException(ERROR_MESSAGES.NO_API_KEY, {
1919
- code: "AUTH_ERROR",
1920
- details: { hasConfig: !!config, hasApiKey: !!config?.apiKey }
1921
- });
2298
+ return allItems;
1922
2299
  }
1923
- return headers;
1924
- }
1925
- function getErrorCodeFromStatus(status) {
1926
- if (status === 401 || status === 403) return "AUTH_ERROR";
1927
- if (status === 404) return "NOT_FOUND";
1928
- if (status === 429) return "RATE_LIMITED";
1929
- if (status >= 400 && status < 500) return "VALIDATION_ERROR";
1930
- if (status >= 500) return "HTTP_ERROR";
1931
- return "UNKNOWN";
1932
- }
1933
- async function handleErrorResponse(response, url, link) {
1934
- let errorData;
1935
- let errorText = "";
1936
- try {
1937
- errorText = await response.text();
1938
- errorData = JSON.parse(errorText);
1939
- } catch {
1940
- errorData = { message: errorText || response.statusText };
1941
- }
1942
- const baseErrorOptions = {
1943
- httpStatus: response.status,
1944
- endpoint: url.toString(),
1945
- method: "POST",
1946
- responseBody: errorData,
1947
- details: {
1948
- url: url.toString(),
1949
- link
2300
+ /**
2301
+ * Create an async iterator for pages
2302
+ * @param options Base options (page will be overridden)
2303
+ * @returns Async generator that yields pages
2304
+ */
2305
+ async *pages(options = {}) {
2306
+ let currentPage = 1;
2307
+ let hasMore = true;
2308
+ while (hasMore) {
2309
+ const result = await this.fetchPage({ ...options, page: currentPage });
2310
+ yield result;
2311
+ const pagination = result.pagination;
2312
+ hasMore = pagination.page !== void 0 && pagination.totalPages !== void 0 && pagination.page < pagination.totalPages;
2313
+ currentPage++;
1950
2314
  }
1951
- };
1952
- if (response.status === 401) {
1953
- throw new KadoaHttpException(ERROR_MESSAGES.AUTH_FAILED, {
1954
- ...baseErrorOptions,
1955
- code: "AUTH_ERROR"
1956
- });
1957
2315
  }
1958
- if (response.status === 429) {
1959
- throw new KadoaHttpException(ERROR_MESSAGES.RATE_LIMITED, {
1960
- ...baseErrorOptions,
1961
- code: "RATE_LIMITED"
1962
- });
2316
+ /**
2317
+ * Create an async iterator for individual items
2318
+ * @param options Base options (page will be overridden)
2319
+ * @returns Async generator that yields items
2320
+ */
2321
+ async *items(options = {}) {
2322
+ for await (const page of this.pages(options)) {
2323
+ for (const item of page.data) {
2324
+ yield item;
2325
+ }
2326
+ }
1963
2327
  }
1964
- if (response.status >= 500) {
1965
- throw new KadoaHttpException(ERROR_MESSAGES.SERVER_ERROR, {
1966
- ...baseErrorOptions,
1967
- code: "HTTP_ERROR"
1968
- });
2328
+ };
2329
+
2330
+ // src/modules/extraction/queries/fetch-data.query.ts
2331
+ var FetchDataQuery = class {
2332
+ constructor(client) {
2333
+ this.client = client;
2334
+ this.defaultLimit = 100;
1969
2335
  }
1970
- throw new KadoaHttpException(
1971
- `Failed to fetch entity fields: ${errorData?.message || response.statusText}`,
1972
- {
1973
- ...baseErrorOptions,
1974
- code: getErrorCodeFromStatus(response.status)
2336
+ /**
2337
+ * Fetch a page of workflow data
2338
+ *
2339
+ * @param options Options for fetching data
2340
+ * @returns Paginated workflow data
2341
+ */
2342
+ async execute(options) {
2343
+ try {
2344
+ const response = await this.client.workflows.v4WorkflowsWorkflowIdDataGet(
2345
+ {
2346
+ ...options,
2347
+ page: options.page ?? 1,
2348
+ limit: options.limit ?? this.defaultLimit
2349
+ }
2350
+ );
2351
+ const result = response.data;
2352
+ return result;
2353
+ } catch (error) {
2354
+ throw KadoaHttpException.wrap(error, {
2355
+ message: ERROR_MESSAGES.DATA_FETCH_FAILED,
2356
+ details: { workflowId: options.workflowId, page: options.page }
2357
+ });
1975
2358
  }
1976
- );
1977
- }
1978
- async function fetchEntityFields(sdk, options) {
1979
- validateEntityOptions(options);
1980
- const url = new URL(ENTITY_API_ENDPOINT, sdk.baseUrl || DEFAULT_API_BASE_URL);
1981
- const headers = await buildRequestHeaders(sdk.configuration);
1982
- const requestBody = options;
1983
- let response;
1984
- try {
1985
- response = await fetch(url.toString(), {
1986
- method: "POST",
1987
- headers,
1988
- body: JSON.stringify(requestBody)
1989
- });
1990
- } catch (error) {
1991
- throw new KadoaSdkException(ERROR_MESSAGES.NETWORK_ERROR, {
1992
- code: "NETWORK_ERROR",
1993
- details: {
1994
- url: url.toString(),
1995
- link: options.link
1996
- },
1997
- cause: error
1998
- });
1999
2359
  }
2000
- if (!response.ok) {
2001
- await handleErrorResponse(response, url, options.link);
2360
+ /**
2361
+ * Internal method for iterator - executes a page fetch
2362
+ */
2363
+ async executePage(options) {
2364
+ const result = await this.execute(options);
2365
+ return result;
2002
2366
  }
2003
- let data;
2004
- try {
2005
- data = await response.json();
2006
- } catch (error) {
2007
- throw new KadoaSdkException(ERROR_MESSAGES.PARSE_ERROR, {
2008
- code: "INTERNAL_ERROR",
2009
- details: {
2010
- url: url.toString(),
2011
- link: options.link
2012
- },
2013
- cause: error
2014
- });
2367
+ /**
2368
+ * Fetch all pages of workflow data
2369
+ *
2370
+ * @param options Options for fetching data (page will be ignored)
2371
+ * @returns All workflow data across all pages
2372
+ */
2373
+ async fetchAll(options) {
2374
+ const iterator = new PagedIterator(
2375
+ (pageOptions) => this.executePage({ ...options, ...pageOptions })
2376
+ );
2377
+ return iterator.fetchAll({ limit: options.limit ?? this.defaultLimit });
2015
2378
  }
2016
- if (!data.success || !data.entityPrediction || data.entityPrediction.length === 0) {
2017
- throw new KadoaSdkException(ERROR_MESSAGES.NO_PREDICTIONS, {
2018
- code: "NOT_FOUND",
2019
- details: {
2020
- success: data.success,
2021
- hasPredictions: !!data.entityPrediction,
2022
- predictionCount: data.entityPrediction?.length || 0,
2023
- link: options.link
2024
- }
2025
- });
2379
+ /**
2380
+ * Create an async iterator for paginated data fetching
2381
+ *
2382
+ * @param options Options for fetching data
2383
+ * @returns Async iterator that yields pages of data
2384
+ */
2385
+ async *pages(options) {
2386
+ const iterator = new PagedIterator(
2387
+ (pageOptions) => this.execute({ ...options, ...pageOptions })
2388
+ );
2389
+ for await (const page of iterator.pages({
2390
+ limit: options.limit ?? this.defaultLimit
2391
+ })) {
2392
+ yield page;
2393
+ }
2026
2394
  }
2027
- return data.entityPrediction[0];
2028
- }
2395
+ };
2029
2396
 
2030
- // src/extraction/workflow-manager.ts
2031
- function isTerminalRunState(runState) {
2032
- if (!runState) return false;
2033
- return TERMINAL_RUN_STATES.has(runState.toUpperCase());
2034
- }
2035
- async function createWorkflow(sdkInstance, config) {
2036
- const workflowsApi = getWorkflowsApi(sdkInstance);
2037
- const request = {
2038
- urls: config.urls,
2039
- navigationMode: config.navigationMode,
2040
- entity: config.entity,
2041
- name: config.name,
2042
- fields: config.fields,
2043
- bypassPreview: true,
2044
- limit: config.maxRecords,
2045
- tags: ["sdk"]
2046
- };
2047
- try {
2048
- const response = await workflowsApi.v4WorkflowsPost({
2049
- v4WorkflowsPostRequest: request
2050
- });
2051
- const workflowId = response.data.workflowId;
2052
- if (!workflowId) {
2053
- throw new KadoaSdkException(ERROR_MESSAGES.NO_WORKFLOW_ID, {
2054
- code: "INTERNAL_ERROR",
2055
- details: { urls: config.urls }
2397
+ // src/core/config/constants.ts
2398
+ var DEFAULT_API_BASE_URL = "https://api.kadoa.com";
2399
+
2400
+ // src/modules/extraction/services/entity-detector.service.ts
2401
+ var ENTITY_API_ENDPOINT = "/v4/entity";
2402
+ var EntityDetectorService = class {
2403
+ constructor(client) {
2404
+ this.client = client;
2405
+ }
2406
+ /**
2407
+ * Fetches entity fields dynamically from the /v4/entity endpoint.
2408
+ * This is a workaround implementation using native fetch since the endpoint
2409
+ * is not yet included in the OpenAPI specification.
2410
+ *
2411
+ * @param options Request options including the link to analyze
2412
+ * @returns EntityPrediction containing the detected entity type and fields
2413
+ */
2414
+ async fetchEntityFields(options) {
2415
+ this.validateEntityOptions(options);
2416
+ const url = `${this.client.baseUrl || DEFAULT_API_BASE_URL}${ENTITY_API_ENDPOINT}`;
2417
+ const headers = await this.buildRequestHeaders();
2418
+ const requestBody = options;
2419
+ try {
2420
+ const response = await this.client.axiosInstance.post(url, requestBody, {
2421
+ headers
2422
+ });
2423
+ const data = response.data;
2424
+ if (!data.success || !data.entityPrediction || data.entityPrediction.length === 0) {
2425
+ throw new KadoaSdkException(ERROR_MESSAGES.NO_PREDICTIONS, {
2426
+ code: "NOT_FOUND",
2427
+ details: {
2428
+ success: data.success,
2429
+ hasPredictions: !!data.entityPrediction,
2430
+ predictionCount: data.entityPrediction?.length || 0,
2431
+ link: options.link
2432
+ }
2433
+ });
2434
+ }
2435
+ return data.entityPrediction[0];
2436
+ } catch (error) {
2437
+ throw KadoaHttpException.wrap(error, {
2438
+ details: {
2439
+ url,
2440
+ link: options.link
2441
+ }
2056
2442
  });
2057
2443
  }
2058
- return workflowId;
2059
- } catch (error) {
2060
- throw wrapKadoaError(error, {
2061
- message: "Failed to create workflow",
2062
- details: config
2063
- });
2064
2444
  }
2065
- }
2066
- async function getWorkflowStatus(sdkInstance, workflowId) {
2067
- const workflowsApi = getWorkflowsApi(sdkInstance);
2068
- try {
2069
- const response = await workflowsApi.v4WorkflowsWorkflowIdGet({
2070
- workflowId
2071
- });
2072
- return response.data;
2073
- } catch (error) {
2074
- throw wrapKadoaError(error, {
2075
- message: ERROR_MESSAGES.PROGRESS_CHECK_FAILED,
2076
- details: { workflowId }
2077
- });
2445
+ /**
2446
+ * Validates entity request options
2447
+ */
2448
+ validateEntityOptions(options) {
2449
+ if (!options.link) {
2450
+ throw new KadoaSdkException(ERROR_MESSAGES.LINK_REQUIRED, {
2451
+ code: "VALIDATION_ERROR",
2452
+ details: { options }
2453
+ });
2454
+ }
2078
2455
  }
2079
- }
2080
- async function waitForWorkflowCompletion(sdkInstance, workflowId, options) {
2081
- const pollingInterval = options.pollingInterval;
2082
- const maxWaitTime = options.maxWaitTime;
2083
- const startTime = Date.now();
2084
- let previousState;
2085
- let previousRunState;
2086
- while (Date.now() - startTime < maxWaitTime) {
2087
- const workflow = await getWorkflowStatus(sdkInstance, workflowId);
2088
- if (workflow.state !== previousState || workflow.runState !== previousRunState) {
2089
- const statusChange = {
2090
- workflowId,
2091
- previousState,
2092
- previousRunState,
2093
- currentState: workflow.state,
2094
- currentRunState: workflow.runState
2095
- };
2096
- sdkInstance.emit("extraction:status_changed", statusChange, "extraction");
2097
- if (options?.onStatusChange) {
2098
- options.onStatusChange(statusChange);
2456
+ /**
2457
+ * Builds request headers including API key authentication
2458
+ */
2459
+ async buildRequestHeaders() {
2460
+ const headers = {
2461
+ "Content-Type": "application/json",
2462
+ Accept: "application/json"
2463
+ };
2464
+ const config = this.client.configuration;
2465
+ if (config?.apiKey) {
2466
+ if (typeof config.apiKey === "function") {
2467
+ const apiKeyValue = await config.apiKey("X-API-Key");
2468
+ if (apiKeyValue) {
2469
+ headers["X-API-Key"] = apiKeyValue;
2470
+ }
2471
+ } else if (typeof config.apiKey === "string") {
2472
+ headers["X-API-Key"] = config.apiKey;
2099
2473
  }
2100
- previousState = workflow.state;
2101
- previousRunState = workflow.runState;
2102
- }
2103
- if (isTerminalRunState(workflow.runState)) {
2104
- return workflow;
2474
+ } else {
2475
+ throw new KadoaSdkException(ERROR_MESSAGES.NO_API_KEY, {
2476
+ code: "AUTH_ERROR",
2477
+ details: { hasConfig: !!config, hasApiKey: !!config?.apiKey }
2478
+ });
2105
2479
  }
2106
- await new Promise((resolve) => setTimeout(resolve, pollingInterval));
2480
+ return headers;
2107
2481
  }
2108
- throw new KadoaSdkException(
2109
- `Extraction did not complete within ${maxWaitTime / 1e3} seconds`,
2110
- { code: "TIMEOUT", details: { workflowId, maxWaitTime } }
2111
- );
2112
- }
2482
+ };
2113
2483
 
2114
- // src/extraction/extraction-runner.ts
2115
- function validateExtractionOptions(options) {
2116
- if (!options.urls || options.urls.length === 0) {
2117
- throw new KadoaSdkException(ERROR_MESSAGES.NO_URLS, {
2118
- code: "VALIDATION_ERROR"
2119
- });
2484
+ // src/modules/extraction/services/workflow-manager.service.ts
2485
+ var TERMINAL_RUN_STATES = /* @__PURE__ */ new Set([
2486
+ "FINISHED",
2487
+ "SUCCESS",
2488
+ "FAILED",
2489
+ "ERROR",
2490
+ "STOPPED",
2491
+ "CANCELLED"
2492
+ ]);
2493
+ var WorkflowManagerService = class {
2494
+ constructor(client) {
2495
+ this.client = client;
2120
2496
  }
2121
- }
2122
- function isExtractionSuccessful(runState) {
2123
- return runState ? SUCCESSFUL_RUN_STATES.has(runState.toUpperCase()) : false;
2124
- }
2125
- async function runExtraction(sdkInstance, options) {
2126
- validateExtractionOptions(options);
2127
- const config = merge(
2128
- DEFAULT_OPTIONS,
2129
- options
2130
- );
2131
- try {
2132
- const entityPrediction = await fetchEntityFields(sdkInstance, {
2133
- link: config.urls[0],
2134
- location: config.location,
2135
- navigationMode: config.navigationMode
2136
- });
2137
- sdkInstance.emit(
2138
- "entity:detected",
2139
- {
2140
- entity: entityPrediction.entity,
2141
- fields: entityPrediction.fields,
2142
- url: config.urls[0]
2143
- },
2144
- "extraction",
2145
- {
2146
- navigationMode: config.navigationMode,
2147
- location: config.location
2148
- }
2149
- );
2150
- const workflowId = await createWorkflow(sdkInstance, {
2151
- entity: entityPrediction.entity,
2152
- fields: entityPrediction.fields,
2153
- ...config
2154
- });
2155
- sdkInstance.emit(
2156
- "extraction:started",
2157
- {
2158
- workflowId,
2159
- name: config.name,
2160
- urls: config.urls
2161
- },
2162
- "extraction"
2163
- );
2164
- const workflow = await waitForWorkflowCompletion(sdkInstance, workflowId, {
2165
- ...config,
2166
- pollingInterval: config.pollingInterval,
2167
- maxWaitTime: config.maxWaitTime
2168
- });
2169
- let data;
2170
- const isSuccess = isExtractionSuccessful(workflow.runState);
2171
- if (isSuccess) {
2172
- data = await fetchWorkflowData(sdkInstance, workflowId);
2173
- if (data) {
2174
- sdkInstance.emit(
2175
- "extraction:data_available",
2176
- {
2177
- workflowId,
2178
- recordCount: data.length,
2179
- isPartial: false
2180
- },
2497
+ /**
2498
+ * Check if a workflow runState is terminal (finished processing)
2499
+ */
2500
+ isTerminalRunState(runState) {
2501
+ if (!runState) return false;
2502
+ return TERMINAL_RUN_STATES.has(runState.toUpperCase());
2503
+ }
2504
+ /**
2505
+ * Creates a new workflow with the provided configuration
2506
+ */
2507
+ async createWorkflow(config) {
2508
+ const request = {
2509
+ urls: config.urls,
2510
+ navigationMode: config.navigationMode,
2511
+ entity: config.entity,
2512
+ name: config.name,
2513
+ fields: config.fields,
2514
+ bypassPreview: true,
2515
+ tags: ["sdk"]
2516
+ };
2517
+ try {
2518
+ const response = await this.client.workflows.v4WorkflowsPost({
2519
+ v4WorkflowsPostRequest: request
2520
+ });
2521
+ const workflowId = response.data.workflowId;
2522
+ if (!workflowId) {
2523
+ throw new KadoaSdkException(ERROR_MESSAGES.NO_WORKFLOW_ID, {
2524
+ code: "INTERNAL_ERROR",
2525
+ details: { response: response.data }
2526
+ });
2527
+ }
2528
+ return workflowId;
2529
+ } catch (error) {
2530
+ throw KadoaHttpException.wrap(error, {
2531
+ message: ERROR_MESSAGES.WORKFLOW_CREATE_FAILED,
2532
+ details: config
2533
+ });
2534
+ }
2535
+ }
2536
+ /**
2537
+ * Gets the current status of a workflow
2538
+ */
2539
+ async getWorkflowStatus(workflowId) {
2540
+ try {
2541
+ const response = await this.client.workflows.v4WorkflowsWorkflowIdGet({
2542
+ workflowId
2543
+ });
2544
+ return response.data;
2545
+ } catch (error) {
2546
+ throw KadoaHttpException.wrap(error, {
2547
+ message: ERROR_MESSAGES.PROGRESS_CHECK_FAILED,
2548
+ details: { workflowId }
2549
+ });
2550
+ }
2551
+ }
2552
+ /**
2553
+ * Waits for a workflow to complete processing
2554
+ *
2555
+ * @param workflowId The workflow ID to monitor
2556
+ * @param pollingInterval How often to check the status (in milliseconds)
2557
+ * @param maxWaitTime Maximum time to wait before timing out (in milliseconds)
2558
+ * @param onStatusChange Optional callback for status changes
2559
+ * @returns The final workflow status
2560
+ */
2561
+ async waitForWorkflowCompletion(workflowId, pollingInterval, maxWaitTime, onStatusChange) {
2562
+ const startTime = Date.now();
2563
+ let lastStatus;
2564
+ while (Date.now() - startTime < maxWaitTime) {
2565
+ const currentStatus = await this.getWorkflowStatus(workflowId);
2566
+ if (lastStatus?.state !== currentStatus.state || lastStatus?.runState !== currentStatus.runState) {
2567
+ const eventPayload = {
2568
+ workflowId,
2569
+ previousState: lastStatus?.state,
2570
+ previousRunState: lastStatus?.runState,
2571
+ currentState: currentStatus.state,
2572
+ currentRunState: currentStatus.runState
2573
+ };
2574
+ this.client.emit(
2575
+ "extraction:status_changed",
2576
+ eventPayload,
2181
2577
  "extraction"
2182
2578
  );
2579
+ if (onStatusChange) {
2580
+ onStatusChange(lastStatus, currentStatus);
2581
+ }
2183
2582
  }
2184
- sdkInstance.emit(
2185
- "extraction:completed",
2583
+ if (this.isTerminalRunState(currentStatus.runState)) {
2584
+ return currentStatus;
2585
+ }
2586
+ lastStatus = currentStatus;
2587
+ await new Promise((resolve) => setTimeout(resolve, pollingInterval));
2588
+ }
2589
+ throw new KadoaSdkException(ERROR_MESSAGES.WORKFLOW_TIMEOUT, {
2590
+ code: "TIMEOUT",
2591
+ details: {
2592
+ workflowId,
2593
+ maxWaitTime,
2594
+ lastState: lastStatus?.state,
2595
+ lastRunState: lastStatus?.runState
2596
+ }
2597
+ });
2598
+ }
2599
+ };
2600
+
2601
+ // src/modules/extraction/commands/run-extraction.command.ts
2602
+ var SUCCESSFUL_RUN_STATES = /* @__PURE__ */ new Set(["FINISHED", "SUCCESS"]);
2603
+ var DEFAULT_OPTIONS = {
2604
+ pollingInterval: 5e3,
2605
+ maxWaitTime: 3e5,
2606
+ navigationMode: "single-page",
2607
+ location: { type: "auto" },
2608
+ name: "Untitled Workflow"
2609
+ };
2610
+ var RunExtractionCommand = class extends Command {
2611
+ constructor(client) {
2612
+ super();
2613
+ this.client = client;
2614
+ this.fetchDataQuery = new FetchDataQuery(client);
2615
+ this.entityDetector = new EntityDetectorService(client);
2616
+ this.workflowManager = new WorkflowManagerService(client);
2617
+ }
2618
+ /**
2619
+ * Execute the extraction workflow
2620
+ */
2621
+ async execute(options) {
2622
+ this.validateOptions(options);
2623
+ const config = {
2624
+ ...DEFAULT_OPTIONS,
2625
+ ...options
2626
+ };
2627
+ try {
2628
+ const entityPrediction = await this.entityDetector.fetchEntityFields({
2629
+ link: config.urls[0],
2630
+ location: config.location,
2631
+ navigationMode: config.navigationMode
2632
+ });
2633
+ this.client.emit(
2634
+ "entity:detected",
2186
2635
  {
2187
- workflowId,
2188
- success: true,
2189
- finalRunState: workflow.runState,
2190
- finalState: workflow.state,
2191
- recordCount: data?.length
2636
+ entity: entityPrediction.entity,
2637
+ fields: entityPrediction.fields,
2638
+ url: config.urls[0]
2192
2639
  },
2193
- "extraction"
2640
+ "extraction",
2641
+ {
2642
+ navigationMode: config.navigationMode,
2643
+ location: config.location
2644
+ }
2194
2645
  );
2195
- } else {
2196
- sdkInstance.emit(
2197
- "extraction:completed",
2646
+ const workflowId = await this.workflowManager.createWorkflow({
2647
+ entity: entityPrediction.entity,
2648
+ fields: entityPrediction.fields,
2649
+ ...config
2650
+ });
2651
+ this.client.emit(
2652
+ "extraction:started",
2198
2653
  {
2199
2654
  workflowId,
2200
- success: false,
2201
- finalRunState: workflow.runState,
2202
- finalState: workflow.state,
2203
- error: `Extraction completed with unexpected status: ${workflow.runState}`
2655
+ name: config.name,
2656
+ urls: config.urls
2204
2657
  },
2205
2658
  "extraction"
2206
2659
  );
2207
- throw new KadoaSdkException(
2208
- `Extraction completed with unexpected status: ${workflow.runState}`,
2209
- {
2210
- code: "INTERNAL_ERROR",
2211
- details: {
2660
+ const workflow = await this.workflowManager.waitForWorkflowCompletion(
2661
+ workflowId,
2662
+ config.pollingInterval,
2663
+ config.maxWaitTime
2664
+ );
2665
+ let data;
2666
+ let pagination;
2667
+ const isSuccess = this.isExtractionSuccessful(workflow.runState);
2668
+ if (isSuccess) {
2669
+ const dataPage = await this.fetchDataQuery.execute({ workflowId });
2670
+ data = dataPage.data;
2671
+ pagination = dataPage.pagination;
2672
+ if (data) {
2673
+ const isPartial = pagination?.totalCount && data.length < pagination.totalCount;
2674
+ this.client.emit(
2675
+ "extraction:data_available",
2676
+ {
2677
+ workflowId,
2678
+ recordCount: data.length,
2679
+ isPartial: !!isPartial,
2680
+ totalCount: pagination?.totalCount
2681
+ },
2682
+ "extraction"
2683
+ );
2684
+ }
2685
+ this.client.emit(
2686
+ "extraction:completed",
2687
+ {
2212
2688
  workflowId,
2213
- runState: workflow.runState,
2214
- state: workflow.state
2689
+ success: true,
2690
+ finalRunState: workflow.runState,
2691
+ finalState: workflow.state,
2692
+ recordCount: data?.length
2693
+ },
2694
+ "extraction"
2695
+ );
2696
+ } else {
2697
+ this.client.emit(
2698
+ "extraction:completed",
2699
+ {
2700
+ workflowId,
2701
+ success: false,
2702
+ finalRunState: workflow.runState,
2703
+ finalState: workflow.state,
2704
+ error: `Extraction completed with unexpected status: ${workflow.runState}`
2705
+ },
2706
+ "extraction"
2707
+ );
2708
+ throw new KadoaSdkException(
2709
+ `${ERROR_MESSAGES.WORKFLOW_UNEXPECTED_STATUS}: ${workflow.runState}`,
2710
+ {
2711
+ code: "INTERNAL_ERROR",
2712
+ details: {
2713
+ workflowId,
2714
+ runState: workflow.runState,
2715
+ state: workflow.state
2716
+ }
2215
2717
  }
2216
- }
2217
- );
2718
+ );
2719
+ }
2720
+ return {
2721
+ workflowId,
2722
+ workflow,
2723
+ data,
2724
+ pagination
2725
+ };
2726
+ } catch (error) {
2727
+ throw KadoaHttpException.wrap(error, {
2728
+ message: ERROR_MESSAGES.EXTRACTION_FAILED,
2729
+ details: { urls: options.urls }
2730
+ });
2218
2731
  }
2219
- return {
2220
- workflowId,
2221
- workflow,
2222
- data
2732
+ }
2733
+ /**
2734
+ * Validates extraction options
2735
+ * @private
2736
+ */
2737
+ validateOptions(options) {
2738
+ if (!options.urls || options.urls.length === 0) {
2739
+ throw new KadoaSdkException(ERROR_MESSAGES.NO_URLS, {
2740
+ code: "VALIDATION_ERROR"
2741
+ });
2742
+ }
2743
+ }
2744
+ /**
2745
+ * Checks if extraction was successful
2746
+ * @private
2747
+ */
2748
+ isExtractionSuccessful(runState) {
2749
+ return runState ? SUCCESSFUL_RUN_STATES.has(runState.toUpperCase()) : false;
2750
+ }
2751
+ };
2752
+
2753
+ // src/modules/extraction/extraction.module.ts
2754
+ var ExtractionModule = class {
2755
+ constructor(client) {
2756
+ this.runExtractionCommand = new RunExtractionCommand(client);
2757
+ this.fetchDataQuery = new FetchDataQuery(client);
2758
+ }
2759
+ /**
2760
+ * Run extraction workflow using dynamic entity detection
2761
+ *
2762
+ * @param options Extraction configuration options
2763
+ * @returns ExtractionResult containing workflow ID, workflow details, and first page of extracted data
2764
+ *
2765
+ * @example
2766
+ * ```typescript
2767
+ * const result = await client.extraction.run({
2768
+ * urls: ['https://example.com'],
2769
+ * name: 'My Extraction'
2770
+ * });
2771
+ * ```
2772
+ */
2773
+ async run(options) {
2774
+ return this.runExtractionCommand.execute(options);
2775
+ }
2776
+ /**
2777
+ * Fetch paginated data from a workflow
2778
+ *
2779
+ * @param options Options for fetching data including workflowId and pagination parameters
2780
+ * @returns Paginated workflow data with metadata
2781
+ *
2782
+ * @example
2783
+ * ```typescript
2784
+ * // Fetch first page
2785
+ * const firstPage = await client.extraction.fetchData({
2786
+ * workflowId: 'workflow-id',
2787
+ * page: 1,
2788
+ * limit: 100
2789
+ * });
2790
+ *
2791
+ * // Iterate through all pages
2792
+ * for await (const page of client.extraction.fetchDataPages({ workflowId: 'workflow-id' })) {
2793
+ * console.log(`Processing ${page.data.length} records`);
2794
+ * }
2795
+ * ```
2796
+ */
2797
+ async fetchData(options) {
2798
+ return this.fetchDataQuery.execute(options);
2799
+ }
2800
+ /**
2801
+ * Fetch all data from a workflow across all pages
2802
+ *
2803
+ * @param options Options for fetching data
2804
+ * @returns All workflow data combined from all pages
2805
+ *
2806
+ * @example
2807
+ * ```typescript
2808
+ * const allData = await client.extraction.fetchAllData({
2809
+ * workflowId: 'workflow-id'
2810
+ * });
2811
+ * ```
2812
+ */
2813
+ async fetchAllData(options) {
2814
+ return this.fetchDataQuery.fetchAll(options);
2815
+ }
2816
+ /**
2817
+ * Create an async iterator for paginated data fetching
2818
+ *
2819
+ * @param options Options for fetching data
2820
+ * @returns Async iterator that yields pages of data
2821
+ *
2822
+ * @example
2823
+ * ```typescript
2824
+ * for await (const page of client.extraction.fetchDataPages({ workflowId: 'workflow-id' })) {
2825
+ * console.log(`Page ${page.pagination.page}: ${page.data.length} records`);
2826
+ * }
2827
+ * ```
2828
+ */
2829
+ fetchDataPages(options) {
2830
+ return this.fetchDataQuery.pages(options);
2831
+ }
2832
+ };
2833
+
2834
+ // src/version.ts
2835
+ var SDK_VERSION = "0.5.0";
2836
+ var SDK_NAME = "kadoa-node-sdk";
2837
+ var SDK_LANGUAGE = "node";
2838
+
2839
+ // src/kadoa-client.ts
2840
+ var KadoaClient = class {
2841
+ constructor(config) {
2842
+ this._baseUrl = config.baseUrl || "https://api.kadoa.com";
2843
+ this._timeout = config.timeout || 3e4;
2844
+ const configParams = {
2845
+ apiKey: config.apiKey,
2846
+ basePath: this._baseUrl,
2847
+ baseOptions: {
2848
+ headers: {
2849
+ "User-Agent": `${SDK_NAME}/${SDK_VERSION}`,
2850
+ "X-SDK-Version": SDK_VERSION,
2851
+ "X-SDK-Language": SDK_LANGUAGE
2852
+ }
2853
+ }
2223
2854
  };
2224
- } catch (error) {
2225
- throw wrapKadoaError(error, {
2226
- message: ERROR_MESSAGES.EXTRACTION_FAILED,
2227
- details: { urls: options.urls }
2855
+ this._configuration = new Configuration(configParams);
2856
+ this._axiosInstance = globalAxios3.create({
2857
+ timeout: this._timeout,
2858
+ headers: {
2859
+ "User-Agent": `${SDK_NAME}/${SDK_VERSION}`,
2860
+ "X-SDK-Version": SDK_VERSION,
2861
+ "X-SDK-Language": SDK_LANGUAGE
2862
+ }
2228
2863
  });
2864
+ this._events = new KadoaEventEmitter();
2865
+ this._workflowsApi = config.apiOverrides?.workflows || new WorkflowsApi(this._configuration, this._baseUrl, this._axiosInstance);
2866
+ this._crawlApi = config.apiOverrides?.crawl || new CrawlApi(this._configuration, this._baseUrl, this._axiosInstance);
2867
+ this.extraction = new ExtractionModule(this);
2229
2868
  }
2230
- }
2231
- function initializeSdk(config) {
2232
- const baseUrl = config.baseUrl || "https://api.kadoa.com";
2233
- const configParams = {
2234
- apiKey: config.apiKey,
2235
- basePath: baseUrl
2236
- };
2237
- const configuration = new Configuration(configParams);
2238
- const axiosInstance = globalAxios2.create({
2239
- timeout: config.timeout || 3e4
2240
- });
2241
- const events = new KadoaEventEmitter();
2242
- return {
2243
- configuration,
2244
- axiosInstance,
2245
- baseUrl,
2246
- events,
2247
- emit: (eventName, payload, source, metadata) => {
2248
- events.emit(eventName, payload, source, metadata);
2249
- },
2250
- onEvent: (listener) => {
2251
- events.onEvent(listener);
2252
- },
2253
- offEvent: (listener) => {
2254
- events.offEvent(listener);
2255
- }
2256
- };
2257
- }
2258
- function dispose(sdkInstance) {
2259
- if (sdkInstance?.events) {
2260
- sdkInstance.events.removeAllListeners();
2869
+ /**
2870
+ * Register an event listener
2871
+ *
2872
+ * @param listener Function to handle events
2873
+ */
2874
+ onEvent(listener) {
2875
+ this._events.onEvent(listener);
2261
2876
  }
2262
- }
2877
+ /**
2878
+ * Remove an event listener
2879
+ *
2880
+ * @param listener Function to remove from event handlers
2881
+ */
2882
+ offEvent(listener) {
2883
+ this._events.offEvent(listener);
2884
+ }
2885
+ /**
2886
+ * Emit an event
2887
+ * @internal
2888
+ *
2889
+ * @param eventName The name of the event
2890
+ * @param payload The event payload
2891
+ * @param source Optional source identifier
2892
+ * @param metadata Optional metadata
2893
+ */
2894
+ emit(eventName, payload, source, metadata) {
2895
+ this._events.emit(eventName, payload, source, metadata);
2896
+ }
2897
+ /**
2898
+ * Get the underlying configuration
2899
+ *
2900
+ * @returns The configuration object
2901
+ */
2902
+ get configuration() {
2903
+ return this._configuration;
2904
+ }
2905
+ /**
2906
+ * Get the axios instance
2907
+ *
2908
+ * @returns The axios instance
2909
+ */
2910
+ get axiosInstance() {
2911
+ return this._axiosInstance;
2912
+ }
2913
+ /**
2914
+ * Get the base URL
2915
+ *
2916
+ * @returns The base URL
2917
+ */
2918
+ get baseUrl() {
2919
+ return this._baseUrl;
2920
+ }
2921
+ /**
2922
+ * Get the timeout value
2923
+ *
2924
+ * @returns The timeout in milliseconds
2925
+ */
2926
+ get timeout() {
2927
+ return this._timeout;
2928
+ }
2929
+ /**
2930
+ * Get the event emitter
2931
+ * @internal
2932
+ *
2933
+ * @returns The event emitter
2934
+ */
2935
+ get events() {
2936
+ return this._events;
2937
+ }
2938
+ /**
2939
+ * Get the workflows API
2940
+ */
2941
+ get workflows() {
2942
+ return this._workflowsApi;
2943
+ }
2944
+ /**
2945
+ * Get the crawl API
2946
+ */
2947
+ get crawl() {
2948
+ return this._crawlApi;
2949
+ }
2950
+ /**
2951
+ * Dispose of the client and clean up resources
2952
+ */
2953
+ dispose() {
2954
+ this._events?.removeAllListeners();
2955
+ }
2956
+ };
2263
2957
 
2264
- export { KadoaEventEmitter, KadoaHttpException, KadoaSdkException, dispose, initializeSdk, isKadoaHttpException, isKadoaSdkException, runExtraction };
2958
+ export { ERROR_MESSAGES, KadoaClient, KadoaEventEmitter, KadoaHttpException, KadoaSdkException };
2265
2959
  //# sourceMappingURL=index.mjs.map
2266
2960
  //# sourceMappingURL=index.mjs.map