@inzombieland/core 1.18.44 → 1.18.48

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
 
@@ -1,5 +1,5 @@
1
1
  export * from "../helpers/composables";
2
- export { useActiveSessions } from "./use-active-sessions";
2
+ export * from "./use-active-sessions";
3
3
  export { useApiActions } from "./use-api-actions";
4
4
  export { useAppLocale } from "./use-app-locale";
5
5
  export { useCookies } from "./use-cookies";
@@ -1,5 +1,5 @@
1
1
  export * from "../helpers/composables.mjs";
2
- export { useActiveSessions } from "./use-active-sessions.mjs";
2
+ export * from "./use-active-sessions.mjs";
3
3
  export { useApiActions } from "./use-api-actions.mjs";
4
4
  export { useAppLocale } from "./use-app-locale.mjs";
5
5
  export { useCookies } from "./use-cookies.mjs";
package/index.d.ts CHANGED
@@ -12,6 +12,9 @@ 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>;
16
19
  signUp: (body: Record<string, any>) => Promise<{
17
20
  key: string;
@@ -26,9 +29,19 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
26
29
  key: string;
27
30
  }>;
28
31
  logout: () => Promise<void>;
29
- fetchActiveSessions: () => Promise<{
30
- 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;
31
40
  }>;
41
+ resetPassword: (body: {
42
+ key: string;
43
+ password: string;
44
+ }) => Promise<{}>;
32
45
  changeName: (body: {
33
46
  firstName: string;
34
47
  lastName: string;
@@ -76,17 +89,30 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
76
89
  }) => Promise<void>;
77
90
  changeAvatar: (body: FormData) => Promise<void>;
78
91
  deleteAvatar: () => Promise<void>;
92
+ fetchActiveSessions: () => Promise<{
93
+ sessions: import("./types").ActiveSession[];
94
+ }>;
79
95
  logoutActiveSession: (body: {
80
96
  sessionId: string;
81
97
  visitorId: string;
82
98
  }) => Promise<any>;
83
99
  logoutFromAllActiveSessions: () => Promise<any>;
100
+ deleteAccount: () => Promise<{
101
+ key: string;
102
+ }>;
103
+ confirmDeleteAccount: (body: {
104
+ key: string;
105
+ code: string;
106
+ }) => Promise<void>;
84
107
  };
85
108
  };
86
109
  export declare const useUserActions: () => Ref<{
87
110
  signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
88
111
  key: string;
89
112
  }>;
113
+ signInByCodeSendCode: (body: Record<string, any>) => Promise<{
114
+ key: string;
115
+ }>;
90
116
  signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
