@jerome-benoit/sap-ai-provider-v2 4.7.1 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +5 -0
  2. package/dist/{chunk-BZWUUBX2.js → chunk-33WLQYKB.js} +8 -2
  3. package/dist/chunk-33WLQYKB.js.map +1 -0
  4. package/dist/{chunk-RUCURXS7.js → chunk-3KCERYUB.js} +12 -6
  5. package/dist/chunk-3KCERYUB.js.map +1 -0
  6. package/dist/{chunk-XIWHF23D.js → chunk-4PLJVJX4.js} +746 -203
  7. package/dist/{chunk-XIWHF23D.js.map → chunk-4PLJVJX4.js.map} +1 -1
  8. package/dist/{chunk-HDOSHLV6.js → chunk-4SQ5HC6Y.js} +2 -2
  9. package/dist/{chunk-OA6TJHD2.js → chunk-RW6WSPU2.js} +10 -4
  10. package/dist/chunk-RW6WSPU2.js.map +1 -0
  11. package/dist/{foundation-models-embedding-model-strategy-TACUPFS2.js → foundation-models-embedding-model-strategy-RVJQSJPU.js} +7 -6
  12. package/dist/foundation-models-embedding-model-strategy-RVJQSJPU.js.map +1 -0
  13. package/dist/{foundation-models-language-model-strategy-LLWYUGA3.js → foundation-models-language-model-strategy-UWJ6FHBI.js} +14 -9
  14. package/dist/foundation-models-language-model-strategy-UWJ6FHBI.js.map +1 -0
  15. package/dist/index.cjs +795 -222
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +26 -5
  18. package/dist/index.d.ts +26 -5
  19. package/dist/index.js +14 -10
  20. package/dist/index.js.map +1 -1
  21. package/dist/{orchestration-embedding-model-strategy-RYI3HWRZ.js → orchestration-embedding-model-strategy-OMIXGLHJ.js} +8 -7
  22. package/dist/orchestration-embedding-model-strategy-OMIXGLHJ.js.map +1 -0
  23. package/dist/{orchestration-language-model-strategy-NIUPRYDW.js → orchestration-language-model-strategy-UE7OQO5K.js} +16 -10
  24. package/dist/orchestration-language-model-strategy-UE7OQO5K.js.map +1 -0
  25. package/package.json +20 -20
  26. package/dist/chunk-BZWUUBX2.js.map +0 -1
  27. package/dist/chunk-OA6TJHD2.js.map +0 -1
  28. package/dist/chunk-RUCURXS7.js.map +0 -1
  29. package/dist/foundation-models-embedding-model-strategy-TACUPFS2.js.map +0 -1
  30. package/dist/foundation-models-language-model-strategy-LLWYUGA3.js.map +0 -1
  31. package/dist/orchestration-embedding-model-strategy-RYI3HWRZ.js.map +0 -1
  32. package/dist/orchestration-language-model-strategy-NIUPRYDW.js.map +0 -1
  33. /package/dist/{chunk-HDOSHLV6.js.map → chunk-4SQ5HC6Y.js.map} +0 -0
