mp-front-cli 0.0.35 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/core/errors/error-catalog.d.ts +2 -1
  2. package/dist/core/errors/error-catalog.d.ts.map +1 -1
  3. package/dist/core/errors/index.d.ts +0 -1
  4. package/dist/core/errors/index.d.ts.map +1 -1
  5. package/dist/core/interfaces/message.d.ts +1 -0
  6. package/dist/core/interfaces/message.d.ts.map +1 -1
  7. package/dist/core/middleware/index.d.ts +6 -4
  8. package/dist/core/middleware/index.d.ts.map +1 -1
  9. package/dist/core/utils/api-request/fetch-service-be.d.ts +2 -5
  10. package/dist/core/utils/api-request/fetch-service-be.d.ts.map +1 -1
  11. package/dist/core/utils/api-request/fetch-service-fe.d.ts +5 -5
  12. package/dist/core/utils/api-request/fetch-service-fe.d.ts.map +1 -1
  13. package/dist/core/utils/custom-catch-error.d.ts +5 -0
  14. package/dist/core/utils/custom-catch-error.d.ts.map +1 -0
  15. package/dist/core/utils/custom-encoder.d.ts +1 -1
  16. package/dist/core/utils/custom-encoder.d.ts.map +1 -1
  17. package/dist/core/utils/custom-header.d.ts +5 -237
  18. package/dist/core/utils/custom-header.d.ts.map +1 -1
  19. package/dist/{custom-encoder-b2078b5c.js → custom-encoder-6737c6cb.js} +244 -245
  20. package/dist/{custom-header-9a9c64e2.js → custom-header-4aec1dac.js} +109 -99
  21. package/dist/{custom-validator-16ec563a.js → custom-validator-ae5da0a7.js} +436 -449
  22. package/dist/{index-6f6eb615.js → index-df4e0539.js} +4 -0
  23. package/dist/lang/common/errors/es_MX/index.d.ts +4 -0
  24. package/dist/lang/common/errors/es_MX/index.d.ts.map +1 -1
  25. package/dist/message-handler-d90f2bb6.js +35 -0
  26. package/dist/mp-front-cli-all.es.js +13 -13
  27. package/dist/mp-front-cli-core.es.js +196 -92
  28. package/dist/mp-front-cli-encoder.es.js +1 -1
  29. package/dist/mp-front-cli-header.es.js +6 -5
  30. package/dist/mp-front-cli-locale.es.js +1 -1
  31. package/dist/mp-front-cli-utils-rxjs.es.js +11 -36
  32. package/dist/mp-front-cli-validator.es.js +3 -3
  33. package/package.json +4 -2
@@ -1,9 +1,15 @@
1
1
  var W = Object.defineProperty;
