@das-fed/upf-utils 6.4.0-dev.223 → 6.4.0-dev.224
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.
- package/api-services/modules/app-manage/es5.js +1107 -1095
- package/api-services/modules/app-manage/index.js +916 -898
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +1095 -1107
- package/api-services/modules/authentication/index.js +898 -916
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/file/es5.js +1231 -1219
- package/api-services/modules/file/index.js +1020 -1002
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +805 -803
- package/api-services/modules/gateway-edge/index.js +626 -622
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +1085 -1076
- package/api-services/modules/justauth/index.js +895 -881
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +1072 -1084
- package/api-services/modules/knowledge/index.js +876 -894
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +1094 -1082
- package/api-services/modules/platformManage/index.js +901 -883
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.js +1107 -1095
- package/api-services/modules/portal/index.js +916 -898
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +1109 -1097
- package/api-services/modules/supplier/index.js +916 -898
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.js +1084 -1072
- package/api-services/modules/supplychain-manage/index.js +894 -876
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +1083 -1074
- package/api-services/modules/tool/index.js +894 -880
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +803 -801
- package/api-services/src/create-service/index.js +625 -621
- package/api-services/src/create-service/index.js.gz +0 -0
- package/create-api-service/es5.js +1092 -1080
- package/create-api-service/index.js +904 -886
- package/create-api-service/index.js.gz +0 -0
- package/directive/auth/es5.js +34 -41
- package/directive/auth/index.js +30 -38
- package/directive/auth/index.js.gz +0 -0
- package/hooks/use-get-auth/apis.d.ts +1 -0
- package/hooks/use-get-auth/es5.js +17 -13
- package/hooks/use-get-auth/index.js +13 -10
- package/package.json +3 -3
|
Binary file
|
package/directive/auth/es5.js
CHANGED
|
@@ -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
|
|
6
|
-
var
|
|
7
|
-
r =
|
|
8
|
-
return !
|
|
9
|
-
return
|
|
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
|
-
|
|
12
|
+
m = function m(s) {
|
|
13
13
|
var _ref, _ref2;
|
|
14
|
-
var t = (_ref =
|
|
15
|
-
var
|
|
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
|
|
20
|
-
var
|
|
21
|
-
return
|
|
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 (!
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
return
|
|
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 =
|
|
30
|
-
btnList:
|
|
31
|
-
menuCode:
|
|
32
|
-
},
|
|
33
|
-
} else
|
|
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(
|
|
37
|
-
t === "hide" ?
|
|
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
|
-
|
|
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
|
|
45
|
-
typeof
|
|
46
|
-
code:
|
|
41
|
+
var e = (s ? t.value : t) || {};
|
|
42
|
+
typeof e == "string" && (e = {
|
|
43
|
+
code: e
|
|
47
44
|
});
|
|
48
|
-
var r = (_ref3 =
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
|
53
|
+
return o;
|
|
61
54
|
};
|
|
62
|
-
exports.vAuth =
|
|
55
|
+
exports.vAuth = y;
|
package/directive/auth/index.js
CHANGED
|
@@ -1,46 +1,38 @@
|
|
|
1
|
-
import { getMenuItemInfo as
|
|
2
|
-
import { getEl as
|
|
3
|
-
const
|
|
4
|
-
const { btnList:
|
|
5
|
-
return !
|
|
6
|
-
},
|
|
7
|
-
const t = (
|
|
8
|
-
let
|
|
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
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
13
|
-
|
|
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
|
|
16
|
-
|
|
15
|
+
const i = u()[e];
|
|
16
|
+
i && (o = i.map((n) => n.code));
|
|
17
17
|
}
|
|
18
|
-
r =
|
|
18
|
+
r = d({ btnList: o, menuCode: e || l().routeCode }, a);
|
|
19
19
|
} else
|
|
20
|
-
|
|
20
|
+
e && (r = !!u()[e]);
|
|
21
21
|
return r;
|
|
22
|
-
}, f = (
|
|
23
|
-
t === "hide" ?
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
24
|
+
r = JSON.parse(sessionStorage.getItem("menuList") || "[]").filter(function (e) {
|
|
21
25
|
return e.type === "application";
|
|
22
26
|
});
|
|
23
|
-
return _context.a(2, t ?
|
|
27
|
+
return _context.a(2, t ? r.find(function (e) {
|
|
24
28
|
return e.appId === t;
|
|
25
|
-
}) :
|
|
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
|
|
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
|
-
|
|
44
|
-
return
|
|
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 (
|
|
53
|
-
return
|
|
54
|
-
}) : n && (a = e.find(function (
|
|
55
|
-
return
|
|
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 =
|
|
71
|
+
exports.useGetAuth = w;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { flatTree as
|
|
2
|
-
import { projectNextTick as
|
|
3
|
-
|
|
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
|
|
6
|
-
const
|
|
7
|
-
return 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;
|
|
8
11
|
},
|
|
9
12
|
getMenu: async (t, n) => {
|
|
10
|
-
await
|
|
11
|
-
const
|
|
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((
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "6.4.0-dev.224",
|
|
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.
|
|
25
|
-
"@das-fed/upf-web": "6.4.0-dev.
|
|
24
|
+
"@das-fed/upf-cli": "6.4.0-dev.224",
|
|
25
|
+
"@das-fed/upf-web": "6.4.0-dev.224",
|
|
26
26
|
"@rollup/plugin-babel": "6.0.4",
|
|
27
27
|
"@types/js-cookie": "^3.0.6",
|
|
28
28
|
"@types/lodash-es": "^4.17.12",
|