@nhost/nhost-js 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients/functions.d.ts +1 -1
- package/dist/clients/graphql.d.ts +1 -1
- package/dist/index.cjs.js +1 -4
- package/dist/index.es.js +54 -3232
- package/dist/types.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -17,1061 +17,12 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
|
|
21
|
-
var bind$8 = function bind(fn, thisArg) {
|
|
22
|
-
return function wrap() {
|
|
23
|
-
var args = new Array(arguments.length);
|
|
24
|
-
for (var i = 0; i < args.length; i++) {
|
|
25
|
-
args[i] = arguments[i];
|
|
26
|
-
}
|
|
27
|
-
return fn.apply(thisArg, args);
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
var bind$7 = bind$8;
|
|
31
|
-
var toString$2 = Object.prototype.toString;
|
|
32
|
-
function isArray$2(val) {
|
|
33
|
-
return Array.isArray(val);
|
|
34
|
-
}
|
|
35
|
-
function isUndefined$2(val) {
|
|
36
|
-
return typeof val === "undefined";
|
|
37
|
-
}
|
|
38
|
-
function isBuffer$2(val) {
|
|
39
|
-
return val !== null && !isUndefined$2(val) && val.constructor !== null && !isUndefined$2(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
|
|
40
|
-
}
|
|
41
|
-
function isArrayBuffer$2(val) {
|
|
42
|
-
return toString$2.call(val) === "[object ArrayBuffer]";
|
|
43
|
-
}
|
|
44
|
-
function isFormData$2(val) {
|
|
45
|
-
return toString$2.call(val) === "[object FormData]";
|
|
46
|
-
}
|
|
47
|
-
function isArrayBufferView$2(val) {
|
|
48
|
-
var result;
|
|
49
|
-
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
50
|
-
result = ArrayBuffer.isView(val);
|
|
51
|
-
} else {
|
|
52
|
-
result = val && val.buffer && isArrayBuffer$2(val.buffer);
|
|
53
|
-
}
|
|
54
|
-
return result;
|
|
55
|
-
}
|
|
56
|
-
function isString$2(val) {
|
|
57
|
-
return typeof val === "string";
|
|
58
|
-
}
|
|
59
|
-
function isNumber$2(val) {
|
|
60
|
-
return typeof val === "number";
|
|
61
|
-
}
|
|
62
|
-
function isObject$2(val) {
|
|
63
|
-
return val !== null && typeof val === "object";
|
|
64
|
-
}
|
|
65
|
-
function isPlainObject$2(val) {
|
|
66
|
-
if (toString$2.call(val) !== "[object Object]") {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
var prototype = Object.getPrototypeOf(val);
|
|
70
|
-
return prototype === null || prototype === Object.prototype;
|
|
71
|
-
}
|
|
72
|
-
function isDate$2(val) {
|
|
73
|
-
return toString$2.call(val) === "[object Date]";
|
|
74
|
-
}
|
|
75
|
-
function isFile$2(val) {
|
|
76
|
-
return toString$2.call(val) === "[object File]";
|
|
77
|
-
}
|
|
78
|
-
function isBlob$2(val) {
|
|
79
|
-
return toString$2.call(val) === "[object Blob]";
|
|
80
|
-
}
|
|
81
|
-
function isFunction$2(val) {
|
|
82
|
-
return toString$2.call(val) === "[object Function]";
|
|
83
|
-
}
|
|
84
|
-
function isStream$2(val) {
|
|
85
|
-
return isObject$2(val) && isFunction$2(val.pipe);
|
|
86
|
-
}
|
|
87
|
-
function isURLSearchParams$2(val) {
|
|
88
|
-
return toString$2.call(val) === "[object URLSearchParams]";
|
|
89
|
-
}
|
|
90
|
-
function trim$2(str) {
|
|
91
|
-
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
|
|
92
|
-
}
|
|
93
|
-
function isStandardBrowserEnv$2() {
|
|
94
|
-
if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
98
|
-
}
|
|
99
|
-
function forEach$2(obj, fn) {
|
|
100
|
-
if (obj === null || typeof obj === "undefined") {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (typeof obj !== "object") {
|
|
104
|
-
obj = [obj];
|
|
105
|
-
}
|
|
106
|
-
if (isArray$2(obj)) {
|
|
107
|
-
for (var i = 0, l = obj.length; i < l; i++) {
|
|
108
|
-
fn.call(null, obj[i], i, obj);
|
|
109
|
-
}
|
|
110
|
-
} else {
|
|
111
|
-
for (var key in obj) {
|
|
112
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
113
|
-
fn.call(null, obj[key], key, obj);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
function merge$2() {
|
|
119
|
-
var result = {};
|
|
120
|
-
function assignValue(val, key) {
|
|
121
|
-
if (isPlainObject$2(result[key]) && isPlainObject$2(val)) {
|
|
122
|
-
result[key] = merge$2(result[key], val);
|
|
123
|
-
} else if (isPlainObject$2(val)) {
|
|
124
|
-
result[key] = merge$2({}, val);
|
|
125
|
-
} else if (isArray$2(val)) {
|
|
126
|
-
result[key] = val.slice();
|
|
127
|
-
} else {
|
|
128
|
-
result[key] = val;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
132
|
-
forEach$2(arguments[i], assignValue);
|
|
133
|
-
}
|
|
134
|
-
return result;
|
|
135
|
-
}
|
|
136
|
-
function extend$2(a, b, thisArg) {
|
|
137
|
-
forEach$2(b, function assignValue(val, key) {
|
|
138
|
-
if (thisArg && typeof val === "function") {
|
|
139
|
-
a[key] = bind$7(val, thisArg);
|
|
140
|
-
} else {
|
|
141
|
-
a[key] = val;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
return a;
|
|
145
|
-
}
|
|
146
|
-
function stripBOM$2(content) {
|
|
147
|
-
if (content.charCodeAt(0) === 65279) {
|
|
148
|
-
content = content.slice(1);
|
|
149
|
-
}
|
|
150
|
-
return content;
|
|
151
|
-
}
|
|
152
|
-
var utils$G = {
|
|
153
|
-
isArray: isArray$2,
|
|
154
|
-
isArrayBuffer: isArrayBuffer$2,
|
|
155
|
-
isBuffer: isBuffer$2,
|
|
156
|
-
isFormData: isFormData$2,
|
|
157
|
-
isArrayBufferView: isArrayBufferView$2,
|
|
158
|
-
isString: isString$2,
|
|
159
|
-
isNumber: isNumber$2,
|
|
160
|
-
isObject: isObject$2,
|
|
161
|
-
isPlainObject: isPlainObject$2,
|
|
162
|
-
isUndefined: isUndefined$2,
|
|
163
|
-
isDate: isDate$2,
|
|
164
|
-
isFile: isFile$2,
|
|
165
|
-
isBlob: isBlob$2,
|
|
166
|
-
isFunction: isFunction$2,
|
|
167
|
-
isStream: isStream$2,
|
|
168
|
-
isURLSearchParams: isURLSearchParams$2,
|
|
169
|
-
isStandardBrowserEnv: isStandardBrowserEnv$2,
|
|
170
|
-
forEach: forEach$2,
|
|
171
|
-
merge: merge$2,
|
|
172
|
-
extend: extend$2,
|
|
173
|
-
trim: trim$2,
|
|
174
|
-
stripBOM: stripBOM$2
|
|
175
|
-
};
|
|
176
|
-
var utils$F = utils$G;
|
|
177
|
-
function encode$2(val) {
|
|
178
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
179
|
-
}
|
|
180
|
-
var buildURL$8 = function buildURL(url, params, paramsSerializer) {
|
|
181
|
-
if (!params) {
|
|
182
|
-
return url;
|
|
183
|
-
}
|
|
184
|
-
var serializedParams;
|
|
185
|
-
if (paramsSerializer) {
|
|
186
|
-
serializedParams = paramsSerializer(params);
|
|
187
|
-
} else if (utils$F.isURLSearchParams(params)) {
|
|
188
|
-
serializedParams = params.toString();
|
|
189
|
-
} else {
|
|
190
|
-
var parts = [];
|
|
191
|
-
utils$F.forEach(params, function serialize(val, key) {
|
|
192
|
-
if (val === null || typeof val === "undefined") {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (utils$F.isArray(val)) {
|
|
196
|
-
key = key + "[]";
|
|
197
|
-
} else {
|
|
198
|
-
val = [val];
|
|
199
|
-
}
|
|
200
|
-
utils$F.forEach(val, function parseValue(v) {
|
|
201
|
-
if (utils$F.isDate(v)) {
|
|
202
|
-
v = v.toISOString();
|
|
203
|
-
} else if (utils$F.isObject(v)) {
|
|
204
|
-
v = JSON.stringify(v);
|
|
205
|
-
}
|
|
206
|
-
parts.push(encode$2(key) + "=" + encode$2(v));
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
serializedParams = parts.join("&");
|
|
210
|
-
}
|
|
211
|
-
if (serializedParams) {
|
|
212
|
-
var hashmarkIndex = url.indexOf("#");
|
|
213
|
-
if (hashmarkIndex !== -1) {
|
|
214
|
-
url = url.slice(0, hashmarkIndex);
|
|
215
|
-
}
|
|
216
|
-
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
217
|
-
}
|
|
218
|
-
return url;
|
|
219
|
-
};
|
|
220
|
-
var utils$E = utils$G;
|
|
221
|
-
function InterceptorManager$5() {
|
|
222
|
-
this.handlers = [];
|
|
223
|
-
}
|
|
224
|
-
InterceptorManager$5.prototype.use = function use(fulfilled, rejected, options) {
|
|
225
|
-
this.handlers.push({
|
|
226
|
-
fulfilled,
|
|
227
|
-
rejected,
|
|
228
|
-
synchronous: options ? options.synchronous : false,
|
|
229
|
-
runWhen: options ? options.runWhen : null
|
|
230
|
-
});
|
|
231
|
-
return this.handlers.length - 1;
|
|
232
|
-
};
|
|
233
|
-
InterceptorManager$5.prototype.eject = function eject(id) {
|
|
234
|
-
if (this.handlers[id]) {
|
|
235
|
-
this.handlers[id] = null;
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
InterceptorManager$5.prototype.forEach = function forEach(fn) {
|
|
239
|
-
utils$E.forEach(this.handlers, function forEachHandler(h) {
|
|
240
|
-
if (h !== null) {
|
|
241
|
-
fn(h);
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
};
|
|
245
|
-
var InterceptorManager_1$2 = InterceptorManager$5;
|
|
246
|
-
var utils$D = utils$G;
|
|
247
|
-
var normalizeHeaderName$5 = function normalizeHeaderName(headers, normalizedName) {
|
|
248
|
-
utils$D.forEach(headers, function processHeader(value, name2) {
|
|
249
|
-
if (name2 !== normalizedName && name2.toUpperCase() === normalizedName.toUpperCase()) {
|
|
250
|
-
headers[normalizedName] = value;
|
|
251
|
-
delete headers[name2];
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
};
|
|
255
|
-
var enhanceError$8 = function enhanceError(error, config, code, request4, response) {
|
|
256
|
-
error.config = config;
|
|
257
|
-
if (code) {
|
|
258
|
-
error.code = code;
|
|
259
|
-
}
|
|
260
|
-
error.request = request4;
|
|
261
|
-
error.response = response;
|
|
262
|
-
error.isAxiosError = true;
|
|
263
|
-
error.toJSON = function toJSON() {
|
|
264
|
-
return {
|
|
265
|
-
message: this.message,
|
|
266
|
-
name: this.name,
|
|
267
|
-
description: this.description,
|
|
268
|
-
number: this.number,
|
|
269
|
-
fileName: this.fileName,
|
|
270
|
-
lineNumber: this.lineNumber,
|
|
271
|
-
columnNumber: this.columnNumber,
|
|
272
|
-
stack: this.stack,
|
|
273
|
-
config: this.config,
|
|
274
|
-
code: this.code,
|
|
275
|
-
status: this.response && this.response.status ? this.response.status : null
|
|
276
|
-
};
|
|
277
|
-
};
|
|
278
|
-
return error;
|
|
279
|
-
};
|
|
280
|
-
var enhanceError$7 = enhanceError$8;
|
|
281
|
-
var createError$8 = function createError(message, config, code, request4, response) {
|
|
282
|
-
var error = new Error(message);
|
|
283
|
-
return enhanceError$7(error, config, code, request4, response);
|
|
284
|
-
};
|
|
285
|
-
var createError$7 = createError$8;
|
|
286
|
-
var settle$5 = function settle(resolve, reject, response) {
|
|
287
|
-
var validateStatus4 = response.config.validateStatus;
|
|
288
|
-
if (!response.status || !validateStatus4 || validateStatus4(response.status)) {
|
|
289
|
-
resolve(response);
|
|
290
|
-
} else {
|
|
291
|
-
reject(createError$7("Request failed with status code " + response.status, response.config, null, response.request, response));
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
var utils$C = utils$G;
|
|
295
|
-
var cookies$5 = utils$C.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
296
|
-
return {
|
|
297
|
-
write: function write(name2, value, expires, path, domain, secure) {
|
|
298
|
-
var cookie = [];
|
|
299
|
-
cookie.push(name2 + "=" + encodeURIComponent(value));
|
|
300
|
-
if (utils$C.isNumber(expires)) {
|
|
301
|
-
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
302
|
-
}
|
|
303
|
-
if (utils$C.isString(path)) {
|
|
304
|
-
cookie.push("path=" + path);
|
|
305
|
-
}
|
|
306
|
-
if (utils$C.isString(domain)) {
|
|
307
|
-
cookie.push("domain=" + domain);
|
|
308
|
-
}
|
|
309
|
-
if (secure === true) {
|
|
310
|
-
cookie.push("secure");
|
|
311
|
-
}
|
|
312
|
-
document.cookie = cookie.join("; ");
|
|
313
|
-
},
|
|
314
|
-
read: function read(name2) {
|
|
315
|
-
var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)"));
|
|
316
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
317
|
-
},
|
|
318
|
-
remove: function remove(name2) {
|
|
319
|
-
this.write(name2, "", Date.now() - 864e5);
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
}() : function nonStandardBrowserEnv() {
|
|
323
|
-
return {
|
|
324
|
-
write: function write() {
|
|
325
|
-
},
|
|
326
|
-
read: function read() {
|
|
327
|
-
return null;
|
|
328
|
-
},
|
|
329
|
-
remove: function remove() {
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
}();
|
|
333
|
-
var isAbsoluteURL$5 = function isAbsoluteURL(url) {
|
|
334
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
335
|
-
};
|
|
336
|
-
var combineURLs$5 = function combineURLs(baseURL, relativeURL) {
|
|
337
|
-
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
338
|
-
};
|
|
339
|
-
var isAbsoluteURL$4 = isAbsoluteURL$5;
|
|
340
|
-
var combineURLs$4 = combineURLs$5;
|
|
341
|
-
var buildFullPath$5 = function buildFullPath(baseURL, requestedURL) {
|
|
342
|
-
if (baseURL && !isAbsoluteURL$4(requestedURL)) {
|
|
343
|
-
return combineURLs$4(baseURL, requestedURL);
|
|
344
|
-
}
|
|
345
|
-
return requestedURL;
|
|
346
|
-
};
|
|
347
|
-
var utils$B = utils$G;
|
|
348
|
-
var ignoreDuplicateOf$2 = [
|
|
349
|
-
"age",
|
|
350
|
-
"authorization",
|
|
351
|
-
"content-length",
|
|
352
|
-
"content-type",
|
|
353
|
-
"etag",
|
|
354
|
-
"expires",
|
|
355
|
-
"from",
|
|
356
|
-
"host",
|
|
357
|
-
"if-modified-since",
|
|
358
|
-
"if-unmodified-since",
|
|
359
|
-
"last-modified",
|
|
360
|
-
"location",
|
|
361
|
-
"max-forwards",
|
|
362
|
-
"proxy-authorization",
|
|
363
|
-
"referer",
|
|
364
|
-
"retry-after",
|
|
365
|
-
"user-agent"
|
|
366
|
-
];
|
|
367
|
-
var parseHeaders$5 = function parseHeaders(headers) {
|
|
368
|
-
var parsed = {};
|
|
369
|
-
var key;
|
|
370
|
-
var val;
|
|
371
|
-
var i;
|
|
372
|
-
if (!headers) {
|
|
373
|
-
return parsed;
|
|
374
|
-
}
|
|
375
|
-
utils$B.forEach(headers.split("\n"), function parser(line) {
|
|
376
|
-
i = line.indexOf(":");
|
|
377
|
-
key = utils$B.trim(line.substr(0, i)).toLowerCase();
|
|
378
|
-
val = utils$B.trim(line.substr(i + 1));
|
|
379
|
-
if (key) {
|
|
380
|
-
if (parsed[key] && ignoreDuplicateOf$2.indexOf(key) >= 0) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
if (key === "set-cookie") {
|
|
384
|
-
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
385
|
-
} else {
|
|
386
|
-
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
return parsed;
|
|
391
|
-
};
|
|
392
|
-
var utils$A = utils$G;
|
|
393
|
-
var isURLSameOrigin$5 = utils$A.isStandardBrowserEnv() ? function standardBrowserEnv2() {
|
|
394
|
-
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
395
|
-
var urlParsingNode = document.createElement("a");
|
|
396
|
-
var originURL;
|
|
397
|
-
function resolveURL(url) {
|
|
398
|
-
var href = url;
|
|
399
|
-
if (msie) {
|
|
400
|
-
urlParsingNode.setAttribute("href", href);
|
|
401
|
-
href = urlParsingNode.href;
|
|
402
|
-
}
|
|
403
|
-
urlParsingNode.setAttribute("href", href);
|
|
404
|
-
return {
|
|
405
|
-
href: urlParsingNode.href,
|
|
406
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
407
|
-
host: urlParsingNode.host,
|
|
408
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
409
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
410
|
-
hostname: urlParsingNode.hostname,
|
|
411
|
-
port: urlParsingNode.port,
|
|
412
|
-
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
originURL = resolveURL(window.location.href);
|
|
416
|
-
return function isURLSameOrigin2(requestURL) {
|
|
417
|
-
var parsed = utils$A.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
418
|
-
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
419
|
-
};
|
|
420
|
-
}() : function nonStandardBrowserEnv2() {
|
|
421
|
-
return function isURLSameOrigin2() {
|
|
422
|
-
return true;
|
|
423
|
-
};
|
|
424
|
-
}();
|
|
425
|
-
function Cancel$9(message) {
|
|
426
|
-
this.message = message;
|
|
427
|
-
}
|
|
428
|
-
Cancel$9.prototype.toString = function toString() {
|
|
429
|
-
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
430
|
-
};
|
|
431
|
-
Cancel$9.prototype.__CANCEL__ = true;
|
|
432
|
-
var Cancel_1$2 = Cancel$9;
|
|
433
|
-
var utils$z = utils$G;
|
|
434
|
-
var settle$4 = settle$5;
|
|
435
|
-
var cookies$4 = cookies$5;
|
|
436
|
-
var buildURL$7 = buildURL$8;
|
|
437
|
-
var buildFullPath$4 = buildFullPath$5;
|
|
438
|
-
var parseHeaders$4 = parseHeaders$5;
|
|
439
|
-
var isURLSameOrigin$4 = isURLSameOrigin$5;
|
|
440
|
-
var createError$6 = createError$8;
|
|
441
|
-
var defaults$d = defaults_1$2;
|
|
442
|
-
var Cancel$8 = Cancel_1$2;
|
|
443
|
-
var xhr$2 = function xhrAdapter(config) {
|
|
444
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
445
|
-
var requestData = config.data;
|
|
446
|
-
var requestHeaders = config.headers;
|
|
447
|
-
var responseType = config.responseType;
|
|
448
|
-
var onCanceled;
|
|
449
|
-
function done() {
|
|
450
|
-
if (config.cancelToken) {
|
|
451
|
-
config.cancelToken.unsubscribe(onCanceled);
|
|
452
|
-
}
|
|
453
|
-
if (config.signal) {
|
|
454
|
-
config.signal.removeEventListener("abort", onCanceled);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
if (utils$z.isFormData(requestData)) {
|
|
458
|
-
delete requestHeaders["Content-Type"];
|
|
459
|
-
}
|
|
460
|
-
var request4 = new XMLHttpRequest();
|
|
461
|
-
if (config.auth) {
|
|
462
|
-
var username = config.auth.username || "";
|
|
463
|
-
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
464
|
-
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
465
|
-
}
|
|
466
|
-
var fullPath = buildFullPath$4(config.baseURL, config.url);
|
|
467
|
-
request4.open(config.method.toUpperCase(), buildURL$7(fullPath, config.params, config.paramsSerializer), true);
|
|
468
|
-
request4.timeout = config.timeout;
|
|
469
|
-
function onloadend() {
|
|
470
|
-
if (!request4) {
|
|
471
|
-
return;
|
|
472
|
-
}
|
|
473
|
-
var responseHeaders = "getAllResponseHeaders" in request4 ? parseHeaders$4(request4.getAllResponseHeaders()) : null;
|
|
474
|
-
var responseData = !responseType || responseType === "text" || responseType === "json" ? request4.responseText : request4.response;
|
|
475
|
-
var response = {
|
|
476
|
-
data: responseData,
|
|
477
|
-
status: request4.status,
|
|
478
|
-
statusText: request4.statusText,
|
|
479
|
-
headers: responseHeaders,
|
|
480
|
-
config,
|
|
481
|
-
request: request4
|
|
482
|
-
};
|
|
483
|
-
settle$4(function _resolve(value) {
|
|
484
|
-
resolve(value);
|
|
485
|
-
done();
|
|
486
|
-
}, function _reject(err) {
|
|
487
|
-
reject(err);
|
|
488
|
-
done();
|
|
489
|
-
}, response);
|
|
490
|
-
request4 = null;
|
|
491
|
-
}
|
|
492
|
-
if ("onloadend" in request4) {
|
|
493
|
-
request4.onloadend = onloadend;
|
|
494
|
-
} else {
|
|
495
|
-
request4.onreadystatechange = function handleLoad() {
|
|
496
|
-
if (!request4 || request4.readyState !== 4) {
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
if (request4.status === 0 && !(request4.responseURL && request4.responseURL.indexOf("file:") === 0)) {
|
|
500
|
-
return;
|
|
501
|
-
}
|
|
502
|
-
setTimeout(onloadend);
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
request4.onabort = function handleAbort() {
|
|
506
|
-
if (!request4) {
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
reject(createError$6("Request aborted", config, "ECONNABORTED", request4));
|
|
510
|
-
request4 = null;
|
|
511
|
-
};
|
|
512
|
-
request4.onerror = function handleError() {
|
|
513
|
-
reject(createError$6("Network Error", config, null, request4));
|
|
514
|
-
request4 = null;
|
|
515
|
-
};
|
|
516
|
-
request4.ontimeout = function handleTimeout() {
|
|
517
|
-
var timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
|
|
518
|
-
var transitional4 = config.transitional || defaults$d.transitional;
|
|
519
|
-
if (config.timeoutErrorMessage) {
|
|
520
|
-
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
521
|
-
}
|
|
522
|
-
reject(createError$6(timeoutErrorMessage, config, transitional4.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", request4));
|
|
523
|
-
request4 = null;
|
|
524
|
-
};
|
|
525
|
-
if (utils$z.isStandardBrowserEnv()) {
|
|
526
|
-
var xsrfValue = (config.withCredentials || isURLSameOrigin$4(fullPath)) && config.xsrfCookieName ? cookies$4.read(config.xsrfCookieName) : void 0;
|
|
527
|
-
if (xsrfValue) {
|
|
528
|
-
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
if ("setRequestHeader" in request4) {
|
|
532
|
-
utils$z.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
533
|
-
if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
|
|
534
|
-
delete requestHeaders[key];
|
|
535
|
-
} else {
|
|
536
|
-
request4.setRequestHeader(key, val);
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
if (!utils$z.isUndefined(config.withCredentials)) {
|
|
541
|
-
request4.withCredentials = !!config.withCredentials;
|
|
542
|
-
}
|
|
543
|
-
if (responseType && responseType !== "json") {
|
|
544
|
-
request4.responseType = config.responseType;
|
|
545
|
-
}
|
|
546
|
-
if (typeof config.onDownloadProgress === "function") {
|
|
547
|
-
request4.addEventListener("progress", config.onDownloadProgress);
|
|
548
|
-
}
|
|
549
|
-
if (typeof config.onUploadProgress === "function" && request4.upload) {
|
|
550
|
-
request4.upload.addEventListener("progress", config.onUploadProgress);
|
|
551
|
-
}
|
|
552
|
-
if (config.cancelToken || config.signal) {
|
|
553
|
-
onCanceled = function(cancel) {
|
|
554
|
-
if (!request4) {
|
|
555
|
-
return;
|
|
556
|
-
}
|
|
557
|
-
reject(!cancel || cancel && cancel.type ? new Cancel$8("canceled") : cancel);
|
|
558
|
-
request4.abort();
|
|
559
|
-
request4 = null;
|
|
560
|
-
};
|
|
561
|
-
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
562
|
-
if (config.signal) {
|
|
563
|
-
config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
if (!requestData) {
|
|
567
|
-
requestData = null;
|
|
568
|
-
}
|
|
569
|
-
request4.send(requestData);
|
|
570
|
-
});
|
|
571
|
-
};
|
|
572
|
-
var utils$y = utils$G;
|
|
573
|
-
var normalizeHeaderName$4 = normalizeHeaderName$5;
|
|
574
|
-
var enhanceError$6 = enhanceError$8;
|
|
575
|
-
var DEFAULT_CONTENT_TYPE$2 = {
|
|
576
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
577
|
-
};
|
|
578
|
-
function setContentTypeIfUnset$2(headers, value) {
|
|
579
|
-
if (!utils$y.isUndefined(headers) && utils$y.isUndefined(headers["Content-Type"])) {
|
|
580
|
-
headers["Content-Type"] = value;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
function getDefaultAdapter$2() {
|
|
584
|
-
var adapter;
|
|
585
|
-
if (typeof XMLHttpRequest !== "undefined") {
|
|
586
|
-
adapter = xhr$2;
|
|
587
|
-
} else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
|
|
588
|
-
adapter = xhr$2;
|
|
589
|
-
}
|
|
590
|
-
return adapter;
|
|
591
|
-
}
|
|
592
|
-
function stringifySafely$2(rawValue, parser, encoder) {
|
|
593
|
-
if (utils$y.isString(rawValue)) {
|
|
594
|
-
try {
|
|
595
|
-
(parser || JSON.parse)(rawValue);
|
|
596
|
-
return utils$y.trim(rawValue);
|
|
597
|
-
} catch (e) {
|
|
598
|
-
if (e.name !== "SyntaxError") {
|
|
599
|
-
throw e;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
return (encoder || JSON.stringify)(rawValue);
|
|
604
|
-
}
|
|
605
|
-
var defaults$c = {
|
|
606
|
-
transitional: {
|
|
607
|
-
silentJSONParsing: true,
|
|
608
|
-
forcedJSONParsing: true,
|
|
609
|
-
clarifyTimeoutError: false
|
|
610
|
-
},
|
|
611
|
-
adapter: getDefaultAdapter$2(),
|
|
612
|
-
transformRequest: [function transformRequest(data2, headers) {
|
|
613
|
-
normalizeHeaderName$4(headers, "Accept");
|
|
614
|
-
normalizeHeaderName$4(headers, "Content-Type");
|
|
615
|
-
if (utils$y.isFormData(data2) || utils$y.isArrayBuffer(data2) || utils$y.isBuffer(data2) || utils$y.isStream(data2) || utils$y.isFile(data2) || utils$y.isBlob(data2)) {
|
|
616
|
-
return data2;
|
|
617
|
-
}
|
|
618
|
-
if (utils$y.isArrayBufferView(data2)) {
|
|
619
|
-
return data2.buffer;
|
|
620
|
-
}
|
|
621
|
-
if (utils$y.isURLSearchParams(data2)) {
|
|
622
|
-
setContentTypeIfUnset$2(headers, "application/x-www-form-urlencoded;charset=utf-8");
|
|
623
|
-
return data2.toString();
|
|
624
|
-
}
|
|
625
|
-
if (utils$y.isObject(data2) || headers && headers["Content-Type"] === "application/json") {
|
|
626
|
-
setContentTypeIfUnset$2(headers, "application/json");
|
|
627
|
-
return stringifySafely$2(data2);
|
|
628
|
-
}
|
|
629
|
-
return data2;
|
|
630
|
-
}],
|
|
631
|
-
transformResponse: [function transformResponse(data2) {
|
|
632
|
-
var transitional4 = this.transitional || defaults$c.transitional;
|
|
633
|
-
var silentJSONParsing = transitional4 && transitional4.silentJSONParsing;
|
|
634
|
-
var forcedJSONParsing = transitional4 && transitional4.forcedJSONParsing;
|
|
635
|
-
var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
|
|
636
|
-
if (strictJSONParsing || forcedJSONParsing && utils$y.isString(data2) && data2.length) {
|
|
637
|
-
try {
|
|
638
|
-
return JSON.parse(data2);
|
|
639
|
-
} catch (e) {
|
|
640
|
-
if (strictJSONParsing) {
|
|
641
|
-
if (e.name === "SyntaxError") {
|
|
642
|
-
throw enhanceError$6(e, this, "E_JSON_PARSE");
|
|
643
|
-
}
|
|
644
|
-
throw e;
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
return data2;
|
|
649
|
-
}],
|
|
650
|
-
timeout: 0,
|
|
651
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
652
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
653
|
-
maxContentLength: -1,
|
|
654
|
-
maxBodyLength: -1,
|
|
655
|
-
validateStatus: function validateStatus(status) {
|
|
656
|
-
return status >= 200 && status < 300;
|
|
657
|
-
},
|
|
658
|
-
headers: {
|
|
659
|
-
common: {
|
|
660
|
-
"Accept": "application/json, text/plain, */*"
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
utils$y.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
665
|
-
defaults$c.headers[method] = {};
|
|
666
|
-
});
|
|
667
|
-
utils$y.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
668
|
-
defaults$c.headers[method] = utils$y.merge(DEFAULT_CONTENT_TYPE$2);
|
|
669
|
-
});
|
|
670
|
-
var defaults_1$2 = defaults$c;
|
|
671
|
-
var utils$x = utils$G;
|
|
672
|
-
var defaults$b = defaults_1$2;
|
|
673
|
-
var transformData$5 = function transformData(data2, headers, fns) {
|
|
674
|
-
var context = this || defaults$b;
|
|
675
|
-
utils$x.forEach(fns, function transform(fn) {
|
|
676
|
-
data2 = fn.call(context, data2, headers);
|
|
677
|
-
});
|
|
678
|
-
return data2;
|
|
679
|
-
};
|
|
680
|
-
var isCancel$5 = function isCancel(value) {
|
|
681
|
-
return !!(value && value.__CANCEL__);
|
|
682
|
-
};
|
|
683
|
-
var utils$w = utils$G;
|
|
684
|
-
var transformData$4 = transformData$5;
|
|
685
|
-
var isCancel$4 = isCancel$5;
|
|
686
|
-
var defaults$a = defaults_1$2;
|
|
687
|
-
var Cancel$7 = Cancel_1$2;
|
|
688
|
-
function throwIfCancellationRequested$2(config) {
|
|
689
|
-
if (config.cancelToken) {
|
|
690
|
-
config.cancelToken.throwIfRequested();
|
|
691
|
-
}
|
|
692
|
-
if (config.signal && config.signal.aborted) {
|
|
693
|
-
throw new Cancel$7("canceled");
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
var dispatchRequest$5 = function dispatchRequest(config) {
|
|
697
|
-
throwIfCancellationRequested$2(config);
|
|
698
|
-
config.headers = config.headers || {};
|
|
699
|
-
config.data = transformData$4.call(config, config.data, config.headers, config.transformRequest);
|
|
700
|
-
config.headers = utils$w.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
|
|
701
|
-
utils$w.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) {
|
|
702
|
-
delete config.headers[method];
|
|
703
|
-
});
|
|
704
|
-
var adapter = config.adapter || defaults$a.adapter;
|
|
705
|
-
return adapter(config).then(function onAdapterResolution(response) {
|
|
706
|
-
throwIfCancellationRequested$2(config);
|
|
707
|
-
response.data = transformData$4.call(config, response.data, response.headers, config.transformResponse);
|
|
708
|
-
return response;
|
|
709
|
-
}, function onAdapterRejection(reason) {
|
|
710
|
-
if (!isCancel$4(reason)) {
|
|
711
|
-
throwIfCancellationRequested$2(config);
|
|
712
|
-
if (reason && reason.response) {
|
|
713
|
-
reason.response.data = transformData$4.call(config, reason.response.data, reason.response.headers, config.transformResponse);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
return Promise.reject(reason);
|
|
717
|
-
});
|
|
718
|
-
};
|
|
719
|
-
var utils$v = utils$G;
|
|
720
|
-
var mergeConfig$8 = function mergeConfig(config1, config2) {
|
|
721
|
-
config2 = config2 || {};
|
|
722
|
-
var config = {};
|
|
723
|
-
function getMergedValue(target, source4) {
|
|
724
|
-
if (utils$v.isPlainObject(target) && utils$v.isPlainObject(source4)) {
|
|
725
|
-
return utils$v.merge(target, source4);
|
|
726
|
-
} else if (utils$v.isPlainObject(source4)) {
|
|
727
|
-
return utils$v.merge({}, source4);
|
|
728
|
-
} else if (utils$v.isArray(source4)) {
|
|
729
|
-
return source4.slice();
|
|
730
|
-
}
|
|
731
|
-
return source4;
|
|
732
|
-
}
|
|
733
|
-
function mergeDeepProperties(prop) {
|
|
734
|
-
if (!utils$v.isUndefined(config2[prop])) {
|
|
735
|
-
return getMergedValue(config1[prop], config2[prop]);
|
|
736
|
-
} else if (!utils$v.isUndefined(config1[prop])) {
|
|
737
|
-
return getMergedValue(void 0, config1[prop]);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
function valueFromConfig2(prop) {
|
|
741
|
-
if (!utils$v.isUndefined(config2[prop])) {
|
|
742
|
-
return getMergedValue(void 0, config2[prop]);
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
function defaultToConfig2(prop) {
|
|
746
|
-
if (!utils$v.isUndefined(config2[prop])) {
|
|
747
|
-
return getMergedValue(void 0, config2[prop]);
|
|
748
|
-
} else if (!utils$v.isUndefined(config1[prop])) {
|
|
749
|
-
return getMergedValue(void 0, config1[prop]);
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
function mergeDirectKeys(prop) {
|
|
753
|
-
if (prop in config2) {
|
|
754
|
-
return getMergedValue(config1[prop], config2[prop]);
|
|
755
|
-
} else if (prop in config1) {
|
|
756
|
-
return getMergedValue(void 0, config1[prop]);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
var mergeMap = {
|
|
760
|
-
"url": valueFromConfig2,
|
|
761
|
-
"method": valueFromConfig2,
|
|
762
|
-
"data": valueFromConfig2,
|
|
763
|
-
"baseURL": defaultToConfig2,
|
|
764
|
-
"transformRequest": defaultToConfig2,
|
|
765
|
-
"transformResponse": defaultToConfig2,
|
|
766
|
-
"paramsSerializer": defaultToConfig2,
|
|
767
|
-
"timeout": defaultToConfig2,
|
|
768
|
-
"timeoutMessage": defaultToConfig2,
|
|
769
|
-
"withCredentials": defaultToConfig2,
|
|
770
|
-
"adapter": defaultToConfig2,
|
|
771
|
-
"responseType": defaultToConfig2,
|
|
772
|
-
"xsrfCookieName": defaultToConfig2,
|
|
773
|
-
"xsrfHeaderName": defaultToConfig2,
|
|
774
|
-
"onUploadProgress": defaultToConfig2,
|
|
775
|
-
"onDownloadProgress": defaultToConfig2,
|
|
776
|
-
"decompress": defaultToConfig2,
|
|
777
|
-
"maxContentLength": defaultToConfig2,
|
|
778
|
-
"maxBodyLength": defaultToConfig2,
|
|
779
|
-
"transport": defaultToConfig2,
|
|
780
|
-
"httpAgent": defaultToConfig2,
|
|
781
|
-
"httpsAgent": defaultToConfig2,
|
|
782
|
-
"cancelToken": defaultToConfig2,
|
|
783
|
-
"socketPath": defaultToConfig2,
|
|
784
|
-
"responseEncoding": defaultToConfig2,
|
|
785
|
-
"validateStatus": mergeDirectKeys
|
|
786
|
-
};
|
|
787
|
-
utils$v.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
788
|
-
var merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
789
|
-
var configValue = merge2(prop);
|
|
790
|
-
utils$v.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
791
|
-
});
|
|
792
|
-
return config;
|
|
793
|
-
};
|
|
794
|
-
var data$1 = {
|
|
795
|
-
"version": "0.25.0"
|
|
796
|
-
};
|
|
797
|
-
var VERSION$1 = data$1.version;
|
|
798
|
-
var validators$5 = {};
|
|
799
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
|
|
800
|
-
validators$5[type] = function validator2(thing) {
|
|
801
|
-
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
802
|
-
};
|
|
803
|
-
});
|
|
804
|
-
var deprecatedWarnings$2 = {};
|
|
805
|
-
validators$5.transitional = function transitional(validator2, version2, message) {
|
|
806
|
-
function formatMessage(opt, desc) {
|
|
807
|
-
return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
808
|
-
}
|
|
809
|
-
return function(value, opt, opts) {
|
|
810
|
-
if (validator2 === false) {
|
|
811
|
-
throw new Error(formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")));
|
|
812
|
-
}
|
|
813
|
-
if (version2 && !deprecatedWarnings$2[opt]) {
|
|
814
|
-
deprecatedWarnings$2[opt] = true;
|
|
815
|
-
console.warn(formatMessage(opt, " has been deprecated since v" + version2 + " and will be removed in the near future"));
|
|
816
|
-
}
|
|
817
|
-
return validator2 ? validator2(value, opt, opts) : true;
|
|
818
|
-
};
|
|
819
|
-
};
|
|
820
|
-
function assertOptions$2(options, schema, allowUnknown) {
|
|
821
|
-
if (typeof options !== "object") {
|
|
822
|
-
throw new TypeError("options must be an object");
|
|
823
|
-
}
|
|
824
|
-
var keys = Object.keys(options);
|
|
825
|
-
var i = keys.length;
|
|
826
|
-
while (i-- > 0) {
|
|
827
|
-
var opt = keys[i];
|
|
828
|
-
var validator2 = schema[opt];
|
|
829
|
-
if (validator2) {
|
|
830
|
-
var value = options[opt];
|
|
831
|
-
var result = value === void 0 || validator2(value, opt, options);
|
|
832
|
-
if (result !== true) {
|
|
833
|
-
throw new TypeError("option " + opt + " must be " + result);
|
|
834
|
-
}
|
|
835
|
-
continue;
|
|
836
|
-
}
|
|
837
|
-
if (allowUnknown !== true) {
|
|
838
|
-
throw Error("Unknown option " + opt);
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
var validator$5 = {
|
|
843
|
-
assertOptions: assertOptions$2,
|
|
844
|
-
validators: validators$5
|
|
845
|
-
};
|
|
846
|
-
var utils$u = utils$G;
|
|
847
|
-
var buildURL$6 = buildURL$8;
|
|
848
|
-
var InterceptorManager$4 = InterceptorManager_1$2;
|
|
849
|
-
var dispatchRequest$4 = dispatchRequest$5;
|
|
850
|
-
var mergeConfig$7 = mergeConfig$8;
|
|
851
|
-
var validator$4 = validator$5;
|
|
852
|
-
var validators$4 = validator$4.validators;
|
|
853
|
-
function Axios$5(instanceConfig) {
|
|
854
|
-
this.defaults = instanceConfig;
|
|
855
|
-
this.interceptors = {
|
|
856
|
-
request: new InterceptorManager$4(),
|
|
857
|
-
response: new InterceptorManager$4()
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
|
-
Axios$5.prototype.request = function request(configOrUrl, config) {
|
|
861
|
-
if (typeof configOrUrl === "string") {
|
|
862
|
-
config = config || {};
|
|
863
|
-
config.url = configOrUrl;
|
|
864
|
-
} else {
|
|
865
|
-
config = configOrUrl || {};
|
|
866
|
-
}
|
|
867
|
-
if (!config.url) {
|
|
868
|
-
throw new Error("Provided config url is not valid");
|
|
869
|
-
}
|
|
870
|
-
config = mergeConfig$7(this.defaults, config);
|
|
871
|
-
if (config.method) {
|
|
872
|
-
config.method = config.method.toLowerCase();
|
|
873
|
-
} else if (this.defaults.method) {
|
|
874
|
-
config.method = this.defaults.method.toLowerCase();
|
|
875
|
-
} else {
|
|
876
|
-
config.method = "get";
|
|
877
|
-
}
|
|
878
|
-
var transitional4 = config.transitional;
|
|
879
|
-
if (transitional4 !== void 0) {
|
|
880
|
-
validator$4.assertOptions(transitional4, {
|
|
881
|
-
silentJSONParsing: validators$4.transitional(validators$4.boolean),
|
|
882
|
-
forcedJSONParsing: validators$4.transitional(validators$4.boolean),
|
|
883
|
-
clarifyTimeoutError: validators$4.transitional(validators$4.boolean)
|
|
884
|
-
}, false);
|
|
885
|
-
}
|
|
886
|
-
var requestInterceptorChain = [];
|
|
887
|
-
var synchronousRequestInterceptors = true;
|
|
888
|
-
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
889
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
890
|
-
return;
|
|
891
|
-
}
|
|
892
|
-
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
893
|
-
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
894
|
-
});
|
|
895
|
-
var responseInterceptorChain = [];
|
|
896
|
-
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
897
|
-
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
898
|
-
});
|
|
899
|
-
var promise;
|
|
900
|
-
if (!synchronousRequestInterceptors) {
|
|
901
|
-
var chain = [dispatchRequest$4, void 0];
|
|
902
|
-
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
903
|
-
chain = chain.concat(responseInterceptorChain);
|
|
904
|
-
promise = Promise.resolve(config);
|
|
905
|
-
while (chain.length) {
|
|
906
|
-
promise = promise.then(chain.shift(), chain.shift());
|
|
907
|
-
}
|
|
908
|
-
return promise;
|
|
909
|
-
}
|
|
910
|
-
var newConfig = config;
|
|
911
|
-
while (requestInterceptorChain.length) {
|
|
912
|
-
var onFulfilled = requestInterceptorChain.shift();
|
|
913
|
-
var onRejected = requestInterceptorChain.shift();
|
|
914
|
-
try {
|
|
915
|
-
newConfig = onFulfilled(newConfig);
|
|
916
|
-
} catch (error) {
|
|
917
|
-
onRejected(error);
|
|
918
|
-
break;
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
try {
|
|
922
|
-
promise = dispatchRequest$4(newConfig);
|
|
923
|
-
} catch (error) {
|
|
924
|
-
return Promise.reject(error);
|
|
925
|
-
}
|
|
926
|
-
while (responseInterceptorChain.length) {
|
|
927
|
-
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
928
|
-
}
|
|
929
|
-
return promise;
|
|
930
|
-
};
|
|
931
|
-
Axios$5.prototype.getUri = function getUri(config) {
|
|
932
|
-
if (!config.url) {
|
|
933
|
-
throw new Error("Provided config url is not valid");
|
|
934
|
-
}
|
|
935
|
-
config = mergeConfig$7(this.defaults, config);
|
|
936
|
-
return buildURL$6(config.url, config.params, config.paramsSerializer).replace(/^\?/, "");
|
|
937
|
-
};
|
|
938
|
-
utils$u.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
|
|
939
|
-
Axios$5.prototype[method] = function(url, config) {
|
|
940
|
-
return this.request(mergeConfig$7(config || {}, {
|
|
941
|
-
method,
|
|
942
|
-
url,
|
|
943
|
-
data: (config || {}).data
|
|
944
|
-
}));
|
|
945
|
-
};
|
|
946
|
-
});
|
|
947
|
-
utils$u.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
948
|
-
Axios$5.prototype[method] = function(url, data2, config) {
|
|
949
|
-
return this.request(mergeConfig$7(config || {}, {
|
|
950
|
-
method,
|
|
951
|
-
url,
|
|
952
|
-
data: data2
|
|
953
|
-
}));
|
|
954
|
-
};
|
|
955
|
-
});
|
|
956
|
-
var Axios_1$2 = Axios$5;
|
|
957
|
-
var Cancel$6 = Cancel_1$2;
|
|
958
|
-
function CancelToken$2(executor) {
|
|
959
|
-
if (typeof executor !== "function") {
|
|
960
|
-
throw new TypeError("executor must be a function.");
|
|
961
|
-
}
|
|
962
|
-
var resolvePromise;
|
|
963
|
-
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
964
|
-
resolvePromise = resolve;
|
|
965
|
-
});
|
|
966
|
-
var token2 = this;
|
|
967
|
-
this.promise.then(function(cancel) {
|
|
968
|
-
if (!token2._listeners)
|
|
969
|
-
return;
|
|
970
|
-
var i;
|
|
971
|
-
var l = token2._listeners.length;
|
|
972
|
-
for (i = 0; i < l; i++) {
|
|
973
|
-
token2._listeners[i](cancel);
|
|
974
|
-
}
|
|
975
|
-
token2._listeners = null;
|
|
976
|
-
});
|
|
977
|
-
this.promise.then = function(onfulfilled) {
|
|
978
|
-
var _resolve;
|
|
979
|
-
var promise = new Promise(function(resolve) {
|
|
980
|
-
token2.subscribe(resolve);
|
|
981
|
-
_resolve = resolve;
|
|
982
|
-
}).then(onfulfilled);
|
|
983
|
-
promise.cancel = function reject() {
|
|
984
|
-
token2.unsubscribe(_resolve);
|
|
985
|
-
};
|
|
986
|
-
return promise;
|
|
987
|
-
};
|
|
988
|
-
executor(function cancel(message) {
|
|
989
|
-
if (token2.reason) {
|
|
990
|
-
return;
|
|
991
|
-
}
|
|
992
|
-
token2.reason = new Cancel$6(message);
|
|
993
|
-
resolvePromise(token2.reason);
|
|
994
|
-
});
|
|
995
|
-
}
|
|
996
|
-
CancelToken$2.prototype.throwIfRequested = function throwIfRequested() {
|
|
997
|
-
if (this.reason) {
|
|
998
|
-
throw this.reason;
|
|
999
|
-
}
|
|
1000
|
-
};
|
|
1001
|
-
CancelToken$2.prototype.subscribe = function subscribe(listener) {
|
|
1002
|
-
if (this.reason) {
|
|
1003
|
-
listener(this.reason);
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
if (this._listeners) {
|
|
1007
|
-
this._listeners.push(listener);
|
|
1008
|
-
} else {
|
|
1009
|
-
this._listeners = [listener];
|
|
1010
|
-
}
|
|
1011
|
-
};
|
|
1012
|
-
CancelToken$2.prototype.unsubscribe = function unsubscribe(listener) {
|
|
1013
|
-
if (!this._listeners) {
|
|
1014
|
-
return;
|
|
1015
|
-
}
|
|
1016
|
-
var index = this._listeners.indexOf(listener);
|
|
1017
|
-
if (index !== -1) {
|
|
1018
|
-
this._listeners.splice(index, 1);
|
|
1019
|
-
}
|
|
1020
|
-
};
|
|
1021
|
-
CancelToken$2.source = function source() {
|
|
1022
|
-
var cancel;
|
|
1023
|
-
var token2 = new CancelToken$2(function executor(c) {
|
|
1024
|
-
cancel = c;
|
|
1025
|
-
});
|
|
1026
|
-
return {
|
|
1027
|
-
token: token2,
|
|
1028
|
-
cancel
|
|
1029
|
-
};
|
|
1030
|
-
};
|
|
1031
|
-
var CancelToken_1$2 = CancelToken$2;
|
|
1032
|
-
var spread$2 = function spread(callback) {
|
|
1033
|
-
return function wrap(arr) {
|
|
1034
|
-
return callback.apply(null, arr);
|
|
1035
|
-
};
|
|
1036
|
-
};
|
|
1037
|
-
var utils$t = utils$G;
|
|
1038
|
-
var isAxiosError$2 = function isAxiosError(payload) {
|
|
1039
|
-
return utils$t.isObject(payload) && payload.isAxiosError === true;
|
|
1040
|
-
};
|
|
1041
|
-
var utils$s = utils$G;
|
|
1042
|
-
var bind$6 = bind$8;
|
|
1043
|
-
var Axios$4 = Axios_1$2;
|
|
1044
|
-
var mergeConfig$6 = mergeConfig$8;
|
|
1045
|
-
var defaults$9 = defaults_1$2;
|
|
1046
|
-
function createInstance$2(defaultConfig) {
|
|
1047
|
-
var context = new Axios$4(defaultConfig);
|
|
1048
|
-
var instance = bind$6(Axios$4.prototype.request, context);
|
|
1049
|
-
utils$s.extend(instance, Axios$4.prototype, context);
|
|
1050
|
-
utils$s.extend(instance, context);
|
|
1051
|
-
instance.create = function create2(instanceConfig) {
|
|
1052
|
-
return createInstance$2(mergeConfig$6(defaultConfig, instanceConfig));
|
|
1053
|
-
};
|
|
1054
|
-
return instance;
|
|
1055
|
-
}
|
|
1056
|
-
var axios$7 = createInstance$2(defaults$9);
|
|
1057
|
-
axios$7.Axios = Axios$4;
|
|
1058
|
-
axios$7.Cancel = Cancel_1$2;
|
|
1059
|
-
axios$7.CancelToken = CancelToken_1$2;
|
|
1060
|
-
axios$7.isCancel = isCancel$5;
|
|
1061
|
-
axios$7.VERSION = data$1.version;
|
|
1062
|
-
axios$7.all = function all(promises) {
|
|
1063
|
-
return Promise.all(promises);
|
|
1064
|
-
};
|
|
1065
|
-
axios$7.spread = spread$2;
|
|
1066
|
-
axios$7.isAxiosError = isAxiosError$2;
|
|
1067
|
-
axios$8.exports = axios$7;
|
|
1068
|
-
axios$8.exports.default = axios$7;
|
|
1069
|
-
var axios$6 = axios$8.exports;
|
|
20
|
+
const axios$3 = require("axios");
|
|
1070
21
|
const SERVER_ERROR_CODE = 500;
|
|
1071
22
|
class HasuraAuthApi {
|
|
1072
23
|
constructor({ url = "" }) {
|
|
1073
24
|
this.url = url;
|
|
1074
|
-
this.httpClient = axios$
|
|
25
|
+
this.httpClient = axios$3.create({
|
|
1075
26
|
baseURL: this.url
|
|
1076
27
|
});
|
|
1077
28
|
this.httpClient.interceptors.response.use((response) => response, (error) => {
|
|
@@ -1313,11 +264,11 @@ var filterObj = function(obj, predicate) {
|
|
|
1313
264
|
return result;
|
|
1314
265
|
}
|
|
1315
266
|
if (value === null) {
|
|
1316
|
-
return [...result, [
|
|
267
|
+
return [...result, [encode(key, options), "[", index, "]"].join("")];
|
|
1317
268
|
}
|
|
1318
269
|
return [
|
|
1319
270
|
...result,
|
|
1320
|
-
[
|
|
271
|
+
[encode(key, options), "[", encode(index, options), "]=", encode(value, options)].join("")
|
|
1321
272
|
];
|
|
1322
273
|
};
|
|
1323
274
|
case "bracket":
|
|
@@ -1326,9 +277,9 @@ var filterObj = function(obj, predicate) {
|
|
|
1326
277
|
return result;
|
|
1327
278
|
}
|
|
1328
279
|
if (value === null) {
|
|
1329
|
-
return [...result, [
|
|
280
|
+
return [...result, [encode(key, options), "[]"].join("")];
|
|
1330
281
|
}
|
|
1331
|
-
return [...result, [
|
|
282
|
+
return [...result, [encode(key, options), "[]=", encode(value, options)].join("")];
|
|
1332
283
|
};
|
|
1333
284
|
case "colon-list-separator":
|
|
1334
285
|
return (key) => (result, value) => {
|
|
@@ -1336,9 +287,9 @@ var filterObj = function(obj, predicate) {
|
|
|
1336
287
|
return result;
|
|
1337
288
|
}
|
|
1338
289
|
if (value === null) {
|
|
1339
|
-
return [...result, [
|
|
290
|
+
return [...result, [encode(key, options), ":list="].join("")];
|
|
1340
291
|
}
|
|
1341
|
-
return [...result, [
|
|
292
|
+
return [...result, [encode(key, options), ":list=", encode(value, options)].join("")];
|
|
1342
293
|
};
|
|
1343
294
|
case "comma":
|
|
1344
295
|
case "separator":
|
|
@@ -1350,9 +301,9 @@ var filterObj = function(obj, predicate) {
|
|
|
1350
301
|
}
|
|
1351
302
|
value = value === null ? "" : value;
|
|
1352
303
|
if (result.length === 0) {
|
|
1353
|
-
return [[
|
|
304
|
+
return [[encode(key, options), keyValueSep, encode(value, options)].join("")];
|
|
1354
305
|
}
|
|
1355
|
-
return [[result,
|
|
306
|
+
return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
|
|
1356
307
|
};
|
|
1357
308
|
}
|
|
1358
309
|
default:
|
|
@@ -1361,9 +312,9 @@ var filterObj = function(obj, predicate) {
|
|
|
1361
312
|
return result;
|
|
1362
313
|
}
|
|
1363
314
|
if (value === null) {
|
|
1364
|
-
return [...result,
|
|
315
|
+
return [...result, encode(key, options)];
|
|
1365
316
|
}
|
|
1366
|
-
return [...result, [
|
|
317
|
+
return [...result, [encode(key, options), "=", encode(value, options)].join("")];
|
|
1367
318
|
};
|
|
1368
319
|
}
|
|
1369
320
|
}
|
|
@@ -1414,17 +365,17 @@ var filterObj = function(obj, predicate) {
|
|
|
1414
365
|
case "comma":
|
|
1415
366
|
case "separator":
|
|
1416
367
|
return (key, value, accumulator) => {
|
|
1417
|
-
const
|
|
1418
|
-
const isEncodedArray = typeof value === "string" && !
|
|
368
|
+
const isArray = typeof value === "string" && value.includes(options.arrayFormatSeparator);
|
|
369
|
+
const isEncodedArray = typeof value === "string" && !isArray && decode2(value, options).includes(options.arrayFormatSeparator);
|
|
1419
370
|
value = isEncodedArray ? decode2(value, options) : value;
|
|
1420
|
-
const newValue =
|
|
371
|
+
const newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map((item) => decode2(item, options)) : value === null ? value : decode2(value, options);
|
|
1421
372
|
accumulator[key] = newValue;
|
|
1422
373
|
};
|
|
1423
374
|
case "bracket-separator":
|
|
1424
375
|
return (key, value, accumulator) => {
|
|
1425
|
-
const
|
|
376
|
+
const isArray = /(\[\])$/.test(key);
|
|
1426
377
|
key = key.replace(/\[\]$/, "");
|
|
1427
|
-
if (!
|
|
378
|
+
if (!isArray) {
|
|
1428
379
|
accumulator[key] = value ? decode2(value, options) : value;
|
|
1429
380
|
return;
|
|
1430
381
|
}
|
|
@@ -1450,7 +401,7 @@ var filterObj = function(obj, predicate) {
|
|
|
1450
401
|
throw new TypeError("arrayFormatSeparator must be single character string");
|
|
1451
402
|
}
|
|
1452
403
|
}
|
|
1453
|
-
function
|
|
404
|
+
function encode(value, options) {
|
|
1454
405
|
if (options.encode) {
|
|
1455
406
|
return options.strict ? strictUriEncode$1(value) : encodeURIComponent(value);
|
|
1456
407
|
}
|
|
@@ -1583,15 +534,15 @@ var filterObj = function(obj, predicate) {
|
|
|
1583
534
|
return "";
|
|
1584
535
|
}
|
|
1585
536
|
if (value === null) {
|
|
1586
|
-
return
|
|
537
|
+
return encode(key, options);
|
|
1587
538
|
}
|
|
1588
539
|
if (Array.isArray(value)) {
|
|
1589
540
|
if (value.length === 0 && options.arrayFormat === "bracket-separator") {
|
|
1590
|
-
return
|
|
541
|
+
return encode(key, options) + "[]";
|
|
1591
542
|
}
|
|
1592
543
|
return value.reduce(formatter(key), []).join("&");
|
|
1593
544
|
}
|
|
1594
|
-
return
|
|
545
|
+
return encode(key, options) + "=" + encode(value, options);
|
|
1595
546
|
}).filter((x) => x.length > 0).join("&");
|
|
1596
547
|
};
|
|
1597
548
|
exports.parseUrl = (url, options) => {
|
|
@@ -1620,7 +571,7 @@ var filterObj = function(obj, predicate) {
|
|
|
1620
571
|
}
|
|
1621
572
|
let hash = getHash(object.url);
|
|
1622
573
|
if (object.fragmentIdentifier) {
|
|
1623
|
-
hash = `#${options[encodeFragmentIdentifier] ?
|
|
574
|
+
hash = `#${options[encodeFragmentIdentifier] ? encode(object.fragmentIdentifier, options) : object.fragmentIdentifier}`;
|
|
1624
575
|
}
|
|
1625
576
|
return `${url}${queryString2}${hash}`;
|
|
1626
577
|
};
|
|
@@ -1709,17 +660,17 @@ class HasuraAuthClient {
|
|
|
1709
660
|
async signUp(params) {
|
|
1710
661
|
const { email, password } = params;
|
|
1711
662
|
if (email && password) {
|
|
1712
|
-
const { data
|
|
663
|
+
const { data, error } = await this.api.signUpEmailPassword(params);
|
|
1713
664
|
if (error) {
|
|
1714
665
|
return { session: null, error };
|
|
1715
666
|
}
|
|
1716
|
-
if (!
|
|
667
|
+
if (!data) {
|
|
1717
668
|
return {
|
|
1718
669
|
session: null,
|
|
1719
670
|
error: { message: "An error occurred on sign up.", status: 500 }
|
|
1720
671
|
};
|
|
1721
672
|
}
|
|
1722
|
-
const { session } =
|
|
673
|
+
const { session } = data;
|
|
1723
674
|
if (session) {
|
|
1724
675
|
await this._setSession(session);
|
|
1725
676
|
}
|
|
@@ -1740,18 +691,18 @@ class HasuraAuthClient {
|
|
|
1740
691
|
return { providerUrl, provider, session: null, mfa: null, error: null };
|
|
1741
692
|
}
|
|
1742
693
|
if ("email" in params && "password" in params) {
|
|
1743
|
-
const { data
|
|
694
|
+
const { data, error } = await this.api.signInEmailPassword(params);
|
|
1744
695
|
if (error) {
|
|
1745
696
|
return { session: null, mfa: null, error };
|
|
1746
697
|
}
|
|
1747
|
-
if (!
|
|
698
|
+
if (!data) {
|
|
1748
699
|
return {
|
|
1749
700
|
session: null,
|
|
1750
701
|
mfa: null,
|
|
1751
702
|
error: { message: "Incorrect Data", status: 500 }
|
|
1752
703
|
};
|
|
1753
704
|
}
|
|
1754
|
-
const { session, mfa } =
|
|
705
|
+
const { session, mfa } = data;
|
|
1755
706
|
if (session) {
|
|
1756
707
|
await this._setSession(session);
|
|
1757
708
|
}
|
|
@@ -1772,18 +723,18 @@ class HasuraAuthClient {
|
|
|
1772
723
|
return { session: null, mfa: null, error: null };
|
|
1773
724
|
}
|
|
1774
725
|
if ("otp" in params) {
|
|
1775
|
-
const { data
|
|
726
|
+
const { data, error } = await this.api.signInPasswordlessSmsOtp(params);
|
|
1776
727
|
if (error) {
|
|
1777
728
|
return { session: null, mfa: null, error };
|
|
1778
729
|
}
|
|
1779
|
-
if (!
|
|
730
|
+
if (!data) {
|
|
1780
731
|
return {
|
|
1781
732
|
session: null,
|
|
1782
733
|
mfa: null,
|
|
1783
734
|
error: { message: "Incorrect data", status: 500 }
|
|
1784
735
|
};
|
|
1785
736
|
}
|
|
1786
|
-
const { session, mfa } =
|
|
737
|
+
const { session, mfa } = data;
|
|
1787
738
|
if (session) {
|
|
1788
739
|
await this._setSession(session);
|
|
1789
740
|
}
|
|
@@ -1830,7 +781,7 @@ class HasuraAuthClient {
|
|
|
1830
781
|
onTokenChanged(fn) {
|
|
1831
782
|
this.onTokenChangedFunctions.push(fn);
|
|
1832
783
|
const index = this.onTokenChangedFunctions.length - 1;
|
|
1833
|
-
const
|
|
784
|
+
const unsubscribe = () => {
|
|
1834
785
|
try {
|
|
1835
786
|
this.onTokenChangedFunctions[index] = () => {
|
|
1836
787
|
};
|
|
@@ -1838,12 +789,12 @@ class HasuraAuthClient {
|
|
|
1838
789
|
console.warn("Unable to unsubscribe onTokenChanged function. Maybe the functions is already unsubscribed?");
|
|
1839
790
|
}
|
|
1840
791
|
};
|
|
1841
|
-
return
|
|
792
|
+
return unsubscribe;
|
|
1842
793
|
}
|
|
1843
794
|
onAuthStateChanged(fn) {
|
|
1844
795
|
this.onAuthChangedFunctions.push(fn);
|
|
1845
796
|
const index = this.onAuthChangedFunctions.length - 1;
|
|
1846
|
-
const
|
|
797
|
+
const unsubscribe = () => {
|
|
1847
798
|
try {
|
|
1848
799
|
this.onAuthChangedFunctions[index] = () => {
|
|
1849
800
|
};
|
|
@@ -1851,7 +802,7 @@ class HasuraAuthClient {
|
|
|
1851
802
|
console.warn("Unable to unsubscribe onAuthStateChanged function. Maybe you already did?");
|
|
1852
803
|
}
|
|
1853
804
|
};
|
|
1854
|
-
return
|
|
805
|
+
return unsubscribe;
|
|
1855
806
|
}
|
|
1856
807
|
isAuthenticated() {
|
|
1857
808
|
return this.session !== null;
|
|
@@ -1861,9 +812,9 @@ class HasuraAuthClient {
|
|
|
1861
812
|
if (!this.initAuthLoading) {
|
|
1862
813
|
resolve(this.isAuthenticated());
|
|
1863
814
|
} else {
|
|
1864
|
-
const
|
|
815
|
+
const unsubscribe = this.onAuthStateChanged((event, _session) => {
|
|
1865
816
|
resolve(event === "SIGNED_IN");
|
|
1866
|
-
|
|
817
|
+
unsubscribe();
|
|
1867
818
|
});
|
|
1868
819
|
}
|
|
1869
820
|
});
|
|
@@ -2076,1101 +1027,13 @@ class HasuraAuthClient {
|
|
|
2076
1027
|
this.initAuthLoading = false;
|
|
2077
1028
|
}
|
|
2078
1029
|
}
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
}
|
|
2086
|
-
return fn.apply(thisArg, args);
|
|
2087
|
-
};
|
|
2088
|
-
};
|
|
2089
|
-
var bind$4 = bind$5;
|
|
2090
|
-
var toString$1 = Object.prototype.toString;
|
|
2091
|
-
function isArray$1(val) {
|
|
2092
|
-
return toString$1.call(val) === "[object Array]";
|
|
2093
|
-
}
|
|
2094
|
-
function isUndefined$1(val) {
|
|
2095
|
-
return typeof val === "undefined";
|
|
2096
|
-
}
|
|
2097
|
-
function isBuffer$1(val) {
|
|
2098
|
-
return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
|
|
2099
|
-
}
|
|
2100
|
-
function isArrayBuffer$1(val) {
|
|
2101
|
-
return toString$1.call(val) === "[object ArrayBuffer]";
|
|
2102
|
-
}
|
|
2103
|
-
function isFormData$1(val) {
|
|
2104
|
-
return typeof FormData !== "undefined" && val instanceof FormData;
|
|
2105
|
-
}
|
|
2106
|
-
function isArrayBufferView$1(val) {
|
|
2107
|
-
var result;
|
|
2108
|
-
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
2109
|
-
result = ArrayBuffer.isView(val);
|
|
2110
|
-
} else {
|
|
2111
|
-
result = val && val.buffer && val.buffer instanceof ArrayBuffer;
|
|
2112
|
-
}
|
|
2113
|
-
return result;
|
|
2114
|
-
}
|
|
2115
|
-
function isString$1(val) {
|
|
2116
|
-
return typeof val === "string";
|
|
2117
|
-
}
|
|
2118
|
-
function isNumber$1(val) {
|
|
2119
|
-
return typeof val === "number";
|
|
2120
|
-
}
|
|
2121
|
-
function isObject$1(val) {
|
|
2122
|
-
return val !== null && typeof val === "object";
|
|
2123
|
-
}
|
|
2124
|
-
function isPlainObject$1(val) {
|
|
2125
|
-
if (toString$1.call(val) !== "[object Object]") {
|
|
2126
|
-
return false;
|
|
2127
|
-
}
|
|
2128
|
-
var prototype = Object.getPrototypeOf(val);
|
|
2129
|
-
return prototype === null || prototype === Object.prototype;
|
|
2130
|
-
}
|
|
2131
|
-
function isDate$1(val) {
|
|
2132
|
-
return toString$1.call(val) === "[object Date]";
|
|
2133
|
-
}
|
|
2134
|
-
function isFile$1(val) {
|
|
2135
|
-
return toString$1.call(val) === "[object File]";
|
|
2136
|
-
}
|
|
2137
|
-
function isBlob$1(val) {
|
|
2138
|
-
return toString$1.call(val) === "[object Blob]";
|
|
2139
|
-
}
|
|
2140
|
-
function isFunction$1(val) {
|
|
2141
|
-
return toString$1.call(val) === "[object Function]";
|
|
2142
|
-
}
|
|
2143
|
-
function isStream$1(val) {
|
|
2144
|
-
return isObject$1(val) && isFunction$1(val.pipe);
|
|
2145
|
-
}
|
|
2146
|
-
function isURLSearchParams$1(val) {
|
|
2147
|
-
return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
|
|
2148
|
-
}
|
|
2149
|
-
function trim$1(str) {
|
|
2150
|
-
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
|
|
2151
|
-
}
|
|
2152
|
-
function isStandardBrowserEnv$1() {
|
|
2153
|
-
if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
|
|
2154
|
-
return false;
|
|
2155
|
-
}
|
|
2156
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
2157
|
-
}
|
|
2158
|
-
function forEach$1(obj, fn) {
|
|
2159
|
-
if (obj === null || typeof obj === "undefined") {
|
|
2160
|
-
return;
|
|
2161
|
-
}
|
|
2162
|
-
if (typeof obj !== "object") {
|
|
2163
|
-
obj = [obj];
|
|
2164
|
-
}
|
|
2165
|
-
if (isArray$1(obj)) {
|
|
2166
|
-
for (var i = 0, l = obj.length; i < l; i++) {
|
|
2167
|
-
fn.call(null, obj[i], i, obj);
|
|
2168
|
-
}
|
|
2169
|
-
} else {
|
|
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
|
-
function merge$1() {
|
|
2178
|
-
var result = {};
|
|
2179
|
-
function assignValue(val, key) {
|
|
2180
|
-
if (isPlainObject$1(result[key]) && isPlainObject$1(val)) {
|
|
2181
|
-
result[key] = merge$1(result[key], val);
|
|
2182
|
-
} else if (isPlainObject$1(val)) {
|
|
2183
|
-
result[key] = merge$1({}, val);
|
|
2184
|
-
} else if (isArray$1(val)) {
|
|
2185
|
-
result[key] = val.slice();
|
|
2186
|
-
} else {
|
|
2187
|
-
result[key] = val;
|
|
2188
|
-
}
|
|
2189
|
-
}
|
|
2190
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
2191
|
-
forEach$1(arguments[i], assignValue);
|
|
2192
|
-
}
|
|
2193
|
-
return result;
|
|
2194
|
-
}
|
|
2195
|
-
function extend$1(a, b, thisArg) {
|
|
2196
|
-
forEach$1(b, function assignValue(val, key) {
|
|
2197
|
-
if (thisArg && typeof val === "function") {
|
|
2198
|
-
a[key] = bind$4(val, thisArg);
|
|
2199
|
-
} else {
|
|
2200
|
-
a[key] = val;
|
|
2201
|
-
}
|
|
2202
|
-
});
|
|
2203
|
-
return a;
|
|
2204
|
-
}
|
|
2205
|
-
function stripBOM$1(content) {
|
|
2206
|
-
if (content.charCodeAt(0) === 65279) {
|
|
2207
|
-
content = content.slice(1);
|
|
2208
|
-
}
|
|
2209
|
-
return content;
|
|
2210
|
-
}
|
|
2211
|
-
var utils$r = {
|
|
2212
|
-
isArray: isArray$1,
|
|
2213
|
-
isArrayBuffer: isArrayBuffer$1,
|
|
2214
|
-
isBuffer: isBuffer$1,
|
|
2215
|
-
isFormData: isFormData$1,
|
|
2216
|
-
isArrayBufferView: isArrayBufferView$1,
|
|
2217
|
-
isString: isString$1,
|
|
2218
|
-
isNumber: isNumber$1,
|
|
2219
|
-
isObject: isObject$1,
|
|
2220
|
-
isPlainObject: isPlainObject$1,
|
|
2221
|
-
isUndefined: isUndefined$1,
|
|
2222
|
-
isDate: isDate$1,
|
|
2223
|
-
isFile: isFile$1,
|
|
2224
|
-
isBlob: isBlob$1,
|
|
2225
|
-
isFunction: isFunction$1,
|
|
2226
|
-
isStream: isStream$1,
|
|
2227
|
-
isURLSearchParams: isURLSearchParams$1,
|
|
2228
|
-
isStandardBrowserEnv: isStandardBrowserEnv$1,
|
|
2229
|
-
forEach: forEach$1,
|
|
2230
|
-
merge: merge$1,
|
|
2231
|
-
extend: extend$1,
|
|
2232
|
-
trim: trim$1,
|
|
2233
|
-
stripBOM: stripBOM$1
|
|
2234
|
-
};
|
|
2235
|
-
var utils$q = utils$r;
|
|
2236
|
-
function encode$1(val) {
|
|
2237
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
2238
|
-
}
|
|
2239
|
-
var buildURL$5 = function buildURL2(url, params, paramsSerializer) {
|
|
2240
|
-
if (!params) {
|
|
2241
|
-
return url;
|
|
2242
|
-
}
|
|
2243
|
-
var serializedParams;
|
|
2244
|
-
if (paramsSerializer) {
|
|
2245
|
-
serializedParams = paramsSerializer(params);
|
|
2246
|
-
} else if (utils$q.isURLSearchParams(params)) {
|
|
2247
|
-
serializedParams = params.toString();
|
|
2248
|
-
} else {
|
|
2249
|
-
var parts = [];
|
|
2250
|
-
utils$q.forEach(params, function serialize(val, key) {
|
|
2251
|
-
if (val === null || typeof val === "undefined") {
|
|
2252
|
-
return;
|
|
2253
|
-
}
|
|
2254
|
-
if (utils$q.isArray(val)) {
|
|
2255
|
-
key = key + "[]";
|
|
2256
|
-
} else {
|
|
2257
|
-
val = [val];
|
|
2258
|
-
}
|
|
2259
|
-
utils$q.forEach(val, function parseValue(v) {
|
|
2260
|
-
if (utils$q.isDate(v)) {
|
|
2261
|
-
v = v.toISOString();
|
|
2262
|
-
} else if (utils$q.isObject(v)) {
|
|
2263
|
-
v = JSON.stringify(v);
|
|
2264
|
-
}
|
|
2265
|
-
parts.push(encode$1(key) + "=" + encode$1(v));
|
|
2266
|
-
});
|
|
2267
|
-
});
|
|
2268
|
-
serializedParams = parts.join("&");
|
|
2269
|
-
}
|
|
2270
|
-
if (serializedParams) {
|
|
2271
|
-
var hashmarkIndex = url.indexOf("#");
|
|
2272
|
-
if (hashmarkIndex !== -1) {
|
|
2273
|
-
url = url.slice(0, hashmarkIndex);
|
|
2274
|
-
}
|
|
2275
|
-
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
2276
|
-
}
|
|
2277
|
-
return url;
|
|
2278
|
-
};
|
|
2279
|
-
var utils$p = utils$r;
|
|
2280
|
-
function InterceptorManager$3() {
|
|
2281
|
-
this.handlers = [];
|
|
2282
|
-
}
|
|
2283
|
-
InterceptorManager$3.prototype.use = function use2(fulfilled, rejected, options) {
|
|
2284
|
-
this.handlers.push({
|
|
2285
|
-
fulfilled,
|
|
2286
|
-
rejected,
|
|
2287
|
-
synchronous: options ? options.synchronous : false,
|
|
2288
|
-
runWhen: options ? options.runWhen : null
|
|
2289
|
-
});
|
|
2290
|
-
return this.handlers.length - 1;
|
|
2291
|
-
};
|
|
2292
|
-
InterceptorManager$3.prototype.eject = function eject2(id) {
|
|
2293
|
-
if (this.handlers[id]) {
|
|
2294
|
-
this.handlers[id] = null;
|
|
2295
|
-
}
|
|
2296
|
-
};
|
|
2297
|
-
InterceptorManager$3.prototype.forEach = function forEach2(fn) {
|
|
2298
|
-
utils$p.forEach(this.handlers, function forEachHandler(h) {
|
|
2299
|
-
if (h !== null) {
|
|
2300
|
-
fn(h);
|
|
2301
|
-
}
|
|
2302
|
-
});
|
|
2303
|
-
};
|
|
2304
|
-
var InterceptorManager_1$1 = InterceptorManager$3;
|
|
2305
|
-
var utils$o = utils$r;
|
|
2306
|
-
var normalizeHeaderName$3 = function normalizeHeaderName2(headers, normalizedName) {
|
|
2307
|
-
utils$o.forEach(headers, function processHeader(value, name2) {
|
|
2308
|
-
if (name2 !== normalizedName && name2.toUpperCase() === normalizedName.toUpperCase()) {
|
|
2309
|
-
headers[normalizedName] = value;
|
|
2310
|
-
delete headers[name2];
|
|
2311
|
-
}
|
|
2312
|
-
});
|
|
2313
|
-
};
|
|
2314
|
-
var enhanceError$5 = function enhanceError2(error, config, code, request4, response) {
|
|
2315
|
-
error.config = config;
|
|
2316
|
-
if (code) {
|
|
2317
|
-
error.code = code;
|
|
2318
|
-
}
|
|
2319
|
-
error.request = request4;
|
|
2320
|
-
error.response = response;
|
|
2321
|
-
error.isAxiosError = true;
|
|
2322
|
-
error.toJSON = function toJSON() {
|
|
2323
|
-
return {
|
|
2324
|
-
message: this.message,
|
|
2325
|
-
name: this.name,
|
|
2326
|
-
description: this.description,
|
|
2327
|
-
number: this.number,
|
|
2328
|
-
fileName: this.fileName,
|
|
2329
|
-
lineNumber: this.lineNumber,
|
|
2330
|
-
columnNumber: this.columnNumber,
|
|
2331
|
-
stack: this.stack,
|
|
2332
|
-
config: this.config,
|
|
2333
|
-
code: this.code
|
|
2334
|
-
};
|
|
2335
|
-
};
|
|
2336
|
-
return error;
|
|
2337
|
-
};
|
|
2338
|
-
var enhanceError$4 = enhanceError$5;
|
|
2339
|
-
var createError$5 = function createError2(message, config, code, request4, response) {
|
|
2340
|
-
var error = new Error(message);
|
|
2341
|
-
return enhanceError$4(error, config, code, request4, response);
|
|
2342
|
-
};
|
|
2343
|
-
var createError$4 = createError$5;
|
|
2344
|
-
var settle$3 = function settle2(resolve, reject, response) {
|
|
2345
|
-
var validateStatus4 = response.config.validateStatus;
|
|
2346
|
-
if (!response.status || !validateStatus4 || validateStatus4(response.status)) {
|
|
2347
|
-
resolve(response);
|
|
2348
|
-
} else {
|
|
2349
|
-
reject(createError$4("Request failed with status code " + response.status, response.config, null, response.request, response));
|
|
2350
|
-
}
|
|
2351
|
-
};
|
|
2352
|
-
var utils$n = utils$r;
|
|
2353
|
-
var cookies$3 = utils$n.isStandardBrowserEnv() ? function standardBrowserEnv3() {
|
|
2354
|
-
return {
|
|
2355
|
-
write: function write(name2, value, expires, path, domain, secure) {
|
|
2356
|
-
var cookie = [];
|
|
2357
|
-
cookie.push(name2 + "=" + encodeURIComponent(value));
|
|
2358
|
-
if (utils$n.isNumber(expires)) {
|
|
2359
|
-
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
2360
|
-
}
|
|
2361
|
-
if (utils$n.isString(path)) {
|
|
2362
|
-
cookie.push("path=" + path);
|
|
2363
|
-
}
|
|
2364
|
-
if (utils$n.isString(domain)) {
|
|
2365
|
-
cookie.push("domain=" + domain);
|
|
2366
|
-
}
|
|
2367
|
-
if (secure === true) {
|
|
2368
|
-
cookie.push("secure");
|
|
2369
|
-
}
|
|
2370
|
-
document.cookie = cookie.join("; ");
|
|
2371
|
-
},
|
|
2372
|
-
read: function read(name2) {
|
|
2373
|
-
var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)"));
|
|
2374
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
2375
|
-
},
|
|
2376
|
-
remove: function remove(name2) {
|
|
2377
|
-
this.write(name2, "", Date.now() - 864e5);
|
|
2378
|
-
}
|
|
2379
|
-
};
|
|
2380
|
-
}() : function nonStandardBrowserEnv3() {
|
|
2381
|
-
return {
|
|
2382
|
-
write: function write() {
|
|
2383
|
-
},
|
|
2384
|
-
read: function read() {
|
|
2385
|
-
return null;
|
|
2386
|
-
},
|
|
2387
|
-
remove: function remove() {
|
|
2388
|
-
}
|
|
2389
|
-
};
|
|
2390
|
-
}();
|
|
2391
|
-
var isAbsoluteURL$3 = function isAbsoluteURL2(url) {
|
|
2392
|
-
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
2393
|
-
};
|
|
2394
|
-
var combineURLs$3 = function combineURLs2(baseURL, relativeURL) {
|
|
2395
|
-
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
2396
|
-
};
|
|
2397
|
-
var isAbsoluteURL$2 = isAbsoluteURL$3;
|
|
2398
|
-
var combineURLs$2 = combineURLs$3;
|
|
2399
|
-
var buildFullPath$3 = function buildFullPath2(baseURL, requestedURL) {
|
|
2400
|
-
if (baseURL && !isAbsoluteURL$2(requestedURL)) {
|
|
2401
|
-
return combineURLs$2(baseURL, requestedURL);
|
|
2402
|
-
}
|
|
2403
|
-
return requestedURL;
|
|
2404
|
-
};
|
|
2405
|
-
var utils$m = utils$r;
|
|
2406
|
-
var ignoreDuplicateOf$1 = [
|
|
2407
|
-
"age",
|
|
2408
|
-
"authorization",
|
|
2409
|
-
"content-length",
|
|
2410
|
-
"content-type",
|
|
2411
|
-
"etag",
|
|
2412
|
-
"expires",
|
|
2413
|
-
"from",
|
|
2414
|
-
"host",
|
|
2415
|
-
"if-modified-since",
|
|
2416
|
-
"if-unmodified-since",
|
|
2417
|
-
"last-modified",
|
|
2418
|
-
"location",
|
|
2419
|
-
"max-forwards",
|
|
2420
|
-
"proxy-authorization",
|
|
2421
|
-
"referer",
|
|
2422
|
-
"retry-after",
|
|
2423
|
-
"user-agent"
|
|
2424
|
-
];
|
|
2425
|
-
var parseHeaders$3 = function parseHeaders2(headers) {
|
|
2426
|
-
var parsed = {};
|
|
2427
|
-
var key;
|
|
2428
|
-
var val;
|
|
2429
|
-
var i;
|
|
2430
|
-
if (!headers) {
|
|
2431
|
-
return parsed;
|
|
2432
|
-
}
|
|
2433
|
-
utils$m.forEach(headers.split("\n"), function parser(line) {
|
|
2434
|
-
i = line.indexOf(":");
|
|
2435
|
-
key = utils$m.trim(line.substr(0, i)).toLowerCase();
|
|
2436
|
-
val = utils$m.trim(line.substr(i + 1));
|
|
2437
|
-
if (key) {
|
|
2438
|
-
if (parsed[key] && ignoreDuplicateOf$1.indexOf(key) >= 0) {
|
|
2439
|
-
return;
|
|
2440
|
-
}
|
|
2441
|
-
if (key === "set-cookie") {
|
|
2442
|
-
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
2443
|
-
} else {
|
|
2444
|
-
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
2445
|
-
}
|
|
2446
|
-
}
|
|
2447
|
-
});
|
|
2448
|
-
return parsed;
|
|
2449
|
-
};
|
|
2450
|
-
var utils$l = utils$r;
|
|
2451
|
-
var isURLSameOrigin$3 = utils$l.isStandardBrowserEnv() ? function standardBrowserEnv4() {
|
|
2452
|
-
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
2453
|
-
var urlParsingNode = document.createElement("a");
|
|
2454
|
-
var originURL;
|
|
2455
|
-
function resolveURL(url) {
|
|
2456
|
-
var href = url;
|
|
2457
|
-
if (msie) {
|
|
2458
|
-
urlParsingNode.setAttribute("href", href);
|
|
2459
|
-
href = urlParsingNode.href;
|
|
2460
|
-
}
|
|
2461
|
-
urlParsingNode.setAttribute("href", href);
|
|
2462
|
-
return {
|
|
2463
|
-
href: urlParsingNode.href,
|
|
2464
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
2465
|
-
host: urlParsingNode.host,
|
|
2466
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
2467
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
2468
|
-
hostname: urlParsingNode.hostname,
|
|
2469
|
-
port: urlParsingNode.port,
|
|
2470
|
-
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
2471
|
-
};
|
|
2472
|
-
}
|
|
2473
|
-
originURL = resolveURL(window.location.href);
|
|
2474
|
-
return function isURLSameOrigin2(requestURL) {
|
|
2475
|
-
var parsed = utils$l.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
2476
|
-
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
2477
|
-
};
|
|
2478
|
-
}() : function nonStandardBrowserEnv4() {
|
|
2479
|
-
return function isURLSameOrigin2() {
|
|
2480
|
-
return true;
|
|
2481
|
-
};
|
|
2482
|
-
}();
|
|
2483
|
-
var utils$k = utils$r;
|
|
2484
|
-
var settle$2 = settle$3;
|
|
2485
|
-
var cookies$2 = cookies$3;
|
|
2486
|
-
var buildURL$4 = buildURL$5;
|
|
2487
|
-
var buildFullPath$2 = buildFullPath$3;
|
|
2488
|
-
var parseHeaders$2 = parseHeaders$3;
|
|
2489
|
-
var isURLSameOrigin$2 = isURLSameOrigin$3;
|
|
2490
|
-
var createError$3 = createError$5;
|
|
2491
|
-
var xhr$1 = function xhrAdapter2(config) {
|
|
2492
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2493
|
-
var requestData = config.data;
|
|
2494
|
-
var requestHeaders = config.headers;
|
|
2495
|
-
var responseType = config.responseType;
|
|
2496
|
-
if (utils$k.isFormData(requestData)) {
|
|
2497
|
-
delete requestHeaders["Content-Type"];
|
|
2498
|
-
}
|
|
2499
|
-
var request4 = new XMLHttpRequest();
|
|
2500
|
-
if (config.auth) {
|
|
2501
|
-
var username = config.auth.username || "";
|
|
2502
|
-
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
2503
|
-
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
2504
|
-
}
|
|
2505
|
-
var fullPath = buildFullPath$2(config.baseURL, config.url);
|
|
2506
|
-
request4.open(config.method.toUpperCase(), buildURL$4(fullPath, config.params, config.paramsSerializer), true);
|
|
2507
|
-
request4.timeout = config.timeout;
|
|
2508
|
-
function onloadend() {
|
|
2509
|
-
if (!request4) {
|
|
2510
|
-
return;
|
|
2511
|
-
}
|
|
2512
|
-
var responseHeaders = "getAllResponseHeaders" in request4 ? parseHeaders$2(request4.getAllResponseHeaders()) : null;
|
|
2513
|
-
var responseData = !responseType || responseType === "text" || responseType === "json" ? request4.responseText : request4.response;
|
|
2514
|
-
var response = {
|
|
2515
|
-
data: responseData,
|
|
2516
|
-
status: request4.status,
|
|
2517
|
-
statusText: request4.statusText,
|
|
2518
|
-
headers: responseHeaders,
|
|
2519
|
-
config,
|
|
2520
|
-
request: request4
|
|
2521
|
-
};
|
|
2522
|
-
settle$2(resolve, reject, response);
|
|
2523
|
-
request4 = null;
|
|
2524
|
-
}
|
|
2525
|
-
if ("onloadend" in request4) {
|
|
2526
|
-
request4.onloadend = onloadend;
|
|
2527
|
-
} else {
|
|
2528
|
-
request4.onreadystatechange = function handleLoad() {
|
|
2529
|
-
if (!request4 || request4.readyState !== 4) {
|
|
2530
|
-
return;
|
|
2531
|
-
}
|
|
2532
|
-
if (request4.status === 0 && !(request4.responseURL && request4.responseURL.indexOf("file:") === 0)) {
|
|
2533
|
-
return;
|
|
2534
|
-
}
|
|
2535
|
-
setTimeout(onloadend);
|
|
2536
|
-
};
|
|
2537
|
-
}
|
|
2538
|
-
request4.onabort = function handleAbort() {
|
|
2539
|
-
if (!request4) {
|
|
2540
|
-
return;
|
|
2541
|
-
}
|
|
2542
|
-
reject(createError$3("Request aborted", config, "ECONNABORTED", request4));
|
|
2543
|
-
request4 = null;
|
|
2544
|
-
};
|
|
2545
|
-
request4.onerror = function handleError() {
|
|
2546
|
-
reject(createError$3("Network Error", config, null, request4));
|
|
2547
|
-
request4 = null;
|
|
2548
|
-
};
|
|
2549
|
-
request4.ontimeout = function handleTimeout() {
|
|
2550
|
-
var timeoutErrorMessage = "timeout of " + config.timeout + "ms exceeded";
|
|
2551
|
-
if (config.timeoutErrorMessage) {
|
|
2552
|
-
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
2553
|
-
}
|
|
2554
|
-
reject(createError$3(timeoutErrorMessage, config, config.transitional && config.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", request4));
|
|
2555
|
-
request4 = null;
|
|
2556
|
-
};
|
|
2557
|
-
if (utils$k.isStandardBrowserEnv()) {
|
|
2558
|
-
var xsrfValue = (config.withCredentials || isURLSameOrigin$2(fullPath)) && config.xsrfCookieName ? cookies$2.read(config.xsrfCookieName) : void 0;
|
|
2559
|
-
if (xsrfValue) {
|
|
2560
|
-
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
2561
|
-
}
|
|
2562
|
-
}
|
|
2563
|
-
if ("setRequestHeader" in request4) {
|
|
2564
|
-
utils$k.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
2565
|
-
if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
|
|
2566
|
-
delete requestHeaders[key];
|
|
2567
|
-
} else {
|
|
2568
|
-
request4.setRequestHeader(key, val);
|
|
2569
|
-
}
|
|
2570
|
-
});
|
|
2571
|
-
}
|
|
2572
|
-
if (!utils$k.isUndefined(config.withCredentials)) {
|
|
2573
|
-
request4.withCredentials = !!config.withCredentials;
|
|
2574
|
-
}
|
|
2575
|
-
if (responseType && responseType !== "json") {
|
|
2576
|
-
request4.responseType = config.responseType;
|
|
2577
|
-
}
|
|
2578
|
-
if (typeof config.onDownloadProgress === "function") {
|
|
2579
|
-
request4.addEventListener("progress", config.onDownloadProgress);
|
|
2580
|
-
}
|
|
2581
|
-
if (typeof config.onUploadProgress === "function" && request4.upload) {
|
|
2582
|
-
request4.upload.addEventListener("progress", config.onUploadProgress);
|
|
2583
|
-
}
|
|
2584
|
-
if (config.cancelToken) {
|
|
2585
|
-
config.cancelToken.promise.then(function onCanceled(cancel) {
|
|
2586
|
-
if (!request4) {
|
|
2587
|
-
return;
|
|
2588
|
-
}
|
|
2589
|
-
request4.abort();
|
|
2590
|
-
reject(cancel);
|
|
2591
|
-
request4 = null;
|
|
2592
|
-
});
|
|
2593
|
-
}
|
|
2594
|
-
if (!requestData) {
|
|
2595
|
-
requestData = null;
|
|
2596
|
-
}
|
|
2597
|
-
request4.send(requestData);
|
|
2598
|
-
});
|
|
2599
|
-
};
|
|
2600
|
-
var utils$j = utils$r;
|
|
2601
|
-
var normalizeHeaderName$2 = normalizeHeaderName$3;
|
|
2602
|
-
var enhanceError$3 = enhanceError$5;
|
|
2603
|
-
var DEFAULT_CONTENT_TYPE$1 = {
|
|
2604
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
2605
|
-
};
|
|
2606
|
-
function setContentTypeIfUnset$1(headers, value) {
|
|
2607
|
-
if (!utils$j.isUndefined(headers) && utils$j.isUndefined(headers["Content-Type"])) {
|
|
2608
|
-
headers["Content-Type"] = value;
|
|
2609
|
-
}
|
|
2610
|
-
}
|
|
2611
|
-
function getDefaultAdapter$1() {
|
|
2612
|
-
var adapter;
|
|
2613
|
-
if (typeof XMLHttpRequest !== "undefined") {
|
|
2614
|
-
adapter = xhr$1;
|
|
2615
|
-
} else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
|
|
2616
|
-
adapter = xhr$1;
|
|
2617
|
-
}
|
|
2618
|
-
return adapter;
|
|
2619
|
-
}
|
|
2620
|
-
function stringifySafely$1(rawValue, parser, encoder) {
|
|
2621
|
-
if (utils$j.isString(rawValue)) {
|
|
2622
|
-
try {
|
|
2623
|
-
(parser || JSON.parse)(rawValue);
|
|
2624
|
-
return utils$j.trim(rawValue);
|
|
2625
|
-
} catch (e) {
|
|
2626
|
-
if (e.name !== "SyntaxError") {
|
|
2627
|
-
throw e;
|
|
2628
|
-
}
|
|
2629
|
-
}
|
|
2630
|
-
}
|
|
2631
|
-
return (encoder || JSON.stringify)(rawValue);
|
|
2632
|
-
}
|
|
2633
|
-
var defaults$8 = {
|
|
2634
|
-
transitional: {
|
|
2635
|
-
silentJSONParsing: true,
|
|
2636
|
-
forcedJSONParsing: true,
|
|
2637
|
-
clarifyTimeoutError: false
|
|
2638
|
-
},
|
|
2639
|
-
adapter: getDefaultAdapter$1(),
|
|
2640
|
-
transformRequest: [function transformRequest2(data2, headers) {
|
|
2641
|
-
normalizeHeaderName$2(headers, "Accept");
|
|
2642
|
-
normalizeHeaderName$2(headers, "Content-Type");
|
|
2643
|
-
if (utils$j.isFormData(data2) || utils$j.isArrayBuffer(data2) || utils$j.isBuffer(data2) || utils$j.isStream(data2) || utils$j.isFile(data2) || utils$j.isBlob(data2)) {
|
|
2644
|
-
return data2;
|
|
2645
|
-
}
|
|
2646
|
-
if (utils$j.isArrayBufferView(data2)) {
|
|
2647
|
-
return data2.buffer;
|
|
2648
|
-
}
|
|
2649
|
-
if (utils$j.isURLSearchParams(data2)) {
|
|
2650
|
-
setContentTypeIfUnset$1(headers, "application/x-www-form-urlencoded;charset=utf-8");
|
|
2651
|
-
return data2.toString();
|
|
2652
|
-
}
|
|
2653
|
-
if (utils$j.isObject(data2) || headers && headers["Content-Type"] === "application/json") {
|
|
2654
|
-
setContentTypeIfUnset$1(headers, "application/json");
|
|
2655
|
-
return stringifySafely$1(data2);
|
|
2656
|
-
}
|
|
2657
|
-
return data2;
|
|
2658
|
-
}],
|
|
2659
|
-
transformResponse: [function transformResponse2(data2) {
|
|
2660
|
-
var transitional4 = this.transitional;
|
|
2661
|
-
var silentJSONParsing = transitional4 && transitional4.silentJSONParsing;
|
|
2662
|
-
var forcedJSONParsing = transitional4 && transitional4.forcedJSONParsing;
|
|
2663
|
-
var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
|
|
2664
|
-
if (strictJSONParsing || forcedJSONParsing && utils$j.isString(data2) && data2.length) {
|
|
2665
|
-
try {
|
|
2666
|
-
return JSON.parse(data2);
|
|
2667
|
-
} catch (e) {
|
|
2668
|
-
if (strictJSONParsing) {
|
|
2669
|
-
if (e.name === "SyntaxError") {
|
|
2670
|
-
throw enhanceError$3(e, this, "E_JSON_PARSE");
|
|
2671
|
-
}
|
|
2672
|
-
throw e;
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
}
|
|
2676
|
-
return data2;
|
|
2677
|
-
}],
|
|
2678
|
-
timeout: 0,
|
|
2679
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
2680
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
2681
|
-
maxContentLength: -1,
|
|
2682
|
-
maxBodyLength: -1,
|
|
2683
|
-
validateStatus: function validateStatus2(status) {
|
|
2684
|
-
return status >= 200 && status < 300;
|
|
2685
|
-
}
|
|
2686
|
-
};
|
|
2687
|
-
defaults$8.headers = {
|
|
2688
|
-
common: {
|
|
2689
|
-
"Accept": "application/json, text/plain, */*"
|
|
2690
|
-
}
|
|
2691
|
-
};
|
|
2692
|
-
utils$j.forEach(["delete", "get", "head"], function forEachMethodNoData3(method) {
|
|
2693
|
-
defaults$8.headers[method] = {};
|
|
2694
|
-
});
|
|
2695
|
-
utils$j.forEach(["post", "put", "patch"], function forEachMethodWithData3(method) {
|
|
2696
|
-
defaults$8.headers[method] = utils$j.merge(DEFAULT_CONTENT_TYPE$1);
|
|
2697
|
-
});
|
|
2698
|
-
var defaults_1$1 = defaults$8;
|
|
2699
|
-
var utils$i = utils$r;
|
|
2700
|
-
var defaults$7 = defaults_1$1;
|
|
2701
|
-
var transformData$3 = function transformData2(data2, headers, fns) {
|
|
2702
|
-
var context = this || defaults$7;
|
|
2703
|
-
utils$i.forEach(fns, function transform(fn) {
|
|
2704
|
-
data2 = fn.call(context, data2, headers);
|
|
2705
|
-
});
|
|
2706
|
-
return data2;
|
|
2707
|
-
};
|
|
2708
|
-
var isCancel$3 = function isCancel2(value) {
|
|
2709
|
-
return !!(value && value.__CANCEL__);
|
|
2710
|
-
};
|
|
2711
|
-
var utils$h = utils$r;
|
|
2712
|
-
var transformData$2 = transformData$3;
|
|
2713
|
-
var isCancel$2 = isCancel$3;
|
|
2714
|
-
var defaults$6 = defaults_1$1;
|
|
2715
|
-
function throwIfCancellationRequested$1(config) {
|
|
2716
|
-
if (config.cancelToken) {
|
|
2717
|
-
config.cancelToken.throwIfRequested();
|
|
2718
|
-
}
|
|
2719
|
-
}
|
|
2720
|
-
var dispatchRequest$3 = function dispatchRequest2(config) {
|
|
2721
|
-
throwIfCancellationRequested$1(config);
|
|
2722
|
-
config.headers = config.headers || {};
|
|
2723
|
-
config.data = transformData$2.call(config, config.data, config.headers, config.transformRequest);
|
|
2724
|
-
config.headers = utils$h.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
|
|
2725
|
-
utils$h.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) {
|
|
2726
|
-
delete config.headers[method];
|
|
2727
|
-
});
|
|
2728
|
-
var adapter = config.adapter || defaults$6.adapter;
|
|
2729
|
-
return adapter(config).then(function onAdapterResolution(response) {
|
|
2730
|
-
throwIfCancellationRequested$1(config);
|
|
2731
|
-
response.data = transformData$2.call(config, response.data, response.headers, config.transformResponse);
|
|
2732
|
-
return response;
|
|
2733
|
-
}, function onAdapterRejection(reason) {
|
|
2734
|
-
if (!isCancel$2(reason)) {
|
|
2735
|
-
throwIfCancellationRequested$1(config);
|
|
2736
|
-
if (reason && reason.response) {
|
|
2737
|
-
reason.response.data = transformData$2.call(config, reason.response.data, reason.response.headers, config.transformResponse);
|
|
2738
|
-
}
|
|
2739
|
-
}
|
|
2740
|
-
return Promise.reject(reason);
|
|
2741
|
-
});
|
|
2742
|
-
};
|
|
2743
|
-
var utils$g = utils$r;
|
|
2744
|
-
var mergeConfig$5 = function mergeConfig2(config1, config2) {
|
|
2745
|
-
config2 = config2 || {};
|
|
2746
|
-
var config = {};
|
|
2747
|
-
var valueFromConfig2Keys = ["url", "method", "data"];
|
|
2748
|
-
var mergeDeepPropertiesKeys = ["headers", "auth", "proxy", "params"];
|
|
2749
|
-
var defaultToConfig2Keys = [
|
|
2750
|
-
"baseURL",
|
|
2751
|
-
"transformRequest",
|
|
2752
|
-
"transformResponse",
|
|
2753
|
-
"paramsSerializer",
|
|
2754
|
-
"timeout",
|
|
2755
|
-
"timeoutMessage",
|
|
2756
|
-
"withCredentials",
|
|
2757
|
-
"adapter",
|
|
2758
|
-
"responseType",
|
|
2759
|
-
"xsrfCookieName",
|
|
2760
|
-
"xsrfHeaderName",
|
|
2761
|
-
"onUploadProgress",
|
|
2762
|
-
"onDownloadProgress",
|
|
2763
|
-
"decompress",
|
|
2764
|
-
"maxContentLength",
|
|
2765
|
-
"maxBodyLength",
|
|
2766
|
-
"maxRedirects",
|
|
2767
|
-
"transport",
|
|
2768
|
-
"httpAgent",
|
|
2769
|
-
"httpsAgent",
|
|
2770
|
-
"cancelToken",
|
|
2771
|
-
"socketPath",
|
|
2772
|
-
"responseEncoding"
|
|
2773
|
-
];
|
|
2774
|
-
var directMergeKeys = ["validateStatus"];
|
|
2775
|
-
function getMergedValue(target, source4) {
|
|
2776
|
-
if (utils$g.isPlainObject(target) && utils$g.isPlainObject(source4)) {
|
|
2777
|
-
return utils$g.merge(target, source4);
|
|
2778
|
-
} else if (utils$g.isPlainObject(source4)) {
|
|
2779
|
-
return utils$g.merge({}, source4);
|
|
2780
|
-
} else if (utils$g.isArray(source4)) {
|
|
2781
|
-
return source4.slice();
|
|
2782
|
-
}
|
|
2783
|
-
return source4;
|
|
2784
|
-
}
|
|
2785
|
-
function mergeDeepProperties(prop) {
|
|
2786
|
-
if (!utils$g.isUndefined(config2[prop])) {
|
|
2787
|
-
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
2788
|
-
} else if (!utils$g.isUndefined(config1[prop])) {
|
|
2789
|
-
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
2790
|
-
}
|
|
2791
|
-
}
|
|
2792
|
-
utils$g.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
|
2793
|
-
if (!utils$g.isUndefined(config2[prop])) {
|
|
2794
|
-
config[prop] = getMergedValue(void 0, config2[prop]);
|
|
2795
|
-
}
|
|
2796
|
-
});
|
|
2797
|
-
utils$g.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
|
2798
|
-
utils$g.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
|
2799
|
-
if (!utils$g.isUndefined(config2[prop])) {
|
|
2800
|
-
config[prop] = getMergedValue(void 0, config2[prop]);
|
|
2801
|
-
} else if (!utils$g.isUndefined(config1[prop])) {
|
|
2802
|
-
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
2803
|
-
}
|
|
2804
|
-
});
|
|
2805
|
-
utils$g.forEach(directMergeKeys, function merge2(prop) {
|
|
2806
|
-
if (prop in config2) {
|
|
2807
|
-
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
2808
|
-
} else if (prop in config1) {
|
|
2809
|
-
config[prop] = getMergedValue(void 0, config1[prop]);
|
|
2810
|
-
}
|
|
2811
|
-
});
|
|
2812
|
-
var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys);
|
|
2813
|
-
var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter(function filterAxiosKeys(key) {
|
|
2814
|
-
return axiosKeys.indexOf(key) === -1;
|
|
2815
|
-
});
|
|
2816
|
-
utils$g.forEach(otherKeys, mergeDeepProperties);
|
|
2817
|
-
return config;
|
|
2818
|
-
};
|
|
2819
|
-
const name = "axios";
|
|
2820
|
-
const version = "0.21.4";
|
|
2821
|
-
const description = "Promise based HTTP client for the browser and node.js";
|
|
2822
|
-
const main = "index.js";
|
|
2823
|
-
const scripts = {
|
|
2824
|
-
test: "grunt test",
|
|
2825
|
-
start: "node ./sandbox/server.js",
|
|
2826
|
-
build: "NODE_ENV=production grunt build",
|
|
2827
|
-
preversion: "npm test",
|
|
2828
|
-
version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
|
|
2829
|
-
postversion: "git push && git push --tags",
|
|
2830
|
-
examples: "node ./examples/server.js",
|
|
2831
|
-
coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
|
2832
|
-
fix: "eslint --fix lib/**/*.js"
|
|
2833
|
-
};
|
|
2834
|
-
const repository = {
|
|
2835
|
-
type: "git",
|
|
2836
|
-
url: "https://github.com/axios/axios.git"
|
|
2837
|
-
};
|
|
2838
|
-
const keywords = [
|
|
2839
|
-
"xhr",
|
|
2840
|
-
"http",
|
|
2841
|
-
"ajax",
|
|
2842
|
-
"promise",
|
|
2843
|
-
"node"
|
|
2844
|
-
];
|
|
2845
|
-
const author = "Matt Zabriskie";
|
|
2846
|
-
const license = "MIT";
|
|
2847
|
-
const bugs = {
|
|
2848
|
-
url: "https://github.com/axios/axios/issues"
|
|
2849
|
-
};
|
|
2850
|
-
const homepage = "https://axios-http.com";
|
|
2851
|
-
const devDependencies = {
|
|
2852
|
-
coveralls: "^3.0.0",
|
|
2853
|
-
"es6-promise": "^4.2.4",
|
|
2854
|
-
grunt: "^1.3.0",
|
|
2855
|
-
"grunt-banner": "^0.6.0",
|
|
2856
|
-
"grunt-cli": "^1.2.0",
|
|
2857
|
-
"grunt-contrib-clean": "^1.1.0",
|
|
2858
|
-
"grunt-contrib-watch": "^1.0.0",
|
|
2859
|
-
"grunt-eslint": "^23.0.0",
|
|
2860
|
-
"grunt-karma": "^4.0.0",
|
|
2861
|
-
"grunt-mocha-test": "^0.13.3",
|
|
2862
|
-
"grunt-ts": "^6.0.0-beta.19",
|
|
2863
|
-
"grunt-webpack": "^4.0.2",
|
|
2864
|
-
"istanbul-instrumenter-loader": "^1.0.0",
|
|
2865
|
-
"jasmine-core": "^2.4.1",
|
|
2866
|
-
karma: "^6.3.2",
|
|
2867
|
-
"karma-chrome-launcher": "^3.1.0",
|
|
2868
|
-
"karma-firefox-launcher": "^2.1.0",
|
|
2869
|
-
"karma-jasmine": "^1.1.1",
|
|
2870
|
-
"karma-jasmine-ajax": "^0.1.13",
|
|
2871
|
-
"karma-safari-launcher": "^1.0.0",
|
|
2872
|
-
"karma-sauce-launcher": "^4.3.6",
|
|
2873
|
-
"karma-sinon": "^1.0.5",
|
|
2874
|
-
"karma-sourcemap-loader": "^0.3.8",
|
|
2875
|
-
"karma-webpack": "^4.0.2",
|
|
2876
|
-
"load-grunt-tasks": "^3.5.2",
|
|
2877
|
-
minimist: "^1.2.0",
|
|
2878
|
-
mocha: "^8.2.1",
|
|
2879
|
-
sinon: "^4.5.0",
|
|
2880
|
-
"terser-webpack-plugin": "^4.2.3",
|
|
2881
|
-
typescript: "^4.0.5",
|
|
2882
|
-
"url-search-params": "^0.10.0",
|
|
2883
|
-
webpack: "^4.44.2",
|
|
2884
|
-
"webpack-dev-server": "^3.11.0"
|
|
2885
|
-
};
|
|
2886
|
-
const browser = {
|
|
2887
|
-
"./lib/adapters/http.js": "./lib/adapters/xhr.js"
|
|
2888
|
-
};
|
|
2889
|
-
const jsdelivr = "dist/axios.min.js";
|
|
2890
|
-
const unpkg = "dist/axios.min.js";
|
|
2891
|
-
const typings = "./index.d.ts";
|
|
2892
|
-
const dependencies = {
|
|
2893
|
-
"follow-redirects": "^1.14.0"
|
|
2894
|
-
};
|
|
2895
|
-
const bundlesize = [
|
|
2896
|
-
{
|
|
2897
|
-
path: "./dist/axios.min.js",
|
|
2898
|
-
threshold: "5kB"
|
|
2899
|
-
}
|
|
2900
|
-
];
|
|
2901
|
-
var require$$0 = {
|
|
2902
|
-
name,
|
|
2903
|
-
version,
|
|
2904
|
-
description,
|
|
2905
|
-
main,
|
|
2906
|
-
scripts,
|
|
2907
|
-
repository,
|
|
2908
|
-
keywords,
|
|
2909
|
-
author,
|
|
2910
|
-
license,
|
|
2911
|
-
bugs,
|
|
2912
|
-
homepage,
|
|
2913
|
-
devDependencies,
|
|
2914
|
-
browser,
|
|
2915
|
-
jsdelivr,
|
|
2916
|
-
unpkg,
|
|
2917
|
-
typings,
|
|
2918
|
-
dependencies,
|
|
2919
|
-
bundlesize
|
|
2920
|
-
};
|
|
2921
|
-
var pkg = require$$0;
|
|
2922
|
-
var validators$3 = {};
|
|
2923
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
|
|
2924
|
-
validators$3[type] = function validator2(thing) {
|
|
2925
|
-
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
2926
|
-
};
|
|
2927
|
-
});
|
|
2928
|
-
var deprecatedWarnings$1 = {};
|
|
2929
|
-
var currentVerArr = pkg.version.split(".");
|
|
2930
|
-
function isOlderVersion(version2, thanVersion) {
|
|
2931
|
-
var pkgVersionArr = thanVersion ? thanVersion.split(".") : currentVerArr;
|
|
2932
|
-
var destVer = version2.split(".");
|
|
2933
|
-
for (var i = 0; i < 3; i++) {
|
|
2934
|
-
if (pkgVersionArr[i] > destVer[i]) {
|
|
2935
|
-
return true;
|
|
2936
|
-
} else if (pkgVersionArr[i] < destVer[i]) {
|
|
2937
|
-
return false;
|
|
2938
|
-
}
|
|
2939
|
-
}
|
|
2940
|
-
return false;
|
|
2941
|
-
}
|
|
2942
|
-
validators$3.transitional = function transitional2(validator2, version2, message) {
|
|
2943
|
-
var isDeprecated = version2 && isOlderVersion(version2);
|
|
2944
|
-
function formatMessage(opt, desc) {
|
|
2945
|
-
return "[Axios v" + pkg.version + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
2946
|
-
}
|
|
2947
|
-
return function(value, opt, opts) {
|
|
2948
|
-
if (validator2 === false) {
|
|
2949
|
-
throw new Error(formatMessage(opt, " has been removed in " + version2));
|
|
2950
|
-
}
|
|
2951
|
-
if (isDeprecated && !deprecatedWarnings$1[opt]) {
|
|
2952
|
-
deprecatedWarnings$1[opt] = true;
|
|
2953
|
-
console.warn(formatMessage(opt, " has been deprecated since v" + version2 + " and will be removed in the near future"));
|
|
2954
|
-
}
|
|
2955
|
-
return validator2 ? validator2(value, opt, opts) : true;
|
|
2956
|
-
};
|
|
2957
|
-
};
|
|
2958
|
-
function assertOptions$1(options, schema, allowUnknown) {
|
|
2959
|
-
if (typeof options !== "object") {
|
|
2960
|
-
throw new TypeError("options must be an object");
|
|
2961
|
-
}
|
|
2962
|
-
var keys = Object.keys(options);
|
|
2963
|
-
var i = keys.length;
|
|
2964
|
-
while (i-- > 0) {
|
|
2965
|
-
var opt = keys[i];
|
|
2966
|
-
var validator2 = schema[opt];
|
|
2967
|
-
if (validator2) {
|
|
2968
|
-
var value = options[opt];
|
|
2969
|
-
var result = value === void 0 || validator2(value, opt, options);
|
|
2970
|
-
if (result !== true) {
|
|
2971
|
-
throw new TypeError("option " + opt + " must be " + result);
|
|
2972
|
-
}
|
|
2973
|
-
continue;
|
|
2974
|
-
}
|
|
2975
|
-
if (allowUnknown !== true) {
|
|
2976
|
-
throw Error("Unknown option " + opt);
|
|
2977
|
-
}
|
|
2978
|
-
}
|
|
2979
|
-
}
|
|
2980
|
-
var validator$3 = {
|
|
2981
|
-
isOlderVersion,
|
|
2982
|
-
assertOptions: assertOptions$1,
|
|
2983
|
-
validators: validators$3
|
|
2984
|
-
};
|
|
2985
|
-
var utils$f = utils$r;
|
|
2986
|
-
var buildURL$3 = buildURL$5;
|
|
2987
|
-
var InterceptorManager$2 = InterceptorManager_1$1;
|
|
2988
|
-
var dispatchRequest$2 = dispatchRequest$3;
|
|
2989
|
-
var mergeConfig$4 = mergeConfig$5;
|
|
2990
|
-
var validator$2 = validator$3;
|
|
2991
|
-
var validators$2 = validator$2.validators;
|
|
2992
|
-
function Axios$3(instanceConfig) {
|
|
2993
|
-
this.defaults = instanceConfig;
|
|
2994
|
-
this.interceptors = {
|
|
2995
|
-
request: new InterceptorManager$2(),
|
|
2996
|
-
response: new InterceptorManager$2()
|
|
2997
|
-
};
|
|
2998
|
-
}
|
|
2999
|
-
Axios$3.prototype.request = function request2(config) {
|
|
3000
|
-
if (typeof config === "string") {
|
|
3001
|
-
config = arguments[1] || {};
|
|
3002
|
-
config.url = arguments[0];
|
|
3003
|
-
} else {
|
|
3004
|
-
config = config || {};
|
|
3005
|
-
}
|
|
3006
|
-
config = mergeConfig$4(this.defaults, config);
|
|
3007
|
-
if (config.method) {
|
|
3008
|
-
config.method = config.method.toLowerCase();
|
|
3009
|
-
} else if (this.defaults.method) {
|
|
3010
|
-
config.method = this.defaults.method.toLowerCase();
|
|
3011
|
-
} else {
|
|
3012
|
-
config.method = "get";
|
|
3013
|
-
}
|
|
3014
|
-
var transitional4 = config.transitional;
|
|
3015
|
-
if (transitional4 !== void 0) {
|
|
3016
|
-
validator$2.assertOptions(transitional4, {
|
|
3017
|
-
silentJSONParsing: validators$2.transitional(validators$2.boolean, "1.0.0"),
|
|
3018
|
-
forcedJSONParsing: validators$2.transitional(validators$2.boolean, "1.0.0"),
|
|
3019
|
-
clarifyTimeoutError: validators$2.transitional(validators$2.boolean, "1.0.0")
|
|
3020
|
-
}, false);
|
|
3021
|
-
}
|
|
3022
|
-
var requestInterceptorChain = [];
|
|
3023
|
-
var synchronousRequestInterceptors = true;
|
|
3024
|
-
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
3025
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
3026
|
-
return;
|
|
3027
|
-
}
|
|
3028
|
-
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
3029
|
-
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
3030
|
-
});
|
|
3031
|
-
var responseInterceptorChain = [];
|
|
3032
|
-
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
3033
|
-
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
3034
|
-
});
|
|
3035
|
-
var promise;
|
|
3036
|
-
if (!synchronousRequestInterceptors) {
|
|
3037
|
-
var chain = [dispatchRequest$2, void 0];
|
|
3038
|
-
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
3039
|
-
chain = chain.concat(responseInterceptorChain);
|
|
3040
|
-
promise = Promise.resolve(config);
|
|
3041
|
-
while (chain.length) {
|
|
3042
|
-
promise = promise.then(chain.shift(), chain.shift());
|
|
3043
|
-
}
|
|
3044
|
-
return promise;
|
|
3045
|
-
}
|
|
3046
|
-
var newConfig = config;
|
|
3047
|
-
while (requestInterceptorChain.length) {
|
|
3048
|
-
var onFulfilled = requestInterceptorChain.shift();
|
|
3049
|
-
var onRejected = requestInterceptorChain.shift();
|
|
3050
|
-
try {
|
|
3051
|
-
newConfig = onFulfilled(newConfig);
|
|
3052
|
-
} catch (error) {
|
|
3053
|
-
onRejected(error);
|
|
3054
|
-
break;
|
|
3055
|
-
}
|
|
3056
|
-
}
|
|
3057
|
-
try {
|
|
3058
|
-
promise = dispatchRequest$2(newConfig);
|
|
3059
|
-
} catch (error) {
|
|
3060
|
-
return Promise.reject(error);
|
|
3061
|
-
}
|
|
3062
|
-
while (responseInterceptorChain.length) {
|
|
3063
|
-
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
3064
|
-
}
|
|
3065
|
-
return promise;
|
|
3066
|
-
};
|
|
3067
|
-
Axios$3.prototype.getUri = function getUri2(config) {
|
|
3068
|
-
config = mergeConfig$4(this.defaults, config);
|
|
3069
|
-
return buildURL$3(config.url, config.params, config.paramsSerializer).replace(/^\?/, "");
|
|
3070
|
-
};
|
|
3071
|
-
utils$f.forEach(["delete", "get", "head", "options"], function forEachMethodNoData4(method) {
|
|
3072
|
-
Axios$3.prototype[method] = function(url, config) {
|
|
3073
|
-
return this.request(mergeConfig$4(config || {}, {
|
|
3074
|
-
method,
|
|
3075
|
-
url,
|
|
3076
|
-
data: (config || {}).data
|
|
3077
|
-
}));
|
|
3078
|
-
};
|
|
3079
|
-
});
|
|
3080
|
-
utils$f.forEach(["post", "put", "patch"], function forEachMethodWithData4(method) {
|
|
3081
|
-
Axios$3.prototype[method] = function(url, data2, config) {
|
|
3082
|
-
return this.request(mergeConfig$4(config || {}, {
|
|
3083
|
-
method,
|
|
3084
|
-
url,
|
|
3085
|
-
data: data2
|
|
3086
|
-
}));
|
|
3087
|
-
};
|
|
3088
|
-
});
|
|
3089
|
-
var Axios_1$1 = Axios$3;
|
|
3090
|
-
function Cancel$5(message) {
|
|
3091
|
-
this.message = message;
|
|
3092
|
-
}
|
|
3093
|
-
Cancel$5.prototype.toString = function toString2() {
|
|
3094
|
-
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
3095
|
-
};
|
|
3096
|
-
Cancel$5.prototype.__CANCEL__ = true;
|
|
3097
|
-
var Cancel_1$1 = Cancel$5;
|
|
3098
|
-
var Cancel$4 = Cancel_1$1;
|
|
3099
|
-
function CancelToken$1(executor) {
|
|
3100
|
-
if (typeof executor !== "function") {
|
|
3101
|
-
throw new TypeError("executor must be a function.");
|
|
3102
|
-
}
|
|
3103
|
-
var resolvePromise;
|
|
3104
|
-
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
3105
|
-
resolvePromise = resolve;
|
|
3106
|
-
});
|
|
3107
|
-
var token2 = this;
|
|
3108
|
-
executor(function cancel(message) {
|
|
3109
|
-
if (token2.reason) {
|
|
3110
|
-
return;
|
|
3111
|
-
}
|
|
3112
|
-
token2.reason = new Cancel$4(message);
|
|
3113
|
-
resolvePromise(token2.reason);
|
|
3114
|
-
});
|
|
3115
|
-
}
|
|
3116
|
-
CancelToken$1.prototype.throwIfRequested = function throwIfRequested2() {
|
|
3117
|
-
if (this.reason) {
|
|
3118
|
-
throw this.reason;
|
|
3119
|
-
}
|
|
3120
|
-
};
|
|
3121
|
-
CancelToken$1.source = function source2() {
|
|
3122
|
-
var cancel;
|
|
3123
|
-
var token2 = new CancelToken$1(function executor(c) {
|
|
3124
|
-
cancel = c;
|
|
3125
|
-
});
|
|
3126
|
-
return {
|
|
3127
|
-
token: token2,
|
|
3128
|
-
cancel
|
|
3129
|
-
};
|
|
3130
|
-
};
|
|
3131
|
-
var CancelToken_1$1 = CancelToken$1;
|
|
3132
|
-
var spread$1 = function spread2(callback) {
|
|
3133
|
-
return function wrap(arr) {
|
|
3134
|
-
return callback.apply(null, arr);
|
|
3135
|
-
};
|
|
3136
|
-
};
|
|
3137
|
-
var isAxiosError$1 = function isAxiosError2(payload) {
|
|
3138
|
-
return typeof payload === "object" && payload.isAxiosError === true;
|
|
3139
|
-
};
|
|
3140
|
-
var utils$e = utils$r;
|
|
3141
|
-
var bind$3 = bind$5;
|
|
3142
|
-
var Axios$2 = Axios_1$1;
|
|
3143
|
-
var mergeConfig$3 = mergeConfig$5;
|
|
3144
|
-
var defaults$5 = defaults_1$1;
|
|
3145
|
-
function createInstance$1(defaultConfig) {
|
|
3146
|
-
var context = new Axios$2(defaultConfig);
|
|
3147
|
-
var instance = bind$3(Axios$2.prototype.request, context);
|
|
3148
|
-
utils$e.extend(instance, Axios$2.prototype, context);
|
|
3149
|
-
utils$e.extend(instance, context);
|
|
3150
|
-
return instance;
|
|
3151
|
-
}
|
|
3152
|
-
var axios$4 = createInstance$1(defaults$5);
|
|
3153
|
-
axios$4.Axios = Axios$2;
|
|
3154
|
-
axios$4.create = function create(instanceConfig) {
|
|
3155
|
-
return createInstance$1(mergeConfig$3(axios$4.defaults, instanceConfig));
|
|
3156
|
-
};
|
|
3157
|
-
axios$4.Cancel = Cancel_1$1;
|
|
3158
|
-
axios$4.CancelToken = CancelToken_1$1;
|
|
3159
|
-
axios$4.isCancel = isCancel$3;
|
|
3160
|
-
axios$4.all = function all2(promises) {
|
|
3161
|
-
return Promise.all(promises);
|
|
3162
|
-
};
|
|
3163
|
-
axios$4.spread = spread$1;
|
|
3164
|
-
axios$4.isAxiosError = isAxiosError$1;
|
|
3165
|
-
axios$5.exports = axios$4;
|
|
3166
|
-
axios$5.exports.default = axios$4;
|
|
3167
|
-
var axios$3 = axios$5.exports;
|
|
3168
|
-
class HasuraStorageApi {
|
|
3169
|
-
constructor({ url }) {
|
|
3170
|
-
this.url = url;
|
|
3171
|
-
this.httpClient = axios$3.create({
|
|
3172
|
-
baseURL: this.url
|
|
3173
|
-
});
|
|
1030
|
+
const axios$2 = require("axios");
|
|
1031
|
+
class HasuraStorageApi {
|
|
1032
|
+
constructor({ url }) {
|
|
1033
|
+
this.url = url;
|
|
1034
|
+
this.httpClient = axios$2.create({
|
|
1035
|
+
baseURL: this.url
|
|
1036
|
+
});
|
|
3174
1037
|
}
|
|
3175
1038
|
async upload(params) {
|
|
3176
1039
|
try {
|
|
@@ -3208,7 +1071,7 @@ class HasuraStorageApi {
|
|
|
3208
1071
|
this.accessToken = accessToken;
|
|
3209
1072
|
}
|
|
3210
1073
|
generateUploadHeaders(params) {
|
|
3211
|
-
const { bucketId, name
|
|
1074
|
+
const { bucketId, name, id } = params;
|
|
3212
1075
|
const uploadheaders = {};
|
|
3213
1076
|
if (bucketId) {
|
|
3214
1077
|
uploadheaders["x-nhost-bucket-id"] = bucketId;
|
|
@@ -3216,8 +1079,8 @@ class HasuraStorageApi {
|
|
|
3216
1079
|
if (id) {
|
|
3217
1080
|
uploadheaders["x-nhost-file-id"] = id;
|
|
3218
1081
|
}
|
|
3219
|
-
if (
|
|
3220
|
-
uploadheaders["x-nhost-file-name"] =
|
|
1082
|
+
if (name) {
|
|
1083
|
+
uploadheaders["x-nhost-file-name"] = name;
|
|
3221
1084
|
}
|
|
3222
1085
|
return uploadheaders;
|
|
3223
1086
|
}
|
|
@@ -3274,1062 +1137,20 @@ class HasuraStorageClient {
|
|
|
3274
1137
|
this.api.setAccessToken(accessToken);
|
|
3275
1138
|
}
|
|
3276
1139
|
}
|
|
3277
|
-
|
|
3278
|
-
var bind$2 = function bind3(fn, thisArg) {
|
|
3279
|
-
return function wrap() {
|
|
3280
|
-
var args = new Array(arguments.length);
|
|
3281
|
-
for (var i = 0; i < args.length; i++) {
|
|
3282
|
-
args[i] = arguments[i];
|
|
3283
|
-
}
|
|
3284
|
-
return fn.apply(thisArg, args);
|
|
3285
|
-
};
|
|
3286
|
-
};
|
|
3287
|
-
var bind$1 = bind$2;
|
|
3288
|
-
var toString3 = Object.prototype.toString;
|
|
3289
|
-
function isArray(val) {
|
|
3290
|
-
return toString3.call(val) === "[object Array]";
|
|
3291
|
-
}
|
|
3292
|
-
function isUndefined(val) {
|
|
3293
|
-
return typeof val === "undefined";
|
|
3294
|
-
}
|
|
3295
|
-
function isBuffer(val) {
|
|
3296
|
-
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
|
|
3297
|
-
}
|
|
3298
|
-
function isArrayBuffer(val) {
|
|
3299
|
-
return toString3.call(val) === "[object ArrayBuffer]";
|
|
3300
|
-
}
|
|
3301
|
-
function isFormData(val) {
|
|
3302
|
-
return typeof FormData !== "undefined" && val instanceof FormData;
|
|
3303
|
-
}
|
|
3304
|
-
function isArrayBufferView(val) {
|
|
3305
|
-
var result;
|
|
3306
|
-
if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
|
|
3307
|
-
result = ArrayBuffer.isView(val);
|
|
3308
|
-
} else {
|
|
3309
|
-
result = val && val.buffer && val.buffer instanceof ArrayBuffer;
|
|
3310
|
-
}
|
|
3311
|
-
return result;
|
|
3312
|
-
}
|
|
3313
|
-
function isString(val) {
|
|
3314
|
-
return typeof val === "string";
|
|
3315
|
-
}
|
|
3316
|
-
function isNumber(val) {
|
|
3317
|
-
return typeof val === "number";
|
|
3318
|
-
}
|
|
3319
|
-
function isObject(val) {
|
|
3320
|
-
return val !== null && typeof val === "object";
|
|
3321
|
-
}
|
|
3322
|
-
function isPlainObject(val) {
|
|
3323
|
-
if (toString3.call(val) !== "[object Object]") {
|
|
3324
|
-
return false;
|
|
3325
|
-
}
|
|
3326
|
-
var prototype = Object.getPrototypeOf(val);
|
|
3327
|
-
return prototype === null || prototype === Object.prototype;
|
|
3328
|
-
}
|
|
3329
|
-
function isDate(val) {
|
|
3330
|
-
return toString3.call(val) === "[object Date]";
|
|
3331
|
-
}
|
|
3332
|
-
function isFile(val) {
|
|
3333
|
-
return toString3.call(val) === "[object File]";
|
|
3334
|
-
}
|
|
3335
|
-
function isBlob(val) {
|
|
3336
|
-
return toString3.call(val) === "[object Blob]";
|
|
3337
|
-
}
|
|
3338
|
-
function isFunction(val) {
|
|
3339
|
-
return toString3.call(val) === "[object Function]";
|
|
3340
|
-
}
|
|
3341
|
-
function isStream(val) {
|
|
3342
|
-
return isObject(val) && isFunction(val.pipe);
|
|
3343
|
-
}
|
|
3344
|
-
function isURLSearchParams(val) {
|
|
3345
|
-
return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
|
|
3346
|
-
}
|
|
3347
|
-
function trim(str) {
|
|
3348
|
-
return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
|
|
3349
|
-
}
|
|
3350
|
-
function isStandardBrowserEnv() {
|
|
3351
|
-
if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
|
|
3352
|
-
return false;
|
|
3353
|
-
}
|
|
3354
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
3355
|
-
}
|
|
3356
|
-
function forEach3(obj, fn) {
|
|
3357
|
-
if (obj === null || typeof obj === "undefined") {
|
|
3358
|
-
return;
|
|
3359
|
-
}
|
|
3360
|
-
if (typeof obj !== "object") {
|
|
3361
|
-
obj = [obj];
|
|
3362
|
-
}
|
|
3363
|
-
if (isArray(obj)) {
|
|
3364
|
-
for (var i = 0, l = obj.length; i < l; i++) {
|
|
3365
|
-
fn.call(null, obj[i], i, obj);
|
|
3366
|
-
}
|
|
3367
|
-
} else {
|
|
3368
|
-
for (var key in obj) {
|
|
3369
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
3370
|
-
fn.call(null, obj[key], key, obj);
|
|
3371
|
-
}
|
|
3372
|
-
}
|
|
3373
|
-
}
|
|
3374
|
-
}
|
|
3375
|
-
function merge() {
|
|
3376
|
-
var result = {};
|
|
3377
|
-
function assignValue(val, key) {
|
|
3378
|
-
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
|
3379
|
-
result[key] = merge(result[key], val);
|
|
3380
|
-
} else if (isPlainObject(val)) {
|
|
3381
|
-
result[key] = merge({}, val);
|
|
3382
|
-
} else if (isArray(val)) {
|
|
3383
|
-
result[key] = val.slice();
|
|
3384
|
-
} else {
|
|
3385
|
-
result[key] = val;
|
|
3386
|
-
}
|
|
3387
|
-
}
|
|
3388
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
3389
|
-
forEach3(arguments[i], assignValue);
|
|
3390
|
-
}
|
|
3391
|
-
return result;
|
|
3392
|
-
}
|
|
3393
|
-
function extend(a, b, thisArg) {
|
|
3394
|
-
forEach3(b, function assignValue(val, key) {
|
|
3395
|
-
if (thisArg && typeof val === "function") {
|
|
3396
|
-
a[key] = bind$1(val, thisArg);
|
|
3397
|
-
} else {
|
|
3398
|
-
a[key] = val;
|
|
3399
|
-
}
|
|
3400
|
-
});
|
|
3401
|
-
return a;
|
|
3402
|
-
}
|
|
3403
|
-
function stripBOM(content) {
|
|
3404
|
-
if (content.charCodeAt(0) === 65279) {
|
|
3405
|
-
content = content.slice(1);
|
|
3406
|
-
}
|
|
3407
|
-
return content;
|
|
3408
|
-
}
|
|
3409
|
-
var utils$d = {
|
|
3410
|
-
isArray,
|
|
3411
|
-
isArrayBuffer,
|
|
3412
|
-
isBuffer,
|
|
3413
|
-
isFormData,
|
|
3414
|
-
isArrayBufferView,
|
|
3415
|
-
isString,
|
|
3416
|
-
isNumber,
|
|
3417
|
-
isObject,
|
|
3418
|
-
isPlainObject,
|
|
3419
|
-
isUndefined,
|
|
3420
|
-
isDate,
|
|
3421
|
-
isFile,
|
|
3422
|
-
isBlob,
|
|
3423
|
-
isFunction,
|
|
3424
|
-
isStream,
|
|
3425
|
-
isURLSearchParams,
|
|
3426
|
-
isStandardBrowserEnv,
|
|
3427
|
-
forEach: forEach3,
|
|
3428
|
-
merge,
|
|
3429
|
-
extend,
|
|
3430
|
-
trim,
|
|
3431
|
-
stripBOM
|
|
3432
|
-
};
|
|
3433
|
-
var utils$c = utils$d;
|
|
3434
|
-
function encode(val) {
|
|
3435
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
3436
|
-
}
|
|
3437
|
-
var buildURL$2 = function buildURL3(url, params, paramsSerializer) {
|
|
3438
|
-
if (!params) {
|
|
3439
|
-
return url;
|
|
3440
|
-
}
|
|
3441
|
-
var serializedParams;
|
|
3442
|
-
if (paramsSerializer) {
|
|
3443
|
-
serializedParams = paramsSerializer(params);
|
|
3444
|
-
} else if (utils$c.isURLSearchParams(params)) {
|
|
3445
|
-
serializedParams = params.toString();
|
|
3446
|
-
} else {
|
|
3447
|
-
var parts = [];
|
|
3448
|
-
utils$c.forEach(params, function serialize(val, key) {
|
|
3449
|
-
if (val === null || typeof val === "undefined") {
|
|
3450
|
-
return;
|
|
3451
|
-
}
|
|
3452
|
-
if (utils$c.isArray(val)) {
|
|
3453
|
-
key = key + "[]";
|
|
3454
|
-
} else {
|
|
3455
|
-
val = [val];
|
|
3456
|
-
}
|
|
3457
|
-
utils$c.forEach(val, function parseValue(v) {
|
|
3458
|
-
if (utils$c.isDate(v)) {
|
|
3459
|
-
v = v.toISOString();
|
|
3460
|
-
} else if (utils$c.isObject(v)) {
|
|
3461
|
-
v = JSON.stringify(v);
|
|
3462
|
-
}
|
|
3463
|
-
parts.push(encode(key) + "=" + encode(v));
|
|
3464
|
-
});
|
|
3465
|
-
});
|
|
3466
|
-
serializedParams = parts.join("&");
|
|
3467
|
-
}
|
|
3468
|
-
if (serializedParams) {
|
|
3469
|
-
var hashmarkIndex = url.indexOf("#");
|
|
3470
|
-
if (hashmarkIndex !== -1) {
|
|
3471
|
-
url = url.slice(0, hashmarkIndex);
|
|
3472
|
-
}
|
|
3473
|
-
url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
|
|
3474
|
-
}
|
|
3475
|
-
return url;
|
|
3476
|
-
};
|
|
3477
|
-
var utils$b = utils$d;
|
|
3478
|
-
function InterceptorManager$1() {
|
|
3479
|
-
this.handlers = [];
|
|
3480
|
-
}
|
|
3481
|
-
InterceptorManager$1.prototype.use = function use3(fulfilled, rejected, options) {
|
|
3482
|
-
this.handlers.push({
|
|
3483
|
-
fulfilled,
|
|
3484
|
-
rejected,
|
|
3485
|
-
synchronous: options ? options.synchronous : false,
|
|
3486
|
-
runWhen: options ? options.runWhen : null
|
|
3487
|
-
});
|
|
3488
|
-
return this.handlers.length - 1;
|
|
3489
|
-
};
|
|
3490
|
-
InterceptorManager$1.prototype.eject = function eject3(id) {
|
|
3491
|
-
if (this.handlers[id]) {
|
|
3492
|
-
this.handlers[id] = null;
|
|
3493
|
-
}
|
|
3494
|
-
};
|
|
3495
|
-
InterceptorManager$1.prototype.forEach = function forEach4(fn) {
|
|
3496
|
-
utils$b.forEach(this.handlers, function forEachHandler(h) {
|
|
3497
|
-
if (h !== null) {
|
|
3498
|
-
fn(h);
|
|
3499
|
-
}
|
|
3500
|
-
});
|
|
3501
|
-
};
|
|
3502
|
-
var InterceptorManager_1 = InterceptorManager$1;
|
|
3503
|
-
var utils$a = utils$d;
|
|
3504
|
-
var normalizeHeaderName$1 = function normalizeHeaderName3(headers, normalizedName) {
|
|
3505
|
-
utils$a.forEach(headers, function processHeader(value, name2) {
|
|
3506
|
-
if (name2 !== normalizedName && name2.toUpperCase() === normalizedName.toUpperCase()) {
|
|
3507
|
-
headers[normalizedName] = value;
|
|
3508
|
-
delete headers[name2];
|
|
3509
|
-
}
|
|
3510
|
-
});
|
|
3511
|
-
};
|
|
3512
|
-
var enhanceError$2 = function enhanceError3(error, config, code, request4, response) {
|
|
3513
|
-
error.config = config;
|
|
3514
|
-
if (code) {
|
|
3515
|
-
error.code = code;
|
|
3516
|
-
}
|
|
3517
|
-
error.request = request4;
|
|
3518
|
-
error.response = response;
|
|
3519
|
-
error.isAxiosError = true;
|
|
3520
|
-
error.toJSON = function toJSON() {
|
|
3521
|
-
return {
|
|
3522
|
-
message: this.message,
|
|
3523
|
-
name: this.name,
|
|
3524
|
-
description: this.description,
|
|
3525
|
-
number: this.number,
|
|
3526
|
-
fileName: this.fileName,
|
|
3527
|
-
lineNumber: this.lineNumber,
|
|
3528
|
-
columnNumber: this.columnNumber,
|
|
3529
|
-
stack: this.stack,
|
|
3530
|
-
config: this.config,
|
|
3531
|
-
code: this.code,
|
|
3532
|
-
status: this.response && this.response.status ? this.response.status : null
|
|
3533
|
-
};
|
|
3534
|
-
};
|
|
3535
|
-
return error;
|
|
3536
|
-
};
|
|
3537
|
-
var enhanceError$1 = enhanceError$2;
|
|
3538
|
-
var createError$2 = function createError3(message, config, code, request4, response) {
|
|
3539
|
-
var error = new Error(message);
|
|
3540
|
-
return enhanceError$1(error, config, code, request4, response);
|
|
3541
|
-
};
|
|
3542
|
-
var createError$1 = createError$2;
|
|
3543
|
-
var settle$1 = function settle3(resolve, reject, response) {
|
|
3544
|
-
var validateStatus4 = response.config.validateStatus;
|
|
3545
|
-
if (!response.status || !validateStatus4 || validateStatus4(response.status)) {
|
|
3546
|
-
resolve(response);
|
|
3547
|
-
} else {
|
|
3548
|
-
reject(createError$1("Request failed with status code " + response.status, response.config, null, response.request, response));
|
|
3549
|
-
}
|
|
3550
|
-
};
|
|
3551
|
-
var utils$9 = utils$d;
|
|
3552
|
-
var cookies$1 = utils$9.isStandardBrowserEnv() ? function standardBrowserEnv5() {
|
|
3553
|
-
return {
|
|
3554
|
-
write: function write(name2, value, expires, path, domain, secure) {
|
|
3555
|
-
var cookie = [];
|
|
3556
|
-
cookie.push(name2 + "=" + encodeURIComponent(value));
|
|
3557
|
-
if (utils$9.isNumber(expires)) {
|
|
3558
|
-
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
3559
|
-
}
|
|
3560
|
-
if (utils$9.isString(path)) {
|
|
3561
|
-
cookie.push("path=" + path);
|
|
3562
|
-
}
|
|
3563
|
-
if (utils$9.isString(domain)) {
|
|
3564
|
-
cookie.push("domain=" + domain);
|
|
3565
|
-
}
|
|
3566
|
-
if (secure === true) {
|
|
3567
|
-
cookie.push("secure");
|
|
3568
|
-
}
|
|
3569
|
-
document.cookie = cookie.join("; ");
|
|
3570
|
-
},
|
|
3571
|
-
read: function read(name2) {
|
|
3572
|
-
var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)"));
|
|
3573
|
-
return match ? decodeURIComponent(match[3]) : null;
|
|
3574
|
-
},
|
|
3575
|
-
remove: function remove(name2) {
|
|
3576
|
-
this.write(name2, "", Date.now() - 864e5);
|
|
3577
|
-
}
|
|
3578
|
-
};
|
|
3579
|
-
}() : function nonStandardBrowserEnv5() {
|
|
3580
|
-
return {
|
|
3581
|
-
write: function write() {
|
|
3582
|
-
},
|
|
3583
|
-
read: function read() {
|
|
3584
|
-
return null;
|
|
3585
|
-
},
|
|
3586
|
-
remove: function remove() {
|
|
3587
|
-
}
|
|
3588
|
-
};
|
|
3589
|
-
}();
|
|
3590
|
-
var isAbsoluteURL$1 = function isAbsoluteURL3(url) {
|
|
3591
|
-
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
|
|
3592
|
-
};
|
|
3593
|
-
var combineURLs$1 = function combineURLs3(baseURL, relativeURL) {
|
|
3594
|
-
return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
3595
|
-
};
|
|
3596
|
-
var isAbsoluteURL4 = isAbsoluteURL$1;
|
|
3597
|
-
var combineURLs4 = combineURLs$1;
|
|
3598
|
-
var buildFullPath$1 = function buildFullPath3(baseURL, requestedURL) {
|
|
3599
|
-
if (baseURL && !isAbsoluteURL4(requestedURL)) {
|
|
3600
|
-
return combineURLs4(baseURL, requestedURL);
|
|
3601
|
-
}
|
|
3602
|
-
return requestedURL;
|
|
3603
|
-
};
|
|
3604
|
-
var utils$8 = utils$d;
|
|
3605
|
-
var ignoreDuplicateOf = [
|
|
3606
|
-
"age",
|
|
3607
|
-
"authorization",
|
|
3608
|
-
"content-length",
|
|
3609
|
-
"content-type",
|
|
3610
|
-
"etag",
|
|
3611
|
-
"expires",
|
|
3612
|
-
"from",
|
|
3613
|
-
"host",
|
|
3614
|
-
"if-modified-since",
|
|
3615
|
-
"if-unmodified-since",
|
|
3616
|
-
"last-modified",
|
|
3617
|
-
"location",
|
|
3618
|
-
"max-forwards",
|
|
3619
|
-
"proxy-authorization",
|
|
3620
|
-
"referer",
|
|
3621
|
-
"retry-after",
|
|
3622
|
-
"user-agent"
|
|
3623
|
-
];
|
|
3624
|
-
var parseHeaders$1 = function parseHeaders3(headers) {
|
|
3625
|
-
var parsed = {};
|
|
3626
|
-
var key;
|
|
3627
|
-
var val;
|
|
3628
|
-
var i;
|
|
3629
|
-
if (!headers) {
|
|
3630
|
-
return parsed;
|
|
3631
|
-
}
|
|
3632
|
-
utils$8.forEach(headers.split("\n"), function parser(line) {
|
|
3633
|
-
i = line.indexOf(":");
|
|
3634
|
-
key = utils$8.trim(line.substr(0, i)).toLowerCase();
|
|
3635
|
-
val = utils$8.trim(line.substr(i + 1));
|
|
3636
|
-
if (key) {
|
|
3637
|
-
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
|
|
3638
|
-
return;
|
|
3639
|
-
}
|
|
3640
|
-
if (key === "set-cookie") {
|
|
3641
|
-
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
|
|
3642
|
-
} else {
|
|
3643
|
-
parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
|
|
3644
|
-
}
|
|
3645
|
-
}
|
|
3646
|
-
});
|
|
3647
|
-
return parsed;
|
|
3648
|
-
};
|
|
3649
|
-
var utils$7 = utils$d;
|
|
3650
|
-
var isURLSameOrigin$1 = utils$7.isStandardBrowserEnv() ? function standardBrowserEnv6() {
|
|
3651
|
-
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
3652
|
-
var urlParsingNode = document.createElement("a");
|
|
3653
|
-
var originURL;
|
|
3654
|
-
function resolveURL(url) {
|
|
3655
|
-
var href = url;
|
|
3656
|
-
if (msie) {
|
|
3657
|
-
urlParsingNode.setAttribute("href", href);
|
|
3658
|
-
href = urlParsingNode.href;
|
|
3659
|
-
}
|
|
3660
|
-
urlParsingNode.setAttribute("href", href);
|
|
3661
|
-
return {
|
|
3662
|
-
href: urlParsingNode.href,
|
|
3663
|
-
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
|
|
3664
|
-
host: urlParsingNode.host,
|
|
3665
|
-
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
|
|
3666
|
-
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
|
|
3667
|
-
hostname: urlParsingNode.hostname,
|
|
3668
|
-
port: urlParsingNode.port,
|
|
3669
|
-
pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
|
|
3670
|
-
};
|
|
3671
|
-
}
|
|
3672
|
-
originURL = resolveURL(window.location.href);
|
|
3673
|
-
return function isURLSameOrigin2(requestURL) {
|
|
3674
|
-
var parsed = utils$7.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
|
3675
|
-
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
|
3676
|
-
};
|
|
3677
|
-
}() : function nonStandardBrowserEnv6() {
|
|
3678
|
-
return function isURLSameOrigin2() {
|
|
3679
|
-
return true;
|
|
3680
|
-
};
|
|
3681
|
-
}();
|
|
3682
|
-
function Cancel$3(message) {
|
|
3683
|
-
this.message = message;
|
|
3684
|
-
}
|
|
3685
|
-
Cancel$3.prototype.toString = function toString4() {
|
|
3686
|
-
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
3687
|
-
};
|
|
3688
|
-
Cancel$3.prototype.__CANCEL__ = true;
|
|
3689
|
-
var Cancel_1 = Cancel$3;
|
|
3690
|
-
var utils$6 = utils$d;
|
|
3691
|
-
var settle4 = settle$1;
|
|
3692
|
-
var cookies = cookies$1;
|
|
3693
|
-
var buildURL$1 = buildURL$2;
|
|
3694
|
-
var buildFullPath4 = buildFullPath$1;
|
|
3695
|
-
var parseHeaders4 = parseHeaders$1;
|
|
3696
|
-
var isURLSameOrigin = isURLSameOrigin$1;
|
|
3697
|
-
var createError4 = createError$2;
|
|
3698
|
-
var defaults$4 = defaults_1;
|
|
3699
|
-
var Cancel$2 = Cancel_1;
|
|
3700
|
-
var xhr = function xhrAdapter3(config) {
|
|
3701
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
3702
|
-
var requestData = config.data;
|
|
3703
|
-
var requestHeaders = config.headers;
|
|
3704
|
-
var responseType = config.responseType;
|
|
3705
|
-
var onCanceled;
|
|
3706
|
-
function done() {
|
|
3707
|
-
if (config.cancelToken) {
|
|
3708
|
-
config.cancelToken.unsubscribe(onCanceled);
|
|
3709
|
-
}
|
|
3710
|
-
if (config.signal) {
|
|
3711
|
-
config.signal.removeEventListener("abort", onCanceled);
|
|
3712
|
-
}
|
|
3713
|
-
}
|
|
3714
|
-
if (utils$6.isFormData(requestData)) {
|
|
3715
|
-
delete requestHeaders["Content-Type"];
|
|
3716
|
-
}
|
|
3717
|
-
var request4 = new XMLHttpRequest();
|
|
3718
|
-
if (config.auth) {
|
|
3719
|
-
var username = config.auth.username || "";
|
|
3720
|
-
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
|
|
3721
|
-
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
3722
|
-
}
|
|
3723
|
-
var fullPath = buildFullPath4(config.baseURL, config.url);
|
|
3724
|
-
request4.open(config.method.toUpperCase(), buildURL$1(fullPath, config.params, config.paramsSerializer), true);
|
|
3725
|
-
request4.timeout = config.timeout;
|
|
3726
|
-
function onloadend() {
|
|
3727
|
-
if (!request4) {
|
|
3728
|
-
return;
|
|
3729
|
-
}
|
|
3730
|
-
var responseHeaders = "getAllResponseHeaders" in request4 ? parseHeaders4(request4.getAllResponseHeaders()) : null;
|
|
3731
|
-
var responseData = !responseType || responseType === "text" || responseType === "json" ? request4.responseText : request4.response;
|
|
3732
|
-
var response = {
|
|
3733
|
-
data: responseData,
|
|
3734
|
-
status: request4.status,
|
|
3735
|
-
statusText: request4.statusText,
|
|
3736
|
-
headers: responseHeaders,
|
|
3737
|
-
config,
|
|
3738
|
-
request: request4
|
|
3739
|
-
};
|
|
3740
|
-
settle4(function _resolve(value) {
|
|
3741
|
-
resolve(value);
|
|
3742
|
-
done();
|
|
3743
|
-
}, function _reject(err) {
|
|
3744
|
-
reject(err);
|
|
3745
|
-
done();
|
|
3746
|
-
}, response);
|
|
3747
|
-
request4 = null;
|
|
3748
|
-
}
|
|
3749
|
-
if ("onloadend" in request4) {
|
|
3750
|
-
request4.onloadend = onloadend;
|
|
3751
|
-
} else {
|
|
3752
|
-
request4.onreadystatechange = function handleLoad() {
|
|
3753
|
-
if (!request4 || request4.readyState !== 4) {
|
|
3754
|
-
return;
|
|
3755
|
-
}
|
|
3756
|
-
if (request4.status === 0 && !(request4.responseURL && request4.responseURL.indexOf("file:") === 0)) {
|
|
3757
|
-
return;
|
|
3758
|
-
}
|
|
3759
|
-
setTimeout(onloadend);
|
|
3760
|
-
};
|
|
3761
|
-
}
|
|
3762
|
-
request4.onabort = function handleAbort() {
|
|
3763
|
-
if (!request4) {
|
|
3764
|
-
return;
|
|
3765
|
-
}
|
|
3766
|
-
reject(createError4("Request aborted", config, "ECONNABORTED", request4));
|
|
3767
|
-
request4 = null;
|
|
3768
|
-
};
|
|
3769
|
-
request4.onerror = function handleError() {
|
|
3770
|
-
reject(createError4("Network Error", config, null, request4));
|
|
3771
|
-
request4 = null;
|
|
3772
|
-
};
|
|
3773
|
-
request4.ontimeout = function handleTimeout() {
|
|
3774
|
-
var timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
|
|
3775
|
-
var transitional4 = config.transitional || defaults$4.transitional;
|
|
3776
|
-
if (config.timeoutErrorMessage) {
|
|
3777
|
-
timeoutErrorMessage = config.timeoutErrorMessage;
|
|
3778
|
-
}
|
|
3779
|
-
reject(createError4(timeoutErrorMessage, config, transitional4.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", request4));
|
|
3780
|
-
request4 = null;
|
|
3781
|
-
};
|
|
3782
|
-
if (utils$6.isStandardBrowserEnv()) {
|
|
3783
|
-
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0;
|
|
3784
|
-
if (xsrfValue) {
|
|
3785
|
-
requestHeaders[config.xsrfHeaderName] = xsrfValue;
|
|
3786
|
-
}
|
|
3787
|
-
}
|
|
3788
|
-
if ("setRequestHeader" in request4) {
|
|
3789
|
-
utils$6.forEach(requestHeaders, function setRequestHeader(val, key) {
|
|
3790
|
-
if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
|
|
3791
|
-
delete requestHeaders[key];
|
|
3792
|
-
} else {
|
|
3793
|
-
request4.setRequestHeader(key, val);
|
|
3794
|
-
}
|
|
3795
|
-
});
|
|
3796
|
-
}
|
|
3797
|
-
if (!utils$6.isUndefined(config.withCredentials)) {
|
|
3798
|
-
request4.withCredentials = !!config.withCredentials;
|
|
3799
|
-
}
|
|
3800
|
-
if (responseType && responseType !== "json") {
|
|
3801
|
-
request4.responseType = config.responseType;
|
|
3802
|
-
}
|
|
3803
|
-
if (typeof config.onDownloadProgress === "function") {
|
|
3804
|
-
request4.addEventListener("progress", config.onDownloadProgress);
|
|
3805
|
-
}
|
|
3806
|
-
if (typeof config.onUploadProgress === "function" && request4.upload) {
|
|
3807
|
-
request4.upload.addEventListener("progress", config.onUploadProgress);
|
|
3808
|
-
}
|
|
3809
|
-
if (config.cancelToken || config.signal) {
|
|
3810
|
-
onCanceled = function(cancel) {
|
|
3811
|
-
if (!request4) {
|
|
3812
|
-
return;
|
|
3813
|
-
}
|
|
3814
|
-
reject(!cancel || cancel && cancel.type ? new Cancel$2("canceled") : cancel);
|
|
3815
|
-
request4.abort();
|
|
3816
|
-
request4 = null;
|
|
3817
|
-
};
|
|
3818
|
-
config.cancelToken && config.cancelToken.subscribe(onCanceled);
|
|
3819
|
-
if (config.signal) {
|
|
3820
|
-
config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
|
|
3821
|
-
}
|
|
3822
|
-
}
|
|
3823
|
-
if (!requestData) {
|
|
3824
|
-
requestData = null;
|
|
3825
|
-
}
|
|
3826
|
-
request4.send(requestData);
|
|
3827
|
-
});
|
|
3828
|
-
};
|
|
3829
|
-
var utils$5 = utils$d;
|
|
3830
|
-
var normalizeHeaderName4 = normalizeHeaderName$1;
|
|
3831
|
-
var enhanceError4 = enhanceError$2;
|
|
3832
|
-
var DEFAULT_CONTENT_TYPE = {
|
|
3833
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
3834
|
-
};
|
|
3835
|
-
function setContentTypeIfUnset(headers, value) {
|
|
3836
|
-
if (!utils$5.isUndefined(headers) && utils$5.isUndefined(headers["Content-Type"])) {
|
|
3837
|
-
headers["Content-Type"] = value;
|
|
3838
|
-
}
|
|
3839
|
-
}
|
|
3840
|
-
function getDefaultAdapter() {
|
|
3841
|
-
var adapter;
|
|
3842
|
-
if (typeof XMLHttpRequest !== "undefined") {
|
|
3843
|
-
adapter = xhr;
|
|
3844
|
-
} else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
|
|
3845
|
-
adapter = xhr;
|
|
3846
|
-
}
|
|
3847
|
-
return adapter;
|
|
3848
|
-
}
|
|
3849
|
-
function stringifySafely(rawValue, parser, encoder) {
|
|
3850
|
-
if (utils$5.isString(rawValue)) {
|
|
3851
|
-
try {
|
|
3852
|
-
(parser || JSON.parse)(rawValue);
|
|
3853
|
-
return utils$5.trim(rawValue);
|
|
3854
|
-
} catch (e) {
|
|
3855
|
-
if (e.name !== "SyntaxError") {
|
|
3856
|
-
throw e;
|
|
3857
|
-
}
|
|
3858
|
-
}
|
|
3859
|
-
}
|
|
3860
|
-
return (encoder || JSON.stringify)(rawValue);
|
|
3861
|
-
}
|
|
3862
|
-
var defaults$3 = {
|
|
3863
|
-
transitional: {
|
|
3864
|
-
silentJSONParsing: true,
|
|
3865
|
-
forcedJSONParsing: true,
|
|
3866
|
-
clarifyTimeoutError: false
|
|
3867
|
-
},
|
|
3868
|
-
adapter: getDefaultAdapter(),
|
|
3869
|
-
transformRequest: [function transformRequest3(data2, headers) {
|
|
3870
|
-
normalizeHeaderName4(headers, "Accept");
|
|
3871
|
-
normalizeHeaderName4(headers, "Content-Type");
|
|
3872
|
-
if (utils$5.isFormData(data2) || utils$5.isArrayBuffer(data2) || utils$5.isBuffer(data2) || utils$5.isStream(data2) || utils$5.isFile(data2) || utils$5.isBlob(data2)) {
|
|
3873
|
-
return data2;
|
|
3874
|
-
}
|
|
3875
|
-
if (utils$5.isArrayBufferView(data2)) {
|
|
3876
|
-
return data2.buffer;
|
|
3877
|
-
}
|
|
3878
|
-
if (utils$5.isURLSearchParams(data2)) {
|
|
3879
|
-
setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
|
|
3880
|
-
return data2.toString();
|
|
3881
|
-
}
|
|
3882
|
-
if (utils$5.isObject(data2) || headers && headers["Content-Type"] === "application/json") {
|
|
3883
|
-
setContentTypeIfUnset(headers, "application/json");
|
|
3884
|
-
return stringifySafely(data2);
|
|
3885
|
-
}
|
|
3886
|
-
return data2;
|
|
3887
|
-
}],
|
|
3888
|
-
transformResponse: [function transformResponse3(data2) {
|
|
3889
|
-
var transitional4 = this.transitional || defaults$3.transitional;
|
|
3890
|
-
var silentJSONParsing = transitional4 && transitional4.silentJSONParsing;
|
|
3891
|
-
var forcedJSONParsing = transitional4 && transitional4.forcedJSONParsing;
|
|
3892
|
-
var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
|
|
3893
|
-
if (strictJSONParsing || forcedJSONParsing && utils$5.isString(data2) && data2.length) {
|
|
3894
|
-
try {
|
|
3895
|
-
return JSON.parse(data2);
|
|
3896
|
-
} catch (e) {
|
|
3897
|
-
if (strictJSONParsing) {
|
|
3898
|
-
if (e.name === "SyntaxError") {
|
|
3899
|
-
throw enhanceError4(e, this, "E_JSON_PARSE");
|
|
3900
|
-
}
|
|
3901
|
-
throw e;
|
|
3902
|
-
}
|
|
3903
|
-
}
|
|
3904
|
-
}
|
|
3905
|
-
return data2;
|
|
3906
|
-
}],
|
|
3907
|
-
timeout: 0,
|
|
3908
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
3909
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
3910
|
-
maxContentLength: -1,
|
|
3911
|
-
maxBodyLength: -1,
|
|
3912
|
-
validateStatus: function validateStatus3(status) {
|
|
3913
|
-
return status >= 200 && status < 300;
|
|
3914
|
-
},
|
|
3915
|
-
headers: {
|
|
3916
|
-
common: {
|
|
3917
|
-
"Accept": "application/json, text/plain, */*"
|
|
3918
|
-
}
|
|
3919
|
-
}
|
|
3920
|
-
};
|
|
3921
|
-
utils$5.forEach(["delete", "get", "head"], function forEachMethodNoData5(method) {
|
|
3922
|
-
defaults$3.headers[method] = {};
|
|
3923
|
-
});
|
|
3924
|
-
utils$5.forEach(["post", "put", "patch"], function forEachMethodWithData5(method) {
|
|
3925
|
-
defaults$3.headers[method] = utils$5.merge(DEFAULT_CONTENT_TYPE);
|
|
3926
|
-
});
|
|
3927
|
-
var defaults_1 = defaults$3;
|
|
3928
|
-
var utils$4 = utils$d;
|
|
3929
|
-
var defaults$2 = defaults_1;
|
|
3930
|
-
var transformData$1 = function transformData3(data2, headers, fns) {
|
|
3931
|
-
var context = this || defaults$2;
|
|
3932
|
-
utils$4.forEach(fns, function transform(fn) {
|
|
3933
|
-
data2 = fn.call(context, data2, headers);
|
|
3934
|
-
});
|
|
3935
|
-
return data2;
|
|
3936
|
-
};
|
|
3937
|
-
var isCancel$1 = function isCancel3(value) {
|
|
3938
|
-
return !!(value && value.__CANCEL__);
|
|
3939
|
-
};
|
|
3940
|
-
var utils$3 = utils$d;
|
|
3941
|
-
var transformData4 = transformData$1;
|
|
3942
|
-
var isCancel4 = isCancel$1;
|
|
3943
|
-
var defaults$1 = defaults_1;
|
|
3944
|
-
var Cancel$1 = Cancel_1;
|
|
3945
|
-
function throwIfCancellationRequested(config) {
|
|
3946
|
-
if (config.cancelToken) {
|
|
3947
|
-
config.cancelToken.throwIfRequested();
|
|
3948
|
-
}
|
|
3949
|
-
if (config.signal && config.signal.aborted) {
|
|
3950
|
-
throw new Cancel$1("canceled");
|
|
3951
|
-
}
|
|
3952
|
-
}
|
|
3953
|
-
var dispatchRequest$1 = function dispatchRequest3(config) {
|
|
3954
|
-
throwIfCancellationRequested(config);
|
|
3955
|
-
config.headers = config.headers || {};
|
|
3956
|
-
config.data = transformData4.call(config, config.data, config.headers, config.transformRequest);
|
|
3957
|
-
config.headers = utils$3.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
|
|
3958
|
-
utils$3.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) {
|
|
3959
|
-
delete config.headers[method];
|
|
3960
|
-
});
|
|
3961
|
-
var adapter = config.adapter || defaults$1.adapter;
|
|
3962
|
-
return adapter(config).then(function onAdapterResolution(response) {
|
|
3963
|
-
throwIfCancellationRequested(config);
|
|
3964
|
-
response.data = transformData4.call(config, response.data, response.headers, config.transformResponse);
|
|
3965
|
-
return response;
|
|
3966
|
-
}, function onAdapterRejection(reason) {
|
|
3967
|
-
if (!isCancel4(reason)) {
|
|
3968
|
-
throwIfCancellationRequested(config);
|
|
3969
|
-
if (reason && reason.response) {
|
|
3970
|
-
reason.response.data = transformData4.call(config, reason.response.data, reason.response.headers, config.transformResponse);
|
|
3971
|
-
}
|
|
3972
|
-
}
|
|
3973
|
-
return Promise.reject(reason);
|
|
3974
|
-
});
|
|
3975
|
-
};
|
|
3976
|
-
var utils$2 = utils$d;
|
|
3977
|
-
var mergeConfig$2 = function mergeConfig3(config1, config2) {
|
|
3978
|
-
config2 = config2 || {};
|
|
3979
|
-
var config = {};
|
|
3980
|
-
function getMergedValue(target, source4) {
|
|
3981
|
-
if (utils$2.isPlainObject(target) && utils$2.isPlainObject(source4)) {
|
|
3982
|
-
return utils$2.merge(target, source4);
|
|
3983
|
-
} else if (utils$2.isPlainObject(source4)) {
|
|
3984
|
-
return utils$2.merge({}, source4);
|
|
3985
|
-
} else if (utils$2.isArray(source4)) {
|
|
3986
|
-
return source4.slice();
|
|
3987
|
-
}
|
|
3988
|
-
return source4;
|
|
3989
|
-
}
|
|
3990
|
-
function mergeDeepProperties(prop) {
|
|
3991
|
-
if (!utils$2.isUndefined(config2[prop])) {
|
|
3992
|
-
return getMergedValue(config1[prop], config2[prop]);
|
|
3993
|
-
} else if (!utils$2.isUndefined(config1[prop])) {
|
|
3994
|
-
return getMergedValue(void 0, config1[prop]);
|
|
3995
|
-
}
|
|
3996
|
-
}
|
|
3997
|
-
function valueFromConfig2(prop) {
|
|
3998
|
-
if (!utils$2.isUndefined(config2[prop])) {
|
|
3999
|
-
return getMergedValue(void 0, config2[prop]);
|
|
4000
|
-
}
|
|
4001
|
-
}
|
|
4002
|
-
function defaultToConfig2(prop) {
|
|
4003
|
-
if (!utils$2.isUndefined(config2[prop])) {
|
|
4004
|
-
return getMergedValue(void 0, config2[prop]);
|
|
4005
|
-
} else if (!utils$2.isUndefined(config1[prop])) {
|
|
4006
|
-
return getMergedValue(void 0, config1[prop]);
|
|
4007
|
-
}
|
|
4008
|
-
}
|
|
4009
|
-
function mergeDirectKeys(prop) {
|
|
4010
|
-
if (prop in config2) {
|
|
4011
|
-
return getMergedValue(config1[prop], config2[prop]);
|
|
4012
|
-
} else if (prop in config1) {
|
|
4013
|
-
return getMergedValue(void 0, config1[prop]);
|
|
4014
|
-
}
|
|
4015
|
-
}
|
|
4016
|
-
var mergeMap = {
|
|
4017
|
-
"url": valueFromConfig2,
|
|
4018
|
-
"method": valueFromConfig2,
|
|
4019
|
-
"data": valueFromConfig2,
|
|
4020
|
-
"baseURL": defaultToConfig2,
|
|
4021
|
-
"transformRequest": defaultToConfig2,
|
|
4022
|
-
"transformResponse": defaultToConfig2,
|
|
4023
|
-
"paramsSerializer": defaultToConfig2,
|
|
4024
|
-
"timeout": defaultToConfig2,
|
|
4025
|
-
"timeoutMessage": defaultToConfig2,
|
|
4026
|
-
"withCredentials": defaultToConfig2,
|
|
4027
|
-
"adapter": defaultToConfig2,
|
|
4028
|
-
"responseType": defaultToConfig2,
|
|
4029
|
-
"xsrfCookieName": defaultToConfig2,
|
|
4030
|
-
"xsrfHeaderName": defaultToConfig2,
|
|
4031
|
-
"onUploadProgress": defaultToConfig2,
|
|
4032
|
-
"onDownloadProgress": defaultToConfig2,
|
|
4033
|
-
"decompress": defaultToConfig2,
|
|
4034
|
-
"maxContentLength": defaultToConfig2,
|
|
4035
|
-
"maxBodyLength": defaultToConfig2,
|
|
4036
|
-
"transport": defaultToConfig2,
|
|
4037
|
-
"httpAgent": defaultToConfig2,
|
|
4038
|
-
"httpsAgent": defaultToConfig2,
|
|
4039
|
-
"cancelToken": defaultToConfig2,
|
|
4040
|
-
"socketPath": defaultToConfig2,
|
|
4041
|
-
"responseEncoding": defaultToConfig2,
|
|
4042
|
-
"validateStatus": mergeDirectKeys
|
|
4043
|
-
};
|
|
4044
|
-
utils$2.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
4045
|
-
var merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
4046
|
-
var configValue = merge2(prop);
|
|
4047
|
-
utils$2.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
|
|
4048
|
-
});
|
|
4049
|
-
return config;
|
|
4050
|
-
};
|
|
4051
|
-
var data = {
|
|
4052
|
-
"version": "0.23.0"
|
|
4053
|
-
};
|
|
4054
|
-
var VERSION = data.version;
|
|
4055
|
-
var validators$1 = {};
|
|
4056
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
|
|
4057
|
-
validators$1[type] = function validator2(thing) {
|
|
4058
|
-
return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
|
|
4059
|
-
};
|
|
4060
|
-
});
|
|
4061
|
-
var deprecatedWarnings = {};
|
|
4062
|
-
validators$1.transitional = function transitional3(validator2, version2, message) {
|
|
4063
|
-
function formatMessage(opt, desc) {
|
|
4064
|
-
return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
4065
|
-
}
|
|
4066
|
-
return function(value, opt, opts) {
|
|
4067
|
-
if (validator2 === false) {
|
|
4068
|
-
throw new Error(formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")));
|
|
4069
|
-
}
|
|
4070
|
-
if (version2 && !deprecatedWarnings[opt]) {
|
|
4071
|
-
deprecatedWarnings[opt] = true;
|
|
4072
|
-
console.warn(formatMessage(opt, " has been deprecated since v" + version2 + " and will be removed in the near future"));
|
|
4073
|
-
}
|
|
4074
|
-
return validator2 ? validator2(value, opt, opts) : true;
|
|
4075
|
-
};
|
|
4076
|
-
};
|
|
4077
|
-
function assertOptions(options, schema, allowUnknown) {
|
|
4078
|
-
if (typeof options !== "object") {
|
|
4079
|
-
throw new TypeError("options must be an object");
|
|
4080
|
-
}
|
|
4081
|
-
var keys = Object.keys(options);
|
|
4082
|
-
var i = keys.length;
|
|
4083
|
-
while (i-- > 0) {
|
|
4084
|
-
var opt = keys[i];
|
|
4085
|
-
var validator2 = schema[opt];
|
|
4086
|
-
if (validator2) {
|
|
4087
|
-
var value = options[opt];
|
|
4088
|
-
var result = value === void 0 || validator2(value, opt, options);
|
|
4089
|
-
if (result !== true) {
|
|
4090
|
-
throw new TypeError("option " + opt + " must be " + result);
|
|
4091
|
-
}
|
|
4092
|
-
continue;
|
|
4093
|
-
}
|
|
4094
|
-
if (allowUnknown !== true) {
|
|
4095
|
-
throw Error("Unknown option " + opt);
|
|
4096
|
-
}
|
|
4097
|
-
}
|
|
4098
|
-
}
|
|
4099
|
-
var validator$1 = {
|
|
4100
|
-
assertOptions,
|
|
4101
|
-
validators: validators$1
|
|
4102
|
-
};
|
|
4103
|
-
var utils$1 = utils$d;
|
|
4104
|
-
var buildURL4 = buildURL$2;
|
|
4105
|
-
var InterceptorManager = InterceptorManager_1;
|
|
4106
|
-
var dispatchRequest4 = dispatchRequest$1;
|
|
4107
|
-
var mergeConfig$1 = mergeConfig$2;
|
|
4108
|
-
var validator = validator$1;
|
|
4109
|
-
var validators = validator.validators;
|
|
4110
|
-
function Axios$1(instanceConfig) {
|
|
4111
|
-
this.defaults = instanceConfig;
|
|
4112
|
-
this.interceptors = {
|
|
4113
|
-
request: new InterceptorManager(),
|
|
4114
|
-
response: new InterceptorManager()
|
|
4115
|
-
};
|
|
4116
|
-
}
|
|
4117
|
-
Axios$1.prototype.request = function request3(config) {
|
|
4118
|
-
if (typeof config === "string") {
|
|
4119
|
-
config = arguments[1] || {};
|
|
4120
|
-
config.url = arguments[0];
|
|
4121
|
-
} else {
|
|
4122
|
-
config = config || {};
|
|
4123
|
-
}
|
|
4124
|
-
config = mergeConfig$1(this.defaults, config);
|
|
4125
|
-
if (config.method) {
|
|
4126
|
-
config.method = config.method.toLowerCase();
|
|
4127
|
-
} else if (this.defaults.method) {
|
|
4128
|
-
config.method = this.defaults.method.toLowerCase();
|
|
4129
|
-
} else {
|
|
4130
|
-
config.method = "get";
|
|
4131
|
-
}
|
|
4132
|
-
var transitional4 = config.transitional;
|
|
4133
|
-
if (transitional4 !== void 0) {
|
|
4134
|
-
validator.assertOptions(transitional4, {
|
|
4135
|
-
silentJSONParsing: validators.transitional(validators.boolean),
|
|
4136
|
-
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
4137
|
-
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
4138
|
-
}, false);
|
|
4139
|
-
}
|
|
4140
|
-
var requestInterceptorChain = [];
|
|
4141
|
-
var synchronousRequestInterceptors = true;
|
|
4142
|
-
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
4143
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
|
|
4144
|
-
return;
|
|
4145
|
-
}
|
|
4146
|
-
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
4147
|
-
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
4148
|
-
});
|
|
4149
|
-
var responseInterceptorChain = [];
|
|
4150
|
-
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
4151
|
-
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
4152
|
-
});
|
|
4153
|
-
var promise;
|
|
4154
|
-
if (!synchronousRequestInterceptors) {
|
|
4155
|
-
var chain = [dispatchRequest4, void 0];
|
|
4156
|
-
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
4157
|
-
chain = chain.concat(responseInterceptorChain);
|
|
4158
|
-
promise = Promise.resolve(config);
|
|
4159
|
-
while (chain.length) {
|
|
4160
|
-
promise = promise.then(chain.shift(), chain.shift());
|
|
4161
|
-
}
|
|
4162
|
-
return promise;
|
|
4163
|
-
}
|
|
4164
|
-
var newConfig = config;
|
|
4165
|
-
while (requestInterceptorChain.length) {
|
|
4166
|
-
var onFulfilled = requestInterceptorChain.shift();
|
|
4167
|
-
var onRejected = requestInterceptorChain.shift();
|
|
4168
|
-
try {
|
|
4169
|
-
newConfig = onFulfilled(newConfig);
|
|
4170
|
-
} catch (error) {
|
|
4171
|
-
onRejected(error);
|
|
4172
|
-
break;
|
|
4173
|
-
}
|
|
4174
|
-
}
|
|
4175
|
-
try {
|
|
4176
|
-
promise = dispatchRequest4(newConfig);
|
|
4177
|
-
} catch (error) {
|
|
4178
|
-
return Promise.reject(error);
|
|
4179
|
-
}
|
|
4180
|
-
while (responseInterceptorChain.length) {
|
|
4181
|
-
promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
|
|
4182
|
-
}
|
|
4183
|
-
return promise;
|
|
4184
|
-
};
|
|
4185
|
-
Axios$1.prototype.getUri = function getUri3(config) {
|
|
4186
|
-
config = mergeConfig$1(this.defaults, config);
|
|
4187
|
-
return buildURL4(config.url, config.params, config.paramsSerializer).replace(/^\?/, "");
|
|
4188
|
-
};
|
|
4189
|
-
utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData6(method) {
|
|
4190
|
-
Axios$1.prototype[method] = function(url, config) {
|
|
4191
|
-
return this.request(mergeConfig$1(config || {}, {
|
|
4192
|
-
method,
|
|
4193
|
-
url,
|
|
4194
|
-
data: (config || {}).data
|
|
4195
|
-
}));
|
|
4196
|
-
};
|
|
4197
|
-
});
|
|
4198
|
-
utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData6(method) {
|
|
4199
|
-
Axios$1.prototype[method] = function(url, data2, config) {
|
|
4200
|
-
return this.request(mergeConfig$1(config || {}, {
|
|
4201
|
-
method,
|
|
4202
|
-
url,
|
|
4203
|
-
data: data2
|
|
4204
|
-
}));
|
|
4205
|
-
};
|
|
4206
|
-
});
|
|
4207
|
-
var Axios_1 = Axios$1;
|
|
4208
|
-
var Cancel = Cancel_1;
|
|
4209
|
-
function CancelToken(executor) {
|
|
4210
|
-
if (typeof executor !== "function") {
|
|
4211
|
-
throw new TypeError("executor must be a function.");
|
|
4212
|
-
}
|
|
4213
|
-
var resolvePromise;
|
|
4214
|
-
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
4215
|
-
resolvePromise = resolve;
|
|
4216
|
-
});
|
|
4217
|
-
var token2 = this;
|
|
4218
|
-
this.promise.then(function(cancel) {
|
|
4219
|
-
if (!token2._listeners)
|
|
4220
|
-
return;
|
|
4221
|
-
var i;
|
|
4222
|
-
var l = token2._listeners.length;
|
|
4223
|
-
for (i = 0; i < l; i++) {
|
|
4224
|
-
token2._listeners[i](cancel);
|
|
4225
|
-
}
|
|
4226
|
-
token2._listeners = null;
|
|
4227
|
-
});
|
|
4228
|
-
this.promise.then = function(onfulfilled) {
|
|
4229
|
-
var _resolve;
|
|
4230
|
-
var promise = new Promise(function(resolve) {
|
|
4231
|
-
token2.subscribe(resolve);
|
|
4232
|
-
_resolve = resolve;
|
|
4233
|
-
}).then(onfulfilled);
|
|
4234
|
-
promise.cancel = function reject() {
|
|
4235
|
-
token2.unsubscribe(_resolve);
|
|
4236
|
-
};
|
|
4237
|
-
return promise;
|
|
4238
|
-
};
|
|
4239
|
-
executor(function cancel(message) {
|
|
4240
|
-
if (token2.reason) {
|
|
4241
|
-
return;
|
|
4242
|
-
}
|
|
4243
|
-
token2.reason = new Cancel(message);
|
|
4244
|
-
resolvePromise(token2.reason);
|
|
4245
|
-
});
|
|
4246
|
-
}
|
|
4247
|
-
CancelToken.prototype.throwIfRequested = function throwIfRequested3() {
|
|
4248
|
-
if (this.reason) {
|
|
4249
|
-
throw this.reason;
|
|
4250
|
-
}
|
|
4251
|
-
};
|
|
4252
|
-
CancelToken.prototype.subscribe = function subscribe2(listener) {
|
|
4253
|
-
if (this.reason) {
|
|
4254
|
-
listener(this.reason);
|
|
4255
|
-
return;
|
|
4256
|
-
}
|
|
4257
|
-
if (this._listeners) {
|
|
4258
|
-
this._listeners.push(listener);
|
|
4259
|
-
} else {
|
|
4260
|
-
this._listeners = [listener];
|
|
4261
|
-
}
|
|
4262
|
-
};
|
|
4263
|
-
CancelToken.prototype.unsubscribe = function unsubscribe2(listener) {
|
|
4264
|
-
if (!this._listeners) {
|
|
4265
|
-
return;
|
|
4266
|
-
}
|
|
4267
|
-
var index = this._listeners.indexOf(listener);
|
|
4268
|
-
if (index !== -1) {
|
|
4269
|
-
this._listeners.splice(index, 1);
|
|
4270
|
-
}
|
|
4271
|
-
};
|
|
4272
|
-
CancelToken.source = function source3() {
|
|
4273
|
-
var cancel;
|
|
4274
|
-
var token2 = new CancelToken(function executor(c) {
|
|
4275
|
-
cancel = c;
|
|
4276
|
-
});
|
|
4277
|
-
return {
|
|
4278
|
-
token: token2,
|
|
4279
|
-
cancel
|
|
4280
|
-
};
|
|
4281
|
-
};
|
|
4282
|
-
var CancelToken_1 = CancelToken;
|
|
4283
|
-
var spread3 = function spread4(callback) {
|
|
4284
|
-
return function wrap(arr) {
|
|
4285
|
-
return callback.apply(null, arr);
|
|
4286
|
-
};
|
|
4287
|
-
};
|
|
4288
|
-
var isAxiosError3 = function isAxiosError4(payload) {
|
|
4289
|
-
return typeof payload === "object" && payload.isAxiosError === true;
|
|
4290
|
-
};
|
|
4291
|
-
var utils = utils$d;
|
|
4292
|
-
var bind4 = bind$2;
|
|
4293
|
-
var Axios = Axios_1;
|
|
4294
|
-
var mergeConfig4 = mergeConfig$2;
|
|
4295
|
-
var defaults = defaults_1;
|
|
4296
|
-
function createInstance(defaultConfig) {
|
|
4297
|
-
var context = new Axios(defaultConfig);
|
|
4298
|
-
var instance = bind4(Axios.prototype.request, context);
|
|
4299
|
-
utils.extend(instance, Axios.prototype, context);
|
|
4300
|
-
utils.extend(instance, context);
|
|
4301
|
-
instance.create = function create2(instanceConfig) {
|
|
4302
|
-
return createInstance(mergeConfig4(defaultConfig, instanceConfig));
|
|
4303
|
-
};
|
|
4304
|
-
return instance;
|
|
4305
|
-
}
|
|
4306
|
-
var axios$1 = createInstance(defaults);
|
|
4307
|
-
axios$1.Axios = Axios;
|
|
4308
|
-
axios$1.Cancel = Cancel_1;
|
|
4309
|
-
axios$1.CancelToken = CancelToken_1;
|
|
4310
|
-
axios$1.isCancel = isCancel$1;
|
|
4311
|
-
axios$1.VERSION = data.version;
|
|
4312
|
-
axios$1.all = function all3(promises) {
|
|
4313
|
-
return Promise.all(promises);
|
|
4314
|
-
};
|
|
4315
|
-
axios$1.spread = spread3;
|
|
4316
|
-
axios$1.isAxiosError = isAxiosError3;
|
|
4317
|
-
axios$2.exports = axios$1;
|
|
4318
|
-
axios$2.exports.default = axios$1;
|
|
4319
|
-
var axios = axios$2.exports;
|
|
1140
|
+
const axios$1 = require("axios");
|
|
4320
1141
|
class NhostFunctionsClient {
|
|
4321
1142
|
constructor(params) {
|
|
4322
1143
|
const { url } = params;
|
|
4323
1144
|
this.accessToken = null;
|
|
4324
|
-
this.instance = axios.create({
|
|
1145
|
+
this.instance = axios$1.create({
|
|
4325
1146
|
baseURL: url
|
|
4326
1147
|
});
|
|
4327
1148
|
}
|
|
4328
|
-
async call(url,
|
|
1149
|
+
async call(url, data, config) {
|
|
4329
1150
|
const headers = __spreadValues(__spreadValues({}, this.generateAccessTokenHeaders()), config == null ? void 0 : config.headers);
|
|
4330
1151
|
let res;
|
|
4331
1152
|
try {
|
|
4332
|
-
res = await this.instance.post(url,
|
|
1153
|
+
res = await this.instance.post(url, data, __spreadProps(__spreadValues({}, config), { headers }));
|
|
4333
1154
|
} catch (error) {
|
|
4334
1155
|
if (error instanceof Error) {
|
|
4335
1156
|
return { res: null, error };
|
|
@@ -4359,6 +1180,7 @@ class NhostFunctionsClient {
|
|
|
4359
1180
|
};
|
|
4360
1181
|
}
|
|
4361
1182
|
}
|
|
1183
|
+
const axios = require("axios");
|
|
4362
1184
|
class NhostGraphqlClient {
|
|
4363
1185
|
constructor(params) {
|
|
4364
1186
|
const { url } = params;
|
|
@@ -4368,14 +1190,14 @@ class NhostGraphqlClient {
|
|
|
4368
1190
|
baseURL: url
|
|
4369
1191
|
});
|
|
4370
1192
|
}
|
|
4371
|
-
async request(
|
|
1193
|
+
async request(document, variables, config) {
|
|
4372
1194
|
const headers = __spreadValues(__spreadValues({}, config == null ? void 0 : config.headers), this.generateAccessTokenHeaders());
|
|
4373
1195
|
const operationName = "";
|
|
4374
1196
|
let responseData;
|
|
4375
1197
|
try {
|
|
4376
1198
|
const res = await this.instance.post("", {
|
|
4377
1199
|
operationName: operationName || void 0,
|
|
4378
|
-
query:
|
|
1200
|
+
query: document,
|
|
4379
1201
|
variables
|
|
4380
1202
|
}, __spreadProps(__spreadValues({}, config), { headers }));
|
|
4381
1203
|
responseData = res.data;
|