deesse 0.1.3 → 0.1.4

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.
@@ -1 +1,1026 @@
1
- export declare const auth: import("better-auth/*").Auth<import("better-auth/*").BetterAuthOptions>;
1
+ import { Pool } from "pg";
2
+ export declare const auth: import("better-auth").Auth<{
3
+ secret: string | undefined;
4
+ appName?: string | undefined | undefined;
5
+ baseURL?: string | undefined | undefined;
6
+ basePath?: string | undefined | undefined;
7
+ secondaryStorage?: import("better-auth").SecondaryStorage | undefined;
8
+ emailVerification?: {
9
+ sendVerificationEmail?: (data: {
10
+ user: import("better-auth").User;
11
+ url: string;
12
+ token: string;
13
+ }, request?: Request) => Promise<void>;
14
+ sendOnSignUp?: boolean;
15
+ sendOnSignIn?: boolean;
16
+ autoSignInAfterVerification?: boolean;
17
+ expiresIn?: number;
18
+ onEmailVerification?: (user: import("better-auth").User, request?: Request) => Promise<void>;
19
+ afterEmailVerification?: (user: import("better-auth").User, request?: Request) => Promise<void>;
20
+ } | undefined | undefined;
21
+ emailAndPassword?: {
22
+ enabled: boolean;
23
+ disableSignUp?: boolean;
24
+ requireEmailVerification?: boolean;
25
+ maxPasswordLength?: number;
26
+ minPasswordLength?: number;
27
+ sendResetPassword?: (data: {
28
+ user: import("better-auth").User;
29
+ url: string;
30
+ token: string;
31
+ }, request?: Request) => Promise<void>;
32
+ resetPasswordTokenExpiresIn?: number;
33
+ onPasswordReset?: (data: {
34
+ user: import("better-auth").User;
35
+ }, request?: Request) => Promise<void>;
36
+ password?: {
37
+ hash?: (password: string) => Promise<string>;
38
+ verify?: (data: {
39
+ hash: string;
40
+ password: string;
41
+ }) => Promise<boolean>;
42
+ };
43
+ autoSignIn?: boolean;
44
+ revokeSessionsOnPasswordReset?: boolean;
45
+ } | undefined | undefined;
46
+ socialProviders?: import("@better-auth/core/dist/index-CVLGS-cz.mjs").w | undefined;
47
+ plugins?: ([] | import("better-auth").BetterAuthPlugin[]) | undefined | undefined;
48
+ user?: {
49
+ modelName?: string;
50
+ fields?: Partial<Record<"email" | "createdAt" | "updatedAt" | "emailVerified" | "name" | "image", string>>;
51
+ additionalFields?: {
52
+ [key: string]: import("better-auth").DBFieldAttribute;
53
+ };
54
+ changeEmail?: {
55
+ enabled: boolean;
56
+ sendChangeEmailVerification?: (data: {
57
+ user: import("better-auth").User;
58
+ newEmail: string;
59
+ url: string;
60
+ token: string;
61
+ }, request?: Request) => Promise<void>;
62
+ sendChangeEmailConfirmation?: (data: {
63
+ user: import("better-auth").User;
64
+ newEmail: string;
65
+ url: string;
66
+ token: string;
67
+ }, request?: Request) => Promise<void>;
68
+ updateEmailWithoutVerification?: boolean;
69
+ };
70
+ deleteUser?: {
71
+ enabled?: boolean;
72
+ sendDeleteAccountVerification?: (data: {
73
+ user: import("better-auth").User;
74
+ url: string;
75
+ token: string;
76
+ }, request?: Request) => Promise<void>;
77
+ beforeDelete?: (user: import("better-auth").User, request?: Request) => Promise<void>;
78
+ afterDelete?: (user: import("better-auth").User, request?: Request) => Promise<void>;
79
+ deleteTokenExpiresIn?: number;
80
+ };
81
+ } | undefined | undefined;
82
+ session?: {
83
+ modelName?: string;
84
+ fields?: Partial<Record<"createdAt" | "updatedAt" | "userId" | "expiresAt" | "token" | "ipAddress" | "userAgent", string>>;
85
+ expiresIn?: number;
86
+ updateAge?: number;
87
+ disableSessionRefresh?: boolean;
88
+ additionalFields?: {
89
+ [key: string]: import("better-auth").DBFieldAttribute;
90
+ };
91
+ storeSessionInDatabase?: boolean;
92
+ preserveSessionInDatabase?: boolean;
93
+ cookieCache?: {
94
+ maxAge?: number;
95
+ enabled?: boolean;
96
+ strategy?: "compact" | "jwt" | "jwe";
97
+ refreshCache?: boolean | {
98
+ updateAge?: number;
99
+ };
100
+ version?: string | ((session: import("better-auth").Session & Record<string, any>, user: import("better-auth").User & Record<string, any>) => string) | ((session: import("better-auth").Session & Record<string, any>, user: import("better-auth").User & Record<string, any>) => Promise<string>);
101
+ };
102
+ freshAge?: number;
103
+ } | undefined | undefined;
104
+ account?: {
105
+ modelName?: string;
106
+ fields?: Partial<Record<"createdAt" | "updatedAt" | "userId" | "refreshToken" | "idToken" | "accessToken" | "password" | "providerId" | "accountId" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "scope", string>>;
107
+ additionalFields?: {
108
+ [key: string]: import("better-auth").DBFieldAttribute;
109
+ };
110
+ updateAccountOnSignIn?: boolean;
111
+ accountLinking?: {
112
+ enabled?: boolean;
113
+ trustedProviders?: Array<import("better-auth").LiteralUnion<import("@better-auth/core/dist/index-CVLGS-cz.mjs").S[number] | "email-password", string>>;
114
+ allowDifferentEmails?: boolean;
115
+ allowUnlinkingAll?: boolean;
116
+ updateUserInfoOnLink?: boolean;
117
+ };
118
+ encryptOAuthTokens?: boolean;
119
+ skipStateCookieCheck?: boolean;
120
+ storeStateStrategy?: "database" | "cookie";
121
+ storeAccountCookie?: boolean;
122
+ } | undefined | undefined;
123
+ verification?: {
124
+ modelName?: string;
125
+ fields?: Partial<Record<"createdAt" | "updatedAt" | "expiresAt" | "value" | "identifier", string>>;
126
+ disableCleanup?: boolean;
127
+ } | undefined | undefined;
128
+ trustedOrigins?: (string[] | ((request: Request) => string[] | Promise<string[]>)) | undefined | undefined;
129
+ rateLimit?: import("better-auth").BetterAuthRateLimitOptions | undefined;
130
+ advanced?: import("better-auth").BetterAuthAdvancedOptions | undefined;
131
+ logger?: import("better-auth").Logger | undefined;
132
+ databaseHooks?: {
133
+ user?: {
134
+ create?: {
135
+ before?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
136
+ data: {
137
+ id?: string | undefined;
138
+ createdAt?: Date | undefined;
139
+ updatedAt?: Date | undefined;
140
+ email?: string | undefined;
141
+ emailVerified?: boolean | undefined;
142
+ name?: string | undefined;
143
+ image?: string | null | undefined;
144
+ } & Record<string, any>;
145
+ }>;
146
+ after?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
147
+ };
148
+ update?: {
149
+ before?: (user: Partial<import("better-auth").User> & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
150
+ data: {
151
+ [x: string]: any;
152
+ id?: string | undefined;
153
+ createdAt?: Date | undefined;
154
+ updatedAt?: Date | undefined;
155
+ email?: string | undefined;
156
+ emailVerified?: boolean | undefined;
157
+ name?: string | undefined;
158
+ image?: string | null | undefined;
159
+ };
160
+ }>;
161
+ after?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
162
+ };
163
+ delete?: {
164
+ before?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void>;
165
+ after?: (user: import("better-auth").User & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
166
+ };
167
+ };
168
+ session?: {
169
+ create?: {
170
+ before?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
171
+ data: {
172
+ id?: string | undefined;
173
+ createdAt?: Date | undefined;
174
+ updatedAt?: Date | undefined;
175
+ userId?: string | undefined;
176
+ expiresAt?: Date | undefined;
177
+ token?: string | undefined;
178
+ ipAddress?: string | null | undefined;
179
+ userAgent?: string | null | undefined;
180
+ } & Record<string, any>;
181
+ }>;
182
+ after?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
183
+ };
184
+ update?: {
185
+ before?: (session: Partial<import("better-auth").Session> & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
186
+ data: {
187
+ [x: string]: any;
188
+ id?: string | undefined;
189
+ createdAt?: Date | undefined;
190
+ updatedAt?: Date | undefined;
191
+ userId?: string | undefined;
192
+ expiresAt?: Date | undefined;
193
+ token?: string | undefined;
194
+ ipAddress?: string | null | undefined;
195
+ userAgent?: string | null | undefined;
196
+ };
197
+ }>;
198
+ after?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
199
+ };
200
+ delete?: {
201
+ before?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void>;
202
+ after?: (session: import("better-auth").Session & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
203
+ };
204
+ };
205
+ account?: {
206
+ create?: {
207
+ before?: (account: import("better-auth").Account, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
208
+ data: {
209
+ id?: string | undefined;
210
+ createdAt?: Date | undefined;
211
+ updatedAt?: Date | undefined;
212
+ providerId?: string | undefined;
213
+ accountId?: string | undefined;
214
+ userId?: string | undefined;
215
+ accessToken?: string | null | undefined;
216
+ refreshToken?: string | null | undefined;
217
+ idToken?: string | null | undefined;
218
+ accessTokenExpiresAt?: Date | null | undefined;
219
+ refreshTokenExpiresAt?: Date | null | undefined;
220
+ scope?: string | null | undefined;
221
+ password?: string | null | undefined;
222
+ } & Record<string, any>;
223
+ }>;
224
+ after?: (account: import("better-auth").Account, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
225
+ };
226
+ update?: {
227
+ before?: (account: Partial<import("better-auth").Account> & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
228
+ data: {
229
+ [x: string]: any;
230
+ id?: string | undefined;
231
+ createdAt?: Date | undefined;
232
+ updatedAt?: Date | undefined;
233
+ providerId?: string | undefined;
234
+ accountId?: string | undefined;
235
+ userId?: string | undefined;
236
+ accessToken?: string | null | undefined;
237
+ refreshToken?: string | null | undefined;
238
+ idToken?: string | null | undefined;
239
+ accessTokenExpiresAt?: Date | null | undefined;
240
+ refreshTokenExpiresAt?: Date | null | undefined;
241
+ scope?: string | null | undefined;
242
+ password?: string | null | undefined;
243
+ };
244
+ }>;
245
+ after?: (account: import("better-auth").Account & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
246
+ };
247
+ delete?: {
248
+ before?: (account: import("better-auth").Account & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void>;
249
+ after?: (account: import("better-auth").Account & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
250
+ };
251
+ };
252
+ verification?: {
253
+ create?: {
254
+ before?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
255
+ data: {
256
+ id?: string | undefined;
257
+ createdAt?: Date | undefined;
258
+ updatedAt?: Date | undefined;
259
+ value?: string | undefined;
260
+ expiresAt?: Date | undefined;
261
+ identifier?: string | undefined;
262
+ } & Record<string, any>;
263
+ }>;
264
+ after?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
265
+ };
266
+ update?: {
267
+ before?: (verification: Partial<import("better-auth").Verification> & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void | {
268
+ data: {
269
+ [x: string]: any;
270
+ id?: string | undefined;
271
+ createdAt?: Date | undefined;
272
+ updatedAt?: Date | undefined;
273
+ value?: string | undefined;
274
+ expiresAt?: Date | undefined;
275
+ identifier?: string | undefined;
276
+ };
277
+ }>;
278
+ after?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
279
+ };
280
+ delete?: {
281
+ before?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<boolean | void>;
282
+ after?: (verification: import("better-auth").Verification & Record<string, unknown>, context?: import("better-auth").GenericEndpointContext) => Promise<void>;
283
+ };
284
+ };
285
+ } | undefined | undefined;
286
+ onAPIError?: {
287
+ throw?: boolean;
288
+ onError?: (error: unknown, ctx: import("better-auth").AuthContext) => void | Promise<void>;
289
+ errorURL?: string;
290
+ customizeDefaultErrorPage?: {
291
+ colors?: {
292
+ background?: string;
293
+ foreground?: string;
294
+ primary?: string;
295
+ primaryForeground?: string;
296
+ mutedForeground?: string;
297
+ border?: string;
298
+ destructive?: string;
299
+ titleBorder?: string;
300
+ titleColor?: string;
301
+ gridColor?: string;
302
+ cardBackground?: string;
303
+ cornerBorder?: string;
304
+ };
305
+ size?: {
306
+ radiusSm?: string;
307
+ radiusMd?: string;
308
+ radiusLg?: string;
309
+ textSm?: string;
310
+ text2xl?: string;
311
+ text4xl?: string;
312
+ text6xl?: string;
313
+ };
314
+ font?: {
315
+ defaultFamily?: string;
316
+ monoFamily?: string;
317
+ };
318
+ disableTitleBorder?: boolean;
319
+ disableCornerDecorations?: boolean;
320
+ disableBackgroundGrid?: boolean;
321
+ };
322
+ } | undefined | undefined;
323
+ hooks?: {
324
+ before?: import("@better-auth/core/api").AuthMiddleware;
325
+ after?: import("@better-auth/core/api").AuthMiddleware;
326
+ } | undefined | undefined;
327
+ disabledPaths?: string[] | undefined | undefined;
328
+ telemetry?: {
329
+ enabled?: boolean;
330
+ debug?: boolean;
331
+ } | undefined | undefined;
332
+ experimental?: {
333
+ joins?: boolean;
334
+ } | undefined;
335
+ database: Pool;
336
+ }>;
337
+ export declare const authClient: {
338
+ signIn: {
339
+ social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
340
+ 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 & {});
341
+ callbackURL?: string | undefined;
342
+ newUserCallbackURL?: string | undefined;
343
+ errorCallbackURL?: string | undefined;
344
+ disableRedirect?: boolean | undefined;
345
+ idToken?: {
346
+ token: string;
347
+ nonce?: string | undefined;
348
+ accessToken?: string | undefined;
349
+ refreshToken?: string | undefined;
350
+ expiresAt?: number | undefined;
351
+ } | undefined;
352
+ scopes?: string[] | undefined;
353
+ requestSignUp?: boolean | undefined;
354
+ loginHint?: string | undefined;
355
+ additionalData?: Record<string, any> | undefined;
356
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
357
+ 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 & {});
358
+ callbackURL?: string | undefined;
359
+ newUserCallbackURL?: string | undefined;
360
+ errorCallbackURL?: string | undefined;
361
+ disableRedirect?: boolean | undefined;
362
+ idToken?: {
363
+ token: string;
364
+ nonce?: string | undefined;
365
+ accessToken?: string | undefined;
366
+ refreshToken?: string | undefined;
367
+ expiresAt?: number | undefined;
368
+ } | undefined;
369
+ scopes?: string[] | undefined;
370
+ requestSignUp?: boolean | undefined;
371
+ loginHint?: string | undefined;
372
+ additionalData?: Record<string, any> | undefined;
373
+ } & {
374
+ fetchOptions?: FetchOptions | undefined;
375
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
376
+ redirect: boolean;
377
+ url: string;
378
+ } | {
379
+ redirect: boolean;
380
+ token: string;
381
+ url: undefined;
382
+ user: {
383
+ id: string;
384
+ createdAt: Date;
385
+ updatedAt: Date;
386
+ email: string;
387
+ emailVerified: boolean;
388
+ name: string;
389
+ image?: string | null | undefined | undefined;
390
+ };
391
+ }>, {
392
+ code?: string | undefined;
393
+ message?: string | undefined;
394
+ }, FetchOptions["throw"] extends true ? true : false>>;
395
+ };
396
+ } & {
397
+ signOut: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
398
+ query?: Record<string, any> | undefined;
399
+ fetchOptions?: FetchOptions | undefined;
400
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
401
+ success: boolean;
402
+ }, {
403
+ code?: string | undefined;
404
+ message?: string | undefined;
405
+ }, FetchOptions["throw"] extends true ? true : false>>;
406
+ } & {
407
+ signUp: {
408
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
409
+ name: string;
410
+ email: string;
411
+ password: string;
412
+ image?: string | undefined;
413
+ callbackURL?: string | undefined;
414
+ rememberMe?: boolean | undefined;
415
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
416
+ email: string;
417
+ name: string;
418
+ password: string;
419
+ image?: string | undefined;
420
+ callbackURL?: string | undefined;
421
+ fetchOptions?: FetchOptions | undefined;
422
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<{
423
+ token: null;
424
+ user: {
425
+ id: string;
426
+ createdAt: Date;
427
+ updatedAt: Date;
428
+ email: string;
429
+ emailVerified: boolean;
430
+ name: string;
431
+ image?: string | null | undefined | undefined;
432
+ };
433
+ } | {
434
+ token: string;
435
+ user: {
436
+ id: string;
437
+ createdAt: Date;
438
+ updatedAt: Date;
439
+ email: string;
440
+ emailVerified: boolean;
441
+ name: string;
442
+ image?: string | null | undefined | undefined;
443
+ };
444
+ }>, {
445
+ code?: string | undefined;
446
+ message?: string | undefined;
447
+ }, FetchOptions["throw"] extends true ? true : false>>;
448
+ };
449
+ } & {
450
+ signIn: {
451
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
452
+ email: string;
453
+ password: string;
454
+ callbackURL?: string | undefined;
455
+ rememberMe?: boolean | undefined;
456
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
457
+ email: string;
458
+ password: string;
459
+ callbackURL?: string | undefined;
460
+ rememberMe?: boolean | undefined;
461
+ } & {
462
+ fetchOptions?: FetchOptions | undefined;
463
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
464
+ redirect: boolean;
465
+ token: string;
466
+ url?: string | undefined;
467
+ user: {
468
+ id: string;
469
+ createdAt: Date;
470
+ updatedAt: Date;
471
+ email: string;
472
+ emailVerified: boolean;
473
+ name: string;
474
+ image?: string | null | undefined | undefined;
475
+ };
476
+ }, {
477
+ code?: string | undefined;
478
+ message?: string | undefined;
479
+ }, FetchOptions["throw"] extends true ? true : false>>;
480
+ };
481
+ } & {
482
+ resetPassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
483
+ newPassword: string;
484
+ token?: string | undefined;
485
+ }> & Record<string, any>, Partial<{
486
+ token?: string | undefined;
487
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
488
+ newPassword: string;
489
+ token?: string | undefined;
490
+ } & {
491
+ fetchOptions?: FetchOptions | undefined;
492
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
493
+ status: boolean;
494
+ }, {
495
+ code?: string | undefined;
496
+ message?: string | undefined;
497
+ }, FetchOptions["throw"] extends true ? true : false>>;
498
+ } & {
499
+ verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
500
+ token: string;
501
+ callbackURL?: string | undefined;
502
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
503
+ query: {
504
+ token: string;
505
+ callbackURL?: string | undefined;
506
+ };
507
+ fetchOptions?: FetchOptions | undefined;
508
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<NonNullable<void | {
509
+ status: boolean;
510
+ }>, {
511
+ code?: string | undefined;
512
+ message?: string | undefined;
513
+ }, FetchOptions["throw"] extends true ? true : false>>;
514
+ } & {
515
+ sendVerificationEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
516
+ email: string;
517
+ callbackURL?: string | undefined;
518
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
519
+ email: string;
520
+ callbackURL?: string | undefined;
521
+ } & {
522
+ fetchOptions?: FetchOptions | undefined;
523
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
524
+ status: boolean;
525
+ }, {
526
+ code?: string | undefined;
527
+ message?: string | undefined;
528
+ }, FetchOptions["throw"] extends true ? true : false>>;
529
+ } & {
530
+ changeEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
531
+ newEmail: string;
532
+ callbackURL?: string | undefined;
533
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
534
+ newEmail: string;
535
+ callbackURL?: string | undefined;
536
+ } & {
537
+ fetchOptions?: FetchOptions | undefined;
538
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
539
+ status: boolean;
540
+ }, {
541
+ code?: string | undefined;
542
+ message?: string | undefined;
543
+ }, FetchOptions["throw"] extends true ? true : false>>;
544
+ } & {
545
+ changePassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
546
+ newPassword: string;
547
+ currentPassword: string;
548
+ revokeOtherSessions?: boolean | undefined;
549
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
550
+ newPassword: string;
551
+ currentPassword: string;
552
+ revokeOtherSessions?: boolean | undefined;
553
+ } & {
554
+ fetchOptions?: FetchOptions | undefined;
555
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
556
+ token: string | null;
557
+ user: {
558
+ id: string;
559
+ email: string;
560
+ name: string;
561
+ image: string | null | undefined;
562
+ emailVerified: boolean;
563
+ createdAt: Date;
564
+ updatedAt: Date;
565
+ };
566
+ }, {
567
+ code?: string | undefined;
568
+ message?: string | undefined;
569
+ }, FetchOptions["throw"] extends true ? true : false>>;
570
+ } & {
571
+ updateUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}> & {
572
+ name?: string | undefined;
573
+ image?: string | undefined;
574
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
575
+ image?: (string | null) | undefined;
576
+ name?: string | undefined;
577
+ fetchOptions?: FetchOptions | undefined;
578
+ } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
579
+ status: boolean;
580
+ }, {
581
+ code?: string | undefined;
582
+ message?: string | undefined;
583
+ }, FetchOptions["throw"] extends true ? true : false>>;
584
+ } & {
585
+ deleteUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
586
+ callbackURL?: string | undefined;
587
+ password?: string | undefined;
588
+ token?: string | undefined;
589
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
590
+ callbackURL?: string | undefined;
591
+ password?: string | undefined;
592
+ token?: string | undefined;
593
+ } & {
594
+ fetchOptions?: FetchOptions | undefined;
595
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
596
+ success: boolean;
597
+ message: string;
598
+ }, {
599
+ code?: string | undefined;
600
+ message?: string | undefined;
601
+ }, FetchOptions["throw"] extends true ? true : false>>;
602
+ } & {
603
+ requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
604
+ email: string;
605
+ redirectTo?: string | undefined;
606
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
607
+ email: string;
608
+ redirectTo?: string | undefined;
609
+ } & {
610
+ fetchOptions?: FetchOptions | undefined;
611
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
612
+ status: boolean;
613
+ message: string;
614
+ }, {
615
+ code?: string | undefined;
616
+ message?: string | undefined;
617
+ }, FetchOptions["throw"] extends true ? true : false>>;
618
+ } & {
619
+ resetPassword: {
620
+ ":token": <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
621
+ callbackURL: string;
622
+ }> & Record<string, any>, {
623
+ token: string;
624
+ }>>(data_0: import("better-auth/react").Prettify<{
625
+ query: {
626
+ callbackURL: string;
627
+ };
628
+ fetchOptions?: FetchOptions | undefined;
629
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<never, {
630
+ code?: string | undefined;
631
+ message?: string | undefined;
632
+ }, FetchOptions["throw"] extends true ? true : false>>;
633
+ };
634
+ } & {
635
+ listSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
636
+ query?: Record<string, any> | undefined;
637
+ fetchOptions?: FetchOptions | undefined;
638
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<import("better-auth/react").Prettify<{
639
+ id: string;
640
+ createdAt: Date;
641
+ updatedAt: Date;
642
+ userId: string;
643
+ expiresAt: Date;
644
+ token: string;
645
+ ipAddress?: string | null | undefined | undefined;
646
+ userAgent?: string | null | undefined | undefined;
647
+ }>[], {
648
+ code?: string | undefined;
649
+ message?: string | undefined;
650
+ }, FetchOptions["throw"] extends true ? true : false>>;
651
+ } & {
652
+ revokeSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
653
+ token: string;
654
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
655
+ token: string;
656
+ } & {
657
+ fetchOptions?: FetchOptions | undefined;
658
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
659
+ status: boolean;
660
+ }, {
661
+ code?: string | undefined;
662
+ message?: string | undefined;
663
+ }, FetchOptions["throw"] extends true ? true : false>>;
664
+ } & {
665
+ revokeSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
666
+ query?: Record<string, any> | undefined;
667
+ fetchOptions?: FetchOptions | undefined;
668
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
669
+ status: boolean;
670
+ }, {
671
+ code?: string | undefined;
672
+ message?: string | undefined;
673
+ }, FetchOptions["throw"] extends true ? true : false>>;
674
+ } & {
675
+ revokeOtherSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
676
+ query?: Record<string, any> | undefined;
677
+ fetchOptions?: FetchOptions | undefined;
678
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
679
+ status: boolean;
680
+ }, {
681
+ code?: string | undefined;
682
+ message?: string | undefined;
683
+ }, FetchOptions["throw"] extends true ? true : false>>;
684
+ } & {
685
+ linkSocial: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
686
+ provider: unknown;
687
+ callbackURL?: string | undefined;
688
+ idToken?: {
689
+ token: string;
690
+ nonce?: string | undefined;
691
+ accessToken?: string | undefined;
692
+ refreshToken?: string | undefined;
693
+ scopes?: string[] | undefined;
694
+ } | undefined;
695
+ requestSignUp?: boolean | undefined;
696
+ scopes?: string[] | undefined;
697
+ errorCallbackURL?: string | undefined;
698
+ disableRedirect?: boolean | undefined;
699
+ additionalData?: Record<string, any> | undefined;
700
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
701
+ provider: unknown;
702
+ callbackURL?: string | undefined;
703
+ idToken?: {
704
+ token: string;
705
+ nonce?: string | undefined;
706
+ accessToken?: string | undefined;
707
+ refreshToken?: string | undefined;
708
+ scopes?: string[] | undefined;
709
+ } | undefined;
710
+ requestSignUp?: boolean | undefined;
711
+ scopes?: string[] | undefined;
712
+ errorCallbackURL?: string | undefined;
713
+ disableRedirect?: boolean | undefined;
714
+ additionalData?: Record<string, any> | undefined;
715
+ } & {
716
+ fetchOptions?: FetchOptions | undefined;
717
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
718
+ url: string;
719
+ redirect: boolean;
720
+ }, {
721
+ code?: string | undefined;
722
+ message?: string | undefined;
723
+ }, FetchOptions["throw"] extends true ? true : false>>;
724
+ } & {
725
+ listAccounts: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
726
+ query?: Record<string, any> | undefined;
727
+ fetchOptions?: FetchOptions | undefined;
728
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
729
+ id: string;
730
+ providerId: string;
731
+ createdAt: Date;
732
+ updatedAt: Date;
733
+ accountId: string;
734
+ userId: string;
735
+ scopes: string[];
736
+ }[], {
737
+ code?: string | undefined;
738
+ message?: string | undefined;
739
+ }, FetchOptions["throw"] extends true ? true : false>>;
740
+ } & {
741
+ deleteUser: {
742
+ callback: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
743
+ token: string;
744
+ callbackURL?: string | undefined;
745
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
746
+ query: {
747
+ token: string;
748
+ callbackURL?: string | undefined;
749
+ };
750
+ fetchOptions?: FetchOptions | undefined;
751
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
752
+ success: boolean;
753
+ message: string;
754
+ }, {
755
+ code?: string | undefined;
756
+ message?: string | undefined;
757
+ }, FetchOptions["throw"] extends true ? true : false>>;
758
+ };
759
+ } & {
760
+ unlinkAccount: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
761
+ providerId: string;
762
+ accountId?: string | undefined;
763
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
764
+ providerId: string;
765
+ accountId?: string | undefined;
766
+ } & {
767
+ fetchOptions?: FetchOptions | undefined;
768
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
769
+ status: boolean;
770
+ }, {
771
+ code?: string | undefined;
772
+ message?: string | undefined;
773
+ }, FetchOptions["throw"] extends true ? true : false>>;
774
+ } & {
775
+ refreshToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
776
+ providerId: string;
777
+ accountId?: string | undefined;
778
+ userId?: string | undefined;
779
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
780
+ providerId: string;
781
+ accountId?: string | undefined;
782
+ userId?: string | undefined;
783
+ } & {
784
+ fetchOptions?: FetchOptions | undefined;
785
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
786
+ accessToken: string | undefined;
787
+ refreshToken: string | undefined;
788
+ accessTokenExpiresAt: Date | undefined;
789
+ refreshTokenExpiresAt: Date | undefined;
790
+ scope: string | null | undefined;
791
+ idToken: string | null | undefined;
792
+ providerId: string;
793
+ accountId: string;
794
+ }, {
795
+ code?: string | undefined;
796
+ message?: string | undefined;
797
+ }, FetchOptions["throw"] extends true ? true : false>>;
798
+ } & {
799
+ getAccessToken: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
800
+ providerId: string;
801
+ accountId?: string | undefined;
802
+ userId?: string | undefined;
803
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth/react").Prettify<{
804
+ providerId: string;
805
+ accountId?: string | undefined;
806
+ userId?: string | undefined;
807
+ } & {
808
+ fetchOptions?: FetchOptions | undefined;
809
+ }>, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
810
+ accessToken: string;
811
+ accessTokenExpiresAt: Date | undefined;
812
+ scopes: string[];
813
+ idToken: string | undefined;
814
+ }, {
815
+ code?: string | undefined;
816
+ message?: string | undefined;
817
+ }, FetchOptions["throw"] extends true ? true : false>>;
818
+ } & {
819
+ accountInfo: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
820
+ accountId?: string | undefined;
821
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
822
+ query?: {
823
+ accountId?: string | undefined;
824
+ } | undefined;
825
+ fetchOptions?: FetchOptions | undefined;
826
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
827
+ user: import("better-auth").OAuth2UserInfo;
828
+ data: Record<string, any>;
829
+ }, {
830
+ code?: string | undefined;
831
+ message?: string | undefined;
832
+ }, FetchOptions["throw"] extends true ? true : false>>;
833
+ } & {
834
+ getSession: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
835
+ disableCookieCache?: unknown;
836
+ disableRefresh?: unknown;
837
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth/react").Prettify<{
838
+ query?: {
839
+ disableCookieCache?: unknown;
840
+ disableRefresh?: unknown;
841
+ } | undefined;
842
+ fetchOptions?: FetchOptions | undefined;
843
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<import("@better-fetch/fetch").BetterFetchResponse<{
844
+ user: {
845
+ id: string;
846
+ createdAt: Date;
847
+ updatedAt: Date;
848
+ email: string;
849
+ emailVerified: boolean;
850
+ name: string;
851
+ image?: string | null | undefined;
852
+ };
853
+ session: {
854
+ id: string;
855
+ createdAt: Date;
856
+ updatedAt: Date;
857
+ userId: string;
858
+ expiresAt: Date;
859
+ token: string;
860
+ ipAddress?: string | null | undefined;
861
+ userAgent?: string | null | undefined;
862
+ };
863
+ } | null, {
864
+ code?: string | undefined;
865
+ message?: string | undefined;
866
+ }, FetchOptions["throw"] extends true ? true : false>>;
867
+ } & {
868
+ useSession: () => {
869
+ data: {
870
+ user: {
871
+ id: string;
872
+ createdAt: Date;
873
+ updatedAt: Date;
874
+ email: string;
875
+ emailVerified: boolean;
876
+ name: string;
877
+ image?: string | null | undefined;
878
+ };
879
+ session: {
880
+ id: string;
881
+ createdAt: Date;
882
+ updatedAt: Date;
883
+ userId: string;
884
+ expiresAt: Date;
885
+ token: string;
886
+ ipAddress?: string | null | undefined;
887
+ userAgent?: string | null | undefined;
888
+ };
889
+ } | null;
890
+ isPending: boolean;
891
+ isRefetching: boolean;
892
+ error: import("@better-fetch/fetch").BetterFetchError | null;
893
+ refetch: (queryParams?: {
894
+ query?: import("better-auth").SessionQueryParams;
895
+ } | undefined) => Promise<void>;
896
+ };
897
+ $Infer: {
898
+ Session: {
899
+ user: {
900
+ id: string;
901
+ createdAt: Date;
902
+ updatedAt: Date;
903
+ email: string;
904
+ emailVerified: boolean;
905
+ name: string;
906
+ image?: string | null | undefined;
907
+ };
908
+ session: {
909
+ id: string;
910
+ createdAt: Date;
911
+ updatedAt: Date;
912
+ userId: string;
913
+ expiresAt: Date;
914
+ token: string;
915
+ ipAddress?: string | null | undefined;
916
+ userAgent?: string | null | undefined;
917
+ };
918
+ };
919
+ };
920
+ $fetch: import("@better-fetch/fetch").BetterFetch<{
921
+ plugins: (import("@better-fetch/fetch").BetterFetchPlugin | {
922
+ id: string;
923
+ name: string;
924
+ hooks: {
925
+ onSuccess(context: import("@better-fetch/fetch").SuccessContext<any>): void;
926
+ };
927
+ } | {
928
+ id: string;
929
+ name: string;
930
+ hooks: {
931
+ onRequest<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>): void;
932
+ };
933
+ } | {
934
+ id: string;
935
+ name: string;
936
+ hooks: {
937
+ onSuccess: ((context: import("@better-fetch/fetch").SuccessContext<any>) => Promise<void> | void) | undefined;
938
+ onError: ((context: import("@better-fetch/fetch").ErrorContext) => Promise<void> | void) | undefined;
939
+ onRequest: (<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>) => Promise<import("@better-fetch/fetch").RequestContext | void> | import("@better-fetch/fetch").RequestContext | void) | undefined;
940
+ onResponse: ((context: import("@better-fetch/fetch").ResponseContext) => Promise<Response | void | import("@better-fetch/fetch").ResponseContext> | Response | import("@better-fetch/fetch").ResponseContext | void) | undefined;
941
+ };
942
+ })[];
943
+ cache?: RequestCache | undefined;
944
+ method: string;
945
+ headers?: (HeadersInit & (HeadersInit | {
946
+ accept: "application/json" | "text/plain" | "application/octet-stream";
947
+ "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
948
+ authorization: "Bearer" | "Basic";
949
+ })) | undefined;
950
+ redirect?: RequestRedirect | undefined;
951
+ credentials?: RequestCredentials;
952
+ integrity?: string | undefined;
953
+ keepalive?: boolean | undefined;
954
+ mode?: RequestMode | undefined;
955
+ priority?: RequestPriority | undefined;
956
+ referrer?: string | undefined;
957
+ referrerPolicy?: ReferrerPolicy | undefined;
958
+ signal?: (AbortSignal | null) | undefined;
959
+ window?: null | undefined;
960
+ onRetry?: ((response: import("@better-fetch/fetch").ResponseContext) => Promise<void> | void) | undefined;
961
+ hookOptions?: {
962
+ cloneResponse?: boolean;
963
+ } | undefined;
964
+ timeout?: number | undefined;
965
+ customFetchImpl: import("@better-fetch/fetch").FetchEsque;
966
+ baseURL: string;
967
+ throw?: boolean | undefined;
968
+ auth?: ({
969
+ type: "Bearer";
970
+ token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
971
+ } | {
972
+ type: "Basic";
973
+ username: string | (() => string | undefined) | undefined;
974
+ password: string | (() => string | undefined) | undefined;
975
+ } | {
976
+ type: "Custom";
977
+ prefix: string | (() => string | undefined) | undefined;
978
+ value: string | (() => string | undefined) | undefined;
979
+ }) | undefined;
980
+ body?: any;
981
+ query?: any;
982
+ params?: any;
983
+ duplex?: "full" | "half" | undefined;
984
+ jsonParser: (text: string) => Promise<any> | any;
985
+ retry?: import("@better-fetch/fetch").RetryOptions | undefined;
986
+ retryAttempt?: number | undefined;
987
+ output?: (import("@better-fetch/fetch").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
988
+ errorSchema?: import("@better-fetch/fetch").StandardSchemaV1 | undefined;
989
+ disableValidation?: boolean | undefined;
990
+ disableSignal?: boolean | undefined;
991
+ }, unknown, unknown, {}>;
992
+ $store: {
993
+ notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
994
+ listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
995
+ atoms: Record<string, import("nanostores/atom").WritableAtom<any>>;
996
+ };
997
+ $ERROR_CODES: {
998
+ readonly USER_NOT_FOUND: "User not found";
999
+ readonly FAILED_TO_CREATE_USER: "Failed to create user";
1000
+ readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
1001
+ readonly FAILED_TO_UPDATE_USER: "Failed to update user";
1002
+ readonly FAILED_TO_GET_SESSION: "Failed to get session";
1003
+ readonly INVALID_PASSWORD: "Invalid password";
1004
+ readonly INVALID_EMAIL: "Invalid email";
1005
+ readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
1006
+ readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
1007
+ readonly PROVIDER_NOT_FOUND: "Provider not found";
1008
+ readonly INVALID_TOKEN: "Invalid token";
1009
+ readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
1010
+ readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
1011
+ readonly USER_EMAIL_NOT_FOUND: "User email not found";
1012
+ readonly EMAIL_NOT_VERIFIED: "Email not verified";
1013
+ readonly PASSWORD_TOO_SHORT: "Password too short";
1014
+ readonly PASSWORD_TOO_LONG: "Password too long";
1015
+ readonly USER_ALREADY_EXISTS: "User already exists.";
1016
+ readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
1017
+ readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
1018
+ readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
1019
+ readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
1020
+ readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
1021
+ readonly ACCOUNT_NOT_FOUND: "Account not found";
1022
+ readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
1023
+ };
1024
+ };
1025
+ export * from "better-auth";
1026
+ export * from "better-auth/next-js";
@@ -1,6 +1,32 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.auth = void 0;
4
- const _1 = require("better-auth/*");
17
+ exports.authClient = exports.auth = void 0;
18
+ const better_auth_1 = require("better-auth");
19
+ const react_1 = require("better-auth/react");
20
+ const pg_1 = require("pg");
5
21
  const config_1 = require("../config");
