2020-01-20 07:43:25 +01:00
|
|
|
# Action Service Interface
|
|
|
|
|
2020-01-21 18:05:47 +01:00
|
|
|
Exception ActionException(message: string);
|
2020-01-20 07:43:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Executes multiple actions in the conext of the user given by the user_id.
|
2020-02-03 23:32:24 +01:00
|
|
|
* All actions are processed independently.
|
|
|
|
*
|
|
|
|
* TODO: Check if we need an interface or flag to process actions all together.
|
2020-01-20 07:43:25 +01:00
|
|
|
*
|
2020-01-21 18:05:47 +01:00
|
|
|
*
|
|
|
|
* @throws ActionException
|
2020-01-20 07:43:25 +01:00
|
|
|
*/
|
2020-02-03 23:32:24 +01:00
|
|
|
handle_request (payload: Action[], user_id: number): ActionResult[]
|
2020-01-20 07:43:25 +01:00
|
|
|
|
|
|
|
interface Action {
|
2020-01-21 18:05:47 +01:00
|
|
|
action: string;
|
2020-02-03 23:32:24 +01:00
|
|
|
data: object[]; # An array of action specific data. See JSON schema defintions.
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ActionResult {
|
|
|
|
success: boolean;
|
|
|
|
message: string;
|
2020-01-20 07:43:25 +01:00
|
|
|
}
|