feat: add bulk upload/download commands for directory and outbound batches#54
Merged
Conversation
…tches Wires up three OpenAPI operations that had no CLI coverage: - syllable directory upload --file <path> (PUT multipart) - syllable directory download [--format normalized|raw] - syllable outbound batches upload <batch-id> --file <path> Refactors the multipart helper to a shared doMultipart and adds PutMultipart. The helper now honors --file - by streaming os.Stdin, fixing the same gap in the existing insights folders upload-file command. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- directoryDownloadCmd: os.Stdout.Write(data) instead of fmt.Print(string(data)) preserves binary bytes if the endpoint ever returns non-UTF-8 content. - New TestInsightsFoldersUploadFileStdin locks in the side-benefit that doMultipart's --file - support fixes the long-broken insights upload path. Spec verified: upload_batch has no trailing slash in the OpenAPI spec; matches. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Locks in the exact trailing-slash convention the spec dictates for the three bulk endpoints. Slash-mismatch redirects can drop the Syllable-API-Key header on some clients, so the test fails loudly if a future spec sync changes any of these paths. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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
syllable directory upload --file <path>(PUT multipart),syllable directory download [--format normalized|raw], andsyllable outbound batches upload <batch-id> --file <path>(POST multipart).doMultipartand addsPutMultipart(the directory bulk-load endpoint is PUT, no PUT-multipart helper existed).--file -by streamingos.Stdin, which also fixes the same documented-but-broken behavior in the existinginsights folders upload-filecommand.Test plan
go build ./...cleango test ./...all packages passTestDirectoryUpload,TestDirectoryUploadStdin,TestDirectoryDownload,TestOutboundBatchesUploadsyllable directory upload --file members.csv→syllable directory download > out.csv🤖 Generated with Claude Code