@convex-dev/better-auth 0.8.1 → 0.8.3

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.
Files changed (47) hide show
  1. package/dist/commonjs/client/adapterUtils.d.ts +6 -6
  2. package/dist/commonjs/client/createSchema.d.ts.map +1 -1
  3. package/dist/commonjs/client/createSchema.js +11 -1
  4. package/dist/commonjs/client/createSchema.js.map +1 -1
  5. package/dist/commonjs/client/createSchemaInternal.d.ts +24 -0
  6. package/dist/commonjs/client/createSchemaInternal.d.ts.map +1 -0
  7. package/dist/commonjs/client/createSchemaInternal.js +105 -0
  8. package/dist/commonjs/client/createSchemaInternal.js.map +1 -0
  9. package/dist/commonjs/client/index.d.ts +3066 -16
  10. package/dist/commonjs/client/index.d.ts.map +1 -1
  11. package/dist/commonjs/client/index.js +8 -5
  12. package/dist/commonjs/client/index.js.map +1 -1
  13. package/dist/commonjs/component/adapter.d.ts +6 -6
  14. package/dist/commonjs/nextjs/index.d.ts +3 -1
  15. package/dist/commonjs/nextjs/index.d.ts.map +1 -1
  16. package/dist/commonjs/nextjs/index.js +2 -2
  17. package/dist/commonjs/nextjs/index.js.map +1 -1
  18. package/dist/commonjs/react-start/index.d.ts +3 -1
  19. package/dist/commonjs/react-start/index.d.ts.map +1 -1
  20. package/dist/commonjs/react-start/index.js +2 -1
  21. package/dist/commonjs/react-start/index.js.map +1 -1
  22. package/dist/esm/client/adapterUtils.d.ts +6 -6
  23. package/dist/esm/client/createSchema.d.ts.map +1 -1
  24. package/dist/esm/client/createSchema.js +11 -1
  25. package/dist/esm/client/createSchema.js.map +1 -1
  26. package/dist/esm/client/createSchemaInternal.d.ts +24 -0
  27. package/dist/esm/client/createSchemaInternal.d.ts.map +1 -0
  28. package/dist/esm/client/createSchemaInternal.js +105 -0
  29. package/dist/esm/client/createSchemaInternal.js.map +1 -0
  30. package/dist/esm/client/index.d.ts +3066 -16
  31. package/dist/esm/client/index.d.ts.map +1 -1
  32. package/dist/esm/client/index.js +8 -5
  33. package/dist/esm/client/index.js.map +1 -1
  34. package/dist/esm/component/adapter.d.ts +6 -6
  35. package/dist/esm/nextjs/index.d.ts +3 -1
  36. package/dist/esm/nextjs/index.d.ts.map +1 -1
  37. package/dist/esm/nextjs/index.js +2 -2
  38. package/dist/esm/nextjs/index.js.map +1 -1
  39. package/dist/esm/react-start/index.d.ts +3 -1
  40. package/dist/esm/react-start/index.d.ts.map +1 -1
  41. package/dist/esm/react-start/index.js +2 -1
  42. package/dist/esm/react-start/index.js.map +1 -1
  43. package/package.json +1 -1
  44. package/src/client/createSchema.ts +13 -1
  45. package/src/client/index.ts +22 -9
  46. package/src/nextjs/index.ts +6 -3
  47. package/src/react-start/index.ts +6 -2
@@ -6,6 +6,3056 @@ import defaultSchema from "../component/schema.js";
6
6
  import { api } from "../component/_generated/api.js";
7
7
  export { convexAdapter };
8
8
  export type CreateAdapter = <Ctx extends RunCtx>(ctx: Ctx) => AdapterInstance;
