@das-fed/upf-utils 6.4.0-hot.9 → 6.4.0-test.0

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 (93) hide show
  1. package/api-services/es5.js +321 -318
  2. package/api-services/index.js +249 -249
  3. package/api-services/index.js.gz +0 -0
  4. package/api-services/modules/app-manage/es5.js +313 -310
  5. package/api-services/modules/app-manage/index.js +292 -292
  6. package/api-services/modules/app-manage/index.js.gz +0 -0
  7. package/api-services/modules/authentication/es5.js +1153 -1162
  8. package/api-services/modules/authentication/index.js +957 -975
  9. package/api-services/modules/authentication/index.js.gz +0 -0
  10. package/api-services/modules/bems/es5.js +940 -940
  11. package/api-services/modules/bems/index.js +762 -766
  12. package/api-services/modules/bems/index.js.gz +0 -0
  13. package/api-services/modules/contract/es5.js +313 -310
  14. package/api-services/modules/contract/index.js +292 -292
  15. package/api-services/modules/contract/index.js.gz +0 -0
  16. package/api-services/modules/duty-manage/es5.js +304 -301
  17. package/api-services/modules/duty-manage/index.js +283 -283
  18. package/api-services/modules/duty-manage/index.js.gz +0 -0
  19. package/api-services/modules/enterpriseright/es5.js +313 -310
  20. package/api-services/modules/enterpriseright/index.js +292 -292
  21. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  22. package/api-services/modules/es5.js +516 -513
  23. package/api-services/modules/file/es5.js +250 -247
  24. package/api-services/modules/file/index.js +209 -209
  25. package/api-services/modules/file/index.js.gz +0 -0
  26. package/api-services/modules/gateway-edge/es5.js +1153 -1162
  27. package/api-services/modules/gateway-edge/index.js +957 -975
  28. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  29. package/api-services/modules/index.js +438 -438
  30. package/api-services/modules/index.js.gz +0 -0
  31. package/api-services/modules/iot/es5.js +321 -318
  32. package/api-services/modules/iot/index.js +292 -292
  33. package/api-services/modules/iot/index.js.gz +0 -0
  34. package/api-services/modules/justauth/es5.js +192 -189
  35. package/api-services/modules/justauth/index.js +191 -191
  36. package/api-services/modules/justauth/index.js.gz +0 -0
  37. package/api-services/modules/knowledge/es5.js +313 -310
  38. package/api-services/modules/knowledge/index.js +292 -292
  39. package/api-services/modules/knowledge/index.js.gz +0 -0
  40. package/api-services/modules/link/es5.js +313 -310
  41. package/api-services/modules/link/index.js +292 -292
  42. package/api-services/modules/link/index.js.gz +0 -0
  43. package/api-services/modules/permission/es5.js +313 -310
  44. package/api-services/modules/permission/index.js +292 -292
  45. package/api-services/modules/permission/index.js.gz +0 -0
  46. package/api-services/modules/platformManage/es5.js +312 -309
  47. package/api-services/modules/platformManage/index.js +287 -287
  48. package/api-services/modules/platformManage/index.js.gz +0 -0
  49. package/api-services/modules/portal/es5.js +313 -310
  50. package/api-services/modules/portal/index.js +292 -292
  51. package/api-services/modules/portal/index.js.gz +0 -0
  52. package/api-services/modules/space-manage/es5.js +313 -310
  53. package/api-services/modules/space-manage/index.js +292 -292
  54. package/api-services/modules/space-manage/index.js.gz +0 -0
  55. package/api-services/modules/super-admin/es5.js +1279 -1264
  56. package/api-services/modules/super-admin/index.js +1067 -1049
  57. package/api-services/modules/super-admin/index.js.gz +0 -0
  58. package/api-services/modules/supplier/es5.js +1156 -1165
  59. package/api-services/modules/supplier/index.js +958 -976
  60. package/api-services/modules/supplier/index.js.gz +0 -0
  61. package/api-services/modules/supplychain-manage/es5.js +313 -310
  62. package/api-services/modules/supplychain-manage/index.js +292 -292
  63. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  64. package/api-services/modules/systemConfiguration/es5.js +1247 -1232
  65. package/api-services/modules/systemConfiguration/index.js +1042 -1024
  66. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  67. package/api-services/modules/tool/es5.js +313 -310
  68. package/api-services/modules/tool/index.js +292 -292
  69. package/api-services/modules/tool/index.js.gz +0 -0
  70. package/api-services/src/create-service/es5.js +311 -308
  71. package/api-services/src/create-service/index.js +291 -291
  72. package/api-services/src/create-service/index.js.gz +0 -0
  73. package/common-info/es5.js +4469 -200
  74. package/common-info/getPermissionMethod/es5.js +4218 -0
  75. package/common-info/getPermissionMethod/index.d.ts +26 -0
  76. package/common-info/getPermissionMethod/index.js +3342 -0
  77. package/common-info/getPermissionMethod/index.js.gz +0 -0
  78. package/common-info/index.d.ts +11 -2
  79. package/common-info/index.js +3539 -168
  80. package/common-info/index.js.gz +0 -0
  81. package/common-info/type.d.ts +0 -2
  82. package/create-api-service/es5.js +1235 -1219
  83. package/create-api-service/index.d.ts +6 -6
  84. package/create-api-service/index.js +1032 -1013
  85. package/create-api-service/index.js.gz +0 -0
  86. package/directive/auth/es5.js +62 -50
  87. package/directive/auth/index.js +39 -38
  88. package/directive/auth/index.js.gz +0 -0
  89. package/esm-map.json +9 -1
  90. package/hooks/use-get-auth/es5.js +13 -17
  91. package/hooks/use-get-auth/index.js +10 -13
  92. package/package.json +3 -3
  93. package/hooks/use-get-auth/apis.d.ts +0 -1
