mp-front-cli 0.0.89 → 0.0.91

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,27 +1,29 @@
1
- var f = Object.defineProperty;
2
- var y = (E, t, e) => t in E ? f(E, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : E[t] = e;
3
- var L = (E, t, e) => (y(E, typeof t != "symbol" ? t + "" : t, e), e);
4
- import { LoadingHandler as g, MessageHandler as B } from "./mp-front-cli-utils-rxjs.es.js";
5
- import { RxSubjectManager as Ue } from "./mp-front-cli-utils-rxjs.es.js";
6
- import v, { t as C } from "i18next";
7
- import { t as Q } from "./index-d4f88744.js";
8
- import { CustomLogger as h } from "./mp-front-cli-logger.es.js";
9
- import { of as N, switchMap as O, forkJoin as M, catchError as I, EMPTY as S, filter as w } from "rxjs";
10
- import { CustomEncrypter as V } from "./mp-front-cli-encrypter.es.js";
11
- import { C as x, f as d } from "./custom-header-b6432556.js";
12
- import { CustomEncoder as F } from "./mp-front-cli-encoder.es.js";
13
- import { u as Y } from "./stringify-788d71a0.js";
1
+ var c = Object.defineProperty;
2
+ var n = (N, s, e) => s in N ? c(N, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : N[s] = e;
3
+ var R = (N, s, e) => (n(N, typeof s != "symbol" ? s + "" : s, e), e);
4
+ import { LoadingHandler as i, MessageHandler as I } from "./mp-front-cli-utils-rxjs.es.js";
5
+ import { RxSubjectManager as z } from "./mp-front-cli-utils-rxjs.es.js";
6
+ import { f as C } from "./index-def0b487.js";
7
+ import { S as ee } from "./index-def0b487.js";
8
+ import d, { t as m } from "i18next";
9
+ import { t as P } from "./index-d4f88744.js";
10
+ import { CustomLogger as B } from "./mp-front-cli-logger.es.js";
11
+ import { of as o, switchMap as T, forkJoin as D, catchError as U, EMPTY as g, filter as M } from "rxjs";
12
+ import { CustomEncrypter as u } from "./mp-front-cli-encrypter.es.js";
13
+ import { CustomHeader as p } from "./mp-front-cli-header.es.js";
14
+ import { CustomEncoder as y } from "./mp-front-cli-encoder.es.js";
15
+ import { a as S } from "./v5-cbd101aa.js";
14
16
  import "node-jose";
15
17
  import "crypto";
16
- const H = {
18
+ const v = {
17
19
  es: {
18
20
  translation: {
19
- ...Q
21
+ ...P
20
22
  }
21
23
  }
22
24
  };
23
- v.init({
24
- resources: H,
25
+ d.init({
26
+ resources: v,
25
27
  lng: "es",
26
28
  // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources
27
29
  // you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage
@@ -33,7 +35,7 @@ v.init({
33
35
  },
34
36
  debug: !1
35
37
  });
36
- const G = {
38
+ const Q = {
37
39
  "ENROLLMENT-INVALIDCONFIGURATION-0000": {
38
40
  code: 400,
39
41
  type: "modal",
@@ -258,7 +260,7 @@ const G = {
258
260
  title: "errors.ENROLLMENT-INVALIDTOKENTRUSTONICSUPPLIER-0031.title",
259
261
  level: "error"
260
262
  }
261
- }, m = {
263
+ }, L = {
262
264
  "MP-001": {
263
265
  code: 400,
264
266
  type: "modal",
@@ -946,273 +948,185 @@ const G = {
946
948
  type: "modal",
947
949
  level: "warning"
948
950
  },
949
- ...G
951
+ ...Q
950
952
  };
951
- class U extends h {
952
- get(t = "default", e = "NOT_FOUND") {
953
- var s, A;
954
- if (t instanceof Error)
955
- return this.logError(t.message), {
956
- ...m.internalError,
957
- title: C(m.internalError.title),
958
- message: C(m.internalError.message),
953
+ class O extends B {
954
+ get(s = "default", e = "NOT_FOUND") {
955
+ var E, l;
956
+ if (s instanceof Error)
957
+ return this.logError(s.message), {
958
+ ...L.internalError,
959
+ title: m(L.internalError.title),
960
+ message: m(L.internalError.message),
959
961
  uuid: e
960
962
  };
961
- const r = typeof t == "string" ? t : t.code ?? t.errorType;
963
+ const r = typeof s == "string" ? s : s.code ?? s.errorType;
962
964
  this.logDebug("statusCode", r);
963
- const l = typeof t == "string" ? {} : { ...t };
965
+ const t = typeof s == "string" ? {} : { ...s };
964
966
  return {
965
- ...m[r] ?? m.default,
966
- title: C(
967
- ((s = m[r]) == null ? void 0 : s.title) ?? m.default.title,
968
- l
967
+ ...L[r] ?? L.default,
968
+ title: m(
969
+ ((E = L[r]) == null ? void 0 : E.title) ?? L.default.title,
970
+ t
969
971
  ),
970
- message: C(
971
- ((A = m[r]) == null ? void 0 : A.message) ?? m.default.message,
972
- l
972
+ message: m(
973
+ ((l = L[r]) == null ? void 0 : l.message) ?? L.default.message,
974
+ t
973
975
  ),
974
976
  uuid: e
975
977
  };
976
978
  }
977
979
  }
978
- class Ne extends V {
980
+ class X extends u {
979
981
  constructor() {
980
982
  super(...arguments);
981
- L(this, "uuid", "");
982
- L(this, "session", null);
983
+ R(this, "uuid", "");
984
+ R(this, "session", null);
983
985
  }
984
986
  setSession(e) {
985
987
  this.session = e;
986
988
  }
987
989
  getSession() {
988
990
  if (!this.session)
989
- throw new U().get("SESSION_NOT_FOUND");
991
+ throw new O().get("SESSION_NOT_FOUND");
990
992
  return this.session;
991
993
  }
992
- returnData(e, r, l) {
993
- const s = this.encode(r, l);
994
- e.status(200).json(s);
994
+ returnData(e, r, t) {
995
+ const E = this.encode(r, t);
996
+ e.status(200).json(E);
995
997
  }
996
998
  returnError(e, r) {
997
- return r != null && r.uuid ? e.status(520).json(r) : e.status(520).json(new U().get(r, this.uuid));
999
+ return r != null && r.uuid ? e.status(520).json(r) : e.status(520).json(new O().get(r, this.uuid));
998
1000
  }
999
1001
  get(e) {
1000
- return this.logDebug("get ApiMiddleware"), (r, l) => {
1001
- var s;
1002
- this.logDebug("return ApiMiddleware"), this.uuid = (s = r == null ? void 0 : r.body) == null ? void 0 : s.uuid, N(r).pipe(
1003
- O(
1004
- (A) => M({
1005
- params: N(this.decode(A.body)),
1006
- headers: N(A.headers)
1002
+ return this.logDebug("get ApiMiddleware"), (r, t) => {
1003
+ var E;
1004
+ this.logDebug("return ApiMiddleware"), this.uuid = (E = r == null ? void 0 : r.body) == null ? void 0 : E.uuid, o(r).pipe(
1005
+ T(
1006
+ (l) => D({
1007
+ params: o(this.decode(l.body)),
1008
+ headers: o(l.headers)
1007
1009
  })
1008
1010
  ),
1009
- O(
1010
- ({ params: A, headers: a }) => M({
1011
- response: e(A, this.uuid, a),
1012
- headers: N(a),
1013
- params: N(A)
1011
+ T(
1012
+ ({ params: l, headers: a }) => D({
1013
+ response: e(l, this.uuid, a),
1014
+ headers: o(a),
1015
+ params: o(l)
1014
1016
  })
1015
1017
  ),
1016
- O(({ params: A, response: a, headers: o }) => (this.logDebug(
1017
- `ApiMiddleware \x1B[37m <URL>: \x1B[33m ${r.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(o)} \x1B[37m <UUID> \x1B[33m ${r.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(A)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(a)}`
1018
- ), N(a))),
1019
- I((A) => {
1018
+ T(({ params: l, response: a, headers: A }) => (this.logDebug(
1019
+ `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(l)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(a)}`
1020
+ ), o(a))),
1021
+ U((l) => {
1020
1022
  var a;
1021
1023
  return this.logError(
1022
- `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(A)}`
1023
- ), this.returnError(l, A), S;
1024
+ `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(l)}`
1025
+ ), this.returnError(t, l), g;
1024
1026
  })
1025
1027
  ).subscribe({
1026
- next: (A) => {
1027
- this.logDebug("ApiMiddleware subscribe next", JSON.stringify(A)), this.returnData(l, A, this.uuid);
1028
+ next: (l) => {
1029
+ this.logDebug("ApiMiddleware subscribe next", JSON.stringify(l)), this.returnData(t, l, this.uuid);
1028
1030
  }
1029
1031
  });
1030
1032
  };
1031
1033
  }
1032
1034
  }
1033
- const _ = process.env.ID_FRONT ?? "NOT_AVAILABLE";
1034
- class Le extends x {
1035
- constructor(e, r, l = {}) {
1036
- super(l);
1037
- L(this, "apiUrl");
1038
- L(this, "method");
1035
+ const w = process.env.ID_FRONT ?? "NOT_AVAILABLE";
1036
+ class W extends p {
1037
+ constructor(e, r, t = {}) {
1038
+ super(t);
1039
+ R(this, "apiUrl");
1040
+ R(this, "method");
1039
1041
  this.apiUrl = e, this.method = r ?? "POST";
1040
1042
  }
1041
1043
  errorHandler(e, r) {
1042
1044
  if (e != null && e.errors)
1043
- throw new U().get(e.errors[0], r);
1045
+ throw new O().get(e.errors[0], r);
1044
1046
  return !(e != null && e.errors);
1045
1047
  }
1046
1048
  formatParams(e) {
1047
1049
  return JSON.stringify({
1048
1050
  data: {
1049
- type: _,
1051
+ type: w,
1050
1052
  attributes: e
1051
1053
  }
1052
1054
  });
1053
1055
  }
1054
1056
  fetchData(e = {}, r) {
1055
1057
  return this.getHeaders().pipe(
1056
- O(
1057
- (l) => d(
1058
+ T(
1059
+ (t) => C(
1058
1060
  this.apiUrl,
1059
1061
  {
1060
1062
  method: "POST",
1061
- headers: l,
1063
+ headers: t,
1062
1064
  body: this.formatParams(e),
1063
- selector: (s) => s.json()
1065
+ selector: (E) => E.json()
1064
1066
  }
1065
1067
  ).pipe(
1066
- I((s) => {
1067
- throw this.logError(JSON.stringify(s)), this.logError(
1068
+ U((E) => {
1069
+ throw this.logError(JSON.stringify(E)), this.logError(
1068
1070
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1069
- l
1071
+ t
1070
1072
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1071
1073
  this.formatParams(e)
1072
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
1073
- ), new U().get("default", r);
1074
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1075
+ ), new O().get("default", r);
1074
1076
  }),
1075
- O((s) => (this.logDebug(
1077
+ T((E) => (this.logDebug(
1076
1078
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1077
- l
1079
+ t
1078
1080
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1079
1081
  this.formatParams(e)
1080
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
1081
- ), N(s)))
1082
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1083
+ ), o(E)))
1082
1084
  )
1083
1085
  ),
1084
- w((l) => this.errorHandler(l, r))
1086
+ M((t) => this.errorHandler(t, r))
1085
1087
  );
1086
1088
  }
1087
1089
  fetchCustomData(e = {}, r) {
1088
1090
  return this.getHeaders().pipe(
1089
- O(
1090
- (l) => d(this.apiUrl, {
1091
+ T(
1092
+ (t) => C(this.apiUrl, {
1091
1093
  method: this.method,
1092
- headers: l,
1094
+ headers: t,
1093
1095
  body: this.method === "GET" ? null : JSON.stringify(e),
1094
- selector: (s) => s.json()
1096
+ selector: (E) => E.json()
1095
1097
  }).pipe(
1096
- I((s) => {
1097
- throw this.logError(JSON.stringify(s)), this.logError(
1098
+ U((E) => {
1099
+ throw this.logError(JSON.stringify(E)), this.logError(
1098
1100
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1099
- l
1101
+ t
1100
1102
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1101
1103
  this.formatParams(e)
1102
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
1103
- ), new U().get("default", r);
1104
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1105
+ ), new O().get("default", r);
1104
1106
  }),
1105
- O((s) => (this.logDebug(
1107
+ T((E) => (this.logDebug(
1106
1108
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m \x1B[37m <METHOD>: \x1B[33m ${this.method} <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1107
- l
1109
+ t
1108
1110
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1109
1111
  e
1110
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
1111
- ), N(s)))
1112
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1113
+ ), o(E)))
1112
1114
  )
1113
1115
  )
1114
1116
  );
1115
1117
  }
1116
1118
  }
1117
- const J = /^(?:[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;
1118
- function $(E) {
1119
- return typeof E == "string" && J.test(E);
1120
- }
1121
- function K(E) {
1122
- if (!$(E))
1123
- throw TypeError("Invalid UUID");
1124
- let t;
1125
- const e = new Uint8Array(16);
1126
- 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;
1127
- }
1128
- function b(E) {
1129
- E = unescape(encodeURIComponent(E));
1130
- const t = [];
1131
- for (let e = 0; e < E.length; ++e)
1132
- t.push(E.charCodeAt(e));
1133
- return t;
1134
- }
1135
- const X = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", W = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
1136
- function j(E, t, e) {
1137
- function r(l, s, A, a) {
1138
- var o;
1139
- if (typeof l == "string" && (l = b(l)), typeof s == "string" && (s = K(s)), ((o = s) === null || o === void 0 ? void 0 : o.length) !== 16)
1140
- throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
1141
- let T = new Uint8Array(16 + l.length);
1142
- if (T.set(s), T.set(l, s.length), T = e(T), T[6] = T[6] & 15 | t, T[8] = T[8] & 63 | 128, A) {
1143
- a = a || 0;
1144
- for (let i = 0; i < 16; ++i)
1145
- A[a + i] = T[i];
1146
- return A;
1147
- }
1148
- return Y(T);
1149
- }
1150
- try {
1151
- r.name = E;
1152
- } catch {
1153
- }
1154
- return r.DNS = X, r.URL = W, r;
1155
- }
1156
- function Z(E, t, e, r) {
1157
- switch (E) {
1158
- case 0:
1159
- return t & e ^ ~t & r;
1160
- case 1:
1161
- return t ^ e ^ r;
1162
- case 2:
1163
- return t & e ^ t & r ^ e & r;
1164
- case 3:
1165
- return t ^ e ^ r;
1166
- }
1167
- }
1168
- function n(E, t) {
1169
- return E << t | E >>> 32 - t;
1170
- }
1171
- function k(E) {
1172
- const t = [1518500249, 1859775393, 2400959708, 3395469782], e = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
1173
- if (typeof E == "string") {
1174
- const A = unescape(encodeURIComponent(E));
1175
- E = [];
1176
- for (let a = 0; a < A.length; ++a)
1177
- E.push(A.charCodeAt(a));
1178
- } else
1179
- Array.isArray(E) || (E = Array.prototype.slice.call(E));
1180
- E.push(128);
1181
- const r = E.length / 4 + 2, l = Math.ceil(r / 16), s = new Array(l);
1182
- for (let A = 0; A < l; ++A) {
1183
- const a = new Uint32Array(16);
1184
- for (let o = 0; o < 16; ++o)
1185
- a[o] = E[A * 64 + o * 4] << 24 | E[A * 64 + o * 4 + 1] << 16 | E[A * 64 + o * 4 + 2] << 8 | E[A * 64 + o * 4 + 3];
1186
- s[A] = a;
1187
- }
1188
- s[l - 1][14] = (E.length - 1) * 8 / Math.pow(2, 32), s[l - 1][14] = Math.floor(s[l - 1][14]), s[l - 1][15] = (E.length - 1) * 8 & 4294967295;
1189
- for (let A = 0; A < l; ++A) {
1190
- const a = new Uint32Array(80);
1191
- for (let R = 0; R < 16; ++R)
1192
- a[R] = s[A][R];
1193
- for (let R = 16; R < 80; ++R)
1194
- a[R] = n(a[R - 3] ^ a[R - 8] ^ a[R - 14] ^ a[R - 16], 1);
1195
- let o = e[0], T = e[1], i = e[2], c = e[3], D = e[4];
1196
- for (let R = 0; R < 80; ++R) {
1197
- const P = Math.floor(R / 20), u = n(o, 5) + Z(P, T, i, c) + D + t[P] + a[R] >>> 0;
1198
- D = c, c = i, i = n(T, 30) >>> 0, T = o, o = u;
1199
- }
1200
- e[0] = e[0] + o >>> 0, e[1] = e[1] + T >>> 0, e[2] = e[2] + i >>> 0, e[3] = e[3] + c >>> 0, e[4] = e[4] + D >>> 0;
1201
- }
1202
- 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];
1203
- }
1204
- const z = j("v5", 80, k), p = z;
1205
- class Oe extends F {
1206
- constructor(e, r = "POST", l = {}) {
1119
+ class j extends y {
1120
+ constructor(e, r = "POST", t = {}) {
1207
1121
  super();
1208
- L(this, "apiUrl");
1209
- L(this, "method");
1210
- L(this, "headers");
1211
- L(this, "isLoadingEnabled", !0);
1212
- L(this, "errorResponse");
1122
+ R(this, "apiUrl");
1123
+ R(this, "method");
1124
+ R(this, "headers");
1125
+ R(this, "isLoadingEnabled", !0);
1126
+ R(this, "errorResponse");
1213
1127
  this.apiUrl = e, this.method = r, this.headers = {
1214
1128
  "Content-Type": "application/json",
1215
- ...l
1129
+ ...t
1216
1130
  };
1217
1131
  }
1218
1132
  setIsLoadingEnabled(e) {
@@ -1222,36 +1136,37 @@ class Oe extends F {
1222
1136
  this.errorResponse = e;
1223
1137
  }
1224
1138
  fetchData(e = {}) {
1225
- const r = (/* @__PURE__ */ new Date()).toISOString(), l = p(r, p.URL), s = this.encode({ ...e }, l);
1226
- g.getInstance().setSubject(this.isLoadingEnabled);
1139
+ const r = (/* @__PURE__ */ new Date()).toISOString(), t = S(r, S.URL), E = this.encode({ ...e }, t);
1140
+ i.getInstance().setSubject(this.isLoadingEnabled);
1227
1141
  const a = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
1228
- return d(this.apiUrl, {
1142
+ return C(this.apiUrl, {
1229
1143
  method: this.method,
1230
1144
  headers: { ...this.headers, flow: a },
1231
- body: s,
1232
- selector: (o) => o.json()
1145
+ body: E,
1146
+ selector: (A) => A.json()
1233
1147
  }).pipe(
1234
- O((o) => N(this.decode(o))),
1235
- O((o) => o.code && (o.type === "modal" || o.type === "message") ? (this.logError(
1236
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(o)}`
1237
- ), g.getInstance().setSubject(!1), B.getInstance().setSubject(o), this.errorResponse ? N(this.errorResponse) : S) : N(o)),
1238
- O((o) => (g.getInstance().setSubject(!1), this.logDebug(
1239
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(o)}`
1240
- ), N(o))),
1241
- I((o) => (this.logError(
1242
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(o)}`
1243
- ), g.getInstance().setSubject(!1), B.getInstance().setSubject(
1244
- new U().get(o, l)
1245
- ), this.errorResponse ? N(this.errorResponse) : S))
1148
+ T((A) => o(this.decode(A))),
1149
+ T((A) => A.code && (A.type === "modal" || A.type === "message") ? (this.logError(
1150
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(A)}`
1151
+ ), i.getInstance().setSubject(!1), I.getInstance().setSubject(A), this.errorResponse ? o(this.errorResponse) : g) : o(A)),
1152
+ T((A) => (i.getInstance().setSubject(!1), this.logDebug(
1153
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(A)}`
1154
+ ), o(A))),
1155
+ U((A) => (this.logError(
1156
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(A)}`
1157
+ ), i.getInstance().setSubject(!1), I.getInstance().setSubject(
1158
+ new O().get(A, t)
1159
+ ), this.errorResponse ? o(this.errorResponse) : g))
1246
1160
  );
1247
1161
  }
1248
1162
  }
1249
1163
  export {
1250
- Ne as ApiMiddleware,
1251
- U as ErrorCatalog,
1252
- Le as FetchServiceBE,
1253
- Oe as FetchServiceFE,
1254
- g as LoadingHandler,
1255
- B as MessageHandler,
1256
- Ue as RxSubjectManager
1164
+ X as ApiMiddleware,
1165
+ O as ErrorCatalog,
1166
+ W as FetchServiceBE,
1167
+ j as FetchServiceFE,
1168
+ i as LoadingHandler,
1169
+ I as MessageHandler,
1170
+ z as RxSubjectManager,
1171
+ ee as ServiceToken
1257
1172
  };
@@ -1,10 +1,34 @@
1
- import "rxjs";
2
- import "./mp-front-cli-encrypter.es.js";
3
- import { C as s } from "./custom-header-b6432556.js";
1
+ var n = Object.defineProperty;
2
+ var p = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var i = (r, t, e) => (p(r, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import { switchMap as a, of as s } from "rxjs";
5
+ import { CustomEncrypter as d } from "./mp-front-cli-encrypter.es.js";
6
+ import { S as m } from "./index-def0b487.js";
4
7
  import "node-jose";
5
8
  import "crypto";
6
9
  import "./mp-front-cli-encoder.es.js";
7
10
  import "./mp-front-cli-logger.es.js";
11
+ class H extends d {
12
+ constructor(e = {}) {
13
+ super();
14
+ i(this, "headers");
15
+ this.headers = {
16
+ Accept: "application/json",
17
+ "Content-Type": "application/vnd.api+json",
18
+ ...e
19
+ };
20
+ }
21
+ addTokenBackend(e) {
22
+ return this.logDebug("addTokenBackend CustomHeader", JSON.stringify(e)), new m().get().pipe(
23
+ a((o) => s({ ...e, Authorization: `Bearer ${o}` }))
24
+ );
25
+ }
26
+ getHeaders(e = {}) {
27
+ return this.logDebug("getHeaders CustomHeader"), this.addTokenBackend(e).pipe(
28
+ a((o) => s({ ...o, ...this.headers }))
29
+ );
30
+ }
31
+ }
8
32
  export {
9
- s as CustomHeader
33
+ H as CustomHeader
10
34
  };
@@ -0,0 +1,6 @@
1
+ import { S as m } from "./index-def0b487.js";
2
+ import "rxjs";
3
+ import "./mp-front-cli-logger.es.js";
4
+ export {
5
+ m as ServiceToken
6
+ };
@@ -0,0 +1,98 @@
1
+ const A = /^(?:[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;
2
+ function I(f) {
3
+ return typeof f == "string" && A.test(f);
4
+ }
5
+ const o = [];
6
+ for (let f = 0; f < 256; ++f)
7
+ o.push((f + 256).toString(16).slice(1));
8
+ function w(f, t = 0) {
9
+ return o[f[t + 0]] + o[f[t + 1]] + o[f[t + 2]] + o[f[t + 3]] + "-" + o[f[t + 4]] + o[f[t + 5]] + "-" + o[f[t + 6]] + o[f[t + 7]] + "-" + o[f[t + 8]] + o[f[t + 9]] + "-" + o[f[t + 10]] + o[f[t + 11]] + o[f[t + 12]] + o[f[t + 13]] + o[f[t + 14]] + o[f[t + 15]];
10
+ }
11
+ function v(f) {
12
+ if (!I(f))
13
+ throw TypeError("Invalid UUID");
14
+ let t;
15
+ const n = new Uint8Array(16);
16
+ return n[0] = (t = parseInt(f.slice(0, 8), 16)) >>> 24, n[1] = t >>> 16 & 255, n[2] = t >>> 8 & 255, n[3] = t & 255, n[4] = (t = parseInt(f.slice(9, 13), 16)) >>> 8, n[5] = t & 255, n[6] = (t = parseInt(f.slice(14, 18), 16)) >>> 8, n[7] = t & 255, n[8] = (t = parseInt(f.slice(19, 23), 16)) >>> 8, n[9] = t & 255, n[10] = (t = parseInt(f.slice(24, 36), 16)) / 1099511627776 & 255, n[11] = t / 4294967296 & 255, n[12] = t >>> 24 & 255, n[13] = t >>> 16 & 255, n[14] = t >>> 8 & 255, n[15] = t & 255, n;
17
+ }
18
+ function R(f) {
19
+ f = unescape(encodeURIComponent(f));
20
+ const t = [];
21
+ for (let n = 0; n < f.length; ++n)
22
+ t.push(f.charCodeAt(n));
23
+ return t;
24
+ }
25
+ const T = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", M = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
26
+ function y(f, t, n) {
27
+ function s(l, a, e, r) {
28
+ var i;
29
+ if (typeof l == "string" && (l = R(l)), typeof a == "string" && (a = v(a)), ((i = a) === null || i === void 0 ? void 0 : i.length) !== 16)
30
+ throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
31
+ let x = new Uint8Array(16 + l.length);
32
+ if (x.set(a), x.set(l, a.length), x = n(x), x[6] = x[6] & 15 | t, x[8] = x[8] & 63 | 128, e) {
33
+ r = r || 0;
34
+ for (let h = 0; h < 16; ++h)
35
+ e[r + h] = x[h];
36
+ return e;
37
+ }
38
+ return w(x);
39
+ }
40
+ try {
41
+ s.name = f;
42
+ } catch {
43
+ }
44
+ return s.DNS = T, s.URL = M, s;
45
+ }
46
+ function C(f, t, n, s) {
47
+ switch (f) {
48
+ case 0:
49
+ return t & n ^ ~t & s;
50
+ case 1:
51
+ return t ^ n ^ s;
52
+ case 2:
53
+ return t & n ^ t & s ^ n & s;
54
+ case 3:
55
+ return t ^ n ^ s;
56
+ }
57
+ }
58
+ function g(f, t) {
59
+ return f << t | f >>> 32 - t;
60
+ }
61
+ function D(f) {
62
+ const t = [1518500249, 1859775393, 2400959708, 3395469782], n = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
63
+ if (typeof f == "string") {
64
+ const e = unescape(encodeURIComponent(f));
65
+ f = [];
66
+ for (let r = 0; r < e.length; ++r)
67
+ f.push(e.charCodeAt(r));
68
+ } else
69
+ Array.isArray(f) || (f = Array.prototype.slice.call(f));
70
+ f.push(128);
71
+ const s = f.length / 4 + 2, l = Math.ceil(s / 16), a = new Array(l);
72
+ for (let e = 0; e < l; ++e) {
73
+ const r = new Uint32Array(16);
74
+ for (let i = 0; i < 16; ++i)
75
+ r[i] = f[e * 64 + i * 4] << 24 | f[e * 64 + i * 4 + 1] << 16 | f[e * 64 + i * 4 + 2] << 8 | f[e * 64 + i * 4 + 3];
76
+ a[e] = r;
77
+ }
78
+ a[l - 1][14] = (f.length - 1) * 8 / Math.pow(2, 32), a[l - 1][14] = Math.floor(a[l - 1][14]), a[l - 1][15] = (f.length - 1) * 8 & 4294967295;
79
+ for (let e = 0; e < l; ++e) {
80
+ const r = new Uint32Array(80);
81
+ for (let c = 0; c < 16; ++c)
82
+ r[c] = a[e][c];
83
+ for (let c = 16; c < 80; ++c)
84
+ r[c] = g(r[c - 3] ^ r[c - 8] ^ r[c - 14] ^ r[c - 16], 1);
85
+ let i = n[0], x = n[1], h = n[2], p = n[3], d = n[4];
86
+ for (let c = 0; c < 80; ++c) {
87
+ const u = Math.floor(c / 20), U = g(i, 5) + C(u, x, h, p) + d + t[u] + r[c] >>> 0;
88
+ d = p, p = h, h = g(x, 30) >>> 0, x = i, i = U;
89
+ }
90
+ n[0] = n[0] + i >>> 0, n[1] = n[1] + x >>> 0, n[2] = n[2] + h >>> 0, n[3] = n[3] + p >>> 0, n[4] = n[4] + d >>> 0;
91
+ }
92
+ return [n[0] >> 24 & 255, n[0] >> 16 & 255, n[0] >> 8 & 255, n[0] & 255, n[1] >> 24 & 255, n[1] >> 16 & 255, n[1] >> 8 & 255, n[1] & 255, n[2] >> 24 & 255, n[2] >> 16 & 255, n[2] >> 8 & 255, n[2] & 255, n[3] >> 24 & 255, n[3] >> 16 & 255, n[3] >> 8 & 255, n[3] & 255, n[4] >> 24 & 255, n[4] >> 16 & 255, n[4] >> 8 & 255, n[4] & 255];
93
+ }
94
+ const E = y("v5", 80, D), N = E;
95
+ export {
96
+ N as a,
97
+ w as u
98
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-front-cli",
3
- "version": "0.0.89",
3
+ "version": "0.0.91",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -51,6 +51,10 @@
51
51
  "types": "./dist/core/utils/custom-adapter.d.ts",
52
52
  "import": "./dist/mp-front-cli-adapter.es.js"
53
53
  },
54
+ "./core/services": {
55
+ "types": "./dist/core/services/index.d.ts",
56
+ "import": "./dist/mp-front-cli-services.es.js"
57
+ },
54
58
  "./locale": {
55
59
  "types": "./dist/lang/index.d.ts",
56
60
  "import": "./dist/mp-front-cli-locale.es.js"