@das-fed/upf-utils 6.4.0-dev.223 → 6.4.0-dev.225

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 (37) hide show
  1. package/api-services/modules/app-manage/es5.js +1107 -1095
  2. package/api-services/modules/app-manage/index.js +916 -898
  3. package/api-services/modules/app-manage/index.js.gz +0 -0
  4. package/api-services/modules/es5.js +1324 -1312
  5. package/api-services/modules/file/es5.js +1231 -1219
  6. package/api-services/modules/file/index.js +1020 -1002
  7. package/api-services/modules/file/index.js.gz +0 -0
  8. package/api-services/modules/gateway-edge/es5.js +805 -803
  9. package/api-services/modules/gateway-edge/index.js +626 -622
  10. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  11. package/api-services/modules/index.js +1070 -1052
  12. package/api-services/modules/index.js.gz +0 -0
  13. package/api-services/modules/justauth/es5.js +1085 -1076
  14. package/api-services/modules/justauth/index.js +895 -881
  15. package/api-services/modules/justauth/index.js.gz +0 -0
  16. package/api-services/modules/platformManage/es5.js +1094 -1082
  17. package/api-services/modules/platformManage/index.js +901 -883
  18. package/api-services/modules/platformManage/index.js.gz +0 -0
  19. package/api-services/modules/supplier/es5.js +1109 -1097
  20. package/api-services/modules/supplier/index.js +916 -898
  21. package/api-services/modules/supplier/index.js.gz +0 -0
  22. package/api-services/modules/supplychain-manage/es5.js +1084 -1072
  23. package/api-services/modules/supplychain-manage/index.js +894 -876
  24. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  25. package/api-services/modules/tool/es5.js +1083 -1074
  26. package/api-services/modules/tool/index.js +894 -880
  27. package/api-services/modules/tool/index.js.gz +0 -0
  28. package/api-services/src/create-service/es5.js +803 -801
  29. package/api-services/src/create-service/index.js +625 -621
  30. package/api-services/src/create-service/index.js.gz +0 -0
  31. package/directive/auth/es5.js +34 -41
  32. package/directive/auth/index.js +30 -38
  33. package/directive/auth/index.js.gz +0 -0
  34. package/hooks/use-get-auth/apis.d.ts +1 -0
  35. package/hooks/use-get-auth/es5.js +17 -13
  36. package/hooks/use-get-auth/index.js +13 -10
  37. package/package.json +3 -3
@@ -2,61 +2,54 @@
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);
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
10
  });
11
11
  },
12
- n = function n(e) {
12
+ m = function m(s) {
13
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 : "",
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
16
  r = false;
17
17
  if (t) {
18
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, ".");
19
+ var o = [];
20
+ var a = typeof t == "string" ? t.replace(/-/g, ".") : t.map(function (i) {
21
+ return i.replace(/-/g, ".");
22
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;
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
27
  }));
28
28
  }
29
- r = m({
30
- btnList: i,
31
- menuCode: s || commonInfo.getMenuItemInfo().routeCode
32
- }, d);
33
- } else s && (r = !!commonInfo.getAuthobj()[s]);
29
+ r = d({
30
+ btnList: o,
31
+ menuCode: e || commonInfo.getMenuItemInfo().routeCode
32
+ }, a);
33
+ } else e && (r = !!commonInfo.getAuthobj()[e]);
34
34
  return r;
35
35
  },
36
- f = function f(e, t) {
37
- t === "hide" ? e.classList.add("is-hide") : (e.setAttribute("disabled", ""), e.classList.add("is-disabled"));
36
+ f = function f(s, t) {
37
+ t === "hide" ? s.classList.remove("is-hide") : (s.removeAttribute("disabled"), s.classList.remove("is-disabled"));
38
38
  },
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) {
39
+ y = function y(s, t) {
43
40
  var _ref3;
44
- var s = (e ? t.value : t) || {};
45
- typeof s == "string" && (s = {
46
- code: s
41
+ var e = (s ? t.value : t) || {};
42
+ typeof e == "string" && (e = {
43
+ code: e
47
44
  });
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);
52
- });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);
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);
58
51
  });
59
52
  }
60
- return i;
53
+ return o;
61
54
  };
62
- exports.vAuth = L;
55
+ exports.vAuth = y;
@@ -1,46 +1,38 @@
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;
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
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 ?? [];
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
14
  else {
15
- const a = l()[s];
16
- a && (i = a.map((o) => o.code));
15
+ const i = u()[e];
16
+ i && (o = i.map((n) => n.code));
17
17
  }
