feat(stream): video libraries, directory linking, uploads, and video management - #203
Draft
amir-at-bunny wants to merge 2 commits into
Draft
feat(stream): video libraries, directory linking, uploads, and video management#203amir-at-bunny wants to merge 2 commits into
amir-at-bunny wants to merge 2 commits into
Conversation
…face Stream error messages Verbose debug logging read every request body as JSON, which would buffer an entire video into memory on octet-stream uploads; non-JSON bodies are now described from their headers instead. Error extraction also learns the Stream API's StatusModel shape (lowercase message), so 400/422/429 responses carry the API's explanation instead of a generic HTTP error.
…management New experimental stream namespace: - stream library: list, create, show, credentials, delete (aliases: libraries, lib) - stream link / unlink: bind a directory to a library via .bunny/stream.json - stream upload: local file via binary PUT, or a URL fetched server side (--header for authenticated origins); library from --lib <id>, the linked directory, or an interactive picker - stream videos: list, show, update, delete by GUID Library CRUD runs on the core API with the account key; uploads and video commands use the library's own Stream API key, resolved automatically. No output format prints API keys (credentials --show-secret is the deliberate reveal path); JSON output strips ApiKey, ReadOnlyApiKey, and the deprecated ApiAccessKey.
|
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.
What
A new experimental
streamnamespace (hidden from--helpwhile it stabilizes, likesitesandstorage):bunny stream library(aliaseslibraries,lib):list,create(with create-time--replication-regions),show,credentials,deletebunny stream link [library]/bunny stream unlink: bind a directory to a library via.bunny/stream.json, mirroringbunny storage linkbunny stream upload <file-or-url>: local files go up as a binary PUT streamed off disk; a URL is fetched server side by bunny.net (--headerfor authenticated origins). Library comes from--lib <id>, the linked directory, or an interactive pickerbunny stream videos:list(with--search),show,update --title,delete, all by video GUID. There is deliberately novideos create;uploadis the create pathA separate first commit improves the shared client: verbose logging no longer reads non-JSON request bodies (an octet-stream upload would have been buffered into memory just to be logged), and error extraction learns the Stream API's
StatusModelshape so 400/422/429 responses surface the API's message.Design notes
api.bunny.net/videolibrary) with the account key. Uploads and video commands authenticate with the library's own Stream API key againstvideo.bunnycdn.com, resolved automatically, so nothing extra needs configuring.ApiKey,ReadOnlyApiKey, and the deprecatedApiAccessKey(which carries the same value asApiKey).credentials --show-secretis the single deliberate reveal path.--output jsonor without a TTY,--forceboth skips confirmations and disables destructive pickers, and upload cleanup only deletes a video shell whose status proves the bytes never landed.GET /videolibraryreturns a plain array at the defaultpage=0and the pagination envelope only forpage >= 1; name resolution pinspage: 1(with a regression test whose fake client mimics the real shape). The videos endpoint paginates bytotalItemswith an empty-page guard.Testing
packages/cliandpackages/openapi-client(about 90 new), including a stubbed-fetch test pinning the exact binary upload request (URL, AccessKey, content type, byte-for-byte body).bun run typecheckclean apart from the 4 pre-existing@bunny.net/database-adaptererrors on main; biome and prettier clean.--forcepicker safety, stale manifest cleanup) plus a dedicated secret/internal-info sweep of the diff.