import type { TriggerDefinition } from "../types" import * as z from "zod/mini" const CRON_PRESENTATION_CONFIG_SCHEMA = z.object({ schedule: z.string(), timeZone: z.prefault(z.string(), "UTC"), }) export const cronTickTriggerDefinition = { getDetails: ({ config }) => { const parsedConfig = CRON_PRESENTATION_CONFIG_SCHEMA.parse(config) return [ { label: "Schedule", value: parsedConfig.schedule }, { label: "Time zone", value: parsedConfig.timeZone }, ] }, icon: "schedule", name: "Cron schedule", type: "cron.tick", } as const satisfies TriggerDefinition