package/dist/index.cjs CHANGED
@@ -11764,7 +11764,7 @@ var require_error_with_cause = __commonJS({
11764
11764
  this.addStack(cause);
11765
11765
  }
11766
11766
  isAxiosError(err) {
11767
- return err["isAxiosError"] === true;
11767
+ return "isAxiosError" in err && err.isAxiosError === true;
11768
11768
  }
11769
11769
  addStack(cause) {
11770
11770
  if (this.isAxiosError(cause)) {
@@ -23653,6 +23653,9 @@ var require_form_data = __commonJS({
23653
23653
  var setToStringTag = require_es_set_tostringtag();
23654
23654
  var hasOwn = require_hasown();
23655
23655
  var populate = require_populate();
23656
+ function escapeHeaderParam(str) {
23657
+ return String(str).replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/"/g, "%22");
23658
+ }
23656
23659
  function FormData2(options) {
23657
23660
  if (!(this instanceof FormData2)) {
23658
23661
  return new FormData2(options);
@@ -23742,7 +23745,7 @@ var require_form_data = __commonJS({
23742
23745
  var contents = "";
23743
23746
  var headers = {
23744
23747
  // add custom disposition as third element or keep it two elements if not
23745
- "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []),
23748
+ "Content-Disposition": ["form-data", 'name="' + escapeHeaderParam(field) + '"'].concat(contentDisposition || []),
23746
23749
  // if no content type. allow it to be empty array
23747
23750
  "Content-Type": [].concat(contentType || [])
23748
23751
  };
@@ -23776,7 +23779,7 @@ var require_form_data = __commonJS({
23776
23779
  filename = path.basename(value.client._httpMessage.path || "");
23777
23780
  }
23778
23781
  if (filename) {
23779
- return 'filename="' + filename + '"';
23782
+ return 'filename="' + escapeHeaderParam(filename) + '"';
23780
23783
  }
23781
23784
  };
23782
23785
  FormData2.prototype._getContentType = function(value, options) {
@@ -25620,6 +25623,25 @@ var require_axios = __commonJS({
25620
25623
  iterator,
25621
25624
  toStringTag
25622
25625
  } = Symbol;
25626
+ var hasOwnProperty = (({
25627
+ hasOwnProperty: hasOwnProperty2
25628
+ }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
25629
+ var hasOwnInPrototypeChain = (thing, prop) => {
25630
+ let obj = thing;
25631
+ const seen = [];
25632
+ while (obj != null && obj !== Object.prototype) {
25633
+ if (seen.indexOf(obj) !== -1) {
25634
+ return false;
25635
+ }
25636
+ seen.push(obj);
25637
+ if (hasOwnProperty(obj, prop)) {
25638
+ return true;
25639
+ }
25640
+ obj = getPrototypeOf(obj);
25641
+ }
25642
+ return false;
25643
+ };
25644
+ var getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : void 0;
25623
25645
  var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
25624
25646
  const str = toString2.call(thing);
25625
25647
  return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
@@ -25652,11 +25674,14 @@ var require_axios = __commonJS({
25652
25674
  var isObject = (thing) => thing !== null && typeof thing === "object";
25653
25675
  var isBoolean = (thing) => thing === true || thing === false;
25654
25676
  var isPlainObject2 = (val) => {
25655
- if (kindOf(val) !== "object") {
25677
+ if (!isObject(val)) {
25656
25678
  return false;
25657
25679
  }
25658
25680
  const prototype2 = getPrototypeOf(val);
25659
- return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
25681
+ return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat any genuine (non-Object.prototype-polluted) Symbol.toStringTag or
25682
+ // Symbol.iterator as evidence the value is a tagged/iterable type rather
25683
+ // than a plain object, while ignoring keys injected onto Object.prototype.
25684
+ !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
25660
25685
  };
25661
25686
  var isEmptyObject = (val) => {
25662
25687
  if (!isObject(val) || isBuffer(val)) {
@@ -25676,6 +25701,7 @@ var require_axios = __commonJS({
25676
25701
  var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined";
25677
25702
  var isBlob = kindOfTest("Blob");
25678
25703
  var isFileList = kindOfTest("FileList");
25704
+ var isSet = kindOfTest("Set");
25679
25705
  var isStream = (val) => isObject(val) && isFunction$1(val.pipe);
25680
25706
  function getGlobal() {
25681
25707
  if (typeof globalThis !== "undefined") return globalThis;
@@ -25909,9 +25935,6 @@ var require_axios = __commonJS({
25909
25935
  return p1.toUpperCase() + p2;
25910
25936
  });
25911
25937
  };
25912
- var hasOwnProperty = (({
25913
- hasOwnProperty: hasOwnProperty2
25914
- }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
25915
25938
  var {
25916
25939
  propertyIsEnumerable
25917
25940
  } = Object.prototype;
@@ -25976,11 +25999,20 @@ var require_axios = __commonJS({
25976
25999
  }
25977
26000
  if (!("toJSON" in source)) {
25978
26001
  visited.add(source);
25979
- const target = isArray(source) ? [] : {};
25980
- forEach(source, (value, key) => {
25981
- const reducedValue = visit(value);
25982
- !isUndefined(reducedValue) && (target[key] = reducedValue);
25983
- });
26002
+ let target;
26003
+ if (isSet(source)) {
26004
+ target = [];
26005
+ for (const value of source) {
26006
+ const reducedValue = visit(value);
26007
+ !isUndefined(reducedValue) && target.push(reducedValue);
26008
+ }
26009
+ } else {
26010
+ target = isArray(source) ? [] : {};
26011
+ forEach(source, (value, key) => {
26012
+ const reducedValue = visit(value);
26013
+ !isUndefined(reducedValue) && (target[key] = reducedValue);
26014
+ });
26015
+ }
25984
26016
  visited.delete(source);
25985
26017
  return target;
25986
26018
  }
@@ -26012,6 +26044,7 @@ var require_axios = __commonJS({
26012
26044
  })(typeof setImmediate === "function", isFunction$1(_global.postMessage));
26013
26045
  var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
26014
26046
  var isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
26047
+ var isSafeIterable = (thing) => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);
26015
26048
  var utils$1 = {
26016
26049
  isArray,
26017
26050
  isArrayBuffer,
@@ -26057,6 +26090,8 @@ var require_axios = __commonJS({
26057
26090
  hasOwnProperty,
26058
26091
  hasOwnProp: hasOwnProperty,
26059
26092
  // an alias to avoid ESLint no-prototype-builtins detection
26093
+ hasOwnInPrototypeChain,
26094
+ getSafeProp,
26060
26095
  reduceDescriptors,
26061
26096
  freezeMethods,
26062
26097
  toObjectSet,
@@ -26072,7 +26107,8 @@ var require_axios = __commonJS({
26072
26107
  isThenable,
26073
26108
  setImmediate: _setImmediate,
26074
26109
  asap,
26075
- isIterable
26110
+ isIterable,
26111
+ isSafeIterable
26076
26112
  };
26077
26113
  var ignoreDuplicateOf = utils$1.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]);
26078
26114
  var parseHeaders = (rawHeaders) => {
@@ -26084,17 +26120,18 @@ var require_axios = __commonJS({
26084
26120
  i = line.indexOf(":");
26085
26121
  key = line.substring(0, i).trim().toLowerCase();
26086
26122
  val = line.substring(i + 1).trim();
26087
- if (!key || parsed[key] && ignoreDuplicateOf[key]) {
26123
+ const hasKey = utils$1.hasOwnProp(parsed, key);
26124
+ if (!key || hasKey && utils$1.hasOwnProp(ignoreDuplicateOf, key)) {
26088
26125
  return;
26089
26126
  }
26090
26127
  if (key === "set-cookie") {
26091
- if (parsed[key]) {
26128
+ if (hasKey) {
26092
26129
  parsed[key].push(val);
26093
26130
  } else {
26094
26131
  parsed[key] = [val];
26095
26132
  }
26096
26133
  } else {
26097
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
26134
+ parsed[key] = hasKey ? parsed[key] + ", " + val : val;
26098
26135
  }
26099
26136
  });
26100
26137
  return parsed;
@@ -26154,6 +26191,90 @@ var require_axios = __commonJS({
26154
26191
  }
26155
26192
  return tokens;
26156
26193
  }
26194
+ var parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
26195
+ function trimOWS(value) {
26196
+ let start = 0;
26197
+ let end = value.length;
26198
+ while (start < end) {
26199
+ const code = value.charCodeAt(start);
26200
+ if (code !== 9 && code !== 32) {
26201
+ break;
26202
+ }
26203
+ start += 1;
26204
+ }
26205
+ while (end > start) {
26206
+ const code = value.charCodeAt(end - 1);
26207
+ if (code !== 9 && code !== 32) {
26208
+ break;
26209
+ }
26210
+ end -= 1;
26211
+ }
26212
+ return start === 0 && end === value.length ? value : value.slice(start, end);
26213
+ }
26214
+ function decodeQuotedString(value) {
26215
+ const last2 = value.length - 1;
26216
+ if (last2 < 1 || value.charCodeAt(0) !== 34 || value.charCodeAt(last2) !== 34) {
26217
+ return value;
26218
+ }
26219
+ let decoded = "";
26220
+ for (let i = 1; i < last2; i++) {
26221
+ const code = value.charCodeAt(i);
26222
+ if (code === 34) {
26223
+ return value;
26224
+ }
26225
+ if (code === 92) {
26226
+ i += 1;
26227
+ if (i >= last2) {
26228
+ return value;
26229
+ }
26230
+ }
26231
+ decoded += value[i];
26232
+ }
26233
+ return decoded;
26234
+ }
26235
+ function parseParameters(value) {
26236
+ const parameters = /* @__PURE__ */ Object.create(null);
26237
+ const str = String(value);
26238
+ let start = 0;
26239
+ let quoted = false;
26240
+ let escaped = false;
26241
+ function parseParameter(end) {
26242
+ const part = trimOWS(str.slice(start, end));
26243
+ const equals = part.indexOf("=");
26244
+ if (equals < 1) {
26245
+ return;
26246
+ }
26247
+ const name = trimOWS(part.slice(0, equals));
26248
+ if (!parameterNameRE.test(name)) {
26249
+ return;
26250
+ }
26251
+ const normalizedName = name.toLowerCase();
26252
+ if (normalizedName === "__proto__" || normalizedName === "constructor" || normalizedName === "prototype") {
26253
+ return;
26254
+ }
26255
+ const parameterValue = trimOWS(part.slice(equals + 1));
26256
+ parameters[normalizedName] = decodeQuotedString(parameterValue);
26257
+ }
26258
+ for (let i = 0; i < str.length; i++) {
26259
+ const code = str.charCodeAt(i);
26260
+ if (quoted) {
26261
+ if (escaped) {
26262
+ escaped = false;
26263
+ } else if (code === 92) {
26264
+ escaped = true;
26265
+ } else if (code === 34) {
26266
+ quoted = false;
26267
+ }
26268
+ } else if (code === 34) {
26269
+ quoted = true;
26270
+ } else if (code === 44 || code === 59) {
26271
+ parseParameter(i);
26272
+ start = i + 1;
26273
+ }
26274
+ }
26275
+ parseParameter(str.length);
26276
+ return parameters;
26277
+ }
26157
26278
  var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
26158
26279
  function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
26159
26280
  if (utils$1.isFunction(filter)) {
@@ -26210,13 +26331,19 @@ var require_axios = __commonJS({
26210
26331
  setHeaders(header, valueOrRewrite);
26211
26332
  } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
26212
26333
  setHeaders(parseHeaders(header), valueOrRewrite);
26213
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
26214
- let obj = {}, dest, key;
26334
+ } else if (utils$1.isObject(header) && utils$1.isSafeIterable(header)) {
26335
+ let obj = /* @__PURE__ */ Object.create(null), dest, key;
26215
26336
  for (const entry of header) {
26216
26337
  if (!utils$1.isArray(entry)) {
26217
26338
  throw new TypeError("Object iterator must return a key-value pair");
26218
26339
  }
26219
- obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
26340
+ key = entry[0];
26341
+ if (utils$1.hasOwnProp(obj, key)) {
26342
+ dest = obj[key];
26343
+ obj[key] = utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];
26344
+ } else {
26345
+ obj[key] = entry[1];
26346
+ }
26220
26347
  }
26221
26348
  setHeaders(obj, valueOrRewrite);
26222
26349
  } else {
@@ -26323,7 +26450,8 @@ var require_axios = __commonJS({
26323
26450
  return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
26324
26451
  }
26325
26452
  getSetCookie() {
26326
- return this.get("set-cookie") || [];
26453
+ const value = this.get("set-cookie");
26454
+ return utils$1.isArray(value) ? value : value == null || value === false ? [] : [value];
26327
26455
  }
26328
26456
  get [Symbol.toStringTag]() {
26329
26457
  return "AxiosHeaders";
@@ -26331,6 +26459,9 @@ var require_axios = __commonJS({
26331
26459
  static from(thing) {
26332
26460
  return thing instanceof this ? thing : new this(thing);
26333
26461
  }
26462
+ static parseParameters(value) {
26463
+ return parseParameters(value);
26464
+ }
26334
26465
  static concat(first2, ...targets) {
26335
26466
  const computed = new this(first2);
26336
26467
  targets.forEach((target) => computed.set(target));
@@ -26418,10 +26549,37 @@ var require_axios = __commonJS({
26418
26549
  };
26419
26550
  return visit(config);
26420
26551
  }
26552
+ function stringifySafely$1(value) {
26553
+ try {
26554
+ return String(value);
26555
+ } catch (err) {
26556
+ return "";
26557
+ }
26558
+ }
26559
+ function aggregateErrorMessage(error) {
26560
+ const message = error.errors.map((entry) => {
26561
+ try {
26562
+ return entry && entry.message ? stringifySafely$1(entry.message) : stringifySafely$1(entry);
26563
+ } catch (err) {
26564
+ return "";
26565
+ }
26566
+ }).filter(Boolean).join("; ");
26567
+ return message || error.name || "AggregateError";
26568
+ }
26421
26569
  var AxiosError = class _AxiosError extends Error {
26422
26570
  static from(error, code, config, request, response, customProps) {
26423
- const axiosError = new _AxiosError(error.message, code || error.code, config, request, response);
26424
- axiosError.cause = error;
26571
+ let message = error.message;
26572
+ if (!message && utils$1.isArray(error.errors) && error.errors.length) {
26573
+ message = aggregateErrorMessage(error);
26574
+ }
26575
+ const axiosError = new _AxiosError(message, code || error.code, config, request, response);
26576
+ Object.defineProperty(axiosError, "cause", {
26577
+ __proto__: null,
26578
+ value: error,
26579
+ writable: true,
26580
+ enumerable: false,
26581
+ configurable: true
26582
+ });
26425
26583
  axiosError.name = error.name;
26426
26584
  if (error.status != null && axiosError.status == null) {
26427
26585
  axiosError.status = error.status;
@@ -26498,6 +26656,15 @@ var require_axios = __commonJS({
26498
26656
  AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
26499
26657
  AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
26500
26658
  AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
26659
+ var PlatformBuffer = {
26660
+ isBufferAvailable() {
26661
+ return typeof Buffer !== "undefined";
26662
+ },
26663
+ from(value) {
26664
+ return Buffer.from(value);
26665
+ }
26666
+ };
26667
+ var DEFAULT_FORM_DATA_MAX_DEPTH = 100;
26501
26668
  function isVisitable(thing) {
26502
26669
  return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
26503
26670
  }
@@ -26534,8 +26701,9 @@ var require_axios = __commonJS({
26534
26701
  const dots = options.dots;
26535
26702
  const indexes = options.indexes;
26536
26703
  const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
26537
- const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth;
26704
+ const maxDepth = options.maxDepth === void 0 ? DEFAULT_FORM_DATA_MAX_DEPTH : options.maxDepth;
26538
26705
  const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
26706
+ const stack = [];
26539
26707
  if (!utils$1.isFunction(visitor)) {
26540
26708
  throw new TypeError("visitor must be a function");
26541
26709
  }
@@ -26551,10 +26719,38 @@ var require_axios = __commonJS({
26551
26719
  throw new AxiosError("Blob is not supported. Use a Buffer instead.");
26552
26720
  }
26553
26721
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
26554
- return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
26722
+ if (useBlob && typeof _Blob === "function") {
26723
+ return new _Blob([value]);
26724
+ }
26725
+ if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) {
26726
+ return PlatformBuffer.from(value);
26727
+ }
26728
+ throw new AxiosError("Blob is not supported. Use a Buffer instead.", AxiosError.ERR_NOT_SUPPORT);
26555
26729
  }
26556
26730
  return value;
26557
26731
  }
26732
+ function throwIfMaxDepthExceeded(depth) {
26733
+ if (depth > maxDepth) {
26734
+ throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
26735
+ }
26736
+ }
26737
+ function stringifyWithDepthLimit(value, depth) {
26738
+ if (maxDepth === Infinity) {
26739
+ return JSON.stringify(value);
26740
+ }
26741
+ const ancestors = [];
26742
+ return JSON.stringify(value, function limitDepth(_key, currentValue) {
26743
+ if (!utils$1.isObject(currentValue)) {
26744
+ return currentValue;
26745
+ }
26746
+ while (ancestors.length && ancestors[ancestors.length - 1] !== this) {
26747
+ ancestors.pop();
26748
+ }
26749
+ ancestors.push(currentValue);
26750
+ throwIfMaxDepthExceeded(depth + ancestors.length - 1);
26751
+ return currentValue;
26752
+ });
26753
+ }
26558
26754
  function defaultVisitor(value, key, path2) {
26559
26755
  let arr = value;
26560
26756
  if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
@@ -26564,7 +26760,7 @@ var require_axios = __commonJS({
26564
26760
  if (value && !path2 && typeof value === "object") {
26565
26761
  if (utils$1.endsWith(key, "{}")) {
26566
26762
  key = metaTokens ? key : key.slice(0, -2);
26567
- value = JSON.stringify(value);
26763
+ value = stringifyWithDepthLimit(value, 1);
26568
26764
  } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
26569
26765
  key = removeBrackets(key);
26570
26766
  arr.forEach(function each(el, index) {
@@ -26583,7 +26779,6 @@ var require_axios = __commonJS({
26583
26779
  formData.append(renderKey(path2, key, dots), convertValue(value));
26584
26780
  return false;
26585
26781
  }
26586
- const stack = [];
26587
26782
  const exposedHelpers = Object.assign(predicates, {
26588
26783
  defaultVisitor,
26589
26784
  convertValue,
@@ -26591,9 +26786,7 @@ var require_axios = __commonJS({
26591
26786
  });
26592
26787
  function build(value, path2, depth = 0) {
26593
26788
  if (utils$1.isUndefined(value)) return;
26594
- if (depth > maxDepth) {
26595
- throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
26596
- }
26789
+ throwIfMaxDepthExceeded(depth);
26597
26790
  if (stack.indexOf(value) !== -1) {
26598
26791
  throw new Error("Circular reference detected in " + path2.join("."));
26599
26792
  }
@@ -26634,9 +26827,7 @@ var require_axios = __commonJS({
26634
26827
  this._pairs.push([name, value]);
26635
26828
  };
26636
26829
  prototype.toString = function toString3(encoder) {
26637
- const _encode = encoder ? function(value) {
26638
- return encoder.call(this, value, encode$1);
26639
- } : encode$1;
26830
+ const _encode = encoder ? (value) => encoder.call(this, value, encode$1) : encode$1;
26640
26831
  return this._pairs.map(function each(pair) {
26641
26832
  return _encode(pair[0]) + "=" + _encode(pair[1]);
26642
26833
  }, "").join("&");
@@ -26648,11 +26839,12 @@ var require_axios = __commonJS({
26648
26839
  if (!params) {
26649
26840
  return url2;
26650
26841
  }
26651
- const _encode = options && options.encode || encode;
26842
+ url2 = url2 || "";
26652
26843
  const _options = utils$1.isFunction(options) ? {
26653
26844
  serialize: options
26654
26845
  } : options;
26655
- const serializeFn = _options && _options.serialize;
26846
+ const _encode = utils$1.getSafeProp(_options, "encode") || encode;
26847
+ const serializeFn = utils$1.getSafeProp(_options, "serialize");
26656
26848
  let serializedParams;
26657
26849
  if (serializeFn) {
26658
26850
  serializedParams = serializeFn(params, _options);
@@ -26735,7 +26927,8 @@ var require_axios = __commonJS({
26735
26927
  forcedJSONParsing: true,
26736
26928
  clarifyTimeoutError: false,
26737
26929
  legacyInterceptorReqResOrdering: true,
26738
- advertiseZstdAcceptEncoding: false
26930
+ advertiseZstdAcceptEncoding: false,
26931
+ validateStatusUndefinedResolves: true
26739
26932
  };
26740
26933
  var URLSearchParams = url.URLSearchParams;
26741
26934
  var ALPHA = "abcdefghijklmnopqrstuvwxyz";
@@ -26800,10 +26993,21 @@ var require_axios = __commonJS({
26800
26993
  ...options
26801
26994
  });
26802
26995
  }
26996
+ var MAX_DEPTH2 = DEFAULT_FORM_DATA_MAX_DEPTH;
26997
+ function throwIfDepthExceeded(index) {
26998
+ if (index > MAX_DEPTH2) {
26999
+ throw new AxiosError("FormData field is too deeply nested (" + index + " levels). Max depth: " + MAX_DEPTH2, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED);
27000
+ }
27001
+ }
26803
27002
  function parsePropPath(name) {
26804
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match2) => {
26805
- return match2[0] === "[]" ? "" : match2[1] || match2[0];
26806
- });
27003
+ const path2 = [];
27004
+ const pattern = /[^.[\]]+|\[([^.[\]]*)]/g;
27005
+ let match2;
27006
+ while ((match2 = pattern.exec(name)) !== null) {
27007
+ throwIfDepthExceeded(path2.length);
27008
+ path2.push(match2[0] === "[]" ? "" : match2[1] || match2[0]);
27009
+ }
27010
+ return path2;
26807
27011
  }
26808
27012
  function arrayToObject(arr) {
26809
27013
  const obj = {};
@@ -26819,6 +27023,7 @@ var require_axios = __commonJS({
26819
27023
  }
26820
27024
  function formDataToJSON(formData) {
26821
27025
  function buildPath(path2, value, target, index) {
27026
+ throwIfDepthExceeded(index);
26822
27027
  let name = path2[index++];
26823
27028
  if (name === "__proto__") return true;
26824
27029
  const isNumericKey = Number.isFinite(+name);
@@ -27003,11 +27208,58 @@ var require_axios = __commonJS({
27003
27208
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
27004
27209
  }
27005
27210
  function combineURLs(baseURL, relativeURL) {
27006
- return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
27211
+ if (!relativeURL) {
27212
+ return baseURL;
27213
+ }
27214
+ let end = baseURL.length;
27215
+ while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {
27216
+ end--;
27217
+ }
27218
+ return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, "");
27219
+ }
27220
+ var malformedHttpProtocol = /^https?:(?!\/\/)/i;
27221
+ var httpProtocolControlCharacters = /[\t\n\r]/g;
27222
+ function stripLeadingC0ControlOrSpace(url2) {
27223
+ let i = 0;
27224
+ while (i < url2.length && url2.charCodeAt(i) <= 32) {
27225
+ i++;
27226
+ }
27227
+ return url2.slice(i);
27228
+ }
27229
+ function normalizeURLForProtocolCheck(url2) {
27230
+ return stripLeadingC0ControlOrSpace(url2).replace(httpProtocolControlCharacters, "");
27231
+ }
27232
+ function redactFragment(fragment) {
27233
+ if (!fragment) {
27234
+ return fragment;
27235
+ }
27236
+ return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match2, separator, parameterName = "") => {
27237
+ return `${separator}${parameterName}${REDACTED}`;
27238
+ });
27007
27239
  }
27008
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
27240
+ function redactSensitiveURLParts(url2) {
27241
+ const redactedURL = url2.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`);
27242
+ const fragmentIndex = redactedURL.indexOf("#");
27243
+ const urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);
27244
+ const redactedURLWithoutFragment = urlWithoutFragment.replace(/([?&][^=&#]*=)[^&#]*/g, `$1${REDACTED}`);
27245
+ if (fragmentIndex === -1) {
27246
+ return redactedURLWithoutFragment;
27247
+ }
27248
+ return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;
27249
+ }
27250
+ function assertValidHttpProtocolURL(url2, config) {
27251
+ if (typeof url2 === "string") {
27252
+ const normalizedURL = normalizeURLForProtocolCheck(url2);
27253
+ if (malformedHttpProtocol.test(normalizedURL)) {
27254
+ throw new AxiosError(`Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, AxiosError.ERR_INVALID_URL, config);
27255
+ }
27256
+ }
27257
+ }
27258
+ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
27259
+ assertValidHttpProtocolURL(requestedURL, config);
27009
27260
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
27010
27261
  if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
27262
+ assertValidHttpProtocolURL(baseURL, config);
27011
27263
  return combineURLs(baseURL, requestedURL);
27012
27264
  }
27013
27265
  return requestedURL;
@@ -27077,7 +27329,7 @@ var require_axios = __commonJS({
27077
27329
  function getEnv(key) {
27078
27330
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
27079
27331
  }
27080
- var VERSION2 = "1.17.0";
27332
+ var VERSION2 = "1.19.0";
27081
27333
  function parseProtocol(url2) {
27082
27334
  const match2 = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2);
27083
27335
  return match2 && match2[1] || "";
@@ -27099,13 +27351,13 @@ var require_axios = __commonJS({
27099
27351
  const params = match2[2];
27100
27352
  const encoding = match2[3] ? "base64" : "utf8";
27101
27353
  const body = match2[4];
27102
- let mime;
27354
+ let mime = "";
27103
27355
  if (type) {
27104
27356
  mime = params ? type + params : type;
27105
27357
  } else if (params) {
27106
27358
  mime = "text/plain" + params;
27107
27359
  }
27108
- const buffer = Buffer.from(decodeURIComponent(body), encoding);
27360
+ const buffer = encoding === "base64" ? Buffer.from(body, "base64") : Buffer.from(decodeURIComponent(body), encoding);
27109
27361
  if (asBlob) {
27110
27362
  if (!_Blob) {
27111
27363
  throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT);
@@ -27118,6 +27370,18 @@ var require_axios = __commonJS({
27118
27370
  }
27119
27371
  throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT);
27120
27372
  }
27373
+ var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
27374
+ function setFormDataHeaders(headers, formHeaders, policy) {
27375
+ if (policy !== "content-only") {
27376
+ headers.set(formHeaders);
27377
+ return;
27378
+ }
27379
+ Object.entries(formHeaders || {}).forEach(([key, val]) => {
27380
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
27381
+ headers.set(key, val);
27382
+ }
27383
+ });
27384
+ }
27121
27385
  var kInternals = /* @__PURE__ */ Symbol("internals");
27122
27386
  var AxiosTransformStream = class extends stream.Transform {
27123
27387
  constructor(options) {
@@ -27429,13 +27693,83 @@ var require_axios = __commonJS({
27429
27693
  }, cb);
27430
27694
  } : fn;
27431
27695
  };
27432
- var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost"]);
27696
+ var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "0.0.0.0"]);
27433
27697
  var isIPv4Loopback = (host) => {
27434
27698
  const parts = host.split(".");
27435
27699
  if (parts.length !== 4) return false;
27436
27700
  if (parts[0] !== "127") return false;
27437
27701
  return parts.every((p) => /^\d+$/.test(p) && Number(p) >= 0 && Number(p) <= 255);
27438
27702
  };
27703
+ var parseIPv4Octet = (text) => {
27704
+ if (/^0[xX][0-9a-fA-F]+$/.test(text)) {
27705
+ const n = parseInt(text.slice(2), 16);
27706
+ return Number.isFinite(n) ? n : null;
27707
+ }
27708
+ if (text.length > 1 && /^0[0-7]+$/.test(text)) {
27709
+ const n = parseInt(text, 8);
27710
+ return Number.isFinite(n) ? n : null;
27711
+ }
27712
+ if (text.length > 1 && /^0[0-9]+$/.test(text)) {
27713
+ return null;
27714
+ }
27715
+ if (/^[0-9]+$/.test(text)) {
27716
+ const n = parseInt(text, 10);
27717
+ return Number.isFinite(n) ? n : null;
27718
+ }
27719
+ return null;
27720
+ };
27721
+ var normalizeIPAddress = (host) => {
27722
+ if (typeof host !== "string" || !host || host.indexOf(":") !== -1) {
27723
+ return host;
27724
+ }
27725
+ let h = host;
27726
+ if (h.charAt(0) === "[" && h.charAt(h.length - 1) === "]") {
27727
+ h = h.slice(1, -1);
27728
+ }
27729
+ h = h.replace(/\.+$/, "");
27730
+ if (!/^[0-9.xXa-fA-F]+$/.test(h)) return host;
27731
+ const parts = h.split(".");
27732
+ if (parts.some((p) => p === "")) return host;
27733
+ if (parts.length === 4) {
27734
+ const octets = parts.map(parseIPv4Octet);
27735
+ if (octets.some((n) => n === null || n < 0 || n > 255)) return host;
27736
+ return octets.join(".");
27737
+ }
27738
+ if (parts.length > 4) {
27739
+ return host;
27740
+ }
27741
+ if (parts.length === 1) return host;
27742
+ const literalOctets = parts.slice(0, -1);
27743
+ const tail = parts[parts.length - 1];
27744
+ const tailSlots = 4 - literalOctets.length;
27745
+ const tailValue = parseIPv4Octet(tail);
27746
+ if (tailValue === null) return host;
27747
+ const maxTail = (1 << 8 * tailSlots) - 1;
27748
+ if (tailValue < 0 || tailValue > maxTail) return host;
27749
+ const tailOctets = new Array(tailSlots).fill(0);
27750
+ for (let i = tailSlots - 1, v = tailValue; i >= 0; i--, v >>= 8) {
27751
+ tailOctets[i] = v & 255;
27752
+ }
27753
+ const literal2 = literalOctets.map(parseIPv4Octet);
27754
+ if (literal2.some((n) => n === null || n < 0 || n > 255)) return host;
27755
+ return [...literal2, ...tailOctets].join(".");
27756
+ };
27757
+ var isIPv6ZeroGroup = (group) => /^0{1,4}$/.test(group);
27758
+ var isIPv6Unspecified = (host) => {
27759
+ if (host === "::") return true;
27760
+ const compressionIndex = host.indexOf("::");
27761
+ if (compressionIndex !== -1) {
27762
+ if (compressionIndex !== host.lastIndexOf("::")) return false;
27763
+ const left = host.slice(0, compressionIndex);
27764
+ const right = host.slice(compressionIndex + 2);
27765
+ const leftGroups = left ? left.split(":") : [];
27766
+ const rightGroups = right ? right.split(":") : [];
27767
+ const explicitGroups = leftGroups.length + rightGroups.length;
27768
+ return explicitGroups < 8 && leftGroups.every(isIPv6ZeroGroup) && rightGroups.every(isIPv6ZeroGroup);
27769
+ }
27770
+ const groups = host.split(":");
27771
+ return groups.length === 8 && groups.every(isIPv6ZeroGroup);
27772
+ };
27439
27773
  var isIPv6Loopback = (host) => {
27440
27774
  if (host === "::1") return true;
27441
27775
  const v4MappedDotted = host.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);
@@ -27458,6 +27792,7 @@ var require_axios = __commonJS({
27458
27792
  if (!host) return false;
27459
27793
  if (LOOPBACK_HOSTNAMES.has(host)) return true;
27460
27794
  if (isIPv4Loopback(host)) return true;
27795
+ if (isIPv6Unspecified(host)) return true;
27461
27796
  return isIPv6Loopback(host);
27462
27797
  };
27463
27798
  var DEFAULT_PORTS = {
@@ -27510,7 +27845,12 @@ var require_axios = __commonJS({
27510
27845
  if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
27511
27846
  hostname = hostname.slice(1, -1);
27512
27847
  }
27513
- return unmapIPv4MappedIPv6(hostname.replace(/\.+$/, ""));
27848
+ const trimmed = hostname.replace(/\.+$/, "");
27849
+ const ipv4 = normalizeIPAddress(trimmed);
27850
+ if (ipv4 !== trimmed) {
27851
+ return ipv4;
27852
+ }
27853
+ return unmapIPv4MappedIPv6(trimmed);
27514
27854
  };
27515
27855
  function shouldBypassProxy(location) {
27516
27856
  let parsed;
@@ -27532,6 +27872,9 @@ var require_axios = __commonJS({
27532
27872
  if (!entry) {
27533
27873
  return false;
27534
27874
  }
27875
+ if (entry === "*") {
27876
+ return true;
27877
+ }
27535
27878
  let [entryHost, entryPort] = parseNoProxyEntry(entry);
27536
27879
  entryHost = normalizeNoProxyHost(entryHost);
27537
27880
  if (!entryHost) {
@@ -27623,7 +27966,7 @@ var require_axios = __commonJS({
27623
27966
  }
27624
27967
  const rawLoaded = e.loaded;
27625
27968
  const total = e.lengthComputable ? e.total : void 0;
27626
- const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
27969
+ const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);
27627
27970
  const progressBytes = Math.max(0, loaded - bytesNotified);
27628
27971
  const rate = _speedometer(progressBytes);
27629
27972
  bytesNotified = Math.max(bytesNotified, loaded);
@@ -27649,8 +27992,64 @@ var require_axios = __commonJS({
27649
27992
  loaded
27650
27993
  }), throttled[1]];
27651
27994
  };
27652
- var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
27653
- function estimateDataURLDecodedBytes(url2) {
27995
+ var asyncDecorator = (fn, scheduler = utils$1.asap) => (...args) => scheduler(() => fn(...args));
27996
+ var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
27997
+ var isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
27998
+ var hexValue = (charCode) => charCode <= 57 ? charCode - 48 : (charCode & 223) - 55;
27999
+ var isBase64Char = (charCode) => charCode >= 65 && charCode <= 90 || // A-Z
28000
+ charCode >= 97 && charCode <= 122 || // a-z
28001
+ charCode >= 48 && charCode <= 57 || // 0-9
28002
+ charCode === 43 || // +
28003
+ charCode === 47 || // /
28004
+ charCode === 45 || // - (base64url)
28005
+ charCode === 95;
28006
+ var isBase64Whitespace = (charCode) => charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;
28007
+ var base64Bytes = (significant) => {
28008
+ const groups = Math.floor(significant / 4);
28009
+ const remainder = significant % 4;
28010
+ return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);
28011
+ };
28012
+ var estimateBase64BufferAllocation = (body) => {
28013
+ const len = body.length;
28014
+ let padding = 0;
28015
+ if (len > 0 && body.charCodeAt(len - 1) === 61) {
28016
+ padding++;
28017
+ if (len > 1 && body.charCodeAt(len - 2) === 61) {
28018
+ padding++;
28019
+ }
28020
+ }
28021
+ return Math.floor((len - padding) * 3 / 4);
28022
+ };
28023
+ var estimatePercentDecodedBase64Bytes = (body) => {
28024
+ const len = body.length;
28025
+ let significant = 0;
28026
+ let padding = 0;
28027
+ let invalid = false;
28028
+ for (let i = 0; i < len; i++) {
28029
+ let code = body.charCodeAt(i);
28030
+ if (code === 37 && isPercentEncodedByte(body, i, len)) {
28031
+ code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));
28032
+ i += 2;
28033
+ }
28034
+ if (isBase64Whitespace(code)) {
28035
+ continue;
28036
+ }
28037
+ if (code === 61) {
28038
+ padding++;
28039
+ continue;
28040
+ }
28041
+ if (!isBase64Char(code) || padding > 0) {
28042
+ invalid = true;
28043
+ continue;
28044
+ }
28045
+ significant++;
28046
+ }
28047
+ if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) {
28048
+ return estimateBase64BufferAllocation(body);
28049
+ }
28050
+ return base64Bytes(significant);
28051
+ };
28052
+ var estimateDataURLBytes = (url2, estimateBase64) => {
27654
28053
  if (!url2 || typeof url2 !== "string") return 0;
27655
28054
  if (!url2.startsWith("data:")) return 0;
27656
28055
  const comma = url2.indexOf(",");
@@ -27659,51 +28058,15 @@ var require_axios = __commonJS({
27659
28058
  const body = url2.slice(comma + 1);
27660
28059
  const isBase64 = /;base64/i.test(meta);
27661
28060
  if (isBase64) {
27662
- let effectiveLen = body.length;
27663
- const len = body.length;
27664
- for (let i = 0; i < len; i++) {
27665
- if (body.charCodeAt(i) === 37 && i + 2 < len) {
27666
- const a = body.charCodeAt(i + 1);
27667
- const b = body.charCodeAt(i + 2);
27668
- const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102);
27669
- if (isHex) {
27670
- effectiveLen -= 2;
27671
- i += 2;
27672
- }
27673
- }
27674
- }
27675
- let pad3 = 0;
27676
- let idx = len - 1;
27677
- const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
27678
- body.charCodeAt(j - 1) === 51 && // '3'
27679
- (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
27680
- if (idx >= 0) {
27681
- if (body.charCodeAt(idx) === 61) {
27682
- pad3++;
27683
- idx--;
27684
- } else if (tailIsPct3D(idx)) {
27685
- pad3++;
27686
- idx -= 3;
27687
- }
27688
- }
27689
- if (pad3 === 1 && idx >= 0) {
27690
- if (body.charCodeAt(idx) === 61) {
27691
- pad3++;
27692
- } else if (tailIsPct3D(idx)) {
27693
- pad3++;
27694
- }
27695
- }
27696
- const groups = Math.floor(effectiveLen / 4);
27697
- const bytes2 = groups * 3 - (pad3 || 0);
27698
- return bytes2 > 0 ? bytes2 : 0;
27699
- }
27700
- if (typeof Buffer !== "undefined" && typeof Buffer.byteLength === "function") {
27701
- return Buffer.byteLength(body, "utf8");
28061
+ return estimateBase64(body);
27702
28062
  }
27703
28063
  let bytes = 0;
27704
28064
  for (let i = 0, len = body.length; i < len; i++) {
27705
28065
  const c = body.charCodeAt(i);
27706
- if (c < 128) {
28066
+ if (c === 37 && isPercentEncodedByte(body, i, len)) {
28067
+ bytes += 1;
28068
+ i += 2;
28069
+ } else if (c < 128) {
27707
28070
  bytes += 1;
27708
28071
  } else if (c < 2048) {
27709
28072
  bytes += 2;
@@ -27720,6 +28083,13 @@ var require_axios = __commonJS({
27720
28083
  }
27721
28084
  }
27722
28085
  return bytes;
28086
+ };
28087
+ function estimateDataURLDecodedBytes(url2) {
28088
+ const fragmentIndex = typeof url2 === "string" ? url2.indexOf("#") : -1;
28089
+ return estimateDataURLBytes(fragmentIndex === -1 ? url2 : url2.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes);
28090
+ }
28091
+ function estimateDataURLBufferAllocation(url2) {
28092
+ return estimateDataURLBytes(url2, estimateBase64BufferAllocation);
27723
28093
  }
27724
28094
  var zlibOptions = {
27725
28095
  flush: zlib.constants.Z_SYNC_FLUSH,
@@ -27737,28 +28107,44 @@ var require_axios = __commonJS({
27737
28107
  var isZstdSupported = utils$1.isFunction(zlib.createZstdDecompress);
27738
28108
  var ACCEPT_ENCODING = "gzip, compress, deflate" + (isBrotliSupported ? ", br" : "");
27739
28109
  var ACCEPT_ENCODING_WITH_ZSTD = ACCEPT_ENCODING + (isZstdSupported ? ", zstd" : "");
28110
+ var scheduleProgress = typeof process !== "undefined" && process.nextTick ? process.nextTick.bind(process) : utils$1.asap;
27740
28111
  var {
27741
28112
  http: httpFollow,
27742
28113
  https: httpsFollow
27743
28114
  } = followRedirects;
27744
28115
  var isHttps = /https:?/;
27745
- var FORM_DATA_CONTENT_HEADERS$1 = ["content-type", "content-length"];
27746
- function setFormDataHeaders$1(headers, formHeaders, policy) {
27747
- if (policy !== "content-only") {
27748
- headers.set(formHeaders);
27749
- return;
27750
- }
27751
- Object.entries(formHeaders).forEach(([key, val]) => {
27752
- if (FORM_DATA_CONTENT_HEADERS$1.includes(key.toLowerCase())) {
27753
- headers.set(key, val);
27754
- }
27755
- });
27756
- }
27757
28116
  var kAxiosSocketListener = /* @__PURE__ */ Symbol("axios.http.socketListener");
27758
28117
  var kAxiosCurrentReq = /* @__PURE__ */ Symbol("axios.http.currentReq");
27759
28118
  var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel");
27760
28119
  var tunnelingAgentCache = /* @__PURE__ */ new Map();
27761
28120
  var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap();
28121
+ var NODE_NATIVE_ENV_PROXY_SUPPORT = {
28122
+ 22: 21,
28123
+ 24: 5
28124
+ };
28125
+ function isNodeNativeEnvProxySupported(nodeVersion = process.versions && process.versions.node) {
28126
+ if (!nodeVersion) {
28127
+ return false;
28128
+ }
28129
+ const [major, minor] = nodeVersion.split(".").map((part) => Number(part));
28130
+ if (!Number.isInteger(major) || !Number.isInteger(minor)) {
28131
+ return false;
28132
+ }
28133
+ if (major > 24) {
28134
+ return true;
28135
+ }
28136
+ return NODE_NATIVE_ENV_PROXY_SUPPORT[major] != null && minor >= NODE_NATIVE_ENV_PROXY_SUPPORT[major];
28137
+ }
28138
+ function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.versions.node) {
28139
+ if (!isNodeNativeEnvProxySupported(nodeVersion)) {
28140
+ return false;
28141
+ }
28142
+ const agentOptions = agent && agent.options;
28143
+ return Boolean(agentOptions && utils$1.hasOwnProp(agentOptions, "proxyEnv") && agentOptions.proxyEnv != null);
28144
+ }
28145
+ function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
28146
+ return isHttps.test(options.protocol) ? configHttpsAgent || https.globalAgent : configHttpAgent || http.globalAgent;
28147
+ }
27762
28148
  function getTunnelingAgent(agentOptions, userHttpsAgent) {
27763
28149
  const key = agentOptions.protocol + "//" + agentOptions.hostname + ":" + (agentOptions.port || "") + "#" + (agentOptions.auth || "");
27764
28150
  const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, /* @__PURE__ */ new Map()).get(userHttpsAgent) : tunnelingAgentCache;
@@ -27810,13 +28196,37 @@ var require_axios = __commonJS({
27810
28196
  if (options.beforeRedirects.auth) {
27811
28197
  options.beforeRedirects.auth(options);
27812
28198
  }
28199
+ if (options.beforeRedirects.sensitiveHeaders) {
28200
+ options.beforeRedirects.sensitiveHeaders(options, requestDetails);
28201
+ }
27813
28202
  if (options.beforeRedirects.config) {
27814
28203
  options.beforeRedirects.config(options, responseDetails, requestDetails);
27815
28204
  }
27816
28205
  }
27817
- function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) {
28206
+ function stripMatchingHeaders(headers, sensitiveSet) {
28207
+ if (!headers) {
28208
+ return;
28209
+ }
28210
+ Object.keys(headers).forEach((header) => {
28211
+ if (sensitiveSet.has(header.toLowerCase())) {
28212
+ delete headers[header];
28213
+ }
28214
+ });
28215
+ }
28216
+ function isSameOriginRedirect(redirectOptions, requestDetails) {
28217
+ if (!requestDetails) {
28218
+ return false;
28219
+ }
28220
+ try {
28221
+ return new URL(requestDetails.url).origin === new URL(redirectOptions.href).origin;
28222
+ } catch (e) {
28223
+ return false;
28224
+ }
28225
+ }
28226
+ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent, configHttpAgent) {
27818
28227
  let proxy = configProxy;
27819
- if (!proxy && proxy !== false) {
28228
+ const proxyEnvAgent = getProxyEnvAgent(options, configHttpAgent, configHttpsAgent);
28229
+ if (!proxy && proxy !== false && !isNodeEnvProxyEnabled(proxyEnvAgent)) {
27820
28230
  const proxyUrl = getProxyForUrl(location);
27821
28231
  if (proxyUrl) {
27822
28232
  if (!shouldBypassProxy(location)) {
@@ -27907,7 +28317,7 @@ var require_axios = __commonJS({
27907
28317
  }
27908
28318
  }
27909
28319
  options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
27910
- setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent);
28320
+ setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent, configHttpAgent);
27911
28321
  };
27912
28322
  }
27913
28323
  var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
@@ -27984,7 +28394,7 @@ var require_axios = __commonJS({
27984
28394
  };
27985
28395
  var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) {
27986
28396
  return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
27987
- const own2 = (key) => utils$1.hasOwnProp(config, key) ? config[key] : void 0;
28397
+ const own2 = (key) => utils$1.getSafeProp(config, key);
27988
28398
  const transitional = own2("transitional") || transitionalDefaults;
27989
28399
  let data = own2("data");
27990
28400
  let lookup = own2("lookup");
@@ -27992,9 +28402,17 @@ var require_axios = __commonJS({
27992
28402
  let httpVersion = own2("httpVersion");
27993
28403
  if (httpVersion === void 0) httpVersion = 1;
27994
28404
  let http2Options = own2("http2Options");
28405
+ const httpAgent = own2("httpAgent");
28406
+ const httpsAgent = own2("httpsAgent");
28407
+ const configProxy = own2("proxy");
27995
28408
  const responseType = own2("responseType");
27996
28409
  const responseEncoding = own2("responseEncoding");
27997
- const method = config.method.toUpperCase();
28410
+ const socketPath = own2("socketPath");
28411
+ const method = own2("method").toUpperCase();
28412
+ const maxRedirects = own2("maxRedirects");
28413
+ const maxBodyLength = own2("maxBodyLength");
28414
+ const maxContentLength = own2("maxContentLength");
28415
+ const decompress = own2("decompress");
27998
28416
  let isDone;
27999
28417
  let rejected = false;
28000
28418
  let req;
@@ -28033,9 +28451,11 @@ var require_axios = __commonJS({
28033
28451
  }
28034
28452
  }
28035
28453
  function createTimeoutError() {
28036
- let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
28037
- if (config.timeoutErrorMessage) {
28038
- timeoutErrorMessage = config.timeoutErrorMessage;
28454
+ const configTimeout = own2("timeout");
28455
+ let timeoutErrorMessage = configTimeout ? "timeout of " + configTimeout + "ms exceeded" : "timeout exceeded";
28456
+ const configTimeoutErrorMessage = own2("timeoutErrorMessage");
28457
+ if (configTimeoutErrorMessage) {
28458
+ timeoutErrorMessage = configTimeoutErrorMessage;
28039
28459
  }
28040
28460
  return new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req);
28041
28461
  }
@@ -28076,15 +28496,16 @@ var require_axios = __commonJS({
28076
28496
  onFinished();
28077
28497
  }
28078
28498
  });
28079
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
28080
- const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : void 0);
28499
+ const fullPath = buildFullPath(own2("baseURL"), own2("url"), own2("allowAbsoluteUrls"), config);
28500
+ const urlBase = socketPath ? "http://localhost" : platform.hasBrowserEnv ? platform.origin : void 0;
28501
+ const parsed = new URL(fullPath, urlBase);
28081
28502
  const protocol = parsed.protocol || supportedProtocols[0];
28082
28503
  if (protocol === "data:") {
28083
- if (config.maxContentLength > -1) {
28084
- const dataUrl = String(config.url || fullPath || "");
28085
- const estimated = estimateDataURLDecodedBytes(dataUrl);
28086
- if (estimated > config.maxContentLength) {
28087
- return reject(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config));
28504
+ if (maxContentLength > -1) {
28505
+ const dataUrl = String(own2("url") || fullPath || "");
28506
+ const estimated = estimateDataURLBufferAllocation(dataUrl);
28507
+ if (estimated > maxContentLength) {
28508
+ return reject(new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config));
28088
28509
  }
28089
28510
  }
28090
28511
  let convertedData;
@@ -28097,7 +28518,7 @@ var require_axios = __commonJS({
28097
28518
  });
28098
28519
  }
28099
28520
  try {
28100
- convertedData = fromDataURI(config.url, responseType === "blob", {
28521
+ convertedData = fromDataURI(own2("url"), responseType === "blob", {
28101
28522
  Blob: config.env && config.env.Blob
28102
28523
  });
28103
28524
  } catch (err) {
@@ -28140,7 +28561,7 @@ var require_axios = __commonJS({
28140
28561
  boundary: userBoundary && userBoundary[1] || void 0
28141
28562
  });
28142
28563
  } else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders) && data.getHeaders !== Object.prototype.getHeaders) {
28143
- setFormDataHeaders$1(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
28564
+ setFormDataHeaders(headers, data.getHeaders(), own2("formDataHeaderPolicy"));
28144
28565
  if (!headers.hasContentLength()) {
28145
28566
  try {
28146
28567
  const knownLength = await util.promisify(data.getLength).call(data);
@@ -28162,7 +28583,7 @@ var require_axios = __commonJS({
28162
28583
  return reject(new AxiosError("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", AxiosError.ERR_BAD_REQUEST, config));
28163
28584
  }
28164
28585
  headers.setContentLength(data.length, false);
28165
- if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
28586
+ if (maxBodyLength > -1 && data.length > maxBodyLength) {
28166
28587
  return reject(new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config));
28167
28588
  }
28168
28589
  }
@@ -28182,13 +28603,13 @@ var require_axios = __commonJS({
28182
28603
  data = stream.pipeline([data, new AxiosTransformStream({
28183
28604
  maxRate: utils$1.toFiniteNumber(maxUploadRate)
28184
28605
  })], utils$1.noop);
28185
- onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3))));
28606
+ onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress, scheduleProgress), false, 3))));
28186
28607
  }
28187
28608
  let auth = void 0;
28188
28609
  const configAuth = own2("auth");
28189
28610
  if (configAuth) {
28190
- const username = configAuth.username || "";
28191
- const password = configAuth.password || "";
28611
+ const username = utils$1.getSafeProp(configAuth, "username") || "";
28612
+ const password = utils$1.getSafeProp(configAuth, "password") || "";
28192
28613
  auth = username + ":" + password;
28193
28614
  }
28194
28615
  if (!auth && (parsed.username || parsed.password)) {
@@ -28199,13 +28620,12 @@ var require_axios = __commonJS({
28199
28620
  auth && headers.delete("authorization");
28200
28621
  let path$1;
28201
28622
  try {
28202
- path$1 = buildURL(parsed.pathname + parsed.search, config.params, config.paramsSerializer).replace(/^\?/, "");
28623
+ path$1 = buildURL(parsed.pathname + parsed.search, own2("params"), own2("paramsSerializer")).replace(/^\?/, "");
28203
28624
  } catch (err) {
28204
- const customErr = new Error(err.message);
28205
- customErr.config = config;
28206
- customErr.url = config.url;
28207
- customErr.exists = true;
28208
- return reject(customErr);
28625
+ return reject(AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config, null, null, {
28626
+ url: own2("url"),
28627
+ exists: true
28628
+ }));
28209
28629
  }
28210
28630
  headers.set("Accept-Encoding", utils$1.hasOwnProp(transitional, "advertiseZstdAcceptEncoding") && transitional.advertiseZstdAcceptEncoding === true ? ACCEPT_ENCODING_WITH_ZSTD : ACCEPT_ENCODING, false);
28211
28631
  const options = Object.assign(/* @__PURE__ */ Object.create(null), {
@@ -28213,8 +28633,8 @@ var require_axios = __commonJS({
28213
28633
  method,
28214
28634
  headers: toByteStringHeaderObject(headers),
28215
28635
  agents: {
28216
- http: config.httpAgent,
28217
- https: config.httpsAgent
28636
+ http: httpAgent,
28637
+ https: httpsAgent
28218
28638
  },
28219
28639
  auth,
28220
28640
  protocol,
@@ -28224,7 +28644,6 @@ var require_axios = __commonJS({
28224
28644
  http2Options
28225
28645
  });
28226
28646
  !utils$1.isUndefined(lookup) && (options.lookup = lookup);
28227
- const socketPath = own2("socketPath");
28228
28647
  if (socketPath) {
28229
28648
  if (typeof socketPath !== "string") {
28230
28649
  return reject(new AxiosError("socketPath must be a string", AxiosError.ERR_BAD_OPTION_VALUE, config));
@@ -28242,13 +28661,14 @@ var require_axios = __commonJS({
28242
28661
  } else {
28243
28662
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
28244
28663
  options.port = parsed.port;
28245
- setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, config.httpsAgent);
28664
+ setProxy(options, configProxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, httpsAgent, httpAgent);
28246
28665
  }
28247
28666
  let transport;
28248
28667
  let isNativeTransport = false;
28668
+ let transportEnforcesMaxBodyLength = false;
28249
28669
  const isHttpsRequest = isHttps.test(options.protocol);
28250
28670
  if (options.agent == null) {
28251
- options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
28671
+ options.agent = isHttpsRequest ? httpsAgent : httpAgent;
28252
28672
  }
28253
28673
  if (isHttp2) {
28254
28674
  transport = http2Transport;
@@ -28256,12 +28676,14 @@ var require_axios = __commonJS({
28256
28676
  const configTransport = own2("transport");
28257
28677
  if (configTransport) {
28258
28678
  transport = configTransport;
28259
- } else if (config.maxRedirects === 0) {
28679
+ } else if (maxRedirects === 0) {
28260
28680
  transport = isHttpsRequest ? https : http;
28261
28681
  isNativeTransport = true;
28262
28682
  } else {
28263
- if (config.maxRedirects) {
28264
- options.maxRedirects = config.maxRedirects;
28683
+ transportEnforcesMaxBodyLength = true;
28684
+ options.sensitiveHeaders = [];
28685
+ if (maxRedirects) {
28686
+ options.maxRedirects = maxRedirects;
28265
28687
  }
28266
28688
  const configBeforeRedirect = own2("beforeRedirect");
28267
28689
  if (configBeforeRedirect) {
@@ -28279,11 +28701,32 @@ var require_axios = __commonJS({
28279
28701
  }
28280
28702
  };
28281
28703
  }
28704
+ const sensitiveHeaders = own2("sensitiveHeaders");
28705
+ if (sensitiveHeaders != null) {
28706
+ if (!utils$1.isArray(sensitiveHeaders)) {
28707
+ return reject(new AxiosError("sensitiveHeaders must be an array of strings", AxiosError.ERR_BAD_OPTION_VALUE, config));
28708
+ }
28709
+ const sensitiveSet = /* @__PURE__ */ new Set();
28710
+ for (const header of sensitiveHeaders) {
28711
+ if (!utils$1.isString(header)) {
28712
+ return reject(new AxiosError("sensitiveHeaders must be an array of strings", AxiosError.ERR_BAD_OPTION_VALUE, config));
28713
+ }
28714
+ sensitiveSet.add(header.toLowerCase());
28715
+ }
28716
+ if (sensitiveSet.size) {
28717
+ options.sensitiveHeaders = Array.from(sensitiveSet);
28718
+ options.beforeRedirects.sensitiveHeaders = function beforeRedirectSensitiveHeaders(redirectOptions, requestDetails) {
28719
+ if (!isSameOriginRedirect(redirectOptions, requestDetails)) {
28720
+ stripMatchingHeaders(redirectOptions.headers, sensitiveSet);
28721
+ }
28722
+ };
28723
+ }
28724
+ }
28282
28725
  transport = isHttpsRequest ? httpsFollow : httpFollow;
28283
28726
  }
28284
28727
  }
28285
- if (config.maxBodyLength > -1) {
28286
- options.maxBodyLength = config.maxBodyLength;
28728
+ if (maxBodyLength > -1) {
28729
+ options.maxBodyLength = maxBodyLength;
28287
28730
  } else {
28288
28731
  options.maxBodyLength = Infinity;
28289
28732
  }
@@ -28297,12 +28740,12 @@ var require_axios = __commonJS({
28297
28740
  const transformStream = new AxiosTransformStream({
28298
28741
  maxRate: utils$1.toFiniteNumber(maxDownloadRate)
28299
28742
  });
28300
- onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3))));
28743
+ onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress, scheduleProgress), true, 3))));
28301
28744
  streams.push(transformStream);
28302
28745
  }
28303
28746
  let responseStream = res;
28304
28747
  const lastRequest = res.req || req;
28305
- if (config.decompress !== false && res.headers["content-encoding"]) {
28748
+ if (decompress !== false && res.headers["content-encoding"]) {
28306
28749
  if (method === "HEAD" || res.statusCode === 204) {
28307
28750
  delete res.headers["content-encoding"];
28308
28751
  }
@@ -28343,8 +28786,8 @@ var require_axios = __commonJS({
28343
28786
  request: lastRequest
28344
28787
  };
28345
28788
  if (responseType === "stream") {
28346
- if (config.maxContentLength > -1) {
28347
- const limit = config.maxContentLength;
28789
+ if (maxContentLength > -1) {
28790
+ const limit = maxContentLength;
28348
28791
  const source = responseStream;
28349
28792
  async function* enforceMaxContentLength() {
28350
28793
  let totalResponseBytes = 0;
@@ -28368,10 +28811,10 @@ var require_axios = __commonJS({
28368
28811
  responseStream.on("data", function handleStreamData(chunk) {
28369
28812
  responseBuffer.push(chunk);
28370
28813
  totalResponseBytes += chunk.length;
28371
- if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
28814
+ if (maxContentLength > -1 && totalResponseBytes > maxContentLength) {
28372
28815
  rejected = true;
28373
28816
  responseStream.destroy();
28374
- abort(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
28817
+ abort(new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
28375
28818
  }
28376
28819
  });
28377
28820
  responseStream.on("aborted", function handlerStreamAborted() {
@@ -28421,7 +28864,9 @@ var require_axios = __commonJS({
28421
28864
  });
28422
28865
  const boundSockets = /* @__PURE__ */ new Set();
28423
28866
  req.on("socket", function handleRequestSocket(socket) {
28424
- socket.setKeepAlive(true, 1e3 * 60);
28867
+ if (typeof socket.setKeepAlive === "function") {
28868
+ socket.setKeepAlive(true, 1e3 * 60);
28869
+ }
28425
28870
  if (!socket[kAxiosSocketListener]) {
28426
28871
  socket.on("error", function handleSocketError(err) {
28427
28872
  const current = socket[kAxiosCurrentReq];
@@ -28443,8 +28888,8 @@ var require_axios = __commonJS({
28443
28888
  }
28444
28889
  boundSockets.clear();
28445
28890
  });
28446
- if (config.timeout) {
28447
- const timeout = parseInt(config.timeout, 10);
28891
+ if (own2("timeout")) {
28892
+ const timeout = parseInt(own2("timeout"), 10);
28448
28893
  if (Number.isNaN(timeout)) {
28449
28894
  abort(new AxiosError("error trying to parse `config.timeout` to int", AxiosError.ERR_BAD_OPTION_VALUE, config, req));
28450
28895
  return;
@@ -28476,8 +28921,8 @@ var require_axios = __commonJS({
28476
28921
  }
28477
28922
  });
28478
28923
  let uploadStream = data;
28479
- if (config.maxBodyLength > -1 && config.maxRedirects === 0) {
28480
- const limit = config.maxBodyLength;
28924
+ if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
28925
+ const limit = maxBodyLength;
28481
28926
  let bytesSent = 0;
28482
28927
  uploadStream = stream.pipeline([data, new stream.Transform({
28483
28928
  transform(chunk, _enc, cb) {
@@ -28533,7 +28978,11 @@ var require_axios = __commonJS({
28533
28978
  const cookie = cookies2[i].replace(/^\s+/, "");
28534
28979
  const eq = cookie.indexOf("=");
28535
28980
  if (eq !== -1 && cookie.slice(0, eq) === name) {
28536
- return decodeURIComponent(cookie.slice(eq + 1));
28981
+ try {
28982
+ return decodeURIComponent(cookie.slice(eq + 1));
28983
+ } catch (e) {
28984
+ return cookie.slice(eq + 1);
28985
+ }
28537
28986
  }
28538
28987
  }
28539
28988
  return null;
@@ -28557,7 +29006,14 @@ var require_axios = __commonJS({
28557
29006
  var headersToObject = (thing) => thing instanceof AxiosHeaders ? {
28558
29007
  ...thing
28559
29008
  } : thing;
29009
+ var ownEnumerableKeys = (thing) => {
29010
+ if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
29011
+ return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter((symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable));
29012
+ }
29013
+ return Object.keys(thing);
29014
+ };
28560
29015
  function mergeConfig(config1, config2) {
29016
+ config1 = config1 || {};
28561
29017
  config2 = config2 || {};
28562
29018
  const config = /* @__PURE__ */ Object.create(null);
28563
29019
  Object.defineProperty(config, "hasOwnProperty", {
@@ -28600,6 +29056,23 @@ var require_axios = __commonJS({
28600
29056
  return getMergedValue(void 0, a);
28601
29057
  }
28602
29058
  }
29059
+ function getMergedTransitionalOption(prop) {
29060
+ const transitional2 = utils$1.hasOwnProp(config2, "transitional") ? config2.transitional : void 0;
29061
+ if (!utils$1.isUndefined(transitional2)) {
29062
+ if (utils$1.isPlainObject(transitional2)) {
29063
+ if (utils$1.hasOwnProp(transitional2, prop)) {
29064
+ return transitional2[prop];
29065
+ }
29066
+ } else {
29067
+ return void 0;
29068
+ }
29069
+ }
29070
+ const transitional1 = utils$1.hasOwnProp(config1, "transitional") ? config1.transitional : void 0;
29071
+ if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) {
29072
+ return transitional1[prop];
29073
+ }
29074
+ return void 0;
29075
+ }
28603
29076
  function mergeDirectKeys(a, b, prop) {
28604
29077
  if (utils$1.hasOwnProp(config2, prop)) {
28605
29078
  return getMergedValue(a, b);
@@ -28639,7 +29112,7 @@ var require_axios = __commonJS({
28639
29112
  validateStatus: mergeDirectKeys,
28640
29113
  headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
28641
29114
  };
28642
- utils$1.forEach(Object.keys({
29115
+ utils$1.forEach(ownEnumerableKeys({
28643
29116
  ...config1,
28644
29117
  ...config2
28645
29118
  }), function computeConfigValue(prop) {
@@ -28650,19 +29123,14 @@ var require_axios = __commonJS({
28650
29123
  const configValue = merge2(a, b, prop);
28651
29124
  utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
28652
29125
  });
28653
- return config;
28654
- }
28655
- var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"];
28656
- function setFormDataHeaders(headers, formHeaders, policy) {
28657
- if (policy !== "content-only") {
28658
- headers.set(formHeaders);
28659
- return;
28660
- }
28661
- Object.entries(formHeaders).forEach(([key, val]) => {
28662
- if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
28663
- headers.set(key, val);
29126
+ if (utils$1.hasOwnProp(config2, "validateStatus") && utils$1.isUndefined(config2.validateStatus) && getMergedTransitionalOption("validateStatusUndefinedResolves") === false) {
29127
+ if (utils$1.hasOwnProp(config1, "validateStatus")) {
29128
+ config.validateStatus = getMergedValue(void 0, config1.validateStatus);
29129
+ } else {
29130
+ delete config.validateStatus;
28664
29131
  }
28665
- });
29132
+ }
29133
+ return config;
28666
29134
  }
28667
29135
  var encodeUTF8$1 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16)));
28668
29136
  function resolveConfig(config) {
@@ -28678,9 +29146,15 @@ var require_axios = __commonJS({
28678
29146
  const allowAbsoluteUrls = own2("allowAbsoluteUrls");
28679
29147
  const url2 = own2("url");
28680
29148
  newConfig.headers = headers = AxiosHeaders.from(headers);
28681
- newConfig.url = buildURL(buildFullPath(baseURL, url2, allowAbsoluteUrls), own2("params"), own2("paramsSerializer"));
29149
+ newConfig.url = buildURL(buildFullPath(baseURL, url2, allowAbsoluteUrls, newConfig), own2("params"), own2("paramsSerializer"));
28682
29150
  if (auth) {
28683
- headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? encodeUTF8$1(auth.password) : "")));
29151
+ const username = utils$1.getSafeProp(auth, "username") || "";
29152
+ const password = utils$1.getSafeProp(auth, "password") || "";
29153
+ try {
29154
+ headers.set("Authorization", "Basic " + btoa(username + ":" + (password ? encodeUTF8$1(password) : "")));
29155
+ } catch (e) {
29156
+ throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
29157
+ }
28684
29158
  }
28685
29159
  if (utils$1.isFormData(data)) {
28686
29160
  if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv || utils$1.isReactNative(data)) {
@@ -28827,6 +29301,7 @@ var require_axios = __commonJS({
28827
29301
  const protocol = parseProtocol(_config.url);
28828
29302
  if (protocol && !platform.protocols.includes(protocol)) {
28829
29303
  reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
29304
+ done();
28830
29305
  return;
28831
29306
  }
28832
29307
  request.send(requestData || null);
@@ -28862,7 +29337,18 @@ var require_axios = __commonJS({
28862
29337
  });
28863
29338
  signals = null;
28864
29339
  };
28865
- signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
29340
+ signals.forEach((signal2) => {
29341
+ if (aborted) {
29342
+ return;
29343
+ }
29344
+ if (signal2.aborted) {
29345
+ onabort.call(signal2);
29346
+ return;
29347
+ }
29348
+ signal2.addEventListener("abort", onabort, {
29349
+ once: true
29350
+ });
29351
+ });
28866
29352
  const {
28867
29353
  signal
28868
29354
  } = controller;
@@ -29092,12 +29578,14 @@ var require_axios = __commonJS({
29092
29578
  composedSignal.unsubscribe();
29093
29579
  });
29094
29580
  let requestContentLength;
29581
+ let pendingBodyError = null;
29582
+ const maxBodyLengthError = () => new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, request);
29095
29583
  try {
29096
29584
  let auth = void 0;
29097
29585
  const configAuth = own2("auth");
29098
29586
  if (configAuth) {
29099
- const username = configAuth.username || "";
29100
- const password = configAuth.password || "";
29587
+ const username = utils$1.getSafeProp(configAuth, "username") || "";
29588
+ const password = utils$1.getSafeProp(configAuth, "password") || "";
29101
29589
  auth = {
29102
29590
  username,
29103
29591
  password
@@ -29130,25 +29618,42 @@ var require_axios = __commonJS({
29130
29618
  }
29131
29619
  }
29132
29620
  if (hasMaxBodyLength && method !== "get" && method !== "head") {
29133
- const outboundLength = await resolveBodyLength(headers, data);
29134
- if (typeof outboundLength === "number" && isFinite(outboundLength) && outboundLength > maxBodyLength) {
29135
- throw new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, request);
29621
+ const outboundLength = await getBodyLength(data);
29622
+ if (typeof outboundLength === "number" && isFinite(outboundLength)) {
29623
+ requestContentLength = outboundLength;
29624
+ if (outboundLength > maxBodyLength) {
29625
+ throw maxBodyLengthError();
29626
+ }
29136
29627
  }
29137
29628
  }
29138
- if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
29139
- let _request = new Request(url2, {
29140
- method: "POST",
29141
- body: data,
29142
- duplex: "half"
29143
- });
29144
- let contentTypeHeader;
29145
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
29146
- headers.setContentType(contentTypeHeader);
29629
+ const mustEnforceStreamBody = hasMaxBodyLength && (utils$1.isReadableStream(data) || utils$1.isStream(data));
29630
+ const trackRequestStream = (stream2, onProgress, flush) => trackStream(stream2, DEFAULT_CHUNK_SIZE, (loadedBytes) => {
29631
+ if (hasMaxBodyLength && loadedBytes > maxBodyLength) {
29632
+ throw pendingBodyError = maxBodyLengthError();
29147
29633
  }
29148
- if (_request.body) {
29149
- const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
29150
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
29634
+ onProgress && onProgress(loadedBytes);
29635
+ }, flush);
29636
+ if (supportsRequestStream && method !== "get" && method !== "head" && (onUploadProgress || mustEnforceStreamBody)) {
29637
+ requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength;
29638
+ if (requestContentLength !== 0 || mustEnforceStreamBody) {
29639
+ let _request = new Request(url2, {
29640
+ method: "POST",
29641
+ body: data,
29642
+ duplex: "half"
29643
+ });
29644
+ let contentTypeHeader;
29645
+ if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
29646
+ headers.setContentType(contentTypeHeader);
29647
+ }
29648
+ if (_request.body) {
29649
+ const [onProgress, flush] = onUploadProgress && progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress))) || [];
29650
+ data = trackRequestStream(_request.body, onProgress, flush);
29651
+ }
29151
29652
  }
29653
+ } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== "get" && method !== "head") {
29654
+ data = trackRequestStream(data);
29655
+ } else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== "get" && method !== "head") {
29656
+ throw new AxiosError("Stream request bodies are not supported by the current fetch implementation", AxiosError.ERR_NOT_SUPPORT, config, request);
29152
29657
  }
29153
29658
  if (!utils$1.isString(withCredentials)) {
29154
29659
  withCredentials = withCredentials ? "include" : "omit";
@@ -29172,8 +29677,9 @@ var require_axios = __commonJS({
29172
29677
  };
29173
29678
  request = isRequestSupported && new Request(url2, resolvedOptions);
29174
29679
  let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions));
29680
+ const responseHeaders = AxiosHeaders.from(response.headers);
29175
29681
  if (hasMaxContentLength) {
29176
- const declaredLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
29682
+ const declaredLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
29177
29683
  if (declaredLength != null && declaredLength > maxContentLength) {
29178
29684
  throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request);
29179
29685
  }
@@ -29184,7 +29690,7 @@ var require_axios = __commonJS({
29184
29690
  ["status", "statusText", "headers"].forEach((prop) => {
29185
29691
  options[prop] = response[prop];
29186
29692
  });
29187
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
29693
+ const responseContentLength = utils$1.toFiniteNumber(responseHeaders.getContentLength());
29188
29694
  const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
29189
29695
  let bytesRead = 0;
29190
29696
  const onChunkProgress = (loadedBytes) => {
@@ -29235,13 +29741,35 @@ var require_axios = __commonJS({
29235
29741
  const canceledError = composedSignal.reason;
29236
29742
  canceledError.config = config;
29237
29743
  request && (canceledError.request = request);
29238
- err !== canceledError && (canceledError.cause = err);
29744
+ if (err !== canceledError) {
29745
+ Object.defineProperty(canceledError, "cause", {
29746
+ __proto__: null,
29747
+ value: err,
29748
+ writable: true,
29749
+ enumerable: false,
29750
+ configurable: true
29751
+ });
29752
+ }
29239
29753
  throw canceledError;
29240
29754
  }
29755
+ if (pendingBodyError) {
29756
+ request && !pendingBodyError.request && (pendingBodyError.request = request);
29757
+ throw pendingBodyError;
29758
+ }
29759
+ if (err instanceof AxiosError) {
29760
+ request && !err.request && (err.request = request);
29761
+ throw err;
29762
+ }
29241
29763
  if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
29242
- throw Object.assign(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response), {
29243
- cause: err.cause || err
29764
+ const networkError = new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response);
29765
+ Object.defineProperty(networkError, "cause", {
29766
+ __proto__: null,
29767
+ value: err.cause || err,
29768
+ writable: true,
29769
+ enumerable: false,
29770
+ configurable: true
29244
29771
  });
29772
+ throw networkError;
29245
29773
  }
29246
29774
  throw AxiosError.from(err, err && err.code, config, request, err && err.response);
29247
29775
  }
@@ -29316,7 +29844,7 @@ var require_axios = __commonJS({
29316
29844
  if (!adapter) {
29317
29845
  const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
29318
29846
  let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
29319
- throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, "ERR_NOT_SUPPORT");
29847
+ throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, AxiosError.ERR_NOT_SUPPORT);
29320
29848
  }
29321
29849
  return adapter;
29322
29850
  }
@@ -29403,7 +29931,7 @@ var require_axios = __commonJS({
29403
29931
  };
29404
29932
  };
29405
29933
  function assertOptions(options, schema, allowUnknown) {
29406
- if (typeof options !== "object") {
29934
+ if (typeof options !== "object" || options === null) {
29407
29935
  throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
29408
29936
  }
29409
29937
  const keys = Object.keys(options);
@@ -29495,7 +30023,8 @@ var require_axios = __commonJS({
29495
30023
  forcedJSONParsing: validators.transitional(validators.boolean),
29496
30024
  clarifyTimeoutError: validators.transitional(validators.boolean),
29497
30025
  legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
29498
- advertiseZstdAcceptEncoding: validators.transitional(validators.boolean)
30026
+ advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),
30027
+ validateStatusUndefinedResolves: validators.transitional(validators.boolean)
29499
30028
  }, false);
29500
30029
  }
29501
30030
  if (paramsSerializer != null) {
@@ -29565,16 +30094,29 @@ var require_axios = __commonJS({
29565
30094
  const onFulfilled = requestInterceptorChain[i++];
29566
30095
  const onRejected = requestInterceptorChain[i++];
29567
30096
  try {
29568
- newConfig = onFulfilled(newConfig);
30097
+ newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;
29569
30098
  } catch (error) {
29570
- onRejected.call(this, error);
30099
+ if (!onRejected) {
30100
+ promise = Promise.reject(error);
30101
+ break;
30102
+ }
30103
+ try {
30104
+ const rejectedResult = onRejected.call(this, error);
30105
+ if (utils$1.isThenable(rejectedResult)) {
30106
+ promise = Promise.resolve(rejectedResult).then(() => dispatchRequest.call(this, newConfig));
30107
+ }
30108
+ } catch (rejectedError) {
30109
+ promise = Promise.reject(rejectedError);
30110
+ }
29571
30111
  break;
29572
30112
  }
29573
30113
  }
29574
- try {
29575
- promise = dispatchRequest.call(this, newConfig);
29576
- } catch (error) {
29577
- return Promise.reject(error);
30114
+ if (!promise) {
30115
+ try {
30116
+ promise = dispatchRequest.call(this, newConfig);
30117
+ } catch (error) {
30118
+ promise = Promise.reject(error);
30119
+ }
29578
30120
  }
29579
30121
  i = 0;
29580
30122
  len = responseInterceptorChain.length;
@@ -29585,7 +30127,7 @@ var require_axios = __commonJS({
29585
30127
  }
29586
30128
  getUri(config) {
29587
30129
  config = mergeConfig(this.defaults, config);
29588
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
30130
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);
29589
30131
  return buildURL(fullPath, config.params, config.paramsSerializer);
29590
30132
  }
29591
30133
  };
@@ -29594,7 +30136,7 @@ var require_axios = __commonJS({
29594
30136
  return this.request(mergeConfig(config || {}, {
29595
30137
  method,
29596
30138
  url: url2,
29597
- data: (config || {}).data
30139
+ data: config && utils$1.hasOwnProp(config, "data") ? config.data : void 0
29598
30140
  }));
29599
30141
  };
29600
30142
  });
@@ -29783,6 +30325,7 @@ var require_axios = __commonJS({
29783
30325
  LoopDetected: 508,
29784
30326
  NotExtended: 510,
29785
30327
  NetworkAuthenticationRequired: 511,
30328
+ WebServerReturnsAnUnknownError: 520,
29786
30329
  WebServerIsDown: 521,
29787
30330
  ConnectionTimedOut: 522,
29788
30331
  OriginIsUnreachable: 523,
@@ -31182,6 +31725,11 @@ function mapToolChoice(toolChoice) {
31182
31725
  return void 0;
31183
31726
  }
31184
31727
  }
31728
+ function mergeRequestConfig(requestConfig, abortSignal) {
31729
+ const { signal: _dropped, ...rest } = requestConfig ?? {};
31730
+ if (abortSignal) return { ...rest, signal: abortSignal };
31731
+ return Object.keys(rest).length > 0 ? rest : void 0;
31732
+ }
31185
31733
  function normalizeEmbedding(embedding) {
31186
31734
  if (Array.isArray(embedding)) {
31187
31735
  return embedding;
@@ -31248,7 +31796,7 @@ var VERSION;
31248
31796
  var init_version = __esm({
31249
31797
  "src/version.ts"() {
31250
31798
  "use strict";
31251
- VERSION = true ? "4.7.1" : "0.0.0-test";
31799
+ VERSION = true ? "4.9.0" : "0.0.0-test";
31252
31800
  }
31253
31801
  });
31254
31802
 
@@ -31283,7 +31831,13 @@ var init_base_embedding_model_strategy = __esm({
31283
31831
  const warnings = [];
31284
31832
  this.resolveWarnings(settings, warnings);
31285
31833
  const client = this.createClient(config, settings, embeddingOptions);
31286
- const response = await this.executeCall(client, values, embeddingType, abortSignal);
31834
+ const response = await this.executeCall(
31835
+ client,
31836
+ values,
31837
+ embeddingType,
31838
+ abortSignal,
31839
+ config.requestConfig
31840
+ );
31287
31841
  const embeddings = this.extractEmbeddings(response);
31288
31842
  const totalTokens = this.extractTokenCount(response);
31289
31843
  const { headers: responseHeaders, requestId } = this.extractResponseMetadata(response);
@@ -31367,9 +31921,9 @@ var init_foundation_models_embedding_model_strategy = __esm({
31367
31921
  mergedParams: hasKeys(mergedParams) ? mergedParams : void 0
31368
31922
  };
31369
31923
  }
31370
- async executeCall(clientWithContext, values, _embeddingType, abortSignal) {
31924
+ async executeCall(clientWithContext, values, _embeddingType, abortSignal, requestConfig) {
31371
31925
  const request = this.buildRequest(values, clientWithContext.mergedParams);
31372
- return clientWithContext.client.run(request, abortSignal ? { signal: abortSignal } : void 0);
31926
+ return clientWithContext.client.run(request, mergeRequestConfig(requestConfig, abortSignal));
31373
31927
  }
31374
31928
  extractEmbeddings(response) {
31375
31929
  const embeddingData = response._data.data;
@@ -31612,10 +32166,10 @@ var init_orchestration_embedding_model_strategy = __esm({
31612
32166
  };
31613
32167
  return new this.ClientClass(moduleConfig, config.deploymentConfig, config.destination);
31614
32168
  }
31615
- async executeCall(client, values, embeddingType, abortSignal) {
32169
+ async executeCall(client, values, embeddingType, abortSignal, requestConfig) {
31616
32170
  return client.embed(
31617
32171
  { input: values, type: embeddingType },
31618
- abortSignal ? { signal: abortSignal } : void 0
32172
+ mergeRequestConfig(requestConfig, abortSignal)
31619
32173
  );
31620
32174
  }
31621
32175
  extractEmbeddings(response) {
@@ -31657,7 +32211,7 @@ var init_base_language_model_strategy = __esm({
31657
32211
  * @internal
31658
32212
  */
31659
32213
  static COMMON_PARAM_MAPPINGS = [
31660
- { camelCaseKey: "maxTokens", optionKey: "maxOutputTokens", outputKey: "max_tokens" },
32214
+ { camelCaseKey: "maxTokens", optionKey: "maxOutputTokens", outputKey: "max_completion_tokens" },
31661
32215
  { camelCaseKey: "temperature", optionKey: "temperature", outputKey: "temperature" },
31662
32216
  { camelCaseKey: "topP", optionKey: "topP", outputKey: "top_p" },
31663
32217
  {
@@ -31678,7 +32232,12 @@ var init_base_language_model_strategy = __esm({
31678
32232
  const commonParts = await this.buildCommonParts(config, settings, options);
31679
32233
  const { request, warnings } = this.buildRequest(config, settings, options, commonParts);
31680
32234
  const client = this.createClient(config, settings, commonParts);
31681
- const response = await this.executeApiCall(client, request, options.abortSignal ?? void 0);
32235
+ const response = await this.executeApiCall(
32236
+ client,
32237
+ request,
32238
+ options.abortSignal ?? void 0,
32239
+ config.requestConfig
32240
+ );
31682
32241
  return buildGenerateResult({
31683
32242
  modelId: config.modelId,
31684
32243
  providerName: commonParts.providerName,
@@ -31706,7 +32265,8 @@ var init_base_language_model_strategy = __esm({
31706
32265
  client,
31707
32266
  request,
31708
32267
  options.abortSignal ?? void 0,
31709
- settings
32268
+ settings,
32269
+ config.requestConfig
31710
32270
  );
31711
32271
  const idGenerator = new StreamIdGenerator();
31712
32272
  const responseId = streamResponse.responseId ?? idGenerator.generateResponseId();
@@ -31922,8 +32482,8 @@ var init_foundation_models_language_model_strategy = __esm({
31922
32482
  const modelDeployment = buildModelDeployment(config, settings.modelVersion);
31923
32483
  return new this.ClientClass(modelDeployment, config.destination);
31924
32484
  }
31925
- async executeApiCall(client, request, abortSignal) {
31926
- const response = await client.run(request, abortSignal ? { signal: abortSignal } : void 0);
32485
+ async executeApiCall(client, request, abortSignal, requestConfig) {
32486
+ const response = await client.run(request, mergeRequestConfig(requestConfig, abortSignal));
31927
32487
  const { requestId, responseId } = this.extractMetadata(response);
31928
32488
  return {
31929
32489
  getContent: () => response.getContent(),
@@ -31936,8 +32496,12 @@ var init_foundation_models_language_model_strategy = __esm({
31936
32496
  responseId
31937
32497
  };
31938
32498
  }
31939
- async executeStreamCall(client, request, abortSignal, _settings) {
31940
- const streamResponse = await client.stream(request, abortSignal);
32499
+ async executeStreamCall(client, request, abortSignal, _settings, requestConfig) {
32500
+ const streamResponse = await client.stream(
32501
+ request,
32502
+ abortSignal,
32503
+ mergeRequestConfig(requestConfig, void 0)
32504
+ );
31941
32505
  const { requestId, responseHeaders, responseId } = this.extractMetadata(streamResponse);
31942
32506
  return {
31943
32507
  getFinishReason: () => streamResponse.getFinishReason(),
@@ -32083,10 +32647,10 @@ var init_orchestration_language_model_strategy = __esm({
32083
32647
  }
32084
32648
  return new this.ClientClass(clientConfig, config.deploymentConfig, config.destination);
32085
32649
  }
32086
- async executeApiCall(client, request, abortSignal) {
32650
+ async executeApiCall(client, request, abortSignal, requestConfig) {
32087
32651
  const response = await client.chatCompletion(
32088
32652
  request,
32089
- abortSignal ? { signal: abortSignal } : void 0
32653
+ mergeRequestConfig(requestConfig, abortSignal)
32090
32654
  );
32091
32655
  const { requestId, responseId } = this.extractMetadata(response);
32092
32656
  return {
@@ -32102,9 +32666,14 @@ var init_orchestration_language_model_strategy = __esm({
32102
32666
  responseId
32103
32667
  };
32104
32668
  }
32105
- async executeStreamCall(client, request, abortSignal, settings) {
32669
+ async executeStreamCall(client, request, abortSignal, settings, requestConfig) {
32106
32670
  const sdkStreamOptions = this.buildSdkStreamOptions(settings.streamOptions);
32107
- const streamResponse = await client.stream(request, abortSignal, sdkStreamOptions);
32671
+ const streamResponse = await client.stream(
32672
+ request,
32673
+ abortSignal,
32674
+ sdkStreamOptions,
32675
+ mergeRequestConfig(requestConfig, void 0)
32676
+ );
32108
32677
  const { requestId, responseHeaders, responseId } = this.extractMetadata(streamResponse);
32109
32678
  return {
32110
32679
  getCitations: () => streamResponse.getCitations?.(),
@@ -32768,7 +33337,8 @@ var SAPAIEmbeddingModel = class {
32768
33337
  deploymentConfig: this.config.deploymentConfig,
32769
33338
  destination: this.config.destination,
32770
33339
  modelId: this.modelId,
32771
- provider: this.config.provider
33340
+ provider: this.config.provider,
33341
+ requestConfig: this.config.requestConfig
32772
33342
  };
32773
33343
  return strategy.doEmbed(strategyConfig, this.settings, options, this.maxEmbeddingsPerCall);
32774
33344
  }
@@ -32909,7 +33479,8 @@ var SAPAILanguageModel = class {
32909
33479
  deploymentConfig: this.config.deploymentConfig,
32910
33480
  destination: this.config.destination,
32911
33481
  modelId: this.modelId,
32912
- provider: this.config.provider
33482
+ provider: this.config.provider,
33483
+ requestConfig: this.config.requestConfig
32913
33484
  };
32914
33485
  return { strategy, strategyConfig };
32915
33486
  }
@@ -33007,7 +33578,8 @@ function createSAPAIProvider(options = {}) {
33007
33578
  deploymentConfig,
33008
33579
  destination: options.destination,
33009
33580
  provider: `${providerName}.chat`,
33010
- providerApi
33581
+ providerApi,
33582
+ requestConfig: options.requestConfig
33011
33583
  });
33012
33584
  };
33013
33585
  const createEmbeddingModel = (modelId, settings = {}) => {
@@ -33023,7 +33595,8 @@ function createSAPAIProvider(options = {}) {
33023
33595
  deploymentConfig,
33024
33596
  destination: options.destination,
33025
33597
  provider: `${providerName}.embedding`,
33026
- providerApi
33598
+ providerApi,
33599
+ requestConfig: options.requestConfig
33027
33600
  });
33028
33601
  };
33029
33602
  const provider = function(modelId, settings) {
@@ -33115,6 +33688,6 @@ mime-types/index.js:
33115
33688
  *)
33116
33689
 
33117
33690
  axios/dist/node/axios.cjs:
33118
- (*! Axios v1.17.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
33691
+ (*! Axios v1.19.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
33119
33692
  */
33120
33693
  //# sourceMappingURL=index-v2.cjs.map