18
- r = m({ btnList: i, menuCode: s || c().routeCode }, d);
18
+ r = d({ btnList: o, menuCode: e || l().routeCode }, a);
19
19
  } else
20
- s && (r = !!l()[s]);
20
+ e && (r = !!u()[e]);
21
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);
30
- if (e)
31
- if (!t.oldValue)
32
- i || u(e, s).then((d) => {
33
- f(d, r);
34
- });
35
- 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);
40
- });
41
- }
42
- return i;
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);
32
+ });
33
+ }
34
+ return o;
43
35
  };
44
36
  export {
45
- L as vAuth
37
+ y as vAuth
46
38
  };
Binary file
@@ -0,0 +1 @@
1
+ export declare const getRightsListApi: any;
@@ -6,23 +6,27 @@ 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 l = function l() {
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() {
10
14
  return {
11
15
  getApplication: function () {
12
16
  var _getApplication = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(t) {
13
- var i;
17
+ var r;
14
18
  return _regenerator().w(function (_context) {
15
19
  while (1) switch (_context.n) {
16
20
  case 0:
17
21
  _context.n = 1;
18
22
  return nextTiken.projectNextTick();
19
23
  case 1:
20
- i = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter(function (e) {
24
+ r = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter(function (e) {
21
25
  return e.type === "application";
22
26
  });
23
- return _context.a(2, t ? i.find(function (e) {
27
+ return _context.a(2, t ? r.find(function (e) {
24
28
  return e.appId === t;
25
- }) : i);
29
+ }) : r);
26
30
  }
27
31
  }, _callee);
28
32
  }));
@@ -33,15 +37,15 @@ var l = function l() {
33
37
  }(),
34
38
  getMenu: function () {
35
39
  var _getMenu = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(t, n) {
36
- var i, e, a;
40
+ var r, e, a;
37
41
  return _regenerator().w(function (_context2) {
38
42
  while (1) switch (_context2.n) {
39
43
  case 0:
40
44
  _context2.n = 1;
41
45
  return nextTiken.projectNextTick();
42
46
  case 1:
43
- i = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = commonTools.flatTree(i).filter(function (r) {
44
- return r.type === "menu";
47
+ r = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = commonTools.flatTree(r).filter(function (i) {
48
+ return i.type === "menu";
45
49
  });
46
50
  if (!(!t && !n)) {
47
51
  _context2.n = 2;
@@ -49,10 +53,10 @@ var l = function l() {
49
53
  }
50
54
  return _context2.a(2, e);
51
55
  case 2:
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;
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;
56
60
  })), a));
57
61
  }
58
62
  }, _callee2);
@@ -64,4 +68,4 @@ var l = function l() {
64
68
  }()
65
69
  };
66
70
  };
67
- exports.useGetAuth = l;
71
+ exports.useGetAuth = w;
@@ -1,19 +1,22 @@
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 = () => ({
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 = () => ({
4
7
  getApplication: async (t) => {
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;
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;
8
11
  },
9
12
  getMenu: async (t, n) => {
10
- await s();
11
- const i = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = o(i).filter((r) => r.type === "menu");
13
+ await o();
14
+ const r = JSON.parse(sessionStorage.getItem("menuList") || "[]"), e = s(r).filter((i) => i.type === "menu");
12
15
  if (!t && !n) return e;
13
16
  let a;
14
- return t ? a = e.find((r) => r.routeCode === t || r.originalCode === t) : n && (a = e.find((r) => r.routeUrl === n)), a;
17
+ return t ? a = e.find((i) => i.routeCode === t || i.originalCode === t) : n && (a = e.find((i) => i.routeUrl === n)), a;
15
18
  }
16
19
  });
17
20
  export {
18
- l as useGetAuth
21
+ w as useGetAuth
19
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/upf-utils",
3
- "version": "6.4.0-dev.223",
3
+ "version": "6.4.0-dev.225",
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.223",
25
- "@das-fed/upf-web": "6.4.0-dev.223",
24
+ "@das-fed/upf-cli": "6.4.0-dev.225",
25
+ "@das-fed/upf-web": "6.4.0-dev.225",
26
26
  "@rollup/plugin-babel": "6.0.4",
27
27
  "@types/js-cookie": "^3.0.6",
28
28
  "@types/lodash-es": "^4.17.12",