axios 0.21.1 → 0.22.0
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/CHANGELOG.md +115 -8
- package/README.md +97 -5
- package/SECURITY.md +5 -0
- package/dist/axios.js +2102 -1583
- package/dist/axios.map +1 -1
- package/dist/axios.min.js +1 -2
- package/dist/axios.min.map +1 -1
- package/index.d.ts +35 -21
- package/lib/adapters/http.js +74 -14
- package/lib/adapters/xhr.js +65 -32
- package/lib/axios.js +6 -5
- package/lib/cancel/CancelToken.js +62 -0
- package/lib/core/Axios.js +60 -7
- package/lib/core/InterceptorManager.js +4 -2
- package/lib/core/README.md +1 -0
- package/lib/core/dispatchRequest.js +11 -3
- package/lib/core/enhanceError.js +2 -1
- package/lib/core/mergeConfig.js +50 -38
- package/lib/core/transformData.js +3 -1
- package/lib/defaults.js +48 -12
- package/lib/env/README.md +3 -0
- package/lib/env/data.js +3 -0
- package/lib/helpers/validator.js +82 -0
- package/lib/utils.js +1 -3
- package/package.json +23 -23
package/dist/axios.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
/* axios v0.21.1 | (c) 2020 by Matt Zabriskie */
|
2
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
3
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
4
3
|
module.exports = factory();
|
@@ -8,7 +7,7 @@
|
|
8
7
|
exports["axios"] = factory();
|
9
8
|
else
|
10
9
|
root["axios"] = factory();
|
11
|
-
})(
|
10
|
+
})(window, function() {
|
12
11
|
return /******/ (function(modules) { // webpackBootstrap
|
13
12
|
/******/ // The module cache
|
14
13
|
/******/ var installedModules = {};
|
@@ -17,21 +16,21 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
17
16
|
/******/ function __webpack_require__(moduleId) {
|
18
17
|
/******/
|
19
18
|
/******/ // Check if module is in cache
|
20
|
-
/******/ if(installedModules[moduleId])
|
19
|
+
/******/ if(installedModules[moduleId]) {
|
21
20
|
/******/ return installedModules[moduleId].exports;
|
22
|
-
/******/
|
21
|
+
/******/ }
|
23
22
|
/******/ // Create a new module (and put it into the cache)
|
24
23
|
/******/ var module = installedModules[moduleId] = {
|
25
|
-
/******/
|
26
|
-
/******/
|
27
|
-
/******/
|
24
|
+
/******/ i: moduleId,
|
25
|
+
/******/ l: false,
|
26
|
+
/******/ exports: {}
|
28
27
|
/******/ };
|
29
28
|
/******/
|
30
29
|
/******/ // Execute the module function
|
31
30
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
32
31
|
/******/
|
33
32
|
/******/ // Flag the module as loaded
|
34
|
-
/******/ module.
|
33
|
+
/******/ module.l = true;
|
35
34
|
/******/
|
36
35
|
/******/ // Return the exports of the module
|
37
36
|
/******/ return module.exports;
|
@@ -44,1713 +43,2233 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
44
43
|
/******/ // expose the module cache
|
45
44
|
/******/ __webpack_require__.c = installedModules;
|
46
45
|
/******/
|
46
|
+
/******/ // define getter function for harmony exports
|
47
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
48
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
49
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
50
|
+
/******/ }
|
51
|
+
/******/ };
|
52
|
+
/******/
|
53
|
+
/******/ // define __esModule on exports
|
54
|
+
/******/ __webpack_require__.r = function(exports) {
|
55
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
56
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
57
|
+
/******/ }
|
58
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
59
|
+
/******/ };
|
60
|
+
/******/
|
61
|
+
/******/ // create a fake namespace object
|
62
|
+
/******/ // mode & 1: value is a module id, require it
|
63
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
64
|
+
/******/ // mode & 4: return value when already ns object
|
65
|
+
/******/ // mode & 8|1: behave like require
|
66
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
67
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
68
|
+
/******/ if(mode & 8) return value;
|
69
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
70
|
+
/******/ var ns = Object.create(null);
|
71
|
+
/******/ __webpack_require__.r(ns);
|
72
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
73
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
74
|
+
/******/ return ns;
|
75
|
+
/******/ };
|
76
|
+
/******/
|
77
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
78
|
+
/******/ __webpack_require__.n = function(module) {
|
79
|
+
/******/ var getter = module && module.__esModule ?
|
80
|
+
/******/ function getDefault() { return module['default']; } :
|
81
|
+
/******/ function getModuleExports() { return module; };
|
82
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
83
|
+
/******/ return getter;
|
84
|
+
/******/ };
|
85
|
+
/******/
|
86
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
87
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
88
|
+
/******/
|
47
89
|
/******/ // __webpack_public_path__
|
48
90
|
/******/ __webpack_require__.p = "";
|
49
91
|
/******/
|
92
|
+
/******/
|
50
93
|
/******/ // Load entry module and return exports
|
51
|
-
/******/ return __webpack_require__(
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = "./index.js");
|
52
95
|
/******/ })
|
53
96
|
/************************************************************************/
|
54
|
-
/******/ (
|
55
|
-
|
97
|
+
/******/ ({
|
98
|
+
|
99
|
+
/***/ "./index.js":
|
100
|
+
/*!******************!*\
|
101
|
+
!*** ./index.js ***!
|
102
|
+
\******************/
|
103
|
+
/*! no static exports found */
|
56
104
|
/***/ (function(module, exports, __webpack_require__) {
|
57
105
|
|
58
|
-
|
106
|
+
module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js");
|
59
107
|
|
60
108
|
/***/ }),
|
61
|
-
|
109
|
+
|
110
|
+
/***/ "./lib/adapters/xhr.js":
|
111
|
+
/*!*****************************!*\
|
112
|
+
!*** ./lib/adapters/xhr.js ***!
|
113
|
+
\*****************************/
|
114
|
+
/*! no static exports found */
|
62
115
|
/***/ (function(module, exports, __webpack_require__) {
|
63
116
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
117
|
+
"use strict";
|
118
|
+
|
119
|
+
|
120
|
+
var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
|
121
|
+
var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js");
|
122
|
+
var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js");
|
123
|
+
var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js");
|
124
|
+
var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js");
|
125
|
+
var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js");
|
126
|
+
var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js");
|
127
|
+
var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js");
|
128
|
+
var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js");
|
129
|
+
var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./lib/cancel/Cancel.js");
|
130
|
+
|
131
|
+
module.exports = function xhrAdapter(config) {
|
132
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
133
|
+
var requestData = config.data;
|
134
|
+
var requestHeaders = config.headers;
|
135
|
+
var responseType = config.responseType;
|
136
|
+
var onCanceled;
|
137
|
+
function done() {
|
138
|
+
if (config.cancelToken) {
|
139
|
+
config.cancelToken.unsubscribe(onCanceled);
|
140
|
+
}
|
141
|
+
|
142
|
+
if (config.signal) {
|
143
|
+
config.signal.removeEventListener('abort', onCanceled);
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
if (utils.isFormData(requestData)) {
|
148
|
+
delete requestHeaders['Content-Type']; // Let the browser set it
|
149
|
+
}
|
150
|
+
|
151
|
+
var request = new XMLHttpRequest();
|
152
|
+
|
153
|
+
// HTTP basic authentication
|
154
|
+
if (config.auth) {
|
155
|
+
var username = config.auth.username || '';
|
156
|
+
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
157
|
+
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
158
|
+
}
|
159
|
+
|
160
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
161
|
+
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
162
|
+
|
163
|
+
// Set the request timeout in MS
|
164
|
+
request.timeout = config.timeout;
|
165
|
+
|
166
|
+
function onloadend() {
|
167
|
+
if (!request) {
|
168
|
+
return;
|
169
|
+
}
|
170
|
+
// Prepare the response
|
171
|
+
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
172
|
+
var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
173
|
+
request.responseText : request.response;
|
174
|
+
var response = {
|
175
|
+
data: responseData,
|
176
|
+
status: request.status,
|
177
|
+
statusText: request.statusText,
|
178
|
+
headers: responseHeaders,
|
179
|
+
config: config,
|
180
|
+
request: request
|
181
|
+
};
|
182
|
+
|
183
|
+
settle(function _resolve(value) {
|
184
|
+
resolve(value);
|
185
|
+
done();
|
186
|
+
}, function _reject(err) {
|
187
|
+
reject(err);
|
188
|
+
done();
|
189
|
+
}, response);
|
190
|
+
|
191
|
+
// Clean up request
|
192
|
+
request = null;
|
193
|
+
}
|
194
|
+
|
195
|
+
if ('onloadend' in request) {
|
196
|
+
// Use onloadend if available
|
197
|
+
request.onloadend = onloadend;
|
198
|
+
} else {
|
199
|
+
// Listen for ready state to emulate onloadend
|
200
|
+
request.onreadystatechange = function handleLoad() {
|
201
|
+
if (!request || request.readyState !== 4) {
|
202
|
+
return;
|
203
|
+
}
|
204
|
+
|
205
|
+
// The request errored out and we didn't get a response, this will be
|
206
|
+
// handled by onerror instead
|
207
|
+
// With one exception: request that using file: protocol, most browsers
|
208
|
+
// will return status as 0 even though it's a successful request
|
209
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
210
|
+
return;
|
211
|
+
}
|
212
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
213
|
+
// so we should call onloadend on the next 'tick'
|
214
|
+
setTimeout(onloadend);
|
215
|
+
};
|
216
|
+
}
|
217
|
+
|
218
|
+
// Handle browser request cancellation (as opposed to a manual cancellation)
|
219
|
+
request.onabort = function handleAbort() {
|
220
|
+
if (!request) {
|
221
|
+
return;
|
222
|
+
}
|
223
|
+
|
224
|
+
reject(createError('Request aborted', config, 'ECONNABORTED', request));
|
225
|
+
|
226
|
+
// Clean up request
|
227
|
+
request = null;
|
228
|
+
};
|
229
|
+
|
230
|
+
// Handle low level network errors
|
231
|
+
request.onerror = function handleError() {
|
232
|
+
// Real errors are hidden from us by the browser
|
233
|
+
// onerror should only fire if it's a network error
|
234
|
+
reject(createError('Network Error', config, null, request));
|
235
|
+
|
236
|
+
// Clean up request
|
237
|
+
request = null;
|
238
|
+
};
|
239
|
+
|
240
|
+
// Handle timeout
|
241
|
+
request.ontimeout = function handleTimeout() {
|
242
|
+
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
243
|
+
var transitional = config.transitional || defaults.transitional;
|
244
|
+
if (config.timeoutErrorMessage) {
|
245
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
246
|
+
}
|
247
|
+
reject(createError(
|
248
|
+
timeoutErrorMessage,
|
249
|
+
config,
|
250
|
+
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
251
|
+
request));
|
252
|
+
|
253
|
+
// Clean up request
|
254
|
+
request = null;
|
255
|
+
};
|
256
|
+
|
257
|
+
// Add xsrf header
|
258
|
+
// This is only done if running in a standard browser environment.
|
259
|
+
// Specifically not if we're in a web worker, or react-native.
|
260
|
+
if (utils.isStandardBrowserEnv()) {
|
261
|
+
// Add xsrf header
|
262
|
+
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
263
|
+
cookies.read(config.xsrfCookieName) :
|
264
|
+
undefined;
|
265
|
+
|
266
|
+
if (xsrfValue) {
|
267
|
+
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
// Add headers to the request
|
272
|
+
if ('setRequestHeader' in request) {
|
273
|
+
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
274
|
+
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
275
|
+
// Remove Content-Type if data is undefined
|
276
|
+
delete requestHeaders[key];
|
277
|
+
} else {
|
278
|
+
// Otherwise add header to the request
|
279
|
+
request.setRequestHeader(key, val);
|
280
|
+
}
|
281
|
+
});
|
282
|
+
}
|
283
|
+
|
284
|
+
// Add withCredentials to request if needed
|
285
|
+
if (!utils.isUndefined(config.withCredentials)) {
|
286
|
+
request.withCredentials = !!config.withCredentials;
|
287
|
+
}
|
288
|
+
|
289
|
+
// Add responseType to request if needed
|
290
|
+
if (responseType && responseType !== 'json') {
|
291
|
+
request.responseType = config.responseType;
|
292
|
+
}
|
293
|
+
|
294
|
+
// Handle progress if needed
|
295
|
+
if (typeof config.onDownloadProgress === 'function') {
|
296
|
+
request.addEventListener('progress', config.onDownloadProgress);
|
297
|
+
}
|
298
|
+
|
299
|
+
// Not all browsers support upload events
|
300
|
+
if (typeof config.onUploadProgress === 'function' && request.upload) {
|
301
|
+
request.upload.addEventListener('progress', config.onUploadProgress);
|
302
|
+
}
|
303
|
+
|
304
|
+
if (config.cancelToken || config.signal) {
|
305
|
+
// Handle cancellation
|
306
|
+
// eslint-disable-next-line func-names
|
307
|
+
onCanceled = function(cancel) {
|
308
|
+
if (!request) {
|
309
|
+
return;
|
310
|
+
}
|
311
|
+
reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);
|
312
|
+
request.abort();
|
313
|
+
request = null;
|
314
|
+
};
|
315
|
+
|
316
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
317
|
+
if (config.signal) {
|
318
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
|
319
|
+
}
|
320
|
+
}
|
321
|
+
|
322
|
+
if (!requestData) {
|
323
|
+
requestData = null;
|
324
|
+
}
|
325
|
+
|
326
|
+
// Send the request
|
327
|
+
request.send(requestData);
|
328
|
+
});
|
329
|
+
};
|
120
330
|
|
121
331
|
|
122
332
|
/***/ }),
|
123
|
-
|
333
|
+
|
334
|
+
/***/ "./lib/axios.js":
|
335
|
+
/*!**********************!*\
|
336
|
+
!*** ./lib/axios.js ***!
|
337
|
+
\**********************/
|
338
|
+
/*! no static exports found */
|
124
339
|
/***/ (function(module, exports, __webpack_require__) {
|
125
340
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
return (typeof FormData !== 'undefined') && (val instanceof FormData);
|
185
|
-
}
|
186
|
-
|
187
|
-
/**
|
188
|
-
* Determine if a value is a view on an ArrayBuffer
|
189
|
-
*
|
190
|
-
* @param {Object} val The value to test
|
191
|
-
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
192
|
-
*/
|
193
|
-
function isArrayBufferView(val) {
|
194
|
-
var result;
|
195
|
-
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
196
|
-
result = ArrayBuffer.isView(val);
|
197
|
-
} else {
|
198
|
-
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
|
199
|
-
}
|
200
|
-
return result;
|
201
|
-
}
|
202
|
-
|
203
|
-
/**
|
204
|
-
* Determine if a value is a String
|
205
|
-
*
|
206
|
-
* @param {Object} val The value to test
|
207
|
-
* @returns {boolean} True if value is a String, otherwise false
|
208
|
-
*/
|
209
|
-
function isString(val) {
|
210
|
-
return typeof val === 'string';
|
211
|
-
}
|
212
|
-
|
213
|
-
/**
|
214
|
-
* Determine if a value is a Number
|
215
|
-
*
|
216
|
-
* @param {Object} val The value to test
|
217
|
-
* @returns {boolean} True if value is a Number, otherwise false
|
218
|
-
*/
|
219
|
-
function isNumber(val) {
|
220
|
-
return typeof val === 'number';
|
221
|
-
}
|
222
|
-
|
223
|
-
/**
|
224
|
-
* Determine if a value is an Object
|
225
|
-
*
|
226
|
-
* @param {Object} val The value to test
|
227
|
-
* @returns {boolean} True if value is an Object, otherwise false
|
228
|
-
*/
|
229
|
-
function isObject(val) {
|
230
|
-
return val !== null && typeof val === 'object';
|
231
|
-
}
|
232
|
-
|
233
|
-
/**
|
234
|
-
* Determine if a value is a plain Object
|
235
|
-
*
|
236
|
-
* @param {Object} val The value to test
|
237
|
-
* @return {boolean} True if value is a plain Object, otherwise false
|
238
|
-
*/
|
239
|
-
function isPlainObject(val) {
|
240
|
-
if (toString.call(val) !== '[object Object]') {
|
241
|
-
return false;
|
242
|
-
}
|
243
|
-
|
244
|
-
var prototype = Object.getPrototypeOf(val);
|
245
|
-
return prototype === null || prototype === Object.prototype;
|
246
|
-
}
|
247
|
-
|
248
|
-
/**
|
249
|
-
* Determine if a value is a Date
|
250
|
-
*
|
251
|
-
* @param {Object} val The value to test
|
252
|
-
* @returns {boolean} True if value is a Date, otherwise false
|
253
|
-
*/
|
254
|
-
function isDate(val) {
|
255
|
-
return toString.call(val) === '[object Date]';
|
256
|
-
}
|
257
|
-
|
258
|
-
/**
|
259
|
-
* Determine if a value is a File
|
260
|
-
*
|
261
|
-
* @param {Object} val The value to test
|
262
|
-
* @returns {boolean} True if value is a File, otherwise false
|
263
|
-
*/
|
264
|
-
function isFile(val) {
|
265
|
-
return toString.call(val) === '[object File]';
|
266
|
-
}
|
267
|
-
|
268
|
-
/**
|
269
|
-
* Determine if a value is a Blob
|
270
|
-
*
|
271
|
-
* @param {Object} val The value to test
|
272
|
-
* @returns {boolean} True if value is a Blob, otherwise false
|
273
|
-
*/
|
274
|
-
function isBlob(val) {
|
275
|
-
return toString.call(val) === '[object Blob]';
|
276
|
-
}
|
277
|
-
|
278
|
-
/**
|
279
|
-
* Determine if a value is a Function
|
280
|
-
*
|
281
|
-
* @param {Object} val The value to test
|
282
|
-
* @returns {boolean} True if value is a Function, otherwise false
|
283
|
-
*/
|
284
|
-
function isFunction(val) {
|
285
|
-
return toString.call(val) === '[object Function]';
|
286
|
-
}
|
287
|
-
|
288
|
-
/**
|
289
|
-
* Determine if a value is a Stream
|
290
|
-
*
|
291
|
-
* @param {Object} val The value to test
|
292
|
-
* @returns {boolean} True if value is a Stream, otherwise false
|
293
|
-
*/
|
294
|
-
function isStream(val) {
|
295
|
-
return isObject(val) && isFunction(val.pipe);
|
296
|
-
}
|
297
|
-
|
298
|
-
/**
|
299
|
-
* Determine if a value is a URLSearchParams object
|
300
|
-
*
|
301
|
-
* @param {Object} val The value to test
|
302
|
-
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
303
|
-
*/
|
304
|
-
function isURLSearchParams(val) {
|
305
|
-
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
|
306
|
-
}
|
307
|
-
|
308
|
-
/**
|
309
|
-
* Trim excess whitespace off the beginning and end of a string
|
310
|
-
*
|
311
|
-
* @param {String} str The String to trim
|
312
|
-
* @returns {String} The String freed of excess whitespace
|
313
|
-
*/
|
314
|
-
function trim(str) {
|
315
|
-
return str.replace(/^\s*/, '').replace(/\s*$/, '');
|
316
|
-
}
|
317
|
-
|
318
|
-
/**
|
319
|
-
* Determine if we're running in a standard browser environment
|
320
|
-
*
|
321
|
-
* This allows axios to run in a web worker, and react-native.
|
322
|
-
* Both environments support XMLHttpRequest, but not fully standard globals.
|
323
|
-
*
|
324
|
-
* web workers:
|
325
|
-
* typeof window -> undefined
|
326
|
-
* typeof document -> undefined
|
327
|
-
*
|
328
|
-
* react-native:
|
329
|
-
* navigator.product -> 'ReactNative'
|
330
|
-
* nativescript
|
331
|
-
* navigator.product -> 'NativeScript' or 'NS'
|
332
|
-
*/
|
333
|
-
function isStandardBrowserEnv() {
|
334
|
-
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
|
335
|
-
navigator.product === 'NativeScript' ||
|
336
|
-
navigator.product === 'NS')) {
|
337
|
-
return false;
|
338
|
-
}
|
339
|
-
return (
|
340
|
-
typeof window !== 'undefined' &&
|
341
|
-
typeof document !== 'undefined'
|
342
|
-
);
|
343
|
-
}
|
344
|
-
|
345
|
-
/**
|
346
|
-
* Iterate over an Array or an Object invoking a function for each item.
|
347
|
-
*
|
348
|
-
* If `obj` is an Array callback will be called passing
|
349
|
-
* the value, index, and complete array for each item.
|
350
|
-
*
|
351
|
-
* If 'obj' is an Object callback will be called passing
|
352
|
-
* the value, key, and complete object for each property.
|
353
|
-
*
|
354
|
-
* @param {Object|Array} obj The object to iterate
|
355
|
-
* @param {Function} fn The callback to invoke for each item
|
356
|
-
*/
|
357
|
-
function forEach(obj, fn) {
|
358
|
-
// Don't bother if no value provided
|
359
|
-
if (obj === null || typeof obj === 'undefined') {
|
360
|
-
return;
|
361
|
-
}
|
362
|
-
|
363
|
-
// Force an array if not already something iterable
|
364
|
-
if (typeof obj !== 'object') {
|
365
|
-
/*eslint no-param-reassign:0*/
|
366
|
-
obj = [obj];
|
367
|
-
}
|
368
|
-
|
369
|
-
if (isArray(obj)) {
|
370
|
-
// Iterate over array values
|
371
|
-
for (var i = 0, l = obj.length; i < l; i++) {
|
372
|
-
fn.call(null, obj[i], i, obj);
|
373
|
-
}
|
374
|
-
} else {
|
375
|
-
// Iterate over object keys
|
376
|
-
for (var key in obj) {
|
377
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
378
|
-
fn.call(null, obj[key], key, obj);
|
379
|
-
}
|
380
|
-
}
|
381
|
-
}
|
382
|
-
}
|
383
|
-
|
384
|
-
/**
|
385
|
-
* Accepts varargs expecting each argument to be an object, then
|
386
|
-
* immutably merges the properties of each object and returns result.
|
387
|
-
*
|
388
|
-
* When multiple objects contain the same key the later object in
|
389
|
-
* the arguments list will take precedence.
|
390
|
-
*
|
391
|
-
* Example:
|
392
|
-
*
|
393
|
-
* ```js
|
394
|
-
* var result = merge({foo: 123}, {foo: 456});
|
395
|
-
* console.log(result.foo); // outputs 456
|
396
|
-
* ```
|
397
|
-
*
|
398
|
-
* @param {Object} obj1 Object to merge
|
399
|
-
* @returns {Object} Result of all merge properties
|
400
|
-
*/
|
401
|
-
function merge(/* obj1, obj2, obj3, ... */) {
|
402
|
-
var result = {};
|
403
|
-
function assignValue(val, key) {
|
404
|
-
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
405
|
-
result[key] = merge(result[key], val);
|
406
|
-
} else if (isPlainObject(val)) {
|
407
|
-
result[key] = merge({}, val);
|
408
|
-
} else if (isArray(val)) {
|
409
|
-
result[key] = val.slice();
|
410
|
-
} else {
|
411
|
-
result[key] = val;
|
412
|
-
}
|
413
|
-
}
|
414
|
-
|
415
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
416
|
-
forEach(arguments[i], assignValue);
|
417
|
-
}
|
418
|
-
return result;
|
419
|
-
}
|
420
|
-
|
421
|
-
/**
|
422
|
-
* Extends object a by mutably adding to it the properties of object b.
|
423
|
-
*
|
424
|
-
* @param {Object} a The object to be extended
|
425
|
-
* @param {Object} b The object to copy properties from
|
426
|
-
* @param {Object} thisArg The object to bind function to
|
427
|
-
* @return {Object} The resulting value of object a
|
428
|
-
*/
|
429
|
-
function extend(a, b, thisArg) {
|
430
|
-
forEach(b, function assignValue(val, key) {
|
431
|
-
if (thisArg && typeof val === 'function') {
|
432
|
-
a[key] = bind(val, thisArg);
|
433
|
-
} else {
|
434
|
-
a[key] = val;
|
435
|
-
}
|
436
|
-
});
|
437
|
-
return a;
|
438
|
-
}
|
439
|
-
|
440
|
-
/**
|
441
|
-
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
442
|
-
*
|
443
|
-
* @param {string} content with BOM
|
444
|
-
* @return {string} content value without BOM
|
445
|
-
*/
|
446
|
-
function stripBOM(content) {
|
447
|
-
if (content.charCodeAt(0) === 0xFEFF) {
|
448
|
-
content = content.slice(1);
|
449
|
-
}
|
450
|
-
return content;
|
451
|
-
}
|
452
|
-
|
453
|
-
module.exports = {
|
454
|
-
isArray: isArray,
|
455
|
-
isArrayBuffer: isArrayBuffer,
|
456
|
-
isBuffer: isBuffer,
|
457
|
-
isFormData: isFormData,
|
458
|
-
isArrayBufferView: isArrayBufferView,
|
459
|
-
isString: isString,
|
460
|
-
isNumber: isNumber,
|
461
|
-
isObject: isObject,
|
462
|
-
isPlainObject: isPlainObject,
|
463
|
-
isUndefined: isUndefined,
|
464
|
-
isDate: isDate,
|
465
|
-
isFile: isFile,
|
466
|
-
isBlob: isBlob,
|
467
|
-
isFunction: isFunction,
|
468
|
-
isStream: isStream,
|
469
|
-
isURLSearchParams: isURLSearchParams,
|
470
|
-
isStandardBrowserEnv: isStandardBrowserEnv,
|
471
|
-
forEach: forEach,
|
472
|
-
merge: merge,
|
473
|
-
extend: extend,
|
474
|
-
trim: trim,
|
475
|
-
stripBOM: stripBOM
|
476
|
-
};
|
341
|
+
"use strict";
|
342
|
+
|
343
|
+
|
344
|
+
var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js");
|
345
|
+
var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js");
|
346
|
+
var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js");
|
347
|
+
var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js");
|
348
|
+
var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults.js");
|
349
|
+
|
350
|
+
/**
|
351
|
+
* Create an instance of Axios
|
352
|
+
*
|
353
|
+
* @param {Object} defaultConfig The default config for the instance
|
354
|
+
* @return {Axios} A new instance of Axios
|
355
|
+
*/
|
356
|
+
function createInstance(defaultConfig) {
|
357
|
+
var context = new Axios(defaultConfig);
|
358
|
+
var instance = bind(Axios.prototype.request, context);
|
359
|
+
|
360
|
+
// Copy axios.prototype to instance
|
361
|
+
utils.extend(instance, Axios.prototype, context);
|
362
|
+
|
363
|
+
// Copy context to instance
|
364
|
+
utils.extend(instance, context);
|
365
|
+
|
366
|
+
// Factory for creating new instances
|
367
|
+
instance.create = function create(instanceConfig) {
|
368
|
+
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
369
|
+
};
|
370
|
+
|
371
|
+
return instance;
|
372
|
+
}
|
373
|
+
|
374
|
+
// Create the default instance to be exported
|
375
|
+
var axios = createInstance(defaults);
|
376
|
+
|
377
|
+
// Expose Axios class to allow class inheritance
|
378
|
+
axios.Axios = Axios;
|
379
|
+
|
380
|
+
// Expose Cancel & CancelToken
|
381
|
+
axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js");
|
382
|
+
axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js");
|
383
|
+
axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js");
|
384
|
+
axios.VERSION = __webpack_require__(/*! ./env/data */ "./lib/env/data.js").version;
|
385
|
+
|
386
|
+
// Expose all/spread
|
387
|
+
axios.all = function all(promises) {
|
388
|
+
return Promise.all(promises);
|
389
|
+
};
|
390
|
+
axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js");
|
391
|
+
|
392
|
+
// Expose isAxiosError
|
393
|
+
axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js");
|
394
|
+
|
395
|
+
module.exports = axios;
|
396
|
+
|
397
|
+
// Allow use of default import syntax in TypeScript
|
398
|
+
module.exports.default = axios;
|
477
399
|
|
478
400
|
|
479
401
|
/***/ }),
|
480
|
-
/* 3 */
|
481
|
-
/***/ (function(module, exports) {
|
482
402
|
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
403
|
+
/***/ "./lib/cancel/Cancel.js":
|
404
|
+
/*!******************************!*\
|
405
|
+
!*** ./lib/cancel/Cancel.js ***!
|
406
|
+
\******************************/
|
407
|
+
/*! no static exports found */
|
408
|
+
/***/ (function(module, exports, __webpack_require__) {
|
409
|
+
|
410
|
+
"use strict";
|
411
|
+
|
412
|
+
|
413
|
+
/**
|
414
|
+
* A `Cancel` is an object that is thrown when an operation is canceled.
|
415
|
+
*
|
416
|
+
* @class
|
417
|
+
* @param {string=} message The message.
|
418
|
+
*/
|
419
|
+
function Cancel(message) {
|
420
|
+
this.message = message;
|
421
|
+
}
|
422
|
+
|
423
|
+
Cancel.prototype.toString = function toString() {
|
424
|
+
return 'Cancel' + (this.message ? ': ' + this.message : '');
|
425
|
+
};
|
426
|
+
|
427
|
+
Cancel.prototype.__CANCEL__ = true;
|
428
|
+
|
429
|
+
module.exports = Cancel;
|
494
430
|
|
495
431
|
|
496
432
|
/***/ }),
|
497
|
-
|
433
|
+
|
434
|
+
/***/ "./lib/cancel/CancelToken.js":
|
435
|
+
/*!***********************************!*\
|
436
|
+
!*** ./lib/cancel/CancelToken.js ***!
|
437
|
+
\***********************************/
|
438
|
+
/*! no static exports found */
|
498
439
|
/***/ (function(module, exports, __webpack_require__) {
|
499
440
|
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
441
|
+
"use strict";
|
442
|
+
|
443
|
+
|
444
|
+
var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js");
|
445
|
+
|
446
|
+
/**
|
447
|
+
* A `CancelToken` is an object that can be used to request cancellation of an operation.
|
448
|
+
*
|
449
|
+
* @class
|
450
|
+
* @param {Function} executor The executor function.
|
451
|
+
*/
|
452
|
+
function CancelToken(executor) {
|
453
|
+
if (typeof executor !== 'function') {
|
454
|
+
throw new TypeError('executor must be a function.');
|
455
|
+
}
|
456
|
+
|
457
|
+
var resolvePromise;
|
458
|
+
|
459
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
460
|
+
resolvePromise = resolve;
|
461
|
+
});
|
462
|
+
|
463
|
+
var token = this;
|
464
|
+
|
465
|
+
// eslint-disable-next-line func-names
|
466
|
+
this.promise.then(function(cancel) {
|
467
|
+
if (!token._listeners) return;
|
468
|
+
|
469
|
+
var i;
|
470
|
+
var l = token._listeners.length;
|
471
|
+
|
472
|
+
for (i = 0; i < l; i++) {
|
473
|
+
token._listeners[i](cancel);
|
474
|
+
}
|
475
|
+
token._listeners = null;
|
476
|
+
});
|
477
|
+
|
478
|
+
// eslint-disable-next-line func-names
|
479
|
+
this.promise.then = function(onfulfilled) {
|
480
|
+
var _resolve;
|
481
|
+
// eslint-disable-next-line func-names
|
482
|
+
var promise = new Promise(function(resolve) {
|
483
|
+
token.subscribe(resolve);
|
484
|
+
_resolve = resolve;
|
485
|
+
}).then(onfulfilled);
|
486
|
+
|
487
|
+
promise.cancel = function reject() {
|
488
|
+
token.unsubscribe(_resolve);
|
489
|
+
};
|
490
|
+
|
491
|
+
return promise;
|
492
|
+
};
|
493
|
+
|
494
|
+
executor(function cancel(message) {
|
495
|
+
if (token.reason) {
|
496
|
+
// Cancellation has already been requested
|
497
|
+
return;
|
498
|
+
}
|
499
|
+
|
500
|
+
token.reason = new Cancel(message);
|
501
|
+
resolvePromise(token.reason);
|
502
|
+
});
|
503
|
+
}
|
504
|
+
|
505
|
+
/**
|
506
|
+
* Throws a `Cancel` if cancellation has been requested.
|
507
|
+
*/
|
508
|
+
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
509
|
+
if (this.reason) {
|
510
|
+
throw this.reason;
|
511
|
+
}
|
512
|
+
};
|
513
|
+
|
514
|
+
/**
|
515
|
+
* Subscribe to the cancel signal
|
516
|
+
*/
|
517
|
+
|
518
|
+
CancelToken.prototype.subscribe = function subscribe(listener) {
|
519
|
+
if (this.reason) {
|
520
|
+
listener(this.reason);
|
521
|
+
return;
|
522
|
+
}
|
523
|
+
|
524
|
+
if (this._listeners) {
|
525
|
+
this._listeners.push(listener);
|
526
|
+
} else {
|
527
|
+
this._listeners = [listener];
|
528
|
+
}
|
529
|
+
};
|
530
|
+
|
531
|
+
/**
|
532
|
+
* Unsubscribe from the cancel signal
|
533
|
+
*/
|
534
|
+
|
535
|
+
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
|
536
|
+
if (!this._listeners) {
|
537
|
+
return;
|
538
|
+
}
|
539
|
+
var index = this._listeners.indexOf(listener);
|
540
|
+
if (index !== -1) {
|
541
|
+
this._listeners.splice(index, 1);
|
542
|
+
}
|
543
|
+
};
|
544
|
+
|
545
|
+
/**
|
546
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
547
|
+
* cancels the `CancelToken`.
|
548
|
+
*/
|
549
|
+
CancelToken.source = function source() {
|
550
|
+
var cancel;
|
551
|
+
var token = new CancelToken(function executor(c) {
|
552
|
+
cancel = c;
|
553
|
+
});
|
554
|
+
return {
|
555
|
+
token: token,
|
556
|
+
cancel: cancel
|
557
|
+
};
|
558
|
+
};
|
559
|
+
|
560
|
+
module.exports = CancelToken;
|
595
561
|
|
596
562
|
|
597
563
|
/***/ }),
|
598
|
-
|
564
|
+
|
565
|
+
/***/ "./lib/cancel/isCancel.js":
|
566
|
+
/*!********************************!*\
|
567
|
+
!*** ./lib/cancel/isCancel.js ***!
|
568
|
+
\********************************/
|
569
|
+
/*! no static exports found */
|
599
570
|
/***/ (function(module, exports, __webpack_require__) {
|
600
571
|
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
replace(/%3A/gi, ':').
|
608
|
-
replace(/%24/g, '$').
|
609
|
-
replace(/%2C/gi, ',').
|
610
|
-
replace(/%20/g, '+').
|
611
|
-
replace(/%5B/gi, '[').
|
612
|
-
replace(/%5D/gi, ']');
|
613
|
-
}
|
614
|
-
|
615
|
-
/**
|
616
|
-
* Build a URL by appending params to the end
|
617
|
-
*
|
618
|
-
* @param {string} url The base of the url (e.g., http://www.google.com)
|
619
|
-
* @param {object} [params] The params to be appended
|
620
|
-
* @returns {string} The formatted url
|
621
|
-
*/
|
622
|
-
module.exports = function buildURL(url, params, paramsSerializer) {
|
623
|
-
/*eslint no-param-reassign:0*/
|
624
|
-
if (!params) {
|
625
|
-
return url;
|
626
|
-
}
|
627
|
-
|
628
|
-
var serializedParams;
|
629
|
-
if (paramsSerializer) {
|
630
|
-
serializedParams = paramsSerializer(params);
|
631
|
-
} else if (utils.isURLSearchParams(params)) {
|
632
|
-
serializedParams = params.toString();
|
633
|
-
} else {
|
634
|
-
var parts = [];
|
635
|
-
|
636
|
-
utils.forEach(params, function serialize(val, key) {
|
637
|
-
if (val === null || typeof val === 'undefined') {
|
638
|
-
return;
|
639
|
-
}
|
640
|
-
|
641
|
-
if (utils.isArray(val)) {
|
642
|
-
key = key + '[]';
|
643
|
-
} else {
|
644
|
-
val = [val];
|
645
|
-
}
|
646
|
-
|
647
|
-
utils.forEach(val, function parseValue(v) {
|
648
|
-
if (utils.isDate(v)) {
|
649
|
-
v = v.toISOString();
|
650
|
-
} else if (utils.isObject(v)) {
|
651
|
-
v = JSON.stringify(v);
|
652
|
-
}
|
653
|
-
parts.push(encode(key) + '=' + encode(v));
|
654
|
-
});
|
655
|
-
});
|
656
|
-
|
657
|
-
serializedParams = parts.join('&');
|
658
|
-
}
|
659
|
-
|
660
|
-
if (serializedParams) {
|
661
|
-
var hashmarkIndex = url.indexOf('#');
|
662
|
-
if (hashmarkIndex !== -1) {
|
663
|
-
url = url.slice(0, hashmarkIndex);
|
664
|
-
}
|
665
|
-
|
666
|
-
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
667
|
-
}
|
668
|
-
|
669
|
-
return url;
|
670
|
-
};
|
572
|
+
"use strict";
|
573
|
+
|
574
|
+
|
575
|
+
module.exports = function isCancel(value) {
|
576
|
+
return !!(value && value.__CANCEL__);
|
577
|
+
};
|
671
578
|
|
672
579
|
|
673
580
|
/***/ }),
|
674
|
-
|
581
|
+
|
582
|
+
/***/ "./lib/core/Axios.js":
|
583
|
+
/*!***************************!*\
|
584
|
+
!*** ./lib/core/Axios.js ***!
|
585
|
+
\***************************/
|
586
|
+
/*! no static exports found */
|
675
587
|
/***/ (function(module, exports, __webpack_require__) {
|
676
588
|
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
589
|
+
"use strict";
|
590
|
+
|
591
|
+
|
592
|
+
var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
|
593
|
+
var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js");
|
594
|
+
var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js");
|
595
|
+
var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js");
|
596
|
+
var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js");
|
597
|
+
var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js");
|
598
|
+
|
599
|
+
var validators = validator.validators;
|
600
|
+
/**
|
601
|
+
* Create a new instance of Axios
|
602
|
+
*
|
603
|
+
* @param {Object} instanceConfig The default config for the instance
|
604
|
+
*/
|
605
|
+
function Axios(instanceConfig) {
|
606
|
+
this.defaults = instanceConfig;
|
607
|
+
this.interceptors = {
|
608
|
+
request: new InterceptorManager(),
|
609
|
+
response: new InterceptorManager()
|
610
|
+
};
|
611
|
+
}
|
612
|
+
|
613
|
+
/**
|
614
|
+
* Dispatch a request
|
615
|
+
*
|
616
|
+
* @param {Object} config The config specific for this request (merged with this.defaults)
|
617
|
+
*/
|
618
|
+
Axios.prototype.request = function request(config) {
|
619
|
+
/*eslint no-param-reassign:0*/
|
620
|
+
// Allow for axios('example/url'[, config]) a la fetch API
|
621
|
+
if (typeof config === 'string') {
|
622
|
+
config = arguments[1] || {};
|
623
|
+
config.url = arguments[0];
|
624
|
+
} else {
|
625
|
+
config = config || {};
|
626
|
+
}
|
627
|
+
|
628
|
+
config = mergeConfig(this.defaults, config);
|
629
|
+
|
630
|
+
// Set config.method
|
631
|
+
if (config.method) {
|
632
|
+
config.method = config.method.toLowerCase();
|
633
|
+
} else if (this.defaults.method) {
|
634
|
+
config.method = this.defaults.method.toLowerCase();
|
635
|
+
} else {
|
636
|
+
config.method = 'get';
|
637
|
+
}
|
638
|
+
|
639
|
+
var transitional = config.transitional;
|
640
|
+
|
641
|
+
if (transitional !== undefined) {
|
642
|
+
validator.assertOptions(transitional, {
|
643
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
644
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
645
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
646
|
+
}, false);
|
647
|
+
}
|
648
|
+
|
649
|
+
// filter out skipped interceptors
|
650
|
+
var requestInterceptorChain = [];
|
651
|
+
var synchronousRequestInterceptors = true;
|
652
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
653
|
+
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
|
654
|
+
return;
|
655
|
+
}
|
656
|
+
|
657
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
658
|
+
|
659
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
660
|
+
});
|
661
|
+
|
662
|
+
var responseInterceptorChain = [];
|
663
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
664
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
665
|
+
});
|
666
|
+
|
667
|
+
var promise;
|
668
|
+
|
669
|
+
if (!synchronousRequestInterceptors) {
|
670
|
+
var chain = [dispatchRequest, undefined];
|
671
|
+
|
672
|
+
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
673
|
+
chain = chain.concat(responseInterceptorChain);
|
674
|
+
|
675
|
+
promise = Promise.resolve(config);
|
676
|
+
while (chain.length) {
|
677
|
+
promise = promise.then(chain.shift(), chain.shift());
|
678
|
+
}
|
679
|
+
|
680
|
+
return promise;
|
681
|
+
}
|
682
|
+
|
683
|
+
|
684
|
+
var newConfig = config;
|
685
|
+
while (requestInterceptorChain.length) {
|
686
|
+
var onFulfilled = requestInterceptorChain.shift();
|
687
|
+
var onRejected = requestInterceptorChain.shift();
|
688
|
+
try {
|
689
|
+
newConfig = onFulfilled(newConfig);
|
690
|
+
} catch (error) {
|
691
|
+
onRejected(error);
|
692
|
+
break;
|
693
|
+
}
|
694
|
+
}
|
695
|
+
|
696
|
+
try {
|
697
|
+
promise = dispatchRequest(newConfig);
|
698
|
+
} catch (error) {
|
699
|
+
return Promise.reject(error);
|
700
|
+
}
|
701
|
+
|
702
|
+
while (responseInterceptorChain.length) {
|
703
|
+
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
704
|
+
}
|
705
|
+
|
706
|
+
return promise;
|
707
|
+
};
|
708
|
+
|
709
|
+
Axios.prototype.getUri = function getUri(config) {
|
710
|
+
config = mergeConfig(this.defaults, config);
|
711
|
+
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
712
|
+
};
|
713
|
+
|
714
|
+
// Provide aliases for supported request methods
|
715
|
+
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
716
|
+
/*eslint func-names:0*/
|
717
|
+
Axios.prototype[method] = function(url, config) {
|
718
|
+
return this.request(mergeConfig(config || {}, {
|
719
|
+
method: method,
|
720
|
+
url: url,
|
721
|
+
data: (config || {}).data
|
722
|
+
}));
|
723
|
+
};
|
724
|
+
});
|
725
|
+
|
726
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
727
|
+
/*eslint func-names:0*/
|
728
|
+
Axios.prototype[method] = function(url, data, config) {
|
729
|
+
return this.request(mergeConfig(config || {}, {
|
730
|
+
method: method,
|
731
|
+
url: url,
|
732
|
+
data: data
|
733
|
+
}));
|
734
|
+
};
|
735
|
+
});
|
736
|
+
|
737
|
+
module.exports = Axios;
|
729
738
|
|
730
739
|
|
731
740
|
/***/ }),
|
732
|
-
|
741
|
+
|
742
|
+
/***/ "./lib/core/InterceptorManager.js":
|
743
|
+
/*!****************************************!*\
|
744
|
+
!*** ./lib/core/InterceptorManager.js ***!
|
745
|
+
\****************************************/
|
746
|
+
/*! no static exports found */
|
733
747
|
/***/ (function(module, exports, __webpack_require__) {
|
734
748
|
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
response.data = transformData(
|
791
|
-
response.data,
|
792
|
-
response.headers,
|
793
|
-
config.transformResponse
|
794
|
-
);
|
795
|
-
|
796
|
-
return response;
|
797
|
-
}, function onAdapterRejection(reason) {
|
798
|
-
if (!isCancel(reason)) {
|
799
|
-
throwIfCancellationRequested(config);
|
800
|
-
|
801
|
-
// Transform response data
|
802
|
-
if (reason && reason.response) {
|
803
|
-
reason.response.data = transformData(
|
804
|
-
reason.response.data,
|
805
|
-
reason.response.headers,
|
806
|
-
config.transformResponse
|
807
|
-
);
|
808
|
-
}
|
809
|
-
}
|
810
|
-
|
811
|
-
return Promise.reject(reason);
|
812
|
-
});
|
813
|
-
};
|
749
|
+
"use strict";
|
750
|
+
|
751
|
+
|
752
|
+
var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
|
753
|
+
|
754
|
+
function InterceptorManager() {
|
755
|
+
this.handlers = [];
|
756
|
+
}
|
757
|
+
|
758
|
+
/**
|
759
|
+
* Add a new interceptor to the stack
|
760
|
+
*
|
761
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
762
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
763
|
+
*
|
764
|
+
* @return {Number} An ID used to remove interceptor later
|
765
|
+
*/
|
766
|
+
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
767
|
+
this.handlers.push({
|
768
|
+
fulfilled: fulfilled,
|
769
|
+
rejected: rejected,
|
770
|
+
synchronous: options ? options.synchronous : false,
|
771
|
+
runWhen: options ? options.runWhen : null
|
772
|
+
});
|
773
|
+
return this.handlers.length - 1;
|
774
|
+
};
|
775
|
+
|
776
|
+
/**
|
777
|
+
* Remove an interceptor from the stack
|
778
|
+
*
|
779
|
+
* @param {Number} id The ID that was returned by `use`
|
780
|
+
*/
|
781
|
+
InterceptorManager.prototype.eject = function eject(id) {
|
782
|
+
if (this.handlers[id]) {
|
783
|
+
this.handlers[id] = null;
|
784
|
+
}
|
785
|
+
};
|
786
|
+
|
787
|
+
/**
|
788
|
+
* Iterate over all the registered interceptors
|
789
|
+
*
|
790
|
+
* This method is particularly useful for skipping over any
|
791
|
+
* interceptors that may have become `null` calling `eject`.
|
792
|
+
*
|
793
|
+
* @param {Function} fn The function to call for each interceptor
|
794
|
+
*/
|
795
|
+
InterceptorManager.prototype.forEach = function forEach(fn) {
|
796
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
797
|
+
if (h !== null) {
|
798
|
+
fn(h);
|
799
|
+
}
|
800
|
+
});
|
801
|
+
};
|
802
|
+
|
803
|
+
module.exports = InterceptorManager;
|
814
804
|
|
815
805
|
|
816
806
|
/***/ }),
|
817
|
-
|
807
|
+
|
808
|
+
/***/ "./lib/core/buildFullPath.js":
|
809
|
+
/*!***********************************!*\
|
810
|
+
!*** ./lib/core/buildFullPath.js ***!
|
811
|
+
\***********************************/
|
812
|
+
/*! no static exports found */
|
818
813
|
/***/ (function(module, exports, __webpack_require__) {
|
819
814
|
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
815
|
+
"use strict";
|
816
|
+
|
817
|
+
|
818
|
+
var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js");
|
819
|
+
var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js");
|
820
|
+
|
821
|
+
/**
|
822
|
+
* Creates a new URL by combining the baseURL with the requestedURL,
|
823
|
+
* only when the requestedURL is not already an absolute URL.
|
824
|
+
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
825
|
+
*
|
826
|
+
* @param {string} baseURL The base URL
|
827
|
+
* @param {string} requestedURL Absolute or relative URL to combine
|
828
|
+
* @returns {string} The combined full path
|
829
|
+
*/
|
830
|
+
module.exports = function buildFullPath(baseURL, requestedURL) {
|
831
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
832
|
+
return combineURLs(baseURL, requestedURL);
|
833
|
+
}
|
834
|
+
return requestedURL;
|
835
|
+
};
|
836
|
+
|
837
|
+
|
838
|
+
/***/ }),
|
839
|
+
|
840
|
+
/***/ "./lib/core/createError.js":
|
841
|
+
/*!*********************************!*\
|
842
|
+
!*** ./lib/core/createError.js ***!
|
843
|
+
\*********************************/
|
844
|
+
/*! no static exports found */
|
845
|
+
/***/ (function(module, exports, __webpack_require__) {
|
846
|
+
|
847
|
+
"use strict";
|
848
|
+
|
849
|
+
|
850
|
+
var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js");
|
851
|
+
|
852
|
+
/**
|
853
|
+
* Create an Error with the specified message, config, error code, request and response.
|
854
|
+
*
|
855
|
+
* @param {string} message The error message.
|
856
|
+
* @param {Object} config The config.
|
857
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
858
|
+
* @param {Object} [request] The request.
|
859
|
+
* @param {Object} [response] The response.
|
860
|
+
* @returns {Error} The created error.
|
861
|
+
*/
|
862
|
+
module.exports = function createError(message, config, code, request, response) {
|
863
|
+
var error = new Error(message);
|
864
|
+
return enhanceError(error, config, code, request, response);
|
865
|
+
};
|
840
866
|
|
841
867
|
|
842
868
|
/***/ }),
|
843
|
-
/* 9 */
|
844
|
-
/***/ (function(module, exports) {
|
845
869
|
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
870
|
+
/***/ "./lib/core/dispatchRequest.js":
|
871
|
+
/*!*************************************!*\
|
872
|
+
!*** ./lib/core/dispatchRequest.js ***!
|
873
|
+
\*************************************/
|
874
|
+
/*! no static exports found */
|
875
|
+
/***/ (function(module, exports, __webpack_require__) {
|
876
|
+
|
877
|
+
"use strict";
|
878
|
+
|
879
|
+
|
880
|
+
var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
|
881
|
+
var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js");
|
882
|
+
var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js");
|
883
|
+
var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js");
|
884
|
+
var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./lib/cancel/Cancel.js");
|
885
|
+
|
886
|
+
/**
|
887
|
+
* Throws a `Cancel` if cancellation has been requested.
|
888
|
+
*/
|
889
|
+
function throwIfCancellationRequested(config) {
|
890
|
+
if (config.cancelToken) {
|
891
|
+
config.cancelToken.throwIfRequested();
|
892
|
+
}
|
893
|
+
|
894
|
+
if (config.signal && config.signal.aborted) {
|
895
|
+
throw new Cancel('canceled');
|
896
|
+
}
|
897
|
+
}
|
898
|
+
|
899
|
+
/**
|
900
|
+
* Dispatch a request to the server using the configured adapter.
|
901
|
+
*
|
902
|
+
* @param {object} config The config that is to be used for the request
|
903
|
+
* @returns {Promise} The Promise to be fulfilled
|
904
|
+
*/
|
905
|
+
module.exports = function dispatchRequest(config) {
|
906
|
+
throwIfCancellationRequested(config);
|
907
|
+
|
908
|
+
// Ensure headers exist
|
909
|
+
config.headers = config.headers || {};
|
910
|
+
|
911
|
+
// Transform request data
|
912
|
+
config.data = transformData.call(
|
913
|
+
config,
|
914
|
+
config.data,
|
915
|
+
config.headers,
|
916
|
+
config.transformRequest
|
917
|
+
);
|
918
|
+
|
919
|
+
// Flatten headers
|
920
|
+
config.headers = utils.merge(
|
921
|
+
config.headers.common || {},
|
922
|
+
config.headers[config.method] || {},
|
923
|
+
config.headers
|
924
|
+
);
|
925
|
+
|
926
|
+
utils.forEach(
|
927
|
+
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
928
|
+
function cleanHeaderConfig(method) {
|
929
|
+
delete config.headers[method];
|
930
|
+
}
|
931
|
+
);
|
932
|
+
|
933
|
+
var adapter = config.adapter || defaults.adapter;
|
934
|
+
|
935
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
936
|
+
throwIfCancellationRequested(config);
|
937
|
+
|
938
|
+
// Transform response data
|
939
|
+
response.data = transformData.call(
|
940
|
+
config,
|
941
|
+
response.data,
|
942
|
+
response.headers,
|
943
|
+
config.transformResponse
|
944
|
+
);
|
945
|
+
|
946
|
+
return response;
|
947
|
+
}, function onAdapterRejection(reason) {
|
948
|
+
if (!isCancel(reason)) {
|
949
|
+
throwIfCancellationRequested(config);
|
950
|
+
|
951
|
+
// Transform response data
|
952
|
+
if (reason && reason.response) {
|
953
|
+
reason.response.data = transformData.call(
|
954
|
+
config,
|
955
|
+
reason.response.data,
|
956
|
+
reason.response.headers,
|
957
|
+
config.transformResponse
|
958
|
+
);
|
959
|
+
}
|
960
|
+
}
|
961
|
+
|
962
|
+
return Promise.reject(reason);
|
963
|
+
});
|
964
|
+
};
|
851
965
|
|
852
966
|
|
853
967
|
/***/ }),
|
854
|
-
|
968
|
+
|
969
|
+
/***/ "./lib/core/enhanceError.js":
|
970
|
+
/*!**********************************!*\
|
971
|
+
!*** ./lib/core/enhanceError.js ***!
|
972
|
+
\**********************************/
|
973
|
+
/*! no static exports found */
|
855
974
|
/***/ (function(module, exports, __webpack_require__) {
|
856
975
|
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
}
|
902
|
-
if (utils.isURLSearchParams(data)) {
|
903
|
-
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
904
|
-
return data.toString();
|
905
|
-
}
|
906
|
-
if (utils.isObject(data)) {
|
907
|
-
setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
|
908
|
-
return JSON.stringify(data);
|
909
|
-
}
|
910
|
-
return data;
|
911
|
-
}],
|
912
|
-
|
913
|
-
transformResponse: [function transformResponse(data) {
|
914
|
-
/*eslint no-param-reassign:0*/
|
915
|
-
if (typeof data === 'string') {
|
916
|
-
try {
|
917
|
-
data = JSON.parse(data);
|
918
|
-
} catch (e) { /* Ignore */ }
|
919
|
-
}
|
920
|
-
return data;
|
921
|
-
}],
|
922
|
-
|
923
|
-
/**
|
924
|
-
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
925
|
-
* timeout is not created.
|
926
|
-
*/
|
927
|
-
timeout: 0,
|
928
|
-
|
929
|
-
xsrfCookieName: 'XSRF-TOKEN',
|
930
|
-
xsrfHeaderName: 'X-XSRF-TOKEN',
|
931
|
-
|
932
|
-
maxContentLength: -1,
|
933
|
-
maxBodyLength: -1,
|
934
|
-
|
935
|
-
validateStatus: function validateStatus(status) {
|
936
|
-
return status >= 200 && status < 300;
|
937
|
-
}
|
938
|
-
};
|
939
|
-
|
940
|
-
defaults.headers = {
|
941
|
-
common: {
|
942
|
-
'Accept': 'application/json, text/plain, */*'
|
943
|
-
}
|
944
|
-
};
|
945
|
-
|
946
|
-
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
947
|
-
defaults.headers[method] = {};
|
948
|
-
});
|
949
|
-
|
950
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
951
|
-
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
952
|
-
});
|
953
|
-
|
954
|
-
module.exports = defaults;
|
976
|
+
"use strict";
|
977
|
+
|
978
|
+
|
979
|
+
/**
|
980
|
+
* Update an Error with the specified config, error code, and response.
|
981
|
+
*
|
982
|
+
* @param {Error} error The error to update.
|
983
|
+
* @param {Object} config The config.
|
984
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
985
|
+
* @param {Object} [request] The request.
|
986
|
+
* @param {Object} [response] The response.
|
987
|
+
* @returns {Error} The error.
|
988
|
+
*/
|
989
|
+
module.exports = function enhanceError(error, config, code, request, response) {
|
990
|
+
error.config = config;
|
991
|
+
if (code) {
|
992
|
+
error.code = code;
|
993
|
+
}
|
994
|
+
|
995
|
+
error.request = request;
|
996
|
+
error.response = response;
|
997
|
+
error.isAxiosError = true;
|
998
|
+
|
999
|
+
error.toJSON = function toJSON() {
|
1000
|
+
return {
|
1001
|
+
// Standard
|
1002
|
+
message: this.message,
|
1003
|
+
name: this.name,
|
1004
|
+
// Microsoft
|
1005
|
+
description: this.description,
|
1006
|
+
number: this.number,
|
1007
|
+
// Mozilla
|
1008
|
+
fileName: this.fileName,
|
1009
|
+
lineNumber: this.lineNumber,
|
1010
|
+
columnNumber: this.columnNumber,
|
1011
|
+
stack: this.stack,
|
1012
|
+
// Axios
|
1013
|
+
config: this.config,
|
1014
|
+
code: this.code,
|
1015
|
+
status: this.response && this.response.status ? this.response.status : null
|
1016
|
+
};
|
1017
|
+
};
|
1018
|
+
return error;
|
1019
|
+
};
|
955
1020
|
|
956
1021
|
|
957
1022
|
/***/ }),
|
958
|
-
|
1023
|
+
|
1024
|
+
/***/ "./lib/core/mergeConfig.js":
|
1025
|
+
/*!*********************************!*\
|
1026
|
+
!*** ./lib/core/mergeConfig.js ***!
|
1027
|
+
\*********************************/
|
1028
|
+
/*! no static exports found */
|
959
1029
|
/***/ (function(module, exports, __webpack_require__) {
|
960
1030
|
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
1031
|
+
"use strict";
|
1032
|
+
|
1033
|
+
|
1034
|
+
var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");
|
1035
|
+
|
1036
|
+
/**
|
1037
|
+
* Config-specific merge-function which creates a new config-object
|
1038
|
+
* by merging two configuration objects together.
|
1039
|
+
*
|
1040
|
+
* @param {Object} config1
|
1041
|
+
* @param {Object} config2
|
1042
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
1043
|
+
*/
|
1044
|
+
module.exports = function mergeConfig(config1, config2) {
|
1045
|
+
// eslint-disable-next-line no-param-reassign
|
1046
|
+
config2 = config2 || {};
|
1047
|
+
var config = {};
|
1048
|
+
|
1049
|
+
function getMergedValue(target, source) {
|
1050
|
+
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
1051
|
+
return utils.merge(target, source);
|
1052
|
+
} else if (utils.isPlainObject(source)) {
|
1053
|
+
return utils.merge({}, source);
|
1054
|
+
} else if (utils.isArray(source)) {
|
1055
|
+
return source.slice();
|
1056
|
+
}
|
1057
|
+
return source;
|
1058
|
+
}
|
1059
|
+
|
1060
|
+
// eslint-disable-next-line consistent-return
|
1061
|
+
function mergeDeepProperties(prop) {
|
1062
|
+
if (!utils.isUndefined(config2[prop])) {
|
1063
|
+
return getMergedValue(config1[prop], config2[prop]);
|
1064
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
1065
|
+
return getMergedValue(undefined, config1[prop]);
|
1066
|
+
}
|
1067
|
+
}
|
1068
|
+
|
1069
|
+
// eslint-disable-next-line consistent-return
|
1070
|
+
function valueFromConfig2(prop) {
|
1071
|
+
if (!utils.isUndefined(config2[prop])) {
|
1072
|
+
return getMergedValue(undefined, config2[prop]);
|
1073
|
+
}
|
1074
|
+
}
|
1075
|
+
|
1076
|
+
// eslint-disable-next-line consistent-return
|
1077
|
+
function defaultToConfig2(prop) {
|
1078
|
+
if (!utils.isUndefined(config2[prop])) {
|
1079
|
+
return getMergedValue(undefined, config2[prop]);
|
1080
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
1081
|
+
return getMergedValue(undefined, config1[prop]);
|
1082
|
+
}
|
1083
|
+
}
|
1084
|
+
|
1085
|
+
// eslint-disable-next-line consistent-return
|
1086
|
+
function mergeDirectKeys(prop) {
|
1087
|
+
if (prop in config2) {
|
1088
|
+
return getMergedValue(config1[prop], config2[prop]);
|
1089
|
+
} else if (prop in config1) {
|
1090
|
+
return getMergedValue(undefined, config1[prop]);
|
1091
|
+
}
|
1092
|
+
}
|
1093
|
+
|
1094
|
+
var mergeMap = {
|
1095
|
+
'url': valueFromConfig2,
|
1096
|
+
'method': valueFromConfig2,
|
1097
|
+
'data': valueFromConfig2,
|
1098
|
+
'baseURL': defaultToConfig2,
|
1099
|
+
'transformRequest': defaultToConfig2,
|
1100
|
+
'transformResponse': defaultToConfig2,
|
1101
|
+
'paramsSerializer': defaultToConfig2,
|
1102
|
+
'timeout': defaultToConfig2,
|
1103
|
+
'timeoutMessage': defaultToConfig2,
|
1104
|
+
'withCredentials': defaultToConfig2,
|
1105
|
+
'adapter': defaultToConfig2,
|
1106
|
+
'responseType': defaultToConfig2,
|
1107
|
+
'xsrfCookieName': defaultToConfig2,
|
1108
|
+
'xsrfHeaderName': defaultToConfig2,
|
1109
|
+
'onUploadProgress': defaultToConfig2,
|
1110
|
+
'onDownloadProgress': defaultToConfig2,
|
1111
|
+
'decompress': defaultToConfig2,
|
1112
|
+
'maxContentLength': defaultToConfig2,
|
1113
|
+
'maxBodyLength': defaultToConfig2,
|
1114
|
+
'transport': defaultToConfig2,
|
1115
|
+
'httpAgent': defaultToConfig2,
|
1116
|
+
'httpsAgent': defaultToConfig2,
|
1117
|
+
'cancelToken': defaultToConfig2,
|
1118
|
+
'socketPath': defaultToConfig2,
|
1119
|
+
'responseEncoding': defaultToConfig2,
|
1120
|
+
'validateStatus': mergeDirectKeys
|
1121
|
+
};
|
1122
|
+
|
1123
|
+
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
1124
|
+
var merge = mergeMap[prop] || mergeDeepProperties;
|
1125
|
+
var configValue = merge(prop);
|
1126
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
1127
|
+
});
|
1128
|
+
|
1129
|
+
return config;
|
1130
|
+
};
|
973
1131
|
|
974
1132
|
|
975
1133
|
/***/ }),
|
976
|
-
|
1134
|
+
|
1135
|
+
/***/ "./lib/core/settle.js":
|
1136
|
+
/*!****************************!*\
|
1137
|
+
!*** ./lib/core/settle.js ***!
|
1138
|
+
\****************************/
|
1139
|
+
/*! no static exports found */
|
977
1140
|
/***/ (function(module, exports, __webpack_require__) {
|
978
1141
|
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
1006
|
-
}
|
1007
|
-
|
1008
|
-
var fullPath = buildFullPath(config.baseURL, config.url);
|
1009
|
-
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
1010
|
-
|
1011
|
-
// Set the request timeout in MS
|
1012
|
-
request.timeout = config.timeout;
|
1013
|
-
|
1014
|
-
// Listen for ready state
|
1015
|
-
request.onreadystatechange = function handleLoad() {
|
1016
|
-
if (!request || request.readyState !== 4) {
|
1017
|
-
return;
|
1018
|
-
}
|
1019
|
-
|
1020
|
-
// The request errored out and we didn't get a response, this will be
|
1021
|
-
// handled by onerror instead
|
1022
|
-
// With one exception: request that using file: protocol, most browsers
|
1023
|
-
// will return status as 0 even though it's a successful request
|
1024
|
-
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
1025
|
-
return;
|
1026
|
-
}
|
1027
|
-
|
1028
|
-
// Prepare the response
|
1029
|
-
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
1030
|
-
var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
|
1031
|
-
var response = {
|
1032
|
-
data: responseData,
|
1033
|
-
status: request.status,
|
1034
|
-
statusText: request.statusText,
|
1035
|
-
headers: responseHeaders,
|
1036
|
-
config: config,
|
1037
|
-
request: request
|
1038
|
-
};
|
1039
|
-
|
1040
|
-
settle(resolve, reject, response);
|
1041
|
-
|
1042
|
-
// Clean up request
|
1043
|
-
request = null;
|
1044
|
-
};
|
1045
|
-
|
1046
|
-
// Handle browser request cancellation (as opposed to a manual cancellation)
|
1047
|
-
request.onabort = function handleAbort() {
|
1048
|
-
if (!request) {
|
1049
|
-
return;
|
1050
|
-
}
|
1051
|
-
|
1052
|
-
reject(createError('Request aborted', config, 'ECONNABORTED', request));
|
1053
|
-
|
1054
|
-
// Clean up request
|
1055
|
-
request = null;
|
1056
|
-
};
|
1057
|
-
|
1058
|
-
// Handle low level network errors
|
1059
|
-
request.onerror = function handleError() {
|
1060
|
-
// Real errors are hidden from us by the browser
|
1061
|
-
// onerror should only fire if it's a network error
|
1062
|
-
reject(createError('Network Error', config, null, request));
|
1063
|
-
|
1064
|
-
// Clean up request
|
1065
|
-
request = null;
|
1066
|
-
};
|
1067
|
-
|
1068
|
-
// Handle timeout
|
1069
|
-
request.ontimeout = function handleTimeout() {
|
1070
|
-
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
|
1071
|
-
if (config.timeoutErrorMessage) {
|
1072
|
-
timeoutErrorMessage = config.timeoutErrorMessage;
|
1073
|
-
}
|
1074
|
-
reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
|
1075
|
-
request));
|
1076
|
-
|
1077
|
-
// Clean up request
|
1078
|
-
request = null;
|
1079
|
-
};
|
1080
|
-
|
1081
|
-
// Add xsrf header
|
1082
|
-
// This is only done if running in a standard browser environment.
|
1083
|
-
// Specifically not if we're in a web worker, or react-native.
|
1084
|
-
if (utils.isStandardBrowserEnv()) {
|
1085
|
-
// Add xsrf header
|
1086
|
-
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
1087
|
-
cookies.read(config.xsrfCookieName) :
|
1088
|
-
undefined;
|
1089
|
-
|
1090
|
-
if (xsrfValue) {
|
1091
|
-
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
1092
|
-
}
|
1093
|
-
}
|
1094
|
-
|
1095
|
-
// Add headers to the request
|
1096
|
-
if ('setRequestHeader' in request) {
|
1097
|
-
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
1098
|
-
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
1099
|
-
// Remove Content-Type if data is undefined
|
1100
|
-
delete requestHeaders[key];
|
1101
|
-
} else {
|
1102
|
-
// Otherwise add header to the request
|
1103
|
-
request.setRequestHeader(key, val);
|
1104
|
-
}
|
1105
|
-
});
|
1106
|
-
}
|
1107
|
-
|
1108
|
-
// Add withCredentials to request if needed
|
1109
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
1110
|
-
request.withCredentials = !!config.withCredentials;
|
1111
|
-
}
|
1112
|
-
|
1113
|
-
// Add responseType to request if needed
|
1114
|
-
if (config.responseType) {
|
1115
|
-
try {
|
1116
|
-
request.responseType = config.responseType;
|
1117
|
-
} catch (e) {
|
1118
|
-
// Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
|
1119
|
-
// But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
|
1120
|
-
if (config.responseType !== 'json') {
|
1121
|
-
throw e;
|
1122
|
-
}
|
1123
|
-
}
|
1124
|
-
}
|
1125
|
-
|
1126
|
-
// Handle progress if needed
|
1127
|
-
if (typeof config.onDownloadProgress === 'function') {
|
1128
|
-
request.addEventListener('progress', config.onDownloadProgress);
|
1129
|
-
}
|
1130
|
-
|
1131
|
-
// Not all browsers support upload events
|
1132
|
-
if (typeof config.onUploadProgress === 'function' && request.upload) {
|
1133
|
-
request.upload.addEventListener('progress', config.onUploadProgress);
|
1134
|
-
}
|
1135
|
-
|
1136
|
-
if (config.cancelToken) {
|
1137
|
-
// Handle cancellation
|
1138
|
-
config.cancelToken.promise.then(function onCanceled(cancel) {
|
1139
|
-
if (!request) {
|
1140
|
-
return;
|
1141
|
-
}
|
1142
|
-
|
1143
|
-
request.abort();
|
1144
|
-
reject(cancel);
|
1145
|
-
// Clean up request
|
1146
|
-
request = null;
|
1147
|
-
});
|
1148
|
-
}
|
1149
|
-
|
1150
|
-
if (!requestData) {
|
1151
|
-
requestData = null;
|
1152
|
-
}
|
1153
|
-
|
1154
|
-
// Send the request
|
1155
|
-
request.send(requestData);
|
1156
|
-
});
|
1157
|
-
};
|
1142
|
+
"use strict";
|
1143
|
+
|
1144
|
+
|
1145
|
+
var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js");
|
1146
|
+
|
1147
|
+
/**
|
1148
|
+
* Resolve or reject a Promise based on response status.
|
1149
|
+
*
|
1150
|
+
* @param {Function} resolve A function that resolves the promise.
|
1151
|
+
* @param {Function} reject A function that rejects the promise.
|
1152
|
+
* @param {object} response The response.
|
1153
|
+
*/
|
1154
|
+
module.exports = function settle(resolve, reject, response) {
|
1155
|
+
var validateStatus = response.config.validateStatus;
|
1156
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
1157
|
+
resolve(response);
|
1158
|
+
} else {
|
1159
|
+
reject(createError(
|
1160
|
+
'Request failed with status code ' + response.status,
|
1161
|
+
response.config,
|
1162
|
+
null,
|
1163
|
+
response.request,
|
1164
|
+
response
|
1165
|
+
));
|
1166
|
+
}
|
1167
|
+
};
|
1158
1168
|
|
1159
1169
|
|
1160
1170
|
/***/ }),
|
1161
|
-
|
1171
|
+
|
1172
|
+
/***/ "./lib/core/transformData.js":
|
1173
|
+
/*!***********************************!*\
|
1174
|
+
!*** ./lib/core/transformData.js ***!
|
1175
|
+
\***********************************/
|
1176
|
+
/*! no static exports found */
|
1162
1177
|
/***/ (function(module, exports, __webpack_require__) {
|
1163
1178
|
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
}
|
1188
|
-
};
|
1179
|
+
"use strict";
|
1180
|
+
|
1181
|
+
|
1182
|
+
var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
|
1183
|
+
var defaults = __webpack_require__(/*! ./../defaults */ "./lib/defaults.js");
|
1184
|
+
|
1185
|
+
/**
|
1186
|
+
* Transform the data for a request or a response
|
1187
|
+
*
|
1188
|
+
* @param {Object|String} data The data to be transformed
|
1189
|
+
* @param {Array} headers The headers for the request or response
|
1190
|
+
* @param {Array|Function} fns A single function or Array of functions
|
1191
|
+
* @returns {*} The resulting transformed data
|
1192
|
+
*/
|
1193
|
+
module.exports = function transformData(data, headers, fns) {
|
1194
|
+
var context = this || defaults;
|
1195
|
+
/*eslint no-param-reassign:0*/
|
1196
|
+
utils.forEach(fns, function transform(fn) {
|
1197
|
+
data = fn.call(context, data, headers);
|
1198
|
+
});
|
1199
|
+
|
1200
|
+
return data;
|
1201
|
+
};
|
1189
1202
|
|
1190
1203
|
|
1191
1204
|
/***/ }),
|
1192
|
-
|
1205
|
+
|
1206
|
+
/***/ "./lib/defaults.js":
|
1207
|
+
/*!*************************!*\
|
1208
|
+
!*** ./lib/defaults.js ***!
|
1209
|
+
\*************************/
|
1210
|
+
/*! no static exports found */
|
1193
1211
|
/***/ (function(module, exports, __webpack_require__) {
|
1194
1212
|
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
+
"use strict";
|
1214
|
+
|
1215
|
+
|
1216
|
+
var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js");
|
1217
|
+
var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js");
|
1218
|
+
var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./lib/core/enhanceError.js");
|
1219
|
+
|
1220
|
+
var DEFAULT_CONTENT_TYPE = {
|
1221
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
1222
|
+
};
|
1223
|
+
|
1224
|
+
function setContentTypeIfUnset(headers, value) {
|
1225
|
+
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
|
1226
|
+
headers['Content-Type'] = value;
|
1227
|
+
}
|
1228
|
+
}
|
1229
|
+
|
1230
|
+
function getDefaultAdapter() {
|
1231
|
+
var adapter;
|
1232
|
+
if (typeof XMLHttpRequest !== 'undefined') {
|
1233
|
+
// For browsers use XHR adapter
|
1234
|
+
adapter = __webpack_require__(/*! ./adapters/xhr */ "./lib/adapters/xhr.js");
|
1235
|
+
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
1236
|
+
// For node use HTTP adapter
|
1237
|
+
adapter = __webpack_require__(/*! ./adapters/http */ "./lib/adapters/xhr.js");
|
1238
|
+
}
|
1239
|
+
return adapter;
|
1240
|
+
}
|
1241
|
+
|
1242
|
+
function stringifySafely(rawValue, parser, encoder) {
|
1243
|
+
if (utils.isString(rawValue)) {
|
1244
|
+
try {
|
1245
|
+
(parser || JSON.parse)(rawValue);
|
1246
|
+
return utils.trim(rawValue);
|
1247
|
+
} catch (e) {
|
1248
|
+
if (e.name !== 'SyntaxError') {
|
1249
|
+
throw e;
|
1250
|
+
}
|
1251
|
+
}
|
1252
|
+
}
|
1253
|
+
|
1254
|
+
return (encoder || JSON.stringify)(rawValue);
|
1255
|
+
}
|
1256
|
+
|
1257
|
+
var defaults = {
|
1258
|
+
|
1259
|
+
transitional: {
|
1260
|
+
silentJSONParsing: true,
|
1261
|
+
forcedJSONParsing: true,
|
1262
|
+
clarifyTimeoutError: false
|
1263
|
+
},
|
1264
|
+
|
1265
|
+
adapter: getDefaultAdapter(),
|
1266
|
+
|
1267
|
+
transformRequest: [function transformRequest(data, headers) {
|
1268
|
+
normalizeHeaderName(headers, 'Accept');
|
1269
|
+
normalizeHeaderName(headers, 'Content-Type');
|
1270
|
+
|
1271
|
+
if (utils.isFormData(data) ||
|
1272
|
+
utils.isArrayBuffer(data) ||
|
1273
|
+
utils.isBuffer(data) ||
|
1274
|
+
utils.isStream(data) ||
|
1275
|
+
utils.isFile(data) ||
|
1276
|
+
utils.isBlob(data)
|
1277
|
+
) {
|
1278
|
+
return data;
|
1279
|
+
}
|
1280
|
+
if (utils.isArrayBufferView(data)) {
|
1281
|
+
return data.buffer;
|
1282
|
+
}
|
1283
|
+
if (utils.isURLSearchParams(data)) {
|
1284
|
+
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
1285
|
+
return data.toString();
|
1286
|
+
}
|
1287
|
+
if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
|
1288
|
+
setContentTypeIfUnset(headers, 'application/json');
|
1289
|
+
return stringifySafely(data);
|
1290
|
+
}
|
1291
|
+
return data;
|
1292
|
+
}],
|
1293
|
+
|
1294
|
+
transformResponse: [function transformResponse(data) {
|
1295
|
+
var transitional = this.transitional || defaults.transitional;
|
1296
|
+
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
1297
|
+
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
1298
|
+
var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
|
1299
|
+
|
1300
|
+
if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
|
1301
|
+
try {
|
1302
|
+
return JSON.parse(data);
|
1303
|
+
} catch (e) {
|
1304
|
+
if (strictJSONParsing) {
|
1305
|
+
if (e.name === 'SyntaxError') {
|
1306
|
+
throw enhanceError(e, this, 'E_JSON_PARSE');
|
1307
|
+
}
|
1308
|
+
throw e;
|
1309
|
+
}
|
1310
|
+
}
|
1311
|
+
}
|
1312
|
+
|
1313
|
+
return data;
|
1314
|
+
}],
|
1315
|
+
|
1316
|
+
/**
|
1317
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
1318
|
+
* timeout is not created.
|
1319
|
+
*/
|
1320
|
+
timeout: 0,
|
1321
|
+
|
1322
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
1323
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
1324
|
+
|
1325
|
+
maxContentLength: -1,
|
1326
|
+
maxBodyLength: -1,
|
1327
|
+
|
1328
|
+
validateStatus: function validateStatus(status) {
|
1329
|
+
return status >= 200 && status < 300;
|
1330
|
+
},
|
1331
|
+
|
1332
|
+
headers: {
|
1333
|
+
common: {
|
1334
|
+
'Accept': 'application/json, text/plain, */*'
|
1335
|
+
}
|
1336
|
+
}
|
1337
|
+
};
|
1338
|
+
|
1339
|
+
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
1340
|
+
defaults.headers[method] = {};
|
1341
|
+
});
|
1342
|
+
|
1343
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
1344
|
+
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
1345
|
+
});
|
1346
|
+
|
1347
|
+
module.exports = defaults;
|
1213
1348
|
|
1214
1349
|
|
1215
1350
|
/***/ }),
|
1216
|
-
|
1351
|
+
|
1352
|
+
/***/ "./lib/env/data.js":
|
1353
|
+
/*!*************************!*\
|
1354
|
+
!*** ./lib/env/data.js ***!
|
1355
|
+
\*************************/
|
1356
|
+
/*! no static exports found */
|
1217
1357
|
/***/ (function(module, exports) {
|
1218
1358
|
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
message: this.message,
|
1245
|
-
name: this.name,
|
1246
|
-
// Microsoft
|
1247
|
-
description: this.description,
|
1248
|
-
number: this.number,
|
1249
|
-
// Mozilla
|
1250
|
-
fileName: this.fileName,
|
1251
|
-
lineNumber: this.lineNumber,
|
1252
|
-
columnNumber: this.columnNumber,
|
1253
|
-
stack: this.stack,
|
1254
|
-
// Axios
|
1255
|
-
config: this.config,
|
1256
|
-
code: this.code
|
1257
|
-
};
|
1258
|
-
};
|
1259
|
-
return error;
|
1260
|
-
};
|
1359
|
+
module.exports = {
|
1360
|
+
"version": "0.22.0"
|
1361
|
+
};
|
1362
|
+
|
1363
|
+
/***/ }),
|
1364
|
+
|
1365
|
+
/***/ "./lib/helpers/bind.js":
|
1366
|
+
/*!*****************************!*\
|
1367
|
+
!*** ./lib/helpers/bind.js ***!
|
1368
|
+
\*****************************/
|
1369
|
+
/*! no static exports found */
|
1370
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1371
|
+
|
1372
|
+
"use strict";
|
1373
|
+
|
1374
|
+
|
1375
|
+
module.exports = function bind(fn, thisArg) {
|
1376
|
+
return function wrap() {
|
1377
|
+
var args = new Array(arguments.length);
|
1378
|
+
for (var i = 0; i < args.length; i++) {
|
1379
|
+
args[i] = arguments[i];
|
1380
|
+
}
|
1381
|
+
return fn.apply(thisArg, args);
|
1382
|
+
};
|
1383
|
+
};
|
1261
1384
|
|
1262
1385
|
|
1263
1386
|
/***/ }),
|
1264
|
-
|
1387
|
+
|
1388
|
+
/***/ "./lib/helpers/buildURL.js":
|
1389
|
+
/*!*********************************!*\
|
1390
|
+
!*** ./lib/helpers/buildURL.js ***!
|
1391
|
+
\*********************************/
|
1392
|
+
/*! no static exports found */
|
1265
1393
|
/***/ (function(module, exports, __webpack_require__) {
|
1266
1394
|
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1395
|
+
"use strict";
|
1396
|
+
|
1397
|
+
|
1398
|
+
var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
|
1399
|
+
|
1400
|
+
function encode(val) {
|
1401
|
+
return encodeURIComponent(val).
|
1402
|
+
replace(/%3A/gi, ':').
|
1403
|
+
replace(/%24/g, '$').
|
1404
|
+
replace(/%2C/gi, ',').
|
1405
|
+
replace(/%20/g, '+').
|
1406
|
+
replace(/%5B/gi, '[').
|
1407
|
+
replace(/%5D/gi, ']');
|
1408
|
+
}
|
1409
|
+
|
1410
|
+
/**
|
1411
|
+
* Build a URL by appending params to the end
|
1412
|
+
*
|
1413
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
1414
|
+
* @param {object} [params] The params to be appended
|
1415
|
+
* @returns {string} The formatted url
|
1416
|
+
*/
|
1417
|
+
module.exports = function buildURL(url, params, paramsSerializer) {
|
1418
|
+
/*eslint no-param-reassign:0*/
|
1419
|
+
if (!params) {
|
1420
|
+
return url;
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
var serializedParams;
|
1424
|
+
if (paramsSerializer) {
|
1425
|
+
serializedParams = paramsSerializer(params);
|
1426
|
+
} else if (utils.isURLSearchParams(params)) {
|
1427
|
+
serializedParams = params.toString();
|
1428
|
+
} else {
|
1429
|
+
var parts = [];
|
1430
|
+
|
1431
|
+
utils.forEach(params, function serialize(val, key) {
|
1432
|
+
if (val === null || typeof val === 'undefined') {
|
1433
|
+
return;
|
1434
|
+
}
|
1435
|
+
|
1436
|
+
if (utils.isArray(val)) {
|
1437
|
+
key = key + '[]';
|
1438
|
+
} else {
|
1439
|
+
val = [val];
|
1440
|
+
}
|
1441
|
+
|
1442
|
+
utils.forEach(val, function parseValue(v) {
|
1443
|
+
if (utils.isDate(v)) {
|
1444
|
+
v = v.toISOString();
|
1445
|
+
} else if (utils.isObject(v)) {
|
1446
|
+
v = JSON.stringify(v);
|
1447
|
+
}
|
1448
|
+
parts.push(encode(key) + '=' + encode(v));
|
1449
|
+
});
|
1450
|
+
});
|
1451
|
+
|
1452
|
+
serializedParams = parts.join('&');
|
1453
|
+
}
|
1454
|
+
|
1455
|
+
if (serializedParams) {
|
1456
|
+
var hashmarkIndex = url.indexOf('#');
|
1457
|
+
if (hashmarkIndex !== -1) {
|
1458
|
+
url = url.slice(0, hashmarkIndex);
|
1459
|
+
}
|
1460
|
+
|
1461
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
1462
|
+
}
|
1463
|
+
|
1464
|
+
return url;
|
1465
|
+
};
|
1320
1466
|
|
1321
1467
|
|
1322
1468
|
/***/ }),
|
1323
|
-
|
1469
|
+
|
1470
|
+
/***/ "./lib/helpers/combineURLs.js":
|
1471
|
+
/*!************************************!*\
|
1472
|
+
!*** ./lib/helpers/combineURLs.js ***!
|
1473
|
+
\************************************/
|
1474
|
+
/*! no static exports found */
|
1324
1475
|
/***/ (function(module, exports, __webpack_require__) {
|
1325
1476
|
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
1342
|
-
return combineURLs(baseURL, requestedURL);
|
1343
|
-
}
|
1344
|
-
return requestedURL;
|
1345
|
-
};
|
1477
|
+
"use strict";
|
1478
|
+
|
1479
|
+
|
1480
|
+
/**
|
1481
|
+
* Creates a new URL by combining the specified URLs
|
1482
|
+
*
|
1483
|
+
* @param {string} baseURL The base URL
|
1484
|
+
* @param {string} relativeURL The relative URL
|
1485
|
+
* @returns {string} The combined URL
|
1486
|
+
*/
|
1487
|
+
module.exports = function combineURLs(baseURL, relativeURL) {
|
1488
|
+
return relativeURL
|
1489
|
+
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
1490
|
+
: baseURL;
|
1491
|
+
};
|
1346
1492
|
|
1347
1493
|
|
1348
1494
|
/***/ }),
|
1349
|
-
/* 18 */
|
1350
|
-
/***/ (function(module, exports) {
|
1351
1495
|
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1496
|
+
/***/ "./lib/helpers/cookies.js":
|
1497
|
+
/*!********************************!*\
|
1498
|
+
!*** ./lib/helpers/cookies.js ***!
|
1499
|
+
\********************************/
|
1500
|
+
/*! no static exports found */
|
1501
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1502
|
+
|
1503
|
+
"use strict";
|
1504
|
+
|
1505
|
+
|
1506
|
+
var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
|
1507
|
+
|
1508
|
+
module.exports = (
|
1509
|
+
utils.isStandardBrowserEnv() ?
|
1510
|
+
|
1511
|
+
// Standard browser envs support document.cookie
|
1512
|
+
(function standardBrowserEnv() {
|
1513
|
+
return {
|
1514
|
+
write: function write(name, value, expires, path, domain, secure) {
|
1515
|
+
var cookie = [];
|
1516
|
+
cookie.push(name + '=' + encodeURIComponent(value));
|
1517
|
+
|
1518
|
+
if (utils.isNumber(expires)) {
|
1519
|
+
cookie.push('expires=' + new Date(expires).toGMTString());
|
1520
|
+
}
|
1521
|
+
|
1522
|
+
if (utils.isString(path)) {
|
1523
|
+
cookie.push('path=' + path);
|
1524
|
+
}
|
1525
|
+
|
1526
|
+
if (utils.isString(domain)) {
|
1527
|
+
cookie.push('domain=' + domain);
|
1528
|
+
}
|
1529
|
+
|
1530
|
+
if (secure === true) {
|
1531
|
+
cookie.push('secure');
|
1532
|
+
}
|
1533
|
+
|
1534
|
+
document.cookie = cookie.join('; ');
|
1535
|
+
},
|
1536
|
+
|
1537
|
+
read: function read(name) {
|
1538
|
+
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
1539
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
1540
|
+
},
|
1541
|
+
|
1542
|
+
remove: function remove(name) {
|
1543
|
+
this.write(name, '', Date.now() - 86400000);
|
1544
|
+
}
|
1545
|
+
};
|
1546
|
+
})() :
|
1547
|
+
|
1548
|
+
// Non standard browser env (web workers, react-native) lack needed support.
|
1549
|
+
(function nonStandardBrowserEnv() {
|
1550
|
+
return {
|
1551
|
+
write: function write() {},
|
1552
|
+
read: function read() { return null; },
|
1553
|
+
remove: function remove() {}
|
1554
|
+
};
|
1555
|
+
})()
|
1556
|
+
);
|
1366
1557
|
|
1367
1558
|
|
1368
1559
|
/***/ }),
|
1369
|
-
/* 19 */
|
1370
|
-
/***/ (function(module, exports) {
|
1371
1560
|
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1561
|
+
/***/ "./lib/helpers/isAbsoluteURL.js":
|
1562
|
+
/*!**************************************!*\
|
1563
|
+
!*** ./lib/helpers/isAbsoluteURL.js ***!
|
1564
|
+
\**************************************/
|
1565
|
+
/*! no static exports found */
|
1566
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1567
|
+
|
1568
|
+
"use strict";
|
1569
|
+
|
1570
|
+
|
1571
|
+
/**
|
1572
|
+
* Determines whether the specified URL is absolute
|
1573
|
+
*
|
1574
|
+
* @param {string} url The URL to test
|
1575
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
1576
|
+
*/
|
1577
|
+
module.exports = function isAbsoluteURL(url) {
|
1578
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
1579
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
1580
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
1581
|
+
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
1582
|
+
};
|
1386
1583
|
|
1387
1584
|
|
1388
1585
|
/***/ }),
|
1389
|
-
|
1586
|
+
|
1587
|
+
/***/ "./lib/helpers/isAxiosError.js":
|
1588
|
+
/*!*************************************!*\
|
1589
|
+
!*** ./lib/helpers/isAxiosError.js ***!
|
1590
|
+
\*************************************/
|
1591
|
+
/*! no static exports found */
|
1390
1592
|
/***/ (function(module, exports, __webpack_require__) {
|
1391
1593
|
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
/**
|
1406
|
-
* Parse headers into an object
|
1407
|
-
*
|
1408
|
-
* ```
|
1409
|
-
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
1410
|
-
* Content-Type: application/json
|
1411
|
-
* Connection: keep-alive
|
1412
|
-
* Transfer-Encoding: chunked
|
1413
|
-
* ```
|
1414
|
-
*
|
1415
|
-
* @param {String} headers Headers needing to be parsed
|
1416
|
-
* @returns {Object} Headers parsed into an object
|
1417
|
-
*/
|
1418
|
-
module.exports = function parseHeaders(headers) {
|
1419
|
-
var parsed = {};
|
1420
|
-
var key;
|
1421
|
-
var val;
|
1422
|
-
var i;
|
1423
|
-
|
1424
|
-
if (!headers) { return parsed; }
|
1425
|
-
|
1426
|
-
utils.forEach(headers.split('\n'), function parser(line) {
|
1427
|
-
i = line.indexOf(':');
|
1428
|
-
key = utils.trim(line.substr(0, i)).toLowerCase();
|
1429
|
-
val = utils.trim(line.substr(i + 1));
|
1430
|
-
|
1431
|
-
if (key) {
|
1432
|
-
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
1433
|
-
return;
|
1434
|
-
}
|
1435
|
-
if (key === 'set-cookie') {
|
1436
|
-
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
1437
|
-
} else {
|
1438
|
-
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
1439
|
-
}
|
1440
|
-
}
|
1441
|
-
});
|
1442
|
-
|
1443
|
-
return parsed;
|
1444
|
-
};
|
1594
|
+
"use strict";
|
1595
|
+
|
1596
|
+
|
1597
|
+
/**
|
1598
|
+
* Determines whether the payload is an error thrown by Axios
|
1599
|
+
*
|
1600
|
+
* @param {*} payload The value to test
|
1601
|
+
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
1602
|
+
*/
|
1603
|
+
module.exports = function isAxiosError(payload) {
|
1604
|
+
return (typeof payload === 'object') && (payload.isAxiosError === true);
|
1605
|
+
};
|
1445
1606
|
|
1446
1607
|
|
1447
1608
|
/***/ }),
|
1448
|
-
|
1609
|
+
|
1610
|
+
/***/ "./lib/helpers/isURLSameOrigin.js":
|
1611
|
+
/*!****************************************!*\
|
1612
|
+
!*** ./lib/helpers/isURLSameOrigin.js ***!
|
1613
|
+
\****************************************/
|
1614
|
+
/*! no static exports found */
|
1449
1615
|
/***/ (function(module, exports, __webpack_require__) {
|
1450
1616
|
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1617
|
+
"use strict";
|
1618
|
+
|
1619
|
+
|
1620
|
+
var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
|
1621
|
+
|
1622
|
+
module.exports = (
|
1623
|
+
utils.isStandardBrowserEnv() ?
|
1624
|
+
|
1625
|
+
// Standard browser envs have full support of the APIs needed to test
|
1626
|
+
// whether the request URL is of the same origin as current location.
|
1627
|
+
(function standardBrowserEnv() {
|
1628
|
+
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
1629
|
+
var urlParsingNode = document.createElement('a');
|
1630
|
+
var originURL;
|
1631
|
+
|
1632
|
+
/**
|
1633
|
+
* Parse a URL to discover it's components
|
1634
|
+
*
|
1635
|
+
* @param {String} url The URL to be parsed
|
1636
|
+
* @returns {Object}
|
1637
|
+
*/
|
1638
|
+
function resolveURL(url) {
|
1639
|
+
var href = url;
|
1640
|
+
|
1641
|
+
if (msie) {
|
1642
|
+
// IE needs attribute set twice to normalize properties
|
1643
|
+
urlParsingNode.setAttribute('href', href);
|
1644
|
+
href = urlParsingNode.href;
|
1645
|
+
}
|
1646
|
+
|
1647
|
+
urlParsingNode.setAttribute('href', href);
|
1648
|
+
|
1649
|
+
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
1650
|
+
return {
|
1651
|
+
href: urlParsingNode.href,
|
1652
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
1653
|
+
host: urlParsingNode.host,
|
1654
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
1655
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
1656
|
+
hostname: urlParsingNode.hostname,
|
1657
|
+
port: urlParsingNode.port,
|
1658
|
+
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
1659
|
+
urlParsingNode.pathname :
|
1660
|
+
'/' + urlParsingNode.pathname
|
1661
|
+
};
|
1662
|
+
}
|
1663
|
+
|
1664
|
+
originURL = resolveURL(window.location.href);
|
1665
|
+
|
1666
|
+
/**
|
1667
|
+
* Determine if a URL shares the same origin as the current location
|
1668
|
+
*
|
1669
|
+
* @param {String} requestURL The URL to test
|
1670
|
+
* @returns {boolean} True if URL shares the same origin, otherwise false
|
1671
|
+
*/
|
1672
|
+
return function isURLSameOrigin(requestURL) {
|
1673
|
+
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
1674
|
+
return (parsed.protocol === originURL.protocol &&
|
1675
|
+
parsed.host === originURL.host);
|
1676
|
+
};
|
1677
|
+
})() :
|
1678
|
+
|
1679
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
1680
|
+
(function nonStandardBrowserEnv() {
|
1681
|
+
return function isURLSameOrigin() {
|
1682
|
+
return true;
|
1683
|
+
};
|
1684
|
+
})()
|
1685
|
+
);
|
1519
1686
|
|
1520
1687
|
|
1521
1688
|
/***/ }),
|
1522
|
-
|
1689
|
+
|
1690
|
+
/***/ "./lib/helpers/normalizeHeaderName.js":
|
1691
|
+
/*!********************************************!*\
|
1692
|
+
!*** ./lib/helpers/normalizeHeaderName.js ***!
|
1693
|
+
\********************************************/
|
1694
|
+
/*! no static exports found */
|
1523
1695
|
/***/ (function(module, exports, __webpack_require__) {
|
1524
1696
|
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
// eslint-disable-next-line no-param-reassign
|
1539
|
-
config2 = config2 || {};
|
1540
|
-
var config = {};
|
1541
|
-
|
1542
|
-
var valueFromConfig2Keys = ['url', 'method', 'data'];
|
1543
|
-
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
|
1544
|
-
var defaultToConfig2Keys = [
|
1545
|
-
'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
1546
|
-
'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
1547
|
-
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
|
1548
|
-
'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
|
1549
|
-
'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
|
1550
|
-
];
|
1551
|
-
var directMergeKeys = ['validateStatus'];
|
1552
|
-
|
1553
|
-
function getMergedValue(target, source) {
|
1554
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
1555
|
-
return utils.merge(target, source);
|
1556
|
-
} else if (utils.isPlainObject(source)) {
|
1557
|
-
return utils.merge({}, source);
|
1558
|
-
} else if (utils.isArray(source)) {
|
1559
|
-
return source.slice();
|
1560
|
-
}
|
1561
|
-
return source;
|
1562
|
-
}
|
1563
|
-
|
1564
|
-
function mergeDeepProperties(prop) {
|
1565
|
-
if (!utils.isUndefined(config2[prop])) {
|
1566
|
-
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
1567
|
-
} else if (!utils.isUndefined(config1[prop])) {
|
1568
|
-
config[prop] = getMergedValue(undefined, config1[prop]);
|
1569
|
-
}
|
1570
|
-
}
|
1571
|
-
|
1572
|
-
utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
1573
|
-
if (!utils.isUndefined(config2[prop])) {
|
1574
|
-
config[prop] = getMergedValue(undefined, config2[prop]);
|
1575
|
-
}
|
1576
|
-
});
|
1577
|
-
|
1578
|
-
utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
1579
|
-
|
1580
|
-
utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
1581
|
-
if (!utils.isUndefined(config2[prop])) {
|
1582
|
-
config[prop] = getMergedValue(undefined, config2[prop]);
|
1583
|
-
} else if (!utils.isUndefined(config1[prop])) {
|
1584
|
-
config[prop] = getMergedValue(undefined, config1[prop]);
|
1585
|
-
}
|
1586
|
-
});
|
1587
|
-
|
1588
|
-
utils.forEach(directMergeKeys, function merge(prop) {
|
1589
|
-
if (prop in config2) {
|
1590
|
-
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
1591
|
-
} else if (prop in config1) {
|
1592
|
-
config[prop] = getMergedValue(undefined, config1[prop]);
|
1593
|
-
}
|
1594
|
-
});
|
1595
|
-
|
1596
|
-
var axiosKeys = valueFromConfig2Keys
|
1597
|
-
.concat(mergeDeepPropertiesKeys)
|
1598
|
-
.concat(defaultToConfig2Keys)
|
1599
|
-
.concat(directMergeKeys);
|
1600
|
-
|
1601
|
-
var otherKeys = Object
|
1602
|
-
.keys(config1)
|
1603
|
-
.concat(Object.keys(config2))
|
1604
|
-
.filter(function filterAxiosKeys(key) {
|
1605
|
-
return axiosKeys.indexOf(key) === -1;
|
1606
|
-
});
|
1607
|
-
|
1608
|
-
utils.forEach(otherKeys, mergeDeepProperties);
|
1609
|
-
|
1610
|
-
return config;
|
1611
|
-
};
|
1697
|
+
"use strict";
|
1698
|
+
|
1699
|
+
|
1700
|
+
var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js");
|
1701
|
+
|
1702
|
+
module.exports = function normalizeHeaderName(headers, normalizedName) {
|
1703
|
+
utils.forEach(headers, function processHeader(value, name) {
|
1704
|
+
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
1705
|
+
headers[normalizedName] = value;
|
1706
|
+
delete headers[name];
|
1707
|
+
}
|
1708
|
+
});
|
1709
|
+
};
|
1612
1710
|
|
1613
1711
|
|
1614
1712
|
/***/ }),
|
1615
|
-
/* 23 */
|
1616
|
-
/***/ (function(module, exports) {
|
1617
1713
|
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1714
|
+
/***/ "./lib/helpers/parseHeaders.js":
|
1715
|
+
/*!*************************************!*\
|
1716
|
+
!*** ./lib/helpers/parseHeaders.js ***!
|
1717
|
+
\*************************************/
|
1718
|
+
/*! no static exports found */
|
1719
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1720
|
+
|
1721
|
+
"use strict";
|
1722
|
+
|
1723
|
+
|
1724
|
+
var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js");
|
1725
|
+
|
1726
|
+
// Headers whose duplicates are ignored by node
|
1727
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
1728
|
+
var ignoreDuplicateOf = [
|
1729
|
+
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
1730
|
+
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
1731
|
+
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
1732
|
+
'referer', 'retry-after', 'user-agent'
|
1733
|
+
];
|
1734
|
+
|
1735
|
+
/**
|
1736
|
+
* Parse headers into an object
|
1737
|
+
*
|
1738
|
+
* ```
|
1739
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
1740
|
+
* Content-Type: application/json
|
1741
|
+
* Connection: keep-alive
|
1742
|
+
* Transfer-Encoding: chunked
|
1743
|
+
* ```
|
1744
|
+
*
|
1745
|
+
* @param {String} headers Headers needing to be parsed
|
1746
|
+
* @returns {Object} Headers parsed into an object
|
1747
|
+
*/
|
1748
|
+
module.exports = function parseHeaders(headers) {
|
1749
|
+
var parsed = {};
|
1750
|
+
var key;
|
1751
|
+
var val;
|
1752
|
+
var i;
|
1753
|
+
|
1754
|
+
if (!headers) { return parsed; }
|
1755
|
+
|
1756
|
+
utils.forEach(headers.split('\n'), function parser(line) {
|
1757
|
+
i = line.indexOf(':');
|
1758
|
+
key = utils.trim(line.substr(0, i)).toLowerCase();
|
1759
|
+
val = utils.trim(line.substr(i + 1));
|
1760
|
+
|
1761
|
+
if (key) {
|
1762
|
+
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
1763
|
+
return;
|
1764
|
+
}
|
1765
|
+
if (key === 'set-cookie') {
|
1766
|
+
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
1767
|
+
} else {
|
1768
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
1769
|
+
}
|
1770
|
+
}
|
1771
|
+
});
|
1772
|
+
|
1773
|
+
return parsed;
|
1774
|
+
};
|
1637
1775
|
|
1638
1776
|
|
1639
1777
|
/***/ }),
|
1640
|
-
|
1778
|
+
|
1779
|
+
/***/ "./lib/helpers/spread.js":
|
1780
|
+
/*!*******************************!*\
|
1781
|
+
!*** ./lib/helpers/spread.js ***!
|
1782
|
+
\*******************************/
|
1783
|
+
/*! no static exports found */
|
1641
1784
|
/***/ (function(module, exports, __webpack_require__) {
|
1642
1785
|
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
resolvePromise(token.reason);
|
1672
|
-
});
|
1673
|
-
}
|
1674
|
-
|
1675
|
-
/**
|
1676
|
-
* Throws a `Cancel` if cancellation has been requested.
|
1677
|
-
*/
|
1678
|
-
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
1679
|
-
if (this.reason) {
|
1680
|
-
throw this.reason;
|
1681
|
-
}
|
1682
|
-
};
|
1683
|
-
|
1684
|
-
/**
|
1685
|
-
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
1686
|
-
* cancels the `CancelToken`.
|
1687
|
-
*/
|
1688
|
-
CancelToken.source = function source() {
|
1689
|
-
var cancel;
|
1690
|
-
var token = new CancelToken(function executor(c) {
|
1691
|
-
cancel = c;
|
1692
|
-
});
|
1693
|
-
return {
|
1694
|
-
token: token,
|
1695
|
-
cancel: cancel
|
1696
|
-
};
|
1697
|
-
};
|
1698
|
-
|
1699
|
-
module.exports = CancelToken;
|
1786
|
+
"use strict";
|
1787
|
+
|
1788
|
+
|
1789
|
+
/**
|
1790
|
+
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
1791
|
+
*
|
1792
|
+
* Common use case would be to use `Function.prototype.apply`.
|
1793
|
+
*
|
1794
|
+
* ```js
|
1795
|
+
* function f(x, y, z) {}
|
1796
|
+
* var args = [1, 2, 3];
|
1797
|
+
* f.apply(null, args);
|
1798
|
+
* ```
|
1799
|
+
*
|
1800
|
+
* With `spread` this example can be re-written.
|
1801
|
+
*
|
1802
|
+
* ```js
|
1803
|
+
* spread(function(x, y, z) {})([1, 2, 3]);
|
1804
|
+
* ```
|
1805
|
+
*
|
1806
|
+
* @param {Function} callback
|
1807
|
+
* @returns {Function}
|
1808
|
+
*/
|
1809
|
+
module.exports = function spread(callback) {
|
1810
|
+
return function wrap(arr) {
|
1811
|
+
return callback.apply(null, arr);
|
1812
|
+
};
|
1813
|
+
};
|
1700
1814
|
|
1701
1815
|
|
1702
1816
|
/***/ }),
|
1703
|
-
/* 25 */
|
1704
|
-
/***/ (function(module, exports) {
|
1705
1817
|
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1818
|
+
/***/ "./lib/helpers/validator.js":
|
1819
|
+
/*!**********************************!*\
|
1820
|
+
!*** ./lib/helpers/validator.js ***!
|
1821
|
+
\**********************************/
|
1822
|
+
/*! no static exports found */
|
1823
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1824
|
+
|
1825
|
+
"use strict";
|
1826
|
+
|
1827
|
+
|
1828
|
+
var VERSION = __webpack_require__(/*! ../env/data */ "./lib/env/data.js").version;
|
1829
|
+
|
1830
|
+
var validators = {};
|
1831
|
+
|
1832
|
+
// eslint-disable-next-line func-names
|
1833
|
+
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
|
1834
|
+
validators[type] = function validator(thing) {
|
1835
|
+
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
|
1836
|
+
};
|
1837
|
+
});
|
1838
|
+
|
1839
|
+
var deprecatedWarnings = {};
|
1840
|
+
|
1841
|
+
/**
|
1842
|
+
* Transitional option validator
|
1843
|
+
* @param {function|boolean?} validator - set to false if the transitional option has been removed
|
1844
|
+
* @param {string?} version - deprecated version / removed since version
|
1845
|
+
* @param {string?} message - some message with additional info
|
1846
|
+
* @returns {function}
|
1847
|
+
*/
|
1848
|
+
validators.transitional = function transitional(validator, version, message) {
|
1849
|
+
function formatMessage(opt, desc) {
|
1850
|
+
return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
|
1851
|
+
}
|
1852
|
+
|
1853
|
+
// eslint-disable-next-line func-names
|
1854
|
+
return function(value, opt, opts) {
|
1855
|
+
if (validator === false) {
|
1856
|
+
throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));
|
1857
|
+
}
|
1858
|
+
|
1859
|
+
if (version && !deprecatedWarnings[opt]) {
|
1860
|
+
deprecatedWarnings[opt] = true;
|
1861
|
+
// eslint-disable-next-line no-console
|
1862
|
+
console.warn(
|
1863
|
+
formatMessage(
|
1864
|
+
opt,
|
1865
|
+
' has been deprecated since v' + version + ' and will be removed in the near future'
|
1866
|
+
)
|
1867
|
+
);
|
1868
|
+
}
|
1869
|
+
|
1870
|
+
return validator ? validator(value, opt, opts) : true;
|
1871
|
+
};
|
1872
|
+
};
|
1873
|
+
|
1874
|
+
/**
|
1875
|
+
* Assert object's properties type
|
1876
|
+
* @param {object} options
|
1877
|
+
* @param {object} schema
|
1878
|
+
* @param {boolean?} allowUnknown
|
1879
|
+
*/
|
1880
|
+
|
1881
|
+
function assertOptions(options, schema, allowUnknown) {
|
1882
|
+
if (typeof options !== 'object') {
|
1883
|
+
throw new TypeError('options must be an object');
|
1884
|
+
}
|
1885
|
+
var keys = Object.keys(options);
|
1886
|
+
var i = keys.length;
|
1887
|
+
while (i-- > 0) {
|
1888
|
+
var opt = keys[i];
|
1889
|
+
var validator = schema[opt];
|
1890
|
+
if (validator) {
|
1891
|
+
var value = options[opt];
|
1892
|
+
var result = value === undefined || validator(value, opt, options);
|
1893
|
+
if (result !== true) {
|
1894
|
+
throw new TypeError('option ' + opt + ' must be ' + result);
|
1895
|
+
}
|
1896
|
+
continue;
|
1897
|
+
}
|
1898
|
+
if (allowUnknown !== true) {
|
1899
|
+
throw Error('Unknown option ' + opt);
|
1900
|
+
}
|
1901
|
+
}
|
1902
|
+
}
|
1903
|
+
|
1904
|
+
module.exports = {
|
1905
|
+
assertOptions: assertOptions,
|
1906
|
+
validators: validators
|
1907
|
+
};
|
1733
1908
|
|
1734
1909
|
|
1735
1910
|
/***/ }),
|
1736
|
-
/* 26 */
|
1737
|
-
/***/ (function(module, exports) {
|
1738
1911
|
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1912
|
+
/***/ "./lib/utils.js":
|
1913
|
+
/*!**********************!*\
|
1914
|
+
!*** ./lib/utils.js ***!
|
1915
|
+
\**********************/
|
1916
|
+
/*! no static exports found */
|
1917
|
+
/***/ (function(module, exports, __webpack_require__) {
|
1918
|
+
|
1919
|
+
"use strict";
|
1920
|
+
|
1921
|
+
|
1922
|
+
var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js");
|
1923
|
+
|
1924
|
+
// utils is a library of generic helper functions non-specific to axios
|
1925
|
+
|
1926
|
+
var toString = Object.prototype.toString;
|
1927
|
+
|
1928
|
+
/**
|
1929
|
+
* Determine if a value is an Array
|
1930
|
+
*
|
1931
|
+
* @param {Object} val The value to test
|
1932
|
+
* @returns {boolean} True if value is an Array, otherwise false
|
1933
|
+
*/
|
1934
|
+
function isArray(val) {
|
1935
|
+
return toString.call(val) === '[object Array]';
|
1936
|
+
}
|
1937
|
+
|
1938
|
+
/**
|
1939
|
+
* Determine if a value is undefined
|
1940
|
+
*
|
1941
|
+
* @param {Object} val The value to test
|
1942
|
+
* @returns {boolean} True if the value is undefined, otherwise false
|
1943
|
+
*/
|
1944
|
+
function isUndefined(val) {
|
1945
|
+
return typeof val === 'undefined';
|
1946
|
+
}
|
1947
|
+
|
1948
|
+
/**
|
1949
|
+
* Determine if a value is a Buffer
|
1950
|
+
*
|
1951
|
+
* @param {Object} val The value to test
|
1952
|
+
* @returns {boolean} True if value is a Buffer, otherwise false
|
1953
|
+
*/
|
1954
|
+
function isBuffer(val) {
|
1955
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
1956
|
+
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
|
1957
|
+
}
|
1958
|
+
|
1959
|
+
/**
|
1960
|
+
* Determine if a value is an ArrayBuffer
|
1961
|
+
*
|
1962
|
+
* @param {Object} val The value to test
|
1963
|
+
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
1964
|
+
*/
|
1965
|
+
function isArrayBuffer(val) {
|
1966
|
+
return toString.call(val) === '[object ArrayBuffer]';
|
1967
|
+
}
|
1968
|
+
|
1969
|
+
/**
|
1970
|
+
* Determine if a value is a FormData
|
1971
|
+
*
|
1972
|
+
* @param {Object} val The value to test
|
1973
|
+
* @returns {boolean} True if value is an FormData, otherwise false
|
1974
|
+
*/
|
1975
|
+
function isFormData(val) {
|
1976
|
+
return (typeof FormData !== 'undefined') && (val instanceof FormData);
|
1977
|
+
}
|
1978
|
+
|
1979
|
+
/**
|
1980
|
+
* Determine if a value is a view on an ArrayBuffer
|
1981
|
+
*
|
1982
|
+
* @param {Object} val The value to test
|
1983
|
+
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
1984
|
+
*/
|
1985
|
+
function isArrayBufferView(val) {
|
1986
|
+
var result;
|
1987
|
+
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
1988
|
+
result = ArrayBuffer.isView(val);
|
1989
|
+
} else {
|
1990
|
+
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
|
1991
|
+
}
|
1992
|
+
return result;
|
1993
|
+
}
|
1994
|
+
|
1995
|
+
/**
|
1996
|
+
* Determine if a value is a String
|
1997
|
+
*
|
1998
|
+
* @param {Object} val The value to test
|
1999
|
+
* @returns {boolean} True if value is a String, otherwise false
|
2000
|
+
*/
|
2001
|
+
function isString(val) {
|
2002
|
+
return typeof val === 'string';
|
2003
|
+
}
|
2004
|
+
|
2005
|
+
/**
|
2006
|
+
* Determine if a value is a Number
|
2007
|
+
*
|
2008
|
+
* @param {Object} val The value to test
|
2009
|
+
* @returns {boolean} True if value is a Number, otherwise false
|
2010
|
+
*/
|
2011
|
+
function isNumber(val) {
|
2012
|
+
return typeof val === 'number';
|
2013
|
+
}
|
2014
|
+
|
2015
|
+
/**
|
2016
|
+
* Determine if a value is an Object
|
2017
|
+
*
|
2018
|
+
* @param {Object} val The value to test
|
2019
|
+
* @returns {boolean} True if value is an Object, otherwise false
|
2020
|
+
*/
|
2021
|
+
function isObject(val) {
|
2022
|
+
return val !== null && typeof val === 'object';
|
2023
|
+
}
|
2024
|
+
|
2025
|
+
/**
|
2026
|
+
* Determine if a value is a plain Object
|
2027
|
+
*
|
2028
|
+
* @param {Object} val The value to test
|
2029
|
+
* @return {boolean} True if value is a plain Object, otherwise false
|
2030
|
+
*/
|
2031
|
+
function isPlainObject(val) {
|
2032
|
+
if (toString.call(val) !== '[object Object]') {
|
2033
|
+
return false;
|
2034
|
+
}
|
2035
|
+
|
2036
|
+
var prototype = Object.getPrototypeOf(val);
|
2037
|
+
return prototype === null || prototype === Object.prototype;
|
2038
|
+
}
|
2039
|
+
|
2040
|
+
/**
|
2041
|
+
* Determine if a value is a Date
|
2042
|
+
*
|
2043
|
+
* @param {Object} val The value to test
|
2044
|
+
* @returns {boolean} True if value is a Date, otherwise false
|
2045
|
+
*/
|
2046
|
+
function isDate(val) {
|
2047
|
+
return toString.call(val) === '[object Date]';
|
2048
|
+
}
|
2049
|
+
|
2050
|
+
/**
|
2051
|
+
* Determine if a value is a File
|
2052
|
+
*
|
2053
|
+
* @param {Object} val The value to test
|
2054
|
+
* @returns {boolean} True if value is a File, otherwise false
|
2055
|
+
*/
|
2056
|
+
function isFile(val) {
|
2057
|
+
return toString.call(val) === '[object File]';
|
2058
|
+
}
|
2059
|
+
|
2060
|
+
/**
|
2061
|
+
* Determine if a value is a Blob
|
2062
|
+
*
|
2063
|
+
* @param {Object} val The value to test
|
2064
|
+
* @returns {boolean} True if value is a Blob, otherwise false
|
2065
|
+
*/
|
2066
|
+
function isBlob(val) {
|
2067
|
+
return toString.call(val) === '[object Blob]';
|
2068
|
+
}
|
2069
|
+
|
2070
|
+
/**
|
2071
|
+
* Determine if a value is a Function
|
2072
|
+
*
|
2073
|
+
* @param {Object} val The value to test
|
2074
|
+
* @returns {boolean} True if value is a Function, otherwise false
|
2075
|
+
*/
|
2076
|
+
function isFunction(val) {
|
2077
|
+
return toString.call(val) === '[object Function]';
|
2078
|
+
}
|
2079
|
+
|
2080
|
+
/**
|
2081
|
+
* Determine if a value is a Stream
|
2082
|
+
*
|
2083
|
+
* @param {Object} val The value to test
|
2084
|
+
* @returns {boolean} True if value is a Stream, otherwise false
|
2085
|
+
*/
|
2086
|
+
function isStream(val) {
|
2087
|
+
return isObject(val) && isFunction(val.pipe);
|
2088
|
+
}
|
2089
|
+
|
2090
|
+
/**
|
2091
|
+
* Determine if a value is a URLSearchParams object
|
2092
|
+
*
|
2093
|
+
* @param {Object} val The value to test
|
2094
|
+
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
2095
|
+
*/
|
2096
|
+
function isURLSearchParams(val) {
|
2097
|
+
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
|
2098
|
+
}
|
2099
|
+
|
2100
|
+
/**
|
2101
|
+
* Trim excess whitespace off the beginning and end of a string
|
2102
|
+
*
|
2103
|
+
* @param {String} str The String to trim
|
2104
|
+
* @returns {String} The String freed of excess whitespace
|
2105
|
+
*/
|
2106
|
+
function trim(str) {
|
2107
|
+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
2108
|
+
}
|
2109
|
+
|
2110
|
+
/**
|
2111
|
+
* Determine if we're running in a standard browser environment
|
2112
|
+
*
|
2113
|
+
* This allows axios to run in a web worker, and react-native.
|
2114
|
+
* Both environments support XMLHttpRequest, but not fully standard globals.
|
2115
|
+
*
|
2116
|
+
* web workers:
|
2117
|
+
* typeof window -> undefined
|
2118
|
+
* typeof document -> undefined
|
2119
|
+
*
|
2120
|
+
* react-native:
|
2121
|
+
* navigator.product -> 'ReactNative'
|
2122
|
+
* nativescript
|
2123
|
+
* navigator.product -> 'NativeScript' or 'NS'
|
2124
|
+
*/
|
2125
|
+
function isStandardBrowserEnv() {
|
2126
|
+
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
|
2127
|
+
navigator.product === 'NativeScript' ||
|
2128
|
+
navigator.product === 'NS')) {
|
2129
|
+
return false;
|
2130
|
+
}
|
2131
|
+
return (
|
2132
|
+
typeof window !== 'undefined' &&
|
2133
|
+
typeof document !== 'undefined'
|
2134
|
+
);
|
2135
|
+
}
|
2136
|
+
|
2137
|
+
/**
|
2138
|
+
* Iterate over an Array or an Object invoking a function for each item.
|
2139
|
+
*
|
2140
|
+
* If `obj` is an Array callback will be called passing
|
2141
|
+
* the value, index, and complete array for each item.
|
2142
|
+
*
|
2143
|
+
* If 'obj' is an Object callback will be called passing
|
2144
|
+
* the value, key, and complete object for each property.
|
2145
|
+
*
|
2146
|
+
* @param {Object|Array} obj The object to iterate
|
2147
|
+
* @param {Function} fn The callback to invoke for each item
|
2148
|
+
*/
|
2149
|
+
function forEach(obj, fn) {
|
2150
|
+
// Don't bother if no value provided
|
2151
|
+
if (obj === null || typeof obj === 'undefined') {
|
2152
|
+
return;
|
2153
|
+
}
|
2154
|
+
|
2155
|
+
// Force an array if not already something iterable
|
2156
|
+
if (typeof obj !== 'object') {
|
2157
|
+
/*eslint no-param-reassign:0*/
|
2158
|
+
obj = [obj];
|
2159
|
+
}
|
2160
|
+
|
2161
|
+
if (isArray(obj)) {
|
2162
|
+
// Iterate over array values
|
2163
|
+
for (var i = 0, l = obj.length; i < l; i++) {
|
2164
|
+
fn.call(null, obj[i], i, obj);
|
2165
|
+
}
|
2166
|
+
} else {
|
2167
|
+
// Iterate over object keys
|
2168
|
+
for (var key in obj) {
|
2169
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
2170
|
+
fn.call(null, obj[key], key, obj);
|
2171
|
+
}
|
2172
|
+
}
|
2173
|
+
}
|
2174
|
+
}
|
2175
|
+
|
2176
|
+
/**
|
2177
|
+
* Accepts varargs expecting each argument to be an object, then
|
2178
|
+
* immutably merges the properties of each object and returns result.
|
2179
|
+
*
|
2180
|
+
* When multiple objects contain the same key the later object in
|
2181
|
+
* the arguments list will take precedence.
|
2182
|
+
*
|
2183
|
+
* Example:
|
2184
|
+
*
|
2185
|
+
* ```js
|
2186
|
+
* var result = merge({foo: 123}, {foo: 456});
|
2187
|
+
* console.log(result.foo); // outputs 456
|
2188
|
+
* ```
|
2189
|
+
*
|
2190
|
+
* @param {Object} obj1 Object to merge
|
2191
|
+
* @returns {Object} Result of all merge properties
|
2192
|
+
*/
|
2193
|
+
function merge(/* obj1, obj2, obj3, ... */) {
|
2194
|
+
var result = {};
|
2195
|
+
function assignValue(val, key) {
|
2196
|
+
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
2197
|
+
result[key] = merge(result[key], val);
|
2198
|
+
} else if (isPlainObject(val)) {
|
2199
|
+
result[key] = merge({}, val);
|
2200
|
+
} else if (isArray(val)) {
|
2201
|
+
result[key] = val.slice();
|
2202
|
+
} else {
|
2203
|
+
result[key] = val;
|
2204
|
+
}
|
2205
|
+
}
|
2206
|
+
|
2207
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
2208
|
+
forEach(arguments[i], assignValue);
|
2209
|
+
}
|
2210
|
+
return result;
|
2211
|
+
}
|
2212
|
+
|
2213
|
+
/**
|
2214
|
+
* Extends object a by mutably adding to it the properties of object b.
|
2215
|
+
*
|
2216
|
+
* @param {Object} a The object to be extended
|
2217
|
+
* @param {Object} b The object to copy properties from
|
2218
|
+
* @param {Object} thisArg The object to bind function to
|
2219
|
+
* @return {Object} The resulting value of object a
|
2220
|
+
*/
|
2221
|
+
function extend(a, b, thisArg) {
|
2222
|
+
forEach(b, function assignValue(val, key) {
|
2223
|
+
if (thisArg && typeof val === 'function') {
|
2224
|
+
a[key] = bind(val, thisArg);
|
2225
|
+
} else {
|
2226
|
+
a[key] = val;
|
2227
|
+
}
|
2228
|
+
});
|
2229
|
+
return a;
|
2230
|
+
}
|
2231
|
+
|
2232
|
+
/**
|
2233
|
+
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
2234
|
+
*
|
2235
|
+
* @param {string} content with BOM
|
2236
|
+
* @return {string} content value without BOM
|
2237
|
+
*/
|
2238
|
+
function stripBOM(content) {
|
2239
|
+
if (content.charCodeAt(0) === 0xFEFF) {
|
2240
|
+
content = content.slice(1);
|
2241
|
+
}
|
2242
|
+
return content;
|
2243
|
+
}
|
2244
|
+
|
2245
|
+
module.exports = {
|
2246
|
+
isArray: isArray,
|
2247
|
+
isArrayBuffer: isArrayBuffer,
|
2248
|
+
isBuffer: isBuffer,
|
2249
|
+
isFormData: isFormData,
|
2250
|
+
isArrayBufferView: isArrayBufferView,
|
2251
|
+
isString: isString,
|
2252
|
+
isNumber: isNumber,
|
2253
|
+
isObject: isObject,
|
2254
|
+
isPlainObject: isPlainObject,
|
2255
|
+
isUndefined: isUndefined,
|
2256
|
+
isDate: isDate,
|
2257
|
+
isFile: isFile,
|
2258
|
+
isBlob: isBlob,
|
2259
|
+
isFunction: isFunction,
|
2260
|
+
isStream: isStream,
|
2261
|
+
isURLSearchParams: isURLSearchParams,
|
2262
|
+
isStandardBrowserEnv: isStandardBrowserEnv,
|
2263
|
+
forEach: forEach,
|
2264
|
+
merge: merge,
|
2265
|
+
extend: extend,
|
2266
|
+
trim: trim,
|
2267
|
+
stripBOM: stripBOM
|
2268
|
+
};
|
1750
2269
|
|
1751
2270
|
|
1752
2271
|
/***/ })
|
1753
|
-
|
2272
|
+
|
2273
|
+
/******/ });
|
1754
2274
|
});
|
1755
|
-
;
|
1756
2275
|
//# sourceMappingURL=axios.map
|