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:
(async) addGoalsIfNotExists(userId) → {Promise:.<void:>}
Add goals to a user if they do not exist.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
number |
- Source:
Returns:
(async) byAccountIdentifier(accountIdentifier) → {Promise:.<object:>}
Get a user by account identifier.
Parameters:
| Name | Type | Description |
|---|---|---|
accountIdentifier |
string |
- Source:
Returns:
(async) byId(id) → {Promise:.<object:>}
Get a user by id.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
number |
- Source:
Returns:
(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:
(async) delete(userId) → {Promise:.<void:>}
Delete a user.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
number |
- Source:
Returns:
(async) getContributionPoints(userId) → {Promise:.<number:>}
Get the contribution points of a user.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
number |
- Source:
Returns:
(async) getContributionType(code) → {Promise:.<object:>}
Get a contribution type by code.
Parameters:
| Name | Type | Description |
|---|---|---|
code |
string |
- Source:
Returns:
(async) getGoals(userId) → {Promise:.<Array:.<object:>>}
Get the goals of a user.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
number |
- Source:
Returns:
(async) getMeta(userId, name) → {Promise:.<any:>}
Get a meta value for a user.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
number | |
name |
string |
- Source:
Returns:
(async) getScans(userId) → {Promise:.<Array:.<object:>>}
Get the scans of a user.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
number |
- Source:
Returns:
(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:
(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: