Function
Static Public Summary | ||
public |
async addUser(req: *, res: *) Function which provides functionality to add/create new user in system |
|
public |
create function to add new user |
|
public |
async errorhandler(err: *, req: *, res: *, next: *): * |
|
public |
findAll function to retrieve all available users in system |
|
public |
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
import {addUser} from 'pg-sequelize/src/controllers/user.controller.js'
Function which provides functionality to add/create new user in system
Params:
Name | Type | Attribute | Description |
req | * | express HTTP request object |
|
res | * | express HTTP response object |
public async create(data: object): Promise source
import {create} from 'pg-sequelize/src/services/user.service.js'
create function to add new user
Params:
Name | Type | Attribute | Description |
data | object | user object with information to be saved in system |
public async errorhandler(err: *, req: *, res: *, next: *): * source
import errorhandler from 'pg-sequelize/src/middlewares/error-handler.js'
Params:
Name | Type | Attribute | Description |
err | * | ||
req | * | ||
res | * | ||
next | * |
Return:
* |
public async findAll(): Promise source
import {findAll} from 'pg-sequelize/src/services/user.service.js'
findAll function to retrieve all available users in system
public async findById(userId: number): Promise source
import {findById} from 'pg-sequelize/src/services/user.service.js'
findById function to fetch data for provided userId
Params:
Name | Type | Attribute | Description |
userId | number | user id for which data needs to be fetched |
public async generateSpecs() source
import {generateSpecs} from 'pg-sequelize/src/utils/generate-api-specs.js'
public async getHealth(req: *, res: *) source
import {getHealth} from 'pg-sequelize/src/controllers/health.controller.js'
Health controller entry function
Params:
Name | Type | Attribute | Description |
req | * | express HTTP request object |
|
res | * | express HTTP response object |
public async getUser(req: *, res: *) source
import {getUser} from 'pg-sequelize/src/controllers/user.controller.js'
Function which provides functionality to retrieve specific user based on provided userId
Params:
Name | Type | Attribute | Description |
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
import {getUsers} from 'pg-sequelize/src/controllers/user.controller.js'
Function which provides functionality to retrieve all users present in system
Params:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
server | * |
public async notfounderror(req: *, res: *, next: *) source
import notfounderror from 'pg-sequelize/src/middlewares/not-found-error.js'
Params:
Name | Type | Attribute | Description |
req | * | ||
res | * | ||
next | * |
public responsehandler(body: *) source
import responsehandler from 'pg-sequelize/src/middlewares/response-handler.js'
Generic success response handler
Params:
Name | Type | Attribute | Description |
body | * | response that needs to be returned as part of API result |
public skill(sequelize: Sequelize, DataTypes: Sequelize.DataTypes): * source
import skill from 'pg-sequelize/src/models/skill.model.js'
Model class for "skill"
Params:
Name | Type | Attribute | Description |
sequelize | Sequelize | sequelize object |
|
DataTypes | Sequelize.DataTypes | sequelize datatypes |
Return:
* | Skill - sequelize model |
public user(sequelize: Sequelize, DataTypes: Sequelize.DataTypes): * source
import user from 'pg-sequelize/src/models/user.model.js'
Model class for "skill"
Params:
Name | Type | Attribute | Description |
sequelize | Sequelize | sequelize object |
|
DataTypes | Sequelize.DataTypes | sequelize datatypes |
Return:
* | User - sequelize model for user entity |
public async validatejson(err: *, req: *, res: *, next: *): * source
import validatejson from 'pg-sequelize/src/middlewares/validate-json.js'
Params:
Name | Type | Attribute | Description |
err | * | ||
req | * | ||
res | * | ||
next | * |
Return:
* |