@jerome-benoit/sap-ai-provider 4.6.1 → 4.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-HJZCRF7J.js → chunk-5FHTB5RT.js} +3 -3
- package/dist/{chunk-I5ZTK7M5.js → chunk-7ZKPZONG.js} +629 -770
- package/dist/chunk-7ZKPZONG.js.map +1 -0
- package/dist/{chunk-DQXZH6CW.js → chunk-IIBSUXGT.js} +3 -2
- package/dist/chunk-IIBSUXGT.js.map +1 -0
- package/dist/{chunk-IAXILSPQ.js → chunk-RHZV73MM.js} +49 -4
- package/dist/chunk-RHZV73MM.js.map +1 -0
- package/dist/{chunk-U2HDUNO7.js → chunk-WLW2XIIX.js} +2 -2
- package/dist/chunk-WLW2XIIX.js.map +1 -0
- package/dist/{foundation-models-embedding-model-strategy-C4SXGZ66.js → foundation-models-embedding-model-strategy-FHJ3PW42.js} +4 -4
- package/dist/{foundation-models-language-model-strategy-3D4V6PSZ.js → foundation-models-language-model-strategy-XQ24PJK4.js} +5 -5
- package/dist/index.cjs +674 -771
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/{orchestration-embedding-model-strategy-7FY6NJD7.js → orchestration-embedding-model-strategy-FKAUQZH2.js} +4 -4
- package/dist/{orchestration-language-model-strategy-FI5HLHWP.js → orchestration-language-model-strategy-TSZQCLG3.js} +5 -5
- package/package.json +6 -6
- package/dist/chunk-DQXZH6CW.js.map +0 -1
- package/dist/chunk-I5ZTK7M5.js.map +0 -1
- package/dist/chunk-IAXILSPQ.js.map +0 -1
- package/dist/chunk-U2HDUNO7.js.map +0 -1
- /package/dist/{chunk-HJZCRF7J.js.map → chunk-5FHTB5RT.js.map} +0 -0
- /package/dist/{foundation-models-embedding-model-strategy-C4SXGZ66.js.map → foundation-models-embedding-model-strategy-FHJ3PW42.js.map} +0 -0
- /package/dist/{foundation-models-language-model-strategy-3D4V6PSZ.js.map → foundation-models-language-model-strategy-XQ24PJK4.js.map} +0 -0
- /package/dist/{orchestration-embedding-model-strategy-7FY6NJD7.js.map → orchestration-embedding-model-strategy-FKAUQZH2.js.map} +0 -0
- /package/dist/{orchestration-language-model-strategy-FI5HLHWP.js.map → orchestration-language-model-strategy-TSZQCLG3.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -145,7 +145,8 @@ function convertToSAPMessages(prompt, options = {}) {
|
|
|
145
145
|
} else {
|
|
146
146
|
contentParts.push({
|
|
147
147
|
file: {
|
|
148
|
-
file_data: fileDataUrl
|
|
148
|
+
file_data: fileDataUrl,
|
|
149
|
+
...part.filename ? { filename: part.filename } : {}
|
|
149
150
|
},
|
|
150
151
|
type: "file"
|
|
151
152
|
});
|
|
@@ -25437,76 +25438,6 @@ var require_form_data = __commonJS({
|
|
|
25437
25438
|
}
|
|
25438
25439
|
});
|
|
25439
25440
|
|
|
25440
|
-
// node_modules/proxy-from-env/index.js
|
|
25441
|
-
var require_proxy_from_env = __commonJS({
|
|
25442
|
-
"node_modules/proxy-from-env/index.js"(exports2) {
|
|
25443
|
-
"use strict";
|
|
25444
|
-
var parseUrl = require("url").parse;
|
|
25445
|
-
var DEFAULT_PORTS = {
|
|
25446
|
-
ftp: 21,
|
|
25447
|
-
gopher: 70,
|
|
25448
|
-
http: 80,
|
|
25449
|
-
https: 443,
|
|
25450
|
-
ws: 80,
|
|
25451
|
-
wss: 443
|
|
25452
|
-
};
|
|
25453
|
-
var stringEndsWith = String.prototype.endsWith || function(s) {
|
|
25454
|
-
return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
|
|
25455
|
-
};
|
|
25456
|
-
function getProxyForUrl(url) {
|
|
25457
|
-
var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {};
|
|
25458
|
-
var proto = parsedUrl.protocol;
|
|
25459
|
-
var hostname = parsedUrl.host;
|
|
25460
|
-
var port = parsedUrl.port;
|
|
25461
|
-
if (typeof hostname !== "string" || !hostname || typeof proto !== "string") {
|
|
25462
|
-
return "";
|
|
25463
|
-
}
|
|
25464
|
-
proto = proto.split(":", 1)[0];
|
|
25465
|
-
hostname = hostname.replace(/:\d*$/, "");
|
|
25466
|
-
port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
|
|
25467
|
-
if (!shouldProxy(hostname, port)) {
|
|
25468
|
-
return "";
|
|
25469
|
-
}
|
|
25470
|
-
var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
|
|
25471
|
-
if (proxy && proxy.indexOf("://") === -1) {
|
|
25472
|
-
proxy = proto + "://" + proxy;
|
|
25473
|
-
}
|
|
25474
|
-
return proxy;
|
|
25475
|
-
}
|
|
25476
|
-
function shouldProxy(hostname, port) {
|
|
25477
|
-
var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
|
|
25478
|
-
if (!NO_PROXY) {
|
|
25479
|
-
return true;
|
|
25480
|
-
}
|
|
25481
|
-
if (NO_PROXY === "*") {
|
|
25482
|
-
return false;
|
|
25483
|
-
}
|
|
25484
|
-
return NO_PROXY.split(/[,\s]/).every(function(proxy) {
|
|
25485
|
-
if (!proxy) {
|
|
25486
|
-
return true;
|
|
25487
|
-
}
|
|
25488
|
-
var parsedProxy = proxy.match(/^(.+):(\d+)$/);
|
|
25489
|
-
var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
|
|
25490
|
-
var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
|
|
25491
|
-
if (parsedProxyPort && parsedProxyPort !== port) {
|
|
25492
|
-
return true;
|
|
25493
|
-
}
|
|
25494
|
-
if (!/^[.*]/.test(parsedProxyHostname)) {
|
|
25495
|
-
return hostname !== parsedProxyHostname;
|
|
25496
|
-
}
|
|
25497
|
-
if (parsedProxyHostname.charAt(0) === "*") {
|
|
25498
|
-
parsedProxyHostname = parsedProxyHostname.slice(1);
|
|
25499
|
-
}
|
|
25500
|
-
return !stringEndsWith.call(hostname, parsedProxyHostname);
|
|
25501
|
-
});
|
|
25502
|
-
}
|
|
25503
|
-
function getEnv(key) {
|
|
25504
|
-
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
25505
|
-
}
|
|
25506
|
-
exports2.getProxyForUrl = getProxyForUrl;
|
|
25507
|
-
}
|
|
25508
|
-
});
|
|
25509
|
-
|
|
25510
25441
|
// node_modules/debug/src/common.js
|
|
25511
25442
|
var require_common2 = __commonJS({
|
|
25512
25443
|
"node_modules/debug/src/common.js"(exports2, module2) {
|
|
@@ -26568,7 +26499,6 @@ var require_axios = __commonJS({
|
|
|
26568
26499
|
var FormData$1 = require_form_data();
|
|
26569
26500
|
var crypto2 = require("crypto");
|
|
26570
26501
|
var url = require("url");
|
|
26571
|
-
var proxyFromEnv = require_proxy_from_env();
|
|
26572
26502
|
var http = require("http");
|
|
26573
26503
|
var https = require("https");
|
|
26574
26504
|
var http2 = require("http2");
|
|
@@ -26577,28 +26507,21 @@ var require_axios = __commonJS({
|
|
|
26577
26507
|
var zlib = require("zlib");
|
|
26578
26508
|
var stream = require("stream");
|
|
26579
26509
|
var events = require("events");
|
|
26580
|
-
function _interopDefaultLegacy(e) {
|
|
26581
|
-
return e && typeof e === "object" && "default" in e ? e : { "default": e };
|
|
26582
|
-
}
|
|
26583
|
-
var FormData__default = /* @__PURE__ */ _interopDefaultLegacy(FormData$1);
|
|
26584
|
-
var crypto__default = /* @__PURE__ */ _interopDefaultLegacy(crypto2);
|
|
26585
|
-
var url__default = /* @__PURE__ */ _interopDefaultLegacy(url);
|
|
26586
|
-
var proxyFromEnv__default = /* @__PURE__ */ _interopDefaultLegacy(proxyFromEnv);
|
|
26587
|
-
var http__default = /* @__PURE__ */ _interopDefaultLegacy(http);
|
|
26588
|
-
var https__default = /* @__PURE__ */ _interopDefaultLegacy(https);
|
|
26589
|
-
var http2__default = /* @__PURE__ */ _interopDefaultLegacy(http2);
|
|
26590
|
-
var util__default = /* @__PURE__ */ _interopDefaultLegacy(util);
|
|
26591
|
-
var followRedirects__default = /* @__PURE__ */ _interopDefaultLegacy(followRedirects);
|
|
26592
|
-
var zlib__default = /* @__PURE__ */ _interopDefaultLegacy(zlib);
|
|
26593
|
-
var stream__default = /* @__PURE__ */ _interopDefaultLegacy(stream);
|
|
26594
26510
|
function bind(fn, thisArg) {
|
|
26595
26511
|
return function wrap() {
|
|
26596
26512
|
return fn.apply(thisArg, arguments);
|
|
26597
26513
|
};
|
|
26598
26514
|
}
|
|
26599
|
-
var {
|
|
26600
|
-
|
|
26601
|
-
|
|
26515
|
+
var {
|
|
26516
|
+
toString: toString2
|
|
26517
|
+
} = Object.prototype;
|
|
26518
|
+
var {
|
|
26519
|
+
getPrototypeOf
|
|
26520
|
+
} = Object;
|
|
26521
|
+
var {
|
|
26522
|
+
iterator,
|
|
26523
|
+
toStringTag
|
|
26524
|
+
} = Symbol;
|
|
26602
26525
|
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
26603
26526
|
const str = toString2.call(thing);
|
|
26604
26527
|
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
|
|
@@ -26608,7 +26531,9 @@ var require_axios = __commonJS({
|
|
|
26608
26531
|
return (thing) => kindOf(thing) === type;
|
|
26609
26532
|
};
|
|
26610
26533
|
var typeOfTest = (type) => (thing) => typeof thing === type;
|
|
26611
|
-
var {
|
|
26534
|
+
var {
|
|
26535
|
+
isArray
|
|
26536
|
+
} = Array;
|
|
26612
26537
|
var isUndefined = typeOfTest("undefined");
|
|
26613
26538
|
function isBuffer(val) {
|
|
26614
26539
|
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
@@ -26669,16 +26594,13 @@ var require_axios = __commonJS({
|
|
|
26669
26594
|
kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
|
|
26670
26595
|
};
|
|
26671
26596
|
var isURLSearchParams = kindOfTest("URLSearchParams");
|
|
26672
|
-
var [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
26673
|
-
"ReadableStream",
|
|
26674
|
-
"Request",
|
|
26675
|
-
"Response",
|
|
26676
|
-
"Headers"
|
|
26677
|
-
].map(kindOfTest);
|
|
26597
|
+
var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
26678
26598
|
var trim2 = (str) => {
|
|
26679
26599
|
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
26680
26600
|
};
|
|
26681
|
-
function forEach(obj, fn, {
|
|
26601
|
+
function forEach(obj, fn, {
|
|
26602
|
+
allOwnKeys = false
|
|
26603
|
+
} = {}) {
|
|
26682
26604
|
if (obj === null || typeof obj === "undefined") {
|
|
26683
26605
|
return;
|
|
26684
26606
|
}
|
|
@@ -26726,7 +26648,10 @@ var require_axios = __commonJS({
|
|
|
26726
26648
|
})();
|
|
26727
26649
|
var isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
26728
26650
|
function merge() {
|
|
26729
|
-
const {
|
|
26651
|
+
const {
|
|
26652
|
+
caseless,
|
|
26653
|
+
skipUndefined
|
|
26654
|
+
} = isContextDefined(this) && this || {};
|
|
26730
26655
|
const result = {};
|
|
26731
26656
|
const assignValue = (val, key) => {
|
|
26732
26657
|
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
@@ -26748,28 +26673,28 @@ var require_axios = __commonJS({
|
|
|
26748
26673
|
}
|
|
26749
26674
|
return result;
|
|
26750
26675
|
}
|
|
26751
|
-
var extend = (a, b, thisArg, {
|
|
26752
|
-
|
|
26753
|
-
|
|
26754
|
-
|
|
26755
|
-
|
|
26756
|
-
|
|
26757
|
-
|
|
26758
|
-
|
|
26759
|
-
|
|
26760
|
-
|
|
26761
|
-
|
|
26762
|
-
|
|
26763
|
-
|
|
26764
|
-
|
|
26765
|
-
|
|
26766
|
-
|
|
26767
|
-
|
|
26768
|
-
|
|
26769
|
-
|
|
26770
|
-
|
|
26771
|
-
|
|
26772
|
-
);
|
|
26676
|
+
var extend = (a, b, thisArg, {
|
|
26677
|
+
allOwnKeys
|
|
26678
|
+
} = {}) => {
|
|
26679
|
+
forEach(b, (val, key) => {
|
|
26680
|
+
if (thisArg && isFunction$1(val)) {
|
|
26681
|
+
Object.defineProperty(a, key, {
|
|
26682
|
+
value: bind(val, thisArg),
|
|
26683
|
+
writable: true,
|
|
26684
|
+
enumerable: true,
|
|
26685
|
+
configurable: true
|
|
26686
|
+
});
|
|
26687
|
+
} else {
|
|
26688
|
+
Object.defineProperty(a, key, {
|
|
26689
|
+
value: val,
|
|
26690
|
+
writable: true,
|
|
26691
|
+
enumerable: true,
|
|
26692
|
+
configurable: true
|
|
26693
|
+
});
|
|
26694
|
+
}
|
|
26695
|
+
}, {
|
|
26696
|
+
allOwnKeys
|
|
26697
|
+
});
|
|
26773
26698
|
return a;
|
|
26774
26699
|
};
|
|
26775
26700
|
var stripBOM = (content) => {
|
|
@@ -26860,7 +26785,9 @@ var require_axios = __commonJS({
|
|
|
26860
26785
|
return p1.toUpperCase() + p2;
|
|
26861
26786
|
});
|
|
26862
26787
|
};
|
|
26863
|
-
var hasOwnProperty = (({
|
|
26788
|
+
var hasOwnProperty = (({
|
|
26789
|
+
hasOwnProperty: hasOwnProperty2
|
|
26790
|
+
}) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
26864
26791
|
var isRegExp = kindOfTest("RegExp");
|
|
26865
26792
|
var reduceDescriptors = (obj, reducer) => {
|
|
26866
26793
|
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
@@ -26942,15 +26869,14 @@ var require_axios = __commonJS({
|
|
|
26942
26869
|
return setImmediate;
|
|
26943
26870
|
}
|
|
26944
26871
|
return postMessageSupported ? ((token2, callbacks) => {
|
|
26945
|
-
_global.addEventListener(
|
|
26946
|
-
|
|
26947
|
-
|
|
26948
|
-
|
|
26949
|
-
|
|
26950
|
-
|
|
26951
|
-
}
|
|
26952
|
-
|
|
26953
|
-
);
|
|
26872
|
+
_global.addEventListener("message", ({
|
|
26873
|
+
source,
|
|
26874
|
+
data
|
|
26875
|
+
}) => {
|
|
26876
|
+
if (source === _global && data === token2) {
|
|
26877
|
+
callbacks.length && callbacks.shift()();
|
|
26878
|
+
}
|
|
26879
|
+
}, false);
|
|
26954
26880
|
return (cb) => {
|
|
26955
26881
|
callbacks.push(cb);
|
|
26956
26882
|
_global.postMessage(token2, "*");
|
|
@@ -27093,7 +27019,6 @@ var require_axios = __commonJS({
|
|
|
27093
27019
|
AxiosError.ERR_CANCELED = "ERR_CANCELED";
|
|
27094
27020
|
AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
27095
27021
|
AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
27096
|
-
var AxiosError$1 = AxiosError;
|
|
27097
27022
|
function isVisitable(thing) {
|
|
27098
27023
|
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
|
27099
27024
|
}
|
|
@@ -27117,19 +27042,14 @@ var require_axios = __commonJS({
|
|
|
27117
27042
|
if (!utils$1.isObject(obj)) {
|
|
27118
27043
|
throw new TypeError("target must be an object");
|
|
27119
27044
|
}
|
|
27120
|
-
formData = formData || new (
|
|
27121
|
-
options = utils$1.toFlatObject(
|
|
27122
|
-
|
|
27123
|
-
|
|
27124
|
-
|
|
27125
|
-
|
|
27126
|
-
|
|
27127
|
-
|
|
27128
|
-
false,
|
|
27129
|
-
function defined(option, source) {
|
|
27130
|
-
return !utils$1.isUndefined(source[option]);
|
|
27131
|
-
}
|
|
27132
|
-
);
|
|
27045
|
+
formData = formData || new (FormData$1 || FormData)();
|
|
27046
|
+
options = utils$1.toFlatObject(options, {
|
|
27047
|
+
metaTokens: true,
|
|
27048
|
+
dots: false,
|
|
27049
|
+
indexes: false
|
|
27050
|
+
}, false, function defined(option, source) {
|
|
27051
|
+
return !utils$1.isUndefined(source[option]);
|
|
27052
|
+
});
|
|
27133
27053
|
const metaTokens = options.metaTokens;
|
|
27134
27054
|
const visitor = options.visitor || defaultVisitor;
|
|
27135
27055
|
const dots = options.dots;
|
|
@@ -27148,7 +27068,7 @@ var require_axios = __commonJS({
|
|
|
27148
27068
|
return value.toString();
|
|
27149
27069
|
}
|
|
27150
27070
|
if (!useBlob && utils$1.isBlob(value)) {
|
|
27151
|
-
throw new AxiosError
|
|
27071
|
+
throw new AxiosError("Blob is not supported. Use a Buffer instead.");
|
|
27152
27072
|
}
|
|
27153
27073
|
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
|
27154
27074
|
return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
|
|
@@ -27328,14 +27248,13 @@ var require_axios = __commonJS({
|
|
|
27328
27248
|
});
|
|
27329
27249
|
}
|
|
27330
27250
|
};
|
|
27331
|
-
var InterceptorManager$1 = InterceptorManager;
|
|
27332
27251
|
var transitionalDefaults = {
|
|
27333
27252
|
silentJSONParsing: true,
|
|
27334
27253
|
forcedJSONParsing: true,
|
|
27335
27254
|
clarifyTimeoutError: false,
|
|
27336
27255
|
legacyInterceptorReqResOrdering: true
|
|
27337
27256
|
};
|
|
27338
|
-
var URLSearchParams =
|
|
27257
|
+
var URLSearchParams = url.URLSearchParams;
|
|
27339
27258
|
var ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
27340
27259
|
var DIGIT = "0123456789";
|
|
27341
27260
|
var ALPHABET = {
|
|
@@ -27345,9 +27264,11 @@ var require_axios = __commonJS({
|
|
|
27345
27264
|
};
|
|
27346
27265
|
var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
27347
27266
|
let str = "";
|
|
27348
|
-
const {
|
|
27267
|
+
const {
|
|
27268
|
+
length
|
|
27269
|
+
} = alphabet;
|
|
27349
27270
|
const randomValues = new Uint32Array(size);
|
|
27350
|
-
|
|
27271
|
+
crypto2.randomFillSync(randomValues);
|
|
27351
27272
|
for (let i = 0; i < size; i++) {
|
|
27352
27273
|
str += alphabet[randomValues[i] % length];
|
|
27353
27274
|
}
|
|
@@ -27357,7 +27278,7 @@ var require_axios = __commonJS({
|
|
|
27357
27278
|
isNode: true,
|
|
27358
27279
|
classes: {
|
|
27359
27280
|
URLSearchParams,
|
|
27360
|
-
FormData:
|
|
27281
|
+
FormData: FormData$1,
|
|
27361
27282
|
Blob: typeof Blob !== "undefined" && Blob || null
|
|
27362
27283
|
},
|
|
27363
27284
|
ALPHABET,
|
|
@@ -27375,8 +27296,8 @@ var require_axios = __commonJS({
|
|
|
27375
27296
|
var utils = /* @__PURE__ */ Object.freeze({
|
|
27376
27297
|
__proto__: null,
|
|
27377
27298
|
hasBrowserEnv,
|
|
27378
|
-
hasStandardBrowserWebWorkerEnv,
|
|
27379
27299
|
hasStandardBrowserEnv,
|
|
27300
|
+
hasStandardBrowserWebWorkerEnv,
|
|
27380
27301
|
navigator: _navigator,
|
|
27381
27302
|
origin
|
|
27382
27303
|
});
|
|
@@ -27462,74 +27383,68 @@ var require_axios = __commonJS({
|
|
|
27462
27383
|
var defaults = {
|
|
27463
27384
|
transitional: transitionalDefaults,
|
|
27464
27385
|
adapter: ["xhr", "http", "fetch"],
|
|
27465
|
-
transformRequest: [
|
|
27466
|
-
|
|
27467
|
-
|
|
27468
|
-
|
|
27469
|
-
|
|
27470
|
-
|
|
27471
|
-
|
|
27472
|
-
|
|
27473
|
-
|
|
27474
|
-
|
|
27475
|
-
|
|
27476
|
-
|
|
27477
|
-
|
|
27478
|
-
|
|
27479
|
-
|
|
27480
|
-
|
|
27481
|
-
|
|
27482
|
-
|
|
27483
|
-
|
|
27484
|
-
|
|
27485
|
-
|
|
27486
|
-
|
|
27487
|
-
|
|
27488
|
-
if (
|
|
27489
|
-
|
|
27490
|
-
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
27491
|
-
}
|
|
27492
|
-
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
27493
|
-
const _FormData = this.env && this.env.FormData;
|
|
27494
|
-
return toFormData(
|
|
27495
|
-
isFileList2 ? { "files[]": data } : data,
|
|
27496
|
-
_FormData && new _FormData(),
|
|
27497
|
-
this.formSerializer
|
|
27498
|
-
);
|
|
27499
|
-
}
|
|
27386
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
27387
|
+
const contentType = headers.getContentType() || "";
|
|
27388
|
+
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
27389
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
27390
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
27391
|
+
data = new FormData(data);
|
|
27392
|
+
}
|
|
27393
|
+
const isFormData2 = utils$1.isFormData(data);
|
|
27394
|
+
if (isFormData2) {
|
|
27395
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
27396
|
+
}
|
|
27397
|
+
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
|
|
27398
|
+
return data;
|
|
27399
|
+
}
|
|
27400
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
27401
|
+
return data.buffer;
|
|
27402
|
+
}
|
|
27403
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
27404
|
+
headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
|
|
27405
|
+
return data.toString();
|
|
27406
|
+
}
|
|
27407
|
+
let isFileList2;
|
|
27408
|
+
if (isObjectPayload) {
|
|
27409
|
+
if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
|
|
27410
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
27500
27411
|
}
|
|
27501
|
-
if (
|
|
27502
|
-
|
|
27503
|
-
return
|
|
27412
|
+
if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
|
|
27413
|
+
const _FormData = this.env && this.env.FormData;
|
|
27414
|
+
return toFormData(isFileList2 ? {
|
|
27415
|
+
"files[]": data
|
|
27416
|
+
} : data, _FormData && new _FormData(), this.formSerializer);
|
|
27504
27417
|
}
|
|
27418
|
+
}
|
|
27419
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
27420
|
+
headers.setContentType("application/json", false);
|
|
27421
|
+
return stringifySafely(data);
|
|
27422
|
+
}
|
|
27423
|
+
return data;
|
|
27424
|
+
}],
|
|
27425
|
+
transformResponse: [function transformResponse(data) {
|
|
27426
|
+
const transitional = this.transitional || defaults.transitional;
|
|
27427
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
27428
|
+
const JSONRequested = this.responseType === "json";
|
|
27429
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
27505
27430
|
return data;
|
|
27506
27431
|
}
|
|
27507
|
-
|
|
27508
|
-
|
|
27509
|
-
|
|
27510
|
-
|
|
27511
|
-
|
|
27512
|
-
|
|
27513
|
-
|
|
27514
|
-
|
|
27515
|
-
|
|
27516
|
-
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
27517
|
-
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
27518
|
-
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
27519
|
-
try {
|
|
27520
|
-
return JSON.parse(data, this.parseReviver);
|
|
27521
|
-
} catch (e) {
|
|
27522
|
-
if (strictJSONParsing) {
|
|
27523
|
-
if (e.name === "SyntaxError") {
|
|
27524
|
-
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
27525
|
-
}
|
|
27526
|
-
throw e;
|
|
27432
|
+
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
27433
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
27434
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
27435
|
+
try {
|
|
27436
|
+
return JSON.parse(data, this.parseReviver);
|
|
27437
|
+
} catch (e) {
|
|
27438
|
+
if (strictJSONParsing) {
|
|
27439
|
+
if (e.name === "SyntaxError") {
|
|
27440
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
|
|
27527
27441
|
}
|
|
27442
|
+
throw e;
|
|
27528
27443
|
}
|
|
27529
27444
|
}
|
|
27530
|
-
return data;
|
|
27531
27445
|
}
|
|
27532
|
-
|
|
27446
|
+
return data;
|
|
27447
|
+
}],
|
|
27533
27448
|
/**
|
|
27534
27449
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
27535
27450
|
* timeout is not created.
|
|
@@ -27556,26 +27471,7 @@ var require_axios = __commonJS({
|
|
|
27556
27471
|
utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
|
|
27557
27472
|
defaults.headers[method] = {};
|
|
27558
27473
|
});
|
|
27559
|
-
var
|
|
27560
|
-
var ignoreDuplicateOf = utils$1.toObjectSet([
|
|
27561
|
-
"age",
|
|
27562
|
-
"authorization",
|
|
27563
|
-
"content-length",
|
|
27564
|
-
"content-type",
|
|
27565
|
-
"etag",
|
|
27566
|
-
"expires",
|
|
27567
|
-
"from",
|
|
27568
|
-
"host",
|
|
27569
|
-
"if-modified-since",
|
|
27570
|
-
"if-unmodified-since",
|
|
27571
|
-
"last-modified",
|
|
27572
|
-
"location",
|
|
27573
|
-
"max-forwards",
|
|
27574
|
-
"proxy-authorization",
|
|
27575
|
-
"referer",
|
|
27576
|
-
"retry-after",
|
|
27577
|
-
"user-agent"
|
|
27578
|
-
]);
|
|
27474
|
+
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"]);
|
|
27579
27475
|
var parseHeaders = (rawHeaders) => {
|
|
27580
27476
|
const parsed = {};
|
|
27581
27477
|
let key;
|
|
@@ -27608,7 +27504,7 @@ var require_axios = __commonJS({
|
|
|
27608
27504
|
if (value === false || value == null) {
|
|
27609
27505
|
return value;
|
|
27610
27506
|
}
|
|
27611
|
-
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
27507
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value).replace(/[\r\n]+$/, "");
|
|
27612
27508
|
}
|
|
27613
27509
|
function parseTokens(str) {
|
|
27614
27510
|
const tokens = /* @__PURE__ */ Object.create(null);
|
|
@@ -27815,15 +27711,10 @@ var require_axios = __commonJS({
|
|
|
27815
27711
|
return this;
|
|
27816
27712
|
}
|
|
27817
27713
|
};
|
|
27818
|
-
AxiosHeaders.accessor([
|
|
27819
|
-
|
|
27820
|
-
|
|
27821
|
-
|
|
27822
|
-
"Accept-Encoding",
|
|
27823
|
-
"User-Agent",
|
|
27824
|
-
"Authorization"
|
|
27825
|
-
]);
|
|
27826
|
-
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
|
|
27714
|
+
AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
27715
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, ({
|
|
27716
|
+
value
|
|
27717
|
+
}, key) => {
|
|
27827
27718
|
let mapped = key[0].toUpperCase() + key.slice(1);
|
|
27828
27719
|
return {
|
|
27829
27720
|
get: () => value,
|
|
@@ -27833,11 +27724,10 @@ var require_axios = __commonJS({
|
|
|
27833
27724
|
};
|
|
27834
27725
|
});
|
|
27835
27726
|
utils$1.freezeMethods(AxiosHeaders);
|
|
27836
|
-
var AxiosHeaders$1 = AxiosHeaders;
|
|
27837
27727
|
function transformData(fns, response) {
|
|
27838
|
-
const config = this || defaults
|
|
27728
|
+
const config = this || defaults;
|
|
27839
27729
|
const context = response || config;
|
|
27840
|
-
const headers = AxiosHeaders
|
|
27730
|
+
const headers = AxiosHeaders.from(context.headers);
|
|
27841
27731
|
let data = context.data;
|
|
27842
27732
|
utils$1.forEach(fns, function transform(fn) {
|
|
27843
27733
|
data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
|
|
@@ -27848,7 +27738,7 @@ var require_axios = __commonJS({
|
|
|
27848
27738
|
function isCancel(value) {
|
|
27849
27739
|
return !!(value && value.__CANCEL__);
|
|
27850
27740
|
}
|
|
27851
|
-
var CanceledError = class extends AxiosError
|
|
27741
|
+
var CanceledError = class extends AxiosError {
|
|
27852
27742
|
/**
|
|
27853
27743
|
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
27854
27744
|
*
|
|
@@ -27859,26 +27749,17 @@ var require_axios = __commonJS({
|
|
|
27859
27749
|
* @returns {CanceledError} The created error.
|
|
27860
27750
|
*/
|
|
27861
27751
|
constructor(message, config, request) {
|
|
27862
|
-
super(message == null ? "canceled" : message, AxiosError
|
|
27752
|
+
super(message == null ? "canceled" : message, AxiosError.ERR_CANCELED, config, request);
|
|
27863
27753
|
this.name = "CanceledError";
|
|
27864
27754
|
this.__CANCEL__ = true;
|
|
27865
27755
|
}
|
|
27866
27756
|
};
|
|
27867
|
-
var CanceledError$1 = CanceledError;
|
|
27868
27757
|
function settle(resolve, reject, response) {
|
|
27869
27758
|
const validateStatus = response.config.validateStatus;
|
|
27870
27759
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
27871
27760
|
resolve(response);
|
|
27872
27761
|
} else {
|
|
27873
|
-
reject(
|
|
27874
|
-
new AxiosError$1(
|
|
27875
|
-
"Request failed with status code " + response.status,
|
|
27876
|
-
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
27877
|
-
response.config,
|
|
27878
|
-
response.request,
|
|
27879
|
-
response
|
|
27880
|
-
)
|
|
27881
|
-
);
|
|
27762
|
+
reject(new AxiosError("Request failed with status code " + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
|
|
27882
27763
|
}
|
|
27883
27764
|
}
|
|
27884
27765
|
function isAbsoluteURL(url2) {
|
|
@@ -27897,7 +27778,72 @@ var require_axios = __commonJS({
|
|
|
27897
27778
|
}
|
|
27898
27779
|
return requestedURL;
|
|
27899
27780
|
}
|
|
27900
|
-
var
|
|
27781
|
+
var DEFAULT_PORTS = {
|
|
27782
|
+
ftp: 21,
|
|
27783
|
+
gopher: 70,
|
|
27784
|
+
http: 80,
|
|
27785
|
+
https: 443,
|
|
27786
|
+
ws: 80,
|
|
27787
|
+
wss: 443
|
|
27788
|
+
};
|
|
27789
|
+
function parseUrl(urlString) {
|
|
27790
|
+
try {
|
|
27791
|
+
return new URL(urlString);
|
|
27792
|
+
} catch {
|
|
27793
|
+
return null;
|
|
27794
|
+
}
|
|
27795
|
+
}
|
|
27796
|
+
function getProxyForUrl(url2) {
|
|
27797
|
+
var parsedUrl = (typeof url2 === "string" ? parseUrl(url2) : url2) || {};
|
|
27798
|
+
var proto = parsedUrl.protocol;
|
|
27799
|
+
var hostname = parsedUrl.host;
|
|
27800
|
+
var port = parsedUrl.port;
|
|
27801
|
+
if (typeof hostname !== "string" || !hostname || typeof proto !== "string") {
|
|
27802
|
+
return "";
|
|
27803
|
+
}
|
|
27804
|
+
proto = proto.split(":", 1)[0];
|
|
27805
|
+
hostname = hostname.replace(/:\d*$/, "");
|
|
27806
|
+
port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
|
|
27807
|
+
if (!shouldProxy(hostname, port)) {
|
|
27808
|
+
return "";
|
|
27809
|
+
}
|
|
27810
|
+
var proxy = getEnv(proto + "_proxy") || getEnv("all_proxy");
|
|
27811
|
+
if (proxy && proxy.indexOf("://") === -1) {
|
|
27812
|
+
proxy = proto + "://" + proxy;
|
|
27813
|
+
}
|
|
27814
|
+
return proxy;
|
|
27815
|
+
}
|
|
27816
|
+
function shouldProxy(hostname, port) {
|
|
27817
|
+
var NO_PROXY = getEnv("no_proxy").toLowerCase();
|
|
27818
|
+
if (!NO_PROXY) {
|
|
27819
|
+
return true;
|
|
27820
|
+
}
|
|
27821
|
+
if (NO_PROXY === "*") {
|
|
27822
|
+
return false;
|
|
27823
|
+
}
|
|
27824
|
+
return NO_PROXY.split(/[,\s]/).every(function(proxy) {
|
|
27825
|
+
if (!proxy) {
|
|
27826
|
+
return true;
|
|
27827
|
+
}
|
|
27828
|
+
var parsedProxy = proxy.match(/^(.+):(\d+)$/);
|
|
27829
|
+
var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
|
|
27830
|
+
var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
|
|
27831
|
+
if (parsedProxyPort && parsedProxyPort !== port) {
|
|
27832
|
+
return true;
|
|
27833
|
+
}
|
|
27834
|
+
if (!/^[.*]/.test(parsedProxyHostname)) {
|
|
27835
|
+
return hostname !== parsedProxyHostname;
|
|
27836
|
+
}
|
|
27837
|
+
if (parsedProxyHostname.charAt(0) === "*") {
|
|
27838
|
+
parsedProxyHostname = parsedProxyHostname.slice(1);
|
|
27839
|
+
}
|
|
27840
|
+
return !hostname.endsWith(parsedProxyHostname);
|
|
27841
|
+
});
|
|
27842
|
+
}
|
|
27843
|
+
function getEnv(key) {
|
|
27844
|
+
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
|
|
27845
|
+
}
|
|
27846
|
+
var VERSION2 = "1.14.0";
|
|
27901
27847
|
function parseProtocol(url2) {
|
|
27902
27848
|
const match2 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
|
|
27903
27849
|
return match2 && match2[1] || "";
|
|
@@ -27913,7 +27859,7 @@ var require_axios = __commonJS({
|
|
|
27913
27859
|
uri = protocol.length ? uri.slice(protocol.length + 1) : uri;
|
|
27914
27860
|
const match2 = DATA_URL_PATTERN.exec(uri);
|
|
27915
27861
|
if (!match2) {
|
|
27916
|
-
throw new AxiosError
|
|
27862
|
+
throw new AxiosError("Invalid URL", AxiosError.ERR_INVALID_URL);
|
|
27917
27863
|
}
|
|
27918
27864
|
const mime = match2[1];
|
|
27919
27865
|
const isBase64 = match2[2];
|
|
@@ -27921,32 +27867,29 @@ var require_axios = __commonJS({
|
|
|
27921
27867
|
const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
|
|
27922
27868
|
if (asBlob) {
|
|
27923
27869
|
if (!_Blob) {
|
|
27924
|
-
throw new AxiosError
|
|
27870
|
+
throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT);
|
|
27925
27871
|
}
|
|
27926
|
-
return new _Blob([buffer], {
|
|
27872
|
+
return new _Blob([buffer], {
|
|
27873
|
+
type: mime
|
|
27874
|
+
});
|
|
27927
27875
|
}
|
|
27928
27876
|
return buffer;
|
|
27929
27877
|
}
|
|
27930
|
-
throw new AxiosError
|
|
27878
|
+
throw new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_NOT_SUPPORT);
|
|
27931
27879
|
}
|
|
27932
27880
|
var kInternals = /* @__PURE__ */ Symbol("internals");
|
|
27933
|
-
var AxiosTransformStream = class extends
|
|
27881
|
+
var AxiosTransformStream = class extends stream.Transform {
|
|
27934
27882
|
constructor(options) {
|
|
27935
|
-
options = utils$1.toFlatObject(
|
|
27936
|
-
|
|
27937
|
-
|
|
27938
|
-
|
|
27939
|
-
|
|
27940
|
-
|
|
27941
|
-
|
|
27942
|
-
|
|
27943
|
-
|
|
27944
|
-
|
|
27945
|
-
null,
|
|
27946
|
-
(prop, source) => {
|
|
27947
|
-
return !utils$1.isUndefined(source[prop]);
|
|
27948
|
-
}
|
|
27949
|
-
);
|
|
27883
|
+
options = utils$1.toFlatObject(options, {
|
|
27884
|
+
maxRate: 0,
|
|
27885
|
+
chunkSize: 64 * 1024,
|
|
27886
|
+
minChunkSize: 100,
|
|
27887
|
+
timeWindow: 500,
|
|
27888
|
+
ticksRate: 2,
|
|
27889
|
+
samplesCount: 15
|
|
27890
|
+
}, null, (prop, source) => {
|
|
27891
|
+
return !utils$1.isUndefined(source[prop]);
|
|
27892
|
+
});
|
|
27950
27893
|
super({
|
|
27951
27894
|
readableHighWaterMark: options.chunkSize
|
|
27952
27895
|
});
|
|
@@ -28029,12 +27972,9 @@ var require_axios = __commonJS({
|
|
|
28029
27972
|
chunkRemainder = _chunk.subarray(maxChunkSize);
|
|
28030
27973
|
_chunk = _chunk.subarray(0, maxChunkSize);
|
|
28031
27974
|
}
|
|
28032
|
-
pushChunk(
|
|
28033
|
-
|
|
28034
|
-
|
|
28035
|
-
process.nextTick(_callback, null, chunkRemainder);
|
|
28036
|
-
} : _callback
|
|
28037
|
-
);
|
|
27975
|
+
pushChunk(_chunk, chunkRemainder ? () => {
|
|
27976
|
+
process.nextTick(_callback, null, chunkRemainder);
|
|
27977
|
+
} : _callback);
|
|
28038
27978
|
};
|
|
28039
27979
|
transformChunk(chunk, function transformNextChunk(err, _chunk) {
|
|
28040
27980
|
if (err) {
|
|
@@ -28048,8 +27988,9 @@ var require_axios = __commonJS({
|
|
|
28048
27988
|
});
|
|
28049
27989
|
}
|
|
28050
27990
|
};
|
|
28051
|
-
var
|
|
28052
|
-
|
|
27991
|
+
var {
|
|
27992
|
+
asyncIterator
|
|
27993
|
+
} = Symbol;
|
|
28053
27994
|
var readBlob = async function* (blob) {
|
|
28054
27995
|
if (blob.stream) {
|
|
28055
27996
|
yield* blob.stream();
|
|
@@ -28061,15 +28002,16 @@ var require_axios = __commonJS({
|
|
|
28061
28002
|
yield blob;
|
|
28062
28003
|
}
|
|
28063
28004
|
};
|
|
28064
|
-
var readBlob$1 = readBlob;
|
|
28065
28005
|
var BOUNDARY_ALPHABET = platform.ALPHABET.ALPHA_DIGIT + "-_";
|
|
28066
|
-
var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new
|
|
28006
|
+
var textEncoder = typeof TextEncoder === "function" ? new TextEncoder() : new util.TextEncoder();
|
|
28067
28007
|
var CRLF = "\r\n";
|
|
28068
28008
|
var CRLF_BYTES = textEncoder.encode(CRLF);
|
|
28069
28009
|
var CRLF_BYTES_COUNT = 2;
|
|
28070
28010
|
var FormDataPart = class {
|
|
28071
28011
|
constructor(name, value) {
|
|
28072
|
-
const {
|
|
28012
|
+
const {
|
|
28013
|
+
escapeName
|
|
28014
|
+
} = this.constructor;
|
|
28073
28015
|
const isStringValue = utils$1.isString(value);
|
|
28074
28016
|
let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`;
|
|
28075
28017
|
if (isStringValue) {
|
|
@@ -28085,23 +28027,22 @@ var require_axios = __commonJS({
|
|
|
28085
28027
|
}
|
|
28086
28028
|
async *encode() {
|
|
28087
28029
|
yield this.headers;
|
|
28088
|
-
const {
|
|
28030
|
+
const {
|
|
28031
|
+
value
|
|
28032
|
+
} = this;
|
|
28089
28033
|
if (utils$1.isTypedArray(value)) {
|
|
28090
28034
|
yield value;
|
|
28091
28035
|
} else {
|
|
28092
|
-
yield* readBlob
|
|
28036
|
+
yield* readBlob(value);
|
|
28093
28037
|
}
|
|
28094
28038
|
yield CRLF_BYTES;
|
|
28095
28039
|
}
|
|
28096
28040
|
static escapeName(name) {
|
|
28097
|
-
return String(name).replace(
|
|
28098
|
-
|
|
28099
|
-
|
|
28100
|
-
|
|
28101
|
-
|
|
28102
|
-
'"': "%22"
|
|
28103
|
-
})[match2]
|
|
28104
|
-
);
|
|
28041
|
+
return String(name).replace(/[\r\n"]/g, (match2) => ({
|
|
28042
|
+
"\r": "%0D",
|
|
28043
|
+
"\n": "%0A",
|
|
28044
|
+
'"': "%22"
|
|
28045
|
+
})[match2]);
|
|
28105
28046
|
}
|
|
28106
28047
|
};
|
|
28107
28048
|
var formDataToStream = (form, headersHandler, options) => {
|
|
@@ -28133,18 +28074,15 @@ var require_axios = __commonJS({
|
|
|
28133
28074
|
computedHeaders["Content-Length"] = contentLength;
|
|
28134
28075
|
}
|
|
28135
28076
|
headersHandler && headersHandler(computedHeaders);
|
|
28136
|
-
return stream.Readable.from(
|
|
28137
|
-
(
|
|
28138
|
-
|
|
28139
|
-
|
|
28140
|
-
|
|
28141
|
-
|
|
28142
|
-
|
|
28143
|
-
})()
|
|
28144
|
-
);
|
|
28077
|
+
return stream.Readable.from((async function* () {
|
|
28078
|
+
for (const part of parts) {
|
|
28079
|
+
yield boundaryBytes;
|
|
28080
|
+
yield* part.encode();
|
|
28081
|
+
}
|
|
28082
|
+
yield footerBytes;
|
|
28083
|
+
})());
|
|
28145
28084
|
};
|
|
28146
|
-
var
|
|
28147
|
-
var ZlibHeaderTransformStream = class extends stream__default["default"].Transform {
|
|
28085
|
+
var ZlibHeaderTransformStream = class extends stream.Transform {
|
|
28148
28086
|
__transform(chunk, encoding, callback) {
|
|
28149
28087
|
this.push(chunk);
|
|
28150
28088
|
callback();
|
|
@@ -28162,7 +28100,6 @@ var require_axios = __commonJS({
|
|
|
28162
28100
|
this.__transform(chunk, encoding, callback);
|
|
28163
28101
|
}
|
|
28164
28102
|
};
|
|
28165
|
-
var ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
|
|
28166
28103
|
var callbackify = (fn, reducer) => {
|
|
28167
28104
|
return utils$1.isAsyncFn(fn) ? function(...args) {
|
|
28168
28105
|
const cb = args.pop();
|
|
@@ -28175,7 +28112,6 @@ var require_axios = __commonJS({
|
|
|
28175
28112
|
}, cb);
|
|
28176
28113
|
} : fn;
|
|
28177
28114
|
};
|
|
28178
|
-
var callbackify$1 = callbackify;
|
|
28179
28115
|
function speedometer(samplesCount, min) {
|
|
28180
28116
|
samplesCount = samplesCount || 10;
|
|
28181
28117
|
const bytes = new Array(samplesCount);
|
|
@@ -28267,14 +28203,11 @@ var require_axios = __commonJS({
|
|
|
28267
28203
|
};
|
|
28268
28204
|
var progressEventDecorator = (total, throttled) => {
|
|
28269
28205
|
const lengthComputable = total != null;
|
|
28270
|
-
return [
|
|
28271
|
-
|
|
28272
|
-
|
|
28273
|
-
|
|
28274
|
-
|
|
28275
|
-
}),
|
|
28276
|
-
throttled[1]
|
|
28277
|
-
];
|
|
28206
|
+
return [(loaded) => throttled[0]({
|
|
28207
|
+
lengthComputable,
|
|
28208
|
+
total,
|
|
28209
|
+
loaded
|
|
28210
|
+
}), throttled[1]];
|
|
28278
28211
|
};
|
|
28279
28212
|
var asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
|
28280
28213
|
function estimateDataURLDecodedBytes(url2) {
|
|
@@ -28327,15 +28260,18 @@ var require_axios = __commonJS({
|
|
|
28327
28260
|
return Buffer.byteLength(body, "utf8");
|
|
28328
28261
|
}
|
|
28329
28262
|
var zlibOptions = {
|
|
28330
|
-
flush:
|
|
28331
|
-
finishFlush:
|
|
28263
|
+
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
28264
|
+
finishFlush: zlib.constants.Z_SYNC_FLUSH
|
|
28332
28265
|
};
|
|
28333
28266
|
var brotliOptions = {
|
|
28334
|
-
flush:
|
|
28335
|
-
finishFlush:
|
|
28267
|
+
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
28268
|
+
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
|
|
28336
28269
|
};
|
|
28337
|
-
var isBrotliSupported = utils$1.isFunction(
|
|
28338
|
-
var {
|
|
28270
|
+
var isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
|
|
28271
|
+
var {
|
|
28272
|
+
http: httpFollow,
|
|
28273
|
+
https: httpsFollow
|
|
28274
|
+
} = followRedirects;
|
|
28339
28275
|
var isHttps = /https:?/;
|
|
28340
28276
|
var supportedProtocols = platform.protocols.map((protocol) => {
|
|
28341
28277
|
return protocol + ":";
|
|
@@ -28349,23 +28285,20 @@ var require_axios = __commonJS({
|
|
|
28349
28285
|
this.sessions = /* @__PURE__ */ Object.create(null);
|
|
28350
28286
|
}
|
|
28351
28287
|
getSession(authority, options) {
|
|
28352
|
-
options = Object.assign(
|
|
28353
|
-
|
|
28354
|
-
|
|
28355
|
-
},
|
|
28356
|
-
options
|
|
28357
|
-
);
|
|
28288
|
+
options = Object.assign({
|
|
28289
|
+
sessionTimeout: 1e3
|
|
28290
|
+
}, options);
|
|
28358
28291
|
let authoritySessions = this.sessions[authority];
|
|
28359
28292
|
if (authoritySessions) {
|
|
28360
28293
|
let len = authoritySessions.length;
|
|
28361
28294
|
for (let i = 0; i < len; i++) {
|
|
28362
28295
|
const [sessionHandle, sessionOptions] = authoritySessions[i];
|
|
28363
|
-
if (!sessionHandle.destroyed && !sessionHandle.closed &&
|
|
28296
|
+
if (!sessionHandle.destroyed && !sessionHandle.closed && util.isDeepStrictEqual(sessionOptions, options)) {
|
|
28364
28297
|
return sessionHandle;
|
|
28365
28298
|
}
|
|
28366
28299
|
}
|
|
28367
28300
|
}
|
|
28368
|
-
const session =
|
|
28301
|
+
const session = http2.connect(authority, options);
|
|
28369
28302
|
let removed;
|
|
28370
28303
|
const removeSession = () => {
|
|
28371
28304
|
if (removed) {
|
|
@@ -28380,12 +28313,17 @@ var require_axios = __commonJS({
|
|
|
28380
28313
|
} else {
|
|
28381
28314
|
entries.splice(i, 1);
|
|
28382
28315
|
}
|
|
28316
|
+
if (!session.closed) {
|
|
28317
|
+
session.close();
|
|
28318
|
+
}
|
|
28383
28319
|
return;
|
|
28384
28320
|
}
|
|
28385
28321
|
}
|
|
28386
28322
|
};
|
|
28387
28323
|
const originalRequestFn = session.request;
|
|
28388
|
-
const {
|
|
28324
|
+
const {
|
|
28325
|
+
sessionTimeout
|
|
28326
|
+
} = options;
|
|
28389
28327
|
if (sessionTimeout != null) {
|
|
28390
28328
|
let timer;
|
|
28391
28329
|
let streamsCount = 0;
|
|
@@ -28425,7 +28363,7 @@ var require_axios = __commonJS({
|
|
|
28425
28363
|
function setProxy(options, configProxy, location) {
|
|
28426
28364
|
let proxy = configProxy;
|
|
28427
28365
|
if (!proxy && proxy !== false) {
|
|
28428
|
-
const proxyUrl =
|
|
28366
|
+
const proxyUrl = getProxyForUrl(location);
|
|
28429
28367
|
if (proxyUrl) {
|
|
28430
28368
|
proxy = new URL(proxyUrl);
|
|
28431
28369
|
}
|
|
@@ -28439,7 +28377,9 @@ var require_axios = __commonJS({
|
|
|
28439
28377
|
if (validProxyAuth) {
|
|
28440
28378
|
proxy.auth = (proxy.auth.username || "") + ":" + (proxy.auth.password || "");
|
|
28441
28379
|
} else if (typeof proxy.auth === "object") {
|
|
28442
|
-
throw new AxiosError
|
|
28380
|
+
throw new AxiosError("Invalid proxy authorization", AxiosError.ERR_BAD_OPTION, {
|
|
28381
|
+
proxy
|
|
28382
|
+
});
|
|
28443
28383
|
}
|
|
28444
28384
|
const base64 = Buffer.from(proxy.auth, "utf8").toString("base64");
|
|
28445
28385
|
options.headers["Proxy-Authorization"] = "Basic " + base64;
|
|
@@ -28479,7 +28419,10 @@ var require_axios = __commonJS({
|
|
|
28479
28419
|
asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
|
|
28480
28420
|
});
|
|
28481
28421
|
};
|
|
28482
|
-
var resolveFamily = ({
|
|
28422
|
+
var resolveFamily = ({
|
|
28423
|
+
address,
|
|
28424
|
+
family
|
|
28425
|
+
}) => {
|
|
28483
28426
|
if (!utils$1.isString(address)) {
|
|
28484
28427
|
throw TypeError("address must be a string");
|
|
28485
28428
|
}
|
|
@@ -28488,13 +28431,24 @@ var require_axios = __commonJS({
|
|
|
28488
28431
|
family: family || (address.indexOf(".") < 0 ? 6 : 4)
|
|
28489
28432
|
};
|
|
28490
28433
|
};
|
|
28491
|
-
var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {
|
|
28434
|
+
var buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {
|
|
28435
|
+
address,
|
|
28436
|
+
family
|
|
28437
|
+
});
|
|
28492
28438
|
var http2Transport = {
|
|
28493
28439
|
request(options, cb) {
|
|
28494
28440
|
const authority = options.protocol + "//" + options.hostname + ":" + (options.port || (options.protocol === "https:" ? 443 : 80));
|
|
28495
|
-
const {
|
|
28441
|
+
const {
|
|
28442
|
+
http2Options,
|
|
28443
|
+
headers
|
|
28444
|
+
} = options;
|
|
28496
28445
|
const session = http2Sessions.getSession(authority, http2Options);
|
|
28497
|
-
const {
|
|
28446
|
+
const {
|
|
28447
|
+
HTTP2_HEADER_SCHEME,
|
|
28448
|
+
HTTP2_HEADER_METHOD,
|
|
28449
|
+
HTTP2_HEADER_PATH,
|
|
28450
|
+
HTTP2_HEADER_STATUS
|
|
28451
|
+
} = http2.constants;
|
|
28498
28452
|
const http2Headers = {
|
|
28499
28453
|
[HTTP2_HEADER_SCHEME]: options.protocol.replace(":", ""),
|
|
28500
28454
|
[HTTP2_HEADER_METHOD]: options.method,
|
|
@@ -28518,8 +28472,17 @@ var require_axios = __commonJS({
|
|
|
28518
28472
|
};
|
|
28519
28473
|
var httpAdapter = isHttpAdapterSupported && function httpAdapter2(config) {
|
|
28520
28474
|
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
28521
|
-
let {
|
|
28522
|
-
|
|
28475
|
+
let {
|
|
28476
|
+
data,
|
|
28477
|
+
lookup,
|
|
28478
|
+
family,
|
|
28479
|
+
httpVersion = 1,
|
|
28480
|
+
http2Options
|
|
28481
|
+
} = config;
|
|
28482
|
+
const {
|
|
28483
|
+
responseType,
|
|
28484
|
+
responseEncoding
|
|
28485
|
+
} = config;
|
|
28523
28486
|
const method = config.method.toUpperCase();
|
|
28524
28487
|
let isDone;
|
|
28525
28488
|
let rejected = false;
|
|
@@ -28533,7 +28496,7 @@ var require_axios = __commonJS({
|
|
|
28533
28496
|
}
|
|
28534
28497
|
const isHttp2 = httpVersion === 2;
|
|
28535
28498
|
if (lookup) {
|
|
28536
|
-
const _lookup = callbackify
|
|
28499
|
+
const _lookup = callbackify(lookup, (value) => utils$1.isArray(value) ? value : [value]);
|
|
28537
28500
|
lookup = (hostname, opt, cb) => {
|
|
28538
28501
|
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
28539
28502
|
if (err) {
|
|
@@ -28547,10 +28510,7 @@ var require_axios = __commonJS({
|
|
|
28547
28510
|
const abortEmitter = new events.EventEmitter();
|
|
28548
28511
|
function abort(reason) {
|
|
28549
28512
|
try {
|
|
28550
|
-
abortEmitter.emit(
|
|
28551
|
-
"abort",
|
|
28552
|
-
!reason || reason.type ? new CanceledError$1(null, config, req) : reason
|
|
28553
|
-
);
|
|
28513
|
+
abortEmitter.emit("abort", !reason || reason.type ? new CanceledError(null, config, req) : reason);
|
|
28554
28514
|
} catch (err) {
|
|
28555
28515
|
console.warn("emit error", err);
|
|
28556
28516
|
}
|
|
@@ -28578,9 +28538,11 @@ var require_axios = __commonJS({
|
|
|
28578
28538
|
onFinished();
|
|
28579
28539
|
return;
|
|
28580
28540
|
}
|
|
28581
|
-
const {
|
|
28582
|
-
|
|
28583
|
-
|
|
28541
|
+
const {
|
|
28542
|
+
data: data2
|
|
28543
|
+
} = response;
|
|
28544
|
+
if (data2 instanceof stream.Readable || data2 instanceof stream.Duplex) {
|
|
28545
|
+
const offListeners = stream.finished(data2, () => {
|
|
28584
28546
|
offListeners();
|
|
28585
28547
|
onFinished();
|
|
28586
28548
|
});
|
|
@@ -28596,13 +28558,7 @@ var require_axios = __commonJS({
|
|
|
28596
28558
|
const dataUrl = String(config.url || fullPath || "");
|
|
28597
28559
|
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
28598
28560
|
if (estimated > config.maxContentLength) {
|
|
28599
|
-
return reject(
|
|
28600
|
-
new AxiosError$1(
|
|
28601
|
-
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
28602
|
-
AxiosError$1.ERR_BAD_RESPONSE,
|
|
28603
|
-
config
|
|
28604
|
-
)
|
|
28605
|
-
);
|
|
28561
|
+
return reject(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config));
|
|
28606
28562
|
}
|
|
28607
28563
|
}
|
|
28608
28564
|
let convertedData;
|
|
@@ -28619,7 +28575,7 @@ var require_axios = __commonJS({
|
|
|
28619
28575
|
Blob: config.env && config.env.Blob
|
|
28620
28576
|
});
|
|
28621
28577
|
} catch (err) {
|
|
28622
|
-
throw AxiosError
|
|
28578
|
+
throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
|
|
28623
28579
|
}
|
|
28624
28580
|
if (responseType === "text") {
|
|
28625
28581
|
convertedData = convertedData.toString(responseEncoding);
|
|
@@ -28627,44 +28583,41 @@ var require_axios = __commonJS({
|
|
|
28627
28583
|
convertedData = utils$1.stripBOM(convertedData);
|
|
28628
28584
|
}
|
|
28629
28585
|
} else if (responseType === "stream") {
|
|
28630
|
-
convertedData =
|
|
28586
|
+
convertedData = stream.Readable.from(convertedData);
|
|
28631
28587
|
}
|
|
28632
28588
|
return settle(resolve, reject, {
|
|
28633
28589
|
data: convertedData,
|
|
28634
28590
|
status: 200,
|
|
28635
28591
|
statusText: "OK",
|
|
28636
|
-
headers: new AxiosHeaders
|
|
28592
|
+
headers: new AxiosHeaders(),
|
|
28637
28593
|
config
|
|
28638
28594
|
});
|
|
28639
28595
|
}
|
|
28640
28596
|
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
28641
|
-
return reject(
|
|
28642
|
-
new AxiosError$1("Unsupported protocol " + protocol, AxiosError$1.ERR_BAD_REQUEST, config)
|
|
28643
|
-
);
|
|
28597
|
+
return reject(new AxiosError("Unsupported protocol " + protocol, AxiosError.ERR_BAD_REQUEST, config));
|
|
28644
28598
|
}
|
|
28645
|
-
const headers = AxiosHeaders
|
|
28599
|
+
const headers = AxiosHeaders.from(config.headers).normalize();
|
|
28646
28600
|
headers.set("User-Agent", "axios/" + VERSION2, false);
|
|
28647
|
-
const {
|
|
28601
|
+
const {
|
|
28602
|
+
onUploadProgress,
|
|
28603
|
+
onDownloadProgress
|
|
28604
|
+
} = config;
|
|
28648
28605
|
const maxRate = config.maxRate;
|
|
28649
28606
|
let maxUploadRate = void 0;
|
|
28650
28607
|
let maxDownloadRate = void 0;
|
|
28651
28608
|
if (utils$1.isSpecCompliantForm(data)) {
|
|
28652
28609
|
const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
|
|
28653
|
-
data = formDataToStream
|
|
28654
|
-
|
|
28655
|
-
|
|
28656
|
-
|
|
28657
|
-
|
|
28658
|
-
|
|
28659
|
-
tag: `axios-${VERSION2}-boundary`,
|
|
28660
|
-
boundary: userBoundary && userBoundary[1] || void 0
|
|
28661
|
-
}
|
|
28662
|
-
);
|
|
28610
|
+
data = formDataToStream(data, (formHeaders) => {
|
|
28611
|
+
headers.set(formHeaders);
|
|
28612
|
+
}, {
|
|
28613
|
+
tag: `axios-${VERSION2}-boundary`,
|
|
28614
|
+
boundary: userBoundary && userBoundary[1] || void 0
|
|
28615
|
+
});
|
|
28663
28616
|
} else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
|
|
28664
28617
|
headers.set(data.getHeaders());
|
|
28665
28618
|
if (!headers.hasContentLength()) {
|
|
28666
28619
|
try {
|
|
28667
|
-
const knownLength = await
|
|
28620
|
+
const knownLength = await util.promisify(data.getLength).call(data);
|
|
28668
28621
|
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
28669
28622
|
} catch (e) {
|
|
28670
28623
|
}
|
|
@@ -28672,7 +28625,7 @@ var require_axios = __commonJS({
|
|
|
28672
28625
|
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
28673
28626
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
28674
28627
|
headers.setContentLength(data.size || 0);
|
|
28675
|
-
data =
|
|
28628
|
+
data = stream.Readable.from(readBlob(data));
|
|
28676
28629
|
} else if (data && !utils$1.isStream(data)) {
|
|
28677
28630
|
if (Buffer.isBuffer(data)) ;
|
|
28678
28631
|
else if (utils$1.isArrayBuffer(data)) {
|
|
@@ -28680,23 +28633,11 @@ var require_axios = __commonJS({
|
|
|
28680
28633
|
} else if (utils$1.isString(data)) {
|
|
28681
28634
|
data = Buffer.from(data, "utf-8");
|
|
28682
28635
|
} else {
|
|
28683
|
-
return reject(
|
|
28684
|
-
new AxiosError$1(
|
|
28685
|
-
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
28686
|
-
AxiosError$1.ERR_BAD_REQUEST,
|
|
28687
|
-
config
|
|
28688
|
-
)
|
|
28689
|
-
);
|
|
28636
|
+
return reject(new AxiosError("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", AxiosError.ERR_BAD_REQUEST, config));
|
|
28690
28637
|
}
|
|
28691
28638
|
headers.setContentLength(data.length, false);
|
|
28692
28639
|
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
28693
|
-
return reject(
|
|
28694
|
-
new AxiosError$1(
|
|
28695
|
-
"Request body larger than maxBodyLength limit",
|
|
28696
|
-
AxiosError$1.ERR_BAD_REQUEST,
|
|
28697
|
-
config
|
|
28698
|
-
)
|
|
28699
|
-
);
|
|
28640
|
+
return reject(new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config));
|
|
28700
28641
|
}
|
|
28701
28642
|
}
|
|
28702
28643
|
const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
|
|
@@ -28708,27 +28649,14 @@ var require_axios = __commonJS({
|
|
|
28708
28649
|
}
|
|
28709
28650
|
if (data && (onUploadProgress || maxUploadRate)) {
|
|
28710
28651
|
if (!utils$1.isStream(data)) {
|
|
28711
|
-
data =
|
|
28652
|
+
data = stream.Readable.from(data, {
|
|
28653
|
+
objectMode: false
|
|
28654
|
+
});
|
|
28712
28655
|
}
|
|
28713
|
-
data =
|
|
28714
|
-
|
|
28715
|
-
|
|
28716
|
-
|
|
28717
|
-
maxRate: utils$1.toFiniteNumber(maxUploadRate)
|
|
28718
|
-
})
|
|
28719
|
-
],
|
|
28720
|
-
utils$1.noop
|
|
28721
|
-
);
|
|
28722
|
-
onUploadProgress && data.on(
|
|
28723
|
-
"progress",
|
|
28724
|
-
flushOnFinish(
|
|
28725
|
-
data,
|
|
28726
|
-
progressEventDecorator(
|
|
28727
|
-
contentLength,
|
|
28728
|
-
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
28729
|
-
)
|
|
28730
|
-
)
|
|
28731
|
-
);
|
|
28656
|
+
data = stream.pipeline([data, new AxiosTransformStream({
|
|
28657
|
+
maxRate: utils$1.toFiniteNumber(maxUploadRate)
|
|
28658
|
+
})], utils$1.noop);
|
|
28659
|
+
onUploadProgress && data.on("progress", flushOnFinish(data, progressEventDecorator(contentLength, progressEventReducer(asyncDecorator(onUploadProgress), false, 3))));
|
|
28732
28660
|
}
|
|
28733
28661
|
let auth = void 0;
|
|
28734
28662
|
if (config.auth) {
|
|
@@ -28744,11 +28672,7 @@ var require_axios = __commonJS({
|
|
|
28744
28672
|
auth && headers.delete("authorization");
|
|
28745
28673
|
let path;
|
|
28746
28674
|
try {
|
|
28747
|
-
path = buildURL(
|
|
28748
|
-
parsed.pathname + parsed.search,
|
|
28749
|
-
config.params,
|
|
28750
|
-
config.paramsSerializer
|
|
28751
|
-
).replace(/^\?/, "");
|
|
28675
|
+
path = buildURL(parsed.pathname + parsed.search, config.params, config.paramsSerializer).replace(/^\?/, "");
|
|
28752
28676
|
} catch (err) {
|
|
28753
28677
|
const customErr = new Error(err.message);
|
|
28754
28678
|
customErr.config = config;
|
|
@@ -28756,16 +28680,15 @@ var require_axios = __commonJS({
|
|
|
28756
28680
|
customErr.exists = true;
|
|
28757
28681
|
return reject(customErr);
|
|
28758
28682
|
}
|
|
28759
|
-
headers.set(
|
|
28760
|
-
"Accept-Encoding",
|
|
28761
|
-
"gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""),
|
|
28762
|
-
false
|
|
28763
|
-
);
|
|
28683
|
+
headers.set("Accept-Encoding", "gzip, compress, deflate" + (isBrotliSupported ? ", br" : ""), false);
|
|
28764
28684
|
const options = {
|
|
28765
28685
|
path,
|
|
28766
28686
|
method,
|
|
28767
28687
|
headers: headers.toJSON(),
|
|
28768
|
-
agents: {
|
|
28688
|
+
agents: {
|
|
28689
|
+
http: config.httpAgent,
|
|
28690
|
+
https: config.httpsAgent
|
|
28691
|
+
},
|
|
28769
28692
|
auth,
|
|
28770
28693
|
protocol,
|
|
28771
28694
|
family,
|
|
@@ -28779,11 +28702,7 @@ var require_axios = __commonJS({
|
|
|
28779
28702
|
} else {
|
|
28780
28703
|
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
28781
28704
|
options.port = parsed.port;
|
|
28782
|
-
setProxy(
|
|
28783
|
-
options,
|
|
28784
|
-
config.proxy,
|
|
28785
|
-
protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path
|
|
28786
|
-
);
|
|
28705
|
+
setProxy(options, config.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
|
|
28787
28706
|
}
|
|
28788
28707
|
let transport;
|
|
28789
28708
|
const isHttpsRequest = isHttps.test(options.protocol);
|
|
@@ -28794,7 +28713,7 @@ var require_axios = __commonJS({
|
|
|
28794
28713
|
if (config.transport) {
|
|
28795
28714
|
transport = config.transport;
|
|
28796
28715
|
} else if (config.maxRedirects === 0) {
|
|
28797
|
-
transport = isHttpsRequest ?
|
|
28716
|
+
transport = isHttpsRequest ? https : http;
|
|
28798
28717
|
} else {
|
|
28799
28718
|
if (config.maxRedirects) {
|
|
28800
28719
|
options.maxRedirects = config.maxRedirects;
|
|
@@ -28818,19 +28737,10 @@ var require_axios = __commonJS({
|
|
|
28818
28737
|
const streams = [res];
|
|
28819
28738
|
const responseLength = utils$1.toFiniteNumber(res.headers["content-length"]);
|
|
28820
28739
|
if (onDownloadProgress || maxDownloadRate) {
|
|
28821
|
-
const transformStream = new AxiosTransformStream
|
|
28740
|
+
const transformStream = new AxiosTransformStream({
|
|
28822
28741
|
maxRate: utils$1.toFiniteNumber(maxDownloadRate)
|
|
28823
28742
|
});
|
|
28824
|
-
onDownloadProgress && transformStream.on(
|
|
28825
|
-
"progress",
|
|
28826
|
-
flushOnFinish(
|
|
28827
|
-
transformStream,
|
|
28828
|
-
progressEventDecorator(
|
|
28829
|
-
responseLength,
|
|
28830
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
28831
|
-
)
|
|
28832
|
-
)
|
|
28833
|
-
);
|
|
28743
|
+
onDownloadProgress && transformStream.on("progress", flushOnFinish(transformStream, progressEventDecorator(responseLength, progressEventReducer(asyncDecorator(onDownloadProgress), true, 3))));
|
|
28834
28744
|
streams.push(transformStream);
|
|
28835
28745
|
}
|
|
28836
28746
|
let responseStream = res;
|
|
@@ -28845,26 +28755,26 @@ var require_axios = __commonJS({
|
|
|
28845
28755
|
case "x-gzip":
|
|
28846
28756
|
case "compress":
|
|
28847
28757
|
case "x-compress":
|
|
28848
|
-
streams.push(
|
|
28758
|
+
streams.push(zlib.createUnzip(zlibOptions));
|
|
28849
28759
|
delete res.headers["content-encoding"];
|
|
28850
28760
|
break;
|
|
28851
28761
|
case "deflate":
|
|
28852
|
-
streams.push(new ZlibHeaderTransformStream
|
|
28853
|
-
streams.push(
|
|
28762
|
+
streams.push(new ZlibHeaderTransformStream());
|
|
28763
|
+
streams.push(zlib.createUnzip(zlibOptions));
|
|
28854
28764
|
delete res.headers["content-encoding"];
|
|
28855
28765
|
break;
|
|
28856
28766
|
case "br":
|
|
28857
28767
|
if (isBrotliSupported) {
|
|
28858
|
-
streams.push(
|
|
28768
|
+
streams.push(zlib.createBrotliDecompress(brotliOptions));
|
|
28859
28769
|
delete res.headers["content-encoding"];
|
|
28860
28770
|
}
|
|
28861
28771
|
}
|
|
28862
28772
|
}
|
|
28863
|
-
responseStream = streams.length > 1 ?
|
|
28773
|
+
responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
|
|
28864
28774
|
const response = {
|
|
28865
28775
|
status: res.statusCode,
|
|
28866
28776
|
statusText: res.statusMessage,
|
|
28867
|
-
headers: new AxiosHeaders
|
|
28777
|
+
headers: new AxiosHeaders(res.headers),
|
|
28868
28778
|
config,
|
|
28869
28779
|
request: lastRequest
|
|
28870
28780
|
};
|
|
@@ -28880,32 +28790,20 @@ var require_axios = __commonJS({
|
|
|
28880
28790
|
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
28881
28791
|
rejected = true;
|
|
28882
28792
|
responseStream.destroy();
|
|
28883
|
-
abort(
|
|
28884
|
-
new AxiosError$1(
|
|
28885
|
-
"maxContentLength size of " + config.maxContentLength + " exceeded",
|
|
28886
|
-
AxiosError$1.ERR_BAD_RESPONSE,
|
|
28887
|
-
config,
|
|
28888
|
-
lastRequest
|
|
28889
|
-
)
|
|
28890
|
-
);
|
|
28793
|
+
abort(new AxiosError("maxContentLength size of " + config.maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
|
|
28891
28794
|
}
|
|
28892
28795
|
});
|
|
28893
28796
|
responseStream.on("aborted", function handlerStreamAborted() {
|
|
28894
28797
|
if (rejected) {
|
|
28895
28798
|
return;
|
|
28896
28799
|
}
|
|
28897
|
-
const err = new AxiosError
|
|
28898
|
-
"stream has been aborted",
|
|
28899
|
-
AxiosError$1.ERR_BAD_RESPONSE,
|
|
28900
|
-
config,
|
|
28901
|
-
lastRequest
|
|
28902
|
-
);
|
|
28800
|
+
const err = new AxiosError("stream has been aborted", AxiosError.ERR_BAD_RESPONSE, config, lastRequest);
|
|
28903
28801
|
responseStream.destroy(err);
|
|
28904
28802
|
reject(err);
|
|
28905
28803
|
});
|
|
28906
28804
|
responseStream.on("error", function handleStreamError(err) {
|
|
28907
28805
|
if (req.destroyed) return;
|
|
28908
|
-
reject(AxiosError
|
|
28806
|
+
reject(AxiosError.from(err, null, config, lastRequest));
|
|
28909
28807
|
});
|
|
28910
28808
|
responseStream.on("end", function handleStreamEnd() {
|
|
28911
28809
|
try {
|
|
@@ -28918,7 +28816,7 @@ var require_axios = __commonJS({
|
|
|
28918
28816
|
}
|
|
28919
28817
|
response.data = responseData;
|
|
28920
28818
|
} catch (err) {
|
|
28921
|
-
return reject(AxiosError
|
|
28819
|
+
return reject(AxiosError.from(err, null, config, response.request, response));
|
|
28922
28820
|
}
|
|
28923
28821
|
settle(resolve, reject, response);
|
|
28924
28822
|
});
|
|
@@ -28938,7 +28836,7 @@ var require_axios = __commonJS({
|
|
|
28938
28836
|
}
|
|
28939
28837
|
});
|
|
28940
28838
|
req.on("error", function handleRequestError(err) {
|
|
28941
|
-
reject(AxiosError
|
|
28839
|
+
reject(AxiosError.from(err, null, config, req));
|
|
28942
28840
|
});
|
|
28943
28841
|
req.on("socket", function handleRequestSocket(socket) {
|
|
28944
28842
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
@@ -28946,14 +28844,7 @@ var require_axios = __commonJS({
|
|
|
28946
28844
|
if (config.timeout) {
|
|
28947
28845
|
const timeout = parseInt(config.timeout, 10);
|
|
28948
28846
|
if (Number.isNaN(timeout)) {
|
|
28949
|
-
abort(
|
|
28950
|
-
new AxiosError$1(
|
|
28951
|
-
"error trying to parse `config.timeout` to int",
|
|
28952
|
-
AxiosError$1.ERR_BAD_OPTION_VALUE,
|
|
28953
|
-
config,
|
|
28954
|
-
req
|
|
28955
|
-
)
|
|
28956
|
-
);
|
|
28847
|
+
abort(new AxiosError("error trying to parse `config.timeout` to int", AxiosError.ERR_BAD_OPTION_VALUE, config, req));
|
|
28957
28848
|
return;
|
|
28958
28849
|
}
|
|
28959
28850
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
@@ -28963,14 +28854,7 @@ var require_axios = __commonJS({
|
|
|
28963
28854
|
if (config.timeoutErrorMessage) {
|
|
28964
28855
|
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
28965
28856
|
}
|
|
28966
|
-
abort(
|
|
28967
|
-
new AxiosError$1(
|
|
28968
|
-
timeoutErrorMessage,
|
|
28969
|
-
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
28970
|
-
config,
|
|
28971
|
-
req
|
|
28972
|
-
)
|
|
28973
|
-
);
|
|
28857
|
+
abort(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, req));
|
|
28974
28858
|
});
|
|
28975
28859
|
} else {
|
|
28976
28860
|
req.setTimeout(0);
|
|
@@ -28987,7 +28871,7 @@ var require_axios = __commonJS({
|
|
|
28987
28871
|
});
|
|
28988
28872
|
data.on("close", () => {
|
|
28989
28873
|
if (!ended && !errored) {
|
|
28990
|
-
abort(new CanceledError
|
|
28874
|
+
abort(new CanceledError("Request stream has been aborted", config, req));
|
|
28991
28875
|
}
|
|
28992
28876
|
});
|
|
28993
28877
|
data.pipe(req);
|
|
@@ -29000,10 +28884,7 @@ var require_axios = __commonJS({
|
|
|
29000
28884
|
var isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
|
|
29001
28885
|
url2 = new URL(url2, platform.origin);
|
|
29002
28886
|
return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
|
|
29003
|
-
})(
|
|
29004
|
-
new URL(platform.origin),
|
|
29005
|
-
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
29006
|
-
) : () => true;
|
|
28887
|
+
})(new URL(platform.origin), platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)) : () => true;
|
|
29007
28888
|
var cookies = platform.hasStandardBrowserEnv ? (
|
|
29008
28889
|
// Standard browser envs support document.cookie
|
|
29009
28890
|
{
|
|
@@ -29048,13 +28929,17 @@ var require_axios = __commonJS({
|
|
|
29048
28929
|
}
|
|
29049
28930
|
}
|
|
29050
28931
|
);
|
|
29051
|
-
var headersToObject = (thing) => thing instanceof AxiosHeaders
|
|
28932
|
+
var headersToObject = (thing) => thing instanceof AxiosHeaders ? {
|
|
28933
|
+
...thing
|
|
28934
|
+
} : thing;
|
|
29052
28935
|
function mergeConfig(config1, config2) {
|
|
29053
28936
|
config2 = config2 || {};
|
|
29054
28937
|
const config = {};
|
|
29055
28938
|
function getMergedValue(target, source, prop, caseless) {
|
|
29056
28939
|
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
29057
|
-
return utils$1.merge.call({
|
|
28940
|
+
return utils$1.merge.call({
|
|
28941
|
+
caseless
|
|
28942
|
+
}, target, source);
|
|
29058
28943
|
} else if (utils$1.isPlainObject(source)) {
|
|
29059
28944
|
return utils$1.merge({}, source);
|
|
29060
28945
|
} else if (utils$1.isArray(source)) {
|
|
@@ -29119,7 +29004,10 @@ var require_axios = __commonJS({
|
|
|
29119
29004
|
validateStatus: mergeDirectKeys,
|
|
29120
29005
|
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
29121
29006
|
};
|
|
29122
|
-
utils$1.forEach(Object.keys({
|
|
29007
|
+
utils$1.forEach(Object.keys({
|
|
29008
|
+
...config1,
|
|
29009
|
+
...config2
|
|
29010
|
+
}), function computeConfigValue(prop) {
|
|
29123
29011
|
if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
|
|
29124
29012
|
const merge2 = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
29125
29013
|
const configValue = merge2(config1[prop], config2[prop], prop);
|
|
@@ -29129,20 +29017,18 @@ var require_axios = __commonJS({
|
|
|
29129
29017
|
}
|
|
29130
29018
|
var resolveConfig = (config) => {
|
|
29131
29019
|
const newConfig = mergeConfig({}, config);
|
|
29132
|
-
let {
|
|
29133
|
-
|
|
29134
|
-
|
|
29135
|
-
|
|
29136
|
-
|
|
29137
|
-
|
|
29138
|
-
|
|
29020
|
+
let {
|
|
29021
|
+
data,
|
|
29022
|
+
withXSRFToken,
|
|
29023
|
+
xsrfHeaderName,
|
|
29024
|
+
xsrfCookieName,
|
|
29025
|
+
headers,
|
|
29026
|
+
auth
|
|
29027
|
+
} = newConfig;
|
|
29028
|
+
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
29029
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
29139
29030
|
if (auth) {
|
|
29140
|
-
headers.set(
|
|
29141
|
-
"Authorization",
|
|
29142
|
-
"Basic " + btoa(
|
|
29143
|
-
(auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")
|
|
29144
|
-
)
|
|
29145
|
-
);
|
|
29031
|
+
headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : "")));
|
|
29146
29032
|
}
|
|
29147
29033
|
if (utils$1.isFormData(data)) {
|
|
29148
29034
|
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
@@ -29173,8 +29059,12 @@ var require_axios = __commonJS({
|
|
|
29173
29059
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
29174
29060
|
const _config = resolveConfig(config);
|
|
29175
29061
|
let requestData = _config.data;
|
|
29176
|
-
const requestHeaders = AxiosHeaders
|
|
29177
|
-
let {
|
|
29062
|
+
const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
|
|
29063
|
+
let {
|
|
29064
|
+
responseType,
|
|
29065
|
+
onUploadProgress,
|
|
29066
|
+
onDownloadProgress
|
|
29067
|
+
} = _config;
|
|
29178
29068
|
let onCanceled;
|
|
29179
29069
|
let uploadThrottled, downloadThrottled;
|
|
29180
29070
|
let flushUpload, flushDownload;
|
|
@@ -29191,9 +29081,7 @@ var require_axios = __commonJS({
|
|
|
29191
29081
|
if (!request) {
|
|
29192
29082
|
return;
|
|
29193
29083
|
}
|
|
29194
|
-
const responseHeaders = AxiosHeaders
|
|
29195
|
-
"getAllResponseHeaders" in request && request.getAllResponseHeaders()
|
|
29196
|
-
);
|
|
29084
|
+
const responseHeaders = AxiosHeaders.from("getAllResponseHeaders" in request && request.getAllResponseHeaders());
|
|
29197
29085
|
const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
|
|
29198
29086
|
const response = {
|
|
29199
29087
|
data: responseData,
|
|
@@ -29203,17 +29091,13 @@ var require_axios = __commonJS({
|
|
|
29203
29091
|
config,
|
|
29204
29092
|
request
|
|
29205
29093
|
};
|
|
29206
|
-
settle(
|
|
29207
|
-
|
|
29208
|
-
|
|
29209
|
-
|
|
29210
|
-
|
|
29211
|
-
|
|
29212
|
-
|
|
29213
|
-
done();
|
|
29214
|
-
},
|
|
29215
|
-
response
|
|
29216
|
-
);
|
|
29094
|
+
settle(function _resolve(value) {
|
|
29095
|
+
resolve(value);
|
|
29096
|
+
done();
|
|
29097
|
+
}, function _reject(err) {
|
|
29098
|
+
reject(err);
|
|
29099
|
+
done();
|
|
29100
|
+
}, response);
|
|
29217
29101
|
request = null;
|
|
29218
29102
|
}
|
|
29219
29103
|
if ("onloadend" in request) {
|
|
@@ -29233,12 +29117,12 @@ var require_axios = __commonJS({
|
|
|
29233
29117
|
if (!request) {
|
|
29234
29118
|
return;
|
|
29235
29119
|
}
|
|
29236
|
-
reject(new AxiosError
|
|
29120
|
+
reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
|
|
29237
29121
|
request = null;
|
|
29238
29122
|
};
|
|
29239
29123
|
request.onerror = function handleError(event) {
|
|
29240
29124
|
const msg = event && event.message ? event.message : "Network Error";
|
|
29241
|
-
const err = new AxiosError
|
|
29125
|
+
const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
|
|
29242
29126
|
err.event = event || null;
|
|
29243
29127
|
reject(err);
|
|
29244
29128
|
request = null;
|
|
@@ -29249,14 +29133,7 @@ var require_axios = __commonJS({
|
|
|
29249
29133
|
if (_config.timeoutErrorMessage) {
|
|
29250
29134
|
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
29251
29135
|
}
|
|
29252
|
-
reject(
|
|
29253
|
-
new AxiosError$1(
|
|
29254
|
-
timeoutErrorMessage,
|
|
29255
|
-
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
29256
|
-
config,
|
|
29257
|
-
request
|
|
29258
|
-
)
|
|
29259
|
-
);
|
|
29136
|
+
reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
|
|
29260
29137
|
request = null;
|
|
29261
29138
|
};
|
|
29262
29139
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
@@ -29285,7 +29162,7 @@ var require_axios = __commonJS({
|
|
|
29285
29162
|
if (!request) {
|
|
29286
29163
|
return;
|
|
29287
29164
|
}
|
|
29288
|
-
reject(!cancel || cancel.type ? new CanceledError
|
|
29165
|
+
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
29289
29166
|
request.abort();
|
|
29290
29167
|
request = null;
|
|
29291
29168
|
};
|
|
@@ -29296,20 +29173,16 @@ var require_axios = __commonJS({
|
|
|
29296
29173
|
}
|
|
29297
29174
|
const protocol = parseProtocol(_config.url);
|
|
29298
29175
|
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
29299
|
-
reject(
|
|
29300
|
-
new AxiosError$1(
|
|
29301
|
-
"Unsupported protocol " + protocol + ":",
|
|
29302
|
-
AxiosError$1.ERR_BAD_REQUEST,
|
|
29303
|
-
config
|
|
29304
|
-
)
|
|
29305
|
-
);
|
|
29176
|
+
reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
|
|
29306
29177
|
return;
|
|
29307
29178
|
}
|
|
29308
29179
|
request.send(requestData || null);
|
|
29309
29180
|
});
|
|
29310
29181
|
};
|
|
29311
29182
|
var composeSignals = (signals, timeout) => {
|
|
29312
|
-
const {
|
|
29183
|
+
const {
|
|
29184
|
+
length
|
|
29185
|
+
} = signals = signals ? signals.filter(Boolean) : [];
|
|
29313
29186
|
if (timeout || length) {
|
|
29314
29187
|
let controller = new AbortController();
|
|
29315
29188
|
let aborted;
|
|
@@ -29318,14 +29191,12 @@ var require_axios = __commonJS({
|
|
|
29318
29191
|
aborted = true;
|
|
29319
29192
|
unsubscribe();
|
|
29320
29193
|
const err = reason instanceof Error ? reason : this.reason;
|
|
29321
|
-
controller.abort(
|
|
29322
|
-
err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err)
|
|
29323
|
-
);
|
|
29194
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
29324
29195
|
}
|
|
29325
29196
|
};
|
|
29326
29197
|
let timer = timeout && setTimeout(() => {
|
|
29327
29198
|
timer = null;
|
|
29328
|
-
onabort(new AxiosError
|
|
29199
|
+
onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
|
|
29329
29200
|
}, timeout);
|
|
29330
29201
|
const unsubscribe = () => {
|
|
29331
29202
|
if (signals) {
|
|
@@ -29338,15 +29209,16 @@ var require_axios = __commonJS({
|
|
|
29338
29209
|
}
|
|
29339
29210
|
};
|
|
29340
29211
|
signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
|
|
29341
|
-
const {
|
|
29212
|
+
const {
|
|
29213
|
+
signal
|
|
29214
|
+
} = controller;
|
|
29342
29215
|
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
29343
29216
|
return signal;
|
|
29344
29217
|
}
|
|
29345
29218
|
};
|
|
29346
|
-
var composeSignals$1 = composeSignals;
|
|
29347
29219
|
var streamChunk = function* (chunk, chunkSize) {
|
|
29348
29220
|
let len = chunk.byteLength;
|
|
29349
|
-
if (
|
|
29221
|
+
if (len < chunkSize) {
|
|
29350
29222
|
yield chunk;
|
|
29351
29223
|
return;
|
|
29352
29224
|
}
|
|
@@ -29371,7 +29243,10 @@ var require_axios = __commonJS({
|
|
|
29371
29243
|
const reader = stream2.getReader();
|
|
29372
29244
|
try {
|
|
29373
29245
|
for (; ; ) {
|
|
29374
|
-
const {
|
|
29246
|
+
const {
|
|
29247
|
+
done,
|
|
29248
|
+
value
|
|
29249
|
+
} = await reader.read();
|
|
29375
29250
|
if (done) {
|
|
29376
29251
|
break;
|
|
29377
29252
|
}
|
|
@@ -29391,44 +29266,52 @@ var require_axios = __commonJS({
|
|
|
29391
29266
|
onFinish && onFinish(e);
|
|
29392
29267
|
}
|
|
29393
29268
|
};
|
|
29394
|
-
return new ReadableStream(
|
|
29395
|
-
{
|
|
29396
|
-
|
|
29397
|
-
|
|
29398
|
-
|
|
29399
|
-
|
|
29400
|
-
|
|
29401
|
-
|
|
29402
|
-
|
|
29403
|
-
|
|
29404
|
-
|
|
29405
|
-
if (onProgress) {
|
|
29406
|
-
let loadedBytes = bytes += len;
|
|
29407
|
-
onProgress(loadedBytes);
|
|
29408
|
-
}
|
|
29409
|
-
controller.enqueue(new Uint8Array(value));
|
|
29410
|
-
} catch (err) {
|
|
29411
|
-
_onFinish(err);
|
|
29412
|
-
throw err;
|
|
29269
|
+
return new ReadableStream({
|
|
29270
|
+
async pull(controller) {
|
|
29271
|
+
try {
|
|
29272
|
+
const {
|
|
29273
|
+
done: done2,
|
|
29274
|
+
value
|
|
29275
|
+
} = await iterator2.next();
|
|
29276
|
+
if (done2) {
|
|
29277
|
+
_onFinish();
|
|
29278
|
+
controller.close();
|
|
29279
|
+
return;
|
|
29413
29280
|
}
|
|
29414
|
-
|
|
29415
|
-
|
|
29416
|
-
|
|
29417
|
-
|
|
29281
|
+
let len = value.byteLength;
|
|
29282
|
+
if (onProgress) {
|
|
29283
|
+
let loadedBytes = bytes += len;
|
|
29284
|
+
onProgress(loadedBytes);
|
|
29285
|
+
}
|
|
29286
|
+
controller.enqueue(new Uint8Array(value));
|
|
29287
|
+
} catch (err) {
|
|
29288
|
+
_onFinish(err);
|
|
29289
|
+
throw err;
|
|
29418
29290
|
}
|
|
29419
29291
|
},
|
|
29420
|
-
{
|
|
29421
|
-
|
|
29292
|
+
cancel(reason) {
|
|
29293
|
+
_onFinish(reason);
|
|
29294
|
+
return iterator2.return();
|
|
29422
29295
|
}
|
|
29423
|
-
|
|
29296
|
+
}, {
|
|
29297
|
+
highWaterMark: 2
|
|
29298
|
+
});
|
|
29424
29299
|
};
|
|
29425
29300
|
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
29426
|
-
var {
|
|
29427
|
-
|
|
29301
|
+
var {
|
|
29302
|
+
isFunction
|
|
29303
|
+
} = utils$1;
|
|
29304
|
+
var globalFetchAPI = (({
|
|
29305
|
+
Request,
|
|
29306
|
+
Response
|
|
29307
|
+
}) => ({
|
|
29428
29308
|
Request,
|
|
29429
29309
|
Response
|
|
29430
29310
|
}))(utils$1.global);
|
|
29431
|
-
var {
|
|
29311
|
+
var {
|
|
29312
|
+
ReadableStream: ReadableStream$1,
|
|
29313
|
+
TextEncoder: TextEncoder$1
|
|
29314
|
+
} = utils$1.global;
|
|
29432
29315
|
var test = (fn, ...args) => {
|
|
29433
29316
|
try {
|
|
29434
29317
|
return !!fn(...args);
|
|
@@ -29437,14 +29320,14 @@ var require_axios = __commonJS({
|
|
|
29437
29320
|
}
|
|
29438
29321
|
};
|
|
29439
29322
|
var factory = (env) => {
|
|
29440
|
-
env = utils$1.merge.call(
|
|
29441
|
-
|
|
29442
|
-
|
|
29443
|
-
|
|
29444
|
-
|
|
29445
|
-
|
|
29446
|
-
|
|
29447
|
-
|
|
29323
|
+
env = utils$1.merge.call({
|
|
29324
|
+
skipUndefined: true
|
|
29325
|
+
}, globalFetchAPI, env);
|
|
29326
|
+
const {
|
|
29327
|
+
fetch: envFetch,
|
|
29328
|
+
Request,
|
|
29329
|
+
Response
|
|
29330
|
+
} = env;
|
|
29448
29331
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
|
|
29449
29332
|
const isRequestSupported = isFunction(Request);
|
|
29450
29333
|
const isResponseSupported = isFunction(Response);
|
|
@@ -29455,14 +29338,16 @@ var require_axios = __commonJS({
|
|
|
29455
29338
|
const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
29456
29339
|
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
29457
29340
|
let duplexAccessed = false;
|
|
29341
|
+
const body = new ReadableStream$1();
|
|
29458
29342
|
const hasContentType = new Request(platform.origin, {
|
|
29459
|
-
body
|
|
29343
|
+
body,
|
|
29460
29344
|
method: "POST",
|
|
29461
29345
|
get duplex() {
|
|
29462
29346
|
duplexAccessed = true;
|
|
29463
29347
|
return "half";
|
|
29464
29348
|
}
|
|
29465
29349
|
}).headers.has("Content-Type");
|
|
29350
|
+
body.cancel();
|
|
29466
29351
|
return duplexAccessed && !hasContentType;
|
|
29467
29352
|
});
|
|
29468
29353
|
const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
|
|
@@ -29476,11 +29361,7 @@ var require_axios = __commonJS({
|
|
|
29476
29361
|
if (method) {
|
|
29477
29362
|
return method.call(res);
|
|
29478
29363
|
}
|
|
29479
|
-
throw new AxiosError$
|
|
29480
|
-
`Response type '${type}' is not supported`,
|
|
29481
|
-
AxiosError$1.ERR_NOT_SUPPORT,
|
|
29482
|
-
config
|
|
29483
|
-
);
|
|
29364
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
29484
29365
|
});
|
|
29485
29366
|
});
|
|
29486
29367
|
})();
|
|
@@ -29529,10 +29410,7 @@ var require_axios = __commonJS({
|
|
|
29529
29410
|
} = resolveConfig(config);
|
|
29530
29411
|
let _fetch = envFetch || fetch;
|
|
29531
29412
|
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
29532
|
-
let composedSignal = composeSignals
|
|
29533
|
-
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
29534
|
-
timeout
|
|
29535
|
-
);
|
|
29413
|
+
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
29536
29414
|
let request = null;
|
|
29537
29415
|
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
29538
29416
|
composedSignal.unsubscribe();
|
|
@@ -29550,10 +29428,7 @@ var require_axios = __commonJS({
|
|
|
29550
29428
|
headers.setContentType(contentTypeHeader);
|
|
29551
29429
|
}
|
|
29552
29430
|
if (_request.body) {
|
|
29553
|
-
const [onProgress, flush] = progressEventDecorator(
|
|
29554
|
-
requestContentLength,
|
|
29555
|
-
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
29556
|
-
);
|
|
29431
|
+
const [onProgress, flush] = progressEventDecorator(requestContentLength, progressEventReducer(asyncDecorator(onUploadProgress)));
|
|
29557
29432
|
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
29558
29433
|
}
|
|
29559
29434
|
}
|
|
@@ -29579,28 +29454,19 @@ var require_axios = __commonJS({
|
|
|
29579
29454
|
options[prop] = response[prop];
|
|
29580
29455
|
});
|
|
29581
29456
|
const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
|
|
29582
|
-
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
29583
|
-
|
|
29584
|
-
|
|
29585
|
-
|
|
29586
|
-
|
|
29587
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
29588
|
-
flush && flush();
|
|
29589
|
-
unsubscribe && unsubscribe();
|
|
29590
|
-
}),
|
|
29591
|
-
options
|
|
29592
|
-
);
|
|
29457
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || [];
|
|
29458
|
+
response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
29459
|
+
flush && flush();
|
|
29460
|
+
unsubscribe && unsubscribe();
|
|
29461
|
+
}), options);
|
|
29593
29462
|
}
|
|
29594
29463
|
responseType = responseType || "text";
|
|
29595
|
-
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](
|
|
29596
|
-
response,
|
|
29597
|
-
config
|
|
29598
|
-
);
|
|
29464
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
|
|
29599
29465
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
29600
29466
|
return await new Promise((resolve, reject) => {
|
|
29601
29467
|
settle(resolve, reject, {
|
|
29602
29468
|
data: responseData,
|
|
29603
|
-
headers: AxiosHeaders
|
|
29469
|
+
headers: AxiosHeaders.from(response.headers),
|
|
29604
29470
|
status: response.status,
|
|
29605
29471
|
statusText: response.statusText,
|
|
29606
29472
|
config,
|
|
@@ -29610,27 +29476,22 @@ var require_axios = __commonJS({
|
|
|
29610
29476
|
} catch (err) {
|
|
29611
29477
|
unsubscribe && unsubscribe();
|
|
29612
29478
|
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
29613
|
-
throw Object.assign(
|
|
29614
|
-
|
|
29615
|
-
|
|
29616
|
-
AxiosError$1.ERR_NETWORK,
|
|
29617
|
-
config,
|
|
29618
|
-
request,
|
|
29619
|
-
err && err.response
|
|
29620
|
-
),
|
|
29621
|
-
{
|
|
29622
|
-
cause: err.cause || err
|
|
29623
|
-
}
|
|
29624
|
-
);
|
|
29479
|
+
throw Object.assign(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response), {
|
|
29480
|
+
cause: err.cause || err
|
|
29481
|
+
});
|
|
29625
29482
|
}
|
|
29626
|
-
throw AxiosError
|
|
29483
|
+
throw AxiosError.from(err, err && err.code, config, request, err && err.response);
|
|
29627
29484
|
}
|
|
29628
29485
|
};
|
|
29629
29486
|
};
|
|
29630
29487
|
var seedCache = /* @__PURE__ */ new Map();
|
|
29631
29488
|
var getFetch = (config) => {
|
|
29632
29489
|
let env = config && config.env || {};
|
|
29633
|
-
const {
|
|
29490
|
+
const {
|
|
29491
|
+
fetch: fetch2,
|
|
29492
|
+
Request,
|
|
29493
|
+
Response
|
|
29494
|
+
} = env;
|
|
29634
29495
|
const seeds = [Request, Response, fetch2];
|
|
29635
29496
|
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
29636
29497
|
while (i--) {
|
|
@@ -29652,17 +29513,23 @@ var require_axios = __commonJS({
|
|
|
29652
29513
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
29653
29514
|
if (fn) {
|
|
29654
29515
|
try {
|
|
29655
|
-
Object.defineProperty(fn, "name", {
|
|
29516
|
+
Object.defineProperty(fn, "name", {
|
|
29517
|
+
value
|
|
29518
|
+
});
|
|
29656
29519
|
} catch (e) {
|
|
29657
29520
|
}
|
|
29658
|
-
Object.defineProperty(fn, "adapterName", {
|
|
29521
|
+
Object.defineProperty(fn, "adapterName", {
|
|
29522
|
+
value
|
|
29523
|
+
});
|
|
29659
29524
|
}
|
|
29660
29525
|
});
|
|
29661
29526
|
var renderReason = (reason) => `- ${reason}`;
|
|
29662
29527
|
var isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
29663
29528
|
function getAdapter(adapters2, config) {
|
|
29664
29529
|
adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
|
|
29665
|
-
const {
|
|
29530
|
+
const {
|
|
29531
|
+
length
|
|
29532
|
+
} = adapters2;
|
|
29666
29533
|
let nameOrAdapter;
|
|
29667
29534
|
let adapter;
|
|
29668
29535
|
const rejectedReasons = {};
|
|
@@ -29673,7 +29540,7 @@ var require_axios = __commonJS({
|
|
|
29673
29540
|
if (!isResolvedHandle(nameOrAdapter)) {
|
|
29674
29541
|
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
29675
29542
|
if (adapter === void 0) {
|
|
29676
|
-
throw new AxiosError
|
|
29543
|
+
throw new AxiosError(`Unknown adapter '${id}'`);
|
|
29677
29544
|
}
|
|
29678
29545
|
}
|
|
29679
29546
|
if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
|
|
@@ -29682,14 +29549,9 @@ var require_axios = __commonJS({
|
|
|
29682
29549
|
rejectedReasons[id || "#" + i] = adapter;
|
|
29683
29550
|
}
|
|
29684
29551
|
if (!adapter) {
|
|
29685
|
-
const reasons = Object.entries(rejectedReasons).map(
|
|
29686
|
-
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
29687
|
-
);
|
|
29552
|
+
const reasons = Object.entries(rejectedReasons).map(([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build"));
|
|
29688
29553
|
let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
|
|
29689
|
-
throw new AxiosError
|
|
29690
|
-
`There is no suitable adapter to dispatch the request ` + s,
|
|
29691
|
-
"ERR_NOT_SUPPORT"
|
|
29692
|
-
);
|
|
29554
|
+
throw new AxiosError(`There is no suitable adapter to dispatch the request ` + s, "ERR_NOT_SUPPORT");
|
|
29693
29555
|
}
|
|
29694
29556
|
return adapter;
|
|
29695
29557
|
}
|
|
@@ -29710,39 +29572,32 @@ var require_axios = __commonJS({
|
|
|
29710
29572
|
config.cancelToken.throwIfRequested();
|
|
29711
29573
|
}
|
|
29712
29574
|
if (config.signal && config.signal.aborted) {
|
|
29713
|
-
throw new CanceledError
|
|
29575
|
+
throw new CanceledError(null, config);
|
|
29714
29576
|
}
|
|
29715
29577
|
}
|
|
29716
29578
|
function dispatchRequest(config) {
|
|
29717
29579
|
throwIfCancellationRequested(config);
|
|
29718
|
-
config.headers = AxiosHeaders
|
|
29580
|
+
config.headers = AxiosHeaders.from(config.headers);
|
|
29719
29581
|
config.data = transformData.call(config, config.transformRequest);
|
|
29720
29582
|
if (["post", "put", "patch"].indexOf(config.method) !== -1) {
|
|
29721
29583
|
config.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
29722
29584
|
}
|
|
29723
|
-
const adapter = adapters.getAdapter(config.adapter || defaults
|
|
29724
|
-
return adapter(config).then(
|
|
29725
|
-
|
|
29585
|
+
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
29586
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
29587
|
+
throwIfCancellationRequested(config);
|
|
29588
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
29589
|
+
response.headers = AxiosHeaders.from(response.headers);
|
|
29590
|
+
return response;
|
|
29591
|
+
}, function onAdapterRejection(reason) {
|
|
29592
|
+
if (!isCancel(reason)) {
|
|
29726
29593
|
throwIfCancellationRequested(config);
|
|
29727
|
-
|
|
29728
|
-
|
|
29729
|
-
|
|
29730
|
-
},
|
|
29731
|
-
function onAdapterRejection(reason) {
|
|
29732
|
-
if (!isCancel(reason)) {
|
|
29733
|
-
throwIfCancellationRequested(config);
|
|
29734
|
-
if (reason && reason.response) {
|
|
29735
|
-
reason.response.data = transformData.call(
|
|
29736
|
-
config,
|
|
29737
|
-
config.transformResponse,
|
|
29738
|
-
reason.response
|
|
29739
|
-
);
|
|
29740
|
-
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
29741
|
-
}
|
|
29594
|
+
if (reason && reason.response) {
|
|
29595
|
+
reason.response.data = transformData.call(config, config.transformResponse, reason.response);
|
|
29596
|
+
reason.response.headers = AxiosHeaders.from(reason.response.headers);
|
|
29742
29597
|
}
|
|
29743
|
-
return Promise.reject(reason);
|
|
29744
29598
|
}
|
|
29745
|
-
|
|
29599
|
+
return Promise.reject(reason);
|
|
29600
|
+
});
|
|
29746
29601
|
}
|
|
29747
29602
|
var validators$1 = {};
|
|
29748
29603
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
@@ -29757,19 +29612,11 @@ var require_axios = __commonJS({
|
|
|
29757
29612
|
}
|
|
29758
29613
|
return (value, opt, opts) => {
|
|
29759
29614
|
if (validator2 === false) {
|
|
29760
|
-
throw new AxiosError
|
|
29761
|
-
formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")),
|
|
29762
|
-
AxiosError$1.ERR_DEPRECATED
|
|
29763
|
-
);
|
|
29615
|
+
throw new AxiosError(formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")), AxiosError.ERR_DEPRECATED);
|
|
29764
29616
|
}
|
|
29765
29617
|
if (version2 && !deprecatedWarnings[opt]) {
|
|
29766
29618
|
deprecatedWarnings[opt] = true;
|
|
29767
|
-
console.warn(
|
|
29768
|
-
formatMessage(
|
|
29769
|
-
opt,
|
|
29770
|
-
" has been deprecated since v" + version2 + " and will be removed in the near future"
|
|
29771
|
-
)
|
|
29772
|
-
);
|
|
29619
|
+
console.warn(formatMessage(opt, " has been deprecated since v" + version2 + " and will be removed in the near future"));
|
|
29773
29620
|
}
|
|
29774
29621
|
return validator2 ? validator2(value, opt, opts) : true;
|
|
29775
29622
|
};
|
|
@@ -29782,7 +29629,7 @@ var require_axios = __commonJS({
|
|
|
29782
29629
|
};
|
|
29783
29630
|
function assertOptions(options, schema, allowUnknown) {
|
|
29784
29631
|
if (typeof options !== "object") {
|
|
29785
|
-
throw new AxiosError
|
|
29632
|
+
throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
|
|
29786
29633
|
}
|
|
29787
29634
|
const keys = Object.keys(options);
|
|
29788
29635
|
let i = keys.length;
|
|
@@ -29793,15 +29640,12 @@ var require_axios = __commonJS({
|
|
|
29793
29640
|
const value = options[opt];
|
|
29794
29641
|
const result = value === void 0 || validator2(value, opt, options);
|
|
29795
29642
|
if (result !== true) {
|
|
29796
|
-
throw new AxiosError
|
|
29797
|
-
"option " + opt + " must be " + result,
|
|
29798
|
-
AxiosError$1.ERR_BAD_OPTION_VALUE
|
|
29799
|
-
);
|
|
29643
|
+
throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
|
|
29800
29644
|
}
|
|
29801
29645
|
continue;
|
|
29802
29646
|
}
|
|
29803
29647
|
if (allowUnknown !== true) {
|
|
29804
|
-
throw new AxiosError
|
|
29648
|
+
throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
|
|
29805
29649
|
}
|
|
29806
29650
|
}
|
|
29807
29651
|
}
|
|
@@ -29814,8 +29658,8 @@ var require_axios = __commonJS({
|
|
|
29814
29658
|
constructor(instanceConfig) {
|
|
29815
29659
|
this.defaults = instanceConfig || {};
|
|
29816
29660
|
this.interceptors = {
|
|
29817
|
-
request: new InterceptorManager
|
|
29818
|
-
response: new InterceptorManager
|
|
29661
|
+
request: new InterceptorManager(),
|
|
29662
|
+
response: new InterceptorManager()
|
|
29819
29663
|
};
|
|
29820
29664
|
}
|
|
29821
29665
|
/**
|
|
@@ -29854,18 +29698,18 @@ var require_axios = __commonJS({
|
|
|
29854
29698
|
config = configOrUrl || {};
|
|
29855
29699
|
}
|
|
29856
29700
|
config = mergeConfig(this.defaults, config);
|
|
29857
|
-
const {
|
|
29701
|
+
const {
|
|
29702
|
+
transitional,
|
|
29703
|
+
paramsSerializer,
|
|
29704
|
+
headers
|
|
29705
|
+
} = config;
|
|
29858
29706
|
if (transitional !== void 0) {
|
|
29859
|
-
validator.assertOptions(
|
|
29860
|
-
transitional,
|
|
29861
|
-
|
|
29862
|
-
|
|
29863
|
-
|
|
29864
|
-
|
|
29865
|
-
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
|
|
29866
|
-
},
|
|
29867
|
-
false
|
|
29868
|
-
);
|
|
29707
|
+
validator.assertOptions(transitional, {
|
|
29708
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
29709
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
29710
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
29711
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
|
|
29712
|
+
}, false);
|
|
29869
29713
|
}
|
|
29870
29714
|
if (paramsSerializer != null) {
|
|
29871
29715
|
if (utils$1.isFunction(paramsSerializer)) {
|
|
@@ -29873,14 +29717,10 @@ var require_axios = __commonJS({
|
|
|
29873
29717
|
serialize: paramsSerializer
|
|
29874
29718
|
};
|
|
29875
29719
|
} else {
|
|
29876
|
-
validator.assertOptions(
|
|
29877
|
-
|
|
29878
|
-
|
|
29879
|
-
|
|
29880
|
-
serialize: validators.function
|
|
29881
|
-
},
|
|
29882
|
-
true
|
|
29883
|
-
);
|
|
29720
|
+
validator.assertOptions(paramsSerializer, {
|
|
29721
|
+
encode: validators.function,
|
|
29722
|
+
serialize: validators.function
|
|
29723
|
+
}, true);
|
|
29884
29724
|
}
|
|
29885
29725
|
}
|
|
29886
29726
|
if (config.allowAbsoluteUrls !== void 0) ;
|
|
@@ -29889,20 +29729,16 @@ var require_axios = __commonJS({
|
|
|
29889
29729
|
} else {
|
|
29890
29730
|
config.allowAbsoluteUrls = true;
|
|
29891
29731
|
}
|
|
29892
|
-
validator.assertOptions(
|
|
29893
|
-
|
|
29894
|
-
|
|
29895
|
-
|
|
29896
|
-
withXsrfToken: validators.spelling("withXSRFToken")
|
|
29897
|
-
},
|
|
29898
|
-
true
|
|
29899
|
-
);
|
|
29732
|
+
validator.assertOptions(config, {
|
|
29733
|
+
baseUrl: validators.spelling("baseURL"),
|
|
29734
|
+
withXsrfToken: validators.spelling("withXSRFToken")
|
|
29735
|
+
}, true);
|
|
29900
29736
|
config.method = (config.method || this.defaults.method || "get").toLowerCase();
|
|
29901
29737
|
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
29902
29738
|
headers && utils$1.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (method) => {
|
|
29903
29739
|
delete headers[method];
|
|
29904
29740
|
});
|
|
29905
|
-
config.headers = AxiosHeaders
|
|
29741
|
+
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
|
29906
29742
|
const requestInterceptorChain = [];
|
|
29907
29743
|
let synchronousRequestInterceptors = true;
|
|
29908
29744
|
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
@@ -29968,34 +29804,29 @@ var require_axios = __commonJS({
|
|
|
29968
29804
|
};
|
|
29969
29805
|
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
29970
29806
|
Axios.prototype[method] = function(url2, config) {
|
|
29971
|
-
return this.request(
|
|
29972
|
-
|
|
29973
|
-
|
|
29974
|
-
|
|
29975
|
-
|
|
29976
|
-
})
|
|
29977
|
-
);
|
|
29807
|
+
return this.request(mergeConfig(config || {}, {
|
|
29808
|
+
method,
|
|
29809
|
+
url: url2,
|
|
29810
|
+
data: (config || {}).data
|
|
29811
|
+
}));
|
|
29978
29812
|
};
|
|
29979
29813
|
});
|
|
29980
29814
|
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
29981
29815
|
function generateHTTPMethod(isForm) {
|
|
29982
29816
|
return function httpMethod(url2, data, config) {
|
|
29983
|
-
return this.request(
|
|
29984
|
-
|
|
29985
|
-
|
|
29986
|
-
|
|
29987
|
-
|
|
29988
|
-
|
|
29989
|
-
|
|
29990
|
-
|
|
29991
|
-
})
|
|
29992
|
-
);
|
|
29817
|
+
return this.request(mergeConfig(config || {}, {
|
|
29818
|
+
method,
|
|
29819
|
+
headers: isForm ? {
|
|
29820
|
+
"Content-Type": "multipart/form-data"
|
|
29821
|
+
} : {},
|
|
29822
|
+
url: url2,
|
|
29823
|
+
data
|
|
29824
|
+
}));
|
|
29993
29825
|
};
|
|
29994
29826
|
}
|
|
29995
29827
|
Axios.prototype[method] = generateHTTPMethod();
|
|
29996
29828
|
Axios.prototype[method + "Form"] = generateHTTPMethod(true);
|
|
29997
29829
|
});
|
|
29998
|
-
var Axios$1 = Axios;
|
|
29999
29830
|
var CancelToken = class _CancelToken {
|
|
30000
29831
|
constructor(executor) {
|
|
30001
29832
|
if (typeof executor !== "function") {
|
|
@@ -30029,7 +29860,7 @@ var require_axios = __commonJS({
|
|
|
30029
29860
|
if (token2.reason) {
|
|
30030
29861
|
return;
|
|
30031
29862
|
}
|
|
30032
|
-
token2.reason = new CanceledError
|
|
29863
|
+
token2.reason = new CanceledError(message, config, request);
|
|
30033
29864
|
resolvePromise(token2.reason);
|
|
30034
29865
|
});
|
|
30035
29866
|
}
|
|
@@ -30091,7 +29922,6 @@ var require_axios = __commonJS({
|
|
|
30091
29922
|
};
|
|
30092
29923
|
}
|
|
30093
29924
|
};
|
|
30094
|
-
var CancelToken$1 = CancelToken;
|
|
30095
29925
|
function spread(callback) {
|
|
30096
29926
|
return function wrap(arr) {
|
|
30097
29927
|
return callback.apply(null, arr);
|
|
@@ -30174,25 +30004,28 @@ var require_axios = __commonJS({
|
|
|
30174
30004
|
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
30175
30005
|
HttpStatusCode[value] = key;
|
|
30176
30006
|
});
|
|
30177
|
-
var HttpStatusCode$1 = HttpStatusCode;
|
|
30178
30007
|
function createInstance(defaultConfig) {
|
|
30179
|
-
const context = new Axios
|
|
30180
|
-
const instance = bind(Axios
|
|
30181
|
-
utils$1.extend(instance, Axios
|
|
30182
|
-
|
|
30008
|
+
const context = new Axios(defaultConfig);
|
|
30009
|
+
const instance = bind(Axios.prototype.request, context);
|
|
30010
|
+
utils$1.extend(instance, Axios.prototype, context, {
|
|
30011
|
+
allOwnKeys: true
|
|
30012
|
+
});
|
|
30013
|
+
utils$1.extend(instance, context, null, {
|
|
30014
|
+
allOwnKeys: true
|
|
30015
|
+
});
|
|
30183
30016
|
instance.create = function create(instanceConfig) {
|
|
30184
30017
|
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
30185
30018
|
};
|
|
30186
30019
|
return instance;
|
|
30187
30020
|
}
|
|
30188
|
-
var axios = createInstance(defaults
|
|
30189
|
-
axios.Axios = Axios
|
|
30190
|
-
axios.CanceledError = CanceledError
|
|
30191
|
-
axios.CancelToken = CancelToken
|
|
30021
|
+
var axios = createInstance(defaults);
|
|
30022
|
+
axios.Axios = Axios;
|
|
30023
|
+
axios.CanceledError = CanceledError;
|
|
30024
|
+
axios.CancelToken = CancelToken;
|
|
30192
30025
|
axios.isCancel = isCancel;
|
|
30193
30026
|
axios.VERSION = VERSION2;
|
|
30194
30027
|
axios.toFormData = toFormData;
|
|
30195
|
-
axios.AxiosError = AxiosError
|
|
30028
|
+
axios.AxiosError = AxiosError;
|
|
30196
30029
|
axios.Cancel = axios.CanceledError;
|
|
30197
30030
|
axios.all = function all(promises) {
|
|
30198
30031
|
return Promise.all(promises);
|
|
@@ -30200,10 +30033,10 @@ var require_axios = __commonJS({
|
|
|
30200
30033
|
axios.spread = spread;
|
|
30201
30034
|
axios.isAxiosError = isAxiosError;
|
|
30202
30035
|
axios.mergeConfig = mergeConfig;
|
|
30203
|
-
axios.AxiosHeaders = AxiosHeaders
|
|
30036
|
+
axios.AxiosHeaders = AxiosHeaders;
|
|
30204
30037
|
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
30205
30038
|
axios.getAdapter = adapters.getAdapter;
|
|
30206
|
-
axios.HttpStatusCode = HttpStatusCode
|
|
30039
|
+
axios.HttpStatusCode = HttpStatusCode;
|
|
30207
30040
|
axios.default = axios;
|
|
30208
30041
|
module2.exports = axios;
|
|
30209
30042
|
}
|
|
@@ -30268,27 +30101,7 @@ var require_dist = __commonJS({
|
|
|
30268
30101
|
|
|
30269
30102
|
// src/sap-ai-error.ts
|
|
30270
30103
|
function convertSAPErrorToAPICallError(errorResponse, context) {
|
|
30271
|
-
const
|
|
30272
|
-
let message;
|
|
30273
|
-
let code;
|
|
30274
|
-
let location;
|
|
30275
|
-
let requestId;
|
|
30276
|
-
if (Array.isArray(error)) {
|
|
30277
|
-
const firstError = error[0];
|
|
30278
|
-
if (firstError) {
|
|
30279
|
-
message = firstError.message;
|
|
30280
|
-
code = firstError.code;
|
|
30281
|
-
location = firstError.location;
|
|
30282
|
-
requestId = firstError.request_id;
|
|
30283
|
-
} else {
|
|
30284
|
-
message = "Unknown SAP AI error";
|
|
30285
|
-
}
|
|
30286
|
-
} else {
|
|
30287
|
-
message = error.message;
|
|
30288
|
-
code = error.code;
|
|
30289
|
-
location = error.location;
|
|
30290
|
-
requestId = error.request_id;
|
|
30291
|
-
}
|
|
30104
|
+
const { code, location, message, requestId } = extractErrorFields(errorResponse);
|
|
30292
30105
|
const statusCode = getStatusCodeFromSAPError(code);
|
|
30293
30106
|
const responseBody = JSON.stringify({
|
|
30294
30107
|
error: {
|
|
@@ -30349,22 +30162,14 @@ function convertToAISDKError(error, context) {
|
|
|
30349
30162
|
if (error instanceof import_provider2.APICallError || error instanceof import_provider2.LoadAPIKeyError || error instanceof import_provider2.NoSuchModelError) {
|
|
30350
30163
|
return error;
|
|
30351
30164
|
}
|
|
30352
|
-
const rootError =
|
|
30353
|
-
|
|
30354
|
-
|
|
30165
|
+
const rootError = getRootError(error);
|
|
30166
|
+
const errorResponse = findOrchestrationErrorResponse(error);
|
|
30167
|
+
if (errorResponse) {
|
|
30168
|
+
return convertSAPErrorToAPICallError(errorResponse, {
|
|
30355
30169
|
...context,
|
|
30356
30170
|
responseHeaders: context?.responseHeaders ?? getAxiosResponseHeaders(error)
|
|
30357
30171
|
});
|
|
30358
30172
|
}
|
|
30359
|
-
if (rootError instanceof Error) {
|
|
30360
|
-
const parsedError = tryExtractSAPErrorFromMessage(rootError.message);
|
|
30361
|
-
if (parsedError && isOrchestrationErrorResponse(parsedError)) {
|
|
30362
|
-
return convertSAPErrorToAPICallError(parsedError, {
|
|
30363
|
-
...context,
|
|
30364
|
-
responseHeaders: context?.responseHeaders ?? getAxiosResponseHeaders(error)
|
|
30365
|
-
});
|
|
30366
|
-
}
|
|
30367
|
-
}
|
|
30368
30173
|
if (isAbortError(rootError)) {
|
|
30369
30174
|
return createAPICallError(
|
|
30370
30175
|
error,
|
|
@@ -30438,6 +30243,10 @@ See: https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-depl
|
|
|
30438
30243
|
context
|
|
30439
30244
|
);
|
|
30440
30245
|
}
|
|
30246
|
+
function isPrefillError(error) {
|
|
30247
|
+
const message = extractSAPErrorMessage(error)?.toLowerCase();
|
|
30248
|
+
return message !== void 0 && PREFILL_ERROR_KEYWORDS.some((kw) => message.includes(kw));
|
|
30249
|
+
}
|
|
30441
30250
|
function normalizeHeaders(headers) {
|
|
30442
30251
|
if (!headers || typeof headers !== "object") return void 0;
|
|
30443
30252
|
const record = headers;
|
|
@@ -30474,6 +30283,25 @@ ${responseBody}` : options.message;
|
|
|
30474
30283
|
url: context?.url ?? ""
|
|
30475
30284
|
});
|
|
30476
30285
|
}
|
|
30286
|
+
function extractErrorFields(response) {
|
|
30287
|
+
const innerError = response.error;
|
|
30288
|
+
if (Array.isArray(innerError)) {
|
|
30289
|
+
const first2 = innerError[0];
|
|
30290
|
+
return {
|
|
30291
|
+
code: first2?.code,
|
|
30292
|
+
location: first2?.location,
|
|
30293
|
+
message: first2?.message ?? "Unknown SAP AI error",
|
|
30294
|
+
requestId: first2?.request_id
|
|
30295
|
+
};
|
|
30296
|
+
}
|
|
30297
|
+
const entry = innerError;
|
|
30298
|
+
return {
|
|
30299
|
+
code: entry.code,
|
|
30300
|
+
location: entry.location,
|
|
30301
|
+
message: entry.message,
|
|
30302
|
+
requestId: entry.request_id
|
|
30303
|
+
};
|
|
30304
|
+
}
|
|
30477
30305
|
function extractModelIdentifier(message, location) {
|
|
30478
30306
|
const patterns = [
|
|
30479
30307
|
/deployment[:\s]+([a-zA-Z0-9_-]+)/i,
|
|
@@ -30494,9 +30322,33 @@ function extractModelIdentifier(message, location) {
|
|
|
30494
30322
|
}
|
|
30495
30323
|
return void 0;
|
|
30496
30324
|
}
|
|
30325
|
+
function extractSAPErrorMessage(error) {
|
|
30326
|
+
const errorResponse = findOrchestrationErrorResponse(error);
|
|
30327
|
+
if (errorResponse) {
|
|
30328
|
+
return extractErrorFields(errorResponse).message;
|
|
30329
|
+
}
|
|
30330
|
+
const rootError = getRootError(error);
|
|
30331
|
+
if (rootError instanceof Error) {
|
|
30332
|
+
return rootError.message;
|
|
30333
|
+
}
|
|
30334
|
+
return typeof rootError === "string" ? rootError : void 0;
|
|
30335
|
+
}
|
|
30336
|
+
function findOrchestrationErrorResponse(error) {
|
|
30337
|
+
const rootError = getRootError(error);
|
|
30338
|
+
if (isOrchestrationErrorResponse(rootError)) {
|
|
30339
|
+
return rootError;
|
|
30340
|
+
}
|
|
30341
|
+
if (rootError instanceof Error) {
|
|
30342
|
+
const parsed = tryExtractSAPErrorFromMessage(rootError.message);
|
|
30343
|
+
if (parsed && isOrchestrationErrorResponse(parsed)) {
|
|
30344
|
+
return parsed;
|
|
30345
|
+
}
|
|
30346
|
+
}
|
|
30347
|
+
return void 0;
|
|
30348
|
+
}
|
|
30497
30349
|
function getAxiosError(error) {
|
|
30498
30350
|
if (!(error instanceof Error)) return void 0;
|
|
30499
|
-
const rootCause = (
|
|
30351
|
+
const rootCause = getRootError(error);
|
|
30500
30352
|
if (typeof rootCause !== "object" || rootCause === null) return void 0;
|
|
30501
30353
|
const maybeAxios = rootCause;
|
|
30502
30354
|
if (maybeAxios.isAxiosError !== true) return void 0;
|
|
@@ -30512,6 +30364,9 @@ function getAxiosResponseHeaders(error) {
|
|
|
30512
30364
|
if (!axiosError) return void 0;
|
|
30513
30365
|
return normalizeHeaders(axiosError.response?.headers);
|
|
30514
30366
|
}
|
|
30367
|
+
function getRootError(error) {
|
|
30368
|
+
return error instanceof Error && (0, import_util.isErrorWithCause)(error) ? error.rootCause : error;
|
|
30369
|
+
}
|
|
30515
30370
|
function getStatusCodeFromSAPError(code) {
|
|
30516
30371
|
if (!code) return HTTP_STATUS.INTERNAL_ERROR;
|
|
30517
30372
|
if (code >= 100 && code < 600) {
|
|
@@ -30598,7 +30453,7 @@ function tryExtractSAPErrorFromMessage(message) {
|
|
|
30598
30453
|
return null;
|
|
30599
30454
|
}
|
|
30600
30455
|
}
|
|
30601
|
-
var import_provider2, import_util, HTTP_STATUS, ERROR_MATCHERS, AUTHENTICATION_ERROR_KEYWORDS, DEPLOYMENT_ERROR_KEYWORDS, ApiSwitchError, UnsupportedFeatureError;
|
|
30456
|
+
var import_provider2, import_util, HTTP_STATUS, ERROR_MATCHERS, AUTHENTICATION_ERROR_KEYWORDS, DEPLOYMENT_ERROR_KEYWORDS, ApiSwitchError, UnsupportedFeatureError, PREFILL_ERROR_KEYWORDS;
|
|
30602
30457
|
var init_sap_ai_error = __esm({
|
|
30603
30458
|
"src/sap-ai-error.ts"() {
|
|
30604
30459
|
"use strict";
|
|
@@ -30757,6 +30612,10 @@ The model's response was blocked by content safety filters. Try a different prom
|
|
|
30757
30612
|
this.name = "UnsupportedFeatureError";
|
|
30758
30613
|
}
|
|
30759
30614
|
};
|
|
30615
|
+
PREFILL_ERROR_KEYWORDS = [
|
|
30616
|
+
"does not support assistant message prefill",
|
|
30617
|
+
"conversation must end with a user message"
|
|
30618
|
+
];
|
|
30760
30619
|
}
|
|
30761
30620
|
});
|
|
30762
30621
|
|
|
@@ -31435,7 +31294,7 @@ var VERSION;
|
|
|
31435
31294
|
var init_version = __esm({
|
|
31436
31295
|
"src/version.ts"() {
|
|
31437
31296
|
"use strict";
|
|
31438
|
-
VERSION = true ? "4.6.
|
|
31297
|
+
VERSION = true ? "4.6.3" : "0.0.0-test";
|
|
31439
31298
|
}
|
|
31440
31299
|
});
|
|
31441
31300
|
|
|
@@ -31650,6 +31509,15 @@ var init_base_language_model_strategy = __esm({
|
|
|
31650
31509
|
warnings: [...commonParts.warnings, ...warnings]
|
|
31651
31510
|
});
|
|
31652
31511
|
} catch (error) {
|
|
31512
|
+
if (this.shouldRetryWithoutPrefill(error, settings, options)) {
|
|
31513
|
+
const retryPrompt = this.stripTrailingAssistantMessages(options.prompt);
|
|
31514
|
+
if (retryPrompt.length > 0 && retryPrompt.at(-1)?.role === "user") {
|
|
31515
|
+
return this.doGenerate(config, settings, {
|
|
31516
|
+
...options,
|
|
31517
|
+
prompt: retryPrompt
|
|
31518
|
+
});
|
|
31519
|
+
}
|
|
31520
|
+
}
|
|
31653
31521
|
throw convertToAISDKError(error, {
|
|
31654
31522
|
operation: "doGenerate",
|
|
31655
31523
|
requestBody: createAISDKRequestBodySummary(options),
|
|
@@ -31699,6 +31567,15 @@ var init_base_language_model_strategy = __esm({
|
|
|
31699
31567
|
stream: transformedStream
|
|
31700
31568
|
};
|
|
31701
31569
|
} catch (error) {
|
|
31570
|
+
if (this.shouldRetryWithoutPrefill(error, settings, options)) {
|
|
31571
|
+
const retryPrompt = this.stripTrailingAssistantMessages(options.prompt);
|
|
31572
|
+
if (retryPrompt.length > 0 && retryPrompt.at(-1)?.role === "user") {
|
|
31573
|
+
return this.doStream(config, settings, {
|
|
31574
|
+
...options,
|
|
31575
|
+
prompt: retryPrompt
|
|
31576
|
+
});
|
|
31577
|
+
}
|
|
31578
|
+
}
|
|
31702
31579
|
throw convertToAISDKError(error, {
|
|
31703
31580
|
operation: "doStream",
|
|
31704
31581
|
requestBody: createAISDKRequestBodySummary(options),
|
|
@@ -31774,6 +31651,32 @@ var init_base_language_model_strategy = __esm({
|
|
|
31774
31651
|
getIncludeReasoning(sapOptions, settings) {
|
|
31775
31652
|
return sapOptions?.includeReasoning ?? settings.includeReasoning ?? false;
|
|
31776
31653
|
}
|
|
31654
|
+
/**
|
|
31655
|
+
* Checks whether a prefill error should trigger a retry without trailing assistant messages.
|
|
31656
|
+
* @param error - Caught error from API call.
|
|
31657
|
+
* @param settings - Model settings.
|
|
31658
|
+
* @param options - Call options containing the prompt.
|
|
31659
|
+
* @returns Whether the request should be retried without trailing assistant messages.
|
|
31660
|
+
* @internal
|
|
31661
|
+
*/
|
|
31662
|
+
shouldRetryWithoutPrefill(error, settings, options) {
|
|
31663
|
+
const suppress = settings.suppressPrefillErrors ?? true;
|
|
31664
|
+
return suppress && isPrefillError(error) && options.prompt.length > 0 && options.prompt.at(-1)?.role === "assistant";
|
|
31665
|
+
}
|
|
31666
|
+
/**
|
|
31667
|
+
* Strips all trailing assistant messages from a prompt for prefill retry.
|
|
31668
|
+
* Removes all (not just the last) to guarantee the retry cannot re-trigger.
|
|
31669
|
+
* @param prompt - Original prompt array.
|
|
31670
|
+
* @returns Prompt with trailing assistant messages removed.
|
|
31671
|
+
* @internal
|
|
31672
|
+
*/
|
|
31673
|
+
stripTrailingAssistantMessages(prompt) {
|
|
31674
|
+
let end = prompt.length;
|
|
31675
|
+
while (end > 0 && prompt[end - 1]?.role === "assistant") {
|
|
31676
|
+
end--;
|
|
31677
|
+
}
|
|
31678
|
+
return prompt.slice(0, end);
|
|
31679
|
+
}
|
|
31777
31680
|
};
|
|
31778
31681
|
}
|
|
31779
31682
|
});
|
|
@@ -32904,6 +32807,6 @@ mime-types/index.js:
|
|
|
32904
32807
|
*)
|
|
32905
32808
|
|
|
32906
32809
|
axios/dist/node/axios.cjs:
|
|
32907
|
-
(*! Axios v1.
|
|
32810
|
+
(*! Axios v1.14.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
|
|
32908
32811
|
*/
|
|
32909
32812
|
//# sourceMappingURL=index.cjs.map
|