@pelcro/react-pelcro-js 4.0.0-alpha.110 → 4.0.0-alpha.112
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/index.cjs.js +527 -1516
- package/dist/index.esm.js +526 -1516
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -16,7 +16,7 @@ var assert = require('assert');
|
|
|
16
16
|
var tty = require('tty');
|
|
17
17
|
var os = require('os');
|
|
18
18
|
var zlib = require('zlib');
|
|
19
|
-
var
|
|
19
|
+
var EventEmitter$1 = require('events');
|
|
20
20
|
|
|
21
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
22
|
|
|
@@ -55,6 +55,7 @@ var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
|
|
|
55
55
|
var tty__default = /*#__PURE__*/_interopDefaultLegacy(tty);
|
|
56
56
|
var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
|
|
57
57
|
var zlib__default = /*#__PURE__*/_interopDefaultLegacy(zlib);
|
|
58
|
+
var EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter$1);
|
|
58
59
|
|
|
59
60
|
function _typeof$4(o) {
|
|
60
61
|
"@babel/helpers - typeof";
|
|
@@ -29047,16 +29048,12 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
|
29047
29048
|
* @returns {boolean} True if value is an FormData, otherwise false
|
|
29048
29049
|
*/
|
|
29049
29050
|
const isFormData = (thing) => {
|
|
29050
|
-
|
|
29051
|
+
const pattern = '[object FormData]';
|
|
29051
29052
|
return thing && (
|
|
29052
|
-
(typeof FormData === 'function' && thing instanceof FormData) ||
|
|
29053
|
-
|
|
29054
|
-
|
|
29055
|
-
|
|
29056
|
-
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
29057
|
-
)
|
|
29058
|
-
)
|
|
29059
|
-
)
|
|
29053
|
+
(typeof FormData === 'function' && thing instanceof FormData) ||
|
|
29054
|
+
toString.call(thing) === pattern ||
|
|
29055
|
+
(isFunction$1(thing.toString) && thing.toString() === pattern)
|
|
29056
|
+
);
|
|
29060
29057
|
};
|
|
29061
29058
|
|
|
29062
29059
|
/**
|
|
@@ -29068,8 +29065,6 @@ const isFormData = (thing) => {
|
|
|
29068
29065
|
*/
|
|
29069
29066
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
29070
29067
|
|
|
29071
|
-
const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
|
|
29072
|
-
|
|
29073
29068
|
/**
|
|
29074
29069
|
* Trim excess whitespace off the beginning and end of a string
|
|
29075
29070
|
*
|
|
@@ -29142,11 +29137,7 @@ function findKey(obj, key) {
|
|
|
29142
29137
|
return null;
|
|
29143
29138
|
}
|
|
29144
29139
|
|
|
29145
|
-
const _global =
|
|
29146
|
-
/*eslint no-undef:0*/
|
|
29147
|
-
if (typeof globalThis !== "undefined") return globalThis;
|
|
29148
|
-
return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global)
|
|
29149
|
-
})();
|
|
29140
|
+
const _global = typeof self === "undefined" ? typeof global === "undefined" ? undefined : global : self;
|
|
29150
29141
|
|
|
29151
29142
|
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
29152
29143
|
|
|
@@ -29377,7 +29368,7 @@ const matchAll = (regExp, str) => {
|
|
|
29377
29368
|
const isHTMLForm = kindOfTest('HTMLFormElement');
|
|
29378
29369
|
|
|
29379
29370
|
const toCamelCase = str => {
|
|
29380
|
-
return str.toLowerCase().replace(/[
|
|
29371
|
+
return str.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,
|
|
29381
29372
|
function replacer(m, p1, p2) {
|
|
29382
29373
|
return p1.toUpperCase() + p2;
|
|
29383
29374
|
}
|
|
@@ -29401,9 +29392,8 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
29401
29392
|
const reducedDescriptors = {};
|
|
29402
29393
|
|
|
29403
29394
|
forEach(descriptors, (descriptor, name) => {
|
|
29404
|
-
|
|
29405
|
-
|
|
29406
|
-
reducedDescriptors[name] = ret || descriptor;
|
|
29395
|
+
if (reducer(descriptor, name, obj) !== false) {
|
|
29396
|
+
reducedDescriptors[name] = descriptor;
|
|
29407
29397
|
}
|
|
29408
29398
|
});
|
|
29409
29399
|
|
|
@@ -29458,40 +29448,10 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
29458
29448
|
const noop$2 = () => {};
|
|
29459
29449
|
|
|
29460
29450
|
const toFiniteNumber = (value, defaultValue) => {
|
|
29461
|
-
|
|
29462
|
-
|
|
29463
|
-
|
|
29464
|
-
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
29465
|
-
|
|
29466
|
-
const DIGIT = '0123456789';
|
|
29467
|
-
|
|
29468
|
-
const ALPHABET = {
|
|
29469
|
-
DIGIT,
|
|
29470
|
-
ALPHA,
|
|
29471
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
29472
|
-
};
|
|
29473
|
-
|
|
29474
|
-
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
29475
|
-
let str = '';
|
|
29476
|
-
const {length} = alphabet;
|
|
29477
|
-
while (size--) {
|
|
29478
|
-
str += alphabet[Math.random() * length|0];
|
|
29479
|
-
}
|
|
29480
|
-
|
|
29481
|
-
return str;
|
|
29451
|
+
value = +value;
|
|
29452
|
+
return Number.isFinite(value) ? value : defaultValue;
|
|
29482
29453
|
};
|
|
29483
29454
|
|
|
29484
|
-
/**
|
|
29485
|
-
* If the thing is a FormData object, return true, otherwise return false.
|
|
29486
|
-
*
|
|
29487
|
-
* @param {unknown} thing - The thing to check.
|
|
29488
|
-
*
|
|
29489
|
-
* @returns {boolean}
|
|
29490
|
-
*/
|
|
29491
|
-
function isSpecCompliantForm(thing) {
|
|
29492
|
-
return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);
|
|
29493
|
-
}
|
|
29494
|
-
|
|
29495
29455
|
const toJSONObject = (obj) => {
|
|
29496
29456
|
const stack = new Array(10);
|
|
29497
29457
|
|
|
@@ -29523,42 +29483,7 @@ const toJSONObject = (obj) => {
|
|
|
29523
29483
|
return visit(obj, 0);
|
|
29524
29484
|
};
|
|
29525
29485
|
|
|
29526
|
-
|
|
29527
|
-
|
|
29528
|
-
const isThenable = (thing) =>
|
|
29529
|
-
thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
|
|
29530
|
-
|
|
29531
|
-
// original code
|
|
29532
|
-
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
29533
|
-
|
|
29534
|
-
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
29535
|
-
if (setImmediateSupported) {
|
|
29536
|
-
return setImmediate;
|
|
29537
|
-
}
|
|
29538
|
-
|
|
29539
|
-
return postMessageSupported ? ((token, callbacks) => {
|
|
29540
|
-
_global.addEventListener("message", ({source, data}) => {
|
|
29541
|
-
if (source === _global && data === token) {
|
|
29542
|
-
callbacks.length && callbacks.shift()();
|
|
29543
|
-
}
|
|
29544
|
-
}, false);
|
|
29545
|
-
|
|
29546
|
-
return (cb) => {
|
|
29547
|
-
callbacks.push(cb);
|
|
29548
|
-
_global.postMessage(token, "*");
|
|
29549
|
-
}
|
|
29550
|
-
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
29551
|
-
})(
|
|
29552
|
-
typeof setImmediate === 'function',
|
|
29553
|
-
isFunction$1(_global.postMessage)
|
|
29554
|
-
);
|
|
29555
|
-
|
|
29556
|
-
const asap = typeof queueMicrotask !== 'undefined' ?
|
|
29557
|
-
queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
|
|
29558
|
-
|
|
29559
|
-
// *********************
|
|
29560
|
-
|
|
29561
|
-
var utils$1 = {
|
|
29486
|
+
var utils = {
|
|
29562
29487
|
isArray,
|
|
29563
29488
|
isArrayBuffer,
|
|
29564
29489
|
isBuffer: isBuffer$1,
|
|
@@ -29569,10 +29494,6 @@ var utils$1 = {
|
|
|
29569
29494
|
isBoolean,
|
|
29570
29495
|
isObject,
|
|
29571
29496
|
isPlainObject,
|
|
29572
|
-
isReadableStream,
|
|
29573
|
-
isRequest,
|
|
29574
|
-
isResponse,
|
|
29575
|
-
isHeaders,
|
|
29576
29497
|
isUndefined,
|
|
29577
29498
|
isDate,
|
|
29578
29499
|
isFile,
|
|
@@ -29608,14 +29529,7 @@ var utils$1 = {
|
|
|
29608
29529
|
findKey,
|
|
29609
29530
|
global: _global,
|
|
29610
29531
|
isContextDefined,
|
|
29611
|
-
|
|
29612
|
-
generateString,
|
|
29613
|
-
isSpecCompliantForm,
|
|
29614
|
-
toJSONObject,
|
|
29615
|
-
isAsyncFn,
|
|
29616
|
-
isThenable,
|
|
29617
|
-
setImmediate: _setImmediate,
|
|
29618
|
-
asap
|
|
29532
|
+
toJSONObject
|
|
29619
29533
|
};
|
|
29620
29534
|
|
|
29621
29535
|
/**
|
|
@@ -29643,13 +29557,10 @@ function AxiosError(message, code, config, request, response) {
|
|
|
29643
29557
|
code && (this.code = code);
|
|
29644
29558
|
config && (this.config = config);
|
|
29645
29559
|
request && (this.request = request);
|
|
29646
|
-
|
|
29647
|
-
this.response = response;
|
|
29648
|
-
this.status = response.status ? response.status : null;
|
|
29649
|
-
}
|
|
29560
|
+
response && (this.response = response);
|
|
29650
29561
|
}
|
|
29651
29562
|
|
|
29652
|
-
utils
|
|
29563
|
+
utils.inherits(AxiosError, Error, {
|
|
29653
29564
|
toJSON: function toJSON() {
|
|
29654
29565
|
return {
|
|
29655
29566
|
// Standard
|
|
@@ -29664,9 +29575,9 @@ utils$1.inherits(AxiosError, Error, {
|
|
|
29664
29575
|
columnNumber: this.columnNumber,
|
|
29665
29576
|
stack: this.stack,
|
|
29666
29577
|
// Axios
|
|
29667
|
-
config: utils
|
|
29578
|
+
config: utils.toJSONObject(this.config),
|
|
29668
29579
|
code: this.code,
|
|
29669
|
-
status: this.status
|
|
29580
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
29670
29581
|
};
|
|
29671
29582
|
}
|
|
29672
29583
|
});
|
|
@@ -29699,7 +29610,7 @@ Object.defineProperty(prototype$1, 'isAxiosError', {value: true});
|
|
|
29699
29610
|
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
29700
29611
|
const axiosError = Object.create(prototype$1);
|
|
29701
29612
|
|
|
29702
|
-
utils
|
|
29613
|
+
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
29703
29614
|
return obj !== Error.prototype;
|
|
29704
29615
|
}, prop => {
|
|
29705
29616
|
return prop !== 'isAxiosError';
|
|
@@ -41647,7 +41558,7 @@ FormData$1.prototype.toString = function () {
|
|
|
41647
41558
|
* @returns {boolean}
|
|
41648
41559
|
*/
|
|
41649
41560
|
function isVisitable(thing) {
|
|
41650
|
-
return utils
|
|
41561
|
+
return utils.isPlainObject(thing) || utils.isArray(thing);
|
|
41651
41562
|
}
|
|
41652
41563
|
|
|
41653
41564
|
/**
|
|
@@ -41658,7 +41569,7 @@ function isVisitable(thing) {
|
|
|
41658
41569
|
* @returns {string} the key without the brackets.
|
|
41659
41570
|
*/
|
|
41660
41571
|
function removeBrackets(key) {
|
|
41661
|
-
return utils
|
|
41572
|
+
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
|
41662
41573
|
}
|
|
41663
41574
|
|
|
41664
41575
|
/**
|
|
@@ -41687,13 +41598,24 @@ function renderKey(path, key, dots) {
|
|
|
41687
41598
|
* @returns {boolean}
|
|
41688
41599
|
*/
|
|
41689
41600
|
function isFlatArray(arr) {
|
|
41690
|
-
return utils
|
|
41601
|
+
return utils.isArray(arr) && !arr.some(isVisitable);
|
|
41691
41602
|
}
|
|
41692
41603
|
|
|
41693
|
-
const predicates = utils
|
|
41604
|
+
const predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
|
41694
41605
|
return /^is[A-Z]/.test(prop);
|
|
41695
41606
|
});
|
|
41696
41607
|
|
|
41608
|
+
/**
|
|
41609
|
+
* If the thing is a FormData object, return true, otherwise return false.
|
|
41610
|
+
*
|
|
41611
|
+
* @param {unknown} thing - The thing to check.
|
|
41612
|
+
*
|
|
41613
|
+
* @returns {boolean}
|
|
41614
|
+
*/
|
|
41615
|
+
function isSpecCompliant(thing) {
|
|
41616
|
+
return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];
|
|
41617
|
+
}
|
|
41618
|
+
|
|
41697
41619
|
/**
|
|
41698
41620
|
* Convert a data object to FormData
|
|
41699
41621
|
*
|
|
@@ -41718,7 +41640,7 @@ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop)
|
|
|
41718
41640
|
* @returns
|
|
41719
41641
|
*/
|
|
41720
41642
|
function toFormData(obj, formData, options) {
|
|
41721
|
-
if (!utils
|
|
41643
|
+
if (!utils.isObject(obj)) {
|
|
41722
41644
|
throw new TypeError('target must be an object');
|
|
41723
41645
|
}
|
|
41724
41646
|
|
|
@@ -41726,13 +41648,13 @@ function toFormData(obj, formData, options) {
|
|
|
41726
41648
|
formData = formData || new (form_data || FormData)();
|
|
41727
41649
|
|
|
41728
41650
|
// eslint-disable-next-line no-param-reassign
|
|
41729
|
-
options = utils
|
|
41651
|
+
options = utils.toFlatObject(options, {
|
|
41730
41652
|
metaTokens: true,
|
|
41731
41653
|
dots: false,
|
|
41732
41654
|
indexes: false
|
|
41733
41655
|
}, false, function defined(option, source) {
|
|
41734
41656
|
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
41735
|
-
return !utils
|
|
41657
|
+
return !utils.isUndefined(source[option]);
|
|
41736
41658
|
});
|
|
41737
41659
|
|
|
41738
41660
|
const metaTokens = options.metaTokens;
|
|
@@ -41741,24 +41663,24 @@ function toFormData(obj, formData, options) {
|
|
|
41741
41663
|
const dots = options.dots;
|
|
41742
41664
|
const indexes = options.indexes;
|
|
41743
41665
|
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
41744
|
-
const useBlob = _Blob &&
|
|
41666
|
+
const useBlob = _Blob && isSpecCompliant(formData);
|
|
41745
41667
|
|
|
41746
|
-
if (!utils
|
|
41668
|
+
if (!utils.isFunction(visitor)) {
|
|
41747
41669
|
throw new TypeError('visitor must be a function');
|
|
41748
41670
|
}
|
|
41749
41671
|
|
|
41750
41672
|
function convertValue(value) {
|
|
41751
41673
|
if (value === null) return '';
|
|
41752
41674
|
|
|
41753
|
-
if (utils
|
|
41675
|
+
if (utils.isDate(value)) {
|
|
41754
41676
|
return value.toISOString();
|
|
41755
41677
|
}
|
|
41756
41678
|
|
|
41757
|
-
if (!useBlob && utils
|
|
41679
|
+
if (!useBlob && utils.isBlob(value)) {
|
|
41758
41680
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
|
41759
41681
|
}
|
|
41760
41682
|
|
|
41761
|
-
if (utils
|
|
41683
|
+
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
|
41762
41684
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
|
41763
41685
|
}
|
|
41764
41686
|
|
|
@@ -41779,20 +41701,20 @@ function toFormData(obj, formData, options) {
|
|
|
41779
41701
|
let arr = value;
|
|
41780
41702
|
|
|
41781
41703
|
if (value && !path && typeof value === 'object') {
|
|
41782
|
-
if (utils
|
|
41704
|
+
if (utils.endsWith(key, '{}')) {
|
|
41783
41705
|
// eslint-disable-next-line no-param-reassign
|
|
41784
41706
|
key = metaTokens ? key : key.slice(0, -2);
|
|
41785
41707
|
// eslint-disable-next-line no-param-reassign
|
|
41786
41708
|
value = JSON.stringify(value);
|
|
41787
41709
|
} else if (
|
|
41788
|
-
(utils
|
|
41789
|
-
(
|
|
41710
|
+
(utils.isArray(value) && isFlatArray(value)) ||
|
|
41711
|
+
(utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))
|
|
41790
41712
|
)) {
|
|
41791
41713
|
// eslint-disable-next-line no-param-reassign
|
|
41792
41714
|
key = removeBrackets(key);
|
|
41793
41715
|
|
|
41794
41716
|
arr.forEach(function each(el, index) {
|
|
41795
|
-
!(utils
|
|
41717
|
+
!(utils.isUndefined(el) || el === null) && formData.append(
|
|
41796
41718
|
// eslint-disable-next-line no-nested-ternary
|
|
41797
41719
|
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
|
|
41798
41720
|
convertValue(el)
|
|
@@ -41820,7 +41742,7 @@ function toFormData(obj, formData, options) {
|
|
|
41820
41742
|
});
|
|
41821
41743
|
|
|
41822
41744
|
function build(value, path) {
|
|
41823
|
-
if (utils
|
|
41745
|
+
if (utils.isUndefined(value)) return;
|
|
41824
41746
|
|
|
41825
41747
|
if (stack.indexOf(value) !== -1) {
|
|
41826
41748
|
throw Error('Circular reference detected in ' + path.join('.'));
|
|
@@ -41828,9 +41750,9 @@ function toFormData(obj, formData, options) {
|
|
|
41828
41750
|
|
|
41829
41751
|
stack.push(value);
|
|
41830
41752
|
|
|
41831
|
-
utils
|
|
41832
|
-
const result = !(utils
|
|
41833
|
-
formData, el, utils
|
|
41753
|
+
utils.forEach(value, function each(el, key) {
|
|
41754
|
+
const result = !(utils.isUndefined(el) || el === null) && visitor.call(
|
|
41755
|
+
formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers
|
|
41834
41756
|
);
|
|
41835
41757
|
|
|
41836
41758
|
if (result === true) {
|
|
@@ -41841,7 +41763,7 @@ function toFormData(obj, formData, options) {
|
|
|
41841
41763
|
stack.pop();
|
|
41842
41764
|
}
|
|
41843
41765
|
|
|
41844
|
-
if (!utils
|
|
41766
|
+
if (!utils.isObject(obj)) {
|
|
41845
41767
|
throw new TypeError('data must be an object');
|
|
41846
41768
|
}
|
|
41847
41769
|
|
|
@@ -41926,7 +41848,7 @@ function encode(val) {
|
|
|
41926
41848
|
*
|
|
41927
41849
|
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
41928
41850
|
* @param {object} [params] The params to be appended
|
|
41929
|
-
* @param {?
|
|
41851
|
+
* @param {?object} options
|
|
41930
41852
|
*
|
|
41931
41853
|
* @returns {string} The formatted url
|
|
41932
41854
|
*/
|
|
@@ -41938,12 +41860,6 @@ function buildURL(url, params, options) {
|
|
|
41938
41860
|
|
|
41939
41861
|
const _encode = options && options.encode || encode;
|
|
41940
41862
|
|
|
41941
|
-
if (utils$1.isFunction(options)) {
|
|
41942
|
-
options = {
|
|
41943
|
-
serialize: options
|
|
41944
|
-
};
|
|
41945
|
-
}
|
|
41946
|
-
|
|
41947
41863
|
const serializeFn = options && options.serialize;
|
|
41948
41864
|
|
|
41949
41865
|
let serializedParams;
|
|
@@ -41951,7 +41867,7 @@ function buildURL(url, params, options) {
|
|
|
41951
41867
|
if (serializeFn) {
|
|
41952
41868
|
serializedParams = serializeFn(params, options);
|
|
41953
41869
|
} else {
|
|
41954
|
-
serializedParams = utils
|
|
41870
|
+
serializedParams = utils.isURLSearchParams(params) ?
|
|
41955
41871
|
params.toString() :
|
|
41956
41872
|
new AxiosURLSearchParams(params, options).toString(_encode);
|
|
41957
41873
|
}
|
|
@@ -42026,7 +41942,7 @@ class InterceptorManager {
|
|
|
42026
41942
|
* @returns {void}
|
|
42027
41943
|
*/
|
|
42028
41944
|
forEach(fn) {
|
|
42029
|
-
utils
|
|
41945
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
42030
41946
|
if (h !== null) {
|
|
42031
41947
|
fn(h);
|
|
42032
41948
|
}
|
|
@@ -42042,7 +41958,7 @@ var transitionalDefaults = {
|
|
|
42042
41958
|
|
|
42043
41959
|
var URLSearchParams = url__default['default'].URLSearchParams;
|
|
42044
41960
|
|
|
42045
|
-
var platform
|
|
41961
|
+
var platform = {
|
|
42046
41962
|
isNode: true,
|
|
42047
41963
|
classes: {
|
|
42048
41964
|
URLSearchParams,
|
|
@@ -42052,68 +41968,10 @@ var platform$1 = {
|
|
|
42052
41968
|
protocols: [ 'http', 'https', 'file', 'data' ]
|
|
42053
41969
|
};
|
|
42054
41970
|
|
|
42055
|
-
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
42056
|
-
|
|
42057
|
-
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
42058
|
-
|
|
42059
|
-
/**
|
|
42060
|
-
* Determine if we're running in a standard browser environment
|
|
42061
|
-
*
|
|
42062
|
-
* This allows axios to run in a web worker, and react-native.
|
|
42063
|
-
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
42064
|
-
*
|
|
42065
|
-
* web workers:
|
|
42066
|
-
* typeof window -> undefined
|
|
42067
|
-
* typeof document -> undefined
|
|
42068
|
-
*
|
|
42069
|
-
* react-native:
|
|
42070
|
-
* navigator.product -> 'ReactNative'
|
|
42071
|
-
* nativescript
|
|
42072
|
-
* navigator.product -> 'NativeScript' or 'NS'
|
|
42073
|
-
*
|
|
42074
|
-
* @returns {boolean}
|
|
42075
|
-
*/
|
|
42076
|
-
const hasStandardBrowserEnv = hasBrowserEnv &&
|
|
42077
|
-
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
42078
|
-
|
|
42079
|
-
/**
|
|
42080
|
-
* Determine if we're running in a standard browser webWorker environment
|
|
42081
|
-
*
|
|
42082
|
-
* Although the `isStandardBrowserEnv` method indicates that
|
|
42083
|
-
* `allows axios to run in a web worker`, the WebWorker will still be
|
|
42084
|
-
* filtered out due to its judgment standard
|
|
42085
|
-
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
|
42086
|
-
* This leads to a problem when axios post `FormData` in webWorker
|
|
42087
|
-
*/
|
|
42088
|
-
const hasStandardBrowserWebWorkerEnv = (() => {
|
|
42089
|
-
return (
|
|
42090
|
-
typeof WorkerGlobalScope !== 'undefined' &&
|
|
42091
|
-
// eslint-disable-next-line no-undef
|
|
42092
|
-
self instanceof WorkerGlobalScope &&
|
|
42093
|
-
typeof self.importScripts === 'function'
|
|
42094
|
-
);
|
|
42095
|
-
})();
|
|
42096
|
-
|
|
42097
|
-
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
42098
|
-
|
|
42099
|
-
var utils = /*#__PURE__*/Object.freeze({
|
|
42100
|
-
__proto__: null,
|
|
42101
|
-
hasBrowserEnv: hasBrowserEnv,
|
|
42102
|
-
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
42103
|
-
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
42104
|
-
navigator: _navigator,
|
|
42105
|
-
origin: origin
|
|
42106
|
-
});
|
|
42107
|
-
|
|
42108
|
-
var platform = {
|
|
42109
|
-
...utils,
|
|
42110
|
-
...platform$1
|
|
42111
|
-
};
|
|
42112
|
-
|
|
42113
41971
|
function toURLEncodedForm(data, options) {
|
|
42114
41972
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
|
42115
41973
|
visitor: function(value, key, path, helpers) {
|
|
42116
|
-
if (
|
|
41974
|
+
if (utils.isBuffer(value)) {
|
|
42117
41975
|
this.append(key, value.toString('base64'));
|
|
42118
41976
|
return false;
|
|
42119
41977
|
}
|
|
@@ -42135,7 +41993,7 @@ function parsePropPath(name) {
|
|
|
42135
41993
|
// foo.x.y.z
|
|
42136
41994
|
// foo-x-y-z
|
|
42137
41995
|
// foo x y z
|
|
42138
|
-
return utils
|
|
41996
|
+
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
42139
41997
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
42140
41998
|
});
|
|
42141
41999
|
}
|
|
@@ -42170,15 +42028,12 @@ function arrayToObject(arr) {
|
|
|
42170
42028
|
function formDataToJSON(formData) {
|
|
42171
42029
|
function buildPath(path, value, target, index) {
|
|
42172
42030
|
let name = path[index++];
|
|
42173
|
-
|
|
42174
|
-
if (name === '__proto__') return true;
|
|
42175
|
-
|
|
42176
42031
|
const isNumericKey = Number.isFinite(+name);
|
|
42177
42032
|
const isLast = index >= path.length;
|
|
42178
|
-
name = !name && utils
|
|
42033
|
+
name = !name && utils.isArray(target) ? target.length : name;
|
|
42179
42034
|
|
|
42180
42035
|
if (isLast) {
|
|
42181
|
-
if (utils
|
|
42036
|
+
if (utils.hasOwnProp(target, name)) {
|
|
42182
42037
|
target[name] = [target[name], value];
|
|
42183
42038
|
} else {
|
|
42184
42039
|
target[name] = value;
|
|
@@ -42187,23 +42042,23 @@ function formDataToJSON(formData) {
|
|
|
42187
42042
|
return !isNumericKey;
|
|
42188
42043
|
}
|
|
42189
42044
|
|
|
42190
|
-
if (!target[name] || !utils
|
|
42045
|
+
if (!target[name] || !utils.isObject(target[name])) {
|
|
42191
42046
|
target[name] = [];
|
|
42192
42047
|
}
|
|
42193
42048
|
|
|
42194
42049
|
const result = buildPath(path, value, target[name], index);
|
|
42195
42050
|
|
|
42196
|
-
if (result && utils
|
|
42051
|
+
if (result && utils.isArray(target[name])) {
|
|
42197
42052
|
target[name] = arrayToObject(target[name]);
|
|
42198
42053
|
}
|
|
42199
42054
|
|
|
42200
42055
|
return !isNumericKey;
|
|
42201
42056
|
}
|
|
42202
42057
|
|
|
42203
|
-
if (utils
|
|
42058
|
+
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
|
42204
42059
|
const obj = {};
|
|
42205
42060
|
|
|
42206
|
-
utils
|
|
42061
|
+
utils.forEachEntry(formData, (name, value) => {
|
|
42207
42062
|
buildPath(parsePropPath(name), value, obj, 0);
|
|
42208
42063
|
});
|
|
42209
42064
|
|
|
@@ -42213,6 +42068,10 @@ function formDataToJSON(formData) {
|
|
|
42213
42068
|
return null;
|
|
42214
42069
|
}
|
|
42215
42070
|
|
|
42071
|
+
const DEFAULT_CONTENT_TYPE = {
|
|
42072
|
+
'Content-Type': undefined
|
|
42073
|
+
};
|
|
42074
|
+
|
|
42216
42075
|
/**
|
|
42217
42076
|
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
42218
42077
|
* of the input
|
|
@@ -42224,10 +42083,10 @@ function formDataToJSON(formData) {
|
|
|
42224
42083
|
* @returns {string} A stringified version of the rawValue.
|
|
42225
42084
|
*/
|
|
42226
42085
|
function stringifySafely(rawValue, parser, encoder) {
|
|
42227
|
-
if (utils
|
|
42086
|
+
if (utils.isString(rawValue)) {
|
|
42228
42087
|
try {
|
|
42229
42088
|
(parser || JSON.parse)(rawValue);
|
|
42230
|
-
return utils
|
|
42089
|
+
return utils.trim(rawValue);
|
|
42231
42090
|
} catch (e) {
|
|
42232
42091
|
if (e.name !== 'SyntaxError') {
|
|
42233
42092
|
throw e;
|
|
@@ -42242,36 +42101,38 @@ const defaults = {
|
|
|
42242
42101
|
|
|
42243
42102
|
transitional: transitionalDefaults,
|
|
42244
42103
|
|
|
42245
|
-
adapter: ['xhr', 'http'
|
|
42104
|
+
adapter: ['xhr', 'http'],
|
|
42246
42105
|
|
|
42247
42106
|
transformRequest: [function transformRequest(data, headers) {
|
|
42248
42107
|
const contentType = headers.getContentType() || '';
|
|
42249
42108
|
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
42250
|
-
const isObjectPayload = utils
|
|
42109
|
+
const isObjectPayload = utils.isObject(data);
|
|
42251
42110
|
|
|
42252
|
-
if (isObjectPayload && utils
|
|
42111
|
+
if (isObjectPayload && utils.isHTMLForm(data)) {
|
|
42253
42112
|
data = new FormData(data);
|
|
42254
42113
|
}
|
|
42255
42114
|
|
|
42256
|
-
const isFormData = utils
|
|
42115
|
+
const isFormData = utils.isFormData(data);
|
|
42257
42116
|
|
|
42258
42117
|
if (isFormData) {
|
|
42118
|
+
if (!hasJSONContentType) {
|
|
42119
|
+
return data;
|
|
42120
|
+
}
|
|
42259
42121
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
42260
42122
|
}
|
|
42261
42123
|
|
|
42262
|
-
if (utils
|
|
42263
|
-
utils
|
|
42264
|
-
utils
|
|
42265
|
-
utils
|
|
42266
|
-
utils
|
|
42267
|
-
utils$1.isReadableStream(data)
|
|
42124
|
+
if (utils.isArrayBuffer(data) ||
|
|
42125
|
+
utils.isBuffer(data) ||
|
|
42126
|
+
utils.isStream(data) ||
|
|
42127
|
+
utils.isFile(data) ||
|
|
42128
|
+
utils.isBlob(data)
|
|
42268
42129
|
) {
|
|
42269
42130
|
return data;
|
|
42270
42131
|
}
|
|
42271
|
-
if (utils
|
|
42132
|
+
if (utils.isArrayBufferView(data)) {
|
|
42272
42133
|
return data.buffer;
|
|
42273
42134
|
}
|
|
42274
|
-
if (utils
|
|
42135
|
+
if (utils.isURLSearchParams(data)) {
|
|
42275
42136
|
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
42276
42137
|
return data.toString();
|
|
42277
42138
|
}
|
|
@@ -42283,7 +42144,7 @@ const defaults = {
|
|
|
42283
42144
|
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
42284
42145
|
}
|
|
42285
42146
|
|
|
42286
|
-
if ((isFileList = utils
|
|
42147
|
+
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
|
42287
42148
|
const _FormData = this.env && this.env.FormData;
|
|
42288
42149
|
|
|
42289
42150
|
return toFormData(
|
|
@@ -42307,11 +42168,7 @@ const defaults = {
|
|
|
42307
42168
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
42308
42169
|
const JSONRequested = this.responseType === 'json';
|
|
42309
42170
|
|
|
42310
|
-
if (utils
|
|
42311
|
-
return data;
|
|
42312
|
-
}
|
|
42313
|
-
|
|
42314
|
-
if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
42171
|
+
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
42315
42172
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
42316
42173
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
42317
42174
|
|
|
@@ -42353,19 +42210,22 @@ const defaults = {
|
|
|
42353
42210
|
|
|
42354
42211
|
headers: {
|
|
42355
42212
|
common: {
|
|
42356
|
-
'Accept': 'application/json, text/plain, */*'
|
|
42357
|
-
'Content-Type': undefined
|
|
42213
|
+
'Accept': 'application/json, text/plain, */*'
|
|
42358
42214
|
}
|
|
42359
42215
|
}
|
|
42360
42216
|
};
|
|
42361
42217
|
|
|
42362
|
-
utils
|
|
42218
|
+
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
|
42363
42219
|
defaults.headers[method] = {};
|
|
42364
42220
|
});
|
|
42365
42221
|
|
|
42222
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
42223
|
+
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
42224
|
+
});
|
|
42225
|
+
|
|
42366
42226
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
42367
42227
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
42368
|
-
const ignoreDuplicateOf = utils
|
|
42228
|
+
const ignoreDuplicateOf = utils.toObjectSet([
|
|
42369
42229
|
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
42370
42230
|
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
42371
42231
|
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
@@ -42426,7 +42286,7 @@ function normalizeValue(value) {
|
|
|
42426
42286
|
return value;
|
|
42427
42287
|
}
|
|
42428
42288
|
|
|
42429
|
-
return utils
|
|
42289
|
+
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
42430
42290
|
}
|
|
42431
42291
|
|
|
42432
42292
|
function parseTokens(str) {
|
|
@@ -42441,24 +42301,22 @@ function parseTokens(str) {
|
|
|
42441
42301
|
return tokens;
|
|
42442
42302
|
}
|
|
42443
42303
|
|
|
42444
|
-
|
|
42304
|
+
function isValidHeaderName(str) {
|
|
42305
|
+
return /^[-_a-zA-Z]+$/.test(str.trim());
|
|
42306
|
+
}
|
|
42445
42307
|
|
|
42446
|
-
function matchHeaderValue(context, value, header, filter
|
|
42447
|
-
if (utils
|
|
42308
|
+
function matchHeaderValue(context, value, header, filter) {
|
|
42309
|
+
if (utils.isFunction(filter)) {
|
|
42448
42310
|
return filter.call(this, value, header);
|
|
42449
42311
|
}
|
|
42450
42312
|
|
|
42451
|
-
if (
|
|
42452
|
-
value = header;
|
|
42453
|
-
}
|
|
42454
|
-
|
|
42455
|
-
if (!utils$1.isString(value)) return;
|
|
42313
|
+
if (!utils.isString(value)) return;
|
|
42456
42314
|
|
|
42457
|
-
if (utils
|
|
42315
|
+
if (utils.isString(filter)) {
|
|
42458
42316
|
return value.indexOf(filter) !== -1;
|
|
42459
42317
|
}
|
|
42460
42318
|
|
|
42461
|
-
if (utils
|
|
42319
|
+
if (utils.isRegExp(filter)) {
|
|
42462
42320
|
return filter.test(value);
|
|
42463
42321
|
}
|
|
42464
42322
|
}
|
|
@@ -42471,7 +42329,7 @@ function formatHeader(header) {
|
|
|
42471
42329
|
}
|
|
42472
42330
|
|
|
42473
42331
|
function buildAccessors(obj, header) {
|
|
42474
|
-
const accessorName = utils
|
|
42332
|
+
const accessorName = utils.toCamelCase(' ' + header);
|
|
42475
42333
|
|
|
42476
42334
|
['get', 'set', 'has'].forEach(methodName => {
|
|
42477
42335
|
Object.defineProperty(obj, methodName + accessorName, {
|
|
@@ -42498,7 +42356,7 @@ class AxiosHeaders {
|
|
|
42498
42356
|
throw new Error('header name must be a non-empty string');
|
|
42499
42357
|
}
|
|
42500
42358
|
|
|
42501
|
-
const key = utils
|
|
42359
|
+
const key = utils.findKey(self, lHeader);
|
|
42502
42360
|
|
|
42503
42361
|
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
|
42504
42362
|
self[key || _header] = normalizeValue(_value);
|
|
@@ -42506,16 +42364,12 @@ class AxiosHeaders {
|
|
|
42506
42364
|
}
|
|
42507
42365
|
|
|
42508
42366
|
const setHeaders = (headers, _rewrite) =>
|
|
42509
|
-
utils
|
|
42367
|
+
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
42510
42368
|
|
|
42511
|
-
if (utils
|
|
42369
|
+
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
|
42512
42370
|
setHeaders(header, valueOrRewrite);
|
|
42513
|
-
} else if(utils
|
|
42371
|
+
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
42514
42372
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
42515
|
-
} else if (utils$1.isHeaders(header)) {
|
|
42516
|
-
for (const [key, value] of header.entries()) {
|
|
42517
|
-
setHeader(value, key, rewrite);
|
|
42518
|
-
}
|
|
42519
42373
|
} else {
|
|
42520
42374
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
42521
42375
|
}
|
|
@@ -42527,7 +42381,7 @@ class AxiosHeaders {
|
|
|
42527
42381
|
header = normalizeHeader(header);
|
|
42528
42382
|
|
|
42529
42383
|
if (header) {
|
|
42530
|
-
const key = utils
|
|
42384
|
+
const key = utils.findKey(this, header);
|
|
42531
42385
|
|
|
42532
42386
|
if (key) {
|
|
42533
42387
|
const value = this[key];
|
|
@@ -42540,11 +42394,11 @@ class AxiosHeaders {
|
|
|
42540
42394
|
return parseTokens(value);
|
|
42541
42395
|
}
|
|
42542
42396
|
|
|
42543
|
-
if (utils
|
|
42397
|
+
if (utils.isFunction(parser)) {
|
|
42544
42398
|
return parser.call(this, value, key);
|
|
42545
42399
|
}
|
|
42546
42400
|
|
|
42547
|
-
if (utils
|
|
42401
|
+
if (utils.isRegExp(parser)) {
|
|
42548
42402
|
return parser.exec(value);
|
|
42549
42403
|
}
|
|
42550
42404
|
|
|
@@ -42557,9 +42411,9 @@ class AxiosHeaders {
|
|
|
42557
42411
|
header = normalizeHeader(header);
|
|
42558
42412
|
|
|
42559
42413
|
if (header) {
|
|
42560
|
-
const key = utils
|
|
42414
|
+
const key = utils.findKey(this, header);
|
|
42561
42415
|
|
|
42562
|
-
return !!(key &&
|
|
42416
|
+
return !!(key && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
42563
42417
|
}
|
|
42564
42418
|
|
|
42565
42419
|
return false;
|
|
@@ -42573,7 +42427,7 @@ class AxiosHeaders {
|
|
|
42573
42427
|
_header = normalizeHeader(_header);
|
|
42574
42428
|
|
|
42575
42429
|
if (_header) {
|
|
42576
|
-
const key = utils
|
|
42430
|
+
const key = utils.findKey(self, _header);
|
|
42577
42431
|
|
|
42578
42432
|
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
42579
42433
|
delete self[key];
|
|
@@ -42583,7 +42437,7 @@ class AxiosHeaders {
|
|
|
42583
42437
|
}
|
|
42584
42438
|
}
|
|
42585
42439
|
|
|
42586
|
-
if (utils
|
|
42440
|
+
if (utils.isArray(header)) {
|
|
42587
42441
|
header.forEach(deleteHeader);
|
|
42588
42442
|
} else {
|
|
42589
42443
|
deleteHeader(header);
|
|
@@ -42592,28 +42446,16 @@ class AxiosHeaders {
|
|
|
42592
42446
|
return deleted;
|
|
42593
42447
|
}
|
|
42594
42448
|
|
|
42595
|
-
clear(
|
|
42596
|
-
|
|
42597
|
-
let i = keys.length;
|
|
42598
|
-
let deleted = false;
|
|
42599
|
-
|
|
42600
|
-
while (i--) {
|
|
42601
|
-
const key = keys[i];
|
|
42602
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
42603
|
-
delete this[key];
|
|
42604
|
-
deleted = true;
|
|
42605
|
-
}
|
|
42606
|
-
}
|
|
42607
|
-
|
|
42608
|
-
return deleted;
|
|
42449
|
+
clear() {
|
|
42450
|
+
return Object.keys(this).forEach(this.delete.bind(this));
|
|
42609
42451
|
}
|
|
42610
42452
|
|
|
42611
42453
|
normalize(format) {
|
|
42612
42454
|
const self = this;
|
|
42613
42455
|
const headers = {};
|
|
42614
42456
|
|
|
42615
|
-
utils
|
|
42616
|
-
const key = utils
|
|
42457
|
+
utils.forEach(this, (value, header) => {
|
|
42458
|
+
const key = utils.findKey(headers, header);
|
|
42617
42459
|
|
|
42618
42460
|
if (key) {
|
|
42619
42461
|
self[key] = normalizeValue(value);
|
|
@@ -42642,8 +42484,8 @@ class AxiosHeaders {
|
|
|
42642
42484
|
toJSON(asStrings) {
|
|
42643
42485
|
const obj = Object.create(null);
|
|
42644
42486
|
|
|
42645
|
-
utils
|
|
42646
|
-
value != null && value !== false && (obj[header] = asStrings && utils
|
|
42487
|
+
utils.forEach(this, (value, header) => {
|
|
42488
|
+
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
|
42647
42489
|
});
|
|
42648
42490
|
|
|
42649
42491
|
return obj;
|
|
@@ -42690,26 +42532,16 @@ class AxiosHeaders {
|
|
|
42690
42532
|
}
|
|
42691
42533
|
}
|
|
42692
42534
|
|
|
42693
|
-
utils
|
|
42535
|
+
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
42694
42536
|
|
|
42695
42537
|
return this;
|
|
42696
42538
|
}
|
|
42697
42539
|
}
|
|
42698
42540
|
|
|
42699
|
-
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent'
|
|
42541
|
+
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent']);
|
|
42700
42542
|
|
|
42701
|
-
|
|
42702
|
-
utils
|
|
42703
|
-
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
42704
|
-
return {
|
|
42705
|
-
get: () => value,
|
|
42706
|
-
set(headerValue) {
|
|
42707
|
-
this[mapped] = headerValue;
|
|
42708
|
-
}
|
|
42709
|
-
}
|
|
42710
|
-
});
|
|
42711
|
-
|
|
42712
|
-
utils$1.freezeMethods(AxiosHeaders);
|
|
42543
|
+
utils.freezeMethods(AxiosHeaders.prototype);
|
|
42544
|
+
utils.freezeMethods(AxiosHeaders);
|
|
42713
42545
|
|
|
42714
42546
|
/**
|
|
42715
42547
|
* Transform the data for a request or a response
|
|
@@ -42725,7 +42557,7 @@ function transformData(fns, response) {
|
|
|
42725
42557
|
const headers = AxiosHeaders.from(context.headers);
|
|
42726
42558
|
let data = context.data;
|
|
42727
42559
|
|
|
42728
|
-
utils
|
|
42560
|
+
utils.forEach(fns, function transform(fn) {
|
|
42729
42561
|
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
|
42730
42562
|
});
|
|
42731
42563
|
|
|
@@ -42753,7 +42585,7 @@ function CanceledError(message, config, request) {
|
|
|
42753
42585
|
this.name = 'CanceledError';
|
|
42754
42586
|
}
|
|
42755
42587
|
|
|
42756
|
-
utils
|
|
42588
|
+
utils.inherits(CanceledError, AxiosError, {
|
|
42757
42589
|
__CANCEL__: true
|
|
42758
42590
|
});
|
|
42759
42591
|
|
|
@@ -42805,7 +42637,7 @@ function isAbsoluteURL(url) {
|
|
|
42805
42637
|
*/
|
|
42806
42638
|
function combineURLs(baseURL, relativeURL) {
|
|
42807
42639
|
return relativeURL
|
|
42808
|
-
? baseURL.replace(
|
|
42640
|
+
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
42809
42641
|
: baseURL;
|
|
42810
42642
|
}
|
|
42811
42643
|
|
|
@@ -42933,10 +42765,6 @@ function getEnv(key) {
|
|
|
42933
42765
|
|
|
42934
42766
|
var getProxyForUrl_1 = getProxyForUrl;
|
|
42935
42767
|
|
|
42936
|
-
var proxyFromEnv = {
|
|
42937
|
-
getProxyForUrl: getProxyForUrl_1
|
|
42938
|
-
};
|
|
42939
|
-
|
|
42940
42768
|
/**
|
|
42941
42769
|
* Helpers.
|
|
42942
42770
|
*/
|
|
@@ -44773,7 +44601,7 @@ var followRedirects = wrap({ http: http__default['default'], https: https__defau
|
|
|
44773
44601
|
var wrap_1 = wrap;
|
|
44774
44602
|
followRedirects.wrap = wrap_1;
|
|
44775
44603
|
|
|
44776
|
-
const VERSION = "1.
|
|
44604
|
+
const VERSION = "1.2.1";
|
|
44777
44605
|
|
|
44778
44606
|
function parseProtocol(url) {
|
|
44779
44607
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
@@ -44828,11 +44656,93 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
44828
44656
|
throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
|
|
44829
44657
|
}
|
|
44830
44658
|
|
|
44659
|
+
/**
|
|
44660
|
+
* Throttle decorator
|
|
44661
|
+
* @param {Function} fn
|
|
44662
|
+
* @param {Number} freq
|
|
44663
|
+
* @return {Function}
|
|
44664
|
+
*/
|
|
44665
|
+
function throttle(fn, freq) {
|
|
44666
|
+
let timestamp = 0;
|
|
44667
|
+
const threshold = 1000 / freq;
|
|
44668
|
+
let timer = null;
|
|
44669
|
+
return function throttled(force, args) {
|
|
44670
|
+
const now = Date.now();
|
|
44671
|
+
if (force || now - timestamp > threshold) {
|
|
44672
|
+
if (timer) {
|
|
44673
|
+
clearTimeout(timer);
|
|
44674
|
+
timer = null;
|
|
44675
|
+
}
|
|
44676
|
+
timestamp = now;
|
|
44677
|
+
return fn.apply(null, args);
|
|
44678
|
+
}
|
|
44679
|
+
if (!timer) {
|
|
44680
|
+
timer = setTimeout(() => {
|
|
44681
|
+
timer = null;
|
|
44682
|
+
timestamp = Date.now();
|
|
44683
|
+
return fn.apply(null, args);
|
|
44684
|
+
}, threshold - (now - timestamp));
|
|
44685
|
+
}
|
|
44686
|
+
};
|
|
44687
|
+
}
|
|
44688
|
+
|
|
44689
|
+
/**
|
|
44690
|
+
* Calculate data maxRate
|
|
44691
|
+
* @param {Number} [samplesCount= 10]
|
|
44692
|
+
* @param {Number} [min= 1000]
|
|
44693
|
+
* @returns {Function}
|
|
44694
|
+
*/
|
|
44695
|
+
function speedometer(samplesCount, min) {
|
|
44696
|
+
samplesCount = samplesCount || 10;
|
|
44697
|
+
const bytes = new Array(samplesCount);
|
|
44698
|
+
const timestamps = new Array(samplesCount);
|
|
44699
|
+
let head = 0;
|
|
44700
|
+
let tail = 0;
|
|
44701
|
+
let firstSampleTS;
|
|
44702
|
+
|
|
44703
|
+
min = min !== undefined ? min : 1000;
|
|
44704
|
+
|
|
44705
|
+
return function push(chunkLength) {
|
|
44706
|
+
const now = Date.now();
|
|
44707
|
+
|
|
44708
|
+
const startedAt = timestamps[tail];
|
|
44709
|
+
|
|
44710
|
+
if (!firstSampleTS) {
|
|
44711
|
+
firstSampleTS = now;
|
|
44712
|
+
}
|
|
44713
|
+
|
|
44714
|
+
bytes[head] = chunkLength;
|
|
44715
|
+
timestamps[head] = now;
|
|
44716
|
+
|
|
44717
|
+
let i = tail;
|
|
44718
|
+
let bytesCount = 0;
|
|
44719
|
+
|
|
44720
|
+
while (i !== head) {
|
|
44721
|
+
bytesCount += bytes[i++];
|
|
44722
|
+
i = i % samplesCount;
|
|
44723
|
+
}
|
|
44724
|
+
|
|
44725
|
+
head = (head + 1) % samplesCount;
|
|
44726
|
+
|
|
44727
|
+
if (head === tail) {
|
|
44728
|
+
tail = (tail + 1) % samplesCount;
|
|
44729
|
+
}
|
|
44730
|
+
|
|
44731
|
+
if (now - firstSampleTS < min) {
|
|
44732
|
+
return;
|
|
44733
|
+
}
|
|
44734
|
+
|
|
44735
|
+
const passed = startedAt && now - startedAt;
|
|
44736
|
+
|
|
44737
|
+
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
44738
|
+
};
|
|
44739
|
+
}
|
|
44740
|
+
|
|
44831
44741
|
const kInternals = Symbol('internals');
|
|
44832
44742
|
|
|
44833
44743
|
class AxiosTransformStream extends stream__default['default'].Transform{
|
|
44834
44744
|
constructor(options) {
|
|
44835
|
-
options = utils
|
|
44745
|
+
options = utils.toFlatObject(options, {
|
|
44836
44746
|
maxRate: 0,
|
|
44837
44747
|
chunkSize: 64 * 1024,
|
|
44838
44748
|
minChunkSize: 100,
|
|
@@ -44840,15 +44750,19 @@ class AxiosTransformStream extends stream__default['default'].Transform{
|
|
|
44840
44750
|
ticksRate: 2,
|
|
44841
44751
|
samplesCount: 15
|
|
44842
44752
|
}, null, (prop, source) => {
|
|
44843
|
-
return !utils
|
|
44753
|
+
return !utils.isUndefined(source[prop]);
|
|
44844
44754
|
});
|
|
44845
44755
|
|
|
44846
44756
|
super({
|
|
44847
44757
|
readableHighWaterMark: options.chunkSize
|
|
44848
44758
|
});
|
|
44849
44759
|
|
|
44760
|
+
const self = this;
|
|
44761
|
+
|
|
44850
44762
|
const internals = this[kInternals] = {
|
|
44763
|
+
length: options.length,
|
|
44851
44764
|
timeWindow: options.timeWindow,
|
|
44765
|
+
ticksRate: options.ticksRate,
|
|
44852
44766
|
chunkSize: options.chunkSize,
|
|
44853
44767
|
maxRate: options.maxRate,
|
|
44854
44768
|
minChunkSize: options.minChunkSize,
|
|
@@ -44860,6 +44774,8 @@ class AxiosTransformStream extends stream__default['default'].Transform{
|
|
|
44860
44774
|
onReadCallback: null
|
|
44861
44775
|
};
|
|
44862
44776
|
|
|
44777
|
+
const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
|
|
44778
|
+
|
|
44863
44779
|
this.on('newListener', event => {
|
|
44864
44780
|
if (event === 'progress') {
|
|
44865
44781
|
if (!internals.isCaptured) {
|
|
@@ -44867,6 +44783,38 @@ class AxiosTransformStream extends stream__default['default'].Transform{
|
|
|
44867
44783
|
}
|
|
44868
44784
|
}
|
|
44869
44785
|
});
|
|
44786
|
+
|
|
44787
|
+
let bytesNotified = 0;
|
|
44788
|
+
|
|
44789
|
+
internals.updateProgress = throttle(function throttledHandler() {
|
|
44790
|
+
const totalBytes = internals.length;
|
|
44791
|
+
const bytesTransferred = internals.bytesSeen;
|
|
44792
|
+
const progressBytes = bytesTransferred - bytesNotified;
|
|
44793
|
+
if (!progressBytes || self.destroyed) return;
|
|
44794
|
+
|
|
44795
|
+
const rate = _speedometer(progressBytes);
|
|
44796
|
+
|
|
44797
|
+
bytesNotified = bytesTransferred;
|
|
44798
|
+
|
|
44799
|
+
process.nextTick(() => {
|
|
44800
|
+
self.emit('progress', {
|
|
44801
|
+
'loaded': bytesTransferred,
|
|
44802
|
+
'total': totalBytes,
|
|
44803
|
+
'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,
|
|
44804
|
+
'bytes': progressBytes,
|
|
44805
|
+
'rate': rate ? rate : undefined,
|
|
44806
|
+
'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?
|
|
44807
|
+
(totalBytes - bytesTransferred) / rate : undefined
|
|
44808
|
+
});
|
|
44809
|
+
});
|
|
44810
|
+
}, internals.ticksRate);
|
|
44811
|
+
|
|
44812
|
+
const onFinish = () => {
|
|
44813
|
+
internals.updateProgress(true);
|
|
44814
|
+
};
|
|
44815
|
+
|
|
44816
|
+
this.once('end', onFinish);
|
|
44817
|
+
this.once('error', onFinish);
|
|
44870
44818
|
}
|
|
44871
44819
|
|
|
44872
44820
|
_read(size) {
|
|
@@ -44880,6 +44828,7 @@ class AxiosTransformStream extends stream__default['default'].Transform{
|
|
|
44880
44828
|
}
|
|
44881
44829
|
|
|
44882
44830
|
_transform(chunk, encoding, callback) {
|
|
44831
|
+
const self = this;
|
|
44883
44832
|
const internals = this[kInternals];
|
|
44884
44833
|
const maxRate = internals.maxRate;
|
|
44885
44834
|
|
|
@@ -44891,14 +44840,16 @@ class AxiosTransformStream extends stream__default['default'].Transform{
|
|
|
44891
44840
|
const bytesThreshold = (maxRate / divider);
|
|
44892
44841
|
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
|
|
44893
44842
|
|
|
44894
|
-
|
|
44843
|
+
function pushChunk(_chunk, _callback) {
|
|
44895
44844
|
const bytes = Buffer.byteLength(_chunk);
|
|
44896
44845
|
internals.bytesSeen += bytes;
|
|
44897
44846
|
internals.bytes += bytes;
|
|
44898
44847
|
|
|
44899
|
-
|
|
44848
|
+
if (internals.isCaptured) {
|
|
44849
|
+
internals.updateProgress();
|
|
44850
|
+
}
|
|
44900
44851
|
|
|
44901
|
-
if (
|
|
44852
|
+
if (self.push(_chunk)) {
|
|
44902
44853
|
process.nextTick(_callback);
|
|
44903
44854
|
} else {
|
|
44904
44855
|
internals.onReadCallback = () => {
|
|
@@ -44906,7 +44857,7 @@ class AxiosTransformStream extends stream__default['default'].Transform{
|
|
|
44906
44857
|
process.nextTick(_callback);
|
|
44907
44858
|
};
|
|
44908
44859
|
}
|
|
44909
|
-
}
|
|
44860
|
+
}
|
|
44910
44861
|
|
|
44911
44862
|
const transformChunk = (_chunk, _callback) => {
|
|
44912
44863
|
const chunkSize = Buffer.byteLength(_chunk);
|
|
@@ -44963,310 +44914,19 @@ class AxiosTransformStream extends stream__default['default'].Transform{
|
|
|
44963
44914
|
}
|
|
44964
44915
|
});
|
|
44965
44916
|
}
|
|
44966
|
-
}
|
|
44967
|
-
|
|
44968
|
-
const {asyncIterator} = Symbol;
|
|
44969
|
-
|
|
44970
|
-
const readBlob = async function* (blob) {
|
|
44971
|
-
if (blob.stream) {
|
|
44972
|
-
yield* blob.stream();
|
|
44973
|
-
} else if (blob.arrayBuffer) {
|
|
44974
|
-
yield await blob.arrayBuffer();
|
|
44975
|
-
} else if (blob[asyncIterator]) {
|
|
44976
|
-
yield* blob[asyncIterator]();
|
|
44977
|
-
} else {
|
|
44978
|
-
yield blob;
|
|
44979
|
-
}
|
|
44980
|
-
};
|
|
44981
|
-
|
|
44982
|
-
const BOUNDARY_ALPHABET = utils$1.ALPHABET.ALPHA_DIGIT + '-_';
|
|
44983
|
-
|
|
44984
|
-
const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util__default['default'].TextEncoder();
|
|
44985
|
-
|
|
44986
|
-
const CRLF = '\r\n';
|
|
44987
|
-
const CRLF_BYTES = textEncoder.encode(CRLF);
|
|
44988
|
-
const CRLF_BYTES_COUNT = 2;
|
|
44989
|
-
|
|
44990
|
-
class FormDataPart {
|
|
44991
|
-
constructor(name, value) {
|
|
44992
|
-
const {escapeName} = this.constructor;
|
|
44993
|
-
const isStringValue = utils$1.isString(value);
|
|
44994
|
-
|
|
44995
|
-
let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
|
|
44996
|
-
!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ''
|
|
44997
|
-
}${CRLF}`;
|
|
44998
|
-
|
|
44999
|
-
if (isStringValue) {
|
|
45000
|
-
value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
|
|
45001
|
-
} else {
|
|
45002
|
-
headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`;
|
|
45003
|
-
}
|
|
45004
|
-
|
|
45005
|
-
this.headers = textEncoder.encode(headers + CRLF);
|
|
45006
|
-
|
|
45007
|
-
this.contentLength = isStringValue ? value.byteLength : value.size;
|
|
45008
|
-
|
|
45009
|
-
this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT;
|
|
45010
|
-
|
|
45011
|
-
this.name = name;
|
|
45012
|
-
this.value = value;
|
|
45013
|
-
}
|
|
45014
|
-
|
|
45015
|
-
async *encode(){
|
|
45016
|
-
yield this.headers;
|
|
45017
|
-
|
|
45018
|
-
const {value} = this;
|
|
45019
|
-
|
|
45020
|
-
if(utils$1.isTypedArray(value)) {
|
|
45021
|
-
yield value;
|
|
45022
|
-
} else {
|
|
45023
|
-
yield* readBlob(value);
|
|
45024
|
-
}
|
|
45025
|
-
|
|
45026
|
-
yield CRLF_BYTES;
|
|
45027
|
-
}
|
|
45028
|
-
|
|
45029
|
-
static escapeName(name) {
|
|
45030
|
-
return String(name).replace(/[\r\n"]/g, (match) => ({
|
|
45031
|
-
'\r' : '%0D',
|
|
45032
|
-
'\n' : '%0A',
|
|
45033
|
-
'"' : '%22',
|
|
45034
|
-
}[match]));
|
|
45035
|
-
}
|
|
45036
|
-
}
|
|
45037
|
-
|
|
45038
|
-
const formDataToStream = (form, headersHandler, options) => {
|
|
45039
|
-
const {
|
|
45040
|
-
tag = 'form-data-boundary',
|
|
45041
|
-
size = 25,
|
|
45042
|
-
boundary = tag + '-' + utils$1.generateString(size, BOUNDARY_ALPHABET)
|
|
45043
|
-
} = options || {};
|
|
45044
|
-
|
|
45045
|
-
if(!utils$1.isFormData(form)) {
|
|
45046
|
-
throw TypeError('FormData instance required');
|
|
45047
|
-
}
|
|
45048
|
-
|
|
45049
|
-
if (boundary.length < 1 || boundary.length > 70) {
|
|
45050
|
-
throw Error('boundary must be 10-70 characters long')
|
|
45051
|
-
}
|
|
45052
|
-
|
|
45053
|
-
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
|
|
45054
|
-
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF);
|
|
45055
|
-
let contentLength = footerBytes.byteLength;
|
|
45056
|
-
|
|
45057
|
-
const parts = Array.from(form.entries()).map(([name, value]) => {
|
|
45058
|
-
const part = new FormDataPart(name, value);
|
|
45059
|
-
contentLength += part.size;
|
|
45060
|
-
return part;
|
|
45061
|
-
});
|
|
45062
|
-
|
|
45063
|
-
contentLength += boundaryBytes.byteLength * parts.length;
|
|
45064
|
-
|
|
45065
|
-
contentLength = utils$1.toFiniteNumber(contentLength);
|
|
45066
|
-
|
|
45067
|
-
const computedHeaders = {
|
|
45068
|
-
'Content-Type': `multipart/form-data; boundary=${boundary}`
|
|
45069
|
-
};
|
|
45070
44917
|
|
|
45071
|
-
|
|
45072
|
-
|
|
45073
|
-
|
|
45074
|
-
|
|
45075
|
-
headersHandler && headersHandler(computedHeaders);
|
|
45076
|
-
|
|
45077
|
-
return stream.Readable.from((async function *() {
|
|
45078
|
-
for(const part of parts) {
|
|
45079
|
-
yield boundaryBytes;
|
|
45080
|
-
yield* part.encode();
|
|
45081
|
-
}
|
|
45082
|
-
|
|
45083
|
-
yield footerBytes;
|
|
45084
|
-
})());
|
|
45085
|
-
};
|
|
45086
|
-
|
|
45087
|
-
class ZlibHeaderTransformStream extends stream__default['default'].Transform {
|
|
45088
|
-
__transform(chunk, encoding, callback) {
|
|
45089
|
-
this.push(chunk);
|
|
45090
|
-
callback();
|
|
45091
|
-
}
|
|
45092
|
-
|
|
45093
|
-
_transform(chunk, encoding, callback) {
|
|
45094
|
-
if (chunk.length !== 0) {
|
|
45095
|
-
this._transform = this.__transform;
|
|
45096
|
-
|
|
45097
|
-
// Add Default Compression headers if no zlib headers are present
|
|
45098
|
-
if (chunk[0] !== 120) { // Hex: 78
|
|
45099
|
-
const header = Buffer.alloc(2);
|
|
45100
|
-
header[0] = 120; // Hex: 78
|
|
45101
|
-
header[1] = 156; // Hex: 9C
|
|
45102
|
-
this.push(header, encoding);
|
|
45103
|
-
}
|
|
45104
|
-
}
|
|
45105
|
-
|
|
45106
|
-
this.__transform(chunk, encoding, callback);
|
|
44918
|
+
setLength(length) {
|
|
44919
|
+
this[kInternals].length = +length;
|
|
44920
|
+
return this;
|
|
45107
44921
|
}
|
|
45108
44922
|
}
|
|
45109
44923
|
|
|
45110
|
-
const callbackify = (fn, reducer) => {
|
|
45111
|
-
return utils$1.isAsyncFn(fn) ? function (...args) {
|
|
45112
|
-
const cb = args.pop();
|
|
45113
|
-
fn.apply(this, args).then((value) => {
|
|
45114
|
-
try {
|
|
45115
|
-
reducer ? cb(null, ...reducer(value)) : cb(null, value);
|
|
45116
|
-
} catch (err) {
|
|
45117
|
-
cb(err);
|
|
45118
|
-
}
|
|
45119
|
-
}, cb);
|
|
45120
|
-
} : fn;
|
|
45121
|
-
};
|
|
45122
|
-
|
|
45123
|
-
/**
|
|
45124
|
-
* Calculate data maxRate
|
|
45125
|
-
* @param {Number} [samplesCount= 10]
|
|
45126
|
-
* @param {Number} [min= 1000]
|
|
45127
|
-
* @returns {Function}
|
|
45128
|
-
*/
|
|
45129
|
-
function speedometer(samplesCount, min) {
|
|
45130
|
-
samplesCount = samplesCount || 10;
|
|
45131
|
-
const bytes = new Array(samplesCount);
|
|
45132
|
-
const timestamps = new Array(samplesCount);
|
|
45133
|
-
let head = 0;
|
|
45134
|
-
let tail = 0;
|
|
45135
|
-
let firstSampleTS;
|
|
45136
|
-
|
|
45137
|
-
min = min !== undefined ? min : 1000;
|
|
45138
|
-
|
|
45139
|
-
return function push(chunkLength) {
|
|
45140
|
-
const now = Date.now();
|
|
45141
|
-
|
|
45142
|
-
const startedAt = timestamps[tail];
|
|
45143
|
-
|
|
45144
|
-
if (!firstSampleTS) {
|
|
45145
|
-
firstSampleTS = now;
|
|
45146
|
-
}
|
|
45147
|
-
|
|
45148
|
-
bytes[head] = chunkLength;
|
|
45149
|
-
timestamps[head] = now;
|
|
45150
|
-
|
|
45151
|
-
let i = tail;
|
|
45152
|
-
let bytesCount = 0;
|
|
45153
|
-
|
|
45154
|
-
while (i !== head) {
|
|
45155
|
-
bytesCount += bytes[i++];
|
|
45156
|
-
i = i % samplesCount;
|
|
45157
|
-
}
|
|
45158
|
-
|
|
45159
|
-
head = (head + 1) % samplesCount;
|
|
45160
|
-
|
|
45161
|
-
if (head === tail) {
|
|
45162
|
-
tail = (tail + 1) % samplesCount;
|
|
45163
|
-
}
|
|
45164
|
-
|
|
45165
|
-
if (now - firstSampleTS < min) {
|
|
45166
|
-
return;
|
|
45167
|
-
}
|
|
45168
|
-
|
|
45169
|
-
const passed = startedAt && now - startedAt;
|
|
45170
|
-
|
|
45171
|
-
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
45172
|
-
};
|
|
45173
|
-
}
|
|
45174
|
-
|
|
45175
|
-
/**
|
|
45176
|
-
* Throttle decorator
|
|
45177
|
-
* @param {Function} fn
|
|
45178
|
-
* @param {Number} freq
|
|
45179
|
-
* @return {Function}
|
|
45180
|
-
*/
|
|
45181
|
-
function throttle(fn, freq) {
|
|
45182
|
-
let timestamp = 0;
|
|
45183
|
-
let threshold = 1000 / freq;
|
|
45184
|
-
let lastArgs;
|
|
45185
|
-
let timer;
|
|
45186
|
-
|
|
45187
|
-
const invoke = (args, now = Date.now()) => {
|
|
45188
|
-
timestamp = now;
|
|
45189
|
-
lastArgs = null;
|
|
45190
|
-
if (timer) {
|
|
45191
|
-
clearTimeout(timer);
|
|
45192
|
-
timer = null;
|
|
45193
|
-
}
|
|
45194
|
-
fn.apply(null, args);
|
|
45195
|
-
};
|
|
45196
|
-
|
|
45197
|
-
const throttled = (...args) => {
|
|
45198
|
-
const now = Date.now();
|
|
45199
|
-
const passed = now - timestamp;
|
|
45200
|
-
if ( passed >= threshold) {
|
|
45201
|
-
invoke(args, now);
|
|
45202
|
-
} else {
|
|
45203
|
-
lastArgs = args;
|
|
45204
|
-
if (!timer) {
|
|
45205
|
-
timer = setTimeout(() => {
|
|
45206
|
-
timer = null;
|
|
45207
|
-
invoke(lastArgs);
|
|
45208
|
-
}, threshold - passed);
|
|
45209
|
-
}
|
|
45210
|
-
}
|
|
45211
|
-
};
|
|
45212
|
-
|
|
45213
|
-
const flush = () => lastArgs && invoke(lastArgs);
|
|
45214
|
-
|
|
45215
|
-
return [throttled, flush];
|
|
45216
|
-
}
|
|
45217
|
-
|
|
45218
|
-
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
45219
|
-
let bytesNotified = 0;
|
|
45220
|
-
const _speedometer = speedometer(50, 250);
|
|
45221
|
-
|
|
45222
|
-
return throttle(e => {
|
|
45223
|
-
const loaded = e.loaded;
|
|
45224
|
-
const total = e.lengthComputable ? e.total : undefined;
|
|
45225
|
-
const progressBytes = loaded - bytesNotified;
|
|
45226
|
-
const rate = _speedometer(progressBytes);
|
|
45227
|
-
const inRange = loaded <= total;
|
|
45228
|
-
|
|
45229
|
-
bytesNotified = loaded;
|
|
45230
|
-
|
|
45231
|
-
const data = {
|
|
45232
|
-
loaded,
|
|
45233
|
-
total,
|
|
45234
|
-
progress: total ? (loaded / total) : undefined,
|
|
45235
|
-
bytes: progressBytes,
|
|
45236
|
-
rate: rate ? rate : undefined,
|
|
45237
|
-
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
45238
|
-
event: e,
|
|
45239
|
-
lengthComputable: total != null,
|
|
45240
|
-
[isDownloadStream ? 'download' : 'upload']: true
|
|
45241
|
-
};
|
|
45242
|
-
|
|
45243
|
-
listener(data);
|
|
45244
|
-
}, freq);
|
|
45245
|
-
};
|
|
45246
|
-
|
|
45247
|
-
const progressEventDecorator = (total, throttled) => {
|
|
45248
|
-
const lengthComputable = total != null;
|
|
45249
|
-
|
|
45250
|
-
return [(loaded) => throttled[0]({
|
|
45251
|
-
lengthComputable,
|
|
45252
|
-
total,
|
|
45253
|
-
loaded
|
|
45254
|
-
}), throttled[1]];
|
|
45255
|
-
};
|
|
45256
|
-
|
|
45257
|
-
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
|
45258
|
-
|
|
45259
44924
|
const zlibOptions = {
|
|
45260
44925
|
flush: zlib__default['default'].constants.Z_SYNC_FLUSH,
|
|
45261
44926
|
finishFlush: zlib__default['default'].constants.Z_SYNC_FLUSH
|
|
45262
44927
|
};
|
|
45263
44928
|
|
|
45264
|
-
const
|
|
45265
|
-
flush: zlib__default['default'].constants.BROTLI_OPERATION_FLUSH,
|
|
45266
|
-
finishFlush: zlib__default['default'].constants.BROTLI_OPERATION_FLUSH
|
|
45267
|
-
};
|
|
45268
|
-
|
|
45269
|
-
const isBrotliSupported = utils$1.isFunction(zlib__default['default'].createBrotliDecompress);
|
|
44929
|
+
const isBrotliSupported = utils.isFunction(zlib__default['default'].createBrotliDecompress);
|
|
45270
44930
|
|
|
45271
44931
|
const {http: httpFollow, https: httpsFollow} = followRedirects;
|
|
45272
44932
|
|
|
@@ -45276,14 +44936,6 @@ const supportedProtocols = platform.protocols.map(protocol => {
|
|
|
45276
44936
|
return protocol + ':';
|
|
45277
44937
|
});
|
|
45278
44938
|
|
|
45279
|
-
const flushOnFinish = (stream, [throttled, flush]) => {
|
|
45280
|
-
stream
|
|
45281
|
-
.on('end', flush)
|
|
45282
|
-
.on('error', flush);
|
|
45283
|
-
|
|
45284
|
-
return throttled;
|
|
45285
|
-
};
|
|
45286
|
-
|
|
45287
44939
|
/**
|
|
45288
44940
|
* If the proxy or config beforeRedirects functions are defined, call them with the options
|
|
45289
44941
|
* object.
|
|
@@ -45292,12 +44944,12 @@ const flushOnFinish = (stream, [throttled, flush]) => {
|
|
|
45292
44944
|
*
|
|
45293
44945
|
* @returns {Object<string, any>}
|
|
45294
44946
|
*/
|
|
45295
|
-
function dispatchBeforeRedirect(options
|
|
44947
|
+
function dispatchBeforeRedirect(options) {
|
|
45296
44948
|
if (options.beforeRedirects.proxy) {
|
|
45297
44949
|
options.beforeRedirects.proxy(options);
|
|
45298
44950
|
}
|
|
45299
44951
|
if (options.beforeRedirects.config) {
|
|
45300
|
-
options.beforeRedirects.config(options
|
|
44952
|
+
options.beforeRedirects.config(options);
|
|
45301
44953
|
}
|
|
45302
44954
|
}
|
|
45303
44955
|
|
|
@@ -45313,7 +44965,7 @@ function dispatchBeforeRedirect(options, responseDetails) {
|
|
|
45313
44965
|
function setProxy(options, configProxy, location) {
|
|
45314
44966
|
let proxy = configProxy;
|
|
45315
44967
|
if (!proxy && proxy !== false) {
|
|
45316
|
-
const proxyUrl =
|
|
44968
|
+
const proxyUrl = getProxyForUrl_1(location);
|
|
45317
44969
|
if (proxyUrl) {
|
|
45318
44970
|
proxy = new URL(proxyUrl);
|
|
45319
44971
|
}
|
|
@@ -45354,77 +45006,27 @@ function setProxy(options, configProxy, location) {
|
|
|
45354
45006
|
};
|
|
45355
45007
|
}
|
|
45356
45008
|
|
|
45357
|
-
const isHttpAdapterSupported = typeof process !== 'undefined' && utils
|
|
45358
|
-
|
|
45359
|
-
// temporary hotfix
|
|
45360
|
-
|
|
45361
|
-
const wrapAsync = (asyncExecutor) => {
|
|
45362
|
-
return new Promise((resolve, reject) => {
|
|
45363
|
-
let onDone;
|
|
45364
|
-
let isDone;
|
|
45365
|
-
|
|
45366
|
-
const done = (value, isRejected) => {
|
|
45367
|
-
if (isDone) return;
|
|
45368
|
-
isDone = true;
|
|
45369
|
-
onDone && onDone(value, isRejected);
|
|
45370
|
-
};
|
|
45371
|
-
|
|
45372
|
-
const _resolve = (value) => {
|
|
45373
|
-
done(value);
|
|
45374
|
-
resolve(value);
|
|
45375
|
-
};
|
|
45376
|
-
|
|
45377
|
-
const _reject = (reason) => {
|
|
45378
|
-
done(reason, true);
|
|
45379
|
-
reject(reason);
|
|
45380
|
-
};
|
|
45381
|
-
|
|
45382
|
-
asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
|
|
45383
|
-
})
|
|
45384
|
-
};
|
|
45385
|
-
|
|
45386
|
-
const resolveFamily = ({address, family}) => {
|
|
45387
|
-
if (!utils$1.isString(address)) {
|
|
45388
|
-
throw TypeError('address must be a string');
|
|
45389
|
-
}
|
|
45390
|
-
return ({
|
|
45391
|
-
address,
|
|
45392
|
-
family: family || (address.indexOf('.') < 0 ? 6 : 4)
|
|
45393
|
-
});
|
|
45394
|
-
};
|
|
45395
|
-
|
|
45396
|
-
const buildAddressEntry = (address, family) => resolveFamily(utils$1.isObject(address) ? address : {address, family});
|
|
45009
|
+
const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process';
|
|
45397
45010
|
|
|
45398
45011
|
/*eslint consistent-return:0*/
|
|
45399
45012
|
var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
45400
|
-
return
|
|
45401
|
-
let
|
|
45402
|
-
const
|
|
45013
|
+
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
|
45014
|
+
let data = config.data;
|
|
45015
|
+
const responseType = config.responseType;
|
|
45016
|
+
const responseEncoding = config.responseEncoding;
|
|
45403
45017
|
const method = config.method.toUpperCase();
|
|
45018
|
+
let isFinished;
|
|
45404
45019
|
let isDone;
|
|
45405
45020
|
let rejected = false;
|
|
45406
45021
|
let req;
|
|
45407
45022
|
|
|
45408
|
-
if (lookup) {
|
|
45409
|
-
const _lookup = callbackify(lookup, (value) => utils$1.isArray(value) ? value : [value]);
|
|
45410
|
-
// hotfix to support opt.all option which is required for node 20.x
|
|
45411
|
-
lookup = (hostname, opt, cb) => {
|
|
45412
|
-
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
45413
|
-
if (err) {
|
|
45414
|
-
return cb(err);
|
|
45415
|
-
}
|
|
45416
|
-
|
|
45417
|
-
const addresses = utils$1.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
45418
|
-
|
|
45419
|
-
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
45420
|
-
});
|
|
45421
|
-
};
|
|
45422
|
-
}
|
|
45423
|
-
|
|
45424
45023
|
// temporary internal emitter until the AxiosRequest class will be implemented
|
|
45425
|
-
const emitter = new
|
|
45024
|
+
const emitter = new EventEmitter__default['default']();
|
|
45025
|
+
|
|
45026
|
+
function onFinished() {
|
|
45027
|
+
if (isFinished) return;
|
|
45028
|
+
isFinished = true;
|
|
45426
45029
|
|
|
45427
|
-
const onFinished = () => {
|
|
45428
45030
|
if (config.cancelToken) {
|
|
45429
45031
|
config.cancelToken.unsubscribe(abort);
|
|
45430
45032
|
}
|
|
@@ -45434,15 +45036,28 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45434
45036
|
}
|
|
45435
45037
|
|
|
45436
45038
|
emitter.removeAllListeners();
|
|
45437
|
-
}
|
|
45039
|
+
}
|
|
45040
|
+
|
|
45041
|
+
function done(value, isRejected) {
|
|
45042
|
+
if (isDone) return;
|
|
45438
45043
|
|
|
45439
|
-
onDone((value, isRejected) => {
|
|
45440
45044
|
isDone = true;
|
|
45045
|
+
|
|
45441
45046
|
if (isRejected) {
|
|
45442
45047
|
rejected = true;
|
|
45443
45048
|
onFinished();
|
|
45444
45049
|
}
|
|
45445
|
-
|
|
45050
|
+
|
|
45051
|
+
isRejected ? rejectPromise(value) : resolvePromise(value);
|
|
45052
|
+
}
|
|
45053
|
+
|
|
45054
|
+
const resolve = function resolve(value) {
|
|
45055
|
+
done(value);
|
|
45056
|
+
};
|
|
45057
|
+
|
|
45058
|
+
const reject = function reject(value) {
|
|
45059
|
+
done(value, true);
|
|
45060
|
+
};
|
|
45446
45061
|
|
|
45447
45062
|
function abort(reason) {
|
|
45448
45063
|
emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
|
|
@@ -45459,7 +45074,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45459
45074
|
|
|
45460
45075
|
// Parse url
|
|
45461
45076
|
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
45462
|
-
const parsed = new URL(fullPath
|
|
45077
|
+
const parsed = new URL(fullPath);
|
|
45463
45078
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
45464
45079
|
|
|
45465
45080
|
if (protocol === 'data:') {
|
|
@@ -45486,7 +45101,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45486
45101
|
convertedData = convertedData.toString(responseEncoding);
|
|
45487
45102
|
|
|
45488
45103
|
if (!responseEncoding || responseEncoding === 'utf8') {
|
|
45489
|
-
|
|
45104
|
+
data = utils.stripBOM(convertedData);
|
|
45490
45105
|
}
|
|
45491
45106
|
} else if (responseType === 'stream') {
|
|
45492
45107
|
convertedData = stream__default['default'].Readable.from(convertedData);
|
|
@@ -45517,41 +45132,19 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45517
45132
|
// Only set header if it hasn't been set in config
|
|
45518
45133
|
headers.set('User-Agent', 'axios/' + VERSION, false);
|
|
45519
45134
|
|
|
45520
|
-
const
|
|
45135
|
+
const onDownloadProgress = config.onDownloadProgress;
|
|
45136
|
+
const onUploadProgress = config.onUploadProgress;
|
|
45521
45137
|
const maxRate = config.maxRate;
|
|
45522
45138
|
let maxUploadRate = undefined;
|
|
45523
45139
|
let maxDownloadRate = undefined;
|
|
45524
45140
|
|
|
45525
|
-
// support for
|
|
45526
|
-
if (utils
|
|
45527
|
-
const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
|
|
45528
|
-
|
|
45529
|
-
data = formDataToStream(data, (formHeaders) => {
|
|
45530
|
-
headers.set(formHeaders);
|
|
45531
|
-
}, {
|
|
45532
|
-
tag: `axios-${VERSION}-boundary`,
|
|
45533
|
-
boundary: userBoundary && userBoundary[1] || undefined
|
|
45534
|
-
});
|
|
45535
|
-
// support for https://www.npmjs.com/package/form-data api
|
|
45536
|
-
} else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
|
|
45141
|
+
// support for https://www.npmjs.com/package/form-data api
|
|
45142
|
+
if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
|
|
45537
45143
|
headers.set(data.getHeaders());
|
|
45538
|
-
|
|
45539
|
-
if (
|
|
45540
|
-
try {
|
|
45541
|
-
const knownLength = await util__default['default'].promisify(data.getLength).call(data);
|
|
45542
|
-
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
45543
|
-
/*eslint no-empty:0*/
|
|
45544
|
-
} catch (e) {
|
|
45545
|
-
}
|
|
45546
|
-
}
|
|
45547
|
-
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
45548
|
-
data.size && headers.setContentType(data.type || 'application/octet-stream');
|
|
45549
|
-
headers.setContentLength(data.size || 0);
|
|
45550
|
-
data = stream__default['default'].Readable.from(readBlob(data));
|
|
45551
|
-
} else if (data && !utils$1.isStream(data)) {
|
|
45552
|
-
if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
|
|
45144
|
+
} else if (data && !utils.isStream(data)) {
|
|
45145
|
+
if (Buffer.isBuffer(data)) ; else if (utils.isArrayBuffer(data)) {
|
|
45553
45146
|
data = Buffer.from(new Uint8Array(data));
|
|
45554
|
-
} else if (utils
|
|
45147
|
+
} else if (utils.isString(data)) {
|
|
45555
45148
|
data = Buffer.from(data, 'utf-8');
|
|
45556
45149
|
} else {
|
|
45557
45150
|
return reject(new AxiosError(
|
|
@@ -45562,7 +45155,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45562
45155
|
}
|
|
45563
45156
|
|
|
45564
45157
|
// Add Content-Length header if data exists
|
|
45565
|
-
headers.
|
|
45158
|
+
headers.set('Content-Length', data.length, false);
|
|
45566
45159
|
|
|
45567
45160
|
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
45568
45161
|
return reject(new AxiosError(
|
|
@@ -45573,9 +45166,9 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45573
45166
|
}
|
|
45574
45167
|
}
|
|
45575
45168
|
|
|
45576
|
-
const contentLength = utils
|
|
45169
|
+
const contentLength = utils.toFiniteNumber(headers.getContentLength());
|
|
45577
45170
|
|
|
45578
|
-
if (utils
|
|
45171
|
+
if (utils.isArray(maxRate)) {
|
|
45579
45172
|
maxUploadRate = maxRate[0];
|
|
45580
45173
|
maxDownloadRate = maxRate[1];
|
|
45581
45174
|
} else {
|
|
@@ -45583,21 +45176,20 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45583
45176
|
}
|
|
45584
45177
|
|
|
45585
45178
|
if (data && (onUploadProgress || maxUploadRate)) {
|
|
45586
|
-
if (!utils
|
|
45179
|
+
if (!utils.isStream(data)) {
|
|
45587
45180
|
data = stream__default['default'].Readable.from(data, {objectMode: false});
|
|
45588
45181
|
}
|
|
45589
45182
|
|
|
45590
45183
|
data = stream__default['default'].pipeline([data, new AxiosTransformStream({
|
|
45591
|
-
|
|
45592
|
-
|
|
45593
|
-
|
|
45594
|
-
|
|
45595
|
-
|
|
45596
|
-
|
|
45597
|
-
|
|
45598
|
-
|
|
45599
|
-
|
|
45600
|
-
));
|
|
45184
|
+
length: contentLength,
|
|
45185
|
+
maxRate: utils.toFiniteNumber(maxUploadRate)
|
|
45186
|
+
})], utils.noop);
|
|
45187
|
+
|
|
45188
|
+
onUploadProgress && data.on('progress', progress => {
|
|
45189
|
+
onUploadProgress(Object.assign(progress, {
|
|
45190
|
+
upload: true
|
|
45191
|
+
}));
|
|
45192
|
+
});
|
|
45601
45193
|
}
|
|
45602
45194
|
|
|
45603
45195
|
// HTTP basic authentication
|
|
@@ -45644,18 +45236,14 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45644
45236
|
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
45645
45237
|
auth,
|
|
45646
45238
|
protocol,
|
|
45647
|
-
family,
|
|
45648
45239
|
beforeRedirect: dispatchBeforeRedirect,
|
|
45649
45240
|
beforeRedirects: {}
|
|
45650
45241
|
};
|
|
45651
45242
|
|
|
45652
|
-
// cacheable-lookup integration hotfix
|
|
45653
|
-
!utils$1.isUndefined(lookup) && (options.lookup = lookup);
|
|
45654
|
-
|
|
45655
45243
|
if (config.socketPath) {
|
|
45656
45244
|
options.socketPath = config.socketPath;
|
|
45657
45245
|
} else {
|
|
45658
|
-
options.hostname = parsed.hostname
|
|
45246
|
+
options.hostname = parsed.hostname;
|
|
45659
45247
|
options.port = parsed.port;
|
|
45660
45248
|
setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
|
|
45661
45249
|
}
|
|
@@ -45696,18 +45284,17 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45696
45284
|
|
|
45697
45285
|
const responseLength = +res.headers['content-length'];
|
|
45698
45286
|
|
|
45699
|
-
if (onDownloadProgress
|
|
45287
|
+
if (onDownloadProgress) {
|
|
45700
45288
|
const transformStream = new AxiosTransformStream({
|
|
45701
|
-
|
|
45289
|
+
length: utils.toFiniteNumber(responseLength),
|
|
45290
|
+
maxRate: utils.toFiniteNumber(maxDownloadRate)
|
|
45702
45291
|
});
|
|
45703
45292
|
|
|
45704
|
-
onDownloadProgress && transformStream.on('progress',
|
|
45705
|
-
|
|
45706
|
-
|
|
45707
|
-
|
|
45708
|
-
|
|
45709
|
-
)
|
|
45710
|
-
));
|
|
45293
|
+
onDownloadProgress && transformStream.on('progress', progress => {
|
|
45294
|
+
onDownloadProgress(Object.assign(progress, {
|
|
45295
|
+
download: true
|
|
45296
|
+
}));
|
|
45297
|
+
});
|
|
45711
45298
|
|
|
45712
45299
|
streams.push(transformStream);
|
|
45713
45300
|
}
|
|
@@ -45726,21 +45313,11 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45726
45313
|
delete res.headers['content-encoding'];
|
|
45727
45314
|
}
|
|
45728
45315
|
|
|
45729
|
-
switch (
|
|
45316
|
+
switch (res.headers['content-encoding']) {
|
|
45730
45317
|
/*eslint default-case:0*/
|
|
45731
45318
|
case 'gzip':
|
|
45732
|
-
case 'x-gzip':
|
|
45733
45319
|
case 'compress':
|
|
45734
|
-
case 'x-compress':
|
|
45735
|
-
// add the unzipper to the body stream processing pipeline
|
|
45736
|
-
streams.push(zlib__default['default'].createUnzip(zlibOptions));
|
|
45737
|
-
|
|
45738
|
-
// remove the content-encoding in order to not confuse downstream operations
|
|
45739
|
-
delete res.headers['content-encoding'];
|
|
45740
|
-
break;
|
|
45741
45320
|
case 'deflate':
|
|
45742
|
-
streams.push(new ZlibHeaderTransformStream());
|
|
45743
|
-
|
|
45744
45321
|
// add the unzipper to the body stream processing pipeline
|
|
45745
45322
|
streams.push(zlib__default['default'].createUnzip(zlibOptions));
|
|
45746
45323
|
|
|
@@ -45749,13 +45326,13 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45749
45326
|
break;
|
|
45750
45327
|
case 'br':
|
|
45751
45328
|
if (isBrotliSupported) {
|
|
45752
|
-
streams.push(zlib__default['default'].createBrotliDecompress(
|
|
45329
|
+
streams.push(zlib__default['default'].createBrotliDecompress(zlibOptions));
|
|
45753
45330
|
delete res.headers['content-encoding'];
|
|
45754
45331
|
}
|
|
45755
45332
|
}
|
|
45756
45333
|
}
|
|
45757
45334
|
|
|
45758
|
-
responseStream = streams.length > 1 ? stream__default['default'].pipeline(streams, utils
|
|
45335
|
+
responseStream = streams.length > 1 ? stream__default['default'].pipeline(streams, utils.noop) : streams[0];
|
|
45759
45336
|
|
|
45760
45337
|
const offListeners = stream__default['default'].finished(responseStream, () => {
|
|
45761
45338
|
offListeners();
|
|
@@ -45797,7 +45374,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45797
45374
|
}
|
|
45798
45375
|
|
|
45799
45376
|
const err = new AxiosError(
|
|
45800
|
-
'
|
|
45377
|
+
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
45801
45378
|
AxiosError.ERR_BAD_RESPONSE,
|
|
45802
45379
|
config,
|
|
45803
45380
|
lastRequest
|
|
@@ -45817,12 +45394,12 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45817
45394
|
if (responseType !== 'arraybuffer') {
|
|
45818
45395
|
responseData = responseData.toString(responseEncoding);
|
|
45819
45396
|
if (!responseEncoding || responseEncoding === 'utf8') {
|
|
45820
|
-
responseData = utils
|
|
45397
|
+
responseData = utils.stripBOM(responseData);
|
|
45821
45398
|
}
|
|
45822
45399
|
}
|
|
45823
45400
|
response.data = responseData;
|
|
45824
45401
|
} catch (err) {
|
|
45825
|
-
|
|
45402
|
+
reject(AxiosError.from(err, null, config, response.request, response));
|
|
45826
45403
|
}
|
|
45827
45404
|
settle(resolve, reject, response);
|
|
45828
45405
|
});
|
|
@@ -45859,7 +45436,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45859
45436
|
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
|
|
45860
45437
|
const timeout = parseInt(config.timeout, 10);
|
|
45861
45438
|
|
|
45862
|
-
if (
|
|
45439
|
+
if (isNaN(timeout)) {
|
|
45863
45440
|
reject(new AxiosError(
|
|
45864
45441
|
'error trying to parse `config.timeout` to int',
|
|
45865
45442
|
AxiosError.ERR_BAD_OPTION_VALUE,
|
|
@@ -45894,7 +45471,7 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45894
45471
|
|
|
45895
45472
|
|
|
45896
45473
|
// Send the request
|
|
45897
|
-
if (utils
|
|
45474
|
+
if (utils.isStream(data)) {
|
|
45898
45475
|
let ended = false;
|
|
45899
45476
|
let errored = false;
|
|
45900
45477
|
|
|
@@ -45920,235 +45497,72 @@ var httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
45920
45497
|
});
|
|
45921
45498
|
};
|
|
45922
45499
|
|
|
45923
|
-
|
|
45924
|
-
|
|
45925
|
-
|
|
45926
|
-
return (
|
|
45927
|
-
origin.protocol === url.protocol &&
|
|
45928
|
-
origin.host === url.host &&
|
|
45929
|
-
(isMSIE || origin.port === url.port)
|
|
45930
|
-
);
|
|
45931
|
-
})(
|
|
45932
|
-
new URL(platform.origin),
|
|
45933
|
-
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
45934
|
-
) : () => true;
|
|
45935
|
-
|
|
45936
|
-
var cookies = platform.hasStandardBrowserEnv ?
|
|
45937
|
-
|
|
45938
|
-
// Standard browser envs support document.cookie
|
|
45939
|
-
{
|
|
45940
|
-
write(name, value, expires, path, domain, secure) {
|
|
45941
|
-
const cookie = [name + '=' + encodeURIComponent(value)];
|
|
45942
|
-
|
|
45943
|
-
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
|
45944
|
-
|
|
45945
|
-
utils$1.isString(path) && cookie.push('path=' + path);
|
|
45946
|
-
|
|
45947
|
-
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
|
45948
|
-
|
|
45949
|
-
secure === true && cookie.push('secure');
|
|
45950
|
-
|
|
45951
|
-
document.cookie = cookie.join('; ');
|
|
45952
|
-
},
|
|
45953
|
-
|
|
45954
|
-
read(name) {
|
|
45955
|
-
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
45956
|
-
return (match ? decodeURIComponent(match[3]) : null);
|
|
45957
|
-
},
|
|
45958
|
-
|
|
45959
|
-
remove(name) {
|
|
45960
|
-
this.write(name, '', Date.now() - 86400000);
|
|
45961
|
-
}
|
|
45962
|
-
}
|
|
45963
|
-
|
|
45964
|
-
:
|
|
45965
|
-
|
|
45966
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
45967
|
-
{
|
|
45968
|
-
write() {},
|
|
45969
|
-
read() {
|
|
45970
|
-
return null;
|
|
45971
|
-
},
|
|
45972
|
-
remove() {}
|
|
45973
|
-
};
|
|
45974
|
-
|
|
45975
|
-
const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
|
|
45976
|
-
|
|
45977
|
-
/**
|
|
45978
|
-
* Config-specific merge-function which creates a new config-object
|
|
45979
|
-
* by merging two configuration objects together.
|
|
45980
|
-
*
|
|
45981
|
-
* @param {Object} config1
|
|
45982
|
-
* @param {Object} config2
|
|
45983
|
-
*
|
|
45984
|
-
* @returns {Object} New object resulting from merging config2 to config1
|
|
45985
|
-
*/
|
|
45986
|
-
function mergeConfig(config1, config2) {
|
|
45987
|
-
// eslint-disable-next-line no-param-reassign
|
|
45988
|
-
config2 = config2 || {};
|
|
45989
|
-
const config = {};
|
|
45990
|
-
|
|
45991
|
-
function getMergedValue(target, source, prop, caseless) {
|
|
45992
|
-
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
45993
|
-
return utils$1.merge.call({caseless}, target, source);
|
|
45994
|
-
} else if (utils$1.isPlainObject(source)) {
|
|
45995
|
-
return utils$1.merge({}, source);
|
|
45996
|
-
} else if (utils$1.isArray(source)) {
|
|
45997
|
-
return source.slice();
|
|
45998
|
-
}
|
|
45999
|
-
return source;
|
|
46000
|
-
}
|
|
45500
|
+
function progressEventReducer(listener, isDownloadStream) {
|
|
45501
|
+
let bytesNotified = 0;
|
|
45502
|
+
const _speedometer = speedometer(50, 250);
|
|
46001
45503
|
|
|
46002
|
-
|
|
46003
|
-
|
|
46004
|
-
|
|
46005
|
-
|
|
46006
|
-
|
|
46007
|
-
|
|
46008
|
-
}
|
|
46009
|
-
}
|
|
45504
|
+
return e => {
|
|
45505
|
+
const loaded = e.loaded;
|
|
45506
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
45507
|
+
const progressBytes = loaded - bytesNotified;
|
|
45508
|
+
const rate = _speedometer(progressBytes);
|
|
45509
|
+
const inRange = loaded <= total;
|
|
46010
45510
|
|
|
46011
|
-
|
|
46012
|
-
function valueFromConfig2(a, b) {
|
|
46013
|
-
if (!utils$1.isUndefined(b)) {
|
|
46014
|
-
return getMergedValue(undefined, b);
|
|
46015
|
-
}
|
|
46016
|
-
}
|
|
45511
|
+
bytesNotified = loaded;
|
|
46017
45512
|
|
|
46018
|
-
|
|
46019
|
-
|
|
46020
|
-
|
|
46021
|
-
|
|
46022
|
-
|
|
46023
|
-
|
|
46024
|
-
|
|
46025
|
-
|
|
45513
|
+
const data = {
|
|
45514
|
+
loaded,
|
|
45515
|
+
total,
|
|
45516
|
+
progress: total ? (loaded / total) : undefined,
|
|
45517
|
+
bytes: progressBytes,
|
|
45518
|
+
rate: rate ? rate : undefined,
|
|
45519
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
45520
|
+
event: e
|
|
45521
|
+
};
|
|
46026
45522
|
|
|
46027
|
-
|
|
46028
|
-
function mergeDirectKeys(a, b, prop) {
|
|
46029
|
-
if (prop in config2) {
|
|
46030
|
-
return getMergedValue(a, b);
|
|
46031
|
-
} else if (prop in config1) {
|
|
46032
|
-
return getMergedValue(undefined, a);
|
|
46033
|
-
}
|
|
46034
|
-
}
|
|
45523
|
+
data[isDownloadStream ? 'download' : 'upload'] = true;
|
|
46035
45524
|
|
|
46036
|
-
|
|
46037
|
-
url: valueFromConfig2,
|
|
46038
|
-
method: valueFromConfig2,
|
|
46039
|
-
data: valueFromConfig2,
|
|
46040
|
-
baseURL: defaultToConfig2,
|
|
46041
|
-
transformRequest: defaultToConfig2,
|
|
46042
|
-
transformResponse: defaultToConfig2,
|
|
46043
|
-
paramsSerializer: defaultToConfig2,
|
|
46044
|
-
timeout: defaultToConfig2,
|
|
46045
|
-
timeoutMessage: defaultToConfig2,
|
|
46046
|
-
withCredentials: defaultToConfig2,
|
|
46047
|
-
withXSRFToken: defaultToConfig2,
|
|
46048
|
-
adapter: defaultToConfig2,
|
|
46049
|
-
responseType: defaultToConfig2,
|
|
46050
|
-
xsrfCookieName: defaultToConfig2,
|
|
46051
|
-
xsrfHeaderName: defaultToConfig2,
|
|
46052
|
-
onUploadProgress: defaultToConfig2,
|
|
46053
|
-
onDownloadProgress: defaultToConfig2,
|
|
46054
|
-
decompress: defaultToConfig2,
|
|
46055
|
-
maxContentLength: defaultToConfig2,
|
|
46056
|
-
maxBodyLength: defaultToConfig2,
|
|
46057
|
-
beforeRedirect: defaultToConfig2,
|
|
46058
|
-
transport: defaultToConfig2,
|
|
46059
|
-
httpAgent: defaultToConfig2,
|
|
46060
|
-
httpsAgent: defaultToConfig2,
|
|
46061
|
-
cancelToken: defaultToConfig2,
|
|
46062
|
-
socketPath: defaultToConfig2,
|
|
46063
|
-
responseEncoding: defaultToConfig2,
|
|
46064
|
-
validateStatus: mergeDirectKeys,
|
|
46065
|
-
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
|
|
45525
|
+
listener(data);
|
|
46066
45526
|
};
|
|
46067
|
-
|
|
46068
|
-
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
46069
|
-
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
46070
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
|
46071
|
-
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
46072
|
-
});
|
|
46073
|
-
|
|
46074
|
-
return config;
|
|
46075
45527
|
}
|
|
46076
45528
|
|
|
46077
|
-
var resolveConfig = (config) => {
|
|
46078
|
-
const newConfig = mergeConfig({}, config);
|
|
46079
|
-
|
|
46080
|
-
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
46081
|
-
|
|
46082
|
-
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
46083
|
-
|
|
46084
|
-
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
46085
|
-
|
|
46086
|
-
// HTTP basic authentication
|
|
46087
|
-
if (auth) {
|
|
46088
|
-
headers.set('Authorization', 'Basic ' +
|
|
46089
|
-
btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
|
|
46090
|
-
);
|
|
46091
|
-
}
|
|
46092
|
-
|
|
46093
|
-
let contentType;
|
|
46094
|
-
|
|
46095
|
-
if (utils$1.isFormData(data)) {
|
|
46096
|
-
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
46097
|
-
headers.setContentType(undefined); // Let the browser set it
|
|
46098
|
-
} else if ((contentType = headers.getContentType()) !== false) {
|
|
46099
|
-
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
46100
|
-
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
46101
|
-
headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
46102
|
-
}
|
|
46103
|
-
}
|
|
46104
|
-
|
|
46105
|
-
// Add xsrf header
|
|
46106
|
-
// This is only done if running in a standard browser environment.
|
|
46107
|
-
// Specifically not if we're in a web worker, or react-native.
|
|
46108
|
-
|
|
46109
|
-
if (platform.hasStandardBrowserEnv) {
|
|
46110
|
-
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
46111
|
-
|
|
46112
|
-
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
|
|
46113
|
-
// Add xsrf header
|
|
46114
|
-
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
46115
|
-
|
|
46116
|
-
if (xsrfValue) {
|
|
46117
|
-
headers.set(xsrfHeaderName, xsrfValue);
|
|
46118
|
-
}
|
|
46119
|
-
}
|
|
46120
|
-
}
|
|
46121
|
-
|
|
46122
|
-
return newConfig;
|
|
46123
|
-
};
|
|
46124
|
-
|
|
46125
45529
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
46126
45530
|
|
|
46127
45531
|
var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
46128
45532
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
46129
|
-
|
|
46130
|
-
|
|
46131
|
-
const
|
|
46132
|
-
let {responseType, onUploadProgress, onDownloadProgress} = _config;
|
|
45533
|
+
let requestData = config.data;
|
|
45534
|
+
const requestHeaders = AxiosHeaders.from(config.headers).normalize();
|
|
45535
|
+
const responseType = config.responseType;
|
|
46133
45536
|
let onCanceled;
|
|
46134
|
-
let uploadThrottled, downloadThrottled;
|
|
46135
|
-
let flushUpload, flushDownload;
|
|
46136
|
-
|
|
46137
45537
|
function done() {
|
|
46138
|
-
|
|
46139
|
-
|
|
45538
|
+
if (config.cancelToken) {
|
|
45539
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
45540
|
+
}
|
|
46140
45541
|
|
|
46141
|
-
|
|
45542
|
+
if (config.signal) {
|
|
45543
|
+
config.signal.removeEventListener('abort', onCanceled);
|
|
45544
|
+
}
|
|
45545
|
+
}
|
|
46142
45546
|
|
|
46143
|
-
|
|
45547
|
+
if (utils.isFormData(requestData) && (platform.isStandardBrowserWebWorkerEnv)) {
|
|
45548
|
+
requestHeaders.setContentType(false); // Let the browser set it
|
|
46144
45549
|
}
|
|
46145
45550
|
|
|
46146
45551
|
let request = new XMLHttpRequest();
|
|
46147
45552
|
|
|
46148
|
-
|
|
45553
|
+
// HTTP basic authentication
|
|
45554
|
+
if (config.auth) {
|
|
45555
|
+
const username = config.auth.username || '';
|
|
45556
|
+
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
|
45557
|
+
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
|
|
45558
|
+
}
|
|
45559
|
+
|
|
45560
|
+
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
45561
|
+
|
|
45562
|
+
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
46149
45563
|
|
|
46150
45564
|
// Set the request timeout in MS
|
|
46151
|
-
request.timeout =
|
|
45565
|
+
request.timeout = config.timeout;
|
|
46152
45566
|
|
|
46153
45567
|
function onloadend() {
|
|
46154
45568
|
if (!request) {
|
|
@@ -46228,10 +45642,10 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
46228
45642
|
|
|
46229
45643
|
// Handle timeout
|
|
46230
45644
|
request.ontimeout = function handleTimeout() {
|
|
46231
|
-
let timeoutErrorMessage =
|
|
46232
|
-
const transitional =
|
|
46233
|
-
if (
|
|
46234
|
-
timeoutErrorMessage =
|
|
45645
|
+
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
45646
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
45647
|
+
if (config.timeoutErrorMessage) {
|
|
45648
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
46235
45649
|
}
|
|
46236
45650
|
reject(new AxiosError(
|
|
46237
45651
|
timeoutErrorMessage,
|
|
@@ -46248,37 +45662,32 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
46248
45662
|
|
|
46249
45663
|
// Add headers to the request
|
|
46250
45664
|
if ('setRequestHeader' in request) {
|
|
46251
|
-
utils
|
|
45665
|
+
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
46252
45666
|
request.setRequestHeader(key, val);
|
|
46253
45667
|
});
|
|
46254
45668
|
}
|
|
46255
45669
|
|
|
46256
45670
|
// Add withCredentials to request if needed
|
|
46257
|
-
if (!utils
|
|
46258
|
-
request.withCredentials = !!
|
|
45671
|
+
if (!utils.isUndefined(config.withCredentials)) {
|
|
45672
|
+
request.withCredentials = !!config.withCredentials;
|
|
46259
45673
|
}
|
|
46260
45674
|
|
|
46261
45675
|
// Add responseType to request if needed
|
|
46262
45676
|
if (responseType && responseType !== 'json') {
|
|
46263
|
-
request.responseType =
|
|
45677
|
+
request.responseType = config.responseType;
|
|
46264
45678
|
}
|
|
46265
45679
|
|
|
46266
45680
|
// Handle progress if needed
|
|
46267
|
-
if (onDownloadProgress) {
|
|
46268
|
-
(
|
|
46269
|
-
request.addEventListener('progress', downloadThrottled);
|
|
45681
|
+
if (typeof config.onDownloadProgress === 'function') {
|
|
45682
|
+
request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
|
|
46270
45683
|
}
|
|
46271
45684
|
|
|
46272
45685
|
// Not all browsers support upload events
|
|
46273
|
-
if (onUploadProgress && request.upload) {
|
|
46274
|
-
(
|
|
46275
|
-
|
|
46276
|
-
request.upload.addEventListener('progress', uploadThrottled);
|
|
46277
|
-
|
|
46278
|
-
request.upload.addEventListener('loadend', flushUpload);
|
|
45686
|
+
if (typeof config.onUploadProgress === 'function' && request.upload) {
|
|
45687
|
+
request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
|
|
46279
45688
|
}
|
|
46280
45689
|
|
|
46281
|
-
if (
|
|
45690
|
+
if (config.cancelToken || config.signal) {
|
|
46282
45691
|
// Handle cancellation
|
|
46283
45692
|
// eslint-disable-next-line func-names
|
|
46284
45693
|
onCanceled = cancel => {
|
|
@@ -46290,13 +45699,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
46290
45699
|
request = null;
|
|
46291
45700
|
};
|
|
46292
45701
|
|
|
46293
|
-
|
|
46294
|
-
if (
|
|
46295
|
-
|
|
45702
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
45703
|
+
if (config.signal) {
|
|
45704
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
|
|
46296
45705
|
}
|
|
46297
45706
|
}
|
|
46298
45707
|
|
|
46299
|
-
const protocol = parseProtocol(
|
|
45708
|
+
const protocol = parseProtocol(fullPath);
|
|
46300
45709
|
|
|
46301
45710
|
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
46302
45711
|
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
@@ -46309,362 +45718,13 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
46309
45718
|
});
|
|
46310
45719
|
};
|
|
46311
45720
|
|
|
46312
|
-
const composeSignals = (signals, timeout) => {
|
|
46313
|
-
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
|
46314
|
-
|
|
46315
|
-
if (timeout || length) {
|
|
46316
|
-
let controller = new AbortController();
|
|
46317
|
-
|
|
46318
|
-
let aborted;
|
|
46319
|
-
|
|
46320
|
-
const onabort = function (reason) {
|
|
46321
|
-
if (!aborted) {
|
|
46322
|
-
aborted = true;
|
|
46323
|
-
unsubscribe();
|
|
46324
|
-
const err = reason instanceof Error ? reason : this.reason;
|
|
46325
|
-
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
46326
|
-
}
|
|
46327
|
-
};
|
|
46328
|
-
|
|
46329
|
-
let timer = timeout && setTimeout(() => {
|
|
46330
|
-
timer = null;
|
|
46331
|
-
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
|
46332
|
-
}, timeout);
|
|
46333
|
-
|
|
46334
|
-
const unsubscribe = () => {
|
|
46335
|
-
if (signals) {
|
|
46336
|
-
timer && clearTimeout(timer);
|
|
46337
|
-
timer = null;
|
|
46338
|
-
signals.forEach(signal => {
|
|
46339
|
-
signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
|
|
46340
|
-
});
|
|
46341
|
-
signals = null;
|
|
46342
|
-
}
|
|
46343
|
-
};
|
|
46344
|
-
|
|
46345
|
-
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
46346
|
-
|
|
46347
|
-
const {signal} = controller;
|
|
46348
|
-
|
|
46349
|
-
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
46350
|
-
|
|
46351
|
-
return signal;
|
|
46352
|
-
}
|
|
46353
|
-
};
|
|
46354
|
-
|
|
46355
|
-
const streamChunk = function* (chunk, chunkSize) {
|
|
46356
|
-
let len = chunk.byteLength;
|
|
46357
|
-
|
|
46358
|
-
if (!chunkSize || len < chunkSize) {
|
|
46359
|
-
yield chunk;
|
|
46360
|
-
return;
|
|
46361
|
-
}
|
|
46362
|
-
|
|
46363
|
-
let pos = 0;
|
|
46364
|
-
let end;
|
|
46365
|
-
|
|
46366
|
-
while (pos < len) {
|
|
46367
|
-
end = pos + chunkSize;
|
|
46368
|
-
yield chunk.slice(pos, end);
|
|
46369
|
-
pos = end;
|
|
46370
|
-
}
|
|
46371
|
-
};
|
|
46372
|
-
|
|
46373
|
-
const readBytes = async function* (iterable, chunkSize) {
|
|
46374
|
-
for await (const chunk of readStream(iterable)) {
|
|
46375
|
-
yield* streamChunk(chunk, chunkSize);
|
|
46376
|
-
}
|
|
46377
|
-
};
|
|
46378
|
-
|
|
46379
|
-
const readStream = async function* (stream) {
|
|
46380
|
-
if (stream[Symbol.asyncIterator]) {
|
|
46381
|
-
yield* stream;
|
|
46382
|
-
return;
|
|
46383
|
-
}
|
|
46384
|
-
|
|
46385
|
-
const reader = stream.getReader();
|
|
46386
|
-
try {
|
|
46387
|
-
for (;;) {
|
|
46388
|
-
const {done, value} = await reader.read();
|
|
46389
|
-
if (done) {
|
|
46390
|
-
break;
|
|
46391
|
-
}
|
|
46392
|
-
yield value;
|
|
46393
|
-
}
|
|
46394
|
-
} finally {
|
|
46395
|
-
await reader.cancel();
|
|
46396
|
-
}
|
|
46397
|
-
};
|
|
46398
|
-
|
|
46399
|
-
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
46400
|
-
const iterator = readBytes(stream, chunkSize);
|
|
46401
|
-
|
|
46402
|
-
let bytes = 0;
|
|
46403
|
-
let done;
|
|
46404
|
-
let _onFinish = (e) => {
|
|
46405
|
-
if (!done) {
|
|
46406
|
-
done = true;
|
|
46407
|
-
onFinish && onFinish(e);
|
|
46408
|
-
}
|
|
46409
|
-
};
|
|
46410
|
-
|
|
46411
|
-
return new ReadableStream({
|
|
46412
|
-
async pull(controller) {
|
|
46413
|
-
try {
|
|
46414
|
-
const {done, value} = await iterator.next();
|
|
46415
|
-
|
|
46416
|
-
if (done) {
|
|
46417
|
-
_onFinish();
|
|
46418
|
-
controller.close();
|
|
46419
|
-
return;
|
|
46420
|
-
}
|
|
46421
|
-
|
|
46422
|
-
let len = value.byteLength;
|
|
46423
|
-
if (onProgress) {
|
|
46424
|
-
let loadedBytes = bytes += len;
|
|
46425
|
-
onProgress(loadedBytes);
|
|
46426
|
-
}
|
|
46427
|
-
controller.enqueue(new Uint8Array(value));
|
|
46428
|
-
} catch (err) {
|
|
46429
|
-
_onFinish(err);
|
|
46430
|
-
throw err;
|
|
46431
|
-
}
|
|
46432
|
-
},
|
|
46433
|
-
cancel(reason) {
|
|
46434
|
-
_onFinish(reason);
|
|
46435
|
-
return iterator.return();
|
|
46436
|
-
}
|
|
46437
|
-
}, {
|
|
46438
|
-
highWaterMark: 2
|
|
46439
|
-
})
|
|
46440
|
-
};
|
|
46441
|
-
|
|
46442
|
-
const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
|
46443
|
-
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
|
46444
|
-
|
|
46445
|
-
// used only inside the fetch adapter
|
|
46446
|
-
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
46447
|
-
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
46448
|
-
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
46449
|
-
);
|
|
46450
|
-
|
|
46451
|
-
const test = (fn, ...args) => {
|
|
46452
|
-
try {
|
|
46453
|
-
return !!fn(...args);
|
|
46454
|
-
} catch (e) {
|
|
46455
|
-
return false
|
|
46456
|
-
}
|
|
46457
|
-
};
|
|
46458
|
-
|
|
46459
|
-
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
46460
|
-
let duplexAccessed = false;
|
|
46461
|
-
|
|
46462
|
-
const hasContentType = new Request(platform.origin, {
|
|
46463
|
-
body: new ReadableStream(),
|
|
46464
|
-
method: 'POST',
|
|
46465
|
-
get duplex() {
|
|
46466
|
-
duplexAccessed = true;
|
|
46467
|
-
return 'half';
|
|
46468
|
-
},
|
|
46469
|
-
}).headers.has('Content-Type');
|
|
46470
|
-
|
|
46471
|
-
return duplexAccessed && !hasContentType;
|
|
46472
|
-
});
|
|
46473
|
-
|
|
46474
|
-
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
46475
|
-
|
|
46476
|
-
const supportsResponseStream = isReadableStreamSupported &&
|
|
46477
|
-
test(() => utils$1.isReadableStream(new Response('').body));
|
|
46478
|
-
|
|
46479
|
-
|
|
46480
|
-
const resolvers = {
|
|
46481
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
46482
|
-
};
|
|
46483
|
-
|
|
46484
|
-
isFetchSupported && (((res) => {
|
|
46485
|
-
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
46486
|
-
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
|
46487
|
-
(_, config) => {
|
|
46488
|
-
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
46489
|
-
});
|
|
46490
|
-
});
|
|
46491
|
-
})(new Response));
|
|
46492
|
-
|
|
46493
|
-
const getBodyLength = async (body) => {
|
|
46494
|
-
if (body == null) {
|
|
46495
|
-
return 0;
|
|
46496
|
-
}
|
|
46497
|
-
|
|
46498
|
-
if(utils$1.isBlob(body)) {
|
|
46499
|
-
return body.size;
|
|
46500
|
-
}
|
|
46501
|
-
|
|
46502
|
-
if(utils$1.isSpecCompliantForm(body)) {
|
|
46503
|
-
const _request = new Request(platform.origin, {
|
|
46504
|
-
method: 'POST',
|
|
46505
|
-
body,
|
|
46506
|
-
});
|
|
46507
|
-
return (await _request.arrayBuffer()).byteLength;
|
|
46508
|
-
}
|
|
46509
|
-
|
|
46510
|
-
if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
46511
|
-
return body.byteLength;
|
|
46512
|
-
}
|
|
46513
|
-
|
|
46514
|
-
if(utils$1.isURLSearchParams(body)) {
|
|
46515
|
-
body = body + '';
|
|
46516
|
-
}
|
|
46517
|
-
|
|
46518
|
-
if(utils$1.isString(body)) {
|
|
46519
|
-
return (await encodeText(body)).byteLength;
|
|
46520
|
-
}
|
|
46521
|
-
};
|
|
46522
|
-
|
|
46523
|
-
const resolveBodyLength = async (headers, body) => {
|
|
46524
|
-
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
46525
|
-
|
|
46526
|
-
return length == null ? getBodyLength(body) : length;
|
|
46527
|
-
};
|
|
46528
|
-
|
|
46529
|
-
var fetchAdapter = isFetchSupported && (async (config) => {
|
|
46530
|
-
let {
|
|
46531
|
-
url,
|
|
46532
|
-
method,
|
|
46533
|
-
data,
|
|
46534
|
-
signal,
|
|
46535
|
-
cancelToken,
|
|
46536
|
-
timeout,
|
|
46537
|
-
onDownloadProgress,
|
|
46538
|
-
onUploadProgress,
|
|
46539
|
-
responseType,
|
|
46540
|
-
headers,
|
|
46541
|
-
withCredentials = 'same-origin',
|
|
46542
|
-
fetchOptions
|
|
46543
|
-
} = resolveConfig(config);
|
|
46544
|
-
|
|
46545
|
-
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
46546
|
-
|
|
46547
|
-
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
46548
|
-
|
|
46549
|
-
let request;
|
|
46550
|
-
|
|
46551
|
-
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
46552
|
-
composedSignal.unsubscribe();
|
|
46553
|
-
});
|
|
46554
|
-
|
|
46555
|
-
let requestContentLength;
|
|
46556
|
-
|
|
46557
|
-
try {
|
|
46558
|
-
if (
|
|
46559
|
-
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
46560
|
-
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
46561
|
-
) {
|
|
46562
|
-
let _request = new Request(url, {
|
|
46563
|
-
method: 'POST',
|
|
46564
|
-
body: data,
|
|
46565
|
-
duplex: "half"
|
|
46566
|
-
});
|
|
46567
|
-
|
|
46568
|
-
let contentTypeHeader;
|
|
46569
|
-
|
|
46570
|
-
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
46571
|
-
headers.setContentType(contentTypeHeader);
|
|
46572
|
-
}
|
|
46573
|
-
|
|
46574
|
-
if (_request.body) {
|
|
46575
|
-
const [onProgress, flush] = progressEventDecorator(
|
|
46576
|
-
requestContentLength,
|
|
46577
|
-
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
46578
|
-
);
|
|
46579
|
-
|
|
46580
|
-
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
46581
|
-
}
|
|
46582
|
-
}
|
|
46583
|
-
|
|
46584
|
-
if (!utils$1.isString(withCredentials)) {
|
|
46585
|
-
withCredentials = withCredentials ? 'include' : 'omit';
|
|
46586
|
-
}
|
|
46587
|
-
|
|
46588
|
-
// Cloudflare Workers throws when credentials are defined
|
|
46589
|
-
// see https://github.com/cloudflare/workerd/issues/902
|
|
46590
|
-
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
46591
|
-
request = new Request(url, {
|
|
46592
|
-
...fetchOptions,
|
|
46593
|
-
signal: composedSignal,
|
|
46594
|
-
method: method.toUpperCase(),
|
|
46595
|
-
headers: headers.normalize().toJSON(),
|
|
46596
|
-
body: data,
|
|
46597
|
-
duplex: "half",
|
|
46598
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
46599
|
-
});
|
|
46600
|
-
|
|
46601
|
-
let response = await fetch(request);
|
|
46602
|
-
|
|
46603
|
-
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
46604
|
-
|
|
46605
|
-
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
46606
|
-
const options = {};
|
|
46607
|
-
|
|
46608
|
-
['status', 'statusText', 'headers'].forEach(prop => {
|
|
46609
|
-
options[prop] = response[prop];
|
|
46610
|
-
});
|
|
46611
|
-
|
|
46612
|
-
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
46613
|
-
|
|
46614
|
-
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
46615
|
-
responseContentLength,
|
|
46616
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
46617
|
-
) || [];
|
|
46618
|
-
|
|
46619
|
-
response = new Response(
|
|
46620
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
46621
|
-
flush && flush();
|
|
46622
|
-
unsubscribe && unsubscribe();
|
|
46623
|
-
}),
|
|
46624
|
-
options
|
|
46625
|
-
);
|
|
46626
|
-
}
|
|
46627
|
-
|
|
46628
|
-
responseType = responseType || 'text';
|
|
46629
|
-
|
|
46630
|
-
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
46631
|
-
|
|
46632
|
-
!isStreamResponse && unsubscribe && unsubscribe();
|
|
46633
|
-
|
|
46634
|
-
return await new Promise((resolve, reject) => {
|
|
46635
|
-
settle(resolve, reject, {
|
|
46636
|
-
data: responseData,
|
|
46637
|
-
headers: AxiosHeaders.from(response.headers),
|
|
46638
|
-
status: response.status,
|
|
46639
|
-
statusText: response.statusText,
|
|
46640
|
-
config,
|
|
46641
|
-
request
|
|
46642
|
-
});
|
|
46643
|
-
})
|
|
46644
|
-
} catch (err) {
|
|
46645
|
-
unsubscribe && unsubscribe();
|
|
46646
|
-
|
|
46647
|
-
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
|
46648
|
-
throw Object.assign(
|
|
46649
|
-
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
46650
|
-
{
|
|
46651
|
-
cause: err.cause || err
|
|
46652
|
-
}
|
|
46653
|
-
)
|
|
46654
|
-
}
|
|
46655
|
-
|
|
46656
|
-
throw AxiosError.from(err, err && err.code, config, request);
|
|
46657
|
-
}
|
|
46658
|
-
});
|
|
46659
|
-
|
|
46660
45721
|
const knownAdapters = {
|
|
46661
45722
|
http: httpAdapter,
|
|
46662
|
-
xhr: xhrAdapter
|
|
46663
|
-
fetch: fetchAdapter
|
|
45723
|
+
xhr: xhrAdapter
|
|
46664
45724
|
};
|
|
46665
45725
|
|
|
46666
|
-
utils
|
|
46667
|
-
if
|
|
45726
|
+
utils.forEach(knownAdapters, (fn, value) => {
|
|
45727
|
+
if(fn) {
|
|
46668
45728
|
try {
|
|
46669
45729
|
Object.defineProperty(fn, 'name', {value});
|
|
46670
45730
|
} catch (e) {
|
|
@@ -46674,58 +45734,40 @@ utils$1.forEach(knownAdapters, (fn, value) => {
|
|
|
46674
45734
|
}
|
|
46675
45735
|
});
|
|
46676
45736
|
|
|
46677
|
-
const renderReason = (reason) => `- ${reason}`;
|
|
46678
|
-
|
|
46679
|
-
const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
46680
|
-
|
|
46681
45737
|
var adapters = {
|
|
46682
45738
|
getAdapter: (adapters) => {
|
|
46683
|
-
adapters = utils
|
|
45739
|
+
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
|
46684
45740
|
|
|
46685
45741
|
const {length} = adapters;
|
|
46686
45742
|
let nameOrAdapter;
|
|
46687
45743
|
let adapter;
|
|
46688
45744
|
|
|
46689
|
-
const rejectedReasons = {};
|
|
46690
|
-
|
|
46691
45745
|
for (let i = 0; i < length; i++) {
|
|
46692
45746
|
nameOrAdapter = adapters[i];
|
|
46693
|
-
|
|
46694
|
-
|
|
46695
|
-
adapter = nameOrAdapter;
|
|
46696
|
-
|
|
46697
|
-
if (!isResolvedHandle(nameOrAdapter)) {
|
|
46698
|
-
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
46699
|
-
|
|
46700
|
-
if (adapter === undefined) {
|
|
46701
|
-
throw new AxiosError(`Unknown adapter '${id}'`);
|
|
46702
|
-
}
|
|
46703
|
-
}
|
|
46704
|
-
|
|
46705
|
-
if (adapter) {
|
|
45747
|
+
if((adapter = utils.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter)) {
|
|
46706
45748
|
break;
|
|
46707
45749
|
}
|
|
46708
|
-
|
|
46709
|
-
rejectedReasons[id || '#' + i] = adapter;
|
|
46710
45750
|
}
|
|
46711
45751
|
|
|
46712
45752
|
if (!adapter) {
|
|
46713
|
-
|
|
46714
|
-
|
|
46715
|
-
|
|
46716
|
-
|
|
45753
|
+
if (adapter === false) {
|
|
45754
|
+
throw new AxiosError(
|
|
45755
|
+
`Adapter ${nameOrAdapter} is not supported by the environment`,
|
|
45756
|
+
'ERR_NOT_SUPPORT'
|
|
46717
45757
|
);
|
|
45758
|
+
}
|
|
46718
45759
|
|
|
46719
|
-
|
|
46720
|
-
|
|
46721
|
-
|
|
46722
|
-
|
|
46723
|
-
throw new AxiosError(
|
|
46724
|
-
`There is no suitable adapter to dispatch the request ` + s,
|
|
46725
|
-
'ERR_NOT_SUPPORT'
|
|
45760
|
+
throw new Error(
|
|
45761
|
+
utils.hasOwnProp(knownAdapters, nameOrAdapter) ?
|
|
45762
|
+
`Adapter '${nameOrAdapter}' is not available in the build` :
|
|
45763
|
+
`Unknown adapter '${nameOrAdapter}'`
|
|
46726
45764
|
);
|
|
46727
45765
|
}
|
|
46728
45766
|
|
|
45767
|
+
if (!utils.isFunction(adapter)) {
|
|
45768
|
+
throw new TypeError('adapter is not a function');
|
|
45769
|
+
}
|
|
45770
|
+
|
|
46729
45771
|
return adapter;
|
|
46730
45772
|
},
|
|
46731
45773
|
adapters: knownAdapters
|
|
@@ -46804,6 +45846,107 @@ function dispatchRequest(config) {
|
|
|
46804
45846
|
});
|
|
46805
45847
|
}
|
|
46806
45848
|
|
|
45849
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders ? thing.toJSON() : thing;
|
|
45850
|
+
|
|
45851
|
+
/**
|
|
45852
|
+
* Config-specific merge-function which creates a new config-object
|
|
45853
|
+
* by merging two configuration objects together.
|
|
45854
|
+
*
|
|
45855
|
+
* @param {Object} config1
|
|
45856
|
+
* @param {Object} config2
|
|
45857
|
+
*
|
|
45858
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
|
45859
|
+
*/
|
|
45860
|
+
function mergeConfig(config1, config2) {
|
|
45861
|
+
// eslint-disable-next-line no-param-reassign
|
|
45862
|
+
config2 = config2 || {};
|
|
45863
|
+
const config = {};
|
|
45864
|
+
|
|
45865
|
+
function getMergedValue(target, source, caseless) {
|
|
45866
|
+
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
45867
|
+
return utils.merge.call({caseless}, target, source);
|
|
45868
|
+
} else if (utils.isPlainObject(source)) {
|
|
45869
|
+
return utils.merge({}, source);
|
|
45870
|
+
} else if (utils.isArray(source)) {
|
|
45871
|
+
return source.slice();
|
|
45872
|
+
}
|
|
45873
|
+
return source;
|
|
45874
|
+
}
|
|
45875
|
+
|
|
45876
|
+
// eslint-disable-next-line consistent-return
|
|
45877
|
+
function mergeDeepProperties(a, b, caseless) {
|
|
45878
|
+
if (!utils.isUndefined(b)) {
|
|
45879
|
+
return getMergedValue(a, b, caseless);
|
|
45880
|
+
} else if (!utils.isUndefined(a)) {
|
|
45881
|
+
return getMergedValue(undefined, a, caseless);
|
|
45882
|
+
}
|
|
45883
|
+
}
|
|
45884
|
+
|
|
45885
|
+
// eslint-disable-next-line consistent-return
|
|
45886
|
+
function valueFromConfig2(a, b) {
|
|
45887
|
+
if (!utils.isUndefined(b)) {
|
|
45888
|
+
return getMergedValue(undefined, b);
|
|
45889
|
+
}
|
|
45890
|
+
}
|
|
45891
|
+
|
|
45892
|
+
// eslint-disable-next-line consistent-return
|
|
45893
|
+
function defaultToConfig2(a, b) {
|
|
45894
|
+
if (!utils.isUndefined(b)) {
|
|
45895
|
+
return getMergedValue(undefined, b);
|
|
45896
|
+
} else if (!utils.isUndefined(a)) {
|
|
45897
|
+
return getMergedValue(undefined, a);
|
|
45898
|
+
}
|
|
45899
|
+
}
|
|
45900
|
+
|
|
45901
|
+
// eslint-disable-next-line consistent-return
|
|
45902
|
+
function mergeDirectKeys(a, b, prop) {
|
|
45903
|
+
if (prop in config2) {
|
|
45904
|
+
return getMergedValue(a, b);
|
|
45905
|
+
} else if (prop in config1) {
|
|
45906
|
+
return getMergedValue(undefined, a);
|
|
45907
|
+
}
|
|
45908
|
+
}
|
|
45909
|
+
|
|
45910
|
+
const mergeMap = {
|
|
45911
|
+
url: valueFromConfig2,
|
|
45912
|
+
method: valueFromConfig2,
|
|
45913
|
+
data: valueFromConfig2,
|
|
45914
|
+
baseURL: defaultToConfig2,
|
|
45915
|
+
transformRequest: defaultToConfig2,
|
|
45916
|
+
transformResponse: defaultToConfig2,
|
|
45917
|
+
paramsSerializer: defaultToConfig2,
|
|
45918
|
+
timeout: defaultToConfig2,
|
|
45919
|
+
timeoutMessage: defaultToConfig2,
|
|
45920
|
+
withCredentials: defaultToConfig2,
|
|
45921
|
+
adapter: defaultToConfig2,
|
|
45922
|
+
responseType: defaultToConfig2,
|
|
45923
|
+
xsrfCookieName: defaultToConfig2,
|
|
45924
|
+
xsrfHeaderName: defaultToConfig2,
|
|
45925
|
+
onUploadProgress: defaultToConfig2,
|
|
45926
|
+
onDownloadProgress: defaultToConfig2,
|
|
45927
|
+
decompress: defaultToConfig2,
|
|
45928
|
+
maxContentLength: defaultToConfig2,
|
|
45929
|
+
maxBodyLength: defaultToConfig2,
|
|
45930
|
+
beforeRedirect: defaultToConfig2,
|
|
45931
|
+
transport: defaultToConfig2,
|
|
45932
|
+
httpAgent: defaultToConfig2,
|
|
45933
|
+
httpsAgent: defaultToConfig2,
|
|
45934
|
+
cancelToken: defaultToConfig2,
|
|
45935
|
+
socketPath: defaultToConfig2,
|
|
45936
|
+
responseEncoding: defaultToConfig2,
|
|
45937
|
+
validateStatus: mergeDirectKeys,
|
|
45938
|
+
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
45939
|
+
};
|
|
45940
|
+
|
|
45941
|
+
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
45942
|
+
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
45943
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
45944
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
45945
|
+
});
|
|
45946
|
+
|
|
45947
|
+
return config;
|
|
45948
|
+
}
|
|
45949
|
+
|
|
46807
45950
|
const validators$1 = {};
|
|
46808
45951
|
|
|
46809
45952
|
// eslint-disable-next-line func-names
|
|
@@ -46853,14 +45996,6 @@ validators$1.transitional = function transitional(validator, version, message) {
|
|
|
46853
45996
|
};
|
|
46854
45997
|
};
|
|
46855
45998
|
|
|
46856
|
-
validators$1.spelling = function spelling(correctSpelling) {
|
|
46857
|
-
return (value, opt) => {
|
|
46858
|
-
// eslint-disable-next-line no-console
|
|
46859
|
-
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
46860
|
-
return true;
|
|
46861
|
-
}
|
|
46862
|
-
};
|
|
46863
|
-
|
|
46864
45999
|
/**
|
|
46865
46000
|
* Assert object's properties type
|
|
46866
46001
|
*
|
|
@@ -46925,34 +46060,7 @@ class Axios {
|
|
|
46925
46060
|
*
|
|
46926
46061
|
* @returns {Promise} The Promise to be fulfilled
|
|
46927
46062
|
*/
|
|
46928
|
-
|
|
46929
|
-
try {
|
|
46930
|
-
return await this._request(configOrUrl, config);
|
|
46931
|
-
} catch (err) {
|
|
46932
|
-
if (err instanceof Error) {
|
|
46933
|
-
let dummy = {};
|
|
46934
|
-
|
|
46935
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
|
46936
|
-
|
|
46937
|
-
// slice off the Error: ... line
|
|
46938
|
-
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
|
46939
|
-
try {
|
|
46940
|
-
if (!err.stack) {
|
|
46941
|
-
err.stack = stack;
|
|
46942
|
-
// match without the 2 top stack lines
|
|
46943
|
-
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
|
|
46944
|
-
err.stack += '\n' + stack;
|
|
46945
|
-
}
|
|
46946
|
-
} catch (e) {
|
|
46947
|
-
// ignore the case where "stack" is an un-writable property
|
|
46948
|
-
}
|
|
46949
|
-
}
|
|
46950
|
-
|
|
46951
|
-
throw err;
|
|
46952
|
-
}
|
|
46953
|
-
}
|
|
46954
|
-
|
|
46955
|
-
_request(configOrUrl, config) {
|
|
46063
|
+
request(configOrUrl, config) {
|
|
46956
46064
|
/*eslint no-param-reassign:0*/
|
|
46957
46065
|
// Allow for axios('example/url'[, config]) a la fetch API
|
|
46958
46066
|
if (typeof configOrUrl === 'string') {
|
|
@@ -46974,34 +46082,25 @@ class Axios {
|
|
|
46974
46082
|
}, false);
|
|
46975
46083
|
}
|
|
46976
46084
|
|
|
46977
|
-
if (paramsSerializer
|
|
46978
|
-
|
|
46979
|
-
|
|
46980
|
-
|
|
46981
|
-
|
|
46982
|
-
} else {
|
|
46983
|
-
validator.assertOptions(paramsSerializer, {
|
|
46984
|
-
encode: validators.function,
|
|
46985
|
-
serialize: validators.function
|
|
46986
|
-
}, true);
|
|
46987
|
-
}
|
|
46085
|
+
if (paramsSerializer !== undefined) {
|
|
46086
|
+
validator.assertOptions(paramsSerializer, {
|
|
46087
|
+
encode: validators.function,
|
|
46088
|
+
serialize: validators.function
|
|
46089
|
+
}, true);
|
|
46988
46090
|
}
|
|
46989
46091
|
|
|
46990
|
-
validator.assertOptions(config, {
|
|
46991
|
-
baseUrl: validators.spelling('baseURL'),
|
|
46992
|
-
withXsrfToken: validators.spelling('withXSRFToken')
|
|
46993
|
-
}, true);
|
|
46994
|
-
|
|
46995
46092
|
// Set config.method
|
|
46996
46093
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
46997
46094
|
|
|
46095
|
+
let contextHeaders;
|
|
46096
|
+
|
|
46998
46097
|
// Flatten headers
|
|
46999
|
-
|
|
46098
|
+
contextHeaders = headers && utils.merge(
|
|
47000
46099
|
headers.common,
|
|
47001
46100
|
headers[config.method]
|
|
47002
46101
|
);
|
|
47003
46102
|
|
|
47004
|
-
|
|
46103
|
+
contextHeaders && utils.forEach(
|
|
47005
46104
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
47006
46105
|
(method) => {
|
|
47007
46106
|
delete headers[method];
|
|
@@ -47088,7 +46187,7 @@ class Axios {
|
|
|
47088
46187
|
}
|
|
47089
46188
|
|
|
47090
46189
|
// Provide aliases for supported request methods
|
|
47091
|
-
utils
|
|
46190
|
+
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
47092
46191
|
/*eslint func-names:0*/
|
|
47093
46192
|
Axios.prototype[method] = function(url, config) {
|
|
47094
46193
|
return this.request(mergeConfig(config || {}, {
|
|
@@ -47099,7 +46198,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
|
|
|
47099
46198
|
};
|
|
47100
46199
|
});
|
|
47101
46200
|
|
|
47102
|
-
utils
|
|
46201
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
47103
46202
|
/*eslint func-names:0*/
|
|
47104
46203
|
|
|
47105
46204
|
function generateHTTPMethod(isForm) {
|
|
@@ -47220,20 +46319,6 @@ class CancelToken {
|
|
|
47220
46319
|
}
|
|
47221
46320
|
}
|
|
47222
46321
|
|
|
47223
|
-
toAbortSignal() {
|
|
47224
|
-
const controller = new AbortController();
|
|
47225
|
-
|
|
47226
|
-
const abort = (err) => {
|
|
47227
|
-
controller.abort(err);
|
|
47228
|
-
};
|
|
47229
|
-
|
|
47230
|
-
this.subscribe(abort);
|
|
47231
|
-
|
|
47232
|
-
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
47233
|
-
|
|
47234
|
-
return controller.signal;
|
|
47235
|
-
}
|
|
47236
|
-
|
|
47237
46322
|
/**
|
|
47238
46323
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
47239
46324
|
* cancels the `CancelToken`.
|
|
@@ -47285,78 +46370,8 @@ function spread(callback) {
|
|
|
47285
46370
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
47286
46371
|
*/
|
|
47287
46372
|
function isAxiosError(payload) {
|
|
47288
|
-
return utils
|
|
47289
|
-
}
|
|
47290
|
-
|
|
47291
|
-
const HttpStatusCode = {
|
|
47292
|
-
Continue: 100,
|
|
47293
|
-
SwitchingProtocols: 101,
|
|
47294
|
-
Processing: 102,
|
|
47295
|
-
EarlyHints: 103,
|
|
47296
|
-
Ok: 200,
|
|
47297
|
-
Created: 201,
|
|
47298
|
-
Accepted: 202,
|
|
47299
|
-
NonAuthoritativeInformation: 203,
|
|
47300
|
-
NoContent: 204,
|
|
47301
|
-
ResetContent: 205,
|
|
47302
|
-
PartialContent: 206,
|
|
47303
|
-
MultiStatus: 207,
|
|
47304
|
-
AlreadyReported: 208,
|
|
47305
|
-
ImUsed: 226,
|
|
47306
|
-
MultipleChoices: 300,
|
|
47307
|
-
MovedPermanently: 301,
|
|
47308
|
-
Found: 302,
|
|
47309
|
-
SeeOther: 303,
|
|
47310
|
-
NotModified: 304,
|
|
47311
|
-
UseProxy: 305,
|
|
47312
|
-
Unused: 306,
|
|
47313
|
-
TemporaryRedirect: 307,
|
|
47314
|
-
PermanentRedirect: 308,
|
|
47315
|
-
BadRequest: 400,
|
|
47316
|
-
Unauthorized: 401,
|
|
47317
|
-
PaymentRequired: 402,
|
|
47318
|
-
Forbidden: 403,
|
|
47319
|
-
NotFound: 404,
|
|
47320
|
-
MethodNotAllowed: 405,
|
|
47321
|
-
NotAcceptable: 406,
|
|
47322
|
-
ProxyAuthenticationRequired: 407,
|
|
47323
|
-
RequestTimeout: 408,
|
|
47324
|
-
Conflict: 409,
|
|
47325
|
-
Gone: 410,
|
|
47326
|
-
LengthRequired: 411,
|
|
47327
|
-
PreconditionFailed: 412,
|
|
47328
|
-
PayloadTooLarge: 413,
|
|
47329
|
-
UriTooLong: 414,
|
|
47330
|
-
UnsupportedMediaType: 415,
|
|
47331
|
-
RangeNotSatisfiable: 416,
|
|
47332
|
-
ExpectationFailed: 417,
|
|
47333
|
-
ImATeapot: 418,
|
|
47334
|
-
MisdirectedRequest: 421,
|
|
47335
|
-
UnprocessableEntity: 422,
|
|
47336
|
-
Locked: 423,
|
|
47337
|
-
FailedDependency: 424,
|
|
47338
|
-
TooEarly: 425,
|
|
47339
|
-
UpgradeRequired: 426,
|
|
47340
|
-
PreconditionRequired: 428,
|
|
47341
|
-
TooManyRequests: 429,
|
|
47342
|
-
RequestHeaderFieldsTooLarge: 431,
|
|
47343
|
-
UnavailableForLegalReasons: 451,
|
|
47344
|
-
InternalServerError: 500,
|
|
47345
|
-
NotImplemented: 501,
|
|
47346
|
-
BadGateway: 502,
|
|
47347
|
-
ServiceUnavailable: 503,
|
|
47348
|
-
GatewayTimeout: 504,
|
|
47349
|
-
HttpVersionNotSupported: 505,
|
|
47350
|
-
VariantAlsoNegotiates: 506,
|
|
47351
|
-
InsufficientStorage: 507,
|
|
47352
|
-
LoopDetected: 508,
|
|
47353
|
-
NotExtended: 510,
|
|
47354
|
-
NetworkAuthenticationRequired: 511,
|
|
47355
|
-
};
|
|
47356
|
-
|
|
47357
|
-
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
47358
|
-
HttpStatusCode[value] = key;
|
|
47359
|
-
});
|
|
46373
|
+
return utils.isObject(payload) && (payload.isAxiosError === true);
|
|
46374
|
+
}
|
|
47360
46375
|
|
|
47361
46376
|
/**
|
|
47362
46377
|
* Create an instance of Axios
|
|
@@ -47370,10 +46385,10 @@ function createInstance(defaultConfig) {
|
|
|
47370
46385
|
const instance = bind(Axios.prototype.request, context);
|
|
47371
46386
|
|
|
47372
46387
|
// Copy axios.prototype to instance
|
|
47373
|
-
utils
|
|
46388
|
+
utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});
|
|
47374
46389
|
|
|
47375
46390
|
// Copy context to instance
|
|
47376
|
-
utils
|
|
46391
|
+
utils.extend(instance, context, null, {allOwnKeys: true});
|
|
47377
46392
|
|
|
47378
46393
|
// Factory for creating new instances
|
|
47379
46394
|
instance.create = function create(instanceConfig) {
|
|
@@ -47417,11 +46432,7 @@ axios.mergeConfig = mergeConfig;
|
|
|
47417
46432
|
|
|
47418
46433
|
axios.AxiosHeaders = AxiosHeaders;
|
|
47419
46434
|
|
|
47420
|
-
axios.formToJSON = thing => formDataToJSON(utils
|
|
47421
|
-
|
|
47422
|
-
axios.getAdapter = adapters.getAdapter;
|
|
47423
|
-
|
|
47424
|
-
axios.HttpStatusCode = HttpStatusCode;
|
|
46435
|
+
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
47425
46436
|
|
|
47426
46437
|
axios.default = axios;
|
|
47427
46438
|
|