2
2
  var J = (r, t, e) => t in r ? W(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
3
  var v = (r, t, e) => (J(r, typeof t != "symbol" ? t + "" : t, e), e);
4
- import { switchMap as _, of as S, catchError as N } from "rxjs";
5
- import { CustomLogger as V } from "./mp-front-cli-logger.es.js";
6
- import { C as q } from "./custom-validator-16ec563a.js";
4
+ import { EMPTY as N, switchMap as _, of as S, catchError as V } from "rxjs";
5
+ import { CustomLogger as q } from "./mp-front-cli-logger.es.js";
6
+ import { C as z, E as Q } from "./custom-validator-ae5da0a7.js";
7
+ import { M as X } from "./message-handler-d90f2bb6.js";
8
+ class Z extends z {
9
+ catch(t, e) {
10
+ return console.log(`CustomCatchError ${t}`), X.getInstance().setSubject(new Q().get(t, e)), N;
11
+ }
12
+ }
7
13
  var I = function(r, t) {
8
14
  return I = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
9
15
  e.__proto__ = n;
@@ -12,7 +18,7 @@ var I = function(r, t) {
12
18
  Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
13
19
  }, I(r, t);
14
20
  };
15
- function B(r, t) {
21
+ function x(r, t) {
16
22
  if (typeof t != "function" && t !== null)
17
23
  throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
18
24
  I(r, t);
@@ -31,7 +37,7 @@ var w = function() {
31
37
  return t;
32
38
  }, w.apply(this, arguments);
33
39
  };
34
- function z(r, t) {
40
+ function ee(r, t) {
35
41
  var e = {};
36
42
  for (var n in r)
37
43
  Object.prototype.hasOwnProperty.call(r, n) && t.indexOf(n) < 0 && (e[n] = r[n]);
@@ -40,7 +46,7 @@ function z(r, t) {
40
46
  t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[i]) && (e[n[i]] = r[n[i]]);
41
47
  return e;
42
48
  }
43
- function Q(r, t, e, n) {
49
+ function re(r, t, e, n) {
44
50
  function i(o) {
45
51
  return o instanceof e ? o : new e(function(s) {
46
52
  s(o);
@@ -67,7 +73,7 @@ function Q(r, t, e, n) {
67
73
  a((n = n.apply(r, t || [])).next());
68
74
  });
69
75
  }
70
- function F(r, t) {
76
+ function M(r, t) {
71
77
  var e = { label: 0, sent: function() {
72
78
  if (o[0] & 1)
73
79
  throw o[1];
@@ -144,7 +150,7 @@ function g(r) {
144
150
  };
145
151
  throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
146
152
  }
147
- function P(r, t) {
153
+ function E(r, t) {
148
154
  var e = typeof Symbol == "function" && r[Symbol.iterator];
149
155
  if (!e)
150
156
  return r;
@@ -164,7 +170,7 @@ function P(r, t) {
164
170
  }
165
171
  return o;
166
172
  }
167
- function E(r, t, e) {
173
+ function P(r, t, e) {
168
174
  if (e || arguments.length === 2)
169
175
  for (var n = 0, i = t.length, o; n < i; n++)
170
176
  (o || !(n in t)) && (o || (o = Array.prototype.slice.call(t, 0, n)), o[n] = t[n]);
@@ -173,7 +179,7 @@ function E(r, t, e) {
173
179
  function m(r) {
174
180
  return this instanceof m ? (this.v = r, this) : new m(r);
175
181
  }
176
- function X(r, t, e) {
182
+ function te(r, t, e) {
177
183
  if (!Symbol.asyncIterator)
178
184
  throw new TypeError("Symbol.asyncIterator is not defined.");
179
185
  var n = e.apply(r, t || []), i, o = [];
@@ -207,7 +213,7 @@ function X(r, t, e) {
207
213
  l(d), o.shift(), o.length && c(o[0][0], o[0][1]);
208
214
  }
209
215
  }
210
- function Z(r) {
216
+ function ne(r) {
211
217
  if (!Symbol.asyncIterator)
212
218
  throw new TypeError("Symbol.asyncIterator is not defined.");
213
219
  var t = r[Symbol.asyncIterator], e;
@@ -230,13 +236,13 @@ function Z(r) {
230
236
  function h(r) {
231
237
  return typeof r == "function";
232
238
  }
233
- function ee(r) {
239
+ function oe(r) {
234
240
  var t = function(n) {
235
241
  Error.call(n), n.stack = new Error().stack;
236
242
  }, e = r(t);
237
243
  return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
238
244
  }
239
- var U = ee(function(r) {
245
+ var U = oe(function(r) {
240
246
  return function(e) {
241
247
  r(this), this.message = e ? e.length + ` errors occurred during unsubscription:
242
248
  ` + e.map(function(n, i) {
@@ -251,7 +257,7 @@ function k(r, t) {
251
257
  0 <= e && r.splice(e, 1);
252
258
  }
253
259
  }
254
- var x = function() {
260
+ var B = function() {
255
261
  function r(t) {
256
262
  this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
257
263
  }
@@ -293,9 +299,9 @@ var x = function() {
293
299
  for (var l = g(y), d = l.next(); !d.done; d = l.next()) {
294
300
  var A = d.value;
295
301
  try {
296
- D(A);
302
+ j(A);
297
303
  } catch (p) {
298
- o = o ?? [], p instanceof U ? o = E(E([], P(o)), P(p.errors)) : o.push(p);
304
+ o = o ?? [], p instanceof U ? o = P(P([], E(o)), E(p.errors)) : o.push(p);
299
305
  }
300
306
  }
301
307
  } catch (p) {
@@ -316,7 +322,7 @@ var x = function() {
316
322
  var e;
317
323
  if (t && t !== this)
318
324
  if (this.closed)
319
- D(t);
325
+ j(t);
320
326
  else {
321
327
  if (t instanceof r) {
322
328
  if (t.closed || t._hasParent(this))
@@ -342,11 +348,11 @@ var x = function() {
342
348
  return t.closed = !0, t;
343
349
  }(), r;
344
350
  }();
345
- x.EMPTY;
346
- function M(r) {
347
- return r instanceof x || r && "closed" in r && h(r.remove) && h(r.add) && h(r.unsubscribe);
351
+ B.EMPTY;
352
+ function F(r) {
353
+ return r instanceof B || r && "closed" in r && h(r.remove) && h(r.add) && h(r.unsubscribe);
348
354
  }
349
- function D(r) {
355
+ function j(r) {
350
356
  h(r) ? r() : r.unsubscribe();
351
357
  }
352
358
  var $ = {
@@ -360,7 +366,7 @@ var $ = {
360
366
  for (var e = [], n = 2; n < arguments.length; n++)
361
367
  e[n - 2] = arguments[n];
362
368
  var i = C.delegate;
363
- return i != null && i.setTimeout ? i.setTimeout.apply(i, E([r, t], P(e))) : setTimeout.apply(void 0, E([r, t], P(e)));
369
+ return i != null && i.setTimeout ? i.setTimeout.apply(i, P([r, t], E(e))) : setTimeout.apply(void 0, P([r, t], E(e)));
364
370
  },
365
371
  clearTimeout: function(r) {
366
372
  var t = C.delegate;
@@ -373,16 +379,16 @@ function G(r) {
373
379
  throw r;
374
380
  });
375
381
  }
376
- function j() {
382
+ function D() {
377
383
  }
378
- function re(r) {
384
+ function ie(r) {
379
385
  r();
380
386
  }
381
387
  var R = function(r) {
382
- B(t, r);
388
+ x(t, r);
383
389
  function t(e) {
384
390
  var n = r.call(this) || this;
385
- return n.isStopped = !1, e ? (n.destination = e, M(e) && e.add(n)) : n.destination = ie, n;
391
+ return n.isStopped = !1, e ? (n.destination = e, F(e) && e.add(n)) : n.destination = ue, n;
386
392
  }
387
393
  return t.create = function(e, n, i) {
388
394
  return new H(e, n, i);
@@ -409,11 +415,11 @@ var R = function(r) {
409
415
  this.unsubscribe();
410
416
  }
411
417
  }, t;
412
- }(x), te = Function.prototype.bind;
418
+ }(B), se = Function.prototype.bind;
413
419
  function O(r, t) {
414
- return te.call(r, t);
420
+ return se.call(r, t);
415
421
  }
416
- var ne = function() {
422
+ var ae = function() {
417
423
  function r(t) {
418
424
  this.partialObserver = t;
419
425
  }
@@ -445,7 +451,7 @@ var ne = function() {
445
451
  }
446
452
  }, r;
447
453
  }(), H = function(r) {
448
- B(t, r);
454
+ x(t, r);
449
455
  function t(e, n, i) {
450
456
  var o = r.call(this) || this, s;
451
457
  if (h(e) || !e)
@@ -464,27 +470,27 @@ var ne = function() {
464
470
  complete: e.complete && O(e.complete, c)
465
471
  }) : s = e;
466
472
  }
467
- return o.destination = new ne(s), o;
473
+ return o.destination = new ae(s), o;
468
474
  }
469
475
  return t;
470
476
  }(R);
471
477
  function T(r) {
472
478
  G(r);
473
479
  }
474
- function oe(r) {
480
+ function ce(r) {
475
481
  throw r;
476
482
  }
477
- var ie = {
483
+ var ue = {
478
484
  closed: !0,
479
- next: j,
480
- error: oe,
481
- complete: j
485
+ next: D,
486
+ error: ce,
487
+ complete: D
482
488
  };
483
- function se(r, t, e, n, i) {
484
- return new ae(r, t, e, n, i);
489
+ function le(r, t, e, n, i) {
490
+ return new fe(r, t, e, n, i);
485
491
  }
486
- var ae = function(r) {
487
- B(t, r);
492
+ var fe = function(r) {
493
+ x(t, r);
488
494
  function t(e, n, i, o, s, c) {
489
495
  var u = r.call(this, e) || this;
490
496
  return u.onFinalize = s, u.shouldUnsubscribe = c, u._next = n ? function(a) {
@@ -521,11 +527,11 @@ var ae = function(r) {
521
527
  }(R), K = function() {
522
528
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
523
529
  }();
524
- function ce(r) {
530
+ function he(r) {
525
531
  return r;
526
532
  }
527
- function ue(r) {
528
- return r.length === 0 ? ce : r.length === 1 ? r[0] : function(e) {
533
+ function pe(r) {
534
+ return r.length === 0 ? he : r.length === 1 ? r[0] : function(e) {
529
535
  return r.reduce(function(n, i) {
530
536
  return i(n);
531
537
  }, e);
@@ -539,8 +545,8 @@ var b = function() {
539
545
  var e = new r();
540
546
  return e.source = this, e.operator = t, e;
541
547
  }, r.prototype.subscribe = function(t, e, n) {
542
- var i = this, o = fe(t) ? t : new H(t, e, n);
543
- return re(function() {
548
+ var i = this, o = de(t) ? t : new H(t, e, n);
549
+ return ie(function() {
544
550
  var s = i, c = s.operator, u = s.source;
545
551
  o.add(c ? c.call(o, u) : u ? i._subscribe(o) : i._trySubscribe(o));
546
552
  }), o;
@@ -574,7 +580,7 @@ var b = function() {
574
580
  }, r.prototype.pipe = function() {
575
581
  for (var t = [], e = 0; e < arguments.length; e++)
576
582
  t[e] = arguments[e];
577
- return ue(t)(this);
583
+ return pe(t)(this);
578
584
  }, r.prototype.toPromise = function(t) {
579
585
  var e = this;
580
586
  return t = L(t), new t(function(n, i) {
@@ -595,38 +601,38 @@ function L(r) {
595
601
  var t;
596
602
  return (t = r ?? $.Promise) !== null && t !== void 0 ? t : Promise;
597
603
  }
598
- function le(r) {
604
+ function ye(r) {
599
605
  return r && h(r.next) && h(r.error) && h(r.complete);
600
606
  }
601
- function fe(r) {
602
- return r && r instanceof R || le(r) && M(r);
607
+ function de(r) {
608
+ return r && r instanceof R || ye(r) && F(r);
603
609
  }
604
- var he = function(r) {
610
+ var ve = function(r) {
605
611
  return r && typeof r.length == "number" && typeof r != "function";
606
612
  };
607
- function pe(r) {
613
+ function be(r) {
608
614
  return h(r == null ? void 0 : r.then);
609
615
  }
610
- function ye(r) {
616
+ function me(r) {
611
617
  return h(r[K]);
612
618
  }
613
- function de(r) {
619
+ function Ae(r) {
614
620
  return Symbol.asyncIterator && h(r == null ? void 0 : r[Symbol.asyncIterator]);
615
621
  }
616
- function ve(r) {
622
+ function _e(r) {
617
623
  return new TypeError("You provided " + (r !== null && typeof r == "object" ? "an invalid object" : "'" + r + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
618
624
  }
619
- function be() {
625
+ function Se() {
620
626
  return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
621
627
  }
622
- var me = be();
623
- function Ae(r) {
624
- return h(r == null ? void 0 : r[me]);
628
+ var ge = Se();
629
+ function Te(r) {
630
+ return h(r == null ? void 0 : r[ge]);
625
631
  }
626
- function _e(r) {
627
- return X(this, arguments, function() {
632
+ function we(r) {
633
+ return te(this, arguments, function() {
628
634
  var e, n, i, o;
629
- return F(this, function(s) {
635
+ return M(this, function(s) {
630
636
  switch (s.label) {
631
637
  case 0:
632
638
  e = r.getReader(), s.label = 1;
@@ -654,29 +660,29 @@ function _e(r) {
654
660
  });
655
661
  });
656
662
  }
657
- function Se(r) {
663
+ function Ee(r) {
658
664
  return h(r == null ? void 0 : r.getReader);
659
665
  }
660
- function ge(r) {
666
+ function Pe(r) {
661
667
  if (r instanceof b)
662
668
  return r;
663
669
  if (r != null) {
664
- if (ye(r))
665
- return Te(r);
666
- if (he(r))
667
- return we(r);
668
- if (pe(r))
669
- return Pe(r);
670
- if (de(r))
671
- return Y(r);
672
- if (Ae(r))
673
- return Ee(r);
674
- if (Se(r))
670
+ if (me(r))
675
671
  return Ue(r);
672
+ if (ve(r))
673
+ return Oe(r);
674
+ if (be(r))
675
+ return Ie(r);
676
+ if (Ae(r))
677
+ return Y(r);
678
+ if (Te(r))
679
+ return Ce(r);
680
+ if (Ee(r))
681
+ return He(r);
676
682
  }
677
- throw ve(r);
683
+ throw _e(r);
678
684
  }
679
- function Te(r) {
685
+ function Ue(r) {
680
686
  return new b(function(t) {
681
687
  var e = r[K]();
682
688
  if (h(e.subscribe))
@@ -684,14 +690,14 @@ function Te(r) {
684
690
  throw new TypeError("Provided object does not correctly implement Symbol.observable");
685
691
  });
686
692
  }
687
- function we(r) {
693
+ function Oe(r) {
688
694
  return new b(function(t) {
689
695
  for (var e = 0; e < r.length && !t.closed; e++)
690
696
  t.next(r[e]);
691
697
  t.complete();
692
698
  });
693
699
  }
694
- function Pe(r) {
700
+ function Ie(r) {
695
701
  return new b(function(t) {
696
702
  r.then(function(e) {
697
703
  t.closed || (t.next(e), t.complete());
@@ -700,7 +706,7 @@ function Pe(r) {
700
706
  }).then(null, G);
701
707
  });
702
708
  }
703
- function Ee(r) {
709
+ function Ce(r) {
704
710
  return new b(function(t) {
705
711
  var e, n;
706
712
  try {
@@ -724,22 +730,22 @@ function Ee(r) {
724
730
  }
725
731
  function Y(r) {
726
732
  return new b(function(t) {
727
- Oe(r, t).catch(function(e) {
733
+ xe(r, t).catch(function(e) {
728
734
  return t.error(e);
729
735
  });
730
736
  });
731
737
  }
732
- function Ue(r) {
733
- return Y(_e(r));
738
+ function He(r) {
739
+ return Y(we(r));
734
740
  }
735
- function Oe(r, t) {
741
+ function xe(r, t) {
736
742
  var e, n, i, o;
737
- return Q(this, void 0, void 0, function() {
743
+ return re(this, void 0, void 0, function() {
738
744
  var s, c;
739
- return F(this, function(u) {
745
+ return M(this, function(u) {
740
746
  switch (u.label) {
741
747
  case 0:
742
- u.trys.push([0, 5, 6, 11]), e = Z(r), u.label = 1;
748
+ u.trys.push([0, 5, 6, 11]), e = ne(r), u.label = 1;
743
749
  case 1:
744
750
  return [4, e.next()];
745
751
  case 2:
@@ -772,9 +778,9 @@ function Oe(r, t) {
772
778
  });
773
779
  });
774
780
  }
775
- function Ie(r, t) {
781
+ function Be(r, t) {
776
782
  t === void 0 && (t = {});
777
- var e = t.selector, n = z(t, ["selector"]);
783
+ var e = t.selector, n = ee(t, ["selector"]);
778
784
  return new b(function(i) {
779
785
  var o = new AbortController(), s = o.signal, c = !0, u = n.signal;
780
786
  if (u)
@@ -792,7 +798,7 @@ function Ie(r, t) {
792
798
  c = !1, i.error(l);
793
799
  };
794
800
  return fetch(r, f).then(function(l) {
795
- e ? ge(e(l)).subscribe(se(i, void 0, function() {
801
+ e ? Pe(e(l)).subscribe(le(i, void 0, function() {
796
802
  c = !1, i.complete();
797
803
  }, y)) : (c = !1, i.next(l), i.complete());
798
804
  }).catch(y), function() {
@@ -800,7 +806,7 @@ function Ie(r, t) {
800
806
  };
801
807
  });
802
808
  }
803
- class Ce extends V {
809
+ class Re extends q {
804
810
  constructor() {
805
811
  super();
806
812
  v(this, "API_AUTH_BACK_URL");
@@ -819,7 +825,7 @@ class Ce extends V {
819
825
  };
820
826
  }
821
827
  get() {
822
- return this.logDebug("get ServiceToken"), Ie(this.API_AUTH_BACK_URL, {
828
+ return this.logDebug("get ServiceToken"), Be(this.API_AUTH_BACK_URL, {
823
829
  method: "POST",
824
830
  headers: this.headers,
825
831
  body: JSON.stringify({
@@ -835,11 +841,11 @@ class Ce extends V {
835
841
  `ServiceToken <URL>: \x1B[33m ${this.API_AUTH_BACK_URL} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(this.headers)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(e)} \x1B[37m`
836
842
  ), S(((n = e == null ? void 0 : e.data) == null ? void 0 : n.Token) || "");
837
843
  }),
838
- N((e) => (this.logError(`ServiceToken ${e}`), S("")))
844
+ V((e) => (this.logError(`ServiceToken ${e}`), S("")))
839
845
  );
840
846
  }
841
847
  }
842
- class Ke extends q {
848
+ class Me extends Z {
843
849
  constructor() {
844
850
  super();
845
851
  v(this, "headers");
@@ -849,17 +855,20 @@ class Ke extends q {
849
855
  };
850
856
  }
851
857
  addTokenBackend(e) {
852
- return this.logDebug("addTokenBackend CustomHeader", JSON.stringify(e)), new Ce().get().pipe(
858
+ return this.logDebug("addTokenBackend CustomHeader", JSON.stringify(e)), new Re().get().pipe(
853
859
  _((n) => S({ ...e, Authorization: `Bearer ${n}` }))
854
860
  );
855
861
  }
856
862
  temporaryCognitoHeader(e) {
857
- return S({
858
- ...e,
863
+ const n = {
859
864
  Accesstoken: process.env.COGNITO_ACCESS_TOKEN,
860
865
  Refreshtoken: process.env.COGNITO_REFRESH_TOKEN,
861
866
  Idtoken: process.env.COGNITO_TOKEN_ID,
862
867
  Username: process.env.COGNITO_USER_NAME
868
+ };
869
+ return S({
870
+ ...e,
871
+ ...n
863
872
  });
864
873
  }
865
874
  getHeaders() {
@@ -872,7 +881,8 @@ class Ke extends q {
872
881
  }
873
882
  }
874
883
  export {
875
- Ke as C,
876
- Ce as S,
877
- Ie as f
884
+ Z as C,
885
+ Re as S,
886
+ Me as a,
887
+ Be as f
878
888
  };