Class: UserController

UserController()

Class representing a user controller.

Constructor

new UserController()

Create a user controller.
Source:

Methods

(async) addContribution(userId, contributionCode) → {Promise:.<void:>}

Add a contribution to a user.
Parameters:
Name Type Description
userId number
contributionCode string
Source:
Returns:
Type
Promise:.<void:>

(async) addGoalsIfNotExists(userId) → {Promise:.<void:>}

Add goals to a user if they do not exist.
Parameters:
Name Type Description
userId number
Source:
Returns:
Type
Promise:.<void:>

(async) byAccountIdentifier(accountIdentifier) → {Promise:.<object:>}

Get a user by account identifier.
Parameters:
Name Type Description
accountIdentifier string
Source:
Returns:
Type
Promise:.<object:>

(async) byId(id) → {Promise:.<object:>}

Get a user by id.
Parameters:
Name Type Description
id number
Source:
Returns:
Type
Promise:.<object:>

(async) changeGoalProgressByTrackName(userId, goalName, goalDesc, changeByAmount) → {Promise:.<void:>}

Change the progress of a goal by the track name.
Parameters:
Name Type Description
userId number
goalName string
goalDesc string
changeByAmount number
Source:
Returns:
Type
Promise:.<void:>

(async) delete(userId) → {Promise:.<void:>}

Delete a user.
Parameters:
Name Type Description
userId number
Source:
Returns:
Type
Promise:.<void:>

(async) getContributionPoints(userId) → {Promise:.<number:>}

Get the contribution points of a user.
Parameters:
Name Type Description
userId number
Source:
Returns:
Type
Promise:.<number:>

(async) getContributionType(code) → {Promise:.<object:>}

Get a contribution type by code.
Parameters:
Name Type Description
code string
Source:
Returns:
Type
Promise:.<object:>

(async) getGoals(userId) → {Promise:.<Array:.<object:>>}

Get the goals of a user.
Parameters:
Name Type Description
userId number
Source:
Returns:
Type
Promise:.<Array:.<object:>>

(async) getMeta(userId, name) → {Promise:.<any:>}

Get a meta value for a user.
Parameters:
Name Type Description
userId number
name string
Source:
Returns:
Type
Promise:.<any:>

(async) getScans(userId) → {Promise:.<Array:.<object:>>}

Get the scans of a user.
Parameters:
Name Type Description
userId number
Source:
Returns:
Type
Promise:.<Array:.<object:>>

(async) insert(name, accountIdentifier, authToken, authMethod) → {Promise:.<object:>}

Insert a user.
Parameters:
Name Type Description
name string
accountIdentifier string
authToken string
authMethod string
Source:
Returns:
Type
Promise:.<object:>

(async) setMeta(userId, name, value) → {Promise:.<void:>}

Set a meta value for a user.
Parameters:
Name Type Description
userId number
name string
value any
Source:
Returns:
Type
Promise:.<void:>