Module

x/deno_slack_hooks/deps.ts>Protocol

Helper library implementing the contract between the Slack CLI and Slack application SDKs
Latest
interface Protocol
import { type Protocol } from "https://dotland.deno.dev/x/deno_slack_hooks@1.3.0/deps.ts";

An interface encapsulating a specific set of communication rules that both the SDK and the CLI implement.

Properties

name: string

Label representing the protocol name, as identified by the slack-cli

log: console.log

Logging utility allowing for SDK or userland code to log diagnostic info that will be surfaced by the CLI.

error: console.error

Logging utility allowing for SDK or userland code to log error info that will be surfaced by the CLI.

warn: console.warn

Logging utility allowing for SDK or userland code to provide warnings that will be surfaced by the CLI.

respond: (data: string) => void

Utility method for responding to CLI hook invocations.

optional
getCLIFlags: () => string[]

Retrieve all command-line flags related to the specific protocol implementation. May be useful if child processes are being spawned by the SDK, such as in local-run mode of deno-slack-runtime.

optional
install: () => void

If exists, provides the SDK an opportunity for the protocol to 'install' itself into the runtime. Inspired by mocking/testing utilities' setup/teardown methods for stubbing/mocking out functionality. Ensures, for example, that any protocol's expectations around stdout/stderr usage is honoured by userland or SDK code.

optional
uninstall: () => void

If exists, provides the SDK an opportunity for the protocol to 'uninstall' itself from the runtime.