@kadoa/mcp 0.5.2 → 0.5.3-rc.2

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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +579 -205
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -28938,8 +28938,17 @@ var toString, getPrototypeOf, iterator, toStringTag, kindOf, kindOfTest = (type)
28938
28938
  }, isDate, isFile, isReactNativeBlob = (value) => {
28939
28939
  return !!(value && typeof value.uri !== "undefined");
28940
28940
  }, isReactNative = (formData) => formData && typeof formData.getParts !== "undefined", isBlob, isFileList, isStream = (val) => isObject2(val) && isFunction(val.pipe), G, FormDataCtor, isFormData = (thing) => {
28941
- let kind;
28942
- return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
28941
+ if (!thing)
28942
+ return false;
28943
+ if (FormDataCtor && thing instanceof FormDataCtor)
28944
+ return true;
28945
+ const proto = getPrototypeOf(thing);
28946
+ if (!proto || proto === Object.prototype)
28947
+ return false;
28948
+ if (!isFunction(thing.append))
28949
+ return false;
28950
+ const kind = kindOf(thing);
28951
+ return kind === "formdata" || kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]";
28943
28952
  }, isURLSearchParams, isReadableStream, isRequest, isResponse, isHeaders, trim = (str) => {
28944
28953
  return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
28945
28954
  }, _global, isContextDefined = (context) => !isUndefined(context) && context !== _global, extend2 = (a, b, thisArg, { allOwnKeys } = {}) => {
@@ -29286,6 +29295,7 @@ var init_AxiosError = __esm(() => {
29286
29295
  AxiosError.ERR_CANCELED = "ERR_CANCELED";
29287
29296
  AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
29288
29297
  AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
29298
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
29289
29299
  AxiosError_default = AxiosError;
29290
29300
  });
29291
29301
 
@@ -39437,6 +39447,7 @@ function toFormData(obj, formData, options) {
39437
39447
  const dots = options.dots;
39438
39448
  const indexes = options.indexes;
39439
39449
  const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
39450
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
39440
39451
  const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
39441
39452
  if (!utils_default.isFunction(visitor)) {
39442
39453
  throw new TypeError("visitor must be a function");
@@ -39488,9 +39499,12 @@ function toFormData(obj, formData, options) {
39488
39499
  convertValue,
39489
39500
  isVisitable
39490
39501
  });
39491
- function build(value, path) {
39502
+ function build(value, path, depth = 0) {
39492
39503
  if (utils_default.isUndefined(value))
39493
39504
  return;
39505
+ if (depth > maxDepth) {
39506
+ throw new AxiosError_default("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError_default.ERR_FORM_DATA_DEPTH_EXCEEDED);
39507
+ }
39494
39508
  if (stack.indexOf(value) !== -1) {
39495
39509
  throw Error("Circular reference detected in " + path.join("."));
39496
39510
  }
@@ -39498,7 +39512,7 @@ function toFormData(obj, formData, options) {
39498
39512
  utils_default.forEach(value, function each(el, key) {
39499
39513
  const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers);
39500
39514
  if (result === true) {
39501
- build(el, path ? path.concat(key) : [key]);
39515
+ build(el, path ? path.concat(key) : [key], depth + 1);
39502
39516
  }
39503
39517
  });
39504
39518
  stack.pop();
@@ -39528,10 +39542,9 @@ function encode3(str) {
39528
39542
  "(": "%28",
39529
39543
  ")": "%29",
39530
39544
  "~": "%7E",
39531
- "%20": "+",
39532
- "%00": "\x00"
39545
+ "%20": "+"
39533
39546
  };
39534
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
39547
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
39535
39548
  return charMap[match];
39536
39549
  });
39537
39550
  }
@@ -39757,7 +39770,7 @@ function formDataToJSON(formData) {
39757
39770
  name = !name && utils_default.isArray(target) ? target.length : name;
39758
39771
  if (isLast) {
39759
39772
  if (utils_default.hasOwnProp(target, name)) {
39760
- target[name] = [target[name], value];
39773
+ target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
39761
39774
  } else {
39762
39775
  target[name] = value;
39763
39776
  }
@@ -39801,7 +39814,7 @@ function stringifySafely(rawValue, parser, encoder) {
39801
39814
  }
39802
39815
  return (encoder || JSON.stringify)(rawValue);
39803
39816
  }
39804
- var defaults, defaults_default;
39817
+ var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : undefined, defaults, defaults_default;
39805
39818
  var init_defaults = __esm(() => {
39806
39819
  init_utils();
39807
39820
  init_AxiosError();
@@ -39837,12 +39850,14 @@ var init_defaults = __esm(() => {
39837
39850
  }
39838
39851
  let isFileList2;
39839
39852
  if (isObjectPayload) {
39853
+ const formSerializer = own(this, "formSerializer");
39840
39854
  if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
39841
- return toURLEncodedForm(data, this.formSerializer).toString();
39855
+ return toURLEncodedForm(data, formSerializer).toString();
39842
39856
  }
39843
39857
  if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
39844
- const _FormData = this.env && this.env.FormData;
39845
- return toFormData_default(isFileList2 ? { "files[]": data } : data, _FormData && new _FormData, this.formSerializer);
39858
+ const env = own(this, "env");
39859
+ const _FormData = env && env.FormData;
39860
+ return toFormData_default(isFileList2 ? { "files[]": data } : data, _FormData && new _FormData, formSerializer);
39846
39861
  }
39847
39862
  }
39848
39863
  if (isObjectPayload || hasJSONContentType) {
@@ -39854,21 +39869,22 @@ var init_defaults = __esm(() => {
39854
39869
  ],
39855
39870
  transformResponse: [
39856
39871
  function transformResponse(data) {
39857
- const transitional = this.transitional || defaults.transitional;
39872
+ const transitional = own(this, "transitional") || defaults.transitional;
39858
39873
  const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
39859
- const JSONRequested = this.responseType === "json";
39874
+ const responseType = own(this, "responseType");
39875
+ const JSONRequested = responseType === "json";
39860
39876
  if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
39861
39877
  return data;
39862
39878
  }
39863
- if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
39879
+ if (data && utils_default.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) {
39864
39880
  const silentJSONParsing = transitional && transitional.silentJSONParsing;
39865
39881
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
39866
39882
  try {
39867
- return JSON.parse(data, this.parseReviver);
39883
+ return JSON.parse(data, own(this, "parseReviver"));
39868
39884
  } catch (e) {
39869
39885
  if (strictJSONParsing) {
39870
39886
  if (e.name === "SyntaxError") {
39871
- throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
39887
+ throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, own(this, "response"));
39872
39888
  }
39873
39889
  throw e;
39874
39890
  }
@@ -39952,14 +39968,36 @@ var init_parseHeaders = __esm(() => {
39952
39968
  });
39953
39969
 
39954
39970
  // node_modules/axios/lib/core/AxiosHeaders.js
39971
+ function trimSPorHTAB(str) {
39972
+ let start = 0;
39973
+ let end = str.length;
39974
+ while (start < end) {
39975
+ const code = str.charCodeAt(start);
39976
+ if (code !== 9 && code !== 32) {
39977
+ break;
39978
+ }
39979
+ start += 1;
39980
+ }
39981
+ while (end > start) {
39982
+ const code = str.charCodeAt(end - 1);
39983
+ if (code !== 9 && code !== 32) {
39984
+ break;
39985
+ }
39986
+ end -= 1;
39987
+ }
39988
+ return start === 0 && end === str.length ? str : str.slice(start, end);
39989
+ }
39955
39990
  function normalizeHeader(header) {
39956
39991
  return header && String(header).trim().toLowerCase();
39957
39992
  }
39993
+ function sanitizeHeaderValue(str) {
39994
+ return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
39995
+ }
39958
39996
  function normalizeValue(value) {
39959
39997
  if (value === false || value == null) {
39960
39998
  return value;
39961
39999
  }
39962
- return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
40000
+ return utils_default.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
39963
40001
  }
39964
40002
  function parseTokens(str) {
39965
40003
  const tokens = Object.create(null);
@@ -40002,11 +40040,12 @@ function buildAccessors(obj, header) {
40002
40040
  });
40003
40041
  });
40004
40042
  }
40005
- var $internals, isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()), AxiosHeaders, AxiosHeaders_default;
40043
+ var $internals, INVALID_HEADER_VALUE_CHARS_RE, isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()), AxiosHeaders, AxiosHeaders_default;
40006
40044
  var init_AxiosHeaders = __esm(() => {
40007
40045
  init_utils();
40008
40046
  init_parseHeaders();
40009
40047
  $internals = Symbol("internals");
40048
+ INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
40010
40049
  AxiosHeaders = class AxiosHeaders {
40011
40050
  constructor(headers) {
40012
40051
  headers && this.set(headers);
@@ -40259,7 +40298,7 @@ function combineURLs(baseURL, relativeURL) {
40259
40298
  // node_modules/axios/lib/core/buildFullPath.js
40260
40299
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
40261
40300
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
40262
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
40301
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
40263
40302
  return combineURLs(baseURL, requestedURL);
40264
40303
  }
40265
40304
  return requestedURL;
@@ -40267,9 +40306,66 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
40267
40306
  var init_buildFullPath = () => {};
40268
40307
 
40269
40308
  // node_modules/proxy-from-env/index.js
40270
- var require_proxy_from_env = __commonJS((exports) => {
40271
- var parseUrl = __require("url").parse;
40272
- var DEFAULT_PORTS = {
40309
+ function parseUrl(urlString) {
40310
+ try {
40311
+ return new URL(urlString);
40312
+ } catch {
40313
+ return null;
40314
+ }
40315
+ }
40316
+ function getProxyForUrl(url3) {
40317
+ var parsedUrl = (typeof url3 === "string" ? parseUrl(url3) : url3) || {};
40318
+ var proto = parsedUrl.protocol;
40319
+ var hostname3 = parsedUrl.host;
40320
+ var port = parsedUrl.port;
40321
+ if (typeof hostname3 !== "string" || !hostname3 || typeof proto !== "string") {
40322
+ return "";
40323
+ }
40324
+ proto = proto.split(":", 1)[0];
40325
+ hostname3 = hostname3.replace(/:\d*$/, "");
40326
+ port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
40327
+ if (!shouldProxy(hostname3, port)) {
40328
+ return "";
40329
+ }
40330
+ var proxy = getEnv(proto + "_proxy") || getEnv("all_proxy");
40331
+ if (proxy && proxy.indexOf("://") === -1) {
40332
+ proxy = proto + "://" + proxy;
40333
+ }
40334
+ return proxy;
40335
+ }
40336
+ function shouldProxy(hostname3, port) {
40337
+ var NO_PROXY = getEnv("no_proxy").toLowerCase();
40338
+ if (!NO_PROXY) {
40339
+ return true;
40340
+ }
40341
+ if (NO_PROXY === "*") {
40342
+ return false;
40343
+ }
40344
+ return NO_PROXY.split(/[,\s]/).every(function(proxy) {
40345
+ if (!proxy) {
40346
+ return true;
40347
+ }
40348
+ var parsedProxy = proxy.match(/^(.+):(\d+)$/);
40349
+ var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
40350
+ var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
40351
+ if (parsedProxyPort && parsedProxyPort !== port) {
40352
+ return true;
40353
+ }
40354
+ if (!/^[.*]/.test(parsedProxyHostname)) {
40355
+ return hostname3 !== parsedProxyHostname;
40356
+ }
40357
+ if (parsedProxyHostname.charAt(0) === "*") {
40358
+ parsedProxyHostname = parsedProxyHostname.slice(1);
40359
+ }
40360
+ return !hostname3.endsWith(parsedProxyHostname);
40361
+ });
40362
+ }
40363
+ function getEnv(key) {
40364
+ return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
40365
+ }
40366
+ var DEFAULT_PORTS;
40367
+ var init_proxy_from_env = __esm(() => {
40368
+ DEFAULT_PORTS = {
40273
40369
  ftp: 21,
40274
40370
  gopher: 70,
40275
40371
  http: 80,
@@ -40277,60 +40373,6 @@ var require_proxy_from_env = __commonJS((exports) => {
40277
40373
  ws: 80,
40278
40374
  wss: 443
40279
40375
  };
40280
- var stringEndsWith = String.prototype.endsWith || function(s) {
40281
- return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
40282
- };
40283
- function getProxyForUrl(url3) {
40284
- var parsedUrl = typeof url3 === "string" ? parseUrl(url3) : url3 || {};
40285
- var proto = parsedUrl.protocol;
40286
- var hostname3 = parsedUrl.host;
40287
- var port = parsedUrl.port;
40288
- if (typeof hostname3 !== "string" || !hostname3 || typeof proto !== "string") {
40289
- return "";
40290
- }
40291
- proto = proto.split(":", 1)[0];
40292
- hostname3 = hostname3.replace(/:\d*$/, "");
40293
- port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
40294
- if (!shouldProxy(hostname3, port)) {
40295
- return "";
40296
- }
40297
- var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
40298
- if (proxy && proxy.indexOf("://") === -1) {
40299
- proxy = proto + "://" + proxy;
40300
- }
40301
- return proxy;
40302
- }
40303
- function shouldProxy(hostname3, port) {
40304
- var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
40305
- if (!NO_PROXY) {
40306
- return true;
40307
- }
40308
- if (NO_PROXY === "*") {
40309
- return false;
40310
- }
40311
- return NO_PROXY.split(/[,\s]/).every(function(proxy) {
40312
- if (!proxy) {
40313
- return true;
40314
- }
40315
- var parsedProxy = proxy.match(/^(.+):(\d+)$/);
40316
- var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
40317
- var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
40318
- if (parsedProxyPort && parsedProxyPort !== port) {
40319
- return true;
40320
- }
40321
- if (!/^[.*]/.test(parsedProxyHostname)) {
40322
- return hostname3 !== parsedProxyHostname;
40323
- }
40324
- if (parsedProxyHostname.charAt(0) === "*") {
40325
- parsedProxyHostname = parsedProxyHostname.slice(1);
40326
- }
40327
- return !stringEndsWith.call(hostname3, parsedProxyHostname);
40328
- });
40329
- }
40330
- function getEnv(key) {
40331
- return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
40332
- }
40333
- exports.getProxyForUrl = getProxyForUrl;
40334
40376
  });
40335
40377
 
40336
40378
  // node_modules/ms/index.js
@@ -41269,7 +41311,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
41269
41311
  removeMatchingHeaders(/^content-/i, this._options.headers);
41270
41312
  }
41271
41313
  var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
41272
- var currentUrlParts = parseUrl(this._currentUrl);
41314
+ var currentUrlParts = parseUrl2(this._currentUrl);
41273
41315
  var currentHost = currentHostHeader || currentUrlParts.host;
41274
41316
  var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url3.format(Object.assign(currentUrlParts, { host: currentHost }));
41275
41317
  var redirectUrl = resolveUrl(location, currentUrl);
@@ -41308,7 +41350,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
41308
41350
  if (isURL(input)) {
41309
41351
  input = spreadUrlObject(input);
41310
41352
  } else if (isString2(input)) {
41311
- input = spreadUrlObject(parseUrl(input));
41353
+ input = spreadUrlObject(parseUrl2(input));
41312
41354
  } else {
41313
41355
  callback = options;
41314
41356
  options = validateUrl(input);
@@ -41343,7 +41385,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
41343
41385
  return exports2;
41344
41386
  }
41345
41387
  function noop2() {}
41346
- function parseUrl(input) {
41388
+ function parseUrl2(input) {
41347
41389
  var parsed;
41348
41390
  if (useNativeURL) {
41349
41391
  parsed = new URL2(input);
@@ -41356,7 +41398,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
41356
41398
  return parsed;
41357
41399
  }
41358
41400
  function resolveUrl(relative, base) {
41359
- return useNativeURL ? new URL2(relative, base) : parseUrl(url3.resolve(base, relative));
41401
+ return useNativeURL ? new URL2(relative, base) : parseUrl2(url3.resolve(base, relative));
41360
41402
  }
41361
41403
  function validateUrl(input) {
41362
41404
  if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
@@ -41442,7 +41484,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
41442
41484
  });
41443
41485
 
41444
41486
  // node_modules/axios/lib/env/data.js
41445
- var VERSION = "1.13.6";
41487
+ var VERSION = "1.15.2";
41446
41488
 
41447
41489
  // node_modules/axios/lib/helpers/parseProtocol.js
41448
41490
  function parseProtocol(url3) {
@@ -41632,7 +41674,8 @@ class FormDataPart {
41632
41674
  if (isStringValue) {
41633
41675
  value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
41634
41676
  } else {
41635
- headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
41677
+ const safeType = String(value.type || "application/octet-stream").replace(/[\r\n]/g, "");
41678
+ headers += `Content-Type: ${safeType}${CRLF}`;
41636
41679
  }
41637
41680
  this.headers = textEncoder.encode(headers + CRLF);
41638
41681
  this.contentLength = isStringValue ? value.byteLength : value.size;
@@ -41749,6 +41792,120 @@ var init_callbackify = __esm(() => {
41749
41792
  callbackify_default = callbackify;
41750
41793
  });
41751
41794
 
41795
+ // node_modules/axios/lib/helpers/shouldBypassProxy.js
41796
+ function shouldBypassProxy(location) {
41797
+ let parsed;
41798
+ try {
41799
+ parsed = new URL(location);
41800
+ } catch (_err) {
41801
+ return false;
41802
+ }
41803
+ const noProxy = (process.env.no_proxy || process.env.NO_PROXY || "").toLowerCase();
41804
+ if (!noProxy) {
41805
+ return false;
41806
+ }
41807
+ if (noProxy === "*") {
41808
+ return true;
41809
+ }
41810
+ const port = Number.parseInt(parsed.port, 10) || DEFAULT_PORTS2[parsed.protocol.split(":", 1)[0]] || 0;
41811
+ const hostname3 = normalizeNoProxyHost(parsed.hostname.toLowerCase());
41812
+ return noProxy.split(/[\s,]+/).some((entry) => {
41813
+ if (!entry) {
41814
+ return false;
41815
+ }
41816
+ let [entryHost, entryPort] = parseNoProxyEntry(entry);
41817
+ entryHost = normalizeNoProxyHost(entryHost);
41818
+ if (!entryHost) {
41819
+ return false;
41820
+ }
41821
+ if (entryPort && entryPort !== port) {
41822
+ return false;
41823
+ }
41824
+ if (entryHost.charAt(0) === "*") {
41825
+ entryHost = entryHost.slice(1);
41826
+ }
41827
+ if (entryHost.charAt(0) === ".") {
41828
+ return hostname3.endsWith(entryHost);
41829
+ }
41830
+ return hostname3 === entryHost || isLoopback(hostname3) && isLoopback(entryHost);
41831
+ });
41832
+ }
41833
+ var LOOPBACK_HOSTNAMES, isIPv4Loopback = (host) => {
41834
+ const parts = host.split(".");
41835
+ if (parts.length !== 4)
41836
+ return false;
41837
+ if (parts[0] !== "127")
41838
+ return false;
41839
+ return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
41840
+ }, isIPv6Loopback = (host) => {
41841
+ if (host === "::1")
41842
+ return true;
41843
+ const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
41844
+ if (v4MappedDotted)
41845
+ return isIPv4Loopback(v4MappedDotted[1]);
41846
+ const v4MappedHex = host.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);
41847
+ if (v4MappedHex) {
41848
+ const high = parseInt(v4MappedHex[1], 16);
41849
+ return high >= 32512 && high <= 32767;
41850
+ }
41851
+ const groups = host.split(":");
41852
+ if (groups.length === 8) {
41853
+ for (let i = 0;i < 7; i++) {
41854
+ if (!/^0+$/.test(groups[i]))
41855
+ return false;
41856
+ }
41857
+ return /^0*1$/.test(groups[7]);
41858
+ }
41859
+ return false;
41860
+ }, isLoopback = (host) => {
41861
+ if (!host)
41862
+ return false;
41863
+ if (LOOPBACK_HOSTNAMES.has(host))
41864
+ return true;
41865
+ if (isIPv4Loopback(host))
41866
+ return true;
41867
+ return isIPv6Loopback(host);
41868
+ }, DEFAULT_PORTS2, parseNoProxyEntry = (entry) => {
41869
+ let entryHost = entry;
41870
+ let entryPort = 0;
41871
+ if (entryHost.charAt(0) === "[") {
41872
+ const bracketIndex = entryHost.indexOf("]");
41873
+ if (bracketIndex !== -1) {
41874
+ const host = entryHost.slice(1, bracketIndex);
41875
+ const rest = entryHost.slice(bracketIndex + 1);
41876
+ if (rest.charAt(0) === ":" && /^\d+$/.test(rest.slice(1))) {
41877
+ entryPort = Number.parseInt(rest.slice(1), 10);
41878
+ }
41879
+ return [host, entryPort];
41880
+ }
41881
+ }
41882
+ const firstColon = entryHost.indexOf(":");
41883
+ const lastColon = entryHost.lastIndexOf(":");
41884
+ if (firstColon !== -1 && firstColon === lastColon && /^\d+$/.test(entryHost.slice(lastColon + 1))) {
41885
+ entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10);
41886
+ entryHost = entryHost.slice(0, lastColon);
41887
+ }
41888
+ return [entryHost, entryPort];
41889
+ }, normalizeNoProxyHost = (hostname3) => {
41890
+ if (!hostname3) {
41891
+ return hostname3;
41892
+ }
41893
+ if (hostname3.charAt(0) === "[" && hostname3.charAt(hostname3.length - 1) === "]") {
41894
+ hostname3 = hostname3.slice(1, -1);
41895
+ }
41896
+ return hostname3.replace(/\.+$/, "");
41897
+ };
41898
+ var init_shouldBypassProxy = __esm(() => {
41899
+ LOOPBACK_HOSTNAMES = new Set(["localhost"]);
41900
+ DEFAULT_PORTS2 = {
41901
+ http: 80,
41902
+ https: 443,
41903
+ ws: 80,
41904
+ wss: 443,
41905
+ ftp: 21
41906
+ };
41907
+ });
41908
+
41752
41909
  // node_modules/axios/lib/helpers/speedometer.js
41753
41910
  function speedometer(samplesCount, min) {
41754
41911
  samplesCount = samplesCount || 10;
@@ -41831,19 +41988,19 @@ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
41831
41988
  let bytesNotified = 0;
41832
41989
  const _speedometer = speedometer_default(50, 250);
41833
41990
  return throttle_default((e) => {
41834
- const loaded = e.loaded;
41991
+ const rawLoaded = e.loaded;
41835
41992
  const total = e.lengthComputable ? e.total : undefined;
41836
- const progressBytes = loaded - bytesNotified;
41993
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
41994
+ const progressBytes = Math.max(0, loaded - bytesNotified);
41837
41995
  const rate = _speedometer(progressBytes);
41838
- const inRange = loaded <= total;
41839
- bytesNotified = loaded;
41996
+ bytesNotified = Math.max(bytesNotified, loaded);
41840
41997
  const data = {
41841
41998
  loaded,
41842
41999
  total,
41843
42000
  progress: total ? loaded / total : undefined,
41844
42001
  bytes: progressBytes,
41845
42002
  rate: rate ? rate : undefined,
41846
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
42003
+ estimated: rate && total ? (total - loaded) / rate : undefined,
41847
42004
  event: e,
41848
42005
  lengthComputable: total != null,
41849
42006
  [isDownloadStream ? "download" : "upload"]: true
@@ -41924,6 +42081,7 @@ import http from "http";
41924
42081
  import https from "https";
41925
42082
  import http2 from "http2";
41926
42083
  import util4 from "util";
42084
+ import { resolve as resolvePath } from "path";
41927
42085
  import zlib from "zlib";
41928
42086
  import stream3 from "stream";
41929
42087
  import { EventEmitter } from "events";
@@ -41961,6 +42119,9 @@ class Http2Sessions {
41961
42119
  } else {
41962
42120
  entries.splice(i, 1);
41963
42121
  }
42122
+ if (!session.closed) {
42123
+ session.close();
42124
+ }
41964
42125
  return;
41965
42126
  }
41966
42127
  }
@@ -42005,9 +42166,11 @@ function dispatchBeforeRedirect(options, responseDetails) {
42005
42166
  function setProxy(options, configProxy, location) {
42006
42167
  let proxy = configProxy;
42007
42168
  if (!proxy && proxy !== false) {
42008
- const proxyUrl = import_proxy_from_env.default.getProxyForUrl(location);
42169
+ const proxyUrl = getProxyForUrl(location);
42009
42170
  if (proxyUrl) {
42010
- proxy = new URL(proxyUrl);
42171
+ if (!shouldBypassProxy(location)) {
42172
+ proxy = new URL(proxyUrl);
42173
+ }
42011
42174
  }
42012
42175
  }
42013
42176
  if (proxy) {
@@ -42038,7 +42201,7 @@ function setProxy(options, configProxy, location) {
42038
42201
  setProxy(redirectOptions, configProxy, redirectOptions.href);
42039
42202
  };
42040
42203
  }
42041
- var import_proxy_from_env, import_follow_redirects, zlibOptions, brotliOptions, isBrotliSupported, httpFollow, httpsFollow, isHttps, supportedProtocols, flushOnFinish = (stream4, [throttled, flush]) => {
42204
+ var import_follow_redirects, zlibOptions, brotliOptions, isBrotliSupported, httpFollow, httpsFollow, isHttps, kAxiosSocketListener, kAxiosCurrentReq, supportedProtocols, flushOnFinish = (stream4, [throttled, flush]) => {
42042
42205
  stream4.on("end", flush).on("error", flush);
42043
42206
  return throttled;
42044
42207
  }, http2Sessions, isHttpAdapterSupported, wrapAsync = (asyncExecutor) => {
@@ -42075,6 +42238,7 @@ var init_http = __esm(() => {
42075
42238
  init_settle();
42076
42239
  init_buildFullPath();
42077
42240
  init_buildURL();
42241
+ init_proxy_from_env();
42078
42242
  init_transitional();
42079
42243
  init_AxiosError();
42080
42244
  init_CanceledError();
@@ -42086,8 +42250,8 @@ var init_http = __esm(() => {
42086
42250
  init_readBlob();
42087
42251
  init_ZlibHeaderTransformStream();
42088
42252
  init_callbackify();
42253
+ init_shouldBypassProxy();
42089
42254
  init_progressEventReducer();
42090
- import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
42091
42255
  import_follow_redirects = __toESM(require_follow_redirects(), 1);
42092
42256
  zlibOptions = {
42093
42257
  flush: zlib.constants.Z_SYNC_FLUSH,
@@ -42100,6 +42264,8 @@ var init_http = __esm(() => {
42100
42264
  isBrotliSupported = utils_default.isFunction(zlib.createBrotliDecompress);
42101
42265
  ({ http: httpFollow, https: httpsFollow } = import_follow_redirects.default);
42102
42266
  isHttps = /https:?/;
42267
+ kAxiosSocketListener = Symbol("axios.http.socketListener");
42268
+ kAxiosCurrentReq = Symbol("axios.http.currentReq");
42103
42269
  supportedProtocols = platform_default.protocols.map((protocol) => {
42104
42270
  return protocol + ":";
42105
42271
  });
@@ -42134,8 +42300,16 @@ var init_http = __esm(() => {
42134
42300
  };
42135
42301
  http_default = isHttpAdapterSupported && function httpAdapter(config2) {
42136
42302
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
42137
- let { data, lookup, family, httpVersion = 1, http2Options } = config2;
42138
- const { responseType, responseEncoding } = config2;
42303
+ const own2 = (key) => utils_default.hasOwnProp(config2, key) ? config2[key] : undefined;
42304
+ let data = own2("data");
42305
+ let lookup = own2("lookup");
42306
+ let family = own2("family");
42307
+ let httpVersion = own2("httpVersion");
42308
+ if (httpVersion === undefined)
42309
+ httpVersion = 1;
42310
+ let http2Options = own2("http2Options");
42311
+ const responseType = own2("responseType");
42312
+ const responseEncoding = own2("responseEncoding");
42139
42313
  const method = config2.method.toUpperCase();
42140
42314
  let isDone;
42141
42315
  let rejected = false;
@@ -42261,7 +42435,7 @@ var init_http = __esm(() => {
42261
42435
  tag: `axios-${VERSION}-boundary`,
42262
42436
  boundary: userBoundary && userBoundary[1] || undefined
42263
42437
  });
42264
- } else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders)) {
42438
+ } else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) {
42265
42439
  headers.set(data.getHeaders());
42266
42440
  if (!headers.hasContentLength()) {
42267
42441
  try {
@@ -42306,9 +42480,10 @@ var init_http = __esm(() => {
42306
42480
  onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3))));
42307
42481
  }
42308
42482
  let auth = undefined;
42309
- if (config2.auth) {
42310
- const username = config2.auth.username || "";
42311
- const password = config2.auth.password || "";
42483
+ const configAuth = own2("auth");
42484
+ if (configAuth) {
42485
+ const username = configAuth.username || "";
42486
+ const password = configAuth.password || "";
42312
42487
  auth = username + ":" + password;
42313
42488
  }
42314
42489
  if (!auth && parsed.username) {
@@ -42328,7 +42503,7 @@ var init_http = __esm(() => {
42328
42503
  return reject(customErr);
42329
42504
  }
42330
42505
  headers.set("Accept-Encoding", "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), false);
42331
- const options = {
42506
+ const options = Object.assign(Object.create(null), {
42332
42507
  path,
42333
42508
  method,
42334
42509
  headers: headers.toJSON(),
@@ -42337,11 +42512,22 @@ var init_http = __esm(() => {
42337
42512
  protocol,
42338
42513
  family,
42339
42514
  beforeRedirect: dispatchBeforeRedirect,
42340
- beforeRedirects: {},
42515
+ beforeRedirects: Object.create(null),
42341
42516
  http2Options
42342
- };
42517
+ });
42343
42518
  !utils_default.isUndefined(lookup) && (options.lookup = lookup);
42344
42519
  if (config2.socketPath) {
42520
+ if (typeof config2.socketPath !== "string") {
42521
+ return reject(new AxiosError_default("socketPath must be a string", AxiosError_default.ERR_BAD_OPTION_VALUE, config2));
42522
+ }
42523
+ if (config2.allowedSocketPaths != null) {
42524
+ const allowed = Array.isArray(config2.allowedSocketPaths) ? config2.allowedSocketPaths : [config2.allowedSocketPaths];
42525
+ const resolvedSocket = resolvePath(config2.socketPath);
42526
+ const isAllowed = allowed.some((entry) => typeof entry === "string" && resolvePath(entry) === resolvedSocket);
42527
+ if (!isAllowed) {
42528
+ return reject(new AxiosError_default(`socketPath "${config2.socketPath}" is not permitted by allowedSocketPaths`, AxiosError_default.ERR_BAD_OPTION_VALUE, config2));
42529
+ }
42530
+ }
42345
42531
  options.socketPath = config2.socketPath;
42346
42532
  } else {
42347
42533
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
@@ -42354,16 +42540,18 @@ var init_http = __esm(() => {
42354
42540
  if (isHttp2) {
42355
42541
  transport = http2Transport;
42356
42542
  } else {
42357
- if (config2.transport) {
42358
- transport = config2.transport;
42543
+ const configTransport = own2("transport");
42544
+ if (configTransport) {
42545
+ transport = configTransport;
42359
42546
  } else if (config2.maxRedirects === 0) {
42360
42547
  transport = isHttpsRequest ? https : http;
42361
42548
  } else {
42362
42549
  if (config2.maxRedirects) {
42363
42550
  options.maxRedirects = config2.maxRedirects;
42364
42551
  }
42365
- if (config2.beforeRedirect) {
42366
- options.beforeRedirects.config = config2.beforeRedirect;
42552
+ const configBeforeRedirect = own2("beforeRedirect");
42553
+ if (configBeforeRedirect) {
42554
+ options.beforeRedirects.config = configBeforeRedirect;
42367
42555
  }
42368
42556
  transport = isHttpsRequest ? httpsFollow : httpFollow;
42369
42557
  }
@@ -42373,9 +42561,7 @@ var init_http = __esm(() => {
42373
42561
  } else {
42374
42562
  options.maxBodyLength = Infinity;
42375
42563
  }
42376
- if (config2.insecureHTTPParser) {
42377
- options.insecureHTTPParser = config2.insecureHTTPParser;
42378
- }
42564
+ options.insecureHTTPParser = Boolean(own2("insecureHTTPParser"));
42379
42565
  req = transport.request(options, function handleResponse(res) {
42380
42566
  if (req.destroyed)
42381
42567
  return;
@@ -42423,6 +42609,23 @@ var init_http = __esm(() => {
42423
42609
  request: lastRequest
42424
42610
  };
42425
42611
  if (responseType === "stream") {
42612
+ if (config2.maxContentLength > -1) {
42613
+ const limit = config2.maxContentLength;
42614
+ const source = responseStream;
42615
+ async function* enforceMaxContentLength() {
42616
+ let totalResponseBytes = 0;
42617
+ for await (const chunk of source) {
42618
+ totalResponseBytes += chunk.length;
42619
+ if (totalResponseBytes > limit) {
42620
+ throw new AxiosError_default("maxContentLength size of " + limit + " exceeded", AxiosError_default.ERR_BAD_RESPONSE, config2, lastRequest);
42621
+ }
42622
+ yield chunk;
42623
+ }
42624
+ }
42625
+ responseStream = stream3.Readable.from(enforceMaxContentLength(), {
42626
+ objectMode: false
42627
+ });
42628
+ }
42426
42629
  response.data = responseStream;
42427
42630
  settle(resolve, reject, response);
42428
42631
  } else {
@@ -42485,6 +42688,21 @@ var init_http = __esm(() => {
42485
42688
  });
42486
42689
  req.on("socket", function handleRequestSocket(socket) {
42487
42690
  socket.setKeepAlive(true, 1000 * 60);
42691
+ if (!socket[kAxiosSocketListener]) {
42692
+ socket.on("error", function handleSocketError(err) {
42693
+ const current = socket[kAxiosCurrentReq];
42694
+ if (current && !current.destroyed) {
42695
+ current.destroy(err);
42696
+ }
42697
+ });
42698
+ socket[kAxiosSocketListener] = true;
42699
+ }
42700
+ socket[kAxiosCurrentReq] = req;
42701
+ req.once("close", function clearCurrentReq() {
42702
+ if (socket[kAxiosCurrentReq] === req) {
42703
+ socket[kAxiosCurrentReq] = null;
42704
+ }
42705
+ });
42488
42706
  });
42489
42707
  if (config2.timeout) {
42490
42708
  const timeout = parseInt(config2.timeout, 10);
@@ -42520,7 +42738,28 @@ var init_http = __esm(() => {
42520
42738
  abort(new CanceledError_default("Request stream has been aborted", config2, req));
42521
42739
  }
42522
42740
  });
42523
- data.pipe(req);
42741
+ let uploadStream = data;
42742
+ if (config2.maxBodyLength > -1 && config2.maxRedirects === 0) {
42743
+ const limit = config2.maxBodyLength;
42744
+ let bytesSent = 0;
42745
+ uploadStream = stream3.pipeline([
42746
+ data,
42747
+ new stream3.Transform({
42748
+ transform(chunk, _enc, cb) {
42749
+ bytesSent += chunk.length;
42750
+ if (bytesSent > limit) {
42751
+ return cb(new AxiosError_default("Request body larger than maxBodyLength limit", AxiosError_default.ERR_BAD_REQUEST, config2, req));
42752
+ }
42753
+ cb(null, chunk);
42754
+ }
42755
+ })
42756
+ ], utils_default.noop);
42757
+ uploadStream.on("error", (err) => {
42758
+ if (!req.destroyed)
42759
+ req.destroy(err);
42760
+ });
42761
+ }
42762
+ uploadStream.pipe(req);
42524
42763
  } else {
42525
42764
  data && req.write(data);
42526
42765
  req.end();
@@ -42587,7 +42826,13 @@ var init_cookies = __esm(() => {
42587
42826
  // node_modules/axios/lib/core/mergeConfig.js
42588
42827
  function mergeConfig(config1, config2) {
42589
42828
  config2 = config2 || {};
42590
- const config3 = {};
42829
+ const config3 = Object.create(null);
42830
+ Object.defineProperty(config3, "hasOwnProperty", {
42831
+ value: Object.prototype.hasOwnProperty,
42832
+ enumerable: false,
42833
+ writable: true,
42834
+ configurable: true
42835
+ });
42591
42836
  function getMergedValue(target, source, prop, caseless) {
42592
42837
  if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
42593
42838
  return utils_default.merge.call({ caseless }, target, source);
@@ -42618,9 +42863,9 @@ function mergeConfig(config1, config2) {
42618
42863
  }
42619
42864
  }
42620
42865
  function mergeDirectKeys(a, b, prop) {
42621
- if (prop in config2) {
42866
+ if (utils_default.hasOwnProp(config2, prop)) {
42622
42867
  return getMergedValue(a, b);
42623
- } else if (prop in config1) {
42868
+ } else if (utils_default.hasOwnProp(config1, prop)) {
42624
42869
  return getMergedValue(undefined, a);
42625
42870
  }
42626
42871
  }
@@ -42651,6 +42896,7 @@ function mergeConfig(config1, config2) {
42651
42896
  httpsAgent: defaultToConfig2,
42652
42897
  cancelToken: defaultToConfig2,
42653
42898
  socketPath: defaultToConfig2,
42899
+ allowedSocketPaths: defaultToConfig2,
42654
42900
  responseEncoding: defaultToConfig2,
42655
42901
  validateStatus: mergeDirectKeys,
42656
42902
  headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
@@ -42659,7 +42905,9 @@ function mergeConfig(config1, config2) {
42659
42905
  if (prop === "__proto__" || prop === "constructor" || prop === "prototype")
42660
42906
  return;
42661
42907
  const merge3 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
42662
- const configValue = merge3(config1[prop], config2[prop], prop);
42908
+ const a = utils_default.hasOwnProp(config1, prop) ? config1[prop] : undefined;
42909
+ const b = utils_default.hasOwnProp(config2, prop) ? config2[prop] : undefined;
42910
+ const configValue = merge3(a, b, prop);
42663
42911
  utils_default.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config3[prop] = configValue);
42664
42912
  });
42665
42913
  return config3;
@@ -42673,9 +42921,18 @@ var init_mergeConfig = __esm(() => {
42673
42921
  // node_modules/axios/lib/helpers/resolveConfig.js
42674
42922
  var resolveConfig_default = (config2) => {
42675
42923
  const newConfig = mergeConfig({}, config2);
42676
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
42924
+ const own2 = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : undefined;
42925
+ const data = own2("data");
42926
+ let withXSRFToken = own2("withXSRFToken");
42927
+ const xsrfHeaderName = own2("xsrfHeaderName");
42928
+ const xsrfCookieName = own2("xsrfCookieName");
42929
+ let headers = own2("headers");
42930
+ const auth = own2("auth");
42931
+ const baseURL = own2("baseURL");
42932
+ const allowAbsoluteUrls = own2("allowAbsoluteUrls");
42933
+ const url3 = own2("url");
42677
42934
  newConfig.headers = headers = AxiosHeaders_default.from(headers);
42678
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config2.params, config2.paramsSerializer);
42935
+ newConfig.url = buildURL(buildFullPath(baseURL, url3, allowAbsoluteUrls), config2.params, config2.paramsSerializer);
42679
42936
  if (auth) {
42680
42937
  headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
42681
42938
  }
@@ -42693,8 +42950,11 @@ var resolveConfig_default = (config2) => {
42693
42950
  }
42694
42951
  }
42695
42952
  if (platform_default.hasStandardBrowserEnv) {
42696
- withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
42697
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
42953
+ if (utils_default.isFunction(withXSRFToken)) {
42954
+ withXSRFToken = withXSRFToken(newConfig);
42955
+ }
42956
+ const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin_default(newConfig.url);
42957
+ if (shouldSendXSRF) {
42698
42958
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
42699
42959
  if (xsrfValue) {
42700
42960
  headers.set(xsrfHeaderName, xsrfValue);
@@ -42986,14 +43246,18 @@ var DEFAULT_CHUNK_SIZE, isFunction2, globalFetchAPI, ReadableStream2, TextEncode
42986
43246
  const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder2) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
42987
43247
  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
42988
43248
  let duplexAccessed = false;
42989
- const hasContentType = new Request(platform_default.origin, {
43249
+ const request = new Request(platform_default.origin, {
42990
43250
  body: new ReadableStream2,
42991
43251
  method: "POST",
42992
43252
  get duplex() {
42993
43253
  duplexAccessed = true;
42994
43254
  return "half";
42995
43255
  }
42996
- }).headers.has("Content-Type");
43256
+ });
43257
+ const hasContentType = request.headers.has("Content-Type");
43258
+ if (request.body != null) {
43259
+ request.body.cancel();
43260
+ }
42997
43261
  return duplexAccessed && !hasContentType;
42998
43262
  });
42999
43263
  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response2("").body));
@@ -43082,6 +43346,12 @@ var DEFAULT_CHUNK_SIZE, isFunction2, globalFetchAPI, ReadableStream2, TextEncode
43082
43346
  withCredentials = withCredentials ? "include" : "omit";
43083
43347
  }
43084
43348
  const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
43349
+ if (utils_default.isFormData(data)) {
43350
+ const contentType = headers.getContentType();
43351
+ if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) {
43352
+ headers.delete("content-type");
43353
+ }
43354
+ }
43085
43355
  const resolvedOptions = {
43086
43356
  ...fetchOptions,
43087
43357
  signal: composedSignal,
@@ -43271,7 +43541,7 @@ function assertOptions(options, schema, allowUnknown) {
43271
43541
  let i = keys.length;
43272
43542
  while (i-- > 0) {
43273
43543
  const opt = keys[i];
43274
- const validator = schema[opt];
43544
+ const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
43275
43545
  if (validator) {
43276
43546
  const value = options[opt];
43277
43547
  const result = value === undefined || validator(value, opt, options);
@@ -43338,13 +43608,27 @@ class Axios {
43338
43608
  if (err instanceof Error) {
43339
43609
  let dummy = {};
43340
43610
  Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error;
43341
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
43611
+ const stack = (() => {
43612
+ if (!dummy.stack) {
43613
+ return "";
43614
+ }
43615
+ const firstNewlineIndex = dummy.stack.indexOf(`
43616
+ `);
43617
+ return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1);
43618
+ })();
43342
43619
  try {
43343
43620
  if (!err.stack) {
43344
43621
  err.stack = stack;
43345
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
43346
- err.stack += `
43622
+ } else if (stack) {
43623
+ const firstNewlineIndex = stack.indexOf(`
43624
+ `);
43625
+ const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf(`
43626
+ `, firstNewlineIndex + 1);
43627
+ const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
43628
+ if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
43629
+ err.stack += `
43347
43630
  ` + stack;
43631
+ }
43348
43632
  }
43349
43633
  } catch (e) {}
43350
43634
  }
@@ -43848,26 +44132,13 @@ var init_dist = __esm(() => {
43848
44132
  init_upperFirst();
43849
44133
  });
43850
44134
 
43851
- // node_modules/uuid/dist-node/native.js
43852
- import { randomUUID } from "node:crypto";
43853
- var native_default;
43854
- var init_native = __esm(() => {
43855
- native_default = { randomUUID };
43856
- });
43857
-
43858
44135
  // node_modules/uuid/dist-node/rng.js
43859
- import { randomFillSync } from "node:crypto";
43860
44136
  function rng() {
43861
- if (poolPtr > rnds8Pool.length - 16) {
43862
- randomFillSync(rnds8Pool);
43863
- poolPtr = 0;
43864
- }
43865
- return rnds8Pool.slice(poolPtr, poolPtr += 16);
44137
+ return crypto.getRandomValues(rnds8);
43866
44138
  }
43867
- var rnds8Pool, poolPtr;
44139
+ var rnds8;
43868
44140
  var init_rng = __esm(() => {
43869
- rnds8Pool = new Uint8Array(256);
43870
- poolPtr = rnds8Pool.length;
44141
+ rnds8 = new Uint8Array(16);
43871
44142
  });
43872
44143
 
43873
44144
  // node_modules/uuid/dist-node/stringify.js
@@ -43883,6 +44154,12 @@ var init_stringify = __esm(() => {
43883
44154
  });
43884
44155
 
43885
44156
  // node_modules/uuid/dist-node/v4.js
44157
+ function v4(options, buf, offset) {
44158
+ if (!buf && !options && crypto.randomUUID) {
44159
+ return crypto.randomUUID();
44160
+ }
44161
+ return _v4(options, buf, offset);
44162
+ }
43886
44163
  function _v4(options, buf, offset) {
43887
44164
  options = options || {};
43888
44165
  const rnds = options.random ?? options.rng?.() ?? rng();
@@ -43903,15 +44180,8 @@ function _v4(options, buf, offset) {
43903
44180
  }
43904
44181
  return unsafeStringify(rnds);
43905
44182
  }
43906
- function v4(options, buf, offset) {
43907
- if (native_default.randomUUID && !buf && !options) {
43908
- return native_default.randomUUID();
43909
- }
43910
- return _v4(options, buf, offset);
43911
- }
43912
44183
  var v4_default;
43913
44184
  var init_v42 = __esm(() => {
43914
- init_native();
43915
44185
  init_rng();
43916
44186
  init_stringify();
43917
44187
  v4_default = v4;
@@ -46617,8 +46887,8 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
46617
46887
  options: localVarRequestOptions
46618
46888
  };
46619
46889
  },
46620
- v4WorkflowsPost: async (createWorkflowBody, options = {}) => {
46621
- const localVarPath = `/v4/workflows/`;
46890
+ v4WorkflowsPost: async (publicWorkflowCreateRequest, options = {}) => {
46891
+ const localVarPath = `/v4/workflows`;
46622
46892
  const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
46623
46893
  let baseOptions;
46624
46894
  if (configuration) {
@@ -46633,7 +46903,7 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
46633
46903
  setSearchParams(localVarUrlObj, localVarQueryParameter);
46634
46904
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
46635
46905
  localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
46636
- localVarRequestOptions.data = serializeDataIfNeeded(createWorkflowBody, localVarRequestOptions, configuration);
46906
+ localVarRequestOptions.data = serializeDataIfNeeded(publicWorkflowCreateRequest, localVarRequestOptions, configuration);
46637
46907
  return {
46638
46908
  url: toPathString(localVarUrlObj),
46639
46909
  options: localVarRequestOptions
@@ -46730,7 +47000,30 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
46730
47000
  options: localVarRequestOptions
46731
47001
  };
46732
47002
  },
46733
- v4WorkflowsWorkflowIdDataGet: async (workflowId, xApiKey, authorization, runId, format, sortBy2, order, filters, page, limit, gzip, rowIds, includeAnomalies, options = {}) => {
47003
+ v4WorkflowsWorkflowIdDataExportsExportIdGet: async (workflowId, exportId, options = {}) => {
47004
+ assertParamExists("v4WorkflowsWorkflowIdDataExportsExportIdGet", "workflowId", workflowId);
47005
+ assertParamExists("v4WorkflowsWorkflowIdDataExportsExportIdGet", "exportId", exportId);
47006
+ const localVarPath = `/v4/workflows/{workflowId}/data/exports/{exportId}`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId))).replace(`{${"exportId"}}`, encodeURIComponent(String(exportId)));
47007
+ const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
47008
+ let baseOptions;
47009
+ if (configuration) {
47010
+ baseOptions = configuration.baseOptions;
47011
+ }
47012
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
47013
+ const localVarHeaderParameter = {};
47014
+ const localVarQueryParameter = {};
47015
+ await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
47016
+ await setBearerAuthToObject(localVarHeaderParameter, configuration);
47017
+ localVarHeaderParameter["Accept"] = "text/csv";
47018
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
47019
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
47020
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
47021
+ return {
47022
+ url: toPathString(localVarUrlObj),
47023
+ options: localVarRequestOptions
47024
+ };
47025
+ },
47026
+ v4WorkflowsWorkflowIdDataGet: async (workflowId, xApiKey, authorization, runId, format, sortBy2, order, filters, page, limit, gzip, rowIds, includeAnomalies, download, options = {}) => {
46734
47027
  assertParamExists("v4WorkflowsWorkflowIdDataGet", "workflowId", workflowId);
46735
47028
  const localVarPath = `/v4/workflows/{workflowId}/data`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
46736
47029
  const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
@@ -46773,6 +47066,9 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
46773
47066
  if (includeAnomalies !== undefined) {
46774
47067
  localVarQueryParameter["includeAnomalies"] = includeAnomalies;
46775
47068
  }
47069
+ if (download !== undefined) {
47070
+ localVarQueryParameter["download"] = download;
47071
+ }
46776
47072
  localVarHeaderParameter["Accept"] = "application/json,text/csv";
46777
47073
  if (xApiKey != null) {
46778
47074
  localVarHeaderParameter["x-api-key"] = String(xApiKey);
@@ -46986,6 +47282,27 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
46986
47282
  options: localVarRequestOptions
46987
47283
  };
46988
47284
  },
47285
+ v4WorkflowsWorkflowIdStopPut: async (workflowId, options = {}) => {
47286
+ assertParamExists("v4WorkflowsWorkflowIdStopPut", "workflowId", workflowId);
47287
+ const localVarPath = `/v4/workflows/{workflowId}/stop`.replace(`{${"workflowId"}}`, encodeURIComponent(String(workflowId)));
47288
+ const localVarUrlObj = new URL$1(localVarPath, DUMMY_BASE_URL);
47289
+ let baseOptions;
47290
+ if (configuration) {
47291
+ baseOptions = configuration.baseOptions;
47292
+ }
47293
+ const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options };
47294
+ const localVarHeaderParameter = {};
47295
+ const localVarQueryParameter = {};
47296
+ await setApiKeyToObject(localVarHeaderParameter, "x-api-key", configuration);
47297
+ localVarHeaderParameter["Accept"] = "application/json";
47298
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
47299
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
47300
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
47301
+ return {
47302
+ url: toPathString(localVarUrlObj),
47303
+ options: localVarRequestOptions
47304
+ };
47305
+ },
46989
47306
  v5ChangesChangeIdGet: async (changeId, xApiKey, authorization, options = {}) => {
46990
47307
  assertParamExists("v5ChangesChangeIdGet", "changeId", changeId);
46991
47308
  const localVarPath = `/v5/changes/{changeId}`.replace(`{${"changeId"}}`, encodeURIComponent(String(changeId)));
@@ -47124,8 +47441,8 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
47124
47441
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsGet"]?.[localVarOperationServerIndex]?.url;
47125
47442
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
47126
47443
  },
47127
- async v4WorkflowsPost(createWorkflowBody, options) {
47128
- const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsPost(createWorkflowBody, options);
47444
+ async v4WorkflowsPost(publicWorkflowCreateRequest, options) {
47445
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsPost(publicWorkflowCreateRequest, options);
47129
47446
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
47130
47447
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsPost"]?.[localVarOperationServerIndex]?.url;
47131
47448
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
@@ -47148,8 +47465,14 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
47148
47465
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdComplianceRejectPut"]?.[localVarOperationServerIndex]?.url;
47149
47466
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
47150
47467
  },
47151
- async v4WorkflowsWorkflowIdDataGet(workflowId, xApiKey, authorization, runId, format, sortBy2, order, filters, page, limit, gzip, rowIds, includeAnomalies, options) {
47152
- const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdDataGet(workflowId, xApiKey, authorization, runId, format, sortBy2, order, filters, page, limit, gzip, rowIds, includeAnomalies, options);
47468
+ async v4WorkflowsWorkflowIdDataExportsExportIdGet(workflowId, exportId, options) {
47469
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdDataExportsExportIdGet(workflowId, exportId, options);
47470
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
47471
+ const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdDataExportsExportIdGet"]?.[localVarOperationServerIndex]?.url;
47472
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
47473
+ },
47474
+ async v4WorkflowsWorkflowIdDataGet(workflowId, xApiKey, authorization, runId, format, sortBy2, order, filters, page, limit, gzip, rowIds, includeAnomalies, download, options) {
47475
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdDataGet(workflowId, xApiKey, authorization, runId, format, sortBy2, order, filters, page, limit, gzip, rowIds, includeAnomalies, download, options);
47153
47476
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
47154
47477
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdDataGet"]?.[localVarOperationServerIndex]?.url;
47155
47478
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
@@ -47208,6 +47531,12 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
47208
47531
  const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdSchedulePut"]?.[localVarOperationServerIndex]?.url;
47209
47532
  return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
47210
47533
  },
47534
+ async v4WorkflowsWorkflowIdStopPut(workflowId, options) {
47535
+ const localVarAxiosArgs = await localVarAxiosParamCreator.v4WorkflowsWorkflowIdStopPut(workflowId, options);
47536
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
47537
+ const localVarOperationServerBasePath = operationServerMap["WorkflowsApi.v4WorkflowsWorkflowIdStopPut"]?.[localVarOperationServerIndex]?.url;
47538
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, axios_default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
47539
+ },
47211
47540
  async v5ChangesChangeIdGet(changeId, xApiKey, authorization, options) {
47212
47541
  const localVarAxiosArgs = await localVarAxiosParamCreator.v5ChangesChangeIdGet(changeId, xApiKey, authorization, options);
47213
47542
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
@@ -47389,8 +47718,7 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
47389
47718
  page: options.page ?? 1,
47390
47719
  limit: options.limit ?? this.defaultLimit
47391
47720
  });
47392
- const result = response.data;
47393
- return result;
47721
+ return response.data;
47394
47722
  }
47395
47723
  async fetchAllData(options) {
47396
47724
  const iterator2 = new PagedIterator((pageOptions) => this.fetchData({ ...options, ...pageOptions }));
@@ -48325,7 +48653,7 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
48325
48653
  }));
48326
48654
  return channels;
48327
48655
  }
48328
- }, PUBLIC_API_URI, WSS_API_URI, REALTIME_API_URI, SDK_VERSION = "0.29.1", SDK_NAME = "kadoa-node-sdk", SDK_LANGUAGE = "node", debug6, isDrainControlMessage = (message) => message.type === "control.draining", isRealtimeEvent = (message) => message.type !== "heartbeat" && message.type !== "control.draining", _Realtime = class _Realtime2 {
48656
+ }, PUBLIC_API_URI, WSS_API_URI, REALTIME_API_URI, SDK_VERSION = "0.31.1", SDK_NAME = "kadoa-node-sdk", SDK_LANGUAGE = "node", debug6, isDrainControlMessage = (message) => message.type === "control.draining", isRealtimeEvent = (message) => message.type !== "heartbeat" && message.type !== "control.draining", _Realtime = class _Realtime2 {
48329
48657
  constructor(config2) {
48330
48658
  this.drainingSockets = /* @__PURE__ */ new Set;
48331
48659
  this.lastHeartbeat = Date.now();
@@ -49059,53 +49387,20 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
49059
49387
  }
49060
49388
  async create(input) {
49061
49389
  validateAdditionalData(input.additionalData);
49062
- const domainName = new URL(input.urls[0]).hostname;
49063
- if (input.navigationMode === "agentic-navigation") {
49064
- if (!input.userPrompt) {
49065
- throw new KadoaSdkException("userPrompt is required when navigationMode is 'agentic-navigation'", {
49066
- code: "VALIDATION_ERROR",
49067
- details: { navigationMode: input.navigationMode }
49068
- });
49069
- }
49070
- const agenticRequest = {
49071
- urls: input.urls,
49072
- navigationMode: "agentic-navigation",
49073
- name: input.name ?? domainName,
49074
- description: input.description,
49075
- userPrompt: input.userPrompt,
49076
- schemaId: input.schemaId,
49077
- entity: input.entity,
49078
- fields: input.fields,
49079
- bypassPreview: input.bypassPreview ?? true,
49080
- tags: input.tags,
49081
- interval: input.interval,
49082
- monitoring: input.monitoring,
49083
- location: input.location,
49084
- autoStart: input.autoStart,
49085
- schedules: input.schedules,
49086
- additionalData: input.additionalData,
49087
- limit: input.limit
49088
- };
49089
- const response2 = await this.workflowsApi.v4WorkflowsPost({
49090
- createWorkflowBody: agenticRequest
49390
+ if (!input.userPrompt) {
49391
+ throw new KadoaSdkException("userPrompt is required to create a workflow", {
49392
+ code: "VALIDATION_ERROR",
49393
+ details: { urls: input.urls }
49091
49394
  });
49092
- const workflowId2 = response2.data?.workflowId;
49093
- if (!workflowId2) {
49094
- throw new KadoaSdkException(ERROR_MESSAGES.NO_WORKFLOW_ID, {
49095
- code: "INTERNAL_ERROR",
49096
- details: {
49097
- response: response2.data
49098
- }
49099
- });
49100
- }
49101
- return { id: workflowId2 };
49102
49395
  }
49396
+ const domainName = new URL(input.urls[0]).hostname;
49103
49397
  const request = {
49104
49398
  urls: input.urls,
49105
49399
  name: input.name ?? domainName,
49106
- schemaId: input.schemaId,
49107
49400
  description: input.description,
49108
- navigationMode: input.navigationMode,
49401
+ userPrompt: input.userPrompt,
49402
+ navigationMode: "agentic-navigation",
49403
+ schemaId: input.schemaId,
49109
49404
  ...input.entity != null && { entity: input.entity },
49110
49405
  fields: input.fields,
49111
49406
  bypassPreview: input.bypassPreview ?? true,
@@ -49113,13 +49408,12 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
49113
49408
  interval: input.interval,
49114
49409
  monitoring: input.monitoring,
49115
49410
  location: input.location,
49116
- autoStart: input.autoStart,
49117
49411
  schedules: input.schedules,
49118
49412
  additionalData: input.additionalData,
49119
49413
  limit: input.limit
49120
49414
  };
49121
49415
  const response = await this.workflowsApi.v4WorkflowsPost({
49122
- createWorkflowBody: request
49416
+ publicWorkflowCreateRequest: request
49123
49417
  });
49124
49418
  const workflowId = response.data?.workflowId;
49125
49419
  if (!workflowId) {
@@ -49148,6 +49442,14 @@ var import_debug, __require2, ChangeDifferenceType, KadoaErrorCode, _KadoaSdkExc
49148
49442
  });
49149
49443
  return response.data?.workflows?.[0];
49150
49444
  }
49445
+ async getAuditLog(id, options) {
49446
+ const response = await this.workflowsApi.v5WorkflowsWorkflowIdAuditlogGet({
49447
+ workflowId: id,
49448
+ page: options?.page,
49449
+ limit: options?.limit
49450
+ });
49451
+ return response.data;
49452
+ }
49151
49453
  async delete(id) {
49152
49454
  await this.workflowsApi.v4WorkflowsWorkflowIdDelete({
49153
49455
  workflowId: id
@@ -49855,7 +50157,7 @@ var init_dist2 = __esm(() => {
49855
50157
  return WorkflowsApiFp(this.configuration).v4WorkflowsGet(requestParameters.search, requestParameters.skip, requestParameters.limit, requestParameters.state, requestParameters.runState, requestParameters.displayState, requestParameters.inSupport, requestParameters.tags, requestParameters.userId, requestParameters.monitoring, requestParameters.updateInterval, requestParameters.includeDeleted, requestParameters.format, options).then((request) => request(this.axios, this.basePath));
49856
50158
  }
49857
50159
  v4WorkflowsPost(requestParameters = {}, options) {
49858
- return WorkflowsApiFp(this.configuration).v4WorkflowsPost(requestParameters.createWorkflowBody, options).then((request) => request(this.axios, this.basePath));
50160
+ return WorkflowsApiFp(this.configuration).v4WorkflowsPost(requestParameters.publicWorkflowCreateRequest, options).then((request) => request(this.axios, this.basePath));
49859
50161
  }
49860
50162
  v4WorkflowsWorkflowIdAuditlogGet(requestParameters, options) {
49861
50163
  return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdAuditlogGet(requestParameters.workflowId, requestParameters.xApiKey, requestParameters.authorization, requestParameters.page, requestParameters.limit, options).then((request) => request(this.axios, this.basePath));
@@ -49866,8 +50168,11 @@ var init_dist2 = __esm(() => {
49866
50168
  v4WorkflowsWorkflowIdComplianceRejectPut(requestParameters, options) {
49867
50169
  return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdComplianceRejectPut(requestParameters.workflowId, requestParameters.v4WorkflowsWorkflowIdComplianceRejectPutRequest, requestParameters.xApiKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
49868
50170
  }
50171
+ v4WorkflowsWorkflowIdDataExportsExportIdGet(requestParameters, options) {
50172
+ return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdDataExportsExportIdGet(requestParameters.workflowId, requestParameters.exportId, options).then((request) => request(this.axios, this.basePath));
50173
+ }
49869
50174
  v4WorkflowsWorkflowIdDataGet(requestParameters, options) {
49870
- return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdDataGet(requestParameters.workflowId, requestParameters.xApiKey, requestParameters.authorization, requestParameters.runId, requestParameters.format, requestParameters.sortBy, requestParameters.order, requestParameters.filters, requestParameters.page, requestParameters.limit, requestParameters.gzip, requestParameters.rowIds, requestParameters.includeAnomalies, options).then((request) => request(this.axios, this.basePath));
50175
+ return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdDataGet(requestParameters.workflowId, requestParameters.xApiKey, requestParameters.authorization, requestParameters.runId, requestParameters.format, requestParameters.sortBy, requestParameters.order, requestParameters.filters, requestParameters.page, requestParameters.limit, requestParameters.gzip, requestParameters.rowIds, requestParameters.includeAnomalies, requestParameters.download, options).then((request) => request(this.axios, this.basePath));
49871
50176
  }
49872
50177
  v4WorkflowsWorkflowIdDelete(requestParameters, options) {
49873
50178
  return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdDelete(requestParameters.workflowId, options).then((request) => request(this.axios, this.basePath));
@@ -49896,6 +50201,9 @@ var init_dist2 = __esm(() => {
49896
50201
  v4WorkflowsWorkflowIdSchedulePut(requestParameters, options) {
49897
50202
  return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdSchedulePut(requestParameters.workflowId, requestParameters.v4WorkflowsWorkflowIdSchedulePutRequest, options).then((request) => request(this.axios, this.basePath));
49898
50203
  }
50204
+ v4WorkflowsWorkflowIdStopPut(requestParameters, options) {
50205
+ return WorkflowsApiFp(this.configuration).v4WorkflowsWorkflowIdStopPut(requestParameters.workflowId, options).then((request) => request(this.axios, this.basePath));
50206
+ }
49899
50207
  v5ChangesChangeIdGet(requestParameters, options) {
49900
50208
  return WorkflowsApiFp(this.configuration).v5ChangesChangeIdGet(requestParameters.changeId, requestParameters.xApiKey, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
49901
50209
  }
@@ -50391,6 +50699,25 @@ function classifyError(error48, toolName) {
50391
50699
  }
50392
50700
  return "Unknown error";
50393
50701
  }
50702
+ function jsonEq(a, b) {
50703
+ return JSON.stringify(a) === JSON.stringify(b);
50704
+ }
50705
+ function diffWorkflowAuditEntry(entry) {
50706
+ const prev = entry.previousValue;
50707
+ const next = entry.newValue;
50708
+ if (!prev || !next)
50709
+ return [];
50710
+ const changed = [];
50711
+ for (const key of WORKFLOW_AUDIT_WATCHED_KEYS) {
50712
+ if (!jsonEq(prev[key], next[key]))
50713
+ changed.push(key);
50714
+ }
50715
+ const prevPrompt = prev["additionalData"]?.["userPrompt"];
50716
+ const nextPrompt = next["additionalData"]?.["userPrompt"];
50717
+ if (!jsonEq(prevPrompt, nextPrompt))
50718
+ changed.push("additionalData.userPrompt");
50719
+ return changed;
50720
+ }
50394
50721
  function registerTools(server, ctx) {
50395
50722
  function withErrorHandling(name, handler) {
50396
50723
  return async (...args) => {
@@ -50751,6 +51078,42 @@ function registerTools(server, ctx) {
50751
51078
  notificationConfig: workflow.notificationConfig
50752
51079
  });
50753
51080
  }));
51081
+ server.registerTool("get_workflow_history", {
51082
+ description: "Get the configuration revision history (audit log) for a workflow. Each entry captures who changed the workflow, when, from which channel (UI/API/SDK/MCP/CLI/SYSTEM), and a `changedFields` list summarizing what changed between revisions. Use this to answer questions like 'did this workflow's prompt or schema change, when, and from what to what?'. Note: CREATE entries return null `previousValue`/`newValue` and an empty `changedFields` (no initial-state snapshot is captured).",
51083
+ inputSchema: {
51084
+ workflowId: exports_external.string().describe("The workflow ID"),
51085
+ page: exports_external.preprocess(coerceNumber(), exports_external.number()).optional().describe("Page number, 1-based (default: 1)"),
51086
+ limit: exports_external.preprocess(coerceNumber(), exports_external.number()).optional().describe("Entries per page (default: 25)")
51087
+ },
51088
+ annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }
51089
+ }, withErrorHandling("get_workflow_history", async (args) => {
51090
+ const response = await ctx.client.workflow.getAuditLog(args.workflowId, {
51091
+ page: args.page,
51092
+ limit: args.limit
51093
+ });
51094
+ const entries = (response.logEntries ?? []).map((e) => ({
51095
+ id: e.id,
51096
+ operationType: e.operationType,
51097
+ createdAt: e.createdAt,
51098
+ userEmail: e.userEmail,
51099
+ userId: e.userId,
51100
+ requestSource: e.requestSource,
51101
+ authMethod: e.authMethod,
51102
+ changedFields: diffWorkflowAuditEntry({
51103
+ previousValue: e.previousValue,
51104
+ newValue: e.newValue
51105
+ }),
51106
+ previousValue: e.previousValue,
51107
+ newValue: e.newValue
51108
+ }));
51109
+ return jsonResult({
51110
+ workflowId: response.id,
51111
+ totalCount: response.pagination?.totalCount ?? response.logEntriesCount ?? entries.length,
51112
+ page: response.pagination?.page ?? 1,
51113
+ totalPages: response.pagination?.totalPages ?? 1,
51114
+ entries
51115
+ });
51116
+ }));
50754
51117
  server.registerTool("run_workflow", {
50755
51118
  description: "Run a workflow to extract fresh data. The run is asynchronous and may take several minutes. Do NOT poll or sleep-wait for completion. Return the workflow ID to the user and let them check status with get_workflow or fetch results later with fetch_data.",
50756
51119
  inputSchema: {
@@ -51479,7 +51842,7 @@ function registerTools(server, ctx) {
51479
51842
  return jsonResult({ schemas: schemas4, count: schemas4.length });
51480
51843
  }));
51481
51844
  }
51482
- var SchemaFieldShape, DASHBOARD_BASE_URL = "https://www.kadoa.com";
51845
+ var SchemaFieldShape, DASHBOARD_BASE_URL = "https://www.kadoa.com", WORKFLOW_AUDIT_WATCHED_KEYS;
51483
51846
  var init_tools = __esm(() => {
51484
51847
  init_zod();
51485
51848
  init_dist2();
@@ -51493,6 +51856,17 @@ var init_tools = __esm(() => {
51493
51856
  isRequired: exports_external.boolean().optional(),
51494
51857
  isUnique: exports_external.boolean().optional()
51495
51858
  };
51859
+ WORKFLOW_AUDIT_WATCHED_KEYS = [
51860
+ "name",
51861
+ "tags",
51862
+ "urls",
51863
+ "schedules",
51864
+ "entity",
51865
+ "schema",
51866
+ "monitoringConfig",
51867
+ "location",
51868
+ "navigationMode"
51869
+ ];
51496
51870
  });
51497
51871
 
51498
51872
  // package.json
@@ -51500,7 +51874,7 @@ var package_default;
51500
51874
  var init_package = __esm(() => {
51501
51875
  package_default = {
51502
51876
  name: "@kadoa/mcp",
51503
- version: "0.5.2",
51877
+ version: "0.5.3-rc.2",
51504
51878
  description: "Kadoa MCP Server — manage workflows from Claude Desktop, Cursor, and other MCP clients",
51505
51879
  type: "module",
51506
51880
  main: "dist/index.js",
@@ -51524,7 +51898,7 @@ var init_package = __esm(() => {
51524
51898
  prepublishOnly: "bun run check-types && bun run test:unit && bun run build"
51525
51899
  },
51526
51900
  dependencies: {
51527
- "@kadoa/node-sdk": "^0.29.1",
51901
+ "@kadoa/node-sdk": "^0.31.1",
51528
51902
  "@modelcontextprotocol/sdk": "^1.26.0",
51529
51903
  express: "^5.2.1",
51530
51904
  ioredis: "^5.6.1",