Skip to content

feat: add bulk upload/download commands for directory and outbound batches#54

Merged
yorkable merged 3 commits into
mainfrom
add-bulk-operations
Apr 30, 2026
Merged

feat: add bulk upload/download commands for directory and outbound batches#54
yorkable merged 3 commits into
mainfrom
add-bulk-operations

Conversation

@yorkable

Copy link
Copy Markdown
Contributor

Summary

  • Adds three previously-missing bulk operations from the embedded OpenAPI spec to the CLI: syllable directory upload --file <path> (PUT multipart), syllable directory download [--format normalized|raw], and syllable outbound batches upload <batch-id> --file <path> (POST multipart).
  • Refactors the multipart helper into a shared doMultipart and adds PutMultipart (the directory bulk-load endpoint is PUT, no PUT-multipart helper existed).
  • The shared helper now honors --file - by streaming os.Stdin, which also fixes the same documented-but-broken behavior in the existing insights folders upload-file command.

Test plan

  • go build ./... clean
  • go test ./... all packages pass
  • New tests pass: TestDirectoryUpload, TestDirectoryUploadStdin, TestDirectoryDownload, TestOutboundBatchesUpload
  • Help text renders for all three new commands
  • Live smoke test against a dev/sandbox org of your choosing — recommended round-trip: syllable directory upload --file members.csvsyllable directory download > out.csv

🤖 Generated with Claude Code

yorkable and others added 2 commits April 30, 2026 10:35
…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]>
@yorkable
yorkable merged commit c662189 into main Apr 30, 2026
2 checks passed
@yorkable
yorkable deleted the add-bulk-operations branch April 30, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant