Optional
realtime: RealtimeChanges password for current user.
Returns a result object. During this action if preferred login mode is OAI_SECURE new jwt cookie will be set.
New password for current user.
The password of the currently logged user.
Changes password for user.
Returns a result object.
User's id or user object.
New user password.
The password of the currently logged user.
Creates a new user.
Returns promise object that is resolved with the details of newly created user.
Example
const userObject: IUser = {
userName: "newUser",
password: "userPassword12!@"
};
(async () => {
const {data, res} = await userService.create(userObject);
})();
User object.
Gets user that is currently logged in with the list of all roles assigned.
Returns promise object that is resolved with the ICurrenUser wrapped by IResult.
Example
(async () => {
const {data, res} = await userService.currentWithEffectiveRoles();
})();
Removes user.
Returns promise object that is resolved with the IResult of null.
Example
const userId: string = "uniqueUserId";
(async () => {
const {data, res} = await userService.delete(userGroupId);
})();
User's id or user object.
Gets the details of given user.
Returns promise object that is resolved with the IUser wrapped by IResult.
Example
const userId: number = 1;
(async () => {
const {data, res} = await userService.detail(userId);
})();
User password is never returned in GET response. Authentication mechanism is provided by another interface.
User's id or user object.
Generates a secret which can be used to setup two-factor authentication with TOTP.
Returns the secret and an URL to a QR Code.
Example
(async () => {
const {data, res} = await userService.generateTotpSecret();
console.log(secret);
})();
Checks if TOTP is activated and enforced.
Returns an object of ITotpStatus if it is active.
Example
(async () => {
const {data, res} = await userService.getActivityTotp();
console.log(data.isActive);
})();
Create instance of User Inventory Role Service related with given User.
Returns UserInventoryRoleService object that is related with given User.
Example
const userId: string = "uniqueUserId";
const userInventoryRoleService = userService.inventoryAssignment(userGroupId);
(async () => {
const {data, res} = await userInventoryRoleService.create(...);
})();
User's id or user object.
Gets the list of users filtered by parameters.
Returns promise object that is resolved with the IUser wrapped by IResultList.
Example
const filter: object = {
pageSize: 100,
withTotalPages: true
};
(async () => {
const {data, res, paging} = await userService.list(filter);
})();
Object containing filters for querying users.
Resets user's password to a new one.
Returns a request result object.
Example
const newPassword: IResetPassword = {
token: '123123ASDAWERER@#!WEDS$@#!WADA#A#EA#EA#EA',
email: 'user@example.com',
newPassword: 'myNewPassword',
passwordStrength: PasswordStrength.GREEN
};
const tenantId = 't123456';
(async () => {
const { res, data } = await userService.resetPassword(newPassword, tenantId);
})();
Object with token, user's email, new password and its strength indicator.
Optional
tenantId: stringThe id of user's tenant (if cannot be inferred from URL).
Saves phone number for the current user.
Server response and data with updated current user object.
Phone number to save.
Sends an email message with a link allowing user to reset their password.
Returns a request result object.
Example
const email = 'user@example.com';
const tenantId = 't123456';
(async () => {
const { res, data } = await userService.sendPasswordResetMail(email, tenantId);
})();
The email address to send the message to.
Optional
tenantId: stringThe id of user's tenant (if cannot be inferred from URL).
Updates user data.
Returns promise object that is resolved with the saved user object.
Example
const partialUpdateObject: Partial<IUser> = {
"id" : "myuser",
"userName" : "newUserName",
"email": "newUserEmail@example.com"
...
}
(async () => {
const {data, res} = await userService.update(partialUpdateObject);
})();
When user is updated with changed permissions or groups, suitable audit record is created with type 'User' and activity 'User updated'.
User is partially updatable.
Verifies TFA code which is sent via SMS. If invoked with string '0', new TFA code will be sent.
Returns a status object.
Example
(async () => {
const {data, res} = await userService.verifyTFACode('123123');
})();
The code to verify.
Description
This service allows for managing users.