varsnap 1.8.2 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/built/varsnap/core.d.ts +1 -1
- package/dist/built/varsnap/core.js +1 -1
- package/dist/varsnap.js +351 -354
- package/dist/varsnap.min.js +2 -2
- package/package.json +4 -4
package/dist/varsnap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Varsnap.js v1.8.
|
|
2
|
+
* Varsnap.js v1.8.3
|
|
3
3
|
*/
|
|
4
4
|
(function(exports) {
|
|
5
5
|
!function(e) {
|
|
@@ -7,173 +7,43 @@
|
|
|
7
7
|
("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).varsnap = e();
|
|
8
8
|
}
|
|
9
9
|
}(function() {
|
|
10
|
-
var e = function(e) {
|
|
11
|
-
var t;
|
|
12
|
-
return function(n) {
|
|
13
|
-
return t || e(t = {
|
|
14
|
-
exports: {},
|
|
15
|
-
parent: n
|
|
16
|
-
}, t.exports), t.exports;
|
|
17
|
-
};
|
|
18
|
-
}, t = e(function(e, t) {
|
|
19
|
-
(function(t) {
|
|
20
|
-
(function() {
|
|
21
|
-
"use strict";
|
|
22
|
-
var r = {
|
|
23
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
24
|
-
};
|
|
25
|
-
function o(e, t) {
|
|
26
|
-
!l.isUndefined(e) && l.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t);
|
|
27
|
-
}
|
|
28
|
-
var i, a = {
|
|
29
|
-
transitional: {
|
|
30
|
-
silentJSONParsing: !0,
|
|
31
|
-
forcedJSONParsing: !0,
|
|
32
|
-
clarifyTimeoutError: !1
|
|
33
|
-
},
|
|
34
|
-
adapter: (("undefined" != typeof XMLHttpRequest || void 0 !== t && "[object process]" === Object.prototype.toString.call(t)) && (i = n({})),
|
|
35
|
-
i),
|
|
36
|
-
transformRequest: [ function(e, t) {
|
|
37
|
-
return m(t, "Accept"), m(t, "Content-Type"), l.isFormData(e) || l.isArrayBuffer(e) || l.isBuffer(e) || l.isStream(e) || l.isFile(e) || l.isBlob(e) ? e : l.isArrayBufferView(e) ? e.buffer : l.isURLSearchParams(e) ? (o(t, "application/x-www-form-urlencoded;charset=utf-8"),
|
|
38
|
-
e.toString()) : l.isObject(e) || t && "application/json" === t["Content-Type"] ? (o(t, "application/json"),
|
|
39
|
-
function(e, t, n) {
|
|
40
|
-
if (l.isString(e)) try {
|
|
41
|
-
return (0, JSON.parse)(e), l.trim(e);
|
|
42
|
-
} catch (r) {
|
|
43
|
-
if ("SyntaxError" !== r.name) throw r;
|
|
44
|
-
}
|
|
45
|
-
return (0, JSON.stringify)(e);
|
|
46
|
-
}(e)) : e;
|
|
47
|
-
} ],
|
|
48
|
-
transformResponse: [ function(e) {
|
|
49
|
-
var t = this.transitional || a.transitional, n = t && t.silentJSONParsing, r = t && t.forcedJSONParsing, o = !n && "json" === this.responseType;
|
|
50
|
-
if (o || r && l.isString(e) && e.length) try {
|
|
51
|
-
return JSON.parse(e);
|
|
52
|
-
} catch (i) {
|
|
53
|
-
if (o) {
|
|
54
|
-
if ("SyntaxError" === i.name) throw v(i, this, "E_JSON_PARSE");
|
|
55
|
-
throw i;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return e;
|
|
59
|
-
} ],
|
|
60
|
-
timeout: 0,
|
|
61
|
-
xsrfCookieName: "XSRF-TOKEN",
|
|
62
|
-
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
63
|
-
maxContentLength: -1,
|
|
64
|
-
maxBodyLength: -1,
|
|
65
|
-
validateStatus: function(e) {
|
|
66
|
-
return e >= 200 && e < 300;
|
|
67
|
-
},
|
|
68
|
-
headers: {
|
|
69
|
-
common: {
|
|
70
|
-
Accept: "application/json, text/plain, */*"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
l.forEach([ "delete", "get", "head" ], function(e) {
|
|
75
|
-
a.headers[e] = {};
|
|
76
|
-
}), l.forEach([ "post", "put", "patch" ], function(e) {
|
|
77
|
-
a.headers[e] = l.merge(r);
|
|
78
|
-
}), e.exports = a;
|
|
79
|
-
}).call(this);
|
|
80
|
-
}).call(this, _);
|
|
81
|
-
}), n = e(function(e, n) {
|
|
82
|
-
"use strict";
|
|
83
|
-
var r = t({});
|
|
84
|
-
e.exports = function(e) {
|
|
85
|
-
return new Promise(function(t, n) {
|
|
86
|
-
var o, i = e.data, a = e.headers, s = e.responseType;
|
|
87
|
-
function u() {
|
|
88
|
-
e.cancelToken && e.cancelToken.unsubscribe(o), e.signal && e.signal.removeEventListener("abort", o);
|
|
89
|
-
}
|
|
90
|
-
l.isFormData(i) && delete a["Content-Type"];
|
|
91
|
-
var c = new XMLHttpRequest();
|
|
92
|
-
if (e.auth) {
|
|
93
|
-
var f = e.auth.username || "", p = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
94
|
-
a.Authorization = "Basic " + btoa(f + ":" + p);
|
|
95
|
-
}
|
|
96
|
-
var h = S(e.baseURL, e.url);
|
|
97
|
-
function g() {
|
|
98
|
-
if (c) {
|
|
99
|
-
var r = "getAllResponseHeaders" in c ? k(c.getAllResponseHeaders()) : null, o = {
|
|
100
|
-
data: s && "text" !== s && "json" !== s ? c.response : c.responseText,
|
|
101
|
-
status: c.status,
|
|
102
|
-
statusText: c.statusText,
|
|
103
|
-
headers: r,
|
|
104
|
-
config: e,
|
|
105
|
-
request: c
|
|
106
|
-
};
|
|
107
|
-
b(function(e) {
|
|
108
|
-
t(e), u();
|
|
109
|
-
}, function(e) {
|
|
110
|
-
n(e), u();
|
|
111
|
-
}, o), c = null;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (c.open(e.method.toUpperCase(), d(h, e.params, e.paramsSerializer), !0), c.timeout = e.timeout,
|
|
115
|
-
"onloadend" in c ? c.onloadend = g : c.onreadystatechange = function() {
|
|
116
|
-
c && 4 === c.readyState && (0 !== c.status || c.responseURL && 0 === c.responseURL.indexOf("file:")) && setTimeout(g);
|
|
117
|
-
}, c.onabort = function() {
|
|
118
|
-
c && (n(y("Request aborted", e, "ECONNABORTED", c)), c = null);
|
|
119
|
-
}, c.onerror = function() {
|
|
120
|
-
n(y("Network Error", e, null, c)), c = null;
|
|
121
|
-
}, c.ontimeout = function() {
|
|
122
|
-
var t = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded", o = e.transitional || r.transitional;
|
|
123
|
-
e.timeoutErrorMessage && (t = e.timeoutErrorMessage), n(y(t, e, o.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", c)),
|
|
124
|
-
c = null;
|
|
125
|
-
}, l.isStandardBrowserEnv()) {
|
|
126
|
-
var m = (e.withCredentials || E(h)) && e.xsrfCookieName ? w.read(e.xsrfCookieName) : void 0;
|
|
127
|
-
m && (a[e.xsrfHeaderName] = m);
|
|
128
|
-
}
|
|
129
|
-
"setRequestHeader" in c && l.forEach(a, function(e, t) {
|
|
130
|
-
void 0 === i && "content-type" === t.toLowerCase() ? delete a[t] : c.setRequestHeader(t, e);
|
|
131
|
-
}), l.isUndefined(e.withCredentials) || (c.withCredentials = !!e.withCredentials),
|
|
132
|
-
s && "json" !== s && (c.responseType = e.responseType), "function" == typeof e.onDownloadProgress && c.addEventListener("progress", e.onDownloadProgress),
|
|
133
|
-
"function" == typeof e.onUploadProgress && c.upload && c.upload.addEventListener("progress", e.onUploadProgress),
|
|
134
|
-
(e.cancelToken || e.signal) && (o = function(e) {
|
|
135
|
-
c && (n(!e || e && e.type ? new C("canceled") : e), c.abort(), c = null);
|
|
136
|
-
}, e.cancelToken && e.cancelToken.subscribe(o), e.signal && (e.signal.aborted ? o() : e.signal.addEventListener("abort", o))),
|
|
137
|
-
i || (i = null), c.send(i);
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
}), r = function(e, t) {
|
|
10
|
+
var e = function(e, t) {
|
|
141
11
|
return function() {
|
|
142
12
|
for (var n = new Array(arguments.length), r = 0; r < n.length; r++) n[r] = arguments[r];
|
|
143
13
|
return e.apply(t, n);
|
|
144
14
|
};
|
|
145
|
-
},
|
|
146
|
-
function
|
|
15
|
+
}, t = Object.prototype.toString;
|
|
16
|
+
function n(e) {
|
|
147
17
|
return Array.isArray(e);
|
|
148
18
|
}
|
|
149
|
-
function
|
|
19
|
+
function r(e) {
|
|
150
20
|
return void 0 === e;
|
|
151
21
|
}
|
|
152
|
-
function
|
|
153
|
-
return "[object ArrayBuffer]" ===
|
|
22
|
+
function o(e) {
|
|
23
|
+
return "[object ArrayBuffer]" === t.call(e);
|
|
154
24
|
}
|
|
155
|
-
function
|
|
25
|
+
function i(e) {
|
|
156
26
|
return null !== e && "object" == typeof e;
|
|
157
27
|
}
|
|
158
|
-
function
|
|
159
|
-
if ("[object Object]" !==
|
|
160
|
-
var
|
|
161
|
-
return null ===
|
|
28
|
+
function a(e) {
|
|
29
|
+
if ("[object Object]" !== t.call(e)) return !1;
|
|
30
|
+
var n = Object.getPrototypeOf(e);
|
|
31
|
+
return null === n || n === Object.prototype;
|
|
162
32
|
}
|
|
163
|
-
function
|
|
164
|
-
if (null != e) if ("object" != typeof e && (e = [ e ]),
|
|
33
|
+
function s(e, t) {
|
|
34
|
+
if (null != e) if ("object" != typeof e && (e = [ e ]), n(e)) for (var r = 0, o = e.length; r < o; r++) t.call(null, e[r], r, e); else for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.call(null, e[i], i, e);
|
|
165
35
|
}
|
|
166
|
-
var
|
|
167
|
-
isArray:
|
|
168
|
-
isArrayBuffer:
|
|
36
|
+
var u = {
|
|
37
|
+
isArray: n,
|
|
38
|
+
isArrayBuffer: o,
|
|
169
39
|
isBuffer: function(e) {
|
|
170
|
-
return null !== e && !
|
|
40
|
+
return null !== e && !r(e) && null !== e.constructor && !r(e.constructor) && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e);
|
|
171
41
|
},
|
|
172
42
|
isFormData: function(e) {
|
|
173
|
-
return "[object FormData]" ===
|
|
43
|
+
return "[object FormData]" === t.call(e);
|
|
174
44
|
},
|
|
175
45
|
isArrayBufferView: function(e) {
|
|
176
|
-
return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer &&
|
|
46
|
+
return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && o(e.buffer);
|
|
177
47
|
},
|
|
178
48
|
isString: function(e) {
|
|
179
49
|
return "string" == typeof e;
|
|
@@ -181,58 +51,59 @@
|
|
|
181
51
|
isNumber: function(e) {
|
|
182
52
|
return "number" == typeof e;
|
|
183
53
|
},
|
|
184
|
-
isObject:
|
|
185
|
-
isPlainObject:
|
|
186
|
-
isUndefined:
|
|
54
|
+
isObject: i,
|
|
55
|
+
isPlainObject: a,
|
|
56
|
+
isUndefined: r,
|
|
187
57
|
isDate: function(e) {
|
|
188
|
-
return "[object Date]" ===
|
|
58
|
+
return "[object Date]" === t.call(e);
|
|
189
59
|
},
|
|
190
60
|
isFile: function(e) {
|
|
191
|
-
return "[object File]" ===
|
|
61
|
+
return "[object File]" === t.call(e);
|
|
192
62
|
},
|
|
193
63
|
isBlob: function(e) {
|
|
194
|
-
return "[object Blob]" ===
|
|
64
|
+
return "[object Blob]" === t.call(e);
|
|
195
65
|
},
|
|
196
66
|
isStream: function(e) {
|
|
197
|
-
return
|
|
198
|
-
return "[object Function]" ===
|
|
67
|
+
return i(e) && function(e) {
|
|
68
|
+
return "[object Function]" === t.call(e);
|
|
199
69
|
}(e.pipe);
|
|
200
70
|
},
|
|
201
71
|
isURLSearchParams: function(e) {
|
|
202
|
-
return "[object URLSearchParams]" ===
|
|
72
|
+
return "[object URLSearchParams]" === t.call(e);
|
|
203
73
|
},
|
|
204
74
|
isStandardBrowserEnv: function() {
|
|
205
75
|
return ("undefined" == typeof navigator || "ReactNative" !== navigator.product && "NativeScript" !== navigator.product && "NS" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document;
|
|
206
76
|
},
|
|
207
|
-
forEach:
|
|
77
|
+
forEach: s,
|
|
208
78
|
merge: function e() {
|
|
209
79
|
var t = {};
|
|
210
|
-
function
|
|
211
|
-
|
|
80
|
+
function r(r, o) {
|
|
81
|
+
a(t[o]) && a(r) ? t[o] = e(t[o], r) : a(r) ? t[o] = e({}, r) : n(r) ? t[o] = r.slice() : t[o] = r;
|
|
212
82
|
}
|
|
213
|
-
for (var
|
|
83
|
+
for (var o = 0, i = arguments.length; o < i; o++) s(arguments[o], r);
|
|
214
84
|
return t;
|
|
215
85
|
},
|
|
216
|
-
extend: function(
|
|
217
|
-
return
|
|
218
|
-
|
|
219
|
-
}),
|
|
86
|
+
extend: function(t, n, r) {
|
|
87
|
+
return s(n, function(n, o) {
|
|
88
|
+
t[o] = r && "function" == typeof n ? e(n, r) : n;
|
|
89
|
+
}), t;
|
|
220
90
|
},
|
|
221
91
|
trim: function(e) {
|
|
222
92
|
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
|
|
223
93
|
}
|
|
224
94
|
};
|
|
225
|
-
function
|
|
95
|
+
function c(e) {
|
|
226
96
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
227
97
|
}
|
|
228
|
-
var
|
|
98
|
+
var f = function(e, t, n) {
|
|
229
99
|
if (!t) return e;
|
|
230
100
|
var r;
|
|
231
|
-
if (n) r = n(t); else if (
|
|
101
|
+
if (n) r = n(t); else if (u.isURLSearchParams(t)) r = t.toString(); else {
|
|
232
102
|
var o = [];
|
|
233
|
-
|
|
234
|
-
null != e && (
|
|
235
|
-
|
|
103
|
+
u.forEach(t, function(e, t) {
|
|
104
|
+
null != e && (u.isArray(e) ? t += "[]" : e = [ e ], u.forEach(e, function(e) {
|
|
105
|
+
u.isDate(e) ? e = e.toISOString() : u.isObject(e) && (e = JSON.stringify(e)),
|
|
106
|
+
o.push(c(t) + "=" + c(e));
|
|
236
107
|
}));
|
|
237
108
|
}), r = o.join("&");
|
|
238
109
|
}
|
|
@@ -241,31 +112,31 @@
|
|
|
241
112
|
-1 !== i && (e = e.slice(0, i)), e += (-1 === e.indexOf("?") ? "?" : "&") + r;
|
|
242
113
|
}
|
|
243
114
|
return e;
|
|
244
|
-
},
|
|
245
|
-
function
|
|
115
|
+
}, l = {};
|
|
116
|
+
function p() {
|
|
246
117
|
this.handlers = [];
|
|
247
118
|
}
|
|
248
|
-
|
|
119
|
+
p.prototype.use = function(e, t, n) {
|
|
249
120
|
return this.handlers.push({
|
|
250
121
|
fulfilled: e,
|
|
251
122
|
rejected: t,
|
|
252
123
|
synchronous: !!n && n.synchronous,
|
|
253
124
|
runWhen: n ? n.runWhen : null
|
|
254
125
|
}), this.handlers.length - 1;
|
|
255
|
-
},
|
|
126
|
+
}, p.prototype.eject = function(e) {
|
|
256
127
|
this.handlers[e] && (this.handlers[e] = null);
|
|
257
|
-
},
|
|
258
|
-
|
|
128
|
+
}, p.prototype.forEach = function(e) {
|
|
129
|
+
u.forEach(this.handlers, function(t) {
|
|
259
130
|
null !== t && e(t);
|
|
260
131
|
});
|
|
261
|
-
},
|
|
262
|
-
var
|
|
263
|
-
|
|
132
|
+
}, l = p;
|
|
133
|
+
var d = function(e, t) {
|
|
134
|
+
u.forEach(e, function(n, r) {
|
|
264
135
|
r !== t && r.toUpperCase() === t.toUpperCase() && (e[t] = n, delete e[r]);
|
|
265
136
|
});
|
|
266
|
-
},
|
|
267
|
-
return e.config = t, n && (e.code = n), e.request = r, e.response = o,
|
|
268
|
-
e.toJSON = function() {
|
|
137
|
+
}, h = function(e, t, n, r, o) {
|
|
138
|
+
return e.config = t, n && (e.code = n), e.request = r, e.response = o,
|
|
139
|
+
e.isAxiosError = !0, e.toJSON = function() {
|
|
269
140
|
return {
|
|
270
141
|
message: this.message,
|
|
271
142
|
name: this.name,
|
|
@@ -280,18 +151,19 @@
|
|
|
280
151
|
status: this.response && this.response.status ? this.response.status : null
|
|
281
152
|
};
|
|
282
153
|
}, e;
|
|
283
|
-
},
|
|
154
|
+
}, g = {
|
|
155
|
+
silentJSONParsing: !0,
|
|
156
|
+
forcedJSONParsing: !0,
|
|
157
|
+
clarifyTimeoutError: !1
|
|
158
|
+
}, m = function(e, t, n, r, o) {
|
|
284
159
|
var i = new Error(e);
|
|
285
|
-
return
|
|
286
|
-
},
|
|
287
|
-
var r = n.config.validateStatus;
|
|
288
|
-
n.status && r && !r(n.status) ? t(y("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n);
|
|
289
|
-
}, w = l.isStandardBrowserEnv() ? {
|
|
160
|
+
return h(i, t, n, r, o);
|
|
161
|
+
}, v = u.isStandardBrowserEnv() ? {
|
|
290
162
|
write: function(e, t, n, r, o, i) {
|
|
291
163
|
var a = [];
|
|
292
|
-
a.push(e + "=" + encodeURIComponent(t)),
|
|
293
|
-
|
|
294
|
-
document.cookie = a.join("; ");
|
|
164
|
+
a.push(e + "=" + encodeURIComponent(t)), u.isNumber(n) && a.push("expires=" + new Date(n).toGMTString()),
|
|
165
|
+
u.isString(r) && a.push("path=" + r), u.isString(o) && a.push("domain=" + o),
|
|
166
|
+
!0 === i && a.push("secure"), document.cookie = a.join("; ");
|
|
295
167
|
},
|
|
296
168
|
read: function(e) {
|
|
297
169
|
var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
@@ -306,20 +178,7 @@
|
|
|
306
178
|
return null;
|
|
307
179
|
},
|
|
308
180
|
remove: function() {}
|
|
309
|
-
},
|
|
310
|
-
return e && !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t) ? function(e, t) {
|
|
311
|
-
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
312
|
-
}(e, t) : t;
|
|
313
|
-
}, T = [ "age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent" ], k = function(e) {
|
|
314
|
-
var t, n, r, o = {};
|
|
315
|
-
return e ? (l.forEach(e.split("\n"), function(e) {
|
|
316
|
-
if (r = e.indexOf(":"), t = l.trim(e.substr(0, r)).toLowerCase(), n = l.trim(e.substr(r + 1)),
|
|
317
|
-
t) {
|
|
318
|
-
if (o[t] && T.indexOf(t) >= 0) return;
|
|
319
|
-
o[t] = "set-cookie" === t ? (o[t] ? o[t] : []).concat([ n ]) : o[t] ? o[t] + ", " + n : n;
|
|
320
|
-
}
|
|
321
|
-
}), o) : o;
|
|
322
|
-
}, E = l.isStandardBrowserEnv() ? function() {
|
|
181
|
+
}, y = [ "age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent" ], b = u.isStandardBrowserEnv() ? function() {
|
|
323
182
|
var e, t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");
|
|
324
183
|
function r(e) {
|
|
325
184
|
var r = e;
|
|
@@ -336,142 +195,272 @@
|
|
|
336
195
|
};
|
|
337
196
|
}
|
|
338
197
|
return e = r(window.location.href), function(t) {
|
|
339
|
-
var n =
|
|
198
|
+
var n = u.isString(t) ? r(t) : t;
|
|
340
199
|
return n.protocol === e.protocol && n.host === e.host;
|
|
341
200
|
};
|
|
342
201
|
}() : function() {
|
|
343
202
|
return !0;
|
|
344
|
-
},
|
|
345
|
-
function
|
|
203
|
+
}, w = {};
|
|
204
|
+
function S(e) {
|
|
346
205
|
this.message = e;
|
|
347
206
|
}
|
|
348
|
-
|
|
207
|
+
S.prototype.toString = function() {
|
|
349
208
|
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
350
|
-
},
|
|
351
|
-
var
|
|
352
|
-
|
|
209
|
+
}, S.prototype.__CANCEL__ = !0, w = S;
|
|
210
|
+
var T, k, E, C = function(e) {
|
|
211
|
+
return new Promise(function(t, n) {
|
|
212
|
+
var r, o = e.data, i = e.headers, a = e.responseType;
|
|
213
|
+
function s() {
|
|
214
|
+
e.cancelToken && e.cancelToken.unsubscribe(r), e.signal && e.signal.removeEventListener("abort", r);
|
|
215
|
+
}
|
|
216
|
+
u.isFormData(o) && delete i["Content-Type"];
|
|
217
|
+
var c = new XMLHttpRequest();
|
|
218
|
+
if (e.auth) {
|
|
219
|
+
var l = e.auth.username || "", p = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
220
|
+
i.Authorization = "Basic " + btoa(l + ":" + p);
|
|
221
|
+
}
|
|
222
|
+
var d, h, S = (d = e.baseURL, h = e.url, d && !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(h) ? function(e, t) {
|
|
223
|
+
return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
224
|
+
}(d, h) : h);
|
|
225
|
+
function T() {
|
|
226
|
+
if (c) {
|
|
227
|
+
var r = "getAllResponseHeaders" in c ? (o = c.getAllResponseHeaders(),
|
|
228
|
+
p = {}, o ? (u.forEach(o.split("\n"), function(e) {
|
|
229
|
+
if (l = e.indexOf(":"), i = u.trim(e.substr(0, l)).toLowerCase(),
|
|
230
|
+
f = u.trim(e.substr(l + 1)), i) {
|
|
231
|
+
if (p[i] && y.indexOf(i) >= 0) return;
|
|
232
|
+
p[i] = "set-cookie" === i ? (p[i] ? p[i] : []).concat([ f ]) : p[i] ? p[i] + ", " + f : f;
|
|
233
|
+
}
|
|
234
|
+
}), p) : p) : null;
|
|
235
|
+
(function(e, t, n) {
|
|
236
|
+
var r = n.config.validateStatus;
|
|
237
|
+
n.status && r && !r(n.status) ? t(m("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n);
|
|
238
|
+
})(function(e) {
|
|
239
|
+
t(e), s();
|
|
240
|
+
}, function(e) {
|
|
241
|
+
n(e), s();
|
|
242
|
+
}, {
|
|
243
|
+
data: a && "text" !== a && "json" !== a ? c.response : c.responseText,
|
|
244
|
+
status: c.status,
|
|
245
|
+
statusText: c.statusText,
|
|
246
|
+
headers: r,
|
|
247
|
+
config: e,
|
|
248
|
+
request: c
|
|
249
|
+
}), c = null;
|
|
250
|
+
}
|
|
251
|
+
var o, i, f, l, p;
|
|
252
|
+
}
|
|
253
|
+
if (c.open(e.method.toUpperCase(), f(S, e.params, e.paramsSerializer), !0),
|
|
254
|
+
c.timeout = e.timeout, "onloadend" in c ? c.onloadend = T : c.onreadystatechange = function() {
|
|
255
|
+
c && 4 === c.readyState && (0 !== c.status || c.responseURL && 0 === c.responseURL.indexOf("file:")) && setTimeout(T);
|
|
256
|
+
}, c.onabort = function() {
|
|
257
|
+
c && (n(m("Request aborted", e, "ECONNABORTED", c)), c = null);
|
|
258
|
+
}, c.onerror = function() {
|
|
259
|
+
n(m("Network Error", e, null, c)), c = null;
|
|
260
|
+
}, c.ontimeout = function() {
|
|
261
|
+
var t = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded", r = e.transitional || g;
|
|
262
|
+
e.timeoutErrorMessage && (t = e.timeoutErrorMessage), n(m(t, e, r.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", c)),
|
|
263
|
+
c = null;
|
|
264
|
+
}, u.isStandardBrowserEnv()) {
|
|
265
|
+
var k = (e.withCredentials || b(S)) && e.xsrfCookieName ? v.read(e.xsrfCookieName) : void 0;
|
|
266
|
+
k && (i[e.xsrfHeaderName] = k);
|
|
267
|
+
}
|
|
268
|
+
"setRequestHeader" in c && u.forEach(i, function(e, t) {
|
|
269
|
+
void 0 === o && "content-type" === t.toLowerCase() ? delete i[t] : c.setRequestHeader(t, e);
|
|
270
|
+
}), u.isUndefined(e.withCredentials) || (c.withCredentials = !!e.withCredentials),
|
|
271
|
+
a && "json" !== a && (c.responseType = e.responseType), "function" == typeof e.onDownloadProgress && c.addEventListener("progress", e.onDownloadProgress),
|
|
272
|
+
"function" == typeof e.onUploadProgress && c.upload && c.upload.addEventListener("progress", e.onUploadProgress),
|
|
273
|
+
(e.cancelToken || e.signal) && (r = function(e) {
|
|
274
|
+
c && (n(!e || e && e.type ? new w("canceled") : e), c.abort(),
|
|
275
|
+
c = null);
|
|
276
|
+
}, e.cancelToken && e.cancelToken.subscribe(r), e.signal && (e.signal.aborted ? r() : e.signal.addEventListener("abort", r))),
|
|
277
|
+
o || (o = null), c.send(o);
|
|
278
|
+
});
|
|
279
|
+
}, j = T = {};
|
|
280
|
+
function O() {
|
|
353
281
|
throw new Error("setTimeout has not been defined");
|
|
354
282
|
}
|
|
355
|
-
function
|
|
283
|
+
function _() {
|
|
356
284
|
throw new Error("clearTimeout has not been defined");
|
|
357
285
|
}
|
|
358
|
-
function
|
|
359
|
-
if (
|
|
360
|
-
if ((
|
|
286
|
+
function x(e) {
|
|
287
|
+
if (k === setTimeout) return setTimeout(e, 0);
|
|
288
|
+
if ((k === O || !k) && setTimeout) return k = setTimeout, setTimeout(e, 0);
|
|
361
289
|
try {
|
|
362
|
-
return
|
|
290
|
+
return k(e, 0);
|
|
363
291
|
} catch (t) {
|
|
364
292
|
try {
|
|
365
|
-
return
|
|
293
|
+
return k.call(null, e, 0);
|
|
366
294
|
} catch (t) {
|
|
367
|
-
return
|
|
295
|
+
return k.call(this, e, 0);
|
|
368
296
|
}
|
|
369
297
|
}
|
|
370
298
|
}
|
|
371
299
|
!function() {
|
|
372
300
|
try {
|
|
373
|
-
|
|
301
|
+
k = "function" == typeof setTimeout ? setTimeout : O;
|
|
374
302
|
} catch (e) {
|
|
375
|
-
|
|
303
|
+
k = O;
|
|
376
304
|
}
|
|
377
305
|
try {
|
|
378
|
-
|
|
306
|
+
E = "function" == typeof clearTimeout ? clearTimeout : _;
|
|
379
307
|
} catch (e) {
|
|
380
|
-
|
|
308
|
+
E = _;
|
|
381
309
|
}
|
|
382
310
|
}();
|
|
383
|
-
var
|
|
384
|
-
function
|
|
385
|
-
|
|
311
|
+
var P, A = [], N = !1, R = -1;
|
|
312
|
+
function U() {
|
|
313
|
+
N && P && (N = !1, P.length ? A = P.concat(A) : R = -1, A.length && L());
|
|
386
314
|
}
|
|
387
|
-
function
|
|
388
|
-
if (!
|
|
389
|
-
var e =
|
|
390
|
-
|
|
391
|
-
for (var t =
|
|
392
|
-
for (
|
|
393
|
-
|
|
315
|
+
function L() {
|
|
316
|
+
if (!N) {
|
|
317
|
+
var e = x(U);
|
|
318
|
+
N = !0;
|
|
319
|
+
for (var t = A.length; t; ) {
|
|
320
|
+
for (P = A, A = []; ++R < t; ) P && P[R].run();
|
|
321
|
+
R = -1, t = A.length;
|
|
394
322
|
}
|
|
395
|
-
|
|
396
|
-
if (
|
|
397
|
-
if ((
|
|
323
|
+
P = null, N = !1, function(e) {
|
|
324
|
+
if (E === clearTimeout) return clearTimeout(e);
|
|
325
|
+
if ((E === _ || !E) && clearTimeout) return E = clearTimeout,
|
|
326
|
+
clearTimeout(e);
|
|
398
327
|
try {
|
|
399
|
-
|
|
328
|
+
E(e);
|
|
400
329
|
} catch (t) {
|
|
401
330
|
try {
|
|
402
|
-
return
|
|
331
|
+
return E.call(null, e);
|
|
403
332
|
} catch (t) {
|
|
404
|
-
return
|
|
333
|
+
return E.call(this, e);
|
|
405
334
|
}
|
|
406
335
|
}
|
|
407
336
|
}(e);
|
|
408
337
|
}
|
|
409
338
|
}
|
|
410
|
-
function
|
|
339
|
+
function B(e, t) {
|
|
411
340
|
this.fun = e, this.array = t;
|
|
412
341
|
}
|
|
413
|
-
function
|
|
414
|
-
|
|
342
|
+
function q() {}
|
|
343
|
+
j.nextTick = function(e) {
|
|
415
344
|
var t = new Array(arguments.length - 1);
|
|
416
345
|
if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
|
|
417
|
-
|
|
418
|
-
},
|
|
346
|
+
A.push(new B(e, t)), 1 !== A.length || N || x(L);
|
|
347
|
+
}, B.prototype.run = function() {
|
|
419
348
|
this.fun.apply(null, this.array);
|
|
420
|
-
},
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
349
|
+
}, j.title = "browser", j.browser = !0, j.env = {}, j.argv = [], j.version = "",
|
|
350
|
+
j.versions = {}, j.on = q, j.addListener = q, j.once = q, j.off = q, j.removeListener = q,
|
|
351
|
+
j.removeAllListeners = q, j.emit = q, j.prependListener = q, j.prependOnceListener = q,
|
|
352
|
+
j.listeners = function(e) {
|
|
424
353
|
return [];
|
|
425
|
-
},
|
|
354
|
+
}, j.binding = function(e) {
|
|
426
355
|
throw new Error("process.binding is not supported");
|
|
427
|
-
},
|
|
356
|
+
}, j.cwd = function() {
|
|
428
357
|
return "/";
|
|
429
|
-
},
|
|
358
|
+
}, j.chdir = function(e) {
|
|
430
359
|
throw new Error("process.chdir is not supported");
|
|
431
|
-
},
|
|
360
|
+
}, j.umask = function() {
|
|
432
361
|
return 0;
|
|
433
362
|
};
|
|
434
|
-
var
|
|
435
|
-
|
|
436
|
-
|
|
363
|
+
var z = {};
|
|
364
|
+
(function(e) {
|
|
365
|
+
(function() {
|
|
366
|
+
"use strict";
|
|
367
|
+
var t = {
|
|
368
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
369
|
+
};
|
|
370
|
+
function n(e, t) {
|
|
371
|
+
!u.isUndefined(e) && u.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t);
|
|
372
|
+
}
|
|
373
|
+
var r, o = {
|
|
374
|
+
transitional: g,
|
|
375
|
+
adapter: (("undefined" != typeof XMLHttpRequest || void 0 !== e && "[object process]" === Object.prototype.toString.call(e)) && (r = C),
|
|
376
|
+
r),
|
|
377
|
+
transformRequest: [ function(e, t) {
|
|
378
|
+
return d(t, "Accept"), d(t, "Content-Type"), u.isFormData(e) || u.isArrayBuffer(e) || u.isBuffer(e) || u.isStream(e) || u.isFile(e) || u.isBlob(e) ? e : u.isArrayBufferView(e) ? e.buffer : u.isURLSearchParams(e) ? (n(t, "application/x-www-form-urlencoded;charset=utf-8"),
|
|
379
|
+
e.toString()) : u.isObject(e) || t && "application/json" === t["Content-Type"] ? (n(t, "application/json"),
|
|
380
|
+
function(e, t, n) {
|
|
381
|
+
if (u.isString(e)) try {
|
|
382
|
+
return (0, JSON.parse)(e), u.trim(e);
|
|
383
|
+
} catch (r) {
|
|
384
|
+
if ("SyntaxError" !== r.name) throw r;
|
|
385
|
+
}
|
|
386
|
+
return (0, JSON.stringify)(e);
|
|
387
|
+
}(e)) : e;
|
|
388
|
+
} ],
|
|
389
|
+
transformResponse: [ function(e) {
|
|
390
|
+
var t = this.transitional || o.transitional, n = t && t.silentJSONParsing, r = t && t.forcedJSONParsing, i = !n && "json" === this.responseType;
|
|
391
|
+
if (i || r && u.isString(e) && e.length) try {
|
|
392
|
+
return JSON.parse(e);
|
|
393
|
+
} catch (a) {
|
|
394
|
+
if (i) {
|
|
395
|
+
if ("SyntaxError" === a.name) throw h(a, this, "E_JSON_PARSE");
|
|
396
|
+
throw a;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return e;
|
|
400
|
+
} ],
|
|
401
|
+
timeout: 0,
|
|
402
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
403
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
404
|
+
maxContentLength: -1,
|
|
405
|
+
maxBodyLength: -1,
|
|
406
|
+
validateStatus: function(e) {
|
|
407
|
+
return e >= 200 && e < 300;
|
|
408
|
+
},
|
|
409
|
+
headers: {
|
|
410
|
+
common: {
|
|
411
|
+
Accept: "application/json, text/plain, */*"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
u.forEach([ "delete", "get", "head" ], function(e) {
|
|
416
|
+
o.headers[e] = {};
|
|
417
|
+
}), u.forEach([ "post", "put", "patch" ], function(e) {
|
|
418
|
+
o.headers[e] = u.merge(t);
|
|
419
|
+
}), z = o;
|
|
420
|
+
}).call(this);
|
|
421
|
+
}).call(this, T);
|
|
422
|
+
var D = function(e, t, n) {
|
|
423
|
+
var r = this || z;
|
|
424
|
+
return u.forEach(n, function(n) {
|
|
437
425
|
e = n.call(r, e, t);
|
|
438
426
|
}), e;
|
|
439
|
-
},
|
|
427
|
+
}, J = function(e) {
|
|
440
428
|
return !(!e || !e.__CANCEL__);
|
|
441
|
-
}
|
|
442
|
-
function
|
|
443
|
-
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new
|
|
429
|
+
};
|
|
430
|
+
function F(e) {
|
|
431
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted) throw new w("canceled");
|
|
444
432
|
}
|
|
445
|
-
var
|
|
446
|
-
return
|
|
447
|
-
e.headers =
|
|
448
|
-
|
|
433
|
+
var I, V = function(e) {
|
|
434
|
+
return F(e), e.headers = e.headers || {}, e.data = D.call(e, e.data, e.headers, e.transformRequest),
|
|
435
|
+
e.headers = u.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers),
|
|
436
|
+
u.forEach([ "delete", "get", "head", "post", "put", "patch", "common" ], function(t) {
|
|
449
437
|
delete e.headers[t];
|
|
450
|
-
}), (e.adapter ||
|
|
451
|
-
return
|
|
438
|
+
}), (e.adapter || z.adapter)(e).then(function(t) {
|
|
439
|
+
return F(e), t.data = D.call(e, t.data, t.headers, e.transformResponse),
|
|
440
|
+
t;
|
|
452
441
|
}, function(t) {
|
|
453
|
-
return
|
|
442
|
+
return J(t) || (F(e), t && t.response && (t.response.data = D.call(e, t.response.data, t.response.headers, e.transformResponse))),
|
|
454
443
|
Promise.reject(t);
|
|
455
444
|
});
|
|
456
|
-
},
|
|
445
|
+
}, H = function(e, t) {
|
|
457
446
|
t = t || {};
|
|
458
447
|
var n = {};
|
|
459
448
|
function r(e, t) {
|
|
460
|
-
return
|
|
449
|
+
return u.isPlainObject(e) && u.isPlainObject(t) ? u.merge(e, t) : u.isPlainObject(t) ? u.merge({}, t) : u.isArray(t) ? t.slice() : t;
|
|
461
450
|
}
|
|
462
451
|
function o(n) {
|
|
463
|
-
return
|
|
452
|
+
return u.isUndefined(t[n]) ? u.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(e[n], t[n]);
|
|
464
453
|
}
|
|
465
454
|
function i(e) {
|
|
466
|
-
if (!
|
|
455
|
+
if (!u.isUndefined(t[e])) return r(void 0, t[e]);
|
|
467
456
|
}
|
|
468
457
|
function a(n) {
|
|
469
|
-
return
|
|
458
|
+
return u.isUndefined(t[n]) ? u.isUndefined(e[n]) ? void 0 : r(void 0, e[n]) : r(void 0, t[n]);
|
|
470
459
|
}
|
|
471
460
|
function s(n) {
|
|
472
461
|
return n in t ? r(e[n], t[n]) : n in e ? r(void 0, e[n]) : void 0;
|
|
473
462
|
}
|
|
474
|
-
var
|
|
463
|
+
var c = {
|
|
475
464
|
url: i,
|
|
476
465
|
method: i,
|
|
477
466
|
data: i,
|
|
@@ -499,28 +488,28 @@
|
|
|
499
488
|
responseEncoding: a,
|
|
500
489
|
validateStatus: s
|
|
501
490
|
};
|
|
502
|
-
return
|
|
503
|
-
var t =
|
|
504
|
-
|
|
491
|
+
return u.forEach(Object.keys(e).concat(Object.keys(t)), function(e) {
|
|
492
|
+
var t = c[e] || o, r = t(e);
|
|
493
|
+
u.isUndefined(r) && t !== s || (n[e] = r);
|
|
505
494
|
}), n;
|
|
506
|
-
},
|
|
495
|
+
}, M = "0.26.1", $ = M, G = {};
|
|
507
496
|
[ "object", "boolean", "number", "function", "string", "symbol" ].forEach(function(e, t) {
|
|
508
|
-
|
|
497
|
+
G[e] = function(n) {
|
|
509
498
|
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
510
499
|
};
|
|
511
500
|
});
|
|
512
|
-
var
|
|
513
|
-
|
|
501
|
+
var X = {};
|
|
502
|
+
G.transitional = function(e, t, n) {
|
|
514
503
|
function r(e, t) {
|
|
515
|
-
return "[Axios v" +
|
|
504
|
+
return "[Axios v" + $ + "] Transitional option '" + e + "'" + t + (n ? ". " + n : "");
|
|
516
505
|
}
|
|
517
506
|
return function(n, o, i) {
|
|
518
507
|
if (!1 === e) throw new Error(r(o, " has been removed" + (t ? " in " + t : "")));
|
|
519
|
-
return t && !
|
|
508
|
+
return t && !X[o] && (X[o] = !0, console.warn(r(o, " has been deprecated since v" + t + " and will be removed in the near future"))),
|
|
520
509
|
!e || e(n, o, i);
|
|
521
510
|
};
|
|
522
511
|
};
|
|
523
|
-
var
|
|
512
|
+
var W = {}, K = (I = {
|
|
524
513
|
assertOptions: function(e, t, n) {
|
|
525
514
|
if ("object" != typeof e) throw new TypeError("options must be an object");
|
|
526
515
|
for (var r = Object.keys(e), o = r.length; o-- > 0; ) {
|
|
@@ -531,22 +520,21 @@
|
|
|
531
520
|
} else if (!0 !== n) throw Error("Unknown option " + i);
|
|
532
521
|
}
|
|
533
522
|
},
|
|
534
|
-
validators:
|
|
523
|
+
validators: G
|
|
535
524
|
}).validators;
|
|
536
|
-
function
|
|
525
|
+
function Y(e) {
|
|
537
526
|
this.defaults = e, this.interceptors = {
|
|
538
|
-
request: new
|
|
539
|
-
response: new
|
|
527
|
+
request: new l(),
|
|
528
|
+
response: new l()
|
|
540
529
|
};
|
|
541
530
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
(t = W(this.defaults, t)).method ? t.method = t.method.toLowerCase() : this.defaults.method ? t.method = this.defaults.method.toLowerCase() : t.method = "get";
|
|
531
|
+
Y.prototype.request = function(e, t) {
|
|
532
|
+
"string" == typeof e ? (t = t || {}).url = e : t = e || {}, (t = H(this.defaults, t)).method ? t.method = t.method.toLowerCase() : this.defaults.method ? t.method = this.defaults.method.toLowerCase() : t.method = "get";
|
|
545
533
|
var n = t.transitional;
|
|
546
|
-
void 0 !== n &&
|
|
547
|
-
silentJSONParsing:
|
|
548
|
-
forcedJSONParsing:
|
|
549
|
-
clarifyTimeoutError:
|
|
534
|
+
void 0 !== n && I.assertOptions(n, {
|
|
535
|
+
silentJSONParsing: K.transitional(K.boolean),
|
|
536
|
+
forcedJSONParsing: K.transitional(K.boolean),
|
|
537
|
+
clarifyTimeoutError: K.transitional(K.boolean)
|
|
550
538
|
}, !1);
|
|
551
539
|
var r = [], o = !0;
|
|
552
540
|
this.interceptors.request.forEach(function(e) {
|
|
@@ -557,7 +545,7 @@
|
|
|
557
545
|
if (this.interceptors.response.forEach(function(e) {
|
|
558
546
|
a.push(e.fulfilled, e.rejected);
|
|
559
547
|
}), !o) {
|
|
560
|
-
var s = [
|
|
548
|
+
var s = [ V, void 0 ];
|
|
561
549
|
for (Array.prototype.unshift.apply(s, r), s = s.concat(a), i = Promise.resolve(t); s.length; ) i = i.then(s.shift(), s.shift());
|
|
562
550
|
return i;
|
|
563
551
|
}
|
|
@@ -571,34 +559,33 @@
|
|
|
571
559
|
}
|
|
572
560
|
}
|
|
573
561
|
try {
|
|
574
|
-
i =
|
|
562
|
+
i = V(u);
|
|
575
563
|
} catch (l) {
|
|
576
564
|
return Promise.reject(l);
|
|
577
565
|
}
|
|
578
566
|
for (;a.length; ) i = i.then(a.shift(), a.shift());
|
|
579
567
|
return i;
|
|
580
|
-
},
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
return this.request(W(n || {}, {
|
|
568
|
+
}, Y.prototype.getUri = function(e) {
|
|
569
|
+
return e = H(this.defaults, e), f(e.url, e.params, e.paramsSerializer).replace(/^\?/, "");
|
|
570
|
+
}, u.forEach([ "delete", "get", "head", "options" ], function(e) {
|
|
571
|
+
Y.prototype[e] = function(t, n) {
|
|
572
|
+
return this.request(H(n || {}, {
|
|
586
573
|
method: e,
|
|
587
574
|
url: t,
|
|
588
575
|
data: (n || {}).data
|
|
589
576
|
}));
|
|
590
577
|
};
|
|
591
|
-
}),
|
|
592
|
-
|
|
593
|
-
return this.request(
|
|
578
|
+
}), u.forEach([ "post", "put", "patch" ], function(e) {
|
|
579
|
+
Y.prototype[e] = function(t, n, r) {
|
|
580
|
+
return this.request(H(r || {}, {
|
|
594
581
|
method: e,
|
|
595
582
|
url: t,
|
|
596
583
|
data: n
|
|
597
584
|
}));
|
|
598
585
|
};
|
|
599
|
-
}),
|
|
600
|
-
var
|
|
601
|
-
function
|
|
586
|
+
}), W = Y;
|
|
587
|
+
var Q;
|
|
588
|
+
function Z(e) {
|
|
602
589
|
if ("function" != typeof e) throw new TypeError("executor must be a function.");
|
|
603
590
|
var t;
|
|
604
591
|
this.promise = new Promise(function(e) {
|
|
@@ -619,44 +606,44 @@
|
|
|
619
606
|
n.unsubscribe(t);
|
|
620
607
|
}, r;
|
|
621
608
|
}, e(function(e) {
|
|
622
|
-
n.reason || (n.reason = new
|
|
609
|
+
n.reason || (n.reason = new w(e), t(n.reason));
|
|
623
610
|
});
|
|
624
611
|
}
|
|
625
|
-
|
|
612
|
+
Z.prototype.throwIfRequested = function() {
|
|
626
613
|
if (this.reason) throw this.reason;
|
|
627
|
-
},
|
|
614
|
+
}, Z.prototype.subscribe = function(e) {
|
|
628
615
|
this.reason ? e(this.reason) : this._listeners ? this._listeners.push(e) : this._listeners = [ e ];
|
|
629
|
-
},
|
|
616
|
+
}, Z.prototype.unsubscribe = function(e) {
|
|
630
617
|
if (this._listeners) {
|
|
631
618
|
var t = this._listeners.indexOf(e);
|
|
632
619
|
-1 !== t && this._listeners.splice(t, 1);
|
|
633
620
|
}
|
|
634
|
-
},
|
|
621
|
+
}, Z.source = function() {
|
|
635
622
|
var e;
|
|
636
623
|
return {
|
|
637
|
-
token: new
|
|
624
|
+
token: new Z(function(t) {
|
|
638
625
|
e = t;
|
|
639
626
|
}),
|
|
640
627
|
cancel: e
|
|
641
628
|
};
|
|
642
|
-
},
|
|
643
|
-
var
|
|
644
|
-
var
|
|
645
|
-
return
|
|
646
|
-
return
|
|
629
|
+
}, Q = Z;
|
|
630
|
+
var ee = {}, te = function t(n) {
|
|
631
|
+
var r = new W(n), o = e(W.prototype.request, r);
|
|
632
|
+
return u.extend(o, W.prototype, r), u.extend(o, r), o.create = function(e) {
|
|
633
|
+
return t(H(n, e));
|
|
647
634
|
}, o;
|
|
648
|
-
}(
|
|
649
|
-
|
|
650
|
-
|
|
635
|
+
}(z);
|
|
636
|
+
te.Axios = W, te.Cancel = w, te.CancelToken = Q, te.isCancel = J, te.VERSION = M,
|
|
637
|
+
te.all = function(e) {
|
|
651
638
|
return Promise.all(e);
|
|
652
|
-
},
|
|
639
|
+
}, te.spread = function(e) {
|
|
653
640
|
return function(t) {
|
|
654
641
|
return e.apply(null, t);
|
|
655
642
|
};
|
|
656
|
-
},
|
|
657
|
-
return
|
|
658
|
-
}, (
|
|
659
|
-
var
|
|
643
|
+
}, te.isAxiosError = function(e) {
|
|
644
|
+
return u.isObject(e) && !0 === e.isAxiosError;
|
|
645
|
+
}, (ee = te).default = te;
|
|
646
|
+
var ne = ee, re = {}, oe = {};
|
|
660
647
|
return function(e) {
|
|
661
648
|
(function() {
|
|
662
649
|
"use strict";
|
|
@@ -709,7 +696,8 @@
|
|
|
709
696
|
if (e) {
|
|
710
697
|
if ("string" == typeof e) return r(e, t);
|
|
711
698
|
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
712
|
-
return "Object" === n && e.constructor && (n = e.constructor.name),
|
|
699
|
+
return "Object" === n && e.constructor && (n = e.constructor.name),
|
|
700
|
+
"Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? r(e, t) : void 0;
|
|
713
701
|
}
|
|
714
702
|
}
|
|
715
703
|
function r(e, t) {
|
|
@@ -730,8 +718,8 @@
|
|
|
730
718
|
function a(e, t) {
|
|
731
719
|
for (var n = 0; n < t.length; n++) {
|
|
732
720
|
var r = t[n];
|
|
733
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0,
|
|
734
|
-
Object.defineProperty(e, r.key, r);
|
|
721
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0,
|
|
722
|
+
"value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
|
|
735
723
|
}
|
|
736
724
|
}
|
|
737
725
|
function s(e, t, n) {
|
|
@@ -739,10 +727,10 @@
|
|
|
739
727
|
writable: !1
|
|
740
728
|
}), e;
|
|
741
729
|
}
|
|
742
|
-
Object.defineProperty(
|
|
730
|
+
Object.defineProperty(oe, "__esModule", {
|
|
743
731
|
value: !0
|
|
744
|
-
}),
|
|
745
|
-
|
|
732
|
+
}), oe.varsnap = oe.clientName = oe.version = void 0;
|
|
733
|
+
oe.version = "1.8.3", oe.clientName = "javascript." + oe.version;
|
|
746
734
|
var u = {
|
|
747
735
|
varsnap: !0,
|
|
748
736
|
env: "development",
|
|
@@ -764,8 +752,8 @@
|
|
|
764
752
|
}, {
|
|
765
753
|
key: "setConfig",
|
|
766
754
|
value: function(e, t, n) {
|
|
767
|
-
return "varsnap" === t && ("string" == typeof n && (n = "true" === n),
|
|
768
|
-
"env" !== t && "producerToken" !== t && "consumerToken" !== t && "branch" !== t || (e[t] = n),
|
|
755
|
+
return "varsnap" === t && ("string" == typeof n && (n = "true" === n),
|
|
756
|
+
e[t] = n), "env" !== t && "producerToken" !== t && "consumerToken" !== t && "branch" !== t || (e[t] = n),
|
|
769
757
|
"logger" === t && (e[t] = n), e;
|
|
770
758
|
}
|
|
771
759
|
}, {
|
|
@@ -773,7 +761,7 @@
|
|
|
773
761
|
value: function(e, t) {
|
|
774
762
|
var n = "";
|
|
775
763
|
return n = "" !== t && void 0 !== t ? t : (n = (n = e.toString().split("{")[0]).replace(/^\s+|\s+$/g, "")).replace(/,\s+/g, ","),
|
|
776
|
-
"javascript." +
|
|
764
|
+
"javascript." + oe.version + "." + n;
|
|
777
765
|
}
|
|
778
766
|
}, {
|
|
779
767
|
key: "ajax",
|
|
@@ -787,8 +775,8 @@
|
|
|
787
775
|
data: new URLSearchParams(n).toString(),
|
|
788
776
|
responseType: "json"
|
|
789
777
|
};
|
|
790
|
-
return t.isNode() && r.headers && (r.headers["User-Agent"] = "varsnap.js"),
|
|
791
|
-
|
|
778
|
+
return t.isNode() && r.headers && (r.headers["User-Agent"] = "varsnap.js"),
|
|
779
|
+
(0, ne.default)(r).then(function(e) {
|
|
792
780
|
return e.data;
|
|
793
781
|
}).catch(function(e) {
|
|
794
782
|
return e;
|
|
@@ -847,7 +835,7 @@
|
|
|
847
835
|
return n ? new Promise(function(e) {
|
|
848
836
|
return e(n);
|
|
849
837
|
}) : t.isNode() ? new Promise(function(e) {
|
|
850
|
-
(0,
|
|
838
|
+
(0, re.exec)("git rev-parse --abbrev-ref HEAD", function(t, n) {
|
|
851
839
|
return e(n.trim());
|
|
852
840
|
});
|
|
853
841
|
}) : new Promise(function(e) {
|
|
@@ -868,7 +856,8 @@
|
|
|
868
856
|
key: "produce",
|
|
869
857
|
value: function(t, n) {
|
|
870
858
|
var r = this;
|
|
871
|
-
return this.isEnabled() ? (l.debug(this.config, "Sending call to Varsnap"),
|
|
859
|
+
return this.isEnabled() ? (l.debug(this.config, "Sending call to Varsnap"),
|
|
860
|
+
Promise.resolve(n).then(function(n) {
|
|
872
861
|
var o = {
|
|
873
862
|
producer_token: l.getConfig(r.config, "producerToken"),
|
|
874
863
|
signature: r.signature,
|
|
@@ -914,7 +903,8 @@
|
|
|
914
903
|
value: function(o) {
|
|
915
904
|
var i = this;
|
|
916
905
|
if (!this.isEnabled()) return new Promise(function(e) {
|
|
917
|
-
return l.error(i.config, "Varsnap not enabled for testing"),
|
|
906
|
+
return l.error(i.config, "Varsnap not enabled for testing"),
|
|
907
|
+
e(!1);
|
|
918
908
|
});
|
|
919
909
|
var a = {
|
|
920
910
|
consumer_token: l.getConfig(this.config, "consumerToken"),
|
|
@@ -923,7 +913,8 @@
|
|
|
923
913
|
return l.ajax("https://www.varsnap.com/api/snap/consume/", a).then(function(s) {
|
|
924
914
|
var u = s;
|
|
925
915
|
if (!u || "ok" !== u.status) return [ new Promise(function(e) {
|
|
926
|
-
return l.error(i.config, "Received error from Varsnap: " + u.status),
|
|
916
|
+
return l.error(i.config, "Received error from Varsnap: " + u.status),
|
|
917
|
+
e(!1);
|
|
927
918
|
}) ];
|
|
928
919
|
0 === u.results.length && l.log(i.config, "No snaps found for signature: " + a.signature);
|
|
929
920
|
var c, f = [], d = t(u.results);
|
|
@@ -963,7 +954,8 @@
|
|
|
963
954
|
});
|
|
964
955
|
});
|
|
965
956
|
}).catch(function(e) {
|
|
966
|
-
return l.error(i.config, "Cannot contact Varsnap: " + e),
|
|
957
|
+
return l.error(i.config, "Cannot contact Varsnap: " + e),
|
|
958
|
+
!1;
|
|
967
959
|
});
|
|
968
960
|
}
|
|
969
961
|
}, {
|
|
@@ -982,15 +974,18 @@
|
|
|
982
974
|
var t = e;
|
|
983
975
|
return !(!t || "ok" !== t.status) && t.trial_url;
|
|
984
976
|
}).catch(function(e) {
|
|
985
|
-
return l.error(i.config, "Cannot upload test results to Varsnap: " + e),
|
|
977
|
+
return l.error(i.config, "Cannot upload test results to Varsnap: " + e),
|
|
978
|
+
!1;
|
|
986
979
|
});
|
|
987
980
|
}
|
|
988
981
|
}, {
|
|
989
982
|
key: "reportLog",
|
|
990
983
|
value: function(e, t, n, r, o, i) {
|
|
991
984
|
l.log(this.config, ""), l.log(this.config, "Testing with Varsnap uuid: " + e),
|
|
992
|
-
l.log(this.config, "Signature: " + this.signature),
|
|
993
|
-
l.log(this.config, "
|
|
985
|
+
l.log(this.config, "Signature: " + this.signature),
|
|
986
|
+
l.log(this.config, "Function input args: " + l.limitString(t)),
|
|
987
|
+
l.log(this.config, "Production function outputs: " + l.limitString(n)),
|
|
988
|
+
l.log(this.config, "Your function outputs: " + l.limitString(r)),
|
|
994
989
|
l.log(this.config, "Matching outputs: " + o);
|
|
995
990
|
var a = "Cannot upload trial";
|
|
996
991
|
i && (a = String(i)), l.log(this.config, "Trial URL: " + a);
|
|
@@ -1018,15 +1013,17 @@
|
|
|
1018
1013
|
}
|
|
1019
1014
|
return r.produce(o, t), t;
|
|
1020
1015
|
};
|
|
1021
|
-
return i.producer = r, i.consumer = o, i.signature = n, c.push(r),
|
|
1016
|
+
return i.producer = r, i.consumer = o, i.signature = n, c.push(r),
|
|
1017
|
+
f.push(o), i;
|
|
1022
1018
|
}
|
|
1023
1019
|
function g() {
|
|
1024
1020
|
var e, n = l.getConsumers();
|
|
1025
|
-
return 0 === n.length ? Promise.resolve(!0) : (e = n[0].config,
|
|
1021
|
+
return 0 === n.length ? Promise.resolve(!0) : (e = n[0].config,
|
|
1022
|
+
l.getBranch(e).then(function(t) {
|
|
1026
1023
|
return {
|
|
1027
1024
|
branch: t,
|
|
1028
1025
|
consumer_token: l.getConfig(e, "consumerToken"),
|
|
1029
|
-
client:
|
|
1026
|
+
client: oe.clientName
|
|
1030
1027
|
};
|
|
1031
1028
|
}).then(function(e) {
|
|
1032
1029
|
var t = e;
|
|
@@ -1061,7 +1058,7 @@
|
|
|
1061
1058
|
});
|
|
1062
1059
|
});
|
|
1063
1060
|
}
|
|
1064
|
-
|
|
1061
|
+
oe.varsnap = h, h._config = u, h.updateConfig = function(e) {
|
|
1065
1062
|
for (var t = h._config, n = 0, r = Object.keys(h._config); n < r.length; n++) {
|
|
1066
1063
|
var o = r[n];
|
|
1067
1064
|
Object.prototype.hasOwnProperty.call(e, o) && (t = l.setConfig(t, o, e[o]));
|
|
@@ -1069,8 +1066,8 @@
|
|
|
1069
1066
|
h._config = t;
|
|
1070
1067
|
}, h.reset = function() {
|
|
1071
1068
|
l.resetConsumers(), l.resetProducers();
|
|
1072
|
-
}, h.version =
|
|
1069
|
+
}, h.version = oe.version, h.runTests = g;
|
|
1073
1070
|
}).call(this);
|
|
1074
|
-
}.call(this,
|
|
1071
|
+
}.call(this, T), oe.varsnap;
|
|
1075
1072
|
});
|
|
1076
1073
|
})(typeof Varsnap == "undefined" ? Varsnap = {} : Varsnap);
|