@mux/ai 0.47.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- export { D as DEFAULT_STORYBOARD_WIDTH, H as HeatmapOptions, a as HeatmapResponse, L as LOW_CONFIDENCE_THRESHOLD, M as MAX_CUE_TEXT_CHARS, T as ThumbnailOptions, b as TranscriptFetchOptions, c as TranscriptResult, V as VTTCue, d as VTTCueBudgetChunkingOptions, e as VTTDurationChunk, f as VTTDurationChunkingOptions, g as buildTranscriptUrl, h as buildVttFromCueBlocks, j as buildVttFromTranslatedCueBlocks, k as chunkByTokens, l as chunkText, m as chunkVTTCues, n as chunkVTTCuesByBudget, o as chunkVTTCuesByDuration, p as concatenateVttSegments, q as estimateTokenCount, r as extractTextFromVTT, s as extractTimestampedTranscript, t as fetchTranscriptForAsset, u as filterVttByScope, v as findCaptionTrack, w as getHeatmapForAsset, x as getHeatmapForPlaybackId, y as getHeatmapForVideo, z as getReadyTextTracks, A as getReliableLanguageCode, B as getStoryboardUrl, C as getThumbnailUrls, E as parseVTTCues, F as replaceCueText, G as sanitizeUntrustedText, I as secondsToTimestamp, J as splitVttPreambleAndCueBlocks, K as stripVttMetadataBlocks, N as vttTimestampToSeconds } from '../index-DAuzEXly.js';
2
- export { q as CompletedShotsResult, r as ErroredShotsResult, H as Hotspot, s as HotspotOptions, t as HotspotResponse, u as PendingShotsResult, v as Shot, w as ShotRequestOptions, x as ShotsResult, y as WaitForShotsOptions, z as getHotspotsForAsset, B as getHotspotsForPlaybackId, D as getHotspotsForVideo, F as getShotsForAsset, G as requestShotsForAsset, J as waitForShotsForAsset } from '../shots-BwpjZDpr.js';
1
+ export { D as DEFAULT_STORYBOARD_WIDTH, H as HeatmapOptions, a as HeatmapResponse, L as LOW_CONFIDENCE_THRESHOLD, M as MAX_CUE_TEXT_CHARS, T as ThumbnailOptions, b as TranscriptFetchOptions, c as TranscriptResult, V as VTTCue, d as VTTCueBudgetChunkingOptions, e as VTTDurationChunk, f as VTTDurationChunkingOptions, g as buildTranscriptUrl, h as buildVttFromCueBlocks, j as buildVttFromTranslatedCueBlocks, k as chunkByTokens, l as chunkText, m as chunkVTTCues, n as chunkVTTCuesByBudget, o as chunkVTTCuesByDuration, p as concatenateVttSegments, q as estimateTokenCount, r as extractTextFromVTT, s as extractTimestampedTranscript, t as fetchTranscriptForAsset, u as filterVttByScope, v as findCaptionTrack, w as getHeatmapForAsset, x as getHeatmapForPlaybackId, y as getHeatmapForVideo, z as getReadyTextTracks, A as getReliableLanguageCode, B as getStoryboardUrl, C as getThumbnailUrls, E as parseVTTCues, F as replaceCueText, G as sanitizeUntrustedText, I as secondsToTimestamp, J as splitVttPreambleAndCueBlocks, K as stripVttMetadataBlocks, N as vttTimestampToSeconds } from '../index-nu1UOAMW.js';
2
+ export { q as CompletedShotsResult, D as DeletedShotsResult, r as ErroredShotsResult, H as Hotspot, s as HotspotOptions, t as HotspotResponse, u as PendingShotsResult, v as Shot, w as ShotRequestOptions, x as ShotsResult, y as SkippedShotsResult, z as WaitForShotsOptions, B as getHotspotsForAsset, F as getHotspotsForPlaybackId, G as getHotspotsForVideo, J as getShotsForAsset, K as requestShotsForAsset, L as waitForShotsForAsset } from '../shots-3wmvZnUV.js';
3
3
  import '@mux/ts';
@@ -1011,21 +1011,21 @@ async function fetchShotsFromManifest(shotsManifestUrl) {
1011
1011
  async function transformShotsResponse(data) {
1012
1012
  switch (data.status) {
1013
1013
  case "pending":
1014
+ case "skipped":
1015
+ case "deleted":
1014
1016
  return {
1015
- status: "pending",
1017
+ status: data.status,
1016
1018
  createdAt: data.created_at
1017
1019
  };
1018
- case "errored": {
1019
- const details = data.errors ?? data.error;
1020
+ case "errored":
1020
1021
  return {
1021
1022
  status: "errored",
1022
1023
  createdAt: data.created_at,
1023
1024
  error: {
1024
- type: details?.type ?? "unknown",
1025
- messages: details?.messages ?? []
1025
+ type: data.errors?.type ?? "unknown",
1026
+ messages: data.errors?.messages ?? []
1026
1027
  }
1027
1028
  };
1028
- }
1029
1029
  case "completed":
1030
1030
  if (!data.shots_manifest_url) {
1031
1031
  throw new Error("Completed shots response is missing shots_manifest_url");
@@ -1101,6 +1101,15 @@ async function waitForShotsForAsset(assetId, options = {}) {
1101
1101
  if (result.status === "errored") {
1102
1102
  throw new MuxAiError(`Shot generation failed for asset ${assetId}.`);
1103
1103
  }
1104
+ if (result.status === "skipped") {
1105
+ throw new MuxAiError(
1106
+ `Shot generation was skipped for asset ${assetId}; the asset may have no video track.`,
1107
+ { type: "validation_error" }
1108
+ );
1109
+ }
1110
+ if (result.status === "deleted") {
1111
+ throw new MuxAiError(`Shots for asset ${assetId} have been deleted.`, { type: "validation_error" });
1112
+ }
1104
1113
  if (attempt < normalizedMaxAttempts - 1) {
1105
1114
  await sleep(normalizedPollIntervalMs);
1106
1115
  }