import { ChangePasswordRequest, DeduplicationLoginRequest, DeleteUserAccountRequest, GetDeduplicationDetailsRequest, GetInviteUserDetailsRequest, GetUserProfileRequest, HandleResetPasswordRequest, InitiateLinkAccountRequest, InitiateResetPasswordRequest, RegisterDeduplicationRequest, RegisterRequest, ResetPasswordRequest, UserCheckExistsRequest, CompleteLinkAccountRequest, GetCommunicationStatusRequest, GetRegistrationSetupRequest, GetUserActivitiesRequest, UpdateProfileImageRequest, UserActionOnEnrollmentRequest } from "./UserService.model"; import { HTTPRequestHeader } from "../common/Common.model"; import { CidaasUser } from "../common/User.model"; import ConfigUserProvider from "../common/ConfigUserProvider"; export declare class UserService { private config; private userManager; constructor(configUserProvider: ConfigUserProvider); /** * To get the user profile information by using cidaas internal api, call **getUserProfile()**. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2zfvjx3vtq6g6-get-user-info for more details. * @example * ```js * cidaasUserService.getUserProfile() * .then(function () { * // the response will give you user profile information. * }).catch(function (ex) { * // your failure code here * }); * ``` */ getUserProfile(options?: GetUserProfileRequest): Promise; /** * To handle registration, first you need the registration fields. To get the registration fields, call **getRegistrationSetup()**. This will return the fields that has to be needed while registration. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4eae72956f65a-registration-field-setup for more details. * @example * ```js * cidaasUserService.getRegistrationSetup({ * requestId: 'your requestId', * acceptlanguage: 'your locale' // optional example: de-de, en-US * }).then(function (resp) { * // the response will give you fields that are required. * }).catch(function(ex) { * // your failure code here * }); * ``` */ getRegistrationSetup(options: GetRegistrationSetupRequest): Promise; /** * To register user, call **register()**. This method will create a new user. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/427632e587203-register-a-new-user for more details. * Note: Only requestId in the headers is required. * @example * ```js * const headers = { * requestId: 'your_received_requestId', * captcha: 'captcha', * acceptlanguage: 'acceptlanguage', * bot_captcha_response: 'bot_captcha_response' * }; * * cidaasUserService.register({ * email: 'xxx123@xxx.com', * given_name: 'xxxxx', * family_name: 'yyyyy', * password: '123456', * password_echo: '123456', * provider: 'your provider', // FACEBOOK, GOOGLE, SELF * acceptlanguage: 'your locale' // optional example: de-de, en-US * }, headers).then(function (response) { * // the response will give you client registration details. * }).catch(function(ex) { * // your failure code here * }); *``` */ register(options: RegisterRequest, headers: HTTPRequestHeader): Promise; /** * to get information about invitation details, call **getInviteUserDetails()**. This API allows to retrieve invitation details and prefill the registration form. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/0b5efa5a2db5d-prefill-the-user-invitation for more details. * Minimum cidaas version to use latest api is v3.100 * @example * ```js * const options = { * invite_id: 'id of user invitation' * callLatestAPI: 'true' // call latest api if parameter is given. By default, the older api will be called * } * cidaasUserService.getInviteUserDetails(options) * .then(function () { * // the response will give you information about the invitation. * }).catch(function (ex) { * // your failure code here * }); * ``` */ getInviteUserDetails(options: GetInviteUserDetailsRequest, headers?: HTTPRequestHeader): Promise; /** * Once registration successful, verify the account based on the flow. To get the details, call **getCommunicationStatus()**. * @example * ```js * cidaasUserService.getCommunicationStatus({ * sub: 'your sub', // which you will get on the registration response * }).then(function (response) { * // the response will give you account details once its verified. * }).catch(function(ex) { * // your failure code here * }); * ``` */ getCommunicationStatus(options: GetCommunicationStatusRequest, headers?: HTTPRequestHeader): Promise; /** * To initiate the password resetting, call **initiateResetPassword()**. This will send verification code to your email or mobile based on the resetMedium you mentioned. * Please refer to the api document https://docs.cidaas.com/openapi/password-management/post-reset-password-initiate for more details. * @example * ```js * cidaasUserService.initiateResetPassword({ * email: 'xxxxxx@xxx.com', * processingType: ProcessingType.Code, * requestId: 'your requestId', * resetMedium: ResetMedium.Email * }).then(function (response) { * // the response will give you password reset details. * }).catch(function(ex) { * // your failure code here * }); * ``` */ initiateResetPassword(options: InitiateResetPasswordRequest, headers?: HTTPRequestHeader): Promise; /** * To handle the reset password by entering the verification code you received, call **handleResetPassword()**. This will check if your verification code was valid or not, and allows you to proceed to the next step. * Please refer to the api document https://docs.cidaas.com/openapi/password-management/post-reset-password-validatecode for more details. * @example * ```js * const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, the response information will be given as query parameter in redirect url.'; * cidaasUserService.handleResetPassword({ * code: 'your code in email or sms or ivr', * resetRequestId: 'your resetRequestId' // which you will get on initiate reset password response * }, handleResponseAsJson).then(function (response) { * // the response will give you valid verification code. * }).catch(function(ex) { * // your failure code here * }); * ``` */ handleResetPassword(options: HandleResetPasswordRequest, handleResponseAsJson?: boolean, headers?: HTTPRequestHeader): Promise; /** * To finish reseting the password, call **resetPassword()**. This will allow you to change your password. * Please refer to the api document https://docs.cidaas.com/openapi/password-management/post-reset-password-accept for more details. * @example * ```js * const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, user will be redirected to success page after successful reset password.'; * cidaasUserService.resetPassword({ * password: '123456', * confirmPassword: '123456', * exchangeId: 'your exchangeId', // which you will get on handle reset password response * resetRequestId: 'your resetRequestId' // which you will get on handle reset password response * }).then(function (response) { * // the response will give you reset password details. * }).catch(function(ex) { * // your failure code here * }); * ``` */ resetPassword(options: ResetPasswordRequest, handleResponseAsJson?: boolean, headers?: HTTPRequestHeader): Promise; /** * To get the list of existing users in deduplication, call **getDeduplicationDetails()**. * @example * ```js * cidaasUserService.getDeduplicationDetails({ * track_id: 'your track id' * }).then((response) => { * // the response will give you deduplication details of users. * }).catch((err) => { * // your failure code here * }); * ``` */ getDeduplicationDetails(options: GetDeduplicationDetailsRequest, headers?: HTTPRequestHeader): Promise; /** * To use the existing users in deduplication, you need to call **deduplicationLogin()**. * @example * ```js * cidaasUserService.deduplicationLogin({ * sub: 'your sub', * requestId: 'request id from deduplication initialisation after register', * trackId: 'track id from deduplication initialisation after register' * }) * ``` */ deduplicationLogin(options: DeduplicationLoginRequest): void; /** * To register new user in deduplication, call **registerDeduplication()**. * @example * ```js * cidaasUserService.registerDeduplication({ * track_id: 'track id from deduplication initialisation after register', * }).then((response) => { * // the response will give you new registered deduplication user. * }).catch((err) => { * // your failure code here * }); * ``` */ registerDeduplication(options: RegisterDeduplicationRequest, headers?: HTTPRequestHeader): Promise; /** * To change the password, call **changePassword()**. This will allow you to change your password. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/8221883241464-change-password for more details. * @example * ```js * cidaasUserService.changePassword({ * old_password: 'your old password', * new_password: 'your new password', * confirm_password: 'your new password', * sub: 'your sub', * }) * .then(function () { * // your success code * }).catch(function (ex) { * // your failure code * }); * ``` */ changePassword(options: ChangePasswordRequest, access_token?: string): Promise; /** * To update the user profile information, call **updateProfile()**. * After updating the user profile, the information in user storage won't be automatically updated. * To get the latest user profile information, you will need to call **getUserProfile()**. * To update the user storage, you will need to call **renewToken()** to generate latest tokens (access token, id token, refresh token) & user informations. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/i3uqnxcpxr19r-update-user-profile for more details. * @example * ```js * cidaasUserService.updateProfile({ * family_name: 'Doe', * given_name: 'John', * provider: 'self', * acceptlanguage: 'your locale' // optional example: de-de, en-US * }, 'your sub' ).then(function () { * // the response will give you updated user profile info. * }).catch(function (ex) { * // your failure code here * }); * ``` */ updateProfile(options: CidaasUser, sub: string, access_token?: string): Promise; /** * To initiate account linking, call **initiateLinkAccount()**. * @example * ```js * const options = { * master_sub: 'sub of the user who initiates the user link', * user_name_to_link: 'username of the user which should get linked', * user_name_type: 'type of user name to link. E.g. email' * } * cidaasUserService.initiateLinkAccount(options).then((response) => { * // your success code * }).catch((err) => { * // your failure code here * }); * ``` */ initiateLinkAccount(options: InitiateLinkAccountRequest, access_token?: string): Promise; /** * To complete account linking, call **completeLinkAccount()**. * @example * ```js * const options = { * code: 'code which is sent to account to be linked', * link_request_id: 'comes from initiateLinkAccount' * } * cidaasUserService.completeLinkAccount(options).then((response) => { * // your success code * }).catch((err) => { * // your failure code here * }); * ``` */ completeLinkAccount(options: CompleteLinkAccountRequest, access_token?: string): Promise; /** * To get all the linked accounts, call **getLinkedUsers()**. * @example * ```js * const sub = 'your sub'; * * cidaasUserService.getLinkedUsers(sub) * .then(function (response) { * // type your code here * }) * .catch(function (ex) { * // your failure code here * }); * ``` */ getLinkedUsers(sub: string, access_token?: string): Promise; /** * To unlink an account for a user, call **unlinkAccount()**. * @example * ```js * const identityId = "comes from getLinkedUsers"; * * cidaasUserService.unlinkAccount(undefined, identityId) * .then(function (response) { * // type your code here * }) * .catch(function (ex) { * // your failure code here * }); * ``` */ unlinkAccount(access_token: string | undefined, identityId: string): Promise; /** * To delete the user account directly in the application, call **deleteUserAccount()**. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/x133xdifl1sx9-schedule-user-deletion for more details. * @example * ```js * options = { * sub: "your sub" * } * * cidaasUserService.deleteUserAccount(options).then(function (response) { * // your success code * }).catch(function(ex) { * // your failure code here * }); * ``` */ deleteUserAccount(options: DeleteUserAccountRequest): Promise; /** * To check if user exists, call **userCheckExists()**. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4yh82qism78xf-find-user-by-identifier for more details. * @example * options = { * requestId: "your request id", * email: "your email" * } * * cidaasUserService.userCheckExists(options).then(function (response) { * // your success code * }).catch(function(ex) { * // your failure code here * }); * ``` */ userCheckExists(options: UserCheckExistsRequest, headers?: HTTPRequestHeader): Promise; /** * To get user activities, call **getUserActivities()**. * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/346141453781e-get-user-activities for more details. * @example * ```js * const options = { * sub: 'your sub', * dateFilter: { * from_date: 'date in UTC format', * to:date: 'date in UTC format' * } * }; * cidaasUserService.getUserActivities(options).then(function (resp) { * // your success code * }).catch(function(ex) { * // your failure code * }); * ``` */ getUserActivities(options: GetUserActivitiesRequest, access_token?: string): Promise; /** * To change profile image, call **updateProfileImage()**. * @example * ```js * const options = { * image_key: 'id for your image e.g. user sub', * photo: yourImageFile, * filename: 'name of your image file' * }; * cidaasUserService.updateProfileImage(options).then(function (resp) { * // your success code * }).catch(function(ex) { * // your failure code * }); * ``` */ updateProfileImage(options: UpdateProfileImageRequest, access_token?: string): Promise; /** * To run predefined action after enrollment, call userActionOnEnrollment() * @param options * @param trackId * @example * ```js * const options = { * action: 'predefined action' * }; * cidaasUserService.userActionOnEnrollment(options, 'trackId'); */ userActionOnEnrollment(options: UserActionOnEnrollmentRequest, trackId: string): Promise; }