@m4l/core 1.1.1 → 2.0.1
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/contexts/AuthContext/{index.c8918b5a.js → index-cvUlEja1.js} +10 -9
- package/contexts/BaseContext/index.d.ts +0 -1
- package/contexts/DomainContext/{index.2ed56159.js → index-D24R5afH.js} +7 -5
- package/contexts/DomainContext/index.d.ts +0 -1
- package/contexts/DomainCountryContext/{index.3cdf9462.js → index-Gjy6Za6i.js} +3 -3
- package/contexts/DomainCountryContext/index.d.ts +0 -1
- package/contexts/EnvironmentContext/index.d.ts +0 -1
- package/contexts/FlagsContext/{index.5b096265.js → index-DcIX8FKd.js} +1 -1
- package/contexts/FlagsContext/index.d.ts +0 -1
- package/contexts/HostToolsContext/index.d.ts +0 -1
- package/contexts/ModuleDictionaryContext/{index.44448b0d.js → index-kBzBlTUI.js} +9 -9
- package/contexts/ModuleDictionaryContext/index.d.ts +0 -1
- package/contexts/ModulePrivilegesContext/{index.1274092a.js → index-DsoWo0kK.js} +5 -4
- package/contexts/ModulePrivilegesContext/index.d.ts +0 -1
- package/contexts/ModuleSkeletonContext/{index.9267d86a.js → index-CkhzuYKp.js} +1 -1
- package/contexts/ModuleSkeletonContext/index.d.ts +0 -1
- package/contexts/NetworkContext/{index.ec7405cd.js → index-C8wX3ESG.js} +2 -2
- package/contexts/NetworkContext/index.d.ts +0 -1
- package/hooks/useAuth/index-BmbX0ftD.js +10 -0
- package/hooks/useBase/index-gThCdRe-.js +10 -0
- package/hooks/useDomain/{index.dd6909f6.js → index-Bct5KNcv.js} +3 -4
- package/hooks/useEnvironment/index-D1xRKaoe.js +10 -0
- package/hooks/useFlagsStore/{index.f7c613ac.js → index-EagkUnqK.js} +3 -4
- package/hooks/useHostTools/index-CL3d7qFm.js +10 -0
- package/hooks/useModuleDictionary/{index.eec95f41.js → index-C1BKVxpe.js} +1 -1
- package/hooks/useModulePrivileges/{index.e93abed8.js → index-D14YH0TD.js} +1 -1
- package/hooks/useModuleSkeleton/{index.a8238d1d.js → index-CBPHGKDR.js} +1 -1
- package/hooks/useNetwork/index--IzMsMJ2.js +10 -0
- package/hooks/usePaginate/{index.1306b0de.js → index-CUbw1Kpb.js} +3 -2
- package/hooks/usePaginate/index.d.ts +0 -1
- package/hooks/usePropageteMF/{index.c440b829.js → index-DEVKsg4w.js} +1 -1
- package/index.d.ts +1 -1
- package/index.js +74 -83
- package/{node_modules.04fac7e9.js → node_modules-C59GSzS1.js} +36 -60
- package/package.json +2 -2
- package/types/index.d.ts +14 -3
- package/utils/{axiosOperation.ce4250d4.js → axiosOperation-CEky_K0E.js} +30 -29
- package/vite-env.d.ts +4 -4
- package/hooks/useAuth/index.bd0fb946.js +0 -11
- package/hooks/useBase/index.4375dcef.js +0 -11
- package/hooks/useEnvironment/index.25f83176.js +0 -11
- package/hooks/useHostTools/index.66d9a667.js +0 -11
- package/hooks/useNetwork/index.3d79002b.js +0 -11
- /package/contexts/BaseContext/{index.f9cdc955.js → index-BZehLjuv.js} +0 -0
- /package/contexts/EnvironmentContext/{index.b33784cd.js → index-CQz-FvKh.js} +0 -0
- /package/contexts/HostToolsContext/{index.499db832.js → index-DikGcxz8.js} +0 -0
- /package/hooks/useLocalStorage/{index.91bc0791.js → index-CsLmjbAr.js} +0 -0
- /package/types/{index.42c24946.js → index-TbOJOhBX.js} +0 -0
- /package/utils/{index.f9db04a8.js → index-BNOjc4WT.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createContext as T, useReducer as y, useEffect as d } from "react";
|
|
2
|
-
import { E } from "../../types/index.
|
|
2
|
+
import { E } from "../../types/index-TbOJOhBX.js";
|
|
3
3
|
import { jsx as v } from "react/jsx-runtime";
|
|
4
|
-
import { u as D } from "../../hooks/useHostTools/index.
|
|
5
|
-
import { u as N } from "../../hooks/useNetwork/index.
|
|
6
|
-
import { u as O } from "../../hooks/useEnvironment/index.
|
|
7
|
-
import { u as S } from "../../hooks/useLocalStorage/index.
|
|
8
|
-
import { g as U, s as u } from "../../utils/index.
|
|
4
|
+
import { u as D } from "../../hooks/useHostTools/index-CL3d7qFm.js";
|
|
5
|
+
import { u as N } from "../../hooks/useNetwork/index--IzMsMJ2.js";
|
|
6
|
+
import { u as O } from "../../hooks/useEnvironment/index-D1xRKaoe.js";
|
|
7
|
+
import { u as S } from "../../hooks/useLocalStorage/index-CsLmjbAr.js";
|
|
8
|
+
import { g as U, s as u } from "../../utils/index-BNOjc4WT.js";
|
|
9
9
|
var s = /* @__PURE__ */ ((t) => (t.Initial = "INITIALIZE", t.Login = "LOGIN", t.Logout = "LOGOUT", t))(s || {});
|
|
10
10
|
const w = {
|
|
11
11
|
isAuthenticated: !1,
|
|
@@ -54,8 +54,9 @@ function M(t) {
|
|
|
54
54
|
} = N(), {
|
|
55
55
|
domain_token: f
|
|
56
56
|
} = O(), [I, l] = S(
|
|
57
|
+
// Variable para saber si ha cambiado la session en otro navegador
|
|
57
58
|
"vSession",
|
|
58
|
-
new Date().getTime() + ""
|
|
59
|
+
(/* @__PURE__ */ new Date()).getTime() + ""
|
|
59
60
|
);
|
|
60
61
|
d(() => {
|
|
61
62
|
(async () => {
|
|
@@ -106,7 +107,7 @@ function M(t) {
|
|
|
106
107
|
payload: {
|
|
107
108
|
user: A
|
|
108
109
|
}
|
|
109
|
-
}), l(new Date().getTime() + "");
|
|
110
|
+
}), l((/* @__PURE__ */ new Date()).getTime() + "");
|
|
110
111
|
});
|
|
111
112
|
}, c = async (a) => {
|
|
112
113
|
a && await r({
|
|
@@ -114,7 +115,7 @@ function M(t) {
|
|
|
114
115
|
method: "POST"
|
|
115
116
|
}), n({
|
|
116
117
|
type: s.Logout
|
|
117
|
-
}), l(new Date().getTime() + "");
|
|
118
|
+
}), l((/* @__PURE__ */ new Date()).getTime() + "");
|
|
118
119
|
}, p = () => {
|
|
119
120
|
c(!1);
|
|
120
121
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createContext as u, useState as g, useEffect as d } from "react";
|
|
2
|
-
import { u as f } from "../../hooks/useFlagsStore/index.
|
|
3
|
-
import { u as p } from "../../hooks/useEnvironment/index.
|
|
4
|
-
import { u as D } from "../../hooks/useNetwork/index.
|
|
5
|
-
import { C as l } from "../../types/index.
|
|
6
|
-
import { s as v } from "../../node_modules.
|
|
2
|
+
import { u as f } from "../../hooks/useFlagsStore/index-EagkUnqK.js";
|
|
3
|
+
import { u as p } from "../../hooks/useEnvironment/index-D1xRKaoe.js";
|
|
4
|
+
import { u as D } from "../../hooks/useNetwork/index--IzMsMJ2.js";
|
|
5
|
+
import { C as l } from "../../types/index-TbOJOhBX.js";
|
|
6
|
+
import { s as v } from "../../node_modules-C59GSzS1.js";
|
|
7
7
|
import { jsx as y } from "react/jsx-runtime";
|
|
8
8
|
const $ = u(null);
|
|
9
9
|
function C(r) {
|
|
@@ -46,6 +46,8 @@ function C(r) {
|
|
|
46
46
|
}, []), /* @__PURE__ */ y($.Provider, {
|
|
47
47
|
value: {
|
|
48
48
|
..._
|
|
49
|
+
// formStatus,
|
|
50
|
+
// setFormStatus,
|
|
49
51
|
},
|
|
50
52
|
children: e
|
|
51
53
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createContext as d, useState as y, useCallback as T } from "react";
|
|
2
|
-
import { E as r } from "../../types/index.
|
|
2
|
+
import { E as r } from "../../types/index-TbOJOhBX.js";
|
|
3
3
|
import { jsx as f } from "react/jsx-runtime";
|
|
4
|
-
import { u as D } from "../../hooks/useHostTools/index.
|
|
5
|
-
import { u as M } from "../../hooks/usePropageteMF/index.
|
|
4
|
+
import { u as D } from "../../hooks/useHostTools/index-CL3d7qFm.js";
|
|
5
|
+
import { u as M } from "../../hooks/usePropageteMF/index-DEVKsg4w.js";
|
|
6
6
|
const N = d(null);
|
|
7
7
|
function A(e) {
|
|
8
8
|
const {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { DomainCountryContextType, DomainCountryProviderProps } from './types';
|
|
3
2
|
declare const DomainCountryContext: import("react").Context<DomainCountryContextType | null>;
|
|
4
3
|
declare function DomainCountryProvider(props: DomainCountryProviderProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { EnvironmentContextType, EnvironmentProviderProps } from './types';
|
|
3
2
|
declare const EnvironmentContext: import("react").Context<EnvironmentContextType | null>;
|
|
4
3
|
declare function EnvironmentProvider(props: EnvironmentProviderProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createContext as l, useRef as n } from "react";
|
|
2
2
|
import { createStore as f } from "zustand";
|
|
3
3
|
import { devtools as i } from "zustand/middleware";
|
|
4
|
-
import { i as c } from "../../node_modules.
|
|
4
|
+
import { i as c } from "../../node_modules-C59GSzS1.js";
|
|
5
5
|
import { jsx as m } from "react/jsx-runtime";
|
|
6
6
|
const g = (e) => f(
|
|
7
7
|
i(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createContext as F, useState as y, useEffect as A, useCallback as u } from "react";
|
|
2
|
-
import { C as L } from "../../types/index.
|
|
2
|
+
import { C as L } from "../../types/index-TbOJOhBX.js";
|
|
3
3
|
import { jsx as M } from "react/jsx-runtime";
|
|
4
|
-
import { u as N } from "../../hooks/useFlagsStore/index.
|
|
5
|
-
import { u as P } from "../../hooks/useEnvironment/index.
|
|
6
|
-
import { u as _ } from "../../hooks/useHostTools/index.
|
|
7
|
-
import { u as x } from "../../hooks/useNetwork/index.
|
|
4
|
+
import { u as N } from "../../hooks/useFlagsStore/index-EagkUnqK.js";
|
|
5
|
+
import { u as P } from "../../hooks/useEnvironment/index-D1xRKaoe.js";
|
|
6
|
+
import { u as _ } from "../../hooks/useHostTools/index-CL3d7qFm.js";
|
|
7
|
+
import { u as x } from "../../hooks/useNetwork/index--IzMsMJ2.js";
|
|
8
8
|
const E = F(null);
|
|
9
9
|
function S(l) {
|
|
10
10
|
const {
|
|
@@ -29,10 +29,12 @@ function S(l) {
|
|
|
29
29
|
endPoint: a ? `dictionaries/${s}` : `na/dictionaries/${s}`,
|
|
30
30
|
parms: {
|
|
31
31
|
comps: m,
|
|
32
|
+
// lang: 'en',
|
|
32
33
|
...a ? {} : {
|
|
33
34
|
domain_token: g
|
|
34
35
|
}
|
|
35
36
|
}
|
|
37
|
+
// isRemote: false
|
|
36
38
|
}).then((o) => {
|
|
37
39
|
t && (p({
|
|
38
40
|
...o
|
|
@@ -44,10 +46,8 @@ function S(l) {
|
|
|
44
46
|
};
|
|
45
47
|
}, [d]);
|
|
46
48
|
const n = u((t) => {
|
|
47
|
-
if (e === void 0)
|
|
48
|
-
|
|
49
|
-
if (t === "")
|
|
50
|
-
return "No key";
|
|
49
|
+
if (e === void 0) return "";
|
|
50
|
+
if (t === "") return "No key";
|
|
51
51
|
let o;
|
|
52
52
|
const r = t.split(".");
|
|
53
53
|
try {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ModuleDictionaryContextProps, ModuleDictionaryProviderProps } from './types';
|
|
3
2
|
declare const ModuleDictionaryContext: import("react").Context<ModuleDictionaryContextProps | null>;
|
|
4
3
|
declare function ModuleDictionaryProvider(props: ModuleDictionaryProviderProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createContext as f, useState as d, useEffect as p, useCallback as P } from "react";
|
|
2
|
-
import { C as i } from "../../types/index.
|
|
2
|
+
import { C as i } from "../../types/index-TbOJOhBX.js";
|
|
3
3
|
import { jsx as v } from "react/jsx-runtime";
|
|
4
|
-
import { u as E } from "../../hooks/useFlagsStore/index.
|
|
5
|
-
import { u as h } from "../../hooks/useHostTools/index.
|
|
6
|
-
import { u as F } from "../../hooks/useNetwork/index.
|
|
4
|
+
import { u as E } from "../../hooks/useFlagsStore/index-EagkUnqK.js";
|
|
5
|
+
import { u as h } from "../../hooks/useHostTools/index-CL3d7qFm.js";
|
|
6
|
+
import { u as F } from "../../hooks/useNetwork/index--IzMsMJ2.js";
|
|
7
7
|
const L = f(null);
|
|
8
8
|
function S(n) {
|
|
9
9
|
const {
|
|
@@ -27,6 +27,7 @@ function S(n) {
|
|
|
27
27
|
parms: {
|
|
28
28
|
privileges: r
|
|
29
29
|
}
|
|
30
|
+
// isRemote: false
|
|
30
31
|
}).then((s) => {
|
|
31
32
|
e && (l({
|
|
32
33
|
...s.data
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ModulePrivilegesContextProps, ModulePrivilegesProviderProps } from './types';
|
|
3
2
|
declare const ModulePrivilegesContext: import("react").Context<ModulePrivilegesContextProps | null>;
|
|
4
3
|
declare function ModulePrivilegesProvider(props: ModulePrivilegesProviderProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext as n } from "react";
|
|
2
2
|
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import { a as l } from "../../hooks/useFlagsStore/index.
|
|
3
|
+
import { a as l } from "../../hooks/useFlagsStore/index-EagkUnqK.js";
|
|
4
4
|
const a = n(null);
|
|
5
5
|
function m(e) {
|
|
6
6
|
const {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ModuleSkeletonContextProps, ModuleSkeletonProviderProps } from './types';
|
|
3
2
|
declare const ModuleSkeletonContext: import("react").Context<ModuleSkeletonContextProps | null>;
|
|
4
3
|
declare function ModuleSkeletonProvider(props: ModuleSkeletonProviderProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext as i, useCallback as c } from "react";
|
|
2
|
-
import { u as m } from "../../hooks/useEnvironment/index.
|
|
3
|
-
import { u } from "../../hooks/useHostTools/index.
|
|
2
|
+
import { u as m } from "../../hooks/useEnvironment/index-D1xRKaoe.js";
|
|
3
|
+
import { u } from "../../hooks/useHostTools/index-CL3d7qFm.js";
|
|
4
4
|
import { jsx as l } from "react/jsx-runtime";
|
|
5
5
|
const p = i(null);
|
|
6
6
|
function d(t) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { NetworkProviderProps } from './types';
|
|
3
2
|
declare const NetworkContext: import("react").Context<import("./types").NetworkType | null>;
|
|
4
3
|
declare function NetworkProvider(props: NetworkProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext as o } from "react";
|
|
2
|
+
import { A as e } from "../../contexts/AuthContext/index-cvUlEja1.js";
|
|
3
|
+
const n = () => {
|
|
4
|
+
const t = o(e);
|
|
5
|
+
if (!t) throw new Error("Auth context must be use inside AuthProvider");
|
|
6
|
+
return t;
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
n as u
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
|
+
import { B as o } from "../../contexts/BaseContext/index-BZehLjuv.js";
|
|
3
|
+
function r() {
|
|
4
|
+
const e = t(o);
|
|
5
|
+
if (!e) throw new Error("useBase context must be use inside BaseContext");
|
|
6
|
+
return e;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
r as u
|
|
10
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useContext as t } from "react";
|
|
2
|
-
import { D as n } from "../../contexts/DomainContext/index.
|
|
3
|
-
import { D as e } from "../../contexts/DomainCountryContext/index.
|
|
2
|
+
import { D as n } from "../../contexts/DomainContext/index-D24R5afH.js";
|
|
3
|
+
import { D as e } from "../../contexts/DomainCountryContext/index-Gjy6Za6i.js";
|
|
4
4
|
const m = () => {
|
|
5
5
|
const o = t(n);
|
|
6
|
-
if (!o)
|
|
7
|
-
throw new Error("useDomain context must be use inside DomainContext");
|
|
6
|
+
if (!o) throw new Error("useDomain context must be use inside DomainContext");
|
|
8
7
|
return o;
|
|
9
8
|
}, u = () => {
|
|
10
9
|
const o = t(e);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
|
+
import { E as e } from "../../contexts/EnvironmentContext/index-CQz-FvKh.js";
|
|
3
|
+
const s = () => {
|
|
4
|
+
const n = t(e);
|
|
5
|
+
if (!n) throw new Error("useEnvironment context must be use inside EnvironmentContext");
|
|
6
|
+
return n;
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
s as u
|
|
10
|
+
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { useContext as o } from "react";
|
|
2
|
-
import { F as i } from "../../contexts/FlagsContext/index.
|
|
2
|
+
import { F as i } from "../../contexts/FlagsContext/index-DcIX8FKd.js";
|
|
3
3
|
import { useStore as l } from "zustand";
|
|
4
|
-
import { s as a } from "../../node_modules.
|
|
4
|
+
import { s as a } from "../../node_modules-C59GSzS1.js";
|
|
5
5
|
function u(t, s) {
|
|
6
6
|
const e = o(i);
|
|
7
|
-
if (!e)
|
|
8
|
-
throw new Error("useFlagsStore context must be use inside FlagsProvider");
|
|
7
|
+
if (!e) throw new Error("useFlagsStore context must be use inside FlagsProvider");
|
|
9
8
|
return l(e, t, s);
|
|
10
9
|
}
|
|
11
10
|
function f(t, s) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
|
+
import { H as s } from "../../contexts/HostToolsContext/index-DikGcxz8.js";
|
|
3
|
+
const n = () => {
|
|
4
|
+
const o = t(s);
|
|
5
|
+
if (!o) throw new Error("useHostTools context must be use inside HostToolsContext");
|
|
6
|
+
return o;
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
n as u
|
|
10
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as n, useContext as s, useEffect as u } from "react";
|
|
2
|
-
import { M as r } from "../../contexts/ModuleSkeletonContext/index.
|
|
2
|
+
import { M as r } from "../../contexts/ModuleSkeletonContext/index-CkhzuYKp.js";
|
|
3
3
|
const S = () => {
|
|
4
4
|
const [t, o] = n(!0), e = s(r);
|
|
5
5
|
if (!e)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext as e } from "react";
|
|
2
|
+
import { N as o } from "../../contexts/NetworkContext/index-C8wX3ESG.js";
|
|
3
|
+
const s = () => {
|
|
4
|
+
const t = e(o);
|
|
5
|
+
if (!t) throw new Error("useNetwork context must be use inside NetworkContext");
|
|
6
|
+
return t;
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
s as u
|
|
10
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as s, useRef as G, useCallback as H, useEffect as p } from "react";
|
|
2
|
-
import { u as L } from "../useHostTools/index.
|
|
3
|
-
import { u as N } from "../useNetwork/index.
|
|
2
|
+
import { u as L } from "../useHostTools/index-CL3d7qFm.js";
|
|
3
|
+
import { u as N } from "../useNetwork/index--IzMsMJ2.js";
|
|
4
4
|
const a = {
|
|
5
5
|
page: 0,
|
|
6
6
|
rowsPerPage: 25,
|
|
@@ -51,6 +51,7 @@ const a = {
|
|
|
51
51
|
r && (n(e.data), t.current.page = e.pager.page, g((x) => ({
|
|
52
52
|
...x,
|
|
53
53
|
page: e.pager.page,
|
|
54
|
+
// rowsPerPage: response.pager.limit,
|
|
54
55
|
totalRecords: e.pager.total
|
|
55
56
|
})));
|
|
56
57
|
}), function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as i } from "react";
|
|
2
|
-
import { u as f } from "../useHostTools/index.
|
|
2
|
+
import { u as f } from "../useHostTools/index-CL3d7qFm.js";
|
|
3
3
|
function c(s) {
|
|
4
4
|
const { isMicroFrontEnd: e, event: t, setHandler: o } = s, { events_add_listener: r, events_remove_listener: n } = f();
|
|
5
5
|
i(() => (e && r(t, o), () => {
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './contexts';
|
|
2
2
|
export * from './hooks';
|
|
3
3
|
export { EmmitEvents as EmitEvents, CommonFlags } from './types';
|
|
4
|
-
export type { Maybe, HostToolsType, NetworkProps, EnvironmentType, AxiosOperation, EventListenerBase, EmmitEventsGuard, } from './types';
|
|
4
|
+
export type { Maybe, HostToolsType, NetworkProps, EnvironmentType, AxiosOperation, EventListenerBase, EmmitEventsGuard, ToasterFunctionProps, Toaster, } from './types';
|
|
5
5
|
export type { GetLabelType, Dictionary, ModuleDictionary, ComponentDictionary, } from './types/dictionary';
|
|
6
6
|
export * from './utils';
|
package/index.js
CHANGED
|
@@ -1,85 +1,76 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { B as
|
|
3
|
-
import { E as
|
|
4
|
-
import { H as
|
|
5
|
-
import { N as
|
|
6
|
-
import { A as
|
|
7
|
-
import { F as
|
|
8
|
-
import { D as
|
|
9
|
-
import { M as
|
|
10
|
-
import { M as
|
|
11
|
-
import { M as
|
|
12
|
-
import { D as
|
|
13
|
-
import { u as
|
|
14
|
-
import { u as
|
|
15
|
-
import { a as
|
|
16
|
-
import { u as
|
|
17
|
-
import { u as
|
|
18
|
-
import { a as
|
|
19
|
-
import { u as
|
|
20
|
-
import { u as
|
|
21
|
-
import { u as
|
|
22
|
-
import { u as
|
|
23
|
-
import { i as
|
|
24
|
-
import { u as
|
|
25
|
-
import { u as
|
|
26
|
-
import { e as
|
|
27
|
-
import { a as
|
|
28
|
-
import "react";
|
|
29
|
-
import "react/jsx-runtime";
|
|
30
|
-
import "zustand";
|
|
31
|
-
import "zustand/middleware";
|
|
32
|
-
import "./node_modules.04fac7e9.js";
|
|
33
|
-
import "axios";
|
|
34
|
-
import "qs";
|
|
35
|
-
import "camelcase-keys";
|
|
36
|
-
import "snakecase-keys";
|
|
1
|
+
import { C as r, E as a } from "./types/index-TbOJOhBX.js";
|
|
2
|
+
import { B as s, a as i } from "./contexts/BaseContext/index-BZehLjuv.js";
|
|
3
|
+
import { E as u, a as x } from "./contexts/EnvironmentContext/index-CQz-FvKh.js";
|
|
4
|
+
import { H as p, a as l } from "./contexts/HostToolsContext/index-DikGcxz8.js";
|
|
5
|
+
import { N as d, a as v } from "./contexts/NetworkContext/index-C8wX3ESG.js";
|
|
6
|
+
import { A as P, a as C } from "./contexts/AuthContext/index-cvUlEja1.js";
|
|
7
|
+
import { F as D, a as S } from "./contexts/FlagsContext/index-DcIX8FKd.js";
|
|
8
|
+
import { D as y, a as F } from "./contexts/DomainContext/index-D24R5afH.js";
|
|
9
|
+
import { M as k, a as h } from "./contexts/ModuleDictionaryContext/index-kBzBlTUI.js";
|
|
10
|
+
import { M as L, a as A } from "./contexts/ModulePrivilegesContext/index-DsoWo0kK.js";
|
|
11
|
+
import { M as N, a as w } from "./contexts/ModuleSkeletonContext/index-CkhzuYKp.js";
|
|
12
|
+
import { D as W, a as O } from "./contexts/DomainCountryContext/index-Gjy6Za6i.js";
|
|
13
|
+
import { u as j } from "./hooks/useBase/index-gThCdRe-.js";
|
|
14
|
+
import { u as z } from "./hooks/useEnvironment/index-D1xRKaoe.js";
|
|
15
|
+
import { a as I, u as J } from "./hooks/useFlagsStore/index-EagkUnqK.js";
|
|
16
|
+
import { u as Q } from "./hooks/useHostTools/index-CL3d7qFm.js";
|
|
17
|
+
import { u as U, a as V } from "./hooks/useDomain/index-Bct5KNcv.js";
|
|
18
|
+
import { a as Y, u as Z } from "./hooks/useLocalStorage/index-CsLmjbAr.js";
|
|
19
|
+
import { u as $ } from "./hooks/useModuleDictionary/index-C1BKVxpe.js";
|
|
20
|
+
import { u as eo } from "./hooks/useModulePrivileges/index-D14YH0TD.js";
|
|
21
|
+
import { u as ao } from "./hooks/useModuleSkeleton/index-CBPHGKDR.js";
|
|
22
|
+
import { u as so } from "./hooks/useNetwork/index--IzMsMJ2.js";
|
|
23
|
+
import { i as no, u as uo } from "./hooks/usePaginate/index-CUbw1Kpb.js";
|
|
24
|
+
import { u as mo } from "./hooks/usePropageteMF/index-DEVKsg4w.js";
|
|
25
|
+
import { u as lo } from "./hooks/useAuth/index-BmbX0ftD.js";
|
|
26
|
+
import { e as vo, g as go, a as Po, s as Co, v as Mo } from "./utils/index-BNOjc4WT.js";
|
|
27
|
+
import { a as So } from "./utils/axiosOperation-CEky_K0E.js";
|
|
37
28
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
29
|
+
P as AuthContext,
|
|
30
|
+
C as AuthProvider,
|
|
31
|
+
s as BaseContext,
|
|
32
|
+
i as BaseProvider,
|
|
33
|
+
r as CommonFlags,
|
|
34
|
+
y as DomainContext,
|
|
35
|
+
W as DomainCountryContext,
|
|
36
|
+
O as DomainCountryProvider,
|
|
37
|
+
F as DomainProvider,
|
|
38
|
+
a as EmitEvents,
|
|
39
|
+
u as EnvironmentContext,
|
|
40
|
+
x as EnvironmentProvider,
|
|
41
|
+
D as FlagsContext,
|
|
42
|
+
S as FlagsProvider,
|
|
43
|
+
p as HostToolsContext,
|
|
44
|
+
l as HostToolsProvider,
|
|
45
|
+
k as ModuleDictionaryContext,
|
|
46
|
+
h as ModuleDictionaryProvider,
|
|
47
|
+
L as ModulePrivilegesContext,
|
|
48
|
+
A as ModulePrivilegesProvider,
|
|
49
|
+
N as ModuleSkeletonContext,
|
|
50
|
+
w as ModuleSkeletonProvider,
|
|
51
|
+
d as NetworkContext,
|
|
52
|
+
v as NetworkProvider,
|
|
53
|
+
So as axiosOperation,
|
|
54
|
+
vo as evaluateWithContext,
|
|
55
|
+
go as getLocalStorage,
|
|
56
|
+
Po as getPropertyByString,
|
|
57
|
+
no as initialPagerState,
|
|
58
|
+
Co as setLocalStorage,
|
|
59
|
+
lo as useAuth,
|
|
60
|
+
j as useBase,
|
|
61
|
+
U as useDomain,
|
|
62
|
+
V as useDomainCountry,
|
|
63
|
+
z as useEnvironment,
|
|
64
|
+
I as useFlagsPresent,
|
|
65
|
+
J as useFlagsStore,
|
|
66
|
+
Q as useHostTools,
|
|
67
|
+
Y as useLocalStorage,
|
|
68
|
+
Z as useLocalStorageWithListener,
|
|
69
|
+
$ as useModuleDictionary,
|
|
70
|
+
eo as useModulePrivileges,
|
|
71
|
+
ao as useModuleSkeleton,
|
|
72
|
+
so as useNetwork,
|
|
73
|
+
uo as usePaginate,
|
|
74
|
+
mo as usePropageteMF,
|
|
75
|
+
Mo as voidFunction
|
|
85
76
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function s(e) {
|
|
2
|
-
for (var t = arguments.length, r = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
3
|
-
r[n - 1] = arguments[n];
|
|
2
|
+
for (var t = arguments.length, r = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++) r[n - 1] = arguments[n];
|
|
4
3
|
if (process.env.NODE_ENV !== "production") {
|
|
5
4
|
var o = ve[e], i = o ? typeof o == "function" ? o.apply(null, r) : o : "unknown error nr: " + e;
|
|
6
5
|
throw Error("[Immer] " + i);
|
|
@@ -15,11 +14,9 @@ function O(e) {
|
|
|
15
14
|
function b(e) {
|
|
16
15
|
var t;
|
|
17
16
|
return !!e && (function(r) {
|
|
18
|
-
if (!r || typeof r != "object")
|
|
19
|
-
return !1;
|
|
17
|
+
if (!r || typeof r != "object") return !1;
|
|
20
18
|
var n = Object.getPrototypeOf(r);
|
|
21
|
-
if (n === null)
|
|
22
|
-
return !0;
|
|
19
|
+
if (n === null) return !0;
|
|
23
20
|
var o = Object.hasOwnProperty.call(n, "constructor") && n.constructor;
|
|
24
21
|
return o === Object || typeof o == "function" && Function.toString.call(o) === he;
|
|
25
22
|
}(e) || Array.isArray(e) || !!e[ne] || !!(!((t = e.constructor) === null || t === void 0) && t[ne]) || V(e) || U(e));
|
|
@@ -58,8 +55,7 @@ function m(e) {
|
|
|
58
55
|
return e.o || e.t;
|
|
59
56
|
}
|
|
60
57
|
function W(e) {
|
|
61
|
-
if (Array.isArray(e))
|
|
62
|
-
return Array.prototype.slice.call(e);
|
|
58
|
+
if (Array.isArray(e)) return Array.prototype.slice.call(e);
|
|
63
59
|
var t = me(e);
|
|
64
60
|
delete t[p];
|
|
65
61
|
for (var r = q(t), n = 0; n < r.length; n++) {
|
|
@@ -108,17 +104,13 @@ function A(e, t) {
|
|
|
108
104
|
return t.h.O || v("ES5").S(t, e, n), n ? (r[p].P && (j(t), s(4)), b(e) && (e = I(t, e), t.l || _(t, e)), t.u && v("Patches").M(r[p].t, e, t.u, t.s)) : e = I(t, r, []), j(t), t.u && t.v(t.u, t.s), e !== ie ? e : void 0;
|
|
109
105
|
}
|
|
110
106
|
function I(e, t, r) {
|
|
111
|
-
if (G(t))
|
|
112
|
-
return t;
|
|
107
|
+
if (G(t)) return t;
|
|
113
108
|
var n = t[p];
|
|
114
|
-
if (!n)
|
|
115
|
-
return
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (n.
|
|
119
|
-
return t;
|
|
120
|
-
if (!n.P)
|
|
121
|
-
return _(e, n.t, !0), n.t;
|
|
109
|
+
if (!n) return S(t, function(a, c) {
|
|
110
|
+
return Z(e, n, t, a, c, r);
|
|
111
|
+
}, !0), t;
|
|
112
|
+
if (n.A !== e) return t;
|
|
113
|
+
if (!n.P) return _(e, n.t, !0), n.t;
|
|
122
114
|
if (!n.I) {
|
|
123
115
|
n.I = !0, n.A._--;
|
|
124
116
|
var o = n.i === 4 || n.i === 5 ? n.o = W(n.k) : n.o, i = o, u = !1;
|
|
@@ -131,14 +123,11 @@ function I(e, t, r) {
|
|
|
131
123
|
function Z(e, t, r, n, o, i, u) {
|
|
132
124
|
if (process.env.NODE_ENV !== "production" && o === r && s(5), O(o)) {
|
|
133
125
|
var a = I(e, o, i && t && t.i !== 3 && !F(t.R, n) ? i.concat(n) : void 0);
|
|
134
|
-
if (oe(r, n, a), !O(a))
|
|
135
|
-
return;
|
|
126
|
+
if (oe(r, n, a), !O(a)) return;
|
|
136
127
|
e.m = !1;
|
|
137
|
-
} else
|
|
138
|
-
u && r.add(o);
|
|
128
|
+
} else u && r.add(o);
|
|
139
129
|
if (b(o) && !G(o)) {
|
|
140
|
-
if (!e.h.D && e._ < 1)
|
|
141
|
-
return;
|
|
130
|
+
if (!e.h.D && e._ < 1) return;
|
|
142
131
|
I(e, o), t && t.A.l || _(e, o);
|
|
143
132
|
}
|
|
144
133
|
}
|
|
@@ -150,13 +139,11 @@ function z(e, t) {
|
|
|
150
139
|
return (r ? m(r) : e)[t];
|
|
151
140
|
}
|
|
152
141
|
function B(e, t) {
|
|
153
|
-
if (t in e)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
r = Object.getPrototypeOf(r);
|
|
159
|
-
}
|
|
142
|
+
if (t in e) for (var r = Object.getPrototypeOf(e); r; ) {
|
|
143
|
+
var n = Object.getOwnPropertyDescriptor(r, t);
|
|
144
|
+
if (n) return n;
|
|
145
|
+
r = Object.getPrototypeOf(r);
|
|
146
|
+
}
|
|
160
147
|
}
|
|
161
148
|
function T(e) {
|
|
162
149
|
e.P || (e.P = !0, e.l && T(e.l));
|
|
@@ -175,15 +162,12 @@ function C(e, t, r) {
|
|
|
175
162
|
}
|
|
176
163
|
function pe(e) {
|
|
177
164
|
return O(e) || s(22, e), function t(r) {
|
|
178
|
-
if (!b(r))
|
|
179
|
-
return r;
|
|
165
|
+
if (!b(r)) return r;
|
|
180
166
|
var n, o = r[p], i = w(r);
|
|
181
167
|
if (o) {
|
|
182
|
-
if (!o.P && (o.i < 4 || !v("ES5").K(o)))
|
|
183
|
-
return o.t;
|
|
168
|
+
if (!o.P && (o.i < 4 || !v("ES5").K(o))) return o.t;
|
|
184
169
|
o.I = !0, n = ee(r, i), o.I = !1;
|
|
185
|
-
} else
|
|
186
|
-
n = ee(r, i);
|
|
170
|
+
} else n = ee(r, i);
|
|
187
171
|
return S(n, function(u, a) {
|
|
188
172
|
o && fe(o.t, u) === a || oe(n, u, t(a));
|
|
189
173
|
}), i === 3 ? new Set(n) : n;
|
|
@@ -220,14 +204,12 @@ var te, P, X = typeof Symbol < "u" && typeof Symbol("x") == "symbol", de = typeo
|
|
|
220
204
|
t[r] = Object.getOwnPropertyDescriptor(e, r);
|
|
221
205
|
}), t;
|
|
222
206
|
}, be = {}, K = { get: function(e, t) {
|
|
223
|
-
if (t === p)
|
|
224
|
-
return e;
|
|
207
|
+
if (t === p) return e;
|
|
225
208
|
var r = m(e);
|
|
226
|
-
if (!F(r, t))
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}(e, r, t);
|
|
209
|
+
if (!F(r, t)) return function(o, i, u) {
|
|
210
|
+
var a, c = B(i, u);
|
|
211
|
+
return c ? "value" in c ? c.value : (a = c.get) === null || a === void 0 ? void 0 : a.call(o.k) : void 0;
|
|
212
|
+
}(e, r, t);
|
|
231
213
|
var n = r[t];
|
|
232
214
|
return e.I || !b(n) ? n : n === z(e.t, t) ? (R(e), e.o[t] = C(e.A.h, n, e)) : n;
|
|
233
215
|
}, has: function(e, t) {
|
|
@@ -236,14 +218,11 @@ var te, P, X = typeof Symbol < "u" && typeof Symbol("x") == "symbol", de = typeo
|
|
|
236
218
|
return Reflect.ownKeys(m(e));
|
|
237
219
|
}, set: function(e, t, r) {
|
|
238
220
|
var n = B(m(e), t);
|
|
239
|
-
if (n?.set)
|
|
240
|
-
return n.set.call(e.k, r), !0;
|
|
221
|
+
if (n?.set) return n.set.call(e.k, r), !0;
|
|
241
222
|
if (!e.P) {
|
|
242
223
|
var o = z(m(e), t), i = o?.[p];
|
|
243
|
-
if (i && i.t === r)
|
|
244
|
-
|
|
245
|
-
if (ce(r, o) && (r !== void 0 || F(e.t, t)))
|
|
246
|
-
return !0;
|
|
224
|
+
if (i && i.t === r) return e.o[t] = r, e.R[t] = !1, !0;
|
|
225
|
+
if (ce(r, o) && (r !== void 0 || F(e.t, t))) return !0;
|
|
247
226
|
R(e), T(e);
|
|
248
227
|
}
|
|
249
228
|
return e.o[t] === r && (r !== void 0 || t in e.o) || Number.isNaN(r) && Number.isNaN(e.o[t]) || (e.o[t] = r, e.R[t] = !0), !0;
|
|
@@ -279,8 +258,7 @@ var ge = function() {
|
|
|
279
258
|
return function(h) {
|
|
280
259
|
var ue = this;
|
|
281
260
|
h === void 0 && (h = a);
|
|
282
|
-
for (var x = arguments.length, J = Array(x > 1 ? x - 1 : 0), E = 1; E < x; E++)
|
|
283
|
-
J[E - 1] = arguments[E];
|
|
261
|
+
for (var x = arguments.length, J = Array(x > 1 ? x - 1 : 0), E = 1; E < x; E++) J[E - 1] = arguments[E];
|
|
284
262
|
return c.produce(h, function(ae) {
|
|
285
263
|
var L;
|
|
286
264
|
return (L = i).call.apply(L, [ue, ae].concat(J));
|
|
@@ -310,14 +288,12 @@ var ge = function() {
|
|
|
310
288
|
}
|
|
311
289
|
s(21, o);
|
|
312
290
|
}, this.produceWithPatches = function(o, i) {
|
|
313
|
-
if (typeof o == "function")
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
});
|
|
320
|
-
};
|
|
291
|
+
if (typeof o == "function") return function(f) {
|
|
292
|
+
for (var l = arguments.length, g = Array(l > 1 ? l - 1 : 0), y = 1; y < l; y++) g[y - 1] = arguments[y];
|
|
293
|
+
return n.produceWithPatches(f, function(D) {
|
|
294
|
+
return o.apply(void 0, [D].concat(g));
|
|
295
|
+
});
|
|
296
|
+
};
|
|
321
297
|
var u, a, c = n.produce(o, i, function(f, l) {
|
|
322
298
|
u = f, a = l;
|
|
323
299
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "M4L Team",
|
|
6
6
|
"private": false,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"history": "5.3.0",
|
|
13
13
|
"qs": "^6.11.0",
|
|
14
14
|
"react": "^17.0.0 || ^18.0.0",
|
|
15
|
-
"react-toastify": "
|
|
15
|
+
"react-toastify": "10.0.5"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"*"
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Id, ToastOptions } from 'react-toastify';
|
|
2
3
|
import type { BrowserHistory } from 'history';
|
|
3
4
|
import { ResponseType } from 'axios';
|
|
4
5
|
import { DomainCountry } from '../contexts';
|
|
@@ -58,7 +59,17 @@ export declare type NetworkProps = {
|
|
|
58
59
|
bodyToSnakeCase?: boolean;
|
|
59
60
|
responseToCamelCase?: boolean;
|
|
60
61
|
};
|
|
61
|
-
export
|
|
62
|
+
export interface ToasterFunctionProps {
|
|
63
|
+
title: ReactNode;
|
|
64
|
+
description?: ReactNode;
|
|
65
|
+
}
|
|
66
|
+
export declare type Toaster = {
|
|
67
|
+
(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
68
|
+
success(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
69
|
+
info(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
70
|
+
warning(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
71
|
+
error(props: ToasterFunctionProps, toastOptions?: ToastOptions): Id;
|
|
72
|
+
};
|
|
62
73
|
export declare enum EmmitEvents {
|
|
63
74
|
EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED = "netsevice_unauthorized",
|
|
64
75
|
EMMIT_EVENT_HOST_LOCALE_CHANGE = "host_locale_change",
|
|
@@ -86,7 +97,7 @@ export interface EmmitListenerGuard extends EmmitListenerBaseGuard {
|
|
|
86
97
|
export declare type EmmitEventListener = <E extends keyof EmmitListenerGuard>(event: E, handler: EmmitListenerGuard[E]) => void;
|
|
87
98
|
export declare interface HostToolsType {
|
|
88
99
|
history: BrowserHistory;
|
|
89
|
-
toast:
|
|
100
|
+
toast: Toaster;
|
|
90
101
|
startProgress: VoidFunction;
|
|
91
102
|
stopProgress: VoidFunction;
|
|
92
103
|
events_add_listener: EmmitEventListener;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import R from "axios";
|
|
2
|
+
import b from "qs";
|
|
3
|
+
import j from "camelcase-keys";
|
|
4
4
|
import v from "snakecase-keys";
|
|
5
|
-
import { E as h } from "../types/index.
|
|
5
|
+
import { E as h } from "../types/index-TbOJOhBX.js";
|
|
6
6
|
function x(e, t, a, i, o, s) {
|
|
7
7
|
const { toast: r } = a;
|
|
8
|
-
return i === "json" ? t && t.data && typeof t.data == "object" ? t.data.error && t.data.error?.code && t.data.error?.msg !== void 0 ? Promise.reject({ ...t.data.error, status: t.status }) : (t.data.
|
|
8
|
+
return i === "json" ? t && t.data && typeof t.data == "object" ? t.data.error && t.data.error?.code && t.data.error?.msg !== void 0 ? Promise.reject({ ...t.data.error, status: t.status }) : (t.data.message && o && r({ title: t.data.message }, { type: "success", autoClose: 1e4 }), s ? j(t.data, { deep: !0 }) : t.data) : Promise.reject({
|
|
9
9
|
code: 1,
|
|
10
10
|
msg: `Incorrect endpoint: ${e}`,
|
|
11
11
|
status: t.status
|
|
@@ -18,11 +18,14 @@ function T(e, t, a = !0, i = !0) {
|
|
|
18
18
|
status: 1,
|
|
19
19
|
code: 0
|
|
20
20
|
};
|
|
21
|
-
return e?.code !== void 0 && s.status !== void 0 && e.message !== void 0 && (s = { ...s, ...e }), e?.response ? e.response.data && typeof e.response.data == "object" && e.response.data.error && e.response.data.error?.code && e.response.data.error?.message !== void 0 ? s = { ...e.response.data.error, status: e.response.status } : (s.message = e.message, s.status = e.response.status, s.code = 0) : e?.request ? (s.message = `${e?.code} ${e.message}`, s.code = -1) : (s.message = `${e?.code} ${e.message}`, s.status = 0, s.code = -2),
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
return e?.code !== void 0 && s.status !== void 0 && e.message !== void 0 && (s = { ...s, ...e }), e?.response ? e.response.data && typeof e.response.data == "object" && e.response.data.error && e.response.data.error?.code && e.response.data.error?.message !== void 0 ? s = { ...e.response.data.error, status: e.response.status } : (s.message = e.message, s.status = e.response.status, s.code = 0) : e?.request ? (s.message = `${e?.code} ${e.message}`, s.code = -1) : (s.message = `${e?.code} ${e.message}`, s.status = 0, s.code = -2), a && e?.response?.status === 401 && t.events_emit(h.EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED, {}), e?.response?.data?.error?.message && (s.message = e?.response?.data?.error.message), a && (s.message.indexOf("ERR_CANCELED") > -1 ? console.log(s.message) : i && o(
|
|
22
|
+
{ title: `${s.message} - status: ${s.status} - code: ${s.code}` },
|
|
23
|
+
{
|
|
24
|
+
type: "error"
|
|
25
|
+
}
|
|
26
|
+
)), s;
|
|
24
27
|
}
|
|
25
|
-
const
|
|
28
|
+
const L = async (e, t, a) => {
|
|
26
29
|
const {
|
|
27
30
|
method: i,
|
|
28
31
|
endPoint: o,
|
|
@@ -30,45 +33,43 @@ const D = async (e, t, a) => {
|
|
|
30
33
|
timeout: r = 6e4,
|
|
31
34
|
parms: g = {},
|
|
32
35
|
data: m = {},
|
|
33
|
-
isRemote:
|
|
36
|
+
isRemote: u = !0,
|
|
34
37
|
checkUnAuthorized: l = !0,
|
|
35
38
|
headers: p,
|
|
36
39
|
onDownloadProgress: E,
|
|
37
|
-
isExternalUrl:
|
|
40
|
+
isExternalUrl: c,
|
|
38
41
|
responseType: f = "json",
|
|
39
|
-
signal:
|
|
40
|
-
toastSuccess:
|
|
41
|
-
toastError:
|
|
42
|
-
bodyToSnakeCase:
|
|
43
|
-
responseToCamelCase:
|
|
42
|
+
signal: y,
|
|
43
|
+
toastSuccess: _ = !0,
|
|
44
|
+
toastError: P = !0,
|
|
45
|
+
bodyToSnakeCase: $ = !1,
|
|
46
|
+
responseToCamelCase: C = !1
|
|
44
47
|
} = e;
|
|
45
48
|
let d;
|
|
46
|
-
return
|
|
47
|
-
baseURL:
|
|
48
|
-
withCredentials:
|
|
49
|
+
return u ? d = t.host_api_remote : d = t.host_api_local, d = d + "/" + s, e?.options?.startProgress && e?.options?.startProgress(), R({
|
|
50
|
+
baseURL: c ? void 0 : d,
|
|
51
|
+
withCredentials: u,
|
|
49
52
|
method: i,
|
|
50
|
-
url:
|
|
51
|
-
data:
|
|
53
|
+
url: c ? o : `/${o}`,
|
|
54
|
+
data: $ ? v(m, { deep: !0 }) : m,
|
|
52
55
|
params: {},
|
|
53
|
-
paramsSerializer: () =>
|
|
56
|
+
paramsSerializer: () => b.stringify(g, { encode: !0 }),
|
|
54
57
|
headers: p,
|
|
55
58
|
timeout: r,
|
|
56
59
|
onDownloadProgress: E,
|
|
57
60
|
responseType: f,
|
|
58
|
-
signal:
|
|
61
|
+
signal: y
|
|
59
62
|
}).then((n) => x(
|
|
60
63
|
o,
|
|
61
64
|
n,
|
|
62
65
|
a,
|
|
63
66
|
f,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)).catch(
|
|
67
|
-
(n) => (console.log("Reject de la promesa"), Promise.reject(T(n, a, l, _)))
|
|
68
|
-
).finally(() => {
|
|
67
|
+
_,
|
|
68
|
+
C
|
|
69
|
+
)).catch((n) => Promise.reject(T(n, a, l, P))).finally(() => {
|
|
69
70
|
e?.options?.stopProgress && e?.options?.stopProgress();
|
|
70
71
|
});
|
|
71
72
|
};
|
|
72
73
|
export {
|
|
73
|
-
|
|
74
|
+
L as a
|
|
74
75
|
};
|
package/vite-env.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
/// <reference types="vitest" />
|
|
3
|
-
/// <reference types="vitest/globals" />
|
|
4
|
-
/// <reference types="vitest/importMeta" />
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
/// <reference types="vitest" />
|
|
3
|
+
/// <reference types="vitest/globals" />
|
|
4
|
+
/// <reference types="vitest/importMeta" />
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useContext as o } from "react";
|
|
2
|
-
import { A as e } from "../../contexts/AuthContext/index.c8918b5a.js";
|
|
3
|
-
const n = () => {
|
|
4
|
-
const t = o(e);
|
|
5
|
-
if (!t)
|
|
6
|
-
throw new Error("Auth context must be use inside AuthProvider");
|
|
7
|
-
return t;
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
n as u
|
|
11
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useContext as t } from "react";
|
|
2
|
-
import { B as o } from "../../contexts/BaseContext/index.f9cdc955.js";
|
|
3
|
-
function r() {
|
|
4
|
-
const e = t(o);
|
|
5
|
-
if (!e)
|
|
6
|
-
throw new Error("useBase context must be use inside BaseContext");
|
|
7
|
-
return e;
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
r as u
|
|
11
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useContext as t } from "react";
|
|
2
|
-
import { E as e } from "../../contexts/EnvironmentContext/index.b33784cd.js";
|
|
3
|
-
const s = () => {
|
|
4
|
-
const n = t(e);
|
|
5
|
-
if (!n)
|
|
6
|
-
throw new Error("useEnvironment context must be use inside EnvironmentContext");
|
|
7
|
-
return n;
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
s as u
|
|
11
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useContext as t } from "react";
|
|
2
|
-
import { H as s } from "../../contexts/HostToolsContext/index.499db832.js";
|
|
3
|
-
const n = () => {
|
|
4
|
-
const o = t(s);
|
|
5
|
-
if (!o)
|
|
6
|
-
throw new Error("useHostTools context must be use inside HostToolsContext");
|
|
7
|
-
return o;
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
n as u
|
|
11
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useContext as e } from "react";
|
|
2
|
-
import { N as o } from "../../contexts/NetworkContext/index.ec7405cd.js";
|
|
3
|
-
const s = () => {
|
|
4
|
-
const t = e(o);
|
|
5
|
-
if (!t)
|
|
6
|
-
throw new Error("useNetwork context must be use inside NetworkContext");
|
|
7
|
-
return t;
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
s as u
|
|
11
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|