fix(producer): validate render request engine snapshots

This commit is contained in:
James
2026-07-17 16:22:23 -04:00
parent 25dd4cc8c0
commit fc4e9a6c0e
5 changed files with 238 additions and 5 deletions
+2 -3
View File
@@ -1,6 +1,7 @@
import {
isVideoFrameFormat,
resolveConfig,
validateEngineConfigSnapshot,
type EngineConfig,
type VideoFrameFormat,
} from "@hyperframes/engine";
@@ -176,9 +177,7 @@ function assertRequestOptionScalars(options: Record<string, unknown>): void {
}
function assertRequestOptionObjects(options: Record<string, unknown>): void {
if (!isPlainObject(options.engineConfig)) {
throw new Error("Render request must contain a resolved engineConfig snapshot");
}
validateEngineConfigSnapshot(options.engineConfig);
if (options.variables !== undefined && !isPlainObject(options.variables)) {
throw new Error("Render request variables must be a JSON object");
}