mp-front-cli 0.0.63 → 0.0.64

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.
@@ -5,11 +5,12 @@ export declare class ErrorCatalog extends CustomLogger {
5
5
  title: string;
6
6
  message: string;
7
7
  uuid: string | undefined;
8
- code?: number | undefined;
9
8
  type: "modal" | "message";
10
9
  level: "error" | "success" | "warning" | "info";
10
+ code?: number | undefined;
11
11
  payload?: {} | undefined;
12
12
  clearCookieSession?: boolean | undefined;
13
+ onOk?: (() => void) | undefined;
13
14
  };
14
15
  }
15
16
  //# sourceMappingURL=error-catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-catalog.d.ts","sourceRoot":"","sources":["../../../src/core/errors/error-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AA2CrD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,GAAG,CAAC,KAAK,GAAE,MAAM,GAAG,KAAK,GAAG,QAAoB,EAAE,IAAI,CAAC,EAAE,MAAM;;;;;;;;;;CA6BhE"}
1
+ {"version":3,"file":"error-catalog.d.ts","sourceRoot":"","sources":["../../../src/core/errors/error-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AA2CrD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,GAAG,CAAC,KAAK,GAAE,MAAM,GAAG,KAAK,GAAG,QAAoB,EAAE,IAAI,CAAC,EAAE,MAAM;;;;;;;;;;;CA6BhE"}
@@ -1,14 +1,15 @@
1
1
  type MessageType = "modal" | "message";
2
2
  type MessageLevel = "error" | "success" | "warning" | "info";
3
3
  export interface IMessage {
4
- code?: number;
5
4
  message: string;
6
5
  type: MessageType;
7
6
  level: MessageLevel;
8
7
  title: string;
8
+ code?: number;
9
9
  payload?: {};
10
10
  clearCookieSession?: boolean;
11
11
  uuid?: string;
12
+ onOk?: () => void;
12
13
  }
13
14
  export type messageManagerFn = (type: MessageType, level: MessageLevel, message: string, title: string, onOk?: () => void) => void;
14
15
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/message.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,OAAO,GAAG,SAAS,CAAA;AACtC,KAAK,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAE5D,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,EAAE,CAAA;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,gBAAgB,GAAG,CAC7B,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,IAAI,KACd,IAAI,CAAA"}
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/message.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG,OAAO,GAAG,SAAS,CAAA;AACtC,KAAK,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAE5D,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,EAAE,CAAA;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,MAAM,MAAM,gBAAgB,GAAG,CAC7B,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,IAAI,KACd,IAAI,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { Observable } from "rxjs";
2
2
  import type { NextApiRequest, NextApiResponse } from "next";
3
3
  import { CustomEncrypter } from "../utils/custom-encrypter";
4
- import { Session } from "../interfaces/session";
4
+ import type { Session } from "next-auth";
5
5
  export declare class ApiMiddleware<TRes, TData = {}> extends CustomEncrypter {
6
6
  private uuid;
7
7
  private session;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/middleware/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAuC,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAG3D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,qBAAa,aAAa,CAAC,IAAI,EAAE,KAAK,GAAG,EAAE,CAAE,SAAQ,eAAe;IAClE,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,OAAO,CAAuB;IAE/B,UAAU,CAAC,OAAO,EAAE,OAAO;IAI3B,UAAU;IAKjB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,WAAW;IAKnB,GAAG,CACD,MAAM,EAAE,CACN,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,KACpE,UAAU,CAAC,IAAI,CAAC,SAIR,cAAc,OAAO,eAAe;CA0CpD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/middleware/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAuC,MAAM,MAAM,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAG3D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAExC,qBAAa,aAAa,CAAC,IAAI,EAAE,KAAK,GAAG,EAAE,CAAE,SAAQ,eAAe;IAClE,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,OAAO,CAAuB;IAE/B,UAAU,CAAC,OAAO,EAAE,OAAO;IAI3B,UAAU;IAKjB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,WAAW;IAKnB,GAAG,CACD,MAAM,EAAE,CACN,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,KACpE,UAAU,CAAC,IAAI,CAAC,SAIR,cAAc,OAAO,eAAe;CA0CpD"}
@@ -40,6 +40,7 @@ export declare class CustomCache<T> extends CustomEncrypter {
40
40
  sha: string;
41
41
  data: T;
42
42
  }>;
43
+ deleteRedisState(idApi: string, idData: string): Promise<void>;
43
44
  setRedisState({ idApi, idData, body, expire, encrypted, refresh, }: ISetRedisStateParams<T>): Promise<string>;
44
45
  statusHost<T>(): Promise<T>;
45
46
  killRedis(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"custom-cache.d.ts","sourceRoot":"","sources":["../../../src/core/utils/custom-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAQpD,UAAU,oBAAoB,CAAC,CAAC;IAC9B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,IAAI,EAAE,CAAC,CAAA;IACP;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,WAAW,CAAC,CAAC,CAAE,SAAQ,eAAe;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IAEzC,OAAO,CAAC,WAAW;YAIL,aAAa;IAS3B,OAAO,CAAC,aAAa;IAKR,aAAa,CAAC,CAAC,EAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC;IAgBvB,aAAa,CAAC,EACzB,KAAK,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,SAAiB,EACjB,OAA+B,GAChC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAc/B,UAAU,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC;IAYjC,SAAS;IAIT,SAAS,CAAC,GAAG,EAAE,MAAM;IAIrB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAI7B,SAAS,CAAC,GAAG,EAAE,MAAM;IAKrB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAKrC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAG5D"}
1
+ {"version":3,"file":"custom-cache.d.ts","sourceRoot":"","sources":["../../../src/core/utils/custom-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAQpD,UAAU,oBAAoB,CAAC,CAAC;IAC9B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,IAAI,EAAE,CAAC,CAAA;IACP;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,WAAW,CAAC,CAAC,CAAE,SAAQ,eAAe;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IAEzC,OAAO,CAAC,WAAW;YAIL,aAAa;IAS3B,OAAO,CAAC,aAAa;IAKR,aAAa,CAAC,CAAC,EAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC;IAgBvB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAK9C,aAAa,CAAC,EACzB,KAAK,EACL,MAAM,EACN,IAAI,EACJ,MAAM,EACN,SAAiB,EACjB,OAA+B,GAChC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAc/B,UAAU,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC;IAYjC,SAAS;IAIT,SAAS,CAAC,GAAG,EAAE,MAAM;IAIrB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAI7B,SAAS,CAAC,GAAG,EAAE,MAAM;IAKrB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAKrC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAG5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"custom-logger.d.ts","sourceRoot":"","sources":["../../../src/core/utils/custom-logger.ts"],"names":[],"mappings":"AAoBA,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,UAAU,CAAS;;IAS3B,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,GAAG;IASX,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAIpC,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,UAAU,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAItC,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAIpC,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;CAGrC"}
1
+ {"version":3,"file":"custom-logger.d.ts","sourceRoot":"","sources":["../../../src/core/utils/custom-logger.ts"],"names":[],"mappings":"AAoBA,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,UAAU,CAAS;;IAQ3B,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,GAAG;IAaX,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAIpC,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,OAAO,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAInC,UAAU,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAItC,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAIpC,QAAQ,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;CAGrC"}
@@ -1,18 +1,18 @@
1
1
  var E = Object.defineProperty;
2
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);
3
+ var a = (o, s, t) => (m(o, typeof s != "symbol" ? s + "" : s, t), t);
4
4
  import { CustomEncrypter as S } from "./mp-front-cli-encrypter.es.js";
5
- import { C as u } from "./custom-redis-bee66564.js";
5
+ import { C as d } 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
+ class T extends S {
13
13
  constructor() {
14
14
  super(...arguments);
15
- p(this, "initClient", u);
15
+ a(this, "initClient", d);
16
16
  }
17
17
  getRootNode(t) {
18
18
  return this.initClient.get(t);
@@ -24,34 +24,38 @@ class H extends S {
24
24
  throw new Error("Not found entry point");
25
25
  }
26
26
  }
27
- setEntryPoint(t, i, e) {
28
- const n = typeof i == "string" ? i : JSON.stringify(i);
29
- this.initClient.set(t, n, "EX", 60 * e);
27
+ setEntryPoint(t, e, i) {
28
+ const n = typeof e == "string" ? e : JSON.stringify(e);
29
+ this.initClient.set(t, n, "EX", 60 * i);
30
30
  }
31
- async getRedisState(t, i) {
32
- const e = `${t}:${this.generateSHA(i)}`, n = await this.getEntryPoint(e), c = await this.isEncrypted(n) ? await this.decrypt(n ?? "") : JSON.parse(n), r = Number(c == null ? void 0 : c.expires_in);
33
- return r > 0 && this.ttl(e, r * 60), { sha: e, data: c };
31
+ async getRedisState(t, e) {
32
+ const i = `${t}:${this.generateSHA(e)}`, n = await this.getEntryPoint(i), c = await this.isEncrypted(n) ? await this.decrypt(n ?? "") : JSON.parse(n), r = Number(c == null ? void 0 : c.expires_in);
33
+ return r > 0 && this.ttl(i, r * 60), { sha: i, data: c };
34
+ }
35
+ async deleteRedisState(t, e) {
36
+ const i = `${t}:${this.generateSHA(e)}`;
37
+ this.initClient.del(i);
34
38
  }
35
39
  async setRedisState({
36
40
  idApi: t,
37
- idData: i,
38
- body: e,
41
+ idData: e,
42
+ body: i,
39
43
  expire: n,
40
44
  encrypted: h = !1,
41
45
  refresh: c = "REFRESH"
42
46
  /* REFRESH */
43
47
  }) {
44
- const r = `${t}:${this.generateSHA(i)}`, l = { expires_in: c === "REFRESH" ? n : 0, ...e };
48
+ const r = `${t}:${this.generateSHA(e)}`, l = { expires_in: c === "REFRESH" ? n : 0, ...i };
45
49
  if (h) {
46
- const a = await this.encrypt(l);
47
- return this.setEntryPoint(r, a, n), r;
50
+ const p = await this.encrypt(l);
51
+ return this.setEntryPoint(r, p, n), r;
48
52
  }
49
53
  return this.setEntryPoint(r, l, n), r;
50
54
  }
51
55
  async statusHost() {
52
- return new Promise((t, i) => {
53
- this.initClient.on("error", (e) => {
54
- this.killRedis(), i(e);
56
+ return new Promise((t, e) => {
57
+ this.initClient.on("error", (i) => {
58
+ this.killRedis(), e(i);
55
59
  }), this.initClient.on("connect", () => {
56
60
  t("success");
57
61
  });
@@ -63,19 +67,19 @@ class H extends S {
63
67
  deleteKey(t) {
64
68
  this.initClient.del(t);
65
69
  }
66
- ttl(t, i) {
67
- this.initClient.expire(t, i);
70
+ ttl(t, e) {
71
+ this.initClient.expire(t, e);
68
72
  }
69
73
  simpleGet(t) {
70
74
  return this.ttl(t, y * 60), this.initClient.get(t);
71
75
  }
72
- simpleHGet(t, i) {
73
- return this.ttl(t, y * 60), this.initClient.hget(t, i);
76
+ simpleHGet(t, e) {
77
+ return this.ttl(t, y * 60), this.initClient.hget(t, e);
74
78
  }
75
- simpleHSet(t, i, e) {
76
- return this.initClient.hset(t, i, e);
79
+ simpleHSet(t, e, i) {
80
+ return this.initClient.hset(t, e, i);
77
81
  }
78
82
  }
79
83
  export {
80
- H as CustomCache
84
+ T as CustomCache
81
85
  };
@@ -1,6 +1,6 @@
1
1
  var o = Object.defineProperty;
2
- var s = (n, r, t) => r in n ? o(n, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[r] = t;
3
- var i = (n, r, t) => (s(n, typeof r != "symbol" ? r + "" : r, t), t);
2
+ var s = (n, e, t) => e in n ? o(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var i = (n, e, t) => (s(n, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  import a from "node-jose";
5
5
  import { createHash as E } from "crypto";
6
6
  import { CustomEncoder as c } from "./mp-front-cli-encoder.es.js";
@@ -22,31 +22,31 @@ class f extends c {
22
22
  async encrypt(t) {
23
23
  if (await this.generateKey(), !this.signatureKey)
24
24
  throw new Error("PLEASE CREATE A KEY TO ENCRYPT 🙂");
25
- const e = JSON.stringify(t).normalize("NFD").replace(/[\u0300-\u036f]/g, "");
25
+ const r = JSON.stringify(t).normalize("NFD").replace(/[\u0300-\u036f]/g, "");
26
26
  return await a.JWE.createEncrypt(
27
27
  { format: "compact" },
28
28
  this.signatureKey
29
- ).update(e).final();
29
+ ).update(r).final();
30
30
  }
31
31
  async decrypt(t) {
32
32
  if (await this.generateKey(), !this.signatureKey)
33
33
  throw new Error("PLEASE CREATE A KEY TO DECRYPT 🙂");
34
- const { payload: e } = await a.JWE.createDecrypt(
34
+ const { payload: r } = await a.JWE.createDecrypt(
35
35
  this.signatureKey
36
36
  ).decrypt(t);
37
- return JSON.parse(e.toString());
37
+ return JSON.parse(r.toString());
38
38
  }
39
39
  async isEncrypted(t) {
40
40
  this.logInfo("EncryptionHandler", t);
41
41
  try {
42
42
  return await this.decrypt(t ?? ""), this.logInfo("EncryptionHandler", "IS ENCRYPTED 🥵"), !0;
43
- } catch (e) {
44
- return this.logError("EncryptionHandler", JSON.stringify(e)), this.logInfo("EncryptionHandler", "IS NOT ENCRYPTED 🙂"), !1;
43
+ } catch (r) {
44
+ return this.logWarn("EncryptionHandler", JSON.stringify(r)), this.logInfo("EncryptionHandler", "IS NOT ENCRYPTED 🙂"), !1;
45
45
  }
46
46
  }
47
47
  generateSHA(t) {
48
- const e = JSON.stringify(t);
49
- return E("sha256").update(e).digest("hex");
48
+ const r = JSON.stringify(t);
49
+ return E("sha256").update(r).digest("hex");
50
50
  }
51
51
  }
52
52
  export {
@@ -1,8 +1,8 @@
1
- var i = Object.defineProperty;
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);
1
+ var n = Object.defineProperty;
2
+ var l = (r, o, t) => o in r ? n(r, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[o] = t;
3
+ var s = (r, o, t) => (l(r, typeof o != "symbol" ? o + "" : o, t), t);
4
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 = {
5
+ const a = {
6
6
  error: "\x1B[31m",
7
7
  warn: "\x1B[33m",
8
8
  info: "\x1B[34m",
@@ -11,22 +11,27 @@ const l = {
11
11
  debug: "\x1B[37m",
12
12
  silly: "\x1B[37m"
13
13
  };
14
- class p {
14
+ class h {
15
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";
16
+ s(this, "appName");
17
+ s(this, "logsLevel");
18
+ s(this, "silentLogs");
19
+ this.appName = process.env.NEXT_PUBLIC_APP_LOGS_NAME, this.logsLevel = process.env.NEXT_PUBLIC_LOGS_LEVEL, this.silentLogs = process.env.NEXT_PUBLIC_SILENT_LOGS === "true";
20
20
  }
21
- consoleFormat(o, s) {
21
+ consoleFormat(o, t) {
22
22
  try {
23
- return `${l[o]} ${this.appName} [${(/* @__PURE__ */ new Date()).toISOString()}] [${o.toUpperCase()}]: ${s.toString()} \x1B[37m`;
23
+ return `${a[o]} ${this.appName} [${(/* @__PURE__ */ new Date()).toISOString()}] [${o.toUpperCase()}]: ${t.toString()} \x1B[37m`;
24
24
  } catch {
25
- return s;
25
+ return t;
26
26
  }
27
27
  }
28
- log(o, s) {
29
- o <= g[this.logsLevel] && !this.silentLogs && console.log(this.consoleFormat(g[o], s));
28
+ log(o, t) {
29
+ if (o <= g[this.logsLevel] && !this.silentLogs)
30
+ try {
31
+ console.log(this.consoleFormat(g[o], t));
32
+ } catch (i) {
33
+ console.error("Fail to parse log", i);
34
+ }
30
35
  }
31
36
  logError(...o) {
32
37
  this.log(0, o);
@@ -51,5 +56,5 @@ class p {
51
56
  }
52
57
  }
53
58
  export {
54
- p as CustomLogger
59
+ h as CustomLogger
55
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-front-cli",
3
- "version": "0.0.63",
3
+ "version": "0.0.64",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,19 +0,0 @@
1
- export interface Session {
2
- user: {
3
- name: string;
4
- email: string;
5
- image: string;
6
- burks: string;
7
- correo_electronico: string;
8
- cve_usuario: string;
9
- cve_empleado: string;
10
- estatus: string;
11
- grupo: string;
12
- id_usuario: string;
13
- nombre_usuario: string;
14
- numero_telefono: string;
15
- rol: string;
16
- centros: string[];
17
- };
18
- }
19
- //# sourceMappingURL=session.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/core/interfaces/session.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,CAAA;QACb,kBAAkB,EAAE,MAAM,CAAA;QAC1B,WAAW,EAAE,MAAM,CAAA;QACnB,YAAY,EAAE,MAAM,CAAA;QACpB,OAAO,EAAE,MAAM,CAAA;QACf,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,MAAM,CAAA;QAClB,cAAc,EAAE,MAAM,CAAA;QACtB,eAAe,EAAE,MAAM,CAAA;QACvB,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,EAAE,MAAM,EAAE,CAAA;KAClB,CAAA;CACF"}