aq-fe-framework 0.1.226 → 0.1.229
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/{chunk-EKVQH4CN.mjs → chunk-MXGYYDEO.mjs} +2 -2
- package/dist/{chunk-D34W6WLY.mjs → chunk-P5TKOHP7.mjs} +28 -27
- package/dist/components/index.mjs +2 -2
- package/dist/hooks/index.d.mts +3 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/modules-features/index.mjs +2 -2
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import {
|
2
2
|
baseAxios_default,
|
3
3
|
useQ_AQ_GetAQModule
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-P5TKOHP7.mjs";
|
5
5
|
import {
|
6
6
|
createGenericStore
|
7
7
|
} from "./chunk-Y3YGC5IH.mjs";
|
@@ -6898,7 +6898,7 @@ import { useRouter as useRouter3 } from "next/navigation";
|
|
6898
6898
|
|
6899
6899
|
// src/modules-features/authenticate/useS_authenticate.ts
|
6900
6900
|
var useStore3 = createGenericStore({
|
6901
|
-
initialState: { token: "", saveLogin: false },
|
6901
|
+
initialState: { token: "", saveLogin: false, username: "", password: "" },
|
6902
6902
|
storageKey: "useS_authenticate"
|
6903
6903
|
});
|
6904
6904
|
function useS_authenticate() {
|
@@ -23,12 +23,33 @@ function createBaseApi(baseUrl, axiosInstance) {
|
|
23
23
|
};
|
24
24
|
}
|
25
25
|
|
26
|
-
// src/
|
27
|
-
import
|
26
|
+
// src/api/config/baseAxios.ts
|
27
|
+
import axios from "axios";
|
28
|
+
var baseAxios = axios.create({
|
29
|
+
baseURL: ""
|
30
|
+
// server
|
31
|
+
// baseURL: process.env.NEXT_PUBLIC_API_LOCAL, // local debug
|
32
|
+
});
|
33
|
+
baseAxios.interceptors.request.use(
|
34
|
+
(config) => {
|
35
|
+
var _a, _b;
|
36
|
+
const tokenData = localStorage.getItem("useS_authenticate");
|
37
|
+
const state = JSON.parse(tokenData);
|
38
|
+
const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
|
39
|
+
if (token) {
|
40
|
+
config.headers.Authorization = `Bearer ${token}`;
|
41
|
+
}
|
42
|
+
return config;
|
43
|
+
},
|
44
|
+
(error) => {
|
45
|
+
return Promise.reject(error);
|
46
|
+
}
|
47
|
+
);
|
48
|
+
var baseAxios_default = baseAxios;
|
28
49
|
|
29
50
|
// src/hooks/custom-hooks/useLoadAxiosConfig.ts
|
30
51
|
import { useEffect } from "react";
|
31
|
-
var useLoadAxiosConfig = (axiosInstance) => {
|
52
|
+
var useLoadAxiosConfig = ({ axiosInstance = baseAxios_default }) => {
|
32
53
|
useEffect(() => {
|
33
54
|
(async () => {
|
34
55
|
try {
|
@@ -36,6 +57,7 @@ var useLoadAxiosConfig = (axiosInstance) => {
|
|
36
57
|
const config = await res.json();
|
37
58
|
if (config.baseURL) {
|
38
59
|
axiosInstance.defaults.baseURL = config.baseURL;
|
60
|
+
baseAxios_default.defaults.baseURL = config.baseURL;
|
39
61
|
console.log("\u2705 baseURL set to", config.baseURL);
|
40
62
|
}
|
41
63
|
} catch (err) {
|
@@ -45,6 +67,9 @@ var useLoadAxiosConfig = (axiosInstance) => {
|
|
45
67
|
}, [axiosInstance]);
|
46
68
|
};
|
47
69
|
|
70
|
+
// src/hooks/custom-hooks/useMutationAction.tsx
|
71
|
+
import { useQueryClient } from "@tanstack/react-query";
|
72
|
+
|
48
73
|
// src/hooks/custom-hooks/useMyReactMutation.ts
|
49
74
|
import { useMutation } from "@tanstack/react-query";
|
50
75
|
function useMyReactMutation({
|
@@ -78,30 +103,6 @@ function useMyReactQuery({
|
|
78
103
|
}, options));
|
79
104
|
}
|
80
105
|
|
81
|
-
// src/api/config/baseAxios.ts
|
82
|
-
import axios from "axios";
|
83
|
-
var baseAxios = axios.create({
|
84
|
-
baseURL: ""
|
85
|
-
// server
|
86
|
-
// baseURL: process.env.NEXT_PUBLIC_API_LOCAL, // local debug
|
87
|
-
});
|
88
|
-
baseAxios.interceptors.request.use(
|
89
|
-
(config) => {
|
90
|
-
var _a, _b;
|
91
|
-
const tokenData = localStorage.getItem("useS_authenticate");
|
92
|
-
const state = JSON.parse(tokenData);
|
93
|
-
const token = (_b = (_a = state == null ? void 0 : state.state) == null ? void 0 : _a.state) == null ? void 0 : _b.token;
|
94
|
-
if (token) {
|
95
|
-
config.headers.Authorization = `Bearer ${token}`;
|
96
|
-
}
|
97
|
-
return config;
|
98
|
-
},
|
99
|
-
(error) => {
|
100
|
-
return Promise.reject(error);
|
101
|
-
}
|
102
|
-
);
|
103
|
-
var baseAxios_default = baseAxios;
|
104
|
-
|
105
106
|
// src/hooks/query/AQ/useQ_AQ_GetAQModule.ts
|
106
107
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
107
108
|
function useQ_AQ_GetAQModule() {
|
@@ -65,8 +65,8 @@ import {
|
|
65
65
|
useS_BasicAppShell,
|
66
66
|
useS_ButtonImport,
|
67
67
|
utils_layout_getItemsWithoutLinks
|
68
|
-
} from "../chunk-
|
69
|
-
import "../chunk-
|
68
|
+
} from "../chunk-MXGYYDEO.mjs";
|
69
|
+
import "../chunk-P5TKOHP7.mjs";
|
70
70
|
import "../chunk-Y3YGC5IH.mjs";
|
71
71
|
import "../chunk-5U2JSHSJ.mjs";
|
72
72
|
import "../chunk-7ZCOFATU.mjs";
|
package/dist/hooks/index.d.mts
CHANGED
@@ -19,7 +19,9 @@ declare function createBaseApi<T>(baseUrl: string, axiosInstance: AxiosInstance)
|
|
19
19
|
delete: (id: number) => Promise<axios.AxiosResponse<any, any>>;
|
20
20
|
};
|
21
21
|
|
22
|
-
declare const useLoadAxiosConfig: (axiosInstance:
|
22
|
+
declare const useLoadAxiosConfig: ({ axiosInstance }: {
|
23
|
+
axiosInstance?: AxiosInstance;
|
24
|
+
}) => void;
|
23
25
|
|
24
26
|
interface MyReactMutationProps<IReq, IRes> {
|
25
27
|
axiosFn: (variables: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>>;
|
package/dist/hooks/index.mjs
CHANGED
@@ -25,12 +25,12 @@ import {
|
|
25
25
|
useS_BasicAppShell,
|
26
26
|
useS_authenticate,
|
27
27
|
utils_layout_getItemsWithoutLinks
|
28
|
-
} from "../chunk-
|
28
|
+
} from "../chunk-MXGYYDEO.mjs";
|
29
29
|
import {
|
30
30
|
baseAxios_default,
|
31
31
|
useQ_AQ_GetAQModule,
|
32
32
|
useQ_SkillCenter_GetAll
|
33
|
-
} from "../chunk-
|
33
|
+
} from "../chunk-P5TKOHP7.mjs";
|
34
34
|
import {
|
35
35
|
createGenericStore
|
36
36
|
} from "../chunk-Y3YGC5IH.mjs";
|