@inzombieland/nuxt-common 1.18.23 → 1.18.24

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/nuxt-common",
3
- "version": "1.18.23",
3
+ "version": "1.18.24",
4
4
  "configKey": "nuxt-common",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.6.0",
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.23";
5
+ const version = "1.18.24";
6
6
 
7
7
  const module = defineNuxtModule({
8
8
  meta: {
@@ -41,6 +41,32 @@ declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/
41
41
  changeGender: (body: {
42
42
  gender: "" | "male" | "female";
43
43
  }) => Promise<void>;
44
+ changePassword: (body: {
45
+ password: string;
46
+ newPassword: string;
47
+ }) => Promise<{
48
+ key: string;
49
+ }>;
50
+ confirmPasswordChange: (body: {
51
+ key: string;
52
+ code: string;
53
+ newPassword?: string;
54
+ }) => Promise<void>;
55
+ changeEmail: (body: {
56
+ email: string;
57
+ password: string;
58
+ }) => Promise<{
59
+ key: string;
60
+ }>;
61
+ confirmEmailChange: (body: {
62
+ key: string;
63
+ code: string;
64
+ email?: string;
65
+ }) => Promise<void>;
66
+ changePhone: (body: {
67
+ phone: string;
68
+ password: string;
69
+ }) => Promise<void>;
44
70
  changeTheme: (body: {
45
71
  theme: "light" | "dark";
46
72
  }) => Promise<void>;
@@ -20,6 +20,32 @@ export declare const changeBirthday: (body: {
20
20
  export declare const changeGender: (body: {
21
21
  gender: "" | "male" | "female";
22
22
  }) => Promise<void>;
23
+ export declare const changePassword: (body: {
24
+ password: string;
25
+ newPassword: string;
26
+ }) => Promise<{
27
+ key: string;
28
+ }>;
29
+ export declare const confirmPasswordChange: (body: {
30
+ key: string;
31
+ code: string;
32
+ newPassword?: string;
33
+ }) => Promise<void>;
34
+ export declare const changeEmail: (body: {
35
+ email: string;
36
+ password: string;
37
+ }) => Promise<{
38
+ key: string;
39
+ }>;
40
+ export declare const confirmEmailChange: (body: {
41
+ key: string;
42
+ code: string;
43
+ email?: string;
44
+ }) => Promise<void>;
45
+ export declare const changePhone: (body: {
46
+ phone: string;
47
+ password: string;
48
+ }) => Promise<void>;
23
49
  export declare const changeAvatar: (body: FormData) => Promise<void>;
24
50
  export declare const deleteAvatar: () => Promise<void>;
25
51
  export declare const signInByCodeSendCode: (body: {
@@ -63,32 +89,6 @@ export declare const resetPassword: (body: {
63
89
  key: string;
64
90
  password: string;
65
91
  }) => Promise<{}>;
66
- export declare const changePassword: (body: {
67
- password: string;
68
- newPassword: string;
69
- }) => Promise<{
70
- key: string;
71
- }>;
72
- export declare const confirmPasswordChange: (body: {
73
- key: string;
74
- code: string;
75
- newPassword?: string;
76
- }) => Promise<void>;
77
- export declare const changeEmail: (body: {
78
- email: string;
79
- password: string;
80
- }) => Promise<{
81
- key: string;
82
- }>;
83
- export declare const confirmEmailChange: (body: {
84
- key: string;
85
- code: string;
86
- email?: string;
87
- }) => Promise<void>;
88
- export declare const changePhone: (body: {
89
- phone: string;
90
- password: string;
91
- }) => Promise<void>;
92
92
  export declare const fetchActiveSessions: () => Promise<{
93
93
  sessions: ActiveSession[];
94
94
  }>;
@@ -1,11 +1,16 @@
1
1
  import { useRequestHeaders } from "#imports";
2
- import { flush, setToken, updateUser } from "../packages/core/api-client.mjs";
2
+ import { flush, setToken } from "../packages/core/api-client.mjs";
3
3
  import { fetch, getUser, userActions } from "./index.mjs";
4
4
  export const signIn = userActions.signIn;
5
5
  export const logout = userActions.logout;
6
6
  export const changeName = userActions.changeName;
7
7
  export const changeBirthday = userActions.changeBirthday;
8
8
  export const changeGender = userActions.changeGender;
9
+ export const changePassword = userActions.changePassword;
10
+ export const confirmPasswordChange = userActions.confirmPasswordChange;
11
+ export const changeEmail = userActions.changeEmail;
12
+ export const confirmEmailChange = userActions.confirmEmailChange;
13
+ export const changePhone = userActions.changePhone;
9
14
  export const changeAvatar = userActions.changeAvatar;
10
15
  export const deleteAvatar = userActions.deleteAvatar;
11
16
  export const signInByCodeSendCode = async (body) => {
@@ -78,24 +83,6 @@ export const resetPassword = async (body) => {
78
83
  headers: useRequestHeaders(["cookie"])
79
84
  });
80
85
  };
81
- export const changePassword = async (body) => {
82
- return await fetch("/account/1/change/password", { body, method: "POST" });
83
- };
84
- export const confirmPasswordChange = async (body) => {
85
- await fetch("/account/1/change/password", { body, method: "PUT" });
86
- updateUser({ passwordLastSet: /* @__PURE__ */ new Date() });
87
- };
88
- export const changeEmail = async (body) => {
89
- return await fetch("/account/1/change/email", { body, method: "POST" });
90
- };
91
- export const confirmEmailChange = async (body) => {
92
- await fetch("/account/1/change/email", { body, method: "PUT" });
93
- updateUser({ email: body.email });
94
- };
95
- export const changePhone = async (body) => {
96
- await fetch("/account/1/change/phone", { body, method: "POST" });
97
- updateUser({ phone: body.phone });
98
- };
99
86
  export const fetchActiveSessions = async () => {
100
87
  return await fetch("/account/1/sessions");
101
88
  };
@@ -33,6 +33,32 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
33
33
  changeGender: (body: {
34
34
  gender: "" | "male" | "female";
35
35
  }) => Promise<void>;
36
+ changePassword: (body: {
37
+ password: string;
38
+ newPassword: string;
39
+ }) => Promise<{
40
+ key: string;
41
+ }>;
42
+ confirmPasswordChange: (body: {
43
+ key: string;
44
+ code: string;
45
+ newPassword?: string;
46
+ }) => Promise<void>;
47
+ changeEmail: (body: {
48
+ email: string;
49
+ password: string;
50
+ }) => Promise<{
51
+ key: string;
52
+ }>;
53
+ confirmEmailChange: (body: {
54
+ key: string;
55
+ code: string;
56
+ email?: string;
57
+ }) => Promise<void>;
58
+ changePhone: (body: {
59
+ phone: string;
60
+ password: string;
61
+ }) => Promise<void>;
36
62
  changeTheme: (body: {
37
63
  theme: "light" | "dark";
38
64
  }) => Promise<void>;
@@ -68,6 +94,32 @@ export declare const useUserActions: () => Ref<{
68
94
  changeGender: (body: {
69
95
  gender: "" | "male" | "female";
70
96
  }) => Promise<void>;
97
+ changePassword: (body: {
98
+ password: string;
99
+ newPassword: string;
100
+ }) => Promise<{
101
+ key: string;
102
+ }>;
103
+ confirmPasswordChange: (body: {
104
+ key: string;
105
+ code: string;
106
+ newPassword?: string;
107
+ }) => Promise<void>;
108
+ changeEmail: (body: {
109
+ email: string;
110
+ password: string;
111
+ }) => Promise<{
112
+ key: string;
113
+ }>;
114
+ confirmEmailChange: (body: {
115
+ key: string;
116
+ code: string;
117
+ email?: string;
118
+ }) => Promise<void>;
119
+ changePhone: (body: {
120
+ phone: string;
121
+ password: string;
122
+ }) => Promise<void>;
71
123
  changeTheme: (body: {
72
124
  theme: "light" | "dark";
73
125
  }) => Promise<void>;
@@ -101,6 +153,32 @@ export declare const useUserActions: () => Ref<{
101
153
  changeGender: (body: {
102
154
  gender: "" | "male" | "female";
103
155
  }) => Promise<void>;
156
+ changePassword: (body: {
157
+ password: string;
158
+ newPassword: string;
159
+ }) => Promise<{
160
+ key: string;
161
+ }>;
162
+ confirmPasswordChange: (body: {
163
+ key: string;
164
+ code: string;
165
+ newPassword?: string;
166
+ }) => Promise<void>;
167
+ changeEmail: (body: {
168
+ email: string;
169
+ password: string;
170
+ }) => Promise<{
171
+ key: string;
172
+ }>;
173
+ confirmEmailChange: (body: {
174
+ key: string;
175
+ code: string;
176
+ email?: string;
177
+ }) => Promise<void>;
178
+ changePhone: (body: {
179
+ phone: string;
180
+ password: string;
181
+ }) => Promise<void>;
104
182
  changeTheme: (body: {
105
183
  theme: "light" | "dark";
106
184
  }) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.18.23",
3
+ "version": "1.18.24",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",
@@ -25,6 +25,32 @@ export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, g
25
25
  changeGender: (body: {
26
26
  gender: "" | "male" | "female";
27
27
  }) => Promise<void>;
28
+ changePassword: (body: {
29
+ password: string;
30
+ newPassword: string;
31
+ }) => Promise<{
32
+ key: string;
33
+ }>;
34
+ confirmPasswordChange: (body: {
35
+ key: string;
36
+ code: string;
37
+ newPassword?: string;
38
+ }) => Promise<void>;
39
+ changeEmail: (body: {
40
+ email: string;
41
+ password: string;
42
+ }) => Promise<{
43
+ key: string;
44
+ }>;
45
+ confirmEmailChange: (body: {
46
+ key: string;
47
+ code: string;
48
+ email?: string;
49
+ }) => Promise<void>;
50
+ changePhone: (body: {
51
+ phone: string;
52
+ password: string;
53
+ }) => Promise<void>;
28
54
  changeTheme: (body: {
29
55
  theme: "light" | "dark";
30
56
  }) => Promise<void>;
@@ -55,6 +55,24 @@ export const createApiUserActions = once(
55
55
  await fetch("/account/1/change/gender", { body, method: "POST" });
56
56
  updateUser(body);
57
57
  },
58
+ changePassword: async (body) => {
59
+ return await fetch("/account/1/change/password", { body, method: "POST" });
60
+ },
61
+ confirmPasswordChange: async (body) => {
62
+ await fetch("/account/1/change/password", { body, method: "PUT" });
63
+ updateUser({ passwordLastSet: /* @__PURE__ */ new Date() });
64
+ },
65
+ changeEmail: async (body) => {
66
+ return await fetch("/account/1/change/email", { body, method: "POST" });
67
+ },
68
+ confirmEmailChange: async (body) => {
69
+ await fetch("/account/1/change/email", { body, method: "PUT" });
70
+ updateUser({ email: body.email });
71
+ },
72
+ changePhone: async (body) => {
73
+ await fetch("/account/1/change/phone", { body, method: "POST" });
74
+ updateUser({ phone: body.phone });
75
+ },
58
76
  changeTheme: async (body) => {
59
77
  const user = useUser();
60
78
  if (user.value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/nuxt-common",
3
- "version": "1.18.23",
3
+ "version": "1.18.24",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "exports": {