mp-front-cli 0.0.75 → 0.0.77

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