mp-front-cli 0.0.38 → 0.0.39

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,18 +1,19 @@
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";
1
+ import { E as m } from "./custom-validator-3bb58ece.js";
2
+ import { ApiMiddleware as d, FetchServiceBE as n, FetchServiceFE as x } from "./mp-front-cli-core.es.js";
3
+ import { S as f } from "./custom-header-89182d9e.js";
4
+ import { LoadingHandler as l, MessageHandler as s, RxSubjectManager as E } from "./mp-front-cli-utils-rxjs.es.js";
5
+ import "./custom-encoder-04bc877a.js";
6
+ import "crypto";
7
+ import "./mp-front-cli-logger.es.js";
7
8
  import "./index-df4e0539.js";
8
9
  import "rxjs";
9
10
  export {
10
- c as ApiMiddleware,
11
- p as ErrorCatalog,
12
- d as FetchServiceBE,
13
- n as FetchServiceFE,
14
- g as LoadingHandler,
15
- l as MessageHandler,
16
- s as RxSubjectManager,
17
- S as ServiceToken
11
+ d as ApiMiddleware,
12
+ m as ErrorCatalog,
13
+ n as FetchServiceBE,
14
+ x as FetchServiceFE,
15
+ l as LoadingHandler,
16
+ s as MessageHandler,
17
+ E as RxSubjectManager,
18
+ f as ServiceToken
18
19
  };
@@ -1,16 +1,17 @@
1
1
  var E = Object.defineProperty;
2
2
  var B = (d, n, t) => n in d ? E(d, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[n] = t;
3
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";
4
+ import { C as S, E as l } from "./custom-validator-3bb58ece.js";
5
+ import { C as O, f } from "./custom-header-89182d9e.js";
6
+ import { S as P } from "./custom-header-89182d9e.js";
7
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";
8
+ import { RxSubjectManager as F } from "./mp-front-cli-utils-rxjs.es.js";
9
+ import { of as a, switchMap as o, catchError as p, EMPTY as b, filter as x } from "rxjs";
10
+ import { v as m } from "./custom-encoder-04bc877a.js";
12
11
  import "./index-df4e0539.js";
13
- class M extends S {
12
+ import "./mp-front-cli-logger.es.js";
13
+ import "crypto";
14
+ class w extends S {
14
15
  constructor() {
15
16
  super(...arguments);
16
17
  u(this, "uuid", "");
@@ -36,11 +37,11 @@ class M extends S {
36
37
  o(({ params: e, response: h }) => (this.logDebug(
37
38
  `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
39
  ), a(h))),
39
- b((e) => {
40
+ p((e) => {
40
41
  var h;
41
42
  return this.logError(
42
43
  `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;
44
+ ), this.returnError(r, e), b;
44
45
  })
45
46
  ).subscribe({
46
47
  next: (e) => {
@@ -50,7 +51,7 @@ class M extends S {
50
51
  };
51
52
  }
52
53
  }
53
- class w extends O {
54
+ class J extends O {
54
55
  constructor(t, i) {
55
56
  super();
56
57
  u(this, "apiUrl");
@@ -87,7 +88,7 @@ class w extends O {
87
88
  );
88
89
  }
89
90
  }
90
- class J extends S {
91
+ class I extends S {
91
92
  constructor(t, i = "POST", r = {}) {
92
93
  super();
93
94
  u(this, "apiUrl");
@@ -119,19 +120,19 @@ class J extends S {
119
120
  ), a(e))),
120
121
  x(this.errorHandler),
121
122
  o((e) => (c.getInstance().setSubject(!1), a(e))),
122
- b((e) => (c.getInstance().setSubject(!1), g.getInstance().setSubject(
123
+ p((e) => (c.getInstance().setSubject(!1), g.getInstance().setSubject(
123
124
  new l().get(e, r)
124
- ), p))
125
+ ), b))
125
126
  );
126
127
  }
127
128
  }
128
129
  export {
129
- M as ApiMiddleware,
130
+ w as ApiMiddleware,
130
131
  l as ErrorCatalog,
131
- w as FetchServiceBE,
132
- J as FetchServiceFE,
132
+ J as FetchServiceBE,
133
+ I as FetchServiceFE,
133
134
  c as LoadingHandler,
134
135
  g as MessageHandler,
135
- v as RxSubjectManager,
136
- L as ServiceToken
136
+ F as RxSubjectManager,
137
+ P as ServiceToken
137
138
  };
@@ -1,5 +1,6 @@
1
- import { C as t } from "./custom-encoder-50b5eb15.js";
2
- import "./custom-logger-a671be8b.js";
1
+ import { C as p } from "./custom-encoder-04bc877a.js";
2
+ import "crypto";
3
+ import "./mp-front-cli-logger.es.js";
3
4
  export {
4
- t as CustomEncoder
5
+ p as CustomEncoder
5
6
  };
@@ -1,9 +1,10 @@
1
- import "./custom-logger-a671be8b.js";
2
1
  import "rxjs";
3
- import { C as a } from "./custom-header-ef367c86.js";
4
- import "./custom-validator-9ec2d3d0.js";
5
- import "./custom-encoder-50b5eb15.js";
2
+ import { C as s } from "./custom-header-89182d9e.js";
3
+ import "./custom-validator-3bb58ece.js";
4
+ import "./mp-front-cli-logger.es.js";
5
+ import "./custom-encoder-04bc877a.js";
6
+ import "crypto";
6
7
  import "./index-df4e0539.js";
7
8
  export {
8
- a as CustomHeader
9
+ s as CustomHeader
9
10
  };
@@ -1,4 +1,55 @@
1
- import { C as e } from "./custom-logger-a671be8b.js";
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);
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
+ }
2
53
  export {
3
- e as CustomLogger
54
+ p as CustomLogger
4
55
  };
@@ -1,7 +1,8 @@
1
- import { C as p } from "./custom-validator-9ec2d3d0.js";
2
- import "./custom-encoder-50b5eb15.js";
3
- import "./custom-logger-a671be8b.js";
1
+ import { C as a } from "./custom-validator-3bb58ece.js";
2
+ import "./custom-encoder-04bc877a.js";
4
3
  import "./index-df4e0539.js";
4
+ import "./mp-front-cli-logger.es.js";
5
+ import "crypto";
5
6
  export {
6
- p as CustomValidator
7
+ a as CustomValidator
7
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-front-cli",
3
- "version": "0.0.38",
3
+ "version": "0.0.39",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -72,7 +72,6 @@
72
72
  "typescript": "5.3.3",
73
73
  "vite": "4.5.2",
74
74
  "vite-plugin-dts": "3.7.1",
75
- "vite-plugin-node-polyfills": "^0.21.0",
76
75
  "vite-tsconfig-paths": "4.2.2"
77
76
  }
78
- }
77
+ }