axios_rails 0.7.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -8
- data/app/assets/javascripts/axios.js +1287 -954
- data/app/assets/javascripts/axios.map +1 -0
- data/app/assets/javascripts/axios.min.js +3 -3
- data/app/assets/javascripts/axios.min.map +1 -0
- data/lib/axios_rails/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdc2fdf9e0a7157fe6da2ebab1d50723f6f1887a
|
4
|
+
data.tar.gz: eebf158ff5bad0565ec91b0cd7ac478e60620c6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c21502f3960976185635ee929b2a03cf98cd2ccad942b9db79bc60fa1ff4833a4d1ccab7970f300755492b52232bb1ae003d94a2ebe0ec31cea854789ba511e
|
7
|
+
data.tar.gz: da638429dad5c54e8038e94b7eb4f61b4247883b296d3d3b03570bd9e30e35a14fb5fbba4eba067bcb1635bce9cfb182feb97bff30232284044d385f8c4f3c2c
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Do you like [Axios](https://github.com/mzabriskie/axios)? Now it is ready to use
|
|
4
4
|
|
5
5
|
##Version
|
6
6
|
|
7
|
-
The latest version of this gem bundles axios v0.
|
7
|
+
The latest version of this gem bundles axios v0.14.0.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -26,12 +26,6 @@ Add it to your JavaScript manifest file:
|
|
26
26
|
|
27
27
|
//= require axios
|
28
28
|
|
29
|
-
## Development
|
30
|
-
|
31
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
32
|
-
|
33
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
34
|
-
|
35
29
|
## Contributing
|
36
30
|
|
37
31
|
Bug reports and pull requests are welcome on GitHub at https://github.com/katherineMuedas/axios_rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
@@ -40,4 +34,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/kather
|
|
40
34
|
## License
|
41
35
|
|
42
36
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
43
|
-
|
@@ -1,1067 +1,1400 @@
|
|
1
|
-
/* axios v0.
|
1
|
+
/* axios v0.14.0 | (c) 2016 by Matt Zabriskie */
|
2
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
4
|
+
module.exports = factory();
|
5
|
+
else if(typeof define === 'function' && define.amd)
|
6
|
+
define([], factory);
|
7
|
+
else if(typeof exports === 'object')
|
8
|
+
exports["axios"] = factory();
|
9
|
+
else
|
10
|
+
root["axios"] = factory();
|
11
11
|
})(this, function() {
|
12
12
|
return /******/ (function(modules) { // webpackBootstrap
|
13
|
-
/******/
|
14
|
-
/******/
|
13
|
+
/******/ // The module cache
|
14
|
+
/******/ var installedModules = {};
|
15
15
|
/******/
|
16
|
-
/******/
|
17
|
-
/******/
|
16
|
+
/******/ // The require function
|
17
|
+
/******/ function __webpack_require__(moduleId) {
|
18
18
|
/******/
|
19
|
-
/******/
|
20
|
-
/******/
|
21
|
-
/******/
|
19
|
+
/******/ // Check if module is in cache
|
20
|
+
/******/ if(installedModules[moduleId])
|
21
|
+
/******/ return installedModules[moduleId].exports;
|
22
22
|
/******/
|
23
|
-
/******/
|
24
|
-
/******/
|
25
|
-
/******/
|
26
|
-
/******/
|
27
|
-
/******/
|
28
|
-
/******/
|
23
|
+
/******/ // Create a new module (and put it into the cache)
|
24
|
+
/******/ var module = installedModules[moduleId] = {
|
25
|
+
/******/ exports: {},
|
26
|
+
/******/ id: moduleId,
|
27
|
+
/******/ loaded: false
|
28
|
+
/******/ };
|
29
29
|
/******/
|
30
|
-
/******/
|
31
|
-
/******/
|
30
|
+
/******/ // Execute the module function
|
31
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
32
32
|
/******/
|
33
|
-
/******/
|
34
|
-
/******/
|
33
|
+
/******/ // Flag the module as loaded
|
34
|
+
/******/ module.loaded = true;
|
35
35
|
/******/
|
36
|
-
/******/
|
37
|
-
/******/
|
38
|
-
/******/
|
36
|
+
/******/ // Return the exports of the module
|
37
|
+
/******/ return module.exports;
|
38
|
+
/******/ }
|
39
39
|
/******/
|
40
40
|
/******/
|
41
|
-
/******/
|
42
|
-
/******/
|
41
|
+
/******/ // expose the modules object (__webpack_modules__)
|
42
|
+
/******/ __webpack_require__.m = modules;
|
43
43
|
/******/
|
44
|
-
/******/
|
45
|
-
/******/
|
44
|
+
/******/ // expose the module cache
|
45
|
+
/******/ __webpack_require__.c = installedModules;
|
46
46
|
/******/
|
47
|
-
/******/
|
48
|
-
/******/
|
47
|
+
/******/ // __webpack_public_path__
|
48
|
+
/******/ __webpack_require__.p = "";
|
49
49
|
/******/
|
50
|
-
/******/
|
51
|
-
/******/
|
50
|
+
/******/ // Load entry module and return exports
|
51
|
+
/******/ return __webpack_require__(0);
|
52
52
|
/******/ })
|
53
53
|
/************************************************************************/
|
54
54
|
/******/ ([
|
55
55
|
/* 0 */
|
56
56
|
/***/ function(module, exports, __webpack_require__) {
|
57
57
|
|
58
|
-
|
58
|
+
module.exports = __webpack_require__(1);
|
59
59
|
|
60
60
|
/***/ },
|
61
61
|
/* 1 */
|
62
62
|
/***/ function(module, exports, __webpack_require__) {
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
axios.defaults = defaults;
|
111
|
-
|
112
|
-
// Expose all/spread
|
113
|
-
axios.all = function (promises) {
|
114
|
-
return Promise.all(promises);
|
115
|
-
};
|
116
|
-
axios.spread = __webpack_require__(13);
|
117
|
-
|
118
|
-
// Expose interceptors
|
119
|
-
axios.interceptors = {
|
120
|
-
request: new InterceptorManager(),
|
121
|
-
response: new InterceptorManager()
|
122
|
-
};
|
123
|
-
|
124
|
-
// Provide aliases for supported request methods
|
125
|
-
(function () {
|
126
|
-
function createShortMethods() {
|
127
|
-
utils.forEach(arguments, function (method) {
|
128
|
-
axios[method] = function (url, config) {
|
129
|
-
return axios(utils.merge(config || {}, {
|
130
|
-
method: method,
|
131
|
-
url: url
|
132
|
-
}));
|
133
|
-
};
|
134
|
-
});
|
135
|
-
}
|
136
|
-
|
137
|
-
function createShortMethodsWithData() {
|
138
|
-
utils.forEach(arguments, function (method) {
|
139
|
-
axios[method] = function (url, data, config) {
|
140
|
-
return axios(utils.merge(config || {}, {
|
141
|
-
method: method,
|
142
|
-
url: url,
|
143
|
-
data: data
|
144
|
-
}));
|
145
|
-
};
|
146
|
-
});
|
147
|
-
}
|
148
|
-
|
149
|
-
createShortMethods('delete', 'get', 'head');
|
150
|
-
createShortMethodsWithData('post', 'put', 'patch');
|
151
|
-
})();
|
64
|
+
'use strict';
|
65
|
+
|
66
|
+
var utils = __webpack_require__(2);
|
67
|
+
var bind = __webpack_require__(3);
|
68
|
+
var Axios = __webpack_require__(4);
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Create an instance of Axios
|
72
|
+
*
|
73
|
+
* @param {Object} defaultConfig The default config for the instance
|
74
|
+
* @return {Axios} A new instance of Axios
|
75
|
+
*/
|
76
|
+
function createInstance(defaultConfig) {
|
77
|
+
var context = new Axios(defaultConfig);
|
78
|
+
var instance = bind(Axios.prototype.request, context);
|
79
|
+
|
80
|
+
// Copy axios.prototype to instance
|
81
|
+
utils.extend(instance, Axios.prototype, context);
|
82
|
+
|
83
|
+
// Copy context to instance
|
84
|
+
utils.extend(instance, context);
|
85
|
+
|
86
|
+
return instance;
|
87
|
+
}
|
88
|
+
|
89
|
+
// Create the default instance to be exported
|
90
|
+
var axios = createInstance();
|
91
|
+
|
92
|
+
// Expose Axios class to allow class inheritance
|
93
|
+
axios.Axios = Axios;
|
94
|
+
|
95
|
+
// Factory for creating new instances
|
96
|
+
axios.create = function create(defaultConfig) {
|
97
|
+
return createInstance(defaultConfig);
|
98
|
+
};
|
99
|
+
|
100
|
+
// Expose all/spread
|
101
|
+
axios.all = function all(promises) {
|
102
|
+
return Promise.all(promises);
|
103
|
+
};
|
104
|
+
axios.spread = __webpack_require__(21);
|
105
|
+
|
106
|
+
module.exports = axios;
|
107
|
+
|
108
|
+
// Allow use of default import syntax in TypeScript
|
109
|
+
module.exports.default = axios;
|
152
110
|
|
153
111
|
|
154
112
|
/***/ },
|
155
113
|
/* 2 */
|
156
114
|
/***/ function(module, exports, __webpack_require__) {
|
157
115
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
116
|
+
'use strict';
|
117
|
+
|
118
|
+
var bind = __webpack_require__(3);
|
119
|
+
|
120
|
+
/*global toString:true*/
|
121
|
+
|
122
|
+
// utils is a library of generic helper functions non-specific to axios
|
123
|
+
|
124
|
+
var toString = Object.prototype.toString;
|
125
|
+
|
126
|
+
/**
|
127
|
+
* Determine if a value is an Array
|
128
|
+
*
|
129
|
+
* @param {Object} val The value to test
|
130
|
+
* @returns {boolean} True if value is an Array, otherwise false
|
131
|
+
*/
|
132
|
+
function isArray(val) {
|
133
|
+
return toString.call(val) === '[object Array]';
|
134
|
+
}
|
135
|
+
|
136
|
+
/**
|
137
|
+
* Determine if a value is an ArrayBuffer
|
138
|
+
*
|
139
|
+
* @param {Object} val The value to test
|
140
|
+
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
141
|
+
*/
|
142
|
+
function isArrayBuffer(val) {
|
143
|
+
return toString.call(val) === '[object ArrayBuffer]';
|
144
|
+
}
|
145
|
+
|
146
|
+
/**
|
147
|
+
* Determine if a value is a FormData
|
148
|
+
*
|
149
|
+
* @param {Object} val The value to test
|
150
|
+
* @returns {boolean} True if value is an FormData, otherwise false
|
151
|
+
*/
|
152
|
+
function isFormData(val) {
|
153
|
+
return (typeof FormData !== 'undefined') && (val instanceof FormData);
|
154
|
+
}
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Determine if a value is a view on an ArrayBuffer
|
158
|
+
*
|
159
|
+
* @param {Object} val The value to test
|
160
|
+
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
161
|
+
*/
|
162
|
+
function isArrayBufferView(val) {
|
163
|
+
var result;
|
164
|
+
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
165
|
+
result = ArrayBuffer.isView(val);
|
166
|
+
} else {
|
167
|
+
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
|
168
|
+
}
|
169
|
+
return result;
|
170
|
+
}
|
171
|
+
|
172
|
+
/**
|
173
|
+
* Determine if a value is a String
|
174
|
+
*
|
175
|
+
* @param {Object} val The value to test
|
176
|
+
* @returns {boolean} True if value is a String, otherwise false
|
177
|
+
*/
|
178
|
+
function isString(val) {
|
179
|
+
return typeof val === 'string';
|
180
|
+
}
|
181
|
+
|
182
|
+
/**
|
183
|
+
* Determine if a value is a Number
|
184
|
+
*
|
185
|
+
* @param {Object} val The value to test
|
186
|
+
* @returns {boolean} True if value is a Number, otherwise false
|
187
|
+
*/
|
188
|
+
function isNumber(val) {
|
189
|
+
return typeof val === 'number';
|
190
|
+
}
|
191
|
+
|
192
|
+
/**
|
193
|
+
* Determine if a value is undefined
|
194
|
+
*
|
195
|
+
* @param {Object} val The value to test
|
196
|
+
* @returns {boolean} True if the value is undefined, otherwise false
|
197
|
+
*/
|
198
|
+
function isUndefined(val) {
|
199
|
+
return typeof val === 'undefined';
|
200
|
+
}
|
201
|
+
|
202
|
+
/**
|
203
|
+
* Determine if a value is an Object
|
204
|
+
*
|
205
|
+
* @param {Object} val The value to test
|
206
|
+
* @returns {boolean} True if value is an Object, otherwise false
|
207
|
+
*/
|
208
|
+
function isObject(val) {
|
209
|
+
return val !== null && typeof val === 'object';
|
210
|
+
}
|
211
|
+
|
212
|
+
/**
|
213
|
+
* Determine if a value is a Date
|
214
|
+
*
|
215
|
+
* @param {Object} val The value to test
|
216
|
+
* @returns {boolean} True if value is a Date, otherwise false
|
217
|
+
*/
|
218
|
+
function isDate(val) {
|
219
|
+
return toString.call(val) === '[object Date]';
|
220
|
+
}
|
221
|
+
|
222
|
+
/**
|
223
|
+
* Determine if a value is a File
|
224
|
+
*
|
225
|
+
* @param {Object} val The value to test
|
226
|
+
* @returns {boolean} True if value is a File, otherwise false
|
227
|
+
*/
|
228
|
+
function isFile(val) {
|
229
|
+
return toString.call(val) === '[object File]';
|
230
|
+
}
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Determine if a value is a Blob
|
234
|
+
*
|
235
|
+
* @param {Object} val The value to test
|
236
|
+
* @returns {boolean} True if value is a Blob, otherwise false
|
237
|
+
*/
|
238
|
+
function isBlob(val) {
|
239
|
+
return toString.call(val) === '[object Blob]';
|
240
|
+
}
|
241
|
+
|
242
|
+
/**
|
243
|
+
* Determine if a value is a Function
|
244
|
+
*
|
245
|
+
* @param {Object} val The value to test
|
246
|
+
* @returns {boolean} True if value is a Function, otherwise false
|
247
|
+
*/
|
248
|
+
function isFunction(val) {
|
249
|
+
return toString.call(val) === '[object Function]';
|
250
|
+
}
|
251
|
+
|
252
|
+
/**
|
253
|
+
* Determine if a value is a Stream
|
254
|
+
*
|
255
|
+
* @param {Object} val The value to test
|
256
|
+
* @returns {boolean} True if value is a Stream, otherwise false
|
257
|
+
*/
|
258
|
+
function isStream(val) {
|
259
|
+
return isObject(val) && isFunction(val.pipe);
|
260
|
+
}
|
261
|
+
|
262
|
+
/**
|
263
|
+
* Determine if a value is a URLSearchParams object
|
264
|
+
*
|
265
|
+
* @param {Object} val The value to test
|
266
|
+
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
|
267
|
+
*/
|
268
|
+
function isURLSearchParams(val) {
|
269
|
+
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
|
270
|
+
}
|
271
|
+
|
272
|
+
/**
|
273
|
+
* Trim excess whitespace off the beginning and end of a string
|
274
|
+
*
|
275
|
+
* @param {String} str The String to trim
|
276
|
+
* @returns {String} The String freed of excess whitespace
|
277
|
+
*/
|
278
|
+
function trim(str) {
|
279
|
+
return str.replace(/^\s*/, '').replace(/\s*$/, '');
|
280
|
+
}
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Determine if we're running in a standard browser environment
|
284
|
+
*
|
285
|
+
* This allows axios to run in a web worker, and react-native.
|
286
|
+
* Both environments support XMLHttpRequest, but not fully standard globals.
|
287
|
+
*
|
288
|
+
* web workers:
|
289
|
+
* typeof window -> undefined
|
290
|
+
* typeof document -> undefined
|
291
|
+
*
|
292
|
+
* react-native:
|
293
|
+
* typeof document.createElement -> undefined
|
294
|
+
*/
|
295
|
+
function isStandardBrowserEnv() {
|
296
|
+
return (
|
297
|
+
typeof window !== 'undefined' &&
|
298
|
+
typeof document !== 'undefined' &&
|
299
|
+
typeof document.createElement === 'function'
|
300
|
+
);
|
301
|
+
}
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Iterate over an Array or an Object invoking a function for each item.
|
305
|
+
*
|
306
|
+
* If `obj` is an Array callback will be called passing
|
307
|
+
* the value, index, and complete array for each item.
|
308
|
+
*
|
309
|
+
* If 'obj' is an Object callback will be called passing
|
310
|
+
* the value, key, and complete object for each property.
|
311
|
+
*
|
312
|
+
* @param {Object|Array} obj The object to iterate
|
313
|
+
* @param {Function} fn The callback to invoke for each item
|
314
|
+
*/
|
315
|
+
function forEach(obj, fn) {
|
316
|
+
// Don't bother if no value provided
|
317
|
+
if (obj === null || typeof obj === 'undefined') {
|
318
|
+
return;
|
319
|
+
}
|
320
|
+
|
321
|
+
// Force an array if not already something iterable
|
322
|
+
if (typeof obj !== 'object' && !isArray(obj)) {
|
323
|
+
/*eslint no-param-reassign:0*/
|
324
|
+
obj = [obj];
|
325
|
+
}
|
326
|
+
|
327
|
+
if (isArray(obj)) {
|
328
|
+
// Iterate over array values
|
329
|
+
for (var i = 0, l = obj.length; i < l; i++) {
|
330
|
+
fn.call(null, obj[i], i, obj);
|
331
|
+
}
|
332
|
+
} else {
|
333
|
+
// Iterate over object keys
|
334
|
+
for (var key in obj) {
|
335
|
+
if (obj.hasOwnProperty(key)) {
|
336
|
+
fn.call(null, obj[key], key, obj);
|
337
|
+
}
|
338
|
+
}
|
339
|
+
}
|
340
|
+
}
|
341
|
+
|
342
|
+
/**
|
343
|
+
* Accepts varargs expecting each argument to be an object, then
|
344
|
+
* immutably merges the properties of each object and returns result.
|
345
|
+
*
|
346
|
+
* When multiple objects contain the same key the later object in
|
347
|
+
* the arguments list will take precedence.
|
348
|
+
*
|
349
|
+
* Example:
|
350
|
+
*
|
351
|
+
* ```js
|
352
|
+
* var result = merge({foo: 123}, {foo: 456});
|
353
|
+
* console.log(result.foo); // outputs 456
|
354
|
+
* ```
|
355
|
+
*
|
356
|
+
* @param {Object} obj1 Object to merge
|
357
|
+
* @returns {Object} Result of all merge properties
|
358
|
+
*/
|
359
|
+
function merge(/* obj1, obj2, obj3, ... */) {
|
360
|
+
var result = {};
|
361
|
+
function assignValue(val, key) {
|
362
|
+
if (typeof result[key] === 'object' && typeof val === 'object') {
|
363
|
+
result[key] = merge(result[key], val);
|
364
|
+
} else {
|
365
|
+
result[key] = val;
|
366
|
+
}
|
367
|
+
}
|
368
|
+
|
369
|
+
for (var i = 0, l = arguments.length; i < l; i++) {
|
370
|
+
forEach(arguments[i], assignValue);
|
371
|
+
}
|
372
|
+
return result;
|
373
|
+
}
|
374
|
+
|
375
|
+
/**
|
376
|
+
* Extends object a by mutably adding to it the properties of object b.
|
377
|
+
*
|
378
|
+
* @param {Object} a The object to be extended
|
379
|
+
* @param {Object} b The object to copy properties from
|
380
|
+
* @param {Object} thisArg The object to bind function to
|
381
|
+
* @return {Object} The resulting value of object a
|
382
|
+
*/
|
383
|
+
function extend(a, b, thisArg) {
|
384
|
+
forEach(b, function assignValue(val, key) {
|
385
|
+
if (thisArg && typeof val === 'function') {
|
386
|
+
a[key] = bind(val, thisArg);
|
387
|
+
} else {
|
388
|
+
a[key] = val;
|
389
|
+
}
|
390
|
+
});
|
391
|
+
return a;
|
392
|
+
}
|
393
|
+
|
394
|
+
module.exports = {
|
395
|
+
isArray: isArray,
|
396
|
+
isArrayBuffer: isArrayBuffer,
|
397
|
+
isFormData: isFormData,
|
398
|
+
isArrayBufferView: isArrayBufferView,
|
399
|
+
isString: isString,
|
400
|
+
isNumber: isNumber,
|
401
|
+
isObject: isObject,
|
402
|
+
isUndefined: isUndefined,
|
403
|
+
isDate: isDate,
|
404
|
+
isFile: isFile,
|
405
|
+
isBlob: isBlob,
|
406
|
+
isFunction: isFunction,
|
407
|
+
isStream: isStream,
|
408
|
+
isURLSearchParams: isURLSearchParams,
|
409
|
+
isStandardBrowserEnv: isStandardBrowserEnv,
|
410
|
+
forEach: forEach,
|
411
|
+
merge: merge,
|
412
|
+
extend: extend,
|
413
|
+
trim: trim
|
414
|
+
};
|
220
415
|
|
221
416
|
|
222
417
|
/***/ },
|
223
418
|
/* 3 */
|
224
419
|
/***/ function(module, exports) {
|
225
420
|
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
* @param {Object} val The value to test
|
238
|
-
* @returns {boolean} True if value is an Array, otherwise false
|
239
|
-
*/
|
240
|
-
function isArray(val) {
|
241
|
-
return toString.call(val) === '[object Array]';
|
242
|
-
}
|
243
|
-
|
244
|
-
/**
|
245
|
-
* Determine if a value is an ArrayBuffer
|
246
|
-
*
|
247
|
-
* @param {Object} val The value to test
|
248
|
-
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
|
249
|
-
*/
|
250
|
-
function isArrayBuffer(val) {
|
251
|
-
return toString.call(val) === '[object ArrayBuffer]';
|
252
|
-
}
|
253
|
-
|
254
|
-
/**
|
255
|
-
* Determine if a value is a FormData
|
256
|
-
*
|
257
|
-
* @param {Object} val The value to test
|
258
|
-
* @returns {boolean} True if value is an FormData, otherwise false
|
259
|
-
*/
|
260
|
-
function isFormData(val) {
|
261
|
-
return toString.call(val) === '[object FormData]';
|
262
|
-
}
|
263
|
-
|
264
|
-
/**
|
265
|
-
* Determine if a value is a view on an ArrayBuffer
|
266
|
-
*
|
267
|
-
* @param {Object} val The value to test
|
268
|
-
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
|
269
|
-
*/
|
270
|
-
function isArrayBufferView(val) {
|
271
|
-
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
|
272
|
-
return ArrayBuffer.isView(val);
|
273
|
-
} else {
|
274
|
-
return (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
|
275
|
-
}
|
276
|
-
}
|
277
|
-
|
278
|
-
/**
|
279
|
-
* Determine if a value is a String
|
280
|
-
*
|
281
|
-
* @param {Object} val The value to test
|
282
|
-
* @returns {boolean} True if value is a String, otherwise false
|
283
|
-
*/
|
284
|
-
function isString(val) {
|
285
|
-
return typeof val === 'string';
|
286
|
-
}
|
287
|
-
|
288
|
-
/**
|
289
|
-
* Determine if a value is a Number
|
290
|
-
*
|
291
|
-
* @param {Object} val The value to test
|
292
|
-
* @returns {boolean} True if value is a Number, otherwise false
|
293
|
-
*/
|
294
|
-
function isNumber(val) {
|
295
|
-
return typeof val === 'number';
|
296
|
-
}
|
297
|
-
|
298
|
-
/**
|
299
|
-
* Determine if a value is undefined
|
300
|
-
*
|
301
|
-
* @param {Object} val The value to test
|
302
|
-
* @returns {boolean} True if the value is undefined, otherwise false
|
303
|
-
*/
|
304
|
-
function isUndefined(val) {
|
305
|
-
return typeof val === 'undefined';
|
306
|
-
}
|
307
|
-
|
308
|
-
/**
|
309
|
-
* Determine if a value is an Object
|
310
|
-
*
|
311
|
-
* @param {Object} val The value to test
|
312
|
-
* @returns {boolean} True if value is an Object, otherwise false
|
313
|
-
*/
|
314
|
-
function isObject(val) {
|
315
|
-
return val !== null && typeof val === 'object';
|
316
|
-
}
|
317
|
-
|
318
|
-
/**
|
319
|
-
* Determine if a value is a Date
|
320
|
-
*
|
321
|
-
* @param {Object} val The value to test
|
322
|
-
* @returns {boolean} True if value is a Date, otherwise false
|
323
|
-
*/
|
324
|
-
function isDate(val) {
|
325
|
-
return toString.call(val) === '[object Date]';
|
326
|
-
}
|
327
|
-
|
328
|
-
/**
|
329
|
-
* Determine if a value is a File
|
330
|
-
*
|
331
|
-
* @param {Object} val The value to test
|
332
|
-
* @returns {boolean} True if value is a File, otherwise false
|
333
|
-
*/
|
334
|
-
function isFile(val) {
|
335
|
-
return toString.call(val) === '[object File]';
|
336
|
-
}
|
337
|
-
|
338
|
-
/**
|
339
|
-
* Determine if a value is a Blob
|
340
|
-
*
|
341
|
-
* @param {Object} val The value to test
|
342
|
-
* @returns {boolean} True if value is a Blob, otherwise false
|
343
|
-
*/
|
344
|
-
function isBlob(val) {
|
345
|
-
return toString.call(val) === '[object Blob]';
|
346
|
-
}
|
347
|
-
|
348
|
-
/**
|
349
|
-
* Trim excess whitespace off the beginning and end of a string
|
350
|
-
*
|
351
|
-
* @param {String} str The String to trim
|
352
|
-
* @returns {String} The String freed of excess whitespace
|
353
|
-
*/
|
354
|
-
function trim(str) {
|
355
|
-
return str.replace(/^\s*/, '').replace(/\s*$/, '');
|
356
|
-
}
|
357
|
-
|
358
|
-
/**
|
359
|
-
* Determine if a value is an Arguments object
|
360
|
-
*
|
361
|
-
* @param {Object} val The value to test
|
362
|
-
* @returns {boolean} True if value is an Arguments object, otherwise false
|
363
|
-
*/
|
364
|
-
function isArguments(val) {
|
365
|
-
return toString.call(val) === '[object Arguments]';
|
366
|
-
}
|
367
|
-
|
368
|
-
/**
|
369
|
-
* Determine if we're running in a standard browser environment
|
370
|
-
*
|
371
|
-
* This allows axios to run in a web worker, and react-native.
|
372
|
-
* Both environments support XMLHttpRequest, but not fully standard globals.
|
373
|
-
*
|
374
|
-
* web workers:
|
375
|
-
* typeof window -> undefined
|
376
|
-
* typeof document -> undefined
|
377
|
-
*
|
378
|
-
* react-native:
|
379
|
-
* typeof document.createelement -> undefined
|
380
|
-
*/
|
381
|
-
function isStandardBrowserEnv() {
|
382
|
-
return (
|
383
|
-
typeof window !== 'undefined' &&
|
384
|
-
typeof document !== 'undefined' &&
|
385
|
-
typeof document.createElement === 'function'
|
386
|
-
);
|
387
|
-
}
|
388
|
-
|
389
|
-
/**
|
390
|
-
* Iterate over an Array or an Object invoking a function for each item.
|
391
|
-
*
|
392
|
-
* If `obj` is an Array or arguments callback will be called passing
|
393
|
-
* the value, index, and complete array for each item.
|
394
|
-
*
|
395
|
-
* If 'obj' is an Object callback will be called passing
|
396
|
-
* the value, key, and complete object for each property.
|
397
|
-
*
|
398
|
-
* @param {Object|Array} obj The object to iterate
|
399
|
-
* @param {Function} fn The callback to invoke for each item
|
400
|
-
*/
|
401
|
-
function forEach(obj, fn) {
|
402
|
-
// Don't bother if no value provided
|
403
|
-
if (obj === null || typeof obj === 'undefined') {
|
404
|
-
return;
|
405
|
-
}
|
406
|
-
|
407
|
-
// Check if obj is array-like
|
408
|
-
var isArrayLike = isArray(obj) || isArguments(obj);
|
409
|
-
|
410
|
-
// Force an array if not already something iterable
|
411
|
-
if (typeof obj !== 'object' && !isArrayLike) {
|
412
|
-
obj = [obj];
|
413
|
-
}
|
414
|
-
|
415
|
-
// Iterate over array values
|
416
|
-
if (isArrayLike) {
|
417
|
-
for (var i = 0, l = obj.length; i < l; i++) {
|
418
|
-
fn.call(null, obj[i], i, obj);
|
419
|
-
}
|
420
|
-
}
|
421
|
-
// Iterate over object keys
|
422
|
-
else {
|
423
|
-
for (var key in obj) {
|
424
|
-
if (obj.hasOwnProperty(key)) {
|
425
|
-
fn.call(null, obj[key], key, obj);
|
426
|
-
}
|
427
|
-
}
|
428
|
-
}
|
429
|
-
}
|
430
|
-
|
431
|
-
/**
|
432
|
-
* Accepts varargs expecting each argument to be an object, then
|
433
|
-
* immutably merges the properties of each object and returns result.
|
434
|
-
*
|
435
|
-
* When multiple objects contain the same key the later object in
|
436
|
-
* the arguments list will take precedence.
|
437
|
-
*
|
438
|
-
* Example:
|
439
|
-
*
|
440
|
-
* ```js
|
441
|
-
* var result = merge({foo: 123}, {foo: 456});
|
442
|
-
* console.log(result.foo); // outputs 456
|
443
|
-
* ```
|
444
|
-
*
|
445
|
-
* @param {Object} obj1 Object to merge
|
446
|
-
* @returns {Object} Result of all merge properties
|
447
|
-
*/
|
448
|
-
function merge(/*obj1, obj2, obj3, ...*/) {
|
449
|
-
var result = {};
|
450
|
-
forEach(arguments, function (obj) {
|
451
|
-
forEach(obj, function (val, key) {
|
452
|
-
result[key] = val;
|
453
|
-
});
|
454
|
-
});
|
455
|
-
return result;
|
456
|
-
}
|
457
|
-
|
458
|
-
module.exports = {
|
459
|
-
isArray: isArray,
|
460
|
-
isArrayBuffer: isArrayBuffer,
|
461
|
-
isFormData: isFormData,
|
462
|
-
isArrayBufferView: isArrayBufferView,
|
463
|
-
isString: isString,
|
464
|
-
isNumber: isNumber,
|
465
|
-
isObject: isObject,
|
466
|
-
isUndefined: isUndefined,
|
467
|
-
isDate: isDate,
|
468
|
-
isFile: isFile,
|
469
|
-
isBlob: isBlob,
|
470
|
-
isStandardBrowserEnv: isStandardBrowserEnv,
|
471
|
-
forEach: forEach,
|
472
|
-
merge: merge,
|
473
|
-
trim: trim
|
474
|
-
};
|
421
|
+
'use strict';
|
422
|
+
|
423
|
+
module.exports = function bind(fn, thisArg) {
|
424
|
+
return function wrap() {
|
425
|
+
var args = new Array(arguments.length);
|
426
|
+
for (var i = 0; i < args.length; i++) {
|
427
|
+
args[i] = arguments[i];
|
428
|
+
}
|
429
|
+
return fn.apply(thisArg, args);
|
430
|
+
};
|
431
|
+
};
|
475
432
|
|
476
433
|
|
477
434
|
/***/ },
|
478
435
|
/* 4 */
|
479
436
|
/***/ function(module, exports, __webpack_require__) {
|
480
437
|
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
438
|
+
'use strict';
|
439
|
+
|
440
|
+
var defaults = __webpack_require__(5);
|
441
|
+
var utils = __webpack_require__(2);
|
442
|
+
var InterceptorManager = __webpack_require__(7);
|
443
|
+
var dispatchRequest = __webpack_require__(8);
|
444
|
+
var isAbsoluteURL = __webpack_require__(19);
|
445
|
+
var combineURLs = __webpack_require__(20);
|
446
|
+
|
447
|
+
/**
|
448
|
+
* Create a new instance of Axios
|
449
|
+
*
|
450
|
+
* @param {Object} defaultConfig The default config for the instance
|
451
|
+
*/
|
452
|
+
function Axios(defaultConfig) {
|
453
|
+
this.defaults = utils.merge(defaults, defaultConfig);
|
454
|
+
this.interceptors = {
|
455
|
+
request: new InterceptorManager(),
|
456
|
+
response: new InterceptorManager()
|
457
|
+
};
|
458
|
+
}
|
459
|
+
|
460
|
+
/**
|
461
|
+
* Dispatch a request
|
462
|
+
*
|
463
|
+
* @param {Object} config The config specific for this request (merged with this.defaults)
|
464
|
+
*/
|
465
|
+
Axios.prototype.request = function request(config) {
|
466
|
+
/*eslint no-param-reassign:0*/
|
467
|
+
// Allow for axios('example/url'[, config]) a la fetch API
|
468
|
+
if (typeof config === 'string') {
|
469
|
+
config = utils.merge({
|
470
|
+
url: arguments[0]
|
471
|
+
}, arguments[1]);
|
472
|
+
}
|
473
|
+
|
474
|
+
config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
|
475
|
+
|
476
|
+
// Support baseURL config
|
477
|
+
if (config.baseURL && !isAbsoluteURL(config.url)) {
|
478
|
+
config.url = combineURLs(config.baseURL, config.url);
|
479
|
+
}
|
480
|
+
|
481
|
+
// Hook up interceptors middleware
|
482
|
+
var chain = [dispatchRequest, undefined];
|
483
|
+
var promise = Promise.resolve(config);
|
484
|
+
|
485
|
+
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
486
|
+
chain.unshift(interceptor.fulfilled, interceptor.rejected);
|
487
|
+
});
|
488
|
+
|
489
|
+
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
490
|
+
chain.push(interceptor.fulfilled, interceptor.rejected);
|
491
|
+
});
|
492
|
+
|
493
|
+
while (chain.length) {
|
494
|
+
promise = promise.then(chain.shift(), chain.shift());
|
495
|
+
}
|
496
|
+
|
497
|
+
return promise;
|
498
|
+
};
|
499
|
+
|
500
|
+
// Provide aliases for supported request methods
|
501
|
+
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
502
|
+
/*eslint func-names:0*/
|
503
|
+
Axios.prototype[method] = function(url, config) {
|
504
|
+
return this.request(utils.merge(config || {}, {
|
505
|
+
method: method,
|
506
|
+
url: url
|
507
|
+
}));
|
508
|
+
};
|
509
|
+
});
|
510
|
+
|
511
|
+
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
512
|
+
/*eslint func-names:0*/
|
513
|
+
Axios.prototype[method] = function(url, data, config) {
|
514
|
+
return this.request(utils.merge(config || {}, {
|
515
|
+
method: method,
|
516
|
+
url: url,
|
517
|
+
data: data
|
518
|
+
}));
|
519
|
+
};
|
520
|
+
});
|
521
|
+
|
522
|
+
module.exports = Axios;
|
523
|
+
|
509
524
|
|
510
525
|
/***/ },
|
511
526
|
/* 5 */
|
512
|
-
/***/ function(module, exports) {
|
527
|
+
/***/ function(module, exports, __webpack_require__) {
|
513
528
|
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
function noop() {}
|
587
|
-
|
588
|
-
process.on = noop;
|
589
|
-
process.addListener = noop;
|
590
|
-
process.once = noop;
|
591
|
-
process.off = noop;
|
592
|
-
process.removeListener = noop;
|
593
|
-
process.removeAllListeners = noop;
|
594
|
-
process.emit = noop;
|
595
|
-
|
596
|
-
process.binding = function (name) {
|
597
|
-
throw new Error('process.binding is not supported');
|
598
|
-
};
|
599
|
-
|
600
|
-
process.cwd = function () { return '/' };
|
601
|
-
process.chdir = function (dir) {
|
602
|
-
throw new Error('process.chdir is not supported');
|
603
|
-
};
|
604
|
-
process.umask = function() { return 0; };
|
529
|
+
'use strict';
|
530
|
+
|
531
|
+
var utils = __webpack_require__(2);
|
532
|
+
var normalizeHeaderName = __webpack_require__(6);
|
533
|
+
|
534
|
+
var PROTECTION_PREFIX = /^\)\]\}',?\n/;
|
535
|
+
var DEFAULT_CONTENT_TYPE = {
|
536
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
537
|
+
};
|
538
|
+
|
539
|
+
function setContentTypeIfUnset(headers, value) {
|
540
|
+
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
|
541
|
+
headers['Content-Type'] = value;
|
542
|
+
}
|
543
|
+
}
|
544
|
+
|
545
|
+
module.exports = {
|
546
|
+
transformRequest: [function transformRequest(data, headers) {
|
547
|
+
normalizeHeaderName(headers, 'Content-Type');
|
548
|
+
if (utils.isFormData(data) ||
|
549
|
+
utils.isArrayBuffer(data) ||
|
550
|
+
utils.isStream(data) ||
|
551
|
+
utils.isFile(data) ||
|
552
|
+
utils.isBlob(data)
|
553
|
+
) {
|
554
|
+
return data;
|
555
|
+
}
|
556
|
+
if (utils.isArrayBufferView(data)) {
|
557
|
+
return data.buffer;
|
558
|
+
}
|
559
|
+
if (utils.isURLSearchParams(data)) {
|
560
|
+
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
561
|
+
return data.toString();
|
562
|
+
}
|
563
|
+
if (utils.isObject(data)) {
|
564
|
+
setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
|
565
|
+
return JSON.stringify(data);
|
566
|
+
}
|
567
|
+
return data;
|
568
|
+
}],
|
569
|
+
|
570
|
+
transformResponse: [function transformResponse(data) {
|
571
|
+
/*eslint no-param-reassign:0*/
|
572
|
+
if (typeof data === 'string') {
|
573
|
+
data = data.replace(PROTECTION_PREFIX, '');
|
574
|
+
try {
|
575
|
+
data = JSON.parse(data);
|
576
|
+
} catch (e) { /* Ignore */ }
|
577
|
+
}
|
578
|
+
return data;
|
579
|
+
}],
|
580
|
+
|
581
|
+
headers: {
|
582
|
+
common: {
|
583
|
+
'Accept': 'application/json, text/plain, */*'
|
584
|
+
},
|
585
|
+
patch: utils.merge(DEFAULT_CONTENT_TYPE),
|
586
|
+
post: utils.merge(DEFAULT_CONTENT_TYPE),
|
587
|
+
put: utils.merge(DEFAULT_CONTENT_TYPE)
|
588
|
+
},
|
589
|
+
|
590
|
+
timeout: 0,
|
591
|
+
|
592
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
593
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
594
|
+
|
595
|
+
maxContentLength: -1,
|
596
|
+
|
597
|
+
validateStatus: function validateStatus(status) {
|
598
|
+
return status >= 200 && status < 300;
|
599
|
+
}
|
600
|
+
};
|
605
601
|
|
606
602
|
|
607
603
|
/***/ },
|
608
604
|
/* 6 */
|
609
605
|
/***/ function(module, exports, __webpack_require__) {
|
610
606
|
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
var data = transformData(
|
624
|
-
config.data,
|
625
|
-
config.headers,
|
626
|
-
config.transformRequest
|
627
|
-
);
|
628
|
-
|
629
|
-
// Merge headers
|
630
|
-
var requestHeaders = utils.merge(
|
631
|
-
defaults.headers.common,
|
632
|
-
defaults.headers[config.method] || {},
|
633
|
-
config.headers || {}
|
634
|
-
);
|
635
|
-
|
636
|
-
if (utils.isFormData(data)) {
|
637
|
-
delete requestHeaders['Content-Type']; // Let the browser set it
|
638
|
-
}
|
639
|
-
|
640
|
-
// Create the request
|
641
|
-
var request = new (XMLHttpRequest || ActiveXObject)('Microsoft.XMLHTTP');
|
642
|
-
request.open(config.method.toUpperCase(), buildUrl(config.url, config.params), true);
|
643
|
-
|
644
|
-
// Set the request timeout in MS
|
645
|
-
request.timeout = config.timeout;
|
646
|
-
|
647
|
-
// Listen for ready state
|
648
|
-
request.onreadystatechange = function () {
|
649
|
-
if (request && request.readyState === 4) {
|
650
|
-
// Prepare the response
|
651
|
-
var responseHeaders = parseHeaders(request.getAllResponseHeaders());
|
652
|
-
var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;
|
653
|
-
var response = {
|
654
|
-
data: transformData(
|
655
|
-
responseData,
|
656
|
-
responseHeaders,
|
657
|
-
config.transformResponse
|
658
|
-
),
|
659
|
-
status: request.status,
|
660
|
-
statusText: request.statusText,
|
661
|
-
headers: responseHeaders,
|
662
|
-
config: config
|
663
|
-
};
|
664
|
-
|
665
|
-
// Resolve or reject the Promise based on the status
|
666
|
-
(request.status >= 200 && request.status < 300 ?
|
667
|
-
resolve :
|
668
|
-
reject)(response);
|
669
|
-
|
670
|
-
// Clean up request
|
671
|
-
request = null;
|
672
|
-
}
|
673
|
-
};
|
674
|
-
|
675
|
-
// Add xsrf header
|
676
|
-
// This is only done if running in a standard browser environment.
|
677
|
-
// Specifically not if we're in a web worker, or react-native.
|
678
|
-
if (utils.isStandardBrowserEnv()) {
|
679
|
-
var cookies = __webpack_require__(10);
|
680
|
-
var urlIsSameOrigin = __webpack_require__(11);
|
681
|
-
|
682
|
-
// Add xsrf header
|
683
|
-
var xsrfValue = urlIsSameOrigin(config.url) ?
|
684
|
-
cookies.read(config.xsrfCookieName || defaults.xsrfCookieName) :
|
685
|
-
undefined;
|
686
|
-
|
687
|
-
if (xsrfValue) {
|
688
|
-
requestHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;
|
689
|
-
}
|
690
|
-
}
|
691
|
-
|
692
|
-
// Add headers to the request
|
693
|
-
utils.forEach(requestHeaders, function (val, key) {
|
694
|
-
// Remove Content-Type if data is undefined
|
695
|
-
if (!data && key.toLowerCase() === 'content-type') {
|
696
|
-
delete requestHeaders[key];
|
697
|
-
}
|
698
|
-
// Otherwise add header to the request
|
699
|
-
else {
|
700
|
-
request.setRequestHeader(key, val);
|
701
|
-
}
|
702
|
-
});
|
703
|
-
|
704
|
-
// Add withCredentials to request if needed
|
705
|
-
if (config.withCredentials) {
|
706
|
-
request.withCredentials = true;
|
707
|
-
}
|
708
|
-
|
709
|
-
// Add responseType to request if needed
|
710
|
-
if (config.responseType) {
|
711
|
-
try {
|
712
|
-
request.responseType = config.responseType;
|
713
|
-
} catch (e) {
|
714
|
-
if (request.responseType !== 'json') {
|
715
|
-
throw e;
|
716
|
-
}
|
717
|
-
}
|
718
|
-
}
|
719
|
-
|
720
|
-
if (utils.isArrayBuffer(data)) {
|
721
|
-
data = new DataView(data);
|
722
|
-
}
|
723
|
-
|
724
|
-
// Send the request
|
725
|
-
request.send(data);
|
726
|
-
};
|
607
|
+
'use strict';
|
608
|
+
|
609
|
+
var utils = __webpack_require__(2);
|
610
|
+
|
611
|
+
module.exports = function normalizeHeaderName(headers, normalizedName) {
|
612
|
+
utils.forEach(headers, function processHeader(value, name) {
|
613
|
+
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
|
614
|
+
headers[normalizedName] = value;
|
615
|
+
delete headers[name];
|
616
|
+
}
|
617
|
+
});
|
618
|
+
};
|
727
619
|
|
728
620
|
|
729
621
|
/***/ },
|
730
622
|
/* 7 */
|
731
623
|
/***/ function(module, exports, __webpack_require__) {
|
732
624
|
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
if (parts.length > 0) {
|
787
|
-
url += (url.indexOf('?') === -1 ? '?' : '&') + parts.join('&');
|
788
|
-
}
|
789
|
-
|
790
|
-
return url;
|
791
|
-
};
|
625
|
+
'use strict';
|
626
|
+
|
627
|
+
var utils = __webpack_require__(2);
|
628
|
+
|
629
|
+
function InterceptorManager() {
|
630
|
+
this.handlers = [];
|
631
|
+
}
|
632
|
+
|
633
|
+
/**
|
634
|
+
* Add a new interceptor to the stack
|
635
|
+
*
|
636
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
637
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
638
|
+
*
|
639
|
+
* @return {Number} An ID used to remove interceptor later
|
640
|
+
*/
|
641
|
+
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
|
642
|
+
this.handlers.push({
|
643
|
+
fulfilled: fulfilled,
|
644
|
+
rejected: rejected
|
645
|
+
});
|
646
|
+
return this.handlers.length - 1;
|
647
|
+
};
|
648
|
+
|
649
|
+
/**
|
650
|
+
* Remove an interceptor from the stack
|
651
|
+
*
|
652
|
+
* @param {Number} id The ID that was returned by `use`
|
653
|
+
*/
|
654
|
+
InterceptorManager.prototype.eject = function eject(id) {
|
655
|
+
if (this.handlers[id]) {
|
656
|
+
this.handlers[id] = null;
|
657
|
+
}
|
658
|
+
};
|
659
|
+
|
660
|
+
/**
|
661
|
+
* Iterate over all the registered interceptors
|
662
|
+
*
|
663
|
+
* This method is particularly useful for skipping over any
|
664
|
+
* interceptors that may have become `null` calling `eject`.
|
665
|
+
*
|
666
|
+
* @param {Function} fn The function to call for each interceptor
|
667
|
+
*/
|
668
|
+
InterceptorManager.prototype.forEach = function forEach(fn) {
|
669
|
+
utils.forEach(this.handlers, function forEachHandler(h) {
|
670
|
+
if (h !== null) {
|
671
|
+
fn(h);
|
672
|
+
}
|
673
|
+
});
|
674
|
+
};
|
675
|
+
|
676
|
+
module.exports = InterceptorManager;
|
792
677
|
|
793
678
|
|
794
679
|
/***/ },
|
795
680
|
/* 8 */
|
796
681
|
/***/ function(module, exports, __webpack_require__) {
|
797
682
|
|
798
|
-
|
683
|
+
'use strict';
|
684
|
+
|
685
|
+
var utils = __webpack_require__(2);
|
686
|
+
var transformData = __webpack_require__(9);
|
687
|
+
|
688
|
+
/**
|
689
|
+
* Dispatch a request to the server using whichever adapter
|
690
|
+
* is supported by the current environment.
|
691
|
+
*
|
692
|
+
* @param {object} config The config that is to be used for the request
|
693
|
+
* @returns {Promise} The Promise to be fulfilled
|
694
|
+
*/
|
695
|
+
module.exports = function dispatchRequest(config) {
|
696
|
+
// Ensure headers exist
|
697
|
+
config.headers = config.headers || {};
|
698
|
+
|
699
|
+
// Transform request data
|
700
|
+
config.data = transformData(
|
701
|
+
config.data,
|
702
|
+
config.headers,
|
703
|
+
config.transformRequest
|
704
|
+
);
|
705
|
+
|
706
|
+
// Flatten headers
|
707
|
+
config.headers = utils.merge(
|
708
|
+
config.headers.common || {},
|
709
|
+
config.headers[config.method] || {},
|
710
|
+
config.headers || {}
|
711
|
+
);
|
712
|
+
|
713
|
+
utils.forEach(
|
714
|
+
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
715
|
+
function cleanHeaderConfig(method) {
|
716
|
+
delete config.headers[method];
|
717
|
+
}
|
718
|
+
);
|
719
|
+
|
720
|
+
var adapter;
|
721
|
+
|
722
|
+
if (typeof config.adapter === 'function') {
|
723
|
+
// For custom adapter support
|
724
|
+
adapter = config.adapter;
|
725
|
+
} else if (typeof XMLHttpRequest !== 'undefined') {
|
726
|
+
// For browsers use XHR adapter
|
727
|
+
adapter = __webpack_require__(10);
|
728
|
+
} else if (typeof process !== 'undefined') {
|
729
|
+
// For node use HTTP adapter
|
730
|
+
adapter = __webpack_require__(10);
|
731
|
+
}
|
732
|
+
|
733
|
+
return Promise.resolve(config)
|
734
|
+
// Wrap synchronous adapter errors and pass configuration
|
735
|
+
.then(adapter)
|
736
|
+
.then(function onFulfilled(response) {
|
737
|
+
// Transform response data
|
738
|
+
response.data = transformData(
|
739
|
+
response.data,
|
740
|
+
response.headers,
|
741
|
+
config.transformResponse
|
742
|
+
);
|
743
|
+
|
744
|
+
return response;
|
745
|
+
}, function onRejected(error) {
|
746
|
+
// Transform response data
|
747
|
+
if (error && error.response) {
|
748
|
+
error.response.data = transformData(
|
749
|
+
error.response.data,
|
750
|
+
error.response.headers,
|
751
|
+
config.transformResponse
|
752
|
+
);
|
753
|
+
}
|
754
|
+
|
755
|
+
return Promise.reject(error);
|
756
|
+
});
|
757
|
+
};
|
799
758
|
|
800
|
-
var utils = __webpack_require__(3);
|
801
759
|
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
* ```
|
806
|
-
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
807
|
-
* Content-Type: application/json
|
808
|
-
* Connection: keep-alive
|
809
|
-
* Transfer-Encoding: chunked
|
810
|
-
* ```
|
811
|
-
*
|
812
|
-
* @param {String} headers Headers needing to be parsed
|
813
|
-
* @returns {Object} Headers parsed into an object
|
814
|
-
*/
|
815
|
-
module.exports = function parseHeaders(headers) {
|
816
|
-
var parsed = {}, key, val, i;
|
760
|
+
/***/ },
|
761
|
+
/* 9 */
|
762
|
+
/***/ function(module, exports, __webpack_require__) {
|
817
763
|
|
818
|
-
|
764
|
+
'use strict';
|
765
|
+
|
766
|
+
var utils = __webpack_require__(2);
|
767
|
+
|
768
|
+
/**
|
769
|
+
* Transform the data for a request or a response
|
770
|
+
*
|
771
|
+
* @param {Object|String} data The data to be transformed
|
772
|
+
* @param {Array} headers The headers for the request or response
|
773
|
+
* @param {Array|Function} fns A single function or Array of functions
|
774
|
+
* @returns {*} The resulting transformed data
|
775
|
+
*/
|
776
|
+
module.exports = function transformData(data, headers, fns) {
|
777
|
+
/*eslint no-param-reassign:0*/
|
778
|
+
utils.forEach(fns, function transform(fn) {
|
779
|
+
data = fn(data, headers);
|
780
|
+
});
|
781
|
+
|
782
|
+
return data;
|
783
|
+
};
|
819
784
|
|
820
|
-
utils.forEach(headers.split('\n'), function(line) {
|
821
|
-
i = line.indexOf(':');
|
822
|
-
key = utils.trim(line.substr(0, i)).toLowerCase();
|
823
|
-
val = utils.trim(line.substr(i + 1));
|
824
785
|
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
});
|
786
|
+
/***/ },
|
787
|
+
/* 10 */
|
788
|
+
/***/ function(module, exports, __webpack_require__) {
|
829
789
|
|
830
|
-
|
831
|
-
|
790
|
+
'use strict';
|
791
|
+
|
792
|
+
var utils = __webpack_require__(2);
|
793
|
+
var settle = __webpack_require__(11);
|
794
|
+
var buildURL = __webpack_require__(14);
|
795
|
+
var parseHeaders = __webpack_require__(15);
|
796
|
+
var isURLSameOrigin = __webpack_require__(16);
|
797
|
+
var createError = __webpack_require__(12);
|
798
|
+
var btoa = (typeof window !== 'undefined' && window.btoa) || __webpack_require__(17);
|
799
|
+
|
800
|
+
module.exports = function xhrAdapter(config) {
|
801
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
802
|
+
var requestData = config.data;
|
803
|
+
var requestHeaders = config.headers;
|
804
|
+
|
805
|
+
if (utils.isFormData(requestData)) {
|
806
|
+
delete requestHeaders['Content-Type']; // Let the browser set it
|
807
|
+
}
|
808
|
+
|
809
|
+
var request = new XMLHttpRequest();
|
810
|
+
var loadEvent = 'onreadystatechange';
|
811
|
+
var xDomain = false;
|
812
|
+
|
813
|
+
// For IE 8/9 CORS support
|
814
|
+
// Only supports POST and GET calls and doesn't returns the response headers.
|
815
|
+
// DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
|
816
|
+
if (("production") !== 'test' &&
|
817
|
+
typeof window !== 'undefined' &&
|
818
|
+
window.XDomainRequest && !('withCredentials' in request) &&
|
819
|
+
!isURLSameOrigin(config.url)) {
|
820
|
+
request = new window.XDomainRequest();
|
821
|
+
loadEvent = 'onload';
|
822
|
+
xDomain = true;
|
823
|
+
request.onprogress = function handleProgress() {};
|
824
|
+
request.ontimeout = function handleTimeout() {};
|
825
|
+
}
|
826
|
+
|
827
|
+
// HTTP basic authentication
|
828
|
+
if (config.auth) {
|
829
|
+
var username = config.auth.username || '';
|
830
|
+
var password = config.auth.password || '';
|
831
|
+
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
832
|
+
}
|
833
|
+
|
834
|
+
request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
|
835
|
+
|
836
|
+
// Set the request timeout in MS
|
837
|
+
request.timeout = config.timeout;
|
838
|
+
|
839
|
+
// Listen for ready state
|
840
|
+
request[loadEvent] = function handleLoad() {
|
841
|
+
if (!request || (request.readyState !== 4 && !xDomain)) {
|
842
|
+
return;
|
843
|
+
}
|
844
|
+
|
845
|
+
// The request errored out and we didn't get a response, this will be
|
846
|
+
// handled by onerror instead
|
847
|
+
if (request.status === 0) {
|
848
|
+
return;
|
849
|
+
}
|
850
|
+
|
851
|
+
// Prepare the response
|
852
|
+
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
|
853
|
+
var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
|
854
|
+
var response = {
|
855
|
+
data: responseData,
|
856
|
+
// IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)
|
857
|
+
status: request.status === 1223 ? 204 : request.status,
|
858
|
+
statusText: request.status === 1223 ? 'No Content' : request.statusText,
|
859
|
+
headers: responseHeaders,
|
860
|
+
config: config,
|
861
|
+
request: request
|
862
|
+
};
|
863
|
+
|
864
|
+
settle(resolve, reject, response);
|
865
|
+
|
866
|
+
// Clean up request
|
867
|
+
request = null;
|
868
|
+
};
|
869
|
+
|
870
|
+
// Handle low level network errors
|
871
|
+
request.onerror = function handleError() {
|
872
|
+
// Real errors are hidden from us by the browser
|
873
|
+
// onerror should only fire if it's a network error
|
874
|
+
reject(createError('Network Error', config));
|
875
|
+
|
876
|
+
// Clean up request
|
877
|
+
request = null;
|
878
|
+
};
|
879
|
+
|
880
|
+
// Handle timeout
|
881
|
+
request.ontimeout = function handleTimeout() {
|
882
|
+
reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED'));
|
883
|
+
|
884
|
+
// Clean up request
|
885
|
+
request = null;
|
886
|
+
};
|
887
|
+
|
888
|
+
// Add xsrf header
|
889
|
+
// This is only done if running in a standard browser environment.
|
890
|
+
// Specifically not if we're in a web worker, or react-native.
|
891
|
+
if (utils.isStandardBrowserEnv()) {
|
892
|
+
var cookies = __webpack_require__(18);
|
893
|
+
|
894
|
+
// Add xsrf header
|
895
|
+
var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
|
896
|
+
cookies.read(config.xsrfCookieName) :
|
897
|
+
undefined;
|
898
|
+
|
899
|
+
if (xsrfValue) {
|
900
|
+
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
901
|
+
}
|
902
|
+
}
|
903
|
+
|
904
|
+
// Add headers to the request
|
905
|
+
if ('setRequestHeader' in request) {
|
906
|
+
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
|
907
|
+
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
|
908
|
+
// Remove Content-Type if data is undefined
|
909
|
+
delete requestHeaders[key];
|
910
|
+
} else {
|
911
|
+
// Otherwise add header to the request
|
912
|
+
request.setRequestHeader(key, val);
|
913
|
+
}
|
914
|
+
});
|
915
|
+
}
|
916
|
+
|
917
|
+
// Add withCredentials to request if needed
|
918
|
+
if (config.withCredentials) {
|
919
|
+
request.withCredentials = true;
|
920
|
+
}
|
921
|
+
|
922
|
+
// Add responseType to request if needed
|
923
|
+
if (config.responseType) {
|
924
|
+
try {
|
925
|
+
request.responseType = config.responseType;
|
926
|
+
} catch (e) {
|
927
|
+
if (request.responseType !== 'json') {
|
928
|
+
throw e;
|
929
|
+
}
|
930
|
+
}
|
931
|
+
}
|
932
|
+
|
933
|
+
// Handle progress if needed
|
934
|
+
if (typeof config.onDownloadProgress === 'function') {
|
935
|
+
request.addEventListener('progress', config.onDownloadProgress);
|
936
|
+
}
|
937
|
+
|
938
|
+
// Not all browsers support upload events
|
939
|
+
if (typeof config.onUploadProgress === 'function' && request.upload) {
|
940
|
+
request.upload.addEventListener('progress', config.onUploadProgress);
|
941
|
+
}
|
942
|
+
|
943
|
+
|
944
|
+
if (requestData === undefined) {
|
945
|
+
requestData = null;
|
946
|
+
}
|
947
|
+
|
948
|
+
// Send the request
|
949
|
+
request.send(requestData);
|
950
|
+
});
|
951
|
+
};
|
832
952
|
|
833
953
|
|
834
954
|
/***/ },
|
835
|
-
/*
|
955
|
+
/* 11 */
|
836
956
|
/***/ function(module, exports, __webpack_require__) {
|
837
957
|
|
838
|
-
|
958
|
+
'use strict';
|
959
|
+
|
960
|
+
var createError = __webpack_require__(12);
|
961
|
+
|
962
|
+
/**
|
963
|
+
* Resolve or reject a Promise based on response status.
|
964
|
+
*
|
965
|
+
* @param {Function} resolve A function that resolves the promise.
|
966
|
+
* @param {Function} reject A function that rejects the promise.
|
967
|
+
* @param {object} response The response.
|
968
|
+
*/
|
969
|
+
module.exports = function settle(resolve, reject, response) {
|
970
|
+
var validateStatus = response.config.validateStatus;
|
971
|
+
// Note: status is not exposed by XDomainRequest
|
972
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
973
|
+
resolve(response);
|
974
|
+
} else {
|
975
|
+
reject(createError(
|
976
|
+
'Request failed with status code ' + response.status,
|
977
|
+
response.config,
|
978
|
+
null,
|
979
|
+
response
|
980
|
+
));
|
981
|
+
}
|
982
|
+
};
|
839
983
|
|
840
|
-
var utils = __webpack_require__(3);
|
841
984
|
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
* @param {Object|String} data The data to be transformed
|
846
|
-
* @param {Array} headers The headers for the request or response
|
847
|
-
* @param {Array|Function} fns A single function or Array of functions
|
848
|
-
* @returns {*} The resulting transformed data
|
849
|
-
*/
|
850
|
-
module.exports = function transformData(data, headers, fns) {
|
851
|
-
utils.forEach(fns, function (fn) {
|
852
|
-
data = fn(data, headers);
|
853
|
-
});
|
985
|
+
/***/ },
|
986
|
+
/* 12 */
|
987
|
+
/***/ function(module, exports, __webpack_require__) {
|
854
988
|
|
855
|
-
|
856
|
-
|
989
|
+
'use strict';
|
990
|
+
|
991
|
+
var enhanceError = __webpack_require__(13);
|
992
|
+
|
993
|
+
/**
|
994
|
+
* Create an Error with the specified message, config, error code, and response.
|
995
|
+
*
|
996
|
+
* @param {string} message The error message.
|
997
|
+
* @param {Object} config The config.
|
998
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
999
|
+
@ @param {Object} [response] The response.
|
1000
|
+
* @returns {Error} The created error.
|
1001
|
+
*/
|
1002
|
+
module.exports = function createError(message, config, code, response) {
|
1003
|
+
var error = new Error(message);
|
1004
|
+
return enhanceError(error, config, code, response);
|
1005
|
+
};
|
857
1006
|
|
858
1007
|
|
859
1008
|
/***/ },
|
860
|
-
/*
|
861
|
-
/***/ function(module, exports
|
1009
|
+
/* 13 */
|
1010
|
+
/***/ function(module, exports) {
|
1011
|
+
|
1012
|
+
'use strict';
|
1013
|
+
|
1014
|
+
/**
|
1015
|
+
* Update an Error with the specified config, error code, and response.
|
1016
|
+
*
|
1017
|
+
* @param {Error} error The error to update.
|
1018
|
+
* @param {Object} config The config.
|
1019
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
1020
|
+
@ @param {Object} [response] The response.
|
1021
|
+
* @returns {Error} The error.
|
1022
|
+
*/
|
1023
|
+
module.exports = function enhanceError(error, config, code, response) {
|
1024
|
+
error.config = config;
|
1025
|
+
if (code) {
|
1026
|
+
error.code = code;
|
1027
|
+
}
|
1028
|
+
error.response = response;
|
1029
|
+
return error;
|
1030
|
+
};
|
862
1031
|
|
863
|
-
'use strict';
|
864
1032
|
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
1033
|
+
/***/ },
|
1034
|
+
/* 14 */
|
1035
|
+
/***/ function(module, exports, __webpack_require__) {
|
1036
|
+
|
1037
|
+
'use strict';
|
1038
|
+
|
1039
|
+
var utils = __webpack_require__(2);
|
1040
|
+
|
1041
|
+
function encode(val) {
|
1042
|
+
return encodeURIComponent(val).
|
1043
|
+
replace(/%40/gi, '@').
|
1044
|
+
replace(/%3A/gi, ':').
|
1045
|
+
replace(/%24/g, '$').
|
1046
|
+
replace(/%2C/gi, ',').
|
1047
|
+
replace(/%20/g, '+').
|
1048
|
+
replace(/%5B/gi, '[').
|
1049
|
+
replace(/%5D/gi, ']');
|
1050
|
+
}
|
1051
|
+
|
1052
|
+
/**
|
1053
|
+
* Build a URL by appending params to the end
|
1054
|
+
*
|
1055
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
1056
|
+
* @param {object} [params] The params to be appended
|
1057
|
+
* @returns {string} The formatted url
|
1058
|
+
*/
|
1059
|
+
module.exports = function buildURL(url, params, paramsSerializer) {
|
1060
|
+
/*eslint no-param-reassign:0*/
|
1061
|
+
if (!params) {
|
1062
|
+
return url;
|
1063
|
+
}
|
1064
|
+
|
1065
|
+
var serializedParams;
|
1066
|
+
if (paramsSerializer) {
|
1067
|
+
serializedParams = paramsSerializer(params);
|
1068
|
+
} else if (utils.isURLSearchParams(params)) {
|
1069
|
+
serializedParams = params.toString();
|
1070
|
+
} else {
|
1071
|
+
var parts = [];
|
1072
|
+
|
1073
|
+
utils.forEach(params, function serialize(val, key) {
|
1074
|
+
if (val === null || typeof val === 'undefined') {
|
1075
|
+
return;
|
1076
|
+
}
|
1077
|
+
|
1078
|
+
if (utils.isArray(val)) {
|
1079
|
+
key = key + '[]';
|
1080
|
+
}
|
1081
|
+
|
1082
|
+
if (!utils.isArray(val)) {
|
1083
|
+
val = [val];
|
1084
|
+
}
|
1085
|
+
|
1086
|
+
utils.forEach(val, function parseValue(v) {
|
1087
|
+
if (utils.isDate(v)) {
|
1088
|
+
v = v.toISOString();
|
1089
|
+
} else if (utils.isObject(v)) {
|
1090
|
+
v = JSON.stringify(v);
|
1091
|
+
}
|
1092
|
+
parts.push(encode(key) + '=' + encode(v));
|
1093
|
+
});
|
1094
|
+
});
|
1095
|
+
|
1096
|
+
serializedParams = parts.join('&');
|
1097
|
+
}
|
1098
|
+
|
1099
|
+
if (serializedParams) {
|
1100
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
1101
|
+
}
|
1102
|
+
|
1103
|
+
return url;
|
1104
|
+
};
|
870
1105
|
|
871
|
-
var utils = __webpack_require__(3);
|
872
1106
|
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
cookie.push(name + '=' + encodeURIComponent(value));
|
1107
|
+
/***/ },
|
1108
|
+
/* 15 */
|
1109
|
+
/***/ function(module, exports, __webpack_require__) {
|
877
1110
|
|
878
|
-
|
879
|
-
|
880
|
-
|
1111
|
+
'use strict';
|
1112
|
+
|
1113
|
+
var utils = __webpack_require__(2);
|
1114
|
+
|
1115
|
+
/**
|
1116
|
+
* Parse headers into an object
|
1117
|
+
*
|
1118
|
+
* ```
|
1119
|
+
* Date: Wed, 27 Aug 2014 08:58:49 GMT
|
1120
|
+
* Content-Type: application/json
|
1121
|
+
* Connection: keep-alive
|
1122
|
+
* Transfer-Encoding: chunked
|
1123
|
+
* ```
|
1124
|
+
*
|
1125
|
+
* @param {String} headers Headers needing to be parsed
|
1126
|
+
* @returns {Object} Headers parsed into an object
|
1127
|
+
*/
|
1128
|
+
module.exports = function parseHeaders(headers) {
|
1129
|
+
var parsed = {};
|
1130
|
+
var key;
|
1131
|
+
var val;
|
1132
|
+
var i;
|
1133
|
+
|
1134
|
+
if (!headers) { return parsed; }
|
1135
|
+
|
1136
|
+
utils.forEach(headers.split('\n'), function parser(line) {
|
1137
|
+
i = line.indexOf(':');
|
1138
|
+
key = utils.trim(line.substr(0, i)).toLowerCase();
|
1139
|
+
val = utils.trim(line.substr(i + 1));
|
1140
|
+
|
1141
|
+
if (key) {
|
1142
|
+
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
|
1143
|
+
}
|
1144
|
+
});
|
1145
|
+
|
1146
|
+
return parsed;
|
1147
|
+
};
|
881
1148
|
|
882
|
-
if (utils.isString(path)) {
|
883
|
-
cookie.push('path=' + path);
|
884
|
-
}
|
885
1149
|
|
886
|
-
|
887
|
-
|
888
|
-
|
1150
|
+
/***/ },
|
1151
|
+
/* 16 */
|
1152
|
+
/***/ function(module, exports, __webpack_require__) {
|
889
1153
|
|
890
|
-
|
891
|
-
|
892
|
-
|
1154
|
+
'use strict';
|
1155
|
+
|
1156
|
+
var utils = __webpack_require__(2);
|
1157
|
+
|
1158
|
+
module.exports = (
|
1159
|
+
utils.isStandardBrowserEnv() ?
|
1160
|
+
|
1161
|
+
// Standard browser envs have full support of the APIs needed to test
|
1162
|
+
// whether the request URL is of the same origin as current location.
|
1163
|
+
(function standardBrowserEnv() {
|
1164
|
+
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
1165
|
+
var urlParsingNode = document.createElement('a');
|
1166
|
+
var originURL;
|
1167
|
+
|
1168
|
+
/**
|
1169
|
+
* Parse a URL to discover it's components
|
1170
|
+
*
|
1171
|
+
* @param {String} url The URL to be parsed
|
1172
|
+
* @returns {Object}
|
1173
|
+
*/
|
1174
|
+
function resolveURL(url) {
|
1175
|
+
var href = url;
|
1176
|
+
|
1177
|
+
if (msie) {
|
1178
|
+
// IE needs attribute set twice to normalize properties
|
1179
|
+
urlParsingNode.setAttribute('href', href);
|
1180
|
+
href = urlParsingNode.href;
|
1181
|
+
}
|
1182
|
+
|
1183
|
+
urlParsingNode.setAttribute('href', href);
|
1184
|
+
|
1185
|
+
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
|
1186
|
+
return {
|
1187
|
+
href: urlParsingNode.href,
|
1188
|
+
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
|
1189
|
+
host: urlParsingNode.host,
|
1190
|
+
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
|
1191
|
+
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
|
1192
|
+
hostname: urlParsingNode.hostname,
|
1193
|
+
port: urlParsingNode.port,
|
1194
|
+
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
|
1195
|
+
urlParsingNode.pathname :
|
1196
|
+
'/' + urlParsingNode.pathname
|
1197
|
+
};
|
1198
|
+
}
|
1199
|
+
|
1200
|
+
originURL = resolveURL(window.location.href);
|
1201
|
+
|
1202
|
+
/**
|
1203
|
+
* Determine if a URL shares the same origin as the current location
|
1204
|
+
*
|
1205
|
+
* @param {String} requestURL The URL to test
|
1206
|
+
* @returns {boolean} True if URL shares the same origin, otherwise false
|
1207
|
+
*/
|
1208
|
+
return function isURLSameOrigin(requestURL) {
|
1209
|
+
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
|
1210
|
+
return (parsed.protocol === originURL.protocol &&
|
1211
|
+
parsed.host === originURL.host);
|
1212
|
+
};
|
1213
|
+
})() :
|
1214
|
+
|
1215
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
1216
|
+
(function nonStandardBrowserEnv() {
|
1217
|
+
return function isURLSameOrigin() {
|
1218
|
+
return true;
|
1219
|
+
};
|
1220
|
+
})()
|
1221
|
+
);
|
893
1222
|
|
894
|
-
document.cookie = cookie.join('; ');
|
895
|
-
},
|
896
1223
|
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
},
|
1224
|
+
/***/ },
|
1225
|
+
/* 17 */
|
1226
|
+
/***/ function(module, exports) {
|
901
1227
|
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
1228
|
+
'use strict';
|
1229
|
+
|
1230
|
+
// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
|
1231
|
+
|
1232
|
+
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
1233
|
+
|
1234
|
+
function E() {
|
1235
|
+
this.message = 'String contains an invalid character';
|
1236
|
+
}
|
1237
|
+
E.prototype = new Error;
|
1238
|
+
E.prototype.code = 5;
|
1239
|
+
E.prototype.name = 'InvalidCharacterError';
|
1240
|
+
|
1241
|
+
function btoa(input) {
|
1242
|
+
var str = String(input);
|
1243
|
+
var output = '';
|
1244
|
+
for (
|
1245
|
+
// initialize result and counter
|
1246
|
+
var block, charCode, idx = 0, map = chars;
|
1247
|
+
// if the next str index does not exist:
|
1248
|
+
// change the mapping table to "="
|
1249
|
+
// check if d has no fractional digits
|
1250
|
+
str.charAt(idx | 0) || (map = '=', idx % 1);
|
1251
|
+
// "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
|
1252
|
+
output += map.charAt(63 & block >> 8 - idx % 1 * 8)
|
1253
|
+
) {
|
1254
|
+
charCode = str.charCodeAt(idx += 3 / 4);
|
1255
|
+
if (charCode > 0xFF) {
|
1256
|
+
throw new E();
|
1257
|
+
}
|
1258
|
+
block = block << 8 | charCode;
|
1259
|
+
}
|
1260
|
+
return output;
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
module.exports = btoa;
|
906
1264
|
|
907
1265
|
|
908
1266
|
/***/ },
|
909
|
-
/*
|
1267
|
+
/* 18 */
|
910
1268
|
/***/ function(module, exports, __webpack_require__) {
|
911
1269
|
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
module.exports = function urlIsSameOrigin(requestUrl) {
|
966
|
-
var parsed = (utils.isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;
|
967
|
-
return (parsed.protocol === originUrl.protocol &&
|
968
|
-
parsed.host === originUrl.host);
|
969
|
-
};
|
1270
|
+
'use strict';
|
1271
|
+
|
1272
|
+
var utils = __webpack_require__(2);
|
1273
|
+
|
1274
|
+
module.exports = (
|
1275
|
+
utils.isStandardBrowserEnv() ?
|
1276
|
+
|
1277
|
+
// Standard browser envs support document.cookie
|
1278
|
+
(function standardBrowserEnv() {
|
1279
|
+
return {
|
1280
|
+
write: function write(name, value, expires, path, domain, secure) {
|
1281
|
+
var cookie = [];
|
1282
|
+
cookie.push(name + '=' + encodeURIComponent(value));
|
1283
|
+
|
1284
|
+
if (utils.isNumber(expires)) {
|
1285
|
+
cookie.push('expires=' + new Date(expires).toGMTString());
|
1286
|
+
}
|
1287
|
+
|
1288
|
+
if (utils.isString(path)) {
|
1289
|
+
cookie.push('path=' + path);
|
1290
|
+
}
|
1291
|
+
|
1292
|
+
if (utils.isString(domain)) {
|
1293
|
+
cookie.push('domain=' + domain);
|
1294
|
+
}
|
1295
|
+
|
1296
|
+
if (secure === true) {
|
1297
|
+
cookie.push('secure');
|
1298
|
+
}
|
1299
|
+
|
1300
|
+
document.cookie = cookie.join('; ');
|
1301
|
+
},
|
1302
|
+
|
1303
|
+
read: function read(name) {
|
1304
|
+
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
1305
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
1306
|
+
},
|
1307
|
+
|
1308
|
+
remove: function remove(name) {
|
1309
|
+
this.write(name, '', Date.now() - 86400000);
|
1310
|
+
}
|
1311
|
+
};
|
1312
|
+
})() :
|
1313
|
+
|
1314
|
+
// Non standard browser env (web workers, react-native) lack needed support.
|
1315
|
+
(function nonStandardBrowserEnv() {
|
1316
|
+
return {
|
1317
|
+
write: function write() {},
|
1318
|
+
read: function read() { return null; },
|
1319
|
+
remove: function remove() {}
|
1320
|
+
};
|
1321
|
+
})()
|
1322
|
+
);
|
970
1323
|
|
971
1324
|
|
972
1325
|
/***/ },
|
973
|
-
/*
|
974
|
-
/***/ function(module, exports
|
1326
|
+
/* 19 */
|
1327
|
+
/***/ function(module, exports) {
|
975
1328
|
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
* @return {Number} An ID used to remove interceptor later
|
991
|
-
*/
|
992
|
-
InterceptorManager.prototype.use = function (fulfilled, rejected) {
|
993
|
-
this.handlers.push({
|
994
|
-
fulfilled: fulfilled,
|
995
|
-
rejected: rejected
|
996
|
-
});
|
997
|
-
return this.handlers.length - 1;
|
998
|
-
};
|
999
|
-
|
1000
|
-
/**
|
1001
|
-
* Remove an interceptor from the stack
|
1002
|
-
*
|
1003
|
-
* @param {Number} id The ID that was returned by `use`
|
1004
|
-
*/
|
1005
|
-
InterceptorManager.prototype.eject = function (id) {
|
1006
|
-
if (this.handlers[id]) {
|
1007
|
-
this.handlers[id] = null;
|
1008
|
-
}
|
1009
|
-
};
|
1010
|
-
|
1011
|
-
/**
|
1012
|
-
* Iterate over all the registered interceptors
|
1013
|
-
*
|
1014
|
-
* This method is particularly useful for skipping over any
|
1015
|
-
* interceptors that may have become `null` calling `remove`.
|
1016
|
-
*
|
1017
|
-
* @param {Function} fn The function to call for each interceptor
|
1018
|
-
*/
|
1019
|
-
InterceptorManager.prototype.forEach = function (fn) {
|
1020
|
-
utils.forEach(this.handlers, function (h) {
|
1021
|
-
if (h !== null) {
|
1022
|
-
fn(h);
|
1023
|
-
}
|
1024
|
-
});
|
1025
|
-
};
|
1026
|
-
|
1027
|
-
module.exports = InterceptorManager;
|
1329
|
+
'use strict';
|
1330
|
+
|
1331
|
+
/**
|
1332
|
+
* Determines whether the specified URL is absolute
|
1333
|
+
*
|
1334
|
+
* @param {string} url The URL to test
|
1335
|
+
* @returns {boolean} True if the specified URL is absolute, otherwise false
|
1336
|
+
*/
|
1337
|
+
module.exports = function isAbsoluteURL(url) {
|
1338
|
+
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
1339
|
+
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
1340
|
+
// by any combination of letters, digits, plus, period, or hyphen.
|
1341
|
+
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
1342
|
+
};
|
1028
1343
|
|
1029
1344
|
|
1030
1345
|
/***/ },
|
1031
|
-
/*
|
1346
|
+
/* 20 */
|
1347
|
+
/***/ function(module, exports) {
|
1348
|
+
|
1349
|
+
'use strict';
|
1350
|
+
|
1351
|
+
/**
|
1352
|
+
* Creates a new URL by combining the specified URLs
|
1353
|
+
*
|
1354
|
+
* @param {string} baseURL The base URL
|
1355
|
+
* @param {string} relativeURL The relative URL
|
1356
|
+
* @returns {string} The combined URL
|
1357
|
+
*/
|
1358
|
+
module.exports = function combineURLs(baseURL, relativeURL) {
|
1359
|
+
return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '');
|
1360
|
+
};
|
1361
|
+
|
1362
|
+
|
1363
|
+
/***/ },
|
1364
|
+
/* 21 */
|
1032
1365
|
/***/ function(module, exports) {
|
1033
1366
|
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1367
|
+
'use strict';
|
1368
|
+
|
1369
|
+
/**
|
1370
|
+
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
1371
|
+
*
|
1372
|
+
* Common use case would be to use `Function.prototype.apply`.
|
1373
|
+
*
|
1374
|
+
* ```js
|
1375
|
+
* function f(x, y, z) {}
|
1376
|
+
* var args = [1, 2, 3];
|
1377
|
+
* f.apply(null, args);
|
1378
|
+
* ```
|
1379
|
+
*
|
1380
|
+
* With `spread` this example can be re-written.
|
1381
|
+
*
|
1382
|
+
* ```js
|
1383
|
+
* spread(function(x, y, z) {})([1, 2, 3]);
|
1384
|
+
* ```
|
1385
|
+
*
|
1386
|
+
* @param {Function} callback
|
1387
|
+
* @returns {Function}
|
1388
|
+
*/
|
1389
|
+
module.exports = function spread(callback) {
|
1390
|
+
return function wrap(arr) {
|
1391
|
+
return callback.apply(null, arr);
|
1392
|
+
};
|
1393
|
+
};
|
1061
1394
|
|
1062
1395
|
|
1063
1396
|
/***/ }
|
1064
1397
|
/******/ ])
|
1065
1398
|
});
|
1066
1399
|
;
|
1067
|
-
//# sourceMappingURL=axios.map
|
1400
|
+
//# sourceMappingURL=axios.map
|