22 lines
587 B
TypeScript
22 lines
587 B
TypeScript
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>
|