action entity
This commit is contained in:
parent
2b257f9192
commit
f4405e14de
0
src/entities/action/index.ts
Normal file
0
src/entities/action/index.ts
Normal file
15
src/entities/action/schema.ts
Normal file
15
src/entities/action/schema.ts
Normal 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>;
|
||||||
Loading…
Reference in New Issue
Block a user