@m4l/core 2.0.9-alpha.0 → 2.0.10

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.
Files changed (72) hide show
  1. package/contexts/AuthContext/AuthContext.d.ts +9 -2
  2. package/contexts/AuthContext/AuthContext.test.d.ts +1 -0
  3. package/contexts/AuthContext/types.d.ts +3 -3
  4. package/contexts/BaseContext/index.d.ts +8 -1
  5. package/contexts/BaseContext/index.test.d.ts +1 -0
  6. package/contexts/DomainContext/index.d.ts +8 -1
  7. package/contexts/DomainContext/index.test.d.ts +1 -0
  8. package/contexts/DomainCountryContext/index.d.ts +8 -1
  9. package/contexts/DomainCountryContext/index.test.d.ts +1 -0
  10. package/contexts/EnvironmentContext/index.d.ts +8 -1
  11. package/contexts/EnvironmentContext/index.test.d.ts +1 -0
  12. package/contexts/FlagsContext/index.d.ts +10 -3
  13. package/contexts/FlagsContext/index.test.d.ts +1 -0
  14. package/contexts/FlagsContext/store.d.ts +9 -2
  15. package/contexts/FlagsContext/store.js +14 -0
  16. package/contexts/HostToolsContext/index.d.ts +9 -2
  17. package/contexts/HostToolsContext/index.test.d.ts +1 -0
  18. package/contexts/ModuleDictionaryContext/index.d.ts +8 -1
  19. package/contexts/ModuleDictionaryContext/index.test.d.ts +1 -0
  20. package/contexts/ModuleDictionaryContext/types.d.ts +1 -1
  21. package/contexts/ModulePrivilegesContext/index.d.ts +8 -1
  22. package/contexts/ModulePrivilegesContext/index.test.d.ts +1 -0
  23. package/contexts/ModuleSkeletonContext/index.d.ts +8 -1
  24. package/contexts/ModuleSkeletonContext/index.test.d.ts +1 -0
  25. package/contexts/NetworkContext/index.d.ts +9 -2
  26. package/contexts/NetworkContext/index.test.d.ts +1 -0
  27. package/hooks/useAuth/useAuth.d.ts +8 -1
  28. package/hooks/useAuth/useAuth.test.d.ts +1 -0
  29. package/hooks/useBase/index.d.ts +7 -0
  30. package/hooks/useBase/index.test.d.ts +1 -0
  31. package/hooks/useDomain/index.d.ts +8 -1
  32. package/hooks/useDomain/index.test.d.ts +1 -0
  33. package/hooks/useDomainCountry/index.d.ts +8 -1
  34. package/hooks/useDomainCountry/index.test.d.ts +1 -0
  35. package/hooks/useEnvironment/index.d.ts +7 -0
  36. package/hooks/useEnvironment/index.test.d.ts +1 -0
  37. package/hooks/useFlagsStore/index.d.ts +15 -1
  38. package/hooks/useFlagsStore/index.test.d.ts +1 -0
  39. package/hooks/useHostTools/index.d.ts +8 -1
  40. package/hooks/useHostTools/index.test.d.ts +1 -0
  41. package/hooks/useLocalStorage/index.d.ts +7 -0
  42. package/hooks/useLocalStorage/index.test.d.ts +1 -0
  43. package/hooks/useLocalStorageWithListener/index.d.ts +8 -0
  44. package/hooks/useLocalStorageWithListener/index.test.d.ts +1 -0
  45. package/hooks/useModuleDictionary/index.d.ts +8 -1
  46. package/hooks/useModuleDictionary/index.test.d.ts +1 -0
  47. package/hooks/useModulePrivileges/index.d.ts +8 -1
  48. package/hooks/useModulePrivileges/index.test.d.ts +1 -0
  49. package/hooks/useModuleSkeleton/index.d.ts +7 -0
  50. package/hooks/useModuleSkeleton/index.test.d.ts +1 -0
  51. package/hooks/useNetwork/index.d.ts +8 -1
  52. package/hooks/useNetwork/index.test.d.ts +1 -0
  53. package/hooks/usePaginate/index.d.ts +5 -3
  54. package/hooks/usePaginate/index.test.d.ts +1 -0
  55. package/hooks/usePropageteMF/index.d.ts +7 -0
  56. package/package.json +37 -11
  57. package/test/constants.d.ts +89 -0
  58. package/test/mocks.d.ts +7 -0
  59. package/test/setup.d.ts +0 -0
  60. package/test/types.d.ts +4 -0
  61. package/test/utils.d.ts +13 -0
  62. package/types/index.d.ts +3 -3
  63. package/utils/axiosOperation/index.d.ts +8 -1
  64. package/utils/axiosOperation/index.js +7 -0
  65. package/utils/axiosOperation/index.test.d.ts +1 -0
  66. package/utils/getLocalStorage/index.d.ts +7 -0
  67. package/utils/getLocalStorage/index.test.d.ts +1 -0
  68. package/utils/getPropertyByString/index.d.ts +7 -0
  69. package/utils/getPropertyByString/index.test.d.ts +1 -0
  70. package/utils/setLocalStorage/index.d.ts +7 -0
  71. package/utils/setLocalStorage/index.test.d.ts +1 -0
  72. package/utils/voidFunction.d.ts +7 -0
