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