baasic-sdk-javascript
Version:
JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).
61 lines (60 loc) • 2.89 kB
TypeScript
/**
* @module passwordRecoveryClient
* @description Password Recovery Client provides an easy way to consume Password Recovery REST API end-points. In order to obtain needed routes `passwordRecoveryClient` uses `passwordRecoveryRoute`.
*/
import { ApiClient, IHttpResponse } from '../../httpApi';
import { PasswordRecoveryRoute } from './';
import { IRequestPasswordReset, IResetPassword } from './contracts';
export declare class PasswordRecoveryClient {
protected passwordRecoveryRoute: PasswordRecoveryRoute;
protected apiClient: ApiClient;
/**
* Provides direct access to `passwordRecoveryRoute`.
* @method
* @example passwordRecoveryClient.routeDefinition.requestReset(data);
**/
readonly routeDefinition: PasswordRecoveryRoute;
constructor(passwordRecoveryRoute: PasswordRecoveryRoute, apiClient: ApiClient);
/**
* Returns a promise that is resolved once the password recovery requestReset action is completed. This action initiates the password recovery process for the user.
* @method
* @param data A password recovery object which contains parameters required for the password retrieval request.
* @example passwordRecoveryClient.requestReset({
challengeIdentifier : '<challenge-identifier>',
challengeResponse : '<challenge-response>',
recoverUrl : '<recover-url>',
username : '<username>'
})
.then(function () {
// perform success action here
},
function (data) {
// perform error handling here
})
.finally (function () {});
*/
requestReset(data: IRequestPasswordReset): PromiseLike<IHttpResponse<any>>;
/**
* Returns a promise that is resolved once the password reset action is completed. This updates user's password selection.
* @method
* @param data Password recovery object used to update user's current password selection.
* @example passwordRecoveryClient.reset({
newPassword : '<new-password>',
passwordRecoveryToken : '<password-recovery-token>'
})
.then(function () {
// perform success action here
},
function (data) {
// perform error handling here
})
.finally (function () {});
*/
reset(data: IResetPassword): PromiseLike<IHttpResponse<any>>;
}
/**
* @overview
***Notes:**
- Refer to the [Baasic REST API](http://dev.baasic.com/api/reference/home) for detailed information about available Baasic REST API end-points.
- All end-point objects are transformed by the associated route service.
*/