feat: complete TASK-WP2-02 project autosave
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Type, type Static } from "@sinclair/typebox";
|
||||
|
||||
import { GenerationErrorCategorySchema } from "./api.js";
|
||||
import { CanvasStateSchema } from "./canvas.js";
|
||||
|
||||
const uuidPattern = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$";
|
||||
const isoTimestampPattern = "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$";
|
||||
@@ -71,12 +72,14 @@ export const ProjectImageItemSchema = Type.Object(
|
||||
export const ProjectDetailResponseSchema = Type.Object(
|
||||
{
|
||||
...ProjectSummarySchema.properties,
|
||||
canvas_state: Type.Ref(CanvasStateSchema),
|
||||
created_at: Type.String({ pattern: isoTimestampPattern }),
|
||||
draft_prompt: Type.String({ maxLength: 4_000, minLength: 1 }),
|
||||
generations: Type.Array(Type.Ref(GenerationProjectItemSchema)),
|
||||
images: Type.Array(Type.Ref(ProjectImageItemSchema), { maxItems: 10 }),
|
||||
pixel_height: Type.Integer({ minimum: 1 }),
|
||||
pixel_width: Type.Integer({ minimum: 1 }),
|
||||
save_status: Type.Literal("saved"),
|
||||
},
|
||||
{ additionalProperties: false, $id: "ProjectDetailResponse" },
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user