mp-front-cli 0.0.37 → 0.0.38
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/middleware/index.d.ts +2 -2
- package/dist/core/middleware/index.d.ts.map +1 -1
- package/dist/core/utils/api-request/fetch-service-fe.d.ts +2 -2
- package/dist/core/utils/api-request/fetch-service-fe.d.ts.map +1 -1
- package/dist/core/utils/custom-encoder.d.ts +2 -2
- package/dist/core/utils/custom-encoder.d.ts.map +1 -1
- package/dist/core/utils/custom-encrypter.d.ts +12 -0
- package/dist/core/utils/custom-encrypter.d.ts.map +1 -0
- package/dist/core/utils/custom-header.d.ts +2 -2
- package/dist/core/utils/custom-header.d.ts.map +1 -1
- package/dist/custom-encoder-50b5eb15.js +43094 -0
- package/dist/custom-header-ef367c86.js +882 -0
- package/dist/custom-logger-a671be8b.js +171 -0
- package/dist/{custom-validator-ae5da0a7.js → custom-validator-9ec2d3d0.js} +512 -512
- package/dist/mp-front-cli-all.es.js +12 -13
- package/dist/mp-front-cli-core.es.js +83 -176
- package/dist/mp-front-cli-encoder.es.js +2 -2
- package/dist/mp-front-cli-header.es.js +5 -6
- package/dist/mp-front-cli-logger.es.js +2 -53
- package/dist/mp-front-cli-utils-rxjs.es.js +36 -11
- package/dist/mp-front-cli-validator.es.js +3 -3
- package/package.json +9 -2
- package/dist/core/utils/custom-catch-error.d.ts +0 -5
- package/dist/core/utils/custom-catch-error.d.ts.map +0 -1
- package/dist/custom-encoder-6737c6cb.js +0 -3729
- package/dist/custom-header-4aec1dac.js +0 -888
- package/dist/message-handler-d90f2bb6.js +0 -35
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { E as p } from "./custom-validator-
|
|
2
|
-
import { ApiMiddleware as c, FetchServiceBE as
|
|
3
|
-
import { S
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import "./custom-encoder-
|
|
7
|
-
import "./mp-front-cli-logger.es.js";
|
|
1
|
+
import { E as p } from "./custom-validator-9ec2d3d0.js";
|
|
2
|
+
import { ApiMiddleware as c, FetchServiceBE as d, FetchServiceFE as n } from "./mp-front-cli-core.es.js";
|
|
3
|
+
import { S } from "./custom-header-ef367c86.js";
|
|
4
|
+
import { LoadingHandler as g, MessageHandler as l, RxSubjectManager as s } from "./mp-front-cli-utils-rxjs.es.js";
|
|
5
|
+
import "./custom-logger-a671be8b.js";
|
|
6
|
+
import "./custom-encoder-50b5eb15.js";
|
|
8
7
|
import "./index-df4e0539.js";
|
|
9
8
|
import "rxjs";
|
|
10
9
|
export {
|
|
11
10
|
c as ApiMiddleware,
|
|
12
11
|
p as ErrorCatalog,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
d as FetchServiceBE,
|
|
13
|
+
n as FetchServiceFE,
|
|
14
|
+
g as LoadingHandler,
|
|
15
|
+
l as MessageHandler,
|
|
16
|
+
s as RxSubjectManager,
|
|
17
|
+
S as ServiceToken
|
|
19
18
|
};
|
|
@@ -1,230 +1,137 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { E as
|
|
5
|
-
import { C as
|
|
6
|
-
import { S as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import "./custom-
|
|
12
|
-
import "./mp-front-cli-logger.es.js";
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var B = (d, n, t) => n in d ? E(d, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[n] = t;
|
|
3
|
+
var u = (d, n, t) => (B(d, typeof n != "symbol" ? n + "" : n, t), t);
|
|
4
|
+
import { C as S, E as l } from "./custom-validator-9ec2d3d0.js";
|
|
5
|
+
import { C as O, f } from "./custom-header-ef367c86.js";
|
|
6
|
+
import { S as L } from "./custom-header-ef367c86.js";
|
|
7
|
+
import { MessageHandler as g, LoadingHandler as c } from "./mp-front-cli-utils-rxjs.es.js";
|
|
8
|
+
import { RxSubjectManager as v } from "./mp-front-cli-utils-rxjs.es.js";
|
|
9
|
+
import { of as a, switchMap as o, catchError as b, EMPTY as p, filter as x } from "rxjs";
|
|
10
|
+
import { v as m } from "./custom-encoder-50b5eb15.js";
|
|
11
|
+
import "./custom-logger-a671be8b.js";
|
|
13
12
|
import "./index-df4e0539.js";
|
|
14
|
-
class
|
|
13
|
+
class M extends S {
|
|
15
14
|
constructor() {
|
|
16
15
|
super(...arguments);
|
|
17
|
-
|
|
16
|
+
u(this, "uuid", "");
|
|
18
17
|
}
|
|
19
|
-
returnData(t,
|
|
20
|
-
const s = this.encode(
|
|
18
|
+
returnData(t, i, r) {
|
|
19
|
+
const s = this.encode(i, r);
|
|
21
20
|
t.status(200).json(s);
|
|
22
21
|
}
|
|
23
|
-
returnError(t,
|
|
24
|
-
return
|
|
22
|
+
returnError(t, i) {
|
|
23
|
+
return i != null && i.uuid ? t.status(520).json(i) : t.status(520).json(new l().get(i, this.uuid));
|
|
25
24
|
}
|
|
26
25
|
get(t) {
|
|
27
|
-
return this.logDebug("get ApiMiddleware"), (
|
|
26
|
+
return this.logDebug("get ApiMiddleware"), (i, r) => {
|
|
28
27
|
var s;
|
|
29
|
-
this.logDebug("return ApiMiddleware"), this.uuid = (s =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(
|
|
34
|
-
|
|
28
|
+
this.logDebug("return ApiMiddleware"), this.uuid = (s = i == null ? void 0 : i.body) == null ? void 0 : s.uuid, a(i).pipe(
|
|
29
|
+
o((e) => this.validateTokenFront(e)),
|
|
30
|
+
o((e) => a(this.decode(e.body))),
|
|
31
|
+
o(
|
|
32
|
+
(e) => t(e, this.uuid).pipe(
|
|
33
|
+
o((h) => a({ params: e, response: h }))
|
|
35
34
|
)
|
|
36
35
|
),
|
|
37
|
-
|
|
38
|
-
`ApiMiddleware \x1B[37m <URL>: \x1B[33m ${
|
|
39
|
-
),
|
|
40
|
-
|
|
41
|
-
var
|
|
36
|
+
o(({ params: e, response: h }) => (this.logDebug(
|
|
37
|
+
`ApiMiddleware \x1B[37m <URL>: \x1B[33m ${i.url} \x1B[37m <UUID> \x1B[33m ${i.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(e)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(h)}`
|
|
38
|
+
), a(h))),
|
|
39
|
+
b((e) => {
|
|
40
|
+
var h;
|
|
42
41
|
return this.logError(
|
|
43
|
-
`ApiMiddleware <URL>: ${
|
|
44
|
-
), this.returnError(
|
|
42
|
+
`ApiMiddleware <URL>: ${i == null ? void 0 : i.url} <UUID> ${(h = i == null ? void 0 : i.body) == null ? void 0 : h.uuid} <PARAMS> ${JSON.stringify(i == null ? void 0 : i.body)} <ERROR>: ${JSON.stringify(e)}`
|
|
43
|
+
), this.returnError(r, e), p;
|
|
45
44
|
})
|
|
46
45
|
).subscribe({
|
|
47
|
-
next: (
|
|
48
|
-
this.logDebug("ApiMiddleware subscribe next", JSON.stringify(
|
|
46
|
+
next: (e) => {
|
|
47
|
+
this.logDebug("ApiMiddleware subscribe next", JSON.stringify(e)), this.returnData(r, e, this.uuid);
|
|
49
48
|
}
|
|
50
49
|
});
|
|
51
50
|
};
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
|
-
class
|
|
55
|
-
constructor(t,
|
|
53
|
+
class w extends O {
|
|
54
|
+
constructor(t, i) {
|
|
56
55
|
super();
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.apiUrl = t, this.method =
|
|
56
|
+
u(this, "apiUrl");
|
|
57
|
+
u(this, "method");
|
|
58
|
+
this.apiUrl = t, this.method = i ?? "POST";
|
|
60
59
|
}
|
|
61
|
-
errorHandler(t,
|
|
60
|
+
errorHandler(t, i) {
|
|
62
61
|
if (t != null && t.errors)
|
|
63
|
-
throw new
|
|
62
|
+
throw new l().get(t.errors[0], i);
|
|
64
63
|
return !(t != null && t.errors);
|
|
65
64
|
}
|
|
66
|
-
fetchData(t = {},
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
(
|
|
65
|
+
fetchData(t = {}, i) {
|
|
66
|
+
return a(t).pipe(
|
|
67
|
+
o(
|
|
68
|
+
(r) => this.getHeaders().pipe(o((s) => a({ params: r, headers: s })))
|
|
70
69
|
),
|
|
71
|
-
|
|
72
|
-
({ params:
|
|
70
|
+
o(
|
|
71
|
+
({ params: r, headers: s }) => f(this.apiUrl, {
|
|
73
72
|
method: this.method,
|
|
74
73
|
headers: s,
|
|
75
|
-
body: this.method === "GET" ? null : JSON.stringify(
|
|
76
|
-
selector: (
|
|
74
|
+
body: this.method === "GET" ? null : JSON.stringify(r),
|
|
75
|
+
selector: (e) => e.json()
|
|
77
76
|
}).pipe(
|
|
78
|
-
|
|
79
|
-
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${
|
|
77
|
+
o((e) => (this.logDebug(
|
|
78
|
+
`FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${i} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
|
|
80
79
|
s
|
|
81
80
|
)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
|
|
82
|
-
|
|
83
|
-
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(
|
|
84
|
-
),
|
|
81
|
+
r
|
|
82
|
+
)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(e)} \x1B[33m`
|
|
83
|
+
), a(e)))
|
|
85
84
|
)
|
|
86
85
|
),
|
|
87
|
-
|
|
86
|
+
x((r) => this.errorHandler(r, i))
|
|
88
87
|
);
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return typeof e == "string" && j.test(e);
|
|
94
|
-
}
|
|
95
|
-
const a = [];
|
|
96
|
-
for (let e = 0; e < 256; ++e)
|
|
97
|
-
a.push((e + 256).toString(16).slice(1));
|
|
98
|
-
function L(e, i = 0) {
|
|
99
|
-
return a[e[i + 0]] + a[e[i + 1]] + a[e[i + 2]] + a[e[i + 3]] + "-" + a[e[i + 4]] + a[e[i + 5]] + "-" + a[e[i + 6]] + a[e[i + 7]] + "-" + a[e[i + 8]] + a[e[i + 9]] + "-" + a[e[i + 10]] + a[e[i + 11]] + a[e[i + 12]] + a[e[i + 13]] + a[e[i + 14]] + a[e[i + 15]];
|
|
100
|
-
}
|
|
101
|
-
function T(e) {
|
|
102
|
-
if (!v(e))
|
|
103
|
-
throw TypeError("Invalid UUID");
|
|
104
|
-
let i;
|
|
105
|
-
const t = new Uint8Array(16);
|
|
106
|
-
return t[0] = (i = parseInt(e.slice(0, 8), 16)) >>> 24, t[1] = i >>> 16 & 255, t[2] = i >>> 8 & 255, t[3] = i & 255, t[4] = (i = parseInt(e.slice(9, 13), 16)) >>> 8, t[5] = i & 255, t[6] = (i = parseInt(e.slice(14, 18), 16)) >>> 8, t[7] = i & 255, t[8] = (i = parseInt(e.slice(19, 23), 16)) >>> 8, t[9] = i & 255, t[10] = (i = parseInt(e.slice(24, 36), 16)) / 1099511627776 & 255, t[11] = i / 4294967296 & 255, t[12] = i >>> 24 & 255, t[13] = i >>> 16 & 255, t[14] = i >>> 8 & 255, t[15] = i & 255, t;
|
|
107
|
-
}
|
|
108
|
-
function H(e) {
|
|
109
|
-
e = unescape(encodeURIComponent(e));
|
|
110
|
-
const i = [];
|
|
111
|
-
for (let t = 0; t < e.length; ++t)
|
|
112
|
-
i.push(e.charCodeAt(t));
|
|
113
|
-
return i;
|
|
114
|
-
}
|
|
115
|
-
const J = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", C = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
116
|
-
function P(e, i, t) {
|
|
117
|
-
function r(o, s, n, f) {
|
|
118
|
-
var l;
|
|
119
|
-
if (typeof o == "string" && (o = H(o)), typeof s == "string" && (s = T(s)), ((l = s) === null || l === void 0 ? void 0 : l.length) !== 16)
|
|
120
|
-
throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
|
|
121
|
-
let h = new Uint8Array(16 + o.length);
|
|
122
|
-
if (h.set(s), h.set(o, s.length), h = t(h), h[6] = h[6] & 15 | i, h[8] = h[8] & 63 | 128, n) {
|
|
123
|
-
f = f || 0;
|
|
124
|
-
for (let x = 0; x < 16; ++x)
|
|
125
|
-
n[f + x] = h[x];
|
|
126
|
-
return n;
|
|
127
|
-
}
|
|
128
|
-
return L(h);
|
|
129
|
-
}
|
|
130
|
-
try {
|
|
131
|
-
r.name = e;
|
|
132
|
-
} catch {
|
|
133
|
-
}
|
|
134
|
-
return r.DNS = J, r.URL = C, r;
|
|
135
|
-
}
|
|
136
|
-
function F(e, i, t, r) {
|
|
137
|
-
switch (e) {
|
|
138
|
-
case 0:
|
|
139
|
-
return i & t ^ ~i & r;
|
|
140
|
-
case 1:
|
|
141
|
-
return i ^ t ^ r;
|
|
142
|
-
case 2:
|
|
143
|
-
return i & t ^ i & r ^ t & r;
|
|
144
|
-
case 3:
|
|
145
|
-
return i ^ t ^ r;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
function E(e, i) {
|
|
149
|
-
return e << i | e >>> 32 - i;
|
|
150
|
-
}
|
|
151
|
-
function k(e) {
|
|
152
|
-
const i = [1518500249, 1859775393, 2400959708, 3395469782], t = [1732584193, 4023233417, 2562383102, 271733878, 3285377520];
|
|
153
|
-
if (typeof e == "string") {
|
|
154
|
-
const n = unescape(encodeURIComponent(e));
|
|
155
|
-
e = [];
|
|
156
|
-
for (let f = 0; f < n.length; ++f)
|
|
157
|
-
e.push(n.charCodeAt(f));
|
|
158
|
-
} else
|
|
159
|
-
Array.isArray(e) || (e = Array.prototype.slice.call(e));
|
|
160
|
-
e.push(128);
|
|
161
|
-
const r = e.length / 4 + 2, o = Math.ceil(r / 16), s = new Array(o);
|
|
162
|
-
for (let n = 0; n < o; ++n) {
|
|
163
|
-
const f = new Uint32Array(16);
|
|
164
|
-
for (let l = 0; l < 16; ++l)
|
|
165
|
-
f[l] = e[n * 64 + l * 4] << 24 | e[n * 64 + l * 4 + 1] << 16 | e[n * 64 + l * 4 + 2] << 8 | e[n * 64 + l * 4 + 3];
|
|
166
|
-
s[n] = f;
|
|
167
|
-
}
|
|
168
|
-
s[o - 1][14] = (e.length - 1) * 8 / Math.pow(2, 32), s[o - 1][14] = Math.floor(s[o - 1][14]), s[o - 1][15] = (e.length - 1) * 8 & 4294967295;
|
|
169
|
-
for (let n = 0; n < o; ++n) {
|
|
170
|
-
const f = new Uint32Array(80);
|
|
171
|
-
for (let c = 0; c < 16; ++c)
|
|
172
|
-
f[c] = s[n][c];
|
|
173
|
-
for (let c = 16; c < 80; ++c)
|
|
174
|
-
f[c] = E(f[c - 3] ^ f[c - 8] ^ f[c - 14] ^ f[c - 16], 1);
|
|
175
|
-
let l = t[0], h = t[1], x = t[2], p = t[3], S = t[4];
|
|
176
|
-
for (let c = 0; c < 80; ++c) {
|
|
177
|
-
const U = Math.floor(c / 20), O = E(l, 5) + F(U, h, x, p) + S + i[U] + f[c] >>> 0;
|
|
178
|
-
S = p, p = x, x = E(h, 30) >>> 0, h = l, l = O;
|
|
179
|
-
}
|
|
180
|
-
t[0] = t[0] + l >>> 0, t[1] = t[1] + h >>> 0, t[2] = t[2] + x >>> 0, t[3] = t[3] + p >>> 0, t[4] = t[4] + S >>> 0;
|
|
181
|
-
}
|
|
182
|
-
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];
|
|
183
|
-
}
|
|
184
|
-
const Y = P("v5", 80, k), b = Y;
|
|
185
|
-
class et extends A {
|
|
186
|
-
constructor(t, r = "POST", o = {}) {
|
|
90
|
+
class J extends S {
|
|
91
|
+
constructor(t, i = "POST", r = {}) {
|
|
187
92
|
super();
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this.apiUrl = t, this.method =
|
|
93
|
+
u(this, "apiUrl");
|
|
94
|
+
u(this, "method");
|
|
95
|
+
u(this, "headers");
|
|
96
|
+
u(this, "isLoadingEnabled", !0);
|
|
97
|
+
this.apiUrl = t, this.method = i, this.headers = {
|
|
193
98
|
"Content-Type": "application/json",
|
|
194
|
-
...
|
|
99
|
+
...r
|
|
195
100
|
};
|
|
196
101
|
}
|
|
197
102
|
setIsLoadingEnabled(t) {
|
|
198
103
|
this.isLoadingEnabled = t;
|
|
199
104
|
}
|
|
200
105
|
errorHandler(t) {
|
|
201
|
-
return t.code && (
|
|
106
|
+
return t.code && (g.getInstance().setSubject(t), c.getInstance().setSubject(!1)), !t.code;
|
|
202
107
|
}
|
|
203
108
|
fetchData(t = {}) {
|
|
204
|
-
const
|
|
205
|
-
return
|
|
109
|
+
const i = (/* @__PURE__ */ new Date()).toISOString(), r = m(i, m.URL), s = this.encode({ ...t }, r);
|
|
110
|
+
return c.getInstance().setSubject(this.isLoadingEnabled), f(this.apiUrl, {
|
|
206
111
|
method: this.method,
|
|
207
112
|
headers: this.headers,
|
|
208
113
|
body: s,
|
|
209
|
-
selector: (
|
|
114
|
+
selector: (e) => e.json()
|
|
210
115
|
}).pipe(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(t)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(
|
|
214
|
-
),
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
116
|
+
o((e) => a(this.decode(e))),
|
|
117
|
+
o((e) => (this.logDebug(
|
|
118
|
+
`FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(t)} <BODY> ${s} <RESPONSE>: ${JSON.stringify(e)}`
|
|
119
|
+
), a(e))),
|
|
120
|
+
x(this.errorHandler),
|
|
121
|
+
o((e) => (c.getInstance().setSubject(!1), a(e))),
|
|
122
|
+
b((e) => (c.getInstance().setSubject(!1), g.getInstance().setSubject(
|
|
123
|
+
new l().get(e, r)
|
|
124
|
+
), p))
|
|
218
125
|
);
|
|
219
126
|
}
|
|
220
127
|
}
|
|
221
128
|
export {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
129
|
+
M as ApiMiddleware,
|
|
130
|
+
l as ErrorCatalog,
|
|
131
|
+
w as FetchServiceBE,
|
|
132
|
+
J as FetchServiceFE,
|
|
133
|
+
c as LoadingHandler,
|
|
134
|
+
g as MessageHandler,
|
|
135
|
+
v as RxSubjectManager,
|
|
136
|
+
L as ServiceToken
|
|
230
137
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import "./custom-logger-a671be8b.js";
|
|
1
2
|
import "rxjs";
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
4
|
-
import "./custom-
|
|
5
|
-
import "./custom-encoder-6737c6cb.js";
|
|
3
|
+
import { C as a } from "./custom-header-ef367c86.js";
|
|
4
|
+
import "./custom-validator-9ec2d3d0.js";
|
|
5
|
+
import "./custom-encoder-50b5eb15.js";
|
|
6
6
|
import "./index-df4e0539.js";
|
|
7
|
-
import "./message-handler-d90f2bb6.js";
|
|
8
7
|
export {
|
|
9
|
-
|
|
8
|
+
a as CustomHeader
|
|
10
9
|
};
|
|
@@ -1,55 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var n = (r, o, s) => o in r ? i(r, o, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[o] = s;
|
|
3
|
-
var t = (r, o, s) => (n(r, typeof o != "symbol" ? o + "" : o, s), s);
|
|
4
|
-
var g = /* @__PURE__ */ ((r) => (r[r.error = 0] = "error", r[r.warn = 1] = "warn", r[r.info = 2] = "info", r[r.http = 3] = "http", r[r.verbose = 4] = "verbose", r[r.debug = 5] = "debug", r[r.silly = 6] = "silly", r))(g || {});
|
|
5
|
-
const l = {
|
|
6
|
-
error: "\x1B[31m",
|
|
7
|
-
warn: "\x1B[33m",
|
|
8
|
-
info: "\x1B[34m",
|
|
9
|
-
http: "\x1B[35m",
|
|
10
|
-
verbose: "\x1B[32m",
|
|
11
|
-
debug: "\x1B[37m",
|
|
12
|
-
silly: "\x1B[37m"
|
|
13
|
-
};
|
|
14
|
-
class p {
|
|
15
|
-
constructor() {
|
|
16
|
-
t(this, "appName");
|
|
17
|
-
t(this, "logsLevel");
|
|
18
|
-
t(this, "silentLogs");
|
|
19
|
-
this.appName = process.env.APP_LOGS_NAME || "", this.logsLevel = process.env.NODE_ENV == "development" ? "debug" : process.env.LOGS_LEVEL, this.silentLogs = process.env.SILENT_LOGS === "true";
|
|
20
|
-
}
|
|
21
|
-
consoleFormat(o, s) {
|
|
22
|
-
try {
|
|
23
|
-
return `${l[o]} ${this.appName} [${(/* @__PURE__ */ new Date()).toISOString()}] [${o.toUpperCase()}]: ${s.toString()} \x1B[37m`;
|
|
24
|
-
} catch {
|
|
25
|
-
return s;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
log(o, s) {
|
|
29
|
-
o <= g[this.logsLevel] && !this.silentLogs && console.log(this.consoleFormat(g[o], s));
|
|
30
|
-
}
|
|
31
|
-
logError(...o) {
|
|
32
|
-
this.log(0, o);
|
|
33
|
-
}
|
|
34
|
-
logWarn(...o) {
|
|
35
|
-
this.log(1, o);
|
|
36
|
-
}
|
|
37
|
-
logInfo(...o) {
|
|
38
|
-
this.log(2, o);
|
|
39
|
-
}
|
|
40
|
-
logHttp(...o) {
|
|
41
|
-
this.log(3, o);
|
|
42
|
-
}
|
|
43
|
-
logVerbose(...o) {
|
|
44
|
-
this.log(4, o);
|
|
45
|
-
}
|
|
46
|
-
logDebug(...o) {
|
|
47
|
-
this.log(5, o);
|
|
48
|
-
}
|
|
49
|
-
logSilly(...o) {
|
|
50
|
-
this.log(6, o);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
import { C as e } from "./custom-logger-a671be8b.js";
|
|
53
2
|
export {
|
|
54
|
-
|
|
3
|
+
e as CustomLogger
|
|
55
4
|
};
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var o = (n, s, t) => s in n ? j(n, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[s] = t;
|
|
3
|
+
var u = (n, s, t) => (o(n, typeof s != "symbol" ? s + "" : s, t), t);
|
|
4
|
+
import { Observable as p, Subject as i } from "rxjs";
|
|
5
|
+
class a extends p {
|
|
6
|
+
constructor() {
|
|
7
|
+
super((t) => {
|
|
8
|
+
this.subject$.subscribe(t);
|
|
9
|
+
});
|
|
10
|
+
u(this, "subject$", new i());
|
|
11
|
+
}
|
|
12
|
+
setSubject(t) {
|
|
13
|
+
this.subject$.next(t);
|
|
14
|
+
}
|
|
15
|
+
completeSubject() {
|
|
16
|
+
this.subject$.complete();
|
|
17
|
+
}
|
|
18
|
+
unsubscribeSubject() {
|
|
19
|
+
return this.subject$.unsubscribe(), this.subject$ = new i(), this.subject$;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const e = class e extends a {
|
|
8
23
|
constructor() {
|
|
9
24
|
super();
|
|
10
25
|
}
|
|
@@ -12,10 +27,20 @@ const e = class e extends o {
|
|
|
12
27
|
return e.instance || (e.instance = new e()), e.instance;
|
|
13
28
|
}
|
|
14
29
|
};
|
|
15
|
-
|
|
16
|
-
let
|
|
30
|
+
u(e, "instance");
|
|
31
|
+
let b = e;
|
|
32
|
+
const c = class c extends a {
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
}
|
|
36
|
+
static getInstance() {
|
|
37
|
+
return c.instance || (c.instance = new c()), c.instance;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
u(c, "instance");
|
|
41
|
+
let r = c;
|
|
17
42
|
export {
|
|
18
43
|
r as LoadingHandler,
|
|
19
|
-
|
|
20
|
-
|
|
44
|
+
b as MessageHandler,
|
|
45
|
+
a as RxSubjectManager
|
|
21
46
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as p } from "./custom-validator-
|
|
2
|
-
import "./custom-encoder-
|
|
1
|
+
import { C as p } from "./custom-validator-9ec2d3d0.js";
|
|
2
|
+
import "./custom-encoder-50b5eb15.js";
|
|
3
|
+
import "./custom-logger-a671be8b.js";
|
|
3
4
|
import "./index-df4e0539.js";
|
|
4
|
-
import "./mp-front-cli-logger.es.js";
|
|
5
5
|
export {
|
|
6
6
|
p as CustomValidator
|
|
7
7
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mp-front-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -42,17 +42,23 @@
|
|
|
42
42
|
"types": "./dist/core/utils/custom-validator.d.ts",
|
|
43
43
|
"import": "./dist/mp-front-cli-validator.es.js"
|
|
44
44
|
},
|
|
45
|
+
"./core/encrypter": {
|
|
46
|
+
"types": "./dist/core/utils/custom-encrypter.d.ts",
|
|
47
|
+
"import": "./dist/mp-front-cli-encrypter.es.js"
|
|
48
|
+
},
|
|
45
49
|
"./locale": {
|
|
46
50
|
"types": "./dist/lang/index.d.ts",
|
|
47
51
|
"import": "./dist/mp-front-cli-locale.es.js"
|
|
48
52
|
}
|
|
49
53
|
},
|
|
50
54
|
"dependencies": {
|
|
55
|
+
"@types/node-jose": "^1.1.13",
|
|
51
56
|
"@types/uuid": "^9.0.8",
|
|
52
57
|
"i18next": "23.7.20",
|
|
53
58
|
"lodash": "^4.17.21",
|
|
54
59
|
"next": "14.1.0",
|
|
55
60
|
"next-auth": "^4.24.5",
|
|
61
|
+
"node-jose": "^2.2.0",
|
|
56
62
|
"rxjs": "^7.8.1",
|
|
57
63
|
"uuid": "^9.0.1"
|
|
58
64
|
},
|
|
@@ -66,6 +72,7 @@
|
|
|
66
72
|
"typescript": "5.3.3",
|
|
67
73
|
"vite": "4.5.2",
|
|
68
74
|
"vite-plugin-dts": "3.7.1",
|
|
75
|
+
"vite-plugin-node-polyfills": "^0.21.0",
|
|
69
76
|
"vite-tsconfig-paths": "4.2.2"
|
|
70
77
|
}
|
|
71
|
-
}
|
|
78
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"custom-catch-error.d.ts","sourceRoot":"","sources":["../../../src/core/utils/custom-catch-error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAIpD,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM;CAKlC"}
|