Interface: SlackTransport
Defined in: slack/src/executors/slack-transport.ts:20
Pluggable transport abstraction for Slack Web API (chat.postMessage, chat.update), incoming webhooks (@slack/webhook), and Socket Mode control-plane connections (@slack/socket-mode).
Allows SlackApproverAdapter and SlackNotifierAdapter to operate over either defaultSlackTransport (WebClient, IncomingWebhook, SocketModeClient) or deterministic test doubles.
Methods
connectSocketMode()?
connectSocketMode?(
appToken,
controller,
onInteractiveAction?
): Promise<ControlPlaneHandle>;Defined in: slack/src/executors/slack-transport.ts:78
Establishes an inbound Slack Socket Mode control-plane connection via SocketModeClient.
Invoked by SlackApproverAdapter.start(controller) to bind interactive Block Kit actions and signals.
Parameters
| Parameter | Type | Description |
|---|---|---|
appToken | string | Resolved Slack app-level token (xapp-...). |
controller | HarnessRuntimeController | Runtime controller for emitting signals and inspecting active runs. |
onInteractiveAction? | (runId, requestId, responsePayload) => void | Callback routing interactive Block Kit decisions to submitDecision. |
Returns
Promise<ControlPlaneHandle>
Handle with .close() to disconnect Socket Mode.
postMessage()
postMessage(
botToken,
channel,
payload
): Promise<SlackMessageReceipt>;Defined in: slack/src/executors/slack-transport.ts:32
Posts a message or interactive decision block to a Slack channel via chat.postMessage.
Returns the Slack message timestamp (ts) used to correlate thread heartbeats and updates.
Parameters
| Parameter | Type | Description |
|---|---|---|
botToken | string | Resolved Slack bot token (xoxb-...). |
channel | string | Resolved Slack channel identifier. |
payload | Readonly<Record<string, unknown>> | Message body and interactive Block Kit fields. |
Returns
Promise<SlackMessageReceipt>
Slack message timestamp receipt.
postWebhook()
postWebhook(webhookUrl, message): Promise<void>;Defined in: slack/src/executors/slack-transport.ts:65
Posts a one-way text notification to a Slack incoming webhook URL via IncomingWebhook.
Used by SlackNotifierAdapter (slack.webhook(url)).
Parameters
| Parameter | Type | Description |
|---|---|---|
webhookUrl | string | Resolved Slack incoming webhook URL. |
message | string | Notification message text. |
Returns
Promise<void>
Resolves once the webhook request succeeds.
updateMessage()
updateMessage(
botToken,
channel,
payload
): Promise<void>;Defined in: slack/src/executors/slack-transport.ts:49
Updates an existing Slack message via chat.update (such as marking a superseded decision request cancelled).
Targets the message identified by payload.ts in channel.
Parameters
| Parameter | Type | Description |
|---|---|---|
botToken | string | Resolved Slack bot token (xoxb-...). |
channel | string | Resolved Slack channel identifier. |
payload | Readonly<Record<string, unknown>> | Message timestamp ts and updated text/status fields. |
Returns
Promise<void>
Resolves once the Slack message update completes.