dev-classes 1.1.17 → 1.1.19
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,45 +1,46 @@
|
|
|
1
1
|
var q = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var d = (o, s, t) => (
|
|
2
|
+
var g = (o, s, t) => s in o ? q(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
|
+
var d = (o, s, t) => (g(o, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
4
|
import { apiRequest as f } from "./deps/apiRequest/apiRequest.js";
|
|
5
5
|
const e = class e {
|
|
6
6
|
static setOptions(s) {
|
|
7
7
|
e.options = { ...e.options, ...s };
|
|
8
8
|
}
|
|
9
9
|
static request({ keyAction: s, request: t }) {
|
|
10
|
-
const { url: l, ...
|
|
11
|
-
return new Promise((
|
|
12
|
-
const { getIsNetwork:
|
|
10
|
+
const { url: l, ...m } = t;
|
|
11
|
+
return new Promise((p, u) => {
|
|
12
|
+
const { getIsNetwork: R, setStatusFetch: i } = e.options, r = R(), c = {
|
|
13
13
|
url: l,
|
|
14
14
|
keyAction: s,
|
|
15
|
-
isErr: !
|
|
16
|
-
msg:
|
|
17
|
-
isReq:
|
|
18
|
-
statusCode: 520,
|
|
15
|
+
isErr: !r,
|
|
16
|
+
msg: r ? "" : "Нет интернета",
|
|
17
|
+
isReq: r,
|
|
18
|
+
statusCode: r ? 0 : 520,
|
|
19
19
|
isReload: !1
|
|
20
20
|
};
|
|
21
|
-
if (
|
|
22
|
-
f.requestInServer(l,
|
|
23
|
-
const
|
|
21
|
+
if (i(c), r) {
|
|
22
|
+
f.requestInServer(l, m).then((n) => {
|
|
23
|
+
const a = {
|
|
24
24
|
isReq: !1,
|
|
25
25
|
isReload: !0,
|
|
26
26
|
isErr: !1,
|
|
27
27
|
keyAction: s,
|
|
28
|
+
msg: "",
|
|
28
29
|
...n
|
|
29
30
|
};
|
|
30
|
-
a
|
|
31
|
+
i(a), p(a);
|
|
31
32
|
}).catch((n) => {
|
|
32
|
-
const
|
|
33
|
+
const a = {
|
|
33
34
|
isReq: !1,
|
|
34
35
|
isReload: !1,
|
|
35
36
|
keyAction: s,
|
|
36
37
|
...n
|
|
37
38
|
};
|
|
38
|
-
a
|
|
39
|
+
i(a), u(a);
|
|
39
40
|
});
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
i(c), u(c);
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
static removeCookie() {
|
|
@@ -1806,7 +1806,7 @@ C(g, "keyCookie", "Token"), C(g, "cookieOptions", {}), C(g, "registerRequest", n
|
|
|
1806
1806
|
},
|
|
1807
1807
|
timeout: 6e4
|
|
1808
1808
|
}, f = ft.deepMerge(c, n);
|
|
1809
|
-
if (
|
|
1809
|
+
if (window != null && window.cordova && ((l = (u = window == null ? void 0 : window.cordova) == null ? void 0 : u.plugin) != null && l.http)) {
|
|
1810
1810
|
const { http: b } = (p = window == null ? void 0 : window.cordova) == null ? void 0 : p.plugin;
|
|
1811
1811
|
b.setDataSerializer("json"), b.setRequestTimeout(Number(f.timeout) / 1e3), g.registerRequest.setList({ url: t, options: f }), b.sendRequest(
|
|
1812
1812
|
t,
|