mp-front-cli 0.0.34 → 0.0.36

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 (34) hide show
  1. package/dist/core/errors/error-catalog.d.ts +4 -4
  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/errors/message-error.d.ts +6 -11
  6. package/dist/core/errors/message-error.d.ts.map +1 -1
  7. package/dist/core/interfaces/message.d.ts +4 -2
  8. package/dist/core/interfaces/message.d.ts.map +1 -1
  9. package/dist/core/middleware/index.d.ts +3 -1
  10. package/dist/core/middleware/index.d.ts.map +1 -1
  11. package/dist/core/utils/api-request/fetch-service-be.d.ts +1 -1
  12. package/dist/core/utils/api-request/fetch-service-be.d.ts.map +1 -1
  13. package/dist/core/utils/api-request/fetch-service-fe.d.ts.map +1 -1
  14. package/dist/core/utils/custom-catch-error.d.ts +1 -1
  15. package/dist/core/utils/custom-catch-error.d.ts.map +1 -1
  16. package/dist/core/utils/custom-encoder.d.ts +1 -1
  17. package/dist/core/utils/custom-encoder.d.ts.map +1 -1
  18. package/dist/core/utils/custom-header.d.ts +3 -123
  19. package/dist/core/utils/custom-header.d.ts.map +1 -1
  20. package/dist/{custom-encoder-b2078b5c.js → custom-encoder-6737c6cb.js} +244 -245
  21. package/dist/custom-header-4aec1dac.js +888 -0
  22. package/dist/{custom-validator-d4c8885a.js → custom-validator-ae5da0a7.js} +718 -735
  23. package/dist/{index-6f6eb615.js → index-df4e0539.js} +4 -0
  24. package/dist/lang/common/errors/es_MX/index.d.ts +4 -0
  25. package/dist/lang/common/errors/es_MX/index.d.ts.map +1 -1
  26. package/dist/mp-front-cli-all.es.js +15 -17
  27. package/dist/mp-front-cli-core.es.js +193 -89
  28. package/dist/mp-front-cli-encoder.es.js +1 -1
  29. package/dist/mp-front-cli-header.es.js +5 -6
  30. package/dist/mp-front-cli-locale.es.js +1 -1
  31. package/dist/mp-front-cli-validator.es.js +3 -3
  32. package/package.json +5 -7
  33. package/dist/custom-header-bb082c8e.js +0 -878
  34. package/dist/mp-front-cli-catch-error.es.js +0 -14
