feat: add download subcommand for Slack files (0.4.0)#6
Merged
Conversation
Adds a first-class `nori-slack download --id <F123> --output <path>` subcommand that resolves a file and writes its raw bytes to disk, replacing the base64 `files.download` proxy hack. - Transport gains `downloadFile()` with proxy- and direct-mode impls. - Direct mode guards against Slack's HTTP-200 HTML sign-in page, which would otherwise be written to disk as a "successful" download. - Test runs are serialized (--no-file-parallelism) to stop subprocess CLI tests flaking under vitest concurrency. 🤖 Generated with [Nori](https://noriagentic.com) Co-Authored-By: Nori <contact@tilework.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
🤖 Generated with Nori
nori-slack download --id <F123> --output <path>subcommand that resolves a file and writes its raw bytes to disk, replacing the old base64files.downloadproxy hack. (Uses--id, deliberately not--file, to avoid colliding withupload --file.)TransportgainsdownloadFile()with proxy- and direct-mode implementations. Proxy mode hits the broker's newGET /slack-proxy/download(the session has no bot token); direct mode resolvesfiles.infothen fetchesurl_private_downloadwith the bot token.--no-file-parallelism) to stop subprocess-based CLI tests flaking under vitest concurrency.Test Plan
npm test(proxy-mode happy path + 403/404/401 error mapping + arg validation; direct-mode byte fetch + HTML-login-page rejection)npx tsc --noEmitcleannori-slack download --id F123 --output ./out.binagainst a real broker proxy and a direct bot token