Home Reference Source
import {User} from '@quobis/sippojs'
public class | source

User

Represents a user. This class must not be directly instantiated. Instead, instances of this class are obtained by calling to session#getUser

Member Summary

Public Members
public get

User's alias

public get

User's capabilities

public get

When the user was created (milliseconds)

public get

The domain of this user

public get

User's email

public get

The unique identifier of this user

public get

User's landLineNumber

public get

User's lastLogin

public get

User's mobile phone

public get

User's role. One of them: "anonymous", "user", "admin"

public get

The username of this user

Method Summary

Public Methods
public

Returns the address of this user as <user>@<domain>

public

Returns a JS object with the JSON serialization representation of this object

public

update(objToUpdate: Object): Promise<User>

Update an user

public

Check if a code is right to update a phone

Public Members

public get alias: string source

User's alias

public get capabilities: Array source

User's capabilities

public get created: number source

When the user was created (milliseconds)

public get domain: string source

The domain of this user

public get email: string source

User's email

public get id: string source

The unique identifier of this user

public get landLineNumber: string source

User's landLineNumber

public get lastLogin: number source

User's lastLogin

public get mobilePhone: Array source

User's mobile phone

public get role: string source

User's role. One of them: "anonymous", "user", "admin"

public get username: string source

The username of this user

Public Methods

public getAddress(): string source

Returns the address of this user as <user>@<domain>

Return:

string

The user address

public toJSON(): Object source

Returns a JS object with the JSON serialization representation of this object

Return:

Object

Return Properties:

NameTypeAttributeDescription
id String
domain String
username String
email String
created Number
lastLogin Number
role String
capabilities Array
mobilePhone Array
landLineNumber String
alias String

public update(objToUpdate: Object): Promise<User> source

Update an user

Params:

NameTypeAttributeDescription
objToUpdate Object

Data that will be used to update an user

objToUpdate.email String
  • optional
objToUpdate.mobilePhone Array
  • optional
objToUpdate.landLineNumber String
  • optional
objToUpdate.alias String
  • optional

Return:

Promise<User>

Example:

// returns this
this.update({
   "email": "user@demo.quobis.com",
   "mobilePhone": ['phone1', 'phone2'],
   "landLineNumber": "landLineNumber"
 });

public validatePhone(code: String, phone: String): Promise<User> source

Check if a code is right to update a phone

Params:

NameTypeAttributeDescription
code String

Random string introduced by the user

phone String

Phone that it wants to update

Return:

Promise<User>

Example:

// returns this
this.validatePhone('uifs8wr5', '4564879564');