@mux/ai 0.24.0 → 0.25.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.
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import '@ai-sdk/google';
9
9
  import '@ai-sdk/openai';
10
10
  import '@mux/mux-node';
11
11
 
12
- var version = "0.24.0";
12
+ var version = "0.25.0";
13
13
 
14
14
  type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error";
15
15
  /**
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // package.json
8
- var version = "0.24.0";
8
+ var version = "0.25.0";
9
9
 
10
10
  // src/lib/language-codes.ts
11
11
  var ISO639_1_TO_3 = {
@@ -1601,19 +1601,30 @@ function getShotsPath(assetId) {
1601
1601
  return `/video/v1/assets/${assetId}/shots`;
1602
1602
  }
1603
1603
  function mapManifestShots(shots) {
1604
- return shots.map((shot, index) => {
1605
- const { start_time: startTime, image_url: imageUrl } = shot;
1604
+ let usedDeprecatedField = false;
1605
+ const mapped = shots.map((shot, index) => {
1606
+ const { start_time: startTime } = shot;
1607
+ const imageUrl = shot.shot_preview_image_url ?? shot.image_url;
1608
+ if (shot.shot_preview_image_url === void 0 && shot.image_url !== void 0) {
1609
+ usedDeprecatedField = true;
1610
+ }
1606
1611
  if (typeof startTime !== "number" || !Number.isFinite(startTime)) {
1607
1612
  throw new TypeError(`Invalid shot start_time in shots manifest at index ${index}`);
1608
1613
  }
1609
1614
  if (typeof imageUrl !== "string" || imageUrl.length === 0) {
1610
- throw new TypeError(`Invalid shot image_url in shots manifest at index ${index}`);
1615
+ throw new TypeError(`Invalid shot shot_preview_image_url in shots manifest at index ${index}`);
1611
1616
  }
1612
1617
  return {
1613
1618
  startTime,
1614
1619
  imageUrl
1615
1620
  };
1616
1621
  });
1622
+ if (usedDeprecatedField) {
1623
+ console.warn(
1624
+ "The 'image_url' field in the Mux shots manifest is deprecated and will be removed. Use 'shot_preview_image_url' instead."
1625
+ );
1626
+ }
1627
+ return mapped;
1617
1628
  }
1618
1629
  async function fetchShotsFromManifest(shotsManifestUrl) {
1619
1630
  const response = await fetch(shotsManifestUrl);