@itcase/ui 1.9.72 → 1.9.73
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/{Avatar_cjs_RLDhG_yp.js → Avatar_cjs_DzHVjvS7.js} +2 -2
- package/dist/{Avatar_es_C3EWFMqx.js → Avatar_es_DT90hDx2.js} +2 -2
- package/dist/{Button_cjs_PkMuJ9DO.js → Button_cjs_BRuxcSph.js} +2 -2
- package/dist/{Button_es_Bc-ZxgQj.js → Button_es_CyZy_s7U.js} +2 -2
- package/dist/{ChipsGroup_cjs_B2ZlA6eW.js → ChipsGroup_cjs_BHWN4JnI.js} +1 -1
- package/dist/{ChipsGroup_es_RmxQO3xO.js → ChipsGroup_es_BwAnAj_g.js} +1 -1
- package/dist/{DatePicker_cjs_BICCxCBy.js → DatePicker_cjs_DKgk6CEH.js} +4 -4
- package/dist/{DatePicker_es_CjMN5FY_.js → DatePicker_es_D1Djdtw0.js} +4 -4
- package/dist/{Group_cjs_DnhjMBbG.js → Group_cjs_D3Vcfu56.js} +1 -1
- package/dist/{Group_es_xcelocLg.js → Group_es_Bkzb9-kE.js} +1 -1
- package/dist/{Image_cjs_DWpR9AaJ.js → Image_cjs_NKrFIeit.js} +1 -1
- package/dist/{Image_es_mAIAmL6i.js → Image_es_Bk5tFxP2.js} +1 -1
- package/dist/{Input_cjs_BFNo6gwu.js → Input_cjs_B-2x-wi5.js} +1 -1
- package/dist/{Input_es_CWDd4ALJ.js → Input_es_C7mbiaA5.js} +1 -1
- package/dist/{Label_cjs_DTzXRcqq.js → Label_cjs_bihYjSd_.js} +2 -1
- package/dist/{Label_es_DaOAzZqj.js → Label_es_CD4vmexu.js} +2 -1
- package/dist/{Loader_cjs_rE9OZ75z.js → Loader_cjs_Ba1FJg3e.js} +1 -1
- package/dist/{Loader_es_VyygDcXJ.js → Loader_es_BPfKELUA.js} +1 -1
- package/dist/{Overlay_cjs_30v9WTGR.js → Overlay_cjs_CX6qxDFr.js} +1 -1
- package/dist/{Overlay_es_CnYxRbhB.js → Overlay_es_Cv_RvDFl.js} +1 -1
- package/dist/{SelectContainer_cjs_FvhilokK.js → SelectContainer_cjs_Dl2PK3-x.js} +3 -3
- package/dist/{SelectContainer_es_DFy6rr8f.js → SelectContainer_es_CzFeKrsC.js} +3 -3
- package/dist/cjs/components/Accordion.js +2 -1
- package/dist/cjs/components/Avatar.js +4 -3
- package/dist/cjs/components/AvatarStack.js +5 -4
- package/dist/cjs/components/Badge.js +2 -1
- package/dist/cjs/components/Breadcrumbs.js +2 -1
- package/dist/cjs/components/Button.js +4 -3
- package/dist/cjs/components/Cell.js +3 -2
- package/dist/cjs/components/Checkbox.js +2 -1
- package/dist/cjs/components/Checkmark.js +2 -1
- package/dist/cjs/components/Chips.js +3 -2
- package/dist/cjs/components/Choice.js +3 -2
- package/dist/cjs/components/Code.js +2 -1
- package/dist/cjs/components/CookiesWarning.js +4 -3
- package/dist/cjs/components/Dadata.js +3 -2
- package/dist/cjs/components/DatePeriod.js +10 -9
- package/dist/cjs/components/DatePicker.js +7 -6
- package/dist/cjs/components/Divider.js +2 -1
- package/dist/cjs/components/Dot.js +2 -1
- package/dist/cjs/components/Drawer.js +2 -1
- package/dist/cjs/components/Dropdown.js +2 -1
- package/dist/cjs/components/Dropzone.js +5 -3
- package/dist/cjs/components/Flex.js +2 -1
- package/dist/cjs/components/Grid.js +2 -1
- package/dist/cjs/components/Group.js +3 -2
- package/dist/cjs/components/HTMLContent.js +2 -1
- package/dist/cjs/components/HeroTitle.js +2 -1
- package/dist/cjs/components/Icon.js +2 -1
- package/dist/cjs/components/Image.js +3 -2
- package/dist/cjs/components/Input.js +3 -2
- package/dist/cjs/components/InputNumber.js +4 -3
- package/dist/cjs/components/InputPassword.js +2 -1
- package/dist/cjs/components/Label.js +3 -2
- package/dist/cjs/components/Link.js +2 -1
- package/dist/cjs/components/List.js +2 -1
- package/dist/cjs/components/Loader.js +3 -2
- package/dist/cjs/components/Logo.js +2 -1
- package/dist/cjs/components/MenuItem.js +15 -25
- package/dist/cjs/components/Modal.js +4 -3
- package/dist/cjs/components/ModalSheetBottom.js +2 -1
- package/dist/cjs/components/Notification.js +4 -3
- package/dist/cjs/components/Overlay.js +3 -2
- package/dist/cjs/components/Pagination.js +2 -1
- package/dist/cjs/components/Radio.js +2 -1
- package/dist/cjs/components/RangeSlider.js +2 -1
- package/dist/cjs/components/Response.js +5 -4
- package/dist/cjs/components/SVGContent.js +2 -1
- package/dist/cjs/components/ScrollOnDrag.js +2 -1
- package/dist/cjs/components/ScrollToView.js +2 -1
- package/dist/cjs/components/Search.js +2 -1
- package/dist/cjs/components/Segmented.js +2 -1
- package/dist/cjs/components/Select.js +5 -4
- package/dist/cjs/components/Swiper.js +3 -2
- package/dist/cjs/components/Switch.js +2 -1
- package/dist/cjs/components/Tab.js +2 -1
- package/dist/cjs/components/Text.js +2 -1
- package/dist/cjs/components/Textarea.js +2 -1
- package/dist/cjs/components/Tile.js +2 -1
- package/dist/cjs/components/Title.js +2 -1
- package/dist/cjs/components/Tooltip.js +3 -1
- package/dist/cjs/components/Video.js +2 -1
- package/dist/cjs/components/Warning.js +2 -1
- package/dist/cjs/context/Notifications.js +2 -1
- package/dist/cjs/context/UIContext.js +2 -1
- package/dist/cjs/context/UrlAssetPrefix.js +2 -1
- package/dist/cjs/hoc/urlWithAssetPrefix.js +2 -1
- package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +2 -1
- package/dist/cjs/hooks/useAppearanceConfig.js +2 -1
- package/dist/cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +2 -1
- package/dist/cjs/hooks/useDevicePropsGenerator.js +2 -1
- package/dist/cjs/hooks/useDeviceTargetClass.js +2 -1
- package/dist/cjs/hooks/useDropzoneFieldFiles.js +1834 -1379
- package/dist/cjs/hooks/useMediaQueries/useMediaQueries.js +2 -1
- package/dist/cjs/hooks/useMediaQueries.js +2 -1
- package/dist/cjs/hooks/useStyles/styleAttributes.js +2 -1
- package/dist/cjs/hooks/useStyles/useStyles.js +2 -1
- package/dist/cjs/hooks/useStyles.js +2 -1
- package/dist/cjs/hooks.js +2 -1
- package/dist/cjs/utils/mergeAppearanceKeys.js +2 -1
- package/dist/cjs/utils/setViewportProperty.js +2 -1
- package/dist/cjs/utils.js +2 -1
- package/dist/components/Accordion.js +2 -1
- package/dist/components/Avatar.js +4 -3
- package/dist/components/AvatarStack.js +5 -4
- package/dist/components/Badge.js +2 -1
- package/dist/components/Breadcrumbs.js +2 -1
- package/dist/components/Button.js +4 -3
- package/dist/components/Cell.js +3 -2
- package/dist/components/Checkbox.js +2 -1
- package/dist/components/Checkmark.js +2 -1
- package/dist/components/Chips.js +3 -2
- package/dist/components/Choice.js +3 -2
- package/dist/components/Code.js +2 -1
- package/dist/components/CookiesWarning.js +4 -3
- package/dist/components/Dadata.js +3 -2
- package/dist/components/DatePeriod.js +10 -9
- package/dist/components/DatePicker.js +7 -6
- package/dist/components/Divider.js +2 -1
- package/dist/components/Dot.js +2 -1
- package/dist/components/Drawer.js +2 -1
- package/dist/components/Dropdown.js +2 -1
- package/dist/components/Dropzone.js +5 -3
- package/dist/components/Flex.js +2 -1
- package/dist/components/Grid.js +2 -1
- package/dist/components/Group.js +3 -2
- package/dist/components/HTMLContent.js +2 -1
- package/dist/components/HeroTitle.js +2 -1
- package/dist/components/Icon.js +2 -1
- package/dist/components/Image.js +3 -2
- package/dist/components/Input.js +3 -2
- package/dist/components/InputNumber.js +4 -3
- package/dist/components/InputPassword.js +2 -1
- package/dist/components/Label.js +3 -2
- package/dist/components/Link.js +2 -1
- package/dist/components/List.js +2 -1
- package/dist/components/Loader.js +3 -2
- package/dist/components/Logo.js +2 -1
- package/dist/components/MenuItem.js +17 -27
- package/dist/components/Modal.js +4 -3
- package/dist/components/ModalSheetBottom.js +2 -1
- package/dist/components/Notification.js +4 -3
- package/dist/components/Overlay.js +3 -2
- package/dist/components/Pagination.js +2 -1
- package/dist/components/Radio.js +2 -1
- package/dist/components/RangeSlider.js +2 -1
- package/dist/components/Response.js +5 -4
- package/dist/components/SVGContent.js +2 -1
- package/dist/components/ScrollOnDrag.js +2 -1
- package/dist/components/ScrollToView.js +2 -1
- package/dist/components/Search.js +2 -1
- package/dist/components/Segmented.js +2 -1
- package/dist/components/Select.js +5 -4
- package/dist/components/Swiper.js +3 -2
- package/dist/components/Switch.js +2 -1
- package/dist/components/Tab.js +2 -1
- package/dist/components/Text.js +2 -1
- package/dist/components/Textarea.js +2 -1
- package/dist/components/Tile.js +2 -1
- package/dist/components/Title.js +2 -1
- package/dist/components/Tooltip.js +2 -1
- package/dist/components/Video.js +2 -1
- package/dist/components/Warning.js +2 -1
- package/dist/context/Notifications.js +2 -1
- package/dist/context/UIContext.js +2 -1
- package/dist/context/UrlAssetPrefix.js +2 -1
- package/dist/css/styles/bundles.css +196 -31
- package/dist/hoc/urlWithAssetPrefix.js +2 -1
- package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +2 -1
- package/dist/hooks/useAppearanceConfig.js +2 -1
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +2 -1
- package/dist/hooks/useDevicePropsGenerator.js +2 -1
- package/dist/hooks/useDeviceTargetClass.js +2 -1
- package/dist/hooks/useDropzoneFieldFiles.js +1834 -1379
- package/dist/hooks/useMediaQueries/useMediaQueries.js +2 -1
- package/dist/hooks/useMediaQueries.js +2 -1
- package/dist/hooks/useStyles/styleAttributes.js +2 -1
- package/dist/hooks/useStyles/useStyles.js +2 -1
- package/dist/hooks/useStyles.js +2 -1
- package/dist/hooks.js +2 -1
- package/dist/{primitives_cjs_D8cRUOUa.js → primitives_cjs_BEU-o0FZ.js} +9 -2
- package/dist/{primitives_es_gY0Wzlk_.js → primitives_es_g9LRUQ6M.js} +9 -3
- package/dist/types/components/MenuItem/MenuItem.interface.d.ts +10 -7
- package/dist/types/components/Select/Select.interface.d.ts +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +1 -2
- package/dist/types/components/Tooltip/Tooltip.interface.d.ts +2 -2
- package/dist/types/components/Tooltip/TooltipWrapper.d.ts +3 -0
- package/dist/types/components/Tooltip/TooltipWrapper.interface.d.ts +12 -0
- package/dist/types/components/Tooltip/index.d.ts +2 -0
- package/dist/utils/mergeAppearanceKeys.js +2 -1
- package/dist/utils/setViewportProperty.js +2 -1
- package/dist/utils.js +2 -1
- package/package.json +2 -1
|
@@ -12,7 +12,8 @@ var require$$6 = require('fs');
|
|
|
12
12
|
var require$$8 = require('crypto');
|
|
13
13
|
var http2 = require('http2');
|
|
14
14
|
var require$$4$1 = require('assert');
|
|
15
|
-
var require$$
|
|
15
|
+
var require$$1$2 = require('tty');
|
|
16
|
+
var require$$0$2 = require('os');
|
|
16
17
|
var zlib = require('zlib');
|
|
17
18
|
var events = require('events');
|
|
18
19
|
var common$1 = require('@itcase/common');
|
|
@@ -64,7 +65,7 @@ const { isArray } = Array;
|
|
|
64
65
|
*
|
|
65
66
|
* @returns {boolean} True if the value is undefined, otherwise false
|
|
66
67
|
*/
|
|
67
|
-
const isUndefined = typeOfTest(
|
|
68
|
+
const isUndefined = typeOfTest('undefined');
|
|
68
69
|
|
|
69
70
|
/**
|
|
70
71
|
* Determine if a value is a Buffer
|
|
@@ -91,7 +92,7 @@ function isBuffer(val) {
|
|
|
91
92
|
*
|
|
92
93
|
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
93
94
|
*/
|
|
94
|
-
const isArrayBuffer = kindOfTest(
|
|
95
|
+
const isArrayBuffer = kindOfTest('ArrayBuffer');
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
98
|
* Determine if a value is a view on an ArrayBuffer
|
|
@@ -102,7 +103,7 @@ const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
|
102
103
|
*/
|
|
103
104
|
function isArrayBufferView(val) {
|
|
104
105
|
let result;
|
|
105
|
-
if (typeof ArrayBuffer !==
|
|
106
|
+
if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
|
|
106
107
|
result = ArrayBuffer.isView(val);
|
|
107
108
|
} else {
|
|
108
109
|
result = val && val.buffer && isArrayBuffer(val.buffer);
|
|
@@ -117,7 +118,7 @@ function isArrayBufferView(val) {
|
|
|
117
118
|
*
|
|
118
119
|
* @returns {boolean} True if value is a String, otherwise false
|
|
119
120
|
*/
|
|
120
|
-
const isString = typeOfTest(
|
|
121
|
+
const isString = typeOfTest('string');
|
|
121
122
|
|
|
122
123
|
/**
|
|
123
124
|
* Determine if a value is a Function
|
|
@@ -125,7 +126,7 @@ const isString = typeOfTest("string");
|
|
|
125
126
|
* @param {*} val The value to test
|
|
126
127
|
* @returns {boolean} True if value is a Function, otherwise false
|
|
127
128
|
*/
|
|
128
|
-
const isFunction$1 = typeOfTest(
|
|
129
|
+
const isFunction$1 = typeOfTest('function');
|
|
129
130
|
|
|
130
131
|
/**
|
|
131
132
|
* Determine if a value is a Number
|
|
@@ -134,7 +135,7 @@ const isFunction$1 = typeOfTest("function");
|
|
|
134
135
|
*
|
|
135
136
|
* @returns {boolean} True if value is a Number, otherwise false
|
|
136
137
|
*/
|
|
137
|
-
const isNumber = typeOfTest(
|
|
138
|
+
const isNumber = typeOfTest('number');
|
|
138
139
|
|
|
139
140
|
/**
|
|
140
141
|
* Determine if a value is an Object
|
|
@@ -143,7 +144,7 @@ const isNumber = typeOfTest("number");
|
|
|
143
144
|
*
|
|
144
145
|
* @returns {boolean} True if value is an Object, otherwise false
|
|
145
146
|
*/
|
|
146
|
-
const isObject = (thing) => thing !== null && typeof thing ===
|
|
147
|
+
const isObject = (thing) => thing !== null && typeof thing === 'object';
|
|
147
148
|
|
|
148
149
|
/**
|
|
149
150
|
* Determine if a value is a Boolean
|
|
@@ -161,7 +162,7 @@ const isBoolean = (thing) => thing === true || thing === false;
|
|
|
161
162
|
* @returns {boolean} True if value is a plain Object, otherwise false
|
|
162
163
|
*/
|
|
163
164
|
const isPlainObject = (val) => {
|
|
164
|
-
if (kindOf(val) !==
|
|
165
|
+
if (kindOf(val) !== 'object') {
|
|
165
166
|
return false;
|
|
166
167
|
}
|
|
167
168
|
|
|
@@ -189,10 +190,7 @@ const isEmptyObject = (val) => {
|
|
|
189
190
|
}
|
|
190
191
|
|
|
191
192
|
try {
|
|
192
|
-
return (
|
|
193
|
-
Object.keys(val).length === 0 &&
|
|
194
|
-
Object.getPrototypeOf(val) === Object.prototype
|
|
195
|
-
);
|
|
193
|
+
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
|
|
196
194
|
} catch (e) {
|
|
197
195
|
// Fallback for any other objects that might cause RangeError with Object.keys()
|
|
198
196
|
return false;
|
|
@@ -206,7 +204,7 @@ const isEmptyObject = (val) => {
|
|
|
206
204
|
*
|
|
207
205
|
* @returns {boolean} True if value is a Date, otherwise false
|
|
208
206
|
*/
|
|
209
|
-
const isDate = kindOfTest(
|
|
207
|
+
const isDate = kindOfTest('Date');
|
|
210
208
|
|
|
211
209
|
/**
|
|
212
210
|
* Determine if a value is a File
|
|
@@ -215,7 +213,32 @@ const isDate = kindOfTest("Date");
|
|
|
215
213
|
*
|
|
216
214
|
* @returns {boolean} True if value is a File, otherwise false
|
|
217
215
|
*/
|
|
218
|
-
const isFile = kindOfTest(
|
|
216
|
+
const isFile = kindOfTest('File');
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Determine if a value is a React Native Blob
|
|
220
|
+
* React Native "blob": an object with a `uri` attribute. Optionally, it can
|
|
221
|
+
* also have a `name` and `type` attribute to specify filename and content type
|
|
222
|
+
*
|
|
223
|
+
* @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
|
|
224
|
+
*
|
|
225
|
+
* @param {*} value The value to test
|
|
226
|
+
*
|
|
227
|
+
* @returns {boolean} True if value is a React Native Blob, otherwise false
|
|
228
|
+
*/
|
|
229
|
+
const isReactNativeBlob = (value) => {
|
|
230
|
+
return !!(value && typeof value.uri !== 'undefined');
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Determine if environment is React Native
|
|
235
|
+
* ReactNative `FormData` has a non-standard `getParts()` method
|
|
236
|
+
*
|
|
237
|
+
* @param {*} formData The formData to test
|
|
238
|
+
*
|
|
239
|
+
* @returns {boolean} True if environment is React Native, otherwise false
|
|
240
|
+
*/
|
|
241
|
+
const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
|
|
219
242
|
|
|
220
243
|
/**
|
|
221
244
|
* Determine if a value is a Blob
|
|
@@ -224,7 +247,7 @@ const isFile = kindOfTest("File");
|
|
|
224
247
|
*
|
|
225
248
|
* @returns {boolean} True if value is a Blob, otherwise false
|
|
226
249
|
*/
|
|
227
|
-
const isBlob = kindOfTest(
|
|
250
|
+
const isBlob = kindOfTest('Blob');
|
|
228
251
|
|
|
229
252
|
/**
|
|
230
253
|
* Determine if a value is a FileList
|
|
@@ -233,7 +256,7 @@ const isBlob = kindOfTest("Blob");
|
|
|
233
256
|
*
|
|
234
257
|
* @returns {boolean} True if value is a File, otherwise false
|
|
235
258
|
*/
|
|
236
|
-
const isFileList = kindOfTest(
|
|
259
|
+
const isFileList = kindOfTest('FileList');
|
|
237
260
|
|
|
238
261
|
/**
|
|
239
262
|
* Determine if a value is a Stream
|
|
@@ -251,17 +274,27 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
|
|
|
251
274
|
*
|
|
252
275
|
* @returns {boolean} True if value is an FormData, otherwise false
|
|
253
276
|
*/
|
|
277
|
+
function getGlobal() {
|
|
278
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
279
|
+
if (typeof self !== 'undefined') return self;
|
|
280
|
+
if (typeof window !== 'undefined') return window;
|
|
281
|
+
if (typeof global !== 'undefined') return global;
|
|
282
|
+
return {};
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const G = getGlobal();
|
|
286
|
+
const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
|
|
287
|
+
|
|
254
288
|
const isFormData = (thing) => {
|
|
255
289
|
let kind;
|
|
256
|
-
return (
|
|
257
|
-
thing
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
thing.toString() === "[object FormData]"))))
|
|
290
|
+
return thing && (
|
|
291
|
+
(FormDataCtor && thing instanceof FormDataCtor) || (
|
|
292
|
+
isFunction$1(thing.append) && (
|
|
293
|
+
(kind = kindOf(thing)) === 'formdata' ||
|
|
294
|
+
// detect form-data instance
|
|
295
|
+
(kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
|
|
296
|
+
)
|
|
297
|
+
)
|
|
265
298
|
);
|
|
266
299
|
};
|
|
267
300
|
|
|
@@ -272,13 +305,13 @@ const isFormData = (thing) => {
|
|
|
272
305
|
*
|
|
273
306
|
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
274
307
|
*/
|
|
275
|
-
const isURLSearchParams = kindOfTest(
|
|
308
|
+
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
276
309
|
|
|
277
310
|
const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
311
|
+
'ReadableStream',
|
|
312
|
+
'Request',
|
|
313
|
+
'Response',
|
|
314
|
+
'Headers',
|
|
282
315
|
].map(kindOfTest);
|
|
283
316
|
|
|
284
317
|
/**
|
|
@@ -288,9 +321,9 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = [
|
|
|
288
321
|
*
|
|
289
322
|
* @returns {String} The String freed of excess whitespace
|
|
290
323
|
*/
|
|
291
|
-
const trim = (str) =>
|
|
292
|
-
str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
|
293
|
-
|
|
324
|
+
const trim = (str) => {
|
|
325
|
+
return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
|
|
326
|
+
};
|
|
294
327
|
/**
|
|
295
328
|
* Iterate over an Array or an Object invoking a function for each item.
|
|
296
329
|
*
|
|
@@ -309,7 +342,7 @@ const trim = (str) =>
|
|
|
309
342
|
*/
|
|
310
343
|
function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
311
344
|
// Don't bother if no value provided
|
|
312
|
-
if (obj === null || typeof obj ===
|
|
345
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
313
346
|
return;
|
|
314
347
|
}
|
|
315
348
|
|
|
@@ -317,7 +350,7 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
317
350
|
let l;
|
|
318
351
|
|
|
319
352
|
// Force an array if not already something iterable
|
|
320
|
-
if (typeof obj !==
|
|
353
|
+
if (typeof obj !== 'object') {
|
|
321
354
|
/*eslint no-param-reassign:0*/
|
|
322
355
|
obj = [obj];
|
|
323
356
|
}
|
|
@@ -334,9 +367,7 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
334
367
|
}
|
|
335
368
|
|
|
336
369
|
// Iterate over object keys
|
|
337
|
-
const keys = allOwnKeys
|
|
338
|
-
? Object.getOwnPropertyNames(obj)
|
|
339
|
-
: Object.keys(obj);
|
|
370
|
+
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
|
|
340
371
|
const len = keys.length;
|
|
341
372
|
let key;
|
|
342
373
|
|
|
@@ -347,6 +378,14 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
|
|
|
347
378
|
}
|
|
348
379
|
}
|
|
349
380
|
|
|
381
|
+
/**
|
|
382
|
+
* Finds a key in an object, case-insensitive, returning the actual key name.
|
|
383
|
+
* Returns null if the object is a Buffer or if no match is found.
|
|
384
|
+
*
|
|
385
|
+
* @param {Object} obj - The object to search.
|
|
386
|
+
* @param {string} key - The key to find (case-insensitive).
|
|
387
|
+
* @returns {?string} The actual key name if found, otherwise null.
|
|
388
|
+
*/
|
|
350
389
|
function findKey(obj, key) {
|
|
351
390
|
if (isBuffer(obj)) {
|
|
352
391
|
return null;
|
|
@@ -367,16 +406,11 @@ function findKey(obj, key) {
|
|
|
367
406
|
|
|
368
407
|
const _global = (() => {
|
|
369
408
|
/*eslint no-undef:0*/
|
|
370
|
-
if (typeof globalThis !==
|
|
371
|
-
return typeof self !==
|
|
372
|
-
? self
|
|
373
|
-
: typeof window !== "undefined"
|
|
374
|
-
? window
|
|
375
|
-
: global;
|
|
409
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
410
|
+
return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;
|
|
376
411
|
})();
|
|
377
412
|
|
|
378
|
-
const isContextDefined = (context) =>
|
|
379
|
-
!isUndefined(context) && context !== _global;
|
|
413
|
+
const isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
380
414
|
|
|
381
415
|
/**
|
|
382
416
|
* Accepts varargs expecting each argument to be an object, then
|
|
@@ -401,7 +435,7 @@ function merge(/* obj1, obj2, obj3, ... */) {
|
|
|
401
435
|
const result = {};
|
|
402
436
|
const assignValue = (val, key) => {
|
|
403
437
|
// Skip dangerous property names to prevent prototype pollution
|
|
404
|
-
if (key ===
|
|
438
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
405
439
|
return;
|
|
406
440
|
}
|
|
407
441
|
|
|
@@ -454,7 +488,7 @@ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
|
|
|
454
488
|
});
|
|
455
489
|
}
|
|
456
490
|
},
|
|
457
|
-
{ allOwnKeys }
|
|
491
|
+
{ allOwnKeys }
|
|
458
492
|
);
|
|
459
493
|
return a;
|
|
460
494
|
};
|
|
@@ -483,17 +517,14 @@ const stripBOM = (content) => {
|
|
|
483
517
|
* @returns {void}
|
|
484
518
|
*/
|
|
485
519
|
const inherits = (constructor, superConstructor, props, descriptors) => {
|
|
486
|
-
constructor.prototype = Object.create(
|
|
487
|
-
|
|
488
|
-
descriptors,
|
|
489
|
-
);
|
|
490
|
-
Object.defineProperty(constructor.prototype, "constructor", {
|
|
520
|
+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
|
|
521
|
+
Object.defineProperty(constructor.prototype, 'constructor', {
|
|
491
522
|
value: constructor,
|
|
492
523
|
writable: true,
|
|
493
524
|
enumerable: false,
|
|
494
525
|
configurable: true,
|
|
495
526
|
});
|
|
496
|
-
Object.defineProperty(constructor,
|
|
527
|
+
Object.defineProperty(constructor, 'super', {
|
|
497
528
|
value: superConstructor.prototype,
|
|
498
529
|
});
|
|
499
530
|
props && Object.assign(constructor.prototype, props);
|
|
@@ -523,20 +554,13 @@ const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
|
|
|
523
554
|
i = props.length;
|
|
524
555
|
while (i-- > 0) {
|
|
525
556
|
prop = props[i];
|
|
526
|
-
if (
|
|
527
|
-
(!propFilter || propFilter(prop, sourceObj, destObj)) &&
|
|
528
|
-
!merged[prop]
|
|
529
|
-
) {
|
|
557
|
+
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
|
|
530
558
|
destObj[prop] = sourceObj[prop];
|
|
531
559
|
merged[prop] = true;
|
|
532
560
|
}
|
|
533
561
|
}
|
|
534
562
|
sourceObj = filter !== false && getPrototypeOf(sourceObj);
|
|
535
|
-
} while (
|
|
536
|
-
sourceObj &&
|
|
537
|
-
(!filter || filter(sourceObj, destObj)) &&
|
|
538
|
-
sourceObj !== Object.prototype
|
|
539
|
-
);
|
|
563
|
+
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
|
|
540
564
|
|
|
541
565
|
return destObj;
|
|
542
566
|
};
|
|
@@ -593,7 +617,7 @@ const isTypedArray = ((TypedArray) => {
|
|
|
593
617
|
return (thing) => {
|
|
594
618
|
return TypedArray && thing instanceof TypedArray;
|
|
595
619
|
};
|
|
596
|
-
})(typeof Uint8Array !==
|
|
620
|
+
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
|
|
597
621
|
|
|
598
622
|
/**
|
|
599
623
|
* For each entry in the object, call the function with the key and value.
|
|
@@ -636,14 +660,12 @@ const matchAll = (regExp, str) => {
|
|
|
636
660
|
};
|
|
637
661
|
|
|
638
662
|
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
|
|
639
|
-
const isHTMLForm = kindOfTest(
|
|
663
|
+
const isHTMLForm = kindOfTest('HTMLFormElement');
|
|
640
664
|
|
|
641
665
|
const toCamelCase = (str) => {
|
|
642
|
-
return str
|
|
643
|
-
.
|
|
644
|
-
|
|
645
|
-
return p1.toUpperCase() + p2;
|
|
646
|
-
});
|
|
666
|
+
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
667
|
+
return p1.toUpperCase() + p2;
|
|
668
|
+
});
|
|
647
669
|
};
|
|
648
670
|
|
|
649
671
|
/* Creating a function that will check if an object has a property. */
|
|
@@ -660,7 +682,7 @@ const hasOwnProperty = (
|
|
|
660
682
|
*
|
|
661
683
|
* @returns {boolean} True if value is a RegExp object, otherwise false
|
|
662
684
|
*/
|
|
663
|
-
const isRegExp = kindOfTest(
|
|
685
|
+
const isRegExp = kindOfTest('RegExp');
|
|
664
686
|
|
|
665
687
|
const reduceDescriptors = (obj, reducer) => {
|
|
666
688
|
const descriptors = Object.getOwnPropertyDescriptors(obj);
|
|
@@ -684,10 +706,7 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
684
706
|
const freezeMethods = (obj) => {
|
|
685
707
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
686
708
|
// skip restricted props in strict mode
|
|
687
|
-
if (
|
|
688
|
-
isFunction$1(obj) &&
|
|
689
|
-
["arguments", "caller", "callee"].indexOf(name) !== -1
|
|
690
|
-
) {
|
|
709
|
+
if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
|
|
691
710
|
return false;
|
|
692
711
|
}
|
|
693
712
|
|
|
@@ -697,7 +716,7 @@ const freezeMethods = (obj) => {
|
|
|
697
716
|
|
|
698
717
|
descriptor.enumerable = false;
|
|
699
718
|
|
|
700
|
-
if (
|
|
719
|
+
if ('writable' in descriptor) {
|
|
701
720
|
descriptor.writable = false;
|
|
702
721
|
return;
|
|
703
722
|
}
|
|
@@ -710,6 +729,14 @@ const freezeMethods = (obj) => {
|
|
|
710
729
|
});
|
|
711
730
|
};
|
|
712
731
|
|
|
732
|
+
/**
|
|
733
|
+
* Converts an array or a delimited string into an object set with values as keys and true as values.
|
|
734
|
+
* Useful for fast membership checks.
|
|
735
|
+
*
|
|
736
|
+
* @param {Array|string} arrayOrString - The array or string to convert.
|
|
737
|
+
* @param {string} delimiter - The delimiter to use if input is a string.
|
|
738
|
+
* @returns {Object} An object with keys from the array or string, values set to true.
|
|
739
|
+
*/
|
|
713
740
|
const toObjectSet = (arrayOrString, delimiter) => {
|
|
714
741
|
const obj = {};
|
|
715
742
|
|
|
@@ -719,9 +746,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
719
746
|
});
|
|
720
747
|
};
|
|
721
748
|
|
|
722
|
-
isArray(arrayOrString)
|
|
723
|
-
? define(arrayOrString)
|
|
724
|
-
: define(String(arrayOrString).split(delimiter));
|
|
749
|
+
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
|
|
725
750
|
|
|
726
751
|
return obj;
|
|
727
752
|
};
|
|
@@ -729,9 +754,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
729
754
|
const noop = () => {};
|
|
730
755
|
|
|
731
756
|
const toFiniteNumber = (value, defaultValue) => {
|
|
732
|
-
return value != null && Number.isFinite((value = +value))
|
|
733
|
-
? value
|
|
734
|
-
: defaultValue;
|
|
757
|
+
return value != null && Number.isFinite((value = +value)) ? value : defaultValue;
|
|
735
758
|
};
|
|
736
759
|
|
|
737
760
|
/**
|
|
@@ -745,11 +768,17 @@ function isSpecCompliantForm(thing) {
|
|
|
745
768
|
return !!(
|
|
746
769
|
thing &&
|
|
747
770
|
isFunction$1(thing.append) &&
|
|
748
|
-
thing[toStringTag] ===
|
|
771
|
+
thing[toStringTag] === 'FormData' &&
|
|
749
772
|
thing[iterator]
|
|
750
773
|
);
|
|
751
774
|
}
|
|
752
775
|
|
|
776
|
+
/**
|
|
777
|
+
* Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
|
|
778
|
+
*
|
|
779
|
+
* @param {Object} obj - The object to convert.
|
|
780
|
+
* @returns {Object} The JSON-compatible object.
|
|
781
|
+
*/
|
|
753
782
|
const toJSONObject = (obj) => {
|
|
754
783
|
const stack = new Array(10);
|
|
755
784
|
|
|
@@ -764,7 +793,7 @@ const toJSONObject = (obj) => {
|
|
|
764
793
|
return source;
|
|
765
794
|
}
|
|
766
795
|
|
|
767
|
-
if (!(
|
|
796
|
+
if (!('toJSON' in source)) {
|
|
768
797
|
stack[i] = source;
|
|
769
798
|
const target = isArray(source) ? [] : {};
|
|
770
799
|
|
|
@@ -785,8 +814,20 @@ const toJSONObject = (obj) => {
|
|
|
785
814
|
return visit(obj, 0);
|
|
786
815
|
};
|
|
787
816
|
|
|
788
|
-
|
|
817
|
+
/**
|
|
818
|
+
* Determines if a value is an async function.
|
|
819
|
+
*
|
|
820
|
+
* @param {*} thing - The value to test.
|
|
821
|
+
* @returns {boolean} True if value is an async function, otherwise false.
|
|
822
|
+
*/
|
|
823
|
+
const isAsyncFn = kindOfTest('AsyncFunction');
|
|
789
824
|
|
|
825
|
+
/**
|
|
826
|
+
* Determines if a value is thenable (has then and catch methods).
|
|
827
|
+
*
|
|
828
|
+
* @param {*} thing - The value to test.
|
|
829
|
+
* @returns {boolean} True if value is thenable, otherwise false.
|
|
830
|
+
*/
|
|
790
831
|
const isThenable = (thing) =>
|
|
791
832
|
thing &&
|
|
792
833
|
(isObject(thing) || isFunction$1(thing)) &&
|
|
@@ -796,6 +837,14 @@ const isThenable = (thing) =>
|
|
|
796
837
|
// original code
|
|
797
838
|
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
798
839
|
|
|
840
|
+
/**
|
|
841
|
+
* Provides a cross-platform setImmediate implementation.
|
|
842
|
+
* Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
|
|
843
|
+
*
|
|
844
|
+
* @param {boolean} setImmediateSupported - Whether setImmediate is supported.
|
|
845
|
+
* @param {boolean} postMessageSupported - Whether postMessage is supported.
|
|
846
|
+
* @returns {Function} A function to schedule a callback asynchronously.
|
|
847
|
+
*/
|
|
799
848
|
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
800
849
|
if (setImmediateSupported) {
|
|
801
850
|
return setImmediate;
|
|
@@ -804,27 +853,33 @@ const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
|
804
853
|
return postMessageSupported
|
|
805
854
|
? ((token, callbacks) => {
|
|
806
855
|
_global.addEventListener(
|
|
807
|
-
|
|
856
|
+
'message',
|
|
808
857
|
({ source, data }) => {
|
|
809
858
|
if (source === _global && data === token) {
|
|
810
859
|
callbacks.length && callbacks.shift()();
|
|
811
860
|
}
|
|
812
861
|
},
|
|
813
|
-
false
|
|
862
|
+
false
|
|
814
863
|
);
|
|
815
864
|
|
|
816
865
|
return (cb) => {
|
|
817
866
|
callbacks.push(cb);
|
|
818
|
-
_global.postMessage(token,
|
|
867
|
+
_global.postMessage(token, '*');
|
|
819
868
|
};
|
|
820
869
|
})(`axios@${Math.random()}`, [])
|
|
821
870
|
: (cb) => setTimeout(cb);
|
|
822
|
-
})(typeof setImmediate ===
|
|
871
|
+
})(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
|
|
823
872
|
|
|
873
|
+
/**
|
|
874
|
+
* Schedules a microtask or asynchronous callback as soon as possible.
|
|
875
|
+
* Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
|
|
876
|
+
*
|
|
877
|
+
* @type {Function}
|
|
878
|
+
*/
|
|
824
879
|
const asap =
|
|
825
|
-
typeof queueMicrotask !==
|
|
880
|
+
typeof queueMicrotask !== 'undefined'
|
|
826
881
|
? queueMicrotask.bind(_global)
|
|
827
|
-
: (typeof process !==
|
|
882
|
+
: (typeof process !== 'undefined' && process.nextTick) || _setImmediate;
|
|
828
883
|
|
|
829
884
|
// *********************
|
|
830
885
|
|
|
@@ -849,6 +904,8 @@ var utils$1 = {
|
|
|
849
904
|
isUndefined,
|
|
850
905
|
isDate,
|
|
851
906
|
isFile,
|
|
907
|
+
isReactNativeBlob,
|
|
908
|
+
isReactNative,
|
|
852
909
|
isBlob,
|
|
853
910
|
isRegExp,
|
|
854
911
|
isFunction: isFunction$1,
|
|
@@ -891,14 +948,20 @@ var utils$1 = {
|
|
|
891
948
|
};
|
|
892
949
|
|
|
893
950
|
let AxiosError$1 = class AxiosError extends Error {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
951
|
+
static from(error, code, config, request, response, customProps) {
|
|
952
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
953
|
+
axiosError.cause = error;
|
|
954
|
+
axiosError.name = error.name;
|
|
955
|
+
|
|
956
|
+
// Preserve status from the original error if not already set from response
|
|
957
|
+
if (error.status != null && axiosError.status == null) {
|
|
958
|
+
axiosError.status = error.status;
|
|
900
959
|
}
|
|
901
960
|
|
|
961
|
+
customProps && Object.assign(axiosError, customProps);
|
|
962
|
+
return axiosError;
|
|
963
|
+
}
|
|
964
|
+
|
|
902
965
|
/**
|
|
903
966
|
* Create an Error with the specified message, config, error code, request and response.
|
|
904
967
|
*
|
|
@@ -911,37 +974,48 @@ let AxiosError$1 = class AxiosError extends Error {
|
|
|
911
974
|
* @returns {Error} The created error.
|
|
912
975
|
*/
|
|
913
976
|
constructor(message, code, config, request, response) {
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
977
|
+
super(message);
|
|
978
|
+
|
|
979
|
+
// Make message enumerable to maintain backward compatibility
|
|
980
|
+
// The native Error constructor sets message as non-enumerable,
|
|
981
|
+
// but axios < v1.13.3 had it as enumerable
|
|
982
|
+
Object.defineProperty(this, 'message', {
|
|
983
|
+
value: message,
|
|
984
|
+
enumerable: true,
|
|
985
|
+
writable: true,
|
|
986
|
+
configurable: true
|
|
987
|
+
});
|
|
988
|
+
|
|
989
|
+
this.name = 'AxiosError';
|
|
990
|
+
this.isAxiosError = true;
|
|
991
|
+
code && (this.code = code);
|
|
992
|
+
config && (this.config = config);
|
|
993
|
+
request && (this.request = request);
|
|
994
|
+
if (response) {
|
|
995
|
+
this.response = response;
|
|
996
|
+
this.status = response.status;
|
|
997
|
+
}
|
|
924
998
|
}
|
|
925
999
|
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
1000
|
+
toJSON() {
|
|
1001
|
+
return {
|
|
1002
|
+
// Standard
|
|
1003
|
+
message: this.message,
|
|
1004
|
+
name: this.name,
|
|
1005
|
+
// Microsoft
|
|
1006
|
+
description: this.description,
|
|
1007
|
+
number: this.number,
|
|
1008
|
+
// Mozilla
|
|
1009
|
+
fileName: this.fileName,
|
|
1010
|
+
lineNumber: this.lineNumber,
|
|
1011
|
+
columnNumber: this.columnNumber,
|
|
1012
|
+
stack: this.stack,
|
|
1013
|
+
// Axios
|
|
1014
|
+
config: utils$1.toJSONObject(this.config),
|
|
1015
|
+
code: this.code,
|
|
1016
|
+
status: this.status,
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
945
1019
|
};
|
|
946
1020
|
|
|
947
1021
|
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
@@ -14311,11 +14385,14 @@ function removeBrackets(key) {
|
|
|
14311
14385
|
*/
|
|
14312
14386
|
function renderKey(path, key, dots) {
|
|
14313
14387
|
if (!path) return key;
|
|
14314
|
-
return path
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14388
|
+
return path
|
|
14389
|
+
.concat(key)
|
|
14390
|
+
.map(function each(token, i) {
|
|
14391
|
+
// eslint-disable-next-line no-param-reassign
|
|
14392
|
+
token = removeBrackets(token);
|
|
14393
|
+
return !dots && i ? '[' + token + ']' : token;
|
|
14394
|
+
})
|
|
14395
|
+
.join(dots ? '.' : '');
|
|
14319
14396
|
}
|
|
14320
14397
|
|
|
14321
14398
|
/**
|
|
@@ -14365,21 +14442,26 @@ function toFormData$1(obj, formData, options) {
|
|
|
14365
14442
|
formData = formData || new (FormData$1 || FormData)();
|
|
14366
14443
|
|
|
14367
14444
|
// eslint-disable-next-line no-param-reassign
|
|
14368
|
-
options = utils$1.toFlatObject(
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14445
|
+
options = utils$1.toFlatObject(
|
|
14446
|
+
options,
|
|
14447
|
+
{
|
|
14448
|
+
metaTokens: true,
|
|
14449
|
+
dots: false,
|
|
14450
|
+
indexes: false,
|
|
14451
|
+
},
|
|
14452
|
+
false,
|
|
14453
|
+
function defined(option, source) {
|
|
14454
|
+
// eslint-disable-next-line no-eq-null,eqeqeq
|
|
14455
|
+
return !utils$1.isUndefined(source[option]);
|
|
14456
|
+
}
|
|
14457
|
+
);
|
|
14376
14458
|
|
|
14377
14459
|
const metaTokens = options.metaTokens;
|
|
14378
14460
|
// eslint-disable-next-line no-use-before-define
|
|
14379
14461
|
const visitor = options.visitor || defaultVisitor;
|
|
14380
14462
|
const dots = options.dots;
|
|
14381
14463
|
const indexes = options.indexes;
|
|
14382
|
-
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
|
14464
|
+
const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
|
|
14383
14465
|
const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
|
14384
14466
|
|
|
14385
14467
|
if (!utils$1.isFunction(visitor)) {
|
|
@@ -14421,6 +14503,11 @@ function toFormData$1(obj, formData, options) {
|
|
|
14421
14503
|
function defaultVisitor(value, key, path) {
|
|
14422
14504
|
let arr = value;
|
|
14423
14505
|
|
|
14506
|
+
if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
|
|
14507
|
+
formData.append(renderKey(path, key, dots), convertValue(value));
|
|
14508
|
+
return false;
|
|
14509
|
+
}
|
|
14510
|
+
|
|
14424
14511
|
if (value && !path && typeof value === 'object') {
|
|
14425
14512
|
if (utils$1.endsWith(key, '{}')) {
|
|
14426
14513
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -14429,17 +14516,22 @@ function toFormData$1(obj, formData, options) {
|
|
|
14429
14516
|
value = JSON.stringify(value);
|
|
14430
14517
|
} else if (
|
|
14431
14518
|
(utils$1.isArray(value) && isFlatArray(value)) ||
|
|
14432
|
-
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
|
|
14433
|
-
|
|
14519
|
+
((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
|
|
14520
|
+
) {
|
|
14434
14521
|
// eslint-disable-next-line no-param-reassign
|
|
14435
14522
|
key = removeBrackets(key);
|
|
14436
14523
|
|
|
14437
14524
|
arr.forEach(function each(el, index) {
|
|
14438
|
-
!(utils$1.isUndefined(el) || el === null) &&
|
|
14439
|
-
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
|
|
14525
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
14526
|
+
formData.append(
|
|
14527
|
+
// eslint-disable-next-line no-nested-ternary
|
|
14528
|
+
indexes === true
|
|
14529
|
+
? renderKey([key], index, dots)
|
|
14530
|
+
: indexes === null
|
|
14531
|
+
? key
|
|
14532
|
+
: key + '[]',
|
|
14533
|
+
convertValue(el)
|
|
14534
|
+
);
|
|
14443
14535
|
});
|
|
14444
14536
|
return false;
|
|
14445
14537
|
}
|
|
@@ -14459,7 +14551,7 @@ function toFormData$1(obj, formData, options) {
|
|
|
14459
14551
|
const exposedHelpers = Object.assign(predicates, {
|
|
14460
14552
|
defaultVisitor,
|
|
14461
14553
|
convertValue,
|
|
14462
|
-
isVisitable
|
|
14554
|
+
isVisitable,
|
|
14463
14555
|
});
|
|
14464
14556
|
|
|
14465
14557
|
function build(value, path) {
|
|
@@ -14472,9 +14564,9 @@ function toFormData$1(obj, formData, options) {
|
|
|
14472
14564
|
stack.push(value);
|
|
14473
14565
|
|
|
14474
14566
|
utils$1.forEach(value, function each(el, key) {
|
|
14475
|
-
const result =
|
|
14476
|
-
|
|
14477
|
-
|
|
14567
|
+
const result =
|
|
14568
|
+
!(utils$1.isUndefined(el) || el === null) &&
|
|
14569
|
+
visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
|
14478
14570
|
|
|
14479
14571
|
if (result === true) {
|
|
14480
14572
|
build(el, path ? path.concat(key) : [key]);
|
|
@@ -14509,7 +14601,7 @@ function encode$1(str) {
|
|
|
14509
14601
|
')': '%29',
|
|
14510
14602
|
'~': '%7E',
|
|
14511
14603
|
'%20': '+',
|
|
14512
|
-
'%00': '\x00'
|
|
14604
|
+
'%00': '\x00',
|
|
14513
14605
|
};
|
|
14514
14606
|
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
14515
14607
|
return charMap[match];
|
|
@@ -14537,13 +14629,17 @@ prototype.append = function append(name, value) {
|
|
|
14537
14629
|
};
|
|
14538
14630
|
|
|
14539
14631
|
prototype.toString = function toString(encoder) {
|
|
14540
|
-
const _encode = encoder
|
|
14541
|
-
|
|
14542
|
-
|
|
14632
|
+
const _encode = encoder
|
|
14633
|
+
? function (value) {
|
|
14634
|
+
return encoder.call(this, value, encode$1);
|
|
14635
|
+
}
|
|
14636
|
+
: encode$1;
|
|
14543
14637
|
|
|
14544
|
-
return this._pairs
|
|
14545
|
-
|
|
14546
|
-
|
|
14638
|
+
return this._pairs
|
|
14639
|
+
.map(function each(pair) {
|
|
14640
|
+
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
14641
|
+
}, '')
|
|
14642
|
+
.join('&');
|
|
14547
14643
|
};
|
|
14548
14644
|
|
|
14549
14645
|
/**
|
|
@@ -14555,11 +14651,11 @@ prototype.toString = function toString(encoder) {
|
|
|
14555
14651
|
* @returns {string} The encoded value.
|
|
14556
14652
|
*/
|
|
14557
14653
|
function encode(val) {
|
|
14558
|
-
return encodeURIComponent(val)
|
|
14559
|
-
replace(/%3A/gi, ':')
|
|
14560
|
-
replace(/%24/g, '$')
|
|
14561
|
-
replace(/%2C/gi, ',')
|
|
14562
|
-
replace(/%20/g, '+');
|
|
14654
|
+
return encodeURIComponent(val)
|
|
14655
|
+
.replace(/%3A/gi, ':')
|
|
14656
|
+
.replace(/%24/g, '$')
|
|
14657
|
+
.replace(/%2C/gi, ',')
|
|
14658
|
+
.replace(/%20/g, '+');
|
|
14563
14659
|
}
|
|
14564
14660
|
|
|
14565
14661
|
/**
|
|
@@ -14576,11 +14672,13 @@ function buildURL(url, params, options) {
|
|
|
14576
14672
|
return url;
|
|
14577
14673
|
}
|
|
14578
14674
|
|
|
14579
|
-
const _encode = options && options.encode || encode;
|
|
14675
|
+
const _encode = (options && options.encode) || encode;
|
|
14580
14676
|
|
|
14581
|
-
const _options = utils$1.isFunction(options)
|
|
14582
|
-
|
|
14583
|
-
|
|
14677
|
+
const _options = utils$1.isFunction(options)
|
|
14678
|
+
? {
|
|
14679
|
+
serialize: options,
|
|
14680
|
+
}
|
|
14681
|
+
: options;
|
|
14584
14682
|
|
|
14585
14683
|
const serializeFn = _options && _options.serialize;
|
|
14586
14684
|
|
|
@@ -14589,13 +14687,13 @@ function buildURL(url, params, options) {
|
|
|
14589
14687
|
if (serializeFn) {
|
|
14590
14688
|
serializedParams = serializeFn(params, _options);
|
|
14591
14689
|
} else {
|
|
14592
|
-
serializedParams = utils$1.isURLSearchParams(params)
|
|
14593
|
-
params.toString()
|
|
14594
|
-
new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
14690
|
+
serializedParams = utils$1.isURLSearchParams(params)
|
|
14691
|
+
? params.toString()
|
|
14692
|
+
: new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
14595
14693
|
}
|
|
14596
14694
|
|
|
14597
14695
|
if (serializedParams) {
|
|
14598
|
-
const hashmarkIndex = url.indexOf(
|
|
14696
|
+
const hashmarkIndex = url.indexOf('#');
|
|
14599
14697
|
|
|
14600
14698
|
if (hashmarkIndex !== -1) {
|
|
14601
14699
|
url = url.slice(0, hashmarkIndex);
|
|
@@ -14625,7 +14723,7 @@ class InterceptorManager {
|
|
|
14625
14723
|
fulfilled,
|
|
14626
14724
|
rejected,
|
|
14627
14725
|
synchronous: options ? options.synchronous : false,
|
|
14628
|
-
runWhen: options ? options.runWhen : null
|
|
14726
|
+
runWhen: options ? options.runWhen : null,
|
|
14629
14727
|
});
|
|
14630
14728
|
return this.handlers.length - 1;
|
|
14631
14729
|
}
|
|
@@ -14677,7 +14775,7 @@ var transitionalDefaults = {
|
|
|
14677
14775
|
silentJSONParsing: true,
|
|
14678
14776
|
forcedJSONParsing: true,
|
|
14679
14777
|
clarifyTimeoutError: false,
|
|
14680
|
-
legacyInterceptorReqResOrdering: true
|
|
14778
|
+
legacyInterceptorReqResOrdering: true,
|
|
14681
14779
|
};
|
|
14682
14780
|
|
|
14683
14781
|
var URLSearchParams = require$$0$1.URLSearchParams;
|
|
@@ -14689,12 +14787,12 @@ const DIGIT = '0123456789';
|
|
|
14689
14787
|
const ALPHABET = {
|
|
14690
14788
|
DIGIT,
|
|
14691
14789
|
ALPHA,
|
|
14692
|
-
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
|
|
14790
|
+
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT,
|
|
14693
14791
|
};
|
|
14694
14792
|
|
|
14695
14793
|
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
14696
14794
|
let str = '';
|
|
14697
|
-
const {length} = alphabet;
|
|
14795
|
+
const { length } = alphabet;
|
|
14698
14796
|
const randomValues = new Uint32Array(size);
|
|
14699
14797
|
require$$8.randomFillSync(randomValues);
|
|
14700
14798
|
for (let i = 0; i < size; i++) {
|
|
@@ -14704,22 +14802,21 @@ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
|
14704
14802
|
return str;
|
|
14705
14803
|
};
|
|
14706
14804
|
|
|
14707
|
-
|
|
14708
14805
|
var platform$1 = {
|
|
14709
14806
|
isNode: true,
|
|
14710
14807
|
classes: {
|
|
14711
14808
|
URLSearchParams,
|
|
14712
14809
|
FormData: FormData$1,
|
|
14713
|
-
Blob: typeof Blob !== 'undefined' && Blob || null
|
|
14810
|
+
Blob: (typeof Blob !== 'undefined' && Blob) || null,
|
|
14714
14811
|
},
|
|
14715
14812
|
ALPHABET,
|
|
14716
14813
|
generateString,
|
|
14717
|
-
protocols: [
|
|
14814
|
+
protocols: ['http', 'https', 'file', 'data'],
|
|
14718
14815
|
};
|
|
14719
14816
|
|
|
14720
14817
|
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
14721
14818
|
|
|
14722
|
-
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
14819
|
+
const _navigator = (typeof navigator === 'object' && navigator) || undefined;
|
|
14723
14820
|
|
|
14724
14821
|
/**
|
|
14725
14822
|
* Determine if we're running in a standard browser environment
|
|
@@ -14738,7 +14835,8 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
|
14738
14835
|
*
|
|
14739
14836
|
* @returns {boolean}
|
|
14740
14837
|
*/
|
|
14741
|
-
const hasStandardBrowserEnv =
|
|
14838
|
+
const hasStandardBrowserEnv =
|
|
14839
|
+
hasBrowserEnv &&
|
|
14742
14840
|
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
14743
14841
|
|
|
14744
14842
|
/**
|
|
@@ -14759,7 +14857,7 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
14759
14857
|
);
|
|
14760
14858
|
})();
|
|
14761
14859
|
|
|
14762
|
-
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
14860
|
+
const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
|
|
14763
14861
|
|
|
14764
14862
|
var utils = /*#__PURE__*/Object.freeze({
|
|
14765
14863
|
__proto__: null,
|
|
@@ -14772,12 +14870,12 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
14772
14870
|
|
|
14773
14871
|
var platform = {
|
|
14774
14872
|
...utils,
|
|
14775
|
-
...platform$1
|
|
14873
|
+
...platform$1,
|
|
14776
14874
|
};
|
|
14777
14875
|
|
|
14778
14876
|
function toURLEncodedForm(data, options) {
|
|
14779
14877
|
return toFormData$1(data, new platform.classes.URLSearchParams(), {
|
|
14780
|
-
visitor: function(value, key, path, helpers) {
|
|
14878
|
+
visitor: function (value, key, path, helpers) {
|
|
14781
14879
|
if (platform.isNode && utils$1.isBuffer(value)) {
|
|
14782
14880
|
this.append(key, value.toString('base64'));
|
|
14783
14881
|
return false;
|
|
@@ -14785,7 +14883,7 @@ function toURLEncodedForm(data, options) {
|
|
|
14785
14883
|
|
|
14786
14884
|
return helpers.defaultVisitor.apply(this, arguments);
|
|
14787
14885
|
},
|
|
14788
|
-
...options
|
|
14886
|
+
...options,
|
|
14789
14887
|
});
|
|
14790
14888
|
}
|
|
14791
14889
|
|
|
@@ -14801,7 +14899,7 @@ function parsePropPath(name) {
|
|
|
14801
14899
|
// foo.x.y.z
|
|
14802
14900
|
// foo-x-y-z
|
|
14803
14901
|
// foo x y z
|
|
14804
|
-
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
|
|
14902
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
14805
14903
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
|
14806
14904
|
});
|
|
14807
14905
|
}
|
|
@@ -14905,96 +15003,107 @@ function stringifySafely(rawValue, parser, encoder) {
|
|
|
14905
15003
|
}
|
|
14906
15004
|
|
|
14907
15005
|
const defaults = {
|
|
14908
|
-
|
|
14909
15006
|
transitional: transitionalDefaults,
|
|
14910
15007
|
|
|
14911
15008
|
adapter: ['xhr', 'http', 'fetch'],
|
|
14912
15009
|
|
|
14913
|
-
transformRequest: [
|
|
14914
|
-
|
|
14915
|
-
|
|
14916
|
-
|
|
15010
|
+
transformRequest: [
|
|
15011
|
+
function transformRequest(data, headers) {
|
|
15012
|
+
const contentType = headers.getContentType() || '';
|
|
15013
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
15014
|
+
const isObjectPayload = utils$1.isObject(data);
|
|
14917
15015
|
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
|
|
15016
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
|
15017
|
+
data = new FormData(data);
|
|
15018
|
+
}
|
|
14921
15019
|
|
|
14922
|
-
|
|
15020
|
+
const isFormData = utils$1.isFormData(data);
|
|
14923
15021
|
|
|
14924
|
-
|
|
14925
|
-
|
|
14926
|
-
|
|
15022
|
+
if (isFormData) {
|
|
15023
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
15024
|
+
}
|
|
14927
15025
|
|
|
14928
|
-
|
|
14929
|
-
|
|
14930
|
-
|
|
14931
|
-
|
|
14932
|
-
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
|
|
14936
|
-
|
|
14937
|
-
|
|
14938
|
-
|
|
14939
|
-
|
|
14940
|
-
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
15026
|
+
if (
|
|
15027
|
+
utils$1.isArrayBuffer(data) ||
|
|
15028
|
+
utils$1.isBuffer(data) ||
|
|
15029
|
+
utils$1.isStream(data) ||
|
|
15030
|
+
utils$1.isFile(data) ||
|
|
15031
|
+
utils$1.isBlob(data) ||
|
|
15032
|
+
utils$1.isReadableStream(data)
|
|
15033
|
+
) {
|
|
15034
|
+
return data;
|
|
15035
|
+
}
|
|
15036
|
+
if (utils$1.isArrayBufferView(data)) {
|
|
15037
|
+
return data.buffer;
|
|
15038
|
+
}
|
|
15039
|
+
if (utils$1.isURLSearchParams(data)) {
|
|
15040
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
15041
|
+
return data.toString();
|
|
15042
|
+
}
|
|
14944
15043
|
|
|
14945
|
-
|
|
15044
|
+
let isFileList;
|
|
14946
15045
|
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
15046
|
+
if (isObjectPayload) {
|
|
15047
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
15048
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
15049
|
+
}
|
|
14951
15050
|
|
|
14952
|
-
|
|
14953
|
-
|
|
15051
|
+
if (
|
|
15052
|
+
(isFileList = utils$1.isFileList(data)) ||
|
|
15053
|
+
contentType.indexOf('multipart/form-data') > -1
|
|
15054
|
+
) {
|
|
15055
|
+
const _FormData = this.env && this.env.FormData;
|
|
14954
15056
|
|
|
14955
|
-
|
|
14956
|
-
|
|
14957
|
-
|
|
14958
|
-
|
|
14959
|
-
|
|
15057
|
+
return toFormData$1(
|
|
15058
|
+
isFileList ? { 'files[]': data } : data,
|
|
15059
|
+
_FormData && new _FormData(),
|
|
15060
|
+
this.formSerializer
|
|
15061
|
+
);
|
|
15062
|
+
}
|
|
14960
15063
|
}
|
|
14961
|
-
}
|
|
14962
15064
|
|
|
14963
|
-
|
|
14964
|
-
|
|
14965
|
-
|
|
14966
|
-
|
|
15065
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
15066
|
+
headers.setContentType('application/json', false);
|
|
15067
|
+
return stringifySafely(data);
|
|
15068
|
+
}
|
|
14967
15069
|
|
|
14968
|
-
|
|
14969
|
-
|
|
15070
|
+
return data;
|
|
15071
|
+
},
|
|
15072
|
+
],
|
|
14970
15073
|
|
|
14971
|
-
transformResponse: [
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
|
|
15074
|
+
transformResponse: [
|
|
15075
|
+
function transformResponse(data) {
|
|
15076
|
+
const transitional = this.transitional || defaults.transitional;
|
|
15077
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
15078
|
+
const JSONRequested = this.responseType === 'json';
|
|
14975
15079
|
|
|
14976
|
-
|
|
14977
|
-
|
|
14978
|
-
|
|
15080
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
15081
|
+
return data;
|
|
15082
|
+
}
|
|
14979
15083
|
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
|
|
15084
|
+
if (
|
|
15085
|
+
data &&
|
|
15086
|
+
utils$1.isString(data) &&
|
|
15087
|
+
((forcedJSONParsing && !this.responseType) || JSONRequested)
|
|
15088
|
+
) {
|
|
15089
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
15090
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
14983
15091
|
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
|
|
15092
|
+
try {
|
|
15093
|
+
return JSON.parse(data, this.parseReviver);
|
|
15094
|
+
} catch (e) {
|
|
15095
|
+
if (strictJSONParsing) {
|
|
15096
|
+
if (e.name === 'SyntaxError') {
|
|
15097
|
+
throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
|
|
15098
|
+
}
|
|
15099
|
+
throw e;
|
|
14990
15100
|
}
|
|
14991
|
-
throw e;
|
|
14992
15101
|
}
|
|
14993
15102
|
}
|
|
14994
|
-
}
|
|
14995
15103
|
|
|
14996
|
-
|
|
14997
|
-
|
|
15104
|
+
return data;
|
|
15105
|
+
},
|
|
15106
|
+
],
|
|
14998
15107
|
|
|
14999
15108
|
/**
|
|
15000
15109
|
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
@@ -15010,7 +15119,7 @@ const defaults = {
|
|
|
15010
15119
|
|
|
15011
15120
|
env: {
|
|
15012
15121
|
FormData: platform.classes.FormData,
|
|
15013
|
-
Blob: platform.classes.Blob
|
|
15122
|
+
Blob: platform.classes.Blob,
|
|
15014
15123
|
},
|
|
15015
15124
|
|
|
15016
15125
|
validateStatus: function validateStatus(status) {
|
|
@@ -15019,10 +15128,10 @@ const defaults = {
|
|
|
15019
15128
|
|
|
15020
15129
|
headers: {
|
|
15021
15130
|
common: {
|
|
15022
|
-
|
|
15023
|
-
'Content-Type': undefined
|
|
15024
|
-
}
|
|
15025
|
-
}
|
|
15131
|
+
Accept: 'application/json, text/plain, */*',
|
|
15132
|
+
'Content-Type': undefined,
|
|
15133
|
+
},
|
|
15134
|
+
},
|
|
15026
15135
|
};
|
|
15027
15136
|
|
|
15028
15137
|
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
@@ -15032,10 +15141,23 @@ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
|
15032
15141
|
// RawAxiosHeaders whose duplicates are ignored by node
|
|
15033
15142
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
15034
15143
|
const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
15035
|
-
'age',
|
|
15036
|
-
'
|
|
15037
|
-
'
|
|
15038
|
-
'
|
|
15144
|
+
'age',
|
|
15145
|
+
'authorization',
|
|
15146
|
+
'content-length',
|
|
15147
|
+
'content-type',
|
|
15148
|
+
'etag',
|
|
15149
|
+
'expires',
|
|
15150
|
+
'from',
|
|
15151
|
+
'host',
|
|
15152
|
+
'if-modified-since',
|
|
15153
|
+
'if-unmodified-since',
|
|
15154
|
+
'last-modified',
|
|
15155
|
+
'location',
|
|
15156
|
+
'max-forwards',
|
|
15157
|
+
'proxy-authorization',
|
|
15158
|
+
'referer',
|
|
15159
|
+
'retry-after',
|
|
15160
|
+
'user-agent',
|
|
15039
15161
|
]);
|
|
15040
15162
|
|
|
15041
15163
|
/**
|
|
@@ -15052,31 +15174,32 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
15052
15174
|
*
|
|
15053
15175
|
* @returns {Object} Headers parsed into an object
|
|
15054
15176
|
*/
|
|
15055
|
-
var parseHeaders = rawHeaders => {
|
|
15177
|
+
var parseHeaders = (rawHeaders) => {
|
|
15056
15178
|
const parsed = {};
|
|
15057
15179
|
let key;
|
|
15058
15180
|
let val;
|
|
15059
15181
|
let i;
|
|
15060
15182
|
|
|
15061
|
-
rawHeaders &&
|
|
15062
|
-
|
|
15063
|
-
|
|
15064
|
-
|
|
15183
|
+
rawHeaders &&
|
|
15184
|
+
rawHeaders.split('\n').forEach(function parser(line) {
|
|
15185
|
+
i = line.indexOf(':');
|
|
15186
|
+
key = line.substring(0, i).trim().toLowerCase();
|
|
15187
|
+
val = line.substring(i + 1).trim();
|
|
15065
15188
|
|
|
15066
|
-
|
|
15067
|
-
|
|
15068
|
-
|
|
15189
|
+
if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
|
|
15190
|
+
return;
|
|
15191
|
+
}
|
|
15069
15192
|
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
|
|
15193
|
+
if (key === 'set-cookie') {
|
|
15194
|
+
if (parsed[key]) {
|
|
15195
|
+
parsed[key].push(val);
|
|
15196
|
+
} else {
|
|
15197
|
+
parsed[key] = [val];
|
|
15198
|
+
}
|
|
15073
15199
|
} else {
|
|
15074
|
-
parsed[key] = [val
|
|
15200
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
15075
15201
|
}
|
|
15076
|
-
}
|
|
15077
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
15078
|
-
}
|
|
15079
|
-
});
|
|
15202
|
+
});
|
|
15080
15203
|
|
|
15081
15204
|
return parsed;
|
|
15082
15205
|
};
|
|
@@ -15130,8 +15253,10 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
|
15130
15253
|
}
|
|
15131
15254
|
|
|
15132
15255
|
function formatHeader(header) {
|
|
15133
|
-
return header
|
|
15134
|
-
.
|
|
15256
|
+
return header
|
|
15257
|
+
.trim()
|
|
15258
|
+
.toLowerCase()
|
|
15259
|
+
.replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
15135
15260
|
return char.toUpperCase() + str;
|
|
15136
15261
|
});
|
|
15137
15262
|
}
|
|
@@ -15139,12 +15264,12 @@ function formatHeader(header) {
|
|
|
15139
15264
|
function buildAccessors(obj, header) {
|
|
15140
15265
|
const accessorName = utils$1.toCamelCase(' ' + header);
|
|
15141
15266
|
|
|
15142
|
-
['get', 'set', 'has'].forEach(methodName => {
|
|
15267
|
+
['get', 'set', 'has'].forEach((methodName) => {
|
|
15143
15268
|
Object.defineProperty(obj, methodName + accessorName, {
|
|
15144
|
-
value: function(arg1, arg2, arg3) {
|
|
15269
|
+
value: function (arg1, arg2, arg3) {
|
|
15145
15270
|
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
15146
15271
|
},
|
|
15147
|
-
configurable: true
|
|
15272
|
+
configurable: true,
|
|
15148
15273
|
});
|
|
15149
15274
|
});
|
|
15150
15275
|
}
|
|
@@ -15166,7 +15291,12 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
15166
15291
|
|
|
15167
15292
|
const key = utils$1.findKey(self, lHeader);
|
|
15168
15293
|
|
|
15169
|
-
if
|
|
15294
|
+
if (
|
|
15295
|
+
!key ||
|
|
15296
|
+
self[key] === undefined ||
|
|
15297
|
+
_rewrite === true ||
|
|
15298
|
+
(_rewrite === undefined && self[key] !== false)
|
|
15299
|
+
) {
|
|
15170
15300
|
self[key || _header] = normalizeValue(_value);
|
|
15171
15301
|
}
|
|
15172
15302
|
}
|
|
@@ -15176,17 +15306,22 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
15176
15306
|
|
|
15177
15307
|
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
|
15178
15308
|
setHeaders(header, valueOrRewrite);
|
|
15179
|
-
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
15309
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
15180
15310
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
15181
15311
|
} else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
|
|
15182
|
-
let obj = {},
|
|
15312
|
+
let obj = {},
|
|
15313
|
+
dest,
|
|
15314
|
+
key;
|
|
15183
15315
|
for (const entry of header) {
|
|
15184
15316
|
if (!utils$1.isArray(entry)) {
|
|
15185
15317
|
throw TypeError('Object iterator must return a key-value pair');
|
|
15186
15318
|
}
|
|
15187
15319
|
|
|
15188
|
-
obj[key = entry[0]] = (dest = obj[key])
|
|
15189
|
-
|
|
15320
|
+
obj[(key = entry[0])] = (dest = obj[key])
|
|
15321
|
+
? utils$1.isArray(dest)
|
|
15322
|
+
? [...dest, entry[1]]
|
|
15323
|
+
: [dest, entry[1]]
|
|
15324
|
+
: entry[1];
|
|
15190
15325
|
}
|
|
15191
15326
|
|
|
15192
15327
|
setHeaders(obj, valueOrRewrite);
|
|
@@ -15233,7 +15368,11 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
15233
15368
|
if (header) {
|
|
15234
15369
|
const key = utils$1.findKey(this, header);
|
|
15235
15370
|
|
|
15236
|
-
return !!(
|
|
15371
|
+
return !!(
|
|
15372
|
+
key &&
|
|
15373
|
+
this[key] !== undefined &&
|
|
15374
|
+
(!matcher || matchHeaderValue(this, this[key], key, matcher))
|
|
15375
|
+
);
|
|
15237
15376
|
}
|
|
15238
15377
|
|
|
15239
15378
|
return false;
|
|
@@ -15273,7 +15412,7 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
15273
15412
|
|
|
15274
15413
|
while (i--) {
|
|
15275
15414
|
const key = keys[i];
|
|
15276
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
15415
|
+
if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
15277
15416
|
delete this[key];
|
|
15278
15417
|
deleted = true;
|
|
15279
15418
|
}
|
|
@@ -15317,7 +15456,9 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
15317
15456
|
const obj = Object.create(null);
|
|
15318
15457
|
|
|
15319
15458
|
utils$1.forEach(this, (value, header) => {
|
|
15320
|
-
value != null &&
|
|
15459
|
+
value != null &&
|
|
15460
|
+
value !== false &&
|
|
15461
|
+
(obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
|
15321
15462
|
});
|
|
15322
15463
|
|
|
15323
15464
|
return obj;
|
|
@@ -15328,11 +15469,13 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
15328
15469
|
}
|
|
15329
15470
|
|
|
15330
15471
|
toString() {
|
|
15331
|
-
return Object.entries(this.toJSON())
|
|
15472
|
+
return Object.entries(this.toJSON())
|
|
15473
|
+
.map(([header, value]) => header + ': ' + value)
|
|
15474
|
+
.join('\n');
|
|
15332
15475
|
}
|
|
15333
15476
|
|
|
15334
15477
|
getSetCookie() {
|
|
15335
|
-
return this.get(
|
|
15478
|
+
return this.get('set-cookie') || [];
|
|
15336
15479
|
}
|
|
15337
15480
|
|
|
15338
15481
|
get [Symbol.toStringTag]() {
|
|
@@ -15352,9 +15495,12 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
15352
15495
|
}
|
|
15353
15496
|
|
|
15354
15497
|
static accessor(header) {
|
|
15355
|
-
const internals =
|
|
15356
|
-
|
|
15357
|
-
|
|
15498
|
+
const internals =
|
|
15499
|
+
(this[$internals] =
|
|
15500
|
+
this[$internals] =
|
|
15501
|
+
{
|
|
15502
|
+
accessors: {},
|
|
15503
|
+
});
|
|
15358
15504
|
|
|
15359
15505
|
const accessors = internals.accessors;
|
|
15360
15506
|
const prototype = this.prototype;
|
|
@@ -15374,17 +15520,24 @@ let AxiosHeaders$1 = class AxiosHeaders {
|
|
|
15374
15520
|
}
|
|
15375
15521
|
};
|
|
15376
15522
|
|
|
15377
|
-
AxiosHeaders$1.accessor([
|
|
15523
|
+
AxiosHeaders$1.accessor([
|
|
15524
|
+
'Content-Type',
|
|
15525
|
+
'Content-Length',
|
|
15526
|
+
'Accept',
|
|
15527
|
+
'Accept-Encoding',
|
|
15528
|
+
'User-Agent',
|
|
15529
|
+
'Authorization',
|
|
15530
|
+
]);
|
|
15378
15531
|
|
|
15379
15532
|
// reserved names hotfix
|
|
15380
|
-
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
|
|
15533
|
+
utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
|
|
15381
15534
|
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
15382
15535
|
return {
|
|
15383
15536
|
get: () => value,
|
|
15384
15537
|
set(headerValue) {
|
|
15385
15538
|
this[mapped] = headerValue;
|
|
15386
|
-
}
|
|
15387
|
-
}
|
|
15539
|
+
},
|
|
15540
|
+
};
|
|
15388
15541
|
});
|
|
15389
15542
|
|
|
15390
15543
|
utils$1.freezeMethods(AxiosHeaders$1);
|
|
@@ -15447,13 +15600,17 @@ function settle(resolve, reject, response) {
|
|
|
15447
15600
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
15448
15601
|
resolve(response);
|
|
15449
15602
|
} else {
|
|
15450
|
-
reject(
|
|
15451
|
-
|
|
15452
|
-
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
|
|
15456
|
-
|
|
15603
|
+
reject(
|
|
15604
|
+
new AxiosError$1(
|
|
15605
|
+
'Request failed with status code ' + response.status,
|
|
15606
|
+
[AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][
|
|
15607
|
+
Math.floor(response.status / 100) - 4
|
|
15608
|
+
],
|
|
15609
|
+
response.config,
|
|
15610
|
+
response.request,
|
|
15611
|
+
response
|
|
15612
|
+
)
|
|
15613
|
+
);
|
|
15457
15614
|
}
|
|
15458
15615
|
}
|
|
15459
15616
|
|
|
@@ -15631,7 +15788,7 @@ var followRedirects$1 = {exports: {}};
|
|
|
15631
15788
|
|
|
15632
15789
|
var src = {exports: {}};
|
|
15633
15790
|
|
|
15634
|
-
var browser
|
|
15791
|
+
var browser = {exports: {}};
|
|
15635
15792
|
|
|
15636
15793
|
/**
|
|
15637
15794
|
* Helpers.
|
|
@@ -16106,11 +16263,11 @@ function requireCommon () {
|
|
|
16106
16263
|
|
|
16107
16264
|
/* eslint-env browser */
|
|
16108
16265
|
|
|
16109
|
-
var hasRequiredBrowser
|
|
16266
|
+
var hasRequiredBrowser;
|
|
16110
16267
|
|
|
16111
|
-
function requireBrowser
|
|
16112
|
-
if (hasRequiredBrowser
|
|
16113
|
-
hasRequiredBrowser
|
|
16268
|
+
function requireBrowser () {
|
|
16269
|
+
if (hasRequiredBrowser) return browser.exports;
|
|
16270
|
+
hasRequiredBrowser = 1;
|
|
16114
16271
|
(function (module, exports$1) {
|
|
16115
16272
|
/**
|
|
16116
16273
|
* This is the web browser implementation of `debug()`.
|
|
@@ -16382,43 +16539,169 @@ function requireBrowser$1 () {
|
|
|
16382
16539
|
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
16383
16540
|
}
|
|
16384
16541
|
};
|
|
16385
|
-
} (browser
|
|
16386
|
-
return browser
|
|
16542
|
+
} (browser, browser.exports));
|
|
16543
|
+
return browser.exports;
|
|
16387
16544
|
}
|
|
16388
16545
|
|
|
16389
16546
|
var node = {exports: {}};
|
|
16390
16547
|
|
|
16391
|
-
|
|
16548
|
+
var hasFlag;
|
|
16549
|
+
var hasRequiredHasFlag;
|
|
16392
16550
|
|
|
16393
|
-
|
|
16394
|
-
|
|
16551
|
+
function requireHasFlag () {
|
|
16552
|
+
if (hasRequiredHasFlag) return hasFlag;
|
|
16553
|
+
hasRequiredHasFlag = 1;
|
|
16395
16554
|
|
|
16396
|
-
|
|
16397
|
-
|
|
16398
|
-
|
|
16555
|
+
hasFlag = (flag, argv = process.argv) => {
|
|
16556
|
+
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
16557
|
+
const position = argv.indexOf(prefix + flag);
|
|
16558
|
+
const terminatorPosition = argv.indexOf('--');
|
|
16559
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
16560
|
+
};
|
|
16561
|
+
return hasFlag;
|
|
16562
|
+
}
|
|
16563
|
+
|
|
16564
|
+
var supportsColor_1;
|
|
16565
|
+
var hasRequiredSupportsColor;
|
|
16566
|
+
|
|
16567
|
+
function requireSupportsColor () {
|
|
16568
|
+
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
16569
|
+
hasRequiredSupportsColor = 1;
|
|
16570
|
+
const os = require$$0$2;
|
|
16571
|
+
const tty = require$$1$2;
|
|
16572
|
+
const hasFlag = requireHasFlag();
|
|
16573
|
+
|
|
16574
|
+
const {env} = process;
|
|
16575
|
+
|
|
16576
|
+
let forceColor;
|
|
16577
|
+
if (hasFlag('no-color') ||
|
|
16578
|
+
hasFlag('no-colors') ||
|
|
16579
|
+
hasFlag('color=false') ||
|
|
16580
|
+
hasFlag('color=never')) {
|
|
16581
|
+
forceColor = 0;
|
|
16582
|
+
} else if (hasFlag('color') ||
|
|
16583
|
+
hasFlag('colors') ||
|
|
16584
|
+
hasFlag('color=true') ||
|
|
16585
|
+
hasFlag('color=always')) {
|
|
16586
|
+
forceColor = 1;
|
|
16587
|
+
}
|
|
16588
|
+
|
|
16589
|
+
if ('FORCE_COLOR' in env) {
|
|
16590
|
+
if (env.FORCE_COLOR === 'true') {
|
|
16591
|
+
forceColor = 1;
|
|
16592
|
+
} else if (env.FORCE_COLOR === 'false') {
|
|
16593
|
+
forceColor = 0;
|
|
16594
|
+
} else {
|
|
16595
|
+
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
16596
|
+
}
|
|
16597
|
+
}
|
|
16598
|
+
|
|
16599
|
+
function translateLevel(level) {
|
|
16600
|
+
if (level === 0) {
|
|
16601
|
+
return false;
|
|
16602
|
+
}
|
|
16603
|
+
|
|
16604
|
+
return {
|
|
16605
|
+
level,
|
|
16606
|
+
hasBasic: true,
|
|
16607
|
+
has256: level >= 2,
|
|
16608
|
+
has16m: level >= 3
|
|
16609
|
+
};
|
|
16610
|
+
}
|
|
16611
|
+
|
|
16612
|
+
function supportsColor(haveStream, streamIsTTY) {
|
|
16613
|
+
if (forceColor === 0) {
|
|
16614
|
+
return 0;
|
|
16615
|
+
}
|
|
16616
|
+
|
|
16617
|
+
if (hasFlag('color=16m') ||
|
|
16618
|
+
hasFlag('color=full') ||
|
|
16619
|
+
hasFlag('color=truecolor')) {
|
|
16620
|
+
return 3;
|
|
16621
|
+
}
|
|
16622
|
+
|
|
16623
|
+
if (hasFlag('color=256')) {
|
|
16624
|
+
return 2;
|
|
16625
|
+
}
|
|
16626
|
+
|
|
16627
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
16628
|
+
return 0;
|
|
16629
|
+
}
|
|
16630
|
+
|
|
16631
|
+
const min = forceColor || 0;
|
|
16632
|
+
|
|
16633
|
+
if (env.TERM === 'dumb') {
|
|
16634
|
+
return min;
|
|
16635
|
+
}
|
|
16636
|
+
|
|
16637
|
+
if (process.platform === 'win32') {
|
|
16638
|
+
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
16639
|
+
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
16640
|
+
const osRelease = os.release().split('.');
|
|
16641
|
+
if (
|
|
16642
|
+
Number(osRelease[0]) >= 10 &&
|
|
16643
|
+
Number(osRelease[2]) >= 10586
|
|
16644
|
+
) {
|
|
16645
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
16646
|
+
}
|
|
16647
|
+
|
|
16648
|
+
return 1;
|
|
16649
|
+
}
|
|
16650
|
+
|
|
16651
|
+
if ('CI' in env) {
|
|
16652
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
16653
|
+
return 1;
|
|
16654
|
+
}
|
|
16399
16655
|
|
|
16400
|
-
|
|
16401
|
-
|
|
16656
|
+
return min;
|
|
16657
|
+
}
|
|
16658
|
+
|
|
16659
|
+
if ('TEAMCITY_VERSION' in env) {
|
|
16660
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
16661
|
+
}
|
|
16662
|
+
|
|
16663
|
+
if (env.COLORTERM === 'truecolor') {
|
|
16664
|
+
return 3;
|
|
16665
|
+
}
|
|
16666
|
+
|
|
16667
|
+
if ('TERM_PROGRAM' in env) {
|
|
16668
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
16669
|
+
|
|
16670
|
+
switch (env.TERM_PROGRAM) {
|
|
16671
|
+
case 'iTerm.app':
|
|
16672
|
+
return version >= 3 ? 3 : 2;
|
|
16673
|
+
case 'Apple_Terminal':
|
|
16674
|
+
return 2;
|
|
16675
|
+
// No default
|
|
16676
|
+
}
|
|
16677
|
+
}
|
|
16678
|
+
|
|
16679
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
16680
|
+
return 2;
|
|
16681
|
+
}
|
|
16682
|
+
|
|
16683
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
16684
|
+
return 1;
|
|
16685
|
+
}
|
|
16402
16686
|
|
|
16403
|
-
if (
|
|
16404
|
-
return;
|
|
16687
|
+
if ('COLORTERM' in env) {
|
|
16688
|
+
return 1;
|
|
16405
16689
|
}
|
|
16406
16690
|
|
|
16407
|
-
return
|
|
16691
|
+
return min;
|
|
16408
16692
|
}
|
|
16409
16693
|
|
|
16410
|
-
|
|
16411
|
-
level
|
|
16412
|
-
|
|
16413
|
-
|
|
16414
|
-
has16m: false
|
|
16415
|
-
} : false;
|
|
16694
|
+
function getSupportLevel(stream) {
|
|
16695
|
+
const level = supportsColor(stream, stream && stream.isTTY);
|
|
16696
|
+
return translateLevel(level);
|
|
16697
|
+
}
|
|
16416
16698
|
|
|
16417
|
-
|
|
16418
|
-
|
|
16419
|
-
|
|
16699
|
+
supportsColor_1 = {
|
|
16700
|
+
supportsColor: getSupportLevel,
|
|
16701
|
+
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
16702
|
+
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
16420
16703
|
};
|
|
16421
|
-
return
|
|
16704
|
+
return supportsColor_1;
|
|
16422
16705
|
}
|
|
16423
16706
|
|
|
16424
16707
|
/**
|
|
@@ -16431,7 +16714,7 @@ function requireNode () {
|
|
|
16431
16714
|
if (hasRequiredNode) return node.exports;
|
|
16432
16715
|
hasRequiredNode = 1;
|
|
16433
16716
|
(function (module, exports$1) {
|
|
16434
|
-
const tty = require$$
|
|
16717
|
+
const tty = require$$1$2;
|
|
16435
16718
|
const util = require$$1;
|
|
16436
16719
|
|
|
16437
16720
|
/**
|
|
@@ -16458,7 +16741,7 @@ function requireNode () {
|
|
|
16458
16741
|
try {
|
|
16459
16742
|
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
16460
16743
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
16461
|
-
const supportsColor =
|
|
16744
|
+
const supportsColor = requireSupportsColor();
|
|
16462
16745
|
|
|
16463
16746
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
16464
16747
|
exports$1.colors = [
|
|
@@ -16705,7 +16988,7 @@ function requireSrc () {
|
|
|
16705
16988
|
if (hasRequiredSrc) return src.exports;
|
|
16706
16989
|
hasRequiredSrc = 1;
|
|
16707
16990
|
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
|
16708
|
-
src.exports = requireBrowser
|
|
16991
|
+
src.exports = requireBrowser();
|
|
16709
16992
|
} else {
|
|
16710
16993
|
src.exports = requireNode();
|
|
16711
16994
|
}
|
|
@@ -17433,11 +17716,11 @@ function requireFollowRedirects () {
|
|
|
17433
17716
|
var followRedirectsExports = requireFollowRedirects();
|
|
17434
17717
|
var followRedirects = /*@__PURE__*/getDefaultExportFromCjs(followRedirectsExports);
|
|
17435
17718
|
|
|
17436
|
-
const VERSION$1 = "1.13.
|
|
17719
|
+
const VERSION$1 = "1.13.6";
|
|
17437
17720
|
|
|
17438
17721
|
function parseProtocol(url) {
|
|
17439
17722
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
17440
|
-
return match && match[1] || '';
|
|
17723
|
+
return (match && match[1]) || '';
|
|
17441
17724
|
}
|
|
17442
17725
|
|
|
17443
17726
|
const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
@@ -17453,7 +17736,7 @@ const DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
|
17453
17736
|
* @returns {Buffer|Blob}
|
|
17454
17737
|
*/
|
|
17455
17738
|
function fromDataURI(uri, asBlob, options) {
|
|
17456
|
-
const _Blob = options && options.Blob || platform.classes.Blob;
|
|
17739
|
+
const _Blob = (options && options.Blob) || platform.classes.Blob;
|
|
17457
17740
|
const protocol = parseProtocol(uri);
|
|
17458
17741
|
|
|
17459
17742
|
if (asBlob === undefined && _Blob) {
|
|
@@ -17479,7 +17762,7 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
17479
17762
|
throw new AxiosError$1('Blob is not supported', AxiosError$1.ERR_NOT_SUPPORT);
|
|
17480
17763
|
}
|
|
17481
17764
|
|
|
17482
|
-
return new _Blob([buffer], {type: mime});
|
|
17765
|
+
return new _Blob([buffer], { type: mime });
|
|
17483
17766
|
}
|
|
17484
17767
|
|
|
17485
17768
|
return buffer;
|
|
@@ -17490,24 +17773,29 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
17490
17773
|
|
|
17491
17774
|
const kInternals = Symbol('internals');
|
|
17492
17775
|
|
|
17493
|
-
class AxiosTransformStream extends stream.Transform{
|
|
17776
|
+
class AxiosTransformStream extends stream.Transform {
|
|
17494
17777
|
constructor(options) {
|
|
17495
|
-
options = utils$1.toFlatObject(
|
|
17496
|
-
|
|
17497
|
-
|
|
17498
|
-
|
|
17499
|
-
|
|
17500
|
-
|
|
17501
|
-
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17778
|
+
options = utils$1.toFlatObject(
|
|
17779
|
+
options,
|
|
17780
|
+
{
|
|
17781
|
+
maxRate: 0,
|
|
17782
|
+
chunkSize: 64 * 1024,
|
|
17783
|
+
minChunkSize: 100,
|
|
17784
|
+
timeWindow: 500,
|
|
17785
|
+
ticksRate: 2,
|
|
17786
|
+
samplesCount: 15,
|
|
17787
|
+
},
|
|
17788
|
+
null,
|
|
17789
|
+
(prop, source) => {
|
|
17790
|
+
return !utils$1.isUndefined(source[prop]);
|
|
17791
|
+
}
|
|
17792
|
+
);
|
|
17505
17793
|
|
|
17506
17794
|
super({
|
|
17507
|
-
readableHighWaterMark: options.chunkSize
|
|
17795
|
+
readableHighWaterMark: options.chunkSize,
|
|
17508
17796
|
});
|
|
17509
17797
|
|
|
17510
|
-
const internals = this[kInternals] = {
|
|
17798
|
+
const internals = (this[kInternals] = {
|
|
17511
17799
|
timeWindow: options.timeWindow,
|
|
17512
17800
|
chunkSize: options.chunkSize,
|
|
17513
17801
|
maxRate: options.maxRate,
|
|
@@ -17517,10 +17805,10 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
17517
17805
|
notifiedBytesLoaded: 0,
|
|
17518
17806
|
ts: Date.now(),
|
|
17519
17807
|
bytes: 0,
|
|
17520
|
-
onReadCallback: null
|
|
17521
|
-
};
|
|
17808
|
+
onReadCallback: null,
|
|
17809
|
+
});
|
|
17522
17810
|
|
|
17523
|
-
this.on('newListener', event => {
|
|
17811
|
+
this.on('newListener', (event) => {
|
|
17524
17812
|
if (event === 'progress') {
|
|
17525
17813
|
if (!internals.isCaptured) {
|
|
17526
17814
|
internals.isCaptured = true;
|
|
@@ -17548,8 +17836,11 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
17548
17836
|
const timeWindow = internals.timeWindow;
|
|
17549
17837
|
|
|
17550
17838
|
const divider = 1000 / timeWindow;
|
|
17551
|
-
const bytesThreshold =
|
|
17552
|
-
const minChunkSize =
|
|
17839
|
+
const bytesThreshold = maxRate / divider;
|
|
17840
|
+
const minChunkSize =
|
|
17841
|
+
internals.minChunkSize !== false
|
|
17842
|
+
? Math.max(internals.minChunkSize, bytesThreshold * 0.01)
|
|
17843
|
+
: 0;
|
|
17553
17844
|
|
|
17554
17845
|
const pushChunk = (_chunk, _callback) => {
|
|
17555
17846
|
const bytes = Buffer.byteLength(_chunk);
|
|
@@ -17578,7 +17869,7 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
17578
17869
|
if (maxRate) {
|
|
17579
17870
|
const now = Date.now();
|
|
17580
17871
|
|
|
17581
|
-
if (!internals.ts || (passed =
|
|
17872
|
+
if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
|
|
17582
17873
|
internals.ts = now;
|
|
17583
17874
|
bytesLeft = bytesThreshold - internals.bytes;
|
|
17584
17875
|
internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
|
|
@@ -17601,14 +17892,19 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
17601
17892
|
}
|
|
17602
17893
|
}
|
|
17603
17894
|
|
|
17604
|
-
if (maxChunkSize && chunkSize > maxChunkSize &&
|
|
17895
|
+
if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
|
|
17605
17896
|
chunkRemainder = _chunk.subarray(maxChunkSize);
|
|
17606
17897
|
_chunk = _chunk.subarray(0, maxChunkSize);
|
|
17607
17898
|
}
|
|
17608
17899
|
|
|
17609
|
-
pushChunk(
|
|
17610
|
-
|
|
17611
|
-
|
|
17900
|
+
pushChunk(
|
|
17901
|
+
_chunk,
|
|
17902
|
+
chunkRemainder
|
|
17903
|
+
? () => {
|
|
17904
|
+
process.nextTick(_callback, null, chunkRemainder);
|
|
17905
|
+
}
|
|
17906
|
+
: _callback
|
|
17907
|
+
);
|
|
17612
17908
|
};
|
|
17613
17909
|
|
|
17614
17910
|
transformChunk(chunk, function transformNextChunk(err, _chunk) {
|
|
@@ -17625,7 +17921,7 @@ class AxiosTransformStream extends stream.Transform{
|
|
|
17625
17921
|
}
|
|
17626
17922
|
}
|
|
17627
17923
|
|
|
17628
|
-
const {asyncIterator} = Symbol;
|
|
17924
|
+
const { asyncIterator } = Symbol;
|
|
17629
17925
|
|
|
17630
17926
|
const readBlob = async function* (blob) {
|
|
17631
17927
|
if (blob.stream) {
|
|
@@ -17649,7 +17945,7 @@ const CRLF_BYTES_COUNT = 2;
|
|
|
17649
17945
|
|
|
17650
17946
|
class FormDataPart {
|
|
17651
17947
|
constructor(name, value) {
|
|
17652
|
-
const {escapeName} = this.constructor;
|
|
17948
|
+
const { escapeName } = this.constructor;
|
|
17653
17949
|
const isStringValue = utils$1.isString(value);
|
|
17654
17950
|
|
|
17655
17951
|
let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${
|
|
@@ -17659,7 +17955,7 @@ class FormDataPart {
|
|
|
17659
17955
|
if (isStringValue) {
|
|
17660
17956
|
value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
|
|
17661
17957
|
} else {
|
|
17662
|
-
headers += `Content-Type: ${value.type ||
|
|
17958
|
+
headers += `Content-Type: ${value.type || 'application/octet-stream'}${CRLF}`;
|
|
17663
17959
|
}
|
|
17664
17960
|
|
|
17665
17961
|
this.headers = textEncoder.encode(headers + CRLF);
|
|
@@ -17672,12 +17968,12 @@ class FormDataPart {
|
|
|
17672
17968
|
this.value = value;
|
|
17673
17969
|
}
|
|
17674
17970
|
|
|
17675
|
-
async *encode(){
|
|
17971
|
+
async *encode() {
|
|
17676
17972
|
yield this.headers;
|
|
17677
17973
|
|
|
17678
|
-
const {value} = this;
|
|
17974
|
+
const { value } = this;
|
|
17679
17975
|
|
|
17680
|
-
if(utils$1.isTypedArray(value)) {
|
|
17976
|
+
if (utils$1.isTypedArray(value)) {
|
|
17681
17977
|
yield value;
|
|
17682
17978
|
} else {
|
|
17683
17979
|
yield* readBlob(value);
|
|
@@ -17687,11 +17983,15 @@ class FormDataPart {
|
|
|
17687
17983
|
}
|
|
17688
17984
|
|
|
17689
17985
|
static escapeName(name) {
|
|
17690
|
-
|
|
17691
|
-
|
|
17692
|
-
|
|
17693
|
-
|
|
17694
|
-
|
|
17986
|
+
return String(name).replace(
|
|
17987
|
+
/[\r\n"]/g,
|
|
17988
|
+
(match) =>
|
|
17989
|
+
({
|
|
17990
|
+
'\r': '%0D',
|
|
17991
|
+
'\n': '%0A',
|
|
17992
|
+
'"': '%22',
|
|
17993
|
+
})[match]
|
|
17994
|
+
);
|
|
17695
17995
|
}
|
|
17696
17996
|
}
|
|
17697
17997
|
|
|
@@ -17699,15 +17999,15 @@ const formDataToStream = (form, headersHandler, options) => {
|
|
|
17699
17999
|
const {
|
|
17700
18000
|
tag = 'form-data-boundary',
|
|
17701
18001
|
size = 25,
|
|
17702
|
-
boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET)
|
|
18002
|
+
boundary = tag + '-' + platform.generateString(size, BOUNDARY_ALPHABET),
|
|
17703
18003
|
} = options || {};
|
|
17704
18004
|
|
|
17705
|
-
if(!utils$1.isFormData(form)) {
|
|
18005
|
+
if (!utils$1.isFormData(form)) {
|
|
17706
18006
|
throw TypeError('FormData instance required');
|
|
17707
18007
|
}
|
|
17708
18008
|
|
|
17709
18009
|
if (boundary.length < 1 || boundary.length > 70) {
|
|
17710
|
-
throw Error('boundary must be 10-70 characters long')
|
|
18010
|
+
throw Error('boundary must be 10-70 characters long');
|
|
17711
18011
|
}
|
|
17712
18012
|
|
|
17713
18013
|
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
|
|
@@ -17725,7 +18025,7 @@ const formDataToStream = (form, headersHandler, options) => {
|
|
|
17725
18025
|
contentLength = utils$1.toFiniteNumber(contentLength);
|
|
17726
18026
|
|
|
17727
18027
|
const computedHeaders = {
|
|
17728
|
-
'Content-Type': `multipart/form-data; boundary=${boundary}
|
|
18028
|
+
'Content-Type': `multipart/form-data; boundary=${boundary}`,
|
|
17729
18029
|
};
|
|
17730
18030
|
|
|
17731
18031
|
if (Number.isFinite(contentLength)) {
|
|
@@ -17734,14 +18034,16 @@ const formDataToStream = (form, headersHandler, options) => {
|
|
|
17734
18034
|
|
|
17735
18035
|
headersHandler && headersHandler(computedHeaders);
|
|
17736
18036
|
|
|
17737
|
-
return stream.Readable.from(
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
18037
|
+
return stream.Readable.from(
|
|
18038
|
+
(async function* () {
|
|
18039
|
+
for (const part of parts) {
|
|
18040
|
+
yield boundaryBytes;
|
|
18041
|
+
yield* part.encode();
|
|
18042
|
+
}
|
|
17742
18043
|
|
|
17743
|
-
|
|
17744
|
-
|
|
18044
|
+
yield footerBytes;
|
|
18045
|
+
})()
|
|
18046
|
+
);
|
|
17745
18047
|
};
|
|
17746
18048
|
|
|
17747
18049
|
class ZlibHeaderTransformStream extends stream.Transform {
|
|
@@ -17755,10 +18057,11 @@ class ZlibHeaderTransformStream extends stream.Transform {
|
|
|
17755
18057
|
this._transform = this.__transform;
|
|
17756
18058
|
|
|
17757
18059
|
// Add Default Compression headers if no zlib headers are present
|
|
17758
|
-
if (chunk[0] !== 120) {
|
|
18060
|
+
if (chunk[0] !== 120) {
|
|
18061
|
+
// Hex: 78
|
|
17759
18062
|
const header = Buffer.alloc(2);
|
|
17760
18063
|
header[0] = 120; // Hex: 78
|
|
17761
|
-
header[1] = 156; // Hex: 9C
|
|
18064
|
+
header[1] = 156; // Hex: 9C
|
|
17762
18065
|
this.push(header, encoding);
|
|
17763
18066
|
}
|
|
17764
18067
|
}
|
|
@@ -17768,16 +18071,18 @@ class ZlibHeaderTransformStream extends stream.Transform {
|
|
|
17768
18071
|
}
|
|
17769
18072
|
|
|
17770
18073
|
const callbackify = (fn, reducer) => {
|
|
17771
|
-
return utils$1.isAsyncFn(fn)
|
|
17772
|
-
|
|
17773
|
-
|
|
17774
|
-
|
|
17775
|
-
|
|
17776
|
-
|
|
17777
|
-
|
|
18074
|
+
return utils$1.isAsyncFn(fn)
|
|
18075
|
+
? function (...args) {
|
|
18076
|
+
const cb = args.pop();
|
|
18077
|
+
fn.apply(this, args).then((value) => {
|
|
18078
|
+
try {
|
|
18079
|
+
reducer ? cb(null, ...reducer(value)) : cb(null, value);
|
|
18080
|
+
} catch (err) {
|
|
18081
|
+
cb(err);
|
|
18082
|
+
}
|
|
18083
|
+
}, cb);
|
|
17778
18084
|
}
|
|
17779
|
-
|
|
17780
|
-
} : fn;
|
|
18085
|
+
: fn;
|
|
17781
18086
|
};
|
|
17782
18087
|
|
|
17783
18088
|
/**
|
|
@@ -17828,7 +18133,7 @@ function speedometer(samplesCount, min) {
|
|
|
17828
18133
|
|
|
17829
18134
|
const passed = startedAt && now - startedAt;
|
|
17830
18135
|
|
|
17831
|
-
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
18136
|
+
return passed ? Math.round((bytesCount * 1000) / passed) : undefined;
|
|
17832
18137
|
};
|
|
17833
18138
|
}
|
|
17834
18139
|
|
|
@@ -17857,7 +18162,7 @@ function throttle(fn, freq) {
|
|
|
17857
18162
|
const throttled = (...args) => {
|
|
17858
18163
|
const now = Date.now();
|
|
17859
18164
|
const passed = now - timestamp;
|
|
17860
|
-
if (
|
|
18165
|
+
if (passed >= threshold) {
|
|
17861
18166
|
invoke(args, now);
|
|
17862
18167
|
} else {
|
|
17863
18168
|
lastArgs = args;
|
|
@@ -17879,7 +18184,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
17879
18184
|
let bytesNotified = 0;
|
|
17880
18185
|
const _speedometer = speedometer(50, 250);
|
|
17881
18186
|
|
|
17882
|
-
return throttle(e => {
|
|
18187
|
+
return throttle((e) => {
|
|
17883
18188
|
const loaded = e.loaded;
|
|
17884
18189
|
const total = e.lengthComputable ? e.total : undefined;
|
|
17885
18190
|
const progressBytes = loaded - bytesNotified;
|
|
@@ -17891,13 +18196,13 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
17891
18196
|
const data = {
|
|
17892
18197
|
loaded,
|
|
17893
18198
|
total,
|
|
17894
|
-
progress: total ?
|
|
18199
|
+
progress: total ? loaded / total : undefined,
|
|
17895
18200
|
bytes: progressBytes,
|
|
17896
18201
|
rate: rate ? rate : undefined,
|
|
17897
18202
|
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
17898
18203
|
event: e,
|
|
17899
18204
|
lengthComputable: total != null,
|
|
17900
|
-
[isDownloadStream ? 'download' : 'upload']: true
|
|
18205
|
+
[isDownloadStream ? 'download' : 'upload']: true,
|
|
17901
18206
|
};
|
|
17902
18207
|
|
|
17903
18208
|
listener(data);
|
|
@@ -17907,14 +18212,21 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
17907
18212
|
const progressEventDecorator = (total, throttled) => {
|
|
17908
18213
|
const lengthComputable = total != null;
|
|
17909
18214
|
|
|
17910
|
-
return [
|
|
17911
|
-
|
|
17912
|
-
|
|
17913
|
-
|
|
17914
|
-
|
|
18215
|
+
return [
|
|
18216
|
+
(loaded) =>
|
|
18217
|
+
throttled[0]({
|
|
18218
|
+
lengthComputable,
|
|
18219
|
+
total,
|
|
18220
|
+
loaded,
|
|
18221
|
+
}),
|
|
18222
|
+
throttled[1],
|
|
18223
|
+
];
|
|
17915
18224
|
};
|
|
17916
18225
|
|
|
17917
|
-
const asyncDecorator =
|
|
18226
|
+
const asyncDecorator =
|
|
18227
|
+
(fn) =>
|
|
18228
|
+
(...args) =>
|
|
18229
|
+
utils$1.asap(() => fn(...args));
|
|
17918
18230
|
|
|
17919
18231
|
/**
|
|
17920
18232
|
* Estimate decoded byte length of a data:// URL *without* allocating large buffers.
|
|
@@ -17992,29 +18304,26 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
17992
18304
|
|
|
17993
18305
|
const zlibOptions = {
|
|
17994
18306
|
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
17995
|
-
finishFlush: zlib.constants.Z_SYNC_FLUSH
|
|
18307
|
+
finishFlush: zlib.constants.Z_SYNC_FLUSH,
|
|
17996
18308
|
};
|
|
17997
18309
|
|
|
17998
18310
|
const brotliOptions = {
|
|
17999
18311
|
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
18000
|
-
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
|
|
18312
|
+
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH,
|
|
18001
18313
|
};
|
|
18002
18314
|
|
|
18003
18315
|
const isBrotliSupported = utils$1.isFunction(zlib.createBrotliDecompress);
|
|
18004
18316
|
|
|
18005
|
-
const {http: httpFollow, https: httpsFollow} = followRedirects;
|
|
18317
|
+
const { http: httpFollow, https: httpsFollow } = followRedirects;
|
|
18006
18318
|
|
|
18007
18319
|
const isHttps = /https:?/;
|
|
18008
18320
|
|
|
18009
|
-
const supportedProtocols = platform.protocols.map(protocol => {
|
|
18321
|
+
const supportedProtocols = platform.protocols.map((protocol) => {
|
|
18010
18322
|
return protocol + ':';
|
|
18011
18323
|
});
|
|
18012
18324
|
|
|
18013
|
-
|
|
18014
18325
|
const flushOnFinish = (stream, [throttled, flush]) => {
|
|
18015
|
-
stream
|
|
18016
|
-
.on('end', flush)
|
|
18017
|
-
.on('error', flush);
|
|
18326
|
+
stream.on('end', flush).on('error', flush);
|
|
18018
18327
|
|
|
18019
18328
|
return throttled;
|
|
18020
18329
|
};
|
|
@@ -18025,9 +18334,12 @@ class Http2Sessions {
|
|
|
18025
18334
|
}
|
|
18026
18335
|
|
|
18027
18336
|
getSession(authority, options) {
|
|
18028
|
-
options = Object.assign(
|
|
18029
|
-
|
|
18030
|
-
|
|
18337
|
+
options = Object.assign(
|
|
18338
|
+
{
|
|
18339
|
+
sessionTimeout: 1000,
|
|
18340
|
+
},
|
|
18341
|
+
options
|
|
18342
|
+
);
|
|
18031
18343
|
|
|
18032
18344
|
let authoritySessions = this.sessions[authority];
|
|
18033
18345
|
|
|
@@ -18036,7 +18348,11 @@ class Http2Sessions {
|
|
|
18036
18348
|
|
|
18037
18349
|
for (let i = 0; i < len; i++) {
|
|
18038
18350
|
const [sessionHandle, sessionOptions] = authoritySessions[i];
|
|
18039
|
-
if (
|
|
18351
|
+
if (
|
|
18352
|
+
!sessionHandle.destroyed &&
|
|
18353
|
+
!sessionHandle.closed &&
|
|
18354
|
+
require$$1.isDeepStrictEqual(sessionOptions, options)
|
|
18355
|
+
) {
|
|
18040
18356
|
return sessionHandle;
|
|
18041
18357
|
}
|
|
18042
18358
|
}
|
|
@@ -18053,7 +18369,9 @@ class Http2Sessions {
|
|
|
18053
18369
|
|
|
18054
18370
|
removed = true;
|
|
18055
18371
|
|
|
18056
|
-
let entries = authoritySessions,
|
|
18372
|
+
let entries = authoritySessions,
|
|
18373
|
+
len = entries.length,
|
|
18374
|
+
i = len;
|
|
18057
18375
|
|
|
18058
18376
|
while (i--) {
|
|
18059
18377
|
if (entries[i][0] === session) {
|
|
@@ -18069,10 +18387,9 @@ class Http2Sessions {
|
|
|
18069
18387
|
|
|
18070
18388
|
const originalRequestFn = session.request;
|
|
18071
18389
|
|
|
18072
|
-
const {sessionTimeout} = options;
|
|
18073
|
-
|
|
18074
|
-
if(sessionTimeout != null) {
|
|
18390
|
+
const { sessionTimeout } = options;
|
|
18075
18391
|
|
|
18392
|
+
if (sessionTimeout != null) {
|
|
18076
18393
|
let timer;
|
|
18077
18394
|
let streamsCount = 0;
|
|
18078
18395
|
|
|
@@ -18101,12 +18418,11 @@ class Http2Sessions {
|
|
|
18101
18418
|
|
|
18102
18419
|
session.once('close', removeSession);
|
|
18103
18420
|
|
|
18104
|
-
let entry = [
|
|
18105
|
-
session,
|
|
18106
|
-
options
|
|
18107
|
-
];
|
|
18421
|
+
let entry = [session, options];
|
|
18108
18422
|
|
|
18109
|
-
authoritySessions
|
|
18423
|
+
authoritySessions
|
|
18424
|
+
? authoritySessions.push(entry)
|
|
18425
|
+
: (authoritySessions = this.sessions[authority] = [entry]);
|
|
18110
18426
|
|
|
18111
18427
|
return session;
|
|
18112
18428
|
}
|
|
@@ -18114,7 +18430,6 @@ class Http2Sessions {
|
|
|
18114
18430
|
|
|
18115
18431
|
const http2Sessions = new Http2Sessions();
|
|
18116
18432
|
|
|
18117
|
-
|
|
18118
18433
|
/**
|
|
18119
18434
|
* If the proxy or config beforeRedirects functions are defined, call them with the options
|
|
18120
18435
|
* object.
|
|
@@ -18189,7 +18504,8 @@ function setProxy(options, configProxy, location) {
|
|
|
18189
18504
|
};
|
|
18190
18505
|
}
|
|
18191
18506
|
|
|
18192
|
-
const isHttpAdapterSupported =
|
|
18507
|
+
const isHttpAdapterSupported =
|
|
18508
|
+
typeof process !== 'undefined' && utils$1.kindOf(process) === 'process';
|
|
18193
18509
|
|
|
18194
18510
|
// temporary hotfix
|
|
18195
18511
|
|
|
@@ -18215,713 +18531,753 @@ const wrapAsync = (asyncExecutor) => {
|
|
|
18215
18531
|
};
|
|
18216
18532
|
|
|
18217
18533
|
asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
|
|
18218
|
-
})
|
|
18534
|
+
});
|
|
18219
18535
|
};
|
|
18220
18536
|
|
|
18221
|
-
const resolveFamily = ({address, family}) => {
|
|
18537
|
+
const resolveFamily = ({ address, family }) => {
|
|
18222
18538
|
if (!utils$1.isString(address)) {
|
|
18223
18539
|
throw TypeError('address must be a string');
|
|
18224
18540
|
}
|
|
18225
|
-
return
|
|
18541
|
+
return {
|
|
18226
18542
|
address,
|
|
18227
|
-
family: family || (address.indexOf('.') < 0 ? 6 : 4)
|
|
18228
|
-
}
|
|
18543
|
+
family: family || (address.indexOf('.') < 0 ? 6 : 4),
|
|
18544
|
+
};
|
|
18229
18545
|
};
|
|
18230
18546
|
|
|
18231
|
-
const buildAddressEntry = (address, family) =>
|
|
18547
|
+
const buildAddressEntry = (address, family) =>
|
|
18548
|
+
resolveFamily(utils$1.isObject(address) ? address : { address, family });
|
|
18232
18549
|
|
|
18233
18550
|
const http2Transport = {
|
|
18234
18551
|
request(options, cb) {
|
|
18235
|
-
|
|
18236
|
-
|
|
18552
|
+
const authority =
|
|
18553
|
+
options.protocol +
|
|
18554
|
+
'//' +
|
|
18555
|
+
options.hostname +
|
|
18556
|
+
':' +
|
|
18557
|
+
(options.port || (options.protocol === 'https:' ? 443 : 80));
|
|
18237
18558
|
|
|
18238
|
-
|
|
18559
|
+
const { http2Options, headers } = options;
|
|
18239
18560
|
|
|
18240
|
-
|
|
18561
|
+
const session = http2Sessions.getSession(authority, http2Options);
|
|
18241
18562
|
|
|
18242
|
-
|
|
18243
|
-
|
|
18244
|
-
HTTP2_HEADER_METHOD,
|
|
18245
|
-
HTTP2_HEADER_PATH,
|
|
18246
|
-
HTTP2_HEADER_STATUS
|
|
18247
|
-
} = http2.constants;
|
|
18563
|
+
const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS } =
|
|
18564
|
+
http2.constants;
|
|
18248
18565
|
|
|
18249
|
-
|
|
18250
|
-
|
|
18251
|
-
|
|
18252
|
-
|
|
18253
|
-
|
|
18566
|
+
const http2Headers = {
|
|
18567
|
+
[HTTP2_HEADER_SCHEME]: options.protocol.replace(':', ''),
|
|
18568
|
+
[HTTP2_HEADER_METHOD]: options.method,
|
|
18569
|
+
[HTTP2_HEADER_PATH]: options.path,
|
|
18570
|
+
};
|
|
18254
18571
|
|
|
18255
|
-
|
|
18256
|
-
|
|
18257
|
-
|
|
18572
|
+
utils$1.forEach(headers, (header, name) => {
|
|
18573
|
+
name.charAt(0) !== ':' && (http2Headers[name] = header);
|
|
18574
|
+
});
|
|
18258
18575
|
|
|
18259
|
-
|
|
18576
|
+
const req = session.request(http2Headers);
|
|
18260
18577
|
|
|
18261
|
-
|
|
18262
|
-
|
|
18578
|
+
req.once('response', (responseHeaders) => {
|
|
18579
|
+
const response = req; //duplex
|
|
18263
18580
|
|
|
18264
|
-
|
|
18581
|
+
responseHeaders = Object.assign({}, responseHeaders);
|
|
18265
18582
|
|
|
18266
|
-
|
|
18583
|
+
const status = responseHeaders[HTTP2_HEADER_STATUS];
|
|
18267
18584
|
|
|
18268
|
-
|
|
18585
|
+
delete responseHeaders[HTTP2_HEADER_STATUS];
|
|
18269
18586
|
|
|
18270
|
-
|
|
18587
|
+
response.headers = responseHeaders;
|
|
18271
18588
|
|
|
18272
|
-
|
|
18589
|
+
response.statusCode = +status;
|
|
18273
18590
|
|
|
18274
|
-
|
|
18275
|
-
|
|
18591
|
+
cb(response);
|
|
18592
|
+
});
|
|
18276
18593
|
|
|
18277
|
-
|
|
18278
|
-
}
|
|
18594
|
+
return req;
|
|
18595
|
+
},
|
|
18279
18596
|
};
|
|
18280
18597
|
|
|
18281
18598
|
/*eslint consistent-return:0*/
|
|
18282
|
-
var httpAdapter = isHttpAdapterSupported &&
|
|
18283
|
-
|
|
18284
|
-
|
|
18285
|
-
|
|
18286
|
-
|
|
18287
|
-
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
|
|
18291
|
-
|
|
18292
|
-
|
|
18293
|
-
|
|
18294
|
-
|
|
18295
|
-
|
|
18296
|
-
|
|
18297
|
-
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
18298
|
-
throw TypeError(`Unsupported protocol version '${httpVersion}'`);
|
|
18299
|
-
}
|
|
18300
|
-
|
|
18301
|
-
const isHttp2 = httpVersion === 2;
|
|
18599
|
+
var httpAdapter = isHttpAdapterSupported &&
|
|
18600
|
+
function httpAdapter(config) {
|
|
18601
|
+
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
18602
|
+
let { data, lookup, family, httpVersion = 1, http2Options } = config;
|
|
18603
|
+
const { responseType, responseEncoding } = config;
|
|
18604
|
+
const method = config.method.toUpperCase();
|
|
18605
|
+
let isDone;
|
|
18606
|
+
let rejected = false;
|
|
18607
|
+
let req;
|
|
18608
|
+
|
|
18609
|
+
httpVersion = +httpVersion;
|
|
18610
|
+
|
|
18611
|
+
if (Number.isNaN(httpVersion)) {
|
|
18612
|
+
throw TypeError(`Invalid protocol version: '${config.httpVersion}' is not a number`);
|
|
18613
|
+
}
|
|
18302
18614
|
|
|
18303
|
-
|
|
18304
|
-
|
|
18305
|
-
|
|
18306
|
-
lookup = (hostname, opt, cb) => {
|
|
18307
|
-
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
18308
|
-
if (err) {
|
|
18309
|
-
return cb(err);
|
|
18310
|
-
}
|
|
18615
|
+
if (httpVersion !== 1 && httpVersion !== 2) {
|
|
18616
|
+
throw TypeError(`Unsupported protocol version '${httpVersion}'`);
|
|
18617
|
+
}
|
|
18311
18618
|
|
|
18312
|
-
|
|
18619
|
+
const isHttp2 = httpVersion === 2;
|
|
18313
18620
|
|
|
18314
|
-
|
|
18315
|
-
|
|
18316
|
-
|
|
18317
|
-
|
|
18621
|
+
if (lookup) {
|
|
18622
|
+
const _lookup = callbackify(lookup, (value) => (utils$1.isArray(value) ? value : [value]));
|
|
18623
|
+
// hotfix to support opt.all option which is required for node 20.x
|
|
18624
|
+
lookup = (hostname, opt, cb) => {
|
|
18625
|
+
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
18626
|
+
if (err) {
|
|
18627
|
+
return cb(err);
|
|
18628
|
+
}
|
|
18318
18629
|
|
|
18319
|
-
|
|
18630
|
+
const addresses = utils$1.isArray(arg0)
|
|
18631
|
+
? arg0.map((addr) => buildAddressEntry(addr))
|
|
18632
|
+
: [buildAddressEntry(arg0, arg1)];
|
|
18320
18633
|
|
|
18321
|
-
|
|
18322
|
-
|
|
18323
|
-
|
|
18324
|
-
} catch(err) {
|
|
18325
|
-
console.warn('emit error', err);
|
|
18634
|
+
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
18635
|
+
});
|
|
18636
|
+
};
|
|
18326
18637
|
}
|
|
18327
|
-
}
|
|
18328
18638
|
|
|
18329
|
-
|
|
18639
|
+
const abortEmitter = new events.EventEmitter();
|
|
18330
18640
|
|
|
18331
|
-
|
|
18332
|
-
|
|
18333
|
-
|
|
18641
|
+
function abort(reason) {
|
|
18642
|
+
try {
|
|
18643
|
+
abortEmitter.emit(
|
|
18644
|
+
'abort',
|
|
18645
|
+
!reason || reason.type ? new CanceledError$1(null, config, req) : reason
|
|
18646
|
+
);
|
|
18647
|
+
} catch (err) {
|
|
18648
|
+
console.warn('emit error', err);
|
|
18649
|
+
}
|
|
18334
18650
|
}
|
|
18335
18651
|
|
|
18336
|
-
|
|
18337
|
-
config.signal.removeEventListener('abort', abort);
|
|
18338
|
-
}
|
|
18652
|
+
abortEmitter.once('abort', reject);
|
|
18339
18653
|
|
|
18340
|
-
|
|
18341
|
-
|
|
18654
|
+
const onFinished = () => {
|
|
18655
|
+
if (config.cancelToken) {
|
|
18656
|
+
config.cancelToken.unsubscribe(abort);
|
|
18657
|
+
}
|
|
18342
18658
|
|
|
18343
|
-
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
|
|
18347
|
-
}
|
|
18348
|
-
}
|
|
18659
|
+
if (config.signal) {
|
|
18660
|
+
config.signal.removeEventListener('abort', abort);
|
|
18661
|
+
}
|
|
18349
18662
|
|
|
18350
|
-
|
|
18351
|
-
|
|
18663
|
+
abortEmitter.removeAllListeners();
|
|
18664
|
+
};
|
|
18352
18665
|
|
|
18353
|
-
if (
|
|
18354
|
-
|
|
18355
|
-
|
|
18356
|
-
|
|
18666
|
+
if (config.cancelToken || config.signal) {
|
|
18667
|
+
config.cancelToken && config.cancelToken.subscribe(abort);
|
|
18668
|
+
if (config.signal) {
|
|
18669
|
+
config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
|
|
18670
|
+
}
|
|
18357
18671
|
}
|
|
18358
18672
|
|
|
18359
|
-
|
|
18673
|
+
onDone((response, isRejected) => {
|
|
18674
|
+
isDone = true;
|
|
18360
18675
|
|
|
18361
|
-
|
|
18362
|
-
|
|
18363
|
-
offListeners();
|
|
18676
|
+
if (isRejected) {
|
|
18677
|
+
rejected = true;
|
|
18364
18678
|
onFinished();
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
onFinished();
|
|
18368
|
-
}
|
|
18369
|
-
});
|
|
18679
|
+
return;
|
|
18680
|
+
}
|
|
18370
18681
|
|
|
18682
|
+
const { data } = response;
|
|
18371
18683
|
|
|
18684
|
+
if (data instanceof stream.Readable || data instanceof stream.Duplex) {
|
|
18685
|
+
const offListeners = stream.finished(data, () => {
|
|
18686
|
+
offListeners();
|
|
18687
|
+
onFinished();
|
|
18688
|
+
});
|
|
18689
|
+
} else {
|
|
18690
|
+
onFinished();
|
|
18691
|
+
}
|
|
18692
|
+
});
|
|
18372
18693
|
|
|
18694
|
+
// Parse url
|
|
18695
|
+
const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
|
|
18696
|
+
const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
|
|
18697
|
+
const protocol = parsed.protocol || supportedProtocols[0];
|
|
18698
|
+
|
|
18699
|
+
if (protocol === 'data:') {
|
|
18700
|
+
// Apply the same semantics as HTTP: only enforce if a finite, non-negative cap is set.
|
|
18701
|
+
if (config.maxContentLength > -1) {
|
|
18702
|
+
// Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed.
|
|
18703
|
+
const dataUrl = String(config.url || fullPath || '');
|
|
18704
|
+
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
18705
|
+
|
|
18706
|
+
if (estimated > config.maxContentLength) {
|
|
18707
|
+
return reject(
|
|
18708
|
+
new AxiosError$1(
|
|
18709
|
+
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
18710
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
18711
|
+
config
|
|
18712
|
+
)
|
|
18713
|
+
);
|
|
18714
|
+
}
|
|
18715
|
+
}
|
|
18373
18716
|
|
|
18717
|
+
let convertedData;
|
|
18374
18718
|
|
|
18375
|
-
|
|
18376
|
-
|
|
18377
|
-
|
|
18378
|
-
|
|
18379
|
-
|
|
18380
|
-
|
|
18381
|
-
|
|
18382
|
-
if (config.maxContentLength > -1) {
|
|
18383
|
-
// Use the exact string passed to fromDataURI (config.url); fall back to fullPath if needed.
|
|
18384
|
-
const dataUrl = String(config.url || fullPath || '');
|
|
18385
|
-
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
18386
|
-
|
|
18387
|
-
if (estimated > config.maxContentLength) {
|
|
18388
|
-
return reject(new AxiosError$1(
|
|
18389
|
-
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
18390
|
-
AxiosError$1.ERR_BAD_RESPONSE,
|
|
18391
|
-
config
|
|
18392
|
-
));
|
|
18719
|
+
if (method !== 'GET') {
|
|
18720
|
+
return settle(resolve, reject, {
|
|
18721
|
+
status: 405,
|
|
18722
|
+
statusText: 'method not allowed',
|
|
18723
|
+
headers: {},
|
|
18724
|
+
config,
|
|
18725
|
+
});
|
|
18393
18726
|
}
|
|
18394
|
-
}
|
|
18395
18727
|
|
|
18396
|
-
|
|
18728
|
+
try {
|
|
18729
|
+
convertedData = fromDataURI(config.url, responseType === 'blob', {
|
|
18730
|
+
Blob: config.env && config.env.Blob,
|
|
18731
|
+
});
|
|
18732
|
+
} catch (err) {
|
|
18733
|
+
throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
|
|
18734
|
+
}
|
|
18397
18735
|
|
|
18398
|
-
|
|
18399
|
-
|
|
18400
|
-
status: 405,
|
|
18401
|
-
statusText: 'method not allowed',
|
|
18402
|
-
headers: {},
|
|
18403
|
-
config
|
|
18404
|
-
});
|
|
18405
|
-
}
|
|
18736
|
+
if (responseType === 'text') {
|
|
18737
|
+
convertedData = convertedData.toString(responseEncoding);
|
|
18406
18738
|
|
|
18407
|
-
|
|
18408
|
-
|
|
18409
|
-
|
|
18739
|
+
if (!responseEncoding || responseEncoding === 'utf8') {
|
|
18740
|
+
convertedData = utils$1.stripBOM(convertedData);
|
|
18741
|
+
}
|
|
18742
|
+
} else if (responseType === 'stream') {
|
|
18743
|
+
convertedData = stream.Readable.from(convertedData);
|
|
18744
|
+
}
|
|
18745
|
+
|
|
18746
|
+
return settle(resolve, reject, {
|
|
18747
|
+
data: convertedData,
|
|
18748
|
+
status: 200,
|
|
18749
|
+
statusText: 'OK',
|
|
18750
|
+
headers: new AxiosHeaders$1(),
|
|
18751
|
+
config,
|
|
18410
18752
|
});
|
|
18411
|
-
} catch (err) {
|
|
18412
|
-
throw AxiosError$1.from(err, AxiosError$1.ERR_BAD_REQUEST, config);
|
|
18413
18753
|
}
|
|
18414
18754
|
|
|
18415
|
-
if (
|
|
18416
|
-
|
|
18417
|
-
|
|
18418
|
-
|
|
18419
|
-
convertedData = utils$1.stripBOM(convertedData);
|
|
18420
|
-
}
|
|
18421
|
-
} else if (responseType === 'stream') {
|
|
18422
|
-
convertedData = stream.Readable.from(convertedData);
|
|
18755
|
+
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
18756
|
+
return reject(
|
|
18757
|
+
new AxiosError$1('Unsupported protocol ' + protocol, AxiosError$1.ERR_BAD_REQUEST, config)
|
|
18758
|
+
);
|
|
18423
18759
|
}
|
|
18424
18760
|
|
|
18425
|
-
|
|
18426
|
-
data: convertedData,
|
|
18427
|
-
status: 200,
|
|
18428
|
-
statusText: 'OK',
|
|
18429
|
-
headers: new AxiosHeaders$1(),
|
|
18430
|
-
config
|
|
18431
|
-
});
|
|
18432
|
-
}
|
|
18761
|
+
const headers = AxiosHeaders$1.from(config.headers).normalize();
|
|
18433
18762
|
|
|
18434
|
-
|
|
18435
|
-
|
|
18436
|
-
|
|
18437
|
-
|
|
18438
|
-
|
|
18439
|
-
));
|
|
18440
|
-
}
|
|
18763
|
+
// Set User-Agent (required by some servers)
|
|
18764
|
+
// See https://github.com/axios/axios/issues/69
|
|
18765
|
+
// User-Agent is specified; handle case where no UA header is desired
|
|
18766
|
+
// Only set header if it hasn't been set in config
|
|
18767
|
+
headers.set('User-Agent', 'axios/' + VERSION$1, false);
|
|
18441
18768
|
|
|
18442
|
-
|
|
18769
|
+
const { onUploadProgress, onDownloadProgress } = config;
|
|
18770
|
+
const maxRate = config.maxRate;
|
|
18771
|
+
let maxUploadRate = undefined;
|
|
18772
|
+
let maxDownloadRate = undefined;
|
|
18443
18773
|
|
|
18444
|
-
|
|
18445
|
-
|
|
18446
|
-
|
|
18447
|
-
// Only set header if it hasn't been set in config
|
|
18448
|
-
headers.set('User-Agent', 'axios/' + VERSION$1, false);
|
|
18774
|
+
// support for spec compliant FormData objects
|
|
18775
|
+
if (utils$1.isSpecCompliantForm(data)) {
|
|
18776
|
+
const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
|
|
18449
18777
|
|
|
18450
|
-
|
|
18451
|
-
|
|
18452
|
-
|
|
18453
|
-
|
|
18778
|
+
data = formDataToStream(
|
|
18779
|
+
data,
|
|
18780
|
+
(formHeaders) => {
|
|
18781
|
+
headers.set(formHeaders);
|
|
18782
|
+
},
|
|
18783
|
+
{
|
|
18784
|
+
tag: `axios-${VERSION$1}-boundary`,
|
|
18785
|
+
boundary: (userBoundary && userBoundary[1]) || undefined,
|
|
18786
|
+
}
|
|
18787
|
+
);
|
|
18788
|
+
// support for https://www.npmjs.com/package/form-data api
|
|
18789
|
+
} else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
|
|
18790
|
+
headers.set(data.getHeaders());
|
|
18454
18791
|
|
|
18455
|
-
|
|
18456
|
-
|
|
18457
|
-
|
|
18792
|
+
if (!headers.hasContentLength()) {
|
|
18793
|
+
try {
|
|
18794
|
+
const knownLength = await require$$1.promisify(data.getLength).call(data);
|
|
18795
|
+
Number.isFinite(knownLength) &&
|
|
18796
|
+
knownLength >= 0 &&
|
|
18797
|
+
headers.setContentLength(knownLength);
|
|
18798
|
+
/*eslint no-empty:0*/
|
|
18799
|
+
} catch (e) {}
|
|
18800
|
+
}
|
|
18801
|
+
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
18802
|
+
data.size && headers.setContentType(data.type || 'application/octet-stream');
|
|
18803
|
+
headers.setContentLength(data.size || 0);
|
|
18804
|
+
data = stream.Readable.from(readBlob(data));
|
|
18805
|
+
} else if (data && !utils$1.isStream(data)) {
|
|
18806
|
+
if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
|
|
18807
|
+
data = Buffer.from(new Uint8Array(data));
|
|
18808
|
+
} else if (utils$1.isString(data)) {
|
|
18809
|
+
data = Buffer.from(data, 'utf-8');
|
|
18810
|
+
} else {
|
|
18811
|
+
return reject(
|
|
18812
|
+
new AxiosError$1(
|
|
18813
|
+
'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
|
|
18814
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
18815
|
+
config
|
|
18816
|
+
)
|
|
18817
|
+
);
|
|
18818
|
+
}
|
|
18458
18819
|
|
|
18459
|
-
|
|
18460
|
-
headers.
|
|
18461
|
-
}, {
|
|
18462
|
-
tag: `axios-${VERSION$1}-boundary`,
|
|
18463
|
-
boundary: userBoundary && userBoundary[1] || undefined
|
|
18464
|
-
});
|
|
18465
|
-
// support for https://www.npmjs.com/package/form-data api
|
|
18466
|
-
} else if (utils$1.isFormData(data) && utils$1.isFunction(data.getHeaders)) {
|
|
18467
|
-
headers.set(data.getHeaders());
|
|
18820
|
+
// Add Content-Length header if data exists
|
|
18821
|
+
headers.setContentLength(data.length, false);
|
|
18468
18822
|
|
|
18469
|
-
|
|
18470
|
-
|
|
18471
|
-
|
|
18472
|
-
|
|
18473
|
-
|
|
18474
|
-
|
|
18823
|
+
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
|
|
18824
|
+
return reject(
|
|
18825
|
+
new AxiosError$1(
|
|
18826
|
+
'Request body larger than maxBodyLength limit',
|
|
18827
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
18828
|
+
config
|
|
18829
|
+
)
|
|
18830
|
+
);
|
|
18475
18831
|
}
|
|
18476
18832
|
}
|
|
18477
|
-
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
18478
|
-
data.size && headers.setContentType(data.type || 'application/octet-stream');
|
|
18479
|
-
headers.setContentLength(data.size || 0);
|
|
18480
|
-
data = stream.Readable.from(readBlob(data));
|
|
18481
|
-
} else if (data && !utils$1.isStream(data)) {
|
|
18482
|
-
if (Buffer.isBuffer(data)) ; else if (utils$1.isArrayBuffer(data)) {
|
|
18483
|
-
data = Buffer.from(new Uint8Array(data));
|
|
18484
|
-
} else if (utils$1.isString(data)) {
|
|
18485
|
-
data = Buffer.from(data, 'utf-8');
|
|
18486
|
-
} else {
|
|
18487
|
-
return reject(new AxiosError$1(
|
|
18488
|
-
'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
|
|
18489
|
-
AxiosError$1.ERR_BAD_REQUEST,
|
|
18490
|
-
config
|
|
18491
|
-
));
|
|
18492
|
-
}
|
|
18493
18833
|
|
|
18494
|
-
|
|
18495
|
-
headers.setContentLength(data.length, false);
|
|
18834
|
+
const contentLength = utils$1.toFiniteNumber(headers.getContentLength());
|
|
18496
18835
|
|
|
18497
|
-
if (
|
|
18498
|
-
|
|
18499
|
-
|
|
18500
|
-
|
|
18501
|
-
|
|
18502
|
-
));
|
|
18836
|
+
if (utils$1.isArray(maxRate)) {
|
|
18837
|
+
maxUploadRate = maxRate[0];
|
|
18838
|
+
maxDownloadRate = maxRate[1];
|
|
18839
|
+
} else {
|
|
18840
|
+
maxUploadRate = maxDownloadRate = maxRate;
|
|
18503
18841
|
}
|
|
18504
|
-
}
|
|
18505
18842
|
|
|
18506
|
-
|
|
18843
|
+
if (data && (onUploadProgress || maxUploadRate)) {
|
|
18844
|
+
if (!utils$1.isStream(data)) {
|
|
18845
|
+
data = stream.Readable.from(data, { objectMode: false });
|
|
18846
|
+
}
|
|
18507
18847
|
|
|
18508
|
-
|
|
18509
|
-
|
|
18510
|
-
|
|
18511
|
-
|
|
18512
|
-
|
|
18513
|
-
|
|
18848
|
+
data = stream.pipeline(
|
|
18849
|
+
[
|
|
18850
|
+
data,
|
|
18851
|
+
new AxiosTransformStream({
|
|
18852
|
+
maxRate: utils$1.toFiniteNumber(maxUploadRate),
|
|
18853
|
+
}),
|
|
18854
|
+
],
|
|
18855
|
+
utils$1.noop
|
|
18856
|
+
);
|
|
18514
18857
|
|
|
18515
|
-
|
|
18516
|
-
|
|
18517
|
-
|
|
18858
|
+
onUploadProgress &&
|
|
18859
|
+
data.on(
|
|
18860
|
+
'progress',
|
|
18861
|
+
flushOnFinish(
|
|
18862
|
+
data,
|
|
18863
|
+
progressEventDecorator(
|
|
18864
|
+
contentLength,
|
|
18865
|
+
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
18866
|
+
)
|
|
18867
|
+
)
|
|
18868
|
+
);
|
|
18518
18869
|
}
|
|
18519
18870
|
|
|
18520
|
-
|
|
18521
|
-
|
|
18522
|
-
|
|
18523
|
-
|
|
18524
|
-
|
|
18525
|
-
|
|
18526
|
-
|
|
18527
|
-
contentLength,
|
|
18528
|
-
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
18529
|
-
)
|
|
18530
|
-
));
|
|
18531
|
-
}
|
|
18532
|
-
|
|
18533
|
-
// HTTP basic authentication
|
|
18534
|
-
let auth = undefined;
|
|
18535
|
-
if (config.auth) {
|
|
18536
|
-
const username = config.auth.username || '';
|
|
18537
|
-
const password = config.auth.password || '';
|
|
18538
|
-
auth = username + ':' + password;
|
|
18539
|
-
}
|
|
18871
|
+
// HTTP basic authentication
|
|
18872
|
+
let auth = undefined;
|
|
18873
|
+
if (config.auth) {
|
|
18874
|
+
const username = config.auth.username || '';
|
|
18875
|
+
const password = config.auth.password || '';
|
|
18876
|
+
auth = username + ':' + password;
|
|
18877
|
+
}
|
|
18540
18878
|
|
|
18541
|
-
|
|
18542
|
-
|
|
18543
|
-
|
|
18544
|
-
|
|
18545
|
-
|
|
18879
|
+
if (!auth && parsed.username) {
|
|
18880
|
+
const urlUsername = parsed.username;
|
|
18881
|
+
const urlPassword = parsed.password;
|
|
18882
|
+
auth = urlUsername + ':' + urlPassword;
|
|
18883
|
+
}
|
|
18546
18884
|
|
|
18547
|
-
|
|
18885
|
+
auth && headers.delete('authorization');
|
|
18548
18886
|
|
|
18549
|
-
|
|
18887
|
+
let path;
|
|
18550
18888
|
|
|
18551
|
-
|
|
18552
|
-
|
|
18553
|
-
|
|
18554
|
-
|
|
18555
|
-
|
|
18556
|
-
|
|
18557
|
-
|
|
18558
|
-
|
|
18559
|
-
|
|
18560
|
-
|
|
18561
|
-
|
|
18562
|
-
|
|
18563
|
-
|
|
18889
|
+
try {
|
|
18890
|
+
path = buildURL(
|
|
18891
|
+
parsed.pathname + parsed.search,
|
|
18892
|
+
config.params,
|
|
18893
|
+
config.paramsSerializer
|
|
18894
|
+
).replace(/^\?/, '');
|
|
18895
|
+
} catch (err) {
|
|
18896
|
+
const customErr = new Error(err.message);
|
|
18897
|
+
customErr.config = config;
|
|
18898
|
+
customErr.url = config.url;
|
|
18899
|
+
customErr.exists = true;
|
|
18900
|
+
return reject(customErr);
|
|
18901
|
+
}
|
|
18564
18902
|
|
|
18565
|
-
|
|
18566
|
-
|
|
18567
|
-
|
|
18903
|
+
headers.set(
|
|
18904
|
+
'Accept-Encoding',
|
|
18905
|
+
'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''),
|
|
18906
|
+
false
|
|
18568
18907
|
);
|
|
18569
18908
|
|
|
18570
|
-
|
|
18571
|
-
|
|
18572
|
-
|
|
18573
|
-
|
|
18574
|
-
|
|
18575
|
-
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
|
|
18580
|
-
|
|
18581
|
-
|
|
18909
|
+
const options = {
|
|
18910
|
+
path,
|
|
18911
|
+
method: method,
|
|
18912
|
+
headers: headers.toJSON(),
|
|
18913
|
+
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
18914
|
+
auth,
|
|
18915
|
+
protocol,
|
|
18916
|
+
family,
|
|
18917
|
+
beforeRedirect: dispatchBeforeRedirect,
|
|
18918
|
+
beforeRedirects: {},
|
|
18919
|
+
http2Options,
|
|
18920
|
+
};
|
|
18582
18921
|
|
|
18583
|
-
|
|
18584
|
-
|
|
18922
|
+
// cacheable-lookup integration hotfix
|
|
18923
|
+
!utils$1.isUndefined(lookup) && (options.lookup = lookup);
|
|
18585
18924
|
|
|
18586
|
-
|
|
18587
|
-
|
|
18588
|
-
|
|
18589
|
-
|
|
18590
|
-
|
|
18591
|
-
|
|
18592
|
-
|
|
18925
|
+
if (config.socketPath) {
|
|
18926
|
+
options.socketPath = config.socketPath;
|
|
18927
|
+
} else {
|
|
18928
|
+
options.hostname = parsed.hostname.startsWith('[')
|
|
18929
|
+
? parsed.hostname.slice(1, -1)
|
|
18930
|
+
: parsed.hostname;
|
|
18931
|
+
options.port = parsed.port;
|
|
18932
|
+
setProxy(
|
|
18933
|
+
options,
|
|
18934
|
+
config.proxy,
|
|
18935
|
+
protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path
|
|
18936
|
+
);
|
|
18937
|
+
}
|
|
18593
18938
|
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18939
|
+
let transport;
|
|
18940
|
+
const isHttpsRequest = isHttps.test(options.protocol);
|
|
18941
|
+
options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
|
|
18597
18942
|
|
|
18598
|
-
|
|
18599
|
-
|
|
18600
|
-
} else {
|
|
18601
|
-
if (config.transport) {
|
|
18602
|
-
transport = config.transport;
|
|
18603
|
-
} else if (config.maxRedirects === 0) {
|
|
18604
|
-
transport = isHttpsRequest ? require$$4 : require$$3;
|
|
18943
|
+
if (isHttp2) {
|
|
18944
|
+
transport = http2Transport;
|
|
18605
18945
|
} else {
|
|
18606
|
-
if (config.
|
|
18607
|
-
|
|
18608
|
-
}
|
|
18609
|
-
|
|
18610
|
-
|
|
18946
|
+
if (config.transport) {
|
|
18947
|
+
transport = config.transport;
|
|
18948
|
+
} else if (config.maxRedirects === 0) {
|
|
18949
|
+
transport = isHttpsRequest ? require$$4 : require$$3;
|
|
18950
|
+
} else {
|
|
18951
|
+
if (config.maxRedirects) {
|
|
18952
|
+
options.maxRedirects = config.maxRedirects;
|
|
18953
|
+
}
|
|
18954
|
+
if (config.beforeRedirect) {
|
|
18955
|
+
options.beforeRedirects.config = config.beforeRedirect;
|
|
18956
|
+
}
|
|
18957
|
+
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
18611
18958
|
}
|
|
18612
|
-
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
18613
18959
|
}
|
|
18614
|
-
}
|
|
18615
|
-
|
|
18616
|
-
if (config.maxBodyLength > -1) {
|
|
18617
|
-
options.maxBodyLength = config.maxBodyLength;
|
|
18618
|
-
} else {
|
|
18619
|
-
// follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
|
|
18620
|
-
options.maxBodyLength = Infinity;
|
|
18621
|
-
}
|
|
18622
18960
|
|
|
18623
|
-
|
|
18624
|
-
|
|
18625
|
-
|
|
18961
|
+
if (config.maxBodyLength > -1) {
|
|
18962
|
+
options.maxBodyLength = config.maxBodyLength;
|
|
18963
|
+
} else {
|
|
18964
|
+
// follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
|
|
18965
|
+
options.maxBodyLength = Infinity;
|
|
18966
|
+
}
|
|
18626
18967
|
|
|
18627
|
-
|
|
18628
|
-
|
|
18629
|
-
|
|
18968
|
+
if (config.insecureHTTPParser) {
|
|
18969
|
+
options.insecureHTTPParser = config.insecureHTTPParser;
|
|
18970
|
+
}
|
|
18630
18971
|
|
|
18631
|
-
|
|
18972
|
+
// Create the request
|
|
18973
|
+
req = transport.request(options, function handleResponse(res) {
|
|
18974
|
+
if (req.destroyed) return;
|
|
18632
18975
|
|
|
18633
|
-
|
|
18976
|
+
const streams = [res];
|
|
18634
18977
|
|
|
18635
|
-
|
|
18636
|
-
const transformStream = new AxiosTransformStream({
|
|
18637
|
-
maxRate: utils$1.toFiniteNumber(maxDownloadRate)
|
|
18638
|
-
});
|
|
18978
|
+
const responseLength = utils$1.toFiniteNumber(res.headers['content-length']);
|
|
18639
18979
|
|
|
18640
|
-
onDownloadProgress
|
|
18641
|
-
transformStream
|
|
18642
|
-
|
|
18643
|
-
|
|
18644
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
18645
|
-
)
|
|
18646
|
-
));
|
|
18980
|
+
if (onDownloadProgress || maxDownloadRate) {
|
|
18981
|
+
const transformStream = new AxiosTransformStream({
|
|
18982
|
+
maxRate: utils$1.toFiniteNumber(maxDownloadRate),
|
|
18983
|
+
});
|
|
18647
18984
|
|
|
18648
|
-
|
|
18649
|
-
|
|
18985
|
+
onDownloadProgress &&
|
|
18986
|
+
transformStream.on(
|
|
18987
|
+
'progress',
|
|
18988
|
+
flushOnFinish(
|
|
18989
|
+
transformStream,
|
|
18990
|
+
progressEventDecorator(
|
|
18991
|
+
responseLength,
|
|
18992
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
18993
|
+
)
|
|
18994
|
+
)
|
|
18995
|
+
);
|
|
18650
18996
|
|
|
18651
|
-
|
|
18652
|
-
|
|
18997
|
+
streams.push(transformStream);
|
|
18998
|
+
}
|
|
18653
18999
|
|
|
18654
|
-
|
|
18655
|
-
|
|
19000
|
+
// decompress the response body transparently if required
|
|
19001
|
+
let responseStream = res;
|
|
18656
19002
|
|
|
18657
|
-
|
|
18658
|
-
|
|
18659
|
-
// if no content, but headers still say that it is encoded,
|
|
18660
|
-
// remove the header not confuse downstream operations
|
|
18661
|
-
if (method === 'HEAD' || res.statusCode === 204) {
|
|
18662
|
-
delete res.headers['content-encoding'];
|
|
18663
|
-
}
|
|
19003
|
+
// return the last request in case of redirects
|
|
19004
|
+
const lastRequest = res.req || req;
|
|
18664
19005
|
|
|
18665
|
-
|
|
18666
|
-
|
|
18667
|
-
|
|
18668
|
-
|
|
18669
|
-
|
|
18670
|
-
case 'x-compress':
|
|
18671
|
-
// add the unzipper to the body stream processing pipeline
|
|
18672
|
-
streams.push(zlib.createUnzip(zlibOptions));
|
|
18673
|
-
|
|
18674
|
-
// remove the content-encoding in order to not confuse downstream operations
|
|
18675
|
-
delete res.headers['content-encoding'];
|
|
18676
|
-
break;
|
|
18677
|
-
case 'deflate':
|
|
18678
|
-
streams.push(new ZlibHeaderTransformStream());
|
|
18679
|
-
|
|
18680
|
-
// add the unzipper to the body stream processing pipeline
|
|
18681
|
-
streams.push(zlib.createUnzip(zlibOptions));
|
|
18682
|
-
|
|
18683
|
-
// remove the content-encoding in order to not confuse downstream operations
|
|
18684
|
-
delete res.headers['content-encoding'];
|
|
18685
|
-
break;
|
|
18686
|
-
case 'br':
|
|
18687
|
-
if (isBrotliSupported) {
|
|
18688
|
-
streams.push(zlib.createBrotliDecompress(brotliOptions));
|
|
19006
|
+
// if decompress disabled we should not decompress
|
|
19007
|
+
if (config.decompress !== false && res.headers['content-encoding']) {
|
|
19008
|
+
// if no content, but headers still say that it is encoded,
|
|
19009
|
+
// remove the header not confuse downstream operations
|
|
19010
|
+
if (method === 'HEAD' || res.statusCode === 204) {
|
|
18689
19011
|
delete res.headers['content-encoding'];
|
|
18690
19012
|
}
|
|
18691
|
-
}
|
|
18692
|
-
}
|
|
18693
19013
|
|
|
18694
|
-
|
|
18695
|
-
|
|
18696
|
-
|
|
18697
|
-
|
|
18698
|
-
|
|
18699
|
-
|
|
18700
|
-
|
|
18701
|
-
|
|
18702
|
-
|
|
18703
|
-
|
|
18704
|
-
|
|
18705
|
-
|
|
18706
|
-
|
|
18707
|
-
|
|
18708
|
-
|
|
18709
|
-
|
|
18710
|
-
|
|
18711
|
-
|
|
18712
|
-
|
|
18713
|
-
|
|
18714
|
-
|
|
18715
|
-
|
|
18716
|
-
|
|
18717
|
-
|
|
18718
|
-
|
|
18719
|
-
|
|
18720
|
-
rejected = true;
|
|
18721
|
-
responseStream.destroy();
|
|
18722
|
-
abort(new AxiosError$1('maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
18723
|
-
AxiosError$1.ERR_BAD_RESPONSE, config, lastRequest));
|
|
19014
|
+
switch ((res.headers['content-encoding'] || '').toLowerCase()) {
|
|
19015
|
+
/*eslint default-case:0*/
|
|
19016
|
+
case 'gzip':
|
|
19017
|
+
case 'x-gzip':
|
|
19018
|
+
case 'compress':
|
|
19019
|
+
case 'x-compress':
|
|
19020
|
+
// add the unzipper to the body stream processing pipeline
|
|
19021
|
+
streams.push(zlib.createUnzip(zlibOptions));
|
|
19022
|
+
|
|
19023
|
+
// remove the content-encoding in order to not confuse downstream operations
|
|
19024
|
+
delete res.headers['content-encoding'];
|
|
19025
|
+
break;
|
|
19026
|
+
case 'deflate':
|
|
19027
|
+
streams.push(new ZlibHeaderTransformStream());
|
|
19028
|
+
|
|
19029
|
+
// add the unzipper to the body stream processing pipeline
|
|
19030
|
+
streams.push(zlib.createUnzip(zlibOptions));
|
|
19031
|
+
|
|
19032
|
+
// remove the content-encoding in order to not confuse downstream operations
|
|
19033
|
+
delete res.headers['content-encoding'];
|
|
19034
|
+
break;
|
|
19035
|
+
case 'br':
|
|
19036
|
+
if (isBrotliSupported) {
|
|
19037
|
+
streams.push(zlib.createBrotliDecompress(brotliOptions));
|
|
19038
|
+
delete res.headers['content-encoding'];
|
|
19039
|
+
}
|
|
18724
19040
|
}
|
|
18725
|
-
}
|
|
19041
|
+
}
|
|
18726
19042
|
|
|
18727
|
-
responseStream.
|
|
18728
|
-
if (rejected) {
|
|
18729
|
-
return;
|
|
18730
|
-
}
|
|
19043
|
+
responseStream = streams.length > 1 ? stream.pipeline(streams, utils$1.noop) : streams[0];
|
|
18731
19044
|
|
|
18732
|
-
|
|
18733
|
-
|
|
18734
|
-
|
|
18735
|
-
|
|
18736
|
-
|
|
18737
|
-
|
|
18738
|
-
|
|
18739
|
-
reject(err);
|
|
18740
|
-
});
|
|
19045
|
+
const response = {
|
|
19046
|
+
status: res.statusCode,
|
|
19047
|
+
statusText: res.statusMessage,
|
|
19048
|
+
headers: new AxiosHeaders$1(res.headers),
|
|
19049
|
+
config,
|
|
19050
|
+
request: lastRequest,
|
|
19051
|
+
};
|
|
18741
19052
|
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
|
|
18745
|
-
}
|
|
19053
|
+
if (responseType === 'stream') {
|
|
19054
|
+
response.data = responseStream;
|
|
19055
|
+
settle(resolve, reject, response);
|
|
19056
|
+
} else {
|
|
19057
|
+
const responseBuffer = [];
|
|
19058
|
+
let totalResponseBytes = 0;
|
|
19059
|
+
|
|
19060
|
+
responseStream.on('data', function handleStreamData(chunk) {
|
|
19061
|
+
responseBuffer.push(chunk);
|
|
19062
|
+
totalResponseBytes += chunk.length;
|
|
19063
|
+
|
|
19064
|
+
// make sure the content length is not over the maxContentLength if specified
|
|
19065
|
+
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
19066
|
+
// stream.destroy() emit aborted event before calling reject() on Node.js v16
|
|
19067
|
+
rejected = true;
|
|
19068
|
+
responseStream.destroy();
|
|
19069
|
+
abort(
|
|
19070
|
+
new AxiosError$1(
|
|
19071
|
+
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
19072
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
19073
|
+
config,
|
|
19074
|
+
lastRequest
|
|
19075
|
+
)
|
|
19076
|
+
);
|
|
19077
|
+
}
|
|
19078
|
+
});
|
|
18746
19079
|
|
|
18747
|
-
|
|
18748
|
-
|
|
18749
|
-
|
|
18750
|
-
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
19080
|
+
responseStream.on('aborted', function handlerStreamAborted() {
|
|
19081
|
+
if (rejected) {
|
|
19082
|
+
return;
|
|
19083
|
+
}
|
|
19084
|
+
|
|
19085
|
+
const err = new AxiosError$1(
|
|
19086
|
+
'stream has been aborted',
|
|
19087
|
+
AxiosError$1.ERR_BAD_RESPONSE,
|
|
19088
|
+
config,
|
|
19089
|
+
lastRequest
|
|
19090
|
+
);
|
|
19091
|
+
responseStream.destroy(err);
|
|
19092
|
+
reject(err);
|
|
19093
|
+
});
|
|
19094
|
+
|
|
19095
|
+
responseStream.on('error', function handleStreamError(err) {
|
|
19096
|
+
if (req.destroyed) return;
|
|
19097
|
+
reject(AxiosError$1.from(err, null, config, lastRequest));
|
|
19098
|
+
});
|
|
19099
|
+
|
|
19100
|
+
responseStream.on('end', function handleStreamEnd() {
|
|
19101
|
+
try {
|
|
19102
|
+
let responseData =
|
|
19103
|
+
responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
|
|
19104
|
+
if (responseType !== 'arraybuffer') {
|
|
19105
|
+
responseData = responseData.toString(responseEncoding);
|
|
19106
|
+
if (!responseEncoding || responseEncoding === 'utf8') {
|
|
19107
|
+
responseData = utils$1.stripBOM(responseData);
|
|
19108
|
+
}
|
|
18754
19109
|
}
|
|
19110
|
+
response.data = responseData;
|
|
19111
|
+
} catch (err) {
|
|
19112
|
+
return reject(AxiosError$1.from(err, null, config, response.request, response));
|
|
18755
19113
|
}
|
|
18756
|
-
|
|
18757
|
-
}
|
|
18758
|
-
|
|
19114
|
+
settle(resolve, reject, response);
|
|
19115
|
+
});
|
|
19116
|
+
}
|
|
19117
|
+
|
|
19118
|
+
abortEmitter.once('abort', (err) => {
|
|
19119
|
+
if (!responseStream.destroyed) {
|
|
19120
|
+
responseStream.emit('error', err);
|
|
19121
|
+
responseStream.destroy();
|
|
18759
19122
|
}
|
|
18760
|
-
settle(resolve, reject, response);
|
|
18761
19123
|
});
|
|
18762
|
-
}
|
|
18763
|
-
|
|
18764
|
-
abortEmitter.once('abort', err => {
|
|
18765
|
-
if (!responseStream.destroyed) {
|
|
18766
|
-
responseStream.emit('error', err);
|
|
18767
|
-
responseStream.destroy();
|
|
18768
|
-
}
|
|
18769
19124
|
});
|
|
18770
|
-
});
|
|
18771
|
-
|
|
18772
|
-
abortEmitter.once('abort', err => {
|
|
18773
|
-
if (req.close) {
|
|
18774
|
-
req.close();
|
|
18775
|
-
} else {
|
|
18776
|
-
req.destroy(err);
|
|
18777
|
-
}
|
|
18778
|
-
});
|
|
18779
|
-
|
|
18780
|
-
// Handle errors
|
|
18781
|
-
req.on('error', function handleRequestError(err) {
|
|
18782
|
-
reject(AxiosError$1.from(err, null, config, req));
|
|
18783
|
-
});
|
|
18784
|
-
|
|
18785
|
-
// set tcp keep alive to prevent drop connection by peer
|
|
18786
|
-
req.on('socket', function handleRequestSocket(socket) {
|
|
18787
|
-
// default interval of sending ack packet is 1 minute
|
|
18788
|
-
socket.setKeepAlive(true, 1000 * 60);
|
|
18789
|
-
});
|
|
18790
|
-
|
|
18791
|
-
// Handle request timeout
|
|
18792
|
-
if (config.timeout) {
|
|
18793
|
-
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
|
|
18794
|
-
const timeout = parseInt(config.timeout, 10);
|
|
18795
|
-
|
|
18796
|
-
if (Number.isNaN(timeout)) {
|
|
18797
|
-
abort(new AxiosError$1(
|
|
18798
|
-
'error trying to parse `config.timeout` to int',
|
|
18799
|
-
AxiosError$1.ERR_BAD_OPTION_VALUE,
|
|
18800
|
-
config,
|
|
18801
|
-
req
|
|
18802
|
-
));
|
|
18803
|
-
|
|
18804
|
-
return;
|
|
18805
|
-
}
|
|
18806
19125
|
|
|
18807
|
-
|
|
18808
|
-
|
|
18809
|
-
|
|
18810
|
-
|
|
18811
|
-
|
|
18812
|
-
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
18813
|
-
if (isDone) return;
|
|
18814
|
-
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
18815
|
-
const transitional = config.transitional || transitionalDefaults;
|
|
18816
|
-
if (config.timeoutErrorMessage) {
|
|
18817
|
-
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
19126
|
+
abortEmitter.once('abort', (err) => {
|
|
19127
|
+
if (req.close) {
|
|
19128
|
+
req.close();
|
|
19129
|
+
} else {
|
|
19130
|
+
req.destroy(err);
|
|
18818
19131
|
}
|
|
18819
|
-
abort(new AxiosError$1(
|
|
18820
|
-
timeoutErrorMessage,
|
|
18821
|
-
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
18822
|
-
config,
|
|
18823
|
-
req
|
|
18824
|
-
));
|
|
18825
19132
|
});
|
|
18826
|
-
} else {
|
|
18827
|
-
// explicitly reset the socket timeout value for a possible `keep-alive` request
|
|
18828
|
-
req.setTimeout(0);
|
|
18829
|
-
}
|
|
18830
19133
|
|
|
18831
|
-
|
|
18832
|
-
|
|
18833
|
-
|
|
18834
|
-
let ended = false;
|
|
18835
|
-
let errored = false;
|
|
18836
|
-
|
|
18837
|
-
data.on('end', () => {
|
|
18838
|
-
ended = true;
|
|
19134
|
+
// Handle errors
|
|
19135
|
+
req.on('error', function handleRequestError(err) {
|
|
19136
|
+
reject(AxiosError$1.from(err, null, config, req));
|
|
18839
19137
|
});
|
|
18840
19138
|
|
|
18841
|
-
|
|
18842
|
-
|
|
18843
|
-
|
|
19139
|
+
// set tcp keep alive to prevent drop connection by peer
|
|
19140
|
+
req.on('socket', function handleRequestSocket(socket) {
|
|
19141
|
+
// default interval of sending ack packet is 1 minute
|
|
19142
|
+
socket.setKeepAlive(true, 1000 * 60);
|
|
18844
19143
|
});
|
|
18845
19144
|
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
|
|
18849
|
-
|
|
18850
|
-
|
|
19145
|
+
// Handle request timeout
|
|
19146
|
+
if (config.timeout) {
|
|
19147
|
+
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
|
|
19148
|
+
const timeout = parseInt(config.timeout, 10);
|
|
19149
|
+
|
|
19150
|
+
if (Number.isNaN(timeout)) {
|
|
19151
|
+
abort(
|
|
19152
|
+
new AxiosError$1(
|
|
19153
|
+
'error trying to parse `config.timeout` to int',
|
|
19154
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE,
|
|
19155
|
+
config,
|
|
19156
|
+
req
|
|
19157
|
+
)
|
|
19158
|
+
);
|
|
18851
19159
|
|
|
18852
|
-
|
|
18853
|
-
|
|
18854
|
-
data && req.write(data);
|
|
18855
|
-
req.end();
|
|
18856
|
-
}
|
|
18857
|
-
});
|
|
18858
|
-
};
|
|
19160
|
+
return;
|
|
19161
|
+
}
|
|
18859
19162
|
|
|
18860
|
-
|
|
18861
|
-
|
|
19163
|
+
// Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
|
|
19164
|
+
// And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
|
|
19165
|
+
// 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.
|
|
19166
|
+
// And then these socket which be hang up will devouring CPU little by little.
|
|
19167
|
+
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
|
|
19168
|
+
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
19169
|
+
if (isDone) return;
|
|
19170
|
+
let timeoutErrorMessage = config.timeout
|
|
19171
|
+
? 'timeout of ' + config.timeout + 'ms exceeded'
|
|
19172
|
+
: 'timeout exceeded';
|
|
19173
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
19174
|
+
if (config.timeoutErrorMessage) {
|
|
19175
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
19176
|
+
}
|
|
19177
|
+
abort(
|
|
19178
|
+
new AxiosError$1(
|
|
19179
|
+
timeoutErrorMessage,
|
|
19180
|
+
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
19181
|
+
config,
|
|
19182
|
+
req
|
|
19183
|
+
)
|
|
19184
|
+
);
|
|
19185
|
+
});
|
|
19186
|
+
} else {
|
|
19187
|
+
// explicitly reset the socket timeout value for a possible `keep-alive` request
|
|
19188
|
+
req.setTimeout(0);
|
|
19189
|
+
}
|
|
18862
19190
|
|
|
18863
|
-
|
|
18864
|
-
|
|
18865
|
-
|
|
18866
|
-
|
|
18867
|
-
);
|
|
18868
|
-
})(
|
|
18869
|
-
new URL(platform.origin),
|
|
18870
|
-
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
18871
|
-
) : () => true;
|
|
19191
|
+
// Send the request
|
|
19192
|
+
if (utils$1.isStream(data)) {
|
|
19193
|
+
let ended = false;
|
|
19194
|
+
let errored = false;
|
|
18872
19195
|
|
|
18873
|
-
|
|
19196
|
+
data.on('end', () => {
|
|
19197
|
+
ended = true;
|
|
19198
|
+
});
|
|
18874
19199
|
|
|
18875
|
-
|
|
18876
|
-
|
|
18877
|
-
|
|
18878
|
-
|
|
19200
|
+
data.once('error', (err) => {
|
|
19201
|
+
errored = true;
|
|
19202
|
+
req.destroy(err);
|
|
19203
|
+
});
|
|
18879
19204
|
|
|
18880
|
-
|
|
19205
|
+
data.on('close', () => {
|
|
19206
|
+
if (!ended && !errored) {
|
|
19207
|
+
abort(new CanceledError$1('Request stream has been aborted', config, req));
|
|
19208
|
+
}
|
|
19209
|
+
});
|
|
18881
19210
|
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
cookie.push(`path=${path}`);
|
|
18887
|
-
}
|
|
18888
|
-
if (utils$1.isString(domain)) {
|
|
18889
|
-
cookie.push(`domain=${domain}`);
|
|
18890
|
-
}
|
|
18891
|
-
if (secure === true) {
|
|
18892
|
-
cookie.push('secure');
|
|
18893
|
-
}
|
|
18894
|
-
if (utils$1.isString(sameSite)) {
|
|
18895
|
-
cookie.push(`SameSite=${sameSite}`);
|
|
19211
|
+
data.pipe(req);
|
|
19212
|
+
} else {
|
|
19213
|
+
data && req.write(data);
|
|
19214
|
+
req.end();
|
|
18896
19215
|
}
|
|
19216
|
+
});
|
|
19217
|
+
};
|
|
18897
19218
|
|
|
18898
|
-
|
|
18899
|
-
|
|
19219
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv
|
|
19220
|
+
? ((origin, isMSIE) => (url) => {
|
|
19221
|
+
url = new URL(url, platform.origin);
|
|
18900
19222
|
|
|
18901
|
-
|
|
18902
|
-
|
|
18903
|
-
|
|
18904
|
-
|
|
18905
|
-
|
|
19223
|
+
return (
|
|
19224
|
+
origin.protocol === url.protocol &&
|
|
19225
|
+
origin.host === url.host &&
|
|
19226
|
+
(isMSIE || origin.port === url.port)
|
|
19227
|
+
);
|
|
19228
|
+
})(
|
|
19229
|
+
new URL(platform.origin),
|
|
19230
|
+
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
19231
|
+
)
|
|
19232
|
+
: () => true;
|
|
19233
|
+
|
|
19234
|
+
var cookies = platform.hasStandardBrowserEnv
|
|
19235
|
+
? // Standard browser envs support document.cookie
|
|
19236
|
+
{
|
|
19237
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
19238
|
+
if (typeof document === 'undefined') return;
|
|
19239
|
+
|
|
19240
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
19241
|
+
|
|
19242
|
+
if (utils$1.isNumber(expires)) {
|
|
19243
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
19244
|
+
}
|
|
19245
|
+
if (utils$1.isString(path)) {
|
|
19246
|
+
cookie.push(`path=${path}`);
|
|
19247
|
+
}
|
|
19248
|
+
if (utils$1.isString(domain)) {
|
|
19249
|
+
cookie.push(`domain=${domain}`);
|
|
19250
|
+
}
|
|
19251
|
+
if (secure === true) {
|
|
19252
|
+
cookie.push('secure');
|
|
19253
|
+
}
|
|
19254
|
+
if (utils$1.isString(sameSite)) {
|
|
19255
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
19256
|
+
}
|
|
18906
19257
|
|
|
18907
|
-
|
|
18908
|
-
|
|
18909
|
-
}
|
|
18910
|
-
}
|
|
19258
|
+
document.cookie = cookie.join('; ');
|
|
19259
|
+
},
|
|
18911
19260
|
|
|
18912
|
-
|
|
19261
|
+
read(name) {
|
|
19262
|
+
if (typeof document === 'undefined') return null;
|
|
19263
|
+
const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
|
|
19264
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
19265
|
+
},
|
|
18913
19266
|
|
|
18914
|
-
|
|
18915
|
-
|
|
18916
|
-
|
|
18917
|
-
|
|
18918
|
-
|
|
18919
|
-
|
|
18920
|
-
|
|
18921
|
-
|
|
19267
|
+
remove(name) {
|
|
19268
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
19269
|
+
},
|
|
19270
|
+
}
|
|
19271
|
+
: // Non-standard browser env (web workers, react-native) lack needed support.
|
|
19272
|
+
{
|
|
19273
|
+
write() {},
|
|
19274
|
+
read() {
|
|
19275
|
+
return null;
|
|
19276
|
+
},
|
|
19277
|
+
remove() {},
|
|
19278
|
+
};
|
|
18922
19279
|
|
|
18923
|
-
const headersToObject = (thing) =>
|
|
18924
|
-
thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
19280
|
+
const headersToObject = (thing) => (thing instanceof AxiosHeaders$1 ? { ...thing } : thing);
|
|
18925
19281
|
|
|
18926
19282
|
/**
|
|
18927
19283
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -19014,23 +19370,12 @@ function mergeConfig$1(config1, config2) {
|
|
|
19014
19370
|
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
19015
19371
|
};
|
|
19016
19372
|
|
|
19017
|
-
utils$1.forEach(
|
|
19018
|
-
|
|
19019
|
-
|
|
19020
|
-
|
|
19021
|
-
|
|
19022
|
-
|
|
19023
|
-
prop === "prototype"
|
|
19024
|
-
)
|
|
19025
|
-
return;
|
|
19026
|
-
const merge = utils$1.hasOwnProp(mergeMap, prop)
|
|
19027
|
-
? mergeMap[prop]
|
|
19028
|
-
: mergeDeepProperties;
|
|
19029
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
|
19030
|
-
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) ||
|
|
19031
|
-
(config[prop] = configValue);
|
|
19032
|
-
},
|
|
19033
|
-
);
|
|
19373
|
+
utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
19374
|
+
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
19375
|
+
const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
19376
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
19377
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
19378
|
+
});
|
|
19034
19379
|
|
|
19035
19380
|
return config;
|
|
19036
19381
|
}
|
|
@@ -19042,12 +19387,22 @@ var resolveConfig = (config) => {
|
|
|
19042
19387
|
|
|
19043
19388
|
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
19044
19389
|
|
|
19045
|
-
newConfig.url = buildURL(
|
|
19390
|
+
newConfig.url = buildURL(
|
|
19391
|
+
buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls),
|
|
19392
|
+
config.params,
|
|
19393
|
+
config.paramsSerializer
|
|
19394
|
+
);
|
|
19046
19395
|
|
|
19047
19396
|
// HTTP basic authentication
|
|
19048
19397
|
if (auth) {
|
|
19049
|
-
headers.set(
|
|
19050
|
-
|
|
19398
|
+
headers.set(
|
|
19399
|
+
'Authorization',
|
|
19400
|
+
'Basic ' +
|
|
19401
|
+
btoa(
|
|
19402
|
+
(auth.username || '') +
|
|
19403
|
+
':' +
|
|
19404
|
+
(auth.password ? unescape(encodeURIComponent(auth.password)) : '')
|
|
19405
|
+
)
|
|
19051
19406
|
);
|
|
19052
19407
|
}
|
|
19053
19408
|
|
|
@@ -19065,7 +19420,7 @@ var resolveConfig = (config) => {
|
|
|
19065
19420
|
}
|
|
19066
19421
|
});
|
|
19067
19422
|
}
|
|
19068
|
-
}
|
|
19423
|
+
}
|
|
19069
19424
|
|
|
19070
19425
|
// Add xsrf header
|
|
19071
19426
|
// This is only done if running in a standard browser environment.
|
|
@@ -19089,196 +19444,218 @@ var resolveConfig = (config) => {
|
|
|
19089
19444
|
|
|
19090
19445
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
19091
19446
|
|
|
19092
|
-
var xhrAdapter = isXHRAdapterSupported &&
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19447
|
+
var xhrAdapter = isXHRAdapterSupported &&
|
|
19448
|
+
function (config) {
|
|
19449
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
19450
|
+
const _config = resolveConfig(config);
|
|
19451
|
+
let requestData = _config.data;
|
|
19452
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
19453
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
19454
|
+
let onCanceled;
|
|
19455
|
+
let uploadThrottled, downloadThrottled;
|
|
19456
|
+
let flushUpload, flushDownload;
|
|
19101
19457
|
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
|
|
19458
|
+
function done() {
|
|
19459
|
+
flushUpload && flushUpload(); // flush events
|
|
19460
|
+
flushDownload && flushDownload(); // flush events
|
|
19105
19461
|
|
|
19106
|
-
|
|
19462
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
19107
19463
|
|
|
19108
|
-
|
|
19109
|
-
|
|
19464
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
19465
|
+
}
|
|
19110
19466
|
|
|
19111
|
-
|
|
19467
|
+
let request = new XMLHttpRequest();
|
|
19112
19468
|
|
|
19113
|
-
|
|
19469
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
19114
19470
|
|
|
19115
|
-
|
|
19116
|
-
|
|
19471
|
+
// Set the request timeout in MS
|
|
19472
|
+
request.timeout = _config.timeout;
|
|
19117
19473
|
|
|
19118
|
-
|
|
19119
|
-
|
|
19120
|
-
|
|
19474
|
+
function onloadend() {
|
|
19475
|
+
if (!request) {
|
|
19476
|
+
return;
|
|
19477
|
+
}
|
|
19478
|
+
// Prepare the response
|
|
19479
|
+
const responseHeaders = AxiosHeaders$1.from(
|
|
19480
|
+
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
19481
|
+
);
|
|
19482
|
+
const responseData =
|
|
19483
|
+
!responseType || responseType === 'text' || responseType === 'json'
|
|
19484
|
+
? request.responseText
|
|
19485
|
+
: request.response;
|
|
19486
|
+
const response = {
|
|
19487
|
+
data: responseData,
|
|
19488
|
+
status: request.status,
|
|
19489
|
+
statusText: request.statusText,
|
|
19490
|
+
headers: responseHeaders,
|
|
19491
|
+
config,
|
|
19492
|
+
request,
|
|
19493
|
+
};
|
|
19494
|
+
|
|
19495
|
+
settle(
|
|
19496
|
+
function _resolve(value) {
|
|
19497
|
+
resolve(value);
|
|
19498
|
+
done();
|
|
19499
|
+
},
|
|
19500
|
+
function _reject(err) {
|
|
19501
|
+
reject(err);
|
|
19502
|
+
done();
|
|
19503
|
+
},
|
|
19504
|
+
response
|
|
19505
|
+
);
|
|
19506
|
+
|
|
19507
|
+
// Clean up request
|
|
19508
|
+
request = null;
|
|
19121
19509
|
}
|
|
19122
|
-
// Prepare the response
|
|
19123
|
-
const responseHeaders = AxiosHeaders$1.from(
|
|
19124
|
-
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
19125
|
-
);
|
|
19126
|
-
const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
19127
|
-
request.responseText : request.response;
|
|
19128
|
-
const response = {
|
|
19129
|
-
data: responseData,
|
|
19130
|
-
status: request.status,
|
|
19131
|
-
statusText: request.statusText,
|
|
19132
|
-
headers: responseHeaders,
|
|
19133
|
-
config,
|
|
19134
|
-
request
|
|
19135
|
-
};
|
|
19136
19510
|
|
|
19137
|
-
|
|
19138
|
-
|
|
19139
|
-
|
|
19140
|
-
}
|
|
19141
|
-
|
|
19142
|
-
|
|
19143
|
-
|
|
19511
|
+
if ('onloadend' in request) {
|
|
19512
|
+
// Use onloadend if available
|
|
19513
|
+
request.onloadend = onloadend;
|
|
19514
|
+
} else {
|
|
19515
|
+
// Listen for ready state to emulate onloadend
|
|
19516
|
+
request.onreadystatechange = function handleLoad() {
|
|
19517
|
+
if (!request || request.readyState !== 4) {
|
|
19518
|
+
return;
|
|
19519
|
+
}
|
|
19144
19520
|
|
|
19145
|
-
|
|
19146
|
-
|
|
19147
|
-
|
|
19521
|
+
// The request errored out and we didn't get a response, this will be
|
|
19522
|
+
// handled by onerror instead
|
|
19523
|
+
// With one exception: request that using file: protocol, most browsers
|
|
19524
|
+
// will return status as 0 even though it's a successful request
|
|
19525
|
+
if (
|
|
19526
|
+
request.status === 0 &&
|
|
19527
|
+
!(request.responseURL && request.responseURL.indexOf('file:') === 0)
|
|
19528
|
+
) {
|
|
19529
|
+
return;
|
|
19530
|
+
}
|
|
19531
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
|
19532
|
+
// so we should call onloadend on the next 'tick'
|
|
19533
|
+
setTimeout(onloadend);
|
|
19534
|
+
};
|
|
19535
|
+
}
|
|
19148
19536
|
|
|
19149
|
-
|
|
19150
|
-
|
|
19151
|
-
|
|
19152
|
-
} else {
|
|
19153
|
-
// Listen for ready state to emulate onloadend
|
|
19154
|
-
request.onreadystatechange = function handleLoad() {
|
|
19155
|
-
if (!request || request.readyState !== 4) {
|
|
19537
|
+
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
19538
|
+
request.onabort = function handleAbort() {
|
|
19539
|
+
if (!request) {
|
|
19156
19540
|
return;
|
|
19157
19541
|
}
|
|
19158
19542
|
|
|
19159
|
-
|
|
19160
|
-
|
|
19161
|
-
//
|
|
19162
|
-
|
|
19163
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
19164
|
-
return;
|
|
19165
|
-
}
|
|
19166
|
-
// readystate handler is calling before onerror or ontimeout handlers,
|
|
19167
|
-
// so we should call onloadend on the next 'tick'
|
|
19168
|
-
setTimeout(onloadend);
|
|
19543
|
+
reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
|
|
19544
|
+
|
|
19545
|
+
// Clean up request
|
|
19546
|
+
request = null;
|
|
19169
19547
|
};
|
|
19170
|
-
}
|
|
19171
19548
|
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19549
|
+
// Handle low level network errors
|
|
19550
|
+
request.onerror = function handleError(event) {
|
|
19551
|
+
// Browsers deliver a ProgressEvent in XHR onerror
|
|
19552
|
+
// (message may be empty; when present, surface it)
|
|
19553
|
+
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
19554
|
+
const msg = event && event.message ? event.message : 'Network Error';
|
|
19555
|
+
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
19556
|
+
// attach the underlying event for consumers who want details
|
|
19557
|
+
err.event = event || null;
|
|
19558
|
+
reject(err);
|
|
19559
|
+
request = null;
|
|
19560
|
+
};
|
|
19177
19561
|
|
|
19178
|
-
|
|
19562
|
+
// Handle timeout
|
|
19563
|
+
request.ontimeout = function handleTimeout() {
|
|
19564
|
+
let timeoutErrorMessage = _config.timeout
|
|
19565
|
+
? 'timeout of ' + _config.timeout + 'ms exceeded'
|
|
19566
|
+
: 'timeout exceeded';
|
|
19567
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
19568
|
+
if (_config.timeoutErrorMessage) {
|
|
19569
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
19570
|
+
}
|
|
19571
|
+
reject(
|
|
19572
|
+
new AxiosError$1(
|
|
19573
|
+
timeoutErrorMessage,
|
|
19574
|
+
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
19575
|
+
config,
|
|
19576
|
+
request
|
|
19577
|
+
)
|
|
19578
|
+
);
|
|
19179
19579
|
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19580
|
+
// Clean up request
|
|
19581
|
+
request = null;
|
|
19582
|
+
};
|
|
19183
19583
|
|
|
19184
|
-
|
|
19185
|
-
|
|
19186
|
-
// Browsers deliver a ProgressEvent in XHR onerror
|
|
19187
|
-
// (message may be empty; when present, surface it)
|
|
19188
|
-
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
19189
|
-
const msg = event && event.message ? event.message : 'Network Error';
|
|
19190
|
-
const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
|
|
19191
|
-
// attach the underlying event for consumers who want details
|
|
19192
|
-
err.event = event || null;
|
|
19193
|
-
reject(err);
|
|
19194
|
-
request = null;
|
|
19195
|
-
};
|
|
19196
|
-
|
|
19197
|
-
// Handle timeout
|
|
19198
|
-
request.ontimeout = function handleTimeout() {
|
|
19199
|
-
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
19200
|
-
const transitional = _config.transitional || transitionalDefaults;
|
|
19201
|
-
if (_config.timeoutErrorMessage) {
|
|
19202
|
-
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
19203
|
-
}
|
|
19204
|
-
reject(new AxiosError$1(
|
|
19205
|
-
timeoutErrorMessage,
|
|
19206
|
-
transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
|
|
19207
|
-
config,
|
|
19208
|
-
request));
|
|
19209
|
-
|
|
19210
|
-
// Clean up request
|
|
19211
|
-
request = null;
|
|
19212
|
-
};
|
|
19584
|
+
// Remove Content-Type if data is undefined
|
|
19585
|
+
requestData === undefined && requestHeaders.setContentType(null);
|
|
19213
19586
|
|
|
19214
|
-
|
|
19215
|
-
|
|
19587
|
+
// Add headers to the request
|
|
19588
|
+
if ('setRequestHeader' in request) {
|
|
19589
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
|
19590
|
+
request.setRequestHeader(key, val);
|
|
19591
|
+
});
|
|
19592
|
+
}
|
|
19216
19593
|
|
|
19217
|
-
|
|
19218
|
-
|
|
19219
|
-
|
|
19220
|
-
|
|
19221
|
-
});
|
|
19222
|
-
}
|
|
19594
|
+
// Add withCredentials to request if needed
|
|
19595
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
19596
|
+
request.withCredentials = !!_config.withCredentials;
|
|
19597
|
+
}
|
|
19223
19598
|
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
|
|
19227
|
-
|
|
19599
|
+
// Add responseType to request if needed
|
|
19600
|
+
if (responseType && responseType !== 'json') {
|
|
19601
|
+
request.responseType = _config.responseType;
|
|
19602
|
+
}
|
|
19228
19603
|
|
|
19229
|
-
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
|
|
19604
|
+
// Handle progress if needed
|
|
19605
|
+
if (onDownloadProgress) {
|
|
19606
|
+
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
19607
|
+
request.addEventListener('progress', downloadThrottled);
|
|
19608
|
+
}
|
|
19233
19609
|
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
request.addEventListener('progress', downloadThrottled);
|
|
19238
|
-
}
|
|
19610
|
+
// Not all browsers support upload events
|
|
19611
|
+
if (onUploadProgress && request.upload) {
|
|
19612
|
+
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
19239
19613
|
|
|
19240
|
-
|
|
19241
|
-
if (onUploadProgress && request.upload) {
|
|
19242
|
-
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
|
19614
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
|
19243
19615
|
|
|
19244
|
-
|
|
19616
|
+
request.upload.addEventListener('loadend', flushUpload);
|
|
19617
|
+
}
|
|
19245
19618
|
|
|
19246
|
-
|
|
19247
|
-
|
|
19619
|
+
if (_config.cancelToken || _config.signal) {
|
|
19620
|
+
// Handle cancellation
|
|
19621
|
+
// eslint-disable-next-line func-names
|
|
19622
|
+
onCanceled = (cancel) => {
|
|
19623
|
+
if (!request) {
|
|
19624
|
+
return;
|
|
19625
|
+
}
|
|
19626
|
+
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
19627
|
+
request.abort();
|
|
19628
|
+
request = null;
|
|
19629
|
+
};
|
|
19248
19630
|
|
|
19249
|
-
|
|
19250
|
-
|
|
19251
|
-
|
|
19252
|
-
|
|
19253
|
-
|
|
19254
|
-
return;
|
|
19631
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
19632
|
+
if (_config.signal) {
|
|
19633
|
+
_config.signal.aborted
|
|
19634
|
+
? onCanceled()
|
|
19635
|
+
: _config.signal.addEventListener('abort', onCanceled);
|
|
19255
19636
|
}
|
|
19256
|
-
reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
|
|
19257
|
-
request.abort();
|
|
19258
|
-
request = null;
|
|
19259
|
-
};
|
|
19260
|
-
|
|
19261
|
-
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
19262
|
-
if (_config.signal) {
|
|
19263
|
-
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
19264
19637
|
}
|
|
19265
|
-
}
|
|
19266
|
-
|
|
19267
|
-
const protocol = parseProtocol(_config.url);
|
|
19268
19638
|
|
|
19269
|
-
|
|
19270
|
-
reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
|
|
19271
|
-
return;
|
|
19272
|
-
}
|
|
19639
|
+
const protocol = parseProtocol(_config.url);
|
|
19273
19640
|
|
|
19641
|
+
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
19642
|
+
reject(
|
|
19643
|
+
new AxiosError$1(
|
|
19644
|
+
'Unsupported protocol ' + protocol + ':',
|
|
19645
|
+
AxiosError$1.ERR_BAD_REQUEST,
|
|
19646
|
+
config
|
|
19647
|
+
)
|
|
19648
|
+
);
|
|
19649
|
+
return;
|
|
19650
|
+
}
|
|
19274
19651
|
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
};
|
|
19652
|
+
// Send the request
|
|
19653
|
+
request.send(requestData || null);
|
|
19654
|
+
});
|
|
19655
|
+
};
|
|
19279
19656
|
|
|
19280
19657
|
const composeSignals = (signals, timeout) => {
|
|
19281
|
-
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
|
19658
|
+
const { length } = (signals = signals ? signals.filter(Boolean) : []);
|
|
19282
19659
|
|
|
19283
19660
|
if (timeout || length) {
|
|
19284
19661
|
let controller = new AbortController();
|
|
@@ -19290,21 +19667,29 @@ const composeSignals = (signals, timeout) => {
|
|
|
19290
19667
|
aborted = true;
|
|
19291
19668
|
unsubscribe();
|
|
19292
19669
|
const err = reason instanceof Error ? reason : this.reason;
|
|
19293
|
-
controller.abort(
|
|
19670
|
+
controller.abort(
|
|
19671
|
+
err instanceof AxiosError$1
|
|
19672
|
+
? err
|
|
19673
|
+
: new CanceledError$1(err instanceof Error ? err.message : err)
|
|
19674
|
+
);
|
|
19294
19675
|
}
|
|
19295
19676
|
};
|
|
19296
19677
|
|
|
19297
|
-
let timer =
|
|
19298
|
-
|
|
19299
|
-
|
|
19300
|
-
|
|
19678
|
+
let timer =
|
|
19679
|
+
timeout &&
|
|
19680
|
+
setTimeout(() => {
|
|
19681
|
+
timer = null;
|
|
19682
|
+
onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
|
|
19683
|
+
}, timeout);
|
|
19301
19684
|
|
|
19302
19685
|
const unsubscribe = () => {
|
|
19303
19686
|
if (signals) {
|
|
19304
19687
|
timer && clearTimeout(timer);
|
|
19305
19688
|
timer = null;
|
|
19306
|
-
signals.forEach(signal => {
|
|
19307
|
-
signal.unsubscribe
|
|
19689
|
+
signals.forEach((signal) => {
|
|
19690
|
+
signal.unsubscribe
|
|
19691
|
+
? signal.unsubscribe(onabort)
|
|
19692
|
+
: signal.removeEventListener('abort', onabort);
|
|
19308
19693
|
});
|
|
19309
19694
|
signals = null;
|
|
19310
19695
|
}
|
|
@@ -19312,7 +19697,7 @@ const composeSignals = (signals, timeout) => {
|
|
|
19312
19697
|
|
|
19313
19698
|
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
19314
19699
|
|
|
19315
|
-
const {signal} = controller;
|
|
19700
|
+
const { signal } = controller;
|
|
19316
19701
|
|
|
19317
19702
|
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
19318
19703
|
|
|
@@ -19353,7 +19738,7 @@ const readStream = async function* (stream) {
|
|
|
19353
19738
|
const reader = stream.getReader();
|
|
19354
19739
|
try {
|
|
19355
19740
|
for (;;) {
|
|
19356
|
-
const {done, value} = await reader.read();
|
|
19741
|
+
const { done, value } = await reader.read();
|
|
19357
19742
|
if (done) {
|
|
19358
19743
|
break;
|
|
19359
19744
|
}
|
|
@@ -19376,64 +19761,69 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
19376
19761
|
}
|
|
19377
19762
|
};
|
|
19378
19763
|
|
|
19379
|
-
return new ReadableStream(
|
|
19380
|
-
|
|
19381
|
-
|
|
19382
|
-
|
|
19764
|
+
return new ReadableStream(
|
|
19765
|
+
{
|
|
19766
|
+
async pull(controller) {
|
|
19767
|
+
try {
|
|
19768
|
+
const { done, value } = await iterator.next();
|
|
19383
19769
|
|
|
19384
|
-
|
|
19385
|
-
|
|
19386
|
-
|
|
19387
|
-
|
|
19388
|
-
|
|
19770
|
+
if (done) {
|
|
19771
|
+
_onFinish();
|
|
19772
|
+
controller.close();
|
|
19773
|
+
return;
|
|
19774
|
+
}
|
|
19389
19775
|
|
|
19390
|
-
|
|
19391
|
-
|
|
19392
|
-
|
|
19393
|
-
|
|
19776
|
+
let len = value.byteLength;
|
|
19777
|
+
if (onProgress) {
|
|
19778
|
+
let loadedBytes = (bytes += len);
|
|
19779
|
+
onProgress(loadedBytes);
|
|
19780
|
+
}
|
|
19781
|
+
controller.enqueue(new Uint8Array(value));
|
|
19782
|
+
} catch (err) {
|
|
19783
|
+
_onFinish(err);
|
|
19784
|
+
throw err;
|
|
19394
19785
|
}
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
_onFinish(
|
|
19398
|
-
|
|
19399
|
-
}
|
|
19786
|
+
},
|
|
19787
|
+
cancel(reason) {
|
|
19788
|
+
_onFinish(reason);
|
|
19789
|
+
return iterator.return();
|
|
19790
|
+
},
|
|
19400
19791
|
},
|
|
19401
|
-
|
|
19402
|
-
|
|
19403
|
-
return iterator.return();
|
|
19792
|
+
{
|
|
19793
|
+
highWaterMark: 2,
|
|
19404
19794
|
}
|
|
19405
|
-
|
|
19406
|
-
highWaterMark: 2
|
|
19407
|
-
})
|
|
19795
|
+
);
|
|
19408
19796
|
};
|
|
19409
19797
|
|
|
19410
19798
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
19411
19799
|
|
|
19412
|
-
const {isFunction} = utils$1;
|
|
19800
|
+
const { isFunction } = utils$1;
|
|
19413
19801
|
|
|
19414
|
-
const globalFetchAPI = (({Request, Response}) => ({
|
|
19415
|
-
Request,
|
|
19802
|
+
const globalFetchAPI = (({ Request, Response }) => ({
|
|
19803
|
+
Request,
|
|
19804
|
+
Response,
|
|
19416
19805
|
}))(utils$1.global);
|
|
19417
19806
|
|
|
19418
|
-
const {
|
|
19419
|
-
ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1
|
|
19420
|
-
} = utils$1.global;
|
|
19421
|
-
|
|
19807
|
+
const { ReadableStream: ReadableStream$1, TextEncoder: TextEncoder$1 } = utils$1.global;
|
|
19422
19808
|
|
|
19423
19809
|
const test = (fn, ...args) => {
|
|
19424
19810
|
try {
|
|
19425
19811
|
return !!fn(...args);
|
|
19426
19812
|
} catch (e) {
|
|
19427
|
-
return false
|
|
19813
|
+
return false;
|
|
19428
19814
|
}
|
|
19429
19815
|
};
|
|
19430
19816
|
|
|
19431
19817
|
const factory = (env) => {
|
|
19432
|
-
env = utils$1.merge.call(
|
|
19433
|
-
|
|
19434
|
-
|
|
19818
|
+
env = utils$1.merge.call(
|
|
19819
|
+
{
|
|
19820
|
+
skipUndefined: true,
|
|
19821
|
+
},
|
|
19822
|
+
globalFetchAPI,
|
|
19823
|
+
env
|
|
19824
|
+
);
|
|
19435
19825
|
|
|
19436
|
-
const {fetch: envFetch, Request, Response} = env;
|
|
19826
|
+
const { fetch: envFetch, Request, Response } = env;
|
|
19437
19827
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
19438
19828
|
const isRequestSupported = isFunction(Request);
|
|
19439
19829
|
const isResponseSupported = isFunction(Response);
|
|
@@ -19444,46 +19834,61 @@ const factory = (env) => {
|
|
|
19444
19834
|
|
|
19445
19835
|
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
19446
19836
|
|
|
19447
|
-
const encodeText =
|
|
19448
|
-
|
|
19449
|
-
|
|
19450
|
-
|
|
19451
|
-
|
|
19452
|
-
|
|
19453
|
-
|
|
19454
|
-
|
|
19455
|
-
|
|
19456
|
-
|
|
19457
|
-
|
|
19458
|
-
|
|
19459
|
-
|
|
19460
|
-
|
|
19461
|
-
|
|
19462
|
-
|
|
19837
|
+
const encodeText =
|
|
19838
|
+
isFetchSupported &&
|
|
19839
|
+
(typeof TextEncoder$1 === 'function'
|
|
19840
|
+
? (
|
|
19841
|
+
(encoder) => (str) =>
|
|
19842
|
+
encoder.encode(str)
|
|
19843
|
+
)(new TextEncoder$1())
|
|
19844
|
+
: async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
19845
|
+
|
|
19846
|
+
const supportsRequestStream =
|
|
19847
|
+
isRequestSupported &&
|
|
19848
|
+
isReadableStreamSupported &&
|
|
19849
|
+
test(() => {
|
|
19850
|
+
let duplexAccessed = false;
|
|
19851
|
+
|
|
19852
|
+
const hasContentType = new Request(platform.origin, {
|
|
19853
|
+
body: new ReadableStream$1(),
|
|
19854
|
+
method: 'POST',
|
|
19855
|
+
get duplex() {
|
|
19856
|
+
duplexAccessed = true;
|
|
19857
|
+
return 'half';
|
|
19858
|
+
},
|
|
19859
|
+
}).headers.has('Content-Type');
|
|
19463
19860
|
|
|
19464
|
-
|
|
19465
|
-
|
|
19861
|
+
return duplexAccessed && !hasContentType;
|
|
19862
|
+
});
|
|
19466
19863
|
|
|
19467
|
-
const supportsResponseStream =
|
|
19864
|
+
const supportsResponseStream =
|
|
19865
|
+
isResponseSupported &&
|
|
19866
|
+
isReadableStreamSupported &&
|
|
19468
19867
|
test(() => utils$1.isReadableStream(new Response('').body));
|
|
19469
19868
|
|
|
19470
19869
|
const resolvers = {
|
|
19471
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
19870
|
+
stream: supportsResponseStream && ((res) => res.body),
|
|
19472
19871
|
};
|
|
19473
19872
|
|
|
19474
|
-
isFetchSupported &&
|
|
19475
|
-
|
|
19476
|
-
|
|
19477
|
-
|
|
19873
|
+
isFetchSupported &&
|
|
19874
|
+
(() => {
|
|
19875
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
|
|
19876
|
+
!resolvers[type] &&
|
|
19877
|
+
(resolvers[type] = (res, config) => {
|
|
19878
|
+
let method = res && res[type];
|
|
19478
19879
|
|
|
19479
|
-
|
|
19480
|
-
|
|
19481
|
-
|
|
19880
|
+
if (method) {
|
|
19881
|
+
return method.call(res);
|
|
19882
|
+
}
|
|
19482
19883
|
|
|
19483
|
-
|
|
19884
|
+
throw new AxiosError$1(
|
|
19885
|
+
`Response type '${type}' is not supported`,
|
|
19886
|
+
AxiosError$1.ERR_NOT_SUPPORT,
|
|
19887
|
+
config
|
|
19888
|
+
);
|
|
19889
|
+
});
|
|
19484
19890
|
});
|
|
19485
|
-
});
|
|
19486
|
-
})());
|
|
19891
|
+
})();
|
|
19487
19892
|
|
|
19488
19893
|
const getBodyLength = async (body) => {
|
|
19489
19894
|
if (body == null) {
|
|
@@ -19534,32 +19939,41 @@ const factory = (env) => {
|
|
|
19534
19939
|
responseType,
|
|
19535
19940
|
headers,
|
|
19536
19941
|
withCredentials = 'same-origin',
|
|
19537
|
-
fetchOptions
|
|
19942
|
+
fetchOptions,
|
|
19538
19943
|
} = resolveConfig(config);
|
|
19539
19944
|
|
|
19540
19945
|
let _fetch = envFetch || fetch;
|
|
19541
19946
|
|
|
19542
19947
|
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
19543
19948
|
|
|
19544
|
-
let composedSignal = composeSignals(
|
|
19949
|
+
let composedSignal = composeSignals(
|
|
19950
|
+
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
19951
|
+
timeout
|
|
19952
|
+
);
|
|
19545
19953
|
|
|
19546
19954
|
let request = null;
|
|
19547
19955
|
|
|
19548
|
-
const unsubscribe =
|
|
19549
|
-
composedSignal
|
|
19550
|
-
|
|
19956
|
+
const unsubscribe =
|
|
19957
|
+
composedSignal &&
|
|
19958
|
+
composedSignal.unsubscribe &&
|
|
19959
|
+
(() => {
|
|
19960
|
+
composedSignal.unsubscribe();
|
|
19961
|
+
});
|
|
19551
19962
|
|
|
19552
19963
|
let requestContentLength;
|
|
19553
19964
|
|
|
19554
19965
|
try {
|
|
19555
19966
|
if (
|
|
19556
|
-
onUploadProgress &&
|
|
19967
|
+
onUploadProgress &&
|
|
19968
|
+
supportsRequestStream &&
|
|
19969
|
+
method !== 'get' &&
|
|
19970
|
+
method !== 'head' &&
|
|
19557
19971
|
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
19558
19972
|
) {
|
|
19559
19973
|
let _request = new Request(url, {
|
|
19560
19974
|
method: 'POST',
|
|
19561
19975
|
body: data,
|
|
19562
|
-
duplex:
|
|
19976
|
+
duplex: 'half',
|
|
19563
19977
|
});
|
|
19564
19978
|
|
|
19565
19979
|
let contentTypeHeader;
|
|
@@ -19584,7 +19998,7 @@ const factory = (env) => {
|
|
|
19584
19998
|
|
|
19585
19999
|
// Cloudflare Workers throws when credentials are defined
|
|
19586
20000
|
// see https://github.com/cloudflare/workerd/issues/902
|
|
19587
|
-
const isCredentialsSupported = isRequestSupported &&
|
|
20001
|
+
const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
|
|
19588
20002
|
|
|
19589
20003
|
const resolvedOptions = {
|
|
19590
20004
|
...fetchOptions,
|
|
@@ -19592,29 +20006,35 @@ const factory = (env) => {
|
|
|
19592
20006
|
method: method.toUpperCase(),
|
|
19593
20007
|
headers: headers.normalize().toJSON(),
|
|
19594
20008
|
body: data,
|
|
19595
|
-
duplex:
|
|
19596
|
-
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
20009
|
+
duplex: 'half',
|
|
20010
|
+
credentials: isCredentialsSupported ? withCredentials : undefined,
|
|
19597
20011
|
};
|
|
19598
20012
|
|
|
19599
20013
|
request = isRequestSupported && new Request(url, resolvedOptions);
|
|
19600
20014
|
|
|
19601
|
-
let response = await (isRequestSupported
|
|
20015
|
+
let response = await (isRequestSupported
|
|
20016
|
+
? _fetch(request, fetchOptions)
|
|
20017
|
+
: _fetch(url, resolvedOptions));
|
|
19602
20018
|
|
|
19603
|
-
const isStreamResponse =
|
|
20019
|
+
const isStreamResponse =
|
|
20020
|
+
supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
19604
20021
|
|
|
19605
20022
|
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
19606
20023
|
const options = {};
|
|
19607
20024
|
|
|
19608
|
-
['status', 'statusText', 'headers'].forEach(prop => {
|
|
20025
|
+
['status', 'statusText', 'headers'].forEach((prop) => {
|
|
19609
20026
|
options[prop] = response[prop];
|
|
19610
20027
|
});
|
|
19611
20028
|
|
|
19612
20029
|
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
19613
20030
|
|
|
19614
|
-
const [onProgress, flush] =
|
|
19615
|
-
|
|
19616
|
-
|
|
19617
|
-
|
|
20031
|
+
const [onProgress, flush] =
|
|
20032
|
+
(onDownloadProgress &&
|
|
20033
|
+
progressEventDecorator(
|
|
20034
|
+
responseContentLength,
|
|
20035
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
20036
|
+
)) ||
|
|
20037
|
+
[];
|
|
19618
20038
|
|
|
19619
20039
|
response = new Response(
|
|
19620
20040
|
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
@@ -19627,7 +20047,10 @@ const factory = (env) => {
|
|
|
19627
20047
|
|
|
19628
20048
|
responseType = responseType || 'text';
|
|
19629
20049
|
|
|
19630
|
-
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
20050
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
|
|
20051
|
+
response,
|
|
20052
|
+
config
|
|
20053
|
+
);
|
|
19631
20054
|
|
|
19632
20055
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
19633
20056
|
|
|
@@ -19638,43 +20061,50 @@ const factory = (env) => {
|
|
|
19638
20061
|
status: response.status,
|
|
19639
20062
|
statusText: response.statusText,
|
|
19640
20063
|
config,
|
|
19641
|
-
request
|
|
20064
|
+
request,
|
|
19642
20065
|
});
|
|
19643
|
-
})
|
|
20066
|
+
});
|
|
19644
20067
|
} catch (err) {
|
|
19645
20068
|
unsubscribe && unsubscribe();
|
|
19646
20069
|
|
|
19647
20070
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
19648
20071
|
throw Object.assign(
|
|
19649
|
-
new AxiosError$1(
|
|
20072
|
+
new AxiosError$1(
|
|
20073
|
+
'Network Error',
|
|
20074
|
+
AxiosError$1.ERR_NETWORK,
|
|
20075
|
+
config,
|
|
20076
|
+
request,
|
|
20077
|
+
err && err.response
|
|
20078
|
+
),
|
|
19650
20079
|
{
|
|
19651
|
-
cause: err.cause || err
|
|
20080
|
+
cause: err.cause || err,
|
|
19652
20081
|
}
|
|
19653
|
-
)
|
|
20082
|
+
);
|
|
19654
20083
|
}
|
|
19655
20084
|
|
|
19656
20085
|
throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
|
|
19657
20086
|
}
|
|
19658
|
-
}
|
|
20087
|
+
};
|
|
19659
20088
|
};
|
|
19660
20089
|
|
|
19661
20090
|
const seedCache = new Map();
|
|
19662
20091
|
|
|
19663
20092
|
const getFetch = (config) => {
|
|
19664
20093
|
let env = (config && config.env) || {};
|
|
19665
|
-
const {fetch, Request, Response} = env;
|
|
19666
|
-
const seeds = [
|
|
19667
|
-
Request, Response, fetch
|
|
19668
|
-
];
|
|
20094
|
+
const { fetch, Request, Response } = env;
|
|
20095
|
+
const seeds = [Request, Response, fetch];
|
|
19669
20096
|
|
|
19670
|
-
let len = seeds.length,
|
|
19671
|
-
|
|
20097
|
+
let len = seeds.length,
|
|
20098
|
+
i = len,
|
|
20099
|
+
seed,
|
|
20100
|
+
target,
|
|
20101
|
+
map = seedCache;
|
|
19672
20102
|
|
|
19673
20103
|
while (i--) {
|
|
19674
20104
|
seed = seeds[i];
|
|
19675
20105
|
target = map.get(seed);
|
|
19676
20106
|
|
|
19677
|
-
target === undefined && map.set(seed, target =
|
|
20107
|
+
target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
|
|
19678
20108
|
|
|
19679
20109
|
map = target;
|
|
19680
20110
|
}
|
|
@@ -19690,7 +20120,7 @@ getFetch();
|
|
|
19690
20120
|
* - `http` for Node.js
|
|
19691
20121
|
* - `xhr` for browsers
|
|
19692
20122
|
* - `fetch` for fetch API-based requests
|
|
19693
|
-
*
|
|
20123
|
+
*
|
|
19694
20124
|
* @type {Object<string, Function|Object>}
|
|
19695
20125
|
*/
|
|
19696
20126
|
const knownAdapters = {
|
|
@@ -19698,7 +20128,7 @@ const knownAdapters = {
|
|
|
19698
20128
|
xhr: xhrAdapter,
|
|
19699
20129
|
fetch: {
|
|
19700
20130
|
get: getFetch,
|
|
19701
|
-
}
|
|
20131
|
+
},
|
|
19702
20132
|
};
|
|
19703
20133
|
|
|
19704
20134
|
// Assign adapter names for easier debugging and identification
|
|
@@ -19715,7 +20145,7 @@ utils$1.forEach(knownAdapters, (fn, value) => {
|
|
|
19715
20145
|
|
|
19716
20146
|
/**
|
|
19717
20147
|
* Render a rejection reason string for unknown or unsupported adapters
|
|
19718
|
-
*
|
|
20148
|
+
*
|
|
19719
20149
|
* @param {string} reason
|
|
19720
20150
|
* @returns {string}
|
|
19721
20151
|
*/
|
|
@@ -19723,17 +20153,18 @@ const renderReason = (reason) => `- ${reason}`;
|
|
|
19723
20153
|
|
|
19724
20154
|
/**
|
|
19725
20155
|
* Check if the adapter is resolved (function, null, or false)
|
|
19726
|
-
*
|
|
20156
|
+
*
|
|
19727
20157
|
* @param {Function|null|false} adapter
|
|
19728
20158
|
* @returns {boolean}
|
|
19729
20159
|
*/
|
|
19730
|
-
const isResolvedHandle = (adapter) =>
|
|
20160
|
+
const isResolvedHandle = (adapter) =>
|
|
20161
|
+
utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
|
19731
20162
|
|
|
19732
20163
|
/**
|
|
19733
20164
|
* Get the first suitable adapter from the provided list.
|
|
19734
20165
|
* Tries each adapter in order until a supported one is found.
|
|
19735
20166
|
* Throws an AxiosError if no adapter is suitable.
|
|
19736
|
-
*
|
|
20167
|
+
*
|
|
19737
20168
|
* @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
|
|
19738
20169
|
* @param {Object} config - Axios request configuration
|
|
19739
20170
|
* @throws {AxiosError} If no suitable adapter is available
|
|
@@ -19770,14 +20201,17 @@ function getAdapter$1(adapters, config) {
|
|
|
19770
20201
|
}
|
|
19771
20202
|
|
|
19772
20203
|
if (!adapter) {
|
|
19773
|
-
const reasons = Object.entries(rejectedReasons)
|
|
19774
|
-
|
|
20204
|
+
const reasons = Object.entries(rejectedReasons).map(
|
|
20205
|
+
([id, state]) =>
|
|
20206
|
+
`adapter ${id} ` +
|
|
19775
20207
|
(state === false ? 'is not supported by the environment' : 'is not available in the build')
|
|
19776
|
-
|
|
20208
|
+
);
|
|
19777
20209
|
|
|
19778
|
-
let s = length
|
|
19779
|
-
|
|
19780
|
-
|
|
20210
|
+
let s = length
|
|
20211
|
+
? reasons.length > 1
|
|
20212
|
+
? 'since :\n' + reasons.map(renderReason).join('\n')
|
|
20213
|
+
: ' ' + renderReason(reasons[0])
|
|
20214
|
+
: 'as no adapter specified';
|
|
19781
20215
|
|
|
19782
20216
|
throw new AxiosError$1(
|
|
19783
20217
|
`There is no suitable adapter to dispatch the request ` + s,
|
|
@@ -19802,7 +20236,7 @@ var adapters = {
|
|
|
19802
20236
|
* Exposes all known adapters
|
|
19803
20237
|
* @type {Object<string, Function|Object>}
|
|
19804
20238
|
*/
|
|
19805
|
-
adapters: knownAdapters
|
|
20239
|
+
adapters: knownAdapters,
|
|
19806
20240
|
};
|
|
19807
20241
|
|
|
19808
20242
|
/**
|
|
@@ -19835,10 +20269,7 @@ function dispatchRequest(config) {
|
|
|
19835
20269
|
config.headers = AxiosHeaders$1.from(config.headers);
|
|
19836
20270
|
|
|
19837
20271
|
// Transform request data
|
|
19838
|
-
config.data = transformData.call(
|
|
19839
|
-
config,
|
|
19840
|
-
config.transformRequest
|
|
19841
|
-
);
|
|
20272
|
+
config.data = transformData.call(config, config.transformRequest);
|
|
19842
20273
|
|
|
19843
20274
|
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
|
19844
20275
|
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
@@ -19846,36 +20277,35 @@ function dispatchRequest(config) {
|
|
|
19846
20277
|
|
|
19847
20278
|
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
19848
20279
|
|
|
19849
|
-
return adapter(config).then(
|
|
19850
|
-
|
|
20280
|
+
return adapter(config).then(
|
|
20281
|
+
function onAdapterResolution(response) {
|
|
20282
|
+
throwIfCancellationRequested(config);
|
|
19851
20283
|
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
config,
|
|
19855
|
-
config.transformResponse,
|
|
19856
|
-
response
|
|
19857
|
-
);
|
|
20284
|
+
// Transform response data
|
|
20285
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
19858
20286
|
|
|
19859
|
-
|
|
20287
|
+
response.headers = AxiosHeaders$1.from(response.headers);
|
|
19860
20288
|
|
|
19861
|
-
|
|
19862
|
-
|
|
19863
|
-
|
|
19864
|
-
|
|
20289
|
+
return response;
|
|
20290
|
+
},
|
|
20291
|
+
function onAdapterRejection(reason) {
|
|
20292
|
+
if (!isCancel$1(reason)) {
|
|
20293
|
+
throwIfCancellationRequested(config);
|
|
19865
20294
|
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
|
|
20295
|
+
// Transform response data
|
|
20296
|
+
if (reason && reason.response) {
|
|
20297
|
+
reason.response.data = transformData.call(
|
|
20298
|
+
config,
|
|
20299
|
+
config.transformResponse,
|
|
20300
|
+
reason.response
|
|
20301
|
+
);
|
|
20302
|
+
reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
|
|
20303
|
+
}
|
|
19874
20304
|
}
|
|
19875
|
-
}
|
|
19876
20305
|
|
|
19877
|
-
|
|
19878
|
-
|
|
20306
|
+
return Promise.reject(reason);
|
|
20307
|
+
}
|
|
20308
|
+
);
|
|
19879
20309
|
}
|
|
19880
20310
|
|
|
19881
20311
|
const validators$1 = {};
|
|
@@ -19900,7 +20330,15 @@ const deprecatedWarnings = {};
|
|
|
19900
20330
|
*/
|
|
19901
20331
|
validators$1.transitional = function transitional(validator, version, message) {
|
|
19902
20332
|
function formatMessage(opt, desc) {
|
|
19903
|
-
return
|
|
20333
|
+
return (
|
|
20334
|
+
'[Axios v' +
|
|
20335
|
+
VERSION$1 +
|
|
20336
|
+
"] Transitional option '" +
|
|
20337
|
+
opt +
|
|
20338
|
+
"'" +
|
|
20339
|
+
desc +
|
|
20340
|
+
(message ? '. ' + message : '')
|
|
20341
|
+
);
|
|
19904
20342
|
}
|
|
19905
20343
|
|
|
19906
20344
|
// eslint-disable-next-line func-names
|
|
@@ -19932,7 +20370,7 @@ validators$1.spelling = function spelling(correctSpelling) {
|
|
|
19932
20370
|
// eslint-disable-next-line no-console
|
|
19933
20371
|
console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
|
|
19934
20372
|
return true;
|
|
19935
|
-
}
|
|
20373
|
+
};
|
|
19936
20374
|
};
|
|
19937
20375
|
|
|
19938
20376
|
/**
|
|
@@ -19958,7 +20396,10 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
19958
20396
|
const value = options[opt];
|
|
19959
20397
|
const result = value === undefined || validator(value, opt, options);
|
|
19960
20398
|
if (result !== true) {
|
|
19961
|
-
throw new AxiosError$1(
|
|
20399
|
+
throw new AxiosError$1(
|
|
20400
|
+
'option ' + opt + ' must be ' + result,
|
|
20401
|
+
AxiosError$1.ERR_BAD_OPTION_VALUE
|
|
20402
|
+
);
|
|
19962
20403
|
}
|
|
19963
20404
|
continue;
|
|
19964
20405
|
}
|
|
@@ -19970,7 +20411,7 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
19970
20411
|
|
|
19971
20412
|
var validator = {
|
|
19972
20413
|
assertOptions,
|
|
19973
|
-
validators: validators$1
|
|
20414
|
+
validators: validators$1,
|
|
19974
20415
|
};
|
|
19975
20416
|
|
|
19976
20417
|
const validators = validator.validators;
|
|
@@ -19987,7 +20428,7 @@ let Axios$1 = class Axios {
|
|
|
19987
20428
|
this.defaults = instanceConfig || {};
|
|
19988
20429
|
this.interceptors = {
|
|
19989
20430
|
request: new InterceptorManager(),
|
|
19990
|
-
response: new InterceptorManager()
|
|
20431
|
+
response: new InterceptorManager(),
|
|
19991
20432
|
};
|
|
19992
20433
|
}
|
|
19993
20434
|
|
|
@@ -20038,27 +20479,35 @@ let Axios$1 = class Axios {
|
|
|
20038
20479
|
|
|
20039
20480
|
config = mergeConfig$1(this.defaults, config);
|
|
20040
20481
|
|
|
20041
|
-
const {transitional, paramsSerializer, headers} = config;
|
|
20482
|
+
const { transitional, paramsSerializer, headers } = config;
|
|
20042
20483
|
|
|
20043
20484
|
if (transitional !== undefined) {
|
|
20044
|
-
validator.assertOptions(
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
|
|
20485
|
+
validator.assertOptions(
|
|
20486
|
+
transitional,
|
|
20487
|
+
{
|
|
20488
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
20489
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
20490
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
20491
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
|
|
20492
|
+
},
|
|
20493
|
+
false
|
|
20494
|
+
);
|
|
20050
20495
|
}
|
|
20051
20496
|
|
|
20052
20497
|
if (paramsSerializer != null) {
|
|
20053
20498
|
if (utils$1.isFunction(paramsSerializer)) {
|
|
20054
20499
|
config.paramsSerializer = {
|
|
20055
|
-
serialize: paramsSerializer
|
|
20500
|
+
serialize: paramsSerializer,
|
|
20056
20501
|
};
|
|
20057
20502
|
} else {
|
|
20058
|
-
validator.assertOptions(
|
|
20059
|
-
|
|
20060
|
-
|
|
20061
|
-
|
|
20503
|
+
validator.assertOptions(
|
|
20504
|
+
paramsSerializer,
|
|
20505
|
+
{
|
|
20506
|
+
encode: validators.function,
|
|
20507
|
+
serialize: validators.function,
|
|
20508
|
+
},
|
|
20509
|
+
true
|
|
20510
|
+
);
|
|
20062
20511
|
}
|
|
20063
20512
|
}
|
|
20064
20513
|
|
|
@@ -20069,26 +20518,25 @@ let Axios$1 = class Axios {
|
|
|
20069
20518
|
config.allowAbsoluteUrls = true;
|
|
20070
20519
|
}
|
|
20071
20520
|
|
|
20072
|
-
validator.assertOptions(
|
|
20073
|
-
|
|
20074
|
-
|
|
20075
|
-
|
|
20521
|
+
validator.assertOptions(
|
|
20522
|
+
config,
|
|
20523
|
+
{
|
|
20524
|
+
baseUrl: validators.spelling('baseURL'),
|
|
20525
|
+
withXsrfToken: validators.spelling('withXSRFToken'),
|
|
20526
|
+
},
|
|
20527
|
+
true
|
|
20528
|
+
);
|
|
20076
20529
|
|
|
20077
20530
|
// Set config.method
|
|
20078
20531
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
20079
20532
|
|
|
20080
20533
|
// Flatten headers
|
|
20081
|
-
let contextHeaders = headers && utils$1.merge(
|
|
20082
|
-
headers.common,
|
|
20083
|
-
headers[config.method]
|
|
20084
|
-
);
|
|
20534
|
+
let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
|
20085
20535
|
|
|
20086
|
-
headers &&
|
|
20087
|
-
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
20088
|
-
(method) => {
|
|
20536
|
+
headers &&
|
|
20537
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
|
|
20089
20538
|
delete headers[method];
|
|
20090
|
-
}
|
|
20091
|
-
);
|
|
20539
|
+
});
|
|
20092
20540
|
|
|
20093
20541
|
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
|
20094
20542
|
|
|
@@ -20103,7 +20551,8 @@ let Axios$1 = class Axios {
|
|
|
20103
20551
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
20104
20552
|
|
|
20105
20553
|
const transitional = config.transitional || transitionalDefaults;
|
|
20106
|
-
const legacyInterceptorReqResOrdering =
|
|
20554
|
+
const legacyInterceptorReqResOrdering =
|
|
20555
|
+
transitional && transitional.legacyInterceptorReqResOrdering;
|
|
20107
20556
|
|
|
20108
20557
|
if (legacyInterceptorReqResOrdering) {
|
|
20109
20558
|
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
@@ -20177,12 +20626,14 @@ let Axios$1 = class Axios {
|
|
|
20177
20626
|
// Provide aliases for supported request methods
|
|
20178
20627
|
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
20179
20628
|
/*eslint func-names:0*/
|
|
20180
|
-
Axios$1.prototype[method] = function(url, config) {
|
|
20181
|
-
return this.request(
|
|
20182
|
-
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20629
|
+
Axios$1.prototype[method] = function (url, config) {
|
|
20630
|
+
return this.request(
|
|
20631
|
+
mergeConfig$1(config || {}, {
|
|
20632
|
+
method,
|
|
20633
|
+
url,
|
|
20634
|
+
data: (config || {}).data,
|
|
20635
|
+
})
|
|
20636
|
+
);
|
|
20186
20637
|
};
|
|
20187
20638
|
});
|
|
20188
20639
|
|
|
@@ -20191,14 +20642,18 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
|
|
|
20191
20642
|
|
|
20192
20643
|
function generateHTTPMethod(isForm) {
|
|
20193
20644
|
return function httpMethod(url, data, config) {
|
|
20194
|
-
return this.request(
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20199
|
-
|
|
20200
|
-
|
|
20201
|
-
|
|
20645
|
+
return this.request(
|
|
20646
|
+
mergeConfig$1(config || {}, {
|
|
20647
|
+
method,
|
|
20648
|
+
headers: isForm
|
|
20649
|
+
? {
|
|
20650
|
+
'Content-Type': 'multipart/form-data',
|
|
20651
|
+
}
|
|
20652
|
+
: {},
|
|
20653
|
+
url,
|
|
20654
|
+
data,
|
|
20655
|
+
})
|
|
20656
|
+
);
|
|
20202
20657
|
};
|
|
20203
20658
|
}
|
|
20204
20659
|
|
|
@@ -20229,7 +20684,7 @@ let CancelToken$1 = class CancelToken {
|
|
|
20229
20684
|
const token = this;
|
|
20230
20685
|
|
|
20231
20686
|
// eslint-disable-next-line func-names
|
|
20232
|
-
this.promise.then(cancel => {
|
|
20687
|
+
this.promise.then((cancel) => {
|
|
20233
20688
|
if (!token._listeners) return;
|
|
20234
20689
|
|
|
20235
20690
|
let i = token._listeners.length;
|
|
@@ -20241,10 +20696,10 @@ let CancelToken$1 = class CancelToken {
|
|
|
20241
20696
|
});
|
|
20242
20697
|
|
|
20243
20698
|
// eslint-disable-next-line func-names
|
|
20244
|
-
this.promise.then = onfulfilled => {
|
|
20699
|
+
this.promise.then = (onfulfilled) => {
|
|
20245
20700
|
let _resolve;
|
|
20246
20701
|
// eslint-disable-next-line func-names
|
|
20247
|
-
const promise = new Promise(resolve => {
|
|
20702
|
+
const promise = new Promise((resolve) => {
|
|
20248
20703
|
token.subscribe(resolve);
|
|
20249
20704
|
_resolve = resolve;
|
|
20250
20705
|
}).then(onfulfilled);
|
|
@@ -20332,7 +20787,7 @@ let CancelToken$1 = class CancelToken {
|
|
|
20332
20787
|
});
|
|
20333
20788
|
return {
|
|
20334
20789
|
token,
|
|
20335
|
-
cancel
|
|
20790
|
+
cancel,
|
|
20336
20791
|
};
|
|
20337
20792
|
}
|
|
20338
20793
|
};
|
|
@@ -20372,7 +20827,7 @@ function spread$1(callback) {
|
|
|
20372
20827
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
20373
20828
|
*/
|
|
20374
20829
|
function isAxiosError$1(payload) {
|
|
20375
|
-
return utils$1.isObject(payload) &&
|
|
20830
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
|
20376
20831
|
}
|
|
20377
20832
|
|
|
20378
20833
|
const HttpStatusCode$1 = {
|
|
@@ -20463,10 +20918,10 @@ function createInstance(defaultConfig) {
|
|
|
20463
20918
|
const instance = bind(Axios$1.prototype.request, context);
|
|
20464
20919
|
|
|
20465
20920
|
// Copy axios.prototype to instance
|
|
20466
|
-
utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
|
|
20921
|
+
utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
|
|
20467
20922
|
|
|
20468
20923
|
// Copy context to instance
|
|
20469
|
-
utils$1.extend(instance, context, null, {allOwnKeys: true});
|
|
20924
|
+
utils$1.extend(instance, context, null, { allOwnKeys: true });
|
|
20470
20925
|
|
|
20471
20926
|
// Factory for creating new instances
|
|
20472
20927
|
instance.create = function create(instanceConfig) {
|
|
@@ -20510,7 +20965,7 @@ axios.mergeConfig = mergeConfig$1;
|
|
|
20510
20965
|
|
|
20511
20966
|
axios.AxiosHeaders = AxiosHeaders$1;
|
|
20512
20967
|
|
|
20513
|
-
axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
20968
|
+
axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
20514
20969
|
|
|
20515
20970
|
axios.getAdapter = adapters.getAdapter;
|
|
20516
20971
|
|
|
@@ -20537,7 +20992,7 @@ const {
|
|
|
20537
20992
|
HttpStatusCode,
|
|
20538
20993
|
formToJSON,
|
|
20539
20994
|
getAdapter,
|
|
20540
|
-
mergeConfig
|
|
20995
|
+
mergeConfig,
|
|
20541
20996
|
} = axios;
|
|
20542
20997
|
|
|
20543
20998
|
/**
|