@das-fed/utils 7.0.7-hot.20 → 7.0.7-hot.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.
Files changed (68) hide show
  1. package/api-services/index.js +832 -841
  2. package/api-services/index.js.gz +0 -0
  3. package/api-services/modules/app-manage/index.js +749 -726
  4. package/api-services/modules/app-manage/index.js.gz +0 -0
  5. package/api-services/modules/authentication/index.js +656 -647
  6. package/api-services/modules/authentication/index.js.gz +0 -0
  7. package/api-services/modules/bems/index.js +750 -731
  8. package/api-services/modules/bems/index.js.gz +0 -0
  9. package/api-services/modules/contract/index.js +7 -2
  10. package/api-services/modules/contract/index.js.gz +0 -0
  11. package/api-services/modules/duty-manage/index.js +745 -726
  12. package/api-services/modules/duty-manage/index.js.gz +0 -0
  13. package/api-services/modules/enterpriseright/index.js +7 -2
  14. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  15. package/api-services/modules/file/index.js +756 -765
  16. package/api-services/modules/file/index.js.gz +0 -0
  17. package/api-services/modules/gateway-edge/index.js +731 -744
  18. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  19. package/api-services/modules/index.js +7 -2
  20. package/api-services/modules/index.js.gz +0 -0
  21. package/api-services/modules/iot/index.js +636 -635
  22. package/api-services/modules/iot/index.js.gz +0 -0
  23. package/api-services/modules/justauth/index.js +750 -727
  24. package/api-services/modules/justauth/index.js.gz +0 -0
  25. package/api-services/modules/knowledge/index.js +7 -2
  26. package/api-services/modules/knowledge/index.js.gz +0 -0
  27. package/api-services/modules/link/index.js +7 -2
  28. package/api-services/modules/link/index.js.gz +0 -0
  29. package/api-services/modules/permission/index.js +652 -651
  30. package/api-services/modules/permission/index.js.gz +0 -0
  31. package/api-services/modules/platformManage/index.js +758 -735
  32. package/api-services/modules/platformManage/index.js.gz +0 -0
  33. package/api-services/modules/portal/index.js +627 -626
  34. package/api-services/modules/portal/index.js.gz +0 -0
  35. package/api-services/modules/space-manage/index.js +7 -2
  36. package/api-services/modules/space-manage/index.js.gz +0 -0
  37. package/api-services/modules/super-admin/index.js +7 -2
  38. package/api-services/modules/super-admin/index.js.gz +0 -0
  39. package/api-services/modules/supplier/index.js +7 -2
  40. package/api-services/modules/supplier/index.js.gz +0 -0
  41. package/api-services/modules/supplychain-manage/index.js +749 -726
  42. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  43. package/api-services/modules/systemConfiguration/index.js +7 -2
  44. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  45. package/api-services/modules/tool/index.js +731 -744
  46. package/api-services/modules/tool/index.js.gz +0 -0
  47. package/api-services/src/create-service/index.js +7 -2
  48. package/api-services/src/create-service/index.js.gz +0 -0
  49. package/common-info/getInfoFromUrl/index.js +36 -36
  50. package/common-info/getInfoFromUrl/index.js.gz +0 -0
  51. package/common-info/set-personal-info/index.js +49 -44
  52. package/common-info/set-personal-info/index.js.gz +0 -0
  53. package/common-tools/extract-file-name/index.js +7 -2
  54. package/common-tools/extract-file-name/index.js.gz +0 -0
  55. package/create-api-service/index.js +7 -2
  56. package/create-api-service/index.js.gz +0 -0
  57. package/create-api-service/sso/authorizer.d.ts +1 -0
  58. package/create-api-service/sso/index.d.ts +2 -1
  59. package/create-api-service/sso/index.js +867 -795
  60. package/create-api-service/sso/index.js.gz +0 -0
  61. package/create-api-service/sso/utils.d.ts +2 -0
  62. package/curring-http/index.js +52 -47
  63. package/curring-http/index.js.gz +0 -0
  64. package/package.json +4 -4
  65. package/pinyin-first-character/index.js +1 -1
  66. package/pinyin-first-character/index.js.gz +0 -0
  67. package/webSocket-service/index.js +50 -40
  68. package/webSocket-service/index.js.gz +0 -0
Binary file
@@ -0,0 +1,2 @@
1
+ export declare const getQuery: (name: string) => any;
2
+ export declare const removeQueryParams: (paramsToRemove: any[]) => void;
@@ -71,9 +71,9 @@ function _e() {
71
71
  arguments[r] && Z(arguments[r], n);
72
72
  return t;
73
73
  }
