@fctc/interface-logic 1.7.2 → 1.7.4

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 (40) hide show
  1. package/dist/{configs.d.cts → configs.d.mts} +1 -4
  2. package/dist/configs.d.ts +1 -4
  3. package/dist/configs.js +146 -124
  4. package/dist/{configs.cjs → configs.mjs} +111 -161
  5. package/dist/constants.js +41 -2
  6. package/dist/{constants.cjs → constants.mjs} +2 -40
  7. package/dist/environment.d.mts +37 -0
  8. package/dist/environment.d.ts +35 -54
  9. package/dist/environment.js +2850 -2906
  10. package/dist/{environment.cjs → environment.mjs} +2816 -2945
  11. package/dist/{hooks.d.cts → hooks.d.mts} +7 -2
  12. package/dist/hooks.d.ts +7 -2
  13. package/dist/hooks.js +4181 -4520
  14. package/dist/{hooks.cjs → hooks.mjs} +4081 -4625
  15. package/dist/{provider.d.cts → provider.d.mts} +1 -1
  16. package/dist/provider.d.ts +1 -1
  17. package/dist/provider.js +530 -854
  18. package/dist/{provider.cjs → provider.mjs} +496 -894
  19. package/dist/{services.d.cts → services.d.mts} +2 -1
  20. package/dist/services.d.ts +2 -1
  21. package/dist/services.js +3866 -4282
  22. package/dist/{services.cjs → services.mjs} +3826 -4328
  23. package/dist/{store.d.cts → store.d.mts} +323 -127
  24. package/dist/store.d.ts +323 -127
  25. package/dist/store.js +147 -45
  26. package/dist/{store.cjs → store.mjs} +46 -150
  27. package/dist/{types.d.cts → types.d.mts} +1 -1
  28. package/dist/types.d.ts +1 -1
  29. package/dist/types.js +18 -0
  30. package/dist/types.mjs +0 -0
  31. package/dist/{utils.d.cts → utils.d.mts} +2 -2
  32. package/dist/utils.d.ts +2 -2
  33. package/dist/utils.js +176 -135
  34. package/dist/{utils.cjs → utils.mjs} +115 -202
  35. package/dist/{view-type-BGJfDe73.d.ts → view-type-D8ukwj_2.d.mts} +1 -1
  36. package/dist/{view-type-BGJfDe73.d.cts → view-type-D8ukwj_2.d.ts} +1 -1
  37. package/package.json +81 -82
  38. package/dist/environment.d.cts +0 -56
  39. package/dist/types.cjs +0 -17
  40. /package/dist/{constants.d.cts → constants.d.mts} +0 -0
@@ -1,56 +1,37 @@
1
- import { EnhancedStore } from '@reduxjs/toolkit';
2
-
3
- declare const localStorageUtils: () => {
4
- setToken: (access_token: string) => Promise<void>;
5
- setRefreshToken: (refresh_token: string) => Promise<void>;
6
- getAccessToken: () => Promise<string | null>;
7
- getRefreshToken: () => Promise<string | null>;
8
- clearToken: () => Promise<void>;
9
- };
10
- type LocalStorageUtilsType = ReturnType<typeof localStorageUtils>;
11
-
12
- declare const sessionStorageUtils: () => {
13
- getBrowserSession: () => Promise<string | null>;
1
+ declare function setupEnv(envConfig: any): void;
2
+ declare function getEnv(): {
3
+ baseUrl: string;
4
+ companies: never[];
5
+ user: {};
6
+ db: string;
7
+ refreshTokenEndpoint: string;
8
+ config: {
9
+ grantType: string;
10
+ clientId: string;
11
+ clientSecret: string;
12
+ redirectUri: string;
13
+ };
14
+ envFile: null;
15
+ requests: {
16
+ get: (url: string, headers?: any) => Promise<any>;
17
+ post: (url: string, body: any, headers?: any) => Promise<any>;
18
+ post_excel: (url: string, body: any, headers?: any) => Promise<any>;
19
+ put: (url: string, body: any, headers?: any) => Promise<any>;
20
+ patch: (url: string, body: any) => Promise<any>;
21
+ delete: (url: string, body: any) => Promise<any>;
22
+ };
23
+ defaultCompany: {
24
+ id: null;
25
+ logo: string;
26
+ secondary_color: string;
27
+ primary_color: string;
28
+ };
29
+ context: {
30
+ uid: null;
31
+ allowed_company_ids: never[];
32
+ lang: string;
33
+ tz: string;
34
+ };
14
35
  };
15
- type SessionStorageUtilsType = ReturnType<typeof sessionStorageUtils>;
16
-
17
- declare global {
18
- interface Global {
19
- envStore?: EnvStore;
20
- }
21
- interface Window {
22
- envStore?: EnvStore;
23
- }
24
- }
25
- declare class EnvStore {
26
- private static instance;
27
- envStore: EnhancedStore | any;
28
- baseUrl?: string;
29
- requests?: any;
30
- context?: any;
31
- defaultCompany?: any;
32
- config?: any;
33
- companies?: any[];
34
- user?: any;
35
- db?: string;
36
- localStorageUtils?: any;
37
- sessionStorageUtils?: any;
38
- refreshTokenEndpoint?: string;
39
- private constructor();
40
- static getInstance(envStore: EnhancedStore, localStorageUtils?: any, sessionStorageUtils?: any): EnvStore;
41
- setup(): void;
42
- setupEnv(envConfig: Partial<EnvStore>): void;
43
- setUid(uid: number): void;
44
- setLang(lang: string): void;
45
- setAllowCompanies(allowCompanies: number[]): void;
46
- setCompanies(companies: any[]): void;
47
- setDefaultCompany(company: any): void;
48
- setUserInfo(userInfo: any): void;
49
- }
50
- declare function initEnv({ localStorageUtils, sessionStorageUtils, }: {
51
- localStorageUtils?: LocalStorageUtilsType;
52
- sessionStorageUtils?: SessionStorageUtilsType;
53
- }): EnvStore;
54
- declare function getEnv(): EnvStore;
55
36
 
56
- export { EnvStore, getEnv, initEnv };
37
+ export { getEnv, setupEnv };