Add poster_time to file/gallery field value types#50
Merged
Conversation
The CMA returns (and accepts) a `poster_time` metadata key on file and gallery field values for video assets — the float second into the video used to generate the thumbnail. The hand-written field value types didn't include it, so it was missing from `FileFieldValue`, `FileFieldValueInRequest`, and (via re-export) the gallery equivalents. - Add `poster_time` to `FileFieldValue` (`number | null`) and `FileFieldValueInRequest` (`number | null`, optional). - Require `poster_time` in the `isFileFieldValue` response type guard, matching the existing `focal_point` check. - Surface `poster_time` in `inspectItem` for file and gallery items. Gallery types derive from the file types, so they pick this up for free. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e3c4e95 to
bcda3fd
Compare
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.
What
The CMA returns (and accepts) a
poster_timemetadata key on file and gallery field values for video assets — the float second into the video used to generate the thumbnail (the video counterpart offocal_pointfor images). The hand-written field value types were missing it.Changes
poster_timetoFileFieldValue(number | null) andFileFieldValueInRequest(number | null, optional), inpackages/cma-client/src/fieldTypes/file.ts.poster_timein theisFileFieldValueresponse type guard, matching the existingfocal_pointcheck.poster_timeininspectItemfor both file and gallery items (guarded, so existing snapshots are unaffected).GalleryItem/GalleryFieldValuederive from the file types, so they pick this up automatically.Context
Mirrors the corresponding docs/hyperschema update on the API side documenting
poster_timein the single-asset and asset gallery fields. The generatedApiTypes/RawApiTypesalready carryposter_timefor the uploaddefault_field_metadata(generated from the hyperschema); these hand-written record field-value types are the part that needed a manual update.🤖 Generated with Claude Code