mp-front-cli 1.0.0 → 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.
@@ -1,38 +1,35 @@
1
1
  var o = Object.defineProperty;
2
2
  var c = (r, e, t) => e in r ? o(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var a = (r, e, t) => (c(r, typeof e != "symbol" ? e + "" : e, t), t);
4
- import i from "node-jose";
3
+ var i = (r, e, t) => c(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import a from "node-jose";
5
5
  import { createHash as E } from "crypto";
6
6
  import { CustomEncoder as y } from "./mp-front-cli-encoder.es.js";
7
- import "./mp-front-cli-logger.es.js";
8
7
  const p = (r) => r.replace(/[\u00A0-\uffff]/gu, (e) => "\\u" + ("000" + e.charCodeAt(0).toString(16)).slice(-4));
9
- class l extends y {
8
+ class S extends y {
10
9
  constructor() {
11
10
  super(...arguments);
12
- a(this, "signatureKey");
11
+ i(this, "signatureKey");
13
12
  }
14
13
  async generateKey() {
15
14
  const t = process.env.SECRET_SIGNATURE;
16
15
  if (!t)
17
16
  throw new Error("Define a SECRET_SIGNATURE from `.env`");
18
- this.signatureKey = await i.JWK.asKey({
17
+ this.signatureKey = await a.JWK.asKey({
19
18
  kty: "oct",
20
- k: i.util.base64url.encode(t)
19
+ k: a.util.base64url.encode(t)
21
20
  });
22
21
  }
23
22
  async encrypt(t) {
24
- if (await this.generateKey(), !this.signatureKey)
25
- throw new Error("PLEASE CREATE A KEY TO ENCRYPT 🙂");
23
+ if (await this.generateKey(), !this.signatureKey) throw new Error("PLEASE CREATE A KEY TO ENCRYPT 🙂");
26
24
  const n = JSON.stringify(t), s = p(n);
27
- return await i.JWE.createEncrypt(
25
+ return await a.JWE.createEncrypt(
28
26
  { format: "compact" },
29
27
  this.signatureKey
30
28
  ).update(s).final();
31
29
  }
32
30
  async decrypt(t) {
33
- if (await this.generateKey(), !this.signatureKey)
34
- throw new Error("PLEASE CREATE A KEY TO DECRYPT 🙂");
35
- const { payload: n } = await i.JWE.createDecrypt(
31
+ if (await this.generateKey(), !this.signatureKey) throw new Error("PLEASE CREATE A KEY TO DECRYPT 🙂");
32
+ const { payload: n } = await a.JWE.createDecrypt(
36
33
  this.signatureKey
37
34
  ).decrypt(t);
38
35
  return JSON.parse(n.toString());
@@ -51,5 +48,5 @@ class l extends y {
51
48
  }
52
49
  }
53
50
  export {
54
- l as CustomEncrypter
51
+ S as CustomEncrypter
55
52
  };
@@ -1,17 +1,13 @@
1
- var n = Object.defineProperty;
2
- var d = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var a = (r, t, e) => (d(r, typeof t != "symbol" ? t + "" : t, e), e);
4
- import { switchMap as s, of as o } from "rxjs";
5
- import { CustomEncrypter as m } from "./mp-front-cli-encrypter.es.js";
6
- import { S as c } from "./index-a6a5a26e.js";
7
- import "node-jose";
8
- import "crypto";
9
- import "./mp-front-cli-encoder.es.js";
10
- import "./mp-front-cli-logger.es.js";
11
- class T extends m {
1
+ var p = Object.defineProperty;
2
+ var d = (r, t, e) => t in r ? p(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var n = (r, t, e) => d(r, typeof t != "symbol" ? t + "" : t, e);
4
+ import { switchMap as a, of as o } from "rxjs";
5
+ import { CustomEncrypter as c } from "./mp-front-cli-encrypter.es.js";
6
+ import { S as u } from "./service-token-D8bum6H0.js";
7
+ class f extends c {
12
8
  constructor(e = {}) {
13
9
  super();
14
- a(this, "headers");
10
+ n(this, "headers");
15
11
  this.headers = {
16
12
  Accept: "application/json",
17
13
  "Content-Type": "application/vnd.api+json",
@@ -19,18 +15,18 @@ class T extends m {
19
15
  };
20
16
  }
21
17
  addTokenBackend(e) {
22
- return this.logDebug("addTokenBackend CustomHeader", JSON.stringify(e)), new c().get().pipe(
23
- s((i) => o({ ...e, Authorization: `Bearer ${i}` }))
18
+ return this.logDebug("addTokenBackend CustomHeader", JSON.stringify(e)), new u().get().pipe(
19
+ a((i) => o({ ...e, Authorization: `Bearer ${i}` }))
24
20
  );
25
21
  }
26
22
  getHeaders(e = {}, i = !0) {
27
23
  return this.logDebug("getHeaders CustomHeader"), i ? this.addTokenBackend(e).pipe(
28
- s((p) => o({ ...p, ...this.headers }))
24
+ a((s) => o({ ...s, ...this.headers }))
29
25
  ) : o(e).pipe(
30
- s((p) => o({ ...p, ...this.headers }))
26
+ a((s) => o({ ...s, ...this.headers }))
31
27
  );
32
28
  }
33
29
  }
34
30
  export {
35
- T as CustomHeader
31
+ f as CustomHeader
36
32
  };
@@ -1,4 +1,4 @@
1
- import { t } from "./i18n-3dcfe704.js";
1
+ import { t } from "./i18n-CniHhItS.js";
2
2
  import { default as i } from "i18next";
3
3
  const e = {
4
4
  errors: {}
@@ -1,6 +1,6 @@
1
1
  var n = Object.defineProperty;
2
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);
3
+ var s = (r, o, t) => l(r, typeof o != "symbol" ? o + "" : o, 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
5
  const a = {
6
6
  error: "\x1B[31m",
@@ -1,6 +1,4 @@
1
- import { S as m } from "./index-a6a5a26e.js";
2
- import "rxjs";
3
- import "./mp-front-cli-logger.es.js";
1
+ import { S as r } from "./service-token-D8bum6H0.js";
4
2
  export {
5
- m as ServiceToken
3
+ r as ServiceToken
6
4
  };
@@ -1,46 +1,6 @@
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 {
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;
1
+ import { L as r, M as s, R as n } from "./loading-handler-Br21zGTA.js";
42
2
  export {
43
3
  r as LoadingHandler,
44
- b as MessageHandler,
45
- a as RxSubjectManager
4
+ s as MessageHandler,
5
+ n as RxSubjectManager
46
6
  };