@inzombieland/core 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/AppProvider.vue CHANGED
@@ -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
- const props = defineProps({ vantEnabled: { type: Boolean, default: true } })
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
 
package/index.d.ts CHANGED
@@ -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
- fetchActiveSessions: () => Promise<{
18
- sessions: import("./types").ActiveSession[];
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
- fetchActiveSessions: () => Promise<{
81
- sessions: import("./types").ActiveSession[];
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
- fetchActiveSessions: () => Promise<{
142
- sessions: import("./types").ActiveSession[];
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.18.43",
3
+ "version": "1.18.45",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",
package/user-actions.d.ts CHANGED
@@ -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
- fetchActiveSessions: () => Promise<{
10
- sessions: ActiveSession[];
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
  };
package/user-actions.mjs CHANGED
@@ -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
- fetchActiveSessions: async () => {
47
- return await fetch("/account/1/sessions");
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
  }