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