better-auth 0.0.8-beta.2 → 0.0.8-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/access.d.ts +3 -4
  2. package/dist/access.js +3 -13
  3. package/dist/access.js.map +1 -1
  4. package/dist/cli.d.ts +1 -2
  5. package/dist/cli.js +36 -44
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client/plugins.d.ts +97 -2407
  8. package/dist/client/plugins.js +143 -203
  9. package/dist/client/plugins.js.map +1 -1
  10. package/dist/client.d.ts +159 -1213
  11. package/dist/client.js +125 -527
  12. package/dist/client.js.map +1 -1
  13. package/dist/{helper-B5_2Vzba.d.ts → helper-D8dhRz72.d.ts} +1 -4
  14. package/dist/{index-Dg4eEXZW.d.ts → index-B9jOjqnF.d.ts} +1 -1
  15. package/dist/{schema-BOszzrbQ.d.ts → index-CcxejJTH.d.ts} +172 -142
  16. package/dist/{client-CaF9eUcv.d.ts → index-Dwhjsk4l.d.ts} +2014 -1971
  17. package/dist/index.d.ts +1124 -6
  18. package/dist/index.js +737 -707
  19. package/dist/index.js.map +1 -1
  20. package/dist/internal-adapter-CVKQ4XR9.d.ts +637 -0
  21. package/dist/next-js.d.ts +17 -7
  22. package/dist/next-js.js +20 -3
  23. package/dist/next-js.js.map +1 -1
  24. package/dist/plugins.d.ts +12 -883
  25. package/dist/plugins.js +743 -679
  26. package/dist/plugins.js.map +1 -1
  27. package/dist/react.d.ts +312 -12
  28. package/dist/react.js +138 -148
  29. package/dist/react.js.map +1 -1
  30. package/dist/social.d.ts +2 -2
  31. package/dist/social.js +179 -151
  32. package/dist/social.js.map +1 -1
  33. package/dist/solid-start.d.ts +7 -6
  34. package/dist/solid-start.js +3 -3
  35. package/dist/solid-start.js.map +1 -1
  36. package/dist/solid.d.ts +91 -2713
  37. package/dist/solid.js +130 -139
  38. package/dist/solid.js.map +1 -1
  39. package/dist/{statement-COylZd3J.d.ts → statement-D6SPoYOh.d.ts} +7 -7
  40. package/dist/svelte-kit.d.ts +6 -5
  41. package/dist/svelte-kit.js +10 -9
  42. package/dist/svelte-kit.js.map +1 -1
  43. package/dist/svelte.d.ts +89 -2713
  44. package/dist/svelte.js +124 -138
  45. package/dist/svelte.js.map +1 -1
  46. package/dist/types-D4WrjKeJ.d.ts +81 -0
  47. package/dist/types.d.ts +31 -5
  48. package/dist/types.js +2 -0
  49. package/dist/types.js.map +1 -1
  50. package/dist/vue.d.ts +313 -12
  51. package/dist/vue.js +131 -145
  52. package/dist/vue.js.map +1 -1
  53. package/package.json +8 -3
  54. package/dist/index-CGeV0d2g.d.ts +0 -1498
  55. package/dist/preact.d.ts +0 -8
  56. package/dist/preact.js +0 -291
  57. package/dist/preact.js.map +0 -1
  58. package/dist/type-tYx_kmry.d.ts +0 -5724
package/dist/plugins.d.ts CHANGED
@@ -1,887 +1,16 @@
1
- import { T as TwoFactorOptions, U as UserWithTwoFactor } from './client-CaF9eUcv.js';
2
- export { O as OrganizationOptions, a as Passkey, P as PasskeyOptions, W as WebAuthnCookieType, g as getPasskeyActions, o as organization, b as passkey, p as passkeyClient, t as twoFactorClient } from './client-CaF9eUcv.js';
3
- export { i as ac } from './index-Dg4eEXZW.js';
4
- import { G as GenericEndpointContext } from './index-CGeV0d2g.js';
5
- import * as better_call from 'better-call';
6
- import { z } from 'zod';
7
- import 'nanostores';
8
- import './type-tYx_kmry.js';
9
- import '@better-fetch/fetch';
10
- import './helper-B5_2Vzba.js';
11
- import '@nanostores/react';
12
- import '@vue/reactivity';
13
- import '@nanostores/vue';
14
- import '@nanostores/solid';
15
- import './schema-BOszzrbQ.js';
1
+ export { O as OrganizationOptions, b as Passkey, P as PasskeyOptions, W as WebAuthnCookieType, g as getPasskeyActions, o as organization, p as passkey, c as passkeyClient, t as twoFactor, a as twoFactorClient, u as username } from './index-Dwhjsk4l.js';
2
+ export { i as ac } from './index-B9jOjqnF.js';
3
+ import { H as HookEndpointContext } from './internal-adapter-CVKQ4XR9.js';
4
+ import './index-CcxejJTH.js';
16
5
  import 'arctic';
17
- import './preact.js';
18
- import './statement-COylZd3J.js';
6
+ import 'zod';
7
+ import './helper-D8dhRz72.js';
8
+ import 'better-call';
9
+ import './statement-D6SPoYOh.js';
10
+ import '@better-fetch/fetch';
19
11
  import '@simplewebauthn/types';
20
12
  import 'kysely';
21
13
 
22
- declare const twoFactor: <O extends TwoFactorOptions>(options: O) => {
23
- id: "two-factor";
24
- endpoints: {
25
- enableTwoFactor: {
26
- (ctx_0?: better_call.Context<"/two-factor/enable", {
27
- method: "POST";
28
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
29
- session: {
30
- session: {
31
- id: string;
32
- userId: string;
33
- expiresAt: Date;
34
- ipAddress?: string | undefined;
35
- userAgent?: string | undefined;
36
- };
37
- user: {
38
- id: string;
39
- name: string;
40
- email: string;
41
- emailVerified: boolean;
42
- createdAt: Date;
43
- updatedAt: Date;
44
- image?: string | undefined;
45
- };
46
- };
47
- }>, better_call.EndpointOptions>[];
48
- }> | undefined): Promise<{
49
- status: boolean;
50
- }>;
51
- path: "/two-factor/enable";
52
- options: {
53
- method: "POST";
54
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
55
- session: {
56
- session: {
57
- id: string;
58
- userId: string;
59
- expiresAt: Date;
60
- ipAddress?: string | undefined;
61
- userAgent?: string | undefined;
62
- };
63
- user: {
64
- id: string;
65
- name: string;
66
- email: string;
67
- emailVerified: boolean;
68
- createdAt: Date;
69
- updatedAt: Date;
70
- image?: string | undefined;
71
- };
72
- };
73
- }>, better_call.EndpointOptions>[];
74
- };
75
- method: better_call.Method | better_call.Method[];
76
- headers: Headers;
77
- };
78
- disableTwoFactor: {
79
- (ctx_0?: better_call.Context<"/two-factor/disable", {
80
- method: "POST";
81
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
82
- session: {
83
- session: {
84
- id: string;
85
- userId: string;
86
- expiresAt: Date;
87
- ipAddress?: string | undefined;
88
- userAgent?: string | undefined;
89
- };
90
- user: {
91
- id: string;
92
- name: string;
93
- email: string;
94
- emailVerified: boolean;
95
- createdAt: Date;
96
- updatedAt: Date;
97
- image?: string | undefined;
98
- };
99
- };
100
- }>, better_call.EndpointOptions>[];
101
- }> | undefined): Promise<{
102
- status: boolean;
103
- }>;
104
- path: "/two-factor/disable";
105
- options: {
106
- method: "POST";
107
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
108
- session: {
109
- session: {
110
- id: string;
111
- userId: string;
112
- expiresAt: Date;
113
- ipAddress?: string | undefined;
114
- userAgent?: string | undefined;
115
- };
116
- user: {
117
- id: string;
118
- name: string;
119
- email: string;
120
- emailVerified: boolean;
121
- createdAt: Date;
122
- updatedAt: Date;
123
- image?: string | undefined;
124
- };
125
- };
126
- }>, better_call.EndpointOptions>[];
127
- };
128
- method: better_call.Method | better_call.Method[];
129
- headers: Headers;
130
- };
131
- verifyBackupCode: {
132
- (ctx_0: better_call.Context<"/two-factor/verify-backup-code", {
133
- method: "POST";
134
- body: z.ZodObject<{
135
- code: z.ZodString;
136
- }, "strip", z.ZodTypeAny, {
137
- code: string;
138
- }, {
139
- code: string;
140
- }>;
141
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
142
- valid: () => Promise<{
143
- response: {
144
- body: any;
145
- status: number;
146
- statusText: string;
147
- headers: Record<string, string> | undefined;
148
- };
149
- body: {
150
- status: boolean;
151
- };
152
- _flag: "json";
153
- }>;
154
- invalid: () => Promise<{
155
- response: {
156
- body: any;
157
- status: number;
158
- statusText: string;
159
- headers: Record<string, string> | undefined;
160
- };
161
- body: {
162
- status: boolean;
163
- };
164
- _flag: "json";
165
- }>;
166
- session: {
167
- id: string;
168
- userId: string;
169
- expiresAt: Date;
170
- user: UserWithTwoFactor;
171
- };
172
- }>, better_call.EndpointOptions>[];
173
- }>): Promise<{
174
- status: boolean;
175
- }>;
176
- path: "/two-factor/verify-backup-code";
177
- options: {
178
- method: "POST";
179
- body: z.ZodObject<{
180
- code: z.ZodString;
181
- }, "strip", z.ZodTypeAny, {
182
- code: string;
183
- }, {
184
- code: string;
185
- }>;
186
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
187
- valid: () => Promise<{
188
- response: {
189
- body: any;
190
- status: number;
191
- statusText: string;
192
- headers: Record<string, string> | undefined;
193
- };
194
- body: {
195
- status: boolean;
196
- };
197
- _flag: "json";
198
- }>;
199
- invalid: () => Promise<{
200
- response: {
201
- body: any;
202
- status: number;
203
- statusText: string;
204
- headers: Record<string, string> | undefined;
205
- };
206
- body: {
207
- status: boolean;
208
- };
209
- _flag: "json";
210
- }>;
211
- session: {
212
- id: string;
213
- userId: string;
214
- expiresAt: Date;
215
- user: UserWithTwoFactor;
216
- };
217
- }>, better_call.EndpointOptions>[];
218
- };
219
- method: better_call.Method | better_call.Method[];
220
- headers: Headers;
221
- };
222
- generateBackupCodes: {
223
- (ctx_0?: better_call.Context<"/two-factor/generate-backup-codes", {
224
- method: "POST";
225
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
226
- session: {
227
- session: {
228
- id: string;
229
- userId: string;
230
- expiresAt: Date;
231
- ipAddress?: string | undefined;
232
- userAgent?: string | undefined;
233
- };
234
- user: {
235
- id: string;
236
- name: string;
237
- email: string;
238
- emailVerified: boolean;
239
- createdAt: Date;
240
- updatedAt: Date;
241
- image?: string | undefined;
242
- };
243
- };
244
- }>, better_call.EndpointOptions>[];
245
- }> | undefined): Promise<{
246
- status: boolean;
247
- backupCodes: string[];
248
- }>;
249
- path: "/two-factor/generate-backup-codes";
250
- options: {
251
- method: "POST";
252
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
253
- session: {
254
- session: {
255
- id: string;
256
- userId: string;
257
- expiresAt: Date;
258
- ipAddress?: string | undefined;
259
- userAgent?: string | undefined;
260
- };
261
- user: {
262
- id: string;
263
- name: string;
264
- email: string;
265
- emailVerified: boolean;
266
- createdAt: Date;
267
- updatedAt: Date;
268
- image?: string | undefined;
269
- };
270
- };
271
- }>, better_call.EndpointOptions>[];
272
- };
273
- method: better_call.Method | better_call.Method[];
274
- headers: Headers;
275
- };
276
- viewBackupCodes: {
277
- (ctx_0?: better_call.Context<"/view/backup-codes", {
278
- method: "GET";
279
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
280
- session: {
281
- session: {
282
- id: string;
283
- userId: string;
284
- expiresAt: Date;
285
- ipAddress?: string | undefined;
286
- userAgent?: string | undefined;
287
- };
288
- user: {
289
- id: string;
290
- name: string;
291
- email: string;
292
- emailVerified: boolean;
293
- createdAt: Date;
294
- updatedAt: Date;
295
- image?: string | undefined;
296
- };
297
- };
298
- }>, better_call.EndpointOptions>[];
299
- }> | undefined): Promise<{
300
- status: boolean;
301
- backupCodes: Promise<string[] | null>;
302
- }>;
303
- path: "/view/backup-codes";
304
- options: {
305
- method: "GET";
306
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
307
- session: {
308
- session: {
309
- id: string;
310
- userId: string;
311
- expiresAt: Date;
312
- ipAddress?: string | undefined;
313
- userAgent?: string | undefined;
314
- };
315
- user: {
316
- id: string;
317
- name: string;
318
- email: string;
319
- emailVerified: boolean;
320
- createdAt: Date;
321
- updatedAt: Date;
322
- image?: string | undefined;
323
- };
324
- };
325
- }>, better_call.EndpointOptions>[];
326
- };
327
- method: better_call.Method | better_call.Method[];
328
- headers: Headers;
329
- };
330
- send2FaOTP: {
331
- (ctx_0?: better_call.Context<"/two-factor/send-otp", {
332
- method: "POST";
333
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
334
- valid: () => Promise<{
335
- response: {
336
- body: any;
337
- status: number;
338
- statusText: string;
339
- headers: Record<string, string> | undefined;
340
- };
341
- body: {
342
- status: boolean;
343
- };
344
- _flag: "json";
345
- }>;
346
- invalid: () => Promise<{
347
- response: {
348
- body: any;
349
- status: number;
350
- statusText: string;
351
- headers: Record<string, string> | undefined;
352
- };
353
- body: {
354
- status: boolean;
355
- };
356
- _flag: "json";
357
- }>;
358
- session: {
359
- id: string;
360
- userId: string;
361
- expiresAt: Date;
362
- user: UserWithTwoFactor;
363
- };
364
- }>, better_call.EndpointOptions>[];
365
- }> | undefined): Promise<{
366
- status: boolean;
367
- }>;
368
- path: "/two-factor/send-otp";
369
- options: {
370
- method: "POST";
371
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
372
- valid: () => Promise<{
373
- response: {
374
- body: any;
375
- status: number;
376
- statusText: string;
377
- headers: Record<string, string> | undefined;
378
- };
379
- body: {
380
- status: boolean;
381
- };
382
- _flag: "json";
383
- }>;
384
- invalid: () => Promise<{
385
- response: {
386
- body: any;
387
- status: number;
388
- statusText: string;
389
- headers: Record<string, string> | undefined;
390
- };
391
- body: {
392
- status: boolean;
393
- };
394
- _flag: "json";
395
- }>;
396
- session: {
397
- id: string;
398
- userId: string;
399
- expiresAt: Date;
400
- user: UserWithTwoFactor;
401
- };
402
- }>, better_call.EndpointOptions>[];
403
- };
404
- method: better_call.Method | better_call.Method[];
405
- headers: Headers;
406
- };
407
- verifyOTP: {
408
- (ctx_0: better_call.Context<"/two-factor/verify-otp", {
409
- method: "POST";
410
- body: z.ZodObject<{
411
- code: z.ZodString;
412
- }, "strip", z.ZodTypeAny, {
413
- code: string;
414
- }, {
415
- code: string;
416
- }>;
417
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
418
- valid: () => Promise<{
419
- response: {
420
- body: any;
421
- status: number;
422
- statusText: string;
423
- headers: Record<string, string> | undefined;
424
- };
425
- body: {
426
- status: boolean;
427
- };
428
- _flag: "json";
429
- }>;
430
- invalid: () => Promise<{
431
- response: {
432
- body: any;
433
- status: number;
434
- statusText: string;
435
- headers: Record<string, string> | undefined;
436
- };
437
- body: {
438
- status: boolean;
439
- };
440
- _flag: "json";
441
- }>;
442
- session: {
443
- id: string;
444
- userId: string;
445
- expiresAt: Date;
446
- user: UserWithTwoFactor;
447
- };
448
- }>, better_call.EndpointOptions>[];
449
- }>): Promise<{
450
- status: boolean;
451
- }>;
452
- path: "/two-factor/verify-otp";
453
- options: {
454
- method: "POST";
455
- body: z.ZodObject<{
456
- code: z.ZodString;
457
- }, "strip", z.ZodTypeAny, {
458
- code: string;
459
- }, {
460
- code: string;
461
- }>;
462
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
463
- valid: () => Promise<{
464
- response: {
465
- body: any;
466
- status: number;
467
- statusText: string;
468
- headers: Record<string, string> | undefined;
469
- };
470
- body: {
471
- status: boolean;
472
- };
473
- _flag: "json";
474
- }>;
475
- invalid: () => Promise<{
476
- response: {
477
- body: any;
478
- status: number;
479
- statusText: string;
480
- headers: Record<string, string> | undefined;
481
- };
482
- body: {
483
- status: boolean;
484
- };
485
- _flag: "json";
486
- }>;
487
- session: {
488
- id: string;
489
- userId: string;
490
- expiresAt: Date;
491
- user: UserWithTwoFactor;
492
- };
493
- }>, better_call.EndpointOptions>[];
494
- };
495
- method: better_call.Method | better_call.Method[];
496
- headers: Headers;
497
- };
498
- generateTOTP: {
499
- (ctx_0?: better_call.Context<"/totp/generate", {
500
- method: "POST";
501
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
502
- session: {
503
- session: {
504
- id: string;
505
- userId: string;
506
- expiresAt: Date;
507
- ipAddress?: string | undefined;
508
- userAgent?: string | undefined;
509
- };
510
- user: {
511
- id: string;
512
- name: string;
513
- email: string;
514
- emailVerified: boolean;
515
- createdAt: Date;
516
- updatedAt: Date;
517
- image?: string | undefined;
518
- };
519
- };
520
- }>, better_call.EndpointOptions>[];
521
- }> | undefined): Promise<{
522
- code: string;
523
- }>;
524
- path: "/totp/generate";
525
- options: {
526
- method: "POST";
527
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
528
- session: {
529
- session: {
530
- id: string;
531
- userId: string;
532
- expiresAt: Date;
533
- ipAddress?: string | undefined;
534
- userAgent?: string | undefined;
535
- };
536
- user: {
537
- id: string;
538
- name: string;
539
- email: string;
540
- emailVerified: boolean;
541
- createdAt: Date;
542
- updatedAt: Date;
543
- image?: string | undefined;
544
- };
545
- };
546
- }>, better_call.EndpointOptions>[];
547
- };
548
- method: better_call.Method | better_call.Method[];
549
- headers: Headers;
550
- };
551
- viewTOTPURI: {
552
- (ctx_0?: better_call.Context<"/two-factor/get-totp-uri", {
553
- method: "GET";
554
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
555
- session: {
556
- session: {
557
- id: string;
558
- userId: string;
559
- expiresAt: Date;
560
- ipAddress?: string | undefined;
561
- userAgent?: string | undefined;
562
- };
563
- user: {
564
- id: string;
565
- name: string;
566
- email: string;
567
- emailVerified: boolean;
568
- createdAt: Date;
569
- updatedAt: Date;
570
- image?: string | undefined;
571
- };
572
- };
573
- }>, better_call.EndpointOptions>[];
574
- }> | undefined): Promise<{
575
- totpURI: string;
576
- }>;
577
- path: "/two-factor/get-totp-uri";
578
- options: {
579
- method: "GET";
580
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
581
- session: {
582
- session: {
583
- id: string;
584
- userId: string;
585
- expiresAt: Date;
586
- ipAddress?: string | undefined;
587
- userAgent?: string | undefined;
588
- };
589
- user: {
590
- id: string;
591
- name: string;
592
- email: string;
593
- emailVerified: boolean;
594
- createdAt: Date;
595
- updatedAt: Date;
596
- image?: string | undefined;
597
- };
598
- };
599
- }>, better_call.EndpointOptions>[];
600
- };
601
- method: better_call.Method | better_call.Method[];
602
- headers: Headers;
603
- };
604
- verifyTOTP: {
605
- (ctx_0: better_call.Context<"/two-factor/verify-totp", {
606
- method: "POST";
607
- body: z.ZodObject<{
608
- code: z.ZodString;
609
- callbackURL: z.ZodOptional<z.ZodString>;
610
- }, "strip", z.ZodTypeAny, {
611
- code: string;
612
- callbackURL?: string | undefined;
613
- }, {
614
- code: string;
615
- callbackURL?: string | undefined;
616
- }>;
617
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
618
- valid: () => Promise<{
619
- response: {
620
- body: any;
621
- status: number;
622
- statusText: string;
623
- headers: Record<string, string> | undefined;
624
- };
625
- body: {
626
- status: boolean;
627
- };
628
- _flag: "json";
629
- }>;
630
- invalid: () => Promise<{
631
- response: {
632
- body: any;
633
- status: number;
634
- statusText: string;
635
- headers: Record<string, string> | undefined;
636
- };
637
- body: {
638
- status: boolean;
639
- };
640
- _flag: "json";
641
- }>;
642
- session: {
643
- id: string;
644
- userId: string;
645
- expiresAt: Date;
646
- user: UserWithTwoFactor;
647
- };
648
- }>, better_call.EndpointOptions>[];
649
- }>): Promise<{
650
- status: boolean;
651
- }>;
652
- path: "/two-factor/verify-totp";
653
- options: {
654
- method: "POST";
655
- body: z.ZodObject<{
656
- code: z.ZodString;
657
- callbackURL: z.ZodOptional<z.ZodString>;
658
- }, "strip", z.ZodTypeAny, {
659
- code: string;
660
- callbackURL?: string | undefined;
661
- }, {
662
- code: string;
663
- callbackURL?: string | undefined;
664
- }>;
665
- use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
666
- valid: () => Promise<{
667
- response: {
668
- body: any;
669
- status: number;
670
- statusText: string;
671
- headers: Record<string, string> | undefined;
672
- };
673
- body: {
674
- status: boolean;
675
- };
676
- _flag: "json";
677
- }>;
678
- invalid: () => Promise<{
679
- response: {
680
- body: any;
681
- status: number;
682
- statusText: string;
683
- headers: Record<string, string> | undefined;
684
- };
685
- body: {
686
- status: boolean;
687
- };
688
- _flag: "json";
689
- }>;
690
- session: {
691
- id: string;
692
- userId: string;
693
- expiresAt: Date;
694
- user: UserWithTwoFactor;
695
- };
696
- }>, better_call.EndpointOptions>[];
697
- };
698
- method: better_call.Method | better_call.Method[];
699
- headers: Headers;
700
- };
701
- };
702
- options: O;
703
- hooks: {
704
- after: {
705
- matcher(context: GenericEndpointContext): boolean;
706
- handler: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, {
707
- response: Response;
708
- } | undefined>, better_call.EndpointOptions>;
709
- }[];
710
- };
711
- schema: {
712
- user: {
713
- fields: {
714
- twoFactorEnabled: {
715
- type: "boolean";
716
- required: false;
717
- defaultValue: false;
718
- };
719
- twoFactorSecret: {
720
- type: "string";
721
- required: false;
722
- };
723
- twoFactorBackupCodes: {
724
- type: "string";
725
- required: false;
726
- returned: false;
727
- };
728
- };
729
- };
730
- };
731
- };
732
-
733
- declare const username: () => {
734
- id: "username";
735
- endpoints: {
736
- signInUsername: {
737
- (ctx_0: better_call.Context<"/sign-in/username", {
738
- method: "POST";
739
- body: z.ZodObject<{
740
- username: z.ZodString;
741
- password: z.ZodString;
742
- dontRememberMe: z.ZodOptional<z.ZodBoolean>;
743
- callbackURL: z.ZodOptional<z.ZodString>;
744
- }, "strip", z.ZodTypeAny, {
745
- password: string;
746
- username: string;
747
- callbackURL?: string | undefined;
748
- dontRememberMe?: boolean | undefined;
749
- }, {
750
- password: string;
751
- username: string;
752
- callbackURL?: string | undefined;
753
- dontRememberMe?: boolean | undefined;
754
- }>;
755
- }>): Promise<{
756
- user: {
757
- id: string;
758
- name: string;
759
- email: string;
760
- emailVerified: boolean;
761
- createdAt: Date;
762
- updatedAt: Date;
763
- image?: string | undefined;
764
- };
765
- session: {
766
- id: string;
767
- userId: string;
768
- expiresAt: Date;
769
- ipAddress?: string | undefined;
770
- userAgent?: string | undefined;
771
- };
772
- redirect: boolean;
773
- url: string | undefined;
774
- }>;
775
- path: "/sign-in/username";
776
- options: {
777
- method: "POST";
778
- body: z.ZodObject<{
779
- username: z.ZodString;
780
- password: z.ZodString;
781
- dontRememberMe: z.ZodOptional<z.ZodBoolean>;
782
- callbackURL: z.ZodOptional<z.ZodString>;
783
- }, "strip", z.ZodTypeAny, {
784
- password: string;
785
- username: string;
786
- callbackURL?: string | undefined;
787
- dontRememberMe?: boolean | undefined;
788
- }, {
789
- password: string;
790
- username: string;
791
- callbackURL?: string | undefined;
792
- dontRememberMe?: boolean | undefined;
793
- }>;
794
- };
795
- method: better_call.Method | better_call.Method[];
796
- headers: Headers;
797
- };
798
- signUpUsername: {
799
- (ctx_0: better_call.Context<"/sign-up/username", {
800
- method: "POST";
801
- body: z.ZodObject<{
802
- username: z.ZodString;
803
- name: z.ZodString;
804
- email: z.ZodString;
805
- password: z.ZodString;
806
- image: z.ZodOptional<z.ZodString>;
807
- callbackURL: z.ZodOptional<z.ZodString>;
808
- }, "strip", z.ZodTypeAny, {
809
- name: string;
810
- email: string;
811
- password: string;
812
- username: string;
813
- callbackURL?: string | undefined;
814
- image?: string | undefined;
815
- }, {
816
- name: string;
817
- email: string;
818
- password: string;
819
- username: string;
820
- callbackURL?: string | undefined;
821
- image?: string | undefined;
822
- }>;
823
- }>): Promise<{
824
- user: {
825
- id: string;
826
- name: string;
827
- email: string;
828
- emailVerified: boolean;
829
- createdAt: Date;
830
- updatedAt: Date;
831
- image?: string | undefined;
832
- };
833
- session: {
834
- id: string;
835
- userId: string;
836
- expiresAt: Date;
837
- ipAddress?: string | undefined;
838
- userAgent?: string | undefined;
839
- };
840
- } | null>;
841
- path: "/sign-up/username";
842
- options: {
843
- method: "POST";
844
- body: z.ZodObject<{
845
- username: z.ZodString;
846
- name: z.ZodString;
847
- email: z.ZodString;
848
- password: z.ZodString;
849
- image: z.ZodOptional<z.ZodString>;
850
- callbackURL: z.ZodOptional<z.ZodString>;
851
- }, "strip", z.ZodTypeAny, {
852
- name: string;
853
- email: string;
854
- password: string;
855
- username: string;
856
- callbackURL?: string | undefined;
857
- image?: string | undefined;
858
- }, {
859
- name: string;
860
- email: string;
861
- password: string;
862
- username: string;
863
- callbackURL?: string | undefined;
864
- image?: string | undefined;
865
- }>;
866
- };
867
- method: better_call.Method | better_call.Method[];
868
- headers: Headers;
869
- };
870
- };
871
- schema: {
872
- user: {
873
- fields: {
874
- username: {
875
- type: "string";
876
- required: false;
877
- unique: true;
878
- returned: true;
879
- };
880
- };
881
- };
882
- };
883
- };
884
-
885
14
  /**
886
15
  * Converts bearer token to session cookie
887
16
  */
@@ -889,10 +18,10 @@ declare const bearer: () => {
889
18
  id: "bearer";
890
19
  hooks: {
891
20
  before: {
892
- matcher(context: GenericEndpointContext): boolean;
893
- handler: (ctx: GenericEndpointContext) => Promise<void>;
21
+ matcher(context: HookEndpointContext): boolean;
22
+ handler: (ctx: HookEndpointContext) => Promise<void>;
894
23
  }[];
895
24
  };
896
25
  };
897
26
 
898
- export { bearer, twoFactor, username };
27
+ export { bearer };