2023-03-03 15:03:31 +01:00
|
|
|
import { z } from 'zod'
|
|
|
|
import { blockBaseSchema } from '../baseSchemas'
|
|
|
|
import { LogicBlockType } from './enums'
|
|
|
|
|
|
|
|
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]),
|
|
|
|
options: jumpOptionsSchema,
|
|
|
|
})
|
|
|
|
)
|
|
|
|
|
|
|
|
export type JumpBlock = z.infer<typeof jumpBlockSchema>
|