AbstractApiUtils

AbstractApiUtils

Utilities for APIs

Constructor

new AbstractApiUtils()

Source:

Methods

(static) argsFromReq(req) → {Array.<*>}

Source:
Generates a list of arguments to be passed to the MongoDBModule from a request object
Parameters:
Name Type Description
req external:ExpressRequest
Returns:
Type
Array.<*>

(static) generateApiMetadata(instance)

Source:
Generates REST API metadata and stores on route config
Parameters:
Name Type Description
instance AbstractApiModule The current AbstractApiModule instance

(static) httpMethodToAction(method) → {String}

Source:
Converts HTTP methods to a corresponding 'action' for use in auth
Parameters:
Name Type Description
method String The HTTP method
Returns:
Type
String

(static) httpMethodToDBFunction(method) → {String}

Source:
Converts HTTP methods to a corresponding database function
Parameters:
Name Type Description
method String The HTTP method
Returns:
Type
String

(static) stringifyValues(data)

Source:
Clones an object and converts any Dates and ObjectIds to Strings
Parameters:
Name Type Description
data Object
Returns:
A clone object with stringified ObjectIds