mp-front-cli 2.3.1 → 2.3.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.
@@ -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-BfQQMCM4.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 o, A;
957
957
  const { errorCatalog: s } = this;
958
958
  if (e instanceof Error)
959
959
  return this.logError(e.message), {
@@ -962,17 +962,17 @@ class d extends 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);
965
+ const l = typeof e == "string" ? e : e.code ?? e.errorType;
966
+ this.logDebug("statusCode", l);
967
967
  const a = typeof e == "string" ? {} : { ...e };
968
968
  return {
969
- ...s[E] ?? s.default,
969
+ ...s[l] ?? s.default,
970
970
  title: this.translate(
971
- ((o = s[E]) == null ? void 0 : o.title) ?? s.default.title,
971
+ ((o = s[l]) == null ? void 0 : o.title) ?? s.default.title,
972
972
  a
973
973
  ),
974
974
  message: this.translate(
975
- ((l = s[E]) == null ? void 0 : l.message) ?? s.default.message,
975
+ ((A = s[l]) == null ? void 0 : A.message) ?? s.default.message,
976
976
  a
977
977
  ),
978
978
  payload: typeof e != "string" ? { errorCode: e.code } : {},
@@ -989,20 +989,20 @@ class d extends u {
989
989
  return this.i18Next || (this.i18Next = D()), this.i18Next.t(e, { payload: r });
990
990
  }
991
991
  }
