@sesionario/media-contracts
v1.3.0
Published
Shared types, Zod schemas, and JSON Schema for the Sesionario media platform (live streaming + VOD)
Maintainers
Readme
@sesionario/media-contracts
Shared types, Zod schemas, JSON Schema, and OpenAPI for the Sesionario media platform (live streaming + VOD).
Published to npm as @sesionario/media-contracts (public registry).
Install
pnpm add @sesionario/media-contractsLocal development (before first publish)
In media or media-svc, link the package from this repo:
pnpm add file:../media-contractsBuild
pnpm install
pnpm run build # emits dist/ + regenerates schemas/*.json
pnpm run testReleases
Releases are automated via semantic-release on push to main or dev. Use Conventional Commits to drive version bumps:
feat:— minor bumpfix:— patch bumpfeat!:orBREAKING CHANGE:— major bump
Channels
| Branch | npm dist-tag | Install |
| ------ | ------------ | ----------------------------------------- |
| dev | rc | pnpm add @sesionario/media-contracts@rc |
| main | latest | pnpm add @sesionario/media-contracts |
RC versions look like 1.4.0-rc.1; stable versions like 1.4.0.
Git flow
- Open feature PRs against
dev. - Merging into
devpublishes a release candidate to thercdist-tag. - When ready, open a PR from
dev→mainto promote to a stable release onlatest.
npm trusted publishing (one-time setup)
Publishing uses OIDC trusted publishing from GitHub Actions — no long-lived NPM_TOKEN is stored in the repo.
- Create the package on npmjs (first publish) or ensure
@sesionario/media-contractsexists under the@sesionarioscope. - On npmjs.com → package → Settings → Trusted publishing, add:
- Provider: GitHub Actions
- Repository:
docufacil/media-contracts - Workflow filename:
release.yml(exact match, case-sensitive)
- Ensure the
devbranch exists on GitHub before the first RC release.
Exports
@sesionario/media-contracts— TypeScript types + Zod schemas@sesionario/media-contracts/schemas/*— JSON Schema files@sesionario/media-contracts/openapi.yaml— public API spec formedia-svc
Domain model
Live stream (kind: "live")
A real-time RTMP ingest → ABR HLS broadcast.
Status flow: provisioning → ingest_ready → preview → live → ended | error
VOD item (kind: "vod")
An uploaded video file transcoded to ABR HLS.
Status flow: awaiting_upload → queued → transcoding → ready | error
MediaItem
A discriminated union of LiveStream | VodItem, used by the unified /media listing endpoint.
TypeScript ↔ Python correspondence (media-engine)
| TypeScript (@sesionario/media-contracts) | Python (media-engine) |
| ------------------------------------------ | ---------------------------- |
| LiveStreamStatus | LiveStreamStatus (Literal) |
| LiveStream | LiveStream (Pydantic) |
| VodStatus | VodStatus (Literal) |
| VodItem | VodItem (Pydantic) |
| MediaItem | MediaItem (Union type) |
| SpawnRequest | SpawnRequest |
| SpawnResponse | SpawnResponse |
| StopRequest | StopRequest |
| StopResponse | StopResponse |
| IngestReadyWebhook | IngestReadyWebhook |
| AuthorizeRequest | AuthorizeRequest |
| AuthorizeResponse | AuthorizeResponse |
| R2Credentials | R2Credentials |
| TranscodeVodRequest | TranscodeVodRequest |
| TranscodeVodResponse | TranscodeVodResponse |
| VodReadyWebhook | VodReadyWebhook |
Keep Python models in media-engine/src/models.py manually synchronized when contracts change.
License
MIT
