@das-fed/utils 7.1.0-dev.10 → 7.1.0-dev.11
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/api-services/index.js +843 -830
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/index.js +726 -749
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/index.js +2 -7
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/index.js +2 -7
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/index.js +2 -7
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/index.js +2 -7
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/index.js +2 -7
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/file/index.js +2 -7
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/index.js +2 -7
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +2 -7
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/index.js +1003 -990
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/index.js +2 -7
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/index.js +2 -7
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/index.js +2 -7
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/index.js +2 -7
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/index.js +2 -7
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/index.js +2 -7
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/index.js +744 -731
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/index.js +2 -7
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/index.js +2 -7
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/index.js +2 -7
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/index.js +647 -656
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/index.js +2 -7
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/index.js +2 -7
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/getInfoFromUrl/index.js +36 -36
- package/common-info/getInfoFromUrl/index.js.gz +0 -0
- package/common-info/set-personal-info/index.js +44 -49
- package/common-info/set-personal-info/index.js.gz +0 -0
- package/common-tools/extract-file-name/index.js +2 -7
- package/common-tools/extract-file-name/index.js.gz +0 -0
- package/create-api-service/index.js +718 -705
- package/create-api-service/index.js.gz +0 -0
- package/create-api-service/sso/index.js +454 -463
- package/create-api-service/sso/index.js.gz +0 -0
- package/curring-http/index.js +47 -52
- package/curring-http/index.js.gz +0 -0
- package/package.json +4 -4
- package/pinyin-first-character/index.js +1 -1
- package/pinyin-first-character/index.js.gz +0 -0
- package/webSocket-service/index.js +40 -50
- package/webSocket-service/index.js.gz +0 -0
|
Binary file
|
package/curring-http/index.js
CHANGED
|
@@ -71,9 +71,9 @@ function _e() {
|
|
|
71
71
|
arguments[r] && Z(arguments[r], n);
|
|
72
72
|
return t;
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const Sn = (e, t, n, { allOwnKeys: r } = {}) => (Z(t, (o, s) => {
|
|
75
75
|
n && A(o) ? e[s] = ht(o, n) : e[s] = o;
|
|
76
|
-
}, { allOwnKeys: r }), e),
|
|
76
|
+
}, { allOwnKeys: r }), e), On = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Tn = (e, t, n, r) => {
|
|
77
77
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
78
78
|
value: t.prototype
|
|
79
79
|
}), n && Object.assign(e.prototype, n);
|
|
@@ -170,14 +170,14 @@ const $n = (e) => {
|
|
|
170
170
|
return r;
|
|
171
171
|
};
|
|
172
172
|
return n(e, 0);
|
|
173
|
-
}, In = P("AsyncFunction"), qn = (e) => e && (X(e) || A(e)) && A(e.then) && A(e.catch),
|
|
173
|
+
}, In = P("AsyncFunction"), qn = (e) => e && (X(e) || A(e)) && A(e.then) && A(e.catch), St = ((e, t) => e ? setImmediate : t ? ((n, r) => (U.addEventListener("message", ({ source: o, data: s }) => {
|
|
174
174
|
o === U && s === n && r.length && r.shift()();
|
|
175
175
|
}, !1), (o) => {
|
|
176
176
|
r.push(o), U.postMessage(n, "*");
|
|
177
177
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
178
178
|
typeof setImmediate == "function",
|
|
179
179
|
A(U.postMessage)
|
|
180
|
-
), Mn = typeof queueMicrotask < "u" ? queueMicrotask.bind(U) : typeof process < "u" && process.nextTick ||
|
|
180
|
+
), Mn = typeof queueMicrotask < "u" ? queueMicrotask.bind(U) : typeof process < "u" && process.nextTick || St, Hn = (e) => e != null && A(e[ue]), a = {
|
|
181
181
|
isArray: I,
|
|
182
182
|
isArrayBuffer: yt,
|
|
183
183
|
isBuffer: G,
|
|
@@ -205,9 +205,9 @@ const $n = (e) => {
|
|
|
205
205
|
isFileList: dn,
|
|
206
206
|
forEach: Z,
|
|
207
207
|
merge: _e,
|
|
208
|
-
extend:
|
|
208
|
+
extend: Sn,
|
|
209
209
|
trim: En,
|
|
210
|
-
stripBOM:
|
|
210
|
+
stripBOM: On,
|
|
211
211
|
inherits: Tn,
|
|
212
212
|
toFlatObject: _n,
|
|
213
213
|
kindOf: le,
|
|
@@ -233,7 +233,7 @@ const $n = (e) => {
|
|
|
233
233
|
toJSONObject: $n,
|
|
234
234
|
isAsyncFn: In,
|
|
235
235
|
isThenable: qn,
|
|
236
|
-
setImmediate:
|
|
236
|
+
setImmediate: St,
|
|
237
237
|
asap: Mn,
|
|
238
238
|
isIterable: Hn
|
|
239
239
|
};
|
|
@@ -261,7 +261,7 @@ a.inherits(b, Error, {
|
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
|
-
const
|
|
264
|
+
const Ot = b.prototype, Tt = {};
|
|
265
265
|
[
|
|
266
266
|
"ERR_BAD_OPTION_VALUE",
|
|
267
267
|
"ERR_BAD_OPTION",
|
|
@@ -280,9 +280,9 @@ const St = b.prototype, Tt = {};
|
|
|
280
280
|
Tt[e] = { value: e };
|
|
281
281
|
});
|
|
282
282
|
Object.defineProperties(b, Tt);
|
|
283
|
-
Object.defineProperty(
|
|
283
|
+
Object.defineProperty(Ot, "isAxiosError", { value: !0 });
|
|
284
284
|
b.from = (e, t, n, r, o, s) => {
|
|
285
|
-
const i = Object.create(
|
|
285
|
+
const i = Object.create(Ot);
|
|
286
286
|
return a.toFlatObject(e, i, function(f) {
|
|
287
287
|
return f !== Error.prototype;
|
|
288
288
|
}, (c) => c !== "isAxiosError"), b.call(i, e.message, t, n, r, o), i.cause = e, i.name = e.name, s && Object.assign(i, s), i;
|
|
@@ -349,7 +349,7 @@ function de(e, t, n) {
|
|
|
349
349
|
convertValue: l,
|
|
350
350
|
isVisitable: Re
|
|
351
351
|
});
|
|
352
|
-
function
|
|
352
|
+
function O(h, y) {
|
|
353
353
|
if (!a.isUndefined(h)) {
|
|
354
354
|
if (d.indexOf(h) !== -1)
|
|
355
355
|
throw Error("Circular reference detected in " + y.join("."));
|
|
@@ -360,13 +360,13 @@ function de(e, t, n) {
|
|
|
360
360
|
a.isString(w) ? w.trim() : w,
|
|
361
361
|
y,
|
|
362
362
|
g
|
|
363
|
-
)) === !0 &&
|
|
363
|
+
)) === !0 && O(p, y ? y.concat(w) : [w]);
|
|
364
364
|
}), d.pop();
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
if (!a.isObject(e))
|
|
368
368
|
throw new TypeError("data must be an object");
|
|
369
|
-
return
|
|
369
|
+
return O(e), t;
|
|
370
370
|
}
|
|
371
371
|
function ke(e) {
|
|
372
372
|
const t = {
|
|
@@ -850,8 +850,8 @@ function dr(e, t) {
|
|
|
850
850
|
g += n[d++], d = d % e;
|
|
851
851
|
if (o = (o + 1) % e, o === s && (s = (s + 1) % e), l - i < t)
|
|
852
852
|
return;
|
|
853
|
-
const
|
|
854
|
-
return
|
|
853
|
+
const O = u && l - u;
|
|
854
|
+
return O ? Math.round(g * 1e3 / O) : void 0;
|
|
855
855
|
};
|
|
856
856
|
}
|
|
857
857
|
function pr(e, t) {
|
|
@@ -1023,9 +1023,9 @@ const Nt = (e) => {
|
|
|
1023
1023
|
const o = Nt(e);
|
|
1024
1024
|
let s = o.data;
|
|
1025
1025
|
const i = x.from(o.headers).normalize();
|
|
1026
|
-
let { responseType: c, onUploadProgress: f, onDownloadProgress: l } = o, u, d, g,
|
|
1026
|
+
let { responseType: c, onUploadProgress: f, onDownloadProgress: l } = o, u, d, g, O, h;
|
|
1027
1027
|
function y() {
|
|
1028
|
-
|
|
1028
|
+
O && O(), h && h(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u);
|
|
1029
1029
|
}
|
|
1030
1030
|
let m = new XMLHttpRequest();
|
|
1031
1031
|
m.open(o.method.toUpperCase(), o.url, !0), m.timeout = o.timeout;
|
|
@@ -1065,7 +1065,7 @@ const Nt = (e) => {
|
|
|
1065
1065
|
)), m = null;
|
|
1066
1066
|
}, s === void 0 && i.setContentType(null), "setRequestHeader" in m && a.forEach(i.toJSON(), function(C, R) {
|
|
1067
1067
|
m.setRequestHeader(R, C);
|
|
1068
|
-
}), a.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), c && c !== "json" && (m.responseType = o.responseType), l && ([g, h] = se(l, !0), m.addEventListener("progress", g)), f && m.upload && ([d,
|
|
1068
|
+
}), a.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), c && c !== "json" && (m.responseType = o.responseType), l && ([g, h] = se(l, !0), m.addEventListener("progress", g)), f && m.upload && ([d, O] = se(f), m.upload.addEventListener("progress", d), m.upload.addEventListener("loadend", O)), (o.cancelToken || o.signal) && (u = (E) => {
|
|
1069
1069
|
m && (r(!E || E.type ? new q(null, e, m) : E), m.abort(), m = null);
|
|
1070
1070
|
}, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
|
|
1071
1071
|
const w = fr(o.url);
|
|
@@ -1098,7 +1098,7 @@ const Nt = (e) => {
|
|
|
1098
1098
|
const { signal: f } = r;
|
|
1099
1099
|
return f.unsubscribe = () => a.asap(c), f;
|
|
1100
1100
|
}
|
|
1101
|
-
},
|
|
1101
|
+
}, Sr = function* (e, t) {
|
|
1102
1102
|
let n = e.byteLength;
|
|
1103
1103
|
if (n < t) {
|
|
1104
1104
|
yield e;
|
|
@@ -1107,9 +1107,9 @@ const Nt = (e) => {
|
|
|
1107
1107
|
let r = 0, o;
|
|
1108
1108
|
for (; r < n; )
|
|
1109
1109
|
o = r + t, yield e.slice(r, o), r = o;
|
|
1110
|
-
},
|
|
1110
|
+
}, Or = async function* (e, t) {
|
|
1111
1111
|
for await (const n of Tr(e))
|
|
1112
|
-
yield*
|
|
1112
|
+
yield* Sr(n, t);
|
|
1113
1113
|
}, Tr = async function* (e) {
|
|
1114
1114
|
if (e[Symbol.asyncIterator]) {
|
|
1115
1115
|
yield* e;
|
|
@@ -1127,7 +1127,7 @@ const Nt = (e) => {
|
|
|
1127
1127
|
await t.cancel();
|
|
1128
1128
|
}
|
|
1129
1129
|
}, Xe = (e, t, n, r) => {
|
|
1130
|
-
const o =
|
|
1130
|
+
const o = Or(e, t);
|
|
1131
1131
|
let s = 0, i, c = (f) => {
|
|
1132
1132
|
i || (i = !0, r && r(f));
|
|
1133
1133
|
};
|
|
@@ -1214,9 +1214,9 @@ const Ar = async (e) => {
|
|
|
1214
1214
|
fetchOptions: g
|
|
1215
1215
|
} = Nt(e);
|
|
1216
1216
|
l = l ? (l + "").toLowerCase() : "text";
|
|
1217
|
-
let
|
|
1218
|
-
const y =
|
|
1219
|
-
|
|
1217
|
+
let O = Er([o, s && s.toAbortSignal()], i), h;
|
|
1218
|
+
const y = O && O.unsubscribe && (() => {
|
|
1219
|
+
O.unsubscribe();
|
|
1220
1220
|
});
|
|
1221
1221
|
let m;
|
|
1222
1222
|
try {
|
|
@@ -1238,7 +1238,7 @@ const Ar = async (e) => {
|
|
|
1238
1238
|
const p = "credentials" in Request.prototype;
|
|
1239
1239
|
h = new Request(t, {
|
|
1240
1240
|
...g,
|
|
1241
|
-
signal:
|
|
1241
|
+
signal: O,
|
|
1242
1242
|
method: n.toUpperCase(),
|
|
1243
1243
|
headers: u.normalize().toJSON(),
|
|
1244
1244
|
body: r,
|
|
@@ -1328,22 +1328,22 @@ const Qe = (e) => `- ${e}`, Pr = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1328
1328
|
},
|
|
1329
1329
|
adapters: Ce
|
|
1330
1330
|
};
|
|
1331
|
-
function
|
|
1331
|
+
function Se(e) {
|
|
1332
1332
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1333
1333
|
throw new q(null, e);
|
|
1334
1334
|
}
|
|
1335
1335
|
function Ye(e) {
|
|
1336
|
-
return
|
|
1336
|
+
return Se(e), e.headers = x.from(e.headers), e.data = Ee.call(
|
|
1337
1337
|
e,
|
|
1338
1338
|
e.transformRequest
|
|
1339
1339
|
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Dt.getAdapter(e.adapter || Q.adapter)(e).then(function(r) {
|
|
1340
|
-
return
|
|
1340
|
+
return Se(e), r.data = Ee.call(
|
|
1341
1341
|
e,
|
|
1342
1342
|
e.transformResponse,
|
|
1343
1343
|
r
|
|
1344
1344
|
), r.headers = x.from(r.headers), r;
|
|
1345
1345
|
}, function(r) {
|
|
1346
|
-
return Pt(r) || (
|
|
1346
|
+
return Pt(r) || (Se(e), r && r.response && (r.response.data = Ee.call(
|
|
1347
1347
|
e,
|
|
1348
1348
|
e.transformResponse,
|
|
1349
1349
|
r.response
|
|
@@ -1367,16 +1367,11 @@ he.transitional = function(t, n, r) {
|
|
|
1367
1367
|
o(i, " has been removed" + (n ? " in " + n : "")),
|
|
1368
1368
|
b.ERR_DEPRECATED
|
|
1369
1369
|
);
|
|
1370
|
-
return n && !et[i] && (et[i] = !0,
|
|
1371
|
-
o(
|
|
1372
|
-
i,
|
|
1373
|
-
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1374
|
-
)
|
|
1375
|
-
)), t ? t(s, i, c) : !0;
|
|
1370
|
+
return n && !et[i] && (et[i] = !0), t ? t(s, i, c) : !0;
|
|
1376
1371
|
};
|
|
1377
1372
|
};
|
|
1378
1373
|
he.spelling = function(t) {
|
|
1379
|
-
return (n, r) =>
|
|
1374
|
+
return (n, r) => !0;
|
|
1380
1375
|
};
|
|
1381
1376
|
function vr(e, t, n) {
|
|
1382
1377
|
if (typeof e != "object")
|
|
@@ -1474,18 +1469,18 @@ let D = class {
|
|
|
1474
1469
|
return u;
|
|
1475
1470
|
}
|
|
1476
1471
|
g = c.length;
|
|
1477
|
-
let
|
|
1472
|
+
let O = n;
|
|
1478
1473
|
for (d = 0; d < g; ) {
|
|
1479
1474
|
const h = c[d++], y = c[d++];
|
|
1480
1475
|
try {
|
|
1481
|
-
|
|
1476
|
+
O = h(O);
|
|
1482
1477
|
} catch (m) {
|
|
1483
1478
|
y.call(this, m);
|
|
1484
1479
|
break;
|
|
1485
1480
|
}
|
|
1486
1481
|
}
|
|
1487
1482
|
try {
|
|
1488
|
-
u = Ye.call(this,
|
|
1483
|
+
u = Ye.call(this, O);
|
|
1489
1484
|
} catch (h) {
|
|
1490
1485
|
return Promise.reject(h);
|
|
1491
1486
|
}
|
|
@@ -1710,8 +1705,8 @@ const {
|
|
|
1710
1705
|
isAxiosError: gi,
|
|
1711
1706
|
spread: wi,
|
|
1712
1707
|
toFormData: Ei,
|
|
1713
|
-
AxiosHeaders:
|
|
1714
|
-
HttpStatusCode:
|
|
1708
|
+
AxiosHeaders: Si,
|
|
1709
|
+
HttpStatusCode: Oi,
|
|
1715
1710
|
formToJSON: Ti,
|
|
1716
1711
|
getAdapter: _i,
|
|
1717
1712
|
mergeConfig: Ri
|
|
@@ -1802,8 +1797,8 @@ function Be(e) {
|
|
|
1802
1797
|
var t = be(e);
|
|
1803
1798
|
return t == to || t == no || t == eo || t == ro;
|
|
1804
1799
|
}
|
|
1805
|
-
var
|
|
1806
|
-
var e = /[^.]+$/.exec(
|
|
1800
|
+
var Oe = M["__core-js_shared__"], nt = function() {
|
|
1801
|
+
var e = /[^.]+$/.exec(Oe && Oe.keys && Oe.keys.IE_PROTO || "");
|
|
1807
1802
|
return e ? "Symbol(src)_1." + e : "";
|
|
1808
1803
|
}();
|
|
1809
1804
|
function oo(e) {
|
|
@@ -1847,14 +1842,14 @@ function wo(e) {
|
|
|
1847
1842
|
var t = this.has(e) && delete this.__data__[e];
|
|
1848
1843
|
return this.size -= t ? 1 : 0, t;
|
|
1849
1844
|
}
|
|
1850
|
-
var Eo = "__lodash_hash_undefined__",
|
|
1845
|
+
var Eo = "__lodash_hash_undefined__", So = Object.prototype, Oo = So.hasOwnProperty;
|
|
1851
1846
|
function To(e) {
|
|
1852
1847
|
var t = this.__data__;
|
|
1853
1848
|
if (W) {
|
|
1854
1849
|
var n = t[e];
|
|
1855
1850
|
return n === Eo ? void 0 : n;
|
|
1856
1851
|
}
|
|
1857
|
-
return
|
|
1852
|
+
return Oo.call(t, e) ? t[e] : void 0;
|
|
1858
1853
|
}
|
|
1859
1854
|
var _o = Object.prototype, Ro = _o.hasOwnProperty;
|
|
1860
1855
|
function Ao(e) {
|
|
@@ -2047,11 +2042,11 @@ function as(e) {
|
|
|
2047
2042
|
var n = ss.call(t, "constructor") && t.constructor;
|
|
2048
2043
|
return typeof n == "function" && n instanceof n && Gt.call(n) == is;
|
|
2049
2044
|
}
|
|
2050
|
-
var cs = "[object Arguments]", us = "[object Array]", ls = "[object Boolean]", fs = "[object Date]", ds = "[object Error]", ps = "[object Function]", hs = "[object Map]", ms = "[object Number]", ys = "[object Object]", bs = "[object RegExp]", gs = "[object Set]", ws = "[object String]", Es = "[object WeakMap]",
|
|
2051
|
-
|
|
2052
|
-
|
|
2045
|
+
var cs = "[object Arguments]", us = "[object Array]", ls = "[object Boolean]", fs = "[object Date]", ds = "[object Error]", ps = "[object Function]", hs = "[object Map]", ms = "[object Number]", ys = "[object Object]", bs = "[object RegExp]", gs = "[object Set]", ws = "[object String]", Es = "[object WeakMap]", Ss = "[object ArrayBuffer]", Os = "[object DataView]", Ts = "[object Float32Array]", _s = "[object Float64Array]", Rs = "[object Int8Array]", As = "[object Int16Array]", xs = "[object Int32Array]", Cs = "[object Uint8Array]", Ps = "[object Uint8ClampedArray]", vs = "[object Uint16Array]", js = "[object Uint32Array]", S = {};
|
|
2046
|
+
S[Ts] = S[_s] = S[Rs] = S[As] = S[xs] = S[Cs] = S[Ps] = S[vs] = S[js] = !0;
|
|
2047
|
+
S[cs] = S[us] = S[Ss] = S[ls] = S[Os] = S[fs] = S[ds] = S[ps] = S[hs] = S[ms] = S[ys] = S[bs] = S[gs] = S[ws] = S[Es] = !1;
|
|
2053
2048
|
function Ns(e) {
|
|
2054
|
-
return Y(e) && Vt(e.length) && !!
|
|
2049
|
+
return Y(e) && Vt(e.length) && !!S[be(e)];
|
|
2055
2050
|
}
|
|
2056
2051
|
function Fs(e) {
|
|
2057
2052
|
return function(t) {
|
|
@@ -2133,8 +2128,8 @@ function Ws(e, t, n, r, o, s, i) {
|
|
|
2133
2128
|
}
|
|
2134
2129
|
var u = s ? s(c, f, n + "", e, t, i) : void 0, d = u === void 0;
|
|
2135
2130
|
if (d) {
|
|
2136
|
-
var g = Ne(f),
|
|
2137
|
-
u = f, g ||
|
|
2131
|
+
var g = Ne(f), O = !g && Wt(f), h = !g && !O && Zt(f);
|
|
2132
|
+
u = f, g || O || h ? Ne(c) ? u = c : Qo(c) ? u = zo(c) : O ? (d = !1, u = qo(f)) : h ? (d = !1, u = Ho(f)) : u = [] : as(f) || je(f) ? (u = c, je(c) ? u = Ks(c) : (!$(c) || Be(c)) && (u = Ko(f))) : d = !1;
|
|
2138
2133
|
}
|
|
2139
2134
|
d && (i.set(f, u), o(u, f, r, s, i), i.delete(f)), ve(e, n, u);
|
|
2140
2135
|
}
|
package/curring-http/index.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/utils",
|
|
3
|
-
"version": "7.1.0-dev.
|
|
3
|
+
"version": "7.1.0-dev.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@antv/x6": "^2.18.1",
|
|
12
|
-
"@das-fed/utils": "7.1.0-dev.
|
|
12
|
+
"@das-fed/utils": "7.1.0-dev.11",
|
|
13
13
|
"@vue/shared": "^3.4.21",
|
|
14
14
|
"@vueuse/core": "^9.6.0",
|
|
15
15
|
"axios": "^1.6.7",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"vue": "^3.4.21"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@das-fed/cli": "7.1.0-dev.
|
|
25
|
-
"@das-fed/web": "7.1.0-dev.
|
|
24
|
+
"@das-fed/cli": "7.1.0-dev.11",
|
|
25
|
+
"@das-fed/web": "7.1.0-dev.11",
|
|
26
26
|
"@types/js-cookie": "^3.0.6",
|
|
27
27
|
"@types/lodash-es": "^4.17.12",
|
|
28
28
|
"@types/qs": "^6.9.15",
|
|
@@ -23799,7 +23799,7 @@ const mn = new F(), pn = () => mn, r = (n) => {
|
|
|
23799
23799
|
return n.split(" ").forEach((u) => {
|
|
23800
23800
|
g.push(i ? u[0] : u);
|
|
23801
23801
|
}), g.join(" ");
|
|
23802
|
-
}, Sn = (n) => typeof n
|
|
23802
|
+
}, Sn = (n) => typeof n == "string";
|
|
23803
23803
|
function p(n, i) {
|
|
23804
23804
|
return i instanceof RegExp ? i.test(n) : !0;
|
|
23805
23805
|
}
|
|
Binary file
|
|
@@ -1,65 +1,60 @@
|
|
|
1
1
|
import { getConfig as m } from "@das-fed/utils/config";
|
|
2
2
|
import { getToken as f } from "@das-fed/utils/common-info";
|
|
3
|
-
import { objectToUrlparams as
|
|
3
|
+
import { objectToUrlparams as d } from "@das-fed/utils/common-tools";
|
|
4
4
|
const c = m(), h = () => {
|
|
5
5
|
let s = "";
|
|
6
6
|
return c.baseURL ? s = c.baseURL : s = location.origin, s.replace("https://", "wss://").replace("http://", "ws://") || "";
|
|
7
|
-
},
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
},
|
|
7
|
+
}, w = (s, t = {}) => {
|
|
8
|
+
const e = d(t);
|
|
9
|
+
return e ? h() + s + `?${e}` : h() + s;
|
|
10
|
+
}, p = (s, t) => Math.floor(Math.random() * (t - s + 1)) + s;
|
|
11
11
|
class R {
|
|
12
12
|
constructor({
|
|
13
|
-
url:
|
|
14
|
-
params:
|
|
15
|
-
opened:
|
|
16
|
-
close:
|
|
17
|
-
error:
|
|
18
|
-
message:
|
|
19
|
-
ifReconnect:
|
|
20
|
-
reconnectNum:
|
|
13
|
+
url: t,
|
|
14
|
+
params: e = {},
|
|
15
|
+
opened: r,
|
|
16
|
+
close: n,
|
|
17
|
+
error: i,
|
|
18
|
+
message: o,
|
|
19
|
+
ifReconnect: a,
|
|
20
|
+
reconnectNum: l,
|
|
21
21
|
reconnectWhenClose: u
|
|
22
22
|
}) {
|
|
23
|
-
if (this.$ws = null, this.url = "", this.params = {}, this.lockReturn = !1, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = !0, this.reconnectId = null, this.reconnectNum = 3, this.reconnectWhenClose = !1, this.currentReconnectNum = 0, this.$ws = null, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect =
|
|
24
|
-
this.url =
|
|
23
|
+
if (this.$ws = null, this.url = "", this.params = {}, this.lockReturn = !1, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = !0, this.reconnectId = null, this.reconnectNum = 3, this.reconnectWhenClose = !1, this.currentReconnectNum = 0, this.$ws = null, this.startTime = 0, this.heartbeatInterval = null, this.ifReconnect = a ?? !0, this.reconnectNum = l ?? 3, this.reconnectWhenClose = u ?? !1, this.lockReturn = !1, this.currentReconnectNum = 0, this.reconnectId = null, this.params = { ...e, access_token: f() }, t)
|
|
24
|
+
this.url = t;
|
|
25
25
|
else
|
|
26
26
|
throw new Error("url is required");
|
|
27
|
-
|
|
27
|
+
r && (this.opened = r), n && (this.close = n), i && (this.error = i), o && (this.afterMsg = o), this.initWebSocket();
|
|
28
28
|
}
|
|
29
29
|
initWebSocket() {
|
|
30
30
|
if (typeof WebSocket > "u") throw new Error("您的浏览器不支持websocket");
|
|
31
|
-
const
|
|
32
|
-
this.$ws = new WebSocket(
|
|
31
|
+
const t = w(this.url, this.params);
|
|
32
|
+
this.$ws = new WebSocket(t), this.$ws.onopen = () => {
|
|
33
33
|
this.open();
|
|
34
|
-
}, this.$ws.onclose = (
|
|
35
|
-
this.close(
|
|
36
|
-
}, this.$ws.onmessage = (
|
|
37
|
-
this.message(
|
|
38
|
-
}, this.$ws.onerror = (
|
|
39
|
-
this.error(
|
|
34
|
+
}, this.$ws.onclose = (e) => {
|
|
35
|
+
this.close(e);
|
|
36
|
+
}, this.$ws.onmessage = (e) => {
|
|
37
|
+
this.message(e);
|
|
38
|
+
}, this.$ws.onerror = (e) => {
|
|
39
|
+
this.error(e);
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
open() {
|
|
43
|
-
this.currentReconnectNum = 0, this.startTime = (/* @__PURE__ */ new Date()).getTime(), this.opened(this.$ws), this.startHeartbeat()
|
|
43
|
+
this.currentReconnectNum = 0, this.startTime = (/* @__PURE__ */ new Date()).getTime(), this.opened(this.$ws), this.startHeartbeat();
|
|
44
44
|
}
|
|
45
|
-
opened(
|
|
46
|
-
console.log(this.url + " =>websocket连接已打开:", e);
|
|
45
|
+
opened(t) {
|
|
47
46
|
}
|
|
48
|
-
close(
|
|
49
|
-
|
|
50
|
-
const t = (/* @__PURE__ */ new Date()).getTime();
|
|
51
|
-
this.reconnectWhenClose && this.reconnect(), clearInterval(this.heartbeatInterval), console.log(`${this.url}=>WebSocket连接已经关闭,连接总时长: ${t - this.startTime}ms`);
|
|
52
|
-
}
|
|
47
|
+
close(t) {
|
|
48
|
+
this.$ws.readyState === WebSocket.CLOSED && ((/* @__PURE__ */ new Date()).getTime(), this.reconnectWhenClose && this.reconnect(), clearInterval(this.heartbeatInterval));
|
|
53
49
|
}
|
|
54
|
-
message(
|
|
55
|
-
const
|
|
56
|
-
this.afterMsg(
|
|
50
|
+
message(t) {
|
|
51
|
+
const e = typeof t.data == "object" ? t.data : JSON.parse(t.data);
|
|
52
|
+
this.afterMsg(e);
|
|
57
53
|
}
|
|
58
|
-
afterMsg(
|
|
59
|
-
console.log(this.url + " =>接收到websocket的消息:", e);
|
|
54
|
+
afterMsg(t) {
|
|
60
55
|
}
|
|
61
|
-
error(
|
|
62
|
-
return this.ifReconnect && this.reconnect(),
|
|
56
|
+
error(t) {
|
|
57
|
+
return this.ifReconnect && this.reconnect(), t;
|
|
63
58
|
}
|
|
64
59
|
/** websocket重连 */
|
|
65
60
|
reconnect() {
|
|
@@ -68,24 +63,19 @@ class R {
|
|
|
68
63
|
}, 3e3)));
|
|
69
64
|
}
|
|
70
65
|
/** 发送消息给服务器 */
|
|
71
|
-
send(
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
console.log(this.url + "=>websocket连接未建立,还不能发送消息");
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
this.$ws.send(e);
|
|
66
|
+
send(t) {
|
|
67
|
+
var e;
|
|
68
|
+
((e = this.$ws) == null ? void 0 : e.readyState) === WebSocket.OPEN && this.$ws.send(t);
|
|
78
69
|
}
|
|
79
70
|
// 启动心跳检测==>30s-5分钟内随机发一次心跳保持会话(时间区间内随机是为了降低突增流量的概率)
|
|
80
71
|
startHeartbeat() {
|
|
81
72
|
this.heartbeatInterval = setInterval(() => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, g(3e4, 3e5));
|
|
73
|
+
this.send("");
|
|
74
|
+
}, p(3e4, 3e5));
|
|
85
75
|
}
|
|
86
76
|
/** 断开连接 */
|
|
87
77
|
disconnect() {
|
|
88
|
-
this.$ws.close()
|
|
78
|
+
this.$ws.close();
|
|
89
79
|
}
|
|
90
80
|
}
|
|
91
81
|
export {
|
|
Binary file
|