@kadoa/node-sdk 0.16.2 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.global.js +12 -12
- package/dist/browser/index.global.js.map +1 -1
- package/dist/index.d.mts +127 -19
- package/dist/index.d.ts +127 -19
- package/dist/index.js +69 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -75
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1338,10 +1338,11 @@ var NotificationsApiAxiosParamCreator = function(configuration) {
|
|
|
1338
1338
|
*
|
|
1339
1339
|
* @summary Retrieve a specific notification channel
|
|
1340
1340
|
* @param {string} channelId Channel ID
|
|
1341
|
+
* @param {boolean} [includeConfigurations] Include linked notification configurations with workflow information
|
|
1341
1342
|
* @param {*} [options] Override http request option.
|
|
1342
1343
|
* @throws {RequiredError}
|
|
1343
1344
|
*/
|
|
1344
|
-
v5NotificationsChannelsChannelIdGet: async (channelId, options = {}) => {
|
|
1345
|
+
v5NotificationsChannelsChannelIdGet: async (channelId, includeConfigurations, options = {}) => {
|
|
1345
1346
|
assertParamExists("v5NotificationsChannelsChannelIdGet", "channelId", channelId);
|
|
1346
1347
|
const localVarPath = `/v5/notifications/channels/{channelId}`.replace(`{${"channelId"}}`, encodeURIComponent(String(channelId)));
|
|
1347
1348
|
const localVarUrlObj = new url.URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -1353,6 +1354,9 @@ var NotificationsApiAxiosParamCreator = function(configuration) {
|
|
|
1353
1354
|
const localVarHeaderParameter = {};
|
|
1354
1355
|
const localVarQueryParameter = {};
|
|
1355
1356
|
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
1357
|
+
if (includeConfigurations !== void 0) {
|
|
1358
|
+
localVarQueryParameter["includeConfigurations"] = includeConfigurations;
|
|
1359
|
+
}
|
|
1356
1360
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1357
1361
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1358
1362
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -1396,10 +1400,11 @@ var NotificationsApiAxiosParamCreator = function(configuration) {
|
|
|
1396
1400
|
*
|
|
1397
1401
|
* @summary Retrieve all notification channels
|
|
1398
1402
|
* @param {string} [workflowId] Workflow ID (optional, if provided returns channels linked to this workflow)
|
|
1403
|
+
* @param {boolean} [includeConfigurations] Include linked notification configurations with workflow information
|
|
1399
1404
|
* @param {*} [options] Override http request option.
|
|
1400
1405
|
* @throws {RequiredError}
|
|
1401
1406
|
*/
|
|
1402
|
-
v5NotificationsChannelsGet: async (workflowId, options = {}) => {
|
|
1407
|
+
v5NotificationsChannelsGet: async (workflowId, includeConfigurations, options = {}) => {
|
|
1403
1408
|
const localVarPath = `/v5/notifications/channels`;
|
|
1404
1409
|
const localVarUrlObj = new url.URL(localVarPath, DUMMY_BASE_URL);
|
|
1405
1410
|
let baseOptions;
|
|
@@ -1413,6 +1418,9 @@ var NotificationsApiAxiosParamCreator = function(configuration) {
|
|
|
1413
1418
|
if (workflowId !== void 0) {
|
|
1414
1419
|
localVarQueryParameter["workflowId"] = workflowId;
|
|
1415
1420
|
}
|
|
1421
|
+
if (includeConfigurations !== void 0) {
|
|
1422
|
+
localVarQueryParameter["includeConfigurations"] = includeConfigurations;
|
|
1423
|
+
}
|
|
1416
1424
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1417
1425
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1418
1426
|
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
@@ -1749,11 +1757,12 @@ var NotificationsApiFp = function(configuration) {
|
|
|
1749
1757
|
*
|
|
1750
1758
|
* @summary Retrieve a specific notification channel
|
|
1751
1759
|
* @param {string} channelId Channel ID
|
|
1760
|
+
* @param {boolean} [includeConfigurations] Include linked notification configurations with workflow information
|
|
1752
1761
|
* @param {*} [options] Override http request option.
|
|
1753
1762
|
* @throws {RequiredError}
|
|
1754
1763
|
*/
|
|
1755
|
-
async v5NotificationsChannelsChannelIdGet(channelId, options) {
|
|
1756
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.v5NotificationsChannelsChannelIdGet(channelId, options);
|
|
1764
|
+
async v5NotificationsChannelsChannelIdGet(channelId, includeConfigurations, options) {
|
|
1765
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v5NotificationsChannelsChannelIdGet(channelId, includeConfigurations, options);
|
|
1757
1766
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1758
1767
|
const localVarOperationServerBasePath = operationServerMap["NotificationsApi.v5NotificationsChannelsChannelIdGet"]?.[localVarOperationServerIndex]?.url;
|
|
1759
1768
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
@@ -1776,11 +1785,12 @@ var NotificationsApiFp = function(configuration) {
|
|
|
1776
1785
|
*
|
|
1777
1786
|
* @summary Retrieve all notification channels
|
|
1778
1787
|
* @param {string} [workflowId] Workflow ID (optional, if provided returns channels linked to this workflow)
|
|
1788
|
+
* @param {boolean} [includeConfigurations] Include linked notification configurations with workflow information
|
|
1779
1789
|
* @param {*} [options] Override http request option.
|
|
1780
1790
|
* @throws {RequiredError}
|
|
1781
1791
|
*/
|
|
1782
|
-
async v5NotificationsChannelsGet(workflowId, options) {
|
|
1783
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.v5NotificationsChannelsGet(workflowId, options);
|
|
1792
|
+
async v5NotificationsChannelsGet(workflowId, includeConfigurations, options) {
|
|
1793
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v5NotificationsChannelsGet(workflowId, includeConfigurations, options);
|
|
1784
1794
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1785
1795
|
const localVarOperationServerBasePath = operationServerMap["NotificationsApi.v5NotificationsChannelsGet"]?.[localVarOperationServerIndex]?.url;
|
|
1786
1796
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2__default.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
@@ -1942,7 +1952,7 @@ var NotificationsApi = class extends BaseAPI {
|
|
|
1942
1952
|
* @throws {RequiredError}
|
|
1943
1953
|
*/
|
|
1944
1954
|
v5NotificationsChannelsChannelIdGet(requestParameters, options) {
|
|
1945
|
-
return NotificationsApiFp(this.configuration).v5NotificationsChannelsChannelIdGet(requestParameters.channelId, options).then((request) => request(this.axios, this.basePath));
|
|
1955
|
+
return NotificationsApiFp(this.configuration).v5NotificationsChannelsChannelIdGet(requestParameters.channelId, requestParameters.includeConfigurations, options).then((request) => request(this.axios, this.basePath));
|
|
1946
1956
|
}
|
|
1947
1957
|
/**
|
|
1948
1958
|
*
|
|
@@ -1962,7 +1972,7 @@ var NotificationsApi = class extends BaseAPI {
|
|
|
1962
1972
|
* @throws {RequiredError}
|
|
1963
1973
|
*/
|
|
1964
1974
|
v5NotificationsChannelsGet(requestParameters = {}, options) {
|
|
1965
|
-
return NotificationsApiFp(this.configuration).v5NotificationsChannelsGet(requestParameters.workflowId, options).then((request) => request(this.axios, this.basePath));
|
|
1975
|
+
return NotificationsApiFp(this.configuration).v5NotificationsChannelsGet(requestParameters.workflowId, requestParameters.includeConfigurations, options).then((request) => request(this.axios, this.basePath));
|
|
1966
1976
|
}
|
|
1967
1977
|
/**
|
|
1968
1978
|
*
|
|
@@ -3642,6 +3652,7 @@ var Configuration = class {
|
|
|
3642
3652
|
this.username = param.username;
|
|
3643
3653
|
this.password = param.password;
|
|
3644
3654
|
this.accessToken = param.accessToken;
|
|
3655
|
+
this.awsv4 = param.awsv4;
|
|
3645
3656
|
this.basePath = param.basePath;
|
|
3646
3657
|
this.serverIndex = param.serverIndex;
|
|
3647
3658
|
this.baseOptions = {
|
|
@@ -4324,7 +4335,6 @@ var DEFAULT_OPTIONS = {
|
|
|
4324
4335
|
maxWaitTime: 3e5,
|
|
4325
4336
|
navigationMode: "single-page",
|
|
4326
4337
|
location: { type: "auto" },
|
|
4327
|
-
name: "Untitled Workflow",
|
|
4328
4338
|
bypassPreview: true,
|
|
4329
4339
|
autoStart: true
|
|
4330
4340
|
};
|
|
@@ -5168,7 +5178,7 @@ var WSS_API_URI = process.env.KADOA_WSS_API_URI ?? "wss://realtime.kadoa.com";
|
|
|
5168
5178
|
var REALTIME_API_URI = process.env.KADOA_REALTIME_API_URI ?? "https://realtime.kadoa.com";
|
|
5169
5179
|
|
|
5170
5180
|
// src/version.ts
|
|
5171
|
-
var SDK_VERSION = "0.
|
|
5181
|
+
var SDK_VERSION = "0.18.1";
|
|
5172
5182
|
var SDK_NAME = "kadoa-node-sdk";
|
|
5173
5183
|
var SDK_LANGUAGE = "node";
|
|
5174
5184
|
|
|
@@ -5448,6 +5458,48 @@ function validateAdditionalData(additionalData) {
|
|
|
5448
5458
|
}
|
|
5449
5459
|
}
|
|
5450
5460
|
|
|
5461
|
+
// src/runtime/utils/version-check.ts
|
|
5462
|
+
var NPM_REGISTRY_URL = "https://registry.npmjs.org";
|
|
5463
|
+
var PACKAGE_NAME = "@kadoa/node-sdk";
|
|
5464
|
+
async function checkForUpdates() {
|
|
5465
|
+
try {
|
|
5466
|
+
const response = await fetch(`${NPM_REGISTRY_URL}/${PACKAGE_NAME}`, {
|
|
5467
|
+
headers: {
|
|
5468
|
+
Accept: "application/json"
|
|
5469
|
+
}
|
|
5470
|
+
});
|
|
5471
|
+
if (!response.ok) {
|
|
5472
|
+
return;
|
|
5473
|
+
}
|
|
5474
|
+
const data = await response.json();
|
|
5475
|
+
const latestVersion = data["dist-tags"]?.latest;
|
|
5476
|
+
if (!latestVersion) {
|
|
5477
|
+
return;
|
|
5478
|
+
}
|
|
5479
|
+
if (isNewerVersion(latestVersion, SDK_VERSION)) {
|
|
5480
|
+
console.warn(
|
|
5481
|
+
`\u26A0\uFE0F A new version of ${SDK_NAME} is available: ${latestVersion} (current: ${SDK_VERSION}). Update with: npm install ${PACKAGE_NAME}@latest`
|
|
5482
|
+
);
|
|
5483
|
+
}
|
|
5484
|
+
} catch (error) {
|
|
5485
|
+
}
|
|
5486
|
+
}
|
|
5487
|
+
function isNewerVersion(version1, version2) {
|
|
5488
|
+
const v1Parts = version1.split(".").map(Number);
|
|
5489
|
+
const v2Parts = version2.split(".").map(Number);
|
|
5490
|
+
for (let i = 0; i < Math.max(v1Parts.length, v2Parts.length); i++) {
|
|
5491
|
+
const v1Part = v1Parts[i] || 0;
|
|
5492
|
+
const v2Part = v2Parts[i] || 0;
|
|
5493
|
+
if (v1Part > v2Part) {
|
|
5494
|
+
return true;
|
|
5495
|
+
}
|
|
5496
|
+
if (v1Part < v2Part) {
|
|
5497
|
+
return false;
|
|
5498
|
+
}
|
|
5499
|
+
}
|
|
5500
|
+
return false;
|
|
5501
|
+
}
|
|
5502
|
+
|
|
5451
5503
|
// src/domains/validation/validation-core.service.ts
|
|
5452
5504
|
var ValidationCoreService = class {
|
|
5453
5505
|
constructor(client) {
|
|
@@ -5730,13 +5782,14 @@ var WorkflowsCoreService = class {
|
|
|
5730
5782
|
}
|
|
5731
5783
|
async create(input) {
|
|
5732
5784
|
validateAdditionalData(input.additionalData);
|
|
5785
|
+
const domainName = new URL(input.urls[0]).hostname;
|
|
5733
5786
|
const request = {
|
|
5734
5787
|
urls: input.urls,
|
|
5735
|
-
name: input.name,
|
|
5788
|
+
name: input.name ?? domainName,
|
|
5736
5789
|
schemaId: input.schemaId,
|
|
5737
5790
|
description: input.description,
|
|
5738
5791
|
navigationMode: input.navigationMode,
|
|
5739
|
-
entity: input.entity,
|
|
5792
|
+
entity: input.entity ?? "",
|
|
5740
5793
|
fields: input.fields,
|
|
5741
5794
|
bypassPreview: input.bypassPreview ?? true,
|
|
5742
5795
|
tags: input.tags,
|
|
@@ -6018,6 +6071,8 @@ var KadoaClient = class {
|
|
|
6018
6071
|
if (config.enableRealtime && config.realtimeConfig?.autoConnect !== false) {
|
|
6019
6072
|
this.connectRealtime();
|
|
6020
6073
|
}
|
|
6074
|
+
checkForUpdates().catch(() => {
|
|
6075
|
+
});
|
|
6021
6076
|
}
|
|
6022
6077
|
/**
|
|
6023
6078
|
* Get the underlying configuration
|
|
@@ -6171,6 +6226,8 @@ exports.Realtime = Realtime;
|
|
|
6171
6226
|
exports.SchemaBuilder = SchemaBuilder;
|
|
6172
6227
|
exports.SchemaFieldDataType = SchemaFieldDataType;
|
|
6173
6228
|
exports.SchemasService = SchemasService;
|
|
6229
|
+
exports.TERMINAL_JOB_STATES = TERMINAL_JOB_STATES;
|
|
6230
|
+
exports.TERMINAL_RUN_STATES = TERMINAL_RUN_STATES;
|
|
6174
6231
|
exports.UserService = UserService;
|
|
6175
6232
|
exports.ValidationCoreService = ValidationCoreService;
|
|
6176
6233
|
exports.ValidationRulesService = ValidationRulesService;
|