deesse 0.1.7 → 0.1.8

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