@bigbinary/neeto-audit-frontend 2.4.3 → 2.4.4
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.js
CHANGED
|
@@ -15,7 +15,7 @@ import require$$0$4 from 'os';
|
|
|
15
15
|
import stream, { Readable } from 'stream';
|
|
16
16
|
import require$$3$1 from 'http';
|
|
17
17
|
import require$$4$1 from 'https';
|
|
18
|
-
import require$$
|
|
18
|
+
import require$$5 from 'url';
|
|
19
19
|
import require$$8 from 'crypto';
|
|
20
20
|
import http2 from 'http2';
|
|
21
21
|
import zlib from 'zlib';
|
|
@@ -15949,7 +15949,7 @@ const DEPENDENCIES$3 = {
|
|
|
15949
15949
|
"@honeybadger-io/js": "6.10.1",
|
|
15950
15950
|
"@honeybadger-io/react": "6.1.25",
|
|
15951
15951
|
"antd": "5.22.1",
|
|
15952
|
-
axios: "1.
|
|
15952
|
+
axios: "1.15.0",
|
|
15953
15953
|
"i18next": "22.5.1",
|
|
15954
15954
|
"js-logger": "1.6.1",
|
|
15955
15955
|
ramda: "0.29.0",
|
|
@@ -15992,7 +15992,7 @@ const DEV_DEPENDENCIES$2 = {
|
|
|
15992
15992
|
"@tippyjs/react": "4.2.6",
|
|
15993
15993
|
"antd": "5.22.1",
|
|
15994
15994
|
"avvvatars-react": "0.4.2",
|
|
15995
|
-
"axios": "1.
|
|
15995
|
+
"axios": "1.15.0",
|
|
15996
15996
|
"classnames": "2.5.1",
|
|
15997
15997
|
"crypto-browserify": "3.12.1",
|
|
15998
15998
|
"dayjs": "1.11.13",
|
|
@@ -16050,7 +16050,7 @@ const PEER_DEPENDENCIES$2 = {
|
|
|
16050
16050
|
"@tippyjs/react": "4.2.6",
|
|
16051
16051
|
"antd": "5.22.1",
|
|
16052
16052
|
"avvvatars-react": "0.4.2",
|
|
16053
|
-
"axios": "1.
|
|
16053
|
+
"axios": "1.15.0",
|
|
16054
16054
|
"classnames": "2.5.1",
|
|
16055
16055
|
"crypto-browserify": "3.12.1",
|
|
16056
16056
|
"dayjs": "1.11.13",
|
|
@@ -16113,7 +16113,7 @@ const DEV_DEPENDENCIES$1 = {
|
|
|
16113
16113
|
"@tanstack/react-query": "5.59.20",
|
|
16114
16114
|
"@tanstack/react-query-devtools": "5.59.20",
|
|
16115
16115
|
"antd": "5.22.1",
|
|
16116
|
-
axios: "1.
|
|
16116
|
+
axios: "1.15.0",
|
|
16117
16117
|
classnames: "2.5.1",
|
|
16118
16118
|
formik: "2.4.6",
|
|
16119
16119
|
"i18next": "22.5.1",
|
|
@@ -16142,7 +16142,7 @@ const PEER_DEPENDENCIES$1 = {
|
|
|
16142
16142
|
"@honeybadger-io/react": "6.1.25",
|
|
16143
16143
|
"@tanstack/react-query": "5.59.20",
|
|
16144
16144
|
"@tanstack/react-query-devtools": "5.59.20",
|
|
16145
|
-
axios: "1.
|
|
16145
|
+
axios: "1.15.0",
|
|
16146
16146
|
classnames: "2.5.1",
|
|
16147
16147
|
formik: "2.4.6",
|
|
16148
16148
|
"i18next": "22.5.1",
|
|
@@ -16224,7 +16224,7 @@ const { isArray } = Array;
|
|
|
16224
16224
|
*
|
|
16225
16225
|
* @returns {boolean} True if the value is undefined, otherwise false
|
|
16226
16226
|
*/
|
|
16227
|
-
const isUndefined = typeOfTest(
|
|
16227
|
+
const isUndefined = typeOfTest('undefined');
|
|
16228
16228
|
|
|
16229
16229
|
/**
|
|
16230
16230
|
* Determine if a value is a Buffer
|
|
@@ -16251,7 +16251,7 @@ function isBuffer$1(val) {
|
|
|
16251
16251
|
*
|
|
16252
16252
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
16253
16253
|
*/
|
|
16254
|
-
const isArrayBuffer = kindOfTest(
|
|
16254
|
+
const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
16255
16255
|
|
|
16256
16256
|
/**
|
|
16257
16257
|
* Determine if a value is a view on an ArrayBuffer
|
|
@@ -16262,7 +16262,7 @@ const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
|
16262
16262
|
*/
|
|
16263
16263
|
function isArrayBufferView(val) {
|
|
16264
16264
|
let result;
|
|
16265
|
-
if (typeof ArrayBuffer !==
|
|
16265
|
+
if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
|
|
16266
16266
|
result = ArrayBuffer.isView(val);
|
|
16267
16267
|
} else {
|
|
16268
16268
|
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
@@ -16277,7 +16277,7 @@ function isArrayBufferView(val) {
|
|
|
16277
16277
|
*
|
|
16278
16278
|
* @returns {boolean} True if value is a String, otherwise false
|
|
16279
16279
|
*/
|
|
16280
|
-
const isString$1 = typeOfTest(
|
|
16280
|
+
const isString$1 = typeOfTest('string');
|
|
16281
16281
|
|
|
16282
16282
|
/**
|
|
16283
16283
|
* Determine if a value is a Function
|
|
@@ -16285,7 +16285,7 @@ const isString$1 = typeOfTest("string");
|
|
|
16285
16285
|
* @param {*} val The value to test
|
|
16286
16286
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
16287
16287
|
*/
|
|
16288
|
-
const isFunction$2 = typeOfTest(
|
|
16288
|
+
const isFunction$2 = typeOfTest('function');
|
|
16289
16289
|
|
|
16290
16290
|
/**
|
|
16291
16291
|
* Determine if a value is a Number
|
|
@@ -16294,7 +16294,7 @@ const isFunction$2 = typeOfTest("function");
|
|
|
16294
16294
|
*
|
|
16295
16295
|
* @returns {boolean} True if value is a Number, otherwise false
|
|
16296
16296
|
*/
|
|
16297
|
-
const isNumber = typeOfTest(
|
|
16297
|
+
const isNumber = typeOfTest('number');
|
|
16298
16298
|
|
|
16299
16299
|
/**
|
|
16300
16300
|
* Determine if a value is an Object
|
|
@@ -16303,7 +16303,7 @@ const isNumber = typeOfTest("number");
|
|
|
16303
16303
|
*
|
|
16304
16304
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
16305
16305
|
*/
|
|
16306
|
-
const isObject = (thing) => thing !== null && typeof thing ===
|
|
16306
|
+
const isObject = (thing) => thing !== null && typeof thing === 'object';
|
|
16307
16307
|
|
|
16308
16308
|
/**
|
|
16309
16309
|
* Determine if a value is a Boolean
|
|
@@ -16321,7 +16321,7 @@ const isBoolean = (thing) => thing === true || thing === false;
|
|
|
16321
16321
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
16322
16322
|
*/
|
|
16323
16323
|
const isPlainObject = (val) => {
|
|
16324
|
-
if (kindOf(val) !==
|
|
16324
|
+
if (kindOf(val) !== 'object') {
|
|
16325
16325
|
return false;
|
|
16326
16326
|
}
|
|
16327
16327
|
|
|
@@ -16349,10 +16349,7 @@ const isEmptyObject = (val) => {
|
|
|
16349
16349
|
}
|
|
16350
16350
|
|
|
16351
16351
|
try {
|
|
16352
|
-
return (
|
|
16353
|
-
Object.keys(val).length === 0 &&
|
|
16354
|
-
Object.getPrototypeOf(val) === Object.prototype
|
|
16355
|
-
);
|
|
16352
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
16356
16353
|
} catch (e) {
|
|
16357
16354
|
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
16358
16355
|
return false;
|
|
@@ -16366,7 +16363,7 @@ const isEmptyObject = (val) => {
|
|
|
16366
16363
|
*
|
|
16367
16364
|
* @returns {boolean} True if value is a Date, otherwise false
|
|
16368
16365
|
*/
|
|
16369
|
-
const isDate = kindOfTest(
|
|
16366
|
+
const isDate = kindOfTest('Date');
|
|
16370
16367
|
|
|
16371
16368
|
/**
|
|
16372
16369
|
* Determine if a value is a File
|
|
@@ -16375,7 +16372,32 @@ const isDate = kindOfTest("Date");
|
|
|
16375
16372
|
*
|
|
16376
16373
|
* @returns {boolean} True if value is a File, otherwise false
|
|
16377
16374
|
*/
|
|
16378
|
-
const isFile = kindOfTest(
|
|
16375
|
+
const isFile = kindOfTest('File');
|
|
16376
|
+
|
|
16377
|
+
/**
|
|
16378
|
+
* Determine if a value is a React Native Blob
|
|
16379
|
+
* React Native "blob": an object with a `uri` attribute. Optionally, it can
|
|
16380
|
+
* also have a `name` and `type` attribute to specify filename and content type
|
|
16381
|
+
*
|
|
16382
|
+
* @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
|
|
16383
|
+
*
|
|
16384
|
+
* @param {*} value The value to test
|
|
16385
|
+
*
|
|
16386
|
+
* @returns {boolean} True if value is a React Native Blob, otherwise false
|
|
16387
|
+
*/
|
|
16388
|
+
const isReactNativeBlob = (value) => {
|
|
16389
|
+
return !!(value && typeof value.uri !== 'undefined');
|
|
16390
|
+
};
|
|
16391
|
+
|
|
16392
|
+
/**
|
|
16393
|
+
* Determine if environment is React Native
|
|
16394
|
+
* ReactNative `FormData` has a non-standard `getParts()` method
|
|
16395
|
+
*
|
|
16396
|
+
* @param {*} formData The formData to test
|
|
16397
|
+
*
|
|
16398
|
+
* @returns {boolean} True if environment is React Native, otherwise false
|
|
16399
|
+
*/
|
|
16400
|
+
const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
|
|
16379
16401
|
|
|
16380
16402
|
/**
|
|
16381
16403
|
* Determine if a value is a Blob
|
|
@@ -16384,7 +16406,7 @@ const isFile = kindOfTest("File");
|
|
|
16384
16406
|
*
|
|
16385
16407
|
* @returns {boolean} True if value is a Blob, otherwise false
|
|
16386
16408
|
*/
|
|
16387
|
-
const isBlob = kindOfTest(
|
|
16409
|
+
const isBlob = kindOfTest('Blob');
|
|
16388
16410
|
|
|
16389
16411
|
/**
|
|
16390
16412
|
* Determine if a value is a FileList
|
|
@@ -16393,7 +16415,7 @@ const isBlob = kindOfTest("Blob");
|
|
|
16393
16415
|
*
|
|
16394
16416
|
* @returns {boolean} True if value is a File, otherwise false
|
|
16395
16417
|
*/
|
|
16396
|
-
const isFileList = kindOfTest(
|
|
16418
|
+
const isFileList = kindOfTest('FileList');
|
|
16397
16419
|
|
|
16398
16420
|
/**
|
|
16399
16421
|
* Determine if a value is a Stream
|
|
@@ -16411,17 +16433,27 @@ const isStream = (val) => isObject(val) && isFunction$2(val.pipe);
|
|
|
16411
16433
|
*
|
|
16412
16434
|
* @returns {boolean} True if value is an FormData, otherwise false
|
|
16413
16435
|
*/
|
|
16436
|
+
function getGlobal() {
|
|
16437
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
16438
|
+
if (typeof self !== 'undefined') return self;
|
|
16439
|
+
if (typeof window !== 'undefined') return window;
|
|
16440
|
+
if (typeof global !== 'undefined') return global;
|
|
16441
|
+
return {};
|
|
16442
|
+
}
|
|
16443
|
+
|
|
16444
|
+
const G = getGlobal();
|
|
16445
|
+
const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
16446
|
+
|
|
16414
16447
|
const isFormData = (thing) => {
|
|
16415
16448
|
let kind;
|
|
16416
|
-
return (
|
|
16417
|
-
thing
|
|
16418
|
-
|
|
16419
|
-
|
|
16420
|
-
|
|
16421
|
-
|
|
16422
|
-
|
|
16423
|
-
|
|
16424
|
-
thing.toString() === "[object FormData]"))))
|
|
16449
|
+
return thing && (
|
|
16450
|
+
(FormDataCtor && thing instanceof FormDataCtor) || (
|
|
16451
|
+
isFunction$2(thing.append) && (
|
|
16452
|
+
(kind = kindOf(thing)) === 'formdata' ||
|
|
16453
|
+
// detect form-data instance
|
|
16454
|
+
(kind === 'object' && isFunction$2(thing.toString) && thing.toString() === '[object FormData]')
|
|
16455
|
+
)
|
|
16456
|
+
)
|
|
16425
16457
|
);
|
|
16426
16458
|
};
|
|
16427
16459
|
|
|
@@ -16432,13 +16464,13 @@ const isFormData = (thing) => {
|
|
|
16432
16464
|
*
|
|
16433
16465
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
16434
16466
|
*/
|
|
16435
|
-
const isURLSearchParams = kindOfTest(
|
|
16467
|
+
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
16436
16468
|
|
|
16437
16469
|
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
16438
|
-
|
|
16439
|
-
|
|
16440
|
-
|
|
16441
|
-
|
|
16470
|
+
'ReadableStream',
|
|
16471
|
+
'Request',
|
|
16472
|
+
'Response',
|
|
16473
|
+
'Headers',
|
|
16442
16474
|
].map(kindOfTest);
|
|
16443
16475
|
|
|
16444
16476
|
/**
|
|
@@ -16448,9 +16480,9 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
|
16448
16480
|
*
|
|
16449
16481
|
* @returns {String} The String freed of excess whitespace
|
|
16450
16482
|
*/
|
|
16451
|
-
const trim = (str) =>
|
|
16452
|
-
str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
|
16453
|
-
|
|
16483
|
+
const trim = (str) => {
|
|
16484
|
+
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
16485
|
+
};
|
|
16454
16486
|
/**
|
|
16455
16487
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
16456
16488
|
*
|
|
@@ -16469,7 +16501,7 @@ const trim = (str) =>
|
|
|
16469
16501
|
*/
|
|
16470
16502
|
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
16471
16503
|
// Don't bother if no value provided
|
|
16472
|
-
if (obj === null || typeof obj ===
|
|
16504
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
16473
16505
|
return;
|
|
16474
16506
|
}
|
|
16475
16507
|
|
|
@@ -16477,7 +16509,7 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
16477
16509
|
let l;
|
|
16478
16510
|
|
|
16479
16511
|
// Force an array if not already something iterable
|
|
16480
|
-
if (typeof obj !==
|
|
16512
|
+
if (typeof obj !== 'object') {
|
|
16481
16513
|
/*eslint no-param-reassign:0*/
|
|
16482
16514
|
obj = [obj];
|
|
16483
16515
|
}
|
|
@@ -16494,9 +16526,7 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
16494
16526
|
}
|
|
16495
16527
|
|
|
16496
16528
|
// Iterate over object keys
|
|
16497
|
-
const keys = allOwnKeys
|
|
16498
|
-
? Object.getOwnPropertyNames(obj)
|
|
16499
|
-
: Object.keys(obj);
|
|
16529
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
16500
16530
|
const len = keys.length;
|
|
16501
16531
|
let key;
|
|
16502
16532
|
|
|
@@ -16507,6 +16537,14 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
16507
16537
|
}
|
|
16508
16538
|
}
|
|
16509
16539
|
|
|
16540
|
+
/**
|
|
16541
|
+
* Finds a key in an object, case-insensitive, returning the actual key name.
|
|
16542
|
+
* Returns null if the object is a Buffer or if no match is found.
|
|
16543
|
+
*
|
|
16544
|
+
* @param {Object} obj - The object to search.
|
|
16545
|
+
* @param {string} key - The key to find (case-insensitive).
|
|
16546
|
+
* @returns {?string} The actual key name if found, otherwise null.
|
|
16547
|
+
*/
|
|
16510
16548
|
function findKey(obj, key) {
|
|
16511
16549
|
if (isBuffer$1(obj)) {
|
|
16512
16550
|
return null;
|
|
@@ -16527,16 +16565,11 @@ function findKey(obj, key) {
|
|
|
16527
16565
|
|
|
16528
16566
|
const _global = (() => {
|
|
16529
16567
|
/*eslint no-undef:0*/
|
|
16530
|
-
if (typeof globalThis !==
|
|
16531
|
-
return typeof self !==
|
|
16532
|
-
? self
|
|
16533
|
-
: typeof window !== "undefined"
|
|
16534
|
-
? window
|
|
16535
|
-
: global;
|
|
16568
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
16569
|
+
return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;
|
|
16536
16570
|
})();
|
|
16537
16571
|
|
|
16538
|
-
const isContextDefined = (context) =>
|
|
16539
|
-
!isUndefined(context) && context !== _global;
|
|
16572
|
+
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
16540
16573
|
|
|
16541
16574
|
/**
|
|
16542
16575
|
* Accepts varargs expecting each argument to be an object, then
|
|
@@ -16561,7 +16594,7 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
16561
16594
|
const result = {};
|
|
16562
16595
|
const assignValue = (val, key) => {
|
|
16563
16596
|
// Skip dangerous property names to prevent prototype pollution
|
|
16564
|
-
if (key ===
|
|
16597
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
16565
16598
|
return;
|
|
16566
16599
|
}
|
|
16567
16600
|
|
|
@@ -16614,7 +16647,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
|
16614
16647
|
});
|
|
16615
16648
|
}
|
|
16616
16649
|
},
|
|
16617
|
-
{ allOwnKeys }
|
|
16650
|
+
{ allOwnKeys }
|
|
16618
16651
|
);
|
|
16619
16652
|
return a;
|
|
16620
16653
|
};
|
|
@@ -16643,17 +16676,14 @@ const stripBOM = (content) => {
|
|
|
16643
16676
|
* @returns {void}
|
|
16644
16677
|
*/
|
|
16645
16678
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
16646
|
-
constructor.prototype = Object.create(
|
|
16647
|
-
|
|
16648
|
-
descriptors,
|
|
16649
|
-
);
|
|
16650
|
-
Object.defineProperty(constructor.prototype, "constructor", {
|
|
16679
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
16680
|
+
Object.defineProperty(constructor.prototype, 'constructor', {
|
|
16651
16681
|
value: constructor,
|
|
16652
16682
|
writable: true,
|
|
16653
16683
|
enumerable: false,
|
|
16654
16684
|
configurable: true,
|
|
16655
16685
|
});
|
|
16656
|
-
Object.defineProperty(constructor,
|
|
16686
|
+
Object.defineProperty(constructor, 'super', {
|
|
16657
16687
|
value: superConstructor.prototype,
|
|
16658
16688
|
});
|
|
16659
16689
|
props && Object.assign(constructor.prototype, props);
|
|
@@ -16683,20 +16713,13 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
|
|
|
16683
16713
|
i = props.length;
|
|
16684
16714
|
while (i-- > 0) {
|
|
16685
16715
|
prop = props[i];
|
|
16686
|
-
if (
|
|
16687
|
-
(!propFilter || propFilter(prop, sourceObj, destObj)) &&
|
|
16688
|
-
!merged[prop]
|
|
16689
|
-
) {
|
|
16716
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
16690
16717
|
destObj[prop] = sourceObj[prop];
|
|
16691
16718
|
merged[prop] = true;
|
|
16692
16719
|
}
|
|
16693
16720
|
}
|
|
16694
16721
|
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
16695
|
-
} while (
|
|
16696
|
-
sourceObj &&
|
|
16697
|
-
(!filter || filter(sourceObj, destObj)) &&
|
|
16698
|
-
sourceObj !== Object.prototype
|
|
16699
|
-
);
|
|
16722
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
16700
16723
|
|
|
16701
16724
|
return destObj;
|
|
16702
16725
|
};
|
|
@@ -16753,7 +16776,7 @@ const isTypedArray = ((TypedArray) => {
|
|
|
16753
16776
|
return (thing) => {
|
|
16754
16777
|
return TypedArray && thing instanceof TypedArray;
|
|
16755
16778
|
};
|
|
16756
|
-
})(typeof Uint8Array !==
|
|
16779
|
+
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
|
|
16757
16780
|
|
|
16758
16781
|
/**
|
|
16759
16782
|
* For each entry in the object, call the function with the key and value.
|
|
@@ -16796,14 +16819,12 @@ const matchAll = (regExp, str) => {
|
|
|
16796
16819
|
};
|
|
16797
16820
|
|
|
16798
16821
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
16799
|
-
const isHTMLForm = kindOfTest(
|
|
16822
|
+
const isHTMLForm = kindOfTest('HTMLFormElement');
|
|
16800
16823
|
|
|
16801
16824
|
const toCamelCase = (str) => {
|
|
16802
|
-
return str
|
|
16803
|
-
.
|
|
16804
|
-
|
|
16805
|
-
return p1.toUpperCase() + p2;
|
|
16806
|
-
});
|
|
16825
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
16826
|
+
return p1.toUpperCase() + p2;
|
|
16827
|
+
});
|
|
16807
16828
|
};
|
|
16808
16829
|
|
|
16809
16830
|
/* Creating a function that will check if an object has a property. */
|
|
@@ -16820,7 +16841,7 @@ const hasOwnProperty = (
|
|
|
16820
16841
|
*
|
|
16821
16842
|
* @returns {boolean} True if value is a RegExp object, otherwise false
|
|
16822
16843
|
*/
|
|
16823
|
-
const isRegExp = kindOfTest(
|
|
16844
|
+
const isRegExp = kindOfTest('RegExp');
|
|
16824
16845
|
|
|
16825
16846
|
const reduceDescriptors = (obj, reducer) => {
|
|
16826
16847
|
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
@@ -16844,10 +16865,7 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
16844
16865
|
const freezeMethods = (obj) => {
|
|
16845
16866
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
16846
16867
|
// skip restricted props in strict mode
|
|
16847
|
-
if (
|
|
16848
|
-
isFunction$2(obj) &&
|
|
16849
|
-
["arguments", "caller", "callee"].indexOf(name) !== -1
|
|
16850
|
-
) {
|
|
16868
|
+
if (isFunction$2(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
16851
16869
|
return false;
|
|
16852
16870
|
}
|
|
16853
16871
|
|
|
@@ -16857,7 +16875,7 @@ const freezeMethods = (obj) => {
|
|
|
16857
16875
|
|
|
16858
16876
|
descriptor.enumerable = false;
|
|
16859
16877
|
|
|
16860
|
-
if (
|
|
16878
|
+
if ('writable' in descriptor) {
|
|
16861
16879
|
descriptor.writable = false;
|
|
16862
16880
|
return;
|
|
16863
16881
|
}
|
|
@@ -16870,6 +16888,14 @@ const freezeMethods = (obj) => {
|
|
|
16870
16888
|
});
|
|
16871
16889
|
};
|
|
16872
16890
|
|
|
16891
|
+
/**
|
|
16892
|
+
* Converts an array or a delimited string into an object set with values as keys and true as values.
|
|
16893
|
+
* Useful for fast membership checks.
|
|
16894
|
+
*
|
|
16895
|
+
* @param {Array|string} arrayOrString - The array or string to convert.
|
|
16896
|
+
* @param {string} delimiter - The delimiter to use if input is a string.
|
|
16897
|
+
* @returns {Object} An object with keys from the array or string, values set to true.
|
|
16898
|
+
*/
|
|
16873
16899
|
const toObjectSet = (arrayOrString, delimiter) => {
|
|
16874
16900
|
const obj = {};
|
|
16875
16901
|
|
|
@@ -16879,9 +16905,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
16879
16905
|
});
|
|
16880
16906
|
};
|
|
16881
16907
|
|
|
16882
|
-
isArray(arrayOrString)
|
|
16883
|
-
? define(arrayOrString)
|
|
16884
|
-
: define(String(arrayOrString).split(delimiter));
|
|
16908
|
+
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
16885
16909
|
|
|
16886
16910
|
return obj;
|
|
16887
16911
|
};
|
|
@@ -16889,9 +16913,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
16889
16913
|
const noop$1 = () => {};
|
|
16890
16914
|
|
|
16891
16915
|
const toFiniteNumber = (value, defaultValue) => {
|
|
16892
|
-
return value != null && Number.isFinite((value = +value))
|
|
16893
|
-
? value
|
|
16894
|
-
: defaultValue;
|
|
16916
|
+
return value != null && Number.isFinite((value = +value)) ? value : defaultValue;
|
|
16895
16917
|
};
|
|
16896
16918
|
|
|
16897
16919
|
/**
|
|
@@ -16905,11 +16927,17 @@ function isSpecCompliantForm(thing) {
|
|
|
16905
16927
|
return !!(
|
|
16906
16928
|
thing &&
|
|
16907
16929
|
isFunction$2(thing.append) &&
|
|
16908
|
-
thing[toStringTag$1] ===
|
|
16930
|
+
thing[toStringTag$1] === 'FormData' &&
|
|
16909
16931
|
thing[iterator]
|
|
16910
16932
|
);
|
|
16911
16933
|
}
|
|
16912
16934
|
|
|
16935
|
+
/**
|
|
16936
|
+
* Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
|
|
16937
|
+
*
|
|
16938
|
+
* @param {Object} obj - The object to convert.
|
|
16939
|
+
* @returns {Object} The JSON-compatible object.
|
|
16940
|
+
*/
|
|
16913
16941
|
const toJSONObject = (obj) => {
|
|
16914
16942
|
const stack = new Array(10);
|
|
16915
16943
|
|
|
@@ -16924,7 +16952,7 @@ const toJSONObject = (obj) => {
|
|
|
16924
16952
|
return source;
|
|
16925
16953
|
}
|
|
16926
16954
|
|
|
16927
|
-
if (!(
|
|
16955
|
+
if (!('toJSON' in source)) {
|
|
16928
16956
|
stack[i] = source;
|
|
16929
16957
|
const target = isArray(source) ? [] : {};
|
|
16930
16958
|
|
|
@@ -16945,8 +16973,20 @@ const toJSONObject = (obj) => {
|
|
|
16945
16973
|
return visit(obj, 0);
|
|
16946
16974
|
};
|
|
16947
16975
|
|
|
16948
|
-
|
|
16976
|
+
/**
|
|
16977
|
+
* Determines if a value is an async function.
|
|
16978
|
+
*
|
|
16979
|
+
* @param {*} thing - The value to test.
|
|
16980
|
+
* @returns {boolean} True if value is an async function, otherwise false.
|
|
16981
|
+
*/
|
|
16982
|
+
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
16949
16983
|
|
|
16984
|
+
/**
|
|
16985
|
+
* Determines if a value is thenable (has then and catch methods).
|
|
16986
|
+
*
|
|
16987
|
+
* @param {*} thing - The value to test.
|
|
16988
|
+
* @returns {boolean} True if value is thenable, otherwise false.
|
|
16989
|
+
*/
|
|
16950
16990
|
const isThenable = (thing) =>
|
|
16951
16991
|
thing &&
|
|
16952
16992
|
(isObject(thing) || isFunction$2(thing)) &&
|
|
@@ -16956,6 +16996,14 @@ const isThenable = (thing) =>
|
|
|
16956
16996
|
// original code
|
|
16957
16997
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
16958
16998
|
|
|
16999
|
+
/**
|
|
17000
|
+
* Provides a cross-platform setImmediate implementation.
|
|
17001
|
+
* Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
|
|
17002
|
+
*
|
|
17003
|
+
* @param {boolean} setImmediateSupported - Whether setImmediate is supported.
|
|
17004
|
+
* @param {boolean} postMessageSupported - Whether postMessage is supported.
|
|
17005
|
+
* @returns {Function} A function to schedule a callback asynchronously.
|
|
17006
|
+
*/
|
|
16959
17007
|
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
16960
17008
|
if (setImmediateSupported) {
|
|
16961
17009
|
return setImmediate;
|
|
@@ -16964,27 +17012,33 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
16964
17012
|
return postMessageSupported
|
|
16965
17013
|
? ((token, callbacks) => {
|
|
16966
17014
|
_global.addEventListener(
|
|
16967
|
-
|
|
17015
|
+
'message',
|
|
16968
17016
|
({ source, data }) => {
|
|
16969
17017
|
if (source === _global && data === token) {
|
|
16970
17018
|
callbacks.length && callbacks.shift()();
|
|
16971
17019
|
}
|
|
16972
17020
|
},
|
|
16973
|
-
false
|
|
17021
|
+
false
|
|
16974
17022
|
);
|
|
16975
17023
|
|
|
16976
17024
|
return (cb) => {
|
|
16977
17025
|
callbacks.push(cb);
|
|
16978
|
-
_global.postMessage(token,
|
|
17026
|
+
_global.postMessage(token, '*');
|
|
16979
17027
|
};
|
|
16980
17028
|
})(`axios@${Math.random()}`, [])
|
|
16981
17029
|
: (cb) => setTimeout(cb);
|
|
16982
|
-
})(typeof setImmediate ===
|
|
17030
|
+
})(typeof setImmediate === 'function', isFunction$2(_global.postMessage));
|
|
16983
17031
|
|
|
17032
|
+
/**
|
|
17033
|
+
* Schedules a microtask or asynchronous callback as soon as possible.
|
|
17034
|
+
* Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
|
|
17035
|
+
*
|
|
17036
|
+
* @type {Function}
|
|
17037
|
+
*/
|
|
16984
17038
|
const asap =
|
|
16985
|
-
typeof queueMicrotask !==
|
|
17039
|
+
typeof queueMicrotask !== 'undefined'
|
|
16986
17040
|
? queueMicrotask.bind(_global)
|
|
16987
|
-
: (typeof process !==
|
|
17041
|
+
: (typeof process !== 'undefined' && process.nextTick) || _setImmediate;
|
|
16988
17042
|
|
|
16989
17043
|
// *********************
|
|
16990
17044
|
|
|
@@ -17009,6 +17063,8 @@ var utils$1 = {
|
|
|
17009
17063
|
isUndefined,
|
|
17010
17064
|
isDate,
|
|
17011
17065
|
isFile,
|
|
17066
|
+
isReactNativeBlob,
|
|
17067
|
+
isReactNative,
|
|
17012
17068
|
isBlob,
|
|
17013
17069
|
isRegExp,
|
|
17014
17070
|
isFunction: isFunction$2,
|
|
@@ -17051,14 +17107,20 @@ var utils$1 = {
|
|
|
17051
17107
|
};
|
|
17052
17108
|
|
|
17053
17109
|
let AxiosError$1 = class AxiosError extends Error {
|
|
17054
|
-
|
|
17055
|
-
|
|
17056
|
-
|
|
17057
|
-
|
|
17058
|
-
|
|
17059
|
-
|
|
17110
|
+
static from(error, code, config, request, response, customProps) {
|
|
17111
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
17112
|
+
axiosError.cause = error;
|
|
17113
|
+
axiosError.name = error.name;
|
|
17114
|
+
|
|
17115
|
+
// Preserve status from the original error if not already set from response
|
|
17116
|
+
if (error.status != null && axiosError.status == null) {
|
|
17117
|
+
axiosError.status = error.status;
|
|
17060
17118
|
}
|
|
17061
17119
|
|
|
17120
|
+
customProps && Object.assign(axiosError, customProps);
|
|
17121
|
+
return axiosError;
|
|
17122
|
+
}
|
|
17123
|
+
|
|
17062
17124
|
/**
|
|
17063
17125
|
* Create an Error with the specified message, config, error code, request and response.
|
|
17064
17126
|
*
|
|
@@ -17071,37 +17133,48 @@ let AxiosError$1 = class AxiosError extends Error {
|
|
|
17071
17133
|
* @returns {Error} The created error.
|
|
17072
17134
|
*/
|
|
17073
17135
|
constructor(message, code, config, request, response) {
|
|
17074
|
-
|
|
17075
|
-
|
|
17076
|
-
|
|
17077
|
-
|
|
17078
|
-
|
|
17079
|
-
|
|
17080
|
-
|
|
17081
|
-
|
|
17082
|
-
|
|
17083
|
-
|
|
17136
|
+
super(message);
|
|
17137
|
+
|
|
17138
|
+
// Make message enumerable to maintain backward compatibility
|
|
17139
|
+
// The native Error constructor sets message as non-enumerable,
|
|
17140
|
+
// but axios < v1.13.3 had it as enumerable
|
|
17141
|
+
Object.defineProperty(this, 'message', {
|
|
17142
|
+
value: message,
|
|
17143
|
+
enumerable: true,
|
|
17144
|
+
writable: true,
|
|
17145
|
+
configurable: true
|
|
17146
|
+
});
|
|
17147
|
+
|
|
17148
|
+
this.name = 'AxiosError';
|
|
17149
|
+
this.isAxiosError = true;
|
|
17150
|
+
code && (this.code = code);
|
|
17151
|
+
config && (this.config = config);
|
|
17152
|
+
request && (this.request = request);
|
|
17153
|
+
if (response) {
|
|
17154
|
+
this.response = response;
|
|
17155
|
+
this.status = response.status;
|
|
17156
|
+
}
|
|
17084
17157
|
}
|
|
17085
17158
|
|
|
17086
|
-
|
|
17087
|
-
|
|
17088
|
-
|
|
17089
|
-
|
|
17090
|
-
|
|
17091
|
-
|
|
17092
|
-
|
|
17093
|
-
|
|
17094
|
-
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
|
|
17098
|
-
|
|
17099
|
-
|
|
17100
|
-
|
|
17101
|
-
|
|
17102
|
-
|
|
17103
|
-
|
|
17104
|
-
|
|
17159
|
+
toJSON() {
|
|
17160
|
+
return {
|
|
17161
|
+
// Standard
|
|
17162
|
+
message: this.message,
|
|
17163
|
+
name: this.name,
|
|
17164
|
+
// Microsoft
|
|
17165
|
+
description: this.description,
|
|
17166
|
+
number: this.number,
|
|
17167
|
+
// Mozilla
|
|
17168
|
+
fileName: this.fileName,
|
|
17169
|
+
lineNumber: this.lineNumber,
|
|
17170
|
+
columnNumber: this.columnNumber,
|
|
17171
|
+
stack: this.stack,
|
|
17172
|
+
// Axios
|
|
17173
|
+
config: utils$1.toJSONObject(this.config),
|
|
17174
|
+
code: this.code,
|
|
17175
|
+
status: this.status,
|
|
17176
|
+
};
|
|
17177
|
+
}
|
|
17105
17178
|
};
|
|
17106
17179
|
|
|
17107
17180
|
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
@@ -29610,7 +29683,7 @@ var util = util$3;
|
|
|
29610
29683
|
var path = path$2;
|
|
29611
29684
|
var http$1 = require$$3$1;
|
|
29612
29685
|
var https$1 = require$$4$1;
|
|
29613
|
-
var parseUrl$2 = require$$
|
|
29686
|
+
var parseUrl$2 = require$$5.parse;
|
|
29614
29687
|
var fs = require$$3;
|
|
29615
29688
|
var Stream = stream.Stream;
|
|
29616
29689
|
var crypto = require$$8;
|
|
@@ -30133,11 +30206,14 @@ function removeBrackets(key) {
|
|
|
30133
30206
|
*/
|
|
30134
30207
|
function renderKey(path, key, dots) {
|
|
30135
30208
|
if (!path) return key;
|
|
30136
|
-
return path
|
|
30137
|
-
|
|
30138
|
-
|
|
30139
|
-
|
|
30140
|
-
|
|
30209
|
+
return path
|
|
30210
|
+
.concat(key)
|
|
30211
|
+
.map(function each(token, i) {
|
|
30212
|
+
// eslint-disable-next-line no-param-reassign
|
|
30213
|
+
token = removeBrackets(token);
|
|
30214
|
+
return !dots && i ? '[' + token + ']' : token;
|
|
30215
|
+
})
|
|
30216
|
+
.join(dots ? '.' : '');
|
|
30141
30217
|
}
|
|
30142
30218
|
|
|
30143
30219
|
/**
|
|
@@ -30187,21 +30263,26 @@ function toFormData$1(obj, formData, options) {
|
|
|
30187
30263
|
formData = formData || new (FormData$2 || FormData)();
|
|
30188
30264
|
|
|
30189
30265
|
// eslint-disable-next-line no-param-reassign
|
|
30190
|
-
options = utils$1.toFlatObject(
|
|
30191
|
-
|
|
30192
|
-
|
|
30193
|
-
|
|
30194
|
-
|
|
30195
|
-
|
|
30196
|
-
|
|
30197
|
-
|
|
30266
|
+
options = utils$1.toFlatObject(
|
|
30267
|
+
options,
|
|
30268
|
+
{
|
|
30269
|
+
metaTokens: true,
|
|
30270
|
+
dots: false,
|
|
30271
|
+
indexes: false,
|
|
30272
|
+
},
|
|
30273
|
+
false,
|
|
30274
|
+
function defined(option, source) {
|
|
30275
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
30276
|
+
return !utils$1.isUndefined(source[option]);
|
|
30277
|
+
}
|
|
30278
|
+
);
|
|
30198
30279
|
|
|
30199
30280
|
const metaTokens = options.metaTokens;
|
|
30200
30281
|
// eslint-disable-next-line no-use-before-define
|
|
30201
30282
|
const visitor = options.visitor || defaultVisitor;
|
|
30202
30283
|
const dots = options.dots;
|
|
30203
30284
|
const indexes = options.indexes;
|
|
30204
|
-
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
30285
|
+
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
30205
30286
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
30206
30287
|
|
|
30207
30288
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -30243,6 +30324,11 @@ function toFormData$1(obj, formData, options) {
|
|
|
30243
30324
|
function defaultVisitor(value, key, path) {
|
|
30244
30325
|
let arr = value;
|
|
30245
30326
|
|
|
30327
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
30328
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
30329
|
+
return false;
|
|
30330
|
+
}
|
|
30331
|
+
|
|
30246
30332
|
if (value && !path && typeof value === 'object') {
|
|
30247
30333
|
if (utils$1.endsWith(key, '{}')) {
|
|
30248
30334
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -30251,17 +30337,22 @@ function toFormData$1(obj, formData, options) {
|
|
|
30251
30337
|
value = JSON.stringify(value);
|
|
30252
30338
|
} else if (
|
|
30253
30339
|
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
30254
|
-
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
|
30255
|
-
|
|
30340
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
30341
|
+
) {
|
|
30256
30342
|
// eslint-disable-next-line no-param-reassign
|
|
30257
30343
|
key = removeBrackets(key);
|
|
30258
30344
|
|
|
30259
30345
|
arr.forEach(function each(el, index) {
|
|
30260
|
-
!(utils$1.isUndefined(el) || el === null) &&
|
|
30261
|
-
|
|
30262
|
-
|
|
30263
|
-
|
|
30264
|
-
|
|
30346
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
30347
|
+
formData.append(
|
|
30348
|
+
// eslint-disable-next-line no-nested-ternary
|
|
30349
|
+
indexes === true
|
|
30350
|
+
? renderKey([key], index, dots)
|
|
30351
|
+
: indexes === null
|
|
30352
|
+
? key
|
|
30353
|
+
: key + '[]',
|
|
30354
|
+
convertValue(el)
|
|
30355
|
+
);
|
|
30265
30356
|
});
|
|
30266
30357
|
return false;
|
|
30267
30358
|
}
|
|
@@ -30281,7 +30372,7 @@ function toFormData$1(obj, formData, options) {
|
|
|
30281
30372
|
const exposedHelpers = Object.assign(predicates, {
|
|
30282
30373
|
defaultVisitor,
|
|
30283
30374
|
convertValue,
|
|
30284
|
-
isVisitable
|
|
30375
|
+
isVisitable,
|
|
30285
30376
|
});
|
|
30286
30377
|
|
|
30287
30378
|
function build(value, path) {
|
|
@@ -30294,9 +30385,9 @@ function toFormData$1(obj, formData, options) {
|
|
|
30294
30385
|
stack.push(value);
|
|
30295
30386
|
|
|
30296
30387
|
utils$1.forEach(value, function each(el, key) {
|
|
30297
|
-
const result =
|
|
30298
|
-
|
|
30299
|
-
|
|
30388
|
+
const result =
|
|
30389
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
30390
|
+
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
30300
30391
|
|
|
30301
30392
|
if (result === true) {
|
|
30302
30393
|
build(el, path ? path.concat(key) : [key]);
|
|
@@ -30331,7 +30422,7 @@ function encode$1(str) {
|
|
|
30331
30422
|
')': '%29',
|
|
30332
30423
|
'~': '%7E',
|
|
30333
30424
|
'%20': '+',
|
|
30334
|
-
'%00': '\x00'
|
|
30425
|
+
'%00': '\x00',
|
|
30335
30426
|
};
|
|
30336
30427
|
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
30337
30428
|
return charMap[match];
|
|
@@ -30359,29 +30450,33 @@ prototype.append = function append(name, value) {
|
|
|
30359
30450
|
};
|
|
30360
30451
|
|
|
30361
30452
|
prototype.toString = function toString(encoder) {
|
|
30362
|
-
const _encode = encoder
|
|
30363
|
-
|
|
30364
|
-
|
|
30453
|
+
const _encode = encoder
|
|
30454
|
+
? function (value) {
|
|
30455
|
+
return encoder.call(this, value, encode$1);
|
|
30456
|
+
}
|
|
30457
|
+
: encode$1;
|
|
30365
30458
|
|
|
30366
|
-
return this._pairs
|
|
30367
|
-
|
|
30368
|
-
|
|
30459
|
+
return this._pairs
|
|
30460
|
+
.map(function each(pair) {
|
|
30461
|
+
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
30462
|
+
}, '')
|
|
30463
|
+
.join('&');
|
|
30369
30464
|
};
|
|
30370
30465
|
|
|
30371
30466
|
/**
|
|
30372
|
-
* It replaces
|
|
30373
|
-
*
|
|
30467
|
+
* It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
|
|
30468
|
+
* their plain counterparts (`:`, `$`, `,`, `+`).
|
|
30374
30469
|
*
|
|
30375
30470
|
* @param {string} val The value to be encoded.
|
|
30376
30471
|
*
|
|
30377
30472
|
* @returns {string} The encoded value.
|
|
30378
30473
|
*/
|
|
30379
30474
|
function encode(val) {
|
|
30380
|
-
return encodeURIComponent(val)
|
|
30381
|
-
replace(/%3A/gi, ':')
|
|
30382
|
-
replace(/%24/g, '$')
|
|
30383
|
-
replace(/%2C/gi, ',')
|
|
30384
|
-
replace(/%20/g, '+');
|
|
30475
|
+
return encodeURIComponent(val)
|
|
30476
|
+
.replace(/%3A/gi, ':')
|
|
30477
|
+
.replace(/%24/g, '$')
|
|
30478
|
+
.replace(/%2C/gi, ',')
|
|
30479
|
+
.replace(/%20/g, '+');
|
|
30385
30480
|
}
|
|
30386
30481
|
|
|
30387
30482
|
/**
|
|
@@ -30398,11 +30493,13 @@ function buildURL(url, params, options) {
|
|
|
30398
30493
|
return url;
|
|
30399
30494
|
}
|
|
30400
30495
|
|
|
30401
|
-
const _encode = options && options.encode || encode;
|
|
30496
|
+
const _encode = (options && options.encode) || encode;
|
|
30402
30497
|
|
|
30403
|
-
const _options = utils$1.isFunction(options)
|
|
30404
|
-
|
|
30405
|
-
|
|
30498
|
+
const _options = utils$1.isFunction(options)
|
|
30499
|
+
? {
|
|
30500
|
+
serialize: options,
|
|
30501
|
+
}
|
|
30502
|
+
: options;
|
|
30406
30503
|
|
|
30407
30504
|
const serializeFn = _options && _options.serialize;
|
|
30408
30505
|
|
|
@@ -30411,13 +30508,13 @@ function buildURL(url, params, options) {
|
|
|
30411
30508
|
if (serializeFn) {
|
|
30412
30509
|
serializedParams = serializeFn(params, _options);
|
|
30413
30510
|
} else {
|
|
30414
|
-
serializedParams = utils$1.isURLSearchParams(params)
|
|
30415
|
-
params.toString()
|
|
30416
|
-
new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
30511
|
+
serializedParams = utils$1.isURLSearchParams(params)
|
|
30512
|
+
? params.toString()
|
|
30513
|
+
: new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
30417
30514
|
}
|
|
30418
30515
|
|
|
30419
30516
|
if (serializedParams) {
|
|
30420
|
-
const hashmarkIndex = url.indexOf(
|
|
30517
|
+
const hashmarkIndex = url.indexOf('#');
|
|
30421
30518
|
|
|
30422
30519
|
if (hashmarkIndex !== -1) {
|
|
30423
30520
|
url = url.slice(0, hashmarkIndex);
|
|
@@ -30447,7 +30544,7 @@ class InterceptorManager {
|
|
|
30447
30544
|
fulfilled,
|
|
30448
30545
|
rejected,
|
|
30449
30546
|
synchronous: options ? options.synchronous : false,
|
|
30450
|
-
runWhen: options ? options.runWhen : null
|
|
30547
|
+
runWhen: options ? options.runWhen : null,
|
|
30451
30548
|
});
|
|
30452
30549
|
return this.handlers.length - 1;
|
|
30453
30550
|
}
|
|
@@ -30499,10 +30596,10 @@ var transitionalDefaults = {
|
|
|
30499
30596
|
silentJSONParsing: true,
|
|
30500
30597
|
forcedJSONParsing: true,
|
|
30501
30598
|
clarifyTimeoutError: false,
|
|
30502
|
-
legacyInterceptorReqResOrdering: true
|
|
30599
|
+
legacyInterceptorReqResOrdering: true,
|
|
30503
30600
|
};
|
|
30504
30601
|
|
|
30505
|
-
var URLSearchParams = require$$
|
|
30602
|
+
var URLSearchParams = require$$5.URLSearchParams;
|
|
30506
30603
|
|
|
30507
30604
|
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
30508
30605
|
|
|
@@ -30511,12 +30608,12 @@ const DIGIT = '0123456789';
|
|
|
30511
30608
|
const ALPHABET = {
|
|
30512
30609
|
DIGIT,
|
|
30513
30610
|
ALPHA,
|
|
30514
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
30611
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT,
|
|
30515
30612
|
};
|
|
30516
30613
|
|
|
30517
30614
|
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
30518
30615
|
let str = '';
|
|
30519
|
-
const {length} = alphabet;
|
|
30616
|
+
const { length } = alphabet;
|
|
30520
30617
|
const randomValues = new Uint32Array(size);
|
|
30521
30618
|
require$$8.randomFillSync(randomValues);
|
|
30522
30619
|
for (let i = 0; i < size; i++) {
|
|
@@ -30526,22 +30623,21 @@ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
|
30526
30623
|
return str;
|
|
30527
30624
|
};
|
|
30528
30625
|
|
|
30529
|
-
|
|
30530
30626
|
var platform$1 = {
|
|
30531
30627
|
isNode: true,
|
|
30532
30628
|
classes: {
|
|
30533
30629
|
URLSearchParams,
|
|
30534
30630
|
FormData: FormData$2,
|
|
30535
|
-
Blob: typeof Blob !== 'undefined' && Blob || null
|
|
30631
|
+
Blob: (typeof Blob !== 'undefined' && Blob) || null,
|
|
30536
30632
|
},
|
|
30537
30633
|
ALPHABET,
|
|
30538
30634
|
generateString,
|
|
30539
|
-
protocols: [
|
|
30635
|
+
protocols: ['http', 'https', 'file', 'data'],
|
|
30540
30636
|
};
|
|
30541
30637
|
|
|
30542
30638
|
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
30543
30639
|
|
|
30544
|
-
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
30640
|
+
const _navigator = (typeof navigator === 'object' && navigator) || undefined;
|
|
30545
30641
|
|
|
30546
30642
|
/**
|
|
30547
30643
|
* Determine if we're running in a standard browser environment
|
|
@@ -30560,7 +30656,8 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
|
30560
30656
|
*
|
|
30561
30657
|
* @returns {boolean}
|
|
30562
30658
|
*/
|
|
30563
|
-
const hasStandardBrowserEnv =
|
|
30659
|
+
const hasStandardBrowserEnv =
|
|
30660
|
+
hasBrowserEnv &&
|
|
30564
30661
|
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
30565
30662
|
|
|
30566
30663
|
/**
|
|
@@ -30581,7 +30678,7 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
30581
30678
|
);
|
|
30582
30679
|
})();
|
|
30583
30680
|
|
|
30584
|
-
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
30681
|
+
const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
|
|
30585
30682
|
|
|
30586
30683
|
var utils = /*#__PURE__*/Object.freeze({
|
|
30587
30684
|
__proto__: null,
|
|
@@ -30594,12 +30691,12 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
30594
30691
|
|
|
30595
30692
|
var platform = {
|
|
30596
30693
|
...utils,
|
|
30597
|
-
...platform$1
|
|
30694
|
+
...platform$1,
|
|
30598
30695
|
};
|
|
30599
30696
|
|
|
30600
30697
|
function toURLEncodedForm(data, options) {
|
|
30601
30698
|
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
30602
|
-
visitor: function(value, key, path, helpers) {
|
|
30699
|
+
visitor: function (value, key, path, helpers) {
|
|
30603
30700
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
30604
30701
|
this.append(key, value.toString('base64'));
|
|
30605
30702
|
return false;
|
|
@@ -30607,7 +30704,7 @@ function toURLEncodedForm(data, options) {
|
|
|
30607
30704
|
|
|
30608
30705
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
30609
30706
|
},
|
|
30610
|
-
...options
|
|
30707
|
+
...options,
|
|
30611
30708
|
});
|
|
30612
30709
|
}
|
|
30613
30710
|
|
|
@@ -30623,7 +30720,7 @@ function parsePropPath(name) {
|
|
|
30623
30720
|
// foo.x.y.z
|
|
30624
30721
|
// foo-x-y-z
|
|
30625
30722
|
// foo x y z
|
|
30626
|
-
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
30723
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
30627
30724
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
30628
30725
|
});
|
|
30629
30726
|
}
|
|
@@ -30727,96 +30824,107 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
30727
30824
|
}
|
|
30728
30825
|
|
|
30729
30826
|
const defaults = {
|
|
30730
|
-
|
|
30731
30827
|
transitional: transitionalDefaults,
|
|
30732
30828
|
|
|
30733
30829
|
adapter: ['xhr', 'http', 'fetch'],
|
|
30734
30830
|
|
|
30735
|
-
transformRequest: [
|
|
30736
|
-
|
|
30737
|
-
|
|
30738
|
-
|
|
30831
|
+
transformRequest: [
|
|
30832
|
+
function transformRequest(data, headers) {
|
|
30833
|
+
const contentType = headers.getContentType() || '';
|
|
30834
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
30835
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
30739
30836
|
|
|
30740
|
-
|
|
30741
|
-
|
|
30742
|
-
|
|
30837
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
30838
|
+
data = new FormData(data);
|
|
30839
|
+
}
|
|
30743
30840
|
|
|
30744
|
-
|
|
30841
|
+
const isFormData = utils$1.isFormData(data);
|
|
30745
30842
|
|
|
30746
|
-
|
|
30747
|
-
|
|
30748
|
-
|
|
30843
|
+
if (isFormData) {
|
|
30844
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
30845
|
+
}
|
|
30749
30846
|
|
|
30750
|
-
|
|
30751
|
-
|
|
30752
|
-
|
|
30753
|
-
|
|
30754
|
-
|
|
30755
|
-
|
|
30756
|
-
|
|
30757
|
-
|
|
30758
|
-
|
|
30759
|
-
|
|
30760
|
-
|
|
30761
|
-
|
|
30762
|
-
|
|
30763
|
-
|
|
30764
|
-
|
|
30765
|
-
|
|
30847
|
+
if (
|
|
30848
|
+
utils$1.isArrayBuffer(data) ||
|
|
30849
|
+
utils$1.isBuffer(data) ||
|
|
30850
|
+
utils$1.isStream(data) ||
|
|
30851
|
+
utils$1.isFile(data) ||
|
|
30852
|
+
utils$1.isBlob(data) ||
|
|
30853
|
+
utils$1.isReadableStream(data)
|
|
30854
|
+
) {
|
|
30855
|
+
return data;
|
|
30856
|
+
}
|
|
30857
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
30858
|
+
return data.buffer;
|
|
30859
|
+
}
|
|
30860
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
30861
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
30862
|
+
return data.toString();
|
|
30863
|
+
}
|
|
30766
30864
|
|
|
30767
|
-
|
|
30865
|
+
let isFileList;
|
|
30768
30866
|
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30867
|
+
if (isObjectPayload) {
|
|
30868
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
30869
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
30870
|
+
}
|
|
30773
30871
|
|
|
30774
|
-
|
|
30775
|
-
|
|
30872
|
+
if (
|
|
30873
|
+
(isFileList = utils$1.isFileList(data)) ||
|
|
30874
|
+
contentType.indexOf('multipart/form-data') > -1
|
|
30875
|
+
) {
|
|
30876
|
+
const _FormData = this.env && this.env.FormData;
|
|
30776
30877
|
|
|
30777
|
-
|
|
30778
|
-
|
|
30779
|
-
|
|
30780
|
-
|
|
30781
|
-
|
|
30878
|
+
return toFormData$1(
|
|
30879
|
+
isFileList ? { 'files[]': data } : data,
|
|
30880
|
+
_FormData && new _FormData(),
|
|
30881
|
+
this.formSerializer
|
|
30882
|
+
);
|
|
30883
|
+
}
|
|
30782
30884
|
}
|
|
30783
|
-
}
|
|
30784
30885
|
|
|
30785
|
-
|
|
30786
|
-
|
|
30787
|
-
|
|
30788
|
-
|
|
30886
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
30887
|
+
headers.setContentType('application/json', false);
|
|
30888
|
+
return stringifySafely(data);
|
|
30889
|
+
}
|
|
30789
30890
|
|
|
30790
|
-
|
|
30791
|
-
|
|
30891
|
+
return data;
|
|
30892
|
+
},
|
|
30893
|
+
],
|
|
30792
30894
|
|
|
30793
|
-
transformResponse: [
|
|
30794
|
-
|
|
30795
|
-
|
|
30796
|
-
|
|
30895
|
+
transformResponse: [
|
|
30896
|
+
function transformResponse(data) {
|
|
30897
|
+
const transitional = this.transitional || defaults.transitional;
|
|
30898
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
30899
|
+
const JSONRequested = this.responseType === 'json';
|
|
30797
30900
|
|
|
30798
|
-
|
|
30799
|
-
|
|
30800
|
-
|
|
30901
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
30902
|
+
return data;
|
|
30903
|
+
}
|
|
30801
30904
|
|
|
30802
|
-
|
|
30803
|
-
|
|
30804
|
-
|
|
30905
|
+
if (
|
|
30906
|
+
data &&
|
|
30907
|
+
utils$1.isString(data) &&
|
|
30908
|
+
((forcedJSONParsing && !this.responseType) || JSONRequested)
|
|
30909
|
+
) {
|
|
30910
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
30911
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
30805
30912
|
|
|
30806
|
-
|
|
30807
|
-
|
|
30808
|
-
|
|
30809
|
-
|
|
30810
|
-
|
|
30811
|
-
|
|
30913
|
+
try {
|
|
30914
|
+
return JSON.parse(data, this.parseReviver);
|
|
30915
|
+
} catch (e) {
|
|
30916
|
+
if (strictJSONParsing) {
|
|
30917
|
+
if (e.name === 'SyntaxError') {
|
|
30918
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
30919
|
+
}
|
|
30920
|
+
throw e;
|
|
30812
30921
|
}
|
|
30813
|
-
throw e;
|
|
30814
30922
|
}
|
|
30815
30923
|
}
|
|
30816
|
-
}
|
|
30817
30924
|
|
|
30818
|
-
|
|
30819
|
-
|
|
30925
|
+
return data;
|
|
30926
|
+
},
|
|
30927
|
+
],
|
|
30820
30928
|
|
|
30821
30929
|
/**
|
|
30822
30930
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
@@ -30832,7 +30940,7 @@ const defaults = {
|
|
|
30832
30940
|
|
|
30833
30941
|
env: {
|
|
30834
30942
|
FormData: platform.classes.FormData,
|
|
30835
|
-
Blob: platform.classes.Blob
|
|
30943
|
+
Blob: platform.classes.Blob,
|
|
30836
30944
|
},
|
|
30837
30945
|
|
|
30838
30946
|
validateStatus: function validateStatus(status) {
|
|
@@ -30841,10 +30949,10 @@ const defaults = {
|
|
|
30841
30949
|
|
|
30842
30950
|
headers: {
|
|
30843
30951
|
common: {
|
|
30844
|
-
|
|
30845
|
-
'Content-Type': undefined
|
|
30846
|
-
}
|
|
30847
|
-
}
|
|
30952
|
+
Accept: 'application/json, text/plain, */*',
|
|
30953
|
+
'Content-Type': undefined,
|
|
30954
|
+
},
|
|
30955
|
+
},
|
|
30848
30956
|
};
|
|
30849
30957
|
|
|
30850
30958
|
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
@@ -30854,10 +30962,23 @@ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
|
30854
30962
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
30855
30963
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
30856
30964
|
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
30857
|
-
'age',
|
|
30858
|
-
'
|
|
30859
|
-
'
|
|
30860
|
-
'
|
|
30965
|
+
'age',
|
|
30966
|
+
'authorization',
|
|
30967
|
+
'content-length',
|
|
30968
|
+
'content-type',
|
|
30969
|
+
'etag',
|
|
30970
|
+
'expires',
|
|
30971
|
+
'from',
|
|
30972
|
+
'host',
|
|
30973
|
+
'if-modified-since',
|
|
30974
|
+
'if-unmodified-since',
|
|
30975
|
+
'last-modified',
|
|
30976
|
+
'location',
|
|
30977
|
+
'max-forwards',
|
|
30978
|
+
'proxy-authorization',
|
|
30979
|
+
'referer',
|
|
30980
|
+
'retry-after',
|
|
30981
|
+
'user-agent',
|
|
30861
30982
|
]);
|
|
30862
30983
|
|
|
30863
30984
|
/**
|
|
@@ -30874,47 +30995,81 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
30874
30995
|
*
|
|
30875
30996
|
* @returns {Object} Headers parsed into an object
|
|
30876
30997
|
*/
|
|
30877
|
-
var parseHeaders = rawHeaders => {
|
|
30998
|
+
var parseHeaders = (rawHeaders) => {
|
|
30878
30999
|
const parsed = {};
|
|
30879
31000
|
let key;
|
|
30880
31001
|
let val;
|
|
30881
31002
|
let i;
|
|
30882
31003
|
|
|
30883
|
-
rawHeaders &&
|
|
30884
|
-
|
|
30885
|
-
|
|
30886
|
-
|
|
31004
|
+
rawHeaders &&
|
|
31005
|
+
rawHeaders.split('\n').forEach(function parser(line) {
|
|
31006
|
+
i = line.indexOf(':');
|
|
31007
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
31008
|
+
val = line.substring(i + 1).trim();
|
|
30887
31009
|
|
|
30888
|
-
|
|
30889
|
-
|
|
30890
|
-
|
|
31010
|
+
if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
|
|
31011
|
+
return;
|
|
31012
|
+
}
|
|
30891
31013
|
|
|
30892
|
-
|
|
30893
|
-
|
|
30894
|
-
|
|
31014
|
+
if (key === 'set-cookie') {
|
|
31015
|
+
if (parsed[key]) {
|
|
31016
|
+
parsed[key].push(val);
|
|
31017
|
+
} else {
|
|
31018
|
+
parsed[key] = [val];
|
|
31019
|
+
}
|
|
30895
31020
|
} else {
|
|
30896
|
-
parsed[key] = [val
|
|
31021
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
30897
31022
|
}
|
|
30898
|
-
}
|
|
30899
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
30900
|
-
}
|
|
30901
|
-
});
|
|
31023
|
+
});
|
|
30902
31024
|
|
|
30903
31025
|
return parsed;
|
|
30904
31026
|
};
|
|
30905
31027
|
|
|
30906
31028
|
const $internals = Symbol('internals');
|
|
30907
31029
|
|
|
31030
|
+
const isValidHeaderValue = (value) => !/[\r\n]/.test(value);
|
|
31031
|
+
|
|
31032
|
+
function assertValidHeaderValue(value, header) {
|
|
31033
|
+
if (value === false || value == null) {
|
|
31034
|
+
return;
|
|
31035
|
+
}
|
|
31036
|
+
|
|
31037
|
+
if (utils$1.isArray(value)) {
|
|
31038
|
+
value.forEach((v) => assertValidHeaderValue(v, header));
|
|
31039
|
+
return;
|
|
31040
|
+
}
|
|
31041
|
+
|
|
31042
|
+
if (!isValidHeaderValue(String(value))) {
|
|
31043
|
+
throw new Error(`Invalid character in header content ["${header}"]`);
|
|
31044
|
+
}
|
|
31045
|
+
}
|
|
31046
|
+
|
|
30908
31047
|
function normalizeHeader(header) {
|
|
30909
31048
|
return header && String(header).trim().toLowerCase();
|
|
30910
31049
|
}
|
|
30911
31050
|
|
|
31051
|
+
function stripTrailingCRLF(str) {
|
|
31052
|
+
let end = str.length;
|
|
31053
|
+
|
|
31054
|
+
while (end > 0) {
|
|
31055
|
+
const charCode = str.charCodeAt(end - 1);
|
|
31056
|
+
|
|
31057
|
+
if (charCode !== 10 && charCode !== 13) {
|
|
31058
|
+
break;
|
|
31059
|
+
}
|
|
31060
|
+
|
|
31061
|
+
end -= 1;
|
|
31062
|
+
}
|
|
31063
|
+
|
|
31064
|
+
return end === str.length ? str : str.slice(0, end);
|
|
31065
|
+
}
|
|
31066
|
+
|
|
30912
31067
|
function normalizeValue(value) {
|
|
30913
31068
|
if (value === false || value == null) {
|
|
30914
31069
|
return value;
|
|
30915
31070
|
}
|
|
30916
31071
|
|
|
30917
|
-
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
31072
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : stripTrailingCRLF(String(value));
|
|
30918
31073
|
}
|
|
30919
31074
|
|
|
30920
31075
|
function parseTokens(str) {
|
|
@@ -30952,8 +31107,10 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
|
30952
31107
|
}
|
|
30953
31108
|
|
|
30954
31109
|
function formatHeader(header) {
|
|
30955
|
-
return header
|
|
30956
|
-
.
|
|
31110
|
+
return header
|
|
31111
|
+
.trim()
|
|
31112
|
+
.toLowerCase()
|
|
31113
|
+
.replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
30957
31114
|
return char.toUpperCase() + str;
|
|
30958
31115
|
});
|
|
30959
31116
|
}
|
|
@@ -30961,12 +31118,12 @@ function formatHeader(header) {
|
|
|
30961
31118
|
function buildAccessors(obj, header) {
|
|
30962
31119
|
const accessorName = utils$1.toCamelCase(' ' + header);
|
|
30963
31120
|
|
|
30964
|
-
['get', 'set', 'has'].forEach(methodName => {
|
|
31121
|
+
['get', 'set', 'has'].forEach((methodName) => {
|
|
30965
31122
|
Object.defineProperty(obj, methodName + accessorName, {
|
|
30966
|
-
value: function(arg1, arg2, arg3) {
|
|
31123
|
+
value: function (arg1, arg2, arg3) {
|
|
30967
31124
|
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
30968
31125
|
},
|
|
30969
|
-
configurable: true
|
|
31126
|
+
configurable: true,
|
|
30970
31127
|
});
|
|
30971
31128
|
});
|
|
30972
31129
|
}
|
|
@@ -30988,7 +31145,13 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
30988
31145
|
|
|
30989
31146
|
const key = utils$1.findKey(self, lHeader);
|
|
30990
31147
|
|
|
30991
|
-
if
|
|
31148
|
+
if (
|
|
31149
|
+
!key ||
|
|
31150
|
+
self[key] === undefined ||
|
|
31151
|
+
_rewrite === true ||
|
|
31152
|
+
(_rewrite === undefined && self[key] !== false)
|
|
31153
|
+
) {
|
|
31154
|
+
assertValidHeaderValue(_value, _header);
|
|
30992
31155
|
self[key || _header] = normalizeValue(_value);
|
|
30993
31156
|
}
|
|
30994
31157
|
}
|
|
@@ -30998,17 +31161,22 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
30998
31161
|
|
|
30999
31162
|
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
31000
31163
|
setHeaders(header, valueOrRewrite);
|
|
31001
|
-
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
31164
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
31002
31165
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
31003
31166
|
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
31004
|
-
let obj = {},
|
|
31167
|
+
let obj = {},
|
|
31168
|
+
dest,
|
|
31169
|
+
key;
|
|
31005
31170
|
for (const entry of header) {
|
|
31006
31171
|
if (!utils$1.isArray(entry)) {
|
|
31007
31172
|
throw TypeError('Object iterator must return a key-value pair');
|
|
31008
31173
|
}
|
|
31009
31174
|
|
|
31010
|
-
obj[key = entry[0]] = (dest = obj[key])
|
|
31011
|
-
|
|
31175
|
+
obj[(key = entry[0])] = (dest = obj[key])
|
|
31176
|
+
? utils$1.isArray(dest)
|
|
31177
|
+
? [...dest, entry[1]]
|
|
31178
|
+
: [dest, entry[1]]
|
|
31179
|
+
: entry[1];
|
|
31012
31180
|
}
|
|
31013
31181
|
|
|
31014
31182
|
setHeaders(obj, valueOrRewrite);
|
|
@@ -31055,7 +31223,11 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
31055
31223
|
if (header) {
|
|
31056
31224
|
const key = utils$1.findKey(this, header);
|
|
31057
31225
|
|
|
31058
|
-
return !!(
|
|
31226
|
+
return !!(
|
|
31227
|
+
key &&
|
|
31228
|
+
this[key] !== undefined &&
|
|
31229
|
+
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
|
31230
|
+
);
|
|
31059
31231
|
}
|
|
31060
31232
|
|
|
31061
31233
|
return false;
|
|
@@ -31095,7 +31267,7 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
31095
31267
|
|
|
31096
31268
|
while (i--) {
|
|
31097
31269
|
const key = keys[i];
|
|
31098
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
31270
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
31099
31271
|
delete this[key];
|
|
31100
31272
|
deleted = true;
|
|
31101
31273
|
}
|
|
@@ -31139,7 +31311,9 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
31139
31311
|
const obj = Object.create(null);
|
|
31140
31312
|
|
|
31141
31313
|
utils$1.forEach(this, (value, header) => {
|
|
31142
|
-
value != null &&
|
|
31314
|
+
value != null &&
|
|
31315
|
+
value !== false &&
|
|
31316
|
+
(obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
31143
31317
|
});
|
|
31144
31318
|
|
|
31145
31319
|
return obj;
|
|
@@ -31150,11 +31324,13 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
31150
31324
|
}
|
|
31151
31325
|
|
|
31152
31326
|
toString() {
|
|
31153
|
-
return Object.entries(this.toJSON())
|
|
31327
|
+
return Object.entries(this.toJSON())
|
|
31328
|
+
.map(([header, value]) => header + ': ' + value)
|
|
31329
|
+
.join('\n');
|
|
31154
31330
|
}
|
|
31155
31331
|
|
|
31156
31332
|
getSetCookie() {
|
|
31157
|
-
return this.get(
|
|
31333
|
+
return this.get('set-cookie') || [];
|
|
31158
31334
|
}
|
|
31159
31335
|
|
|
31160
31336
|
get [Symbol.toStringTag]() {
|
|
@@ -31174,9 +31350,12 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
31174
31350
|
}
|
|
31175
31351
|
|
|
31176
31352
|
static accessor(header) {
|
|
31177
|
-
const internals =
|
|
31178
|
-
|
|
31179
|
-
|
|
31353
|
+
const internals =
|
|
31354
|
+
(this[$internals] =
|
|
31355
|
+
this[$internals] =
|
|
31356
|
+
{
|
|
31357
|
+
accessors: {},
|
|
31358
|
+
});
|
|
31180
31359
|
|
|
31181
31360
|
const accessors = internals.accessors;
|
|
31182
31361
|
const prototype = this.prototype;
|
|
@@ -31196,17 +31375,24 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
31196
31375
|
}
|
|
31197
31376
|
};
|
|
31198
31377
|
|
|
31199
|
-
AxiosHeaders$1.accessor([
|
|
31378
|
+
AxiosHeaders$1.accessor([
|
|
31379
|
+
'Content-Type',
|
|
31380
|
+
'Content-Length',
|
|
31381
|
+
'Accept',
|
|
31382
|
+
'Accept-Encoding',
|
|
31383
|
+
'User-Agent',
|
|
31384
|
+
'Authorization',
|
|
31385
|
+
]);
|
|
31200
31386
|
|
|
31201
31387
|
// reserved names hotfix
|
|
31202
|
-
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
|
|
31388
|
+
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
31203
31389
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
31204
31390
|
return {
|
|
31205
31391
|
get: () => value,
|
|
31206
31392
|
set(headerValue) {
|
|
31207
31393
|
this[mapped] = headerValue;
|
|
31208
|
-
}
|
|
31209
|
-
}
|
|
31394
|
+
},
|
|
31395
|
+
};
|
|
31210
31396
|
});
|
|
31211
31397
|
|
|
31212
31398
|
utils$1.freezeMethods(AxiosHeaders$1);
|
|
@@ -31269,13 +31455,17 @@ function settle(resolve, reject, response) {
|
|
|
31269
31455
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
31270
31456
|
resolve(response);
|
|
31271
31457
|
} else {
|
|
31272
|
-
reject(
|
|
31273
|
-
|
|
31274
|
-
|
|
31275
|
-
|
|
31276
|
-
|
|
31277
|
-
|
|
31278
|
-
|
|
31458
|
+
reject(
|
|
31459
|
+
new AxiosError$1(
|
|
31460
|
+
'Request failed with status code ' + response.status,
|
|
31461
|
+
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][
|
|
31462
|
+
Math.floor(response.status / 100) - 4
|
|
31463
|
+
],
|
|
31464
|
+
response.config,
|
|
31465
|
+
response.request,
|
|
31466
|
+
response
|
|
31467
|
+
)
|
|
31468
|
+
);
|
|
31279
31469
|
}
|
|
31280
31470
|
}
|
|
31281
31471
|
|
|
@@ -31329,11 +31519,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
|
|
|
31329
31519
|
return requestedURL;
|
|
31330
31520
|
}
|
|
31331
31521
|
|
|
31332
|
-
var
|
|
31333
|
-
|
|
31334
|
-
var parseUrl$1 = require$$0$5.parse;
|
|
31335
|
-
|
|
31336
|
-
var DEFAULT_PORTS = {
|
|
31522
|
+
var DEFAULT_PORTS$1 = {
|
|
31337
31523
|
ftp: 21,
|
|
31338
31524
|
gopher: 70,
|
|
31339
31525
|
http: 80,
|
|
@@ -31342,18 +31528,22 @@ var DEFAULT_PORTS = {
|
|
|
31342
31528
|
wss: 443,
|
|
31343
31529
|
};
|
|
31344
31530
|
|
|
31345
|
-
|
|
31346
|
-
|
|
31347
|
-
|
|
31348
|
-
}
|
|
31531
|
+
function parseUrl$1(urlString) {
|
|
31532
|
+
try {
|
|
31533
|
+
return new URL(urlString);
|
|
31534
|
+
} catch {
|
|
31535
|
+
return null;
|
|
31536
|
+
}
|
|
31537
|
+
}
|
|
31349
31538
|
|
|
31350
31539
|
/**
|
|
31351
|
-
* @param {string|object} url - The URL
|
|
31540
|
+
* @param {string|object|URL} url - The URL as a string or URL instance, or a
|
|
31541
|
+
* compatible object (such as the result from legacy url.parse).
|
|
31352
31542
|
* @return {string} The URL of the proxy that should handle the request to the
|
|
31353
31543
|
* given URL. If no proxy is set, this will be an empty string.
|
|
31354
31544
|
*/
|
|
31355
31545
|
function getProxyForUrl(url) {
|
|
31356
|
-
var parsedUrl = typeof url === 'string' ? parseUrl$1(url) : url || {};
|
|
31546
|
+
var parsedUrl = (typeof url === 'string' ? parseUrl$1(url) : url) || {};
|
|
31357
31547
|
var proto = parsedUrl.protocol;
|
|
31358
31548
|
var hostname = parsedUrl.host;
|
|
31359
31549
|
var port = parsedUrl.port;
|
|
@@ -31365,16 +31555,12 @@ function getProxyForUrl(url) {
|
|
|
31365
31555
|
// Stripping ports in this way instead of using parsedUrl.hostname to make
|
|
31366
31556
|
// sure that the brackets around IPv6 addresses are kept.
|
|
31367
31557
|
hostname = hostname.replace(/:\d*$/, '');
|
|
31368
|
-
port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
|
|
31558
|
+
port = parseInt(port) || DEFAULT_PORTS$1[proto] || 0;
|
|
31369
31559
|
if (!shouldProxy(hostname, port)) {
|
|
31370
31560
|
return ''; // Don't proxy URLs that match NO_PROXY.
|
|
31371
31561
|
}
|
|
31372
31562
|
|
|
31373
|
-
var proxy =
|
|
31374
|
-
getEnv('npm_config_' + proto + '_proxy') ||
|
|
31375
|
-
getEnv(proto + '_proxy') ||
|
|
31376
|
-
getEnv('npm_config_proxy') ||
|
|
31377
|
-
getEnv('all_proxy');
|
|
31563
|
+
var proxy = getEnv(proto + '_proxy') || getEnv('all_proxy');
|
|
31378
31564
|
if (proxy && proxy.indexOf('://') === -1) {
|
|
31379
31565
|
// Missing scheme in proxy, default to the requested URL's scheme.
|
|
31380
31566
|
proxy = proto + '://' + proxy;
|
|
@@ -31391,8 +31577,7 @@ function getProxyForUrl(url) {
|
|
|
31391
31577
|
* @private
|
|
31392
31578
|
*/
|
|
31393
31579
|
function shouldProxy(hostname, port) {
|
|
31394
|
-
var NO_PROXY =
|
|
31395
|
-
(getEnv('npm_config_no_proxy') || getEnv('no_proxy')).toLowerCase();
|
|
31580
|
+
var NO_PROXY = getEnv('no_proxy').toLowerCase();
|
|
31396
31581
|
if (!NO_PROXY) {
|
|
31397
31582
|
return true; // Always proxy if NO_PROXY is not set.
|
|
31398
31583
|
}
|
|
@@ -31421,7 +31606,7 @@ function shouldProxy(hostname, port) {
|
|
|
31421
31606
|
parsedProxyHostname = parsedProxyHostname.slice(1);
|
|
31422
31607
|
}
|
|
31423
31608
|
// Stop proxying if the hostname ends with the no_proxy host.
|
|
31424
|
-
return !
|
|
31609
|
+
return !hostname.endsWith(parsedProxyHostname);
|
|
31425
31610
|
});
|
|
31426
31611
|
}
|
|
31427
31612
|
|
|
@@ -31436,8 +31621,6 @@ function getEnv(key) {
|
|
|
31436
31621
|
return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || '';
|
|
31437
31622
|
}
|
|
31438
31623
|
|
|
31439
|
-
proxyFromEnv.getProxyForUrl = getProxyForUrl;
|
|
31440
|
-
|
|
31441
31624
|
var followRedirects$1 = {exports: {}};
|
|
31442
31625
|
|
|
31443
31626
|
var debug$1;
|
|
@@ -31456,7 +31639,7 @@ var debug_1 = function () {
|
|
|
31456
31639
|
debug$1.apply(null, arguments);
|
|
31457
31640
|
};
|
|
31458
31641
|
|
|
31459
|
-
var url = require$$
|
|
31642
|
+
var url = require$$5;
|
|
31460
31643
|
var URL$1 = url.URL;
|
|
31461
31644
|
var http = require$$3$1;
|
|
31462
31645
|
var https = require$$4$1;
|
|
@@ -32146,11 +32329,11 @@ followRedirects$1.exports.wrap = wrap;
|
|
|
32146
32329
|
var followRedirectsExports = followRedirects$1.exports;
|
|
32147
32330
|
var followRedirects = /*@__PURE__*/getDefaultExportFromCjs(followRedirectsExports);
|
|
32148
32331
|
|
|
32149
|
-
const VERSION$1 = "1.
|
|
32332
|
+
const VERSION$1 = "1.15.0";
|
|
32150
32333
|
|
|
32151
32334
|
function parseProtocol(url) {
|
|
32152
32335
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
32153
|
-
return match && match[1] || '';
|
|
32336
|
+
return (match && match[1]) || '';
|
|
32154
32337
|
}
|
|
32155
32338
|
|
|
32156
32339
|
const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
@@ -32166,7 +32349,7 @@ const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
|
32166
32349
|
* @returns {Buffer|Blob}
|
|
32167
32350
|
*/
|
|
32168
32351
|
function fromDataURI(uri, asBlob, options) {
|
|
32169
|
-
const _Blob = options && options.Blob || platform.classes.Blob;
|
|
32352
|
+
const _Blob = (options && options.Blob) || platform.classes.Blob;
|
|
32170
32353
|
const protocol = parseProtocol(uri);
|
|
32171
32354
|
|
|
32172
32355
|
if (asBlob === undefined && _Blob) {
|
|
@@ -32192,7 +32375,7 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
32192
32375
|
throw new AxiosError$1('Blob is not supported', AxiosError$1.ERR_NOT_SUPPORT);
|
|
32193
32376
|
}
|
|
32194
32377
|
|
|
32195
|
-
return new _Blob([buffer], {type: mime});
|
|
32378
|
+
return new _Blob([buffer], { type: mime });
|
|
32196
32379
|
}
|
|
32197
32380
|
|
|
32198
32381
|
return buffer;
|
|
@@ -32203,24 +32386,29 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
32203
32386
|
|
|
32204
32387
|
const kInternals = Symbol('internals');
|
|
32205
32388
|
|
|
32206
|
-
class AxiosTransformStream extends stream.Transform{
|
|
32389
|
+
class AxiosTransformStream extends stream.Transform {
|
|
32207
32390
|
constructor(options) {
|
|
32208
|
-
options = utils$1.toFlatObject(
|
|
32209
|
-
|
|
32210
|
-
|
|
32211
|
-
|
|
32212
|
-
|
|
32213
|
-
|
|
32214
|
-
|
|
32215
|
-
|
|
32216
|
-
|
|
32217
|
-
|
|
32391
|
+
options = utils$1.toFlatObject(
|
|
32392
|
+
options,
|
|
32393
|
+
{
|
|
32394
|
+
maxRate: 0,
|
|
32395
|
+
chunkSize: 64 * 1024,
|
|
32396
|
+
minChunkSize: 100,
|
|
32397
|
+
timeWindow: 500,
|
|
32398
|
+
ticksRate: 2,
|
|
32399
|
+
samplesCount: 15,
|
|
32400
|
+
},
|
|
32401
|
+
null,
|
|
32402
|
+
(prop, source) => {
|
|
32403
|
+
return !utils$1.isUndefined(source[prop]);
|
|
32404
|
+
}
|
|
32405
|
+
);
|
|
32218
32406
|
|
|
32219
32407
|
super({
|
|
32220
|
-
readableHighWaterMark: options.chunkSize
|
|
32408
|
+
readableHighWaterMark: options.chunkSize,
|
|
32221
32409
|
});
|
|
32222
32410
|
|
|
32223
|
-
const internals = this[kInternals] = {
|
|
32411
|
+
const internals = (this[kInternals] = {
|
|
32224
32412
|
timeWindow: options.timeWindow,
|
|
32225
32413
|
chunkSize: options.chunkSize,
|
|
32226
32414
|
maxRate: options.maxRate,
|
|
@@ -32230,10 +32418,10 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
32230
32418
|
notifiedBytesLoaded: 0,
|
|
32231
32419
|
ts: Date.now(),
|
|
32232
32420
|
bytes: 0,
|
|
32233
|
-
onReadCallback: null
|
|
32234
|
-
};
|
|
32421
|
+
onReadCallback: null,
|
|
32422
|
+
});
|
|
32235
32423
|
|
|
32236
|
-
this.on('newListener', event => {
|
|
32424
|
+
this.on('newListener', (event) => {
|
|
32237
32425
|
if (event === 'progress') {
|
|
32238
32426
|
if (!internals.isCaptured) {
|
|
32239
32427
|
internals.isCaptured = true;
|
|
@@ -32261,8 +32449,11 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
32261
32449
|
const timeWindow = internals.timeWindow;
|
|
32262
32450
|
|
|
32263
32451
|
const divider = 1000 / timeWindow;
|
|
32264
|
-
const bytesThreshold =
|
|
32265
|
-
const minChunkSize =
|
|
32452
|
+
const bytesThreshold = maxRate / divider;
|
|
32453
|
+
const minChunkSize =
|
|
32454
|
+
internals.minChunkSize !== false
|
|
32455
|
+
? Math.max(internals.minChunkSize, bytesThreshold * 0.01)
|
|
32456
|
+
: 0;
|
|
32266
32457
|
|
|
32267
32458
|
const pushChunk = (_chunk, _callback) => {
|
|
32268
32459
|
const bytes = Buffer.byteLength(_chunk);
|
|
@@ -32291,7 +32482,7 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
32291
32482
|
if (maxRate) {
|
|
32292
32483
|
const now = Date.now();
|
|
32293
32484
|
|
|
32294
|
-
if (!internals.ts || (passed =
|
|
32485
|
+
if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
|
|
32295
32486
|
internals.ts = now;
|
|
32296
32487
|
bytesLeft = bytesThreshold - internals.bytes;
|
|
32297
32488
|
internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
|
|
@@ -32314,14 +32505,19 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
32314
32505
|
}
|
|
32315
32506
|
}
|
|
32316
32507
|
|
|
32317
|
-
if (maxChunkSize && chunkSize > maxChunkSize &&
|
|
32508
|
+
if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
|
|
32318
32509
|
chunkRemainder = _chunk.subarray(maxChunkSize);
|
|
32319
32510
|
_chunk = _chunk.subarray(0, maxChunkSize);
|
|
32320
32511
|
}
|
|
32321
32512
|
|
|
32322
|
-
pushChunk(
|
|
32323
|
-
|
|
32324
|
-
|
|
32513
|
+
pushChunk(
|
|
32514
|
+
_chunk,
|
|
32515
|
+
chunkRemainder
|
|
32516
|
+
? () => {
|
|
32517
|
+
process.nextTick(_callback, null, chunkRemainder);
|
|
32518
|
+
}
|
|
32519
|
+
: _callback
|
|
32520
|
+
);
|
|
32325
32521
|
};
|
|
32326
32522
|
|
|
32327
32523
|
transformChunk(chunk, function transformNextChunk(err, _chunk) {
|
|
@@ -32338,7 +32534,7 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
32338
32534
|
}
|
|
32339
32535
|
}
|
|
32340
32536
|
|
|
32341
|
-
const {asyncIterator} = Symbol;
|
|
32537
|
+
const { asyncIterator } = Symbol;
|
|
32342
32538
|
|
|
32343
32539
|
const readBlob = async function* (blob) {
|
|
32344
32540
|
if (blob.stream) {
|
|
@@ -32362,7 +32558,7 @@ const CRLF_BYTES_COUNT = 2;
|
|
|
32362
32558
|
|
|
32363
32559
|
class FormDataPart {
|
|
32364
32560
|
constructor(name, value) {
|
|
32365
|
-
const {escapeName} = this.constructor;
|
|
32561
|
+
const { escapeName } = this.constructor;
|
|
32366
32562
|
const isStringValue = utils$1.isString(value);
|
|
32367
32563
|
|
|
32368
32564
|
let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
|
|
@@ -32372,7 +32568,7 @@ class FormDataPart {
|
|
|
32372
32568
|
if (isStringValue) {
|
|
32373
32569
|
value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
|
|
32374
32570
|
} else {
|
|
32375
|
-
headers += `Content-Type: ${value.type ||
|
|
32571
|
+
headers += `Content-Type: ${value.type || 'application/octet-stream'}${CRLF}`;
|
|
32376
32572
|
}
|
|
32377
32573
|
|
|
32378
32574
|
this.headers = textEncoder.encode(headers + CRLF);
|
|
@@ -32385,12 +32581,12 @@ class FormDataPart {
|
|
|
32385
32581
|
this.value = value;
|
|
32386
32582
|
}
|
|
32387
32583
|
|
|
32388
|
-
async *encode(){
|
|
32584
|
+
async *encode() {
|
|
32389
32585
|
yield this.headers;
|
|
32390
32586
|
|
|
32391
|
-
const {value} = this;
|
|
32587
|
+
const { value } = this;
|
|
32392
32588
|
|
|
32393
|
-
if(utils$1.isTypedArray(value)) {
|
|
32589
|
+
if (utils$1.isTypedArray(value)) {
|
|
32394
32590
|
yield value;
|
|
32395
32591
|
} else {
|
|
32396
32592
|
yield* readBlob(value);
|
|
@@ -32400,11 +32596,15 @@ class FormDataPart {
|
|
|
32400
32596
|
}
|
|
32401
32597
|
|
|
32402
32598
|
static escapeName(name) {
|
|
32403
|
-
|
|
32404
|
-
|
|
32405
|
-
|
|
32406
|
-
|
|
32407
|
-
|
|
32599
|
+
return String(name).replace(
|
|
32600
|
+
/[\r\n"]/g,
|
|
32601
|
+
(match) =>
|
|
32602
|
+
({
|
|
32603
|
+
'\r': '%0D',
|
|
32604
|
+
'\n': '%0A',
|
|
32605
|
+
'"': '%22',
|
|
32606
|
+
})[match]
|
|
32607
|
+
);
|
|
32408
32608
|
}
|
|
32409
32609
|
}
|
|
32410
32610
|
|
|
@@ -32412,15 +32612,15 @@ const formDataToStream = (form, headersHandler, options) => {
|
|
|
32412
32612
|
const {
|
|
32413
32613
|
tag = 'form-data-boundary',
|
|
32414
32614
|
size = 25,
|
|
32415
|
-
boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
|
|
32615
|
+
boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET),
|
|
32416
32616
|
} = options || {};
|
|
32417
32617
|
|
|
32418
|
-
if(!utils$1.isFormData(form)) {
|
|
32618
|
+
if (!utils$1.isFormData(form)) {
|
|
32419
32619
|
throw TypeError('FormData instance required');
|
|
32420
32620
|
}
|
|
32421
32621
|
|
|
32422
32622
|
if (boundary.length < 1 || boundary.length > 70) {
|
|
32423
|
-
throw Error('boundary must be 10-70 characters long')
|
|
32623
|
+
throw Error('boundary must be 10-70 characters long');
|
|
32424
32624
|
}
|
|
32425
32625
|
|
|
32426
32626
|
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
|
|
@@ -32438,7 +32638,7 @@ const formDataToStream = (form, headersHandler, options) => {
|
|
|
32438
32638
|
contentLength = utils$1.toFiniteNumber(contentLength);
|
|
32439
32639
|
|
|
32440
32640
|
const computedHeaders = {
|
|
32441
|
-
'Content-Type': `multipart/form-data; boundary=${boundary}
|
|
32641
|
+
'Content-Type': `multipart/form-data; boundary=${boundary}`,
|
|
32442
32642
|
};
|
|
32443
32643
|
|
|
32444
32644
|
if (Number.isFinite(contentLength)) {
|
|
@@ -32447,14 +32647,16 @@ const formDataToStream = (form, headersHandler, options) => {
|
|
|
32447
32647
|
|
|
32448
32648
|
headersHandler && headersHandler(computedHeaders);
|
|
32449
32649
|
|
|
32450
|
-
return Readable.from(
|
|
32451
|
-
|
|
32452
|
-
|
|
32453
|
-
|
|
32454
|
-
|
|
32650
|
+
return Readable.from(
|
|
32651
|
+
(async function* () {
|
|
32652
|
+
for (const part of parts) {
|
|
32653
|
+
yield boundaryBytes;
|
|
32654
|
+
yield* part.encode();
|
|
32655
|
+
}
|
|
32455
32656
|
|
|
32456
|
-
|
|
32457
|
-
|
|
32657
|
+
yield footerBytes;
|
|
32658
|
+
})()
|
|
32659
|
+
);
|
|
32458
32660
|
};
|
|
32459
32661
|
|
|
32460
32662
|
class ZlibHeaderTransformStream extends stream.Transform {
|
|
@@ -32468,10 +32670,11 @@ class ZlibHeaderTransformStream extends stream.Transform {
|
|
|
32468
32670
|
this._transform = this.__transform;
|
|
32469
32671
|
|
|
32470
32672
|
// Add Default Compression headers if no zlib headers are present
|
|
32471
|
-
if (chunk[0] !== 120) {
|
|
32673
|
+
if (chunk[0] !== 120) {
|
|
32674
|
+
// Hex: 78
|
|
32472
32675
|
const header = Buffer.alloc(2);
|
|
32473
32676
|
header[0] = 120; // Hex: 78
|
|
32474
|
-
header[1] = 156; // Hex: 9C
|
|
32677
|
+
header[1] = 156; // Hex: 9C
|
|
32475
32678
|
this.push(header, encoding);
|
|
32476
32679
|
}
|
|
32477
32680
|
}
|
|
@@ -32481,18 +32684,127 @@ class ZlibHeaderTransformStream extends stream.Transform {
|
|
|
32481
32684
|
}
|
|
32482
32685
|
|
|
32483
32686
|
const callbackify = (fn, reducer) => {
|
|
32484
|
-
return utils$1.isAsyncFn(fn)
|
|
32485
|
-
|
|
32486
|
-
|
|
32487
|
-
|
|
32488
|
-
|
|
32489
|
-
|
|
32490
|
-
|
|
32687
|
+
return utils$1.isAsyncFn(fn)
|
|
32688
|
+
? function (...args) {
|
|
32689
|
+
const cb = args.pop();
|
|
32690
|
+
fn.apply(this, args).then((value) => {
|
|
32691
|
+
try {
|
|
32692
|
+
reducer ? cb(null, ...reducer(value)) : cb(null, value);
|
|
32693
|
+
} catch (err) {
|
|
32694
|
+
cb(err);
|
|
32695
|
+
}
|
|
32696
|
+
}, cb);
|
|
32491
32697
|
}
|
|
32492
|
-
|
|
32493
|
-
} : fn;
|
|
32698
|
+
: fn;
|
|
32494
32699
|
};
|
|
32495
32700
|
|
|
32701
|
+
const DEFAULT_PORTS = {
|
|
32702
|
+
http: 80,
|
|
32703
|
+
https: 443,
|
|
32704
|
+
ws: 80,
|
|
32705
|
+
wss: 443,
|
|
32706
|
+
ftp: 21,
|
|
32707
|
+
};
|
|
32708
|
+
|
|
32709
|
+
const parseNoProxyEntry = (entry) => {
|
|
32710
|
+
let entryHost = entry;
|
|
32711
|
+
let entryPort = 0;
|
|
32712
|
+
|
|
32713
|
+
if (entryHost.charAt(0) === '[') {
|
|
32714
|
+
const bracketIndex = entryHost.indexOf(']');
|
|
32715
|
+
|
|
32716
|
+
if (bracketIndex !== -1) {
|
|
32717
|
+
const host = entryHost.slice(1, bracketIndex);
|
|
32718
|
+
const rest = entryHost.slice(bracketIndex + 1);
|
|
32719
|
+
|
|
32720
|
+
if (rest.charAt(0) === ':' && /^\d+$/.test(rest.slice(1))) {
|
|
32721
|
+
entryPort = Number.parseInt(rest.slice(1), 10);
|
|
32722
|
+
}
|
|
32723
|
+
|
|
32724
|
+
return [host, entryPort];
|
|
32725
|
+
}
|
|
32726
|
+
}
|
|
32727
|
+
|
|
32728
|
+
const firstColon = entryHost.indexOf(':');
|
|
32729
|
+
const lastColon = entryHost.lastIndexOf(':');
|
|
32730
|
+
|
|
32731
|
+
if (
|
|
32732
|
+
firstColon !== -1 &&
|
|
32733
|
+
firstColon === lastColon &&
|
|
32734
|
+
/^\d+$/.test(entryHost.slice(lastColon + 1))
|
|
32735
|
+
) {
|
|
32736
|
+
entryPort = Number.parseInt(entryHost.slice(lastColon + 1), 10);
|
|
32737
|
+
entryHost = entryHost.slice(0, lastColon);
|
|
32738
|
+
}
|
|
32739
|
+
|
|
32740
|
+
return [entryHost, entryPort];
|
|
32741
|
+
};
|
|
32742
|
+
|
|
32743
|
+
const normalizeNoProxyHost = (hostname) => {
|
|
32744
|
+
if (!hostname) {
|
|
32745
|
+
return hostname;
|
|
32746
|
+
}
|
|
32747
|
+
|
|
32748
|
+
if (hostname.charAt(0) === '[' && hostname.charAt(hostname.length - 1) === ']') {
|
|
32749
|
+
hostname = hostname.slice(1, -1);
|
|
32750
|
+
}
|
|
32751
|
+
|
|
32752
|
+
return hostname.replace(/\.+$/, '');
|
|
32753
|
+
};
|
|
32754
|
+
|
|
32755
|
+
function shouldBypassProxy(location) {
|
|
32756
|
+
let parsed;
|
|
32757
|
+
|
|
32758
|
+
try {
|
|
32759
|
+
parsed = new URL(location);
|
|
32760
|
+
} catch (_err) {
|
|
32761
|
+
return false;
|
|
32762
|
+
}
|
|
32763
|
+
|
|
32764
|
+
const noProxy = (process.env.no_proxy || process.env.NO_PROXY || '').toLowerCase();
|
|
32765
|
+
|
|
32766
|
+
if (!noProxy) {
|
|
32767
|
+
return false;
|
|
32768
|
+
}
|
|
32769
|
+
|
|
32770
|
+
if (noProxy === '*') {
|
|
32771
|
+
return true;
|
|
32772
|
+
}
|
|
32773
|
+
|
|
32774
|
+
const port =
|
|
32775
|
+
Number.parseInt(parsed.port, 10) || DEFAULT_PORTS[parsed.protocol.split(':', 1)[0]] || 0;
|
|
32776
|
+
|
|
32777
|
+
const hostname = normalizeNoProxyHost(parsed.hostname.toLowerCase());
|
|
32778
|
+
|
|
32779
|
+
return noProxy.split(/[\s,]+/).some((entry) => {
|
|
32780
|
+
if (!entry) {
|
|
32781
|
+
return false;
|
|
32782
|
+
}
|
|
32783
|
+
|
|
32784
|
+
let [entryHost, entryPort] = parseNoProxyEntry(entry);
|
|
32785
|
+
|
|
32786
|
+
entryHost = normalizeNoProxyHost(entryHost);
|
|
32787
|
+
|
|
32788
|
+
if (!entryHost) {
|
|
32789
|
+
return false;
|
|
32790
|
+
}
|
|
32791
|
+
|
|
32792
|
+
if (entryPort && entryPort !== port) {
|
|
32793
|
+
return false;
|
|
32794
|
+
}
|
|
32795
|
+
|
|
32796
|
+
if (entryHost.charAt(0) === '*') {
|
|
32797
|
+
entryHost = entryHost.slice(1);
|
|
32798
|
+
}
|
|
32799
|
+
|
|
32800
|
+
if (entryHost.charAt(0) === '.') {
|
|
32801
|
+
return hostname.endsWith(entryHost);
|
|
32802
|
+
}
|
|
32803
|
+
|
|
32804
|
+
return hostname === entryHost;
|
|
32805
|
+
});
|
|
32806
|
+
}
|
|
32807
|
+
|
|
32496
32808
|
/**
|
|
32497
32809
|
* Calculate data maxRate
|
|
32498
32810
|
* @param {Number} [samplesCount= 10]
|
|
@@ -32541,7 +32853,7 @@ function speedometer(samplesCount, min) {
|
|
|
32541
32853
|
|
|
32542
32854
|
const passed = startedAt && now - startedAt;
|
|
32543
32855
|
|
|
32544
|
-
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
32856
|
+
return passed ? Math.round((bytesCount * 1000) / passed) : undefined;
|
|
32545
32857
|
};
|
|
32546
32858
|
}
|
|
32547
32859
|
|
|
@@ -32570,7 +32882,7 @@ function throttle(fn, freq) {
|
|
|
32570
32882
|
const throttled = (...args) => {
|
|
32571
32883
|
const now = Date.now();
|
|
32572
32884
|
const passed = now - timestamp;
|
|
32573
|
-
if (
|
|
32885
|
+
if (passed >= threshold) {
|
|
32574
32886
|
invoke(args, now);
|
|
32575
32887
|
} else {
|
|
32576
32888
|
lastArgs = args;
|
|
@@ -32592,7 +32904,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
32592
32904
|
let bytesNotified = 0;
|
|
32593
32905
|
const _speedometer = speedometer(50, 250);
|
|
32594
32906
|
|
|
32595
|
-
return throttle(e => {
|
|
32907
|
+
return throttle((e) => {
|
|
32596
32908
|
const loaded = e.loaded;
|
|
32597
32909
|
const total = e.lengthComputable ? e.total : undefined;
|
|
32598
32910
|
const progressBytes = loaded - bytesNotified;
|
|
@@ -32604,13 +32916,13 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
32604
32916
|
const data = {
|
|
32605
32917
|
loaded,
|
|
32606
32918
|
total,
|
|
32607
|
-
progress: total ?
|
|
32919
|
+
progress: total ? loaded / total : undefined,
|
|
32608
32920
|
bytes: progressBytes,
|
|
32609
32921
|
rate: rate ? rate : undefined,
|
|
32610
32922
|
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
32611
32923
|
event: e,
|
|
32612
32924
|
lengthComputable: total != null,
|
|
32613
|
-
[isDownloadStream ? 'download' : 'upload']: true
|
|
32925
|
+
[isDownloadStream ? 'download' : 'upload']: true,
|
|
32614
32926
|
};
|
|
32615
32927
|
|
|
32616
32928
|
listener(data);
|
|
@@ -32620,14 +32932,21 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
32620
32932
|
const progressEventDecorator = (total, throttled) => {
|
|
32621
32933
|
const lengthComputable = total != null;
|
|
32622
32934
|
|
|
32623
|
-
return [
|
|
32624
|
-
|
|
32625
|
-
|
|
32626
|
-
|
|
32627
|
-
|
|
32935
|
+
return [
|
|
32936
|
+
(loaded) =>
|
|
32937
|
+
throttled[0]({
|
|
32938
|
+
lengthComputable,
|
|
32939
|
+
total,
|
|
32940
|
+
loaded,
|
|
32941
|
+
}),
|
|
32942
|
+
throttled[1],
|
|
32943
|
+
];
|
|
32628
32944
|
};
|
|
32629
32945
|
|
|
32630
|
-
const asyncDecorator =
|
|
32946
|
+
const asyncDecorator =
|
|
32947
|
+
(fn) =>
|
|
32948
|
+
(...args) =>
|
|
32949
|
+
utils$1.asap(() => fn(...args));
|
|
32631
32950
|
|
|
32632
32951
|
/**
|
|
32633
32952
|
* Estimate decoded byte length of a data:// URL *without* allocating large buffers.
|
|
@@ -32705,29 +33024,26 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
32705
33024
|
|
|
32706
33025
|
const zlibOptions = {
|
|
32707
33026
|
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
32708
|
-
finishFlush: zlib.constants.Z_SYNC_FLUSH
|
|
33027
|
+
finishFlush: zlib.constants.Z_SYNC_FLUSH,
|
|
32709
33028
|
};
|
|
32710
33029
|
|
|
32711
33030
|
const brotliOptions = {
|
|
32712
33031
|
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
32713
|
-
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
|
|
33032
|
+
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
32714
33033
|
};
|
|
32715
33034
|
|
|
32716
33035
|
const isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
|
|
32717
33036
|
|
|
32718
|
-
const {http: httpFollow, https: httpsFollow} = followRedirects;
|
|
33037
|
+
const { http: httpFollow, https: httpsFollow } = followRedirects;
|
|
32719
33038
|
|
|
32720
33039
|
const isHttps = /https:?/;
|
|
32721
33040
|
|
|
32722
|
-
const supportedProtocols = platform.protocols.map(protocol => {
|
|
33041
|
+
const supportedProtocols = platform.protocols.map((protocol) => {
|
|
32723
33042
|
return protocol + ':';
|
|
32724
33043
|
});
|
|
32725
33044
|
|
|
32726
|
-
|
|
32727
33045
|
const flushOnFinish = (stream, [throttled, flush]) => {
|
|
32728
|
-
stream
|
|
32729
|
-
.on('end', flush)
|
|
32730
|
-
.on('error', flush);
|
|
33046
|
+
stream.on('end', flush).on('error', flush);
|
|
32731
33047
|
|
|
32732
33048
|
return throttled;
|
|
32733
33049
|
};
|
|
@@ -32738,9 +33054,12 @@ class Http2Sessions {
|
|
|
32738
33054
|
}
|
|
32739
33055
|
|
|
32740
33056
|
getSession(authority, options) {
|
|
32741
|
-
options = Object.assign(
|
|
32742
|
-
|
|
32743
|
-
|
|
33057
|
+
options = Object.assign(
|
|
33058
|
+
{
|
|
33059
|
+
sessionTimeout: 1000,
|
|
33060
|
+
},
|
|
33061
|
+
options
|
|
33062
|
+
);
|
|
32744
33063
|
|
|
32745
33064
|
let authoritySessions = this.sessions[authority];
|
|
32746
33065
|
|
|
@@ -32749,7 +33068,11 @@ class Http2Sessions {
|
|
|
32749
33068
|
|
|
32750
33069
|
for (let i = 0; i < len; i++) {
|
|
32751
33070
|
const [sessionHandle, sessionOptions] = authoritySessions[i];
|
|
32752
|
-
if (
|
|
33071
|
+
if (
|
|
33072
|
+
!sessionHandle.destroyed &&
|
|
33073
|
+
!sessionHandle.closed &&
|
|
33074
|
+
util$3.isDeepStrictEqual(sessionOptions, options)
|
|
33075
|
+
) {
|
|
32753
33076
|
return sessionHandle;
|
|
32754
33077
|
}
|
|
32755
33078
|
}
|
|
@@ -32766,7 +33089,9 @@ class Http2Sessions {
|
|
|
32766
33089
|
|
|
32767
33090
|
removed = true;
|
|
32768
33091
|
|
|
32769
|
-
let entries = authoritySessions,
|
|
33092
|
+
let entries = authoritySessions,
|
|
33093
|
+
len = entries.length,
|
|
33094
|
+
i = len;
|
|
32770
33095
|
|
|
32771
33096
|
while (i--) {
|
|
32772
33097
|
if (entries[i][0] === session) {
|
|
@@ -32775,6 +33100,9 @@ class Http2Sessions {
|
|
|
32775
33100
|
} else {
|
|
32776
33101
|
entries.splice(i, 1);
|
|
32777
33102
|
}
|
|
33103
|
+
if (!session.closed) {
|
|
33104
|
+
session.close();
|
|
33105
|
+
}
|
|
32778
33106
|
return;
|
|
32779
33107
|
}
|
|
32780
33108
|
}
|
|
@@ -32782,10 +33110,9 @@ class Http2Sessions {
|
|
|
32782
33110
|
|
|
32783
33111
|
const originalRequestFn = session.request;
|
|
32784
33112
|
|
|
32785
|
-
const {sessionTimeout} = options;
|
|
32786
|
-
|
|
32787
|
-
if(sessionTimeout != null) {
|
|
33113
|
+
const { sessionTimeout } = options;
|
|
32788
33114
|
|
|
33115
|
+
if (sessionTimeout != null) {
|
|
32789
33116
|
let timer;
|
|
32790
33117
|
let streamsCount = 0;
|
|
32791
33118
|
|
|
@@ -32814,12 +33141,11 @@ class Http2Sessions {
|
|
|
32814
33141
|
|
|
32815
33142
|
session.once('close', removeSession);
|
|
32816
33143
|
|
|
32817
|
-
let entry = [
|
|
32818
|
-
session,
|
|
32819
|
-
options
|
|
32820
|
-
];
|
|
33144
|
+
let entry = [session, options];
|
|
32821
33145
|
|
|
32822
|
-
authoritySessions
|
|
33146
|
+
authoritySessions
|
|
33147
|
+
? authoritySessions.push(entry)
|
|
33148
|
+
: (authoritySessions = this.sessions[authority] = [entry]);
|
|
32823
33149
|
|
|
32824
33150
|
return session;
|
|
32825
33151
|
}
|
|
@@ -32827,7 +33153,6 @@ class Http2Sessions {
|
|
|
32827
33153
|
|
|
32828
33154
|
const http2Sessions = new Http2Sessions();
|
|
32829
33155
|
|
|
32830
|
-
|
|
32831
33156
|
/**
|
|
32832
33157
|
* If the proxy or config beforeRedirects functions are defined, call them with the options
|
|
32833
33158
|
* object.
|
|
@@ -32857,9 +33182,11 @@ function dispatchBeforeRedirect(options, responseDetails) {
|
|
|
32857
33182
|
function setProxy(options, configProxy, location) {
|
|
32858
33183
|
let proxy = configProxy;
|
|
32859
33184
|
if (!proxy && proxy !== false) {
|
|
32860
|
-
const proxyUrl =
|
|
33185
|
+
const proxyUrl = getProxyForUrl(location);
|
|
32861
33186
|
if (proxyUrl) {
|
|
32862
|
-
|
|
33187
|
+
if (!shouldBypassProxy(location)) {
|
|
33188
|
+
proxy = new URL(proxyUrl);
|
|
33189
|
+
}
|
|
32863
33190
|
}
|
|
32864
33191
|
}
|
|
32865
33192
|
if (proxy) {
|
|
@@ -32902,7 +33229,8 @@ function setProxy(options, configProxy, location) {
|
|
|
32902
33229
|
};
|
|
32903
33230
|
}
|
|
32904
33231
|
|
|
32905
|
-
const isHttpAdapterSupported =
|
|
33232
|
+
const isHttpAdapterSupported =
|
|
33233
|
+
typeof process !== 'undefined' && utils$1.kindOf(process) === 'process';
|
|
32906
33234
|
|
|
32907
33235
|
// temporary hotfix
|
|
32908
33236
|
|
|
@@ -32928,713 +33256,752 @@ const wrapAsync = (asyncExecutor) => {
|
|
|
32928
33256
|
};
|
|
32929
33257
|
|
|
32930
33258
|
asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
|
|
32931
|
-
})
|
|
33259
|
+
});
|
|
32932
33260
|
};
|
|
32933
33261
|
|
|
32934
|
-
const resolveFamily = ({address, family}) => {
|
|
33262
|
+
const resolveFamily = ({ address, family }) => {
|
|
32935
33263
|
if (!utils$1.isString(address)) {
|
|
32936
33264
|
throw TypeError('address must be a string');
|
|
32937
33265
|
}
|
|
32938
|
-
return
|
|
33266
|
+
return {
|
|
32939
33267
|
address,
|
|
32940
|
-
family: family || (address.indexOf('.') < 0 ? 6 : 4)
|
|
32941
|
-
}
|
|
33268
|
+
family: family || (address.indexOf('.') < 0 ? 6 : 4),
|
|
33269
|
+
};
|
|
32942
33270
|
};
|
|
32943
33271
|
|
|
32944
|
-
const buildAddressEntry = (address, family) =>
|
|
33272
|
+
const buildAddressEntry = (address, family) =>
|
|
33273
|
+
resolveFamily(utils$1.isObject(address) ? address : { address, family });
|
|
32945
33274
|
|
|
32946
33275
|
const http2Transport = {
|
|
32947
33276
|
request(options, cb) {
|
|
32948
|
-
|
|
33277
|
+
const authority =
|
|
33278
|
+
options.protocol +
|
|
33279
|
+
'//' +
|
|
33280
|
+
options.hostname +
|
|
33281
|
+
':' +
|
|
33282
|
+
(options.port || (options.protocol === 'https:' ? 443 : 80));
|
|
32949
33283
|
|
|
33284
|
+
const { http2Options, headers } = options;
|
|
32950
33285
|
|
|
32951
|
-
|
|
33286
|
+
const session = http2Sessions.getSession(authority, http2Options);
|
|
32952
33287
|
|
|
32953
|
-
|
|
33288
|
+
const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } =
|
|
33289
|
+
http2.constants;
|
|
32954
33290
|
|
|
32955
|
-
|
|
32956
|
-
|
|
32957
|
-
|
|
32958
|
-
|
|
32959
|
-
|
|
32960
|
-
} = http2.constants;
|
|
32961
|
-
|
|
32962
|
-
const http2Headers = {
|
|
32963
|
-
[HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
|
|
32964
|
-
[HTTP2_HEADER_METHOD]: options.method,
|
|
32965
|
-
[HTTP2_HEADER_PATH]: options.path,
|
|
32966
|
-
};
|
|
33291
|
+
const http2Headers = {
|
|
33292
|
+
[HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
|
|
33293
|
+
[HTTP2_HEADER_METHOD]: options.method,
|
|
33294
|
+
[HTTP2_HEADER_PATH]: options.path,
|
|
33295
|
+
};
|
|
32967
33296
|
|
|
32968
|
-
|
|
32969
|
-
|
|
32970
|
-
|
|
33297
|
+
utils$1.forEach(headers, (header, name) => {
|
|
33298
|
+
name.charAt(0) !== ':' && (http2Headers[name] = header);
|
|
33299
|
+
});
|
|
32971
33300
|
|
|
32972
|
-
|
|
33301
|
+
const req = session.request(http2Headers);
|
|
32973
33302
|
|
|
32974
|
-
|
|
32975
|
-
|
|
33303
|
+
req.once('response', (responseHeaders) => {
|
|
33304
|
+
const response = req; //duplex
|
|
32976
33305
|
|
|
32977
|
-
|
|
33306
|
+
responseHeaders = Object.assign({}, responseHeaders);
|
|
32978
33307
|
|
|
32979
|
-
|
|
33308
|
+
const status = responseHeaders[HTTP2_HEADER_STATUS];
|
|
32980
33309
|
|
|
32981
|
-
|
|
33310
|
+
delete responseHeaders[HTTP2_HEADER_STATUS];
|
|
32982
33311
|
|
|
32983
|
-
|
|
33312
|
+
response.headers = responseHeaders;
|
|
32984
33313
|
|
|
32985
|
-
|
|
33314
|
+
response.statusCode = +status;
|
|
32986
33315
|
|
|
32987
|
-
|
|
32988
|
-
|
|
33316
|
+
cb(response);
|
|
33317
|
+
});
|
|
32989
33318
|
|
|
32990
|
-
|
|
32991
|
-
}
|
|
33319
|
+
return req;
|
|
33320
|
+
},
|
|
32992
33321
|
};
|
|
32993
33322
|
|
|
32994
33323
|
/*eslint consistent-return:0*/
|
|
32995
|
-
var httpAdapter = isHttpAdapterSupported &&
|
|
32996
|
-
|
|
32997
|
-
|
|
32998
|
-
|
|
32999
|
-
|
|
33000
|
-
|
|
33001
|
-
|
|
33002
|
-
|
|
33324
|
+
var httpAdapter = isHttpAdapterSupported &&
|
|
33325
|
+
function httpAdapter(config) {
|
|
33326
|
+
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
33327
|
+
let { data, lookup, family, httpVersion = 1, http2Options } = config;
|
|
33328
|
+
const { responseType, responseEncoding } = config;
|
|
33329
|
+
const method = config.method.toUpperCase();
|
|
33330
|
+
let isDone;
|
|
33331
|
+
let rejected = false;
|
|
33332
|
+
let req;
|
|
33003
33333
|
|
|
33004
|
-
|
|
33005
|
-
|
|
33006
|
-
if (Number.isNaN(httpVersion)) {
|
|
33007
|
-
throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
|
|
33008
|
-
}
|
|
33009
|
-
|
|
33010
|
-
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
33011
|
-
throw TypeError(`Unsupported protocol version '${httpVersion}'`);
|
|
33012
|
-
}
|
|
33334
|
+
httpVersion = +httpVersion;
|
|
33013
33335
|
|
|
33014
|
-
|
|
33336
|
+
if (Number.isNaN(httpVersion)) {
|
|
33337
|
+
throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
|
|
33338
|
+
}
|
|
33015
33339
|
|
|
33016
|
-
|
|
33017
|
-
|
|
33018
|
-
|
|
33019
|
-
lookup = (hostname, opt, cb) => {
|
|
33020
|
-
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
33021
|
-
if (err) {
|
|
33022
|
-
return cb(err);
|
|
33023
|
-
}
|
|
33340
|
+
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
33341
|
+
throw TypeError(`Unsupported protocol version '${httpVersion}'`);
|
|
33342
|
+
}
|
|
33024
33343
|
|
|
33025
|
-
|
|
33344
|
+
const isHttp2 = httpVersion === 2;
|
|
33026
33345
|
|
|
33027
|
-
|
|
33028
|
-
|
|
33029
|
-
|
|
33030
|
-
|
|
33346
|
+
if (lookup) {
|
|
33347
|
+
const _lookup = callbackify(lookup, (value) => (utils$1.isArray(value) ? value : [value]));
|
|
33348
|
+
// hotfix to support opt.all option which is required for node 20.x
|
|
33349
|
+
lookup = (hostname, opt, cb) => {
|
|
33350
|
+
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
33351
|
+
if (err) {
|
|
33352
|
+
return cb(err);
|
|
33353
|
+
}
|
|
33031
33354
|
|
|
33032
|
-
|
|
33355
|
+
const addresses = utils$1.isArray(arg0)
|
|
33356
|
+
? arg0.map((addr) => buildAddressEntry(addr))
|
|
33357
|
+
: [buildAddressEntry(arg0, arg1)];
|
|
33033
33358
|
|
|
33034
|
-
|
|
33035
|
-
|
|
33036
|
-
|
|
33037
|
-
} catch(err) {
|
|
33038
|
-
console.warn('emit error', err);
|
|
33359
|
+
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
33360
|
+
});
|
|
33361
|
+
};
|
|
33039
33362
|
}
|
|
33040
|
-
}
|
|
33041
33363
|
|
|
33042
|
-
|
|
33364
|
+
const abortEmitter = new EventEmitter$1();
|
|
33043
33365
|
|
|
33044
|
-
|
|
33045
|
-
|
|
33046
|
-
|
|
33366
|
+
function abort(reason) {
|
|
33367
|
+
try {
|
|
33368
|
+
abortEmitter.emit(
|
|
33369
|
+
'abort',
|
|
33370
|
+
!reason || reason.type ? new CanceledError$1(null, config, req) : reason
|
|
33371
|
+
);
|
|
33372
|
+
} catch (err) {
|
|
33373
|
+
console.warn('emit error', err);
|
|
33374
|
+
}
|
|
33047
33375
|
}
|
|
33048
33376
|
|
|
33049
|
-
|
|
33050
|
-
config.signal.removeEventListener('abort', abort);
|
|
33051
|
-
}
|
|
33377
|
+
abortEmitter.once('abort', reject);
|
|
33052
33378
|
|
|
33053
|
-
|
|
33054
|
-
|
|
33379
|
+
const onFinished = () => {
|
|
33380
|
+
if (config.cancelToken) {
|
|
33381
|
+
config.cancelToken.unsubscribe(abort);
|
|
33382
|
+
}
|
|
33055
33383
|
|
|
33056
|
-
|
|
33057
|
-
|
|
33058
|
-
|
|
33059
|
-
config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
|
|
33060
|
-
}
|
|
33061
|
-
}
|
|
33384
|
+
if (config.signal) {
|
|
33385
|
+
config.signal.removeEventListener('abort', abort);
|
|
33386
|
+
}
|
|
33062
33387
|
|
|
33063
|
-
|
|
33064
|
-
|
|
33388
|
+
abortEmitter.removeAllListeners();
|
|
33389
|
+
};
|
|
33065
33390
|
|
|
33066
|
-
if (
|
|
33067
|
-
|
|
33068
|
-
|
|
33069
|
-
|
|
33391
|
+
if (config.cancelToken || config.signal) {
|
|
33392
|
+
config.cancelToken && config.cancelToken.subscribe(abort);
|
|
33393
|
+
if (config.signal) {
|
|
33394
|
+
config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
|
|
33395
|
+
}
|
|
33070
33396
|
}
|
|
33071
33397
|
|
|
33072
|
-
|
|
33398
|
+
onDone((response, isRejected) => {
|
|
33399
|
+
isDone = true;
|
|
33073
33400
|
|
|
33074
|
-
|
|
33075
|
-
|
|
33076
|
-
offListeners();
|
|
33401
|
+
if (isRejected) {
|
|
33402
|
+
rejected = true;
|
|
33077
33403
|
onFinished();
|
|
33078
|
-
|
|
33079
|
-
|
|
33080
|
-
|
|
33081
|
-
|
|
33082
|
-
});
|
|
33404
|
+
return;
|
|
33405
|
+
}
|
|
33406
|
+
|
|
33407
|
+
const { data } = response;
|
|
33083
33408
|
|
|
33409
|
+
if (data instanceof stream.Readable || data instanceof stream.Duplex) {
|
|
33410
|
+
const offListeners = stream.finished(data, () => {
|
|
33411
|
+
offListeners();
|
|
33412
|
+
onFinished();
|
|
33413
|
+
});
|
|
33414
|
+
} else {
|
|
33415
|
+
onFinished();
|
|
33416
|
+
}
|
|
33417
|
+
});
|
|
33084
33418
|
|
|
33419
|
+
// Parse url
|
|
33420
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
33421
|
+
const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
|
|
33422
|
+
const protocol = parsed.protocol || supportedProtocols[0];
|
|
33423
|
+
|
|
33424
|
+
if (protocol === 'data:') {
|
|
33425
|
+
// Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
|
|
33426
|
+
if (config.maxContentLength > -1) {
|
|
33427
|
+
// Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed.
|
|
33428
|
+
const dataUrl = String(config.url || fullPath || '');
|
|
33429
|
+
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
33430
|
+
|
|
33431
|
+
if (estimated > config.maxContentLength) {
|
|
33432
|
+
return reject(
|
|
33433
|
+
new AxiosError$1(
|
|
33434
|
+
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
33435
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
33436
|
+
config
|
|
33437
|
+
)
|
|
33438
|
+
);
|
|
33439
|
+
}
|
|
33440
|
+
}
|
|
33085
33441
|
|
|
33442
|
+
let convertedData;
|
|
33086
33443
|
|
|
33444
|
+
if (method !== 'GET') {
|
|
33445
|
+
return settle(resolve, reject, {
|
|
33446
|
+
status: 405,
|
|
33447
|
+
statusText: 'method not allowed',
|
|
33448
|
+
headers: {},
|
|
33449
|
+
config,
|
|
33450
|
+
});
|
|
33451
|
+
}
|
|
33087
33452
|
|
|
33088
|
-
|
|
33089
|
-
|
|
33090
|
-
|
|
33091
|
-
|
|
33092
|
-
|
|
33093
|
-
|
|
33094
|
-
// Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
|
|
33095
|
-
if (config.maxContentLength > -1) {
|
|
33096
|
-
// Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed.
|
|
33097
|
-
const dataUrl = String(config.url || fullPath || '');
|
|
33098
|
-
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
33099
|
-
|
|
33100
|
-
if (estimated > config.maxContentLength) {
|
|
33101
|
-
return reject(new AxiosError$1(
|
|
33102
|
-
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
33103
|
-
AxiosError$1.ERR_BAD_RESPONSE,
|
|
33104
|
-
config
|
|
33105
|
-
));
|
|
33453
|
+
try {
|
|
33454
|
+
convertedData = fromDataURI(config.url, responseType === 'blob', {
|
|
33455
|
+
Blob: config.env && config.env.Blob,
|
|
33456
|
+
});
|
|
33457
|
+
} catch (err) {
|
|
33458
|
+
throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
|
|
33106
33459
|
}
|
|
33107
|
-
}
|
|
33108
33460
|
|
|
33109
|
-
|
|
33461
|
+
if (responseType === 'text') {
|
|
33462
|
+
convertedData = convertedData.toString(responseEncoding);
|
|
33110
33463
|
|
|
33111
|
-
|
|
33112
|
-
|
|
33113
|
-
|
|
33114
|
-
|
|
33115
|
-
|
|
33116
|
-
|
|
33117
|
-
});
|
|
33118
|
-
}
|
|
33464
|
+
if (!responseEncoding || responseEncoding === 'utf8') {
|
|
33465
|
+
convertedData = utils$1.stripBOM(convertedData);
|
|
33466
|
+
}
|
|
33467
|
+
} else if (responseType === 'stream') {
|
|
33468
|
+
convertedData = stream.Readable.from(convertedData);
|
|
33469
|
+
}
|
|
33119
33470
|
|
|
33120
|
-
|
|
33121
|
-
|
|
33122
|
-
|
|
33471
|
+
return settle(resolve, reject, {
|
|
33472
|
+
data: convertedData,
|
|
33473
|
+
status: 200,
|
|
33474
|
+
statusText: 'OK',
|
|
33475
|
+
headers: new AxiosHeaders$1(),
|
|
33476
|
+
config,
|
|
33123
33477
|
});
|
|
33124
|
-
} catch (err) {
|
|
33125
|
-
throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
|
|
33126
33478
|
}
|
|
33127
33479
|
|
|
33128
|
-
if (
|
|
33129
|
-
|
|
33130
|
-
|
|
33131
|
-
|
|
33132
|
-
convertedData = utils$1.stripBOM(convertedData);
|
|
33133
|
-
}
|
|
33134
|
-
} else if (responseType === 'stream') {
|
|
33135
|
-
convertedData = stream.Readable.from(convertedData);
|
|
33480
|
+
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
33481
|
+
return reject(
|
|
33482
|
+
new AxiosError$1('Unsupported protocol ' + protocol, AxiosError$1.ERR_BAD_REQUEST, config)
|
|
33483
|
+
);
|
|
33136
33484
|
}
|
|
33137
33485
|
|
|
33138
|
-
|
|
33139
|
-
data: convertedData,
|
|
33140
|
-
status: 200,
|
|
33141
|
-
statusText: 'OK',
|
|
33142
|
-
headers: new AxiosHeaders$1(),
|
|
33143
|
-
config
|
|
33144
|
-
});
|
|
33145
|
-
}
|
|
33486
|
+
const headers = AxiosHeaders$1.from(config.headers).normalize();
|
|
33146
33487
|
|
|
33147
|
-
|
|
33148
|
-
|
|
33149
|
-
|
|
33150
|
-
|
|
33151
|
-
|
|
33152
|
-
));
|
|
33153
|
-
}
|
|
33488
|
+
// Set User-Agent (required by some servers)
|
|
33489
|
+
// See https://github.com/axios/axios/issues/69
|
|
33490
|
+
// User-Agent is specified; handle case where no UA header is desired
|
|
33491
|
+
// Only set header if it hasn't been set in config
|
|
33492
|
+
headers.set('User-Agent', 'axios/' + VERSION$1, false);
|
|
33154
33493
|
|
|
33155
|
-
|
|
33494
|
+
const { onUploadProgress, onDownloadProgress } = config;
|
|
33495
|
+
const maxRate = config.maxRate;
|
|
33496
|
+
let maxUploadRate = undefined;
|
|
33497
|
+
let maxDownloadRate = undefined;
|
|
33156
33498
|
|
|
33157
|
-
|
|
33158
|
-
|
|
33159
|
-
|
|
33160
|
-
// Only set header if it hasn't been set in config
|
|
33161
|
-
headers.set('User-Agent', 'axios/' + VERSION$1, false);
|
|
33499
|
+
// support for spec compliant FormData objects
|
|
33500
|
+
if (utils$1.isSpecCompliantForm(data)) {
|
|
33501
|
+
const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
|
|
33162
33502
|
|
|
33163
|
-
|
|
33164
|
-
|
|
33165
|
-
|
|
33166
|
-
|
|
33503
|
+
data = formDataToStream(
|
|
33504
|
+
data,
|
|
33505
|
+
(formHeaders) => {
|
|
33506
|
+
headers.set(formHeaders);
|
|
33507
|
+
},
|
|
33508
|
+
{
|
|
33509
|
+
tag: `axios-${VERSION$1}-boundary`,
|
|
33510
|
+
boundary: (userBoundary && userBoundary[1]) || undefined,
|
|
33511
|
+
}
|
|
33512
|
+
);
|
|
33513
|
+
// support for https://www.npmjs.com/package/form-data api
|
|
33514
|
+
} else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
|
|
33515
|
+
headers.set(data.getHeaders());
|
|
33167
33516
|
|
|
33168
|
-
|
|
33169
|
-
|
|
33170
|
-
|
|
33517
|
+
if (!headers.hasContentLength()) {
|
|
33518
|
+
try {
|
|
33519
|
+
const knownLength = await util$3.promisify(data.getLength).call(data);
|
|
33520
|
+
Number.isFinite(knownLength) &&
|
|
33521
|
+
knownLength >= 0 &&
|
|
33522
|
+
headers.setContentLength(knownLength);
|
|
33523
|
+
/*eslint no-empty:0*/
|
|
33524
|
+
} catch (e) {}
|
|
33525
|
+
}
|
|
33526
|
+
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
33527
|
+
data.size && headers.setContentType(data.type || 'application/octet-stream');
|
|
33528
|
+
headers.setContentLength(data.size || 0);
|
|
33529
|
+
data = stream.Readable.from(readBlob(data));
|
|
33530
|
+
} else if (data && !utils$1.isStream(data)) {
|
|
33531
|
+
if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
|
|
33532
|
+
data = Buffer.from(new Uint8Array(data));
|
|
33533
|
+
} else if (utils$1.isString(data)) {
|
|
33534
|
+
data = Buffer.from(data, 'utf-8');
|
|
33535
|
+
} else {
|
|
33536
|
+
return reject(
|
|
33537
|
+
new AxiosError$1(
|
|
33538
|
+
'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
|
|
33539
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
33540
|
+
config
|
|
33541
|
+
)
|
|
33542
|
+
);
|
|
33543
|
+
}
|
|
33171
33544
|
|
|
33172
|
-
|
|
33173
|
-
headers.
|
|
33174
|
-
}, {
|
|
33175
|
-
tag: `axios-${VERSION$1}-boundary`,
|
|
33176
|
-
boundary: userBoundary && userBoundary[1] || undefined
|
|
33177
|
-
});
|
|
33178
|
-
// support for https://www.npmjs.com/package/form-data api
|
|
33179
|
-
} else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
|
|
33180
|
-
headers.set(data.getHeaders());
|
|
33545
|
+
// Add Content-Length header if data exists
|
|
33546
|
+
headers.setContentLength(data.length, false);
|
|
33181
33547
|
|
|
33182
|
-
|
|
33183
|
-
|
|
33184
|
-
|
|
33185
|
-
|
|
33186
|
-
|
|
33187
|
-
|
|
33548
|
+
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
33549
|
+
return reject(
|
|
33550
|
+
new AxiosError$1(
|
|
33551
|
+
'Request body larger than maxBodyLength limit',
|
|
33552
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
33553
|
+
config
|
|
33554
|
+
)
|
|
33555
|
+
);
|
|
33188
33556
|
}
|
|
33189
33557
|
}
|
|
33190
|
-
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
33191
|
-
data.size && headers.setContentType(data.type || 'application/octet-stream');
|
|
33192
|
-
headers.setContentLength(data.size || 0);
|
|
33193
|
-
data = stream.Readable.from(readBlob(data));
|
|
33194
|
-
} else if (data && !utils$1.isStream(data)) {
|
|
33195
|
-
if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
|
|
33196
|
-
data = Buffer.from(new Uint8Array(data));
|
|
33197
|
-
} else if (utils$1.isString(data)) {
|
|
33198
|
-
data = Buffer.from(data, 'utf-8');
|
|
33199
|
-
} else {
|
|
33200
|
-
return reject(new AxiosError$1(
|
|
33201
|
-
'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
|
|
33202
|
-
AxiosError$1.ERR_BAD_REQUEST,
|
|
33203
|
-
config
|
|
33204
|
-
));
|
|
33205
|
-
}
|
|
33206
33558
|
|
|
33207
|
-
|
|
33208
|
-
headers.setContentLength(data.length, false);
|
|
33559
|
+
const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
|
|
33209
33560
|
|
|
33210
|
-
if (
|
|
33211
|
-
|
|
33212
|
-
|
|
33213
|
-
|
|
33214
|
-
|
|
33215
|
-
));
|
|
33561
|
+
if (utils$1.isArray(maxRate)) {
|
|
33562
|
+
maxUploadRate = maxRate[0];
|
|
33563
|
+
maxDownloadRate = maxRate[1];
|
|
33564
|
+
} else {
|
|
33565
|
+
maxUploadRate = maxDownloadRate = maxRate;
|
|
33216
33566
|
}
|
|
33217
|
-
}
|
|
33218
33567
|
|
|
33219
|
-
|
|
33568
|
+
if (data && (onUploadProgress || maxUploadRate)) {
|
|
33569
|
+
if (!utils$1.isStream(data)) {
|
|
33570
|
+
data = stream.Readable.from(data, { objectMode: false });
|
|
33571
|
+
}
|
|
33220
33572
|
|
|
33221
|
-
|
|
33222
|
-
|
|
33223
|
-
|
|
33224
|
-
|
|
33225
|
-
|
|
33226
|
-
|
|
33573
|
+
data = stream.pipeline(
|
|
33574
|
+
[
|
|
33575
|
+
data,
|
|
33576
|
+
new AxiosTransformStream({
|
|
33577
|
+
maxRate: utils$1.toFiniteNumber(maxUploadRate),
|
|
33578
|
+
}),
|
|
33579
|
+
],
|
|
33580
|
+
utils$1.noop
|
|
33581
|
+
);
|
|
33227
33582
|
|
|
33228
|
-
|
|
33229
|
-
|
|
33230
|
-
|
|
33583
|
+
onUploadProgress &&
|
|
33584
|
+
data.on(
|
|
33585
|
+
'progress',
|
|
33586
|
+
flushOnFinish(
|
|
33587
|
+
data,
|
|
33588
|
+
progressEventDecorator(
|
|
33589
|
+
contentLength,
|
|
33590
|
+
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
33591
|
+
)
|
|
33592
|
+
)
|
|
33593
|
+
);
|
|
33231
33594
|
}
|
|
33232
33595
|
|
|
33233
|
-
|
|
33234
|
-
|
|
33235
|
-
|
|
33236
|
-
|
|
33237
|
-
|
|
33238
|
-
|
|
33239
|
-
|
|
33240
|
-
contentLength,
|
|
33241
|
-
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
33242
|
-
)
|
|
33243
|
-
));
|
|
33244
|
-
}
|
|
33245
|
-
|
|
33246
|
-
// HTTP basic authentication
|
|
33247
|
-
let auth = undefined;
|
|
33248
|
-
if (config.auth) {
|
|
33249
|
-
const username = config.auth.username || '';
|
|
33250
|
-
const password = config.auth.password || '';
|
|
33251
|
-
auth = username + ':' + password;
|
|
33252
|
-
}
|
|
33596
|
+
// HTTP basic authentication
|
|
33597
|
+
let auth = undefined;
|
|
33598
|
+
if (config.auth) {
|
|
33599
|
+
const username = config.auth.username || '';
|
|
33600
|
+
const password = config.auth.password || '';
|
|
33601
|
+
auth = username + ':' + password;
|
|
33602
|
+
}
|
|
33253
33603
|
|
|
33254
|
-
|
|
33255
|
-
|
|
33256
|
-
|
|
33257
|
-
|
|
33258
|
-
|
|
33604
|
+
if (!auth && parsed.username) {
|
|
33605
|
+
const urlUsername = parsed.username;
|
|
33606
|
+
const urlPassword = parsed.password;
|
|
33607
|
+
auth = urlUsername + ':' + urlPassword;
|
|
33608
|
+
}
|
|
33259
33609
|
|
|
33260
|
-
|
|
33610
|
+
auth && headers.delete('authorization');
|
|
33261
33611
|
|
|
33262
|
-
|
|
33612
|
+
let path;
|
|
33263
33613
|
|
|
33264
|
-
|
|
33265
|
-
|
|
33266
|
-
|
|
33267
|
-
|
|
33268
|
-
|
|
33269
|
-
|
|
33270
|
-
|
|
33271
|
-
|
|
33272
|
-
|
|
33273
|
-
|
|
33274
|
-
|
|
33275
|
-
|
|
33276
|
-
|
|
33614
|
+
try {
|
|
33615
|
+
path = buildURL(
|
|
33616
|
+
parsed.pathname + parsed.search,
|
|
33617
|
+
config.params,
|
|
33618
|
+
config.paramsSerializer
|
|
33619
|
+
).replace(/^\?/, '');
|
|
33620
|
+
} catch (err) {
|
|
33621
|
+
const customErr = new Error(err.message);
|
|
33622
|
+
customErr.config = config;
|
|
33623
|
+
customErr.url = config.url;
|
|
33624
|
+
customErr.exists = true;
|
|
33625
|
+
return reject(customErr);
|
|
33626
|
+
}
|
|
33277
33627
|
|
|
33278
|
-
|
|
33279
|
-
|
|
33280
|
-
|
|
33628
|
+
headers.set(
|
|
33629
|
+
'Accept-Encoding',
|
|
33630
|
+
'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''),
|
|
33631
|
+
false
|
|
33281
33632
|
);
|
|
33282
33633
|
|
|
33283
|
-
|
|
33284
|
-
|
|
33285
|
-
|
|
33286
|
-
|
|
33287
|
-
|
|
33288
|
-
|
|
33289
|
-
|
|
33290
|
-
|
|
33291
|
-
|
|
33292
|
-
|
|
33293
|
-
|
|
33294
|
-
|
|
33634
|
+
const options = {
|
|
33635
|
+
path,
|
|
33636
|
+
method: method,
|
|
33637
|
+
headers: headers.toJSON(),
|
|
33638
|
+
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
33639
|
+
auth,
|
|
33640
|
+
protocol,
|
|
33641
|
+
family,
|
|
33642
|
+
beforeRedirect: dispatchBeforeRedirect,
|
|
33643
|
+
beforeRedirects: {},
|
|
33644
|
+
http2Options,
|
|
33645
|
+
};
|
|
33295
33646
|
|
|
33296
|
-
|
|
33297
|
-
|
|
33647
|
+
// cacheable-lookup integration hotfix
|
|
33648
|
+
!utils$1.isUndefined(lookup) && (options.lookup = lookup);
|
|
33298
33649
|
|
|
33299
|
-
|
|
33300
|
-
|
|
33301
|
-
|
|
33302
|
-
|
|
33303
|
-
|
|
33304
|
-
|
|
33305
|
-
|
|
33306
|
-
|
|
33307
|
-
|
|
33308
|
-
|
|
33309
|
-
|
|
33650
|
+
if (config.socketPath) {
|
|
33651
|
+
options.socketPath = config.socketPath;
|
|
33652
|
+
} else {
|
|
33653
|
+
options.hostname = parsed.hostname.startsWith('[')
|
|
33654
|
+
? parsed.hostname.slice(1, -1)
|
|
33655
|
+
: parsed.hostname;
|
|
33656
|
+
options.port = parsed.port;
|
|
33657
|
+
setProxy(
|
|
33658
|
+
options,
|
|
33659
|
+
config.proxy,
|
|
33660
|
+
protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path
|
|
33661
|
+
);
|
|
33662
|
+
}
|
|
33663
|
+
let transport;
|
|
33664
|
+
const isHttpsRequest = isHttps.test(options.protocol);
|
|
33665
|
+
options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
|
|
33310
33666
|
|
|
33311
|
-
|
|
33312
|
-
|
|
33313
|
-
} else {
|
|
33314
|
-
if (config.transport) {
|
|
33315
|
-
transport = config.transport;
|
|
33316
|
-
} else if (config.maxRedirects === 0) {
|
|
33317
|
-
transport = isHttpsRequest ? require$$4$1 : require$$3$1;
|
|
33667
|
+
if (isHttp2) {
|
|
33668
|
+
transport = http2Transport;
|
|
33318
33669
|
} else {
|
|
33319
|
-
if (config.
|
|
33320
|
-
|
|
33321
|
-
}
|
|
33322
|
-
|
|
33323
|
-
|
|
33670
|
+
if (config.transport) {
|
|
33671
|
+
transport = config.transport;
|
|
33672
|
+
} else if (config.maxRedirects === 0) {
|
|
33673
|
+
transport = isHttpsRequest ? require$$4$1 : require$$3$1;
|
|
33674
|
+
} else {
|
|
33675
|
+
if (config.maxRedirects) {
|
|
33676
|
+
options.maxRedirects = config.maxRedirects;
|
|
33677
|
+
}
|
|
33678
|
+
if (config.beforeRedirect) {
|
|
33679
|
+
options.beforeRedirects.config = config.beforeRedirect;
|
|
33680
|
+
}
|
|
33681
|
+
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
33324
33682
|
}
|
|
33325
|
-
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
33326
33683
|
}
|
|
33327
|
-
}
|
|
33328
33684
|
|
|
33329
|
-
|
|
33330
|
-
|
|
33331
|
-
|
|
33332
|
-
|
|
33333
|
-
|
|
33334
|
-
|
|
33335
|
-
|
|
33336
|
-
if (config.insecureHTTPParser) {
|
|
33337
|
-
options.insecureHTTPParser = config.insecureHTTPParser;
|
|
33338
|
-
}
|
|
33339
|
-
|
|
33340
|
-
// Create the request
|
|
33341
|
-
req = transport.request(options, function handleResponse(res) {
|
|
33342
|
-
if (req.destroyed) return;
|
|
33343
|
-
|
|
33344
|
-
const streams = [res];
|
|
33685
|
+
if (config.maxBodyLength > -1) {
|
|
33686
|
+
options.maxBodyLength = config.maxBodyLength;
|
|
33687
|
+
} else {
|
|
33688
|
+
// follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
|
|
33689
|
+
options.maxBodyLength = Infinity;
|
|
33690
|
+
}
|
|
33345
33691
|
|
|
33346
|
-
|
|
33692
|
+
if (config.insecureHTTPParser) {
|
|
33693
|
+
options.insecureHTTPParser = config.insecureHTTPParser;
|
|
33694
|
+
}
|
|
33347
33695
|
|
|
33348
|
-
|
|
33349
|
-
|
|
33350
|
-
|
|
33351
|
-
});
|
|
33696
|
+
// Create the request
|
|
33697
|
+
req = transport.request(options, function handleResponse(res) {
|
|
33698
|
+
if (req.destroyed) return;
|
|
33352
33699
|
|
|
33353
|
-
|
|
33354
|
-
transformStream,
|
|
33355
|
-
progressEventDecorator(
|
|
33356
|
-
responseLength,
|
|
33357
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
33358
|
-
)
|
|
33359
|
-
));
|
|
33700
|
+
const streams = [res];
|
|
33360
33701
|
|
|
33361
|
-
|
|
33362
|
-
}
|
|
33702
|
+
const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
|
|
33363
33703
|
|
|
33364
|
-
|
|
33365
|
-
|
|
33704
|
+
if (onDownloadProgress || maxDownloadRate) {
|
|
33705
|
+
const transformStream = new AxiosTransformStream({
|
|
33706
|
+
maxRate: utils$1.toFiniteNumber(maxDownloadRate),
|
|
33707
|
+
});
|
|
33366
33708
|
|
|
33367
|
-
|
|
33368
|
-
|
|
33709
|
+
onDownloadProgress &&
|
|
33710
|
+
transformStream.on(
|
|
33711
|
+
'progress',
|
|
33712
|
+
flushOnFinish(
|
|
33713
|
+
transformStream,
|
|
33714
|
+
progressEventDecorator(
|
|
33715
|
+
responseLength,
|
|
33716
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
33717
|
+
)
|
|
33718
|
+
)
|
|
33719
|
+
);
|
|
33369
33720
|
|
|
33370
|
-
|
|
33371
|
-
if (config.decompress !== false && res.headers['content-encoding']) {
|
|
33372
|
-
// if no content, but headers still say that it is encoded,
|
|
33373
|
-
// remove the header not confuse downstream operations
|
|
33374
|
-
if (method === 'HEAD' || res.statusCode === 204) {
|
|
33375
|
-
delete res.headers['content-encoding'];
|
|
33721
|
+
streams.push(transformStream);
|
|
33376
33722
|
}
|
|
33377
33723
|
|
|
33378
|
-
|
|
33379
|
-
|
|
33380
|
-
case 'gzip':
|
|
33381
|
-
case 'x-gzip':
|
|
33382
|
-
case 'compress':
|
|
33383
|
-
case 'x-compress':
|
|
33384
|
-
// add the unzipper to the body stream processing pipeline
|
|
33385
|
-
streams.push(zlib.createUnzip(zlibOptions));
|
|
33386
|
-
|
|
33387
|
-
// remove the content-encoding in order to not confuse downstream operations
|
|
33388
|
-
delete res.headers['content-encoding'];
|
|
33389
|
-
break;
|
|
33390
|
-
case 'deflate':
|
|
33391
|
-
streams.push(new ZlibHeaderTransformStream());
|
|
33724
|
+
// decompress the response body transparently if required
|
|
33725
|
+
let responseStream = res;
|
|
33392
33726
|
|
|
33393
|
-
|
|
33394
|
-
|
|
33727
|
+
// return the last request in case of redirects
|
|
33728
|
+
const lastRequest = res.req || req;
|
|
33395
33729
|
|
|
33396
|
-
|
|
33397
|
-
|
|
33398
|
-
|
|
33399
|
-
|
|
33400
|
-
if (
|
|
33401
|
-
streams.push(zlib.createBrotliDecompress(brotliOptions));
|
|
33730
|
+
// if decompress disabled we should not decompress
|
|
33731
|
+
if (config.decompress !== false && res.headers['content-encoding']) {
|
|
33732
|
+
// if no content, but headers still say that it is encoded,
|
|
33733
|
+
// remove the header not confuse downstream operations
|
|
33734
|
+
if (method === 'HEAD' || res.statusCode === 204) {
|
|
33402
33735
|
delete res.headers['content-encoding'];
|
|
33403
33736
|
}
|
|
33737
|
+
|
|
33738
|
+
switch ((res.headers['content-encoding'] || '').toLowerCase()) {
|
|
33739
|
+
/*eslint default-case:0*/
|
|
33740
|
+
case 'gzip':
|
|
33741
|
+
case 'x-gzip':
|
|
33742
|
+
case 'compress':
|
|
33743
|
+
case 'x-compress':
|
|
33744
|
+
// add the unzipper to the body stream processing pipeline
|
|
33745
|
+
streams.push(zlib.createUnzip(zlibOptions));
|
|
33746
|
+
|
|
33747
|
+
// remove the content-encoding in order to not confuse downstream operations
|
|
33748
|
+
delete res.headers['content-encoding'];
|
|
33749
|
+
break;
|
|
33750
|
+
case 'deflate':
|
|
33751
|
+
streams.push(new ZlibHeaderTransformStream());
|
|
33752
|
+
|
|
33753
|
+
// add the unzipper to the body stream processing pipeline
|
|
33754
|
+
streams.push(zlib.createUnzip(zlibOptions));
|
|
33755
|
+
|
|
33756
|
+
// remove the content-encoding in order to not confuse downstream operations
|
|
33757
|
+
delete res.headers['content-encoding'];
|
|
33758
|
+
break;
|
|
33759
|
+
case 'br':
|
|
33760
|
+
if (isBrotliSupported) {
|
|
33761
|
+
streams.push(zlib.createBrotliDecompress(brotliOptions));
|
|
33762
|
+
delete res.headers['content-encoding'];
|
|
33763
|
+
}
|
|
33764
|
+
}
|
|
33404
33765
|
}
|
|
33405
|
-
}
|
|
33406
33766
|
|
|
33407
|
-
|
|
33767
|
+
responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
|
|
33768
|
+
|
|
33769
|
+
const response = {
|
|
33770
|
+
status: res.statusCode,
|
|
33771
|
+
statusText: res.statusMessage,
|
|
33772
|
+
headers: new AxiosHeaders$1(res.headers),
|
|
33773
|
+
config,
|
|
33774
|
+
request: lastRequest,
|
|
33775
|
+
};
|
|
33408
33776
|
|
|
33777
|
+
if (responseType === 'stream') {
|
|
33778
|
+
response.data = responseStream;
|
|
33779
|
+
settle(resolve, reject, response);
|
|
33780
|
+
} else {
|
|
33781
|
+
const responseBuffer = [];
|
|
33782
|
+
let totalResponseBytes = 0;
|
|
33783
|
+
|
|
33784
|
+
responseStream.on('data', function handleStreamData(chunk) {
|
|
33785
|
+
responseBuffer.push(chunk);
|
|
33786
|
+
totalResponseBytes += chunk.length;
|
|
33787
|
+
|
|
33788
|
+
// make sure the content length is not over the maxContentLength if specified
|
|
33789
|
+
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
33790
|
+
// stream.destroy() emit aborted event before calling reject() on Node.js v16
|
|
33791
|
+
rejected = true;
|
|
33792
|
+
responseStream.destroy();
|
|
33793
|
+
abort(
|
|
33794
|
+
new AxiosError$1(
|
|
33795
|
+
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
33796
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
33797
|
+
config,
|
|
33798
|
+
lastRequest
|
|
33799
|
+
)
|
|
33800
|
+
);
|
|
33801
|
+
}
|
|
33802
|
+
});
|
|
33409
33803
|
|
|
33804
|
+
responseStream.on('aborted', function handlerStreamAborted() {
|
|
33805
|
+
if (rejected) {
|
|
33806
|
+
return;
|
|
33807
|
+
}
|
|
33410
33808
|
|
|
33411
|
-
|
|
33412
|
-
|
|
33413
|
-
|
|
33414
|
-
|
|
33415
|
-
|
|
33416
|
-
|
|
33417
|
-
|
|
33809
|
+
const err = new AxiosError$1(
|
|
33810
|
+
'stream has been aborted',
|
|
33811
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
33812
|
+
config,
|
|
33813
|
+
lastRequest
|
|
33814
|
+
);
|
|
33815
|
+
responseStream.destroy(err);
|
|
33816
|
+
reject(err);
|
|
33817
|
+
});
|
|
33418
33818
|
|
|
33419
|
-
|
|
33420
|
-
|
|
33421
|
-
|
|
33422
|
-
|
|
33423
|
-
const responseBuffer = [];
|
|
33424
|
-
let totalResponseBytes = 0;
|
|
33819
|
+
responseStream.on('error', function handleStreamError(err) {
|
|
33820
|
+
if (req.destroyed) return;
|
|
33821
|
+
reject(AxiosError$1.from(err, null, config, lastRequest));
|
|
33822
|
+
});
|
|
33425
33823
|
|
|
33426
|
-
|
|
33427
|
-
|
|
33428
|
-
|
|
33824
|
+
responseStream.on('end', function handleStreamEnd() {
|
|
33825
|
+
try {
|
|
33826
|
+
let responseData =
|
|
33827
|
+
responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
|
|
33828
|
+
if (responseType !== 'arraybuffer') {
|
|
33829
|
+
responseData = responseData.toString(responseEncoding);
|
|
33830
|
+
if (!responseEncoding || responseEncoding === 'utf8') {
|
|
33831
|
+
responseData = utils$1.stripBOM(responseData);
|
|
33832
|
+
}
|
|
33833
|
+
}
|
|
33834
|
+
response.data = responseData;
|
|
33835
|
+
} catch (err) {
|
|
33836
|
+
return reject(AxiosError$1.from(err, null, config, response.request, response));
|
|
33837
|
+
}
|
|
33838
|
+
settle(resolve, reject, response);
|
|
33839
|
+
});
|
|
33840
|
+
}
|
|
33429
33841
|
|
|
33430
|
-
|
|
33431
|
-
if (
|
|
33432
|
-
|
|
33433
|
-
rejected = true;
|
|
33842
|
+
abortEmitter.once('abort', (err) => {
|
|
33843
|
+
if (!responseStream.destroyed) {
|
|
33844
|
+
responseStream.emit('error', err);
|
|
33434
33845
|
responseStream.destroy();
|
|
33435
|
-
abort(new AxiosError$1('maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
33436
|
-
AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest));
|
|
33437
33846
|
}
|
|
33438
33847
|
});
|
|
33848
|
+
});
|
|
33439
33849
|
|
|
33440
|
-
|
|
33441
|
-
|
|
33442
|
-
|
|
33443
|
-
|
|
33850
|
+
abortEmitter.once('abort', (err) => {
|
|
33851
|
+
if (req.close) {
|
|
33852
|
+
req.close();
|
|
33853
|
+
} else {
|
|
33854
|
+
req.destroy(err);
|
|
33855
|
+
}
|
|
33856
|
+
});
|
|
33444
33857
|
|
|
33445
|
-
|
|
33446
|
-
|
|
33447
|
-
|
|
33448
|
-
|
|
33449
|
-
lastRequest
|
|
33450
|
-
);
|
|
33451
|
-
responseStream.destroy(err);
|
|
33452
|
-
reject(err);
|
|
33453
|
-
});
|
|
33858
|
+
// Handle errors
|
|
33859
|
+
req.on('error', function handleRequestError(err) {
|
|
33860
|
+
reject(AxiosError$1.from(err, null, config, req));
|
|
33861
|
+
});
|
|
33454
33862
|
|
|
33455
|
-
|
|
33456
|
-
|
|
33457
|
-
|
|
33458
|
-
|
|
33863
|
+
// set tcp keep alive to prevent drop connection by peer
|
|
33864
|
+
req.on('socket', function handleRequestSocket(socket) {
|
|
33865
|
+
// default interval of sending ack packet is 1 minute
|
|
33866
|
+
socket.setKeepAlive(true, 1000 * 60);
|
|
33867
|
+
});
|
|
33459
33868
|
|
|
33460
|
-
|
|
33461
|
-
|
|
33462
|
-
|
|
33463
|
-
|
|
33464
|
-
|
|
33465
|
-
|
|
33466
|
-
|
|
33467
|
-
|
|
33468
|
-
|
|
33469
|
-
|
|
33470
|
-
|
|
33471
|
-
|
|
33472
|
-
|
|
33473
|
-
|
|
33474
|
-
});
|
|
33475
|
-
}
|
|
33869
|
+
// Handle request timeout
|
|
33870
|
+
if (config.timeout) {
|
|
33871
|
+
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
|
|
33872
|
+
const timeout = parseInt(config.timeout, 10);
|
|
33873
|
+
|
|
33874
|
+
if (Number.isNaN(timeout)) {
|
|
33875
|
+
abort(
|
|
33876
|
+
new AxiosError$1(
|
|
33877
|
+
'error trying to parse `config.timeout` to int',
|
|
33878
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE,
|
|
33879
|
+
config,
|
|
33880
|
+
req
|
|
33881
|
+
)
|
|
33882
|
+
);
|
|
33476
33883
|
|
|
33477
|
-
|
|
33478
|
-
if (!responseStream.destroyed) {
|
|
33479
|
-
responseStream.emit('error', err);
|
|
33480
|
-
responseStream.destroy();
|
|
33884
|
+
return;
|
|
33481
33885
|
}
|
|
33482
|
-
});
|
|
33483
|
-
});
|
|
33484
33886
|
|
|
33485
|
-
|
|
33486
|
-
|
|
33487
|
-
|
|
33887
|
+
// Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
|
|
33888
|
+
// And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
|
|
33889
|
+
// At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
|
|
33890
|
+
// And then these socket which be hang up will devouring CPU little by little.
|
|
33891
|
+
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
|
|
33892
|
+
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
33893
|
+
if (isDone) return;
|
|
33894
|
+
let timeoutErrorMessage = config.timeout
|
|
33895
|
+
? 'timeout of ' + config.timeout + 'ms exceeded'
|
|
33896
|
+
: 'timeout exceeded';
|
|
33897
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
33898
|
+
if (config.timeoutErrorMessage) {
|
|
33899
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
33900
|
+
}
|
|
33901
|
+
abort(
|
|
33902
|
+
new AxiosError$1(
|
|
33903
|
+
timeoutErrorMessage,
|
|
33904
|
+
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
33905
|
+
config,
|
|
33906
|
+
req
|
|
33907
|
+
)
|
|
33908
|
+
);
|
|
33909
|
+
});
|
|
33488
33910
|
} else {
|
|
33489
|
-
|
|
33911
|
+
// explicitly reset the socket timeout value for a possible `keep-alive` request
|
|
33912
|
+
req.setTimeout(0);
|
|
33490
33913
|
}
|
|
33491
|
-
});
|
|
33492
33914
|
|
|
33493
|
-
|
|
33494
|
-
|
|
33495
|
-
|
|
33496
|
-
|
|
33915
|
+
// Send the request
|
|
33916
|
+
if (utils$1.isStream(data)) {
|
|
33917
|
+
let ended = false;
|
|
33918
|
+
let errored = false;
|
|
33497
33919
|
|
|
33498
|
-
|
|
33499
|
-
|
|
33500
|
-
|
|
33501
|
-
socket.setKeepAlive(true, 1000 * 60);
|
|
33502
|
-
});
|
|
33920
|
+
data.on('end', () => {
|
|
33921
|
+
ended = true;
|
|
33922
|
+
});
|
|
33503
33923
|
|
|
33504
|
-
|
|
33505
|
-
|
|
33506
|
-
|
|
33507
|
-
|
|
33924
|
+
data.once('error', (err) => {
|
|
33925
|
+
errored = true;
|
|
33926
|
+
req.destroy(err);
|
|
33927
|
+
});
|
|
33508
33928
|
|
|
33509
|
-
|
|
33510
|
-
|
|
33511
|
-
|
|
33512
|
-
|
|
33513
|
-
|
|
33514
|
-
req
|
|
33515
|
-
));
|
|
33929
|
+
data.on('close', () => {
|
|
33930
|
+
if (!ended && !errored) {
|
|
33931
|
+
abort(new CanceledError$1('Request stream has been aborted', config, req));
|
|
33932
|
+
}
|
|
33933
|
+
});
|
|
33516
33934
|
|
|
33517
|
-
|
|
33935
|
+
data.pipe(req);
|
|
33936
|
+
} else {
|
|
33937
|
+
data && req.write(data);
|
|
33938
|
+
req.end();
|
|
33518
33939
|
}
|
|
33940
|
+
});
|
|
33941
|
+
};
|
|
33519
33942
|
|
|
33520
|
-
|
|
33521
|
-
|
|
33522
|
-
|
|
33523
|
-
// And then these socket which be hang up will devouring CPU little by little.
|
|
33524
|
-
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
|
|
33525
|
-
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
33526
|
-
if (isDone) return;
|
|
33527
|
-
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
33528
|
-
const transitional = config.transitional || transitionalDefaults;
|
|
33529
|
-
if (config.timeoutErrorMessage) {
|
|
33530
|
-
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
33531
|
-
}
|
|
33532
|
-
abort(new AxiosError$1(
|
|
33533
|
-
timeoutErrorMessage,
|
|
33534
|
-
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
33535
|
-
config,
|
|
33536
|
-
req
|
|
33537
|
-
));
|
|
33538
|
-
});
|
|
33539
|
-
} else {
|
|
33540
|
-
// explicitly reset the socket timeout value for a possible `keep-alive` request
|
|
33541
|
-
req.setTimeout(0);
|
|
33542
|
-
}
|
|
33543
|
-
|
|
33544
|
-
|
|
33545
|
-
// Send the request
|
|
33546
|
-
if (utils$1.isStream(data)) {
|
|
33547
|
-
let ended = false;
|
|
33548
|
-
let errored = false;
|
|
33943
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv
|
|
33944
|
+
? ((origin, isMSIE) => (url) => {
|
|
33945
|
+
url = new URL(url, platform.origin);
|
|
33549
33946
|
|
|
33550
|
-
|
|
33551
|
-
|
|
33552
|
-
|
|
33947
|
+
return (
|
|
33948
|
+
origin.protocol === url.protocol &&
|
|
33949
|
+
origin.host === url.host &&
|
|
33950
|
+
(isMSIE || origin.port === url.port)
|
|
33951
|
+
);
|
|
33952
|
+
})(
|
|
33953
|
+
new URL(platform.origin),
|
|
33954
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
33955
|
+
)
|
|
33956
|
+
: () => true;
|
|
33957
|
+
|
|
33958
|
+
var cookies = platform.hasStandardBrowserEnv
|
|
33959
|
+
? // Standard browser envs support document.cookie
|
|
33960
|
+
{
|
|
33961
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
33962
|
+
if (typeof document === 'undefined') return;
|
|
33553
33963
|
|
|
33554
|
-
|
|
33555
|
-
errored = true;
|
|
33556
|
-
req.destroy(err);
|
|
33557
|
-
});
|
|
33964
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
33558
33965
|
|
|
33559
|
-
|
|
33560
|
-
|
|
33561
|
-
|
|
33966
|
+
if (utils$1.isNumber(expires)) {
|
|
33967
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
33968
|
+
}
|
|
33969
|
+
if (utils$1.isString(path)) {
|
|
33970
|
+
cookie.push(`path=${path}`);
|
|
33971
|
+
}
|
|
33972
|
+
if (utils$1.isString(domain)) {
|
|
33973
|
+
cookie.push(`domain=${domain}`);
|
|
33974
|
+
}
|
|
33975
|
+
if (secure === true) {
|
|
33976
|
+
cookie.push('secure');
|
|
33977
|
+
}
|
|
33978
|
+
if (utils$1.isString(sameSite)) {
|
|
33979
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
33562
33980
|
}
|
|
33563
|
-
});
|
|
33564
|
-
|
|
33565
|
-
data.pipe(req);
|
|
33566
|
-
} else {
|
|
33567
|
-
data && req.write(data);
|
|
33568
|
-
req.end();
|
|
33569
|
-
}
|
|
33570
|
-
});
|
|
33571
|
-
};
|
|
33572
|
-
|
|
33573
|
-
var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
|
|
33574
|
-
url = new URL(url, platform.origin);
|
|
33575
|
-
|
|
33576
|
-
return (
|
|
33577
|
-
origin.protocol === url.protocol &&
|
|
33578
|
-
origin.host === url.host &&
|
|
33579
|
-
(isMSIE || origin.port === url.port)
|
|
33580
|
-
);
|
|
33581
|
-
})(
|
|
33582
|
-
new URL(platform.origin),
|
|
33583
|
-
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
33584
|
-
) : () => true;
|
|
33585
|
-
|
|
33586
|
-
var cookies = platform.hasStandardBrowserEnv ?
|
|
33587
|
-
|
|
33588
|
-
// Standard browser envs support document.cookie
|
|
33589
|
-
{
|
|
33590
|
-
write(name, value, expires, path, domain, secure, sameSite) {
|
|
33591
|
-
if (typeof document === 'undefined') return;
|
|
33592
|
-
|
|
33593
|
-
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
33594
|
-
|
|
33595
|
-
if (utils$1.isNumber(expires)) {
|
|
33596
|
-
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
33597
|
-
}
|
|
33598
|
-
if (utils$1.isString(path)) {
|
|
33599
|
-
cookie.push(`path=${path}`);
|
|
33600
|
-
}
|
|
33601
|
-
if (utils$1.isString(domain)) {
|
|
33602
|
-
cookie.push(`domain=${domain}`);
|
|
33603
|
-
}
|
|
33604
|
-
if (secure === true) {
|
|
33605
|
-
cookie.push('secure');
|
|
33606
|
-
}
|
|
33607
|
-
if (utils$1.isString(sameSite)) {
|
|
33608
|
-
cookie.push(`SameSite=${sameSite}`);
|
|
33609
|
-
}
|
|
33610
33981
|
|
|
33611
|
-
|
|
33612
|
-
|
|
33982
|
+
document.cookie = cookie.join('; ');
|
|
33983
|
+
},
|
|
33613
33984
|
|
|
33614
|
-
|
|
33615
|
-
|
|
33616
|
-
|
|
33617
|
-
|
|
33618
|
-
|
|
33985
|
+
read(name) {
|
|
33986
|
+
if (typeof document === 'undefined') return null;
|
|
33987
|
+
const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
|
33988
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
33989
|
+
},
|
|
33619
33990
|
|
|
33620
|
-
|
|
33621
|
-
|
|
33991
|
+
remove(name) {
|
|
33992
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
33993
|
+
},
|
|
33622
33994
|
}
|
|
33623
|
-
|
|
33624
|
-
|
|
33625
|
-
|
|
33626
|
-
|
|
33627
|
-
|
|
33628
|
-
|
|
33629
|
-
|
|
33630
|
-
|
|
33631
|
-
return null;
|
|
33632
|
-
},
|
|
33633
|
-
remove() {}
|
|
33634
|
-
};
|
|
33995
|
+
: // Non-standard browser env (web workers, react-native) lack needed support.
|
|
33996
|
+
{
|
|
33997
|
+
write() {},
|
|
33998
|
+
read() {
|
|
33999
|
+
return null;
|
|
34000
|
+
},
|
|
34001
|
+
remove() {},
|
|
34002
|
+
};
|
|
33635
34003
|
|
|
33636
|
-
const headersToObject = (thing) =>
|
|
33637
|
-
thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
34004
|
+
const headersToObject = (thing) => (thing instanceof AxiosHeaders$1 ? { ...thing } : thing);
|
|
33638
34005
|
|
|
33639
34006
|
/**
|
|
33640
34007
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -33727,23 +34094,12 @@ function mergeConfig$1(config1, config2) {
|
|
|
33727
34094
|
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
33728
34095
|
};
|
|
33729
34096
|
|
|
33730
|
-
utils$1.forEach(
|
|
33731
|
-
|
|
33732
|
-
|
|
33733
|
-
|
|
33734
|
-
|
|
33735
|
-
|
|
33736
|
-
prop === "prototype"
|
|
33737
|
-
)
|
|
33738
|
-
return;
|
|
33739
|
-
const merge = utils$1.hasOwnProp(mergeMap, prop)
|
|
33740
|
-
? mergeMap[prop]
|
|
33741
|
-
: mergeDeepProperties;
|
|
33742
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
|
33743
|
-
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) ||
|
|
33744
|
-
(config[prop] = configValue);
|
|
33745
|
-
},
|
|
33746
|
-
);
|
|
34097
|
+
utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
34098
|
+
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
34099
|
+
const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
34100
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
34101
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
34102
|
+
});
|
|
33747
34103
|
|
|
33748
34104
|
return config;
|
|
33749
34105
|
}
|
|
@@ -33755,12 +34111,22 @@ var resolveConfig = (config) => {
|
|
|
33755
34111
|
|
|
33756
34112
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
33757
34113
|
|
|
33758
|
-
newConfig.url = buildURL(
|
|
34114
|
+
newConfig.url = buildURL(
|
|
34115
|
+
buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls),
|
|
34116
|
+
config.params,
|
|
34117
|
+
config.paramsSerializer
|
|
34118
|
+
);
|
|
33759
34119
|
|
|
33760
34120
|
// HTTP basic authentication
|
|
33761
34121
|
if (auth) {
|
|
33762
|
-
headers.set(
|
|
33763
|
-
|
|
34122
|
+
headers.set(
|
|
34123
|
+
'Authorization',
|
|
34124
|
+
'Basic ' +
|
|
34125
|
+
btoa(
|
|
34126
|
+
(auth.username || '') +
|
|
34127
|
+
':' +
|
|
34128
|
+
(auth.password ? unescape(encodeURIComponent(auth.password)) : '')
|
|
34129
|
+
)
|
|
33764
34130
|
);
|
|
33765
34131
|
}
|
|
33766
34132
|
|
|
@@ -33778,7 +34144,7 @@ var resolveConfig = (config) => {
|
|
|
33778
34144
|
}
|
|
33779
34145
|
});
|
|
33780
34146
|
}
|
|
33781
|
-
}
|
|
34147
|
+
}
|
|
33782
34148
|
|
|
33783
34149
|
// Add xsrf header
|
|
33784
34150
|
// This is only done if running in a standard browser environment.
|
|
@@ -33802,196 +34168,218 @@ var resolveConfig = (config) => {
|
|
|
33802
34168
|
|
|
33803
34169
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
33804
34170
|
|
|
33805
|
-
var xhrAdapter = isXHRAdapterSupported &&
|
|
33806
|
-
|
|
33807
|
-
|
|
33808
|
-
|
|
33809
|
-
|
|
33810
|
-
|
|
33811
|
-
|
|
33812
|
-
|
|
33813
|
-
|
|
34171
|
+
var xhrAdapter = isXHRAdapterSupported &&
|
|
34172
|
+
function (config) {
|
|
34173
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
34174
|
+
const _config = resolveConfig(config);
|
|
34175
|
+
let requestData = _config.data;
|
|
34176
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
34177
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
34178
|
+
let onCanceled;
|
|
34179
|
+
let uploadThrottled, downloadThrottled;
|
|
34180
|
+
let flushUpload, flushDownload;
|
|
33814
34181
|
|
|
33815
|
-
|
|
33816
|
-
|
|
33817
|
-
|
|
34182
|
+
function done() {
|
|
34183
|
+
flushUpload && flushUpload(); // flush events
|
|
34184
|
+
flushDownload && flushDownload(); // flush events
|
|
33818
34185
|
|
|
33819
|
-
|
|
34186
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
33820
34187
|
|
|
33821
|
-
|
|
33822
|
-
|
|
34188
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
34189
|
+
}
|
|
33823
34190
|
|
|
33824
|
-
|
|
34191
|
+
let request = new XMLHttpRequest();
|
|
33825
34192
|
|
|
33826
|
-
|
|
34193
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
33827
34194
|
|
|
33828
|
-
|
|
33829
|
-
|
|
34195
|
+
// Set the request timeout in MS
|
|
34196
|
+
request.timeout = _config.timeout;
|
|
33830
34197
|
|
|
33831
|
-
|
|
33832
|
-
|
|
33833
|
-
|
|
34198
|
+
function onloadend() {
|
|
34199
|
+
if (!request) {
|
|
34200
|
+
return;
|
|
34201
|
+
}
|
|
34202
|
+
// Prepare the response
|
|
34203
|
+
const responseHeaders = AxiosHeaders$1.from(
|
|
34204
|
+
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
34205
|
+
);
|
|
34206
|
+
const responseData =
|
|
34207
|
+
!responseType || responseType === 'text' || responseType === 'json'
|
|
34208
|
+
? request.responseText
|
|
34209
|
+
: request.response;
|
|
34210
|
+
const response = {
|
|
34211
|
+
data: responseData,
|
|
34212
|
+
status: request.status,
|
|
34213
|
+
statusText: request.statusText,
|
|
34214
|
+
headers: responseHeaders,
|
|
34215
|
+
config,
|
|
34216
|
+
request,
|
|
34217
|
+
};
|
|
34218
|
+
|
|
34219
|
+
settle(
|
|
34220
|
+
function _resolve(value) {
|
|
34221
|
+
resolve(value);
|
|
34222
|
+
done();
|
|
34223
|
+
},
|
|
34224
|
+
function _reject(err) {
|
|
34225
|
+
reject(err);
|
|
34226
|
+
done();
|
|
34227
|
+
},
|
|
34228
|
+
response
|
|
34229
|
+
);
|
|
34230
|
+
|
|
34231
|
+
// Clean up request
|
|
34232
|
+
request = null;
|
|
33834
34233
|
}
|
|
33835
|
-
// Prepare the response
|
|
33836
|
-
const responseHeaders = AxiosHeaders$1.from(
|
|
33837
|
-
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
33838
|
-
);
|
|
33839
|
-
const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
33840
|
-
request.responseText : request.response;
|
|
33841
|
-
const response = {
|
|
33842
|
-
data: responseData,
|
|
33843
|
-
status: request.status,
|
|
33844
|
-
statusText: request.statusText,
|
|
33845
|
-
headers: responseHeaders,
|
|
33846
|
-
config,
|
|
33847
|
-
request
|
|
33848
|
-
};
|
|
33849
34234
|
|
|
33850
|
-
|
|
33851
|
-
|
|
33852
|
-
|
|
33853
|
-
}
|
|
33854
|
-
|
|
33855
|
-
|
|
33856
|
-
|
|
34235
|
+
if ('onloadend' in request) {
|
|
34236
|
+
// Use onloadend if available
|
|
34237
|
+
request.onloadend = onloadend;
|
|
34238
|
+
} else {
|
|
34239
|
+
// Listen for ready state to emulate onloadend
|
|
34240
|
+
request.onreadystatechange = function handleLoad() {
|
|
34241
|
+
if (!request || request.readyState !== 4) {
|
|
34242
|
+
return;
|
|
34243
|
+
}
|
|
33857
34244
|
|
|
33858
|
-
|
|
33859
|
-
|
|
33860
|
-
|
|
34245
|
+
// The request errored out and we didn't get a response, this will be
|
|
34246
|
+
// handled by onerror instead
|
|
34247
|
+
// With one exception: request that using file: protocol, most browsers
|
|
34248
|
+
// will return status as 0 even though it's a successful request
|
|
34249
|
+
if (
|
|
34250
|
+
request.status === 0 &&
|
|
34251
|
+
!(request.responseURL && request.responseURL.indexOf('file:') === 0)
|
|
34252
|
+
) {
|
|
34253
|
+
return;
|
|
34254
|
+
}
|
|
34255
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
|
34256
|
+
// so we should call onloadend on the next 'tick'
|
|
34257
|
+
setTimeout(onloadend);
|
|
34258
|
+
};
|
|
34259
|
+
}
|
|
33861
34260
|
|
|
33862
|
-
|
|
33863
|
-
|
|
33864
|
-
|
|
33865
|
-
} else {
|
|
33866
|
-
// Listen for ready state to emulate onloadend
|
|
33867
|
-
request.onreadystatechange = function handleLoad() {
|
|
33868
|
-
if (!request || request.readyState !== 4) {
|
|
34261
|
+
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
34262
|
+
request.onabort = function handleAbort() {
|
|
34263
|
+
if (!request) {
|
|
33869
34264
|
return;
|
|
33870
34265
|
}
|
|
33871
34266
|
|
|
33872
|
-
|
|
33873
|
-
|
|
33874
|
-
//
|
|
33875
|
-
|
|
33876
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
33877
|
-
return;
|
|
33878
|
-
}
|
|
33879
|
-
// readystate handler is calling before onerror or ontimeout handlers,
|
|
33880
|
-
// so we should call onloadend on the next 'tick'
|
|
33881
|
-
setTimeout(onloadend);
|
|
34267
|
+
reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
|
|
34268
|
+
|
|
34269
|
+
// Clean up request
|
|
34270
|
+
request = null;
|
|
33882
34271
|
};
|
|
33883
|
-
}
|
|
33884
34272
|
|
|
33885
|
-
|
|
33886
|
-
|
|
33887
|
-
|
|
33888
|
-
|
|
33889
|
-
|
|
34273
|
+
// Handle low level network errors
|
|
34274
|
+
request.onerror = function handleError(event) {
|
|
34275
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
34276
|
+
// (message may be empty; when present, surface it)
|
|
34277
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
34278
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
34279
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
34280
|
+
// attach the underlying event for consumers who want details
|
|
34281
|
+
err.event = event || null;
|
|
34282
|
+
reject(err);
|
|
34283
|
+
request = null;
|
|
34284
|
+
};
|
|
33890
34285
|
|
|
33891
|
-
|
|
34286
|
+
// Handle timeout
|
|
34287
|
+
request.ontimeout = function handleTimeout() {
|
|
34288
|
+
let timeoutErrorMessage = _config.timeout
|
|
34289
|
+
? 'timeout of ' + _config.timeout + 'ms exceeded'
|
|
34290
|
+
: 'timeout exceeded';
|
|
34291
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
34292
|
+
if (_config.timeoutErrorMessage) {
|
|
34293
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
34294
|
+
}
|
|
34295
|
+
reject(
|
|
34296
|
+
new AxiosError$1(
|
|
34297
|
+
timeoutErrorMessage,
|
|
34298
|
+
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
34299
|
+
config,
|
|
34300
|
+
request
|
|
34301
|
+
)
|
|
34302
|
+
);
|
|
33892
34303
|
|
|
33893
|
-
|
|
33894
|
-
|
|
33895
|
-
|
|
34304
|
+
// Clean up request
|
|
34305
|
+
request = null;
|
|
34306
|
+
};
|
|
33896
34307
|
|
|
33897
|
-
|
|
33898
|
-
|
|
33899
|
-
// Browsers deliver a ProgressEvent in XHR onerror
|
|
33900
|
-
// (message may be empty; when present, surface it)
|
|
33901
|
-
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
33902
|
-
const msg = event && event.message ? event.message : 'Network Error';
|
|
33903
|
-
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
33904
|
-
// attach the underlying event for consumers who want details
|
|
33905
|
-
err.event = event || null;
|
|
33906
|
-
reject(err);
|
|
33907
|
-
request = null;
|
|
33908
|
-
};
|
|
33909
|
-
|
|
33910
|
-
// Handle timeout
|
|
33911
|
-
request.ontimeout = function handleTimeout() {
|
|
33912
|
-
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
33913
|
-
const transitional = _config.transitional || transitionalDefaults;
|
|
33914
|
-
if (_config.timeoutErrorMessage) {
|
|
33915
|
-
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
33916
|
-
}
|
|
33917
|
-
reject(new AxiosError$1(
|
|
33918
|
-
timeoutErrorMessage,
|
|
33919
|
-
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
33920
|
-
config,
|
|
33921
|
-
request));
|
|
33922
|
-
|
|
33923
|
-
// Clean up request
|
|
33924
|
-
request = null;
|
|
33925
|
-
};
|
|
34308
|
+
// Remove Content-Type if data is undefined
|
|
34309
|
+
requestData === undefined && requestHeaders.setContentType(null);
|
|
33926
34310
|
|
|
33927
|
-
|
|
33928
|
-
|
|
34311
|
+
// Add headers to the request
|
|
34312
|
+
if ('setRequestHeader' in request) {
|
|
34313
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
34314
|
+
request.setRequestHeader(key, val);
|
|
34315
|
+
});
|
|
34316
|
+
}
|
|
33929
34317
|
|
|
33930
|
-
|
|
33931
|
-
|
|
33932
|
-
|
|
33933
|
-
|
|
33934
|
-
});
|
|
33935
|
-
}
|
|
34318
|
+
// Add withCredentials to request if needed
|
|
34319
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
34320
|
+
request.withCredentials = !!_config.withCredentials;
|
|
34321
|
+
}
|
|
33936
34322
|
|
|
33937
|
-
|
|
33938
|
-
|
|
33939
|
-
|
|
33940
|
-
|
|
34323
|
+
// Add responseType to request if needed
|
|
34324
|
+
if (responseType && responseType !== 'json') {
|
|
34325
|
+
request.responseType = _config.responseType;
|
|
34326
|
+
}
|
|
33941
34327
|
|
|
33942
|
-
|
|
33943
|
-
|
|
33944
|
-
|
|
33945
|
-
|
|
34328
|
+
// Handle progress if needed
|
|
34329
|
+
if (onDownloadProgress) {
|
|
34330
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
34331
|
+
request.addEventListener('progress', downloadThrottled);
|
|
34332
|
+
}
|
|
33946
34333
|
|
|
33947
|
-
|
|
33948
|
-
|
|
33949
|
-
|
|
33950
|
-
request.addEventListener('progress', downloadThrottled);
|
|
33951
|
-
}
|
|
34334
|
+
// Not all browsers support upload events
|
|
34335
|
+
if (onUploadProgress && request.upload) {
|
|
34336
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
33952
34337
|
|
|
33953
|
-
|
|
33954
|
-
if (onUploadProgress && request.upload) {
|
|
33955
|
-
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
|
34338
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
|
33956
34339
|
|
|
33957
|
-
|
|
34340
|
+
request.upload.addEventListener('loadend', flushUpload);
|
|
34341
|
+
}
|
|
33958
34342
|
|
|
33959
|
-
|
|
33960
|
-
|
|
34343
|
+
if (_config.cancelToken || _config.signal) {
|
|
34344
|
+
// Handle cancellation
|
|
34345
|
+
// eslint-disable-next-line func-names
|
|
34346
|
+
onCanceled = (cancel) => {
|
|
34347
|
+
if (!request) {
|
|
34348
|
+
return;
|
|
34349
|
+
}
|
|
34350
|
+
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
34351
|
+
request.abort();
|
|
34352
|
+
request = null;
|
|
34353
|
+
};
|
|
33961
34354
|
|
|
33962
|
-
|
|
33963
|
-
|
|
33964
|
-
|
|
33965
|
-
|
|
33966
|
-
|
|
33967
|
-
return;
|
|
34355
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
34356
|
+
if (_config.signal) {
|
|
34357
|
+
_config.signal.aborted
|
|
34358
|
+
? onCanceled()
|
|
34359
|
+
: _config.signal.addEventListener('abort', onCanceled);
|
|
33968
34360
|
}
|
|
33969
|
-
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
33970
|
-
request.abort();
|
|
33971
|
-
request = null;
|
|
33972
|
-
};
|
|
33973
|
-
|
|
33974
|
-
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
33975
|
-
if (_config.signal) {
|
|
33976
|
-
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
33977
34361
|
}
|
|
33978
|
-
}
|
|
33979
34362
|
|
|
33980
|
-
|
|
33981
|
-
|
|
33982
|
-
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
33983
|
-
reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
|
|
33984
|
-
return;
|
|
33985
|
-
}
|
|
34363
|
+
const protocol = parseProtocol(_config.url);
|
|
33986
34364
|
|
|
34365
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
34366
|
+
reject(
|
|
34367
|
+
new AxiosError$1(
|
|
34368
|
+
'Unsupported protocol ' + protocol + ':',
|
|
34369
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
34370
|
+
config
|
|
34371
|
+
)
|
|
34372
|
+
);
|
|
34373
|
+
return;
|
|
34374
|
+
}
|
|
33987
34375
|
|
|
33988
|
-
|
|
33989
|
-
|
|
33990
|
-
|
|
33991
|
-
};
|
|
34376
|
+
// Send the request
|
|
34377
|
+
request.send(requestData || null);
|
|
34378
|
+
});
|
|
34379
|
+
};
|
|
33992
34380
|
|
|
33993
34381
|
const composeSignals = (signals, timeout) => {
|
|
33994
|
-
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
|
34382
|
+
const { length } = (signals = signals ? signals.filter(Boolean) : []);
|
|
33995
34383
|
|
|
33996
34384
|
if (timeout || length) {
|
|
33997
34385
|
let controller = new AbortController();
|
|
@@ -34003,21 +34391,29 @@ const composeSignals = (signals, timeout) => {
|
|
|
34003
34391
|
aborted = true;
|
|
34004
34392
|
unsubscribe();
|
|
34005
34393
|
const err = reason instanceof Error ? reason : this.reason;
|
|
34006
|
-
controller.abort(
|
|
34394
|
+
controller.abort(
|
|
34395
|
+
err instanceof AxiosError$1
|
|
34396
|
+
? err
|
|
34397
|
+
: new CanceledError$1(err instanceof Error ? err.message : err)
|
|
34398
|
+
);
|
|
34007
34399
|
}
|
|
34008
34400
|
};
|
|
34009
34401
|
|
|
34010
|
-
let timer =
|
|
34011
|
-
|
|
34012
|
-
|
|
34013
|
-
|
|
34402
|
+
let timer =
|
|
34403
|
+
timeout &&
|
|
34404
|
+
setTimeout(() => {
|
|
34405
|
+
timer = null;
|
|
34406
|
+
onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
34407
|
+
}, timeout);
|
|
34014
34408
|
|
|
34015
34409
|
const unsubscribe = () => {
|
|
34016
34410
|
if (signals) {
|
|
34017
34411
|
timer && clearTimeout(timer);
|
|
34018
34412
|
timer = null;
|
|
34019
|
-
signals.forEach(signal => {
|
|
34020
|
-
signal.unsubscribe
|
|
34413
|
+
signals.forEach((signal) => {
|
|
34414
|
+
signal.unsubscribe
|
|
34415
|
+
? signal.unsubscribe(onabort)
|
|
34416
|
+
: signal.removeEventListener('abort', onabort);
|
|
34021
34417
|
});
|
|
34022
34418
|
signals = null;
|
|
34023
34419
|
}
|
|
@@ -34025,7 +34421,7 @@ const composeSignals = (signals, timeout) => {
|
|
|
34025
34421
|
|
|
34026
34422
|
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
34027
34423
|
|
|
34028
|
-
const {signal} = controller;
|
|
34424
|
+
const { signal } = controller;
|
|
34029
34425
|
|
|
34030
34426
|
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
34031
34427
|
|
|
@@ -34066,7 +34462,7 @@ const readStream = async function* (stream) {
|
|
|
34066
34462
|
const reader = stream.getReader();
|
|
34067
34463
|
try {
|
|
34068
34464
|
for (;;) {
|
|
34069
|
-
const {done, value} = await reader.read();
|
|
34465
|
+
const { done, value } = await reader.read();
|
|
34070
34466
|
if (done) {
|
|
34071
34467
|
break;
|
|
34072
34468
|
}
|
|
@@ -34089,64 +34485,69 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
34089
34485
|
}
|
|
34090
34486
|
};
|
|
34091
34487
|
|
|
34092
|
-
return new ReadableStream(
|
|
34093
|
-
|
|
34094
|
-
|
|
34095
|
-
|
|
34488
|
+
return new ReadableStream(
|
|
34489
|
+
{
|
|
34490
|
+
async pull(controller) {
|
|
34491
|
+
try {
|
|
34492
|
+
const { done, value } = await iterator.next();
|
|
34096
34493
|
|
|
34097
|
-
|
|
34098
|
-
|
|
34099
|
-
|
|
34100
|
-
|
|
34101
|
-
|
|
34494
|
+
if (done) {
|
|
34495
|
+
_onFinish();
|
|
34496
|
+
controller.close();
|
|
34497
|
+
return;
|
|
34498
|
+
}
|
|
34102
34499
|
|
|
34103
|
-
|
|
34104
|
-
|
|
34105
|
-
|
|
34106
|
-
|
|
34500
|
+
let len = value.byteLength;
|
|
34501
|
+
if (onProgress) {
|
|
34502
|
+
let loadedBytes = (bytes += len);
|
|
34503
|
+
onProgress(loadedBytes);
|
|
34504
|
+
}
|
|
34505
|
+
controller.enqueue(new Uint8Array(value));
|
|
34506
|
+
} catch (err) {
|
|
34507
|
+
_onFinish(err);
|
|
34508
|
+
throw err;
|
|
34107
34509
|
}
|
|
34108
|
-
|
|
34109
|
-
|
|
34110
|
-
_onFinish(
|
|
34111
|
-
|
|
34112
|
-
}
|
|
34510
|
+
},
|
|
34511
|
+
cancel(reason) {
|
|
34512
|
+
_onFinish(reason);
|
|
34513
|
+
return iterator.return();
|
|
34514
|
+
},
|
|
34113
34515
|
},
|
|
34114
|
-
|
|
34115
|
-
|
|
34116
|
-
return iterator.return();
|
|
34516
|
+
{
|
|
34517
|
+
highWaterMark: 2,
|
|
34117
34518
|
}
|
|
34118
|
-
|
|
34119
|
-
highWaterMark: 2
|
|
34120
|
-
})
|
|
34519
|
+
);
|
|
34121
34520
|
};
|
|
34122
34521
|
|
|
34123
34522
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
34124
34523
|
|
|
34125
|
-
const {isFunction} = utils$1;
|
|
34524
|
+
const { isFunction } = utils$1;
|
|
34126
34525
|
|
|
34127
|
-
const globalFetchAPI = (({Request, Response}) => ({
|
|
34128
|
-
Request,
|
|
34526
|
+
const globalFetchAPI = (({ Request, Response }) => ({
|
|
34527
|
+
Request,
|
|
34528
|
+
Response,
|
|
34129
34529
|
}))(utils$1.global);
|
|
34130
34530
|
|
|
34131
|
-
const {
|
|
34132
|
-
ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1
|
|
34133
|
-
} = utils$1.global;
|
|
34134
|
-
|
|
34531
|
+
const { ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1 } = utils$1.global;
|
|
34135
34532
|
|
|
34136
34533
|
const test = (fn, ...args) => {
|
|
34137
34534
|
try {
|
|
34138
34535
|
return !!fn(...args);
|
|
34139
34536
|
} catch (e) {
|
|
34140
|
-
return false
|
|
34537
|
+
return false;
|
|
34141
34538
|
}
|
|
34142
34539
|
};
|
|
34143
34540
|
|
|
34144
34541
|
const factory = (env) => {
|
|
34145
|
-
env = utils$1.merge.call(
|
|
34146
|
-
|
|
34147
|
-
|
|
34542
|
+
env = utils$1.merge.call(
|
|
34543
|
+
{
|
|
34544
|
+
skipUndefined: true,
|
|
34545
|
+
},
|
|
34546
|
+
globalFetchAPI,
|
|
34547
|
+
env
|
|
34548
|
+
);
|
|
34148
34549
|
|
|
34149
|
-
const {fetch: envFetch, Request, Response} = env;
|
|
34550
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
34150
34551
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
34151
34552
|
const isRequestSupported = isFunction(Request);
|
|
34152
34553
|
const isResponseSupported = isFunction(Response);
|
|
@@ -34157,46 +34558,65 @@ const factory = (env) => {
|
|
|
34157
34558
|
|
|
34158
34559
|
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
34159
34560
|
|
|
34160
|
-
const encodeText =
|
|
34161
|
-
|
|
34162
|
-
|
|
34163
|
-
|
|
34561
|
+
const encodeText =
|
|
34562
|
+
isFetchSupported &&
|
|
34563
|
+
(typeof TextEncoder$1 === 'function'
|
|
34564
|
+
? (
|
|
34565
|
+
(encoder) => (str) =>
|
|
34566
|
+
encoder.encode(str)
|
|
34567
|
+
)(new TextEncoder$1())
|
|
34568
|
+
: async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
34164
34569
|
|
|
34165
|
-
const supportsRequestStream =
|
|
34166
|
-
|
|
34570
|
+
const supportsRequestStream =
|
|
34571
|
+
isRequestSupported &&
|
|
34572
|
+
isReadableStreamSupported &&
|
|
34573
|
+
test(() => {
|
|
34574
|
+
let duplexAccessed = false;
|
|
34167
34575
|
|
|
34168
|
-
|
|
34169
|
-
body: new ReadableStream$1(),
|
|
34170
|
-
method: 'POST',
|
|
34171
|
-
get duplex() {
|
|
34172
|
-
duplexAccessed = true;
|
|
34173
|
-
return 'half';
|
|
34174
|
-
},
|
|
34175
|
-
}).headers.has('Content-Type');
|
|
34576
|
+
const body = new ReadableStream$1();
|
|
34176
34577
|
|
|
34177
|
-
|
|
34178
|
-
|
|
34578
|
+
const hasContentType = new Request(platform.origin, {
|
|
34579
|
+
body,
|
|
34580
|
+
method: 'POST',
|
|
34581
|
+
get duplex() {
|
|
34582
|
+
duplexAccessed = true;
|
|
34583
|
+
return 'half';
|
|
34584
|
+
},
|
|
34585
|
+
}).headers.has('Content-Type');
|
|
34586
|
+
|
|
34587
|
+
body.cancel();
|
|
34179
34588
|
|
|
34180
|
-
|
|
34589
|
+
return duplexAccessed && !hasContentType;
|
|
34590
|
+
});
|
|
34591
|
+
|
|
34592
|
+
const supportsResponseStream =
|
|
34593
|
+
isResponseSupported &&
|
|
34594
|
+
isReadableStreamSupported &&
|
|
34181
34595
|
test(() => utils$1.isReadableStream(new Response('').body));
|
|
34182
34596
|
|
|
34183
34597
|
const resolvers = {
|
|
34184
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
34598
|
+
stream: supportsResponseStream && ((res) => res.body),
|
|
34185
34599
|
};
|
|
34186
34600
|
|
|
34187
|
-
isFetchSupported &&
|
|
34188
|
-
|
|
34189
|
-
|
|
34190
|
-
|
|
34601
|
+
isFetchSupported &&
|
|
34602
|
+
(() => {
|
|
34603
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
|
|
34604
|
+
!resolvers[type] &&
|
|
34605
|
+
(resolvers[type] = (res, config) => {
|
|
34606
|
+
let method = res && res[type];
|
|
34191
34607
|
|
|
34192
|
-
|
|
34193
|
-
|
|
34194
|
-
|
|
34608
|
+
if (method) {
|
|
34609
|
+
return method.call(res);
|
|
34610
|
+
}
|
|
34195
34611
|
|
|
34196
|
-
|
|
34612
|
+
throw new AxiosError$1(
|
|
34613
|
+
`Response type '${type}' is not supported`,
|
|
34614
|
+
AxiosError$1.ERR_NOT_SUPPORT,
|
|
34615
|
+
config
|
|
34616
|
+
);
|
|
34617
|
+
});
|
|
34197
34618
|
});
|
|
34198
|
-
});
|
|
34199
|
-
})());
|
|
34619
|
+
})();
|
|
34200
34620
|
|
|
34201
34621
|
const getBodyLength = async (body) => {
|
|
34202
34622
|
if (body == null) {
|
|
@@ -34247,32 +34667,41 @@ const factory = (env) => {
|
|
|
34247
34667
|
responseType,
|
|
34248
34668
|
headers,
|
|
34249
34669
|
withCredentials = 'same-origin',
|
|
34250
|
-
fetchOptions
|
|
34670
|
+
fetchOptions,
|
|
34251
34671
|
} = resolveConfig(config);
|
|
34252
34672
|
|
|
34253
34673
|
let _fetch = envFetch || fetch;
|
|
34254
34674
|
|
|
34255
34675
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
34256
34676
|
|
|
34257
|
-
let composedSignal = composeSignals(
|
|
34677
|
+
let composedSignal = composeSignals(
|
|
34678
|
+
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
34679
|
+
timeout
|
|
34680
|
+
);
|
|
34258
34681
|
|
|
34259
34682
|
let request = null;
|
|
34260
34683
|
|
|
34261
|
-
const unsubscribe =
|
|
34262
|
-
composedSignal
|
|
34263
|
-
|
|
34684
|
+
const unsubscribe =
|
|
34685
|
+
composedSignal &&
|
|
34686
|
+
composedSignal.unsubscribe &&
|
|
34687
|
+
(() => {
|
|
34688
|
+
composedSignal.unsubscribe();
|
|
34689
|
+
});
|
|
34264
34690
|
|
|
34265
34691
|
let requestContentLength;
|
|
34266
34692
|
|
|
34267
34693
|
try {
|
|
34268
34694
|
if (
|
|
34269
|
-
onUploadProgress &&
|
|
34695
|
+
onUploadProgress &&
|
|
34696
|
+
supportsRequestStream &&
|
|
34697
|
+
method !== 'get' &&
|
|
34698
|
+
method !== 'head' &&
|
|
34270
34699
|
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
34271
34700
|
) {
|
|
34272
34701
|
let _request = new Request(url, {
|
|
34273
34702
|
method: 'POST',
|
|
34274
34703
|
body: data,
|
|
34275
|
-
duplex:
|
|
34704
|
+
duplex: 'half',
|
|
34276
34705
|
});
|
|
34277
34706
|
|
|
34278
34707
|
let contentTypeHeader;
|
|
@@ -34297,7 +34726,7 @@ const factory = (env) => {
|
|
|
34297
34726
|
|
|
34298
34727
|
// Cloudflare Workers throws when credentials are defined
|
|
34299
34728
|
// see https://github.com/cloudflare/workerd/issues/902
|
|
34300
|
-
const isCredentialsSupported = isRequestSupported &&
|
|
34729
|
+
const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
|
|
34301
34730
|
|
|
34302
34731
|
const resolvedOptions = {
|
|
34303
34732
|
...fetchOptions,
|
|
@@ -34305,29 +34734,35 @@ const factory = (env) => {
|
|
|
34305
34734
|
method: method.toUpperCase(),
|
|
34306
34735
|
headers: headers.normalize().toJSON(),
|
|
34307
34736
|
body: data,
|
|
34308
|
-
duplex:
|
|
34309
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
34737
|
+
duplex: 'half',
|
|
34738
|
+
credentials: isCredentialsSupported ? withCredentials : undefined,
|
|
34310
34739
|
};
|
|
34311
34740
|
|
|
34312
34741
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
34313
34742
|
|
|
34314
|
-
let response = await (isRequestSupported
|
|
34743
|
+
let response = await (isRequestSupported
|
|
34744
|
+
? _fetch(request, fetchOptions)
|
|
34745
|
+
: _fetch(url, resolvedOptions));
|
|
34315
34746
|
|
|
34316
|
-
const isStreamResponse =
|
|
34747
|
+
const isStreamResponse =
|
|
34748
|
+
supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
34317
34749
|
|
|
34318
34750
|
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
34319
34751
|
const options = {};
|
|
34320
34752
|
|
|
34321
|
-
['status', 'statusText', 'headers'].forEach(prop => {
|
|
34753
|
+
['status', 'statusText', 'headers'].forEach((prop) => {
|
|
34322
34754
|
options[prop] = response[prop];
|
|
34323
34755
|
});
|
|
34324
34756
|
|
|
34325
34757
|
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
34326
34758
|
|
|
34327
|
-
const [onProgress, flush] =
|
|
34328
|
-
|
|
34329
|
-
|
|
34330
|
-
|
|
34759
|
+
const [onProgress, flush] =
|
|
34760
|
+
(onDownloadProgress &&
|
|
34761
|
+
progressEventDecorator(
|
|
34762
|
+
responseContentLength,
|
|
34763
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
34764
|
+
)) ||
|
|
34765
|
+
[];
|
|
34331
34766
|
|
|
34332
34767
|
response = new Response(
|
|
34333
34768
|
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
@@ -34340,7 +34775,10 @@ const factory = (env) => {
|
|
|
34340
34775
|
|
|
34341
34776
|
responseType = responseType || 'text';
|
|
34342
34777
|
|
|
34343
|
-
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
34778
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
34779
|
+
response,
|
|
34780
|
+
config
|
|
34781
|
+
);
|
|
34344
34782
|
|
|
34345
34783
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
34346
34784
|
|
|
@@ -34351,43 +34789,50 @@ const factory = (env) => {
|
|
|
34351
34789
|
status: response.status,
|
|
34352
34790
|
statusText: response.statusText,
|
|
34353
34791
|
config,
|
|
34354
|
-
request
|
|
34792
|
+
request,
|
|
34355
34793
|
});
|
|
34356
|
-
})
|
|
34794
|
+
});
|
|
34357
34795
|
} catch (err) {
|
|
34358
34796
|
unsubscribe && unsubscribe();
|
|
34359
34797
|
|
|
34360
34798
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
34361
34799
|
throw Object.assign(
|
|
34362
|
-
new AxiosError$1(
|
|
34800
|
+
new AxiosError$1(
|
|
34801
|
+
'Network Error',
|
|
34802
|
+
AxiosError$1.ERR_NETWORK,
|
|
34803
|
+
config,
|
|
34804
|
+
request,
|
|
34805
|
+
err && err.response
|
|
34806
|
+
),
|
|
34363
34807
|
{
|
|
34364
|
-
cause: err.cause || err
|
|
34808
|
+
cause: err.cause || err,
|
|
34365
34809
|
}
|
|
34366
|
-
)
|
|
34810
|
+
);
|
|
34367
34811
|
}
|
|
34368
34812
|
|
|
34369
34813
|
throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
|
|
34370
34814
|
}
|
|
34371
|
-
}
|
|
34815
|
+
};
|
|
34372
34816
|
};
|
|
34373
34817
|
|
|
34374
34818
|
const seedCache = new Map();
|
|
34375
34819
|
|
|
34376
34820
|
const getFetch = (config) => {
|
|
34377
34821
|
let env = (config && config.env) || {};
|
|
34378
|
-
const {fetch, Request, Response} = env;
|
|
34379
|
-
const seeds = [
|
|
34380
|
-
Request, Response, fetch
|
|
34381
|
-
];
|
|
34822
|
+
const { fetch, Request, Response } = env;
|
|
34823
|
+
const seeds = [Request, Response, fetch];
|
|
34382
34824
|
|
|
34383
|
-
let len = seeds.length,
|
|
34384
|
-
|
|
34825
|
+
let len = seeds.length,
|
|
34826
|
+
i = len,
|
|
34827
|
+
seed,
|
|
34828
|
+
target,
|
|
34829
|
+
map = seedCache;
|
|
34385
34830
|
|
|
34386
34831
|
while (i--) {
|
|
34387
34832
|
seed = seeds[i];
|
|
34388
34833
|
target = map.get(seed);
|
|
34389
34834
|
|
|
34390
|
-
target === undefined && map.set(seed, target =
|
|
34835
|
+
target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
|
|
34391
34836
|
|
|
34392
34837
|
map = target;
|
|
34393
34838
|
}
|
|
@@ -34403,7 +34848,7 @@ getFetch();
|
|
|
34403
34848
|
* - `http` for Node.js
|
|
34404
34849
|
* - `xhr` for browsers
|
|
34405
34850
|
* - `fetch` for fetch API-based requests
|
|
34406
|
-
*
|
|
34851
|
+
*
|
|
34407
34852
|
* @type {Object<string, Function|Object>}
|
|
34408
34853
|
*/
|
|
34409
34854
|
const knownAdapters = {
|
|
@@ -34411,7 +34856,7 @@ const knownAdapters = {
|
|
|
34411
34856
|
xhr: xhrAdapter,
|
|
34412
34857
|
fetch: {
|
|
34413
34858
|
get: getFetch,
|
|
34414
|
-
}
|
|
34859
|
+
},
|
|
34415
34860
|
};
|
|
34416
34861
|
|
|
34417
34862
|
// Assign adapter names for easier debugging and identification
|
|
@@ -34428,7 +34873,7 @@ utils$1.forEach(knownAdapters, (fn, value) => {
|
|
|
34428
34873
|
|
|
34429
34874
|
/**
|
|
34430
34875
|
* Render a rejection reason string for unknown or unsupported adapters
|
|
34431
|
-
*
|
|
34876
|
+
*
|
|
34432
34877
|
* @param {string} reason
|
|
34433
34878
|
* @returns {string}
|
|
34434
34879
|
*/
|
|
@@ -34436,17 +34881,18 @@ const renderReason = (reason) => `- ${reason}`;
|
|
|
34436
34881
|
|
|
34437
34882
|
/**
|
|
34438
34883
|
* Check if the adapter is resolved (function, null, or false)
|
|
34439
|
-
*
|
|
34884
|
+
*
|
|
34440
34885
|
* @param {Function|null|false} adapter
|
|
34441
34886
|
* @returns {boolean}
|
|
34442
34887
|
*/
|
|
34443
|
-
const isResolvedHandle = (adapter) =>
|
|
34888
|
+
const isResolvedHandle = (adapter) =>
|
|
34889
|
+
utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
34444
34890
|
|
|
34445
34891
|
/**
|
|
34446
34892
|
* Get the first suitable adapter from the provided list.
|
|
34447
34893
|
* Tries each adapter in order until a supported one is found.
|
|
34448
34894
|
* Throws an AxiosError if no adapter is suitable.
|
|
34449
|
-
*
|
|
34895
|
+
*
|
|
34450
34896
|
* @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
|
|
34451
34897
|
* @param {Object} config - Axios request configuration
|
|
34452
34898
|
* @throws {AxiosError} If no suitable adapter is available
|
|
@@ -34483,14 +34929,17 @@ function getAdapter$1(adapters, config) {
|
|
|
34483
34929
|
}
|
|
34484
34930
|
|
|
34485
34931
|
if (!adapter) {
|
|
34486
|
-
const reasons = Object.entries(rejectedReasons)
|
|
34487
|
-
|
|
34932
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
34933
|
+
([id, state]) =>
|
|
34934
|
+
`adapter ${id} ` +
|
|
34488
34935
|
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
|
34489
|
-
|
|
34936
|
+
);
|
|
34490
34937
|
|
|
34491
|
-
let s = length
|
|
34492
|
-
|
|
34493
|
-
|
|
34938
|
+
let s = length
|
|
34939
|
+
? reasons.length > 1
|
|
34940
|
+
? 'since :\n' + reasons.map(renderReason).join('\n')
|
|
34941
|
+
: ' ' + renderReason(reasons[0])
|
|
34942
|
+
: 'as no adapter specified';
|
|
34494
34943
|
|
|
34495
34944
|
throw new AxiosError$1(
|
|
34496
34945
|
`There is no suitable adapter to dispatch the request ` + s,
|
|
@@ -34515,7 +34964,7 @@ var adapters = {
|
|
|
34515
34964
|
* Exposes all known adapters
|
|
34516
34965
|
* @type {Object<string, Function|Object>}
|
|
34517
34966
|
*/
|
|
34518
|
-
adapters: knownAdapters
|
|
34967
|
+
adapters: knownAdapters,
|
|
34519
34968
|
};
|
|
34520
34969
|
|
|
34521
34970
|
/**
|
|
@@ -34548,10 +34997,7 @@ function dispatchRequest(config) {
|
|
|
34548
34997
|
config.headers = AxiosHeaders$1.from(config.headers);
|
|
34549
34998
|
|
|
34550
34999
|
// Transform request data
|
|
34551
|
-
config.data = transformData.call(
|
|
34552
|
-
config,
|
|
34553
|
-
config.transformRequest
|
|
34554
|
-
);
|
|
35000
|
+
config.data = transformData.call(config, config.transformRequest);
|
|
34555
35001
|
|
|
34556
35002
|
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
|
34557
35003
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
@@ -34559,36 +35005,35 @@ function dispatchRequest(config) {
|
|
|
34559
35005
|
|
|
34560
35006
|
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
34561
35007
|
|
|
34562
|
-
return adapter(config).then(
|
|
34563
|
-
|
|
35008
|
+
return adapter(config).then(
|
|
35009
|
+
function onAdapterResolution(response) {
|
|
35010
|
+
throwIfCancellationRequested(config);
|
|
34564
35011
|
|
|
34565
|
-
|
|
34566
|
-
|
|
34567
|
-
config,
|
|
34568
|
-
config.transformResponse,
|
|
34569
|
-
response
|
|
34570
|
-
);
|
|
35012
|
+
// Transform response data
|
|
35013
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
34571
35014
|
|
|
34572
|
-
|
|
35015
|
+
response.headers = AxiosHeaders$1.from(response.headers);
|
|
34573
35016
|
|
|
34574
|
-
|
|
34575
|
-
|
|
34576
|
-
|
|
34577
|
-
|
|
35017
|
+
return response;
|
|
35018
|
+
},
|
|
35019
|
+
function onAdapterRejection(reason) {
|
|
35020
|
+
if (!isCancel$1(reason)) {
|
|
35021
|
+
throwIfCancellationRequested(config);
|
|
34578
35022
|
|
|
34579
|
-
|
|
34580
|
-
|
|
34581
|
-
|
|
34582
|
-
|
|
34583
|
-
|
|
34584
|
-
|
|
34585
|
-
|
|
34586
|
-
|
|
35023
|
+
// Transform response data
|
|
35024
|
+
if (reason && reason.response) {
|
|
35025
|
+
reason.response.data = transformData.call(
|
|
35026
|
+
config,
|
|
35027
|
+
config.transformResponse,
|
|
35028
|
+
reason.response
|
|
35029
|
+
);
|
|
35030
|
+
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
35031
|
+
}
|
|
34587
35032
|
}
|
|
34588
|
-
}
|
|
34589
35033
|
|
|
34590
|
-
|
|
34591
|
-
|
|
35034
|
+
return Promise.reject(reason);
|
|
35035
|
+
}
|
|
35036
|
+
);
|
|
34592
35037
|
}
|
|
34593
35038
|
|
|
34594
35039
|
const validators$1 = {};
|
|
@@ -34613,7 +35058,15 @@ const deprecatedWarnings = {};
|
|
|
34613
35058
|
*/
|
|
34614
35059
|
validators$1.transitional = function transitional(validator, version, message) {
|
|
34615
35060
|
function formatMessage(opt, desc) {
|
|
34616
|
-
return
|
|
35061
|
+
return (
|
|
35062
|
+
'[Axios v' +
|
|
35063
|
+
VERSION$1 +
|
|
35064
|
+
"] Transitional option '" +
|
|
35065
|
+
opt +
|
|
35066
|
+
"'" +
|
|
35067
|
+
desc +
|
|
35068
|
+
(message ? '. ' + message : '')
|
|
35069
|
+
);
|
|
34617
35070
|
}
|
|
34618
35071
|
|
|
34619
35072
|
// eslint-disable-next-line func-names
|
|
@@ -34645,7 +35098,7 @@ validators$1.spelling = function spelling(correctSpelling) {
|
|
|
34645
35098
|
// eslint-disable-next-line no-console
|
|
34646
35099
|
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
34647
35100
|
return true;
|
|
34648
|
-
}
|
|
35101
|
+
};
|
|
34649
35102
|
};
|
|
34650
35103
|
|
|
34651
35104
|
/**
|
|
@@ -34671,7 +35124,10 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
34671
35124
|
const value = options[opt];
|
|
34672
35125
|
const result = value === undefined || validator(value, opt, options);
|
|
34673
35126
|
if (result !== true) {
|
|
34674
|
-
throw new AxiosError$1(
|
|
35127
|
+
throw new AxiosError$1(
|
|
35128
|
+
'option ' + opt + ' must be ' + result,
|
|
35129
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE
|
|
35130
|
+
);
|
|
34675
35131
|
}
|
|
34676
35132
|
continue;
|
|
34677
35133
|
}
|
|
@@ -34683,7 +35139,7 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
34683
35139
|
|
|
34684
35140
|
var validator = {
|
|
34685
35141
|
assertOptions,
|
|
34686
|
-
validators: validators$1
|
|
35142
|
+
validators: validators$1,
|
|
34687
35143
|
};
|
|
34688
35144
|
|
|
34689
35145
|
const validators = validator.validators;
|
|
@@ -34700,7 +35156,7 @@ let Axios$1 = class Axios {
|
|
|
34700
35156
|
this.defaults = instanceConfig || {};
|
|
34701
35157
|
this.interceptors = {
|
|
34702
35158
|
request: new InterceptorManager(),
|
|
34703
|
-
response: new InterceptorManager()
|
|
35159
|
+
response: new InterceptorManager(),
|
|
34704
35160
|
};
|
|
34705
35161
|
}
|
|
34706
35162
|
|
|
@@ -34722,13 +35178,29 @@ let Axios$1 = class Axios {
|
|
|
34722
35178
|
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
|
34723
35179
|
|
|
34724
35180
|
// slice off the Error: ... line
|
|
34725
|
-
const stack =
|
|
35181
|
+
const stack = (() => {
|
|
35182
|
+
if (!dummy.stack) {
|
|
35183
|
+
return '';
|
|
35184
|
+
}
|
|
35185
|
+
|
|
35186
|
+
const firstNewlineIndex = dummy.stack.indexOf('\n');
|
|
35187
|
+
|
|
35188
|
+
return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
|
|
35189
|
+
})();
|
|
34726
35190
|
try {
|
|
34727
35191
|
if (!err.stack) {
|
|
34728
35192
|
err.stack = stack;
|
|
34729
35193
|
// match without the 2 top stack lines
|
|
34730
|
-
} else if (stack
|
|
34731
|
-
|
|
35194
|
+
} else if (stack) {
|
|
35195
|
+
const firstNewlineIndex = stack.indexOf('\n');
|
|
35196
|
+
const secondNewlineIndex =
|
|
35197
|
+
firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
|
|
35198
|
+
const stackWithoutTwoTopLines =
|
|
35199
|
+
secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
|
|
35200
|
+
|
|
35201
|
+
if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
|
|
35202
|
+
err.stack += '\n' + stack;
|
|
35203
|
+
}
|
|
34732
35204
|
}
|
|
34733
35205
|
} catch (e) {
|
|
34734
35206
|
// ignore the case where "stack" is an un-writable property
|
|
@@ -34751,27 +35223,35 @@ let Axios$1 = class Axios {
|
|
|
34751
35223
|
|
|
34752
35224
|
config = mergeConfig$1(this.defaults, config);
|
|
34753
35225
|
|
|
34754
|
-
const {transitional, paramsSerializer, headers} = config;
|
|
35226
|
+
const { transitional, paramsSerializer, headers } = config;
|
|
34755
35227
|
|
|
34756
35228
|
if (transitional !== undefined) {
|
|
34757
|
-
validator.assertOptions(
|
|
34758
|
-
|
|
34759
|
-
|
|
34760
|
-
|
|
34761
|
-
|
|
34762
|
-
|
|
35229
|
+
validator.assertOptions(
|
|
35230
|
+
transitional,
|
|
35231
|
+
{
|
|
35232
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
35233
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
35234
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
35235
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
|
|
35236
|
+
},
|
|
35237
|
+
false
|
|
35238
|
+
);
|
|
34763
35239
|
}
|
|
34764
35240
|
|
|
34765
35241
|
if (paramsSerializer != null) {
|
|
34766
35242
|
if (utils$1.isFunction(paramsSerializer)) {
|
|
34767
35243
|
config.paramsSerializer = {
|
|
34768
|
-
serialize: paramsSerializer
|
|
35244
|
+
serialize: paramsSerializer,
|
|
34769
35245
|
};
|
|
34770
35246
|
} else {
|
|
34771
|
-
validator.assertOptions(
|
|
34772
|
-
|
|
34773
|
-
|
|
34774
|
-
|
|
35247
|
+
validator.assertOptions(
|
|
35248
|
+
paramsSerializer,
|
|
35249
|
+
{
|
|
35250
|
+
encode: validators.function,
|
|
35251
|
+
serialize: validators.function,
|
|
35252
|
+
},
|
|
35253
|
+
true
|
|
35254
|
+
);
|
|
34775
35255
|
}
|
|
34776
35256
|
}
|
|
34777
35257
|
|
|
@@ -34782,26 +35262,25 @@ let Axios$1 = class Axios {
|
|
|
34782
35262
|
config.allowAbsoluteUrls = true;
|
|
34783
35263
|
}
|
|
34784
35264
|
|
|
34785
|
-
validator.assertOptions(
|
|
34786
|
-
|
|
34787
|
-
|
|
34788
|
-
|
|
35265
|
+
validator.assertOptions(
|
|
35266
|
+
config,
|
|
35267
|
+
{
|
|
35268
|
+
baseUrl: validators.spelling('baseURL'),
|
|
35269
|
+
withXsrfToken: validators.spelling('withXSRFToken'),
|
|
35270
|
+
},
|
|
35271
|
+
true
|
|
35272
|
+
);
|
|
34789
35273
|
|
|
34790
35274
|
// Set config.method
|
|
34791
35275
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
34792
35276
|
|
|
34793
35277
|
// Flatten headers
|
|
34794
|
-
let contextHeaders = headers && utils$1.merge(
|
|
34795
|
-
headers.common,
|
|
34796
|
-
headers[config.method]
|
|
34797
|
-
);
|
|
35278
|
+
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
34798
35279
|
|
|
34799
|
-
headers &&
|
|
34800
|
-
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
34801
|
-
(method) => {
|
|
35280
|
+
headers &&
|
|
35281
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
|
|
34802
35282
|
delete headers[method];
|
|
34803
|
-
}
|
|
34804
|
-
);
|
|
35283
|
+
});
|
|
34805
35284
|
|
|
34806
35285
|
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
34807
35286
|
|
|
@@ -34816,7 +35295,8 @@ let Axios$1 = class Axios {
|
|
|
34816
35295
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
34817
35296
|
|
|
34818
35297
|
const transitional = config.transitional || transitionalDefaults;
|
|
34819
|
-
const legacyInterceptorReqResOrdering =
|
|
35298
|
+
const legacyInterceptorReqResOrdering =
|
|
35299
|
+
transitional && transitional.legacyInterceptorReqResOrdering;
|
|
34820
35300
|
|
|
34821
35301
|
if (legacyInterceptorReqResOrdering) {
|
|
34822
35302
|
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
@@ -34890,28 +35370,32 @@ let Axios$1 = class Axios {
|
|
|
34890
35370
|
// Provide aliases for supported request methods
|
|
34891
35371
|
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
34892
35372
|
/*eslint func-names:0*/
|
|
34893
|
-
Axios$1.prototype[method] = function(url, config) {
|
|
34894
|
-
return this.request(
|
|
34895
|
-
|
|
34896
|
-
|
|
34897
|
-
|
|
34898
|
-
|
|
35373
|
+
Axios$1.prototype[method] = function (url, config) {
|
|
35374
|
+
return this.request(
|
|
35375
|
+
mergeConfig$1(config || {}, {
|
|
35376
|
+
method,
|
|
35377
|
+
url,
|
|
35378
|
+
data: (config || {}).data,
|
|
35379
|
+
})
|
|
35380
|
+
);
|
|
34899
35381
|
};
|
|
34900
35382
|
});
|
|
34901
35383
|
|
|
34902
35384
|
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
34903
|
-
/*eslint func-names:0*/
|
|
34904
|
-
|
|
34905
35385
|
function generateHTTPMethod(isForm) {
|
|
34906
35386
|
return function httpMethod(url, data, config) {
|
|
34907
|
-
return this.request(
|
|
34908
|
-
|
|
34909
|
-
|
|
34910
|
-
|
|
34911
|
-
|
|
34912
|
-
|
|
34913
|
-
|
|
34914
|
-
|
|
35387
|
+
return this.request(
|
|
35388
|
+
mergeConfig$1(config || {}, {
|
|
35389
|
+
method,
|
|
35390
|
+
headers: isForm
|
|
35391
|
+
? {
|
|
35392
|
+
'Content-Type': 'multipart/form-data',
|
|
35393
|
+
}
|
|
35394
|
+
: {},
|
|
35395
|
+
url,
|
|
35396
|
+
data,
|
|
35397
|
+
})
|
|
35398
|
+
);
|
|
34915
35399
|
};
|
|
34916
35400
|
}
|
|
34917
35401
|
|
|
@@ -34942,7 +35426,7 @@ let CancelToken$1 = class CancelToken {
|
|
|
34942
35426
|
const token = this;
|
|
34943
35427
|
|
|
34944
35428
|
// eslint-disable-next-line func-names
|
|
34945
|
-
this.promise.then(cancel => {
|
|
35429
|
+
this.promise.then((cancel) => {
|
|
34946
35430
|
if (!token._listeners) return;
|
|
34947
35431
|
|
|
34948
35432
|
let i = token._listeners.length;
|
|
@@ -34954,10 +35438,10 @@ let CancelToken$1 = class CancelToken {
|
|
|
34954
35438
|
});
|
|
34955
35439
|
|
|
34956
35440
|
// eslint-disable-next-line func-names
|
|
34957
|
-
this.promise.then = onfulfilled => {
|
|
35441
|
+
this.promise.then = (onfulfilled) => {
|
|
34958
35442
|
let _resolve;
|
|
34959
35443
|
// eslint-disable-next-line func-names
|
|
34960
|
-
const promise = new Promise(resolve => {
|
|
35444
|
+
const promise = new Promise((resolve) => {
|
|
34961
35445
|
token.subscribe(resolve);
|
|
34962
35446
|
_resolve = resolve;
|
|
34963
35447
|
}).then(onfulfilled);
|
|
@@ -35045,7 +35529,7 @@ let CancelToken$1 = class CancelToken {
|
|
|
35045
35529
|
});
|
|
35046
35530
|
return {
|
|
35047
35531
|
token,
|
|
35048
|
-
cancel
|
|
35532
|
+
cancel,
|
|
35049
35533
|
};
|
|
35050
35534
|
}
|
|
35051
35535
|
};
|
|
@@ -35085,7 +35569,7 @@ function spread$1(callback) {
|
|
|
35085
35569
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
35086
35570
|
*/
|
|
35087
35571
|
function isAxiosError$1(payload) {
|
|
35088
|
-
return utils$1.isObject(payload) &&
|
|
35572
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
35089
35573
|
}
|
|
35090
35574
|
|
|
35091
35575
|
const HttpStatusCode$1 = {
|
|
@@ -35176,10 +35660,10 @@ function createInstance(defaultConfig) {
|
|
|
35176
35660
|
const instance = bind$2(Axios$1.prototype.request, context);
|
|
35177
35661
|
|
|
35178
35662
|
// Copy axios.prototype to instance
|
|
35179
|
-
utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
|
35663
|
+
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
35180
35664
|
|
|
35181
35665
|
// Copy context to instance
|
|
35182
|
-
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
|
35666
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
35183
35667
|
|
|
35184
35668
|
// Factory for creating new instances
|
|
35185
35669
|
instance.create = function create(instanceConfig) {
|
|
@@ -35223,7 +35707,7 @@ axios.mergeConfig = mergeConfig$1;
|
|
|
35223
35707
|
|
|
35224
35708
|
axios.AxiosHeaders = AxiosHeaders$1;
|
|
35225
35709
|
|
|
35226
|
-
axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
35710
|
+
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
35227
35711
|
|
|
35228
35712
|
axios.getAdapter = adapters.getAdapter;
|
|
35229
35713
|
|
|
@@ -35250,7 +35734,7 @@ const {
|
|
|
35250
35734
|
HttpStatusCode,
|
|
35251
35735
|
formToJSON,
|
|
35252
35736
|
getAdapter,
|
|
35253
|
-
mergeConfig
|
|
35737
|
+
mergeConfig,
|
|
35254
35738
|
} = axios;
|
|
35255
35739
|
|
|
35256
35740
|
path$2.resolve("./package.json");
|