maests
Version:
An executable compiler for creating Maestro's yaml-flows with typescript.
24 lines (23 loc) • 493 B
JavaScript
import { stringify } from "yaml";
import { addOut } from "../out.mjs";
const allowedMimeTypes = [
"image/png",
"image/jpeg",
"image/jpg",
"image/gif",
"video/mp4"
], addMedia = (mimeType, filePath) => {
if (!allowedMimeTypes.includes(mimeType))
throw new Error(
`Unsupported MIME type. Allowed types are: ${allowedMimeTypes.join(", ")}`
);
const commands = [
{
addMedia: [`${filePath}`]
}
];
addOut(stringify(commands));
};
export {
addMedia
};