feat(ai-sdk)!: decouple image/audio .store() from @rudderjs/storage (#37)#43
Merged
Conversation
) Second child of the @rudderjs decoupling epic (#35). - New exported neutral StorageAdapter contract (put(path, bytes)) in src/storage-adapter.ts. - ImageGenerator.store() and AudioGenerator.store() no longer lazy-import @rudderjs/storage. They take a REQUIRED caller-supplied storage arg (.store(path, storage)); construction-less guard throws a clear error if omitted. Image still fetches a url->bytes itself; audio passes its Buffer. - Exported StorageAdapter from the entry; updated the JSDoc examples. Breaking (0.x): .store(path) -> .store(path, storage). No in-repo callers used the old form. A Rudder app wraps @rudderjs/storage in a ~3-line adapter. Added store() tests (image base64, audio bytes, missing-adapter throw). Typecheck clean, 982 tests pass.
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.
Closes #37. Second child of the
@rudderjsdecoupling epic #35.What
StorageAdaptercontract (exported) - a one-method interfaceput(path, bytes)insrc/storage-adapter.ts.ImageGenerator.store()/AudioGenerator.store()no longer lazy-import@rudderjs/storage. They take a required caller-supplied storage:.store(path, storage). Image still does its ownurl -> bytesfetch; audio passes itsBuffer. Missing-adapter throws a clear error.StorageAdapterfrom the entry; updated the JSDoc examples.Breaking (0.x -> minor)
.store(path)is now.store(path, storage). No in-repo callers used the old form. A Rudder app wraps@rudderjs/storagein a ~3-line adapter:Verification
Added
.store()tests (image base64 path, audio bytes, missing-adapter throw). Typecheck clean, 982 tests pass. No@rudderjs/storagereferences remain insrc. Minor changeset included.