@strapi/plugin-users-permissions 5.0.0-rc.11 → 5.0.0-rc.13
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-CWLVetj5.mjs → index-4BPl6AMm.mjs} +2 -2
- package/dist/_chunks/{index-CWLVetj5.mjs.map → index-4BPl6AMm.mjs.map} +1 -1
- package/dist/_chunks/{index-CmaIewQS.mjs → index-8Q6so35a.mjs} +3 -3
- package/dist/_chunks/{index-CmaIewQS.mjs.map → index-8Q6so35a.mjs.map} +1 -1
- package/dist/_chunks/{index-DtCT27Ac.mjs → index-B7OR51Q9.mjs} +3 -3
- package/dist/_chunks/{index-DtCT27Ac.mjs.map → index-B7OR51Q9.mjs.map} +1 -1
- package/dist/_chunks/{index-DVBNFt5t.js → index-B9YyUd0B.js} +2 -2
- package/dist/_chunks/{index-DVBNFt5t.js.map → index-B9YyUd0B.js.map} +1 -1
- package/dist/_chunks/{index-C63Uuxtf.js → index-C9CfKpb-.js} +4 -4
- package/dist/_chunks/{index-C63Uuxtf.js.map → index-C9CfKpb-.js.map} +1 -1
- package/dist/_chunks/{index-n_X8Wl-9.js → index-DdSvZooN.js} +8 -8
- package/dist/_chunks/{index-n_X8Wl-9.js.map → index-DdSvZooN.js.map} +1 -1
- package/dist/_chunks/{index-DbFr_t5R.js → index-Dh3Q7sPn.js} +2 -2
- package/dist/_chunks/{index-DbFr_t5R.js.map → index-Dh3Q7sPn.js.map} +1 -1
- package/dist/_chunks/{index-CMwq-8wx.mjs → index-Dlwh8Qv9.mjs} +8 -8
- package/dist/_chunks/{index-CMwq-8wx.mjs.map → index-Dlwh8Qv9.mjs.map} +1 -1
- package/dist/_chunks/{index-VzSi-Vm6.mjs → index-DsgPurAM.mjs} +2 -2
- package/dist/_chunks/{index-VzSi-Vm6.mjs.map → index-DsgPurAM.mjs.map} +1 -1
- package/dist/_chunks/{index-ivyMOLZZ-B_CbEB2q.js → index-SpIq5bn1-DuwqBvNN.js} +574 -238
- package/dist/_chunks/index-SpIq5bn1-DuwqBvNN.js.map +1 -0
- package/dist/_chunks/{index-ivyMOLZZ-CJ1KIk95.mjs → index-SpIq5bn1-GLTXwMLz.mjs} +574 -238
- package/dist/_chunks/index-SpIq5bn1-GLTXwMLz.mjs.map +1 -0
- package/dist/_chunks/{index-tMJFLsgx.js → index-enGgjXK0.js} +7 -7
- package/dist/_chunks/{index-tMJFLsgx.js.map → index-enGgjXK0.js.map} +1 -1
- 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-ivyMOLZZ-B_CbEB2q.js.map +0 -1
- package/dist/_chunks/index-ivyMOLZZ-CJ1KIk95.mjs.map +0 -1
|
@@ -4553,12 +4553,12 @@ var hasSymbols$1 = function hasNativeSymbols() {
|
|
|
4553
4553
|
}
|
|
4554
4554
|
return hasSymbolSham();
|
|
4555
4555
|
};
|
|
4556
|
-
var test = {
|
|
4556
|
+
var test$1 = {
|
|
4557
4557
|
foo: {}
|
|
4558
4558
|
};
|
|
4559
4559
|
var $Object = Object;
|
|
4560
4560
|
var hasProto$1 = function hasProto() {
|
|
4561
|
-
return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
|
|
4561
|
+
return { __proto__: test$1 }.foo === test$1.foo && !({ __proto__: null } instanceof $Object);
|
|
4562
4562
|
};
|
|
4563
4563
|
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
4564
4564
|
var slice = Array.prototype.slice;
|
|
@@ -6574,6 +6574,7 @@ const isFormData = (thing) => {
|
|
|
6574
6574
|
kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
|
|
6575
6575
|
};
|
|
6576
6576
|
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
6577
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
6577
6578
|
const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
6578
6579
|
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
6579
6580
|
if (obj === null || typeof obj === "undefined") {
|
|
@@ -6783,8 +6784,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
6783
6784
|
const noop = () => {
|
|
6784
6785
|
};
|
|
6785
6786
|
const toFiniteNumber = (value, defaultValue) => {
|
|
6786
|
-
value = +value;
|
|
6787
|
-
return Number.isFinite(value) ? value : defaultValue;
|
|
6787
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
6788
6788
|
};
|
|
6789
6789
|
const ALPHA = "abcdefghijklmnopqrstuvwxyz";
|
|
6790
6790
|
const DIGIT = "0123456789";
|
|
@@ -6828,6 +6828,26 @@ const toJSONObject = (obj) => {
|
|
|
6828
6828
|
};
|
|
6829
6829
|
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
6830
6830
|
const isThenable = (thing) => thing && (isObject$1(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
6831
|
+
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
6832
|
+
if (setImmediateSupported) {
|
|
6833
|
+
return setImmediate;
|
|
6834
|
+
}
|
|
6835
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
6836
|
+
_global.addEventListener("message", ({ source, data }) => {
|
|
6837
|
+
if (source === _global && data === token) {
|
|
6838
|
+
callbacks.length && callbacks.shift()();
|
|
6839
|
+
}
|
|
6840
|
+
}, false);
|
|
6841
|
+
return (cb) => {
|
|
6842
|
+
callbacks.push(cb);
|
|
6843
|
+
_global.postMessage(token, "*");
|
|
6844
|
+
};
|
|
6845
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
6846
|
+
})(
|
|
6847
|
+
typeof setImmediate === "function",
|
|
6848
|
+
isFunction(_global.postMessage)
|
|
6849
|
+
);
|
|
6850
|
+
const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
|
|
6831
6851
|
const utils$1 = {
|
|
6832
6852
|
isArray,
|
|
6833
6853
|
isArrayBuffer,
|
|
@@ -6839,6 +6859,10 @@ const utils$1 = {
|
|
|
6839
6859
|
isBoolean,
|
|
6840
6860
|
isObject: isObject$1,
|
|
6841
6861
|
isPlainObject,
|
|
6862
|
+
isReadableStream,
|
|
6863
|
+
isRequest,
|
|
6864
|
+
isResponse,
|
|
6865
|
+
isHeaders,
|
|
6842
6866
|
isUndefined,
|
|
6843
6867
|
isDate,
|
|
6844
6868
|
isFile,
|
|
@@ -6880,7 +6904,9 @@ const utils$1 = {
|
|
|
6880
6904
|
isSpecCompliantForm,
|
|
6881
6905
|
toJSONObject,
|
|
6882
6906
|
isAsyncFn,
|
|
6883
|
-
isThenable
|
|
6907
|
+
isThenable,
|
|
6908
|
+
setImmediate: _setImmediate,
|
|
6909
|
+
asap
|
|
6884
6910
|
};
|
|
6885
6911
|
function AxiosError(message, code, config, request, response) {
|
|
6886
6912
|
Error.call(this);
|
|
@@ -7204,11 +7230,13 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
7204
7230
|
return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
|
|
7205
7231
|
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
7206
7232
|
})();
|
|
7233
|
+
const origin = hasBrowserEnv && window.location.href || "http://localhost";
|
|
7207
7234
|
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7208
7235
|
__proto__: null,
|
|
7209
7236
|
hasBrowserEnv,
|
|
7210
7237
|
hasStandardBrowserEnv,
|
|
7211
|
-
hasStandardBrowserWebWorkerEnv
|
|
7238
|
+
hasStandardBrowserWebWorkerEnv,
|
|
7239
|
+
origin
|
|
7212
7240
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7213
7241
|
const platform = {
|
|
7214
7242
|
...utils,
|
|
@@ -7291,7 +7319,7 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
7291
7319
|
}
|
|
7292
7320
|
const defaults = {
|
|
7293
7321
|
transitional: transitionalDefaults,
|
|
7294
|
-
adapter: ["xhr", "http"],
|
|
7322
|
+
adapter: ["xhr", "http", "fetch"],
|
|
7295
7323
|
transformRequest: [function transformRequest(data, headers) {
|
|
7296
7324
|
const contentType = headers.getContentType() || "";
|
|
7297
7325
|
const hasJSONContentType = contentType.indexOf("application/json") > -1;
|
|
@@ -7303,7 +7331,7 @@ const defaults = {
|
|
|
7303
7331
|
if (isFormData2) {
|
|
7304
7332
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
7305
7333
|
}
|
|
7306
|
-
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data)) {
|
|
7334
|
+
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)) {
|
|
7307
7335
|
return data;
|
|
7308
7336
|
}
|
|
7309
7337
|
if (utils$1.isArrayBufferView(data)) {
|
|
@@ -7337,6 +7365,9 @@ const defaults = {
|
|
|
7337
7365
|
const transitional2 = this.transitional || defaults.transitional;
|
|
7338
7366
|
const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
7339
7367
|
const JSONRequested = this.responseType === "json";
|
|
7368
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
7369
|
+
return data;
|
|
7370
|
+
}
|
|
7340
7371
|
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
|
7341
7372
|
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
7342
7373
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
@@ -7496,6 +7527,10 @@ class AxiosHeaders {
|
|
|
7496
7527
|
setHeaders(header, valueOrRewrite);
|
|
7497
7528
|
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
7498
7529
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
7530
|
+
} else if (utils$1.isHeaders(header)) {
|
|
7531
|
+
for (const [key, value] of header.entries()) {
|
|
7532
|
+
setHeader(value, key, rewrite);
|
|
7533
|
+
}
|
|
7499
7534
|
} else {
|
|
7500
7535
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
7501
7536
|
}
|
|
@@ -7674,88 +7709,6 @@ function settle(resolve, reject, response) {
|
|
|
7674
7709
|
));
|
|
7675
7710
|
}
|
|
7676
7711
|
}
|
|
7677
|
-
const cookies = platform.hasStandardBrowserEnv ? (
|
|
7678
|
-
// Standard browser envs support document.cookie
|
|
7679
|
-
{
|
|
7680
|
-
write(name, value, expires, path, domain, secure) {
|
|
7681
|
-
const cookie = [name + "=" + encodeURIComponent(value)];
|
|
7682
|
-
utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
|
|
7683
|
-
utils$1.isString(path) && cookie.push("path=" + path);
|
|
7684
|
-
utils$1.isString(domain) && cookie.push("domain=" + domain);
|
|
7685
|
-
secure === true && cookie.push("secure");
|
|
7686
|
-
document.cookie = cookie.join("; ");
|
|
7687
|
-
},
|
|
7688
|
-
read(name) {
|
|
7689
|
-
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
7690
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
7691
|
-
},
|
|
7692
|
-
remove(name) {
|
|
7693
|
-
this.write(name, "", Date.now() - 864e5);
|
|
7694
|
-
}
|
|
7695
|
-
}
|
|
7696
|
-
) : (
|
|
7697
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
7698
|
-
{
|
|
7699
|
-
write() {
|
|
7700
|
-
},
|
|
7701
|
-
read() {
|
|
7702
|
-
return null;
|
|
7703
|
-
},
|
|
7704
|
-
remove() {
|
|
7705
|
-
}
|
|
7706
|
-
}
|
|
7707
|
-
);
|
|
7708
|
-
function isAbsoluteURL(url) {
|
|
7709
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
7710
|
-
}
|
|
7711
|
-
function combineURLs(baseURL, relativeURL) {
|
|
7712
|
-
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
7713
|
-
}
|
|
7714
|
-
function buildFullPath(baseURL, requestedURL) {
|
|
7715
|
-
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
7716
|
-
return combineURLs(baseURL, requestedURL);
|
|
7717
|
-
}
|
|
7718
|
-
return requestedURL;
|
|
7719
|
-
}
|
|
7720
|
-
const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
|
|
7721
|
-
// Standard browser envs have full support of the APIs needed to test
|
|
7722
|
-
// whether the request URL is of the same origin as current location.
|
|
7723
|
-
function standardBrowserEnv() {
|
|
7724
|
-
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
7725
|
-
const urlParsingNode = document.createElement("a");
|
|
7726
|
-
let originURL;
|
|
7727
|
-
function resolveURL(url) {
|
|
7728
|
-
let href = url;
|
|
7729
|
-
if (msie) {
|
|
7730
|
-
urlParsingNode.setAttribute("href", href);
|
|
7731
|
-
href = urlParsingNode.href;
|
|
7732
|
-
}
|
|
7733
|
-
urlParsingNode.setAttribute("href", href);
|
|
7734
|
-
return {
|
|
7735
|
-
href: urlParsingNode.href,
|
|
7736
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
7737
|
-
host: urlParsingNode.host,
|
|
7738
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
7739
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
7740
|
-
hostname: urlParsingNode.hostname,
|
|
7741
|
-
port: urlParsingNode.port,
|
|
7742
|
-
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
7743
|
-
};
|
|
7744
|
-
}
|
|
7745
|
-
originURL = resolveURL(window.location.href);
|
|
7746
|
-
return function isURLSameOrigin2(requestURL) {
|
|
7747
|
-
const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
7748
|
-
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
7749
|
-
};
|
|
7750
|
-
}()
|
|
7751
|
-
) : (
|
|
7752
|
-
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
7753
|
-
/* @__PURE__ */ function nonStandardBrowserEnv() {
|
|
7754
|
-
return function isURLSameOrigin2() {
|
|
7755
|
-
return true;
|
|
7756
|
-
};
|
|
7757
|
-
}()
|
|
7758
|
-
);
|
|
7759
7712
|
function parseProtocol(url) {
|
|
7760
7713
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
7761
7714
|
return match && match[1] || "";
|
|
@@ -7793,10 +7746,42 @@ function speedometer(samplesCount, min) {
|
|
|
7793
7746
|
return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
|
|
7794
7747
|
};
|
|
7795
7748
|
}
|
|
7796
|
-
function
|
|
7749
|
+
function throttle(fn, freq) {
|
|
7750
|
+
let timestamp = 0;
|
|
7751
|
+
let threshold = 1e3 / freq;
|
|
7752
|
+
let lastArgs;
|
|
7753
|
+
let timer;
|
|
7754
|
+
const invoke = (args, now = Date.now()) => {
|
|
7755
|
+
timestamp = now;
|
|
7756
|
+
lastArgs = null;
|
|
7757
|
+
if (timer) {
|
|
7758
|
+
clearTimeout(timer);
|
|
7759
|
+
timer = null;
|
|
7760
|
+
}
|
|
7761
|
+
fn.apply(null, args);
|
|
7762
|
+
};
|
|
7763
|
+
const throttled = (...args) => {
|
|
7764
|
+
const now = Date.now();
|
|
7765
|
+
const passed = now - timestamp;
|
|
7766
|
+
if (passed >= threshold) {
|
|
7767
|
+
invoke(args, now);
|
|
7768
|
+
} else {
|
|
7769
|
+
lastArgs = args;
|
|
7770
|
+
if (!timer) {
|
|
7771
|
+
timer = setTimeout(() => {
|
|
7772
|
+
timer = null;
|
|
7773
|
+
invoke(lastArgs);
|
|
7774
|
+
}, threshold - passed);
|
|
7775
|
+
}
|
|
7776
|
+
}
|
|
7777
|
+
};
|
|
7778
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
7779
|
+
return [throttled, flush];
|
|
7780
|
+
}
|
|
7781
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
7797
7782
|
let bytesNotified = 0;
|
|
7798
7783
|
const _speedometer = speedometer(50, 250);
|
|
7799
|
-
return (e) => {
|
|
7784
|
+
return throttle((e) => {
|
|
7800
7785
|
const loaded = e.loaded;
|
|
7801
7786
|
const total = e.lengthComputable ? e.total : void 0;
|
|
7802
7787
|
const progressBytes = loaded - bytesNotified;
|
|
@@ -7810,45 +7795,232 @@ function progressEventReducer(listener, isDownloadStream) {
|
|
|
7810
7795
|
bytes: progressBytes,
|
|
7811
7796
|
rate: rate ? rate : void 0,
|
|
7812
7797
|
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
7813
|
-
event: e
|
|
7798
|
+
event: e,
|
|
7799
|
+
lengthComputable: total != null,
|
|
7800
|
+
[isDownloadStream ? "download" : "upload"]: true
|
|
7814
7801
|
};
|
|
7815
|
-
data[isDownloadStream ? "download" : "upload"] = true;
|
|
7816
7802
|
listener(data);
|
|
7803
|
+
}, freq);
|
|
7804
|
+
};
|
|
7805
|
+
const progressEventDecorator = (total, throttled) => {
|
|
7806
|
+
const lengthComputable = total != null;
|
|
7807
|
+
return [(loaded) => throttled[0]({
|
|
7808
|
+
lengthComputable,
|
|
7809
|
+
total,
|
|
7810
|
+
loaded
|
|
7811
|
+
}), throttled[1]];
|
|
7812
|
+
};
|
|
7813
|
+
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
|
7814
|
+
const isURLSameOrigin = platform.hasStandardBrowserEnv ? (
|
|
7815
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
7816
|
+
// whether the request URL is of the same origin as current location.
|
|
7817
|
+
function standardBrowserEnv() {
|
|
7818
|
+
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
7819
|
+
const urlParsingNode = document.createElement("a");
|
|
7820
|
+
let originURL;
|
|
7821
|
+
function resolveURL(url) {
|
|
7822
|
+
let href = url;
|
|
7823
|
+
if (msie) {
|
|
7824
|
+
urlParsingNode.setAttribute("href", href);
|
|
7825
|
+
href = urlParsingNode.href;
|
|
7826
|
+
}
|
|
7827
|
+
urlParsingNode.setAttribute("href", href);
|
|
7828
|
+
return {
|
|
7829
|
+
href: urlParsingNode.href,
|
|
7830
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
7831
|
+
host: urlParsingNode.host,
|
|
7832
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
7833
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
7834
|
+
hostname: urlParsingNode.hostname,
|
|
7835
|
+
port: urlParsingNode.port,
|
|
7836
|
+
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
7837
|
+
};
|
|
7838
|
+
}
|
|
7839
|
+
originURL = resolveURL(window.location.href);
|
|
7840
|
+
return function isURLSameOrigin2(requestURL) {
|
|
7841
|
+
const parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
7842
|
+
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
7843
|
+
};
|
|
7844
|
+
}()
|
|
7845
|
+
) : (
|
|
7846
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
7847
|
+
/* @__PURE__ */ function nonStandardBrowserEnv() {
|
|
7848
|
+
return function isURLSameOrigin2() {
|
|
7849
|
+
return true;
|
|
7850
|
+
};
|
|
7851
|
+
}()
|
|
7852
|
+
);
|
|
7853
|
+
const cookies = platform.hasStandardBrowserEnv ? (
|
|
7854
|
+
// Standard browser envs support document.cookie
|
|
7855
|
+
{
|
|
7856
|
+
write(name, value, expires, path, domain, secure) {
|
|
7857
|
+
const cookie = [name + "=" + encodeURIComponent(value)];
|
|
7858
|
+
utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
|
|
7859
|
+
utils$1.isString(path) && cookie.push("path=" + path);
|
|
7860
|
+
utils$1.isString(domain) && cookie.push("domain=" + domain);
|
|
7861
|
+
secure === true && cookie.push("secure");
|
|
7862
|
+
document.cookie = cookie.join("; ");
|
|
7863
|
+
},
|
|
7864
|
+
read(name) {
|
|
7865
|
+
const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
|
|
7866
|
+
return match ? decodeURIComponent(match[3]) : null;
|
|
7867
|
+
},
|
|
7868
|
+
remove(name) {
|
|
7869
|
+
this.write(name, "", Date.now() - 864e5);
|
|
7870
|
+
}
|
|
7871
|
+
}
|
|
7872
|
+
) : (
|
|
7873
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
7874
|
+
{
|
|
7875
|
+
write() {
|
|
7876
|
+
},
|
|
7877
|
+
read() {
|
|
7878
|
+
return null;
|
|
7879
|
+
},
|
|
7880
|
+
remove() {
|
|
7881
|
+
}
|
|
7882
|
+
}
|
|
7883
|
+
);
|
|
7884
|
+
function isAbsoluteURL(url) {
|
|
7885
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
7886
|
+
}
|
|
7887
|
+
function combineURLs(baseURL, relativeURL) {
|
|
7888
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
7889
|
+
}
|
|
7890
|
+
function buildFullPath(baseURL, requestedURL) {
|
|
7891
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
7892
|
+
return combineURLs(baseURL, requestedURL);
|
|
7893
|
+
}
|
|
7894
|
+
return requestedURL;
|
|
7895
|
+
}
|
|
7896
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
7897
|
+
function mergeConfig(config1, config2) {
|
|
7898
|
+
config2 = config2 || {};
|
|
7899
|
+
const config = {};
|
|
7900
|
+
function getMergedValue(target, source, caseless) {
|
|
7901
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
7902
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
7903
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
7904
|
+
return utils$1.merge({}, source);
|
|
7905
|
+
} else if (utils$1.isArray(source)) {
|
|
7906
|
+
return source.slice();
|
|
7907
|
+
}
|
|
7908
|
+
return source;
|
|
7909
|
+
}
|
|
7910
|
+
function mergeDeepProperties(a2, b, caseless) {
|
|
7911
|
+
if (!utils$1.isUndefined(b)) {
|
|
7912
|
+
return getMergedValue(a2, b, caseless);
|
|
7913
|
+
} else if (!utils$1.isUndefined(a2)) {
|
|
7914
|
+
return getMergedValue(void 0, a2, caseless);
|
|
7915
|
+
}
|
|
7916
|
+
}
|
|
7917
|
+
function valueFromConfig2(a2, b) {
|
|
7918
|
+
if (!utils$1.isUndefined(b)) {
|
|
7919
|
+
return getMergedValue(void 0, b);
|
|
7920
|
+
}
|
|
7921
|
+
}
|
|
7922
|
+
function defaultToConfig2(a2, b) {
|
|
7923
|
+
if (!utils$1.isUndefined(b)) {
|
|
7924
|
+
return getMergedValue(void 0, b);
|
|
7925
|
+
} else if (!utils$1.isUndefined(a2)) {
|
|
7926
|
+
return getMergedValue(void 0, a2);
|
|
7927
|
+
}
|
|
7928
|
+
}
|
|
7929
|
+
function mergeDirectKeys(a2, b, prop) {
|
|
7930
|
+
if (prop in config2) {
|
|
7931
|
+
return getMergedValue(a2, b);
|
|
7932
|
+
} else if (prop in config1) {
|
|
7933
|
+
return getMergedValue(void 0, a2);
|
|
7934
|
+
}
|
|
7935
|
+
}
|
|
7936
|
+
const mergeMap = {
|
|
7937
|
+
url: valueFromConfig2,
|
|
7938
|
+
method: valueFromConfig2,
|
|
7939
|
+
data: valueFromConfig2,
|
|
7940
|
+
baseURL: defaultToConfig2,
|
|
7941
|
+
transformRequest: defaultToConfig2,
|
|
7942
|
+
transformResponse: defaultToConfig2,
|
|
7943
|
+
paramsSerializer: defaultToConfig2,
|
|
7944
|
+
timeout: defaultToConfig2,
|
|
7945
|
+
timeoutMessage: defaultToConfig2,
|
|
7946
|
+
withCredentials: defaultToConfig2,
|
|
7947
|
+
withXSRFToken: defaultToConfig2,
|
|
7948
|
+
adapter: defaultToConfig2,
|
|
7949
|
+
responseType: defaultToConfig2,
|
|
7950
|
+
xsrfCookieName: defaultToConfig2,
|
|
7951
|
+
xsrfHeaderName: defaultToConfig2,
|
|
7952
|
+
onUploadProgress: defaultToConfig2,
|
|
7953
|
+
onDownloadProgress: defaultToConfig2,
|
|
7954
|
+
decompress: defaultToConfig2,
|
|
7955
|
+
maxContentLength: defaultToConfig2,
|
|
7956
|
+
maxBodyLength: defaultToConfig2,
|
|
7957
|
+
beforeRedirect: defaultToConfig2,
|
|
7958
|
+
transport: defaultToConfig2,
|
|
7959
|
+
httpAgent: defaultToConfig2,
|
|
7960
|
+
httpsAgent: defaultToConfig2,
|
|
7961
|
+
cancelToken: defaultToConfig2,
|
|
7962
|
+
socketPath: defaultToConfig2,
|
|
7963
|
+
responseEncoding: defaultToConfig2,
|
|
7964
|
+
validateStatus: mergeDirectKeys,
|
|
7965
|
+
headers: (a2, b) => mergeDeepProperties(headersToObject(a2), headersToObject(b), true)
|
|
7817
7966
|
};
|
|
7967
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
7968
|
+
const merge3 = mergeMap[prop] || mergeDeepProperties;
|
|
7969
|
+
const configValue = merge3(config1[prop], config2[prop], prop);
|
|
7970
|
+
utils$1.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config[prop] = configValue);
|
|
7971
|
+
});
|
|
7972
|
+
return config;
|
|
7818
7973
|
}
|
|
7974
|
+
const resolveConfig = (config) => {
|
|
7975
|
+
const newConfig = mergeConfig({}, config);
|
|
7976
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
7977
|
+
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
7978
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
7979
|
+
if (auth) {
|
|
7980
|
+
headers.set(
|
|
7981
|
+
"Authorization",
|
|
7982
|
+
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
7983
|
+
);
|
|
7984
|
+
}
|
|
7985
|
+
let contentType;
|
|
7986
|
+
if (utils$1.isFormData(data)) {
|
|
7987
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
7988
|
+
headers.setContentType(void 0);
|
|
7989
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
7990
|
+
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
7991
|
+
headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
7992
|
+
}
|
|
7993
|
+
}
|
|
7994
|
+
if (platform.hasStandardBrowserEnv) {
|
|
7995
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
7996
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
|
|
7997
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
7998
|
+
if (xsrfValue) {
|
|
7999
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
8000
|
+
}
|
|
8001
|
+
}
|
|
8002
|
+
}
|
|
8003
|
+
return newConfig;
|
|
8004
|
+
};
|
|
7819
8005
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
7820
8006
|
const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
7821
8007
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
8008
|
+
const _config = resolveConfig(config);
|
|
8009
|
+
let requestData = _config.data;
|
|
8010
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
8011
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
7825
8012
|
let onCanceled;
|
|
8013
|
+
let uploadThrottled, downloadThrottled;
|
|
8014
|
+
let flushUpload, flushDownload;
|
|
7826
8015
|
function done() {
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
config.signal.removeEventListener("abort", onCanceled);
|
|
7832
|
-
}
|
|
7833
|
-
}
|
|
7834
|
-
let contentType;
|
|
7835
|
-
if (utils$1.isFormData(requestData)) {
|
|
7836
|
-
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
7837
|
-
requestHeaders.setContentType(false);
|
|
7838
|
-
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
7839
|
-
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
7840
|
-
requestHeaders.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
7841
|
-
}
|
|
8016
|
+
flushUpload && flushUpload();
|
|
8017
|
+
flushDownload && flushDownload();
|
|
8018
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
8019
|
+
_config.signal && _config.signal.removeEventListener("abort", onCanceled);
|
|
7842
8020
|
}
|
|
7843
8021
|
let request = new XMLHttpRequest();
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
7847
|
-
requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
|
|
7848
|
-
}
|
|
7849
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
7850
|
-
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
7851
|
-
request.timeout = config.timeout;
|
|
8022
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
8023
|
+
request.timeout = _config.timeout;
|
|
7852
8024
|
function onloadend() {
|
|
7853
8025
|
if (!request) {
|
|
7854
8026
|
return;
|
|
@@ -7899,10 +8071,10 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
7899
8071
|
request = null;
|
|
7900
8072
|
};
|
|
7901
8073
|
request.ontimeout = function handleTimeout() {
|
|
7902
|
-
let timeoutErrorMessage =
|
|
7903
|
-
const transitional2 =
|
|
7904
|
-
if (
|
|
7905
|
-
timeoutErrorMessage =
|
|
8074
|
+
let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
|
|
8075
|
+
const transitional2 = _config.transitional || transitionalDefaults;
|
|
8076
|
+
if (_config.timeoutErrorMessage) {
|
|
8077
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
7906
8078
|
}
|
|
7907
8079
|
reject(new AxiosError(
|
|
7908
8080
|
timeoutErrorMessage,
|
|
@@ -7912,34 +8084,28 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
7912
8084
|
));
|
|
7913
8085
|
request = null;
|
|
7914
8086
|
};
|
|
7915
|
-
if (platform.hasStandardBrowserEnv) {
|
|
7916
|
-
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
7917
|
-
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(fullPath)) {
|
|
7918
|
-
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
7919
|
-
if (xsrfValue) {
|
|
7920
|
-
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
7921
|
-
}
|
|
7922
|
-
}
|
|
7923
|
-
}
|
|
7924
8087
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
7925
8088
|
if ("setRequestHeader" in request) {
|
|
7926
8089
|
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
7927
8090
|
request.setRequestHeader(key, val);
|
|
7928
8091
|
});
|
|
7929
8092
|
}
|
|
7930
|
-
if (!utils$1.isUndefined(
|
|
7931
|
-
request.withCredentials = !!
|
|
8093
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
8094
|
+
request.withCredentials = !!_config.withCredentials;
|
|
7932
8095
|
}
|
|
7933
8096
|
if (responseType && responseType !== "json") {
|
|
7934
|
-
request.responseType =
|
|
8097
|
+
request.responseType = _config.responseType;
|
|
7935
8098
|
}
|
|
7936
|
-
if (
|
|
7937
|
-
|
|
8099
|
+
if (onDownloadProgress) {
|
|
8100
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
8101
|
+
request.addEventListener("progress", downloadThrottled);
|
|
7938
8102
|
}
|
|
7939
|
-
if (
|
|
7940
|
-
|
|
8103
|
+
if (onUploadProgress && request.upload) {
|
|
8104
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
8105
|
+
request.upload.addEventListener("progress", uploadThrottled);
|
|
8106
|
+
request.upload.addEventListener("loadend", flushUpload);
|
|
7941
8107
|
}
|
|
7942
|
-
if (
|
|
8108
|
+
if (_config.cancelToken || _config.signal) {
|
|
7943
8109
|
onCanceled = (cancel) => {
|
|
7944
8110
|
if (!request) {
|
|
7945
8111
|
return;
|
|
@@ -7948,12 +8114,12 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
7948
8114
|
request.abort();
|
|
7949
8115
|
request = null;
|
|
7950
8116
|
};
|
|
7951
|
-
|
|
7952
|
-
if (
|
|
7953
|
-
|
|
8117
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
8118
|
+
if (_config.signal) {
|
|
8119
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
|
|
7954
8120
|
}
|
|
7955
8121
|
}
|
|
7956
|
-
const protocol = parseProtocol(
|
|
8122
|
+
const protocol = parseProtocol(_config.url);
|
|
7957
8123
|
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
7958
8124
|
reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
|
|
7959
8125
|
return;
|
|
@@ -7961,9 +8127,260 @@ const xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
|
7961
8127
|
request.send(requestData || null);
|
|
7962
8128
|
});
|
|
7963
8129
|
};
|
|
8130
|
+
const composeSignals = (signals, timeout) => {
|
|
8131
|
+
let controller = new AbortController();
|
|
8132
|
+
let aborted;
|
|
8133
|
+
const onabort = function(cancel) {
|
|
8134
|
+
if (!aborted) {
|
|
8135
|
+
aborted = true;
|
|
8136
|
+
unsubscribe();
|
|
8137
|
+
const err = cancel instanceof Error ? cancel : this.reason;
|
|
8138
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
8139
|
+
}
|
|
8140
|
+
};
|
|
8141
|
+
let timer = timeout && setTimeout(() => {
|
|
8142
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
|
8143
|
+
}, timeout);
|
|
8144
|
+
const unsubscribe = () => {
|
|
8145
|
+
if (signals) {
|
|
8146
|
+
timer && clearTimeout(timer);
|
|
8147
|
+
timer = null;
|
|
8148
|
+
signals.forEach((signal2) => {
|
|
8149
|
+
signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort));
|
|
8150
|
+
});
|
|
8151
|
+
signals = null;
|
|
8152
|
+
}
|
|
8153
|
+
};
|
|
8154
|
+
signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort));
|
|
8155
|
+
const { signal } = controller;
|
|
8156
|
+
signal.unsubscribe = unsubscribe;
|
|
8157
|
+
return [signal, () => {
|
|
8158
|
+
timer && clearTimeout(timer);
|
|
8159
|
+
timer = null;
|
|
8160
|
+
}];
|
|
8161
|
+
};
|
|
8162
|
+
const streamChunk = function* (chunk, chunkSize) {
|
|
8163
|
+
let len = chunk.byteLength;
|
|
8164
|
+
if (!chunkSize || len < chunkSize) {
|
|
8165
|
+
yield chunk;
|
|
8166
|
+
return;
|
|
8167
|
+
}
|
|
8168
|
+
let pos = 0;
|
|
8169
|
+
let end;
|
|
8170
|
+
while (pos < len) {
|
|
8171
|
+
end = pos + chunkSize;
|
|
8172
|
+
yield chunk.slice(pos, end);
|
|
8173
|
+
pos = end;
|
|
8174
|
+
}
|
|
8175
|
+
};
|
|
8176
|
+
const readBytes = async function* (iterable, chunkSize, encode3) {
|
|
8177
|
+
for await (const chunk of iterable) {
|
|
8178
|
+
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : await encode3(String(chunk)), chunkSize);
|
|
8179
|
+
}
|
|
8180
|
+
};
|
|
8181
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish, encode3) => {
|
|
8182
|
+
const iterator = readBytes(stream, chunkSize, encode3);
|
|
8183
|
+
let bytes = 0;
|
|
8184
|
+
let done;
|
|
8185
|
+
let _onFinish = (e) => {
|
|
8186
|
+
if (!done) {
|
|
8187
|
+
done = true;
|
|
8188
|
+
onFinish && onFinish(e);
|
|
8189
|
+
}
|
|
8190
|
+
};
|
|
8191
|
+
return new ReadableStream({
|
|
8192
|
+
async pull(controller) {
|
|
8193
|
+
try {
|
|
8194
|
+
const { done: done2, value } = await iterator.next();
|
|
8195
|
+
if (done2) {
|
|
8196
|
+
_onFinish();
|
|
8197
|
+
controller.close();
|
|
8198
|
+
return;
|
|
8199
|
+
}
|
|
8200
|
+
let len = value.byteLength;
|
|
8201
|
+
if (onProgress) {
|
|
8202
|
+
let loadedBytes = bytes += len;
|
|
8203
|
+
onProgress(loadedBytes);
|
|
8204
|
+
}
|
|
8205
|
+
controller.enqueue(new Uint8Array(value));
|
|
8206
|
+
} catch (err) {
|
|
8207
|
+
_onFinish(err);
|
|
8208
|
+
throw err;
|
|
8209
|
+
}
|
|
8210
|
+
},
|
|
8211
|
+
cancel(reason) {
|
|
8212
|
+
_onFinish(reason);
|
|
8213
|
+
return iterator.return();
|
|
8214
|
+
}
|
|
8215
|
+
}, {
|
|
8216
|
+
highWaterMark: 2
|
|
8217
|
+
});
|
|
8218
|
+
};
|
|
8219
|
+
const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
|
|
8220
|
+
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
|
|
8221
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
|
|
8222
|
+
const test = (fn, ...args) => {
|
|
8223
|
+
try {
|
|
8224
|
+
return !!fn(...args);
|
|
8225
|
+
} catch (e) {
|
|
8226
|
+
return false;
|
|
8227
|
+
}
|
|
8228
|
+
};
|
|
8229
|
+
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
8230
|
+
let duplexAccessed = false;
|
|
8231
|
+
const hasContentType = new Request(platform.origin, {
|
|
8232
|
+
body: new ReadableStream(),
|
|
8233
|
+
method: "POST",
|
|
8234
|
+
get duplex() {
|
|
8235
|
+
duplexAccessed = true;
|
|
8236
|
+
return "half";
|
|
8237
|
+
}
|
|
8238
|
+
}).headers.has("Content-Type");
|
|
8239
|
+
return duplexAccessed && !hasContentType;
|
|
8240
|
+
});
|
|
8241
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
8242
|
+
const supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
|
|
8243
|
+
const resolvers = {
|
|
8244
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
8245
|
+
};
|
|
8246
|
+
isFetchSupported && ((res) => {
|
|
8247
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
8248
|
+
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_, config) => {
|
|
8249
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
8250
|
+
});
|
|
8251
|
+
});
|
|
8252
|
+
})(new Response());
|
|
8253
|
+
const getBodyLength = async (body) => {
|
|
8254
|
+
if (body == null) {
|
|
8255
|
+
return 0;
|
|
8256
|
+
}
|
|
8257
|
+
if (utils$1.isBlob(body)) {
|
|
8258
|
+
return body.size;
|
|
8259
|
+
}
|
|
8260
|
+
if (utils$1.isSpecCompliantForm(body)) {
|
|
8261
|
+
return (await new Request(body).arrayBuffer()).byteLength;
|
|
8262
|
+
}
|
|
8263
|
+
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
8264
|
+
return body.byteLength;
|
|
8265
|
+
}
|
|
8266
|
+
if (utils$1.isURLSearchParams(body)) {
|
|
8267
|
+
body = body + "";
|
|
8268
|
+
}
|
|
8269
|
+
if (utils$1.isString(body)) {
|
|
8270
|
+
return (await encodeText(body)).byteLength;
|
|
8271
|
+
}
|
|
8272
|
+
};
|
|
8273
|
+
const resolveBodyLength = async (headers, body) => {
|
|
8274
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
8275
|
+
return length == null ? getBodyLength(body) : length;
|
|
8276
|
+
};
|
|
8277
|
+
const fetchAdapter = isFetchSupported && (async (config) => {
|
|
8278
|
+
let {
|
|
8279
|
+
url,
|
|
8280
|
+
method,
|
|
8281
|
+
data,
|
|
8282
|
+
signal,
|
|
8283
|
+
cancelToken,
|
|
8284
|
+
timeout,
|
|
8285
|
+
onDownloadProgress,
|
|
8286
|
+
onUploadProgress,
|
|
8287
|
+
responseType,
|
|
8288
|
+
headers,
|
|
8289
|
+
withCredentials = "same-origin",
|
|
8290
|
+
fetchOptions
|
|
8291
|
+
} = resolveConfig(config);
|
|
8292
|
+
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
8293
|
+
let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals([signal, cancelToken], timeout) : [];
|
|
8294
|
+
let finished, request;
|
|
8295
|
+
const onFinish = () => {
|
|
8296
|
+
!finished && setTimeout(() => {
|
|
8297
|
+
composedSignal && composedSignal.unsubscribe();
|
|
8298
|
+
});
|
|
8299
|
+
finished = true;
|
|
8300
|
+
};
|
|
8301
|
+
let requestContentLength;
|
|
8302
|
+
try {
|
|
8303
|
+
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
8304
|
+
let _request = new Request(url, {
|
|
8305
|
+
method: "POST",
|
|
8306
|
+
body: data,
|
|
8307
|
+
duplex: "half"
|
|
8308
|
+
});
|
|
8309
|
+
let contentTypeHeader;
|
|
8310
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
8311
|
+
headers.setContentType(contentTypeHeader);
|
|
8312
|
+
}
|
|
8313
|
+
if (_request.body) {
|
|
8314
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
8315
|
+
requestContentLength,
|
|
8316
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
8317
|
+
);
|
|
8318
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
|
|
8319
|
+
}
|
|
8320
|
+
}
|
|
8321
|
+
if (!utils$1.isString(withCredentials)) {
|
|
8322
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
8323
|
+
}
|
|
8324
|
+
request = new Request(url, {
|
|
8325
|
+
...fetchOptions,
|
|
8326
|
+
signal: composedSignal,
|
|
8327
|
+
method: method.toUpperCase(),
|
|
8328
|
+
headers: headers.normalize().toJSON(),
|
|
8329
|
+
body: data,
|
|
8330
|
+
duplex: "half",
|
|
8331
|
+
credentials: withCredentials
|
|
8332
|
+
});
|
|
8333
|
+
let response = await fetch(request);
|
|
8334
|
+
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
8335
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse)) {
|
|
8336
|
+
const options = {};
|
|
8337
|
+
["status", "statusText", "headers"].forEach((prop) => {
|
|
8338
|
+
options[prop] = response[prop];
|
|
8339
|
+
});
|
|
8340
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
|
|
8341
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
8342
|
+
responseContentLength,
|
|
8343
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
8344
|
+
) || [];
|
|
8345
|
+
response = new Response(
|
|
8346
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
8347
|
+
flush && flush();
|
|
8348
|
+
isStreamResponse && onFinish();
|
|
8349
|
+
}, encodeText),
|
|
8350
|
+
options
|
|
8351
|
+
);
|
|
8352
|
+
}
|
|
8353
|
+
responseType = responseType || "text";
|
|
8354
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
|
|
8355
|
+
!isStreamResponse && onFinish();
|
|
8356
|
+
stopTimeout && stopTimeout();
|
|
8357
|
+
return await new Promise((resolve, reject) => {
|
|
8358
|
+
settle(resolve, reject, {
|
|
8359
|
+
data: responseData,
|
|
8360
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
8361
|
+
status: response.status,
|
|
8362
|
+
statusText: response.statusText,
|
|
8363
|
+
config,
|
|
8364
|
+
request
|
|
8365
|
+
});
|
|
8366
|
+
});
|
|
8367
|
+
} catch (err) {
|
|
8368
|
+
onFinish();
|
|
8369
|
+
if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
|
|
8370
|
+
throw Object.assign(
|
|
8371
|
+
new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request),
|
|
8372
|
+
{
|
|
8373
|
+
cause: err.cause || err
|
|
8374
|
+
}
|
|
8375
|
+
);
|
|
8376
|
+
}
|
|
8377
|
+
throw AxiosError.from(err, err && err.code, config, request);
|
|
8378
|
+
}
|
|
8379
|
+
});
|
|
7964
8380
|
const knownAdapters = {
|
|
7965
8381
|
http: httpAdapter,
|
|
7966
|
-
xhr: xhrAdapter
|
|
8382
|
+
xhr: xhrAdapter,
|
|
8383
|
+
fetch: fetchAdapter
|
|
7967
8384
|
};
|
|
7968
8385
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
7969
8386
|
if (fn) {
|
|
@@ -8055,85 +8472,7 @@ function dispatchRequest(config) {
|
|
|
8055
8472
|
return Promise.reject(reason);
|
|
8056
8473
|
});
|
|
8057
8474
|
}
|
|
8058
|
-
const
|
|
8059
|
-
function mergeConfig(config1, config2) {
|
|
8060
|
-
config2 = config2 || {};
|
|
8061
|
-
const config = {};
|
|
8062
|
-
function getMergedValue(target, source, caseless) {
|
|
8063
|
-
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
8064
|
-
return utils$1.merge.call({ caseless }, target, source);
|
|
8065
|
-
} else if (utils$1.isPlainObject(source)) {
|
|
8066
|
-
return utils$1.merge({}, source);
|
|
8067
|
-
} else if (utils$1.isArray(source)) {
|
|
8068
|
-
return source.slice();
|
|
8069
|
-
}
|
|
8070
|
-
return source;
|
|
8071
|
-
}
|
|
8072
|
-
function mergeDeepProperties(a2, b, caseless) {
|
|
8073
|
-
if (!utils$1.isUndefined(b)) {
|
|
8074
|
-
return getMergedValue(a2, b, caseless);
|
|
8075
|
-
} else if (!utils$1.isUndefined(a2)) {
|
|
8076
|
-
return getMergedValue(void 0, a2, caseless);
|
|
8077
|
-
}
|
|
8078
|
-
}
|
|
8079
|
-
function valueFromConfig2(a2, b) {
|
|
8080
|
-
if (!utils$1.isUndefined(b)) {
|
|
8081
|
-
return getMergedValue(void 0, b);
|
|
8082
|
-
}
|
|
8083
|
-
}
|
|
8084
|
-
function defaultToConfig2(a2, b) {
|
|
8085
|
-
if (!utils$1.isUndefined(b)) {
|
|
8086
|
-
return getMergedValue(void 0, b);
|
|
8087
|
-
} else if (!utils$1.isUndefined(a2)) {
|
|
8088
|
-
return getMergedValue(void 0, a2);
|
|
8089
|
-
}
|
|
8090
|
-
}
|
|
8091
|
-
function mergeDirectKeys(a2, b, prop) {
|
|
8092
|
-
if (prop in config2) {
|
|
8093
|
-
return getMergedValue(a2, b);
|
|
8094
|
-
} else if (prop in config1) {
|
|
8095
|
-
return getMergedValue(void 0, a2);
|
|
8096
|
-
}
|
|
8097
|
-
}
|
|
8098
|
-
const mergeMap = {
|
|
8099
|
-
url: valueFromConfig2,
|
|
8100
|
-
method: valueFromConfig2,
|
|
8101
|
-
data: valueFromConfig2,
|
|
8102
|
-
baseURL: defaultToConfig2,
|
|
8103
|
-
transformRequest: defaultToConfig2,
|
|
8104
|
-
transformResponse: defaultToConfig2,
|
|
8105
|
-
paramsSerializer: defaultToConfig2,
|
|
8106
|
-
timeout: defaultToConfig2,
|
|
8107
|
-
timeoutMessage: defaultToConfig2,
|
|
8108
|
-
withCredentials: defaultToConfig2,
|
|
8109
|
-
withXSRFToken: defaultToConfig2,
|
|
8110
|
-
adapter: defaultToConfig2,
|
|
8111
|
-
responseType: defaultToConfig2,
|
|
8112
|
-
xsrfCookieName: defaultToConfig2,
|
|
8113
|
-
xsrfHeaderName: defaultToConfig2,
|
|
8114
|
-
onUploadProgress: defaultToConfig2,
|
|
8115
|
-
onDownloadProgress: defaultToConfig2,
|
|
8116
|
-
decompress: defaultToConfig2,
|
|
8117
|
-
maxContentLength: defaultToConfig2,
|
|
8118
|
-
maxBodyLength: defaultToConfig2,
|
|
8119
|
-
beforeRedirect: defaultToConfig2,
|
|
8120
|
-
transport: defaultToConfig2,
|
|
8121
|
-
httpAgent: defaultToConfig2,
|
|
8122
|
-
httpsAgent: defaultToConfig2,
|
|
8123
|
-
cancelToken: defaultToConfig2,
|
|
8124
|
-
socketPath: defaultToConfig2,
|
|
8125
|
-
responseEncoding: defaultToConfig2,
|
|
8126
|
-
validateStatus: mergeDirectKeys,
|
|
8127
|
-
headers: (a2, b) => mergeDeepProperties(headersToObject(a2), headersToObject(b), true)
|
|
8128
|
-
};
|
|
8129
|
-
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
8130
|
-
const merge3 = mergeMap[prop] || mergeDeepProperties;
|
|
8131
|
-
const configValue = merge3(config1[prop], config2[prop], prop);
|
|
8132
|
-
utils$1.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config[prop] = configValue);
|
|
8133
|
-
});
|
|
8134
|
-
return config;
|
|
8135
|
-
}
|
|
8136
|
-
const VERSION = "1.6.8";
|
|
8475
|
+
const VERSION = "1.7.4";
|
|
8137
8476
|
const validators$1 = {};
|
|
8138
8477
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
8139
8478
|
validators$1[type] = function validator2(thing) {
|
|
@@ -8215,10 +8554,13 @@ class Axios {
|
|
|
8215
8554
|
let dummy;
|
|
8216
8555
|
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
|
|
8217
8556
|
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
8218
|
-
|
|
8219
|
-
err.stack
|
|
8220
|
-
|
|
8221
|
-
err.stack
|
|
8557
|
+
try {
|
|
8558
|
+
if (!err.stack) {
|
|
8559
|
+
err.stack = stack;
|
|
8560
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
8561
|
+
err.stack += "\n" + stack;
|
|
8562
|
+
}
|
|
8563
|
+
} catch (e) {
|
|
8222
8564
|
}
|
|
8223
8565
|
}
|
|
8224
8566
|
throw err;
|
|
@@ -10836,21 +11178,15 @@ const PasswordInput = React.forwardRef(
|
|
|
10836
11178
|
ref: composedRefs,
|
|
10837
11179
|
autoComplete: "password",
|
|
10838
11180
|
endAction: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10839
|
-
|
|
11181
|
+
designSystem.Field.Action,
|
|
10840
11182
|
{
|
|
10841
|
-
|
|
11183
|
+
label: formatMessage({
|
|
10842
11184
|
id: "Auth.form.password.show-password",
|
|
10843
11185
|
defaultMessage: "Show password"
|
|
10844
11186
|
}),
|
|
10845
11187
|
onClick: () => {
|
|
10846
11188
|
setShowPassword((prev) => !prev);
|
|
10847
11189
|
},
|
|
10848
|
-
style: {
|
|
10849
|
-
border: "none",
|
|
10850
|
-
padding: 0,
|
|
10851
|
-
background: "transparent"
|
|
10852
|
-
},
|
|
10853
|
-
type: "button",
|
|
10854
11190
|
children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(icons.Eye, { fill: "neutral500" }) : /* @__PURE__ */ jsxRuntime.jsx(icons.EyeStriked, { fill: "neutral500" })
|
|
10855
11191
|
}
|
|
10856
11192
|
),
|
|
@@ -11505,4 +11841,4 @@ adminApi.enhanceEndpoints({
|
|
|
11505
11841
|
});
|
|
11506
11842
|
exports.Layouts = Layouts;
|
|
11507
11843
|
exports.useTracking = useTracking;
|
|
11508
|
-
//# sourceMappingURL=index-
|
|
11844
|
+
//# sourceMappingURL=index-SpIq5bn1-DuwqBvNN.js.map
|