@react-arch/validation 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/schema.ts","../src/validate.ts"],"mappings":";;;;;cAMa,UAAA,EAAU,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAYV,aAAA,EAAa,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcb,UAAA,EAAU,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAYV,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWpB,WAAA,EAAW,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAcX,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAMd,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWd,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAhFnC;;iBCKgB,gBAAA,CAAiB,GAAA,EAAK,gBAAA,GAAmB,YAAU"}
package/dist/index.js ADDED
@@ -0,0 +1,191 @@
1
+ import { z } from "zod";
2
+ import { allFloors, isCompatibleVersion } from "@react-arch/core";
3
+ import { openingFits, wallLength } from "@react-arch/geometry";
4
+ //#region src/schema.ts
5
+ const finite = z.number().finite();
6
+ const vec2 = z.tuple([finite, finite]);
7
+ const vec3 = z.tuple([
8
+ finite,
9
+ finite,
10
+ finite
11
+ ]);
12
+ const WallSchema = z.object({
13
+ id: z.string().min(1),
14
+ floorId: z.string().min(1),
15
+ start: vec2,
16
+ end: vec2,
17
+ thickness: z.number().positive(),
18
+ height: z.number().positive(),
19
+ materialId: z.string().optional(),
20
+ layerId: z.string().optional(),
21
+ locked: z.boolean().optional()
22
+ });
23
+ const OpeningSchema = z.object({
24
+ id: z.string().min(1),
25
+ floorId: z.string().min(1),
26
+ wallId: z.string().min(1),
27
+ type: z.enum([
28
+ "door",
29
+ "window",
30
+ "opening"
31
+ ]),
32
+ offset: finite,
33
+ width: z.number().positive(),
34
+ height: z.number().positive(),
35
+ sillHeight: z.number().min(0),
36
+ swing: z.enum(["in", "out"]).optional(),
37
+ hinge: z.enum(["left", "right"]).optional(),
38
+ materialId: z.string().optional()
39
+ });
40
+ const RoomSchema = z.object({
41
+ id: z.string().min(1),
42
+ floorId: z.string().min(1),
43
+ name: z.string(),
44
+ polygon: z.array(vec2).min(3),
45
+ boundaryWallIds: z.array(z.string()).optional(),
46
+ floorMaterialId: z.string().optional(),
47
+ ceilingMaterialId: z.string().optional(),
48
+ usageType: z.string().optional(),
49
+ height: z.number().positive().optional()
50
+ });
51
+ const BuildingObjectSchema = z.object({
52
+ id: z.string().min(1),
53
+ floorId: z.string().min(1),
54
+ type: z.string(),
55
+ position: vec3,
56
+ rotation: vec3,
57
+ scale: vec3,
58
+ assetId: z.string().optional(),
59
+ metadata: z.record(z.unknown()).optional()
60
+ });
61
+ const FloorSchema = z.object({
62
+ id: z.string().min(1),
63
+ buildingId: z.string().min(1),
64
+ name: z.string(),
65
+ elevation: finite,
66
+ height: z.number().positive(),
67
+ visible: z.boolean(),
68
+ locked: z.boolean(),
69
+ walls: z.array(WallSchema),
70
+ rooms: z.array(RoomSchema),
71
+ openings: z.array(OpeningSchema),
72
+ objects: z.array(BuildingObjectSchema)
73
+ });
74
+ const BuildingSchema = z.object({
75
+ id: z.string().min(1),
76
+ name: z.string(),
77
+ floors: z.array(FloorSchema)
78
+ });
79
+ const MaterialSchema = z.object({
80
+ id: z.string().min(1),
81
+ name: z.string(),
82
+ category: z.string(),
83
+ baseColor: z.string(),
84
+ roughness: z.number().optional(),
85
+ metalness: z.number().optional(),
86
+ opacity: z.number().optional(),
87
+ textureUrl: z.string().optional()
88
+ });
89
+ const BuildingDocumentSchema = z.object({
90
+ id: z.string().min(1),
91
+ version: z.string(),
92
+ name: z.string(),
93
+ units: z.enum(["metric", "imperial"]),
94
+ site: z.unknown().optional(),
95
+ buildings: z.array(BuildingSchema),
96
+ materials: z.array(MaterialSchema),
97
+ assets: z.array(z.unknown()),
98
+ metadata: z.record(z.unknown())
99
+ });
100
+ //#endregion
101
+ //#region src/validate.ts
102
+ /**
103
+ * Validate a document and return structured diagnostics. Runs the Zod schema
104
+ * for shape, then semantic checks (unique ids, references, fit). The studio
105
+ * shows these in the diagnostics panel; clicking one selects the entity.
106
+ */
107
+ function validateDocument(doc) {
108
+ const diags = [];
109
+ const parsed = BuildingDocumentSchema.safeParse(doc);
110
+ if (!parsed.success) for (const issue of parsed.error.issues) diags.push({
111
+ severity: "error",
112
+ code: "schema",
113
+ message: issue.message,
114
+ path: issue.path.map(String)
115
+ });
116
+ if (!isCompatibleVersion(doc.version)) diags.push({
117
+ severity: "warning",
118
+ code: "version",
119
+ message: `Document version ${doc.version} may be incompatible with this build`
120
+ });
121
+ const seen = /* @__PURE__ */ new Map();
122
+ const checkId = (id, kind) => {
123
+ if (seen.has(id)) diags.push({
124
+ severity: "error",
125
+ code: "duplicate-id",
126
+ message: `Duplicate id "${id}" (${seen.get(id)} and ${kind})`,
127
+ entityId: id
128
+ });
129
+ else seen.set(id, kind);
130
+ };
131
+ const floors = allFloors(doc);
132
+ new Set(floors.map((f) => f.id));
133
+ for (const floor of floors) {
134
+ checkId(floor.id, "floor");
135
+ const wallIds = new Set(floor.walls.map((w) => w.id));
136
+ for (const wall of floor.walls) {
137
+ checkId(wall.id, "wall");
138
+ if (wall.floorId !== floor.id) diags.push({
139
+ severity: "error",
140
+ code: "bad-floor-ref",
141
+ message: `Wall ${wall.id} references wrong floor`,
142
+ entityId: wall.id
143
+ });
144
+ if (wallLength(wall) < .001) diags.push({
145
+ severity: "warning",
146
+ code: "zero-length-wall",
147
+ message: `Wall ${wall.id} has near-zero length`,
148
+ entityId: wall.id
149
+ });
150
+ }
151
+ for (const room of floor.rooms) {
152
+ checkId(room.id, "room");
153
+ if (room.polygon.length < 3) diags.push({
154
+ severity: "error",
155
+ code: "open-room",
156
+ message: `Room ${room.id} boundary is not closed`,
157
+ entityId: room.id
158
+ });
159
+ }
160
+ for (const o of floor.openings) {
161
+ checkId(o.id, "opening");
162
+ if (!wallIds.has(o.wallId)) {
163
+ diags.push({
164
+ severity: "error",
165
+ code: "bad-wall-ref",
166
+ message: `Opening ${o.id} references unknown wall ${o.wallId}`,
167
+ entityId: o.id
168
+ });
169
+ continue;
170
+ }
171
+ if (!openingFits(floor.walls.find((w) => w.id === o.wallId), o)) diags.push({
172
+ severity: "warning",
173
+ code: "opening-overflow",
174
+ message: `Opening ${o.id} does not fit within its wall`,
175
+ entityId: o.id
176
+ });
177
+ }
178
+ for (const obj of floor.objects) checkId(obj.id, "object");
179
+ }
180
+ for (const building of doc.buildings) for (const f of building.floors) if (f.buildingId !== building.id) diags.push({
181
+ severity: "error",
182
+ code: "bad-building-ref",
183
+ message: `Floor ${f.id} references wrong building`,
184
+ entityId: f.id
185
+ });
186
+ return diags;
187
+ }
188
+ //#endregion
189
+ export { BuildingDocumentSchema, BuildingObjectSchema, BuildingSchema, FloorSchema, MaterialSchema, OpeningSchema, RoomSchema, WallSchema, validateDocument };
190
+
191
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/schema.ts","../src/validate.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst finite = z.number().finite();\nconst vec2 = z.tuple([finite, finite]);\nconst vec3 = z.tuple([finite, finite, finite]);\n\nexport const WallSchema = z.object({\n id: z.string().min(1),\n floorId: z.string().min(1),\n start: vec2,\n end: vec2,\n thickness: z.number().positive(),\n height: z.number().positive(),\n materialId: z.string().optional(),\n layerId: z.string().optional(),\n locked: z.boolean().optional(),\n});\n\nexport const OpeningSchema = z.object({\n id: z.string().min(1),\n floorId: z.string().min(1),\n wallId: z.string().min(1),\n type: z.enum([\"door\", \"window\", \"opening\"]),\n offset: finite,\n width: z.number().positive(),\n height: z.number().positive(),\n sillHeight: z.number().min(0),\n swing: z.enum([\"in\", \"out\"]).optional(),\n hinge: z.enum([\"left\", \"right\"]).optional(),\n materialId: z.string().optional(),\n});\n\nexport const RoomSchema = z.object({\n id: z.string().min(1),\n floorId: z.string().min(1),\n name: z.string(),\n polygon: z.array(vec2).min(3),\n boundaryWallIds: z.array(z.string()).optional(),\n floorMaterialId: z.string().optional(),\n ceilingMaterialId: z.string().optional(),\n usageType: z.string().optional(),\n height: z.number().positive().optional(),\n});\n\nexport const BuildingObjectSchema = z.object({\n id: z.string().min(1),\n floorId: z.string().min(1),\n type: z.string(),\n position: vec3,\n rotation: vec3,\n scale: vec3,\n assetId: z.string().optional(),\n metadata: z.record(z.unknown()).optional(),\n});\n\nexport const FloorSchema = z.object({\n id: z.string().min(1),\n buildingId: z.string().min(1),\n name: z.string(),\n elevation: finite,\n height: z.number().positive(),\n visible: z.boolean(),\n locked: z.boolean(),\n walls: z.array(WallSchema),\n rooms: z.array(RoomSchema),\n openings: z.array(OpeningSchema),\n objects: z.array(BuildingObjectSchema),\n});\n\nexport const BuildingSchema = z.object({\n id: z.string().min(1),\n name: z.string(),\n floors: z.array(FloorSchema),\n});\n\nexport const MaterialSchema = z.object({\n id: z.string().min(1),\n name: z.string(),\n category: z.string(),\n baseColor: z.string(),\n roughness: z.number().optional(),\n metalness: z.number().optional(),\n opacity: z.number().optional(),\n textureUrl: z.string().optional(),\n});\n\nexport const BuildingDocumentSchema = z.object({\n id: z.string().min(1),\n version: z.string(),\n name: z.string(),\n units: z.enum([\"metric\", \"imperial\"]),\n site: z.unknown().optional(),\n buildings: z.array(BuildingSchema),\n materials: z.array(MaterialSchema),\n assets: z.array(z.unknown()),\n metadata: z.record(z.unknown()),\n});\n","import type { Diagnostic } from \"@react-arch/shared\";\nimport { allFloors, type BuildingDocument } from \"@react-arch/core\";\nimport { openingFits, wallLength } from \"@react-arch/geometry\";\nimport { isCompatibleVersion } from \"@react-arch/core\";\nimport { BuildingDocumentSchema } from \"./schema.js\";\n\n/**\n * Validate a document and return structured diagnostics. Runs the Zod schema\n * for shape, then semantic checks (unique ids, references, fit). The studio\n * shows these in the diagnostics panel; clicking one selects the entity.\n */\nexport function validateDocument(doc: BuildingDocument): Diagnostic[] {\n const diags: Diagnostic[] = [];\n\n const parsed = BuildingDocumentSchema.safeParse(doc);\n if (!parsed.success) {\n for (const issue of parsed.error.issues) {\n diags.push({\n severity: \"error\",\n code: \"schema\",\n message: issue.message,\n path: issue.path.map(String),\n });\n }\n }\n\n if (!isCompatibleVersion(doc.version)) {\n diags.push({\n severity: \"warning\",\n code: \"version\",\n message: `Document version ${doc.version} may be incompatible with this build`,\n });\n }\n\n // Unique ids across the whole document.\n const seen = new Map<string, string>();\n const checkId = (id: string, kind: string) => {\n if (seen.has(id)) {\n diags.push({\n severity: \"error\",\n code: \"duplicate-id\",\n message: `Duplicate id \"${id}\" (${seen.get(id)} and ${kind})`,\n entityId: id,\n });\n } else {\n seen.set(id, kind);\n }\n };\n\n const floors = allFloors(doc);\n const floorIds = new Set(floors.map((f) => f.id));\n for (const floor of floors) {\n checkId(floor.id, \"floor\");\n const wallIds = new Set(floor.walls.map((w) => w.id));\n for (const wall of floor.walls) {\n checkId(wall.id, \"wall\");\n if (wall.floorId !== floor.id) {\n diags.push({ severity: \"error\", code: \"bad-floor-ref\", message: `Wall ${wall.id} references wrong floor`, entityId: wall.id });\n }\n if (wallLength(wall) < 1e-3) {\n diags.push({ severity: \"warning\", code: \"zero-length-wall\", message: `Wall ${wall.id} has near-zero length`, entityId: wall.id });\n }\n }\n for (const room of floor.rooms) {\n checkId(room.id, \"room\");\n if (room.polygon.length < 3) {\n diags.push({ severity: \"error\", code: \"open-room\", message: `Room ${room.id} boundary is not closed`, entityId: room.id });\n }\n }\n for (const o of floor.openings) {\n checkId(o.id, \"opening\");\n if (!wallIds.has(o.wallId)) {\n diags.push({ severity: \"error\", code: \"bad-wall-ref\", message: `Opening ${o.id} references unknown wall ${o.wallId}`, entityId: o.id });\n continue;\n }\n const wall = floor.walls.find((w) => w.id === o.wallId)!;\n if (!openingFits(wall, o)) {\n diags.push({ severity: \"warning\", code: \"opening-overflow\", message: `Opening ${o.id} does not fit within its wall`, entityId: o.id });\n }\n }\n for (const obj of floor.objects) checkId(obj.id, \"object\");\n }\n\n // Building → floor references.\n for (const building of doc.buildings) {\n for (const f of building.floors) {\n if (f.buildingId !== building.id) {\n diags.push({ severity: \"error\", code: \"bad-building-ref\", message: `Floor ${f.id} references wrong building`, entityId: f.id });\n }\n }\n }\n void floorIds;\n\n return diags;\n}\n"],"mappings":";;;;AAEA,MAAM,SAAS,EAAE,OAAO,CAAC,CAAC,OAAO;AACjC,MAAM,OAAO,EAAE,MAAM,CAAC,QAAQ,MAAM,CAAC;AACrC,MAAM,OAAO,EAAE,MAAM;CAAC;CAAQ;CAAQ;AAAM,CAAC;AAE7C,MAAa,aAAa,EAAE,OAAO;CACjC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACzB,OAAO;CACP,KAAK;CACL,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS;CAChC,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;CAC7B,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS;AAC/B,CAAC;AAED,MAAa,gBAAgB,EAAE,OAAO;CACpC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACzB,QAAQ,EAAE,OAAO,C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AM,OAAO;GAC9B,QAAQ,KAAK,IAAI,MAAM;GACvB,IAAI,KAAK,QAAQ,SAAS,GACxB,MAAM,KAAK;IAAE,UAAU;IAAS,MAAM;IAAa,SAAS,QAAQ,KAAK,GAAG;IAA0B,UAAU,KAAK;GAAG,CAAC;EAE7H;EACA,KAAK,MAAM,KAAK,MAAM,UAAU;GAC9B,QAAQ,EAAE,IAAI,SAAS;GACvB,IAAI,CAAC,QAAQ,IAAI,EAAE,MAAM,GAAG;IAC1B,MAAM,KAAK;KAAE,UAAU;KAAS,MAAM;KAAgB,SAAS,WAAW,EAAE,GAAG,2BAA2B,EAAE;KAAU,UAAU,EAAE;IAAG,CAAC;IACtI;GACF;GAEA,IAAI,CAAC,YADQ,MAAM,MAAM,MAAM,MAAM,EAAE,OAAO,EAAE,MAC5B,GAAG,CAAC,GACtB,MAAM,KAAK;IAAE,UAAU;IAAW,MAAM;IAAoB,SAAS,WAAW,EAAE,GAAG;IAAgC,UAAU,EAAE;GAAG,CAAC;EAEzI;EACA,KAAK,MAAM,OAAO,MAAM,SAAS,QAAQ,IAAI,IAAI,QAAQ;CAC3D;CAGA,KAAK,MAAM,YAAY,IAAI,WACzB,KAAK,MAAM,KAAK,SAAS,QACvB,IAAI,EAAE,eAAe,SAAS,IAC5B,MAAM,KAAK;EAAE,UAAU;EAAS,MAAM;EAAoB,SAAS,SAAS,EAAE,GAAG;EAA6B,UAAU,EAAE;CAAG,CAAC;CAMpI,OAAO;AACT"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@react-arch/validation",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "dependencies": {
15
+ "zod": "^3.24.1",
16
+ "@react-arch/core": "0.1.0",
17
+ "@react-arch/geometry": "0.1.0",
18
+ "@react-arch/shared": "0.1.0"
19
+ },
20
+ "devDependencies": {
21
+ "typescript": "^5.7.2",
22
+ "vitest": "^2.1.8"
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/react-arch/react-arch.git",
33
+ "directory": "packages/validation"
34
+ },
35
+ "license": "MIT",
36
+ "scripts": {
37
+ "typecheck": "tsc --noEmit",
38
+ "test": "vitest run --passWithNoTests",
39
+ "lint": "oxlint src",
40
+ "build": "tsdown"
41
+ }
42
+ }