@ -1,8 +1,12 @@
|
||||
import { z } from 'zod'
|
||||
import { answerInputSchema, answerSchema } from './answer'
|
||||
import { InputBlockType } from './blocks'
|
||||
import { variableWithValueSchema } from './typebot/variable'
|
||||
import { Result as ResultPrisma, Log as LogPrisma } from '@typebot.io/prisma'
|
||||
import {
|
||||
Result as ResultPrisma,
|
||||
Log as LogPrisma,
|
||||
VisitedEdge,
|
||||
} from '@typebot.io/prisma'
|
||||
import { InputBlockType } from './blocks/inputs/constants'
|
||||
|
||||
export const resultSchema = z.object({
|
||||
id: z.string(),
|
||||
@ -20,6 +24,12 @@ export const resultWithAnswersSchema = resultSchema.merge(
|
||||
})
|
||||
)
|
||||
|
||||
export const visitedEdgeSchema = z.object({
|
||||
edgeId: z.string(),
|
||||
resultId: z.string(),
|
||||
index: z.number(),
|
||||
}) satisfies z.ZodType<VisitedEdge>
|
||||
|
||||
export const resultWithAnswersInputSchema = resultSchema.merge(
|
||||
z.object({
|
||||
answers: z.array(answerInputSchema),
|
||||
|
Reference in New Issue
Block a user