@meistrari/auth-core 1.11.4 → 1.11.6

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.
package/dist/index.d.mts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as better_auth_plugins from 'better-auth/plugins';
2
2
  import * as better_auth from 'better-auth';
3
3
  import { JWTPayload } from 'better-auth';
4
+ export { APIError } from 'better-auth';
4
5
  import * as better_auth_client from 'better-auth/client';
5
6
  import { BetterFetchOption } from 'better-auth/client';
6
- import * as _better_fetch_fetch from '@better-fetch/fetch';
7
- export { BetterFetchError as APIError } from '@better-fetch/fetch';
7
+ import * as jose from 'jose';
8
+ import * as _better_auth_sso from '@better-auth/sso';
8
9
 
9
10
  declare const ac: {
10
11
  newRole<K extends "member" | "access" | "organization" | "invitation" | "team" | "ac">(statements: better_auth_plugins.Subset<K, {
@@ -219,6 +220,2331 @@ type Strict<T> = {
219
220
  [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
220
221
  };
221
222
  declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOption): {
223
+ useActiveOrganization: better_auth_client.AuthQueryAtom<better_auth.Prettify<{
224
+ id: string;
225
+ name: string;
226
+ slug: string;
227
+ createdAt: Date;
228
+ logo?: string | null | undefined | undefined;
229
+ metadata?: any;
230
+ } & {
231
+ members: {
232
+ id: string;
233
+ organizationId: string;
234
+ role: "org:admin" | "org:member" | "org:reviewer";
235
+ createdAt: Date;
236
+ userId: string;
237
+ teamId?: string | undefined | undefined;
238
+ user: {
239
+ id: string;
240
+ email: string;
241
+ name: string;
242
+ image?: string | undefined;
243
+ };
244
+ }[];
245
+ invitations: {
246
+ id: string;
247
+ organizationId: string;
248
+ email: string;
249
+ role: "org:admin" | "org:member" | "org:reviewer";
250
+ status: better_auth_plugins.InvitationStatus;
251
+ inviterId: string;
252
+ expiresAt: Date;
253
+ createdAt: Date;
254
+ teamId?: string | undefined | undefined;
255
+ }[];
256
+ }>>;
257
+ useListOrganizations: better_auth_client.AuthQueryAtom<{
258
+ id: string;
259
+ name: string;
260
+ slug: string;
261
+ createdAt: Date;
262
+ logo?: string | null | undefined | undefined;
263
+ metadata?: any;
264
+ }[]>;
265
+ useActiveMember: better_auth_client.AuthQueryAtom<{
266
+ id: string;
267
+ organizationId: string;
268
+ userId: string;
269
+ role: string;
270
+ createdAt: Date;
271
+ }>;
272
+ useActiveMemberRole: better_auth_client.AuthQueryAtom<{
273
+ role: string;
274
+ }>;
275
+ } & {
276
+ customEndpoints: {
277
+ teams: {
278
+ ":id": {
279
+ members: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, {
280
+ id: string;
281
+ }>>(data_0?: better_auth.Prettify<{
282
+ query?: Record<string, any> | undefined;
283
+ fetchOptions?: FetchOptions | undefined;
284
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
285
+ teamMembers: {
286
+ id: string;
287
+ teamId: string;
288
+ userId: string;
289
+ createdAt: Date;
290
+ }[];
291
+ }, {
292
+ code?: string | undefined;
293
+ message?: string | undefined;
294
+ }, FetchOptions["throw"] extends true ? true : true>>;
295
+ };
296
+ };
297
+ };
298
+ } & {
299
+ handshake: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
300
+ origin: string;
301
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
302
+ query: {
303
+ origin: string;
304
+ };
305
+ fetchOptions?: FetchOptions | undefined;
306
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
307
+ status: ("OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "BAD_REQUEST" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "LENGTH_REQUIRED" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "URI_TOO_LONG" | "UNSUPPORTED_MEDIA_TYPE" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "TOO_MANY_REQUESTS" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_auth.Status;
308
+ body: ({
309
+ message?: string;
310
+ code?: string;
311
+ cause?: unknown;
312
+ } & Record<string, any>) | undefined;
313
+ headers: HeadersInit;
314
+ statusCode: number;
315
+ name: string;
316
+ message: string;
317
+ stack?: string;
318
+ cause?: unknown;
319
+ }, {
320
+ code?: string | undefined;
321
+ message?: string | undefined;
322
+ }, FetchOptions["throw"] extends true ? true : true>>;
323
+ } & {
324
+ handshake: {
325
+ noncePayload: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
326
+ nonce: string;
327
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
328
+ query: {
329
+ nonce: string;
330
+ };
331
+ fetchOptions?: FetchOptions | undefined;
332
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
333
+ token: string;
334
+ }, {
335
+ code?: string | undefined;
336
+ message?: string | undefined;
337
+ }, FetchOptions["throw"] extends true ? true : true>>;
338
+ };
339
+ } & {
340
+ organization: {
341
+ create: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
342
+ name: string;
343
+ slug: string;
344
+ userId?: string | undefined;
345
+ logo?: string | undefined;
346
+ metadata?: Record<string, any> | undefined;
347
+ keepCurrentActiveOrganization?: boolean | undefined;
348
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
349
+ name: string;
350
+ slug: string;
351
+ userId?: string | undefined;
352
+ logo?: string | undefined;
353
+ metadata?: Record<string, any> | undefined;
354
+ keepCurrentActiveOrganization?: boolean | undefined;
355
+ } & {
356
+ fetchOptions?: FetchOptions | undefined;
357
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
358
+ id: string;
359
+ name: string;
360
+ slug: string;
361
+ createdAt: Date;
362
+ logo?: string | null | undefined | undefined;
363
+ metadata?: any;
364
+ } & {
365
+ metadata: any;
366
+ members: ({
367
+ id: string;
368
+ organizationId: string;
369
+ userId: string;
370
+ role: string;
371
+ createdAt: Date;
372
+ } | undefined)[];
373
+ }>, {
374
+ code?: string | undefined;
375
+ message?: string | undefined;
376
+ }, FetchOptions["throw"] extends true ? true : true>>;
377
+ };
378
+ } & {
379
+ organization: {
380
+ update: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
381
+ data: {
382
+ name?: string | undefined;
383
+ slug?: string | undefined;
384
+ logo?: string | undefined;
385
+ metadata?: Record<string, any> | undefined;
386
+ } & Partial<{}>;
387
+ organizationId?: string | undefined;
388
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
389
+ data: {
390
+ name?: string | undefined;
391
+ slug?: string | undefined;
392
+ logo?: string | undefined;
393
+ metadata?: Record<string, any> | undefined;
394
+ } & Partial<{}>;
395
+ organizationId?: string | undefined;
396
+ } & {
397
+ fetchOptions?: FetchOptions | undefined;
398
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
399
+ id: string;
400
+ name: string;
401
+ slug: string;
402
+ createdAt: Date;
403
+ logo?: string | null | undefined | undefined;
404
+ metadata?: any;
405
+ }, {
406
+ code?: string | undefined;
407
+ message?: string | undefined;
408
+ }, FetchOptions["throw"] extends true ? true : true>>;
409
+ };
410
+ } & {
411
+ organization: {
412
+ delete: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
413
+ organizationId: string;
414
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
415
+ organizationId: string;
416
+ } & {
417
+ fetchOptions?: FetchOptions | undefined;
418
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
419
+ id: string;
420
+ name: string;
421
+ slug: string;
422
+ createdAt: Date;
423
+ logo?: string | null | undefined | undefined;
424
+ metadata?: any;
425
+ }, {
426
+ code?: string | undefined;
427
+ message?: string | undefined;
428
+ }, FetchOptions["throw"] extends true ? true : true>>;
429
+ };
430
+ } & {
431
+ organization: {
432
+ setActive: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
433
+ organizationId?: string | null | undefined;
434
+ organizationSlug?: string | undefined;
435
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
436
+ organizationId?: string | null | undefined;
437
+ organizationSlug?: string | undefined;
438
+ } & {
439
+ fetchOptions?: FetchOptions | undefined;
440
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
441
+ members: {
442
+ id: string;
443
+ organizationId: string;
444
+ role: "org:admin" | "org:member" | "org:reviewer";
445
+ createdAt: Date;
446
+ userId: string;
447
+ teamId?: string | undefined | undefined;
448
+ user: {
449
+ id: string;
450
+ email: string;
451
+ name: string;
452
+ image?: string | undefined;
453
+ };
454
+ }[];
455
+ invitations: {
456
+ id: string;
457
+ organizationId: string;
458
+ email: string;
459
+ role: "org:admin" | "org:member" | "org:reviewer";
460
+ status: better_auth_plugins.InvitationStatus;
461
+ inviterId: string;
462
+ expiresAt: Date;
463
+ createdAt: Date;
464
+ teamId?: string | undefined | undefined;
465
+ }[];
466
+ teams: {
467
+ id: string;
468
+ name: string;
469
+ organizationId: string;
470
+ createdAt: Date;
471
+ updatedAt?: Date | undefined;
472
+ }[];
473
+ } & {
474
+ id: string;
475
+ name: string;
476
+ slug: string;
477
+ createdAt: Date;
478
+ logo?: string | null | undefined | undefined;
479
+ metadata?: any;
480
+ }, {
481
+ code?: string | undefined;
482
+ message?: string | undefined;
483
+ }, FetchOptions["throw"] extends true ? true : true>>;
484
+ };
485
+ } & {
486
+ organization: {
487
+ getFullOrganization: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
488
+ organizationId?: string | undefined;
489
+ organizationSlug?: string | undefined;
490
+ membersLimit?: string | number | undefined;
491
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
492
+ query?: {
493
+ organizationId?: string | undefined;
494
+ organizationSlug?: string | undefined;
495
+ membersLimit?: string | number | undefined;
496
+ } | undefined;
497
+ fetchOptions?: FetchOptions | undefined;
498
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
499
+ members: {
500
+ id: string;
501
+ organizationId: string;
502
+ role: "org:admin" | "org:member" | "org:reviewer";
503
+ createdAt: Date;
504
+ userId: string;
505
+ teamId?: string | undefined | undefined;
506
+ user: {
507
+ id: string;
508
+ email: string;
509
+ name: string;
510
+ image?: string | undefined;
511
+ };
512
+ }[];
513
+ invitations: {
514
+ id: string;
515
+ organizationId: string;
516
+ email: string;
517
+ role: "org:admin" | "org:member" | "org:reviewer";
518
+ status: better_auth_plugins.InvitationStatus;
519
+ inviterId: string;
520
+ expiresAt: Date;
521
+ createdAt: Date;
522
+ teamId?: string | undefined | undefined;
523
+ }[];
524
+ teams: {
525
+ id: string;
526
+ name: string;
527
+ organizationId: string;
528
+ createdAt: Date;
529
+ updatedAt?: Date | undefined;
530
+ }[];
531
+ } & {
532
+ id: string;
533
+ name: string;
534
+ slug: string;
535
+ createdAt: Date;
536
+ logo?: string | null | undefined | undefined;
537
+ metadata?: any;
538
+ }, {
539
+ code?: string | undefined;
540
+ message?: string | undefined;
541
+ }, FetchOptions["throw"] extends true ? true : true>>;
542
+ };
543
+ } & {
544
+ organization: {
545
+ list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
546
+ query?: Record<string, any> | undefined;
547
+ fetchOptions?: FetchOptions | undefined;
548
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
549
+ id: string;
550
+ name: string;
551
+ slug: string;
552
+ createdAt: Date;
553
+ logo?: string | null | undefined | undefined;
554
+ metadata?: any;
555
+ }[], {
556
+ code?: string | undefined;
557
+ message?: string | undefined;
558
+ }, FetchOptions["throw"] extends true ? true : true>>;
559
+ };
560
+ } & {
561
+ organization: {
562
+ inviteMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
563
+ email: string;
564
+ role: "org:admin" | "org:member" | "org:reviewer" | ("org:admin" | "org:member" | "org:reviewer")[];
565
+ organizationId?: string | undefined;
566
+ resend?: boolean | undefined;
567
+ } & {
568
+ teamId?: (string | string[]) | undefined;
569
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
570
+ email: string;
571
+ role: "org:admin" | "org:member" | "org:reviewer" | ("org:admin" | "org:member" | "org:reviewer")[];
572
+ organizationId?: string | undefined;
573
+ resend?: boolean | undefined;
574
+ } & {
575
+ teamId?: (string | string[]) | undefined;
576
+ } & {
577
+ fetchOptions?: FetchOptions | undefined;
578
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
579
+ id: string;
580
+ organizationId: string;
581
+ email: string;
582
+ role: "org:admin" | "org:member" | "org:reviewer";
583
+ status: better_auth_plugins.InvitationStatus;
584
+ inviterId: string;
585
+ expiresAt: Date;
586
+ createdAt: Date;
587
+ teamId?: string | undefined | undefined;
588
+ } | {
589
+ id: string;
590
+ organizationId: string;
591
+ email: string;
592
+ role: "org:admin" | "org:member" | "org:reviewer";
593
+ status: better_auth_plugins.InvitationStatus;
594
+ inviterId: string;
595
+ expiresAt: Date;
596
+ createdAt: Date;
597
+ teamId?: string | undefined | undefined;
598
+ }>, {
599
+ code?: string | undefined;
600
+ message?: string | undefined;
601
+ }, FetchOptions["throw"] extends true ? true : true>>;
602
+ };
603
+ } & {
604
+ organization: {
605
+ cancelInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
606
+ invitationId: string;
607
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
608
+ invitationId: string;
609
+ } & {
610
+ fetchOptions?: FetchOptions | undefined;
611
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
612
+ id: string;
613
+ organizationId: string;
614
+ email: string;
615
+ role: "org:admin" | "org:member" | "org:reviewer";
616
+ status: better_auth_plugins.InvitationStatus;
617
+ inviterId: string;
618
+ expiresAt: Date;
619
+ createdAt: Date;
620
+ teamId?: string | undefined | undefined;
621
+ }, {
622
+ code?: string | undefined;
623
+ message?: string | undefined;
624
+ }, FetchOptions["throw"] extends true ? true : true>>;
625
+ };
626
+ } & {
627
+ organization: {
628
+ acceptInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
629
+ invitationId: string;
630
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
631
+ invitationId: string;
632
+ } & {
633
+ fetchOptions?: FetchOptions | undefined;
634
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
635
+ invitation: {
636
+ id: string;
637
+ organizationId: string;
638
+ email: string;
639
+ role: "org:admin" | "org:member" | "org:reviewer";
640
+ status: better_auth_plugins.InvitationStatus;
641
+ inviterId: string;
642
+ expiresAt: Date;
643
+ createdAt: Date;
644
+ teamId?: string | undefined | undefined;
645
+ };
646
+ member: {
647
+ id: string;
648
+ organizationId: string;
649
+ userId: string;
650
+ role: string;
651
+ createdAt: Date;
652
+ };
653
+ }, {
654
+ code?: string | undefined;
655
+ message?: string | undefined;
656
+ }, FetchOptions["throw"] extends true ? true : true>>;
657
+ };
658
+ } & {
659
+ organization: {
660
+ getInvitation: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
661
+ id: string;
662
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
663
+ query: {
664
+ id: string;
665
+ };
666
+ fetchOptions?: FetchOptions | undefined;
667
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
668
+ id: string;
669
+ organizationId: string;
670
+ email: string;
671
+ role: "org:admin" | "org:member" | "org:reviewer";
672
+ status: better_auth_plugins.InvitationStatus;
673
+ inviterId: string;
674
+ expiresAt: Date;
675
+ createdAt: Date;
676
+ teamId?: string | undefined | undefined;
677
+ } & {
678
+ organizationName: string;
679
+ organizationSlug: string;
680
+ inviterEmail: string;
681
+ }>, {
682
+ code?: string | undefined;
683
+ message?: string | undefined;
684
+ }, FetchOptions["throw"] extends true ? true : true>>;
685
+ };
686
+ } & {
687
+ organization: {
688
+ rejectInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
689
+ invitationId: string;
690
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
691
+ invitationId: string;
692
+ } & {
693
+ fetchOptions?: FetchOptions | undefined;
694
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
695
+ invitation: {
696
+ id: string;
697
+ organizationId: string;
698
+ email: string;
699
+ role: "admin" | "member" | "owner";
700
+ status: better_auth_plugins.InvitationStatus;
701
+ inviterId: string;
702
+ expiresAt: Date;
703
+ createdAt: Date;
704
+ } | null;
705
+ member: null;
706
+ }, {
707
+ code?: string | undefined;
708
+ message?: string | undefined;
709
+ }, FetchOptions["throw"] extends true ? true : true>>;
710
+ };
711
+ } & {
712
+ organization: {
713
+ listInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
714
+ organizationId?: string | undefined;
715
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
716
+ query?: {
717
+ organizationId?: string | undefined;
718
+ } | undefined;
719
+ fetchOptions?: FetchOptions | undefined;
720
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
721
+ id: string;
722
+ organizationId: string;
723
+ email: string;
724
+ role: "org:admin" | "org:member" | "org:reviewer";
725
+ status: better_auth_plugins.InvitationStatus;
726
+ inviterId: string;
727
+ expiresAt: Date;
728
+ createdAt: Date;
729
+ teamId?: string | undefined | undefined;
730
+ }[], {
731
+ code?: string | undefined;
732
+ message?: string | undefined;
733
+ }, FetchOptions["throw"] extends true ? true : true>>;
734
+ };
735
+ } & {
736
+ organization: {
737
+ getActiveMember: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
738
+ query?: Record<string, any> | undefined;
739
+ fetchOptions?: FetchOptions | undefined;
740
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<Omit<{
741
+ id: string;
742
+ organizationId: string;
743
+ role: "org:admin" | "org:member" | "org:reviewer";
744
+ createdAt: Date;
745
+ userId: string;
746
+ teamId?: string | undefined | undefined;
747
+ user: {
748
+ id: string;
749
+ email: string;
750
+ name: string;
751
+ image?: string | undefined;
752
+ };
753
+ } & {
754
+ user: {
755
+ id: string;
756
+ createdAt: Date;
757
+ updatedAt: Date;
758
+ email: string;
759
+ emailVerified: boolean;
760
+ name: string;
761
+ image?: string | null | undefined;
762
+ };
763
+ }, "user"> & {
764
+ user: {
765
+ id: string;
766
+ name: string;
767
+ email: string;
768
+ image: string | undefined;
769
+ };
770
+ }>, {
771
+ code?: string | undefined;
772
+ message?: string | undefined;
773
+ }, FetchOptions["throw"] extends true ? true : true>>;
774
+ };
775
+ } & {
776
+ organization: {
777
+ checkSlug: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
778
+ slug: string;
779
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
780
+ slug: string;
781
+ } & {
782
+ fetchOptions?: FetchOptions | undefined;
783
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
784
+ status: boolean;
785
+ }, {
786
+ code?: string | undefined;
787
+ message?: string | undefined;
788
+ }, FetchOptions["throw"] extends true ? true : true>>;
789
+ };
790
+ } & {
791
+ organization: {
792
+ removeMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
793
+ memberIdOrEmail: string;
794
+ organizationId?: string | undefined;
795
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
796
+ memberIdOrEmail: string;
797
+ organizationId?: string | undefined;
798
+ } & {
799
+ fetchOptions?: FetchOptions | undefined;
800
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
801
+ member: {
802
+ id: string;
803
+ organizationId: string;
804
+ role: "org:admin" | "org:member" | "org:reviewer";
805
+ createdAt: Date;
806
+ userId: string;
807
+ teamId?: string | undefined | undefined;
808
+ user: {
809
+ id: string;
810
+ email: string;
811
+ name: string;
812
+ image?: string | undefined;
813
+ };
814
+ };
815
+ }, {
816
+ code?: string | undefined;
817
+ message?: string | undefined;
818
+ }, FetchOptions["throw"] extends true ? true : true>>;
819
+ };
820
+ } & {
821
+ organization: {
822
+ updateMemberRole: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
823
+ role: better_auth.LiteralString | "org:admin" | "org:member" | "org:reviewer" | better_auth.LiteralString[] | ("org:admin" | "org:member" | "org:reviewer")[];
824
+ memberId: string;
825
+ organizationId?: string | undefined;
826
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
827
+ role: better_auth.LiteralString | "org:admin" | "org:member" | "org:reviewer" | better_auth.LiteralString[] | ("org:admin" | "org:member" | "org:reviewer")[];
828
+ memberId: string;
829
+ organizationId?: string | undefined;
830
+ } & {
831
+ fetchOptions?: FetchOptions | undefined;
832
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
833
+ id: string;
834
+ organizationId: string;
835
+ role: "admin" | "member" | "owner";
836
+ createdAt: Date;
837
+ userId: string;
838
+ user: {
839
+ id: string;
840
+ email: string;
841
+ name: string;
842
+ image?: string | undefined;
843
+ };
844
+ }, {
845
+ code?: string | undefined;
846
+ message?: string | undefined;
847
+ }, FetchOptions["throw"] extends true ? true : true>>;
848
+ };
849
+ } & {
850
+ organization: {
851
+ leave: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
852
+ organizationId: string;
853
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
854
+ organizationId: string;
855
+ } & {
856
+ fetchOptions?: FetchOptions | undefined;
857
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<Omit<{
858
+ id: string;
859
+ organizationId: string;
860
+ role: "org:admin" | "org:member" | "org:reviewer";
861
+ createdAt: Date;
862
+ userId: string;
863
+ teamId?: string | undefined | undefined;
864
+ user: {
865
+ id: string;
866
+ email: string;
867
+ name: string;
868
+ image?: string | undefined;
869
+ };
870
+ } & {
871
+ user: {
872
+ id: string;
873
+ createdAt: Date;
874
+ updatedAt: Date;
875
+ email: string;
876
+ emailVerified: boolean;
877
+ name: string;
878
+ image?: string | null | undefined;
879
+ };
880
+ }, "user"> & {
881
+ user: {
882
+ id: string;
883
+ name: string;
884
+ email: string;
885
+ image: string | undefined;
886
+ };
887
+ }>, {
888
+ code?: string | undefined;
889
+ message?: string | undefined;
890
+ }, FetchOptions["throw"] extends true ? true : true>>;
891
+ };
892
+ } & {
893
+ organization: {
894
+ listUserInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
895
+ email?: string | undefined;
896
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
897
+ query?: {
898
+ email?: string | undefined;
899
+ } | undefined;
900
+ fetchOptions?: FetchOptions | undefined;
901
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
902
+ id: string;
903
+ organizationId: string;
904
+ email: string;
905
+ role: "org:admin" | "org:member" | "org:reviewer";
906
+ status: better_auth_plugins.InvitationStatus;
907
+ inviterId: string;
908
+ expiresAt: Date;
909
+ createdAt: Date;
910
+ teamId?: string | undefined | undefined;
911
+ } & {
912
+ organization: {
913
+ id: string;
914
+ name: string;
915
+ slug: string;
916
+ createdAt: Date;
917
+ logo?: string | null | undefined | undefined;
918
+ metadata?: any;
919
+ };
920
+ }, "organization"> & {
921
+ organizationName: string;
922
+ })[], {
923
+ code?: string | undefined;
924
+ message?: string | undefined;
925
+ }, FetchOptions["throw"] extends true ? true : true>>;
926
+ };
927
+ } & {
928
+ organization: {
929
+ listMembers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
930
+ limit?: string | number | undefined;
931
+ offset?: string | number | undefined;
932
+ sortBy?: string | undefined;
933
+ sortDirection?: "asc" | "desc" | undefined;
934
+ filterField?: string | undefined;
935
+ filterValue?: string | number | boolean | string[] | number[] | undefined;
936
+ filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
937
+ organizationId?: string | undefined;
938
+ organizationSlug?: string | undefined;
939
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
940
+ query?: {
941
+ limit?: string | number | undefined;
942
+ offset?: string | number | undefined;
943
+ sortBy?: string | undefined;
944
+ sortDirection?: "asc" | "desc" | undefined;
945
+ filterField?: string | undefined;
946
+ filterValue?: string | number | boolean | string[] | number[] | undefined;
947
+ filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
948
+ organizationId?: string | undefined;
949
+ organizationSlug?: string | undefined;
950
+ } | undefined;
951
+ fetchOptions?: FetchOptions | undefined;
952
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
953
+ members: ({
954
+ id: string;
955
+ organizationId: string;
956
+ role: "org:admin" | "org:member" | "org:reviewer";
957
+ createdAt: Date;
958
+ userId: string;
959
+ teamId?: string | undefined | undefined;
960
+ user: {
961
+ id: string;
962
+ email: string;
963
+ name: string;
964
+ image?: string | undefined;
965
+ };
966
+ } & {
967
+ user: {
968
+ id: string;
969
+ name: string;
970
+ email: string;
971
+ image: string | null | undefined;
972
+ };
973
+ })[];
974
+ total: number;
975
+ }, {
976
+ code?: string | undefined;
977
+ message?: string | undefined;
978
+ }, FetchOptions["throw"] extends true ? true : true>>;
979
+ };
980
+ } & {
981
+ organization: {
982
+ getActiveMemberRole: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
983
+ userId?: string | undefined;
984
+ organizationId?: string | undefined;
985
+ organizationSlug?: string | undefined;
986
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
987
+ query?: {
988
+ userId?: string | undefined;
989
+ organizationId?: string | undefined;
990
+ organizationSlug?: string | undefined;
991
+ } | undefined;
992
+ fetchOptions?: FetchOptions | undefined;
993
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
994
+ role: "org:admin" | "org:member" | "org:reviewer";
995
+ }, {
996
+ code?: string | undefined;
997
+ message?: string | undefined;
998
+ }, FetchOptions["throw"] extends true ? true : true>>;
999
+ };
1000
+ } & {
1001
+ organization: {
1002
+ hasPermission: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1003
+ permissions: {
1004
+ access?: string[] | undefined;
1005
+ organization?: ("update" | "delete")[] | undefined;
1006
+ member?: ("update" | "delete" | "create")[] | undefined;
1007
+ invitation?: ("create" | "cancel")[] | undefined;
1008
+ team?: ("update" | "delete" | "create")[] | undefined;
1009
+ ac?: ("update" | "delete" | "create" | "read")[] | undefined;
1010
+ };
1011
+ } & {
1012
+ organizationId?: string | undefined;
1013
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1014
+ permissions: {
1015
+ access?: string[] | undefined;
1016
+ organization?: ("update" | "delete")[] | undefined;
1017
+ member?: ("update" | "delete" | "create")[] | undefined;
1018
+ invitation?: ("create" | "cancel")[] | undefined;
1019
+ team?: ("update" | "delete" | "create")[] | undefined;
1020
+ ac?: ("update" | "delete" | "create" | "read")[] | undefined;
1021
+ };
1022
+ } & {
1023
+ organizationId?: string | undefined;
1024
+ } & {
1025
+ fetchOptions?: FetchOptions | undefined;
1026
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1027
+ error: null;
1028
+ success: boolean;
1029
+ }, {
1030
+ code?: string | undefined;
1031
+ message?: string | undefined;
1032
+ }, FetchOptions["throw"] extends true ? true : true>>;
1033
+ };
1034
+ } & {
1035
+ organization: {
1036
+ createTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1037
+ name: string;
1038
+ organizationId?: string | undefined;
1039
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1040
+ name: string;
1041
+ organizationId?: string | undefined;
1042
+ } & {
1043
+ fetchOptions?: FetchOptions | undefined;
1044
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1045
+ id: string;
1046
+ name: string;
1047
+ organizationId: string;
1048
+ createdAt: Date;
1049
+ updatedAt?: Date | undefined;
1050
+ }, {
1051
+ code?: string | undefined;
1052
+ message?: string | undefined;
1053
+ }, FetchOptions["throw"] extends true ? true : true>>;
1054
+ };
1055
+ } & {
1056
+ organization: {
1057
+ listTeams: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1058
+ organizationId?: string | undefined;
1059
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1060
+ query?: {
1061
+ organizationId?: string | undefined;
1062
+ } | undefined;
1063
+ fetchOptions?: FetchOptions | undefined;
1064
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1065
+ id: string;
1066
+ name: string;
1067
+ organizationId: string;
1068
+ createdAt: Date;
1069
+ updatedAt?: Date | undefined;
1070
+ }[], {
1071
+ code?: string | undefined;
1072
+ message?: string | undefined;
1073
+ }, FetchOptions["throw"] extends true ? true : true>>;
1074
+ };
1075
+ } & {
1076
+ organization: {
1077
+ removeTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1078
+ teamId: string;
1079
+ organizationId?: string | undefined;
1080
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1081
+ teamId: string;
1082
+ organizationId?: string | undefined;
1083
+ } & {
1084
+ fetchOptions?: FetchOptions | undefined;
1085
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1086
+ message: string;
1087
+ }, {
1088
+ code?: string | undefined;
1089
+ message?: string | undefined;
1090
+ }, FetchOptions["throw"] extends true ? true : true>>;
1091
+ };
1092
+ } & {
1093
+ organization: {
1094
+ updateTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1095
+ teamId: string;
1096
+ data: Partial<{
1097
+ name: string;
1098
+ organizationId: string;
1099
+ }>;
1100
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1101
+ teamId: string;
1102
+ data: Partial<{
1103
+ name: string;
1104
+ organizationId: string;
1105
+ }>;
1106
+ } & {
1107
+ fetchOptions?: FetchOptions | undefined;
1108
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1109
+ id: string;
1110
+ name: string;
1111
+ organizationId: string;
1112
+ createdAt: Date;
1113
+ updatedAt?: Date | undefined;
1114
+ }, {
1115
+ code?: string | undefined;
1116
+ message?: string | undefined;
1117
+ }, FetchOptions["throw"] extends true ? true : true>>;
1118
+ };
1119
+ } & {
1120
+ organization: {
1121
+ setActiveTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1122
+ teamId?: string | null | undefined;
1123
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1124
+ teamId?: string | null | undefined;
1125
+ } & {
1126
+ fetchOptions?: FetchOptions | undefined;
1127
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1128
+ id: string;
1129
+ name: string;
1130
+ organizationId: string;
1131
+ createdAt: Date;
1132
+ updatedAt?: Date | undefined;
1133
+ }, {
1134
+ code?: string | undefined;
1135
+ message?: string | undefined;
1136
+ }, FetchOptions["throw"] extends true ? true : true>>;
1137
+ };
1138
+ } & {
1139
+ organization: {
1140
+ listUserTeams: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1141
+ query?: Record<string, any> | undefined;
1142
+ fetchOptions?: FetchOptions | undefined;
1143
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1144
+ id: string;
1145
+ name: string;
1146
+ organizationId: string;
1147
+ createdAt: Date;
1148
+ updatedAt?: Date | undefined;
1149
+ }[], {
1150
+ code?: string | undefined;
1151
+ message?: string | undefined;
1152
+ }, FetchOptions["throw"] extends true ? true : true>>;
1153
+ };
1154
+ } & {
1155
+ organization: {
1156
+ listTeamMembers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1157
+ teamId?: string | undefined;
1158
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1159
+ query?: {
1160
+ teamId?: string | undefined;
1161
+ } | undefined;
1162
+ fetchOptions?: FetchOptions | undefined;
1163
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1164
+ id: string;
1165
+ teamId: string;
1166
+ userId: string;
1167
+ createdAt: Date;
1168
+ }[], {
1169
+ code?: string | undefined;
1170
+ message?: string | undefined;
1171
+ }, FetchOptions["throw"] extends true ? true : true>>;
1172
+ };
1173
+ } & {
1174
+ organization: {
1175
+ addTeamMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1176
+ teamId: string;
1177
+ userId: unknown;
1178
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1179
+ teamId: string;
1180
+ userId: unknown;
1181
+ } & {
1182
+ fetchOptions?: FetchOptions | undefined;
1183
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1184
+ id: string;
1185
+ teamId: string;
1186
+ userId: string;
1187
+ createdAt: Date;
1188
+ }, {
1189
+ code?: string | undefined;
1190
+ message?: string | undefined;
1191
+ }, FetchOptions["throw"] extends true ? true : true>>;
1192
+ };
1193
+ } & {
1194
+ organization: {
1195
+ removeTeamMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1196
+ teamId: string;
1197
+ userId: unknown;
1198
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1199
+ teamId: string;
1200
+ userId: unknown;
1201
+ } & {
1202
+ fetchOptions?: FetchOptions | undefined;
1203
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1204
+ message: string;
1205
+ }, {
1206
+ code?: string | undefined;
1207
+ message?: string | undefined;
1208
+ }, FetchOptions["throw"] extends true ? true : true>>;
1209
+ };
1210
+ } & {
1211
+ sso: {
1212
+ saml2: {
1213
+ sp: {
1214
+ metadata: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1215
+ providerId: string;
1216
+ format?: "json" | "xml" | undefined;
1217
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1218
+ query: {
1219
+ providerId: string;
1220
+ format?: "json" | "xml" | undefined;
1221
+ };
1222
+ fetchOptions?: FetchOptions | undefined;
1223
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Response, {
1224
+ code?: string | undefined;
1225
+ message?: string | undefined;
1226
+ }, FetchOptions["throw"] extends true ? true : true>>;
1227
+ };
1228
+ };
1229
+ };
1230
+ } & {
1231
+ sso: {
1232
+ register: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1233
+ providerId: string;
1234
+ issuer: string;
1235
+ domain: string;
1236
+ oidcConfig?: {
1237
+ clientId: string;
1238
+ clientSecret: string;
1239
+ authorizationEndpoint?: string | undefined;
1240
+ tokenEndpoint?: string | undefined;
1241
+ userInfoEndpoint?: string | undefined;
1242
+ tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
1243
+ jwksEndpoint?: string | undefined;
1244
+ discoveryEndpoint?: string | undefined;
1245
+ skipDiscovery?: boolean | undefined;
1246
+ scopes?: string[] | undefined;
1247
+ pkce?: boolean | undefined;
1248
+ mapping?: {
1249
+ id: string;
1250
+ email: string;
1251
+ name: string;
1252
+ emailVerified?: string | undefined;
1253
+ image?: string | undefined;
1254
+ extraFields?: Record<string, any> | undefined;
1255
+ } | undefined;
1256
+ } | undefined;
1257
+ samlConfig?: {
1258
+ entryPoint: string;
1259
+ cert: string;
1260
+ callbackUrl: string;
1261
+ spMetadata: {
1262
+ metadata?: string | undefined;
1263
+ entityID?: string | undefined;
1264
+ binding?: string | undefined;
1265
+ privateKey?: string | undefined;
1266
+ privateKeyPass?: string | undefined;
1267
+ isAssertionEncrypted?: boolean | undefined;
1268
+ encPrivateKey?: string | undefined;
1269
+ encPrivateKeyPass?: string | undefined;
1270
+ };
1271
+ audience?: string | undefined;
1272
+ idpMetadata?: {
1273
+ metadata?: string | undefined;
1274
+ entityID?: string | undefined;
1275
+ cert?: string | undefined;
1276
+ privateKey?: string | undefined;
1277
+ privateKeyPass?: string | undefined;
1278
+ isAssertionEncrypted?: boolean | undefined;
1279
+ encPrivateKey?: string | undefined;
1280
+ encPrivateKeyPass?: string | undefined;
1281
+ singleSignOnService?: {
1282
+ Binding: string;
1283
+ Location: string;
1284
+ }[] | undefined;
1285
+ } | undefined;
1286
+ wantAssertionsSigned?: boolean | undefined;
1287
+ authnRequestsSigned?: boolean | undefined;
1288
+ signatureAlgorithm?: string | undefined;
1289
+ digestAlgorithm?: string | undefined;
1290
+ identifierFormat?: string | undefined;
1291
+ privateKey?: string | undefined;
1292
+ decryptionPvk?: string | undefined;
1293
+ additionalParams?: Record<string, any> | undefined;
1294
+ mapping?: {
1295
+ id: string;
1296
+ email: string;
1297
+ name: string;
1298
+ emailVerified?: string | undefined;
1299
+ firstName?: string | undefined;
1300
+ lastName?: string | undefined;
1301
+ extraFields?: Record<string, any> | undefined;
1302
+ } | undefined;
1303
+ } | undefined;
1304
+ organizationId?: string | undefined;
1305
+ overrideUserInfo?: boolean | undefined;
1306
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1307
+ providerId: string;
1308
+ issuer: string;
1309
+ domain: string;
1310
+ oidcConfig?: {
1311
+ clientId: string;
1312
+ clientSecret: string;
1313
+ authorizationEndpoint?: string | undefined;
1314
+ tokenEndpoint?: string | undefined;
1315
+ userInfoEndpoint?: string | undefined;
1316
+ tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
1317
+ jwksEndpoint?: string | undefined;
1318
+ discoveryEndpoint?: string | undefined;
1319
+ skipDiscovery?: boolean | undefined;
1320
+ scopes?: string[] | undefined;
1321
+ pkce?: boolean | undefined;
1322
+ mapping?: {
1323
+ id: string;
1324
+ email: string;
1325
+ name: string;
1326
+ emailVerified?: string | undefined;
1327
+ image?: string | undefined;
1328
+ extraFields?: Record<string, any> | undefined;
1329
+ } | undefined;
1330
+ } | undefined;
1331
+ samlConfig?: {
1332
+ entryPoint: string;
1333
+ cert: string;
1334
+ callbackUrl: string;
1335
+ spMetadata: {
1336
+ metadata?: string | undefined;
1337
+ entityID?: string | undefined;
1338
+ binding?: string | undefined;
1339
+ privateKey?: string | undefined;
1340
+ privateKeyPass?: string | undefined;
1341
+ isAssertionEncrypted?: boolean | undefined;
1342
+ encPrivateKey?: string | undefined;
1343
+ encPrivateKeyPass?: string | undefined;
1344
+ };
1345
+ audience?: string | undefined;
1346
+ idpMetadata?: {
1347
+ metadata?: string | undefined;
1348
+ entityID?: string | undefined;
1349
+ cert?: string | undefined;
1350
+ privateKey?: string | undefined;
1351
+ privateKeyPass?: string | undefined;
1352
+ isAssertionEncrypted?: boolean | undefined;
1353
+ encPrivateKey?: string | undefined;
1354
+ encPrivateKeyPass?: string | undefined;
1355
+ singleSignOnService?: {
1356
+ Binding: string;
1357
+ Location: string;
1358
+ }[] | undefined;
1359
+ } | undefined;
1360
+ wantAssertionsSigned?: boolean | undefined;
1361
+ authnRequestsSigned?: boolean | undefined;
1362
+ signatureAlgorithm?: string | undefined;
1363
+ digestAlgorithm?: string | undefined;
1364
+ identifierFormat?: string | undefined;
1365
+ privateKey?: string | undefined;
1366
+ decryptionPvk?: string | undefined;
1367
+ additionalParams?: Record<string, any> | undefined;
1368
+ mapping?: {
1369
+ id: string;
1370
+ email: string;
1371
+ name: string;
1372
+ emailVerified?: string | undefined;
1373
+ firstName?: string | undefined;
1374
+ lastName?: string | undefined;
1375
+ extraFields?: Record<string, any> | undefined;
1376
+ } | undefined;
1377
+ } | undefined;
1378
+ organizationId?: string | undefined;
1379
+ overrideUserInfo?: boolean | undefined;
1380
+ } & {
1381
+ fetchOptions?: FetchOptions | undefined;
1382
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
1383
+ redirectURI: string;
1384
+ oidcConfig: _better_auth_sso.OIDCConfig | null;
1385
+ samlConfig: _better_auth_sso.SAMLConfig | null;
1386
+ } & Omit<{
1387
+ issuer: string;
1388
+ oidcConfig?: _better_auth_sso.OIDCConfig | undefined;
1389
+ samlConfig?: _better_auth_sso.SAMLConfig | undefined;
1390
+ userId: string;
1391
+ providerId: string;
1392
+ organizationId?: string | undefined;
1393
+ domain: string;
1394
+ }, "oidcConfig" | "samlConfig">>, {
1395
+ code?: string | undefined;
1396
+ message?: string | undefined;
1397
+ }, FetchOptions["throw"] extends true ? true : true>>;
1398
+ };
1399
+ } & {
1400
+ signIn: {
1401
+ sso: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1402
+ callbackURL: string;
1403
+ email?: string | undefined;
1404
+ organizationSlug?: string | undefined;
1405
+ providerId?: string | undefined;
1406
+ domain?: string | undefined;
1407
+ errorCallbackURL?: string | undefined;
1408
+ newUserCallbackURL?: string | undefined;
1409
+ scopes?: string[] | undefined;
1410
+ loginHint?: string | undefined;
1411
+ requestSignUp?: boolean | undefined;
1412
+ providerType?: "saml" | "oidc" | undefined;
1413
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1414
+ callbackURL: string;
1415
+ email?: string | undefined;
1416
+ organizationSlug?: string | undefined;
1417
+ providerId?: string | undefined;
1418
+ domain?: string | undefined;
1419
+ errorCallbackURL?: string | undefined;
1420
+ newUserCallbackURL?: string | undefined;
1421
+ scopes?: string[] | undefined;
1422
+ loginHint?: string | undefined;
1423
+ requestSignUp?: boolean | undefined;
1424
+ providerType?: "saml" | "oidc" | undefined;
1425
+ } & {
1426
+ fetchOptions?: FetchOptions | undefined;
1427
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1428
+ url: string;
1429
+ redirect: boolean;
1430
+ }, {
1431
+ code?: string | undefined;
1432
+ message?: string | undefined;
1433
+ }, FetchOptions["throw"] extends true ? true : true>>;
1434
+ };
1435
+ } & {
1436
+ sso: {
1437
+ providers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1438
+ query?: Record<string, any> | undefined;
1439
+ fetchOptions?: FetchOptions | undefined;
1440
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1441
+ providers: {
1442
+ providerId: string;
1443
+ type: string;
1444
+ issuer: string;
1445
+ domain: string;
1446
+ organizationId: string | null;
1447
+ domainVerified: boolean;
1448
+ oidcConfig: {
1449
+ discoveryEndpoint: string;
1450
+ clientIdLastFour: string;
1451
+ pkce: boolean;
1452
+ authorizationEndpoint: string | undefined;
1453
+ tokenEndpoint: string | undefined;
1454
+ userInfoEndpoint: string | undefined;
1455
+ jwksEndpoint: string | undefined;
1456
+ scopes: string[] | undefined;
1457
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
1458
+ } | undefined;
1459
+ samlConfig: {
1460
+ entryPoint: string;
1461
+ callbackUrl: string;
1462
+ audience: string | undefined;
1463
+ wantAssertionsSigned: boolean | undefined;
1464
+ authnRequestsSigned: boolean | undefined;
1465
+ identifierFormat: string | undefined;
1466
+ signatureAlgorithm: string | undefined;
1467
+ digestAlgorithm: string | undefined;
1468
+ certificate: {
1469
+ fingerprintSha256: string;
1470
+ notBefore: string;
1471
+ notAfter: string;
1472
+ publicKeyAlgorithm: string;
1473
+ } | {
1474
+ error: string;
1475
+ };
1476
+ } | undefined;
1477
+ spMetadataUrl: string;
1478
+ }[];
1479
+ }, {
1480
+ code?: string | undefined;
1481
+ message?: string | undefined;
1482
+ }, FetchOptions["throw"] extends true ? true : true>>;
1483
+ };
1484
+ } & {
1485
+ sso: {
1486
+ getProvider: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1487
+ providerId: string;
1488
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1489
+ query: {
1490
+ providerId: string;
1491
+ };
1492
+ fetchOptions?: FetchOptions | undefined;
1493
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1494
+ providerId: string;
1495
+ type: string;
1496
+ issuer: string;
1497
+ domain: string;
1498
+ organizationId: string | null;
1499
+ domainVerified: boolean;
1500
+ oidcConfig: {
1501
+ discoveryEndpoint: string;
1502
+ clientIdLastFour: string;
1503
+ pkce: boolean;
1504
+ authorizationEndpoint: string | undefined;
1505
+ tokenEndpoint: string | undefined;
1506
+ userInfoEndpoint: string | undefined;
1507
+ jwksEndpoint: string | undefined;
1508
+ scopes: string[] | undefined;
1509
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
1510
+ } | undefined;
1511
+ samlConfig: {
1512
+ entryPoint: string;
1513
+ callbackUrl: string;
1514
+ audience: string | undefined;
1515
+ wantAssertionsSigned: boolean | undefined;
1516
+ authnRequestsSigned: boolean | undefined;
1517
+ identifierFormat: string | undefined;
1518
+ signatureAlgorithm: string | undefined;
1519
+ digestAlgorithm: string | undefined;
1520
+ certificate: {
1521
+ fingerprintSha256: string;
1522
+ notBefore: string;
1523
+ notAfter: string;
1524
+ publicKeyAlgorithm: string;
1525
+ } | {
1526
+ error: string;
1527
+ };
1528
+ } | undefined;
1529
+ spMetadataUrl: string;
1530
+ }, {
1531
+ code?: string | undefined;
1532
+ message?: string | undefined;
1533
+ }, FetchOptions["throw"] extends true ? true : true>>;
1534
+ };
1535
+ } & {
1536
+ sso: {
1537
+ updateProvider: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1538
+ providerId: string;
1539
+ issuer?: string | undefined;
1540
+ domain?: string | undefined;
1541
+ oidcConfig?: {
1542
+ clientId?: string | undefined;
1543
+ clientSecret?: string | undefined;
1544
+ authorizationEndpoint?: string | undefined;
1545
+ tokenEndpoint?: string | undefined;
1546
+ userInfoEndpoint?: string | undefined;
1547
+ tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
1548
+ jwksEndpoint?: string | undefined;
1549
+ discoveryEndpoint?: string | undefined;
1550
+ scopes?: string[] | undefined;
1551
+ pkce?: boolean | undefined;
1552
+ overrideUserInfo?: boolean | undefined;
1553
+ mapping?: {
1554
+ id?: string | undefined;
1555
+ email?: string | undefined;
1556
+ emailVerified?: string | undefined;
1557
+ name?: string | undefined;
1558
+ image?: string | undefined;
1559
+ extraFields?: Record<string, any> | undefined;
1560
+ } | undefined;
1561
+ } | undefined;
1562
+ samlConfig?: {
1563
+ entryPoint?: string | undefined;
1564
+ cert?: string | undefined;
1565
+ callbackUrl?: string | undefined;
1566
+ audience?: string | undefined;
1567
+ idpMetadata?: {
1568
+ metadata?: string | undefined;
1569
+ entityID?: string | undefined;
1570
+ cert?: string | undefined;
1571
+ privateKey?: string | undefined;
1572
+ privateKeyPass?: string | undefined;
1573
+ isAssertionEncrypted?: boolean | undefined;
1574
+ encPrivateKey?: string | undefined;
1575
+ encPrivateKeyPass?: string | undefined;
1576
+ singleSignOnService?: {
1577
+ Binding: string;
1578
+ Location: string;
1579
+ }[] | undefined;
1580
+ } | undefined;
1581
+ spMetadata?: {
1582
+ metadata?: string | undefined;
1583
+ entityID?: string | undefined;
1584
+ binding?: string | undefined;
1585
+ privateKey?: string | undefined;
1586
+ privateKeyPass?: string | undefined;
1587
+ isAssertionEncrypted?: boolean | undefined;
1588
+ encPrivateKey?: string | undefined;
1589
+ encPrivateKeyPass?: string | undefined;
1590
+ } | undefined;
1591
+ wantAssertionsSigned?: boolean | undefined;
1592
+ authnRequestsSigned?: boolean | undefined;
1593
+ signatureAlgorithm?: string | undefined;
1594
+ digestAlgorithm?: string | undefined;
1595
+ identifierFormat?: string | undefined;
1596
+ privateKey?: string | undefined;
1597
+ decryptionPvk?: string | undefined;
1598
+ additionalParams?: Record<string, any> | undefined;
1599
+ mapping?: {
1600
+ id?: string | undefined;
1601
+ email?: string | undefined;
1602
+ emailVerified?: string | undefined;
1603
+ name?: string | undefined;
1604
+ firstName?: string | undefined;
1605
+ lastName?: string | undefined;
1606
+ extraFields?: Record<string, any> | undefined;
1607
+ } | undefined;
1608
+ } | undefined;
1609
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1610
+ providerId: string;
1611
+ issuer?: string | undefined;
1612
+ domain?: string | undefined;
1613
+ oidcConfig?: {
1614
+ clientId?: string | undefined;
1615
+ clientSecret?: string | undefined;
1616
+ authorizationEndpoint?: string | undefined;
1617
+ tokenEndpoint?: string | undefined;
1618
+ userInfoEndpoint?: string | undefined;
1619
+ tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
1620
+ jwksEndpoint?: string | undefined;
1621
+ discoveryEndpoint?: string | undefined;
1622
+ scopes?: string[] | undefined;
1623
+ pkce?: boolean | undefined;
1624
+ overrideUserInfo?: boolean | undefined;
1625
+ mapping?: {
1626
+ id?: string | undefined;
1627
+ email?: string | undefined;
1628
+ emailVerified?: string | undefined;
1629
+ name?: string | undefined;
1630
+ image?: string | undefined;
1631
+ extraFields?: Record<string, any> | undefined;
1632
+ } | undefined;
1633
+ } | undefined;
1634
+ samlConfig?: {
1635
+ entryPoint?: string | undefined;
1636
+ cert?: string | undefined;
1637
+ callbackUrl?: string | undefined;
1638
+ audience?: string | undefined;
1639
+ idpMetadata?: {
1640
+ metadata?: string | undefined;
1641
+ entityID?: string | undefined;
1642
+ cert?: string | undefined;
1643
+ privateKey?: string | undefined;
1644
+ privateKeyPass?: string | undefined;
1645
+ isAssertionEncrypted?: boolean | undefined;
1646
+ encPrivateKey?: string | undefined;
1647
+ encPrivateKeyPass?: string | undefined;
1648
+ singleSignOnService?: {
1649
+ Binding: string;
1650
+ Location: string;
1651
+ }[] | undefined;
1652
+ } | undefined;
1653
+ spMetadata?: {
1654
+ metadata?: string | undefined;
1655
+ entityID?: string | undefined;
1656
+ binding?: string | undefined;
1657
+ privateKey?: string | undefined;
1658
+ privateKeyPass?: string | undefined;
1659
+ isAssertionEncrypted?: boolean | undefined;
1660
+ encPrivateKey?: string | undefined;
1661
+ encPrivateKeyPass?: string | undefined;
1662
+ } | undefined;
1663
+ wantAssertionsSigned?: boolean | undefined;
1664
+ authnRequestsSigned?: boolean | undefined;
1665
+ signatureAlgorithm?: string | undefined;
1666
+ digestAlgorithm?: string | undefined;
1667
+ identifierFormat?: string | undefined;
1668
+ privateKey?: string | undefined;
1669
+ decryptionPvk?: string | undefined;
1670
+ additionalParams?: Record<string, any> | undefined;
1671
+ mapping?: {
1672
+ id?: string | undefined;
1673
+ email?: string | undefined;
1674
+ emailVerified?: string | undefined;
1675
+ name?: string | undefined;
1676
+ firstName?: string | undefined;
1677
+ lastName?: string | undefined;
1678
+ extraFields?: Record<string, any> | undefined;
1679
+ } | undefined;
1680
+ } | undefined;
1681
+ } & {
1682
+ fetchOptions?: FetchOptions | undefined;
1683
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1684
+ providerId: string;
1685
+ type: string;
1686
+ issuer: string;
1687
+ domain: string;
1688
+ organizationId: string | null;
1689
+ domainVerified: boolean;
1690
+ oidcConfig: {
1691
+ discoveryEndpoint: string;
1692
+ clientIdLastFour: string;
1693
+ pkce: boolean;
1694
+ authorizationEndpoint: string | undefined;
1695
+ tokenEndpoint: string | undefined;
1696
+ userInfoEndpoint: string | undefined;
1697
+ jwksEndpoint: string | undefined;
1698
+ scopes: string[] | undefined;
1699
+ tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
1700
+ } | undefined;
1701
+ samlConfig: {
1702
+ entryPoint: string;
1703
+ callbackUrl: string;
1704
+ audience: string | undefined;
1705
+ wantAssertionsSigned: boolean | undefined;
1706
+ authnRequestsSigned: boolean | undefined;
1707
+ identifierFormat: string | undefined;
1708
+ signatureAlgorithm: string | undefined;
1709
+ digestAlgorithm: string | undefined;
1710
+ certificate: {
1711
+ fingerprintSha256: string;
1712
+ notBefore: string;
1713
+ notAfter: string;
1714
+ publicKeyAlgorithm: string;
1715
+ } | {
1716
+ error: string;
1717
+ };
1718
+ } | undefined;
1719
+ spMetadataUrl: string;
1720
+ }, {
1721
+ code?: string | undefined;
1722
+ message?: string | undefined;
1723
+ }, FetchOptions["throw"] extends true ? true : true>>;
1724
+ };
1725
+ } & {
1726
+ sso: {
1727
+ deleteProvider: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1728
+ providerId: string;
1729
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1730
+ providerId: string;
1731
+ } & {
1732
+ fetchOptions?: FetchOptions | undefined;
1733
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1734
+ success: boolean;
1735
+ }, {
1736
+ code?: string | undefined;
1737
+ message?: string | undefined;
1738
+ }, FetchOptions["throw"] extends true ? true : true>>;
1739
+ };
1740
+ } & {
1741
+ twoFactor: {
1742
+ enable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1743
+ password: string;
1744
+ issuer?: string | undefined;
1745
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1746
+ password: string;
1747
+ issuer?: string | undefined;
1748
+ } & {
1749
+ fetchOptions?: FetchOptions | undefined;
1750
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1751
+ totpURI: string;
1752
+ backupCodes: string[];
1753
+ }, {
1754
+ code?: string | undefined;
1755
+ message?: string | undefined;
1756
+ }, FetchOptions["throw"] extends true ? true : true>>;
1757
+ };
1758
+ } & {
1759
+ twoFactor: {
1760
+ disable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1761
+ password: string;
1762
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1763
+ password: string;
1764
+ } & {
1765
+ fetchOptions?: FetchOptions | undefined;
1766
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1767
+ status: boolean;
1768
+ }, {
1769
+ code?: string | undefined;
1770
+ message?: string | undefined;
1771
+ }, FetchOptions["throw"] extends true ? true : true>>;
1772
+ };
1773
+ } & {
1774
+ twoFactor: {
1775
+ verifyBackupCode: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1776
+ code: string;
1777
+ disableSession?: boolean | undefined;
1778
+ trustDevice?: boolean | undefined;
1779
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1780
+ code: string;
1781
+ disableSession?: boolean | undefined;
1782
+ trustDevice?: boolean | undefined;
1783
+ } & {
1784
+ fetchOptions?: FetchOptions | undefined;
1785
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Omit<{
1786
+ token: string | undefined;
1787
+ user: (Record<string, any> & {
1788
+ id: string;
1789
+ createdAt: Date;
1790
+ updatedAt: Date;
1791
+ email: string;
1792
+ emailVerified: boolean;
1793
+ name: string;
1794
+ image?: string | null | undefined;
1795
+ }) | better_auth_plugins.UserWithTwoFactor;
1796
+ }, "user"> & {
1797
+ user: better_auth.StripEmptyObjects<{
1798
+ id: string;
1799
+ createdAt: Date;
1800
+ updatedAt: Date;
1801
+ email: string;
1802
+ emailVerified: boolean;
1803
+ name: string;
1804
+ image?: string | null | undefined;
1805
+ } & {
1806
+ twoFactorEnabled: boolean | null | undefined;
1807
+ } & {} & {
1808
+ banned: boolean | null | undefined;
1809
+ } & {
1810
+ role?: string | null | undefined;
1811
+ banReason?: string | null | undefined;
1812
+ banExpires?: Date | null | undefined;
1813
+ } & {} & {
1814
+ lastActiveAt?: Date | null | undefined;
1815
+ }>;
1816
+ }, {
1817
+ code?: string | undefined;
1818
+ message?: string | undefined;
1819
+ }, FetchOptions["throw"] extends true ? true : true>>;
1820
+ };
1821
+ } & {
1822
+ twoFactor: {
1823
+ generateBackupCodes: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1824
+ password: string;
1825
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1826
+ password: string;
1827
+ } & {
1828
+ fetchOptions?: FetchOptions | undefined;
1829
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1830
+ status: boolean;
1831
+ backupCodes: string[];
1832
+ }, {
1833
+ code?: string | undefined;
1834
+ message?: string | undefined;
1835
+ }, FetchOptions["throw"] extends true ? true : true>>;
1836
+ };
1837
+ } & {
1838
+ twoFactor: {
1839
+ sendOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1840
+ trustDevice?: boolean | undefined;
1841
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1842
+ query?: Record<string, any> | undefined;
1843
+ fetchOptions?: FetchOptions | undefined;
1844
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1845
+ status: boolean;
1846
+ }, {
1847
+ code?: string | undefined;
1848
+ message?: string | undefined;
1849
+ }, FetchOptions["throw"] extends true ? true : true>>;
1850
+ };
1851
+ } & {
1852
+ twoFactor: {
1853
+ verifyOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1854
+ code: string;
1855
+ trustDevice?: boolean | undefined;
1856
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1857
+ code: string;
1858
+ trustDevice?: boolean | undefined;
1859
+ } & {
1860
+ fetchOptions?: FetchOptions | undefined;
1861
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
1862
+ token: string;
1863
+ user: better_auth_plugins.UserWithTwoFactor;
1864
+ }, "user"> & {
1865
+ user: better_auth.StripEmptyObjects<{
1866
+ id: string;
1867
+ createdAt: Date;
1868
+ updatedAt: Date;
1869
+ email: string;
1870
+ emailVerified: boolean;
1871
+ name: string;
1872
+ image?: string | null | undefined;
1873
+ } & {
1874
+ twoFactorEnabled: boolean | null | undefined;
1875
+ } & {} & {
1876
+ banned: boolean | null | undefined;
1877
+ } & {
1878
+ role?: string | null | undefined;
1879
+ banReason?: string | null | undefined;
1880
+ banExpires?: Date | null | undefined;
1881
+ } & {} & {
1882
+ lastActiveAt?: Date | null | undefined;
1883
+ }>;
1884
+ }) | (Omit<{
1885
+ token: string;
1886
+ user: Record<string, any> & {
1887
+ id: string;
1888
+ createdAt: Date;
1889
+ updatedAt: Date;
1890
+ email: string;
1891
+ emailVerified: boolean;
1892
+ name: string;
1893
+ image?: string | null | undefined;
1894
+ };
1895
+ }, "user"> & {
1896
+ user: better_auth.StripEmptyObjects<{
1897
+ id: string;
1898
+ createdAt: Date;
1899
+ updatedAt: Date;
1900
+ email: string;
1901
+ emailVerified: boolean;
1902
+ name: string;
1903
+ image?: string | null | undefined;
1904
+ } & {
1905
+ twoFactorEnabled: boolean | null | undefined;
1906
+ } & {} & {
1907
+ banned: boolean | null | undefined;
1908
+ } & {
1909
+ role?: string | null | undefined;
1910
+ banReason?: string | null | undefined;
1911
+ banExpires?: Date | null | undefined;
1912
+ } & {} & {
1913
+ lastActiveAt?: Date | null | undefined;
1914
+ }>;
1915
+ }), {
1916
+ code?: string | undefined;
1917
+ message?: string | undefined;
1918
+ }, FetchOptions["throw"] extends true ? true : true>>;
1919
+ };
1920
+ } & {
1921
+ twoFactor: {
1922
+ getTotpUri: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1923
+ password: string;
1924
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1925
+ password: string;
1926
+ } & {
1927
+ fetchOptions?: FetchOptions | undefined;
1928
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
1929
+ totpURI: string;
1930
+ }, {
1931
+ code?: string | undefined;
1932
+ message?: string | undefined;
1933
+ }, FetchOptions["throw"] extends true ? true : true>>;
1934
+ };
1935
+ } & {
1936
+ twoFactor: {
1937
+ verifyTotp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1938
+ code: string;
1939
+ trustDevice?: boolean | undefined;
1940
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1941
+ code: string;
1942
+ trustDevice?: boolean | undefined;
1943
+ } & {
1944
+ fetchOptions?: FetchOptions | undefined;
1945
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
1946
+ token: string;
1947
+ user: better_auth_plugins.UserWithTwoFactor;
1948
+ }, "user"> & {
1949
+ user: better_auth.StripEmptyObjects<{
1950
+ id: string;
1951
+ createdAt: Date;
1952
+ updatedAt: Date;
1953
+ email: string;
1954
+ emailVerified: boolean;
1955
+ name: string;
1956
+ image?: string | null | undefined;
1957
+ } & {
1958
+ twoFactorEnabled: boolean | null | undefined;
1959
+ } & {} & {
1960
+ banned: boolean | null | undefined;
1961
+ } & {
1962
+ role?: string | null | undefined;
1963
+ banReason?: string | null | undefined;
1964
+ banExpires?: Date | null | undefined;
1965
+ } & {} & {
1966
+ lastActiveAt?: Date | null | undefined;
1967
+ }>;
1968
+ }) | (Omit<{
1969
+ token: string;
1970
+ user: Record<string, any> & {
1971
+ id: string;
1972
+ createdAt: Date;
1973
+ updatedAt: Date;
1974
+ email: string;
1975
+ emailVerified: boolean;
1976
+ name: string;
1977
+ image?: string | null | undefined;
1978
+ };
1979
+ }, "user"> & {
1980
+ user: better_auth.StripEmptyObjects<{
1981
+ id: string;
1982
+ createdAt: Date;
1983
+ updatedAt: Date;
1984
+ email: string;
1985
+ emailVerified: boolean;
1986
+ name: string;
1987
+ image?: string | null | undefined;
1988
+ } & {
1989
+ twoFactorEnabled: boolean | null | undefined;
1990
+ } & {} & {
1991
+ banned: boolean | null | undefined;
1992
+ } & {
1993
+ role?: string | null | undefined;
1994
+ banReason?: string | null | undefined;
1995
+ banExpires?: Date | null | undefined;
1996
+ } & {} & {
1997
+ lastActiveAt?: Date | null | undefined;
1998
+ }>;
1999
+ }), {
2000
+ code?: string | undefined;
2001
+ message?: string | undefined;
2002
+ }, FetchOptions["throw"] extends true ? true : true>>;
2003
+ };
2004
+ } & {
2005
+ token: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2006
+ query?: Record<string, any> | undefined;
2007
+ fetchOptions?: FetchOptions | undefined;
2008
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2009
+ token: string;
2010
+ }, {
2011
+ code?: string | undefined;
2012
+ message?: string | undefined;
2013
+ }, FetchOptions["throw"] extends true ? true : true>>;
2014
+ } & {
2015
+ apiKey: {
2016
+ create: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2017
+ configId?: string | undefined;
2018
+ name?: string | undefined;
2019
+ expiresIn?: number | null | undefined;
2020
+ prefix?: string | undefined;
2021
+ remaining?: number | null | undefined;
2022
+ metadata?: any;
2023
+ refillAmount?: number | undefined;
2024
+ refillInterval?: number | undefined;
2025
+ rateLimitTimeWindow?: number | undefined;
2026
+ rateLimitMax?: number | undefined;
2027
+ rateLimitEnabled?: boolean | undefined;
2028
+ permissions?: Record<string, string[]> | undefined;
2029
+ userId?: unknown;
2030
+ organizationId?: unknown;
2031
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2032
+ configId?: string | undefined;
2033
+ name?: string | undefined;
2034
+ expiresIn?: number | null | undefined;
2035
+ prefix?: string | undefined;
2036
+ remaining?: number | null | undefined;
2037
+ metadata?: any;
2038
+ refillAmount?: number | undefined;
2039
+ refillInterval?: number | undefined;
2040
+ rateLimitTimeWindow?: number | undefined;
2041
+ rateLimitMax?: number | undefined;
2042
+ rateLimitEnabled?: boolean | undefined;
2043
+ permissions?: Record<string, string[]> | undefined;
2044
+ userId?: unknown;
2045
+ organizationId?: unknown;
2046
+ } & {
2047
+ fetchOptions?: FetchOptions | undefined;
2048
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2049
+ key: string;
2050
+ metadata: any;
2051
+ permissions: any;
2052
+ id: string;
2053
+ configId: string;
2054
+ name: string | null;
2055
+ start: string | null;
2056
+ prefix: string | null;
2057
+ referenceId: string;
2058
+ refillInterval: number | null;
2059
+ refillAmount: number | null;
2060
+ lastRefillAt: Date | null;
2061
+ enabled: boolean;
2062
+ rateLimitEnabled: boolean;
2063
+ rateLimitTimeWindow: number | null;
2064
+ rateLimitMax: number | null;
2065
+ requestCount: number;
2066
+ remaining: number | null;
2067
+ lastRequest: Date | null;
2068
+ expiresAt: Date | null;
2069
+ createdAt: Date;
2070
+ updatedAt: Date;
2071
+ }, {
2072
+ code?: string | undefined;
2073
+ message?: string | undefined;
2074
+ }, FetchOptions["throw"] extends true ? true : true>>;
2075
+ };
2076
+ } & {
2077
+ apiKey: {
2078
+ get: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2079
+ id: string;
2080
+ configId?: string | undefined;
2081
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2082
+ query: {
2083
+ id: string;
2084
+ configId?: string | undefined;
2085
+ };
2086
+ fetchOptions?: FetchOptions | undefined;
2087
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2088
+ metadata: Record<string, any> | null;
2089
+ permissions: {
2090
+ [key: string]: string[];
2091
+ } | null;
2092
+ id: string;
2093
+ configId: string;
2094
+ name: string | null;
2095
+ start: string | null;
2096
+ prefix: string | null;
2097
+ referenceId: string;
2098
+ refillInterval: number | null;
2099
+ refillAmount: number | null;
2100
+ lastRefillAt: Date | null;
2101
+ enabled: boolean;
2102
+ rateLimitEnabled: boolean;
2103
+ rateLimitTimeWindow: number | null;
2104
+ rateLimitMax: number | null;
2105
+ requestCount: number;
2106
+ remaining: number | null;
2107
+ lastRequest: Date | null;
2108
+ expiresAt: Date | null;
2109
+ createdAt: Date;
2110
+ updatedAt: Date;
2111
+ }, {
2112
+ code?: string | undefined;
2113
+ message?: string | undefined;
2114
+ }, FetchOptions["throw"] extends true ? true : true>>;
2115
+ };
2116
+ } & {
2117
+ apiKey: {
2118
+ update: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2119
+ keyId: string;
2120
+ configId?: string | undefined;
2121
+ userId?: unknown;
2122
+ name?: string | undefined;
2123
+ enabled?: boolean | undefined;
2124
+ remaining?: number | undefined;
2125
+ refillAmount?: number | undefined;
2126
+ refillInterval?: number | undefined;
2127
+ metadata?: any;
2128
+ expiresIn?: number | null | undefined;
2129
+ rateLimitEnabled?: boolean | undefined;
2130
+ rateLimitTimeWindow?: number | undefined;
2131
+ rateLimitMax?: number | undefined;
2132
+ permissions?: Record<string, string[]> | null | undefined;
2133
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2134
+ keyId: string;
2135
+ configId?: string | undefined;
2136
+ userId?: unknown;
2137
+ name?: string | undefined;
2138
+ enabled?: boolean | undefined;
2139
+ remaining?: number | undefined;
2140
+ refillAmount?: number | undefined;
2141
+ refillInterval?: number | undefined;
2142
+ metadata?: any;
2143
+ expiresIn?: number | null | undefined;
2144
+ rateLimitEnabled?: boolean | undefined;
2145
+ rateLimitTimeWindow?: number | undefined;
2146
+ rateLimitMax?: number | undefined;
2147
+ permissions?: Record<string, string[]> | null | undefined;
2148
+ } & {
2149
+ fetchOptions?: FetchOptions | undefined;
2150
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2151
+ metadata: Record<string, any> | null;
2152
+ permissions: {
2153
+ [key: string]: string[];
2154
+ } | null;
2155
+ id: string;
2156
+ configId: string;
2157
+ name: string | null;
2158
+ start: string | null;
2159
+ prefix: string | null;
2160
+ referenceId: string;
2161
+ refillInterval: number | null;
2162
+ refillAmount: number | null;
2163
+ lastRefillAt: Date | null;
2164
+ enabled: boolean;
2165
+ rateLimitEnabled: boolean;
2166
+ rateLimitTimeWindow: number | null;
2167
+ rateLimitMax: number | null;
2168
+ requestCount: number;
2169
+ remaining: number | null;
2170
+ lastRequest: Date | null;
2171
+ expiresAt: Date | null;
2172
+ createdAt: Date;
2173
+ updatedAt: Date;
2174
+ }, {
2175
+ code?: string | undefined;
2176
+ message?: string | undefined;
2177
+ }, FetchOptions["throw"] extends true ? true : true>>;
2178
+ };
2179
+ } & {
2180
+ apiKey: {
2181
+ delete: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2182
+ keyId: string;
2183
+ configId?: string | undefined;
2184
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2185
+ keyId: string;
2186
+ configId?: string | undefined;
2187
+ } & {
2188
+ fetchOptions?: FetchOptions | undefined;
2189
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2190
+ success: boolean;
2191
+ }, {
2192
+ code?: string | undefined;
2193
+ message?: string | undefined;
2194
+ }, FetchOptions["throw"] extends true ? true : true>>;
2195
+ };
2196
+ } & {
2197
+ apiKey: {
2198
+ list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2199
+ configId?: string | undefined;
2200
+ organizationId?: string | undefined;
2201
+ limit?: unknown;
2202
+ offset?: unknown;
2203
+ sortBy?: string | undefined;
2204
+ sortDirection?: "asc" | "desc" | undefined;
2205
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2206
+ query?: {
2207
+ configId?: string | undefined;
2208
+ organizationId?: string | undefined;
2209
+ limit?: unknown;
2210
+ offset?: unknown;
2211
+ sortBy?: string | undefined;
2212
+ sortDirection?: "asc" | "desc" | undefined;
2213
+ } | undefined;
2214
+ fetchOptions?: FetchOptions | undefined;
2215
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2216
+ apiKeys: {
2217
+ metadata: Record<string, any> | null;
2218
+ permissions: {
2219
+ [key: string]: string[];
2220
+ } | null;
2221
+ id: string;
2222
+ configId: string;
2223
+ name: string | null;
2224
+ start: string | null;
2225
+ prefix: string | null;
2226
+ referenceId: string;
2227
+ refillInterval: number | null;
2228
+ refillAmount: number | null;
2229
+ lastRefillAt: Date | null;
2230
+ enabled: boolean;
2231
+ rateLimitEnabled: boolean;
2232
+ rateLimitTimeWindow: number | null;
2233
+ rateLimitMax: number | null;
2234
+ requestCount: number;
2235
+ remaining: number | null;
2236
+ lastRequest: Date | null;
2237
+ expiresAt: Date | null;
2238
+ createdAt: Date;
2239
+ updatedAt: Date;
2240
+ }[];
2241
+ total: number;
2242
+ limit: number | undefined;
2243
+ offset: number | undefined;
2244
+ }, {
2245
+ code?: string | undefined;
2246
+ message?: string | undefined;
2247
+ }, FetchOptions["throw"] extends true ? true : true>>;
2248
+ };
2249
+ } & {
2250
+ admin: {
2251
+ setRole: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2252
+ userId: string;
2253
+ role: "admin" | "user" | ("admin" | "user")[];
2254
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2255
+ userId: string;
2256
+ role: "admin" | "user" | ("admin" | "user")[];
2257
+ } & {
2258
+ fetchOptions?: FetchOptions | undefined;
2259
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2260
+ user: better_auth_plugins.UserWithRole;
2261
+ }, {
2262
+ code?: string | undefined;
2263
+ message?: string | undefined;
2264
+ }, FetchOptions["throw"] extends true ? true : true>>;
2265
+ };
2266
+ } & {
2267
+ admin: {
2268
+ getUser: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2269
+ id: string;
2270
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2271
+ query: {
2272
+ id: string;
2273
+ };
2274
+ fetchOptions?: FetchOptions | undefined;
2275
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<better_auth_plugins.UserWithRole, {
2276
+ code?: string | undefined;
2277
+ message?: string | undefined;
2278
+ }, FetchOptions["throw"] extends true ? true : true>>;
2279
+ };
2280
+ } & {
2281
+ admin: {
2282
+ createUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2283
+ email: string;
2284
+ password?: string | undefined;
2285
+ name: string;
2286
+ role?: "admin" | "user" | ("admin" | "user")[] | undefined;
2287
+ data?: Record<string, any> | undefined;
2288
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2289
+ email: string;
2290
+ password?: string | undefined;
2291
+ name: string;
2292
+ role?: "admin" | "user" | ("admin" | "user")[] | undefined;
2293
+ data?: Record<string, any> | undefined;
2294
+ } & {
2295
+ fetchOptions?: FetchOptions | undefined;
2296
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2297
+ user: better_auth_plugins.UserWithRole;
2298
+ }, {
2299
+ code?: string | undefined;
2300
+ message?: string | undefined;
2301
+ }, FetchOptions["throw"] extends true ? true : true>>;
2302
+ };
2303
+ } & {
2304
+ admin: {
2305
+ updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2306
+ userId: unknown;
2307
+ data: Record<any, any>;
2308
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2309
+ userId: unknown;
2310
+ data: Record<any, any>;
2311
+ } & {
2312
+ fetchOptions?: FetchOptions | undefined;
2313
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<better_auth_plugins.UserWithRole, {
2314
+ code?: string | undefined;
2315
+ message?: string | undefined;
2316
+ }, FetchOptions["throw"] extends true ? true : true>>;
2317
+ };
2318
+ } & {
2319
+ admin: {
2320
+ listUsers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2321
+ searchValue?: string | undefined;
2322
+ searchField?: "name" | "email" | undefined;
2323
+ searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
2324
+ limit?: string | number | undefined;
2325
+ offset?: string | number | undefined;
2326
+ sortBy?: string | undefined;
2327
+ sortDirection?: "asc" | "desc" | undefined;
2328
+ filterField?: string | undefined;
2329
+ filterValue?: string | number | boolean | string[] | number[] | undefined;
2330
+ filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
2331
+ }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2332
+ query: {
2333
+ searchValue?: string | undefined;
2334
+ searchField?: "name" | "email" | undefined;
2335
+ searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
2336
+ limit?: string | number | undefined;
2337
+ offset?: string | number | undefined;
2338
+ sortBy?: string | undefined;
2339
+ sortDirection?: "asc" | "desc" | undefined;
2340
+ filterField?: string | undefined;
2341
+ filterValue?: string | number | boolean | string[] | number[] | undefined;
2342
+ filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
2343
+ };
2344
+ fetchOptions?: FetchOptions | undefined;
2345
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2346
+ users: better_auth_plugins.UserWithRole[];
2347
+ total: number;
2348
+ }, {
2349
+ code?: string | undefined;
2350
+ message?: string | undefined;
2351
+ }, FetchOptions["throw"] extends true ? true : true>>;
2352
+ };
2353
+ } & {
2354
+ admin: {
2355
+ listUserSessions: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2356
+ userId: unknown;
2357
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2358
+ userId: unknown;
2359
+ } & {
2360
+ fetchOptions?: FetchOptions | undefined;
2361
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2362
+ sessions: better_auth_plugins.SessionWithImpersonatedBy[];
2363
+ }, {
2364
+ code?: string | undefined;
2365
+ message?: string | undefined;
2366
+ }, FetchOptions["throw"] extends true ? true : true>>;
2367
+ };
2368
+ } & {
2369
+ admin: {
2370
+ unbanUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2371
+ userId: unknown;
2372
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2373
+ userId: unknown;
2374
+ } & {
2375
+ fetchOptions?: FetchOptions | undefined;
2376
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2377
+ user: better_auth_plugins.UserWithRole;
2378
+ }, {
2379
+ code?: string | undefined;
2380
+ message?: string | undefined;
2381
+ }, FetchOptions["throw"] extends true ? true : true>>;
2382
+ };
2383
+ } & {
2384
+ admin: {
2385
+ banUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2386
+ userId: unknown;
2387
+ banReason?: string | undefined;
2388
+ banExpiresIn?: number | undefined;
2389
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2390
+ userId: unknown;
2391
+ banReason?: string | undefined;
2392
+ banExpiresIn?: number | undefined;
2393
+ } & {
2394
+ fetchOptions?: FetchOptions | undefined;
2395
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2396
+ user: better_auth_plugins.UserWithRole;
2397
+ }, {
2398
+ code?: string | undefined;
2399
+ message?: string | undefined;
2400
+ }, FetchOptions["throw"] extends true ? true : true>>;
2401
+ };
2402
+ } & {
2403
+ admin: {
2404
+ impersonateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2405
+ userId: unknown;
2406
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2407
+ userId: unknown;
2408
+ } & {
2409
+ fetchOptions?: FetchOptions | undefined;
2410
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2411
+ session: {
2412
+ id: string;
2413
+ createdAt: Date;
2414
+ updatedAt: Date;
2415
+ userId: string;
2416
+ expiresAt: Date;
2417
+ token: string;
2418
+ ipAddress?: string | null | undefined;
2419
+ userAgent?: string | null | undefined;
2420
+ };
2421
+ user: better_auth_plugins.UserWithRole;
2422
+ }, {
2423
+ code?: string | undefined;
2424
+ message?: string | undefined;
2425
+ }, FetchOptions["throw"] extends true ? true : true>>;
2426
+ };
2427
+ } & {
2428
+ admin: {
2429
+ stopImpersonating: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2430
+ query?: Record<string, any> | undefined;
2431
+ fetchOptions?: FetchOptions | undefined;
2432
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2433
+ session: {
2434
+ id: string;
2435
+ createdAt: Date;
2436
+ updatedAt: Date;
2437
+ userId: string;
2438
+ expiresAt: Date;
2439
+ token: string;
2440
+ ipAddress?: string | null | undefined;
2441
+ userAgent?: string | null | undefined;
2442
+ } & Record<string, any>;
2443
+ user: {
2444
+ id: string;
2445
+ createdAt: Date;
2446
+ updatedAt: Date;
2447
+ email: string;
2448
+ emailVerified: boolean;
2449
+ name: string;
2450
+ image?: string | null | undefined;
2451
+ } & Record<string, any>;
2452
+ }, {
2453
+ code?: string | undefined;
2454
+ message?: string | undefined;
2455
+ }, FetchOptions["throw"] extends true ? true : true>>;
2456
+ };
2457
+ } & {
2458
+ admin: {
2459
+ revokeUserSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2460
+ sessionToken: string;
2461
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2462
+ sessionToken: string;
2463
+ } & {
2464
+ fetchOptions?: FetchOptions | undefined;
2465
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2466
+ success: boolean;
2467
+ }, {
2468
+ code?: string | undefined;
2469
+ message?: string | undefined;
2470
+ }, FetchOptions["throw"] extends true ? true : true>>;
2471
+ };
2472
+ } & {
2473
+ admin: {
2474
+ revokeUserSessions: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2475
+ userId: unknown;
2476
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2477
+ userId: unknown;
2478
+ } & {
2479
+ fetchOptions?: FetchOptions | undefined;
2480
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2481
+ success: boolean;
2482
+ }, {
2483
+ code?: string | undefined;
2484
+ message?: string | undefined;
2485
+ }, FetchOptions["throw"] extends true ? true : true>>;
2486
+ };
2487
+ } & {
2488
+ admin: {
2489
+ removeUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2490
+ userId: unknown;
2491
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2492
+ userId: unknown;
2493
+ } & {
2494
+ fetchOptions?: FetchOptions | undefined;
2495
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2496
+ success: boolean;
2497
+ }, {
2498
+ code?: string | undefined;
2499
+ message?: string | undefined;
2500
+ }, FetchOptions["throw"] extends true ? true : true>>;
2501
+ };
2502
+ } & {
2503
+ admin: {
2504
+ setUserPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2505
+ newPassword: string;
2506
+ userId: unknown;
2507
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2508
+ newPassword: string;
2509
+ userId: unknown;
2510
+ } & {
2511
+ fetchOptions?: FetchOptions | undefined;
2512
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2513
+ status: boolean;
2514
+ }, {
2515
+ code?: string | undefined;
2516
+ message?: string | undefined;
2517
+ }, FetchOptions["throw"] extends true ? true : true>>;
2518
+ };
2519
+ } & {
2520
+ admin: {
2521
+ hasPermission: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2522
+ permissions: {
2523
+ readonly user?: ("update" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
2524
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
2525
+ };
2526
+ } & {
2527
+ userId?: string | undefined;
2528
+ role?: "admin" | "user" | undefined;
2529
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2530
+ permissions: {
2531
+ readonly user?: ("update" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
2532
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
2533
+ };
2534
+ } & {
2535
+ userId?: string | undefined;
2536
+ role?: "admin" | "user" | undefined;
2537
+ } & {
2538
+ fetchOptions?: FetchOptions | undefined;
2539
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
2540
+ error: null;
2541
+ success: boolean;
2542
+ }, {
2543
+ code?: string | undefined;
2544
+ message?: string | undefined;
2545
+ }, FetchOptions["throw"] extends true ? true : true>>;
2546
+ };
2547
+ } & {
222
2548
  signIn: {
223
2549
  social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
224
2550
  provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel";
@@ -256,7 +2582,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
256
2582
  additionalData?: Record<string, any> | undefined;
257
2583
  } & {
258
2584
  fetchOptions?: FetchOptions | undefined;
259
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2585
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
260
2586
  redirect: boolean;
261
2587
  url: string;
262
2588
  } | (Omit<{
@@ -281,22 +2607,32 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
281
2607
  emailVerified: boolean;
282
2608
  name: string;
283
2609
  image?: string | null | undefined;
2610
+ } & {
2611
+ twoFactorEnabled: boolean | null | undefined;
2612
+ } & {} & {
2613
+ banned: boolean | null | undefined;
2614
+ } & {
2615
+ role?: string | null | undefined;
2616
+ banReason?: string | null | undefined;
2617
+ banExpires?: Date | null | undefined;
2618
+ } & {} & {
2619
+ lastActiveAt?: Date | null | undefined;
284
2620
  }>;
285
2621
  }), {
286
2622
  code?: string | undefined;
287
2623
  message?: string | undefined;
288
- }, FetchOptions["throw"] extends true ? true : false>>;
2624
+ }, FetchOptions["throw"] extends true ? true : true>>;
289
2625
  };