992
- const m = class m {
992
+ const g = class g {
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() {
998
- return m.instance || (m.instance = new m()), m.instance;
998
+ return g.instance || (g.instance = new g()), g.instance;
999
999
  }
1000
1000
  init(t, e) {
1001
- this.exceptions = { ...this.exceptions, ...t }, m.i18n = D(e);
1001
+ this.exceptions = { ...this.exceptions, ...t }, g.i18n = D(e);
1002
1002
  }
1003
1003
  get(t, e = "NOT_FOUND") {
1004
- var E, a;
1005
- if (m.i18n || (m.i18n = D()), t instanceof Error) {
1004
+ var l, a;
1005
+ if (g.i18n || (g.i18n = D()), t instanceof Error) {
1006
1006
  this.customLogger.logError(t.message);
1007
1007
  const o = this.exceptions.internalError;
1008
1008
  return {
@@ -1018,7 +1018,7 @@ 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
+ ((l = this.exceptions[r]) == null ? void 0 : l.title) ?? this.exceptions.default.title,
1022
1022
  s
1023
1023
  ),
1024
1024
  message: this.translate(
@@ -1030,11 +1030,12 @@ const m = class m {
1030
1030
  };
1031
1031
  }
1032
1032
  translate(t, e = {}) {
1033
- return m.i18n.t(t, { payload: e });
1033
+ return g.i18n.t(t, { payload: e });
1034
1034
  }
1035
1035
  };
1036
- O(m, "instance"), O(m, "i18n");
1037
- let I = m;
1036
+ O(g, "instance"), O(g, "i18n");
1037
+ let I = g;
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,32 +1050,32 @@ 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 l = this.encode(r, s);
1054
+ e.status(200).json(l);
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(
1061
+ var l;
1062
+ this.logDebug("return ApiMiddleware"), this.uuid = (l = r == null ? void 0 : r.body) == null ? void 0 : l.uuid, N(r).pipe(
1063
+ n(
1063
1064
  (a) => p({
1064
- params: n(this.decode(a.body)),
1065
- headers: n(a.headers)
1065
+ params: N(this.decode(a.body)),
1066
+ headers: N(a.headers)
1066
1067
  })
1067
1068
  ),
1068
- N(
1069
+ n(
1069
1070
  ({ params: a, headers: o }) => p({
1070
1071
  response: e(a, this.uuid, o),
1071
- headers: n(o),
1072
- params: n(a)
1072
+ headers: N(o),
1073
+ params: N(a)
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))),
1076
+ n(({ params: a, response: o, headers: A }) => (this.logDebug(
1077
+ `ApiMiddleware \x1B[37m <URL>: \x1B[33m ${r.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(A)} \x1B[37m <UUID> \x1B[33m ${r.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(a)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)}`
1078
+ ), N(o))),
1078
1079
  U((a) => {
1079
1080
  var o;
1080
1081
  return this.logError(
@@ -1112,46 +1113,46 @@ 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: (l) => l.json()
1123
1124
  }
1124
1125
  ).pipe(
1125
- U((E) => {
1126
- throw this.logError(JSON.stringify(E)), this.logError(
1126
+ U((l) => {
1127
+ throw this.logError(JSON.stringify(l)), 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(l)} \x1B[33m`
1132
1133
  ), I.getInstance().get("default", r);
1133
1134
  }),
1134
- N((E) => (this.logDebug(
1135
+ n((l) => (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(l)} \x1B[33m`
1141
+ ), N(l)))
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 l = {
1148
1149
  "Content-Type": "application/json"
1149
1150
  }, a = 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(
1154
- (R) => L(l, {
1152
+ ), o = `${this.apiUrl}?${a}`, A = this.method === "GET" ? o : this.apiUrl;
1153
+ return this.getHeaders(l, s).pipe(
1154
+ n(
1155
+ (R) => L(A, {
1155
1156
  method: this.method,
1156
1157
  headers: R,
1157
1158
  body: this.method === "GET" ? null : JSON.stringify(e),
@@ -1159,51 +1160,51 @@ class de extends V {
1159
1160
  }).pipe(
1160
1161
  U((T) => {
1161
1162
  throw this.logError(JSON.stringify(T)), this.logError(
1162
- `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${l} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1163
+ `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${A} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1163
1164
  R
1164
1165
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1165
1166
  this.formatParams(e)
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
- `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(
1170
+ n((T) => (this.logDebug(
1171
+ `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${A} \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) {
1202
- 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)
1201
+ function Ae(E, t, e) {
1202
+ function r(s, l, a, o) {
1203
+ var A;
1204
+ if (typeof s == "string" && (s = se(s)), typeof l == "string" && (l = te(l)), ((A = l) === null || A === void 0 ? void 0 : A.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
+ if (R.set(l), R.set(s, l.length), R = e(R), R[6] = R[6] & 15 | t, R[8] = R[8] & 63 | 128, a) {
1207
1208
  o = o || 0;
1208
1209
  for (let T = 0; T < 16; ++T)
1209
1210
  a[o + T] = R[T];
@@ -1212,13 +1213,13 @@ function Ae(A, t, e) {
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 = [];
1238
+ if (typeof E == "string") {
1239
+ const a = unescape(encodeURIComponent(E));
1240
+ E = [];
1240
1241
  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);
1242
+ E.push(a.charCodeAt(o));
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), l = new Array(s);
1245
1246
  for (let a = 0; a < s; ++a) {
1246
1247
  const o = new Uint32Array(16);
1247
- 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;
1248
+ for (let A = 0; A < 16; ++A)
1249
+ o[A] = E[a * 64 + A * 4] << 24 | E[a * 64 + A * 4 + 1] << 16 | E[a * 64 + A * 4 + 2] << 8 | E[a * 64 + A * 4 + 3];
1250
+ l[a] = o;
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
+ l[s - 1][14] = (E.length - 1) * 8 / Math.pow(2, 32), l[s - 1][14] = Math.floor(l[s - 1][14]), l[s - 1][15] = (E.length - 1) * 8 & 4294967295;
1252
1253
  for (let a = 0; a < s; ++a) {
1253
1254
  const o = new Uint32Array(80);
1254
1255
  for (let C = 0; C < 16; ++C)
1255
- o[C] = E[a][C];
1256
+ o[C] = l[a][C];
1256
1257
  for (let C = 16; C < 80; ++C)
1257
1258
  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
+ let A = e[0], R = e[1], T = e[2], m = 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
- i = g, g = T, T = P(R, 30) >>> 0, R = l, l = $;
1261
+ const u = Math.floor(C / 20), $ = P(A, 5) + ae(u, R, T, m) + i + t[u] + o[C] >>> 0;
1262
+ i = m, m = T, T = P(R, 30) >>> 0, R = A, A = $;
1262
1263
  }
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;
1264
+ e[0] = e[0] + A >>> 0, e[1] = e[1] + R >>> 0, e[2] = e[2] + T >>> 0, e[3] = e[3] + m >>> 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), l = this.encode({ ...e }, s);
1289
1290
  S.getInstance().setSubject(this.isLoadingEnabled);
1290
1291
  const o = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
1291
1292
  return L(this.apiUrl, {
1292
1293
  method: this.method,
1293
1294
  headers: { ...this.headers, flow: o },
1294
- body: E,
1295
- selector: (l) => l.json()
1295
+ body: l,
1296
+ selector: (A) => A.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))),
1304
- U((l) => (this.logError(
1305
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(l)}`
1298
+ n((A) => N(this.decode(A))),
1299
+ n((A) => A.code && (A.type === "modal" || A.type === "message") ? (this.logError(
1300
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${l} <RESPONSE>: ${JSON.stringify(A)}`
1301
+ ), S.getInstance().setSubject(!1), x.getInstance().setSubject(A), this.errorResponse ? N(this.errorResponse) : h) : N(A)),
1302
+ n((A) => (S.getInstance().setSubject(!1), this.logDebug(
1303
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${l} <RESPONSE>: ${JSON.stringify(A)}`
1304
+ ), N(A))),
1305
+ U((A) => (this.logError(
1306
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${l} <RESPONSE>: ${JSON.stringify(A)}`
1306
1307
  ), S.getInstance().setSubject(!1), x.getInstance().setSubject(
1307
- I.getInstance().get(l, s)
1308
- ), this.errorResponse ? n(this.errorResponse) : h))
1308
+ I.getInstance().get(A, s)
1309
+ ), this.errorResponse ? N(this.errorResponse) : h))
1309
1310
  );
1310
1311
  }
1311
1312
  }
@@ -1332,9 +1333,9 @@ class Be extends V {
1332
1333
  });
1333
1334
  }
1334
1335
  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(
1336
+ const { resources: s, errors: l } = this.onInit();
1337
+ return this.errorCatalog.setErrors(l), this.errorCatalog.setI18nResources(s), this.getHeaders().pipe(
1338
+ n(
1338
1339
  (a) => L(
1339
1340
  this.apiUrl,
1340
1341
  {
@@ -1353,50 +1354,50 @@ class Be extends V {
1353
1354
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
1354
1355
  ), new d().get("default", r);
1355
1356
  }),
1356
- N((o) => (this.logDebug(
1357
+ n((o) => (this.logDebug(
1357
1358
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1358
1359
  a
1359
1360
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1360
1361
  this.formatParams(e)
1361
1362
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
1362
- ), n(o)))
1363
+ ), N(o)))
1363
1364
  )
1364
1365
  ),
1365
1366
  G((a) => this.errorHandler(a, r))
1366
1367
  );
1367
1368
  }
1368
1369
  fetchCustomData(e = {}, r, s) {
1369
- const { resources: E, errors: a } = this.onInit();
1370
- this.errorCatalog.setErrors(a), this.errorCatalog.setI18nResources(E);
1370
+ const { resources: l, errors: a } = this.onInit();
1371
+ this.errorCatalog.setErrors(a), this.errorCatalog.setI18nResources(l);
1371
1372
  const o = {
1372
1373
  "Content-Type": "application/json"
1373
- }, l = J.stringify(
1374
+ }, A = J.stringify(
1374
1375
  e
1375
- ), R = `${this.apiUrl}?${l}`, T = this.method === "GET" ? R : this.apiUrl;
1376
+ ), R = `${this.apiUrl}?${A}`, T = this.method === "GET" ? R : this.apiUrl;
1376
1377
  return this.getHeaders(o, s).pipe(
1377
- N(
1378
- (g) => L(T, {
1378
+ n(
1379
+ (m) => L(T, {
1379
1380
  method: this.method,
1380
- headers: g,
1381
+ headers: m,
1381
1382
  body: this.method === "GET" ? null : JSON.stringify(e),
1382
1383
  selector: (i) => i.json()
1383
1384
  }).pipe(
1384
1385
  U((i) => {
1385
1386
  throw this.logError(JSON.stringify(i)), this.logError(
1386
1387
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${T} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1387
- g
1388
+ m
1388
1389
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1389
1390
  this.formatParams(e)
1390
1391
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(i)} \x1B[33m`
1391
1392
  ), new d().get("default", r);
1392
1393
  }),
1393
- N((i) => (this.logDebug(
1394
+ n((i) => (this.logDebug(
1394
1395
  `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
- g
1396
+ m
1396
1397
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1397
1398
  e
1398
1399
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(i)} \x1B[33m`
1399
- ), n(i)))
1400
+ ), N(i)))
1400
1401
  )
1401
1402
  )
1402
1403
  );
@@ -1407,11 +1408,11 @@ const B = {
1407
1408
  client_secret: process.env.AZURE_AD_CLIENT_SECRET,
1408
1409
  resource: process.env.AZURE_AD_CLIENT_RESOURCE,
1409
1410
  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 {
1411
+ }, F = process.env.AZURE_AD_GRAPH_URL_TOKEN, v = process.env.AZURE_AD_TENANT_ID;
1412
+ class Re extends f {
1412
1413
  getHeaders() {
1413
- const t = Object.keys(B).some((r) => c.isEmpty(B[r]));
1414
- if (c.isEmpty(w) || c.isEmpty(F))
1414
+ const t = Object.keys(B).some((r) => c(B[r]));
1415
+ if (c(F) || c(v))
1415
1416
  throw this.logError(
1416
1417
  "AZURE_AD_GRAPH_URL_TOKEN or AZURE_AD_TENANT_ID are empty or missing"
1417
1418
  ), new Error(
@@ -1421,9 +1422,9 @@ class Re extends u {
1421
1422
  throw this.logError(
1422
1423
  "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
1424
  ), new Error("some variables are empty or missing");
1424
- const e = w.replace(
1425
+ const e = F.replace(
1425
1426
  "AZURE_AD_TENANT_ID",
1426
- F
1427
+ v
1427
1428
  );
1428
1429
  return L(e, {
1429
1430
  method: "POST",
@@ -1434,10 +1435,10 @@ class Re extends u {
1434
1435
  body: new URLSearchParams(B),
1435
1436
  selector: (r) => r.json()
1436
1437
  }).pipe(
1437
- N((r) => (this.logDebug(
1438
+ n((r) => (this.logDebug(
1438
1439
  "response from API new_url_365_graph_token",
1439
1440
  JSON.stringify(r)
1440
- ), n({
1441
+ ), N({
1441
1442
  headers: {
1442
1443
  Authorization: `Bearer ${r == null ? void 0 : r.access_token}`,
1443
1444
  responseType: "json"
@@ -1446,40 +1447,40 @@ class Re extends u {
1446
1447
  );
1447
1448
  }
1448
1449
  }
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
+ 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
1451
  class pe extends Re {
1451
1452
  getAppRoles(t) {
1452
- if (c.isEmpty(_))
1453
+ if (c(M))
1453
1454
  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(
1455
+ const e = M.replace(
1455
1456
  "{id-obj}",
1456
1457
  `${t}`
1457
1458
  );
1458
1459
  return this.getHeaders().pipe(
1459
- N(
1460
+ n(
1460
1461
  (r) => L(e, {
1461
1462
  method: "GET",
1462
1463
  headers: r == null ? void 0 : r.headers,
1463
1464
  selector: (s) => s.json()
1464
- }).pipe(N((s) => n({ roles: s == null ? void 0 : s.value })))
1465
+ }).pipe(n((s) => N({ roles: s == null ? void 0 : s.value })))
1465
1466
  )
1466
1467
  );
1467
1468
  }
1468
1469
  getAppRoleAssignments(t) {
1469
- if (c.isEmpty(M))
1470
+ if (c(_))
1470
1471
  throw this.logError("AZURE_AD_GRAPH_GET_USER_BY_EMAIL URL is empty or missing"), new Error(
1471
1472
  "AZURE_AD_GRAPH_GET_USER_BY_EMAIL URL is empty or missing"
1472
1473
  );
1473
- const r = `${M.replace(
1474
+ const r = `${_.replace(
1474
1475
  "{user-mail}",
1475
1476
  `${t}/appRoleAssignments`
1476
1477
  )}?$select=appRoleId,resourceDisplayName`;
1477
1478
  return this.getHeaders().pipe(
1478
- N(
1479
+ n(
1479
1480
  (s) => L(r, {
1480
1481
  method: "GET",
1481
1482
  headers: s == null ? void 0 : s.headers,
1482
- selector: (E) => E.json()
1483
+ selector: (l) => l.json()
1483
1484
  })
1484
1485
  )
1485
1486
  );
@@ -1489,42 +1490,42 @@ class pe extends Re {
1489
1490
  appRoles: this.getAppRoles(e),
1490
1491
  appRoleAssignments: this.getAppRoleAssignments(t)
1491
1492
  }).pipe(
1492
- N(({ appRoles: r, appRoleAssignments: s }) => {
1493
+ n(({ appRoles: r, appRoleAssignments: s }) => {
1493
1494
  var o;
1494
- const E = (o = s == null ? void 0 : s.value) == null ? void 0 : o.map(
1495
- (l) => {
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) => ({
1498
- appRoleId: l == null ? void 0 : l.appRoleId,
1495
+ const l = (o = s == null ? void 0 : s.value) == null ? void 0 : o.map(
1496
+ (A) => {
1497
+ var R, T, m;
1498
+ return (m = (T = (R = r == null ? void 0 : r.roles) == null ? void 0 : R.filter((i) => (i == null ? void 0 : i.id) === (A == null ? void 0 : A.appRoleId))) == null ? void 0 : T.filter((i) => i == null ? void 0 : i.isEnabled)) == null ? void 0 : m.map((i) => ({
1499
+ appRoleId: A == null ? void 0 : A.appRoleId,
1499
1500
  displayName: i == null ? void 0 : i.displayName,
1500
1501
  value: i == null ? void 0 : i.value
1501
1502
  }));
1502
1503
  }
1503
- ).flat(), a = E == null ? void 0 : E.map((l) => l == null ? void 0 : l.appRoleId);
1504
- return n({ roles: a });
1504
+ ).flat(), a = l == null ? void 0 : l.map((A) => A == null ? void 0 : A.appRoleId);
1505
+ return N({ roles: a });
1505
1506
  })
1506
1507
  );
1507
1508
  }
1508
1509
  getRolesFromApi(t, e) {
1509
1510
  return this.userRolesByApp(t, e).pipe(
1510
- N((r) => n(r))
1511
+ n((r) => N(r))
1511
1512
  );
1512
1513
  }
1513
1514
  getRoles(t, e) {
1514
1515
  return this.getRolesFromApi(t, e);
1515
1516
  }
1516
1517
  getGroupsFromApi(t) {
1517
- if (this.logDebug("getGroupsFromApi by email: ", JSON.stringify(t)), c.isEmpty(Q))
1518
+ if (this.logDebug("getGroupsFromApi by email: ", JSON.stringify(t)), c(Q))
1518
1519
  throw this.logError("AZURE_AD_GRAPH_GROUPS URL is empty or missing"), new Error("AZURE_AD_GRAPH_GROUPS URL is empty or missing");
1519
1520
  const e = `${Q.replace("idUser", t)}?$select=id,description,displayName`;
1520
1521
  return this.logDebug("URL base: ", e), this.getHeaders().pipe(
1521
- N(
1522
+ n(
1522
1523
  (r) => L(e, {
1523
1524
  method: "GET",
1524
1525
  headers: r == null ? void 0 : r.headers,
1525
1526
  selector: (s) => s.json()
1526
1527
  }).pipe(
1527
- N((s) => (this.logDebug("response from API: ", JSON.stringify(s)), n(s)))
1528
+ n((s) => (this.logDebug("response from API: ", JSON.stringify(s)), N(s)))
1528
1529
  )
1529
1530
  )
1530
1531
  );
@@ -1539,10 +1540,10 @@ class pe extends Re {
1539
1540
  * @returns `true` si el usuario pertenece al grupo
1540
1541
  */
1541
1542
  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) => {
1543
+ 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(
1544
+ n((r) => {
1544
1545
  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));
1546
+ return N((s = r == null ? void 0 : r.value) == null ? void 0 : s.some((l) => (l == null ? void 0 : l.id) === e));
1546
1547
  })
1547
1548
  );
1548
1549
  }
@@ -1557,10 +1558,10 @@ class pe extends Re {
1557
1558
  return this.logDebug(
1558
1559
  "Check inRole params: ",
1559
1560
  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));
1561
+ ), 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(
1562
+ n((s) => {
1563
+ var l;
1564
+ return N((l = s == null ? void 0 : s.roles) == null ? void 0 : l.includes(e));
1564
1565
  })
1565
1566
  );
1566
1567
  }
@@ -1569,8 +1570,8 @@ export {
1569
1570
  De as A,
1570
1571
  d as E,
1571
1572
  de as F,
1572
- I as a,
1573
- Pe as b,
1574
- Be as c,
1575
- pe as d
1573
+ pe as a,
1574
+ I as b,
1575
+ Pe as c,
1576
+ Be as d
1576
1577
  };