2023-08-24 07:48:30 +02:00
|
|
|
import { z } from 'zod'
|
|
|
|
import { publicTypebotSchema } from '../publicTypebot'
|
2023-08-24 09:11:10 +02:00
|
|
|
import { preprocessTypebot } from '../typebot/helpers/preprocessTypebot'
|
2023-08-24 07:48:30 +02:00
|
|
|
|
2023-08-24 09:11:10 +02:00
|
|
|
export const typebotInSessionStateSchema = z.preprocess(
|
|
|
|
preprocessTypebot,
|
|
|
|
publicTypebotSchema._def.schema.pick({
|
|
|
|
version: true,
|
2023-08-24 07:48:30 +02:00
|
|
|
id: true,
|
|
|
|
groups: true,
|
|
|
|
edges: true,
|
|
|
|
variables: true,
|
2023-08-24 09:11:10 +02:00
|
|
|
})
|
2023-08-24 07:48:30 +02:00
|
|
|
)
|
|
|
|
export type TypebotInSession = z.infer<typeof typebotInSessionStateSchema>
|
|
|
|
|
|
|
|
export const dynamicThemeSchema = z.object({
|
|
|
|
hostAvatarUrl: z.string().optional(),
|
|
|
|
guestAvatarUrl: z.string().optional(),
|
|
|
|
})
|