Binary file
@@ -2,61 +2,73 @@
2
2
 
3
3
  var commonInfo = require('@das-fed/upf-utils/common-info/es5');
4
4
  var utils = require('@das-fed/upf-utils/directive/utils/es5');
5
- var m = function m(e, t) {
6
- var s = e.btnList,
7
- r = e.menuCode;
8
- return !s || !t ? false : (Array.isArray(t) ? t : [t]).some(function (d) {
9
- return s.includes(r ? "".concat(r, ".").concat(d) : d);
10
- });
5
+ var A = function A(e) {
6
+ var _ref;
7
+ var i = (_ref = e == null ? undefined : e.code) !== null && _ref !== void 0 ? _ref : "";
8
+ var t = false;
9
+ if (!i) return t;
10
+ var o = Array.isArray(i) ? i : [i],
11
+ r = commonInfo.getCurrentModulePermissionData("all"),
12
+ a = Array.isArray(r == null ? undefined : r.idList) ? r.idList : commonInfo.getCurrentModulePermissionData("id"),
13
+ c = Array.isArray(r == null ? undefined : r.codeList) ? r.codeList : commonInfo.getCurrentModulePermissionData("code"),
14
+ d = new Set((Array.isArray(a) ? a : []).map(function (n) {
15
+ return String(n);
16
+ })),
17
+ u = new Set((Array.isArray(c) ? c : []).map(function (n) {
18
+ return String(n);
19
+ })),
20
+ y = o.some(function (n) {
21
+ var s = String(n !== null && n !== void 0 ? n : "").trim();
22
+ return s && !/^[0-9]{3,}$/.test(s) && !s.includes(".") && !s.includes("_");
23
+ }),
24
+ L = commonInfo.getCurrentRouteCode(),
25
+ l = y ? commonInfo.buildActionSuffixSet(u, {
26
+ routeCode: L
27
+ }) : /* @__PURE__ */new Set(),
28
+ v = {
29
+ search: "q",
30
+ add: "a",
31
+ "delete": "d",
32
+ edit: "m",
33
+ view: "v"
34
+ },
35
+ w = function w(n) {
36
+ if (!n) return false;
37
+ var s = String(n || "").trim();
38
+ if (!s) return false;
39
+ if (s.includes(".") || s.includes("_")) return u.has(s);
40
+ var m = v[s] || "";
41
+ return l.has(s) || (m ? l.has(m) : false);
42
+ };
43
+ return (d.size > 0 || u.size > 0) && (t = o.some(function (n) {
44
+ var s = String(n !== null && n !== void 0 ? n : "").trim();
45
+ return s ? /^[0-9]{3,}$/.test(s) ? d.has(s) : w(s) : false;
46
+ }), t) ? true : t;
11
47
  },
12
- n = function n(e) {
13
- var _ref, _ref2;
14
- var t = (_ref = e == null ? undefined : e.code) !== null && _ref !== void 0 ? _ref : "";
15
- var s = (_ref2 = e == null ? undefined : e.menuCode) !== null && _ref2 !== void 0 ? _ref2 : "",
16
- r = false;
17
- if (t) {
18
- var _commonInfo$getMenuIt;
19
- var i = [];
20
- var d = typeof t == "string" ? t.replace(/-/g, ".") : t.map(function (a) {
21
- return a.replace(/-/g, ".");
22
- });
23
- if (!s) i = (_commonInfo$getMenuIt = commonInfo.getMenuItemInfo().authCodes) !== null && _commonInfo$getMenuIt !== void 0 ? _commonInfo$getMenuIt : [];else {
24
- var a = commonInfo.getAuthobj()[s];
25
- a && (i = a.map(function (o) {
26
- return o.code;
27
- }));
28
- }
29
- r = m({
30
- btnList: i,
31
- menuCode: s || commonInfo.getMenuItemInfo().routeCode
32
- }, d);
33
- } else s && (r = !!commonInfo.getAuthobj()[s]);
34
- return r;
48
+ S = function S(e, i) {
49
+ i === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
35
50
  },
36
- f = function f(e, t) {
37
- t === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
51
+ C = function C(e, i) {
52
+ i === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
38
53
  },
39
- h = function h(e, t) {
40
- t === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
41
- },
42
- L = function L(e, t) {
43
- var _ref3;
44
- var s = (e ? t.value : t) || {};
45
- typeof s == "string" && (s = {
46
- code: s
54
+ E = function E(e, i) {
55
+ var _ref2;
56
+ var t = (e ? i.value : i) || {};
57
+ typeof t == "string" && (t = {
58
+ code: t
47
59
  });
48
- var r = (_ref3 = s == null ? undefined : s.type) !== null && _ref3 !== void 0 ? _ref3 : "hide",
49
- i = n(s);
50
- if (e) if (!t.oldValue) i || utils.getEl(e, s).then(function (d) {
51
- f(d, r);
60
+ var o = (_ref2 = t == null ? undefined : t.type) !== null && _ref2 !== void 0 ? _ref2 : "hide",
61
+ r = A(t);
62
+ if (e) if (!i.oldValue) r || utils.getEl(e, t).then(function (a) {
63
+ S(a, o);
52
64
  });else {
53
- var d = n(t.oldValue),
54
- a = i;
55
- if (d === a) return;
56
- utils.getEl(e, s).then(function (o) {
57
- a ? h(o, r) : f(o, r);
65
+ var a = A(i.oldValue),
66
+ c = r;
67
+ if (a === c) return;
68
+ utils.getEl(e, t).then(function (d) {
69
+ c ? C(d, o) : S(d, o);
58
70
  });
59
71
  }
60
- return i;
72
+ return r;
61
73
  };
62
- exports.vAuth = L;
74
+ exports.vAuth = E;
@@ -1,46 +1,47 @@
1
- import { getMenuItemInfo as c, getAuthobj as l } from "@das-fed/upf-utils/common-info";
2
- import { getEl as u } from "@das-fed/upf-utils/directive/utils";
3
- const m = (e, t) => {
4
- const { btnList: s, menuCode: r } = e;
5
- return !s || !t ? !1 : (Array.isArray(t) ? t : [t]).some((d) => s.includes(r ? `${r}.${d}` : d));
6
- }, n = (e) => {
7
- const t = (e == null ? void 0 : e.code) ?? "";
8
- let s = (e == null ? void 0 : e.menuCode) ?? "", r = !1;
9
- if (t) {
10
- let i = [];
11
- const d = typeof t == "string" ? t.replace(/-/g, ".") : t.map((a) => a.replace(/-/g, "."));
12
- if (!s)
13
- i = c().authCodes ?? [];
14
- else {
15
- const a = l()[s];
16
- a && (i = a.map((o) => o.code));
17
- }
18
- r = m({ btnList: i, menuCode: s || c().routeCode }, d);
19
- } else
20
- s && (r = !!l()[s]);
21
- return r;
22
- }, f = (e, t) => {
23
- t === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
24
- }, h = (e, t) => {
25
- t === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
26
- }, L = (e, t) => {
27
- let s = (e ? t.value : t) || {};
28
- typeof s == "string" && (s = { code: s });
29
- const r = (s == null ? void 0 : s.type) ?? "hide", i = n(s);
1
+ import { getCurrentModulePermissionData as f, getCurrentRouteCode as g, buildActionSuffixSet as P } from "@das-fed/upf-utils/common-info";
2
+ import { getEl as h } from "@das-fed/upf-utils/directive/utils";
3
+ const A = (e) => {
4
+ const i = (e == null ? void 0 : e.code) ?? "";
5
+ let t = !1;
6
+ if (!i)
7
+ return t;
8
+ const o = Array.isArray(i) ? i : [i], r = f("all"), a = Array.isArray(r == null ? void 0 : r.idList) ? r.idList : f("id"), c = Array.isArray(r == null ? void 0 : r.codeList) ? r.codeList : f("code"), d = new Set((Array.isArray(a) ? a : []).map((n) => String(n))), u = new Set((Array.isArray(c) ? c : []).map((n) => String(n))), y = o.some((n) => {
9
+ const s = String(n ?? "").trim();
10
+ return s && !/^[0-9]{3,}$/.test(s) && !s.includes(".") && !s.includes("_");
11
+ }), L = g(), l = y ? P(u, { routeCode: L }) : /* @__PURE__ */ new Set(), v = { search: "q", add: "a", delete: "d", edit: "m", view: "v" }, w = (n) => {
12
+ if (!n) return !1;
13
+ const s = String(n || "").trim();
14
+ if (!s) return !1;
15
+ if (s.includes(".") || s.includes("_")) return u.has(s);
16
+ const m = v[s] || "";
17
+ return l.has(s) || (m ? l.has(m) : !1);
18
+ };
19
+ return (d.size > 0 || u.size > 0) && (t = o.some((n) => {
20
+ const s = String(n ?? "").trim();
21
+ return s ? /^[0-9]{3,}$/.test(s) ? d.has(s) : w(s) : !1;
22
+ }), t) ? !0 : t;
23
+ }, S = (e, i) => {
24
+ i === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
25
+ }, C = (e, i) => {
26
+ i === "hide" ? e.classList.remove("is-hide") : (e.removeAttribute("disabled"), e.classList.remove("is-disabled"));
27
+ }, E = (e, i) => {
28
+ let t = (e ? i.value : i) || {};
29
+ typeof t == "string" && (t = { code: t });
30
+ const o = (t == null ? void 0 : t.type) ?? "hide", r = A(t);
30
31
  if (e)
31
- if (!t.oldValue)
32
- i || u(e, s).then((d) => {
33
- f(d, r);
32
+ if (!i.oldValue)
33
+ r || h(e, t).then((a) => {
34
+ S(a, o);
34
35
  });
35
36
  else {
36
- const d = n(t.oldValue), a = i;
37
- if (d === a) return;
38
- u(e, s).then((o) => {
39
- a ? h(o, r) : f(o, r);
37
+ const a = A(i.oldValue), c = r;
38
+ if (a === c) return;
39
+ h(e, t).then((d) => {
40
+ c ? C(d, o) : S(d, o);
40
41
  });
41
42
  }
42
- return i;
43
+ return r;
43
44
  };
44
45
  export {
45
- L as vAuth
46
+ E as vAuth
46
47
  };
Binary file
package/esm-map.json CHANGED
@@ -150,5 +150,13 @@
150
150
  "getAuthobj": "/common-info/index",
151
151
  "getMenuListnfo": "/common-info/index",
152
152
  "setI18nBridge": "/i18n-bridge/index",
153
- "getI18nBridge": "/i18n-bridge/index"
153
+ "getI18nBridge": "/i18n-bridge/index",
154
+ "groupPermissionListByModuleAndCode": "/common-info/index",
155
+ "getGroupedCurrentUserPermissionList": "/common-info/index",
156
+ "getCurrentModulePermissionData": "/common-info/getPermissionMethod/index",
157
+ "getCurrentUserPermissionsList": "/common-info/getPermissionMethod/index",
158
+ "getCurrentUserMenuPermissionsList": "/common-info/getPermissionMethod/index",
159
+ "handleUnauthorized": "/create-api-service/index",
160
+ "getCurrentRouteCode": "/common-info/index",
161
+ "buildActionSuffixSet": "/common-info/index"
154
162
  }
@@ -6,27 +6,23 @@ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.
6
6
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
7
7
  var commonTools = require('@das-fed/upf-utils/common-tools/es5');
8
8
  var nextTiken = require('@das-fed/upf-utils/nextTiken/es5');
9
- var createApiService = require('@das-fed/upf-utils/create-api-service/es5');
10
- var p = "v1",
11
- l = createApiService.createService("/api/admin/basic-application/log/".concat(p));
12
- l.post("/dependency/rights/list");
13
- var w = function w() {
9
+ var l = function l() {
14
10
  return {
15
11
  getApplication: function () {
16
12
  var _getApplication = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t) {
17
- var r;
13
+ var i;
18
14
  return _regenerator().w(function (_context) {
19
15
  while (1) switch (_context.n) {
20
16
  case 0:
21
17
  _context.n = 1;
22
18
  return nextTiken.projectNextTick();
23
19
  case 1:
24
- r = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter(function (e) {
20
+ i = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter(function (e) {
25
21
  return e.type === "application";
26
22
  });
27
- return _context.a(2, t ? r.find(function (e) {
23
+ return _context.a(2, t ? i.find(function (e) {
28
24
  return e.appId === t;
29
- }) : r);
25
+ }) : i);
30
26
  }
31
27
  }, _callee);
32
28
  }));
@@ -37,15 +33,15 @@ var w = function w() {
37
33
  }(),
38
34
  getMenu: function () {
39
35
  var _getMenu = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t, n) {
40
- var r, e, a;
36
+ var i, e, a;
41
37
  return _regenerator().w(function (_context2) {
42
38
  while (1) switch (_context2.n) {
43
39
  case 0:
44
40
  _context2.n = 1;
45
41
  return nextTiken.projectNextTick();
46
42
  case 1:
47
- r = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = commonTools.flatTree(r).filter(function (i) {
48
- return i.type === "menu";
43
+ i = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = commonTools.flatTree(i).filter(function (r) {
44
+ return r.type === "menu";
49
45
  });
50
46
  if (!(!t && !n)) {
51
47
  _context2.n = 2;
@@ -53,10 +49,10 @@ var w = function w() {
53
49
  }
54
50
  return _context2.a(2, e);
55
51
  case 2:
56
- return _context2.a(2, (t ? a = e.find(function (i) {
57
- return i.routeCode === t || i.originalCode === t;
58
- }) : n && (a = e.find(function (i) {
59
- return i.routeUrl === n;
52
+ return _context2.a(2, (t ? a = e.find(function (r) {
53
+ return r.routeCode === t || r.originalCode === t;
54
+ }) : n && (a = e.find(function (r) {
55
+ return r.routeUrl === n;
60
56
  })), a));
61
57
  }
62
58
  }, _callee2);
@@ -68,4 +64,4 @@ var w = function w() {
68
64
  }()
69
65
  };
70
66
  };
71
- exports.useGetAuth = w;
67
+ exports.useGetAuth = l;
@@ -1,22 +1,19 @@
1
- import { flatTree as s } from "@das-fed/upf-utils/common-tools";
2
- import { projectNextTick as o } from "@das-fed/upf-utils/nextTiken";
3
- import { createService as c } from "@das-fed/upf-utils/create-api-service";
4
- const p = "v1", l = c(`/api/admin/basic-application/log/${p}`);
5
- l.post("/dependency/rights/list");
6
- const w = () => ({
1
+ import { flatTree as o } from "@das-fed/upf-utils/common-tools";
2
+ import { projectNextTick as s } from "@das-fed/upf-utils/nextTiken";
3
+ const l = () => ({
7
4
  getApplication: async (t) => {
8
- await o();
9
- const r = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter((e) => e.type === "application");
10
- return t ? r.find((e) => e.appId === t) : r;
5
+ await s();
6
+ const i = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter((e) => e.type === "application");
7
+ return t ? i.find((e) => e.appId === t) : i;
11
8
  },
12
9
  getMenu: async (t, n) => {
13
- await o();
14
- const r = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = s(r).filter((i) => i.type === "menu");
10
+ await s();
11
+ const i = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = o(i).filter((r) => r.type === "menu");
15
12
  if (!t && !n) return e;
16
13
  let a;
17
- return t ? a = e.find((i) => i.routeCode === t || i.originalCode === t) : n && (a = e.find((i) => i.routeUrl === n)), a;
14
+ return t ? a = e.find((r) => r.routeCode === t || r.originalCode === t) : n && (a = e.find((r) => r.routeUrl === n)), a;
18
15
  }
19
16
  });
20
17
  export {
21
- w as useGetAuth
18
+ l as useGetAuth
22
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/upf-utils",
3
- "version": "6.4.0-hot.9",
3
+ "version": "6.4.0-test.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "@babel/preset-env": "7.26.0",
24
- "@das-fed/upf-cli": "6.4.0-hot.9",
25
- "@das-fed/upf-web": "6.4.0-hot.9",
24
+ "@das-fed/upf-cli": "6.4.0-test.0",
25
+ "@das-fed/upf-web": "6.4.0-test.0",
26
26
  "@rollup/plugin-babel": "6.0.4",
27
27
  "@types/js-cookie": "^3.0.6",
28
28
  "@types/lodash-es": "^4.17.12",
@@ -1 +0,0 @@
1
- export declare const getRightsListApi: any;