@mux/ai 0.24.0 → 0.26.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 +1 -1
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/dist/primitives/index.js +14 -3
- package/dist/primitives/index.js.map +1 -1
- package/dist/workflows/index.js +25 -4
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
package/dist/primitives/index.js
CHANGED
|
@@ -827,19 +827,30 @@ function getShotsPath(assetId) {
|
|
|
827
827
|
return `/video/v1/assets/${assetId}/shots`;
|
|
828
828
|
}
|
|
829
829
|
function mapManifestShots(shots) {
|
|
830
|
-
|
|
831
|
-
|
|
830
|
+
let usedDeprecatedField = false;
|
|
831
|
+
const mapped = shots.map((shot, index) => {
|
|
832
|
+
const { start_time: startTime } = shot;
|
|
833
|
+
const imageUrl = shot.shot_preview_image_url ?? shot.image_url;
|
|
834
|
+
if (shot.shot_preview_image_url === void 0 && shot.image_url !== void 0) {
|
|
835
|
+
usedDeprecatedField = true;
|
|
836
|
+
}
|
|
832
837
|
if (typeof startTime !== "number" || !Number.isFinite(startTime)) {
|
|
833
838
|
throw new TypeError(`Invalid shot start_time in shots manifest at index ${index}`);
|
|
834
839
|
}
|
|
835
840
|
if (typeof imageUrl !== "string" || imageUrl.length === 0) {
|
|
836
|
-
throw new TypeError(`Invalid shot
|
|
841
|
+
throw new TypeError(`Invalid shot shot_preview_image_url in shots manifest at index ${index}`);
|
|
837
842
|
}
|
|
838
843
|
return {
|
|
839
844
|
startTime,
|
|
840
845
|
imageUrl
|
|
841
846
|
};
|
|
842
847
|
});
|
|
848
|
+
if (usedDeprecatedField) {
|
|
849
|
+
console.warn(
|
|
850
|
+
"The 'image_url' field in the Mux shots manifest is deprecated and will be removed. Use 'shot_preview_image_url' instead."
|
|
851
|
+
);
|
|
852
|
+
}
|
|
853
|
+
return mapped;
|
|
843
854
|
}
|
|
844
855
|
async function fetchShotsFromManifest(shotsManifestUrl) {
|
|
845
856
|
const response = await fetch(shotsManifestUrl);
|