isdata-customer-sdk 0.1.1
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/.eslintignore +8 -0
- package/.eslintrc.js +42 -0
- package/babel.config.js +12 -0
- package/dist/index.js +4818 -0
- package/package.json +51 -0
- package/src/api/request.js +64 -0
- package/src/index.js +126 -0
- package/webpack.config.js +28 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,4818 @@
|
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ var __webpack_modules__ = ({
|
|
3
|
+
|
|
4
|
+
/***/ 12:
|
|
5
|
+
/***/ ((module) => {
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
module.exports = function bind(fn, thisArg) {
|
|
11
|
+
return function wrap() {
|
|
12
|
+
var args = new Array(arguments.length);
|
|
13
|
+
for (var i = 0; i < args.length; i++) {
|
|
14
|
+
args[i] = arguments[i];
|
|
15
|
+
}
|
|
16
|
+
return fn.apply(thisArg, args);
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/***/ }),
|
|
22
|
+
|
|
23
|
+
/***/ 15:
|
|
24
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
25
|
+
|
|
26
|
+
"use strict";
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
var utils = __webpack_require__(516);
|
|
30
|
+
var bind = __webpack_require__(12);
|
|
31
|
+
var Axios = __webpack_require__(155);
|
|
32
|
+
var mergeConfig = __webpack_require__(343);
|
|
33
|
+
var defaults = __webpack_require__(987);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create an instance of Axios
|
|
37
|
+
*
|
|
38
|
+
* @param {Object} defaultConfig The default config for the instance
|
|
39
|
+
* @return {Axios} A new instance of Axios
|
|
40
|
+
*/
|
|
41
|
+
function createInstance(defaultConfig) {
|
|
42
|
+
var context = new Axios(defaultConfig);
|
|
43
|
+
var instance = bind(Axios.prototype.request, context);
|
|
44
|
+
|
|
45
|
+
// Copy axios.prototype to instance
|
|
46
|
+
utils.extend(instance, Axios.prototype, context);
|
|
47
|
+
|
|
48
|
+
// Copy context to instance
|
|
49
|
+
utils.extend(instance, context);
|
|
50
|
+
|
|
51
|
+
// Factory for creating new instances
|
|
52
|
+
instance.create = function create(instanceConfig) {
|
|
53
|
+
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return instance;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Create the default instance to be exported
|
|
60
|
+
var axios = createInstance(defaults);
|
|
61
|
+
|
|
62
|
+
// Expose Axios class to allow class inheritance
|
|
63
|
+
axios.Axios = Axios;
|
|
64
|
+
|
|
65
|
+
// Expose Cancel & CancelToken
|
|
66
|
+
axios.Cancel = __webpack_require__(928);
|
|
67
|
+
axios.CancelToken = __webpack_require__(191);
|
|
68
|
+
axios.isCancel = __webpack_require__(864);
|
|
69
|
+
axios.VERSION = (__webpack_require__(641).version);
|
|
70
|
+
|
|
71
|
+
// Expose all/spread
|
|
72
|
+
axios.all = function all(promises) {
|
|
73
|
+
return Promise.all(promises);
|
|
74
|
+
};
|
|
75
|
+
axios.spread = __webpack_require__(980);
|
|
76
|
+
|
|
77
|
+
// Expose isAxiosError
|
|
78
|
+
axios.isAxiosError = __webpack_require__(19);
|
|
79
|
+
|
|
80
|
+
module.exports = axios;
|
|
81
|
+
|
|
82
|
+
// Allow use of default import syntax in TypeScript
|
|
83
|
+
module.exports["default"] = axios;
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/***/ }),
|
|
87
|
+
|
|
88
|
+
/***/ 16:
|
|
89
|
+
/***/ ((module) => {
|
|
90
|
+
|
|
91
|
+
"use strict";
|
|
92
|
+
module.exports = require("url");
|
|
93
|
+
|
|
94
|
+
/***/ }),
|
|
95
|
+
|
|
96
|
+
/***/ 18:
|
|
97
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
98
|
+
|
|
99
|
+
"use strict";
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
var utils = __webpack_require__(516);
|
|
103
|
+
|
|
104
|
+
module.exports = function normalizeHeaderName(headers, normalizedName) {
|
|
105
|
+
utils.forEach(headers, function processHeader(value, name) {
|
|
106
|
+
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
|
107
|
+
headers[normalizedName] = value;
|
|
108
|
+
delete headers[name];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
/***/ }),
|
|
115
|
+
|
|
116
|
+
/***/ 19:
|
|
117
|
+
/***/ ((module) => {
|
|
118
|
+
|
|
119
|
+
"use strict";
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Determines whether the payload is an error thrown by Axios
|
|
124
|
+
*
|
|
125
|
+
* @param {*} payload The value to test
|
|
126
|
+
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
127
|
+
*/
|
|
128
|
+
module.exports = function isAxiosError(payload) {
|
|
129
|
+
return (typeof payload === 'object') && (payload.isAxiosError === true);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
/***/ }),
|
|
134
|
+
|
|
135
|
+
/***/ 23:
|
|
136
|
+
/***/ ((module) => {
|
|
137
|
+
|
|
138
|
+
"use strict";
|
|
139
|
+
module.exports = require("util");
|
|
140
|
+
|
|
141
|
+
/***/ }),
|
|
142
|
+
|
|
143
|
+
/***/ 33:
|
|
144
|
+
/***/ ((module, exports, __webpack_require__) => {
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Module dependencies.
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
const tty = __webpack_require__(637);
|
|
151
|
+
const util = __webpack_require__(23);
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* This is the Node.js implementation of `debug()`.
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
exports.init = init;
|
|
158
|
+
exports.log = log;
|
|
159
|
+
exports.formatArgs = formatArgs;
|
|
160
|
+
exports.save = save;
|
|
161
|
+
exports.load = load;
|
|
162
|
+
exports.useColors = useColors;
|
|
163
|
+
exports.destroy = util.deprecate(
|
|
164
|
+
() => {},
|
|
165
|
+
'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Colors.
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
176
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
177
|
+
const supportsColor = __webpack_require__(687);
|
|
178
|
+
|
|
179
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
180
|
+
exports.colors = [
|
|
181
|
+
20,
|
|
182
|
+
21,
|
|
183
|
+
26,
|
|
184
|
+
27,
|
|
185
|
+
32,
|
|
186
|
+
33,
|
|
187
|
+
38,
|
|
188
|
+
39,
|
|
189
|
+
40,
|
|
190
|
+
41,
|
|
191
|
+
42,
|
|
192
|
+
43,
|
|
193
|
+
44,
|
|
194
|
+
45,
|
|
195
|
+
56,
|
|
196
|
+
57,
|
|
197
|
+
62,
|
|
198
|
+
63,
|
|
199
|
+
68,
|
|
200
|
+
69,
|
|
201
|
+
74,
|
|
202
|
+
75,
|
|
203
|
+
76,
|
|
204
|
+
77,
|
|
205
|
+
78,
|
|
206
|
+
79,
|
|
207
|
+
80,
|
|
208
|
+
81,
|
|
209
|
+
92,
|
|
210
|
+
93,
|
|
211
|
+
98,
|
|
212
|
+
99,
|
|
213
|
+
112,
|
|
214
|
+
113,
|
|
215
|
+
128,
|
|
216
|
+
129,
|
|
217
|
+
134,
|
|
218
|
+
135,
|
|
219
|
+
148,
|
|
220
|
+
149,
|
|
221
|
+
160,
|
|
222
|
+
161,
|
|
223
|
+
162,
|
|
224
|
+
163,
|
|
225
|
+
164,
|
|
226
|
+
165,
|
|
227
|
+
166,
|
|
228
|
+
167,
|
|
229
|
+
168,
|
|
230
|
+
169,
|
|
231
|
+
170,
|
|
232
|
+
171,
|
|
233
|
+
172,
|
|
234
|
+
173,
|
|
235
|
+
178,
|
|
236
|
+
179,
|
|
237
|
+
184,
|
|
238
|
+
185,
|
|
239
|
+
196,
|
|
240
|
+
197,
|
|
241
|
+
198,
|
|
242
|
+
199,
|
|
243
|
+
200,
|
|
244
|
+
201,
|
|
245
|
+
202,
|
|
246
|
+
203,
|
|
247
|
+
204,
|
|
248
|
+
205,
|
|
249
|
+
206,
|
|
250
|
+
207,
|
|
251
|
+
208,
|
|
252
|
+
209,
|
|
253
|
+
214,
|
|
254
|
+
215,
|
|
255
|
+
220,
|
|
256
|
+
221
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
} catch (error) {
|
|
260
|
+
// Swallow - we only care if `supports-color` is available; it doesn't have to be.
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Build up the default `inspectOpts` object from the environment variables.
|
|
265
|
+
*
|
|
266
|
+
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
|
267
|
+
*/
|
|
268
|
+
|
|
269
|
+
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
|
270
|
+
return /^debug_/i.test(key);
|
|
271
|
+
}).reduce((obj, key) => {
|
|
272
|
+
// Camel-case
|
|
273
|
+
const prop = key
|
|
274
|
+
.substring(6)
|
|
275
|
+
.toLowerCase()
|
|
276
|
+
.replace(/_([a-z])/g, (_, k) => {
|
|
277
|
+
return k.toUpperCase();
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
// Coerce string value into JS value
|
|
281
|
+
let val = process.env[key];
|
|
282
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
283
|
+
val = true;
|
|
284
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
285
|
+
val = false;
|
|
286
|
+
} else if (val === 'null') {
|
|
287
|
+
val = null;
|
|
288
|
+
} else {
|
|
289
|
+
val = Number(val);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
obj[prop] = val;
|
|
293
|
+
return obj;
|
|
294
|
+
}, {});
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
function useColors() {
|
|
301
|
+
return 'colors' in exports.inspectOpts ?
|
|
302
|
+
Boolean(exports.inspectOpts.colors) :
|
|
303
|
+
tty.isatty(process.stderr.fd);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Adds ANSI color escape codes if enabled.
|
|
308
|
+
*
|
|
309
|
+
* @api public
|
|
310
|
+
*/
|
|
311
|
+
|
|
312
|
+
function formatArgs(args) {
|
|
313
|
+
const {namespace: name, useColors} = this;
|
|
314
|
+
|
|
315
|
+
if (useColors) {
|
|
316
|
+
const c = this.color;
|
|
317
|
+
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
318
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
319
|
+
|
|
320
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
321
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
322
|
+
} else {
|
|
323
|
+
args[0] = getDate() + name + ' ' + args[0];
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function getDate() {
|
|
328
|
+
if (exports.inspectOpts.hideDate) {
|
|
329
|
+
return '';
|
|
330
|
+
}
|
|
331
|
+
return new Date().toISOString() + ' ';
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
|
|
336
|
+
*/
|
|
337
|
+
|
|
338
|
+
function log(...args) {
|
|
339
|
+
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Save `namespaces`.
|
|
344
|
+
*
|
|
345
|
+
* @param {String} namespaces
|
|
346
|
+
* @api private
|
|
347
|
+
*/
|
|
348
|
+
function save(namespaces) {
|
|
349
|
+
if (namespaces) {
|
|
350
|
+
process.env.DEBUG = namespaces;
|
|
351
|
+
} else {
|
|
352
|
+
// If you set a process.env field to null or undefined, it gets cast to the
|
|
353
|
+
// string 'null' or 'undefined'. Just delete instead.
|
|
354
|
+
delete process.env.DEBUG;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Load `namespaces`.
|
|
360
|
+
*
|
|
361
|
+
* @return {String} returns the previously persisted debug modes
|
|
362
|
+
* @api private
|
|
363
|
+
*/
|
|
364
|
+
|
|
365
|
+
function load() {
|
|
366
|
+
return process.env.DEBUG;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Init logic for `debug` instances.
|
|
371
|
+
*
|
|
372
|
+
* Create a new `inspectOpts` object in case `useColors` is set
|
|
373
|
+
* differently for a particular `debug` instance.
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
function init(debug) {
|
|
377
|
+
debug.inspectOpts = {};
|
|
378
|
+
|
|
379
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
380
|
+
for (let i = 0; i < keys.length; i++) {
|
|
381
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
module.exports = __webpack_require__(736)(exports);
|
|
386
|
+
|
|
387
|
+
const {formatters} = module.exports;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Map %o to `util.inspect()`, all on a single line.
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
formatters.o = function (v) {
|
|
394
|
+
this.inspectOpts.colors = this.useColors;
|
|
395
|
+
return util.inspect(v, this.inspectOpts)
|
|
396
|
+
.split('\n')
|
|
397
|
+
.map(str => str.trim())
|
|
398
|
+
.join(' ');
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Map %O to `util.inspect()`, allowing multiple lines if needed.
|
|
403
|
+
*/
|
|
404
|
+
|
|
405
|
+
formatters.O = function (v) {
|
|
406
|
+
this.inspectOpts.colors = this.useColors;
|
|
407
|
+
return util.inspect(v, this.inspectOpts);
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
/***/ }),
|
|
412
|
+
|
|
413
|
+
/***/ 106:
|
|
414
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
415
|
+
|
|
416
|
+
"use strict";
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
var utils = __webpack_require__(516);
|
|
420
|
+
|
|
421
|
+
function encode(val) {
|
|
422
|
+
return encodeURIComponent(val).
|
|
423
|
+
replace(/%3A/gi, ':').
|
|
424
|
+
replace(/%24/g, '$').
|
|
425
|
+
replace(/%2C/gi, ',').
|
|
426
|
+
replace(/%20/g, '+').
|
|
427
|
+
replace(/%5B/gi, '[').
|
|
428
|
+
replace(/%5D/gi, ']');
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Build a URL by appending params to the end
|
|
433
|
+
*
|
|
434
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
435
|
+
* @param {object} [params] The params to be appended
|
|
436
|
+
* @returns {string} The formatted url
|
|
437
|
+
*/
|
|
438
|
+
module.exports = function buildURL(url, params, paramsSerializer) {
|
|
439
|
+
/*eslint no-param-reassign:0*/
|
|
440
|
+
if (!params) {
|
|
441
|
+
return url;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
var serializedParams;
|
|
445
|
+
if (paramsSerializer) {
|
|
446
|
+
serializedParams = paramsSerializer(params);
|
|
447
|
+
} else if (utils.isURLSearchParams(params)) {
|
|
448
|
+
serializedParams = params.toString();
|
|
449
|
+
} else {
|
|
450
|
+
var parts = [];
|
|
451
|
+
|
|
452
|
+
utils.forEach(params, function serialize(val, key) {
|
|
453
|
+
if (val === null || typeof val === 'undefined') {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
if (utils.isArray(val)) {
|
|
458
|
+
key = key + '[]';
|
|
459
|
+
} else {
|
|
460
|
+
val = [val];
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
utils.forEach(val, function parseValue(v) {
|
|
464
|
+
if (utils.isDate(v)) {
|
|
465
|
+
v = v.toISOString();
|
|
466
|
+
} else if (utils.isObject(v)) {
|
|
467
|
+
v = JSON.stringify(v);
|
|
468
|
+
}
|
|
469
|
+
parts.push(encode(key) + '=' + encode(v));
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
serializedParams = parts.join('&');
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (serializedParams) {
|
|
477
|
+
var hashmarkIndex = url.indexOf('#');
|
|
478
|
+
if (hashmarkIndex !== -1) {
|
|
479
|
+
url = url.slice(0, hashmarkIndex);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
return url;
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
/***/ }),
|
|
490
|
+
|
|
491
|
+
/***/ 137:
|
|
492
|
+
/***/ ((module) => {
|
|
493
|
+
|
|
494
|
+
"use strict";
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Determines whether the specified URL is absolute
|
|
499
|
+
*
|
|
500
|
+
* @param {string} url The URL to test
|
|
501
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
|
502
|
+
*/
|
|
503
|
+
module.exports = function isAbsoluteURL(url) {
|
|
504
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
505
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
506
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
|
507
|
+
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
/***/ }),
|
|
512
|
+
|
|
513
|
+
/***/ 155:
|
|
514
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
515
|
+
|
|
516
|
+
"use strict";
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
var utils = __webpack_require__(516);
|
|
520
|
+
var buildURL = __webpack_require__(106);
|
|
521
|
+
var InterceptorManager = __webpack_require__(471);
|
|
522
|
+
var dispatchRequest = __webpack_require__(490);
|
|
523
|
+
var mergeConfig = __webpack_require__(343);
|
|
524
|
+
var validator = __webpack_require__(841);
|
|
525
|
+
|
|
526
|
+
var validators = validator.validators;
|
|
527
|
+
/**
|
|
528
|
+
* Create a new instance of Axios
|
|
529
|
+
*
|
|
530
|
+
* @param {Object} instanceConfig The default config for the instance
|
|
531
|
+
*/
|
|
532
|
+
function Axios(instanceConfig) {
|
|
533
|
+
this.defaults = instanceConfig;
|
|
534
|
+
this.interceptors = {
|
|
535
|
+
request: new InterceptorManager(),
|
|
536
|
+
response: new InterceptorManager()
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Dispatch a request
|
|
542
|
+
*
|
|
543
|
+
* @param {Object} config The config specific for this request (merged with this.defaults)
|
|
544
|
+
*/
|
|
545
|
+
Axios.prototype.request = function request(config) {
|
|
546
|
+
/*eslint no-param-reassign:0*/
|
|
547
|
+
// Allow for axios('example/url'[, config]) a la fetch API
|
|
548
|
+
if (typeof config === 'string') {
|
|
549
|
+
config = arguments[1] || {};
|
|
550
|
+
config.url = arguments[0];
|
|
551
|
+
} else {
|
|
552
|
+
config = config || {};
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
config = mergeConfig(this.defaults, config);
|
|
556
|
+
|
|
557
|
+
// Set config.method
|
|
558
|
+
if (config.method) {
|
|
559
|
+
config.method = config.method.toLowerCase();
|
|
560
|
+
} else if (this.defaults.method) {
|
|
561
|
+
config.method = this.defaults.method.toLowerCase();
|
|
562
|
+
} else {
|
|
563
|
+
config.method = 'get';
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
var transitional = config.transitional;
|
|
567
|
+
|
|
568
|
+
if (transitional !== undefined) {
|
|
569
|
+
validator.assertOptions(transitional, {
|
|
570
|
+
silentJSONParsing: validators.transitional(validators.boolean),
|
|
571
|
+
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
572
|
+
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
573
|
+
}, false);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// filter out skipped interceptors
|
|
577
|
+
var requestInterceptorChain = [];
|
|
578
|
+
var synchronousRequestInterceptors = true;
|
|
579
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
580
|
+
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
585
|
+
|
|
586
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
var responseInterceptorChain = [];
|
|
590
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
591
|
+
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
var promise;
|
|
595
|
+
|
|
596
|
+
if (!synchronousRequestInterceptors) {
|
|
597
|
+
var chain = [dispatchRequest, undefined];
|
|
598
|
+
|
|
599
|
+
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
600
|
+
chain = chain.concat(responseInterceptorChain);
|
|
601
|
+
|
|
602
|
+
promise = Promise.resolve(config);
|
|
603
|
+
while (chain.length) {
|
|
604
|
+
promise = promise.then(chain.shift(), chain.shift());
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
return promise;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
var newConfig = config;
|
|
612
|
+
while (requestInterceptorChain.length) {
|
|
613
|
+
var onFulfilled = requestInterceptorChain.shift();
|
|
614
|
+
var onRejected = requestInterceptorChain.shift();
|
|
615
|
+
try {
|
|
616
|
+
newConfig = onFulfilled(newConfig);
|
|
617
|
+
} catch (error) {
|
|
618
|
+
onRejected(error);
|
|
619
|
+
break;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
try {
|
|
624
|
+
promise = dispatchRequest(newConfig);
|
|
625
|
+
} catch (error) {
|
|
626
|
+
return Promise.reject(error);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
while (responseInterceptorChain.length) {
|
|
630
|
+
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
return promise;
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
Axios.prototype.getUri = function getUri(config) {
|
|
637
|
+
config = mergeConfig(this.defaults, config);
|
|
638
|
+
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
// Provide aliases for supported request methods
|
|
642
|
+
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
643
|
+
/*eslint func-names:0*/
|
|
644
|
+
Axios.prototype[method] = function(url, config) {
|
|
645
|
+
return this.request(mergeConfig(config || {}, {
|
|
646
|
+
method: method,
|
|
647
|
+
url: url,
|
|
648
|
+
data: (config || {}).data
|
|
649
|
+
}));
|
|
650
|
+
};
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
654
|
+
/*eslint func-names:0*/
|
|
655
|
+
Axios.prototype[method] = function(url, data, config) {
|
|
656
|
+
return this.request(mergeConfig(config || {}, {
|
|
657
|
+
method: method,
|
|
658
|
+
url: url,
|
|
659
|
+
data: data
|
|
660
|
+
}));
|
|
661
|
+
};
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
module.exports = Axios;
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
/***/ }),
|
|
668
|
+
|
|
669
|
+
/***/ 164:
|
|
670
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
671
|
+
|
|
672
|
+
var url = __webpack_require__(16);
|
|
673
|
+
var URL = url.URL;
|
|
674
|
+
var http = __webpack_require__(611);
|
|
675
|
+
var https = __webpack_require__(692);
|
|
676
|
+
var Writable = (__webpack_require__(203).Writable);
|
|
677
|
+
var assert = __webpack_require__(613);
|
|
678
|
+
var debug = __webpack_require__(507);
|
|
679
|
+
|
|
680
|
+
// Preventive platform detection
|
|
681
|
+
// istanbul ignore next
|
|
682
|
+
(function detectUnsupportedEnvironment() {
|
|
683
|
+
var looksLikeNode = typeof process !== "undefined";
|
|
684
|
+
var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
685
|
+
var looksLikeV8 = isFunction(Error.captureStackTrace);
|
|
686
|
+
if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
|
|
687
|
+
console.warn("The follow-redirects package should be excluded from browser builds.");
|
|
688
|
+
}
|
|
689
|
+
}());
|
|
690
|
+
|
|
691
|
+
// Whether to use the native URL object or the legacy url module
|
|
692
|
+
var useNativeURL = false;
|
|
693
|
+
try {
|
|
694
|
+
assert(new URL(""));
|
|
695
|
+
}
|
|
696
|
+
catch (error) {
|
|
697
|
+
useNativeURL = error.code === "ERR_INVALID_URL";
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// URL fields to preserve in copy operations
|
|
701
|
+
var preservedUrlFields = [
|
|
702
|
+
"auth",
|
|
703
|
+
"host",
|
|
704
|
+
"hostname",
|
|
705
|
+
"href",
|
|
706
|
+
"path",
|
|
707
|
+
"pathname",
|
|
708
|
+
"port",
|
|
709
|
+
"protocol",
|
|
710
|
+
"query",
|
|
711
|
+
"search",
|
|
712
|
+
"hash",
|
|
713
|
+
];
|
|
714
|
+
|
|
715
|
+
// Create handlers that pass events from native requests
|
|
716
|
+
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
|
717
|
+
var eventHandlers = Object.create(null);
|
|
718
|
+
events.forEach(function (event) {
|
|
719
|
+
eventHandlers[event] = function (arg1, arg2, arg3) {
|
|
720
|
+
this._redirectable.emit(event, arg1, arg2, arg3);
|
|
721
|
+
};
|
|
722
|
+
});
|
|
723
|
+
|
|
724
|
+
// Error types with codes
|
|
725
|
+
var InvalidUrlError = createErrorType(
|
|
726
|
+
"ERR_INVALID_URL",
|
|
727
|
+
"Invalid URL",
|
|
728
|
+
TypeError
|
|
729
|
+
);
|
|
730
|
+
var RedirectionError = createErrorType(
|
|
731
|
+
"ERR_FR_REDIRECTION_FAILURE",
|
|
732
|
+
"Redirected request failed"
|
|
733
|
+
);
|
|
734
|
+
var TooManyRedirectsError = createErrorType(
|
|
735
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
736
|
+
"Maximum number of redirects exceeded",
|
|
737
|
+
RedirectionError
|
|
738
|
+
);
|
|
739
|
+
var MaxBodyLengthExceededError = createErrorType(
|
|
740
|
+
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
741
|
+
"Request body larger than maxBodyLength limit"
|
|
742
|
+
);
|
|
743
|
+
var WriteAfterEndError = createErrorType(
|
|
744
|
+
"ERR_STREAM_WRITE_AFTER_END",
|
|
745
|
+
"write after end"
|
|
746
|
+
);
|
|
747
|
+
|
|
748
|
+
// istanbul ignore next
|
|
749
|
+
var destroy = Writable.prototype.destroy || noop;
|
|
750
|
+
|
|
751
|
+
// An HTTP(S) request that can be redirected
|
|
752
|
+
function RedirectableRequest(options, responseCallback) {
|
|
753
|
+
// Initialize the request
|
|
754
|
+
Writable.call(this);
|
|
755
|
+
this._sanitizeOptions(options);
|
|
756
|
+
this._options = options;
|
|
757
|
+
this._ended = false;
|
|
758
|
+
this._ending = false;
|
|
759
|
+
this._redirectCount = 0;
|
|
760
|
+
this._redirects = [];
|
|
761
|
+
this._requestBodyLength = 0;
|
|
762
|
+
this._requestBodyBuffers = [];
|
|
763
|
+
|
|
764
|
+
// Attach a callback if passed
|
|
765
|
+
if (responseCallback) {
|
|
766
|
+
this.on("response", responseCallback);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
// React to responses of native requests
|
|
770
|
+
var self = this;
|
|
771
|
+
this._onNativeResponse = function (response) {
|
|
772
|
+
try {
|
|
773
|
+
self._processResponse(response);
|
|
774
|
+
}
|
|
775
|
+
catch (cause) {
|
|
776
|
+
self.emit("error", cause instanceof RedirectionError ?
|
|
777
|
+
cause : new RedirectionError({ cause: cause }));
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
// Perform the first request
|
|
782
|
+
this._performRequest();
|
|
783
|
+
}
|
|
784
|
+
RedirectableRequest.prototype = Object.create(Writable.prototype);
|
|
785
|
+
|
|
786
|
+
RedirectableRequest.prototype.abort = function () {
|
|
787
|
+
destroyRequest(this._currentRequest);
|
|
788
|
+
this._currentRequest.abort();
|
|
789
|
+
this.emit("abort");
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
RedirectableRequest.prototype.destroy = function (error) {
|
|
793
|
+
destroyRequest(this._currentRequest, error);
|
|
794
|
+
destroy.call(this, error);
|
|
795
|
+
return this;
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
// Writes buffered data to the current native request
|
|
799
|
+
RedirectableRequest.prototype.write = function (data, encoding, callback) {
|
|
800
|
+
// Writing is not allowed if end has been called
|
|
801
|
+
if (this._ending) {
|
|
802
|
+
throw new WriteAfterEndError();
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
// Validate input and shift parameters if necessary
|
|
806
|
+
if (!isString(data) && !isBuffer(data)) {
|
|
807
|
+
throw new TypeError("data should be a string, Buffer or Uint8Array");
|
|
808
|
+
}
|
|
809
|
+
if (isFunction(encoding)) {
|
|
810
|
+
callback = encoding;
|
|
811
|
+
encoding = null;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// Ignore empty buffers, since writing them doesn't invoke the callback
|
|
815
|
+
// https://github.com/nodejs/node/issues/22066
|
|
816
|
+
if (data.length === 0) {
|
|
817
|
+
if (callback) {
|
|
818
|
+
callback();
|
|
819
|
+
}
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
// Only write when we don't exceed the maximum body length
|
|
823
|
+
if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
|
|
824
|
+
this._requestBodyLength += data.length;
|
|
825
|
+
this._requestBodyBuffers.push({ data: data, encoding: encoding });
|
|
826
|
+
this._currentRequest.write(data, encoding, callback);
|
|
827
|
+
}
|
|
828
|
+
// Error when we exceed the maximum body length
|
|
829
|
+
else {
|
|
830
|
+
this.emit("error", new MaxBodyLengthExceededError());
|
|
831
|
+
this.abort();
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
|
|
835
|
+
// Ends the current native request
|
|
836
|
+
RedirectableRequest.prototype.end = function (data, encoding, callback) {
|
|
837
|
+
// Shift parameters if necessary
|
|
838
|
+
if (isFunction(data)) {
|
|
839
|
+
callback = data;
|
|
840
|
+
data = encoding = null;
|
|
841
|
+
}
|
|
842
|
+
else if (isFunction(encoding)) {
|
|
843
|
+
callback = encoding;
|
|
844
|
+
encoding = null;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
// Write data if needed and end
|
|
848
|
+
if (!data) {
|
|
849
|
+
this._ended = this._ending = true;
|
|
850
|
+
this._currentRequest.end(null, null, callback);
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
var self = this;
|
|
854
|
+
var currentRequest = this._currentRequest;
|
|
855
|
+
this.write(data, encoding, function () {
|
|
856
|
+
self._ended = true;
|
|
857
|
+
currentRequest.end(null, null, callback);
|
|
858
|
+
});
|
|
859
|
+
this._ending = true;
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
// Sets a header value on the current native request
|
|
864
|
+
RedirectableRequest.prototype.setHeader = function (name, value) {
|
|
865
|
+
this._options.headers[name] = value;
|
|
866
|
+
this._currentRequest.setHeader(name, value);
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
// Clears a header value on the current native request
|
|
870
|
+
RedirectableRequest.prototype.removeHeader = function (name) {
|
|
871
|
+
delete this._options.headers[name];
|
|
872
|
+
this._currentRequest.removeHeader(name);
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
// Global timeout for all underlying requests
|
|
876
|
+
RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
|
|
877
|
+
var self = this;
|
|
878
|
+
|
|
879
|
+
// Destroys the socket on timeout
|
|
880
|
+
function destroyOnTimeout(socket) {
|
|
881
|
+
socket.setTimeout(msecs);
|
|
882
|
+
socket.removeListener("timeout", socket.destroy);
|
|
883
|
+
socket.addListener("timeout", socket.destroy);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
// Sets up a timer to trigger a timeout event
|
|
887
|
+
function startTimer(socket) {
|
|
888
|
+
if (self._timeout) {
|
|
889
|
+
clearTimeout(self._timeout);
|
|
890
|
+
}
|
|
891
|
+
self._timeout = setTimeout(function () {
|
|
892
|
+
self.emit("timeout");
|
|
893
|
+
clearTimer();
|
|
894
|
+
}, msecs);
|
|
895
|
+
destroyOnTimeout(socket);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// Stops a timeout from triggering
|
|
899
|
+
function clearTimer() {
|
|
900
|
+
// Clear the timeout
|
|
901
|
+
if (self._timeout) {
|
|
902
|
+
clearTimeout(self._timeout);
|
|
903
|
+
self._timeout = null;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// Clean up all attached listeners
|
|
907
|
+
self.removeListener("abort", clearTimer);
|
|
908
|
+
self.removeListener("error", clearTimer);
|
|
909
|
+
self.removeListener("response", clearTimer);
|
|
910
|
+
self.removeListener("close", clearTimer);
|
|
911
|
+
if (callback) {
|
|
912
|
+
self.removeListener("timeout", callback);
|
|
913
|
+
}
|
|
914
|
+
if (!self.socket) {
|
|
915
|
+
self._currentRequest.removeListener("socket", startTimer);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
// Attach callback if passed
|
|
920
|
+
if (callback) {
|
|
921
|
+
this.on("timeout", callback);
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
// Start the timer if or when the socket is opened
|
|
925
|
+
if (this.socket) {
|
|
926
|
+
startTimer(this.socket);
|
|
927
|
+
}
|
|
928
|
+
else {
|
|
929
|
+
this._currentRequest.once("socket", startTimer);
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
// Clean up on events
|
|
933
|
+
this.on("socket", destroyOnTimeout);
|
|
934
|
+
this.on("abort", clearTimer);
|
|
935
|
+
this.on("error", clearTimer);
|
|
936
|
+
this.on("response", clearTimer);
|
|
937
|
+
this.on("close", clearTimer);
|
|
938
|
+
|
|
939
|
+
return this;
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
// Proxy all other public ClientRequest methods
|
|
943
|
+
[
|
|
944
|
+
"flushHeaders", "getHeader",
|
|
945
|
+
"setNoDelay", "setSocketKeepAlive",
|
|
946
|
+
].forEach(function (method) {
|
|
947
|
+
RedirectableRequest.prototype[method] = function (a, b) {
|
|
948
|
+
return this._currentRequest[method](a, b);
|
|
949
|
+
};
|
|
950
|
+
});
|
|
951
|
+
|
|
952
|
+
// Proxy all public ClientRequest properties
|
|
953
|
+
["aborted", "connection", "socket"].forEach(function (property) {
|
|
954
|
+
Object.defineProperty(RedirectableRequest.prototype, property, {
|
|
955
|
+
get: function () { return this._currentRequest[property]; },
|
|
956
|
+
});
|
|
957
|
+
});
|
|
958
|
+
|
|
959
|
+
RedirectableRequest.prototype._sanitizeOptions = function (options) {
|
|
960
|
+
// Ensure headers are always present
|
|
961
|
+
if (!options.headers) {
|
|
962
|
+
options.headers = {};
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
// Since http.request treats host as an alias of hostname,
|
|
966
|
+
// but the url module interprets host as hostname plus port,
|
|
967
|
+
// eliminate the host property to avoid confusion.
|
|
968
|
+
if (options.host) {
|
|
969
|
+
// Use hostname if set, because it has precedence
|
|
970
|
+
if (!options.hostname) {
|
|
971
|
+
options.hostname = options.host;
|
|
972
|
+
}
|
|
973
|
+
delete options.host;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
// Complete the URL object when necessary
|
|
977
|
+
if (!options.pathname && options.path) {
|
|
978
|
+
var searchPos = options.path.indexOf("?");
|
|
979
|
+
if (searchPos < 0) {
|
|
980
|
+
options.pathname = options.path;
|
|
981
|
+
}
|
|
982
|
+
else {
|
|
983
|
+
options.pathname = options.path.substring(0, searchPos);
|
|
984
|
+
options.search = options.path.substring(searchPos);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
// Executes the next native request (initial or redirect)
|
|
991
|
+
RedirectableRequest.prototype._performRequest = function () {
|
|
992
|
+
// Load the native protocol
|
|
993
|
+
var protocol = this._options.protocol;
|
|
994
|
+
var nativeProtocol = this._options.nativeProtocols[protocol];
|
|
995
|
+
if (!nativeProtocol) {
|
|
996
|
+
throw new TypeError("Unsupported protocol " + protocol);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
// If specified, use the agent corresponding to the protocol
|
|
1000
|
+
// (HTTP and HTTPS use different types of agents)
|
|
1001
|
+
if (this._options.agents) {
|
|
1002
|
+
var scheme = protocol.slice(0, -1);
|
|
1003
|
+
this._options.agent = this._options.agents[scheme];
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// Create the native request and set up its event handlers
|
|
1007
|
+
var request = this._currentRequest =
|
|
1008
|
+
nativeProtocol.request(this._options, this._onNativeResponse);
|
|
1009
|
+
request._redirectable = this;
|
|
1010
|
+
for (var event of events) {
|
|
1011
|
+
request.on(event, eventHandlers[event]);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
// RFC7230§5.3.1: When making a request directly to an origin server, […]
|
|
1015
|
+
// a client MUST send only the absolute path […] as the request-target.
|
|
1016
|
+
this._currentUrl = /^\//.test(this._options.path) ?
|
|
1017
|
+
url.format(this._options) :
|
|
1018
|
+
// When making a request to a proxy, […]
|
|
1019
|
+
// a client MUST send the target URI in absolute-form […].
|
|
1020
|
+
this._options.path;
|
|
1021
|
+
|
|
1022
|
+
// End a redirected request
|
|
1023
|
+
// (The first request must be ended explicitly with RedirectableRequest#end)
|
|
1024
|
+
if (this._isRedirect) {
|
|
1025
|
+
// Write the request entity and end
|
|
1026
|
+
var i = 0;
|
|
1027
|
+
var self = this;
|
|
1028
|
+
var buffers = this._requestBodyBuffers;
|
|
1029
|
+
(function writeNext(error) {
|
|
1030
|
+
// Only write if this request has not been redirected yet
|
|
1031
|
+
// istanbul ignore else
|
|
1032
|
+
if (request === self._currentRequest) {
|
|
1033
|
+
// Report any write errors
|
|
1034
|
+
// istanbul ignore if
|
|
1035
|
+
if (error) {
|
|
1036
|
+
self.emit("error", error);
|
|
1037
|
+
}
|
|
1038
|
+
// Write the next buffer if there are still left
|
|
1039
|
+
else if (i < buffers.length) {
|
|
1040
|
+
var buffer = buffers[i++];
|
|
1041
|
+
// istanbul ignore else
|
|
1042
|
+
if (!request.finished) {
|
|
1043
|
+
request.write(buffer.data, buffer.encoding, writeNext);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
// End the request if `end` has been called on us
|
|
1047
|
+
else if (self._ended) {
|
|
1048
|
+
request.end();
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
}());
|
|
1052
|
+
}
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
// Processes a response from the current native request
|
|
1056
|
+
RedirectableRequest.prototype._processResponse = function (response) {
|
|
1057
|
+
// Store the redirected response
|
|
1058
|
+
var statusCode = response.statusCode;
|
|
1059
|
+
if (this._options.trackRedirects) {
|
|
1060
|
+
this._redirects.push({
|
|
1061
|
+
url: this._currentUrl,
|
|
1062
|
+
headers: response.headers,
|
|
1063
|
+
statusCode: statusCode,
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
// RFC7231§6.4: The 3xx (Redirection) class of status code indicates
|
|
1068
|
+
// that further action needs to be taken by the user agent in order to
|
|
1069
|
+
// fulfill the request. If a Location header field is provided,
|
|
1070
|
+
// the user agent MAY automatically redirect its request to the URI
|
|
1071
|
+
// referenced by the Location field value,
|
|
1072
|
+
// even if the specific status code is not understood.
|
|
1073
|
+
|
|
1074
|
+
// If the response is not a redirect; return it as-is
|
|
1075
|
+
var location = response.headers.location;
|
|
1076
|
+
if (!location || this._options.followRedirects === false ||
|
|
1077
|
+
statusCode < 300 || statusCode >= 400) {
|
|
1078
|
+
response.responseUrl = this._currentUrl;
|
|
1079
|
+
response.redirects = this._redirects;
|
|
1080
|
+
this.emit("response", response);
|
|
1081
|
+
|
|
1082
|
+
// Clean up
|
|
1083
|
+
this._requestBodyBuffers = [];
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
// The response is a redirect, so abort the current request
|
|
1088
|
+
destroyRequest(this._currentRequest);
|
|
1089
|
+
// Discard the remainder of the response to avoid waiting for data
|
|
1090
|
+
response.destroy();
|
|
1091
|
+
|
|
1092
|
+
// RFC7231§6.4: A client SHOULD detect and intervene
|
|
1093
|
+
// in cyclical redirections (i.e., "infinite" redirection loops).
|
|
1094
|
+
if (++this._redirectCount > this._options.maxRedirects) {
|
|
1095
|
+
throw new TooManyRedirectsError();
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
// Store the request headers if applicable
|
|
1099
|
+
var requestHeaders;
|
|
1100
|
+
var beforeRedirect = this._options.beforeRedirect;
|
|
1101
|
+
if (beforeRedirect) {
|
|
1102
|
+
requestHeaders = Object.assign({
|
|
1103
|
+
// The Host header was set by nativeProtocol.request
|
|
1104
|
+
Host: response.req.getHeader("host"),
|
|
1105
|
+
}, this._options.headers);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
// RFC7231§6.4: Automatic redirection needs to done with
|
|
1109
|
+
// care for methods not known to be safe, […]
|
|
1110
|
+
// RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
|
|
1111
|
+
// the request method from POST to GET for the subsequent request.
|
|
1112
|
+
var method = this._options.method;
|
|
1113
|
+
if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
|
|
1114
|
+
// RFC7231§6.4.4: The 303 (See Other) status code indicates that
|
|
1115
|
+
// the server is redirecting the user agent to a different resource […]
|
|
1116
|
+
// A user agent can perform a retrieval request targeting that URI
|
|
1117
|
+
// (a GET or HEAD request if using HTTP) […]
|
|
1118
|
+
(statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
|
|
1119
|
+
this._options.method = "GET";
|
|
1120
|
+
// Drop a possible entity and headers related to it
|
|
1121
|
+
this._requestBodyBuffers = [];
|
|
1122
|
+
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// Drop the Host header, as the redirect might lead to a different host
|
|
1126
|
+
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
1127
|
+
|
|
1128
|
+
// If the redirect is relative, carry over the host of the last request
|
|
1129
|
+
var currentUrlParts = parseUrl(this._currentUrl);
|
|
1130
|
+
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
1131
|
+
var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
|
|
1132
|
+
url.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
1133
|
+
|
|
1134
|
+
// Create the redirected request
|
|
1135
|
+
var redirectUrl = resolveUrl(location, currentUrl);
|
|
1136
|
+
debug("redirecting to", redirectUrl.href);
|
|
1137
|
+
this._isRedirect = true;
|
|
1138
|
+
spreadUrlObject(redirectUrl, this._options);
|
|
1139
|
+
|
|
1140
|
+
// Drop confidential headers when redirecting to a less secure protocol
|
|
1141
|
+
// or to a different domain that is not a superdomain
|
|
1142
|
+
if (redirectUrl.protocol !== currentUrlParts.protocol &&
|
|
1143
|
+
redirectUrl.protocol !== "https:" ||
|
|
1144
|
+
redirectUrl.host !== currentHost &&
|
|
1145
|
+
!isSubdomain(redirectUrl.host, currentHost)) {
|
|
1146
|
+
removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// Evaluate the beforeRedirect callback
|
|
1150
|
+
if (isFunction(beforeRedirect)) {
|
|
1151
|
+
var responseDetails = {
|
|
1152
|
+
headers: response.headers,
|
|
1153
|
+
statusCode: statusCode,
|
|
1154
|
+
};
|
|
1155
|
+
var requestDetails = {
|
|
1156
|
+
url: currentUrl,
|
|
1157
|
+
method: method,
|
|
1158
|
+
headers: requestHeaders,
|
|
1159
|
+
};
|
|
1160
|
+
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
1161
|
+
this._sanitizeOptions(this._options);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// Perform the redirected request
|
|
1165
|
+
this._performRequest();
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
// Wraps the key/value object of protocols with redirect functionality
|
|
1169
|
+
function wrap(protocols) {
|
|
1170
|
+
// Default settings
|
|
1171
|
+
var exports = {
|
|
1172
|
+
maxRedirects: 21,
|
|
1173
|
+
maxBodyLength: 10 * 1024 * 1024,
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
// Wrap each protocol
|
|
1177
|
+
var nativeProtocols = {};
|
|
1178
|
+
Object.keys(protocols).forEach(function (scheme) {
|
|
1179
|
+
var protocol = scheme + ":";
|
|
1180
|
+
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
|
1181
|
+
var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
|
|
1182
|
+
|
|
1183
|
+
// Executes a request, following redirects
|
|
1184
|
+
function request(input, options, callback) {
|
|
1185
|
+
// Parse parameters, ensuring that input is an object
|
|
1186
|
+
if (isURL(input)) {
|
|
1187
|
+
input = spreadUrlObject(input);
|
|
1188
|
+
}
|
|
1189
|
+
else if (isString(input)) {
|
|
1190
|
+
input = spreadUrlObject(parseUrl(input));
|
|
1191
|
+
}
|
|
1192
|
+
else {
|
|
1193
|
+
callback = options;
|
|
1194
|
+
options = validateUrl(input);
|
|
1195
|
+
input = { protocol: protocol };
|
|
1196
|
+
}
|
|
1197
|
+
if (isFunction(options)) {
|
|
1198
|
+
callback = options;
|
|
1199
|
+
options = null;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
// Set defaults
|
|
1203
|
+
options = Object.assign({
|
|
1204
|
+
maxRedirects: exports.maxRedirects,
|
|
1205
|
+
maxBodyLength: exports.maxBodyLength,
|
|
1206
|
+
}, input, options);
|
|
1207
|
+
options.nativeProtocols = nativeProtocols;
|
|
1208
|
+
if (!isString(options.host) && !isString(options.hostname)) {
|
|
1209
|
+
options.hostname = "::1";
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
assert.equal(options.protocol, protocol, "protocol mismatch");
|
|
1213
|
+
debug("options", options);
|
|
1214
|
+
return new RedirectableRequest(options, callback);
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
// Executes a GET request, following redirects
|
|
1218
|
+
function get(input, options, callback) {
|
|
1219
|
+
var wrappedRequest = wrappedProtocol.request(input, options, callback);
|
|
1220
|
+
wrappedRequest.end();
|
|
1221
|
+
return wrappedRequest;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
// Expose the properties on the wrapped protocol
|
|
1225
|
+
Object.defineProperties(wrappedProtocol, {
|
|
1226
|
+
request: { value: request, configurable: true, enumerable: true, writable: true },
|
|
1227
|
+
get: { value: get, configurable: true, enumerable: true, writable: true },
|
|
1228
|
+
});
|
|
1229
|
+
});
|
|
1230
|
+
return exports;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
function noop() { /* empty */ }
|
|
1234
|
+
|
|
1235
|
+
function parseUrl(input) {
|
|
1236
|
+
var parsed;
|
|
1237
|
+
// istanbul ignore else
|
|
1238
|
+
if (useNativeURL) {
|
|
1239
|
+
parsed = new URL(input);
|
|
1240
|
+
}
|
|
1241
|
+
else {
|
|
1242
|
+
// Ensure the URL is valid and absolute
|
|
1243
|
+
parsed = validateUrl(url.parse(input));
|
|
1244
|
+
if (!isString(parsed.protocol)) {
|
|
1245
|
+
throw new InvalidUrlError({ input });
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
return parsed;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
function resolveUrl(relative, base) {
|
|
1252
|
+
// istanbul ignore next
|
|
1253
|
+
return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
function validateUrl(input) {
|
|
1257
|
+
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
1258
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
1259
|
+
}
|
|
1260
|
+
if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
|
|
1261
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
1262
|
+
}
|
|
1263
|
+
return input;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
function spreadUrlObject(urlObject, target) {
|
|
1267
|
+
var spread = target || {};
|
|
1268
|
+
for (var key of preservedUrlFields) {
|
|
1269
|
+
spread[key] = urlObject[key];
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
// Fix IPv6 hostname
|
|
1273
|
+
if (spread.hostname.startsWith("[")) {
|
|
1274
|
+
spread.hostname = spread.hostname.slice(1, -1);
|
|
1275
|
+
}
|
|
1276
|
+
// Ensure port is a number
|
|
1277
|
+
if (spread.port !== "") {
|
|
1278
|
+
spread.port = Number(spread.port);
|
|
1279
|
+
}
|
|
1280
|
+
// Concatenate path
|
|
1281
|
+
spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
|
|
1282
|
+
|
|
1283
|
+
return spread;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
function removeMatchingHeaders(regex, headers) {
|
|
1287
|
+
var lastValue;
|
|
1288
|
+
for (var header in headers) {
|
|
1289
|
+
if (regex.test(header)) {
|
|
1290
|
+
lastValue = headers[header];
|
|
1291
|
+
delete headers[header];
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
return (lastValue === null || typeof lastValue === "undefined") ?
|
|
1295
|
+
undefined : String(lastValue).trim();
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
function createErrorType(code, message, baseClass) {
|
|
1299
|
+
// Create constructor
|
|
1300
|
+
function CustomError(properties) {
|
|
1301
|
+
// istanbul ignore else
|
|
1302
|
+
if (isFunction(Error.captureStackTrace)) {
|
|
1303
|
+
Error.captureStackTrace(this, this.constructor);
|
|
1304
|
+
}
|
|
1305
|
+
Object.assign(this, properties || {});
|
|
1306
|
+
this.code = code;
|
|
1307
|
+
this.message = this.cause ? message + ": " + this.cause.message : message;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
// Attach constructor and set default properties
|
|
1311
|
+
CustomError.prototype = new (baseClass || Error)();
|
|
1312
|
+
Object.defineProperties(CustomError.prototype, {
|
|
1313
|
+
constructor: {
|
|
1314
|
+
value: CustomError,
|
|
1315
|
+
enumerable: false,
|
|
1316
|
+
},
|
|
1317
|
+
name: {
|
|
1318
|
+
value: "Error [" + code + "]",
|
|
1319
|
+
enumerable: false,
|
|
1320
|
+
},
|
|
1321
|
+
});
|
|
1322
|
+
return CustomError;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
function destroyRequest(request, error) {
|
|
1326
|
+
for (var event of events) {
|
|
1327
|
+
request.removeListener(event, eventHandlers[event]);
|
|
1328
|
+
}
|
|
1329
|
+
request.on("error", noop);
|
|
1330
|
+
request.destroy(error);
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
function isSubdomain(subdomain, domain) {
|
|
1334
|
+
assert(isString(subdomain) && isString(domain));
|
|
1335
|
+
var dot = subdomain.length - domain.length - 1;
|
|
1336
|
+
return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
function isString(value) {
|
|
1340
|
+
return typeof value === "string" || value instanceof String;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
function isFunction(value) {
|
|
1344
|
+
return typeof value === "function";
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
function isBuffer(value) {
|
|
1348
|
+
return typeof value === "object" && ("length" in value);
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
function isURL(value) {
|
|
1352
|
+
return URL && value instanceof URL;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
// Exports
|
|
1356
|
+
module.exports = wrap({ http: http, https: https });
|
|
1357
|
+
module.exports.wrap = wrap;
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
/***/ }),
|
|
1361
|
+
|
|
1362
|
+
/***/ 191:
|
|
1363
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1364
|
+
|
|
1365
|
+
"use strict";
|
|
1366
|
+
|
|
1367
|
+
|
|
1368
|
+
var Cancel = __webpack_require__(928);
|
|
1369
|
+
|
|
1370
|
+
/**
|
|
1371
|
+
* A `CancelToken` is an object that can be used to request cancellation of an operation.
|
|
1372
|
+
*
|
|
1373
|
+
* @class
|
|
1374
|
+
* @param {Function} executor The executor function.
|
|
1375
|
+
*/
|
|
1376
|
+
function CancelToken(executor) {
|
|
1377
|
+
if (typeof executor !== 'function') {
|
|
1378
|
+
throw new TypeError('executor must be a function.');
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
var resolvePromise;
|
|
1382
|
+
|
|
1383
|
+
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
1384
|
+
resolvePromise = resolve;
|
|
1385
|
+
});
|
|
1386
|
+
|
|
1387
|
+
var token = this;
|
|
1388
|
+
|
|
1389
|
+
// eslint-disable-next-line func-names
|
|
1390
|
+
this.promise.then(function(cancel) {
|
|
1391
|
+
if (!token._listeners) return;
|
|
1392
|
+
|
|
1393
|
+
var i;
|
|
1394
|
+
var l = token._listeners.length;
|
|
1395
|
+
|
|
1396
|
+
for (i = 0; i < l; i++) {
|
|
1397
|
+
token._listeners[i](cancel);
|
|
1398
|
+
}
|
|
1399
|
+
token._listeners = null;
|
|
1400
|
+
});
|
|
1401
|
+
|
|
1402
|
+
// eslint-disable-next-line func-names
|
|
1403
|
+
this.promise.then = function(onfulfilled) {
|
|
1404
|
+
var _resolve;
|
|
1405
|
+
// eslint-disable-next-line func-names
|
|
1406
|
+
var promise = new Promise(function(resolve) {
|
|
1407
|
+
token.subscribe(resolve);
|
|
1408
|
+
_resolve = resolve;
|
|
1409
|
+
}).then(onfulfilled);
|
|
1410
|
+
|
|
1411
|
+
promise.cancel = function reject() {
|
|
1412
|
+
token.unsubscribe(_resolve);
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1415
|
+
return promise;
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
executor(function cancel(message) {
|
|
1419
|
+
if (token.reason) {
|
|
1420
|
+
// Cancellation has already been requested
|
|
1421
|
+
return;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
token.reason = new Cancel(message);
|
|
1425
|
+
resolvePromise(token.reason);
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/**
|
|
1430
|
+
* Throws a `Cancel` if cancellation has been requested.
|
|
1431
|
+
*/
|
|
1432
|
+
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
1433
|
+
if (this.reason) {
|
|
1434
|
+
throw this.reason;
|
|
1435
|
+
}
|
|
1436
|
+
};
|
|
1437
|
+
|
|
1438
|
+
/**
|
|
1439
|
+
* Subscribe to the cancel signal
|
|
1440
|
+
*/
|
|
1441
|
+
|
|
1442
|
+
CancelToken.prototype.subscribe = function subscribe(listener) {
|
|
1443
|
+
if (this.reason) {
|
|
1444
|
+
listener(this.reason);
|
|
1445
|
+
return;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
if (this._listeners) {
|
|
1449
|
+
this._listeners.push(listener);
|
|
1450
|
+
} else {
|
|
1451
|
+
this._listeners = [listener];
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Unsubscribe from the cancel signal
|
|
1457
|
+
*/
|
|
1458
|
+
|
|
1459
|
+
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
|
|
1460
|
+
if (!this._listeners) {
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1463
|
+
var index = this._listeners.indexOf(listener);
|
|
1464
|
+
if (index !== -1) {
|
|
1465
|
+
this._listeners.splice(index, 1);
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
/**
|
|
1470
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
1471
|
+
* cancels the `CancelToken`.
|
|
1472
|
+
*/
|
|
1473
|
+
CancelToken.source = function source() {
|
|
1474
|
+
var cancel;
|
|
1475
|
+
var token = new CancelToken(function executor(c) {
|
|
1476
|
+
cancel = c;
|
|
1477
|
+
});
|
|
1478
|
+
return {
|
|
1479
|
+
token: token,
|
|
1480
|
+
cancel: cancel
|
|
1481
|
+
};
|
|
1482
|
+
};
|
|
1483
|
+
|
|
1484
|
+
module.exports = CancelToken;
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
/***/ }),
|
|
1488
|
+
|
|
1489
|
+
/***/ 202:
|
|
1490
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1491
|
+
|
|
1492
|
+
"use strict";
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
var utils = __webpack_require__(516);
|
|
1496
|
+
|
|
1497
|
+
module.exports = (
|
|
1498
|
+
utils.isStandardBrowserEnv() ?
|
|
1499
|
+
|
|
1500
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
1501
|
+
// whether the request URL is of the same origin as current location.
|
|
1502
|
+
(function standardBrowserEnv() {
|
|
1503
|
+
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
1504
|
+
var urlParsingNode = document.createElement('a');
|
|
1505
|
+
var originURL;
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* Parse a URL to discover it's components
|
|
1509
|
+
*
|
|
1510
|
+
* @param {String} url The URL to be parsed
|
|
1511
|
+
* @returns {Object}
|
|
1512
|
+
*/
|
|
1513
|
+
function resolveURL(url) {
|
|
1514
|
+
var href = url;
|
|
1515
|
+
|
|
1516
|
+
if (msie) {
|
|
1517
|
+
// IE needs attribute set twice to normalize properties
|
|
1518
|
+
urlParsingNode.setAttribute('href', href);
|
|
1519
|
+
href = urlParsingNode.href;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
urlParsingNode.setAttribute('href', href);
|
|
1523
|
+
|
|
1524
|
+
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
|
1525
|
+
return {
|
|
1526
|
+
href: urlParsingNode.href,
|
|
1527
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
|
1528
|
+
host: urlParsingNode.host,
|
|
1529
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
|
1530
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
|
1531
|
+
hostname: urlParsingNode.hostname,
|
|
1532
|
+
port: urlParsingNode.port,
|
|
1533
|
+
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
|
1534
|
+
urlParsingNode.pathname :
|
|
1535
|
+
'/' + urlParsingNode.pathname
|
|
1536
|
+
};
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
originURL = resolveURL(window.location.href);
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* Determine if a URL shares the same origin as the current location
|
|
1543
|
+
*
|
|
1544
|
+
* @param {String} requestURL The URL to test
|
|
1545
|
+
* @returns {boolean} True if URL shares the same origin, otherwise false
|
|
1546
|
+
*/
|
|
1547
|
+
return function isURLSameOrigin(requestURL) {
|
|
1548
|
+
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
|
1549
|
+
return (parsed.protocol === originURL.protocol &&
|
|
1550
|
+
parsed.host === originURL.host);
|
|
1551
|
+
};
|
|
1552
|
+
})() :
|
|
1553
|
+
|
|
1554
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
1555
|
+
(function nonStandardBrowserEnv() {
|
|
1556
|
+
return function isURLSameOrigin() {
|
|
1557
|
+
return true;
|
|
1558
|
+
};
|
|
1559
|
+
})()
|
|
1560
|
+
);
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
/***/ }),
|
|
1564
|
+
|
|
1565
|
+
/***/ 203:
|
|
1566
|
+
/***/ ((module) => {
|
|
1567
|
+
|
|
1568
|
+
"use strict";
|
|
1569
|
+
module.exports = require("stream");
|
|
1570
|
+
|
|
1571
|
+
/***/ }),
|
|
1572
|
+
|
|
1573
|
+
/***/ 343:
|
|
1574
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1575
|
+
|
|
1576
|
+
"use strict";
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
var utils = __webpack_require__(516);
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* Config-specific merge-function which creates a new config-object
|
|
1583
|
+
* by merging two configuration objects together.
|
|
1584
|
+
*
|
|
1585
|
+
* @param {Object} config1
|
|
1586
|
+
* @param {Object} config2
|
|
1587
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
|
1588
|
+
*/
|
|
1589
|
+
module.exports = function mergeConfig(config1, config2) {
|
|
1590
|
+
// eslint-disable-next-line no-param-reassign
|
|
1591
|
+
config2 = config2 || {};
|
|
1592
|
+
var config = {};
|
|
1593
|
+
|
|
1594
|
+
function getMergedValue(target, source) {
|
|
1595
|
+
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
1596
|
+
return utils.merge(target, source);
|
|
1597
|
+
} else if (utils.isPlainObject(source)) {
|
|
1598
|
+
return utils.merge({}, source);
|
|
1599
|
+
} else if (utils.isArray(source)) {
|
|
1600
|
+
return source.slice();
|
|
1601
|
+
}
|
|
1602
|
+
return source;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
// eslint-disable-next-line consistent-return
|
|
1606
|
+
function mergeDeepProperties(prop) {
|
|
1607
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
1608
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
1609
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
|
1610
|
+
return getMergedValue(undefined, config1[prop]);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
// eslint-disable-next-line consistent-return
|
|
1615
|
+
function valueFromConfig2(prop) {
|
|
1616
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
1617
|
+
return getMergedValue(undefined, config2[prop]);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
// eslint-disable-next-line consistent-return
|
|
1622
|
+
function defaultToConfig2(prop) {
|
|
1623
|
+
if (!utils.isUndefined(config2[prop])) {
|
|
1624
|
+
return getMergedValue(undefined, config2[prop]);
|
|
1625
|
+
} else if (!utils.isUndefined(config1[prop])) {
|
|
1626
|
+
return getMergedValue(undefined, config1[prop]);
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
// eslint-disable-next-line consistent-return
|
|
1631
|
+
function mergeDirectKeys(prop) {
|
|
1632
|
+
if (prop in config2) {
|
|
1633
|
+
return getMergedValue(config1[prop], config2[prop]);
|
|
1634
|
+
} else if (prop in config1) {
|
|
1635
|
+
return getMergedValue(undefined, config1[prop]);
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
var mergeMap = {
|
|
1640
|
+
'url': valueFromConfig2,
|
|
1641
|
+
'method': valueFromConfig2,
|
|
1642
|
+
'data': valueFromConfig2,
|
|
1643
|
+
'baseURL': defaultToConfig2,
|
|
1644
|
+
'transformRequest': defaultToConfig2,
|
|
1645
|
+
'transformResponse': defaultToConfig2,
|
|
1646
|
+
'paramsSerializer': defaultToConfig2,
|
|
1647
|
+
'timeout': defaultToConfig2,
|
|
1648
|
+
'timeoutMessage': defaultToConfig2,
|
|
1649
|
+
'withCredentials': defaultToConfig2,
|
|
1650
|
+
'adapter': defaultToConfig2,
|
|
1651
|
+
'responseType': defaultToConfig2,
|
|
1652
|
+
'xsrfCookieName': defaultToConfig2,
|
|
1653
|
+
'xsrfHeaderName': defaultToConfig2,
|
|
1654
|
+
'onUploadProgress': defaultToConfig2,
|
|
1655
|
+
'onDownloadProgress': defaultToConfig2,
|
|
1656
|
+
'decompress': defaultToConfig2,
|
|
1657
|
+
'maxContentLength': defaultToConfig2,
|
|
1658
|
+
'maxBodyLength': defaultToConfig2,
|
|
1659
|
+
'transport': defaultToConfig2,
|
|
1660
|
+
'httpAgent': defaultToConfig2,
|
|
1661
|
+
'httpsAgent': defaultToConfig2,
|
|
1662
|
+
'cancelToken': defaultToConfig2,
|
|
1663
|
+
'socketPath': defaultToConfig2,
|
|
1664
|
+
'responseEncoding': defaultToConfig2,
|
|
1665
|
+
'validateStatus': mergeDirectKeys
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1668
|
+
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
1669
|
+
var merge = mergeMap[prop] || mergeDeepProperties;
|
|
1670
|
+
var configValue = merge(prop);
|
|
1671
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
1672
|
+
});
|
|
1673
|
+
|
|
1674
|
+
return config;
|
|
1675
|
+
};
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
/***/ }),
|
|
1679
|
+
|
|
1680
|
+
/***/ 449:
|
|
1681
|
+
/***/ ((module) => {
|
|
1682
|
+
|
|
1683
|
+
"use strict";
|
|
1684
|
+
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* Update an Error with the specified config, error code, and response.
|
|
1688
|
+
*
|
|
1689
|
+
* @param {Error} error The error to update.
|
|
1690
|
+
* @param {Object} config The config.
|
|
1691
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
1692
|
+
* @param {Object} [request] The request.
|
|
1693
|
+
* @param {Object} [response] The response.
|
|
1694
|
+
* @returns {Error} The error.
|
|
1695
|
+
*/
|
|
1696
|
+
module.exports = function enhanceError(error, config, code, request, response) {
|
|
1697
|
+
error.config = config;
|
|
1698
|
+
if (code) {
|
|
1699
|
+
error.code = code;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
error.request = request;
|
|
1703
|
+
error.response = response;
|
|
1704
|
+
error.isAxiosError = true;
|
|
1705
|
+
|
|
1706
|
+
error.toJSON = function toJSON() {
|
|
1707
|
+
return {
|
|
1708
|
+
// Standard
|
|
1709
|
+
message: this.message,
|
|
1710
|
+
name: this.name,
|
|
1711
|
+
// Microsoft
|
|
1712
|
+
description: this.description,
|
|
1713
|
+
number: this.number,
|
|
1714
|
+
// Mozilla
|
|
1715
|
+
fileName: this.fileName,
|
|
1716
|
+
lineNumber: this.lineNumber,
|
|
1717
|
+
columnNumber: this.columnNumber,
|
|
1718
|
+
stack: this.stack,
|
|
1719
|
+
// Axios
|
|
1720
|
+
config: this.config,
|
|
1721
|
+
code: this.code,
|
|
1722
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
1723
|
+
};
|
|
1724
|
+
};
|
|
1725
|
+
return error;
|
|
1726
|
+
};
|
|
1727
|
+
|
|
1728
|
+
|
|
1729
|
+
/***/ }),
|
|
1730
|
+
|
|
1731
|
+
/***/ 471:
|
|
1732
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1733
|
+
|
|
1734
|
+
"use strict";
|
|
1735
|
+
|
|
1736
|
+
|
|
1737
|
+
var utils = __webpack_require__(516);
|
|
1738
|
+
|
|
1739
|
+
function InterceptorManager() {
|
|
1740
|
+
this.handlers = [];
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* Add a new interceptor to the stack
|
|
1745
|
+
*
|
|
1746
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
1747
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
1748
|
+
*
|
|
1749
|
+
* @return {Number} An ID used to remove interceptor later
|
|
1750
|
+
*/
|
|
1751
|
+
InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
|
|
1752
|
+
this.handlers.push({
|
|
1753
|
+
fulfilled: fulfilled,
|
|
1754
|
+
rejected: rejected,
|
|
1755
|
+
synchronous: options ? options.synchronous : false,
|
|
1756
|
+
runWhen: options ? options.runWhen : null
|
|
1757
|
+
});
|
|
1758
|
+
return this.handlers.length - 1;
|
|
1759
|
+
};
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* Remove an interceptor from the stack
|
|
1763
|
+
*
|
|
1764
|
+
* @param {Number} id The ID that was returned by `use`
|
|
1765
|
+
*/
|
|
1766
|
+
InterceptorManager.prototype.eject = function eject(id) {
|
|
1767
|
+
if (this.handlers[id]) {
|
|
1768
|
+
this.handlers[id] = null;
|
|
1769
|
+
}
|
|
1770
|
+
};
|
|
1771
|
+
|
|
1772
|
+
/**
|
|
1773
|
+
* Iterate over all the registered interceptors
|
|
1774
|
+
*
|
|
1775
|
+
* This method is particularly useful for skipping over any
|
|
1776
|
+
* interceptors that may have become `null` calling `eject`.
|
|
1777
|
+
*
|
|
1778
|
+
* @param {Function} fn The function to call for each interceptor
|
|
1779
|
+
*/
|
|
1780
|
+
InterceptorManager.prototype.forEach = function forEach(fn) {
|
|
1781
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
|
1782
|
+
if (h !== null) {
|
|
1783
|
+
fn(h);
|
|
1784
|
+
}
|
|
1785
|
+
});
|
|
1786
|
+
};
|
|
1787
|
+
|
|
1788
|
+
module.exports = InterceptorManager;
|
|
1789
|
+
|
|
1790
|
+
|
|
1791
|
+
/***/ }),
|
|
1792
|
+
|
|
1793
|
+
/***/ 490:
|
|
1794
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1795
|
+
|
|
1796
|
+
"use strict";
|
|
1797
|
+
|
|
1798
|
+
|
|
1799
|
+
var utils = __webpack_require__(516);
|
|
1800
|
+
var transformData = __webpack_require__(881);
|
|
1801
|
+
var isCancel = __webpack_require__(864);
|
|
1802
|
+
var defaults = __webpack_require__(987);
|
|
1803
|
+
var Cancel = __webpack_require__(928);
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* Throws a `Cancel` if cancellation has been requested.
|
|
1807
|
+
*/
|
|
1808
|
+
function throwIfCancellationRequested(config) {
|
|
1809
|
+
if (config.cancelToken) {
|
|
1810
|
+
config.cancelToken.throwIfRequested();
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
if (config.signal && config.signal.aborted) {
|
|
1814
|
+
throw new Cancel('canceled');
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
/**
|
|
1819
|
+
* Dispatch a request to the server using the configured adapter.
|
|
1820
|
+
*
|
|
1821
|
+
* @param {object} config The config that is to be used for the request
|
|
1822
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
1823
|
+
*/
|
|
1824
|
+
module.exports = function dispatchRequest(config) {
|
|
1825
|
+
throwIfCancellationRequested(config);
|
|
1826
|
+
|
|
1827
|
+
// Ensure headers exist
|
|
1828
|
+
config.headers = config.headers || {};
|
|
1829
|
+
|
|
1830
|
+
// Transform request data
|
|
1831
|
+
config.data = transformData.call(
|
|
1832
|
+
config,
|
|
1833
|
+
config.data,
|
|
1834
|
+
config.headers,
|
|
1835
|
+
config.transformRequest
|
|
1836
|
+
);
|
|
1837
|
+
|
|
1838
|
+
// Flatten headers
|
|
1839
|
+
config.headers = utils.merge(
|
|
1840
|
+
config.headers.common || {},
|
|
1841
|
+
config.headers[config.method] || {},
|
|
1842
|
+
config.headers
|
|
1843
|
+
);
|
|
1844
|
+
|
|
1845
|
+
utils.forEach(
|
|
1846
|
+
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
1847
|
+
function cleanHeaderConfig(method) {
|
|
1848
|
+
delete config.headers[method];
|
|
1849
|
+
}
|
|
1850
|
+
);
|
|
1851
|
+
|
|
1852
|
+
var adapter = config.adapter || defaults.adapter;
|
|
1853
|
+
|
|
1854
|
+
return adapter(config).then(function onAdapterResolution(response) {
|
|
1855
|
+
throwIfCancellationRequested(config);
|
|
1856
|
+
|
|
1857
|
+
// Transform response data
|
|
1858
|
+
response.data = transformData.call(
|
|
1859
|
+
config,
|
|
1860
|
+
response.data,
|
|
1861
|
+
response.headers,
|
|
1862
|
+
config.transformResponse
|
|
1863
|
+
);
|
|
1864
|
+
|
|
1865
|
+
return response;
|
|
1866
|
+
}, function onAdapterRejection(reason) {
|
|
1867
|
+
if (!isCancel(reason)) {
|
|
1868
|
+
throwIfCancellationRequested(config);
|
|
1869
|
+
|
|
1870
|
+
// Transform response data
|
|
1871
|
+
if (reason && reason.response) {
|
|
1872
|
+
reason.response.data = transformData.call(
|
|
1873
|
+
config,
|
|
1874
|
+
reason.response.data,
|
|
1875
|
+
reason.response.headers,
|
|
1876
|
+
config.transformResponse
|
|
1877
|
+
);
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
return Promise.reject(reason);
|
|
1882
|
+
});
|
|
1883
|
+
};
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
/***/ }),
|
|
1887
|
+
|
|
1888
|
+
/***/ 505:
|
|
1889
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1890
|
+
|
|
1891
|
+
module.exports = __webpack_require__(15);
|
|
1892
|
+
|
|
1893
|
+
/***/ }),
|
|
1894
|
+
|
|
1895
|
+
/***/ 507:
|
|
1896
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1897
|
+
|
|
1898
|
+
var debug;
|
|
1899
|
+
|
|
1900
|
+
module.exports = function () {
|
|
1901
|
+
if (!debug) {
|
|
1902
|
+
try {
|
|
1903
|
+
/* eslint global-require: off */
|
|
1904
|
+
debug = __webpack_require__(753)("follow-redirects");
|
|
1905
|
+
}
|
|
1906
|
+
catch (error) { /* */ }
|
|
1907
|
+
if (typeof debug !== "function") {
|
|
1908
|
+
debug = function () { /* */ };
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
debug.apply(null, arguments);
|
|
1912
|
+
};
|
|
1913
|
+
|
|
1914
|
+
|
|
1915
|
+
/***/ }),
|
|
1916
|
+
|
|
1917
|
+
/***/ 516:
|
|
1918
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1919
|
+
|
|
1920
|
+
"use strict";
|
|
1921
|
+
|
|
1922
|
+
|
|
1923
|
+
var bind = __webpack_require__(12);
|
|
1924
|
+
|
|
1925
|
+
// utils is a library of generic helper functions non-specific to axios
|
|
1926
|
+
|
|
1927
|
+
var toString = Object.prototype.toString;
|
|
1928
|
+
|
|
1929
|
+
/**
|
|
1930
|
+
* Determine if a value is an Array
|
|
1931
|
+
*
|
|
1932
|
+
* @param {Object} val The value to test
|
|
1933
|
+
* @returns {boolean} True if value is an Array, otherwise false
|
|
1934
|
+
*/
|
|
1935
|
+
function isArray(val) {
|
|
1936
|
+
return toString.call(val) === '[object Array]';
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
/**
|
|
1940
|
+
* Determine if a value is undefined
|
|
1941
|
+
*
|
|
1942
|
+
* @param {Object} val The value to test
|
|
1943
|
+
* @returns {boolean} True if the value is undefined, otherwise false
|
|
1944
|
+
*/
|
|
1945
|
+
function isUndefined(val) {
|
|
1946
|
+
return typeof val === 'undefined';
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
/**
|
|
1950
|
+
* Determine if a value is a Buffer
|
|
1951
|
+
*
|
|
1952
|
+
* @param {Object} val The value to test
|
|
1953
|
+
* @returns {boolean} True if value is a Buffer, otherwise false
|
|
1954
|
+
*/
|
|
1955
|
+
function isBuffer(val) {
|
|
1956
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
|
|
1957
|
+
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
/**
|
|
1961
|
+
* Determine if a value is an ArrayBuffer
|
|
1962
|
+
*
|
|
1963
|
+
* @param {Object} val The value to test
|
|
1964
|
+
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
|
1965
|
+
*/
|
|
1966
|
+
function isArrayBuffer(val) {
|
|
1967
|
+
return toString.call(val) === '[object ArrayBuffer]';
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
/**
|
|
1971
|
+
* Determine if a value is a FormData
|
|
1972
|
+
*
|
|
1973
|
+
* @param {Object} val The value to test
|
|
1974
|
+
* @returns {boolean} True if value is an FormData, otherwise false
|
|
1975
|
+
*/
|
|
1976
|
+
function isFormData(val) {
|
|
1977
|
+
return (typeof FormData !== 'undefined') && (val instanceof FormData);
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
/**
|
|
1981
|
+
* Determine if a value is a view on an ArrayBuffer
|
|
1982
|
+
*
|
|
1983
|
+
* @param {Object} val The value to test
|
|
1984
|
+
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
|
1985
|
+
*/
|
|
1986
|
+
function isArrayBufferView(val) {
|
|
1987
|
+
var result;
|
|
1988
|
+
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
|
1989
|
+
result = ArrayBuffer.isView(val);
|
|
1990
|
+
} else {
|
|
1991
|
+
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
|
|
1992
|
+
}
|
|
1993
|
+
return result;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
/**
|
|
1997
|
+
* Determine if a value is a String
|
|
1998
|
+
*
|
|
1999
|
+
* @param {Object} val The value to test
|
|
2000
|
+
* @returns {boolean} True if value is a String, otherwise false
|
|
2001
|
+
*/
|
|
2002
|
+
function isString(val) {
|
|
2003
|
+
return typeof val === 'string';
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* Determine if a value is a Number
|
|
2008
|
+
*
|
|
2009
|
+
* @param {Object} val The value to test
|
|
2010
|
+
* @returns {boolean} True if value is a Number, otherwise false
|
|
2011
|
+
*/
|
|
2012
|
+
function isNumber(val) {
|
|
2013
|
+
return typeof val === 'number';
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
/**
|
|
2017
|
+
* Determine if a value is an Object
|
|
2018
|
+
*
|
|
2019
|
+
* @param {Object} val The value to test
|
|
2020
|
+
* @returns {boolean} True if value is an Object, otherwise false
|
|
2021
|
+
*/
|
|
2022
|
+
function isObject(val) {
|
|
2023
|
+
return val !== null && typeof val === 'object';
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
/**
|
|
2027
|
+
* Determine if a value is a plain Object
|
|
2028
|
+
*
|
|
2029
|
+
* @param {Object} val The value to test
|
|
2030
|
+
* @return {boolean} True if value is a plain Object, otherwise false
|
|
2031
|
+
*/
|
|
2032
|
+
function isPlainObject(val) {
|
|
2033
|
+
if (toString.call(val) !== '[object Object]') {
|
|
2034
|
+
return false;
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
var prototype = Object.getPrototypeOf(val);
|
|
2038
|
+
return prototype === null || prototype === Object.prototype;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
/**
|
|
2042
|
+
* Determine if a value is a Date
|
|
2043
|
+
*
|
|
2044
|
+
* @param {Object} val The value to test
|
|
2045
|
+
* @returns {boolean} True if value is a Date, otherwise false
|
|
2046
|
+
*/
|
|
2047
|
+
function isDate(val) {
|
|
2048
|
+
return toString.call(val) === '[object Date]';
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* Determine if a value is a File
|
|
2053
|
+
*
|
|
2054
|
+
* @param {Object} val The value to test
|
|
2055
|
+
* @returns {boolean} True if value is a File, otherwise false
|
|
2056
|
+
*/
|
|
2057
|
+
function isFile(val) {
|
|
2058
|
+
return toString.call(val) === '[object File]';
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
/**
|
|
2062
|
+
* Determine if a value is a Blob
|
|
2063
|
+
*
|
|
2064
|
+
* @param {Object} val The value to test
|
|
2065
|
+
* @returns {boolean} True if value is a Blob, otherwise false
|
|
2066
|
+
*/
|
|
2067
|
+
function isBlob(val) {
|
|
2068
|
+
return toString.call(val) === '[object Blob]';
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Determine if a value is a Function
|
|
2073
|
+
*
|
|
2074
|
+
* @param {Object} val The value to test
|
|
2075
|
+
* @returns {boolean} True if value is a Function, otherwise false
|
|
2076
|
+
*/
|
|
2077
|
+
function isFunction(val) {
|
|
2078
|
+
return toString.call(val) === '[object Function]';
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
/**
|
|
2082
|
+
* Determine if a value is a Stream
|
|
2083
|
+
*
|
|
2084
|
+
* @param {Object} val The value to test
|
|
2085
|
+
* @returns {boolean} True if value is a Stream, otherwise false
|
|
2086
|
+
*/
|
|
2087
|
+
function isStream(val) {
|
|
2088
|
+
return isObject(val) && isFunction(val.pipe);
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
/**
|
|
2092
|
+
* Determine if a value is a URLSearchParams object
|
|
2093
|
+
*
|
|
2094
|
+
* @param {Object} val The value to test
|
|
2095
|
+
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
|
2096
|
+
*/
|
|
2097
|
+
function isURLSearchParams(val) {
|
|
2098
|
+
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
/**
|
|
2102
|
+
* Trim excess whitespace off the beginning and end of a string
|
|
2103
|
+
*
|
|
2104
|
+
* @param {String} str The String to trim
|
|
2105
|
+
* @returns {String} The String freed of excess whitespace
|
|
2106
|
+
*/
|
|
2107
|
+
function trim(str) {
|
|
2108
|
+
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
/**
|
|
2112
|
+
* Determine if we're running in a standard browser environment
|
|
2113
|
+
*
|
|
2114
|
+
* This allows axios to run in a web worker, and react-native.
|
|
2115
|
+
* Both environments support XMLHttpRequest, but not fully standard globals.
|
|
2116
|
+
*
|
|
2117
|
+
* web workers:
|
|
2118
|
+
* typeof window -> undefined
|
|
2119
|
+
* typeof document -> undefined
|
|
2120
|
+
*
|
|
2121
|
+
* react-native:
|
|
2122
|
+
* navigator.product -> 'ReactNative'
|
|
2123
|
+
* nativescript
|
|
2124
|
+
* navigator.product -> 'NativeScript' or 'NS'
|
|
2125
|
+
*/
|
|
2126
|
+
function isStandardBrowserEnv() {
|
|
2127
|
+
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
|
|
2128
|
+
navigator.product === 'NativeScript' ||
|
|
2129
|
+
navigator.product === 'NS')) {
|
|
2130
|
+
return false;
|
|
2131
|
+
}
|
|
2132
|
+
return (
|
|
2133
|
+
typeof window !== 'undefined' &&
|
|
2134
|
+
typeof document !== 'undefined'
|
|
2135
|
+
);
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
/**
|
|
2139
|
+
* Iterate over an Array or an Object invoking a function for each item.
|
|
2140
|
+
*
|
|
2141
|
+
* If `obj` is an Array callback will be called passing
|
|
2142
|
+
* the value, index, and complete array for each item.
|
|
2143
|
+
*
|
|
2144
|
+
* If 'obj' is an Object callback will be called passing
|
|
2145
|
+
* the value, key, and complete object for each property.
|
|
2146
|
+
*
|
|
2147
|
+
* @param {Object|Array} obj The object to iterate
|
|
2148
|
+
* @param {Function} fn The callback to invoke for each item
|
|
2149
|
+
*/
|
|
2150
|
+
function forEach(obj, fn) {
|
|
2151
|
+
// Don't bother if no value provided
|
|
2152
|
+
if (obj === null || typeof obj === 'undefined') {
|
|
2153
|
+
return;
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
// Force an array if not already something iterable
|
|
2157
|
+
if (typeof obj !== 'object') {
|
|
2158
|
+
/*eslint no-param-reassign:0*/
|
|
2159
|
+
obj = [obj];
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
if (isArray(obj)) {
|
|
2163
|
+
// Iterate over array values
|
|
2164
|
+
for (var i = 0, l = obj.length; i < l; i++) {
|
|
2165
|
+
fn.call(null, obj[i], i, obj);
|
|
2166
|
+
}
|
|
2167
|
+
} else {
|
|
2168
|
+
// Iterate over object keys
|
|
2169
|
+
for (var key in obj) {
|
|
2170
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
2171
|
+
fn.call(null, obj[key], key, obj);
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
/**
|
|
2178
|
+
* Accepts varargs expecting each argument to be an object, then
|
|
2179
|
+
* immutably merges the properties of each object and returns result.
|
|
2180
|
+
*
|
|
2181
|
+
* When multiple objects contain the same key the later object in
|
|
2182
|
+
* the arguments list will take precedence.
|
|
2183
|
+
*
|
|
2184
|
+
* Example:
|
|
2185
|
+
*
|
|
2186
|
+
* ```js
|
|
2187
|
+
* var result = merge({foo: 123}, {foo: 456});
|
|
2188
|
+
* console.log(result.foo); // outputs 456
|
|
2189
|
+
* ```
|
|
2190
|
+
*
|
|
2191
|
+
* @param {Object} obj1 Object to merge
|
|
2192
|
+
* @returns {Object} Result of all merge properties
|
|
2193
|
+
*/
|
|
2194
|
+
function merge(/* obj1, obj2, obj3, ... */) {
|
|
2195
|
+
var result = {};
|
|
2196
|
+
function assignValue(val, key) {
|
|
2197
|
+
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
|
2198
|
+
result[key] = merge(result[key], val);
|
|
2199
|
+
} else if (isPlainObject(val)) {
|
|
2200
|
+
result[key] = merge({}, val);
|
|
2201
|
+
} else if (isArray(val)) {
|
|
2202
|
+
result[key] = val.slice();
|
|
2203
|
+
} else {
|
|
2204
|
+
result[key] = val;
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
2209
|
+
forEach(arguments[i], assignValue);
|
|
2210
|
+
}
|
|
2211
|
+
return result;
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
/**
|
|
2215
|
+
* Extends object a by mutably adding to it the properties of object b.
|
|
2216
|
+
*
|
|
2217
|
+
* @param {Object} a The object to be extended
|
|
2218
|
+
* @param {Object} b The object to copy properties from
|
|
2219
|
+
* @param {Object} thisArg The object to bind function to
|
|
2220
|
+
* @return {Object} The resulting value of object a
|
|
2221
|
+
*/
|
|
2222
|
+
function extend(a, b, thisArg) {
|
|
2223
|
+
forEach(b, function assignValue(val, key) {
|
|
2224
|
+
if (thisArg && typeof val === 'function') {
|
|
2225
|
+
a[key] = bind(val, thisArg);
|
|
2226
|
+
} else {
|
|
2227
|
+
a[key] = val;
|
|
2228
|
+
}
|
|
2229
|
+
});
|
|
2230
|
+
return a;
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
/**
|
|
2234
|
+
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
|
2235
|
+
*
|
|
2236
|
+
* @param {string} content with BOM
|
|
2237
|
+
* @return {string} content value without BOM
|
|
2238
|
+
*/
|
|
2239
|
+
function stripBOM(content) {
|
|
2240
|
+
if (content.charCodeAt(0) === 0xFEFF) {
|
|
2241
|
+
content = content.slice(1);
|
|
2242
|
+
}
|
|
2243
|
+
return content;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
module.exports = {
|
|
2247
|
+
isArray: isArray,
|
|
2248
|
+
isArrayBuffer: isArrayBuffer,
|
|
2249
|
+
isBuffer: isBuffer,
|
|
2250
|
+
isFormData: isFormData,
|
|
2251
|
+
isArrayBufferView: isArrayBufferView,
|
|
2252
|
+
isString: isString,
|
|
2253
|
+
isNumber: isNumber,
|
|
2254
|
+
isObject: isObject,
|
|
2255
|
+
isPlainObject: isPlainObject,
|
|
2256
|
+
isUndefined: isUndefined,
|
|
2257
|
+
isDate: isDate,
|
|
2258
|
+
isFile: isFile,
|
|
2259
|
+
isBlob: isBlob,
|
|
2260
|
+
isFunction: isFunction,
|
|
2261
|
+
isStream: isStream,
|
|
2262
|
+
isURLSearchParams: isURLSearchParams,
|
|
2263
|
+
isStandardBrowserEnv: isStandardBrowserEnv,
|
|
2264
|
+
forEach: forEach,
|
|
2265
|
+
merge: merge,
|
|
2266
|
+
extend: extend,
|
|
2267
|
+
trim: trim,
|
|
2268
|
+
stripBOM: stripBOM
|
|
2269
|
+
};
|
|
2270
|
+
|
|
2271
|
+
|
|
2272
|
+
/***/ }),
|
|
2273
|
+
|
|
2274
|
+
/***/ 522:
|
|
2275
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2276
|
+
|
|
2277
|
+
"use strict";
|
|
2278
|
+
|
|
2279
|
+
|
|
2280
|
+
var createError = __webpack_require__(763);
|
|
2281
|
+
|
|
2282
|
+
/**
|
|
2283
|
+
* Resolve or reject a Promise based on response status.
|
|
2284
|
+
*
|
|
2285
|
+
* @param {Function} resolve A function that resolves the promise.
|
|
2286
|
+
* @param {Function} reject A function that rejects the promise.
|
|
2287
|
+
* @param {object} response The response.
|
|
2288
|
+
*/
|
|
2289
|
+
module.exports = function settle(resolve, reject, response) {
|
|
2290
|
+
var validateStatus = response.config.validateStatus;
|
|
2291
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
2292
|
+
resolve(response);
|
|
2293
|
+
} else {
|
|
2294
|
+
reject(createError(
|
|
2295
|
+
'Request failed with status code ' + response.status,
|
|
2296
|
+
response.config,
|
|
2297
|
+
null,
|
|
2298
|
+
response.request,
|
|
2299
|
+
response
|
|
2300
|
+
));
|
|
2301
|
+
}
|
|
2302
|
+
};
|
|
2303
|
+
|
|
2304
|
+
|
|
2305
|
+
/***/ }),
|
|
2306
|
+
|
|
2307
|
+
/***/ 585:
|
|
2308
|
+
/***/ ((module) => {
|
|
2309
|
+
|
|
2310
|
+
/**
|
|
2311
|
+
* Helpers.
|
|
2312
|
+
*/
|
|
2313
|
+
|
|
2314
|
+
var s = 1000;
|
|
2315
|
+
var m = s * 60;
|
|
2316
|
+
var h = m * 60;
|
|
2317
|
+
var d = h * 24;
|
|
2318
|
+
var w = d * 7;
|
|
2319
|
+
var y = d * 365.25;
|
|
2320
|
+
|
|
2321
|
+
/**
|
|
2322
|
+
* Parse or format the given `val`.
|
|
2323
|
+
*
|
|
2324
|
+
* Options:
|
|
2325
|
+
*
|
|
2326
|
+
* - `long` verbose formatting [false]
|
|
2327
|
+
*
|
|
2328
|
+
* @param {String|Number} val
|
|
2329
|
+
* @param {Object} [options]
|
|
2330
|
+
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
2331
|
+
* @return {String|Number}
|
|
2332
|
+
* @api public
|
|
2333
|
+
*/
|
|
2334
|
+
|
|
2335
|
+
module.exports = function (val, options) {
|
|
2336
|
+
options = options || {};
|
|
2337
|
+
var type = typeof val;
|
|
2338
|
+
if (type === 'string' && val.length > 0) {
|
|
2339
|
+
return parse(val);
|
|
2340
|
+
} else if (type === 'number' && isFinite(val)) {
|
|
2341
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
2342
|
+
}
|
|
2343
|
+
throw new Error(
|
|
2344
|
+
'val is not a non-empty string or a valid number. val=' +
|
|
2345
|
+
JSON.stringify(val)
|
|
2346
|
+
);
|
|
2347
|
+
};
|
|
2348
|
+
|
|
2349
|
+
/**
|
|
2350
|
+
* Parse the given `str` and return milliseconds.
|
|
2351
|
+
*
|
|
2352
|
+
* @param {String} str
|
|
2353
|
+
* @return {Number}
|
|
2354
|
+
* @api private
|
|
2355
|
+
*/
|
|
2356
|
+
|
|
2357
|
+
function parse(str) {
|
|
2358
|
+
str = String(str);
|
|
2359
|
+
if (str.length > 100) {
|
|
2360
|
+
return;
|
|
2361
|
+
}
|
|
2362
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
2363
|
+
str
|
|
2364
|
+
);
|
|
2365
|
+
if (!match) {
|
|
2366
|
+
return;
|
|
2367
|
+
}
|
|
2368
|
+
var n = parseFloat(match[1]);
|
|
2369
|
+
var type = (match[2] || 'ms').toLowerCase();
|
|
2370
|
+
switch (type) {
|
|
2371
|
+
case 'years':
|
|
2372
|
+
case 'year':
|
|
2373
|
+
case 'yrs':
|
|
2374
|
+
case 'yr':
|
|
2375
|
+
case 'y':
|
|
2376
|
+
return n * y;
|
|
2377
|
+
case 'weeks':
|
|
2378
|
+
case 'week':
|
|
2379
|
+
case 'w':
|
|
2380
|
+
return n * w;
|
|
2381
|
+
case 'days':
|
|
2382
|
+
case 'day':
|
|
2383
|
+
case 'd':
|
|
2384
|
+
return n * d;
|
|
2385
|
+
case 'hours':
|
|
2386
|
+
case 'hour':
|
|
2387
|
+
case 'hrs':
|
|
2388
|
+
case 'hr':
|
|
2389
|
+
case 'h':
|
|
2390
|
+
return n * h;
|
|
2391
|
+
case 'minutes':
|
|
2392
|
+
case 'minute':
|
|
2393
|
+
case 'mins':
|
|
2394
|
+
case 'min':
|
|
2395
|
+
case 'm':
|
|
2396
|
+
return n * m;
|
|
2397
|
+
case 'seconds':
|
|
2398
|
+
case 'second':
|
|
2399
|
+
case 'secs':
|
|
2400
|
+
case 'sec':
|
|
2401
|
+
case 's':
|
|
2402
|
+
return n * s;
|
|
2403
|
+
case 'milliseconds':
|
|
2404
|
+
case 'millisecond':
|
|
2405
|
+
case 'msecs':
|
|
2406
|
+
case 'msec':
|
|
2407
|
+
case 'ms':
|
|
2408
|
+
return n;
|
|
2409
|
+
default:
|
|
2410
|
+
return undefined;
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
/**
|
|
2415
|
+
* Short format for `ms`.
|
|
2416
|
+
*
|
|
2417
|
+
* @param {Number} ms
|
|
2418
|
+
* @return {String}
|
|
2419
|
+
* @api private
|
|
2420
|
+
*/
|
|
2421
|
+
|
|
2422
|
+
function fmtShort(ms) {
|
|
2423
|
+
var msAbs = Math.abs(ms);
|
|
2424
|
+
if (msAbs >= d) {
|
|
2425
|
+
return Math.round(ms / d) + 'd';
|
|
2426
|
+
}
|
|
2427
|
+
if (msAbs >= h) {
|
|
2428
|
+
return Math.round(ms / h) + 'h';
|
|
2429
|
+
}
|
|
2430
|
+
if (msAbs >= m) {
|
|
2431
|
+
return Math.round(ms / m) + 'm';
|
|
2432
|
+
}
|
|
2433
|
+
if (msAbs >= s) {
|
|
2434
|
+
return Math.round(ms / s) + 's';
|
|
2435
|
+
}
|
|
2436
|
+
return ms + 'ms';
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
/**
|
|
2440
|
+
* Long format for `ms`.
|
|
2441
|
+
*
|
|
2442
|
+
* @param {Number} ms
|
|
2443
|
+
* @return {String}
|
|
2444
|
+
* @api private
|
|
2445
|
+
*/
|
|
2446
|
+
|
|
2447
|
+
function fmtLong(ms) {
|
|
2448
|
+
var msAbs = Math.abs(ms);
|
|
2449
|
+
if (msAbs >= d) {
|
|
2450
|
+
return plural(ms, msAbs, d, 'day');
|
|
2451
|
+
}
|
|
2452
|
+
if (msAbs >= h) {
|
|
2453
|
+
return plural(ms, msAbs, h, 'hour');
|
|
2454
|
+
}
|
|
2455
|
+
if (msAbs >= m) {
|
|
2456
|
+
return plural(ms, msAbs, m, 'minute');
|
|
2457
|
+
}
|
|
2458
|
+
if (msAbs >= s) {
|
|
2459
|
+
return plural(ms, msAbs, s, 'second');
|
|
2460
|
+
}
|
|
2461
|
+
return ms + ' ms';
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
/**
|
|
2465
|
+
* Pluralization helper.
|
|
2466
|
+
*/
|
|
2467
|
+
|
|
2468
|
+
function plural(ms, msAbs, n, name) {
|
|
2469
|
+
var isPlural = msAbs >= n * 1.5;
|
|
2470
|
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
|
|
2474
|
+
/***/ }),
|
|
2475
|
+
|
|
2476
|
+
/***/ 592:
|
|
2477
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2478
|
+
|
|
2479
|
+
"use strict";
|
|
2480
|
+
|
|
2481
|
+
|
|
2482
|
+
var utils = __webpack_require__(516);
|
|
2483
|
+
var settle = __webpack_require__(522);
|
|
2484
|
+
var cookies = __webpack_require__(948);
|
|
2485
|
+
var buildURL = __webpack_require__(106);
|
|
2486
|
+
var buildFullPath = __webpack_require__(615);
|
|
2487
|
+
var parseHeaders = __webpack_require__(631);
|
|
2488
|
+
var isURLSameOrigin = __webpack_require__(202);
|
|
2489
|
+
var createError = __webpack_require__(763);
|
|
2490
|
+
var defaults = __webpack_require__(987);
|
|
2491
|
+
var Cancel = __webpack_require__(928);
|
|
2492
|
+
|
|
2493
|
+
module.exports = function xhrAdapter(config) {
|
|
2494
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2495
|
+
var requestData = config.data;
|
|
2496
|
+
var requestHeaders = config.headers;
|
|
2497
|
+
var responseType = config.responseType;
|
|
2498
|
+
var onCanceled;
|
|
2499
|
+
function done() {
|
|
2500
|
+
if (config.cancelToken) {
|
|
2501
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
if (config.signal) {
|
|
2505
|
+
config.signal.removeEventListener('abort', onCanceled);
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
if (utils.isFormData(requestData)) {
|
|
2510
|
+
delete requestHeaders['Content-Type']; // Let the browser set it
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
var request = new XMLHttpRequest();
|
|
2514
|
+
|
|
2515
|
+
// HTTP basic authentication
|
|
2516
|
+
if (config.auth) {
|
|
2517
|
+
var username = config.auth.username || '';
|
|
2518
|
+
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
|
2519
|
+
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
2523
|
+
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
2524
|
+
|
|
2525
|
+
// Set the request timeout in MS
|
|
2526
|
+
request.timeout = config.timeout;
|
|
2527
|
+
|
|
2528
|
+
function onloadend() {
|
|
2529
|
+
if (!request) {
|
|
2530
|
+
return;
|
|
2531
|
+
}
|
|
2532
|
+
// Prepare the response
|
|
2533
|
+
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
|
2534
|
+
var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
|
|
2535
|
+
request.responseText : request.response;
|
|
2536
|
+
var response = {
|
|
2537
|
+
data: responseData,
|
|
2538
|
+
status: request.status,
|
|
2539
|
+
statusText: request.statusText,
|
|
2540
|
+
headers: responseHeaders,
|
|
2541
|
+
config: config,
|
|
2542
|
+
request: request
|
|
2543
|
+
};
|
|
2544
|
+
|
|
2545
|
+
settle(function _resolve(value) {
|
|
2546
|
+
resolve(value);
|
|
2547
|
+
done();
|
|
2548
|
+
}, function _reject(err) {
|
|
2549
|
+
reject(err);
|
|
2550
|
+
done();
|
|
2551
|
+
}, response);
|
|
2552
|
+
|
|
2553
|
+
// Clean up request
|
|
2554
|
+
request = null;
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
if ('onloadend' in request) {
|
|
2558
|
+
// Use onloadend if available
|
|
2559
|
+
request.onloadend = onloadend;
|
|
2560
|
+
} else {
|
|
2561
|
+
// Listen for ready state to emulate onloadend
|
|
2562
|
+
request.onreadystatechange = function handleLoad() {
|
|
2563
|
+
if (!request || request.readyState !== 4) {
|
|
2564
|
+
return;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
// The request errored out and we didn't get a response, this will be
|
|
2568
|
+
// handled by onerror instead
|
|
2569
|
+
// With one exception: request that using file: protocol, most browsers
|
|
2570
|
+
// will return status as 0 even though it's a successful request
|
|
2571
|
+
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
|
|
2572
|
+
return;
|
|
2573
|
+
}
|
|
2574
|
+
// readystate handler is calling before onerror or ontimeout handlers,
|
|
2575
|
+
// so we should call onloadend on the next 'tick'
|
|
2576
|
+
setTimeout(onloadend);
|
|
2577
|
+
};
|
|
2578
|
+
}
|
|
2579
|
+
|
|
2580
|
+
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
2581
|
+
request.onabort = function handleAbort() {
|
|
2582
|
+
if (!request) {
|
|
2583
|
+
return;
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
reject(createError('Request aborted', config, 'ECONNABORTED', request));
|
|
2587
|
+
|
|
2588
|
+
// Clean up request
|
|
2589
|
+
request = null;
|
|
2590
|
+
};
|
|
2591
|
+
|
|
2592
|
+
// Handle low level network errors
|
|
2593
|
+
request.onerror = function handleError() {
|
|
2594
|
+
// Real errors are hidden from us by the browser
|
|
2595
|
+
// onerror should only fire if it's a network error
|
|
2596
|
+
reject(createError('Network Error', config, null, request));
|
|
2597
|
+
|
|
2598
|
+
// Clean up request
|
|
2599
|
+
request = null;
|
|
2600
|
+
};
|
|
2601
|
+
|
|
2602
|
+
// Handle timeout
|
|
2603
|
+
request.ontimeout = function handleTimeout() {
|
|
2604
|
+
var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
2605
|
+
var transitional = config.transitional || defaults.transitional;
|
|
2606
|
+
if (config.timeoutErrorMessage) {
|
|
2607
|
+
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
2608
|
+
}
|
|
2609
|
+
reject(createError(
|
|
2610
|
+
timeoutErrorMessage,
|
|
2611
|
+
config,
|
|
2612
|
+
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
2613
|
+
request));
|
|
2614
|
+
|
|
2615
|
+
// Clean up request
|
|
2616
|
+
request = null;
|
|
2617
|
+
};
|
|
2618
|
+
|
|
2619
|
+
// Add xsrf header
|
|
2620
|
+
// This is only done if running in a standard browser environment.
|
|
2621
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
2622
|
+
if (utils.isStandardBrowserEnv()) {
|
|
2623
|
+
// Add xsrf header
|
|
2624
|
+
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
|
2625
|
+
cookies.read(config.xsrfCookieName) :
|
|
2626
|
+
undefined;
|
|
2627
|
+
|
|
2628
|
+
if (xsrfValue) {
|
|
2629
|
+
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
// Add headers to the request
|
|
2634
|
+
if ('setRequestHeader' in request) {
|
|
2635
|
+
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
2636
|
+
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
|
2637
|
+
// Remove Content-Type if data is undefined
|
|
2638
|
+
delete requestHeaders[key];
|
|
2639
|
+
} else {
|
|
2640
|
+
// Otherwise add header to the request
|
|
2641
|
+
request.setRequestHeader(key, val);
|
|
2642
|
+
}
|
|
2643
|
+
});
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
// Add withCredentials to request if needed
|
|
2647
|
+
if (!utils.isUndefined(config.withCredentials)) {
|
|
2648
|
+
request.withCredentials = !!config.withCredentials;
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
// Add responseType to request if needed
|
|
2652
|
+
if (responseType && responseType !== 'json') {
|
|
2653
|
+
request.responseType = config.responseType;
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
// Handle progress if needed
|
|
2657
|
+
if (typeof config.onDownloadProgress === 'function') {
|
|
2658
|
+
request.addEventListener('progress', config.onDownloadProgress);
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
// Not all browsers support upload events
|
|
2662
|
+
if (typeof config.onUploadProgress === 'function' && request.upload) {
|
|
2663
|
+
request.upload.addEventListener('progress', config.onUploadProgress);
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2666
|
+
if (config.cancelToken || config.signal) {
|
|
2667
|
+
// Handle cancellation
|
|
2668
|
+
// eslint-disable-next-line func-names
|
|
2669
|
+
onCanceled = function(cancel) {
|
|
2670
|
+
if (!request) {
|
|
2671
|
+
return;
|
|
2672
|
+
}
|
|
2673
|
+
reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);
|
|
2674
|
+
request.abort();
|
|
2675
|
+
request = null;
|
|
2676
|
+
};
|
|
2677
|
+
|
|
2678
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
2679
|
+
if (config.signal) {
|
|
2680
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
if (!requestData) {
|
|
2685
|
+
requestData = null;
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2688
|
+
// Send the request
|
|
2689
|
+
request.send(requestData);
|
|
2690
|
+
});
|
|
2691
|
+
};
|
|
2692
|
+
|
|
2693
|
+
|
|
2694
|
+
/***/ }),
|
|
2695
|
+
|
|
2696
|
+
/***/ 611:
|
|
2697
|
+
/***/ ((module) => {
|
|
2698
|
+
|
|
2699
|
+
"use strict";
|
|
2700
|
+
module.exports = require("http");
|
|
2701
|
+
|
|
2702
|
+
/***/ }),
|
|
2703
|
+
|
|
2704
|
+
/***/ 613:
|
|
2705
|
+
/***/ ((module) => {
|
|
2706
|
+
|
|
2707
|
+
"use strict";
|
|
2708
|
+
module.exports = require("assert");
|
|
2709
|
+
|
|
2710
|
+
/***/ }),
|
|
2711
|
+
|
|
2712
|
+
/***/ 615:
|
|
2713
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2714
|
+
|
|
2715
|
+
"use strict";
|
|
2716
|
+
|
|
2717
|
+
|
|
2718
|
+
var isAbsoluteURL = __webpack_require__(137);
|
|
2719
|
+
var combineURLs = __webpack_require__(680);
|
|
2720
|
+
|
|
2721
|
+
/**
|
|
2722
|
+
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
2723
|
+
* only when the requestedURL is not already an absolute URL.
|
|
2724
|
+
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
|
2725
|
+
*
|
|
2726
|
+
* @param {string} baseURL The base URL
|
|
2727
|
+
* @param {string} requestedURL Absolute or relative URL to combine
|
|
2728
|
+
* @returns {string} The combined full path
|
|
2729
|
+
*/
|
|
2730
|
+
module.exports = function buildFullPath(baseURL, requestedURL) {
|
|
2731
|
+
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
2732
|
+
return combineURLs(baseURL, requestedURL);
|
|
2733
|
+
}
|
|
2734
|
+
return requestedURL;
|
|
2735
|
+
};
|
|
2736
|
+
|
|
2737
|
+
|
|
2738
|
+
/***/ }),
|
|
2739
|
+
|
|
2740
|
+
/***/ 631:
|
|
2741
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2742
|
+
|
|
2743
|
+
"use strict";
|
|
2744
|
+
|
|
2745
|
+
|
|
2746
|
+
var utils = __webpack_require__(516);
|
|
2747
|
+
|
|
2748
|
+
// Headers whose duplicates are ignored by node
|
|
2749
|
+
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
|
2750
|
+
var ignoreDuplicateOf = [
|
|
2751
|
+
'age', 'authorization', 'content-length', 'content-type', 'etag',
|
|
2752
|
+
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
|
|
2753
|
+
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
|
|
2754
|
+
'referer', 'retry-after', 'user-agent'
|
|
2755
|
+
];
|
|
2756
|
+
|
|
2757
|
+
/**
|
|
2758
|
+
* Parse headers into an object
|
|
2759
|
+
*
|
|
2760
|
+
* ```
|
|
2761
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
|
2762
|
+
* Content-Type: application/json
|
|
2763
|
+
* Connection: keep-alive
|
|
2764
|
+
* Transfer-Encoding: chunked
|
|
2765
|
+
* ```
|
|
2766
|
+
*
|
|
2767
|
+
* @param {String} headers Headers needing to be parsed
|
|
2768
|
+
* @returns {Object} Headers parsed into an object
|
|
2769
|
+
*/
|
|
2770
|
+
module.exports = function parseHeaders(headers) {
|
|
2771
|
+
var parsed = {};
|
|
2772
|
+
var key;
|
|
2773
|
+
var val;
|
|
2774
|
+
var i;
|
|
2775
|
+
|
|
2776
|
+
if (!headers) { return parsed; }
|
|
2777
|
+
|
|
2778
|
+
utils.forEach(headers.split('\n'), function parser(line) {
|
|
2779
|
+
i = line.indexOf(':');
|
|
2780
|
+
key = utils.trim(line.substr(0, i)).toLowerCase();
|
|
2781
|
+
val = utils.trim(line.substr(i + 1));
|
|
2782
|
+
|
|
2783
|
+
if (key) {
|
|
2784
|
+
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
2785
|
+
return;
|
|
2786
|
+
}
|
|
2787
|
+
if (key === 'set-cookie') {
|
|
2788
|
+
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
2789
|
+
} else {
|
|
2790
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
});
|
|
2794
|
+
|
|
2795
|
+
return parsed;
|
|
2796
|
+
};
|
|
2797
|
+
|
|
2798
|
+
|
|
2799
|
+
/***/ }),
|
|
2800
|
+
|
|
2801
|
+
/***/ 637:
|
|
2802
|
+
/***/ ((module) => {
|
|
2803
|
+
|
|
2804
|
+
"use strict";
|
|
2805
|
+
module.exports = require("tty");
|
|
2806
|
+
|
|
2807
|
+
/***/ }),
|
|
2808
|
+
|
|
2809
|
+
/***/ 641:
|
|
2810
|
+
/***/ ((module) => {
|
|
2811
|
+
|
|
2812
|
+
module.exports = {
|
|
2813
|
+
"version": "0.23.0"
|
|
2814
|
+
};
|
|
2815
|
+
|
|
2816
|
+
/***/ }),
|
|
2817
|
+
|
|
2818
|
+
/***/ 680:
|
|
2819
|
+
/***/ ((module) => {
|
|
2820
|
+
|
|
2821
|
+
"use strict";
|
|
2822
|
+
|
|
2823
|
+
|
|
2824
|
+
/**
|
|
2825
|
+
* Creates a new URL by combining the specified URLs
|
|
2826
|
+
*
|
|
2827
|
+
* @param {string} baseURL The base URL
|
|
2828
|
+
* @param {string} relativeURL The relative URL
|
|
2829
|
+
* @returns {string} The combined URL
|
|
2830
|
+
*/
|
|
2831
|
+
module.exports = function combineURLs(baseURL, relativeURL) {
|
|
2832
|
+
return relativeURL
|
|
2833
|
+
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
|
|
2834
|
+
: baseURL;
|
|
2835
|
+
};
|
|
2836
|
+
|
|
2837
|
+
|
|
2838
|
+
/***/ }),
|
|
2839
|
+
|
|
2840
|
+
/***/ 687:
|
|
2841
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2842
|
+
|
|
2843
|
+
"use strict";
|
|
2844
|
+
|
|
2845
|
+
const os = __webpack_require__(857);
|
|
2846
|
+
const tty = __webpack_require__(637);
|
|
2847
|
+
const hasFlag = __webpack_require__(884);
|
|
2848
|
+
|
|
2849
|
+
const {env} = process;
|
|
2850
|
+
|
|
2851
|
+
let forceColor;
|
|
2852
|
+
if (hasFlag('no-color') ||
|
|
2853
|
+
hasFlag('no-colors') ||
|
|
2854
|
+
hasFlag('color=false') ||
|
|
2855
|
+
hasFlag('color=never')) {
|
|
2856
|
+
forceColor = 0;
|
|
2857
|
+
} else if (hasFlag('color') ||
|
|
2858
|
+
hasFlag('colors') ||
|
|
2859
|
+
hasFlag('color=true') ||
|
|
2860
|
+
hasFlag('color=always')) {
|
|
2861
|
+
forceColor = 1;
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
if ('FORCE_COLOR' in env) {
|
|
2865
|
+
if (env.FORCE_COLOR === 'true') {
|
|
2866
|
+
forceColor = 1;
|
|
2867
|
+
} else if (env.FORCE_COLOR === 'false') {
|
|
2868
|
+
forceColor = 0;
|
|
2869
|
+
} else {
|
|
2870
|
+
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
function translateLevel(level) {
|
|
2875
|
+
if (level === 0) {
|
|
2876
|
+
return false;
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
return {
|
|
2880
|
+
level,
|
|
2881
|
+
hasBasic: true,
|
|
2882
|
+
has256: level >= 2,
|
|
2883
|
+
has16m: level >= 3
|
|
2884
|
+
};
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
function supportsColor(haveStream, streamIsTTY) {
|
|
2888
|
+
if (forceColor === 0) {
|
|
2889
|
+
return 0;
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
if (hasFlag('color=16m') ||
|
|
2893
|
+
hasFlag('color=full') ||
|
|
2894
|
+
hasFlag('color=truecolor')) {
|
|
2895
|
+
return 3;
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
if (hasFlag('color=256')) {
|
|
2899
|
+
return 2;
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2902
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
2903
|
+
return 0;
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
const min = forceColor || 0;
|
|
2907
|
+
|
|
2908
|
+
if (env.TERM === 'dumb') {
|
|
2909
|
+
return min;
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
if (process.platform === 'win32') {
|
|
2913
|
+
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
2914
|
+
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
2915
|
+
const osRelease = os.release().split('.');
|
|
2916
|
+
if (
|
|
2917
|
+
Number(osRelease[0]) >= 10 &&
|
|
2918
|
+
Number(osRelease[2]) >= 10586
|
|
2919
|
+
) {
|
|
2920
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
return 1;
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
if ('CI' in env) {
|
|
2927
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
2928
|
+
return 1;
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
return min;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
if ('TEAMCITY_VERSION' in env) {
|
|
2935
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
if (env.COLORTERM === 'truecolor') {
|
|
2939
|
+
return 3;
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
if ('TERM_PROGRAM' in env) {
|
|
2943
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
2944
|
+
|
|
2945
|
+
switch (env.TERM_PROGRAM) {
|
|
2946
|
+
case 'iTerm.app':
|
|
2947
|
+
return version >= 3 ? 3 : 2;
|
|
2948
|
+
case 'Apple_Terminal':
|
|
2949
|
+
return 2;
|
|
2950
|
+
// No default
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
2955
|
+
return 2;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
2959
|
+
return 1;
|
|
2960
|
+
}
|
|
2961
|
+
|
|
2962
|
+
if ('COLORTERM' in env) {
|
|
2963
|
+
return 1;
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
return min;
|
|
2967
|
+
}
|
|
2968
|
+
|
|
2969
|
+
function getSupportLevel(stream) {
|
|
2970
|
+
const level = supportsColor(stream, stream && stream.isTTY);
|
|
2971
|
+
return translateLevel(level);
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
module.exports = {
|
|
2975
|
+
supportsColor: getSupportLevel,
|
|
2976
|
+
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
2977
|
+
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
2978
|
+
};
|
|
2979
|
+
|
|
2980
|
+
|
|
2981
|
+
/***/ }),
|
|
2982
|
+
|
|
2983
|
+
/***/ 692:
|
|
2984
|
+
/***/ ((module) => {
|
|
2985
|
+
|
|
2986
|
+
"use strict";
|
|
2987
|
+
module.exports = require("https");
|
|
2988
|
+
|
|
2989
|
+
/***/ }),
|
|
2990
|
+
|
|
2991
|
+
/***/ 725:
|
|
2992
|
+
/***/ ((module) => {
|
|
2993
|
+
|
|
2994
|
+
"use strict";
|
|
2995
|
+
module.exports = require("zlib");
|
|
2996
|
+
|
|
2997
|
+
/***/ }),
|
|
2998
|
+
|
|
2999
|
+
/***/ 736:
|
|
3000
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3001
|
+
|
|
3002
|
+
|
|
3003
|
+
/**
|
|
3004
|
+
* This is the common logic for both the Node.js and web browser
|
|
3005
|
+
* implementations of `debug()`.
|
|
3006
|
+
*/
|
|
3007
|
+
|
|
3008
|
+
function setup(env) {
|
|
3009
|
+
createDebug.debug = createDebug;
|
|
3010
|
+
createDebug.default = createDebug;
|
|
3011
|
+
createDebug.coerce = coerce;
|
|
3012
|
+
createDebug.disable = disable;
|
|
3013
|
+
createDebug.enable = enable;
|
|
3014
|
+
createDebug.enabled = enabled;
|
|
3015
|
+
createDebug.humanize = __webpack_require__(585);
|
|
3016
|
+
createDebug.destroy = destroy;
|
|
3017
|
+
|
|
3018
|
+
Object.keys(env).forEach(key => {
|
|
3019
|
+
createDebug[key] = env[key];
|
|
3020
|
+
});
|
|
3021
|
+
|
|
3022
|
+
/**
|
|
3023
|
+
* The currently active debug mode names, and names to skip.
|
|
3024
|
+
*/
|
|
3025
|
+
|
|
3026
|
+
createDebug.names = [];
|
|
3027
|
+
createDebug.skips = [];
|
|
3028
|
+
|
|
3029
|
+
/**
|
|
3030
|
+
* Map of special "%n" handling functions, for the debug "format" argument.
|
|
3031
|
+
*
|
|
3032
|
+
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
|
3033
|
+
*/
|
|
3034
|
+
createDebug.formatters = {};
|
|
3035
|
+
|
|
3036
|
+
/**
|
|
3037
|
+
* Selects a color for a debug namespace
|
|
3038
|
+
* @param {String} namespace The namespace string for the debug instance to be colored
|
|
3039
|
+
* @return {Number|String} An ANSI color code for the given namespace
|
|
3040
|
+
* @api private
|
|
3041
|
+
*/
|
|
3042
|
+
function selectColor(namespace) {
|
|
3043
|
+
let hash = 0;
|
|
3044
|
+
|
|
3045
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
3046
|
+
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
|
|
3047
|
+
hash |= 0; // Convert to 32bit integer
|
|
3048
|
+
}
|
|
3049
|
+
|
|
3050
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
3051
|
+
}
|
|
3052
|
+
createDebug.selectColor = selectColor;
|
|
3053
|
+
|
|
3054
|
+
/**
|
|
3055
|
+
* Create a debugger with the given `namespace`.
|
|
3056
|
+
*
|
|
3057
|
+
* @param {String} namespace
|
|
3058
|
+
* @return {Function}
|
|
3059
|
+
* @api public
|
|
3060
|
+
*/
|
|
3061
|
+
function createDebug(namespace) {
|
|
3062
|
+
let prevTime;
|
|
3063
|
+
let enableOverride = null;
|
|
3064
|
+
let namespacesCache;
|
|
3065
|
+
let enabledCache;
|
|
3066
|
+
|
|
3067
|
+
function debug(...args) {
|
|
3068
|
+
// Disabled?
|
|
3069
|
+
if (!debug.enabled) {
|
|
3070
|
+
return;
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
const self = debug;
|
|
3074
|
+
|
|
3075
|
+
// Set `diff` timestamp
|
|
3076
|
+
const curr = Number(new Date());
|
|
3077
|
+
const ms = curr - (prevTime || curr);
|
|
3078
|
+
self.diff = ms;
|
|
3079
|
+
self.prev = prevTime;
|
|
3080
|
+
self.curr = curr;
|
|
3081
|
+
prevTime = curr;
|
|
3082
|
+
|
|
3083
|
+
args[0] = createDebug.coerce(args[0]);
|
|
3084
|
+
|
|
3085
|
+
if (typeof args[0] !== 'string') {
|
|
3086
|
+
// Anything else let's inspect with %O
|
|
3087
|
+
args.unshift('%O');
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
// Apply any `formatters` transformations
|
|
3091
|
+
let index = 0;
|
|
3092
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
3093
|
+
// If we encounter an escaped % then don't increase the array index
|
|
3094
|
+
if (match === '%%') {
|
|
3095
|
+
return '%';
|
|
3096
|
+
}
|
|
3097
|
+
index++;
|
|
3098
|
+
const formatter = createDebug.formatters[format];
|
|
3099
|
+
if (typeof formatter === 'function') {
|
|
3100
|
+
const val = args[index];
|
|
3101
|
+
match = formatter.call(self, val);
|
|
3102
|
+
|
|
3103
|
+
// Now we need to remove `args[index]` since it's inlined in the `format`
|
|
3104
|
+
args.splice(index, 1);
|
|
3105
|
+
index--;
|
|
3106
|
+
}
|
|
3107
|
+
return match;
|
|
3108
|
+
});
|
|
3109
|
+
|
|
3110
|
+
// Apply env-specific formatting (colors, etc.)
|
|
3111
|
+
createDebug.formatArgs.call(self, args);
|
|
3112
|
+
|
|
3113
|
+
const logFn = self.log || createDebug.log;
|
|
3114
|
+
logFn.apply(self, args);
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
debug.namespace = namespace;
|
|
3118
|
+
debug.useColors = createDebug.useColors();
|
|
3119
|
+
debug.color = createDebug.selectColor(namespace);
|
|
3120
|
+
debug.extend = extend;
|
|
3121
|
+
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
|
|
3122
|
+
|
|
3123
|
+
Object.defineProperty(debug, 'enabled', {
|
|
3124
|
+
enumerable: true,
|
|
3125
|
+
configurable: false,
|
|
3126
|
+
get: () => {
|
|
3127
|
+
if (enableOverride !== null) {
|
|
3128
|
+
return enableOverride;
|
|
3129
|
+
}
|
|
3130
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
3131
|
+
namespacesCache = createDebug.namespaces;
|
|
3132
|
+
enabledCache = createDebug.enabled(namespace);
|
|
3133
|
+
}
|
|
3134
|
+
|
|
3135
|
+
return enabledCache;
|
|
3136
|
+
},
|
|
3137
|
+
set: v => {
|
|
3138
|
+
enableOverride = v;
|
|
3139
|
+
}
|
|
3140
|
+
});
|
|
3141
|
+
|
|
3142
|
+
// Env-specific initialization logic for debug instances
|
|
3143
|
+
if (typeof createDebug.init === 'function') {
|
|
3144
|
+
createDebug.init(debug);
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
return debug;
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
function extend(namespace, delimiter) {
|
|
3151
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|
3152
|
+
newDebug.log = this.log;
|
|
3153
|
+
return newDebug;
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
/**
|
|
3157
|
+
* Enables a debug mode by namespaces. This can include modes
|
|
3158
|
+
* separated by a colon and wildcards.
|
|
3159
|
+
*
|
|
3160
|
+
* @param {String} namespaces
|
|
3161
|
+
* @api public
|
|
3162
|
+
*/
|
|
3163
|
+
function enable(namespaces) {
|
|
3164
|
+
createDebug.save(namespaces);
|
|
3165
|
+
createDebug.namespaces = namespaces;
|
|
3166
|
+
|
|
3167
|
+
createDebug.names = [];
|
|
3168
|
+
createDebug.skips = [];
|
|
3169
|
+
|
|
3170
|
+
const split = (typeof namespaces === 'string' ? namespaces : '')
|
|
3171
|
+
.trim()
|
|
3172
|
+
.replace(/\s+/g, ',')
|
|
3173
|
+
.split(',')
|
|
3174
|
+
.filter(Boolean);
|
|
3175
|
+
|
|
3176
|
+
for (const ns of split) {
|
|
3177
|
+
if (ns[0] === '-') {
|
|
3178
|
+
createDebug.skips.push(ns.slice(1));
|
|
3179
|
+
} else {
|
|
3180
|
+
createDebug.names.push(ns);
|
|
3181
|
+
}
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
/**
|
|
3186
|
+
* Checks if the given string matches a namespace template, honoring
|
|
3187
|
+
* asterisks as wildcards.
|
|
3188
|
+
*
|
|
3189
|
+
* @param {String} search
|
|
3190
|
+
* @param {String} template
|
|
3191
|
+
* @return {Boolean}
|
|
3192
|
+
*/
|
|
3193
|
+
function matchesTemplate(search, template) {
|
|
3194
|
+
let searchIndex = 0;
|
|
3195
|
+
let templateIndex = 0;
|
|
3196
|
+
let starIndex = -1;
|
|
3197
|
+
let matchIndex = 0;
|
|
3198
|
+
|
|
3199
|
+
while (searchIndex < search.length) {
|
|
3200
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
|
|
3201
|
+
// Match character or proceed with wildcard
|
|
3202
|
+
if (template[templateIndex] === '*') {
|
|
3203
|
+
starIndex = templateIndex;
|
|
3204
|
+
matchIndex = searchIndex;
|
|
3205
|
+
templateIndex++; // Skip the '*'
|
|
3206
|
+
} else {
|
|
3207
|
+
searchIndex++;
|
|
3208
|
+
templateIndex++;
|
|
3209
|
+
}
|
|
3210
|
+
} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
|
|
3211
|
+
// Backtrack to the last '*' and try to match more characters
|
|
3212
|
+
templateIndex = starIndex + 1;
|
|
3213
|
+
matchIndex++;
|
|
3214
|
+
searchIndex = matchIndex;
|
|
3215
|
+
} else {
|
|
3216
|
+
return false; // No match
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3220
|
+
// Handle trailing '*' in template
|
|
3221
|
+
while (templateIndex < template.length && template[templateIndex] === '*') {
|
|
3222
|
+
templateIndex++;
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3225
|
+
return templateIndex === template.length;
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
/**
|
|
3229
|
+
* Disable debug output.
|
|
3230
|
+
*
|
|
3231
|
+
* @return {String} namespaces
|
|
3232
|
+
* @api public
|
|
3233
|
+
*/
|
|
3234
|
+
function disable() {
|
|
3235
|
+
const namespaces = [
|
|
3236
|
+
...createDebug.names,
|
|
3237
|
+
...createDebug.skips.map(namespace => '-' + namespace)
|
|
3238
|
+
].join(',');
|
|
3239
|
+
createDebug.enable('');
|
|
3240
|
+
return namespaces;
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
/**
|
|
3244
|
+
* Returns true if the given mode name is enabled, false otherwise.
|
|
3245
|
+
*
|
|
3246
|
+
* @param {String} name
|
|
3247
|
+
* @return {Boolean}
|
|
3248
|
+
* @api public
|
|
3249
|
+
*/
|
|
3250
|
+
function enabled(name) {
|
|
3251
|
+
for (const skip of createDebug.skips) {
|
|
3252
|
+
if (matchesTemplate(name, skip)) {
|
|
3253
|
+
return false;
|
|
3254
|
+
}
|
|
3255
|
+
}
|
|
3256
|
+
|
|
3257
|
+
for (const ns of createDebug.names) {
|
|
3258
|
+
if (matchesTemplate(name, ns)) {
|
|
3259
|
+
return true;
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
return false;
|
|
3264
|
+
}
|
|
3265
|
+
|
|
3266
|
+
/**
|
|
3267
|
+
* Coerce `val`.
|
|
3268
|
+
*
|
|
3269
|
+
* @param {Mixed} val
|
|
3270
|
+
* @return {Mixed}
|
|
3271
|
+
* @api private
|
|
3272
|
+
*/
|
|
3273
|
+
function coerce(val) {
|
|
3274
|
+
if (val instanceof Error) {
|
|
3275
|
+
return val.stack || val.message;
|
|
3276
|
+
}
|
|
3277
|
+
return val;
|
|
3278
|
+
}
|
|
3279
|
+
|
|
3280
|
+
/**
|
|
3281
|
+
* XXX DO NOT USE. This is a temporary stub function.
|
|
3282
|
+
* XXX It WILL be removed in the next major release.
|
|
3283
|
+
*/
|
|
3284
|
+
function destroy() {
|
|
3285
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
3286
|
+
}
|
|
3287
|
+
|
|
3288
|
+
createDebug.enable(createDebug.load());
|
|
3289
|
+
|
|
3290
|
+
return createDebug;
|
|
3291
|
+
}
|
|
3292
|
+
|
|
3293
|
+
module.exports = setup;
|
|
3294
|
+
|
|
3295
|
+
|
|
3296
|
+
/***/ }),
|
|
3297
|
+
|
|
3298
|
+
/***/ 753:
|
|
3299
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3300
|
+
|
|
3301
|
+
/**
|
|
3302
|
+
* Detect Electron renderer / nwjs process, which is node, but we should
|
|
3303
|
+
* treat as a browser.
|
|
3304
|
+
*/
|
|
3305
|
+
|
|
3306
|
+
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
|
3307
|
+
module.exports = __webpack_require__(833);
|
|
3308
|
+
} else {
|
|
3309
|
+
module.exports = __webpack_require__(33);
|
|
3310
|
+
}
|
|
3311
|
+
|
|
3312
|
+
|
|
3313
|
+
/***/ }),
|
|
3314
|
+
|
|
3315
|
+
/***/ 763:
|
|
3316
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3317
|
+
|
|
3318
|
+
"use strict";
|
|
3319
|
+
|
|
3320
|
+
|
|
3321
|
+
var enhanceError = __webpack_require__(449);
|
|
3322
|
+
|
|
3323
|
+
/**
|
|
3324
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
3325
|
+
*
|
|
3326
|
+
* @param {string} message The error message.
|
|
3327
|
+
* @param {Object} config The config.
|
|
3328
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
3329
|
+
* @param {Object} [request] The request.
|
|
3330
|
+
* @param {Object} [response] The response.
|
|
3331
|
+
* @returns {Error} The created error.
|
|
3332
|
+
*/
|
|
3333
|
+
module.exports = function createError(message, config, code, request, response) {
|
|
3334
|
+
var error = new Error(message);
|
|
3335
|
+
return enhanceError(error, config, code, request, response);
|
|
3336
|
+
};
|
|
3337
|
+
|
|
3338
|
+
|
|
3339
|
+
/***/ }),
|
|
3340
|
+
|
|
3341
|
+
/***/ 833:
|
|
3342
|
+
/***/ ((module, exports, __webpack_require__) => {
|
|
3343
|
+
|
|
3344
|
+
/* eslint-env browser */
|
|
3345
|
+
|
|
3346
|
+
/**
|
|
3347
|
+
* This is the web browser implementation of `debug()`.
|
|
3348
|
+
*/
|
|
3349
|
+
|
|
3350
|
+
exports.formatArgs = formatArgs;
|
|
3351
|
+
exports.save = save;
|
|
3352
|
+
exports.load = load;
|
|
3353
|
+
exports.useColors = useColors;
|
|
3354
|
+
exports.storage = localstorage();
|
|
3355
|
+
exports.destroy = (() => {
|
|
3356
|
+
let warned = false;
|
|
3357
|
+
|
|
3358
|
+
return () => {
|
|
3359
|
+
if (!warned) {
|
|
3360
|
+
warned = true;
|
|
3361
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
3362
|
+
}
|
|
3363
|
+
};
|
|
3364
|
+
})();
|
|
3365
|
+
|
|
3366
|
+
/**
|
|
3367
|
+
* Colors.
|
|
3368
|
+
*/
|
|
3369
|
+
|
|
3370
|
+
exports.colors = [
|
|
3371
|
+
'#0000CC',
|
|
3372
|
+
'#0000FF',
|
|
3373
|
+
'#0033CC',
|
|
3374
|
+
'#0033FF',
|
|
3375
|
+
'#0066CC',
|
|
3376
|
+
'#0066FF',
|
|
3377
|
+
'#0099CC',
|
|
3378
|
+
'#0099FF',
|
|
3379
|
+
'#00CC00',
|
|
3380
|
+
'#00CC33',
|
|
3381
|
+
'#00CC66',
|
|
3382
|
+
'#00CC99',
|
|
3383
|
+
'#00CCCC',
|
|
3384
|
+
'#00CCFF',
|
|
3385
|
+
'#3300CC',
|
|
3386
|
+
'#3300FF',
|
|
3387
|
+
'#3333CC',
|
|
3388
|
+
'#3333FF',
|
|
3389
|
+
'#3366CC',
|
|
3390
|
+
'#3366FF',
|
|
3391
|
+
'#3399CC',
|
|
3392
|
+
'#3399FF',
|
|
3393
|
+
'#33CC00',
|
|
3394
|
+
'#33CC33',
|
|
3395
|
+
'#33CC66',
|
|
3396
|
+
'#33CC99',
|
|
3397
|
+
'#33CCCC',
|
|
3398
|
+
'#33CCFF',
|
|
3399
|
+
'#6600CC',
|
|
3400
|
+
'#6600FF',
|
|
3401
|
+
'#6633CC',
|
|
3402
|
+
'#6633FF',
|
|
3403
|
+
'#66CC00',
|
|
3404
|
+
'#66CC33',
|
|
3405
|
+
'#9900CC',
|
|
3406
|
+
'#9900FF',
|
|
3407
|
+
'#9933CC',
|
|
3408
|
+
'#9933FF',
|
|
3409
|
+
'#99CC00',
|
|
3410
|
+
'#99CC33',
|
|
3411
|
+
'#CC0000',
|
|
3412
|
+
'#CC0033',
|
|
3413
|
+
'#CC0066',
|
|
3414
|
+
'#CC0099',
|
|
3415
|
+
'#CC00CC',
|
|
3416
|
+
'#CC00FF',
|
|
3417
|
+
'#CC3300',
|
|
3418
|
+
'#CC3333',
|
|
3419
|
+
'#CC3366',
|
|
3420
|
+
'#CC3399',
|
|
3421
|
+
'#CC33CC',
|
|
3422
|
+
'#CC33FF',
|
|
3423
|
+
'#CC6600',
|
|
3424
|
+
'#CC6633',
|
|
3425
|
+
'#CC9900',
|
|
3426
|
+
'#CC9933',
|
|
3427
|
+
'#CCCC00',
|
|
3428
|
+
'#CCCC33',
|
|
3429
|
+
'#FF0000',
|
|
3430
|
+
'#FF0033',
|
|
3431
|
+
'#FF0066',
|
|
3432
|
+
'#FF0099',
|
|
3433
|
+
'#FF00CC',
|
|
3434
|
+
'#FF00FF',
|
|
3435
|
+
'#FF3300',
|
|
3436
|
+
'#FF3333',
|
|
3437
|
+
'#FF3366',
|
|
3438
|
+
'#FF3399',
|
|
3439
|
+
'#FF33CC',
|
|
3440
|
+
'#FF33FF',
|
|
3441
|
+
'#FF6600',
|
|
3442
|
+
'#FF6633',
|
|
3443
|
+
'#FF9900',
|
|
3444
|
+
'#FF9933',
|
|
3445
|
+
'#FFCC00',
|
|
3446
|
+
'#FFCC33'
|
|
3447
|
+
];
|
|
3448
|
+
|
|
3449
|
+
/**
|
|
3450
|
+
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
3451
|
+
* and the Firebug extension (any Firefox version) are known
|
|
3452
|
+
* to support "%c" CSS customizations.
|
|
3453
|
+
*
|
|
3454
|
+
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
3455
|
+
*/
|
|
3456
|
+
|
|
3457
|
+
// eslint-disable-next-line complexity
|
|
3458
|
+
function useColors() {
|
|
3459
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
|
3460
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
3461
|
+
// explicitly
|
|
3462
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
3463
|
+
return true;
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3466
|
+
// Internet Explorer and Edge do not support colors.
|
|
3467
|
+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
3468
|
+
return false;
|
|
3469
|
+
}
|
|
3470
|
+
|
|
3471
|
+
let m;
|
|
3472
|
+
|
|
3473
|
+
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
3474
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
3475
|
+
// eslint-disable-next-line no-return-assign
|
|
3476
|
+
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
3477
|
+
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
3478
|
+
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
3479
|
+
// Is firefox >= v31?
|
|
3480
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
3481
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
|
|
3482
|
+
// Double check webkit in userAgent just in case we are in a worker
|
|
3483
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
3484
|
+
}
|
|
3485
|
+
|
|
3486
|
+
/**
|
|
3487
|
+
* Colorize log arguments if enabled.
|
|
3488
|
+
*
|
|
3489
|
+
* @api public
|
|
3490
|
+
*/
|
|
3491
|
+
|
|
3492
|
+
function formatArgs(args) {
|
|
3493
|
+
args[0] = (this.useColors ? '%c' : '') +
|
|
3494
|
+
this.namespace +
|
|
3495
|
+
(this.useColors ? ' %c' : ' ') +
|
|
3496
|
+
args[0] +
|
|
3497
|
+
(this.useColors ? '%c ' : ' ') +
|
|
3498
|
+
'+' + module.exports.humanize(this.diff);
|
|
3499
|
+
|
|
3500
|
+
if (!this.useColors) {
|
|
3501
|
+
return;
|
|
3502
|
+
}
|
|
3503
|
+
|
|
3504
|
+
const c = 'color: ' + this.color;
|
|
3505
|
+
args.splice(1, 0, c, 'color: inherit');
|
|
3506
|
+
|
|
3507
|
+
// The final "%c" is somewhat tricky, because there could be other
|
|
3508
|
+
// arguments passed either before or after the %c, so we need to
|
|
3509
|
+
// figure out the correct index to insert the CSS into
|
|
3510
|
+
let index = 0;
|
|
3511
|
+
let lastC = 0;
|
|
3512
|
+
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
3513
|
+
if (match === '%%') {
|
|
3514
|
+
return;
|
|
3515
|
+
}
|
|
3516
|
+
index++;
|
|
3517
|
+
if (match === '%c') {
|
|
3518
|
+
// We only are interested in the *last* %c
|
|
3519
|
+
// (the user may have provided their own)
|
|
3520
|
+
lastC = index;
|
|
3521
|
+
}
|
|
3522
|
+
});
|
|
3523
|
+
|
|
3524
|
+
args.splice(lastC, 0, c);
|
|
3525
|
+
}
|
|
3526
|
+
|
|
3527
|
+
/**
|
|
3528
|
+
* Invokes `console.debug()` when available.
|
|
3529
|
+
* No-op when `console.debug` is not a "function".
|
|
3530
|
+
* If `console.debug` is not available, falls back
|
|
3531
|
+
* to `console.log`.
|
|
3532
|
+
*
|
|
3533
|
+
* @api public
|
|
3534
|
+
*/
|
|
3535
|
+
exports.log = console.debug || console.log || (() => {});
|
|
3536
|
+
|
|
3537
|
+
/**
|
|
3538
|
+
* Save `namespaces`.
|
|
3539
|
+
*
|
|
3540
|
+
* @param {String} namespaces
|
|
3541
|
+
* @api private
|
|
3542
|
+
*/
|
|
3543
|
+
function save(namespaces) {
|
|
3544
|
+
try {
|
|
3545
|
+
if (namespaces) {
|
|
3546
|
+
exports.storage.setItem('debug', namespaces);
|
|
3547
|
+
} else {
|
|
3548
|
+
exports.storage.removeItem('debug');
|
|
3549
|
+
}
|
|
3550
|
+
} catch (error) {
|
|
3551
|
+
// Swallow
|
|
3552
|
+
// XXX (@Qix-) should we be logging these?
|
|
3553
|
+
}
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3556
|
+
/**
|
|
3557
|
+
* Load `namespaces`.
|
|
3558
|
+
*
|
|
3559
|
+
* @return {String} returns the previously persisted debug modes
|
|
3560
|
+
* @api private
|
|
3561
|
+
*/
|
|
3562
|
+
function load() {
|
|
3563
|
+
let r;
|
|
3564
|
+
try {
|
|
3565
|
+
r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
|
|
3566
|
+
} catch (error) {
|
|
3567
|
+
// Swallow
|
|
3568
|
+
// XXX (@Qix-) should we be logging these?
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3571
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
3572
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
3573
|
+
r = process.env.DEBUG;
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
|
+
return r;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
/**
|
|
3580
|
+
* Localstorage attempts to return the localstorage.
|
|
3581
|
+
*
|
|
3582
|
+
* This is necessary because safari throws
|
|
3583
|
+
* when a user disables cookies/localstorage
|
|
3584
|
+
* and you attempt to access it.
|
|
3585
|
+
*
|
|
3586
|
+
* @return {LocalStorage}
|
|
3587
|
+
* @api private
|
|
3588
|
+
*/
|
|
3589
|
+
|
|
3590
|
+
function localstorage() {
|
|
3591
|
+
try {
|
|
3592
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
3593
|
+
// The Browser also has localStorage in the global context.
|
|
3594
|
+
return localStorage;
|
|
3595
|
+
} catch (error) {
|
|
3596
|
+
// Swallow
|
|
3597
|
+
// XXX (@Qix-) should we be logging these?
|
|
3598
|
+
}
|
|
3599
|
+
}
|
|
3600
|
+
|
|
3601
|
+
module.exports = __webpack_require__(736)(exports);
|
|
3602
|
+
|
|
3603
|
+
const {formatters} = module.exports;
|
|
3604
|
+
|
|
3605
|
+
/**
|
|
3606
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
3607
|
+
*/
|
|
3608
|
+
|
|
3609
|
+
formatters.j = function (v) {
|
|
3610
|
+
try {
|
|
3611
|
+
return JSON.stringify(v);
|
|
3612
|
+
} catch (error) {
|
|
3613
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
3614
|
+
}
|
|
3615
|
+
};
|
|
3616
|
+
|
|
3617
|
+
|
|
3618
|
+
/***/ }),
|
|
3619
|
+
|
|
3620
|
+
/***/ 841:
|
|
3621
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3622
|
+
|
|
3623
|
+
"use strict";
|
|
3624
|
+
|
|
3625
|
+
|
|
3626
|
+
var VERSION = (__webpack_require__(641).version);
|
|
3627
|
+
|
|
3628
|
+
var validators = {};
|
|
3629
|
+
|
|
3630
|
+
// eslint-disable-next-line func-names
|
|
3631
|
+
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
|
|
3632
|
+
validators[type] = function validator(thing) {
|
|
3633
|
+
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
|
|
3634
|
+
};
|
|
3635
|
+
});
|
|
3636
|
+
|
|
3637
|
+
var deprecatedWarnings = {};
|
|
3638
|
+
|
|
3639
|
+
/**
|
|
3640
|
+
* Transitional option validator
|
|
3641
|
+
* @param {function|boolean?} validator - set to false if the transitional option has been removed
|
|
3642
|
+
* @param {string?} version - deprecated version / removed since version
|
|
3643
|
+
* @param {string?} message - some message with additional info
|
|
3644
|
+
* @returns {function}
|
|
3645
|
+
*/
|
|
3646
|
+
validators.transitional = function transitional(validator, version, message) {
|
|
3647
|
+
function formatMessage(opt, desc) {
|
|
3648
|
+
return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
// eslint-disable-next-line func-names
|
|
3652
|
+
return function(value, opt, opts) {
|
|
3653
|
+
if (validator === false) {
|
|
3654
|
+
throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));
|
|
3655
|
+
}
|
|
3656
|
+
|
|
3657
|
+
if (version && !deprecatedWarnings[opt]) {
|
|
3658
|
+
deprecatedWarnings[opt] = true;
|
|
3659
|
+
// eslint-disable-next-line no-console
|
|
3660
|
+
console.warn(
|
|
3661
|
+
formatMessage(
|
|
3662
|
+
opt,
|
|
3663
|
+
' has been deprecated since v' + version + ' and will be removed in the near future'
|
|
3664
|
+
)
|
|
3665
|
+
);
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
return validator ? validator(value, opt, opts) : true;
|
|
3669
|
+
};
|
|
3670
|
+
};
|
|
3671
|
+
|
|
3672
|
+
/**
|
|
3673
|
+
* Assert object's properties type
|
|
3674
|
+
* @param {object} options
|
|
3675
|
+
* @param {object} schema
|
|
3676
|
+
* @param {boolean?} allowUnknown
|
|
3677
|
+
*/
|
|
3678
|
+
|
|
3679
|
+
function assertOptions(options, schema, allowUnknown) {
|
|
3680
|
+
if (typeof options !== 'object') {
|
|
3681
|
+
throw new TypeError('options must be an object');
|
|
3682
|
+
}
|
|
3683
|
+
var keys = Object.keys(options);
|
|
3684
|
+
var i = keys.length;
|
|
3685
|
+
while (i-- > 0) {
|
|
3686
|
+
var opt = keys[i];
|
|
3687
|
+
var validator = schema[opt];
|
|
3688
|
+
if (validator) {
|
|
3689
|
+
var value = options[opt];
|
|
3690
|
+
var result = value === undefined || validator(value, opt, options);
|
|
3691
|
+
if (result !== true) {
|
|
3692
|
+
throw new TypeError('option ' + opt + ' must be ' + result);
|
|
3693
|
+
}
|
|
3694
|
+
continue;
|
|
3695
|
+
}
|
|
3696
|
+
if (allowUnknown !== true) {
|
|
3697
|
+
throw Error('Unknown option ' + opt);
|
|
3698
|
+
}
|
|
3699
|
+
}
|
|
3700
|
+
}
|
|
3701
|
+
|
|
3702
|
+
module.exports = {
|
|
3703
|
+
assertOptions: assertOptions,
|
|
3704
|
+
validators: validators
|
|
3705
|
+
};
|
|
3706
|
+
|
|
3707
|
+
|
|
3708
|
+
/***/ }),
|
|
3709
|
+
|
|
3710
|
+
/***/ 857:
|
|
3711
|
+
/***/ ((module) => {
|
|
3712
|
+
|
|
3713
|
+
"use strict";
|
|
3714
|
+
module.exports = require("os");
|
|
3715
|
+
|
|
3716
|
+
/***/ }),
|
|
3717
|
+
|
|
3718
|
+
/***/ 864:
|
|
3719
|
+
/***/ ((module) => {
|
|
3720
|
+
|
|
3721
|
+
"use strict";
|
|
3722
|
+
|
|
3723
|
+
|
|
3724
|
+
module.exports = function isCancel(value) {
|
|
3725
|
+
return !!(value && value.__CANCEL__);
|
|
3726
|
+
};
|
|
3727
|
+
|
|
3728
|
+
|
|
3729
|
+
/***/ }),
|
|
3730
|
+
|
|
3731
|
+
/***/ 881:
|
|
3732
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3733
|
+
|
|
3734
|
+
"use strict";
|
|
3735
|
+
|
|
3736
|
+
|
|
3737
|
+
var utils = __webpack_require__(516);
|
|
3738
|
+
var defaults = __webpack_require__(987);
|
|
3739
|
+
|
|
3740
|
+
/**
|
|
3741
|
+
* Transform the data for a request or a response
|
|
3742
|
+
*
|
|
3743
|
+
* @param {Object|String} data The data to be transformed
|
|
3744
|
+
* @param {Array} headers The headers for the request or response
|
|
3745
|
+
* @param {Array|Function} fns A single function or Array of functions
|
|
3746
|
+
* @returns {*} The resulting transformed data
|
|
3747
|
+
*/
|
|
3748
|
+
module.exports = function transformData(data, headers, fns) {
|
|
3749
|
+
var context = this || defaults;
|
|
3750
|
+
/*eslint no-param-reassign:0*/
|
|
3751
|
+
utils.forEach(fns, function transform(fn) {
|
|
3752
|
+
data = fn.call(context, data, headers);
|
|
3753
|
+
});
|
|
3754
|
+
|
|
3755
|
+
return data;
|
|
3756
|
+
};
|
|
3757
|
+
|
|
3758
|
+
|
|
3759
|
+
/***/ }),
|
|
3760
|
+
|
|
3761
|
+
/***/ 884:
|
|
3762
|
+
/***/ ((module) => {
|
|
3763
|
+
|
|
3764
|
+
"use strict";
|
|
3765
|
+
|
|
3766
|
+
|
|
3767
|
+
module.exports = (flag, argv = process.argv) => {
|
|
3768
|
+
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
3769
|
+
const position = argv.indexOf(prefix + flag);
|
|
3770
|
+
const terminatorPosition = argv.indexOf('--');
|
|
3771
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
3772
|
+
};
|
|
3773
|
+
|
|
3774
|
+
|
|
3775
|
+
/***/ }),
|
|
3776
|
+
|
|
3777
|
+
/***/ 928:
|
|
3778
|
+
/***/ ((module) => {
|
|
3779
|
+
|
|
3780
|
+
"use strict";
|
|
3781
|
+
|
|
3782
|
+
|
|
3783
|
+
/**
|
|
3784
|
+
* A `Cancel` is an object that is thrown when an operation is canceled.
|
|
3785
|
+
*
|
|
3786
|
+
* @class
|
|
3787
|
+
* @param {string=} message The message.
|
|
3788
|
+
*/
|
|
3789
|
+
function Cancel(message) {
|
|
3790
|
+
this.message = message;
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3793
|
+
Cancel.prototype.toString = function toString() {
|
|
3794
|
+
return 'Cancel' + (this.message ? ': ' + this.message : '');
|
|
3795
|
+
};
|
|
3796
|
+
|
|
3797
|
+
Cancel.prototype.__CANCEL__ = true;
|
|
3798
|
+
|
|
3799
|
+
module.exports = Cancel;
|
|
3800
|
+
|
|
3801
|
+
|
|
3802
|
+
/***/ }),
|
|
3803
|
+
|
|
3804
|
+
/***/ 948:
|
|
3805
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3806
|
+
|
|
3807
|
+
"use strict";
|
|
3808
|
+
|
|
3809
|
+
|
|
3810
|
+
var utils = __webpack_require__(516);
|
|
3811
|
+
|
|
3812
|
+
module.exports = (
|
|
3813
|
+
utils.isStandardBrowserEnv() ?
|
|
3814
|
+
|
|
3815
|
+
// Standard browser envs support document.cookie
|
|
3816
|
+
(function standardBrowserEnv() {
|
|
3817
|
+
return {
|
|
3818
|
+
write: function write(name, value, expires, path, domain, secure) {
|
|
3819
|
+
var cookie = [];
|
|
3820
|
+
cookie.push(name + '=' + encodeURIComponent(value));
|
|
3821
|
+
|
|
3822
|
+
if (utils.isNumber(expires)) {
|
|
3823
|
+
cookie.push('expires=' + new Date(expires).toGMTString());
|
|
3824
|
+
}
|
|
3825
|
+
|
|
3826
|
+
if (utils.isString(path)) {
|
|
3827
|
+
cookie.push('path=' + path);
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
if (utils.isString(domain)) {
|
|
3831
|
+
cookie.push('domain=' + domain);
|
|
3832
|
+
}
|
|
3833
|
+
|
|
3834
|
+
if (secure === true) {
|
|
3835
|
+
cookie.push('secure');
|
|
3836
|
+
}
|
|
3837
|
+
|
|
3838
|
+
document.cookie = cookie.join('; ');
|
|
3839
|
+
},
|
|
3840
|
+
|
|
3841
|
+
read: function read(name) {
|
|
3842
|
+
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
3843
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
|
3844
|
+
},
|
|
3845
|
+
|
|
3846
|
+
remove: function remove(name) {
|
|
3847
|
+
this.write(name, '', Date.now() - 86400000);
|
|
3848
|
+
}
|
|
3849
|
+
};
|
|
3850
|
+
})() :
|
|
3851
|
+
|
|
3852
|
+
// Non standard browser env (web workers, react-native) lack needed support.
|
|
3853
|
+
(function nonStandardBrowserEnv() {
|
|
3854
|
+
return {
|
|
3855
|
+
write: function write() {},
|
|
3856
|
+
read: function read() { return null; },
|
|
3857
|
+
remove: function remove() {}
|
|
3858
|
+
};
|
|
3859
|
+
})()
|
|
3860
|
+
);
|
|
3861
|
+
|
|
3862
|
+
|
|
3863
|
+
/***/ }),
|
|
3864
|
+
|
|
3865
|
+
/***/ 960:
|
|
3866
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3867
|
+
|
|
3868
|
+
"use strict";
|
|
3869
|
+
|
|
3870
|
+
|
|
3871
|
+
var utils = __webpack_require__(516);
|
|
3872
|
+
var settle = __webpack_require__(522);
|
|
3873
|
+
var buildFullPath = __webpack_require__(615);
|
|
3874
|
+
var buildURL = __webpack_require__(106);
|
|
3875
|
+
var http = __webpack_require__(611);
|
|
3876
|
+
var https = __webpack_require__(692);
|
|
3877
|
+
var httpFollow = (__webpack_require__(164).http);
|
|
3878
|
+
var httpsFollow = (__webpack_require__(164).https);
|
|
3879
|
+
var url = __webpack_require__(16);
|
|
3880
|
+
var zlib = __webpack_require__(725);
|
|
3881
|
+
var VERSION = (__webpack_require__(641).version);
|
|
3882
|
+
var createError = __webpack_require__(763);
|
|
3883
|
+
var enhanceError = __webpack_require__(449);
|
|
3884
|
+
var defaults = __webpack_require__(987);
|
|
3885
|
+
var Cancel = __webpack_require__(928);
|
|
3886
|
+
|
|
3887
|
+
var isHttps = /https:?/;
|
|
3888
|
+
|
|
3889
|
+
/**
|
|
3890
|
+
*
|
|
3891
|
+
* @param {http.ClientRequestArgs} options
|
|
3892
|
+
* @param {AxiosProxyConfig} proxy
|
|
3893
|
+
* @param {string} location
|
|
3894
|
+
*/
|
|
3895
|
+
function setProxy(options, proxy, location) {
|
|
3896
|
+
options.hostname = proxy.host;
|
|
3897
|
+
options.host = proxy.host;
|
|
3898
|
+
options.port = proxy.port;
|
|
3899
|
+
options.path = location;
|
|
3900
|
+
|
|
3901
|
+
// Basic proxy authorization
|
|
3902
|
+
if (proxy.auth) {
|
|
3903
|
+
var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64');
|
|
3904
|
+
options.headers['Proxy-Authorization'] = 'Basic ' + base64;
|
|
3905
|
+
}
|
|
3906
|
+
|
|
3907
|
+
// If a proxy is used, any redirects must also pass through the proxy
|
|
3908
|
+
options.beforeRedirect = function beforeRedirect(redirection) {
|
|
3909
|
+
redirection.headers.host = redirection.host;
|
|
3910
|
+
setProxy(redirection, proxy, redirection.href);
|
|
3911
|
+
};
|
|
3912
|
+
}
|
|
3913
|
+
|
|
3914
|
+
/*eslint consistent-return:0*/
|
|
3915
|
+
module.exports = function httpAdapter(config) {
|
|
3916
|
+
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
|
3917
|
+
var onCanceled;
|
|
3918
|
+
function done() {
|
|
3919
|
+
if (config.cancelToken) {
|
|
3920
|
+
config.cancelToken.unsubscribe(onCanceled);
|
|
3921
|
+
}
|
|
3922
|
+
|
|
3923
|
+
if (config.signal) {
|
|
3924
|
+
config.signal.removeEventListener('abort', onCanceled);
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
var resolve = function resolve(value) {
|
|
3928
|
+
done();
|
|
3929
|
+
resolvePromise(value);
|
|
3930
|
+
};
|
|
3931
|
+
var reject = function reject(value) {
|
|
3932
|
+
done();
|
|
3933
|
+
rejectPromise(value);
|
|
3934
|
+
};
|
|
3935
|
+
var data = config.data;
|
|
3936
|
+
var headers = config.headers;
|
|
3937
|
+
var headerNames = {};
|
|
3938
|
+
|
|
3939
|
+
Object.keys(headers).forEach(function storeLowerName(name) {
|
|
3940
|
+
headerNames[name.toLowerCase()] = name;
|
|
3941
|
+
});
|
|
3942
|
+
|
|
3943
|
+
// Set User-Agent (required by some servers)
|
|
3944
|
+
// See https://github.com/axios/axios/issues/69
|
|
3945
|
+
if ('user-agent' in headerNames) {
|
|
3946
|
+
// User-Agent is specified; handle case where no UA header is desired
|
|
3947
|
+
if (!headers[headerNames['user-agent']]) {
|
|
3948
|
+
delete headers[headerNames['user-agent']];
|
|
3949
|
+
}
|
|
3950
|
+
// Otherwise, use specified value
|
|
3951
|
+
} else {
|
|
3952
|
+
// Only set header if it hasn't been set in config
|
|
3953
|
+
headers['User-Agent'] = 'axios/' + VERSION;
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
if (data && !utils.isStream(data)) {
|
|
3957
|
+
if (Buffer.isBuffer(data)) {
|
|
3958
|
+
// Nothing to do...
|
|
3959
|
+
} else if (utils.isArrayBuffer(data)) {
|
|
3960
|
+
data = Buffer.from(new Uint8Array(data));
|
|
3961
|
+
} else if (utils.isString(data)) {
|
|
3962
|
+
data = Buffer.from(data, 'utf-8');
|
|
3963
|
+
} else {
|
|
3964
|
+
return reject(createError(
|
|
3965
|
+
'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
|
|
3966
|
+
config
|
|
3967
|
+
));
|
|
3968
|
+
}
|
|
3969
|
+
|
|
3970
|
+
// Add Content-Length header if data exists
|
|
3971
|
+
if (!headerNames['content-length']) {
|
|
3972
|
+
headers['Content-Length'] = data.length;
|
|
3973
|
+
}
|
|
3974
|
+
}
|
|
3975
|
+
|
|
3976
|
+
// HTTP basic authentication
|
|
3977
|
+
var auth = undefined;
|
|
3978
|
+
if (config.auth) {
|
|
3979
|
+
var username = config.auth.username || '';
|
|
3980
|
+
var password = config.auth.password || '';
|
|
3981
|
+
auth = username + ':' + password;
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
// Parse url
|
|
3985
|
+
var fullPath = buildFullPath(config.baseURL, config.url);
|
|
3986
|
+
var parsed = url.parse(fullPath);
|
|
3987
|
+
var protocol = parsed.protocol || 'http:';
|
|
3988
|
+
|
|
3989
|
+
if (!auth && parsed.auth) {
|
|
3990
|
+
var urlAuth = parsed.auth.split(':');
|
|
3991
|
+
var urlUsername = urlAuth[0] || '';
|
|
3992
|
+
var urlPassword = urlAuth[1] || '';
|
|
3993
|
+
auth = urlUsername + ':' + urlPassword;
|
|
3994
|
+
}
|
|
3995
|
+
|
|
3996
|
+
if (auth && headerNames.authorization) {
|
|
3997
|
+
delete headers[headerNames.authorization];
|
|
3998
|
+
}
|
|
3999
|
+
|
|
4000
|
+
var isHttpsRequest = isHttps.test(protocol);
|
|
4001
|
+
var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
|
|
4002
|
+
|
|
4003
|
+
var options = {
|
|
4004
|
+
path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
|
|
4005
|
+
method: config.method.toUpperCase(),
|
|
4006
|
+
headers: headers,
|
|
4007
|
+
agent: agent,
|
|
4008
|
+
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
4009
|
+
auth: auth
|
|
4010
|
+
};
|
|
4011
|
+
|
|
4012
|
+
if (config.socketPath) {
|
|
4013
|
+
options.socketPath = config.socketPath;
|
|
4014
|
+
} else {
|
|
4015
|
+
options.hostname = parsed.hostname;
|
|
4016
|
+
options.port = parsed.port;
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
var proxy = config.proxy;
|
|
4020
|
+
if (!proxy && proxy !== false) {
|
|
4021
|
+
var proxyEnv = protocol.slice(0, -1) + '_proxy';
|
|
4022
|
+
var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
|
|
4023
|
+
if (proxyUrl) {
|
|
4024
|
+
var parsedProxyUrl = url.parse(proxyUrl);
|
|
4025
|
+
var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY;
|
|
4026
|
+
var shouldProxy = true;
|
|
4027
|
+
|
|
4028
|
+
if (noProxyEnv) {
|
|
4029
|
+
var noProxy = noProxyEnv.split(',').map(function trim(s) {
|
|
4030
|
+
return s.trim();
|
|
4031
|
+
});
|
|
4032
|
+
|
|
4033
|
+
shouldProxy = !noProxy.some(function proxyMatch(proxyElement) {
|
|
4034
|
+
if (!proxyElement) {
|
|
4035
|
+
return false;
|
|
4036
|
+
}
|
|
4037
|
+
if (proxyElement === '*') {
|
|
4038
|
+
return true;
|
|
4039
|
+
}
|
|
4040
|
+
if (proxyElement[0] === '.' &&
|
|
4041
|
+
parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) {
|
|
4042
|
+
return true;
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
return parsed.hostname === proxyElement;
|
|
4046
|
+
});
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
if (shouldProxy) {
|
|
4050
|
+
proxy = {
|
|
4051
|
+
host: parsedProxyUrl.hostname,
|
|
4052
|
+
port: parsedProxyUrl.port,
|
|
4053
|
+
protocol: parsedProxyUrl.protocol
|
|
4054
|
+
};
|
|
4055
|
+
|
|
4056
|
+
if (parsedProxyUrl.auth) {
|
|
4057
|
+
var proxyUrlAuth = parsedProxyUrl.auth.split(':');
|
|
4058
|
+
proxy.auth = {
|
|
4059
|
+
username: proxyUrlAuth[0],
|
|
4060
|
+
password: proxyUrlAuth[1]
|
|
4061
|
+
};
|
|
4062
|
+
}
|
|
4063
|
+
}
|
|
4064
|
+
}
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
if (proxy) {
|
|
4068
|
+
options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : '');
|
|
4069
|
+
setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
|
|
4070
|
+
}
|
|
4071
|
+
|
|
4072
|
+
var transport;
|
|
4073
|
+
var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true);
|
|
4074
|
+
if (config.transport) {
|
|
4075
|
+
transport = config.transport;
|
|
4076
|
+
} else if (config.maxRedirects === 0) {
|
|
4077
|
+
transport = isHttpsProxy ? https : http;
|
|
4078
|
+
} else {
|
|
4079
|
+
if (config.maxRedirects) {
|
|
4080
|
+
options.maxRedirects = config.maxRedirects;
|
|
4081
|
+
}
|
|
4082
|
+
transport = isHttpsProxy ? httpsFollow : httpFollow;
|
|
4083
|
+
}
|
|
4084
|
+
|
|
4085
|
+
if (config.maxBodyLength > -1) {
|
|
4086
|
+
options.maxBodyLength = config.maxBodyLength;
|
|
4087
|
+
}
|
|
4088
|
+
|
|
4089
|
+
if (config.insecureHTTPParser) {
|
|
4090
|
+
options.insecureHTTPParser = config.insecureHTTPParser;
|
|
4091
|
+
}
|
|
4092
|
+
|
|
4093
|
+
// Create the request
|
|
4094
|
+
var req = transport.request(options, function handleResponse(res) {
|
|
4095
|
+
if (req.aborted) return;
|
|
4096
|
+
|
|
4097
|
+
// uncompress the response body transparently if required
|
|
4098
|
+
var stream = res;
|
|
4099
|
+
|
|
4100
|
+
// return the last request in case of redirects
|
|
4101
|
+
var lastRequest = res.req || req;
|
|
4102
|
+
|
|
4103
|
+
|
|
4104
|
+
// if no content, is HEAD request or decompress disabled we should not decompress
|
|
4105
|
+
if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) {
|
|
4106
|
+
switch (res.headers['content-encoding']) {
|
|
4107
|
+
/*eslint default-case:0*/
|
|
4108
|
+
case 'gzip':
|
|
4109
|
+
case 'compress':
|
|
4110
|
+
case 'deflate':
|
|
4111
|
+
// add the unzipper to the body stream processing pipeline
|
|
4112
|
+
stream = stream.pipe(zlib.createUnzip());
|
|
4113
|
+
|
|
4114
|
+
// remove the content-encoding in order to not confuse downstream operations
|
|
4115
|
+
delete res.headers['content-encoding'];
|
|
4116
|
+
break;
|
|
4117
|
+
}
|
|
4118
|
+
}
|
|
4119
|
+
|
|
4120
|
+
var response = {
|
|
4121
|
+
status: res.statusCode,
|
|
4122
|
+
statusText: res.statusMessage,
|
|
4123
|
+
headers: res.headers,
|
|
4124
|
+
config: config,
|
|
4125
|
+
request: lastRequest
|
|
4126
|
+
};
|
|
4127
|
+
|
|
4128
|
+
if (config.responseType === 'stream') {
|
|
4129
|
+
response.data = stream;
|
|
4130
|
+
settle(resolve, reject, response);
|
|
4131
|
+
} else {
|
|
4132
|
+
var responseBuffer = [];
|
|
4133
|
+
var totalResponseBytes = 0;
|
|
4134
|
+
stream.on('data', function handleStreamData(chunk) {
|
|
4135
|
+
responseBuffer.push(chunk);
|
|
4136
|
+
totalResponseBytes += chunk.length;
|
|
4137
|
+
|
|
4138
|
+
// make sure the content length is not over the maxContentLength if specified
|
|
4139
|
+
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
|
|
4140
|
+
stream.destroy();
|
|
4141
|
+
reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
|
|
4142
|
+
config, null, lastRequest));
|
|
4143
|
+
}
|
|
4144
|
+
});
|
|
4145
|
+
|
|
4146
|
+
stream.on('error', function handleStreamError(err) {
|
|
4147
|
+
if (req.aborted) return;
|
|
4148
|
+
reject(enhanceError(err, config, null, lastRequest));
|
|
4149
|
+
});
|
|
4150
|
+
|
|
4151
|
+
stream.on('end', function handleStreamEnd() {
|
|
4152
|
+
var responseData = Buffer.concat(responseBuffer);
|
|
4153
|
+
if (config.responseType !== 'arraybuffer') {
|
|
4154
|
+
responseData = responseData.toString(config.responseEncoding);
|
|
4155
|
+
if (!config.responseEncoding || config.responseEncoding === 'utf8') {
|
|
4156
|
+
responseData = utils.stripBOM(responseData);
|
|
4157
|
+
}
|
|
4158
|
+
}
|
|
4159
|
+
|
|
4160
|
+
response.data = responseData;
|
|
4161
|
+
settle(resolve, reject, response);
|
|
4162
|
+
});
|
|
4163
|
+
}
|
|
4164
|
+
});
|
|
4165
|
+
|
|
4166
|
+
// Handle errors
|
|
4167
|
+
req.on('error', function handleRequestError(err) {
|
|
4168
|
+
if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return;
|
|
4169
|
+
reject(enhanceError(err, config, null, req));
|
|
4170
|
+
});
|
|
4171
|
+
|
|
4172
|
+
// Handle request timeout
|
|
4173
|
+
if (config.timeout) {
|
|
4174
|
+
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
|
|
4175
|
+
var timeout = parseInt(config.timeout, 10);
|
|
4176
|
+
|
|
4177
|
+
if (isNaN(timeout)) {
|
|
4178
|
+
reject(createError(
|
|
4179
|
+
'error trying to parse `config.timeout` to int',
|
|
4180
|
+
config,
|
|
4181
|
+
'ERR_PARSE_TIMEOUT',
|
|
4182
|
+
req
|
|
4183
|
+
));
|
|
4184
|
+
|
|
4185
|
+
return;
|
|
4186
|
+
}
|
|
4187
|
+
|
|
4188
|
+
// Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
|
|
4189
|
+
// And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
|
|
4190
|
+
// At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
|
|
4191
|
+
// And then these socket which be hang up will devoring CPU little by little.
|
|
4192
|
+
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
|
|
4193
|
+
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
4194
|
+
req.abort();
|
|
4195
|
+
var transitional = config.transitional || defaults.transitional;
|
|
4196
|
+
reject(createError(
|
|
4197
|
+
'timeout of ' + timeout + 'ms exceeded',
|
|
4198
|
+
config,
|
|
4199
|
+
transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',
|
|
4200
|
+
req
|
|
4201
|
+
));
|
|
4202
|
+
});
|
|
4203
|
+
}
|
|
4204
|
+
|
|
4205
|
+
if (config.cancelToken || config.signal) {
|
|
4206
|
+
// Handle cancellation
|
|
4207
|
+
// eslint-disable-next-line func-names
|
|
4208
|
+
onCanceled = function(cancel) {
|
|
4209
|
+
if (req.aborted) return;
|
|
4210
|
+
|
|
4211
|
+
req.abort();
|
|
4212
|
+
reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);
|
|
4213
|
+
};
|
|
4214
|
+
|
|
4215
|
+
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
4216
|
+
if (config.signal) {
|
|
4217
|
+
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
|
|
4218
|
+
}
|
|
4219
|
+
}
|
|
4220
|
+
|
|
4221
|
+
|
|
4222
|
+
// Send the request
|
|
4223
|
+
if (utils.isStream(data)) {
|
|
4224
|
+
data.on('error', function handleStreamError(err) {
|
|
4225
|
+
reject(enhanceError(err, config, null, req));
|
|
4226
|
+
}).pipe(req);
|
|
4227
|
+
} else {
|
|
4228
|
+
req.end(data);
|
|
4229
|
+
}
|
|
4230
|
+
});
|
|
4231
|
+
};
|
|
4232
|
+
|
|
4233
|
+
|
|
4234
|
+
/***/ }),
|
|
4235
|
+
|
|
4236
|
+
/***/ 980:
|
|
4237
|
+
/***/ ((module) => {
|
|
4238
|
+
|
|
4239
|
+
"use strict";
|
|
4240
|
+
|
|
4241
|
+
|
|
4242
|
+
/**
|
|
4243
|
+
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
|
4244
|
+
*
|
|
4245
|
+
* Common use case would be to use `Function.prototype.apply`.
|
|
4246
|
+
*
|
|
4247
|
+
* ```js
|
|
4248
|
+
* function f(x, y, z) {}
|
|
4249
|
+
* var args = [1, 2, 3];
|
|
4250
|
+
* f.apply(null, args);
|
|
4251
|
+
* ```
|
|
4252
|
+
*
|
|
4253
|
+
* With `spread` this example can be re-written.
|
|
4254
|
+
*
|
|
4255
|
+
* ```js
|
|
4256
|
+
* spread(function(x, y, z) {})([1, 2, 3]);
|
|
4257
|
+
* ```
|
|
4258
|
+
*
|
|
4259
|
+
* @param {Function} callback
|
|
4260
|
+
* @returns {Function}
|
|
4261
|
+
*/
|
|
4262
|
+
module.exports = function spread(callback) {
|
|
4263
|
+
return function wrap(arr) {
|
|
4264
|
+
return callback.apply(null, arr);
|
|
4265
|
+
};
|
|
4266
|
+
};
|
|
4267
|
+
|
|
4268
|
+
|
|
4269
|
+
/***/ }),
|
|
4270
|
+
|
|
4271
|
+
/***/ 987:
|
|
4272
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
4273
|
+
|
|
4274
|
+
"use strict";
|
|
4275
|
+
|
|
4276
|
+
|
|
4277
|
+
var utils = __webpack_require__(516);
|
|
4278
|
+
var normalizeHeaderName = __webpack_require__(18);
|
|
4279
|
+
var enhanceError = __webpack_require__(449);
|
|
4280
|
+
|
|
4281
|
+
var DEFAULT_CONTENT_TYPE = {
|
|
4282
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
4283
|
+
};
|
|
4284
|
+
|
|
4285
|
+
function setContentTypeIfUnset(headers, value) {
|
|
4286
|
+
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
|
|
4287
|
+
headers['Content-Type'] = value;
|
|
4288
|
+
}
|
|
4289
|
+
}
|
|
4290
|
+
|
|
4291
|
+
function getDefaultAdapter() {
|
|
4292
|
+
var adapter;
|
|
4293
|
+
if (typeof XMLHttpRequest !== 'undefined') {
|
|
4294
|
+
// For browsers use XHR adapter
|
|
4295
|
+
adapter = __webpack_require__(592);
|
|
4296
|
+
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
|
|
4297
|
+
// For node use HTTP adapter
|
|
4298
|
+
adapter = __webpack_require__(960);
|
|
4299
|
+
}
|
|
4300
|
+
return adapter;
|
|
4301
|
+
}
|
|
4302
|
+
|
|
4303
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
4304
|
+
if (utils.isString(rawValue)) {
|
|
4305
|
+
try {
|
|
4306
|
+
(parser || JSON.parse)(rawValue);
|
|
4307
|
+
return utils.trim(rawValue);
|
|
4308
|
+
} catch (e) {
|
|
4309
|
+
if (e.name !== 'SyntaxError') {
|
|
4310
|
+
throw e;
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
4313
|
+
}
|
|
4314
|
+
|
|
4315
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
4316
|
+
}
|
|
4317
|
+
|
|
4318
|
+
var defaults = {
|
|
4319
|
+
|
|
4320
|
+
transitional: {
|
|
4321
|
+
silentJSONParsing: true,
|
|
4322
|
+
forcedJSONParsing: true,
|
|
4323
|
+
clarifyTimeoutError: false
|
|
4324
|
+
},
|
|
4325
|
+
|
|
4326
|
+
adapter: getDefaultAdapter(),
|
|
4327
|
+
|
|
4328
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
4329
|
+
normalizeHeaderName(headers, 'Accept');
|
|
4330
|
+
normalizeHeaderName(headers, 'Content-Type');
|
|
4331
|
+
|
|
4332
|
+
if (utils.isFormData(data) ||
|
|
4333
|
+
utils.isArrayBuffer(data) ||
|
|
4334
|
+
utils.isBuffer(data) ||
|
|
4335
|
+
utils.isStream(data) ||
|
|
4336
|
+
utils.isFile(data) ||
|
|
4337
|
+
utils.isBlob(data)
|
|
4338
|
+
) {
|
|
4339
|
+
return data;
|
|
4340
|
+
}
|
|
4341
|
+
if (utils.isArrayBufferView(data)) {
|
|
4342
|
+
return data.buffer;
|
|
4343
|
+
}
|
|
4344
|
+
if (utils.isURLSearchParams(data)) {
|
|
4345
|
+
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
|
4346
|
+
return data.toString();
|
|
4347
|
+
}
|
|
4348
|
+
if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
|
|
4349
|
+
setContentTypeIfUnset(headers, 'application/json');
|
|
4350
|
+
return stringifySafely(data);
|
|
4351
|
+
}
|
|
4352
|
+
return data;
|
|
4353
|
+
}],
|
|
4354
|
+
|
|
4355
|
+
transformResponse: [function transformResponse(data) {
|
|
4356
|
+
var transitional = this.transitional || defaults.transitional;
|
|
4357
|
+
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
4358
|
+
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
4359
|
+
var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
|
|
4360
|
+
|
|
4361
|
+
if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
|
|
4362
|
+
try {
|
|
4363
|
+
return JSON.parse(data);
|
|
4364
|
+
} catch (e) {
|
|
4365
|
+
if (strictJSONParsing) {
|
|
4366
|
+
if (e.name === 'SyntaxError') {
|
|
4367
|
+
throw enhanceError(e, this, 'E_JSON_PARSE');
|
|
4368
|
+
}
|
|
4369
|
+
throw e;
|
|
4370
|
+
}
|
|
4371
|
+
}
|
|
4372
|
+
}
|
|
4373
|
+
|
|
4374
|
+
return data;
|
|
4375
|
+
}],
|
|
4376
|
+
|
|
4377
|
+
/**
|
|
4378
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
4379
|
+
* timeout is not created.
|
|
4380
|
+
*/
|
|
4381
|
+
timeout: 0,
|
|
4382
|
+
|
|
4383
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
|
4384
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
|
4385
|
+
|
|
4386
|
+
maxContentLength: -1,
|
|
4387
|
+
maxBodyLength: -1,
|
|
4388
|
+
|
|
4389
|
+
validateStatus: function validateStatus(status) {
|
|
4390
|
+
return status >= 200 && status < 300;
|
|
4391
|
+
},
|
|
4392
|
+
|
|
4393
|
+
headers: {
|
|
4394
|
+
common: {
|
|
4395
|
+
'Accept': 'application/json, text/plain, */*'
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
};
|
|
4399
|
+
|
|
4400
|
+
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
|
4401
|
+
defaults.headers[method] = {};
|
|
4402
|
+
});
|
|
4403
|
+
|
|
4404
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
4405
|
+
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
|
|
4406
|
+
});
|
|
4407
|
+
|
|
4408
|
+
module.exports = defaults;
|
|
4409
|
+
|
|
4410
|
+
|
|
4411
|
+
/***/ }),
|
|
4412
|
+
|
|
4413
|
+
/***/ 992:
|
|
4414
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
4415
|
+
|
|
4416
|
+
"use strict";
|
|
4417
|
+
|
|
4418
|
+
|
|
4419
|
+
var has = Object.prototype.hasOwnProperty
|
|
4420
|
+
, undef;
|
|
4421
|
+
|
|
4422
|
+
/**
|
|
4423
|
+
* Decode a URI encoded string.
|
|
4424
|
+
*
|
|
4425
|
+
* @param {String} input The URI encoded string.
|
|
4426
|
+
* @returns {String|Null} The decoded string.
|
|
4427
|
+
* @api private
|
|
4428
|
+
*/
|
|
4429
|
+
function decode(input) {
|
|
4430
|
+
try {
|
|
4431
|
+
return decodeURIComponent(input.replace(/\+/g, ' '));
|
|
4432
|
+
} catch (e) {
|
|
4433
|
+
return null;
|
|
4434
|
+
}
|
|
4435
|
+
}
|
|
4436
|
+
|
|
4437
|
+
/**
|
|
4438
|
+
* Attempts to encode a given input.
|
|
4439
|
+
*
|
|
4440
|
+
* @param {String} input The string that needs to be encoded.
|
|
4441
|
+
* @returns {String|Null} The encoded string.
|
|
4442
|
+
* @api private
|
|
4443
|
+
*/
|
|
4444
|
+
function encode(input) {
|
|
4445
|
+
try {
|
|
4446
|
+
return encodeURIComponent(input);
|
|
4447
|
+
} catch (e) {
|
|
4448
|
+
return null;
|
|
4449
|
+
}
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4452
|
+
/**
|
|
4453
|
+
* Simple query string parser.
|
|
4454
|
+
*
|
|
4455
|
+
* @param {String} query The query string that needs to be parsed.
|
|
4456
|
+
* @returns {Object}
|
|
4457
|
+
* @api public
|
|
4458
|
+
*/
|
|
4459
|
+
function querystring(query) {
|
|
4460
|
+
var parser = /([^=?#&]+)=?([^&]*)/g
|
|
4461
|
+
, result = {}
|
|
4462
|
+
, part;
|
|
4463
|
+
|
|
4464
|
+
while (part = parser.exec(query)) {
|
|
4465
|
+
var key = decode(part[1])
|
|
4466
|
+
, value = decode(part[2]);
|
|
4467
|
+
|
|
4468
|
+
//
|
|
4469
|
+
// Prevent overriding of existing properties. This ensures that build-in
|
|
4470
|
+
// methods like `toString` or __proto__ are not overriden by malicious
|
|
4471
|
+
// querystrings.
|
|
4472
|
+
//
|
|
4473
|
+
// In the case if failed decoding, we want to omit the key/value pairs
|
|
4474
|
+
// from the result.
|
|
4475
|
+
//
|
|
4476
|
+
if (key === null || value === null || key in result) continue;
|
|
4477
|
+
result[key] = value;
|
|
4478
|
+
}
|
|
4479
|
+
|
|
4480
|
+
return result;
|
|
4481
|
+
}
|
|
4482
|
+
|
|
4483
|
+
/**
|
|
4484
|
+
* Transform a query string to an object.
|
|
4485
|
+
*
|
|
4486
|
+
* @param {Object} obj Object that should be transformed.
|
|
4487
|
+
* @param {String} prefix Optional prefix.
|
|
4488
|
+
* @returns {String}
|
|
4489
|
+
* @api public
|
|
4490
|
+
*/
|
|
4491
|
+
function querystringify(obj, prefix) {
|
|
4492
|
+
prefix = prefix || '';
|
|
4493
|
+
|
|
4494
|
+
var pairs = []
|
|
4495
|
+
, value
|
|
4496
|
+
, key;
|
|
4497
|
+
|
|
4498
|
+
//
|
|
4499
|
+
// Optionally prefix with a '?' if needed
|
|
4500
|
+
//
|
|
4501
|
+
if ('string' !== typeof prefix) prefix = '?';
|
|
4502
|
+
|
|
4503
|
+
for (key in obj) {
|
|
4504
|
+
if (has.call(obj, key)) {
|
|
4505
|
+
value = obj[key];
|
|
4506
|
+
|
|
4507
|
+
//
|
|
4508
|
+
// Edge cases where we actually want to encode the value to an empty
|
|
4509
|
+
// string instead of the stringified value.
|
|
4510
|
+
//
|
|
4511
|
+
if (!value && (value === null || value === undef || isNaN(value))) {
|
|
4512
|
+
value = '';
|
|
4513
|
+
}
|
|
4514
|
+
|
|
4515
|
+
key = encode(key);
|
|
4516
|
+
value = encode(value);
|
|
4517
|
+
|
|
4518
|
+
//
|
|
4519
|
+
// If we failed to encode the strings, we should bail out as we don't
|
|
4520
|
+
// want to add invalid strings to the query.
|
|
4521
|
+
//
|
|
4522
|
+
if (key === null || value === null) continue;
|
|
4523
|
+
pairs.push(key +'='+ value);
|
|
4524
|
+
}
|
|
4525
|
+
}
|
|
4526
|
+
|
|
4527
|
+
return pairs.length ? prefix + pairs.join('&') : '';
|
|
4528
|
+
}
|
|
4529
|
+
|
|
4530
|
+
//
|
|
4531
|
+
// Expose the module.
|
|
4532
|
+
//
|
|
4533
|
+
exports.stringify = querystringify;
|
|
4534
|
+
exports.parse = querystring;
|
|
4535
|
+
|
|
4536
|
+
|
|
4537
|
+
/***/ })
|
|
4538
|
+
|
|
4539
|
+
/******/ });
|
|
4540
|
+
/************************************************************************/
|
|
4541
|
+
/******/ // The module cache
|
|
4542
|
+
/******/ var __webpack_module_cache__ = {};
|
|
4543
|
+
/******/
|
|
4544
|
+
/******/ // The require function
|
|
4545
|
+
/******/ function __webpack_require__(moduleId) {
|
|
4546
|
+
/******/ // Check if module is in cache
|
|
4547
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
4548
|
+
/******/ if (cachedModule !== undefined) {
|
|
4549
|
+
/******/ return cachedModule.exports;
|
|
4550
|
+
/******/ }
|
|
4551
|
+
/******/ // Create a new module (and put it into the cache)
|
|
4552
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
4553
|
+
/******/ // no module.id needed
|
|
4554
|
+
/******/ // no module.loaded needed
|
|
4555
|
+
/******/ exports: {}
|
|
4556
|
+
/******/ };
|
|
4557
|
+
/******/
|
|
4558
|
+
/******/ // Execute the module function
|
|
4559
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
4560
|
+
/******/
|
|
4561
|
+
/******/ // Return the exports of the module
|
|
4562
|
+
/******/ return module.exports;
|
|
4563
|
+
/******/ }
|
|
4564
|
+
/******/
|
|
4565
|
+
/************************************************************************/
|
|
4566
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
4567
|
+
/******/ (() => {
|
|
4568
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
4569
|
+
/******/ __webpack_require__.n = (module) => {
|
|
4570
|
+
/******/ var getter = module && module.__esModule ?
|
|
4571
|
+
/******/ () => (module['default']) :
|
|
4572
|
+
/******/ () => (module);
|
|
4573
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
4574
|
+
/******/ return getter;
|
|
4575
|
+
/******/ };
|
|
4576
|
+
/******/ })();
|
|
4577
|
+
/******/
|
|
4578
|
+
/******/ /* webpack/runtime/define property getters */
|
|
4579
|
+
/******/ (() => {
|
|
4580
|
+
/******/ // define getter functions for harmony exports
|
|
4581
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
4582
|
+
/******/ for(var key in definition) {
|
|
4583
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
4584
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
4585
|
+
/******/ }
|
|
4586
|
+
/******/ }
|
|
4587
|
+
/******/ };
|
|
4588
|
+
/******/ })();
|
|
4589
|
+
/******/
|
|
4590
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
4591
|
+
/******/ (() => {
|
|
4592
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
4593
|
+
/******/ })();
|
|
4594
|
+
/******/
|
|
4595
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
4596
|
+
/******/ (() => {
|
|
4597
|
+
/******/ // define __esModule on exports
|
|
4598
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
4599
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
4600
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4601
|
+
/******/ }
|
|
4602
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4603
|
+
/******/ };
|
|
4604
|
+
/******/ })();
|
|
4605
|
+
/******/
|
|
4606
|
+
/************************************************************************/
|
|
4607
|
+
var __webpack_exports__ = {};
|
|
4608
|
+
// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
|
|
4609
|
+
(() => {
|
|
4610
|
+
"use strict";
|
|
4611
|
+
// ESM COMPAT FLAG
|
|
4612
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4613
|
+
|
|
4614
|
+
// EXPORTS
|
|
4615
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
4616
|
+
getMenuDatasByGroupID: () => (/* binding */ getMenuDatasByGroupID),
|
|
4617
|
+
queryAssetById: () => (/* binding */ queryAssetById),
|
|
4618
|
+
queryGroupIDByOfficeId: () => (/* binding */ queryGroupIDByOfficeId),
|
|
4619
|
+
transformPortalData: () => (/* binding */ transformPortalData)
|
|
4620
|
+
});
|
|
4621
|
+
|
|
4622
|
+
// EXTERNAL MODULE: ./node_modules/axios/index.js
|
|
4623
|
+
var axios = __webpack_require__(505);
|
|
4624
|
+
var axios_default = /*#__PURE__*/__webpack_require__.n(axios);
|
|
4625
|
+
// EXTERNAL MODULE: ./node_modules/querystringify/index.js
|
|
4626
|
+
var querystringify = __webpack_require__(992);
|
|
4627
|
+
;// ./src/api/request.js
|
|
4628
|
+
|
|
4629
|
+
|
|
4630
|
+
|
|
4631
|
+
let apiContextPath = ""
|
|
4632
|
+
const onlineDevelopmentMode = process.env.VUE_APP_ONLINE_DEVELOPMENT_MODE === "true" || process.env.REACT_APP_ONLINE_DEVELOPMENT_MODE === "true"
|
|
4633
|
+
if (false) // removed by dead control flow
|
|
4634
|
+
{}
|
|
4635
|
+
const getInstance = (prefix = "") => {
|
|
4636
|
+
if (prefix) {
|
|
4637
|
+
prefix.startsWith("/") && (prefix = prefix.slice(1, prefix.length))
|
|
4638
|
+
prefix.endsWith("/") && (prefix = prefix.slice(0, -1))
|
|
4639
|
+
}
|
|
4640
|
+
const instance = axios_default().create({
|
|
4641
|
+
baseURL: `${apiContextPath}/${prefix ? prefix + "/" : ""}sdata/rest`,
|
|
4642
|
+
timeout: 60000,
|
|
4643
|
+
validateStatus: function(status) {
|
|
4644
|
+
return status >= 200 && status < 300 // default
|
|
4645
|
+
},
|
|
4646
|
+
headers:
|
|
4647
|
+
(window.location.search && querystringify.parse(window.location.search).token) ||
|
|
4648
|
+
window.token
|
|
4649
|
+
? { token: querystringify.parse(window.location.search).token || window.token }
|
|
4650
|
+
: {}
|
|
4651
|
+
})
|
|
4652
|
+
|
|
4653
|
+
instance.defaults.headers.post["Content-Type"] = "application/json"
|
|
4654
|
+
|
|
4655
|
+
instance.interceptors.response.use(
|
|
4656
|
+
response => {
|
|
4657
|
+
let { data } = response
|
|
4658
|
+
if (typeof data === "string") {
|
|
4659
|
+
data = JSON.parse(data)
|
|
4660
|
+
}
|
|
4661
|
+
if (data && data.status !== 200 && !(data instanceof Blob)) {
|
|
4662
|
+
return Promise.reject(response)
|
|
4663
|
+
}
|
|
4664
|
+
if (data instanceof Blob) {
|
|
4665
|
+
response.data = data
|
|
4666
|
+
return response
|
|
4667
|
+
}
|
|
4668
|
+
|
|
4669
|
+
response.data = data && data.result
|
|
4670
|
+
return response
|
|
4671
|
+
},
|
|
4672
|
+
error => {
|
|
4673
|
+
if (error.response && error.response.status === 401) {
|
|
4674
|
+
return
|
|
4675
|
+
}
|
|
4676
|
+
|
|
4677
|
+
return Promise.reject(error.response)
|
|
4678
|
+
}
|
|
4679
|
+
)
|
|
4680
|
+
return instance
|
|
4681
|
+
}
|
|
4682
|
+
let prefixPath = window.prefixPath || ""
|
|
4683
|
+
|
|
4684
|
+
/* harmony default export */ const request = (getInstance(prefixPath));
|
|
4685
|
+
|
|
4686
|
+
;// ./src/index.js
|
|
4687
|
+
|
|
4688
|
+
|
|
4689
|
+
/**
|
|
4690
|
+
* 查询资产
|
|
4691
|
+
* @param id 资产ID
|
|
4692
|
+
*
|
|
4693
|
+
*/
|
|
4694
|
+
const queryAssetById = (id, count = 200) =>
|
|
4695
|
+
request.post(`/asset/getAssetData?asset_id=${id}&count=${count}`, { filters: [] });
|
|
4696
|
+
|
|
4697
|
+
|
|
4698
|
+
/**
|
|
4699
|
+
* 查询当前企业门户菜单信息
|
|
4700
|
+
* @param id GroupID
|
|
4701
|
+
*
|
|
4702
|
+
*/
|
|
4703
|
+
const getMenuDatasByGroupID =async (id) =>{
|
|
4704
|
+
let queryData_groupData = {
|
|
4705
|
+
"param": {
|
|
4706
|
+
"id": id
|
|
4707
|
+
}
|
|
4708
|
+
};
|
|
4709
|
+
let result =await request.post(`/dataservice/rest/orchestration/getMenuDatasByGroupID`,queryData_groupData);
|
|
4710
|
+
let portalMenuDatas = result.data.resultDatas;
|
|
4711
|
+
portalMenuDatas =transformPortalData(portalMenuDatas);
|
|
4712
|
+
//获取菜单数据
|
|
4713
|
+
return portalMenuDatas;
|
|
4714
|
+
};
|
|
4715
|
+
|
|
4716
|
+
const transformPortalData =(datas) =>{
|
|
4717
|
+
// console.log(datas);
|
|
4718
|
+
let menuMaps={};
|
|
4719
|
+
for (const data of datas) {
|
|
4720
|
+
let id = data.id;
|
|
4721
|
+
let tempMenuData={
|
|
4722
|
+
id:data.menu_id,
|
|
4723
|
+
name:data.title,
|
|
4724
|
+
sort:data.sort,
|
|
4725
|
+
actionType:data.actionType,
|
|
4726
|
+
url:data.url,
|
|
4727
|
+
iconClass:data.image,
|
|
4728
|
+
types:[],
|
|
4729
|
+
app_id:data.app_id,
|
|
4730
|
+
menu_id:data.menu_id,
|
|
4731
|
+
beyond_type:data.menu_type_name?data.menu_type_name:"其他",
|
|
4732
|
+
beyond_type_sort:data.menu_type_sort?data.menu_type_sort:999,
|
|
4733
|
+
}
|
|
4734
|
+
menuMaps[id]=tempMenuData;
|
|
4735
|
+
}
|
|
4736
|
+
for (const data of datas) {
|
|
4737
|
+
let type = data.type;
|
|
4738
|
+
//5:子菜单入口
|
|
4739
|
+
if(type =="5")
|
|
4740
|
+
{
|
|
4741
|
+
let tempMenuData =menuMaps[data.id];
|
|
4742
|
+
let parent_id =data.parent_id;
|
|
4743
|
+
let tempType =tempMenuData.beyond_type;
|
|
4744
|
+
let tempType_sort =tempMenuData.beyond_type_sort;
|
|
4745
|
+
let tempParentMenu = menuMaps[parent_id];
|
|
4746
|
+
let parentTypes=tempParentMenu.types;
|
|
4747
|
+
let parentType=parentTypes.find((tempTypeItem)=>{return tempTypeItem.name==tempType});
|
|
4748
|
+
if(parentType)
|
|
4749
|
+
{
|
|
4750
|
+
let type_childens =parentType.children;
|
|
4751
|
+
type_childens.push(tempMenuData);
|
|
4752
|
+
}
|
|
4753
|
+
else
|
|
4754
|
+
{
|
|
4755
|
+
let parentType = {name:tempType,children:[],sort:tempType_sort};
|
|
4756
|
+
let type_childens =parentType.children;
|
|
4757
|
+
type_childens.push(tempMenuData);
|
|
4758
|
+
parentTypes.push(parentType);
|
|
4759
|
+
}
|
|
4760
|
+
}
|
|
4761
|
+
}
|
|
4762
|
+
const menuList =[];
|
|
4763
|
+
for (const data of datas) {
|
|
4764
|
+
let type = data.type;
|
|
4765
|
+
//4:主菜单入口
|
|
4766
|
+
if(type =="4")
|
|
4767
|
+
{
|
|
4768
|
+
let tempMenuData =menuMaps[data.id];
|
|
4769
|
+
menuList.push(tempMenuData);
|
|
4770
|
+
let types = tempMenuData.types;
|
|
4771
|
+
types.sort((data1,data2)=>{
|
|
4772
|
+
if(Number.isNaN(data1.sort)) return 1;
|
|
4773
|
+
if(Number.isNaN(data2.sort)) return -1;
|
|
4774
|
+
return data1.sort - data2.sort;
|
|
4775
|
+
});
|
|
4776
|
+
for(let typeItem of types)
|
|
4777
|
+
{
|
|
4778
|
+
let tempArrys =typeItem.children;
|
|
4779
|
+
tempArrys.sort((data1,data2)=>{
|
|
4780
|
+
if(Number.isNaN(data1.sort)) return 1;
|
|
4781
|
+
if(Number.isNaN(data2.sort)) return -1;
|
|
4782
|
+
return data1.sort - data2.sort;
|
|
4783
|
+
});
|
|
4784
|
+
}
|
|
4785
|
+
}
|
|
4786
|
+
}
|
|
4787
|
+
menuList.sort((data1,data2)=>{
|
|
4788
|
+
if(Number.isNaN(data1.sort)) return 1;
|
|
4789
|
+
if(Number.isNaN(data2.sort)) return -1;
|
|
4790
|
+
return data1.sort - data2.sort;
|
|
4791
|
+
});
|
|
4792
|
+
// console.log(menuList);
|
|
4793
|
+
return menuList;
|
|
4794
|
+
}
|
|
4795
|
+
|
|
4796
|
+
/**
|
|
4797
|
+
* 查询当前企业组织的集团组织ID
|
|
4798
|
+
* @param id 组织ID
|
|
4799
|
+
*
|
|
4800
|
+
*/
|
|
4801
|
+
const queryGroupIDByOfficeId =async(id) =>{
|
|
4802
|
+
let queryData_office = {
|
|
4803
|
+
"param": {
|
|
4804
|
+
"id": id
|
|
4805
|
+
}
|
|
4806
|
+
};
|
|
4807
|
+
let result =await request.post(`/dataservice/rest/orchestration/getGroupIDByDptID`,queryData_office);
|
|
4808
|
+
let groupDptData = result.data.resultDptData;
|
|
4809
|
+
let group_id = groupDptData.id;
|
|
4810
|
+
return group_id;
|
|
4811
|
+
};
|
|
4812
|
+
|
|
4813
|
+
|
|
4814
|
+
})();
|
|
4815
|
+
|
|
4816
|
+
module.exports = __webpack_exports__;
|
|
4817
|
+
/******/ })()
|
|
4818
|
+
;
|