View Source Runbox.Scenario.UIAction (runbox v13.0.3)
Definition of action to be fired from UI.
In scenario list of Runbox.Scenario.UIAction
s is defined and stored in asset
map entity. When action is fired from UI, scenario receives Runbox.Scenario.UserAction
.
Summary
Functions
Converts list of UI actions to actions property.
Types
@type t() :: %Runbox.Scenario.UIAction{ description: String.t(), details: map(), name: String.t(), topic: String.t(), type: String.t() }
UI action definition.
Properties topic
, type
and details
are serialized to JWT token and used for
routing of fired action. Property topic
is name of raw topic where fired actions
are pushed, property type
is type to be used in Runbox.Message
as type
and
property details
is stored in resulting message body
as details
property.
Properties name
and description
are only metadata for UI.
Functions
@spec actions([t()]) :: {:ok, [map()]} | {:error, Joken.error_reason()}
Converts list of UI actions to actions property.
Map in resulting list contains two properties:
action
- action (topic
,type
,details
) encoded to JWT.meta
- metadata (name
,description
) to be used in UI.
Resulting list of maps should be stored to some entity in asset map.