Home Reference Source Test

Function

Static Public Summary
public

async addUser(req: *, res: *)

Function which provides functionality to add/create new user in system

public

async create(data: object): Promise

create function to add new user

public

async errorhandler(err: *, req: *, res: *, next: *): *

public

async findAll(): Promise

findAll function to retrieve all available users in system

public

async findById(userId: number): Promise

findById function to fetch data for provided userId

public

async generateSpecs()

public

async getHealth(req: *, res: *)

Health controller entry function

public

async getUser(req: *, res: *)

Function which provides functionality to retrieve specific user based on provided userId

public

async getUsers(req: *, res: *)

Function which provides functionality to retrieve all users present in system

public

async gracefulShutdown(server: *)

public

async notfounderror(req: *, res: *, next: *)

public

responsehandler(body: *)

Generic success response handler

public

skill(sequelize: Sequelize, DataTypes: Sequelize.DataTypes): *

Model class for "skill"

public

user(sequelize: Sequelize, DataTypes: Sequelize.DataTypes): *

Model class for "skill"

public

async validatejson(err: *, req: *, res: *, next: *): *

Static Public

public async addUser(req: *, res: *) source

Function which provides functionality to add/create new user in system

Params:

NameTypeAttributeDescription
req *

express HTTP request object

res *

express HTTP response object

public async create(data: object): Promise source

create function to add new user

Params:

NameTypeAttributeDescription
data object

user object with information to be saved in system

Return:

Promise

Created user object

public async errorhandler(err: *, req: *, res: *, next: *): * source

Params:

NameTypeAttributeDescription
err *
req *
res *
next *

Return:

*

public async findAll(): Promise source

findAll function to retrieve all available users in system

Return:

Promise

User object array

public async findById(userId: number): Promise source

findById function to fetch data for provided userId

Params:

NameTypeAttributeDescription
userId number

user id for which data needs to be fetched

Return:

Promise

User object

public async generateSpecs() source

import {generateSpecs} from 'pg-sequelize/src/utils/generate-api-specs.js'

public async getHealth(req: *, res: *) source

Health controller entry function

Params:

NameTypeAttributeDescription
req *

express HTTP request object

res *

express HTTP response object

public async getUser(req: *, res: *) source

Function which provides functionality to retrieve specific user based on provided userId

Params:

NameTypeAttributeDescription
req *

express HTTP request object

res *

express HTTP response object

Throw:

NotFoundError

if no such user exists for provided userId

public async getUsers(req: *, res: *) source

Function which provides functionality to retrieve all users present in system

Params:

NameTypeAttributeDescription
req *

express HTTP request object

res *

express HTTP response object

public async gracefulShutdown(server: *) source

import {gracefulShutdown} from 'pg-sequelize/src/utils/graceful-shutdown.js'

Params:

NameTypeAttributeDescription
server *

public async notfounderror(req: *, res: *, next: *) source

Params:

NameTypeAttributeDescription
req *
res *
next *

public responsehandler(body: *) source

Generic success response handler

Params:

NameTypeAttributeDescription
body *

response that needs to be returned as part of API result

public skill(sequelize: Sequelize, DataTypes: Sequelize.DataTypes): * source

Model class for "skill"

Params:

NameTypeAttributeDescription
sequelize Sequelize

sequelize object

DataTypes Sequelize.DataTypes

sequelize datatypes

Return:

*

Skill - sequelize model

public user(sequelize: Sequelize, DataTypes: Sequelize.DataTypes): * source

Model class for "skill"

Params:

NameTypeAttributeDescription
sequelize Sequelize

sequelize object

DataTypes Sequelize.DataTypes

sequelize datatypes

Return:

*

User - sequelize model for user entity

public async validatejson(err: *, req: *, res: *, next: *): * source

Params:

NameTypeAttributeDescription
err *
req *
res *
next *

Return:

*