290
2626
  } & {
291
2627
  signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
292
2628
  query?: Record<string, any> | undefined;
293
2629
  fetchOptions?: FetchOptions | undefined;
294
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2630
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
295
2631
  success: boolean;
296
2632
  }, {
297
2633
  code?: string | undefined;
298
2634
  message?: string | undefined;
299
- }, FetchOptions["throw"] extends true ? true : false>>;
2635
+ }, FetchOptions["throw"] extends true ? true : true>>;
300
2636
  } & {
301
2637
  signUp: {
302
2638
  email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
@@ -313,7 +2649,9 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
313
2649
  image?: string | undefined;
314
2650
  callbackURL?: string | undefined;
315
2651
  fetchOptions?: FetchOptions | undefined;
316
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<(Omit<{
2652
+ } & {} & {} & {} & {} & {} & {
2653
+ lastActiveAt?: Date | null | undefined;
2654
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
317
2655
  token: null;
318
2656
  user: {
319
2657
  id: string;
@@ -333,6 +2671,16 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
333
2671
  emailVerified: boolean;
334
2672
  name: string;
335
2673
  image?: string | null | undefined;
2674
+ } & {
2675
+ twoFactorEnabled: boolean | null | undefined;
2676
+ } & {} & {
2677
+ banned: boolean | null | undefined;
2678
+ } & {
2679
+ role?: string | null | undefined;
2680
+ banReason?: string | null | undefined;
2681
+ banExpires?: Date | null | undefined;
2682
+ } & {} & {
2683
+ lastActiveAt?: Date | null | undefined;
336
2684
  }>;
337
2685
  }) | (Omit<{
338
2686
  token: string;
@@ -354,11 +2702,21 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
354
2702
  emailVerified: boolean;
355
2703
  name: string;
356
2704
  image?: string | null | undefined;
2705
+ } & {
2706
+ twoFactorEnabled: boolean | null | undefined;
2707
+ } & {} & {
2708
+ banned: boolean | null | undefined;
2709
+ } & {
2710
+ role?: string | null | undefined;
2711
+ banReason?: string | null | undefined;
2712
+ banExpires?: Date | null | undefined;
2713
+ } & {} & {
2714
+ lastActiveAt?: Date | null | undefined;
357
2715
  }>;
358
2716
  }), {
359
2717
  code?: string | undefined;
360
2718
  message?: string | undefined;
361
- }, FetchOptions["throw"] extends true ? true : false>>;
2719
+ }, FetchOptions["throw"] extends true ? true : true>>;
362
2720
  };
