UNPKG

ordercloud-javascript-sdk

Version:

The offical Javascript SDK for the Ordercloud ecommerce API

68 lines (67 loc) 4.67 kB
import { OneTimePasswordRequest } from '../models/OneTimePasswordRequest'; import { PasswordResetRequest } from '../models/PasswordResetRequest'; import { PasswordReset } from '../models/PasswordReset'; import { RequestOptions } from '../models/RequestOptions'; declare class ForgottenCredentials { private impersonating; /** * @ignore * not part of public api, don't include in generated docs */ constructor(); /** * Send an one time password * Check out the {@link https://ordercloud.io/api-reference/authentication-and-authorization/forgotten-credentials/send-one-time-password|api docs} for more info * * @param oneTimePasswordRequest Required fields: ClientID * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ SendOneTimePassword(oneTimePasswordRequest: OneTimePasswordRequest, requestOptions?: RequestOptions): Promise<void>; /** * Send a verification code Sends a temporary verification code via email, which must subsequently be passed in a Reset Password call. The verification code expires in 120 minutes. * Check out the {@link https://ordercloud.io/api-reference/authentication-and-authorization/forgotten-credentials/send-verification-code|api docs} for more info * * @param passwordResetRequest Required fields: ClientID * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ SendVerificationCode(passwordResetRequest: PasswordResetRequest, requestOptions?: RequestOptions): Promise<void>; /** * Reset a password by verification code * Check out the {@link https://ordercloud.io/api-reference/authentication-and-authorization/forgotten-credentials/reset-password-by-verification-code|api docs} for more info * * @param verificationCode Verification code of the password reset. * @param passwordReset Required fields: ClientID, Username * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ ResetPasswordByVerificationCode(verificationCode: string, passwordReset: PasswordReset, requestOptions?: RequestOptions): Promise<void>; /** * Retrieve a username Sends an email with username for every username associated with an email. Always returns a 200 success regardless of if email doesn’t exist in the clientID. * Check out the {@link https://ordercloud.io/api-reference/authentication-and-authorization/forgotten-credentials/retrieve-username|api docs} for more info * * @param listOptions.clientID ID of the client. * @param listOptions.email Email of the forgotten credentials. * @param requestOptions.accessToken Provide an alternative token to the one stored in the sdk instance (useful for impersonation). * @param requestOptions.cancelToken Provide an [axios cancelToken](https://github.com/axios/axios#cancellation) that can be used to cancel the request. * @param requestOptions.requestType Provide a value that can be used to identify the type of request. Useful for error logs. */ RetrieveUsername(listOptions?: { clientID?: string; email?: string; }, requestOptions?: RequestOptions): Promise<void>; /** * @description * enables impersonation by calling the subsequent method with the stored impersonation token * * @example * ForgottenCredentials.As().List() // lists ForgottenCredentials using the impersonated users' token */ As(): this; } declare const _default: ForgottenCredentials; export default _default;