Files
bitvid/scripts/vendor/blossom-sdk-entry.mjs
T
thePR0M3TH3ANandClaude Opus 4.8 02e60f1842 feat(storage): Blossom Phase 0 — flag + vendored SDK + service skeleton (#30)
Phase 0 of docs/blossom-plan.md. No UX; off-by-default ("off = no trace").

- Vendored: pinned [email protected] bundled by scripts/build-blossom-sdk.mjs
  → vendor/blossom-client-sdk.bundle.min.js (esbuild, browser ESM, ~27KB). The
  optional @cashu/cashu-ts peer dep (BUD-07 payments, only reached on a lazy 402
  branch bitvid never hits) is aliased to a throwing stub. `npm run build:blossom-sdk`.
- Flag: FEATURE_BLOSSOM_STORAGE wired like FEATURE_AUDIO_INGEST / _BITCOIN_CONNECT
  (instance-config → config → constants), default FALSE.
- Service: js/services/blossomService.js implements the same
  uploadFile({…}) → {url,key} contract as s3UploadService (so a later
  isBlossomProvider branch drops into mediaUploader). Lazy-loads the SDK; core
  path = createUploadAuth(signer, sha256) + multiServerUpload (BUD-11 auth via
  bitvid's existing signer, BUD-04 mirror). Torrent parity + result-shape mapping +
  mediaUploader wiring + Storage-pane config land in Phase 1.

Tests: tests/blossom-service.test.mjs (5 — availability gate + input guards).
Lint + build clean. Nothing wired into the app yet.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-09 15:42:19 -04:00

26 lines
1.0 KiB
JavaScript

// Vendor entry for blossom-client-sdk (hzrd149), bundled by
// scripts/build-blossom-sdk.mjs into vendor/blossom-client-sdk.bundle.min.js so
// bitvid can lazy-import it behind FEATURE_BLOSSOM_STORAGE without a runtime CDN.
// Re-exports only the surface bitvid needs. See docs/blossom-plan.md.
//
// The action helpers live under the `./actions/*` subpaths (the root entry
// namespaces them as `Actions`); auth + discovery are top-level modules.
export {
createUploadAuth,
createMirrorAuth,
createListAuth,
encodeAuthorizationHeader,
} from "blossom-client-sdk/auth";
export {
getServersFromServerListEvent,
USER_BLOSSOM_SERVER_LIST_KIND,
} from "blossom-client-sdk/nostr";
export {
multiServerUpload,
multiServerMediaUpload,
} from "blossom-client-sdk/actions/multi-server";
export { uploadBlob } from "blossom-client-sdk/actions/upload";
export { mirrorBlob } from "blossom-client-sdk/actions/mirror";
export { listBlobs, iterateBlobs } from "blossom-client-sdk/actions/list";
export { deleteBlob } from "blossom-client-sdk/actions/delete";