Skip to content

Commit b5030bb

Browse files
committed
narrowing this PR to socket mode only
1 parent a77ec51 commit b5030bb

3 files changed

Lines changed: 12 additions & 465 deletions

File tree

src/README.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ project is to provide modules for:
1010
3. Dispatching event payloads to individual functions by callback ID and running
1111
them (`src/dispatch-payload.ts`)
1212

13-
This library has four modes of operation:
13+
This library has multiple modes of operation:
1414

1515
1. Using `mod.ts` as the entrypoint, a directory containing function code files
1616
to be loaded at runtime must be provided as an argument. This directory must
@@ -22,22 +22,19 @@ This library has four modes of operation:
2222
contain a `manifest.json`, `manifest.ts` or `manifest.js` file, which in turn
2323
must contain function definitions that include a `source_file` property. This
2424
property is used to determine which function to load and run at runtime.
25-
3. Using `self-hosted-socket-mode.ts` as the entrypoint. This establishes a persistent
26-
WebSocket connection to Slack using Socket Mode and maintains a long-running process that listens for events.
27-
4. Using `self-hosted-http-mode.ts` as the entrypoint. This starts an HTTP server that
28-
accepts events via POST requests to `/events` endpoints, similar to Bolt JS's
29-
HTTPReceiver. The only required environment variable is
30-
`SLACK_SIGNING_SECRET`; optional variables include `PORT`,
31-
`SLACK_SIGNATURE_VERIFICATION`, and `SLACK_API_URL` (e.g.
32-
`SLACK_SIGNING_SECRET=xxx PORT=3000 deno run src/self-hosted-http-mode.ts`).
25+
3. Using `self-hosted-socket-mode.ts` as the entrypoint. This establishes a
26+
persistent WebSocket connection to Slack using Socket Mode and maintains a
27+
long-running process that listens for `function_executed` events. It expects
28+
a similar setup in the current working directory as the `local-run.ts`
29+
entrypoint.
3330

3431
Regardless of which mode of operation used, each runtime definition for a
3532
function is specified in its own file and must be the default export.
3633

3734
## Usage
3835

39-
By default, your Slack app has a `.slack/hooks.json` file that defines a `get-hooks`
40-
hook. The Slack CLI will automatically use the version of the
36+
By default, your Slack app has a `.slack/hooks.json` file that defines a
37+
`get-hooks` hook. The Slack CLI will automatically use the version of the
4138
`deno-slack-runtime` that is specified by the version of the `get-hooks` script
4239
that you're using. To use this library via the Slack CLI out of the box, use the
4340
`slack run` command in your terminal. This will automatically run the `start`
@@ -70,8 +67,6 @@ operating this library in:
7067
`deno run -q --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_runtime@0.1.1/local-run.ts`
7168
3. Self-hosted socket mode:
7269
`deno run -q --config=deno.jsonc --allow-read --allow-net --allow-run --allow-env --allow-sys=osRelease https://deno.land/x/deno_slack_runtime@0.1.1/self-hosted-socket-mode.ts`
73-
4. Self-hosted HTTP Receiver:
74-
`deno run -q --config=deno.jsonc --allow-read --allow-net --allow-env --allow-sys=osRelease https://deno.land/x/deno_slack_runtime@0.1.1/self-hosted-http-mode.ts`
7570

7671
⚠️ Don't forget to update the version specifier in the URL inside the above
7772
commands to match the version you want to test! You can also drop the `@` and

src/deps.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ export { parse } from "https://deno.land/std@0.99.0/flags/mod.ts";
66
export { getProtocolInterface } from "https://deno.land/x/deno_slack_protocols@0.0.2/mod.ts";
77
export type { Protocol } from "https://deno.land/x/deno_slack_protocols@0.0.2/types.ts";
88

9-
// Socket Mode dependencies (npm packages via Deno)
9+
// Dependencies for self-hosted-socket-mode.ts
1010
export { SocketModeClient } from "npm:@slack/socket-mode@2.0.5";
11-
export { ConsoleLogger, LogLevel } from "npm:@slack/logger@4.0.0";
11+
12+
// Logging dependencies for self-hosted entrypoints
1213
export type { Logger } from "npm:@slack/logger@4.0.0";
14+
export { ConsoleLogger, LogLevel } from "npm:@slack/logger@4.0.0";

0 commit comments

Comments
 (0)