mp-front-cli 2.1.1-next-0 → 2.1.1-next-1
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/dist/AuthEngine-AJU52DBI.cjs +1 -0
- package/dist/{fetch-service-parent-be-B7dH5eoV.js → AuthEngine-MkGcIFAo.js} +443 -250
- package/dist/core/utils/AuthEngine/AuthEngine.d.ts +31 -0
- package/dist/core/utils/AuthEngine/AuthEngine.d.ts.map +1 -0
- package/dist/core/utils/AuthEngine/EntraID.d.ts +11 -0
- package/dist/core/utils/AuthEngine/EntraID.d.ts.map +1 -0
- package/dist/core/utils/AuthEngine/index.d.ts +2 -0
- package/dist/core/utils/AuthEngine/index.d.ts.map +1 -0
- package/dist/core/utils/AuthEngine/interfaces/index.d.ts +51 -0
- package/dist/core/utils/AuthEngine/interfaces/index.d.ts.map +1 -0
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/core/utils/index.d.ts.map +1 -1
- package/dist/mp-front-cli-all.cjs +1 -0
- package/dist/mp-front-cli-all.js +15 -0
- package/dist/mp-front-cli-cache.cjs +1 -0
- package/dist/{mp-front-cli6.js → mp-front-cli-cache.js} +1 -1
- package/dist/mp-front-cli-core.cjs +1 -0
- package/dist/mp-front-cli-core.js +15 -0
- package/dist/{mp-front-cli-encoder.cjs.js → mp-front-cli-encoder.cjs} +1 -1
- package/dist/{mp-front-cli11.js → mp-front-cli-encoder.js} +1 -1
- package/dist/mp-front-cli-encrypter.cjs +1 -0
- package/dist/{mp-front-cli8.js → mp-front-cli-encrypter.js} +1 -1
- package/dist/mp-front-cli-header.cjs +1 -0
- package/dist/{mp-front-cli5.js → mp-front-cli-header.js} +2 -2
- package/dist/{mp-front-cli-services.cjs.js → mp-front-cli-services.cjs} +1 -1
- package/dist/mp-front-cli-services.js +4 -0
- package/dist/{service-token-CkqXJlgW.cjs → service-token-Bv3BAiQd.cjs} +1 -1
- package/dist/{service-token-CK4mGUv8.js → service-token-DUKgd-pZ.js} +1 -1
- package/package.json +1 -1
- package/dist/fetch-service-parent-be-1E2rjJep.cjs +0 -1
- package/dist/mp-front-cli-all.cjs.js +0 -1
- package/dist/mp-front-cli-cache.cjs.js +0 -1
- package/dist/mp-front-cli-core.cjs.js +0 -1
- package/dist/mp-front-cli-encrypter.cjs.js +0 -1
- package/dist/mp-front-cli-header.cjs.js +0 -1
- package/dist/mp-front-cli.js +0 -14
- package/dist/mp-front-cli2.js +0 -14
- package/dist/mp-front-cli4.js +0 -4
- /package/dist/{mp-front-cli-adapter.cjs.js → mp-front-cli-adapter.cjs} +0 -0
- /package/dist/{mp-front-cli10.js → mp-front-cli-adapter.js} +0 -0
- /package/dist/{mp-front-cli-locale.cjs.js → mp-front-cli-locale.cjs} +0 -0
- /package/dist/{mp-front-cli9.js → mp-front-cli-locale.js} +0 -0
- /package/dist/{mp-front-cli-logger.cjs.js → mp-front-cli-logger.cjs} +0 -0
- /package/dist/{mp-front-cli7.js → mp-front-cli-logger.js} +0 -0
- /package/dist/{mp-front-cli-utils-rxjs.cjs.js → mp-front-cli-utils-rxjs.cjs} +0 -0
- /package/dist/{mp-front-cli3.js → mp-front-cli-utils-rxjs.js} +0 -0
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { of as O, switchMap as
|
|
5
|
-
import { CustomEncrypter as
|
|
6
|
-
import { CustomHeader as
|
|
7
|
-
import
|
|
8
|
-
import { f as
|
|
9
|
-
import { L as S, M as
|
|
10
|
-
import { CustomEncoder as
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
1
|
+
var Q = Object.defineProperty;
|
|
2
|
+
var G = (l, a, e) => a in l ? Q(l, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[a] = e;
|
|
3
|
+
var n = (l, a, e) => G(l, typeof a != "symbol" ? a + "" : a, e);
|
|
4
|
+
import { of as O, switchMap as T, forkJoin as D, catchError as g, EMPTY as P, filter as v, from as h } from "rxjs";
|
|
5
|
+
import { CustomEncrypter as V } from "./mp-front-cli-encrypter.js";
|
|
6
|
+
import { CustomHeader as F } from "./mp-front-cli-header.js";
|
|
7
|
+
import x from "querystring";
|
|
8
|
+
import { f as I } from "./service-token-DUKgd-pZ.js";
|
|
9
|
+
import { L as S, M as u } from "./loading-handler-Br21zGTA.js";
|
|
10
|
+
import { CustomEncoder as _ } from "./mp-front-cli-encoder.js";
|
|
11
|
+
import { CustomLogger as w } from "./mp-front-cli-logger.js";
|
|
12
|
+
import f from "i18next";
|
|
13
|
+
import { t as J } from "./index-Dy5KNkhq.js";
|
|
14
|
+
import { CustomCache as $ } from "./mp-front-cli-cache.js";
|
|
15
|
+
import { u as H } from "./stringify-93tp0umt.js";
|
|
16
|
+
const y = (l) => (f.init({
|
|
16
17
|
resources: {
|
|
17
18
|
es: {
|
|
18
19
|
translation: {
|
|
19
20
|
errors: {
|
|
20
|
-
...
|
|
21
|
-
...(
|
|
21
|
+
...J.errors,
|
|
22
|
+
...(l == null ? void 0 : l.es) ?? {}
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -33,7 +34,7 @@ const f = (t) => (B.init({
|
|
|
33
34
|
// react already safes from xss
|
|
34
35
|
},
|
|
35
36
|
debug: !1
|
|
36
|
-
}),
|
|
37
|
+
}), f), Y = {
|
|
37
38
|
"SKIPFINGERPRINT-WITHOUT-PERMISSIONS-01": {
|
|
38
39
|
code: 400,
|
|
39
40
|
type: "modal",
|
|
@@ -90,7 +91,7 @@ const f = (t) => (B.init({
|
|
|
90
91
|
title: "errors.helpdesk.UNEXCEPTED-ERROR.title",
|
|
91
92
|
level: "error"
|
|
92
93
|
}
|
|
93
|
-
},
|
|
94
|
+
}, X = {
|
|
94
95
|
"PF-CANCEL-APPLICATION-GENERIC-ERROR-001": {
|
|
95
96
|
code: 400,
|
|
96
97
|
type: "modal",
|
|
@@ -98,10 +99,10 @@ const f = (t) => (B.init({
|
|
|
98
99
|
title: "errors.PF-CANCEL-APPLICATION-GENERIC-ERROR-001.title",
|
|
99
100
|
level: "error"
|
|
100
101
|
}
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
...
|
|
104
|
-
},
|
|
102
|
+
}, b = {
|
|
103
|
+
...X,
|
|
104
|
+
...Y
|
|
105
|
+
}, K = {
|
|
105
106
|
UNAUTHORIZED: {
|
|
106
107
|
level: "warning",
|
|
107
108
|
type: "modal",
|
|
@@ -944,36 +945,36 @@ const f = (t) => (B.init({
|
|
|
944
945
|
type: "modal",
|
|
945
946
|
level: "warning"
|
|
946
947
|
},
|
|
947
|
-
...
|
|
948
|
+
...b
|
|
948
949
|
};
|
|
949
|
-
class
|
|
950
|
+
class m extends w {
|
|
950
951
|
constructor() {
|
|
951
952
|
super(...arguments);
|
|
952
|
-
|
|
953
|
-
|
|
953
|
+
n(this, "errorCatalog", { ...K });
|
|
954
|
+
n(this, "i18Next");
|
|
954
955
|
}
|
|
955
956
|
get(e = "default", r = "NOT_FOUND") {
|
|
956
|
-
var
|
|
957
|
-
const { errorCatalog:
|
|
957
|
+
var o, A;
|
|
958
|
+
const { errorCatalog: t } = this;
|
|
958
959
|
if (e instanceof Error)
|
|
959
960
|
return this.logError(e.message), {
|
|
960
|
-
...
|
|
961
|
-
title: this.translate(
|
|
962
|
-
message: this.translate(
|
|
961
|
+
...t.internalError,
|
|
962
|
+
title: this.translate(t.internalError.title),
|
|
963
|
+
message: this.translate(t.internalError.message),
|
|
963
964
|
uuid: r
|
|
964
965
|
};
|
|
965
|
-
const
|
|
966
|
-
this.logDebug("statusCode",
|
|
967
|
-
const
|
|
966
|
+
const s = typeof e == "string" ? e : e.code ?? e.errorType;
|
|
967
|
+
this.logDebug("statusCode", s);
|
|
968
|
+
const E = typeof e == "string" ? {} : { ...e };
|
|
968
969
|
return {
|
|
969
|
-
...s
|
|
970
|
+
...t[s] ?? t.default,
|
|
970
971
|
title: this.translate(
|
|
971
|
-
((
|
|
972
|
-
|
|
972
|
+
((o = t[s]) == null ? void 0 : o.title) ?? t.default.title,
|
|
973
|
+
E
|
|
973
974
|
),
|
|
974
975
|
message: this.translate(
|
|
975
|
-
((
|
|
976
|
-
|
|
976
|
+
((A = t[s]) == null ? void 0 : A.message) ?? t.default.message,
|
|
977
|
+
E
|
|
977
978
|
),
|
|
978
979
|
payload: typeof e != "string" ? { errorCode: e.code } : {},
|
|
979
980
|
uuid: r
|
|
@@ -983,253 +984,253 @@ class n extends G {
|
|
|
983
984
|
this.errorCatalog = { ...this.errorCatalog, ...e };
|
|
984
985
|
}
|
|
985
986
|
setI18nResources(e) {
|
|
986
|
-
this.i18Next =
|
|
987
|
+
this.i18Next = y(e);
|
|
987
988
|
}
|
|
988
989
|
translate(e, r = {}) {
|
|
989
|
-
return this.i18Next || (this.i18Next =
|
|
990
|
+
return this.i18Next || (this.i18Next = y()), this.i18Next.t(e, { payload: r });
|
|
990
991
|
}
|
|
991
992
|
}
|
|
992
|
-
class
|
|
993
|
+
class ge extends V {
|
|
993
994
|
constructor() {
|
|
994
995
|
super(...arguments);
|
|
995
|
-
|
|
996
|
-
|
|
996
|
+
n(this, "uuid", "");
|
|
997
|
+
n(this, "session", null);
|
|
997
998
|
}
|
|
998
999
|
setSession(e) {
|
|
999
1000
|
this.session = e;
|
|
1000
1001
|
}
|
|
1001
1002
|
getSession() {
|
|
1002
|
-
if (!this.session) throw new
|
|
1003
|
+
if (!this.session) throw new m().get("SESSION_NOT_FOUND");
|
|
1003
1004
|
return this.session;
|
|
1004
1005
|
}
|
|
1005
|
-
returnData(e, r,
|
|
1006
|
-
const
|
|
1007
|
-
e.status(200).json(
|
|
1006
|
+
returnData(e, r, t) {
|
|
1007
|
+
const s = this.encode(r, t);
|
|
1008
|
+
e.status(200).json(s);
|
|
1008
1009
|
}
|
|
1009
1010
|
returnError(e, r) {
|
|
1010
|
-
return r != null && r.uuid ? e.status(520).json(r) : e.status(520).json(new
|
|
1011
|
+
return r != null && r.uuid ? e.status(520).json(r) : e.status(520).json(new m().get(r, this.uuid));
|
|
1011
1012
|
}
|
|
1012
1013
|
get(e) {
|
|
1013
|
-
return this.logDebug("get ApiMiddleware"), (r,
|
|
1014
|
-
var
|
|
1015
|
-
this.logDebug("return ApiMiddleware"), this.uuid = (
|
|
1016
|
-
|
|
1017
|
-
(
|
|
1018
|
-
params: O(this.decode(
|
|
1019
|
-
headers: O(
|
|
1014
|
+
return this.logDebug("get ApiMiddleware"), (r, t) => {
|
|
1015
|
+
var s;
|
|
1016
|
+
this.logDebug("return ApiMiddleware"), this.uuid = (s = r == null ? void 0 : r.body) == null ? void 0 : s.uuid, O(r).pipe(
|
|
1017
|
+
T(
|
|
1018
|
+
(E) => D({
|
|
1019
|
+
params: O(this.decode(E.body)),
|
|
1020
|
+
headers: O(E.headers)
|
|
1020
1021
|
})
|
|
1021
1022
|
),
|
|
1022
|
-
|
|
1023
|
-
({ params:
|
|
1024
|
-
response: e(
|
|
1025
|
-
headers: O(
|
|
1026
|
-
params: O(
|
|
1023
|
+
T(
|
|
1024
|
+
({ params: E, headers: o }) => D({
|
|
1025
|
+
response: e(E, this.uuid, o),
|
|
1026
|
+
headers: O(o),
|
|
1027
|
+
params: O(E)
|
|
1027
1028
|
})
|
|
1028
1029
|
),
|
|
1029
|
-
|
|
1030
|
-
`ApiMiddleware \x1B[37m <URL>: \x1B[33m ${r.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1031
|
-
), O(
|
|
1032
|
-
|
|
1033
|
-
var
|
|
1030
|
+
T(({ params: E, response: o, headers: A }) => (this.logDebug(
|
|
1031
|
+
`ApiMiddleware \x1B[37m <URL>: \x1B[33m ${r.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(A)} \x1B[37m <UUID> \x1B[33m ${r.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(E)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)}`
|
|
1032
|
+
), O(o))),
|
|
1033
|
+
g((E) => {
|
|
1034
|
+
var o;
|
|
1034
1035
|
return this.logError(
|
|
1035
|
-
`ApiMiddleware <URL>: ${r == null ? void 0 : r.url} <HEADERS>: ${JSON.stringify(r == null ? void 0 : r.headers)} <UUID> ${(
|
|
1036
|
-
), this.returnError(
|
|
1036
|
+
`ApiMiddleware <URL>: ${r == null ? void 0 : r.url} <HEADERS>: ${JSON.stringify(r == null ? void 0 : r.headers)} <UUID> ${(o = r == null ? void 0 : r.body) == null ? void 0 : o.uuid} <PARAMS> ${JSON.stringify(r == null ? void 0 : r.body)} <ERROR>: ${JSON.stringify(E)}`
|
|
1037
|
+
), this.returnError(t, E), P;
|
|
1037
1038
|
})
|
|
1038
1039
|
).subscribe({
|
|
1039
|
-
next: (
|
|
1040
|
-
this.logDebug("ApiMiddleware subscribe next", JSON.stringify(
|
|
1040
|
+
next: (E) => {
|
|
1041
|
+
this.logDebug("ApiMiddleware subscribe next", JSON.stringify(E)), this.returnData(t, E, this.uuid);
|
|
1041
1042
|
}
|
|
1042
1043
|
});
|
|
1043
1044
|
};
|
|
1044
1045
|
}
|
|
1045
1046
|
}
|
|
1046
|
-
const
|
|
1047
|
-
class
|
|
1048
|
-
constructor(e, r,
|
|
1049
|
-
super(
|
|
1050
|
-
|
|
1051
|
-
|
|
1047
|
+
const k = process.env.ID_FRONT ?? "NOT_AVAILABLE";
|
|
1048
|
+
class Le extends F {
|
|
1049
|
+
constructor(e, r, t = {}) {
|
|
1050
|
+
super(t);
|
|
1051
|
+
n(this, "apiUrl");
|
|
1052
|
+
n(this, "method");
|
|
1052
1053
|
this.apiUrl = e, this.method = r ?? "POST";
|
|
1053
1054
|
}
|
|
1054
1055
|
errorHandler(e, r) {
|
|
1055
1056
|
if (e != null && e.errors)
|
|
1056
|
-
throw new
|
|
1057
|
+
throw new m().get(e.errors[0], r);
|
|
1057
1058
|
return !(e != null && e.errors);
|
|
1058
1059
|
}
|
|
1059
1060
|
formatParams(e) {
|
|
1060
1061
|
return JSON.stringify({
|
|
1061
1062
|
data: {
|
|
1062
|
-
type:
|
|
1063
|
+
type: k,
|
|
1063
1064
|
attributes: e
|
|
1064
1065
|
}
|
|
1065
1066
|
});
|
|
1066
1067
|
}
|
|
1067
1068
|
fetchData(e = {}, r) {
|
|
1068
1069
|
return this.getHeaders().pipe(
|
|
1069
|
-
|
|
1070
|
-
(
|
|
1070
|
+
T(
|
|
1071
|
+
(t) => I(
|
|
1071
1072
|
this.apiUrl,
|
|
1072
1073
|
{
|
|
1073
1074
|
method: "POST",
|
|
1074
|
-
headers:
|
|
1075
|
+
headers: t,
|
|
1075
1076
|
body: this.formatParams(e),
|
|
1076
|
-
selector: (
|
|
1077
|
+
selector: (s) => s.json()
|
|
1077
1078
|
}
|
|
1078
1079
|
).pipe(
|
|
1079
|
-
|
|
1080
|
-
throw this.logError(JSON.stringify(
|
|
1080
|
+
g((s) => {
|
|
1081
|
+
throw this.logError(JSON.stringify(s)), this.logError(
|
|
1081
1082
|
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1082
|
-
|
|
1083
|
+
t
|
|
1083
1084
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1084
1085
|
this.formatParams(e)
|
|
1085
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
1086
|
-
), new
|
|
1086
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
|
|
1087
|
+
), new m().get("default", r);
|
|
1087
1088
|
}),
|
|
1088
|
-
|
|
1089
|
+
T((s) => (this.logDebug(
|
|
1089
1090
|
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1090
|
-
|
|
1091
|
+
t
|
|
1091
1092
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1092
1093
|
this.formatParams(e)
|
|
1093
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
1094
|
-
), O(
|
|
1094
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
|
|
1095
|
+
), O(s)))
|
|
1095
1096
|
)
|
|
1096
1097
|
),
|
|
1097
|
-
|
|
1098
|
+
v((t) => this.errorHandler(t, r))
|
|
1098
1099
|
);
|
|
1099
1100
|
}
|
|
1100
|
-
fetchCustomData(e = {}, r,
|
|
1101
|
-
const
|
|
1101
|
+
fetchCustomData(e = {}, r, t) {
|
|
1102
|
+
const s = {
|
|
1102
1103
|
"Content-Type": "application/json"
|
|
1103
|
-
},
|
|
1104
|
+
}, E = x.stringify(
|
|
1104
1105
|
e
|
|
1105
|
-
),
|
|
1106
|
-
return this.getHeaders(
|
|
1107
|
-
|
|
1108
|
-
(R) =>
|
|
1106
|
+
), o = `${this.apiUrl}?${E}`, A = this.method === "GET" ? o : this.apiUrl;
|
|
1107
|
+
return this.getHeaders(s, t).pipe(
|
|
1108
|
+
T(
|
|
1109
|
+
(R) => I(A, {
|
|
1109
1110
|
method: this.method,
|
|
1110
1111
|
headers: R,
|
|
1111
1112
|
body: this.method === "GET" ? null : JSON.stringify(e),
|
|
1112
|
-
selector: (
|
|
1113
|
+
selector: (N) => N.json()
|
|
1113
1114
|
}).pipe(
|
|
1114
|
-
|
|
1115
|
-
throw this.logError(JSON.stringify(
|
|
1116
|
-
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${
|
|
1115
|
+
g((N) => {
|
|
1116
|
+
throw this.logError(JSON.stringify(N)), this.logError(
|
|
1117
|
+
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${A} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1117
1118
|
R
|
|
1118
1119
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1119
1120
|
this.formatParams(e)
|
|
1120
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
1121
|
-
), new
|
|
1121
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(N)} \x1B[33m`
|
|
1122
|
+
), new m().get("default", r);
|
|
1122
1123
|
}),
|
|
1123
|
-
|
|
1124
|
-
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${
|
|
1124
|
+
T((N) => (this.logDebug(
|
|
1125
|
+
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${A} \x1B[37m \x1B[37m <METHOD>: \x1B[33m ${this.method} <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1125
1126
|
R
|
|
1126
1127
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1127
1128
|
e
|
|
1128
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
1129
|
-
), O(
|
|
1129
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(N)} \x1B[33m`
|
|
1130
|
+
), O(N)))
|
|
1130
1131
|
)
|
|
1131
1132
|
)
|
|
1132
1133
|
);
|
|
1133
1134
|
}
|
|
1134
1135
|
}
|
|
1135
|
-
const
|
|
1136
|
-
function
|
|
1137
|
-
return typeof
|
|
1136
|
+
const W = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
1137
|
+
function j(l) {
|
|
1138
|
+
return typeof l == "string" && W.test(l);
|
|
1138
1139
|
}
|
|
1139
|
-
function
|
|
1140
|
-
if (!
|
|
1140
|
+
function Z(l) {
|
|
1141
|
+
if (!j(l))
|
|
1141
1142
|
throw TypeError("Invalid UUID");
|
|
1142
|
-
let
|
|
1143
|
+
let a;
|
|
1143
1144
|
const e = new Uint8Array(16);
|
|
1144
|
-
return e[0] = (
|
|
1145
|
+
return e[0] = (a = parseInt(l.slice(0, 8), 16)) >>> 24, e[1] = a >>> 16 & 255, e[2] = a >>> 8 & 255, e[3] = a & 255, e[4] = (a = parseInt(l.slice(9, 13), 16)) >>> 8, e[5] = a & 255, e[6] = (a = parseInt(l.slice(14, 18), 16)) >>> 8, e[7] = a & 255, e[8] = (a = parseInt(l.slice(19, 23), 16)) >>> 8, e[9] = a & 255, e[10] = (a = parseInt(l.slice(24, 36), 16)) / 1099511627776 & 255, e[11] = a / 4294967296 & 255, e[12] = a >>> 24 & 255, e[13] = a >>> 16 & 255, e[14] = a >>> 8 & 255, e[15] = a & 255, e;
|
|
1145
1146
|
}
|
|
1146
|
-
function
|
|
1147
|
-
|
|
1148
|
-
const
|
|
1149
|
-
for (let e = 0; e <
|
|
1150
|
-
|
|
1151
|
-
return
|
|
1147
|
+
function z(l) {
|
|
1148
|
+
l = unescape(encodeURIComponent(l));
|
|
1149
|
+
const a = [];
|
|
1150
|
+
for (let e = 0; e < l.length; ++e)
|
|
1151
|
+
a.push(l.charCodeAt(e));
|
|
1152
|
+
return a;
|
|
1152
1153
|
}
|
|
1153
|
-
const
|
|
1154
|
-
function
|
|
1155
|
-
function r(
|
|
1156
|
-
var
|
|
1157
|
-
if (typeof
|
|
1154
|
+
const q = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", ee = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
1155
|
+
function re(l, a, e) {
|
|
1156
|
+
function r(t, s, E, o) {
|
|
1157
|
+
var A;
|
|
1158
|
+
if (typeof t == "string" && (t = z(t)), typeof s == "string" && (s = Z(s)), ((A = s) === null || A === void 0 ? void 0 : A.length) !== 16)
|
|
1158
1159
|
throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
|
|
1159
|
-
let R = new Uint8Array(16 +
|
|
1160
|
-
if (R.set(
|
|
1161
|
-
|
|
1162
|
-
for (let
|
|
1163
|
-
|
|
1164
|
-
return
|
|
1160
|
+
let R = new Uint8Array(16 + t.length);
|
|
1161
|
+
if (R.set(s), R.set(t, s.length), R = e(R), R[6] = R[6] & 15 | a, R[8] = R[8] & 63 | 128, E) {
|
|
1162
|
+
o = o || 0;
|
|
1163
|
+
for (let N = 0; N < 16; ++N)
|
|
1164
|
+
E[o + N] = R[N];
|
|
1165
|
+
return E;
|
|
1165
1166
|
}
|
|
1166
|
-
return
|
|
1167
|
+
return H(R);
|
|
1167
1168
|
}
|
|
1168
1169
|
try {
|
|
1169
|
-
r.name =
|
|
1170
|
+
r.name = l;
|
|
1170
1171
|
} catch {
|
|
1171
1172
|
}
|
|
1172
|
-
return r.DNS =
|
|
1173
|
+
return r.DNS = q, r.URL = ee, r;
|
|
1173
1174
|
}
|
|
1174
|
-
function
|
|
1175
|
-
switch (
|
|
1175
|
+
function te(l, a, e, r) {
|
|
1176
|
+
switch (l) {
|
|
1176
1177
|
case 0:
|
|
1177
|
-
return
|
|
1178
|
+
return a & e ^ ~a & r;
|
|
1178
1179
|
case 1:
|
|
1179
|
-
return
|
|
1180
|
+
return a ^ e ^ r;
|
|
1180
1181
|
case 2:
|
|
1181
|
-
return
|
|
1182
|
+
return a & e ^ a & r ^ e & r;
|
|
1182
1183
|
case 3:
|
|
1183
|
-
return
|
|
1184
|
+
return a ^ e ^ r;
|
|
1184
1185
|
}
|
|
1185
1186
|
}
|
|
1186
|
-
function
|
|
1187
|
-
return
|
|
1187
|
+
function d(l, a) {
|
|
1188
|
+
return l << a | l >>> 32 - a;
|
|
1188
1189
|
}
|
|
1189
|
-
function
|
|
1190
|
-
const
|
|
1191
|
-
if (typeof
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1194
|
-
for (let
|
|
1195
|
-
|
|
1196
|
-
} else Array.isArray(
|
|
1197
|
-
|
|
1198
|
-
const r =
|
|
1199
|
-
for (let
|
|
1200
|
-
const
|
|
1201
|
-
for (let
|
|
1202
|
-
A
|
|
1203
|
-
|
|
1190
|
+
function se(l) {
|
|
1191
|
+
const a = [1518500249, 1859775393, 2400959708, 3395469782], e = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
|
|
1192
|
+
if (typeof l == "string") {
|
|
1193
|
+
const E = unescape(encodeURIComponent(l));
|
|
1194
|
+
l = [];
|
|
1195
|
+
for (let o = 0; o < E.length; ++o)
|
|
1196
|
+
l.push(E.charCodeAt(o));
|
|
1197
|
+
} else Array.isArray(l) || (l = Array.prototype.slice.call(l));
|
|
1198
|
+
l.push(128);
|
|
1199
|
+
const r = l.length / 4 + 2, t = Math.ceil(r / 16), s = new Array(t);
|
|
1200
|
+
for (let E = 0; E < t; ++E) {
|
|
1201
|
+
const o = new Uint32Array(16);
|
|
1202
|
+
for (let A = 0; A < 16; ++A)
|
|
1203
|
+
o[A] = l[E * 64 + A * 4] << 24 | l[E * 64 + A * 4 + 1] << 16 | l[E * 64 + A * 4 + 2] << 8 | l[E * 64 + A * 4 + 3];
|
|
1204
|
+
s[E] = o;
|
|
1204
1205
|
}
|
|
1205
|
-
|
|
1206
|
-
for (let
|
|
1207
|
-
const
|
|
1208
|
-
for (let
|
|
1209
|
-
|
|
1210
|
-
for (let
|
|
1211
|
-
|
|
1212
|
-
let
|
|
1213
|
-
for (let
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1206
|
+
s[t - 1][14] = (l.length - 1) * 8 / Math.pow(2, 32), s[t - 1][14] = Math.floor(s[t - 1][14]), s[t - 1][15] = (l.length - 1) * 8 & 4294967295;
|
|
1207
|
+
for (let E = 0; E < t; ++E) {
|
|
1208
|
+
const o = new Uint32Array(80);
|
|
1209
|
+
for (let i = 0; i < 16; ++i)
|
|
1210
|
+
o[i] = s[E][i];
|
|
1211
|
+
for (let i = 16; i < 80; ++i)
|
|
1212
|
+
o[i] = d(o[i - 3] ^ o[i - 8] ^ o[i - 14] ^ o[i - 16], 1);
|
|
1213
|
+
let A = e[0], R = e[1], N = e[2], c = e[3], C = e[4];
|
|
1214
|
+
for (let i = 0; i < 80; ++i) {
|
|
1215
|
+
const p = Math.floor(i / 20), M = d(A, 5) + te(p, R, N, c) + C + a[p] + o[i] >>> 0;
|
|
1216
|
+
C = c, c = N, N = d(R, 30) >>> 0, R = A, A = M;
|
|
1216
1217
|
}
|
|
1217
|
-
e[0] = e[0] +
|
|
1218
|
+
e[0] = e[0] + A >>> 0, e[1] = e[1] + R >>> 0, e[2] = e[2] + N >>> 0, e[3] = e[3] + c >>> 0, e[4] = e[4] + C >>> 0;
|
|
1218
1219
|
}
|
|
1219
1220
|
return [e[0] >> 24 & 255, e[0] >> 16 & 255, e[0] >> 8 & 255, e[0] & 255, e[1] >> 24 & 255, e[1] >> 16 & 255, e[1] >> 8 & 255, e[1] & 255, e[2] >> 24 & 255, e[2] >> 16 & 255, e[2] >> 8 & 255, e[2] & 255, e[3] >> 24 & 255, e[3] >> 16 & 255, e[3] >> 8 & 255, e[3] & 255, e[4] >> 24 & 255, e[4] >> 16 & 255, e[4] >> 8 & 255, e[4] & 255];
|
|
1220
1221
|
}
|
|
1221
|
-
const
|
|
1222
|
-
class
|
|
1223
|
-
constructor(e, r = "POST",
|
|
1222
|
+
const B = re("v5", 80, se);
|
|
1223
|
+
class Se extends _ {
|
|
1224
|
+
constructor(e, r = "POST", t = {}) {
|
|
1224
1225
|
super();
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1226
|
+
n(this, "apiUrl");
|
|
1227
|
+
n(this, "method");
|
|
1228
|
+
n(this, "headers");
|
|
1229
|
+
n(this, "isLoadingEnabled", !0);
|
|
1230
|
+
n(this, "errorResponse");
|
|
1230
1231
|
this.apiUrl = e, this.method = r, this.headers = {
|
|
1231
1232
|
"Content-Type": "application/json",
|
|
1232
|
-
...
|
|
1233
|
+
...t
|
|
1233
1234
|
};
|
|
1234
1235
|
}
|
|
1235
1236
|
setIsLoadingEnabled(e) {
|
|
@@ -1239,37 +1240,37 @@ class Le extends M {
|
|
|
1239
1240
|
this.errorResponse = e;
|
|
1240
1241
|
}
|
|
1241
1242
|
fetchData(e = {}) {
|
|
1242
|
-
const r = (/* @__PURE__ */ new Date()).toISOString(),
|
|
1243
|
+
const r = (/* @__PURE__ */ new Date()).toISOString(), t = B(r, B.URL), s = this.encode({ ...e }, t);
|
|
1243
1244
|
S.getInstance().setSubject(this.isLoadingEnabled);
|
|
1244
|
-
const
|
|
1245
|
-
return
|
|
1245
|
+
const o = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
|
|
1246
|
+
return I(this.apiUrl, {
|
|
1246
1247
|
method: this.method,
|
|
1247
|
-
headers: { ...this.headers, flow:
|
|
1248
|
-
body:
|
|
1249
|
-
selector: (
|
|
1248
|
+
headers: { ...this.headers, flow: o },
|
|
1249
|
+
body: s,
|
|
1250
|
+
selector: (A) => A.json()
|
|
1250
1251
|
}).pipe(
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${
|
|
1254
|
-
), S.getInstance().setSubject(!1),
|
|
1255
|
-
|
|
1256
|
-
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${
|
|
1257
|
-
), O(
|
|
1258
|
-
|
|
1259
|
-
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${
|
|
1260
|
-
), S.getInstance().setSubject(!1),
|
|
1261
|
-
new
|
|
1262
|
-
), this.errorResponse ? O(this.errorResponse) :
|
|
1252
|
+
T((A) => O(this.decode(A))),
|
|
1253
|
+
T((A) => A.code && (A.type === "modal" || A.type === "message") ? (this.logError(
|
|
1254
|
+
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(A)}`
|
|
1255
|
+
), S.getInstance().setSubject(!1), u.getInstance().setSubject(A), this.errorResponse ? O(this.errorResponse) : P) : O(A)),
|
|
1256
|
+
T((A) => (S.getInstance().setSubject(!1), this.logDebug(
|
|
1257
|
+
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(A)}`
|
|
1258
|
+
), O(A))),
|
|
1259
|
+
g((A) => (this.logError(
|
|
1260
|
+
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(A)}`
|
|
1261
|
+
), S.getInstance().setSubject(!1), u.getInstance().setSubject(
|
|
1262
|
+
new m().get(A, t)
|
|
1263
|
+
), this.errorResponse ? O(this.errorResponse) : P))
|
|
1263
1264
|
);
|
|
1264
1265
|
}
|
|
1265
1266
|
}
|
|
1266
|
-
const
|
|
1267
|
-
class
|
|
1268
|
-
constructor(e, r,
|
|
1269
|
-
super(
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1267
|
+
const Ee = process.env.ID_FRONT ?? "NOT_AVAILABLE";
|
|
1268
|
+
class Ue extends F {
|
|
1269
|
+
constructor(e, r, t = {}) {
|
|
1270
|
+
super(t);
|
|
1271
|
+
n(this, "apiUrl");
|
|
1272
|
+
n(this, "method");
|
|
1273
|
+
n(this, "errorCatalog", new m());
|
|
1273
1274
|
this.apiUrl = e, this.method = r ?? "POST";
|
|
1274
1275
|
}
|
|
1275
1276
|
errorHandler(e, r) {
|
|
@@ -1280,86 +1281,278 @@ class ne extends y {
|
|
|
1280
1281
|
formatParams(e) {
|
|
1281
1282
|
return JSON.stringify({
|
|
1282
1283
|
data: {
|
|
1283
|
-
type:
|
|
1284
|
+
type: Ee,
|
|
1284
1285
|
attributes: e
|
|
1285
1286
|
}
|
|
1286
1287
|
});
|
|
1287
1288
|
}
|
|
1288
1289
|
fetchData(e = {}, r) {
|
|
1289
|
-
const { resources:
|
|
1290
|
-
return this.errorCatalog.setErrors(
|
|
1291
|
-
|
|
1292
|
-
(
|
|
1290
|
+
const { resources: t, errors: s } = this.onInit();
|
|
1291
|
+
return this.errorCatalog.setErrors(s), this.errorCatalog.setI18nResources(t), this.getHeaders().pipe(
|
|
1292
|
+
T(
|
|
1293
|
+
(E) => I(
|
|
1293
1294
|
this.apiUrl,
|
|
1294
1295
|
{
|
|
1295
1296
|
method: "POST",
|
|
1296
|
-
headers:
|
|
1297
|
+
headers: E,
|
|
1297
1298
|
body: this.formatParams(e),
|
|
1298
|
-
selector: (
|
|
1299
|
+
selector: (o) => o.json()
|
|
1299
1300
|
}
|
|
1300
1301
|
).pipe(
|
|
1301
|
-
|
|
1302
|
-
throw this.logError(JSON.stringify(
|
|
1302
|
+
g((o) => {
|
|
1303
|
+
throw this.logError(JSON.stringify(o)), this.logError(
|
|
1303
1304
|
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1304
|
-
|
|
1305
|
+
E
|
|
1305
1306
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1306
1307
|
this.formatParams(e)
|
|
1307
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
1308
|
-
), new
|
|
1308
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
|
|
1309
|
+
), new m().get("default", r);
|
|
1309
1310
|
}),
|
|
1310
|
-
|
|
1311
|
+
T((o) => (this.logDebug(
|
|
1311
1312
|
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1312
|
-
|
|
1313
|
+
E
|
|
1313
1314
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1314
1315
|
this.formatParams(e)
|
|
1315
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
1316
|
-
), O(
|
|
1316
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
|
|
1317
|
+
), O(o)))
|
|
1317
1318
|
)
|
|
1318
1319
|
),
|
|
1319
|
-
|
|
1320
|
+
v((E) => this.errorHandler(E, r))
|
|
1320
1321
|
);
|
|
1321
1322
|
}
|
|
1322
|
-
fetchCustomData(e = {}, r,
|
|
1323
|
-
const { resources:
|
|
1324
|
-
this.errorCatalog.setErrors(
|
|
1325
|
-
const
|
|
1323
|
+
fetchCustomData(e = {}, r, t) {
|
|
1324
|
+
const { resources: s, errors: E } = this.onInit();
|
|
1325
|
+
this.errorCatalog.setErrors(E), this.errorCatalog.setI18nResources(s);
|
|
1326
|
+
const o = {
|
|
1326
1327
|
"Content-Type": "application/json"
|
|
1327
|
-
},
|
|
1328
|
+
}, A = x.stringify(
|
|
1328
1329
|
e
|
|
1329
|
-
), R = `${this.apiUrl}?${
|
|
1330
|
-
return this.getHeaders(
|
|
1331
|
-
|
|
1332
|
-
(
|
|
1330
|
+
), R = `${this.apiUrl}?${A}`, N = this.method === "GET" ? R : this.apiUrl;
|
|
1331
|
+
return this.getHeaders(o, t).pipe(
|
|
1332
|
+
T(
|
|
1333
|
+
(c) => I(N, {
|
|
1333
1334
|
method: this.method,
|
|
1334
|
-
headers:
|
|
1335
|
+
headers: c,
|
|
1335
1336
|
body: this.method === "GET" ? null : JSON.stringify(e),
|
|
1336
|
-
selector: (
|
|
1337
|
+
selector: (C) => C.json()
|
|
1337
1338
|
}).pipe(
|
|
1338
|
-
|
|
1339
|
-
throw this.logError(JSON.stringify(
|
|
1340
|
-
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${
|
|
1341
|
-
|
|
1339
|
+
g((C) => {
|
|
1340
|
+
throw this.logError(JSON.stringify(C)), this.logError(
|
|
1341
|
+
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${N} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1342
|
+
c
|
|
1342
1343
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1343
1344
|
this.formatParams(e)
|
|
1344
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
1345
|
-
), new
|
|
1345
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(C)} \x1B[33m`
|
|
1346
|
+
), new m().get("default", r);
|
|
1346
1347
|
}),
|
|
1347
|
-
|
|
1348
|
-
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${
|
|
1349
|
-
|
|
1348
|
+
T((C) => (this.logDebug(
|
|
1349
|
+
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${N} \x1B[37m \x1B[37m <METHOD>: \x1B[33m ${this.method} <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1350
|
+
c
|
|
1350
1351
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1351
1352
|
e
|
|
1352
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
1353
|
-
), O(
|
|
1353
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(C)} \x1B[33m`
|
|
1354
|
+
), O(C)))
|
|
1355
|
+
)
|
|
1356
|
+
)
|
|
1357
|
+
);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
class le extends w {
|
|
1361
|
+
getHeaders() {
|
|
1362
|
+
const a = {
|
|
1363
|
+
client_id: process.env.AZURE_AD_CLIENT_ID,
|
|
1364
|
+
client_secret: process.env.AZURE_AD_CLIENT_SECRET,
|
|
1365
|
+
resource: process.env.AZURE_AD_CLIENT_RESOURCE,
|
|
1366
|
+
grant_type: process.env.AZURE_AD_CLIENT_GRANT_TYPE
|
|
1367
|
+
}, e = process.env.AZURE_AD_GRAPH_URL_TOKEN.replace(
|
|
1368
|
+
"AZURE_AD_TENANT_ID",
|
|
1369
|
+
process.env.AZURE_AD_TENANT_ID
|
|
1370
|
+
);
|
|
1371
|
+
return I(e, {
|
|
1372
|
+
method: "POST",
|
|
1373
|
+
headers: {
|
|
1374
|
+
Accept: "application/json",
|
|
1375
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
1376
|
+
},
|
|
1377
|
+
body: new URLSearchParams(a),
|
|
1378
|
+
selector: (r) => r.json()
|
|
1379
|
+
}).pipe(
|
|
1380
|
+
T((r) => O({
|
|
1381
|
+
headers: {
|
|
1382
|
+
Authorization: `Bearer ${r == null ? void 0 : r.access_token}`,
|
|
1383
|
+
responseType: "json"
|
|
1384
|
+
}
|
|
1385
|
+
}))
|
|
1386
|
+
);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
const L = "ROLES", U = "GROUPS";
|
|
1390
|
+
class de extends le {
|
|
1391
|
+
constructor() {
|
|
1392
|
+
super(...arguments);
|
|
1393
|
+
n(this, "redisCacheHandler", new $());
|
|
1394
|
+
n(this, "getIdApi", (e, r) => {
|
|
1395
|
+
const t = B(e, process.env.NAMESPACE_CACHE);
|
|
1396
|
+
return `${process.env.ID_FRONT}:${r}:${t}`;
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
getAppRoles(e) {
|
|
1400
|
+
const r = process.env.AZURE_AD_GRAPH_GET_APP_ROLES.replace(
|
|
1401
|
+
"{id-obj}",
|
|
1402
|
+
`${e}`
|
|
1403
|
+
);
|
|
1404
|
+
return this.getHeaders().pipe(
|
|
1405
|
+
T(
|
|
1406
|
+
(t) => I(r, {
|
|
1407
|
+
method: "GET",
|
|
1408
|
+
headers: t == null ? void 0 : t.headers,
|
|
1409
|
+
selector: (s) => s.json()
|
|
1410
|
+
}).pipe(
|
|
1411
|
+
T((s) => (this.redisCacheHandler.setRedisState({
|
|
1412
|
+
idApi: this.getIdApi(e, L),
|
|
1413
|
+
idData: L,
|
|
1414
|
+
body: { roles: s == null ? void 0 : s.value },
|
|
1415
|
+
expire: process.env.TIMEOUT_SESSION_MINUTES,
|
|
1416
|
+
encrypted: process.env.NODE_ENV === "production"
|
|
1417
|
+
}), O({ roles: s == null ? void 0 : s.value })))
|
|
1354
1418
|
)
|
|
1355
1419
|
)
|
|
1356
1420
|
);
|
|
1357
1421
|
}
|
|
1422
|
+
getAppRoleAssignments(e) {
|
|
1423
|
+
const t = `${process.env.AZURE_AD_GRAPH_GET_USER_BY_EMAIL.replace(
|
|
1424
|
+
"{user-mail}",
|
|
1425
|
+
`${e}/appRoleAssignments`
|
|
1426
|
+
)}?$select=appRoleId,resourceDisplayName`;
|
|
1427
|
+
return this.getHeaders().pipe(
|
|
1428
|
+
T(
|
|
1429
|
+
(s) => I(t, {
|
|
1430
|
+
method: "GET",
|
|
1431
|
+
headers: s == null ? void 0 : s.headers,
|
|
1432
|
+
selector: (E) => E.json()
|
|
1433
|
+
})
|
|
1434
|
+
)
|
|
1435
|
+
);
|
|
1436
|
+
}
|
|
1437
|
+
userRolesByApp(e, r) {
|
|
1438
|
+
return D({
|
|
1439
|
+
appRoles: this.getAppRoles(r),
|
|
1440
|
+
appRoleAssignments: this.getAppRoleAssignments(e)
|
|
1441
|
+
}).pipe(
|
|
1442
|
+
T(({ appRoles: t, appRoleAssignments: s }) => {
|
|
1443
|
+
var A;
|
|
1444
|
+
const E = (A = s == null ? void 0 : s.value) == null ? void 0 : A.map(
|
|
1445
|
+
(R) => {
|
|
1446
|
+
var N, c, C;
|
|
1447
|
+
return (C = (c = (N = t == null ? void 0 : t.roles) == null ? void 0 : N.filter((i) => (i == null ? void 0 : i.id) === (R == null ? void 0 : R.appRoleId))) == null ? void 0 : c.filter((i) => i == null ? void 0 : i.isEnabled)) == null ? void 0 : C.map((i) => ({
|
|
1448
|
+
appRoleId: R == null ? void 0 : R.appRoleId,
|
|
1449
|
+
displayName: i == null ? void 0 : i.displayName,
|
|
1450
|
+
value: i == null ? void 0 : i.value
|
|
1451
|
+
}));
|
|
1452
|
+
}
|
|
1453
|
+
).flat(), o = E == null ? void 0 : E.map((R) => R == null ? void 0 : R.appRoleId);
|
|
1454
|
+
return O({ roles: o });
|
|
1455
|
+
})
|
|
1456
|
+
);
|
|
1457
|
+
}
|
|
1458
|
+
getRolesFromApi(e, r) {
|
|
1459
|
+
return this.userRolesByApp(e, r).pipe(
|
|
1460
|
+
T((t) => (this.redisCacheHandler.setRedisState({
|
|
1461
|
+
idApi: this.getIdApi(e, L),
|
|
1462
|
+
idData: L,
|
|
1463
|
+
body: t,
|
|
1464
|
+
expire: process.env.TIMEOUT_SESSION_MINUTES,
|
|
1465
|
+
encrypted: process.env.NODE_ENV === "production"
|
|
1466
|
+
}), O(t)))
|
|
1467
|
+
);
|
|
1468
|
+
}
|
|
1469
|
+
handleCacheRolesService(e, r, t) {
|
|
1470
|
+
return e.data ? (this.logInfo("Response From Redis", JSON.stringify(e)), O(e == null ? void 0 : e.data)) : (this.logInfo("Redis Data not found, get data from API to save on Redis"), this.logError("No data found in Redis, request to roles api"), this.getRolesFromApi(r, t));
|
|
1471
|
+
}
|
|
1472
|
+
getRoles(e, r) {
|
|
1473
|
+
return h(
|
|
1474
|
+
this.redisCacheHandler.getRedisState(
|
|
1475
|
+
this.getIdApi(e, L),
|
|
1476
|
+
L
|
|
1477
|
+
)
|
|
1478
|
+
).pipe(
|
|
1479
|
+
T(
|
|
1480
|
+
(t) => this.handleCacheRolesService(t, e, r)
|
|
1481
|
+
),
|
|
1482
|
+
g((t) => (this.logError("No cache found", t == null ? void 0 : t.message), this.getRolesFromApi(e, r)))
|
|
1483
|
+
);
|
|
1484
|
+
}
|
|
1485
|
+
getGroupsFromApi(e) {
|
|
1486
|
+
return this.getHeaders().pipe(
|
|
1487
|
+
T(
|
|
1488
|
+
(r) => I(
|
|
1489
|
+
`${process.env.AZURE_AD_GRAPH_GROUPS.replace("idUser", e)}?$select=id,description,displayName`,
|
|
1490
|
+
{
|
|
1491
|
+
method: "GET",
|
|
1492
|
+
headers: r == null ? void 0 : r.headers,
|
|
1493
|
+
selector: (t) => t.json()
|
|
1494
|
+
}
|
|
1495
|
+
).pipe(
|
|
1496
|
+
T((t) => (this.redisCacheHandler.setRedisState({
|
|
1497
|
+
idApi: this.getIdApi(e, U),
|
|
1498
|
+
idData: U,
|
|
1499
|
+
body: t,
|
|
1500
|
+
expire: process.env.TIMEOUT_SESSION_MINUTES,
|
|
1501
|
+
encrypted: process.env.NODE_ENV === "production"
|
|
1502
|
+
}), O(t)))
|
|
1503
|
+
)
|
|
1504
|
+
)
|
|
1505
|
+
);
|
|
1506
|
+
}
|
|
1507
|
+
handleCacheGroupsService(e, r) {
|
|
1508
|
+
return e.data ? (this.logInfo("Response From Redis", JSON.stringify(e)), O(e == null ? void 0 : e.data)) : (this.logInfo("Redis Data not found, get data from API to save on Redis"), this.getGroupsFromApi(r));
|
|
1509
|
+
}
|
|
1510
|
+
getUserGroups(e) {
|
|
1511
|
+
return h(
|
|
1512
|
+
this.redisCacheHandler.getRedisState(
|
|
1513
|
+
this.getIdApi(e, U),
|
|
1514
|
+
U
|
|
1515
|
+
)
|
|
1516
|
+
).pipe(
|
|
1517
|
+
T((r) => this.handleCacheGroupsService(r, e)),
|
|
1518
|
+
g((r) => (this.logError("No cache found", r == null ? void 0 : r.message), this.getGroupsFromApi(e)))
|
|
1519
|
+
);
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
*
|
|
1523
|
+
* @param email correo del usuario
|
|
1524
|
+
* @param idGroup id del grupo de EntraID
|
|
1525
|
+
* @returns `true` si el usuario pertenece al grupo
|
|
1526
|
+
*/
|
|
1527
|
+
inGroup(e, r) {
|
|
1528
|
+
return this.getUserGroups(e).pipe(
|
|
1529
|
+
T((t) => {
|
|
1530
|
+
var s;
|
|
1531
|
+
return O((s = t == null ? void 0 : t.value) == null ? void 0 : s.some((E) => (E == null ? void 0 : E.id) === r));
|
|
1532
|
+
})
|
|
1533
|
+
);
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
*
|
|
1537
|
+
* @param email correo del usuario
|
|
1538
|
+
* @param idRole id del rol del aplicativo de EntraID
|
|
1539
|
+
* @param idObjApp id del objeto de la aplicacion `Identificador de objeto` en EntraID
|
|
1540
|
+
* @returns `true` si el usuario tiene asignado el rol
|
|
1541
|
+
*/
|
|
1542
|
+
inRole(e, r, t) {
|
|
1543
|
+
return this.getRoles(e, t).pipe(
|
|
1544
|
+
T((s) => {
|
|
1545
|
+
var E;
|
|
1546
|
+
return O((E = s == null ? void 0 : s.roles) == null ? void 0 : E.includes(r));
|
|
1547
|
+
})
|
|
1548
|
+
);
|
|
1549
|
+
}
|
|
1358
1550
|
}
|
|
1359
1551
|
export {
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1552
|
+
ge as A,
|
|
1553
|
+
m as E,
|
|
1554
|
+
Le as F,
|
|
1555
|
+
Se as a,
|
|
1556
|
+
Ue as b,
|
|
1557
|
+
de as c
|
|
1365
1558
|
};
|