@das-fed/upf-utils 6.4.0-dev.226 → 6.4.0-dev.228

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 +1520 -1526
  2. package/api-services/index.js +1223 -1237
  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 +313 -310
  8. package/api-services/modules/authentication/index.js +292 -292
  9. package/api-services/modules/authentication/index.js.gz +0 -0
  10. package/api-services/modules/bems/es5.js +308 -305
  11. package/api-services/modules/bems/index.js +287 -287
  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 +1153 -1159
  17. package/api-services/modules/duty-manage/index.js +958 -972
  18. package/api-services/modules/duty-manage/index.js.gz +0 -0
  19. package/api-services/modules/enterpriseright/es5.js +1153 -1162
  20. package/api-services/modules/enterpriseright/index.js +957 -975
  21. package/api-services/modules/enterpriseright/index.js.gz +0 -0
  22. package/api-services/modules/es5.js +1518 -1527
  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 +188 -185
  27. package/api-services/modules/gateway-edge/index.js +184 -184
  28. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  29. package/api-services/modules/index.js +1221 -1239
  30. package/api-services/modules/index.js.gz +0 -0
  31. package/api-services/modules/iot/es5.js +1168 -1177
  32. package/api-services/modules/iot/index.js +968 -986
  33. package/api-services/modules/iot/index.js.gz +0 -0
  34. package/api-services/modules/justauth/es5.js +314 -311
  35. package/api-services/modules/justauth/index.js +293 -293
  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 +1153 -1162
  44. package/api-services/modules/permission/index.js +957 -975
  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 +1135 -1141
  50. package/api-services/modules/portal/index.js +941 -955
  51. package/api-services/modules/portal/index.js.gz +0 -0
  52. package/api-services/modules/space-manage/es5.js +1247 -1232
  53. package/api-services/modules/space-manage/index.js +1042 -1024
  54. package/api-services/modules/space-manage/index.js.gz +0 -0
  55. package/api-services/modules/super-admin/es5.js +262 -259
  56. package/api-services/modules/super-admin/index.js +244 -244
  57. package/api-services/modules/super-admin/index.js.gz +0 -0
  58. package/api-services/modules/supplier/es5.js +315 -312
  59. package/api-services/modules/supplier/index.js +292 -292
  60. package/api-services/modules/supplier/index.js.gz +0 -0
  61. package/api-services/modules/supplychain-manage/es5.js +1164 -1173
  62. package/api-services/modules/supplychain-manage/index.js +967 -985
  63. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  64. package/api-services/modules/systemConfiguration/es5.js +313 -310
  65. package/api-services/modules/systemConfiguration/index.js +292 -292
  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 +4357 -124
  74. package/common-info/getPermissionMethod/es5.js +4209 -0
  75. package/common-info/getPermissionMethod/index.d.ts +26 -0
  76. package/common-info/getPermissionMethod/index.js +3328 -0
  77. package/common-info/getPermissionMethod/index.js.gz +0 -0
  78. package/common-info/index.d.ts +2 -0
  79. package/common-info/index.js +3414 -63
  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 +1142 -1150
  83. package/create-api-service/index.d.ts +6 -6
  84. package/create-api-service/index.js +948 -965
  85. package/create-api-service/index.js.gz +0 -0
  86. package/directive/auth/es5.js +63 -44
  87. package/directive/auth/index.js +42 -33
  88. package/directive/auth/index.js.gz +0 -0
  89. package/esm-map.json +7 -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,54 +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 d = function d(s, t) {
6
- var e = s.btnList,
7
- r = s.menuCode;
8
- return !e || !t ? false : (Array.isArray(t) ? t : [t]).some(function (a) {
9
- return e.includes(r ? "".concat(r, ".").concat(a) : a);
10
- });
5
+ var A = function A(r) {
6
+ var s = /* @__PURE__ */new Set();
7
+ return r.forEach(function (t) {
8
+ var n = String(t !== null && t !== void 0 ? t : "").trim();
9
+ if (!n) return;
10
+ var i = n.lastIndexOf("."),
11
+ d = n.lastIndexOf("_"),
12
+ c = Math.max(i, d),
13
+ o = c >= 0 ? n.slice(c + 1) : n;
14
+ o && s.add(o);
15
+ }), s;
11
16
  },
12
- m = function m(s) {
13
- var _ref, _ref2;
14
- var t = (_ref = s == null ? undefined : s.code) !== null && _ref !== void 0 ? _ref : "";
15
- var e = (_ref2 = s == null ? undefined : s.menuCode) !== null && _ref2 !== void 0 ? _ref2 : "",
16
- r = false;
17
- if (t) {
18
- var _commonInfo$getMenuIt;
19
- var o = [];
20
- var a = typeof t == "string" ? t.replace(/-/g, ".") : t.map(function (i) {
21
- return i.replace(/-/g, ".");
22
- });
23
- if (!e) o = (_commonInfo$getMenuIt = commonInfo.getMenuItemInfo().authCodes) !== null && _commonInfo$getMenuIt !== void 0 ? _commonInfo$getMenuIt : [];else {
24
- var i = commonInfo.getAuthobj()[e];
25
- i && (o = i.map(function (n) {
26
- return n.code;
27
- }));
28
- }
29
- r = d({
30
- btnList: o,
31
- menuCode: e || commonInfo.getMenuItemInfo().routeCode
32
- }, a);
33
- } else e && (r = !!commonInfo.getAuthobj()[e]);
34
- return r;
17
+ x = function x(r) {
18
+ var _ref;
19
+ var s = (_ref = r == null ? undefined : r.code) !== null && _ref !== void 0 ? _ref : "";
20
+ var t = false;
21
+ if (!s) return t;
22
+ var n = Array.isArray(s) ? s : [s],
23
+ i = commonInfo.getCurrentModulePermissionData("all"),
24
+ d = Array.isArray(i == null ? undefined : i.idList) ? i.idList : commonInfo.getCurrentModulePermissionData("id"),
25
+ c = Array.isArray(i == null ? undefined : i.codeList) ? i.codeList : commonInfo.getCurrentModulePermissionData("code"),
26
+ o = new Set((Array.isArray(d) ? d : []).map(function (a) {
27
+ return String(a);
28
+ })),
29
+ f = new Set((Array.isArray(c) ? c : []).map(function (a) {
30
+ return String(a);
31
+ })),
32
+ l = n.some(function (a) {
33
+ var e = String(a !== null && a !== void 0 ? a : "").trim();
34
+ return e && !/^[0-9]{3,}$/.test(e) && !e.includes(".") && !e.includes("_");
35
+ }) ? A(f) : /* @__PURE__ */new Set(),
36
+ S = function S(a) {
37
+ if (!a) return false;
38
+ var e = String(a || "").trim();
39
+ if (!e) return false;
40
+ if (e.includes(".") || e.includes("_")) return f.has(e);
41
+ var m = {
42
+ search: "q",
43
+ add: "a",
44
+ "delete": "d",
45
+ edit: "m",
46
+ view: "v"
47
+ }[e] || "";
48
+ return l.has(e) || (m ? l.has(m) : false);
49
+ };
50
+ return (o.size > 0 || f.size > 0) && (t = n.some(function (a) {
51
+ var e = String(a !== null && a !== void 0 ? a : "").trim();
52
+ return e ? /^[0-9]{3,}$/.test(e) ? o.has(e) : S(e) : false;
53
+ }), t) ? true : t;
35
54
  },
36
- f = function f(s, t) {
37
- t === "hide" ? s.classList.remove("is-hide") : (s.removeAttribute("disabled"), s.classList.remove("is-disabled"));
55
+ y = function y(r, s) {
56
+ s === "hide" ? r.classList.remove("is-hide") : (r.removeAttribute("disabled"), r.classList.remove("is-disabled"));
38
57
  },
39
- y = function y(s, t) {
40
- var _ref3;
41
- var e = (s ? t.value : t) || {};
42
- typeof e == "string" && (e = {
43
- code: e
58
+ M = function M(r, s) {
59
+ var _ref2;
60
+ var t = (r ? s.value : s) || {};
61
+ typeof t == "string" && (t = {
62
+ code: t
44
63
  });
45
- var r = (_ref3 = e == null ? undefined : e.type) !== null && _ref3 !== void 0 ? _ref3 : "hide",
46
- o = true;
47
- if (s && t.oldValue) {
48
- if (m(t.oldValue) === o) return;
49
- utils.getEl(s, e).then(function (n) {
50
- f(n, r);
64
+ var n = (_ref2 = t == null ? undefined : t.type) !== null && _ref2 !== void 0 ? _ref2 : "hide",
65
+ i = true;
66
+ if (r && s.oldValue) {
67
+ if (x(s.oldValue) === i) return;
68
+ utils.getEl(r, t).then(function (o) {
69
+ y(o, n);
51
70
  });
52
71
  }
53
- return o;
72
+ return i;
54
73
  };
55
- exports.vAuth = y;
74
+ exports.vAuth = M;
@@ -1,38 +1,47 @@
1
- import { getMenuItemInfo as l, getAuthobj as u } from "@das-fed/upf-utils/common-info";
2
- import { getEl as c } from "@das-fed/upf-utils/directive/utils";
3
- const d = (s, t) => {
4
- const { btnList: e, menuCode: r } = s;
5
- return !e || !t ? !1 : (Array.isArray(t) ? t : [t]).some((a) => e.includes(r ? `${r}.${a}` : a));
6
- }, m = (s) => {
7
- const t = (s == null ? void 0 : s.code) ?? "";
8
- let e = (s == null ? void 0 : s.menuCode) ?? "", r = !1;
9
- if (t) {
10
- let o = [];
11
- const a = typeof t == "string" ? t.replace(/-/g, ".") : t.map((i) => i.replace(/-/g, "."));
12
- if (!e)
13
- o = l().authCodes ?? [];
14
- else {
15
- const i = u()[e];
16
- i && (o = i.map((n) => n.code));
17
- }
18
- r = d({ btnList: o, menuCode: e || l().routeCode }, a);
19
- } else
20
- e && (r = !!u()[e]);
21
- return r;
22
- }, f = (s, t) => {
23
- t === "hide" ? s.classList.remove("is-hide") : (s.removeAttribute("disabled"), s.classList.remove("is-disabled"));
24
- }, y = (s, t) => {
25
- let e = (s ? t.value : t) || {};
26
- typeof e == "string" && (e = { code: e });
27
- const r = (e == null ? void 0 : e.type) ?? "hide", o = !0;
28
- if (s && t.oldValue) {
29
- if (m(t.oldValue) === o) return;
30
- c(s, e).then((n) => {
31
- f(n, r);
1
+ import { getCurrentModulePermissionData as u } from "@das-fed/upf-utils/common-info";
2
+ import { getEl as h } from "@das-fed/upf-utils/directive/utils";
3
+ const A = (r) => {
4
+ const s = /* @__PURE__ */ new Set();
5
+ return r.forEach((t) => {
6
+ const n = String(t ?? "").trim();
7
+ if (!n) return;
8
+ const i = n.lastIndexOf("."), d = n.lastIndexOf("_"), c = Math.max(i, d), o = c >= 0 ? n.slice(c + 1) : n;
9
+ o && s.add(o);
10
+ }), s;
11
+ }, x = (r) => {
12
+ const s = (r == null ? void 0 : r.code) ?? "";
13
+ let t = !1;
14
+ if (!s)
15
+ return t;
16
+ const n = Array.isArray(s) ? s : [s], i = u("all"), d = Array.isArray(i == null ? void 0 : i.idList) ? i.idList : u("id"), c = Array.isArray(i == null ? void 0 : i.codeList) ? i.codeList : u("code"), o = new Set((Array.isArray(d) ? d : []).map((a) => String(a))), f = new Set((Array.isArray(c) ? c : []).map((a) => String(a))), l = n.some((a) => {
17
+ const e = String(a ?? "").trim();
18
+ return e && !/^[0-9]{3,}$/.test(e) && !e.includes(".") && !e.includes("_");
19
+ }) ? A(f) : /* @__PURE__ */ new Set(), S = (a) => {
20
+ if (!a) return !1;
21
+ const e = String(a || "").trim();
22
+ if (!e) return !1;
23
+ if (e.includes(".") || e.includes("_")) return f.has(e);
24
+ const m = { search: "q", add: "a", delete: "d", edit: "m", view: "v" }[e] || "";
25
+ return l.has(e) || (m ? l.has(m) : !1);
26
+ };
27
+ return (o.size > 0 || f.size > 0) && (t = n.some((a) => {
28
+ const e = String(a ?? "").trim();
29
+ return e ? /^[0-9]{3,}$/.test(e) ? o.has(e) : S(e) : !1;
30
+ }), t) ? !0 : t;
31
+ }, y = (r, s) => {
32
+ s === "hide" ? r.classList.remove("is-hide") : (r.removeAttribute("disabled"), r.classList.remove("is-disabled"));
33
+ }, M = (r, s) => {
34
+ let t = (r ? s.value : s) || {};
35
+ typeof t == "string" && (t = { code: t });
36
+ const n = (t == null ? void 0 : t.type) ?? "hide", i = !0;
37
+ if (r && s.oldValue) {
38
+ if (x(s.oldValue) === i) return;
39
+ h(r, t).then((o) => {
40
+ y(o, n);
32
41
  });
33
42
  }
34
- return o;
43
+ return i;
35
44
  };
36
45
  export {
37
- y as vAuth
46
+ M as vAuth
38
47
  };
Binary file
package/esm-map.json CHANGED
@@ -150,5 +150,11 @@
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"
154
160
  }
@@ -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-dev.226",
3
+ "version": "6.4.0-dev.228",
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-dev.226",
25
- "@das-fed/upf-web": "6.4.0-dev.226",
24
+ "@das-fed/upf-cli": "6.4.0-dev.228",
25
+ "@das-fed/upf-web": "6.4.0-dev.228",
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;