5
packages/schemas/features/blocks/logic/wait/constants.ts
Normal file
5
packages/schemas/features/blocks/logic/wait/constants.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { WaitBlock } from './schema'
|
||||
|
||||
export const defaultWaitOptions = {
|
||||
shouldPause: false,
|
||||
} as const satisfies WaitBlock['options']
|
1
packages/schemas/features/blocks/logic/wait/index.ts
Normal file
1
packages/schemas/features/blocks/logic/wait/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './schema'
|
17
packages/schemas/features/blocks/logic/wait/schema.ts
Normal file
17
packages/schemas/features/blocks/logic/wait/schema.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { z } from 'zod'
|
||||
import { blockBaseSchema } from '../../shared'
|
||||
import { LogicBlockType } from '../constants'
|
||||
|
||||
export const waitOptionsSchema = z.object({
|
||||
secondsToWaitFor: z.string().optional(),
|
||||
shouldPause: z.boolean().optional(),
|
||||
})
|
||||
|
||||
export const waitBlockSchema = blockBaseSchema.merge(
|
||||
z.object({
|
||||
type: z.enum([LogicBlockType.WAIT]),
|
||||
options: waitOptionsSchema.optional(),
|
||||
})
|
||||
)
|
||||
|
||||
export type WaitBlock = z.infer<typeof waitBlockSchema>
|
Reference in New Issue
Block a user