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