363
2721
  } & {
364
2722
  signIn: {
@@ -374,7 +2732,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
374
2732
  rememberMe?: boolean | undefined;
375
2733
  } & {
376
2734
  fetchOptions?: FetchOptions | undefined;
377
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<Omit<{
2735
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Omit<{
378
2736
  redirect: boolean;
379
2737
  token: string;
380
2738
  url?: string | undefined;
@@ -396,11 +2754,21 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
396
2754
  emailVerified: boolean;
397
2755
  name: string;
398
2756
  image?: string | null | undefined;
2757
+ } & {
2758
+ twoFactorEnabled: boolean | null | undefined;
2759
+ } & {} & {
2760
+ banned: boolean | null | undefined;
2761
+ } & {
2762
+ role?: string | null | undefined;
2763
+ banReason?: string | null | undefined;
2764
+ banExpires?: Date | null | undefined;
2765
+ } & {} & {
2766
+ lastActiveAt?: Date | null | undefined;
399
2767
  }>;
400
2768
  }, {
401
2769
  code?: string | undefined;
402
2770
  message?: string | undefined;
403
- }, FetchOptions["throw"] extends true ? true : false>>;
2771
+ }, FetchOptions["throw"] extends true ? true : true>>;
404
2772
  };
405
2773
  } & {
406
2774
  resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
@@ -413,12 +2781,12 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
413
2781
  token?: string | undefined;
414
2782
  } & {
415
2783
  fetchOptions?: FetchOptions | undefined;
416
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2784
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
417
2785
  status: boolean;
418
2786
  }, {
419
2787
  code?: string | undefined;
420
2788
  message?: string | undefined;
421
- }, FetchOptions["throw"] extends true ? true : false>>;
2789
+ }, FetchOptions["throw"] extends true ? true : true>>;
422
2790
  } & {
423
2791
  verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
424
2792
  token: string;
@@ -429,12 +2797,12 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
429
2797
  callbackURL?: string | undefined;
430
2798
  };
