@m4l/core 2.0.26 → 2.0.27-beta.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/AuthContext.js +52 -48
- package/contexts/AuthContext/constants.js +2 -2
- package/contexts/AuthContext/helpers.js +1 -1
- package/contexts/BaseContext/BaseContext.js +11 -11
- package/contexts/BaseContext/store.js +1 -1
- package/contexts/DomainContext/index.js +23 -23
- package/contexts/DomainCountryContext/index.js +17 -17
- package/contexts/EnvironmentContext/index.js +8 -8
- package/contexts/FlagsContext/index.js +9 -9
- package/contexts/FlagsContext/store.js +4 -4
- package/contexts/HostToolsContext/index.js +7 -7
- package/contexts/ModuleDictionaryContext/index.js +20 -20
- package/contexts/ModulePrivilegesContext/index.js +9 -9
- package/contexts/ModuleSkeletonContext/index.js +8 -8
- package/contexts/NetworkContext/index.js +10 -10
- package/hooks/useAuth/useAuth.js +5 -4
- package/hooks/useBase/useBase.js +10 -9
- package/hooks/useDomain/index.js +8 -7
- package/hooks/useDomainCountry/index.js +2 -2
- package/hooks/useEnvironment/index.js +8 -7
- package/hooks/useFlagsStore/index.js +9 -9
- package/hooks/useHostTools/index.js +3 -2
- package/hooks/useLocalStorage/index.js +4 -4
- package/hooks/useLocalStorageWithListener/index.js +2 -1
- package/hooks/useModuleDictionary/index.js +2 -2
- package/hooks/useModulePrivileges/index.js +3 -3
- package/hooks/useModuleSkeleton/index.js +3 -3
- package/hooks/useNetwork/index.js +3 -2
- package/hooks/usePaginate/index.js +19 -19
- package/hooks/usePaginate/types.js +2 -2
- package/hooks/usePropageteMF/index.js +6 -6
- package/index.js +68 -68
- package/package.json +30 -52
- package/types/index.js +2 -2
- package/utils/axiosOperation/index.js +15 -15
- package/utils/evaluateWithContext/index.js +1 -1
- package/utils/getLocalStorage/index.js +1 -1
- package/utils/getPropertyByString/index.js +4 -4
- package/utils/setLocalStorage/index.js +3 -3
- package/utils/voidFunction.js +1 -1
- package/contexts/AuthContext/AuthContext.d.ts +0 -8
- package/contexts/AuthContext/AuthContext.test.d.ts +0 -1
- package/contexts/AuthContext/constants.d.ts +0 -7
- package/contexts/AuthContext/helpers.d.ts +0 -5
- package/contexts/AuthContext/index.d.ts +0 -2
- package/contexts/AuthContext/index.js +0 -1
- package/contexts/AuthContext/types.d.ts +0 -67
- package/contexts/BaseContext/BaseContext.d.ts +0 -7
- package/contexts/BaseContext/index.d.ts +0 -2
- package/contexts/BaseContext/index.js +0 -1
- package/contexts/BaseContext/index.test.d.ts +0 -1
- package/contexts/BaseContext/store.d.ts +0 -6
- package/contexts/BaseContext/types.d.ts +0 -37
- package/contexts/DomainContext/index.d.ts +0 -7
- package/contexts/DomainContext/index.test.d.ts +0 -1
- package/contexts/DomainContext/types.d.ts +0 -11
- package/contexts/DomainCountryContext/index.d.ts +0 -7
- package/contexts/DomainCountryContext/index.test.d.ts +0 -1
- package/contexts/DomainCountryContext/types.d.ts +0 -15
- package/contexts/EnvironmentContext/index.d.ts +0 -7
- package/contexts/EnvironmentContext/index.test.d.ts +0 -1
- package/contexts/EnvironmentContext/types.d.ts +0 -14
- package/contexts/FlagsContext/index.d.ts +0 -15
- package/contexts/FlagsContext/index.test.d.ts +0 -1
- package/contexts/FlagsContext/store.d.ts +0 -14
- package/contexts/FlagsContext/types.d.ts +0 -46
- package/contexts/HostToolsContext/index.d.ts +0 -8
- package/contexts/HostToolsContext/index.test.d.ts +0 -1
- package/contexts/HostToolsContext/types.d.ts +0 -6
- package/contexts/ModuleDictionaryContext/index.d.ts +0 -7
- package/contexts/ModuleDictionaryContext/index.test.d.ts +0 -1
- package/contexts/ModuleDictionaryContext/types.d.ts +0 -16
- package/contexts/ModulePrivilegesContext/index.d.ts +0 -7
- package/contexts/ModulePrivilegesContext/index.test.d.ts +0 -1
- package/contexts/ModulePrivilegesContext/types.d.ts +0 -9
- package/contexts/ModuleSkeletonContext/index.d.ts +0 -7
- package/contexts/ModuleSkeletonContext/index.test.d.ts +0 -1
- package/contexts/ModuleSkeletonContext/types.d.ts +0 -8
- package/contexts/NetworkContext/index.d.ts +0 -7
- package/contexts/NetworkContext/index.test.d.ts +0 -1
- package/contexts/NetworkContext/types.d.ts +0 -11
- package/contexts/index.d.ts +0 -12
- package/contexts/index.js +0 -1
- package/hooks/index.d.ts +0 -17
- package/hooks/index.js +0 -1
- package/hooks/useAuth/index.d.ts +0 -1
- package/hooks/useAuth/index.js +0 -1
- package/hooks/useAuth/useAuth.d.ts +0 -5
- package/hooks/useAuth/useAuth.test.d.ts +0 -1
- package/hooks/useBase/index.d.ts +0 -1
- package/hooks/useBase/index.js +0 -1
- package/hooks/useBase/index.test.d.ts +0 -1
- package/hooks/useBase/useBase.d.ts +0 -10
- package/hooks/useDomain/index.d.ts +0 -5
- package/hooks/useDomain/index.test.d.ts +0 -1
- package/hooks/useDomainCountry/index.d.ts +0 -4
- package/hooks/useDomainCountry/index.test.d.ts +0 -1
- package/hooks/useEnvironment/index.d.ts +0 -6
- package/hooks/useEnvironment/index.test.d.ts +0 -1
- package/hooks/useFlagsStore/index.d.ts +0 -9
- package/hooks/useFlagsStore/index.test.d.ts +0 -1
- package/hooks/useHostTools/index.d.ts +0 -5
- package/hooks/useHostTools/index.test.d.ts +0 -1
- package/hooks/useLocalStorage/index.d.ts +0 -4
- package/hooks/useLocalStorage/index.test.d.ts +0 -1
- package/hooks/useLocalStorageWithListener/index.d.ts +0 -7
- package/hooks/useLocalStorageWithListener/index.test.d.ts +0 -1
- package/hooks/useModuleDictionary/index.d.ts +0 -4
- package/hooks/useModuleDictionary/index.test.d.ts +0 -1
- package/hooks/useModulePrivileges/index.d.ts +0 -4
- package/hooks/useModulePrivileges/index.test.d.ts +0 -1
- package/hooks/useModuleSkeleton/index.d.ts +0 -4
- package/hooks/useModuleSkeleton/index.test.d.ts +0 -1
- package/hooks/useNetwork/index.d.ts +0 -5
- package/hooks/useNetwork/index.test.d.ts +0 -1
- package/hooks/usePaginate/index.d.ts +0 -14
- package/hooks/usePaginate/index.test.d.ts +0 -1
- package/hooks/usePaginate/types.d.ts +0 -17
- package/hooks/usePropageteMF/index.d.ts +0 -6
- package/hooks/usePropageteMF/types.d.ts +0 -6
- package/index.d.ts +0 -6
- package/test/constants.d.ts +0 -69
- package/test/index.d.ts +0 -3
- package/test/mocks.d.ts +0 -7
- package/test/setup.d.ts +0 -0
- package/test/types.d.ts +0 -4
- package/test/utils.d.ts +0 -9
- package/types/dictionary.d.ts +0 -13
- package/types/index.d.ts +0 -117
- package/utils/axiosOperation/index.d.ts +0 -5
- package/utils/axiosOperation/index.test.d.ts +0 -1
- package/utils/axiosOperation/types.d.ts +0 -9
- package/utils/evaluateWithContext/index.d.ts +0 -7
- package/utils/getLocalStorage/index.d.ts +0 -4
- package/utils/getLocalStorage/index.test.d.ts +0 -1
- package/utils/getPropertyByString/index.d.ts +0 -7
- package/utils/getPropertyByString/index.test.d.ts +0 -1
- package/utils/index.d.ts +0 -7
- package/utils/index.js +0 -1
- package/utils/setLocalStorage/index.d.ts +0 -4
- package/utils/setLocalStorage/index.test.d.ts +0 -1
- package/utils/voidFunction.d.ts +0 -4
- package/vite-env.d.ts +0 -4
|
@@ -2,34 +2,34 @@ import R from "axios";
|
|
|
2
2
|
import b from "qs";
|
|
3
3
|
import j from "camelcase-keys";
|
|
4
4
|
import v from "snakecase-keys";
|
|
5
|
-
import {
|
|
6
|
-
function x(e,
|
|
5
|
+
import { EmmitEvents as h } from "../../types/index.js";
|
|
6
|
+
function x(e, s, a, i, o, t) {
|
|
7
7
|
const { toast: r } = a;
|
|
8
|
-
return i === "json" ?
|
|
8
|
+
return i === "json" ? s && s.data && typeof s.data == "object" ? s.data.error && s.data.error?.code && s.data.error?.msg !== void 0 ? Promise.reject({ ...s.data.error, status: s.status }) : (s.data.message && o && r({ title: s.data.message }, { type: "success", autoClose: 1e4 }), t ? j(s.data, { deep: !0 }) : s.data) : Promise.reject({
|
|
9
9
|
code: 1,
|
|
10
10
|
msg: `Incorrect endpoint: ${e}`,
|
|
11
|
-
status:
|
|
12
|
-
}) :
|
|
11
|
+
status: s.status
|
|
12
|
+
}) : s.data;
|
|
13
13
|
}
|
|
14
|
-
function T(e,
|
|
15
|
-
const { toast: o } =
|
|
16
|
-
let
|
|
14
|
+
function T(e, s, a = !0, i = !0) {
|
|
15
|
+
const { toast: o } = s;
|
|
16
|
+
let t = {
|
|
17
17
|
message: "",
|
|
18
18
|
status: 1,
|
|
19
19
|
code: 0
|
|
20
20
|
};
|
|
21
|
-
return e?.code !== void 0 &&
|
|
22
|
-
{ title: `${
|
|
21
|
+
return e?.code !== void 0 && t.status !== void 0 && e.message !== void 0 && (t = { ...t, ...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 ? t = { ...e.response.data.error, status: e.response.status } : (t.message = e.message, t.status = e.response.status, t.code = 0) : e?.request ? (t.message = `${e?.code} ${e.message}`, t.code = -1) : (t.message = `${e?.code} ${e.message}`, t.status = 0, t.code = -2), a && e?.response?.status === 401 && s.events_emit(h.EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED, {}), e?.response?.data?.error?.message && (t.message = e?.response?.data?.error.message), a && (t.message.indexOf("ERR_CANCELED") > -1 ? console.log(t.message) : i && o(
|
|
22
|
+
{ title: `${t.message} - status: ${t.status} - code: ${t.code}` },
|
|
23
23
|
{
|
|
24
24
|
type: "error"
|
|
25
25
|
}
|
|
26
|
-
)),
|
|
26
|
+
)), t;
|
|
27
27
|
}
|
|
28
|
-
const L = async (e,
|
|
28
|
+
const L = async (e, s, a) => {
|
|
29
29
|
const {
|
|
30
30
|
method: i,
|
|
31
31
|
endPoint: o,
|
|
32
|
-
database:
|
|
32
|
+
database: t = s.database,
|
|
33
33
|
timeout: r = 6e4,
|
|
34
34
|
parms: g = {},
|
|
35
35
|
data: m = {},
|
|
@@ -46,7 +46,7 @@ const L = async (e, t, a) => {
|
|
|
46
46
|
responseToCamelCase: C = !1
|
|
47
47
|
} = e;
|
|
48
48
|
let d;
|
|
49
|
-
return u ? d =
|
|
49
|
+
return u ? d = s.host_api_remote : d = s.host_api_local, d = d + "/" + t, e?.options?.startProgress && e?.options?.startProgress(), R({
|
|
50
50
|
baseURL: c ? void 0 : d,
|
|
51
51
|
withCredentials: u,
|
|
52
52
|
method: i,
|
|
@@ -74,5 +74,5 @@ const L = async (e, t, a) => {
|
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
76
|
export {
|
|
77
|
-
L as
|
|
77
|
+
L as axiosOperation
|
|
78
78
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
function
|
|
2
|
-
const
|
|
1
|
+
function g(y, a, n) {
|
|
2
|
+
const f = a.split(".");
|
|
3
3
|
let r = y;
|
|
4
|
-
for (const s of
|
|
4
|
+
for (const s of f) {
|
|
5
5
|
const c = s.match(/^(\w+)\[(\w+)\]$/);
|
|
6
6
|
if (c) {
|
|
7
7
|
const i = c[1], o = c[2];
|
|
@@ -21,5 +21,5 @@ function f(y, a, n) {
|
|
|
21
21
|
return r;
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
g as getPropertyByString
|
|
25
25
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a(e, o, r = !1) {
|
|
2
2
|
try {
|
|
3
3
|
let t = null;
|
|
4
4
|
if (typeof o == "string") {
|
|
5
5
|
window.localStorage.setItem(e, o);
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
r && (t = window.localStorage.getItem(e));
|
|
9
9
|
let l = t !== null ? JSON.parse(t) : {};
|
|
10
10
|
l = { ...l, ...o }, window.localStorage.setItem(e, JSON.stringify(l));
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
a as setLocalStorage
|
|
16
16
|
};
|
package/utils/voidFunction.js
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { AuthProviderProps, SessionContextType } from './types';
|
|
3
|
-
declare const AuthContext: React.Context<SessionContextType | null>;
|
|
4
|
-
/**
|
|
5
|
-
* Proveedor de autenticación
|
|
6
|
-
*/
|
|
7
|
-
declare function AuthProvider(props: AuthProviderProps): React.JSX.Element;
|
|
8
|
-
export { AuthContext, AuthProvider };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { DomainCountry } from '../DomainCountryContext/types';
|
|
3
|
-
import { Maybe } from '../../types';
|
|
4
|
-
import { EnumTypes } from './constants';
|
|
5
|
-
export interface UserAuth {
|
|
6
|
-
email: string;
|
|
7
|
-
id: number;
|
|
8
|
-
firstName: string;
|
|
9
|
-
lastName: string;
|
|
10
|
-
accountId: number;
|
|
11
|
-
domainCountry: DomainCountry;
|
|
12
|
-
avatarUrl?: Maybe<string>;
|
|
13
|
-
userTypeId?: number;
|
|
14
|
-
preferences?: {
|
|
15
|
-
deviceLabel?: string;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* sessionId: id de la sesión del usuario, puede o no retornala el backend en gclick (si)
|
|
19
|
-
*/
|
|
20
|
-
sessionId?: string;
|
|
21
|
-
}
|
|
22
|
-
export type AuthUserType = Maybe<UserAuth>;
|
|
23
|
-
export type AuthProviderProps = {
|
|
24
|
-
/**
|
|
25
|
-
* isMicroFrontEnd: indica si la aplicación es un microfrontend
|
|
26
|
-
* default: false
|
|
27
|
-
*/
|
|
28
|
-
isMicroFrontEnd?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* loggedUser: usuario de la aplicación, solo aplica para Microfrontends, porque se pasa la información del usuario directamente desde el host
|
|
31
|
-
*/
|
|
32
|
-
loggedUser?: AuthUserType;
|
|
33
|
-
/**
|
|
34
|
-
* children: hijos del componente
|
|
35
|
-
*/
|
|
36
|
-
children: ReactNode;
|
|
37
|
-
};
|
|
38
|
-
export type ActionMap<M extends {
|
|
39
|
-
[index: string]: any;
|
|
40
|
-
}> = {
|
|
41
|
-
[Key in keyof M]: M[Key] extends undefined ? {
|
|
42
|
-
type: Key;
|
|
43
|
-
} : {
|
|
44
|
-
type: Key;
|
|
45
|
-
payload: M[Key];
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export type SessionAuthPayload = {
|
|
49
|
-
[EnumTypes.Initial]: {
|
|
50
|
-
isAuthenticated: boolean;
|
|
51
|
-
user: AuthUserType;
|
|
52
|
-
};
|
|
53
|
-
[EnumTypes.Login]: {
|
|
54
|
-
user: AuthUserType;
|
|
55
|
-
};
|
|
56
|
-
[EnumTypes.Logout]: undefined;
|
|
57
|
-
};
|
|
58
|
-
export type SessionActions = ActionMap<SessionAuthPayload>[keyof ActionMap<SessionAuthPayload>];
|
|
59
|
-
export type AuthState = {
|
|
60
|
-
isAuthenticated: boolean;
|
|
61
|
-
isInitialized: boolean;
|
|
62
|
-
user: Maybe<UserAuth>;
|
|
63
|
-
};
|
|
64
|
-
export interface SessionContextType extends AuthState {
|
|
65
|
-
login: (email: string, password: string, remember: boolean) => object | undefined;
|
|
66
|
-
logout: (isAuthenticated: boolean) => Promise<void>;
|
|
67
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseProviderProps } from './types';
|
|
2
|
-
declare const BaseContext: import('react').Context<import('zustand').StoreApi<import('./types').BaseProviderStoreStateWithActions<Record<any, any>>> | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Proveedor base para los contextos.
|
|
5
|
-
*/
|
|
6
|
-
declare function BaseProvider<T extends Record<any, any>>(props: BaseProviderProps<T>): import("react").JSX.Element;
|
|
7
|
-
export { BaseProvider, BaseContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BaseProviderStoreStateWithActions, InitialBaseProviderStoreProps, KeyOFHash } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* TODO: Documentar
|
|
4
|
-
*/
|
|
5
|
-
export declare function createBaseProviderStore<T extends Record<KeyOFHash, any>>(initProps: InitialBaseProviderStoreProps<T>, storeDevtoolsEnabled?: boolean): import('zustand').StoreApi<BaseProviderStoreStateWithActions<T>>;
|
|
6
|
-
export type BaseProviderStoreReturnType<T extends Record<any, any>> = ReturnType<typeof createBaseProviderStore<T>>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type KeyOFHash = string | number;
|
|
3
|
-
/**
|
|
4
|
-
* Store del tiempo real, actualizado por sockets
|
|
5
|
-
*/
|
|
6
|
-
export interface BaseProviderStoreState<T extends Record<KeyOFHash, any>> {
|
|
7
|
-
/**
|
|
8
|
-
* Id del store
|
|
9
|
-
*/
|
|
10
|
-
storeId: string;
|
|
11
|
-
/**
|
|
12
|
-
* Lugar donde se almancena los datos del prveedor
|
|
13
|
-
*/
|
|
14
|
-
value: T;
|
|
15
|
-
}
|
|
16
|
-
export interface BaseProviderStoreStateWithActions<T extends Record<KeyOFHash, any>> extends BaseProviderStoreState<T> {
|
|
17
|
-
actions: {
|
|
18
|
-
/**
|
|
19
|
-
* Modifica parcialmente el custom data.
|
|
20
|
-
*/
|
|
21
|
-
setPartialValue: (customData: Partial<T>) => void;
|
|
22
|
-
/**
|
|
23
|
-
* Modifica parcialmente el custom data.
|
|
24
|
-
*/
|
|
25
|
-
mergeValue: (customData: Partial<T>) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Modifica una propidadparcialmente el custom data.
|
|
28
|
-
*/
|
|
29
|
-
setKeyValue: (key: KeyOFHash, value: T[KeyOFHash]) => void;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export type InitialBaseProviderStoreProps<T extends Record<KeyOFHash, any>> = BaseProviderStoreState<T>;
|
|
33
|
-
export interface BaseProviderProps<T extends Record<KeyOFHash, any>> extends Omit<InitialBaseProviderStoreProps<T>, 'storeId'> {
|
|
34
|
-
storeId?: string;
|
|
35
|
-
storeDevtoolsEnabled?: boolean;
|
|
36
|
-
children: ReactNode;
|
|
37
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DomainProviderProps, Domain } from './types';
|
|
2
|
-
declare const DomainContext: import('react').Context<Domain | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Proveedor del contexto de dominio.
|
|
5
|
-
*/
|
|
6
|
-
declare function DomainProvider(props: DomainProviderProps): import("react").JSX.Element;
|
|
7
|
-
export { DomainProvider, DomainContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface Domain {
|
|
3
|
-
name: string;
|
|
4
|
-
company_logo_small_url: string;
|
|
5
|
-
company_logo_normal_url: string;
|
|
6
|
-
slogan: string;
|
|
7
|
-
}
|
|
8
|
-
export interface DomainProviderProps {
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export type DomainContextProps = Domain;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { DomainCountryContextType, DomainCountryProviderProps } from './types';
|
|
2
|
-
declare const DomainCountryContext: import('react').Context<DomainCountryContextType | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Proveedor del contexto de país de dominio.
|
|
5
|
-
*/
|
|
6
|
-
declare function DomainCountryProvider(props: DomainCountryProviderProps): import("react").JSX.Element;
|
|
7
|
-
export { DomainCountryProvider, DomainCountryContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const mock_useEffect: import('vitest').Mock<(...args: any[]) => any>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface DomainCountry {
|
|
3
|
-
id: number;
|
|
4
|
-
currency: string;
|
|
5
|
-
currency_decimal_digits: number;
|
|
6
|
-
decimal_symbol: string;
|
|
7
|
-
thousands_symbol: string;
|
|
8
|
-
}
|
|
9
|
-
export interface DomainCountryProviderProps extends DomainCountry {
|
|
10
|
-
isMicroFrontEnd: boolean;
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
}
|
|
13
|
-
export interface DomainCountryContextType extends DomainCountry {
|
|
14
|
-
changeDomainCountry: (newDomainCountry: DomainCountry) => void;
|
|
15
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { EnvironmentContextType, EnvironmentProviderProps } from './types';
|
|
2
|
-
declare const EnvironmentContext: import('react').Context<EnvironmentContextType | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Proveedor del contexto de entorno.
|
|
5
|
-
*/
|
|
6
|
-
declare function EnvironmentProvider(props: EnvironmentProviderProps): import("react").JSX.Element;
|
|
7
|
-
export { EnvironmentProvider, EnvironmentContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { EnvironmentType } from '../../types';
|
|
3
|
-
export interface EnvironmentProviderProps extends Omit<EnvironmentType, 'getMfUrlIconAsset'> {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export type EnvironmentContextType = EnvironmentType & {
|
|
7
|
-
/**
|
|
8
|
-
* "getModuleUrlIconAsset" función encargada de obtener la url de un recurso de un microfrontend
|
|
9
|
-
* basado
|
|
10
|
-
* @param iconName
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
getModuleUrlIconAsset: (iconName: string) => string;
|
|
14
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { FlagsProviderProps } from './types';
|
|
2
|
-
declare const FlagsContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./types').FlagsStateWithActions>, "setState"> & {
|
|
3
|
-
setState<A extends string | {
|
|
4
|
-
type: unknown;
|
|
5
|
-
}>(partial: import('./types').FlagsStateWithActions | Partial<import('./types').FlagsStateWithActions> | ((state: import('./types').FlagsStateWithActions) => import('./types').FlagsStateWithActions | Partial<import('./types').FlagsStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
6
|
-
}, "setState"> & {
|
|
7
|
-
setState(nextStateOrUpdater: import('./types').FlagsStateWithActions | Partial<import('./types').FlagsStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<import('./types').FlagsStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
8
|
-
type: unknown;
|
|
9
|
-
} | undefined): void;
|
|
10
|
-
}) | null>;
|
|
11
|
-
/**
|
|
12
|
-
* Proveedor del contexto de banderas.
|
|
13
|
-
*/
|
|
14
|
-
declare function FlagsProvider({ children, storeId, storeDevtoolsEnabled }: FlagsProviderProps): import("react").JSX.Element;
|
|
15
|
-
export { FlagsProvider, FlagsContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FlagsStateWithActions, FlagsStoreState } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Crea el store de banderas.
|
|
4
|
-
*/
|
|
5
|
-
export declare const createFlagsStore: (initialState: FlagsStoreState, storeDevtoolsEnabled?: boolean) => Omit<Omit<import('zustand').StoreApi<FlagsStateWithActions>, "setState"> & {
|
|
6
|
-
setState<A extends string | {
|
|
7
|
-
type: unknown;
|
|
8
|
-
}>(partial: FlagsStateWithActions | Partial<FlagsStateWithActions> | ((state: FlagsStateWithActions) => FlagsStateWithActions | Partial<FlagsStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
9
|
-
}, "setState"> & {
|
|
10
|
-
setState(nextStateOrUpdater: FlagsStateWithActions | Partial<FlagsStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<FlagsStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
11
|
-
type: unknown;
|
|
12
|
-
} | undefined): void;
|
|
13
|
-
};
|
|
14
|
-
export type FlagsStore = ReturnType<typeof createFlagsStore>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface FlagsProviderProps {
|
|
3
|
-
/**
|
|
4
|
-
* "storeId" Id del store
|
|
5
|
-
*/
|
|
6
|
-
storeId?: string;
|
|
7
|
-
/**
|
|
8
|
-
* "storeDevtoolsEnabled" Determina si se debe usar devtools para el store
|
|
9
|
-
*/
|
|
10
|
-
storeDevtoolsEnabled?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* "children" Componentes hijos
|
|
13
|
-
*/
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
export type Flag = string;
|
|
17
|
-
export interface FlagsContextProps {
|
|
18
|
-
/**
|
|
19
|
-
* "flags" Banderas
|
|
20
|
-
*/
|
|
21
|
-
flags: Array<Flag>;
|
|
22
|
-
/**
|
|
23
|
-
* "clearFlags" Limpia las banderas
|
|
24
|
-
*/
|
|
25
|
-
clearFlags: () => void;
|
|
26
|
-
/**
|
|
27
|
-
* "addFlag" Agrega una bandera
|
|
28
|
-
*/
|
|
29
|
-
addFlag: (flag: Flag) => void;
|
|
30
|
-
}
|
|
31
|
-
export interface FlagsStoreState {
|
|
32
|
-
/**
|
|
33
|
-
* "storeId" Id del store
|
|
34
|
-
*/
|
|
35
|
-
storeId?: string;
|
|
36
|
-
/**
|
|
37
|
-
* "flags" Banderas
|
|
38
|
-
*/
|
|
39
|
-
flags: Array<Flag>;
|
|
40
|
-
}
|
|
41
|
-
export interface FlagsStateWithActions extends FlagsStoreState {
|
|
42
|
-
flagsActions: {
|
|
43
|
-
clearFlags: () => void;
|
|
44
|
-
addFlag: (flag: Flag) => void;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { HostToolsType } from '../../types';
|
|
2
|
-
import { HostToolsProviderProps } from './types';
|
|
3
|
-
declare const HostToolsContext: import('react').Context<HostToolsType | null>;
|
|
4
|
-
/**
|
|
5
|
-
* Proveedor de contexto de herramientas del host
|
|
6
|
-
*/
|
|
7
|
-
declare function HostToolsProvider(props: HostToolsProviderProps): import("react").JSX.Element;
|
|
8
|
-
export { HostToolsProvider, HostToolsContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ModuleDictionaryContextProps, ModuleDictionaryProviderProps } from './types';
|
|
2
|
-
declare const ModuleDictionaryContext: import('react').Context<ModuleDictionaryContextProps | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Proveedor de contexto de diccionario de módulo
|
|
5
|
-
*/
|
|
6
|
-
declare function ModuleDictionaryProvider(props: ModuleDictionaryProviderProps): import("react").JSX.Element;
|
|
7
|
-
export { ModuleDictionaryProvider, ModuleDictionaryContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { GetLabelType, ModuleDictionary } from '../../types/dictionary';
|
|
3
|
-
export interface ModuleDictionaryProviderProps {
|
|
4
|
-
currentLang?: string;
|
|
5
|
-
isAuth?: boolean;
|
|
6
|
-
moduleId: string;
|
|
7
|
-
moduleNameField?: string;
|
|
8
|
-
componentsDictionary: string[];
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
moduleDictionaryLoaded?: ModuleDictionary;
|
|
11
|
-
}
|
|
12
|
-
export interface ModuleDictionaryContextProps {
|
|
13
|
-
moduleDictionary?: ModuleDictionary;
|
|
14
|
-
getLabel: GetLabelType;
|
|
15
|
-
getModuleLabel: () => string;
|
|
16
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ModulePrivilegesContextProps, ModulePrivilegesProviderProps } from './types';
|
|
2
|
-
declare const ModulePrivilegesContext: import('react').Context<ModulePrivilegesContextProps | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Proveedor de contexto de privilegios
|
|
5
|
-
*/
|
|
6
|
-
declare function ModulePrivilegesProvider(props: ModulePrivilegesProviderProps): import("react").JSX.Element;
|
|
7
|
-
export { ModulePrivilegesProvider, ModulePrivilegesContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export interface ModulePrivilegesProviderProps {
|
|
3
|
-
queryPrivileges: string[];
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export interface ModulePrivilegesContextProps {
|
|
7
|
-
privileges: Record<string, boolean>;
|
|
8
|
-
hasPrivilege: (id: string | string[]) => boolean;
|
|
9
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ModuleSkeletonContextProps, ModuleSkeletonProviderProps } from './types';
|
|
2
|
-
declare const ModuleSkeletonContext: import('react').Context<ModuleSkeletonContextProps | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Proveedor de contexto de esqueleto de módulo
|
|
5
|
-
*/
|
|
6
|
-
declare function ModuleSkeletonProvider(props: ModuleSkeletonProviderProps): import("react").JSX.Element;
|
|
7
|
-
export { ModuleSkeletonProvider, ModuleSkeletonContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const mockUseFlagsPresent: jest.Mock;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { NetworkProviderProps } from './types';
|
|
2
|
-
declare const NetworkContext: import('react').Context<import('./types').NetworkType | null>;
|
|
3
|
-
/**
|
|
4
|
-
* Proveedor de contexto de red
|
|
5
|
-
*/
|
|
6
|
-
declare function NetworkProvider(props: NetworkProviderProps): import("react").JSX.Element;
|
|
7
|
-
export { NetworkProvider, NetworkContext };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { AxiosOperation, NetworkProps } from '../../types';
|
|
3
|
-
export type EventFunListener = (...args: any[]) => void;
|
|
4
|
-
export interface NetworkType {
|
|
5
|
-
networkOperation: <T = any>(props: NetworkProps) => Promise<T>;
|
|
6
|
-
}
|
|
7
|
-
export interface NetworkProviderProps {
|
|
8
|
-
axiosOperation: AxiosOperation;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export type NetworkContextType = NetworkType;
|
package/contexts/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './BaseContext';
|
|
2
|
-
export { EnvironmentContext, EnvironmentProvider } from './EnvironmentContext';
|
|
3
|
-
export { HostToolsContext, HostToolsProvider } from './HostToolsContext';
|
|
4
|
-
export { NetworkContext, NetworkProvider } from './NetworkContext';
|
|
5
|
-
export * from './AuthContext';
|
|
6
|
-
export { FlagsContext, FlagsProvider } from './FlagsContext';
|
|
7
|
-
export { DomainContext, DomainProvider } from './DomainContext';
|
|
8
|
-
export { ModuleDictionaryContext, ModuleDictionaryProvider } from './ModuleDictionaryContext';
|
|
9
|
-
export { ModulePrivilegesContext, ModulePrivilegesProvider } from './ModulePrivilegesContext';
|
|
10
|
-
export { ModuleSkeletonContext, ModuleSkeletonProvider } from './ModuleSkeletonContext';
|
|
11
|
-
export { DomainCountryContext, DomainCountryProvider } from './DomainCountryContext';
|
|
12
|
-
export type { DomainCountryContextType, DomainCountry } from './DomainCountryContext/types';
|
package/contexts/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/hooks/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export * from './useBase';
|
|
2
|
-
export { useEnvironment } from './useEnvironment';
|
|
3
|
-
export { useFlagsStore, useFlagsPresent } from './useFlagsStore';
|
|
4
|
-
export { useHostTools } from './useHostTools';
|
|
5
|
-
export { useDomain } from './useDomain';
|
|
6
|
-
export { useLocalStorage } from './useLocalStorage';
|
|
7
|
-
export { useLocalStorageWithListener } from './useLocalStorageWithListener';
|
|
8
|
-
export { useModuleDictionary } from './useModuleDictionary';
|
|
9
|
-
export { useModulePrivileges } from './useModulePrivileges';
|
|
10
|
-
export { useModuleSkeleton } from './useModuleSkeleton';
|
|
11
|
-
export { useNetwork } from './useNetwork';
|
|
12
|
-
export { usePaginate } from './usePaginate';
|
|
13
|
-
export { usePropageteMF } from './usePropageteMF';
|
|
14
|
-
export { useDomainCountry } from './useDomainCountry';
|
|
15
|
-
export { useAuth } from './useAuth';
|
|
16
|
-
export type { PagerState } from './usePaginate/types';
|
|
17
|
-
export { initialPagerState } from './usePaginate/types';
|
package/hooks/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/hooks/useAuth/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useAuth } from './useAuth';
|
package/hooks/useAuth/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|