All contracts are based on COMMAND pattern, where the name of the command is placed in "command" field and the argument is all other fields.
Only "Client -> Router" outerCallContract have no "command" field - the command is recognized by current state of session, if no session state currently presented then the command will be "open", otherwise the command will be "action".
{
sid: string,
contentBody: string?
}
Where
- sid - session id
- contentBody - request contentBody with inner structure, depends on current Client -> Flow contract
{
sid: string,
contentBody: string
}
Where
- sid - session id
- contentBody - response contentBody with inner structure, depends on current Client -> Flow outerCallContract
{
type: "ANSWER",
flow: string,
state: string,
flowData: string?,
contentBody: string?
}
{
type: "OPEN",
flow: string,
state: null,
flowData: null,
contentBody: string?
}
{
type: "RETURN",
flow: string,
state: string,
flowData: string,
onReturn: string,
contentBody: string
}
{
type: "QUESTION",
state: string,
flowData: string,
contentBody: string
}
{
type: "OPEN",
flow: string,//flow that should be opened
state: string, //state of opener flow
flowData: string, //updated flowData of opener flow
contentBody: string?, //argument data
}
The state of opener flow should be
{
type: "RETURN",
contentBody: string?
}
{
type: "ERROR",
state: string,
flowData: string,
contentBody: string?
}