@@ -0,0 +1,888 @@
1
+ var W = Object.defineProperty;
2
+ var J = (r, t, e) => t in r ? W(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var v = (r, t, e) => (J(r, typeof t != "symbol" ? t + "" : t, e), e);
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
+ }
13
+ var I = function(r, t) {
14
+ return I = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
15
+ e.__proto__ = n;
16
+ } || function(e, n) {
17
+ for (var i in n)
18
+ Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
19
+ }, I(r, t);
20
+ };
21
+ function x(r, t) {
22
+ if (typeof t != "function" && t !== null)
23
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
24
+ I(r, t);
25
+ function e() {
26
+ this.constructor = r;
27
+ }
28
+ r.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
29
+ }
30
+ var w = function() {
31
+ return w = Object.assign || function(t) {
32
+ for (var e, n = 1, i = arguments.length; n < i; n++) {
33
+ e = arguments[n];
34
+ for (var o in e)
35
+ Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
36
+ }
37
+ return t;
38
+ }, w.apply(this, arguments);
39
+ };
40
+ function ee(r, t) {
41
+ var e = {};
42
+ for (var n in r)
43
+ Object.prototype.hasOwnProperty.call(r, n) && t.indexOf(n) < 0 && (e[n] = r[n]);
44
+ if (r != null && typeof Object.getOwnPropertySymbols == "function")
45
+ for (var i = 0, n = Object.getOwnPropertySymbols(r); i < n.length; i++)
46
+ t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[i]) && (e[n[i]] = r[n[i]]);
47
+ return e;
48
+ }
49
+ function re(r, t, e, n) {
50
+ function i(o) {
51
+ return o instanceof e ? o : new e(function(s) {
52
+ s(o);
53
+ });
54
+ }
55
+ return new (e || (e = Promise))(function(o, s) {
56
+ function c(f) {
57
+ try {
58
+ a(n.next(f));
59
+ } catch (y) {
60
+ s(y);
61
+ }
62
+ }
63
+ function u(f) {
64
+ try {
65
+ a(n.throw(f));
66
+ } catch (y) {
67
+ s(y);
68
+ }
69
+ }
70
+ function a(f) {
71
+ f.done ? o(f.value) : i(f.value).then(c, u);
72
+ }
73
+ a((n = n.apply(r, t || [])).next());
74
+ });
75
+ }
76
+ function M(r, t) {
77
+ var e = { label: 0, sent: function() {
78
+ if (o[0] & 1)
79
+ throw o[1];
80
+ return o[1];
81
+ }, trys: [], ops: [] }, n, i, o, s;
82
+ return s = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (s[Symbol.iterator] = function() {
83
+ return this;
84
+ }), s;
85
+ function c(a) {
86
+ return function(f) {
87
+ return u([a, f]);
88
+ };
89
+ }
90
+ function u(a) {
91
+ if (n)
92
+ throw new TypeError("Generator is already executing.");
93
+ for (; s && (s = 0, a[0] && (e = 0)), e; )
94
+ try {
95
+ if (n = 1, i && (o = a[0] & 2 ? i.return : a[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, a[1])).done)
96
+ return o;
97
+ switch (i = 0, o && (a = [a[0] & 2, o.value]), a[0]) {
98
+ case 0:
99
+ case 1:
100
+ o = a;
101
+ break;
102
+ case 4:
103
+ return e.label++, { value: a[1], done: !1 };
104
+ case 5:
105
+ e.label++, i = a[1], a = [0];
106
+ continue;
107
+ case 7:
108
+ a = e.ops.pop(), e.trys.pop();
109
+ continue;
110
+ default:
111
+ if (o = e.trys, !(o = o.length > 0 && o[o.length - 1]) && (a[0] === 6 || a[0] === 2)) {
112
+ e = 0;
113
+ continue;
114
+ }
115
+ if (a[0] === 3 && (!o || a[1] > o[0] && a[1] < o[3])) {
116
+ e.label = a[1];
117
+ break;
118
+ }
119
+ if (a[0] === 6 && e.label < o[1]) {
120
+ e.label = o[1], o = a;
121
+ break;
122
+ }
123
+ if (o && e.label < o[2]) {
124
+ e.label = o[2], e.ops.push(a);
125
+ break;
126
+ }
127
+ o[2] && e.ops.pop(), e.trys.pop();
128
+ continue;
129
+ }
130
+ a = t.call(r, e);
131
+ } catch (f) {
132
+ a = [6, f], i = 0;
133
+ } finally {
134
+ n = o = 0;
135
+ }
136
+ if (a[0] & 5)
137
+ throw a[1];
138
+ return { value: a[0] ? a[1] : void 0, done: !0 };
139
+ }
140
+ }
141
+ function g(r) {
142
+ var t = typeof Symbol == "function" && Symbol.iterator, e = t && r[t], n = 0;
143
+ if (e)
144
+ return e.call(r);
145
+ if (r && typeof r.length == "number")
146
+ return {
147
+ next: function() {
148
+ return r && n >= r.length && (r = void 0), { value: r && r[n++], done: !r };
149
+ }
150
+ };
151
+ throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
152
+ }
153
+ function E(r, t) {
154
+ var e = typeof Symbol == "function" && r[Symbol.iterator];
155
+ if (!e)
156
+ return r;
157
+ var n = e.call(r), i, o = [], s;
158
+ try {
159
+ for (; (t === void 0 || t-- > 0) && !(i = n.next()).done; )
160
+ o.push(i.value);
161
+ } catch (c) {
162
+ s = { error: c };
163
+ } finally {
164
+ try {
165
+ i && !i.done && (e = n.return) && e.call(n);
166
+ } finally {
167
+ if (s)
168
+ throw s.error;
169
+ }
170
+ }
171
+ return o;
172
+ }
173
+ function P(r, t, e) {
174
+ if (e || arguments.length === 2)
175
+ for (var n = 0, i = t.length, o; n < i; n++)
176
+ (o || !(n in t)) && (o || (o = Array.prototype.slice.call(t, 0, n)), o[n] = t[n]);
177
+ return r.concat(o || Array.prototype.slice.call(t));
178
+ }
179
+ function m(r) {
180
+ return this instanceof m ? (this.v = r, this) : new m(r);
181
+ }
182
+ function te(r, t, e) {
183
+ if (!Symbol.asyncIterator)
184
+ throw new TypeError("Symbol.asyncIterator is not defined.");
185
+ var n = e.apply(r, t || []), i, o = [];
186
+ return i = {}, s("next"), s("throw"), s("return"), i[Symbol.asyncIterator] = function() {
187
+ return this;
188
+ }, i;
189
+ function s(l) {
190
+ n[l] && (i[l] = function(d) {
191
+ return new Promise(function(A, p) {
192
+ o.push([l, d, A, p]) > 1 || c(l, d);
193
+ });
194
+ });
195
+ }
196
+ function c(l, d) {
197
+ try {
198
+ u(n[l](d));
199
+ } catch (A) {
200
+ y(o[0][3], A);
201
+ }
202
+ }
203
+ function u(l) {
204
+ l.value instanceof m ? Promise.resolve(l.value.v).then(a, f) : y(o[0][2], l);
205
+ }
206
+ function a(l) {
207
+ c("next", l);
208
+ }
209
+ function f(l) {
210
+ c("throw", l);
211
+ }
212
+ function y(l, d) {
213
+ l(d), o.shift(), o.length && c(o[0][0], o[0][1]);
214
+ }
215
+ }
216
+ function ne(r) {
217
+ if (!Symbol.asyncIterator)
218
+ throw new TypeError("Symbol.asyncIterator is not defined.");
219
+ var t = r[Symbol.asyncIterator], e;
220
+ return t ? t.call(r) : (r = typeof g == "function" ? g(r) : r[Symbol.iterator](), e = {}, n("next"), n("throw"), n("return"), e[Symbol.asyncIterator] = function() {
221
+ return this;
222
+ }, e);
223
+ function n(o) {
224
+ e[o] = r[o] && function(s) {
225
+ return new Promise(function(c, u) {
226
+ s = r[o](s), i(c, u, s.done, s.value);
227
+ });
228
+ };
229
+ }
230
+ function i(o, s, c, u) {
231
+ Promise.resolve(u).then(function(a) {
232
+ o({ value: a, done: c });
233
+ }, s);
234
+ }
235
+ }
236
+ function h(r) {
237
+ return typeof r == "function";
238
+ }
239
+ function oe(r) {
240
+ var t = function(n) {
241
+ Error.call(n), n.stack = new Error().stack;
242
+ }, e = r(t);
243
+ return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
244
+ }
245
+ var U = oe(function(r) {
246
+ return function(e) {
247
+ r(this), this.message = e ? e.length + ` errors occurred during unsubscription:
248
+ ` + e.map(function(n, i) {
249
+ return i + 1 + ") " + n.toString();
250
+ }).join(`
251
+ `) : "", this.name = "UnsubscriptionError", this.errors = e;
252
+ };
253
+ });
254
+ function k(r, t) {
255
+ if (r) {
256
+ var e = r.indexOf(t);
257
+ 0 <= e && r.splice(e, 1);
258
+ }
259
+ }
260
+ var B = function() {
261
+ function r(t) {
262
+ this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
263
+ }
264
+ return r.prototype.unsubscribe = function() {
265
+ var t, e, n, i, o;
266
+ if (!this.closed) {
267
+ this.closed = !0;
268
+ var s = this._parentage;
269
+ if (s)
270
+ if (this._parentage = null, Array.isArray(s))
271
+ try {
272
+ for (var c = g(s), u = c.next(); !u.done; u = c.next()) {
273
+ var a = u.value;
274
+ a.remove(this);
275
+ }
276
+ } catch (p) {
277
+ t = { error: p };
278
+ } finally {
279
+ try {
280
+ u && !u.done && (e = c.return) && e.call(c);
281
+ } finally {
282
+ if (t)
283
+ throw t.error;
284
+ }
285
+ }
286
+ else
287
+ s.remove(this);
288
+ var f = this.initialTeardown;
289
+ if (h(f))
290
+ try {
291
+ f();
292
+ } catch (p) {
293
+ o = p instanceof U ? p.errors : [p];
294
+ }
295
+ var y = this._finalizers;
296
+ if (y) {
297
+ this._finalizers = null;
298
+ try {
299
+ for (var l = g(y), d = l.next(); !d.done; d = l.next()) {
300
+ var A = d.value;
301
+ try {
302
+ j(A);
303
+ } catch (p) {
304
+ o = o ?? [], p instanceof U ? o = P(P([], E(o)), E(p.errors)) : o.push(p);
305
+ }
306
+ }
307
+ } catch (p) {
308
+ n = { error: p };
309
+ } finally {
310
+ try {
311
+ d && !d.done && (i = l.return) && i.call(l);
312
+ } finally {
313
+ if (n)
314
+ throw n.error;
315
+ }
316
+ }
317
+ }
318
+ if (o)
319
+ throw new U(o);
320
+ }
321
+ }, r.prototype.add = function(t) {
322
+ var e;
323
+ if (t && t !== this)
324
+ if (this.closed)
325
+ j(t);
326
+ else {
327
+ if (t instanceof r) {
328
+ if (t.closed || t._hasParent(this))
329
+ return;
330
+ t._addParent(this);
331
+ }
332
+ (this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);
333
+ }
334
+ }, r.prototype._hasParent = function(t) {
335
+ var e = this._parentage;
336
+ return e === t || Array.isArray(e) && e.includes(t);
337
+ }, r.prototype._addParent = function(t) {
338
+ var e = this._parentage;
339
+ this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
340
+ }, r.prototype._removeParent = function(t) {
341
+ var e = this._parentage;
342
+ e === t ? this._parentage = null : Array.isArray(e) && k(e, t);
343
+ }, r.prototype.remove = function(t) {
344
+ var e = this._finalizers;
345
+ e && k(e, t), t instanceof r && t._removeParent(this);
346
+ }, r.EMPTY = function() {
347
+ var t = new r();
348
+ return t.closed = !0, t;
349
+ }(), r;
350
+ }();
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);
354
+ }
355
+ function j(r) {
356
+ h(r) ? r() : r.unsubscribe();
357
+ }
358
+ var $ = {
359
+ onUnhandledError: null,
360
+ onStoppedNotification: null,
361
+ Promise: void 0,
362
+ useDeprecatedSynchronousErrorHandling: !1,
363
+ useDeprecatedNextContext: !1
364
+ }, C = {
365
+ setTimeout: function(r, t) {
366
+ for (var e = [], n = 2; n < arguments.length; n++)
367
+ e[n - 2] = arguments[n];
368
+ var i = C.delegate;
369
+ return i != null && i.setTimeout ? i.setTimeout.apply(i, P([r, t], E(e))) : setTimeout.apply(void 0, P([r, t], E(e)));
370
+ },
371
+ clearTimeout: function(r) {
372
+ var t = C.delegate;
373
+ return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(r);
374
+ },
375
+ delegate: void 0
376
+ };
377
+ function G(r) {
378
+ C.setTimeout(function() {
379
+ throw r;
380
+ });
381
+ }
382
+ function D() {
383
+ }
384
+ function ie(r) {
385
+ r();
386
+ }
387
+ var R = function(r) {
388
+ x(t, r);
389
+ function t(e) {
390
+ var n = r.call(this) || this;
391
+ return n.isStopped = !1, e ? (n.destination = e, F(e) && e.add(n)) : n.destination = ue, n;
392
+ }
393
+ return t.create = function(e, n, i) {
394
+ return new H(e, n, i);
395
+ }, t.prototype.next = function(e) {
396
+ this.isStopped || this._next(e);
397
+ }, t.prototype.error = function(e) {
398
+ this.isStopped || (this.isStopped = !0, this._error(e));
399
+ }, t.prototype.complete = function() {
400
+ this.isStopped || (this.isStopped = !0, this._complete());
401
+ }, t.prototype.unsubscribe = function() {
402
+ this.closed || (this.isStopped = !0, r.prototype.unsubscribe.call(this), this.destination = null);
403
+ }, t.prototype._next = function(e) {
404
+ this.destination.next(e);
405
+ }, t.prototype._error = function(e) {
406
+ try {
407
+ this.destination.error(e);
408
+ } finally {
409
+ this.unsubscribe();
410
+ }
411
+ }, t.prototype._complete = function() {
412
+ try {
413
+ this.destination.complete();
414
+ } finally {
415
+ this.unsubscribe();
416
+ }
417
+ }, t;
418
+ }(B), se = Function.prototype.bind;
419
+ function O(r, t) {
420
+ return se.call(r, t);
421
+ }
422
+ var ae = function() {
423
+ function r(t) {
424
+ this.partialObserver = t;
425
+ }
426
+ return r.prototype.next = function(t) {
427
+ var e = this.partialObserver;
428
+ if (e.next)
429
+ try {
430
+ e.next(t);
431
+ } catch (n) {
432
+ T(n);
433
+ }
434
+ }, r.prototype.error = function(t) {
435
+ var e = this.partialObserver;
436
+ if (e.error)
437
+ try {
438
+ e.error(t);
439
+ } catch (n) {
440
+ T(n);
441
+ }
442
+ else
443
+ T(t);
444
+ }, r.prototype.complete = function() {
445
+ var t = this.partialObserver;
446
+ if (t.complete)
447
+ try {
448
+ t.complete();
449
+ } catch (e) {
450
+ T(e);
451
+ }
452
+ }, r;
453
+ }(), H = function(r) {
454
+ x(t, r);
455
+ function t(e, n, i) {
456
+ var o = r.call(this) || this, s;
457
+ if (h(e) || !e)
458
+ s = {
459
+ next: e ?? void 0,
460
+ error: n ?? void 0,
461
+ complete: i ?? void 0
462
+ };
463
+ else {
464
+ var c;
465
+ o && $.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
466
+ return o.unsubscribe();
467
+ }, s = {
468
+ next: e.next && O(e.next, c),
469
+ error: e.error && O(e.error, c),
470
+ complete: e.complete && O(e.complete, c)
471
+ }) : s = e;
472
+ }
473
+ return o.destination = new ae(s), o;
474
+ }
475
+ return t;
476
+ }(R);
477
+ function T(r) {
478
+ G(r);
479
+ }
480
+ function ce(r) {
481
+ throw r;
482
+ }
483
+ var ue = {
484
+ closed: !0,
485
+ next: D,
486
+ error: ce,
487
+ complete: D
488
+ };
489
+ function le(r, t, e, n, i) {
490
+ return new fe(r, t, e, n, i);
491
+ }
492
+ var fe = function(r) {
493
+ x(t, r);
494
+ function t(e, n, i, o, s, c) {
495
+ var u = r.call(this, e) || this;
496
+ return u.onFinalize = s, u.shouldUnsubscribe = c, u._next = n ? function(a) {
497
+ try {
498
+ n(a);
499
+ } catch (f) {
500
+ e.error(f);
501
+ }
502
+ } : r.prototype._next, u._error = o ? function(a) {
503
+ try {
504
+ o(a);
505
+ } catch (f) {
506
+ e.error(f);
507
+ } finally {
508
+ this.unsubscribe();
509
+ }
510
+ } : r.prototype._error, u._complete = i ? function() {
511
+ try {
512
+ i();
513
+ } catch (a) {
514
+ e.error(a);
515
+ } finally {
516
+ this.unsubscribe();
517
+ }
518
+ } : r.prototype._complete, u;
519
+ }
520
+ return t.prototype.unsubscribe = function() {
521
+ var e;
522
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
523
+ var n = this.closed;
524
+ r.prototype.unsubscribe.call(this), !n && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
525
+ }
526
+ }, t;
527
+ }(R), K = function() {
528
+ return typeof Symbol == "function" && Symbol.observable || "@@observable";
529
+ }();
530
+ function he(r) {
531
+ return r;
532
+ }
533
+ function pe(r) {
534
+ return r.length === 0 ? he : r.length === 1 ? r[0] : function(e) {
535
+ return r.reduce(function(n, i) {
536
+ return i(n);
537
+ }, e);
538
+ };
539
+ }
540
+ var b = function() {
541
+ function r(t) {
542
+ t && (this._subscribe = t);
543
+ }
544
+ return r.prototype.lift = function(t) {
545
+ var e = new r();
546
+ return e.source = this, e.operator = t, e;
547
+ }, r.prototype.subscribe = function(t, e, n) {
548
+ var i = this, o = de(t) ? t : new H(t, e, n);
549
+ return ie(function() {
550
+ var s = i, c = s.operator, u = s.source;
551
+ o.add(c ? c.call(o, u) : u ? i._subscribe(o) : i._trySubscribe(o));
552
+ }), o;
553
+ }, r.prototype._trySubscribe = function(t) {
554
+ try {
555
+ return this._subscribe(t);
556
+ } catch (e) {
557
+ t.error(e);
558
+ }
559
+ }, r.prototype.forEach = function(t, e) {
560
+ var n = this;
561
+ return e = L(e), new e(function(i, o) {
562
+ var s = new H({
563
+ next: function(c) {
564
+ try {
565
+ t(c);
566
+ } catch (u) {
567
+ o(u), s.unsubscribe();
568
+ }
569
+ },
570
+ error: o,
571
+ complete: i
572
+ });
573
+ n.subscribe(s);
574
+ });
575
+ }, r.prototype._subscribe = function(t) {
576
+ var e;
577
+ return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
578
+ }, r.prototype[K] = function() {
579
+ return this;
580
+ }, r.prototype.pipe = function() {
581
+ for (var t = [], e = 0; e < arguments.length; e++)
582
+ t[e] = arguments[e];
583
+ return pe(t)(this);
584
+ }, r.prototype.toPromise = function(t) {
585
+ var e = this;
586
+ return t = L(t), new t(function(n, i) {
587
+ var o;
588
+ e.subscribe(function(s) {
589
+ return o = s;
590
+ }, function(s) {
591
+ return i(s);
592
+ }, function() {
593
+ return n(o);
594
+ });
595
+ });
596
+ }, r.create = function(t) {
597
+ return new r(t);
598
+ }, r;
599
+ }();
600
+ function L(r) {
601
+ var t;
602
+ return (t = r ?? $.Promise) !== null && t !== void 0 ? t : Promise;
603
+ }
604
+ function ye(r) {
605
+ return r && h(r.next) && h(r.error) && h(r.complete);
606
+ }
607
+ function de(r) {
608
+ return r && r instanceof R || ye(r) && F(r);
609
+ }
610
+ var ve = function(r) {
611
+ return r && typeof r.length == "number" && typeof r != "function";
612
+ };
613
+ function be(r) {
614
+ return h(r == null ? void 0 : r.then);
615
+ }
616
+ function me(r) {
617
+ return h(r[K]);
618
+ }
619
+ function Ae(r) {
620
+ return Symbol.asyncIterator && h(r == null ? void 0 : r[Symbol.asyncIterator]);
621
+ }
622
+ function _e(r) {
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.");
624
+ }
625
+ function Se() {
626
+ return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
627
+ }
628
+ var ge = Se();
629
+ function Te(r) {
630
+ return h(r == null ? void 0 : r[ge]);
631
+ }
632
+ function we(r) {
633
+ return te(this, arguments, function() {
634
+ var e, n, i, o;
635
+ return M(this, function(s) {
636
+ switch (s.label) {
637
+ case 0:
638
+ e = r.getReader(), s.label = 1;
639
+ case 1:
640
+ s.trys.push([1, , 9, 10]), s.label = 2;
641
+ case 2:
642
+ return [4, m(e.read())];
643
+ case 3:
644
+ return n = s.sent(), i = n.value, o = n.done, o ? [4, m(void 0)] : [3, 5];
645
+ case 4:
646
+ return [2, s.sent()];
647
+ case 5:
648
+ return [4, m(i)];
649
+ case 6:
650
+ return [4, s.sent()];
651
+ case 7:
652
+ return s.sent(), [3, 2];
653
+ case 8:
654
+ return [3, 10];
655
+ case 9:
656
+ return e.releaseLock(), [7];
657
+ case 10:
658
+ return [2];
659
+ }
660
+ });
661
+ });
662
+ }
663
+ function Ee(r) {
664
+ return h(r == null ? void 0 : r.getReader);
665
+ }
666
+ function Pe(r) {
667
+ if (r instanceof b)
668
+ return r;
669
+ if (r != null) {
670
+ if (me(r))
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);
682
+ }
683
+ throw _e(r);
684
+ }
685
+ function Ue(r) {
686
+ return new b(function(t) {
687
+ var e = r[K]();
688
+ if (h(e.subscribe))
689
+ return e.subscribe(t);
690
+ throw new TypeError("Provided object does not correctly implement Symbol.observable");
691
+ });
692
+ }
693
+ function Oe(r) {
694
+ return new b(function(t) {
695
+ for (var e = 0; e < r.length && !t.closed; e++)
696
+ t.next(r[e]);
697
+ t.complete();
698
+ });
699
+ }
700
+ function Ie(r) {
701
+ return new b(function(t) {
702
+ r.then(function(e) {
703
+ t.closed || (t.next(e), t.complete());
704
+ }, function(e) {
705
+ return t.error(e);
706
+ }).then(null, G);
707
+ });
708
+ }
709
+ function Ce(r) {
710
+ return new b(function(t) {
711
+ var e, n;
712
+ try {
713
+ for (var i = g(r), o = i.next(); !o.done; o = i.next()) {
714
+ var s = o.value;
715
+ if (t.next(s), t.closed)
716
+ return;
717
+ }
718
+ } catch (c) {
719
+ e = { error: c };
720
+ } finally {
721
+ try {
722
+ o && !o.done && (n = i.return) && n.call(i);
723
+ } finally {
724
+ if (e)
725
+ throw e.error;
726
+ }
727
+ }
728
+ t.complete();
729
+ });
730
+ }
731
+ function Y(r) {
732
+ return new b(function(t) {
733
+ xe(r, t).catch(function(e) {
734
+ return t.error(e);
735
+ });
736
+ });
737
+ }
738
+ function He(r) {
739
+ return Y(we(r));
740
+ }
741
+ function xe(r, t) {
742
+ var e, n, i, o;
743
+ return re(this, void 0, void 0, function() {
744
+ var s, c;
745
+ return M(this, function(u) {
746
+ switch (u.label) {
747
+ case 0:
748
+ u.trys.push([0, 5, 6, 11]), e = ne(r), u.label = 1;
749
+ case 1:
750
+ return [4, e.next()];
751
+ case 2:
752
+ if (n = u.sent(), !!n.done)
753
+ return [3, 4];
754
+ if (s = n.value, t.next(s), t.closed)
755
+ return [2];
756
+ u.label = 3;
757
+ case 3:
758
+ return [3, 1];
759
+ case 4:
760
+ return [3, 11];
761
+ case 5:
762
+ return c = u.sent(), i = { error: c }, [3, 11];
763
+ case 6:
764
+ return u.trys.push([6, , 9, 10]), n && !n.done && (o = e.return) ? [4, o.call(e)] : [3, 8];
765
+ case 7:
766
+ u.sent(), u.label = 8;
767
+ case 8:
768
+ return [3, 10];
769
+ case 9:
770
+ if (i)
771
+ throw i.error;
772
+ return [7];
773
+ case 10:
774
+ return [7];
775
+ case 11:
776
+ return t.complete(), [2];
777
+ }
778
+ });
779
+ });
780
+ }
781
+ function Be(r, t) {
782
+ t === void 0 && (t = {});
783
+ var e = t.selector, n = ee(t, ["selector"]);
784
+ return new b(function(i) {
785
+ var o = new AbortController(), s = o.signal, c = !0, u = n.signal;
786
+ if (u)
787
+ if (u.aborted)
788
+ o.abort();
789
+ else {
790
+ var a = function() {
791
+ s.aborted || o.abort();
792
+ };
793
+ u.addEventListener("abort", a), i.add(function() {
794
+ return u.removeEventListener("abort", a);
795
+ });
796
+ }
797
+ var f = w(w({}, n), { signal: s }), y = function(l) {
798
+ c = !1, i.error(l);
799
+ };
800
+ return fetch(r, f).then(function(l) {
801
+ e ? Pe(e(l)).subscribe(le(i, void 0, function() {
802
+ c = !1, i.complete();
803
+ }, y)) : (c = !1, i.next(l), i.complete());
804
+ }).catch(y), function() {
805
+ c && o.abort();
806
+ };
807
+ });
808
+ }
809
+ class Re extends q {
810
+ constructor() {
811
+ super();
812
+ v(this, "API_AUTH_BACK_URL");
813
+ v(this, "API_AUTH_BACK_USERNAME_AUTH");
814
+ v(this, "API_AUTH_BACK_PASSWORD_AUTH");
815
+ v(this, "API_AUTH_BACK_USER");
816
+ v(this, "API_AUTH_BACK_SCOPE");
817
+ v(this, "API_AUTH_BACK_PASSWORD");
818
+ v(this, "headers");
819
+ this.API_AUTH_BACK_URL = process.env.API_AUTH_BACK_URL, this.API_AUTH_BACK_USERNAME_AUTH = process.env.API_AUTH_BACK_USERNAME_AUTH, this.API_AUTH_BACK_PASSWORD_AUTH = process.env.API_AUTH_BACK_PASSWORD_AUTH, this.API_AUTH_BACK_USER = process.env.API_AUTH_BACK_USER, this.API_AUTH_BACK_SCOPE = process.env.API_AUTH_BACK_SCOPE, this.API_AUTH_BACK_PASSWORD = process.env.API_AUTH_BACK_PASSWORD;
820
+ const e = `${this.API_AUTH_BACK_USERNAME_AUTH}:${this.API_AUTH_BACK_PASSWORD_AUTH}`, n = Buffer.from(e).toString("base64");
821
+ this.headers = {
822
+ Accept: "application/json",
823
+ "Content-Type": "application/json;charset=UTF-8",
824
+ Authorization: `Basic ${n}`
825
+ };
826
+ }
827
+ get() {
828
+ return this.logDebug("get ServiceToken"), Be(this.API_AUTH_BACK_URL, {
829
+ method: "POST",
830
+ headers: this.headers,
831
+ body: JSON.stringify({
832
+ user: this.API_AUTH_BACK_USER,
833
+ scope: this.API_AUTH_BACK_SCOPE,
834
+ password: this.API_AUTH_BACK_PASSWORD
835
+ })
836
+ }).pipe(
837
+ _((e) => e.json()),
838
+ _((e) => {
839
+ var n;
840
+ return this.logDebug(
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`
842
+ ), S(((n = e == null ? void 0 : e.data) == null ? void 0 : n.Token) || "");
843
+ }),
844
+ V((e) => (this.logError(`ServiceToken ${e}`), S("")))
845
+ );
846
+ }
847
+ }
848
+ class Me extends Z {
849
+ constructor() {
850
+ super();
851
+ v(this, "headers");
852
+ this.headers = {
853
+ Accept: "application/json",
854
+ "Content-Type": "application/json"
855
+ };
856
+ }
857
+ addTokenBackend(e) {
858
+ return this.logDebug("addTokenBackend CustomHeader", JSON.stringify(e)), new Re().get().pipe(
859
+ _((n) => S({ ...e, Authorization: `Bearer ${n}` }))
860
+ );
861
+ }
862
+ temporaryCognitoHeader(e) {
863
+ const n = {
864
+ Accesstoken: process.env.COGNITO_ACCESS_TOKEN,
865
+ Refreshtoken: process.env.COGNITO_REFRESH_TOKEN,
866
+ Idtoken: process.env.COGNITO_TOKEN_ID,
867
+ Username: process.env.COGNITO_USER_NAME
868
+ };
869
+ return S({
870
+ ...e,
871
+ ...n
872
+ });
873
+ }
874
+ getHeaders() {
875
+ return this.logDebug("getHeaders CustomHeader"), S({
876
+ ...this.headers
877
+ }).pipe(
878
+ _((e) => this.addTokenBackend(e)),
879
+ _((e) => this.temporaryCognitoHeader(e))
880
+ );
881
+ }
882
+ }
883
+ export {
884
+ Z as C,
885
+ Re as S,
886
+ Me as a,
887
+ Be as f
888
+ };