docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Define decorated data models for a blueprint collaboration service. The goal is to rely on the dependency's schema inference to keep nested classes, arrays, maps, raw literal objects, lazy references, and ambiguous-type errors behaving correctly.
layout as a raw literal object with required canvas.width, canvas.height, and theme keys while allowing extra keys to pass through. @testownerRef to the profile class using a lazy reference form that still serializes to the reference id field even when the profile class is declared later. @testtrouble property because its union type lacks an explicit type hint. @testexport class Profile {
id: string;
email: string;
displayName?: string;
}
export class BlockSetting {
key: string;
value: string;
flags: Map<string, boolean>;
}
export class Block {
title: string;
settings: BlockSetting[];
metadata: { accent: string; weight: number };
}
export class Blueprint {
name: string;
ownerRef: () => Profile;
reviewers: Profile[];
layout: { canvas: { width: number; height: number }; theme: string };
blocks: Block[];
labels: Map<string, string>;
sourceSnapshot: { provider: string; payload: Record<string, unknown> };
}
export class AmbiguousShape {
trouble: string | number;
noted?: string;
}
export const blueprintSchema: unknown;
export const profileSchema: unknown;
export const blockSchema: unknown;
export const ambiguousSchemaBuilder: () => unknown;Provides schema decorators, definition factories, and Nest integration for MongoDB.