Skip to content

Contract Alignment

This client consumes majestic-api-contracts wire shapes. BrightScript has no TypeScript; models are documented here and maintained to match schemas.

LibraryResponse (GET /library)

FieldTypeRequiredNotes
itemsArrayLibraryMovieItem[]
contract_versionStringSemVer from server
system_warningString?
deviceStringDevice id used
health_summaryString?e.g. "125 playable · 3 need review · 12 not playable"

Query params: device, filter (playable | all | integrity-flagged), media_type (digital | physical | all)

LibraryMovieItem

FieldTypeNotes
movie_idInteger?
titleString
yearInteger?
poster_urlString?Server-relative URL
backdrop_urlString?
overviewString?
editionsArrayLibraryEdition[]
default_edition_indexIntegerServer-computed
badgeStringintegrity_flagged, missing, etc.
physical_copiesArray?
has_digital_apple_tvBoolean?
has_digital_fandangoBoolean?

LibraryEdition

FieldTypeNotes
media_file_idInteger
labelString
stream_urlStringPlayback URL
is_playableBooleanAuthoritative - use for UI
has_adaptive_fallbackBooleanCreate Compatible Audio
playback_status_primary_textStringServer precomputed
display_labelStringServer precomputed
...See libraryEdition.schema.json

No client logic for: playback_prediction mapping, display formatting, compatibility evaluation. Server provides all.

ApiError (4xx/5xx error bodies)

Structured error responses. Parse JSON body when status is 400, 403, 503.

FieldTypeRequiredNotes
errorStringMachine-readable code: unresolved, video_incompatible, no_compatible_audio, artifact_build_failed, media_unavailable
messageString?Human-readable
match_reasonString?For unresolved
hintString?User guidance
adaptiveAvailableBoolean?Create Compatible Audio available
videoTranscodeAvailableBoolean?Transcode available
editionAudioString?
requiredString?
policyString?

Schema: majestic-api-contracts schemas/apiError.schema.json

Contract version and hash embedded at build time.