mp-front-cli 0.0.102 → 0.0.104

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 +1 @@
1
- {"version":3,"file":"error-catalog.d.ts","sourceRoot":"","sources":["../../../src/core/errors/error-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AA0vBrD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,GAAG,CACD,KAAK,GAAE,MAAM,GAAG,KAAK,GAAG,QAAoB,EAC5C,IAAI,GAAE,MAAoB;;;;;;;;;;;CA8B7B"}
1
+ {"version":3,"file":"error-catalog.d.ts","sourceRoot":"","sources":["../../../src/core/errors/error-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAkwBrD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,GAAG,CACD,KAAK,GAAE,MAAM,GAAG,KAAK,GAAG,QAAoB,EAC5C,IAAI,GAAE,MAAoB;;;;;;;;;;;CA8B7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"custom-adapter.d.ts","sourceRoot":"","sources":["../../../src/core/utils/custom-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,OAAO,EAIR,MAAM,oBAAoB,CAAA;AAW3B,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,cAAc,EAAE,qBAU5B,CAAA;AAgBD,wBAAgB,cAAc,CAC5B,OAAO,GAAE,qBAAgE,GACxE,OAAO,CAmRT"}
1
+ {"version":3,"file":"custom-adapter.d.ts","sourceRoot":"","sources":["../../../src/core/utils/custom-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,OAAO,EAIR,MAAM,oBAAoB,CAAA;AAW3B,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,cAAc,EAAE,qBAU5B,CAAA;AAgBD,wBAAgB,cAAc,CAC5B,OAAO,GAAE,qBAAgE,GACxE,OAAO,CAsRT"}
@@ -0,0 +1,11 @@
1
+ import s from "ioredis";
2
+ const o = process.env.REDIS_HOST, S = process.env.REDIS_PORT, e = process.env.REDIS_USER, R = process.env.REDIS_PASS, t = new s({
3
+ host: o,
4
+ port: S,
5
+ username: e,
6
+ password: R,
7
+ tls: {}
8
+ });
9
+ export {
10
+ t as C
11
+ };
@@ -565,6 +565,10 @@ const e = {
565
565
  title: "Teléfono invalido",
566
566
  message: "Ingrese un número valido."
567
567
  },
568
+ "PERSONALREFERENCE-DELETEREFERENCEEXCEPTION-001": {
569
+ title: "Eliminar excepción de referencia",
570
+ message: "Ocurrió un error al eliminar la referencia."
571
+ },
568
572
  //PAYMENTS
569
573
  "SALES-SUMMARY-GENERIC-ERROR-001": {
570
574
  title: "Ocurrió un error resumen de venta",
@@ -16,6 +16,10 @@ declare const translation: {
16
16
  title: string;
17
17
  message: string;
18
18
  };
19
+ "PERSONALREFERENCE-DELETEREFERENCEEXCEPTION-001": {
20
+ title: string;
21
+ message: string;
22
+ };
19
23
  "SALES-SUMMARY-GENERIC-ERROR-001": {
20
24
  title: string;
21
25
  message: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lang/common/errors/es_MX/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4PhB,CAAA;AAED,eAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lang/common/errors/es_MX/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgQhB,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -1,67 +1,31 @@
1
- var W = Object.defineProperty;
2
- var Y = (a, s, r) => s in a ? W(a, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[s] = r;
3
- var A = (a, s, r) => (Y(a, typeof s != "symbol" ? s + "" : s, r), r);
4
- import { C as R, a as ee } from "./custom-cache-8c806250.js";
5
- import { CustomEncrypter as te } from "./mp-front-cli-encrypter.es.js";
6
- import { u as ne, a as se } from "./v5-cbd101aa.js";
1
+ import { C as Z } from "./custom-redis-bee66564.js";
2
+ import { u as $ } from "./stringify-788d71a0.js";
7
3
  import "ioredis";
8
- import "node-jose";
9
- import "crypto";
10
- import "./mp-front-cli-encoder.es.js";
11
- import "./mp-front-cli-logger.es.js";
12
- let K;
13
- const re = new Uint8Array(16);
14
- function ie() {
15
- if (!K && (K = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !K))
4
+ let x;
5
+ const v = new Uint8Array(16);
6
+ function C() {
7
+ if (!x && (x = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !x))
16
8
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
17
- return K(re);
9
+ return x(v);
18
10
  }
19
- const ae = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), B = {
20
- randomUUID: ae
11
+ const G = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), A = {
12
+ randomUUID: G
21
13
  };
22
- function oe(a, s, r) {
23
- if (B.randomUUID && !s && !a)
24
- return B.randomUUID();
25
- a = a || {};
26
- const i = a.random || (a.rng || ie)();
14
+ function H(c, s, r) {
15
+ if (A.randomUUID && !s && !c)
16
+ return A.randomUUID();
17
+ c = c || {};
18
+ const i = c.random || (c.rng || C)();
27
19
  if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, s) {
28
20
  r = r || 0;
29
- for (let y = 0; y < 16; ++y)
30
- s[r + y] = i[y];
21
+ for (let u = 0; u < 16; ++u)
22
+ s[r + u] = i[u];
31
23
  return s;
32
24
  }
33
- return ne(i);
25
+ return $(i);
34
26
  }
35
- const ce = process.env.TIMEOUT_SESSION_MINUTES, ue = "619abad7-0dea-46c5-aa49-fc1ec872a684", de = "PF:TERMINAL:", O = "TERMINAL";
36
- class ye extends te {
37
- constructor() {
38
- super(...arguments);
39
- A(this, "redisCacheHandler", new R());
40
- A(this, "getIdApi", (r) => {
41
- const i = se(r, ue);
42
- return `${de}${i}`;
43
- });
44
- }
45
- async saveTerminalData(r, i) {
46
- return this.redisCacheHandler.setRedisState({
47
- idApi: this.getIdApi(r),
48
- idData: O,
49
- body: i,
50
- expire: ce
51
- });
52
- }
53
- async getTerminalData(r) {
54
- return this.redisCacheHandler.getRedisState(this.getIdApi(r), O).then(({ data: i }) => (this.logDebug("getTerminal", JSON.stringify(i)), i)).catch((i) => (this.logError("Error getTerminal", JSON.stringify(i)), null));
55
- }
56
- async deleteTerminalData(r) {
57
- return this.redisCacheHandler.deleteRedisState(
58
- this.getIdApi(r),
59
- O
60
- );
61
- }
62
- }
63
- const d = process.env.PREFIX_LOGIN, b = process.env.TIMEOUT_SESSION_MINUTES, c = new R(), le = {
64
- baseKeyPrefix: `${d}:`,
27
+ const L = process.env.PREFIX_LOGIN, B = process.env.TIMEOUT_SESSION_MINUTES, q = {
28
+ baseKeyPrefix: `${L}:`,
65
29
  userKeyPrefix: "user:",
66
30
  accountKeyPrefix: "account:",
67
31
  accountByUserIdPrefix: "account:user:",
@@ -69,153 +33,145 @@ const d = process.env.PREFIX_LOGIN, b = process.env.TIMEOUT_SESSION_MINUTES, c =
69
33
  sessionByUserIdPrefix: "session:user:",
70
34
  userByEmailKeyPrefix: "user:email:",
71
35
  verificationKeyPrefix: "verification:",
72
- expire: b * 60
73
- }, fe = (a) => {
74
- for (const s in a)
36
+ expire: B * 60
37
+ }, z = (c) => {
38
+ for (const s in c)
75
39
  return !1;
76
40
  return !0;
77
- }, we = /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/, me = (a) => a && we.test(a) && !Number.isNaN(Date.parse(a));
78
- function he(a = { expire: b * 60 }) {
79
- const s = ee, r = {
80
- ...le,
81
- ...a
82
- }, i = r.baseKeyPrefix || "", y = i + r.userKeyPrefix, k = i + r.userByEmailKeyPrefix, C = i + r.accountKeyPrefix, M = i + r.accountByUserIdPrefix, V = i + r.sessionKeyPrefix, _ = i + r.sessionByUserIdPrefix, j = i + r.verificationKeyPrefix, U = (e) => k + e, x = (e) => y + e, S = (e) => C + e, I = (e) => M + e, w = (e, t) => `${t}:${e}`, E = (e) => V + e, g = (e) => _ + e, P = (e) => j + e, p = async (e, t) => {
83
- const n = Object.entries(t).reduce((o, [f, u]) => (o[f] = u instanceof Date ? u.toISOString() : u, o), {});
41
+ }, J = /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/, Q = (c) => c && J.test(c) && !Number.isNaN(Date.parse(c));
42
+ function te(c = { expire: B * 60 }) {
43
+ const s = Z, r = {
44
+ ...q,
45
+ ...c
46
+ }, i = r.baseKeyPrefix || "", u = i + r.userKeyPrefix, b = i + r.userByEmailKeyPrefix, k = i + r.accountKeyPrefix, T = i + r.accountByUserIdPrefix, D = i + r.sessionKeyPrefix, V = i + r.sessionByUserIdPrefix, j = i + r.verificationKeyPrefix, U = (e) => b + e, p = (e) => u + e, K = (e) => k + e, f = (e) => T + e, m = (e, t) => `${t}:${e}`, I = (e) => D + e, l = (e) => V + e, g = (e) => j + e, w = async (e, t) => {
47
+ const n = Object.entries(t).reduce((o, [S, a]) => (o[S] = a instanceof Date ? a.toISOString() : a, o), {});
84
48
  await s.hset(e, n), await s.expire(e, r.expire);
85
- }, m = async (e) => {
49
+ }, y = async (e) => {
86
50
  const t = await s.hgetall(e);
87
- return !t || fe(t) ? null : Object.entries(t).reduce((o, [f, u]) => (o[f] = me(u) ? new Date(u) : u, o), {});
88
- }, D = async (e, t) => (await p(x(e), t), t.email && await s.set(
51
+ return !t || z(t) ? null : Object.entries(t).reduce((o, [S, a]) => (o[S] = Q(a) ? new Date(a) : a, o), {});
52
+ }, E = async (e, t) => (await w(p(e), t), t.email && await s.set(
89
53
  U(t.email),
90
54
  e,
91
55
  "EX",
92
56
  r.expire
93
- ), t), l = async (e) => {
94
- const t = await m(x(e));
57
+ ), t), d = async (e) => {
58
+ const t = await y(p(e));
95
59
  return t ? { ...t } : null;
96
- }, H = async (e, t) => {
97
- const n = S(e);
98
- await p(n, t), await s.set(
99
- I(t.userId),
60
+ }, N = async (e, t) => {
61
+ const n = K(e);
62
+ await w(n, t), await s.set(
63
+ f(t.userId),
100
64
  n,
101
65
  "EX",
102
66
  r.expire
103
67
  );
104
- }, T = async (e) => {
105
- const t = await m(S(e));
68
+ }, R = async (e) => {
69
+ const t = await y(K(e));
106
70
  return t ? { ...t } : null;
107
- }, G = async (e) => {
108
- const t = S(e), n = await m(t);
71
+ }, h = async (e) => {
72
+ const t = K(e), n = await y(t);
109
73
  if (!n)
110
74
  return null;
111
- await s.hdel(t), await s.del(I(n.userId));
112
- }, N = async (e, t) => {
113
- const n = E(e);
114
- return await p(n, t), await s.set(
115
- g(t.userId),
75
+ await s.hdel(t), await s.del(f(n.userId));
76
+ }, O = async (e, t) => {
77
+ const n = I(e);
78
+ return await w(n, t), await s.set(
79
+ l(t.userId),
116
80
  n,
117
81
  "EX",
118
82
  r.expire
119
83
  ), t;
120
- }, h = async (e) => {
121
- const t = await m(E(e));
84
+ }, P = async (e) => {
85
+ const t = await y(I(e));
122
86
  return t ? {
123
87
  id: t.id,
124
88
  ...t
125
89
  } : null;
126
- }, X = async (e) => {
127
- const t = await h(e);
90
+ }, _ = async (e) => {
91
+ const t = await P(e);
128
92
  if (!t)
129
93
  return null;
130
- const n = E(e);
131
- await s.del(n), await s.del(g(t.userId));
132
- }, F = async (e, t) => {
133
- const n = P(e);
134
- return await p(n, t), t;
135
- }, L = async (e) => {
136
- const t = P(e), n = await m(t);
94
+ const n = I(e);
95
+ await s.del(n), await s.del(l(t.userId));
96
+ }, X = async (e, t) => {
97
+ const n = g(e);
98
+ return await w(n, t), t;
99
+ }, M = async (e) => {
100
+ const t = g(e), n = await y(t);
137
101
  return n ? { identifier: n.identifier, ...n } : null;
138
- }, Z = async (e) => {
139
- const t = P(e);
102
+ }, F = async (e) => {
103
+ const t = g(e);
140
104
  await s.del(t);
141
- }, v = async (e, t) => {
142
- const n = await T(w(e, t)), o = await c.simpleGet(
143
- `${d}:account:user:${n == null ? void 0 : n.userId}`
144
- ) ?? "", f = `${d}:user:${n == null ? void 0 : n.userId}`, u = await c.simpleHGet(f, "email") ?? "", $ = await c.simpleHGet(o, "cveUsuario") ?? "", J = `${d}:account:user:${n == null ? void 0 : n.userId}`, z = `${d}:session:user:${n == null ? void 0 : n.userId}`, q = await c.simpleGet(
145
- `${d}:session:user:${n == null ? void 0 : n.userId}`
146
- ) ?? "", Q = `${d}:user:email:${u}`;
147
- await c.deleteKey(o), await c.deleteKey(J), await c.deleteKey(z), await c.deleteKey(q), await c.deleteKey(Q), await c.deleteKey(f), await c.deleteKey($), await new ye().deleteTerminalData($);
148
105
  };
149
106
  return {
150
107
  async createUser(e) {
151
- const t = oe();
152
- return await D(t, { ...e, id: t });
108
+ const t = H();
109
+ return await E(t, { ...e, id: t });
153
110
  },
154
- getUser: l,
111
+ getUser: d,
155
112
  async getUserByEmail(e) {
156
113
  const t = await s.get(U(e));
157
- return t ? await l(t) : null;
114
+ return t ? await d(t) : null;
158
115
  },
159
116
  async getUserByAccount({ providerAccountId: e, provider: t }) {
160
- const n = await T(
161
- w(e, t)
117
+ const n = await R(
118
+ m(e, t)
162
119
  );
163
- console.log("🚀 ~ getUserByAccount ~ account:", n), n && await v(e, t);
164
- const o = await T(
165
- w(e, t)
166
- );
167
- return console.log("🚀 ~ getUserByAccount ~ account:", o), o ? await l(o.userId) : null;
120
+ return n ? await d(n.userId) : null;
168
121
  },
169
122
  async updateUser(e) {
170
- const t = e.id, n = await l(t);
171
- return await D(t, { ...n, ...e });
123
+ const t = e.id, n = await d(t);
124
+ return await E(t, { ...n, ...e });
172
125
  },
173
126
  async deleteUser(e) {
174
- const t = await l(e);
127
+ const t = await d(e);
175
128
  if (!t)
176
129
  return null;
177
- const n = await s.get(I(e)), o = await s.get(g(e));
130
+ const n = await s.get(f(e)), o = await s.get(l(e));
178
131
  await s.del(
179
132
  U(t.email),
180
- I(e),
181
- g(e)
182
- ), o && await s.del(o), n && await s.del(n), await s.del(x(e));
133
+ f(e),
134
+ l(e)
135
+ ), o && await s.del(o), n && await s.del(n), await s.del(p(e));
183
136
  },
184
137
  async linkAccount(e) {
185
- const t = w(e.providerAccountId, e.provider);
186
- return await H(t, { ...e, id: t });
138
+ const t = m(e.providerAccountId, e.provider);
139
+ return await N(t, { ...e, id: t });
187
140
  },
188
141
  async unlinkAccount({ providerAccountId: e, provider: t }) {
189
- const n = w(e, t);
190
- await G(n);
142
+ const n = m(e, t);
143
+ await h(n);
191
144
  },
192
145
  async createSession(e) {
193
146
  const t = e.sessionToken;
194
- return await N(t, { ...e, id: t });
147
+ return await O(t, {
148
+ ...e,
149
+ id: t
150
+ });
195
151
  },
196
152
  async getSessionAndUser(e) {
197
- const n = await h(e);
153
+ const n = await P(e);
198
154
  if (!n)
199
155
  return null;
200
- const o = await l(n.userId);
156
+ const o = await d(n.userId);
201
157
  return o ? { session: n, user: o } : null;
202
158
  },
203
159
  async updateSession(e) {
204
- const t = e.sessionToken, n = await h(t);
205
- return n ? await N(t, { ...n, ...e }) : null;
160
+ const t = e.sessionToken, n = await P(t);
161
+ return n ? await O(t, { ...n, ...e }) : null;
206
162
  },
207
- deleteSession: X,
163
+ deleteSession: _,
208
164
  async createVerificationToken(e) {
209
165
  const t = e.identifier;
210
- return await F(t, e), e;
166
+ return await X(t, e), e;
211
167
  },
212
168
  async useVerificationToken(e) {
213
- const t = e.identifier, n = await L(t);
214
- return !n || e.token !== n.token ? null : (await Z(t), n);
169
+ const t = e.identifier, n = await M(t);
170
+ return !n || e.token !== n.token ? null : (await F(t), n);
215
171
  }
216
172
  };
217
173
  }
218
174
  export {
219
- he as IORedisAdapter,
220
- le as defaultOptions
175
+ te as IORedisAdapter,
176
+ q as defaultOptions
221
177
  };
@@ -2,7 +2,7 @@ import { ApiMiddleware as g, ErrorCatalog as l, FetchServiceBE as x, FetchServic
2
2
  import { LoadingHandler as v, MessageHandler as E, RxSubjectManager as F } from "./mp-front-cli-utils-rxjs.es.js";
3
3
  import { S as h } from "./index-def0b487.js";
4
4
  import "i18next";
5
- import "./index-6ac9fcde.js";
5
+ import "./index-d7b5f68b.js";
6
6
  import "./mp-front-cli-logger.es.js";
7
7
  import "rxjs";
8
8
  import "./mp-front-cli-encrypter.es.js";
@@ -10,7 +10,7 @@ import "node-jose";
10
10
  import "crypto";
11
11
  import "./mp-front-cli-encoder.es.js";
12
12
  import "./mp-front-cli-header.es.js";
13
- import "./v5-cbd101aa.js";
13
+ import "./stringify-788d71a0.js";
14
14
  export {
15
15
  g as ApiMiddleware,
16
16
  l as ErrorCatalog,
@@ -1,11 +1,87 @@
1
- import "./mp-front-cli-encrypter.es.js";
2
- import { C as s, R as C } from "./custom-cache-8c806250.js";
1
+ var p = Object.defineProperty;
2
+ var S = (n, r, t) => r in n ? p(n, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[r] = t;
3
+ var E = (n, r, t) => (S(n, typeof r != "symbol" ? r + "" : r, t), t);
4
+ import { CustomEncrypter as m } from "./mp-front-cli-encrypter.es.js";
5
+ import { C as R } from "./custom-redis-bee66564.js";
3
6
  import "node-jose";
4
7
  import "crypto";
5
8
  import "./mp-front-cli-encoder.es.js";
6
9
  import "./mp-front-cli-logger.es.js";
7
10
  import "ioredis";
11
+ const a = process.env.TIMEOUT_SESSION_MINUTES;
12
+ var d = /* @__PURE__ */ ((n) => (n.NOT_REFRESH = "NOT_REFRESH", n.REFRESH = "REFRESH", n))(d || {});
13
+ class O extends m {
14
+ constructor() {
15
+ super(...arguments);
16
+ E(this, "initClient", R);
17
+ }
18
+ getRootNode(t) {
19
+ return this.initClient.get(t);
20
+ }
21
+ async getEntryPoint(t) {
22
+ try {
23
+ return await this.getRootNode(t);
24
+ } catch {
25
+ throw new Error("Not found entry point");
26
+ }
27
+ }
28
+ setEntryPoint(t, i, e) {
29
+ const s = typeof i == "string" ? i : JSON.stringify(i);
30
+ this.initClient.set(t, s, "EX", 60 * e);
31
+ }
32
+ async getRedisState(t, i) {
33
+ const e = `${t}:${this.generateSHA(i)}`, s = await this.getEntryPoint(e), c = await this.isEncrypted(s) ? await this.decrypt(s ?? "") : JSON.parse(s), o = Number(c == null ? void 0 : c.expires_in);
34
+ return o > 0 && this.ttl(e, o * 60), { sha: e, data: c };
35
+ }
36
+ async deleteRedisState(t, i) {
37
+ const e = `${t}:${this.generateSHA(i)}`;
38
+ this.initClient.del(e);
39
+ }
40
+ async setRedisState({
41
+ idApi: t,
42
+ idData: i,
43
+ body: e,
44
+ expire: s,
45
+ encrypted: h = !1,
46
+ refresh: c = "REFRESH"
47
+ /* REFRESH */
48
+ }) {
49
+ const o = `${t}:${this.generateSHA(i)}`, l = { expires_in: c === "REFRESH" ? s : 0, ...e };
50
+ if (h) {
51
+ const y = await this.encrypt(l);
52
+ return this.setEntryPoint(o, y, s), o;
53
+ }
54
+ return this.setEntryPoint(o, l, s), o;
55
+ }
56
+ async statusHost() {
57
+ return new Promise((t, i) => {
58
+ this.initClient.on("error", (e) => {
59
+ this.killRedis(), i(e);
60
+ }), this.initClient.on("connect", () => {
61
+ t("success");
62
+ });
63
+ });
64
+ }
65
+ killRedis() {
66
+ this.initClient.disconnect();
67
+ }
68
+ deleteKey(t) {
69
+ this.initClient.del(t);
70
+ }
71
+ ttl(t, i) {
72
+ this.initClient.expire(t, i);
73
+ }
74
+ simpleGet(t) {
75
+ return this.ttl(t, a * 60), this.initClient.get(t);
76
+ }
77
+ simpleHGet(t, i) {
78
+ return this.ttl(t, a * 60), this.initClient.hget(t, i);
79
+ }
80
+ simpleHSet(t, i, e) {
81
+ return this.initClient.hset(t, i, e);
82
+ }
83
+ }
8
84
  export {
9
- s as CustomCache,
10
- C as RefreshState
85
+ O as CustomCache,
86
+ d as RefreshState
11
87
  };
@@ -1,29 +1,29 @@
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 g } 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-6ac9fcde.js";
10
- import { CustomLogger as B } from "./mp-front-cli-logger.es.js";
11
- import { of as o, switchMap as T, forkJoin as S, catchError as I, EMPTY as U, filter as M } from "rxjs";
12
- import { CustomEncrypter as p } from "./mp-front-cli-encrypter.es.js";
13
- import { CustomHeader as u } from "./mp-front-cli-header.es.js";
14
- import { CustomEncoder as y } from "./mp-front-cli-encoder.es.js";
15
- import { a as D } from "./v5-cbd101aa.js";
1
+ var f = Object.defineProperty;
2
+ var y = (t, E, e) => E in t ? f(t, E, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[E] = e;
3
+ var L = (t, E, e) => (y(t, typeof E != "symbol" ? E + "" : E, e), e);
4
+ import { LoadingHandler as U, MessageHandler as B } from "./mp-front-cli-utils-rxjs.es.js";
5
+ import { RxSubjectManager as Ce } from "./mp-front-cli-utils-rxjs.es.js";
6
+ import { f as n } from "./index-def0b487.js";
7
+ import { S as ge } from "./index-def0b487.js";
8
+ import v, { t as g } from "i18next";
9
+ import { t as Q } from "./index-d7b5f68b.js";
10
+ import { CustomLogger as w } from "./mp-front-cli-logger.es.js";
11
+ import { of as N, switchMap as O, forkJoin as M, catchError as c, EMPTY as d, filter as h } from "rxjs";
12
+ import { CustomEncrypter as V } from "./mp-front-cli-encrypter.es.js";
13
+ import { CustomHeader as F } from "./mp-front-cli-header.es.js";
14
+ import { CustomEncoder as x } from "./mp-front-cli-encoder.es.js";
15
+ import { u as Y } from "./stringify-788d71a0.js";
16
16
  import "node-jose";
17
17
  import "crypto";
18
- const v = {
18
+ const G = {
19
19
  es: {
20
20
  translation: {
21
- ...P
21
+ ...Q
22
22
  }
23
23
  }
24
24
  };
25
- d.init({
26
- resources: v,
25
+ v.init({
26
+ resources: G,
27
27
  lng: "es",
28
28
  // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources
29
29
  // you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage
@@ -35,7 +35,7 @@ d.init({
35
35
  },
36
36
  debug: !1
37
37
  });
38
- const Q = {
38
+ const H = {
39
39
  "ENROLLMENT-INVALIDCONFIGURATION-0000": {
40
40
  code: 400,
41
41
  type: "modal",
@@ -260,7 +260,7 @@ const Q = {
260
260
  title: "errors.ENROLLMENT-INVALIDTOKENTRUSTONICSUPPLIER-0031.title",
261
261
  level: "error"
262
262
  }
263
- }, L = {
263
+ }, m = {
264
264
  "MP-001": {
265
265
  code: 400,
266
266
  type: "modal",
@@ -997,6 +997,13 @@ const Q = {
997
997
  type: "modal",
998
998
  level: "warning"
999
999
  },
1000
+ "PERSONALREFERENCE-DELETEREFERENCEEXCEPTION-001": {
1001
+ title: "errors.PERSONALREFERENCE-DELETEREFERENCEEXCEPTION-001.title",
1002
+ message: "errors.PERSONALREFERENCE-DELETEREFERENCEEXCEPTION-001.message",
1003
+ code: 400,
1004
+ type: "modal",
1005
+ level: "warning"
1006
+ },
1000
1007
  //PAYMENTS
1001
1008
  "SALES-SUMMARY-GENERIC-ERROR-001": {
1002
1009
  title: "errors.SALES-SUMMARY-GENERIC-ERROR-001.title",
@@ -1012,185 +1019,273 @@ const Q = {
1012
1019
  type: "modal",
1013
1020
  level: "warning"
1014
1021
  },
1015
- ...Q
1022
+ ...H
1016
1023
  };
1017
- class O extends B {
1018
- get(s = "default", e = "NOT_FOUND") {
1019
- var E, l;
1020
- if (s instanceof Error)
1021
- return this.logError(s.message), {
1022
- ...L.internalError,
1023
- title: m(L.internalError.title),
1024
- message: m(L.internalError.message),
1024
+ class I extends w {
1025
+ get(E = "default", e = "NOT_FOUND") {
1026
+ var s, A;
1027
+ if (E instanceof Error)
1028
+ return this.logError(E.message), {
1029
+ ...m.internalError,
1030
+ title: g(m.internalError.title),
1031
+ message: g(m.internalError.message),
1025
1032
  uuid: e
1026
1033
  };
1027
- const r = typeof s == "string" ? s : s.code ?? s.errorType;
1034
+ const r = typeof E == "string" ? E : E.code ?? E.errorType;
1028
1035
  this.logDebug("statusCode", r);
1029
- const t = typeof s == "string" ? {} : { ...s };
1036
+ const l = typeof E == "string" ? {} : { ...E };
1030
1037
  return {
1031
- ...L[r] ?? L.default,
1032
- title: m(
1033
- ((E = L[r]) == null ? void 0 : E.title) ?? L.default.title,
1034
- t
1038
+ ...m[r] ?? m.default,
1039
+ title: g(
1040
+ ((s = m[r]) == null ? void 0 : s.title) ?? m.default.title,
1041
+ l
1035
1042
  ),
1036
- message: m(
1037
- ((l = L[r]) == null ? void 0 : l.message) ?? L.default.message,
1038
- t
1043
+ message: g(
1044
+ ((A = m[r]) == null ? void 0 : A.message) ?? m.default.message,
1045
+ l
1039
1046
  ),
1040
1047
  uuid: e
1041
1048
  };
1042
1049
  }
1043
1050
  }
1044
- class b extends p {
1051
+ class Le extends V {
1045
1052
  constructor() {
1046
1053
  super(...arguments);
1047
- R(this, "uuid", "");
1048
- R(this, "session", null);
1054
+ L(this, "uuid", "");
1055
+ L(this, "session", null);
1049
1056
  }
1050
1057
  setSession(e) {
1051
1058
  this.session = e;
1052
1059
  }
1053
1060
  getSession() {
1054
1061
  if (!this.session)
1055
- throw new O().get("SESSION_NOT_FOUND");
1062
+ throw new I().get("SESSION_NOT_FOUND");
1056
1063
  return this.session;
1057
1064
  }
1058
- returnData(e, r, t) {
1059
- const E = this.encode(r, t);
1060
- e.status(200).json(E);
1065
+ returnData(e, r, l) {
1066
+ const s = this.encode(r, l);
1067
+ e.status(200).json(s);
1061
1068
  }
1062
1069
  returnError(e, r) {
1063
- return r != null && r.uuid ? e.status(520).json(r) : e.status(520).json(new O().get(r, this.uuid));
1070
+ return r != null && r.uuid ? e.status(520).json(r) : e.status(520).json(new I().get(r, this.uuid));
1064
1071
  }
1065
1072
  get(e) {
1066
- return this.logDebug("get ApiMiddleware"), (r, t) => {
1067
- var E;
1068
- this.logDebug("return ApiMiddleware"), this.uuid = (E = r == null ? void 0 : r.body) == null ? void 0 : E.uuid, o(r).pipe(
1069
- T(
1070
- (l) => S({
1071
- params: o(this.decode(l.body)),
1072
- headers: o(l.headers)
1073
+ return this.logDebug("get ApiMiddleware"), (r, l) => {
1074
+ var s;
1075
+ this.logDebug("return ApiMiddleware"), this.uuid = (s = r == null ? void 0 : r.body) == null ? void 0 : s.uuid, N(r).pipe(
1076
+ O(
1077
+ (A) => M({
1078
+ params: N(this.decode(A.body)),
1079
+ headers: N(A.headers)
1073
1080
  })
1074
1081
  ),
1075
- T(
1076
- ({ params: l, headers: a }) => S({
1077
- response: e(l, this.uuid, a),
1078
- headers: o(a),
1079
- params: o(l)
1082
+ O(
1083
+ ({ params: A, headers: a }) => M({
1084
+ response: e(A, this.uuid, a),
1085
+ headers: N(a),
1086
+ params: N(A)
1080
1087
  })
1081
1088
  ),
1082
- T(({ params: l, response: a, headers: A }) => (this.logDebug(
1083
- `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)}`
1084
- ), o(a))),
1085
- I((l) => {
1089
+ O(({ params: A, response: a, headers: o }) => (this.logDebug(
1090
+ `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)}`
1091
+ ), N(a))),
1092
+ c((A) => {
1086
1093
  var a;
1087
1094
  return this.logError(
1088
- `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)}`
1089
- ), this.returnError(t, l), U;
1095
+ `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)}`
1096
+ ), this.returnError(l, A), d;
1090
1097
  })
1091
1098
  ).subscribe({
1092
- next: (l) => {
1093
- this.logDebug("ApiMiddleware subscribe next", JSON.stringify(l)), this.returnData(t, l, this.uuid);
1099
+ next: (A) => {
1100
+ this.logDebug("ApiMiddleware subscribe next", JSON.stringify(A)), this.returnData(l, A, this.uuid);
1094
1101
  }
1095
1102
  });
1096
1103
  };
1097
1104
  }
1098
1105
  }
1099
- const V = process.env.ID_FRONT ?? "NOT_AVAILABLE";
1100
- class W extends u {
1101
- constructor(e, r, t = {}) {
1102
- super(t);
1103
- R(this, "apiUrl");
1104
- R(this, "method");
1106
+ const _ = process.env.ID_FRONT ?? "NOT_AVAILABLE";
1107
+ class Oe extends F {
1108
+ constructor(e, r, l = {}) {
1109
+ super(l);
1110
+ L(this, "apiUrl");
1111
+ L(this, "method");
1105
1112
  this.apiUrl = e, this.method = r ?? "POST";
1106
1113
  }
1107
1114
  errorHandler(e, r) {
1108
1115
  if (e != null && e.errors)
1109
- throw new O().get(e.errors[0], r);
1116
+ throw new I().get(e.errors[0], r);
1110
1117
  return !(e != null && e.errors);
1111
1118
  }
1112
1119
  formatParams(e) {
1113
1120
  return JSON.stringify({
1114
1121
  data: {
1115
- type: V,
1122
+ type: _,
1116
1123
  attributes: e
1117
1124
  }
1118
1125
  });
1119
1126
  }
1120
1127
  fetchData(e = {}, r) {
1121
1128
  return this.getHeaders().pipe(
1122
- T(
1123
- (t) => C(
1129
+ O(
1130
+ (l) => n(
1124
1131
  this.apiUrl,
1125
1132
  {
1126
1133
  method: "POST",
1127
- headers: t,
1134
+ headers: l,
1128
1135
  body: this.formatParams(e),
1129
- selector: (E) => E.json()
1136
+ selector: (s) => s.json()
1130
1137
  }
1131
1138
  ).pipe(
1132
- I((E) => {
1133
- throw this.logError(JSON.stringify(E)), this.logError(
1139
+ c((s) => {
1140
+ throw this.logError(JSON.stringify(s)), this.logError(
1134
1141
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1135
- t
1142
+ l
1136
1143
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1137
1144
  this.formatParams(e)
1138
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1139
- ), new O().get("default", r);
1145
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
1146
+ ), new I().get("default", r);
1140
1147
  }),
1141
- T((E) => (this.logDebug(
1148
+ O((s) => (this.logDebug(
1142
1149
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1143
- t
1150
+ l
1144
1151
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1145
1152
  this.formatParams(e)
1146
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1147
- ), o(E)))
1153
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
1154
+ ), N(s)))
1148
1155
  )
1149
1156
  ),
1150
- M((t) => this.errorHandler(t, r))
1157
+ h((l) => this.errorHandler(l, r))
1151
1158
  );
1152
1159
  }
1153
1160
  fetchCustomData(e = {}, r) {
1154
1161
  return this.getHeaders().pipe(
1155
- T(
1156
- (t) => C(this.apiUrl, {
1162
+ O(
1163
+ (l) => n(this.apiUrl, {
1157
1164
  method: this.method,
1158
- headers: t,
1165
+ headers: l,
1159
1166
  body: this.method === "GET" ? null : JSON.stringify(e),
1160
- selector: (E) => E.json()
1167
+ selector: (s) => s.json()
1161
1168
  }).pipe(
1162
- I((E) => {
1163
- throw this.logError(JSON.stringify(E)), this.logError(
1169
+ c((s) => {
1170
+ throw this.logError(JSON.stringify(s)), this.logError(
1164
1171
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1165
- t
1172
+ l
1166
1173
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1167
1174
  this.formatParams(e)
1168
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1169
- ), new O().get("default", r);
1175
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
1176
+ ), new I().get("default", r);
1170
1177
  }),
1171
- T((E) => (this.logDebug(
1178
+ O((s) => (this.logDebug(
1172
1179
  `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(
1173
- t
1180
+ l
1174
1181
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1175
1182
  e
1176
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(E)} \x1B[33m`
1177
- ), o(E)))
1183
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(s)} \x1B[33m`
1184
+ ), N(s)))
1178
1185
  )
1179
1186
  )
1180
1187
  );
1181
1188
  }
1182
1189
  }
1183
- class j extends y {
1184
- constructor(e, r = "POST", t = {}) {
1190
+ 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;
1191
+ function K(t) {
1192
+ return typeof t == "string" && J.test(t);
1193
+ }
1194
+ function $(t) {
1195
+ if (!K(t))
1196
+ throw TypeError("Invalid UUID");
1197
+ let E;
1198
+ const e = new Uint8Array(16);
1199
+ return e[0] = (E = parseInt(t.slice(0, 8), 16)) >>> 24, e[1] = E >>> 16 & 255, e[2] = E >>> 8 & 255, e[3] = E & 255, e[4] = (E = parseInt(t.slice(9, 13), 16)) >>> 8, e[5] = E & 255, e[6] = (E = parseInt(t.slice(14, 18), 16)) >>> 8, e[7] = E & 255, e[8] = (E = parseInt(t.slice(19, 23), 16)) >>> 8, e[9] = E & 255, e[10] = (E = parseInt(t.slice(24, 36), 16)) / 1099511627776 & 255, e[11] = E / 4294967296 & 255, e[12] = E >>> 24 & 255, e[13] = E >>> 16 & 255, e[14] = E >>> 8 & 255, e[15] = E & 255, e;
1200
+ }
1201
+ function X(t) {
1202
+ t = unescape(encodeURIComponent(t));
1203
+ const E = [];
1204
+ for (let e = 0; e < t.length; ++e)
1205
+ E.push(t.charCodeAt(e));
1206
+ return E;
1207
+ }
1208
+ const b = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", W = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
1209
+ function j(t, E, e) {
1210
+ function r(l, s, A, a) {
1211
+ var o;
1212
+ if (typeof l == "string" && (l = X(l)), typeof s == "string" && (s = $(s)), ((o = s) === null || o === void 0 ? void 0 : o.length) !== 16)
1213
+ throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
1214
+ let T = new Uint8Array(16 + l.length);
1215
+ if (T.set(s), T.set(l, s.length), T = e(T), T[6] = T[6] & 15 | E, T[8] = T[8] & 63 | 128, A) {
1216
+ a = a || 0;
1217
+ for (let i = 0; i < 16; ++i)
1218
+ A[a + i] = T[i];
1219
+ return A;
1220
+ }
1221
+ return Y(T);
1222
+ }
1223
+ try {
1224
+ r.name = t;
1225
+ } catch {
1226
+ }
1227
+ return r.DNS = b, r.URL = W, r;
1228
+ }
1229
+ function Z(t, E, e, r) {
1230
+ switch (t) {
1231
+ case 0:
1232
+ return E & e ^ ~E & r;
1233
+ case 1:
1234
+ return E ^ e ^ r;
1235
+ case 2:
1236
+ return E & e ^ E & r ^ e & r;
1237
+ case 3:
1238
+ return E ^ e ^ r;
1239
+ }
1240
+ }
1241
+ function D(t, E) {
1242
+ return t << E | t >>> 32 - E;
1243
+ }
1244
+ function k(t) {
1245
+ const E = [1518500249, 1859775393, 2400959708, 3395469782], e = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
1246
+ if (typeof t == "string") {
1247
+ const A = unescape(encodeURIComponent(t));
1248
+ t = [];
1249
+ for (let a = 0; a < A.length; ++a)
1250
+ t.push(A.charCodeAt(a));
1251
+ } else
1252
+ Array.isArray(t) || (t = Array.prototype.slice.call(t));
1253
+ t.push(128);
1254
+ const r = t.length / 4 + 2, l = Math.ceil(r / 16), s = new Array(l);
1255
+ for (let A = 0; A < l; ++A) {
1256
+ const a = new Uint32Array(16);
1257
+ for (let o = 0; o < 16; ++o)
1258
+ a[o] = t[A * 64 + o * 4] << 24 | t[A * 64 + o * 4 + 1] << 16 | t[A * 64 + o * 4 + 2] << 8 | t[A * 64 + o * 4 + 3];
1259
+ s[A] = a;
1260
+ }
1261
+ s[l - 1][14] = (t.length - 1) * 8 / Math.pow(2, 32), s[l - 1][14] = Math.floor(s[l - 1][14]), s[l - 1][15] = (t.length - 1) * 8 & 4294967295;
1262
+ for (let A = 0; A < l; ++A) {
1263
+ const a = new Uint32Array(80);
1264
+ for (let R = 0; R < 16; ++R)
1265
+ a[R] = s[A][R];
1266
+ for (let R = 16; R < 80; ++R)
1267
+ a[R] = D(a[R - 3] ^ a[R - 8] ^ a[R - 14] ^ a[R - 16], 1);
1268
+ let o = e[0], T = e[1], i = e[2], C = e[3], S = e[4];
1269
+ for (let R = 0; R < 80; ++R) {
1270
+ const P = Math.floor(R / 20), u = D(o, 5) + Z(P, T, i, C) + S + E[P] + a[R] >>> 0;
1271
+ S = C, C = i, i = D(T, 30) >>> 0, T = o, o = u;
1272
+ }
1273
+ 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] + S >>> 0;
1274
+ }
1275
+ 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];
1276
+ }
1277
+ const z = j("v5", 80, k), p = z;
1278
+ class ie extends x {
1279
+ constructor(e, r = "POST", l = {}) {
1185
1280
  super();
1186
- R(this, "apiUrl");
1187
- R(this, "method");
1188
- R(this, "headers");
1189
- R(this, "isLoadingEnabled", !0);
1190
- R(this, "errorResponse");
1281
+ L(this, "apiUrl");
1282
+ L(this, "method");
1283
+ L(this, "headers");
1284
+ L(this, "isLoadingEnabled", !0);
1285
+ L(this, "errorResponse");
1191
1286
  this.apiUrl = e, this.method = r, this.headers = {
1192
1287
  "Content-Type": "application/json",
1193
- ...t
1288
+ ...l
1194
1289
  };
1195
1290
  }
1196
1291
  setIsLoadingEnabled(e) {
@@ -1200,37 +1295,37 @@ class j extends y {
1200
1295
  this.errorResponse = e;
1201
1296
  }
1202
1297
  fetchData(e = {}) {
1203
- const r = (/* @__PURE__ */ new Date()).toISOString(), t = D(r, D.URL), E = this.encode({ ...e }, t);
1204
- i.getInstance().setSubject(this.isLoadingEnabled);
1298
+ const r = (/* @__PURE__ */ new Date()).toISOString(), l = p(r, p.URL), s = this.encode({ ...e }, l);
1299
+ U.getInstance().setSubject(this.isLoadingEnabled);
1205
1300
  const a = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
1206
- return C(this.apiUrl, {
1301
+ return n(this.apiUrl, {
1207
1302
  method: this.method,
1208
1303
  headers: { ...this.headers, flow: a },
1209
- body: E,
1210
- selector: (A) => A.json()
1304
+ body: s,
1305
+ selector: (o) => o.json()
1211
1306
  }).pipe(
1212
- T((A) => o(this.decode(A))),
1213
- T((A) => A.code && (A.type === "modal" || A.type === "message") ? (this.logError(
1214
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(A)}`
1215
- ), i.getInstance().setSubject(!1), g.getInstance().setSubject(A), this.errorResponse ? o(this.errorResponse) : U) : o(A)),
1216
- T((A) => (i.getInstance().setSubject(!1), this.logDebug(
1217
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(A)}`
1218
- ), o(A))),
1219
- I((A) => (this.logError(
1220
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${E} <RESPONSE>: ${JSON.stringify(A)}`
1221
- ), i.getInstance().setSubject(!1), g.getInstance().setSubject(
1222
- new O().get(A, t)
1223
- ), this.errorResponse ? o(this.errorResponse) : U))
1307
+ O((o) => N(this.decode(o))),
1308
+ O((o) => o.code && (o.type === "modal" || o.type === "message") ? (this.logError(
1309
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(o)}`
1310
+ ), U.getInstance().setSubject(!1), B.getInstance().setSubject(o), this.errorResponse ? N(this.errorResponse) : d) : N(o)),
1311
+ O((o) => (U.getInstance().setSubject(!1), this.logDebug(
1312
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(o)}`
1313
+ ), N(o))),
1314
+ c((o) => (this.logError(
1315
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(o)}`
1316
+ ), U.getInstance().setSubject(!1), B.getInstance().setSubject(
1317
+ new I().get(o, l)
1318
+ ), this.errorResponse ? N(this.errorResponse) : d))
1224
1319
  );
1225
1320
  }
1226
1321
  }
1227
1322
  export {
1228
- b as ApiMiddleware,
1229
- O as ErrorCatalog,
1230
- W as FetchServiceBE,
1231
- j as FetchServiceFE,
1232
- i as LoadingHandler,
1233
- g as MessageHandler,
1234
- z as RxSubjectManager,
1235
- ee as ServiceToken
1323
+ Le as ApiMiddleware,
1324
+ I as ErrorCatalog,
1325
+ Oe as FetchServiceBE,
1326
+ ie as FetchServiceFE,
1327
+ U as LoadingHandler,
1328
+ B as MessageHandler,
1329
+ Ce as RxSubjectManager,
1330
+ ge as ServiceToken
1236
1331
  };
@@ -1,4 +1,4 @@
1
- import { t } from "./index-6ac9fcde.js";
1
+ import { t } from "./index-d7b5f68b.js";
2
2
  const e = {
3
3
  errors: {}
4
4
  }, a = {
@@ -0,0 +1,9 @@
1
+ const i = [];
2
+ for (let n = 0; n < 256; ++n)
3
+ i.push((n + 256).toString(16).slice(1));
4
+ function c(n, u = 0) {
5
+ return i[n[u + 0]] + i[n[u + 1]] + i[n[u + 2]] + i[n[u + 3]] + "-" + i[n[u + 4]] + i[n[u + 5]] + "-" + i[n[u + 6]] + i[n[u + 7]] + "-" + i[n[u + 8]] + i[n[u + 9]] + "-" + i[n[u + 10]] + i[n[u + 11]] + i[n[u + 12]] + i[n[u + 13]] + i[n[u + 14]] + i[n[u + 15]];
6
+ }
7
+ export {
8
+ c as u
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-front-cli",
3
- "version": "0.0.102",
3
+ "version": "0.0.104",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,89 +0,0 @@
1
- var a = Object.defineProperty;
2
- var p = (n, r, t) => r in n ? a(n, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[r] = t;
3
- var h = (n, r, t) => (p(n, typeof r != "symbol" ? r + "" : r, t), t);
4
- import { CustomEncrypter as y } from "./mp-front-cli-encrypter.es.js";
5
- import d from "ioredis";
6
- const u = process.env.REDIS_HOST, C = process.env.REDIS_PORT, m = process.env.REDIS_USER, _ = process.env.REDIS_PASS, H = new d({
7
- host: u,
8
- port: C,
9
- username: m,
10
- password: _,
11
- tls: {}
12
- }), R = process.env.TIMEOUT_SESSION_MINUTES;
13
- var T = /* @__PURE__ */ ((n) => (n.NOT_REFRESH = "NOT_REFRESH", n.REFRESH = "REFRESH", n))(T || {});
14
- class O extends y {
15
- constructor() {
16
- super(...arguments);
17
- h(this, "initClient", H);
18
- }
19
- getRootNode(t) {
20
- return this.initClient.get(t);
21
- }
22
- async getEntryPoint(t) {
23
- try {
24
- return await this.getRootNode(t);
25
- } catch {
26
- throw new Error("Not found entry point");
27
- }
28
- }
29
- setEntryPoint(t, e, s) {
30
- const i = typeof e == "string" ? e : JSON.stringify(e);
31
- this.initClient.set(t, i, "EX", 60 * s);
32
- }
33
- async getRedisState(t, e) {
34
- const s = `${t}:${this.generateSHA(e)}`, i = await this.getEntryPoint(s), c = await this.isEncrypted(i) ? await this.decrypt(i ?? "") : JSON.parse(i), o = Number(c == null ? void 0 : c.expires_in);
35
- return o > 0 && this.ttl(s, o * 60), { sha: s, data: c };
36
- }
37
- async deleteRedisState(t, e) {
38
- const s = `${t}:${this.generateSHA(e)}`;
39
- this.initClient.del(s);
40
- }
41
- async setRedisState({
42
- idApi: t,
43
- idData: e,
44
- body: s,
45
- expire: i,
46
- encrypted: E = !1,
47
- refresh: c = "REFRESH"
48
- /* REFRESH */
49
- }) {
50
- const o = `${t}:${this.generateSHA(e)}`, S = { expires_in: c === "REFRESH" ? i : 0, ...s };
51
- if (E) {
52
- const l = await this.encrypt(S);
53
- return this.setEntryPoint(o, l, i), o;
54
- }
55
- return this.setEntryPoint(o, S, i), o;
56
- }
57
- async statusHost() {
58
- return new Promise((t, e) => {
59
- this.initClient.on("error", (s) => {
60
- this.killRedis(), e(s);
61
- }), this.initClient.on("connect", () => {
62
- t("success");
63
- });
64
- });
65
- }
66
- killRedis() {
67
- this.initClient.disconnect();
68
- }
69
- deleteKey(t) {
70
- this.initClient.del(t);
71
- }
72
- ttl(t, e) {
73
- this.initClient.expire(t, e);
74
- }
75
- simpleGet(t) {
76
- return this.ttl(t, R * 60), this.initClient.get(t);
77
- }
78
- simpleHGet(t, e) {
79
- return this.ttl(t, R * 60), this.initClient.hget(t, e);
80
- }
81
- simpleHSet(t, e, s) {
82
- return this.initClient.hset(t, e, s);
83
- }
84
- }
85
- export {
86
- O as C,
87
- T as R,
88
- H as a
89
- };
@@ -1,98 +0,0 @@
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
- };