{"id":15714275,"url":"https://github.com/slackapi/deno-slack-runtime","last_synced_at":"2025-03-16T07:31:39.570Z","repository":{"id":38773916,"uuid":"475118465","full_name":"slackapi/deno-slack-runtime","owner":"slackapi","description":"Helper library for running a Run on Slack Deno function","archived":false,"fork":false,"pushed_at":"2024-12-02T01:57:51.000Z","size":139,"stargazers_count":16,"open_issues_count":7,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-15T23:41:35.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slackapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-28T17:56:14.000Z","updated_at":"2025-03-11T06:36:50.000Z","dependencies_parsed_at":"2023-12-04T22:30:37.495Z","dependency_job_id":"f8fc10cd-cfb8-4118-bc59-ff61a80dce83","html_url":"https://github.com/slackapi/deno-slack-runtime","commit_stats":{"total_commits":51,"total_committers":14,"mean_commits":3.642857142857143,"dds":0.7254901960784313,"last_synced_commit":"73f0a717b936c12c59ea65afd4d80ee9f8b884c9"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Fdeno-slack-runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Fdeno-slack-runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Fdeno-slack-runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Fdeno-slack-runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slackapi","download_url":"https://codeload.github.com/slackapi/deno-slack-runtime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841126,"owners_count":20356440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T21:35:48.538Z","updated_at":"2025-03-16T07:31:39.088Z","avatar_url":"https://github.com/slackapi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno-slack-runtime\n\n[![codecov](https://codecov.io/gh/slackapi/deno-slack-runtime/graph/badge.svg?token=D7U34ERPH0)](https://codecov.io/gh/slackapi/deno-slack-runtime)\n\nHelper library for running a Run on Slack Deno function. The goal of this\nproject is to provide modules for:\n\n1. Parsing function execution event payloads into JSON (`src/parse-payload.ts`)\n2. Dynamically loading the target function (`src/load-function-module.ts`)\n3. Dispatching event payloads to individual functions by callback ID and running\n   them (`src/dispatch-payload.ts`)\n\nThis library has two modes of operation:\n\n1. Using `mod.ts` as the entrypoint, a directory containing function code files\n   to be loaded at runtime must be provided as an argument. This directory must\n   contain one source file per function, with each filename matching the\n   function ID, i.e. if a function to be invoked has a `callback_id` of\n   `reverse`, the provided directory argument must contain a `reverse.ts` or a\n   `reverse.js`.\n2. Using `local-run.ts` as the entrypoint, the current working directory must\n   contain a `manifest.json`, `manifest.ts` or `manifest.js` file, which in turn\n   must contain function definitions that include a `source_file` property. This\n   property is used to determine which function to load and run at runtime.\n\nRegardless of which mode of operation used, each runtime definition for a\nfunction is specified in its own file and must be the default export.\n\n## Usage\n\nBy default, your Slack app has a `/slack.json` file that defines a `get-hooks`\nhook. The Slack CLI will automatically use the version of the\n`deno-slack-runtime` that is specified by the version of the `get-hooks` script\nthat you're using. To use this library via the Slack CLI out of the box, use the\n`slack run` command in your terminal. This will automatically run the `start`\nhook and wait for events to parse the payload.\n\n### Override\n\nYou also have the option to\n[override this hook](https://github.com/slackapi/deno-slack-hooks#script-overrides)!\nYou can change the script that runs by specifying a new script for the `start`\ncommand. For instance, if you wanted to point to your local instance of this\nrepo, you could accomplish that by adding a `start` command to your\n`/slack.json` file and setting it to the following:\n\n```json\n{\n  \"hooks\": {\n    /* ... */\n    \"start\": \"deno run -q --config=deno.jsonc --allow-read --allow-net file:///\u003cpath-to-your-local-repo\u003e/local-run.ts\"\n  }\n}\n```\n\nThe script may be one of the following, depending on which mode you are\noperating this library in:\n\n1. Explicit function directory as argument:\n   `deno run -q --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_runtime@0.1.1/mod.ts ./\u003crequired-function-directory\u003e`\n2. Local project with a manifest file:\n   `deno run -q --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_runtime@0.1.1/local-run.ts`\n\n⚠️ Don't forget to update the version specifier in the URL inside the above\ncommands to match the version you want to test! You can also drop the `@` and\nthe version specifier to use the latest released version. You can also use the\n`file:///` protocol to point to a version present on your local filesystem.\n\n## CLI\n\nYou can also invoke this library directly from the command line:\n\n```zsh\ndeno run -q --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_runtime@0.1.1/mod.ts [-p \u003cport\u003e]\n```\n\nWhich will start an API Server that will exectue user provided code\n\n### GET /health\n\nReturns `200 OK` when called, the runtime will use this route to ensure the\nserver is ready to handle requests\n\n### POST /functions\n\nPost Body contains the event payload that used to be read via stdout. Returns\n`200 OK` when there are no errors with finding and executing the expected user\ncode. Will return a `500` otherwise.\n\n## Running Tests\n\nIf you make changes to this repo, or just want to make sure things are working\nas desired, you can run:\n\n```zsh\ndeno task test\n```\n\nTo get a full test coverage report, run:\n\n```zsh\ndeno task coverage\n```\n\n---\n\n### Getting Help\n\nWe welcome contributions from everyone! Please check out our\n[Contributor's Guide](https://github.com/slackapi/deno-slack-runtime/blob/main/.github/CONTRIBUTING.md)\nfor how to contribute in a helpful and collaborative way.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslackapi%2Fdeno-slack-runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslackapi%2Fdeno-slack-runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslackapi%2Fdeno-slack-runtime/lists"}