Optional
realtime: RealtimeVerifies TFA code which is generated by a TOTP app.
Returns a status object.
Example
(async () => {
const {data, res} = await userService.activateTotp();
})();
Changes password for current user.
New password for current user.
The password of the currently logged user.
Returns a result object. During this action if preferred login mode is OAI_SECURE new jwt cookie will be set.
Creates a new user.
User object.
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);
})();
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.
User's id or user object.
Returns promise object that is resolved with the IResult of null.
Example
const userId: string = "uniqueUserId";
(async () => {
const {data, res} = await userService.delete(userGroupId);
})();
Gets the details of given user.
User's id or user object.
Additional query params.
Returns promise object that is resolved with the IUser wrapped by IResult.
Example
const userId: number = 1;
const params = { withCertificates: true };
(async () => {
const { data, res } = await userService.detail(userId, params);
})();
User password is never returned in GET response. Authentication mechanism is provided by another interface.
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);
})();
Gets the list of emails of users subscribed for newsletter on the current tenant and its subtenants.
Server response and data with email addresses as plain text.
Create instance of User Inventory Role Service related with given User.
User's id or user object.
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(...);
})();
Gets the list of users filtered by parameters.
Object containing filters for querying users.
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);
})();
Resets user's password to a new one.
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).
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);
})();
Revoke tokens for all users. All users logged with "OAI-Secure" or "Single sign-on redirect" will be logged out.
Returns a result object.
Saves phone number for the current user.
Phone number to save.
Server response and data with updated current user object.
Sends an email message with a link allowing user to reset their password.
The email address to send the message to.
Optional
tenantId: stringThe id of user's tenant (if cannot be inferred from URL).
Returns a request result object.
Example
const email = 'user@example.com';
const tenantId = 't123456';
(async () => {
const { res, data } = await userService.sendPasswordResetMail(email, tenantId);
})();
Updates user data.
User is partially updatable.
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'.
Verifies TFA code which is sent via SMS. If invoked with string '0', new TFA code will be sent.
The code to verify.
Returns a status object.
Example
(async () => {
const {data, res} = await userService.verifyTFACode('123123');
})();
Verifies TFA code which is generated by a TOTP app.
The code to verify.
Returns a status object.
Example
(async () => {
const {data, res} = await userService.verifyTotpCode('123123');
})();
Description
This service allows for managing users.