hylekit 1.0.0 → 1.0.1
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/README.md +402 -0
- package/dist/bff/index.cjs +338 -0
- package/dist/bff/index.cjs.map +1 -0
- package/dist/bff/index.d.cts +2 -0
- package/dist/bff/index.d.ts +2 -0
- package/dist/bff/index.js +316 -0
- package/dist/bff/index.js.map +1 -0
- package/dist/client/nextjs.cjs +250 -0
- package/dist/client/nextjs.cjs.map +1 -0
- package/dist/client/nextjs.d.cts +868 -0
- package/dist/client/nextjs.d.ts +868 -0
- package/dist/client/nextjs.js +230 -0
- package/dist/client/nextjs.js.map +1 -0
- package/dist/client/sveltekit.cjs +237 -0
- package/dist/client/sveltekit.cjs.map +1 -0
- package/dist/client/sveltekit.d.cts +844 -0
- package/dist/client/sveltekit.d.ts +844 -0
- package/dist/client/sveltekit.js +217 -0
- package/dist/client/sveltekit.js.map +1 -0
- package/dist/index-DYW73KK3.d.cts +58 -0
- package/dist/index-DYW73KK3.d.ts +58 -0
- package/dist/index.cjs +502 -553
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3266 -1897
- package/dist/index.d.ts +3266 -1897
- package/dist/index.js +488 -535
- package/dist/index.js.map +1 -1
- package/dist/lib/schema.cjs +118 -0
- package/dist/lib/schema.cjs.map +1 -0
- package/dist/lib/schema.d.cts +3 -0
- package/dist/lib/schema.d.ts +3 -0
- package/dist/lib/schema.js +87 -0
- package/dist/lib/schema.js.map +1 -0
- package/dist/schema-ph9L8QMm.d.cts +674 -0
- package/dist/schema-ph9L8QMm.d.ts +674 -0
- package/dist/server/express.cjs +243 -0
- package/dist/server/express.cjs.map +1 -0
- package/dist/server/express.d.cts +85 -0
- package/dist/server/express.d.ts +85 -0
- package/dist/server/express.js +219 -0
- package/dist/server/express.js.map +1 -0
- package/dist/types-BHiK1JUX.d.cts +32 -0
- package/dist/types-GOn9sn7-.d.ts +32 -0
- package/package.json +45 -10
|
@@ -0,0 +1,844 @@
|
|
|
1
|
+
import * as nanostores from 'nanostores';
|
|
2
|
+
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
3
|
+
import * as better_auth from 'better-auth';
|
|
4
|
+
import { Handle, RequestEvent } from '@sveltejs/kit';
|
|
5
|
+
import { S as SessionResult, a as SessionData, d as db } from '../types-BHiK1JUX.cjs';
|
|
6
|
+
export { U as UserInfo } from '../types-BHiK1JUX.cjs';
|
|
7
|
+
import '@libsql/client';
|
|
8
|
+
import 'drizzle-orm/libsql';
|
|
9
|
+
import '../schema-ph9L8QMm.cjs';
|
|
10
|
+
import 'drizzle-orm';
|
|
11
|
+
import 'drizzle-orm/sqlite-core';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Client-side Auth instance.
|
|
15
|
+
* Use this in your Svelte components and client-side logic.
|
|
16
|
+
*/
|
|
17
|
+
declare const client: {
|
|
18
|
+
/**
|
|
19
|
+
* Alias for signIn.
|
|
20
|
+
*/
|
|
21
|
+
login: {
|
|
22
|
+
social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
23
|
+
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
|
|
24
|
+
callbackURL?: string | undefined;
|
|
25
|
+
newUserCallbackURL?: string | undefined;
|
|
26
|
+
errorCallbackURL?: string | undefined;
|
|
27
|
+
disableRedirect?: boolean | undefined;
|
|
28
|
+
idToken?: {
|
|
29
|
+
token: string;
|
|
30
|
+
nonce?: string | undefined;
|
|
31
|
+
accessToken?: string | undefined;
|
|
32
|
+
refreshToken?: string | undefined;
|
|
33
|
+
expiresAt?: number | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
scopes?: string[] | undefined;
|
|
36
|
+
requestSignUp?: boolean | undefined;
|
|
37
|
+
loginHint?: string | undefined;
|
|
38
|
+
additionalData?: Record<string, any> | undefined;
|
|
39
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
40
|
+
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
|
|
41
|
+
callbackURL?: string | undefined;
|
|
42
|
+
newUserCallbackURL?: string | undefined;
|
|
43
|
+
errorCallbackURL?: string | undefined;
|
|
44
|
+
disableRedirect?: boolean | undefined;
|
|
45
|
+
idToken?: {
|
|
46
|
+
token: string;
|
|
47
|
+
nonce?: string | undefined;
|
|
48
|
+
accessToken?: string | undefined;
|
|
49
|
+
refreshToken?: string | undefined;
|
|
50
|
+
expiresAt?: number | undefined;
|
|
51
|
+
} | undefined;
|
|
52
|
+
scopes?: string[] | undefined;
|
|
53
|
+
requestSignUp?: boolean | undefined;
|
|
54
|
+
loginHint?: string | undefined;
|
|
55
|
+
additionalData?: Record<string, any> | undefined;
|
|
56
|
+
} & {
|
|
57
|
+
fetchOptions?: FetchOptions | undefined;
|
|
58
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
|
|
59
|
+
redirect: boolean;
|
|
60
|
+
url: string;
|
|
61
|
+
} | {
|
|
62
|
+
redirect: boolean;
|
|
63
|
+
token: string;
|
|
64
|
+
url: undefined;
|
|
65
|
+
user: {
|
|
66
|
+
id: string;
|
|
67
|
+
createdAt: Date;
|
|
68
|
+
updatedAt: Date;
|
|
69
|
+
email: string;
|
|
70
|
+
emailVerified: boolean;
|
|
71
|
+
name: string;
|
|
72
|
+
image?: string | null | undefined | undefined;
|
|
73
|
+
};
|
|
74
|
+
}>, {
|
|
75
|
+
code?: string | undefined;
|
|
76
|
+
message?: string | undefined;
|
|
77
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
78
|
+
} & {
|
|
79
|
+
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
80
|
+
email: string;
|
|
81
|
+
password: string;
|
|
82
|
+
callbackURL?: string | undefined;
|
|
83
|
+
rememberMe?: boolean | undefined;
|
|
84
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
85
|
+
email: string;
|
|
86
|
+
password: string;
|
|
87
|
+
callbackURL?: string | undefined;
|
|
88
|
+
rememberMe?: boolean | undefined;
|
|
89
|
+
} & {
|
|
90
|
+
fetchOptions?: FetchOptions | undefined;
|
|
91
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
92
|
+
redirect: boolean;
|
|
93
|
+
token: string;
|
|
94
|
+
url?: string | undefined;
|
|
95
|
+
user: {
|
|
96
|
+
id: string;
|
|
97
|
+
createdAt: Date;
|
|
98
|
+
updatedAt: Date;
|
|
99
|
+
email: string;
|
|
100
|
+
emailVerified: boolean;
|
|
101
|
+
name: string;
|
|
102
|
+
image?: string | null | undefined | undefined;
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
code?: string | undefined;
|
|
106
|
+
message?: string | undefined;
|
|
107
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
108
|
+
};
|
|
109
|
+
signIn: {
|
|
110
|
+
social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
111
|
+
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
|
|
112
|
+
callbackURL?: string | undefined;
|
|
113
|
+
newUserCallbackURL?: string | undefined;
|
|
114
|
+
errorCallbackURL?: string | undefined;
|
|
115
|
+
disableRedirect?: boolean | undefined;
|
|
116
|
+
idToken?: {
|
|
117
|
+
token: string;
|
|
118
|
+
nonce?: string | undefined;
|
|
119
|
+
accessToken?: string | undefined;
|
|
120
|
+
refreshToken?: string | undefined;
|
|
121
|
+
expiresAt?: number | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
scopes?: string[] | undefined;
|
|
124
|
+
requestSignUp?: boolean | undefined;
|
|
125
|
+
loginHint?: string | undefined;
|
|
126
|
+
additionalData?: Record<string, any> | undefined;
|
|
127
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
128
|
+
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {});
|
|
129
|
+
callbackURL?: string | undefined;
|
|
130
|
+
newUserCallbackURL?: string | undefined;
|
|
131
|
+
errorCallbackURL?: string | undefined;
|
|
132
|
+
disableRedirect?: boolean | undefined;
|
|
133
|
+
idToken?: {
|
|
134
|
+
token: string;
|
|
135
|
+
nonce?: string | undefined;
|
|
136
|
+
accessToken?: string | undefined;
|
|
137
|
+
refreshToken?: string | undefined;
|
|
138
|
+
expiresAt?: number | undefined;
|
|
139
|
+
} | undefined;
|
|
140
|
+
scopes?: string[] | undefined;
|
|
141
|
+
requestSignUp?: boolean | undefined;
|
|
142
|
+
loginHint?: string | undefined;
|
|
143
|
+
additionalData?: Record<string, any> | undefined;
|
|
144
|
+
} & {
|
|
145
|
+
fetchOptions?: FetchOptions | undefined;
|
|
146
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
|
|
147
|
+
redirect: boolean;
|
|
148
|
+
url: string;
|
|
149
|
+
} | {
|
|
150
|
+
redirect: boolean;
|
|
151
|
+
token: string;
|
|
152
|
+
url: undefined;
|
|
153
|
+
user: {
|
|
154
|
+
id: string;
|
|
155
|
+
createdAt: Date;
|
|
156
|
+
updatedAt: Date;
|
|
157
|
+
email: string;
|
|
158
|
+
emailVerified: boolean;
|
|
159
|
+
name: string;
|
|
160
|
+
image?: string | null | undefined | undefined;
|
|
161
|
+
};
|
|
162
|
+
}>, {
|
|
163
|
+
code?: string | undefined;
|
|
164
|
+
message?: string | undefined;
|
|
165
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
166
|
+
} & {
|
|
167
|
+
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
168
|
+
email: string;
|
|
169
|
+
password: string;
|
|
170
|
+
callbackURL?: string | undefined;
|
|
171
|
+
rememberMe?: boolean | undefined;
|
|
172
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
173
|
+
email: string;
|
|
174
|
+
password: string;
|
|
175
|
+
callbackURL?: string | undefined;
|
|
176
|
+
rememberMe?: boolean | undefined;
|
|
177
|
+
} & {
|
|
178
|
+
fetchOptions?: FetchOptions | undefined;
|
|
179
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
180
|
+
redirect: boolean;
|
|
181
|
+
token: string;
|
|
182
|
+
url?: string | undefined;
|
|
183
|
+
user: {
|
|
184
|
+
id: string;
|
|
185
|
+
createdAt: Date;
|
|
186
|
+
updatedAt: Date;
|
|
187
|
+
email: string;
|
|
188
|
+
emailVerified: boolean;
|
|
189
|
+
name: string;
|
|
190
|
+
image?: string | null | undefined | undefined;
|
|
191
|
+
};
|
|
192
|
+
}, {
|
|
193
|
+
code?: string | undefined;
|
|
194
|
+
message?: string | undefined;
|
|
195
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
196
|
+
};
|
|
197
|
+
signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
198
|
+
query?: Record<string, any> | undefined;
|
|
199
|
+
fetchOptions?: FetchOptions | undefined;
|
|
200
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
201
|
+
success: boolean;
|
|
202
|
+
}, {
|
|
203
|
+
code?: string | undefined;
|
|
204
|
+
message?: string | undefined;
|
|
205
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
206
|
+
signUp: {
|
|
207
|
+
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
208
|
+
name: string;
|
|
209
|
+
email: string;
|
|
210
|
+
password: string;
|
|
211
|
+
image?: string | undefined;
|
|
212
|
+
callbackURL?: string | undefined;
|
|
213
|
+
rememberMe?: boolean | undefined;
|
|
214
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
215
|
+
email: string;
|
|
216
|
+
name: string;
|
|
217
|
+
password: string;
|
|
218
|
+
image?: string | undefined;
|
|
219
|
+
callbackURL?: string | undefined;
|
|
220
|
+
fetchOptions?: FetchOptions | undefined;
|
|
221
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<{
|
|
222
|
+
token: null;
|
|
223
|
+
user: {
|
|
224
|
+
id: string;
|
|
225
|
+
createdAt: Date;
|
|
226
|
+
updatedAt: Date;
|
|
227
|
+
email: string;
|
|
228
|
+
emailVerified: boolean;
|
|
229
|
+
name: string;
|
|
230
|
+
image?: string | null | undefined | undefined;
|
|
231
|
+
};
|
|
232
|
+
} | {
|
|
233
|
+
token: string;
|
|
234
|
+
user: {
|
|
235
|
+
id: string;
|
|
236
|
+
createdAt: Date;
|
|
237
|
+
updatedAt: Date;
|
|
238
|
+
email: string;
|
|
239
|
+
emailVerified: boolean;
|
|
240
|
+
name: string;
|
|
241
|
+
image?: string | null | undefined | undefined;
|
|
242
|
+
};
|
|
243
|
+
}>, {
|
|
244
|
+
code?: string | undefined;
|
|
245
|
+
message?: string | undefined;
|
|
246
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
247
|
+
};
|
|
248
|
+
resetPassword: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
249
|
+
newPassword: string;
|
|
250
|
+
token?: string | undefined;
|
|
251
|
+
}> & Record<string, any>, Partial<{
|
|
252
|
+
token?: string | undefined;
|
|
253
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
254
|
+
newPassword: string;
|
|
255
|
+
token?: string | undefined;
|
|
256
|
+
} & {
|
|
257
|
+
fetchOptions?: FetchOptions | undefined;
|
|
258
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
259
|
+
status: boolean;
|
|
260
|
+
}, {
|
|
261
|
+
code?: string | undefined;
|
|
262
|
+
message?: string | undefined;
|
|
263
|
+
}, FetchOptions["throw"] extends true ? true : false>>) & {
|
|
264
|
+
":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
265
|
+
callbackURL: string;
|
|
266
|
+
}> & Record<string, any>, {
|
|
267
|
+
token: string;
|
|
268
|
+
}>>(data_0: better_auth.Prettify<{
|
|
269
|
+
query: {
|
|
270
|
+
callbackURL: string;
|
|
271
|
+
};
|
|
272
|
+
fetchOptions?: FetchOptions | undefined;
|
|
273
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
|
|
274
|
+
code?: string | undefined;
|
|
275
|
+
message?: string | undefined;
|
|
276
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
277
|
+
};
|
|
278
|
+
verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
279
|
+
token: string;
|
|
280
|
+
callbackURL?: string | undefined;
|
|
281
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
282
|
+
query: {
|
|
283
|
+
token: string;
|
|
284
|
+
callbackURL?: string | undefined;
|
|
285
|
+
};
|
|
286
|
+
fetchOptions?: FetchOptions | undefined;
|
|
287
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
|
|
288
|
+
status: boolean;
|
|
289
|
+
}>, {
|
|
290
|
+
code?: string | undefined;
|
|
291
|
+
message?: string | undefined;
|
|
292
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
293
|
+
sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
294
|
+
email: string;
|
|
295
|
+
callbackURL?: string | undefined;
|
|
296
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
297
|
+
email: string;
|
|
298
|
+
callbackURL?: string | undefined;
|
|
299
|
+
} & {
|
|
300
|
+
fetchOptions?: FetchOptions | undefined;
|
|
301
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
302
|
+
status: boolean;
|
|
303
|
+
}, {
|
|
304
|
+
code?: string | undefined;
|
|
305
|
+
message?: string | undefined;
|
|
306
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
307
|
+
changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
308
|
+
newEmail: string;
|
|
309
|
+
callbackURL?: string | undefined;
|
|
310
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
311
|
+
newEmail: string;
|
|
312
|
+
callbackURL?: string | undefined;
|
|
313
|
+
} & {
|
|
314
|
+
fetchOptions?: FetchOptions | undefined;
|
|
315
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
316
|
+
status: boolean;
|
|
317
|
+
}, {
|
|
318
|
+
code?: string | undefined;
|
|
319
|
+
message?: string | undefined;
|
|
320
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
321
|
+
changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
322
|
+
newPassword: string;
|
|
323
|
+
currentPassword: string;
|
|
324
|
+
revokeOtherSessions?: boolean | undefined;
|
|
325
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
326
|
+
newPassword: string;
|
|
327
|
+
currentPassword: string;
|
|
328
|
+
revokeOtherSessions?: boolean | undefined;
|
|
329
|
+
} & {
|
|
330
|
+
fetchOptions?: FetchOptions | undefined;
|
|
331
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
332
|
+
token: string | null;
|
|
333
|
+
user: {
|
|
334
|
+
id: string;
|
|
335
|
+
email: string;
|
|
336
|
+
name: string;
|
|
337
|
+
image: string | null | undefined;
|
|
338
|
+
emailVerified: boolean;
|
|
339
|
+
createdAt: Date;
|
|
340
|
+
updatedAt: Date;
|
|
341
|
+
};
|
|
342
|
+
}, {
|
|
343
|
+
code?: string | undefined;
|
|
344
|
+
message?: string | undefined;
|
|
345
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
346
|
+
updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
|
|
347
|
+
name?: string | undefined;
|
|
348
|
+
image?: string | undefined | null;
|
|
349
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
350
|
+
image?: (string | null) | undefined;
|
|
351
|
+
name?: string | undefined;
|
|
352
|
+
fetchOptions?: FetchOptions | undefined;
|
|
353
|
+
} & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
354
|
+
status: boolean;
|
|
355
|
+
}, {
|
|
356
|
+
code?: string | undefined;
|
|
357
|
+
message?: string | undefined;
|
|
358
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
359
|
+
deleteUser: (<FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
360
|
+
callbackURL?: string | undefined;
|
|
361
|
+
password?: string | undefined;
|
|
362
|
+
token?: string | undefined;
|
|
363
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
364
|
+
callbackURL?: string | undefined;
|
|
365
|
+
password?: string | undefined;
|
|
366
|
+
token?: string | undefined;
|
|
367
|
+
} & {
|
|
368
|
+
fetchOptions?: FetchOptions | undefined;
|
|
369
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
370
|
+
success: boolean;
|
|
371
|
+
message: string;
|
|
372
|
+
}, {
|
|
373
|
+
code?: string | undefined;
|
|
374
|
+
message?: string | undefined;
|
|
375
|
+
}, FetchOptions["throw"] extends true ? true : false>>) & {
|
|
376
|
+
callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
377
|
+
token: string;
|
|
378
|
+
callbackURL?: string | undefined;
|
|
379
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
380
|
+
query: {
|
|
381
|
+
token: string;
|
|
382
|
+
callbackURL?: string | undefined;
|
|
383
|
+
};
|
|
384
|
+
fetchOptions?: FetchOptions | undefined;
|
|
385
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
386
|
+
success: boolean;
|
|
387
|
+
message: string;
|
|
388
|
+
}, {
|
|
389
|
+
code?: string | undefined;
|
|
390
|
+
message?: string | undefined;
|
|
391
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
392
|
+
};
|
|
393
|
+
requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
394
|
+
email: string;
|
|
395
|
+
redirectTo?: string | undefined;
|
|
396
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
397
|
+
email: string;
|
|
398
|
+
redirectTo?: string | undefined;
|
|
399
|
+
} & {
|
|
400
|
+
fetchOptions?: FetchOptions | undefined;
|
|
401
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
402
|
+
status: boolean;
|
|
403
|
+
message: string;
|
|
404
|
+
}, {
|
|
405
|
+
code?: string | undefined;
|
|
406
|
+
message?: string | undefined;
|
|
407
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
408
|
+
listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
409
|
+
query?: Record<string, any> | undefined;
|
|
410
|
+
fetchOptions?: FetchOptions | undefined;
|
|
411
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
|
|
412
|
+
id: string;
|
|
413
|
+
createdAt: Date;
|
|
414
|
+
updatedAt: Date;
|
|
415
|
+
userId: string;
|
|
416
|
+
expiresAt: Date;
|
|
417
|
+
token: string;
|
|
418
|
+
ipAddress?: string | null | undefined | undefined;
|
|
419
|
+
userAgent?: string | null | undefined | undefined;
|
|
420
|
+
}>[], {
|
|
421
|
+
code?: string | undefined;
|
|
422
|
+
message?: string | undefined;
|
|
423
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
424
|
+
revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
425
|
+
token: string;
|
|
426
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
427
|
+
token: string;
|
|
428
|
+
} & {
|
|
429
|
+
fetchOptions?: FetchOptions | undefined;
|
|
430
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
431
|
+
status: boolean;
|
|
432
|
+
}, {
|
|
433
|
+
code?: string | undefined;
|
|
434
|
+
message?: string | undefined;
|
|
435
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
436
|
+
revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
437
|
+
query?: Record<string, any> | undefined;
|
|
438
|
+
fetchOptions?: FetchOptions | undefined;
|
|
439
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
440
|
+
status: boolean;
|
|
441
|
+
}, {
|
|
442
|
+
code?: string | undefined;
|
|
443
|
+
message?: string | undefined;
|
|
444
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
445
|
+
revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
446
|
+
query?: Record<string, any> | undefined;
|
|
447
|
+
fetchOptions?: FetchOptions | undefined;
|
|
448
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
449
|
+
status: boolean;
|
|
450
|
+
}, {
|
|
451
|
+
code?: string | undefined;
|
|
452
|
+
message?: string | undefined;
|
|
453
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
454
|
+
linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
455
|
+
provider: unknown;
|
|
456
|
+
callbackURL?: string | undefined;
|
|
457
|
+
idToken?: {
|
|
458
|
+
token: string;
|
|
459
|
+
nonce?: string | undefined;
|
|
460
|
+
accessToken?: string | undefined;
|
|
461
|
+
refreshToken?: string | undefined;
|
|
462
|
+
scopes?: string[] | undefined;
|
|
463
|
+
} | undefined;
|
|
464
|
+
requestSignUp?: boolean | undefined;
|
|
465
|
+
scopes?: string[] | undefined;
|
|
466
|
+
errorCallbackURL?: string | undefined;
|
|
467
|
+
disableRedirect?: boolean | undefined;
|
|
468
|
+
additionalData?: Record<string, any> | undefined;
|
|
469
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
470
|
+
provider: unknown;
|
|
471
|
+
callbackURL?: string | undefined;
|
|
472
|
+
idToken?: {
|
|
473
|
+
token: string;
|
|
474
|
+
nonce?: string | undefined;
|
|
475
|
+
accessToken?: string | undefined;
|
|
476
|
+
refreshToken?: string | undefined;
|
|
477
|
+
scopes?: string[] | undefined;
|
|
478
|
+
} | undefined;
|
|
479
|
+
requestSignUp?: boolean | undefined;
|
|
480
|
+
scopes?: string[] | undefined;
|
|
481
|
+
errorCallbackURL?: string | undefined;
|
|
482
|
+
disableRedirect?: boolean | undefined;
|
|
483
|
+
additionalData?: Record<string, any> | undefined;
|
|
484
|
+
} & {
|
|
485
|
+
fetchOptions?: FetchOptions | undefined;
|
|
486
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
487
|
+
url: string;
|
|
488
|
+
redirect: boolean;
|
|
489
|
+
}, {
|
|
490
|
+
code?: string | undefined;
|
|
491
|
+
message?: string | undefined;
|
|
492
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
493
|
+
listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
494
|
+
query?: Record<string, any> | undefined;
|
|
495
|
+
fetchOptions?: FetchOptions | undefined;
|
|
496
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
497
|
+
id: string;
|
|
498
|
+
providerId: string;
|
|
499
|
+
createdAt: Date;
|
|
500
|
+
updatedAt: Date;
|
|
501
|
+
accountId: string;
|
|
502
|
+
userId: string;
|
|
503
|
+
scopes: string[];
|
|
504
|
+
}[], {
|
|
505
|
+
code?: string | undefined;
|
|
506
|
+
message?: string | undefined;
|
|
507
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
508
|
+
unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
509
|
+
providerId: string;
|
|
510
|
+
accountId?: string | undefined;
|
|
511
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
512
|
+
providerId: string;
|
|
513
|
+
accountId?: string | undefined;
|
|
514
|
+
} & {
|
|
515
|
+
fetchOptions?: FetchOptions | undefined;
|
|
516
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
517
|
+
status: boolean;
|
|
518
|
+
}, {
|
|
519
|
+
code?: string | undefined;
|
|
520
|
+
message?: string | undefined;
|
|
521
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
522
|
+
refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
523
|
+
providerId: string;
|
|
524
|
+
accountId?: string | undefined;
|
|
525
|
+
userId?: string | undefined;
|
|
526
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
527
|
+
providerId: string;
|
|
528
|
+
accountId?: string | undefined;
|
|
529
|
+
userId?: string | undefined;
|
|
530
|
+
} & {
|
|
531
|
+
fetchOptions?: FetchOptions | undefined;
|
|
532
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
533
|
+
accessToken: string | undefined;
|
|
534
|
+
refreshToken: string | undefined;
|
|
535
|
+
accessTokenExpiresAt: Date | undefined;
|
|
536
|
+
refreshTokenExpiresAt: Date | undefined;
|
|
537
|
+
scope: string | null | undefined;
|
|
538
|
+
idToken: string | null | undefined;
|
|
539
|
+
providerId: string;
|
|
540
|
+
accountId: string;
|
|
541
|
+
}, {
|
|
542
|
+
code?: string | undefined;
|
|
543
|
+
message?: string | undefined;
|
|
544
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
545
|
+
getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
546
|
+
providerId: string;
|
|
547
|
+
accountId?: string | undefined;
|
|
548
|
+
userId?: string | undefined;
|
|
549
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
550
|
+
providerId: string;
|
|
551
|
+
accountId?: string | undefined;
|
|
552
|
+
userId?: string | undefined;
|
|
553
|
+
} & {
|
|
554
|
+
fetchOptions?: FetchOptions | undefined;
|
|
555
|
+
}>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
556
|
+
accessToken: string;
|
|
557
|
+
accessTokenExpiresAt: Date | undefined;
|
|
558
|
+
scopes: string[];
|
|
559
|
+
idToken: string | undefined;
|
|
560
|
+
}, {
|
|
561
|
+
code?: string | undefined;
|
|
562
|
+
message?: string | undefined;
|
|
563
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
564
|
+
accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
565
|
+
accountId?: string | undefined;
|
|
566
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
567
|
+
query?: {
|
|
568
|
+
accountId?: string | undefined;
|
|
569
|
+
} | undefined;
|
|
570
|
+
fetchOptions?: FetchOptions | undefined;
|
|
571
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
572
|
+
user: better_auth.OAuth2UserInfo;
|
|
573
|
+
data: Record<string, any>;
|
|
574
|
+
}, {
|
|
575
|
+
code?: string | undefined;
|
|
576
|
+
message?: string | undefined;
|
|
577
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
578
|
+
getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
579
|
+
disableCookieCache?: unknown;
|
|
580
|
+
disableRefresh?: unknown;
|
|
581
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
582
|
+
query?: {
|
|
583
|
+
disableCookieCache?: unknown;
|
|
584
|
+
disableRefresh?: unknown;
|
|
585
|
+
} | undefined;
|
|
586
|
+
fetchOptions?: FetchOptions | undefined;
|
|
587
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
588
|
+
user: {
|
|
589
|
+
id: string;
|
|
590
|
+
createdAt: Date;
|
|
591
|
+
updatedAt: Date;
|
|
592
|
+
email: string;
|
|
593
|
+
emailVerified: boolean;
|
|
594
|
+
name: string;
|
|
595
|
+
image?: string | null | undefined;
|
|
596
|
+
};
|
|
597
|
+
session: {
|
|
598
|
+
id: string;
|
|
599
|
+
createdAt: Date;
|
|
600
|
+
updatedAt: Date;
|
|
601
|
+
userId: string;
|
|
602
|
+
expiresAt: Date;
|
|
603
|
+
token: string;
|
|
604
|
+
ipAddress?: string | null | undefined;
|
|
605
|
+
userAgent?: string | null | undefined;
|
|
606
|
+
};
|
|
607
|
+
} | null, {
|
|
608
|
+
code?: string | undefined;
|
|
609
|
+
message?: string | undefined;
|
|
610
|
+
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
611
|
+
useSession: () => nanostores.Atom<{
|
|
612
|
+
data: {
|
|
613
|
+
user: {
|
|
614
|
+
id: string;
|
|
615
|
+
createdAt: Date;
|
|
616
|
+
updatedAt: Date;
|
|
617
|
+
email: string;
|
|
618
|
+
emailVerified: boolean;
|
|
619
|
+
name: string;
|
|
620
|
+
image?: string | null | undefined;
|
|
621
|
+
};
|
|
622
|
+
session: {
|
|
623
|
+
id: string;
|
|
624
|
+
createdAt: Date;
|
|
625
|
+
updatedAt: Date;
|
|
626
|
+
userId: string;
|
|
627
|
+
expiresAt: Date;
|
|
628
|
+
token: string;
|
|
629
|
+
ipAddress?: string | null | undefined;
|
|
630
|
+
userAgent?: string | null | undefined;
|
|
631
|
+
};
|
|
632
|
+
} | null;
|
|
633
|
+
error: _better_fetch_fetch.BetterFetchError | null;
|
|
634
|
+
isPending: boolean;
|
|
635
|
+
isRefetching: boolean;
|
|
636
|
+
refetch: (queryParams?: {
|
|
637
|
+
query?: better_auth.SessionQueryParams;
|
|
638
|
+
} | undefined) => Promise<void>;
|
|
639
|
+
}>;
|
|
640
|
+
$fetch: _better_fetch_fetch.BetterFetch<{
|
|
641
|
+
plugins: (_better_fetch_fetch.BetterFetchPlugin<Record<string, any>> | {
|
|
642
|
+
id: string;
|
|
643
|
+
name: string;
|
|
644
|
+
hooks: {
|
|
645
|
+
onSuccess(context: _better_fetch_fetch.SuccessContext<any>): void;
|
|
646
|
+
};
|
|
647
|
+
} | {
|
|
648
|
+
id: string;
|
|
649
|
+
name: string;
|
|
650
|
+
hooks: {
|
|
651
|
+
onSuccess: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
652
|
+
onError: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
|
|
653
|
+
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
|
|
654
|
+
onResponse: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
|
|
655
|
+
};
|
|
656
|
+
})[];
|
|
657
|
+
cache?: RequestCache | undefined;
|
|
658
|
+
method: string;
|
|
659
|
+
window?: null | undefined;
|
|
660
|
+
headers?: (HeadersInit & (HeadersInit | {
|
|
661
|
+
accept: "application/json" | "text/plain" | "application/octet-stream";
|
|
662
|
+
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
663
|
+
authorization: "Bearer" | "Basic";
|
|
664
|
+
})) | undefined;
|
|
665
|
+
redirect?: RequestRedirect | undefined;
|
|
666
|
+
credentials?: RequestCredentials;
|
|
667
|
+
integrity?: string | undefined;
|
|
668
|
+
keepalive?: boolean | undefined;
|
|
669
|
+
mode?: RequestMode | undefined;
|
|
670
|
+
priority?: RequestPriority | undefined;
|
|
671
|
+
referrer?: string | undefined;
|
|
672
|
+
referrerPolicy?: ReferrerPolicy | undefined;
|
|
673
|
+
signal?: (AbortSignal | null) | undefined;
|
|
674
|
+
onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
|
|
675
|
+
hookOptions?: {
|
|
676
|
+
cloneResponse?: boolean;
|
|
677
|
+
} | undefined;
|
|
678
|
+
timeout?: number | undefined;
|
|
679
|
+
customFetchImpl: _better_fetch_fetch.FetchEsque;
|
|
680
|
+
baseURL: string;
|
|
681
|
+
throw?: boolean | undefined;
|
|
682
|
+
auth?: ({
|
|
683
|
+
type: "Bearer";
|
|
684
|
+
token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
|
|
685
|
+
} | {
|
|
686
|
+
type: "Basic";
|
|
687
|
+
username: string | (() => string | undefined) | undefined;
|
|
688
|
+
password: string | (() => string | undefined) | undefined;
|
|
689
|
+
} | {
|
|
690
|
+
type: "Custom";
|
|
691
|
+
prefix: string | (() => string | undefined) | undefined;
|
|
692
|
+
value: string | (() => string | undefined) | undefined;
|
|
693
|
+
}) | undefined;
|
|
694
|
+
body?: any;
|
|
695
|
+
query?: any;
|
|
696
|
+
params?: any;
|
|
697
|
+
duplex?: "full" | "half" | undefined;
|
|
698
|
+
jsonParser: (text: string) => Promise<any> | any;
|
|
699
|
+
retry?: _better_fetch_fetch.RetryOptions | undefined;
|
|
700
|
+
retryAttempt?: number | undefined;
|
|
701
|
+
output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
702
|
+
errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
|
|
703
|
+
disableValidation?: boolean | undefined;
|
|
704
|
+
disableSignal?: boolean | undefined;
|
|
705
|
+
}, unknown, unknown, {}>;
|
|
706
|
+
$store: {
|
|
707
|
+
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
708
|
+
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
709
|
+
atoms: Record<string, nanostores.WritableAtom<any>>;
|
|
710
|
+
};
|
|
711
|
+
$Infer: {
|
|
712
|
+
Session: {
|
|
713
|
+
user: {
|
|
714
|
+
id: string;
|
|
715
|
+
createdAt: Date;
|
|
716
|
+
updatedAt: Date;
|
|
717
|
+
email: string;
|
|
718
|
+
emailVerified: boolean;
|
|
719
|
+
name: string;
|
|
720
|
+
image?: string | null | undefined;
|
|
721
|
+
};
|
|
722
|
+
session: {
|
|
723
|
+
id: string;
|
|
724
|
+
createdAt: Date;
|
|
725
|
+
updatedAt: Date;
|
|
726
|
+
userId: string;
|
|
727
|
+
expiresAt: Date;
|
|
728
|
+
token: string;
|
|
729
|
+
ipAddress?: string | null | undefined;
|
|
730
|
+
userAgent?: string | null | undefined;
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
};
|
|
734
|
+
$ERROR_CODES: {
|
|
735
|
+
readonly USER_NOT_FOUND: "User not found";
|
|
736
|
+
readonly FAILED_TO_CREATE_USER: "Failed to create user";
|
|
737
|
+
readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
|
|
738
|
+
readonly FAILED_TO_UPDATE_USER: "Failed to update user";
|
|
739
|
+
readonly FAILED_TO_GET_SESSION: "Failed to get session";
|
|
740
|
+
readonly INVALID_PASSWORD: "Invalid password";
|
|
741
|
+
readonly INVALID_EMAIL: "Invalid email";
|
|
742
|
+
readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
|
|
743
|
+
readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
|
|
744
|
+
readonly PROVIDER_NOT_FOUND: "Provider not found";
|
|
745
|
+
readonly INVALID_TOKEN: "Invalid token";
|
|
746
|
+
readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
|
|
747
|
+
readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
|
|
748
|
+
readonly USER_EMAIL_NOT_FOUND: "User email not found";
|
|
749
|
+
readonly EMAIL_NOT_VERIFIED: "Email not verified";
|
|
750
|
+
readonly PASSWORD_TOO_SHORT: "Password too short";
|
|
751
|
+
readonly PASSWORD_TOO_LONG: "Password too long";
|
|
752
|
+
readonly USER_ALREADY_EXISTS: "User already exists.";
|
|
753
|
+
readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
|
|
754
|
+
readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
|
|
755
|
+
readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
|
|
756
|
+
readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
|
|
757
|
+
readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
|
|
758
|
+
readonly ACCOUNT_NOT_FOUND: "Account not found";
|
|
759
|
+
readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
|
|
760
|
+
readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
|
|
761
|
+
readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
|
|
762
|
+
readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
|
|
763
|
+
readonly EMAIL_MISMATCH: "Email mismatch";
|
|
764
|
+
readonly SESSION_NOT_FRESH: "Session is not fresh";
|
|
765
|
+
readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
|
|
766
|
+
readonly INVALID_ORIGIN: "Invalid origin";
|
|
767
|
+
readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
|
|
768
|
+
readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
|
|
769
|
+
readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
|
|
770
|
+
readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
|
|
771
|
+
readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
|
|
772
|
+
readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
|
|
773
|
+
readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
|
|
774
|
+
readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
|
|
775
|
+
readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
|
|
776
|
+
readonly VALIDATION_ERROR: "Validation Error";
|
|
777
|
+
readonly MISSING_FIELD: "Field is required";
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
/**
|
|
781
|
+
* Server-side Auth instance.
|
|
782
|
+
* Use this in your +page.server.ts, hooks.server.ts, and API routes.
|
|
783
|
+
*/
|
|
784
|
+
declare const server: {
|
|
785
|
+
/**
|
|
786
|
+
* The underlying BetterAuth instance.
|
|
787
|
+
*/
|
|
788
|
+
auth: better_auth.Auth<{
|
|
789
|
+
database: (options: better_auth.BetterAuthOptions) => better_auth.DBAdapter<better_auth.BetterAuthOptions>;
|
|
790
|
+
baseURL: string | undefined;
|
|
791
|
+
secret: string | undefined;
|
|
792
|
+
trustedOrigins: string[] | undefined;
|
|
793
|
+
socialProviders: {
|
|
794
|
+
google: {
|
|
795
|
+
clientId: string;
|
|
796
|
+
clientSecret: string;
|
|
797
|
+
};
|
|
798
|
+
};
|
|
799
|
+
session: {
|
|
800
|
+
expiresIn: number;
|
|
801
|
+
updateAge: number;
|
|
802
|
+
cookieCache: {
|
|
803
|
+
enabled: true;
|
|
804
|
+
maxAge: number;
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
}>;
|
|
808
|
+
/**
|
|
809
|
+
* SvelteKit request handler for auth routes.
|
|
810
|
+
* Place this in `src/routes/api/auth/[...auth]/+server.ts`
|
|
811
|
+
*/
|
|
812
|
+
handler: {
|
|
813
|
+
GET: (event: {
|
|
814
|
+
request: Request;
|
|
815
|
+
}) => Response | Promise<Response>;
|
|
816
|
+
POST: (event: {
|
|
817
|
+
request: Request;
|
|
818
|
+
}) => Response | Promise<Response>;
|
|
819
|
+
};
|
|
820
|
+
/**
|
|
821
|
+
* Creates a SvelteKit handle hook for session management.
|
|
822
|
+
*/
|
|
823
|
+
createHandle: () => Handle;
|
|
824
|
+
/**
|
|
825
|
+
* Get session from request event.
|
|
826
|
+
*/
|
|
827
|
+
getSession: (event: RequestEvent) => Promise<SessionResult>;
|
|
828
|
+
/**
|
|
829
|
+
* Check if user is authenticated.
|
|
830
|
+
*/
|
|
831
|
+
isAuthenticated: (event: RequestEvent) => Promise<boolean>;
|
|
832
|
+
/**
|
|
833
|
+
* Wraps a function to ensure the user is authenticated before execution.
|
|
834
|
+
* Injects the user, session, and db into the first argument.
|
|
835
|
+
*/
|
|
836
|
+
makeAuthenticatedCall: <TArgs extends any[], TReturn>(fn: (ctx: {
|
|
837
|
+
user: SessionData["user"];
|
|
838
|
+
session: SessionData["session"];
|
|
839
|
+
db: typeof db;
|
|
840
|
+
event: RequestEvent;
|
|
841
|
+
}, ...args: TArgs) => Promise<TReturn>) => (event: RequestEvent, ...args: TArgs) => Promise<TReturn>;
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
export { SessionData, SessionResult, client, server };
|