@meistrari/auth-core 1.26.0 → 1.28.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 +86 -8
- package/dist/index.d.ts +86 -8
- package/dist/index.mjs +38 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4386,15 +4386,15 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
4386
4386
|
} & {
|
|
4387
4387
|
applications: {
|
|
4388
4388
|
getApplicationAuthContext: (applicationId: string) => Promise<{
|
|
4389
|
-
data: ApplicationAuthContextResponse;
|
|
4390
|
-
error: null;
|
|
4391
|
-
} | {
|
|
4392
4389
|
data: null;
|
|
4393
4390
|
error: {
|
|
4394
4391
|
message?: string | undefined;
|
|
4395
4392
|
status: number;
|
|
4396
4393
|
statusText: string;
|
|
4397
4394
|
};
|
|
4395
|
+
} | {
|
|
4396
|
+
data: ApplicationAuthContextResponse;
|
|
4397
|
+
error: null;
|
|
4398
4398
|
}>;
|
|
4399
4399
|
listCandidateOrganizations: (applicationId: string) => Promise<{
|
|
4400
4400
|
data: ListCandidateOrganizationsResponse;
|
|
@@ -5723,6 +5723,8 @@ type CreateAdminApplicationOptions = {
|
|
|
5723
5723
|
homeUrl?: string | null;
|
|
5724
5724
|
/** Custom application authentication settings. */
|
|
5725
5725
|
config?: ApplicationConfig | null;
|
|
5726
|
+
/** Organizations to enable for this application during creation. */
|
|
5727
|
+
entitlements?: CreateAdminApplicationEntitlementOptions[];
|
|
5726
5728
|
};
|
|
5727
5729
|
/**
|
|
5728
5730
|
* Options accepted when enabling an organization for an application.
|
|
@@ -5757,6 +5759,36 @@ type ListAdminOrganizationMembersOptions = {
|
|
|
5757
5759
|
limit?: number;
|
|
5758
5760
|
/** Number of members to skip. Defaults to 0. */
|
|
5759
5761
|
offset?: number;
|
|
5762
|
+
/** Free-text search matched against member name, email, role, user ID, and member ID. */
|
|
5763
|
+
query?: string;
|
|
5764
|
+
};
|
|
5765
|
+
/**
|
|
5766
|
+
* Options accepted when listing teams for a single organization as a global admin.
|
|
5767
|
+
*/
|
|
5768
|
+
type ListAdminOrganizationTeamsOptions = {
|
|
5769
|
+
/** ID of the organization whose teams should be listed. */
|
|
5770
|
+
organizationId: string;
|
|
5771
|
+
/** Maximum number of teams to return. Defaults to 50. */
|
|
5772
|
+
limit?: number;
|
|
5773
|
+
/** Number of teams to skip. Defaults to 0. */
|
|
5774
|
+
offset?: number;
|
|
5775
|
+
/** Free-text search matched against team name and ID. */
|
|
5776
|
+
query?: string;
|
|
5777
|
+
/** Column used to order the listing. Defaults to creation date. */
|
|
5778
|
+
sortBy?: 'createdAt' | 'name';
|
|
5779
|
+
/** Order direction. Defaults to descending. */
|
|
5780
|
+
sortDirection?: 'asc' | 'desc';
|
|
5781
|
+
};
|
|
5782
|
+
/**
|
|
5783
|
+
* Options accepted when creating a team for a single organization as a global admin.
|
|
5784
|
+
*/
|
|
5785
|
+
type CreateAdminOrganizationTeamOptions = {
|
|
5786
|
+
/** ID of the organization that should own the team. */
|
|
5787
|
+
organizationId: string;
|
|
5788
|
+
/** Display name of the team. */
|
|
5789
|
+
name: string;
|
|
5790
|
+
/** User IDs of organization members to add to the team. */
|
|
5791
|
+
memberIds?: string[];
|
|
5760
5792
|
};
|
|
5761
5793
|
/**
|
|
5762
5794
|
* Options accepted when creating an organization as a global admin.
|
|
@@ -5846,6 +5878,26 @@ type ListAdminOrganizationMembersResult = {
|
|
|
5846
5878
|
limit: number;
|
|
5847
5879
|
offset: number;
|
|
5848
5880
|
};
|
|
5881
|
+
/**
|
|
5882
|
+
* Full team row returned by the admin organization team listing endpoint.
|
|
5883
|
+
*/
|
|
5884
|
+
type AdminOrganizationTeamRecord = {
|
|
5885
|
+
id: string;
|
|
5886
|
+
name: string;
|
|
5887
|
+
organizationId: string;
|
|
5888
|
+
createdAt: string;
|
|
5889
|
+
updatedAt: string;
|
|
5890
|
+
memberCount: number;
|
|
5891
|
+
};
|
|
5892
|
+
/**
|
|
5893
|
+
* Paginated organization team listing response.
|
|
5894
|
+
*/
|
|
5895
|
+
type ListAdminOrganizationTeamsResult = {
|
|
5896
|
+
teams: AdminOrganizationTeamRecord[];
|
|
5897
|
+
total: number;
|
|
5898
|
+
limit: number;
|
|
5899
|
+
offset: number;
|
|
5900
|
+
};
|
|
5849
5901
|
/**
|
|
5850
5902
|
* Organization row embedded in an admin application entitlement.
|
|
5851
5903
|
*/
|
|
@@ -5985,15 +6037,15 @@ declare class AdminService {
|
|
|
5985
6037
|
* @returns The paginated organization listing
|
|
5986
6038
|
*/
|
|
5987
6039
|
listOrganizations(options?: ListAdminOrganizationsOptions): Promise<{
|
|
6040
|
+
data: ListAdminOrganizationsResult;
|
|
6041
|
+
error: null;
|
|
6042
|
+
} | {
|
|
5988
6043
|
data: null;
|
|
5989
6044
|
error: {
|
|
5990
6045
|
message?: string | undefined;
|
|
5991
6046
|
status: number;
|
|
5992
6047
|
statusText: string;
|
|
5993
6048
|
};
|
|
5994
|
-
} | {
|
|
5995
|
-
data: ListAdminOrganizationsResult;
|
|
5996
|
-
error: null;
|
|
5997
6049
|
}>;
|
|
5998
6050
|
/**
|
|
5999
6051
|
* Lists all Better Auth users from the user table.
|
|
@@ -6025,7 +6077,7 @@ declare class AdminService {
|
|
|
6025
6077
|
/**
|
|
6026
6078
|
* Lists active members for one organization as a global admin.
|
|
6027
6079
|
*
|
|
6028
|
-
* @param options - Organization ID and
|
|
6080
|
+
* @param options - Organization ID, pagination, and search options
|
|
6029
6081
|
* @returns The paginated organization member listing
|
|
6030
6082
|
*/
|
|
6031
6083
|
listOrganizationMembers(options: ListAdminOrganizationMembersOptions): Promise<{
|
|
@@ -6039,6 +6091,32 @@ declare class AdminService {
|
|
|
6039
6091
|
data: ListAdminOrganizationMembersResult;
|
|
6040
6092
|
error: null;
|
|
6041
6093
|
}>;
|
|
6094
|
+
/**
|
|
6095
|
+
* Lists teams for one organization as a global admin.
|
|
6096
|
+
*
|
|
6097
|
+
* @param options - Organization ID, pagination, search, and ordering options
|
|
6098
|
+
* @returns The paginated organization team listing
|
|
6099
|
+
*/
|
|
6100
|
+
listOrganizationTeams(options: ListAdminOrganizationTeamsOptions): Promise<{
|
|
6101
|
+
data: null;
|
|
6102
|
+
error: {
|
|
6103
|
+
message?: string | undefined;
|
|
6104
|
+
status: number;
|
|
6105
|
+
statusText: string;
|
|
6106
|
+
};
|
|
6107
|
+
} | {
|
|
6108
|
+
data: ListAdminOrganizationTeamsResult;
|
|
6109
|
+
error: null;
|
|
6110
|
+
}>;
|
|
6111
|
+
/**
|
|
6112
|
+
* Creates a team for one organization as a global admin.
|
|
6113
|
+
*
|
|
6114
|
+
* @param options - Organization ID, team name, and optional team members
|
|
6115
|
+
* @returns The created team
|
|
6116
|
+
*/
|
|
6117
|
+
createOrganizationTeam(options: CreateAdminOrganizationTeamOptions): Promise<{
|
|
6118
|
+
data: AdminOrganizationTeamRecord;
|
|
6119
|
+
} | null>;
|
|
6042
6120
|
/**
|
|
6043
6121
|
* Creates an organization without adding the creator as a member.
|
|
6044
6122
|
*
|
|
@@ -6990,4 +7068,4 @@ declare function validateToken(token: string, apiUrl: string): Promise<boolean>;
|
|
|
6990
7068
|
declare function extractTokenPayload(token: string): DecodedJWTPayload;
|
|
6991
7069
|
|
|
6992
7070
|
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 };
|
|
6993
|
-
export type { APIClient, AdminApplication, AdminApplicationEntitlement, AdminApplicationEntitlementRecord, AdminApplicationMember, AdminApplicationOrganization, AdminApplicationRecord, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberRecord, AdminUser, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, CompleteAuthorizationFlowResponse, CreateAdminApplicationEntitlementOptions, CreateAdminApplicationOptions, CreateAdminOrganizationOptions, CreateApiKeyPayload, CreateTeamPayload, DecodedJWTPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, Invitation, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminApplicationsOptions, ListAdminApplicationsResult, 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, UserProfile, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
|
7071
|
+
export type { APIClient, AdminApplication, AdminApplicationEntitlement, AdminApplicationEntitlementRecord, AdminApplicationMember, AdminApplicationOrganization, AdminApplicationRecord, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberRecord, AdminOrganizationTeamRecord, AdminUser, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, CompleteAuthorizationFlowResponse, CreateAdminApplicationEntitlementOptions, CreateAdminApplicationOptions, CreateAdminOrganizationOptions, CreateAdminOrganizationTeamOptions, CreateApiKeyPayload, CreateTeamPayload, DecodedJWTPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, Invitation, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminApplicationsOptions, ListAdminApplicationsResult, ListAdminOrganizationMembersOptions, ListAdminOrganizationMembersResult, ListAdminOrganizationTeamsOptions, ListAdminOrganizationTeamsResult, 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, UserProfile, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -4386,15 +4386,15 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
4386
4386
|
} & {
|
|
4387
4387
|
applications: {
|
|
4388
4388
|
getApplicationAuthContext: (applicationId: string) => Promise<{
|
|
4389
|
-
data: ApplicationAuthContextResponse;
|
|
4390
|
-
error: null;
|
|
4391
|
-
} | {
|
|
4392
4389
|
data: null;
|
|
4393
4390
|
error: {
|
|
4394
4391
|
message?: string | undefined;
|
|
4395
4392
|
status: number;
|
|
4396
4393
|
statusText: string;
|
|
4397
4394
|
};
|
|
4395
|
+
} | {
|
|
4396
|
+
data: ApplicationAuthContextResponse;
|
|
4397
|
+
error: null;
|
|
4398
4398
|
}>;
|
|
4399
4399
|
listCandidateOrganizations: (applicationId: string) => Promise<{
|
|
4400
4400
|
data: ListCandidateOrganizationsResponse;
|
|
@@ -5723,6 +5723,8 @@ type CreateAdminApplicationOptions = {
|
|
|
5723
5723
|
homeUrl?: string | null;
|
|
5724
5724
|
/** Custom application authentication settings. */
|
|
5725
5725
|
config?: ApplicationConfig | null;
|
|
5726
|
+
/** Organizations to enable for this application during creation. */
|
|
5727
|
+
entitlements?: CreateAdminApplicationEntitlementOptions[];
|
|
5726
5728
|
};
|
|
5727
5729
|
/**
|
|
5728
5730
|
* Options accepted when enabling an organization for an application.
|
|
@@ -5757,6 +5759,36 @@ type ListAdminOrganizationMembersOptions = {
|
|
|
5757
5759
|
limit?: number;
|
|
5758
5760
|
/** Number of members to skip. Defaults to 0. */
|
|
5759
5761
|
offset?: number;
|
|
5762
|
+
/** Free-text search matched against member name, email, role, user ID, and member ID. */
|
|
5763
|
+
query?: string;
|
|
5764
|
+
};
|
|
5765
|
+
/**
|
|
5766
|
+
* Options accepted when listing teams for a single organization as a global admin.
|
|
5767
|
+
*/
|
|
5768
|
+
type ListAdminOrganizationTeamsOptions = {
|
|
5769
|
+
/** ID of the organization whose teams should be listed. */
|
|
5770
|
+
organizationId: string;
|
|
5771
|
+
/** Maximum number of teams to return. Defaults to 50. */
|
|
5772
|
+
limit?: number;
|
|
5773
|
+
/** Number of teams to skip. Defaults to 0. */
|
|
5774
|
+
offset?: number;
|
|
5775
|
+
/** Free-text search matched against team name and ID. */
|
|
5776
|
+
query?: string;
|
|
5777
|
+
/** Column used to order the listing. Defaults to creation date. */
|
|
5778
|
+
sortBy?: 'createdAt' | 'name';
|
|
5779
|
+
/** Order direction. Defaults to descending. */
|
|
5780
|
+
sortDirection?: 'asc' | 'desc';
|
|
5781
|
+
};
|
|
5782
|
+
/**
|
|
5783
|
+
* Options accepted when creating a team for a single organization as a global admin.
|
|
5784
|
+
*/
|
|
5785
|
+
type CreateAdminOrganizationTeamOptions = {
|
|
5786
|
+
/** ID of the organization that should own the team. */
|
|
5787
|
+
organizationId: string;
|
|
5788
|
+
/** Display name of the team. */
|
|
5789
|
+
name: string;
|
|
5790
|
+
/** User IDs of organization members to add to the team. */
|
|
5791
|
+
memberIds?: string[];
|
|
5760
5792
|
};
|
|
5761
5793
|
/**
|
|
5762
5794
|
* Options accepted when creating an organization as a global admin.
|
|
@@ -5846,6 +5878,26 @@ type ListAdminOrganizationMembersResult = {
|
|
|
5846
5878
|
limit: number;
|
|
5847
5879
|
offset: number;
|
|
5848
5880
|
};
|
|
5881
|
+
/**
|
|
5882
|
+
* Full team row returned by the admin organization team listing endpoint.
|
|
5883
|
+
*/
|
|
5884
|
+
type AdminOrganizationTeamRecord = {
|
|
5885
|
+
id: string;
|
|
5886
|
+
name: string;
|
|
5887
|
+
organizationId: string;
|
|
5888
|
+
createdAt: string;
|
|
5889
|
+
updatedAt: string;
|
|
5890
|
+
memberCount: number;
|
|
5891
|
+
};
|
|
5892
|
+
/**
|
|
5893
|
+
* Paginated organization team listing response.
|
|
5894
|
+
*/
|
|
5895
|
+
type ListAdminOrganizationTeamsResult = {
|
|
5896
|
+
teams: AdminOrganizationTeamRecord[];
|
|
5897
|
+
total: number;
|
|
5898
|
+
limit: number;
|
|
5899
|
+
offset: number;
|
|
5900
|
+
};
|
|
5849
5901
|
/**
|
|
5850
5902
|
* Organization row embedded in an admin application entitlement.
|
|
5851
5903
|
*/
|
|
@@ -5985,15 +6037,15 @@ declare class AdminService {
|
|
|
5985
6037
|
* @returns The paginated organization listing
|
|
5986
6038
|
*/
|
|
5987
6039
|
listOrganizations(options?: ListAdminOrganizationsOptions): Promise<{
|
|
6040
|
+
data: ListAdminOrganizationsResult;
|
|
6041
|
+
error: null;
|
|
6042
|
+
} | {
|
|
5988
6043
|
data: null;
|
|
5989
6044
|
error: {
|
|
5990
6045
|
message?: string | undefined;
|
|
5991
6046
|
status: number;
|
|
5992
6047
|
statusText: string;
|
|
5993
6048
|
};
|
|
5994
|
-
} | {
|
|
5995
|
-
data: ListAdminOrganizationsResult;
|
|
5996
|
-
error: null;
|
|
5997
6049
|
}>;
|
|
5998
6050
|
/**
|
|
5999
6051
|
* Lists all Better Auth users from the user table.
|
|
@@ -6025,7 +6077,7 @@ declare class AdminService {
|
|
|
6025
6077
|
/**
|
|
6026
6078
|
* Lists active members for one organization as a global admin.
|
|
6027
6079
|
*
|
|
6028
|
-
* @param options - Organization ID and
|
|
6080
|
+
* @param options - Organization ID, pagination, and search options
|
|
6029
6081
|
* @returns The paginated organization member listing
|
|
6030
6082
|
*/
|
|
6031
6083
|
listOrganizationMembers(options: ListAdminOrganizationMembersOptions): Promise<{
|
|
@@ -6039,6 +6091,32 @@ declare class AdminService {
|
|
|
6039
6091
|
data: ListAdminOrganizationMembersResult;
|
|
6040
6092
|
error: null;
|
|
6041
6093
|
}>;
|
|
6094
|
+
/**
|
|
6095
|
+
* Lists teams for one organization as a global admin.
|
|
6096
|
+
*
|
|
6097
|
+
* @param options - Organization ID, pagination, search, and ordering options
|
|
6098
|
+
* @returns The paginated organization team listing
|
|
6099
|
+
*/
|
|
6100
|
+
listOrganizationTeams(options: ListAdminOrganizationTeamsOptions): Promise<{
|
|
6101
|
+
data: null;
|
|
6102
|
+
error: {
|
|
6103
|
+
message?: string | undefined;
|
|
6104
|
+
status: number;
|
|
6105
|
+
statusText: string;
|
|
6106
|
+
};
|
|
6107
|
+
} | {
|
|
6108
|
+
data: ListAdminOrganizationTeamsResult;
|
|
6109
|
+
error: null;
|
|
6110
|
+
}>;
|
|
6111
|
+
/**
|
|
6112
|
+
* Creates a team for one organization as a global admin.
|
|
6113
|
+
*
|
|
6114
|
+
* @param options - Organization ID, team name, and optional team members
|
|
6115
|
+
* @returns The created team
|
|
6116
|
+
*/
|
|
6117
|
+
createOrganizationTeam(options: CreateAdminOrganizationTeamOptions): Promise<{
|
|
6118
|
+
data: AdminOrganizationTeamRecord;
|
|
6119
|
+
} | null>;
|
|
6042
6120
|
/**
|
|
6043
6121
|
* Creates an organization without adding the creator as a member.
|
|
6044
6122
|
*
|
|
@@ -6990,4 +7068,4 @@ declare function validateToken(token: string, apiUrl: string): Promise<boolean>;
|
|
|
6990
7068
|
declare function extractTokenPayload(token: string): DecodedJWTPayload;
|
|
6991
7069
|
|
|
6992
7070
|
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 };
|
|
6993
|
-
export type { APIClient, AdminApplication, AdminApplicationEntitlement, AdminApplicationEntitlementRecord, AdminApplicationMember, AdminApplicationOrganization, AdminApplicationRecord, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberRecord, AdminUser, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, CompleteAuthorizationFlowResponse, CreateAdminApplicationEntitlementOptions, CreateAdminApplicationOptions, CreateAdminOrganizationOptions, CreateApiKeyPayload, CreateTeamPayload, DecodedJWTPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, Invitation, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminApplicationsOptions, ListAdminApplicationsResult, 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, UserProfile, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
|
7071
|
+
export type { APIClient, AdminApplication, AdminApplicationEntitlement, AdminApplicationEntitlementRecord, AdminApplicationMember, AdminApplicationOrganization, AdminApplicationRecord, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberRecord, AdminOrganizationTeamRecord, AdminUser, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, CompleteAuthorizationFlowResponse, CreateAdminApplicationEntitlementOptions, CreateAdminApplicationOptions, CreateAdminOrganizationOptions, CreateAdminOrganizationTeamOptions, CreateApiKeyPayload, CreateTeamPayload, DecodedJWTPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, Invitation, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminApplicationsOptions, ListAdminApplicationsResult, ListAdminOrganizationMembersOptions, ListAdminOrganizationMembersResult, ListAdminOrganizationTeamsOptions, ListAdminOrganizationTeamsResult, 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, UserProfile, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { defaultStatements } from 'better-auth/plugins/organization/access';
|
|
|
8
8
|
import z, { z as z$1 } from 'zod';
|
|
9
9
|
export { APIError } from 'better-auth';
|
|
10
10
|
|
|
11
|
-
const version = "1.
|
|
11
|
+
const version = "1.28.0";
|
|
12
12
|
|
|
13
13
|
function parsedEnumValues(schema) {
|
|
14
14
|
return Object.fromEntries(
|
|
@@ -482,7 +482,7 @@ class AdminService {
|
|
|
482
482
|
/**
|
|
483
483
|
* Lists active members for one organization as a global admin.
|
|
484
484
|
*
|
|
485
|
-
* @param options - Organization ID and
|
|
485
|
+
* @param options - Organization ID, pagination, and search options
|
|
486
486
|
* @returns The paginated organization member listing
|
|
487
487
|
*/
|
|
488
488
|
async listOrganizationMembers(options) {
|
|
@@ -490,10 +490,45 @@ class AdminService {
|
|
|
490
490
|
method: "GET",
|
|
491
491
|
query: {
|
|
492
492
|
...options.limit !== void 0 ? { limit: options.limit } : {},
|
|
493
|
-
...options.offset !== void 0 ? { offset: options.offset } : {}
|
|
493
|
+
...options.offset !== void 0 ? { offset: options.offset } : {},
|
|
494
|
+
...options.query ? { query: options.query } : {}
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Lists teams for one organization as a global admin.
|
|
500
|
+
*
|
|
501
|
+
* @param options - Organization ID, pagination, search, and ordering options
|
|
502
|
+
* @returns The paginated organization team listing
|
|
503
|
+
*/
|
|
504
|
+
async listOrganizationTeams(options) {
|
|
505
|
+
return await this.client.$fetch(`/admin/organizations/${encodeURIComponent(options.organizationId)}/teams`, {
|
|
506
|
+
method: "GET",
|
|
507
|
+
query: {
|
|
508
|
+
...options.limit !== void 0 ? { limit: options.limit } : {},
|
|
509
|
+
...options.offset !== void 0 ? { offset: options.offset } : {},
|
|
510
|
+
...options.query ? { query: options.query } : {},
|
|
511
|
+
...options.sortBy ? { sortBy: options.sortBy } : {},
|
|
512
|
+
...options.sortDirection ? { sortDirection: options.sortDirection } : {}
|
|
494
513
|
}
|
|
495
514
|
});
|
|
496
515
|
}
|
|
516
|
+
/**
|
|
517
|
+
* Creates a team for one organization as a global admin.
|
|
518
|
+
*
|
|
519
|
+
* @param options - Organization ID, team name, and optional team members
|
|
520
|
+
* @returns The created team
|
|
521
|
+
*/
|
|
522
|
+
async createOrganizationTeam(options) {
|
|
523
|
+
const { data } = await this.client.$fetch(`/admin/organizations/${encodeURIComponent(options.organizationId)}/teams`, {
|
|
524
|
+
method: "POST",
|
|
525
|
+
body: {
|
|
526
|
+
name: options.name,
|
|
527
|
+
memberIds: options.memberIds ?? []
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
return data;
|
|
531
|
+
}
|
|
497
532
|
/**
|
|
498
533
|
* Creates an organization without adding the creator as a member.
|
|
499
534
|
*
|