Typedef
Static Public Summary | ||
public |
BeforeRouteParams: Object |
|
public |
Decorator: : function |
|
public |
OptionErrors: * |
|
public |
ParamMiddlewareFunction(elem: *, route: Route, context: {ctx: KoaContext, body: Object, keyBody: string}): *: function |
|
public |
ParamsClassDecorator: Object |
|
public |
ParamsMethodDecorator: Object |
|
public |
PostParamsFilter: Object |
|
public |
RouteParams: Object |
|
public |
StatusCode: Object |
Static Public
public BeforeRouteParams: Object source
Properties:
Name | Type | Attribute | Description |
path | string | the path at which the route will be available. |
|
options | ParamsMethodDecorator | ||
call | function | the fonction to call when route match, this is automaticaly add by route decorator |
public OptionErrors: * source
Properties:
Name | Type | Attribute | Description |
logAll | boolean |
|
if set to true, all logs will be displayed regardless of their individual settings |
logErrorUnknown | boolean |
|
whether unknown errors should be displayed |
logErrorSequelize | boolean |
|
whether errors pertaining to the models should be logged |
logErrorApp | boolean |
|
whether errors coming from thrown ErrorApp should be logged |
public ParamMiddlewareFunction(elem: *, route: Route, context: {ctx: KoaContext, body: Object, keyBody: string}): *: function source
Params:
Name | Type | Attribute | Description |
elem | * | the element the function will act upon |
|
route | Route |
|
the element's current route |
context | {ctx: KoaContext, body: Object, keyBody: string} |
|
the element's context |
Return:
* | transformedParam the parameter, after being manipulated by the function |
public ParamsClassDecorator: Object source
Properties:
Name | Type | Attribute | Description |
routeBase | string | a prefix which will be preppended all to the route's path |
|
disabled | boolean | if set to true, all route in the class will be ignored |
|
middlewares | function[] | an array of Koa Middlewares, which will be mounted for the given route |
|
accesses | function[] | an array of async function, which will be call (for all routes in the class) with ctx, if one of them return true, the current client will access the route |
public ParamsMethodDecorator: Object source
Properties:
Name | Type | Attribute | Description |
params | Object<string, boolean|PostParamsFilter> | the params describing the route's middlewares, with the key being the param's name, and the value describes the way it should be handled. (only applicable for requests containing a body) |
|
path | string | the path at which the route will be available. |
|
disabled | boolean | if set to true, the route will be ignored |
|
middlewares | function[] | an array of Koa Middlewares, which will be mounted for the given route |
|
rateLimit | Object | a rateLimit object, which lets the user describe the max rate at which a user can access the route |
|
accesses | function[] | an array of async function, which will be call with ctx, if one of them return true, the current client will access the route. This will overwrite the accesses pass to {ParamsClassDecorator} |
public PostParamsFilter: Object source
Properties:
Name | Type | Attribute | Description |
__func | ParamMiddlewareFunction[] | an array of functions which provides "middleware" functions that will be applied to the corresponding parameter one by one, in order to validate or transform it |
|
__force | boolean | whether the parameter is required or not. |
public RouteParams: Object source
Properties:
Name | Type | Attribute | Description |
app | Koa | the Koa application |
|
prefix | string | a prefix which will be preppended before every route's paths |
|
routes | Route[] | an array containing all the mounted Routes |
|
models | Model[] |
|
an array containing all of the app's models |
model | string |
|
the name of the route's own model |
boolean | disable |
|
whether the route should be disabled |
public StatusCode: Object source
Properties:
Name | Type | Attribute | Description |
ok | Number | HTTP response 200 |
|
created | Number | HTTP response 201 |
|
noContent | Number | HTTP response 204 |
|
badRequest | Number | HTTP response 400 |
|
unauthorized | Number | HTTP response 401 |
|
forbidden | Number | HTTP response 403 |
|
notFound | Number | HTTP response 404 |
|
internalServerError | Number | HTTP response 500 |