@kadoa/mcp 0.3.10-rc.3 → 0.3.11-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +347 -10
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -44094,6 +44094,7 @@ function createClientDomains(params) {
|
|
|
44094
44094
|
const entityResolverService = new EntityResolverService(client);
|
|
44095
44095
|
const workflowsCoreService = new WorkflowsCoreService(client.apis.workflows);
|
|
44096
44096
|
const schemasService = new SchemasService(client);
|
|
44097
|
+
const variablesService = new VariablesService(client);
|
|
44097
44098
|
const channelSetupService = new NotificationSetupService(channelsService, settingsService);
|
|
44098
44099
|
const coreService = new ValidationCoreService(client);
|
|
44099
44100
|
const rulesService = new ValidationRulesService(client);
|
|
@@ -44115,6 +44116,7 @@ function createClientDomains(params) {
|
|
|
44115
44116
|
schema: schemasService,
|
|
44116
44117
|
user: userService,
|
|
44117
44118
|
validation,
|
|
44119
|
+
variable: variablesService,
|
|
44118
44120
|
crawler
|
|
44119
44121
|
};
|
|
44120
44122
|
}
|
|
@@ -44194,8 +44196,8 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
|
|
|
44194
44196
|
return needsSerialization ? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
|
|
44195
44197
|
}, toPathString = function(url3) {
|
|
44196
44198
|
return url3.pathname + url3.search + url3.hash;
|
|
44197
|
-
}, createRequestFunction = function(axiosArgs,
|
|
44198
|
-
return (axios2 =
|
|
44199
|
+
}, createRequestFunction = function(axiosArgs, globalAxios8, BASE_PATH2, configuration) {
|
|
44200
|
+
return (axios2 = globalAxios8, basePath = BASE_PATH2) => {
|
|
44199
44201
|
const axiosRequestArgs = { ...axiosArgs.options, url: (axios2.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
|
|
44200
44202
|
return axios2.request(axiosRequestArgs);
|
|
44201
44203
|
};
|
|
@@ -45781,7 +45783,151 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
|
|
|
45781
45783
|
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
45782
45784
|
}
|
|
45783
45785
|
};
|
|
45784
|
-
}, SchemasApi,
|
|
45786
|
+
}, SchemasApi, VariablesApiAxiosParamCreator = function(configuration) {
|
|
45787
|
+
return {
|
|
45788
|
+
v4VariablesGet: async (options = {}) => {
|
|
45789
|
+
const localVarPath = `/v4/variables/`;
|
|
45790
|
+
const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
|
|
45791
|
+
let baseOptions;
|
|
45792
|
+
if (configuration) {
|
|
45793
|
+
baseOptions = configuration.baseOptions;
|
|
45794
|
+
}
|
|
45795
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
45796
|
+
const localVarHeaderParameter = {};
|
|
45797
|
+
const localVarQueryParameter = {};
|
|
45798
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
45799
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
45800
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
45801
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
45802
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
45803
|
+
return {
|
|
45804
|
+
url: toPathString(localVarUrlObj),
|
|
45805
|
+
options: localVarRequestOptions
|
|
45806
|
+
};
|
|
45807
|
+
},
|
|
45808
|
+
v4VariablesPost: async (createVariableBody, options = {}) => {
|
|
45809
|
+
const localVarPath = `/v4/variables/`;
|
|
45810
|
+
const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
|
|
45811
|
+
let baseOptions;
|
|
45812
|
+
if (configuration) {
|
|
45813
|
+
baseOptions = configuration.baseOptions;
|
|
45814
|
+
}
|
|
45815
|
+
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
45816
|
+
const localVarHeaderParameter = {};
|
|
45817
|
+
const localVarQueryParameter = {};
|
|
45818
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
45819
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
45820
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
45821
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
45822
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
45823
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
45824
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createVariableBody, localVarRequestOptions, configuration);
|
|
45825
|
+
return {
|
|
45826
|
+
url: toPathString(localVarUrlObj),
|
|
45827
|
+
options: localVarRequestOptions
|
|
45828
|
+
};
|
|
45829
|
+
},
|
|
45830
|
+
v4VariablesVariableIdDelete: async (variableId, options = {}) => {
|
|
45831
|
+
assertParamExists("v4VariablesVariableIdDelete", "variableId", variableId);
|
|
45832
|
+
const localVarPath = `/v4/variables/{variableId}`.replace(`{${"variableId"}}`, encodeURIComponent(String(variableId)));
|
|
45833
|
+
const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
|
|
45834
|
+
let baseOptions;
|
|
45835
|
+
if (configuration) {
|
|
45836
|
+
baseOptions = configuration.baseOptions;
|
|
45837
|
+
}
|
|
45838
|
+
const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
|
|
45839
|
+
const localVarHeaderParameter = {};
|
|
45840
|
+
const localVarQueryParameter = {};
|
|
45841
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
45842
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
45843
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
45844
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
45845
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
45846
|
+
return {
|
|
45847
|
+
url: toPathString(localVarUrlObj),
|
|
45848
|
+
options: localVarRequestOptions
|
|
45849
|
+
};
|
|
45850
|
+
},
|
|
45851
|
+
v4VariablesVariableIdGet: async (variableId, options = {}) => {
|
|
45852
|
+
assertParamExists("v4VariablesVariableIdGet", "variableId", variableId);
|
|
45853
|
+
const localVarPath = `/v4/variables/{variableId}`.replace(`{${"variableId"}}`, encodeURIComponent(String(variableId)));
|
|
45854
|
+
const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
|
|
45855
|
+
let baseOptions;
|
|
45856
|
+
if (configuration) {
|
|
45857
|
+
baseOptions = configuration.baseOptions;
|
|
45858
|
+
}
|
|
45859
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
45860
|
+
const localVarHeaderParameter = {};
|
|
45861
|
+
const localVarQueryParameter = {};
|
|
45862
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
45863
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
45864
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
45865
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
45866
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
45867
|
+
return {
|
|
45868
|
+
url: toPathString(localVarUrlObj),
|
|
45869
|
+
options: localVarRequestOptions
|
|
45870
|
+
};
|
|
45871
|
+
},
|
|
45872
|
+
v4VariablesVariableIdPatch: async (variableId, updateVariableBody, options = {}) => {
|
|
45873
|
+
assertParamExists("v4VariablesVariableIdPatch", "variableId", variableId);
|
|
45874
|
+
const localVarPath = `/v4/variables/{variableId}`.replace(`{${"variableId"}}`, encodeURIComponent(String(variableId)));
|
|
45875
|
+
const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
|
|
45876
|
+
let baseOptions;
|
|
45877
|
+
if (configuration) {
|
|
45878
|
+
baseOptions = configuration.baseOptions;
|
|
45879
|
+
}
|
|
45880
|
+
const localVarRequestOptions = { method: "PATCH", ...baseOptions, ...options };
|
|
45881
|
+
const localVarHeaderParameter = {};
|
|
45882
|
+
const localVarQueryParameter = {};
|
|
45883
|
+
await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
|
|
45884
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
45885
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
45886
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
45887
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
45888
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
45889
|
+
localVarRequestOptions.data = serializeDataIfNeeded(updateVariableBody, localVarRequestOptions, configuration);
|
|
45890
|
+
return {
|
|
45891
|
+
url: toPathString(localVarUrlObj),
|
|
45892
|
+
options: localVarRequestOptions
|
|
45893
|
+
};
|
|
45894
|
+
}
|
|
45895
|
+
};
|
|
45896
|
+
}, VariablesApiFp = function(configuration) {
|
|
45897
|
+
const localVarAxiosParamCreator = VariablesApiAxiosParamCreator(configuration);
|
|
45898
|
+
return {
|
|
45899
|
+
async v4VariablesGet(options) {
|
|
45900
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4VariablesGet(options);
|
|
45901
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
45902
|
+
const localVarOperationServerBasePath = operationServerMap["VariablesApi.v4VariablesGet"]?.[localVarOperationServerIndex]?.url;
|
|
45903
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
45904
|
+
},
|
|
45905
|
+
async v4VariablesPost(createVariableBody, options) {
|
|
45906
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4VariablesPost(createVariableBody, options);
|
|
45907
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
45908
|
+
const localVarOperationServerBasePath = operationServerMap["VariablesApi.v4VariablesPost"]?.[localVarOperationServerIndex]?.url;
|
|
45909
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
45910
|
+
},
|
|
45911
|
+
async v4VariablesVariableIdDelete(variableId, options) {
|
|
45912
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4VariablesVariableIdDelete(variableId, options);
|
|
45913
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
45914
|
+
const localVarOperationServerBasePath = operationServerMap["VariablesApi.v4VariablesVariableIdDelete"]?.[localVarOperationServerIndex]?.url;
|
|
45915
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
45916
|
+
},
|
|
45917
|
+
async v4VariablesVariableIdGet(variableId, options) {
|
|
45918
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4VariablesVariableIdGet(variableId, options);
|
|
45919
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
45920
|
+
const localVarOperationServerBasePath = operationServerMap["VariablesApi.v4VariablesVariableIdGet"]?.[localVarOperationServerIndex]?.url;
|
|
45921
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
45922
|
+
},
|
|
45923
|
+
async v4VariablesVariableIdPatch(variableId, updateVariableBody, options) {
|
|
45924
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.v4VariablesVariableIdPatch(variableId, updateVariableBody, options);
|
|
45925
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
45926
|
+
const localVarOperationServerBasePath = operationServerMap["VariablesApi.v4VariablesVariableIdPatch"]?.[localVarOperationServerIndex]?.url;
|
|
45927
|
+
return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
|
|
45928
|
+
}
|
|
45929
|
+
};
|
|
45930
|
+
}, VariablesApi, WorkflowsApiAxiosParamCreator = function(configuration) {
|
|
45785
45931
|
return {
|
|
45786
45932
|
v4ChangesChangeIdGet: async (changeId, xApiKey, authorization, options = {}) => {
|
|
45787
45933
|
assertParamExists("v4ChangesChangeIdGet", "changeId", changeId);
|
|
@@ -47712,7 +47858,7 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
|
|
|
47712
47858
|
}));
|
|
47713
47859
|
return channels;
|
|
47714
47860
|
}
|
|
47715
|
-
}, PUBLIC_API_URI, WSS_API_URI, REALTIME_API_URI, SDK_VERSION = "0.
|
|
47861
|
+
}, PUBLIC_API_URI, WSS_API_URI, REALTIME_API_URI, SDK_VERSION = "0.25.0", SDK_NAME = "kadoa-node-sdk", SDK_LANGUAGE = "node", debug5, isDrainControlMessage = (message) => message.type === "control.draining", isRealtimeEvent = (message) => message.type !== "heartbeat" && message.type !== "control.draining", _Realtime = class _Realtime2 {
|
|
47716
47862
|
constructor(config2) {
|
|
47717
47863
|
this.drainingSockets = /* @__PURE__ */ new Set;
|
|
47718
47864
|
this.lastHeartbeat = Date.now();
|
|
@@ -48285,7 +48431,66 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
|
|
|
48285
48431
|
}
|
|
48286
48432
|
return response.data.data;
|
|
48287
48433
|
}
|
|
48288
|
-
},
|
|
48434
|
+
}, debug6, VariablesService = class {
|
|
48435
|
+
constructor(client) {
|
|
48436
|
+
this.client = client;
|
|
48437
|
+
}
|
|
48438
|
+
get variablesApi() {
|
|
48439
|
+
return this.client.apis.variables;
|
|
48440
|
+
}
|
|
48441
|
+
async list() {
|
|
48442
|
+
const response = await this.variablesApi.v4VariablesGet();
|
|
48443
|
+
return response.data.variables ?? [];
|
|
48444
|
+
}
|
|
48445
|
+
async get(variableId) {
|
|
48446
|
+
debug6("Fetching variable with ID: %s", variableId);
|
|
48447
|
+
const response = await this.variablesApi.v4VariablesVariableIdGet({
|
|
48448
|
+
variableId
|
|
48449
|
+
});
|
|
48450
|
+
const variable = response.data.variable;
|
|
48451
|
+
if (!variable) {
|
|
48452
|
+
throw new KadoaSdkException(`${ERROR_MESSAGES.VARIABLE_NOT_FOUND}: ${variableId}`, {
|
|
48453
|
+
code: KadoaErrorCode.NOT_FOUND,
|
|
48454
|
+
details: { variableId }
|
|
48455
|
+
});
|
|
48456
|
+
}
|
|
48457
|
+
return variable;
|
|
48458
|
+
}
|
|
48459
|
+
async create(body) {
|
|
48460
|
+
debug6("Creating variable with key: %s", body.key);
|
|
48461
|
+
const response = await this.variablesApi.v4VariablesPost({
|
|
48462
|
+
createVariableBody: body
|
|
48463
|
+
});
|
|
48464
|
+
const variable = response.data.variable;
|
|
48465
|
+
if (!variable) {
|
|
48466
|
+
throw new KadoaSdkException(ERROR_MESSAGES.VARIABLE_CREATE_FAILED, {
|
|
48467
|
+
code: KadoaErrorCode.INTERNAL_ERROR
|
|
48468
|
+
});
|
|
48469
|
+
}
|
|
48470
|
+
return variable;
|
|
48471
|
+
}
|
|
48472
|
+
async update(variableId, body) {
|
|
48473
|
+
debug6("Updating variable with ID: %s", variableId);
|
|
48474
|
+
const response = await this.variablesApi.v4VariablesVariableIdPatch({
|
|
48475
|
+
variableId,
|
|
48476
|
+
updateVariableBody: body
|
|
48477
|
+
});
|
|
48478
|
+
const variable = response.data.variable;
|
|
48479
|
+
if (!variable) {
|
|
48480
|
+
throw new KadoaSdkException(`${ERROR_MESSAGES.VARIABLE_UPDATE_FAILED}: ${variableId}`, {
|
|
48481
|
+
code: KadoaErrorCode.INTERNAL_ERROR,
|
|
48482
|
+
details: { variableId }
|
|
48483
|
+
});
|
|
48484
|
+
}
|
|
48485
|
+
return variable;
|
|
48486
|
+
}
|
|
48487
|
+
async delete(variableId) {
|
|
48488
|
+
debug6("Deleting variable with ID: %s", variableId);
|
|
48489
|
+
await this.variablesApi.v4VariablesVariableIdDelete({
|
|
48490
|
+
variableId
|
|
48491
|
+
});
|
|
48492
|
+
}
|
|
48493
|
+
}, JobStateEnum, TERMINAL_JOB_STATES, TERMINAL_RUN_STATES, debug7, WorkflowsCoreService = class {
|
|
48289
48494
|
constructor(workflowsApi) {
|
|
48290
48495
|
this.workflowsApi = workflowsApi;
|
|
48291
48496
|
}
|
|
@@ -48401,7 +48606,7 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
|
|
|
48401
48606
|
async wait(id, options) {
|
|
48402
48607
|
const result = await pollUntil(async () => {
|
|
48403
48608
|
const current = await this.get(id);
|
|
48404
|
-
|
|
48609
|
+
debug7("workflow %s state: %s", id, current.runState);
|
|
48405
48610
|
return current;
|
|
48406
48611
|
}, (current) => {
|
|
48407
48612
|
if (options?.targetState && current.state === options.targetState) {
|
|
@@ -48447,7 +48652,7 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
|
|
|
48447
48652
|
async waitForJobCompletion(workflowId, jobId, options) {
|
|
48448
48653
|
const result = await pollUntil(async () => {
|
|
48449
48654
|
const current = await this.getJobStatus(workflowId, jobId);
|
|
48450
|
-
|
|
48655
|
+
debug7("workflow run %s state: %s", jobId, current.state);
|
|
48451
48656
|
return current;
|
|
48452
48657
|
}, (current) => {
|
|
48453
48658
|
if (options?.targetStatus && current.state === options.targetStatus) {
|
|
@@ -48492,6 +48697,9 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
|
|
|
48492
48697
|
get notifications() {
|
|
48493
48698
|
return this.get(NotificationsApi);
|
|
48494
48699
|
}
|
|
48700
|
+
get variables() {
|
|
48701
|
+
return this.get(VariablesApi);
|
|
48702
|
+
}
|
|
48495
48703
|
}, KadoaClient = class {
|
|
48496
48704
|
constructor(config2) {
|
|
48497
48705
|
if (!config2.apiKey && !config2.bearerToken) {
|
|
@@ -48520,6 +48728,7 @@ var import_debug, __require2, BASE_PATH, BaseAPI = class {
|
|
|
48520
48728
|
this.schema = domains.schema;
|
|
48521
48729
|
this.notification = domains.notification;
|
|
48522
48730
|
this.validation = domains.validation;
|
|
48731
|
+
this.variable = domains.variable;
|
|
48523
48732
|
this.crawler = domains.crawler;
|
|
48524
48733
|
this._extractionBuilderService = domains.extractionBuilderService;
|
|
48525
48734
|
checkForUpdates().catch(() => {});
|
|
@@ -48785,6 +48994,23 @@ var init_dist2 = __esm(() => {
|
|
|
48785
48994
|
return SchemasApiFp(this.configuration).v4SchemasSchemaIdPut(requestParameters.schemaId, requestParameters.updateSchemaBody, options).then((request) => request(this.axios, this.basePath));
|
|
48786
48995
|
}
|
|
48787
48996
|
};
|
|
48997
|
+
VariablesApi = class extends BaseAPI {
|
|
48998
|
+
v4VariablesGet(options) {
|
|
48999
|
+
return VariablesApiFp(this.configuration).v4VariablesGet(options).then((request) => request(this.axios, this.basePath));
|
|
49000
|
+
}
|
|
49001
|
+
v4VariablesPost(requestParameters = {}, options) {
|
|
49002
|
+
return VariablesApiFp(this.configuration).v4VariablesPost(requestParameters.createVariableBody, options).then((request) => request(this.axios, this.basePath));
|
|
49003
|
+
}
|
|
49004
|
+
v4VariablesVariableIdDelete(requestParameters, options) {
|
|
49005
|
+
return VariablesApiFp(this.configuration).v4VariablesVariableIdDelete(requestParameters.variableId, options).then((request) => request(this.axios, this.basePath));
|
|
49006
|
+
}
|
|
49007
|
+
v4VariablesVariableIdGet(requestParameters, options) {
|
|
49008
|
+
return VariablesApiFp(this.configuration).v4VariablesVariableIdGet(requestParameters.variableId, options).then((request) => request(this.axios, this.basePath));
|
|
49009
|
+
}
|
|
49010
|
+
v4VariablesVariableIdPatch(requestParameters, options) {
|
|
49011
|
+
return VariablesApiFp(this.configuration).v4VariablesVariableIdPatch(requestParameters.variableId, requestParameters.updateVariableBody, options).then((request) => request(this.axios, this.basePath));
|
|
49012
|
+
}
|
|
49013
|
+
};
|
|
48788
49014
|
WorkflowsApi = class extends BaseAPI {
|
|
48789
49015
|
v4ChangesChangeIdGet(requestParameters, options) {
|
|
48790
49016
|
return WorkflowsApiFp(this.configuration).v4ChangesChangeIdGet(requestParameters.changeId, requestParameters.xApiKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
@@ -48972,7 +49198,10 @@ var init_dist2 = __esm(() => {
|
|
|
48972
49198
|
SCHEMAS_FETCH_ERROR: "Failed to fetch schemas",
|
|
48973
49199
|
SCHEMA_CREATE_FAILED: "Failed to create schema",
|
|
48974
49200
|
SCHEMA_UPDATE_FAILED: "Failed to update schema",
|
|
48975
|
-
SCHEMA_DELETE_FAILED: "Failed to delete schema"
|
|
49201
|
+
SCHEMA_DELETE_FAILED: "Failed to delete schema",
|
|
49202
|
+
VARIABLE_NOT_FOUND: "Variable not found",
|
|
49203
|
+
VARIABLE_CREATE_FAILED: "Failed to create variable",
|
|
49204
|
+
VARIABLE_UPDATE_FAILED: "Failed to update variable"
|
|
48976
49205
|
};
|
|
48977
49206
|
KadoaSdkException = _KadoaSdkException;
|
|
48978
49207
|
ERROR_MESSAGES = KadoaSdkException.ERROR_MESSAGES;
|
|
@@ -49079,7 +49308,8 @@ var init_dist2 = __esm(() => {
|
|
|
49079
49308
|
crawl: createLogger("crawl"),
|
|
49080
49309
|
notifications: createLogger("notifications"),
|
|
49081
49310
|
schemas: createLogger("schemas"),
|
|
49082
|
-
validation: createLogger("validation")
|
|
49311
|
+
validation: createLogger("validation"),
|
|
49312
|
+
variables: createLogger("variables")
|
|
49083
49313
|
};
|
|
49084
49314
|
_SchemaBuilder.FIELD_NAME_PATTERN = /^[A-Za-z0-9]+$/;
|
|
49085
49315
|
_SchemaBuilder.TYPES_REQUIRING_EXAMPLE = [
|
|
@@ -49132,6 +49362,7 @@ var init_dist2 = __esm(() => {
|
|
|
49132
49362
|
ABORTED: "ABORTED",
|
|
49133
49363
|
TIMEOUT: "TIMEOUT"
|
|
49134
49364
|
};
|
|
49365
|
+
debug6 = logger.variables;
|
|
49135
49366
|
JobStateEnum = {
|
|
49136
49367
|
Finished: "FINISHED",
|
|
49137
49368
|
Failed: "FAILED",
|
|
@@ -49152,7 +49383,7 @@ var init_dist2 = __esm(() => {
|
|
|
49152
49383
|
"STOPPED",
|
|
49153
49384
|
"CANCELLED"
|
|
49154
49385
|
]);
|
|
49155
|
-
|
|
49386
|
+
debug7 = logger.workflow;
|
|
49156
49387
|
});
|
|
49157
49388
|
|
|
49158
49389
|
// src/client.ts
|
|
@@ -50208,6 +50439,112 @@ function registerTools(server, ctx) {
|
|
|
50208
50439
|
message: `Switched to team "${match.name}". All subsequent API calls will use this team.`
|
|
50209
50440
|
});
|
|
50210
50441
|
}));
|
|
50442
|
+
server.registerTool("create_variable", {
|
|
50443
|
+
description: "Create a new variable. Variables are key-value pairs that can be referenced in workflow prompts using @variableKey syntax. Keys must be unique within the team scope.",
|
|
50444
|
+
inputSchema: strictSchema({
|
|
50445
|
+
key: exports_external.string().describe("Variable key (must be unique within scope). Referenced in prompts as @key."),
|
|
50446
|
+
value: exports_external.string().describe("Variable value"),
|
|
50447
|
+
dataType: exports_external.enum(["STRING", "NUMBER", "BOOLEAN", "JSON"]).optional().describe("Data type of the value (defaults to STRING)")
|
|
50448
|
+
}),
|
|
50449
|
+
annotations: {
|
|
50450
|
+
readOnlyHint: false,
|
|
50451
|
+
destructiveHint: false,
|
|
50452
|
+
idempotentHint: false
|
|
50453
|
+
}
|
|
50454
|
+
}, withErrorHandling("create_variable", async (args) => {
|
|
50455
|
+
const variable = await ctx.client.variable.create({
|
|
50456
|
+
key: args.key,
|
|
50457
|
+
value: args.value,
|
|
50458
|
+
...args.dataType != null && { dataType: args.dataType }
|
|
50459
|
+
});
|
|
50460
|
+
return jsonResult({
|
|
50461
|
+
success: true,
|
|
50462
|
+
variable,
|
|
50463
|
+
message: `Variable "${variable.key}" created. Use @${variable.key} in workflow prompts to reference it.`
|
|
50464
|
+
});
|
|
50465
|
+
}));
|
|
50466
|
+
server.registerTool("list_variables", {
|
|
50467
|
+
description: "List all variables in the current team scope. Variables are key-value pairs that can be referenced in workflow prompts using @variableKey syntax.",
|
|
50468
|
+
inputSchema: strictSchema({}),
|
|
50469
|
+
annotations: {
|
|
50470
|
+
readOnlyHint: true,
|
|
50471
|
+
destructiveHint: false,
|
|
50472
|
+
idempotentHint: true
|
|
50473
|
+
}
|
|
50474
|
+
}, withErrorHandling("list_variables", async () => {
|
|
50475
|
+
const variables = await ctx.client.variable.list();
|
|
50476
|
+
return jsonResult({
|
|
50477
|
+
variables,
|
|
50478
|
+
count: variables.length
|
|
50479
|
+
});
|
|
50480
|
+
}));
|
|
50481
|
+
server.registerTool("get_variable", {
|
|
50482
|
+
description: "Get a specific variable by its ID.",
|
|
50483
|
+
inputSchema: strictSchema({
|
|
50484
|
+
variableId: exports_external.string().describe("The variable ID")
|
|
50485
|
+
}),
|
|
50486
|
+
annotations: {
|
|
50487
|
+
readOnlyHint: true,
|
|
50488
|
+
destructiveHint: false,
|
|
50489
|
+
idempotentHint: true
|
|
50490
|
+
}
|
|
50491
|
+
}, withErrorHandling("get_variable", async (args) => {
|
|
50492
|
+
const variable = await ctx.client.variable.get(args.variableId);
|
|
50493
|
+
return jsonResult({ variable });
|
|
50494
|
+
}));
|
|
50495
|
+
server.registerTool("update_variable", {
|
|
50496
|
+
description: "Update an existing variable. At least one field must be provided. If the variable key is referenced in workflow prompts (@variableKey), those workflows will automatically use the new value on next run.",
|
|
50497
|
+
inputSchema: strictSchema({
|
|
50498
|
+
variableId: exports_external.string().describe("The variable ID to update"),
|
|
50499
|
+
key: exports_external.string().optional().describe("New variable key"),
|
|
50500
|
+
value: exports_external.string().optional().describe("New variable value"),
|
|
50501
|
+
dataType: exports_external.enum(["STRING", "NUMBER", "BOOLEAN", "JSON"]).optional().describe("New data type")
|
|
50502
|
+
}),
|
|
50503
|
+
annotations: {
|
|
50504
|
+
readOnlyHint: false,
|
|
50505
|
+
destructiveHint: false,
|
|
50506
|
+
idempotentHint: true
|
|
50507
|
+
}
|
|
50508
|
+
}, withErrorHandling("update_variable", async (args) => {
|
|
50509
|
+
const { variableId, ...updates } = args;
|
|
50510
|
+
const variable = await ctx.client.variable.update(variableId, updates);
|
|
50511
|
+
return jsonResult({
|
|
50512
|
+
success: true,
|
|
50513
|
+
variable,
|
|
50514
|
+
message: "Variable updated."
|
|
50515
|
+
});
|
|
50516
|
+
}));
|
|
50517
|
+
server.registerTool("delete_variable", {
|
|
50518
|
+
description: "Delete a variable permanently. This is irreversible. " + "You MUST first call this tool without confirmed=true to preview what will be deleted, " + "then show the user the variable key and ask for confirmation, " + "then call again with confirmed=true only after the user explicitly agrees.",
|
|
50519
|
+
inputSchema: strictSchema({
|
|
50520
|
+
variableId: exports_external.string().describe("The variable ID to delete"),
|
|
50521
|
+
confirmed: exports_external.preprocess(coerceBoolean(), exports_external.boolean()).optional().describe("Set to true only after the user has explicitly confirmed deletion. Omit or set to false for the initial preview call.")
|
|
50522
|
+
}),
|
|
50523
|
+
annotations: {
|
|
50524
|
+
readOnlyHint: false,
|
|
50525
|
+
destructiveHint: true,
|
|
50526
|
+
idempotentHint: true
|
|
50527
|
+
}
|
|
50528
|
+
}, withErrorHandling("delete_variable", async (args) => {
|
|
50529
|
+
let variableKey = args.variableId;
|
|
50530
|
+
try {
|
|
50531
|
+
const variable = await ctx.client.variable.get(args.variableId);
|
|
50532
|
+
variableKey = variable.key || args.variableId;
|
|
50533
|
+
} catch {}
|
|
50534
|
+
if (!args.confirmed) {
|
|
50535
|
+
return jsonResult({
|
|
50536
|
+
pending: true,
|
|
50537
|
+
variableId: args.variableId,
|
|
50538
|
+
variableKey,
|
|
50539
|
+
message: `⚠️ You are about to permanently delete variable "${variableKey}". This cannot be undone. Ask the user to confirm, then call delete_variable again with confirmed=true.`
|
|
50540
|
+
});
|
|
50541
|
+
}
|
|
50542
|
+
await ctx.client.variable.delete(args.variableId);
|
|
50543
|
+
return jsonResult({
|
|
50544
|
+
success: true,
|
|
50545
|
+
message: `Variable "${variableKey}" (${args.variableId}) deleted.`
|
|
50546
|
+
});
|
|
50547
|
+
}));
|
|
50211
50548
|
}
|
|
50212
50549
|
var SchemaFieldShape, DASHBOARD_BASE_URL = "https://www.kadoa.com";
|
|
50213
50550
|
var init_tools = __esm(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kadoa/mcp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11-rc.1",
|
|
4
4
|
"description": "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"prepublishOnly": "bun run check-types && bun run test:unit && bun run build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@kadoa/node-sdk": "^0.
|
|
27
|
+
"@kadoa/node-sdk": "^0.25.0",
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
29
29
|
"express": "^5.2.1",
|
|
30
30
|
"ioredis": "^5.6.1",
|