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

(static) instanceSymbol

This method is called by the instanceof operator.

This method is called by the instanceof operator.

Since
  • 2.1.0

defaults

Properties
NameTypeDefaultDescription
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
headersObject

Object containing any custom headers that you want to apply to the request.

acceptedStatusstring[200,201
urlstring

URL

mappingObject

the mapping is applied before writing.

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 before writing.

reportObject
Properties
NameTypeDescription
pathString

Path to validations

sheathingObject
Properties
NameTypeDescription
objectObject

Object to be wrapped

pathstring

Path to the data

readObject{}

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
methodstringGET
acceptedStatusstring[200
urlstring

URL

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