@rolder/kit 3.0.0-alpha.101 → 3.0.0-alpha.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,2411 @@
1
- import type { BetterAuthOptions, BetterAuthPlugin } from 'better-auth';
2
- export declare const defaultAuthServerPlugins: BetterAuthPlugin[];
3
- export declare const defaultAuthServerConfig: BetterAuthOptions;
1
+ export declare const defaultAuthServerPlugins: ({
2
+ id: "username";
3
+ init(ctx: import("better-auth").AuthContext): {
4
+ options: {
5
+ databaseHooks: {
6
+ user: {
7
+ create: {
8
+ before(user: {
9
+ id: string;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ email: string;
13
+ emailVerified: boolean;
14
+ name: string;
15
+ image?: string | null | undefined;
16
+ } & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
17
+ data: {
18
+ displayUsername?: string | undefined;
19
+ username?: string | undefined;
20
+ id: string;
21
+ createdAt: Date;
22
+ updatedAt: Date;
23
+ email: string;
24
+ emailVerified: boolean;
25
+ name: string;
26
+ image?: string | null | undefined;
27
+ };
28
+ }>;
29
+ };
30
+ update: {
31
+ before(user: Partial<{
32
+ id: string;
33
+ createdAt: Date;
34
+ updatedAt: Date;
35
+ email: string;
36
+ emailVerified: boolean;
37
+ name: string;
38
+ image?: string | null | undefined;
39
+ }> & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
40
+ data: {
41
+ displayUsername?: string | undefined;
42
+ username?: string | undefined;
43
+ id?: string | undefined;
44
+ createdAt?: Date | undefined;
45
+ updatedAt?: Date | undefined;
46
+ email?: string | undefined;
47
+ emailVerified?: boolean | undefined;
48
+ name?: string | undefined;
49
+ image?: string | null | undefined;
50
+ };
51
+ }>;
52
+ };
53
+ };
54
+ };
55
+ };
56
+ };
57
+ endpoints: {
58
+ signInUsername: import("better-auth").StrictEndpoint<"/sign-in/username", {
59
+ method: "POST";
60
+ body: import("zod").ZodObject<{
61
+ username: import("zod").ZodString;
62
+ password: import("zod").ZodString;
63
+ rememberMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
64
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
65
+ }, import("better-auth").$strip>;
66
+ metadata: {
67
+ openapi: {
68
+ summary: string;
69
+ description: string;
70
+ responses: {
71
+ 200: {
72
+ description: string;
73
+ content: {
74
+ "application/json": {
75
+ schema: {
76
+ type: "object";
77
+ properties: {
78
+ token: {
79
+ type: string;
80
+ description: string;
81
+ };
82
+ user: {
83
+ $ref: string;
84
+ };
85
+ };
86
+ required: string[];
87
+ };
88
+ };
89
+ };
90
+ };
91
+ 422: {
92
+ description: string;
93
+ content: {
94
+ "application/json": {
95
+ schema: {
96
+ type: "object";
97
+ properties: {
98
+ message: {
99
+ type: string;
100
+ };
101
+ };
102
+ };
103
+ };
104
+ };
105
+ };
106
+ };
107
+ };
108
+ };
109
+ }, {
110
+ token: string;
111
+ user: {
112
+ id: string;
113
+ createdAt: Date;
114
+ updatedAt: Date;
115
+ email: string;
116
+ emailVerified: boolean;
117
+ name: string;
118
+ image?: string | null | undefined;
119
+ } & {
120
+ username: string;
121
+ displayUsername: string;
122
+ };
123
+ } | null>;
124
+ isUsernameAvailable: import("better-auth").StrictEndpoint<"/is-username-available", {
125
+ method: "POST";
126
+ body: import("zod").ZodObject<{
127
+ username: import("zod").ZodString;
128
+ }, import("better-auth").$strip>;
129
+ }, {
130
+ available: boolean;
131
+ }>;
132
+ };
133
+ schema: {
134
+ user: {
135
+ fields: {
136
+ username: {
137
+ type: "string";
138
+ required: false;
139
+ sortable: true;
140
+ unique: true;
141
+ returned: true;
142
+ transform: {
143
+ input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
144
+ };
145
+ };
146
+ displayUsername: {
147
+ type: "string";
148
+ required: false;
149
+ transform: {
150
+ input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
151
+ };
152
+ };
153
+ };
154
+ };
155
+ };
156
+ hooks: {
157
+ before: {
158
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
159
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
160
+ }[];
161
+ };
162
+ options: import("better-auth/plugins").UsernameOptions | undefined;
163
+ $ERROR_CODES: {
164
+ readonly INVALID_USERNAME_OR_PASSWORD: "Invalid username or password";
165
+ readonly EMAIL_NOT_VERIFIED: "Email not verified";
166
+ readonly UNEXPECTED_ERROR: "Unexpected error";
167
+ readonly USERNAME_IS_ALREADY_TAKEN: "Username is already taken. Please try another.";
168
+ readonly USERNAME_TOO_SHORT: "Username is too short";
169
+ readonly USERNAME_TOO_LONG: "Username is too long";
170
+ readonly INVALID_USERNAME: "Username is invalid";
171
+ readonly INVALID_DISPLAY_USERNAME: "Display username is invalid";
172
+ };
173
+ } | {
174
+ id: "admin";
175
+ init(): {
176
+ options: {
177
+ databaseHooks: {
178
+ user: {
179
+ create: {
180
+ before(user: {
181
+ id: string;
182
+ createdAt: Date;
183
+ updatedAt: Date;
184
+ email: string;
185
+ emailVerified: boolean;
186
+ name: string;
187
+ image?: string | null | undefined;
188
+ } & Record<string, unknown>): Promise<{
189
+ data: {
190
+ id: string;
191
+ createdAt: Date;
192
+ updatedAt: Date;
193
+ email: string;
194
+ emailVerified: boolean;
195
+ name: string;
196
+ image?: string | null | undefined;
197
+ role: string;
198
+ };
199
+ }>;
200
+ };
201
+ };
202
+ session: {
203
+ create: {
204
+ before(session: {
205
+ id: string;
206
+ createdAt: Date;
207
+ updatedAt: Date;
208
+ userId: string;
209
+ expiresAt: Date;
210
+ token: string;
211
+ ipAddress?: string | null | undefined;
212
+ userAgent?: string | null | undefined;
213
+ } & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | null): Promise<void>;
214
+ };
215
+ };
216
+ };
217
+ };
218
+ };
219
+ hooks: {
220
+ after: {
221
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
222
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
223
+ }[];
224
+ };
225
+ endpoints: {
226
+ setRole: import("better-auth").StrictEndpoint<"/admin/set-role", {
227
+ method: "POST";
228
+ body: import("zod").ZodObject<{
229
+ userId: import("zod").ZodCoercedString<unknown>;
230
+ role: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
231
+ }, import("better-auth").$strip>;
232
+ requireHeaders: true;
233
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
234
+ session: {
235
+ user: import("better-auth/plugins").UserWithRole;
236
+ session: import("better-auth").Session;
237
+ };
238
+ }>)[];
239
+ metadata: {
240
+ openapi: {
241
+ operationId: string;
242
+ summary: string;
243
+ description: string;
244
+ responses: {
245
+ 200: {
246
+ description: string;
247
+ content: {
248
+ "application/json": {
249
+ schema: {
250
+ type: "object";
251
+ properties: {
252
+ user: {
253
+ $ref: string;
254
+ };
255
+ };
256
+ };
257
+ };
258
+ };
259
+ };
260
+ };
261
+ };
262
+ $Infer: {
263
+ body: {
264
+ userId: string;
265
+ role: "user" | "admin" | ("user" | "admin")[];
266
+ };
267
+ };
268
+ };
269
+ }, {
270
+ user: import("better-auth/plugins").UserWithRole;
271
+ }>;
272
+ getUser: import("better-auth").StrictEndpoint<"/admin/get-user", {
273
+ method: "GET";
274
+ query: import("zod").ZodObject<{
275
+ id: import("zod").ZodString;
276
+ }, import("better-auth").$strip>;
277
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
278
+ session: {
279
+ user: import("better-auth/plugins").UserWithRole;
280
+ session: import("better-auth").Session;
281
+ };
282
+ }>)[];
283
+ metadata: {
284
+ openapi: {
285
+ operationId: string;
286
+ summary: string;
287
+ description: string;
288
+ responses: {
289
+ 200: {
290
+ description: string;
291
+ content: {
292
+ "application/json": {
293
+ schema: {
294
+ type: "object";
295
+ properties: {
296
+ user: {
297
+ $ref: string;
298
+ };
299
+ };
300
+ };
301
+ };
302
+ };
303
+ };
304
+ };
305
+ };
306
+ };
307
+ }, import("better-auth/plugins").UserWithRole>;
308
+ createUser: import("better-auth").StrictEndpoint<"/admin/create-user", {
309
+ method: "POST";
310
+ body: import("zod").ZodObject<{
311
+ email: import("zod").ZodString;
312
+ password: import("zod").ZodOptional<import("zod").ZodString>;
313
+ name: import("zod").ZodString;
314
+ role: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>;
315
+ data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
316
+ }, import("better-auth").$strip>;
317
+ metadata: {
318
+ openapi: {
319
+ operationId: string;
320
+ summary: string;
321
+ description: string;
322
+ responses: {
323
+ 200: {
324
+ description: string;
325
+ content: {
326
+ "application/json": {
327
+ schema: {
328
+ type: "object";
329
+ properties: {
330
+ user: {
331
+ $ref: string;
332
+ };
333
+ };
334
+ };
335
+ };
336
+ };
337
+ };
338
+ };
339
+ };
340
+ $Infer: {
341
+ body: {
342
+ email: string;
343
+ password?: string | undefined;
344
+ name: string;
345
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
346
+ data?: Record<string, any> | undefined;
347
+ };
348
+ };
349
+ };
350
+ }, {
351
+ user: import("better-auth/plugins").UserWithRole;
352
+ }>;
353
+ adminUpdateUser: import("better-auth").StrictEndpoint<"/admin/update-user", {
354
+ method: "POST";
355
+ body: import("zod").ZodObject<{
356
+ userId: import("zod").ZodCoercedString<unknown>;
357
+ data: import("zod").ZodRecord<import("zod").ZodAny, import("zod").ZodAny>;
358
+ }, import("better-auth").$strip>;
359
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
360
+ session: {
361
+ user: import("better-auth/plugins").UserWithRole;
362
+ session: import("better-auth").Session;
363
+ };
364
+ }>)[];
365
+ metadata: {
366
+ openapi: {
367
+ operationId: string;
368
+ summary: string;
369
+ description: string;
370
+ responses: {
371
+ 200: {
372
+ description: string;
373
+ content: {
374
+ "application/json": {
375
+ schema: {
376
+ type: "object";
377
+ properties: {
378
+ user: {
379
+ $ref: string;
380
+ };
381
+ };
382
+ };
383
+ };
384
+ };
385
+ };
386
+ };
387
+ };
388
+ };
389
+ }, import("better-auth/plugins").UserWithRole>;
390
+ listUsers: import("better-auth").StrictEndpoint<"/admin/list-users", {
391
+ method: "GET";
392
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
393
+ session: {
394
+ user: import("better-auth/plugins").UserWithRole;
395
+ session: import("better-auth").Session;
396
+ };
397
+ }>)[];
398
+ query: import("zod").ZodObject<{
399
+ searchValue: import("zod").ZodOptional<import("zod").ZodString>;
400
+ searchField: import("zod").ZodOptional<import("zod").ZodEnum<{
401
+ name: "name";
402
+ email: "email";
403
+ }>>;
404
+ searchOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
405
+ contains: "contains";
406
+ starts_with: "starts_with";
407
+ ends_with: "ends_with";
408
+ }>>;
409
+ limit: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
410
+ offset: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
411
+ sortBy: import("zod").ZodOptional<import("zod").ZodString>;
412
+ sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
413
+ asc: "asc";
414
+ desc: "desc";
415
+ }>>;
416
+ filterField: import("zod").ZodOptional<import("zod").ZodString>;
417
+ filterValue: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, import("zod").ZodBoolean]>>;
418
+ filterOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
419
+ eq: "eq";
420
+ ne: "ne";
421
+ lt: "lt";
422
+ lte: "lte";
423
+ gt: "gt";
424
+ gte: "gte";
425
+ contains: "contains";
426
+ }>>;
427
+ }, import("better-auth").$strip>;
428
+ metadata: {
429
+ openapi: {
430
+ operationId: string;
431
+ summary: string;
432
+ description: string;
433
+ responses: {
434
+ 200: {
435
+ description: string;
436
+ content: {
437
+ "application/json": {
438
+ schema: {
439
+ type: "object";
440
+ properties: {
441
+ users: {
442
+ type: string;
443
+ items: {
444
+ $ref: string;
445
+ };
446
+ };
447
+ total: {
448
+ type: string;
449
+ };
450
+ limit: {
451
+ type: string;
452
+ };
453
+ offset: {
454
+ type: string;
455
+ };
456
+ };
457
+ required: string[];
458
+ };
459
+ };
460
+ };
461
+ };
462
+ };
463
+ };
464
+ };
465
+ }, {
466
+ users: import("better-auth/plugins").UserWithRole[];
467
+ total: number;
468
+ limit: number | undefined;
469
+ offset: number | undefined;
470
+ } | {
471
+ users: never[];
472
+ total: number;
473
+ }>;
474
+ listUserSessions: import("better-auth").StrictEndpoint<"/admin/list-user-sessions", {
475
+ method: "POST";
476
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
477
+ session: {
478
+ user: import("better-auth/plugins").UserWithRole;
479
+ session: import("better-auth").Session;
480
+ };
481
+ }>)[];
482
+ body: import("zod").ZodObject<{
483
+ userId: import("zod").ZodCoercedString<unknown>;
484
+ }, import("better-auth").$strip>;
485
+ metadata: {
486
+ openapi: {
487
+ operationId: string;
488
+ summary: string;
489
+ description: string;
490
+ responses: {
491
+ 200: {
492
+ description: string;
493
+ content: {
494
+ "application/json": {
495
+ schema: {
496
+ type: "object";
497
+ properties: {
498
+ sessions: {
499
+ type: string;
500
+ items: {
501
+ $ref: string;
502
+ };
503
+ };
504
+ };
505
+ };
506
+ };
507
+ };
508
+ };
509
+ };
510
+ };
511
+ };
512
+ }, {
513
+ sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
514
+ }>;
515
+ unbanUser: import("better-auth").StrictEndpoint<"/admin/unban-user", {
516
+ method: "POST";
517
+ body: import("zod").ZodObject<{
518
+ userId: import("zod").ZodCoercedString<unknown>;
519
+ }, import("better-auth").$strip>;
520
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
521
+ session: {
522
+ user: import("better-auth/plugins").UserWithRole;
523
+ session: import("better-auth").Session;
524
+ };
525
+ }>)[];
526
+ metadata: {
527
+ openapi: {
528
+ operationId: string;
529
+ summary: string;
530
+ description: string;
531
+ responses: {
532
+ 200: {
533
+ description: string;
534
+ content: {
535
+ "application/json": {
536
+ schema: {
537
+ type: "object";
538
+ properties: {
539
+ user: {
540
+ $ref: string;
541
+ };
542
+ };
543
+ };
544
+ };
545
+ };
546
+ };
547
+ };
548
+ };
549
+ };
550
+ }, {
551
+ user: import("better-auth/plugins").UserWithRole;
552
+ }>;
553
+ banUser: import("better-auth").StrictEndpoint<"/admin/ban-user", {
554
+ method: "POST";
555
+ body: import("zod").ZodObject<{
556
+ userId: import("zod").ZodCoercedString<unknown>;
557
+ banReason: import("zod").ZodOptional<import("zod").ZodString>;
558
+ banExpiresIn: import("zod").ZodOptional<import("zod").ZodNumber>;
559
+ }, import("better-auth").$strip>;
560
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
561
+ session: {
562
+ user: import("better-auth/plugins").UserWithRole;
563
+ session: import("better-auth").Session;
564
+ };
565
+ }>)[];
566
+ metadata: {
567
+ openapi: {
568
+ operationId: string;
569
+ summary: string;
570
+ description: string;
571
+ responses: {
572
+ 200: {
573
+ description: string;
574
+ content: {
575
+ "application/json": {
576
+ schema: {
577
+ type: "object";
578
+ properties: {
579
+ user: {
580
+ $ref: string;
581
+ };
582
+ };
583
+ };
584
+ };
585
+ };
586
+ };
587
+ };
588
+ };
589
+ };
590
+ }, {
591
+ user: import("better-auth/plugins").UserWithRole;
592
+ }>;
593
+ impersonateUser: import("better-auth").StrictEndpoint<"/admin/impersonate-user", {
594
+ method: "POST";
595
+ body: import("zod").ZodObject<{
596
+ userId: import("zod").ZodCoercedString<unknown>;
597
+ }, import("better-auth").$strip>;
598
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
599
+ session: {
600
+ user: import("better-auth/plugins").UserWithRole;
601
+ session: import("better-auth").Session;
602
+ };
603
+ }>)[];
604
+ metadata: {
605
+ openapi: {
606
+ operationId: string;
607
+ summary: string;
608
+ description: string;
609
+ responses: {
610
+ 200: {
611
+ description: string;
612
+ content: {
613
+ "application/json": {
614
+ schema: {
615
+ type: "object";
616
+ properties: {
617
+ session: {
618
+ $ref: string;
619
+ };
620
+ user: {
621
+ $ref: string;
622
+ };
623
+ };
624
+ };
625
+ };
626
+ };
627
+ };
628
+ };
629
+ };
630
+ };
631
+ }, {
632
+ session: {
633
+ id: string;
634
+ createdAt: Date;
635
+ updatedAt: Date;
636
+ userId: string;
637
+ expiresAt: Date;
638
+ token: string;
639
+ ipAddress?: string | null | undefined;
640
+ userAgent?: string | null | undefined;
641
+ };
642
+ user: import("better-auth/plugins").UserWithRole;
643
+ }>;
644
+ stopImpersonating: import("better-auth").StrictEndpoint<"/admin/stop-impersonating", {
645
+ method: "POST";
646
+ requireHeaders: true;
647
+ }, {
648
+ session: {
649
+ id: string;
650
+ createdAt: Date;
651
+ updatedAt: Date;
652
+ userId: string;
653
+ expiresAt: Date;
654
+ token: string;
655
+ ipAddress?: string | null | undefined;
656
+ userAgent?: string | null | undefined;
657
+ } & Record<string, any>;
658
+ user: {
659
+ id: string;
660
+ createdAt: Date;
661
+ updatedAt: Date;
662
+ email: string;
663
+ emailVerified: boolean;
664
+ name: string;
665
+ image?: string | null | undefined;
666
+ } & Record<string, any>;
667
+ }>;
668
+ revokeUserSession: import("better-auth").StrictEndpoint<"/admin/revoke-user-session", {
669
+ method: "POST";
670
+ body: import("zod").ZodObject<{
671
+ sessionToken: import("zod").ZodString;
672
+ }, import("better-auth").$strip>;
673
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
674
+ session: {
675
+ user: import("better-auth/plugins").UserWithRole;
676
+ session: import("better-auth").Session;
677
+ };
678
+ }>)[];
679
+ metadata: {
680
+ openapi: {
681
+ operationId: string;
682
+ summary: string;
683
+ description: string;
684
+ responses: {
685
+ 200: {
686
+ description: string;
687
+ content: {
688
+ "application/json": {
689
+ schema: {
690
+ type: "object";
691
+ properties: {
692
+ success: {
693
+ type: string;
694
+ };
695
+ };
696
+ };
697
+ };
698
+ };
699
+ };
700
+ };
701
+ };
702
+ };
703
+ }, {
704
+ success: boolean;
705
+ }>;
706
+ revokeUserSessions: import("better-auth").StrictEndpoint<"/admin/revoke-user-sessions", {
707
+ method: "POST";
708
+ body: import("zod").ZodObject<{
709
+ userId: import("zod").ZodCoercedString<unknown>;
710
+ }, import("better-auth").$strip>;
711
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
712
+ session: {
713
+ user: import("better-auth/plugins").UserWithRole;
714
+ session: import("better-auth").Session;
715
+ };
716
+ }>)[];
717
+ metadata: {
718
+ openapi: {
719
+ operationId: string;
720
+ summary: string;
721
+ description: string;
722
+ responses: {
723
+ 200: {
724
+ description: string;
725
+ content: {
726
+ "application/json": {
727
+ schema: {
728
+ type: "object";
729
+ properties: {
730
+ success: {
731
+ type: string;
732
+ };
733
+ };
734
+ };
735
+ };
736
+ };
737
+ };
738
+ };
739
+ };
740
+ };
741
+ }, {
742
+ success: boolean;
743
+ }>;
744
+ removeUser: import("better-auth").StrictEndpoint<"/admin/remove-user", {
745
+ method: "POST";
746
+ body: import("zod").ZodObject<{
747
+ userId: import("zod").ZodCoercedString<unknown>;
748
+ }, import("better-auth").$strip>;
749
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
750
+ session: {
751
+ user: import("better-auth/plugins").UserWithRole;
752
+ session: import("better-auth").Session;
753
+ };
754
+ }>)[];
755
+ metadata: {
756
+ openapi: {
757
+ operationId: string;
758
+ summary: string;
759
+ description: string;
760
+ responses: {
761
+ 200: {
762
+ description: string;
763
+ content: {
764
+ "application/json": {
765
+ schema: {
766
+ type: "object";
767
+ properties: {
768
+ success: {
769
+ type: string;
770
+ };
771
+ };
772
+ };
773
+ };
774
+ };
775
+ };
776
+ };
777
+ };
778
+ };
779
+ }, {
780
+ success: boolean;
781
+ }>;
782
+ setUserPassword: import("better-auth").StrictEndpoint<"/admin/set-user-password", {
783
+ method: "POST";
784
+ body: import("zod").ZodObject<{
785
+ newPassword: import("zod").ZodString;
786
+ userId: import("zod").ZodCoercedString<unknown>;
787
+ }, import("better-auth").$strip>;
788
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
789
+ session: {
790
+ user: import("better-auth/plugins").UserWithRole;
791
+ session: import("better-auth").Session;
792
+ };
793
+ }>)[];
794
+ metadata: {
795
+ openapi: {
796
+ operationId: string;
797
+ summary: string;
798
+ description: string;
799
+ responses: {
800
+ 200: {
801
+ description: string;
802
+ content: {
803
+ "application/json": {
804
+ schema: {
805
+ type: "object";
806
+ properties: {
807
+ status: {
808
+ type: string;
809
+ };
810
+ };
811
+ };
812
+ };
813
+ };
814
+ };
815
+ };
816
+ };
817
+ };
818
+ }, {
819
+ status: boolean;
820
+ }>;
821
+ userHasPermission: import("better-auth").StrictEndpoint<"/admin/has-permission", {
822
+ method: "POST";
823
+ body: import("zod").ZodIntersection<import("zod").ZodObject<{
824
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
825
+ role: import("zod").ZodOptional<import("zod").ZodString>;
826
+ }, import("better-auth").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
827
+ permission: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
828
+ permissions: import("zod").ZodUndefined;
829
+ }, import("better-auth").$strip>, import("zod").ZodObject<{
830
+ permission: import("zod").ZodUndefined;
831
+ permissions: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
832
+ }, import("better-auth").$strip>]>>;
833
+ metadata: {
834
+ openapi: {
835
+ description: string;
836
+ requestBody: {
837
+ content: {
838
+ "application/json": {
839
+ schema: {
840
+ type: "object";
841
+ properties: {
842
+ permission: {
843
+ type: string;
844
+ description: string;
845
+ deprecated: boolean;
846
+ };
847
+ permissions: {
848
+ type: string;
849
+ description: string;
850
+ };
851
+ };
852
+ required: string[];
853
+ };
854
+ };
855
+ };
856
+ };
857
+ responses: {
858
+ "200": {
859
+ description: string;
860
+ content: {
861
+ "application/json": {
862
+ schema: {
863
+ type: "object";
864
+ properties: {
865
+ error: {
866
+ type: string;
867
+ };
868
+ success: {
869
+ type: string;
870
+ };
871
+ };
872
+ required: string[];
873
+ };
874
+ };
875
+ };
876
+ };
877
+ };
878
+ };
879
+ $Infer: {
880
+ body: ({
881
+ permission: {
882
+ readonly user?: ("list" | "create" | "update" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get")[] | undefined;
883
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
884
+ };
885
+ permissions?: never | undefined;
886
+ } | {
887
+ permissions: {
888
+ readonly user?: ("list" | "create" | "update" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get")[] | undefined;
889
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
890
+ };
891
+ permission?: never | undefined;
892
+ }) & {
893
+ userId?: string | undefined;
894
+ role?: "user" | "admin" | undefined;
895
+ };
896
+ };
897
+ };
898
+ }, {
899
+ error: null;
900
+ success: boolean;
901
+ }>;
902
+ };
903
+ $ERROR_CODES: {
904
+ readonly FAILED_TO_CREATE_USER: "Failed to create user";
905
+ readonly USER_ALREADY_EXISTS: "User already exists.";
906
+ readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
907
+ readonly YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself";
908
+ readonly YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role";
909
+ readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users";
910
+ readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users";
911
+ readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions";
912
+ readonly YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users";
913
+ readonly YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users";
914
+ readonly YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions";
915
+ readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users";
916
+ readonly YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password";
917
+ readonly BANNED_USER: "You have been banned from this application";
918
+ readonly YOU_ARE_NOT_ALLOWED_TO_GET_USER: "You are not allowed to get user";
919
+ readonly NO_DATA_TO_UPDATE: "No data to update";
920
+ readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
921
+ readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
922
+ readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
923
+ readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
924
+ readonly INVALID_ROLE_TYPE: "Invalid role type";
925
+ };
926
+ schema: {
927
+ user: {
928
+ fields: {
929
+ role: {
930
+ type: "string";
931
+ required: false;
932
+ input: false;
933
+ };
934
+ banned: {
935
+ type: "boolean";
936
+ defaultValue: false;
937
+ required: false;
938
+ input: false;
939
+ };
940
+ banReason: {
941
+ type: "string";
942
+ required: false;
943
+ input: false;
944
+ };
945
+ banExpires: {
946
+ type: "date";
947
+ required: false;
948
+ input: false;
949
+ };
950
+ };
951
+ };
952
+ session: {
953
+ fields: {
954
+ impersonatedBy: {
955
+ type: "string";
956
+ required: false;
957
+ };
958
+ };
959
+ };
960
+ };
961
+ options: NoInfer<{
962
+ bannedUserMessage: string;
963
+ }>;
964
+ } | {
965
+ id: "jwt";
966
+ options: NoInfer<{
967
+ jwks: {
968
+ keyPairConfig: {
969
+ alg: "EdDSA";
970
+ crv: "Ed25519";
971
+ };
972
+ };
973
+ jwt: {
974
+ issuer: string;
975
+ audience: string;
976
+ expirationTime: string;
977
+ definePayload: ({ user, session }: {
978
+ user: import("better-auth").User & Record<string, any>;
979
+ session: import("better-auth").Session & Record<string, any>;
980
+ }) => {
981
+ id: string;
982
+ ns: string;
983
+ db: string;
984
+ ac: string;
985
+ email: string;
986
+ name: string;
987
+ role: string;
988
+ sessionId: string;
989
+ };
990
+ };
991
+ }>;
992
+ endpoints: {
993
+ getJwks: import("better-auth").StrictEndpoint<string, {
994
+ method: "GET";
995
+ metadata: {
996
+ openapi: {
997
+ operationId: string;
998
+ description: string;
999
+ responses: {
1000
+ "200": {
1001
+ description: string;
1002
+ content: {
1003
+ "application/json": {
1004
+ schema: {
1005
+ type: "object";
1006
+ properties: {
1007
+ keys: {
1008
+ type: string;
1009
+ description: string;
1010
+ items: {
1011
+ type: string;
1012
+ properties: {
1013
+ kid: {
1014
+ type: string;
1015
+ description: string;
1016
+ };
1017
+ kty: {
1018
+ type: string;
1019
+ description: string;
1020
+ };
1021
+ alg: {
1022
+ type: string;
1023
+ description: string;
1024
+ };
1025
+ use: {
1026
+ type: string;
1027
+ description: string;
1028
+ enum: string[];
1029
+ nullable: boolean;
1030
+ };
1031
+ n: {
1032
+ type: string;
1033
+ description: string;
1034
+ nullable: boolean;
1035
+ };
1036
+ e: {
1037
+ type: string;
1038
+ description: string;
1039
+ nullable: boolean;
1040
+ };
1041
+ crv: {
1042
+ type: string;
1043
+ description: string;
1044
+ nullable: boolean;
1045
+ };
1046
+ x: {
1047
+ type: string;
1048
+ description: string;
1049
+ nullable: boolean;
1050
+ };
1051
+ y: {
1052
+ type: string;
1053
+ description: string;
1054
+ nullable: boolean;
1055
+ };
1056
+ };
1057
+ required: string[];
1058
+ };
1059
+ };
1060
+ };
1061
+ required: string[];
1062
+ };
1063
+ };
1064
+ };
1065
+ };
1066
+ };
1067
+ };
1068
+ };
1069
+ }, import("better-auth").JSONWebKeySet>;
1070
+ getToken: import("better-auth").StrictEndpoint<"/token", {
1071
+ method: "GET";
1072
+ requireHeaders: true;
1073
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1074
+ session: {
1075
+ session: Record<string, any> & {
1076
+ id: string;
1077
+ createdAt: Date;
1078
+ updatedAt: Date;
1079
+ userId: string;
1080
+ expiresAt: Date;
1081
+ token: string;
1082
+ ipAddress?: string | null | undefined;
1083
+ userAgent?: string | null | undefined;
1084
+ };
1085
+ user: Record<string, any> & {
1086
+ id: string;
1087
+ createdAt: Date;
1088
+ updatedAt: Date;
1089
+ email: string;
1090
+ emailVerified: boolean;
1091
+ name: string;
1092
+ image?: string | null | undefined;
1093
+ };
1094
+ };
1095
+ }>)[];
1096
+ metadata: {
1097
+ openapi: {
1098
+ operationId: string;
1099
+ description: string;
1100
+ responses: {
1101
+ 200: {
1102
+ description: string;
1103
+ content: {
1104
+ "application/json": {
1105
+ schema: {
1106
+ type: "object";
1107
+ properties: {
1108
+ token: {
1109
+ type: string;
1110
+ };
1111
+ };
1112
+ };
1113
+ };
1114
+ };
1115
+ };
1116
+ };
1117
+ };
1118
+ };
1119
+ }, {
1120
+ token: string;
1121
+ }>;
1122
+ signJWT: import("better-auth").StrictEndpoint<string, {
1123
+ method: "POST";
1124
+ metadata: {
1125
+ $Infer: {
1126
+ body: {
1127
+ payload: import("better-auth").JWTPayload;
1128
+ overrideOptions?: import("better-auth/plugins").JwtOptions | undefined;
1129
+ };
1130
+ };
1131
+ };
1132
+ body: import("zod").ZodObject<{
1133
+ payload: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>;
1134
+ overrideOptions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1135
+ }, import("better-auth").$strip>;
1136
+ }, {
1137
+ token: string;
1138
+ }>;
1139
+ verifyJWT: import("better-auth").StrictEndpoint<string, {
1140
+ method: "POST";
1141
+ metadata: {
1142
+ $Infer: {
1143
+ body: {
1144
+ token: string;
1145
+ issuer?: string;
1146
+ };
1147
+ response: {
1148
+ payload: {
1149
+ sub: string;
1150
+ aud: string;
1151
+ [key: string]: any;
1152
+ } | null;
1153
+ };
1154
+ };
1155
+ };
1156
+ body: import("zod").ZodObject<{
1157
+ token: import("zod").ZodString;
1158
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
1159
+ }, import("better-auth").$strip>;
1160
+ }, {
1161
+ payload: (import("better-auth").JWTPayload & Required<Pick<import("better-auth").JWTPayload, "sub" | "aud">>) | null;
1162
+ }>;
1163
+ };
1164
+ hooks: {
1165
+ after: {
1166
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
1167
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
1168
+ }[];
1169
+ };
1170
+ schema: {
1171
+ jwks: {
1172
+ fields: {
1173
+ publicKey: {
1174
+ type: "string";
1175
+ required: true;
1176
+ };
1177
+ privateKey: {
1178
+ type: "string";
1179
+ required: true;
1180
+ };
1181
+ createdAt: {
1182
+ type: "date";
1183
+ required: true;
1184
+ };
1185
+ expiresAt: {
1186
+ type: "date";
1187
+ required: false;
1188
+ };
1189
+ };
1190
+ };
1191
+ };
1192
+ } | {
1193
+ id: "tanstack-start-cookies";
1194
+ hooks: {
1195
+ after: {
1196
+ matcher(ctx: import("better-auth").HookEndpointContext): true;
1197
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
1198
+ }[];
1199
+ };
1200
+ })[];
1201
+ export declare const defaultAuthServerConfig: {
1202
+ baseURL: string;
1203
+ secret: string | undefined;
1204
+ database: (options: Parameters<import("better-auth/adapters").AdapterFactory>[0]) => import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
1205
+ experimental: {
1206
+ joins: boolean;
1207
+ };
1208
+ emailAndPassword: {
1209
+ enabled: boolean;
1210
+ };
1211
+ plugins: ({
1212
+ id: "username";
1213
+ init(ctx: import("better-auth").AuthContext): {
1214
+ options: {
1215
+ databaseHooks: {
1216
+ user: {
1217
+ create: {
1218
+ before(user: {
1219
+ id: string;
1220
+ createdAt: Date;
1221
+ updatedAt: Date;
1222
+ email: string;
1223
+ emailVerified: boolean;
1224
+ name: string;
1225
+ image?: string | null | undefined;
1226
+ } & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
1227
+ data: {
1228
+ displayUsername?: string | undefined;
1229
+ username?: string | undefined;
1230
+ id: string;
1231
+ createdAt: Date;
1232
+ updatedAt: Date;
1233
+ email: string;
1234
+ emailVerified: boolean;
1235
+ name: string;
1236
+ image?: string | null | undefined;
1237
+ };
1238
+ }>;
1239
+ };
1240
+ update: {
1241
+ before(user: Partial<{
1242
+ id: string;
1243
+ createdAt: Date;
1244
+ updatedAt: Date;
1245
+ email: string;
1246
+ emailVerified: boolean;
1247
+ name: string;
1248
+ image?: string | null | undefined;
1249
+ }> & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
1250
+ data: {
1251
+ displayUsername?: string | undefined;
1252
+ username?: string | undefined;
1253
+ id?: string | undefined;
1254
+ createdAt?: Date | undefined;
1255
+ updatedAt?: Date | undefined;
1256
+ email?: string | undefined;
1257
+ emailVerified?: boolean | undefined;
1258
+ name?: string | undefined;
1259
+ image?: string | null | undefined;
1260
+ };
1261
+ }>;
1262
+ };
1263
+ };
1264
+ };
1265
+ };
1266
+ };
1267
+ endpoints: {
1268
+ signInUsername: import("better-auth").StrictEndpoint<"/sign-in/username", {
1269
+ method: "POST";
1270
+ body: import("zod").ZodObject<{
1271
+ username: import("zod").ZodString;
1272
+ password: import("zod").ZodString;
1273
+ rememberMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
1274
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
1275
+ }, import("better-auth").$strip>;
1276
+ metadata: {
1277
+ openapi: {
1278
+ summary: string;
1279
+ description: string;
1280
+ responses: {
1281
+ 200: {
1282
+ description: string;
1283
+ content: {
1284
+ "application/json": {
1285
+ schema: {
1286
+ type: "object";
1287
+ properties: {
1288
+ token: {
1289
+ type: string;
1290
+ description: string;
1291
+ };
1292
+ user: {
1293
+ $ref: string;
1294
+ };
1295
+ };
1296
+ required: string[];
1297
+ };
1298
+ };
1299
+ };
1300
+ };
1301
+ 422: {
1302
+ description: string;
1303
+ content: {
1304
+ "application/json": {
1305
+ schema: {
1306
+ type: "object";
1307
+ properties: {
1308
+ message: {
1309
+ type: string;
1310
+ };
1311
+ };
1312
+ };
1313
+ };
1314
+ };
1315
+ };
1316
+ };
1317
+ };
1318
+ };
1319
+ }, {
1320
+ token: string;
1321
+ user: {
1322
+ id: string;
1323
+ createdAt: Date;
1324
+ updatedAt: Date;
1325
+ email: string;
1326
+ emailVerified: boolean;
1327
+ name: string;
1328
+ image?: string | null | undefined;
1329
+ } & {
1330
+ username: string;
1331
+ displayUsername: string;
1332
+ };
1333
+ } | null>;
1334
+ isUsernameAvailable: import("better-auth").StrictEndpoint<"/is-username-available", {
1335
+ method: "POST";
1336
+ body: import("zod").ZodObject<{
1337
+ username: import("zod").ZodString;
1338
+ }, import("better-auth").$strip>;
1339
+ }, {
1340
+ available: boolean;
1341
+ }>;
1342
+ };
1343
+ schema: {
1344
+ user: {
1345
+ fields: {
1346
+ username: {
1347
+ type: "string";
1348
+ required: false;
1349
+ sortable: true;
1350
+ unique: true;
1351
+ returned: true;
1352
+ transform: {
1353
+ input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
1354
+ };
1355
+ };
1356
+ displayUsername: {
1357
+ type: "string";
1358
+ required: false;
1359
+ transform: {
1360
+ input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
1361
+ };
1362
+ };
1363
+ };
1364
+ };
1365
+ };
1366
+ hooks: {
1367
+ before: {
1368
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
1369
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
1370
+ }[];
1371
+ };
1372
+ options: import("better-auth/plugins").UsernameOptions | undefined;
1373
+ $ERROR_CODES: {
1374
+ readonly INVALID_USERNAME_OR_PASSWORD: "Invalid username or password";
1375
+ readonly EMAIL_NOT_VERIFIED: "Email not verified";
1376
+ readonly UNEXPECTED_ERROR: "Unexpected error";
1377
+ readonly USERNAME_IS_ALREADY_TAKEN: "Username is already taken. Please try another.";
1378
+ readonly USERNAME_TOO_SHORT: "Username is too short";
1379
+ readonly USERNAME_TOO_LONG: "Username is too long";
1380
+ readonly INVALID_USERNAME: "Username is invalid";
1381
+ readonly INVALID_DISPLAY_USERNAME: "Display username is invalid";
1382
+ };
1383
+ } | {
1384
+ id: "admin";
1385
+ init(): {
1386
+ options: {
1387
+ databaseHooks: {
1388
+ user: {
1389
+ create: {
1390
+ before(user: {
1391
+ id: string;
1392
+ createdAt: Date;
1393
+ updatedAt: Date;
1394
+ email: string;
1395
+ emailVerified: boolean;
1396
+ name: string;
1397
+ image?: string | null | undefined;
1398
+ } & Record<string, unknown>): Promise<{
1399
+ data: {
1400
+ id: string;
1401
+ createdAt: Date;
1402
+ updatedAt: Date;
1403
+ email: string;
1404
+ emailVerified: boolean;
1405
+ name: string;
1406
+ image?: string | null | undefined;
1407
+ role: string;
1408
+ };
1409
+ }>;
1410
+ };
1411
+ };
1412
+ session: {
1413
+ create: {
1414
+ before(session: {
1415
+ id: string;
1416
+ createdAt: Date;
1417
+ updatedAt: Date;
1418
+ userId: string;
1419
+ expiresAt: Date;
1420
+ token: string;
1421
+ ipAddress?: string | null | undefined;
1422
+ userAgent?: string | null | undefined;
1423
+ } & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | null): Promise<void>;
1424
+ };
1425
+ };
1426
+ };
1427
+ };
1428
+ };
1429
+ hooks: {
1430
+ after: {
1431
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
1432
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
1433
+ }[];
1434
+ };
1435
+ endpoints: {
1436
+ setRole: import("better-auth").StrictEndpoint<"/admin/set-role", {
1437
+ method: "POST";
1438
+ body: import("zod").ZodObject<{
1439
+ userId: import("zod").ZodCoercedString<unknown>;
1440
+ role: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
1441
+ }, import("better-auth").$strip>;
1442
+ requireHeaders: true;
1443
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1444
+ session: {
1445
+ user: import("better-auth/plugins").UserWithRole;
1446
+ session: import("better-auth").Session;
1447
+ };
1448
+ }>)[];
1449
+ metadata: {
1450
+ openapi: {
1451
+ operationId: string;
1452
+ summary: string;
1453
+ description: string;
1454
+ responses: {
1455
+ 200: {
1456
+ description: string;
1457
+ content: {
1458
+ "application/json": {
1459
+ schema: {
1460
+ type: "object";
1461
+ properties: {
1462
+ user: {
1463
+ $ref: string;
1464
+ };
1465
+ };
1466
+ };
1467
+ };
1468
+ };
1469
+ };
1470
+ };
1471
+ };
1472
+ $Infer: {
1473
+ body: {
1474
+ userId: string;
1475
+ role: "user" | "admin" | ("user" | "admin")[];
1476
+ };
1477
+ };
1478
+ };
1479
+ }, {
1480
+ user: import("better-auth/plugins").UserWithRole;
1481
+ }>;
1482
+ getUser: import("better-auth").StrictEndpoint<"/admin/get-user", {
1483
+ method: "GET";
1484
+ query: import("zod").ZodObject<{
1485
+ id: import("zod").ZodString;
1486
+ }, import("better-auth").$strip>;
1487
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1488
+ session: {
1489
+ user: import("better-auth/plugins").UserWithRole;
1490
+ session: import("better-auth").Session;
1491
+ };
1492
+ }>)[];
1493
+ metadata: {
1494
+ openapi: {
1495
+ operationId: string;
1496
+ summary: string;
1497
+ description: string;
1498
+ responses: {
1499
+ 200: {
1500
+ description: string;
1501
+ content: {
1502
+ "application/json": {
1503
+ schema: {
1504
+ type: "object";
1505
+ properties: {
1506
+ user: {
1507
+ $ref: string;
1508
+ };
1509
+ };
1510
+ };
1511
+ };
1512
+ };
1513
+ };
1514
+ };
1515
+ };
1516
+ };
1517
+ }, import("better-auth/plugins").UserWithRole>;
1518
+ createUser: import("better-auth").StrictEndpoint<"/admin/create-user", {
1519
+ method: "POST";
1520
+ body: import("zod").ZodObject<{
1521
+ email: import("zod").ZodString;
1522
+ password: import("zod").ZodOptional<import("zod").ZodString>;
1523
+ name: import("zod").ZodString;
1524
+ role: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>;
1525
+ data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1526
+ }, import("better-auth").$strip>;
1527
+ metadata: {
1528
+ openapi: {
1529
+ operationId: string;
1530
+ summary: string;
1531
+ description: string;
1532
+ responses: {
1533
+ 200: {
1534
+ description: string;
1535
+ content: {
1536
+ "application/json": {
1537
+ schema: {
1538
+ type: "object";
1539
+ properties: {
1540
+ user: {
1541
+ $ref: string;
1542
+ };
1543
+ };
1544
+ };
1545
+ };
1546
+ };
1547
+ };
1548
+ };
1549
+ };
1550
+ $Infer: {
1551
+ body: {
1552
+ email: string;
1553
+ password?: string | undefined;
1554
+ name: string;
1555
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
1556
+ data?: Record<string, any> | undefined;
1557
+ };
1558
+ };
1559
+ };
1560
+ }, {
1561
+ user: import("better-auth/plugins").UserWithRole;
1562
+ }>;
1563
+ adminUpdateUser: import("better-auth").StrictEndpoint<"/admin/update-user", {
1564
+ method: "POST";
1565
+ body: import("zod").ZodObject<{
1566
+ userId: import("zod").ZodCoercedString<unknown>;
1567
+ data: import("zod").ZodRecord<import("zod").ZodAny, import("zod").ZodAny>;
1568
+ }, import("better-auth").$strip>;
1569
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1570
+ session: {
1571
+ user: import("better-auth/plugins").UserWithRole;
1572
+ session: import("better-auth").Session;
1573
+ };
1574
+ }>)[];
1575
+ metadata: {
1576
+ openapi: {
1577
+ operationId: string;
1578
+ summary: string;
1579
+ description: string;
1580
+ responses: {
1581
+ 200: {
1582
+ description: string;
1583
+ content: {
1584
+ "application/json": {
1585
+ schema: {
1586
+ type: "object";
1587
+ properties: {
1588
+ user: {
1589
+ $ref: string;
1590
+ };
1591
+ };
1592
+ };
1593
+ };
1594
+ };
1595
+ };
1596
+ };
1597
+ };
1598
+ };
1599
+ }, import("better-auth/plugins").UserWithRole>;
1600
+ listUsers: import("better-auth").StrictEndpoint<"/admin/list-users", {
1601
+ method: "GET";
1602
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1603
+ session: {
1604
+ user: import("better-auth/plugins").UserWithRole;
1605
+ session: import("better-auth").Session;
1606
+ };
1607
+ }>)[];
1608
+ query: import("zod").ZodObject<{
1609
+ searchValue: import("zod").ZodOptional<import("zod").ZodString>;
1610
+ searchField: import("zod").ZodOptional<import("zod").ZodEnum<{
1611
+ name: "name";
1612
+ email: "email";
1613
+ }>>;
1614
+ searchOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
1615
+ contains: "contains";
1616
+ starts_with: "starts_with";
1617
+ ends_with: "ends_with";
1618
+ }>>;
1619
+ limit: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
1620
+ offset: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
1621
+ sortBy: import("zod").ZodOptional<import("zod").ZodString>;
1622
+ sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
1623
+ asc: "asc";
1624
+ desc: "desc";
1625
+ }>>;
1626
+ filterField: import("zod").ZodOptional<import("zod").ZodString>;
1627
+ filterValue: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, import("zod").ZodBoolean]>>;
1628
+ filterOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
1629
+ eq: "eq";
1630
+ ne: "ne";
1631
+ lt: "lt";
1632
+ lte: "lte";
1633
+ gt: "gt";
1634
+ gte: "gte";
1635
+ contains: "contains";
1636
+ }>>;
1637
+ }, import("better-auth").$strip>;
1638
+ metadata: {
1639
+ openapi: {
1640
+ operationId: string;
1641
+ summary: string;
1642
+ description: string;
1643
+ responses: {
1644
+ 200: {
1645
+ description: string;
1646
+ content: {
1647
+ "application/json": {
1648
+ schema: {
1649
+ type: "object";
1650
+ properties: {
1651
+ users: {
1652
+ type: string;
1653
+ items: {
1654
+ $ref: string;
1655
+ };
1656
+ };
1657
+ total: {
1658
+ type: string;
1659
+ };
1660
+ limit: {
1661
+ type: string;
1662
+ };
1663
+ offset: {
1664
+ type: string;
1665
+ };
1666
+ };
1667
+ required: string[];
1668
+ };
1669
+ };
1670
+ };
1671
+ };
1672
+ };
1673
+ };
1674
+ };
1675
+ }, {
1676
+ users: import("better-auth/plugins").UserWithRole[];
1677
+ total: number;
1678
+ limit: number | undefined;
1679
+ offset: number | undefined;
1680
+ } | {
1681
+ users: never[];
1682
+ total: number;
1683
+ }>;
1684
+ listUserSessions: import("better-auth").StrictEndpoint<"/admin/list-user-sessions", {
1685
+ method: "POST";
1686
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1687
+ session: {
1688
+ user: import("better-auth/plugins").UserWithRole;
1689
+ session: import("better-auth").Session;
1690
+ };
1691
+ }>)[];
1692
+ body: import("zod").ZodObject<{
1693
+ userId: import("zod").ZodCoercedString<unknown>;
1694
+ }, import("better-auth").$strip>;
1695
+ metadata: {
1696
+ openapi: {
1697
+ operationId: string;
1698
+ summary: string;
1699
+ description: string;
1700
+ responses: {
1701
+ 200: {
1702
+ description: string;
1703
+ content: {
1704
+ "application/json": {
1705
+ schema: {
1706
+ type: "object";
1707
+ properties: {
1708
+ sessions: {
1709
+ type: string;
1710
+ items: {
1711
+ $ref: string;
1712
+ };
1713
+ };
1714
+ };
1715
+ };
1716
+ };
1717
+ };
1718
+ };
1719
+ };
1720
+ };
1721
+ };
1722
+ }, {
1723
+ sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
1724
+ }>;
1725
+ unbanUser: import("better-auth").StrictEndpoint<"/admin/unban-user", {
1726
+ method: "POST";
1727
+ body: import("zod").ZodObject<{
1728
+ userId: import("zod").ZodCoercedString<unknown>;
1729
+ }, import("better-auth").$strip>;
1730
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1731
+ session: {
1732
+ user: import("better-auth/plugins").UserWithRole;
1733
+ session: import("better-auth").Session;
1734
+ };
1735
+ }>)[];
1736
+ metadata: {
1737
+ openapi: {
1738
+ operationId: string;
1739
+ summary: string;
1740
+ description: string;
1741
+ responses: {
1742
+ 200: {
1743
+ description: string;
1744
+ content: {
1745
+ "application/json": {
1746
+ schema: {
1747
+ type: "object";
1748
+ properties: {
1749
+ user: {
1750
+ $ref: string;
1751
+ };
1752
+ };
1753
+ };
1754
+ };
1755
+ };
1756
+ };
1757
+ };
1758
+ };
1759
+ };
1760
+ }, {
1761
+ user: import("better-auth/plugins").UserWithRole;
1762
+ }>;
1763
+ banUser: import("better-auth").StrictEndpoint<"/admin/ban-user", {
1764
+ method: "POST";
1765
+ body: import("zod").ZodObject<{
1766
+ userId: import("zod").ZodCoercedString<unknown>;
1767
+ banReason: import("zod").ZodOptional<import("zod").ZodString>;
1768
+ banExpiresIn: import("zod").ZodOptional<import("zod").ZodNumber>;
1769
+ }, import("better-auth").$strip>;
1770
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1771
+ session: {
1772
+ user: import("better-auth/plugins").UserWithRole;
1773
+ session: import("better-auth").Session;
1774
+ };
1775
+ }>)[];
1776
+ metadata: {
1777
+ openapi: {
1778
+ operationId: string;
1779
+ summary: string;
1780
+ description: string;
1781
+ responses: {
1782
+ 200: {
1783
+ description: string;
1784
+ content: {
1785
+ "application/json": {
1786
+ schema: {
1787
+ type: "object";
1788
+ properties: {
1789
+ user: {
1790
+ $ref: string;
1791
+ };
1792
+ };
1793
+ };
1794
+ };
1795
+ };
1796
+ };
1797
+ };
1798
+ };
1799
+ };
1800
+ }, {
1801
+ user: import("better-auth/plugins").UserWithRole;
1802
+ }>;
1803
+ impersonateUser: import("better-auth").StrictEndpoint<"/admin/impersonate-user", {
1804
+ method: "POST";
1805
+ body: import("zod").ZodObject<{
1806
+ userId: import("zod").ZodCoercedString<unknown>;
1807
+ }, import("better-auth").$strip>;
1808
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1809
+ session: {
1810
+ user: import("better-auth/plugins").UserWithRole;
1811
+ session: import("better-auth").Session;
1812
+ };
1813
+ }>)[];
1814
+ metadata: {
1815
+ openapi: {
1816
+ operationId: string;
1817
+ summary: string;
1818
+ description: string;
1819
+ responses: {
1820
+ 200: {
1821
+ description: string;
1822
+ content: {
1823
+ "application/json": {
1824
+ schema: {
1825
+ type: "object";
1826
+ properties: {
1827
+ session: {
1828
+ $ref: string;
1829
+ };
1830
+ user: {
1831
+ $ref: string;
1832
+ };
1833
+ };
1834
+ };
1835
+ };
1836
+ };
1837
+ };
1838
+ };
1839
+ };
1840
+ };
1841
+ }, {
1842
+ session: {
1843
+ id: string;
1844
+ createdAt: Date;
1845
+ updatedAt: Date;
1846
+ userId: string;
1847
+ expiresAt: Date;
1848
+ token: string;
1849
+ ipAddress?: string | null | undefined;
1850
+ userAgent?: string | null | undefined;
1851
+ };
1852
+ user: import("better-auth/plugins").UserWithRole;
1853
+ }>;
1854
+ stopImpersonating: import("better-auth").StrictEndpoint<"/admin/stop-impersonating", {
1855
+ method: "POST";
1856
+ requireHeaders: true;
1857
+ }, {
1858
+ session: {
1859
+ id: string;
1860
+ createdAt: Date;
1861
+ updatedAt: Date;
1862
+ userId: string;
1863
+ expiresAt: Date;
1864
+ token: string;
1865
+ ipAddress?: string | null | undefined;
1866
+ userAgent?: string | null | undefined;
1867
+ } & Record<string, any>;
1868
+ user: {
1869
+ id: string;
1870
+ createdAt: Date;
1871
+ updatedAt: Date;
1872
+ email: string;
1873
+ emailVerified: boolean;
1874
+ name: string;
1875
+ image?: string | null | undefined;
1876
+ } & Record<string, any>;
1877
+ }>;
1878
+ revokeUserSession: import("better-auth").StrictEndpoint<"/admin/revoke-user-session", {
1879
+ method: "POST";
1880
+ body: import("zod").ZodObject<{
1881
+ sessionToken: import("zod").ZodString;
1882
+ }, import("better-auth").$strip>;
1883
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1884
+ session: {
1885
+ user: import("better-auth/plugins").UserWithRole;
1886
+ session: import("better-auth").Session;
1887
+ };
1888
+ }>)[];
1889
+ metadata: {
1890
+ openapi: {
1891
+ operationId: string;
1892
+ summary: string;
1893
+ description: string;
1894
+ responses: {
1895
+ 200: {
1896
+ description: string;
1897
+ content: {
1898
+ "application/json": {
1899
+ schema: {
1900
+ type: "object";
1901
+ properties: {
1902
+ success: {
1903
+ type: string;
1904
+ };
1905
+ };
1906
+ };
1907
+ };
1908
+ };
1909
+ };
1910
+ };
1911
+ };
1912
+ };
1913
+ }, {
1914
+ success: boolean;
1915
+ }>;
1916
+ revokeUserSessions: import("better-auth").StrictEndpoint<"/admin/revoke-user-sessions", {
1917
+ method: "POST";
1918
+ body: import("zod").ZodObject<{
1919
+ userId: import("zod").ZodCoercedString<unknown>;
1920
+ }, import("better-auth").$strip>;
1921
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1922
+ session: {
1923
+ user: import("better-auth/plugins").UserWithRole;
1924
+ session: import("better-auth").Session;
1925
+ };
1926
+ }>)[];
1927
+ metadata: {
1928
+ openapi: {
1929
+ operationId: string;
1930
+ summary: string;
1931
+ description: string;
1932
+ responses: {
1933
+ 200: {
1934
+ description: string;
1935
+ content: {
1936
+ "application/json": {
1937
+ schema: {
1938
+ type: "object";
1939
+ properties: {
1940
+ success: {
1941
+ type: string;
1942
+ };
1943
+ };
1944
+ };
1945
+ };
1946
+ };
1947
+ };
1948
+ };
1949
+ };
1950
+ };
1951
+ }, {
1952
+ success: boolean;
1953
+ }>;
1954
+ removeUser: import("better-auth").StrictEndpoint<"/admin/remove-user", {
1955
+ method: "POST";
1956
+ body: import("zod").ZodObject<{
1957
+ userId: import("zod").ZodCoercedString<unknown>;
1958
+ }, import("better-auth").$strip>;
1959
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1960
+ session: {
1961
+ user: import("better-auth/plugins").UserWithRole;
1962
+ session: import("better-auth").Session;
1963
+ };
1964
+ }>)[];
1965
+ metadata: {
1966
+ openapi: {
1967
+ operationId: string;
1968
+ summary: string;
1969
+ description: string;
1970
+ responses: {
1971
+ 200: {
1972
+ description: string;
1973
+ content: {
1974
+ "application/json": {
1975
+ schema: {
1976
+ type: "object";
1977
+ properties: {
1978
+ success: {
1979
+ type: string;
1980
+ };
1981
+ };
1982
+ };
1983
+ };
1984
+ };
1985
+ };
1986
+ };
1987
+ };
1988
+ };
1989
+ }, {
1990
+ success: boolean;
1991
+ }>;
1992
+ setUserPassword: import("better-auth").StrictEndpoint<"/admin/set-user-password", {
1993
+ method: "POST";
1994
+ body: import("zod").ZodObject<{
1995
+ newPassword: import("zod").ZodString;
1996
+ userId: import("zod").ZodCoercedString<unknown>;
1997
+ }, import("better-auth").$strip>;
1998
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1999
+ session: {
2000
+ user: import("better-auth/plugins").UserWithRole;
2001
+ session: import("better-auth").Session;
2002
+ };
2003
+ }>)[];
2004
+ metadata: {
2005
+ openapi: {
2006
+ operationId: string;
2007
+ summary: string;
2008
+ description: string;
2009
+ responses: {
2010
+ 200: {
2011
+ description: string;
2012
+ content: {
2013
+ "application/json": {
2014
+ schema: {
2015
+ type: "object";
2016
+ properties: {
2017
+ status: {
2018
+ type: string;
2019
+ };
2020
+ };
2021
+ };
2022
+ };
2023
+ };
2024
+ };
2025
+ };
2026
+ };
2027
+ };
2028
+ }, {
2029
+ status: boolean;
2030
+ }>;
2031
+ userHasPermission: import("better-auth").StrictEndpoint<"/admin/has-permission", {
2032
+ method: "POST";
2033
+ body: import("zod").ZodIntersection<import("zod").ZodObject<{
2034
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
2035
+ role: import("zod").ZodOptional<import("zod").ZodString>;
2036
+ }, import("better-auth").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
2037
+ permission: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
2038
+ permissions: import("zod").ZodUndefined;
2039
+ }, import("better-auth").$strip>, import("zod").ZodObject<{
2040
+ permission: import("zod").ZodUndefined;
2041
+ permissions: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
2042
+ }, import("better-auth").$strip>]>>;
2043
+ metadata: {
2044
+ openapi: {
2045
+ description: string;
2046
+ requestBody: {
2047
+ content: {
2048
+ "application/json": {
2049
+ schema: {
2050
+ type: "object";
2051
+ properties: {
2052
+ permission: {
2053
+ type: string;
2054
+ description: string;
2055
+ deprecated: boolean;
2056
+ };
2057
+ permissions: {
2058
+ type: string;
2059
+ description: string;
2060
+ };
2061
+ };
2062
+ required: string[];
2063
+ };
2064
+ };
2065
+ };
2066
+ };
2067
+ responses: {
2068
+ "200": {
2069
+ description: string;
2070
+ content: {
2071
+ "application/json": {
2072
+ schema: {
2073
+ type: "object";
2074
+ properties: {
2075
+ error: {
2076
+ type: string;
2077
+ };
2078
+ success: {
2079
+ type: string;
2080
+ };
2081
+ };
2082
+ required: string[];
2083
+ };
2084
+ };
2085
+ };
2086
+ };
2087
+ };
2088
+ };
2089
+ $Infer: {
2090
+ body: ({
2091
+ permission: {
2092
+ readonly user?: ("list" | "create" | "update" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get")[] | undefined;
2093
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
2094
+ };
2095
+ permissions?: never | undefined;
2096
+ } | {
2097
+ permissions: {
2098
+ readonly user?: ("list" | "create" | "update" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get")[] | undefined;
2099
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
2100
+ };
2101
+ permission?: never | undefined;
2102
+ }) & {
2103
+ userId?: string | undefined;
2104
+ role?: "user" | "admin" | undefined;
2105
+ };
2106
+ };
2107
+ };
2108
+ }, {
2109
+ error: null;
2110
+ success: boolean;
2111
+ }>;
2112
+ };
2113
+ $ERROR_CODES: {
2114
+ readonly FAILED_TO_CREATE_USER: "Failed to create user";
2115
+ readonly USER_ALREADY_EXISTS: "User already exists.";
2116
+ readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
2117
+ readonly YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself";
2118
+ readonly YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role";
2119
+ readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users";
2120
+ readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users";
2121
+ readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions";
2122
+ readonly YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users";
2123
+ readonly YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users";
2124
+ readonly YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions";
2125
+ readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users";
2126
+ readonly YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password";
2127
+ readonly BANNED_USER: "You have been banned from this application";
2128
+ readonly YOU_ARE_NOT_ALLOWED_TO_GET_USER: "You are not allowed to get user";
2129
+ readonly NO_DATA_TO_UPDATE: "No data to update";
2130
+ readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
2131
+ readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
2132
+ readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
2133
+ readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
2134
+ readonly INVALID_ROLE_TYPE: "Invalid role type";
2135
+ };
2136
+ schema: {
2137
+ user: {
2138
+ fields: {
2139
+ role: {
2140
+ type: "string";
2141
+ required: false;
2142
+ input: false;
2143
+ };
2144
+ banned: {
2145
+ type: "boolean";
2146
+ defaultValue: false;
2147
+ required: false;
2148
+ input: false;
2149
+ };
2150
+ banReason: {
2151
+ type: "string";
2152
+ required: false;
2153
+ input: false;
2154
+ };
2155
+ banExpires: {
2156
+ type: "date";
2157
+ required: false;
2158
+ input: false;
2159
+ };
2160
+ };
2161
+ };
2162
+ session: {
2163
+ fields: {
2164
+ impersonatedBy: {
2165
+ type: "string";
2166
+ required: false;
2167
+ };
2168
+ };
2169
+ };
2170
+ };
2171
+ options: NoInfer<{
2172
+ bannedUserMessage: string;
2173
+ }>;
2174
+ } | {
2175
+ id: "jwt";
2176
+ options: NoInfer<{
2177
+ jwks: {
2178
+ keyPairConfig: {
2179
+ alg: "EdDSA";
2180
+ crv: "Ed25519";
2181
+ };
2182
+ };
2183
+ jwt: {
2184
+ issuer: string;
2185
+ audience: string;
2186
+ expirationTime: string;
2187
+ definePayload: ({ user, session }: {
2188
+ user: import("better-auth").User & Record<string, any>;
2189
+ session: import("better-auth").Session & Record<string, any>;
2190
+ }) => {
2191
+ id: string;
2192
+ ns: string;
2193
+ db: string;
2194
+ ac: string;
2195
+ email: string;
2196
+ name: string;
2197
+ role: string;
2198
+ sessionId: string;
2199
+ };
2200
+ };
2201
+ }>;
2202
+ endpoints: {
2203
+ getJwks: import("better-auth").StrictEndpoint<string, {
2204
+ method: "GET";
2205
+ metadata: {
2206
+ openapi: {
2207
+ operationId: string;
2208
+ description: string;
2209
+ responses: {
2210
+ "200": {
2211
+ description: string;
2212
+ content: {
2213
+ "application/json": {
2214
+ schema: {
2215
+ type: "object";
2216
+ properties: {
2217
+ keys: {
2218
+ type: string;
2219
+ description: string;
2220
+ items: {
2221
+ type: string;
2222
+ properties: {
2223
+ kid: {
2224
+ type: string;
2225
+ description: string;
2226
+ };
2227
+ kty: {
2228
+ type: string;
2229
+ description: string;
2230
+ };
2231
+ alg: {
2232
+ type: string;
2233
+ description: string;
2234
+ };
2235
+ use: {
2236
+ type: string;
2237
+ description: string;
2238
+ enum: string[];
2239
+ nullable: boolean;
2240
+ };
2241
+ n: {
2242
+ type: string;
2243
+ description: string;
2244
+ nullable: boolean;
2245
+ };
2246
+ e: {
2247
+ type: string;
2248
+ description: string;
2249
+ nullable: boolean;
2250
+ };
2251
+ crv: {
2252
+ type: string;
2253
+ description: string;
2254
+ nullable: boolean;
2255
+ };
2256
+ x: {
2257
+ type: string;
2258
+ description: string;
2259
+ nullable: boolean;
2260
+ };
2261
+ y: {
2262
+ type: string;
2263
+ description: string;
2264
+ nullable: boolean;
2265
+ };
2266
+ };
2267
+ required: string[];
2268
+ };
2269
+ };
2270
+ };
2271
+ required: string[];
2272
+ };
2273
+ };
2274
+ };
2275
+ };
2276
+ };
2277
+ };
2278
+ };
2279
+ }, import("better-auth").JSONWebKeySet>;
2280
+ getToken: import("better-auth").StrictEndpoint<"/token", {
2281
+ method: "GET";
2282
+ requireHeaders: true;
2283
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2284
+ session: {
2285
+ session: Record<string, any> & {
2286
+ id: string;
2287
+ createdAt: Date;
2288
+ updatedAt: Date;
2289
+ userId: string;
2290
+ expiresAt: Date;
2291
+ token: string;
2292
+ ipAddress?: string | null | undefined;
2293
+ userAgent?: string | null | undefined;
2294
+ };
2295
+ user: Record<string, any> & {
2296
+ id: string;
2297
+ createdAt: Date;
2298
+ updatedAt: Date;
2299
+ email: string;
2300
+ emailVerified: boolean;
2301
+ name: string;
2302
+ image?: string | null | undefined;
2303
+ };
2304
+ };
2305
+ }>)[];
2306
+ metadata: {
2307
+ openapi: {
2308
+ operationId: string;
2309
+ description: string;
2310
+ responses: {
2311
+ 200: {
2312
+ description: string;
2313
+ content: {
2314
+ "application/json": {
2315
+ schema: {
2316
+ type: "object";
2317
+ properties: {
2318
+ token: {
2319
+ type: string;
2320
+ };
2321
+ };
2322
+ };
2323
+ };
2324
+ };
2325
+ };
2326
+ };
2327
+ };
2328
+ };
2329
+ }, {
2330
+ token: string;
2331
+ }>;
2332
+ signJWT: import("better-auth").StrictEndpoint<string, {
2333
+ method: "POST";
2334
+ metadata: {
2335
+ $Infer: {
2336
+ body: {
2337
+ payload: import("better-auth").JWTPayload;
2338
+ overrideOptions?: import("better-auth/plugins").JwtOptions | undefined;
2339
+ };
2340
+ };
2341
+ };
2342
+ body: import("zod").ZodObject<{
2343
+ payload: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>;
2344
+ overrideOptions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
2345
+ }, import("better-auth").$strip>;
2346
+ }, {
2347
+ token: string;
2348
+ }>;
2349
+ verifyJWT: import("better-auth").StrictEndpoint<string, {
2350
+ method: "POST";
2351
+ metadata: {
2352
+ $Infer: {
2353
+ body: {
2354
+ token: string;
2355
+ issuer?: string;
2356
+ };
2357
+ response: {
2358
+ payload: {
2359
+ sub: string;
2360
+ aud: string;
2361
+ [key: string]: any;
2362
+ } | null;
2363
+ };
2364
+ };
2365
+ };
2366
+ body: import("zod").ZodObject<{
2367
+ token: import("zod").ZodString;
2368
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
2369
+ }, import("better-auth").$strip>;
2370
+ }, {
2371
+ payload: (import("better-auth").JWTPayload & Required<Pick<import("better-auth").JWTPayload, "sub" | "aud">>) | null;
2372
+ }>;
2373
+ };
2374
+ hooks: {
2375
+ after: {
2376
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
2377
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
2378
+ }[];
2379
+ };
2380
+ schema: {
2381
+ jwks: {
2382
+ fields: {
2383
+ publicKey: {
2384
+ type: "string";
2385
+ required: true;
2386
+ };
2387
+ privateKey: {
2388
+ type: "string";
2389
+ required: true;
2390
+ };
2391
+ createdAt: {
2392
+ type: "date";
2393
+ required: true;
2394
+ };
2395
+ expiresAt: {
2396
+ type: "date";
2397
+ required: false;
2398
+ };
2399
+ };
2400
+ };
2401
+ };
2402
+ } | {
2403
+ id: "tanstack-start-cookies";
2404
+ hooks: {
2405
+ after: {
2406
+ matcher(ctx: import("better-auth").HookEndpointContext): true;
2407
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
2408
+ }[];
2409
+ };
2410
+ })[];
2411
+ };