@ivotoby/openapi-mcp-server 1.12.3 → 1.12.5

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/dist/bundle.js +630 -417
  2. package/dist/cli.js +630 -417
  3. package/package.json +20 -7
package/dist/cli.js CHANGED
@@ -14726,7 +14726,7 @@ var OpenAPISpecLoader = class {
14726
14726
  const name = this.abbreviateOperationId(nameSource);
14727
14727
  const tool = {
14728
14728
  name,
14729
- description: op.description || `Make a ${method.toUpperCase()} request to ${path2}`,
14729
+ description: op.description || op.summary || `Make a ${method.toUpperCase()} request to ${path2}`,
14730
14730
  inputSchema: {
14731
14731
  type: "object",
14732
14732
  properties: {}
@@ -14834,11 +14834,14 @@ var OpenAPISpecLoader = class {
14834
14834
  continue;
14835
14835
  }
14836
14836
  let mediaTypeObj;
14837
+ let selectedContentType;
14837
14838
  if (requestBodyObj.content["application/json"]) {
14838
14839
  mediaTypeObj = requestBodyObj.content["application/json"];
14840
+ selectedContentType = "application/json";
14839
14841
  } else if (Object.keys(requestBodyObj.content).length > 0) {
14840
14842
  const firstContentType = Object.keys(requestBodyObj.content)[0];
14841
14843
  mediaTypeObj = requestBodyObj.content[firstContentType];
14844
+ selectedContentType = firstContentType;
14842
14845
  }
14843
14846
  if (mediaTypeObj?.schema) {
14844
14847
  const inlinedSchema = this.inlineSchema(
@@ -14876,6 +14879,10 @@ var OpenAPISpecLoader = class {
14876
14879
  requiredParams.push("body");
14877
14880
  }
14878
14881
  }
14882
+ if (selectedContentType) {
14883
+ ;
14884
+ tool.inputSchema["x-content-type"] = selectedContentType;
14885
+ }
14879
14886
  }
14880
14887
  if (requiredParams.length > 0) {
14881
14888
  tool.inputSchema.required = requiredParams;
@@ -15251,8 +15258,8 @@ var isPlainObject = (val) => {
15251
15258
  if (kindOf(val) !== "object") {
15252
15259
  return false;
15253
15260
  }
15254
- const prototype3 = getPrototypeOf(val);
15255
- return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(toStringTag in val) && !(iterator in val);
15261
+ const prototype2 = getPrototypeOf(val);
15262
+ return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
15256
15263
  };
15257
15264
  var isEmptyObject = (val) => {
15258
15265
  if (!isObject2(val) || isBuffer(val)) {
@@ -15266,17 +15273,37 @@ var isEmptyObject = (val) => {
15266
15273
  };
15267
15274
  var isDate = kindOfTest("Date");
15268
15275
  var isFile = kindOfTest("File");
15276
+ var isReactNativeBlob = (value) => {
15277
+ return !!(value && typeof value.uri !== "undefined");
15278
+ };
15279
+ var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
15269
15280
  var isBlob = kindOfTest("Blob");
15270
15281
  var isFileList = kindOfTest("FileList");
15271
15282
  var isStream = (val) => isObject2(val) && isFunction(val.pipe);
15283
+ function getGlobal() {
15284
+ if (typeof globalThis !== "undefined") return globalThis;
15285
+ if (typeof self !== "undefined") return self;
15286
+ if (typeof window !== "undefined") return window;
15287
+ if (typeof global !== "undefined") return global;
15288
+ return {};
15289
+ }
15290
+ var G = getGlobal();
15291
+ var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0;
15272
15292
  var isFormData = (thing) => {
15273
15293
  let kind;
15274
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
15294
+ return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
15275
15295
  kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
15276
15296
  };
15277
15297
  var isURLSearchParams = kindOfTest("URLSearchParams");
15278
- var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
15279
- var trim = (str2) => str2.trim ? str2.trim() : str2.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
15298
+ var [isReadableStream, isRequest, isResponse, isHeaders] = [
15299
+ "ReadableStream",
15300
+ "Request",
15301
+ "Response",
15302
+ "Headers"
15303
+ ].map(kindOfTest);
15304
+ var trim = (str2) => {
15305
+ return str2.trim ? str2.trim() : str2.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
15306
+ };
15280
15307
  function forEach(obj, fn, { allOwnKeys = false } = {}) {
15281
15308
  if (obj === null || typeof obj === "undefined") {
15282
15309
  return;
@@ -15328,6 +15355,9 @@ function merge2() {
15328
15355
  const { caseless, skipUndefined } = isContextDefined(this) && this || {};
15329
15356
  const result = {};
15330
15357
  const assignValue = (val, key) => {
15358
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
15359
+ return;
15360
+ }
15331
15361
  const targetKey = caseless && findKey(result, key) || key;
15332
15362
  if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
15333
15363
  result[targetKey] = merge2(result[targetKey], val);
@@ -15345,13 +15375,27 @@ function merge2() {
15345
15375
  return result;
15346
15376
  }
15347
15377
  var extend3 = (a, b, thisArg, { allOwnKeys } = {}) => {
15348
- forEach(b, (val, key) => {
15349
- if (thisArg && isFunction(val)) {
15350
- a[key] = bind(val, thisArg);
15351
- } else {
15352
- a[key] = val;
15353
- }
15354
- }, { allOwnKeys });
15378
+ forEach(
15379
+ b,
15380
+ (val, key) => {
15381
+ if (thisArg && isFunction(val)) {
15382
+ Object.defineProperty(a, key, {
15383
+ value: bind(val, thisArg),
15384
+ writable: true,
15385
+ enumerable: true,
15386
+ configurable: true
15387
+ });
15388
+ } else {
15389
+ Object.defineProperty(a, key, {
15390
+ value: val,
15391
+ writable: true,
15392
+ enumerable: true,
15393
+ configurable: true
15394
+ });
15395
+ }
15396
+ },
15397
+ { allOwnKeys }
15398
+ );
15355
15399
  return a;
15356
15400
  };
15357
15401
  var stripBOM = (content) => {
@@ -15360,9 +15404,14 @@ var stripBOM = (content) => {
15360
15404
  }
15361
15405
  return content;
15362
15406
  };
15363
- var inherits = (constructor, superConstructor, props, descriptors2) => {
15364
- constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
15365
- constructor.prototype.constructor = constructor;
15407
+ var inherits = (constructor, superConstructor, props, descriptors) => {
15408
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
15409
+ Object.defineProperty(constructor.prototype, "constructor", {
15410
+ value: constructor,
15411
+ writable: true,
15412
+ enumerable: false,
15413
+ configurable: true
15414
+ });
15366
15415
  Object.defineProperty(constructor, "super", {
15367
15416
  value: superConstructor.prototype
15368
15417
  });
@@ -15433,19 +15482,16 @@ var matchAll = (regExp, str2) => {
15433
15482
  };
15434
15483
  var isHTMLForm = kindOfTest("HTMLFormElement");
15435
15484
  var toCamelCase = (str2) => {
15436
- return str2.toLowerCase().replace(
15437
- /[-_\s]([a-z\d])(\w*)/g,
15438
- function replacer(m, p1, p2) {
15439
- return p1.toUpperCase() + p2;
15440
- }
15441
- );
15485
+ return str2.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
15486
+ return p1.toUpperCase() + p2;
15487
+ });
15442
15488
  };
15443
15489
  var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
15444
15490
  var isRegExp = kindOfTest("RegExp");
15445
15491
  var reduceDescriptors = (obj, reducer) => {
15446
- const descriptors2 = Object.getOwnPropertyDescriptors(obj);
15492
+ const descriptors = Object.getOwnPropertyDescriptors(obj);
15447
15493
  const reducedDescriptors = {};
15448
- forEach(descriptors2, (descriptor, name) => {
15494
+ forEach(descriptors, (descriptor, name) => {
15449
15495
  let ret;
15450
15496
  if ((ret = reducer(descriptor, name, obj)) !== false) {
15451
15497
  reducedDescriptors[name] = ret || descriptor;
@@ -15522,20 +15568,21 @@ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
15522
15568
  return setImmediate;
15523
15569
  }
15524
15570
  return postMessageSupported ? ((token, callbacks) => {
15525
- _global.addEventListener("message", ({ source, data }) => {
15526
- if (source === _global && data === token) {
15527
- callbacks.length && callbacks.shift()();
15528
- }
15529
- }, false);
15571
+ _global.addEventListener(
15572
+ "message",
15573
+ ({ source, data }) => {
15574
+ if (source === _global && data === token) {
15575
+ callbacks.length && callbacks.shift()();
15576
+ }
15577
+ },
15578
+ false
15579
+ );
15530
15580
  return (cb) => {
15531
15581
  callbacks.push(cb);
15532
15582
  _global.postMessage(token, "*");
15533
15583
  };
15534
15584
  })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
15535
- })(
15536
- typeof setImmediate === "function",
15537
- isFunction(_global.postMessage)
15538
- );
15585
+ })(typeof setImmediate === "function", isFunction(_global.postMessage));
15539
15586
  var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
15540
15587
  var isIterable = (thing) => thing != null && isFunction(thing[iterator]);
15541
15588
  var utils_default = {
@@ -15557,6 +15604,8 @@ var utils_default = {
15557
15604
  isUndefined,
15558
15605
  isDate,
15559
15606
  isFile,
15607
+ isReactNativeBlob,
15608
+ isReactNative,
15560
15609
  isBlob,
15561
15610
  isRegExp,
15562
15611
  isFunction,
@@ -15600,25 +15649,47 @@ var utils_default = {
15600
15649
  };
15601
15650
 
15602
15651
  // node_modules/axios/lib/core/AxiosError.js
15603
- function AxiosError(message, code, config, request, response) {
15604
- Error.call(this);
15605
- if (Error.captureStackTrace) {
15606
- Error.captureStackTrace(this, this.constructor);
15607
- } else {
15608
- this.stack = new Error().stack;
15652
+ var AxiosError = class _AxiosError extends Error {
15653
+ static from(error, code, config, request, response, customProps) {
15654
+ const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
15655
+ axiosError.cause = error;
15656
+ axiosError.name = error.name;
15657
+ if (error.status != null && axiosError.status == null) {
15658
+ axiosError.status = error.status;
15659
+ }
15660
+ customProps && Object.assign(axiosError, customProps);
15661
+ return axiosError;
15609
15662
  }
15610
- this.message = message;
15611
- this.name = "AxiosError";
15612
- code && (this.code = code);
15613
- config && (this.config = config);
15614
- request && (this.request = request);
15615
- if (response) {
15616
- this.response = response;
15617
- this.status = response.status ? response.status : null;
15663
+ /**
15664
+ * Create an Error with the specified message, config, error code, request and response.
15665
+ *
15666
+ * @param {string} message The error message.
15667
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
15668
+ * @param {Object} [config] The config.
15669
+ * @param {Object} [request] The request.
15670
+ * @param {Object} [response] The response.
15671
+ *
15672
+ * @returns {Error} The created error.
15673
+ */
15674
+ constructor(message, code, config, request, response) {
15675
+ super(message);
15676
+ Object.defineProperty(this, "message", {
15677
+ value: message,
15678
+ enumerable: true,
15679
+ writable: true,
15680
+ configurable: true
15681
+ });
15682
+ this.name = "AxiosError";
15683
+ this.isAxiosError = true;
15684
+ code && (this.code = code);
15685
+ config && (this.config = config);
15686
+ request && (this.request = request);
15687
+ if (response) {
15688
+ this.response = response;
15689
+ this.status = response.status;
15690
+ }
15618
15691
  }
15619
- }
15620
- utils_default.inherits(AxiosError, Error, {
15621
- toJSON: function toJSON() {
15692
+ toJSON() {
15622
15693
  return {
15623
15694
  // Standard
15624
15695
  message: this.message,
@@ -15637,45 +15708,19 @@ utils_default.inherits(AxiosError, Error, {
15637
15708
  status: this.status
15638
15709
  };
15639
15710
  }
15640
- });
15641
- var prototype = AxiosError.prototype;
15642
- var descriptors = {};
15643
- [
15644
- "ERR_BAD_OPTION_VALUE",
15645
- "ERR_BAD_OPTION",
15646
- "ECONNABORTED",
15647
- "ETIMEDOUT",
15648
- "ERR_NETWORK",
15649
- "ERR_FR_TOO_MANY_REDIRECTS",
15650
- "ERR_DEPRECATED",
15651
- "ERR_BAD_RESPONSE",
15652
- "ERR_BAD_REQUEST",
15653
- "ERR_CANCELED",
15654
- "ERR_NOT_SUPPORT",
15655
- "ERR_INVALID_URL"
15656
- // eslint-disable-next-line func-names
15657
- ].forEach((code) => {
15658
- descriptors[code] = { value: code };
15659
- });
15660
- Object.defineProperties(AxiosError, descriptors);
15661
- Object.defineProperty(prototype, "isAxiosError", { value: true });
15662
- AxiosError.from = (error, code, config, request, response, customProps) => {
15663
- const axiosError = Object.create(prototype);
15664
- utils_default.toFlatObject(error, axiosError, function filter2(obj) {
15665
- return obj !== Error.prototype;
15666
- }, (prop) => {
15667
- return prop !== "isAxiosError";
15668
- });
15669
- const msg = error && error.message ? error.message : "Error";
15670
- const errCode = code == null && error ? error.code : code;
15671
- AxiosError.call(axiosError, msg, errCode, config, request, response);
15672
- if (error && axiosError.cause == null) {
15673
- Object.defineProperty(axiosError, "cause", { value: error, configurable: true });
15674
- }
15675
- axiosError.name = error && error.name || "Error";
15676
- customProps && Object.assign(axiosError, customProps);
15677
- return axiosError;
15678
15711
  };
15712
+ AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
15713
+ AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION";
15714
+ AxiosError.ECONNABORTED = "ECONNABORTED";
15715
+ AxiosError.ETIMEDOUT = "ETIMEDOUT";
15716
+ AxiosError.ERR_NETWORK = "ERR_NETWORK";
15717
+ AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
15718
+ AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED";
15719
+ AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
15720
+ AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
15721
+ AxiosError.ERR_CANCELED = "ERR_CANCELED";
15722
+ AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
15723
+ AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
15679
15724
  var AxiosError_default = AxiosError;
15680
15725
 
15681
15726
  // node_modules/axios/lib/platform/node/classes/FormData.js
@@ -15707,13 +15752,18 @@ function toFormData(obj, formData, options) {
15707
15752
  throw new TypeError("target must be an object");
15708
15753
  }
15709
15754
  formData = formData || new (FormData_default || FormData)();
15710
- options = utils_default.toFlatObject(options, {
15711
- metaTokens: true,
15712
- dots: false,
15713
- indexes: false
15714
- }, false, function defined(option, source) {
15715
- return !utils_default.isUndefined(source[option]);
15716
- });
15755
+ options = utils_default.toFlatObject(
15756
+ options,
15757
+ {
15758
+ metaTokens: true,
15759
+ dots: false,
15760
+ indexes: false
15761
+ },
15762
+ false,
15763
+ function defined(option, source) {
15764
+ return !utils_default.isUndefined(source[option]);
15765
+ }
15766
+ );
15717
15767
  const metaTokens = options.metaTokens;
15718
15768
  const visitor = options.visitor || defaultVisitor;
15719
15769
  const dots = options.dots;
@@ -15741,6 +15791,10 @@ function toFormData(obj, formData, options) {
15741
15791
  }
15742
15792
  function defaultVisitor(value, key, path2) {
15743
15793
  let arr = value;
15794
+ if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
15795
+ formData.append(renderKey(path2, key, dots), convertValue(value));
15796
+ return false;
15797
+ }
15744
15798
  if (value && !path2 && typeof value === "object") {
15745
15799
  if (utils_default.endsWith(key, "{}")) {
15746
15800
  key = metaTokens ? key : key.slice(0, -2);
@@ -15776,13 +15830,7 @@ function toFormData(obj, formData, options) {
15776
15830
  }
15777
15831
  stack.push(value);
15778
15832
  utils_default.forEach(value, function each(el, key) {
15779
- const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
15780
- formData,
15781
- el,
15782
- utils_default.isString(key) ? key.trim() : key,
15783
- path2,
15784
- exposedHelpers
15785
- );
15833
+ const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path2, exposedHelpers);
15786
15834
  if (result === true) {
15787
15835
  build(el, path2 ? path2.concat(key) : [key]);
15788
15836
  }
@@ -15816,11 +15864,11 @@ function AxiosURLSearchParams(params, options) {
15816
15864
  this._pairs = [];
15817
15865
  params && toFormData_default(params, this, options);
15818
15866
  }
15819
- var prototype2 = AxiosURLSearchParams.prototype;
15820
- prototype2.append = function append(name, value) {
15867
+ var prototype = AxiosURLSearchParams.prototype;
15868
+ prototype.append = function append(name, value) {
15821
15869
  this._pairs.push([name, value]);
15822
15870
  };
15823
- prototype2.toString = function toString3(encoder) {
15871
+ prototype.toString = function toString3(encoder) {
15824
15872
  const _encode = encoder ? function(value) {
15825
15873
  return encoder.call(this, value, encode);
15826
15874
  } : encode;
@@ -15839,17 +15887,15 @@ function buildURL(url2, params, options) {
15839
15887
  return url2;
15840
15888
  }
15841
15889
  const _encode = options && options.encode || encode2;
15842
- if (utils_default.isFunction(options)) {
15843
- options = {
15844
- serialize: options
15845
- };
15846
- }
15847
- const serializeFn = options && options.serialize;
15890
+ const _options = utils_default.isFunction(options) ? {
15891
+ serialize: options
15892
+ } : options;
15893
+ const serializeFn = _options && _options.serialize;
15848
15894
  let serializedParams;
15849
15895
  if (serializeFn) {
15850
- serializedParams = serializeFn(params, options);
15896
+ serializedParams = serializeFn(params, _options);
15851
15897
  } else {
15852
- serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode);
15898
+ serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, _options).toString(_encode);
15853
15899
  }
15854
15900
  if (serializedParams) {
15855
15901
  const hashmarkIndex = url2.indexOf("#");
@@ -15871,6 +15917,7 @@ var InterceptorManager = class {
15871
15917
  *
15872
15918
  * @param {Function} fulfilled The function to handle `then` for a `Promise`
15873
15919
  * @param {Function} rejected The function to handle `reject` for a `Promise`
15920
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
15874
15921
  *
15875
15922
  * @return {Number} An ID used to remove interceptor later
15876
15923
  */
@@ -15929,7 +15976,8 @@ var InterceptorManager_default = InterceptorManager;
15929
15976
  var transitional_default = {
15930
15977
  silentJSONParsing: true,
15931
15978
  forcedJSONParsing: true,
15932
- clarifyTimeoutError: false
15979
+ clarifyTimeoutError: false,
15980
+ legacyInterceptorReqResOrdering: true
15933
15981
  };
15934
15982
 
15935
15983
  // node_modules/axios/lib/platform/node/index.js
@@ -16077,70 +16125,74 @@ function stringifySafely(rawValue, parser2, encoder) {
16077
16125
  var defaults = {
16078
16126
  transitional: transitional_default,
16079
16127
  adapter: ["xhr", "http", "fetch"],
16080
- transformRequest: [function transformRequest(data, headers) {
16081
- const contentType = headers.getContentType() || "";
16082
- const hasJSONContentType = contentType.indexOf("application/json") > -1;
16083
- const isObjectPayload = utils_default.isObject(data);
16084
- if (isObjectPayload && utils_default.isHTMLForm(data)) {
16085
- data = new FormData(data);
16086
- }
16087
- const isFormData2 = utils_default.isFormData(data);
16088
- if (isFormData2) {
16089
- return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
16090
- }
16091
- if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
16092
- return data;
16093
- }
16094
- if (utils_default.isArrayBufferView(data)) {
16095
- return data.buffer;
16096
- }
16097
- if (utils_default.isURLSearchParams(data)) {
16098
- headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
16099
- return data.toString();
16100
- }
16101
- let isFileList2;
16102
- if (isObjectPayload) {
16103
- if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
16104
- return toURLEncodedForm(data, this.formSerializer).toString();
16128
+ transformRequest: [
16129
+ function transformRequest(data, headers) {
16130
+ const contentType = headers.getContentType() || "";
16131
+ const hasJSONContentType = contentType.indexOf("application/json") > -1;
16132
+ const isObjectPayload = utils_default.isObject(data);
16133
+ if (isObjectPayload && utils_default.isHTMLForm(data)) {
16134
+ data = new FormData(data);
16135
+ }
16136
+ const isFormData2 = utils_default.isFormData(data);
16137
+ if (isFormData2) {
16138
+ return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
16139
+ }
16140
+ if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
16141
+ return data;
16142
+ }
16143
+ if (utils_default.isArrayBufferView(data)) {
16144
+ return data.buffer;
16145
+ }
16146
+ if (utils_default.isURLSearchParams(data)) {
16147
+ headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
16148
+ return data.toString();
16149
+ }
16150
+ let isFileList2;
16151
+ if (isObjectPayload) {
16152
+ if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
16153
+ return toURLEncodedForm(data, this.formSerializer).toString();
16154
+ }
16155
+ if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
16156
+ const _FormData = this.env && this.env.FormData;
16157
+ return toFormData_default(
16158
+ isFileList2 ? { "files[]": data } : data,
16159
+ _FormData && new _FormData(),
16160
+ this.formSerializer
16161
+ );
16162
+ }
16105
16163
  }
16106
- if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
16107
- const _FormData = this.env && this.env.FormData;
16108
- return toFormData_default(
16109
- isFileList2 ? { "files[]": data } : data,
16110
- _FormData && new _FormData(),
16111
- this.formSerializer
16112
- );
16164
+ if (isObjectPayload || hasJSONContentType) {
16165
+ headers.setContentType("application/json", false);
16166
+ return stringifySafely(data);
16113
16167
  }
16114
- }
16115
- if (isObjectPayload || hasJSONContentType) {
16116
- headers.setContentType("application/json", false);
16117
- return stringifySafely(data);
16118
- }
16119
- return data;
16120
- }],
16121
- transformResponse: [function transformResponse(data) {
16122
- const transitional2 = this.transitional || defaults.transitional;
16123
- const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
16124
- const JSONRequested = this.responseType === "json";
16125
- if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
16126
16168
  return data;
16127
16169
  }
16128
- if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
16129
- const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
16130
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
16131
- try {
16132
- return JSON.parse(data, this.parseReviver);
16133
- } catch (e) {
16134
- if (strictJSONParsing) {
16135
- if (e.name === "SyntaxError") {
16136
- throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
16170
+ ],
16171
+ transformResponse: [
16172
+ function transformResponse(data) {
16173
+ const transitional2 = this.transitional || defaults.transitional;
16174
+ const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
16175
+ const JSONRequested = this.responseType === "json";
16176
+ if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
16177
+ return data;
16178
+ }
16179
+ if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
16180
+ const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
16181
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
16182
+ try {
16183
+ return JSON.parse(data, this.parseReviver);
16184
+ } catch (e) {
16185
+ if (strictJSONParsing) {
16186
+ if (e.name === "SyntaxError") {
16187
+ throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
16188
+ }
16189
+ throw e;
16137
16190
  }
16138
- throw e;
16139
16191
  }
16140
16192
  }
16193
+ return data;
16141
16194
  }
16142
- return data;
16143
- }],
16195
+ ],
16144
16196
  /**
16145
16197
  * A timeout in milliseconds to abort a request. If set to 0 (default) a
16146
16198
  * timeout is not created.
@@ -16159,7 +16211,7 @@ var defaults = {
16159
16211
  },
16160
16212
  headers: {
16161
16213
  common: {
16162
- "Accept": "application/json, text/plain, */*",
16214
+ Accept: "application/json, text/plain, */*",
16163
16215
  "Content-Type": void 0
16164
16216
  }
16165
16217
  }
@@ -16418,11 +16470,11 @@ var AxiosHeaders = class {
16418
16470
  accessors: {}
16419
16471
  };
16420
16472
  const accessors = internals.accessors;
16421
- const prototype3 = this.prototype;
16473
+ const prototype2 = this.prototype;
16422
16474
  function defineAccessor(_header) {
16423
16475
  const lHeader = normalizeHeader(_header);
16424
16476
  if (!accessors[lHeader]) {
16425
- buildAccessors(prototype3, _header);
16477
+ buildAccessors(prototype2, _header);
16426
16478
  accessors[lHeader] = true;
16427
16479
  }
16428
16480
  }
@@ -16430,7 +16482,14 @@ var AxiosHeaders = class {
16430
16482
  return this;
16431
16483
  }
16432
16484
  };
16433
- AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
16485
+ AxiosHeaders.accessor([
16486
+ "Content-Type",
16487
+ "Content-Length",
16488
+ "Accept",
16489
+ "Accept-Encoding",
16490
+ "User-Agent",
16491
+ "Authorization"
16492
+ ]);
16434
16493
  utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
16435
16494
  let mapped = key[0].toUpperCase() + key.slice(1);
16436
16495
  return {
@@ -16462,13 +16521,22 @@ function isCancel(value) {
16462
16521
  }
16463
16522
 
16464
16523
  // node_modules/axios/lib/cancel/CanceledError.js
16465
- function CanceledError(message, config, request) {
16466
- AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
16467
- this.name = "CanceledError";
16468
- }
16469
- utils_default.inherits(CanceledError, AxiosError_default, {
16470
- __CANCEL__: true
16471
- });
16524
+ var CanceledError = class extends AxiosError_default {
16525
+ /**
16526
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
16527
+ *
16528
+ * @param {string=} message The message.
16529
+ * @param {Object=} config The config.
16530
+ * @param {Object=} request The request.
16531
+ *
16532
+ * @returns {CanceledError} The created error.
16533
+ */
16534
+ constructor(message, config, request) {
16535
+ super(message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
16536
+ this.name = "CanceledError";
16537
+ this.__CANCEL__ = true;
16538
+ }
16539
+ };
16472
16540
  var CanceledError_default = CanceledError;
16473
16541
 
16474
16542
  // node_modules/axios/lib/core/settle.js
@@ -16477,18 +16545,23 @@ function settle(resolve6, reject, response) {
16477
16545
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
16478
16546
  resolve6(response);
16479
16547
  } else {
16480
- reject(new AxiosError_default(
16481
- "Request failed with status code " + response.status,
16482
- [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
16483
- response.config,
16484
- response.request,
16485
- response
16486
- ));
16548
+ reject(
16549
+ new AxiosError_default(
16550
+ "Request failed with status code " + response.status,
16551
+ [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
16552
+ response.config,
16553
+ response.request,
16554
+ response
16555
+ )
16556
+ );
16487
16557
  }
16488
16558
  }
16489
16559
 
16490
16560
  // node_modules/axios/lib/helpers/isAbsoluteURL.js
16491
16561
  function isAbsoluteURL(url2) {
16562
+ if (typeof url2 !== "string") {
16563
+ return false;
16564
+ }
16492
16565
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
16493
16566
  }
16494
16567
 
@@ -16516,7 +16589,7 @@ import util2 from "util";
16516
16589
  import zlib from "zlib";
16517
16590
 
16518
16591
  // node_modules/axios/lib/env/data.js
16519
- var VERSION = "1.13.2";
16592
+ var VERSION = "1.13.6";
16520
16593
 
16521
16594
  // node_modules/axios/lib/helpers/parseProtocol.js
16522
16595
  function parseProtocol(url2) {
@@ -16561,16 +16634,21 @@ import stream from "stream";
16561
16634
  var kInternals = Symbol("internals");
16562
16635
  var AxiosTransformStream = class extends stream.Transform {
16563
16636
  constructor(options) {
16564
- options = utils_default.toFlatObject(options, {
16565
- maxRate: 0,
16566
- chunkSize: 64 * 1024,
16567
- minChunkSize: 100,
16568
- timeWindow: 500,
16569
- ticksRate: 2,
16570
- samplesCount: 15
16571
- }, null, (prop, source) => {
16572
- return !utils_default.isUndefined(source[prop]);
16573
- });
16637
+ options = utils_default.toFlatObject(
16638
+ options,
16639
+ {
16640
+ maxRate: 0,
16641
+ chunkSize: 64 * 1024,
16642
+ minChunkSize: 100,
16643
+ timeWindow: 500,
16644
+ ticksRate: 2,
16645
+ samplesCount: 15
16646
+ },
16647
+ null,
16648
+ (prop, source) => {
16649
+ return !utils_default.isUndefined(source[prop]);
16650
+ }
16651
+ );
16574
16652
  super({
16575
16653
  readableHighWaterMark: options.chunkSize
16576
16654
  });
@@ -16653,9 +16731,12 @@ var AxiosTransformStream = class extends stream.Transform {
16653
16731
  chunkRemainder = _chunk.subarray(maxChunkSize);
16654
16732
  _chunk = _chunk.subarray(0, maxChunkSize);
16655
16733
  }
16656
- pushChunk(_chunk, chunkRemainder ? () => {
16657
- process.nextTick(_callback, null, chunkRemainder);
16658
- } : _callback);
16734
+ pushChunk(
16735
+ _chunk,
16736
+ chunkRemainder ? () => {
16737
+ process.nextTick(_callback, null, chunkRemainder);
16738
+ } : _callback
16739
+ );
16659
16740
  };
16660
16741
  transformChunk(chunk, function transformNextChunk(err, _chunk) {
16661
16742
  if (err) {
@@ -16726,11 +16807,14 @@ var FormDataPart = class {
16726
16807
  yield CRLF_BYTES;
16727
16808
  }
16728
16809
  static escapeName(name) {
16729
- return String(name).replace(/[\r\n"]/g, (match) => ({
16730
- "\r": "%0D",
16731
- "\n": "%0A",
16732
- '"': "%22"
16733
- })[match]);
16810
+ return String(name).replace(
16811
+ /[\r\n"]/g,
16812
+ (match) => ({
16813
+ "\r": "%0D",
16814
+ "\n": "%0A",
16815
+ '"': "%22"
16816
+ })[match]
16817
+ );
16734
16818
  }
16735
16819
  };
16736
16820
  var formDataToStream = (form, headersHandler, options) => {
@@ -16762,13 +16846,15 @@ var formDataToStream = (form, headersHandler, options) => {
16762
16846
  computedHeaders["Content-Length"] = contentLength;
16763
16847
  }
16764
16848
  headersHandler && headersHandler(computedHeaders);
16765
- return Readable.from(async function* () {
16766
- for (const part of parts) {
16767
- yield boundaryBytes;
16768
- yield* part.encode();
16769
- }
16770
- yield footerBytes;
16771
- }());
16849
+ return Readable.from(
16850
+ async function* () {
16851
+ for (const part of parts) {
16852
+ yield boundaryBytes;
16853
+ yield* part.encode();
16854
+ }
16855
+ yield footerBytes;
16856
+ }()
16857
+ );
16772
16858
  };
16773
16859
  var formDataToStream_default = formDataToStream;
16774
16860
 
@@ -16907,11 +16993,14 @@ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
16907
16993
  };
16908
16994
  var progressEventDecorator = (total, throttled) => {
16909
16995
  const lengthComputable = total != null;
16910
- return [(loaded) => throttled[0]({
16911
- lengthComputable,
16912
- total,
16913
- loaded
16914
- }), throttled[1]];
16996
+ return [
16997
+ (loaded) => throttled[0]({
16998
+ lengthComputable,
16999
+ total,
17000
+ loaded
17001
+ }),
17002
+ throttled[1]
17003
+ ];
16915
17004
  };
16916
17005
  var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
16917
17006
 
@@ -16990,9 +17079,12 @@ var Http2Sessions = class {
16990
17079
  this.sessions = /* @__PURE__ */ Object.create(null);
16991
17080
  }
16992
17081
  getSession(authority, options) {
16993
- options = Object.assign({
16994
- sessionTimeout: 1e3
16995
- }, options);
17082
+ options = Object.assign(
17083
+ {
17084
+ sessionTimeout: 1e3
17085
+ },
17086
+ options
17087
+ );
16996
17088
  let authoritySessions = this.sessions[authority];
16997
17089
  if (authoritySessions) {
16998
17090
  let len = authoritySessions.length;
@@ -17046,10 +17138,7 @@ var Http2Sessions = class {
17046
17138
  };
17047
17139
  }
17048
17140
  session.once("close", removeSession);
17049
- let entry = [
17050
- session,
17051
- options
17052
- ];
17141
+ let entry = [session, options];
17053
17142
  authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
17054
17143
  return session;
17055
17144
  }
@@ -17076,8 +17165,11 @@ function setProxy(options, configProxy, location) {
17076
17165
  proxy.auth = (proxy.username || "") + ":" + (proxy.password || "");
17077
17166
  }
17078
17167
  if (proxy.auth) {
17079
- if (proxy.auth.username || proxy.auth.password) {
17168
+ const validProxyAuth = Boolean(proxy.auth.username || proxy.auth.password);
17169
+ if (validProxyAuth) {
17080
17170
  proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
17171
+ } else if (typeof proxy.auth === "object") {
17172
+ throw new AxiosError_default("Invalid proxy authorization", AxiosError_default.ERR_BAD_OPTION, { proxy });
17081
17173
  }
17082
17174
  const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
17083
17175
  options.headers["Proxy-Authorization"] = "Basic " + base64;
@@ -17129,15 +17221,10 @@ var resolveFamily = ({ address, family }) => {
17129
17221
  var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
17130
17222
  var http2Transport = {
17131
17223
  request(options, cb) {
17132
- const authority = options.protocol + "//" + options.hostname + ":" + (options.port || 80);
17224
+ const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
17133
17225
  const { http2Options, headers } = options;
17134
17226
  const session = http2Sessions.getSession(authority, http2Options);
17135
- const {
17136
- HTTP2_HEADER_SCHEME,
17137
- HTTP2_HEADER_METHOD,
17138
- HTTP2_HEADER_PATH,
17139
- HTTP2_HEADER_STATUS
17140
- } = http2.constants;
17227
+ const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } = http2.constants;
17141
17228
  const http2Headers = {
17142
17229
  [HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
17143
17230
  [HTTP2_HEADER_METHOD]: options.method,
@@ -17190,7 +17277,10 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17190
17277
  const abortEmitter = new EventEmitter();
17191
17278
  function abort(reason) {
17192
17279
  try {
17193
- abortEmitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config, req) : reason);
17280
+ abortEmitter.emit(
17281
+ "abort",
17282
+ !reason || reason.type ? new CanceledError_default(null, config, req) : reason
17283
+ );
17194
17284
  } catch (err) {
17195
17285
  console.warn("emit error", err);
17196
17286
  }
@@ -17236,11 +17326,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17236
17326
  const dataUrl = String(config.url || fullPath || "");
17237
17327
  const estimated = estimateDataURLDecodedBytes(dataUrl);
17238
17328
  if (estimated > config.maxContentLength) {
17239
- return reject(new AxiosError_default(
17240
- "maxContentLength size of " + config.maxContentLength + " exceeded",
17241
- AxiosError_default.ERR_BAD_RESPONSE,
17242
- config
17243
- ));
17329
+ return reject(
17330
+ new AxiosError_default(
17331
+ "maxContentLength size of " + config.maxContentLength + " exceeded",
17332
+ AxiosError_default.ERR_BAD_RESPONSE,
17333
+ config
17334
+ )
17335
+ );
17244
17336
  }
17245
17337
  }
17246
17338
  let convertedData;
@@ -17276,11 +17368,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17276
17368
  });
17277
17369
  }
17278
17370
  if (supportedProtocols.indexOf(protocol) === -1) {
17279
- return reject(new AxiosError_default(
17280
- "Unsupported protocol " + protocol,
17281
- AxiosError_default.ERR_BAD_REQUEST,
17282
- config
17283
- ));
17371
+ return reject(
17372
+ new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_BAD_REQUEST, config)
17373
+ );
17284
17374
  }
17285
17375
  const headers = AxiosHeaders_default.from(config.headers).normalize();
17286
17376
  headers.set("User-Agent", "axios/" + VERSION, false);
@@ -17290,12 +17380,16 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17290
17380
  let maxDownloadRate = void 0;
17291
17381
  if (utils_default.isSpecCompliantForm(data)) {
17292
17382
  const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
17293
- data = formDataToStream_default(data, (formHeaders) => {
17294
- headers.set(formHeaders);
17295
- }, {
17296
- tag: `axios-${VERSION}-boundary`,
17297
- boundary: userBoundary && userBoundary[1] || void 0
17298
- });
17383
+ data = formDataToStream_default(
17384
+ data,
17385
+ (formHeaders) => {
17386
+ headers.set(formHeaders);
17387
+ },
17388
+ {
17389
+ tag: `axios-${VERSION}-boundary`,
17390
+ boundary: userBoundary && userBoundary[1] || void 0
17391
+ }
17392
+ );
17299
17393
  } else if (utils_default.isFormData(data) && utils_default.isFunction(data.getHeaders)) {
17300
17394
  headers.set(data.getHeaders());
17301
17395
  if (!headers.hasContentLength()) {
@@ -17316,19 +17410,23 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17316
17410
  } else if (utils_default.isString(data)) {
17317
17411
  data = Buffer.from(data, "utf-8");
17318
17412
  } else {
17319
- return reject(new AxiosError_default(
17320
- "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
17321
- AxiosError_default.ERR_BAD_REQUEST,
17322
- config
17323
- ));
17413
+ return reject(
17414
+ new AxiosError_default(
17415
+ "Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
17416
+ AxiosError_default.ERR_BAD_REQUEST,
17417
+ config
17418
+ )
17419
+ );
17324
17420
  }
17325
17421
  headers.setContentLength(data.length, false);
17326
17422
  if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
17327
- return reject(new AxiosError_default(
17328
- "Request body larger than maxBodyLength limit",
17329
- AxiosError_default.ERR_BAD_REQUEST,
17330
- config
17331
- ));
17423
+ return reject(
17424
+ new AxiosError_default(
17425
+ "Request body larger than maxBodyLength limit",
17426
+ AxiosError_default.ERR_BAD_REQUEST,
17427
+ config
17428
+ )
17429
+ );
17332
17430
  }
17333
17431
  }
17334
17432
  const contentLength = utils_default.toFiniteNumber(headers.getContentLength());
@@ -17342,16 +17440,25 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17342
17440
  if (!utils_default.isStream(data)) {
17343
17441
  data = stream3.Readable.from(data, { objectMode: false });
17344
17442
  }
17345
- data = stream3.pipeline([data, new AxiosTransformStream_default({
17346
- maxRate: utils_default.toFiniteNumber(maxUploadRate)
17347
- })], utils_default.noop);
17348
- onUploadProgress && data.on("progress", flushOnFinish(
17349
- data,
17350
- progressEventDecorator(
17351
- contentLength,
17352
- progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
17443
+ data = stream3.pipeline(
17444
+ [
17445
+ data,
17446
+ new AxiosTransformStream_default({
17447
+ maxRate: utils_default.toFiniteNumber(maxUploadRate)
17448
+ })
17449
+ ],
17450
+ utils_default.noop
17451
+ );
17452
+ onUploadProgress && data.on(
17453
+ "progress",
17454
+ flushOnFinish(
17455
+ data,
17456
+ progressEventDecorator(
17457
+ contentLength,
17458
+ progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
17459
+ )
17353
17460
  )
17354
- ));
17461
+ );
17355
17462
  }
17356
17463
  let auth = void 0;
17357
17464
  if (config.auth) {
@@ -17402,7 +17509,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17402
17509
  } else {
17403
17510
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
17404
17511
  options.port = parsed.port;
17405
- setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
17512
+ setProxy(
17513
+ options,
17514
+ config.proxy,
17515
+ protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path
17516
+ );
17406
17517
  }
17407
17518
  let transport;
17408
17519
  const isHttpsRequest = isHttps.test(options.protocol);
@@ -17440,13 +17551,16 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17440
17551
  const transformStream = new AxiosTransformStream_default({
17441
17552
  maxRate: utils_default.toFiniteNumber(maxDownloadRate)
17442
17553
  });
17443
- onDownloadProgress && transformStream.on("progress", flushOnFinish(
17444
- transformStream,
17445
- progressEventDecorator(
17446
- responseLength,
17447
- progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
17554
+ onDownloadProgress && transformStream.on(
17555
+ "progress",
17556
+ flushOnFinish(
17557
+ transformStream,
17558
+ progressEventDecorator(
17559
+ responseLength,
17560
+ progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
17561
+ )
17448
17562
  )
17449
- ));
17563
+ );
17450
17564
  streams.push(transformStream);
17451
17565
  }
17452
17566
  let responseStream = res;
@@ -17496,12 +17610,14 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17496
17610
  if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
17497
17611
  rejected = true;
17498
17612
  responseStream.destroy();
17499
- abort(new AxiosError_default(
17500
- "maxContentLength size of " + config.maxContentLength + " exceeded",
17501
- AxiosError_default.ERR_BAD_RESPONSE,
17502
- config,
17503
- lastRequest
17504
- ));
17613
+ abort(
17614
+ new AxiosError_default(
17615
+ "maxContentLength size of " + config.maxContentLength + " exceeded",
17616
+ AxiosError_default.ERR_BAD_RESPONSE,
17617
+ config,
17618
+ lastRequest
17619
+ )
17620
+ );
17505
17621
  }
17506
17622
  });
17507
17623
  responseStream.on("aborted", function handlerStreamAborted() {
@@ -17560,12 +17676,14 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17560
17676
  if (config.timeout) {
17561
17677
  const timeout = parseInt(config.timeout, 10);
17562
17678
  if (Number.isNaN(timeout)) {
17563
- abort(new AxiosError_default(
17564
- "error trying to parse `config.timeout` to int",
17565
- AxiosError_default.ERR_BAD_OPTION_VALUE,
17566
- config,
17567
- req
17568
- ));
17679
+ abort(
17680
+ new AxiosError_default(
17681
+ "error trying to parse `config.timeout` to int",
17682
+ AxiosError_default.ERR_BAD_OPTION_VALUE,
17683
+ config,
17684
+ req
17685
+ )
17686
+ );
17569
17687
  return;
17570
17688
  }
17571
17689
  req.setTimeout(timeout, function handleRequestTimeout() {
@@ -17575,12 +17693,14 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
17575
17693
  if (config.timeoutErrorMessage) {
17576
17694
  timeoutErrorMessage = config.timeoutErrorMessage;
17577
17695
  }
17578
- abort(new AxiosError_default(
17579
- timeoutErrorMessage,
17580
- transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
17581
- config,
17582
- req
17583
- ));
17696
+ abort(
17697
+ new AxiosError_default(
17698
+ timeoutErrorMessage,
17699
+ transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
17700
+ config,
17701
+ req
17702
+ )
17703
+ );
17584
17704
  });
17585
17705
  } else {
17586
17706
  req.setTimeout(0);
@@ -17736,7 +17856,8 @@ function mergeConfig(config1, config2) {
17736
17856
  headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
17737
17857
  };
17738
17858
  utils_default.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
17739
- const merge3 = mergeMap[prop] || mergeDeepProperties;
17859
+ if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
17860
+ const merge3 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
17740
17861
  const configValue = merge3(config1[prop], config2[prop], prop);
17741
17862
  utils_default.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config[prop] = configValue);
17742
17863
  });
@@ -17748,11 +17869,17 @@ var resolveConfig_default = (config) => {
17748
17869
  const newConfig = mergeConfig({}, config);
17749
17870
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
17750
17871
  newConfig.headers = headers = AxiosHeaders_default.from(headers);
17751
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
17872
+ newConfig.url = buildURL(
17873
+ buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls),
17874
+ config.params,
17875
+ config.paramsSerializer
17876
+ );
17752
17877
  if (auth) {
17753
17878
  headers.set(
17754
17879
  "Authorization",
17755
- "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
17880
+ "Basic " + btoa(
17881
+ (auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")
17882
+ )
17756
17883
  );
17757
17884
  }
17758
17885
  if (utils_default.isFormData(data)) {
@@ -17816,13 +17943,17 @@ var xhr_default = isXHRAdapterSupported && function(config) {
17816
17943
  config,
17817
17944
  request
17818
17945
  };
17819
- settle(function _resolve(value) {
17820
- resolve6(value);
17821
- done();
17822
- }, function _reject(err) {
17823
- reject(err);
17824
- done();
17825
- }, response);
17946
+ settle(
17947
+ function _resolve(value) {
17948
+ resolve6(value);
17949
+ done();
17950
+ },
17951
+ function _reject(err) {
17952
+ reject(err);
17953
+ done();
17954
+ },
17955
+ response
17956
+ );
17826
17957
  request = null;
17827
17958
  }
17828
17959
  if ("onloadend" in request) {
@@ -17858,12 +17989,14 @@ var xhr_default = isXHRAdapterSupported && function(config) {
17858
17989
  if (_config.timeoutErrorMessage) {
17859
17990
  timeoutErrorMessage = _config.timeoutErrorMessage;
17860
17991
  }
17861
- reject(new AxiosError_default(
17862
- timeoutErrorMessage,
17863
- transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
17864
- config,
17865
- request
17866
- ));
17992
+ reject(
17993
+ new AxiosError_default(
17994
+ timeoutErrorMessage,
17995
+ transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
17996
+ config,
17997
+ request
17998
+ )
17999
+ );
17867
18000
  request = null;
17868
18001
  };
17869
18002
  requestData === void 0 && requestHeaders.setContentType(null);
@@ -17903,7 +18036,13 @@ var xhr_default = isXHRAdapterSupported && function(config) {
17903
18036
  }
17904
18037
  const protocol = parseProtocol(_config.url);
17905
18038
  if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
17906
- reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
18039
+ reject(
18040
+ new AxiosError_default(
18041
+ "Unsupported protocol " + protocol + ":",
18042
+ AxiosError_default.ERR_BAD_REQUEST,
18043
+ config
18044
+ )
18045
+ );
17907
18046
  return;
17908
18047
  }
17909
18048
  request.send(requestData || null);
@@ -17921,12 +18060,14 @@ var composeSignals = (signals, timeout) => {
17921
18060
  aborted = true;
17922
18061
  unsubscribe();
17923
18062
  const err = reason instanceof Error ? reason : this.reason;
17924
- controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
18063
+ controller.abort(
18064
+ err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)
18065
+ );
17925
18066
  }
17926
18067
  };
17927
18068
  let timer = timeout && setTimeout(() => {
17928
18069
  timer = null;
17929
- onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
18070
+ onabort(new AxiosError_default(`timeout of ${timeout}ms exceeded`, AxiosError_default.ETIMEDOUT));
17930
18071
  }, timeout);
17931
18072
  const unsubscribe = () => {
17932
18073
  if (signals) {
@@ -17994,33 +18135,36 @@ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
17994
18135
  onFinish && onFinish(e);
17995
18136
  }
17996
18137
  };
17997
- return new ReadableStream({
17998
- async pull(controller) {
17999
- try {
18000
- const { done: done2, value } = await iterator2.next();
18001
- if (done2) {
18002
- _onFinish();
18003
- controller.close();
18004
- return;
18005
- }
18006
- let len = value.byteLength;
18007
- if (onProgress) {
18008
- let loadedBytes = bytes += len;
18009
- onProgress(loadedBytes);
18138
+ return new ReadableStream(
18139
+ {
18140
+ async pull(controller) {
18141
+ try {
18142
+ const { done: done2, value } = await iterator2.next();
18143
+ if (done2) {
18144
+ _onFinish();
18145
+ controller.close();
18146
+ return;
18147
+ }
18148
+ let len = value.byteLength;
18149
+ if (onProgress) {
18150
+ let loadedBytes = bytes += len;
18151
+ onProgress(loadedBytes);
18152
+ }
18153
+ controller.enqueue(new Uint8Array(value));
18154
+ } catch (err) {
18155
+ _onFinish(err);
18156
+ throw err;
18010
18157
  }
18011
- controller.enqueue(new Uint8Array(value));
18012
- } catch (err) {
18013
- _onFinish(err);
18014
- throw err;
18158
+ },
18159
+ cancel(reason) {
18160
+ _onFinish(reason);
18161
+ return iterator2.return();
18015
18162
  }
18016
18163
  },
18017
- cancel(reason) {
18018
- _onFinish(reason);
18019
- return iterator2.return();
18164
+ {
18165
+ highWaterMark: 2
18020
18166
  }
18021
- }, {
18022
- highWaterMark: 2
18023
- });
18167
+ );
18024
18168
  };
18025
18169
 
18026
18170
  // node_modules/axios/lib/adapters/fetch.js
@@ -18030,10 +18174,7 @@ var globalFetchAPI = (({ Request, Response }) => ({
18030
18174
  Request,
18031
18175
  Response
18032
18176
  }))(utils_default.global);
18033
- var {
18034
- ReadableStream: ReadableStream2,
18035
- TextEncoder: TextEncoder2
18036
- } = utils_default.global;
18177
+ var { ReadableStream: ReadableStream2, TextEncoder: TextEncoder2 } = utils_default.global;
18037
18178
  var test = (fn, ...args) => {
18038
18179
  try {
18039
18180
  return !!fn(...args);
@@ -18042,9 +18183,13 @@ var test = (fn, ...args) => {
18042
18183
  }
18043
18184
  };
18044
18185
  var factory = (env2) => {
18045
- env2 = utils_default.merge.call({
18046
- skipUndefined: true
18047
- }, globalFetchAPI, env2);
18186
+ env2 = utils_default.merge.call(
18187
+ {
18188
+ skipUndefined: true
18189
+ },
18190
+ globalFetchAPI,
18191
+ env2
18192
+ );
18048
18193
  const { fetch: envFetch, Request, Response } = env2;
18049
18194
  const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
18050
18195
  const isRequestSupported = isFunction2(Request);
@@ -18077,7 +18222,11 @@ var factory = (env2) => {
18077
18222
  if (method) {
18078
18223
  return method.call(res);
18079
18224
  }
18080
- throw new AxiosError_default(`Response type '${type2}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config);
18225
+ throw new AxiosError_default(
18226
+ `Response type '${type2}' is not supported`,
18227
+ AxiosError_default.ERR_NOT_SUPPORT,
18228
+ config
18229
+ );
18081
18230
  });
18082
18231
  });
18083
18232
  })();
@@ -18126,7 +18275,10 @@ var factory = (env2) => {
18126
18275
  } = resolveConfig_default(config);
18127
18276
  let _fetch = envFetch || fetch;
18128
18277
  responseType = responseType ? (responseType + "").toLowerCase() : "text";
18129
- let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
18278
+ let composedSignal = composeSignals_default(
18279
+ [signal, cancelToken && cancelToken.toAbortSignal()],
18280
+ timeout
18281
+ );
18130
18282
  let request = null;
18131
18283
  const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
18132
18284
  composedSignal.unsubscribe();
@@ -18186,7 +18338,10 @@ var factory = (env2) => {
18186
18338
  );
18187
18339
  }
18188
18340
  responseType = responseType || "text";
18189
- let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
18341
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](
18342
+ response,
18343
+ config
18344
+ );
18190
18345
  !isStreamResponse && unsubscribe && unsubscribe();
18191
18346
  return await new Promise((resolve6, reject) => {
18192
18347
  settle(resolve6, reject, {
@@ -18202,13 +18357,19 @@ var factory = (env2) => {
18202
18357
  unsubscribe && unsubscribe();
18203
18358
  if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
18204
18359
  throw Object.assign(
18205
- new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request),
18360
+ new AxiosError_default(
18361
+ "Network Error",
18362
+ AxiosError_default.ERR_NETWORK,
18363
+ config,
18364
+ request,
18365
+ err && err.response
18366
+ ),
18206
18367
  {
18207
18368
  cause: err.cause || err
18208
18369
  }
18209
18370
  );
18210
18371
  }
18211
- throw AxiosError_default.from(err, err && err.code, config, request);
18372
+ throw AxiosError_default.from(err, err && err.code, config, request, err && err.response);
18212
18373
  }
18213
18374
  };
18214
18375
  };
@@ -18216,11 +18377,7 @@ var seedCache = /* @__PURE__ */ new Map();
18216
18377
  var getFetch = (config) => {
18217
18378
  let env2 = config && config.env || {};
18218
18379
  const { fetch: fetch2, Request, Response } = env2;
18219
- const seeds = [
18220
- Request,
18221
- Response,
18222
- fetch2
18223
- ];
18380
+ const seeds = [Request, Response, fetch2];
18224
18381
  let len = seeds.length, i = len, seed, target, map2 = seedCache;
18225
18382
  while (i--) {
18226
18383
  seed = seeds[i];
@@ -18309,37 +18466,33 @@ function throwIfCancellationRequested(config) {
18309
18466
  function dispatchRequest(config) {
18310
18467
  throwIfCancellationRequested(config);
18311
18468
  config.headers = AxiosHeaders_default.from(config.headers);
18312
- config.data = transformData.call(
18313
- config,
18314
- config.transformRequest
18315
- );
18469
+ config.data = transformData.call(config, config.transformRequest);
18316
18470
  if (["post", "put", "patch"].indexOf(config.method) !== -1) {
18317
18471
  config.headers.setContentType("application/x-www-form-urlencoded", false);
18318
18472
  }
18319
18473
  const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
18320
- return adapter2(config).then(function onAdapterResolution(response) {
18321
- throwIfCancellationRequested(config);
18322
- response.data = transformData.call(
18323
- config,
18324
- config.transformResponse,
18325
- response
18326
- );
18327
- response.headers = AxiosHeaders_default.from(response.headers);
18328
- return response;
18329
- }, function onAdapterRejection(reason) {
18330
- if (!isCancel(reason)) {
18474
+ return adapter2(config).then(
18475
+ function onAdapterResolution(response) {
18331
18476
  throwIfCancellationRequested(config);
18332
- if (reason && reason.response) {
18333
- reason.response.data = transformData.call(
18334
- config,
18335
- config.transformResponse,
18336
- reason.response
18337
- );
18338
- reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
18477
+ response.data = transformData.call(config, config.transformResponse, response);
18478
+ response.headers = AxiosHeaders_default.from(response.headers);
18479
+ return response;
18480
+ },
18481
+ function onAdapterRejection(reason) {
18482
+ if (!isCancel(reason)) {
18483
+ throwIfCancellationRequested(config);
18484
+ if (reason && reason.response) {
18485
+ reason.response.data = transformData.call(
18486
+ config,
18487
+ config.transformResponse,
18488
+ reason.response
18489
+ );
18490
+ reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
18491
+ }
18339
18492
  }
18493
+ return Promise.reject(reason);
18340
18494
  }
18341
- return Promise.reject(reason);
18342
- });
18495
+ );
18343
18496
  }
18344
18497
 
18345
18498
  // node_modules/axios/lib/helpers/validator.js
@@ -18392,7 +18545,10 @@ function assertOptions(options, schema2, allowUnknown) {
18392
18545
  const value = options[opt];
18393
18546
  const result = value === void 0 || validator(value, opt, options);
18394
18547
  if (result !== true) {
18395
- throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
18548
+ throw new AxiosError_default(
18549
+ "option " + opt + " must be " + result,
18550
+ AxiosError_default.ERR_BAD_OPTION_VALUE
18551
+ );
18396
18552
  }
18397
18553
  continue;
18398
18554
  }
@@ -18454,11 +18610,16 @@ var Axios = class {
18454
18610
  config = mergeConfig(this.defaults, config);
18455
18611
  const { transitional: transitional2, paramsSerializer, headers } = config;
18456
18612
  if (transitional2 !== void 0) {
18457
- validator_default.assertOptions(transitional2, {
18458
- silentJSONParsing: validators2.transitional(validators2.boolean),
18459
- forcedJSONParsing: validators2.transitional(validators2.boolean),
18460
- clarifyTimeoutError: validators2.transitional(validators2.boolean)
18461
- }, false);
18613
+ validator_default.assertOptions(
18614
+ transitional2,
18615
+ {
18616
+ silentJSONParsing: validators2.transitional(validators2.boolean),
18617
+ forcedJSONParsing: validators2.transitional(validators2.boolean),
18618
+ clarifyTimeoutError: validators2.transitional(validators2.boolean),
18619
+ legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean)
18620
+ },
18621
+ false
18622
+ );
18462
18623
  }
18463
18624
  if (paramsSerializer != null) {
18464
18625
  if (utils_default.isFunction(paramsSerializer)) {
@@ -18466,10 +18627,14 @@ var Axios = class {
18466
18627
  serialize: paramsSerializer
18467
18628
  };
18468
18629
  } else {
18469
- validator_default.assertOptions(paramsSerializer, {
18470
- encode: validators2.function,
18471
- serialize: validators2.function
18472
- }, true);
18630
+ validator_default.assertOptions(
18631
+ paramsSerializer,
18632
+ {
18633
+ encode: validators2.function,
18634
+ serialize: validators2.function
18635
+ },
18636
+ true
18637
+ );
18473
18638
  }
18474
18639
  }
18475
18640
  if (config.allowAbsoluteUrls !== void 0) {
@@ -18478,21 +18643,19 @@ var Axios = class {
18478
18643
  } else {
18479
18644
  config.allowAbsoluteUrls = true;
18480
18645
  }
18481
- validator_default.assertOptions(config, {
18482
- baseUrl: validators2.spelling("baseURL"),
18483
- withXsrfToken: validators2.spelling("withXSRFToken")
18484
- }, true);
18485
- config.method = (config.method || this.defaults.method || "get").toLowerCase();
18486
- let contextHeaders = headers && utils_default.merge(
18487
- headers.common,
18488
- headers[config.method]
18489
- );
18490
- headers && utils_default.forEach(
18491
- ["delete", "get", "head", "post", "put", "patch", "common"],
18492
- (method) => {
18493
- delete headers[method];
18494
- }
18646
+ validator_default.assertOptions(
18647
+ config,
18648
+ {
18649
+ baseUrl: validators2.spelling("baseURL"),
18650
+ withXsrfToken: validators2.spelling("withXSRFToken")
18651
+ },
18652
+ true
18495
18653
  );
18654
+ config.method = (config.method || this.defaults.method || "get").toLowerCase();
18655
+ let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]);
18656
+ headers && utils_default.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (method) => {
18657
+ delete headers[method];
18658
+ });
18496
18659
  config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
18497
18660
  const requestInterceptorChain = [];
18498
18661
  let synchronousRequestInterceptors = true;
@@ -18501,7 +18664,13 @@ var Axios = class {
18501
18664
  return;
18502
18665
  }
18503
18666
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
18504
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
18667
+ const transitional3 = config.transitional || transitional_default;
18668
+ const legacyInterceptorReqResOrdering = transitional3 && transitional3.legacyInterceptorReqResOrdering;
18669
+ if (legacyInterceptorReqResOrdering) {
18670
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
18671
+ } else {
18672
+ requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
18673
+ }
18505
18674
  });
18506
18675
  const responseInterceptorChain = [];
18507
18676
  this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
@@ -18553,24 +18722,28 @@ var Axios = class {
18553
18722
  };
18554
18723
  utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
18555
18724
  Axios.prototype[method] = function(url2, config) {
18556
- return this.request(mergeConfig(config || {}, {
18557
- method,
18558
- url: url2,
18559
- data: (config || {}).data
18560
- }));
18725
+ return this.request(
18726
+ mergeConfig(config || {}, {
18727
+ method,
18728
+ url: url2,
18729
+ data: (config || {}).data
18730
+ })
18731
+ );
18561
18732
  };
18562
18733
  });
18563
18734
  utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
18564
18735
  function generateHTTPMethod(isForm) {
18565
18736
  return function httpMethod(url2, data, config) {
18566
- return this.request(mergeConfig(config || {}, {
18567
- method,
18568
- headers: isForm ? {
18569
- "Content-Type": "multipart/form-data"
18570
- } : {},
18571
- url: url2,
18572
- data
18573
- }));
18737
+ return this.request(
18738
+ mergeConfig(config || {}, {
18739
+ method,
18740
+ headers: isForm ? {
18741
+ "Content-Type": "multipart/form-data"
18742
+ } : {},
18743
+ url: url2,
18744
+ data
18745
+ })
18746
+ );
18574
18747
  };
18575
18748
  }
18576
18749
  Axios.prototype[method] = generateHTTPMethod();
@@ -18857,6 +19030,8 @@ function isGetLikeMethod(method) {
18857
19030
  var SYSTEM_CONTROLLED_HEADERS = /* @__PURE__ */ new Set([
18858
19031
  "host",
18859
19032
  // Controlled by HTTP client based on URL
19033
+ "content-type",
19034
+ // Set automatically based on OpenAPI spec or defaults
18860
19035
  "content-length",
18861
19036
  // Calculated by HTTP client from body
18862
19037
  "transfer-encoding",
@@ -18933,6 +19108,41 @@ var ApiClient = class {
18933
19108
  getToolDefinition(toolId) {
18934
19109
  return this.toolsMap.get(toolId);
18935
19110
  }
19111
+ resolveRequestBodyObject(requestBody) {
19112
+ if (!requestBody || !("$ref" in requestBody)) {
19113
+ return requestBody;
19114
+ }
19115
+ const refPrefix = "#/components/requestBodies/";
19116
+ if (!requestBody.$ref.startsWith(refPrefix)) {
19117
+ return void 0;
19118
+ }
19119
+ const requestBodyName = requestBody.$ref.slice(refPrefix.length);
19120
+ const resolvedRequestBody = this.openApiSpec?.components?.requestBodies?.[requestBodyName];
19121
+ if (!resolvedRequestBody || "$ref" in resolvedRequestBody) {
19122
+ return void 0;
19123
+ }
19124
+ return resolvedRequestBody;
19125
+ }
19126
+ getRequestContentType(method, path2) {
19127
+ const pathItem = this.openApiSpec?.paths[path2];
19128
+ const normalizedMethod = method.toLowerCase();
19129
+ if (!isValidHttpMethod(normalizedMethod)) {
19130
+ return void 0;
19131
+ }
19132
+ const operation = pathItem?.[normalizedMethod];
19133
+ if (!operation || "$ref" in operation) {
19134
+ return void 0;
19135
+ }
19136
+ const requestBody = this.resolveRequestBodyObject(operation.requestBody);
19137
+ const content = requestBody?.content;
19138
+ if (!content) {
19139
+ return void 0;
19140
+ }
19141
+ if (content["application/json"]) {
19142
+ return "application/json";
19143
+ }
19144
+ return Object.keys(content)[0];
19145
+ }
18936
19146
  /**
18937
19147
  * Execute an API call based on the tool ID and parameters
18938
19148
  *
@@ -19057,6 +19267,8 @@ var ApiClient = class {
19057
19267
  }
19058
19268
  } else {
19059
19269
  config.data = Object.keys(paramsCopy).length > 0 ? paramsCopy : {};
19270
+ const contentType = toolDef?.inputSchema?.["x-content-type"] || "application/json";
19271
+ config.headers["Content-Type"] = contentType;
19060
19272
  }
19061
19273
  const response = await this.axiosInstance(config);
19062
19274
  return response.data;
@@ -19293,12 +19505,13 @@ var ApiClient = class {
19293
19505
  const config = {
19294
19506
  method: method.toLowerCase(),
19295
19507
  url: path2,
19296
- headers: authHeaders
19508
+ headers: { ...authHeaders }
19297
19509
  };
19298
19510
  if (isGetLikeMethod(method)) {
19299
19511
  config.params = this.processQueryParams(params);
19300
19512
  } else {
19301
19513
  config.data = params;
19514
+ config.headers["Content-Type"] = this.getRequestContentType(method, path2) || "application/json";
19302
19515
  }
19303
19516
  try {
19304
19517
  const response = await this.axiosInstance.request(config);