@inzombieland/nuxt-common 1.18.29 → 1.18.31
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 +2 -15
- package/dist/runtime/api/user-actions.d.ts +7 -15
- package/dist/runtime/api/user-actions.mjs +8 -1
- package/dist/runtime/packages/core/index.d.ts +6 -45
- package/dist/runtime/packages/core/package.json +1 -1
- package/dist/runtime/packages/core/user-actions.d.ts +2 -15
- package/dist/runtime/packages/core/user-actions.mjs +0 -7
- 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.31";
|
|
6
6
|
|
|
7
7
|
const module = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
@@ -17,23 +17,10 @@ export declare const config: {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/core/types").GetUserResponse>, useApiFetch: () => Fetch, userActions: {
|
|
20
|
-
signIn: (body: {
|
|
21
|
-
username: string;
|
|
22
|
-
password: string;
|
|
23
|
-
rememberMe: boolean;
|
|
24
|
-
}) => Promise<import("src/runtime/packages/core/types").GetUserResponse | {
|
|
25
|
-
key: string;
|
|
26
|
-
}>;
|
|
27
|
-
signInByCodeSendCode: (body: {
|
|
28
|
-
username: string;
|
|
29
|
-
}) => Promise<{
|
|
20
|
+
signIn: (body: Record<string, any>) => Promise<import("src/runtime/packages/core/types").GetUserResponse | {
|
|
30
21
|
key: string;
|
|
31
22
|
}>;
|
|
32
|
-
signInByCodeVerifyCode: (body:
|
|
33
|
-
key: string;
|
|
34
|
-
code: string;
|
|
35
|
-
rememberMe?: boolean;
|
|
36
|
-
}) => Promise<import("src/runtime/packages/core/types").GetUserResponse>;
|
|
23
|
+
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("src/runtime/packages/core/types").GetUserResponse>;
|
|
37
24
|
logout: () => Promise<void>;
|
|
38
25
|
fetchActiveSessions: () => Promise<{
|
|
39
26
|
sessions: import("src/runtime/packages/core/types").ActiveSession[];
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import type { ActiveSession } from "../packages/core";
|
|
2
|
-
export declare const signIn: (body: {
|
|
3
|
-
username: string;
|
|
4
|
-
password: string;
|
|
5
|
-
rememberMe: boolean;
|
|
6
|
-
}) => Promise<import("src/runtime/packages/core/types").GetUserResponse | {
|
|
7
|
-
key: string;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const signInByCodeSendCode: (body: {
|
|
10
|
-
username: string;
|
|
11
|
-
}) => Promise<{
|
|
2
|
+
export declare const signIn: (body: Record<string, any>) => Promise<import("src/runtime/packages/core/types").GetUserResponse | {
|
|
12
3
|
key: string;
|
|
13
4
|
}>;
|
|
14
|
-
export declare const signInByCodeVerifyCode: (body:
|
|
15
|
-
key: string;
|
|
16
|
-
code: string;
|
|
17
|
-
rememberMe?: boolean;
|
|
18
|
-
}) => Promise<import("src/runtime/packages/core/types").GetUserResponse>;
|
|
5
|
+
export declare const signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("src/runtime/packages/core/types").GetUserResponse>;
|
|
19
6
|
export declare const logout: () => Promise<void>;
|
|
20
7
|
export declare const changeName: (body: {
|
|
21
8
|
firstName: string;
|
|
@@ -58,6 +45,11 @@ export declare const changePhone: (body: {
|
|
|
58
45
|
}) => Promise<void>;
|
|
59
46
|
export declare const changeAvatar: (body: FormData) => Promise<void>;
|
|
60
47
|
export declare const deleteAvatar: () => Promise<void>;
|
|
48
|
+
export declare const signInByCodeSendCode: (body: {
|
|
49
|
+
username: string;
|
|
50
|
+
}) => Promise<{
|
|
51
|
+
key: string;
|
|
52
|
+
}>;
|
|
61
53
|
export declare const signUp: (body: {
|
|
62
54
|
email: string;
|
|
63
55
|
password: string;
|
|
@@ -2,7 +2,6 @@ import { useRequestHeaders } from "#imports";
|
|
|
2
2
|
import { flush } from "../packages/core/api-client.mjs";
|
|
3
3
|
import { fetch, userActions } from "./index.mjs";
|
|
4
4
|
export const signIn = userActions.signIn;
|
|
5
|
-
export const signInByCodeSendCode = userActions.signInByCodeSendCode;
|
|
6
5
|
export const signInByCodeVerifyCode = userActions.signInByCodeVerifyCode;
|
|
7
6
|
export const logout = userActions.logout;
|
|
8
7
|
export const changeName = userActions.changeName;
|
|
@@ -15,6 +14,14 @@ export const confirmEmailChange = userActions.confirmEmailChange;
|
|
|
15
14
|
export const changePhone = userActions.changePhone;
|
|
16
15
|
export const changeAvatar = userActions.changeAvatar;
|
|
17
16
|
export const deleteAvatar = userActions.deleteAvatar;
|
|
17
|
+
export const signInByCodeSendCode = async (body) => {
|
|
18
|
+
return await fetch("/account/0/signinbycode/sendcode", {
|
|
19
|
+
body,
|
|
20
|
+
method: "POST",
|
|
21
|
+
baseURL: "/",
|
|
22
|
+
headers: useRequestHeaders(["cookie"])
|
|
23
|
+
});
|
|
24
|
+
};
|
|
18
25
|
export const signUp = async (body) => {
|
|
19
26
|
return await fetch("/account/0/signup", {
|
|
20
27
|
body,
|
|
@@ -9,23 +9,10 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
|
|
|
9
9
|
getUser: () => Promise<import("./types").GetUserResponse>;
|
|
10
10
|
useApiFetch: () => Fetch;
|
|
11
11
|
userActions: {
|
|
12
|
-
signIn: (body: {
|
|
13
|
-
username: string;
|
|
14
|
-
password: string;
|
|
15
|
-
rememberMe: boolean;
|
|
16
|
-
}) => Promise<import("./types").GetUserResponse | {
|
|
12
|
+
signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
|
|
17
13
|
key: string;
|
|
18
14
|
}>;
|
|
19
|
-
|
|
20
|
-
username: string;
|
|
21
|
-
}) => Promise<{
|
|
22
|
-
key: string;
|
|
23
|
-
}>;
|
|
24
|
-
signInByCodeVerifyCode: (body: {
|
|
25
|
-
key: string;
|
|
26
|
-
code: string;
|
|
27
|
-
rememberMe?: boolean;
|
|
28
|
-
}) => Promise<import("./types").GetUserResponse>;
|
|
15
|
+
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
|
|
29
16
|
logout: () => Promise<void>;
|
|
30
17
|
fetchActiveSessions: () => Promise<{
|
|
31
18
|
sessions: import("./types").ActiveSession[];
|
|
@@ -80,23 +67,10 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
|
|
|
80
67
|
};
|
|
81
68
|
};
|
|
82
69
|
export declare const useUserActions: () => Ref<{
|
|
83
|
-
signIn: (body: {
|
|
84
|
-
username: string;
|
|
85
|
-
password: string;
|
|
86
|
-
rememberMe: boolean;
|
|
87
|
-
}) => Promise<import("./types").GetUserResponse | {
|
|
88
|
-
key: string;
|
|
89
|
-
}>;
|
|
90
|
-
signInByCodeSendCode: (body: {
|
|
91
|
-
username: string;
|
|
92
|
-
}) => Promise<{
|
|
70
|
+
signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
|
|
93
71
|
key: string;
|
|
94
72
|
}>;
|
|
95
|
-
signInByCodeVerifyCode: (body:
|
|
96
|
-
key: string;
|
|
97
|
-
code: string;
|
|
98
|
-
rememberMe?: boolean;
|
|
99
|
-
}) => Promise<import("./types").GetUserResponse>;
|
|
73
|
+
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
|
|
100
74
|
logout: () => Promise<void>;
|
|
101
75
|
fetchActiveSessions: () => Promise<{
|
|
102
76
|
sessions: import("./types").ActiveSession[];
|
|
@@ -149,23 +123,10 @@ export declare const useUserActions: () => Ref<{
|
|
|
149
123
|
changeAvatar: (body: FormData) => Promise<void>;
|
|
150
124
|
deleteAvatar: () => Promise<void>;
|
|
151
125
|
}, {
|
|
152
|
-
signIn: (body: {
|
|
153
|
-
username: string;
|
|
154
|
-
password: string;
|
|
155
|
-
rememberMe: boolean;
|
|
156
|
-
}) => Promise<import("./types").GetUserResponse | {
|
|
126
|
+
signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
|
|
157
127
|
key: string;
|
|
158
128
|
}>;
|
|
159
|
-
|
|
160
|
-
username: string;
|
|
161
|
-
}) => Promise<{
|
|
162
|
-
key: string;
|
|
163
|
-
}>;
|
|
164
|
-
signInByCodeVerifyCode: (body: {
|
|
165
|
-
key: string;
|
|
166
|
-
code: string;
|
|
167
|
-
rememberMe?: boolean;
|
|
168
|
-
}) => Promise<import("./types").GetUserResponse>;
|
|
129
|
+
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
|
|
169
130
|
logout: () => Promise<void>;
|
|
170
131
|
fetchActiveSessions: () => Promise<{
|
|
171
132
|
sessions: import("./types").ActiveSession[];
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import type { ActiveSession, Fetch, FetchConfig, GetUserResponse } from "./types";
|
|
2
2
|
export type UserActions = ReturnType<typeof createApiUserActions>;
|
|
3
3
|
export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, getUser: () => Promise<GetUserResponse>) => {
|
|
4
|
-
signIn: (body: {
|
|
5
|
-
username: string;
|
|
6
|
-
password: string;
|
|
7
|
-
rememberMe: boolean;
|
|
8
|
-
}) => Promise<GetUserResponse | {
|
|
9
|
-
key: string;
|
|
10
|
-
}>;
|
|
11
|
-
signInByCodeSendCode: (body: {
|
|
12
|
-
username: string;
|
|
13
|
-
}) => Promise<{
|
|
4
|
+
signIn: (body: Record<string, any>) => Promise<GetUserResponse | {
|
|
14
5
|
key: string;
|
|
15
6
|
}>;
|
|
16
|
-
signInByCodeVerifyCode: (body:
|
|
17
|
-
key: string;
|
|
18
|
-
code: string;
|
|
19
|
-
rememberMe?: boolean;
|
|
20
|
-
}) => Promise<GetUserResponse>;
|
|
7
|
+
signInByCodeVerifyCode: (body: Record<string, any>) => Promise<GetUserResponse>;
|
|
21
8
|
logout: () => Promise<void>;
|
|
22
9
|
fetchActiveSessions: () => Promise<{
|
|
23
10
|
sessions: ActiveSession[];
|
|
@@ -20,13 +20,6 @@ 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
|
-
},
|
|
30
23
|
signInByCodeVerifyCode: async (body) => {
|
|
31
24
|
const response = await fetch("/account/0/signinbycode/verifycode", {
|
|
32
25
|
body,
|