9
+ export type CreateAuth<DataModel extends GenericDataModel> = ((ctx: GenericCtx<DataModel>) => ReturnType<typeof betterAuth>) | ((ctx: GenericCtx<DataModel>, opts?: {
10
+ optionsOnly?: boolean;
11
+ }) => ReturnType<typeof betterAuth>);
12
+ export declare const getStaticAuth: <DataModel extends GenericDataModel>(createAuth: CreateAuth<DataModel>) => {
13
+ handler: (request: Request) => Promise<Response>;
14
+ api: import("better-auth").InferAPI<{
15
+ ok: {
16
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
17
+ body?: undefined;
18
+ } & {
19
+ method?: "GET" | undefined;
20
+ } & {
21
+ query?: Record<string, any> | undefined;
22
+ } & {
23
+ params?: Record<string, any>;
24
+ } & {
25
+ request?: Request;
26
+ } & {
27
+ headers?: HeadersInit;
28
+ } & {
29
+ asResponse?: boolean;
30
+ returnHeaders?: boolean;
31
+ use?: import("better-call").Middleware[];
32
+ path?: string;
33
+ } & {
34
+ asResponse?: AsResponse | undefined;
35
+ returnHeaders?: ReturnHeaders | undefined;
36
+ }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
37
+ headers: Headers;
38
+ response: {
39
+ ok: boolean;
40
+ };
41
+ } : {
42
+ ok: boolean;
43
+ }>;
44
+ options: {
45
+ method: "GET";
46
+ metadata: {
47
+ openapi: {
48
+ description: string;
49
+ responses: {
50
+ "200": {
51
+ description: string;
52
+ content: {
53
+ "application/json": {
54
+ schema: {
55
+ type: "object";
56
+ properties: {
57
+ ok: {
58
+ type: string;
59
+ description: string;
60
+ };
61
+ };
62
+ required: string[];
63
+ };
64
+ };
65
+ };
66
+ };
67
+ };
68
+ };
69
+ isAction: false;
70
+ };
71
+ } & {
72
+ use: any[];
73
+ };
74
+ path: "/ok";
75
+ };
76
+ error: {
77
+ <AsResponse extends boolean = false, ReturnHeaders_1 extends boolean = false>(inputCtx_0?: ({
78
+ body?: undefined;
79
+ } & {
80
+ method?: "GET" | undefined;
81
+ } & {
82
+ query?: Record<string, any> | undefined;
83
+ } & {
84
+ params?: Record<string, any>;
85
+ } & {
86
+ request?: Request;
87
+ } & {
88
+ headers?: HeadersInit;
89
+ } & {
90
+ asResponse?: boolean;
91
+ returnHeaders?: boolean;
92
+ use?: import("better-call").Middleware[];
93
+ path?: string;
94
+ } & {
95
+ asResponse?: AsResponse | undefined;
96
+ returnHeaders?: ReturnHeaders_1 | undefined;
97
+ }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_1] extends [true] ? {
98
+ headers: Headers;
99
+ response: Response;
100
+ } : Response>;
101
+ options: {
102
+ method: "GET";
103
+ metadata: {
104
+ openapi: {
105
+ description: string;
106
+ responses: {
107
+ "200": {
108
+ description: string;
109
+ content: {
110
+ "text/html": {
111
+ schema: {
112
+ type: "string";
113
+ description: string;
114
+ };
115
+ };
116
+ };
117
+ };
118
+ };
119
+ };
120
+ isAction: false;
121
+ };
122
+ } & {
123
+ use: any[];
124
+ };
125
+ path: "/error";
126
+ };
127
+ signInSocial: {
128
+ <AsResponse extends boolean = false, ReturnHeaders_2 extends boolean = false>(inputCtx_0: {
129
+ body: {
130
+ provider: unknown;
131
+ callbackURL?: string | undefined;
132
+ newUserCallbackURL?: string | undefined;
133
+ errorCallbackURL?: string | undefined;
134
+ disableRedirect?: boolean | undefined;
135
+ idToken?: {
136
+ token: string;
137
+ nonce?: string | undefined;
138
+ accessToken?: string | undefined;
139
+ refreshToken?: string | undefined;
140
+ expiresAt?: number | undefined;
141
+ } | undefined;
142
+ scopes?: string[] | undefined;
143
+ requestSignUp?: boolean | undefined;
144
+ loginHint?: string | undefined;
145
+ };
146
+ } & {
147
+ method?: "POST" | undefined;
148
+ } & {
149
+ query?: Record<string, any> | undefined;
150
+ } & {
151
+ params?: Record<string, any>;
152
+ } & {
153
+ request?: Request;
154
+ } & {
155
+ headers?: HeadersInit;
156
+ } & {
157
+ asResponse?: boolean;
158
+ returnHeaders?: boolean;
159
+ use?: import("better-call").Middleware[];
160
+ path?: string;
161
+ } & {
162
+ asResponse?: AsResponse | undefined;
163
+ returnHeaders?: ReturnHeaders_2 | undefined;
164
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_2] extends [true] ? {
165
+ headers: Headers;
166
+ response: {
167
+ redirect: boolean;
168
+ token: string;
169
+ url: undefined;
170
+ user: {
171
+ id: string;
172
+ email: string;
173
+ name: string;
174
+ image: string | null | undefined;
175
+ emailVerified: boolean;
176
+ createdAt: Date;
177
+ updatedAt: Date;
178
+ };
179
+ } | {
180
+ url: string;
181
+ redirect: boolean;
182
+ };
183
+ } : {
184
+ redirect: boolean;
185
+ token: string;
186
+ url: undefined;
187
+ user: {
188
+ id: string;
189
+ email: string;
190
+ name: string;
191
+ image: string | null | undefined;
192
+ emailVerified: boolean;
193
+ createdAt: Date;
194
+ updatedAt: Date;
195
+ };
196
+ } | {
197
+ url: string;
198
+ redirect: boolean;
199
+ }>;
200
+ options: {
201
+ method: "POST";
202
+ body: import("better-auth").ZodObject<{
203
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
204
+ newUserCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
205
+ errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
206
+ provider: import("better-auth").ZodType<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal" | (string & {}), unknown, import("better-auth").$ZodTypeInternals<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal" | (string & {}), unknown>>;
207
+ disableRedirect: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
208
+ idToken: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
209
+ token: import("better-auth").ZodString;
210
+ nonce: import("better-auth").ZodOptional<import("better-auth").ZodString>;
211
+ accessToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
212
+ refreshToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
213
+ expiresAt: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
214
+ }, import("better-auth").$strip>>;
215
+ scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
216
+ requestSignUp: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
217
+ loginHint: import("better-auth").ZodOptional<import("better-auth").ZodString>;
218
+ }, import("better-auth").$strip>;
219
+ metadata: {
220
+ openapi: {
221
+ description: string;
222
+ operationId: string;
223
+ responses: {
224
+ "200": {
225
+ description: string;
226
+ content: {
227
+ "application/json": {
228
+ schema: {
229
+ type: "object";
230
+ description: string;
231
+ properties: {
232
+ redirect: {
233
+ type: string;
234
+ enum: boolean[];
235
+ };
236
+ token: {
237
+ type: string;
238
+ description: string;
239
+ url: {
240
+ type: string;
241
+ nullable: boolean;
242
+ };
243
+ user: {
244
+ type: string;
245
+ properties: {
246
+ id: {
247
+ type: string;
248
+ };
249
+ email: {
250
+ type: string;
251
+ };
252
+ name: {
253
+ type: string;
254
+ nullable: boolean;
255
+ };
256
+ image: {
257
+ type: string;
258
+ nullable: boolean;
259
+ };
260
+ emailVerified: {
261
+ type: string;
262
+ };
263
+ createdAt: {
264
+ type: string;
265
+ format: string;
266
+ };
267
+ updatedAt: {
268
+ type: string;
269
+ format: string;
270
+ };
271
+ };
272
+ required: string[];
273
+ };
274
+ };
275
+ };
276
+ required: string[];
277
+ };
278
+ };
279
+ };
280
+ };
281
+ };
282
+ };
283
+ };
284
+ } & {
285
+ use: any[];
286
+ };
287
+ path: "/sign-in/social";
288
+ };
289
+ callbackOAuth: {
290
+ <AsResponse extends boolean = false, ReturnHeaders_3 extends boolean = false>(inputCtx_0: {
291
+ body?: {
292
+ code?: string | undefined;
293
+ error?: string | undefined;
294
+ device_id?: string | undefined;
295
+ error_description?: string | undefined;
296
+ state?: string | undefined;
297
+ user?: string | undefined;
298
+ } | undefined;
299
+ } & {
300
+ method: "GET" | "POST";
301
+ } & {
302
+ query?: {
303
+ code?: string | undefined;
304
+ error?: string | undefined;
305
+ device_id?: string | undefined;
306
+ error_description?: string | undefined;
307
+ state?: string | undefined;
308
+ user?: string | undefined;
309
+ } | undefined;
310
+ } & {
311
+ params: {
312
+ id: string;
313
+ };
314
+ } & {
315
+ request?: Request;
316
+ } & {
317
+ headers?: HeadersInit;
318
+ } & {
319
+ asResponse?: boolean;
320
+ returnHeaders?: boolean;
321
+ use?: import("better-call").Middleware[];
322
+ path?: string;
323
+ } & {
324
+ asResponse?: AsResponse | undefined;
325
+ returnHeaders?: ReturnHeaders_3 | undefined;
326
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_3] extends [true] ? {
327
+ headers: Headers;
328
+ response: void;
329
+ } : void>;
330
+ options: {
331
+ method: ("GET" | "POST")[];
332
+ body: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
333
+ code: import("better-auth").ZodOptional<import("better-auth").ZodString>;
334
+ error: import("better-auth").ZodOptional<import("better-auth").ZodString>;
335
+ device_id: import("better-auth").ZodOptional<import("better-auth").ZodString>;
336
+ error_description: import("better-auth").ZodOptional<import("better-auth").ZodString>;
337
+ state: import("better-auth").ZodOptional<import("better-auth").ZodString>;
338
+ user: import("better-auth").ZodOptional<import("better-auth").ZodString>;
339
+ }, import("better-auth").$strip>>;
340
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
341
+ code: import("better-auth").ZodOptional<import("better-auth").ZodString>;
342
+ error: import("better-auth").ZodOptional<import("better-auth").ZodString>;
343
+ device_id: import("better-auth").ZodOptional<import("better-auth").ZodString>;
344
+ error_description: import("better-auth").ZodOptional<import("better-auth").ZodString>;
345
+ state: import("better-auth").ZodOptional<import("better-auth").ZodString>;
346
+ user: import("better-auth").ZodOptional<import("better-auth").ZodString>;
347
+ }, import("better-auth").$strip>>;
348
+ metadata: {
349
+ isAction: false;
350
+ };
351
+ } & {
352
+ use: any[];
353
+ };
354
+ path: "/callback/:id";
355
+ };
356
+ getSession: {
357
+ <AsResponse extends boolean = false, ReturnHeaders_4 extends boolean = false>(inputCtx_0: {
358
+ body?: undefined;
359
+ } & {
360
+ method?: "GET" | undefined;
361
+ } & {
362
+ query?: {
363
+ disableCookieCache?: unknown;
364
+ disableRefresh?: unknown;
365
+ } | undefined;
366
+ } & {
367
+ params?: Record<string, any>;
368
+ } & {
369
+ request?: Request;
370
+ } & {
371
+ headers: HeadersInit;
372
+ } & {
373
+ asResponse?: boolean;
374
+ returnHeaders?: boolean;
375
+ use?: import("better-call").Middleware[];
376
+ path?: string;
377
+ } & {
378
+ asResponse?: AsResponse | undefined;
379
+ returnHeaders?: ReturnHeaders_4 | undefined;
380
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_4] extends [true] ? {
381
+ headers: Headers;
382
+ response: {
383
+ session: {
384
+ id: string;
385
+ createdAt: Date;
386
+ updatedAt: Date;
387
+ userId: string;
388
+ expiresAt: Date;
389
+ token: string;
390
+ ipAddress?: string | null | undefined | undefined;
391
+ userAgent?: string | null | undefined | undefined;
392
+ };
393
+ user: {
394
+ id: string;
395
+ createdAt: Date;
396
+ updatedAt: Date;
397
+ email: string;
398
+ emailVerified: boolean;
399
+ name: string;
400
+ image?: string | null | undefined | undefined;
401
+ };
402
+ } | null;
403
+ } : {
404
+ session: {
405
+ id: string;
406
+ createdAt: Date;
407
+ updatedAt: Date;
408
+ userId: string;
409
+ expiresAt: Date;
410
+ token: string;
411
+ ipAddress?: string | null | undefined | undefined;
412
+ userAgent?: string | null | undefined | undefined;
413
+ };
414
+ user: {
415
+ id: string;
416
+ createdAt: Date;
417
+ updatedAt: Date;
418
+ email: string;
419
+ emailVerified: boolean;
420
+ name: string;
421
+ image?: string | null | undefined | undefined;
422
+ };
423
+ } | null>;
424
+ options: {
425
+ method: "GET";
426
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
427
+ disableCookieCache: import("better-auth").ZodOptional<import("better-auth").ZodCoercedBoolean<unknown>>;
428
+ disableRefresh: import("better-auth").ZodOptional<import("better-auth").ZodCoercedBoolean<unknown>>;
429
+ }, import("better-auth").$strip>>;
430
+ requireHeaders: true;
431
+ metadata: {
432
+ openapi: {
433
+ description: string;
434
+ responses: {
435
+ "200": {
436
+ description: string;
437
+ content: {
438
+ "application/json": {
439
+ schema: {
440
+ type: "object";
441
+ properties: {
442
+ session: {
443
+ $ref: string;
444
+ };
445
+ user: {
446
+ $ref: string;
447
+ };
448
+ };
449
+ required: string[];
450
+ };
451
+ };
452
+ };
453
+ };
454
+ };
455
+ };
456
+ };
457
+ } & {
458
+ use: any[];
459
+ };
460
+ path: "/get-session";
461
+ };
462
+ signOut: {
463
+ <AsResponse extends boolean = false, ReturnHeaders_5 extends boolean = false>(inputCtx_0: {
464
+ body?: undefined;
465
+ } & {
466
+ method?: "POST" | undefined;
467
+ } & {
468
+ query?: Record<string, any> | undefined;
469
+ } & {
470
+ params?: Record<string, any>;
471
+ } & {
472
+ request?: Request;
473
+ } & {
474
+ headers: HeadersInit;
475
+ } & {
476
+ asResponse?: boolean;
477
+ returnHeaders?: boolean;
478
+ use?: import("better-call").Middleware[];
479
+ path?: string;
480
+ } & {
481
+ asResponse?: AsResponse | undefined;
482
+ returnHeaders?: ReturnHeaders_5 | undefined;
483
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_5] extends [true] ? {
484
+ headers: Headers;
485
+ response: {
486
+ success: boolean;
487
+ };
488
+ } : {
489
+ success: boolean;
490
+ }>;
491
+ options: {
492
+ method: "POST";
493
+ requireHeaders: true;
494
+ metadata: {
495
+ openapi: {
496
+ description: string;
497
+ responses: {
498
+ "200": {
499
+ description: string;
500
+ content: {
501
+ "application/json": {
502
+ schema: {
503
+ type: "object";
504
+ properties: {
505
+ success: {
506
+ type: string;
507
+ };
508
+ };
509
+ };
510
+ };
511
+ };
512
+ };
513
+ };
514
+ };
515
+ };
516
+ } & {
517
+ use: any[];
518
+ };
519
+ path: "/sign-out";
520
+ };
521
+ signUpEmail: {
522
+ <AsResponse extends boolean = false, ReturnHeaders_6 extends boolean = false>(inputCtx_0: {
523
+ body: {
524
+ name: string;
525
+ email: string;
526
+ password: string;
527
+ image?: string;
528
+ callbackURL?: string;
529
+ rememberMe?: boolean;
530
+ };
531
+ } & {
532
+ method?: "POST" | undefined;
533
+ } & {
534
+ query?: Record<string, any> | undefined;
535
+ } & {
536
+ params?: Record<string, any>;
537
+ } & {
538
+ request?: Request;
539
+ } & {
540
+ headers?: HeadersInit;
541
+ } & {
542
+ asResponse?: boolean;
543
+ returnHeaders?: boolean;
544
+ use?: import("better-call").Middleware[];
545
+ path?: string;
546
+ } & {
547
+ asResponse?: AsResponse | undefined;
548
+ returnHeaders?: ReturnHeaders_6 | undefined;
549
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_6] extends [true] ? {
550
+ headers: Headers;
551
+ response: {
552
+ token: null;
553
+ user: {
554
+ id: string;
555
+ email: string;
556
+ name: string;
557
+ image: string | null | undefined;
558
+ emailVerified: boolean;
559
+ createdAt: Date;
560
+ updatedAt: Date;
561
+ };
562
+ } | {
563
+ token: string;
564
+ user: {
565
+ id: string;
566
+ email: string;
567
+ name: string;
568
+ image: string | null | undefined;
569
+ emailVerified: boolean;
570
+ createdAt: Date;
571
+ updatedAt: Date;
572
+ };
573
+ };
574
+ } : {
575
+ token: null;
576
+ user: {
577
+ id: string;
578
+ email: string;
579
+ name: string;
580
+ image: string | null | undefined;
581
+ emailVerified: boolean;
582
+ createdAt: Date;
583
+ updatedAt: Date;
584
+ };
585
+ } | {
586
+ token: string;
587
+ user: {
588
+ id: string;
589
+ email: string;
590
+ name: string;
591
+ image: string | null | undefined;
592
+ emailVerified: boolean;
593
+ createdAt: Date;
594
+ updatedAt: Date;
595
+ };
596
+ }>;
597
+ options: {
598
+ method: "POST";
599
+ body: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>;
600
+ metadata: {
601
+ $Infer: {
602
+ body: {
603
+ name: string;
604
+ email: string;
605
+ password: string;
606
+ image?: string;
607
+ callbackURL?: string;
608
+ rememberMe?: boolean;
609
+ };
610
+ };
611
+ openapi: {
612
+ description: string;
613
+ requestBody: {
614
+ content: {
615
+ "application/json": {
616
+ schema: {
617
+ type: "object";
618
+ properties: {
619
+ name: {
620
+ type: string;
621
+ description: string;
622
+ };
623
+ email: {
624
+ type: string;
625
+ description: string;
626
+ };
627
+ password: {
628
+ type: string;
629
+ description: string;
630
+ };
631
+ image: {
632
+ type: string;
633
+ description: string;
634
+ };
635
+ callbackURL: {
636
+ type: string;
637
+ description: string;
638
+ };
639
+ rememberMe: {
640
+ type: string;
641
+ description: string;
642
+ };
643
+ };
644
+ required: string[];
645
+ };
646
+ };
647
+ };
648
+ };
649
+ responses: {
650
+ "200": {
651
+ description: string;
652
+ content: {
653
+ "application/json": {
654
+ schema: {
655
+ type: "object";
656
+ properties: {
657
+ token: {
658
+ type: string;
659
+ nullable: boolean;
660
+ description: string;
661
+ };
662
+ user: {
663
+ type: string;
664
+ properties: {
665
+ id: {
666
+ type: string;
667
+ description: string;
668
+ };
669
+ email: {
670
+ type: string;
671
+ format: string;
672
+ description: string;
673
+ };
674
+ name: {
675
+ type: string;
676
+ description: string;
677
+ };
678
+ image: {
679
+ type: string;
680
+ format: string;
681
+ nullable: boolean;
682
+ description: string;
683
+ };
684
+ emailVerified: {
685
+ type: string;
686
+ description: string;
687
+ };
688
+ createdAt: {
689
+ type: string;
690
+ format: string;
691
+ description: string;
692
+ };
693
+ updatedAt: {
694
+ type: string;
695
+ format: string;
696
+ description: string;
697
+ };
698
+ };
699
+ required: string[];
700
+ };
701
+ };
702
+ required: string[];
703
+ };
704
+ };
705
+ };
706
+ };
707
+ };
708
+ };
709
+ };
710
+ } & {
711
+ use: any[];
712
+ };
713
+ path: "/sign-up/email";
714
+ };
715
+ signInEmail: {
716
+ <AsResponse extends boolean = false, ReturnHeaders_7 extends boolean = false>(inputCtx_0: {
717
+ body: {
718
+ email: string;
719
+ password: string;
720
+ callbackURL?: string | undefined;
721
+ rememberMe?: boolean | undefined;
722
+ };
723
+ } & {
724
+ method?: "POST" | undefined;
725
+ } & {
726
+ query?: Record<string, any> | undefined;
727
+ } & {
728
+ params?: Record<string, any>;
729
+ } & {
730
+ request?: Request;
731
+ } & {
732
+ headers?: HeadersInit;
733
+ } & {
734
+ asResponse?: boolean;
735
+ returnHeaders?: boolean;
736
+ use?: import("better-call").Middleware[];
737
+ path?: string;
738
+ } & {
739
+ asResponse?: AsResponse | undefined;
740
+ returnHeaders?: ReturnHeaders_7 | undefined;
741
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_7] extends [true] ? {
742
+ headers: Headers;
743
+ response: {
744
+ redirect: boolean;
745
+ token: string;
746
+ url: string | undefined;
747
+ user: {
748
+ id: string;
749
+ email: string;
750
+ name: string;
751
+ image: string | null | undefined;
752
+ emailVerified: boolean;
753
+ createdAt: Date;
754
+ updatedAt: Date;
755
+ };
756
+ };
757
+ } : {
758
+ redirect: boolean;
759
+ token: string;
760
+ url: string | undefined;
761
+ user: {
762
+ id: string;
763
+ email: string;
764
+ name: string;
765
+ image: string | null | undefined;
766
+ emailVerified: boolean;
767
+ createdAt: Date;
768
+ updatedAt: Date;
769
+ };
770
+ }>;
771
+ options: {
772
+ method: "POST";
773
+ body: import("better-auth").ZodObject<{
774
+ email: import("better-auth").ZodString;
775
+ password: import("better-auth").ZodString;
776
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
777
+ rememberMe: import("better-auth").ZodOptional<import("better-auth").ZodDefault<import("better-auth").ZodBoolean>>;
778
+ }, import("better-auth").$strip>;
779
+ metadata: {
780
+ openapi: {
781
+ description: string;
782
+ responses: {
783
+ "200": {
784
+ description: string;
785
+ content: {
786
+ "application/json": {
787
+ schema: {
788
+ type: "object";
789
+ description: string;
790
+ properties: {
791
+ redirect: {
792
+ type: string;
793
+ enum: boolean[];
794
+ };
795
+ token: {
796
+ type: string;
797
+ description: string;
798
+ };
799
+ url: {
800
+ type: string;
801
+ nullable: boolean;
802
+ };
803
+ user: {
804
+ type: string;
805
+ properties: {
806
+ id: {
807
+ type: string;
808
+ };
809
+ email: {
810
+ type: string;
811
+ };
812
+ name: {
813
+ type: string;
814
+ nullable: boolean;
815
+ };
816
+ image: {
817
+ type: string;
818
+ nullable: boolean;
819
+ };
820
+ emailVerified: {
821
+ type: string;
822
+ };
823
+ createdAt: {
824
+ type: string;
825
+ format: string;
826
+ };
827
+ updatedAt: {
828
+ type: string;
829
+ format: string;
830
+ };
831
+ };
832
+ required: string[];
833
+ };
834
+ };
835
+ required: string[];
836
+ };
837
+ };
838
+ };
839
+ };
840
+ };
841
+ };
842
+ };
843
+ } & {
844
+ use: any[];
845
+ };
846
+ path: "/sign-in/email";
847
+ };
848
+ forgetPassword: {
849
+ <AsResponse extends boolean = false, ReturnHeaders_8 extends boolean = false>(inputCtx_0: {
850
+ body: {
851
+ email: string;
852
+ redirectTo?: string | undefined;
853
+ };
854
+ } & {
855
+ method?: "POST" | undefined;
856
+ } & {
857
+ query?: Record<string, any> | undefined;
858
+ } & {
859
+ params?: Record<string, any>;
860
+ } & {
861
+ request?: Request;
862
+ } & {
863
+ headers?: HeadersInit;
864
+ } & {
865
+ asResponse?: boolean;
866
+ returnHeaders?: boolean;
867
+ use?: import("better-call").Middleware[];
868
+ path?: string;
869
+ } & {
870
+ asResponse?: AsResponse | undefined;
871
+ returnHeaders?: ReturnHeaders_8 | undefined;
872
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_8] extends [true] ? {
873
+ headers: Headers;
874
+ response: {
875
+ status: boolean;
876
+ };
877
+ } : {
878
+ status: boolean;
879
+ }>;
880
+ options: {
881
+ method: "POST";
882
+ body: import("better-auth").ZodObject<{
883
+ email: import("better-auth").ZodString;
884
+ redirectTo: import("better-auth").ZodOptional<import("better-auth").ZodString>;
885
+ }, import("better-auth").$strip>;
886
+ metadata: {
887
+ openapi: {
888
+ description: string;
889
+ responses: {
890
+ "200": {
891
+ description: string;
892
+ content: {
893
+ "application/json": {
894
+ schema: {
895
+ type: "object";
896
+ properties: {
897
+ status: {
898
+ type: string;
899
+ };
900
+ message: {
901
+ type: string;
902
+ };
903
+ };
904
+ };
905
+ };
906
+ };
907
+ };
908
+ };
909
+ };
910
+ };
911
+ } & {
912
+ use: any[];
913
+ };
914
+ path: "/forget-password";
915
+ };
916
+ resetPassword: {
917
+ <AsResponse extends boolean = false, ReturnHeaders_9 extends boolean = false>(inputCtx_0: {
918
+ body: {
919
+ newPassword: string;
920
+ token?: string | undefined;
921
+ };
922
+ } & {
923
+ method?: "POST" | undefined;
924
+ } & {
925
+ query?: {
926
+ token?: string | undefined;
927
+ } | undefined;
928
+ } & {
929
+ params?: Record<string, any>;
930
+ } & {
931
+ request?: Request;
932
+ } & {
933
+ headers?: HeadersInit;
934
+ } & {
935
+ asResponse?: boolean;
936
+ returnHeaders?: boolean;
937
+ use?: import("better-call").Middleware[];
938
+ path?: string;
939
+ } & {
940
+ asResponse?: AsResponse | undefined;
941
+ returnHeaders?: ReturnHeaders_9 | undefined;
942
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_9] extends [true] ? {
943
+ headers: Headers;
944
+ response: {
945
+ status: boolean;
946
+ };
947
+ } : {
948
+ status: boolean;
949
+ }>;
950
+ options: {
951
+ method: "POST";
952
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
953
+ token: import("better-auth").ZodOptional<import("better-auth").ZodString>;
954
+ }, import("better-auth").$strip>>;
955
+ body: import("better-auth").ZodObject<{
956
+ newPassword: import("better-auth").ZodString;
957
+ token: import("better-auth").ZodOptional<import("better-auth").ZodString>;
958
+ }, import("better-auth").$strip>;
959
+ metadata: {
960
+ openapi: {
961
+ description: string;
962
+ responses: {
963
+ "200": {
964
+ description: string;
965
+ content: {
966
+ "application/json": {
967
+ schema: {
968
+ type: "object";
969
+ properties: {
970
+ status: {
971
+ type: string;
972
+ };
973
+ };
974
+ };
975
+ };
976
+ };
977
+ };
978
+ };
979
+ };
980
+ };
981
+ } & {
982
+ use: any[];
983
+ };
984
+ path: "/reset-password";
985
+ };
986
+ verifyEmail: {
987
+ <AsResponse extends boolean = false, ReturnHeaders_10 extends boolean = false>(inputCtx_0: {
988
+ body?: undefined;
989
+ } & {
990
+ method?: "GET" | undefined;
991
+ } & {
992
+ query: {
993
+ token: string;
994
+ callbackURL?: string | undefined;
995
+ };
996
+ } & {
997
+ params?: Record<string, any>;
998
+ } & {
999
+ request?: Request;
1000
+ } & {
1001
+ headers?: HeadersInit;
1002
+ } & {
1003
+ asResponse?: boolean;
1004
+ returnHeaders?: boolean;
1005
+ use?: import("better-call").Middleware[];
1006
+ path?: string;
1007
+ } & {
1008
+ asResponse?: AsResponse | undefined;
1009
+ returnHeaders?: ReturnHeaders_10 | undefined;
1010
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_10] extends [true] ? {
1011
+ headers: Headers;
1012
+ response: void | {
1013
+ status: boolean;
1014
+ user: {
1015
+ id: any;
1016
+ email: any;
1017
+ name: any;
1018
+ image: any;
1019
+ emailVerified: any;
1020
+ createdAt: any;
1021
+ updatedAt: any;
1022
+ };
1023
+ } | {
1024
+ status: boolean;
1025
+ user: null;
1026
+ };
1027
+ } : void | {
1028
+ status: boolean;
1029
+ user: {
1030
+ id: any;
1031
+ email: any;
1032
+ name: any;
1033
+ image: any;
1034
+ emailVerified: any;
1035
+ createdAt: any;
1036
+ updatedAt: any;
1037
+ };
1038
+ } | {
1039
+ status: boolean;
1040
+ user: null;
1041
+ }>;
1042
+ options: {
1043
+ method: "GET";
1044
+ query: import("better-auth").ZodObject<{
1045
+ token: import("better-auth").ZodString;
1046
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1047
+ }, import("better-auth").$strip>;
1048
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
1049
+ metadata: {
1050
+ openapi: {
1051
+ description: string;
1052
+ parameters: ({
1053
+ name: string;
1054
+ in: "query";
1055
+ description: string;
1056
+ required: true;
1057
+ schema: {
1058
+ type: "string";
1059
+ };
1060
+ } | {
1061
+ name: string;
1062
+ in: "query";
1063
+ description: string;
1064
+ required: false;
1065
+ schema: {
1066
+ type: "string";
1067
+ };
1068
+ })[];
1069
+ responses: {
1070
+ "200": {
1071
+ description: string;
1072
+ content: {
1073
+ "application/json": {
1074
+ schema: {
1075
+ type: "object";
1076
+ properties: {
1077
+ user: {
1078
+ type: string;
1079
+ properties: {
1080
+ id: {
1081
+ type: string;
1082
+ description: string;
1083
+ };
1084
+ email: {
1085
+ type: string;
1086
+ description: string;
1087
+ };
1088
+ name: {
1089
+ type: string;
1090
+ description: string;
1091
+ };
1092
+ image: {
1093
+ type: string;
1094
+ description: string;
1095
+ };
1096
+ emailVerified: {
1097
+ type: string;
1098
+ description: string;
1099
+ };
1100
+ createdAt: {
1101
+ type: string;
1102
+ description: string;
1103
+ };
1104
+ updatedAt: {
1105
+ type: string;
1106
+ description: string;
1107
+ };
1108
+ };
1109
+ required: string[];
1110
+ };
1111
+ status: {
1112
+ type: string;
1113
+ description: string;
1114
+ };
1115
+ };
1116
+ required: string[];
1117
+ };
1118
+ };
1119
+ };
1120
+ };
1121
+ };
1122
+ };
1123
+ };
1124
+ } & {
1125
+ use: any[];
1126
+ };
1127
+ path: "/verify-email";
1128
+ };
1129
+ sendVerificationEmail: {
1130
+ <AsResponse extends boolean = false, ReturnHeaders_11 extends boolean = false>(inputCtx_0: {
1131
+ body: {
1132
+ email: string;
1133
+ callbackURL?: string | undefined;
1134
+ };
1135
+ } & {
1136
+ method?: "POST" | undefined;
1137
+ } & {
1138
+ query?: Record<string, any> | undefined;
1139
+ } & {
1140
+ params?: Record<string, any>;
1141
+ } & {
1142
+ request?: Request;
1143
+ } & {
1144
+ headers?: HeadersInit;
1145
+ } & {
1146
+ asResponse?: boolean;
1147
+ returnHeaders?: boolean;
1148
+ use?: import("better-call").Middleware[];
1149
+ path?: string;
1150
+ } & {
1151
+ asResponse?: AsResponse | undefined;
1152
+ returnHeaders?: ReturnHeaders_11 | undefined;
1153
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_11] extends [true] ? {
1154
+ headers: Headers;
1155
+ response: {
1156
+ status: boolean;
1157
+ };
1158
+ } : {
1159
+ status: boolean;
1160
+ }>;
1161
+ options: {
1162
+ method: "POST";
1163
+ body: import("better-auth").ZodObject<{
1164
+ email: import("better-auth").ZodEmail;
1165
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1166
+ }, import("better-auth").$strip>;
1167
+ metadata: {
1168
+ openapi: {
1169
+ description: string;
1170
+ requestBody: {
1171
+ content: {
1172
+ "application/json": {
1173
+ schema: {
1174
+ type: "object";
1175
+ properties: {
1176
+ email: {
1177
+ type: string;
1178
+ description: string;
1179
+ example: string;
1180
+ };
1181
+ callbackURL: {
1182
+ type: string;
1183
+ description: string;
1184
+ example: string;
1185
+ nullable: boolean;
1186
+ };
1187
+ };
1188
+ required: string[];
1189
+ };
1190
+ };
1191
+ };
1192
+ };
1193
+ responses: {
1194
+ "200": {
1195
+ description: string;
1196
+ content: {
1197
+ "application/json": {
1198
+ schema: {
1199
+ type: "object";
1200
+ properties: {
1201
+ status: {
1202
+ type: string;
1203
+ description: string;
1204
+ example: boolean;
1205
+ };
1206
+ };
1207
+ };
1208
+ };
1209
+ };
1210
+ };
1211
+ "400": {
1212
+ description: string;
1213
+ content: {
1214
+ "application/json": {
1215
+ schema: {
1216
+ type: "object";
1217
+ properties: {
1218
+ message: {
1219
+ type: string;
1220
+ description: string;
1221
+ example: string;
1222
+ };
1223
+ };
1224
+ };
1225
+ };
1226
+ };
1227
+ };
1228
+ };
1229
+ };
1230
+ };
1231
+ } & {
1232
+ use: any[];
1233
+ };
1234
+ path: "/send-verification-email";
1235
+ };
1236
+ changeEmail: {
1237
+ <AsResponse extends boolean = false, ReturnHeaders_12 extends boolean = false>(inputCtx_0: {
1238
+ body: {
1239
+ newEmail: string;
1240
+ callbackURL?: string | undefined;
1241
+ };
1242
+ } & {
1243
+ method?: "POST" | undefined;
1244
+ } & {
1245
+ query?: Record<string, any> | undefined;
1246
+ } & {
1247
+ params?: Record<string, any>;
1248
+ } & {
1249
+ request?: Request;
1250
+ } & {
1251
+ headers?: HeadersInit;
1252
+ } & {
1253
+ asResponse?: boolean;
1254
+ returnHeaders?: boolean;
1255
+ use?: import("better-call").Middleware[];
1256
+ path?: string;
1257
+ } & {
1258
+ asResponse?: AsResponse | undefined;
1259
+ returnHeaders?: ReturnHeaders_12 | undefined;
1260
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_12] extends [true] ? {
1261
+ headers: Headers;
1262
+ response: {
1263
+ status: boolean;
1264
+ };
1265
+ } : {
1266
+ status: boolean;
1267
+ }>;
1268
+ options: {
1269
+ method: "POST";
1270
+ body: import("better-auth").ZodObject<{
1271
+ newEmail: import("better-auth").ZodEmail;
1272
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1273
+ }, import("better-auth").$strip>;
1274
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1275
+ session: {
1276
+ session: Record<string, any> & {
1277
+ id: string;
1278
+ createdAt: Date;
1279
+ updatedAt: Date;
1280
+ userId: string;
1281
+ expiresAt: Date;
1282
+ token: string;
1283
+ ipAddress?: string | null | undefined;
1284
+ userAgent?: string | null | undefined;
1285
+ };
1286
+ user: Record<string, any> & {
1287
+ id: string;
1288
+ createdAt: Date;
1289
+ updatedAt: Date;
1290
+ email: string;
1291
+ emailVerified: boolean;
1292
+ name: string;
1293
+ image?: string | null | undefined;
1294
+ };
1295
+ };
1296
+ }>)[];
1297
+ metadata: {
1298
+ openapi: {
1299
+ responses: {
1300
+ "200": {
1301
+ description: string;
1302
+ content: {
1303
+ "application/json": {
1304
+ schema: {
1305
+ type: "object";
1306
+ properties: {
1307
+ status: {
1308
+ type: string;
1309
+ description: string;
1310
+ };
1311
+ message: {
1312
+ type: string;
1313
+ enum: string[];
1314
+ description: string;
1315
+ nullable: boolean;
1316
+ };
1317
+ };
1318
+ required: string[];
1319
+ };
1320
+ };
1321
+ };
1322
+ };
1323
+ };
1324
+ };
1325
+ };
1326
+ } & {
1327
+ use: any[];
1328
+ };
1329
+ path: "/change-email";
1330
+ };
1331
+ changePassword: {
1332
+ <AsResponse extends boolean = false, ReturnHeaders_13 extends boolean = false>(inputCtx_0: {
1333
+ body: {
1334
+ newPassword: string;
1335
+ currentPassword: string;
1336
+ revokeOtherSessions?: boolean | undefined;
1337
+ };
1338
+ } & {
1339
+ method?: "POST" | undefined;
1340
+ } & {
1341
+ query?: Record<string, any> | undefined;
1342
+ } & {
1343
+ params?: Record<string, any>;
1344
+ } & {
1345
+ request?: Request;
1346
+ } & {
1347
+ headers?: HeadersInit;
1348
+ } & {
1349
+ asResponse?: boolean;
1350
+ returnHeaders?: boolean;
1351
+ use?: import("better-call").Middleware[];
1352
+ path?: string;
1353
+ } & {
1354
+ asResponse?: AsResponse | undefined;
1355
+ returnHeaders?: ReturnHeaders_13 | undefined;
1356
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_13] extends [true] ? {
1357
+ headers: Headers;
1358
+ response: {
1359
+ token: string | null;
1360
+ user: {
1361
+ id: string;
1362
+ email: string;
1363
+ name: string;
1364
+ image: string | null | undefined;
1365
+ emailVerified: boolean;
1366
+ createdAt: Date;
1367
+ updatedAt: Date;
1368
+ };
1369
+ };
1370
+ } : {
1371
+ token: string | null;
1372
+ user: {
1373
+ id: string;
1374
+ email: string;
1375
+ name: string;
1376
+ image: string | null | undefined;
1377
+ emailVerified: boolean;
1378
+ createdAt: Date;
1379
+ updatedAt: Date;
1380
+ };
1381
+ }>;
1382
+ options: {
1383
+ method: "POST";
1384
+ body: import("better-auth").ZodObject<{
1385
+ newPassword: import("better-auth").ZodString;
1386
+ currentPassword: import("better-auth").ZodString;
1387
+ revokeOtherSessions: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
1388
+ }, import("better-auth").$strip>;
1389
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1390
+ session: {
1391
+ session: Record<string, any> & {
1392
+ id: string;
1393
+ createdAt: Date;
1394
+ updatedAt: Date;
1395
+ userId: string;
1396
+ expiresAt: Date;
1397
+ token: string;
1398
+ ipAddress?: string | null | undefined;
1399
+ userAgent?: string | null | undefined;
1400
+ };
1401
+ user: Record<string, any> & {
1402
+ id: string;
1403
+ createdAt: Date;
1404
+ updatedAt: Date;
1405
+ email: string;
1406
+ emailVerified: boolean;
1407
+ name: string;
1408
+ image?: string | null | undefined;
1409
+ };
1410
+ };
1411
+ }>)[];
1412
+ metadata: {
1413
+ openapi: {
1414
+ description: string;
1415
+ responses: {
1416
+ "200": {
1417
+ description: string;
1418
+ content: {
1419
+ "application/json": {
1420
+ schema: {
1421
+ type: "object";
1422
+ properties: {
1423
+ token: {
1424
+ type: string;
1425
+ nullable: boolean;
1426
+ description: string;
1427
+ };
1428
+ user: {
1429
+ type: string;
1430
+ properties: {
1431
+ id: {
1432
+ type: string;
1433
+ description: string;
1434
+ };
1435
+ email: {
1436
+ type: string;
1437
+ format: string;
1438
+ description: string;
1439
+ };
1440
+ name: {
1441
+ type: string;
1442
+ description: string;
1443
+ };
1444
+ image: {
1445
+ type: string;
1446
+ format: string;
1447
+ nullable: boolean;
1448
+ description: string;
1449
+ };
1450
+ emailVerified: {
1451
+ type: string;
1452
+ description: string;
1453
+ };
1454
+ createdAt: {
1455
+ type: string;
1456
+ format: string;
1457
+ description: string;
1458
+ };
1459
+ updatedAt: {
1460
+ type: string;
1461
+ format: string;
1462
+ description: string;
1463
+ };
1464
+ };
1465
+ required: string[];
1466
+ };
1467
+ };
1468
+ required: string[];
1469
+ };
1470
+ };
1471
+ };
1472
+ };
1473
+ };
1474
+ };
1475
+ };
1476
+ } & {
1477
+ use: any[];
1478
+ };
1479
+ path: "/change-password";
1480
+ };
1481
+ setPassword: {
1482
+ <AsResponse extends boolean = false, ReturnHeaders_14 extends boolean = false>(inputCtx_0: {
1483
+ body: {
1484
+ newPassword: string;
1485
+ };
1486
+ } & {
1487
+ method?: "POST" | undefined;
1488
+ } & {
1489
+ query?: Record<string, any> | undefined;
1490
+ } & {
1491
+ params?: Record<string, any>;
1492
+ } & {
1493
+ request?: Request;
1494
+ } & {
1495
+ headers?: HeadersInit;
1496
+ } & {
1497
+ asResponse?: boolean;
1498
+ returnHeaders?: boolean;
1499
+ use?: import("better-call").Middleware[];
1500
+ path?: string;
1501
+ } & {
1502
+ asResponse?: AsResponse | undefined;
1503
+ returnHeaders?: ReturnHeaders_14 | undefined;
1504
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_14] extends [true] ? {
1505
+ headers: Headers;
1506
+ response: {
1507
+ status: boolean;
1508
+ };
1509
+ } : {
1510
+ status: boolean;
1511
+ }>;
1512
+ options: {
1513
+ method: "POST";
1514
+ body: import("better-auth").ZodObject<{
1515
+ newPassword: import("better-auth").ZodString;
1516
+ }, import("better-auth").$strip>;
1517
+ metadata: {
1518
+ SERVER_ONLY: true;
1519
+ };
1520
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1521
+ session: {
1522
+ session: Record<string, any> & {
1523
+ id: string;
1524
+ createdAt: Date;
1525
+ updatedAt: Date;
1526
+ userId: string;
1527
+ expiresAt: Date;
1528
+ token: string;
1529
+ ipAddress?: string | null | undefined;
1530
+ userAgent?: string | null | undefined;
1531
+ };
1532
+ user: Record<string, any> & {
1533
+ id: string;
1534
+ createdAt: Date;
1535
+ updatedAt: Date;
1536
+ email: string;
1537
+ emailVerified: boolean;
1538
+ name: string;
1539
+ image?: string | null | undefined;
1540
+ };
1541
+ };
1542
+ }>)[];
1543
+ } & {
1544
+ use: any[];
1545
+ };
1546
+ path: "/set-password";
1547
+ };
1548
+ updateUser: {
1549
+ <AsResponse extends boolean = false, ReturnHeaders_15 extends boolean = false>(inputCtx_0: {
1550
+ body: Partial<{}> & {
1551
+ name?: string;
1552
+ image?: string;
1553
+ };
1554
+ } & {
1555
+ method?: "POST" | undefined;
1556
+ } & {
1557
+ query?: Record<string, any> | undefined;
1558
+ } & {
1559
+ params?: Record<string, any>;
1560
+ } & {
1561
+ request?: Request;
1562
+ } & {
1563
+ headers?: HeadersInit;
1564
+ } & {
1565
+ asResponse?: boolean;
1566
+ returnHeaders?: boolean;
1567
+ use?: import("better-call").Middleware[];
1568
+ path?: string;
1569
+ } & {
1570
+ asResponse?: AsResponse | undefined;
1571
+ returnHeaders?: ReturnHeaders_15 | undefined;
1572
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_15] extends [true] ? {
1573
+ headers: Headers;
1574
+ response: {
1575
+ status: boolean;
1576
+ };
1577
+ } : {
1578
+ status: boolean;
1579
+ }>;
1580
+ options: {
1581
+ method: "POST";
1582
+ body: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>;
1583
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1584
+ session: {
1585
+ session: Record<string, any> & {
1586
+ id: string;
1587
+ createdAt: Date;
1588
+ updatedAt: Date;
1589
+ userId: string;
1590
+ expiresAt: Date;
1591
+ token: string;
1592
+ ipAddress?: string | null | undefined;
1593
+ userAgent?: string | null | undefined;
1594
+ };
1595
+ user: Record<string, any> & {
1596
+ id: string;
1597
+ createdAt: Date;
1598
+ updatedAt: Date;
1599
+ email: string;
1600
+ emailVerified: boolean;
1601
+ name: string;
1602
+ image?: string | null | undefined;
1603
+ };
1604
+ };
1605
+ }>)[];
1606
+ metadata: {
1607
+ $Infer: {
1608
+ body: Partial<{}> & {
1609
+ name?: string;
1610
+ image?: string;
1611
+ };
1612
+ };
1613
+ openapi: {
1614
+ description: string;
1615
+ requestBody: {
1616
+ content: {
1617
+ "application/json": {
1618
+ schema: {
1619
+ type: "object";
1620
+ properties: {
1621
+ name: {
1622
+ type: string;
1623
+ description: string;
1624
+ };
1625
+ image: {
1626
+ type: string;
1627
+ description: string;
1628
+ };
1629
+ };
1630
+ };
1631
+ };
1632
+ };
1633
+ };
1634
+ responses: {
1635
+ "200": {
1636
+ description: string;
1637
+ content: {
1638
+ "application/json": {
1639
+ schema: {
1640
+ type: "object";
1641
+ properties: {
1642
+ status: {
1643
+ type: string;
1644
+ description: string;
1645
+ };
1646
+ };
1647
+ };
1648
+ };
1649
+ };
1650
+ };
1651
+ };
1652
+ };
1653
+ };
1654
+ } & {
1655
+ use: any[];
1656
+ };
1657
+ path: "/update-user";
1658
+ };
1659
+ deleteUser: {
1660
+ <AsResponse extends boolean = false, ReturnHeaders_16 extends boolean = false>(inputCtx_0: {
1661
+ body: {
1662
+ callbackURL?: string | undefined;
1663
+ password?: string | undefined;
1664
+ token?: string | undefined;
1665
+ };
1666
+ } & {
1667
+ method?: "POST" | undefined;
1668
+ } & {
1669
+ query?: Record<string, any> | undefined;
1670
+ } & {
1671
+ params?: Record<string, any>;
1672
+ } & {
1673
+ request?: Request;
1674
+ } & {
1675
+ headers?: HeadersInit;
1676
+ } & {
1677
+ asResponse?: boolean;
1678
+ returnHeaders?: boolean;
1679
+ use?: import("better-call").Middleware[];
1680
+ path?: string;
1681
+ } & {
1682
+ asResponse?: AsResponse | undefined;
1683
+ returnHeaders?: ReturnHeaders_16 | undefined;
1684
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_16] extends [true] ? {
1685
+ headers: Headers;
1686
+ response: {
1687
+ success: boolean;
1688
+ message: string;
1689
+ };
1690
+ } : {
1691
+ success: boolean;
1692
+ message: string;
1693
+ }>;
1694
+ options: {
1695
+ method: "POST";
1696
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1697
+ session: {
1698
+ session: Record<string, any> & {
1699
+ id: string;
1700
+ createdAt: Date;
1701
+ updatedAt: Date;
1702
+ userId: string;
1703
+ expiresAt: Date;
1704
+ token: string;
1705
+ ipAddress?: string | null | undefined;
1706
+ userAgent?: string | null | undefined;
1707
+ };
1708
+ user: Record<string, any> & {
1709
+ id: string;
1710
+ createdAt: Date;
1711
+ updatedAt: Date;
1712
+ email: string;
1713
+ emailVerified: boolean;
1714
+ name: string;
1715
+ image?: string | null | undefined;
1716
+ };
1717
+ };
1718
+ }>)[];
1719
+ body: import("better-auth").ZodObject<{
1720
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1721
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1722
+ token: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1723
+ }, import("better-auth").$strip>;
1724
+ metadata: {
1725
+ openapi: {
1726
+ description: string;
1727
+ responses: {
1728
+ "200": {
1729
+ description: string;
1730
+ content: {
1731
+ "application/json": {
1732
+ schema: {
1733
+ type: "object";
1734
+ properties: {
1735
+ success: {
1736
+ type: string;
1737
+ description: string;
1738
+ };
1739
+ message: {
1740
+ type: string;
1741
+ enum: string[];
1742
+ description: string;
1743
+ };
1744
+ };
1745
+ required: string[];
1746
+ };
1747
+ };
1748
+ };
1749
+ };
1750
+ };
1751
+ };
1752
+ };
1753
+ } & {
1754
+ use: any[];
1755
+ };
1756
+ path: "/delete-user";
1757
+ };
1758
+ forgetPasswordCallback: {
1759
+ <AsResponse extends boolean = false, ReturnHeaders_17 extends boolean = false>(inputCtx_0: {
1760
+ body?: undefined;
1761
+ } & {
1762
+ method?: "GET" | undefined;
1763
+ } & {
1764
+ query: {
1765
+ callbackURL: string;
1766
+ };
1767
+ } & {
1768
+ params: {
1769
+ token: string;
1770
+ };
1771
+ } & {
1772
+ request?: Request;
1773
+ } & {
1774
+ headers?: HeadersInit;
1775
+ } & {
1776
+ asResponse?: boolean;
1777
+ returnHeaders?: boolean;
1778
+ use?: import("better-call").Middleware[];
1779
+ path?: string;
1780
+ } & {
1781
+ asResponse?: AsResponse | undefined;
1782
+ returnHeaders?: ReturnHeaders_17 | undefined;
1783
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_17] extends [true] ? {
1784
+ headers: Headers;
1785
+ response: never;
1786
+ } : never>;
1787
+ options: {
1788
+ method: "GET";
1789
+ query: import("better-auth").ZodObject<{
1790
+ callbackURL: import("better-auth").ZodString;
1791
+ }, import("better-auth").$strip>;
1792
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
1793
+ metadata: {
1794
+ openapi: {
1795
+ description: string;
1796
+ responses: {
1797
+ "200": {
1798
+ description: string;
1799
+ content: {
1800
+ "application/json": {
1801
+ schema: {
1802
+ type: "object";
1803
+ properties: {
1804
+ token: {
1805
+ type: string;
1806
+ };
1807
+ };
1808
+ };
1809
+ };
1810
+ };
1811
+ };
1812
+ };
1813
+ };
1814
+ };
1815
+ } & {
1816
+ use: any[];
1817
+ };
1818
+ path: "/reset-password/:token";
1819
+ };
1820
+ requestPasswordReset: {
1821
+ <AsResponse extends boolean = false, ReturnHeaders_18 extends boolean = false>(inputCtx_0: {
1822
+ body: {
1823
+ email: string;
1824
+ redirectTo?: string | undefined;
1825
+ };
1826
+ } & {
1827
+ method?: "POST" | undefined;
1828
+ } & {
1829
+ query?: Record<string, any> | undefined;
1830
+ } & {
1831
+ params?: Record<string, any>;
1832
+ } & {
1833
+ request?: Request;
1834
+ } & {
1835
+ headers?: HeadersInit;
1836
+ } & {
1837
+ asResponse?: boolean;
1838
+ returnHeaders?: boolean;
1839
+ use?: import("better-call").Middleware[];
1840
+ path?: string;
1841
+ } & {
1842
+ asResponse?: AsResponse | undefined;
1843
+ returnHeaders?: ReturnHeaders_18 | undefined;
1844
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_18] extends [true] ? {
1845
+ headers: Headers;
1846
+ response: {
1847
+ status: boolean;
1848
+ };
1849
+ } : {
1850
+ status: boolean;
1851
+ }>;
1852
+ options: {
1853
+ method: "POST";
1854
+ body: import("better-auth").ZodObject<{
1855
+ email: import("better-auth").ZodEmail;
1856
+ redirectTo: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1857
+ }, import("better-auth").$strip>;
1858
+ metadata: {
1859
+ openapi: {
1860
+ description: string;
1861
+ responses: {
1862
+ "200": {
1863
+ description: string;
1864
+ content: {
1865
+ "application/json": {
1866
+ schema: {
1867
+ type: "object";
1868
+ properties: {
1869
+ status: {
1870
+ type: string;
1871
+ };
1872
+ message: {
1873
+ type: string;
1874
+ };
1875
+ };
1876
+ };
1877
+ };
1878
+ };
1879
+ };
1880
+ };
1881
+ };
1882
+ };
1883
+ } & {
1884
+ use: any[];
1885
+ };
1886
+ path: "/request-password-reset";
1887
+ };
1888
+ requestPasswordResetCallback: {
1889
+ <AsResponse extends boolean = false, ReturnHeaders_19 extends boolean = false>(inputCtx_0: {
1890
+ body?: undefined;
1891
+ } & {
1892
+ method?: "GET" | undefined;
1893
+ } & {
1894
+ query: {
1895
+ callbackURL: string;
1896
+ };
1897
+ } & {
1898
+ params: {
1899
+ token: string;
1900
+ };
1901
+ } & {
1902
+ request?: Request;
1903
+ } & {
1904
+ headers?: HeadersInit;
1905
+ } & {
1906
+ asResponse?: boolean;
1907
+ returnHeaders?: boolean;
1908
+ use?: import("better-call").Middleware[];
1909
+ path?: string;
1910
+ } & {
1911
+ asResponse?: AsResponse | undefined;
1912
+ returnHeaders?: ReturnHeaders_19 | undefined;
1913
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_19] extends [true] ? {
1914
+ headers: Headers;
1915
+ response: never;
1916
+ } : never>;
1917
+ options: {
1918
+ method: "GET";
1919
+ query: import("better-auth").ZodObject<{
1920
+ callbackURL: import("better-auth").ZodString;
1921
+ }, import("better-auth").$strip>;
1922
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
1923
+ metadata: {
1924
+ openapi: {
1925
+ description: string;
1926
+ responses: {
1927
+ "200": {
1928
+ description: string;
1929
+ content: {
1930
+ "application/json": {
1931
+ schema: {
1932
+ type: "object";
1933
+ properties: {
1934
+ token: {
1935
+ type: string;
1936
+ };
1937
+ };
1938
+ };
1939
+ };
1940
+ };
1941
+ };
1942
+ };
1943
+ };
1944
+ };
1945
+ } & {
1946
+ use: any[];
1947
+ };
1948
+ path: "/reset-password/:token";
1949
+ };
1950
+ listSessions: {
1951
+ <AsResponse extends boolean = false, ReturnHeaders_20 extends boolean = false>(inputCtx_0: {
1952
+ body?: undefined;
1953
+ } & {
1954
+ method?: "GET" | undefined;
1955
+ } & {
1956
+ query?: Record<string, any> | undefined;
1957
+ } & {
1958
+ params?: Record<string, any>;
1959
+ } & {
1960
+ request?: Request;
1961
+ } & {
1962
+ headers: HeadersInit;
1963
+ } & {
1964
+ asResponse?: boolean;
1965
+ returnHeaders?: boolean;
1966
+ use?: import("better-call").Middleware[];
1967
+ path?: string;
1968
+ } & {
1969
+ asResponse?: AsResponse | undefined;
1970
+ returnHeaders?: ReturnHeaders_20 | undefined;
1971
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_20] extends [true] ? {
1972
+ headers: Headers;
1973
+ response: import("better-auth").Prettify<{
1974
+ id: string;
1975
+ createdAt: Date;
1976
+ updatedAt: Date;
1977
+ userId: string;
1978
+ expiresAt: Date;
1979
+ token: string;
1980
+ ipAddress?: string | null | undefined | undefined;
1981
+ userAgent?: string | null | undefined | undefined;
1982
+ }>[];
1983
+ } : import("better-auth").Prettify<{
1984
+ id: string;
1985
+ createdAt: Date;
1986
+ updatedAt: Date;
1987
+ userId: string;
1988
+ expiresAt: Date;
1989
+ token: string;
1990
+ ipAddress?: string | null | undefined | undefined;
1991
+ userAgent?: string | null | undefined | undefined;
1992
+ }>[]>;
1993
+ options: {
1994
+ method: "GET";
1995
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1996
+ session: {
1997
+ session: Record<string, any> & {
1998
+ id: string;
1999
+ createdAt: Date;
2000
+ updatedAt: Date;
2001
+ userId: string;
2002
+ expiresAt: Date;
2003
+ token: string;
2004
+ ipAddress?: string | null | undefined;
2005
+ userAgent?: string | null | undefined;
2006
+ };
2007
+ user: Record<string, any> & {
2008
+ id: string;
2009
+ createdAt: Date;
2010
+ updatedAt: Date;
2011
+ email: string;
2012
+ emailVerified: boolean;
2013
+ name: string;
2014
+ image?: string | null | undefined;
2015
+ };
2016
+ };
2017
+ }>)[];
2018
+ requireHeaders: true;
2019
+ metadata: {
2020
+ openapi: {
2021
+ description: string;
2022
+ responses: {
2023
+ "200": {
2024
+ description: string;
2025
+ content: {
2026
+ "application/json": {
2027
+ schema: {
2028
+ type: "array";
2029
+ items: {
2030
+ $ref: string;
2031
+ };
2032
+ };
2033
+ };
2034
+ };
2035
+ };
2036
+ };
2037
+ };
2038
+ };
2039
+ } & {
2040
+ use: any[];
2041
+ };
2042
+ path: "/list-sessions";
2043
+ };
2044
+ revokeSession: {
2045
+ <AsResponse extends boolean = false, ReturnHeaders_21 extends boolean = false>(inputCtx_0: {
2046
+ body: {
2047
+ token: string;
2048
+ };
2049
+ } & {
2050
+ method?: "POST" | undefined;
2051
+ } & {
2052
+ query?: Record<string, any> | undefined;
2053
+ } & {
2054
+ params?: Record<string, any>;
2055
+ } & {
2056
+ request?: Request;
2057
+ } & {
2058
+ headers: HeadersInit;
2059
+ } & {
2060
+ asResponse?: boolean;
2061
+ returnHeaders?: boolean;
2062
+ use?: import("better-call").Middleware[];
2063
+ path?: string;
2064
+ } & {
2065
+ asResponse?: AsResponse | undefined;
2066
+ returnHeaders?: ReturnHeaders_21 | undefined;
2067
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_21] extends [true] ? {
2068
+ headers: Headers;
2069
+ response: {
2070
+ status: boolean;
2071
+ };
2072
+ } : {
2073
+ status: boolean;
2074
+ }>;
2075
+ options: {
2076
+ method: "POST";
2077
+ body: import("better-auth").ZodObject<{
2078
+ token: import("better-auth").ZodString;
2079
+ }, import("better-auth").$strip>;
2080
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
2081
+ session: {
2082
+ session: Record<string, any> & {
2083
+ id: string;
2084
+ createdAt: Date;
2085
+ updatedAt: Date;
2086
+ userId: string;
2087
+ expiresAt: Date;
2088
+ token: string;
2089
+ ipAddress?: string | null | undefined;
2090
+ userAgent?: string | null | undefined;
2091
+ };
2092
+ user: Record<string, any> & {
2093
+ id: string;
2094
+ createdAt: Date;
2095
+ updatedAt: Date;
2096
+ email: string;
2097
+ emailVerified: boolean;
2098
+ name: string;
2099
+ image?: string | null | undefined;
2100
+ };
2101
+ };
2102
+ }>)[];
2103
+ requireHeaders: true;
2104
+ metadata: {
2105
+ openapi: {
2106
+ description: string;
2107
+ requestBody: {
2108
+ content: {
2109
+ "application/json": {
2110
+ schema: {
2111
+ type: "object";
2112
+ properties: {
2113
+ token: {
2114
+ type: string;
2115
+ description: string;
2116
+ };
2117
+ };
2118
+ required: string[];
2119
+ };
2120
+ };
2121
+ };
2122
+ };
2123
+ responses: {
2124
+ "200": {
2125
+ description: string;
2126
+ content: {
2127
+ "application/json": {
2128
+ schema: {
2129
+ type: "object";
2130
+ properties: {
2131
+ status: {
2132
+ type: string;
2133
+ description: string;
2134
+ };
2135
+ };
2136
+ required: string[];
2137
+ };
2138
+ };
2139
+ };
2140
+ };
2141
+ };
2142
+ };
2143
+ };
2144
+ } & {
2145
+ use: any[];
2146
+ };
2147
+ path: "/revoke-session";
2148
+ };
2149
+ revokeSessions: {
2150
+ <AsResponse extends boolean = false, ReturnHeaders_22 extends boolean = false>(inputCtx_0: {
2151
+ body?: undefined;
2152
+ } & {
2153
+ method?: "POST" | undefined;
2154
+ } & {
2155
+ query?: Record<string, any> | undefined;
2156
+ } & {
2157
+ params?: Record<string, any>;
2158
+ } & {
2159
+ request?: Request;
2160
+ } & {
2161
+ headers: HeadersInit;
2162
+ } & {
2163
+ asResponse?: boolean;
2164
+ returnHeaders?: boolean;
2165
+ use?: import("better-call").Middleware[];
2166
+ path?: string;
2167
+ } & {
2168
+ asResponse?: AsResponse | undefined;
2169
+ returnHeaders?: ReturnHeaders_22 | undefined;
2170
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_22] extends [true] ? {
2171
+ headers: Headers;
2172
+ response: {
2173
+ status: boolean;
2174
+ };
2175
+ } : {
2176
+ status: boolean;
2177
+ }>;
2178
+ options: {
2179
+ method: "POST";
2180
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
2181
+ session: {
2182
+ session: Record<string, any> & {
2183
+ id: string;
2184
+ createdAt: Date;
2185
+ updatedAt: Date;
2186
+ userId: string;
2187
+ expiresAt: Date;
2188
+ token: string;
2189
+ ipAddress?: string | null | undefined;
2190
+ userAgent?: string | null | undefined;
2191
+ };
2192
+ user: Record<string, any> & {
2193
+ id: string;
2194
+ createdAt: Date;
2195
+ updatedAt: Date;
2196
+ email: string;
2197
+ emailVerified: boolean;
2198
+ name: string;
2199
+ image?: string | null | undefined;
2200
+ };
2201
+ };
2202
+ }>)[];
2203
+ requireHeaders: true;
2204
+ metadata: {
2205
+ openapi: {
2206
+ description: string;
2207
+ responses: {
2208
+ "200": {
2209
+ description: string;
2210
+ content: {
2211
+ "application/json": {
2212
+ schema: {
2213
+ type: "object";
2214
+ properties: {
2215
+ status: {
2216
+ type: string;
2217
+ description: string;
2218
+ };
2219
+ };
2220
+ required: string[];
2221
+ };
2222
+ };
2223
+ };
2224
+ };
2225
+ };
2226
+ };
2227
+ };
2228
+ } & {
2229
+ use: any[];
2230
+ };
2231
+ path: "/revoke-sessions";
2232
+ };
2233
+ revokeOtherSessions: {
2234
+ <AsResponse extends boolean = false, ReturnHeaders_23 extends boolean = false>(inputCtx_0: {
2235
+ body?: undefined;
2236
+ } & {
2237
+ method?: "POST" | undefined;
2238
+ } & {
2239
+ query?: Record<string, any> | undefined;
2240
+ } & {
2241
+ params?: Record<string, any>;
2242
+ } & {
2243
+ request?: Request;
2244
+ } & {
2245
+ headers: HeadersInit;
2246
+ } & {
2247
+ asResponse?: boolean;
2248
+ returnHeaders?: boolean;
2249
+ use?: import("better-call").Middleware[];
2250
+ path?: string;
2251
+ } & {
2252
+ asResponse?: AsResponse | undefined;
2253
+ returnHeaders?: ReturnHeaders_23 | undefined;
2254
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_23] extends [true] ? {
2255
+ headers: Headers;
2256
+ response: {
2257
+ status: boolean;
2258
+ };
2259
+ } : {
2260
+ status: boolean;
2261
+ }>;
2262
+ options: {
2263
+ method: "POST";
2264
+ requireHeaders: true;
2265
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
2266
+ session: {
2267
+ session: Record<string, any> & {
2268
+ id: string;
2269
+ createdAt: Date;
2270
+ updatedAt: Date;
2271
+ userId: string;
2272
+ expiresAt: Date;
2273
+ token: string;
2274
+ ipAddress?: string | null | undefined;
2275
+ userAgent?: string | null | undefined;
2276
+ };
2277
+ user: Record<string, any> & {
2278
+ id: string;
2279
+ createdAt: Date;
2280
+ updatedAt: Date;
2281
+ email: string;
2282
+ emailVerified: boolean;
2283
+ name: string;
2284
+ image?: string | null | undefined;
2285
+ };
2286
+ };
2287
+ }>)[];
2288
+ metadata: {
2289
+ openapi: {
2290
+ description: string;
2291
+ responses: {
2292
+ "200": {
2293
+ description: string;
2294
+ content: {
2295
+ "application/json": {
2296
+ schema: {
2297
+ type: "object";
2298
+ properties: {
2299
+ status: {
2300
+ type: string;
2301
+ description: string;
2302
+ };
2303
+ };
2304
+ required: string[];
2305
+ };
2306
+ };
2307
+ };
2308
+ };
2309
+ };
2310
+ };
2311
+ };
2312
+ } & {
2313
+ use: any[];
2314
+ };
2315
+ path: "/revoke-other-sessions";
2316
+ };
2317
+ linkSocialAccount: {
2318
+ <AsResponse extends boolean = false, ReturnHeaders_24 extends boolean = false>(inputCtx_0: {
2319
+ body: {
2320
+ provider: unknown;
2321
+ callbackURL?: string | undefined;
2322
+ idToken?: {
2323
+ token: string;
2324
+ nonce?: string | undefined;
2325
+ accessToken?: string | undefined;
2326
+ refreshToken?: string | undefined;
2327
+ scopes?: string[] | undefined;
2328
+ } | undefined;
2329
+ requestSignUp?: boolean | undefined;
2330
+ scopes?: string[] | undefined;
2331
+ errorCallbackURL?: string | undefined;
2332
+ disableRedirect?: boolean | undefined;
2333
+ };
2334
+ } & {
2335
+ method?: "POST" | undefined;
2336
+ } & {
2337
+ query?: Record<string, any> | undefined;
2338
+ } & {
2339
+ params?: Record<string, any>;
2340
+ } & {
2341
+ request?: Request;
2342
+ } & {
2343
+ headers: HeadersInit;
2344
+ } & {
2345
+ asResponse?: boolean;
2346
+ returnHeaders?: boolean;
2347
+ use?: import("better-call").Middleware[];
2348
+ path?: string;
2349
+ } & {
2350
+ asResponse?: AsResponse | undefined;
2351
+ returnHeaders?: ReturnHeaders_24 | undefined;
2352
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_24] extends [true] ? {
2353
+ headers: Headers;
2354
+ response: {
2355
+ url: string;
2356
+ redirect: boolean;
2357
+ };
2358
+ } : {
2359
+ url: string;
2360
+ redirect: boolean;
2361
+ }>;
2362
+ options: {
2363
+ method: "POST";
2364
+ requireHeaders: true;
2365
+ body: import("better-auth").ZodObject<{
2366
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2367
+ provider: import("better-auth").ZodType<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal" | (string & {}), unknown, import("better-auth").$ZodTypeInternals<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal" | (string & {}), unknown>>;
2368
+ idToken: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
2369
+ token: import("better-auth").ZodString;
2370
+ nonce: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2371
+ accessToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2372
+ refreshToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2373
+ scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
2374
+ }, import("better-auth").$strip>>;
2375
+ requestSignUp: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
2376
+ scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
2377
+ errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2378
+ disableRedirect: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
2379
+ }, import("better-auth").$strip>;
2380
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
2381
+ session: {
2382
+ session: Record<string, any> & {
2383
+ id: string;
2384
+ createdAt: Date;
2385
+ updatedAt: Date;
2386
+ userId: string;
2387
+ expiresAt: Date;
2388
+ token: string;
2389
+ ipAddress?: string | null | undefined;
2390
+ userAgent?: string | null | undefined;
2391
+ };
2392
+ user: Record<string, any> & {
2393
+ id: string;
2394
+ createdAt: Date;
2395
+ updatedAt: Date;
2396
+ email: string;
2397
+ emailVerified: boolean;
2398
+ name: string;
2399
+ image?: string | null | undefined;
2400
+ };
2401
+ };
2402
+ }>)[];
2403
+ metadata: {
2404
+ openapi: {
2405
+ description: string;
2406
+ responses: {
2407
+ "200": {
2408
+ description: string;
2409
+ content: {
2410
+ "application/json": {
2411
+ schema: {
2412
+ type: "object";
2413
+ properties: {
2414
+ url: {
2415
+ type: string;
2416
+ description: string;
2417
+ };
2418
+ redirect: {
2419
+ type: string;
2420
+ description: string;
2421
+ };
2422
+ status: {
2423
+ type: string;
2424
+ };
2425
+ };
2426
+ required: string[];
2427
+ };
2428
+ };
2429
+ };
2430
+ };
2431
+ };
2432
+ };
2433
+ };
2434
+ } & {
2435
+ use: any[];
2436
+ };
2437
+ path: "/link-social";
2438
+ };
2439
+ listUserAccounts: {
2440
+ <AsResponse extends boolean = false, ReturnHeaders_25 extends boolean = false>(inputCtx_0?: ({
2441
+ body?: undefined;
2442
+ } & {
2443
+ method?: "GET" | undefined;
2444
+ } & {
2445
+ query?: Record<string, any> | undefined;
2446
+ } & {
2447
+ params?: Record<string, any>;
2448
+ } & {
2449
+ request?: Request;
2450
+ } & {
2451
+ headers?: HeadersInit;
2452
+ } & {
2453
+ asResponse?: boolean;
2454
+ returnHeaders?: boolean;
2455
+ use?: import("better-call").Middleware[];
2456
+ path?: string;
2457
+ } & {
2458
+ asResponse?: AsResponse | undefined;
2459
+ returnHeaders?: ReturnHeaders_25 | undefined;
2460
+ }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_25] extends [true] ? {
2461
+ headers: Headers;
2462
+ response: {
2463
+ id: string;
2464
+ providerId: string;
2465
+ createdAt: Date;
2466
+ updatedAt: Date;
2467
+ accountId: string;
2468
+ scopes: string[];
2469
+ }[];
2470
+ } : {
2471
+ id: string;
2472
+ providerId: string;
2473
+ createdAt: Date;
2474
+ updatedAt: Date;
2475
+ accountId: string;
2476
+ scopes: string[];
2477
+ }[]>;
2478
+ options: {
2479
+ method: "GET";
2480
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
2481
+ session: {
2482
+ session: Record<string, any> & {
2483
+ id: string;
2484
+ createdAt: Date;
2485
+ updatedAt: Date;
2486
+ userId: string;
2487
+ expiresAt: Date;
2488
+ token: string;
2489
+ ipAddress?: string | null | undefined;
2490
+ userAgent?: string | null | undefined;
2491
+ };
2492
+ user: Record<string, any> & {
2493
+ id: string;
2494
+ createdAt: Date;
2495
+ updatedAt: Date;
2496
+ email: string;
2497
+ emailVerified: boolean;
2498
+ name: string;
2499
+ image?: string | null | undefined;
2500
+ };
2501
+ };
2502
+ }>)[];
2503
+ metadata: {
2504
+ openapi: {
2505
+ description: string;
2506
+ responses: {
2507
+ "200": {
2508
+ description: string;
2509
+ content: {
2510
+ "application/json": {
2511
+ schema: {
2512
+ type: "array";
2513
+ items: {
2514
+ type: string;
2515
+ properties: {
2516
+ id: {
2517
+ type: string;
2518
+ };
2519
+ providerId: {
2520
+ type: string;
2521
+ };
2522
+ createdAt: {
2523
+ type: string;
2524
+ format: string;
2525
+ };
2526
+ updatedAt: {
2527
+ type: string;
2528
+ format: string;
2529
+ };
2530
+ accountId: {
2531
+ type: string;
2532
+ };
2533
+ scopes: {
2534
+ type: string;
2535
+ items: {
2536
+ type: string;
2537
+ };
2538
+ };
2539
+ };
2540
+ required: string[];
2541
+ };
2542
+ };
2543
+ };
2544
+ };
2545
+ };
2546
+ };
2547
+ };
2548
+ };
2549
+ } & {
2550
+ use: any[];
2551
+ };
2552
+ path: "/list-accounts";
2553
+ };
2554
+ deleteUserCallback: {
2555
+ <AsResponse extends boolean = false, ReturnHeaders_26 extends boolean = false>(inputCtx_0: {
2556
+ body?: undefined;
2557
+ } & {
2558
+ method?: "GET" | undefined;
2559
+ } & {
2560
+ query: {
2561
+ token: string;
2562
+ callbackURL?: string | undefined;
2563
+ };
2564
+ } & {
2565
+ params?: Record<string, any>;
2566
+ } & {
2567
+ request?: Request;
2568
+ } & {
2569
+ headers?: HeadersInit;
2570
+ } & {
2571
+ asResponse?: boolean;
2572
+ returnHeaders?: boolean;
2573
+ use?: import("better-call").Middleware[];
2574
+ path?: string;
2575
+ } & {
2576
+ asResponse?: AsResponse | undefined;
2577
+ returnHeaders?: ReturnHeaders_26 | undefined;
2578
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_26] extends [true] ? {
2579
+ headers: Headers;
2580
+ response: {
2581
+ success: boolean;
2582
+ message: string;
2583
+ };
2584
+ } : {
2585
+ success: boolean;
2586
+ message: string;
2587
+ }>;
2588
+ options: {
2589
+ method: "GET";
2590
+ query: import("better-auth").ZodObject<{
2591
+ token: import("better-auth").ZodString;
2592
+ callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2593
+ }, import("better-auth").$strip>;
2594
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
2595
+ metadata: {
2596
+ openapi: {
2597
+ description: string;
2598
+ responses: {
2599
+ "200": {
2600
+ description: string;
2601
+ content: {
2602
+ "application/json": {
2603
+ schema: {
2604
+ type: "object";
2605
+ properties: {
2606
+ success: {
2607
+ type: string;
2608
+ description: string;
2609
+ };
2610
+ message: {
2611
+ type: string;
2612
+ enum: string[];
2613
+ description: string;
2614
+ };
2615
+ };
2616
+ required: string[];
2617
+ };
2618
+ };
2619
+ };
2620
+ };
2621
+ };
2622
+ };
2623
+ };
2624
+ } & {
2625
+ use: any[];
2626
+ };
2627
+ path: "/delete-user/callback";
2628
+ };
2629
+ unlinkAccount: {
2630
+ <AsResponse extends boolean = false, ReturnHeaders_27 extends boolean = false>(inputCtx_0: {
2631
+ body: {
2632
+ providerId: string;
2633
+ accountId?: string | undefined;
2634
+ };
2635
+ } & {
2636
+ method?: "POST" | undefined;
2637
+ } & {
2638
+ query?: Record<string, any> | undefined;
2639
+ } & {
2640
+ params?: Record<string, any>;
2641
+ } & {
2642
+ request?: Request;
2643
+ } & {
2644
+ headers?: HeadersInit;
2645
+ } & {
2646
+ asResponse?: boolean;
2647
+ returnHeaders?: boolean;
2648
+ use?: import("better-call").Middleware[];
2649
+ path?: string;
2650
+ } & {
2651
+ asResponse?: AsResponse | undefined;
2652
+ returnHeaders?: ReturnHeaders_27 | undefined;
2653
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_27] extends [true] ? {
2654
+ headers: Headers;
2655
+ response: {
2656
+ status: boolean;
2657
+ };
2658
+ } : {
2659
+ status: boolean;
2660
+ }>;
2661
+ options: {
2662
+ method: "POST";
2663
+ body: import("better-auth").ZodObject<{
2664
+ providerId: import("better-auth").ZodString;
2665
+ accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2666
+ }, import("better-auth").$strip>;
2667
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
2668
+ session: {
2669
+ session: Record<string, any> & {
2670
+ id: string;
2671
+ createdAt: Date;
2672
+ updatedAt: Date;
2673
+ userId: string;
2674
+ expiresAt: Date;
2675
+ token: string;
2676
+ ipAddress?: string | null | undefined;
2677
+ userAgent?: string | null | undefined;
2678
+ };
2679
+ user: Record<string, any> & {
2680
+ id: string;
2681
+ createdAt: Date;
2682
+ updatedAt: Date;
2683
+ email: string;
2684
+ emailVerified: boolean;
2685
+ name: string;
2686
+ image?: string | null | undefined;
2687
+ };
2688
+ };
2689
+ }>)[];
2690
+ metadata: {
2691
+ openapi: {
2692
+ description: string;
2693
+ responses: {
2694
+ "200": {
2695
+ description: string;
2696
+ content: {
2697
+ "application/json": {
2698
+ schema: {
2699
+ type: "object";
2700
+ properties: {
2701
+ status: {
2702
+ type: string;
2703
+ };
2704
+ };
2705
+ };
2706
+ };
2707
+ };
2708
+ };
2709
+ };
2710
+ };
2711
+ };
2712
+ } & {
2713
+ use: any[];
2714
+ };
2715
+ path: "/unlink-account";
2716
+ };
2717
+ refreshToken: {
2718
+ <AsResponse extends boolean = false, ReturnHeaders_28 extends boolean = false>(inputCtx_0: {
2719
+ body: {
2720
+ providerId: string;
2721
+ accountId?: string | undefined;
2722
+ userId?: string | undefined;
2723
+ };
2724
+ } & {
2725
+ method?: "POST" | undefined;
2726
+ } & {
2727
+ query?: Record<string, any> | undefined;
2728
+ } & {
2729
+ params?: Record<string, any>;
2730
+ } & {
2731
+ request?: Request;
2732
+ } & {
2733
+ headers?: HeadersInit;
2734
+ } & {
2735
+ asResponse?: boolean;
2736
+ returnHeaders?: boolean;
2737
+ use?: import("better-call").Middleware[];
2738
+ path?: string;
2739
+ } & {
2740
+ asResponse?: AsResponse | undefined;
2741
+ returnHeaders?: ReturnHeaders_28 | undefined;
2742
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_28] extends [true] ? {
2743
+ headers: Headers;
2744
+ response: import("better-auth").OAuth2Tokens;
2745
+ } : import("better-auth").OAuth2Tokens>;
2746
+ options: {
2747
+ method: "POST";
2748
+ body: import("better-auth").ZodObject<{
2749
+ providerId: import("better-auth").ZodString;
2750
+ accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2751
+ userId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2752
+ }, import("better-auth").$strip>;
2753
+ metadata: {
2754
+ openapi: {
2755
+ description: string;
2756
+ responses: {
2757
+ 200: {
2758
+ description: string;
2759
+ content: {
2760
+ "application/json": {
2761
+ schema: {
2762
+ type: "object";
2763
+ properties: {
2764
+ tokenType: {
2765
+ type: string;
2766
+ };
2767
+ idToken: {
2768
+ type: string;
2769
+ };
2770
+ accessToken: {
2771
+ type: string;
2772
+ };
2773
+ refreshToken: {
2774
+ type: string;
2775
+ };
2776
+ accessTokenExpiresAt: {
2777
+ type: string;
2778
+ format: string;
2779
+ };
2780
+ refreshTokenExpiresAt: {
2781
+ type: string;
2782
+ format: string;
2783
+ };
2784
+ };
2785
+ };
2786
+ };
2787
+ };
2788
+ };
2789
+ 400: {
2790
+ description: string;
2791
+ };
2792
+ };
2793
+ };
2794
+ };
2795
+ } & {
2796
+ use: any[];
2797
+ };
2798
+ path: "/refresh-token";
2799
+ };
2800
+ getAccessToken: {
2801
+ <AsResponse extends boolean = false, ReturnHeaders_29 extends boolean = false>(inputCtx_0: {
2802
+ body: {
2803
+ providerId: string;
2804
+ accountId?: string | undefined;
2805
+ userId?: string | undefined;
2806
+ };
2807
+ } & {
2808
+ method?: "POST" | undefined;
2809
+ } & {
2810
+ query?: Record<string, any> | undefined;
2811
+ } & {
2812
+ params?: Record<string, any>;
2813
+ } & {
2814
+ request?: Request;
2815
+ } & {
2816
+ headers?: HeadersInit;
2817
+ } & {
2818
+ asResponse?: boolean;
2819
+ returnHeaders?: boolean;
2820
+ use?: import("better-call").Middleware[];
2821
+ path?: string;
2822
+ } & {
2823
+ asResponse?: AsResponse | undefined;
2824
+ returnHeaders?: ReturnHeaders_29 | undefined;
2825
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_29] extends [true] ? {
2826
+ headers: Headers;
2827
+ response: {
2828
+ accessToken: string;
2829
+ accessTokenExpiresAt: Date | undefined;
2830
+ scopes: string[];
2831
+ idToken: string | undefined;
2832
+ };
2833
+ } : {
2834
+ accessToken: string;
2835
+ accessTokenExpiresAt: Date | undefined;
2836
+ scopes: string[];
2837
+ idToken: string | undefined;
2838
+ }>;
2839
+ options: {
2840
+ method: "POST";
2841
+ body: import("better-auth").ZodObject<{
2842
+ providerId: import("better-auth").ZodString;
2843
+ accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2844
+ userId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2845
+ }, import("better-auth").$strip>;
2846
+ metadata: {
2847
+ openapi: {
2848
+ description: string;
2849
+ responses: {
2850
+ 200: {
2851
+ description: string;
2852
+ content: {
2853
+ "application/json": {
2854
+ schema: {
2855
+ type: "object";
2856
+ properties: {
2857
+ tokenType: {
2858
+ type: string;
2859
+ };
2860
+ idToken: {
2861
+ type: string;
2862
+ };
2863
+ accessToken: {
2864
+ type: string;
2865
+ };
2866
+ refreshToken: {
2867
+ type: string;
2868
+ };
2869
+ accessTokenExpiresAt: {
2870
+ type: string;
2871
+ format: string;
2872
+ };
2873
+ refreshTokenExpiresAt: {
2874
+ type: string;
2875
+ format: string;
2876
+ };
2877
+ };
2878
+ };
2879
+ };
2880
+ };
2881
+ };
2882
+ 400: {
2883
+ description: string;
2884
+ };
2885
+ };
2886
+ };
2887
+ };
2888
+ } & {
2889
+ use: any[];
2890
+ };
2891
+ path: "/get-access-token";
2892
+ };
2893
+ accountInfo: {
2894
+ <AsResponse extends boolean = false, ReturnHeaders_30 extends boolean = false>(inputCtx_0: {
2895
+ body: {
2896
+ accountId: string;
2897
+ };
2898
+ } & {
2899
+ method?: "POST" | undefined;
2900
+ } & {
2901
+ query?: Record<string, any> | undefined;
2902
+ } & {
2903
+ params?: Record<string, any>;
2904
+ } & {
2905
+ request?: Request;
2906
+ } & {
2907
+ headers?: HeadersInit;
2908
+ } & {
2909
+ asResponse?: boolean;
2910
+ returnHeaders?: boolean;
2911
+ use?: import("better-call").Middleware[];
2912
+ path?: string;
2913
+ } & {
2914
+ asResponse?: AsResponse | undefined;
2915
+ returnHeaders?: ReturnHeaders_30 | undefined;
2916
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders_30] extends [true] ? {
2917
+ headers: Headers;
2918
+ response: {
2919
+ user: import("better-auth").OAuth2UserInfo;
2920
+ data: Record<string, any>;
2921
+ } | null;
2922
+ } : {
2923
+ user: import("better-auth").OAuth2UserInfo;
2924
+ data: Record<string, any>;
2925
+ } | null>;
2926
+ options: {
2927
+ method: "POST";
2928
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
2929
+ session: {
2930
+ session: Record<string, any> & {
2931
+ id: string;
2932
+ createdAt: Date;
2933
+ updatedAt: Date;
2934
+ userId: string;
2935
+ expiresAt: Date;
2936
+ token: string;
2937
+ ipAddress?: string | null | undefined;
2938
+ userAgent?: string | null | undefined;
2939
+ };
2940
+ user: Record<string, any> & {
2941
+ id: string;
2942
+ createdAt: Date;
2943
+ updatedAt: Date;
2944
+ email: string;
2945
+ emailVerified: boolean;
2946
+ name: string;
2947
+ image?: string | null | undefined;
2948
+ };
2949
+ };
2950
+ }>)[];
2951
+ metadata: {
2952
+ openapi: {
2953
+ description: string;
2954
+ responses: {
2955
+ "200": {
2956
+ description: string;
2957
+ content: {
2958
+ "application/json": {
2959
+ schema: {
2960
+ type: "object";
2961
+ properties: {
2962
+ user: {
2963
+ type: string;
2964
+ properties: {
2965
+ id: {
2966
+ type: string;
2967
+ };
2968
+ name: {
2969
+ type: string;
2970
+ };
2971
+ email: {
2972
+ type: string;
2973
+ };
2974
+ image: {
2975
+ type: string;
2976
+ };
2977
+ emailVerified: {
2978
+ type: string;
2979
+ };
2980
+ };
2981
+ required: string[];
2982
+ };
2983
+ data: {
2984
+ type: string;
2985
+ properties: {};
2986
+ additionalProperties: boolean;
2987
+ };
2988
+ };
2989
+ required: string[];
2990
+ additionalProperties: boolean;
2991
+ };
2992
+ };
2993
+ };
2994
+ };
2995
+ };
2996
+ };
2997
+ };
2998
+ body: import("better-auth").ZodObject<{
2999
+ accountId: import("better-auth").ZodString;
3000
+ }, import("better-auth").$strip>;
3001
+ } & {
3002
+ use: any[];
3003
+ };
3004
+ path: "/account-info";
3005
+ };
3006
+ }>;
3007
+ options: import("better-auth").BetterAuthOptions;
3008
+ $context: Promise<import("better-auth").AuthContext>;
3009
+ $Infer: {
3010
+ Session: {
3011
+ session: {
3012
+ id: string;
3013
+ createdAt: Date;
3014
+ updatedAt: Date;
3015
+ userId: string;
3016
+ expiresAt: Date;
3017
+ token: string;
3018
+ ipAddress?: string | null | undefined;
3019
+ userAgent?: string | null | undefined;
3020
+ };
3021
+ user: {
3022
+ id: string;
3023
+ createdAt: Date;
3024
+ updatedAt: Date;
3025
+ email: string;
3026
+ emailVerified: boolean;
3027
+ name: string;
3028
+ image?: string | null | undefined;
3029
+ };
3030
+ };
3031
+ };
3032
+ $ERROR_CODES: {
3033
+ USER_NOT_FOUND: string;
3034
+ FAILED_TO_CREATE_USER: string;
3035
+ FAILED_TO_CREATE_SESSION: string;
3036
+ FAILED_TO_UPDATE_USER: string;
3037
+ FAILED_TO_GET_SESSION: string;
3038
+ INVALID_PASSWORD: string;
3039
+ INVALID_EMAIL: string;
3040
+ INVALID_EMAIL_OR_PASSWORD: string;
3041
+ SOCIAL_ACCOUNT_ALREADY_LINKED: string;
3042
+ PROVIDER_NOT_FOUND: string;
3043
+ INVALID_TOKEN: string;
3044
+ ID_TOKEN_NOT_SUPPORTED: string;
3045
+ FAILED_TO_GET_USER_INFO: string;
3046
+ USER_EMAIL_NOT_FOUND: string;
3047
+ EMAIL_NOT_VERIFIED: string;
3048
+ PASSWORD_TOO_SHORT: string;
3049
+ PASSWORD_TOO_LONG: string;
3050
+ USER_ALREADY_EXISTS: string;
3051
+ EMAIL_CAN_NOT_BE_UPDATED: string;
3052
+ CREDENTIAL_ACCOUNT_NOT_FOUND: string;
3053
+ SESSION_EXPIRED: string;
3054
+ FAILED_TO_UNLINK_LAST_ACCOUNT: string;
3055
+ ACCOUNT_NOT_FOUND: string;
3056
+ USER_ALREADY_HAS_PASSWORD: string;
3057
+ };
3058
+ };
9
3059
  export type EventFunction<T extends DefaultFunctionArgs> = FunctionReference<"mutation", "internal" | "public", T>;
