fix: harden authoring schema and contract projections

This commit is contained in:
lda
2026-08-29 21:08:05 +07:00 Verified
parent 8b16c6403d
commit 0570ef8a78
14 changed files with 243 additions and 359 deletions
@@ -531,7 +531,9 @@ export const authoredRpcSchemas = {
payload: Schema.Struct({
workspace_id: Schema.String.pipe(Schema.minLength(1)),
revision: PositiveIntegerSchema,
selected_step_id: Schema.optional(Schema.NullOr(Schema.String)),
selected_step_id: Schema.optional(
Schema.NullOr(Schema.String.pipe(Schema.minLength(1))),
),
}),
success: Schema.Union(AuthoringContractInventorySchema, DraftWorkspaceSchema),
},
@@ -548,7 +548,11 @@ const parityCases: ReadonlyArray<ParityCase> = [
revision: 7,
selected_step_id: "render",
},
invalidPayload: { workspace_id: "console.demo", revision: 0 },
invalidPayload: {
workspace_id: "console.demo",
revision: 7,
selected_step_id: "",
},
validSuccess: authoringContractInventory,
invalidSuccess: {
...authoringContractInventory,