@das-fed/utils 7.0.0-beta.5 → 7.0.0-zhaohang.2

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 (63) hide show
  1. package/api-services/index.js +217 -231
  2. package/api-services/index.js.gz +0 -0
  3. package/api-services/modules/app-manage/index.js +445 -459
  4. package/api-services/modules/app-manage/index.js.gz +0 -0
  5. package/api-services/modules/authentication/index.js +445 -459
  6. package/api-services/modules/authentication/index.js.gz +0 -0
  7. package/api-services/modules/bems/index.js +337 -351
  8. package/api-services/modules/bems/index.js.gz +0 -0
  9. package/api-services/modules/contract/index.js +950 -946
  10. package/api-services/modules/contract/index.js.gz +0 -0
  11. package/api-services/modules/duty-manage/index.js +959 -959
  12. package/api-services/modules/duty-manage/index.js.gz +0 -0
  13. package/api-services/modules/enterpriseright/index.js +963 -995
  14. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  15. package/api-services/modules/file/index.js +929 -961
  16. package/api-services/modules/file/index.js.gz +0 -0
  17. package/api-services/modules/gateway-edge/index.js +445 -459
  18. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  19. package/api-services/modules/index.js +109 -123
  20. package/api-services/modules/index.js.gz +0 -0
  21. package/api-services/modules/iot/index.js +617 -631
  22. package/api-services/modules/iot/index.js.gz +0 -0
  23. package/api-services/modules/justauth/index.js +384 -398
  24. package/api-services/modules/justauth/index.js.gz +0 -0
  25. package/api-services/modules/knowledge/index.js +384 -398
  26. package/api-services/modules/knowledge/index.js.gz +0 -0
  27. package/api-services/modules/link/index.js +445 -459
  28. package/api-services/modules/link/index.js.gz +0 -0
  29. package/api-services/modules/permission/index.js +445 -459
  30. package/api-services/modules/permission/index.js.gz +0 -0
  31. package/api-services/modules/platformManage/index.js +676 -690
  32. package/api-services/modules/platformManage/index.js.gz +0 -0
  33. package/api-services/modules/portal/index.js +445 -459
  34. package/api-services/modules/portal/index.js.gz +0 -0
  35. package/api-services/modules/space-manage/index.js +445 -459
  36. package/api-services/modules/space-manage/index.js.gz +0 -0
  37. package/api-services/modules/super-admin/index.js +956 -952
  38. package/api-services/modules/super-admin/index.js.gz +0 -0
  39. package/api-services/modules/supplier/index.js +965 -961
  40. package/api-services/modules/supplier/index.js.gz +0 -0
  41. package/api-services/modules/supplychain-manage/index.js +384 -398
  42. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  43. package/api-services/modules/systemConfiguration/index.js +445 -459
  44. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  45. package/api-services/modules/tool/index.js +445 -459
  46. package/api-services/modules/tool/index.js.gz +0 -0
  47. package/api-services/src/create-service/index.js +445 -459
  48. package/api-services/src/create-service/index.js.gz +0 -0
  49. package/common-info/index.d.ts +0 -2
  50. package/common-info/index.js +19 -20
  51. package/common-info/index.js.gz +0 -0
  52. package/common-info/type.d.ts +7 -11
  53. package/common-tools/get-url-params/index.d.ts +1 -1
  54. package/create-api-service/index.d.ts +1 -3
  55. package/create-api-service/index.js +940 -940
  56. package/create-api-service/index.js.gz +0 -0
  57. package/create-api-service/sso/index.js +412 -411
  58. package/create-api-service/sso/index.js.gz +0 -0
  59. package/curring-http/index.js +95 -94
  60. package/curring-http/index.js.gz +0 -0
  61. package/curring-http/type.d.ts +3 -3
  62. package/esm-map.json +1 -2
  63. package/package.json +4 -4
Binary file
@@ -7,11 +7,11 @@ function ht(e, t) {
7
7
  const { toString: rn } = Object.prototype, { getPrototypeOf: Fe } = Object, ae = /* @__PURE__ */ ((e) => (t) => {
8
8
  const n = rn.call(t);
9
9
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
10
- })(/* @__PURE__ */ Object.create(null)), C = (e) => (e = e.toLowerCase(), (t) => ae(t) === e), ce = (e) => (t) => typeof t === e, { isArray: I } = Array, K = ce("undefined");
10
+ })(/* @__PURE__ */ Object.create(null)), P = (e) => (e = e.toLowerCase(), (t) => ae(t) === e), ce = (e) => (t) => typeof t === e, { isArray: I } = Array, K = ce("undefined");
11
11
  function on(e) {
12
12
  return e !== null && !K(e) && e.constructor !== null && !K(e.constructor) && x(e.constructor.isBuffer) && e.constructor.isBuffer(e);
13
13
  }
