mp-front-cli 2.3.0 → 2.3.2-next-0

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.
Files changed (38) hide show
  1. package/dist/AuthEngine-CATazTYM.cjs +1 -0
  2. package/dist/{AuthEngine-Gl4gv5KD.js → AuthEngine-CQfKuww8.js} +175 -172
  3. package/dist/core/middleware/index.d.ts +1 -1
  4. package/dist/core/middleware/index.d.ts.map +1 -1
  5. package/dist/core/services/service-token.d.ts +2 -1
  6. package/dist/core/services/service-token.d.ts.map +1 -1
  7. package/dist/core/utils/api-request/fetch-service-parent-be.d.ts +3 -1
  8. package/dist/core/utils/api-request/fetch-service-parent-be.d.ts.map +1 -1
  9. package/dist/core/utils/custom-encoder.d.ts.map +1 -1
  10. package/dist/core/utils/custom-encrypter.d.ts +11 -4
  11. package/dist/core/utils/custom-encrypter.d.ts.map +1 -1
  12. package/dist/core/utils/custom-header.d.ts +6 -2
  13. package/dist/core/utils/custom-header.d.ts.map +1 -1
  14. package/dist/core/utils/functions/index.d.ts +3 -0
  15. package/dist/core/utils/functions/index.d.ts.map +1 -0
  16. package/dist/core/utils/functions/isEmpty.d.ts +2 -0
  17. package/dist/core/utils/functions/isEmpty.d.ts.map +1 -0
  18. package/dist/core/utils/functions/isString.d.ts +2 -0
  19. package/dist/core/utils/functions/isString.d.ts.map +1 -0
  20. package/dist/mp-front-cli-all.cjs +1 -1
  21. package/dist/mp-front-cli-all.js +2 -2
  22. package/dist/mp-front-cli-core.cjs +1 -1
  23. package/dist/mp-front-cli-core.js +2 -2
  24. package/dist/mp-front-cli-encoder.cjs +1 -1
  25. package/dist/mp-front-cli-encoder.js +29 -3
  26. package/dist/mp-front-cli-encrypter.cjs +1 -1
  27. package/dist/mp-front-cli-encrypter.js +56 -30
  28. package/dist/mp-front-cli-header.cjs +1 -1
  29. package/dist/mp-front-cli-header.js +18 -17
  30. package/dist/mp-front-cli-services.cjs +1 -1
  31. package/dist/mp-front-cli-services.js +1 -1
  32. package/dist/{service-token-DUKgd-pZ.js → service-token-DrUMHiYQ.js} +181 -173
  33. package/dist/service-token-g-Zt_ctQ.cjs +3 -0
  34. package/package.json +6 -8
  35. package/dist/AuthEngine-D65_iNdB.cjs +0 -1
  36. package/dist/custom-encoder-Cfd7FFMe.js +0 -3705
  37. package/dist/custom-encoder-d7rw7W8X.cjs +0 -27
  38. package/dist/service-token-Bv3BAiQd.cjs +0 -3
