@meistrari/auth-core 1.39.3 → 1.41.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 +103 -2
- package/dist/index.d.ts +103 -2
- package/dist/index.mjs +85 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1357,6 +1357,14 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
1357
1357
|
noncePayload: (nonce: string) => Promise<NoncePayloadResponse>;
|
|
1358
1358
|
};
|
|
1359
1359
|
};
|
|
1360
|
+
} | {
|
|
1361
|
+
id: "invitation-signup";
|
|
1362
|
+
getActions: ($fetch: better_auth_client.BetterFetch) => {
|
|
1363
|
+
invitationSignup: {
|
|
1364
|
+
status: (invitationId: string) => Promise<InvitationSignupStatus>;
|
|
1365
|
+
setupPassword: (invitationId: string, password: string) => Promise<InvitationPasswordSetupResult>;
|
|
1366
|
+
};
|
|
1367
|
+
};
|
|
1360
1368
|
} | {
|
|
1361
1369
|
id: "sso-client";
|
|
1362
1370
|
version: string;
|
|
@@ -4450,6 +4458,28 @@ type CreateAdminOrganizationTeamOptions = {
|
|
|
4450
4458
|
/** User IDs of organization members to add to the team. */
|
|
4451
4459
|
memberIds?: string[];
|
|
4452
4460
|
};
|
|
4461
|
+
/**
|
|
4462
|
+
* Options accepted when updating an organization team as a global admin.
|
|
4463
|
+
*/
|
|
4464
|
+
type UpdateAdminOrganizationTeamOptions = {
|
|
4465
|
+
/** ID of the organization that owns the team. */
|
|
4466
|
+
organizationId: string;
|
|
4467
|
+
/** ID of the team to update. */
|
|
4468
|
+
teamId: string;
|
|
4469
|
+
/** New display name of the team. */
|
|
4470
|
+
name: string;
|
|
4471
|
+
/** Complete replacement set of active organization member user IDs. */
|
|
4472
|
+
memberIds?: string[];
|
|
4473
|
+
};
|
|
4474
|
+
/**
|
|
4475
|
+
* Options accepted when deleting an organization team as a global admin.
|
|
4476
|
+
*/
|
|
4477
|
+
type DeleteAdminOrganizationTeamOptions = {
|
|
4478
|
+
/** ID of the organization that owns the team. */
|
|
4479
|
+
organizationId: string;
|
|
4480
|
+
/** ID of the team to delete. */
|
|
4481
|
+
teamId: string;
|
|
4482
|
+
};
|
|
4453
4483
|
/**
|
|
4454
4484
|
* Options accepted when updating an organization member's role as a global admin.
|
|
4455
4485
|
*/
|
|
@@ -5143,6 +5173,24 @@ declare class AdminService {
|
|
|
5143
5173
|
createOrganizationTeam(options: CreateAdminOrganizationTeamOptions): Promise<{
|
|
5144
5174
|
data: AdminOrganizationTeamRecord;
|
|
5145
5175
|
} | null>;
|
|
5176
|
+
/**
|
|
5177
|
+
* Updates a team for one organization. Global admins may update any
|
|
5178
|
+
* organization; an organization admin only their own.
|
|
5179
|
+
*
|
|
5180
|
+
* @param options - Organization ID, team ID, new name, and optional replacement member IDs
|
|
5181
|
+
* @returns The updated team
|
|
5182
|
+
*/
|
|
5183
|
+
updateOrganizationTeam(options: UpdateAdminOrganizationTeamOptions): Promise<{
|
|
5184
|
+
data: AdminOrganizationTeamRecord;
|
|
5185
|
+
} | null>;
|
|
5186
|
+
/**
|
|
5187
|
+
* Deletes a team for one organization, detaching its members with it.
|
|
5188
|
+
* Global admins may delete from any organization; an organization admin
|
|
5189
|
+
* only from their own.
|
|
5190
|
+
*
|
|
5191
|
+
* @param options - Organization ID and team ID
|
|
5192
|
+
*/
|
|
5193
|
+
deleteOrganizationTeam(options: DeleteAdminOrganizationTeamOptions): Promise<void>;
|
|
5146
5194
|
/**
|
|
5147
5195
|
* Fetches a single entitlement together with its ordered access rules.
|
|
5148
5196
|
*
|
|
@@ -5368,6 +5416,33 @@ type CreateTeamPayload = Pick<Team, 'name'> & {
|
|
|
5368
5416
|
*/
|
|
5369
5417
|
type UpdateTeamPayload = Pick<Team, 'name'>;
|
|
5370
5418
|
|
|
5419
|
+
/**
|
|
5420
|
+
* Status of an invitation as seen by the pre-login invite flow.
|
|
5421
|
+
*
|
|
5422
|
+
* `email` and `requiresAccountSetup` are only present while the invitation is
|
|
5423
|
+
* still pending; other statuses return the status alone.
|
|
5424
|
+
*/
|
|
5425
|
+
type InvitationSignupStatus = {
|
|
5426
|
+
status: 'pending';
|
|
5427
|
+
email: string;
|
|
5428
|
+
/** True when the invited user has no account yet and has never signed in. */
|
|
5429
|
+
requiresAccountSetup: boolean;
|
|
5430
|
+
} | {
|
|
5431
|
+
status: 'accepted' | 'canceled' | 'rejected' | 'expired';
|
|
5432
|
+
};
|
|
5433
|
+
/**
|
|
5434
|
+
* Result of creating a password from an invitation. The user is signed in
|
|
5435
|
+
* as part of the call; the session cookie is set on the response.
|
|
5436
|
+
*/
|
|
5437
|
+
type InvitationPasswordSetupResult = {
|
|
5438
|
+
token: string;
|
|
5439
|
+
user: {
|
|
5440
|
+
id: string;
|
|
5441
|
+
email: string;
|
|
5442
|
+
name: string;
|
|
5443
|
+
};
|
|
5444
|
+
};
|
|
5445
|
+
|
|
5371
5446
|
/**
|
|
5372
5447
|
* Service for managing organizations, members, invitations, and teams.
|
|
5373
5448
|
*
|
|
@@ -5566,6 +5641,29 @@ declare class OrganizationService {
|
|
|
5566
5641
|
* and the configured post-acceptance URL for plain organization invitations.
|
|
5567
5642
|
*/
|
|
5568
5643
|
acceptInvitation(id: string): Promise<AcceptInvitationResult>;
|
|
5644
|
+
/**
|
|
5645
|
+
* Gets the pre-login signup status for an invitation.
|
|
5646
|
+
*
|
|
5647
|
+
* Public endpoint keyed by the invitation id from the emailed invite link.
|
|
5648
|
+
* While the invitation is pending, the result includes the invited email
|
|
5649
|
+
* and whether the invited user still needs to set up their account.
|
|
5650
|
+
*
|
|
5651
|
+
* @param id - The invitation ID from the invite link
|
|
5652
|
+
* @returns The invitation status with account-setup information
|
|
5653
|
+
*/
|
|
5654
|
+
getInvitationSignupStatus(id: string): Promise<InvitationSignupStatus>;
|
|
5655
|
+
/**
|
|
5656
|
+
* Creates a password for an invited user who has no account yet.
|
|
5657
|
+
*
|
|
5658
|
+
* Only available once per invitation, while the invitation is pending and
|
|
5659
|
+
* the invited user has never signed in. The user is signed in as part of
|
|
5660
|
+
* the call; the session cookie is set on the response.
|
|
5661
|
+
*
|
|
5662
|
+
* @param id - The invitation ID from the invite link
|
|
5663
|
+
* @param password - The password to create (minimum 8 characters)
|
|
5664
|
+
* @returns The session token and signed-in user
|
|
5665
|
+
*/
|
|
5666
|
+
setupInvitationPassword(id: string, password: string): Promise<InvitationPasswordSetupResult>;
|
|
5569
5667
|
/**
|
|
5570
5668
|
* Removes a user from the active organization.
|
|
5571
5669
|
*
|
|
@@ -5671,6 +5769,8 @@ type SocialSignInOptions = {
|
|
|
5671
5769
|
callbackURL: string;
|
|
5672
5770
|
/** URL to redirect to if authentication fails. Falls back to the API's default error page if not provided. */
|
|
5673
5771
|
errorCallbackURL?: string;
|
|
5772
|
+
/** Email address to preselect at the provider, sent as the `login_hint` authorization parameter. */
|
|
5773
|
+
loginHint?: string;
|
|
5674
5774
|
};
|
|
5675
5775
|
/**
|
|
5676
5776
|
* Options for signing in via SAML Single Sign-On.
|
|
@@ -5772,11 +5872,12 @@ declare class SessionService {
|
|
|
5772
5872
|
* @param options.provider - The social provider
|
|
5773
5873
|
* @param options.callbackURL - URL to redirect to after successful authentication
|
|
5774
5874
|
* @param options.errorCallbackURL - URL to redirect to on error
|
|
5875
|
+
* @param options.loginHint - Email to preselect at the provider
|
|
5775
5876
|
*
|
|
5776
5877
|
* @throws {InvalidSocialProvider} When the provider is not 'google' or 'microsoft'
|
|
5777
5878
|
* @throws {InvalidCallbackURL} When callback URLs are malformed
|
|
5778
5879
|
*/
|
|
5779
|
-
signInWithSocialProvider({ provider, callbackURL, errorCallbackURL, }: SocialSignInOptions): Promise<void>;
|
|
5880
|
+
signInWithSocialProvider({ provider, callbackURL, errorCallbackURL, loginHint, }: SocialSignInOptions): Promise<void>;
|
|
5780
5881
|
/**
|
|
5781
5882
|
* Initiates SAML-based Single Sign-On authentication flow.
|
|
5782
5883
|
*
|
|
@@ -6275,4 +6376,4 @@ declare function validateToken(token: string, apiUrl: string): Promise<boolean>;
|
|
|
6275
6376
|
declare function extractTokenPayload(token: string): DecodedJWTPayload;
|
|
6276
6377
|
|
|
6277
6378
|
export { AAL, AALBrand, AALs, ACR, ACRBrand, ACRs, AMR, AMRBrand, AMRs, ApiKeyMetadata, ApplicationConfig, ApplicationError, ApplicationSessionAssuranceConfig, ApplicationSessionAssuranceError, ApplicationTokenStorage, 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, STEP_UP_MAX_AGE_SECONDS, 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 };
|
|
6278
|
-
export type { APIClient, AcceptInvitationResult, AdminApplication, AdminApplicationEntitlement, AdminApplicationEntitlementRecord, AdminApplicationIdentity, AdminApplicationMember, AdminApplicationOrganization, AdminApplicationRecord, AdminApplicationRole, AdminApplicationSecret, AdminEntitlementRule, AdminEntitlementRuleType, AdminEntitlementWithRules, AdminMember, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberApplication, AdminOrganizationMemberRecord, AdminOrganizationMemberTeam, AdminOrganizationSummary, AdminOrganizationTeam, AdminOrganizationTeamRecord, AdminUser, AdminUserAccess, AdminUserAccessApplication, AdminUserAccessOrganization, AdminUserAccessTeam, AdminUserInvitation, AdminUserOrganization, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, ApplicationTokenStorageOptions, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, ClientCredentialsGrant, ClientCredentialsTokenResponse, CompleteAuthorizationFlowResponse, CreateAdminApplicationEntitlementOptions, CreateAdminApplicationOptions, CreateAdminApplicationRoleOptions, CreateAdminApplicationSecretOptions, CreateAdminOrganizationOptions, CreateAdminOrganizationTeamOptions, CreateApiKeyPayload, CreateTeamPayload, CreatedAdminApplicationSecret, DecodedJWTPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, GetAdminOrganizationsSummaryOptions, GetTokenOptions, Invitation, InviteAdminOrganizationUsersOptions, InviteAdminOrganizationUsersResult, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminApplicationsOptions, ListAdminApplicationsResult, ListAdminOrganizationMembersOptions, ListAdminOrganizationMembersResult, ListAdminOrganizationTeamsOptions, ListAdminOrganizationTeamsResult, ListAdminOrganizationsOptions, ListAdminOrganizationsResult, ListAdminUsersOptions, ListAdminUsersResult, ListCandidateOrganizationsResponse, ListMembersOptions, ListOrganizationsOptions, ListOrganizationsWithRoleOptions, Member, NoncePayloadResponse, ExtendedOrganization as Organization, OrganizationSettings, OrganizationWithRole, RemoveAdminMemberOptions, RemoveUserFromOrganizationOptions, ResendAdminInviteOptions, Role, SendVerificationOTPOptions, Session, SessionAssuranceActions, SessionData, SetAdminEntitlementRulesOptions, SetAdminUserApplicationRoleOptions, SetAdminUserTeamOptions, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, TeamMembersResponse, UpdateAdminApplicationRoleOptions, UpdateAdminEntitlementOptions, UpdateAdminMemberRoleOptions, UpdateAdminOrganizationOptions, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, UserProfile, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
|
6379
|
+
export type { APIClient, AcceptInvitationResult, AdminApplication, AdminApplicationEntitlement, AdminApplicationEntitlementRecord, AdminApplicationIdentity, AdminApplicationMember, AdminApplicationOrganization, AdminApplicationRecord, AdminApplicationRole, AdminApplicationSecret, AdminEntitlementRule, AdminEntitlementRuleType, AdminEntitlementWithRules, AdminMember, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberApplication, AdminOrganizationMemberRecord, AdminOrganizationMemberTeam, AdminOrganizationSummary, AdminOrganizationTeam, AdminOrganizationTeamRecord, AdminUser, AdminUserAccess, AdminUserAccessApplication, AdminUserAccessOrganization, AdminUserAccessTeam, AdminUserInvitation, AdminUserOrganization, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, ApplicationTokenStorageOptions, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, ClientCredentialsGrant, ClientCredentialsTokenResponse, CompleteAuthorizationFlowResponse, CreateAdminApplicationEntitlementOptions, CreateAdminApplicationOptions, CreateAdminApplicationRoleOptions, CreateAdminApplicationSecretOptions, CreateAdminOrganizationOptions, CreateAdminOrganizationTeamOptions, CreateApiKeyPayload, CreateTeamPayload, CreatedAdminApplicationSecret, DecodedJWTPayload, DeleteAdminOrganizationTeamOptions, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, GetAdminOrganizationsSummaryOptions, GetTokenOptions, Invitation, InvitationPasswordSetupResult, InvitationSignupStatus, InviteAdminOrganizationUsersOptions, InviteAdminOrganizationUsersResult, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminApplicationsOptions, ListAdminApplicationsResult, ListAdminOrganizationMembersOptions, ListAdminOrganizationMembersResult, ListAdminOrganizationTeamsOptions, ListAdminOrganizationTeamsResult, ListAdminOrganizationsOptions, ListAdminOrganizationsResult, ListAdminUsersOptions, ListAdminUsersResult, ListCandidateOrganizationsResponse, ListMembersOptions, ListOrganizationsOptions, ListOrganizationsWithRoleOptions, Member, NoncePayloadResponse, ExtendedOrganization as Organization, OrganizationSettings, OrganizationWithRole, RemoveAdminMemberOptions, RemoveUserFromOrganizationOptions, ResendAdminInviteOptions, Role, SendVerificationOTPOptions, Session, SessionAssuranceActions, SessionData, SetAdminEntitlementRulesOptions, SetAdminUserApplicationRoleOptions, SetAdminUserTeamOptions, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, TeamMembersResponse, UpdateAdminApplicationRoleOptions, UpdateAdminEntitlementOptions, UpdateAdminMemberRoleOptions, UpdateAdminOrganizationOptions, UpdateAdminOrganizationTeamOptions, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, UserProfile, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -1357,6 +1357,14 @@ declare function createAPIClient(apiUrl: string, fetchOptions?: BetterFetchOptio
|
|
|
1357
1357
|
noncePayload: (nonce: string) => Promise<NoncePayloadResponse>;
|
|
1358
1358
|
};
|
|
1359
1359
|
};
|
|
1360
|
+
} | {
|
|
1361
|
+
id: "invitation-signup";
|
|
1362
|
+
getActions: ($fetch: better_auth_client.BetterFetch) => {
|
|
1363
|
+
invitationSignup: {
|
|
1364
|
+
status: (invitationId: string) => Promise<InvitationSignupStatus>;
|
|
1365
|
+
setupPassword: (invitationId: string, password: string) => Promise<InvitationPasswordSetupResult>;
|
|
1366
|
+
};
|
|
1367
|
+
};
|
|
1360
1368
|
} | {
|
|
1361
1369
|
id: "sso-client";
|
|
1362
1370
|
version: string;
|
|
@@ -4450,6 +4458,28 @@ type CreateAdminOrganizationTeamOptions = {
|
|
|
4450
4458
|
/** User IDs of organization members to add to the team. */
|
|
4451
4459
|
memberIds?: string[];
|
|
4452
4460
|
};
|
|
4461
|
+
/**
|
|
4462
|
+
* Options accepted when updating an organization team as a global admin.
|
|
4463
|
+
*/
|
|
4464
|
+
type UpdateAdminOrganizationTeamOptions = {
|
|
4465
|
+
/** ID of the organization that owns the team. */
|
|
4466
|
+
organizationId: string;
|
|
4467
|
+
/** ID of the team to update. */
|
|
4468
|
+
teamId: string;
|
|
4469
|
+
/** New display name of the team. */
|
|
4470
|
+
name: string;
|
|
4471
|
+
/** Complete replacement set of active organization member user IDs. */
|
|
4472
|
+
memberIds?: string[];
|
|
4473
|
+
};
|
|
4474
|
+
/**
|
|
4475
|
+
* Options accepted when deleting an organization team as a global admin.
|
|
4476
|
+
*/
|
|
4477
|
+
type DeleteAdminOrganizationTeamOptions = {
|
|
4478
|
+
/** ID of the organization that owns the team. */
|
|
4479
|
+
organizationId: string;
|
|
4480
|
+
/** ID of the team to delete. */
|
|
4481
|
+
teamId: string;
|
|
4482
|
+
};
|
|
4453
4483
|
/**
|
|
4454
4484
|
* Options accepted when updating an organization member's role as a global admin.
|
|
4455
4485
|
*/
|
|
@@ -5143,6 +5173,24 @@ declare class AdminService {
|
|
|
5143
5173
|
createOrganizationTeam(options: CreateAdminOrganizationTeamOptions): Promise<{
|
|
5144
5174
|
data: AdminOrganizationTeamRecord;
|
|
5145
5175
|
} | null>;
|
|
5176
|
+
/**
|
|
5177
|
+
* Updates a team for one organization. Global admins may update any
|
|
5178
|
+
* organization; an organization admin only their own.
|
|
5179
|
+
*
|
|
5180
|
+
* @param options - Organization ID, team ID, new name, and optional replacement member IDs
|
|
5181
|
+
* @returns The updated team
|
|
5182
|
+
*/
|
|
5183
|
+
updateOrganizationTeam(options: UpdateAdminOrganizationTeamOptions): Promise<{
|
|
5184
|
+
data: AdminOrganizationTeamRecord;
|
|
5185
|
+
} | null>;
|
|
5186
|
+
/**
|
|
5187
|
+
* Deletes a team for one organization, detaching its members with it.
|
|
5188
|
+
* Global admins may delete from any organization; an organization admin
|
|
5189
|
+
* only from their own.
|
|
5190
|
+
*
|
|
5191
|
+
* @param options - Organization ID and team ID
|
|
5192
|
+
*/
|
|
5193
|
+
deleteOrganizationTeam(options: DeleteAdminOrganizationTeamOptions): Promise<void>;
|
|
5146
5194
|
/**
|
|
5147
5195
|
* Fetches a single entitlement together with its ordered access rules.
|
|
5148
5196
|
*
|
|
@@ -5368,6 +5416,33 @@ type CreateTeamPayload = Pick<Team, 'name'> & {
|
|
|
5368
5416
|
*/
|
|
5369
5417
|
type UpdateTeamPayload = Pick<Team, 'name'>;
|
|
5370
5418
|
|
|
5419
|
+
/**
|
|
5420
|
+
* Status of an invitation as seen by the pre-login invite flow.
|
|
5421
|
+
*
|
|
5422
|
+
* `email` and `requiresAccountSetup` are only present while the invitation is
|
|
5423
|
+
* still pending; other statuses return the status alone.
|
|
5424
|
+
*/
|
|
5425
|
+
type InvitationSignupStatus = {
|
|
5426
|
+
status: 'pending';
|
|
5427
|
+
email: string;
|
|
5428
|
+
/** True when the invited user has no account yet and has never signed in. */
|
|
5429
|
+
requiresAccountSetup: boolean;
|
|
5430
|
+
} | {
|
|
5431
|
+
status: 'accepted' | 'canceled' | 'rejected' | 'expired';
|
|
5432
|
+
};
|
|
5433
|
+
/**
|
|
5434
|
+
* Result of creating a password from an invitation. The user is signed in
|
|
5435
|
+
* as part of the call; the session cookie is set on the response.
|
|
5436
|
+
*/
|
|
5437
|
+
type InvitationPasswordSetupResult = {
|
|
5438
|
+
token: string;
|
|
5439
|
+
user: {
|
|
5440
|
+
id: string;
|
|
5441
|
+
email: string;
|
|
5442
|
+
name: string;
|
|
5443
|
+
};
|
|
5444
|
+
};
|
|
5445
|
+
|
|
5371
5446
|
/**
|
|
5372
5447
|
* Service for managing organizations, members, invitations, and teams.
|
|
5373
5448
|
*
|
|
@@ -5566,6 +5641,29 @@ declare class OrganizationService {
|
|
|
5566
5641
|
* and the configured post-acceptance URL for plain organization invitations.
|
|
5567
5642
|
*/
|
|
5568
5643
|
acceptInvitation(id: string): Promise<AcceptInvitationResult>;
|
|
5644
|
+
/**
|
|
5645
|
+
* Gets the pre-login signup status for an invitation.
|
|
5646
|
+
*
|
|
5647
|
+
* Public endpoint keyed by the invitation id from the emailed invite link.
|
|
5648
|
+
* While the invitation is pending, the result includes the invited email
|
|
5649
|
+
* and whether the invited user still needs to set up their account.
|
|
5650
|
+
*
|
|
5651
|
+
* @param id - The invitation ID from the invite link
|
|
5652
|
+
* @returns The invitation status with account-setup information
|
|
5653
|
+
*/
|
|
5654
|
+
getInvitationSignupStatus(id: string): Promise<InvitationSignupStatus>;
|
|
5655
|
+
/**
|
|
5656
|
+
* Creates a password for an invited user who has no account yet.
|
|
5657
|
+
*
|
|
5658
|
+
* Only available once per invitation, while the invitation is pending and
|
|
5659
|
+
* the invited user has never signed in. The user is signed in as part of
|
|
5660
|
+
* the call; the session cookie is set on the response.
|
|
5661
|
+
*
|
|
5662
|
+
* @param id - The invitation ID from the invite link
|
|
5663
|
+
* @param password - The password to create (minimum 8 characters)
|
|
5664
|
+
* @returns The session token and signed-in user
|
|
5665
|
+
*/
|
|
5666
|
+
setupInvitationPassword(id: string, password: string): Promise<InvitationPasswordSetupResult>;
|
|
5569
5667
|
/**
|
|
5570
5668
|
* Removes a user from the active organization.
|
|
5571
5669
|
*
|
|
@@ -5671,6 +5769,8 @@ type SocialSignInOptions = {
|
|
|
5671
5769
|
callbackURL: string;
|
|
5672
5770
|
/** URL to redirect to if authentication fails. Falls back to the API's default error page if not provided. */
|
|
5673
5771
|
errorCallbackURL?: string;
|
|
5772
|
+
/** Email address to preselect at the provider, sent as the `login_hint` authorization parameter. */
|
|
5773
|
+
loginHint?: string;
|
|
5674
5774
|
};
|
|
5675
5775
|
/**
|
|
5676
5776
|
* Options for signing in via SAML Single Sign-On.
|
|
@@ -5772,11 +5872,12 @@ declare class SessionService {
|
|
|
5772
5872
|
* @param options.provider - The social provider
|
|
5773
5873
|
* @param options.callbackURL - URL to redirect to after successful authentication
|
|
5774
5874
|
* @param options.errorCallbackURL - URL to redirect to on error
|
|
5875
|
+
* @param options.loginHint - Email to preselect at the provider
|
|
5775
5876
|
*
|
|
5776
5877
|
* @throws {InvalidSocialProvider} When the provider is not 'google' or 'microsoft'
|
|
5777
5878
|
* @throws {InvalidCallbackURL} When callback URLs are malformed
|
|
5778
5879
|
*/
|
|
5779
|
-
signInWithSocialProvider({ provider, callbackURL, errorCallbackURL, }: SocialSignInOptions): Promise<void>;
|
|
5880
|
+
signInWithSocialProvider({ provider, callbackURL, errorCallbackURL, loginHint, }: SocialSignInOptions): Promise<void>;
|
|
5780
5881
|
/**
|
|
5781
5882
|
* Initiates SAML-based Single Sign-On authentication flow.
|
|
5782
5883
|
*
|
|
@@ -6275,4 +6376,4 @@ declare function validateToken(token: string, apiUrl: string): Promise<boolean>;
|
|
|
6275
6376
|
declare function extractTokenPayload(token: string): DecodedJWTPayload;
|
|
6276
6377
|
|
|
6277
6378
|
export { AAL, AALBrand, AALs, ACR, ACRBrand, ACRs, AMR, AMRBrand, AMRs, ApiKeyMetadata, ApplicationConfig, ApplicationError, ApplicationSessionAssuranceConfig, ApplicationSessionAssuranceError, ApplicationTokenStorage, 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, STEP_UP_MAX_AGE_SECONDS, 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 };
|
|
6278
|
-
export type { APIClient, AcceptInvitationResult, AdminApplication, AdminApplicationEntitlement, AdminApplicationEntitlementRecord, AdminApplicationIdentity, AdminApplicationMember, AdminApplicationOrganization, AdminApplicationRecord, AdminApplicationRole, AdminApplicationSecret, AdminEntitlementRule, AdminEntitlementRuleType, AdminEntitlementWithRules, AdminMember, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberApplication, AdminOrganizationMemberRecord, AdminOrganizationMemberTeam, AdminOrganizationSummary, AdminOrganizationTeam, AdminOrganizationTeamRecord, AdminUser, AdminUserAccess, AdminUserAccessApplication, AdminUserAccessOrganization, AdminUserAccessTeam, AdminUserInvitation, AdminUserOrganization, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, ApplicationTokenStorageOptions, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, ClientCredentialsGrant, ClientCredentialsTokenResponse, CompleteAuthorizationFlowResponse, CreateAdminApplicationEntitlementOptions, CreateAdminApplicationOptions, CreateAdminApplicationRoleOptions, CreateAdminApplicationSecretOptions, CreateAdminOrganizationOptions, CreateAdminOrganizationTeamOptions, CreateApiKeyPayload, CreateTeamPayload, CreatedAdminApplicationSecret, DecodedJWTPayload, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, GetAdminOrganizationsSummaryOptions, GetTokenOptions, Invitation, InviteAdminOrganizationUsersOptions, InviteAdminOrganizationUsersResult, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminApplicationsOptions, ListAdminApplicationsResult, ListAdminOrganizationMembersOptions, ListAdminOrganizationMembersResult, ListAdminOrganizationTeamsOptions, ListAdminOrganizationTeamsResult, ListAdminOrganizationsOptions, ListAdminOrganizationsResult, ListAdminUsersOptions, ListAdminUsersResult, ListCandidateOrganizationsResponse, ListMembersOptions, ListOrganizationsOptions, ListOrganizationsWithRoleOptions, Member, NoncePayloadResponse, ExtendedOrganization as Organization, OrganizationSettings, OrganizationWithRole, RemoveAdminMemberOptions, RemoveUserFromOrganizationOptions, ResendAdminInviteOptions, Role, SendVerificationOTPOptions, Session, SessionAssuranceActions, SessionData, SetAdminEntitlementRulesOptions, SetAdminUserApplicationRoleOptions, SetAdminUserTeamOptions, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, TeamMembersResponse, UpdateAdminApplicationRoleOptions, UpdateAdminEntitlementOptions, UpdateAdminMemberRoleOptions, UpdateAdminOrganizationOptions, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, UserProfile, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
|
6379
|
+
export type { APIClient, AcceptInvitationResult, AdminApplication, AdminApplicationEntitlement, AdminApplicationEntitlementRecord, AdminApplicationIdentity, AdminApplicationMember, AdminApplicationOrganization, AdminApplicationRecord, AdminApplicationRole, AdminApplicationSecret, AdminEntitlementRule, AdminEntitlementRuleType, AdminEntitlementWithRules, AdminMember, AdminOrganization, AdminOrganizationApplication, AdminOrganizationMember, AdminOrganizationMemberApplication, AdminOrganizationMemberRecord, AdminOrganizationMemberTeam, AdminOrganizationSummary, AdminOrganizationTeam, AdminOrganizationTeamRecord, AdminUser, AdminUserAccess, AdminUserAccessApplication, AdminUserAccessOrganization, AdminUserAccessTeam, AdminUserInvitation, AdminUserOrganization, ApiKey, ApiKeyWithoutSecret, Application, ApplicationAuthContextResponse, ApplicationTokenStorageOptions, AssuranceFields, BaseOrganization, BeginOAuthStepUpParams, BillingMode, ClientCredentialsGrant, ClientCredentialsTokenResponse, CompleteAuthorizationFlowResponse, CreateAdminApplicationEntitlementOptions, CreateAdminApplicationOptions, CreateAdminApplicationRoleOptions, CreateAdminApplicationSecretOptions, CreateAdminOrganizationOptions, CreateAdminOrganizationTeamOptions, CreateApiKeyPayload, CreateTeamPayload, CreatedAdminApplicationSecret, DecodedJWTPayload, DeleteAdminOrganizationTeamOptions, DeviceAuthorizationActionResponse, DeviceAuthorizationContextResponse, DeviceAuthorizationResponse, DeviceContextApplication, EmailOTPSignInOptions, FullOrganization, GetAdminOrganizationOptions, GetAdminOrganizationsSummaryOptions, GetTokenOptions, Invitation, InvitationPasswordSetupResult, InvitationSignupStatus, InviteAdminOrganizationUsersOptions, InviteAdminOrganizationUsersResult, InviteUserToOrganizationOptions, JWTPayloadData, ListAdminApplicationsOptions, ListAdminApplicationsResult, ListAdminOrganizationMembersOptions, ListAdminOrganizationMembersResult, ListAdminOrganizationTeamsOptions, ListAdminOrganizationTeamsResult, ListAdminOrganizationsOptions, ListAdminOrganizationsResult, ListAdminUsersOptions, ListAdminUsersResult, ListCandidateOrganizationsResponse, ListMembersOptions, ListOrganizationsOptions, ListOrganizationsWithRoleOptions, Member, NoncePayloadResponse, ExtendedOrganization as Organization, OrganizationSettings, OrganizationWithRole, RemoveAdminMemberOptions, RemoveUserFromOrganizationOptions, ResendAdminInviteOptions, Role, SendVerificationOTPOptions, Session, SessionAssuranceActions, SessionData, SetAdminEntitlementRulesOptions, SetAdminUserApplicationRoleOptions, SetAdminUserTeamOptions, SignInWithEmailAndPasswordOptions, SignInWithSamlOptions, SocialSignInOptions, StartAuthorizationFlowResponse, Strict, Team, TeamMember, TeamMembersResponse, UpdateAdminApplicationRoleOptions, UpdateAdminEntitlementOptions, UpdateAdminMemberRoleOptions, UpdateAdminOrganizationOptions, UpdateAdminOrganizationTeamOptions, UpdateApiKeyPayload, UpdateMemberRoleOptions, UpdateOrganizationPayload, UpdateTeamPayload, User, UserProfile, WhoAmIInclude, WhoAmIOptions, WhoAmIOrganization, WhoAmIResponse };
|
package/dist/index.mjs
CHANGED
|
@@ -21,7 +21,7 @@ function isTokenExpired(token, expiresInMs) {
|
|
|
21
21
|
return nowInSeconds > expirationTime;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
const version = "1.
|
|
24
|
+
const version = "1.41.0";
|
|
25
25
|
|
|
26
26
|
function parsedEnumValues(schema) {
|
|
27
27
|
return Object.fromEntries(
|
|
@@ -389,6 +389,27 @@ function handshakePluginClient() {
|
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
+
function invitationSignupPluginClient() {
|
|
393
|
+
return {
|
|
394
|
+
id: "invitation-signup",
|
|
395
|
+
getActions: ($fetch) => ({
|
|
396
|
+
invitationSignup: {
|
|
397
|
+
status: async (invitationId) => {
|
|
398
|
+
return await $fetch("/invitation/signup-status", {
|
|
399
|
+
query: { invitationId }
|
|
400
|
+
});
|
|
401
|
+
},
|
|
402
|
+
setupPassword: async (invitationId, password) => {
|
|
403
|
+
return await $fetch("/invitation/setup-password", {
|
|
404
|
+
method: "POST",
|
|
405
|
+
body: { invitationId, password }
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
})
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
|
|
392
413
|
function sessionAssurancePluginClient() {
|
|
393
414
|
return {
|
|
394
415
|
id: "session-assurance",
|
|
@@ -433,6 +454,7 @@ function createAPIClient(apiUrl, fetchOptions = {}) {
|
|
|
433
454
|
}),
|
|
434
455
|
customEndpointsPluginClient(),
|
|
435
456
|
handshakePluginClient(),
|
|
457
|
+
invitationSignupPluginClient(),
|
|
436
458
|
ssoClient(),
|
|
437
459
|
twoFactorClient(),
|
|
438
460
|
jwtClient(),
|
|
@@ -826,6 +848,36 @@ class AdminService {
|
|
|
826
848
|
});
|
|
827
849
|
return data;
|
|
828
850
|
}
|
|
851
|
+
/**
|
|
852
|
+
* Updates a team for one organization. Global admins may update any
|
|
853
|
+
* organization; an organization admin only their own.
|
|
854
|
+
*
|
|
855
|
+
* @param options - Organization ID, team ID, new name, and optional replacement member IDs
|
|
856
|
+
* @returns The updated team
|
|
857
|
+
*/
|
|
858
|
+
async updateOrganizationTeam(options) {
|
|
859
|
+
const { data } = await this.client.$fetch(`/admin/organizations/${encodeURIComponent(options.organizationId)}/teams/update`, {
|
|
860
|
+
method: "POST",
|
|
861
|
+
body: {
|
|
862
|
+
teamId: options.teamId,
|
|
863
|
+
name: options.name,
|
|
864
|
+
...options.memberIds !== void 0 ? { memberIds: options.memberIds } : {}
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
return data;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Deletes a team for one organization, detaching its members with it.
|
|
871
|
+
* Global admins may delete from any organization; an organization admin
|
|
872
|
+
* only from their own.
|
|
873
|
+
*
|
|
874
|
+
* @param options - Organization ID and team ID
|
|
875
|
+
*/
|
|
876
|
+
async deleteOrganizationTeam(options) {
|
|
877
|
+
await this.client.$fetch(`/admin/organizations/${encodeURIComponent(options.organizationId)}/teams/${encodeURIComponent(options.teamId)}`, {
|
|
878
|
+
method: "DELETE"
|
|
879
|
+
});
|
|
880
|
+
}
|
|
829
881
|
/**
|
|
830
882
|
* Fetches a single entitlement together with its ordered access rules.
|
|
831
883
|
*
|
|
@@ -1708,6 +1760,33 @@ class OrganizationService {
|
|
|
1708
1760
|
member: response.member
|
|
1709
1761
|
};
|
|
1710
1762
|
}
|
|
1763
|
+
/**
|
|
1764
|
+
* Gets the pre-login signup status for an invitation.
|
|
1765
|
+
*
|
|
1766
|
+
* Public endpoint keyed by the invitation id from the emailed invite link.
|
|
1767
|
+
* While the invitation is pending, the result includes the invited email
|
|
1768
|
+
* and whether the invited user still needs to set up their account.
|
|
1769
|
+
*
|
|
1770
|
+
* @param id - The invitation ID from the invite link
|
|
1771
|
+
* @returns The invitation status with account-setup information
|
|
1772
|
+
*/
|
|
1773
|
+
async getInvitationSignupStatus(id) {
|
|
1774
|
+
return await this.client.invitationSignup.status(id);
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* Creates a password for an invited user who has no account yet.
|
|
1778
|
+
*
|
|
1779
|
+
* Only available once per invitation, while the invitation is pending and
|
|
1780
|
+
* the invited user has never signed in. The user is signed in as part of
|
|
1781
|
+
* the call; the session cookie is set on the response.
|
|
1782
|
+
*
|
|
1783
|
+
* @param id - The invitation ID from the invite link
|
|
1784
|
+
* @param password - The password to create (minimum 8 characters)
|
|
1785
|
+
* @returns The session token and signed-in user
|
|
1786
|
+
*/
|
|
1787
|
+
async setupInvitationPassword(id, password) {
|
|
1788
|
+
return await this.client.invitationSignup.setupPassword(id, password);
|
|
1789
|
+
}
|
|
1711
1790
|
/**
|
|
1712
1791
|
* Removes a user from the active organization.
|
|
1713
1792
|
*
|
|
@@ -1874,6 +1953,7 @@ class SessionService {
|
|
|
1874
1953
|
* @param options.provider - The social provider
|
|
1875
1954
|
* @param options.callbackURL - URL to redirect to after successful authentication
|
|
1876
1955
|
* @param options.errorCallbackURL - URL to redirect to on error
|
|
1956
|
+
* @param options.loginHint - Email to preselect at the provider
|
|
1877
1957
|
*
|
|
1878
1958
|
* @throws {InvalidSocialProvider} When the provider is not 'google' or 'microsoft'
|
|
1879
1959
|
* @throws {InvalidCallbackURL} When callback URLs are malformed
|
|
@@ -1881,7 +1961,8 @@ class SessionService {
|
|
|
1881
1961
|
async signInWithSocialProvider({
|
|
1882
1962
|
provider,
|
|
1883
1963
|
callbackURL,
|
|
1884
|
-
errorCallbackURL
|
|
1964
|
+
errorCallbackURL,
|
|
1965
|
+
loginHint
|
|
1885
1966
|
}) {
|
|
1886
1967
|
if (provider !== "google" && provider !== "microsoft") {
|
|
1887
1968
|
throw new InvalidSocialProvider("Invalid social provider");
|
|
@@ -1896,7 +1977,8 @@ class SessionService {
|
|
|
1896
1977
|
await this.client.signIn.social({
|
|
1897
1978
|
provider,
|
|
1898
1979
|
callbackURL,
|
|
1899
|
-
errorCallbackURL: errorCallbackURL ?? `${this.apiUrl}/error?callbackURL=${appUrl}
|
|
1980
|
+
errorCallbackURL: errorCallbackURL ?? `${this.apiUrl}/error?callbackURL=${appUrl}`,
|
|
1981
|
+
...loginHint && { loginHint }
|
|
1900
1982
|
});
|
|
1901
1983
|
}
|
|
1902
1984
|
/**
|