UNPKG

maests

Version:

An executable compiler for creating Maestro's yaml-flows with typescript.

30 lines (29 loc) 624 B
import { handleNest, addOut } from "../out.mjs"; const envAppId = process.env.appId, initFlow = ({ appId, onFlowStart } = {}) => { let commands = `appId: ${appId ?? envAppId} `; if (onFlowStart) { const flowCommand = `onFlowStart: ${handleNest(onFlowStart).replaceAll(/\n/g, ` `)}`; commands += flowCommand; } commands += `--- `, addOut(commands); }, launchApp = ({ appId } = {}) => { addOut(`- launchApp: appId: "${appId ?? envAppId}" `); }, clearState = ({ appId } = {}) => { addOut(appId ? `- clearState: ${appId} ` : `- clearState `); }; export { clearState, initFlow, launchApp };