@fusionauth/typescript-client
Version:
A typescript implementation of the FusionAuth client.
817 lines • 295 kB
TypeScript
import IRESTClientBuilder from "./IRESTClientBuilder";
import ClientResponse from "./ClientResponse";
import { RequestCredentials } from "node-fetch";
export declare class FusionAuthClient {
apiKey: string;
host: string;
tenantId?: string;
clientBuilder: IRESTClientBuilder;
credentials: RequestCredentials;
constructor(apiKey: string, host: string, tenantId?: string);
/**
* Sets the tenant id, that will be included in the X-FusionAuth-TenantId header.
*
* @param {string | null} tenantId The value of the X-FusionAuth-TenantId header.
* @returns {FusionAuthClient}
*/
setTenantId(tenantId: string | null): FusionAuthClient;
/**
* Sets whether and how cookies will be sent with each request.
*
* @param value The value that indicates whether and how cookies will be sent.
* @returns {FusionAuthClient}
*/
setRequestCredentials(value: RequestCredentials): FusionAuthClient;
/**
* Takes an action on a user. The user being actioned is called the "actionee" and the user taking the action is called the
* "actioner". Both user ids are required in the request object.
*
* @param {ActionRequest} request The action request that includes all the information about the action being taken including
* the id of the action, any options and the duration (if applicable).
* @returns {Promise<ClientResponse<ActionResponse>>}
*/
actionUser(request: ActionRequest): Promise<ClientResponse<ActionResponse>>;
/**
* Activates the FusionAuth Reactor using a license id and optionally a license text (for air-gapped deployments)
*
* @param {ReactorRequest} request An optional request that contains the license text to activate Reactor (useful for air-gap deployments of FusionAuth).
* @returns {Promise<ClientResponse<void>>}
*/
activateReactor(request: ReactorRequest): Promise<ClientResponse<void>>;
/**
* Adds a user to an existing family. The family id must be specified.
*
* @param {UUID} familyId The id of the family.
* @param {FamilyRequest} request The request object that contains all the information used to determine which user to add to the family.
* @returns {Promise<ClientResponse<FamilyResponse>>}
*/
addUserToFamily(familyId: UUID, request: FamilyRequest): Promise<ClientResponse<FamilyResponse>>;
/**
* Approve a device grant.
*
* @param {string} client_id (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate.
* @param {string} client_secret (Optional) The client secret. This value will be required if client authentication is enabled.
* @param {string} token The access token used to identify the user.
* @param {string} user_code The end-user verification code.
* @returns {Promise<ClientResponse<DeviceApprovalResponse>>}
*/
approveDevice(client_id: string, client_secret: string, token: string, user_code: string): Promise<ClientResponse<DeviceApprovalResponse>>;
/**
* Cancels the user action.
*
* @param {UUID} actionId The action id of the action to cancel.
* @param {ActionRequest} request The action request that contains the information about the cancellation.
* @returns {Promise<ClientResponse<ActionResponse>>}
*/
cancelAction(actionId: UUID, request: ActionRequest): Promise<ClientResponse<ActionResponse>>;
/**
* Changes a user's password using the change password Id. This usually occurs after an email has been sent to the user
* and they clicked on a link to reset their password.
*
* As of version 1.32.2, prefer sending the changePasswordId in the request body. To do this, omit the first parameter, and set
* the value in the request body.
*
* @param {string} changePasswordId The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.
* @param {ChangePasswordRequest} request The change password request that contains all the information used to change the password.
* @returns {Promise<ClientResponse<ChangePasswordResponse>>}
*/
changePassword(changePasswordId: string, request: ChangePasswordRequest): Promise<ClientResponse<ChangePasswordResponse>>;
/**
* Changes a user's password using their identity (login id and password). Using a loginId instead of the changePasswordId
* bypasses the email verification and allows a password to be changed directly without first calling the #forgotPassword
* method.
*
* @param {ChangePasswordRequest} request The change password request that contains all the information used to change the password.
* @returns {Promise<ClientResponse<void>>}
*/
changePasswordByIdentity(request: ChangePasswordRequest): Promise<ClientResponse<void>>;
/**
* Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
* your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.
*
* An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
*
* @param {string} changePasswordId The change password Id used to find the user. This value is generated by FusionAuth once the change password workflow has been initiated.
* @returns {Promise<ClientResponse<void>>}
*/
checkChangePasswordUsingId(changePasswordId: string): Promise<ClientResponse<void>>;
/**
* Check to see if the user must obtain a Trust Token Id in order to complete a change password request.
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
* your password, you must obtain a Trust Token by completing a Two-Factor Step-Up authentication.
*
* An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
*
* @param {string} encodedJWT The encoded JWT (access token).
* @returns {Promise<ClientResponse<void>>}
*/
checkChangePasswordUsingJWT(encodedJWT: string): Promise<ClientResponse<void>>;
/**
* Check to see if the user must obtain a Trust Request Id in order to complete a change password request.
* When a user has enabled Two-Factor authentication, before you are allowed to use the Change Password API to change
* your password, you must obtain a Trust Request Id by completing a Two-Factor Step-Up authentication.
*
* An HTTP status code of 400 with a general error code of [TrustTokenRequired] indicates that a Trust Token is required to make a POST request to this API.
*
* @param {string} loginId The loginId of the User that you intend to change the password for.
* @returns {Promise<ClientResponse<void>>}
*/
checkChangePasswordUsingLoginId(loginId: string): Promise<ClientResponse<void>>;
/**
* Make a Client Credentials grant request to obtain an access token.
*
* @param {string} client_id (Optional) The client identifier. The client Id is the Id of the FusionAuth Entity in which you are attempting to authenticate.
* This parameter is optional when Basic Authorization is used to authenticate this request.
* @param {string} client_secret (Optional) The client secret used to authenticate this request.
* This parameter is optional when Basic Authorization is used to authenticate this request.
* @param {string} scope (Optional) This parameter is used to indicate which target entity you are requesting access. To request access to an entity, use the format target-entity:<target-entity-id>:<roles>. Roles are an optional comma separated list.
* @returns {Promise<ClientResponse<AccessToken>>}
*/
clientCredentialsGrant(client_id: string, client_secret: string, scope: string): Promise<ClientResponse<AccessToken>>;
/**
* Adds a comment to the user's account.
*
* @param {UserCommentRequest} request The request object that contains all the information used to create the user comment.
* @returns {Promise<ClientResponse<void>>}
*/
commentOnUser(request: UserCommentRequest): Promise<ClientResponse<void>>;
/**
* Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
*
* @param {WebAuthnLoginRequest} request An object containing data necessary for completing the authentication ceremony
* @returns {Promise<ClientResponse<WebAuthnAssertResponse>>}
*/
completeWebAuthnAssertion(request: WebAuthnLoginRequest): Promise<ClientResponse<WebAuthnAssertResponse>>;
/**
* Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge and then login the user in
*
* @param {WebAuthnLoginRequest} request An object containing data necessary for completing the authentication ceremony
* @returns {Promise<ClientResponse<LoginResponse>>}
*/
completeWebAuthnLogin(request: WebAuthnLoginRequest): Promise<ClientResponse<LoginResponse>>;
/**
* Complete a WebAuthn registration ceremony by validating the client request and saving the new credential
*
* @param {WebAuthnRegisterCompleteRequest} request An object containing data necessary for completing the registration ceremony
* @returns {Promise<ClientResponse<WebAuthnRegisterCompleteResponse>>}
*/
completeWebAuthnRegistration(request: WebAuthnRegisterCompleteRequest): Promise<ClientResponse<WebAuthnRegisterCompleteResponse>>;
/**
* Creates an API key. You can optionally specify a unique Id for the key, if not provided one will be generated.
* an API key can only be created with equal or lesser authority. An API key cannot create another API key unless it is granted
* to that API key.
*
* If an API key is locked to a tenant, it can only create API Keys for that same tenant.
*
* @param {UUID} keyId (Optional) The unique Id of the API key. If not provided a secure random Id will be generated.
* @param {APIKeyRequest} request The request object that contains all the information needed to create the APIKey.
* @returns {Promise<ClientResponse<APIKeyResponse>>}
*/
createAPIKey(keyId: UUID, request: APIKeyRequest): Promise<ClientResponse<APIKeyResponse>>;
/**
* Creates an application. You can optionally specify an Id for the application, if not provided one will be generated.
*
* @param {UUID} applicationId (Optional) The Id to use for the application. If not provided a secure random UUID will be generated.
* @param {ApplicationRequest} request The request object that contains all the information used to create the application.
* @returns {Promise<ClientResponse<ApplicationResponse>>}
*/
createApplication(applicationId: UUID, request: ApplicationRequest): Promise<ClientResponse<ApplicationResponse>>;
/**
* Creates a new role for an application. You must specify the id of the application you are creating the role for.
* You can optionally specify an Id for the role inside the ApplicationRole object itself, if not provided one will be generated.
*
* @param {UUID} applicationId The Id of the application to create the role on.
* @param {UUID} roleId (Optional) The Id of the role. If not provided a secure random UUID will be generated.
* @param {ApplicationRequest} request The request object that contains all the information used to create the application role.
* @returns {Promise<ClientResponse<ApplicationResponse>>}
*/
createApplicationRole(applicationId: UUID, roleId: UUID, request: ApplicationRequest): Promise<ClientResponse<ApplicationResponse>>;
/**
* Creates an audit log with the message and user name (usually an email). Audit logs should be written anytime you
* make changes to the FusionAuth database. When using the FusionAuth App web interface, any changes are automatically
* written to the audit log. However, if you are accessing the API, you must write the audit logs yourself.
*
* @param {AuditLogRequest} request The request object that contains all the information used to create the audit log entry.
* @returns {Promise<ClientResponse<AuditLogResponse>>}
*/
createAuditLog(request: AuditLogRequest): Promise<ClientResponse<AuditLogResponse>>;
/**
* Creates a connector. You can optionally specify an Id for the connector, if not provided one will be generated.
*
* @param {UUID} connectorId (Optional) The Id for the connector. If not provided a secure random UUID will be generated.
* @param {ConnectorRequest} request The request object that contains all the information used to create the connector.
* @returns {Promise<ClientResponse<ConnectorResponse>>}
*/
createConnector(connectorId: UUID, request: ConnectorRequest): Promise<ClientResponse<ConnectorResponse>>;
/**
* Creates a user consent type. You can optionally specify an Id for the consent type, if not provided one will be generated.
*
* @param {UUID} consentId (Optional) The Id for the consent. If not provided a secure random UUID will be generated.
* @param {ConsentRequest} request The request object that contains all the information used to create the consent.
* @returns {Promise<ClientResponse<ConsentResponse>>}
*/
createConsent(consentId: UUID, request: ConsentRequest): Promise<ClientResponse<ConsentResponse>>;
/**
* Creates an email template. You can optionally specify an Id for the template, if not provided one will be generated.
*
* @param {UUID} emailTemplateId (Optional) The Id for the template. If not provided a secure random UUID will be generated.
* @param {EmailTemplateRequest} request The request object that contains all the information used to create the email template.
* @returns {Promise<ClientResponse<EmailTemplateResponse>>}
*/
createEmailTemplate(emailTemplateId: UUID, request: EmailTemplateRequest): Promise<ClientResponse<EmailTemplateResponse>>;
/**
* Creates an Entity. You can optionally specify an Id for the Entity. If not provided one will be generated.
*
* @param {UUID} entityId (Optional) The Id for the Entity. If not provided a secure random UUID will be generated.
* @param {EntityRequest} request The request object that contains all the information used to create the Entity.
* @returns {Promise<ClientResponse<EntityResponse>>}
*/
createEntity(entityId: UUID, request: EntityRequest): Promise<ClientResponse<EntityResponse>>;
/**
* Creates a Entity Type. You can optionally specify an Id for the Entity Type, if not provided one will be generated.
*
* @param {UUID} entityTypeId (Optional) The Id for the Entity Type. If not provided a secure random UUID will be generated.
* @param {EntityTypeRequest} request The request object that contains all the information used to create the Entity Type.
* @returns {Promise<ClientResponse<EntityTypeResponse>>}
*/
createEntityType(entityTypeId: UUID, request: EntityTypeRequest): Promise<ClientResponse<EntityTypeResponse>>;
/**
* Creates a new permission for an entity type. You must specify the id of the entity type you are creating the permission for.
* You can optionally specify an Id for the permission inside the EntityTypePermission object itself, if not provided one will be generated.
*
* @param {UUID} entityTypeId The Id of the entity type to create the permission on.
* @param {UUID} permissionId (Optional) The Id of the permission. If not provided a secure random UUID will be generated.
* @param {EntityTypeRequest} request The request object that contains all the information used to create the permission.
* @returns {Promise<ClientResponse<EntityTypeResponse>>}
*/
createEntityTypePermission(entityTypeId: UUID, permissionId: UUID, request: EntityTypeRequest): Promise<ClientResponse<EntityTypeResponse>>;
/**
* Creates a family with the user id in the request as the owner and sole member of the family. You can optionally specify an id for the
* family, if not provided one will be generated.
*
* @param {UUID} familyId (Optional) The id for the family. If not provided a secure random UUID will be generated.
* @param {FamilyRequest} request The request object that contains all the information used to create the family.
* @returns {Promise<ClientResponse<FamilyResponse>>}
*/
createFamily(familyId: UUID, request: FamilyRequest): Promise<ClientResponse<FamilyResponse>>;
/**
* Creates a form. You can optionally specify an Id for the form, if not provided one will be generated.
*
* @param {UUID} formId (Optional) The Id for the form. If not provided a secure random UUID will be generated.
* @param {FormRequest} request The request object that contains all the information used to create the form.
* @returns {Promise<ClientResponse<FormResponse>>}
*/
createForm(formId: UUID, request: FormRequest): Promise<ClientResponse<FormResponse>>;
/**
* Creates a form field. You can optionally specify an Id for the form, if not provided one will be generated.
*
* @param {UUID} fieldId (Optional) The Id for the form field. If not provided a secure random UUID will be generated.
* @param {FormFieldRequest} request The request object that contains all the information used to create the form field.
* @returns {Promise<ClientResponse<FormFieldResponse>>}
*/
createFormField(fieldId: UUID, request: FormFieldRequest): Promise<ClientResponse<FormFieldResponse>>;
/**
* Creates a group. You can optionally specify an Id for the group, if not provided one will be generated.
*
* @param {UUID} groupId (Optional) The Id for the group. If not provided a secure random UUID will be generated.
* @param {GroupRequest} request The request object that contains all the information used to create the group.
* @returns {Promise<ClientResponse<GroupResponse>>}
*/
createGroup(groupId: UUID, request: GroupRequest): Promise<ClientResponse<GroupResponse>>;
/**
* Creates a member in a group.
*
* @param {MemberRequest} request The request object that contains all the information used to create the group member(s).
* @returns {Promise<ClientResponse<MemberResponse>>}
*/
createGroupMembers(request: MemberRequest): Promise<ClientResponse<MemberResponse>>;
/**
* Creates an IP Access Control List. You can optionally specify an Id on this create request, if one is not provided one will be generated.
*
* @param {UUID} accessControlListId (Optional) The Id for the IP Access Control List. If not provided a secure random UUID will be generated.
* @param {IPAccessControlListRequest} request The request object that contains all the information used to create the IP Access Control List.
* @returns {Promise<ClientResponse<IPAccessControlListResponse>>}
*/
createIPAccessControlList(accessControlListId: UUID, request: IPAccessControlListRequest): Promise<ClientResponse<IPAccessControlListResponse>>;
/**
* Creates an identity provider. You can optionally specify an Id for the identity provider, if not provided one will be generated.
*
* @param {UUID} identityProviderId (Optional) The Id of the identity provider. If not provided a secure random UUID will be generated.
* @param {IdentityProviderRequest} request The request object that contains all the information used to create the identity provider.
* @returns {Promise<ClientResponse<IdentityProviderResponse>>}
*/
createIdentityProvider(identityProviderId: UUID, request: IdentityProviderRequest): Promise<ClientResponse<IdentityProviderResponse>>;
/**
* Creates a Lambda. You can optionally specify an Id for the lambda, if not provided one will be generated.
*
* @param {UUID} lambdaId (Optional) The Id for the lambda. If not provided a secure random UUID will be generated.
* @param {LambdaRequest} request The request object that contains all the information used to create the lambda.
* @returns {Promise<ClientResponse<LambdaResponse>>}
*/
createLambda(lambdaId: UUID, request: LambdaRequest): Promise<ClientResponse<LambdaResponse>>;
/**
* Creates an message template. You can optionally specify an Id for the template, if not provided one will be generated.
*
* @param {UUID} messageTemplateId (Optional) The Id for the template. If not provided a secure random UUID will be generated.
* @param {MessageTemplateRequest} request The request object that contains all the information used to create the message template.
* @returns {Promise<ClientResponse<MessageTemplateResponse>>}
*/
createMessageTemplate(messageTemplateId: UUID, request: MessageTemplateRequest): Promise<ClientResponse<MessageTemplateResponse>>;
/**
* Creates a messenger. You can optionally specify an Id for the messenger, if not provided one will be generated.
*
* @param {UUID} messengerId (Optional) The Id for the messenger. If not provided a secure random UUID will be generated.
* @param {MessengerRequest} request The request object that contains all the information used to create the messenger.
* @returns {Promise<ClientResponse<MessengerResponse>>}
*/
createMessenger(messengerId: UUID, request: MessengerRequest): Promise<ClientResponse<MessengerResponse>>;
/**
* Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
*
* @param {UUID} tenantId (Optional) The Id for the tenant. If not provided a secure random UUID will be generated.
* @param {TenantRequest} request The request object that contains all the information used to create the tenant.
* @returns {Promise<ClientResponse<TenantResponse>>}
*/
createTenant(tenantId: UUID, request: TenantRequest): Promise<ClientResponse<TenantResponse>>;
/**
* Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
*
* @param {UUID} themeId (Optional) The Id for the theme. If not provided a secure random UUID will be generated.
* @param {ThemeRequest} request The request object that contains all the information used to create the theme.
* @returns {Promise<ClientResponse<ThemeResponse>>}
*/
createTheme(themeId: UUID, request: ThemeRequest): Promise<ClientResponse<ThemeResponse>>;
/**
* Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
*
* @param {UUID} userId (Optional) The Id for the user. If not provided a secure random UUID will be generated.
* @param {UserRequest} request The request object that contains all the information used to create the user.
* @returns {Promise<ClientResponse<UserResponse>>}
*/
createUser(userId: UUID, request: UserRequest): Promise<ClientResponse<UserResponse>>;
/**
* Creates a user action. This action cannot be taken on a user until this call successfully returns. Anytime after
* that the user action can be applied to any user.
*
* @param {UUID} userActionId (Optional) The Id for the user action. If not provided a secure random UUID will be generated.
* @param {UserActionRequest} request The request object that contains all the information used to create the user action.
* @returns {Promise<ClientResponse<UserActionResponse>>}
*/
createUserAction(userActionId: UUID, request: UserActionRequest): Promise<ClientResponse<UserActionResponse>>;
/**
* Creates a user reason. This user action reason cannot be used when actioning a user until this call completes
* successfully. Anytime after that the user action reason can be used.
*
* @param {UUID} userActionReasonId (Optional) The Id for the user action reason. If not provided a secure random UUID will be generated.
* @param {UserActionReasonRequest} request The request object that contains all the information used to create the user action reason.
* @returns {Promise<ClientResponse<UserActionReasonResponse>>}
*/
createUserActionReason(userActionReasonId: UUID, request: UserActionReasonRequest): Promise<ClientResponse<UserActionReasonResponse>>;
/**
* Creates a single User consent.
*
* @param {UUID} userConsentId (Optional) The Id for the User consent. If not provided a secure random UUID will be generated.
* @param {UserConsentRequest} request The request that contains the user consent information.
* @returns {Promise<ClientResponse<UserConsentResponse>>}
*/
createUserConsent(userConsentId: UUID, request: UserConsentRequest): Promise<ClientResponse<UserConsentResponse>>;
/**
* Link an external user from a 3rd party identity provider to a FusionAuth user.
*
* @param {IdentityProviderLinkRequest} request The request object that contains all the information used to link the FusionAuth user.
* @returns {Promise<ClientResponse<IdentityProviderLinkResponse>>}
*/
createUserLink(request: IdentityProviderLinkRequest): Promise<ClientResponse<IdentityProviderLinkResponse>>;
/**
* Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
*
* @param {UUID} webhookId (Optional) The Id for the webhook. If not provided a secure random UUID will be generated.
* @param {WebhookRequest} request The request object that contains all the information used to create the webhook.
* @returns {Promise<ClientResponse<WebhookResponse>>}
*/
createWebhook(webhookId: UUID, request: WebhookRequest): Promise<ClientResponse<WebhookResponse>>;
/**
* Deactivates the application with the given Id.
*
* @param {UUID} applicationId The Id of the application to deactivate.
* @returns {Promise<ClientResponse<void>>}
*/
deactivateApplication(applicationId: UUID): Promise<ClientResponse<void>>;
/**
* Deactivates the FusionAuth Reactor.
*
* @returns {Promise<ClientResponse<void>>}
*/
deactivateReactor(): Promise<ClientResponse<void>>;
/**
* Deactivates the user with the given Id.
*
* @param {UUID} userId The Id of the user to deactivate.
* @returns {Promise<ClientResponse<void>>}
*/
deactivateUser(userId: UUID): Promise<ClientResponse<void>>;
/**
* Deactivates the user action with the given Id.
*
* @param {UUID} userActionId The Id of the user action to deactivate.
* @returns {Promise<ClientResponse<void>>}
*/
deactivateUserAction(userActionId: UUID): Promise<ClientResponse<void>>;
/**
* Deactivates the users with the given ids.
*
* @param {Array<string>} userIds The ids of the users to deactivate.
* @returns {Promise<ClientResponse<UserDeleteResponse>>}
*
* @deprecated This method has been renamed to deactivateUsersByIds, use that method instead.
*/
deactivateUsers(userIds: Array<string>): Promise<ClientResponse<UserDeleteResponse>>;
/**
* Deactivates the users with the given ids.
*
* @param {Array<string>} userIds The ids of the users to deactivate.
* @returns {Promise<ClientResponse<UserDeleteResponse>>}
*/
deactivateUsersByIds(userIds: Array<string>): Promise<ClientResponse<UserDeleteResponse>>;
/**
* Deletes the API key for the given Id.
*
* @param {UUID} keyId The Id of the authentication API key to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteAPIKey(keyId: UUID): Promise<ClientResponse<void>>;
/**
* Hard deletes an application. This is a dangerous operation and should not be used in most circumstances. This will
* delete the application, any registrations for that application, metrics and reports for the application, all the
* roles for the application, and any other data associated with the application. This operation could take a very
* long time, depending on the amount of data in your database.
*
* @param {UUID} applicationId The Id of the application to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteApplication(applicationId: UUID): Promise<ClientResponse<void>>;
/**
* Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This
* permanently removes the given role from all users that had it.
*
* @param {UUID} applicationId The Id of the application to deactivate.
* @param {UUID} roleId The Id of the role to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteApplicationRole(applicationId: UUID, roleId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the connector for the given Id.
*
* @param {UUID} connectorId The Id of the connector to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteConnector(connectorId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the consent for the given Id.
*
* @param {UUID} consentId The Id of the consent to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteConsent(consentId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the email template for the given Id.
*
* @param {UUID} emailTemplateId The Id of the email template to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteEmailTemplate(emailTemplateId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the Entity for the given Id.
*
* @param {UUID} entityId The Id of the Entity to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteEntity(entityId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes an Entity Grant for the given User or Entity.
*
* @param {UUID} entityId The Id of the Entity that the Entity Grant is being deleted for.
* @param {UUID} recipientEntityId (Optional) The Id of the Entity that the Entity Grant is for.
* @param {UUID} userId (Optional) The Id of the User that the Entity Grant is for.
* @returns {Promise<ClientResponse<void>>}
*/
deleteEntityGrant(entityId: UUID, recipientEntityId: UUID, userId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the Entity Type for the given Id.
*
* @param {UUID} entityTypeId The Id of the Entity Type to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteEntityType(entityTypeId: UUID): Promise<ClientResponse<void>>;
/**
* Hard deletes a permission. This is a dangerous operation and should not be used in most circumstances. This
* permanently removes the given permission from all grants that had it.
*
* @param {UUID} entityTypeId The Id of the entityType the the permission belongs to.
* @param {UUID} permissionId The Id of the permission to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteEntityTypePermission(entityTypeId: UUID, permissionId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the form for the given Id.
*
* @param {UUID} formId The Id of the form to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteForm(formId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the form field for the given Id.
*
* @param {UUID} fieldId The Id of the form field to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteFormField(fieldId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the group for the given Id.
*
* @param {UUID} groupId The Id of the group to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteGroup(groupId: UUID): Promise<ClientResponse<void>>;
/**
* Removes users as members of a group.
*
* @param {MemberDeleteRequest} request The member request that contains all the information used to remove members to the group.
* @returns {Promise<ClientResponse<void>>}
*/
deleteGroupMembers(request: MemberDeleteRequest): Promise<ClientResponse<void>>;
/**
* Deletes the IP Access Control List for the given Id.
*
* @param {UUID} ipAccessControlListId The Id of the IP Access Control List to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteIPAccessControlList(ipAccessControlListId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the identity provider for the given Id.
*
* @param {UUID} identityProviderId The Id of the identity provider to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteIdentityProvider(identityProviderId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the key for the given Id.
*
* @param {UUID} keyId The Id of the key to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteKey(keyId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the lambda for the given Id.
*
* @param {UUID} lambdaId The Id of the lambda to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteLambda(lambdaId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the message template for the given Id.
*
* @param {UUID} messageTemplateId The Id of the message template to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteMessageTemplate(messageTemplateId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the messenger for the given Id.
*
* @param {UUID} messengerId The Id of the messenger to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteMessenger(messengerId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the user registration for the given user and application.
*
* @param {UUID} userId The Id of the user whose registration is being deleted.
* @param {UUID} applicationId The Id of the application to remove the registration for.
* @returns {Promise<ClientResponse<void>>}
*/
deleteRegistration(userId: UUID, applicationId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the user registration for the given user and application along with the given JSON body that contains the event information.
*
* @param {UUID} userId The Id of the user whose registration is being deleted.
* @param {UUID} applicationId The Id of the application to remove the registration for.
* @param {RegistrationDeleteRequest} request The request body that contains the event information.
* @returns {Promise<ClientResponse<void>>}
*/
deleteRegistrationWithRequest(userId: UUID, applicationId: UUID, request: RegistrationDeleteRequest): Promise<ClientResponse<void>>;
/**
* Deletes the tenant based on the given Id on the URL. This permanently deletes all information, metrics, reports and data associated
* with the tenant and everything under the tenant (applications, users, etc).
*
* @param {UUID} tenantId The Id of the tenant to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteTenant(tenantId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the tenant for the given Id asynchronously.
* This method is helpful if you do not want to wait for the delete operation to complete.
*
* @param {UUID} tenantId The Id of the tenant to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteTenantAsync(tenantId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the tenant based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
* with the tenant and everything under the tenant (applications, users, etc).
*
* @param {UUID} tenantId The Id of the tenant to delete.
* @param {TenantDeleteRequest} request The request object that contains all the information used to delete the user.
* @returns {Promise<ClientResponse<void>>}
*/
deleteTenantWithRequest(tenantId: UUID, request: TenantDeleteRequest): Promise<ClientResponse<void>>;
/**
* Deletes the theme for the given Id.
*
* @param {UUID} themeId The Id of the theme to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteTheme(themeId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated
* with the user.
*
* @param {UUID} userId The Id of the user to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteUser(userId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the user action for the given Id. This permanently deletes the user action and also any history and logs of
* the action being applied to any users.
*
* @param {UUID} userActionId The Id of the user action to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteUserAction(userActionId: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the user action reason for the given Id.
*
* @param {UUID} userActionReasonId The Id of the user action reason to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteUserActionReason(userActionReasonId: UUID): Promise<ClientResponse<void>>;
/**
* Remove an existing link that has been made from a 3rd party identity provider to a FusionAuth user.
*
* @param {UUID} identityProviderId The unique Id of the identity provider.
* @param {string} identityProviderUserId The unique Id of the user in the 3rd party identity provider to unlink.
* @param {UUID} userId The unique Id of the FusionAuth user to unlink.
* @returns {Promise<ClientResponse<IdentityProviderLinkResponse>>}
*/
deleteUserLink(identityProviderId: UUID, identityProviderUserId: string, userId: UUID): Promise<ClientResponse<IdentityProviderLinkResponse>>;
/**
* Deletes the user based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
* with the user.
*
* @param {UUID} userId The Id of the user to delete (required).
* @param {UserDeleteSingleRequest} request The request object that contains all the information used to delete the user.
* @returns {Promise<ClientResponse<void>>}
*/
deleteUserWithRequest(userId: UUID, request: UserDeleteSingleRequest): Promise<ClientResponse<void>>;
/**
* Deletes the users with the given ids, or users matching the provided JSON query or queryString.
* The order of preference is ids, query and then queryString, it is recommended to only provide one of the three for the request.
*
* This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body.
* Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.
*
* @param {UserDeleteRequest} request The UserDeleteRequest.
* @returns {Promise<ClientResponse<UserDeleteResponse>>}
*
* @deprecated This method has been renamed to deleteUsersByQuery, use that method instead.
*/
deleteUsers(request: UserDeleteRequest): Promise<ClientResponse<UserDeleteResponse>>;
/**
* Deletes the users with the given ids, or users matching the provided JSON query or queryString.
* The order of preference is ids, query and then queryString, it is recommended to only provide one of the three for the request.
*
* This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body.
* Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.
*
* @param {UserDeleteRequest} request The UserDeleteRequest.
* @returns {Promise<ClientResponse<UserDeleteResponse>>}
*/
deleteUsersByQuery(request: UserDeleteRequest): Promise<ClientResponse<UserDeleteResponse>>;
/**
* Deletes the WebAuthn credential for the given Id.
*
* @param {UUID} id The Id of the WebAuthn credential to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteWebAuthnCredential(id: UUID): Promise<ClientResponse<void>>;
/**
* Deletes the webhook for the given Id.
*
* @param {UUID} webhookId The Id of the webhook to delete.
* @returns {Promise<ClientResponse<void>>}
*/
deleteWebhook(webhookId: UUID): Promise<ClientResponse<void>>;
/**
* Disable two-factor authentication for a user.
*
* @param {UUID} userId The Id of the User for which you're disabling two-factor authentication.
* @param {string} methodId The two-factor method identifier you wish to disable
* @param {string} code The two-factor code used verify the the caller knows the two-factor secret.
* @returns {Promise<ClientResponse<void>>}
*/
disableTwoFactor(userId: UUID, methodId: string, code: string): Promise<ClientResponse<void>>;
/**
* Disable two-factor authentication for a user using a JSON body rather than URL parameters.
*
* @param {UUID} userId The Id of the User for which you're disabling two-factor authentication.
* @param {TwoFactorDisableRequest} request The request information that contains the code and methodId along with any event information.
* @returns {Promise<ClientResponse<void>>}
*/
disableTwoFactorWithRequest(userId: UUID, request: TwoFactorDisableRequest): Promise<ClientResponse<void>>;
/**
* Enable two-factor authentication for a user.
*
* @param {UUID} userId The Id of the user to enable two-factor authentication.
* @param {TwoFactorRequest} request The two-factor enable request information.
* @returns {Promise<ClientResponse<TwoFactorResponse>>}
*/
enableTwoFactor(userId: UUID, request: TwoFactorRequest): Promise<ClientResponse<TwoFactorResponse>>;
/**
* Exchanges an OAuth authorization code for an access token.
* Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token.
*
* @param {string} code The authorization code returned on the /oauth2/authorize response.
* @param {string} client_id (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate.
* This parameter is optional when Basic Authorization is used to authenticate this request.
* @param {string} client_secret (Optional) The client secret. This value will be required if client authentication is enabled.
* @param {string} redirect_uri The URI to redirect to upon a successful request.
* @returns {Promise<ClientResponse<AccessToken>>}
*/
exchangeOAuthCodeForAccessToken(code: string, client_id: string, client_secret: string, redirect_uri: string): Promise<ClientResponse<AccessToken>>;
/**
* Exchanges an OAuth authorization code and code_verifier for an access token.
* Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a code_verifier for an access token.
*
* @param {string} code The authorization code returned on the /oauth2/authorize response.
* @param {string} client_id (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
* This parameter is optional when Basic Authorization is used to authenticate this request.
* @param {string} client_secret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
* @param {string} redirect_uri The URI to redirect to upon a successful request.
* @param {string} code_verifier The random string generated previously. Will be compared with the code_challenge sent previously, which allows the OAuth provider to authenticate your app.
* @returns {Promise<ClientResponse<AccessToken>>}
*/
exchangeOAuthCodeForAccessTokenUsingPKCE(code: string, client_id: string, client_secret: string, redirect_uri: string, code_verifier: string): Promise<ClientResponse<AccessToken>>;
/**
* Exchange a Refresh Token for an Access Token.
* If you will be using the Refresh Token Grant, you will make a request to the Token endpoint to exchange the user’s refresh token for an access token.
*
* @param {string} refresh_token The refresh token that you would like to use to exchange for an access token.
* @param {string} client_id (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
* This parameter is optional when Basic Authorization is used to authenticate this request.
* @param {string} client_secret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
* @param {string} scope (Optional) This parameter is optional and if omitted, the same scope requested during the authorization request will be used. If provided the scopes must match those requested during the initial authorization request.
* @param {string} user_code (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization.
* @returns {Promise<ClientResponse<AccessToken>>}
*/
exchangeRefreshTokenForAccessToken(refresh_token: string, client_id: string, client_secret: string, scope: string, user_code: string): Promise<ClientResponse<AccessToken>>;
/**
* Exchange a refresh token for a new JWT.
*
* @param {RefreshRequest} request The refresh request.
* @returns {Promise<ClientResponse<JWTRefreshResponse>>}
*/
exchangeRefreshTokenForJWT(request: RefreshRequest): Promise<ClientResponse<JWTRefreshResponse>>;
/**
* Exchange User Credentials for a Token.
* If you will be using the Resource Owner Password Credential Grant, you will make a request to the Token endpoint to exchange the user’s email and password for an access token.
*
* @param {string} username The login identifier of the user. The login identifier can be either the email or the username.
* @param {string} password The user’s password.
* @param {string} client_id (Optional) The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate. This parameter is optional when the Authorization header is provided.
* This parameter is optional when Basic Authorization is used to authenticate this request.
* @param {string} client_secret (Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header.
* @param {string} scope (Optional) This parameter is optional and if omitted, the same scope requested during the authorization request will be used. If provided the scopes must match those requested during the initial authorization request.
* @param {string} user_code (Optional) The end-user verification code. This code is required if using this endpoint to approve the Device Authorization.
* @returns {Promise<ClientResponse<AccessToken>>}
*/
exchangeUserCredentialsForAccessToken(username: string, password: string, client_id: string, client_secret: string, scope: string, user_code: string): Promise<ClientResponse<AccessToken>>;
/**
* Begins the forgot password sequence, which kicks off an email to the user so that they can reset their password.
*
* @param {ForgotPasswordRequest} request The request that contains the information about the user so that they can be emailed.
* @returns {Promise<ClientResponse<ForgotPasswordResponse>>}
*/
forgotPassword(request: ForgotPasswordRequest): Promise<ClientResponse<ForgotPasswordResponse>>;
/**
* Generate a new Email Verification Id to be used with the Verify Email API. This API will not attempt to send an
* email to the User. This API may be used to collect the verificationId for use with a third party system.
*
* @param {string} email The email address of the user that needs a new verification email.
* @returns {Promise<ClientResponse<VerifyEmailResponse>>}
*/
generateEmailVerificationId(email: string): Promise<ClientResponse<VerifyEmailResponse>>;
/**
* Generate a new RSA or EC key pair or an HMAC secret.
*
* @param {UUID} keyId (Optional) The Id for the key. If not provided a secure random UUID will be generated.
* @param {KeyRequest} request The request object that contains all the inform