Skip to content

Asset.created_at type is wrong. #422

@ryanleecode

Description

@ryanleecode

The webhook passes it as a number but in the types its defined as a string.

ParseError: ((JsonString <-> unknown) <-> { readonly type: "video.asset.ready"; readonly id: string; readonly data: ({ readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined } <-> { readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: ("preparing" | "ready" | "errored" <-> "ready"); readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: ({ readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } <-> never) | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined }) } | { readonly type: "video.asset.errored"; readonly id: string; readonly data: ({ readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined } <-> { readonly id: string; readonly status: ("preparing" | "ready" | "errored" <-> "errored"); readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined }) } | { readonly id: string; readonly type: string & Brand<"video.asset.*">; readonly data: { readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined } })
└─ Type side transformation failure
   └─ { readonly type: "video.asset.ready"; readonly id: string; readonly data: ({ readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined } <-> { readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: ("preparing" | "ready" | "errored" <-> "ready"); readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: ({ readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } <-> never) | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined }) } | { readonly type: "video.asset.errored"; readonly id: string; readonly data: ({ readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined } <-> { readonly id: string; readonly status: ("preparing" | "ready" | "errored" <-> "errored"); readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined }) } | { readonly id: string; readonly type: string & Brand<"video.asset.*">; readonly data: { readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined } }
      ├─ Union member
      │  └─ { readonly type: "video.asset.ready"; readonly id: string; readonly data: ({ readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined } <-> { readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: ("preparing" | "ready" | "errored" <-> "ready"); readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: ({ readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } <-> never) | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined }) }
      │     └─ ["data"]
      │        └─ ({ readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined } <-> { readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: ("preparing" | "ready" | "errored" <-> "ready"); readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: ({ readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } <-> never) | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined })
      │           └─ Encoded side transformation failure
      │              └─ { readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined }
      │                 └─ ["created_at"]
      │                    └─ Expected a string, actual 1717971887
      └─ Union member
         └─ { readonly id: string; readonly type: string & Brand<"video.asset.*">; readonly data: { readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined } }
            └─ ["data"]
               └─ { readonly id: string; readonly created_at: string; readonly encoding_tier: "smart" | "baseline"; readonly master_access: "temporary" | "none"; readonly max_resolution_tier: "1080p" | "1440p" | "2160p"; readonly mp4_support: "standard" | "none" | "capped-1080p" | "audio-only" | "audio-only,capped-1080p"; readonly status: "preparing" | "ready" | "errored"; readonly aspect_ratio?: string | undefined; readonly duration?: number | undefined; readonly errors?: { readonly messages?: ReadonlyArray<string> | undefined; readonly type?: string | undefined } | undefined; readonly ingest_type?: "on_demand_url" | "on_demand_direct_upload" | "on_demand_clip" | "live_rtmp" | "live_srt" | undefined; readonly is_live?: boolean | undefined; readonly live_stream_id?: string | undefined; readonly max_stored_frame_rate?: number | undefined; readonly max_stored_resolution?: "Audio only" | "SD" | "HD" | "FHD" | "UHD" | undefined; readonly normalize_audio?: boolean | undefined; readonly passthrough?: string | undefined; readonly per_title_encode?: boolean | undefined; readonly playback_ids?: ReadonlyArray<{ readonly id: string; readonly policy: "public" | "signed" }> | undefined; readonly resolution_tier?: "audio-only" | "720p" | "1080p" | "1440p" | "2160p" | undefined; readonly source_asset_id?: string | undefined; readonly test?: boolean | undefined; readonly upload_id?: string | undefined }
                  └─ ["created_at"]
                     └─ Expected a string, actual 1717971887

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions