mp-front-cli 0.0.140 → 2.0.0-canary.0

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