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