@inzombieland/core 1.18.22 → 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/index.d.ts CHANGED
@@ -25,9 +25,40 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
25
25
  lastName: string;
26
26
  middleName: string;
27
27
  }) => Promise<void>;
28
+ changeBirthday: (body: {
29
+ day?: number;
30
+ month?: number;
31
+ year?: number;
32
+ }) => Promise<void>;
28
33
  changeGender: (body: {
29
34
  gender: "" | "male" | "female";
30
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>;
31
62
  changeTheme: (body: {
32
63
  theme: "light" | "dark";
33
64
  }) => Promise<void>;
@@ -55,9 +86,40 @@ export declare const useUserActions: () => Ref<{
55
86
  lastName: string;
56
87
  middleName: string;
57
88
  }) => Promise<void>;
89
+ changeBirthday: (body: {
90
+ day?: number;
91
+ month?: number;
92
+ year?: number;
93
+ }) => Promise<void>;
58
94
  changeGender: (body: {
59
95
  gender: "" | "male" | "female";
60
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>;
61
123
  changeTheme: (body: {
62
124
  theme: "light" | "dark";
63
125
  }) => Promise<void>;
@@ -83,9 +145,40 @@ export declare const useUserActions: () => Ref<{
83
145
  lastName: string;
84
146
  middleName: string;
85
147
  }) => Promise<void>;
148
+ changeBirthday: (body: {
149
+ day?: number;
150
+ month?: number;
151
+ year?: number;
152
+ }) => Promise<void>;
86
153
  changeGender: (body: {
87
154
  gender: "" | "male" | "female";
88
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>;
89
182
  changeTheme: (body: {
90
183
  theme: "light" | "dark";
91
184
  }) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.18.22",
3
+ "version": "1.18.24",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",
package/user-actions.d.ts CHANGED
@@ -17,9 +17,40 @@ export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, g
17
17
  lastName: string;
18
18
  middleName: string;
19
19
  }) => Promise<void>;
20
+ changeBirthday: (body: {
21
+ day?: number;
22
+ month?: number;
23
+ year?: number;
24
+ }) => Promise<void>;
20
25
  changeGender: (body: {
21
26
  gender: "" | "male" | "female";
22
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>;
23
54
  changeTheme: (body: {
24
55
  theme: "light" | "dark";
25
56
  }) => Promise<void>;
package/user-actions.mjs CHANGED
@@ -41,10 +41,38 @@ export const createApiUserActions = once(
41
41
  });
42
42
  updateUser(body);
43
43
  },
44
+ changeBirthday: async (body) => {
45
+ await fetch("/account/1/change/birthday", { body, method: "POST" });
46
+ const { year, month, day } = body;
47
+ if (year && month && day) {
48
+ const birthday = /* @__PURE__ */ new Date();
49
+ birthday.setUTCFullYear(year, month - 1, day);
50
+ birthday.setUTCHours(0, 0, 0, 0);
51
+ updateUser({ birthday });
52
+ }
53
+ },
44
54
  changeGender: async (body) => {
45
55
  await fetch("/account/1/change/gender", { body, method: "POST" });
46
56
  updateUser(body);
47
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
+ },
48
76
  changeTheme: async (body) => {
49
77
  const user = useUser();
50
78
  if (user.value) {