mp-front-cli 0.0.71 → 0.0.73

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,20 +1,20 @@
1
- var I = Object.defineProperty;
2
- var L = (s, r, t) => r in s ? I(s, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[r] = t;
3
- var h = (s, r, t) => (L(s, typeof r != "symbol" ? r + "" : r, t), t);
4
- import { C as M, f as U } from "./custom-header-596dcd13.js";
5
- import { S as ut } from "./custom-header-596dcd13.js";
6
- import { MessageHandler as O, LoadingHandler as p } from "./mp-front-cli-utils-rxjs.es.js";
7
- import { RxSubjectManager as pt } from "./mp-front-cli-utils-rxjs.es.js";
8
- import P, { t as E } from "i18next";
9
- import { t as v } from "./index-fccce407.js";
10
- import { CustomLogger as J } from "./mp-front-cli-logger.es.js";
11
- import { of as d, switchMap as m, forkJoin as A, catchError as b, EMPTY as D, filter as w } from "rxjs";
12
- import { CustomEncrypter as T } from "./mp-front-cli-encrypter.es.js";
13
- import { CustomEncoder as H } from "./mp-front-cli-encoder.es.js";
14
- import { u as j } from "./stringify-788d71a0.js";
1
+ var N = Object.defineProperty;
2
+ var w = (l, t, e) => t in l ? N(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
3
+ var L = (l, t, e) => (w(l, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import { C as Q, f } from "./custom-header-596dcd13.js";
5
+ import { S as Ue } from "./custom-header-596dcd13.js";
6
+ import { MessageHandler as B, LoadingHandler as m } from "./mp-front-cli-utils-rxjs.es.js";
7
+ import { RxSubjectManager as me } from "./mp-front-cli-utils-rxjs.es.js";
8
+ import P, { t as g } from "i18next";
9
+ import { t as v } from "./index-a0e4df41.js";
10
+ import { CustomLogger as M } from "./mp-front-cli-logger.es.js";
11
+ import { of as R, switchMap as E, forkJoin as D, catchError as h, EMPTY as I, filter as y } from "rxjs";
12
+ import { CustomEncrypter as b } from "./mp-front-cli-encrypter.es.js";
13
+ import { CustomEncoder as F } from "./mp-front-cli-encoder.es.js";
14
+ import { u as $ } from "./stringify-788d71a0.js";
15
15
  import "node-jose";
16
16
  import "crypto";
17
- const C = {
17
+ const H = {
18
18
  es: {
19
19
  translation: {
20
20
  ...v
@@ -22,7 +22,7 @@ const C = {
22
22
  }
23
23
  };
24
24
  P.init({
25
- resources: C,
25
+ resources: H,
26
26
  lng: "es",
27
27
  // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources
28
28
  // you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage
@@ -34,8 +34,7 @@ P.init({
34
34
  },
35
35
  debug: !1
36
36
  });
37
- const u = {
38
- // EXAMPLE ERROR
37
+ const U = {
39
38
  "MP-001": {
40
39
  code: 400,
41
40
  type: "modal",
@@ -70,289 +69,613 @@ const u = {
70
69
  message: "errors.default.message",
71
70
  title: "errors.default.title",
72
71
  level: "warning"
72
+ },
73
+ // Biometric
74
+ "PF-BIOMETRIC-001": {
75
+ title: "errors.PF-BIOMETRIC-001.title",
76
+ message: "errors.PF-BIOMETRIC-001.message",
77
+ level: "warning",
78
+ code: 420,
79
+ type: "modal"
80
+ },
81
+ "PF-BIOMETRIC-002": {
82
+ title: "errors.PF-BIOMETRIC-002.title",
83
+ message: "errors.PF-BIOMETRIC-002.message",
84
+ level: "warning",
85
+ code: 420,
86
+ type: "modal"
87
+ },
88
+ "PF-BIOMETRIC-003": {
89
+ title: "errors.PF-BIOMETRIC-003.title",
90
+ message: "errors.PF-BIOMETRIC-003.message",
91
+ level: "warning",
92
+ code: 420,
93
+ type: "modal"
94
+ },
95
+ "PF-BIOMETRIC-004": {
96
+ code: 521,
97
+ type: "modal",
98
+ message: "errors.PF-BIOMETRIC-004.message",
99
+ title: "errors.PF-BIOMETRIC-004.title",
100
+ level: "warning"
101
+ },
102
+ "PF-VALIDATE-CLIENTTYPE-003": {
103
+ title: "errors.PF-VALIDATE-CLIENTTYPE-003.title",
104
+ message: "errors.PF-VALIDATE-CLIENTTYPE-003.message",
105
+ level: "warning",
106
+ code: 420,
107
+ type: "modal"
108
+ },
109
+ // Calculator
110
+ "SCORE-CLIENTREJECTED-01": {
111
+ title: "errors.calculator.SCORE-CLIENTREJECTED-01.title",
112
+ message: "errors.calculator.SCORE-CLIENTREJECTED-01.message",
113
+ code: 420,
114
+ type: "modal",
115
+ level: "warning"
116
+ },
117
+ "CALCULATOR-MAPPING-01": {
118
+ title: "errors.calculator.CALCULATOR-MAPPING-01.title",
119
+ message: "errors.calculator.CALCULATOR-MAPPING-01.message",
120
+ code: 420,
121
+ type: "modal",
122
+ level: "warning"
123
+ },
124
+ "CALCULATOR-MAPPING-02": {
125
+ title: "errors.calculator.CALCULATOR-MAPPING-02.title",
126
+ message: "errors.calculator.CALCULATOR-MAPPING-02.message",
127
+ code: 420,
128
+ type: "modal",
129
+ level: "warning"
130
+ },
131
+ "CALCULATOR-MAPPING-03": {
132
+ title: "errors.calculator.CALCULATOR-MAPPING-03.title",
133
+ message: "errors.calculator.CALCULATOR-MAPPING-03.message",
134
+ code: 420,
135
+ type: "modal",
136
+ level: "warning"
137
+ },
138
+ "CALCULATOR-MAPPING-04": {
139
+ title: "errors.calculator.CALCULATOR-MAPPING-04.title",
140
+ message: "errors.calculator.CALCULATOR-MAPPING-04.message",
141
+ code: 420,
142
+ type: "modal",
143
+ level: "warning"
144
+ },
145
+ "CALCULATOR-BAD-REQUEST-01": {
146
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-01.title",
147
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-01.message",
148
+ code: 420,
149
+ type: "modal",
150
+ level: "warning"
151
+ },
152
+ "CALCULATOR-BAD-REQUEST-02": {
153
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-02.title",
154
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-02.message",
155
+ code: 420,
156
+ type: "modal",
157
+ level: "warning"
158
+ },
159
+ "CALCULATOR-BAD-REQUEST-03": {
160
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-03.title",
161
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-03.message",
162
+ code: 420,
163
+ type: "modal",
164
+ level: "warning"
165
+ },
166
+ "CALCULATOR-BAD-REQUEST-04": {
167
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-04.title",
168
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-04.message",
169
+ code: 420,
170
+ type: "modal",
171
+ level: "warning"
172
+ },
173
+ "CALCULATOR-BAD-REQUEST-05": {
174
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-05.title",
175
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-05.message",
176
+ code: 420,
177
+ type: "modal",
178
+ level: "warning"
179
+ },
180
+ "CALCULATOR-BAD-REQUEST-06": {
181
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-06.title",
182
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-06.message",
183
+ code: 420,
184
+ type: "modal",
185
+ level: "warning"
186
+ },
187
+ "CALCULATOR-BAD-REQUEST-07": {
188
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-07.title",
189
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-07.message",
190
+ code: 420,
191
+ type: "modal",
192
+ level: "warning"
193
+ },
194
+ "CALCULATOR-BAD-REQUEST-08": {
195
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-08.title",
196
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-08.message",
197
+ code: 420,
198
+ type: "modal",
199
+ level: "warning"
200
+ },
201
+ "CALCULATOR-BAD-REQUEST-09": {
202
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-09.title",
203
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-09.message",
204
+ code: 420,
205
+ type: "modal",
206
+ level: "warning"
207
+ },
208
+ "CALCULATOR-BAD-REQUEST-10": {
209
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-10.title",
210
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-10.message",
211
+ code: 420,
212
+ type: "modal",
213
+ level: "warning"
214
+ },
215
+ "CALCULATOR-BAD-REQUEST-11": {
216
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-11.title",
217
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-11.message",
218
+ code: 420,
219
+ type: "modal",
220
+ level: "warning"
221
+ },
222
+ "CALCULATOR-BAD-REQUEST-12": {
223
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-12.title",
224
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-12.message",
225
+ code: 420,
226
+ type: "modal",
227
+ level: "warning"
228
+ },
229
+ "CALCULATOR-BAD-REQUEST-13": {
230
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-13.title",
231
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-13.message",
232
+ code: 420,
233
+ type: "modal",
234
+ level: "warning"
235
+ },
236
+ "CALCULATOR-BAD-REQUEST-14": {
237
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-14.title",
238
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-14.message",
239
+ code: 420,
240
+ type: "modal",
241
+ level: "warning"
242
+ },
243
+ "CALCULATOR-BAD-REQUEST-15": {
244
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-15.title",
245
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-15.message",
246
+ code: 420,
247
+ type: "modal",
248
+ level: "warning"
249
+ },
250
+ "CALCULATOR-BAD-REQUEST-16": {
251
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-16.title",
252
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-16.message",
253
+ code: 420,
254
+ type: "modal",
255
+ level: "warning"
256
+ },
257
+ "CALCULATOR-BAD-REQUEST-17": {
258
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-17.title",
259
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-17.message",
260
+ code: 420,
261
+ type: "modal",
262
+ level: "warning"
263
+ },
264
+ "CALCULATOR-BAD-REQUEST-18": {
265
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-18.title",
266
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-18.message",
267
+ code: 420,
268
+ type: "modal",
269
+ level: "warning"
270
+ },
271
+ "CALCULATOR-BAD-REQUEST-19": {
272
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-19.title",
273
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-19.message",
274
+ code: 420,
275
+ type: "modal",
276
+ level: "warning"
277
+ },
278
+ "CALCULATOR-BAD-REQUEST-20": {
279
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-20.title",
280
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-20.message",
281
+ code: 420,
282
+ type: "modal",
283
+ level: "warning"
284
+ },
285
+ "CALCULATOR-BAD-REQUEST-21": {
286
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-21.title",
287
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-21.message",
288
+ code: 420,
289
+ type: "modal",
290
+ level: "warning"
291
+ },
292
+ "CALCULATOR-BAD-REQUEST-22": {
293
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-22.title",
294
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-22.message",
295
+ code: 420,
296
+ type: "modal",
297
+ level: "warning"
298
+ },
299
+ "CALCULATOR-BAD-REQUEST-23": {
300
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-23.title",
301
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-23.message",
302
+ code: 420,
303
+ type: "modal",
304
+ level: "warning"
305
+ },
306
+ "CALCULATOR-BAD-REQUEST-24": {
307
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-24.title",
308
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-24.message",
309
+ code: 420,
310
+ type: "modal",
311
+ level: "warning"
312
+ },
313
+ "CALCULATOR-BAD-REQUEST-25": {
314
+ title: "errors.calculator.CALCULATOR-BAD-REQUEST-25.title",
315
+ message: "errors.calculator.CALCULATOR-BAD-REQUEST-25.message",
316
+ code: 420,
317
+ type: "modal",
318
+ level: "warning"
319
+ },
320
+ "CALCULATOR-UNAUTHORIZED-01": {
321
+ title: "errors.calculator.CALCULATOR-UNAUTHORIZED-01.title",
322
+ message: "errors.calculator.CALCULATOR-UNAUTHORIZED-01.message",
323
+ code: 420,
324
+ type: "modal",
325
+ level: "warning"
326
+ },
327
+ "CALCULATOR-UNAUTHORIZED-02": {
328
+ title: "errors.calculator.CALCULATOR-UNAUTHORIZED-02.title",
329
+ message: "errors.calculator.CALCULATOR-UNAUTHORIZED-02.message",
330
+ code: 420,
331
+ type: "modal",
332
+ level: "warning"
333
+ },
334
+ "CALCULATOR-SERVICE-UNAVAILABLE-01": {
335
+ title: "errors.calculator.CALCULATOR-SERVICE-UNAVAILABLE-01.title",
336
+ message: "errors.calculator.CALCULATOR-SERVICE-UNAVAILABLE-01.message",
337
+ code: 420,
338
+ type: "modal",
339
+ level: "warning"
340
+ },
341
+ "CALCULATOR-SERVICE-UNAVAILABLE-02": {
342
+ title: "errors.calculator.CALCULATOR-SERVICE-UNAVAILABLE-02.title",
343
+ message: "errors.calculator.CALCULATOR-SERVICE-UNAVAILABLE-02.message",
344
+ code: 420,
345
+ type: "modal",
346
+ level: "warning"
347
+ },
348
+ "CALCULATOR-NOT-FOUND-01": {
349
+ title: "errors.calculator.CALCULATOR-NOT-FOUND-01.title",
350
+ message: "errors.calculator.CALCULATOR-NOT-FOUND-01.message",
351
+ code: 420,
352
+ type: "modal",
353
+ level: "warning"
354
+ },
355
+ "CALCULATOR-NOT-FOUND-02": {
356
+ title: "errors.calculator.CALCULATOR-NOT-FOUND-02.title",
357
+ message: "errors.calculator.CALCULATOR-NOT-FOUND-02.message",
358
+ code: 420,
359
+ type: "modal",
360
+ level: "warning"
361
+ },
362
+ "CALCULATOR-SAP-ERROR-01": {
363
+ title: "errors.calculator.CALCULATOR-SAP-ERROR-01.title",
364
+ message: "errors.calculator.CALCULATOR-SAP-ERROR-01.message",
365
+ code: 420,
366
+ type: "modal",
367
+ level: "warning"
368
+ },
369
+ "CALCULATOR-SAP-ERROR-02": {
370
+ title: "errors.calculator.CALCULATOR-SAP-ERROR-02.title",
371
+ message: "errors.calculator.CALCULATOR-SAP-ERROR-02.message",
372
+ code: 420,
373
+ type: "modal",
374
+ level: "warning"
375
+ },
376
+ "CALCULATOR-SAP-ERROR-03": {
377
+ title: "errors.calculator.CALCULATOR-SAP-ERROR-03.title",
378
+ message: "errors.calculator.CALCULATOR-SAP-ERROR-03.message",
379
+ code: 420,
380
+ type: "modal",
381
+ level: "warning"
382
+ },
383
+ "CALCULATOR-SAP-ERROR-04": {
384
+ title: "errors.calculator.CALCULATOR-SAP-ERROR-04.title",
385
+ message: "errors.calculator.CALCULATOR-SAP-ERROR-04.message",
386
+ code: 420,
387
+ type: "modal",
388
+ level: "warning"
389
+ },
390
+ "CALCULATOR-GENERIC-001": {
391
+ title: "errors.calculator.CALCULATOR-GENERIC-001.title",
392
+ message: "errors.calculator.CALCULATOR-GENERIC-001.message",
393
+ code: 420,
394
+ type: "modal",
395
+ level: "warning"
73
396
  }
74
397
  };
75
- class S extends J {
76
- get(r = "default", t) {
77
- var o, n;
78
- if (r instanceof Error)
79
- return this.logError(r.message), {
80
- ...u.internalError,
81
- title: E(u.internalError.title),
82
- message: E(u.internalError.message),
83
- uuid: t
398
+ class d extends M {
399
+ get(t = "default", e) {
400
+ var o, s;
401
+ if (t instanceof Error)
402
+ return this.logError(t.message), {
403
+ ...U.internalError,
404
+ title: g(U.internalError.title),
405
+ message: g(U.internalError.message),
406
+ uuid: e
84
407
  };
85
- const e = typeof r == "string" ? r : r.code ?? r.errorType, i = typeof r == "string" ? {} : { ...r };
408
+ const r = typeof t == "string" ? t : t.code ?? t.errorType, a = typeof t == "string" ? {} : { ...t };
86
409
  return {
87
- ...u[e] ?? u.default,
88
- title: E(
89
- ((o = u[e]) == null ? void 0 : o.title) ?? u.default.title,
90
- i
410
+ ...U[r] ?? U.default,
411
+ title: g(
412
+ ((o = U[r]) == null ? void 0 : o.title) ?? U.default.title,
413
+ a
91
414
  ),
92
- message: E(
93
- ((n = u[e]) == null ? void 0 : n.message) ?? u.default.message,
94
- i
415
+ message: g(
416
+ ((s = U[r]) == null ? void 0 : s.message) ?? U.default.message,
417
+ a
95
418
  ),
96
- uuid: t
419
+ uuid: e
97
420
  };
98
421
  }
99
422
  }
100
- class ct extends T {
423
+ class ne extends b {
101
424
  constructor() {
102
425
  super(...arguments);
103
- h(this, "uuid", "");
104
- h(this, "session", null);
426
+ L(this, "uuid", "");
427
+ L(this, "session", null);
105
428
  }
106
- setSession(t) {
107
- this.session = t;
429
+ setSession(e) {
430
+ this.session = e;
108
431
  }
109
432
  getSession() {
110
433
  if (!this.session)
111
- throw new S().get("SESSION_NOT_FOUND");
434
+ throw new d().get("SESSION_NOT_FOUND");
112
435
  return this.session;
113
436
  }
114
- returnData(t, e, i) {
115
- const o = this.encode(e, i);
116
- t.status(200).json(o);
437
+ returnData(e, r, a) {
438
+ const o = this.encode(r, a);
439
+ e.status(200).json(o);
117
440
  }
118
- returnError(t, e) {
119
- return e != null && e.uuid ? t.status(520).json(e) : t.status(520).json(new S().get(e, this.uuid));
441
+ returnError(e, r) {
442
+ return r != null && r.uuid ? e.status(520).json(r) : e.status(520).json(new d().get(r, this.uuid));
120
443
  }
121
- get(t) {
122
- return this.logDebug("get ApiMiddleware"), (e, i) => {
444
+ get(e) {
445
+ return this.logDebug("get ApiMiddleware"), (r, a) => {
123
446
  var o;
124
- this.logDebug("return ApiMiddleware"), this.uuid = (o = e == null ? void 0 : e.body) == null ? void 0 : o.uuid, d(e).pipe(
125
- m(
126
- (n) => A({
127
- params: d(this.decode(n.body)),
128
- headers: d(n.headers)
447
+ this.logDebug("return ApiMiddleware"), this.uuid = (o = r == null ? void 0 : r.body) == null ? void 0 : o.uuid, R(r).pipe(
448
+ E(
449
+ (s) => D({
450
+ params: R(this.decode(s.body)),
451
+ headers: R(s.headers)
129
452
  })
130
453
  ),
131
- m(
132
- ({ params: n, headers: a }) => A({
133
- response: t(n, this.uuid, a),
134
- headers: d(a),
135
- params: d(n)
454
+ E(
455
+ ({ params: s, headers: A }) => D({
456
+ response: e(s, this.uuid, A),
457
+ headers: R(A),
458
+ params: R(s)
136
459
  })
137
460
  ),
138
- m(({ params: n, response: a, headers: f }) => (this.logDebug(
139
- `ApiMiddleware \x1B[37m <URL>: \x1B[33m ${e.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(f)} \x1B[37m <UUID> \x1B[33m ${e.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(n)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(a)}`
140
- ), d(a))),
141
- b((n) => {
142
- var a;
461
+ E(({ params: s, response: A, headers: i }) => (this.logDebug(
462
+ `ApiMiddleware \x1B[37m <URL>: \x1B[33m ${r.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(i)} \x1B[37m <UUID> \x1B[33m ${r.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(s)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(A)}`
463
+ ), R(A))),
464
+ h((s) => {
465
+ var A;
143
466
  return this.logError(
144
- `ApiMiddleware <URL>: ${e == null ? void 0 : e.url} <HEADERS>: ${JSON.stringify(e == null ? void 0 : e.headers)} <UUID> ${(a = e == null ? void 0 : e.body) == null ? void 0 : a.uuid} <PARAMS> ${JSON.stringify(e == null ? void 0 : e.body)} <ERROR>: ${JSON.stringify(n)}`
145
- ), this.returnError(i, n), D;
467
+ `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(s)}`
468
+ ), this.returnError(a, s), I;
146
469
  })
147
470
  ).subscribe({
148
- next: (n) => {
149
- this.logDebug("ApiMiddleware subscribe next", JSON.stringify(n)), this.returnData(i, n, this.uuid);
471
+ next: (s) => {
472
+ this.logDebug("ApiMiddleware subscribe next", JSON.stringify(s)), this.returnData(a, s, this.uuid);
150
473
  }
151
474
  });
152
475
  };
153
476
  }
154
477
  }
155
- const F = process.env.ID_FRONT ?? "NOT_AVAILABLE";
156
- class dt extends M {
157
- constructor(t, e, i = {}) {
158
- super(i);
159
- h(this, "apiUrl");
160
- h(this, "method");
161
- this.apiUrl = t, this.method = e ?? "POST";
478
+ const J = process.env.ID_FRONT ?? "NOT_AVAILABLE";
479
+ class Re extends Q {
480
+ constructor(e, r, a = {}) {
481
+ super(a);
482
+ L(this, "apiUrl");
483
+ L(this, "method");
484
+ this.apiUrl = e, this.method = r ?? "POST";
162
485
  }
163
- errorHandler(t, e) {
164
- if (t != null && t.errors)
165
- throw new S().get(t.errors[0], e);
166
- return !(t != null && t.errors);
486
+ errorHandler(e, r) {
487
+ if (e != null && e.errors)
488
+ throw new d().get(e.errors[0], r);
489
+ return !(e != null && e.errors);
167
490
  }
168
- formatParams(t) {
491
+ formatParams(e) {
169
492
  return JSON.stringify({
170
493
  data: {
171
- type: F,
172
- attributes: t
494
+ type: J,
495
+ attributes: e
173
496
  }
174
497
  });
175
498
  }
176
- fetchData(t = {}, e) {
499
+ fetchData(e = {}, r) {
177
500
  return this.getHeaders().pipe(
178
- m(
179
- (i) => U(
501
+ E(
502
+ (a) => f(
180
503
  this.apiUrl,
181
504
  {
182
505
  method: "POST",
183
- headers: i,
184
- body: this.formatParams(t),
506
+ headers: a,
507
+ body: this.formatParams(e),
185
508
  selector: (o) => o.json()
186
509
  }
187
510
  ).pipe(
188
- m((o) => (this.logDebug(
189
- `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${e} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
190
- i
511
+ E((o) => (this.logDebug(
512
+ `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${r} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
513
+ a
191
514
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
192
- this.formatParams(t)
515
+ this.formatParams(e)
193
516
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
194
- ), d(o)))
517
+ ), R(o)))
195
518
  )
196
519
  ),
197
- w((i) => this.errorHandler(i, e))
520
+ y((a) => this.errorHandler(a, r))
198
521
  );
199
522
  }
200
- fetchCustomData(t = {}, e) {
523
+ fetchCustomData(e = {}, r) {
201
524
  return this.getHeaders().pipe(
202
- m(
203
- (i) => U(this.apiUrl, {
525
+ E(
526
+ (a) => f(this.apiUrl, {
204
527
  method: this.method,
205
- headers: i,
206
- body: this.method === "GET" ? null : JSON.stringify(t),
528
+ headers: a,
529
+ body: this.method === "GET" ? null : JSON.stringify(e),
207
530
  selector: (o) => o.json()
208
531
  }).pipe(
209
- m((o) => (this.logDebug(
210
- `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m \x1B[37m <METHOD>: \x1B[33m ${this.method} <UUID>: \x1B[33m ${e} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
211
- i
532
+ E((o) => (this.logDebug(
533
+ `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(
534
+ a
212
535
  )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
213
- t
536
+ e
214
537
  )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
215
- ), d(o)))
538
+ ), R(o)))
216
539
  )
217
540
  )
218
541
  );
219
542
  }
220
543
  }
221
544
  const G = /^(?:[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;
222
- function _(s) {
223
- return typeof s == "string" && G.test(s);
545
+ function V(l) {
546
+ return typeof l == "string" && G.test(l);
224
547
  }
225
- function Y(s) {
226
- if (!_(s))
548
+ function j(l) {
549
+ if (!V(l))
227
550
  throw TypeError("Invalid UUID");
228
- let r;
229
- const t = new Uint8Array(16);
230
- return t[0] = (r = parseInt(s.slice(0, 8), 16)) >>> 24, t[1] = r >>> 16 & 255, t[2] = r >>> 8 & 255, t[3] = r & 255, t[4] = (r = parseInt(s.slice(9, 13), 16)) >>> 8, t[5] = r & 255, t[6] = (r = parseInt(s.slice(14, 18), 16)) >>> 8, t[7] = r & 255, t[8] = (r = parseInt(s.slice(19, 23), 16)) >>> 8, t[9] = r & 255, t[10] = (r = parseInt(s.slice(24, 36), 16)) / 1099511627776 & 255, t[11] = r / 4294967296 & 255, t[12] = r >>> 24 & 255, t[13] = r >>> 16 & 255, t[14] = r >>> 8 & 255, t[15] = r & 255, t;
551
+ let t;
552
+ const e = new Uint8Array(16);
553
+ return e[0] = (t = parseInt(l.slice(0, 8), 16)) >>> 24, e[1] = t >>> 16 & 255, e[2] = t >>> 8 & 255, e[3] = t & 255, e[4] = (t = parseInt(l.slice(9, 13), 16)) >>> 8, e[5] = t & 255, e[6] = (t = parseInt(l.slice(14, 18), 16)) >>> 8, e[7] = t & 255, e[8] = (t = parseInt(l.slice(19, 23), 16)) >>> 8, e[9] = t & 255, e[10] = (t = parseInt(l.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;
231
554
  }
232
- function k(s) {
233
- s = unescape(encodeURIComponent(s));
234
- const r = [];
235
- for (let t = 0; t < s.length; ++t)
236
- r.push(s.charCodeAt(t));
237
- return r;
555
+ function Y(l) {
556
+ l = unescape(encodeURIComponent(l));
557
+ const t = [];
558
+ for (let e = 0; e < l.length; ++e)
559
+ t.push(l.charCodeAt(e));
560
+ return t;
238
561
  }
239
- const V = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", K = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
240
- function W(s, r, t) {
241
- function e(i, o, n, a) {
242
- var f;
243
- if (typeof i == "string" && (i = k(i)), typeof o == "string" && (o = Y(o)), ((f = o) === null || f === void 0 ? void 0 : f.length) !== 16)
562
+ const Z = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", _ = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
563
+ function k(l, t, e) {
564
+ function r(a, o, s, A) {
565
+ var i;
566
+ if (typeof a == "string" && (a = Y(a)), typeof o == "string" && (o = j(o)), ((i = o) === null || i === void 0 ? void 0 : i.length) !== 16)
244
567
  throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
245
- let c = new Uint8Array(16 + i.length);
246
- if (c.set(o), c.set(i, o.length), c = t(c), c[6] = c[6] & 15 | r, c[8] = c[8] & 63 | 128, n) {
247
- a = a || 0;
248
- for (let g = 0; g < 16; ++g)
249
- n[a + g] = c[g];
250
- return n;
568
+ let n = new Uint8Array(16 + a.length);
569
+ if (n.set(o), n.set(a, o.length), n = e(n), n[6] = n[6] & 15 | t, n[8] = n[8] & 63 | 128, s) {
570
+ A = A || 0;
571
+ for (let C = 0; C < 16; ++C)
572
+ s[A + C] = n[C];
573
+ return s;
251
574
  }
252
- return j(c);
575
+ return $(n);
253
576
  }
254
577
  try {
255
- e.name = s;
578
+ r.name = l;
256
579
  } catch {
257
580
  }
258
- return e.DNS = V, e.URL = K, e;
581
+ return r.DNS = Z, r.URL = _, r;
259
582
  }
260
- function X(s, r, t, e) {
261
- switch (s) {
583
+ function K(l, t, e, r) {
584
+ switch (l) {
262
585
  case 0:
263
- return r & t ^ ~r & e;
586
+ return t & e ^ ~t & r;
264
587
  case 1:
265
- return r ^ t ^ e;
588
+ return t ^ e ^ r;
266
589
  case 2:
267
- return r & t ^ r & e ^ t & e;
590
+ return t & e ^ t & r ^ e & r;
268
591
  case 3:
269
- return r ^ t ^ e;
592
+ return t ^ e ^ r;
270
593
  }
271
594
  }
272
- function B(s, r) {
273
- return s << r | s >>> 32 - r;
595
+ function u(l, t) {
596
+ return l << t | l >>> 32 - t;
274
597
  }
275
- function Z(s) {
276
- const r = [1518500249, 1859775393, 2400959708, 3395469782], t = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
277
- if (typeof s == "string") {
278
- const n = unescape(encodeURIComponent(s));
279
- s = [];
280
- for (let a = 0; a < n.length; ++a)
281
- s.push(n.charCodeAt(a));
598
+ function W(l) {
599
+ const t = [1518500249, 1859775393, 2400959708, 3395469782], e = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
600
+ if (typeof l == "string") {
601
+ const s = unescape(encodeURIComponent(l));
602
+ l = [];
603
+ for (let A = 0; A < s.length; ++A)
604
+ l.push(s.charCodeAt(A));
282
605
  } else
283
- Array.isArray(s) || (s = Array.prototype.slice.call(s));
284
- s.push(128);
285
- const e = s.length / 4 + 2, i = Math.ceil(e / 16), o = new Array(i);
286
- for (let n = 0; n < i; ++n) {
287
- const a = new Uint32Array(16);
288
- for (let f = 0; f < 16; ++f)
289
- a[f] = s[n * 64 + f * 4] << 24 | s[n * 64 + f * 4 + 1] << 16 | s[n * 64 + f * 4 + 2] << 8 | s[n * 64 + f * 4 + 3];
290
- o[n] = a;
606
+ Array.isArray(l) || (l = Array.prototype.slice.call(l));
607
+ l.push(128);
608
+ const r = l.length / 4 + 2, a = Math.ceil(r / 16), o = new Array(a);
609
+ for (let s = 0; s < a; ++s) {
610
+ const A = new Uint32Array(16);
611
+ for (let i = 0; i < 16; ++i)
612
+ A[i] = l[s * 64 + i * 4] << 24 | l[s * 64 + i * 4 + 1] << 16 | l[s * 64 + i * 4 + 2] << 8 | l[s * 64 + i * 4 + 3];
613
+ o[s] = A;
291
614
  }
292
- o[i - 1][14] = (s.length - 1) * 8 / Math.pow(2, 32), o[i - 1][14] = Math.floor(o[i - 1][14]), o[i - 1][15] = (s.length - 1) * 8 & 4294967295;
293
- for (let n = 0; n < i; ++n) {
294
- const a = new Uint32Array(80);
295
- for (let l = 0; l < 16; ++l)
296
- a[l] = o[n][l];
297
- for (let l = 16; l < 80; ++l)
298
- a[l] = B(a[l - 3] ^ a[l - 8] ^ a[l - 14] ^ a[l - 16], 1);
299
- let f = t[0], c = t[1], g = t[2], x = t[3], y = t[4];
300
- for (let l = 0; l < 80; ++l) {
301
- const R = Math.floor(l / 20), $ = B(f, 5) + X(R, c, g, x) + y + r[R] + a[l] >>> 0;
302
- y = x, x = g, g = B(c, 30) >>> 0, c = f, f = $;
615
+ o[a - 1][14] = (l.length - 1) * 8 / Math.pow(2, 32), o[a - 1][14] = Math.floor(o[a - 1][14]), o[a - 1][15] = (l.length - 1) * 8 & 4294967295;
616
+ for (let s = 0; s < a; ++s) {
617
+ const A = new Uint32Array(80);
618
+ for (let c = 0; c < 16; ++c)
619
+ A[c] = o[s][c];
620
+ for (let c = 16; c < 80; ++c)
621
+ A[c] = u(A[c - 3] ^ A[c - 8] ^ A[c - 14] ^ A[c - 16], 1);
622
+ let i = e[0], n = e[1], C = e[2], T = e[3], O = e[4];
623
+ for (let c = 0; c < 80; ++c) {
624
+ const S = Math.floor(c / 20), x = u(i, 5) + K(S, n, C, T) + O + t[S] + A[c] >>> 0;
625
+ O = T, T = C, C = u(n, 30) >>> 0, n = i, i = x;
303
626
  }
304
- t[0] = t[0] + f >>> 0, t[1] = t[1] + c >>> 0, t[2] = t[2] + g >>> 0, t[3] = t[3] + x >>> 0, t[4] = t[4] + y >>> 0;
627
+ e[0] = e[0] + i >>> 0, e[1] = e[1] + n >>> 0, e[2] = e[2] + C >>> 0, e[3] = e[3] + T >>> 0, e[4] = e[4] + O >>> 0;
305
628
  }
306
- return [t[0] >> 24 & 255, t[0] >> 16 & 255, t[0] >> 8 & 255, t[0] & 255, t[1] >> 24 & 255, t[1] >> 16 & 255, t[1] >> 8 & 255, t[1] & 255, t[2] >> 24 & 255, t[2] >> 16 & 255, t[2] >> 8 & 255, t[2] & 255, t[3] >> 24 & 255, t[3] >> 16 & 255, t[3] >> 8 & 255, t[3] & 255, t[4] >> 24 & 255, t[4] >> 16 & 255, t[4] >> 8 & 255, t[4] & 255];
629
+ 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];
307
630
  }
308
- const Q = W("v5", 80, Z), N = Q;
309
- class mt extends H {
310
- constructor(t, e = "POST", i = {}) {
631
+ const X = k("v5", 80, W), p = X;
632
+ class Ee extends F {
633
+ constructor(e, r = "POST", a = {}) {
311
634
  super();
312
- h(this, "apiUrl");
313
- h(this, "method");
314
- h(this, "headers");
315
- h(this, "isLoadingEnabled", !0);
316
- this.apiUrl = t, this.method = e, this.headers = {
635
+ L(this, "apiUrl");
636
+ L(this, "method");
637
+ L(this, "headers");
638
+ L(this, "isLoadingEnabled", !0);
639
+ this.apiUrl = e, this.method = r, this.headers = {
317
640
  "Content-Type": "application/json",
318
- ...i
641
+ ...a
319
642
  };
320
643
  }
321
- setIsLoadingEnabled(t) {
322
- this.isLoadingEnabled = t;
644
+ setIsLoadingEnabled(e) {
645
+ this.isLoadingEnabled = e;
323
646
  }
324
- errorHandler(t) {
325
- return t.code && (t.type === "modal" || t.type === "message") && (O.getInstance().setSubject(t), p.getInstance().setSubject(!1)), !t.code;
647
+ errorHandler(e) {
648
+ return e.code && (e.type === "modal" || e.type === "message") && (B.getInstance().setSubject(e), m.getInstance().setSubject(!1)), !e.code;
326
649
  }
327
- fetchData(t = {}) {
328
- const e = (/* @__PURE__ */ new Date()).toISOString(), i = N(e, N.URL), o = this.encode({ ...t }, i);
329
- p.getInstance().setSubject(this.isLoadingEnabled);
330
- const a = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
331
- return U(this.apiUrl, {
650
+ fetchData(e = {}) {
651
+ const r = (/* @__PURE__ */ new Date()).toISOString(), a = p(r, p.URL), o = this.encode({ ...e }, a);
652
+ m.getInstance().setSubject(this.isLoadingEnabled);
653
+ const A = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
654
+ return f(this.apiUrl, {
332
655
  method: this.method,
333
- headers: { ...this.headers, flow: a },
656
+ headers: { ...this.headers, flow: A },
334
657
  body: o,
335
- selector: (f) => f.json()
658
+ selector: (i) => i.json()
336
659
  }).pipe(
337
- m((f) => d(this.decode(f))),
338
- m((f) => (this.logDebug(
339
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(t)} <BODY> ${o} <RESPONSE>: ${JSON.stringify(f)}`
340
- ), d(f))),
341
- w(this.errorHandler),
342
- m((f) => (p.getInstance().setSubject(!1), d(f))),
343
- b((f) => (p.getInstance().setSubject(!1), O.getInstance().setSubject(
344
- new S().get(f, i)
345
- ), D))
660
+ E((i) => R(this.decode(i))),
661
+ E((i) => (this.logDebug(
662
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${o} <RESPONSE>: ${JSON.stringify(i)}`
663
+ ), R(i))),
664
+ y(this.errorHandler),
665
+ E((i) => (m.getInstance().setSubject(!1), R(i))),
666
+ h((i) => (m.getInstance().setSubject(!1), B.getInstance().setSubject(
667
+ new d().get(i, a)
668
+ ), I))
346
669
  );
347
670
  }
348
671
  }
349
672
  export {
350
- ct as ApiMiddleware,
351
- S as ErrorCatalog,
352
- dt as FetchServiceBE,
353
- mt as FetchServiceFE,
354
- p as LoadingHandler,
355
- O as MessageHandler,
356
- pt as RxSubjectManager,
357
- ut as ServiceToken
673
+ ne as ApiMiddleware,
674
+ d as ErrorCatalog,
675
+ Re as FetchServiceBE,
676
+ Ee as FetchServiceFE,
677
+ m as LoadingHandler,
678
+ B as MessageHandler,
679
+ me as RxSubjectManager,
680
+ Ue as ServiceToken
358
681
  };