mp-front-cli 0.0.45 → 0.0.46

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.
@@ -1,57 +1,7 @@
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 a = (n, r, t) => (s(n, typeof r != "symbol" ? r + "" : r, t), t);
4
- import E, { JWK as c, JWE as i } from "node-jose";
5
- import { createHash as y } from "crypto";
6
- import { C as p } from "./custom-validator-74fcaf87.js";
7
- import "./mp-front-cli-encoder.es.js";
1
+ import { C as i } from "./custom-encrypter-1573699a.js";
2
+ import "crypto";
3
+ import "./custom-encoder-05d6a9f1.js";
8
4
  import "./mp-front-cli-logger.es.js";
9
- import "./index-df4e0539.js";
10
- import "next-auth";
11
- class K extends p {
12
- constructor() {
13
- super(...arguments);
14
- a(this, "signatureKey");
15
- }
16
- async generateKey() {
17
- const t = process.env.SECRET_SIGNATURE;
18
- if (!t)
19
- throw new Error("Define a SECRET_SIGNATURE from `.env`");
20
- this.signatureKey = await c.asKey({
21
- kty: "oct",
22
- k: E.util.base64url.encode(t)
23
- });
24
- }
25
- async encrypt(t) {
26
- if (await this.generateKey(), !this.signatureKey)
27
- throw new Error("PLEASE CREATE A KEY TO ENCRYPT 🙂");
28
- const e = JSON.stringify(t).normalize("NFD").replace(/[\u0300-\u036f]/g, "");
29
- return await i.createEncrypt(
30
- { format: "compact" },
31
- this.signatureKey
32
- ).update(e).final();
33
- }
34
- async decrypt(t) {
35
- if (await this.generateKey(), !this.signatureKey)
36
- throw new Error("PLEASE CREATE A KEY TO DECRYPT 🙂");
37
- const { payload: e } = await i.createDecrypt(this.signatureKey).decrypt(
38
- t
39
- );
40
- return JSON.parse(e.toString());
41
- }
42
- async isEncrypted(t) {
43
- this.logInfo("EncryptionHandler", t);
44
- try {
45
- return await this.decrypt(t ?? ""), this.logInfo("EncryptionHandler", "IS ENCRYPTED 🥵"), !0;
46
- } catch (e) {
47
- return this.logError("EncryptionHandler", JSON.stringify(e)), this.logInfo("EncryptionHandler", "IS NOT ENCRYPTED 🙂"), !1;
48
- }
49
- }
50
- generateSHA(t) {
51
- const e = JSON.stringify(t);
52
- return y("sha256").update(e).digest("hex");
53
- }
54
- }
55
5
  export {
56
- K as CustomEncrypter
6
+ i as CustomEncrypter
57
7
  };
@@ -1,13 +1,9 @@
1
1
  import "rxjs";
2
- import { C as f } from "./custom-header-3ba5652e.js";
3
- import "./mp-front-cli-encrypter.es.js";
2
+ import { C as a } from "./custom-header-eeb04e28.js";
3
+ import "./custom-encrypter-1573699a.js";
4
4
  import "./mp-front-cli-logger.es.js";
5
- import "node-jose";
5
+ import "./custom-encoder-05d6a9f1.js";
6
6
  import "crypto";
7
- import "./custom-validator-74fcaf87.js";
8
- import "./mp-front-cli-encoder.es.js";
9
- import "./index-df4e0539.js";
10
- import "next-auth";
11
7
  export {
12
- f as CustomHeader
8
+ a as CustomHeader
13
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-front-cli",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -38,10 +38,6 @@
38
38
  "types": "./dist/core/utils/custom-logger.d.ts",
39
39
  "import": "./dist/mp-front-cli-logger.es.js"
40
40
  },
41
- "./core/validator": {
42
- "types": "./dist/core/utils/custom-validator.d.ts",
43
- "import": "./dist/mp-front-cli-validator.es.js"
44
- },
45
41
  "./core/encrypter": {
46
42
  "types": "./dist/core/utils/custom-encrypter.d.ts",
47
43
  "import": "./dist/mp-front-cli-encrypter.es.js"
@@ -57,7 +53,6 @@
57
53
  "i18next": "23.7.20",
58
54
  "lodash": "^4.17.21",
59
55
  "next": "14.1.0",
60
- "next-auth": "^4.24.5",
61
56
  "node-jose": "^2.2.0",
62
57
  "rxjs": "^7.8.1",
63
58
  "uuid": "^9.0.1"
@@ -1,7 +0,0 @@
1
- import type { NextApiRequest, NextApiResponse } from "next";
2
- import { CustomEncoder } from "./custom-encoder";
3
- import { type NextAuthOptions } from "next-auth";
4
- export declare class CustomValidator extends CustomEncoder {
5
- validateTokenFront(req: NextApiRequest, res: NextApiResponse, authOptions: NextAuthOptions): Promise<NextApiRequest>;
6
- }
7
- //# sourceMappingURL=custom-validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom-validator.d.ts","sourceRoot":"","sources":["../../../src/core/utils/custom-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,WAAW,CAAA;AAElE,qBAAa,eAAgB,SAAQ,aAAa;IAC1C,kBAAkB,CACtB,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,eAAe,EACpB,WAAW,EAAE,eAAe;CAU/B"}