@strapi/plugin-users-permissions 5.0.0-rc.12 → 5.0.0-rc.14
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/_chunks/{index-DvPCIqyf.js → index-7fW4l9GY.js} +4 -4
- package/dist/_chunks/{index-DvPCIqyf.js.map → index-7fW4l9GY.js.map} +1 -1
- package/dist/_chunks/{index-CIMb2uti.mjs → index-B8A_vssi.mjs} +8 -8
- package/dist/_chunks/{index-CIMb2uti.mjs.map → index-B8A_vssi.mjs.map} +1 -1
- package/dist/_chunks/{index-UBiCMOdz.js → index-BMeoT12i.js} +8 -8
- package/dist/_chunks/{index-UBiCMOdz.js.map → index-BMeoT12i.js.map} +1 -1
- package/dist/_chunks/{index-B3x4gd1D.mjs → index-BRB5oGTq.mjs} +3 -3
- package/dist/_chunks/{index-B3x4gd1D.mjs.map → index-BRB5oGTq.mjs.map} +1 -1
- package/dist/_chunks/{index-D7quRKmw.js → index-BTZfQUnt.js} +2 -2
- package/dist/_chunks/{index-D7quRKmw.js.map → index-BTZfQUnt.js.map} +1 -1
- package/dist/_chunks/{index-yv7F3vmo.mjs → index-BrckfGx3.mjs} +3 -3
- package/dist/_chunks/{index-yv7F3vmo.mjs.map → index-BrckfGx3.mjs.map} +1 -1
- package/dist/_chunks/{index-CTyFbjO5.mjs → index-Bvn4_9U4.mjs} +2 -2
- package/dist/_chunks/{index-CTyFbjO5.mjs.map → index-Bvn4_9U4.mjs.map} +1 -1
- package/dist/_chunks/{index-BWiSg5PZ.js → index-CORgh9JE.js} +2 -2
- package/dist/_chunks/{index-BWiSg5PZ.js.map → index-CORgh9JE.js.map} +1 -1
- package/dist/_chunks/{index-BAMBWIll.mjs → index-CnD4RF8l.mjs} +2 -2
- package/dist/_chunks/{index-BAMBWIll.mjs.map → index-CnD4RF8l.mjs.map} +1 -1
- package/dist/_chunks/{index-DnmeIQqO.js → index-DtNLOcA_.js} +7 -7
- package/dist/_chunks/{index-DnmeIQqO.js.map → index-DtNLOcA_.js.map} +1 -1
- package/dist/_chunks/{index-JR3vTXJC-CgmFHk8K.js → index-EVGmgxV1-DuwqBvNN.js} +572 -230
- package/dist/_chunks/index-EVGmgxV1-DuwqBvNN.js.map +1 -0
- package/dist/_chunks/{index-JR3vTXJC-Depgl-yk.mjs → index-EVGmgxV1-GLTXwMLz.mjs} +572 -230
- package/dist/_chunks/index-EVGmgxV1-GLTXwMLz.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/package.json +6 -6
- package/server/services/providers-registry.js +5 -2
- package/dist/_chunks/index-JR3vTXJC-CgmFHk8K.js.map +0 -1
- package/dist/_chunks/index-JR3vTXJC-Depgl-yk.mjs.map +0 -1
|
@@ -4527,12 +4527,12 @@ var hasSymbols$1 = function hasNativeSymbols() {
|
|
|
4527
4527
|
}
|
|
4528
4528
|
return hasSymbolSham();
|
|
4529
4529
|
};
|
|
4530
|
-
var test = {
|
|
4530
|
+
var test$1 = {
|
|
4531
4531
|
foo: {}
|
|
4532
4532
|
};
|
|
4533
4533
|
var $Object = Object;
|
|
4534
4534
|
var hasProto$1 = function hasProto() {
|
|
4535
|
-
return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
|
|
4535
|
+
return { __proto__: test$1 }.foo === test$1.foo && !({ __proto__: null } instanceof $Object);
|
|
4536
4536
|
};
|
|
4537
4537
|
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
4538
4538
|
var slice = Array.prototype.slice;
|
|
@@ -6548,6 +6548,7 @@ const isFormData = (thing) => {
|
|
|
6548
6548
|
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
|
|
6549
6549
|
};
|
|
6550
6550
|
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
6551
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
6551
6552
|
const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
6552
6553
|
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
6553
6554
|
if (obj === null || typeof obj === "undefined") {
|
|
@@ -6757,8 +6758,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
6757
6758
|
const noop = () => {
|
|
6758
6759
|
};
|
|
6759
6760
|
const toFiniteNumber = (value, defaultValue) => {
|
|
6760
|
-
value = +value;
|
|
6761
|
-
return Number.isFinite(value) ? value : defaultValue;
|
|
6761
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
6762
6762
|
};
|
|
6763
6763
|
const ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
6764
6764
|
const DIGIT = "0123456789";
|
|
@@ -6802,6 +6802,26 @@ const toJSONObject = (obj) => {
|
|
|
6802
6802
|
};
|
|
6803
6803
|
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
6804
6804
|
const isThenable = (thing) => thing && (isObject$1(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
6805
|
+
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
6806
|
+
if (setImmediateSupported) {
|
|
6807
|
+
return setImmediate;
|
|
6808
|
+
}
|
|
6809
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
6810
|
+
_global.addEventListener("message", ({ source, data }) => {
|
|
6811
|
+
if (source === _global && data === token) {
|
|
6812
|
+
callbacks.length && callbacks.shift()();
|
|
6813
|
+
}
|
|
6814
|
+
}, false);
|
|
6815
|
+
return (cb) => {
|
|
6816
|
+
callbacks.push(cb);
|
|
6817
|
+
_global.postMessage(token, "*");
|
|
6818
|
+
};
|
|
6819
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
6820
|
+
})(
|
|
6821
|
+
typeof setImmediate === "function",
|
|
6822
|
+
isFunction(_global.postMessage)
|
|
6823
|
+
);
|
|
6824
|
+
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
6805
6825
|
const utils$1 = {
|
|
6806
6826
|
isArray,
|
|
6807
6827
|
isArrayBuffer,
|
|
@@ -6813,6 +6833,10 @@ const utils$1 = {
|
|
|
6813
6833
|
isBoolean,
|
|
6814
6834
|
isObject: isObject$1,
|
|
6815
6835
|
isPlainObject,
|
|
6836
|
+
isReadableStream,
|
|
6837
|
+
isRequest,
|
|
6838
|
+
isResponse,
|
|
6839
|
+
isHeaders,
|
|
6816
6840
|
isUndefined,
|
|
6817
6841
|
isDate,
|
|
6818
6842
|
isFile,
|
|
@@ -6854,7 +6878,9 @@ const utils$1 = {
|
|
|
6854
6878
|
isSpecCompliantForm,
|
|
6855
6879
|
toJSONObject,
|
|
6856
6880
|
isAsyncFn,
|
|
6857
|
-
isThenable
|
|
6881
|
+
isThenable,
|
|
6882
|
+
setImmediate: _setImmediate,
|
|
6883
|
+
asap
|
|
6858
6884
|
};
|
|
6859
6885
|
function AxiosError(message, code, config, request, response) {
|
|
6860
6886
|
Error.call(this);
|
|
@@ -7178,11 +7204,13 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
7178
7204
|
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
7179
7205
|
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
7180
7206
|
})();
|
|
7207
|
+
const origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
7181
7208
|
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7182
7209
|
__proto__: null,
|
|
7183
7210
|
hasBrowserEnv,
|
|
7184
7211
|
hasStandardBrowserEnv,
|
|
7185
|
-
hasStandardBrowserWebWorkerEnv
|
|
7212
|
+
hasStandardBrowserWebWorkerEnv,
|
|
7213
|
+
origin
|
|
7186
7214
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7187
7215
|
const platform = {
|
|
7188
7216
|
...utils,
|
|
@@ -7265,7 +7293,7 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
7265
7293
|
}
|
|
7266
7294
|
const defaults = {
|
|
7267
7295
|
transitional: transitionalDefaults,
|
|
7268
|
-
adapter: ["xhr", "http"],
|
|
7296
|
+
adapter: ["xhr", "http", "fetch"],
|
|
7269
7297
|
transformRequest: [function transformRequest(data, headers) {
|
|
7270
7298
|
const contentType = headers.getContentType() || "";
|
|
7271
7299
|
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
@@ -7277,7 +7305,7 @@ const defaults = {
|
|
|
7277
7305
|
if (isFormData2) {
|
|
7278
7306
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
7279
7307
|
}
|
|
7280
|
-
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data)) {
|
|
7308
|
+
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)) {
|
|
7281
7309
|
return data;
|
|
7282
7310
|
}
|
|
7283
7311
|
if (utils$1.isArrayBufferView(data)) {
|
|
@@ -7311,6 +7339,9 @@ const defaults = {
|
|
|
7311
7339
|
const transitional2 = this.transitional || defaults.transitional;
|
|
7312
7340
|
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
7313
7341
|
const JSONRequested = this.responseType === "json";
|
|
7342
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
7343
|
+
return data;
|
|
7344
|
+
}
|
|
7314
7345
|
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
7315
7346
|
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
7316
7347
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
@@ -7470,6 +7501,10 @@ class AxiosHeaders {
|
|
|
7470
7501
|
setHeaders(header, valueOrRewrite);
|
|
7471
7502
|
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
7472
7503
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
7504
|
+
} else if (utils$1.isHeaders(header)) {
|
|
7505
|
+
for (const [key, value] of header.entries()) {
|
|
7506
|
+
setHeader(value, key, rewrite);
|
|
7507
|
+
}
|
|
7473
7508
|
} else {
|
|
7474
7509
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
7475
7510
|
}
|
|
@@ -7648,88 +7683,6 @@ function settle(resolve, reject, response) {
|
|
|
7648
7683
|
));
|
|
7649
7684
|
}
|
|
7650
7685
|
}
|
|
7651
|
-
const cookies = platform.hasStandardBrowserEnv ? (
|
|
7652
|
-
// Standard browser envs support document.cookie
|
|
7653
|
-
{
|
|
7654
|
-
write(name, value, expires, path, domain, secure) {
|
|
7655
|
-
const cookie = [name + "=" + encodeURIComponent(value)];
|
|
7656
|
-
utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
|
|
7657
|
-
utils$1.isString(path) && cookie.push("path=" + path);
|
|
7658
|
-
utils$1.isString(domain) && cookie.push("domain=" + domain);
|
|
7659
|
-
secure === true && cookie.push("secure");
|
|
7660
|
-
document.cookie = cookie.join("; ");
|
|
7661
|
-
},
|
|
7662
|
-
read(name) {
|
|
7663
|
-
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
7664
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
7665
|
-
},
|
|
7666
|
-
remove(name) {
|
|
7667
|
-
this.write(name, "", Date.now() - 864e5);
|
|
7668
|
-
}
|
|
7669
|
-
}
|
|
7670
|
-
) : (
|
|
7671
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
7672
|
-
{
|
|
7673
|
-
write() {
|
|
7674
|
-
},
|
|
7675
|
-
read() {
|
|
7676
|
-
return null;
|
|
7677
|
-
},
|
|
7678
|
-
remove() {
|
|
7679
|
-
}
|
|
7680
|
-
}
|
|
7681
|
-
);
|
|
7682
|
-
function isAbsoluteURL(url) {
|
|
7683
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
7684
|
-
}
|
|
7685
|
-
function combineURLs(baseURL, relativeURL) {
|
|
7686
|
-
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
7687
|
-
}
|
|
7688
|
-
function buildFullPath(baseURL, requestedURL) {
|
|
7689
|
-
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
7690
|
-
return combineURLs(baseURL, requestedURL);
|
|
7691
|
-
}
|
|
7692
|
-
return requestedURL;
|
|
7693
|
-
}
|
|
7694
|
-
const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
|
|
7695
|
-
// Standard browser envs have full support of the APIs needed to test
|
|
7696
|
-
// whether the request URL is of the same origin as current location.
|
|
7697
|
-
function standardBrowserEnv() {
|
|
7698
|
-
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
7699
|
-
const urlParsingNode = document.createElement("a");
|
|
7700
|
-
let originURL;
|
|
7701
|
-
function resolveURL(url) {
|
|
7702
|
-
let href = url;
|
|
7703
|
-
if (msie) {
|
|
7704
|
-
urlParsingNode.setAttribute("href", href);
|
|
7705
|
-
href = urlParsingNode.href;
|
|
7706
|
-
}
|
|
7707
|
-
urlParsingNode.setAttribute("href", href);
|
|
7708
|
-
return {
|
|
7709
|
-
href: urlParsingNode.href,
|
|
7710
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
7711
|
-
host: urlParsingNode.host,
|
|
7712
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
7713
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
7714
|
-
hostname: urlParsingNode.hostname,
|
|
7715
|
-
port: urlParsingNode.port,
|
|
7716
|
-
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
7717
|
-
};
|
|
7718
|
-
}
|
|
7719
|
-
originURL = resolveURL(window.location.href);
|
|
7720
|
-
return function isURLSameOrigin2(requestURL) {
|
|
7721
|
-
const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
7722
|
-
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
7723
|
-
};
|
|
7724
|
-
}()
|
|
7725
|
-
) : (
|
|
7726
|
-
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
7727
|
-
/* @__PURE__ */ function nonStandardBrowserEnv() {
|
|
7728
|
-
return function isURLSameOrigin2() {
|
|
7729
|
-
return true;
|
|
7730
|
-
};
|
|
7731
|
-
}()
|
|
7732
|
-
);
|
|
7733
7686
|
function parseProtocol(url) {
|
|
7734
7687
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
7735
7688
|
return match && match[1] || "";
|
|
@@ -7767,10 +7720,42 @@ function speedometer(samplesCount, min) {
|
|
|
7767
7720
|
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
7768
7721
|
};
|
|
7769
7722
|
}
|
|
7770
|
-
function
|
|
7723
|
+
function throttle(fn, freq) {
|
|
7724
|
+
let timestamp = 0;
|
|
7725
|
+
let threshold = 1e3 / freq;
|
|
7726
|
+
let lastArgs;
|
|
7727
|
+
let timer;
|
|
7728
|
+
const invoke = (args, now = Date.now()) => {
|
|
7729
|
+
timestamp = now;
|
|
7730
|
+
lastArgs = null;
|
|
7731
|
+
if (timer) {
|
|
7732
|
+
clearTimeout(timer);
|
|
7733
|
+
timer = null;
|
|
7734
|
+
}
|
|
7735
|
+
fn.apply(null, args);
|
|
7736
|
+
};
|
|
7737
|
+
const throttled = (...args) => {
|
|
7738
|
+
const now = Date.now();
|
|
7739
|
+
const passed = now - timestamp;
|
|
7740
|
+
if (passed >= threshold) {
|
|
7741
|
+
invoke(args, now);
|
|
7742
|
+
} else {
|
|
7743
|
+
lastArgs = args;
|
|
7744
|
+
if (!timer) {
|
|
7745
|
+
timer = setTimeout(() => {
|
|
7746
|
+
timer = null;
|
|
7747
|
+
invoke(lastArgs);
|
|
7748
|
+
}, threshold - passed);
|
|
7749
|
+
}
|
|
7750
|
+
}
|
|
7751
|
+
};
|
|
7752
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
7753
|
+
return [throttled, flush];
|
|
7754
|
+
}
|
|
7755
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
7771
7756
|
let bytesNotified = 0;
|
|
7772
7757
|
const _speedometer = speedometer(50, 250);
|
|
7773
|
-
return (e) => {
|
|
7758
|
+
return throttle((e) => {
|
|
7774
7759
|
const loaded = e.loaded;
|
|
7775
7760
|
const total = e.lengthComputable ? e.total : void 0;
|
|
7776
7761
|
const progressBytes = loaded - bytesNotified;
|
|
@@ -7784,45 +7769,232 @@ function progressEventReducer(listener, isDownloadStream) {
|
|
|
7784
7769
|
bytes: progressBytes,
|
|
7785
7770
|
rate: rate ? rate : void 0,
|
|
7786
7771
|
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
7787
|
-
event: e
|
|
7772
|
+
event: e,
|
|
7773
|
+
lengthComputable: total != null,
|
|
7774
|
+
[isDownloadStream ? "download" : "upload"]: true
|
|
7788
7775
|
};
|
|
7789
|
-
data[isDownloadStream ? "download" : "upload"] = true;
|
|
7790
7776
|
listener(data);
|
|
7777
|
+
}, freq);
|
|
7778
|
+
};
|
|
7779
|
+
const progressEventDecorator = (total, throttled) => {
|
|
7780
|
+
const lengthComputable = total != null;
|
|
7781
|
+
return [(loaded) => throttled[0]({
|
|
7782
|
+
lengthComputable,
|
|
7783
|
+
total,
|
|
7784
|
+
loaded
|
|
7785
|
+
}), throttled[1]];
|
|
7786
|
+
};
|
|
7787
|
+
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
|
7788
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
|
|
7789
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
7790
|
+
// whether the request URL is of the same origin as current location.
|
|
7791
|
+
function standardBrowserEnv() {
|
|
7792
|
+
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
7793
|
+
const urlParsingNode = document.createElement("a");
|
|
7794
|
+
let originURL;
|
|
7795
|
+
function resolveURL(url) {
|
|
7796
|
+
let href = url;
|
|
7797
|
+
if (msie) {
|
|
7798
|
+
urlParsingNode.setAttribute("href", href);
|
|
7799
|
+
href = urlParsingNode.href;
|
|
7800
|
+
}
|
|
7801
|
+
urlParsingNode.setAttribute("href", href);
|
|
7802
|
+
return {
|
|
7803
|
+
href: urlParsingNode.href,
|
|
7804
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
7805
|
+
host: urlParsingNode.host,
|
|
7806
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
7807
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
7808
|
+
hostname: urlParsingNode.hostname,
|
|
7809
|
+
port: urlParsingNode.port,
|
|
7810
|
+
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
7811
|
+
};
|
|
7812
|
+
}
|
|
7813
|
+
originURL = resolveURL(window.location.href);
|
|
7814
|
+
return function isURLSameOrigin2(requestURL) {
|
|
7815
|
+
const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
7816
|
+
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
7817
|
+
};
|
|
7818
|
+
}()
|
|
7819
|
+
) : (
|
|
7820
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
7821
|
+
/* @__PURE__ */ function nonStandardBrowserEnv() {
|
|
7822
|
+
return function isURLSameOrigin2() {
|
|
7823
|
+
return true;
|
|
7824
|
+
};
|
|
7825
|
+
}()
|
|
7826
|
+
);
|
|
7827
|
+
const cookies = platform.hasStandardBrowserEnv ? (
|
|
7828
|
+
// Standard browser envs support document.cookie
|
|
7829
|
+
{
|
|
7830
|
+
write(name, value, expires, path, domain, secure) {
|
|
7831
|
+
const cookie = [name + "=" + encodeURIComponent(value)];
|
|
7832
|
+
utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
|
|
7833
|
+
utils$1.isString(path) && cookie.push("path=" + path);
|
|
7834
|
+
utils$1.isString(domain) && cookie.push("domain=" + domain);
|
|
7835
|
+
secure === true && cookie.push("secure");
|
|
7836
|
+
document.cookie = cookie.join("; ");
|
|
7837
|
+
},
|
|
7838
|
+
read(name) {
|
|
7839
|
+
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
7840
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
7841
|
+
},
|
|
7842
|
+
remove(name) {
|
|
7843
|
+
this.write(name, "", Date.now() - 864e5);
|
|
7844
|
+
}
|
|
7845
|
+
}
|
|
7846
|
+
) : (
|
|
7847
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
7848
|
+
{
|
|
7849
|
+
write() {
|
|
7850
|
+
},
|
|
7851
|
+
read() {
|
|
7852
|
+
return null;
|
|
7853
|
+
},
|
|
7854
|
+
remove() {
|
|
7855
|
+
}
|
|
7856
|
+
}
|
|
7857
|
+
);
|
|
7858
|
+
function isAbsoluteURL(url) {
|
|
7859
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
7860
|
+
}
|
|
7861
|
+
function combineURLs(baseURL, relativeURL) {
|
|
7862
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
7863
|
+
}
|
|
7864
|
+
function buildFullPath(baseURL, requestedURL) {
|
|
7865
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
7866
|
+
return combineURLs(baseURL, requestedURL);
|
|
7867
|
+
}
|
|
7868
|
+
return requestedURL;
|
|
7869
|
+
}
|
|
7870
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
7871
|
+
function mergeConfig(config1, config2) {
|
|
7872
|
+
config2 = config2 || {};
|
|
7873
|
+
const config = {};
|
|
7874
|
+
function getMergedValue(target, source, caseless) {
|
|
7875
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
7876
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
7877
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
7878
|
+
return utils$1.merge({}, source);
|
|
7879
|
+
} else if (utils$1.isArray(source)) {
|
|
7880
|
+
return source.slice();
|
|
7881
|
+
}
|
|
7882
|
+
return source;
|
|
7883
|
+
}
|
|
7884
|
+
function mergeDeepProperties(a2, b, caseless) {
|
|
7885
|
+
if (!utils$1.isUndefined(b)) {
|
|
7886
|
+
return getMergedValue(a2, b, caseless);
|
|
7887
|
+
} else if (!utils$1.isUndefined(a2)) {
|
|
7888
|
+
return getMergedValue(void 0, a2, caseless);
|
|
7889
|
+
}
|
|
7890
|
+
}
|
|
7891
|
+
function valueFromConfig2(a2, b) {
|
|
7892
|
+
if (!utils$1.isUndefined(b)) {
|
|
7893
|
+
return getMergedValue(void 0, b);
|
|
7894
|
+
}
|
|
7895
|
+
}
|
|
7896
|
+
function defaultToConfig2(a2, b) {
|
|
7897
|
+
if (!utils$1.isUndefined(b)) {
|
|
7898
|
+
return getMergedValue(void 0, b);
|
|
7899
|
+
} else if (!utils$1.isUndefined(a2)) {
|
|
7900
|
+
return getMergedValue(void 0, a2);
|
|
7901
|
+
}
|
|
7902
|
+
}
|
|
7903
|
+
function mergeDirectKeys(a2, b, prop) {
|
|
7904
|
+
if (prop in config2) {
|
|
7905
|
+
return getMergedValue(a2, b);
|
|
7906
|
+
} else if (prop in config1) {
|
|
7907
|
+
return getMergedValue(void 0, a2);
|
|
7908
|
+
}
|
|
7909
|
+
}
|
|
7910
|
+
const mergeMap = {
|
|
7911
|
+
url: valueFromConfig2,
|
|
7912
|
+
method: valueFromConfig2,
|
|
7913
|
+
data: valueFromConfig2,
|
|
7914
|
+
baseURL: defaultToConfig2,
|
|
7915
|
+
transformRequest: defaultToConfig2,
|
|
7916
|
+
transformResponse: defaultToConfig2,
|
|
7917
|
+
paramsSerializer: defaultToConfig2,
|
|
7918
|
+
timeout: defaultToConfig2,
|
|
7919
|
+
timeoutMessage: defaultToConfig2,
|
|
7920
|
+
withCredentials: defaultToConfig2,
|
|
7921
|
+
withXSRFToken: defaultToConfig2,
|
|
7922
|
+
adapter: defaultToConfig2,
|
|
7923
|
+
responseType: defaultToConfig2,
|
|
7924
|
+
xsrfCookieName: defaultToConfig2,
|
|
7925
|
+
xsrfHeaderName: defaultToConfig2,
|
|
7926
|
+
onUploadProgress: defaultToConfig2,
|
|
7927
|
+
onDownloadProgress: defaultToConfig2,
|
|
7928
|
+
decompress: defaultToConfig2,
|
|
7929
|
+
maxContentLength: defaultToConfig2,
|
|
7930
|
+
maxBodyLength: defaultToConfig2,
|
|
7931
|
+
beforeRedirect: defaultToConfig2,
|
|
7932
|
+
transport: defaultToConfig2,
|
|
7933
|
+
httpAgent: defaultToConfig2,
|
|
7934
|
+
httpsAgent: defaultToConfig2,
|
|
7935
|
+
cancelToken: defaultToConfig2,
|
|
7936
|
+
socketPath: defaultToConfig2,
|
|
7937
|
+
responseEncoding: defaultToConfig2,
|
|
7938
|
+
validateStatus: mergeDirectKeys,
|
|
7939
|
+
headers: (a2, b) => mergeDeepProperties(headersToObject(a2), headersToObject(b), true)
|
|
7791
7940
|
};
|
|
7941
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
7942
|
+
const merge3 = mergeMap[prop] || mergeDeepProperties;
|
|
7943
|
+
const configValue = merge3(config1[prop], config2[prop], prop);
|
|
7944
|
+
utils$1.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config[prop] = configValue);
|
|
7945
|
+
});
|
|
7946
|
+
return config;
|
|
7792
7947
|
}
|
|
7948
|
+
const resolveConfig = (config) => {
|
|
7949
|
+
const newConfig = mergeConfig({}, config);
|
|
7950
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
7951
|
+
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
7952
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
7953
|
+
if (auth) {
|
|
7954
|
+
headers.set(
|
|
7955
|
+
"Authorization",
|
|
7956
|
+
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
7957
|
+
);
|
|
7958
|
+
}
|
|
7959
|
+
let contentType;
|
|
7960
|
+
if (utils$1.isFormData(data)) {
|
|
7961
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
7962
|
+
headers.setContentType(void 0);
|
|
7963
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
7964
|
+
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
7965
|
+
headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
7966
|
+
}
|
|
7967
|
+
}
|
|
7968
|
+
if (platform.hasStandardBrowserEnv) {
|
|
7969
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
7970
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
|
|
7971
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
7972
|
+
if (xsrfValue) {
|
|
7973
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
7974
|
+
}
|
|
7975
|
+
}
|
|
7976
|
+
}
|
|
7977
|
+
return newConfig;
|
|
7978
|
+
};
|
|
7793
7979
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
7794
7980
|
const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
7795
7981
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7982
|
+
const _config = resolveConfig(config);
|
|
7983
|
+
let requestData = _config.data;
|
|
7984
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
7985
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
7799
7986
|
let onCanceled;
|
|
7987
|
+
let uploadThrottled, downloadThrottled;
|
|
7988
|
+
let flushUpload, flushDownload;
|
|
7800
7989
|
function done() {
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
config.signal.removeEventListener("abort", onCanceled);
|
|
7806
|
-
}
|
|
7807
|
-
}
|
|
7808
|
-
let contentType;
|
|
7809
|
-
if (utils$1.isFormData(requestData)) {
|
|
7810
|
-
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
7811
|
-
requestHeaders.setContentType(false);
|
|
7812
|
-
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
7813
|
-
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
7814
|
-
requestHeaders.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
7815
|
-
}
|
|
7990
|
+
flushUpload && flushUpload();
|
|
7991
|
+
flushDownload && flushDownload();
|
|
7992
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
7993
|
+
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
7816
7994
|
}
|
|
7817
7995
|
let request = new XMLHttpRequest();
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
7821
|
-
requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
|
|
7822
|
-
}
|
|
7823
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
7824
|
-
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
7825
|
-
request.timeout = config.timeout;
|
|
7996
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
7997
|
+
request.timeout = _config.timeout;
|
|
7826
7998
|
function onloadend() {
|
|
7827
7999
|
if (!request) {
|
|
7828
8000
|
return;
|
|
@@ -7873,10 +8045,10 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
7873
8045
|
request = null;
|
|
7874
8046
|
};
|
|
7875
8047
|
request.ontimeout = function handleTimeout() {
|
|
7876
|
-
let timeoutErrorMessage =
|
|
7877
|
-
const transitional2 =
|
|
7878
|
-
if (
|
|
7879
|
-
timeoutErrorMessage =
|
|
8048
|
+
let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
|
|
8049
|
+
const transitional2 = _config.transitional || transitionalDefaults;
|
|
8050
|
+
if (_config.timeoutErrorMessage) {
|
|
8051
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
7880
8052
|
}
|
|
7881
8053
|
reject(new AxiosError(
|
|
7882
8054
|
timeoutErrorMessage,
|
|
@@ -7886,34 +8058,28 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
7886
8058
|
));
|
|
7887
8059
|
request = null;
|
|
7888
8060
|
};
|
|
7889
|
-
if (platform.hasStandardBrowserEnv) {
|
|
7890
|
-
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
7891
|
-
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(fullPath)) {
|
|
7892
|
-
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
7893
|
-
if (xsrfValue) {
|
|
7894
|
-
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
7895
|
-
}
|
|
7896
|
-
}
|
|
7897
|
-
}
|
|
7898
8061
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
7899
8062
|
if ("setRequestHeader" in request) {
|
|
7900
8063
|
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
7901
8064
|
request.setRequestHeader(key, val);
|
|
7902
8065
|
});
|
|
7903
8066
|
}
|
|
7904
|
-
if (!utils$1.isUndefined(
|
|
7905
|
-
request.withCredentials = !!
|
|
8067
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
8068
|
+
request.withCredentials = !!_config.withCredentials;
|
|
7906
8069
|
}
|
|
7907
8070
|
if (responseType && responseType !== "json") {
|
|
7908
|
-
request.responseType =
|
|
8071
|
+
request.responseType = _config.responseType;
|
|
7909
8072
|
}
|
|
7910
|
-
if (
|
|
7911
|
-
|
|
8073
|
+
if (onDownloadProgress) {
|
|
8074
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
8075
|
+
request.addEventListener("progress", downloadThrottled);
|
|
7912
8076
|
}
|
|
7913
|
-
if (
|
|
7914
|
-
|
|
8077
|
+
if (onUploadProgress && request.upload) {
|
|
8078
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
8079
|
+
request.upload.addEventListener("progress", uploadThrottled);
|
|
8080
|
+
request.upload.addEventListener("loadend", flushUpload);
|
|
7915
8081
|
}
|
|
7916
|
-
if (
|
|
8082
|
+
if (_config.cancelToken || _config.signal) {
|
|
7917
8083
|
onCanceled = (cancel) => {
|
|
7918
8084
|
if (!request) {
|
|
7919
8085
|
return;
|
|
@@ -7922,12 +8088,12 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
7922
8088
|
request.abort();
|
|
7923
8089
|
request = null;
|
|
7924
8090
|
};
|
|
7925
|
-
|
|
7926
|
-
if (
|
|
7927
|
-
|
|
8091
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
8092
|
+
if (_config.signal) {
|
|
8093
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
7928
8094
|
}
|
|
7929
8095
|
}
|
|
7930
|
-
const protocol = parseProtocol(
|
|
8096
|
+
const protocol = parseProtocol(_config.url);
|
|
7931
8097
|
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
7932
8098
|
reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
|
|
7933
8099
|
return;
|
|
@@ -7935,9 +8101,260 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
7935
8101
|
request.send(requestData || null);
|
|
7936
8102
|
});
|
|
7937
8103
|
};
|
|
8104
|
+
const composeSignals = (signals, timeout) => {
|
|
8105
|
+
let controller = new AbortController();
|
|
8106
|
+
let aborted;
|
|
8107
|
+
const onabort = function(cancel) {
|
|
8108
|
+
if (!aborted) {
|
|
8109
|
+
aborted = true;
|
|
8110
|
+
unsubscribe();
|
|
8111
|
+
const err = cancel instanceof Error ? cancel : this.reason;
|
|
8112
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
8113
|
+
}
|
|
8114
|
+
};
|
|
8115
|
+
let timer = timeout && setTimeout(() => {
|
|
8116
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
|
8117
|
+
}, timeout);
|
|
8118
|
+
const unsubscribe = () => {
|
|
8119
|
+
if (signals) {
|
|
8120
|
+
timer && clearTimeout(timer);
|
|
8121
|
+
timer = null;
|
|
8122
|
+
signals.forEach((signal2) => {
|
|
8123
|
+
signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort));
|
|
8124
|
+
});
|
|
8125
|
+
signals = null;
|
|
8126
|
+
}
|
|
8127
|
+
};
|
|
8128
|
+
signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort));
|
|
8129
|
+
const { signal } = controller;
|
|
8130
|
+
signal.unsubscribe = unsubscribe;
|
|
8131
|
+
return [signal, () => {
|
|
8132
|
+
timer && clearTimeout(timer);
|
|
8133
|
+
timer = null;
|
|
8134
|
+
}];
|
|
8135
|
+
};
|
|
8136
|
+
const streamChunk = function* (chunk, chunkSize) {
|
|
8137
|
+
let len = chunk.byteLength;
|
|
8138
|
+
if (!chunkSize || len < chunkSize) {
|
|
8139
|
+
yield chunk;
|
|
8140
|
+
return;
|
|
8141
|
+
}
|
|
8142
|
+
let pos = 0;
|
|
8143
|
+
let end;
|
|
8144
|
+
while (pos < len) {
|
|
8145
|
+
end = pos + chunkSize;
|
|
8146
|
+
yield chunk.slice(pos, end);
|
|
8147
|
+
pos = end;
|
|
8148
|
+
}
|
|
8149
|
+
};
|
|
8150
|
+
const readBytes = async function* (iterable, chunkSize, encode3) {
|
|
8151
|
+
for await (const chunk of iterable) {
|
|
8152
|
+
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : await encode3(String(chunk)), chunkSize);
|
|
8153
|
+
}
|
|
8154
|
+
};
|
|
8155
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish, encode3) => {
|
|
8156
|
+
const iterator = readBytes(stream, chunkSize, encode3);
|
|
8157
|
+
let bytes = 0;
|
|
8158
|
+
let done;
|
|
8159
|
+
let _onFinish = (e) => {
|
|
8160
|
+
if (!done) {
|
|
8161
|
+
done = true;
|
|
8162
|
+
onFinish && onFinish(e);
|
|
8163
|
+
}
|
|
8164
|
+
};
|
|
8165
|
+
return new ReadableStream({
|
|
8166
|
+
async pull(controller) {
|
|
8167
|
+
try {
|
|
8168
|
+
const { done: done2, value } = await iterator.next();
|
|
8169
|
+
if (done2) {
|
|
8170
|
+
_onFinish();
|
|
8171
|
+
controller.close();
|
|
8172
|
+
return;
|
|
8173
|
+
}
|
|
8174
|
+
let len = value.byteLength;
|
|
8175
|
+
if (onProgress) {
|
|
8176
|
+
let loadedBytes = bytes += len;
|
|
8177
|
+
onProgress(loadedBytes);
|
|
8178
|
+
}
|
|
8179
|
+
controller.enqueue(new Uint8Array(value));
|
|
8180
|
+
} catch (err) {
|
|
8181
|
+
_onFinish(err);
|
|
8182
|
+
throw err;
|
|
8183
|
+
}
|
|
8184
|
+
},
|
|
8185
|
+
cancel(reason) {
|
|
8186
|
+
_onFinish(reason);
|
|
8187
|
+
return iterator.return();
|
|
8188
|
+
}
|
|
8189
|
+
}, {
|
|
8190
|
+
highWaterMark: 2
|
|
8191
|
+
});
|
|
8192
|
+
};
|
|
8193
|
+
const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
|
|
8194
|
+
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
|
|
8195
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
|
|
8196
|
+
const test = (fn, ...args) => {
|
|
8197
|
+
try {
|
|
8198
|
+
return !!fn(...args);
|
|
8199
|
+
} catch (e) {
|
|
8200
|
+
return false;
|
|
8201
|
+
}
|
|
8202
|
+
};
|
|
8203
|
+
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
8204
|
+
let duplexAccessed = false;
|
|
8205
|
+
const hasContentType = new Request(platform.origin, {
|
|
8206
|
+
body: new ReadableStream(),
|
|
8207
|
+
method: "POST",
|
|
8208
|
+
get duplex() {
|
|
8209
|
+
duplexAccessed = true;
|
|
8210
|
+
return "half";
|
|
8211
|
+
}
|
|
8212
|
+
}).headers.has("Content-Type");
|
|
8213
|
+
return duplexAccessed && !hasContentType;
|
|
8214
|
+
});
|
|
8215
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
8216
|
+
const supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
|
|
8217
|
+
const resolvers = {
|
|
8218
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
8219
|
+
};
|
|
8220
|
+
isFetchSupported && ((res) => {
|
|
8221
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
8222
|
+
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
|
|
8223
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
8224
|
+
});
|
|
8225
|
+
});
|
|
8226
|
+
})(new Response());
|
|
8227
|
+
const getBodyLength = async (body) => {
|
|
8228
|
+
if (body == null) {
|
|
8229
|
+
return 0;
|
|
8230
|
+
}
|
|
8231
|
+
if (utils$1.isBlob(body)) {
|
|
8232
|
+
return body.size;
|
|
8233
|
+
}
|
|
8234
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
|
8235
|
+
return (await new Request(body).arrayBuffer()).byteLength;
|
|
8236
|
+
}
|
|
8237
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
8238
|
+
return body.byteLength;
|
|
8239
|
+
}
|
|
8240
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
8241
|
+
body = body + "";
|
|
8242
|
+
}
|
|
8243
|
+
if (utils$1.isString(body)) {
|
|
8244
|
+
return (await encodeText(body)).byteLength;
|
|
8245
|
+
}
|
|
8246
|
+
};
|
|
8247
|
+
const resolveBodyLength = async (headers, body) => {
|
|
8248
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
8249
|
+
return length == null ? getBodyLength(body) : length;
|
|
8250
|
+
};
|
|
8251
|
+
const fetchAdapter = isFetchSupported && (async (config) => {
|
|
8252
|
+
let {
|
|
8253
|
+
url,
|
|
8254
|
+
method,
|
|
8255
|
+
data,
|
|
8256
|
+
signal,
|
|
8257
|
+
cancelToken,
|
|
8258
|
+
timeout,
|
|
8259
|
+
onDownloadProgress,
|
|
8260
|
+
onUploadProgress,
|
|
8261
|
+
responseType,
|
|
8262
|
+
headers,
|
|
8263
|
+
withCredentials = "same-origin",
|
|
8264
|
+
fetchOptions
|
|
8265
|
+
} = resolveConfig(config);
|
|
8266
|
+
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
8267
|
+
let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals([signal, cancelToken], timeout) : [];
|
|
8268
|
+
let finished, request;
|
|
8269
|
+
const onFinish = () => {
|
|
8270
|
+
!finished && setTimeout(() => {
|
|
8271
|
+
composedSignal && composedSignal.unsubscribe();
|
|
8272
|
+
});
|
|
8273
|
+
finished = true;
|
|
8274
|
+
};
|
|
8275
|
+
let requestContentLength;
|
|
8276
|
+
try {
|
|
8277
|
+
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
8278
|
+
let _request = new Request(url, {
|
|
8279
|
+
method: "POST",
|
|
8280
|
+
body: data,
|
|
8281
|
+
duplex: "half"
|
|
8282
|
+
});
|
|
8283
|
+
let contentTypeHeader;
|
|
8284
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
8285
|
+
headers.setContentType(contentTypeHeader);
|
|
8286
|
+
}
|
|
8287
|
+
if (_request.body) {
|
|
8288
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
8289
|
+
requestContentLength,
|
|
8290
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
8291
|
+
);
|
|
8292
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
|
|
8293
|
+
}
|
|
8294
|
+
}
|
|
8295
|
+
if (!utils$1.isString(withCredentials)) {
|
|
8296
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
8297
|
+
}
|
|
8298
|
+
request = new Request(url, {
|
|
8299
|
+
...fetchOptions,
|
|
8300
|
+
signal: composedSignal,
|
|
8301
|
+
method: method.toUpperCase(),
|
|
8302
|
+
headers: headers.normalize().toJSON(),
|
|
8303
|
+
body: data,
|
|
8304
|
+
duplex: "half",
|
|
8305
|
+
credentials: withCredentials
|
|
8306
|
+
});
|
|
8307
|
+
let response = await fetch(request);
|
|
8308
|
+
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
8309
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
|
8310
|
+
const options = {};
|
|
8311
|
+
["status", "statusText", "headers"].forEach((prop) => {
|
|
8312
|
+
options[prop] = response[prop];
|
|
8313
|
+
});
|
|
8314
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
|
|
8315
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
8316
|
+
responseContentLength,
|
|
8317
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
8318
|
+
) || [];
|
|
8319
|
+
response = new Response(
|
|
8320
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
8321
|
+
flush && flush();
|
|
8322
|
+
isStreamResponse && onFinish();
|
|
8323
|
+
}, encodeText),
|
|
8324
|
+
options
|
|
8325
|
+
);
|
|
8326
|
+
}
|
|
8327
|
+
responseType = responseType || "text";
|
|
8328
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
|
|
8329
|
+
!isStreamResponse && onFinish();
|
|
8330
|
+
stopTimeout && stopTimeout();
|
|
8331
|
+
return await new Promise((resolve, reject) => {
|
|
8332
|
+
settle(resolve, reject, {
|
|
8333
|
+
data: responseData,
|
|
8334
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
8335
|
+
status: response.status,
|
|
8336
|
+
statusText: response.statusText,
|
|
8337
|
+
config,
|
|
8338
|
+
request
|
|
8339
|
+
});
|
|
8340
|
+
});
|
|
8341
|
+
} catch (err) {
|
|
8342
|
+
onFinish();
|
|
8343
|
+
if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
|
|
8344
|
+
throw Object.assign(
|
|
8345
|
+
new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request),
|
|
8346
|
+
{
|
|
8347
|
+
cause: err.cause || err
|
|
8348
|
+
}
|
|
8349
|
+
);
|
|
8350
|
+
}
|
|
8351
|
+
throw AxiosError.from(err, err && err.code, config, request);
|
|
8352
|
+
}
|
|
8353
|
+
});
|
|
7938
8354
|
const knownAdapters = {
|
|
7939
8355
|
http: httpAdapter,
|
|
7940
|
-
xhr: xhrAdapter
|
|
8356
|
+
xhr: xhrAdapter,
|
|
8357
|
+
fetch: fetchAdapter
|
|
7941
8358
|
};
|
|
7942
8359
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
7943
8360
|
if (fn) {
|
|
@@ -8029,85 +8446,7 @@ function dispatchRequest(config) {
|
|
|
8029
8446
|
return Promise.reject(reason);
|
|
8030
8447
|
});
|
|
8031
8448
|
}
|
|
8032
|
-
const
|
|
8033
|
-
function mergeConfig(config1, config2) {
|
|
8034
|
-
config2 = config2 || {};
|
|
8035
|
-
const config = {};
|
|
8036
|
-
function getMergedValue(target, source, caseless) {
|
|
8037
|
-
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
8038
|
-
return utils$1.merge.call({ caseless }, target, source);
|
|
8039
|
-
} else if (utils$1.isPlainObject(source)) {
|
|
8040
|
-
return utils$1.merge({}, source);
|
|
8041
|
-
} else if (utils$1.isArray(source)) {
|
|
8042
|
-
return source.slice();
|
|
8043
|
-
}
|
|
8044
|
-
return source;
|
|
8045
|
-
}
|
|
8046
|
-
function mergeDeepProperties(a2, b, caseless) {
|
|
8047
|
-
if (!utils$1.isUndefined(b)) {
|
|
8048
|
-
return getMergedValue(a2, b, caseless);
|
|
8049
|
-
} else if (!utils$1.isUndefined(a2)) {
|
|
8050
|
-
return getMergedValue(void 0, a2, caseless);
|
|
8051
|
-
}
|
|
8052
|
-
}
|
|
8053
|
-
function valueFromConfig2(a2, b) {
|
|
8054
|
-
if (!utils$1.isUndefined(b)) {
|
|
8055
|
-
return getMergedValue(void 0, b);
|
|
8056
|
-
}
|
|
8057
|
-
}
|
|
8058
|
-
function defaultToConfig2(a2, b) {
|
|
8059
|
-
if (!utils$1.isUndefined(b)) {
|
|
8060
|
-
return getMergedValue(void 0, b);
|
|
8061
|
-
} else if (!utils$1.isUndefined(a2)) {
|
|
8062
|
-
return getMergedValue(void 0, a2);
|
|
8063
|
-
}
|
|
8064
|
-
}
|
|
8065
|
-
function mergeDirectKeys(a2, b, prop) {
|
|
8066
|
-
if (prop in config2) {
|
|
8067
|
-
return getMergedValue(a2, b);
|
|
8068
|
-
} else if (prop in config1) {
|
|
8069
|
-
return getMergedValue(void 0, a2);
|
|
8070
|
-
}
|
|
8071
|
-
}
|
|
8072
|
-
const mergeMap = {
|
|
8073
|
-
url: valueFromConfig2,
|
|
8074
|
-
method: valueFromConfig2,
|
|
8075
|
-
data: valueFromConfig2,
|
|
8076
|
-
baseURL: defaultToConfig2,
|
|
8077
|
-
transformRequest: defaultToConfig2,
|
|
8078
|
-
transformResponse: defaultToConfig2,
|
|
8079
|
-
paramsSerializer: defaultToConfig2,
|
|
8080
|
-
timeout: defaultToConfig2,
|
|
8081
|
-
timeoutMessage: defaultToConfig2,
|
|
8082
|
-
withCredentials: defaultToConfig2,
|
|
8083
|
-
withXSRFToken: defaultToConfig2,
|
|
8084
|
-
adapter: defaultToConfig2,
|
|
8085
|
-
responseType: defaultToConfig2,
|
|
8086
|
-
xsrfCookieName: defaultToConfig2,
|
|
8087
|
-
xsrfHeaderName: defaultToConfig2,
|
|
8088
|
-
onUploadProgress: defaultToConfig2,
|
|
8089
|
-
onDownloadProgress: defaultToConfig2,
|
|
8090
|
-
decompress: defaultToConfig2,
|
|
8091
|
-
maxContentLength: defaultToConfig2,
|
|
8092
|
-
maxBodyLength: defaultToConfig2,
|
|
8093
|
-
beforeRedirect: defaultToConfig2,
|
|
8094
|
-
transport: defaultToConfig2,
|
|
8095
|
-
httpAgent: defaultToConfig2,
|
|
8096
|
-
httpsAgent: defaultToConfig2,
|
|
8097
|
-
cancelToken: defaultToConfig2,
|
|
8098
|
-
socketPath: defaultToConfig2,
|
|
8099
|
-
responseEncoding: defaultToConfig2,
|
|
8100
|
-
validateStatus: mergeDirectKeys,
|
|
8101
|
-
headers: (a2, b) => mergeDeepProperties(headersToObject(a2), headersToObject(b), true)
|
|
8102
|
-
};
|
|
8103
|
-
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
8104
|
-
const merge3 = mergeMap[prop] || mergeDeepProperties;
|
|
8105
|
-
const configValue = merge3(config1[prop], config2[prop], prop);
|
|
8106
|
-
utils$1.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config[prop] = configValue);
|
|
8107
|
-
});
|
|
8108
|
-
return config;
|
|
8109
|
-
}
|
|
8110
|
-
const VERSION = "1.6.8";
|
|
8449
|
+
const VERSION = "1.7.4";
|
|
8111
8450
|
const validators$1 = {};
|
|
8112
8451
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
8113
8452
|
validators$1[type] = function validator2(thing) {
|
|
@@ -8189,10 +8528,13 @@ class Axios {
|
|
|
8189
8528
|
let dummy;
|
|
8190
8529
|
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
|
|
8191
8530
|
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
8192
|
-
|
|
8193
|
-
err.stack
|
|
8194
|
-
|
|
8195
|
-
err.stack
|
|
8531
|
+
try {
|
|
8532
|
+
if (!err.stack) {
|
|
8533
|
+
err.stack = stack;
|
|
8534
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
8535
|
+
err.stack += "\n" + stack;
|
|
8536
|
+
}
|
|
8537
|
+
} catch (e) {
|
|
8196
8538
|
}
|
|
8197
8539
|
}
|
|
8198
8540
|
throw err;
|
|
@@ -11475,4 +11817,4 @@ export {
|
|
|
11475
11817
|
Layouts as L,
|
|
11476
11818
|
useTracking as u
|
|
11477
11819
|
};
|
|
11478
|
-
//# sourceMappingURL=index-
|
|
11820
|
+
//# sourceMappingURL=index-EVGmgxV1-GLTXwMLz.mjs.map
|