21
packages/schemas/features/blocks/inputs/url/schema.ts
Normal file
21
packages/schemas/features/blocks/inputs/url/schema.ts
Normal file
@ -0,0 +1,21 @@
|
||||
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>
|
Reference in New Issue
Block a user