Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

745 B
Raw Blame
import { isNil } from '@activepieces/core-utils'
import { flowStructureUtil, FlowVersion, Step } from '@activepieces/shared'
import { Migration } from '.'

export const migrateV17AddLastUpdatedDate: Migration = {
    targetSchemaVersion: '17',
    migrate: async (flowVersion: FlowVersion): Promise<FlowVersion> => {
        const newFlowVersion = flowStructureUtil.transferFlow(flowVersion, (step: Step) => {
            const lastTestDate = step.settings?.sampleData?.lastTestDate
            return {
                ...step,
                lastUpdatedDate: isNil(lastTestDate) ? flowVersion.updated : lastTestDate,
            }
        })
        return {
            ...newFlowVersion,
            schemaVersion: '18',
        }
    },
}