mp-front-cli 0.0.56 → 0.0.58
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.
- package/dist/core/interfaces/api-response.d.ts +9 -12
- package/dist/core/interfaces/api-response.d.ts.map +1 -1
- package/dist/core/middleware/index.d.ts +1 -1
- package/dist/core/middleware/index.d.ts.map +1 -1
- package/dist/core/utils/api-request/fetch-service-be.d.ts +3 -3
- package/dist/core/utils/api-request/fetch-service-be.d.ts.map +1 -1
- package/dist/core/utils/custom-cache.d.ts +1 -0
- package/dist/core/utils/custom-cache.d.ts.map +1 -1
- package/dist/core/utils/custom-header.d.ts +1 -1
- package/dist/core/utils/custom-header.d.ts.map +1 -1
- package/dist/{custom-header-3ba5652e.js → custom-header-596dcd13.js} +300 -299
- package/dist/mp-front-cli-all.es.js +1 -1
- package/dist/mp-front-cli-cache.es.js +18 -14
- package/dist/mp-front-cli-core.es.js +103 -98
- package/dist/mp-front-cli-header.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiMiddleware as S, ErrorCatalog as g, FetchServiceBE as l, FetchServiceFE as x } from "./mp-front-cli-core.es.js";
|
|
2
|
-
import { S as s } from "./custom-header-
|
|
2
|
+
import { S as s } from "./custom-header-596dcd13.js";
|
|
3
3
|
import { LoadingHandler as E, MessageHandler as F, RxSubjectManager as M } from "./mp-front-cli-utils-rxjs.es.js";
|
|
4
4
|
import "i18next";
|
|
5
5
|
import "./index-df4e0539.js";
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var m = (o, s, t) => s in o ?
|
|
3
|
-
var
|
|
4
|
-
import { CustomEncrypter as
|
|
5
|
-
import { C as
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var m = (o, s, t) => s in o ? E(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
|
+
var p = (o, s, t) => (m(o, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
|
+
import { CustomEncrypter as S } from "./mp-front-cli-encrypter.es.js";
|
|
5
|
+
import { C as u } from "./custom-redis-bee66564.js";
|
|
6
6
|
import "node-jose";
|
|
7
7
|
import "crypto";
|
|
8
8
|
import "./mp-front-cli-encoder.es.js";
|
|
9
9
|
import "./mp-front-cli-logger.es.js";
|
|
10
10
|
import "ioredis";
|
|
11
|
-
|
|
11
|
+
const y = process.env.TIMEOUT_SESSION_MINUTES;
|
|
12
|
+
class H extends S {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(...arguments);
|
|
14
|
-
|
|
15
|
+
p(this, "initClient", u);
|
|
15
16
|
}
|
|
16
17
|
getRootNode(t) {
|
|
17
18
|
return this.initClient.get(t);
|
|
@@ -40,12 +41,12 @@ class N extends u {
|
|
|
40
41
|
refresh: c = "REFRESH"
|
|
41
42
|
/* REFRESH */
|
|
42
43
|
}) {
|
|
43
|
-
const r = `${t}:${this.generateSHA(i)}`,
|
|
44
|
+
const r = `${t}:${this.generateSHA(i)}`, l = { expires_in: c === "REFRESH" ? n : 0, ...e };
|
|
44
45
|
if (h) {
|
|
45
|
-
const
|
|
46
|
-
return this.setEntryPoint(r,
|
|
46
|
+
const a = await this.encrypt(l);
|
|
47
|
+
return this.setEntryPoint(r, a, n), r;
|
|
47
48
|
}
|
|
48
|
-
return this.setEntryPoint(r,
|
|
49
|
+
return this.setEntryPoint(r, l, n), r;
|
|
49
50
|
}
|
|
50
51
|
async statusHost() {
|
|
51
52
|
return new Promise((t, i) => {
|
|
@@ -66,12 +67,15 @@ class N extends u {
|
|
|
66
67
|
this.initClient.expire(t, i);
|
|
67
68
|
}
|
|
68
69
|
simpleGet(t) {
|
|
69
|
-
return this.initClient.get(t);
|
|
70
|
+
return this.ttl(t, y * 60), this.initClient.get(t);
|
|
70
71
|
}
|
|
71
72
|
simpleHGet(t, i) {
|
|
72
|
-
return this.initClient.hget(t, i);
|
|
73
|
+
return this.ttl(t, y * 60), this.initClient.hget(t, i);
|
|
74
|
+
}
|
|
75
|
+
simpleHSet(t, i, e) {
|
|
76
|
+
return this.initClient.hset(t, i, e);
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
export {
|
|
76
|
-
|
|
80
|
+
H as CustomCache
|
|
77
81
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
var I = Object.defineProperty;
|
|
2
2
|
var L = (s, r, t) => r in s ? I(s, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[r] = t;
|
|
3
|
-
var
|
|
4
|
-
import { C as M, f as
|
|
5
|
-
import { S as
|
|
6
|
-
import { MessageHandler as
|
|
3
|
+
var h = (s, r, t) => (L(s, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
+
import { C as M, f as U } from "./custom-header-596dcd13.js";
|
|
5
|
+
import { S as ut } from "./custom-header-596dcd13.js";
|
|
6
|
+
import { MessageHandler as O, LoadingHandler as p } from "./mp-front-cli-utils-rxjs.es.js";
|
|
7
7
|
import { RxSubjectManager as pt } from "./mp-front-cli-utils-rxjs.es.js";
|
|
8
8
|
import P, { t as E } from "i18next";
|
|
9
9
|
import { t as v } from "./index-df4e0539.js";
|
|
10
10
|
import { CustomLogger as J } from "./mp-front-cli-logger.es.js";
|
|
11
|
-
import { of as d, switchMap as m, forkJoin as
|
|
12
|
-
import { CustomEncrypter as
|
|
13
|
-
import { CustomEncoder as
|
|
11
|
+
import { of as d, switchMap as m, forkJoin as A, catchError as b, EMPTY as D, filter as w } from "rxjs";
|
|
12
|
+
import { CustomEncrypter as T } from "./mp-front-cli-encrypter.es.js";
|
|
13
|
+
import { CustomEncoder as H } from "./mp-front-cli-encoder.es.js";
|
|
14
14
|
import { u as j } from "./stringify-788d71a0.js";
|
|
15
15
|
import "node-jose";
|
|
16
16
|
import "crypto";
|
|
@@ -34,7 +34,7 @@ P.init({
|
|
|
34
34
|
},
|
|
35
35
|
debug: !1
|
|
36
36
|
});
|
|
37
|
-
const
|
|
37
|
+
const u = {
|
|
38
38
|
// EXAMPLE ERROR
|
|
39
39
|
"MP-001": {
|
|
40
40
|
code: 400,
|
|
@@ -72,79 +72,81 @@ const h = {
|
|
|
72
72
|
level: "warning"
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
class
|
|
75
|
+
class S extends J {
|
|
76
76
|
get(r = "default", t) {
|
|
77
|
-
var o,
|
|
77
|
+
var o, n;
|
|
78
78
|
if (r instanceof Error)
|
|
79
79
|
return this.logError(r.message), {
|
|
80
|
-
...
|
|
81
|
-
title: E(
|
|
82
|
-
message: E(
|
|
80
|
+
...u.internalError,
|
|
81
|
+
title: E(u.internalError.title),
|
|
82
|
+
message: E(u.internalError.message),
|
|
83
83
|
uuid: t
|
|
84
84
|
};
|
|
85
|
-
const e = typeof r == "string" ? r : r.code ?? r.errorType,
|
|
85
|
+
const e = typeof r == "string" ? r : r.code ?? r.errorType, i = typeof r == "string" ? {} : { ...r };
|
|
86
86
|
return {
|
|
87
|
-
...
|
|
87
|
+
...u[e] ?? u.default,
|
|
88
88
|
title: E(
|
|
89
|
-
((o =
|
|
90
|
-
|
|
89
|
+
((o = u[e]) == null ? void 0 : o.title) ?? u.default.title,
|
|
90
|
+
i
|
|
91
91
|
),
|
|
92
92
|
message: E(
|
|
93
|
-
((
|
|
94
|
-
|
|
93
|
+
((n = u[e]) == null ? void 0 : n.message) ?? u.default.message,
|
|
94
|
+
i
|
|
95
95
|
),
|
|
96
96
|
uuid: t
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
class ct extends
|
|
100
|
+
class ct extends T {
|
|
101
101
|
constructor() {
|
|
102
102
|
super(...arguments);
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
h(this, "uuid", "");
|
|
104
|
+
h(this, "session", null);
|
|
105
105
|
}
|
|
106
106
|
setSession(t) {
|
|
107
107
|
this.session = t;
|
|
108
108
|
}
|
|
109
109
|
getSession() {
|
|
110
|
+
if (!this.session)
|
|
111
|
+
throw new S().get("SESSION_NOT_FOUND");
|
|
110
112
|
return this.session;
|
|
111
113
|
}
|
|
112
|
-
returnData(t, e,
|
|
113
|
-
const o = this.encode(e,
|
|
114
|
+
returnData(t, e, i) {
|
|
115
|
+
const o = this.encode(e, i);
|
|
114
116
|
t.status(200).json(o);
|
|
115
117
|
}
|
|
116
118
|
returnError(t, e) {
|
|
117
|
-
return e != null && e.uuid ? t.status(520).json(e) : t.status(520).json(new
|
|
119
|
+
return e != null && e.uuid ? t.status(520).json(e) : t.status(520).json(new S().get(e, this.uuid));
|
|
118
120
|
}
|
|
119
121
|
get(t) {
|
|
120
|
-
return this.logDebug("get ApiMiddleware"), (e,
|
|
122
|
+
return this.logDebug("get ApiMiddleware"), (e, i) => {
|
|
121
123
|
var o;
|
|
122
124
|
this.logDebug("return ApiMiddleware"), this.uuid = (o = e == null ? void 0 : e.body) == null ? void 0 : o.uuid, d(e).pipe(
|
|
123
125
|
m(
|
|
124
|
-
(
|
|
125
|
-
params: d(this.decode(
|
|
126
|
-
headers: d(
|
|
126
|
+
(n) => A({
|
|
127
|
+
params: d(this.decode(n.body)),
|
|
128
|
+
headers: d(n.headers)
|
|
127
129
|
})
|
|
128
130
|
),
|
|
129
131
|
m(
|
|
130
|
-
({ params:
|
|
131
|
-
response: t(
|
|
132
|
+
({ params: n, headers: a }) => A({
|
|
133
|
+
response: t(n, this.uuid, a),
|
|
132
134
|
headers: d(a),
|
|
133
|
-
params: d(
|
|
135
|
+
params: d(n)
|
|
134
136
|
})
|
|
135
137
|
),
|
|
136
|
-
m(({ params:
|
|
137
|
-
`ApiMiddleware \x1B[37m <URL>: \x1B[33m ${e.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(f)} \x1B[37m <UUID> \x1B[33m ${e.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(
|
|
138
|
+
m(({ params: n, response: a, headers: f }) => (this.logDebug(
|
|
139
|
+
`ApiMiddleware \x1B[37m <URL>: \x1B[33m ${e.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(f)} \x1B[37m <UUID> \x1B[33m ${e.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(n)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(a)}`
|
|
138
140
|
), d(a))),
|
|
139
|
-
|
|
141
|
+
b((n) => {
|
|
140
142
|
var a;
|
|
141
143
|
return this.logError(
|
|
142
|
-
`ApiMiddleware <URL>: ${e == null ? void 0 : e.url} <HEADERS>: ${JSON.stringify(e == null ? void 0 : e.headers)} <UUID> ${(a = e == null ? void 0 : e.body) == null ? void 0 : a.uuid} <PARAMS> ${JSON.stringify(e == null ? void 0 : e.body)} <ERROR>: ${JSON.stringify(
|
|
143
|
-
), this.returnError(
|
|
144
|
+
`ApiMiddleware <URL>: ${e == null ? void 0 : e.url} <HEADERS>: ${JSON.stringify(e == null ? void 0 : e.headers)} <UUID> ${(a = e == null ? void 0 : e.body) == null ? void 0 : a.uuid} <PARAMS> ${JSON.stringify(e == null ? void 0 : e.body)} <ERROR>: ${JSON.stringify(n)}`
|
|
145
|
+
), this.returnError(i, n), D;
|
|
144
146
|
})
|
|
145
147
|
).subscribe({
|
|
146
|
-
next: (
|
|
147
|
-
this.logDebug("ApiMiddleware subscribe next", JSON.stringify(
|
|
148
|
+
next: (n) => {
|
|
149
|
+
this.logDebug("ApiMiddleware subscribe next", JSON.stringify(n)), this.returnData(i, n, this.uuid);
|
|
148
150
|
}
|
|
149
151
|
});
|
|
150
152
|
};
|
|
@@ -152,15 +154,15 @@ class ct extends H {
|
|
|
152
154
|
}
|
|
153
155
|
const F = process.env.ID_FRONT ?? "NOT_AVAILABLE";
|
|
154
156
|
class dt extends M {
|
|
155
|
-
constructor(t, e) {
|
|
156
|
-
super();
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
constructor(t, e, i = {}) {
|
|
158
|
+
super(i);
|
|
159
|
+
h(this, "apiUrl");
|
|
160
|
+
h(this, "method");
|
|
159
161
|
this.apiUrl = t, this.method = e ?? "POST";
|
|
160
162
|
}
|
|
161
163
|
errorHandler(t, e) {
|
|
162
164
|
if (t != null && t.errors)
|
|
163
|
-
throw new
|
|
165
|
+
throw new S().get(t.errors[0], e);
|
|
164
166
|
return !(t != null && t.errors);
|
|
165
167
|
}
|
|
166
168
|
formatParams(t) {
|
|
@@ -174,36 +176,39 @@ class dt extends M {
|
|
|
174
176
|
fetchData(t = {}, e) {
|
|
175
177
|
return this.getHeaders().pipe(
|
|
176
178
|
m(
|
|
177
|
-
(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
(i) => U(
|
|
180
|
+
this.apiUrl,
|
|
181
|
+
{
|
|
182
|
+
method: "POST",
|
|
183
|
+
headers: i,
|
|
184
|
+
body: this.formatParams(t),
|
|
185
|
+
selector: (o) => o.json()
|
|
186
|
+
}
|
|
187
|
+
).pipe(
|
|
183
188
|
m((o) => (this.logDebug(
|
|
184
189
|
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${e} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
185
|
-
|
|
190
|
+
i
|
|
186
191
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
187
192
|
this.formatParams(t)
|
|
188
193
|
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
|
|
189
194
|
), d(o)))
|
|
190
195
|
)
|
|
191
196
|
),
|
|
192
|
-
|
|
197
|
+
w((i) => this.errorHandler(i, e))
|
|
193
198
|
);
|
|
194
199
|
}
|
|
195
200
|
fetchCustomData(t = {}, e) {
|
|
196
201
|
return this.getHeaders().pipe(
|
|
197
202
|
m(
|
|
198
|
-
(
|
|
203
|
+
(i) => U(this.apiUrl, {
|
|
199
204
|
method: this.method,
|
|
200
|
-
headers:
|
|
205
|
+
headers: i,
|
|
201
206
|
body: this.method === "GET" ? null : JSON.stringify(t),
|
|
202
207
|
selector: (o) => o.json()
|
|
203
208
|
}).pipe(
|
|
204
209
|
m((o) => (this.logDebug(
|
|
205
210
|
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m \x1B[37m <METHOD>: \x1B[33m ${this.method} <UUID>: \x1B[33m ${e} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
206
|
-
|
|
211
|
+
i
|
|
207
212
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
208
213
|
t
|
|
209
214
|
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(o)} \x1B[33m`
|
|
@@ -214,17 +219,17 @@ class dt extends M {
|
|
|
214
219
|
}
|
|
215
220
|
}
|
|
216
221
|
const G = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
217
|
-
function
|
|
222
|
+
function _(s) {
|
|
218
223
|
return typeof s == "string" && G.test(s);
|
|
219
224
|
}
|
|
220
|
-
function
|
|
221
|
-
if (!
|
|
225
|
+
function Y(s) {
|
|
226
|
+
if (!_(s))
|
|
222
227
|
throw TypeError("Invalid UUID");
|
|
223
228
|
let r;
|
|
224
229
|
const t = new Uint8Array(16);
|
|
225
230
|
return t[0] = (r = parseInt(s.slice(0, 8), 16)) >>> 24, t[1] = r >>> 16 & 255, t[2] = r >>> 8 & 255, t[3] = r & 255, t[4] = (r = parseInt(s.slice(9, 13), 16)) >>> 8, t[5] = r & 255, t[6] = (r = parseInt(s.slice(14, 18), 16)) >>> 8, t[7] = r & 255, t[8] = (r = parseInt(s.slice(19, 23), 16)) >>> 8, t[9] = r & 255, t[10] = (r = parseInt(s.slice(24, 36), 16)) / 1099511627776 & 255, t[11] = r / 4294967296 & 255, t[12] = r >>> 24 & 255, t[13] = r >>> 16 & 255, t[14] = r >>> 8 & 255, t[15] = r & 255, t;
|
|
226
231
|
}
|
|
227
|
-
function
|
|
232
|
+
function k(s) {
|
|
228
233
|
s = unescape(encodeURIComponent(s));
|
|
229
234
|
const r = [];
|
|
230
235
|
for (let t = 0; t < s.length; ++t)
|
|
@@ -233,16 +238,16 @@ function _(s) {
|
|
|
233
238
|
}
|
|
234
239
|
const V = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", K = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
235
240
|
function W(s, r, t) {
|
|
236
|
-
function e(
|
|
241
|
+
function e(i, o, n, a) {
|
|
237
242
|
var f;
|
|
238
|
-
if (typeof
|
|
243
|
+
if (typeof i == "string" && (i = k(i)), typeof o == "string" && (o = Y(o)), ((f = o) === null || f === void 0 ? void 0 : f.length) !== 16)
|
|
239
244
|
throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
|
|
240
|
-
let c = new Uint8Array(16 +
|
|
241
|
-
if (c.set(o), c.set(
|
|
245
|
+
let c = new Uint8Array(16 + i.length);
|
|
246
|
+
if (c.set(o), c.set(i, o.length), c = t(c), c[6] = c[6] & 15 | r, c[8] = c[8] & 63 | 128, n) {
|
|
242
247
|
a = a || 0;
|
|
243
|
-
for (let
|
|
244
|
-
|
|
245
|
-
return
|
|
248
|
+
for (let g = 0; g < 16; ++g)
|
|
249
|
+
n[a + g] = c[g];
|
|
250
|
+
return n;
|
|
246
251
|
}
|
|
247
252
|
return j(c);
|
|
248
253
|
}
|
|
@@ -270,60 +275,60 @@ function B(s, r) {
|
|
|
270
275
|
function Z(s) {
|
|
271
276
|
const r = [1518500249, 1859775393, 2400959708, 3395469782], t = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
|
|
272
277
|
if (typeof s == "string") {
|
|
273
|
-
const
|
|
278
|
+
const n = unescape(encodeURIComponent(s));
|
|
274
279
|
s = [];
|
|
275
|
-
for (let a = 0; a <
|
|
276
|
-
s.push(
|
|
280
|
+
for (let a = 0; a < n.length; ++a)
|
|
281
|
+
s.push(n.charCodeAt(a));
|
|
277
282
|
} else
|
|
278
283
|
Array.isArray(s) || (s = Array.prototype.slice.call(s));
|
|
279
284
|
s.push(128);
|
|
280
|
-
const e = s.length / 4 + 2,
|
|
281
|
-
for (let
|
|
285
|
+
const e = s.length / 4 + 2, i = Math.ceil(e / 16), o = new Array(i);
|
|
286
|
+
for (let n = 0; n < i; ++n) {
|
|
282
287
|
const a = new Uint32Array(16);
|
|
283
288
|
for (let f = 0; f < 16; ++f)
|
|
284
|
-
a[f] = s[
|
|
285
|
-
o[
|
|
289
|
+
a[f] = s[n * 64 + f * 4] << 24 | s[n * 64 + f * 4 + 1] << 16 | s[n * 64 + f * 4 + 2] << 8 | s[n * 64 + f * 4 + 3];
|
|
290
|
+
o[n] = a;
|
|
286
291
|
}
|
|
287
|
-
o[
|
|
288
|
-
for (let
|
|
292
|
+
o[i - 1][14] = (s.length - 1) * 8 / Math.pow(2, 32), o[i - 1][14] = Math.floor(o[i - 1][14]), o[i - 1][15] = (s.length - 1) * 8 & 4294967295;
|
|
293
|
+
for (let n = 0; n < i; ++n) {
|
|
289
294
|
const a = new Uint32Array(80);
|
|
290
295
|
for (let l = 0; l < 16; ++l)
|
|
291
|
-
a[l] = o[
|
|
296
|
+
a[l] = o[n][l];
|
|
292
297
|
for (let l = 16; l < 80; ++l)
|
|
293
298
|
a[l] = B(a[l - 3] ^ a[l - 8] ^ a[l - 14] ^ a[l - 16], 1);
|
|
294
|
-
let f = t[0], c = t[1],
|
|
299
|
+
let f = t[0], c = t[1], g = t[2], x = t[3], y = t[4];
|
|
295
300
|
for (let l = 0; l < 80; ++l) {
|
|
296
|
-
const R = Math.floor(l / 20),
|
|
297
|
-
|
|
301
|
+
const R = Math.floor(l / 20), $ = B(f, 5) + X(R, c, g, x) + y + r[R] + a[l] >>> 0;
|
|
302
|
+
y = x, x = g, g = B(c, 30) >>> 0, c = f, f = $;
|
|
298
303
|
}
|
|
299
|
-
t[0] = t[0] + f >>> 0, t[1] = t[1] + c >>> 0, t[2] = t[2] +
|
|
304
|
+
t[0] = t[0] + f >>> 0, t[1] = t[1] + c >>> 0, t[2] = t[2] + g >>> 0, t[3] = t[3] + x >>> 0, t[4] = t[4] + y >>> 0;
|
|
300
305
|
}
|
|
301
306
|
return [t[0] >> 24 & 255, t[0] >> 16 & 255, t[0] >> 8 & 255, t[0] & 255, t[1] >> 24 & 255, t[1] >> 16 & 255, t[1] >> 8 & 255, t[1] & 255, t[2] >> 24 & 255, t[2] >> 16 & 255, t[2] >> 8 & 255, t[2] & 255, t[3] >> 24 & 255, t[3] >> 16 & 255, t[3] >> 8 & 255, t[3] & 255, t[4] >> 24 & 255, t[4] >> 16 & 255, t[4] >> 8 & 255, t[4] & 255];
|
|
302
307
|
}
|
|
303
|
-
const Q = W("v5", 80, Z),
|
|
304
|
-
class mt extends
|
|
305
|
-
constructor(t, e = "POST",
|
|
308
|
+
const Q = W("v5", 80, Z), N = Q;
|
|
309
|
+
class mt extends H {
|
|
310
|
+
constructor(t, e = "POST", i = {}) {
|
|
306
311
|
super();
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
312
|
+
h(this, "apiUrl");
|
|
313
|
+
h(this, "method");
|
|
314
|
+
h(this, "headers");
|
|
315
|
+
h(this, "isLoadingEnabled", !0);
|
|
311
316
|
this.apiUrl = t, this.method = e, this.headers = {
|
|
312
317
|
"Content-Type": "application/json",
|
|
313
|
-
...
|
|
318
|
+
...i
|
|
314
319
|
};
|
|
315
320
|
}
|
|
316
321
|
setIsLoadingEnabled(t) {
|
|
317
322
|
this.isLoadingEnabled = t;
|
|
318
323
|
}
|
|
319
324
|
errorHandler(t) {
|
|
320
|
-
return t.code && (
|
|
325
|
+
return t.code && (t.type === "modal" || t.type === "message") && (O.getInstance().setSubject(t), p.getInstance().setSubject(!1)), !t.code;
|
|
321
326
|
}
|
|
322
327
|
fetchData(t = {}) {
|
|
323
|
-
const e = (/* @__PURE__ */ new Date()).toISOString(),
|
|
328
|
+
const e = (/* @__PURE__ */ new Date()).toISOString(), i = N(e, N.URL), o = this.encode({ ...t }, i);
|
|
324
329
|
p.getInstance().setSubject(this.isLoadingEnabled);
|
|
325
330
|
const a = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
|
|
326
|
-
return
|
|
331
|
+
return U(this.apiUrl, {
|
|
327
332
|
method: this.method,
|
|
328
333
|
headers: { ...this.headers, flow: a },
|
|
329
334
|
body: o,
|
|
@@ -333,21 +338,21 @@ class mt extends T {
|
|
|
333
338
|
m((f) => (this.logDebug(
|
|
334
339
|
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(t)} <BODY> ${o} <RESPONSE>: ${JSON.stringify(f)}`
|
|
335
340
|
), d(f))),
|
|
336
|
-
|
|
341
|
+
w(this.errorHandler),
|
|
337
342
|
m((f) => (p.getInstance().setSubject(!1), d(f))),
|
|
338
|
-
|
|
339
|
-
new
|
|
340
|
-
),
|
|
343
|
+
b((f) => (p.getInstance().setSubject(!1), O.getInstance().setSubject(
|
|
344
|
+
new S().get(f, i)
|
|
345
|
+
), D))
|
|
341
346
|
);
|
|
342
347
|
}
|
|
343
348
|
}
|
|
344
349
|
export {
|
|
345
350
|
ct as ApiMiddleware,
|
|
346
|
-
|
|
351
|
+
S as ErrorCatalog,
|
|
347
352
|
dt as FetchServiceBE,
|
|
348
353
|
mt as FetchServiceFE,
|
|
349
354
|
p as LoadingHandler,
|
|
350
|
-
|
|
355
|
+
O as MessageHandler,
|
|
351
356
|
pt as RxSubjectManager,
|
|
352
|
-
|
|
357
|
+
ut as ServiceToken
|
|
353
358
|
};
|