dev-classes 1.3.24 → 1.3.26
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var ut = Object.defineProperty;
|
|
2
2
|
var lt = (e, t, n) => t in e ? ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
3
|
+
var N = (e, t, n) => (lt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
4
|
import { ErrorsHandler as ft } from "./ErrorsHandler/ErrorsHandler.js";
|
|
5
5
|
import { SaveRequest as Re } from "./SaveRequest/SaveRequest.js";
|
|
6
6
|
import { Utils as Oe } from "../../../Utils/Utils.js";
|
|
@@ -14,22 +14,22 @@ const { toString: dt } = Object.prototype, { getPrototypeOf: he } = Object, G =
|
|
|
14
14
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
15
15
|
})(/* @__PURE__ */ Object.create(null)), D = (e) => (e = e.toLowerCase(), (t) => G(t) === e), X = (e) => (t) => typeof t === e, { isArray: _ } = Array, H = X("undefined");
|
|
16
16
|
function pt(e) {
|
|
17
|
-
return e !== null && !H(e) && e.constructor !== null && !H(e.constructor) &&
|
|
17
|
+
return e !== null && !H(e) && e.constructor !== null && !H(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
18
18
|
}
|
|
19
19
|
const He = D("ArrayBuffer");
|
|
20
20
|
function ht(e) {
|
|
21
21
|
let t;
|
|
22
22
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && He(e.buffer), t;
|
|
23
23
|
}
|
|
24
|
-
const mt = X("string"),
|
|
24
|
+
const mt = X("string"), P = X("function"), ve = X("number"), Q = (e) => e !== null && typeof e == "object", yt = (e) => e === !0 || e === !1, z = (e) => {
|
|
25
25
|
if (G(e) !== "object")
|
|
26
26
|
return !1;
|
|
27
27
|
const t = he(e);
|
|
28
28
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
29
|
-
}, wt = D("Date"), gt = D("File"), bt = D("Blob"), Et = D("FileList"), St = (e) => Q(e) &&
|
|
29
|
+
}, wt = D("Date"), gt = D("File"), bt = D("Blob"), Et = D("FileList"), St = (e) => Q(e) && P(e.pipe), Rt = (e) => {
|
|
30
30
|
let t;
|
|
31
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
32
|
-
t === "object" &&
|
|
31
|
+
return e && (typeof FormData == "function" && e instanceof FormData || P(e.append) && ((t = G(e)) === "formdata" || // detect form-data instance
|
|
32
|
+
t === "object" && P(e.toString) && e.toString() === "[object FormData]"));
|
|
33
33
|
}, Ot = D("URLSearchParams"), [Tt, At, Ct, xt] = ["ReadableStream", "Request", "Response", "Headers"].map(D), Nt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
34
34
|
function v(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
35
35
|
if (e === null || typeof e > "u")
|
|
@@ -65,7 +65,7 @@ function ie() {
|
|
|
65
65
|
return t;
|
|
66
66
|
}
|
|
67
67
|
const Pt = (e, t, n, { allOwnKeys: r } = {}) => (v(t, (s, o) => {
|
|
68
|
-
n &&
|
|
68
|
+
n && P(s) ? e[o] = Ie(s, n) : e[o] = s;
|
|
69
69
|
}, { allOwnKeys: r }), e), kt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Ft = (e, t, n, r) => {
|
|
70
70
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
71
71
|
value: t.prototype
|
|
@@ -123,10 +123,10 @@ const Pt = (e, t, n, { allOwnKeys: r } = {}) => (v(t, (s, o) => {
|
|
|
123
123
|
}), Object.defineProperties(e, r);
|
|
124
124
|
}, vt = (e) => {
|
|
125
125
|
Je(e, (t, n) => {
|
|
126
|
-
if (
|
|
126
|
+
if (P(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
127
127
|
return !1;
|
|
128
128
|
const r = e[n];
|
|
129
|
-
if (
|
|
129
|
+
if (P(r)) {
|
|
130
130
|
if (t.enumerable = !1, "writable" in t) {
|
|
131
131
|
t.writable = !1;
|
|
132
132
|
return;
|
|
@@ -156,7 +156,7 @@ const Pt = (e, t, n, { allOwnKeys: r } = {}) => (v(t, (s, o) => {
|
|
|
156
156
|
return n;
|
|
157
157
|
};
|
|
158
158
|
function Vt(e) {
|
|
159
|
-
return !!(e &&
|
|
159
|
+
return !!(e && P(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
|
160
160
|
}
|
|
161
161
|
const Wt = (e) => {
|
|
162
162
|
const t = new Array(10), n = (r, s) => {
|
|
@@ -175,13 +175,13 @@ const Wt = (e) => {
|
|
|
175
175
|
return r;
|
|
176
176
|
};
|
|
177
177
|
return n(e, 0);
|
|
178
|
-
}, Kt = D("AsyncFunction"), Gt = (e) => e && (Q(e) ||
|
|
178
|
+
}, Kt = D("AsyncFunction"), Gt = (e) => e && (Q(e) || P(e)) && P(e.then) && P(e.catch), Ve = ((e, t) => e ? setImmediate : t ? ((n, r) => (B.addEventListener("message", ({ source: s, data: o }) => {
|
|
179
179
|
s === B && o === n && r.length && r.shift()();
|
|
180
180
|
}, !1), (s) => {
|
|
181
181
|
r.push(s), B.postMessage(n, "*");
|
|
182
182
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
183
183
|
typeof setImmediate == "function",
|
|
184
|
-
|
|
184
|
+
P(B.postMessage)
|
|
185
185
|
), Xt = typeof queueMicrotask < "u" ? queueMicrotask.bind(B) : typeof process < "u" && process.nextTick || Ve, a = {
|
|
186
186
|
isArray: _,
|
|
187
187
|
isArrayBuffer: He,
|
|
@@ -202,7 +202,7 @@ const Wt = (e) => {
|
|
|
202
202
|
isFile: gt,
|
|
203
203
|
isBlob: bt,
|
|
204
204
|
isRegExp: Ht,
|
|
205
|
-
isFunction:
|
|
205
|
+
isFunction: P,
|
|
206
206
|
isStream: St,
|
|
207
207
|
isURLSearchParams: Ot,
|
|
208
208
|
isTypedArray: Bt,
|
|
@@ -338,10 +338,10 @@ function Z(e, t, n) {
|
|
|
338
338
|
if (a.endsWith(h, "{}"))
|
|
339
339
|
h = r ? h : h.slice(0, -2), d = JSON.stringify(d);
|
|
340
340
|
else if (a.isArray(d) && Zt(d) || (a.isFileList(d) || a.endsWith(h, "[]")) && (g = a.toArray(d)))
|
|
341
|
-
return h = Ge(h), g.forEach(function(O,
|
|
341
|
+
return h = Ge(h), g.forEach(function(O, E) {
|
|
342
342
|
!(a.isUndefined(O) || O === null) && t.append(
|
|
343
343
|
// eslint-disable-next-line no-nested-ternary
|
|
344
|
-
i === !0 ? Ce([h],
|
|
344
|
+
i === !0 ? Ce([h], E, o) : i === null ? h : h + "[]",
|
|
345
345
|
u(O)
|
|
346
346
|
);
|
|
347
347
|
}), !1;
|
|
@@ -357,14 +357,14 @@ function Z(e, t, n) {
|
|
|
357
357
|
if (!a.isUndefined(d)) {
|
|
358
358
|
if (m.indexOf(d) !== -1)
|
|
359
359
|
throw Error("Circular reference detected in " + h.join("."));
|
|
360
|
-
m.push(d), a.forEach(d, function(g,
|
|
360
|
+
m.push(d), a.forEach(d, function(g, b) {
|
|
361
361
|
(!(a.isUndefined(g) || g === null) && s.call(
|
|
362
362
|
t,
|
|
363
363
|
g,
|
|
364
|
-
a.isString(
|
|
364
|
+
a.isString(b) ? b.trim() : b,
|
|
365
365
|
h,
|
|
366
366
|
S
|
|
367
|
-
)) === !0 && R(g, h ? h.concat(
|
|
367
|
+
)) === !0 && R(g, h ? h.concat(b) : [b]);
|
|
368
368
|
}), m.pop();
|
|
369
369
|
}
|
|
370
370
|
}
|
|
@@ -1077,22 +1077,22 @@ const rt = (e) => {
|
|
|
1077
1077
|
}, p.onerror = function() {
|
|
1078
1078
|
r(new y("Network Error", y.ERR_NETWORK, e, p)), p = null;
|
|
1079
1079
|
}, p.ontimeout = function() {
|
|
1080
|
-
let
|
|
1080
|
+
let E = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1081
1081
|
const A = s.transitional || Ze;
|
|
1082
|
-
s.timeoutErrorMessage && (
|
|
1083
|
-
|
|
1082
|
+
s.timeoutErrorMessage && (E = s.timeoutErrorMessage), r(new y(
|
|
1083
|
+
E,
|
|
1084
1084
|
A.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
|
|
1085
1085
|
e,
|
|
1086
1086
|
p
|
|
1087
1087
|
)), p = null;
|
|
1088
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(
|
|
1089
|
-
p.setRequestHeader(A,
|
|
1088
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(E, A) {
|
|
1089
|
+
p.setRequestHeader(A, E);
|
|
1090
1090
|
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([S, d] = V(u, !0), p.addEventListener("progress", S)), f && p.upload && ([m, R] = V(f), p.upload.addEventListener("progress", m), p.upload.addEventListener("loadend", R)), (s.cancelToken || s.signal) && (l = (O) => {
|
|
1091
1091
|
p && (r(!O || O.type ? new q(null, e, p) : O), p.abort(), p = null);
|
|
1092
1092
|
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1093
|
-
const
|
|
1094
|
-
if (
|
|
1095
|
-
r(new y("Unsupported protocol " +
|
|
1093
|
+
const b = En(s.url);
|
|
1094
|
+
if (b && C.protocols.indexOf(b) === -1) {
|
|
1095
|
+
r(new y("Unsupported protocol " + b + ":", y.ERR_BAD_REQUEST, e));
|
|
1096
1096
|
return;
|
|
1097
1097
|
}
|
|
1098
1098
|
p.send(o || null);
|
|
@@ -1247,8 +1247,8 @@ const jn = async (e) => {
|
|
|
1247
1247
|
method: "POST",
|
|
1248
1248
|
body: r,
|
|
1249
1249
|
duplex: "half"
|
|
1250
|
-
}),
|
|
1251
|
-
if (a.isFormData(r) && (
|
|
1250
|
+
}), x;
|
|
1251
|
+
if (a.isFormData(r) && (x = A.headers.get("content-type")) && l.setContentType(x), A.body) {
|
|
1252
1252
|
const [k, F] = ke(
|
|
1253
1253
|
p,
|
|
1254
1254
|
V(Fe(f))
|
|
@@ -1267,32 +1267,32 @@ const jn = async (e) => {
|
|
|
1267
1267
|
duplex: "half",
|
|
1268
1268
|
credentials: g ? m : void 0
|
|
1269
1269
|
});
|
|
1270
|
-
let
|
|
1270
|
+
let b = await fetch(d);
|
|
1271
1271
|
const O = ue && (u === "stream" || u === "response");
|
|
1272
1272
|
if (ue && (c || O && h)) {
|
|
1273
1273
|
const A = {};
|
|
1274
1274
|
["status", "statusText", "headers"].forEach((Se) => {
|
|
1275
|
-
A[Se] =
|
|
1275
|
+
A[Se] = b[Se];
|
|
1276
1276
|
});
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1277
|
+
const x = a.toFiniteNumber(b.headers.get("content-length")), [k, F] = c && ke(
|
|
1278
|
+
x,
|
|
1279
1279
|
V(Fe(c), !0)
|
|
1280
1280
|
) || [];
|
|
1281
|
-
|
|
1282
|
-
De(
|
|
1281
|
+
b = new Response(
|
|
1282
|
+
De(b.body, Le, k, () => {
|
|
1283
1283
|
F && F(), h && h();
|
|
1284
1284
|
}),
|
|
1285
1285
|
A
|
|
1286
1286
|
);
|
|
1287
1287
|
}
|
|
1288
1288
|
u = u || "text";
|
|
1289
|
-
let
|
|
1290
|
-
return !O && h && h(), await new Promise((A,
|
|
1291
|
-
tt(A,
|
|
1292
|
-
data:
|
|
1293
|
-
headers: U.from(
|
|
1294
|
-
status:
|
|
1295
|
-
statusText:
|
|
1289
|
+
let E = await W[a.findKey(W, u) || "text"](b, e);
|
|
1290
|
+
return !O && h && h(), await new Promise((A, x) => {
|
|
1291
|
+
tt(A, x, {
|
|
1292
|
+
data: E,
|
|
1293
|
+
headers: U.from(b.headers),
|
|
1294
|
+
status: b.status,
|
|
1295
|
+
statusText: b.statusText,
|
|
1296
1296
|
config: e,
|
|
1297
1297
|
request: d
|
|
1298
1298
|
});
|
|
@@ -1794,9 +1794,9 @@ const w = class w {
|
|
|
1794
1794
|
w.errorsHandler = t;
|
|
1795
1795
|
}
|
|
1796
1796
|
};
|
|
1797
|
-
|
|
1797
|
+
N(w, "keyCookie", "AuthCookie"), N(w, "cookieOptions", {}), N(w, "registerRequest", new Re()), N(w, "registerFailedRequests", new Re()), N(w, "requestUploadToken", null), N(w, "errorsHandler", new ft()), N(w, "setMethodUploadToken", (t) => {
|
|
1798
1798
|
w.requestUploadToken = t;
|
|
1799
|
-
}),
|
|
1799
|
+
}), N(w, "requestInServer", (t, n = {}) => new Promise((r, s) => {
|
|
1800
1800
|
var m, S, R;
|
|
1801
1801
|
let o = { url: t, statusCode: 0, data: {}, res: {} };
|
|
1802
1802
|
const i = {
|
|
@@ -1820,29 +1820,29 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1820
1820
|
c,
|
|
1821
1821
|
(h) => {
|
|
1822
1822
|
w.registerFailedRequests.removeItem(t), w.registerRequest.removeItem(t);
|
|
1823
|
-
const p = (h == null ? void 0 : h.headers) && h.headers["set-cookie"], g = h.status,
|
|
1824
|
-
o = { ...o, statusCode: g, data:
|
|
1823
|
+
const p = (h == null ? void 0 : h.headers) && h.headers["set-cookie"], g = h.status, b = h == null ? void 0 : h.data;
|
|
1824
|
+
o = { ...o, statusCode: g, data: b, res: h }, g === 200 && p && (w.saveToken(p), o.data = { ...o.data, token: p }), r(o);
|
|
1825
1825
|
},
|
|
1826
1826
|
(h) => {
|
|
1827
1827
|
console.log("http.sendRequest error: ", h);
|
|
1828
|
-
const p = w.errorsHandler.handleError(h), { url: g, status:
|
|
1829
|
-
console.
|
|
1828
|
+
const p = w.errorsHandler.handleError(h), { url: g, status: b, headers: O, error: E, ...A } = h, x = typeof E == "string" ? Oe.isJSON(E.trim()) : !1;
|
|
1829
|
+
console.log("isJSON", x);
|
|
1830
1830
|
try {
|
|
1831
|
-
const F = JSON.parse(
|
|
1831
|
+
const F = JSON.parse(E.trim());
|
|
1832
1832
|
console.log("parseError", F);
|
|
1833
1833
|
} catch (F) {
|
|
1834
1834
|
console.dir(F);
|
|
1835
1835
|
}
|
|
1836
|
-
const
|
|
1836
|
+
const k = {
|
|
1837
1837
|
headers: O,
|
|
1838
|
-
status:
|
|
1838
|
+
status: b,
|
|
1839
1839
|
message: ""
|
|
1840
1840
|
};
|
|
1841
|
-
if (
|
|
1842
|
-
const F = JSON.parse(
|
|
1841
|
+
if (x) {
|
|
1842
|
+
const F = JSON.parse(E.trim());
|
|
1843
1843
|
k.message = w.errorsHandler.getErrorMessageFromData(F), k.data = F;
|
|
1844
1844
|
} else
|
|
1845
|
-
typeof
|
|
1845
|
+
typeof E == "string" && (k.message = E);
|
|
1846
1846
|
s({ ...l, ...p, errExt: k });
|
|
1847
1847
|
}
|
|
1848
1848
|
);
|
|
@@ -1852,19 +1852,19 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1852
1852
|
const h = d.status, p = d == null ? void 0 : d.data;
|
|
1853
1853
|
o = { ...o, statusCode: h, data: p, res: d }, r(o);
|
|
1854
1854
|
}).catch((d) => {
|
|
1855
|
-
const h = w.errorsHandler.handleError(d), { code: p, config: g, status:
|
|
1855
|
+
const h = w.errorsHandler.handleError(d), { code: p, config: g, status: b, message: O, response: E, stack: A } = d, x = {
|
|
1856
1856
|
code: p,
|
|
1857
1857
|
config: g,
|
|
1858
|
-
status:
|
|
1858
|
+
status: b || f,
|
|
1859
1859
|
message: O,
|
|
1860
|
-
headers:
|
|
1861
|
-
statusText:
|
|
1862
|
-
data:
|
|
1860
|
+
headers: E == null ? void 0 : E.headers,
|
|
1861
|
+
statusText: E == null ? void 0 : E.statusText,
|
|
1862
|
+
data: E == null ? void 0 : E.data,
|
|
1863
1863
|
stack: A
|
|
1864
1864
|
};
|
|
1865
|
-
s({ ...l, ...h, errExt:
|
|
1865
|
+
s({ ...l, ...h, errExt: x });
|
|
1866
1866
|
});
|
|
1867
|
-
})),
|
|
1867
|
+
})), N(w, "getAuthCookies", () => {
|
|
1868
1868
|
var n, r, s;
|
|
1869
1869
|
const { keyCookie: t } = w;
|
|
1870
1870
|
if ((r = (n = window == null ? void 0 : window.cordova) == null ? void 0 : n.plugin) != null && r.http) {
|
|
@@ -1872,7 +1872,7 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1872
1872
|
return o.getCookieString(t);
|
|
1873
1873
|
}
|
|
1874
1874
|
return oe.get(t);
|
|
1875
|
-
}),
|
|
1875
|
+
}), N(w, "saveToken", (t) => {
|
|
1876
1876
|
var n, r, s;
|
|
1877
1877
|
if (t) {
|
|
1878
1878
|
const { keyCookie: o, cookieOptions: i } = w;
|
|
@@ -1883,7 +1883,7 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1883
1883
|
}
|
|
1884
1884
|
oe.set(o, t, i);
|
|
1885
1885
|
}
|
|
1886
|
-
}),
|
|
1886
|
+
}), N(w, "removeAuthCookie", () => {
|
|
1887
1887
|
var n, r, s;
|
|
1888
1888
|
const { keyCookie: t } = w;
|
|
1889
1889
|
if ((r = (n = window == null ? void 0 : window.cordova) == null ? void 0 : n.plugin) != null && r.http) {
|
|
@@ -1892,7 +1892,7 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1892
1892
|
return;
|
|
1893
1893
|
}
|
|
1894
1894
|
oe.remove(t);
|
|
1895
|
-
}),
|
|
1895
|
+
}), N(w, "setCookieOptions", (t) => {
|
|
1896
1896
|
w.cookieOptions = t;
|
|
1897
1897
|
});
|
|
1898
1898
|
let qe = w;
|