Turns a UI button click in the fake-Slack dashboard into a realistic inbound Slack interaction.
When a user clicks a Block Kit button, Slack POSTs a block_actions
interaction payload to your app's interactivity request URL (as
application/x-www-form-urlencoded with a single payload field). Your app
replies out-of-band by POSTing to the interaction's response_url.
click/3 reproduces that exact flow over real HTTP against a configured
endpoint, wiring in a response_url that routes back into Slackbox.Store
(see Slackbox.ResponsePlug) so the message can be updated live.
Summary
Functions
Build the Slack block_actions interaction payload for action on entry.
Wrap event in a Slack event_callback envelope (Events API). Exposed for
testing.
Build a Slack view_closed interaction payload. opts carries :user.
Exposed for testing.
Build a Slack view_submission interaction payload.
Simulate a click on action for entry, POSTing a block_actions
interaction to config.interactivity_url over real HTTP.
Simulate closing a modal, POSTing a view_closed interaction to
config.interactivity_url. Signed when config.signing_secret is set.
Deliver event to the app's Events API URL (config.events_url) as a JSON
body. Signed over the raw JSON body when config.signing_secret is set.
Simulate a modal submission, POSTing a view_submission interaction to
config.interactivity_url. Signed when config.signing_secret is set.
Functions
Build the Slack block_actions interaction payload for action on entry.
action is a map with "action_id" and optional "value". opts carries
:user and :response_url. Exposed for testing.
Wrap event in a Slack event_callback envelope (Events API). Exposed for
testing.
Build a Slack view_closed interaction payload. opts carries :user.
Exposed for testing.
Build a Slack view_submission interaction payload.
Merges view_id and the collected state (Block Kit state.values) into
view. opts carries :user. Exposed for testing.
Simulate a click on action for entry, POSTing a block_actions
interaction to config.interactivity_url over real HTTP.
config keys: :interactivity_url, :response_base, :signing_secret
(nil = unsigned), :user (default "U_DEMO"). Returns {:ok, status} on a
completed request or {:error, reason} — it never raises into the caller.
Simulate closing a modal, POSTing a view_closed interaction to
config.interactivity_url. Signed when config.signing_secret is set.
Deliver event to the app's Events API URL (config.events_url) as a JSON
body. Signed over the raw JSON body when config.signing_secret is set.
Simulate a modal submission, POSTing a view_submission interaction to
config.interactivity_url. Signed when config.signing_secret is set.