Updated action spec.
This commit is contained in:
parent
c187700af2
commit
6054eb76c5
@ -1,27 +1,19 @@
|
|||||||
# Action Service Interface
|
# Action Service Interface
|
||||||
|
|
||||||
// TODO: More Exceptions?
|
Exception ActionException(message: string);
|
||||||
Exception ActionNotFound(name: string);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes multiple actions in the conext of the user given by the user_id.
|
* Executes multiple actions in the conext of the user given by the user_id.
|
||||||
|
* All actions are successful if no exception is thrown, else no action was
|
||||||
|
* processed.
|
||||||
*
|
*
|
||||||
* @throws ActionNotFound
|
*
|
||||||
|
* @throws ActionException
|
||||||
*/
|
*/
|
||||||
execute(actions: Action[], user_id: number): ExecuteResult;
|
handle_request (payload: Action[], user_id: number): void
|
||||||
|
|
||||||
interface Action {
|
interface Action {
|
||||||
name: string;
|
action: string;
|
||||||
data: object;
|
data: object[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ActionError {
|
|
||||||
error: string;
|
|
||||||
argumens: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gives a detailed error, for all failed actions. For some actions, success
|
|
||||||
// data is returned (the object). If there is no success data, null is given
|
|
||||||
// for the action. The results index matches to the action index in the request.
|
|
||||||
Type ExecuteResult = (ActionError | object | null)[]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user