431
2799
  fetchOptions?: FetchOptions | undefined;
432
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<NonNullable<void | {
2800
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<void | {
433
2801
  status: boolean;
434
2802
  }>, {
435
2803
  code?: string | undefined;
436
2804
  message?: string | undefined;
437
- }, FetchOptions["throw"] extends true ? true : false>>;
2805
+ }, FetchOptions["throw"] extends true ? true : true>>;
438
2806
  } & {
439
2807
  sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
440
2808
  email: string;
@@ -444,12 +2812,12 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
444
2812
  callbackURL?: string | undefined;
445
2813
  } & {
446
2814
  fetchOptions?: FetchOptions | undefined;
447
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2815
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
448
2816
  status: boolean;
449
2817
  }, {
450
2818
  code?: string | undefined;
451
2819
  message?: string | undefined;
452
- }, FetchOptions["throw"] extends true ? true : false>>;
2820
+ }, FetchOptions["throw"] extends true ? true : true>>;
453
2821
  } & {
454
2822
  changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
455
2823
  newEmail: string;
@@ -459,12 +2827,12 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
459
2827
  callbackURL?: string | undefined;
460
2828
  } & {
461
2829
  fetchOptions?: FetchOptions | undefined;
462
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2830
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
463
2831
  status: boolean;
464
2832
  }, {
465
2833
  code?: string | undefined;
466
2834
  message?: string | undefined;
467
- }, FetchOptions["throw"] extends true ? true : false>>;
2835
+ }, FetchOptions["throw"] extends true ? true : true>>;
468
2836
  } & {
469
2837
  changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
470
2838
  newPassword: string;
@@ -476,7 +2844,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
476
2844
  revokeOtherSessions?: boolean | undefined;
477
2845
  } & {
478
2846
  fetchOptions?: FetchOptions | undefined;
479
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<Omit<{
2847
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Omit<{
480
2848
  token: string | null;
481
2849
  user: {
482
2850
  id: string;
@@ -504,15 +2872,25 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
504
2872
  emailVerified: boolean;
505
2873
  name: string;
506
2874
  image?: string | null | undefined;
2875
+ } & {
2876
+ twoFactorEnabled: boolean | null | undefined;
2877
+ } & {} & {
2878
+ banned: boolean | null | undefined;
2879
+ } & {
2880
+ role?: string | null | undefined;
2881
+ banReason?: string | null | undefined;
2882
+ banExpires?: Date | null | undefined;
2883
+ } & {} & {
2884
+ lastActiveAt?: Date | null | undefined;
507
2885
  }>;
508
2886
  }, {
509
2887
  code?: string | undefined;
510
2888
  message?: string | undefined;
511
- }, FetchOptions["throw"] extends true ? true : false>>;
2889
+ }, FetchOptions["throw"] extends true ? true : true>>;
512
2890
  } & {
513
2891
  updateSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}>> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<Partial<{}> & {
514
2892
  fetchOptions?: FetchOptions | undefined;
515
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2893
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
516
2894
  session: {
517
2895
  id: string;
518
2896
  createdAt: Date;
@@ -526,7 +2904,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
526
2904
  }, {
527
2905
  code?: string | undefined;
528
2906
  message?: string | undefined;
529
- }, FetchOptions["throw"] extends true ? true : false>>;
2907
+ }, FetchOptions["throw"] extends true ? true : true>>;
530
2908
  } & {
531
2909
  updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
532
2910
  name?: string | undefined;
@@ -535,12 +2913,14 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
535
2913
  image?: (string | null) | undefined;
536
2914
  name?: string | undefined;
537
2915
  fetchOptions?: FetchOptions | undefined;
538
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2916
+ } & Partial<{} & {} & {} & {} & {} & {
2917
+ lastActiveAt?: Date | null | undefined;
2918
+ }>> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
539
2919
  status: boolean;
