@fctc/interface-logic 1.7.1 → 1.7.2

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 (38) hide show
  1. package/dist/{configs.mjs → configs.cjs} +161 -111
  2. package/dist/{configs.d.mts → configs.d.cts} +2 -1
  3. package/dist/configs.d.ts +1 -0
  4. package/dist/configs.js +124 -146
  5. package/dist/{constants.mjs → constants.cjs} +40 -2
  6. package/dist/constants.js +2 -41
  7. package/dist/{environment.mjs → environment.cjs} +2029 -1967
  8. package/dist/environment.d.cts +56 -0
  9. package/dist/environment.d.ts +24 -6
  10. package/dist/environment.js +2235 -2248
  11. package/dist/{hooks.mjs → hooks.cjs} +4021 -3773
  12. package/dist/{hooks.d.mts → hooks.d.cts} +2 -7
  13. package/dist/hooks.d.ts +1 -6
  14. package/dist/hooks.js +3916 -3873
  15. package/dist/{provider.mjs → provider.cjs} +688 -586
  16. package/dist/{provider.d.mts → provider.d.cts} +1 -1
  17. package/dist/provider.d.ts +1 -1
  18. package/dist/provider.js +648 -620
  19. package/dist/{services.mjs → services.cjs} +4186 -3980
  20. package/dist/{services.d.mts → services.d.cts} +1 -2
  21. package/dist/services.d.ts +0 -1
  22. package/dist/services.js +4141 -4021
  23. package/dist/{store.mjs → store.cjs} +149 -33
  24. package/dist/{store.d.mts → store.d.cts} +127 -155
  25. package/dist/store.d.ts +127 -155
  26. package/dist/store.js +44 -134
  27. package/dist/types.cjs +17 -0
  28. package/dist/{types.d.mts → types.d.cts} +1 -1
  29. package/dist/types.js +0 -18
  30. package/dist/{utils.mjs → utils.cjs} +202 -115
  31. package/dist/{utils.d.mts → utils.d.cts} +2 -2
  32. package/dist/utils.d.ts +2 -2
  33. package/dist/utils.js +135 -176
  34. package/package.json +82 -81
  35. package/dist/environment.d.mts +0 -38
  36. package/dist/types.mjs +0 -0
  37. /package/dist/{constants.d.mts → constants.d.cts} +0 -0
  38. /package/dist/{view-type-BGJfDe73.d.mts → view-type-BGJfDe73.d.cts} +0 -0
@@ -0,0 +1,56 @@
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>;
14
+ };
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
+
56
+ export { EnvStore, getEnv, initEnv };
@@ -1,3 +1,19 @@
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>;
14
+ };
15
+ type SessionStorageUtilsType = ReturnType<typeof sessionStorageUtils>;
16
+
1
17
  declare global {
2
18
  interface Global {
3
19
  envStore?: EnvStore;
@@ -7,6 +23,8 @@ declare global {
7
23
  }
8
24
  }
9
25
  declare class EnvStore {
26
+ private static instance;
27
+ envStore: EnhancedStore | any;
10
28
  baseUrl?: string;
11
29
  requests?: any;
12
30
  context?: any;
@@ -18,9 +36,10 @@ declare class EnvStore {
18
36
  localStorageUtils?: any;
19
37
  sessionStorageUtils?: any;
20
38
  refreshTokenEndpoint?: string;
21
- constructor(localStorageUtils?: any, sessionStorageUtils?: any);
39
+ private constructor();
40
+ static getInstance(envStore: EnhancedStore, localStorageUtils?: any, sessionStorageUtils?: any): EnvStore;
22
41
  setup(): void;
23
- setupEnv(envConfig: EnvStore): any;
42
+ setupEnv(envConfig: Partial<EnvStore>): void;
24
43
  setUid(uid: number): void;
25
44
  setLang(lang: string): void;
26
45
  setAllowCompanies(allowCompanies: number[]): void;
@@ -28,11 +47,10 @@ declare class EnvStore {
28
47
  setDefaultCompany(company: any): void;
29
48
  setUserInfo(userInfo: any): void;
30
49
  }
31
- declare let env: EnvStore | null;
32
50
  declare function initEnv({ localStorageUtils, sessionStorageUtils, }: {
33
- localStorageUtils?: any;
34
- sessionStorageUtils?: any;
51
+ localStorageUtils?: LocalStorageUtilsType;
52
+ sessionStorageUtils?: SessionStorageUtilsType;
35
53
  }): EnvStore;
36
54
  declare function getEnv(): EnvStore;
37
55
 
38
- export { EnvStore, env, getEnv, initEnv };
56
+ export { EnvStore, getEnv, initEnv };