10
3060
  export type GenericCtx<DataModel extends GenericDataModel = GenericDataModel> = GenericQueryCtx<DataModel> | GenericMutationCtx<DataModel> | GenericActionCtx<DataModel>;
11
3061
  export type AuthFunctions = {
@@ -19,7 +3069,7 @@ export type AuthFunctions = {
19
3069
  [key: string]: any;
20
3070
  }>;
21
3071
  };
22
- export declare const createApi: <DataModel extends GenericDataModel, Schema extends SchemaDefinition<any, any>>(schema: Schema, createAuth: (ctx: GenericCtx<DataModel>) => ReturnType<typeof betterAuth>) => {
3072
+ export declare const createApi: <DataModel extends GenericDataModel, Schema extends SchemaDefinition<any, any>>(schema: Schema, createAuth: CreateAuth<DataModel>) => {
23
3073
  create: import("convex/server").RegisteredMutation<"public", {
24
3074
  select?: string[] | undefined;
25
3075
  onCreateHandle?: string | undefined;
@@ -35,7 +3085,7 @@ export declare const createApi: <DataModel extends GenericDataModel, Schema exte
35
3085
  findOne: import("convex/server").RegisteredQuery<"public", {
36
3086
  select?: string[] | undefined;
37
3087
  where?: {
38
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3088
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
39
3089
  connector?: "AND" | "OR" | undefined;
40
3090
  value: string | number | boolean | string[] | number[] | null;
41
3091
  field: string;
@@ -44,7 +3094,7 @@ export declare const createApi: <DataModel extends GenericDataModel, Schema exte
44
3094
  }, Promise<import("convex/server").GenericDocument | null>>;
45
3095
  findMany: import("convex/server").RegisteredQuery<"public", {
46
3096
  where?: {
47
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3097
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
48
3098
  connector?: "AND" | "OR" | undefined;
49
3099
  value: string | number | boolean | string[] | number[] | null;
50
3100
  field: string;
@@ -69,7 +3119,7 @@ export declare const createApi: <DataModel extends GenericDataModel, Schema exte
69
3119
  onUpdateHandle?: string | undefined;
70
3120
  input: {
71
3121
  where?: {
72
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3122
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
73
3123
  connector?: "AND" | "OR" | undefined;
74
3124
  value: string | number | boolean | string[] | number[] | null;
75
3125
  field: string;
@@ -86,7 +3136,7 @@ export declare const createApi: <DataModel extends GenericDataModel, Schema exte
86
3136
  onUpdateHandle?: string | undefined;
87
3137
  input: {
88
3138
  where?: {
89
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3139
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
90
3140
  connector?: "AND" | "OR" | undefined;
91
3141
  value: string | number | boolean | string[] | number[] | null;
92
3142
  field: string;
@@ -118,7 +3168,7 @@ export declare const createApi: <DataModel extends GenericDataModel, Schema exte
118
3168
  onDeleteHandle?: string | undefined;
119
3169
  input: {
120
3170
  where?: {
121
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3171
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
122
3172
  connector?: "AND" | "OR" | undefined;
123
3173
  value: string | number | boolean | string[] | number[] | null;
124
3174
  field: string;
@@ -130,7 +3180,7 @@ export declare const createApi: <DataModel extends GenericDataModel, Schema exte
130
3180
  onDeleteHandle?: string | undefined;
131
3181
  input: {
132
3182
  where?: {
133
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3183
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
134
3184
  connector?: "AND" | "OR" | undefined;
135
3185
  value: string | number | boolean | string[] | number[] | null;
136
3186
  field: string;
@@ -198,7 +3248,7 @@ export declare const createClient: <DataModel extends GenericDataModel, Schema e
198
3248
  findOne: FunctionReference<"query", "internal", {
199
3249
  select?: string[] | undefined;
200
3250
  where?: {
201
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3251
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
202
3252
  connector?: "AND" | "OR" | undefined;
203
3253
  value: string | number | boolean | string[] | number[] | null;
204
3254
  field: string;
@@ -233,7 +3283,7 @@ export declare const createClient: <DataModel extends GenericDataModel, Schema e
233
3283
  } | null, string | undefined>;
234
3284
  findMany: FunctionReference<"query", "internal", {
235
3285
  where?: {
236
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3286
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
237
3287
  connector?: "AND" | "OR" | undefined;
238
3288
  value: string | number | boolean | string[] | number[] | null;
239
3289
  field: string;
@@ -288,7 +3338,7 @@ export declare const createClient: <DataModel extends GenericDataModel, Schema e
288
3338
  onUpdateHandle?: string | undefined;
289
3339
  input: {
290
3340
  where?: {
291
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3341
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
292
3342
  connector?: "AND" | "OR" | undefined;
293
3343
  value: string | number | boolean | string[] | number[] | null;
294
3344
  field: string;
@@ -305,7 +3355,7 @@ export declare const createClient: <DataModel extends GenericDataModel, Schema e
305
3355
  onUpdateHandle?: string | undefined;
306
3356
  input: {
307
3357
  where?: {
308
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3358
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
309
3359
  connector?: "AND" | "OR" | undefined;
310
3360
  value: string | number | boolean | string[] | number[] | null;
311
3361
  field: string;
@@ -359,7 +3409,7 @@ export declare const createClient: <DataModel extends GenericDataModel, Schema e
359
3409
  onDeleteHandle?: string | undefined;
360
3410
  input: {
361
3411
  where?: {
362
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3412
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
363
3413
  connector?: "AND" | "OR" | undefined;
364
3414
  value: string | number | boolean | string[] | number[] | null;
365
3415
  field: string;
@@ -397,7 +3447,7 @@ export declare const createClient: <DataModel extends GenericDataModel, Schema e
397
3447
  onDeleteHandle?: string | undefined;
398
3448
  input: {
399
3449
  where?: {
400
- operator?: "in" | "lt" | "lte" | "gt" | "gte" | "eq" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
3450
+ operator?: "lt" | "lte" | "gt" | "gte" | "eq" | "in" | "ne" | "contains" | "starts_with" | "ends_with" | undefined;
401
3451
  connector?: "AND" | "OR" | undefined;
402
3452
  value: string | number | boolean | string[] | number[] | null;
403
3453
  field: string;
@@ -458,8 +3508,8 @@ export declare const createClient: <DataModel extends GenericDataModel, Schema e
458
3508
  getHeaders: (ctx: RunQueryCtx & {
459
3509
  auth: ConvexAuth;
460
3510
  }) => Promise<Headers>;
461
- safeGetAuthUser: (ctx: GenericQueryCtx<DataModel>) => Promise<DataModelFromSchemaDefinition<Schema>["user"]["document"] | undefined>;
462
- getAuthUser: (ctx: GenericQueryCtx<DataModel>) => Promise<DataModelFromSchemaDefinition<Schema>["user"]["document"]>;
3511
+ safeGetAuthUser: (ctx: GenericCtx<DataModel>) => Promise<DataModelFromSchemaDefinition<Schema>["user"]["document"] | undefined>;
3512
+ getAuthUser: (ctx: GenericCtx<DataModel>) => Promise<DataModelFromSchemaDefinition<Schema>["user"]["document"]>;
463
3513
  setUserId: (ctx: GenericMutationCtx<DataModel>, authId: string, userId: string) => Promise<void>;
464
3514
  triggersApi: () => {
465
3515
  onCreate: import("convex/server").RegisteredMutation<"internal", {
@@ -476,7 +3526,7 @@ export declare const createClient: <DataModel extends GenericDataModel, Schema e
476
3526
  doc: any;
477
3527
  }, Promise<void>>;
478
3528
  };
479
- registerRoutes: (http: HttpRouter, createAuth: (ctx: GenericCtx<DataModel>) => ReturnType<typeof betterAuth>, opts?: {
3529
+ registerRoutes: (http: HttpRouter, createAuth: CreateAuth<DataModel>, opts?: {
480
3530
  cors?: boolean | {
481
3531
  allowedOrigins?: string[];
482
3532
  allowedHeaders?: string[];