Home Manual Reference Source Test Repository
public class | source

User

Extends:

BaseProvision → User

This class allow make get request to user resource into Opengate North API.

Constructor Summary

Public Constructor
public

Constructor

Method Summary

Public Methods
public

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a apiKey of a user

public

changePassword(newPassword: String): Promise

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user

public
public

login(email: String, password: String, twoFaCode: String): Promise

This invoke a request to OpenGate North API and the callback is managed by promises This function get a JWT for user with Two Factor Authorithation (optional)

public

This invoke a request to OpenGate North API and the callback is managed by promises This function request for new password when the user forgets it.

public

updatePassword(newPassword: String, tokenId: String): Promise

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user with a tokenId

public

with2FaType(twoFaType: string): User

Set the 2FaType attribute

public

withApiKey(apiKey: string): User

Set the apiKey attribute.

public

withCountryCode(countryCode: string): User

Set the countryCode attribute

public

withDescription(description: string): User

Set the description attribute

public

withDomain(domain: string): User

Set the domain attribute

public

withEmail(email: string): User

Set the email attribute

public

withForcePasswordChange(forcePasswordChange: boolean): User

Set the forcePasswordChange: if true Forces you to reset your password on your next login attempt.

public

withLangCode(langCode: string): User

Set the langCode attribute

public

withName(name: string): User

Set the name attribute

public

withPassword(password: string): User

Set the password attribute

public

withProfile(profile: string): User

Set the profile attribute

public

withSurname(surname: string): User

Set the surname attribute

public

withTimezone(timezone: string): User

Set the timezone attribute

public

withWorkgroup(workgroup: string): User

Set the workgroup attribute

Inherited Summary

From class BaseProvision
public

This invoke a request to OpenGate North API and the callback is managed by promises This function create a entity of provision

public

delete(body: *): Promise

This invoke a request to OpenGate North API and the callback is managed by promises This function deletes a entity of provision

public

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a entity of provision

Public Constructors

public constructor(Reference: InternalOpenGateAPI) source

Constructor

Override:

BaseProvision#constructor

Params:

NameTypeAttributeDescription
Reference InternalOpenGateAPI

to the API object.

Public Methods

public changeApiKey(apiKey: String): Promise source

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a apiKey of a user

Params:

NameTypeAttributeDescription
apiKey String

required field

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

Example:

 ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changeApiKey(newPassword);

public changePassword(newPassword: String): Promise source

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user

Params:

NameTypeAttributeDescription
newPassword String

required field

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

Example:

 ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changePassword(newPassword);

public generateApiKey(): * source

Return:

*

public login(email: String, password: String, twoFaCode: String): Promise source

This invoke a request to OpenGate North API and the callback is managed by promises This function get a JWT for user with Two Factor Authorithation (optional)

Params:

NameTypeAttributeDescription
email String

required field

password String

required field

twoFaCode String

optional field

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

Example:

 ogapi.usersBuilder().login(email, password);
 ogapi.usersBuilder().login(email, password, twoFaCode);

public requestResetPassword(): Promise source

This invoke a request to OpenGate North API and the callback is managed by promises This function request for new password when the user forgets it. Sends a password recovery email

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

Example:

 ogapi.usersBuilder().withEmail(example@example.es).requestResetPassword()

public updatePassword(newPassword: String, tokenId: String): Promise source

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user with a tokenId

Params:

NameTypeAttributeDescription
newPassword String

required field

tokenId String

required field

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

Example:

 ogapi.usersBuilder().withEmail(example@example.es).updatePassword(newPassword, tokenid);

public with2FaType(twoFaType: string): User source

Set the 2FaType attribute

Params:

NameTypeAttributeDescription
twoFaType string

required field

Return:

User

public withApiKey(apiKey: string): User source

Set the apiKey attribute. Only on update user

Params:

NameTypeAttributeDescription
apiKey string

required field

Return:

User

public withCountryCode(countryCode: string): User source

Set the countryCode attribute

Params:

NameTypeAttributeDescription
countryCode string

required field

Return:

User

public withDescription(description: string): User source

Set the description attribute

Params:

NameTypeAttributeDescription
description string

required field

Return:

User

public withDomain(domain: string): User source

Set the domain attribute

Params:

NameTypeAttributeDescription
domain string

required field

Return:

User

public withEmail(email: string): User source

Set the email attribute

Params:

NameTypeAttributeDescription
email string

required field

Return:

User

public withForcePasswordChange(forcePasswordChange: boolean): User source

Set the forcePasswordChange: if true Forces you to reset your password on your next login attempt.

Params:

NameTypeAttributeDescription
forcePasswordChange boolean

Return:

User

public withLangCode(langCode: string): User source

Set the langCode attribute

Params:

NameTypeAttributeDescription
langCode string

required field

Return:

User

public withName(name: string): User source

Set the name attribute

Params:

NameTypeAttributeDescription
name string

required field

Return:

User

public withPassword(password: string): User source

Set the password attribute

Params:

NameTypeAttributeDescription
password string

required field

Return:

User

public withProfile(profile: string): User source

Set the profile attribute

Params:

NameTypeAttributeDescription
profile string

required field

Return:

User

public withSurname(surname: string): User source

Set the surname attribute

Params:

NameTypeAttributeDescription
surname string

required field

Return:

User

public withTimezone(timezone: string): User source

Set the timezone attribute

Params:

NameTypeAttributeDescription
timezone string

required field

Return:

User

public withWorkgroup(workgroup: string): User source

Set the workgroup attribute

Params:

NameTypeAttributeDescription
workgroup string

required field

Return:

User