Add project command API
This commit is contained in:
parent
1e4dd26bb8
commit
e4c7cf06e9
19 changed files with 781 additions and 21 deletions
17
src/shared/validation/project-command.schemas.ts
Normal file
17
src/shared/validation/project-command.schemas.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { z } from "zod";
|
||||
|
||||
const projectCommandEnvelopeSchema = z.object({
|
||||
schemaVersion: z.number().int().positive(),
|
||||
type: z.string().trim().min(1),
|
||||
payload: z.unknown(),
|
||||
});
|
||||
|
||||
export const executeProjectCommandSchema = z.object({
|
||||
expectedRevision: z.number().int().nonnegative(),
|
||||
description: z.string().trim().min(1).max(500).optional(),
|
||||
command: projectCommandEnvelopeSchema,
|
||||
});
|
||||
|
||||
export const executeProjectHistoryCommandSchema = z.object({
|
||||
expectedRevision: z.number().int().nonnegative(),
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue