better-auth 0.0.2-beta.7 → 0.0.2

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