91
117
  signUp: (body: Record<string, any>) => Promise<{
92
118
  key: string;
@@ -101,9 +127,19 @@ export declare const useUserActions: () => Ref<{
101
127
  key: string;
102
128
  }>;
103
129
  logout: () => Promise<void>;
104
- fetchActiveSessions: () => Promise<{
105
- 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;
106
138
  }>;
139
+ resetPassword: (body: {
140
+ key: string;
141
+ password: string;
142
+ }) => Promise<{}>;
107
143
  changeName: (body: {
108
144
  firstName: string;
109
145
  lastName: string;
@@ -151,15 +187,28 @@ export declare const useUserActions: () => Ref<{
151
187
  }) => Promise<void>;
152
188
  changeAvatar: (body: FormData) => Promise<void>;
153
189
  deleteAvatar: () => Promise<void>;
190
+ fetchActiveSessions: () => Promise<{
191
+ sessions: import("./types").ActiveSession[];
192
+ }>;
154
193
  logoutActiveSession: (body: {
155
194
  sessionId: string;
156
195
  visitorId: string;
157
196
  }) => Promise<any>;
158
197
  logoutFromAllActiveSessions: () => Promise<any>;
198
+ deleteAccount: () => Promise<{
199
+ key: string;
200
+ }>;
201
+ confirmDeleteAccount: (body: {
202
+ key: string;
203
+ code: string;
204
+ }) => Promise<void>;
159
205
  }, {
160
206
  signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
161
207
  key: string;
162
208
  }>;
209
+ signInByCodeSendCode: (body: Record<string, any>) => Promise<{
210
+ key: string;
211
+ }>;
163
212
  signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
164
213
  signUp: (body: Record<string, any>) => Promise<{
165
214
  key: string;
@@ -174,9 +223,19 @@ export declare const useUserActions: () => Ref<{
174
223
  key: string;
175
224
  }>;
176
225
  logout: () => Promise<void>;
177
- fetchActiveSessions: () => Promise<{
178
- sessions: import("./types").ActiveSession[];
226
+ recovery: (body: Record<string, any>) => Promise<{
227
+ key: string;
179
228
  }>;
229
+ confirmRecovery: (body: {
230
+ key: string;
231
+ code: string;
232
+ }) => Promise<{
233
+ key: string;
234
+ }>;
235
+ resetPassword: (body: {
236
+ key: string;
237
+ password: string;
238
+ }) => Promise<{}>;
180
239
  changeName: (body: {
181
240
  firstName: string;
182
241
  lastName: string;
@@ -224,9 +283,19 @@ export declare const useUserActions: () => Ref<{
224
283
  }) => Promise<void>;
225
284
  changeAvatar: (body: FormData) => Promise<void>;
226
285
  deleteAvatar: () => Promise<void>;
286
+ fetchActiveSessions: () => Promise<{
287
+ sessions: import("./types").ActiveSession[];
288
+ }>;
227
289
  logoutActiveSession: (body: {
228
290
  sessionId: string;
229
291
  visitorId: string;
230
292
  }) => Promise<any>;
231
293
  logoutFromAllActiveSessions: () => Promise<any>;
294
+ deleteAccount: () => Promise<{
295
+ key: string;
296
+ }>;
297
+ confirmDeleteAccount: (body: {
298
+ key: string;
299
+ code: string;
300
+ }) => Promise<void>;
232
301
  }> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.18.44",
3
+ "version": "1.18.48",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",
package/user-actions.d.ts CHANGED
@@ -4,6 +4,9 @@ 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>;
8
11
  signUp: (body: Record<string, any>) => Promise<{
9
12
  key: string;
@@ -18,9 +21,19 @@ export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, g
18
21
  key: string;
19
22
  }>;
20
23
  logout: () => Promise<void>;
21
- fetchActiveSessions: () => Promise<{
22
- sessions: ActiveSession[];
24
+ recovery: (body: Record<string, any>) => Promise<{
25
+ key: string;
23
26
  }>;
27
+ confirmRecovery: (body: {
28
+ key: string;
29
+ code: string;
30
+ }) => Promise<{
31
+ key: string;
32
+ }>;
33
+ resetPassword: (body: {
34
+ key: string;
35
+ password: string;
36
+ }) => Promise<{}>;
24
37
  changeName: (body: {
25
38
  firstName: string;
26
39
  lastName: string;
@@ -68,9 +81,19 @@ export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, g
68
81
  }) => Promise<void>;
69
82
  changeAvatar: (body: FormData) => Promise<void>;
70
83
  deleteAvatar: () => Promise<void>;
84
+ fetchActiveSessions: () => Promise<{
85
+ sessions: ActiveSession[];
86
+ }>;
71
87
  logoutActiveSession: (body: {
72
88
  sessionId: string;
73
89
  visitorId: string;
74
90
  }) => Promise<any>;
75
91
  logoutFromAllActiveSessions: () => Promise<any>;
92
+ deleteAccount: () => Promise<{
93
+ key: string;
94
+ }>;
95
+ confirmDeleteAccount: (body: {
96
+ key: string;
97
+ code: string;
98
+ }) => Promise<void>;
76
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,
@@ -64,8 +71,26 @@ export const createApiUserActions = once(
64
71
  flush();
65
72
  }
66
73
  },
67
- fetchActiveSessions: async () => {
68
- 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
+ });
69
94
  },
70
95
  changeName: async (body) => {
71
96
  await fetch("/account/1/change/name", {
@@ -130,11 +155,21 @@ export const createApiUserActions = once(
130
155
  await fetch("/account/1/delete/avatar", { body: { avatar: user.value?.avatar }, method: "DELETE" });
131
156
  updateUser({ avatar: "" });
132
157
  },
158
+ fetchActiveSessions: async () => {
159
+ return await fetch("/account/1/sessions");
160
+ },
133
161
  logoutActiveSession: async (body) => {
134
162
  return await fetch("/account/1/logout/session", { body, method: "POST" });
135
163
  },
136
164
  logoutFromAllActiveSessions: async () => {
137
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();
138
173
  }
139
174
  };
140
175
  }