14
- const mt = C("ArrayBuffer");
14
+ const mt = P("ArrayBuffer");
15
15
  function sn(e) {
16
16
  let t;
17
17
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && mt(e.buffer), t;
@@ -21,11 +21,11 @@ const an = ce("string"), x = ce("function"), yt = ce("number"), ue = (e) => e !=
21
21
  return !1;
22
22
  const t = Fe(e);
23
23
  return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
24
- }, un = C("Date"), ln = C("File"), fn = C("Blob"), dn = C("FileList"), pn = (e) => ue(e) && x(e.pipe), hn = (e) => {
24
+ }, un = P("Date"), ln = P("File"), fn = P("Blob"), dn = P("FileList"), pn = (e) => ue(e) && x(e.pipe), hn = (e) => {
25
25
  let t;
26
26
  return e && (typeof FormData == "function" && e instanceof FormData || x(e.append) && ((t = ae(e)) === "formdata" || // detect form-data instance
27
27
  t === "object" && x(e.toString) && e.toString() === "[object FormData]"));
28
- }, mn = C("URLSearchParams"), [yn, bn, gn, wn] = ["ReadableStream", "Request", "Response", "Headers"].map(C), En = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
28
+ }, mn = P("URLSearchParams"), [yn, bn, gn, wn] = ["ReadableStream", "Request", "Response", "Headers"].map(P), En = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
29
29
  function G(e, t, { allOwnKeys: n = !1 } = {}) {
30
30
  if (e === null || typeof e > "u")
31
31
  return;
@@ -88,25 +88,25 @@ const Sn = (e, t, n, { allOwnKeys: r } = {}) => (G(t, (o, s) => {
88
88
  for (; t-- > 0; )
89
89
  n[t] = e[t];
90
90
  return n;
91
- }, xn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Fe(Uint8Array)), Pn = (e, t) => {
91
+ }, xn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Fe(Uint8Array)), Cn = (e, t) => {
92
92
  const r = (e && e[Symbol.iterator]).call(e);
93
93
  let o;
94
94
  for (; (o = r.next()) && !o.done; ) {
95
95
  const s = o.value;
96
96
  t.call(e, s[0], s[1]);
97
97
  }
98
- }, Cn = (e, t) => {
98
+ }, Pn = (e, t) => {
99
99
  let n;
100
100
  const r = [];
101
101
  for (; (n = e.exec(t)) !== null; )
102
102
  r.push(n);
103
103
  return r;
104
- }, vn = C("HTMLFormElement"), jn = (e) => e.toLowerCase().replace(
104
+ }, vn = P("HTMLFormElement"), jn = (e) => e.toLowerCase().replace(
105
105
  /[-_\s]([a-z\d])(\w*)/g,
106
106
  function(n, r, o) {
107
107
  return r.toUpperCase() + o;
108
108
  }
109
- ), He = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Nn = C("RegExp"), wt = (e, t) => {
109
+ ), He = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Nn = P("RegExp"), wt = (e, t) => {
110
110
  const n = Object.getOwnPropertyDescriptors(e), r = {};
111
111
  G(n, (o, s) => {
112
112
  let i;
@@ -166,7 +166,7 @@ const In = (e) => {
166
166
  return r;
167
167
  };
168
168
  return n(e, 0);
169
- }, qn = C("AsyncFunction"), Hn = (e) => e && (ue(e) || x(e)) && x(e.then) && x(e.catch), St = ((e, t) => e ? setImmediate : t ? ((n, r) => (D.addEventListener("message", ({ source: o, data: s }) => {
169
+ }, qn = P("AsyncFunction"), Hn = (e) => e && (ue(e) || x(e)) && x(e.then) && x(e.catch), St = ((e, t) => e ? setImmediate : t ? ((n, r) => (D.addEventListener("message", ({ source: o, data: s }) => {
170
170
  o === D && s === n && r.length && r.shift()();
171
171
  }, !1), (o) => {
172
172
  r.push(o), D.postMessage(n, "*");
@@ -206,11 +206,11 @@ const In = (e) => {
206
206
  inherits: On,
207
207
  toFlatObject: _n,
208
208
  kindOf: ae,
209
- kindOfTest: C,
209
+ kindOfTest: P,
210
210
  endsWith: Rn,
211
211
  toArray: An,
212
- forEachEntry: Pn,
213
- matchAll: Cn,
212
+ forEachEntry: Cn,
213
+ matchAll: Pn,
214
214
  isHTMLForm: vn,
215
215
  hasOwnProperty: He,
216
216
  hasOwnProp: He,
@@ -328,11 +328,11 @@ function le(e, t, n) {
328
328
  if (c.endsWith(y, "{}"))
329
329
  y = r ? y : y.slice(0, -2), h = JSON.stringify(h);
330
330
  else if (c.isArray(h) && kn(h) || (c.isFileList(h) || c.endsWith(y, "[]")) && (p = c.toArray(h)))
331
- return y = _t(y), p.forEach(function(E, P) {
332
- !(c.isUndefined(E) || E === null) && t.append(
331
+ return y = _t(y), p.forEach(function(w, C) {
332
+ !(c.isUndefined(w) || w === null) && t.append(
333
333
  // eslint-disable-next-line no-nested-ternary
334
- i === !0 ? ze([y], P, s) : i === null ? y : y + "[]",
335
- u(E)
334
+ i === !0 ? ze([y], C, s) : i === null ? y : y + "[]",
335
+ u(w)
336
336
  );
337
337
  }), !1;
338
338
  }
@@ -347,14 +347,14 @@ function le(e, t, n) {
347
347
  if (!c.isUndefined(h)) {
348
348
  if (d.indexOf(h) !== -1)
349
349
  throw Error("Circular reference detected in " + y.join("."));
350
- d.push(h), c.forEach(h, function(p, w) {
350
+ d.push(h), c.forEach(h, function(p, E) {
351
351
  (!(c.isUndefined(p) || p === null) && o.call(
352
352
  t,
353
353
  p,
354
- c.isString(w) ? w.trim() : w,
354
+ c.isString(E) ? E.trim() : E,
355
355
  y,
356
356
  g
357
- )) === !0 && T(p, y ? y.concat(w) : [w]);
357
+ )) === !0 && T(p, y ? y.concat(E) : [E]);
358
358
  }), d.pop();
359
359
  }
360
360
  }
@@ -506,7 +506,7 @@ function rr(e) {
506
506
  s = n[r], t[s] = e[s];
507
507
  return t;
508
508
  }
509
- function Pt(e) {
509
+ function Ct(e) {
510
510
  function t(n, r, o, s) {
511
511
  let i = n[s++];
512
512
  if (i === "__proto__") return !0;
@@ -537,7 +537,7 @@ const X = {
537
537
  transformRequest: [function(t, n) {
538
538
  const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = c.isObject(t);
539
539
  if (s && c.isHTMLForm(t) && (t = new FormData(t)), c.isFormData(t))
540
- return o ? JSON.stringify(Pt(t)) : t;
540
+ return o ? JSON.stringify(Ct(t)) : t;
541
541
  if (c.isArrayBuffer(t) || c.isBuffer(t) || c.isStream(t) || c.isFile(t) || c.isBlob(t) || c.isReadableStream(t))
542
542
  return t;
543
543
  if (c.isArrayBufferView(t))
@@ -800,7 +800,7 @@ function we(e, t) {
800
800
  s = a.call(n, s, o.normalize(), t ? t.status : void 0);
801
801
  }), o.normalize(), s;
802
802
  }
803
- function Ct(e) {
803
+ function Pt(e) {
804
804
  return !!(e && e.__CANCEL__);
805
805
  }
806
806
  function q(e, t, n) {
@@ -1016,13 +1016,13 @@ const Nt = (e) => {
1016
1016
  function p() {
1017
1017
  if (!m)
1018
1018
  return;
1019
- const E = A.from(
1019
+ const w = A.from(
1020
1020
  "getAllResponseHeaders" in m && m.getAllResponseHeaders()
1021
1021
  ), R = {
1022
1022
  data: !a || a === "text" || a === "json" ? m.responseText : m.response,
1023
1023
  status: m.status,
1024
1024
  statusText: m.statusText,
1025
- headers: E,
1025
+ headers: w,
1026
1026
  config: e,
1027
1027
  request: m
1028
1028
  };
@@ -1039,22 +1039,22 @@ const Nt = (e) => {
1039
1039
  }, m.onerror = function() {
1040
1040
  r(new b("Network Error", b.ERR_NETWORK, e, m)), m = null;
1041
1041
  }, m.ontimeout = function() {
1042
- let P = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
1042
+ let C = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
1043
1043
  const R = o.transitional || xt;
1044
- o.timeoutErrorMessage && (P = o.timeoutErrorMessage), r(new b(
1045
- P,
1044
+ o.timeoutErrorMessage && (C = o.timeoutErrorMessage), r(new b(
1045
+ C,
1046
1046
  R.clarifyTimeoutError ? b.ETIMEDOUT : b.ECONNABORTED,
1047
1047
  e,
1048
1048
  m
1049
1049
  )), m = null;
1050
- }, s === void 0 && i.setContentType(null), "setRequestHeader" in m && c.forEach(i.toJSON(), function(P, R) {
1051
- m.setRequestHeader(R, P);
1052
- }), c.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), a && a !== "json" && (m.responseType = o.responseType), u && ([g, h] = re(u, !0), m.addEventListener("progress", g)), f && m.upload && ([d, T] = re(f), m.upload.addEventListener("progress", d), m.upload.addEventListener("loadend", T)), (o.cancelToken || o.signal) && (l = (E) => {
1053
- m && (r(!E || E.type ? new q(null, e, m) : E), m.abort(), m = null);
1050
+ }, s === void 0 && i.setContentType(null), "setRequestHeader" in m && c.forEach(i.toJSON(), function(C, R) {
1051
+ m.setRequestHeader(R, C);
1052
+ }), c.isUndefined(o.withCredentials) || (m.withCredentials = !!o.withCredentials), a && a !== "json" && (m.responseType = o.responseType), u && ([g, h] = re(u, !0), m.addEventListener("progress", g)), f && m.upload && ([d, T] = re(f), m.upload.addEventListener("progress", d), m.upload.addEventListener("loadend", T)), (o.cancelToken || o.signal) && (l = (w) => {
1053
+ m && (r(!w || w.type ? new q(null, e, m) : w), m.abort(), m = null);
1054
1054
  }, o.cancelToken && o.cancelToken.subscribe(l), o.signal && (o.signal.aborted ? l() : o.signal.addEventListener("abort", l)));
1055
- const w = fr(o.url);
1056
- if (w && _.protocols.indexOf(w) === -1) {
1057
- r(new b("Unsupported protocol " + w + ":", b.ERR_BAD_REQUEST, e));
1055
+ const E = fr(o.url);
1056
+ if (E && _.protocols.indexOf(E) === -1) {
1057
+ r(new b("Unsupported protocol " + E + ":", b.ERR_BAD_REQUEST, e));
1058
1058
  return;
1059
1059
  }
1060
1060
  m.send(s || null);
@@ -1182,7 +1182,7 @@ const Ar = async (e) => {
1182
1182
  }, xr = async (e, t) => {
1183
1183
  const n = c.toFiniteNumber(e.getContentLength());
1184
1184
  return n ?? Ar(t);
1185
- }, Pr = fe && (async (e) => {
1185
+ }, Cr = fe && (async (e) => {
1186
1186
  let {
1187
1187
  url: t,
1188
1188
  method: n,
@@ -1229,32 +1229,32 @@ const Ar = async (e) => {
1229
1229
  duplex: "half",
1230
1230
  credentials: p ? d : void 0
1231
1231
  });
1232
- let w = await fetch(h);
1233
- const E = Ae && (u === "stream" || u === "response");
1234
- if (Ae && (a || E && y)) {
1232
+ let E = await fetch(h);
1233
+ const w = Ae && (u === "stream" || u === "response");
1234
+ if (Ae && (a || w && y)) {
1235
1235
  const R = {};
1236
1236
  ["status", "statusText", "headers"].forEach((qe) => {
1237
- R[qe] = w[qe];
1237
+ R[qe] = E[qe];
1238
1238
  });
1239
- const N = c.toFiniteNumber(w.headers.get("content-length")), [F, Q] = a && Ke(
1239
+ const N = c.toFiniteNumber(E.headers.get("content-length")), [F, Q] = a && Ke(
1240
1240
  N,
1241
1241
  re(We(a), !0)
1242
1242
  ) || [];
1243
- w = new Response(
1244
- Xe(w.body, Ze, F, () => {
1243
+ E = new Response(
1244
+ Xe(E.body, Ze, F, () => {
1245
1245
  Q && Q(), y && y();
1246
1246
  }),
1247
1247
  R
1248
1248
  );
1249
1249
  }
1250
1250
  u = u || "text";
1251
- let P = await oe[c.findKey(oe, u) || "text"](w, e);
1252
- return !E && y && y(), await new Promise((R, N) => {
1251
+ let C = await oe[c.findKey(oe, u) || "text"](E, e);
1252
+ return !w && y && y(), await new Promise((R, N) => {
1253
1253
  vt(R, N, {
1254
- data: P,
1255
- headers: A.from(w.headers),
1256
- status: w.status,
1257
- statusText: w.statusText,
1254
+ data: C,
1255
+ headers: A.from(E.headers),
1256
+ status: E.status,
1257
+ statusText: E.statusText,
1258
1258
  config: e,
1259
1259
  request: h
1260
1260
  });
@@ -1270,7 +1270,7 @@ const Ar = async (e) => {
1270
1270
  }), xe = {
1271
1271
  http: zn,
1272
1272
  xhr: wr,
1273
- fetch: Pr
1273
+ fetch: Cr
1274
1274
  };
1275
1275
  c.forEach(xe, (e, t) => {
1276
1276
  if (e) {
@@ -1281,7 +1281,7 @@ c.forEach(xe, (e, t) => {
1281
1281
  Object.defineProperty(e, "adapterName", { value: t });
1282
1282
  }
1283
1283
  });
1284
- const Qe = (e) => `- ${e}`, Cr = (e) => c.isFunction(e) || e === null || e === !1, Lt = {
1284
+ const Qe = (e) => `- ${e}`, Pr = (e) => c.isFunction(e) || e === null || e === !1, Lt = {
1285
1285
  getAdapter: (e) => {
1286
1286
  e = c.isArray(e) ? e : [e];
1287
1287
  const { length: t } = e;
@@ -1290,7 +1290,7 @@ const Qe = (e) => `- ${e}`, Cr = (e) => c.isFunction(e) || e === null || e === !
1290
1290
  for (let s = 0; s < t; s++) {
1291
1291
  n = e[s];
1292
1292
  let i;
1293
- if (r = n, !Cr(n) && (r = xe[(i = String(n)).toLowerCase()], r === void 0))
1293
+ if (r = n, !Pr(n) && (r = xe[(i = String(n)).toLowerCase()], r === void 0))
1294
1294
  throw new b(`Unknown adapter '${i}'`);
1295
1295
  if (r)
1296
1296
  break;
@@ -1327,7 +1327,7 @@ function Ye(e) {
1327
1327
  r
1328
1328
  ), r.headers = A.from(r.headers), r;
1329
1329
  }, function(r) {
1330
- return Ct(r) || (Ee(e), r && r.response && (r.response.data = we.call(
1330
+ return Pt(r) || (Ee(e), r && r.response && (r.response.data = we.call(
1331
1331
  e,
1332
1332
  e.transformResponse,
1333
1333
  r.response
@@ -1583,7 +1583,7 @@ function Nr(e) {
1583
1583
  function Fr(e) {
1584
1584
  return c.isObject(e) && e.isAxiosError === !0;
1585
1585
  }
1586
- const Pe = {
1586
+ const Ce = {
1587
1587
  Continue: 100,
1588
1588
  SwitchingProtocols: 101,
1589
1589
  Processing: 102,
@@ -1648,8 +1648,8 @@ const Pe = {
1648
1648
  NotExtended: 510,
1649
1649
  NetworkAuthenticationRequired: 511
1650
1650
  };
1651
- Object.entries(Pe).forEach(([e, t]) => {
1652
- Pe[t] = e;
1651
+ Object.entries(Ce).forEach(([e, t]) => {
1652
+ Ce[t] = e;
1653
1653
  });
1654
1654
  function $t(e) {
1655
1655
  const t = new L(e), n = ht(L.prototype.request, t);
@@ -1661,7 +1661,7 @@ const O = $t(X);
1661
1661
  O.Axios = L;
1662
1662
  O.CanceledError = q;
1663
1663
  O.CancelToken = jr;
1664
- O.isCancel = Ct;
1664
+ O.isCancel = Pt;
1665
1665
  O.VERSION = Ut;
1666
1666
  O.toFormData = le;
1667
1667
  O.AxiosError = b;
@@ -1673,27 +1673,27 @@ O.spread = Nr;
1673
1673
  O.isAxiosError = Fr;
1674
1674
  O.mergeConfig = U;
1675
1675
  O.AxiosHeaders = A;
1676
- O.formToJSON = (e) => Pt(c.isHTMLForm(e) ? new FormData(e) : e);
1676
+ O.formToJSON = (e) => Ct(c.isHTMLForm(e) ? new FormData(e) : e);
1677
1677
  O.getAdapter = Lt.getAdapter;
1678
- O.HttpStatusCode = Pe;
1678
+ O.HttpStatusCode = Ce;
1679
1679
  O.default = O;
1680
1680
  const {
1681
- Axios: li,
1682
- AxiosError: fi,
1683
- CanceledError: di,
1684
- isCancel: pi,
1685
- CancelToken: hi,
1686
- VERSION: mi,
1687
- all: yi,
1688
- Cancel: bi,
1689
- isAxiosError: gi,
1690
- spread: wi,
1691
- toFormData: Ei,
1692
- AxiosHeaders: Si,
1693
- HttpStatusCode: Ti,
1694
- formToJSON: Oi,
1695
- getAdapter: _i,
1696
- mergeConfig: Ri
1681
+ Axios: fi,
1682
+ AxiosError: di,
1683
+ CanceledError: pi,
1684
+ isCancel: hi,
1685
+ CancelToken: mi,
1686
+ VERSION: yi,
1687
+ all: bi,
1688
+ Cancel: gi,
1689
+ isAxiosError: wi,
1690
+ spread: Ei,
1691
+ toFormData: Si,
1692
+ AxiosHeaders: Ti,
1693
+ HttpStatusCode: Oi,
1694
+ formToJSON: _i,
1695
+ getAdapter: Ri,
1696
+ mergeConfig: Ai
1697
1697
  } = O;
1698
1698
  function Dr() {
1699
1699
  this.__data__ = [], this.size = 0;
@@ -1841,7 +1841,7 @@ function Ao(e) {
1841
1841
  return W ? t[e] !== void 0 : Ro.call(t, e);
1842
1842
  }
1843
1843
  var xo = "__lodash_hash_undefined__";
1844
- function Po(e, t) {
1844
+ function Co(e, t) {
1845
1845
  var n = this.__data__;
1846
1846
  return this.size += this.has(e) ? 0 : 1, n[e] = W && t === void 0 ? xo : t, this;
1847
1847
  }
@@ -1856,8 +1856,8 @@ B.prototype.clear = go;
1856
1856
  B.prototype.delete = wo;
1857
1857
  B.prototype.get = Oo;
1858
1858
  B.prototype.has = Ao;
1859
- B.prototype.set = Po;
1860
- function Co() {
1859
+ B.prototype.set = Co;
1860
+ function Po() {
1861
1861
  this.size = 0, this.__data__ = {
1862
1862
  hash: new B(),
1863
1863
  map: new (Ht || j)(),
@@ -1893,7 +1893,7 @@ function M(e) {
1893
1893
  this.set(r[0], r[1]);
1894
1894
  }
1895
1895
  }
1896
- M.prototype.clear = Co;
1896
+ M.prototype.clear = Po;
1897
1897
  M.prototype.delete = jo;
1898
1898
  M.prototype.get = No;
1899
1899
  M.prototype.has = Fo;
@@ -1933,7 +1933,7 @@ function $e(e, t, n) {
1933
1933
  writable: !0
1934
1934
  }) : e[t] = n;
1935
1935
  }
1936
- function Ce(e, t, n) {
1936
+ function Pe(e, t, n) {
1937
1937
  (n !== void 0 && !pe(e[t], n) || n === void 0 && !(t in e)) && $e(e, t, n);
1938
1938
  }
1939
1939
  function Bo(e) {
@@ -2026,8 +2026,8 @@ function as(e) {
2026
2026
  var n = ss.call(t, "constructor") && t.constructor;
2027
2027
  return typeof n == "function" && n instanceof n && Gt.call(n) == is;
2028
2028
  }
2029
- 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]", Ts = "[object DataView]", Os = "[object Float32Array]", _s = "[object Float64Array]", Rs = "[object Int8Array]", As = "[object Int16Array]", xs = "[object Int32Array]", Ps = "[object Uint8Array]", Cs = "[object Uint8ClampedArray]", vs = "[object Uint16Array]", js = "[object Uint32Array]", S = {};
2030
- S[Os] = S[_s] = S[Rs] = S[As] = S[xs] = S[Ps] = S[Cs] = S[vs] = S[js] = !0;
2029
+ 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]", Ts = "[object DataView]", Os = "[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 = {};
2030
+ S[Os] = S[_s] = S[Rs] = S[As] = S[xs] = S[Cs] = S[Ps] = S[vs] = S[js] = !0;
2031
2031
  S[cs] = S[us] = S[Ss] = S[ls] = S[Ts] = S[fs] = S[ds] = S[ps] = S[hs] = S[ms] = S[ys] = S[bs] = S[gs] = S[ws] = S[Es] = !1;
2032
2032
  function Ns(e) {
2033
2033
  return Z(e) && Vt(e.length) && !!S[me(e)];
@@ -2107,7 +2107,7 @@ function Ks(e) {
2107
2107
  function Ws(e, t, n, r, o, s, i) {
2108
2108
  var a = Ne(e, n), f = Ne(t, n), u = i.get(f);
2109
2109
  if (u) {
2110
- Ce(e, n, u);
2110
+ Pe(e, n, u);
2111
2111
  return;
2112
2112
  }
2113
2113
  var l = s ? s(a, f, n + "", e, t, i) : void 0, d = l === void 0;
@@ -2115,7 +2115,7 @@ function Ws(e, t, n, r, o, s, i) {
2115
2115
  var g = je(f), T = !g && Wt(f), h = !g && !T && Zt(f);
2116
2116
  l = f, g || T || h ? je(a) ? l = a : Qo(a) ? l = zo(a) : T ? (d = !1, l = qo(f)) : h ? (d = !1, l = Mo(f)) : l = [] : as(f) || ve(f) ? (l = a, ve(a) ? l = Ks(a) : (!$(a) || Ue(a)) && (l = Ko(f))) : d = !1;
2117
2117
  }
2118
- d && (i.set(f, l), o(l, f, r, s, i), i.delete(f)), Ce(e, n, l);
2118
+ d && (i.set(f, l), o(l, f, r, s, i), i.delete(f)), Pe(e, n, l);
2119
2119
  }
2120
2120
  function en(e, t, n, r, o) {
2121
2121
  e !== t && $o(t, function(s, i) {
@@ -2123,7 +2123,7 @@ function en(e, t, n, r, o) {
2123
2123
  Ws(e, t, i, n, en, r, o);
2124
2124
  else {
2125
2125
  var a = r ? r(Ne(e, i), s, i + "", e, t, o) : void 0;
2126
- a === void 0 && (a = s), Ce(e, i, a);
2126
+ a === void 0 && (a = s), Pe(e, i, a);
2127
2127
  }
2128
2128
  }, Yt);
2129
2129
  }
@@ -2202,7 +2202,7 @@ function ii(e) {
2202
2202
  var pt = ii(function(e, t, n) {
2203
2203
  en(e, t, n);
2204
2204
  });
2205
- const Ai = (e, t) => {
2205
+ const ai = "SUC0000", xi = (e, t) => {
2206
2206
  const n = (r, o) => (s, i) => (a, f) => {
2207
2207
  const u = Y(!1), l = Y(null), d = Y(null), g = Y(null);
2208
2208
  return {
@@ -2221,16 +2221,17 @@ const Ai = (e, t) => {
2221
2221
  return h && (a = h), p.method === "get" || p.method === "delete" ? p.params = a : p.data = a, p.method !== "get" && (p.params = {
2222
2222
  ...p.params,
2223
2223
  timestamp: (/* @__PURE__ */ new Date()).getTime()
2224
- }), i && (p = await i(p)), f && (p = pt(p, f)), y && (p = pt(p, y)), t && (p = await t(p)), p.axiosInstance && (e = p.axiosInstance), p.urlPrefix && (p.baseURL = p.baseURL + p.urlPrefix), p.signal || (p.signal = g.value.signal), p.beforeRun && (p = await p.beforeRun(p)), e(p).then(async (w) => {
2225
- let E = (w == null ? void 0 : w.data) ?? w;
2226
- return p.onSuccess && (E = await p.onSuccess(w, p)), d.value = E, Promise.resolve([null, E]);
2227
- }).catch(async (w) => {
2224
+ }), i && (p = await i(p)), f && (p = pt(p, f)), y && (p = pt(p, y)), t && (p = await t(p)), p.axiosInstance && (e = p.axiosInstance), p.urlPrefix && (p.baseURL = p.baseURL + p.urlPrefix), p.signal || (p.signal = g.value.signal), p.beforeRun && (p = await p.beforeRun(p)), e(p).then(async (E) => {
2225
+ let w = (E == null ? void 0 : E.data) ?? E;
2226
+ if (p.onSuccess)
2227
+ return w = await p.onSuccess(E, p), w.code !== ai ? (p.onCustomError && (w = await p.onCustomError(null, p)), l.value = w, Promise.resolve([w, null])) : (d.value = w, Promise.resolve([null, w]));
2228
+ }).catch(async (E) => {
2228
2229
  if (p.signal) {
2229
- const P = p.signal.reason;
2230
- typeof P == "string" && (w.abortReason = P || "");
2230
+ const C = p.signal.reason;
2231
+ typeof C == "string" && (E.abortReason = C || "");
2231
2232
  }
2232
- let E = w;
2233
- return p.onError && (E = await p.onError(w, p)), p.onCustomError && (E = await p.onCustomError(w, p)), l.value = E, Promise.resolve([E, null]);
2233
+ let w = E;
2234
+ return p.onError && (w = await p.onError(E, p)), l.value = w, Promise.resolve([w, null]);
2234
2235
  }).finally(() => {
2235
2236
  p.finally && p.finally(p), u.value = !1;
2236
2237
  });
@@ -2247,5 +2248,5 @@ const Ai = (e, t) => {
2247
2248
  };
2248
2249
  };
2249
2250
  export {
2250
- Ai as curringHttp
2251
+ xi as curringHttp
2251
2252
  };
Binary file
@@ -29,7 +29,7 @@ export type CurringConfig = AxiosRequestConfig & {
29
29
  onError?: (error: any, config: CurringConfig) => Promise<any>
30
30
 
31
31
  /** 自定义处理请求失败执行的回调 */
32
- onCustomError?: (error: any, config: CurringConfig) => Promise<any>
32
+ onCustomError?: (error: null, config: CurringConfig) => Promise<any>
33
33
 
34
34
  /** 不管请求成功或失败都会执行的回调 */
35
35
  finally?: (config: CurringConfig) => any
@@ -42,8 +42,8 @@ export type CurringConfig = AxiosRequestConfig & {
42
42
  /** 原始错误信息 */
43
43
  message: string,
44
44
 
45
- /** 原始错误对象 */
46
- error: any,
45
+ /** 错误编码 */
46
+ code: string,
47
47
  ) => string | null | undefined
48
48
 
49
49
  /** 忽略错误提示 */
package/esm-map.json CHANGED
@@ -141,6 +141,5 @@
141
141
  "getProjectMessage": "/common-info/index",
142
142
  "analyApi": "/api-services/modules/iot/index",
143
143
  "calcTextWidth": "/common-tools/calc-text-width/index",
144
- "getFileExtension": "/common-tools/get-file-extension/index",
145
- "getLanguages": "/common-info/index"
144
+ "getFileExtension": "/common-tools/get-file-extension/index"
146
145
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/utils",
3
- "version": "7.0.0-beta.5",
3
+ "version": "7.0.0-zhaohang.2",
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.0-beta.5",
12
+ "@das-fed/utils": "7.0.0-zhaohang.2",
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.0-beta.5",
25
- "@das-fed/web": "7.0.0-beta.5",
24
+ "@das-fed/cli": "7.0.0-zhaohang.2",
25
+ "@das-fed/web": "7.0.0-zhaohang.2",
26
26
  "@types/js-cookie": "^3.0.6",
27
27
  "@types/lodash-es": "^4.17.12",
28
28
  "@types/qs": "^6.9.15",