action entity

This commit is contained in:
Robert 2024-03-07 05:32:53 +07:00
parent 2b257f9192
commit f4405e14de
No known key found for this signature in database
GPG Key ID: F631C7FD957D5F22
2 changed files with 15 additions and 0 deletions

View File

View File

@ -0,0 +1,15 @@
import { z } from "zod";
const waitActionSchema = z.object({
actionType: z.literal("wait"),
waitFor: z.number(),
});
const commentActionSchema = z.object({
actionType: z.literal("comment"),
text: z.string().nullable(),
fileUrls: z.array(z.string()),
});
export const actionSchema = z.union([waitActionSchema, commentActionSchema]);
export type Action = z.infer<typeof actionSchema>;