Home Manual Reference Source
private class | source

ProgressController

Controller class for the Progress model.

Constructor Summary

Public Constructor
public

constructor(connection: Connection)

Member Summary

Private Members
private

Object to use for making a connection to the REST API and Websocket server.

Method Summary

Public Methods
public

getProgress(categoryId: string, groupId: string, roles: Array): Promise<Progress[]>

Get Progress corresponding to a {@Link Category} for the current active {@Link User} derived from the OAuth2 scope.

Public Constructors

public constructor(connection: Connection) source

Params:

NameTypeAttributeDescription
connection Connection

Object to use for making a connection to the REST API and Websocket server.

Private Members

private _connection: Connection source

Object to use for making a connection to the REST API and Websocket server.

Public Methods

public getProgress(categoryId: string, groupId: string, roles: Array): Promise<Progress[]> source

Get Progress corresponding to a {@Link Category} for the current active {@Link User} derived from the OAuth2 scope. If a user is allowed to see the progress of multiple users (depending of its {@Link Role} and permissions) then more Progress objects could be returned. This can be controlled with the groupId parameter. This way, only users in a specific group will be returned as a result.

Progress is always being fetched for a single category, identified with a categoryId.

Params:

NameTypeAttributeDescription
categoryId string

Specify a Category identifier.

groupId string
  • nullable: true

Specify a Group identifier.

roles Array
  • nullable: true

Specify user roles as a filter to the result.

Return:

Promise<Progress[]>

Array of Progress.

Throw:

Promise.<Error>

categoryId parameter of type "string" is required.

Promise.<Error>

groupId parameter of type "string|null" is required.

Promise.<Error>

roles parameter of type "Array|null" is required.

Promise.<Error>

If the server returned an error.