2
0
Files
bot/packages/schemas/features/items/shared.ts
2023-12-22 09:13:53 +01:00

17 lines
407 B
TypeScript

import { z } from '../../zod'
const itemBaseV5Schema = z.object({
id: z.string(),
blockId: z.string().optional(),
outgoingEdgeId: z.string().optional(),
})
export const itemBaseSchemas = {
v5: itemBaseV5Schema,
v6: itemBaseV5Schema.omit({ blockId: true }),
}
export const itemBaseSchema = z.union([itemBaseSchemas.v5, itemBaseSchemas.v6])
export type ItemBase = z.infer<typeof itemBaseSchema>