Monster.Data.Datasource. RestAPI

Namespace for storages

Author
  • schukai GmbH

Classes

WriteError

the error is thrown by the rest api in case of error

Members

defaults

Properties
NameTypeDefaultDescription
urlstring

Defines the resource that you wish to fetch.

writeObject{}

Options

Properties
NameTypeDefaultDescription
initObject{}

An options object containing any custom settings that you want to apply to the request. The parameters are identical to those of the Request constructor

Properties
NameTypeDefaultDescription
methodstringPOST
acceptedStatusstring[200,201
urlstring

URL

mappingObject

the mapping is applied before writing.

Properties
NameTypeDescription
transformerString

Transformer to select the appropriate entries

reportObject
Properties
NameTypeDescription
pathString

Path to validations

mapping.callbackArray.<Monster.Data.Datasource~exampleCallback>

with the help of the callback, the structures can be adjusted before writing.

read.initObject{}

An options object containing any custom settings that you want to apply to the request. The parameters are identical to those of the Request constructor

Properties
NameTypeDefaultDescription
methodstringGET
read.acceptedStatusstring[200
read.urlstring

URL

read.mappingObject

the mapping is applied after reading.

Properties
NameTypeDescription
transformerString

Transformer to select the appropriate entries

callbackArray.<Monster.Data.Datasource~exampleCallback>

with the help of the callback, the structures can be adjusted after reading.

Methods

getClone() → {RestAPI}

Returns:
Type: 
RestAPI

read() → {Promise}

Throws:
  • the options does not contain a valid json definition

    Type
    Error
  • value is not a object

    Type
    TypeError
  • the data cannot be read

    Type
    Error
Returns:
Type: 
Promise

write() → {Promise}

Throws:

the data cannot be written

Type
WriteError
Returns:
Type: 
Promise