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