540
2920
  }, {
541
2921
  code?: string | undefined;
542
2922
  message?: string | undefined;
543
- }, FetchOptions["throw"] extends true ? true : false>>;
2923
+ }, FetchOptions["throw"] extends true ? true : true>>;
544
2924
  } & {
545
2925
  deleteUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
546
2926
  callbackURL?: string | undefined;
@@ -552,13 +2932,13 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
552
2932
  token?: string | undefined;
553
2933
  } & {
554
2934
  fetchOptions?: FetchOptions | undefined;
555
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2935
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
556
2936
  success: boolean;
557
2937
  message: string;
558
2938
  }, {
559
2939
  code?: string | undefined;
560
2940
  message?: string | undefined;
561
- }, FetchOptions["throw"] extends true ? true : false>>;
2941
+ }, FetchOptions["throw"] extends true ? true : true>>;
562
2942
  } & {
563
2943
  requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
564
2944
  email: string;
@@ -568,13 +2948,13 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
568
2948
  redirectTo?: string | undefined;
569
2949
  } & {
570
2950
  fetchOptions?: FetchOptions | undefined;
571
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2951
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
572
2952
  status: boolean;
573
2953
  message: string;
574
2954
  }, {
575
2955
  code?: string | undefined;
576
2956
  message?: string | undefined;
577
- }, FetchOptions["throw"] extends true ? true : false>>;
2957
+ }, FetchOptions["throw"] extends true ? true : true>>;
578
2958
  } & {
579
2959
  resetPassword: {
580
2960
  ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
@@ -586,16 +2966,16 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
586
2966
  callbackURL: string;
587
2967
  };
588
2968
  fetchOptions?: FetchOptions | undefined;
589
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<never, {
2969
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<never, {
590
2970
  code?: string | undefined;
591
2971
  message?: string | undefined;
592
- }, FetchOptions["throw"] extends true ? true : false>>;
2972
+ }, FetchOptions["throw"] extends true ? true : true>>;
593
2973
  };
594
2974
  } & {
595
2975
  listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
596
2976
  query?: Record<string, any> | undefined;
597
2977
  fetchOptions?: FetchOptions | undefined;
598
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<better_auth.Prettify<{
2978
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<better_auth.Prettify<{
599
2979
  id: string;
600
2980
  createdAt: Date;
601
2981
  updatedAt: Date;
@@ -607,7 +2987,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
607
2987
  }>[], {
608
2988
  code?: string | undefined;
609
2989
  message?: string | undefined;
610
- }, FetchOptions["throw"] extends true ? true : false>>;
2990
+ }, FetchOptions["throw"] extends true ? true : true>>;
611
2991
  } & {
612
2992
  revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
613
2993
  token: string;
@@ -615,32 +2995,32 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
615
2995
  token: string;
616
2996
  } & {
617
2997
  fetchOptions?: FetchOptions | undefined;
618
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
2998
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
619
2999
  status: boolean;
620
3000
  }, {
621
3001
  code?: string | undefined;
622
3002
  message?: string | undefined;
623
- }, FetchOptions["throw"] extends true ? true : false>>;
3003
+ }, FetchOptions["throw"] extends true ? true : true>>;
624
3004
  } & {
625
3005
  revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
626
3006
  query?: Record<string, any> | undefined;
627
3007
  fetchOptions?: FetchOptions | undefined;
628
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3008
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
629
3009
  status: boolean;
630
3010
  }, {
631
3011
  code?: string | undefined;
632
3012
  message?: string | undefined;
633
- }, FetchOptions["throw"] extends true ? true : false>>;
3013
+ }, FetchOptions["throw"] extends true ? true : true>>;
634
3014
  } & {
635
3015
  revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
636
3016
  query?: Record<string, any> | undefined;
637
3017
  fetchOptions?: FetchOptions | undefined;
638
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3018
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
639
3019
  status: boolean;
640
3020
  }, {
641
3021
  code?: string | undefined;
642
3022
  message?: string | undefined;
643
- }, FetchOptions["throw"] extends true ? true : false>>;
3023
+ }, FetchOptions["throw"] extends true ? true : true>>;
644
3024
  } & {
645
3025
  linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
646
3026
  provider: unknown;
@@ -674,18 +3054,18 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
674
3054
  additionalData?: Record<string, any> | undefined;
675
3055
  } & {
676
3056
  fetchOptions?: FetchOptions | undefined;
677
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3057
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
678
3058
  url: string;
679
3059
  redirect: boolean;
680
3060
  }, {
681
3061
  code?: string | undefined;
682
3062
  message?: string | undefined;
683
- }, FetchOptions["throw"] extends true ? true : false>>;
3063
+ }, FetchOptions["throw"] extends true ? true : true>>;
684
3064
  } & {
685
3065
  listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
686
3066
  query?: Record<string, any> | undefined;
687
3067
  fetchOptions?: FetchOptions | undefined;
688
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3068
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
689
3069
  scopes: string[];
690
3070
  id: string;
691
3071
  createdAt: Date;
@@ -696,7 +3076,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
696
3076
  }[], {
697
3077
  code?: string | undefined;
698
3078
  message?: string | undefined;
699
- }, FetchOptions["throw"] extends true ? true : false>>;
3079
+ }, FetchOptions["throw"] extends true ? true : true>>;
700
3080
  } & {
701
3081
  deleteUser: {
702
3082
  callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
@@ -708,13 +3088,13 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
708
3088
  callbackURL?: string | undefined;
709
3089
  };
710
3090
  fetchOptions?: FetchOptions | undefined;
711
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3091
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
712
3092
  success: boolean;
713
3093
  message: string;
714
3094
  }, {
715
3095
  code?: string | undefined;
716
3096
  message?: string | undefined;
717
- }, FetchOptions["throw"] extends true ? true : false>>;
3097
+ }, FetchOptions["throw"] extends true ? true : true>>;
718
3098
  };
