@fctc/interface-logic 1.7.7 → 1.7.9
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 +4 -4
- package/dist/configs.d.ts +4 -4
- package/dist/configs.js +15 -12
- package/dist/configs.mjs +15 -12
- package/dist/environment.d.mts +36 -35
- package/dist/environment.d.ts +36 -35
- package/dist/environment.js +2822 -2771
- package/dist/environment.mjs +2821 -2770
- package/dist/hooks.d.mts +1 -6
- package/dist/hooks.d.ts +1 -6
- package/dist/hooks.js +2274 -2025
- package/dist/hooks.mjs +2247 -1997
- package/dist/provider.js +330 -50
- package/dist/provider.mjs +330 -50
- package/dist/services.d.mts +0 -1
- package/dist/services.d.ts +0 -1
- package/dist/services.js +2223 -1958
- package/dist/services.mjs +2223 -1958
- package/dist/store-DvWeB4jm.d.mts +294 -0
- package/dist/store-DvWeB4jm.d.ts +294 -0
- package/dist/store.d.mts +18 -653
- package/dist/store.d.ts +18 -653
- package/dist/store.js +6 -12
- package/dist/store.mjs +6 -12
- package/package.json +81 -81
package/dist/configs.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const axiosClient: {
|
|
2
2
|
init(config: any): {
|
|
3
|
-
get: (url: string, headers
|
|
4
|
-
post: (url: string, body: any, headers
|
|
5
|
-
post_excel: (url: string, body: any, headers
|
|
6
|
-
put: (url: string, body: any, headers
|
|
3
|
+
get: (url: string, headers: any) => Promise<any>;
|
|
4
|
+
post: (url: string, body: any, headers: any) => Promise<any>;
|
|
5
|
+
post_excel: (url: string, body: any, headers: any) => Promise<any>;
|
|
6
|
+
put: (url: string, body: any, headers: any) => Promise<any>;
|
|
7
7
|
patch: (url: string, body: any) => Promise<any>;
|
|
8
8
|
delete: (url: string, body: any) => Promise<any>;
|
|
9
9
|
};
|
package/dist/configs.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const axiosClient: {
|
|
2
2
|
init(config: any): {
|
|
3
|
-
get: (url: string, headers
|
|
4
|
-
post: (url: string, body: any, headers
|
|
5
|
-
post_excel: (url: string, body: any, headers
|
|
6
|
-
put: (url: string, body: any, headers
|
|
3
|
+
get: (url: string, headers: any) => Promise<any>;
|
|
4
|
+
post: (url: string, body: any, headers: any) => Promise<any>;
|
|
5
|
+
post_excel: (url: string, body: any, headers: any) => Promise<any>;
|
|
6
|
+
put: (url: string, body: any, headers: any) => Promise<any>;
|
|
7
7
|
patch: (url: string, body: any) => Promise<any>;
|
|
8
8
|
delete: (url: string, body: any) => Promise<any>;
|
|
9
9
|
};
|
package/dist/configs.js
CHANGED
|
@@ -2208,9 +2208,9 @@ var sessionStorageUtils = () => {
|
|
|
2208
2208
|
// src/configs/axios-client.ts
|
|
2209
2209
|
var axiosClient = {
|
|
2210
2210
|
init(config) {
|
|
2211
|
-
const localStorage2 = config
|
|
2212
|
-
const sessionStorage2 = config
|
|
2213
|
-
const db = config
|
|
2211
|
+
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
2212
|
+
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
2213
|
+
const db = config?.db;
|
|
2214
2214
|
let isRefreshing = false;
|
|
2215
2215
|
let failedQueue = [];
|
|
2216
2216
|
const processQueue = (error, token = null) => {
|
|
@@ -2229,16 +2229,19 @@ var axiosClient = {
|
|
|
2229
2229
|
timeout: 5e4,
|
|
2230
2230
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2231
2231
|
});
|
|
2232
|
-
instance.interceptors.request.use(
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2232
|
+
instance.interceptors.request.use(
|
|
2233
|
+
async (config2) => {
|
|
2234
|
+
const useRefreshToken = config2.useRefreshToken;
|
|
2235
|
+
const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
|
|
2236
|
+
if (token) {
|
|
2237
|
+
config2.headers["Authorization"] = "Bearer " + token;
|
|
2238
|
+
}
|
|
2239
|
+
return config2;
|
|
2240
|
+
},
|
|
2241
|
+
(error) => {
|
|
2242
|
+
Promise.reject(error);
|
|
2236
2243
|
}
|
|
2237
|
-
|
|
2238
|
-
const token = await getToken?.();
|
|
2239
|
-
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2240
|
-
return config2;
|
|
2241
|
-
}, Promise.reject);
|
|
2244
|
+
);
|
|
2242
2245
|
instance.interceptors.response.use(
|
|
2243
2246
|
(response) => {
|
|
2244
2247
|
return handleResponse(response);
|
package/dist/configs.mjs
CHANGED
|
@@ -2172,9 +2172,9 @@ var sessionStorageUtils = () => {
|
|
|
2172
2172
|
// src/configs/axios-client.ts
|
|
2173
2173
|
var axiosClient = {
|
|
2174
2174
|
init(config) {
|
|
2175
|
-
const localStorage2 = config
|
|
2176
|
-
const sessionStorage2 = config
|
|
2177
|
-
const db = config
|
|
2175
|
+
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
2176
|
+
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
2177
|
+
const db = config?.db;
|
|
2178
2178
|
let isRefreshing = false;
|
|
2179
2179
|
let failedQueue = [];
|
|
2180
2180
|
const processQueue = (error, token = null) => {
|
|
@@ -2193,16 +2193,19 @@ var axiosClient = {
|
|
|
2193
2193
|
timeout: 5e4,
|
|
2194
2194
|
paramsSerializer: (params) => new URLSearchParams(params).toString()
|
|
2195
2195
|
});
|
|
2196
|
-
instance.interceptors.request.use(
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2196
|
+
instance.interceptors.request.use(
|
|
2197
|
+
async (config2) => {
|
|
2198
|
+
const useRefreshToken = config2.useRefreshToken;
|
|
2199
|
+
const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
|
|
2200
|
+
if (token) {
|
|
2201
|
+
config2.headers["Authorization"] = "Bearer " + token;
|
|
2202
|
+
}
|
|
2203
|
+
return config2;
|
|
2204
|
+
},
|
|
2205
|
+
(error) => {
|
|
2206
|
+
Promise.reject(error);
|
|
2200
2207
|
}
|
|
2201
|
-
|
|
2202
|
-
const token = await getToken?.();
|
|
2203
|
-
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2204
|
-
return config2;
|
|
2205
|
-
}, Promise.reject);
|
|
2208
|
+
);
|
|
2206
2209
|
instance.interceptors.response.use(
|
|
2207
2210
|
(response) => {
|
|
2208
2211
|
return handleResponse(response);
|
package/dist/environment.d.mts
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { e as envStore } from './store-DvWeB4jm.mjs';
|
|
2
|
+
import '@reduxjs/toolkit';
|
|
3
|
+
import 'redux-thunk';
|
|
4
|
+
import 'redux';
|
|
5
|
+
import 'immer';
|
|
6
|
+
import 'react-redux';
|
|
7
|
+
|
|
8
|
+
declare const localStorageUtils: () => {
|
|
9
|
+
setToken: (access_token: string) => Promise<void>;
|
|
10
|
+
setRefreshToken: (refresh_token: string) => Promise<void>;
|
|
11
|
+
getAccessToken: () => Promise<string | null>;
|
|
12
|
+
getRefreshToken: () => Promise<string | null>;
|
|
13
|
+
clearToken: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
type LocalStorageUtilsType = ReturnType<typeof localStorageUtils>;
|
|
16
|
+
|
|
17
|
+
declare const sessionStorageUtils: () => {
|
|
18
|
+
getBrowserSession: () => Promise<string | null>;
|
|
19
|
+
};
|
|
20
|
+
type SessionStorageUtilsType = ReturnType<typeof sessionStorageUtils>;
|
|
21
|
+
|
|
22
|
+
type EnvStore = ReturnType<typeof envStore.getState>['env'];
|
|
23
|
+
declare function initEnv({ localStorageUtils, sessionStorageUtils, }: {
|
|
24
|
+
localStorageUtils?: LocalStorageUtilsType;
|
|
25
|
+
sessionStorageUtils?: SessionStorageUtilsType;
|
|
26
|
+
}): {
|
|
27
|
+
getEnvData: () => any;
|
|
28
|
+
setupEnv: (envConfig: EnvStore) => void;
|
|
29
|
+
setLangValue: (lang: string) => void;
|
|
30
|
+
setUidValue: (uid: number) => void;
|
|
31
|
+
setAllowCompaniesValue: (allowCompanies: number[]) => void;
|
|
32
|
+
setCompaniesValue: (companies: any[]) => void;
|
|
33
|
+
setDefaultCompanyValue: (company: any) => void;
|
|
34
|
+
setUserInfoValue: (user: any) => void;
|
|
35
35
|
};
|
|
36
|
+
declare function getEnv(): any;
|
|
36
37
|
|
|
37
|
-
export { getEnv,
|
|
38
|
+
export { type EnvStore, getEnv, initEnv };
|
package/dist/environment.d.ts
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { e as envStore } from './store-DvWeB4jm.js';
|
|
2
|
+
import '@reduxjs/toolkit';
|
|
3
|
+
import 'redux-thunk';
|
|
4
|
+
import 'redux';
|
|
5
|
+
import 'immer';
|
|
6
|
+
import 'react-redux';
|
|
7
|
+
|
|
8
|
+
declare const localStorageUtils: () => {
|
|
9
|
+
setToken: (access_token: string) => Promise<void>;
|
|
10
|
+
setRefreshToken: (refresh_token: string) => Promise<void>;
|
|
11
|
+
getAccessToken: () => Promise<string | null>;
|
|
12
|
+
getRefreshToken: () => Promise<string | null>;
|
|
13
|
+
clearToken: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
type LocalStorageUtilsType = ReturnType<typeof localStorageUtils>;
|
|
16
|
+
|
|
17
|
+
declare const sessionStorageUtils: () => {
|
|
18
|
+
getBrowserSession: () => Promise<string | null>;
|
|
19
|
+
};
|
|
20
|
+
type SessionStorageUtilsType = ReturnType<typeof sessionStorageUtils>;
|
|
21
|
+
|
|
22
|
+
type EnvStore = ReturnType<typeof envStore.getState>['env'];
|
|
23
|
+
declare function initEnv({ localStorageUtils, sessionStorageUtils, }: {
|
|
24
|
+
localStorageUtils?: LocalStorageUtilsType;
|
|
25
|
+
sessionStorageUtils?: SessionStorageUtilsType;
|
|
26
|
+
}): {
|
|
27
|
+
getEnvData: () => any;
|
|
28
|
+
setupEnv: (envConfig: EnvStore) => void;
|
|
29
|
+
setLangValue: (lang: string) => void;
|
|
30
|
+
setUidValue: (uid: number) => void;
|
|
31
|
+
setAllowCompaniesValue: (allowCompanies: number[]) => void;
|
|
32
|
+
setCompaniesValue: (companies: any[]) => void;
|
|
33
|
+
setDefaultCompanyValue: (company: any) => void;
|
|
34
|
+
setUserInfoValue: (user: any) => void;
|
|
35
35
|
};
|
|
36
|
+
declare function getEnv(): any;
|
|
36
37
|
|
|
37
|
-
export { getEnv,
|
|
38
|
+
export { type EnvStore, getEnv, initEnv };
|