@inzombieland/nuxt-common 1.18.43 → 1.18.45
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/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/api/index.d.ts +37 -2
- package/dist/runtime/api/user-actions.d.ts +2 -98
- package/dist/runtime/api/user-actions.mjs +2 -84
- package/dist/runtime/composables/use-user-actions.d.ts +97 -2
- package/dist/runtime/composables/use-user-actions.mjs +1 -1
- package/dist/runtime/packages/core/AppProvider.vue +1 -3
- package/dist/runtime/packages/core/index.d.ts +111 -6
- package/dist/runtime/packages/core/package.json +1 -1
- package/dist/runtime/packages/core/user-actions.d.ts +37 -2
- package/dist/runtime/packages/core/user-actions.mjs +58 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { defineNuxtModule, createResolver, addServerHandler, addImportsDir, addPlugin, addComponent } from '@nuxt/kit';
|
|
3
3
|
|
|
4
4
|
const name = "@inzombieland/nuxt-common";
|
|
5
|
-
const version = "1.18.
|
|
5
|
+
const version = "1.18.45";
|
|
6
6
|
|
|
7
7
|
const module = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
@@ -20,11 +20,36 @@ declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/
|
|
|
20
20
|
signIn: (body: Record<string, any>) => Promise<import("src/runtime/packages/core/types").GetUserResponse | {
|
|
21
21
|
key: string;
|
|
22
22
|
}>;
|
|
23
|
+
signInByCodeSendCode: (body: Record<string, any>) => Promise<{
|
|
24
|
+
key: string;
|
|
25
|
+
}>;
|
|
23
26
|
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("src/runtime/packages/core/types").GetUserResponse>;
|
|
27
|
+
signUp: (body: Record<string, any>) => Promise<{
|
|
28
|
+
key: string;
|
|
29
|
+
}>;
|
|
30
|
+
confirmEmail: (body: {
|
|
31
|
+
key: string;
|
|
32
|
+
code: string;
|
|
33
|
+
}) => Promise<{}>;
|
|
34
|
+
resendActivationEmail: (body: {
|
|
35
|
+
email: string;
|
|
36
|
+
}) => Promise<{
|
|
37
|
+
key: string;
|
|
38
|
+
}>;
|
|
24
39
|
logout: () => Promise<void>;
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
recovery: (body: Record<string, any>) => Promise<{
|
|
41
|
+
key: string;
|
|
42
|
+
}>;
|
|
43
|
+
confirmRecovery: (body: {
|
|
44
|
+
key: string;
|
|
45
|
+
code: string;
|
|
46
|
+
}) => Promise<{
|
|
47
|
+
key: string;
|
|
27
48
|
}>;
|
|
49
|
+
resetPassword: (body: {
|
|
50
|
+
key: string;
|
|
51
|
+
password: string;
|
|
52
|
+
}) => Promise<{}>;
|
|
28
53
|
changeName: (body: {
|
|
29
54
|
firstName: string;
|
|
30
55
|
lastName: string;
|
|
@@ -72,10 +97,20 @@ declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/
|
|
|
72
97
|
}) => Promise<void>;
|
|
73
98
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
74
99
|
deleteAvatar: () => Promise<void>;
|
|
100
|
+
fetchActiveSessions: () => Promise<{
|
|
101
|
+
sessions: import("src/runtime/packages/core/types").ActiveSession[];
|
|
102
|
+
}>;
|
|
75
103
|
logoutActiveSession: (body: {
|
|
76
104
|
sessionId: string;
|
|
77
105
|
visitorId: string;
|
|
78
106
|
}) => Promise<any>;
|
|
79
107
|
logoutFromAllActiveSessions: () => Promise<any>;
|
|
108
|
+
deleteAccount: () => Promise<{
|
|
109
|
+
key: string;
|
|
110
|
+
}>;
|
|
111
|
+
confirmDeleteAccount: (body: {
|
|
112
|
+
key: string;
|
|
113
|
+
code: string;
|
|
114
|
+
}) => Promise<void>;
|
|
80
115
|
};
|
|
81
116
|
export { fetch, getUser, useApiFetch, userActions };
|
|
@@ -1,98 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
key: string;
|
|
4
|
-
}>;
|
|
5
|
-
export declare const signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("src/runtime/packages/core/types").GetUserResponse>;
|
|
6
|
-
export declare const logout: () => Promise<void>;
|
|
7
|
-
export declare const changeName: (body: {
|
|
8
|
-
firstName: string;
|
|
9
|
-
lastName: string;
|
|
10
|
-
middleName: string;
|
|
11
|
-
}) => Promise<void>;
|
|
12
|
-
export declare const changeBirthday: (body: {
|
|
13
|
-
day?: number;
|
|
14
|
-
month?: number;
|
|
15
|
-
year?: number;
|
|
16
|
-
}) => Promise<void>;
|
|
17
|
-
export declare const changeGender: (body: {
|
|
18
|
-
gender: "" | "male" | "female";
|
|
19
|
-
}) => Promise<void>;
|
|
20
|
-
export declare const changePassword: (body: {
|
|
21
|
-
password: string;
|
|
22
|
-
newPassword: string;
|
|
23
|
-
}) => Promise<{
|
|
24
|
-
key: string;
|
|
25
|
-
}>;
|
|
26
|
-
export declare const confirmPasswordChange: (body: {
|
|
27
|
-
key: string;
|
|
28
|
-
code: string;
|
|
29
|
-
newPassword?: string;
|
|
30
|
-
}) => Promise<void>;
|
|
31
|
-
export declare const changeEmail: (body: {
|
|
32
|
-
email: string;
|
|
33
|
-
password: string;
|
|
34
|
-
}) => Promise<{
|
|
35
|
-
key: string;
|
|
36
|
-
}>;
|
|
37
|
-
export declare const confirmEmailChange: (body: {
|
|
38
|
-
key: string;
|
|
39
|
-
code: string;
|
|
40
|
-
email?: string;
|
|
41
|
-
}) => Promise<void>;
|
|
42
|
-
export declare const changePhone: (body: {
|
|
43
|
-
phone: string;
|
|
44
|
-
password: string;
|
|
45
|
-
}) => Promise<void>;
|
|
46
|
-
export declare const changeAvatar: (body: FormData) => Promise<void>;
|
|
47
|
-
export declare const deleteAvatar: () => Promise<void>;
|
|
48
|
-
export declare const logoutActiveSession: (body: {
|
|
49
|
-
sessionId: string;
|
|
50
|
-
visitorId: string;
|
|
51
|
-
}) => Promise<any>;
|
|
52
|
-
export declare const logoutFromAllActiveSessions: () => Promise<any>;
|
|
53
|
-
export declare const signInByCodeSendCode: (body: {
|
|
54
|
-
username: string;
|
|
55
|
-
}) => Promise<{
|
|
56
|
-
key: string;
|
|
57
|
-
}>;
|
|
58
|
-
export declare const signUp: (body: {
|
|
59
|
-
email: string;
|
|
60
|
-
password: string;
|
|
61
|
-
passwordConfirm: string;
|
|
62
|
-
}) => Promise<{
|
|
63
|
-
key: string;
|
|
64
|
-
}>;
|
|
65
|
-
export declare const confirmEmail: (body: {
|
|
66
|
-
key: string;
|
|
67
|
-
code: string;
|
|
68
|
-
}) => Promise<{}>;
|
|
69
|
-
export declare const resendActivationEmail: (body: {
|
|
70
|
-
email: string;
|
|
71
|
-
}) => Promise<{
|
|
72
|
-
key: string;
|
|
73
|
-
}>;
|
|
74
|
-
export declare const recovery: (body: {
|
|
75
|
-
email: string;
|
|
76
|
-
}) => Promise<{
|
|
77
|
-
key: string;
|
|
78
|
-
}>;
|
|
79
|
-
export declare const confirmRecovery: (body: {
|
|
80
|
-
key: string;
|
|
81
|
-
code: string;
|
|
82
|
-
}) => Promise<{
|
|
83
|
-
key: string;
|
|
84
|
-
}>;
|
|
85
|
-
export declare const resetPassword: (body: {
|
|
86
|
-
key: string;
|
|
87
|
-
password: string;
|
|
88
|
-
}) => Promise<{}>;
|
|
89
|
-
export declare const fetchActiveSessions: () => Promise<{
|
|
90
|
-
sessions: ActiveSession[];
|
|
91
|
-
}>;
|
|
92
|
-
export declare const deleteAccount: () => Promise<{
|
|
93
|
-
key: string;
|
|
94
|
-
}>;
|
|
95
|
-
export declare const confirmDeleteAccount: (body: {
|
|
96
|
-
key: string;
|
|
97
|
-
code: string;
|
|
98
|
-
}) => Promise<void>;
|
|
1
|
+
import { userActions } from "./index";
|
|
2
|
+
export default userActions;
|
|
@@ -1,84 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { fetch, userActions } from "./index.mjs";
|
|
4
|
-
export const signIn = userActions.signIn;
|
|
5
|
-
export const signInByCodeVerifyCode = userActions.signInByCodeVerifyCode;
|
|
6
|
-
export const logout = userActions.logout;
|
|
7
|
-
export const changeName = userActions.changeName;
|
|
8
|
-
export const changeBirthday = userActions.changeBirthday;
|
|
9
|
-
export const changeGender = userActions.changeGender;
|
|
10
|
-
export const changePassword = userActions.changePassword;
|
|
11
|
-
export const confirmPasswordChange = userActions.confirmPasswordChange;
|
|
12
|
-
export const changeEmail = userActions.changeEmail;
|
|
13
|
-
export const confirmEmailChange = userActions.confirmEmailChange;
|
|
14
|
-
export const changePhone = userActions.changePhone;
|
|
15
|
-
export const changeAvatar = userActions.changeAvatar;
|
|
16
|
-
export const deleteAvatar = userActions.deleteAvatar;
|
|
17
|
-
export const logoutActiveSession = userActions.logoutActiveSession;
|
|
18
|
-
export const logoutFromAllActiveSessions = userActions.logoutFromAllActiveSessions;
|
|
19
|
-
export const signInByCodeSendCode = async (body) => {
|
|
20
|
-
return await fetch("/account/0/signinbycode/sendcode", {
|
|
21
|
-
body,
|
|
22
|
-
method: "POST",
|
|
23
|
-
baseURL: "/",
|
|
24
|
-
headers: useRequestHeaders(["cookie"])
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
export const signUp = async (body) => {
|
|
28
|
-
return await fetch("/account/0/signup", {
|
|
29
|
-
body,
|
|
30
|
-
method: "POST",
|
|
31
|
-
baseURL: "/",
|
|
32
|
-
headers: useRequestHeaders(["cookie"])
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
export const confirmEmail = async (body) => {
|
|
36
|
-
return await fetch("/account/0/signup", {
|
|
37
|
-
body,
|
|
38
|
-
method: "PUT",
|
|
39
|
-
baseURL: "/",
|
|
40
|
-
headers: useRequestHeaders(["cookie"])
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
export const resendActivationEmail = async (body) => {
|
|
44
|
-
return await fetch("/account/0/signup", {
|
|
45
|
-
body,
|
|
46
|
-
method: "PATCH",
|
|
47
|
-
baseURL: "/",
|
|
48
|
-
headers: useRequestHeaders(["cookie"])
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
export const recovery = async (body) => {
|
|
52
|
-
return await fetch("/account/0/recovery", {
|
|
53
|
-
body,
|
|
54
|
-
method: "POST",
|
|
55
|
-
baseURL: "/",
|
|
56
|
-
headers: useRequestHeaders(["cookie"])
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
export const confirmRecovery = async (body) => {
|
|
60
|
-
return await fetch("/account/0/recovery", {
|
|
61
|
-
body,
|
|
62
|
-
method: "PATCH",
|
|
63
|
-
baseURL: "/",
|
|
64
|
-
headers: useRequestHeaders(["cookie"])
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
export const resetPassword = async (body) => {
|
|
68
|
-
return await fetch("/account/0/recovery", {
|
|
69
|
-
body,
|
|
70
|
-
method: "PUT",
|
|
71
|
-
baseURL: "/",
|
|
72
|
-
headers: useRequestHeaders(["cookie"])
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
export const fetchActiveSessions = async () => {
|
|
76
|
-
return await fetch("/account/1/sessions");
|
|
77
|
-
};
|
|
78
|
-
export const deleteAccount = async () => {
|
|
79
|
-
return await fetch("/account/1/delete", { method: "POST" });
|
|
80
|
-
};
|
|
81
|
-
export const confirmDeleteAccount = async (body) => {
|
|
82
|
-
await fetch("/account/1/delete", { body, method: "PUT" });
|
|
83
|
-
flush();
|
|
84
|
-
};
|
|
1
|
+
import { userActions } from "./index.mjs";
|
|
2
|
+
export default userActions;
|
|
@@ -1,2 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const useUserActions: () => {
|
|
2
|
+
signIn: (body: Record<string, any>) => Promise<import("src/runtime/packages/core").GetUserResponse | {
|
|
3
|
+
key: string;
|
|
4
|
+
}>;
|
|
5
|
+
signInByCodeSendCode: (body: Record<string, any>) => Promise<{
|
|
6
|
+
key: string;
|
|
7
|
+
}>;
|
|
8
|
+
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("src/runtime/packages/core").GetUserResponse>;
|
|
9
|
+
signUp: (body: Record<string, any>) => Promise<{
|
|
10
|
+
key: string;
|
|
11
|
+
}>;
|
|
12
|
+
confirmEmail: (body: {
|
|
13
|
+
key: string;
|
|
14
|
+
code: string;
|
|
15
|
+
}) => Promise<{}>;
|
|
16
|
+
resendActivationEmail: (body: {
|
|
17
|
+
email: string;
|
|
18
|
+
}) => Promise<{
|
|
19
|
+
key: string;
|
|
20
|
+
}>;
|
|
21
|
+
logout: () => Promise<void>;
|
|
22
|
+
recovery: (body: Record<string, any>) => Promise<{
|
|
23
|
+
key: string;
|
|
24
|
+
}>;
|
|
25
|
+
confirmRecovery: (body: {
|
|
26
|
+
key: string;
|
|
27
|
+
code: string;
|
|
28
|
+
}) => Promise<{
|
|
29
|
+
key: string;
|
|
30
|
+
}>;
|
|
31
|
+
resetPassword: (body: {
|
|
32
|
+
key: string;
|
|
33
|
+
password: string;
|
|
34
|
+
}) => Promise<{}>;
|
|
35
|
+
changeName: (body: {
|
|
36
|
+
firstName: string;
|
|
37
|
+
lastName: string;
|
|
38
|
+
middleName: string;
|
|
39
|
+
}) => Promise<void>;
|
|
40
|
+
changeBirthday: (body: {
|
|
41
|
+
day?: number;
|
|
42
|
+
month?: number;
|
|
43
|
+
year?: number;
|
|
44
|
+
}) => Promise<void>;
|
|
45
|
+
changeGender: (body: {
|
|
46
|
+
gender: "" | "male" | "female";
|
|
47
|
+
}) => Promise<void>;
|
|
48
|
+
changePassword: (body: {
|
|
49
|
+
password: string;
|
|
50
|
+
newPassword: string;
|
|
51
|
+
}) => Promise<{
|
|
52
|
+
key: string;
|
|
53
|
+
}>;
|
|
54
|
+
confirmPasswordChange: (body: {
|
|
55
|
+
key: string;
|
|
56
|
+
code: string;
|
|
57
|
+
newPassword?: string;
|
|
58
|
+
}) => Promise<void>;
|
|
59
|
+
changeEmail: (body: {
|
|
60
|
+
email: string;
|
|
61
|
+
password: string;
|
|
62
|
+
}) => Promise<{
|
|
63
|
+
key: string;
|
|
64
|
+
}>;
|
|
65
|
+
confirmEmailChange: (body: {
|
|
66
|
+
key: string;
|
|
67
|
+
code: string;
|
|
68
|
+
email?: string;
|
|
69
|
+
}) => Promise<void>;
|
|
70
|
+
changePhone: (body: {
|
|
71
|
+
phone: string;
|
|
72
|
+
password: string;
|
|
73
|
+
}) => Promise<void>;
|
|
74
|
+
changeTheme: (body: {
|
|
75
|
+
theme: "light" | "dark";
|
|
76
|
+
}) => Promise<void>;
|
|
77
|
+
changeLocale: (body: {
|
|
78
|
+
locale: string;
|
|
79
|
+
}) => Promise<void>;
|
|
80
|
+
changeAvatar: (body: FormData) => Promise<void>;
|
|
81
|
+
deleteAvatar: () => Promise<void>;
|
|
82
|
+
fetchActiveSessions: () => Promise<{
|
|
83
|
+
sessions: import("src/runtime/packages/core").ActiveSession[];
|
|
84
|
+
}>;
|
|
85
|
+
logoutActiveSession: (body: {
|
|
86
|
+
sessionId: string;
|
|
87
|
+
visitorId: string;
|
|
88
|
+
}) => Promise<any>;
|
|
89
|
+
logoutFromAllActiveSessions: () => Promise<any>;
|
|
90
|
+
deleteAccount: () => Promise<{
|
|
91
|
+
key: string;
|
|
92
|
+
}>;
|
|
93
|
+
confirmDeleteAccount: (body: {
|
|
94
|
+
key: string;
|
|
95
|
+
code: string;
|
|
96
|
+
}) => Promise<void>;
|
|
97
|
+
};
|
|
@@ -5,7 +5,7 @@ import VantConfigProvider from "./vant"
|
|
|
5
5
|
import { useThemeMode, useUser } from "./index"
|
|
6
6
|
import type { ConfigProviderTheme } from "vant"
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
defineProps({ vantEnabled: { type: Boolean, default: true } })
|
|
9
9
|
|
|
10
10
|
const theme = useThemeMode()
|
|
11
11
|
const user = useUser()
|
|
@@ -17,8 +17,6 @@ onBeforeMount(() => {
|
|
|
17
17
|
|
|
18
18
|
onMounted(() => {
|
|
19
19
|
appLoading.value = false
|
|
20
|
-
// eslint-disable-next-line no-console
|
|
21
|
-
console.log("vant enabled", props.vantEnabled)
|
|
22
20
|
})
|
|
23
21
|
</script>
|
|
24
22
|
|
|
@@ -12,11 +12,36 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
|
|
|
12
12
|
signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
|
|
13
13
|
key: string;
|
|
14
14
|
}>;
|
|
15
|
+
signInByCodeSendCode: (body: Record<string, any>) => Promise<{
|
|
16
|
+
key: string;
|
|
17
|
+
}>;
|
|
15
18
|
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
|
|
19
|
+
signUp: (body: Record<string, any>) => Promise<{
|
|
20
|
+
key: string;
|
|
21
|
+
}>;
|
|
22
|
+
confirmEmail: (body: {
|
|
23
|
+
key: string;
|
|
24
|
+
code: string;
|
|
25
|
+
}) => Promise<{}>;
|
|
26
|
+
resendActivationEmail: (body: {
|
|
27
|
+
email: string;
|
|
28
|
+
}) => Promise<{
|
|
29
|
+
key: string;
|
|
30
|
+
}>;
|
|
16
31
|
logout: () => Promise<void>;
|
|
17
|
-
|
|
18
|
-
|
|
32
|
+
recovery: (body: Record<string, any>) => Promise<{
|
|
33
|
+
key: string;
|
|
34
|
+
}>;
|
|
35
|
+
confirmRecovery: (body: {
|
|
36
|
+
key: string;
|
|
37
|
+
code: string;
|
|
38
|
+
}) => Promise<{
|
|
39
|
+
key: string;
|
|
19
40
|
}>;
|
|
41
|
+
resetPassword: (body: {
|
|
42
|
+
key: string;
|
|
43
|
+
password: string;
|
|
44
|
+
}) => Promise<{}>;
|
|
20
45
|
changeName: (body: {
|
|
21
46
|
firstName: string;
|
|
22
47
|
lastName: string;
|
|
@@ -64,22 +89,57 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
|
|
|
64
89
|
}) => Promise<void>;
|
|
65
90
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
66
91
|
deleteAvatar: () => Promise<void>;
|
|
92
|
+
fetchActiveSessions: () => Promise<{
|
|
93
|
+
sessions: import("./types").ActiveSession[];
|
|
94
|
+
}>;
|
|
67
95
|
logoutActiveSession: (body: {
|
|
68
96
|
sessionId: string;
|
|
69
97
|
visitorId: string;
|
|
70
98
|
}) => Promise<any>;
|
|
71
99
|
logoutFromAllActiveSessions: () => Promise<any>;
|
|
100
|
+
deleteAccount: () => Promise<{
|
|
101
|
+
key: string;
|
|
102
|
+
}>;
|
|
103
|
+
confirmDeleteAccount: (body: {
|
|
104
|
+
key: string;
|
|
105
|
+
code: string;
|
|
106
|
+
}) => Promise<void>;
|
|
72
107
|
};
|
|
73
108
|
};
|
|
74
109
|
export declare const useUserActions: () => Ref<{
|
|
75
110
|
signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
|
|
76
111
|
key: string;
|
|
77
112
|
}>;
|
|
113
|
+
signInByCodeSendCode: (body: Record<string, any>) => Promise<{
|
|
114
|
+
key: string;
|
|
115
|
+
}>;
|
|
78
116
|
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
|
|
117
|
+
signUp: (body: Record<string, any>) => Promise<{
|
|
118
|
+
key: string;
|
|
119
|
+
}>;
|
|
120
|
+
confirmEmail: (body: {
|
|
121
|
+
key: string;
|
|
122
|
+
code: string;
|
|
123
|
+
}) => Promise<{}>;
|
|
124
|
+
resendActivationEmail: (body: {
|
|
125
|
+
email: string;
|
|
126
|
+
}) => Promise<{
|
|
127
|
+
key: string;
|
|
128
|
+
}>;
|
|
79
129
|
logout: () => Promise<void>;
|
|
80
|
-
|
|
81
|
-
|
|
130
|
+
recovery: (body: Record<string, any>) => Promise<{
|
|
131
|
+
key: string;
|
|
132
|
+
}>;
|
|
133
|
+
confirmRecovery: (body: {
|
|
134
|
+
key: string;
|
|
135
|
+
code: string;
|
|
136
|
+
}) => Promise<{
|
|
137
|
+
key: string;
|
|
82
138
|
}>;
|
|
139
|
+
resetPassword: (body: {
|
|
140
|
+
key: string;
|
|
141
|
+
password: string;
|
|
142
|
+
}) => Promise<{}>;
|
|
83
143
|
changeName: (body: {
|
|
84
144
|
firstName: string;
|
|
85
145
|
lastName: string;
|
|
@@ -127,20 +187,55 @@ export declare const useUserActions: () => Ref<{
|
|
|
127
187
|
}) => Promise<void>;
|
|
128
188
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
129
189
|
deleteAvatar: () => Promise<void>;
|
|
190
|
+
fetchActiveSessions: () => Promise<{
|
|
191
|
+
sessions: import("./types").ActiveSession[];
|
|
192
|
+
}>;
|
|
130
193
|
logoutActiveSession: (body: {
|
|
131
194
|
sessionId: string;
|
|
132
195
|
visitorId: string;
|
|
133
196
|
}) => Promise<any>;
|
|
134
197
|
logoutFromAllActiveSessions: () => Promise<any>;
|
|
198
|
+
deleteAccount: () => Promise<{
|
|
199
|
+
key: string;
|
|
200
|
+
}>;
|
|
201
|
+
confirmDeleteAccount: (body: {
|
|
202
|
+
key: string;
|
|
203
|
+
code: string;
|
|
204
|
+
}) => Promise<void>;
|
|
135
205
|
}, {
|
|
136
206
|
signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
|
|
137
207
|
key: string;
|
|
138
208
|
}>;
|
|
209
|
+
signInByCodeSendCode: (body: Record<string, any>) => Promise<{
|
|
210
|
+
key: string;
|
|
211
|
+
}>;
|
|
139
212
|
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
|
|
213
|
+
signUp: (body: Record<string, any>) => Promise<{
|
|
214
|
+
key: string;
|
|
215
|
+
}>;
|
|
216
|
+
confirmEmail: (body: {
|
|
217
|
+
key: string;
|
|
218
|
+
code: string;
|
|
219
|
+
}) => Promise<{}>;
|
|
220
|
+
resendActivationEmail: (body: {
|
|
221
|
+
email: string;
|
|
222
|
+
}) => Promise<{
|
|
223
|
+
key: string;
|
|
224
|
+
}>;
|
|
140
225
|
logout: () => Promise<void>;
|
|
141
|
-
|
|
142
|
-
|
|
226
|
+
recovery: (body: Record<string, any>) => Promise<{
|
|
227
|
+
key: string;
|
|
228
|
+
}>;
|
|
229
|
+
confirmRecovery: (body: {
|
|
230
|
+
key: string;
|
|
231
|
+
code: string;
|
|
232
|
+
}) => Promise<{
|
|
233
|
+
key: string;
|
|
143
234
|
}>;
|
|
235
|
+
resetPassword: (body: {
|
|
236
|
+
key: string;
|
|
237
|
+
password: string;
|
|
238
|
+
}) => Promise<{}>;
|
|
144
239
|
changeName: (body: {
|
|
145
240
|
firstName: string;
|
|
146
241
|
lastName: string;
|
|
@@ -188,9 +283,19 @@ export declare const useUserActions: () => Ref<{
|
|
|
188
283
|
}) => Promise<void>;
|
|
189
284
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
190
285
|
deleteAvatar: () => Promise<void>;
|
|
286
|
+
fetchActiveSessions: () => Promise<{
|
|
287
|
+
sessions: import("./types").ActiveSession[];
|
|
288
|
+
}>;
|
|
191
289
|
logoutActiveSession: (body: {
|
|
192
290
|
sessionId: string;
|
|
193
291
|
visitorId: string;
|
|
194
292
|
}) => Promise<any>;
|
|
195
293
|
logoutFromAllActiveSessions: () => Promise<any>;
|
|
294
|
+
deleteAccount: () => Promise<{
|
|
295
|
+
key: string;
|
|
296
|
+
}>;
|
|
297
|
+
confirmDeleteAccount: (body: {
|
|
298
|
+
key: string;
|
|
299
|
+
code: string;
|
|
300
|
+
}) => Promise<void>;
|
|
196
301
|
}> | undefined;
|
|
@@ -4,11 +4,36 @@ export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, g
|
|
|
4
4
|
signIn: (body: Record<string, any>) => Promise<GetUserResponse | {
|
|
5
5
|
key: string;
|
|
6
6
|
}>;
|
|
7
|
+
signInByCodeSendCode: (body: Record<string, any>) => Promise<{
|
|
8
|
+
key: string;
|
|
9
|
+
}>;
|
|
7
10
|
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<GetUserResponse>;
|
|
11
|
+
signUp: (body: Record<string, any>) => Promise<{
|
|
12
|
+
key: string;
|
|
13
|
+
}>;
|
|
14
|
+
confirmEmail: (body: {
|
|
15
|
+
key: string;
|
|
16
|
+
code: string;
|
|
17
|
+
}) => Promise<{}>;
|
|
18
|
+
resendActivationEmail: (body: {
|
|
19
|
+
email: string;
|
|
20
|
+
}) => Promise<{
|
|
21
|
+
key: string;
|
|
22
|
+
}>;
|
|
8
23
|
logout: () => Promise<void>;
|
|
9
|
-
|
|
10
|
-
|
|
24
|
+
recovery: (body: Record<string, any>) => Promise<{
|
|
25
|
+
key: string;
|
|
26
|
+
}>;
|
|
27
|
+
confirmRecovery: (body: {
|
|
28
|
+
key: string;
|
|
29
|
+
code: string;
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
key: string;
|
|
11
32
|
}>;
|
|
33
|
+
resetPassword: (body: {
|
|
34
|
+
key: string;
|
|
35
|
+
password: string;
|
|
36
|
+
}) => Promise<{}>;
|
|
12
37
|
changeName: (body: {
|
|
13
38
|
firstName: string;
|
|
14
39
|
lastName: string;
|
|
@@ -56,9 +81,19 @@ export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, g
|
|
|
56
81
|
}) => Promise<void>;
|
|
57
82
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
58
83
|
deleteAvatar: () => Promise<void>;
|
|
84
|
+
fetchActiveSessions: () => Promise<{
|
|
85
|
+
sessions: ActiveSession[];
|
|
86
|
+
}>;
|
|
59
87
|
logoutActiveSession: (body: {
|
|
60
88
|
sessionId: string;
|
|
61
89
|
visitorId: string;
|
|
62
90
|
}) => Promise<any>;
|
|
63
91
|
logoutFromAllActiveSessions: () => Promise<any>;
|
|
92
|
+
deleteAccount: () => Promise<{
|
|
93
|
+
key: string;
|
|
94
|
+
}>;
|
|
95
|
+
confirmDeleteAccount: (body: {
|
|
96
|
+
key: string;
|
|
97
|
+
code: string;
|
|
98
|
+
}) => Promise<void>;
|
|
64
99
|
};
|
|
@@ -20,6 +20,13 @@ export const createApiUserActions = once(
|
|
|
20
20
|
setToken(accessToken);
|
|
21
21
|
return await getUser();
|
|
22
22
|
},
|
|
23
|
+
signInByCodeSendCode: async (body) => {
|
|
24
|
+
return await fetch("/account/0/signinbycode/sendcode", {
|
|
25
|
+
body,
|
|
26
|
+
method: "POST",
|
|
27
|
+
...config.useRequestHeaders?.(["cookie"]) ?? {}
|
|
28
|
+
});
|
|
29
|
+
},
|
|
23
30
|
signInByCodeVerifyCode: async (body) => {
|
|
24
31
|
const response = await fetch("/account/0/signinbycode/verifycode", {
|
|
25
32
|
body,
|
|
@@ -33,6 +40,27 @@ export const createApiUserActions = once(
|
|
|
33
40
|
setToken(accessToken);
|
|
34
41
|
return await getUser();
|
|
35
42
|
},
|
|
43
|
+
signUp: async (body) => {
|
|
44
|
+
return await fetch("/account/0/signup", {
|
|
45
|
+
body,
|
|
46
|
+
method: "POST",
|
|
47
|
+
...config.useRequestHeaders?.(["cookie"]) ?? {}
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
confirmEmail: async (body) => {
|
|
51
|
+
return await fetch("/account/0/signup", {
|
|
52
|
+
body,
|
|
53
|
+
method: "PUT",
|
|
54
|
+
...config.useRequestHeaders?.(["cookie"]) ?? {}
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
resendActivationEmail: async (body) => {
|
|
58
|
+
return await fetch("/account/0/signup", {
|
|
59
|
+
body,
|
|
60
|
+
method: "PATCH",
|
|
61
|
+
...config.useRequestHeaders?.(["cookie"]) ?? {}
|
|
62
|
+
});
|
|
63
|
+
},
|
|
36
64
|
logout: async () => {
|
|
37
65
|
const user = useUser();
|
|
38
66
|
try {
|
|
@@ -43,8 +71,26 @@ export const createApiUserActions = once(
|
|
|
43
71
|
flush();
|
|
44
72
|
}
|
|
45
73
|
},
|
|
46
|
-
|
|
47
|
-
return await fetch("/account/
|
|
74
|
+
recovery: async (body) => {
|
|
75
|
+
return await fetch("/account/0/recovery", {
|
|
76
|
+
body,
|
|
77
|
+
method: "POST",
|
|
78
|
+
...config.useRequestHeaders?.(["cookie"]) ?? {}
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
confirmRecovery: async (body) => {
|
|
82
|
+
return await fetch("/account/0/recovery", {
|
|
83
|
+
body,
|
|
84
|
+
method: "PATCH",
|
|
85
|
+
...config.useRequestHeaders?.(["cookie"]) ?? {}
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
resetPassword: async (body) => {
|
|
89
|
+
return await fetch("/account/0/recovery", {
|
|
90
|
+
body,
|
|
91
|
+
method: "PUT",
|
|
92
|
+
...config.useRequestHeaders?.(["cookie"]) ?? {}
|
|
93
|
+
});
|
|
48
94
|
},
|
|
49
95
|
changeName: async (body) => {
|
|
50
96
|
await fetch("/account/1/change/name", {
|
|
@@ -109,11 +155,21 @@ export const createApiUserActions = once(
|
|
|
109
155
|
await fetch("/account/1/delete/avatar", { body: { avatar: user.value?.avatar }, method: "DELETE" });
|
|
110
156
|
updateUser({ avatar: "" });
|
|
111
157
|
},
|
|
158
|
+
fetchActiveSessions: async () => {
|
|
159
|
+
return await fetch("/account/1/sessions");
|
|
160
|
+
},
|
|
112
161
|
logoutActiveSession: async (body) => {
|
|
113
162
|
return await fetch("/account/1/logout/session", { body, method: "POST" });
|
|
114
163
|
},
|
|
115
164
|
logoutFromAllActiveSessions: async () => {
|
|
116
165
|
return await fetch("/account/1/logout/sessions", { method: "POST" });
|
|
166
|
+
},
|
|
167
|
+
deleteAccount: async () => {
|
|
168
|
+
return await fetch("/account/1/delete", { method: "POST" });
|
|
169
|
+
},
|
|
170
|
+
confirmDeleteAccount: async (body) => {
|
|
171
|
+
await fetch("/account/1/delete", { body, method: "PUT" });
|
|
172
|
+
flush();
|
|
117
173
|
}
|
|
118
174
|
};
|
|
119
175
|
}
|