719
3099
  } & {
720
3100
  unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
@@ -725,12 +3105,12 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
725
3105
  accountId?: string | undefined;
726
3106
  } & {
727
3107
  fetchOptions?: FetchOptions | undefined;
728
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3108
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
729
3109
  status: boolean;
730
3110
  }, {
731
3111
  code?: string | undefined;
732
3112
  message?: string | undefined;
733
- }, FetchOptions["throw"] extends true ? true : false>>;
3113
+ }, FetchOptions["throw"] extends true ? true : true>>;
734
3114
  } & {
735
3115
  refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
736
3116
  providerId: string;
@@ -742,7 +3122,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
742
3122
  userId?: string | undefined;
743
3123
  } & {
744
3124
  fetchOptions?: FetchOptions | undefined;
745
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3125
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
746
3126
  accessToken: string | undefined;
747
3127
  refreshToken: string;
748
3128
  accessTokenExpiresAt: Date | undefined;
@@ -754,7 +3134,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
754
3134
  }, {
755
3135
  code?: string | undefined;
756
3136
  message?: string | undefined;
757
- }, FetchOptions["throw"] extends true ? true : false>>;
3137
+ }, FetchOptions["throw"] extends true ? true : true>>;
758
3138
  } & {
759
3139
  getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
760
3140
  providerId: string;
@@ -766,7 +3146,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
766
3146
  userId?: string | undefined;
767
3147
  } & {
768
3148
  fetchOptions?: FetchOptions | undefined;
769
- }>, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3149
+ }>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
770
3150
  accessToken: string;
771
3151
  accessTokenExpiresAt: Date | undefined;
772
3152
  scopes: string[];
@@ -774,7 +3154,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
774
3154
  }, {
775
3155
  code?: string | undefined;
776
3156
  message?: string | undefined;
777
- }, FetchOptions["throw"] extends true ? true : false>>;
3157
+ }, FetchOptions["throw"] extends true ? true : true>>;
778
3158
  } & {
779
3159
  accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
780
3160
  accountId?: string | undefined;
@@ -783,13 +3163,13 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
783
3163
  accountId?: string | undefined;
784
3164
  } | undefined;
785
3165
  fetchOptions?: FetchOptions | undefined;
786
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3166
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
787
3167
  user: better_auth.OAuth2UserInfo;
788
3168
  data: Record<string, any>;
789
3169
  }, {
790
3170
  code?: string | undefined;
791
3171
  message?: string | undefined;
792
- }, FetchOptions["throw"] extends true ? true : false>>;
3172
+ }, FetchOptions["throw"] extends true ? true : true>>;
793
3173
  } & {
794
3174
  getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
795
3175
  disableCookieCache?: unknown;
@@ -800,30 +3180,252 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
800
3180
  disableRefresh?: unknown;
801
3181
  } | undefined;
802
3182
  fetchOptions?: FetchOptions | undefined;
803
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
3183
+ }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
804
3184
  user: better_auth.StripEmptyObjects<{
805
3185
  id: string;
806
3186
  createdAt: Date;
807
- updatedAt: Date;
808
- email: string;
809
- emailVerified: boolean;
3187
+ updatedAt: Date;
3188
+ email: string;
3189
+ emailVerified: boolean;
3190
+ name: string;
3191
+ image?: string | null | undefined;
3192
+ } & {
3193
+ twoFactorEnabled: boolean | null | undefined;
3194
+ } & {} & {
3195
+ banned: boolean | null | undefined;
3196
+ } & {
3197
+ role?: string | null | undefined;
3198
+ banReason?: string | null | undefined;
3199
+ banExpires?: Date | null | undefined;
3200
+ } & {} & {
3201
+ lastActiveAt?: Date | null | undefined;
3202
+ }>;
3203
+ session: better_auth.StripEmptyObjects<{
3204
+ id: string;
3205
+ createdAt: Date;
3206
+ updatedAt: Date;
3207
+ userId: string;
3208
+ expiresAt: Date;
3209
+ token: string;
3210
+ ipAddress?: string | null | undefined;
3211
+ userAgent?: string | null | undefined;
3212
+ } & {} & {
3213
+ activeOrganizationId?: string | null | undefined;
3214
+ activeTeamId?: string | null | undefined;
3215
+ } & {} & {
3216
+ impersonatedBy?: string | null | undefined;
3217
+ } & {} & {}>;
3218
+ } | null, {
3219
+ code?: string | undefined;
3220
+ message?: string | undefined;
3221
+ }, FetchOptions["throw"] extends true ? true : true>>;
3222
+ } & {
3223
+ applications: {
3224
+ listCandidateOrganizations: (applicationId: string) => Promise<{
3225
+ data: {
3226
+ organizations: FullOrganization[];
3227
+ application?: Application | undefined;
3228
+ };
3229
+ error: null;
3230
+ } | {
3231
+ data: {
3232
+ organizations: FullOrganization[];
3233
+ application?: Application | undefined;
3234
+ };
3235
+ error: {
3236
+ message?: string | undefined;
3237
+ status: number;
3238
+ statusText: string;
3239
+ };
3240
+ }>;
3241
+ startAuthorizationFlow: (applicationId: string, redirectUri: string, codeChallenge: string, organizationId: string) => Promise<{
3242
+ data: null;
3243
+ error: {
3244
+ message?: string | undefined;
3245
+ status: number;
3246
+ statusText: string;
3247
+ };
3248
+ } | {
3249
+ data: StartAuthorizationFlowResponse;
3250
+ error: null;
3251
+ }>;
3252
+ completeAuthorizationFlow: (code: string, codeVerifier: string) => Promise<{
3253
+ data: null;
3254
+ error: {
3255
+ message?: string | undefined;
3256
+ status: number;
3257
+ statusText: string;
3258
+ };
3259
+ } | {
3260
+ data: CompleteAuthorizationFlowResponse;
3261
+ error: null;
3262
+ }>;
3263
+ refreshAccessToken: (refreshToken: string) => Promise<{
3264
+ data: null;
3265
+ error: {
3266
+ message?: string | undefined;
3267
+ status: number;
3268
+ statusText: string;
3269
+ };
3270
+ } | {
3271
+ data: CompleteAuthorizationFlowResponse;
3272
+ error: null;
3273
+ }>;
3274
+ whoAmI: (accessToken: string) => Promise<{
3275
+ data: null;
3276
+ error: {
3277
+ message?: string | undefined;
3278
+ status: number;
3279
+ statusText: string;
3280
+ };
3281
+ } | {
3282
+ data: WhoAmIResponse;
3283
+ error: null;
3284
+ }>;
3285
+ switchOrganization: (organizationId: string, accessToken: string) => Promise<{
3286
+ data: null;
3287
+ error: {
3288
+ message?: string | undefined;
3289
+ status: number;
3290
+ statusText: string;
3291
+ };
3292
+ } | {
3293
+ data: CompleteAuthorizationFlowResponse;
3294
+ error: null;
3295
+ }>;
3296
+ logout: (refreshToken: string) => Promise<{
3297
+ data: null;
3298
+ error: {
3299
+ message?: string | undefined;
3300
+ status: number;
3301
+ statusText: string;
3302
+ };
3303
+ } | {
3304
+ data: void;
3305
+ error: null;
3306
+ }>;
3307
+ };
3308
+ } & {
3309
+ $Infer: {
3310
+ ActiveOrganization: {
3311
+ members: {
3312
+ id: string;
3313
+ organizationId: string;
3314
+ role: "org:admin" | "org:member" | "org:reviewer";
3315
+ createdAt: Date;
3316
+ userId: string;
3317
+ teamId?: string | undefined | undefined;
3318
+ user: {
3319
+ id: string;
3320
+ email: string;
3321
+ name: string;
3322
+ image?: string | undefined;
3323
+ };
3324
+ }[];
3325
+ invitations: {
3326
+ id: string;
3327
+ organizationId: string;
3328
+ email: string;
3329
+ role: "org:admin" | "org:member" | "org:reviewer";
3330
+ status: better_auth_plugins.InvitationStatus;
3331
+ inviterId: string;
3332
+ expiresAt: Date;
3333
+ createdAt: Date;
3334
+ teamId?: string | undefined | undefined;
3335
+ }[];
3336
+ teams: {
3337
+ id: string;
3338
+ name: string;
3339
+ organizationId: string;
3340
+ createdAt: Date;
3341
+ updatedAt?: Date | undefined;
3342
+ }[];
3343
+ } & {
3344
+ id: string;
3345
+ name: string;
3346
+ slug: string;
3347
+ createdAt: Date;
3348
+ logo?: string | null | undefined | undefined;
3349
+ metadata?: any;
3350
+ };
3351
+ Organization: {
3352
+ id: string;
810
3353
  name: string;
811
- image?: string | null | undefined;
812
- }>;
813
- session: better_auth.StripEmptyObjects<{
3354
+ slug: string;
3355
+ createdAt: Date;
3356
+ logo?: string | null | undefined;
3357
+ metadata?: any;
3358
+ };
3359
+ Invitation: {
3360
+ id: string;
3361
+ organizationId: string;
3362
+ email: string;
3363
+ role: "org:admin" | "org:member" | "org:reviewer";
3364
+ status: better_auth_plugins.InvitationStatus;
3365
+ inviterId: string;
3366
+ expiresAt: Date;
3367
+ createdAt: Date;
3368
+ teamId?: string | undefined | undefined;
3369
+ };
3370
+ Member: {
814
3371
  id: string;
3372
+ organizationId: string;
3373
+ role: "org:admin" | "org:member" | "org:reviewer";
815
3374
  createdAt: Date;
816
- updatedAt: Date;
817
3375
  userId: string;
818
- expiresAt: Date;
819
- token: string;
820
- ipAddress?: string | null | undefined;
821
- userAgent?: string | null | undefined;
822
- }>;
823
- } | null, {
824
- code?: string | undefined;
825
- message?: string | undefined;
826
- }, FetchOptions["throw"] extends true ? true : false>>;
3376
+ teamId?: string | undefined | undefined;
3377
+ user: {
3378
+ id: string;
3379
+ email: string;
3380
+ name: string;
3381
+ image?: string | undefined;
3382
+ };
3383
+ };
3384
+ Team: {
3385
+ id: string;
3386
+ name: string;
3387
+ organizationId: string;
3388
+ createdAt: Date;
3389
+ updatedAt?: Date | undefined;
3390
+ };
3391
+ };
3392
+ organization: {
3393
+ checkRolePermission: <R extends "org:admin" | "org:member" | "org:reviewer">(data: {
3394
+ permissions: {
3395
+ access?: string[] | undefined;
3396
+ organization?: ("update" | "delete")[] | undefined;
3397
+ member?: ("update" | "delete" | "create")[] | undefined;
3398
+ invitation?: ("create" | "cancel")[] | undefined;
3399
+ team?: ("update" | "delete" | "create")[] | undefined;
3400
+ ac?: ("update" | "delete" | "create" | "read")[] | undefined;
3401
+ };
3402
+ } & {
3403
+ role: R;
3404
+ }) => boolean;
3405
+ };
3406
+ } & {
3407
+ jwks: (fetchOptions?: any) => Promise<{
3408
+ data: null;
3409
+ error: {
3410
+ message?: string | undefined;
3411
+ status: number;
3412
+ statusText: string;
3413
+ };
3414
+ } | {
3415
+ data: jose.JSONWebKeySet;
3416
+ error: null;
3417
+ }>;
3418
+ } & {
3419
+ admin: {
3420
+ checkRolePermission: <R extends "admin" | "user">(data: {
3421
+ permissions: {
3422
+ readonly user?: ("update" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
3423
+ readonly session?: ("delete" | "list" | "revoke")[] | undefined;
3424
+ };
3425
+ } & {
3426
+ role: R;
3427
+ }) => boolean;
3428
+ };
827
3429
  } & {
828
3430
  useSession: better_auth_client.Atom<{
829
3431
  data: {
@@ -835,6 +3437,16 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
835
3437
  emailVerified: boolean;
836
3438
  name: string;
837
3439
  image?: string | null | undefined;
3440
+ } & {
3441
+ twoFactorEnabled: boolean | null | undefined;
3442
+ } & {} & {
3443
+ banned: boolean | null | undefined;
3444
+ } & {
3445
+ role?: string | null | undefined;
3446
+ banReason?: string | null | undefined;
3447
+ banExpires?: Date | null | undefined;
3448
+ } & {} & {
3449
+ lastActiveAt?: Date | null | undefined;
838
3450
  }>;
839
3451
  session: better_auth.StripEmptyObjects<{
840
3452
  id: string;
@@ -845,30 +3457,35 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
845
3457
  token: string;
846
3458
  ipAddress?: string | null | undefined;
847
3459
  userAgent?: string | null | undefined;
848
- }>;
849
- } | null;
850
- error: _better_fetch_fetch.BetterFetchError | null;
3460
+ } & {} & {
3461
+ activeOrganizationId?: string | null | undefined;
3462
+ activeTeamId?: string | null | undefined;
3463
+ } & {} & {
3464
+ impersonatedBy?: string | null | undefined;
3465
+ } & {} & {}>;
3466
+ };
3467
+ error: better_auth_client.BetterFetchError | null;
851
3468
  isPending: boolean;
852
3469
  isRefetching: boolean;
853
3470
  refetch: (queryParams?: {
854
3471
  query?: better_auth.SessionQueryParams;
855
3472
  } | undefined) => Promise<void>;
856
3473
  }>;
