ODataEndpoint

@ub-e/odata~ ODataEndpoint

new ODataEndpoint(props)

Construct new ODataEndpoint
Arguments:
  1. props (Object)

Methods

handle(req, res)

Main OData endpoint handler. Will parse the request route and call sub-handler.
Arguments:
  1. req (THTTPRequest)
  2. res (THTTPResponse)

metadata(req, res, params)

Metadata /$metadata request
Arguments:
  1. req (THTTPRequest)
  2. res (THTTPResponse)
  3. params (Object)

notFoundError(req, res, params)

Write "Resource not found" error back to caller
Arguments:
  1. req (THTTPRequest)
  2. res (THTTPResponse)
  3. params (Object)

checkEntitySet(req, res, params, methodopt)TubEntity|null

Check entity set exist in entitySetMapping and return entity or write notFound resp and return null
Arguments:
  1. req (THTTPRequest)
  2. res (THTTPResponse)
  3. params (Object)
  4. [method] (String)  if passed check ELS

queryByID(req, res, params)

Single instance request
Arguments:
  1. req (THTTPRequest)
  2. res (THTTPResponse)
  3. params (Object)

query(req, res, params)

Single instance request
Arguments:
  1. req (THTTPRequest)
  2. res (THTTPResponse)
  3. params (Object)

collections(req, res, params)

Root OData request - must return a EntitySet collection
Arguments:
  1. req (THTTPRequest)
  2. res (THTTPResponse)
  3. params (Object)

update(req, res, params)

PATCH OData request. Support optimistic lock using E-Tag
Arguments:
  1. req (THTTPRequest)
  2. res (THTTPResponse)
  3. params (Object)