Class: oracleRestJsonShredding

oracleRestJsonShredding

Shredder for REST services which conform to the Oracle REST standard.

Methods

(static) getShredder(storeName, idAttr, dataMappingopt) → {function}

Return the shredder for Oracle REST JSON
Parameters:
Name Type Attributes Description
storeName string Name of the Persistent Store into which the shredded data should be stored
idAttr string | Array The id field or array of fields in the JSON data
dataMapping DataMapping <optional>
Optional dataMapping to apply to the data
Source:
Returns:
shredder The shredder function takes a Response object as parameter and returns a Promise which resolves to an array of objects which have the following structure:
{
 'name': storeName, 
 'resourceIdentifier': resourceIdentifier, 
 'keys': idArray, 
 'data': dataArray,
 'resourceType' : 'single' or 'collection'
}
Type
function

(static) getUnshredder(dataMappingopt) → {function}

Return the unshredder for Oracle REST JSON
Parameters:
Name Type Attributes Description
dataMapping DataMapping <optional>
Optional dataMapping to apply to the data
Source:
Returns:
unshredder The unshredder function takes an array of objects and a response object as parameters. The array of objects has the following structure:
{
 'name': storeName, 
 'resourceIdentifier': resourceIdentifier, 
 'keys': idArray, 
 'data': dataArray,
 'resourceType' : 'single' or 'collection'
}
The unshredder returns a Promise which resolves to a Response object.
Type
function