@meistrari/auth-core 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +834 -3230
- package/dist/index.d.ts +834 -3230
- package/dist/index.mjs +127 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import z, { z as z$1 } from 'zod';
|
|
|
6
6
|
import * as better_auth_client from 'better-auth/client';
|
|
7
7
|
import { BetterFetchOption } from 'better-auth/client';
|
|
8
8
|
import * as jose from 'jose';
|
|
9
|
-
import * as _better_auth_sso from '@better-auth/sso';
|
|
10
9
|
import { ApiKey as ApiKey$1 } from '@better-auth/api-key';
|
|
11
10
|
|
|
12
11
|
declare const AMRBrand: unique symbol;
|
|
@@ -14,11 +13,11 @@ declare const AALBrand: unique symbol;
|
|
|
14
13
|
declare const ACRBrand: unique symbol;
|
|
15
14
|
declare const AuthMethodBrand: unique symbol;
|
|
16
15
|
declare const AMRs: {
|
|
17
|
-
readonly Pwd: ("
|
|
18
|
-
readonly Otp: ("
|
|
19
|
-
readonly Oauth: ("
|
|
20
|
-
readonly Sso: ("
|
|
21
|
-
readonly Saml: ("
|
|
16
|
+
readonly Pwd: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
|
|
17
|
+
readonly Otp: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
|
|
18
|
+
readonly Oauth: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
|
|
19
|
+
readonly Sso: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
|
|
20
|
+
readonly Saml: ("pwd" & z.core.$brand<typeof AMRBrand>) | ("otp" & z.core.$brand<typeof AMRBrand>) | ("oauth" & z.core.$brand<typeof AMRBrand>) | ("sso" & z.core.$brand<typeof AMRBrand>) | ("saml" & z.core.$brand<typeof AMRBrand>);
|
|
22
21
|
};
|
|
23
22
|
declare const AALs: {
|
|
24
23
|
readonly Aal1: ("aal1" & z.core.$brand<typeof AALBrand>) | ("aal2" & z.core.$brand<typeof AALBrand>) | ("aal3" & z.core.$brand<typeof AALBrand>);
|
|
@@ -29,11 +28,11 @@ declare const ACRs: {
|
|
|
29
28
|
readonly Unspecified: "urn:tela:auth:unspecified" & z.core.$brand<typeof ACRBrand>;
|
|
30
29
|
};
|
|
31
30
|
declare const AuthMethods: {
|
|
32
|
-
readonly Password: ("
|
|
33
|
-
readonly EmailOTP: ("
|
|
34
|
-
readonly OAuth: ("
|
|
35
|
-
readonly SAML: ("
|
|
36
|
-
readonly Unknown: ("
|
|
31
|
+
readonly Password: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
|
|
32
|
+
readonly EmailOTP: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
|
|
33
|
+
readonly OAuth: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
|
|
34
|
+
readonly SAML: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
|
|
35
|
+
readonly Unknown: ("oauth" & z.core.$brand<typeof AuthMethodBrand>) | ("saml" & z.core.$brand<typeof AuthMethodBrand>) | ("password" & z.core.$brand<typeof AuthMethodBrand>) | ("email_otp" & z.core.$brand<typeof AuthMethodBrand>) | ("unknown" & z.core.$brand<typeof AuthMethodBrand>);
|
|
37
36
|
};
|
|
38
37
|
declare const AMR: z.core.$ZodBranded<z.ZodEnum<{
|
|
39
38
|
readonly Pwd: "pwd";
|
|
@@ -531,2697 +530,527 @@ declare class SessionAssuranceService {
|
|
|
531
530
|
completeOAuthStepUp(stepUpToken: string): Promise<OAuthCompleteStepUpResponse>;
|
|
532
531
|
}
|
|
533
532
|
|
|
534
|
-
declare const
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
}
|
|
533
|
+
declare const DEFAULT_SESSION_ASSURANCE_CONFIG: ApplicationSessionAssuranceConfig;
|
|
534
|
+
declare const DEFAULT_APPLICATION_CONFIG: {
|
|
535
|
+
version: 1;
|
|
536
|
+
sessionAssurance: ApplicationSessionAssuranceConfig;
|
|
537
|
+
};
|
|
538
|
+
type ApplicationSessionAssuranceConfig = {
|
|
539
|
+
acceptedAmr: AMR[];
|
|
540
|
+
minAal: AAL;
|
|
541
|
+
};
|
|
542
|
+
declare const ApplicationSessionAssuranceConfig: z.ZodType<ApplicationSessionAssuranceConfig>;
|
|
543
|
+
type ApplicationConfig = {
|
|
544
|
+
version: 1;
|
|
545
|
+
sessionAssurance: ApplicationSessionAssuranceConfig;
|
|
546
|
+
};
|
|
547
|
+
declare const ApplicationConfig: z.ZodType<ApplicationConfig>;
|
|
548
548
|
/**
|
|
549
|
-
*
|
|
549
|
+
* Keys of the organization's related collections that can be optionally
|
|
550
|
+
* included in the "who am I" response.
|
|
550
551
|
*/
|
|
551
|
-
type
|
|
552
|
+
type WhoAmIInclude = 'members' | 'teams' | 'invitations';
|
|
552
553
|
/**
|
|
553
|
-
*
|
|
554
|
-
*
|
|
555
|
-
* The secret `key` field is only returned once at creation time.
|
|
554
|
+
* Represents a registered OAuth application.
|
|
556
555
|
*/
|
|
557
|
-
type
|
|
558
|
-
/**
|
|
556
|
+
type Application = {
|
|
557
|
+
/** Unique application identifier. */
|
|
558
|
+
id: string;
|
|
559
|
+
/** Display name of the application. */
|
|
559
560
|
name: string;
|
|
560
|
-
/**
|
|
561
|
-
|
|
561
|
+
/** Human-readable description of the application. */
|
|
562
|
+
description: string;
|
|
563
|
+
/** Allowed OAuth redirect URIs for this application. */
|
|
564
|
+
redirectUris: string[];
|
|
565
|
+
/** Additional configuration for this application. */
|
|
566
|
+
config?: ApplicationConfig;
|
|
562
567
|
};
|
|
563
568
|
/**
|
|
564
|
-
*
|
|
569
|
+
* Response returned when listing candidate organizations for an application.
|
|
570
|
+
*/
|
|
571
|
+
type ListCandidateOrganizationsResponse = FullOrganization[];
|
|
572
|
+
/**
|
|
573
|
+
* Public application context used to preserve continuity during auth redirects.
|
|
574
|
+
*/
|
|
575
|
+
type ApplicationAuthContextResponse = {
|
|
576
|
+
/** Minimal application identity shown in the hosted auth flow. */
|
|
577
|
+
application: Pick<Application, 'id' | 'name' | 'config'>;
|
|
578
|
+
};
|
|
579
|
+
/**
|
|
580
|
+
* Response returned when starting an authorization flow.
|
|
581
|
+
*/
|
|
582
|
+
type StartAuthorizationFlowResponse = {
|
|
583
|
+
/** The authorization code to exchange for tokens. */
|
|
584
|
+
code: string;
|
|
585
|
+
};
|
|
586
|
+
/**
|
|
587
|
+
* Response returned when completing an authorization flow or refreshing tokens.
|
|
588
|
+
*/
|
|
589
|
+
type CompleteAuthorizationFlowResponse = {
|
|
590
|
+
/** Short-lived JWT access token. */
|
|
591
|
+
accessToken: string;
|
|
592
|
+
/** Long-lived refresh token for obtaining new access tokens. */
|
|
593
|
+
refreshToken: string;
|
|
594
|
+
/** The authenticated user. */
|
|
595
|
+
user: User;
|
|
596
|
+
/** The organization the tokens are scoped to. */
|
|
597
|
+
organization: FullOrganization;
|
|
598
|
+
/** Assurance context embedded in the issued access token. */
|
|
599
|
+
assurance: JWTPayload['assurance'];
|
|
600
|
+
};
|
|
601
|
+
/**
|
|
602
|
+
* Response returned by the "who am I" endpoint.
|
|
565
603
|
*
|
|
566
|
-
*
|
|
604
|
+
* By default, the `organization` only contains the base organization fields.
|
|
605
|
+
* The `members`, `teams`, and `invitations` collections are only populated
|
|
606
|
+
* when explicitly requested via the `include` query parameter.
|
|
567
607
|
*/
|
|
568
|
-
type
|
|
608
|
+
type WhoAmIResponse = {
|
|
609
|
+
/** The authenticated user. */
|
|
610
|
+
user: User;
|
|
611
|
+
/** The user's active organization. */
|
|
612
|
+
organization: WhoAmIOrganization;
|
|
613
|
+
/** Assurance context embedded in the verified access token. */
|
|
614
|
+
assurance: JWTPayload['assurance'];
|
|
615
|
+
};
|
|
569
616
|
/**
|
|
570
|
-
*
|
|
617
|
+
* Options accepted by the "who am I" client method.
|
|
571
618
|
*/
|
|
572
|
-
type
|
|
573
|
-
/**
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
prefix?: string;
|
|
579
|
-
/** Optional metadata to attach to the key. */
|
|
580
|
-
metadata?: ApiKeyMetadata;
|
|
619
|
+
type WhoAmIOptions = {
|
|
620
|
+
/**
|
|
621
|
+
* Collections to include in the returned organization. When omitted or
|
|
622
|
+
* empty, only the base organization fields are returned.
|
|
623
|
+
*/
|
|
624
|
+
include?: WhoAmIInclude[];
|
|
581
625
|
};
|
|
582
626
|
/**
|
|
583
|
-
*
|
|
627
|
+
* Response returned when starting a device authorization flow (RFC 8628).
|
|
584
628
|
*/
|
|
585
|
-
type
|
|
586
|
-
/** The
|
|
629
|
+
type DeviceAuthorizationResponse = {
|
|
630
|
+
/** The device verification code for polling. */
|
|
631
|
+
device_code: string;
|
|
632
|
+
/** The user-facing code to enter on the verification page. */
|
|
633
|
+
user_code: string;
|
|
634
|
+
/** The URI the user should visit to authorize the device. */
|
|
635
|
+
verification_uri: string;
|
|
636
|
+
/** A complete URI including the user code for convenience. */
|
|
637
|
+
verification_uri_complete: string;
|
|
638
|
+
/** Number of seconds until the device code expires. */
|
|
639
|
+
expires_in: number;
|
|
640
|
+
/** Minimum polling interval in seconds. */
|
|
641
|
+
interval: number;
|
|
642
|
+
};
|
|
643
|
+
/**
|
|
644
|
+
* Minimal application info shown in device authorization context.
|
|
645
|
+
*
|
|
646
|
+
* @internal
|
|
647
|
+
*/
|
|
648
|
+
type DeviceContextApplication = {
|
|
649
|
+
/** Unique application identifier. */
|
|
587
650
|
id: string;
|
|
588
|
-
/**
|
|
651
|
+
/** Display name of the application. */
|
|
589
652
|
name: string;
|
|
653
|
+
/** Human-readable description, or `null` if not set. */
|
|
654
|
+
description: string | null;
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* Context information for a pending device authorization request.
|
|
658
|
+
*/
|
|
659
|
+
type DeviceAuthorizationContextResponse = {
|
|
660
|
+
/** The application that initiated the device flow, with verification status. */
|
|
661
|
+
requester: DeviceContextApplication & {
|
|
662
|
+
isVerified: boolean;
|
|
663
|
+
};
|
|
664
|
+
/** The target application the requester wants access to. */
|
|
665
|
+
target: DeviceContextApplication;
|
|
666
|
+
/** Organizations the user can authorize the device for. */
|
|
667
|
+
organizations: FullOrganization[];
|
|
668
|
+
/** Organization pre-selected by the requester, if any. */
|
|
669
|
+
preselectedOrganizationId: string | null;
|
|
670
|
+
/** Current status of the device authorization request. */
|
|
671
|
+
status: 'pending' | 'approved' | 'denied';
|
|
672
|
+
/** Seconds remaining before the device code expires. */
|
|
673
|
+
expiresIn: number;
|
|
674
|
+
};
|
|
675
|
+
/**
|
|
676
|
+
* Response returned when approving or denying a device authorization request.
|
|
677
|
+
*/
|
|
678
|
+
type DeviceAuthorizationActionResponse = {
|
|
679
|
+
/** Whether the action was performed successfully. */
|
|
680
|
+
success: boolean;
|
|
590
681
|
};
|
|
591
682
|
|
|
592
683
|
/**
|
|
593
|
-
*
|
|
594
|
-
* @template T - The type to remove index signatures from
|
|
595
|
-
* @example
|
|
596
|
-
* ```typescript
|
|
597
|
-
* type MyType = {
|
|
598
|
-
* foo: string
|
|
599
|
-
* bar: number
|
|
600
|
-
* [key: string]: any
|
|
601
|
-
* }
|
|
684
|
+
* Generic error thrown by the `ApplicationService`.
|
|
602
685
|
*
|
|
603
|
-
*
|
|
604
|
-
*
|
|
686
|
+
* All application-specific errors extend this class, so you can catch
|
|
687
|
+
* `ApplicationError` to handle any application-related failure.
|
|
605
688
|
*/
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
}
|
|
689
|
+
declare class ApplicationError extends BaseError {
|
|
690
|
+
constructor(message: string, options?: ErrorOptions);
|
|
691
|
+
}
|
|
609
692
|
/**
|
|
610
|
-
*
|
|
693
|
+
* Thrown when a refresh token has expired or been revoked.
|
|
611
694
|
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
|
|
695
|
+
* The client should discard its stored tokens and prompt the user
|
|
696
|
+
* to re-authenticate.
|
|
697
|
+
*/
|
|
698
|
+
declare class RefreshTokenExpiredError extends ApplicationError {
|
|
699
|
+
constructor(options?: ErrorOptions);
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Thrown when an authorization flow fails unexpectedly.
|
|
703
|
+
*/
|
|
704
|
+
declare class AuthorizationFlowError extends ApplicationError {
|
|
705
|
+
constructor(message: string, options?: ErrorOptions);
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Thrown when the authenticated session no longer satisfies the target
|
|
709
|
+
* application's assurance policy.
|
|
615
710
|
*
|
|
616
|
-
*
|
|
711
|
+
* During device-code token exchange this is a final error: the consumed flow
|
|
712
|
+
* cannot be retried and the client must start a new device authorization flow.
|
|
617
713
|
*/
|
|
618
|
-
declare
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
922
|
-
query?: {
|
|
923
|
-
organizationId?: string | undefined;
|
|
924
|
-
organizationSlug?: string | undefined;
|
|
925
|
-
membersLimit?: string | number | undefined;
|
|
926
|
-
} | undefined;
|
|
927
|
-
fetchOptions?: FetchOptions | undefined;
|
|
928
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
929
|
-
members: {
|
|
930
|
-
id: string;
|
|
931
|
-
organizationId: string;
|
|
932
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
933
|
-
createdAt: Date;
|
|
934
|
-
userId: string;
|
|
935
|
-
teamId?: string | undefined | undefined;
|
|
936
|
-
user: {
|
|
937
|
-
id: string;
|
|
938
|
-
email: string;
|
|
939
|
-
name: string;
|
|
940
|
-
image?: string | undefined;
|
|
941
|
-
};
|
|
942
|
-
}[];
|
|
943
|
-
invitations: {
|
|
944
|
-
id: string;
|
|
945
|
-
organizationId: string;
|
|
946
|
-
email: string;
|
|
947
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
948
|
-
status: better_auth_plugins.InvitationStatus;
|
|
949
|
-
inviterId: string;
|
|
950
|
-
expiresAt: Date;
|
|
951
|
-
createdAt: Date;
|
|
952
|
-
teamId?: string | undefined | undefined;
|
|
953
|
-
}[];
|
|
954
|
-
teams: {
|
|
955
|
-
id: string;
|
|
956
|
-
name: string;
|
|
957
|
-
organizationId: string;
|
|
958
|
-
createdAt: Date;
|
|
959
|
-
updatedAt?: Date | undefined;
|
|
960
|
-
}[];
|
|
961
|
-
} & {
|
|
962
|
-
id: string;
|
|
963
|
-
name: string;
|
|
964
|
-
slug: string;
|
|
965
|
-
createdAt: Date;
|
|
966
|
-
logo?: string | null | undefined | undefined;
|
|
967
|
-
metadata?: any;
|
|
968
|
-
}, {
|
|
969
|
-
code?: string | undefined;
|
|
970
|
-
message?: string | undefined;
|
|
971
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
972
|
-
};
|
|
973
|
-
} & {
|
|
974
|
-
organization: {
|
|
975
|
-
list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
976
|
-
query?: Record<string, any> | undefined;
|
|
977
|
-
fetchOptions?: FetchOptions | undefined;
|
|
978
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
979
|
-
id: string;
|
|
980
|
-
name: string;
|
|
981
|
-
slug: string;
|
|
982
|
-
createdAt: Date;
|
|
983
|
-
logo?: string | null | undefined | undefined;
|
|
984
|
-
metadata?: any;
|
|
985
|
-
}[], {
|
|
986
|
-
code?: string | undefined;
|
|
987
|
-
message?: string | undefined;
|
|
988
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
989
|
-
};
|
|
990
|
-
} & {
|
|
991
|
-
organization: {
|
|
992
|
-
inviteMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
993
|
-
email: string;
|
|
994
|
-
role: "org:admin" | "org:member" | "org:reviewer" | ("org:admin" | "org:member" | "org:reviewer")[];
|
|
995
|
-
organizationId?: string | undefined;
|
|
996
|
-
resend?: boolean | undefined;
|
|
997
|
-
} & {
|
|
998
|
-
teamId?: (string | string[]) | undefined;
|
|
999
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1000
|
-
email: string;
|
|
1001
|
-
role: "org:admin" | "org:member" | "org:reviewer" | ("org:admin" | "org:member" | "org:reviewer")[];
|
|
1002
|
-
organizationId?: string | undefined;
|
|
1003
|
-
resend?: boolean | undefined;
|
|
1004
|
-
} & {
|
|
1005
|
-
teamId?: (string | string[]) | undefined;
|
|
1006
|
-
} & {
|
|
1007
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1008
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
|
|
1009
|
-
id: string;
|
|
1010
|
-
organizationId: string;
|
|
1011
|
-
email: string;
|
|
1012
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1013
|
-
status: better_auth_plugins.InvitationStatus;
|
|
1014
|
-
inviterId: string;
|
|
1015
|
-
expiresAt: Date;
|
|
1016
|
-
createdAt: Date;
|
|
1017
|
-
teamId?: string | undefined | undefined;
|
|
1018
|
-
} | {
|
|
1019
|
-
id: string;
|
|
1020
|
-
organizationId: string;
|
|
1021
|
-
email: string;
|
|
1022
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1023
|
-
status: better_auth_plugins.InvitationStatus;
|
|
1024
|
-
inviterId: string;
|
|
1025
|
-
expiresAt: Date;
|
|
1026
|
-
createdAt: Date;
|
|
1027
|
-
teamId?: string | undefined | undefined;
|
|
1028
|
-
}>, {
|
|
1029
|
-
code?: string | undefined;
|
|
1030
|
-
message?: string | undefined;
|
|
1031
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1032
|
-
};
|
|
1033
|
-
} & {
|
|
1034
|
-
organization: {
|
|
1035
|
-
cancelInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1036
|
-
invitationId: string;
|
|
1037
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1038
|
-
invitationId: string;
|
|
1039
|
-
} & {
|
|
1040
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1041
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1042
|
-
id: string;
|
|
1043
|
-
organizationId: string;
|
|
1044
|
-
email: string;
|
|
1045
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1046
|
-
status: better_auth_plugins.InvitationStatus;
|
|
1047
|
-
inviterId: string;
|
|
1048
|
-
expiresAt: Date;
|
|
1049
|
-
createdAt: Date;
|
|
1050
|
-
teamId?: string | undefined | undefined;
|
|
1051
|
-
}, {
|
|
1052
|
-
code?: string | undefined;
|
|
1053
|
-
message?: string | undefined;
|
|
1054
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1055
|
-
};
|
|
1056
|
-
} & {
|
|
1057
|
-
organization: {
|
|
1058
|
-
acceptInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1059
|
-
invitationId: string;
|
|
1060
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1061
|
-
invitationId: string;
|
|
1062
|
-
} & {
|
|
1063
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1064
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1065
|
-
invitation: {
|
|
1066
|
-
id: string;
|
|
1067
|
-
organizationId: string;
|
|
1068
|
-
email: string;
|
|
1069
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1070
|
-
status: better_auth_plugins.InvitationStatus;
|
|
1071
|
-
inviterId: string;
|
|
1072
|
-
expiresAt: Date;
|
|
1073
|
-
createdAt: Date;
|
|
1074
|
-
teamId?: string | undefined | undefined;
|
|
1075
|
-
};
|
|
1076
|
-
member: {
|
|
1077
|
-
id: string;
|
|
1078
|
-
organizationId: string;
|
|
1079
|
-
userId: string;
|
|
1080
|
-
role: string;
|
|
1081
|
-
createdAt: Date;
|
|
1082
|
-
};
|
|
1083
|
-
}, {
|
|
1084
|
-
code?: string | undefined;
|
|
1085
|
-
message?: string | undefined;
|
|
1086
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1087
|
-
};
|
|
1088
|
-
} & {
|
|
1089
|
-
organization: {
|
|
1090
|
-
getInvitation: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
1091
|
-
id: string;
|
|
1092
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1093
|
-
query: {
|
|
1094
|
-
id: string;
|
|
1095
|
-
};
|
|
1096
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1097
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
|
|
1098
|
-
id: string;
|
|
1099
|
-
organizationId: string;
|
|
1100
|
-
email: string;
|
|
1101
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1102
|
-
status: better_auth_plugins.InvitationStatus;
|
|
1103
|
-
inviterId: string;
|
|
1104
|
-
expiresAt: Date;
|
|
1105
|
-
createdAt: Date;
|
|
1106
|
-
teamId?: string | undefined | undefined;
|
|
1107
|
-
} & {
|
|
1108
|
-
organizationName: string;
|
|
1109
|
-
organizationSlug: string;
|
|
1110
|
-
inviterEmail: string;
|
|
1111
|
-
}>, {
|
|
1112
|
-
code?: string | undefined;
|
|
1113
|
-
message?: string | undefined;
|
|
1114
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1115
|
-
};
|
|
1116
|
-
} & {
|
|
1117
|
-
organization: {
|
|
1118
|
-
rejectInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1119
|
-
invitationId: string;
|
|
1120
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1121
|
-
invitationId: string;
|
|
1122
|
-
} & {
|
|
1123
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1124
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1125
|
-
invitation: {
|
|
1126
|
-
id: string;
|
|
1127
|
-
organizationId: string;
|
|
1128
|
-
email: string;
|
|
1129
|
-
role: "admin" | "member" | "owner";
|
|
1130
|
-
status: better_auth_plugins.InvitationStatus;
|
|
1131
|
-
inviterId: string;
|
|
1132
|
-
expiresAt: Date;
|
|
1133
|
-
createdAt: Date;
|
|
1134
|
-
} | null;
|
|
1135
|
-
member: null;
|
|
1136
|
-
}, {
|
|
1137
|
-
code?: string | undefined;
|
|
1138
|
-
message?: string | undefined;
|
|
1139
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1140
|
-
};
|
|
1141
|
-
} & {
|
|
1142
|
-
organization: {
|
|
1143
|
-
listInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
1144
|
-
organizationId?: string | undefined;
|
|
1145
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1146
|
-
query?: {
|
|
1147
|
-
organizationId?: string | undefined;
|
|
1148
|
-
} | undefined;
|
|
1149
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1150
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1151
|
-
id: string;
|
|
1152
|
-
organizationId: string;
|
|
1153
|
-
email: string;
|
|
1154
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1155
|
-
status: better_auth_plugins.InvitationStatus;
|
|
1156
|
-
inviterId: string;
|
|
1157
|
-
expiresAt: Date;
|
|
1158
|
-
createdAt: Date;
|
|
1159
|
-
teamId?: string | undefined | undefined;
|
|
1160
|
-
}[], {
|
|
1161
|
-
code?: string | undefined;
|
|
1162
|
-
message?: string | undefined;
|
|
1163
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1164
|
-
};
|
|
1165
|
-
} & {
|
|
1166
|
-
organization: {
|
|
1167
|
-
getActiveMember: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1168
|
-
query?: Record<string, any> | undefined;
|
|
1169
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1170
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<Omit<{
|
|
1171
|
-
id: string;
|
|
1172
|
-
organizationId: string;
|
|
1173
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1174
|
-
createdAt: Date;
|
|
1175
|
-
userId: string;
|
|
1176
|
-
teamId?: string | undefined | undefined;
|
|
1177
|
-
user: {
|
|
1178
|
-
id: string;
|
|
1179
|
-
email: string;
|
|
1180
|
-
name: string;
|
|
1181
|
-
image?: string | undefined;
|
|
1182
|
-
};
|
|
1183
|
-
} & {
|
|
1184
|
-
user: {
|
|
1185
|
-
id: string;
|
|
1186
|
-
createdAt: Date;
|
|
1187
|
-
updatedAt: Date;
|
|
1188
|
-
email: string;
|
|
1189
|
-
emailVerified: boolean;
|
|
1190
|
-
name: string;
|
|
1191
|
-
image?: string | null | undefined;
|
|
1192
|
-
};
|
|
1193
|
-
}, "user"> & {
|
|
1194
|
-
user: {
|
|
1195
|
-
id: string;
|
|
1196
|
-
name: string;
|
|
1197
|
-
email: string;
|
|
1198
|
-
image: string | undefined;
|
|
1199
|
-
};
|
|
1200
|
-
}>, {
|
|
1201
|
-
code?: string | undefined;
|
|
1202
|
-
message?: string | undefined;
|
|
1203
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1204
|
-
};
|
|
1205
|
-
} & {
|
|
1206
|
-
organization: {
|
|
1207
|
-
checkSlug: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1208
|
-
slug: string;
|
|
1209
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1210
|
-
slug: string;
|
|
1211
|
-
} & {
|
|
1212
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1213
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1214
|
-
status: boolean;
|
|
1215
|
-
}, {
|
|
1216
|
-
code?: string | undefined;
|
|
1217
|
-
message?: string | undefined;
|
|
1218
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1219
|
-
};
|
|
1220
|
-
} & {
|
|
1221
|
-
organization: {
|
|
1222
|
-
removeMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1223
|
-
memberIdOrEmail: string;
|
|
1224
|
-
organizationId?: string | undefined;
|
|
1225
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1226
|
-
memberIdOrEmail: string;
|
|
1227
|
-
organizationId?: string | undefined;
|
|
1228
|
-
} & {
|
|
1229
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1230
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1231
|
-
member: {
|
|
1232
|
-
id: string;
|
|
1233
|
-
organizationId: string;
|
|
1234
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1235
|
-
createdAt: Date;
|
|
1236
|
-
userId: string;
|
|
1237
|
-
teamId?: string | undefined | undefined;
|
|
1238
|
-
user: {
|
|
1239
|
-
id: string;
|
|
1240
|
-
email: string;
|
|
1241
|
-
name: string;
|
|
1242
|
-
image?: string | undefined;
|
|
1243
|
-
};
|
|
1244
|
-
};
|
|
1245
|
-
}, {
|
|
1246
|
-
code?: string | undefined;
|
|
1247
|
-
message?: string | undefined;
|
|
1248
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1249
|
-
};
|
|
1250
|
-
} & {
|
|
1251
|
-
organization: {
|
|
1252
|
-
updateMemberRole: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1253
|
-
role: better_auth.LiteralString | "org:admin" | "org:member" | "org:reviewer" | better_auth.LiteralString[] | ("org:admin" | "org:member" | "org:reviewer")[];
|
|
1254
|
-
memberId: string;
|
|
1255
|
-
organizationId?: string | undefined;
|
|
1256
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1257
|
-
role: better_auth.LiteralString | "org:admin" | "org:member" | "org:reviewer" | better_auth.LiteralString[] | ("org:admin" | "org:member" | "org:reviewer")[];
|
|
1258
|
-
memberId: string;
|
|
1259
|
-
organizationId?: string | undefined;
|
|
1260
|
-
} & {
|
|
1261
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1262
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1263
|
-
id: string;
|
|
1264
|
-
organizationId: string;
|
|
1265
|
-
role: "admin" | "member" | "owner";
|
|
1266
|
-
createdAt: Date;
|
|
1267
|
-
userId: string;
|
|
1268
|
-
user: {
|
|
1269
|
-
id: string;
|
|
1270
|
-
email: string;
|
|
1271
|
-
name: string;
|
|
1272
|
-
image?: string | undefined;
|
|
1273
|
-
};
|
|
1274
|
-
}, {
|
|
1275
|
-
code?: string | undefined;
|
|
1276
|
-
message?: string | undefined;
|
|
1277
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1278
|
-
};
|
|
1279
|
-
} & {
|
|
1280
|
-
organization: {
|
|
1281
|
-
leave: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1282
|
-
organizationId: string;
|
|
1283
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1284
|
-
organizationId: string;
|
|
1285
|
-
} & {
|
|
1286
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1287
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<Omit<{
|
|
1288
|
-
id: string;
|
|
1289
|
-
organizationId: string;
|
|
1290
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1291
|
-
createdAt: Date;
|
|
1292
|
-
userId: string;
|
|
1293
|
-
teamId?: string | undefined | undefined;
|
|
1294
|
-
user: {
|
|
1295
|
-
id: string;
|
|
1296
|
-
email: string;
|
|
1297
|
-
name: string;
|
|
1298
|
-
image?: string | undefined;
|
|
1299
|
-
};
|
|
1300
|
-
} & {
|
|
1301
|
-
user: {
|
|
1302
|
-
id: string;
|
|
1303
|
-
createdAt: Date;
|
|
1304
|
-
updatedAt: Date;
|
|
1305
|
-
email: string;
|
|
1306
|
-
emailVerified: boolean;
|
|
1307
|
-
name: string;
|
|
1308
|
-
image?: string | null | undefined;
|
|
1309
|
-
};
|
|
1310
|
-
}, "user"> & {
|
|
1311
|
-
user: {
|
|
1312
|
-
id: string;
|
|
1313
|
-
name: string;
|
|
1314
|
-
email: string;
|
|
1315
|
-
image: string | undefined;
|
|
1316
|
-
};
|
|
1317
|
-
}>, {
|
|
1318
|
-
code?: string | undefined;
|
|
1319
|
-
message?: string | undefined;
|
|
1320
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1321
|
-
};
|
|
1322
|
-
} & {
|
|
1323
|
-
organization: {
|
|
1324
|
-
listUserInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
1325
|
-
email?: string | undefined;
|
|
1326
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1327
|
-
query?: {
|
|
1328
|
-
email?: string | undefined;
|
|
1329
|
-
} | undefined;
|
|
1330
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1331
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
|
|
1332
|
-
id: string;
|
|
1333
|
-
organizationId: string;
|
|
1334
|
-
email: string;
|
|
1335
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1336
|
-
status: better_auth_plugins.InvitationStatus;
|
|
1337
|
-
inviterId: string;
|
|
1338
|
-
expiresAt: Date;
|
|
1339
|
-
createdAt: Date;
|
|
1340
|
-
teamId?: string | undefined | undefined;
|
|
1341
|
-
} & {
|
|
1342
|
-
organization: {
|
|
1343
|
-
id: string;
|
|
1344
|
-
name: string;
|
|
1345
|
-
slug: string;
|
|
1346
|
-
createdAt: Date;
|
|
1347
|
-
logo?: string | null | undefined | undefined;
|
|
1348
|
-
metadata?: any;
|
|
1349
|
-
};
|
|
1350
|
-
}, "organization"> & {
|
|
1351
|
-
organizationName: string;
|
|
1352
|
-
})[], {
|
|
1353
|
-
code?: string | undefined;
|
|
1354
|
-
message?: string | undefined;
|
|
1355
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1356
|
-
};
|
|
1357
|
-
} & {
|
|
1358
|
-
organization: {
|
|
1359
|
-
listMembers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
1360
|
-
limit?: string | number | undefined;
|
|
1361
|
-
offset?: string | number | undefined;
|
|
1362
|
-
sortBy?: string | undefined;
|
|
1363
|
-
sortDirection?: "asc" | "desc" | undefined;
|
|
1364
|
-
filterField?: string | undefined;
|
|
1365
|
-
filterValue?: string | number | boolean | string[] | number[] | undefined;
|
|
1366
|
-
filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
1367
|
-
organizationId?: string | undefined;
|
|
1368
|
-
organizationSlug?: string | undefined;
|
|
1369
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1370
|
-
query?: {
|
|
1371
|
-
limit?: string | number | undefined;
|
|
1372
|
-
offset?: string | number | undefined;
|
|
1373
|
-
sortBy?: string | undefined;
|
|
1374
|
-
sortDirection?: "asc" | "desc" | undefined;
|
|
1375
|
-
filterField?: string | undefined;
|
|
1376
|
-
filterValue?: string | number | boolean | string[] | number[] | undefined;
|
|
1377
|
-
filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
1378
|
-
organizationId?: string | undefined;
|
|
1379
|
-
organizationSlug?: string | undefined;
|
|
1380
|
-
} | undefined;
|
|
1381
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1382
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1383
|
-
members: ({
|
|
1384
|
-
id: string;
|
|
1385
|
-
organizationId: string;
|
|
1386
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1387
|
-
createdAt: Date;
|
|
1388
|
-
userId: string;
|
|
1389
|
-
teamId?: string | undefined | undefined;
|
|
1390
|
-
user: {
|
|
1391
|
-
id: string;
|
|
1392
|
-
email: string;
|
|
1393
|
-
name: string;
|
|
1394
|
-
image?: string | undefined;
|
|
1395
|
-
};
|
|
1396
|
-
} & {
|
|
1397
|
-
user: {
|
|
1398
|
-
id: string;
|
|
1399
|
-
name: string;
|
|
1400
|
-
email: string;
|
|
1401
|
-
image: string | null | undefined;
|
|
1402
|
-
};
|
|
1403
|
-
})[];
|
|
1404
|
-
total: number;
|
|
1405
|
-
}, {
|
|
1406
|
-
code?: string | undefined;
|
|
1407
|
-
message?: string | undefined;
|
|
1408
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1409
|
-
};
|
|
1410
|
-
} & {
|
|
1411
|
-
organization: {
|
|
1412
|
-
getActiveMemberRole: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
1413
|
-
userId?: string | undefined;
|
|
1414
|
-
organizationId?: string | undefined;
|
|
1415
|
-
organizationSlug?: string | undefined;
|
|
1416
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1417
|
-
query?: {
|
|
1418
|
-
userId?: string | undefined;
|
|
1419
|
-
organizationId?: string | undefined;
|
|
1420
|
-
organizationSlug?: string | undefined;
|
|
1421
|
-
} | undefined;
|
|
1422
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1423
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1424
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1425
|
-
}, {
|
|
1426
|
-
code?: string | undefined;
|
|
1427
|
-
message?: string | undefined;
|
|
1428
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1429
|
-
};
|
|
1430
|
-
} & {
|
|
1431
|
-
organization: {
|
|
1432
|
-
hasPermission: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1433
|
-
permissions: {
|
|
1434
|
-
access?: string[] | undefined;
|
|
1435
|
-
organization?: ("update" | "delete")[] | undefined;
|
|
1436
|
-
member?: ("update" | "delete" | "create")[] | undefined;
|
|
1437
|
-
invitation?: ("create" | "cancel")[] | undefined;
|
|
1438
|
-
team?: ("update" | "delete" | "create")[] | undefined;
|
|
1439
|
-
ac?: ("update" | "delete" | "create" | "read")[] | undefined;
|
|
1440
|
-
};
|
|
1441
|
-
} & {
|
|
1442
|
-
organizationId?: string | undefined;
|
|
1443
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1444
|
-
permissions: {
|
|
1445
|
-
access?: string[] | undefined;
|
|
1446
|
-
organization?: ("update" | "delete")[] | undefined;
|
|
1447
|
-
member?: ("update" | "delete" | "create")[] | undefined;
|
|
1448
|
-
invitation?: ("create" | "cancel")[] | undefined;
|
|
1449
|
-
team?: ("update" | "delete" | "create")[] | undefined;
|
|
1450
|
-
ac?: ("update" | "delete" | "create" | "read")[] | undefined;
|
|
1451
|
-
};
|
|
1452
|
-
} & {
|
|
1453
|
-
organizationId?: string | undefined;
|
|
1454
|
-
} & {
|
|
1455
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1456
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1457
|
-
error: null;
|
|
1458
|
-
success: boolean;
|
|
1459
|
-
}, {
|
|
1460
|
-
code?: string | undefined;
|
|
1461
|
-
message?: string | undefined;
|
|
1462
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1463
|
-
};
|
|
1464
|
-
} & {
|
|
1465
|
-
organization: {
|
|
1466
|
-
createTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1467
|
-
name: string;
|
|
1468
|
-
organizationId?: string | undefined;
|
|
1469
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1470
|
-
name: string;
|
|
1471
|
-
organizationId?: string | undefined;
|
|
1472
|
-
} & {
|
|
1473
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1474
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1475
|
-
id: string;
|
|
1476
|
-
name: string;
|
|
1477
|
-
organizationId: string;
|
|
1478
|
-
createdAt: Date;
|
|
1479
|
-
updatedAt?: Date | undefined;
|
|
1480
|
-
}, {
|
|
1481
|
-
code?: string | undefined;
|
|
1482
|
-
message?: string | undefined;
|
|
1483
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1484
|
-
};
|
|
1485
|
-
} & {
|
|
1486
|
-
organization: {
|
|
1487
|
-
listTeams: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
1488
|
-
organizationId?: string | undefined;
|
|
1489
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1490
|
-
query?: {
|
|
1491
|
-
organizationId?: string | undefined;
|
|
1492
|
-
} | undefined;
|
|
1493
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1494
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1495
|
-
id: string;
|
|
1496
|
-
name: string;
|
|
1497
|
-
organizationId: string;
|
|
1498
|
-
createdAt: Date;
|
|
1499
|
-
updatedAt?: Date | undefined;
|
|
1500
|
-
}[], {
|
|
1501
|
-
code?: string | undefined;
|
|
1502
|
-
message?: string | undefined;
|
|
1503
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1504
|
-
};
|
|
1505
|
-
} & {
|
|
1506
|
-
organization: {
|
|
1507
|
-
removeTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1508
|
-
teamId: string;
|
|
1509
|
-
organizationId?: string | undefined;
|
|
1510
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1511
|
-
teamId: string;
|
|
1512
|
-
organizationId?: string | undefined;
|
|
1513
|
-
} & {
|
|
1514
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1515
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1516
|
-
message: string;
|
|
1517
|
-
}, {
|
|
1518
|
-
code?: string | undefined;
|
|
1519
|
-
message?: string | undefined;
|
|
1520
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1521
|
-
};
|
|
1522
|
-
} & {
|
|
1523
|
-
organization: {
|
|
1524
|
-
updateTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1525
|
-
teamId: string;
|
|
1526
|
-
data: Partial<{
|
|
1527
|
-
name: string;
|
|
1528
|
-
organizationId: string;
|
|
1529
|
-
}>;
|
|
1530
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1531
|
-
teamId: string;
|
|
1532
|
-
data: Partial<{
|
|
1533
|
-
name: string;
|
|
1534
|
-
organizationId: string;
|
|
1535
|
-
}>;
|
|
1536
|
-
} & {
|
|
1537
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1538
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1539
|
-
id: string;
|
|
1540
|
-
name: string;
|
|
1541
|
-
organizationId: string;
|
|
1542
|
-
createdAt: Date;
|
|
1543
|
-
updatedAt?: Date | undefined;
|
|
1544
|
-
}, {
|
|
1545
|
-
code?: string | undefined;
|
|
1546
|
-
message?: string | undefined;
|
|
1547
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1548
|
-
};
|
|
1549
|
-
} & {
|
|
1550
|
-
organization: {
|
|
1551
|
-
setActiveTeam: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1552
|
-
teamId?: string | null | undefined;
|
|
1553
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1554
|
-
teamId?: string | null | undefined;
|
|
1555
|
-
} & {
|
|
1556
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1557
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1558
|
-
id: string;
|
|
1559
|
-
name: string;
|
|
1560
|
-
organizationId: string;
|
|
1561
|
-
createdAt: Date;
|
|
1562
|
-
updatedAt?: Date | undefined;
|
|
1563
|
-
}, {
|
|
1564
|
-
code?: string | undefined;
|
|
1565
|
-
message?: string | undefined;
|
|
1566
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1567
|
-
};
|
|
1568
|
-
} & {
|
|
1569
|
-
organization: {
|
|
1570
|
-
listUserTeams: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1571
|
-
query?: Record<string, any> | undefined;
|
|
1572
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1573
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1574
|
-
id: string;
|
|
1575
|
-
name: string;
|
|
1576
|
-
organizationId: string;
|
|
1577
|
-
createdAt: Date;
|
|
1578
|
-
updatedAt?: Date | undefined;
|
|
1579
|
-
}[], {
|
|
1580
|
-
code?: string | undefined;
|
|
1581
|
-
message?: string | undefined;
|
|
1582
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1583
|
-
};
|
|
1584
|
-
} & {
|
|
1585
|
-
organization: {
|
|
1586
|
-
listTeamMembers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
1587
|
-
teamId?: string | undefined;
|
|
1588
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1589
|
-
query?: {
|
|
1590
|
-
teamId?: string | undefined;
|
|
1591
|
-
} | undefined;
|
|
1592
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1593
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1594
|
-
id: string;
|
|
1595
|
-
teamId: string;
|
|
1596
|
-
userId: string;
|
|
1597
|
-
createdAt: Date;
|
|
1598
|
-
}[], {
|
|
1599
|
-
code?: string | undefined;
|
|
1600
|
-
message?: string | undefined;
|
|
1601
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1602
|
-
};
|
|
1603
|
-
} & {
|
|
1604
|
-
organization: {
|
|
1605
|
-
addTeamMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1606
|
-
teamId: string;
|
|
1607
|
-
userId: unknown;
|
|
1608
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1609
|
-
teamId: string;
|
|
1610
|
-
userId: unknown;
|
|
1611
|
-
} & {
|
|
1612
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1613
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1614
|
-
id: string;
|
|
1615
|
-
teamId: string;
|
|
1616
|
-
userId: string;
|
|
1617
|
-
createdAt: Date;
|
|
1618
|
-
}, {
|
|
1619
|
-
code?: string | undefined;
|
|
1620
|
-
message?: string | undefined;
|
|
1621
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1622
|
-
};
|
|
1623
|
-
} & {
|
|
1624
|
-
organization: {
|
|
1625
|
-
removeTeamMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1626
|
-
teamId: string;
|
|
1627
|
-
userId: unknown;
|
|
1628
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1629
|
-
teamId: string;
|
|
1630
|
-
userId: unknown;
|
|
1631
|
-
} & {
|
|
1632
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1633
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1634
|
-
message: string;
|
|
1635
|
-
}, {
|
|
1636
|
-
code?: string | undefined;
|
|
1637
|
-
message?: string | undefined;
|
|
1638
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1639
|
-
};
|
|
1640
|
-
} & {
|
|
1641
|
-
sso: {
|
|
1642
|
-
saml2: {
|
|
1643
|
-
sp: {
|
|
1644
|
-
metadata: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
1645
|
-
providerId: string;
|
|
1646
|
-
format?: "json" | "xml" | undefined;
|
|
1647
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1648
|
-
query: {
|
|
1649
|
-
providerId: string;
|
|
1650
|
-
format?: "json" | "xml" | undefined;
|
|
1651
|
-
};
|
|
1652
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1653
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Response, {
|
|
1654
|
-
code?: string | undefined;
|
|
1655
|
-
message?: string | undefined;
|
|
1656
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1657
|
-
};
|
|
1658
|
-
};
|
|
1659
|
-
};
|
|
1660
|
-
} & {
|
|
1661
|
-
sso: {
|
|
1662
|
-
register: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1663
|
-
providerId: string;
|
|
1664
|
-
issuer: string;
|
|
1665
|
-
domain: string;
|
|
1666
|
-
oidcConfig?: {
|
|
1667
|
-
clientId: string;
|
|
1668
|
-
clientSecret: string;
|
|
1669
|
-
authorizationEndpoint?: string | undefined;
|
|
1670
|
-
tokenEndpoint?: string | undefined;
|
|
1671
|
-
userInfoEndpoint?: string | undefined;
|
|
1672
|
-
tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
|
|
1673
|
-
jwksEndpoint?: string | undefined;
|
|
1674
|
-
discoveryEndpoint?: string | undefined;
|
|
1675
|
-
skipDiscovery?: boolean | undefined;
|
|
1676
|
-
scopes?: string[] | undefined;
|
|
1677
|
-
pkce?: boolean | undefined;
|
|
1678
|
-
mapping?: {
|
|
1679
|
-
id: string;
|
|
1680
|
-
email: string;
|
|
1681
|
-
name: string;
|
|
1682
|
-
emailVerified?: string | undefined;
|
|
1683
|
-
image?: string | undefined;
|
|
1684
|
-
extraFields?: Record<string, any> | undefined;
|
|
1685
|
-
} | undefined;
|
|
1686
|
-
} | undefined;
|
|
1687
|
-
samlConfig?: {
|
|
1688
|
-
entryPoint: string;
|
|
1689
|
-
cert: string;
|
|
1690
|
-
callbackUrl: string;
|
|
1691
|
-
spMetadata: {
|
|
1692
|
-
metadata?: string | undefined;
|
|
1693
|
-
entityID?: string | undefined;
|
|
1694
|
-
binding?: string | undefined;
|
|
1695
|
-
privateKey?: string | undefined;
|
|
1696
|
-
privateKeyPass?: string | undefined;
|
|
1697
|
-
isAssertionEncrypted?: boolean | undefined;
|
|
1698
|
-
encPrivateKey?: string | undefined;
|
|
1699
|
-
encPrivateKeyPass?: string | undefined;
|
|
1700
|
-
};
|
|
1701
|
-
audience?: string | undefined;
|
|
1702
|
-
idpMetadata?: {
|
|
1703
|
-
metadata?: string | undefined;
|
|
1704
|
-
entityID?: string | undefined;
|
|
1705
|
-
cert?: string | undefined;
|
|
1706
|
-
privateKey?: string | undefined;
|
|
1707
|
-
privateKeyPass?: string | undefined;
|
|
1708
|
-
isAssertionEncrypted?: boolean | undefined;
|
|
1709
|
-
encPrivateKey?: string | undefined;
|
|
1710
|
-
encPrivateKeyPass?: string | undefined;
|
|
1711
|
-
singleSignOnService?: {
|
|
1712
|
-
Binding: string;
|
|
1713
|
-
Location: string;
|
|
1714
|
-
}[] | undefined;
|
|
1715
|
-
} | undefined;
|
|
1716
|
-
wantAssertionsSigned?: boolean | undefined;
|
|
1717
|
-
authnRequestsSigned?: boolean | undefined;
|
|
1718
|
-
signatureAlgorithm?: string | undefined;
|
|
1719
|
-
digestAlgorithm?: string | undefined;
|
|
1720
|
-
identifierFormat?: string | undefined;
|
|
1721
|
-
privateKey?: string | undefined;
|
|
1722
|
-
decryptionPvk?: string | undefined;
|
|
1723
|
-
additionalParams?: Record<string, any> | undefined;
|
|
1724
|
-
mapping?: {
|
|
1725
|
-
id: string;
|
|
1726
|
-
email: string;
|
|
1727
|
-
name: string;
|
|
1728
|
-
emailVerified?: string | undefined;
|
|
1729
|
-
firstName?: string | undefined;
|
|
1730
|
-
lastName?: string | undefined;
|
|
1731
|
-
extraFields?: Record<string, any> | undefined;
|
|
1732
|
-
} | undefined;
|
|
1733
|
-
} | undefined;
|
|
1734
|
-
organizationId?: string | undefined;
|
|
1735
|
-
overrideUserInfo?: boolean | undefined;
|
|
1736
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1737
|
-
providerId: string;
|
|
1738
|
-
issuer: string;
|
|
1739
|
-
domain: string;
|
|
1740
|
-
oidcConfig?: {
|
|
1741
|
-
clientId: string;
|
|
1742
|
-
clientSecret: string;
|
|
1743
|
-
authorizationEndpoint?: string | undefined;
|
|
1744
|
-
tokenEndpoint?: string | undefined;
|
|
1745
|
-
userInfoEndpoint?: string | undefined;
|
|
1746
|
-
tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
|
|
1747
|
-
jwksEndpoint?: string | undefined;
|
|
1748
|
-
discoveryEndpoint?: string | undefined;
|
|
1749
|
-
skipDiscovery?: boolean | undefined;
|
|
1750
|
-
scopes?: string[] | undefined;
|
|
1751
|
-
pkce?: boolean | undefined;
|
|
1752
|
-
mapping?: {
|
|
1753
|
-
id: string;
|
|
1754
|
-
email: string;
|
|
1755
|
-
name: string;
|
|
1756
|
-
emailVerified?: string | undefined;
|
|
1757
|
-
image?: string | undefined;
|
|
1758
|
-
extraFields?: Record<string, any> | undefined;
|
|
1759
|
-
} | undefined;
|
|
1760
|
-
} | undefined;
|
|
1761
|
-
samlConfig?: {
|
|
1762
|
-
entryPoint: string;
|
|
1763
|
-
cert: string;
|
|
1764
|
-
callbackUrl: string;
|
|
1765
|
-
spMetadata: {
|
|
1766
|
-
metadata?: string | undefined;
|
|
1767
|
-
entityID?: string | undefined;
|
|
1768
|
-
binding?: string | undefined;
|
|
1769
|
-
privateKey?: string | undefined;
|
|
1770
|
-
privateKeyPass?: string | undefined;
|
|
1771
|
-
isAssertionEncrypted?: boolean | undefined;
|
|
1772
|
-
encPrivateKey?: string | undefined;
|
|
1773
|
-
encPrivateKeyPass?: string | undefined;
|
|
1774
|
-
};
|
|
1775
|
-
audience?: string | undefined;
|
|
1776
|
-
idpMetadata?: {
|
|
1777
|
-
metadata?: string | undefined;
|
|
1778
|
-
entityID?: string | undefined;
|
|
1779
|
-
cert?: string | undefined;
|
|
1780
|
-
privateKey?: string | undefined;
|
|
1781
|
-
privateKeyPass?: string | undefined;
|
|
1782
|
-
isAssertionEncrypted?: boolean | undefined;
|
|
1783
|
-
encPrivateKey?: string | undefined;
|
|
1784
|
-
encPrivateKeyPass?: string | undefined;
|
|
1785
|
-
singleSignOnService?: {
|
|
1786
|
-
Binding: string;
|
|
1787
|
-
Location: string;
|
|
1788
|
-
}[] | undefined;
|
|
1789
|
-
} | undefined;
|
|
1790
|
-
wantAssertionsSigned?: boolean | undefined;
|
|
1791
|
-
authnRequestsSigned?: boolean | undefined;
|
|
1792
|
-
signatureAlgorithm?: string | undefined;
|
|
1793
|
-
digestAlgorithm?: string | undefined;
|
|
1794
|
-
identifierFormat?: string | undefined;
|
|
1795
|
-
privateKey?: string | undefined;
|
|
1796
|
-
decryptionPvk?: string | undefined;
|
|
1797
|
-
additionalParams?: Record<string, any> | undefined;
|
|
1798
|
-
mapping?: {
|
|
1799
|
-
id: string;
|
|
1800
|
-
email: string;
|
|
1801
|
-
name: string;
|
|
1802
|
-
emailVerified?: string | undefined;
|
|
1803
|
-
firstName?: string | undefined;
|
|
1804
|
-
lastName?: string | undefined;
|
|
1805
|
-
extraFields?: Record<string, any> | undefined;
|
|
1806
|
-
} | undefined;
|
|
1807
|
-
} | undefined;
|
|
1808
|
-
organizationId?: string | undefined;
|
|
1809
|
-
overrideUserInfo?: boolean | undefined;
|
|
1810
|
-
} & {
|
|
1811
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1812
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<NonNullable<{
|
|
1813
|
-
redirectURI: string;
|
|
1814
|
-
oidcConfig: _better_auth_sso.OIDCConfig | null;
|
|
1815
|
-
samlConfig: _better_auth_sso.SAMLConfig | null;
|
|
1816
|
-
} & Omit<{
|
|
1817
|
-
issuer: string;
|
|
1818
|
-
oidcConfig?: _better_auth_sso.OIDCConfig | undefined;
|
|
1819
|
-
samlConfig?: _better_auth_sso.SAMLConfig | undefined;
|
|
1820
|
-
userId: string;
|
|
1821
|
-
providerId: string;
|
|
1822
|
-
organizationId?: string | undefined;
|
|
1823
|
-
domain: string;
|
|
1824
|
-
}, "oidcConfig" | "samlConfig">>, {
|
|
1825
|
-
code?: string | undefined;
|
|
1826
|
-
message?: string | undefined;
|
|
1827
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1828
|
-
};
|
|
1829
|
-
} & {
|
|
1830
|
-
signIn: {
|
|
1831
|
-
sso: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1832
|
-
callbackURL: string;
|
|
1833
|
-
email?: string | undefined;
|
|
1834
|
-
organizationSlug?: string | undefined;
|
|
1835
|
-
providerId?: string | undefined;
|
|
1836
|
-
domain?: string | undefined;
|
|
1837
|
-
errorCallbackURL?: string | undefined;
|
|
1838
|
-
newUserCallbackURL?: string | undefined;
|
|
1839
|
-
scopes?: string[] | undefined;
|
|
1840
|
-
loginHint?: string | undefined;
|
|
1841
|
-
requestSignUp?: boolean | undefined;
|
|
1842
|
-
providerType?: "saml" | "oidc" | undefined;
|
|
1843
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1844
|
-
callbackURL: string;
|
|
1845
|
-
email?: string | undefined;
|
|
1846
|
-
organizationSlug?: string | undefined;
|
|
1847
|
-
providerId?: string | undefined;
|
|
1848
|
-
domain?: string | undefined;
|
|
1849
|
-
errorCallbackURL?: string | undefined;
|
|
1850
|
-
newUserCallbackURL?: string | undefined;
|
|
1851
|
-
scopes?: string[] | undefined;
|
|
1852
|
-
loginHint?: string | undefined;
|
|
1853
|
-
requestSignUp?: boolean | undefined;
|
|
1854
|
-
providerType?: "saml" | "oidc" | undefined;
|
|
1855
|
-
} & {
|
|
1856
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1857
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1858
|
-
url: string;
|
|
1859
|
-
redirect: boolean;
|
|
1860
|
-
}, {
|
|
1861
|
-
code?: string | undefined;
|
|
1862
|
-
message?: string | undefined;
|
|
1863
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1864
|
-
};
|
|
1865
|
-
} & {
|
|
1866
|
-
sso: {
|
|
1867
|
-
providers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
1868
|
-
query?: Record<string, any> | undefined;
|
|
1869
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1870
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1871
|
-
providers: {
|
|
1872
|
-
providerId: string;
|
|
1873
|
-
type: string;
|
|
1874
|
-
issuer: string;
|
|
1875
|
-
domain: string;
|
|
1876
|
-
organizationId: string | null;
|
|
1877
|
-
domainVerified: boolean;
|
|
1878
|
-
oidcConfig: {
|
|
1879
|
-
discoveryEndpoint: string;
|
|
1880
|
-
clientIdLastFour: string;
|
|
1881
|
-
pkce: boolean;
|
|
1882
|
-
authorizationEndpoint: string | undefined;
|
|
1883
|
-
tokenEndpoint: string | undefined;
|
|
1884
|
-
userInfoEndpoint: string | undefined;
|
|
1885
|
-
jwksEndpoint: string | undefined;
|
|
1886
|
-
scopes: string[] | undefined;
|
|
1887
|
-
tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
|
|
1888
|
-
} | undefined;
|
|
1889
|
-
samlConfig: {
|
|
1890
|
-
entryPoint: string;
|
|
1891
|
-
callbackUrl: string;
|
|
1892
|
-
audience: string | undefined;
|
|
1893
|
-
wantAssertionsSigned: boolean | undefined;
|
|
1894
|
-
authnRequestsSigned: boolean | undefined;
|
|
1895
|
-
identifierFormat: string | undefined;
|
|
1896
|
-
signatureAlgorithm: string | undefined;
|
|
1897
|
-
digestAlgorithm: string | undefined;
|
|
1898
|
-
certificate: {
|
|
1899
|
-
fingerprintSha256: string;
|
|
1900
|
-
notBefore: string;
|
|
1901
|
-
notAfter: string;
|
|
1902
|
-
publicKeyAlgorithm: string;
|
|
1903
|
-
} | {
|
|
1904
|
-
error: string;
|
|
1905
|
-
};
|
|
1906
|
-
} | undefined;
|
|
1907
|
-
spMetadataUrl: string;
|
|
1908
|
-
}[];
|
|
1909
|
-
}, {
|
|
1910
|
-
code?: string | undefined;
|
|
1911
|
-
message?: string | undefined;
|
|
1912
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1913
|
-
};
|
|
1914
|
-
} & {
|
|
1915
|
-
sso: {
|
|
1916
|
-
getProvider: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
1917
|
-
providerId: string;
|
|
1918
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1919
|
-
query: {
|
|
1920
|
-
providerId: string;
|
|
1921
|
-
};
|
|
1922
|
-
fetchOptions?: FetchOptions | undefined;
|
|
1923
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
1924
|
-
providerId: string;
|
|
1925
|
-
type: string;
|
|
1926
|
-
issuer: string;
|
|
1927
|
-
domain: string;
|
|
1928
|
-
organizationId: string | null;
|
|
1929
|
-
domainVerified: boolean;
|
|
1930
|
-
oidcConfig: {
|
|
1931
|
-
discoveryEndpoint: string;
|
|
1932
|
-
clientIdLastFour: string;
|
|
1933
|
-
pkce: boolean;
|
|
1934
|
-
authorizationEndpoint: string | undefined;
|
|
1935
|
-
tokenEndpoint: string | undefined;
|
|
1936
|
-
userInfoEndpoint: string | undefined;
|
|
1937
|
-
jwksEndpoint: string | undefined;
|
|
1938
|
-
scopes: string[] | undefined;
|
|
1939
|
-
tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
|
|
1940
|
-
} | undefined;
|
|
1941
|
-
samlConfig: {
|
|
1942
|
-
entryPoint: string;
|
|
1943
|
-
callbackUrl: string;
|
|
1944
|
-
audience: string | undefined;
|
|
1945
|
-
wantAssertionsSigned: boolean | undefined;
|
|
1946
|
-
authnRequestsSigned: boolean | undefined;
|
|
1947
|
-
identifierFormat: string | undefined;
|
|
1948
|
-
signatureAlgorithm: string | undefined;
|
|
1949
|
-
digestAlgorithm: string | undefined;
|
|
1950
|
-
certificate: {
|
|
1951
|
-
fingerprintSha256: string;
|
|
1952
|
-
notBefore: string;
|
|
1953
|
-
notAfter: string;
|
|
1954
|
-
publicKeyAlgorithm: string;
|
|
1955
|
-
} | {
|
|
1956
|
-
error: string;
|
|
1957
|
-
};
|
|
1958
|
-
} | undefined;
|
|
1959
|
-
spMetadataUrl: string;
|
|
1960
|
-
}, {
|
|
1961
|
-
code?: string | undefined;
|
|
1962
|
-
message?: string | undefined;
|
|
1963
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
1964
|
-
};
|
|
1965
|
-
} & {
|
|
1966
|
-
sso: {
|
|
1967
|
-
updateProvider: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
1968
|
-
providerId: string;
|
|
1969
|
-
issuer?: string | undefined;
|
|
1970
|
-
domain?: string | undefined;
|
|
1971
|
-
oidcConfig?: {
|
|
1972
|
-
clientId?: string | undefined;
|
|
1973
|
-
clientSecret?: string | undefined;
|
|
1974
|
-
authorizationEndpoint?: string | undefined;
|
|
1975
|
-
tokenEndpoint?: string | undefined;
|
|
1976
|
-
userInfoEndpoint?: string | undefined;
|
|
1977
|
-
tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
|
|
1978
|
-
jwksEndpoint?: string | undefined;
|
|
1979
|
-
discoveryEndpoint?: string | undefined;
|
|
1980
|
-
scopes?: string[] | undefined;
|
|
1981
|
-
pkce?: boolean | undefined;
|
|
1982
|
-
overrideUserInfo?: boolean | undefined;
|
|
1983
|
-
mapping?: {
|
|
1984
|
-
id?: string | undefined;
|
|
1985
|
-
email?: string | undefined;
|
|
1986
|
-
emailVerified?: string | undefined;
|
|
1987
|
-
name?: string | undefined;
|
|
1988
|
-
image?: string | undefined;
|
|
1989
|
-
extraFields?: Record<string, any> | undefined;
|
|
1990
|
-
} | undefined;
|
|
1991
|
-
} | undefined;
|
|
1992
|
-
samlConfig?: {
|
|
1993
|
-
entryPoint?: string | undefined;
|
|
1994
|
-
cert?: string | undefined;
|
|
1995
|
-
callbackUrl?: string | undefined;
|
|
1996
|
-
audience?: string | undefined;
|
|
1997
|
-
idpMetadata?: {
|
|
1998
|
-
metadata?: string | undefined;
|
|
1999
|
-
entityID?: string | undefined;
|
|
2000
|
-
cert?: string | undefined;
|
|
2001
|
-
privateKey?: string | undefined;
|
|
2002
|
-
privateKeyPass?: string | undefined;
|
|
2003
|
-
isAssertionEncrypted?: boolean | undefined;
|
|
2004
|
-
encPrivateKey?: string | undefined;
|
|
2005
|
-
encPrivateKeyPass?: string | undefined;
|
|
2006
|
-
singleSignOnService?: {
|
|
2007
|
-
Binding: string;
|
|
2008
|
-
Location: string;
|
|
2009
|
-
}[] | undefined;
|
|
2010
|
-
} | undefined;
|
|
2011
|
-
spMetadata?: {
|
|
2012
|
-
metadata?: string | undefined;
|
|
2013
|
-
entityID?: string | undefined;
|
|
2014
|
-
binding?: string | undefined;
|
|
2015
|
-
privateKey?: string | undefined;
|
|
2016
|
-
privateKeyPass?: string | undefined;
|
|
2017
|
-
isAssertionEncrypted?: boolean | undefined;
|
|
2018
|
-
encPrivateKey?: string | undefined;
|
|
2019
|
-
encPrivateKeyPass?: string | undefined;
|
|
2020
|
-
} | undefined;
|
|
2021
|
-
wantAssertionsSigned?: boolean | undefined;
|
|
2022
|
-
authnRequestsSigned?: boolean | undefined;
|
|
2023
|
-
signatureAlgorithm?: string | undefined;
|
|
2024
|
-
digestAlgorithm?: string | undefined;
|
|
2025
|
-
identifierFormat?: string | undefined;
|
|
2026
|
-
privateKey?: string | undefined;
|
|
2027
|
-
decryptionPvk?: string | undefined;
|
|
2028
|
-
additionalParams?: Record<string, any> | undefined;
|
|
2029
|
-
mapping?: {
|
|
2030
|
-
id?: string | undefined;
|
|
2031
|
-
email?: string | undefined;
|
|
2032
|
-
emailVerified?: string | undefined;
|
|
2033
|
-
name?: string | undefined;
|
|
2034
|
-
firstName?: string | undefined;
|
|
2035
|
-
lastName?: string | undefined;
|
|
2036
|
-
extraFields?: Record<string, any> | undefined;
|
|
2037
|
-
} | undefined;
|
|
2038
|
-
} | undefined;
|
|
2039
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2040
|
-
providerId: string;
|
|
2041
|
-
issuer?: string | undefined;
|
|
2042
|
-
domain?: string | undefined;
|
|
2043
|
-
oidcConfig?: {
|
|
2044
|
-
clientId?: string | undefined;
|
|
2045
|
-
clientSecret?: string | undefined;
|
|
2046
|
-
authorizationEndpoint?: string | undefined;
|
|
2047
|
-
tokenEndpoint?: string | undefined;
|
|
2048
|
-
userInfoEndpoint?: string | undefined;
|
|
2049
|
-
tokenEndpointAuthentication?: "client_secret_post" | "client_secret_basic" | undefined;
|
|
2050
|
-
jwksEndpoint?: string | undefined;
|
|
2051
|
-
discoveryEndpoint?: string | undefined;
|
|
2052
|
-
scopes?: string[] | undefined;
|
|
2053
|
-
pkce?: boolean | undefined;
|
|
2054
|
-
overrideUserInfo?: boolean | undefined;
|
|
2055
|
-
mapping?: {
|
|
2056
|
-
id?: string | undefined;
|
|
2057
|
-
email?: string | undefined;
|
|
2058
|
-
emailVerified?: string | undefined;
|
|
2059
|
-
name?: string | undefined;
|
|
2060
|
-
image?: string | undefined;
|
|
2061
|
-
extraFields?: Record<string, any> | undefined;
|
|
2062
|
-
} | undefined;
|
|
2063
|
-
} | undefined;
|
|
2064
|
-
samlConfig?: {
|
|
2065
|
-
entryPoint?: string | undefined;
|
|
2066
|
-
cert?: string | undefined;
|
|
2067
|
-
callbackUrl?: string | undefined;
|
|
2068
|
-
audience?: string | undefined;
|
|
2069
|
-
idpMetadata?: {
|
|
2070
|
-
metadata?: string | undefined;
|
|
2071
|
-
entityID?: string | undefined;
|
|
2072
|
-
cert?: string | undefined;
|
|
2073
|
-
privateKey?: string | undefined;
|
|
2074
|
-
privateKeyPass?: string | undefined;
|
|
2075
|
-
isAssertionEncrypted?: boolean | undefined;
|
|
2076
|
-
encPrivateKey?: string | undefined;
|
|
2077
|
-
encPrivateKeyPass?: string | undefined;
|
|
2078
|
-
singleSignOnService?: {
|
|
2079
|
-
Binding: string;
|
|
2080
|
-
Location: string;
|
|
2081
|
-
}[] | undefined;
|
|
2082
|
-
} | undefined;
|
|
2083
|
-
spMetadata?: {
|
|
2084
|
-
metadata?: string | undefined;
|
|
2085
|
-
entityID?: string | undefined;
|
|
2086
|
-
binding?: string | undefined;
|
|
2087
|
-
privateKey?: string | undefined;
|
|
2088
|
-
privateKeyPass?: string | undefined;
|
|
2089
|
-
isAssertionEncrypted?: boolean | undefined;
|
|
2090
|
-
encPrivateKey?: string | undefined;
|
|
2091
|
-
encPrivateKeyPass?: string | undefined;
|
|
2092
|
-
} | undefined;
|
|
2093
|
-
wantAssertionsSigned?: boolean | undefined;
|
|
2094
|
-
authnRequestsSigned?: boolean | undefined;
|
|
2095
|
-
signatureAlgorithm?: string | undefined;
|
|
2096
|
-
digestAlgorithm?: string | undefined;
|
|
2097
|
-
identifierFormat?: string | undefined;
|
|
2098
|
-
privateKey?: string | undefined;
|
|
2099
|
-
decryptionPvk?: string | undefined;
|
|
2100
|
-
additionalParams?: Record<string, any> | undefined;
|
|
2101
|
-
mapping?: {
|
|
2102
|
-
id?: string | undefined;
|
|
2103
|
-
email?: string | undefined;
|
|
2104
|
-
emailVerified?: string | undefined;
|
|
2105
|
-
name?: string | undefined;
|
|
2106
|
-
firstName?: string | undefined;
|
|
2107
|
-
lastName?: string | undefined;
|
|
2108
|
-
extraFields?: Record<string, any> | undefined;
|
|
2109
|
-
} | undefined;
|
|
2110
|
-
} | undefined;
|
|
2111
|
-
} & {
|
|
2112
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2113
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2114
|
-
providerId: string;
|
|
2115
|
-
type: string;
|
|
2116
|
-
issuer: string;
|
|
2117
|
-
domain: string;
|
|
2118
|
-
organizationId: string | null;
|
|
2119
|
-
domainVerified: boolean;
|
|
2120
|
-
oidcConfig: {
|
|
2121
|
-
discoveryEndpoint: string;
|
|
2122
|
-
clientIdLastFour: string;
|
|
2123
|
-
pkce: boolean;
|
|
2124
|
-
authorizationEndpoint: string | undefined;
|
|
2125
|
-
tokenEndpoint: string | undefined;
|
|
2126
|
-
userInfoEndpoint: string | undefined;
|
|
2127
|
-
jwksEndpoint: string | undefined;
|
|
2128
|
-
scopes: string[] | undefined;
|
|
2129
|
-
tokenEndpointAuthentication: "client_secret_post" | "client_secret_basic" | undefined;
|
|
2130
|
-
} | undefined;
|
|
2131
|
-
samlConfig: {
|
|
2132
|
-
entryPoint: string;
|
|
2133
|
-
callbackUrl: string;
|
|
2134
|
-
audience: string | undefined;
|
|
2135
|
-
wantAssertionsSigned: boolean | undefined;
|
|
2136
|
-
authnRequestsSigned: boolean | undefined;
|
|
2137
|
-
identifierFormat: string | undefined;
|
|
2138
|
-
signatureAlgorithm: string | undefined;
|
|
2139
|
-
digestAlgorithm: string | undefined;
|
|
2140
|
-
certificate: {
|
|
2141
|
-
fingerprintSha256: string;
|
|
2142
|
-
notBefore: string;
|
|
2143
|
-
notAfter: string;
|
|
2144
|
-
publicKeyAlgorithm: string;
|
|
2145
|
-
} | {
|
|
2146
|
-
error: string;
|
|
2147
|
-
};
|
|
2148
|
-
} | undefined;
|
|
2149
|
-
spMetadataUrl: string;
|
|
2150
|
-
}, {
|
|
2151
|
-
code?: string | undefined;
|
|
2152
|
-
message?: string | undefined;
|
|
2153
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2154
|
-
};
|
|
2155
|
-
} & {
|
|
2156
|
-
sso: {
|
|
2157
|
-
deleteProvider: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2158
|
-
providerId: string;
|
|
2159
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2160
|
-
providerId: string;
|
|
2161
|
-
} & {
|
|
2162
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2163
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2164
|
-
success: boolean;
|
|
2165
|
-
}, {
|
|
2166
|
-
code?: string | undefined;
|
|
2167
|
-
message?: string | undefined;
|
|
2168
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2169
|
-
};
|
|
2170
|
-
} & {
|
|
2171
|
-
twoFactor: {
|
|
2172
|
-
enable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2173
|
-
password: string;
|
|
2174
|
-
issuer?: string | undefined;
|
|
2175
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2176
|
-
password: string;
|
|
2177
|
-
issuer?: string | undefined;
|
|
2178
|
-
} & {
|
|
2179
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2180
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2181
|
-
totpURI: string;
|
|
2182
|
-
backupCodes: string[];
|
|
2183
|
-
}, {
|
|
2184
|
-
code?: string | undefined;
|
|
2185
|
-
message?: string | undefined;
|
|
2186
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2187
|
-
};
|
|
2188
|
-
} & {
|
|
2189
|
-
twoFactor: {
|
|
2190
|
-
disable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2191
|
-
password: string;
|
|
2192
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2193
|
-
password: string;
|
|
2194
|
-
} & {
|
|
2195
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2196
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2197
|
-
status: boolean;
|
|
2198
|
-
}, {
|
|
2199
|
-
code?: string | undefined;
|
|
2200
|
-
message?: string | undefined;
|
|
2201
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2202
|
-
};
|
|
2203
|
-
} & {
|
|
2204
|
-
twoFactor: {
|
|
2205
|
-
verifyBackupCode: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2206
|
-
code: string;
|
|
2207
|
-
disableSession?: boolean | undefined;
|
|
2208
|
-
trustDevice?: boolean | undefined;
|
|
2209
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2210
|
-
code: string;
|
|
2211
|
-
disableSession?: boolean | undefined;
|
|
2212
|
-
trustDevice?: boolean | undefined;
|
|
2213
|
-
} & {
|
|
2214
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2215
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Omit<{
|
|
2216
|
-
token: string | undefined;
|
|
2217
|
-
user: (Record<string, any> & {
|
|
2218
|
-
id: string;
|
|
2219
|
-
createdAt: Date;
|
|
2220
|
-
updatedAt: Date;
|
|
2221
|
-
email: string;
|
|
2222
|
-
emailVerified: boolean;
|
|
2223
|
-
name: string;
|
|
2224
|
-
image?: string | null | undefined;
|
|
2225
|
-
}) | better_auth_plugins.UserWithTwoFactor;
|
|
2226
|
-
}, "user"> & {
|
|
2227
|
-
user: better_auth.StripEmptyObjects<{
|
|
2228
|
-
id: string;
|
|
2229
|
-
createdAt: Date;
|
|
2230
|
-
updatedAt: Date;
|
|
2231
|
-
email: string;
|
|
2232
|
-
emailVerified: boolean;
|
|
2233
|
-
name: string;
|
|
2234
|
-
image?: string | null | undefined;
|
|
2235
|
-
} & {
|
|
2236
|
-
twoFactorEnabled: boolean | null | undefined;
|
|
2237
|
-
} & {} & {
|
|
2238
|
-
banned: boolean | null | undefined;
|
|
2239
|
-
} & {
|
|
2240
|
-
role?: string | null | undefined;
|
|
2241
|
-
banReason?: string | null | undefined;
|
|
2242
|
-
banExpires?: Date | null | undefined;
|
|
2243
|
-
} & {} & {
|
|
2244
|
-
lastActiveAt?: Date | null | undefined;
|
|
2245
|
-
}>;
|
|
2246
|
-
}, {
|
|
2247
|
-
code?: string | undefined;
|
|
2248
|
-
message?: string | undefined;
|
|
2249
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2250
|
-
};
|
|
2251
|
-
} & {
|
|
2252
|
-
twoFactor: {
|
|
2253
|
-
generateBackupCodes: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2254
|
-
password: string;
|
|
2255
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2256
|
-
password: string;
|
|
2257
|
-
} & {
|
|
2258
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2259
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2260
|
-
status: boolean;
|
|
2261
|
-
backupCodes: string[];
|
|
2262
|
-
}, {
|
|
2263
|
-
code?: string | undefined;
|
|
2264
|
-
message?: string | undefined;
|
|
2265
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2266
|
-
};
|
|
2267
|
-
} & {
|
|
2268
|
-
twoFactor: {
|
|
2269
|
-
sendOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2270
|
-
trustDevice?: boolean | undefined;
|
|
2271
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
2272
|
-
query?: Record<string, any> | undefined;
|
|
2273
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2274
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2275
|
-
status: boolean;
|
|
2276
|
-
}, {
|
|
2277
|
-
code?: string | undefined;
|
|
2278
|
-
message?: string | undefined;
|
|
2279
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2280
|
-
};
|
|
2281
|
-
} & {
|
|
2282
|
-
twoFactor: {
|
|
2283
|
-
verifyOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2284
|
-
code: string;
|
|
2285
|
-
trustDevice?: boolean | undefined;
|
|
2286
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2287
|
-
code: string;
|
|
2288
|
-
trustDevice?: boolean | undefined;
|
|
2289
|
-
} & {
|
|
2290
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2291
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
|
|
2292
|
-
token: string;
|
|
2293
|
-
user: better_auth_plugins.UserWithTwoFactor;
|
|
2294
|
-
}, "user"> & {
|
|
2295
|
-
user: better_auth.StripEmptyObjects<{
|
|
2296
|
-
id: string;
|
|
2297
|
-
createdAt: Date;
|
|
2298
|
-
updatedAt: Date;
|
|
2299
|
-
email: string;
|
|
2300
|
-
emailVerified: boolean;
|
|
2301
|
-
name: string;
|
|
2302
|
-
image?: string | null | undefined;
|
|
2303
|
-
} & {
|
|
2304
|
-
twoFactorEnabled: boolean | null | undefined;
|
|
2305
|
-
} & {} & {
|
|
2306
|
-
banned: boolean | null | undefined;
|
|
2307
|
-
} & {
|
|
2308
|
-
role?: string | null | undefined;
|
|
2309
|
-
banReason?: string | null | undefined;
|
|
2310
|
-
banExpires?: Date | null | undefined;
|
|
2311
|
-
} & {} & {
|
|
2312
|
-
lastActiveAt?: Date | null | undefined;
|
|
2313
|
-
}>;
|
|
2314
|
-
}) | (Omit<{
|
|
2315
|
-
token: string;
|
|
2316
|
-
user: Record<string, any> & {
|
|
2317
|
-
id: string;
|
|
2318
|
-
createdAt: Date;
|
|
2319
|
-
updatedAt: Date;
|
|
2320
|
-
email: string;
|
|
2321
|
-
emailVerified: boolean;
|
|
2322
|
-
name: string;
|
|
2323
|
-
image?: string | null | undefined;
|
|
2324
|
-
};
|
|
2325
|
-
}, "user"> & {
|
|
2326
|
-
user: better_auth.StripEmptyObjects<{
|
|
2327
|
-
id: string;
|
|
2328
|
-
createdAt: Date;
|
|
2329
|
-
updatedAt: Date;
|
|
2330
|
-
email: string;
|
|
2331
|
-
emailVerified: boolean;
|
|
2332
|
-
name: string;
|
|
2333
|
-
image?: string | null | undefined;
|
|
2334
|
-
} & {
|
|
2335
|
-
twoFactorEnabled: boolean | null | undefined;
|
|
2336
|
-
} & {} & {
|
|
2337
|
-
banned: boolean | null | undefined;
|
|
2338
|
-
} & {
|
|
2339
|
-
role?: string | null | undefined;
|
|
2340
|
-
banReason?: string | null | undefined;
|
|
2341
|
-
banExpires?: Date | null | undefined;
|
|
2342
|
-
} & {} & {
|
|
2343
|
-
lastActiveAt?: Date | null | undefined;
|
|
2344
|
-
}>;
|
|
2345
|
-
}), {
|
|
2346
|
-
code?: string | undefined;
|
|
2347
|
-
message?: string | undefined;
|
|
2348
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2349
|
-
};
|
|
2350
|
-
} & {
|
|
2351
|
-
twoFactor: {
|
|
2352
|
-
getTotpUri: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2353
|
-
password: string;
|
|
2354
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2355
|
-
password: string;
|
|
2356
|
-
} & {
|
|
2357
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2358
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2359
|
-
totpURI: string;
|
|
2360
|
-
}, {
|
|
2361
|
-
code?: string | undefined;
|
|
2362
|
-
message?: string | undefined;
|
|
2363
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2364
|
-
};
|
|
2365
|
-
} & {
|
|
2366
|
-
twoFactor: {
|
|
2367
|
-
verifyTotp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2368
|
-
code: string;
|
|
2369
|
-
trustDevice?: boolean | undefined;
|
|
2370
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2371
|
-
code: string;
|
|
2372
|
-
trustDevice?: boolean | undefined;
|
|
2373
|
-
} & {
|
|
2374
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2375
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
|
|
2376
|
-
token: string;
|
|
2377
|
-
user: better_auth_plugins.UserWithTwoFactor;
|
|
2378
|
-
}, "user"> & {
|
|
2379
|
-
user: better_auth.StripEmptyObjects<{
|
|
2380
|
-
id: string;
|
|
2381
|
-
createdAt: Date;
|
|
2382
|
-
updatedAt: Date;
|
|
2383
|
-
email: string;
|
|
2384
|
-
emailVerified: boolean;
|
|
2385
|
-
name: string;
|
|
2386
|
-
image?: string | null | undefined;
|
|
2387
|
-
} & {
|
|
2388
|
-
twoFactorEnabled: boolean | null | undefined;
|
|
2389
|
-
} & {} & {
|
|
2390
|
-
banned: boolean | null | undefined;
|
|
2391
|
-
} & {
|
|
2392
|
-
role?: string | null | undefined;
|
|
2393
|
-
banReason?: string | null | undefined;
|
|
2394
|
-
banExpires?: Date | null | undefined;
|
|
2395
|
-
} & {} & {
|
|
2396
|
-
lastActiveAt?: Date | null | undefined;
|
|
2397
|
-
}>;
|
|
2398
|
-
}) | (Omit<{
|
|
2399
|
-
token: string;
|
|
2400
|
-
user: Record<string, any> & {
|
|
2401
|
-
id: string;
|
|
2402
|
-
createdAt: Date;
|
|
2403
|
-
updatedAt: Date;
|
|
2404
|
-
email: string;
|
|
2405
|
-
emailVerified: boolean;
|
|
2406
|
-
name: string;
|
|
2407
|
-
image?: string | null | undefined;
|
|
2408
|
-
};
|
|
2409
|
-
}, "user"> & {
|
|
2410
|
-
user: better_auth.StripEmptyObjects<{
|
|
2411
|
-
id: string;
|
|
2412
|
-
createdAt: Date;
|
|
2413
|
-
updatedAt: Date;
|
|
2414
|
-
email: string;
|
|
2415
|
-
emailVerified: boolean;
|
|
2416
|
-
name: string;
|
|
2417
|
-
image?: string | null | undefined;
|
|
2418
|
-
} & {
|
|
2419
|
-
twoFactorEnabled: boolean | null | undefined;
|
|
2420
|
-
} & {} & {
|
|
2421
|
-
banned: boolean | null | undefined;
|
|
2422
|
-
} & {
|
|
2423
|
-
role?: string | null | undefined;
|
|
2424
|
-
banReason?: string | null | undefined;
|
|
2425
|
-
banExpires?: Date | null | undefined;
|
|
2426
|
-
} & {} & {
|
|
2427
|
-
lastActiveAt?: Date | null | undefined;
|
|
2428
|
-
}>;
|
|
2429
|
-
}), {
|
|
2430
|
-
code?: string | undefined;
|
|
2431
|
-
message?: string | undefined;
|
|
2432
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2433
|
-
};
|
|
2434
|
-
} & {
|
|
2435
|
-
token: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
2436
|
-
query?: Record<string, any> | undefined;
|
|
2437
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2438
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2439
|
-
token: string;
|
|
2440
|
-
}, {
|
|
2441
|
-
code?: string | undefined;
|
|
2442
|
-
message?: string | undefined;
|
|
2443
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2444
|
-
} & {
|
|
2445
|
-
apiKey: {
|
|
2446
|
-
create: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2447
|
-
configId?: string | undefined;
|
|
2448
|
-
name?: string | undefined;
|
|
2449
|
-
expiresIn?: number | null | undefined;
|
|
2450
|
-
prefix?: string | undefined;
|
|
2451
|
-
remaining?: number | null | undefined;
|
|
2452
|
-
metadata?: any;
|
|
2453
|
-
refillAmount?: number | undefined;
|
|
2454
|
-
refillInterval?: number | undefined;
|
|
2455
|
-
rateLimitTimeWindow?: number | undefined;
|
|
2456
|
-
rateLimitMax?: number | undefined;
|
|
2457
|
-
rateLimitEnabled?: boolean | undefined;
|
|
2458
|
-
permissions?: Record<string, string[]> | undefined;
|
|
2459
|
-
userId?: unknown;
|
|
2460
|
-
organizationId?: unknown;
|
|
2461
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
2462
|
-
configId?: string | undefined;
|
|
2463
|
-
name?: string | undefined;
|
|
2464
|
-
expiresIn?: number | null | undefined;
|
|
2465
|
-
prefix?: string | undefined;
|
|
2466
|
-
remaining?: number | null | undefined;
|
|
2467
|
-
metadata?: any;
|
|
2468
|
-
refillAmount?: number | undefined;
|
|
2469
|
-
refillInterval?: number | undefined;
|
|
2470
|
-
rateLimitTimeWindow?: number | undefined;
|
|
2471
|
-
rateLimitMax?: number | undefined;
|
|
2472
|
-
rateLimitEnabled?: boolean | undefined;
|
|
2473
|
-
permissions?: Record<string, string[]> | undefined;
|
|
2474
|
-
userId?: unknown;
|
|
2475
|
-
organizationId?: unknown;
|
|
2476
|
-
} & {
|
|
2477
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2478
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2479
|
-
key: string;
|
|
2480
|
-
metadata: any;
|
|
2481
|
-
permissions: any;
|
|
2482
|
-
id: string;
|
|
2483
|
-
configId: string;
|
|
2484
|
-
name: string | null;
|
|
2485
|
-
start: string | null;
|
|
2486
|
-
prefix: string | null;
|
|
2487
|
-
referenceId: string;
|
|
2488
|
-
refillInterval: number | null;
|
|
2489
|
-
refillAmount: number | null;
|
|
2490
|
-
lastRefillAt: Date | null;
|
|
2491
|
-
enabled: boolean;
|
|
2492
|
-
rateLimitEnabled: boolean;
|
|
2493
|
-
rateLimitTimeWindow: number | null;
|
|
2494
|
-
rateLimitMax: number | null;
|
|
2495
|
-
requestCount: number;
|
|
2496
|
-
remaining: number | null;
|
|
2497
|
-
lastRequest: Date | null;
|
|
2498
|
-
expiresAt: Date | null;
|
|
2499
|
-
createdAt: Date;
|
|
2500
|
-
updatedAt: Date;
|
|
2501
|
-
}, {
|
|
2502
|
-
code?: string | undefined;
|
|
2503
|
-
message?: string | undefined;
|
|
2504
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2505
|
-
};
|
|
2506
|
-
} & {
|
|
2507
|
-
apiKey: {
|
|
2508
|
-
get: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
2509
|
-
id: string;
|
|
2510
|
-
configId?: string | undefined;
|
|
2511
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2512
|
-
query: {
|
|
2513
|
-
id: string;
|
|
2514
|
-
configId?: string | undefined;
|
|
2515
|
-
};
|
|
2516
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2517
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2518
|
-
metadata: Record<string, any> | null;
|
|
2519
|
-
permissions: {
|
|
2520
|
-
[key: string]: string[];
|
|
2521
|
-
} | null;
|
|
2522
|
-
id: string;
|
|
2523
|
-
configId: string;
|
|
2524
|
-
name: string | null;
|
|
2525
|
-
start: string | null;
|
|
2526
|
-
prefix: string | null;
|
|
2527
|
-
referenceId: string;
|
|
2528
|
-
refillInterval: number | null;
|
|
2529
|
-
refillAmount: number | null;
|
|
2530
|
-
lastRefillAt: Date | null;
|
|
2531
|
-
enabled: boolean;
|
|
2532
|
-
rateLimitEnabled: boolean;
|
|
2533
|
-
rateLimitTimeWindow: number | null;
|
|
2534
|
-
rateLimitMax: number | null;
|
|
2535
|
-
requestCount: number;
|
|
2536
|
-
remaining: number | null;
|
|
2537
|
-
lastRequest: Date | null;
|
|
2538
|
-
expiresAt: Date | null;
|
|
2539
|
-
createdAt: Date;
|
|
2540
|
-
updatedAt: Date;
|
|
2541
|
-
}, {
|
|
2542
|
-
code?: string | undefined;
|
|
2543
|
-
message?: string | undefined;
|
|
2544
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2545
|
-
};
|
|
2546
|
-
} & {
|
|
2547
|
-
apiKey: {
|
|
2548
|
-
update: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2549
|
-
keyId: string;
|
|
2550
|
-
configId?: string | undefined;
|
|
2551
|
-
userId?: unknown;
|
|
2552
|
-
name?: string | undefined;
|
|
2553
|
-
enabled?: boolean | undefined;
|
|
2554
|
-
remaining?: number | undefined;
|
|
2555
|
-
refillAmount?: number | undefined;
|
|
2556
|
-
refillInterval?: number | undefined;
|
|
2557
|
-
metadata?: any;
|
|
2558
|
-
expiresIn?: number | null | undefined;
|
|
2559
|
-
rateLimitEnabled?: boolean | undefined;
|
|
2560
|
-
rateLimitTimeWindow?: number | undefined;
|
|
2561
|
-
rateLimitMax?: number | undefined;
|
|
2562
|
-
permissions?: Record<string, string[]> | null | undefined;
|
|
2563
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2564
|
-
keyId: string;
|
|
2565
|
-
configId?: string | undefined;
|
|
2566
|
-
userId?: unknown;
|
|
2567
|
-
name?: string | undefined;
|
|
2568
|
-
enabled?: boolean | undefined;
|
|
2569
|
-
remaining?: number | undefined;
|
|
2570
|
-
refillAmount?: number | undefined;
|
|
2571
|
-
refillInterval?: number | undefined;
|
|
2572
|
-
metadata?: any;
|
|
2573
|
-
expiresIn?: number | null | undefined;
|
|
2574
|
-
rateLimitEnabled?: boolean | undefined;
|
|
2575
|
-
rateLimitTimeWindow?: number | undefined;
|
|
2576
|
-
rateLimitMax?: number | undefined;
|
|
2577
|
-
permissions?: Record<string, string[]> | null | undefined;
|
|
2578
|
-
} & {
|
|
2579
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2580
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2581
|
-
metadata: Record<string, any> | null;
|
|
2582
|
-
permissions: {
|
|
2583
|
-
[key: string]: string[];
|
|
2584
|
-
} | null;
|
|
2585
|
-
id: string;
|
|
2586
|
-
configId: string;
|
|
2587
|
-
name: string | null;
|
|
2588
|
-
start: string | null;
|
|
2589
|
-
prefix: string | null;
|
|
2590
|
-
referenceId: string;
|
|
2591
|
-
refillInterval: number | null;
|
|
2592
|
-
refillAmount: number | null;
|
|
2593
|
-
lastRefillAt: Date | null;
|
|
2594
|
-
enabled: boolean;
|
|
2595
|
-
rateLimitEnabled: boolean;
|
|
2596
|
-
rateLimitTimeWindow: number | null;
|
|
2597
|
-
rateLimitMax: number | null;
|
|
2598
|
-
requestCount: number;
|
|
2599
|
-
remaining: number | null;
|
|
2600
|
-
lastRequest: Date | null;
|
|
2601
|
-
expiresAt: Date | null;
|
|
2602
|
-
createdAt: Date;
|
|
2603
|
-
updatedAt: Date;
|
|
2604
|
-
}, {
|
|
2605
|
-
code?: string | undefined;
|
|
2606
|
-
message?: string | undefined;
|
|
2607
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2608
|
-
};
|
|
2609
|
-
} & {
|
|
2610
|
-
apiKey: {
|
|
2611
|
-
delete: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2612
|
-
keyId: string;
|
|
2613
|
-
configId?: string | undefined;
|
|
2614
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2615
|
-
keyId: string;
|
|
2616
|
-
configId?: string | undefined;
|
|
2617
|
-
} & {
|
|
2618
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2619
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2620
|
-
success: boolean;
|
|
2621
|
-
}, {
|
|
2622
|
-
code?: string | undefined;
|
|
2623
|
-
message?: string | undefined;
|
|
2624
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2625
|
-
};
|
|
2626
|
-
} & {
|
|
2627
|
-
apiKey: {
|
|
2628
|
-
list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
2629
|
-
configId?: string | undefined;
|
|
2630
|
-
organizationId?: string | undefined;
|
|
2631
|
-
limit?: unknown;
|
|
2632
|
-
offset?: unknown;
|
|
2633
|
-
sortBy?: string | undefined;
|
|
2634
|
-
sortDirection?: "asc" | "desc" | undefined;
|
|
2635
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
2636
|
-
query?: {
|
|
2637
|
-
configId?: string | undefined;
|
|
2638
|
-
organizationId?: string | undefined;
|
|
2639
|
-
limit?: unknown;
|
|
2640
|
-
offset?: unknown;
|
|
2641
|
-
sortBy?: string | undefined;
|
|
2642
|
-
sortDirection?: "asc" | "desc" | undefined;
|
|
2643
|
-
} | undefined;
|
|
2644
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2645
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2646
|
-
apiKeys: {
|
|
2647
|
-
metadata: Record<string, any> | null;
|
|
2648
|
-
permissions: {
|
|
2649
|
-
[key: string]: string[];
|
|
2650
|
-
} | null;
|
|
2651
|
-
id: string;
|
|
2652
|
-
configId: string;
|
|
2653
|
-
name: string | null;
|
|
2654
|
-
start: string | null;
|
|
2655
|
-
prefix: string | null;
|
|
2656
|
-
referenceId: string;
|
|
2657
|
-
refillInterval: number | null;
|
|
2658
|
-
refillAmount: number | null;
|
|
2659
|
-
lastRefillAt: Date | null;
|
|
2660
|
-
enabled: boolean;
|
|
2661
|
-
rateLimitEnabled: boolean;
|
|
2662
|
-
rateLimitTimeWindow: number | null;
|
|
2663
|
-
rateLimitMax: number | null;
|
|
2664
|
-
requestCount: number;
|
|
2665
|
-
remaining: number | null;
|
|
2666
|
-
lastRequest: Date | null;
|
|
2667
|
-
expiresAt: Date | null;
|
|
2668
|
-
createdAt: Date;
|
|
2669
|
-
updatedAt: Date;
|
|
2670
|
-
}[];
|
|
2671
|
-
total: number;
|
|
2672
|
-
limit: number | undefined;
|
|
2673
|
-
offset: number | undefined;
|
|
2674
|
-
}, {
|
|
2675
|
-
code?: string | undefined;
|
|
2676
|
-
message?: string | undefined;
|
|
2677
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2678
|
-
};
|
|
2679
|
-
} & {
|
|
2680
|
-
admin: {
|
|
2681
|
-
setRole: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2682
|
-
userId: string;
|
|
2683
|
-
role: "admin" | "user" | ("admin" | "user")[];
|
|
2684
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2685
|
-
userId: string;
|
|
2686
|
-
role: "admin" | "user" | ("admin" | "user")[];
|
|
2687
|
-
} & {
|
|
2688
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2689
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2690
|
-
user: better_auth_plugins.UserWithRole;
|
|
2691
|
-
}, {
|
|
2692
|
-
code?: string | undefined;
|
|
2693
|
-
message?: string | undefined;
|
|
2694
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2695
|
-
};
|
|
2696
|
-
} & {
|
|
2697
|
-
admin: {
|
|
2698
|
-
getUser: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
2699
|
-
id: string;
|
|
2700
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2701
|
-
query: {
|
|
2702
|
-
id: string;
|
|
2703
|
-
};
|
|
2704
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2705
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<better_auth_plugins.UserWithRole, {
|
|
2706
|
-
code?: string | undefined;
|
|
2707
|
-
message?: string | undefined;
|
|
2708
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2709
|
-
};
|
|
2710
|
-
} & {
|
|
2711
|
-
admin: {
|
|
2712
|
-
createUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2713
|
-
email: string;
|
|
2714
|
-
password?: string | undefined;
|
|
2715
|
-
name: string;
|
|
2716
|
-
role?: "admin" | "user" | ("admin" | "user")[] | undefined;
|
|
2717
|
-
data?: Record<string, any> | undefined;
|
|
2718
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2719
|
-
email: string;
|
|
2720
|
-
password?: string | undefined;
|
|
2721
|
-
name: string;
|
|
2722
|
-
role?: "admin" | "user" | ("admin" | "user")[] | undefined;
|
|
2723
|
-
data?: Record<string, any> | undefined;
|
|
2724
|
-
} & {
|
|
2725
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2726
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2727
|
-
user: better_auth_plugins.UserWithRole;
|
|
2728
|
-
}, {
|
|
2729
|
-
code?: string | undefined;
|
|
2730
|
-
message?: string | undefined;
|
|
2731
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2732
|
-
};
|
|
2733
|
-
} & {
|
|
2734
|
-
admin: {
|
|
2735
|
-
updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2736
|
-
userId: unknown;
|
|
2737
|
-
data: Record<any, any>;
|
|
2738
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2739
|
-
userId: unknown;
|
|
2740
|
-
data: Record<any, any>;
|
|
2741
|
-
} & {
|
|
2742
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2743
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<better_auth_plugins.UserWithRole, {
|
|
2744
|
-
code?: string | undefined;
|
|
2745
|
-
message?: string | undefined;
|
|
2746
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2747
|
-
};
|
|
2748
|
-
} & {
|
|
2749
|
-
admin: {
|
|
2750
|
-
listUsers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
2751
|
-
searchValue?: string | undefined;
|
|
2752
|
-
searchField?: "name" | "email" | undefined;
|
|
2753
|
-
searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
|
|
2754
|
-
limit?: string | number | undefined;
|
|
2755
|
-
offset?: string | number | undefined;
|
|
2756
|
-
sortBy?: string | undefined;
|
|
2757
|
-
sortDirection?: "asc" | "desc" | undefined;
|
|
2758
|
-
filterField?: string | undefined;
|
|
2759
|
-
filterValue?: string | number | boolean | string[] | number[] | undefined;
|
|
2760
|
-
filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
2761
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2762
|
-
query: {
|
|
2763
|
-
searchValue?: string | undefined;
|
|
2764
|
-
searchField?: "name" | "email" | undefined;
|
|
2765
|
-
searchOperator?: "contains" | "starts_with" | "ends_with" | undefined;
|
|
2766
|
-
limit?: string | number | undefined;
|
|
2767
|
-
offset?: string | number | undefined;
|
|
2768
|
-
sortBy?: string | undefined;
|
|
2769
|
-
sortDirection?: "asc" | "desc" | undefined;
|
|
2770
|
-
filterField?: string | undefined;
|
|
2771
|
-
filterValue?: string | number | boolean | string[] | number[] | undefined;
|
|
2772
|
-
filterOperator?: "in" | "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
|
|
2773
|
-
};
|
|
2774
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2775
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2776
|
-
users: better_auth_plugins.UserWithRole[];
|
|
2777
|
-
total: number;
|
|
2778
|
-
}, {
|
|
2779
|
-
code?: string | undefined;
|
|
2780
|
-
message?: string | undefined;
|
|
2781
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2782
|
-
};
|
|
2783
|
-
} & {
|
|
2784
|
-
admin: {
|
|
2785
|
-
listUserSessions: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2786
|
-
userId: unknown;
|
|
2787
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2788
|
-
userId: unknown;
|
|
2789
|
-
} & {
|
|
2790
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2791
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2792
|
-
sessions: better_auth_plugins.SessionWithImpersonatedBy[];
|
|
2793
|
-
}, {
|
|
2794
|
-
code?: string | undefined;
|
|
2795
|
-
message?: string | undefined;
|
|
2796
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2797
|
-
};
|
|
2798
|
-
} & {
|
|
2799
|
-
admin: {
|
|
2800
|
-
unbanUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2801
|
-
userId: unknown;
|
|
2802
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2803
|
-
userId: unknown;
|
|
2804
|
-
} & {
|
|
2805
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2806
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2807
|
-
user: better_auth_plugins.UserWithRole;
|
|
2808
|
-
}, {
|
|
2809
|
-
code?: string | undefined;
|
|
2810
|
-
message?: string | undefined;
|
|
2811
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2812
|
-
};
|
|
2813
|
-
} & {
|
|
2814
|
-
admin: {
|
|
2815
|
-
banUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2816
|
-
userId: unknown;
|
|
2817
|
-
banReason?: string | undefined;
|
|
2818
|
-
banExpiresIn?: number | undefined;
|
|
2819
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2820
|
-
userId: unknown;
|
|
2821
|
-
banReason?: string | undefined;
|
|
2822
|
-
banExpiresIn?: number | undefined;
|
|
2823
|
-
} & {
|
|
2824
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2825
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2826
|
-
user: better_auth_plugins.UserWithRole;
|
|
2827
|
-
}, {
|
|
2828
|
-
code?: string | undefined;
|
|
2829
|
-
message?: string | undefined;
|
|
2830
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2831
|
-
};
|
|
2832
|
-
} & {
|
|
2833
|
-
admin: {
|
|
2834
|
-
impersonateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2835
|
-
userId: unknown;
|
|
2836
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2837
|
-
userId: unknown;
|
|
2838
|
-
} & {
|
|
2839
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2840
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2841
|
-
session: {
|
|
2842
|
-
id: string;
|
|
2843
|
-
createdAt: Date;
|
|
2844
|
-
updatedAt: Date;
|
|
2845
|
-
userId: string;
|
|
2846
|
-
expiresAt: Date;
|
|
2847
|
-
token: string;
|
|
2848
|
-
ipAddress?: string | null | undefined;
|
|
2849
|
-
userAgent?: string | null | undefined;
|
|
2850
|
-
};
|
|
2851
|
-
user: better_auth_plugins.UserWithRole;
|
|
2852
|
-
}, {
|
|
2853
|
-
code?: string | undefined;
|
|
2854
|
-
message?: string | undefined;
|
|
2855
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2856
|
-
};
|
|
2857
|
-
} & {
|
|
2858
|
-
admin: {
|
|
2859
|
-
stopImpersonating: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
|
|
2860
|
-
query?: Record<string, any> | undefined;
|
|
2861
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2862
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2863
|
-
session: {
|
|
2864
|
-
id: string;
|
|
2865
|
-
createdAt: Date;
|
|
2866
|
-
updatedAt: Date;
|
|
2867
|
-
userId: string;
|
|
2868
|
-
expiresAt: Date;
|
|
2869
|
-
token: string;
|
|
2870
|
-
ipAddress?: string | null | undefined;
|
|
2871
|
-
userAgent?: string | null | undefined;
|
|
2872
|
-
} & Record<string, any>;
|
|
2873
|
-
user: {
|
|
2874
|
-
id: string;
|
|
2875
|
-
createdAt: Date;
|
|
2876
|
-
updatedAt: Date;
|
|
2877
|
-
email: string;
|
|
2878
|
-
emailVerified: boolean;
|
|
2879
|
-
name: string;
|
|
2880
|
-
image?: string | null | undefined;
|
|
2881
|
-
} & Record<string, any>;
|
|
2882
|
-
}, {
|
|
2883
|
-
code?: string | undefined;
|
|
2884
|
-
message?: string | undefined;
|
|
2885
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2886
|
-
};
|
|
2887
|
-
} & {
|
|
2888
|
-
admin: {
|
|
2889
|
-
revokeUserSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2890
|
-
sessionToken: string;
|
|
2891
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2892
|
-
sessionToken: string;
|
|
2893
|
-
} & {
|
|
2894
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2895
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2896
|
-
success: boolean;
|
|
2897
|
-
}, {
|
|
2898
|
-
code?: string | undefined;
|
|
2899
|
-
message?: string | undefined;
|
|
2900
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2901
|
-
};
|
|
2902
|
-
} & {
|
|
2903
|
-
admin: {
|
|
2904
|
-
revokeUserSessions: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2905
|
-
userId: unknown;
|
|
2906
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2907
|
-
userId: unknown;
|
|
2908
|
-
} & {
|
|
2909
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2910
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2911
|
-
success: boolean;
|
|
2912
|
-
}, {
|
|
2913
|
-
code?: string | undefined;
|
|
2914
|
-
message?: string | undefined;
|
|
2915
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2916
|
-
};
|
|
2917
|
-
} & {
|
|
2918
|
-
admin: {
|
|
2919
|
-
removeUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2920
|
-
userId: unknown;
|
|
2921
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2922
|
-
userId: unknown;
|
|
2923
|
-
} & {
|
|
2924
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2925
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2926
|
-
success: boolean;
|
|
2927
|
-
}, {
|
|
2928
|
-
code?: string | undefined;
|
|
2929
|
-
message?: string | undefined;
|
|
2930
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2931
|
-
};
|
|
2932
|
-
} & {
|
|
2933
|
-
admin: {
|
|
2934
|
-
setUserPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2935
|
-
newPassword: string;
|
|
2936
|
-
userId: unknown;
|
|
2937
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2938
|
-
newPassword: string;
|
|
2939
|
-
userId: unknown;
|
|
2940
|
-
} & {
|
|
2941
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2942
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2943
|
-
status: boolean;
|
|
2944
|
-
}, {
|
|
2945
|
-
code?: string | undefined;
|
|
2946
|
-
message?: string | undefined;
|
|
2947
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2948
|
-
};
|
|
2949
|
-
} & {
|
|
2950
|
-
admin: {
|
|
2951
|
-
hasPermission: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2952
|
-
permissions: {
|
|
2953
|
-
readonly user?: ("update" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
|
|
2954
|
-
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
2955
|
-
};
|
|
2956
|
-
} & {
|
|
2957
|
-
userId?: string | undefined;
|
|
2958
|
-
role?: "admin" | "user" | undefined;
|
|
2959
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2960
|
-
permissions: {
|
|
2961
|
-
readonly user?: ("update" | "delete" | "create" | "list" | "set-role" | "ban" | "impersonate" | "impersonate-admins" | "set-password" | "get")[] | undefined;
|
|
2962
|
-
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
2963
|
-
};
|
|
2964
|
-
} & {
|
|
2965
|
-
userId?: string | undefined;
|
|
2966
|
-
role?: "admin" | "user" | undefined;
|
|
2967
|
-
} & {
|
|
2968
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2969
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2970
|
-
error: null;
|
|
2971
|
-
success: boolean;
|
|
2972
|
-
}, {
|
|
2973
|
-
code?: string | undefined;
|
|
2974
|
-
message?: string | undefined;
|
|
2975
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2976
|
-
};
|
|
2977
|
-
} & {
|
|
2978
|
-
emailOtp: {
|
|
2979
|
-
sendVerificationOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2980
|
-
email: string;
|
|
2981
|
-
type: "sign-in" | "change-email" | "email-verification" | "forget-password";
|
|
2982
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
2983
|
-
email: string;
|
|
2984
|
-
type: "sign-in" | "change-email" | "email-verification" | "forget-password";
|
|
2985
|
-
} & {
|
|
2986
|
-
fetchOptions?: FetchOptions | undefined;
|
|
2987
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
2988
|
-
success: boolean;
|
|
2989
|
-
}, {
|
|
2990
|
-
code?: string | undefined;
|
|
2991
|
-
message?: string | undefined;
|
|
2992
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
2993
|
-
};
|
|
2994
|
-
} & {
|
|
2995
|
-
emailOtp: {
|
|
2996
|
-
checkVerificationOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
2997
|
-
email: string;
|
|
2998
|
-
type: "sign-in" | "change-email" | "email-verification" | "forget-password";
|
|
2999
|
-
otp: string;
|
|
3000
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
3001
|
-
email: string;
|
|
3002
|
-
type: "sign-in" | "change-email" | "email-verification" | "forget-password";
|
|
3003
|
-
otp: string;
|
|
3004
|
-
} & {
|
|
3005
|
-
fetchOptions?: FetchOptions | undefined;
|
|
3006
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
3007
|
-
success: boolean;
|
|
3008
|
-
}, {
|
|
3009
|
-
code?: string | undefined;
|
|
3010
|
-
message?: string | undefined;
|
|
3011
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
3012
|
-
};
|
|
3013
|
-
} & {
|
|
3014
|
-
emailOtp: {
|
|
3015
|
-
verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
3016
|
-
email: string;
|
|
3017
|
-
otp: string;
|
|
3018
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
3019
|
-
email: string;
|
|
3020
|
-
otp: string;
|
|
3021
|
-
} & {
|
|
3022
|
-
fetchOptions?: FetchOptions | undefined;
|
|
3023
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<(Omit<{
|
|
3024
|
-
status: boolean;
|
|
3025
|
-
token: string;
|
|
3026
|
-
user: {
|
|
3027
|
-
id: string;
|
|
3028
|
-
createdAt: Date;
|
|
3029
|
-
updatedAt: Date;
|
|
3030
|
-
email: string;
|
|
3031
|
-
emailVerified: boolean;
|
|
3032
|
-
name: string;
|
|
3033
|
-
image?: string | null | undefined;
|
|
3034
|
-
} & Record<string, any>;
|
|
3035
|
-
}, "user"> & {
|
|
3036
|
-
user: better_auth.StripEmptyObjects<{
|
|
3037
|
-
id: string;
|
|
3038
|
-
createdAt: Date;
|
|
3039
|
-
updatedAt: Date;
|
|
3040
|
-
email: string;
|
|
3041
|
-
emailVerified: boolean;
|
|
3042
|
-
name: string;
|
|
3043
|
-
image?: string | null | undefined;
|
|
3044
|
-
} & {
|
|
3045
|
-
twoFactorEnabled: boolean | null | undefined;
|
|
3046
|
-
} & {} & {
|
|
3047
|
-
banned: boolean | null | undefined;
|
|
3048
|
-
} & {
|
|
3049
|
-
role?: string | null | undefined;
|
|
3050
|
-
banReason?: string | null | undefined;
|
|
3051
|
-
banExpires?: Date | null | undefined;
|
|
3052
|
-
} & {} & {
|
|
3053
|
-
lastActiveAt?: Date | null | undefined;
|
|
3054
|
-
}>;
|
|
3055
|
-
}) | (Omit<{
|
|
3056
|
-
status: boolean;
|
|
3057
|
-
token: null;
|
|
3058
|
-
user: {
|
|
3059
|
-
id: string;
|
|
3060
|
-
createdAt: Date;
|
|
3061
|
-
updatedAt: Date;
|
|
3062
|
-
email: string;
|
|
3063
|
-
emailVerified: boolean;
|
|
3064
|
-
name: string;
|
|
3065
|
-
image?: string | null | undefined;
|
|
3066
|
-
} & Record<string, any>;
|
|
3067
|
-
}, "user"> & {
|
|
3068
|
-
user: better_auth.StripEmptyObjects<{
|
|
3069
|
-
id: string;
|
|
3070
|
-
createdAt: Date;
|
|
3071
|
-
updatedAt: Date;
|
|
3072
|
-
email: string;
|
|
3073
|
-
emailVerified: boolean;
|
|
3074
|
-
name: string;
|
|
3075
|
-
image?: string | null | undefined;
|
|
3076
|
-
} & {
|
|
3077
|
-
twoFactorEnabled: boolean | null | undefined;
|
|
3078
|
-
} & {} & {
|
|
3079
|
-
banned: boolean | null | undefined;
|
|
3080
|
-
} & {
|
|
3081
|
-
role?: string | null | undefined;
|
|
3082
|
-
banReason?: string | null | undefined;
|
|
3083
|
-
banExpires?: Date | null | undefined;
|
|
3084
|
-
} & {} & {
|
|
3085
|
-
lastActiveAt?: Date | null | undefined;
|
|
3086
|
-
}>;
|
|
3087
|
-
}), {
|
|
3088
|
-
code?: string | undefined;
|
|
3089
|
-
message?: string | undefined;
|
|
3090
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
3091
|
-
};
|
|
3092
|
-
} & {
|
|
3093
|
-
signIn: {
|
|
3094
|
-
emailOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
3095
|
-
email: string;
|
|
3096
|
-
otp: string;
|
|
3097
|
-
name?: string | undefined;
|
|
3098
|
-
image?: string | undefined;
|
|
3099
|
-
} & Record<string, any>> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
3100
|
-
email: string;
|
|
3101
|
-
otp: string;
|
|
3102
|
-
name?: string | undefined;
|
|
3103
|
-
image?: string | undefined;
|
|
3104
|
-
} & Record<string, any> & {
|
|
3105
|
-
fetchOptions?: FetchOptions | undefined;
|
|
3106
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<Omit<{
|
|
3107
|
-
token: string;
|
|
714
|
+
declare class ApplicationSessionAssuranceError extends ApplicationError {
|
|
715
|
+
readonly payload: SessionAssuranceRequiredPayload | null;
|
|
716
|
+
readonly currentAssurance: SessionAssuranceRequiredPayload['currentAssurance'] | null;
|
|
717
|
+
readonly requiredAssurance: SessionAssuranceRequiredPayload['requiredAssurance'] | null;
|
|
718
|
+
readonly validStepUps: SessionAssuranceRequiredPayload['validStepUps'];
|
|
719
|
+
constructor(payload?: SessionAssuranceRequiredPayload | null, options?: ErrorOptions);
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Thrown when an operation requires an authenticated user but no session exists.
|
|
723
|
+
*/
|
|
724
|
+
declare class UserNotLoggedInError extends ApplicationError {
|
|
725
|
+
constructor(message: string, options?: ErrorOptions);
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* Thrown during device code polling when the user has not yet authorized the request.
|
|
729
|
+
*
|
|
730
|
+
* The client should continue polling at the specified interval.
|
|
731
|
+
*/
|
|
732
|
+
declare class DeviceAuthorizationPendingError extends ApplicationError {
|
|
733
|
+
constructor(options?: ErrorOptions);
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Thrown when the client is polling too frequently during the device flow.
|
|
737
|
+
*
|
|
738
|
+
* The client should increase its polling interval before retrying.
|
|
739
|
+
*/
|
|
740
|
+
declare class DeviceAuthorizationSlowDownError extends ApplicationError {
|
|
741
|
+
constructor(options?: ErrorOptions);
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Thrown when the user explicitly denies the device authorization request.
|
|
745
|
+
*/
|
|
746
|
+
declare class DeviceAccessDeniedError extends ApplicationError {
|
|
747
|
+
constructor(options?: ErrorOptions);
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Thrown when the device code has expired or has already been consumed.
|
|
751
|
+
*
|
|
752
|
+
* The client must start a new device authorization flow.
|
|
753
|
+
*/
|
|
754
|
+
declare class DeviceCodeExpiredError extends ApplicationError {
|
|
755
|
+
constructor(options?: ErrorOptions);
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Thrown when the authorization server returns a transient error during the device flow.
|
|
759
|
+
*
|
|
760
|
+
* The token exchange can be safely retried.
|
|
761
|
+
*/
|
|
762
|
+
declare class DeviceTransientServerError extends ApplicationError {
|
|
763
|
+
constructor(options?: ErrorOptions);
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Checks whether a session assurance value satisfies an application policy.
|
|
768
|
+
*/
|
|
769
|
+
declare function isSessionAssuranceSufficient(sessionAssurance: JWTPayload['assurance'] | null | undefined, config?: ApplicationConfig): boolean;
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Service for managing applications and their candidate organizations.
|
|
773
|
+
*
|
|
774
|
+
* Provides functionality for:
|
|
775
|
+
* - OAuth authorization code flow (PKCE)
|
|
776
|
+
* - Device authorization flow (RFC 8628)
|
|
777
|
+
* - Token management (refresh, exchange)
|
|
778
|
+
* - Organization switching
|
|
779
|
+
*/
|
|
780
|
+
declare class ApplicationService {
|
|
781
|
+
private client;
|
|
782
|
+
/**
|
|
783
|
+
* Creates a new ApplicationService instance.
|
|
784
|
+
*
|
|
785
|
+
* @param client - The API client for making application requests
|
|
786
|
+
*/
|
|
787
|
+
constructor(client: APIClient);
|
|
788
|
+
/**
|
|
789
|
+
* Gets public display context for an application auth redirect.
|
|
790
|
+
*
|
|
791
|
+
* @param applicationId - The application ID to get public auth context for
|
|
792
|
+
* @returns The minimal application identity safe to show before login
|
|
793
|
+
*/
|
|
794
|
+
getApplicationAuthContext(applicationId: string): Promise<ApplicationAuthContextResponse>;
|
|
795
|
+
/**
|
|
796
|
+
* Lists candidate organizations for a specific application.
|
|
797
|
+
*
|
|
798
|
+
* Returns organizations where the authenticated user is a member and
|
|
799
|
+
* the application has been enabled with appropriate entitlement rules.
|
|
800
|
+
*
|
|
801
|
+
* @param applicationId - The application ID to get candidate organizations for
|
|
802
|
+
* @returns The list of candidate organizations
|
|
803
|
+
*/
|
|
804
|
+
listCandidateOrganizations(applicationId: string): Promise<ListCandidateOrganizationsResponse>;
|
|
805
|
+
/**
|
|
806
|
+
* Starts an authorization flow for a specific application.
|
|
807
|
+
*
|
|
808
|
+
* @param applicationId - The application ID to start the authorization flow for
|
|
809
|
+
* @param redirectUri - The redirect URI to use for the authorization flow
|
|
810
|
+
* @param codeChallenge - The code challenge to use for the authorization flow
|
|
811
|
+
* @param organizationId - The organization ID to start the authorization flow for
|
|
812
|
+
*/
|
|
813
|
+
startAuthorizationFlow(applicationId: string, redirectUri: string, codeChallenge: string, organizationId: string): Promise<StartAuthorizationFlowResponse>;
|
|
814
|
+
/**
|
|
815
|
+
* Starts a device authorization flow (RFC 8628).
|
|
816
|
+
*
|
|
817
|
+
* Returns a device code and user code that the end user must enter
|
|
818
|
+
* on the verification URI to authorize the device.
|
|
819
|
+
*
|
|
820
|
+
* @param requesterApplicationId - The application requesting authorization
|
|
821
|
+
* @param targetApplicationId - The target application to gain access to
|
|
822
|
+
* @returns Device authorization details including codes and verification URI
|
|
823
|
+
*/
|
|
824
|
+
startDeviceAuthorizationFlow(requesterApplicationId: string, targetApplicationId: string): Promise<DeviceAuthorizationResponse>;
|
|
825
|
+
/**
|
|
826
|
+
* Retrieves the context for a pending device authorization request.
|
|
827
|
+
*
|
|
828
|
+
* Used by the authorization page to display details about the requesting
|
|
829
|
+
* and target applications before the user approves or denies.
|
|
830
|
+
*
|
|
831
|
+
* @param userCode - The user code from the device authorization response
|
|
832
|
+
* @returns Context including application info, available organizations, and status
|
|
833
|
+
*/
|
|
834
|
+
getDeviceAuthorizationContext(userCode: string): Promise<DeviceAuthorizationContextResponse>;
|
|
835
|
+
/**
|
|
836
|
+
* Approves a pending device authorization request.
|
|
837
|
+
*
|
|
838
|
+
* @param userCode - The user code identifying the device authorization request
|
|
839
|
+
* @param organizationId - The organization to authorize the device for
|
|
840
|
+
* @returns Confirmation of the approval action
|
|
841
|
+
*/
|
|
842
|
+
approveDeviceAuthorizationFlow(userCode: string, organizationId: string): Promise<DeviceAuthorizationActionResponse>;
|
|
843
|
+
/**
|
|
844
|
+
* Denies a pending device authorization request.
|
|
845
|
+
*
|
|
846
|
+
* @param userCode - The user code identifying the device authorization request
|
|
847
|
+
* @returns Confirmation of the denial action
|
|
848
|
+
*/
|
|
849
|
+
denyDeviceAuthorizationFlow(userCode: string): Promise<DeviceAuthorizationActionResponse>;
|
|
850
|
+
/**
|
|
851
|
+
* Exchanges a device code for access and refresh tokens.
|
|
852
|
+
*
|
|
853
|
+
* This should be called by the device client while polling. It will throw
|
|
854
|
+
* typed errors to indicate the polling state (pending, slow down, denied, expired).
|
|
855
|
+
*
|
|
856
|
+
* @param deviceCode - The device code obtained from {@link startDeviceAuthorizationFlow}
|
|
857
|
+
* @returns Access and refresh tokens along with user and organization info
|
|
858
|
+
*
|
|
859
|
+
* @throws {DeviceAuthorizationPendingError} The user hasn't authorized yet — keep polling
|
|
860
|
+
* @throws {DeviceAuthorizationSlowDownError} Polling too fast — increase the interval
|
|
861
|
+
* @throws {DeviceAccessDeniedError} The user denied the request
|
|
862
|
+
* @throws {DeviceCodeExpiredError} The device code has expired
|
|
863
|
+
* @throws {DeviceTransientServerError} Transient server error — safe to retry
|
|
864
|
+
* @throws {ApplicationSessionAssuranceError} Assurance policy changed or is no longer met — start a new flow
|
|
865
|
+
*/
|
|
866
|
+
exchangeDeviceCodeForTokens(deviceCode: string): Promise<CompleteAuthorizationFlowResponse>;
|
|
867
|
+
/**
|
|
868
|
+
* Completes an authorization flow for a specific application.
|
|
869
|
+
*
|
|
870
|
+
* @param code - The code to use for the authorization flow
|
|
871
|
+
* @param codeVerifier - The code verifier to use for the authorization flow
|
|
872
|
+
*/
|
|
873
|
+
completeAuthorizationFlow(code: string, codeVerifier: string): Promise<CompleteAuthorizationFlowResponse>;
|
|
874
|
+
/**
|
|
875
|
+
* Refreshes an authentication token for a specific application.
|
|
876
|
+
*
|
|
877
|
+
* @param refreshToken - The refresh token to use for the authentication token refresh
|
|
878
|
+
* @throws {RefreshTokenExpiredError} When the refresh token has expired or is invalid
|
|
879
|
+
* @throws {ApplicationError} For other API errors
|
|
880
|
+
*/
|
|
881
|
+
refreshAccessToken(refreshToken: string): Promise<CompleteAuthorizationFlowResponse | null>;
|
|
882
|
+
/**
|
|
883
|
+
* Gets the current user and organization for a specific application.
|
|
884
|
+
*
|
|
885
|
+
* By default, the returned organization does not include its `members`,
|
|
886
|
+
* `teams`, or `invitations` collections. Pass `options.include` to request
|
|
887
|
+
* any of them explicitly.
|
|
888
|
+
*
|
|
889
|
+
* @param accessToken - The access token to use for the who am I request
|
|
890
|
+
* @param options - Optional include list controlling which relations are loaded
|
|
891
|
+
* @returns The current user and organization
|
|
892
|
+
*/
|
|
893
|
+
whoAmI(accessToken: string, options?: WhoAmIOptions): Promise<WhoAmIResponse>;
|
|
894
|
+
/**
|
|
895
|
+
* Switches the active organization for the authenticated user.
|
|
896
|
+
*
|
|
897
|
+
* Issues new access and refresh tokens scoped to the specified organization.
|
|
898
|
+
* The target organization must be entitled to the application and the entitlement's
|
|
899
|
+
* access rules must allow the current user.
|
|
900
|
+
*
|
|
901
|
+
* @param organizationId - The ID of the organization to switch to
|
|
902
|
+
* @param accessToken - Optional access token for authentication (uses cookie if not provided)
|
|
903
|
+
* @returns New authentication tokens and user/organization details
|
|
904
|
+
*/
|
|
905
|
+
switchOrganization(organizationId: string, accessToken: string): Promise<CompleteAuthorizationFlowResponse>;
|
|
906
|
+
/**
|
|
907
|
+
* Logs out the user by invalidating their refresh token.
|
|
908
|
+
*
|
|
909
|
+
* Revokes the refresh token on the server, preventing further token refreshes
|
|
910
|
+
* and effectively ending the user's session.
|
|
911
|
+
*
|
|
912
|
+
* @param refreshToken - The refresh token to invalidate
|
|
913
|
+
*/
|
|
914
|
+
logout(refreshToken: string): Promise<void>;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
declare const ApiKeyMetadata: z.ZodObject<{
|
|
918
|
+
user: z.ZodObject<{
|
|
919
|
+
id: z.ZodString;
|
|
920
|
+
email: z.ZodString;
|
|
921
|
+
}, z.core.$strip>;
|
|
922
|
+
workspace: z.ZodObject<{
|
|
923
|
+
id: z.ZodString;
|
|
924
|
+
title: z.ZodString;
|
|
925
|
+
}, z.core.$strip>;
|
|
926
|
+
application: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
927
|
+
id: z.ZodString;
|
|
928
|
+
name: z.ZodString;
|
|
929
|
+
}, z.core.$strip>>>;
|
|
930
|
+
}, z.core.$strip>;
|
|
931
|
+
/**
|
|
932
|
+
* Metadata attached to an API key, identifying the owning user and workspace.
|
|
933
|
+
*/
|
|
934
|
+
type ApiKeyMetadata = z.infer<typeof ApiKeyMetadata> & Record<string, unknown>;
|
|
935
|
+
/**
|
|
936
|
+
* A full API key including the secret key value.
|
|
937
|
+
*
|
|
938
|
+
* The secret `key` field is only returned once at creation time.
|
|
939
|
+
*/
|
|
940
|
+
type ApiKey = Omit<ApiKey$1, 'metadata' | 'name'> & {
|
|
941
|
+
/** Display name of the API key. */
|
|
942
|
+
name: string;
|
|
943
|
+
/** Metadata identifying the key's owner and workspace. */
|
|
944
|
+
metadata: ApiKeyMetadata;
|
|
945
|
+
};
|
|
946
|
+
/**
|
|
947
|
+
* An API key with the secret key value omitted.
|
|
948
|
+
*
|
|
949
|
+
* Used in list and get operations where the secret should not be exposed.
|
|
950
|
+
*/
|
|
951
|
+
type ApiKeyWithoutSecret = Omit<ApiKey, 'key'>;
|
|
952
|
+
/**
|
|
953
|
+
* Payload for creating a new API key.
|
|
954
|
+
*/
|
|
955
|
+
type CreateApiKeyPayload = {
|
|
956
|
+
/** Display name for the API key. */
|
|
957
|
+
name: string;
|
|
958
|
+
/** Time in milliseconds until the key expires. Omit for a non-expiring key. */
|
|
959
|
+
expiresIn?: number;
|
|
960
|
+
/** Optional prefix prepended to the generated key for identification. */
|
|
961
|
+
prefix?: string;
|
|
962
|
+
/** Optional metadata to attach to the key. */
|
|
963
|
+
metadata?: ApiKeyMetadata;
|
|
964
|
+
};
|
|
965
|
+
/**
|
|
966
|
+
* Payload for updating an existing API key.
|
|
967
|
+
*/
|
|
968
|
+
type UpdateApiKeyPayload = {
|
|
969
|
+
/** The ID of the API key to update. */
|
|
970
|
+
id: string;
|
|
971
|
+
/** The new display name for the API key. */
|
|
972
|
+
name: string;
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Removes index signatures from a type
|
|
977
|
+
* @template T - The type to remove index signatures from
|
|
978
|
+
* @example
|
|
979
|
+
* ```typescript
|
|
980
|
+
* type MyType = {
|
|
981
|
+
* foo: string
|
|
982
|
+
* bar: number
|
|
983
|
+
* [key: string]: any
|
|
984
|
+
* }
|
|
985
|
+
*
|
|
986
|
+
* type StrictMyType = Strict<MyType> // { foo: string; bar: number; }
|
|
987
|
+
* ```
|
|
988
|
+
*/
|
|
989
|
+
type Strict<T> = {
|
|
990
|
+
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
|
991
|
+
};
|
|
992
|
+
/**
|
|
993
|
+
* Creates a configured Better Auth API client with all required plugins.
|
|
994
|
+
*
|
|
995
|
+
* @param apiUrl - The base URL of the authentication API
|
|
996
|
+
* @param fetchOptions - Custom fetch options to include in all API requests
|
|
997
|
+
* @returns A fully-configured Better Auth client instance
|
|
998
|
+
*
|
|
999
|
+
* @internal
|
|
1000
|
+
*/
|
|
1001
|
+
declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOption): {
|
|
1002
|
+
useActiveOrganization: better_auth_client.AuthQueryAtom<better_auth.Prettify<{
|
|
1003
|
+
id: string;
|
|
1004
|
+
name: string;
|
|
1005
|
+
slug: string;
|
|
1006
|
+
createdAt: Date;
|
|
1007
|
+
logo?: string | null | undefined | undefined;
|
|
1008
|
+
metadata?: any;
|
|
1009
|
+
} & {
|
|
1010
|
+
members: {
|
|
1011
|
+
id: string;
|
|
1012
|
+
organizationId: string;
|
|
1013
|
+
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1014
|
+
createdAt: Date;
|
|
1015
|
+
userId: string;
|
|
1016
|
+
teamId?: string | undefined | undefined;
|
|
3108
1017
|
user: {
|
|
3109
1018
|
id: string;
|
|
3110
|
-
createdAt: Date;
|
|
3111
|
-
updatedAt: Date;
|
|
3112
1019
|
email: string;
|
|
3113
|
-
emailVerified: boolean;
|
|
3114
1020
|
name: string;
|
|
3115
|
-
image?: string |
|
|
1021
|
+
image?: string | undefined;
|
|
3116
1022
|
};
|
|
3117
|
-
}
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
updatedAt: Date;
|
|
3122
|
-
email: string;
|
|
3123
|
-
emailVerified: boolean;
|
|
3124
|
-
name: string;
|
|
3125
|
-
image?: string | null | undefined;
|
|
3126
|
-
} & {
|
|
3127
|
-
twoFactorEnabled: boolean | null | undefined;
|
|
3128
|
-
} & {} & {
|
|
3129
|
-
banned: boolean | null | undefined;
|
|
3130
|
-
} & {
|
|
3131
|
-
role?: string | null | undefined;
|
|
3132
|
-
banReason?: string | null | undefined;
|
|
3133
|
-
banExpires?: Date | null | undefined;
|
|
3134
|
-
} & {} & {
|
|
3135
|
-
lastActiveAt?: Date | null | undefined;
|
|
3136
|
-
}>;
|
|
3137
|
-
}, {
|
|
3138
|
-
code?: string | undefined;
|
|
3139
|
-
message?: string | undefined;
|
|
3140
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
3141
|
-
};
|
|
3142
|
-
} & {
|
|
3143
|
-
emailOtp: {
|
|
3144
|
-
requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
3145
|
-
email: string;
|
|
3146
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
3147
|
-
email: string;
|
|
3148
|
-
} & {
|
|
3149
|
-
fetchOptions?: FetchOptions | undefined;
|
|
3150
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
3151
|
-
success: boolean;
|
|
3152
|
-
}, {
|
|
3153
|
-
code?: string | undefined;
|
|
3154
|
-
message?: string | undefined;
|
|
3155
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
3156
|
-
};
|
|
3157
|
-
} & {
|
|
3158
|
-
forgetPassword: {
|
|
3159
|
-
emailOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
3160
|
-
email: string;
|
|
3161
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
3162
|
-
email: string;
|
|
3163
|
-
} & {
|
|
3164
|
-
fetchOptions?: FetchOptions | undefined;
|
|
3165
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
3166
|
-
success: boolean;
|
|
3167
|
-
}, {
|
|
3168
|
-
code?: string | undefined;
|
|
3169
|
-
message?: string | undefined;
|
|
3170
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
3171
|
-
};
|
|
3172
|
-
} & {
|
|
3173
|
-
emailOtp: {
|
|
3174
|
-
resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
3175
|
-
email: string;
|
|
3176
|
-
otp: string;
|
|
3177
|
-
password: string;
|
|
3178
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
1023
|
+
}[];
|
|
1024
|
+
invitations: {
|
|
1025
|
+
id: string;
|
|
1026
|
+
organizationId: string;
|
|
3179
1027
|
email: string;
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
}
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
3207
|
-
};
|
|
3208
|
-
} & {
|
|
3209
|
-
emailOtp: {
|
|
3210
|
-
changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
3211
|
-
newEmail: string;
|
|
3212
|
-
otp: string;
|
|
3213
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
|
|
3214
|
-
newEmail: string;
|
|
3215
|
-
otp: string;
|
|
3216
|
-
} & {
|
|
3217
|
-
fetchOptions?: FetchOptions | undefined;
|
|
3218
|
-
}>, data_1?: FetchOptions | undefined) => Promise<better_auth_client.BetterFetchResponse<{
|
|
3219
|
-
success: boolean;
|
|
3220
|
-
}, {
|
|
3221
|
-
code?: string | undefined;
|
|
3222
|
-
message?: string | undefined;
|
|
3223
|
-
}, FetchOptions["throw"] extends true ? true : true>>;
|
|
3224
|
-
};
|
|
1028
|
+
role: "org:admin" | "org:member" | "org:reviewer";
|
|
1029
|
+
status: better_auth_plugins.InvitationStatus;
|
|
1030
|
+
inviterId: string;
|
|
1031
|
+
expiresAt: Date;
|
|
1032
|
+
createdAt: Date;
|
|
1033
|
+
teamId?: string | undefined | undefined;
|
|
1034
|
+
}[];
|
|
1035
|
+
}>>;
|
|
1036
|
+
useListOrganizations: better_auth_client.AuthQueryAtom<{
|
|
1037
|
+
id: string;
|
|
1038
|
+
name: string;
|
|
1039
|
+
slug: string;
|
|
1040
|
+
createdAt: Date;
|
|
1041
|
+
logo?: string | null | undefined | undefined;
|
|
1042
|
+
metadata?: any;
|
|
1043
|
+
}[]>;
|
|
1044
|
+
useActiveMember: better_auth_client.AuthQueryAtom<{
|
|
1045
|
+
id: string;
|
|
1046
|
+
organizationId: string;
|
|
1047
|
+
userId: string;
|
|
1048
|
+
role: string;
|
|
1049
|
+
createdAt: Date;
|
|
1050
|
+
}>;
|
|
1051
|
+
useActiveMemberRole: better_auth_client.AuthQueryAtom<{
|
|
1052
|
+
role: string;
|
|
1053
|
+
}>;
|
|
3225
1054
|
} & {
|
|
3226
1055
|
signIn: {
|
|
3227
1056
|
social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
@@ -4337,7 +2166,7 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
4337
2166
|
body?: any;
|
|
4338
2167
|
query?: any;
|
|
4339
2168
|
params?: any;
|
|
4340
|
-
duplex
|
|
2169
|
+
duplex? /** Number of hours to retain data before automatic cleanup. */: "full" | "half" | undefined;
|
|
4341
2170
|
jsonParser: (text: string) => Promise<any> | any;
|
|
4342
2171
|
retry?: better_auth_client.RetryOptions | undefined;
|
|
4343
2172
|
retryAttempt?: number | undefined;
|
|
@@ -5075,434 +2904,382 @@ type Invitation = Strict<APIClient['$Infer']['Invitation']>;
|
|
|
5075
2904
|
/** A member of an organization with role information. */
|
|
5076
2905
|
type Member = Strict<APIClient['$Infer']['Member']>;
|
|
5077
2906
|
/**
|
|
5078
|
-
* Custom settings that can be applied to an organization.
|
|
5079
|
-
*/
|
|
5080
|
-
type OrganizationSettings = {
|
|
5081
|
-
/** Whether file storage is disabled for this organization. */
|
|
5082
|
-
disableStorage?: boolean;
|
|
5083
|
-
/** Number of hours to retain data before automatic cleanup. */
|
|
5084
|
-
dataRetentionHours?: number;
|
|
5085
|
-
};
|
|
5086
|
-
/**
|
|
5087
|
-
* An organization with optional custom settings.
|
|
5088
|
-
*/
|
|
5089
|
-
type ExtendedOrganization = BaseOrganization & {
|
|
5090
|
-
settings?: OrganizationSettings;
|
|
5091
|
-
};
|
|
5092
|
-
/**
|
|
5093
|
-
* A complete organization object including its members, invitations, and teams.
|
|
5094
|
-
*/
|
|
5095
|
-
type FullOrganization = ExtendedOrganization & {
|
|
5096
|
-
members: Member[];
|
|
5097
|
-
invitations: Invitation[];
|
|
5098
|
-
teams: Team[];
|
|
5099
|
-
};
|
|
5100
|
-
/**
|
|
5101
|
-
* An organization as returned by the "who am I" endpoint, where related
|
|
5102
|
-
* collections (`members`, `teams`, `invitations`) are optional and only
|
|
5103
|
-
* populated when explicitly requested via the `include` query parameter.
|
|
5104
|
-
*/
|
|
5105
|
-
type WhoAmIOrganization = Omit<FullOrganization, 'members' | 'invitations' | 'teams'> & {
|
|
5106
|
-
members?: Member[];
|
|
5107
|
-
invitations?: Invitation[];
|
|
5108
|
-
teams?: Team[];
|
|
5109
|
-
};
|
|
5110
|
-
/**
|
|
5111
|
-
* A record linking a user to a team.
|
|
5112
|
-
*/
|
|
5113
|
-
type TeamMember = {
|
|
5114
|
-
/** Unique identifier for this team membership. */
|
|
5115
|
-
id: string;
|
|
5116
|
-
/** The team this membership belongs to. */
|
|
5117
|
-
teamId: string;
|
|
5118
|
-
/** The user who is a member of the team. */
|
|
5119
|
-
userId: string;
|
|
5120
|
-
/** When the user was added to the team. */
|
|
5121
|
-
createdAt: Date;
|
|
5122
|
-
};
|
|
5123
|
-
|
|
5124
|
-
declare const DEFAULT_SESSION_ASSURANCE_CONFIG: ApplicationSessionAssuranceConfig;
|
|
5125
|
-
declare const DEFAULT_APPLICATION_CONFIG: {
|
|
5126
|
-
version: 1;
|
|
5127
|
-
sessionAssurance: ApplicationSessionAssuranceConfig;
|
|
5128
|
-
};
|
|
5129
|
-
type ApplicationSessionAssuranceConfig = {
|
|
5130
|
-
acceptedAmr: AMR[];
|
|
5131
|
-
minAal: AAL;
|
|
5132
|
-
};
|
|
5133
|
-
declare const ApplicationSessionAssuranceConfig: z.ZodType<ApplicationSessionAssuranceConfig>;
|
|
5134
|
-
type ApplicationConfig = {
|
|
5135
|
-
version: 1;
|
|
5136
|
-
sessionAssurance: ApplicationSessionAssuranceConfig;
|
|
5137
|
-
};
|
|
5138
|
-
declare const ApplicationConfig: z.ZodType<ApplicationConfig>;
|
|
5139
|
-
/**
|
|
5140
|
-
* Keys of the organization's related collections that can be optionally
|
|
5141
|
-
* included in the "who am I" response.
|
|
5142
|
-
*/
|
|
5143
|
-
type WhoAmIInclude = 'members' | 'teams' | 'invitations';
|
|
5144
|
-
/**
|
|
5145
|
-
* Represents a registered OAuth application.
|
|
5146
|
-
*/
|
|
5147
|
-
type Application = {
|
|
5148
|
-
/** Unique application identifier. */
|
|
5149
|
-
id: string;
|
|
5150
|
-
/** Display name of the application. */
|
|
5151
|
-
name: string;
|
|
5152
|
-
/** Human-readable description of the application. */
|
|
5153
|
-
description: string;
|
|
5154
|
-
/** Allowed OAuth redirect URIs for this application. */
|
|
5155
|
-
redirectUris: string[];
|
|
5156
|
-
/** Additional configuration for this application. */
|
|
5157
|
-
config?: ApplicationConfig;
|
|
5158
|
-
};
|
|
5159
|
-
/**
|
|
5160
|
-
* Response returned when listing candidate organizations for an application.
|
|
5161
|
-
*/
|
|
5162
|
-
type ListCandidateOrganizationsResponse = FullOrganization[];
|
|
5163
|
-
/**
|
|
5164
|
-
* Public application context used to preserve continuity during auth redirects.
|
|
5165
|
-
*/
|
|
5166
|
-
type ApplicationAuthContextResponse = {
|
|
5167
|
-
/** Minimal application identity shown in the hosted auth flow. */
|
|
5168
|
-
application: Pick<Application, 'id' | 'name' | 'config'>;
|
|
5169
|
-
};
|
|
5170
|
-
/**
|
|
5171
|
-
* Response returned when starting an authorization flow.
|
|
5172
|
-
*/
|
|
5173
|
-
type StartAuthorizationFlowResponse = {
|
|
5174
|
-
/** The authorization code to exchange for tokens. */
|
|
5175
|
-
code: string;
|
|
5176
|
-
};
|
|
5177
|
-
/**
|
|
5178
|
-
* Response returned when completing an authorization flow or refreshing tokens.
|
|
5179
|
-
*/
|
|
5180
|
-
type CompleteAuthorizationFlowResponse = {
|
|
5181
|
-
/** Short-lived JWT access token. */
|
|
5182
|
-
accessToken: string;
|
|
5183
|
-
/** Long-lived refresh token for obtaining new access tokens. */
|
|
5184
|
-
refreshToken: string;
|
|
5185
|
-
/** The authenticated user. */
|
|
5186
|
-
user: User;
|
|
5187
|
-
/** The organization the tokens are scoped to. */
|
|
5188
|
-
organization: FullOrganization;
|
|
5189
|
-
/** Assurance context embedded in the issued access token. */
|
|
5190
|
-
assurance: JWTPayload['assurance'];
|
|
5191
|
-
};
|
|
5192
|
-
/**
|
|
5193
|
-
* Response returned by the "who am I" endpoint.
|
|
5194
|
-
*
|
|
5195
|
-
* By default, the `organization` only contains the base organization fields.
|
|
5196
|
-
* The `members`, `teams`, and `invitations` collections are only populated
|
|
5197
|
-
* when explicitly requested via the `include` query parameter.
|
|
5198
|
-
*/
|
|
5199
|
-
type WhoAmIResponse = {
|
|
5200
|
-
/** The authenticated user. */
|
|
5201
|
-
user: User;
|
|
5202
|
-
/** The user's active organization. */
|
|
5203
|
-
organization: WhoAmIOrganization;
|
|
5204
|
-
/** Assurance context embedded in the verified access token. */
|
|
5205
|
-
assurance: JWTPayload['assurance'];
|
|
5206
|
-
};
|
|
5207
|
-
/**
|
|
5208
|
-
* Options accepted by the "who am I" client method.
|
|
2907
|
+
* Custom settings that can be applied to an organization.
|
|
5209
2908
|
*/
|
|
5210
|
-
type
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
2909
|
+
type BillingMode = 'credits' | 'plan';
|
|
2910
|
+
type OrganizationSettings = {
|
|
2911
|
+
/** Whether file storage is disabled for this organization. */
|
|
2912
|
+
disableStorage?: boolean;
|
|
2913
|
+
/** Number of hours to retain data before automatic cleanup. */
|
|
2914
|
+
dataRetentionHours?: number;
|
|
2915
|
+
/** How the organization is billed for usage. */
|
|
2916
|
+
billing?: {
|
|
2917
|
+
mode: BillingMode;
|
|
2918
|
+
cvp?: number;
|
|
2919
|
+
limits?: {
|
|
2920
|
+
enabled: boolean;
|
|
2921
|
+
soft_usd?: number;
|
|
2922
|
+
hard_usd?: number;
|
|
2923
|
+
soft_credits?: number;
|
|
2924
|
+
hard_credits?: number;
|
|
2925
|
+
period: 'monthly';
|
|
2926
|
+
notify_emails?: string[];
|
|
2927
|
+
};
|
|
2928
|
+
};
|
|
5216
2929
|
};
|
|
5217
2930
|
/**
|
|
5218
|
-
*
|
|
2931
|
+
* An organization with optional custom settings.
|
|
5219
2932
|
*/
|
|
5220
|
-
type
|
|
5221
|
-
|
|
5222
|
-
device_code: string;
|
|
5223
|
-
/** The user-facing code to enter on the verification page. */
|
|
5224
|
-
user_code: string;
|
|
5225
|
-
/** The URI the user should visit to authorize the device. */
|
|
5226
|
-
verification_uri: string;
|
|
5227
|
-
/** A complete URI including the user code for convenience. */
|
|
5228
|
-
verification_uri_complete: string;
|
|
5229
|
-
/** Number of seconds until the device code expires. */
|
|
5230
|
-
expires_in: number;
|
|
5231
|
-
/** Minimum polling interval in seconds. */
|
|
5232
|
-
interval: number;
|
|
2933
|
+
type ExtendedOrganization = BaseOrganization & {
|
|
2934
|
+
settings?: OrganizationSettings;
|
|
5233
2935
|
};
|
|
5234
2936
|
/**
|
|
5235
|
-
*
|
|
5236
|
-
*
|
|
5237
|
-
* @internal
|
|
2937
|
+
* A complete organization object including its members, invitations, and teams.
|
|
5238
2938
|
*/
|
|
5239
|
-
type
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
name: string;
|
|
5244
|
-
/** Human-readable description, or `null` if not set. */
|
|
5245
|
-
description: string | null;
|
|
2939
|
+
type FullOrganization = ExtendedOrganization & {
|
|
2940
|
+
members: Member[];
|
|
2941
|
+
invitations: Invitation[];
|
|
2942
|
+
teams: Team[];
|
|
5246
2943
|
};
|
|
5247
2944
|
/**
|
|
5248
|
-
*
|
|
2945
|
+
* An organization as returned by the "who am I" endpoint, where related
|
|
2946
|
+
* collections (`members`, `teams`, `invitations`) are optional and only
|
|
2947
|
+
* populated when explicitly requested via the `include` query parameter.
|
|
5249
2948
|
*/
|
|
5250
|
-
type
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
};
|
|
5255
|
-
/** The target application the requester wants access to. */
|
|
5256
|
-
target: DeviceContextApplication;
|
|
5257
|
-
/** Organizations the user can authorize the device for. */
|
|
5258
|
-
organizations: FullOrganization[];
|
|
5259
|
-
/** Organization pre-selected by the requester, if any. */
|
|
5260
|
-
preselectedOrganizationId: string | null;
|
|
5261
|
-
/** Current status of the device authorization request. */
|
|
5262
|
-
status: 'pending' | 'approved' | 'denied';
|
|
5263
|
-
/** Seconds remaining before the device code expires. */
|
|
5264
|
-
expiresIn: number;
|
|
2949
|
+
type WhoAmIOrganization = Omit<FullOrganization, 'members' | 'invitations' | 'teams'> & {
|
|
2950
|
+
members?: Member[];
|
|
2951
|
+
invitations?: Invitation[];
|
|
2952
|
+
teams?: Team[];
|
|
5265
2953
|
};
|
|
5266
2954
|
/**
|
|
5267
|
-
*
|
|
2955
|
+
* A record linking a user to a team.
|
|
5268
2956
|
*/
|
|
5269
|
-
type
|
|
5270
|
-
/**
|
|
5271
|
-
|
|
2957
|
+
type TeamMember = {
|
|
2958
|
+
/** Unique identifier for this team membership. */
|
|
2959
|
+
id: string;
|
|
2960
|
+
/** The team this membership belongs to. */
|
|
2961
|
+
teamId: string;
|
|
2962
|
+
/** The user who is a member of the team. */
|
|
2963
|
+
userId: string;
|
|
2964
|
+
/** When the user was added to the team. */
|
|
2965
|
+
createdAt: Date;
|
|
5272
2966
|
};
|
|
5273
2967
|
|
|
5274
2968
|
/**
|
|
5275
|
-
*
|
|
5276
|
-
*
|
|
5277
|
-
* All application-specific errors extend this class, so you can catch
|
|
5278
|
-
* `ApplicationError` to handle any application-related failure.
|
|
2969
|
+
* Options accepted when listing users through the Better Auth admin plugin.
|
|
5279
2970
|
*/
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
2971
|
+
type ListAdminUsersOptions = {
|
|
2972
|
+
/** Maximum number of users to return. */
|
|
2973
|
+
limit?: number;
|
|
2974
|
+
/** Number of users to skip. */
|
|
2975
|
+
offset?: number;
|
|
2976
|
+
/** Free-text search value. */
|
|
2977
|
+
searchValue?: string;
|
|
2978
|
+
/** User field searched by Better Auth. Defaults to email. */
|
|
2979
|
+
searchField?: 'email' | 'name';
|
|
2980
|
+
/** Search comparison operator. Defaults to contains. */
|
|
2981
|
+
searchOperator?: 'contains' | 'starts_with' | 'ends_with';
|
|
2982
|
+
/** Field used to sort the listing. */
|
|
2983
|
+
sortBy?: string;
|
|
2984
|
+
/** Sort direction. */
|
|
2985
|
+
sortDirection?: 'asc' | 'desc';
|
|
2986
|
+
/** User field filtered by Better Auth. Defaults to email. */
|
|
2987
|
+
filterField?: string;
|
|
2988
|
+
/** Filter value. */
|
|
2989
|
+
filterValue?: string | number | boolean | string[] | number[];
|
|
2990
|
+
/** Filter comparison operator. Defaults to eq. */
|
|
2991
|
+
filterOperator?: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'not_in' | 'contains' | 'starts_with' | 'ends_with';
|
|
2992
|
+
};
|
|
5283
2993
|
/**
|
|
5284
|
-
*
|
|
5285
|
-
*
|
|
5286
|
-
* The client should discard its stored tokens and prompt the user
|
|
5287
|
-
* to re-authenticate.
|
|
2994
|
+
* Options accepted when listing all organizations as a global admin.
|
|
5288
2995
|
*/
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
2996
|
+
type ListAdminOrganizationsOptions = {
|
|
2997
|
+
/** Maximum number of organizations to return. Defaults to 50. */
|
|
2998
|
+
limit?: number;
|
|
2999
|
+
/** Number of organizations to skip. Defaults to 0. */
|
|
3000
|
+
offset?: number;
|
|
3001
|
+
/** Column used to order the listing. Defaults to creation date. */
|
|
3002
|
+
sortBy?: 'createdAt' | 'title';
|
|
3003
|
+
/** Order direction. Defaults to descending. */
|
|
3004
|
+
sortDirection?: 'asc' | 'desc';
|
|
3005
|
+
/** Free-text search matched against organization name, slug, and ID. */
|
|
3006
|
+
query?: string;
|
|
3007
|
+
/**
|
|
3008
|
+
* Number of member previews to include per organization (max 10).
|
|
3009
|
+
* When greater than 0, each row also includes the total member count.
|
|
3010
|
+
* Defaults to 0 (no members or member count returned).
|
|
3011
|
+
*/
|
|
3012
|
+
membersPreview?: number;
|
|
3013
|
+
/**
|
|
3014
|
+
* Number of application previews to include per organization (max 10).
|
|
3015
|
+
* When greater than 0, each row also includes the total application count.
|
|
3016
|
+
* Defaults to 0 (no applications or application count returned).
|
|
3017
|
+
*/
|
|
3018
|
+
applicationsPreview?: number;
|
|
3019
|
+
};
|
|
5292
3020
|
/**
|
|
5293
|
-
*
|
|
3021
|
+
* Options accepted when fetching a single organization as a global admin.
|
|
5294
3022
|
*/
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
3023
|
+
type GetAdminOrganizationOptions = {
|
|
3024
|
+
/** ID of the organization to fetch. */
|
|
3025
|
+
organizationId: string;
|
|
3026
|
+
/** Column the listing adjacency is computed against. Defaults to creation date. */
|
|
3027
|
+
sortBy?: 'createdAt' | 'title';
|
|
3028
|
+
/** Order direction the listing adjacency is computed against. Defaults to descending. */
|
|
3029
|
+
sortDirection?: 'asc' | 'desc';
|
|
3030
|
+
/**
|
|
3031
|
+
* When true, the organization includes adjacent IDs in the listing
|
|
3032
|
+
* defined by the ordering options.
|
|
3033
|
+
*/
|
|
3034
|
+
includeAdjacent?: boolean;
|
|
3035
|
+
};
|
|
5298
3036
|
/**
|
|
5299
|
-
*
|
|
5300
|
-
* application's assurance policy.
|
|
5301
|
-
*
|
|
5302
|
-
* During device-code token exchange this is a final error: the consumed flow
|
|
5303
|
-
* cannot be retried and the client must start a new device authorization flow.
|
|
3037
|
+
* Options accepted when listing members for a single organization as a global admin.
|
|
5304
3038
|
*/
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
3039
|
+
type ListAdminOrganizationMembersOptions = {
|
|
3040
|
+
/** ID of the organization whose members should be listed. */
|
|
3041
|
+
organizationId: string;
|
|
3042
|
+
/** Maximum number of members to return. Defaults to 50. */
|
|
3043
|
+
limit?: number;
|
|
3044
|
+
/** Number of members to skip. Defaults to 0. */
|
|
3045
|
+
offset?: number;
|
|
3046
|
+
};
|
|
5312
3047
|
/**
|
|
5313
|
-
*
|
|
3048
|
+
* Options accepted when creating an organization as a global admin.
|
|
5314
3049
|
*/
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
3050
|
+
type CreateAdminOrganizationOptions = {
|
|
3051
|
+
/** Optional organization ID. Generated by the API when omitted. */
|
|
3052
|
+
id?: string;
|
|
3053
|
+
/** Display name of the organization. */
|
|
3054
|
+
name: string;
|
|
3055
|
+
/** URL-friendly identifier. Generated from the name when omitted. */
|
|
3056
|
+
slug?: string;
|
|
3057
|
+
/** Logo URL. */
|
|
3058
|
+
logo?: string;
|
|
3059
|
+
/** Opaque metadata stored with the organization. */
|
|
3060
|
+
metadata?: string;
|
|
3061
|
+
/** Custom organization settings. */
|
|
3062
|
+
settings?: OrganizationSettings;
|
|
3063
|
+
};
|
|
5318
3064
|
/**
|
|
5319
|
-
*
|
|
5320
|
-
|
|
5321
|
-
|
|
3065
|
+
* Options accepted when updating an organization as a global admin.
|
|
3066
|
+
*/
|
|
3067
|
+
type UpdateAdminOrganizationOptions = {
|
|
3068
|
+
/** ID of the organization to update. */
|
|
3069
|
+
organizationId: string;
|
|
3070
|
+
/** Display name of the organization. */
|
|
3071
|
+
name?: string;
|
|
3072
|
+
/** URL-friendly identifier. */
|
|
3073
|
+
slug?: string;
|
|
3074
|
+
/** Logo URL. */
|
|
3075
|
+
logo?: string;
|
|
3076
|
+
/** Opaque metadata stored with the organization. */
|
|
3077
|
+
metadata?: string;
|
|
3078
|
+
/** Custom organization settings. Replaces the stored settings object. */
|
|
3079
|
+
settings?: OrganizationSettings;
|
|
3080
|
+
};
|
|
3081
|
+
/**
|
|
3082
|
+
* User row returned by the Better Auth admin user listing endpoint.
|
|
5322
3083
|
*/
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
3084
|
+
type AdminUser = {
|
|
3085
|
+
id: string;
|
|
3086
|
+
name: string;
|
|
3087
|
+
email: string;
|
|
3088
|
+
emailVerified: boolean;
|
|
3089
|
+
image: string | null;
|
|
3090
|
+
createdAt: string | Date;
|
|
3091
|
+
updatedAt: string | Date;
|
|
3092
|
+
role: string | null;
|
|
3093
|
+
banned: boolean | null;
|
|
3094
|
+
banReason: string | null;
|
|
3095
|
+
banExpires: string | Date | null;
|
|
3096
|
+
lastActiveAt?: string | Date | null;
|
|
3097
|
+
twoFactorEnabled?: boolean | null;
|
|
3098
|
+
};
|
|
5326
3099
|
/**
|
|
5327
|
-
*
|
|
5328
|
-
*
|
|
5329
|
-
* The client should increase its polling interval before retrying.
|
|
3100
|
+
* Paginated Better Auth admin user listing response.
|
|
5330
3101
|
*/
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
3102
|
+
type ListAdminUsersResult = {
|
|
3103
|
+
users: AdminUser[];
|
|
3104
|
+
total: number;
|
|
3105
|
+
limit?: number;
|
|
3106
|
+
offset?: number;
|
|
3107
|
+
};
|
|
5334
3108
|
/**
|
|
5335
|
-
*
|
|
3109
|
+
* Member preview returned alongside each admin organization row.
|
|
5336
3110
|
*/
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
3111
|
+
type AdminOrganizationMember = {
|
|
3112
|
+
id: string;
|
|
3113
|
+
name: string;
|
|
3114
|
+
email: string;
|
|
3115
|
+
image: string | null;
|
|
3116
|
+
};
|
|
5340
3117
|
/**
|
|
5341
|
-
*
|
|
5342
|
-
*
|
|
5343
|
-
* The client must start a new device authorization flow.
|
|
3118
|
+
* Full organization member row returned by the admin organization member listing endpoint.
|
|
5344
3119
|
*/
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
3120
|
+
type AdminOrganizationMemberRecord = AdminOrganizationMember & {
|
|
3121
|
+
memberId: string;
|
|
3122
|
+
organizationId: string;
|
|
3123
|
+
role: string;
|
|
3124
|
+
createdAt: string;
|
|
3125
|
+
};
|
|
5348
3126
|
/**
|
|
5349
|
-
*
|
|
5350
|
-
*
|
|
5351
|
-
* The token exchange can be safely retried.
|
|
3127
|
+
* Paginated organization member listing response.
|
|
5352
3128
|
*/
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
3129
|
+
type ListAdminOrganizationMembersResult = {
|
|
3130
|
+
members: AdminOrganizationMemberRecord[];
|
|
3131
|
+
total: number;
|
|
3132
|
+
limit: number;
|
|
3133
|
+
offset: number;
|
|
3134
|
+
};
|
|
5357
3135
|
/**
|
|
5358
|
-
*
|
|
3136
|
+
* Application preview returned alongside each admin organization row.
|
|
5359
3137
|
*/
|
|
5360
|
-
|
|
5361
|
-
|
|
3138
|
+
type AdminOrganizationApplication = {
|
|
3139
|
+
id: string;
|
|
3140
|
+
name: string;
|
|
3141
|
+
imageUrl: string | null;
|
|
3142
|
+
createdAt: string;
|
|
3143
|
+
};
|
|
5362
3144
|
/**
|
|
5363
|
-
*
|
|
5364
|
-
*
|
|
5365
|
-
* Provides functionality for:
|
|
5366
|
-
* - OAuth authorization code flow (PKCE)
|
|
5367
|
-
* - Device authorization flow (RFC 8628)
|
|
5368
|
-
* - Token management (refresh, exchange)
|
|
5369
|
-
* - Organization switching
|
|
3145
|
+
* Organization row returned by the admin organization listing endpoint.
|
|
5370
3146
|
*/
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
/**
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
*
|
|
5389
|
-
*
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
/**
|
|
5417
|
-
* Retrieves the context for a pending device authorization request.
|
|
5418
|
-
*
|
|
5419
|
-
* Used by the authorization page to display details about the requesting
|
|
5420
|
-
* and target applications before the user approves or denies.
|
|
5421
|
-
*
|
|
5422
|
-
* @param userCode - The user code from the device authorization response
|
|
5423
|
-
* @returns Context including application info, available organizations, and status
|
|
5424
|
-
*/
|
|
5425
|
-
getDeviceAuthorizationContext(userCode: string): Promise<DeviceAuthorizationContextResponse>;
|
|
3147
|
+
type AdminOrganization = {
|
|
3148
|
+
id: string;
|
|
3149
|
+
name: string;
|
|
3150
|
+
slug: string;
|
|
3151
|
+
logo: string | null;
|
|
3152
|
+
createdAt: string;
|
|
3153
|
+
metadata: string | null;
|
|
3154
|
+
settings: OrganizationSettings | null;
|
|
3155
|
+
/** Total number of active members. Present when requested via membersPreview. */
|
|
3156
|
+
memberCount?: number;
|
|
3157
|
+
/** Preview of the first members. Present when requested via membersPreview. */
|
|
3158
|
+
members?: AdminOrganizationMember[];
|
|
3159
|
+
/** Total number of enabled applications. Present when requested via applicationsPreview. */
|
|
3160
|
+
applicationCount?: number;
|
|
3161
|
+
/** Preview of the first enabled applications. Present when requested via applicationsPreview. */
|
|
3162
|
+
applications?: AdminOrganizationApplication[];
|
|
3163
|
+
/**
|
|
3164
|
+
* Adjacent organization IDs in the listing defined by the ordering options.
|
|
3165
|
+
* Present when requested via includeAdjacent.
|
|
3166
|
+
*/
|
|
3167
|
+
adjacent?: {
|
|
3168
|
+
previous: string | null;
|
|
3169
|
+
next: string | null;
|
|
3170
|
+
/** 1-based position in the listing. */
|
|
3171
|
+
index: number;
|
|
3172
|
+
total: number;
|
|
3173
|
+
};
|
|
3174
|
+
};
|
|
3175
|
+
/**
|
|
3176
|
+
* Paginated admin organization listing response.
|
|
3177
|
+
*/
|
|
3178
|
+
type ListAdminOrganizationsResult = {
|
|
3179
|
+
organizations: AdminOrganization[];
|
|
3180
|
+
total: number;
|
|
3181
|
+
limit: number;
|
|
3182
|
+
offset: number;
|
|
3183
|
+
};
|
|
3184
|
+
|
|
3185
|
+
/**
|
|
3186
|
+
* Service for global admin operations.
|
|
3187
|
+
*
|
|
3188
|
+
* All endpoints require the authenticated user to hold the global admin role.
|
|
3189
|
+
*/
|
|
3190
|
+
declare class AdminService {
|
|
3191
|
+
private client;
|
|
5426
3192
|
/**
|
|
5427
|
-
*
|
|
3193
|
+
* Creates a new AdminService instance.
|
|
5428
3194
|
*
|
|
5429
|
-
* @param
|
|
5430
|
-
* @param organizationId - The organization to authorize the device for
|
|
5431
|
-
* @returns Confirmation of the approval action
|
|
3195
|
+
* @param client - The API client for making admin requests
|
|
5432
3196
|
*/
|
|
5433
|
-
|
|
3197
|
+
constructor(client: APIClient);
|
|
5434
3198
|
/**
|
|
5435
|
-
*
|
|
3199
|
+
* Lists all organizations, optionally with member and application previews
|
|
3200
|
+
* and totals when a preview size is requested.
|
|
5436
3201
|
*
|
|
5437
|
-
* @param
|
|
5438
|
-
* @returns
|
|
3202
|
+
* @param options - Pagination, ordering, search, and preview options
|
|
3203
|
+
* @returns The paginated organization listing
|
|
5439
3204
|
*/
|
|
5440
|
-
|
|
3205
|
+
listOrganizations(options?: ListAdminOrganizationsOptions): Promise<{
|
|
3206
|
+
data: null;
|
|
3207
|
+
error: {
|
|
3208
|
+
message?: string | undefined;
|
|
3209
|
+
status: number;
|
|
3210
|
+
statusText: string;
|
|
3211
|
+
};
|
|
3212
|
+
} | {
|
|
3213
|
+
data: ListAdminOrganizationsResult;
|
|
3214
|
+
error: null;
|
|
3215
|
+
}>;
|
|
5441
3216
|
/**
|
|
5442
|
-
*
|
|
5443
|
-
*
|
|
5444
|
-
* This should be called by the device client while polling. It will throw
|
|
5445
|
-
* typed errors to indicate the polling state (pending, slow down, denied, expired).
|
|
3217
|
+
* Lists all Better Auth users from the user table.
|
|
5446
3218
|
*
|
|
5447
|
-
* @param
|
|
5448
|
-
* @returns
|
|
5449
|
-
*
|
|
5450
|
-
* @throws {DeviceAuthorizationPendingError} The user hasn't authorized yet — keep polling
|
|
5451
|
-
* @throws {DeviceAuthorizationSlowDownError} Polling too fast — increase the interval
|
|
5452
|
-
* @throws {DeviceAccessDeniedError} The user denied the request
|
|
5453
|
-
* @throws {DeviceCodeExpiredError} The device code has expired
|
|
5454
|
-
* @throws {DeviceTransientServerError} Transient server error — safe to retry
|
|
5455
|
-
* @throws {ApplicationSessionAssuranceError} Assurance policy changed or is no longer met — start a new flow
|
|
3219
|
+
* @param options - Pagination, search, filter, and ordering options
|
|
3220
|
+
* @returns The paginated user listing
|
|
5456
3221
|
*/
|
|
5457
|
-
|
|
3222
|
+
listUsers(options?: ListAdminUsersOptions): Promise<{
|
|
3223
|
+
data: null;
|
|
3224
|
+
error: {
|
|
3225
|
+
message?: string | undefined;
|
|
3226
|
+
status: number;
|
|
3227
|
+
statusText: string;
|
|
3228
|
+
};
|
|
3229
|
+
} | {
|
|
3230
|
+
data: ListAdminUsersResult;
|
|
3231
|
+
error: null;
|
|
3232
|
+
}>;
|
|
5458
3233
|
/**
|
|
5459
|
-
*
|
|
3234
|
+
* Fetches a single organization, optionally with adjacent IDs in
|
|
3235
|
+
* the listing defined by the ordering options.
|
|
5460
3236
|
*
|
|
5461
|
-
* @param
|
|
5462
|
-
* @
|
|
3237
|
+
* @param options - Organization ID and listing adjacency options
|
|
3238
|
+
* @returns The organization
|
|
5463
3239
|
*/
|
|
5464
|
-
|
|
3240
|
+
getOrganization(options: GetAdminOrganizationOptions): Promise<{
|
|
3241
|
+
data: AdminOrganization;
|
|
3242
|
+
} | null>;
|
|
5465
3243
|
/**
|
|
5466
|
-
*
|
|
3244
|
+
* Lists active members for one organization as a global admin.
|
|
5467
3245
|
*
|
|
5468
|
-
* @param
|
|
5469
|
-
* @
|
|
5470
|
-
* @throws {ApplicationError} For other API errors
|
|
3246
|
+
* @param options - Organization ID and pagination options
|
|
3247
|
+
* @returns The paginated organization member listing
|
|
5471
3248
|
*/
|
|
5472
|
-
|
|
3249
|
+
listOrganizationMembers(options: ListAdminOrganizationMembersOptions): Promise<{
|
|
3250
|
+
data: null;
|
|
3251
|
+
error: {
|
|
3252
|
+
message?: string | undefined;
|
|
3253
|
+
status: number;
|
|
3254
|
+
statusText: string;
|
|
3255
|
+
};
|
|
3256
|
+
} | {
|
|
3257
|
+
data: ListAdminOrganizationMembersResult;
|
|
3258
|
+
error: null;
|
|
3259
|
+
}>;
|
|
5473
3260
|
/**
|
|
5474
|
-
*
|
|
5475
|
-
*
|
|
5476
|
-
* By default, the returned organization does not include its `members`,
|
|
5477
|
-
* `teams`, or `invitations` collections. Pass `options.include` to request
|
|
5478
|
-
* any of them explicitly.
|
|
3261
|
+
* Creates an organization without adding the creator as a member.
|
|
5479
3262
|
*
|
|
5480
|
-
* @param
|
|
5481
|
-
* @
|
|
5482
|
-
* @returns The current user and organization
|
|
3263
|
+
* @param options - Organization name and optional slug, logo, metadata, and settings
|
|
3264
|
+
* @returns The created organization
|
|
5483
3265
|
*/
|
|
5484
|
-
|
|
3266
|
+
createOrganization(options: CreateAdminOrganizationOptions): Promise<{
|
|
3267
|
+
data: AdminOrganization;
|
|
3268
|
+
} | null>;
|
|
5485
3269
|
/**
|
|
5486
|
-
*
|
|
5487
|
-
*
|
|
5488
|
-
* Issues new access and refresh tokens scoped to the specified organization.
|
|
5489
|
-
* The target organization must be entitled to the application and the entitlement's
|
|
5490
|
-
* access rules must allow the current user.
|
|
3270
|
+
* Updates an organization's profile and settings.
|
|
5491
3271
|
*
|
|
5492
|
-
* @param
|
|
5493
|
-
* @
|
|
5494
|
-
* @returns New authentication tokens and user/organization details
|
|
3272
|
+
* @param options - Organization ID and the fields to update
|
|
3273
|
+
* @returns The updated organization
|
|
5495
3274
|
*/
|
|
5496
|
-
|
|
3275
|
+
updateOrganization(options: UpdateAdminOrganizationOptions): Promise<{
|
|
3276
|
+
data: AdminOrganization;
|
|
3277
|
+
} | null>;
|
|
5497
3278
|
/**
|
|
5498
|
-
*
|
|
5499
|
-
*
|
|
5500
|
-
* Revokes the refresh token on the server, preventing further token refreshes
|
|
5501
|
-
* and effectively ending the user's session.
|
|
5502
|
-
*
|
|
5503
|
-
* @param refreshToken - The refresh token to invalidate
|
|
3279
|
+
* Bans a user from the auth system and invalidates all their sessions.
|
|
3280
|
+
* @param userId - The ID of the user to ban
|
|
5504
3281
|
*/
|
|
5505
|
-
|
|
3282
|
+
banUser(userId: string): Promise<void>;
|
|
5506
3283
|
}
|
|
5507
3284
|
|
|
5508
3285
|
/**
|
|
@@ -5590,47 +3367,7 @@ declare class OrganizationService {
|
|
|
5590
3367
|
* @param id - The organization ID
|
|
5591
3368
|
* @returns The organization with members, invitations, and teams
|
|
5592
3369
|
*/
|
|
5593
|
-
getOrganization(id: string): Promise<
|
|
5594
|
-
members: {
|
|
5595
|
-
id: string;
|
|
5596
|
-
organizationId: string;
|
|
5597
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
5598
|
-
createdAt: Date;
|
|
5599
|
-
userId: string;
|
|
5600
|
-
teamId?: string | undefined | undefined;
|
|
5601
|
-
user: {
|
|
5602
|
-
id: string;
|
|
5603
|
-
email: string;
|
|
5604
|
-
name: string;
|
|
5605
|
-
image?: string | undefined;
|
|
5606
|
-
};
|
|
5607
|
-
}[];
|
|
5608
|
-
invitations: {
|
|
5609
|
-
id: string;
|
|
5610
|
-
organizationId: string;
|
|
5611
|
-
email: string;
|
|
5612
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
5613
|
-
status: better_auth_plugins.InvitationStatus;
|
|
5614
|
-
inviterId: string;
|
|
5615
|
-
expiresAt: Date;
|
|
5616
|
-
createdAt: Date;
|
|
5617
|
-
teamId?: string | undefined | undefined;
|
|
5618
|
-
}[];
|
|
5619
|
-
teams: {
|
|
5620
|
-
id: string;
|
|
5621
|
-
name: string;
|
|
5622
|
-
organizationId: string;
|
|
5623
|
-
createdAt: Date;
|
|
5624
|
-
updatedAt?: Date | undefined;
|
|
5625
|
-
}[];
|
|
5626
|
-
} & {
|
|
5627
|
-
id: string;
|
|
5628
|
-
name: string;
|
|
5629
|
-
slug: string;
|
|
5630
|
-
createdAt: Date;
|
|
5631
|
-
logo?: string | null | undefined | undefined;
|
|
5632
|
-
metadata?: any;
|
|
5633
|
-
}>;
|
|
3370
|
+
getOrganization(id: string): Promise<any>;
|
|
5634
3371
|
/**
|
|
5635
3372
|
* Lists all organizations accessible to the current user.
|
|
5636
3373
|
*
|
|
@@ -5658,63 +3395,13 @@ declare class OrganizationService {
|
|
|
5658
3395
|
* @param options.offset - Number of members to skip
|
|
5659
3396
|
* @returns An array of organization members
|
|
5660
3397
|
*/
|
|
5661
|
-
listMembers(options?: ListMembersOptions): Promise<
|
|
5662
|
-
id: string;
|
|
5663
|
-
organizationId: string;
|
|
5664
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
5665
|
-
createdAt: Date;
|
|
5666
|
-
userId: string;
|
|
5667
|
-
teamId?: string | undefined | undefined;
|
|
5668
|
-
user: {
|
|
5669
|
-
id: string;
|
|
5670
|
-
email: string;
|
|
5671
|
-
name: string;
|
|
5672
|
-
image?: string | undefined;
|
|
5673
|
-
};
|
|
5674
|
-
} & {
|
|
5675
|
-
user: {
|
|
5676
|
-
id: string;
|
|
5677
|
-
name: string;
|
|
5678
|
-
email: string;
|
|
5679
|
-
image: string | null | undefined;
|
|
5680
|
-
};
|
|
5681
|
-
})[]>;
|
|
3398
|
+
listMembers(options?: ListMembersOptions): Promise<any>;
|
|
5682
3399
|
/**
|
|
5683
3400
|
* Gets the currently active organization member for the authenticated user.
|
|
5684
3401
|
*
|
|
5685
3402
|
* @returns The active member object
|
|
5686
3403
|
*/
|
|
5687
|
-
getActiveMember(): Promise<
|
|
5688
|
-
id: string;
|
|
5689
|
-
organizationId: string;
|
|
5690
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
5691
|
-
createdAt: Date;
|
|
5692
|
-
userId: string;
|
|
5693
|
-
teamId?: string | undefined | undefined;
|
|
5694
|
-
user: {
|
|
5695
|
-
id: string;
|
|
5696
|
-
email: string;
|
|
5697
|
-
name: string;
|
|
5698
|
-
image?: string | undefined;
|
|
5699
|
-
};
|
|
5700
|
-
} & {
|
|
5701
|
-
user: {
|
|
5702
|
-
id: string;
|
|
5703
|
-
createdAt: Date;
|
|
5704
|
-
updatedAt: Date;
|
|
5705
|
-
email: string;
|
|
5706
|
-
emailVerified: boolean;
|
|
5707
|
-
name: string;
|
|
5708
|
-
image?: string | null | undefined;
|
|
5709
|
-
};
|
|
5710
|
-
}, "user"> & {
|
|
5711
|
-
user: {
|
|
5712
|
-
id: string;
|
|
5713
|
-
name: string;
|
|
5714
|
-
email: string;
|
|
5715
|
-
image: string | undefined;
|
|
5716
|
-
};
|
|
5717
|
-
}>>;
|
|
3404
|
+
getActiveMember(): Promise<any>;
|
|
5718
3405
|
/**
|
|
5719
3406
|
* Invites a user to join the active organization.
|
|
5720
3407
|
*
|
|
@@ -5728,27 +3415,7 @@ declare class OrganizationService {
|
|
|
5728
3415
|
* @param options.resend - Whether to resend if invitation already exists
|
|
5729
3416
|
* @returns The created invitation
|
|
5730
3417
|
*/
|
|
5731
|
-
inviteUserToOrganization({ userEmail, role, teamId, resend }: InviteUserToOrganizationOptions): Promise<
|
|
5732
|
-
id: string;
|
|
5733
|
-
organizationId: string;
|
|
5734
|
-
email: string;
|
|
5735
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
5736
|
-
status: better_auth_plugins.InvitationStatus;
|
|
5737
|
-
inviterId: string;
|
|
5738
|
-
expiresAt: Date;
|
|
5739
|
-
createdAt: Date;
|
|
5740
|
-
teamId?: string | undefined | undefined;
|
|
5741
|
-
} | {
|
|
5742
|
-
id: string;
|
|
5743
|
-
organizationId: string;
|
|
5744
|
-
email: string;
|
|
5745
|
-
role: "org:admin" | "org:member" | "org:reviewer";
|
|
5746
|
-
status: better_auth_plugins.InvitationStatus;
|
|
5747
|
-
inviterId: string;
|
|
5748
|
-
expiresAt: Date;
|
|
5749
|
-
createdAt: Date;
|
|
5750
|
-
teamId?: string | undefined | undefined;
|
|
5751
|
-
}>>;
|
|
3418
|
+
inviteUserToOrganization({ userEmail, role, teamId, resend }: InviteUserToOrganizationOptions): Promise<any>;
|
|
5752
3419
|
/**
|
|
5753
3420
|
* Cancels a pending organization invitation.
|
|
5754
3421
|
*
|
|
@@ -5785,13 +3452,7 @@ declare class OrganizationService {
|
|
|
5785
3452
|
* @param payload - Team configuration with a `name` field
|
|
5786
3453
|
* @returns The created team
|
|
5787
3454
|
*/
|
|
5788
|
-
createTeam(payload: CreateTeamPayload): Promise<
|
|
5789
|
-
id: string;
|
|
5790
|
-
name: string;
|
|
5791
|
-
organizationId: string;
|
|
5792
|
-
createdAt: Date;
|
|
5793
|
-
updatedAt?: Date | undefined;
|
|
5794
|
-
}>;
|
|
3455
|
+
createTeam(payload: CreateTeamPayload): Promise<any>;
|
|
5795
3456
|
/**
|
|
5796
3457
|
* Updates an existing team's details.
|
|
5797
3458
|
*
|
|
@@ -5799,13 +3460,7 @@ declare class OrganizationService {
|
|
|
5799
3460
|
* @param payload - Team fields to update (currently supports `name`)
|
|
5800
3461
|
* @returns The updated team
|
|
5801
3462
|
*/
|
|
5802
|
-
updateTeam(id: string, payload: UpdateTeamPayload): Promise<
|
|
5803
|
-
id: string;
|
|
5804
|
-
name: string;
|
|
5805
|
-
organizationId: string;
|
|
5806
|
-
createdAt: Date;
|
|
5807
|
-
updatedAt?: Date | undefined;
|
|
5808
|
-
}>;
|
|
3463
|
+
updateTeam(id: string, payload: UpdateTeamPayload): Promise<any>;
|
|
5809
3464
|
/**
|
|
5810
3465
|
* Deletes a team from the active organization.
|
|
5811
3466
|
*
|
|
@@ -5817,25 +3472,14 @@ declare class OrganizationService {
|
|
|
5817
3472
|
*
|
|
5818
3473
|
* @returns An array of teams
|
|
5819
3474
|
*/
|
|
5820
|
-
listTeams(): Promise<
|
|
5821
|
-
id: string;
|
|
5822
|
-
name: string;
|
|
5823
|
-
organizationId: string;
|
|
5824
|
-
createdAt: Date;
|
|
5825
|
-
updatedAt?: Date | undefined;
|
|
5826
|
-
}[]>;
|
|
3475
|
+
listTeams(): Promise<any>;
|
|
5827
3476
|
/**
|
|
5828
3477
|
* Lists all members of a specific team.
|
|
5829
3478
|
*
|
|
5830
3479
|
* @param id - The team ID
|
|
5831
3480
|
* @returns An array of team members
|
|
5832
3481
|
*/
|
|
5833
|
-
listTeamMembers(id: string): Promise<
|
|
5834
|
-
id: string;
|
|
5835
|
-
teamId: string;
|
|
5836
|
-
userId: string;
|
|
5837
|
-
createdAt: Date;
|
|
5838
|
-
}[]>;
|
|
3482
|
+
listTeamMembers(id: string): Promise<any>;
|
|
5839
3483
|
/**
|
|
5840
3484
|
* Adds a user to a team.
|
|
5841
3485
|
*
|
|
@@ -5843,12 +3487,7 @@ declare class OrganizationService {
|
|
|
5843
3487
|
* @param userId - The user ID to add
|
|
5844
3488
|
* @returns The added team member
|
|
5845
3489
|
*/
|
|
5846
|
-
addTeamMember(teamId: string, userId: string): Promise<
|
|
5847
|
-
id: string;
|
|
5848
|
-
teamId: string;
|
|
5849
|
-
userId: string;
|
|
5850
|
-
createdAt: Date;
|
|
5851
|
-
}>;
|
|
3490
|
+
addTeamMember(teamId: string, userId: string): Promise<any>;
|
|
5852
3491
|
/**
|
|
5853
3492
|
* Removes a user from a team.
|
|
5854
3493
|
*
|
|
@@ -5954,9 +3593,7 @@ declare class SessionService {
|
|
|
5954
3593
|
*
|
|
5955
3594
|
* @returns The JWT token
|
|
5956
3595
|
*/
|
|
5957
|
-
getToken(): Promise<
|
|
5958
|
-
token: string;
|
|
5959
|
-
}>;
|
|
3596
|
+
getToken(): Promise<any>;
|
|
5960
3597
|
/**
|
|
5961
3598
|
* Initiates social authentication flow with Google or Microsoft.
|
|
5962
3599
|
*
|
|
@@ -6016,9 +3653,7 @@ declare class SessionService {
|
|
|
6016
3653
|
* @param nonce - The nonce to retrieve the token for
|
|
6017
3654
|
* @returns The JWT token for the nonce
|
|
6018
3655
|
*/
|
|
6019
|
-
getNoncePayload(nonce: string): Promise<
|
|
6020
|
-
token: string;
|
|
6021
|
-
}>;
|
|
3656
|
+
getNoncePayload(nonce: string): Promise<any>;
|
|
6022
3657
|
}
|
|
6023
3658
|
|
|
6024
3659
|
/**
|
|
@@ -6081,9 +3716,7 @@ declare class ApiKeyService {
|
|
|
6081
3716
|
*
|
|
6082
3717
|
* @param id - The API key ID to delete
|
|
6083
3718
|
*/
|
|
6084
|
-
deleteApiKey(id: string): Promise<
|
|
6085
|
-
success: boolean;
|
|
6086
|
-
}>;
|
|
3719
|
+
deleteApiKey(id: string): Promise<any>;
|
|
6087
3720
|
}
|
|
6088
3721
|
|
|
6089
3722
|
/**
|
|
@@ -6127,9 +3760,7 @@ declare class EmailOTPService {
|
|
|
6127
3760
|
* @param options - Request configuration
|
|
6128
3761
|
* @returns The underlying email OTP API response
|
|
6129
3762
|
*/
|
|
6130
|
-
sendVerificationOTP(email: string, options: SendVerificationOTPOptions): Promise<
|
|
6131
|
-
success: boolean;
|
|
6132
|
-
}>;
|
|
3763
|
+
sendVerificationOTP(email: string, options: SendVerificationOTPOptions): Promise<any>;
|
|
6133
3764
|
/**
|
|
6134
3765
|
* Completes email OTP sign-in with a one-time passcode.
|
|
6135
3766
|
*
|
|
@@ -6138,38 +3769,7 @@ declare class EmailOTPService {
|
|
|
6138
3769
|
* @param options - Request configuration
|
|
6139
3770
|
* @returns The underlying email OTP sign-in API response
|
|
6140
3771
|
*/
|
|
6141
|
-
signIn(email: string, otp: string, options: EmailOTPSignInOptions): Promise<
|
|
6142
|
-
token: string;
|
|
6143
|
-
user: {
|
|
6144
|
-
id: string;
|
|
6145
|
-
createdAt: Date;
|
|
6146
|
-
updatedAt: Date;
|
|
6147
|
-
email: string;
|
|
6148
|
-
emailVerified: boolean;
|
|
6149
|
-
name: string;
|
|
6150
|
-
image?: string | null | undefined;
|
|
6151
|
-
};
|
|
6152
|
-
}, "user"> & {
|
|
6153
|
-
user: better_auth.StripEmptyObjects<{
|
|
6154
|
-
id: string;
|
|
6155
|
-
createdAt: Date;
|
|
6156
|
-
updatedAt: Date;
|
|
6157
|
-
email: string;
|
|
6158
|
-
emailVerified: boolean;
|
|
6159
|
-
name: string;
|
|
6160
|
-
image?: string | null | undefined;
|
|
6161
|
-
} & {
|
|
6162
|
-
twoFactorEnabled: boolean | null | undefined;
|
|
6163
|
-
} & {} & {
|
|
6164
|
-
banned: boolean | null | undefined;
|
|
6165
|
-
} & {
|
|
6166
|
-
role?: string | null | undefined;
|
|
6167
|
-
banReason?: string | null | undefined;
|
|
6168
|
-
banExpires?: Date | null | undefined;
|
|
6169
|
-
} & {} & {
|
|
6170
|
-
lastActiveAt?: Date | null | undefined;
|
|
6171
|
-
}>;
|
|
6172
|
-
}>;
|
|
3772
|
+
signIn(email: string, otp: string, options: EmailOTPSignInOptions): Promise<any>;
|
|
6173
3773
|
}
|
|
6174
3774
|
|
|
6175
3775
|
/**
|
|
@@ -6245,6 +3845,10 @@ declare class AuthClient {
|
|
|
6245
3845
|
* Session assurance service for step-up operations
|
|
6246
3846
|
*/
|
|
6247
3847
|
sessionAssurance: SessionAssuranceService;
|
|
3848
|
+
/**
|
|
3849
|
+
* Admin service for global admin operations
|
|
3850
|
+
*/
|
|
3851
|
+
admin: AdminService;
|
|
6248
3852
|
/**
|
|
6249
3853
|
* Creates a new AuthClient instance.
|
|
6250
3854
|
*
|
|
@@ -6319,4 +3923,4 @@ declare function validateToken(token: string, apiUrl: string): Promise<boolean>;
|
|
|
6319
3923
|
declare function extractTokenPayload(token: string): DecodedJWTPayload;
|
|
6320
3924
|
|
|
6321
3925
|
export { AAL, AALBrand, AALs, ACR, ACRBrand, ACRs, AMR, AMRBrand, AMRs, ApiKeyMetadata, ApplicationConfig, ApplicationError, ApplicationSessionAssuranceConfig, ApplicationSessionAssuranceError, AuthClient, AuthMethod, AuthMethodBrand, AuthMethods, AuthorizationFlowError, DEFAULT_APPLICATION_CONFIG, DEFAULT_JWT_ASSURANCE, DEFAULT_SESSION_ASSURANCE_CONFIG, DeviceAccessDeniedError, DeviceAuthorizationPendingError, DeviceAuthorizationSlowDownError, DeviceCodeExpiredError, DeviceTransientServerError, EmailOTPService, EmailRequired, InvalidCallbackURL, InvalidSocialProvider, JWTPayload, JWTPayloadAssurance, JWTPayloadUser, JWTPayloadWorkspace, OAuthBeginStepUpResponse, OAuthCompleteStepUpResponse, OAuthStepUpProvider, RefreshTokenExpiredError, Roles, SENSITIVE_ACTION_ASSURANCE_POLICY, SendOtpResponse, SessionAssurancePolicy, SessionAssuranceRequiredError, SessionAssuranceRequiredPayload, SessionAssuranceResponse, SessionAssuranceService, StepUpOption, UserNotLoggedInError, ac, assuranceFields, canStepUpWithAmr, createAPIClient, extractTokenPayload, getAalRank, invitationAdditionalFields, isAssuranceSufficientForPolicy, isSessionAssuranceSufficient, isTokenExpired, memberAdditionalFields, mergeStepUpAssurance, organizationAdditionalFields, parseSessionAssuranceRequiredPayload, rolesAccessControl, sessionAssurancePluginClient, userAdditionalFields, validateToken };
|
|
6322
|
-
export type { APIClient, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, CompleteAuthorizationFlowResponse, CreateApiKeyPayload, CreateTeamPayload, DecodedJWTPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, Invitation, InviteUserToOrganizationOptions, JWTPayloadData, ListCandidateOrganizationsResponse, ListMembersOptions, Member, ExtendedOrganization as Organization, OrganizationSettings, RemoveUserFromOrganizationOptions, Role, SendVerificationOTPOptions, Session, SessionAssuranceActions, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
|
3926
|
+
export type { APIClient, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberRecord, AdminUser, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, CompleteAuthorizationFlowResponse, CreateAdminOrganizationOptions, CreateApiKeyPayload, CreateTeamPayload, DecodedJWTPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, Invitation, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminOrganizationMembersOptions, ListAdminOrganizationMembersResult, ListAdminOrganizationsOptions, ListAdminOrganizationsResult, ListAdminUsersOptions, ListAdminUsersResult, ListCandidateOrganizationsResponse, ListMembersOptions, Member, ExtendedOrganization as Organization, OrganizationSettings, RemoveUserFromOrganizationOptions, Role, SendVerificationOTPOptions, Session, SessionAssuranceActions, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, UpdateAdminOrganizationOptions, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|