Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 59 additions & 59 deletions src/FusionAuthClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class FusionAuthClient {
/**
* 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.
*
Expand Down Expand Up @@ -178,7 +178,7 @@ export class FusionAuthClient {
* 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.
Expand All @@ -196,7 +196,7 @@ export class FusionAuthClient {
* 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).
Expand All @@ -214,7 +214,7 @@ export class FusionAuthClient {
* 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.
Expand Down Expand Up @@ -310,9 +310,9 @@ export class FusionAuthClient {

/**
* 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
* 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.
Expand Down Expand Up @@ -1332,7 +1332,7 @@ export class FusionAuthClient {
/**
* 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.
*
Expand All @@ -1352,7 +1352,7 @@ export class FusionAuthClient {
/**
* 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.
*
Expand Down Expand Up @@ -1636,7 +1636,7 @@ export class FusionAuthClient {
}

/**
* Generate two-factor recovery codes for a user. Generating two-factor recovery codes will invalidate any existing recovery codes.
* Generate two-factor recovery codes for a user. Generating two-factor recovery codes will invalidate any existing recovery codes.
*
* @param {UUID} userId The Id of the user to generate new Two Factor recovery codes.
* @returns {Promise<ClientResponse<TwoFactorRecoveryCodeResponse>>}
Expand Down Expand Up @@ -1716,7 +1716,7 @@ export class FusionAuthClient {
* Bulk imports refresh tokens. This request performs minimal validation and runs batch inserts of refresh tokens with the
* expectation that each token represents a user that already exists and is registered for the corresponding FusionAuth
* Application. This is done to increases the insert performance.
*
*
* Therefore, if you encounter an error due to a database key violation, the response will likely offer a generic
* explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
* body with specific validation errors. This will slow the request down but will allow you to identify the cause of
Expand All @@ -1737,7 +1737,7 @@ export class FusionAuthClient {
* Bulk imports users. This request performs minimal validation and runs batch inserts of users with the expectation
* that each user does not yet exist and each registration corresponds to an existing FusionAuth Application. This is done to
* increases the insert performance.
*
*
* Therefore, if you encounter an error due to a database key violation, the response will likely offer
* a generic explanation. If you encounter an error, you may optionally enable additional validation to receive a JSON response
* body with specific validation errors. This will slow the request down but will allow you to identify the cause of the failure. See
Expand Down Expand Up @@ -1829,8 +1829,8 @@ export class FusionAuthClient {
}

/**
* Authenticates a user to FusionAuth.
*
* Authenticates a user to FusionAuth.
*
* This API optionally requires an API key. See <code>Application.loginConfiguration.requireAuthentication</code>.
*
* @param {LoginRequest} request The login request that contains the user credentials used to log them in.
Expand Down Expand Up @@ -2361,7 +2361,7 @@ export class FusionAuthClient {

/**
* Request a refresh of the Entity search index. This API is not generally necessary and the search index will become consistent in a
* reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be
* reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be
* if you are using the Search API or Delete Tenant API immediately following a Entity Create etc, you may wish to request a refresh to
* ensure the index immediately current before making a query request to the search index.
*
Expand All @@ -2376,7 +2376,7 @@ export class FusionAuthClient {

/**
* Request a refresh of the User search index. This API is not generally necessary and the search index will become consistent in a
* reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be
* reasonable amount of time. There may be scenarios where you may wish to manually request an index refresh. One example may be
* if you are using the Search API or Delete Tenant API immediately following a User Create etc, you may wish to request a refresh to
* ensure the index immediately current before making a query request to the search index.
*
Expand Down Expand Up @@ -2422,10 +2422,10 @@ export class FusionAuthClient {
}

/**
* Requests Elasticsearch to delete and rebuild the index for FusionAuth users or entities. Be very careful when running this request as it will
* increase the CPU and I/O load on your database until the operation completes. Generally speaking you do not ever need to run this operation unless
* instructed by FusionAuth support, or if you are migrating a database another system and you are not brining along the Elasticsearch index.
*
* Requests Elasticsearch to delete and rebuild the index for FusionAuth users or entities. Be very careful when running this request as it will
* increase the CPU and I/O load on your database until the operation completes. Generally speaking you do not ever need to run this operation unless
* instructed by FusionAuth support, or if you are migrating a database another system and you are not brining along the Elasticsearch index.
*
* You have been warned.
*
* @param {ReindexRequest} request The request that contains the index name.
Expand Down Expand Up @@ -2937,8 +2937,8 @@ export class FusionAuthClient {
}

/**
* Retrieves one or more identity provider for the given type. For types such as Google, Facebook, Twitter and LinkedIn, only a single
* identity provider can exist. For types such as OpenID Connect and SAMLv2 more than one identity provider can be configured so this request
* Retrieves one or more identity provider for the given type. For types such as Google, Facebook, Twitter and LinkedIn, only a single
* identity provider can exist. For types such as OpenID Connect and SAMLv2 more than one identity provider can be configured so this request
* may return multiple identity providers.
*
* @param {IdentityProviderType} type The type of the identity provider.
Expand Down Expand Up @@ -3268,9 +3268,9 @@ export class FusionAuthClient {
}

/**
* Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided
* Retrieves the password validation rules for a specific tenant. This method requires a tenantId to be provided
* through the use of a Tenant scoped API key or an HTTP header X-FusionAuth-TenantId to specify the Tenant Id.
*
*
* This API does not require an API key.
*
* @returns {Promise<ClientResponse<PasswordValidationRulesResponse>>}
Expand All @@ -3284,7 +3284,7 @@ export class FusionAuthClient {

/**
* Retrieves the password validation rules for a specific tenant.
*
*
* This API does not require an API key.
*
* @param {UUID} tenantId The Id of the tenant.
Expand Down Expand Up @@ -3432,7 +3432,7 @@ export class FusionAuthClient {
}

/**
* Retrieve the status of a re-index process. A status code of 200 indicates the re-index is in progress, a status code of
* Retrieve the status of a re-index process. A status code of 200 indicates the re-index is in progress, a status code of
* 404 indicates no re-index is in progress.
*
* @returns {Promise<ClientResponse<void>>}
Expand Down Expand Up @@ -3537,7 +3537,7 @@ export class FusionAuthClient {

/**
* Retrieve a user's two-factor status.
*
*
* This can be used to see if a user will need to complete a two-factor challenge to complete a login,
* and optionally identify the state of the two-factor trust across various applications.
*
Expand Down Expand Up @@ -3698,7 +3698,7 @@ export class FusionAuthClient {

/**
* Retrieve a user_code that is part of an in-progress Device Authorization Grant.
*
*
* This API is useful if you want to build your own login workflow to complete a device grant.
*
* @param {string} client_id The client id.
Expand All @@ -3721,9 +3721,9 @@ export class FusionAuthClient {

/**
* Retrieve a user_code that is part of an in-progress Device Authorization Grant.
*
*
* This API is useful if you want to build your own login workflow to complete a device grant.
*
*
* This request will require an API key.
*
* @param {string} user_code The end-user verification code.
Expand Down Expand Up @@ -3972,24 +3972,24 @@ export class FusionAuthClient {

/**
* Revokes refresh tokens.
*
*
* Usage examples:
* - Delete a single refresh token, pass in only the token.
* revokeRefreshToken(token)
*
*
* - Delete all refresh tokens for a user, pass in only the userId.
* revokeRefreshToken(null, userId)
*
*
* - Delete all refresh tokens for a user for a specific application, pass in both the userId and the applicationId.
* revokeRefreshToken(null, userId, applicationId)
*
*
* - Delete all refresh tokens for an application
* revokeRefreshToken(null, null, applicationId)
*
*
* Note: <code>null</code> may be handled differently depending upon the programming language.
*
*
* See also: (method names may vary by language... but you'll figure it out)
*
*
* - revokeRefreshTokenById
* - revokeRefreshTokenByToken
* - revokeRefreshTokensByUserId
Expand Down Expand Up @@ -4593,11 +4593,11 @@ export class FusionAuthClient {
}

/**
* Start a Two-Factor login request by generating a two-factor identifier. This code can then be sent to the Two Factor Send
* API (/api/two-factor/send)in order to send a one-time use code to a user. You can also use one-time use code returned
* to send the code out-of-band. The Two-Factor login is completed by making a request to the Two-Factor Login
* Start a Two-Factor login request by generating a two-factor identifier. This code can then be sent to the Two Factor Send
* API (/api/two-factor/send)in order to send a one-time use code to a user. You can also use one-time use code returned
* to send the code out-of-band. The Two-Factor login is completed by making a request to the Two-Factor Login
* API (/api/two-factor/login). with the two-factor identifier and the one-time use code.
*
*
* This API is intended to allow you to begin a Two-Factor login outside a normal login that originated from the Login API (/api/login).
*
* @param {TwoFactorStartRequest} request The Two-Factor start request that contains all the information used to begin the Two-Factor login request.
Expand Down Expand Up @@ -5170,13 +5170,13 @@ export class FusionAuthClient {

/**
* It's a JWT vending machine!
*
* Issue a new access token (JWT) with the provided claims in the request. This JWT is not scoped to a tenant or user, it is a free form
*
* Issue a new access token (JWT) with the provided claims in the request. This JWT is not scoped to a tenant or user, it is a free form
* token that will contain what claims you provide.
* <p>
* The iat, exp and jti claims will be added by FusionAuth, all other claims must be provided by the caller.
*
* If a TTL is not provided in the request, the TTL will be retrieved from the default Tenant or the Tenant specified on the request either
*
* If a TTL is not provided in the request, the TTL will be retrieved from the default Tenant or the Tenant specified on the request either
* by way of the X-FusionAuth-TenantId request header, or a tenant scoped API key.
*
* @param {JWTVendRequest} request The request that contains all the claims for this JWT.
Expand Down Expand Up @@ -5208,11 +5208,11 @@ export class FusionAuthClient {
}

/**
* Confirms a user's email address.
*
* The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
* the tenant is configured to gate a user until their email address is verified, this procedures requires two values instead of one.
* The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
* Confirms a user's email address.
*
* The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
* the tenant is configured to gate a user until their email address is verified, this procedures requires two values instead of one.
* The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
* two values together are able to confirm a user's email address and mark the user's email address as verified.
*
* @param {VerifyEmailRequest} request The request that contains the verificationId and optional one-time use code paired with the verificationId.
Expand All @@ -5228,7 +5228,7 @@ export class FusionAuthClient {

/**
* Administratively verify a user's email address. Use this method to bypass email verification for the user.
*
*
* The request body will contain the userId to be verified. An API key is required when sending the userId in the request body.
*
* @param {VerifyEmailRequest} request The request that contains the userId to verify.
Expand Down Expand Up @@ -5260,11 +5260,11 @@ export class FusionAuthClient {
}

/**
* Confirms a user's registration.
*
* The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
* the application is configured to gate a user until their registration is verified, this procedures requires two values instead of one.
* The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
* Confirms a user's registration.
*
* The request body will contain the verificationId. You may also be required to send a one-time use code based upon your configuration. When
* the application is configured to gate a user until their registration is verified, this procedures requires two values instead of one.
* The verificationId is a high entropy value and the one-time use code is a low entropy value that is easily entered in a user interactive form. The
* two values together are able to confirm a user's registration and mark the user's registration as verified.
*
* @param {VerifyRegistrationRequest} request The request that contains the verificationId and optional one-time use code paired with the verificationId.
Expand Down Expand Up @@ -11070,10 +11070,10 @@ export interface TwoFactorResponse {
}

export interface LambdaConfiguration {
accessTokenPopulateId?: UUID;
idTokenPopulateId?: UUID;
samlv2PopulateId?: UUID;
selfServiceRegistrationValidationId?: UUID;
accessTokenPopulateId?: UUID | null;
idTokenPopulateId?: UUID | null;
samlv2PopulateId?: UUID | null;
selfServiceRegistrationValidationId?: UUID | null;
}

/**
Expand Down