@@ -1,5 +1,12 @@
1
- import React from 'react';
2
- import type { AuthProviderProps, SessionContextType } from './types';
1
+ import { default as React } from 'react';
2
+ import { AuthProviderProps, SessionContextType } from './types';
3
3
  declare const AuthContext: React.Context<SessionContextType | null>;
4
+ /**
5
+ * Proveedor de autenticación
6
+ * @author Juan Escobar - automatic
7
+ * @createdAt 2024-10-04 18:38:38 - automatic
8
+ * @updatedAt 2024-10-04 18:38:38 - automatic
9
+ * @updatedUser Juan Escobar - automatic
10
+ */
4
11
  declare function AuthProvider(props: AuthProviderProps): React.JSX.Element;
5
12
  export { AuthContext, AuthProvider };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
- import type { ReactNode } from 'react';
2
- import type { DomainCountry } from '../DomainCountryContext/types';
3
- import type { Maybe } from '../../types';
1
+ import { ReactNode } from 'react';
2
+ import { DomainCountry } from '../DomainCountryContext/types';
3
+ import { Maybe } from '../../types';
4
4
  import { EnumTypes } from './constants';
5
5
  export interface UserAuth {
6
6
  email: string;
@@ -1,4 +1,11 @@
1
1
  import { BaseProviderProps } from './types';
2
- declare const BaseContext: import("react").Context<unknown>;
2
+ declare const BaseContext: import('react').Context<unknown>;
3
+ /**
4
+ * Proveedor base para los contextos.
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:39:38 - automatic
7
+ * @updatedAt 2024-10-04 18:39:38 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
3
10
  declare function BaseProvider<T>(props: BaseProviderProps<T>): import("react").JSX.Element;
4
11
  export { BaseProvider, BaseContext };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,11 @@
1
1
  import { DomainProviderProps, Domain } from './types';
2
- declare const DomainContext: import("react").Context<Domain | null>;
2
+ declare const DomainContext: import('react').Context<Domain | null>;
3
+ /**
4
+ * Proveedor del contexto de dominio.
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:41:02 - automatic
7
+ * @updatedAt 2024-10-04 18:41:02 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
3
10
  declare function DomainProvider(props: DomainProviderProps): import("react").JSX.Element;
4
11
  export { DomainProvider, DomainContext };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,11 @@
1
1
  import { DomainCountryContextType, DomainCountryProviderProps } from './types';
2
- declare const DomainCountryContext: import("react").Context<DomainCountryContextType | null>;
2
+ declare const DomainCountryContext: import('react').Context<DomainCountryContextType | null>;
3
+ /**
4
+ * Proveedor del contexto de país de dominio.
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:42:00 - automatic
7
+ * @updatedAt 2024-10-04 18:42:01 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
3
10
  declare function DomainCountryProvider(props: DomainCountryProviderProps): import("react").JSX.Element;
4
11
  export { DomainCountryProvider, DomainCountryContext };
@@ -0,0 +1 @@
1
+ export declare const mock_useEffect: import('vitest').Mock<(...args: any[]) => any>;
@@ -1,4 +1,11 @@
1
1
  import { EnvironmentContextType, EnvironmentProviderProps } from './types';
2
- declare const EnvironmentContext: import("react").Context<EnvironmentContextType | null>;
2
+ declare const EnvironmentContext: import('react').Context<EnvironmentContextType | null>;
3
+ /**
4
+ * Proveedor del contexto de entorno.
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:42:00 - automatic
7
+ * @updatedAt 2024-10-04 18:42:01 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
3
10
  declare function EnvironmentProvider(props: EnvironmentProviderProps): import("react").JSX.Element;
4
11
  export { EnvironmentProvider, EnvironmentContext };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,12 +1,19 @@
1
1
  import { FlagsProviderProps } from './types';
2
- declare const FlagsContext: import("react").Context<(Omit<Omit<import("zustand").StoreApi<import("./types").FlagsStateWithActions>, "setState"> & {
2
+ declare const FlagsContext: import('react').Context<(Omit<Omit<import('zustand').StoreApi<import('./types').FlagsStateWithActions>, "setState"> & {
3
3
  setState<A extends string | {
4
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;
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
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 | {
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
8
  type: unknown;
9
9
  } | undefined): void;
10
10
  }) | null>;
11
+ /**
12
+ * Proveedor del contexto de banderas.
13
+ * @author Juan Escobar - automatic
14
+ * @createdAt 2024-10-04 18:42:00 - automatic
15
+ * @updatedAt 2024-10-04 18:42:01 - automatic
16
+ * @updatedUser Juan Escobar - automatic
17
+ */
11
18
  declare function FlagsProvider({ children }: FlagsProviderProps): import("react").JSX.Element;
12
19
  export { FlagsProvider, FlagsContext };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,17 @@
1
1
  import { FlagsStateWithActions, FlagsStoreState } from './types';
2
- export declare const createFlagsStore: (initialState: FlagsStoreState) => Omit<Omit<import("zustand").StoreApi<FlagsStateWithActions>, "setState"> & {
2
+ /**
3
+ * Crea el store de banderas.
4
+ * @author Juan Escobar - automatic
5
+ * @createdAt 2024-10-04 18:42:00 - automatic
6
+ * @updatedAt 2024-10-04 18:42:01 - automatic
7
+ * @updatedUser Juan Escobar - automatic
8
+ */
9
+ export declare const createFlagsStore: (initialState: FlagsStoreState) => Omit<Omit<import('zustand').StoreApi<FlagsStateWithActions>, "setState"> & {
3
10
  setState<A extends string | {
4
11
  type: unknown;
5
12
  }>(partial: FlagsStateWithActions | Partial<FlagsStateWithActions> | ((state: FlagsStateWithActions) => FlagsStateWithActions | Partial<FlagsStateWithActions>), replace?: boolean | undefined, action?: A | undefined): void;
6
13
  }, "setState"> & {
7
- setState(nextStateOrUpdater: FlagsStateWithActions | Partial<FlagsStateWithActions> | ((state: import("immer/dist/internal").WritableDraft<FlagsStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
14
+ setState(nextStateOrUpdater: FlagsStateWithActions | Partial<FlagsStateWithActions> | ((state: import('immer/dist/internal').WritableDraft<FlagsStateWithActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
8
15
  type: unknown;
9
16
  } | undefined): void;
10
17
  };
@@ -6,11 +6,25 @@ const d = (l) => t(
6
6
  m((r) => ({
7
7
  ...l,
8
8
  flagsActions: {
9
+ /**
10
+ * Limpia las banderas.
11
+ * @author Juan Escobar - automatic
12
+ * @createdAt 2024-10-04 18:42:00 - automatic
13
+ * @updatedAt 2024-10-04 18:42:01 - automatic
14
+ * @updatedUser Juan Escobar - automatic
15
+ */
9
16
  clearFlags: () => {
10
17
  r((o) => {
11
18
  o.flags = [];
12
19
  });
13
20
  },
21
+ /**
22
+ * Agrega una bandera.
23
+ * @author Juan Escobar - automatic
24
+ * @createdAt 2024-10-04 18:42:00 - automatic
25
+ * @updatedAt 2024-10-04 18:42:01 - automatic
26
+ * @updatedUser Juan Escobar - automatic
27
+ */
14
28
  addFlag: (o) => {
15
29
  r((a) => {
16
30
  const e = a.flags;
@@ -1,5 +1,12 @@
1
1
  import { HostToolsType } from '../../types';
2
- import type { HostToolsProviderProps } from './types';
3
- declare const HostToolsContext: import("react").Context<HostToolsType | null>;
2
+ import { HostToolsProviderProps } from './types';
3
+ declare const HostToolsContext: import('react').Context<HostToolsType | null>;
4
+ /**
5
+ * Proveedor de contexto de herramientas del host
6
+ * @author Juan Escobar - automatic
7
+ * @createdAt 2024-10-04 18:42:00 - automatic
8
+ * @updatedAt 2024-10-04 18:42:01 - automatic
9
+ * @updatedUser Juan Escobar - automatic
10
+ */
4
11
  declare function HostToolsProvider(props: HostToolsProviderProps): import("react").JSX.Element;
5
12
  export { HostToolsProvider, HostToolsContext };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,11 @@
1
1
  import { ModuleDictionaryContextProps, ModuleDictionaryProviderProps } from './types';
2
- declare const ModuleDictionaryContext: import("react").Context<ModuleDictionaryContextProps | null>;
2
+ declare const ModuleDictionaryContext: import('react').Context<ModuleDictionaryContextProps | null>;
3
+ /**
4
+ * Proveedor de contexto de diccionario de módulo
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:42:00 - automatic
7
+ * @updatedAt 2024-10-04 18:42:01 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
3
10
  declare function ModuleDictionaryProvider(props: ModuleDictionaryProviderProps): import("react").JSX.Element;
4
11
  export { ModuleDictionaryProvider, ModuleDictionaryContext };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import type { GetLabelType, ModuleDictionary } from '../../types/dictionary';
2
+ import { GetLabelType, ModuleDictionary } from '../../types/dictionary';
3
3
  export interface ModuleDictionaryProviderProps {
4
4
  currentLang?: string;
5
5
  isAuth?: boolean;
@@ -1,4 +1,11 @@
1
1
  import { ModulePrivilegesContextProps, ModulePrivilegesProviderProps } from './types';
2
- declare const ModulePrivilegesContext: import("react").Context<ModulePrivilegesContextProps | null>;
2
+ declare const ModulePrivilegesContext: import('react').Context<ModulePrivilegesContextProps | null>;
3
+ /**
4
+ * Proveedor de contexto de privilegios
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:42:00 - automatic
7
+ * @updatedAt 2024-10-04 18:42:01 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
3
10
  declare function ModulePrivilegesProvider(props: ModulePrivilegesProviderProps): import("react").JSX.Element;
4
11
  export { ModulePrivilegesProvider, ModulePrivilegesContext };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,11 @@
1
1
  import { ModuleSkeletonContextProps, ModuleSkeletonProviderProps } from './types';
2
- declare const ModuleSkeletonContext: import("react").Context<ModuleSkeletonContextProps | null>;
2
+ declare const ModuleSkeletonContext: import('react').Context<ModuleSkeletonContextProps | null>;
3
+ /**
4
+ * Proveedor de contexto de esqueleto de módulo
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:42:00 - automatic
7
+ * @updatedAt 2024-10-04 18:42:01 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
3
10
  declare function ModuleSkeletonProvider(props: ModuleSkeletonProviderProps): import("react").JSX.Element;
4
11
  export { ModuleSkeletonProvider, ModuleSkeletonContext };
@@ -0,0 +1 @@
1
+ export declare const mockUseFlagsPresent: jest.Mock;
@@ -1,4 +1,11 @@
1
- import type { NetworkProviderProps } from './types';
2
- declare const NetworkContext: import("react").Context<import("./types").NetworkType | null>;
1
+ import { NetworkProviderProps } from './types';
2
+ declare const NetworkContext: import('react').Context<import('./types').NetworkType | null>;
3
+ /**
4
+ * Proveedor de contexto de red
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:42:00 - automatic
7
+ * @updatedAt 2024-10-04 18:42:01 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
3
10
  declare function NetworkProvider(props: NetworkProviderProps): import("react").JSX.Element;
4
11
  export { NetworkProvider, NetworkContext };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,9 @@
1
- export declare const useAuth: () => import("../../contexts/AuthContext/types").SessionContextType;
1
+ /**
2
+ * Hook para obtener el contexto de autenticación
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
8
+ export declare const useAuth: () => import('../../contexts/AuthContext/types').SessionContextType;
2
9
  export default useAuth;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,9 @@
1
+ /**
2
+ * Hook para obtener el contexto base
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
1
8
  export declare function useBase<T>(): T;
2
9
  export default useBase;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,9 @@
1
- export declare const useDomain: () => import("../../contexts/DomainContext/types").Domain;
1
+ /**
2
+ * Hook para obtener el contexto del dominio
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
8
+ export declare const useDomain: () => import('../../contexts/DomainContext/types').Domain;
2
9
  export default useDomain;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,8 @@
1
- export declare const useDomainCountry: () => import("../..").DomainCountryContextType;
1
+ /**
2
+ * Hook para obtener el contexto del pais del dominio
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
8
+ export declare const useDomainCountry: () => import('../..').DomainCountryContextType;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,10 @@
1
1
  import { EnvironmentContextType } from '../../contexts/EnvironmentContext/types';
2
+ /**
3
+ * Hook para obtener el contexto del ambiente
4
+ * @author Juan Escobar - automatic
5
+ * @createdAt 2024-10-04 18:42:00 - automatic
6
+ * @updatedAt 2024-10-04 18:42:01 - automatic
7
+ * @updatedUser Juan Escobar - automatic
8
+ */
2
9
  export declare const useEnvironment: () => EnvironmentContextType;
3
10
  export default useEnvironment;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,17 @@
1
- import type { Flag, FlagsStateWithActions } from '../../contexts/FlagsContext/types';
1
+ import { Flag, FlagsStateWithActions } from '../../contexts/FlagsContext/types';
2
+ /**
3
+ * Hook to get the flags store
4
+ * @author Juan Escobar - automatic
5
+ * @createdAt 2024-10-04 18:42:00 - automatic
6
+ * @updatedAt 2024-10-04 18:42:01 - automatic
7
+ * @updatedUser Juan Escobar - automatic
8
+ */
2
9
  export declare function useFlagsStore<T>(selector: (state: FlagsStateWithActions) => T, equalityFn?: (left: T, right: T) => boolean): T;
10
+ /**
11
+ * Hook to check if the flags are present
12
+ * @author Juan Escobar - automatic
13
+ * @createdAt 2024-10-04 18:42:00 - automatic
14
+ * @updatedAt 2024-10-04 18:42:01 - automatic
15
+ * @updatedUser Juan Escobar - automatic
16
+ */
3
17
  export declare const useFlagsPresent: (compareFlags: Array<Flag>) => boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,9 @@
1
- export declare const useHostTools: () => import("../..").HostToolsType;
1
+ /**
2
+ * Hook para obtener las herramientas del host
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
8
+ export declare const useHostTools: () => import('../..').HostToolsType;
2
9
  export default useHostTools;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,8 @@
1
+ /**
2
+ * Hook to use local storage
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
1
8
  export declare function useLocalStorage<ValueType>(key: string, initialValue: ValueType): any[];
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,11 @@
1
1
  export type SetStateType<ValueType> = (newValue: ValueType) => void;
2
+ /**
3
+ * Hook to use local storage with listener, vigiala los cambios en el local storage y actualiza el estado con
4
+ * listener de storage
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:42:00 - automatic
7
+ * @updatedAt 2024-10-04 18:42:01 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
2
10
  export declare function useLocalStorageWithListener<ValueType>(key: string, initialValue: ValueType): [ValueType, SetStateType<ValueType>];
3
11
  export default useLocalStorageWithListener;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,8 @@
1
- export declare const useModuleDictionary: () => import("../../contexts/ModuleDictionaryContext/types").ModuleDictionaryContextProps;
1
+ /**
2
+ * Hook para obtener el diccionario de un modulo
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
8
+ export declare const useModuleDictionary: () => import('../../contexts/ModuleDictionaryContext/types').ModuleDictionaryContextProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,8 @@
1
- export declare const useModulePrivileges: () => import("../../contexts/ModulePrivilegesContext/types").ModulePrivilegesContextProps;
1
+ /**
2
+ * Hook para obtener el contexto de privilegios de un modulo
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
8
+ export declare const useModulePrivileges: () => import('../../contexts/ModulePrivilegesContext/types').ModulePrivilegesContextProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,8 @@
1
+ /**
2
+ * Hook para obtener el estado del esqueleto de un modulo
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
1
8
  export declare const useModuleSkeleton: () => boolean;
@@ -0,0 +1 @@
1
+ export declare const mockUseFlagsPresent: jest.Mock;
@@ -1,2 +1,9 @@
1
- export declare const useNetwork: () => import("../../contexts/NetworkContext/types").NetworkType;
1
+ /**
2
+ * Hook para obtener el contexto de la red
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:00 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
8
+ export declare const useNetwork: () => import('../../contexts/NetworkContext/types').NetworkType;
2
9
  export default useNetwork;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,7 @@
1
- import { UsePaginateProps } from './types';
2
- import type { PagerState } from './types';
1
+ import { UsePaginateProps, PagerState } from './types';
2
+ /**
3
+ * Hook para paginar una lista de elementos
4
+ */
3
5
  export declare const usePaginate: <TRow>(props: UsePaginateProps<TRow>) => {
4
6
  onPageChange: (newPage: number) => void;
5
7
  onRowsPerPageChange: (newRowsPerPage: number) => void;
@@ -7,5 +9,5 @@ export declare const usePaginate: <TRow>(props: UsePaginateProps<TRow>) => {
7
9
  rows: TRow[];
8
10
  clearRows: () => void;
9
11
  Refresh: () => void;
10
- setRows: import("react").Dispatch<import("react").SetStateAction<TRow[]>>;
12
+ setRows: import('react').Dispatch<import('react').SetStateAction<TRow[]>>;
11
13
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,10 @@
1
1
  import { EmmitListenerGuard } from '../../types';
2
2
  import { usePropagateProps } from './types';
3
+ /**
4
+ * Hook para propagar eventos entre microfrontends
5
+ * @author Juan Escobar - automatic
6
+ * @createdAt 2024-10-04 18:42:00 - automatic
7
+ * @updatedAt 2024-10-04 18:42:01 - automatic
8
+ * @updatedUser Juan Escobar - automatic
9
+ */
3
10
  export declare function usePropageteMF<E extends keyof EmmitListenerGuard>(props: usePropagateProps<E>): void;
package/package.json CHANGED
@@ -1,14 +1,50 @@
1
1
  {
2
2
  "name": "@m4l/core",
3
- "version": "2.0.9-alpha.0",
3
+ "version": "2.0.10",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "lint-staged": {
10
+ "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
11
+ },
6
12
  "dependencies": {
7
13
  "camelcase-keys": "^9.1.3",
8
14
  "immer": "^9.0.21",
9
15
  "snakecase-keys": "^8.0.1",
10
16
  "zustand": "4.3.6"
11
17
  },
18
+ "peerDependencies": {
19
+ "axios": "^1.0.0",
20
+ "history": "5.3.0",
21
+ "qs": "^6.0.0",
22
+ "react": "^18.0.0",
23
+ "react-toastify": "10.0.5"
24
+ },
25
+ "peerDependenciesMeta": {
26
+ "@types/nprogress": {
27
+ "optional": true
28
+ },
29
+ "@types/react": {
30
+ "optional": true
31
+ },
32
+ "axios": {
33
+ "optional": true
34
+ },
35
+ "history": {
36
+ "optional": true
37
+ },
38
+ "qs": {
39
+ "optional": true
40
+ },
41
+ "react": {
42
+ "optional": true
43
+ },
44
+ "react-toastify": {
45
+ "optional": true
46
+ }
47
+ },
12
48
  "resolutions": {
13
49
  "glob": "^10.4.5",
14
50
  "react": "^18.0.0",
@@ -26,13 +62,6 @@
26
62
  "react-dom": "^18.0.0",
27
63
  "vite": "^5.4.7"
28
64
  },
29
- "peerDependencies": {
30
- "axios": "^1.0.0",
31
- "history": "5.3.0",
32
- "qs": "^6.0.0",
33
- "react": "^18.0.0",
34
- "react-toastify": "10.0.5"
35
- },
36
65
  "files": [
37
66
  "*"
38
67
  ],
@@ -42,9 +71,6 @@
42
71
  "type": "module",
43
72
  "types": "./index.d.ts",
44
73
  "sideEffects": false,
45
- "publishConfig": {
46
- "access": "public"
47
- },
48
74
  "engines": {
49
75
  "node": ">=12.0.0"
50
76
  },
@@ -0,0 +1,89 @@
1
+ import { HostToolsType, Toaster } from '../types';
2
+ import { BaseDataForTesting } from './types';
3
+ export declare const moduleIdForTesting = "testing";
4
+ export declare const moduleNameForTesting = "label_for_module_name";
5
+ export declare const dictionaryDataForTesting: {
6
+ data: {
7
+ module_name: string;
8
+ label1: string;
9
+ };
10
+ comp1: {
11
+ key1: string;
12
+ };
13
+ };
14
+ export declare const queryPrivilegesForTesting: string[];
15
+ export declare const resultpPrivilegesForTesting: {
16
+ data: {
17
+ priv1: boolean;
18
+ };
19
+ };
20
+ export declare const domainDataForTesting: {
21
+ data: {
22
+ name: string;
23
+ company_logo_small_url: string;
24
+ company_logo_normal_url: string;
25
+ };
26
+ };
27
+ export declare const domainCountry1DataForTesting: {
28
+ id: number;
29
+ currency: string;
30
+ currency_decimal_digits: number;
31
+ decimal_symbol: string;
32
+ thousands_symbol: string;
33
+ };
34
+ export declare const domainCountry2DataForTesting: {
35
+ id: number;
36
+ currency: string;
37
+ currency_decimal_digits: number;
38
+ decimal_symbol: string;
39
+ thousands_symbol: string;
40
+ };
41
+ export declare const resultAxiosOperationForTesting: {
42
+ data: {
43
+ a: number;
44
+ b: string;
45
+ };
46
+ };
47
+ export declare const networkPropsForTesting: {
48
+ method: string;
49
+ endPoint: string;
50
+ parms: {};
51
+ };
52
+ export declare const environmentDataForTesting: {
53
+ isLocalhost: boolean;
54
+ host: string;
55
+ domain_token: string;
56
+ host_api_local: string;
57
+ host_api_remote: string;
58
+ host_static_assets: string;
59
+ environment_assets: string;
60
+ isMicroFrontend: boolean;
61
+ isIsolatation: boolean;
62
+ database: string;
63
+ };
64
+ export declare const baseDataForTesting: BaseDataForTesting;
65
+ /**
66
+ * Mock toaster
67
+ * @updatedUser Juan Escobar - automatic
68
+ * @updatedUser Juan Escobar - automatic
69
+ * @updatedUser Juan Escobar - automatic
70
+ * @updatedUser Juan Escobar - automatic
71
+ * @updatedAt 2024-10-04 18:42:01 - automatic
72
+ * @updatedAt 2024-10-04 18:42:01 - automatic
73
+ * @updatedAt 2024-10-04 18:42:01 - automatic
74
+ * @updatedAt 2024-10-04 18:42:01 - automatic
75
+ * @createdAt 2024-10-04 18:42:00 - automatic
76
+ * @createdAt 2024-10-04 18:42:00 - automatic
77
+ * @createdAt 2024-10-04 18:42:00 - automatic
78
+ * @createdAt 2024-10-04 18:42:00 - automatic
79
+ * @author Juan Escobar - automatic
80
+ * @author Juan Escobar - automatic
81
+ * @author Juan Escobar - automatic
82
+ * @author Juan Escobar - automatic
83
+ * @author Juan Escobar - automatic
84
+ * @createdAt 2024-10-04 18:42:00 - automatic
85
+ * @updatedAt 2024-10-04 18:42:01 - automatic
86
+ * @updatedUser Juan Escobar - automatic
87
+ */
88
+ export declare const mock_toaster: Toaster;
89
+ export declare const hostToolsDataForTesting: HostToolsType;
@@ -0,0 +1,7 @@
1
+ export declare const mock_addFlag: import('vitest').Mock<(...args: any[]) => any>;
2
+ export declare const mock_networkOperation: import('vitest').Mock<(...args: any[]) => any>;
3
+ export declare const mock_events_add_listener: import('vitest').Mock<(...args: any[]) => any>;
4
+ export declare const mock_events_remove_listener: import('vitest').Mock<(...args: any[]) => any>;
5
+ export declare const mock_events_emit: import('vitest').Mock<(...args: any[]) => any>;
6
+ export declare const mock_startProgress: import('vitest').Mock<(...args: any[]) => any>;
7
+ export declare const mock_stopProgress: import('vitest').Mock<(...args: any[]) => any>;
File without changes
@@ -0,0 +1,4 @@
1
+ export interface BaseDataForTesting {
2
+ a: string;
3
+ b: number;
4
+ }
@@ -0,0 +1,13 @@
1
+ import { cleanup, screen } from '@testing-library/react';
2
+ import { renderHook } from '@testing-library/react-hooks';
3
+ import { default as React, act } from 'react';
4
+ /**
5
+ * customRender
6
+ * @author Juan Escobar - automatic
7
+ * @createdAt 2024-10-04 18:42:01 - automatic
8
+ * @updatedAt 2024-10-04 18:42:01 - automatic
9
+ * @updatedUser Juan Escobar - automatic
10
+ */
11
+ declare const customRender: (ui: React.ReactElement, options?: {}) => import('@testing-library/react').RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
12
+ export { default as userEvent } from '@testing-library/user-event';
13
+ export { customRender as render, renderHook, screen, cleanup, act };
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { ReactNode } from 'react';
2
- import type { Id, ToastOptions } from 'react-toastify';
3
- import type { BrowserHistory } from 'history';
1
+ import { ReactNode } from 'react';
2
+ import { Id, ToastOptions } from 'react-toastify';
3
+ import { BrowserHistory } from 'history';
4
4
  import { AxiosProgressEvent, ResponseType } from 'axios';
5
5
  import { DomainCountry } from '../contexts';
6
6
  import { AxiosOptions } from '../utils/axiosOperation/types';
@@ -1,2 +1,9 @@
1
- import type { EnvironmentType, HostToolsType, NetworkProps } from '../../types';
1
+ import { EnvironmentType, HostToolsType, NetworkProps } from '../../types';
2
+ /**
3
+ * Esta función se encarga de realizar las operaciones de red.
4
+ * @author Juan Escobar - automatic
5
+ * @createdAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedAt 2024-10-04 18:42:01 - automatic
7
+ * @updatedUser Juan Escobar - automatic
8
+ */
2
9
  export declare const axiosOperation: (props: NetworkProps, enviroment: EnvironmentType, hostTools: HostToolsType) => Promise<any>;
@@ -53,6 +53,13 @@ const L = async (e, t, a) => {
53
53
  url: c ? o : `/${o}`,
54
54
  data: $ ? v(m, { deep: !0 }) : m,
55
55
  params: {},
56
+ /**
57
+ * paramsSerializer: es una función opcional que permite serializar los parámetros de la URL.
58
+ * @author Juan Escobar - automatic
59
+ * @createdAt 2024-10-04 18:42:01 - automatic
60
+ * @updatedAt 2024-10-04 18:42:01 - automatic
61
+ * @updatedUser Juan Escobar - automatic
62
+ */
56
63
  paramsSerializer: () => b.stringify(g, { encode: !0 }),
57
64
  headers: p,
58
65
  timeout: r,
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,8 @@
1
+ /**
2
+ * Get value from local storage
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:01 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
1
8
  export declare function getLocalStorage<ValueType>(key: string, initialValue: ValueType): ValueType;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,10 @@
1
1
  type PropertyType = string | undefined | any[] | Record<any, any>;
2
+ /**
3
+ * Devuelve una parte de un objeto, que puede estar anidado.
4
+ * @author Juan Escobar - automatic
5
+ * @createdAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedAt 2024-10-04 18:42:01 - automatic
7
+ * @updatedUser Juan Escobar - automatic
8
+ */
2
9
  export declare function getPropertyByString<T extends PropertyType = PropertyType>(object: any, key: string, defaultValue?: T): T;
3
10
  export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,8 @@
1
+ /**
2
+ * Graba en el localStorage un objeto con la key especificada. Si ya existe, lo mezcla con el objeto actual.
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:01 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
1
8
  export declare function setLocalStorage<ValueType>(key: string, newValue: ValueType, mixCurrentLocalStorage?: boolean): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,8 @@
1
+ /**
2
+ * A function that does nothing.
3
+ * @author Juan Escobar - automatic
4
+ * @createdAt 2024-10-04 18:42:01 - automatic
5
+ * @updatedAt 2024-10-04 18:42:01 - automatic
6
+ * @updatedUser Juan Escobar - automatic
7
+ */
1
8
  export declare function voidFunction(): void;