UNPKG

@fusionauth/typescript-client

Version:
820 lines 357 kB
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>>; /** * Approve a device grant. * * @param {DeviceApprovalRequest} request The request object containing the device approval information and optional tenantId. * @returns {Promise<ClientResponse<DeviceApprovalResponse>>} */ approveDeviceWithRequest(request: DeviceApprovalRequest): 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 access token (JWT) instead of the changePasswordId * A common use case for this method will be if you want to allow the user to change their own password. * * Remember to send refreshToken in the request body if you want to get a new refresh token when login using the returned oneTimePassword. * * @param {string} encodedJWT The encoded JWT (access token). * @param {ChangePasswordRequest} request The change password request that contains all the information used to change the password. * @returns {Promise<ClientResponse<ChangePasswordResponse>>} * * @deprecated This method has been renamed to changePasswordUsingJWT, use that method instead. */ changePasswordByJWT(encodedJWT: string, request: ChangePasswordRequest): Promise<ClientResponse<ChangePasswordResponse>>; /** * Changes a user's password using their identity (loginId 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>>; /** * Changes a user's password using their access token (JWT) instead of the changePasswordId * A common use case for this method will be if you want to allow the user to change their own password. * * Remember to send refreshToken in the request body if you want to get a new refresh token when login using the returned oneTimePassword. * * @param {string} encodedJWT The encoded JWT (access token). * @param {ChangePasswordRequest} request The change password request that contains all the information used to change the password. * @returns {Promise<ClientResponse<ChangePasswordResponse>>} */ changePasswordUsingJWT(encodedJWT: string, request: ChangePasswordRequest): Promise<ClientResponse<ChangePasswordResponse>>; /** * 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} 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 {string} ipAddress (Optional) IP address of the user changing their password. This is used for MFA risk assessment. * @returns {Promise<ClientResponse<void>>} */ checkChangePasswordUsingIdAndIPAddress(changePasswordId: string, ipAddress: 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 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). * @param {string} ipAddress (Optional) IP address of the user changing their password. This is used for MFA risk assessment. * @returns {Promise<ClientResponse<void>>} */ checkChangePasswordUsingJWTAndIPAddress(encodedJWT: string, ipAddress: 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 (email or username) of the User that you intend to change the password for. * @returns {Promise<ClientResponse<void>>} */ checkChangePasswordUsingLoginId(loginId: 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 (email or username) of the User that you intend to change the password for. * @param {string} ipAddress (Optional) IP address of the user changing their password. This is used for MFA risk assessment. * @returns {Promise<ClientResponse<void>>} */ checkChangePasswordUsingLoginIdAndIPAddress(loginId: string, ipAddress: 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. * @param {Array<String>} loginIdTypes The identity types that FusionAuth will compare the loginId to. * @returns {Promise<ClientResponse<void>>} */ checkChangePasswordUsingLoginIdAndLoginIdTypes(loginId: string, loginIdTypes: Array<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. * @param {Array<String>} loginIdTypes The identity types that FusionAuth will compare the loginId to. * @param {string} ipAddress (Optional) IP address of the user changing their password. This is used for MFA risk assessment. * @returns {Promise<ClientResponse<void>>} */ checkChangePasswordUsingLoginIdAndLoginIdTypesAndIPAddress(loginId: string, loginIdTypes: Array<String>, ipAddress: 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:&lt;target-entity-id&gt;:&lt;roles&gt;. Roles are an optional comma separated list. * @returns {Promise<ClientResponse<AccessToken>>} */ clientCredentialsGrant(client_id: string, client_secret: string, scope: string): Promise<ClientResponse<AccessToken>>; /** * Make a Client Credentials grant request to obtain an access token. * * @param {ClientCredentialsGrantRequest} request The client credentials grant request containing client authentication, scope and optional tenantId. * @returns {Promise<ClientResponse<AccessToken>>} */ clientCredentialsGrantWithRequest(request: ClientCredentialsGrantRequest): 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<UserCommentResponse>>} */ commentOnUser(request: UserCommentRequest): Promise<ClientResponse<UserCommentResponse>>; /** * Completes verification of an identity using verification codes from the Verify Start API. * * @param {VerifyCompleteRequest} request The identity verify complete request that contains all the information used to verify the identity. * @returns {Promise<ClientResponse<VerifyCompleteResponse>>} */ completeVerifyIdentity(request: VerifyCompleteRequest): Promise<ClientResponse<VerifyCompleteResponse>>; /** * 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 new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for. * You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated. * * @param {UUID} applicationId The Id of the application to create the OAuth scope on. * @param {UUID} scopeId (Optional) The Id of the OAuth scope. If not provided a secure random UUID will be generated. * @param {ApplicationOAuthScopeRequest} request The request object that contains all the information used to create the OAuth OAuth scope. * @returns {Promise<ClientResponse<ApplicationOAuthScopeResponse>>} */ createOAuthScope(applicationId: UUID, scopeId: UUID, request: ApplicationOAuthScopeRequest): Promise<ClientResponse<ApplicationOAuthScopeResponse>>; /** * 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 tenant manager identity provider type configuration for the given identity provider type. * * @param {IdentityProviderType} type The type of the identity provider. * @param {TenantManagerIdentityProviderTypeConfigurationRequest} request The request object that contains all the information used to create the tenant manager identity provider type configuration. * @returns {Promise<ClientResponse<TenantManagerIdentityProviderTypeConfigurationResponse>>} */ createTenantManagerIdentityProviderTypeConfiguration(type: IdentityProviderType, request: TenantManagerIdentityProviderTypeConfigurationRequest): Promise<ClientResponse<TenantManagerIdentityProviderTypeConfigurationResponse>>; /** * 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 that the role belongs to. * @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>>; /** * Hard deletes a custom OAuth scope. * OAuth workflows that are still requesting the deleted OAuth scope may fail depending on the application's unknown scope policy. * * @param {UUID} applicationId The Id of the application that the OAuth scope belongs to. * @param {UUID} scopeId The Id of the OAuth scope to delete. * @returns {Promise<ClientResponse<void>>} */ deleteOAuthScope(applicationId: UUID, scopeId: 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 manager identity provider type configuration for the given identity provider type. * * @param {IdentityProviderType} type The type of the identity provider. * @returns {Promise<ClientResponse<void>>} */ deleteTenantManagerIdentityProviderTypeConfiguration(type: IdentityProviderType): 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