mp-front-cli 2.3.2 → 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-DF2swG3Z.cjs → AuthEngine-CDNhQfnX.cjs} +1 -1
- package/dist/{AuthEngine-EDmxrdis.js → AuthEngine-T4Nti8Ya.js} +219 -228
- package/dist/core/utils/custom-encrypter.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 +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-encrypter.cjs +1 -1
- package/dist/mp-front-cli-encrypter.js +25 -30
- package/dist/stringify-BbkhfUoJ.js +9 -0
- package/dist/{stringify-BN6t_WDt.cjs → stringify-Ixz5_KTs.cjs} +1 -1
- package/package.json +5 -6
- 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 o,
|
|
956
|
+
var o, l;
|
|
957
957
|
const { errorCatalog: s } = this;
|
|
958
958
|
if (e instanceof Error)
|
|
959
959
|
return this.logError(e.message), {
|
|
@@ -962,17 +962,17 @@ class d extends f {
|
|
|
962
962
|
message: this.translate(s.internalError.message),
|
|
963
963
|
uuid: r
|
|
964
964
|
};
|
|
965
|
-
const
|
|
966
|
-
this.logDebug("statusCode",
|
|
965
|
+
const A = typeof e == "string" ? e : e.code ?? e.errorType;
|
|
966
|
+
this.logDebug("statusCode", A);
|
|
967
967
|
const a = typeof e == "string" ? {} : { ...e };
|
|
968
968
|
return {
|
|
969
|
-
...s[
|
|
969
|
+
...s[A] ?? s.default,
|
|
970
970
|
title: this.translate(
|
|
971
|
-
((o = s[
|
|
971
|
+
((o = s[A]) == null ? void 0 : o.title) ?? s.default.title,
|
|
972
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 } : {},
|
|
@@ -991,8 +991,8 @@ class d extends f {
|
|
|
991
991
|
}
|
|
992
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
998
|
return g.instance || (g.instance = new g()), g.instance;
|
|
@@ -1001,7 +1001,7 @@ const g = class g {
|
|
|
1001
1001
|
this.exceptions = { ...this.exceptions, ...t }, g.i18n = D(e);
|
|
1002
1002
|
}
|
|
1003
1003
|
get(t, e = "NOT_FOUND") {
|
|
1004
|
-
var
|
|
1004
|
+
var A, a;
|
|
1005
1005
|
if (g.i18n || (g.i18n = D()), t instanceof Error) {
|
|
1006
1006
|
this.customLogger.logError(t.message);
|
|
1007
1007
|
const o = this.exceptions.internalError;
|
|
@@ -1018,7 +1018,7 @@ const g = class g {
|
|
|
1018
1018
|
return {
|
|
1019
1019
|
...this.exceptions[r] ?? this.exceptions.default,
|
|
1020
1020
|
title: this.translate(
|
|
1021
|
-
((
|
|
1021
|
+
((A = this.exceptions[r]) == null ? void 0 : A.title) ?? this.exceptions.default.title,
|
|
1022
1022
|
s
|
|
1023
1023
|
),
|
|
1024
1024
|
message: this.translate(
|
|
@@ -1035,8 +1035,8 @@ const g = class g {
|
|
|
1035
1035
|
};
|
|
1036
1036
|
O(g, "instance"), O(g, "i18n");
|
|
1037
1037
|
let I = g;
|
|
1038
|
-
const
|
|
1039
|
-
class
|
|
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", "");
|
|
@@ -1050,37 +1050,37 @@ class De extends b {
|
|
|
1050
1050
|
return this.session;
|
|
1051
1051
|
}
|
|
1052
1052
|
returnData(e, r, s) {
|
|
1053
|
-
const
|
|
1054
|
-
e.status(200).json(
|
|
1053
|
+
const A = this.encode(r, s);
|
|
1054
|
+
e.status(200).json(A);
|
|
1055
1055
|
}
|
|
1056
1056
|
returnError(e, r) {
|
|
1057
1057
|
return r != null && r.uuid ? e.status(520).json(r) : e.status(520).json(I.getInstance().get(r, this.uuid));
|
|
1058
1058
|
}
|
|
1059
1059
|
get(e) {
|
|
1060
1060
|
return this.logDebug("get ApiMiddleware"), (r, s) => {
|
|
1061
|
-
var
|
|
1062
|
-
this.logDebug("return ApiMiddleware"), this.uuid = (
|
|
1063
|
-
|
|
1064
|
-
(a) =>
|
|
1065
|
-
params:
|
|
1066
|
-
headers:
|
|
1061
|
+
var A;
|
|
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: a, headers: o }) =>
|
|
1069
|
+
T(
|
|
1070
|
+
({ params: a, headers: o }) => u({
|
|
1071
1071
|
response: e(a, this.uuid, o),
|
|
1072
|
-
headers:
|
|
1073
|
-
params:
|
|
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(
|
|
1078
|
-
),
|
|
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
1079
|
U((a) => {
|
|
1080
1080
|
var o;
|
|
1081
1081
|
return this.logError(
|
|
1082
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),
|
|
1083
|
+
), this.returnError(s, a), f;
|
|
1084
1084
|
})
|
|
1085
1085
|
).subscribe({
|
|
1086
1086
|
next: (a) => {
|
|
@@ -1090,8 +1090,8 @@ class De extends b {
|
|
|
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,117 +1106,110 @@ 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",
|
|
1121
1121
|
headers: s,
|
|
1122
1122
|
body: this.formatParams(e),
|
|
1123
|
-
selector: (
|
|
1123
|
+
selector: (A) => A.json()
|
|
1124
1124
|
}
|
|
1125
1125
|
).pipe(
|
|
1126
|
-
U((
|
|
1127
|
-
throw this.logError(JSON.stringify(
|
|
1126
|
+
U((A) => {
|
|
1127
|
+
throw this.logError(JSON.stringify(A)), this.logError(
|
|
1128
1128
|
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1129
1129
|
s
|
|
1130
1130
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1131
1131
|
this.formatParams(e)
|
|
1132
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
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
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
1141
|
-
),
|
|
1140
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(A)} \x1B[33m`
|
|
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
|
-
const
|
|
1148
|
+
const A = {
|
|
1149
1149
|
"Content-Type": "application/json"
|
|
1150
|
-
}, a =
|
|
1150
|
+
}, a = H.stringify(
|
|
1151
1151
|
e
|
|
1152
|
-
), o = `${this.apiUrl}?${a}`,
|
|
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(
|
|
1163
|
-
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${
|
|
1161
|
+
U((N) => {
|
|
1162
|
+
throw this.logError(JSON.stringify(N)), this.logError(
|
|
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
|
-
|
|
1171
|
-
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${
|
|
1170
|
+
T((N) => (this.logDebug(
|
|
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);
|
|
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;
|
|
1214
1211
|
}
|
|
1215
|
-
|
|
1216
|
-
r.name = E;
|
|
1217
|
-
} catch {
|
|
1218
|
-
}
|
|
1219
|
-
return r.DNS = Ee, r.URL = le, r;
|
|
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), l = new Array(s);
|
|
1246
|
-
for (let a = 0; a < s; ++a) {
|
|
1247
|
-
const o = new Uint32Array(16);
|
|
1248
|
-
for (let A = 0; A < 16; ++A)
|
|
1249
|
-
o[A] = E[a * 64 + A * 4] << 24 | E[a * 64 + A * 4 + 1] << 16 | E[a * 64 + A * 4 + 2] << 8 | E[a * 64 + A * 4 + 3];
|
|
1250
|
-
l[a] = o;
|
|
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
|
-
|
|
1253
|
-
for (let
|
|
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]);
|
|
1254
|
+
}
|
|
1255
|
+
function d(E, t, e, r) {
|
|
1256
|
+
return oe(80, ie, E, t, e, r);
|
|
1267
1257
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
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
1282
|
const o = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
|
|
1292
|
-
return
|
|
1283
|
+
return c(this.apiUrl, {
|
|
1293
1284
|
method: this.method,
|
|
1294
1285
|
headers: { ...this.headers, flow: o },
|
|
1295
|
-
body:
|
|
1296
|
-
selector: (
|
|
1286
|
+
body: A,
|
|
1287
|
+
selector: (l) => l.json()
|
|
1297
1288
|
}).pipe(
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${
|
|
1301
|
-
), S.getInstance().setSubject(!1),
|
|
1302
|
-
|
|
1303
|
-
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${
|
|
1304
|
-
),
|
|
1305
|
-
U((
|
|
1306
|
-
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${
|
|
1307
|
-
), S.getInstance().setSubject(!1),
|
|
1308
|
-
I.getInstance().get(
|
|
1309
|
-
), this.errorResponse ?
|
|
1289
|
+
T((l) => n(this.decode(l))),
|
|
1290
|
+
T((l) => l.code && (l.type === "modal" || l.type === "message") ? (this.logError(
|
|
1291
|
+
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${A} <RESPONSE>: ${JSON.stringify(l)}`
|
|
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(
|
|
1294
|
+
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${A} <RESPONSE>: ${JSON.stringify(l)}`
|
|
1295
|
+
), n(l))),
|
|
1296
|
+
U((l) => (this.logError(
|
|
1297
|
+
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${A} <RESPONSE>: ${JSON.stringify(l)}`
|
|
1298
|
+
), S.getInstance().setSubject(!1), v.getInstance().setSubject(
|
|
1299
|
+
I.getInstance().get(l, s)
|
|
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,16 +1318,16 @@ 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
1326
|
fetchData(e = {}, r) {
|
|
1336
|
-
const { resources: s, errors:
|
|
1337
|
-
return this.errorCatalog.setErrors(
|
|
1338
|
-
|
|
1339
|
-
(a) =>
|
|
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(
|
|
1340
1331
|
this.apiUrl,
|
|
1341
1332
|
{
|
|
1342
1333
|
method: "POST",
|
|
@@ -1352,31 +1343,31 @@ class Be extends V {
|
|
|
1352
1343
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1353
1344
|
this.formatParams(e)
|
|
1354
1345
|
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
|
|
1355
|
-
), new
|
|
1346
|
+
), new B().get("default", r);
|
|
1356
1347
|
}),
|
|
1357
|
-
|
|
1348
|
+
T((o) => (this.logDebug(
|
|
1358
1349
|
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1359
1350
|
a
|
|
1360
1351
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1361
1352
|
this.formatParams(e)
|
|
1362
1353
|
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
|
|
1363
|
-
),
|
|
1354
|
+
), n(o)))
|
|
1364
1355
|
)
|
|
1365
1356
|
),
|
|
1366
|
-
|
|
1357
|
+
J((a) => this.errorHandler(a, r))
|
|
1367
1358
|
);
|
|
1368
1359
|
}
|
|
1369
1360
|
fetchCustomData(e = {}, r, s) {
|
|
1370
|
-
const { resources:
|
|
1371
|
-
this.errorCatalog.setErrors(a), this.errorCatalog.setI18nResources(
|
|
1361
|
+
const { resources: A, errors: a } = this.onInit();
|
|
1362
|
+
this.errorCatalog.setErrors(a), this.errorCatalog.setI18nResources(A);
|
|
1372
1363
|
const o = {
|
|
1373
1364
|
"Content-Type": "application/json"
|
|
1374
|
-
},
|
|
1365
|
+
}, l = H.stringify(
|
|
1375
1366
|
e
|
|
1376
|
-
), R = `${this.apiUrl}?${
|
|
1367
|
+
), R = `${this.apiUrl}?${l}`, N = this.method === "GET" ? R : this.apiUrl;
|
|
1377
1368
|
return this.getHeaders(o, s).pipe(
|
|
1378
|
-
|
|
1379
|
-
(m) =>
|
|
1369
|
+
T(
|
|
1370
|
+
(m) => c(N, {
|
|
1380
1371
|
method: this.method,
|
|
1381
1372
|
headers: m,
|
|
1382
1373
|
body: this.method === "GET" ? null : JSON.stringify(e),
|
|
@@ -1384,35 +1375,35 @@ class Be extends V {
|
|
|
1384
1375
|
}).pipe(
|
|
1385
1376
|
U((i) => {
|
|
1386
1377
|
throw this.logError(JSON.stringify(i)), this.logError(
|
|
1387
|
-
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${
|
|
1378
|
+
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${N} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
1388
1379
|
m
|
|
1389
1380
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1390
1381
|
this.formatParams(e)
|
|
1391
1382
|
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(i)} \x1B[33m`
|
|
1392
|
-
), new
|
|
1383
|
+
), new B().get("default", r);
|
|
1393
1384
|
}),
|
|
1394
|
-
|
|
1395
|
-
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${
|
|
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(
|
|
1396
1387
|
m
|
|
1397
1388
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
1398
1389
|
e
|
|
1399
1390
|
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(i)} \x1B[33m`
|
|
1400
|
-
),
|
|
1391
|
+
), n(i)))
|
|
1401
1392
|
)
|
|
1402
1393
|
)
|
|
1403
1394
|
);
|
|
1404
1395
|
}
|
|
1405
1396
|
}
|
|
1406
|
-
const
|
|
1397
|
+
const h = {
|
|
1407
1398
|
client_id: process.env.AZURE_AD_CLIENT_ID,
|
|
1408
1399
|
client_secret: process.env.AZURE_AD_CLIENT_SECRET,
|
|
1409
1400
|
resource: process.env.AZURE_AD_CLIENT_RESOURCE,
|
|
1410
1401
|
grant_type: process.env.AZURE_AD_CLIENT_GRANT_TYPE
|
|
1411
|
-
},
|
|
1412
|
-
class
|
|
1402
|
+
}, M = process.env.AZURE_AD_GRAPH_URL_TOKEN, _ = process.env.AZURE_AD_TENANT_ID;
|
|
1403
|
+
class Te extends y {
|
|
1413
1404
|
getHeaders() {
|
|
1414
|
-
const t = Object.keys(
|
|
1415
|
-
if (
|
|
1405
|
+
const t = Object.keys(h).some((r) => L(h[r]));
|
|
1406
|
+
if (L(M) || L(_))
|
|
1416
1407
|
throw this.logError(
|
|
1417
1408
|
"AZURE_AD_GRAPH_URL_TOKEN or AZURE_AD_TENANT_ID are empty or missing"
|
|
1418
1409
|
), new Error(
|
|
@@ -1422,23 +1413,23 @@ class Re extends f {
|
|
|
1422
1413
|
throw this.logError(
|
|
1423
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"
|
|
1424
1415
|
), new Error("some variables are empty or missing");
|
|
1425
|
-
const e =
|
|
1416
|
+
const e = M.replace(
|
|
1426
1417
|
"AZURE_AD_TENANT_ID",
|
|
1427
|
-
|
|
1418
|
+
_
|
|
1428
1419
|
);
|
|
1429
|
-
return
|
|
1420
|
+
return c(e, {
|
|
1430
1421
|
method: "POST",
|
|
1431
1422
|
headers: {
|
|
1432
1423
|
Accept: "application/json",
|
|
1433
1424
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
1434
1425
|
},
|
|
1435
|
-
body: new URLSearchParams(
|
|
1426
|
+
body: new URLSearchParams(h),
|
|
1436
1427
|
selector: (r) => r.json()
|
|
1437
1428
|
}).pipe(
|
|
1438
|
-
|
|
1429
|
+
T((r) => (this.logDebug(
|
|
1439
1430
|
"response from API new_url_365_graph_token",
|
|
1440
1431
|
JSON.stringify(r)
|
|
1441
|
-
),
|
|
1432
|
+
), n({
|
|
1442
1433
|
headers: {
|
|
1443
1434
|
Authorization: `Bearer ${r == null ? void 0 : r.access_token}`,
|
|
1444
1435
|
responseType: "json"
|
|
@@ -1447,85 +1438,85 @@ class Re extends f {
|
|
|
1447
1438
|
);
|
|
1448
1439
|
}
|
|
1449
1440
|
}
|
|
1450
|
-
const
|
|
1451
|
-
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 {
|
|
1452
1443
|
getAppRoles(t) {
|
|
1453
|
-
if (
|
|
1444
|
+
if (L(Q))
|
|
1454
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");
|
|
1455
|
-
const e =
|
|
1446
|
+
const e = Q.replace(
|
|
1456
1447
|
"{id-obj}",
|
|
1457
1448
|
`${t}`
|
|
1458
1449
|
);
|
|
1459
1450
|
return this.getHeaders().pipe(
|
|
1460
|
-
|
|
1461
|
-
(r) =>
|
|
1451
|
+
T(
|
|
1452
|
+
(r) => c(e, {
|
|
1462
1453
|
method: "GET",
|
|
1463
1454
|
headers: r == null ? void 0 : r.headers,
|
|
1464
1455
|
selector: (s) => s.json()
|
|
1465
|
-
}).pipe(
|
|
1456
|
+
}).pipe(T((s) => n({ roles: s == null ? void 0 : s.value })))
|
|
1466
1457
|
)
|
|
1467
1458
|
);
|
|
1468
1459
|
}
|
|
1469
1460
|
getAppRoleAssignments(t) {
|
|
1470
|
-
if (
|
|
1461
|
+
if (L(G))
|
|
1471
1462
|
throw this.logError("AZURE_AD_GRAPH_GET_USER_BY_EMAIL URL is empty or missing"), new Error(
|
|
1472
1463
|
"AZURE_AD_GRAPH_GET_USER_BY_EMAIL URL is empty or missing"
|
|
1473
1464
|
);
|
|
1474
|
-
const r = `${
|
|
1465
|
+
const r = `${G.replace(
|
|
1475
1466
|
"{user-mail}",
|
|
1476
1467
|
`${t}/appRoleAssignments`
|
|
1477
1468
|
)}?$select=appRoleId,resourceDisplayName`;
|
|
1478
1469
|
return this.getHeaders().pipe(
|
|
1479
|
-
|
|
1480
|
-
(s) =>
|
|
1470
|
+
T(
|
|
1471
|
+
(s) => c(r, {
|
|
1481
1472
|
method: "GET",
|
|
1482
1473
|
headers: s == null ? void 0 : s.headers,
|
|
1483
|
-
selector: (
|
|
1474
|
+
selector: (A) => A.json()
|
|
1484
1475
|
})
|
|
1485
1476
|
)
|
|
1486
1477
|
);
|
|
1487
1478
|
}
|
|
1488
1479
|
userRolesByApp(t, e) {
|
|
1489
|
-
return
|
|
1480
|
+
return u({
|
|
1490
1481
|
appRoles: this.getAppRoles(e),
|
|
1491
1482
|
appRoleAssignments: this.getAppRoleAssignments(t)
|
|
1492
1483
|
}).pipe(
|
|
1493
|
-
|
|
1484
|
+
T(({ appRoles: r, appRoleAssignments: s }) => {
|
|
1494
1485
|
var o;
|
|
1495
|
-
const
|
|
1496
|
-
(
|
|
1497
|
-
var R,
|
|
1498
|
-
return (m = (
|
|
1499
|
-
appRoleId:
|
|
1486
|
+
const A = (o = s == null ? void 0 : s.value) == null ? void 0 : o.map(
|
|
1487
|
+
(l) => {
|
|
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) => ({
|
|
1490
|
+
appRoleId: l == null ? void 0 : l.appRoleId,
|
|
1500
1491
|
displayName: i == null ? void 0 : i.displayName,
|
|
1501
1492
|
value: i == null ? void 0 : i.value
|
|
1502
1493
|
}));
|
|
1503
1494
|
}
|
|
1504
|
-
).flat(), a =
|
|
1505
|
-
return
|
|
1495
|
+
).flat(), a = A == null ? void 0 : A.map((l) => l == null ? void 0 : l.appRoleId);
|
|
1496
|
+
return n({ roles: a });
|
|
1506
1497
|
})
|
|
1507
1498
|
);
|
|
1508
1499
|
}
|
|
1509
1500
|
getRolesFromApi(t, e) {
|
|
1510
1501
|
return this.userRolesByApp(t, e).pipe(
|
|
1511
|
-
|
|
1502
|
+
T((r) => n(r))
|
|
1512
1503
|
);
|
|
1513
1504
|
}
|
|
1514
1505
|
getRoles(t, e) {
|
|
1515
1506
|
return this.getRolesFromApi(t, e);
|
|
1516
1507
|
}
|
|
1517
1508
|
getGroupsFromApi(t) {
|
|
1518
|
-
if (this.logDebug("getGroupsFromApi by email: ", JSON.stringify(t)),
|
|
1509
|
+
if (this.logDebug("getGroupsFromApi by email: ", JSON.stringify(t)), L(V))
|
|
1519
1510
|
throw this.logError("AZURE_AD_GRAPH_GROUPS URL is empty or missing"), new Error("AZURE_AD_GRAPH_GROUPS URL is empty or missing");
|
|
1520
|
-
const e = `${
|
|
1511
|
+
const e = `${V.replace("idUser", t)}?$select=id,description,displayName`;
|
|
1521
1512
|
return this.logDebug("URL base: ", e), this.getHeaders().pipe(
|
|
1522
|
-
|
|
1523
|
-
(r) =>
|
|
1513
|
+
T(
|
|
1514
|
+
(r) => c(e, {
|
|
1524
1515
|
method: "GET",
|
|
1525
1516
|
headers: r == null ? void 0 : r.headers,
|
|
1526
1517
|
selector: (s) => s.json()
|
|
1527
1518
|
}).pipe(
|
|
1528
|
-
|
|
1519
|
+
T((s) => (this.logDebug("response from API: ", JSON.stringify(s)), n(s)))
|
|
1529
1520
|
)
|
|
1530
1521
|
)
|
|
1531
1522
|
);
|
|
@@ -1540,10 +1531,10 @@ class pe extends Re {
|
|
|
1540
1531
|
* @returns `true` si el usuario pertenece al grupo
|
|
1541
1532
|
*/
|
|
1542
1533
|
inGroup(t, e) {
|
|
1543
|
-
return this.logDebug("Check inGroup params: ", JSON.stringify({ email: t, idGroup: e })),
|
|
1544
|
-
|
|
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) => {
|
|
1545
1536
|
var s;
|
|
1546
|
-
return
|
|
1537
|
+
return n((s = r == null ? void 0 : r.value) == null ? void 0 : s.some((A) => (A == null ? void 0 : A.id) === e));
|
|
1547
1538
|
})
|
|
1548
1539
|
);
|
|
1549
1540
|
}
|
|
@@ -1558,20 +1549,20 @@ class pe extends Re {
|
|
|
1558
1549
|
return this.logDebug(
|
|
1559
1550
|
"Check inRole params: ",
|
|
1560
1551
|
JSON.stringify({ email: t, idRole: e, idObjApp: r })
|
|
1561
|
-
),
|
|
1562
|
-
|
|
1563
|
-
var
|
|
1564
|
-
return
|
|
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) => {
|
|
1554
|
+
var A;
|
|
1555
|
+
return n((A = s == null ? void 0 : s.roles) == null ? void 0 : A.includes(e));
|
|
1565
1556
|
})
|
|
1566
1557
|
);
|
|
1567
1558
|
}
|
|
1568
1559
|
}
|
|
1569
1560
|
export {
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1561
|
+
de as A,
|
|
1562
|
+
B as E,
|
|
1563
|
+
Pe as F,
|
|
1564
|
+
he as a,
|
|
1574
1565
|
I as b,
|
|
1575
|
-
|
|
1576
|
-
|
|
1566
|
+
Be as c,
|
|
1567
|
+
pe as d
|
|
1577
1568
|
};
|