6
- exports.auth = (0, _1.betterAuth)((0, config_1.getConfig)().auth);
22
+ const config = (0, config_1.getConfig)();
23
+ exports.auth = (0, better_auth_1.betterAuth)({
24
+ database: new pg_1.Pool({
25
+ connectionString: config.databaseUrl,
26
+ }),
27
+ ...config.auth,
28
+ secret: process.env.DEESSE_SECRET,
29
+ });
30
+ exports.authClient = (0, react_1.createAuthClient)();
31
+ __exportStar(require("better-auth"), exports);
32
+ __exportStar(require("better-auth/next-js"), exports);
@@ -1,4 +1,5 @@
1
- import { BetterAuthOptions } from "better-auth/*";
1
+ import { BetterAuthOptions } from "better-auth";
2
2
  export type Config = {
3
- auth: BetterAuthOptions;
3
+ databaseUrl: string;
4
+ auth: Omit<BetterAuthOptions, "secret" | "database">;
4
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deesse",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "The fullstack web framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,14 +11,39 @@
11
11
  "LICENSE"
12
12
  ],
13
13
  "scripts": {
14
- "test": "echo \"Error: no test specified\" && exit 1",
15
14
  "build": "tsc",
16
15
  "build:watch": "tsc --watch",
17
- "prepublishOnly": "npm run build"
16
+ "prepublishOnly": "npm run build",
17
+ "test": "vitest",
18
+ "test:ui": "vitest --ui",
19
+ "test:run": "vitest run",
20
+ "test:coverage": "vitest run --coverage",
21
+ "test:watch": "vitest watch",
22
+ "lint": "eslint src --ext .ts",
23
+ "lint:fix": "eslint src --ext .ts --fix"
18
24
  },
19
25
  "author": "",
20
26
  "license": "ISC",
21
27
  "dependencies": {
22
- "better-auth": "^1.4.3"
28
+ "better-auth": "^1.4.3",
29
+ "pg": "^8.16.3"
30
+ },
31
+ "devDependencies": {
32
+ "@testing-library/dom": "^10.4.1",
33
+ "@testing-library/user-event": "^14.6.1",
34
+ "@types/jsdom": "^27.0.0",
35
+ "@types/node": "^20.0.0",
36
+ "@types/pg": "^8.15.6",
37
+ "@types/sinon": "^21.0.0",
38
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
39
+ "@typescript-eslint/parser": "^6.0.0",
40
+ "@vitest/coverage-istanbul": "^4.0.14",
41
+ "@vitest/coverage-v8": "^4.0.13",
42
+ "@vitest/ui": "^4.0.13",
43
+ "eslint": "^8.0.0",
44
+ "jsdom": "^27.2.0",
45
+ "sinon": "^21.0.0",
46
+ "typescript": "^5.0.0",
47
+ "vitest": "^4.0.13"
23
48
  }
24
49
  }