Skip to main content
Glama

mcp-google-sheets

migrate-v0-branch-to-router.ts2.19 kB
import { BranchExecutionType, FlowAction, FlowActionType, RouterAction, RouterExecutionType } from '../../actions/action' import { FlowVersion } from '../../flow-version' import { flowStructureUtil } from '../../util/flow-structure-util' import { Migration } from '.' export const migrateBranchToRouter: Migration = { targetSchemaVersion: undefined, migrate: (flowVersion: FlowVersion) => { const newVersion = flowStructureUtil.transferFlow(flowVersion, (step) => { const unschemedStep = step as unknown as { type: string, settings: { conditions: unknown[] }, onSuccessAction: FlowAction | null, onFailureAction: FlowAction | null } if (unschemedStep.type === 'BRANCH') { const routerAction: RouterAction = { displayName: step.displayName, name: step.name, valid: step.valid, type: FlowActionType.ROUTER, settings: { branches: [ { branchName: 'Branch 1', conditions: step.settings.conditions, branchType: BranchExecutionType.CONDITION, }, { branchName: 'Otherwise', branchType: BranchExecutionType.FALLBACK, }, ], executionType: RouterExecutionType.EXECUTE_FIRST_MATCH, sampleData: { sampleDataFileId: undefined, sampleDataInputFileId: undefined, lastTestDate: undefined, }, }, nextAction: step.nextAction, children: [unschemedStep.onSuccessAction ?? null, unschemedStep.onFailureAction ?? null], } return routerAction } return step }) return { ...newVersion, schemaVersion: '1', } }, }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server