@hyperfixation/auth 0.1.0

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.
@@ -0,0 +1,3372 @@
1
+ import { emailOTP } from "better-auth/plugins";
2
+ import type { Pool } from "pg";
3
+ import { type SessionFactor } from "./session.js";
4
+ /** Model name → the `hf_*` table it lives in. Every better-auth table is prefixed, forever. */
5
+ export declare const AUTH_SCHEMA: {
6
+ readonly user: import("drizzle-orm/pg-core").PgTableWithColumns<{
7
+ name: "hf_user";
8
+ schema: undefined;
9
+ columns: {
10
+ id: import("drizzle-orm/pg-core").PgColumn<{
11
+ name: "id";
12
+ tableName: "hf_user";
13
+ dataType: "string";
14
+ columnType: "PgText";
15
+ data: string;
16
+ driverParam: string;
17
+ notNull: true;
18
+ hasDefault: false;
19
+ isPrimaryKey: true;
20
+ isAutoincrement: false;
21
+ hasRuntimeDefault: false;
22
+ enumValues: [string, ...string[]];
23
+ baseColumn: never;
24
+ identity: undefined;
25
+ generated: undefined;
26
+ }, {}, {}>;
27
+ name: import("drizzle-orm/pg-core").PgColumn<{
28
+ name: "name";
29
+ tableName: "hf_user";
30
+ dataType: "string";
31
+ columnType: "PgText";
32
+ data: string;
33
+ driverParam: string;
34
+ notNull: true;
35
+ hasDefault: false;
36
+ isPrimaryKey: false;
37
+ isAutoincrement: false;
38
+ hasRuntimeDefault: false;
39
+ enumValues: [string, ...string[]];
40
+ baseColumn: never;
41
+ identity: undefined;
42
+ generated: undefined;
43
+ }, {}, {}>;
44
+ email: import("drizzle-orm/pg-core").PgColumn<{
45
+ name: "email";
46
+ tableName: "hf_user";
47
+ dataType: "string";
48
+ columnType: "PgText";
49
+ data: string;
50
+ driverParam: string;
51
+ notNull: true;
52
+ hasDefault: false;
53
+ isPrimaryKey: false;
54
+ isAutoincrement: false;
55
+ hasRuntimeDefault: false;
56
+ enumValues: [string, ...string[]];
57
+ baseColumn: never;
58
+ identity: undefined;
59
+ generated: undefined;
60
+ }, {}, {}>;
61
+ emailVerified: import("drizzle-orm/pg-core").PgColumn<{
62
+ name: "email_verified";
63
+ tableName: "hf_user";
64
+ dataType: "boolean";
65
+ columnType: "PgBoolean";
66
+ data: boolean;
67
+ driverParam: boolean;
68
+ notNull: true;
69
+ hasDefault: true;
70
+ isPrimaryKey: false;
71
+ isAutoincrement: false;
72
+ hasRuntimeDefault: false;
73
+ enumValues: undefined;
74
+ baseColumn: never;
75
+ identity: undefined;
76
+ generated: undefined;
77
+ }, {}, {}>;
78
+ image: import("drizzle-orm/pg-core").PgColumn<{
79
+ name: "image";
80
+ tableName: "hf_user";
81
+ dataType: "string";
82
+ columnType: "PgText";
83
+ data: string;
84
+ driverParam: string;
85
+ notNull: false;
86
+ hasDefault: false;
87
+ isPrimaryKey: false;
88
+ isAutoincrement: false;
89
+ hasRuntimeDefault: false;
90
+ enumValues: [string, ...string[]];
91
+ baseColumn: never;
92
+ identity: undefined;
93
+ generated: undefined;
94
+ }, {}, {}>;
95
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
96
+ name: "created_at";
97
+ tableName: "hf_user";
98
+ dataType: "date";
99
+ columnType: "PgTimestamp";
100
+ data: Date;
101
+ driverParam: string;
102
+ notNull: true;
103
+ hasDefault: true;
104
+ isPrimaryKey: false;
105
+ isAutoincrement: false;
106
+ hasRuntimeDefault: false;
107
+ enumValues: undefined;
108
+ baseColumn: never;
109
+ identity: undefined;
110
+ generated: undefined;
111
+ }, {}, {}>;
112
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
113
+ name: "updated_at";
114
+ tableName: "hf_user";
115
+ dataType: "date";
116
+ columnType: "PgTimestamp";
117
+ data: Date;
118
+ driverParam: string;
119
+ notNull: true;
120
+ hasDefault: true;
121
+ isPrimaryKey: false;
122
+ isAutoincrement: false;
123
+ hasRuntimeDefault: false;
124
+ enumValues: undefined;
125
+ baseColumn: never;
126
+ identity: undefined;
127
+ generated: undefined;
128
+ }, {}, {}>;
129
+ role: import("drizzle-orm/pg-core").PgColumn<{
130
+ name: "role";
131
+ tableName: "hf_user";
132
+ dataType: "string";
133
+ columnType: "PgText";
134
+ data: string;
135
+ driverParam: string;
136
+ notNull: false;
137
+ hasDefault: false;
138
+ isPrimaryKey: false;
139
+ isAutoincrement: false;
140
+ hasRuntimeDefault: false;
141
+ enumValues: [string, ...string[]];
142
+ baseColumn: never;
143
+ identity: undefined;
144
+ generated: undefined;
145
+ }, {}, {}>;
146
+ banned: import("drizzle-orm/pg-core").PgColumn<{
147
+ name: "banned";
148
+ tableName: "hf_user";
149
+ dataType: "boolean";
150
+ columnType: "PgBoolean";
151
+ data: boolean;
152
+ driverParam: boolean;
153
+ notNull: false;
154
+ hasDefault: true;
155
+ isPrimaryKey: false;
156
+ isAutoincrement: false;
157
+ hasRuntimeDefault: false;
158
+ enumValues: undefined;
159
+ baseColumn: never;
160
+ identity: undefined;
161
+ generated: undefined;
162
+ }, {}, {}>;
163
+ banReason: import("drizzle-orm/pg-core").PgColumn<{
164
+ name: "ban_reason";
165
+ tableName: "hf_user";
166
+ dataType: "string";
167
+ columnType: "PgText";
168
+ data: string;
169
+ driverParam: string;
170
+ notNull: false;
171
+ hasDefault: false;
172
+ isPrimaryKey: false;
173
+ isAutoincrement: false;
174
+ hasRuntimeDefault: false;
175
+ enumValues: [string, ...string[]];
176
+ baseColumn: never;
177
+ identity: undefined;
178
+ generated: undefined;
179
+ }, {}, {}>;
180
+ banExpires: import("drizzle-orm/pg-core").PgColumn<{
181
+ name: "ban_expires";
182
+ tableName: "hf_user";
183
+ dataType: "date";
184
+ columnType: "PgTimestamp";
185
+ data: Date;
186
+ driverParam: string;
187
+ notNull: false;
188
+ hasDefault: false;
189
+ isPrimaryKey: false;
190
+ isAutoincrement: false;
191
+ hasRuntimeDefault: false;
192
+ enumValues: undefined;
193
+ baseColumn: never;
194
+ identity: undefined;
195
+ generated: undefined;
196
+ }, {}, {}>;
197
+ };
198
+ dialect: "pg";
199
+ }>;
200
+ readonly session: import("drizzle-orm/pg-core").PgTableWithColumns<{
201
+ name: "hf_session";
202
+ schema: undefined;
203
+ columns: {
204
+ id: import("drizzle-orm/pg-core").PgColumn<{
205
+ name: "id";
206
+ tableName: "hf_session";
207
+ dataType: "string";
208
+ columnType: "PgText";
209
+ data: string;
210
+ driverParam: string;
211
+ notNull: true;
212
+ hasDefault: false;
213
+ isPrimaryKey: true;
214
+ isAutoincrement: false;
215
+ hasRuntimeDefault: false;
216
+ enumValues: [string, ...string[]];
217
+ baseColumn: never;
218
+ identity: undefined;
219
+ generated: undefined;
220
+ }, {}, {}>;
221
+ expiresAt: import("drizzle-orm/pg-core").PgColumn<{
222
+ name: "expires_at";
223
+ tableName: "hf_session";
224
+ dataType: "date";
225
+ columnType: "PgTimestamp";
226
+ data: Date;
227
+ driverParam: string;
228
+ notNull: true;
229
+ hasDefault: false;
230
+ isPrimaryKey: false;
231
+ isAutoincrement: false;
232
+ hasRuntimeDefault: false;
233
+ enumValues: undefined;
234
+ baseColumn: never;
235
+ identity: undefined;
236
+ generated: undefined;
237
+ }, {}, {}>;
238
+ token: import("drizzle-orm/pg-core").PgColumn<{
239
+ name: "token";
240
+ tableName: "hf_session";
241
+ dataType: "string";
242
+ columnType: "PgText";
243
+ data: string;
244
+ driverParam: string;
245
+ notNull: true;
246
+ hasDefault: false;
247
+ isPrimaryKey: false;
248
+ isAutoincrement: false;
249
+ hasRuntimeDefault: false;
250
+ enumValues: [string, ...string[]];
251
+ baseColumn: never;
252
+ identity: undefined;
253
+ generated: undefined;
254
+ }, {}, {}>;
255
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
256
+ name: "created_at";
257
+ tableName: "hf_session";
258
+ dataType: "date";
259
+ columnType: "PgTimestamp";
260
+ data: Date;
261
+ driverParam: string;
262
+ notNull: true;
263
+ hasDefault: true;
264
+ isPrimaryKey: false;
265
+ isAutoincrement: false;
266
+ hasRuntimeDefault: false;
267
+ enumValues: undefined;
268
+ baseColumn: never;
269
+ identity: undefined;
270
+ generated: undefined;
271
+ }, {}, {}>;
272
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
273
+ name: "updated_at";
274
+ tableName: "hf_session";
275
+ dataType: "date";
276
+ columnType: "PgTimestamp";
277
+ data: Date;
278
+ driverParam: string;
279
+ notNull: true;
280
+ hasDefault: true;
281
+ isPrimaryKey: false;
282
+ isAutoincrement: false;
283
+ hasRuntimeDefault: false;
284
+ enumValues: undefined;
285
+ baseColumn: never;
286
+ identity: undefined;
287
+ generated: undefined;
288
+ }, {}, {}>;
289
+ ipAddress: import("drizzle-orm/pg-core").PgColumn<{
290
+ name: "ip_address";
291
+ tableName: "hf_session";
292
+ dataType: "string";
293
+ columnType: "PgText";
294
+ data: string;
295
+ driverParam: string;
296
+ notNull: false;
297
+ hasDefault: false;
298
+ isPrimaryKey: false;
299
+ isAutoincrement: false;
300
+ hasRuntimeDefault: false;
301
+ enumValues: [string, ...string[]];
302
+ baseColumn: never;
303
+ identity: undefined;
304
+ generated: undefined;
305
+ }, {}, {}>;
306
+ userAgent: import("drizzle-orm/pg-core").PgColumn<{
307
+ name: "user_agent";
308
+ tableName: "hf_session";
309
+ dataType: "string";
310
+ columnType: "PgText";
311
+ data: string;
312
+ driverParam: string;
313
+ notNull: false;
314
+ hasDefault: false;
315
+ isPrimaryKey: false;
316
+ isAutoincrement: false;
317
+ hasRuntimeDefault: false;
318
+ enumValues: [string, ...string[]];
319
+ baseColumn: never;
320
+ identity: undefined;
321
+ generated: undefined;
322
+ }, {}, {}>;
323
+ userId: import("drizzle-orm/pg-core").PgColumn<{
324
+ name: "user_id";
325
+ tableName: "hf_session";
326
+ dataType: "string";
327
+ columnType: "PgText";
328
+ data: string;
329
+ driverParam: string;
330
+ notNull: true;
331
+ hasDefault: false;
332
+ isPrimaryKey: false;
333
+ isAutoincrement: false;
334
+ hasRuntimeDefault: false;
335
+ enumValues: [string, ...string[]];
336
+ baseColumn: never;
337
+ identity: undefined;
338
+ generated: undefined;
339
+ }, {}, {}>;
340
+ activeOrganizationId: import("drizzle-orm/pg-core").PgColumn<{
341
+ name: "active_organization_id";
342
+ tableName: "hf_session";
343
+ dataType: "string";
344
+ columnType: "PgText";
345
+ data: string;
346
+ driverParam: string;
347
+ notNull: false;
348
+ hasDefault: false;
349
+ isPrimaryKey: false;
350
+ isAutoincrement: false;
351
+ hasRuntimeDefault: false;
352
+ enumValues: [string, ...string[]];
353
+ baseColumn: never;
354
+ identity: undefined;
355
+ generated: undefined;
356
+ }, {}, {}>;
357
+ impersonatedBy: import("drizzle-orm/pg-core").PgColumn<{
358
+ name: "impersonated_by";
359
+ tableName: "hf_session";
360
+ dataType: "string";
361
+ columnType: "PgText";
362
+ data: string;
363
+ driverParam: string;
364
+ notNull: false;
365
+ hasDefault: false;
366
+ isPrimaryKey: false;
367
+ isAutoincrement: false;
368
+ hasRuntimeDefault: false;
369
+ enumValues: [string, ...string[]];
370
+ baseColumn: never;
371
+ identity: undefined;
372
+ generated: undefined;
373
+ }, {}, {}>;
374
+ factor: import("drizzle-orm/pg-core").PgColumn<{
375
+ name: "factor";
376
+ tableName: "hf_session";
377
+ dataType: "string";
378
+ columnType: "PgText";
379
+ data: "code" | "passkey";
380
+ driverParam: string;
381
+ notNull: true;
382
+ hasDefault: true;
383
+ isPrimaryKey: false;
384
+ isAutoincrement: false;
385
+ hasRuntimeDefault: false;
386
+ enumValues: ["code", "passkey"];
387
+ baseColumn: never;
388
+ identity: undefined;
389
+ generated: undefined;
390
+ }, {}, {}>;
391
+ };
392
+ dialect: "pg";
393
+ }>;
394
+ readonly account: import("drizzle-orm/pg-core").PgTableWithColumns<{
395
+ name: "hf_account";
396
+ schema: undefined;
397
+ columns: {
398
+ id: import("drizzle-orm/pg-core").PgColumn<{
399
+ name: "id";
400
+ tableName: "hf_account";
401
+ dataType: "string";
402
+ columnType: "PgText";
403
+ data: string;
404
+ driverParam: string;
405
+ notNull: true;
406
+ hasDefault: false;
407
+ isPrimaryKey: true;
408
+ isAutoincrement: false;
409
+ hasRuntimeDefault: false;
410
+ enumValues: [string, ...string[]];
411
+ baseColumn: never;
412
+ identity: undefined;
413
+ generated: undefined;
414
+ }, {}, {}>;
415
+ accountId: import("drizzle-orm/pg-core").PgColumn<{
416
+ name: "account_id";
417
+ tableName: "hf_account";
418
+ dataType: "string";
419
+ columnType: "PgText";
420
+ data: string;
421
+ driverParam: string;
422
+ notNull: true;
423
+ hasDefault: false;
424
+ isPrimaryKey: false;
425
+ isAutoincrement: false;
426
+ hasRuntimeDefault: false;
427
+ enumValues: [string, ...string[]];
428
+ baseColumn: never;
429
+ identity: undefined;
430
+ generated: undefined;
431
+ }, {}, {}>;
432
+ providerId: import("drizzle-orm/pg-core").PgColumn<{
433
+ name: "provider_id";
434
+ tableName: "hf_account";
435
+ dataType: "string";
436
+ columnType: "PgText";
437
+ data: string;
438
+ driverParam: string;
439
+ notNull: true;
440
+ hasDefault: false;
441
+ isPrimaryKey: false;
442
+ isAutoincrement: false;
443
+ hasRuntimeDefault: false;
444
+ enumValues: [string, ...string[]];
445
+ baseColumn: never;
446
+ identity: undefined;
447
+ generated: undefined;
448
+ }, {}, {}>;
449
+ userId: import("drizzle-orm/pg-core").PgColumn<{
450
+ name: "user_id";
451
+ tableName: "hf_account";
452
+ dataType: "string";
453
+ columnType: "PgText";
454
+ data: string;
455
+ driverParam: string;
456
+ notNull: true;
457
+ hasDefault: false;
458
+ isPrimaryKey: false;
459
+ isAutoincrement: false;
460
+ hasRuntimeDefault: false;
461
+ enumValues: [string, ...string[]];
462
+ baseColumn: never;
463
+ identity: undefined;
464
+ generated: undefined;
465
+ }, {}, {}>;
466
+ accessToken: import("drizzle-orm/pg-core").PgColumn<{
467
+ name: "access_token";
468
+ tableName: "hf_account";
469
+ dataType: "string";
470
+ columnType: "PgText";
471
+ data: string;
472
+ driverParam: string;
473
+ notNull: false;
474
+ hasDefault: false;
475
+ isPrimaryKey: false;
476
+ isAutoincrement: false;
477
+ hasRuntimeDefault: false;
478
+ enumValues: [string, ...string[]];
479
+ baseColumn: never;
480
+ identity: undefined;
481
+ generated: undefined;
482
+ }, {}, {}>;
483
+ refreshToken: import("drizzle-orm/pg-core").PgColumn<{
484
+ name: "refresh_token";
485
+ tableName: "hf_account";
486
+ dataType: "string";
487
+ columnType: "PgText";
488
+ data: string;
489
+ driverParam: string;
490
+ notNull: false;
491
+ hasDefault: false;
492
+ isPrimaryKey: false;
493
+ isAutoincrement: false;
494
+ hasRuntimeDefault: false;
495
+ enumValues: [string, ...string[]];
496
+ baseColumn: never;
497
+ identity: undefined;
498
+ generated: undefined;
499
+ }, {}, {}>;
500
+ idToken: import("drizzle-orm/pg-core").PgColumn<{
501
+ name: "id_token";
502
+ tableName: "hf_account";
503
+ dataType: "string";
504
+ columnType: "PgText";
505
+ data: string;
506
+ driverParam: string;
507
+ notNull: false;
508
+ hasDefault: false;
509
+ isPrimaryKey: false;
510
+ isAutoincrement: false;
511
+ hasRuntimeDefault: false;
512
+ enumValues: [string, ...string[]];
513
+ baseColumn: never;
514
+ identity: undefined;
515
+ generated: undefined;
516
+ }, {}, {}>;
517
+ accessTokenExpiresAt: import("drizzle-orm/pg-core").PgColumn<{
518
+ name: "access_token_expires_at";
519
+ tableName: "hf_account";
520
+ dataType: "date";
521
+ columnType: "PgTimestamp";
522
+ data: Date;
523
+ driverParam: string;
524
+ notNull: false;
525
+ hasDefault: false;
526
+ isPrimaryKey: false;
527
+ isAutoincrement: false;
528
+ hasRuntimeDefault: false;
529
+ enumValues: undefined;
530
+ baseColumn: never;
531
+ identity: undefined;
532
+ generated: undefined;
533
+ }, {}, {}>;
534
+ refreshTokenExpiresAt: import("drizzle-orm/pg-core").PgColumn<{
535
+ name: "refresh_token_expires_at";
536
+ tableName: "hf_account";
537
+ dataType: "date";
538
+ columnType: "PgTimestamp";
539
+ data: Date;
540
+ driverParam: string;
541
+ notNull: false;
542
+ hasDefault: false;
543
+ isPrimaryKey: false;
544
+ isAutoincrement: false;
545
+ hasRuntimeDefault: false;
546
+ enumValues: undefined;
547
+ baseColumn: never;
548
+ identity: undefined;
549
+ generated: undefined;
550
+ }, {}, {}>;
551
+ scope: import("drizzle-orm/pg-core").PgColumn<{
552
+ name: "scope";
553
+ tableName: "hf_account";
554
+ dataType: "string";
555
+ columnType: "PgText";
556
+ data: string;
557
+ driverParam: string;
558
+ notNull: false;
559
+ hasDefault: false;
560
+ isPrimaryKey: false;
561
+ isAutoincrement: false;
562
+ hasRuntimeDefault: false;
563
+ enumValues: [string, ...string[]];
564
+ baseColumn: never;
565
+ identity: undefined;
566
+ generated: undefined;
567
+ }, {}, {}>;
568
+ password: import("drizzle-orm/pg-core").PgColumn<{
569
+ name: "password";
570
+ tableName: "hf_account";
571
+ dataType: "string";
572
+ columnType: "PgText";
573
+ data: string;
574
+ driverParam: string;
575
+ notNull: false;
576
+ hasDefault: false;
577
+ isPrimaryKey: false;
578
+ isAutoincrement: false;
579
+ hasRuntimeDefault: false;
580
+ enumValues: [string, ...string[]];
581
+ baseColumn: never;
582
+ identity: undefined;
583
+ generated: undefined;
584
+ }, {}, {}>;
585
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
586
+ name: "created_at";
587
+ tableName: "hf_account";
588
+ dataType: "date";
589
+ columnType: "PgTimestamp";
590
+ data: Date;
591
+ driverParam: string;
592
+ notNull: true;
593
+ hasDefault: true;
594
+ isPrimaryKey: false;
595
+ isAutoincrement: false;
596
+ hasRuntimeDefault: false;
597
+ enumValues: undefined;
598
+ baseColumn: never;
599
+ identity: undefined;
600
+ generated: undefined;
601
+ }, {}, {}>;
602
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
603
+ name: "updated_at";
604
+ tableName: "hf_account";
605
+ dataType: "date";
606
+ columnType: "PgTimestamp";
607
+ data: Date;
608
+ driverParam: string;
609
+ notNull: true;
610
+ hasDefault: true;
611
+ isPrimaryKey: false;
612
+ isAutoincrement: false;
613
+ hasRuntimeDefault: false;
614
+ enumValues: undefined;
615
+ baseColumn: never;
616
+ identity: undefined;
617
+ generated: undefined;
618
+ }, {}, {}>;
619
+ };
620
+ dialect: "pg";
621
+ }>;
622
+ readonly verification: import("drizzle-orm/pg-core").PgTableWithColumns<{
623
+ name: "hf_verification";
624
+ schema: undefined;
625
+ columns: {
626
+ id: import("drizzle-orm/pg-core").PgColumn<{
627
+ name: "id";
628
+ tableName: "hf_verification";
629
+ dataType: "string";
630
+ columnType: "PgText";
631
+ data: string;
632
+ driverParam: string;
633
+ notNull: true;
634
+ hasDefault: false;
635
+ isPrimaryKey: true;
636
+ isAutoincrement: false;
637
+ hasRuntimeDefault: false;
638
+ enumValues: [string, ...string[]];
639
+ baseColumn: never;
640
+ identity: undefined;
641
+ generated: undefined;
642
+ }, {}, {}>;
643
+ identifier: import("drizzle-orm/pg-core").PgColumn<{
644
+ name: "identifier";
645
+ tableName: "hf_verification";
646
+ dataType: "string";
647
+ columnType: "PgText";
648
+ data: string;
649
+ driverParam: string;
650
+ notNull: true;
651
+ hasDefault: false;
652
+ isPrimaryKey: false;
653
+ isAutoincrement: false;
654
+ hasRuntimeDefault: false;
655
+ enumValues: [string, ...string[]];
656
+ baseColumn: never;
657
+ identity: undefined;
658
+ generated: undefined;
659
+ }, {}, {}>;
660
+ value: import("drizzle-orm/pg-core").PgColumn<{
661
+ name: "value";
662
+ tableName: "hf_verification";
663
+ dataType: "string";
664
+ columnType: "PgText";
665
+ data: string;
666
+ driverParam: string;
667
+ notNull: true;
668
+ hasDefault: false;
669
+ isPrimaryKey: false;
670
+ isAutoincrement: false;
671
+ hasRuntimeDefault: false;
672
+ enumValues: [string, ...string[]];
673
+ baseColumn: never;
674
+ identity: undefined;
675
+ generated: undefined;
676
+ }, {}, {}>;
677
+ expiresAt: import("drizzle-orm/pg-core").PgColumn<{
678
+ name: "expires_at";
679
+ tableName: "hf_verification";
680
+ dataType: "date";
681
+ columnType: "PgTimestamp";
682
+ data: Date;
683
+ driverParam: string;
684
+ notNull: true;
685
+ hasDefault: false;
686
+ isPrimaryKey: false;
687
+ isAutoincrement: false;
688
+ hasRuntimeDefault: false;
689
+ enumValues: undefined;
690
+ baseColumn: never;
691
+ identity: undefined;
692
+ generated: undefined;
693
+ }, {}, {}>;
694
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
695
+ name: "created_at";
696
+ tableName: "hf_verification";
697
+ dataType: "date";
698
+ columnType: "PgTimestamp";
699
+ data: Date;
700
+ driverParam: string;
701
+ notNull: true;
702
+ hasDefault: true;
703
+ isPrimaryKey: false;
704
+ isAutoincrement: false;
705
+ hasRuntimeDefault: false;
706
+ enumValues: undefined;
707
+ baseColumn: never;
708
+ identity: undefined;
709
+ generated: undefined;
710
+ }, {}, {}>;
711
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
712
+ name: "updated_at";
713
+ tableName: "hf_verification";
714
+ dataType: "date";
715
+ columnType: "PgTimestamp";
716
+ data: Date;
717
+ driverParam: string;
718
+ notNull: true;
719
+ hasDefault: true;
720
+ isPrimaryKey: false;
721
+ isAutoincrement: false;
722
+ hasRuntimeDefault: false;
723
+ enumValues: undefined;
724
+ baseColumn: never;
725
+ identity: undefined;
726
+ generated: undefined;
727
+ }, {}, {}>;
728
+ };
729
+ dialect: "pg";
730
+ }>;
731
+ readonly passkey: import("drizzle-orm/pg-core").PgTableWithColumns<{
732
+ name: "hf_passkey";
733
+ schema: undefined;
734
+ columns: {
735
+ id: import("drizzle-orm/pg-core").PgColumn<{
736
+ name: "id";
737
+ tableName: "hf_passkey";
738
+ dataType: "string";
739
+ columnType: "PgText";
740
+ data: string;
741
+ driverParam: string;
742
+ notNull: true;
743
+ hasDefault: false;
744
+ isPrimaryKey: true;
745
+ isAutoincrement: false;
746
+ hasRuntimeDefault: false;
747
+ enumValues: [string, ...string[]];
748
+ baseColumn: never;
749
+ identity: undefined;
750
+ generated: undefined;
751
+ }, {}, {}>;
752
+ name: import("drizzle-orm/pg-core").PgColumn<{
753
+ name: "name";
754
+ tableName: "hf_passkey";
755
+ dataType: "string";
756
+ columnType: "PgText";
757
+ data: string;
758
+ driverParam: string;
759
+ notNull: false;
760
+ hasDefault: false;
761
+ isPrimaryKey: false;
762
+ isAutoincrement: false;
763
+ hasRuntimeDefault: false;
764
+ enumValues: [string, ...string[]];
765
+ baseColumn: never;
766
+ identity: undefined;
767
+ generated: undefined;
768
+ }, {}, {}>;
769
+ publicKey: import("drizzle-orm/pg-core").PgColumn<{
770
+ name: "public_key";
771
+ tableName: "hf_passkey";
772
+ dataType: "string";
773
+ columnType: "PgText";
774
+ data: string;
775
+ driverParam: string;
776
+ notNull: true;
777
+ hasDefault: false;
778
+ isPrimaryKey: false;
779
+ isAutoincrement: false;
780
+ hasRuntimeDefault: false;
781
+ enumValues: [string, ...string[]];
782
+ baseColumn: never;
783
+ identity: undefined;
784
+ generated: undefined;
785
+ }, {}, {}>;
786
+ userId: import("drizzle-orm/pg-core").PgColumn<{
787
+ name: "user_id";
788
+ tableName: "hf_passkey";
789
+ dataType: "string";
790
+ columnType: "PgText";
791
+ data: string;
792
+ driverParam: string;
793
+ notNull: true;
794
+ hasDefault: false;
795
+ isPrimaryKey: false;
796
+ isAutoincrement: false;
797
+ hasRuntimeDefault: false;
798
+ enumValues: [string, ...string[]];
799
+ baseColumn: never;
800
+ identity: undefined;
801
+ generated: undefined;
802
+ }, {}, {}>;
803
+ credentialID: import("drizzle-orm/pg-core").PgColumn<{
804
+ name: "credential_id";
805
+ tableName: "hf_passkey";
806
+ dataType: "string";
807
+ columnType: "PgText";
808
+ data: string;
809
+ driverParam: string;
810
+ notNull: true;
811
+ hasDefault: false;
812
+ isPrimaryKey: false;
813
+ isAutoincrement: false;
814
+ hasRuntimeDefault: false;
815
+ enumValues: [string, ...string[]];
816
+ baseColumn: never;
817
+ identity: undefined;
818
+ generated: undefined;
819
+ }, {}, {}>;
820
+ counter: import("drizzle-orm/pg-core").PgColumn<{
821
+ name: "counter";
822
+ tableName: "hf_passkey";
823
+ dataType: "number";
824
+ columnType: "PgInteger";
825
+ data: number;
826
+ driverParam: string | number;
827
+ notNull: true;
828
+ hasDefault: false;
829
+ isPrimaryKey: false;
830
+ isAutoincrement: false;
831
+ hasRuntimeDefault: false;
832
+ enumValues: undefined;
833
+ baseColumn: never;
834
+ identity: undefined;
835
+ generated: undefined;
836
+ }, {}, {}>;
837
+ deviceType: import("drizzle-orm/pg-core").PgColumn<{
838
+ name: "device_type";
839
+ tableName: "hf_passkey";
840
+ dataType: "string";
841
+ columnType: "PgText";
842
+ data: string;
843
+ driverParam: string;
844
+ notNull: true;
845
+ hasDefault: false;
846
+ isPrimaryKey: false;
847
+ isAutoincrement: false;
848
+ hasRuntimeDefault: false;
849
+ enumValues: [string, ...string[]];
850
+ baseColumn: never;
851
+ identity: undefined;
852
+ generated: undefined;
853
+ }, {}, {}>;
854
+ backedUp: import("drizzle-orm/pg-core").PgColumn<{
855
+ name: "backed_up";
856
+ tableName: "hf_passkey";
857
+ dataType: "boolean";
858
+ columnType: "PgBoolean";
859
+ data: boolean;
860
+ driverParam: boolean;
861
+ notNull: true;
862
+ hasDefault: false;
863
+ isPrimaryKey: false;
864
+ isAutoincrement: false;
865
+ hasRuntimeDefault: false;
866
+ enumValues: undefined;
867
+ baseColumn: never;
868
+ identity: undefined;
869
+ generated: undefined;
870
+ }, {}, {}>;
871
+ transports: import("drizzle-orm/pg-core").PgColumn<{
872
+ name: "transports";
873
+ tableName: "hf_passkey";
874
+ dataType: "string";
875
+ columnType: "PgText";
876
+ data: string;
877
+ driverParam: string;
878
+ notNull: false;
879
+ hasDefault: false;
880
+ isPrimaryKey: false;
881
+ isAutoincrement: false;
882
+ hasRuntimeDefault: false;
883
+ enumValues: [string, ...string[]];
884
+ baseColumn: never;
885
+ identity: undefined;
886
+ generated: undefined;
887
+ }, {}, {}>;
888
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
889
+ name: "created_at";
890
+ tableName: "hf_passkey";
891
+ dataType: "date";
892
+ columnType: "PgTimestamp";
893
+ data: Date;
894
+ driverParam: string;
895
+ notNull: false;
896
+ hasDefault: true;
897
+ isPrimaryKey: false;
898
+ isAutoincrement: false;
899
+ hasRuntimeDefault: false;
900
+ enumValues: undefined;
901
+ baseColumn: never;
902
+ identity: undefined;
903
+ generated: undefined;
904
+ }, {}, {}>;
905
+ aaguid: import("drizzle-orm/pg-core").PgColumn<{
906
+ name: "aaguid";
907
+ tableName: "hf_passkey";
908
+ dataType: "string";
909
+ columnType: "PgText";
910
+ data: string;
911
+ driverParam: string;
912
+ notNull: false;
913
+ hasDefault: false;
914
+ isPrimaryKey: false;
915
+ isAutoincrement: false;
916
+ hasRuntimeDefault: false;
917
+ enumValues: [string, ...string[]];
918
+ baseColumn: never;
919
+ identity: undefined;
920
+ generated: undefined;
921
+ }, {}, {}>;
922
+ };
923
+ dialect: "pg";
924
+ }>;
925
+ readonly organization: import("drizzle-orm/pg-core").PgTableWithColumns<{
926
+ name: "hf_organization";
927
+ schema: undefined;
928
+ columns: {
929
+ id: import("drizzle-orm/pg-core").PgColumn<{
930
+ name: "id";
931
+ tableName: "hf_organization";
932
+ dataType: "string";
933
+ columnType: "PgText";
934
+ data: string;
935
+ driverParam: string;
936
+ notNull: true;
937
+ hasDefault: false;
938
+ isPrimaryKey: true;
939
+ isAutoincrement: false;
940
+ hasRuntimeDefault: false;
941
+ enumValues: [string, ...string[]];
942
+ baseColumn: never;
943
+ identity: undefined;
944
+ generated: undefined;
945
+ }, {}, {}>;
946
+ name: import("drizzle-orm/pg-core").PgColumn<{
947
+ name: "name";
948
+ tableName: "hf_organization";
949
+ dataType: "string";
950
+ columnType: "PgText";
951
+ data: string;
952
+ driverParam: string;
953
+ notNull: true;
954
+ hasDefault: false;
955
+ isPrimaryKey: false;
956
+ isAutoincrement: false;
957
+ hasRuntimeDefault: false;
958
+ enumValues: [string, ...string[]];
959
+ baseColumn: never;
960
+ identity: undefined;
961
+ generated: undefined;
962
+ }, {}, {}>;
963
+ slug: import("drizzle-orm/pg-core").PgColumn<{
964
+ name: "slug";
965
+ tableName: "hf_organization";
966
+ dataType: "string";
967
+ columnType: "PgText";
968
+ data: string;
969
+ driverParam: string;
970
+ notNull: true;
971
+ hasDefault: false;
972
+ isPrimaryKey: false;
973
+ isAutoincrement: false;
974
+ hasRuntimeDefault: false;
975
+ enumValues: [string, ...string[]];
976
+ baseColumn: never;
977
+ identity: undefined;
978
+ generated: undefined;
979
+ }, {}, {}>;
980
+ logo: import("drizzle-orm/pg-core").PgColumn<{
981
+ name: "logo";
982
+ tableName: "hf_organization";
983
+ dataType: "string";
984
+ columnType: "PgText";
985
+ data: string;
986
+ driverParam: string;
987
+ notNull: false;
988
+ hasDefault: false;
989
+ isPrimaryKey: false;
990
+ isAutoincrement: false;
991
+ hasRuntimeDefault: false;
992
+ enumValues: [string, ...string[]];
993
+ baseColumn: never;
994
+ identity: undefined;
995
+ generated: undefined;
996
+ }, {}, {}>;
997
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
998
+ name: "created_at";
999
+ tableName: "hf_organization";
1000
+ dataType: "date";
1001
+ columnType: "PgTimestamp";
1002
+ data: Date;
1003
+ driverParam: string;
1004
+ notNull: true;
1005
+ hasDefault: true;
1006
+ isPrimaryKey: false;
1007
+ isAutoincrement: false;
1008
+ hasRuntimeDefault: false;
1009
+ enumValues: undefined;
1010
+ baseColumn: never;
1011
+ identity: undefined;
1012
+ generated: undefined;
1013
+ }, {}, {}>;
1014
+ metadata: import("drizzle-orm/pg-core").PgColumn<{
1015
+ name: "metadata";
1016
+ tableName: "hf_organization";
1017
+ dataType: "string";
1018
+ columnType: "PgText";
1019
+ data: string;
1020
+ driverParam: string;
1021
+ notNull: false;
1022
+ hasDefault: false;
1023
+ isPrimaryKey: false;
1024
+ isAutoincrement: false;
1025
+ hasRuntimeDefault: false;
1026
+ enumValues: [string, ...string[]];
1027
+ baseColumn: never;
1028
+ identity: undefined;
1029
+ generated: undefined;
1030
+ }, {}, {}>;
1031
+ };
1032
+ dialect: "pg";
1033
+ }>;
1034
+ readonly member: import("drizzle-orm/pg-core").PgTableWithColumns<{
1035
+ name: "hf_member";
1036
+ schema: undefined;
1037
+ columns: {
1038
+ id: import("drizzle-orm/pg-core").PgColumn<{
1039
+ name: "id";
1040
+ tableName: "hf_member";
1041
+ dataType: "string";
1042
+ columnType: "PgText";
1043
+ data: string;
1044
+ driverParam: string;
1045
+ notNull: true;
1046
+ hasDefault: false;
1047
+ isPrimaryKey: true;
1048
+ isAutoincrement: false;
1049
+ hasRuntimeDefault: false;
1050
+ enumValues: [string, ...string[]];
1051
+ baseColumn: never;
1052
+ identity: undefined;
1053
+ generated: undefined;
1054
+ }, {}, {}>;
1055
+ organizationId: import("drizzle-orm/pg-core").PgColumn<{
1056
+ name: "organization_id";
1057
+ tableName: "hf_member";
1058
+ dataType: "string";
1059
+ columnType: "PgText";
1060
+ data: string;
1061
+ driverParam: string;
1062
+ notNull: true;
1063
+ hasDefault: false;
1064
+ isPrimaryKey: false;
1065
+ isAutoincrement: false;
1066
+ hasRuntimeDefault: false;
1067
+ enumValues: [string, ...string[]];
1068
+ baseColumn: never;
1069
+ identity: undefined;
1070
+ generated: undefined;
1071
+ }, {}, {}>;
1072
+ userId: import("drizzle-orm/pg-core").PgColumn<{
1073
+ name: "user_id";
1074
+ tableName: "hf_member";
1075
+ dataType: "string";
1076
+ columnType: "PgText";
1077
+ data: string;
1078
+ driverParam: string;
1079
+ notNull: true;
1080
+ hasDefault: false;
1081
+ isPrimaryKey: false;
1082
+ isAutoincrement: false;
1083
+ hasRuntimeDefault: false;
1084
+ enumValues: [string, ...string[]];
1085
+ baseColumn: never;
1086
+ identity: undefined;
1087
+ generated: undefined;
1088
+ }, {}, {}>;
1089
+ role: import("drizzle-orm/pg-core").PgColumn<{
1090
+ name: "role";
1091
+ tableName: "hf_member";
1092
+ dataType: "string";
1093
+ columnType: "PgText";
1094
+ data: string;
1095
+ driverParam: string;
1096
+ notNull: true;
1097
+ hasDefault: true;
1098
+ isPrimaryKey: false;
1099
+ isAutoincrement: false;
1100
+ hasRuntimeDefault: false;
1101
+ enumValues: [string, ...string[]];
1102
+ baseColumn: never;
1103
+ identity: undefined;
1104
+ generated: undefined;
1105
+ }, {}, {}>;
1106
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
1107
+ name: "created_at";
1108
+ tableName: "hf_member";
1109
+ dataType: "date";
1110
+ columnType: "PgTimestamp";
1111
+ data: Date;
1112
+ driverParam: string;
1113
+ notNull: true;
1114
+ hasDefault: true;
1115
+ isPrimaryKey: false;
1116
+ isAutoincrement: false;
1117
+ hasRuntimeDefault: false;
1118
+ enumValues: undefined;
1119
+ baseColumn: never;
1120
+ identity: undefined;
1121
+ generated: undefined;
1122
+ }, {}, {}>;
1123
+ };
1124
+ dialect: "pg";
1125
+ }>;
1126
+ readonly invitation: import("drizzle-orm/pg-core").PgTableWithColumns<{
1127
+ name: "hf_invitation";
1128
+ schema: undefined;
1129
+ columns: {
1130
+ id: import("drizzle-orm/pg-core").PgColumn<{
1131
+ name: "id";
1132
+ tableName: "hf_invitation";
1133
+ dataType: "string";
1134
+ columnType: "PgText";
1135
+ data: string;
1136
+ driverParam: string;
1137
+ notNull: true;
1138
+ hasDefault: false;
1139
+ isPrimaryKey: true;
1140
+ isAutoincrement: false;
1141
+ hasRuntimeDefault: false;
1142
+ enumValues: [string, ...string[]];
1143
+ baseColumn: never;
1144
+ identity: undefined;
1145
+ generated: undefined;
1146
+ }, {}, {}>;
1147
+ organizationId: import("drizzle-orm/pg-core").PgColumn<{
1148
+ name: "organization_id";
1149
+ tableName: "hf_invitation";
1150
+ dataType: "string";
1151
+ columnType: "PgText";
1152
+ data: string;
1153
+ driverParam: string;
1154
+ notNull: true;
1155
+ hasDefault: false;
1156
+ isPrimaryKey: false;
1157
+ isAutoincrement: false;
1158
+ hasRuntimeDefault: false;
1159
+ enumValues: [string, ...string[]];
1160
+ baseColumn: never;
1161
+ identity: undefined;
1162
+ generated: undefined;
1163
+ }, {}, {}>;
1164
+ email: import("drizzle-orm/pg-core").PgColumn<{
1165
+ name: "email";
1166
+ tableName: "hf_invitation";
1167
+ dataType: "string";
1168
+ columnType: "PgText";
1169
+ data: string;
1170
+ driverParam: string;
1171
+ notNull: true;
1172
+ hasDefault: false;
1173
+ isPrimaryKey: false;
1174
+ isAutoincrement: false;
1175
+ hasRuntimeDefault: false;
1176
+ enumValues: [string, ...string[]];
1177
+ baseColumn: never;
1178
+ identity: undefined;
1179
+ generated: undefined;
1180
+ }, {}, {}>;
1181
+ role: import("drizzle-orm/pg-core").PgColumn<{
1182
+ name: "role";
1183
+ tableName: "hf_invitation";
1184
+ dataType: "string";
1185
+ columnType: "PgText";
1186
+ data: string;
1187
+ driverParam: string;
1188
+ notNull: false;
1189
+ hasDefault: false;
1190
+ isPrimaryKey: false;
1191
+ isAutoincrement: false;
1192
+ hasRuntimeDefault: false;
1193
+ enumValues: [string, ...string[]];
1194
+ baseColumn: never;
1195
+ identity: undefined;
1196
+ generated: undefined;
1197
+ }, {}, {}>;
1198
+ status: import("drizzle-orm/pg-core").PgColumn<{
1199
+ name: "status";
1200
+ tableName: "hf_invitation";
1201
+ dataType: "string";
1202
+ columnType: "PgText";
1203
+ data: string;
1204
+ driverParam: string;
1205
+ notNull: true;
1206
+ hasDefault: true;
1207
+ isPrimaryKey: false;
1208
+ isAutoincrement: false;
1209
+ hasRuntimeDefault: false;
1210
+ enumValues: [string, ...string[]];
1211
+ baseColumn: never;
1212
+ identity: undefined;
1213
+ generated: undefined;
1214
+ }, {}, {}>;
1215
+ expiresAt: import("drizzle-orm/pg-core").PgColumn<{
1216
+ name: "expires_at";
1217
+ tableName: "hf_invitation";
1218
+ dataType: "date";
1219
+ columnType: "PgTimestamp";
1220
+ data: Date;
1221
+ driverParam: string;
1222
+ notNull: true;
1223
+ hasDefault: false;
1224
+ isPrimaryKey: false;
1225
+ isAutoincrement: false;
1226
+ hasRuntimeDefault: false;
1227
+ enumValues: undefined;
1228
+ baseColumn: never;
1229
+ identity: undefined;
1230
+ generated: undefined;
1231
+ }, {}, {}>;
1232
+ inviterId: import("drizzle-orm/pg-core").PgColumn<{
1233
+ name: "inviter_id";
1234
+ tableName: "hf_invitation";
1235
+ dataType: "string";
1236
+ columnType: "PgText";
1237
+ data: string;
1238
+ driverParam: string;
1239
+ notNull: true;
1240
+ hasDefault: false;
1241
+ isPrimaryKey: false;
1242
+ isAutoincrement: false;
1243
+ hasRuntimeDefault: false;
1244
+ enumValues: [string, ...string[]];
1245
+ baseColumn: never;
1246
+ identity: undefined;
1247
+ generated: undefined;
1248
+ }, {}, {}>;
1249
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
1250
+ name: "created_at";
1251
+ tableName: "hf_invitation";
1252
+ dataType: "date";
1253
+ columnType: "PgTimestamp";
1254
+ data: Date;
1255
+ driverParam: string;
1256
+ notNull: true;
1257
+ hasDefault: true;
1258
+ isPrimaryKey: false;
1259
+ isAutoincrement: false;
1260
+ hasRuntimeDefault: false;
1261
+ enumValues: undefined;
1262
+ baseColumn: never;
1263
+ identity: undefined;
1264
+ generated: undefined;
1265
+ }, {}, {}>;
1266
+ };
1267
+ dialect: "pg";
1268
+ }>;
1269
+ };
1270
+ export interface CreateAuthOptions {
1271
+ /** The web pool — 5 connections in the budget. Never the step pool, never the control pool. */
1272
+ pool: Pool;
1273
+ /** `sendVerificationOTP` is the one thing this package cannot supply for an app. */
1274
+ sendVerificationOTP: Parameters<typeof emailOTP>[0]["sendVerificationOTP"];
1275
+ baseURL?: string;
1276
+ secret?: string;
1277
+ trustedOrigins?: string[];
1278
+ /** Relying-party id and name for WebAuthn; defaults come from `baseURL` in better-auth. */
1279
+ rpID?: string;
1280
+ rpName?: string;
1281
+ origin?: string | null;
1282
+ }
1283
+ /**
1284
+ * The better-auth instance, wired to the seven `hf_*` tables chunk 2 created.
1285
+ *
1286
+ * `disableSignUp: true` on the OTP plugin is the shape of the whole product: there is no
1287
+ * self-serve path into an app. A user exists because `bootstrapAdmin` or an existing admin put
1288
+ * them there, and a code sent to an address with no `hf_user` row signs nobody in.
1289
+ *
1290
+ * `emailAndPassword` is left off entirely rather than configured off — the `password` column on
1291
+ * `hf_account` is better-auth's, not a supported credential here — and the only two ways to
1292
+ * hold a session are an emailed code and a passkey, which is exactly what `factor` records.
1293
+ */
1294
+ export declare function createAuth(options: CreateAuthOptions): import("better-auth").Auth<{
1295
+ database: (options: import("better-auth").BetterAuthOptions) => import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
1296
+ baseURL: string | undefined;
1297
+ secret: string | undefined;
1298
+ trustedOrigins: string[] | undefined;
1299
+ session: {
1300
+ additionalFields: {
1301
+ factor: {
1302
+ type: "string";
1303
+ required: false;
1304
+ input: false;
1305
+ defaultValue: string;
1306
+ };
1307
+ };
1308
+ };
1309
+ databaseHooks: {
1310
+ session: {
1311
+ create: {
1312
+ before: (session: {
1313
+ id: string;
1314
+ createdAt: Date;
1315
+ updatedAt: Date;
1316
+ userId: string;
1317
+ expiresAt: Date;
1318
+ token: string;
1319
+ ipAddress?: string | null | undefined;
1320
+ userAgent?: string | null | undefined;
1321
+ } & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | null) => Promise<{
1322
+ data: {
1323
+ factor: "code" | "passkey";
1324
+ id: string;
1325
+ createdAt: Date;
1326
+ updatedAt: Date;
1327
+ userId: string;
1328
+ expiresAt: Date;
1329
+ token: string;
1330
+ ipAddress?: string | null | undefined;
1331
+ userAgent?: string | null | undefined;
1332
+ };
1333
+ }>;
1334
+ };
1335
+ };
1336
+ };
1337
+ plugins: [{
1338
+ id: "email-otp";
1339
+ version: string;
1340
+ init(ctx: import("better-auth").AuthContext): {
1341
+ options: {
1342
+ emailVerification: {
1343
+ sendVerificationEmail(data: {
1344
+ user: import("better-auth").User;
1345
+ url: string;
1346
+ token: string;
1347
+ }, request: Request | undefined): Promise<void>;
1348
+ };
1349
+ };
1350
+ } | undefined;
1351
+ endpoints: {
1352
+ sendVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/send-verification-otp", {
1353
+ method: "POST";
1354
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>[];
1355
+ body: import("better-auth").ZodObject<{
1356
+ email: import("better-auth").ZodString;
1357
+ type: import("better-auth").ZodEnum<{
1358
+ "sign-in": "sign-in";
1359
+ "change-email": "change-email";
1360
+ "email-verification": "email-verification";
1361
+ "forget-password": "forget-password";
1362
+ }>;
1363
+ }, import("zod/v4/core").$strip>;
1364
+ metadata: {
1365
+ openapi: {
1366
+ operationId: string;
1367
+ description: string;
1368
+ responses: {
1369
+ 200: {
1370
+ description: string;
1371
+ content: {
1372
+ "application/json": {
1373
+ schema: {
1374
+ type: "object";
1375
+ properties: {
1376
+ success: {
1377
+ type: string;
1378
+ };
1379
+ };
1380
+ };
1381
+ };
1382
+ };
1383
+ };
1384
+ };
1385
+ };
1386
+ };
1387
+ }, {
1388
+ success: boolean;
1389
+ }>;
1390
+ createVerificationOTP: import("better-auth").StrictEndpoint<string, {
1391
+ method: "POST";
1392
+ body: import("better-auth").ZodObject<{
1393
+ email: import("better-auth").ZodString;
1394
+ type: import("better-auth").ZodEnum<{
1395
+ "sign-in": "sign-in";
1396
+ "change-email": "change-email";
1397
+ "email-verification": "email-verification";
1398
+ "forget-password": "forget-password";
1399
+ }>;
1400
+ }, import("zod/v4/core").$strip>;
1401
+ metadata: {
1402
+ openapi: {
1403
+ operationId: string;
1404
+ description: string;
1405
+ responses: {
1406
+ 200: {
1407
+ description: string;
1408
+ content: {
1409
+ "application/json": {
1410
+ schema: {
1411
+ type: "string";
1412
+ };
1413
+ };
1414
+ };
1415
+ };
1416
+ };
1417
+ };
1418
+ };
1419
+ }, string>;
1420
+ getVerificationOTP: import("better-auth").StrictEndpoint<string, {
1421
+ method: "GET";
1422
+ query: import("better-auth").ZodObject<{
1423
+ email: import("better-auth").ZodString;
1424
+ type: import("better-auth").ZodEnum<{
1425
+ "sign-in": "sign-in";
1426
+ "change-email": "change-email";
1427
+ "email-verification": "email-verification";
1428
+ "forget-password": "forget-password";
1429
+ }>;
1430
+ }, import("zod/v4/core").$strip>;
1431
+ metadata: {
1432
+ openapi: {
1433
+ operationId: string;
1434
+ description: string;
1435
+ responses: {
1436
+ "200": {
1437
+ description: string;
1438
+ content: {
1439
+ "application/json": {
1440
+ schema: {
1441
+ type: "object";
1442
+ properties: {
1443
+ otp: {
1444
+ type: string;
1445
+ nullable: boolean;
1446
+ description: string;
1447
+ };
1448
+ };
1449
+ required: string[];
1450
+ };
1451
+ };
1452
+ };
1453
+ };
1454
+ };
1455
+ };
1456
+ };
1457
+ }, {
1458
+ otp: null;
1459
+ } | {
1460
+ otp: string;
1461
+ }>;
1462
+ checkVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/check-verification-otp", {
1463
+ method: "POST";
1464
+ body: import("better-auth").ZodObject<{
1465
+ email: import("better-auth").ZodString;
1466
+ type: import("better-auth").ZodEnum<{
1467
+ "sign-in": "sign-in";
1468
+ "change-email": "change-email";
1469
+ "email-verification": "email-verification";
1470
+ "forget-password": "forget-password";
1471
+ }>;
1472
+ otp: import("better-auth").ZodString;
1473
+ }, import("zod/v4/core").$strip>;
1474
+ metadata: {
1475
+ openapi: {
1476
+ operationId: string;
1477
+ description: string;
1478
+ responses: {
1479
+ 200: {
1480
+ description: string;
1481
+ content: {
1482
+ "application/json": {
1483
+ schema: {
1484
+ type: "object";
1485
+ properties: {
1486
+ success: {
1487
+ type: string;
1488
+ };
1489
+ };
1490
+ };
1491
+ };
1492
+ };
1493
+ };
1494
+ };
1495
+ };
1496
+ };
1497
+ }, {
1498
+ success: boolean;
1499
+ }>;
1500
+ verifyEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/verify-email", {
1501
+ method: "POST";
1502
+ body: import("better-auth").ZodObject<{
1503
+ email: import("better-auth").ZodString;
1504
+ otp: import("better-auth").ZodString;
1505
+ }, import("zod/v4/core").$strip>;
1506
+ metadata: {
1507
+ openapi: {
1508
+ description: string;
1509
+ responses: {
1510
+ 200: {
1511
+ description: string;
1512
+ content: {
1513
+ "application/json": {
1514
+ schema: {
1515
+ type: "object";
1516
+ properties: {
1517
+ status: {
1518
+ type: string;
1519
+ description: string;
1520
+ enum: boolean[];
1521
+ };
1522
+ token: {
1523
+ type: string;
1524
+ nullable: boolean;
1525
+ description: string;
1526
+ };
1527
+ user: {
1528
+ $ref: string;
1529
+ };
1530
+ };
1531
+ required: string[];
1532
+ };
1533
+ };
1534
+ };
1535
+ };
1536
+ };
1537
+ };
1538
+ };
1539
+ }, {
1540
+ status: boolean;
1541
+ token: string;
1542
+ user: {
1543
+ id: string;
1544
+ createdAt: Date;
1545
+ updatedAt: Date;
1546
+ email: string;
1547
+ emailVerified: boolean;
1548
+ name: string;
1549
+ image?: string | null | undefined;
1550
+ } & Record<string, any>;
1551
+ } | {
1552
+ status: boolean;
1553
+ token: null;
1554
+ user: {
1555
+ id: string;
1556
+ createdAt: Date;
1557
+ updatedAt: Date;
1558
+ email: string;
1559
+ emailVerified: boolean;
1560
+ name: string;
1561
+ image?: string | null | undefined;
1562
+ } & Record<string, any>;
1563
+ }>;
1564
+ signInEmailOTP: import("better-auth").StrictEndpoint<"/sign-in/email-otp", {
1565
+ method: "POST";
1566
+ body: import("better-auth").ZodIntersection<import("better-auth").ZodObject<{
1567
+ email: import("better-auth").ZodString;
1568
+ otp: import("better-auth").ZodString;
1569
+ name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1570
+ image: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1571
+ }, import("zod/v4/core").$strip>, import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
1572
+ metadata: {
1573
+ openapi: {
1574
+ operationId: string;
1575
+ description: string;
1576
+ responses: {
1577
+ 200: {
1578
+ description: string;
1579
+ content: {
1580
+ "application/json": {
1581
+ schema: {
1582
+ type: "object";
1583
+ properties: {
1584
+ token: {
1585
+ type: string;
1586
+ description: string;
1587
+ };
1588
+ user: {
1589
+ $ref: string;
1590
+ };
1591
+ };
1592
+ required: string[];
1593
+ };
1594
+ };
1595
+ };
1596
+ };
1597
+ };
1598
+ };
1599
+ };
1600
+ }, {
1601
+ token: string;
1602
+ user: {
1603
+ id: string;
1604
+ createdAt: Date;
1605
+ updatedAt: Date;
1606
+ email: string;
1607
+ emailVerified: boolean;
1608
+ name: string;
1609
+ image?: string | null | undefined;
1610
+ };
1611
+ }>;
1612
+ requestPasswordResetEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-password-reset", {
1613
+ method: "POST";
1614
+ body: import("better-auth").ZodObject<{
1615
+ email: import("better-auth").ZodString;
1616
+ }, import("zod/v4/core").$strip>;
1617
+ metadata: {
1618
+ openapi: {
1619
+ operationId: string;
1620
+ description: string;
1621
+ responses: {
1622
+ 200: {
1623
+ description: string;
1624
+ content: {
1625
+ "application/json": {
1626
+ schema: {
1627
+ type: "object";
1628
+ properties: {
1629
+ success: {
1630
+ type: string;
1631
+ description: string;
1632
+ };
1633
+ };
1634
+ };
1635
+ };
1636
+ };
1637
+ };
1638
+ };
1639
+ };
1640
+ };
1641
+ }, {
1642
+ success: boolean;
1643
+ }>;
1644
+ forgetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/forget-password/email-otp", {
1645
+ method: "POST";
1646
+ body: import("better-auth").ZodObject<{
1647
+ email: import("better-auth").ZodString;
1648
+ }, import("zod/v4/core").$strip>;
1649
+ metadata: {
1650
+ openapi: {
1651
+ operationId: string;
1652
+ description: string;
1653
+ responses: {
1654
+ 200: {
1655
+ description: string;
1656
+ content: {
1657
+ "application/json": {
1658
+ schema: {
1659
+ type: "object";
1660
+ properties: {
1661
+ success: {
1662
+ type: string;
1663
+ description: string;
1664
+ };
1665
+ };
1666
+ };
1667
+ };
1668
+ };
1669
+ };
1670
+ };
1671
+ };
1672
+ };
1673
+ }, {
1674
+ success: boolean;
1675
+ }>;
1676
+ resetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/reset-password", {
1677
+ method: "POST";
1678
+ body: import("better-auth").ZodObject<{
1679
+ email: import("better-auth").ZodString;
1680
+ otp: import("better-auth").ZodString;
1681
+ password: import("better-auth").ZodString;
1682
+ }, import("zod/v4/core").$strip>;
1683
+ metadata: {
1684
+ openapi: {
1685
+ operationId: string;
1686
+ description: string;
1687
+ responses: {
1688
+ 200: {
1689
+ description: string;
1690
+ content: {
1691
+ "application/json": {
1692
+ schema: {
1693
+ type: "object";
1694
+ properties: {
1695
+ success: {
1696
+ type: string;
1697
+ };
1698
+ };
1699
+ };
1700
+ };
1701
+ };
1702
+ };
1703
+ };
1704
+ };
1705
+ };
1706
+ }, {
1707
+ success: boolean;
1708
+ }>;
1709
+ requestEmailChangeEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-email-change", {
1710
+ method: "POST";
1711
+ body: import("better-auth").ZodObject<{
1712
+ newEmail: import("better-auth").ZodString;
1713
+ otp: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1714
+ }, import("zod/v4/core").$strip>;
1715
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1716
+ session: {
1717
+ session: Record<string, any> & {
1718
+ id: string;
1719
+ createdAt: Date;
1720
+ updatedAt: Date;
1721
+ userId: string;
1722
+ expiresAt: Date;
1723
+ token: string;
1724
+ ipAddress?: string | null | undefined;
1725
+ userAgent?: string | null | undefined;
1726
+ };
1727
+ user: Record<string, any> & {
1728
+ id: string;
1729
+ createdAt: Date;
1730
+ updatedAt: Date;
1731
+ email: string;
1732
+ emailVerified: boolean;
1733
+ name: string;
1734
+ image?: string | null | undefined;
1735
+ };
1736
+ };
1737
+ }>>[];
1738
+ metadata: {
1739
+ openapi: {
1740
+ operationId: string;
1741
+ description: string;
1742
+ responses: {
1743
+ 200: {
1744
+ description: string;
1745
+ content: {
1746
+ "application/json": {
1747
+ schema: {
1748
+ type: "object";
1749
+ properties: {
1750
+ success: {
1751
+ type: string;
1752
+ };
1753
+ };
1754
+ };
1755
+ };
1756
+ };
1757
+ };
1758
+ };
1759
+ };
1760
+ };
1761
+ }, {
1762
+ success: boolean;
1763
+ }>;
1764
+ changeEmailEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/change-email", {
1765
+ method: "POST";
1766
+ body: import("better-auth").ZodObject<{
1767
+ newEmail: import("better-auth").ZodString;
1768
+ otp: import("better-auth").ZodString;
1769
+ }, import("zod/v4/core").$strip>;
1770
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1771
+ session: {
1772
+ session: Record<string, any> & {
1773
+ id: string;
1774
+ createdAt: Date;
1775
+ updatedAt: Date;
1776
+ userId: string;
1777
+ expiresAt: Date;
1778
+ token: string;
1779
+ ipAddress?: string | null | undefined;
1780
+ userAgent?: string | null | undefined;
1781
+ };
1782
+ user: Record<string, any> & {
1783
+ id: string;
1784
+ createdAt: Date;
1785
+ updatedAt: Date;
1786
+ email: string;
1787
+ emailVerified: boolean;
1788
+ name: string;
1789
+ image?: string | null | undefined;
1790
+ };
1791
+ };
1792
+ }>>[];
1793
+ metadata: {
1794
+ openapi: {
1795
+ operationId: string;
1796
+ description: string;
1797
+ responses: {
1798
+ 200: {
1799
+ description: string;
1800
+ content: {
1801
+ "application/json": {
1802
+ schema: {
1803
+ type: "object";
1804
+ properties: {
1805
+ success: {
1806
+ type: string;
1807
+ };
1808
+ };
1809
+ };
1810
+ };
1811
+ };
1812
+ };
1813
+ };
1814
+ };
1815
+ };
1816
+ }, {
1817
+ success: boolean;
1818
+ }>;
1819
+ };
1820
+ hooks: {
1821
+ after: {
1822
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
1823
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
1824
+ }[];
1825
+ };
1826
+ rateLimit: ({
1827
+ pathMatcher(path: string): path is "/email-otp/send-verification-otp";
1828
+ window: number;
1829
+ max: number;
1830
+ } | {
1831
+ pathMatcher(path: string): path is "/email-otp/check-verification-otp";
1832
+ window: number;
1833
+ max: number;
1834
+ } | {
1835
+ pathMatcher(path: string): path is "/email-otp/verify-email";
1836
+ window: number;
1837
+ max: number;
1838
+ } | {
1839
+ pathMatcher(path: string): path is "/sign-in/email-otp";
1840
+ window: number;
1841
+ max: number;
1842
+ } | {
1843
+ pathMatcher(path: string): path is "/email-otp/request-password-reset";
1844
+ window: number;
1845
+ max: number;
1846
+ } | {
1847
+ pathMatcher(path: string): path is "/email-otp/reset-password";
1848
+ window: number;
1849
+ max: number;
1850
+ } | {
1851
+ pathMatcher(path: string): path is "/forget-password/email-otp";
1852
+ window: number;
1853
+ max: number;
1854
+ } | {
1855
+ pathMatcher(path: string): path is "/email-otp/request-email-change";
1856
+ window: number;
1857
+ max: number;
1858
+ } | {
1859
+ pathMatcher(path: string): path is "/email-otp/change-email";
1860
+ window: number;
1861
+ max: number;
1862
+ })[];
1863
+ options: import("better-auth/plugins").EmailOTPOptions;
1864
+ $ERROR_CODES: {
1865
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
1866
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
1867
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
1868
+ };
1869
+ }, {
1870
+ id: "passkey";
1871
+ version: string;
1872
+ endpoints: {
1873
+ generatePasskeyRegistrationOptions: import("better-auth").StrictEndpoint<"/passkey/generate-register-options", {
1874
+ method: "GET";
1875
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1876
+ session: {
1877
+ session: Record<string, any> & {
1878
+ id: string;
1879
+ createdAt: Date;
1880
+ updatedAt: Date;
1881
+ userId: string;
1882
+ expiresAt: Date;
1883
+ token: string;
1884
+ ipAddress?: string | null | undefined;
1885
+ userAgent?: string | null | undefined;
1886
+ };
1887
+ user: Record<string, any> & {
1888
+ id: string;
1889
+ createdAt: Date;
1890
+ updatedAt: Date;
1891
+ email: string;
1892
+ emailVerified: boolean;
1893
+ name: string;
1894
+ image?: string | null | undefined;
1895
+ };
1896
+ };
1897
+ }>>[];
1898
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
1899
+ authenticatorAttachment: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
1900
+ platform: "platform";
1901
+ "cross-platform": "cross-platform";
1902
+ }>>;
1903
+ name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1904
+ context: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1905
+ }, import("zod/v4/core").$strip>>;
1906
+ metadata: {
1907
+ openapi: {
1908
+ operationId: string;
1909
+ description: string;
1910
+ parameters: import("better-auth").OpenAPIParameter[];
1911
+ responses: {
1912
+ 200: {
1913
+ description: string;
1914
+ content: {
1915
+ "application/json": {
1916
+ schema: {
1917
+ type: "object";
1918
+ properties: {
1919
+ challenge: {
1920
+ type: string;
1921
+ };
1922
+ rp: {
1923
+ type: string;
1924
+ properties: {
1925
+ name: {
1926
+ type: string;
1927
+ };
1928
+ id: {
1929
+ type: string;
1930
+ };
1931
+ };
1932
+ };
1933
+ user: {
1934
+ type: string;
1935
+ properties: {
1936
+ id: {
1937
+ type: string;
1938
+ };
1939
+ name: {
1940
+ type: string;
1941
+ };
1942
+ displayName: {
1943
+ type: string;
1944
+ };
1945
+ };
1946
+ };
1947
+ pubKeyCredParams: {
1948
+ type: string;
1949
+ items: {
1950
+ type: string;
1951
+ properties: {
1952
+ type: {
1953
+ type: string;
1954
+ };
1955
+ alg: {
1956
+ type: string;
1957
+ };
1958
+ };
1959
+ };
1960
+ };
1961
+ timeout: {
1962
+ type: string;
1963
+ };
1964
+ excludeCredentials: {
1965
+ type: string;
1966
+ items: {
1967
+ type: string;
1968
+ properties: {
1969
+ id: {
1970
+ type: string;
1971
+ };
1972
+ type: {
1973
+ type: string;
1974
+ };
1975
+ transports: {
1976
+ type: string;
1977
+ items: {
1978
+ type: string;
1979
+ };
1980
+ };
1981
+ };
1982
+ };
1983
+ };
1984
+ authenticatorSelection: {
1985
+ type: string;
1986
+ properties: {
1987
+ authenticatorAttachment: {
1988
+ type: string;
1989
+ };
1990
+ requireResidentKey: {
1991
+ type: string;
1992
+ };
1993
+ userVerification: {
1994
+ type: string;
1995
+ };
1996
+ };
1997
+ };
1998
+ attestation: {
1999
+ type: string;
2000
+ };
2001
+ extensions: {
2002
+ type: string;
2003
+ };
2004
+ };
2005
+ };
2006
+ };
2007
+ };
2008
+ };
2009
+ };
2010
+ };
2011
+ };
2012
+ }, import("@simplewebauthn/server").PublicKeyCredentialCreationOptionsJSON>;
2013
+ generatePasskeyAuthenticationOptions: import("better-auth").StrictEndpoint<"/passkey/generate-authenticate-options", {
2014
+ method: "GET";
2015
+ metadata: {
2016
+ openapi: {
2017
+ operationId: string;
2018
+ description: string;
2019
+ responses: {
2020
+ 200: {
2021
+ description: string;
2022
+ content: {
2023
+ "application/json": {
2024
+ schema: {
2025
+ type: "object";
2026
+ properties: {
2027
+ challenge: {
2028
+ type: string;
2029
+ };
2030
+ rp: {
2031
+ type: string;
2032
+ properties: {
2033
+ name: {
2034
+ type: string;
2035
+ };
2036
+ id: {
2037
+ type: string;
2038
+ };
2039
+ };
2040
+ };
2041
+ user: {
2042
+ type: string;
2043
+ properties: {
2044
+ id: {
2045
+ type: string;
2046
+ };
2047
+ name: {
2048
+ type: string;
2049
+ };
2050
+ displayName: {
2051
+ type: string;
2052
+ };
2053
+ };
2054
+ };
2055
+ timeout: {
2056
+ type: string;
2057
+ };
2058
+ allowCredentials: {
2059
+ type: string;
2060
+ items: {
2061
+ type: string;
2062
+ properties: {
2063
+ id: {
2064
+ type: string;
2065
+ };
2066
+ type: {
2067
+ type: string;
2068
+ };
2069
+ transports: {
2070
+ type: string;
2071
+ items: {
2072
+ type: string;
2073
+ };
2074
+ };
2075
+ };
2076
+ };
2077
+ };
2078
+ userVerification: {
2079
+ type: string;
2080
+ };
2081
+ authenticatorSelection: {
2082
+ type: string;
2083
+ properties: {
2084
+ authenticatorAttachment: {
2085
+ type: string;
2086
+ };
2087
+ requireResidentKey: {
2088
+ type: string;
2089
+ };
2090
+ userVerification: {
2091
+ type: string;
2092
+ };
2093
+ };
2094
+ };
2095
+ extensions: {
2096
+ type: string;
2097
+ };
2098
+ };
2099
+ };
2100
+ };
2101
+ };
2102
+ };
2103
+ };
2104
+ };
2105
+ };
2106
+ }, import("@simplewebauthn/server").PublicKeyCredentialRequestOptionsJSON>;
2107
+ verifyPasskeyRegistration: import("better-auth").StrictEndpoint<"/passkey/verify-registration", {
2108
+ method: "POST";
2109
+ body: import("better-auth").ZodObject<{
2110
+ response: import("better-auth").ZodAny;
2111
+ name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2112
+ createSession: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
2113
+ }, import("zod/v4/core").$strip>;
2114
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2115
+ session: {
2116
+ session: Record<string, any> & {
2117
+ id: string;
2118
+ createdAt: Date;
2119
+ updatedAt: Date;
2120
+ userId: string;
2121
+ expiresAt: Date;
2122
+ token: string;
2123
+ ipAddress?: string | null | undefined;
2124
+ userAgent?: string | null | undefined;
2125
+ };
2126
+ user: Record<string, any> & {
2127
+ id: string;
2128
+ createdAt: Date;
2129
+ updatedAt: Date;
2130
+ email: string;
2131
+ emailVerified: boolean;
2132
+ name: string;
2133
+ image?: string | null | undefined;
2134
+ };
2135
+ };
2136
+ }>>[];
2137
+ metadata: {
2138
+ openapi: {
2139
+ operationId: string;
2140
+ description: string;
2141
+ responses: {
2142
+ 200: {
2143
+ description: string;
2144
+ content: {
2145
+ "application/json": {
2146
+ schema: {
2147
+ readonly type: "object";
2148
+ readonly allOf: readonly [{
2149
+ readonly $ref: "#/components/schemas/Passkey";
2150
+ }, {
2151
+ readonly type: "object";
2152
+ readonly properties: {
2153
+ readonly session: {
2154
+ readonly $ref: "#/components/schemas/Session";
2155
+ };
2156
+ readonly user: {
2157
+ readonly $ref: "#/components/schemas/User";
2158
+ };
2159
+ };
2160
+ }];
2161
+ };
2162
+ };
2163
+ };
2164
+ };
2165
+ 400: {
2166
+ description: string;
2167
+ };
2168
+ };
2169
+ };
2170
+ };
2171
+ }, import("@better-auth/passkey").Passkey>;
2172
+ verifyPasskeyAuthentication: import("better-auth").StrictEndpoint<"/passkey/verify-authentication", {
2173
+ method: "POST";
2174
+ body: import("better-auth").ZodObject<{
2175
+ response: import("better-auth").ZodRecord<import("better-auth").ZodAny, import("better-auth").ZodAny>;
2176
+ }, import("zod/v4/core").$strip>;
2177
+ metadata: {
2178
+ openapi: {
2179
+ operationId: string;
2180
+ description: string;
2181
+ responses: {
2182
+ 200: {
2183
+ description: string;
2184
+ content: {
2185
+ "application/json": {
2186
+ schema: {
2187
+ type: "object";
2188
+ properties: {
2189
+ session: {
2190
+ $ref: string;
2191
+ };
2192
+ user: {
2193
+ $ref: string;
2194
+ };
2195
+ };
2196
+ };
2197
+ };
2198
+ };
2199
+ };
2200
+ };
2201
+ };
2202
+ $Infer: {
2203
+ body: {
2204
+ response: import("@simplewebauthn/server").AuthenticationResponseJSON;
2205
+ };
2206
+ };
2207
+ };
2208
+ }, {
2209
+ session: {
2210
+ id: string;
2211
+ createdAt: Date;
2212
+ updatedAt: Date;
2213
+ userId: string;
2214
+ expiresAt: Date;
2215
+ token: string;
2216
+ ipAddress?: string | null | undefined;
2217
+ userAgent?: string | null | undefined;
2218
+ };
2219
+ user: {
2220
+ id: string;
2221
+ createdAt: Date;
2222
+ updatedAt: Date;
2223
+ email: string;
2224
+ emailVerified: boolean;
2225
+ name: string;
2226
+ image?: string | null | undefined;
2227
+ };
2228
+ }>;
2229
+ listPasskeys: import("better-auth").StrictEndpoint<"/passkey/list-user-passkeys", {
2230
+ method: "GET";
2231
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2232
+ session: {
2233
+ session: Record<string, any> & {
2234
+ id: string;
2235
+ createdAt: Date;
2236
+ updatedAt: Date;
2237
+ userId: string;
2238
+ expiresAt: Date;
2239
+ token: string;
2240
+ ipAddress?: string | null | undefined;
2241
+ userAgent?: string | null | undefined;
2242
+ };
2243
+ user: Record<string, any> & {
2244
+ id: string;
2245
+ createdAt: Date;
2246
+ updatedAt: Date;
2247
+ email: string;
2248
+ emailVerified: boolean;
2249
+ name: string;
2250
+ image?: string | null | undefined;
2251
+ };
2252
+ };
2253
+ }>>[];
2254
+ metadata: {
2255
+ openapi: {
2256
+ description: string;
2257
+ responses: {
2258
+ "200": {
2259
+ description: string;
2260
+ content: {
2261
+ "application/json": {
2262
+ schema: {
2263
+ type: "array";
2264
+ items: {
2265
+ $ref: string;
2266
+ required: string[];
2267
+ };
2268
+ description: string;
2269
+ };
2270
+ };
2271
+ };
2272
+ };
2273
+ };
2274
+ };
2275
+ };
2276
+ }, import("@better-auth/passkey").Passkey[]>;
2277
+ deletePasskey: import("better-auth").StrictEndpoint<"/passkey/delete-passkey", {
2278
+ method: "POST";
2279
+ body: import("better-auth").ZodObject<{
2280
+ id: import("better-auth").ZodString;
2281
+ }, import("zod/v4/core").$strip>;
2282
+ use: (import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2283
+ session: {
2284
+ session: Record<string, any> & {
2285
+ id: string;
2286
+ createdAt: Date;
2287
+ updatedAt: Date;
2288
+ userId: string;
2289
+ expiresAt: Date;
2290
+ token: string;
2291
+ ipAddress?: string | null | undefined;
2292
+ userAgent?: string | null | undefined;
2293
+ };
2294
+ user: Record<string, any> & {
2295
+ id: string;
2296
+ createdAt: Date;
2297
+ updatedAt: Date;
2298
+ email: string;
2299
+ emailVerified: boolean;
2300
+ name: string;
2301
+ image?: string | null | undefined;
2302
+ };
2303
+ };
2304
+ }>> | import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2305
+ verifiedResource: {};
2306
+ }>>)[];
2307
+ metadata: {
2308
+ openapi: {
2309
+ description: string;
2310
+ responses: {
2311
+ "200": {
2312
+ description: string;
2313
+ content: {
2314
+ "application/json": {
2315
+ schema: {
2316
+ type: "object";
2317
+ properties: {
2318
+ status: {
2319
+ type: string;
2320
+ description: string;
2321
+ };
2322
+ };
2323
+ required: string[];
2324
+ };
2325
+ };
2326
+ };
2327
+ };
2328
+ };
2329
+ };
2330
+ };
2331
+ }, {
2332
+ status: boolean;
2333
+ }>;
2334
+ updatePasskey: import("better-auth").StrictEndpoint<"/passkey/update-passkey", {
2335
+ method: "POST";
2336
+ body: import("better-auth").ZodObject<{
2337
+ id: import("better-auth").ZodString;
2338
+ name: import("better-auth").ZodString;
2339
+ }, import("zod/v4/core").$strip>;
2340
+ use: (import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2341
+ session: {
2342
+ session: Record<string, any> & {
2343
+ id: string;
2344
+ createdAt: Date;
2345
+ updatedAt: Date;
2346
+ userId: string;
2347
+ expiresAt: Date;
2348
+ token: string;
2349
+ ipAddress?: string | null | undefined;
2350
+ userAgent?: string | null | undefined;
2351
+ };
2352
+ user: Record<string, any> & {
2353
+ id: string;
2354
+ createdAt: Date;
2355
+ updatedAt: Date;
2356
+ email: string;
2357
+ emailVerified: boolean;
2358
+ name: string;
2359
+ image?: string | null | undefined;
2360
+ };
2361
+ };
2362
+ }>> | import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2363
+ verifiedResource: {};
2364
+ }>>)[];
2365
+ metadata: {
2366
+ openapi: {
2367
+ description: string;
2368
+ responses: {
2369
+ "200": {
2370
+ description: string;
2371
+ content: {
2372
+ "application/json": {
2373
+ schema: {
2374
+ type: "object";
2375
+ properties: {
2376
+ passkey: {
2377
+ $ref: string;
2378
+ };
2379
+ };
2380
+ required: string[];
2381
+ };
2382
+ };
2383
+ };
2384
+ };
2385
+ };
2386
+ };
2387
+ };
2388
+ }, {
2389
+ passkey: import("@better-auth/passkey").Passkey;
2390
+ }>;
2391
+ };
2392
+ schema: {
2393
+ passkey: {
2394
+ fields: {
2395
+ name: {
2396
+ type: "string";
2397
+ required: false;
2398
+ };
2399
+ publicKey: {
2400
+ type: "string";
2401
+ required: true;
2402
+ };
2403
+ userId: {
2404
+ type: "string";
2405
+ references: {
2406
+ model: string;
2407
+ field: string;
2408
+ };
2409
+ required: true;
2410
+ index: true;
2411
+ };
2412
+ credentialID: {
2413
+ type: "string";
2414
+ required: true;
2415
+ index: true;
2416
+ };
2417
+ counter: {
2418
+ type: "number";
2419
+ required: true;
2420
+ };
2421
+ deviceType: {
2422
+ type: "string";
2423
+ required: true;
2424
+ };
2425
+ backedUp: {
2426
+ type: "boolean";
2427
+ required: true;
2428
+ };
2429
+ transports: {
2430
+ type: "string";
2431
+ required: false;
2432
+ };
2433
+ createdAt: {
2434
+ type: "date";
2435
+ required: false;
2436
+ };
2437
+ aaguid: {
2438
+ type: "string";
2439
+ required: false;
2440
+ };
2441
+ };
2442
+ };
2443
+ };
2444
+ $ERROR_CODES: {
2445
+ CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
2446
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
2447
+ FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
2448
+ PASSKEY_NOT_FOUND: import("better-auth").RawError<"PASSKEY_NOT_FOUND">;
2449
+ AUTHENTICATION_FAILED: import("better-auth").RawError<"AUTHENTICATION_FAILED">;
2450
+ UNABLE_TO_CREATE_SESSION: import("better-auth").RawError<"UNABLE_TO_CREATE_SESSION">;
2451
+ USER_NOT_FOUND: import("better-auth").RawError<"USER_NOT_FOUND">;
2452
+ FAILED_TO_UPDATE_PASSKEY: import("better-auth").RawError<"FAILED_TO_UPDATE_PASSKEY">;
2453
+ PREVIOUSLY_REGISTERED: import("better-auth").RawError<"PREVIOUSLY_REGISTERED">;
2454
+ REGISTRATION_CANCELLED: import("better-auth").RawError<"REGISTRATION_CANCELLED">;
2455
+ AUTH_CANCELLED: import("better-auth").RawError<"AUTH_CANCELLED">;
2456
+ UNKNOWN_ERROR: import("better-auth").RawError<"UNKNOWN_ERROR">;
2457
+ SESSION_REQUIRED: import("better-auth").RawError<"SESSION_REQUIRED">;
2458
+ RESOLVE_USER_REQUIRED: import("better-auth").RawError<"RESOLVE_USER_REQUIRED">;
2459
+ RESOLVED_USER_INVALID: import("better-auth").RawError<"RESOLVED_USER_INVALID">;
2460
+ };
2461
+ options: import("@better-auth/passkey").PasskeyOptions | undefined;
2462
+ }, {
2463
+ id: "admin";
2464
+ version: string;
2465
+ init(): {
2466
+ options: {
2467
+ databaseHooks: {
2468
+ user: {
2469
+ create: {
2470
+ before(user: {
2471
+ id: string;
2472
+ createdAt: Date;
2473
+ updatedAt: Date;
2474
+ email: string;
2475
+ emailVerified: boolean;
2476
+ name: string;
2477
+ image?: string | null | undefined;
2478
+ } & Record<string, unknown>): Promise<{
2479
+ data: {
2480
+ id: string;
2481
+ createdAt: Date;
2482
+ updatedAt: Date;
2483
+ email: string;
2484
+ emailVerified: boolean;
2485
+ name: string;
2486
+ image?: string | null | undefined;
2487
+ role: string;
2488
+ };
2489
+ }>;
2490
+ };
2491
+ };
2492
+ session: {
2493
+ create: {
2494
+ before(session: {
2495
+ id: string;
2496
+ createdAt: Date;
2497
+ updatedAt: Date;
2498
+ userId: string;
2499
+ expiresAt: Date;
2500
+ token: string;
2501
+ ipAddress?: string | null | undefined;
2502
+ userAgent?: string | null | undefined;
2503
+ } & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | null): Promise<void>;
2504
+ };
2505
+ };
2506
+ };
2507
+ };
2508
+ };
2509
+ hooks: {
2510
+ after: {
2511
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
2512
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>>;
2513
+ }[];
2514
+ };
2515
+ endpoints: {
2516
+ setRole: import("better-auth").StrictEndpoint<"/admin/set-role", {
2517
+ method: "POST";
2518
+ body: import("better-auth").ZodObject<{
2519
+ userId: import("better-auth").ZodCoercedString<unknown>;
2520
+ role: import("better-auth").ZodUnion<readonly [import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>]>;
2521
+ }, import("zod/v4/core").$strip>;
2522
+ requireHeaders: true;
2523
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2524
+ session: {
2525
+ user: import("better-auth/plugins").UserWithRole;
2526
+ session: {
2527
+ id: string;
2528
+ createdAt: Date;
2529
+ updatedAt: Date;
2530
+ userId: string;
2531
+ expiresAt: Date;
2532
+ token: string;
2533
+ ipAddress?: string | null | undefined;
2534
+ userAgent?: string | null | undefined;
2535
+ };
2536
+ };
2537
+ }>>[];
2538
+ metadata: {
2539
+ openapi: {
2540
+ operationId: string;
2541
+ summary: string;
2542
+ description: string;
2543
+ responses: {
2544
+ 200: {
2545
+ description: string;
2546
+ content: {
2547
+ "application/json": {
2548
+ schema: {
2549
+ type: "object";
2550
+ properties: {
2551
+ user: {
2552
+ $ref: string;
2553
+ };
2554
+ };
2555
+ };
2556
+ };
2557
+ };
2558
+ };
2559
+ };
2560
+ };
2561
+ $Infer: {
2562
+ body: {
2563
+ userId: string;
2564
+ role: "admin" | "user" | ("admin" | "user")[];
2565
+ };
2566
+ };
2567
+ };
2568
+ }, {
2569
+ user: import("better-auth/plugins").UserWithRole;
2570
+ }>;
2571
+ getUser: import("better-auth").StrictEndpoint<"/admin/get-user", {
2572
+ method: "GET";
2573
+ query: import("better-auth").ZodObject<{
2574
+ id: import("better-auth").ZodString;
2575
+ }, import("zod/v4/core").$strip>;
2576
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2577
+ session: {
2578
+ user: import("better-auth/plugins").UserWithRole;
2579
+ session: {
2580
+ id: string;
2581
+ createdAt: Date;
2582
+ updatedAt: Date;
2583
+ userId: string;
2584
+ expiresAt: Date;
2585
+ token: string;
2586
+ ipAddress?: string | null | undefined;
2587
+ userAgent?: string | null | undefined;
2588
+ };
2589
+ };
2590
+ }>>[];
2591
+ metadata: {
2592
+ openapi: {
2593
+ operationId: string;
2594
+ summary: string;
2595
+ description: string;
2596
+ responses: {
2597
+ 200: {
2598
+ description: string;
2599
+ content: {
2600
+ "application/json": {
2601
+ schema: {
2602
+ type: "object";
2603
+ properties: {
2604
+ user: {
2605
+ $ref: string;
2606
+ };
2607
+ };
2608
+ };
2609
+ };
2610
+ };
2611
+ };
2612
+ };
2613
+ };
2614
+ };
2615
+ }, import("better-auth/plugins").UserWithRole>;
2616
+ createUser: import("better-auth").StrictEndpoint<"/admin/create-user", {
2617
+ method: "POST";
2618
+ body: import("better-auth").ZodObject<{
2619
+ email: import("better-auth").ZodString;
2620
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2621
+ name: import("better-auth").ZodString;
2622
+ role: import("better-auth").ZodOptional<import("better-auth").ZodUnion<readonly [import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>]>>;
2623
+ data: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
2624
+ }, import("zod/v4/core").$strip>;
2625
+ metadata: {
2626
+ openapi: {
2627
+ operationId: string;
2628
+ summary: string;
2629
+ description: string;
2630
+ responses: {
2631
+ 200: {
2632
+ description: string;
2633
+ content: {
2634
+ "application/json": {
2635
+ schema: {
2636
+ type: "object";
2637
+ properties: {
2638
+ user: {
2639
+ $ref: string;
2640
+ };
2641
+ };
2642
+ };
2643
+ };
2644
+ };
2645
+ };
2646
+ };
2647
+ };
2648
+ $Infer: {
2649
+ body: {
2650
+ email: string;
2651
+ password?: string | undefined;
2652
+ name: string;
2653
+ role?: "admin" | "user" | ("admin" | "user")[] | undefined;
2654
+ data?: Record<string, any> | undefined;
2655
+ };
2656
+ };
2657
+ };
2658
+ }, {
2659
+ user: import("better-auth/plugins").UserWithRole;
2660
+ }>;
2661
+ adminUpdateUser: import("better-auth").StrictEndpoint<"/admin/update-user", {
2662
+ method: "POST";
2663
+ body: import("better-auth").ZodObject<{
2664
+ userId: import("better-auth").ZodCoercedString<unknown>;
2665
+ data: import("better-auth").ZodRecord<import("better-auth").ZodAny, import("better-auth").ZodAny>;
2666
+ }, import("zod/v4/core").$strip>;
2667
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2668
+ session: {
2669
+ user: import("better-auth/plugins").UserWithRole;
2670
+ session: {
2671
+ id: string;
2672
+ createdAt: Date;
2673
+ updatedAt: Date;
2674
+ userId: string;
2675
+ expiresAt: Date;
2676
+ token: string;
2677
+ ipAddress?: string | null | undefined;
2678
+ userAgent?: string | null | undefined;
2679
+ };
2680
+ };
2681
+ }>>[];
2682
+ metadata: {
2683
+ openapi: {
2684
+ operationId: string;
2685
+ summary: string;
2686
+ description: string;
2687
+ responses: {
2688
+ 200: {
2689
+ description: string;
2690
+ content: {
2691
+ "application/json": {
2692
+ schema: {
2693
+ type: "object";
2694
+ properties: {
2695
+ user: {
2696
+ $ref: string;
2697
+ };
2698
+ };
2699
+ };
2700
+ };
2701
+ };
2702
+ };
2703
+ };
2704
+ };
2705
+ };
2706
+ }, import("better-auth/plugins").UserWithRole>;
2707
+ listUsers: import("better-auth").StrictEndpoint<"/admin/list-users", {
2708
+ method: "GET";
2709
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2710
+ session: {
2711
+ user: import("better-auth/plugins").UserWithRole;
2712
+ session: {
2713
+ id: string;
2714
+ createdAt: Date;
2715
+ updatedAt: Date;
2716
+ userId: string;
2717
+ expiresAt: Date;
2718
+ token: string;
2719
+ ipAddress?: string | null | undefined;
2720
+ userAgent?: string | null | undefined;
2721
+ };
2722
+ };
2723
+ }>>[];
2724
+ query: import("better-auth").ZodObject<{
2725
+ searchValue: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2726
+ searchField: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
2727
+ email: "email";
2728
+ name: "name";
2729
+ }>>;
2730
+ searchOperator: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
2731
+ contains: "contains";
2732
+ starts_with: "starts_with";
2733
+ ends_with: "ends_with";
2734
+ }>>;
2735
+ limit: import("better-auth").ZodOptional<import("better-auth").ZodUnion<[import("better-auth").ZodString, import("better-auth").ZodNumber]>>;
2736
+ offset: import("better-auth").ZodOptional<import("better-auth").ZodUnion<[import("better-auth").ZodString, import("better-auth").ZodNumber]>>;
2737
+ sortBy: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2738
+ sortDirection: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
2739
+ asc: "asc";
2740
+ desc: "desc";
2741
+ }>>;
2742
+ filterField: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2743
+ filterValue: import("better-auth").ZodOptional<import("better-auth").ZodUnion<[import("better-auth").ZodUnion<[import("better-auth").ZodUnion<[import("better-auth").ZodUnion<[import("better-auth").ZodString, import("better-auth").ZodNumber]>, import("better-auth").ZodBoolean]>, import("better-auth").ZodArray<import("better-auth").ZodString>]>, import("better-auth").ZodArray<import("better-auth").ZodNumber>]>>;
2744
+ filterOperator: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
2745
+ in: "in";
2746
+ lte: "lte";
2747
+ eq: "eq";
2748
+ ne: "ne";
2749
+ lt: "lt";
2750
+ gt: "gt";
2751
+ gte: "gte";
2752
+ not_in: "not_in";
2753
+ contains: "contains";
2754
+ starts_with: "starts_with";
2755
+ ends_with: "ends_with";
2756
+ }>>;
2757
+ }, import("zod/v4/core").$strip>;
2758
+ metadata: {
2759
+ openapi: {
2760
+ operationId: string;
2761
+ summary: string;
2762
+ description: string;
2763
+ responses: {
2764
+ 200: {
2765
+ description: string;
2766
+ content: {
2767
+ "application/json": {
2768
+ schema: {
2769
+ type: "object";
2770
+ properties: {
2771
+ users: {
2772
+ type: string;
2773
+ items: {
2774
+ $ref: string;
2775
+ };
2776
+ };
2777
+ total: {
2778
+ type: string;
2779
+ };
2780
+ limit: {
2781
+ type: string;
2782
+ };
2783
+ offset: {
2784
+ type: string;
2785
+ };
2786
+ };
2787
+ required: string[];
2788
+ };
2789
+ };
2790
+ };
2791
+ };
2792
+ };
2793
+ };
2794
+ };
2795
+ }, {
2796
+ users: import("better-auth/plugins").UserWithRole[];
2797
+ total: number;
2798
+ }>;
2799
+ listUserSessions: import("better-auth").StrictEndpoint<"/admin/list-user-sessions", {
2800
+ method: "POST";
2801
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2802
+ session: {
2803
+ user: import("better-auth/plugins").UserWithRole;
2804
+ session: {
2805
+ id: string;
2806
+ createdAt: Date;
2807
+ updatedAt: Date;
2808
+ userId: string;
2809
+ expiresAt: Date;
2810
+ token: string;
2811
+ ipAddress?: string | null | undefined;
2812
+ userAgent?: string | null | undefined;
2813
+ };
2814
+ };
2815
+ }>>[];
2816
+ body: import("better-auth").ZodObject<{
2817
+ userId: import("better-auth").ZodCoercedString<unknown>;
2818
+ }, import("zod/v4/core").$strip>;
2819
+ metadata: {
2820
+ openapi: {
2821
+ operationId: string;
2822
+ summary: string;
2823
+ description: string;
2824
+ responses: {
2825
+ 200: {
2826
+ description: string;
2827
+ content: {
2828
+ "application/json": {
2829
+ schema: {
2830
+ type: "object";
2831
+ properties: {
2832
+ sessions: {
2833
+ type: string;
2834
+ items: {
2835
+ $ref: string;
2836
+ };
2837
+ };
2838
+ };
2839
+ };
2840
+ };
2841
+ };
2842
+ };
2843
+ };
2844
+ };
2845
+ };
2846
+ }, {
2847
+ sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
2848
+ }>;
2849
+ unbanUser: import("better-auth").StrictEndpoint<"/admin/unban-user", {
2850
+ method: "POST";
2851
+ body: import("better-auth").ZodObject<{
2852
+ userId: import("better-auth").ZodCoercedString<unknown>;
2853
+ }, import("zod/v4/core").$strip>;
2854
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2855
+ session: {
2856
+ user: import("better-auth/plugins").UserWithRole;
2857
+ session: {
2858
+ id: string;
2859
+ createdAt: Date;
2860
+ updatedAt: Date;
2861
+ userId: string;
2862
+ expiresAt: Date;
2863
+ token: string;
2864
+ ipAddress?: string | null | undefined;
2865
+ userAgent?: string | null | undefined;
2866
+ };
2867
+ };
2868
+ }>>[];
2869
+ metadata: {
2870
+ openapi: {
2871
+ operationId: string;
2872
+ summary: string;
2873
+ description: string;
2874
+ responses: {
2875
+ 200: {
2876
+ description: string;
2877
+ content: {
2878
+ "application/json": {
2879
+ schema: {
2880
+ type: "object";
2881
+ properties: {
2882
+ user: {
2883
+ $ref: string;
2884
+ };
2885
+ };
2886
+ };
2887
+ };
2888
+ };
2889
+ };
2890
+ };
2891
+ };
2892
+ };
2893
+ }, {
2894
+ user: import("better-auth/plugins").UserWithRole;
2895
+ }>;
2896
+ banUser: import("better-auth").StrictEndpoint<"/admin/ban-user", {
2897
+ method: "POST";
2898
+ body: import("better-auth").ZodObject<{
2899
+ userId: import("better-auth").ZodCoercedString<unknown>;
2900
+ banReason: import("better-auth").ZodOptional<import("better-auth").ZodString>;
2901
+ banExpiresIn: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
2902
+ }, import("zod/v4/core").$strip>;
2903
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2904
+ session: {
2905
+ user: import("better-auth/plugins").UserWithRole;
2906
+ session: {
2907
+ id: string;
2908
+ createdAt: Date;
2909
+ updatedAt: Date;
2910
+ userId: string;
2911
+ expiresAt: Date;
2912
+ token: string;
2913
+ ipAddress?: string | null | undefined;
2914
+ userAgent?: string | null | undefined;
2915
+ };
2916
+ };
2917
+ }>>[];
2918
+ metadata: {
2919
+ openapi: {
2920
+ operationId: string;
2921
+ summary: string;
2922
+ description: string;
2923
+ responses: {
2924
+ 200: {
2925
+ description: string;
2926
+ content: {
2927
+ "application/json": {
2928
+ schema: {
2929
+ type: "object";
2930
+ properties: {
2931
+ user: {
2932
+ $ref: string;
2933
+ };
2934
+ };
2935
+ };
2936
+ };
2937
+ };
2938
+ };
2939
+ };
2940
+ };
2941
+ };
2942
+ }, {
2943
+ user: import("better-auth/plugins").UserWithRole;
2944
+ }>;
2945
+ impersonateUser: import("better-auth").StrictEndpoint<"/admin/impersonate-user", {
2946
+ method: "POST";
2947
+ body: import("better-auth").ZodObject<{
2948
+ userId: import("better-auth").ZodCoercedString<unknown>;
2949
+ }, import("zod/v4/core").$strip>;
2950
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
2951
+ session: {
2952
+ user: import("better-auth/plugins").UserWithRole;
2953
+ session: {
2954
+ id: string;
2955
+ createdAt: Date;
2956
+ updatedAt: Date;
2957
+ userId: string;
2958
+ expiresAt: Date;
2959
+ token: string;
2960
+ ipAddress?: string | null | undefined;
2961
+ userAgent?: string | null | undefined;
2962
+ };
2963
+ };
2964
+ }>>[];
2965
+ metadata: {
2966
+ openapi: {
2967
+ operationId: string;
2968
+ summary: string;
2969
+ description: string;
2970
+ responses: {
2971
+ 200: {
2972
+ description: string;
2973
+ content: {
2974
+ "application/json": {
2975
+ schema: {
2976
+ type: "object";
2977
+ properties: {
2978
+ session: {
2979
+ $ref: string;
2980
+ };
2981
+ user: {
2982
+ $ref: string;
2983
+ };
2984
+ };
2985
+ };
2986
+ };
2987
+ };
2988
+ };
2989
+ };
2990
+ };
2991
+ };
2992
+ }, {
2993
+ session: {
2994
+ id: string;
2995
+ createdAt: Date;
2996
+ updatedAt: Date;
2997
+ userId: string;
2998
+ expiresAt: Date;
2999
+ token: string;
3000
+ ipAddress?: string | null | undefined;
3001
+ userAgent?: string | null | undefined;
3002
+ };
3003
+ user: import("better-auth/plugins").UserWithRole;
3004
+ }>;
3005
+ stopImpersonating: import("better-auth").StrictEndpoint<"/admin/stop-impersonating", {
3006
+ method: "POST";
3007
+ requireHeaders: true;
3008
+ }, {
3009
+ session: {
3010
+ id: string;
3011
+ createdAt: Date;
3012
+ updatedAt: Date;
3013
+ userId: string;
3014
+ expiresAt: Date;
3015
+ token: string;
3016
+ ipAddress?: string | null | undefined;
3017
+ userAgent?: string | null | undefined;
3018
+ } & Record<string, any>;
3019
+ user: {
3020
+ id: string;
3021
+ createdAt: Date;
3022
+ updatedAt: Date;
3023
+ email: string;
3024
+ emailVerified: boolean;
3025
+ name: string;
3026
+ image?: string | null | undefined;
3027
+ } & Record<string, any>;
3028
+ }>;
3029
+ revokeUserSession: import("better-auth").StrictEndpoint<"/admin/revoke-user-session", {
3030
+ method: "POST";
3031
+ body: import("better-auth").ZodObject<{
3032
+ sessionToken: import("better-auth").ZodString;
3033
+ }, import("zod/v4/core").$strip>;
3034
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3035
+ session: {
3036
+ user: import("better-auth/plugins").UserWithRole;
3037
+ session: {
3038
+ id: string;
3039
+ createdAt: Date;
3040
+ updatedAt: Date;
3041
+ userId: string;
3042
+ expiresAt: Date;
3043
+ token: string;
3044
+ ipAddress?: string | null | undefined;
3045
+ userAgent?: string | null | undefined;
3046
+ };
3047
+ };
3048
+ }>>[];
3049
+ metadata: {
3050
+ openapi: {
3051
+ operationId: string;
3052
+ summary: string;
3053
+ description: string;
3054
+ responses: {
3055
+ 200: {
3056
+ description: string;
3057
+ content: {
3058
+ "application/json": {
3059
+ schema: {
3060
+ type: "object";
3061
+ properties: {
3062
+ success: {
3063
+ type: string;
3064
+ };
3065
+ };
3066
+ };
3067
+ };
3068
+ };
3069
+ };
3070
+ };
3071
+ };
3072
+ };
3073
+ }, {
3074
+ success: boolean;
3075
+ }>;
3076
+ revokeUserSessions: import("better-auth").StrictEndpoint<"/admin/revoke-user-sessions", {
3077
+ method: "POST";
3078
+ body: import("better-auth").ZodObject<{
3079
+ userId: import("better-auth").ZodCoercedString<unknown>;
3080
+ }, import("zod/v4/core").$strip>;
3081
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3082
+ session: {
3083
+ user: import("better-auth/plugins").UserWithRole;
3084
+ session: {
3085
+ id: string;
3086
+ createdAt: Date;
3087
+ updatedAt: Date;
3088
+ userId: string;
3089
+ expiresAt: Date;
3090
+ token: string;
3091
+ ipAddress?: string | null | undefined;
3092
+ userAgent?: string | null | undefined;
3093
+ };
3094
+ };
3095
+ }>>[];
3096
+ metadata: {
3097
+ openapi: {
3098
+ operationId: string;
3099
+ summary: string;
3100
+ description: string;
3101
+ responses: {
3102
+ 200: {
3103
+ description: string;
3104
+ content: {
3105
+ "application/json": {
3106
+ schema: {
3107
+ type: "object";
3108
+ properties: {
3109
+ success: {
3110
+ type: string;
3111
+ };
3112
+ };
3113
+ };
3114
+ };
3115
+ };
3116
+ };
3117
+ };
3118
+ };
3119
+ };
3120
+ }, {
3121
+ success: boolean;
3122
+ }>;
3123
+ removeUser: import("better-auth").StrictEndpoint<"/admin/remove-user", {
3124
+ method: "POST";
3125
+ body: import("better-auth").ZodObject<{
3126
+ userId: import("better-auth").ZodCoercedString<unknown>;
3127
+ }, import("zod/v4/core").$strip>;
3128
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3129
+ session: {
3130
+ user: import("better-auth/plugins").UserWithRole;
3131
+ session: {
3132
+ id: string;
3133
+ createdAt: Date;
3134
+ updatedAt: Date;
3135
+ userId: string;
3136
+ expiresAt: Date;
3137
+ token: string;
3138
+ ipAddress?: string | null | undefined;
3139
+ userAgent?: string | null | undefined;
3140
+ };
3141
+ };
3142
+ }>>[];
3143
+ metadata: {
3144
+ openapi: {
3145
+ operationId: string;
3146
+ summary: string;
3147
+ description: string;
3148
+ responses: {
3149
+ 200: {
3150
+ description: string;
3151
+ content: {
3152
+ "application/json": {
3153
+ schema: {
3154
+ type: "object";
3155
+ properties: {
3156
+ success: {
3157
+ type: string;
3158
+ };
3159
+ };
3160
+ };
3161
+ };
3162
+ };
3163
+ };
3164
+ };
3165
+ };
3166
+ };
3167
+ }, {
3168
+ success: boolean;
3169
+ }>;
3170
+ setUserPassword: import("better-auth").StrictEndpoint<"/admin/set-user-password", {
3171
+ method: "POST";
3172
+ body: import("better-auth").ZodObject<{
3173
+ newPassword: import("better-auth").ZodString;
3174
+ userId: import("better-auth").ZodCoercedString<unknown>;
3175
+ }, import("zod/v4/core").$strip>;
3176
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
3177
+ session: {
3178
+ user: import("better-auth/plugins").UserWithRole;
3179
+ session: {
3180
+ id: string;
3181
+ createdAt: Date;
3182
+ updatedAt: Date;
3183
+ userId: string;
3184
+ expiresAt: Date;
3185
+ token: string;
3186
+ ipAddress?: string | null | undefined;
3187
+ userAgent?: string | null | undefined;
3188
+ };
3189
+ };
3190
+ }>>[];
3191
+ metadata: {
3192
+ openapi: {
3193
+ operationId: string;
3194
+ summary: string;
3195
+ description: string;
3196
+ responses: {
3197
+ 200: {
3198
+ description: string;
3199
+ content: {
3200
+ "application/json": {
3201
+ schema: {
3202
+ type: "object";
3203
+ properties: {
3204
+ status: {
3205
+ type: string;
3206
+ };
3207
+ };
3208
+ };
3209
+ };
3210
+ };
3211
+ };
3212
+ };
3213
+ };
3214
+ };
3215
+ }, {
3216
+ status: boolean;
3217
+ }>;
3218
+ userHasPermission: import("better-auth").StrictEndpoint<"/admin/has-permission", {
3219
+ method: "POST";
3220
+ body: import("better-auth").ZodIntersection<import("better-auth").ZodObject<{
3221
+ userId: import("better-auth").ZodOptional<import("better-auth").ZodCoercedString<unknown>>;
3222
+ role: import("better-auth").ZodOptional<import("better-auth").ZodString>;
3223
+ }, import("zod/v4/core").$strip>, import("better-auth").ZodXor<readonly [import("better-auth").ZodObject<{
3224
+ permission: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>;
3225
+ }, import("zod/v4/core").$strip>, import("better-auth").ZodObject<{
3226
+ permissions: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>;
3227
+ }, import("zod/v4/core").$strip>]>>;
3228
+ metadata: {
3229
+ openapi: {
3230
+ description: string;
3231
+ requestBody: {
3232
+ content: {
3233
+ "application/json": {
3234
+ schema: {
3235
+ type: "object";
3236
+ properties: {
3237
+ permissions: {
3238
+ type: string;
3239
+ description: string;
3240
+ };
3241
+ };
3242
+ required: string[];
3243
+ };
3244
+ };
3245
+ };
3246
+ };
3247
+ responses: {
3248
+ "200": {
3249
+ description: string;
3250
+ content: {
3251
+ "application/json": {
3252
+ schema: {
3253
+ type: "object";
3254
+ properties: {
3255
+ error: {
3256
+ type: string;
3257
+ };
3258
+ success: {
3259
+ type: string;
3260
+ };
3261
+ };
3262
+ required: string[];
3263
+ };
3264
+ };
3265
+ };
3266
+ };
3267
+ };
3268
+ };
3269
+ $Infer: {
3270
+ body: {
3271
+ permissions: {
3272
+ readonly user?: ("set-role" | "create" | "update" | "delete" | "list" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "set-email" | "get")[] | undefined;
3273
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
3274
+ };
3275
+ } & {
3276
+ userId?: string | undefined;
3277
+ role?: "admin" | "user" | undefined;
3278
+ };
3279
+ };
3280
+ };
3281
+ }, {
3282
+ error: null;
3283
+ success: boolean;
3284
+ }>;
3285
+ };
3286
+ $ERROR_CODES: {
3287
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
3288
+ FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
3289
+ USER_ALREADY_EXISTS: import("better-auth").RawError<"USER_ALREADY_EXISTS">;
3290
+ YOU_CANNOT_BAN_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_BAN_YOURSELF">;
3291
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
3292
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
3293
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
3294
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
3295
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
3296
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
3297
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
3298
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
3299
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
3300
+ BANNED_USER: import("better-auth").RawError<"BANNED_USER">;
3301
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
3302
+ NO_DATA_TO_UPDATE: import("better-auth").RawError<"NO_DATA_TO_UPDATE">;
3303
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
3304
+ YOU_CANNOT_REMOVE_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
3305
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
3306
+ YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
3307
+ INVALID_ROLE_TYPE: import("better-auth").RawError<"INVALID_ROLE_TYPE">;
3308
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL">;
3309
+ PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER: import("better-auth").RawError<"PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER">;
3310
+ };
3311
+ schema: {
3312
+ user: {
3313
+ fields: {
3314
+ role: {
3315
+ type: "string";
3316
+ required: false;
3317
+ input: false;
3318
+ };
3319
+ banned: {
3320
+ type: "boolean";
3321
+ defaultValue: false;
3322
+ required: false;
3323
+ input: false;
3324
+ };
3325
+ banReason: {
3326
+ type: "string";
3327
+ required: false;
3328
+ input: false;
3329
+ };
3330
+ banExpires: {
3331
+ type: "date";
3332
+ required: false;
3333
+ input: false;
3334
+ };
3335
+ };
3336
+ };
3337
+ session: {
3338
+ fields: {
3339
+ impersonatedBy: {
3340
+ type: "string";
3341
+ required: false;
3342
+ input: false;
3343
+ };
3344
+ };
3345
+ };
3346
+ };
3347
+ options: NoInfer<{
3348
+ defaultRole: string;
3349
+ adminRoles: string[];
3350
+ }>;
3351
+ }, import("better-auth/plugins").DefaultOrganizationPlugin<{
3352
+ invitationLimit: number;
3353
+ }>];
3354
+ }>;
3355
+ /**
3356
+ * Promotes the session that just enrolled a passkey, so the user is not sent back through the
3357
+ * email code to reach the app they enrolled from.
3358
+ *
3359
+ * Registration is not authentication, so it does not go through `sessionFactorForPath`: this is
3360
+ * a deliberate second entry into `passkey`, taken only after `/passkey/verify-registration`
3361
+ * succeeded for this very session. It grants nothing an immediate passkey sign-in would not —
3362
+ * whoever enrolled the authenticator can use it — and the `factor = 'code'` predicate makes it
3363
+ * a no-op on a session that already holds the stronger factor.
3364
+ */
3365
+ export declare function upgradeSessionFactor(pool: Pool, sessionToken: string): Promise<boolean>;
3366
+ /**
3367
+ * Inferred rather than declared as `ReturnType<typeof betterAuth>`: better-auth's `Auth` is
3368
+ * generic in the exact option object, so the widened form is not assignable to itself and the
3369
+ * plugins' endpoints disappear from `auth.api`.
3370
+ */
3371
+ export type HyperfixationAuth = ReturnType<typeof createAuth>;
3372
+ export type { SessionFactor };