mp-front-cli 0.0.46 → 0.0.48
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/interfaces/api-response.d.ts +8 -5
- package/dist/core/interfaces/api-response.d.ts.map +1 -1
- package/dist/core/interfaces/session.d.ts +19 -0
- package/dist/core/interfaces/session.d.ts.map +1 -0
- package/dist/core/middleware/index.d.ts +4 -0
- package/dist/core/middleware/index.d.ts.map +1 -1
- package/dist/core/utils/api-request/fetch-service-be.d.ts +2 -2
- package/dist/core/utils/api-request/fetch-service-be.d.ts.map +1 -1
- package/dist/{custom-encoder-05d6a9f1.js → custom-encoder-70a77460.js} +969 -947
- package/dist/{custom-encrypter-1573699a.js → custom-encrypter-5ff8df87.js} +3744 -3920
- package/dist/{custom-header-eeb04e28.js → custom-header-525aa4f2.js} +1 -1
- package/dist/mp-front-cli-all.es.js +3 -3
- package/dist/mp-front-cli-core.es.js +42 -35
- package/dist/mp-front-cli-encoder.es.js +1 -1
- package/dist/mp-front-cli-encrypter.es.js +2 -2
- package/dist/mp-front-cli-header.es.js +3 -3
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ var J = (r, t, e) => t in r ? G(r, t, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var v = (r, t, e) => (J(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
import { switchMap as g, of as T, catchError as V } from "rxjs";
|
|
5
5
|
import { CustomLogger as q } from "./mp-front-cli-logger.es.js";
|
|
6
|
-
import { C as z } from "./custom-encrypter-
|
|
6
|
+
import { C as z } from "./custom-encrypter-5ff8df87.js";
|
|
7
7
|
var O = function(r, t) {
|
|
8
8
|
return O = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, n) {
|
|
9
9
|
e.__proto__ = n;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ApiMiddleware as c, ErrorCatalog as d, FetchServiceBE as n, FetchServiceFE as S } from "./mp-front-cli-core.es.js";
|
|
2
|
-
import { S as l } from "./custom-header-
|
|
2
|
+
import { S as l } from "./custom-header-525aa4f2.js";
|
|
3
3
|
import { LoadingHandler as f, MessageHandler as s, RxSubjectManager as v } from "./mp-front-cli-utils-rxjs.es.js";
|
|
4
4
|
import "./index-df4e0539.js";
|
|
5
5
|
import "./mp-front-cli-logger.es.js";
|
|
6
6
|
import "rxjs";
|
|
7
|
-
import "./custom-encrypter-
|
|
8
|
-
import "./custom-encoder-
|
|
7
|
+
import "./custom-encrypter-5ff8df87.js";
|
|
8
|
+
import "./custom-encoder-70a77460.js";
|
|
9
9
|
import "crypto";
|
|
10
10
|
export {
|
|
11
11
|
c as ApiMiddleware,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var ve = Object.defineProperty;
|
|
2
2
|
var we = (i, e, t) => e in i ? ve(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { C as Re, f as pe } from "./custom-header-
|
|
5
|
-
import { S as ht } from "./custom-header-
|
|
3
|
+
var $ = (i, e, t) => (we(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { C as Re, f as pe } from "./custom-header-525aa4f2.js";
|
|
5
|
+
import { S as ht } from "./custom-header-525aa4f2.js";
|
|
6
6
|
import { MessageHandler as ne, LoadingHandler as M } from "./mp-front-cli-utils-rxjs.es.js";
|
|
7
7
|
import { RxSubjectManager as dt } from "./mp-front-cli-utils-rxjs.es.js";
|
|
8
8
|
import { t as Ne } from "./index-df4e0539.js";
|
|
9
9
|
import { CustomLogger as Pe } from "./mp-front-cli-logger.es.js";
|
|
10
10
|
import { of as w, switchMap as N, forkJoin as ie, catchError as me, EMPTY as ye, filter as be } from "rxjs";
|
|
11
|
-
import { C as $e,
|
|
12
|
-
import { C as Ce } from "./custom-encoder-
|
|
11
|
+
import { C as $e, v as re } from "./custom-encrypter-5ff8df87.js";
|
|
12
|
+
import { C as Ce } from "./custom-encoder-70a77460.js";
|
|
13
13
|
import "crypto";
|
|
14
14
|
const Ee = {
|
|
15
15
|
type: "logger",
|
|
@@ -107,7 +107,7 @@ function U() {
|
|
|
107
107
|
function ae(i) {
|
|
108
108
|
return i == null ? "" : "" + i;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function ke(i, e, t) {
|
|
111
111
|
i.forEach((s) => {
|
|
112
112
|
e[s] && (t[s] = e[s]);
|
|
113
113
|
});
|
|
@@ -138,7 +138,7 @@ function oe(i, e, t) {
|
|
|
138
138
|
} = q(i, e, Object);
|
|
139
139
|
s[n] = t;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function je(i, e, t, s) {
|
|
142
142
|
const {
|
|
143
143
|
obj: n,
|
|
144
144
|
k: r
|
|
@@ -162,7 +162,7 @@ function xe(i, e, t) {
|
|
|
162
162
|
s !== "__proto__" && s !== "constructor" && (s in i ? typeof i[s] == "string" || i[s] instanceof String || typeof e[s] == "string" || e[s] instanceof String ? t && (i[s] = e[s]) : xe(i[s], e[s], t) : i[s] = e[s]);
|
|
163
163
|
return i;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function k(i) {
|
|
166
166
|
return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
167
167
|
}
|
|
168
168
|
var Ae = {
|
|
@@ -314,7 +314,7 @@ const ue = {};
|
|
|
314
314
|
class Z extends Q {
|
|
315
315
|
constructor(e) {
|
|
316
316
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
317
|
-
super(),
|
|
317
|
+
super(), ke(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = P.create("translator");
|
|
318
318
|
}
|
|
319
319
|
changeLanguage(e) {
|
|
320
320
|
e && (this.language = e);
|
|
@@ -877,7 +877,7 @@ class Je {
|
|
|
877
877
|
escapeValue: !0
|
|
878
878
|
});
|
|
879
879
|
const t = e.interpolation;
|
|
880
|
-
this.escape = t.escape !== void 0 ? t.escape : De, this.escapeValue = t.escapeValue !== void 0 ? t.escapeValue : !0, this.useRawValueToEscape = t.useRawValueToEscape !== void 0 ? t.useRawValueToEscape : !1, this.prefix = t.prefix ?
|
|
880
|
+
this.escape = t.escape !== void 0 ? t.escape : De, this.escapeValue = t.escapeValue !== void 0 ? t.escapeValue : !0, this.useRawValueToEscape = t.useRawValueToEscape !== void 0 ? t.useRawValueToEscape : !1, this.prefix = t.prefix ? k(t.prefix) : t.prefixEscaped || "{{", this.suffix = t.suffix ? k(t.suffix) : t.suffixEscaped || "}}", this.formatSeparator = t.formatSeparator ? t.formatSeparator : t.formatSeparator || ",", this.unescapePrefix = t.unescapeSuffix ? "" : t.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t.unescapeSuffix || "", this.nestingPrefix = t.nestingPrefix ? k(t.nestingPrefix) : t.nestingPrefixEscaped || k("$t("), this.nestingSuffix = t.nestingSuffix ? k(t.nestingSuffix) : t.nestingSuffixEscaped || k(")"), this.nestingOptionsSeparator = t.nestingOptionsSeparator ? t.nestingOptionsSeparator : t.nestingOptionsSeparator || ",", this.maxReplaces = t.maxReplaces ? t.maxReplaces : 1e3, this.alwaysFormat = t.alwaysFormat !== void 0 ? t.alwaysFormat : !1, this.resetRegExp();
|
|
881
881
|
}
|
|
882
882
|
reset() {
|
|
883
883
|
this.options && this.init(this.options);
|
|
@@ -1002,7 +1002,7 @@ function ze(i) {
|
|
|
1002
1002
|
formatOptions: t
|
|
1003
1003
|
};
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1005
|
+
function j(i) {
|
|
1006
1006
|
const e = {};
|
|
1007
1007
|
return function(s, n, r) {
|
|
1008
1008
|
const a = n + JSON.stringify(r);
|
|
@@ -1014,32 +1014,32 @@ class We {
|
|
|
1014
1014
|
constructor() {
|
|
1015
1015
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1016
1016
|
this.logger = P.create("formatter"), this.options = e, this.formats = {
|
|
1017
|
-
number:
|
|
1017
|
+
number: j((t, s) => {
|
|
1018
1018
|
const n = new Intl.NumberFormat(t, {
|
|
1019
1019
|
...s
|
|
1020
1020
|
});
|
|
1021
1021
|
return (r) => n.format(r);
|
|
1022
1022
|
}),
|
|
1023
|
-
currency:
|
|
1023
|
+
currency: j((t, s) => {
|
|
1024
1024
|
const n = new Intl.NumberFormat(t, {
|
|
1025
1025
|
...s,
|
|
1026
1026
|
style: "currency"
|
|
1027
1027
|
});
|
|
1028
1028
|
return (r) => n.format(r);
|
|
1029
1029
|
}),
|
|
1030
|
-
datetime:
|
|
1030
|
+
datetime: j((t, s) => {
|
|
1031
1031
|
const n = new Intl.DateTimeFormat(t, {
|
|
1032
1032
|
...s
|
|
1033
1033
|
});
|
|
1034
1034
|
return (r) => n.format(r);
|
|
1035
1035
|
}),
|
|
1036
|
-
relativetime:
|
|
1036
|
+
relativetime: j((t, s) => {
|
|
1037
1037
|
const n = new Intl.RelativeTimeFormat(t, {
|
|
1038
1038
|
...s
|
|
1039
1039
|
});
|
|
1040
1040
|
return (r) => n.format(r, s.range || "day");
|
|
1041
1041
|
}),
|
|
1042
|
-
list:
|
|
1042
|
+
list: j((t, s) => {
|
|
1043
1043
|
const n = new Intl.ListFormat(t, {
|
|
1044
1044
|
...s
|
|
1045
1045
|
});
|
|
@@ -1057,7 +1057,7 @@ class We {
|
|
|
1057
1057
|
this.formats[e.toLowerCase().trim()] = t;
|
|
1058
1058
|
}
|
|
1059
1059
|
addCached(e, t) {
|
|
1060
|
-
this.formats[e.toLowerCase().trim()] =
|
|
1060
|
+
this.formats[e.toLowerCase().trim()] = j(t);
|
|
1061
1061
|
}
|
|
1062
1062
|
format(e, t, s) {
|
|
1063
1063
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
@@ -1119,7 +1119,7 @@ class Ge extends Q {
|
|
|
1119
1119
|
t && this.emit("failedLoading", r, a, t), s && this.store.addResourceBundle(r, a, s), this.state[e] = t ? -1 : 2;
|
|
1120
1120
|
const l = {};
|
|
1121
1121
|
this.queue.forEach((o) => {
|
|
1122
|
-
|
|
1122
|
+
je(o.loaded, [r], a), Ye(o, e), t && o.errors.push(t), o.pendingCount === 0 && !o.done && (Object.keys(o.loaded).forEach((f) => {
|
|
1123
1123
|
l[f] || (l[f] = {});
|
|
1124
1124
|
const g = o.loaded[f];
|
|
1125
1125
|
g.length && g.forEach((h) => {
|
|
@@ -1575,7 +1575,7 @@ b.init({
|
|
|
1575
1575
|
},
|
|
1576
1576
|
debug: !1
|
|
1577
1577
|
});
|
|
1578
|
-
const
|
|
1578
|
+
const C = {
|
|
1579
1579
|
// EXAMPLE ERROR
|
|
1580
1580
|
"MP-001": {
|
|
1581
1581
|
code: 400,
|
|
@@ -1618,20 +1618,20 @@ class _ extends Pe {
|
|
|
1618
1618
|
var r, a;
|
|
1619
1619
|
if (e instanceof Error)
|
|
1620
1620
|
return this.logError(e.message), {
|
|
1621
|
-
|
|
1622
|
-
title: J(
|
|
1623
|
-
message: J(
|
|
1621
|
+
...C.internalError,
|
|
1622
|
+
title: J(C.internalError.title),
|
|
1623
|
+
message: J(C.internalError.message),
|
|
1624
1624
|
uuid: t
|
|
1625
1625
|
};
|
|
1626
1626
|
const s = typeof e == "string" ? e : e.code ?? e.errorType, n = typeof e == "string" ? {} : { ...e };
|
|
1627
1627
|
return {
|
|
1628
|
-
|
|
1628
|
+
...C[s] ?? C.default,
|
|
1629
1629
|
title: J(
|
|
1630
|
-
((r =
|
|
1630
|
+
((r = C[s]) == null ? void 0 : r.title) ?? C.default.title,
|
|
1631
1631
|
n
|
|
1632
1632
|
),
|
|
1633
1633
|
message: J(
|
|
1634
|
-
((a =
|
|
1634
|
+
((a = C[s]) == null ? void 0 : a.message) ?? C.default.message,
|
|
1635
1635
|
n
|
|
1636
1636
|
),
|
|
1637
1637
|
uuid: t
|
|
@@ -1641,7 +1641,14 @@ class _ extends Pe {
|
|
|
1641
1641
|
class ot extends $e {
|
|
1642
1642
|
constructor() {
|
|
1643
1643
|
super(...arguments);
|
|
1644
|
-
|
|
1644
|
+
$(this, "uuid", "");
|
|
1645
|
+
$(this, "session", null);
|
|
1646
|
+
}
|
|
1647
|
+
setSession(t) {
|
|
1648
|
+
this.session = t;
|
|
1649
|
+
}
|
|
1650
|
+
getSession() {
|
|
1651
|
+
return this.session;
|
|
1645
1652
|
}
|
|
1646
1653
|
returnData(t, s, n) {
|
|
1647
1654
|
const r = this.encode(s, n);
|
|
@@ -1668,12 +1675,12 @@ class ot extends $e {
|
|
|
1668
1675
|
})
|
|
1669
1676
|
),
|
|
1670
1677
|
N(({ params: a, response: l, headers: o }) => (this.logDebug(
|
|
1671
|
-
`ApiMiddleware \x1B[37m <URL>: \x1B[33m ${s.url} \x1B[37m <HEADERS>: \x1B[33m ${o} \x1B[37m <UUID> \x1B[33m ${s.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(a)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(l)}`
|
|
1678
|
+
`ApiMiddleware \x1B[37m <URL>: \x1B[33m ${s.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(o)} \x1B[37m <UUID> \x1B[33m ${s.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(a)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(l)}`
|
|
1672
1679
|
), w(l))),
|
|
1673
1680
|
me((a) => {
|
|
1674
1681
|
var l;
|
|
1675
1682
|
return this.logError(
|
|
1676
|
-
`ApiMiddleware <URL>: ${s == null ? void 0 : s.url} <HEADERS>: ${s == null ? void 0 : s.headers} <UUID> ${(l = s == null ? void 0 : s.body) == null ? void 0 : l.uuid} <PARAMS> ${JSON.stringify(s == null ? void 0 : s.body)} <ERROR>: ${JSON.stringify(a)}`
|
|
1683
|
+
`ApiMiddleware <URL>: ${s == null ? void 0 : s.url} <HEADERS>: ${JSON.stringify(s == null ? void 0 : s.headers)} <UUID> ${(l = s == null ? void 0 : s.body) == null ? void 0 : l.uuid} <PARAMS> ${JSON.stringify(s == null ? void 0 : s.body)} <ERROR>: ${JSON.stringify(a)}`
|
|
1677
1684
|
), this.returnError(n, a), ye;
|
|
1678
1685
|
})
|
|
1679
1686
|
).subscribe({
|
|
@@ -1687,8 +1694,8 @@ class ot extends $e {
|
|
|
1687
1694
|
class lt extends Re {
|
|
1688
1695
|
constructor(t, s) {
|
|
1689
1696
|
super();
|
|
1690
|
-
|
|
1691
|
-
|
|
1697
|
+
$(this, "apiUrl");
|
|
1698
|
+
$(this, "method");
|
|
1692
1699
|
this.apiUrl = t, this.method = s ?? "POST";
|
|
1693
1700
|
}
|
|
1694
1701
|
errorHandler(t, s) {
|
|
@@ -1724,10 +1731,10 @@ class lt extends Re {
|
|
|
1724
1731
|
class ut extends Ce {
|
|
1725
1732
|
constructor(t, s = "POST", n = {}) {
|
|
1726
1733
|
super();
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1734
|
+
$(this, "apiUrl");
|
|
1735
|
+
$(this, "method");
|
|
1736
|
+
$(this, "headers");
|
|
1737
|
+
$(this, "isLoadingEnabled", !0);
|
|
1731
1738
|
this.apiUrl = t, this.method = s, this.headers = {
|
|
1732
1739
|
"Content-Type": "application/json",
|
|
1733
1740
|
...n
|
|
@@ -1740,7 +1747,7 @@ class ut extends Ce {
|
|
|
1740
1747
|
return t.code && (ne.getInstance().setSubject(t), M.getInstance().setSubject(!1)), !t.code;
|
|
1741
1748
|
}
|
|
1742
1749
|
fetchData(t = {}) {
|
|
1743
|
-
const s = (/* @__PURE__ */ new Date()).toISOString(), n = re
|
|
1750
|
+
const s = (/* @__PURE__ */ new Date()).toISOString(), n = re(s, re.URL), r = this.encode({ ...t }, n);
|
|
1744
1751
|
M.getInstance().setSubject(this.isLoadingEnabled);
|
|
1745
1752
|
const l = new URLSearchParams(window.location.search).get("flow") || "N/A";
|
|
1746
1753
|
return pe(this.apiUrl, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as i } from "./custom-encrypter-
|
|
1
|
+
import { C as i } from "./custom-encrypter-5ff8df87.js";
|
|
2
2
|
import "crypto";
|
|
3
|
-
import "./custom-encoder-
|
|
3
|
+
import "./custom-encoder-70a77460.js";
|
|
4
4
|
import "./mp-front-cli-logger.es.js";
|
|
5
5
|
export {
|
|
6
6
|
i as CustomEncrypter
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "rxjs";
|
|
2
|
-
import { C as a } from "./custom-header-
|
|
3
|
-
import "./custom-encrypter-
|
|
2
|
+
import { C as a } from "./custom-header-525aa4f2.js";
|
|
3
|
+
import "./custom-encrypter-5ff8df87.js";
|
|
4
4
|
import "./mp-front-cli-logger.es.js";
|
|
5
|
-
import "./custom-encoder-
|
|
5
|
+
import "./custom-encoder-70a77460.js";
|
|
6
6
|
import "crypto";
|
|
7
7
|
export {
|
|
8
8
|
a as CustomHeader
|