74
- const Sn = (e, t, n, { allOwnKeys: r } = {}) => (Z(t, (o, s) => {
74
+ const On = (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), On = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Tn = (e, t, n, r) => {
76
+ }, { allOwnKeys: r }), e), Sn = (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), St = ((e, t) => e ? setImmediate : t ? ((n, r) => (U.addEventListener("message", ({ source: o, data: s }) => {
173
+ }, In = P("AsyncFunction"), qn = (e) => e && (X(e) || A(e)) && A(e.then) && A(e.catch), Ot = ((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 || St, Hn = (e) => e != null && A(e[ue]), a = {
180
+ ), Mn = typeof queueMicrotask < "u" ? queueMicrotask.bind(U) : typeof process < "u" && process.nextTick || Ot, 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: Sn,
208
+ extend: On,
209
209
  trim: En,
210
- stripBOM: On,
210
+ stripBOM: Sn,
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: St,
236
+ setImmediate: Ot,
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 Ot = b.prototype, Tt = {};
264
+ const St = b.prototype, Tt = {};
265
265
  [
266
266
  "ERR_BAD_OPTION_VALUE",
267
267
  "ERR_BAD_OPTION",
@@ -280,9 +280,9 @@ const Ot = b.prototype, Tt = {};
280
280
  Tt[e] = { value: e };
281
281
  });
282
282
  Object.defineProperties(b, Tt);
283
- Object.defineProperty(Ot, "isAxiosError", { value: !0 });
283
+ Object.defineProperty(St, "isAxiosError", { value: !0 });
284
284
  b.from = (e, t, n, r, o, s) => {
285
- const i = Object.create(Ot);
285
+ const i = Object.create(St);
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 O(h, y) {
352
+ function S(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 && O(p, y ? y.concat(w) : [w]);
363
+ )) === !0 && S(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 O(e), t;
369
+ return S(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 O = u && l - u;
854
- return O ? Math.round(g * 1e3 / O) : void 0;
853
+ const S = u && l - u;
854
+ return S ? Math.round(g * 1e3 / S) : 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, O, h;
1026
+ let { responseType: c, onUploadProgress: f, onDownloadProgress: l } = o, u, d, g, S, h;
1027
1027
  function y() {
1028
- O && O(), h && h(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u);
1028
+ S && S(), 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, O] = se(f), m.upload.addEventListener("progress", d), m.upload.addEventListener("loadend", O)), (o.cancelToken || o.signal) && (u = (E) => {
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, S] = se(f), m.upload.addEventListener("progress", d), m.upload.addEventListener("loadend", S)), (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
- }, Sr = function* (e, t) {
1101
+ }, Or = 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
- }, Or = async function* (e, t) {
1110
+ }, Sr = async function* (e, t) {
1111
1111
  for await (const n of Tr(e))
1112
- yield* Sr(n, t);
1112
+ yield* Or(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 = Or(e, t);
1130
+ const o = Sr(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 O = Er([o, s && s.toAbortSignal()], i), h;
1218
- const y = O && O.unsubscribe && (() => {
1219
- O.unsubscribe();
1217
+ let S = Er([o, s && s.toAbortSignal()], i), h;
1218
+ const y = S && S.unsubscribe && (() => {
1219
+ S.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: O,
1241
+ signal: S,
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 Se(e) {
1331
+ function Oe(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 Se(e), e.headers = x.from(e.headers), e.data = Ee.call(
1336
+ return Oe(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 Se(e), r.data = Ee.call(
1340
+ return Oe(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) || (Se(e), r && r.response && (r.response.data = Ee.call(
1346
+ return Pt(r) || (Oe(e), r && r.response && (r.response.data = Ee.call(
1347
1347
  e,
1348
1348
  e.transformResponse,
1349
1349
  r.response
@@ -1367,11 +1367,16 @@ 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), t ? t(s, i, c) : !0;
1370
+ return n && !et[i] && (et[i] = !0, console.warn(
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;
1371
1376
  };
1372
1377
  };
1373
1378
  he.spelling = function(t) {
1374
- return (n, r) => !0;
1379
+ return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
1375
1380
  };
1376
1381
  function vr(e, t, n) {
1377
1382
  if (typeof e != "object")
@@ -1469,18 +1474,18 @@ let D = class {
1469
1474
  return u;
1470
1475
  }
1471
1476
  g = c.length;
1472
- let O = n;
1477
+ let S = n;
1473
1478
  for (d = 0; d < g; ) {
1474
1479
  const h = c[d++], y = c[d++];
1475
1480
  try {
1476
- O = h(O);
1481
+ S = h(S);
1477
1482
  } catch (m) {
1478
1483
  y.call(this, m);
1479
1484
  break;
1480
1485
  }
1481
1486
  }
1482
1487
  try {
1483
- u = Ye.call(this, O);
1488
+ u = Ye.call(this, S);
1484
1489
  } catch (h) {
1485
1490
  return Promise.reject(h);
1486
1491
  }
@@ -1705,8 +1710,8 @@ const {
1705
1710
  isAxiosError: gi,
1706
1711
  spread: wi,
1707
1712
  toFormData: Ei,
1708
- AxiosHeaders: Si,
1709
- HttpStatusCode: Oi,
1713
+ AxiosHeaders: Oi,
1714
+ HttpStatusCode: Si,
1710
1715
  formToJSON: Ti,
1711
1716
  getAdapter: _i,
1712
1717
  mergeConfig: Ri
@@ -1797,8 +1802,8 @@ function Be(e) {
1797
1802
  var t = be(e);
1798
1803
  return t == to || t == no || t == eo || t == ro;
1799
1804
  }
1800
- var Oe = M["__core-js_shared__"], nt = function() {
1801
- var e = /[^.]+$/.exec(Oe && Oe.keys && Oe.keys.IE_PROTO || "");
1805
+ var Se = M["__core-js_shared__"], nt = function() {
1806
+ var e = /[^.]+$/.exec(Se && Se.keys && Se.keys.IE_PROTO || "");
1802
1807
  return e ? "Symbol(src)_1." + e : "";
1803
1808
  }();
1804
1809
  function oo(e) {
@@ -1842,14 +1847,14 @@ function wo(e) {
1842
1847
  var t = this.has(e) && delete this.__data__[e];
1843
1848
  return this.size -= t ? 1 : 0, t;
1844
1849
  }
1845
- var Eo = "__lodash_hash_undefined__", So = Object.prototype, Oo = So.hasOwnProperty;
1850
+ var Eo = "__lodash_hash_undefined__", Oo = Object.prototype, So = Oo.hasOwnProperty;
1846
1851
  function To(e) {
1847
1852
  var t = this.__data__;
1848
1853
  if (W) {
1849
1854
  var n = t[e];
1850
1855
  return n === Eo ? void 0 : n;
1851
1856
  }
1852
- return Oo.call(t, e) ? t[e] : void 0;
1857
+ return So.call(t, e) ? t[e] : void 0;
1853
1858
  }
1854
1859
  var _o = Object.prototype, Ro = _o.hasOwnProperty;
1855
1860
  function Ao(e) {
@@ -2042,11 +2047,11 @@ function as(e) {
2042
2047
  var n = ss.call(t, "constructor") && t.constructor;
2043
2048
  return typeof n == "function" && n instanceof n && Gt.call(n) == is;
2044
2049
  }
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;
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]", Os = "[object ArrayBuffer]", Ss = "[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]", O = {};
2051
+ O[Ts] = O[_s] = O[Rs] = O[As] = O[xs] = O[Cs] = O[Ps] = O[vs] = O[js] = !0;
2052
+ O[cs] = O[us] = O[Os] = O[ls] = O[Ss] = O[fs] = O[ds] = O[ps] = O[hs] = O[ms] = O[ys] = O[bs] = O[gs] = O[ws] = O[Es] = !1;
2048
2053
  function Ns(e) {
2049
- return Y(e) && Vt(e.length) && !!S[be(e)];
2054
+ return Y(e) && Vt(e.length) && !!O[be(e)];
2050
2055
  }
2051
2056
  function Fs(e) {
2052
2057
  return function(t) {
@@ -2128,8 +2133,8 @@ function Ws(e, t, n, r, o, s, i) {
2128
2133
  }
2129
2134
  var u = s ? s(c, f, n + "", e, t, i) : void 0, d = u === void 0;
2130
2135
  if (d) {
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;
2136
+ var g = Ne(f), S = !g && Wt(f), h = !g && !S && Zt(f);
2137
+ u = f, g || S || h ? Ne(c) ? u = c : Qo(c) ? u = zo(c) : S ? (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;
2133
2138
  }
2134
2139
  d && (i.set(f, u), o(u, f, r, s, i), i.delete(f)), ve(e, n, u);
2135
2140
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "7.0.7-hot.20",
3
+ "version": "7.0.7-hot.22",
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.0.7-hot.20",
12
+ "@das-fed/utils": "7.0.7-hot.22",
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.0.7-hot.20",
25
- "@das-fed/web": "7.0.7-hot.20",
24
+ "@das-fed/cli": "7.0.7-hot.22",
25
+ "@das-fed/web": "7.0.7-hot.22",
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 == "string";
23802
+ }, Sn = (n) => typeof n != "string" ? (console.error("The first param of pinyin is error: " + n + ' is not assignable to type "string".'), !1) : !0;
23803
23803
  function p(n, i) {
23804
23804
  return i instanceof RegExp ? i.test(n) : !0;
23805
23805
  }
Binary file
@@ -1,60 +1,65 @@
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 d } from "@das-fed/utils/common-tools";
3
+ import { objectToUrlparams as w } 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
- }, 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;
7
+ }, b = (s, e = {}) => {
8
+ const t = w(e);
9
+ return t ? h() + s + `?${t}` : h() + s;
10
+ }, g = (s, e) => Math.floor(Math.random() * (e - s + 1)) + s;
11
11
  class R {
12
12
  constructor({
13
- url: t,
14
- params: e = {},
15
- opened: r,
16
- close: n,
17
- error: i,
18
- message: o,
19
- ifReconnect: a,
20
- reconnectNum: l,
13
+ url: e,
14
+ params: t = {},
15
+ opened: n,
16
+ close: r,
17
+ error: o,
18
+ message: i,
19
+ ifReconnect: l,
20
+ reconnectNum: a,
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 = 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;
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 = l ?? !0, this.reconnectNum = a ?? 3, this.reconnectWhenClose = u ?? !1, this.lockReturn = !1, this.currentReconnectNum = 0, this.reconnectId = null, this.params = { ...t, access_token: f() }, e)
24
+ this.url = e;
25
25
  else
26
26
  throw new Error("url is required");
27
- r && (this.opened = r), n && (this.close = n), i && (this.error = i), o && (this.afterMsg = o), this.initWebSocket();
27
+ n && (this.opened = n), r && (this.close = r), o && (this.error = o), i && (this.afterMsg = i), this.initWebSocket();
28
28
  }
29
29
  initWebSocket() {
30
30
  if (typeof WebSocket > "u") throw new Error("您的浏览器不支持websocket");
31
- const t = w(this.url, this.params);
32
- this.$ws = new WebSocket(t), this.$ws.onopen = () => {
31
+ const e = b(this.url, this.params);
32
+ this.$ws = new WebSocket(e), this.$ws.onopen = () => {
33
33
  this.open();
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);
34
+ }, this.$ws.onclose = (t) => {
35
+ this.close(t);
36
+ }, this.$ws.onmessage = (t) => {
37
+ this.message(t);
38
+ }, this.$ws.onerror = (t) => {
39
+ this.error(t);
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(), console.log(this.url + " =>websocket连接成功,可以开始通讯");
44
44
  }
45
- opened(t) {
45
+ opened(e) {
46
+ console.log(this.url + " =>websocket连接已打开:", e);
46
47
  }
47
- close(t) {
48
- this.$ws.readyState === WebSocket.CLOSED && ((/* @__PURE__ */ new Date()).getTime(), this.reconnectWhenClose && this.reconnect(), clearInterval(this.heartbeatInterval));
48
+ close(e) {
49
+ if (this.$ws.readyState === WebSocket.CLOSED) {
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
+ }
49
53
  }
50
- message(t) {
51
- const e = typeof t.data == "object" ? t.data : JSON.parse(t.data);
52
- this.afterMsg(e);
54
+ message(e) {
55
+ const t = typeof e.data == "object" ? e.data : JSON.parse(e.data);
56
+ this.afterMsg(t);
53
57
  }
54
- afterMsg(t) {
58
+ afterMsg(e) {
59
+ console.log(this.url + " =>接收到websocket的消息:", e);
55
60
  }
56
- error(t) {
57
- return this.ifReconnect && this.reconnect(), t;
61
+ error(e) {
62
+ return this.ifReconnect && this.reconnect(), e;
58
63
  }
59
64
  /** websocket重连 */
60
65
  reconnect() {
@@ -63,19 +68,24 @@ class R {
63
68
  }, 3e3)));
64
69
  }
65
70
  /** 发送消息给服务器 */
66
- send(t) {
67
- var e;
68
- ((e = this.$ws) == null ? void 0 : e.readyState) === WebSocket.OPEN && this.$ws.send(t);
71
+ send(e) {
72
+ var t;
73
+ if (((t = this.$ws) == null ? void 0 : t.readyState) !== WebSocket.OPEN) {
74
+ console.log(this.url + "=>websocket连接未建立,还不能发送消息");
75
+ return;
76
+ }
77
+ this.$ws.send(e);
69
78
  }
70
79
  // 启动心跳检测==>30s-5分钟内随机发一次心跳保持会话(时间区间内随机是为了降低突增流量的概率)
71
80
  startHeartbeat() {
72
81
  this.heartbeatInterval = setInterval(() => {
73
- this.send("");
74
- }, p(3e4, 3e5));
82
+ const e = "";
83
+ this.send(e), console.log(this.url + "=>心跳检测发送消息:", e);
84
+ }, g(3e4, 3e5));
75
85
  }
76
86
  /** 断开连接 */
77
87
  disconnect() {
78
- this.$ws.close();
88
+ this.$ws.close(), console.log(this.url + " =>主动断开websocket连接");
79
89
  }
80
90
  }
81
91
  export {
Binary file