Interface
Returns the public URL for the given content key. For the local driver,
this is the path under /public/ that Next.js serves. For the S3
driver, this is the bucket URL (and optionally signed).
Returns whether a blob for the given key exists in the underlying store. Used by the seed generator to verify content is present, and by future code paths that need to surface "missing media" states.
Reads a bounded UTF-8 text blob for a known text key. Implementations
MUST validate that the key is safe (no absolute prefixes, no .. path
segments) and reject keys that point to binary asset types before
returning any text. Missing or non-text keys reject; the read is not
a general arbitrary-path API.
Driven-adapter primitive: resolves opaque content "keys" to URLs (and checks whether a key exists in the underlying store).
BlobStore is not a domain port. The domain (
src/domain/**) does not import this file — it sees URLs as plain strings onVideoLesson.sourceandResource.url. The BlobStore exists so that lesson/resource adapters can stay agnostic to whether content is served from a local folder in development or from an S3-compatible bucket in production; only the BlobStore implementation changes.A "key" is an opaque, store-agnostic, URL-safe identifier such as
advanced-intermediate-course/5-sound-natural-intonation/03-falling-intonation.mp4. Keys MUST be kebab-case ASCII (no spaces, no&/#/:).Future drivers:
S3BlobStore,R2BlobStore. Seeopenspec/changes/filesystem-backed-course-content/design.mdfor the migration plan.