Service / Server Specific API

The following server APIs are only availble in services and executed on the server.


server

Generale functions to interact with the server.

Description

Returns the actual environment the user is logged into.

Returns
data type description
Environment Returns the actual the environment of the user
Description

Returns the actual user which has triggered the service.

Returns
data type description
Record The user record
Description

Returns the actual record for which the service has been triggered.

Returns
data type description
Option The record
Description

Returns the actual model for which the service has been triggered.

Returns
data type description
Option The model

server::db

Generale functions to interact with the database of the server.

Description

Fetches a record from the database.

Parameters
parameter data type description
0 String | Reference The uuid of the record to query
Returns
data type description
async Result<Record> The answer from the executed service
Description

Inserts a new Record into the database.

Parameters
parameter data type description
0 Record The Record which should be inserted into the db
Returns
data type description
async Result<(String)> Returns the uuid of the created record or an error.
Description

Updates a Record value in the database. This also informs all subscribed clients about this change.

Parameters
parameter data type description
0 String | Reference The uuid of the record be updated
1 Ident | String The ident of the value to update
2 Value The new value which should be applied to the record (any value type allowed)
Returns
data type description
async Result<()> Thorws an error when something went wrong
Description

Adds a record into the inbox of a user. This also informs all subscribed clients about this change.

Parameters
parameter data type description
0 Ident | Reference The uuid of the user (Ident, UUID of Reference as String)
1 Reference | String The uuid of the record to add into the inbox
Returns
data type description
async Result<()> Thorws an error when something went wrong
Description

Removes a record from the inbox of a user. This also informs all subscribed clients about this change.

Parameters
parameter data type description
0 Ident | Reference The uuid of the user (Ident, UUID of Reference as String)
1 Reference | String The uuid of the record to remove from the inbox
Returns
data type description
async Result<()> Thorws an error when something went wrong
Description

Adds a record into the favorite container of a user. This also informs all subscribed clients about this change.

Parameters
parameter data type description
0 Ident | Reference The uuid of the user (Ident, UUID of Reference as String)
1 Reference | String The uuid of the record to add into the favorites
Returns
data type description
async Result<()> Thorws an error when something went wrong
Description

Removes a record from the favorites of a user. This also informs all subscribed clients about this change.

Parameters
parameter data type description
0 Ident | Reference The uuid of the user (Ident, UUID of Reference as String)
1 Reference | String The uuid of the record to remove from the favorites
Returns
data type description
async Result<()> Thorws an error when something went wrong
Description

Resets the password for the given user. The needs to have the password_reset right.

Parameters
parameter data type description
0 Ident | Reference The uuid of the user to reset the password for
1 String The new password to set for the user
Returns
data type description
async Result<()> Thorws an error when something went wrong
Description

Fetches a model from the database. Get ether a model by ident or by the uuid (always of active model).

Parameters
parameter data type description
0 String The uuid of the model to get
Returns
data type description
async Result<Model> The answer from the executed service
Description

Executes a SqlQuery against the database.

Parameters
parameter data type description
0 String The sql string to be executed
Returns
data type description
async Result<SqlQueryAnswer> The answer from the executed sql