mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 14:50:02 +00:00
fix(producer): validate render request engine snapshots
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user