Class: RestStore

RestStore()

This class implements the Store api and transforms it to librest rest calls.

Constructor

new RestStore()

Implements:
Source:

Methods

(async) delete(cls, uid) → {Promise}

Delete an object by uid

Parameters:
Name Type Description
cls string

The class name

uid int

The id of the object

Implements:
Source:
Returns:

No values

Type
Promise

(async) read(cls, params, method) → {Promise}

Gets some object by cls name, filtered by optional params by calling the optional method on cls.

Parameters:
Name Type Description
cls string

The class name

params collect

A map values to filter the result by

method string

The name of the method to call on class. Optional

Implements:
Source:
Returns:

An array of object on the form: {SomeClass:{uid:someId, ...}}

Type
Promise

(async) update(cls, data, method) → {Promise}

Updates object of classs with the given data og maybe calling the method on the class. By convention if the uid == 0 then it is create otherwise it is updated.

Parameters:
Name Type Description
cls string

The class name

data Object

The propertis of the class

method string

An optional method to call

Implements:
Source:
Returns:

The uid of updated the object on the form: {uid:someId}

Type
Promise