Type Definitions
-
ActionHandler(component, req)
-
Custom defined method that retrieves data/results for an endpoint
Method parameters:Name Type Description component
Object Instance of
Mapper
,Container
,SimpleStore
, orDataStore
.req
Object HTTP(S) Request Object
Return value:Type Description Promise Promise that resolves with the result.
Example(component, req) => { return new Promise((resolve, reject) => { // ..some logic return resolve(results) }) }
-
Config
-
Configuration options for endpoints, actions, & request/response
Properties:
Name Type Argument Description getEndpoint
Endpoint <optional>
Define endpoints with custom method
create
CreateConfig <optional>
create action configs
createMany
CreateManyConfig <optional>
createMany action configs
destroy
DestroyConfig <optional>
destroy action configs
destroyAll
DestroyAllConfig <optional>
destroyAll action configs
find
FindConfig <optional>
find action configs
findAll
FindAllConfig <optional>
findAll action configs
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results
update
UpdateConfig <optional>
update action configs
updateAll
UpdateAllConfig <optional>
updateAll action configs
updateMany
UpdateManyConfig <optional>
updateMany action configs
-
CreateConfig
-
create action configs
Properties:
Name Type Argument Description action
ActionHandler <optional>
Custom action to retrieve data results
statusCode
Number <optional>
The status code to return with the response
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results
-
CreateManyConfig
-
createMany action configs
Properties:
Name Type Argument Description action
ActionHandler <optional>
Custom action to retrieve data results
statusCode
Number <optional>
The status code to return with the response
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results
-
DestroyAllConfig
-
destroyAll action configs
Properties:
Name Type Argument Description action
ActionHandler <optional>
Custom action to retrieve data results
statusCode
Number <optional>
The status code to return with the response
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results
-
DestroyConfig
-
destroy action configs
Properties:
Name Type Argument Description action
ActionHandler <optional>
Custom action to retrieve data results
statusCode
Number <optional>
The status code to return with the response
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results
-
Endpoint(mapper)
-
Define endpoint path with custom logic
Method parameters:Name Type Description mapper
Object Component Mapper object
-
FindAllConfig
-
findAll action configs
Properties:
Name Type Argument Description action
ActionHandler <optional>
Custom action to retrieve data results
statusCode
Number <optional>
The status code to return with the response
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results
-
FindConfig
-
find action configs
Properties:
Name Type Argument Description action
ActionHandler <optional>
Custom action to retrieve data results
statusCode
Number <optional>
The status code to return with the response
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results
-
RequestHandler(req, res, next)
-
A middleware method invoked on all requests
Method parameters:Name Type Description req
Object HTTP(S) Request Object
res
Object HTTP(S) Response Object
next
Function Express
next()
callback to continue the chain -
ResponseHandler(req, res, next)
-
A method that handles all responses
Method parameters:Name Type Description req
Object HTTP(S) Request Object
res
Object HTTP(S) Response Object
next
Function Express
next()
callback to continue the chain -
Serializer(component, result, opts)
-
Method parameters:
Name Type Description component
Object Instance of
Mapper
,Container
,SimpleStore
, orDataStore
.result
Object The result of the endpoint's ActionHandler.
opts
Object Configuration options.
-
UpdateAllConfig
-
UpdateAllConfig action configs
Properties:
Name Type Argument Description action
ActionHandler <optional>
Custom action to retrieve data results
statusCode
Number <optional>
The status code to return with the response
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results
-
UpdateConfig
-
update action configs
Properties:
Name Type Argument Description action
ActionHandler <optional>
Custom action to retrieve data results
statusCode
Number <optional>
The status code to return with the response
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results
-
UpdateManyConfig
-
updateMany action configs
Properties:
Name Type Argument Description action
ActionHandler <optional>
Custom action to retrieve data results
statusCode
Number <optional>
The status code to return with the response
toJSON
Serializer | Boolean <optional>
Define custom toJSON method for response results