@fctc/interface-logic 1.8.4 → 1.8.5
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/environment.d.mts +1 -14
- package/dist/environment.d.ts +1 -14
- package/dist/hooks.js +0 -3
- package/dist/hooks.mjs +0 -3
- package/dist/provider.d.mts +44 -1
- package/dist/provider.d.ts +44 -1
- package/dist/provider.js +127 -2
- package/dist/provider.mjs +124 -1
- package/dist/session-storage-ARp_lhTD.d.mts +15 -0
- package/dist/session-storage-ARp_lhTD.d.ts +15 -0
- package/package.json +1 -1
package/dist/environment.d.mts
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
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>;
|
|
2
|
+
import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.mjs';
|
|
16
3
|
|
|
17
4
|
declare global {
|
|
18
5
|
interface Global {
|
package/dist/environment.d.ts
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
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>;
|
|
2
|
+
import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.js';
|
|
16
3
|
|
|
17
4
|
declare global {
|
|
18
5
|
interface Global {
|
package/dist/hooks.js
CHANGED
|
@@ -5937,9 +5937,6 @@ var useVerifyTotp = () => {
|
|
|
5937
5937
|
});
|
|
5938
5938
|
};
|
|
5939
5939
|
var use_verify_totp_default = useVerifyTotp;
|
|
5940
|
-
|
|
5941
|
-
// src/hooks/env.ts
|
|
5942
|
-
var import_react2 = require("react");
|
|
5943
5940
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5944
5941
|
0 && (module.exports = {
|
|
5945
5942
|
useButton,
|
package/dist/hooks.mjs
CHANGED
|
@@ -5834,9 +5834,6 @@ var useVerifyTotp = () => {
|
|
|
5834
5834
|
});
|
|
5835
5835
|
};
|
|
5836
5836
|
var use_verify_totp_default = useVerifyTotp;
|
|
5837
|
-
|
|
5838
|
-
// src/hooks/env.ts
|
|
5839
|
-
import { useState as useState2, useCallback } from "react";
|
|
5840
5837
|
export {
|
|
5841
5838
|
use_button_default as useButton,
|
|
5842
5839
|
use_change_status_default as useChangeStatus,
|
package/dist/provider.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.mjs';
|
|
3
4
|
|
|
4
5
|
declare const MainProvider: ({ children }: {
|
|
5
6
|
children: ReactNode;
|
|
@@ -13,4 +14,46 @@ declare const VersionGate: ({ children }: {
|
|
|
13
14
|
children: ReactNode;
|
|
14
15
|
}) => react_jsx_runtime.JSX.Element | null;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
interface EnvConfig {
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
requests?: any;
|
|
20
|
+
context?: {
|
|
21
|
+
uid?: number | null;
|
|
22
|
+
allowed_company_ids?: number[];
|
|
23
|
+
lang?: string;
|
|
24
|
+
tz?: string;
|
|
25
|
+
};
|
|
26
|
+
defaultCompany?: {
|
|
27
|
+
id?: number | null;
|
|
28
|
+
logo?: string;
|
|
29
|
+
secondary_color?: string;
|
|
30
|
+
primary_color?: string;
|
|
31
|
+
};
|
|
32
|
+
config?: any;
|
|
33
|
+
companies?: any[];
|
|
34
|
+
user?: any;
|
|
35
|
+
db?: string;
|
|
36
|
+
refreshTokenEndpoint?: string;
|
|
37
|
+
localStorageUtils?: LocalStorageUtilsType;
|
|
38
|
+
sessionStorageUtils?: SessionStorageUtilsType;
|
|
39
|
+
envFile?: any;
|
|
40
|
+
}
|
|
41
|
+
declare function EnvProvider({ children, localStorageUtils: localStorageUtil, sessionStorageUtils: sessionStorageUtil, }: {
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
localStorageUtils?: LocalStorageUtilsType;
|
|
44
|
+
sessionStorageUtils?: SessionStorageUtilsType;
|
|
45
|
+
}): react_jsx_runtime.JSX.Element;
|
|
46
|
+
declare function useEnv(): {
|
|
47
|
+
env: EnvConfig;
|
|
48
|
+
setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
|
|
49
|
+
setUid: (uid: number) => void;
|
|
50
|
+
setLang: (lang: string) => void;
|
|
51
|
+
setAllowCompanies: (allowed_company_ids: number[]) => void;
|
|
52
|
+
setCompanies: (companies: any[]) => void;
|
|
53
|
+
setDefaultCompany: (defaultCompany: EnvConfig["defaultCompany"]) => void;
|
|
54
|
+
setUserInfo: (user: any) => void;
|
|
55
|
+
setConfig: (config: any) => void;
|
|
56
|
+
setEnvFile: (envFile: any) => void;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { EnvProvider, MainProvider, ReactQueryProvider, VersionGate, useEnv };
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
+
import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.js';
|
|
3
4
|
|
|
4
5
|
declare const MainProvider: ({ children }: {
|
|
5
6
|
children: ReactNode;
|
|
@@ -13,4 +14,46 @@ declare const VersionGate: ({ children }: {
|
|
|
13
14
|
children: ReactNode;
|
|
14
15
|
}) => react_jsx_runtime.JSX.Element | null;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
interface EnvConfig {
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
requests?: any;
|
|
20
|
+
context?: {
|
|
21
|
+
uid?: number | null;
|
|
22
|
+
allowed_company_ids?: number[];
|
|
23
|
+
lang?: string;
|
|
24
|
+
tz?: string;
|
|
25
|
+
};
|
|
26
|
+
defaultCompany?: {
|
|
27
|
+
id?: number | null;
|
|
28
|
+
logo?: string;
|
|
29
|
+
secondary_color?: string;
|
|
30
|
+
primary_color?: string;
|
|
31
|
+
};
|
|
32
|
+
config?: any;
|
|
33
|
+
companies?: any[];
|
|
34
|
+
user?: any;
|
|
35
|
+
db?: string;
|
|
36
|
+
refreshTokenEndpoint?: string;
|
|
37
|
+
localStorageUtils?: LocalStorageUtilsType;
|
|
38
|
+
sessionStorageUtils?: SessionStorageUtilsType;
|
|
39
|
+
envFile?: any;
|
|
40
|
+
}
|
|
41
|
+
declare function EnvProvider({ children, localStorageUtils: localStorageUtil, sessionStorageUtils: sessionStorageUtil, }: {
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
localStorageUtils?: LocalStorageUtilsType;
|
|
44
|
+
sessionStorageUtils?: SessionStorageUtilsType;
|
|
45
|
+
}): react_jsx_runtime.JSX.Element;
|
|
46
|
+
declare function useEnv(): {
|
|
47
|
+
env: EnvConfig;
|
|
48
|
+
setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
|
|
49
|
+
setUid: (uid: number) => void;
|
|
50
|
+
setLang: (lang: string) => void;
|
|
51
|
+
setAllowCompanies: (allowed_company_ids: number[]) => void;
|
|
52
|
+
setCompanies: (companies: any[]) => void;
|
|
53
|
+
setDefaultCompany: (defaultCompany: EnvConfig["defaultCompany"]) => void;
|
|
54
|
+
setUserInfo: (user: any) => void;
|
|
55
|
+
setConfig: (config: any) => void;
|
|
56
|
+
setEnvFile: (envFile: any) => void;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { EnvProvider, MainProvider, ReactQueryProvider, VersionGate, useEnv };
|
package/dist/provider.js
CHANGED
|
@@ -30,9 +30,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/provider.ts
|
|
31
31
|
var provider_exports = {};
|
|
32
32
|
__export(provider_exports, {
|
|
33
|
+
EnvProvider: () => EnvProvider,
|
|
33
34
|
MainProvider: () => MainProvider,
|
|
34
35
|
ReactQueryProvider: () => ReactQueryProvider,
|
|
35
|
-
VersionGate: () => VersionGate
|
|
36
|
+
VersionGate: () => VersionGate,
|
|
37
|
+
useEnv: () => useEnv
|
|
36
38
|
});
|
|
37
39
|
module.exports = __toCommonJS(provider_exports);
|
|
38
40
|
|
|
@@ -3591,10 +3593,133 @@ var VersionGate = ({ children }) => {
|
|
|
3591
3593
|
// src/provider/env-provider.tsx
|
|
3592
3594
|
var import_react3 = require("react");
|
|
3593
3595
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
3596
|
+
var initialEnvState = {
|
|
3597
|
+
baseUrl: "",
|
|
3598
|
+
requests: null,
|
|
3599
|
+
companies: [],
|
|
3600
|
+
user: {},
|
|
3601
|
+
config: null,
|
|
3602
|
+
envFile: null,
|
|
3603
|
+
defaultCompany: {
|
|
3604
|
+
id: null,
|
|
3605
|
+
logo: "",
|
|
3606
|
+
secondary_color: "",
|
|
3607
|
+
primary_color: ""
|
|
3608
|
+
},
|
|
3609
|
+
context: {
|
|
3610
|
+
uid: null,
|
|
3611
|
+
allowed_company_ids: [],
|
|
3612
|
+
lang: "vi_VN",
|
|
3613
|
+
tz: "Asia/Saigon"
|
|
3614
|
+
}
|
|
3615
|
+
};
|
|
3594
3616
|
var EnvContext = (0, import_react3.createContext)(null);
|
|
3617
|
+
function EnvProvider({
|
|
3618
|
+
children,
|
|
3619
|
+
localStorageUtils: localStorageUtil = localStorageUtils(),
|
|
3620
|
+
sessionStorageUtils: sessionStorageUtil = sessionStorageUtils()
|
|
3621
|
+
}) {
|
|
3622
|
+
const [env2, setEnvState] = (0, import_react3.useState)({
|
|
3623
|
+
...initialEnvState,
|
|
3624
|
+
localStorageUtils: localStorageUtil,
|
|
3625
|
+
sessionStorageUtils: sessionStorageUtil
|
|
3626
|
+
});
|
|
3627
|
+
const setupEnv = (0, import_react3.useCallback)(
|
|
3628
|
+
(envConfig) => {
|
|
3629
|
+
const updatedEnv = {
|
|
3630
|
+
...env2,
|
|
3631
|
+
...envConfig,
|
|
3632
|
+
localStorageUtils: localStorageUtil,
|
|
3633
|
+
sessionStorageUtils: sessionStorageUtil
|
|
3634
|
+
};
|
|
3635
|
+
const requests = axiosClient.init(updatedEnv);
|
|
3636
|
+
setEnvState({ ...updatedEnv, requests });
|
|
3637
|
+
return updatedEnv;
|
|
3638
|
+
},
|
|
3639
|
+
[env2, localStorageUtil, sessionStorageUtil]
|
|
3640
|
+
);
|
|
3641
|
+
const setUid2 = (0, import_react3.useCallback)((uid) => {
|
|
3642
|
+
setEnvState((prev) => ({
|
|
3643
|
+
...prev,
|
|
3644
|
+
context: { ...prev.context, uid }
|
|
3645
|
+
}));
|
|
3646
|
+
}, []);
|
|
3647
|
+
const setLang2 = (0, import_react3.useCallback)((lang) => {
|
|
3648
|
+
setEnvState((prev) => ({
|
|
3649
|
+
...prev,
|
|
3650
|
+
context: { ...prev.context, lang }
|
|
3651
|
+
}));
|
|
3652
|
+
}, []);
|
|
3653
|
+
const setAllowCompanies2 = (0, import_react3.useCallback)((allowed_company_ids) => {
|
|
3654
|
+
setEnvState((prev) => ({
|
|
3655
|
+
...prev,
|
|
3656
|
+
context: { ...prev.context, allowed_company_ids }
|
|
3657
|
+
}));
|
|
3658
|
+
}, []);
|
|
3659
|
+
const setCompanies2 = (0, import_react3.useCallback)((companies) => {
|
|
3660
|
+
setEnvState((prev) => ({
|
|
3661
|
+
...prev,
|
|
3662
|
+
companies
|
|
3663
|
+
}));
|
|
3664
|
+
}, []);
|
|
3665
|
+
const setDefaultCompany2 = (0, import_react3.useCallback)(
|
|
3666
|
+
(defaultCompany) => {
|
|
3667
|
+
setEnvState((prev) => ({
|
|
3668
|
+
...prev,
|
|
3669
|
+
defaultCompany
|
|
3670
|
+
}));
|
|
3671
|
+
},
|
|
3672
|
+
[]
|
|
3673
|
+
);
|
|
3674
|
+
const setUserInfo = (0, import_react3.useCallback)((user) => {
|
|
3675
|
+
setEnvState((prev) => ({
|
|
3676
|
+
...prev,
|
|
3677
|
+
user
|
|
3678
|
+
}));
|
|
3679
|
+
}, []);
|
|
3680
|
+
const setConfig2 = (0, import_react3.useCallback)((config) => {
|
|
3681
|
+
setEnvState((prev) => ({
|
|
3682
|
+
...prev,
|
|
3683
|
+
config
|
|
3684
|
+
}));
|
|
3685
|
+
}, []);
|
|
3686
|
+
const setEnvFile2 = (0, import_react3.useCallback)((envFile) => {
|
|
3687
|
+
setEnvState((prev) => ({
|
|
3688
|
+
...prev,
|
|
3689
|
+
envFile
|
|
3690
|
+
}));
|
|
3691
|
+
}, []);
|
|
3692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3693
|
+
EnvContext.Provider,
|
|
3694
|
+
{
|
|
3695
|
+
value: {
|
|
3696
|
+
env: env2,
|
|
3697
|
+
setupEnv,
|
|
3698
|
+
setUid: setUid2,
|
|
3699
|
+
setLang: setLang2,
|
|
3700
|
+
setAllowCompanies: setAllowCompanies2,
|
|
3701
|
+
setCompanies: setCompanies2,
|
|
3702
|
+
setDefaultCompany: setDefaultCompany2,
|
|
3703
|
+
setUserInfo,
|
|
3704
|
+
setConfig: setConfig2,
|
|
3705
|
+
setEnvFile: setEnvFile2
|
|
3706
|
+
},
|
|
3707
|
+
children
|
|
3708
|
+
}
|
|
3709
|
+
);
|
|
3710
|
+
}
|
|
3711
|
+
function useEnv() {
|
|
3712
|
+
const context = (0, import_react3.useContext)(EnvContext);
|
|
3713
|
+
if (!context) {
|
|
3714
|
+
throw new Error("useEnv must be used within an EnvProvider");
|
|
3715
|
+
}
|
|
3716
|
+
return context;
|
|
3717
|
+
}
|
|
3595
3718
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3596
3719
|
0 && (module.exports = {
|
|
3720
|
+
EnvProvider,
|
|
3597
3721
|
MainProvider,
|
|
3598
3722
|
ReactQueryProvider,
|
|
3599
|
-
VersionGate
|
|
3723
|
+
VersionGate,
|
|
3724
|
+
useEnv
|
|
3600
3725
|
});
|
package/dist/provider.mjs
CHANGED
|
@@ -3553,9 +3553,132 @@ var VersionGate = ({ children }) => {
|
|
|
3553
3553
|
// src/provider/env-provider.tsx
|
|
3554
3554
|
import { createContext, useContext, useState as useState3, useCallback } from "react";
|
|
3555
3555
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
3556
|
+
var initialEnvState = {
|
|
3557
|
+
baseUrl: "",
|
|
3558
|
+
requests: null,
|
|
3559
|
+
companies: [],
|
|
3560
|
+
user: {},
|
|
3561
|
+
config: null,
|
|
3562
|
+
envFile: null,
|
|
3563
|
+
defaultCompany: {
|
|
3564
|
+
id: null,
|
|
3565
|
+
logo: "",
|
|
3566
|
+
secondary_color: "",
|
|
3567
|
+
primary_color: ""
|
|
3568
|
+
},
|
|
3569
|
+
context: {
|
|
3570
|
+
uid: null,
|
|
3571
|
+
allowed_company_ids: [],
|
|
3572
|
+
lang: "vi_VN",
|
|
3573
|
+
tz: "Asia/Saigon"
|
|
3574
|
+
}
|
|
3575
|
+
};
|
|
3556
3576
|
var EnvContext = createContext(null);
|
|
3577
|
+
function EnvProvider({
|
|
3578
|
+
children,
|
|
3579
|
+
localStorageUtils: localStorageUtil = localStorageUtils(),
|
|
3580
|
+
sessionStorageUtils: sessionStorageUtil = sessionStorageUtils()
|
|
3581
|
+
}) {
|
|
3582
|
+
const [env2, setEnvState] = useState3({
|
|
3583
|
+
...initialEnvState,
|
|
3584
|
+
localStorageUtils: localStorageUtil,
|
|
3585
|
+
sessionStorageUtils: sessionStorageUtil
|
|
3586
|
+
});
|
|
3587
|
+
const setupEnv = useCallback(
|
|
3588
|
+
(envConfig) => {
|
|
3589
|
+
const updatedEnv = {
|
|
3590
|
+
...env2,
|
|
3591
|
+
...envConfig,
|
|
3592
|
+
localStorageUtils: localStorageUtil,
|
|
3593
|
+
sessionStorageUtils: sessionStorageUtil
|
|
3594
|
+
};
|
|
3595
|
+
const requests = axiosClient.init(updatedEnv);
|
|
3596
|
+
setEnvState({ ...updatedEnv, requests });
|
|
3597
|
+
return updatedEnv;
|
|
3598
|
+
},
|
|
3599
|
+
[env2, localStorageUtil, sessionStorageUtil]
|
|
3600
|
+
);
|
|
3601
|
+
const setUid2 = useCallback((uid) => {
|
|
3602
|
+
setEnvState((prev) => ({
|
|
3603
|
+
...prev,
|
|
3604
|
+
context: { ...prev.context, uid }
|
|
3605
|
+
}));
|
|
3606
|
+
}, []);
|
|
3607
|
+
const setLang2 = useCallback((lang) => {
|
|
3608
|
+
setEnvState((prev) => ({
|
|
3609
|
+
...prev,
|
|
3610
|
+
context: { ...prev.context, lang }
|
|
3611
|
+
}));
|
|
3612
|
+
}, []);
|
|
3613
|
+
const setAllowCompanies2 = useCallback((allowed_company_ids) => {
|
|
3614
|
+
setEnvState((prev) => ({
|
|
3615
|
+
...prev,
|
|
3616
|
+
context: { ...prev.context, allowed_company_ids }
|
|
3617
|
+
}));
|
|
3618
|
+
}, []);
|
|
3619
|
+
const setCompanies2 = useCallback((companies) => {
|
|
3620
|
+
setEnvState((prev) => ({
|
|
3621
|
+
...prev,
|
|
3622
|
+
companies
|
|
3623
|
+
}));
|
|
3624
|
+
}, []);
|
|
3625
|
+
const setDefaultCompany2 = useCallback(
|
|
3626
|
+
(defaultCompany) => {
|
|
3627
|
+
setEnvState((prev) => ({
|
|
3628
|
+
...prev,
|
|
3629
|
+
defaultCompany
|
|
3630
|
+
}));
|
|
3631
|
+
},
|
|
3632
|
+
[]
|
|
3633
|
+
);
|
|
3634
|
+
const setUserInfo = useCallback((user) => {
|
|
3635
|
+
setEnvState((prev) => ({
|
|
3636
|
+
...prev,
|
|
3637
|
+
user
|
|
3638
|
+
}));
|
|
3639
|
+
}, []);
|
|
3640
|
+
const setConfig2 = useCallback((config) => {
|
|
3641
|
+
setEnvState((prev) => ({
|
|
3642
|
+
...prev,
|
|
3643
|
+
config
|
|
3644
|
+
}));
|
|
3645
|
+
}, []);
|
|
3646
|
+
const setEnvFile2 = useCallback((envFile) => {
|
|
3647
|
+
setEnvState((prev) => ({
|
|
3648
|
+
...prev,
|
|
3649
|
+
envFile
|
|
3650
|
+
}));
|
|
3651
|
+
}, []);
|
|
3652
|
+
return /* @__PURE__ */ jsx5(
|
|
3653
|
+
EnvContext.Provider,
|
|
3654
|
+
{
|
|
3655
|
+
value: {
|
|
3656
|
+
env: env2,
|
|
3657
|
+
setupEnv,
|
|
3658
|
+
setUid: setUid2,
|
|
3659
|
+
setLang: setLang2,
|
|
3660
|
+
setAllowCompanies: setAllowCompanies2,
|
|
3661
|
+
setCompanies: setCompanies2,
|
|
3662
|
+
setDefaultCompany: setDefaultCompany2,
|
|
3663
|
+
setUserInfo,
|
|
3664
|
+
setConfig: setConfig2,
|
|
3665
|
+
setEnvFile: setEnvFile2
|
|
3666
|
+
},
|
|
3667
|
+
children
|
|
3668
|
+
}
|
|
3669
|
+
);
|
|
3670
|
+
}
|
|
3671
|
+
function useEnv() {
|
|
3672
|
+
const context = useContext(EnvContext);
|
|
3673
|
+
if (!context) {
|
|
3674
|
+
throw new Error("useEnv must be used within an EnvProvider");
|
|
3675
|
+
}
|
|
3676
|
+
return context;
|
|
3677
|
+
}
|
|
3557
3678
|
export {
|
|
3679
|
+
EnvProvider,
|
|
3558
3680
|
MainProvider,
|
|
3559
3681
|
ReactQueryProvider,
|
|
3560
|
-
VersionGate
|
|
3682
|
+
VersionGate,
|
|
3683
|
+
useEnv
|
|
3561
3684
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const localStorageUtils: () => {
|
|
2
|
+
setToken: (access_token: string) => Promise<void>;
|
|
3
|
+
setRefreshToken: (refresh_token: string) => Promise<void>;
|
|
4
|
+
getAccessToken: () => Promise<string | null>;
|
|
5
|
+
getRefreshToken: () => Promise<string | null>;
|
|
6
|
+
clearToken: () => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
type LocalStorageUtilsType = ReturnType<typeof localStorageUtils>;
|
|
9
|
+
|
|
10
|
+
declare const sessionStorageUtils: () => {
|
|
11
|
+
getBrowserSession: () => Promise<string | null>;
|
|
12
|
+
};
|
|
13
|
+
type SessionStorageUtilsType = ReturnType<typeof sessionStorageUtils>;
|
|
14
|
+
|
|
15
|
+
export type { LocalStorageUtilsType as L, SessionStorageUtilsType as S };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const localStorageUtils: () => {
|
|
2
|
+
setToken: (access_token: string) => Promise<void>;
|
|
3
|
+
setRefreshToken: (refresh_token: string) => Promise<void>;
|
|
4
|
+
getAccessToken: () => Promise<string | null>;
|
|
5
|
+
getRefreshToken: () => Promise<string | null>;
|
|
6
|
+
clearToken: () => Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
type LocalStorageUtilsType = ReturnType<typeof localStorageUtils>;
|
|
9
|
+
|
|
10
|
+
declare const sessionStorageUtils: () => {
|
|
11
|
+
getBrowserSession: () => Promise<string | null>;
|
|
12
|
+
};
|
|
13
|
+
type SessionStorageUtilsType = ReturnType<typeof sessionStorageUtils>;
|
|
14
|
+
|
|
15
|
+
export type { LocalStorageUtilsType as L, SessionStorageUtilsType as S };
|