2
0
Files
bot/packages/schemas/features/blocks/inputs/url/schema.ts

22 lines
587 B
TypeScript
Raw Normal View History

import { z } from 'zod'
import { optionBaseSchema, blockBaseSchema } from '../../shared'
import { InputBlockType } from '../constants'
import { textInputOptionsBaseSchema } from '../text'
export const urlInputOptionsSchema = optionBaseSchema
.merge(textInputOptionsBaseSchema)
.merge(
z.object({
retryMessageContent: z.string().optional(),
})
)
export const urlInputSchema = blockBaseSchema.merge(
z.object({
type: z.enum([InputBlockType.URL]),
options: urlInputOptionsSchema.optional(),
})
)
export type UrlInputBlock = z.infer<typeof urlInputSchema>