Global

Details

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, or DataStore.

req Object

HTTP(S) Request Object

Return value:
Type Description
Promise

Promise that resolves with the result.

Details
Type Source
Function index.js, line 63
Example

(component, req) => {
   return new Promise((resolve, reject) => {
     // ..some logic
     return resolve(results)
    })
}

Config

Configuration options for endpoints, actions, & request/response

Details
Type Source
Object index.js, line 191
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

Details
Type Source
Object index.js, line 93
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

Details
Type Source
Object index.js, line 103
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

Details
Type Source
Object index.js, line 123
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

Details
Type Source
Object index.js, line 113
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

Details
Type Source
Function index.js, line 183

FindAllConfig

findAll action configs

Details
Type Source
Object index.js, line 143
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

Details
Type Source
Object index.js, line 133
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

Details
Type Source
Function index.js, line 43

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

Details
Type Source
Function index.js, line 53

Serializer(component, result, opts)

Method parameters:
Name Type Description
component Object

Instance of Mapper, Container, SimpleStore, or DataStore.

result Object

The result of the endpoint's ActionHandler.

opts Object

Configuration options.

Return value:
Type Description
Object | Array | undefined

The serialized result.

Details
Type Source
Function index.js, line 83

UpdateAllConfig

UpdateAllConfig action configs

Details
Type Source
Object index.js, line 163
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

Details
Type Source
Object index.js, line 153
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

Details
Type Source
Object index.js, line 173
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