@tencentcloud/sdk-mcp 1.0.2 → 1.0.4

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