@@ -1,24 +1,24 @@
1
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";
2
+ var X = (E, t, e) => t in E ? Y(E, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : E[t] = e;
3
+ var O = (E, t, e) => X(E, 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
5
  import { CustomEncrypter as b } from "./mp-front-cli-encrypter.js";
6
6
  import y from "i18next";
7
7
  import { CustomHeader as V } from "./mp-front-cli-header.js";
8
8
  import J from "querystring";
9
- import { f as L } from "./service-token-DUKgd-pZ.js";
9
+ import { f as L } from "./service-token-DrUMHiYQ.js";
10
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";
11
+ import { CustomEncoder as K } from "./mp-front-cli-encoder.js";
12
+ import { CustomLogger as f } from "./mp-front-cli-logger.js";
13
13
  import { u as Z } from "./stringify-93tp0umt.js";
14
14
  import { t as k } from "./index-Dy5KNkhq.js";
15
- const D = (A) => (y.init({
15
+ const D = (E) => (y.init({
16
16
  resources: {
17
17
  es: {
18
18
  translation: {
19
19
  errors: {
20
20
  ...k.errors,
21
- ...(A == null ? void 0 : A.es) ?? {}
21
+ ...(E == null ? void 0 : E.es) ?? {}
22
22
  }
23
23
  }
24
24
  }
@@ -946,14 +946,14 @@ const D = (A) => (y.init({
946
946
  },
947
947
  ...z
948
948
  };
949
- class d extends u {
949
+ class d extends f {
950
950
  constructor() {
951
951
  super(...arguments);
952
952
  O(this, "errorCatalog", { ...H });
953
953
  O(this, "i18Next");
954
954
  }
955
955
  get(e = "default", r = "NOT_FOUND") {
956
- var o, l;
956
+ var a, l;
957
957
  const { errorCatalog: s } = this;
958
958
  if (e instanceof Error)
959
959
  return this.logError(e.message), {
@@ -962,18 +962,18 @@ class d extends u {
962
962
  message: this.translate(s.internalError.message),
963
963
  uuid: r
964
964
  };
965
- const E = typeof e == "string" ? e : e.code ?? e.errorType;
966
- this.logDebug("statusCode", E);
967
- const a = typeof e == "string" ? {} : { ...e };
965
+ const A = typeof e == "string" ? e : e.code ?? e.errorType;
966
+ this.logDebug("statusCode", A);
967
+ const o = typeof e == "string" ? {} : { ...e };
968
968
  return {
969
- ...s[E] ?? s.default,
969
+ ...s[A] ?? s.default,
970
970
  title: this.translate(
971
- ((o = s[E]) == null ? void 0 : o.title) ?? s.default.title,
972
- a
971
+ ((a = s[A]) == null ? void 0 : a.title) ?? s.default.title,
972
+ o
973
973
  ),
974
974
  message: this.translate(
975
- ((l = s[E]) == null ? void 0 : l.message) ?? s.default.message,
976
- a
975
+ ((l = s[A]) == null ? void 0 : l.message) ?? s.default.message,
976
+ o
977
977
  ),
978
978
  payload: typeof e != "string" ? { errorCode: e.code } : {},
979
979
  uuid: r
@@ -991,7 +991,7 @@ class d extends u {
991
991
  }
992
992
  const m = class m {
993
993
  constructor() {
994
- O(this, "customLogger", new u());
994
+ O(this, "customLogger", new f());
995
995
  O(this, "exceptions", { ...H });
996
996
  }
997
997
  static getInstance() {
@@ -1001,14 +1001,14 @@ const m = class m {
1001
1001
  this.exceptions = { ...this.exceptions, ...t }, m.i18n = D(e);
1002
1002
  }
1003
1003
  get(t, e = "NOT_FOUND") {
1004
- var E, a;
1004
+ var A, o;
1005
1005
  if (m.i18n || (m.i18n = D()), t instanceof Error) {
1006
1006
  this.customLogger.logError(t.message);
1007
- const o = this.exceptions.internalError;
1007
+ const a = this.exceptions.internalError;
1008
1008
  return {
1009
- ...o,
1010
- title: this.translate(o.title),
1011
- message: this.translate(o.message),
1009
+ ...a,
1010
+ title: this.translate(a.title),
1011
+ message: this.translate(a.message),
1012
1012
  uuid: e
1013
1013
  };
1014
1014
  }
@@ -1018,11 +1018,11 @@ const m = class m {
1018
1018
  return {
1019
1019
  ...this.exceptions[r] ?? this.exceptions.default,
1020
1020
  title: this.translate(
1021
- ((E = this.exceptions[r]) == null ? void 0 : E.title) ?? this.exceptions.default.title,
1021
+ ((A = this.exceptions[r]) == null ? void 0 : A.title) ?? this.exceptions.default.title,
1022
1022
  s
1023
1023
  ),
1024
1024
  message: this.translate(
1025
- ((a = this.exceptions[r]) == null ? void 0 : a.message) ?? this.exceptions.default.message,
1025
+ ((o = this.exceptions[r]) == null ? void 0 : o.message) ?? this.exceptions.default.message,
1026
1026
  s
1027
1027
  ),
1028
1028
  payload: typeof t != "string" ? { errorCode: t.code } : {},
@@ -1035,6 +1035,7 @@ const m = class m {
1035
1035
  };
1036
1036
  O(m, "instance"), O(m, "i18n");
1037
1037
  let I = m;
1038
+ const c = (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;
1038
1039
  class De extends b {
1039
1040
  constructor() {
1040
1041
  super(...arguments);
@@ -1049,41 +1050,41 @@ class De extends b {
1049
1050
  return this.session;
1050
1051
  }
1051
1052
  returnData(e, r, s) {
1052
- const E = this.encode(r, s);
1053
- e.status(200).json(E);
1053
+ const A = this.encode(r, s);
1054
+ e.status(200).json(A);
1054
1055
  }
1055
1056
  returnError(e, r) {
1056
1057
  return r != null && r.uuid ? e.status(520).json(r) : e.status(520).json(I.getInstance().get(r, this.uuid));
1057
1058
  }
1058
1059
  get(e) {
1059
1060
  return this.logDebug("get ApiMiddleware"), (r, s) => {
1060
- var E;
1061
- this.logDebug("return ApiMiddleware"), this.uuid = (E = r == null ? void 0 : r.body) == null ? void 0 : E.uuid, n(r).pipe(
1062
- N(
1063
- (a) => p({
1064
- params: n(this.decode(a.body)),
1065
- headers: n(a.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
+ n(
1064
+ (o) => p({
1065
+ params: N(this.decode(o.body)),
1066
+ headers: N(o.headers)
1066
1067
  })
1067
1068
  ),
1068
- N(
1069
- ({ params: a, headers: o }) => p({
1070
- response: e(a, this.uuid, o),
1071
- headers: n(o),
1072
- params: n(a)
1069
+ n(
1070
+ ({ params: o, headers: a }) => p({
1071
+ response: e(o, this.uuid, a),
1072
+ headers: N(a),
1073
+ params: N(o)
1073
1074
  })
1074
1075
  ),
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;
1076
+ n(({ params: o, response: a, 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(o)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(a)}`
1078
+ ), N(a))),
1079
+ U((o) => {
1080
+ var a;
1080
1081
  return this.logError(
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;
1082
+ `ApiMiddleware <URL>: ${r == null ? void 0 : r.url} <HEADERS>: ${JSON.stringify(r == null ? void 0 : r.headers)} <UUID> ${(a = r == null ? void 0 : r.body) == null ? void 0 : a.uuid} <PARAMS> ${JSON.stringify(r == null ? void 0 : r.body)} <ERROR>: ${JSON.stringify(o)}`
1083
+ ), this.returnError(s, o), h;
1083
1084
  })
1084
1085
  ).subscribe({
1085
- next: (a) => {
1086
- this.logDebug("ApiMiddleware subscribe next", JSON.stringify(a)), this.returnData(s, a, this.uuid);
1086
+ next: (o) => {
1087
+ this.logDebug("ApiMiddleware subscribe next", JSON.stringify(o)), this.returnData(s, o, this.uuid);
1087
1088
  }
1088
1089
  });
1089
1090
  };
@@ -1112,45 +1113,45 @@ class de extends V {
1112
1113
  }
1113
1114
  fetchData(e = {}, r) {
1114
1115
  return this.getHeaders().pipe(
1115
- N(
1116
+ n(
1116
1117
  (s) => L(
1117
1118
  this.apiUrl,
1118
1119
  {
1119
1120
  method: "POST",
1120
1121
  headers: s,
1121
1122
  body: this.formatParams(e),
1122
- selector: (E) => E.json()
1123
+ selector: (A) => A.json()
1123
1124
  }
1124
1125
  ).pipe(
1125
- U((E) => {
1126
- throw this.logError(JSON.stringify(E)), this.logError(
1126
+ U((A) => {
1127
+ throw this.logError(JSON.stringify(A)), this.logError(
1127
1128
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1128
1129
  s
1129
1130
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1130
1131
  this.formatParams(e)
1131
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1132
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(A)} \x1B[33m`
1132
1133
  ), I.getInstance().get("default", r);
1133
1134
  }),
1134
- N((E) => (this.logDebug(
1135
+ n((A) => (this.logDebug(
1135
1136
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1136
1137
  s
1137
1138
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1138
1139
  this.formatParams(e)
1139
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1140
- ), n(E)))
1140
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(A)} \x1B[33m`
1141
+ ), N(A)))
1141
1142
  )
1142
1143
  ),
1143
1144
  G((s) => this.errorHandler(s, r))
1144
1145
  );
1145
1146
  }
1146
1147
  fetchCustomData(e = {}, r, s) {
1147
- const E = {
1148
+ const A = {
1148
1149
  "Content-Type": "application/json"
1149
- }, a = J.stringify(
1150
+ }, o = J.stringify(
1150
1151
  e
1151
- ), o = `${this.apiUrl}?${a}`, l = this.method === "GET" ? o : this.apiUrl;
1152
- return this.getHeaders(E, s).pipe(
1153
- N(
1152
+ ), a = `${this.apiUrl}?${o}`, l = this.method === "GET" ? a : this.apiUrl;
1153
+ return this.getHeaders({ useToken: s, headers: A }).pipe(
1154
+ n(
1154
1155
  (R) => L(l, {
1155
1156
  method: this.method,
1156
1157
  headers: R,
@@ -1166,59 +1167,59 @@ class de extends V {
1166
1167
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(T)} \x1B[33m`
1167
1168
  ), I.getInstance().get("default", r);
1168
1169
  }),
1169
- N((T) => (this.logDebug(
1170
+ n((T) => (this.logDebug(
1170
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(
1171
1172
  R
1172
1173
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1173
1174
  e
1174
1175
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(T)} \x1B[33m`
1175
- ), n(T)))
1176
+ ), N(T)))
1176
1177
  )
1177
1178
  )
1178
1179
  );
1179
1180
  }
1180
1181
  }
1181
1182
  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);
1183
+ function re(E) {
1184
+ return typeof E == "string" && ee.test(E);
1184
1185
  }
1185
- function te(A) {
1186
- if (!re(A))
1186
+ function te(E) {
1187
+ if (!re(E))
1187
1188
  throw TypeError("Invalid UUID");
1188
1189
  let t;
1189
1190
  const e = new Uint8Array(16);
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;
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;
1191
1192
  }
1192
- function se(A) {
1193
- A = unescape(encodeURIComponent(A));
1193
+ function se(E) {
1194
+ E = unescape(encodeURIComponent(E));
1194
1195
  const t = [];
1195
- for (let e = 0; e < A.length; ++e)
1196
- t.push(A.charCodeAt(e));
1196
+ for (let e = 0; e < E.length; ++e)
1197
+ t.push(E.charCodeAt(e));
1197
1198
  return t;
1198
1199
  }
1199
1200
  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) {
1201
+ function Ae(E, t, e) {
1202
+ function r(s, A, o, a) {
1202
1203
  var l;
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)
1204
+ if (typeof s == "string" && (s = se(s)), typeof A == "string" && (A = te(A)), ((l = A) === null || l === void 0 ? void 0 : l.length) !== 16)
1204
1205
  throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
1205
1206
  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;
1207
+ if (R.set(A), R.set(s, A.length), R = e(R), R[6] = R[6] & 15 | t, R[8] = R[8] & 63 | 128, o) {
1208
+ a = a || 0;
1208
1209
  for (let T = 0; T < 16; ++T)
1209
- a[o + T] = R[T];
1210
- return a;
1210
+ o[a + T] = R[T];
1211
+ return o;
1211
1212
  }
1212
1213
  return Z(R);
1213
1214
  }
1214
1215
  try {
1215
- r.name = A;
1216
+ r.name = E;
1216
1217
  } catch {
1217
1218
  }
1218
1219
  return r.DNS = Ee, r.URL = le, r;
1219
1220
  }
1220
- function ae(A, t, e, r) {
1221
- switch (A) {
1221
+ function ae(E, t, e, r) {
1222
+ switch (E) {
1222
1223
  case 0:
1223
1224
  return t & e ^ ~t & r;
1224
1225
  case 1:
@@ -1229,42 +1230,42 @@ function ae(A, t, e, r) {
1229
1230
  return t ^ e ^ r;
1230
1231
  }
1231
1232
  }
1232
- function P(A, t) {
1233
- return A << t | A >>> 32 - t;
1233
+ function P(E, t) {
1234
+ return E << t | E >>> 32 - t;
1234
1235
  }
1235
- function oe(A) {
1236
+ function oe(E) {
1236
1237
  const t = [1518500249, 1859775393, 2400959708, 3395469782], e = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
1237
- if (typeof A == "string") {
1238
- const a = unescape(encodeURIComponent(A));
1239
- A = [];
1240
- for (let o = 0; o < a.length; ++o)
1241
- A.push(a.charCodeAt(o));
1242
- } else Array.isArray(A) || (A = Array.prototype.slice.call(A));
1243
- A.push(128);
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);
1238
+ if (typeof E == "string") {
1239
+ const o = unescape(encodeURIComponent(E));
1240
+ E = [];
1241
+ for (let a = 0; a < o.length; ++a)
1242
+ E.push(o.charCodeAt(a));
1243
+ } else Array.isArray(E) || (E = Array.prototype.slice.call(E));
1244
+ E.push(128);
1245
+ const r = E.length / 4 + 2, s = Math.ceil(r / 16), A = new Array(s);
1246
+ for (let o = 0; o < s; ++o) {
1247
+ const a = new Uint32Array(16);
1247
1248
  for (let l = 0; l < 16; ++l)
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;
1249
+ a[l] = E[o * 64 + l * 4] << 24 | E[o * 64 + l * 4 + 1] << 16 | E[o * 64 + l * 4 + 2] << 8 | E[o * 64 + l * 4 + 3];
1250
+ A[o] = a;
1250
1251
  }
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);
1252
+ A[s - 1][14] = (E.length - 1) * 8 / Math.pow(2, 32), A[s - 1][14] = Math.floor(A[s - 1][14]), A[s - 1][15] = (E.length - 1) * 8 & 4294967295;
1253
+ for (let o = 0; o < s; ++o) {
1254
+ const a = new Uint32Array(80);
1254
1255
  for (let C = 0; C < 16; ++C)
1255
- o[C] = E[a][C];
1256
+ a[C] = A[o][C];
1256
1257
  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
+ a[C] = P(a[C - 3] ^ a[C - 8] ^ a[C - 14] ^ a[C - 16], 1);
1258
1259
  let l = e[0], R = e[1], T = e[2], g = e[3], i = e[4];
1259
1260
  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
+ const u = Math.floor(C / 20), $ = P(l, 5) + ae(u, R, T, g) + i + t[u] + a[C] >>> 0;
1261
1262
  i = g, g = T, T = P(R, 30) >>> 0, R = l, l = $;
1262
1263
  }
1263
1264
  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;
1264
1265
  }
1265
1266
  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];
1266
1267
  }
1267
- const v = Ae("v5", 80, oe);
1268
+ const w = Ae("v5", 80, oe);
1268
1269
  class Pe extends K {
1269
1270
  constructor(e, r = "POST", s = {}) {
1270
1271
  super();
@@ -1285,27 +1286,27 @@ class Pe extends K {
1285
1286
  this.errorResponse = e;
1286
1287
  }
1287
1288
  fetchData(e = {}) {
1288
- const r = (/* @__PURE__ */ new Date()).toISOString(), s = v(r, v.URL), E = this.encode({ ...e }, s);
1289
+ const r = (/* @__PURE__ */ new Date()).toISOString(), s = w(r, w.URL), A = this.encode({ ...e }, s);
1289
1290
  S.getInstance().setSubject(this.isLoadingEnabled);
1290
- const o = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
1291
+ const a = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
1291
1292
  return L(this.apiUrl, {
1292
1293
  method: this.method,
1293
- headers: { ...this.headers, flow: o },
1294
- body: E,
1294
+ headers: { ...this.headers, flow: a },
1295
+ body: A,
1295
1296
  selector: (l) => l.json()
1296
1297
  }).pipe(
1297
- N((l) => n(this.decode(l))),
1298
- N((l) => l.code && (l.type === "modal" || l.type === "message") ? (this.logError(
1299
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(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(
1302
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(l)}`
1303
- ), n(l))),
1298
+ n((l) => N(this.decode(l))),
1299
+ n((l) => l.code && (l.type === "modal" || l.type === "message") ? (this.logError(
1300
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${A} <RESPONSE>: ${JSON.stringify(l)}`
1301
+ ), S.getInstance().setSubject(!1), x.getInstance().setSubject(l), this.errorResponse ? N(this.errorResponse) : h) : N(l)),
1302
+ n((l) => (S.getInstance().setSubject(!1), this.logDebug(
1303
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${A} <RESPONSE>: ${JSON.stringify(l)}`
1304
+ ), N(l))),
1304
1305
  U((l) => (this.logError(
1305
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(l)}`
1306
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${A} <RESPONSE>: ${JSON.stringify(l)}`
1306
1307
  ), S.getInstance().setSubject(!1), x.getInstance().setSubject(
1307
1308
  I.getInstance().get(l, s)
1308
- ), this.errorResponse ? n(this.errorResponse) : h))
1309
+ ), this.errorResponse ? N(this.errorResponse) : h))
1309
1310
  );
1310
1311
  }
1311
1312
  }
@@ -1331,50 +1332,52 @@ class Be extends V {
1331
1332
  }
1332
1333
  });
1333
1334
  }
1334
- fetchData(e = {}, r) {
1335
- const { resources: s, errors: E } = this.onInit();
1336
- return this.errorCatalog.setErrors(E), this.errorCatalog.setI18nResources(s), this.getHeaders().pipe(
1337
- N(
1335
+ fetchData(e = {}, r, s) {
1336
+ const { resources: A, errors: o } = this.onInit();
1337
+ return this.errorCatalog.setErrors(o), this.errorCatalog.setI18nResources(A), this.getHeaders({
1338
+ encryptCredentials: s == null ? void 0 : s.encryptCredentials
1339
+ }).pipe(
1340
+ n(
1338
1341
  (a) => L(
1339
1342
  this.apiUrl,
1340
1343
  {
1341
1344
  method: "POST",
1342
1345
  headers: a,
1343
1346
  body: this.formatParams(e),
1344
- selector: (o) => o.json()
1347
+ selector: (l) => l.json()
1345
1348
  }
1346
1349
  ).pipe(
1347
- U((o) => {
1348
- throw this.logError(JSON.stringify(o)), this.logError(
1350
+ U((l) => {
1351
+ throw this.logError(JSON.stringify(l)), this.logError(
1349
1352
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1350
1353
  a
1351
1354
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1352
1355
  this.formatParams(e)
1353
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
1356
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(l)} \x1B[33m`
1354
1357
  ), new d().get("default", r);
1355
1358
  }),
1356
- N((o) => (this.logDebug(
1359
+ n((l) => (this.logDebug(
1357
1360
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1358
1361
  a
1359
1362
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1360
1363
  this.formatParams(e)
1361
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
1362
- ), n(o)))
1364
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(l)} \x1B[33m`
1365
+ ), N(l)))
1363
1366
  )
1364
1367
  ),
1365
1368
  G((a) => this.errorHandler(a, r))
1366
1369
  );
1367
1370
  }
1368
1371
  fetchCustomData(e = {}, r, s) {
1369
- const { resources: E, errors: a } = this.onInit();
1370
- this.errorCatalog.setErrors(a), this.errorCatalog.setI18nResources(E);
1371
- const o = {
1372
+ const { resources: A, errors: o } = this.onInit();
1373
+ this.errorCatalog.setErrors(o), this.errorCatalog.setI18nResources(A);
1374
+ const a = {
1372
1375
  "Content-Type": "application/json"
1373
1376
  }, l = J.stringify(
1374
1377
  e
1375
1378
  ), R = `${this.apiUrl}?${l}`, T = this.method === "GET" ? R : this.apiUrl;
1376
- return this.getHeaders(o, s).pipe(
1377
- N(
1379
+ return this.getHeaders({ useToken: s, headers: a }).pipe(
1380
+ n(
1378
1381
  (g) => L(T, {
1379
1382
  method: this.method,
1380
1383
  headers: g,
@@ -1390,13 +1393,13 @@ class Be extends V {
1390
1393
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(i)} \x1B[33m`
1391
1394
  ), new d().get("default", r);
1392
1395
  }),
1393
- N((i) => (this.logDebug(
1396
+ n((i) => (this.logDebug(
1394
1397
  `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(
1395
1398
  g
1396
1399
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1397
1400
  e
1398
1401
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(i)} \x1B[33m`
1399
- ), n(i)))
1402
+ ), N(i)))
1400
1403
  )
1401
1404
  )
1402
1405
  );
@@ -1407,11 +1410,11 @@ const B = {
1407
1410
  client_secret: process.env.AZURE_AD_CLIENT_SECRET,
1408
1411
  resource: process.env.AZURE_AD_CLIENT_RESOURCE,
1409
1412
  grant_type: process.env.AZURE_AD_CLIENT_GRANT_TYPE
1410
- }, w = process.env.AZURE_AD_GRAPH_URL_TOKEN, F = process.env.AZURE_AD_TENANT_ID;
1411
- class Re extends u {
1413
+ }, F = process.env.AZURE_AD_GRAPH_URL_TOKEN, v = process.env.AZURE_AD_TENANT_ID;
1414
+ class Re extends f {
1412
1415
  getHeaders() {
1413
- const t = Object.keys(B).some((r) => c.isEmpty(B[r]));
1414
- if (c.isEmpty(w) || c.isEmpty(F))
1416
+ const t = Object.keys(B).some((r) => c(B[r]));
1417
+ if (c(F) || c(v))
1415
1418
  throw this.logError(
1416
1419
  "AZURE_AD_GRAPH_URL_TOKEN or AZURE_AD_TENANT_ID are empty or missing"
1417
1420
  ), new Error(
@@ -1421,9 +1424,9 @@ class Re extends u {
1421
1424
  throw this.logError(
1422
1425
  "Some variables are empty or missing, check AZURE_AD_CLIENT_ID, AZURE_AD_CLIENT_SECRET, AZURE_AD_CLIENT_RESOURCE, AZURE_AD_CLIENT_GRANT_TYPE"
1423
1426
  ), new Error("some variables are empty or missing");
1424
- const e = w.replace(
1427
+ const e = F.replace(
1425
1428
  "AZURE_AD_TENANT_ID",
1426
- F
1429
+ v
1427
1430
  );
1428
1431
  return L(e, {
1429
1432
  method: "POST",
@@ -1434,10 +1437,10 @@ class Re extends u {
1434
1437
  body: new URLSearchParams(B),
1435
1438
  selector: (r) => r.json()
1436
1439
  }).pipe(
1437
- N((r) => (this.logDebug(
1440
+ n((r) => (this.logDebug(
1438
1441
  "response from API new_url_365_graph_token",
1439
1442
  JSON.stringify(r)
1440
- ), n({
1443
+ ), N({
1441
1444
  headers: {
1442
1445
  Authorization: `Bearer ${r == null ? void 0 : r.access_token}`,
1443
1446
  responseType: "json"
@@ -1446,40 +1449,40 @@ class Re extends u {
1446
1449
  );
1447
1450
  }
1448
1451
  }
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;
1452
+ const M = process.env.AZURE_AD_GRAPH_GET_APP_ROLES, _ = process.env.AZURE_AD_GRAPH_GET_USER_BY_EMAIL, Q = process.env.AZURE_AD_GRAPH_GROUPS;
1450
1453
  class pe extends Re {
1451
1454
  getAppRoles(t) {
1452
- if (c.isEmpty(_))
1455
+ if (c(M))
1453
1456
  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");
1454
- const e = _.replace(
1457
+ const e = M.replace(
1455
1458
  "{id-obj}",
1456
1459
  `${t}`
1457
1460
  );
1458
1461
  return this.getHeaders().pipe(
1459
- N(
1462
+ n(
1460
1463
  (r) => L(e, {
1461
1464
  method: "GET",
1462
1465
  headers: r == null ? void 0 : r.headers,
1463
1466
  selector: (s) => s.json()
1464
- }).pipe(N((s) => n({ roles: s == null ? void 0 : s.value })))
1467
+ }).pipe(n((s) => N({ roles: s == null ? void 0 : s.value })))
1465
1468
  )
1466
1469
  );
1467
1470
  }
1468
1471
  getAppRoleAssignments(t) {
1469
- if (c.isEmpty(M))
1472
+ if (c(_))
1470
1473
  throw this.logError("AZURE_AD_GRAPH_GET_USER_BY_EMAIL URL is empty or missing"), new Error(
1471
1474
  "AZURE_AD_GRAPH_GET_USER_BY_EMAIL URL is empty or missing"
1472
1475
  );
1473
- const r = `${M.replace(
1476
+ const r = `${_.replace(
1474
1477
  "{user-mail}",
1475
1478
  `${t}/appRoleAssignments`
1476
1479
  )}?$select=appRoleId,resourceDisplayName`;
1477
1480
  return this.getHeaders().pipe(
1478
- N(
1481
+ n(
1479
1482
  (s) => L(r, {
1480
1483
  method: "GET",
1481
1484
  headers: s == null ? void 0 : s.headers,
1482
- selector: (E) => E.json()
1485
+ selector: (A) => A.json()
1483
1486
  })
1484
1487
  )
1485
1488
  );
@@ -1489,9 +1492,9 @@ class pe extends Re {
1489
1492
  appRoles: this.getAppRoles(e),
1490
1493
  appRoleAssignments: this.getAppRoleAssignments(t)
1491
1494
  }).pipe(
1492
- N(({ appRoles: r, appRoleAssignments: s }) => {
1493
- var o;
1494
- const E = (o = s == null ? void 0 : s.value) == null ? void 0 : o.map(
1495
+ n(({ appRoles: r, appRoleAssignments: s }) => {
1496
+ var a;
1497
+ const A = (a = s == null ? void 0 : s.value) == null ? void 0 : a.map(
1495
1498
  (l) => {
1496
1499
  var R, T, g;
1497
1500
  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) => ({
@@ -1500,31 +1503,31 @@ class pe extends Re {
1500
1503
  value: i == null ? void 0 : i.value
1501
1504
  }));
1502
1505
  }
1503
- ).flat(), a = E == null ? void 0 : E.map((l) => l == null ? void 0 : l.appRoleId);
1504
- return n({ roles: a });
1506
+ ).flat(), o = A == null ? void 0 : A.map((l) => l == null ? void 0 : l.appRoleId);
1507
+ return N({ roles: o });
1505
1508
  })
1506
1509
  );
1507
1510
  }
1508
1511
  getRolesFromApi(t, e) {
1509
1512
  return this.userRolesByApp(t, e).pipe(
1510
- N((r) => n(r))
1513
+ n((r) => N(r))
1511
1514
  );
1512
1515
  }
1513
1516
  getRoles(t, e) {
1514
1517
  return this.getRolesFromApi(t, e);
1515
1518
  }
1516
1519
  getGroupsFromApi(t) {
1517
- if (this.logDebug("getGroupsFromApi by email: ", JSON.stringify(t)), c.isEmpty(Q))
1520
+ if (this.logDebug("getGroupsFromApi by email: ", JSON.stringify(t)), c(Q))
1518
1521
  throw this.logError("AZURE_AD_GRAPH_GROUPS URL is empty or missing"), new Error("AZURE_AD_GRAPH_GROUPS URL is empty or missing");
1519
1522
  const e = `${Q.replace("idUser", t)}?$select=id,description,displayName`;
1520
1523
  return this.logDebug("URL base: ", e), this.getHeaders().pipe(
1521
- N(
1524
+ n(
1522
1525
  (r) => L(e, {
1523
1526
  method: "GET",
1524
1527
  headers: r == null ? void 0 : r.headers,
1525
1528
  selector: (s) => s.json()
1526
1529
  }).pipe(
1527
- N((s) => (this.logDebug("response from API: ", JSON.stringify(s)), n(s)))
1530
+ n((s) => (this.logDebug("response from API: ", JSON.stringify(s)), N(s)))
1528
1531
  )
1529
1532
  )
1530
1533
  );
@@ -1539,10 +1542,10 @@ class pe extends Re {
1539
1542
  * @returns `true` si el usuario pertenece al grupo
1540
1543
  */
1541
1544
  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(
1543
- N((r) => {
1545
+ return this.logDebug("Check inGroup params: ", JSON.stringify({ email: t, idGroup: e })), c(t) || c(e) ? (this.logError("inGroup method error"), this.logError("email or idGroup are empty or missing"), N(!1)) : this.getUserGroups(t).pipe(
1546
+ n((r) => {
1544
1547
  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));
1548
+ return N((s = r == null ? void 0 : r.value) == null ? void 0 : s.some((A) => (A == null ? void 0 : A.id) === e));
1546
1549
  })
1547
1550
  );
1548
1551
  }
@@ -1557,10 +1560,10 @@ class pe extends Re {
1557
1560
  return this.logDebug(
1558
1561
  "Check inRole params: ",
1559
1562
  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) => {
1562
- var E;
1563
- return n((E = s == null ? void 0 : s.roles) == null ? void 0 : E.includes(e));
1563
+ ), c(t) || c(e) || c(r) ? (this.logError("inRole method error"), this.logError("email or idRole or idObjApp are empty or missing"), N(!1)) : this.getRoles(t, r).pipe(
1564
+ n((s) => {
1565
+ var A;
1566
+ return N((A = s == null ? void 0 : s.roles) == null ? void 0 : A.includes(e));
1564
1567
  })
1565
1568
  );
1566
1569
  }
@@ -1569,8 +1572,8 @@ export {
1569
1572
  De as A,
1570
1573
  d as E,
1571
1574
  de as F,
1572
- I as a,
1573
- Pe as b,
1574
- Be as c,
1575
- pe as d
1575
+ pe as a,
1576
+ I as b,
1577
+ Pe as c,
1578
+ Be as d
1576
1579
  };