Skip to content

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()? ​

ts
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 ​

ParameterTypeDescription
appTokenstringResolved Slack app-level token (xapp-...).
controllerHarnessRuntimeControllerRuntime controller for emitting signals and inspecting active runs.
onInteractiveAction?(runId, requestId, responsePayload) => voidCallback routing interactive Block Kit decisions to submitDecision.

Returns ​

Promise<ControlPlaneHandle>

Handle with .close() to disconnect Socket Mode.


postMessage() ​

ts
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 ​

ParameterTypeDescription
botTokenstringResolved Slack bot token (xoxb-...).
channelstringResolved Slack channel identifier.
payloadReadonly<Record<string, unknown>>Message body and interactive Block Kit fields.

Returns ​

Promise<SlackMessageReceipt>

Slack message timestamp receipt.


postWebhook() ​

ts
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 ​

ParameterTypeDescription
webhookUrlstringResolved Slack incoming webhook URL.
messagestringNotification message text.

Returns ​

Promise<void>

Resolves once the webhook request succeeds.


updateMessage() ​

ts
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 ​

ParameterTypeDescription
botTokenstringResolved Slack bot token (xoxb-...).
channelstringResolved Slack channel identifier.
payloadReadonly<Record<string, unknown>>Message timestamp ts and updated text/status fields.

Returns ​

Promise<void>

Resolves once the Slack message update completes.

Released under the MIT License.