Class: simpleJsonShredding

simpleJsonShredding

Shredder for REST services which have a JSON structure. If the
JSON contained in the payload is hierchical the shredder will only process
the first level in the hierarchy. The shredder transforms the JSON payload
into a flat list of ids and data items.

Parameters:

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() → {function}

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.