@fctc/interface-logic 1.7.3 → 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.
- package/dist/configs.d.mts +1 -4
- package/dist/configs.d.ts +1 -4
- package/dist/configs.js +9 -12
- package/dist/configs.mjs +9 -12
- package/dist/environment.d.mts +35 -54
- package/dist/environment.d.ts +35 -54
- package/dist/environment.js +2793 -2869
- package/dist/environment.mjs +2792 -2867
- package/dist/hooks.d.mts +7 -2
- package/dist/hooks.d.ts +7 -2
- package/dist/hooks.js +2733 -3010
- package/dist/hooks.mjs +2685 -2963
- package/dist/provider.js +19 -327
- package/dist/provider.mjs +19 -327
- package/dist/services.d.mts +2 -1
- package/dist/services.d.ts +2 -1
- package/dist/services.js +2560 -2853
- package/dist/services.mjs +2560 -2853
- package/dist/store.d.mts +224 -28
- package/dist/store.d.ts +224 -28
- package/dist/store.js +20 -6
- package/dist/store.mjs +20 -6
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{view-type-BGJfDe73.d.mts → view-type-D8ukwj_2.d.mts} +1 -1
- package/dist/{view-type-BGJfDe73.d.ts → view-type-D8ukwj_2.d.ts} +1 -1
- package/package.json +81 -81
package/dist/configs.d.mts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { EnvStore } from './environment.mjs';
|
|
2
|
-
import '@reduxjs/toolkit';
|
|
3
|
-
|
|
4
1
|
declare const axiosClient: {
|
|
5
|
-
init(config:
|
|
2
|
+
init(config: any): {
|
|
6
3
|
get: (url: string, headers: any) => Promise<any>;
|
|
7
4
|
post: (url: string, body: any, headers: any) => Promise<any>;
|
|
8
5
|
post_excel: (url: string, body: any, headers: any) => Promise<any>;
|
package/dist/configs.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { EnvStore } from './environment.js';
|
|
2
|
-
import '@reduxjs/toolkit';
|
|
3
|
-
|
|
4
1
|
declare const axiosClient: {
|
|
5
|
-
init(config:
|
|
2
|
+
init(config: any): {
|
|
6
3
|
get: (url: string, headers: any) => Promise<any>;
|
|
7
4
|
post: (url: string, body: any, headers: any) => Promise<any>;
|
|
8
5
|
post_excel: (url: string, body: any, headers: any) => Promise<any>;
|
package/dist/configs.js
CHANGED
|
@@ -2229,19 +2229,16 @@ var axiosClient = {
|
|
|
2229
2229
|
timeout: 5e4,
|
|
2230
2230
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2231
2231
|
});
|
|
2232
|
-
instance.interceptors.request.use(
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
if (token) {
|
|
2237
|
-
config2.headers["Authorization"] = "Bearer " + token;
|
|
2238
|
-
}
|
|
2239
|
-
return config2;
|
|
2240
|
-
},
|
|
2241
|
-
(error) => {
|
|
2242
|
-
Promise.reject(error);
|
|
2232
|
+
instance.interceptors.request.use(async (config2) => {
|
|
2233
|
+
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
2234
|
+
if (useActionToken && actionToken) {
|
|
2235
|
+
config2.headers["Action-Token"] = actionToken;
|
|
2243
2236
|
}
|
|
2244
|
-
|
|
2237
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2238
|
+
const token = await getToken?.();
|
|
2239
|
+
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2240
|
+
return config2;
|
|
2241
|
+
}, Promise.reject);
|
|
2245
2242
|
instance.interceptors.response.use(
|
|
2246
2243
|
(response) => {
|
|
2247
2244
|
return handleResponse(response);
|
package/dist/configs.mjs
CHANGED
|
@@ -2193,19 +2193,16 @@ var axiosClient = {
|
|
|
2193
2193
|
timeout: 5e4,
|
|
2194
2194
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2195
2195
|
});
|
|
2196
|
-
instance.interceptors.request.use(
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
if (token) {
|
|
2201
|
-
config2.headers["Authorization"] = "Bearer " + token;
|
|
2202
|
-
}
|
|
2203
|
-
return config2;
|
|
2204
|
-
},
|
|
2205
|
-
(error) => {
|
|
2206
|
-
Promise.reject(error);
|
|
2196
|
+
instance.interceptors.request.use(async (config2) => {
|
|
2197
|
+
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
2198
|
+
if (useActionToken && actionToken) {
|
|
2199
|
+
config2.headers["Action-Token"] = actionToken;
|
|
2207
2200
|
}
|
|
2208
|
-
|
|
2201
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2202
|
+
const token = await getToken?.();
|
|
2203
|
+
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2204
|
+
return config2;
|
|
2205
|
+
}, Promise.reject);
|
|
2209
2206
|
instance.interceptors.response.use(
|
|
2210
2207
|
(response) => {
|
|
2211
2208
|
return handleResponse(response);
|
package/dist/environment.d.mts
CHANGED
|
@@ -1,56 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 {
|
|
37
|
+
export { getEnv, setupEnv };
|
package/dist/environment.d.ts
CHANGED
|
@@ -1,56 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 {
|
|
37
|
+
export { getEnv, setupEnv };
|