2023-03-03 15:03:31 +01:00
|
|
|
import { z } from 'zod'
|
2023-11-08 15:34:16 +01:00
|
|
|
import { blockBaseSchema } from '../../shared'
|
|
|
|
import { LogicBlockType } from '../constants'
|
2023-03-03 15:03:31 +01:00
|
|
|
|
|
|
|
export const jumpOptionsSchema = z.object({
|
|
|
|
groupId: z.string().optional(),
|
|
|
|
blockId: z.string().optional(),
|
|
|
|
})
|
|
|
|
|
2023-03-14 16:42:12 +01:00
|
|
|
export const jumpBlockSchema = blockBaseSchema.merge(
|
2023-03-03 15:03:31 +01:00
|
|
|
z.object({
|
|
|
|
type: z.enum([LogicBlockType.JUMP]),
|
2023-11-08 15:34:16 +01:00
|
|
|
options: jumpOptionsSchema.optional(),
|
2023-03-03 15:03:31 +01:00
|
|
|
})
|
|
|
|
)
|
|
|
|
|
|
|
|
export type JumpBlock = z.infer<typeof jumpBlockSchema>
|