@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 +1 -1
- package/dist/index.js +15 -4
- 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 +14 -3
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
package/dist/workflows/index.js
CHANGED
|
@@ -4228,19 +4228,30 @@ function getShotsPath(assetId) {
|
|
|
4228
4228
|
return `/video/v1/assets/${assetId}/shots`;
|
|
4229
4229
|
}
|
|
4230
4230
|
function mapManifestShots(shots) {
|
|
4231
|
-
|
|
4232
|
-
|
|
4231
|
+
let usedDeprecatedField = false;
|
|
4232
|
+
const mapped = shots.map((shot, index) => {
|
|
4233
|
+
const { start_time: startTime } = shot;
|
|
4234
|
+
const imageUrl = shot.shot_preview_image_url ?? shot.image_url;
|
|
4235
|
+
if (shot.shot_preview_image_url === void 0 && shot.image_url !== void 0) {
|
|
4236
|
+
usedDeprecatedField = true;
|
|
4237
|
+
}
|
|
4233
4238
|
if (typeof startTime !== "number" || !Number.isFinite(startTime)) {
|
|
4234
4239
|
throw new TypeError(`Invalid shot start_time in shots manifest at index ${index}`);
|
|
4235
4240
|
}
|
|
4236
4241
|
if (typeof imageUrl !== "string" || imageUrl.length === 0) {
|
|
4237
|
-
throw new TypeError(`Invalid shot
|
|
4242
|
+
throw new TypeError(`Invalid shot shot_preview_image_url in shots manifest at index ${index}`);
|
|
4238
4243
|
}
|
|
4239
4244
|
return {
|
|
4240
4245
|
startTime,
|
|
4241
4246
|
imageUrl
|
|
4242
4247
|
};
|
|
4243
4248
|
});
|
|
4249
|
+
if (usedDeprecatedField) {
|
|
4250
|
+
console.warn(
|
|
4251
|
+
"The 'image_url' field in the Mux shots manifest is deprecated and will be removed. Use 'shot_preview_image_url' instead."
|
|
4252
|
+
);
|
|
4253
|
+
}
|
|
4254
|
+
return mapped;
|
|
4244
4255
|
}
|
|
4245
4256
|
async function fetchShotsFromManifest(shotsManifestUrl) {
|
|
4246
4257
|
const response = await fetch(shotsManifestUrl);
|