857
- $fetch: _better_fetch_fetch.BetterFetch<{
858
- plugins: (_better_fetch_fetch.BetterFetchPlugin<Record<string, any>> | {
3474
+ $fetch: better_auth_client.BetterFetch<{
3475
+ plugins: (better_auth_client.BetterFetchPlugin<Record<string, any>> | {
859
3476
  id: string;
860
3477
  name: string;
861
3478
  hooks: {
862
- onSuccess(context: _better_fetch_fetch.SuccessContext<any>): void;
3479
+ onSuccess(context: better_auth_client.SuccessContext<any>): void;
863
3480
  };
864
3481
  } | {
865
3482
  id: string;
866
3483
  name: string;
867
3484
  hooks: {
868
- onSuccess: ((context: _better_fetch_fetch.SuccessContext<any>) => Promise<void> | void) | undefined;
869
- onError: ((context: _better_fetch_fetch.ErrorContext) => Promise<void> | void) | undefined;
870
- onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch.RequestContext<T>) => Promise<_better_fetch_fetch.RequestContext | void> | _better_fetch_fetch.RequestContext | void) | undefined;
871
- onResponse: ((context: _better_fetch_fetch.ResponseContext) => Promise<Response | void | _better_fetch_fetch.ResponseContext> | Response | _better_fetch_fetch.ResponseContext | void) | undefined;
3485
+ onSuccess: ((context: better_auth_client.SuccessContext<any>) => Promise<void> | void) | undefined;
3486
+ onError: ((context: better_auth_client.ErrorContext) => Promise<void> | void) | undefined;
3487
+ onRequest: (<T extends Record<string, any>>(context: better_auth_client.RequestContext<T>) => Promise<better_auth_client.RequestContext | void> | better_auth_client.RequestContext | void) | undefined;
3488
+ onResponse: ((context: better_auth_client.ResponseContext) => Promise<Response | void | better_auth_client.ResponseContext> | Response | better_auth_client.ResponseContext | void) | undefined;
872
3489
  };
873
3490
  })[];
874
3491
  cache?: RequestCache | undefined;
@@ -888,12 +3505,12 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
888
3505
  referrerPolicy?: ReferrerPolicy | undefined;
889
3506
  signal?: (AbortSignal | null) | undefined;
890
3507
  window?: null | undefined;
891
- onRetry?: ((response: _better_fetch_fetch.ResponseContext) => Promise<void> | void) | undefined;
3508
+ onRetry?: ((response: better_auth_client.ResponseContext) => Promise<void> | void) | undefined;
892
3509
  hookOptions?: {
893
3510
  cloneResponse?: boolean;
894
3511
  } | undefined;
895
3512
  timeout?: number | undefined;
896
- customFetchImpl: _better_fetch_fetch.FetchEsque;
3513
+ customFetchImpl: better_auth_client.FetchEsque;
897
3514
  baseURL: string;
898
3515
  throw?: boolean | undefined;
899
3516
  auth?: ({
@@ -913,10 +3530,10 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
913
3530
  params?: any;
914
3531
  duplex?: "full" | "half" | undefined;
915
3532
  jsonParser: (text: string) => Promise<any> | any;
916
- retry?: _better_fetch_fetch.RetryOptions | undefined;
3533
+ retry?: better_auth_client.RetryOptions | undefined;
917
3534
  retryAttempt?: number | undefined;
918
- output?: (_better_fetch_fetch.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
919
- errorSchema?: _better_fetch_fetch.StandardSchemaV1 | undefined;
3535
+ output?: (better_auth_client.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
3536
+ errorSchema?: better_auth_client.StandardSchemaV1 | undefined;
920
3537
  disableValidation?: boolean | undefined;
921
3538
  disableSignal?: boolean | undefined;
922
3539
  }, unknown, unknown, {}>;
@@ -935,6 +3552,16 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
935
3552
  emailVerified: boolean;
936
3553
  name: string;
937
3554
  image?: string | null | undefined;
3555
+ } & {
3556
+ twoFactorEnabled: boolean | null | undefined;
3557
+ } & {} & {
3558
+ banned: boolean | null | undefined;
3559
+ } & {
3560
+ role?: string | null | undefined;
3561
+ banReason?: string | null | undefined;
3562
+ banExpires?: Date | null | undefined;
3563
+ } & {} & {
3564
+ lastActiveAt?: Date | null | undefined;
938
3565
  }>;
939
3566
  session: better_auth.StripEmptyObjects<{
940
3567
  id: string;
@@ -945,18 +3572,491 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
945
3572
  token: string;
946
3573
  ipAddress?: string | null | undefined;
947
3574
  userAgent?: string | null | undefined;
948
- }>;
3575
+ } & {} & {
3576
+ activeOrganizationId?: string | null | undefined;
3577
+ activeTeamId?: string | null | undefined;
3578
+ } & {} & {
3579
+ impersonatedBy?: string | null | undefined;
3580
+ } & {} & {}>;
3581
+ };
3582
+ };
3583
+ $ERROR_CODES: {
3584
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: {
3585
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION";
3586
+ message: string;
3587
+ };
3588
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: {
3589
+ readonly code: "YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS";
3590
+ message: string;
3591
+ };
3592
+ ORGANIZATION_ALREADY_EXISTS: {
3593
+ readonly code: "ORGANIZATION_ALREADY_EXISTS";
3594
+ message: string;
3595
+ };
3596
+ ORGANIZATION_SLUG_ALREADY_TAKEN: {
3597
+ readonly code: "ORGANIZATION_SLUG_ALREADY_TAKEN";
3598
+ message: string;
3599
+ };
3600
+ ORGANIZATION_NOT_FOUND: {
3601
+ readonly code: "ORGANIZATION_NOT_FOUND";
3602
+ message: string;
3603
+ };
3604
+ USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: {
3605
+ readonly code: "USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION";
3606
+ message: string;
3607
+ };
3608
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: {
3609
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION";
3610
+ message: string;
3611
+ };
3612
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: {
3613
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION";
3614
+ message: string;
3615
+ };
3616
+ NO_ACTIVE_ORGANIZATION: {
3617
+ readonly code: "NO_ACTIVE_ORGANIZATION";
3618
+ message: string;
3619
+ };
3620
+ USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: {
3621
+ readonly code: "USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION";
3622
+ message: string;
3623
+ };
3624
+ MEMBER_NOT_FOUND: {
3625
+ readonly code: "MEMBER_NOT_FOUND";
3626
+ message: string;
3627
+ };
3628
+ ROLE_NOT_FOUND: {
3629
+ readonly code: "ROLE_NOT_FOUND";
3630
+ message: string;
3631
+ };
3632
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: {
3633
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM";
3634
+ message: string;
3635
+ };
3636
+ TEAM_ALREADY_EXISTS: {
3637
+ readonly code: "TEAM_ALREADY_EXISTS";
3638
+ message: string;
3639
+ };
3640
+ TEAM_NOT_FOUND: {
3641
+ readonly code: "TEAM_NOT_FOUND";
3642
+ message: string;
3643
+ };
3644
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: {
3645
+ readonly code: "YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER";
3646
+ message: string;
3647
+ };
3648
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: {
3649
+ readonly code: "YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER";
3650
+ message: string;
3651
+ };
3652
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: {
3653
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER";
3654
+ message: string;
3655
+ };
3656
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: {
3657
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION";
3658
+ message: string;
3659
+ };
3660
+ USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: {
3661
+ readonly code: "USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION";
3662
+ message: string;
3663
+ };
3664
+ INVITATION_NOT_FOUND: {
3665
+ readonly code: "INVITATION_NOT_FOUND";
3666
+ message: string;
3667
+ };
3668
+ YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: {
3669
+ readonly code: "YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION";
3670
+ message: string;
3671
+ };
3672
+ EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: {
3673
+ readonly code: "EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION";
3674
+ message: string;
3675
+ };
3676
+ YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: {
3677
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION";
3678
+ message: string;
3679
+ };
3680
+ INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: {
3681
+ readonly code: "INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION";
3682
+ message: string;
3683
+ };
3684
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: {
3685
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE";
3686
+ message: string;
3687
+ };
3688
+ FAILED_TO_RETRIEVE_INVITATION: {
3689
+ readonly code: "FAILED_TO_RETRIEVE_INVITATION";
3690
+ message: string;
3691
+ };
3692
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: {
3693
+ readonly code: "YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS";
3694
+ message: string;
3695
+ };
3696
+ UNABLE_TO_REMOVE_LAST_TEAM: {
3697
+ readonly code: "UNABLE_TO_REMOVE_LAST_TEAM";
3698
+ message: string;
3699
+ };
3700
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: {
3701
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER";
3702
+ message: string;
3703
+ };
3704
+ ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: {
3705
+ readonly code: "ORGANIZATION_MEMBERSHIP_LIMIT_REACHED";
3706
+ message: string;
3707
+ };
3708
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: {
3709
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION";
3710
+ message: string;
3711
+ };
3712
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: {
3713
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION";
3714
+ message: string;
3715
+ };
3716
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: {
3717
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM";
3718
+ message: string;
3719
+ };
3720
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: {
3721
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM";
3722
+ message: string;
3723
+ };
3724
+ INVITATION_LIMIT_REACHED: {
3725
+ readonly code: "INVITATION_LIMIT_REACHED";
3726
+ message: string;
3727
+ };
3728
+ TEAM_MEMBER_LIMIT_REACHED: {
3729
+ readonly code: "TEAM_MEMBER_LIMIT_REACHED";
3730
+ message: string;
3731
+ };
3732
+ USER_IS_NOT_A_MEMBER_OF_THE_TEAM: {
3733
+ readonly code: "USER_IS_NOT_A_MEMBER_OF_THE_TEAM";
3734
+ message: string;
3735
+ };
3736
+ YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: {
3737
+ readonly code: "YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM";
3738
+ message: string;
3739
+ };
3740
+ YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: {
3741
+ readonly code: "YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM";
3742
+ message: string;
3743
+ };
3744
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: {
3745
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER";
3746
+ message: string;
3747
+ };
3748
+ YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: {
3749
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER";
3750
+ message: string;
3751
+ };
3752
+ YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: {
3753
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION";
3754
+ message: string;
3755
+ };
3756
+ YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: {
3757
+ readonly code: "YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION";
3758
+ message: string;
3759
+ };
3760
+ MISSING_AC_INSTANCE: {
3761
+ readonly code: "MISSING_AC_INSTANCE";
3762
+ message: string;
3763
+ };
3764
+ YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: {
3765
+ readonly code: "YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE";
3766
+ message: string;
3767
+ };
3768
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: {
3769
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE";
3770
+ message: string;
3771
+ };
3772
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: {
3773
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE";
3774
+ message: string;
3775
+ };
3776
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: {
3777
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE";
3778
+ message: string;
3779
+ };
3780
+ YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: {
3781
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE";
3782
+ message: string;
3783
+ };
3784
+ YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: {
3785
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE";
3786
+ message: string;
3787
+ };
3788
+ YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: {
3789
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE";
3790
+ message: string;
3791
+ };
3792
+ TOO_MANY_ROLES: {
3793
+ readonly code: "TOO_MANY_ROLES";
3794
+ message: string;
3795
+ };
3796
+ INVALID_RESOURCE: {
3797
+ readonly code: "INVALID_RESOURCE";
3798
+ message: string;
3799
+ };
3800
+ ROLE_NAME_IS_ALREADY_TAKEN: {
3801
+ readonly code: "ROLE_NAME_IS_ALREADY_TAKEN";
3802
+ message: string;
3803
+ };
3804
+ CANNOT_DELETE_A_PRE_DEFINED_ROLE: {
3805
+ readonly code: "CANNOT_DELETE_A_PRE_DEFINED_ROLE";
3806
+ message: string;
3807
+ };
3808
+ ROLE_IS_ASSIGNED_TO_MEMBERS: {
3809
+ readonly code: "ROLE_IS_ASSIGNED_TO_MEMBERS";
3810
+ message: string;
3811
+ };
3812
+ OTP_NOT_ENABLED: {
3813
+ readonly code: "OTP_NOT_ENABLED";
3814
+ message: string;
3815
+ };
3816
+ OTP_HAS_EXPIRED: {
3817
+ readonly code: "OTP_HAS_EXPIRED";
3818
+ message: string;
3819
+ };
3820
+ TOTP_NOT_ENABLED: {
3821
+ readonly code: "TOTP_NOT_ENABLED";
3822
+ message: string;
3823
+ };
3824
+ TWO_FACTOR_NOT_ENABLED: {
3825
+ readonly code: "TWO_FACTOR_NOT_ENABLED";
3826
+ message: string;
3827
+ };
3828
+ BACKUP_CODES_NOT_ENABLED: {
3829
+ readonly code: "BACKUP_CODES_NOT_ENABLED";
3830
+ message: string;
3831
+ };
3832
+ INVALID_BACKUP_CODE: {
3833
+ readonly code: "INVALID_BACKUP_CODE";
3834
+ message: string;
3835
+ };
3836
+ INVALID_CODE: {
3837
+ readonly code: "INVALID_CODE";
3838
+ message: string;
3839
+ };
3840
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: {
3841
+ readonly code: "TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE";
3842
+ message: string;
3843
+ };
3844
+ INVALID_TWO_FACTOR_COOKIE: {
3845
+ readonly code: "INVALID_TWO_FACTOR_COOKIE";
3846
+ message: string;
3847
+ };
3848
+ INVALID_METADATA_TYPE: {
3849
+ readonly code: "INVALID_METADATA_TYPE";
3850
+ message: string;
3851
+ };
3852
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: {
3853
+ readonly code: "REFILL_AMOUNT_AND_INTERVAL_REQUIRED";
3854
+ message: string;
3855
+ };
3856
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: {
3857
+ readonly code: "REFILL_INTERVAL_AND_AMOUNT_REQUIRED";
3858
+ message: string;
3859
+ };
3860
+ USER_BANNED: {
3861
+ readonly code: "USER_BANNED";
3862
+ message: string;
3863
+ };
3864
+ UNAUTHORIZED_SESSION: {
3865
+ readonly code: "UNAUTHORIZED_SESSION";
3866
+ message: string;
3867
+ };
3868
+ KEY_NOT_FOUND: {
3869
+ readonly code: "KEY_NOT_FOUND";
3870
+ message: string;
3871
+ };
3872
+ KEY_DISABLED: {
3873
+ readonly code: "KEY_DISABLED";
3874
+ message: string;
3875
+ };
3876
+ KEY_EXPIRED: {
3877
+ readonly code: "KEY_EXPIRED";
3878
+ message: string;
3879
+ };
3880
+ USAGE_EXCEEDED: {
3881
+ readonly code: "USAGE_EXCEEDED";
3882
+ message: string;
3883
+ };
3884
+ KEY_NOT_RECOVERABLE: {
3885
+ readonly code: "KEY_NOT_RECOVERABLE";
3886
+ message: string;
3887
+ };
3888
+ EXPIRES_IN_IS_TOO_SMALL: {
3889
+ readonly code: "EXPIRES_IN_IS_TOO_SMALL";
3890
+ message: string;
3891
+ };
3892
+ EXPIRES_IN_IS_TOO_LARGE: {
3893
+ readonly code: "EXPIRES_IN_IS_TOO_LARGE";
3894
+ message: string;
3895
+ };
3896
+ INVALID_REMAINING: {
3897
+ readonly code: "INVALID_REMAINING";
3898
+ message: string;
3899
+ };
3900
+ INVALID_PREFIX_LENGTH: {
3901
+ readonly code: "INVALID_PREFIX_LENGTH";
3902
+ message: string;
3903
+ };
3904
+ INVALID_NAME_LENGTH: {
3905
+ readonly code: "INVALID_NAME_LENGTH";
3906
+ message: string;
3907
+ };
3908
+ METADATA_DISABLED: {
3909
+ readonly code: "METADATA_DISABLED";
3910
+ message: string;
3911
+ };
3912
+ RATE_LIMIT_EXCEEDED: {
3913
+ readonly code: "RATE_LIMIT_EXCEEDED";
3914
+ message: string;
3915
+ };
3916
+ NO_VALUES_TO_UPDATE: {
3917
+ readonly code: "NO_VALUES_TO_UPDATE";
3918
+ message: string;
3919
+ };
3920
+ KEY_DISABLED_EXPIRATION: {
3921
+ readonly code: "KEY_DISABLED_EXPIRATION";
3922
+ message: string;
3923
+ };
3924
+ INVALID_API_KEY: {
3925
+ readonly code: "INVALID_API_KEY";
3926
+ message: string;
3927
+ };
3928
+ INVALID_USER_ID_FROM_API_KEY: {
3929
+ readonly code: "INVALID_USER_ID_FROM_API_KEY";
3930
+ message: string;
3931
+ };
3932
+ INVALID_REFERENCE_ID_FROM_API_KEY: {
3933
+ readonly code: "INVALID_REFERENCE_ID_FROM_API_KEY";
3934
+ message: string;
3935
+ };
3936
+ INVALID_API_KEY_GETTER_RETURN_TYPE: {
3937
+ readonly code: "INVALID_API_KEY_GETTER_RETURN_TYPE";
3938
+ message: string;
3939
+ };
3940
+ SERVER_ONLY_PROPERTY: {
3941
+ readonly code: "SERVER_ONLY_PROPERTY";
3942
+ message: string;
3943
+ };
3944
+ FAILED_TO_UPDATE_API_KEY: {
3945
+ readonly code: "FAILED_TO_UPDATE_API_KEY";
3946
+ message: string;
3947
+ };
3948
+ NAME_REQUIRED: {
3949
+ readonly code: "NAME_REQUIRED";
3950
+ message: string;
3951
+ };
3952
+ ORGANIZATION_ID_REQUIRED: {
3953
+ readonly code: "ORGANIZATION_ID_REQUIRED";
3954
+ message: string;
3955
+ };
3956
+ USER_NOT_MEMBER_OF_ORGANIZATION: {
3957
+ readonly code: "USER_NOT_MEMBER_OF_ORGANIZATION";
3958
+ message: string;
3959
+ };
3960
+ INSUFFICIENT_API_KEY_PERMISSIONS: {
3961
+ readonly code: "INSUFFICIENT_API_KEY_PERMISSIONS";
3962
+ message: string;
3963
+ };
3964
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: {
3965
+ readonly code: "NO_DEFAULT_API_KEY_CONFIGURATION_FOUND";
3966
+ message: string;
3967
+ };
3968
+ ORGANIZATION_PLUGIN_REQUIRED: {
3969
+ readonly code: "ORGANIZATION_PLUGIN_REQUIRED";
3970
+ message: string;
949
3971
  };
950
- };
951
- $ERROR_CODES: {
952
- USER_NOT_FOUND: {
953
- readonly code: "USER_NOT_FOUND";
3972
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: {
3973
+ readonly code: "USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL";
954
3974
  message: string;
955
3975
  };
956
3976
  FAILED_TO_CREATE_USER: {
957
3977
  readonly code: "FAILED_TO_CREATE_USER";
958
3978
  message: string;
959
3979
  };
3980
+ USER_ALREADY_EXISTS: {
3981
+ readonly code: "USER_ALREADY_EXISTS";
3982
+ message: string;
3983
+ };
3984
+ YOU_CANNOT_BAN_YOURSELF: {
3985
+ readonly code: "YOU_CANNOT_BAN_YOURSELF";
3986
+ message: string;
3987
+ };
3988
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: {
3989
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE";
3990
+ message: string;
3991
+ };
3992
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: {
3993
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS";
3994
+ message: string;
3995
+ };
3996
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: {
3997
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_LIST_USERS";
3998
+ message: string;
3999
+ };
4000
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: {
4001
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS";
4002
+ message: string;
4003
+ };
4004
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: {
4005
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_BAN_USERS";
4006
+ message: string;
4007
+ };
4008
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: {
4009
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS";
4010
+ message: string;
4011
+ };
4012
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: {
4013
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS";
4014
+ message: string;
4015
+ };
4016
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: {
4017
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS";
4018
+ message: string;
4019
+ };
4020
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: {
4021
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD";
4022
+ message: string;
4023
+ };
4024
+ BANNED_USER: {
4025
+ readonly code: "BANNED_USER";
4026
+ message: string;
4027
+ };
4028
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: {
4029
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_GET_USER";
4030
+ message: string;
4031
+ };
4032
+ NO_DATA_TO_UPDATE: {
4033
+ readonly code: "NO_DATA_TO_UPDATE";
4034
+ message: string;
4035
+ };
4036
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: {
4037
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS";
4038
+ message: string;
4039
+ };
4040
+ YOU_CANNOT_REMOVE_YOURSELF: {
4041
+ readonly code: "YOU_CANNOT_REMOVE_YOURSELF";
4042
+ message: string;
4043
+ };
4044
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: {
4045
+ readonly code: "YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE";
4046
+ message: string;
4047
+ };
4048
+ YOU_CANNOT_IMPERSONATE_ADMINS: {
4049
+ readonly code: "YOU_CANNOT_IMPERSONATE_ADMINS";
4050
+ message: string;
4051
+ };
4052
+ INVALID_ROLE_TYPE: {
4053
+ readonly code: "INVALID_ROLE_TYPE";
4054
+ message: string;
4055
+ };
4056
+ USER_NOT_FOUND: {
4057
+ readonly code: "USER_NOT_FOUND";
4058
+ message: string;
4059
+ };
960
4060
  FAILED_TO_CREATE_SESSION: {
961
4061
  readonly code: "FAILED_TO_CREATE_SESSION";
962
4062
  message: string;
@@ -1025,14 +4125,6 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
1025
4125
  readonly code: "PASSWORD_TOO_LONG";
1026
4126
  message: string;
1027
4127
  };
1028
- USER_ALREADY_EXISTS: {
1029
- readonly code: "USER_ALREADY_EXISTS";
1030
- message: string;
1031
- };
1032
- USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: {
1033
- readonly code: "USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL";
1034
- message: string;
1035
- };
1036
4128
  EMAIL_CAN_NOT_BE_UPDATED: {
1037
4129
  readonly code: "EMAIL_CAN_NOT_BE_UPDATED";
1038
4130
  message: string;
@@ -1170,24 +4262,6 @@ type TeamMember = {
1170
4262
  createdAt: Date;
1171
4263
  };
1172
4264
 
1173
- declare class BaseError extends Error {
1174
- code: string;
1175
- constructor(code: string, message: string, options?: ErrorOptions);
1176
- }
1177
-
1178
- declare class ApplicationError extends BaseError {
1179
- constructor(message: string, options?: ErrorOptions);
1180
- }
1181
- declare class RefreshTokenExpiredError extends ApplicationError {
1182
- constructor(options?: ErrorOptions);
1183
- }
1184
- declare class AuthorizationFlowError extends ApplicationError {
1185
- constructor(message: string, options?: ErrorOptions);
1186
- }
1187
- declare class UserNotLoggedInError extends ApplicationError {
1188
- constructor(message: string, options?: ErrorOptions);
1189
- }
1190
-
1191
4265
  type Application = {
1192
4266
  id: string;
1193
4267
  name: string;
@@ -1212,6 +4286,24 @@ type WhoAmIResponse = {
1212
4286
  organization: FullOrganization;
1213
4287
  };
1214
4288
 
4289
+ declare class BaseError extends Error {
4290
+ code: string;
4291
+ constructor(code: string, message: string, options?: ErrorOptions);
4292
+ }
4293
+
4294
+ declare class ApplicationError extends BaseError {
4295
+ constructor(message: string, options?: ErrorOptions);
4296
+ }
4297
+ declare class RefreshTokenExpiredError extends ApplicationError {
4298
+ constructor(options?: ErrorOptions);
4299
+ }
4300
+ declare class AuthorizationFlowError extends ApplicationError {
4301
+ constructor(message: string, options?: ErrorOptions);
4302
+ }
4303
+ declare class UserNotLoggedInError extends ApplicationError {
4304
+ constructor(message: string, options?: ErrorOptions);
4305
+ }
4306
+
1215
4307
  /**
1216
4308
  * Service for managing applications and their candidate organizations.
1217
4309
  *
@@ -1235,7 +4327,13 @@ declare class ApplicationService {
1235
4327
  * @param applicationId - The application ID to get candidate organizations for
1236
4328
  * @returns The application details and list of candidate organizations
1237
4329
  */
1238
- listCandidateOrganizations(applicationId: string): Promise<any>;
4330
+ listCandidateOrganizations(applicationId: string): Promise<{
4331
+ organizations: FullOrganization[];
4332
+ application?: Application | undefined;
4333
+ } | {
4334
+ organizations: FullOrganization[];
4335
+ application?: Application | undefined;
4336
+ }>;
1239
4337
  /**
1240
4338
  * Starts an authorization flow for a specific application.
1241
4339
  *
@@ -1244,14 +4342,14 @@ declare class ApplicationService {
1244
4342
  * @param codeChallenge - The code challenge to use for the authorization flow
1245
4343
  * @param organizationId - The organization ID to start the authorization flow for
1246
4344
  */
1247
- startAuthorizationFlow(applicationId: string, redirectUri: string, codeChallenge: string, organizationId: string): Promise<any>;
4345
+ startAuthorizationFlow(applicationId: string, redirectUri: string, codeChallenge: string, organizationId: string): Promise<StartAuthorizationFlowResponse>;
1248
4346
  /**
1249
4347
  * Completes an authorization flow for a specific application.
1250
4348
  *
1251
4349
  * @param code - The code to use for the authorization flow
1252
4350
  * @param codeVerifier - The code verifier to use for the authorization flow
1253
4351
  */
1254
- completeAuthorizationFlow(code: string, codeVerifier: string): Promise<any>;
4352
+ completeAuthorizationFlow(code: string, codeVerifier: string): Promise<CompleteAuthorizationFlowResponse>;
1255
4353
  /**
1256
4354
  * Refreshes an authentication token for a specific application.
1257
4355
  *
@@ -1259,14 +4357,14 @@ declare class ApplicationService {
1259
4357
  * @throws {RefreshTokenExpiredError} When the refresh token has expired or is invalid
1260
4358
  * @throws {ApplicationError} For other API errors
1261
4359
  */
1262
- refreshAccessToken(refreshToken: string): Promise<any>;
4360
+ refreshAccessToken(refreshToken: string): Promise<CompleteAuthorizationFlowResponse>;
1263
4361
  /**
1264
4362
  * Gets the current user and organization for a specific application.
1265
4363
  *
1266
4364
  * @param accessToken - The access token to use for the who am I request
1267
4365
  * @returns The current user and organization
1268
4366
  */
1269
- whoAmI(accessToken: string): Promise<any>;
4367
+ whoAmI(accessToken: string): Promise<WhoAmIResponse>;
1270
4368
  /**
1271
4369
  * Switches the active organization for the authenticated user.
1272
4370
  *
@@ -1278,7 +4376,7 @@ declare class ApplicationService {
1278
4376
  * @param accessToken - Optional access token for authentication (uses cookie if not provided)
1279
4377
  * @returns New authentication tokens and user/organization details
1280
4378
  */
1281
- switchOrganization(organizationId: string, accessToken: string): Promise<any>;
4379
+ switchOrganization(organizationId: string, accessToken: string): Promise<CompleteAuthorizationFlowResponse>;
1282
4380
  /**
1283
4381
  * Logs out the user by invalidating their refresh token.
1284
4382
  *
@@ -1338,13 +4436,53 @@ declare class OrganizationService {
1338
4436
  * @param id - The organization ID
1339
4437
  * @returns The organization with members, invitations, and teams
1340
4438
  */
1341
- getOrganization(id: string): Promise<any>;
4439
+ getOrganization(id: string): Promise<{
4440
+ members: {
4441
+ id: string;
4442
+ organizationId: string;
4443
+ role: "org:admin" | "org:member" | "org:reviewer";
4444
+ createdAt: Date;
4445
+ userId: string;
4446
+ teamId?: string | undefined | undefined;
4447
+ user: {
4448
+ id: string;
4449
+ email: string;
4450
+ name: string;
4451
+ image?: string | undefined;
4452
+ };
4453
+ }[];
4454
+ invitations: {
4455
+ id: string;
4456
+ organizationId: string;
4457
+ email: string;
4458
+ role: "org:admin" | "org:member" | "org:reviewer";
4459
+ status: better_auth_plugins.InvitationStatus;
4460
+ inviterId: string;
4461
+ expiresAt: Date;
4462
+ createdAt: Date;
4463
+ teamId?: string | undefined | undefined;
4464
+ }[];
4465
+ teams: {
4466
+ id: string;
4467
+ name: string;
4468
+ organizationId: string;
4469
+ createdAt: Date;
4470
+ updatedAt?: Date | undefined;
4471
+ }[];
4472
+ } & {
4473
+ id: string;
4474
+ name: string;
4475
+ slug: string;
4476
+ createdAt: Date;
4477
+ logo?: string | null | undefined | undefined;
4478
+ metadata?: any;
4479
+ }>;
1342
4480
  /**
1343
4481
  * Lists all organizations accessible to the current user.
1344
4482
  *
1345
4483
  * @returns An array of organizations
1346
4484
  */
1347
- listOrganizations(): Promise<any[]>;
4485
+ listOrganizations(): Promise<ExtendedOrganization[]>;
1348
4486
  /**
1349
4487
  * Sets the active organization for the current user session.
1350
4488
  *
@@ -1360,7 +4498,7 @@ declare class OrganizationService {
1360
4498
  * @param payload.settings - New organization settings
1361
4499
  * @returns The updated organization
1362
4500
  */
1363
- updateOrganization(payload: UpdateOrganizationPayload): Promise<any>;
4501
+ updateOrganization(payload: UpdateOrganizationPayload): Promise<ExtendedOrganization>;
1364
4502
  /**
1365
4503
  * Lists members of the active organization with optional pagination.
1366
4504
  *
@@ -1369,13 +4507,63 @@ declare class OrganizationService {
1369
4507
  * @param options.offset - Number of members to skip
1370
4508
  * @returns An array of organization members
1371
4509
  */
1372
- listMembers(options?: ListMembersOptions): Promise<any>;
4510
+ listMembers(options?: ListMembersOptions): Promise<({
4511
+ id: string;
4512
+ organizationId: string;
4513
+ role: "org:admin" | "org:member" | "org:reviewer";
4514
+ createdAt: Date;
4515
+ userId: string;
4516
+ teamId?: string | undefined | undefined;
4517
+ user: {
4518
+ id: string;
4519
+ email: string;
4520
+ name: string;
4521
+ image?: string | undefined;
4522
+ };
4523
+ } & {
4524
+ user: {
4525
+ id: string;
4526
+ name: string;
4527
+ email: string;
4528
+ image: string | null | undefined;
4529
+ };
4530
+ })[]>;
1373
4531
  /**
1374
4532
  * Gets the currently active organization member for the authenticated user.
1375
4533
  *
1376
4534
  * @returns The active member object
1377
4535
  */
1378
- getActiveMember(): Promise<any>;
4536
+ getActiveMember(): Promise<NonNullable<Omit<{
4537
+ id: string;
4538
+ organizationId: string;
4539
+ role: "org:admin" | "org:member" | "org:reviewer";
4540
+ createdAt: Date;
4541
+ userId: string;
4542
+ teamId?: string | undefined | undefined;
4543
+ user: {
4544
+ id: string;
4545
+ email: string;
4546
+ name: string;
4547
+ image?: string | undefined;
4548
+ };
4549
+ } & {
4550
+ user: {
4551
+ id: string;
4552
+ createdAt: Date;
4553
+ updatedAt: Date;
4554
+ email: string;
4555
+ emailVerified: boolean;
4556
+ name: string;
4557
+ image?: string | null | undefined;
4558
+ };
4559
+ }, "user"> & {
4560
+ user: {
4561
+ id: string;
4562
+ name: string;
4563
+ email: string;
4564
+ image: string | undefined;
4565
+ };
4566
+ }>>;
1379
4567
  /**
1380
4568
  * Invites a user to join the active organization.
1381
4569
  *
@@ -1386,7 +4574,27 @@ declare class OrganizationService {
1386
4574
  * @param options.resend - Whether to resend if invitation already exists
1387
4575
  * @returns The created invitation
1388
4576
  */
1389
- inviteUserToOrganization({ userEmail, role, teamId, resend }: InviteUserToOrganizationOptions): Promise<any>;
4577
+ inviteUserToOrganization({ userEmail, role, teamId, resend }: InviteUserToOrganizationOptions): Promise<NonNullable<{
4578
+ id: string;
4579
+ organizationId: string;
4580
+ email: string;
4581
+ role: "org:admin" | "org:member" | "org:reviewer";
4582
+ status: better_auth_plugins.InvitationStatus;
4583
+ inviterId: string;
4584
+ expiresAt: Date;
4585
+ createdAt: Date;
4586
+ teamId?: string | undefined | undefined;
4587
+ } | {
4588
+ id: string;
4589
+ organizationId: string;
4590
+ email: string;
4591
+ role: "org:admin" | "org:member" | "org:reviewer";
4592
+ status: better_auth_plugins.InvitationStatus;
4593
+ inviterId: string;
4594
+ expiresAt: Date;
4595
+ createdAt: Date;
4596
+ teamId?: string | undefined | undefined;
4597
+ }>>;
1390
4598
  /**
1391
4599
  * Cancels a pending organization invitation.
1392
4600
  *
@@ -1422,7 +4630,13 @@ declare class OrganizationService {
1422
4630
  * @param payload.name - The name of the team
1423
4631
  * @returns The created team
1424
4632
  */
1425
- createTeam(payload: CreateTeamPayload): Promise<any>;
4633
+ createTeam(payload: CreateTeamPayload): Promise<{
4634
+ id: string;
4635
+ name: string;
4636
+ organizationId: string;
4637
+ createdAt: Date;
4638
+ updatedAt?: Date | undefined;
4639
+ }>;
1426
4640
  /**
1427
4641
  * Updates an existing team's details.
1428
4642
  *
@@ -1431,7 +4645,13 @@ declare class OrganizationService {
1431
4645
  * @param payload.name - The new team name
1432
4646
  * @returns The updated team
1433
4647
  */
1434
- updateTeam(id: string, payload: UpdateTeamPayload): Promise<any>;
4648
+ updateTeam(id: string, payload: UpdateTeamPayload): Promise<{
4649
+ id: string;
4650
+ name: string;
4651
+ organizationId: string;
4652
+ createdAt: Date;
4653
+ updatedAt?: Date | undefined;
4654
+ }>;
1435
4655
  /**
1436
4656
  * Deletes a team from the active organization.
1437
4657
  *
@@ -1443,14 +4663,25 @@ declare class OrganizationService {
1443
4663
  *
1444
4664
  * @returns An array of teams
1445
4665
  */
1446
- listTeams(): Promise<any>;
4666
+ listTeams(): Promise<{
4667
+ id: string;
4668
+ name: string;
4669
+ organizationId: string;
4670
+ createdAt: Date;
4671
+ updatedAt?: Date | undefined;
4672
+ }[]>;
1447
4673
  /**
1448
4674
  * Lists all members of a specific team.
1449
4675
  *
1450
4676
  * @param id - The team ID
1451
4677
  * @returns An array of team members
1452
4678
  */
1453
- listTeamMembers(id: string): Promise<any>;
4679
+ listTeamMembers(id: string): Promise<{
4680
+ id: string;
4681
+ teamId: string;
4682
+ userId: string;
4683
+ createdAt: Date;
4684
+ }[]>;
1454
4685
  /**
1455
4686
  * Adds a user to a team.
1456
4687
  *
@@ -1458,7 +4689,12 @@ declare class OrganizationService {
1458
4689
  * @param userId - The user ID to add
1459
4690
  * @returns The added team member
1460
4691
  */
1461
- addTeamMember(teamId: string, userId: string): Promise<any>;
4692
+ addTeamMember(teamId: string, userId: string): Promise<{
4693
+ id: string;
4694
+ teamId: string;
4695
+ userId: string;
4696
+ createdAt: Date;
4697
+ }>;
1462
4698
  /**
1463
4699
  * Removes a user from a team.
1464
4700
  *
@@ -1507,43 +4743,49 @@ declare class SessionService {
1507
4743
  * @returns The current user session
1508
4744
  */
1509
4745
  getSession(token?: string): Promise<{
1510
- data: {
1511
- user: better_auth.StripEmptyObjects<{
1512
- id: string;
1513
- createdAt: Date;
1514
- updatedAt: Date;
1515
- email: string;
1516
- emailVerified: boolean;
1517
- name: string;
1518
- image?: string | null | undefined;
1519
- }>;
1520
- session: better_auth.StripEmptyObjects<{
1521
- id: string;
1522
- createdAt: Date;
1523
- updatedAt: Date;
1524
- userId: string;
1525
- expiresAt: Date;
1526
- token: string;
1527
- ipAddress?: string | null | undefined;
1528
- userAgent?: string | null | undefined;
1529
- }>;
1530
- } | null;
1531
- error: null;
1532
- } | {
1533
- data: null;
1534
- error: {
1535
- code?: string | undefined | undefined;
1536
- message?: string | undefined | undefined;
1537
- status: number;
1538
- statusText: string;
1539
- };
1540
- }>;
4746
+ user: better_auth.StripEmptyObjects<{
4747
+ id: string;
4748
+ createdAt: Date;
4749
+ updatedAt: Date;
4750
+ email: string;
4751
+ emailVerified: boolean;
4752
+ name: string;
4753
+ image?: string | null | undefined;
4754
+ } & {
4755
+ twoFactorEnabled: boolean | null | undefined;
4756
+ } & {} & {
4757
+ banned: boolean | null | undefined;
4758
+ } & {
4759
+ role?: string | null | undefined;
4760
+ banReason?: string | null | undefined;
4761
+ banExpires?: Date | null | undefined;
4762
+ } & {} & {
4763
+ lastActiveAt?: Date | null | undefined;
4764
+ }>;
4765
+ session: better_auth.StripEmptyObjects<{
4766
+ id: string;
4767
+ createdAt: Date;
4768
+ updatedAt: Date;
4769
+ userId: string;
4770
+ expiresAt: Date;
4771
+ token: string;
4772
+ ipAddress?: string | null | undefined;
4773
+ userAgent?: string | null | undefined;
4774
+ } & {} & {
4775
+ activeOrganizationId?: string | null | undefined;
4776
+ activeTeamId?: string | null | undefined;
4777
+ } & {} & {
4778
+ impersonatedBy?: string | null | undefined;
4779
+ } & {} & {}>;
4780
+ } | null>;
1541
4781
  /**
1542
4782
  * Retrieves a valid JWT token.
1543
4783
  *
1544
4784
  * @returns The JWT token
1545
4785
  */
1546
- getToken(): Promise<any>;
4786
+ getToken(): Promise<{
4787
+ token: string;
4788
+ }>;
1547
4789
  /**
1548
4790
  * Initiates social authentication flow with Google or Microsoft.
1549
4791
  *
@@ -1602,7 +4844,9 @@ declare class SessionService {
1602
4844
  * @param nonce - The nonce to retrieve the token for
1603
4845
  * @returns The JWT token for the nonce
1604
4846
  */
1605
- getNoncePayload(nonce: string): Promise<any>;
4847
+ getNoncePayload(nonce: string): Promise<{
4848
+ token: string;
4849
+ }>;
1606
4850
  }
1607
4851
 
1608
4852
  type CreateApiKeyPayload = {
@@ -1640,11 +4884,113 @@ declare class ApiKeyService {
1640
4884
  * @param client - The API client for making API key requests
1641
4885
  */
1642
4886
  constructor(client: APIClient);
1643
- createApiKey(payload: CreateApiKeyPayload): Promise<any>;
1644
- getApiKey(id: string): Promise<any>;
1645
- listApiKeys(): Promise<any>;
1646
- updateApiKey(payload: UpdateApiKeyPayload): Promise<any>;
1647
- deleteApiKey(id: string): Promise<any>;
4887
+ createApiKey(payload: CreateApiKeyPayload): Promise<{
4888
+ key: string;
4889
+ metadata: any;
4890
+ permissions: any;
4891
+ id: string;
4892
+ configId: string;
4893
+ name: string | null;
4894
+ start: string | null;
4895
+ prefix: string | null;
4896
+ referenceId: string;
4897
+ refillInterval: number | null;
4898
+ refillAmount: number | null;
4899
+ lastRefillAt: Date | null;
4900
+ enabled: boolean;
4901
+ rateLimitEnabled: boolean;
4902
+ rateLimitTimeWindow: number | null;
4903
+ rateLimitMax: number | null;
4904
+ requestCount: number;
4905
+ remaining: number | null;
4906
+ lastRequest: Date | null;
4907
+ expiresAt: Date | null;
4908
+ createdAt: Date;
4909
+ updatedAt: Date;
4910
+ }>;
4911
+ getApiKey(id: string): Promise<{
4912
+ metadata: Record<string, any> | null;
4913
+ permissions: {
4914
+ [key: string]: string[];
4915
+ } | null;
4916
+ id: string;
4917
+ configId: string;
4918
+ name: string | null;
4919
+ start: string | null;
4920
+ prefix: string | null;
4921
+ referenceId: string;
4922
+ refillInterval: number | null;
4923
+ refillAmount: number | null;
4924
+ lastRefillAt: Date | null;
4925
+ enabled: boolean;
4926
+ rateLimitEnabled: boolean;
4927
+ rateLimitTimeWindow: number | null;
4928
+ rateLimitMax: number | null;
4929
+ requestCount: number;
4930
+ remaining: number | null;
4931
+ lastRequest: Date | null;
4932
+ expiresAt: Date | null;
4933
+ createdAt: Date;
4934
+ updatedAt: Date;
4935
+ }>;
4936
+ listApiKeys(): Promise<{
4937
+ apiKeys: {
4938
+ metadata: Record<string, any> | null;
4939
+ permissions: {
4940
+ [key: string]: string[];
4941
+ } | null;
4942
+ id: string;
4943
+ configId: string;
4944
+ name: string | null;
4945
+ start: string | null;
4946
+ prefix: string | null;
4947
+ referenceId: string;
4948
+ refillInterval: number | null;
4949
+ refillAmount: number | null;
4950
+ lastRefillAt: Date | null;
4951
+ enabled: boolean;
4952
+ rateLimitEnabled: boolean;
4953
+ rateLimitTimeWindow: number | null;
4954
+ rateLimitMax: number | null;
4955
+ requestCount: number;
4956
+ remaining: number | null;
4957
+ lastRequest: Date | null;
4958
+ expiresAt: Date | null;
4959
+ createdAt: Date;
4960
+ updatedAt: Date;
4961
+ }[];
4962
+ total: number;
4963
+ limit: number | undefined;
4964
+ offset: number | undefined;
4965
+ }>;
4966
+ updateApiKey(payload: UpdateApiKeyPayload): Promise<{
4967
+ metadata: Record<string, any> | null;
4968
+ permissions: {
4969
+ [key: string]: string[];
4970
+ } | null;
4971
+ id: string;
4972
+ configId: string;
4973
+ name: string | null;
4974
+ start: string | null;
4975
+ prefix: string | null;
4976
+ referenceId: string;
4977
+ refillInterval: number | null;
4978
+ refillAmount: number | null;
4979
+ lastRefillAt: Date | null;
4980
+ enabled: boolean;
4981
+ rateLimitEnabled: boolean;
4982
+ rateLimitTimeWindow: number | null;
4983
+ rateLimitMax: number | null;
4984
+ requestCount: number;
4985
+ remaining: number | null;
4986
+ lastRequest: Date | null;
4987
+ expiresAt: Date | null;
4988
+ createdAt: Date;
4989
+ updatedAt: Date;
4990
+ }>;
4991
+ deleteApiKey(id: string): Promise<{
4992
+ success: boolean;
4993
+ }>;
1648
4994
  }
1649
4995
 
1650
4996
  /**