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.
- package/dist/core/errors/enrollment/error-catalog-enrollment.d.ts +1 -1
- package/dist/core/errors/error-catalog.d.ts +9 -9
- package/dist/core/errors/helpdesk/cancelPr.d.ts +1 -1
- package/dist/core/errors/helpdesk/index.d.ts +1 -1
- package/dist/core/errors/helpdesk/skipFingerprint.d.ts +1 -1
- package/dist/core/errors/index.d.ts +1 -1
- package/dist/core/errors/message-error.d.ts +3 -3
- package/dist/core/index.d.ts +5 -5
- package/dist/core/interfaces/api-response.d.ts +0 -1
- package/dist/core/interfaces/api-response.d.ts.map +1 -1
- package/dist/core/interfaces/index.d.ts +3 -3
- package/dist/core/middleware/index.d.ts +5 -5
- package/dist/core/services/index.d.ts +1 -1
- package/dist/core/services/service-token.d.ts +2 -2
- package/dist/core/utils/Terminal/constants/index.d.ts +1 -1
- package/dist/core/utils/Terminal/index.d.ts +3 -3
- package/dist/core/utils/api-request/fetch-service-be.d.ts +4 -4
- package/dist/core/utils/api-request/fetch-service-fe.d.ts +3 -3
- package/dist/core/utils/api-request/index.d.ts +2 -2
- package/dist/core/utils/custom-adapter.d.ts +1 -1
- package/dist/core/utils/custom-adapter.d.ts.map +1 -1
- package/dist/core/utils/custom-cache.d.ts +3 -3
- package/dist/core/utils/custom-encoder.d.ts +1 -1
- package/dist/core/utils/custom-encrypter.d.ts +1 -1
- package/dist/core/utils/custom-header.d.ts +2 -2
- package/dist/core/utils/custom-redis.d.ts +1 -1
- package/dist/core/utils/func/index.d.ts +1 -1
- package/dist/core/utils/index.d.ts +2 -2
- package/dist/core/utils/rxjs/index.d.ts +3 -3
- package/dist/core/utils/rxjs/loading-handler.d.ts +1 -1
- package/dist/core/utils/rxjs/message-handler.d.ts +2 -2
- package/dist/core/utils/rxjs/rx-subject-manager.d.ts +1 -1
- package/dist/fetch-service-fe-Bn43l_lH.js +1574 -0
- package/dist/index.d.ts +1 -1
- package/dist/lang/common/errors/calculator/index.d.ts +2 -2
- package/dist/lang/common/errors/enrollment/index.d.ts +2 -2
- package/dist/lang/common/errors/helpdesk/index.d.ts +2 -2
- package/dist/lang/common/errors/index.d.ts +2 -2
- package/dist/lang/common/index.d.ts +1 -1
- package/dist/lang/i18n.d.ts +1 -1
- package/dist/lang/index.d.ts +4 -4
- package/dist/lang/validator/index.d.ts +2 -2
- package/dist/loading-handler-Br21zGTA.js +46 -0
- package/dist/mp-front-cli-adapter.es.js +73 -84
- package/dist/mp-front-cli-all.es.js +11 -22
- package/dist/mp-front-cli-cache.es.js +33 -38
- package/dist/mp-front-cli-core.es.js +11 -1582
- package/dist/mp-front-cli-encoder.es.js +3535 -3537
- package/dist/mp-front-cli-encrypter.es.js +11 -14
- package/dist/mp-front-cli-header.es.js +13 -17
- package/dist/mp-front-cli-locale.es.js +1 -1
- package/dist/mp-front-cli-logger.es.js +1 -1
- package/dist/mp-front-cli-services.es.js +2 -4
- package/dist/mp-front-cli-utils-rxjs.es.js +3 -43
- package/dist/service-token-D8bum6H0.js +811 -0
- package/package.json +11 -11
- package/dist/index-def0b487.js +0 -844
- /package/dist/{custom-redis-bee66564.js → custom-redis-BMPP_XZi.js} +0 -0
- /package/dist/{i18n-3dcfe704.js → i18n-CniHhItS.js} +0 -0
- /package/dist/{stringify-788d71a0.js → stringify-93tp0umt.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './core';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as calculatorEN_EN } from
|
|
2
|
-
export { default as calculatorES_MX } from
|
|
1
|
+
export { default as calculatorEN_EN } from './en_EN';
|
|
2
|
+
export { default as calculatorES_MX } from './es_MX';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as enrollmentEN_EN } from
|
|
2
|
-
export { default as enrollmentES_MX } from
|
|
1
|
+
export { default as enrollmentEN_EN } from './en_EN';
|
|
2
|
+
export { default as enrollmentES_MX } from './es_MX';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as helpdeskEN_EN } from
|
|
2
|
-
export { default as helpdeskES_MX } from
|
|
1
|
+
export { default as helpdeskEN_EN } from './en_EN';
|
|
2
|
+
export { default as helpdeskES_MX } from './en_MX';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as errorEN_EN } from
|
|
2
|
-
export { default as errorES_MX } from
|
|
1
|
+
export { default as errorEN_EN } from './en_EN';
|
|
2
|
+
export { default as errorES_MX } from './es_MX';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './errors';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lang/i18n.d.ts
CHANGED
package/dist/lang/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export { default as i18n } from
|
|
4
|
-
export { errorES_MX } from
|
|
1
|
+
export * from './common';
|
|
2
|
+
export * from './validator';
|
|
3
|
+
export { default as i18n } from '../lang/i18n';
|
|
4
|
+
export { errorES_MX } from './common';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as validatorEN_EN } from
|
|
2
|
-
export { default as validatorES_MX } from
|
|
1
|
+
export { default as validatorEN_EN } from './en_EN';
|
|
2
|
+
export { default as validatorES_MX } from './es_MX';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var o = (n, t, s) => t in n ? j(n, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[t] = s;
|
|
3
|
+
var u = (n, t, s) => o(n, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
import { Observable as p, Subject as i } from "rxjs";
|
|
5
|
+
class a extends p {
|
|
6
|
+
constructor() {
|
|
7
|
+
super((s) => {
|
|
8
|
+
this.subject$.subscribe(s);
|
|
9
|
+
});
|
|
10
|
+
u(this, "subject$", new i());
|
|
11
|
+
}
|
|
12
|
+
setSubject(s) {
|
|
13
|
+
this.subject$.next(s);
|
|
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 {
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
}
|
|
26
|
+
static getInstance() {
|
|
27
|
+
return e.instance || (e.instance = new e()), e.instance;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
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;
|
|
42
|
+
export {
|
|
43
|
+
r as L,
|
|
44
|
+
b as M,
|
|
45
|
+
a as R
|
|
46
|
+
};
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import { C as Z } from "./custom-redis-
|
|
2
|
-
import { u as $ } from "./stringify-
|
|
3
|
-
|
|
4
|
-
let x;
|
|
1
|
+
import { C as Z } from "./custom-redis-BMPP_XZi.js";
|
|
2
|
+
import { u as $ } from "./stringify-93tp0umt.js";
|
|
3
|
+
let w;
|
|
5
4
|
const v = new Uint8Array(16);
|
|
6
5
|
function C() {
|
|
7
|
-
if (!
|
|
6
|
+
if (!w && (w = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !w))
|
|
8
7
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
9
|
-
return
|
|
8
|
+
return w(v);
|
|
10
9
|
}
|
|
11
|
-
const G = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
10
|
+
const G = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), O = {
|
|
12
11
|
randomUUID: G
|
|
13
12
|
};
|
|
14
|
-
function H(
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
r = r || 0;
|
|
21
|
-
for (let u = 0; u < 16; ++u)
|
|
22
|
-
s[r + u] = i[u];
|
|
23
|
-
return s;
|
|
24
|
-
}
|
|
25
|
-
return $(i);
|
|
13
|
+
function H(r, s, i) {
|
|
14
|
+
if (O.randomUUID && !r)
|
|
15
|
+
return O.randomUUID();
|
|
16
|
+
r = r || {};
|
|
17
|
+
const o = r.random || (r.rng || C)();
|
|
18
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, $(o);
|
|
26
19
|
}
|
|
27
|
-
const L = process.env.PREFIX_LOGIN,
|
|
20
|
+
const L = process.env.PREFIX_LOGIN, b = process.env.TIMEOUT_SESSION_MINUTES, q = {
|
|
28
21
|
baseKeyPrefix: `${L}:`,
|
|
29
22
|
userKeyPrefix: "user:",
|
|
30
23
|
accountKeyPrefix: "account:",
|
|
@@ -33,71 +26,69 @@ const L = process.env.PREFIX_LOGIN, B = process.env.TIMEOUT_SESSION_MINUTES, q =
|
|
|
33
26
|
sessionByUserIdPrefix: "session:user:",
|
|
34
27
|
userByEmailKeyPrefix: "user:email:",
|
|
35
28
|
verificationKeyPrefix: "verification:",
|
|
36
|
-
expire:
|
|
37
|
-
}, z = (
|
|
38
|
-
for (const s in
|
|
29
|
+
expire: b * 60
|
|
30
|
+
}, z = (r) => {
|
|
31
|
+
for (const s in r)
|
|
39
32
|
return !1;
|
|
40
33
|
return !0;
|
|
41
|
-
}, J = /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/, Q = (
|
|
42
|
-
function
|
|
43
|
-
const s = Z,
|
|
34
|
+
}, J = /(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/, Q = (r) => r && J.test(r) && !Number.isNaN(Date.parse(r));
|
|
35
|
+
function ee(r = { expire: b * 60 }) {
|
|
36
|
+
const s = Z, i = {
|
|
44
37
|
...q,
|
|
45
|
-
...
|
|
46
|
-
},
|
|
47
|
-
const n = Object.entries(t).reduce((
|
|
48
|
-
await s.hset(e, n), await s.expire(e,
|
|
49
|
-
},
|
|
38
|
+
...r
|
|
39
|
+
}, o = i.baseKeyPrefix || "", A = o + i.userKeyPrefix, B = o + i.userByEmailKeyPrefix, k = o + i.accountKeyPrefix, T = o + i.accountByUserIdPrefix, D = o + i.sessionKeyPrefix, V = o + i.sessionByUserIdPrefix, j = o + i.verificationKeyPrefix, x = (e) => B + e, U = (e) => A + e, K = (e) => k + e, y = (e) => T + e, p = (e, t) => `${t}:${e}`, I = (e) => D + e, f = (e) => V + e, g = (e) => j + e, l = async (e, t) => {
|
|
40
|
+
const n = Object.entries(t).reduce((c, [P, a]) => (c[P] = a instanceof Date ? a.toISOString() : a, c), {});
|
|
41
|
+
await s.hset(e, n), await s.expire(e, i.expire);
|
|
42
|
+
}, d = async (e) => {
|
|
50
43
|
const t = await s.hgetall(e);
|
|
51
|
-
return !t || z(t) ? null : Object.entries(t).reduce((
|
|
52
|
-
},
|
|
53
|
-
|
|
44
|
+
return !t || z(t) ? null : Object.entries(t).reduce((c, [P, a]) => (c[P] = Q(a) ? new Date(a) : a, c), {});
|
|
45
|
+
}, S = async (e, t) => (await l(U(e), t), t.email && await s.set(
|
|
46
|
+
x(t.email),
|
|
54
47
|
e,
|
|
55
48
|
"EX",
|
|
56
|
-
|
|
57
|
-
), t),
|
|
58
|
-
const t = await
|
|
49
|
+
i.expire
|
|
50
|
+
), t), u = async (e) => {
|
|
51
|
+
const t = await d(U(e));
|
|
59
52
|
return t ? { ...t } : null;
|
|
60
53
|
}, N = async (e, t) => {
|
|
61
54
|
const n = K(e);
|
|
62
|
-
await
|
|
63
|
-
|
|
55
|
+
await l(n, t), await s.set(
|
|
56
|
+
y(t.userId),
|
|
64
57
|
n,
|
|
65
58
|
"EX",
|
|
66
|
-
|
|
59
|
+
i.expire
|
|
67
60
|
);
|
|
68
61
|
}, R = async (e) => {
|
|
69
|
-
const t = await
|
|
62
|
+
const t = await d(K(e));
|
|
70
63
|
return t ? { ...t } : null;
|
|
71
64
|
}, h = async (e) => {
|
|
72
|
-
const t = K(e), n = await
|
|
73
|
-
if (!n)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, O = async (e, t) => {
|
|
65
|
+
const t = K(e), n = await d(t);
|
|
66
|
+
if (!n) return null;
|
|
67
|
+
await s.hdel(t), await s.del(y(n.userId));
|
|
68
|
+
}, E = async (e, t) => {
|
|
77
69
|
const n = I(e);
|
|
78
|
-
return await
|
|
79
|
-
|
|
70
|
+
return await l(n, t), await s.set(
|
|
71
|
+
f(t.userId),
|
|
80
72
|
n,
|
|
81
73
|
"EX",
|
|
82
|
-
|
|
74
|
+
i.expire
|
|
83
75
|
), t;
|
|
84
|
-
},
|
|
85
|
-
const t = await
|
|
76
|
+
}, m = async (e) => {
|
|
77
|
+
const t = await d(I(e));
|
|
86
78
|
return t ? {
|
|
87
79
|
id: t.id,
|
|
88
80
|
...t
|
|
89
81
|
} : null;
|
|
90
82
|
}, _ = async (e) => {
|
|
91
|
-
const t = await
|
|
92
|
-
if (!t)
|
|
93
|
-
return null;
|
|
83
|
+
const t = await m(e);
|
|
84
|
+
if (!t) return null;
|
|
94
85
|
const n = I(e);
|
|
95
|
-
await s.del(n), await s.del(
|
|
86
|
+
await s.del(n), await s.del(f(t.userId));
|
|
96
87
|
}, X = async (e, t) => {
|
|
97
88
|
const n = g(e);
|
|
98
|
-
return await
|
|
89
|
+
return await l(n, t), t;
|
|
99
90
|
}, M = async (e) => {
|
|
100
|
-
const t = g(e), n = await
|
|
91
|
+
const t = g(e), n = await d(t);
|
|
101
92
|
return n ? { identifier: n.identifier, ...n } : null;
|
|
102
93
|
}, F = async (e) => {
|
|
103
94
|
const t = g(e);
|
|
@@ -106,62 +97,60 @@ function te(c = { expire: B * 60 }) {
|
|
|
106
97
|
return {
|
|
107
98
|
async createUser(e) {
|
|
108
99
|
const t = H();
|
|
109
|
-
return await
|
|
100
|
+
return await S(t, { ...e, id: t });
|
|
110
101
|
},
|
|
111
|
-
getUser:
|
|
102
|
+
getUser: u,
|
|
112
103
|
async getUserByEmail(e) {
|
|
113
|
-
const t = await s.get(
|
|
114
|
-
return t ? await
|
|
104
|
+
const t = await s.get(x(e));
|
|
105
|
+
return t ? await u(t) : null;
|
|
115
106
|
},
|
|
116
107
|
async getUserByAccount({ providerAccountId: e, provider: t }) {
|
|
117
108
|
const n = await R(
|
|
118
|
-
|
|
109
|
+
p(e, t)
|
|
119
110
|
);
|
|
120
|
-
return n ? await
|
|
111
|
+
return n ? await u(n.userId) : null;
|
|
121
112
|
},
|
|
122
113
|
async updateUser(e) {
|
|
123
|
-
const t = e.id, n = await
|
|
124
|
-
return await
|
|
114
|
+
const t = e.id, n = await u(t);
|
|
115
|
+
return await S(t, { ...n, ...e });
|
|
125
116
|
},
|
|
126
117
|
async deleteUser(e) {
|
|
127
|
-
const t = await
|
|
128
|
-
if (!t)
|
|
129
|
-
|
|
130
|
-
const n = await s.get(f(e)), o = await s.get(l(e));
|
|
118
|
+
const t = await u(e);
|
|
119
|
+
if (!t) return null;
|
|
120
|
+
const n = await s.get(y(e)), c = await s.get(f(e));
|
|
131
121
|
await s.del(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
),
|
|
122
|
+
x(t.email),
|
|
123
|
+
y(e),
|
|
124
|
+
f(e)
|
|
125
|
+
), c && await s.del(c), n && await s.del(n), await s.del(U(e));
|
|
136
126
|
},
|
|
137
127
|
async linkAccount(e) {
|
|
138
|
-
const t =
|
|
128
|
+
const t = p(e.providerAccountId, e.provider);
|
|
139
129
|
return await N(t, { ...e, id: t });
|
|
140
130
|
},
|
|
141
131
|
async unlinkAccount({
|
|
142
132
|
providerAccountId: e,
|
|
143
133
|
provider: t
|
|
144
134
|
}) {
|
|
145
|
-
const n =
|
|
135
|
+
const n = p(e, t);
|
|
146
136
|
await h(n);
|
|
147
137
|
},
|
|
148
138
|
async createSession(e) {
|
|
149
139
|
const t = e.sessionToken;
|
|
150
|
-
return await
|
|
140
|
+
return await E(t, {
|
|
151
141
|
...e,
|
|
152
142
|
id: t
|
|
153
143
|
});
|
|
154
144
|
},
|
|
155
145
|
async getSessionAndUser(e) {
|
|
156
|
-
const n = await
|
|
157
|
-
if (!n)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return o ? { session: n, user: o } : null;
|
|
146
|
+
const n = await m(e);
|
|
147
|
+
if (!n) return null;
|
|
148
|
+
const c = await u(n.userId);
|
|
149
|
+
return c ? { session: n, user: c } : null;
|
|
161
150
|
},
|
|
162
151
|
async updateSession(e) {
|
|
163
|
-
const t = e.sessionToken, n = await
|
|
164
|
-
return n ? await
|
|
152
|
+
const t = e.sessionToken, n = await m(t);
|
|
153
|
+
return n ? await E(t, { ...n, ...e }) : null;
|
|
165
154
|
},
|
|
166
155
|
deleteSession: _,
|
|
167
156
|
async createVerificationToken(e) {
|
|
@@ -175,6 +164,6 @@ function te(c = { expire: B * 60 }) {
|
|
|
175
164
|
};
|
|
176
165
|
}
|
|
177
166
|
export {
|
|
178
|
-
|
|
167
|
+
ee as IORedisAdapter,
|
|
179
168
|
q as defaultOptions
|
|
180
169
|
};
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { S as
|
|
4
|
-
import "./i18n-3dcfe704.js";
|
|
5
|
-
import "i18next";
|
|
6
|
-
import "./mp-front-cli-logger.es.js";
|
|
7
|
-
import "rxjs";
|
|
8
|
-
import "./mp-front-cli-encrypter.es.js";
|
|
9
|
-
import "node-jose";
|
|
10
|
-
import "crypto";
|
|
11
|
-
import "./mp-front-cli-encoder.es.js";
|
|
12
|
-
import "./mp-front-cli-header.es.js";
|
|
13
|
-
import "querystring";
|
|
14
|
-
import "./stringify-788d71a0.js";
|
|
1
|
+
import { A as r, E as o, F as s, a as t } from "./fetch-service-fe-Bn43l_lH.js";
|
|
2
|
+
import { L as i, M as d, R as n } from "./loading-handler-Br21zGTA.js";
|
|
3
|
+
import { S as g } from "./service-token-D8bum6H0.js";
|
|
15
4
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
r as ApiMiddleware,
|
|
6
|
+
o as ErrorCatalog,
|
|
7
|
+
s as FetchServiceBE,
|
|
8
|
+
t as FetchServiceFE,
|
|
9
|
+
i as LoadingHandler,
|
|
10
|
+
d as MessageHandler,
|
|
11
|
+
n as RxSubjectManager,
|
|
12
|
+
g as ServiceToken
|
|
24
13
|
};
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var E = (n, r, t) => (
|
|
4
|
-
import { CustomEncrypter as
|
|
5
|
-
import { C as
|
|
6
|
-
import "node-jose";
|
|
7
|
-
import "crypto";
|
|
8
|
-
import "./mp-front-cli-encoder.es.js";
|
|
9
|
-
import "./mp-front-cli-logger.es.js";
|
|
10
|
-
import "ioredis";
|
|
1
|
+
var S = Object.defineProperty;
|
|
2
|
+
var p = (n, r, t) => r in n ? S(n, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[r] = t;
|
|
3
|
+
var E = (n, r, t) => p(n, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { CustomEncrypter as u } from "./mp-front-cli-encrypter.es.js";
|
|
5
|
+
import { C as R } from "./custom-redis-BMPP_XZi.js";
|
|
11
6
|
const a = process.env.TIMEOUT_SESSION_MINUTES;
|
|
12
|
-
var
|
|
13
|
-
class
|
|
7
|
+
var d = /* @__PURE__ */ ((n) => (n.NOT_REFRESH = "NOT_REFRESH", n.REFRESH = "REFRESH", n))(d || {});
|
|
8
|
+
class N extends u {
|
|
14
9
|
constructor() {
|
|
15
10
|
super(...arguments);
|
|
16
|
-
E(this, "initClient",
|
|
11
|
+
E(this, "initClient", R);
|
|
17
12
|
}
|
|
18
13
|
getRootNode(t) {
|
|
19
14
|
return this.initClient.get(t);
|
|
@@ -25,38 +20,38 @@ class O extends m {
|
|
|
25
20
|
throw new Error("Not found entry point");
|
|
26
21
|
}
|
|
27
22
|
}
|
|
28
|
-
setEntryPoint(t,
|
|
29
|
-
const s = typeof
|
|
30
|
-
this.initClient.set(t, s, "EX", 60 *
|
|
23
|
+
setEntryPoint(t, e, i) {
|
|
24
|
+
const s = typeof e == "string" ? e : JSON.stringify(e);
|
|
25
|
+
this.initClient.set(t, s, "EX", 60 * i);
|
|
31
26
|
}
|
|
32
|
-
async getRedisState(t,
|
|
33
|
-
const
|
|
34
|
-
return o > 0 && this.ttl(
|
|
27
|
+
async getRedisState(t, e) {
|
|
28
|
+
const i = `${t}:${this.generateSHA(e)}`, s = await this.getEntryPoint(i), c = await this.isEncrypted(s) ? await this.decrypt(s ?? "") : JSON.parse(s), o = Number(c == null ? void 0 : c.expires_in);
|
|
29
|
+
return o > 0 && this.ttl(i, o * 60), { sha: i, data: c };
|
|
35
30
|
}
|
|
36
|
-
async deleteRedisState(t,
|
|
37
|
-
const
|
|
38
|
-
this.initClient.del(
|
|
31
|
+
async deleteRedisState(t, e) {
|
|
32
|
+
const i = `${t}:${this.generateSHA(e)}`;
|
|
33
|
+
this.initClient.del(i);
|
|
39
34
|
}
|
|
40
35
|
async setRedisState({
|
|
41
36
|
idApi: t,
|
|
42
|
-
idData:
|
|
43
|
-
body:
|
|
37
|
+
idData: e,
|
|
38
|
+
body: i,
|
|
44
39
|
expire: s,
|
|
45
40
|
encrypted: l = !1,
|
|
46
41
|
refresh: c = "REFRESH"
|
|
47
42
|
/* REFRESH */
|
|
48
43
|
}) {
|
|
49
|
-
const o = `${t}:${this.generateSHA(
|
|
44
|
+
const o = `${t}:${this.generateSHA(e)}`, h = { expires_in: c === "REFRESH" ? s : 0, ...i };
|
|
50
45
|
if (l) {
|
|
51
|
-
const
|
|
52
|
-
return this.setEntryPoint(o,
|
|
46
|
+
const y = await this.encrypt(h);
|
|
47
|
+
return this.setEntryPoint(o, y, s), o;
|
|
53
48
|
}
|
|
54
49
|
return this.setEntryPoint(o, h, s), o;
|
|
55
50
|
}
|
|
56
51
|
async statusHost() {
|
|
57
|
-
return new Promise((t,
|
|
58
|
-
this.initClient.on("error", (
|
|
59
|
-
this.killRedis(), i
|
|
52
|
+
return new Promise((t, e) => {
|
|
53
|
+
this.initClient.on("error", (i) => {
|
|
54
|
+
this.killRedis(), e(i);
|
|
60
55
|
}), this.initClient.on("connect", () => {
|
|
61
56
|
t("success");
|
|
62
57
|
});
|
|
@@ -68,23 +63,23 @@ class O extends m {
|
|
|
68
63
|
deleteKey(t) {
|
|
69
64
|
this.initClient.del(t);
|
|
70
65
|
}
|
|
71
|
-
ttl(t,
|
|
72
|
-
this.initClient.expire(t,
|
|
66
|
+
ttl(t, e) {
|
|
67
|
+
this.initClient.expire(t, e);
|
|
73
68
|
}
|
|
74
69
|
simpleGet(t) {
|
|
75
70
|
return this.ttl(t, a * 60), this.initClient.get(t);
|
|
76
71
|
}
|
|
77
|
-
simpleHGet(t,
|
|
78
|
-
return this.ttl(t, a * 60), this.initClient.hget(t,
|
|
72
|
+
simpleHGet(t, e) {
|
|
73
|
+
return this.ttl(t, a * 60), this.initClient.hget(t, e);
|
|
79
74
|
}
|
|
80
|
-
simpleHSet(t,
|
|
81
|
-
return this.initClient.hset(t,
|
|
75
|
+
simpleHSet(t, e, i) {
|
|
76
|
+
return this.initClient.hset(t, e, i);
|
|
82
77
|
}
|
|
83
78
|
simpleHGetAll(t) {
|
|
84
79
|
return this.initClient.hgetall(t);
|
|
85
80
|
}
|
|
86
81
|
}
|
|
87
82
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
N as CustomCache,
|
|
84
|
+
d as RefreshState
|
|
90
85
|
};
|