dev-classes 1.3.20 → 1.3.22
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)), U = (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 = U("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 = U("Date"), gt = U("File"), bt = U("Blob"), Et = U("FileList"), St = (e) => Q(e) &&
|
|
29
|
+
}, wt = U("Date"), gt = U("File"), bt = U("Blob"), Et = U("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 = U("URLSearchParams"), [Tt, At, Ct, xt] = ["ReadableStream", "Request", "Response", "Headers"].map(U), 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 = U("AsyncFunction"), Gt = (e) => e && (Q(e) ||
|
|
178
|
+
}, Kt = U("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,
|
|
@@ -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, L] = ke(
|
|
1253
1253
|
p,
|
|
1254
1254
|
V(Fe(f))
|
|
@@ -1274,8 +1274,8 @@ const jn = async (e) => {
|
|
|
1274
1274
|
["status", "statusText", "headers"].forEach((Se) => {
|
|
1275
1275
|
A[Se] = b[Se];
|
|
1276
1276
|
});
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1277
|
+
const x = a.toFiniteNumber(b.headers.get("content-length")), [k, L] = c && ke(
|
|
1278
|
+
x,
|
|
1279
1279
|
V(Fe(c), !0)
|
|
1280
1280
|
) || [];
|
|
1281
1281
|
b = new Response(
|
|
@@ -1287,8 +1287,8 @@ const jn = async (e) => {
|
|
|
1287
1287
|
}
|
|
1288
1288
|
u = u || "text";
|
|
1289
1289
|
let S = await W[a.findKey(W, u) || "text"](b, e);
|
|
1290
|
-
return !O && h && h(), await new Promise((A,
|
|
1291
|
-
tt(A,
|
|
1290
|
+
return !O && h && h(), await new Promise((A, x) => {
|
|
1291
|
+
tt(A, x, {
|
|
1292
1292
|
data: S,
|
|
1293
1293
|
headers: F.from(b.headers),
|
|
1294
1294
|
status: b.status,
|
|
@@ -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, E, R;
|
|
1801
1801
|
let o = { url: t, statusCode: 0, data: {}, res: {} };
|
|
1802
1802
|
const i = {
|
|
@@ -1825,12 +1825,12 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1825
1825
|
},
|
|
1826
1826
|
(h) => {
|
|
1827
1827
|
console.log("http.sendRequest error: ", h);
|
|
1828
|
-
const p = w.errorsHandler.handleError(h), { url: g, status: b, headers: O, error: S, ...A } = h,
|
|
1828
|
+
const p = w.errorsHandler.handleError(h), { url: g, status: b, headers: O, error: S, ...A } = h, x = Oe.isJSON(S), k = {
|
|
1829
1829
|
headers: O,
|
|
1830
1830
|
status: b,
|
|
1831
1831
|
message: ""
|
|
1832
1832
|
};
|
|
1833
|
-
if (
|
|
1833
|
+
if (console.log("isJSON: ", x), x) {
|
|
1834
1834
|
const L = JSON.parse(S);
|
|
1835
1835
|
k.message = w.errorsHandler.getErrorMessageFromData(L), k.data = L;
|
|
1836
1836
|
} else
|
|
@@ -1844,7 +1844,7 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1844
1844
|
const h = d.status, p = d == null ? void 0 : d.data;
|
|
1845
1845
|
o = { ...o, statusCode: h, data: p, res: d }, r(o);
|
|
1846
1846
|
}).catch((d) => {
|
|
1847
|
-
const h = w.errorsHandler.handleError(d), { code: p, config: g, status: b, message: O, response: S, stack: A } = d,
|
|
1847
|
+
const h = w.errorsHandler.handleError(d), { code: p, config: g, status: b, message: O, response: S, stack: A } = d, x = {
|
|
1848
1848
|
code: p,
|
|
1849
1849
|
config: g,
|
|
1850
1850
|
status: b || f,
|
|
@@ -1854,9 +1854,9 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1854
1854
|
data: S == null ? void 0 : S.data,
|
|
1855
1855
|
stack: A
|
|
1856
1856
|
};
|
|
1857
|
-
s({ ...l, ...h, errExt:
|
|
1857
|
+
s({ ...l, ...h, errExt: x });
|
|
1858
1858
|
});
|
|
1859
|
-
})),
|
|
1859
|
+
})), N(w, "getAuthCookies", () => {
|
|
1860
1860
|
var n, r, s;
|
|
1861
1861
|
const { keyCookie: t } = w;
|
|
1862
1862
|
if ((r = (n = window == null ? void 0 : window.cordova) == null ? void 0 : n.plugin) != null && r.http) {
|
|
@@ -1864,7 +1864,7 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1864
1864
|
return o.getCookieString(t);
|
|
1865
1865
|
}
|
|
1866
1866
|
return oe.get(t);
|
|
1867
|
-
}),
|
|
1867
|
+
}), N(w, "saveToken", (t) => {
|
|
1868
1868
|
var n, r, s;
|
|
1869
1869
|
if (t) {
|
|
1870
1870
|
const { keyCookie: o, cookieOptions: i } = w;
|
|
@@ -1875,7 +1875,7 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1875
1875
|
}
|
|
1876
1876
|
oe.set(o, t, i);
|
|
1877
1877
|
}
|
|
1878
|
-
}),
|
|
1878
|
+
}), N(w, "removeAuthCookie", () => {
|
|
1879
1879
|
var n, r, s;
|
|
1880
1880
|
const { keyCookie: t } = w;
|
|
1881
1881
|
if ((r = (n = window == null ? void 0 : window.cordova) == null ? void 0 : n.plugin) != null && r.http) {
|
|
@@ -1884,7 +1884,7 @@ x(w, "keyCookie", "AuthCookie"), x(w, "cookieOptions", {}), x(w, "registerReques
|
|
|
1884
1884
|
return;
|
|
1885
1885
|
}
|
|
1886
1886
|
oe.remove(t);
|
|
1887
|
-
}),
|
|
1887
|
+
}), N(w, "setCookieOptions", (t) => {
|
|
1888
1888
|
w.cookieOptions = t;
|
|
1889
1889
|
});
|
|
1890
1890
|
let qe = w;
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { NetworkInformationAbstract as
|
|
5
|
-
class
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var l = (e, o, n) => o in e ? i(e, o, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[o] = n;
|
|
3
|
+
var a = (e, o, n) => (l(e, typeof o != "symbol" ? o + "" : o, n), n);
|
|
4
|
+
import { NetworkInformationAbstract as d } from "./types/types.abscruct.js";
|
|
5
|
+
class w extends d {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
console.
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
a(this, "watchers", (n) => {
|
|
9
|
+
const s = (t) => {
|
|
10
|
+
console.log("watchers cb", n), console.log("watcher status", t);
|
|
11
|
+
const r = !["none", "unknown"].includes(t);
|
|
12
|
+
n(r, t);
|
|
13
13
|
};
|
|
14
|
-
navigator != null && navigator.connection && "getInfo" in (navigator == null ? void 0 : navigator.connection)
|
|
14
|
+
if (navigator != null && navigator.connection && "getInfo" in (navigator == null ? void 0 : navigator.connection)) {
|
|
15
|
+
const t = () => {
|
|
16
|
+
var c;
|
|
17
|
+
return (c = navigator == null ? void 0 : navigator.connection) == null ? void 0 : c.type;
|
|
18
|
+
}, r = () => {
|
|
19
|
+
const c = t();
|
|
20
|
+
s(c);
|
|
21
|
+
};
|
|
22
|
+
r(), document.addEventListener("offline", r, !1), document.addEventListener("online", r, !1);
|
|
23
|
+
} else
|
|
24
|
+
console.error("Нету navigator.connection.getInfo");
|
|
15
25
|
});
|
|
16
|
-
|
|
26
|
+
a(this, "getControls", () => ({
|
|
17
27
|
system: "cordova",
|
|
18
28
|
addWatchers: this.watchers,
|
|
19
29
|
removeWatchers: () => {
|
|
@@ -22,5 +32,5 @@ class h extends g {
|
|
|
22
32
|
}
|
|
23
33
|
}
|
|
24
34
|
export {
|
|
25
|
-
|
|
35
|
+
w as NetworkInformationCordova
|
|
26
36
|
};
|