@huukhanhnguyen/model / validate/parse
validate/parse
RETIRED_ARG_MESSAGES
constRETIRED_ARG_MESSAGES:Record<string,string>
"<method>.<arg>" → the message a RETIRED arg gets instead of the generic "has no arg".
RETIRED_ROOT_MESSAGES
constRETIRED_ROOT_MESSAGES:Record<string,string>
RETIRED root keys → the message each gets instead of the generic "unknown top-level field". The engine speaks only the CURRENT schema: these keys are rejected, and the message says what the field is now (verbatim — tests and authors match on these strings).
parseModel()
parseModel(
raw):ModelJSON
Parameters
raw
unknown
Returns
rootObjectMessages()
rootObjectMessages(
json):RegistryError[]
Root body entries that are not scene OBJECTS (SCHEMA 46). Named here because the raw Zod failure — "unrecognized key: method", "operations is required" — describes the shape mismatch without saying what to do, and this is the one the whole cutover produces.
Parameters
json
Record<string, unknown>
Returns
safeParseModel()
safeParseModel(
raw):SafeParseModel
Parameters
raw
unknown
Returns
staticAssetRecordMessages()
staticAssetRecordMessages(
raw): {message:string;path:string; }[]
Static records in materials/layers/styles (name, no method) — those lanes are node lanes. NodeSchema rejects the shape at parse; this pre-scan says WHICH node to write instead on the validate path.
Parameters
raw
Record<string, unknown>
Returns
{ message: string; path: string; }[]