@inzombieland/nuxt-common 1.18.31 → 1.18.33
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 +5 -0
- package/dist/runtime/api/user-actions.d.ts +5 -5
- package/dist/runtime/api/user-actions.mjs +2 -6
- package/dist/runtime/packages/core/index.d.ts +15 -0
- package/dist/runtime/packages/core/package.json +1 -1
- package/dist/runtime/packages/core/user-actions.d.ts +5 -0
- package/dist/runtime/packages/core/user-actions.mjs +6 -0
- 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.33";
|
|
6
6
|
|
|
7
7
|
const module = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
@@ -72,5 +72,10 @@ declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/
|
|
|
72
72
|
}) => Promise<void>;
|
|
73
73
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
74
74
|
deleteAvatar: () => Promise<void>;
|
|
75
|
+
logoutActiveSession: (body: {
|
|
76
|
+
sessionId: string;
|
|
77
|
+
visitorId: string;
|
|
78
|
+
}) => Promise<any>;
|
|
79
|
+
logoutFromAllActiveSessions: () => Promise<any>;
|
|
75
80
|
};
|
|
76
81
|
export { fetch, getUser, useApiFetch, userActions };
|
|
@@ -45,6 +45,11 @@ export declare const changePhone: (body: {
|
|
|
45
45
|
}) => Promise<void>;
|
|
46
46
|
export declare const changeAvatar: (body: FormData) => Promise<void>;
|
|
47
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>;
|
|
48
53
|
export declare const signInByCodeSendCode: (body: {
|
|
49
54
|
username: string;
|
|
50
55
|
}) => Promise<{
|
|
@@ -84,11 +89,6 @@ export declare const resetPassword: (body: {
|
|
|
84
89
|
export declare const fetchActiveSessions: () => Promise<{
|
|
85
90
|
sessions: ActiveSession[];
|
|
86
91
|
}>;
|
|
87
|
-
export declare const logoutActiveSession: (body: {
|
|
88
|
-
sessionId: string;
|
|
89
|
-
visitorId: string;
|
|
90
|
-
}) => Promise<any>;
|
|
91
|
-
export declare const logoutFromAllActiveSessions: () => Promise<any>;
|
|
92
92
|
export declare const deleteAccount: () => Promise<{
|
|
93
93
|
key: string;
|
|
94
94
|
}>;
|
|
@@ -14,6 +14,8 @@ export const confirmEmailChange = userActions.confirmEmailChange;
|
|
|
14
14
|
export const changePhone = userActions.changePhone;
|
|
15
15
|
export const changeAvatar = userActions.changeAvatar;
|
|
16
16
|
export const deleteAvatar = userActions.deleteAvatar;
|
|
17
|
+
export const logoutActiveSession = userActions.logoutActiveSession;
|
|
18
|
+
export const logoutFromAllActiveSessions = userActions.logoutFromAllActiveSessions;
|
|
17
19
|
export const signInByCodeSendCode = async (body) => {
|
|
18
20
|
return await fetch("/account/0/signinbycode/sendcode", {
|
|
19
21
|
body,
|
|
@@ -73,12 +75,6 @@ export const resetPassword = async (body) => {
|
|
|
73
75
|
export const fetchActiveSessions = async () => {
|
|
74
76
|
return await fetch("/account/1/sessions");
|
|
75
77
|
};
|
|
76
|
-
export const logoutActiveSession = async (body) => {
|
|
77
|
-
return await fetch("/account/1/logout/session", { body, method: "POST" });
|
|
78
|
-
};
|
|
79
|
-
export const logoutFromAllActiveSessions = async () => {
|
|
80
|
-
return await fetch("/account/1/logout/sessions", { method: "POST" });
|
|
81
|
-
};
|
|
82
78
|
export const deleteAccount = async () => {
|
|
83
79
|
return await fetch("/account/1/delete", { method: "POST" });
|
|
84
80
|
};
|
|
@@ -64,6 +64,11 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
|
|
|
64
64
|
}) => Promise<void>;
|
|
65
65
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
66
66
|
deleteAvatar: () => Promise<void>;
|
|
67
|
+
logoutActiveSession: (body: {
|
|
68
|
+
sessionId: string;
|
|
69
|
+
visitorId: string;
|
|
70
|
+
}) => Promise<any>;
|
|
71
|
+
logoutFromAllActiveSessions: () => Promise<any>;
|
|
67
72
|
};
|
|
68
73
|
};
|
|
69
74
|
export declare const useUserActions: () => Ref<{
|
|
@@ -122,6 +127,11 @@ export declare const useUserActions: () => Ref<{
|
|
|
122
127
|
}) => Promise<void>;
|
|
123
128
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
124
129
|
deleteAvatar: () => Promise<void>;
|
|
130
|
+
logoutActiveSession: (body: {
|
|
131
|
+
sessionId: string;
|
|
132
|
+
visitorId: string;
|
|
133
|
+
}) => Promise<any>;
|
|
134
|
+
logoutFromAllActiveSessions: () => Promise<any>;
|
|
125
135
|
}, {
|
|
126
136
|
signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
|
|
127
137
|
key: string;
|
|
@@ -178,4 +188,9 @@ export declare const useUserActions: () => Ref<{
|
|
|
178
188
|
}) => Promise<void>;
|
|
179
189
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
180
190
|
deleteAvatar: () => Promise<void>;
|
|
191
|
+
logoutActiveSession: (body: {
|
|
192
|
+
sessionId: string;
|
|
193
|
+
visitorId: string;
|
|
194
|
+
}) => Promise<any>;
|
|
195
|
+
logoutFromAllActiveSessions: () => Promise<any>;
|
|
181
196
|
}> | undefined;
|
|
@@ -56,4 +56,9 @@ export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, g
|
|
|
56
56
|
}) => Promise<void>;
|
|
57
57
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
58
58
|
deleteAvatar: () => Promise<void>;
|
|
59
|
+
logoutActiveSession: (body: {
|
|
60
|
+
sessionId: string;
|
|
61
|
+
visitorId: string;
|
|
62
|
+
}) => Promise<any>;
|
|
63
|
+
logoutFromAllActiveSessions: () => Promise<any>;
|
|
59
64
|
};
|
|
@@ -108,6 +108,12 @@ export const createApiUserActions = once(
|
|
|
108
108
|
const user = useUser();
|
|
109
109
|
await fetch("/account/1/delete/avatar", { body: { avatar: user.value?.avatar }, method: "DELETE" });
|
|
110
110
|
updateUser({ avatar: "" });
|
|
111
|
+
},
|
|
112
|
+
logoutActiveSession: async (body) => {
|
|
113
|
+
return await fetch("/account/1/logout/session", { body, method: "POST" });
|
|
114
|
+
},
|
|
115
|
+
logoutFromAllActiveSessions: async () => {
|
|
116
|
+
return await fetch("/account/1/logout/sessions", { method: "POST" });
|
|
111
117
|
}
|
|
112
118
|
};
|
|
113
119
|
}
|