2
0
Files
bot/packages/schemas/features/chat/shared.ts
2023-08-24 09:11:10 +02:00

21 lines
573 B
TypeScript

import { z } from 'zod'
import { publicTypebotSchema } from '../publicTypebot'
import { preprocessTypebot } from '../typebot/helpers/preprocessTypebot'
export const typebotInSessionStateSchema = z.preprocess(
preprocessTypebot,
publicTypebotSchema._def.schema.pick({
version: true,
id: true,
groups: true,
edges: true,
variables: true,
})
)
export type TypebotInSession = z.infer<typeof typebotInSessionStateSchema>
export const dynamicThemeSchema = z.object({
hostAvatarUrl: z.string().optional(),
guestAvatarUrl: z.string().optional(),
})