@seatmap-fyi/map-domain 0.1.0-alpha.4 → 0.1.0-alpha.48
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.
- package/dist/arc-fan-rebuild.d.ts +13 -0
- package/dist/arc-fan-rebuild.js +163 -0
- package/dist/arc-fan.d.ts +27 -0
- package/dist/arc-fan.interface.d.ts +83 -0
- package/dist/arc-fan.interface.js +30 -0
- package/dist/arc-fan.js +182 -0
- package/dist/catalog.d.ts +6 -4
- package/dist/catalog.js +31 -17
- package/dist/categories.d.ts +5 -3
- package/dist/categories.js +104 -25
- package/dist/editor-state.d.ts +4 -1
- package/dist/editor-state.js +53 -30
- package/dist/floors.d.ts +22 -0
- package/dist/floors.js +77 -0
- package/dist/geometry/boundary.d.ts +1 -1
- package/dist/geometry/boundary.js +16 -12
- package/dist/geometry/curve-warnings.d.ts +1 -1
- package/dist/geometry/curve-warnings.js +3 -5
- package/dist/geometry/decoration-bounds.d.ts +4 -0
- package/dist/geometry/decoration-bounds.js +42 -0
- package/dist/geometry/ellipse.js +4 -12
- package/dist/geometry/geometry.d.ts +6 -3
- package/dist/geometry/geometry.js +28 -30
- package/dist/geometry/layout-transform.d.ts +10 -0
- package/dist/geometry/layout-transform.interface.d.ts +6 -0
- package/dist/geometry/layout-transform.interface.js +1 -0
- package/dist/geometry/layout-transform.js +206 -0
- package/dist/geometry/polygon-curves.d.ts +17 -0
- package/dist/geometry/polygon-curves.interface.d.ts +21 -0
- package/dist/geometry/polygon-curves.interface.js +5 -0
- package/dist/geometry/polygon-curves.js +169 -0
- package/dist/geometry/primitives.d.ts +1 -1
- package/dist/geometry/primitives.js +2 -3
- package/dist/geometry/seat-shape.d.ts +1 -1
- package/dist/geometry/seat-shape.js +1 -1
- package/dist/geometry/seating-layout.d.ts +9 -1
- package/dist/geometry/seating-layout.js +66 -57
- package/dist/geometry/units.d.ts +8 -0
- package/dist/geometry/units.js +13 -0
- package/dist/geometry/venue-outline.d.ts +4 -18
- package/dist/geometry/venue-outline.interface.d.ts +23 -0
- package/dist/geometry/venue-outline.interface.js +7 -0
- package/dist/geometry/venue-outline.js +107 -49
- package/dist/identity.d.ts +3 -1
- package/dist/identity.js +32 -17
- package/dist/issues.d.ts +15 -2
- package/dist/issues.js +16 -6
- package/dist/labels.d.ts +6 -1
- package/dist/labels.js +20 -18
- package/dist/layers.d.ts +26 -0
- package/dist/layers.js +86 -0
- package/dist/media.d.ts +27 -0
- package/dist/media.js +89 -0
- package/dist/{types.d.ts → physical-document.interface.d.ts} +117 -4
- package/dist/{types.js → physical-document.interface.js} +17 -0
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +39 -29
- package/dist/reference.js +1 -1
- package/dist/row-segments.d.ts +5 -1
- package/dist/row-segments.js +10 -9
- package/dist/schema.d.ts +591 -14
- package/dist/schema.js +238 -102
- package/dist/seat-proximity.d.ts +4 -0
- package/dist/seat-proximity.js +119 -0
- package/dist/section-elevation.d.ts +5 -0
- package/dist/section-elevation.interface.d.ts +26 -0
- package/dist/section-elevation.interface.js +8 -0
- package/dist/section-elevation.js +53 -0
- package/dist/section-fill-rebuild.d.ts +10 -0
- package/dist/section-fill-rebuild.js +64 -0
- package/dist/section-fill.d.ts +84 -0
- package/dist/section-fill.interface.d.ts +94 -0
- package/dist/section-fill.interface.js +22 -0
- package/dist/section-fill.js +306 -0
- package/dist/section-growth.d.ts +11 -0
- package/dist/section-growth.interface.d.ts +12 -0
- package/dist/section-growth.interface.js +1 -0
- package/dist/section-growth.js +198 -0
- package/dist/section-layout.d.ts +95 -0
- package/dist/section-layout.interface.d.ts +8 -0
- package/dist/section-layout.interface.js +5 -0
- package/dist/section-layout.js +70 -0
- package/dist/section-outline-refit.d.ts +8 -0
- package/dist/section-outline-refit.js +246 -0
- package/dist/section-refit.d.ts +22 -0
- package/dist/section-refit.interface.d.ts +49 -0
- package/dist/section-refit.interface.js +6 -0
- package/dist/section-refit.js +179 -0
- package/dist/section-scale.d.ts +2 -0
- package/dist/section-scale.js +128 -0
- package/dist/sections.d.ts +23 -0
- package/dist/sections.js +144 -0
- package/dist/selling.d.ts +1 -1
- package/dist/selling.js +11 -26
- package/dist/spacing-repairs.d.ts +31 -0
- package/dist/spacing-repairs.js +168 -0
- package/dist/table-layout.d.ts +1 -2
- package/dist/table-layout.js +14 -22
- package/dist/validation.d.ts +7 -2
- package/dist/validation.interface.d.ts +20 -0
- package/dist/validation.interface.js +9 -0
- package/dist/validation.js +221 -85
- package/dist/wayfinding.d.ts +10 -0
- package/dist/wayfinding.interface.d.ts +52 -0
- package/dist/wayfinding.interface.js +28 -0
- package/dist/wayfinding.js +63 -0
- package/package.json +89 -4
package/dist/schema.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArcFanFacing, ArcFanFit, ArcFanMaximumRows, ArcFanMaximumPartsPerRow, ArcFanSectionOrigin, } from "./arc-fan.interface.js";
|
|
2
|
+
import { EntranceKind, GateUse, LineCap, LineJoin, LineEnding } from "./wayfinding.interface.js";
|
|
3
|
+
import { polygonContour, polygonContourVertexCount, PolygonVertexLimit, PolygonCornerRadiusMaxM, } from "./geometry/polygon-curves.js";
|
|
4
|
+
import { DocumentLimits, TicketRestriction, TableBookingMode, TableChairDistribution, StandingBookingMode, SeatShape, TicketOptionLimit, NumberingScheme, LabelDirection, RowLabelPosition, AccessNeed, SeatingKind, CurveMode, DecorationKind, LabelAlignment, RowAlignment, RowStagger, RowEnds, RowJoin, SectionOutlineRole, RowRefitStrength, SectionRotation, SectionScale, SectionTier, SectionRake, SectionFrontRowHeight, AreaKind, ShapeKind, VenueGlyph, } from "./physical-document.interface.js";
|
|
2
5
|
import { z } from "zod";
|
|
3
6
|
import { tableSellingValid, standingSellingValid } from "./selling.js";
|
|
4
|
-
import {
|
|
7
|
+
import { ticketOptionNameKey } from "./categories.js";
|
|
5
8
|
import { issue, IssueCode } from "./issues.js";
|
|
6
|
-
import { footprint, generateGroup, project, worldMatrices
|
|
7
|
-
const uuid = z
|
|
8
|
-
.string()
|
|
9
|
-
.regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);
|
|
9
|
+
import { footprint, generateGroup, project, worldMatrices } from "./geometry/geometry.js";
|
|
10
|
+
const uuid = z.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/);
|
|
10
11
|
const finite = z.number().finite();
|
|
11
12
|
const coordinate = finite.min(-10000).max(10000);
|
|
12
13
|
const dimension = finite.min(0.001).max(10000);
|
|
13
14
|
const nonNegative = finite.min(0).max(10000);
|
|
14
15
|
const angle = finite.min(-180).lt(180);
|
|
16
|
+
const unsupportedText = /[\u0000-\u001f\u007f-\u009f]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u;
|
|
15
17
|
const text = (limit, multiline = false) => z
|
|
16
18
|
.string()
|
|
17
|
-
.refine((v) => Array.from(v).length <= limit &&
|
|
18
|
-
!/[\u0000-\u001f\u007f-\u009f]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u.test(multiline ? v.replace(/\n/g, "") : v), "Text exceeds its limit or contains unsupported control/surrogate characters.")
|
|
19
|
+
.refine((v) => Array.from(v).length <= limit && !unsupportedText.test(multiline ? v.replace(/\n/g, "") : v), "Text exceeds its limit or contains unsupported control/surrogate characters.")
|
|
19
20
|
.meta({
|
|
20
21
|
maxLength: limit,
|
|
21
22
|
description: multiline
|
|
@@ -29,7 +30,13 @@ const name = text(120)
|
|
|
29
30
|
description: "Nonempty, trimmed name; at most 120 Unicode code points. Control characters and unpaired surrogates are rejected.",
|
|
30
31
|
});
|
|
31
32
|
const label = text(80);
|
|
33
|
+
// Materialized labels retain their authored text within the document size limit.
|
|
34
|
+
export const storedLabelSchema = z
|
|
35
|
+
.string()
|
|
36
|
+
.refine((value) => !unsupportedText.test(value), "Use single-line text without control characters.")
|
|
37
|
+
.describe("Single-line label text without control characters or unpaired surrogates.");
|
|
32
38
|
const point = z.strictObject({ x: coordinate, y: coordinate });
|
|
39
|
+
const focalPoint = point.describe("Authored seat-facing point in the chart coordinate system, in metres.").optional();
|
|
33
40
|
const size = z.strictObject({ width: dimension, height: dimension });
|
|
34
41
|
const transform = z.strictObject({
|
|
35
42
|
positionM: point,
|
|
@@ -40,15 +47,40 @@ const transform = z.strictObject({
|
|
|
40
47
|
const ring = z
|
|
41
48
|
.array(point)
|
|
42
49
|
.min(3)
|
|
43
|
-
.max(
|
|
50
|
+
.max(PolygonVertexLimit)
|
|
44
51
|
.refine((v) => v[0].x !== v[v.length - 1].x || v[0].y !== v[v.length - 1].y, "Rings close implicitly; do not repeat the first vertex.")
|
|
45
52
|
.describe("Implicitly closed ring; the last vertex must not repeat the first.");
|
|
46
|
-
const polygon = z
|
|
53
|
+
const polygon = z
|
|
54
|
+
.strictObject({
|
|
47
55
|
outer: ring,
|
|
48
56
|
holes: z.array(ring).max(10000),
|
|
57
|
+
edgeCurvature: z.array(finite.min(-100).max(100)).max(PolygonVertexLimit).optional(),
|
|
58
|
+
cornerRounding: finite.min(0).max(100).optional(),
|
|
59
|
+
cornerRadiusM: nonNegative.max(PolygonCornerRadiusMaxM).optional(),
|
|
60
|
+
})
|
|
61
|
+
.superRefine((value, context) => {
|
|
62
|
+
if (value.edgeCurvature && value.edgeCurvature.length !== value.outer.length) {
|
|
63
|
+
context.addIssue({
|
|
64
|
+
code: "custom",
|
|
65
|
+
path: ["edgeCurvature"],
|
|
66
|
+
message: "Provide one curvature value per outer side.",
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (value.cornerRounding !== undefined && value.cornerRadiusM !== undefined) {
|
|
71
|
+
context.addIssue({ code: "custom", path: ["cornerRadiusM"], message: "Use one corner rounding mode." });
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (polygonContourVertexCount(value) > PolygonVertexLimit)
|
|
75
|
+
context.addIssue({
|
|
76
|
+
code: "custom",
|
|
77
|
+
path: ["edgeCurvature"],
|
|
78
|
+
message: "The boundary exceeds the 1mm / 10,000-vertex curve limit.",
|
|
79
|
+
});
|
|
49
80
|
});
|
|
81
|
+
export const hexColourSchema = z.string().regex(/^#[0-9a-fA-F]{6}$/);
|
|
50
82
|
const paint = z.strictObject({
|
|
51
|
-
color:
|
|
83
|
+
color: hexColourSchema,
|
|
52
84
|
opacity: finite.min(0).max(1),
|
|
53
85
|
});
|
|
54
86
|
const sequence = z
|
|
@@ -68,8 +100,7 @@ const sequence = z
|
|
|
68
100
|
path: ["lastAt"],
|
|
69
101
|
message: "Last-seat anchoring requires a last number.",
|
|
70
102
|
});
|
|
71
|
-
if (value.scheme === NumberingScheme.Roman &&
|
|
72
|
-
(value.startAt > 999 || (value.lastAt ?? 0) > 100999))
|
|
103
|
+
if (value.scheme === NumberingScheme.Roman && (value.startAt > 999 || (value.lastAt ?? 0) > 100999))
|
|
73
104
|
context.addIssue({
|
|
74
105
|
code: "custom",
|
|
75
106
|
path: ["startAt"],
|
|
@@ -81,22 +112,23 @@ const labelStyle = z.strictObject({
|
|
|
81
112
|
fontSizeM: dimension,
|
|
82
113
|
style: z.enum(["plain", "pill"]).optional(),
|
|
83
114
|
rotationDeg: angle.optional(),
|
|
84
|
-
color:
|
|
85
|
-
.string()
|
|
86
|
-
.regex(/^#[0-9a-fA-F]{6}$/)
|
|
87
|
-
.optional(),
|
|
115
|
+
color: hexColourSchema.optional(),
|
|
88
116
|
});
|
|
89
117
|
const rowLabelStyle = labelStyle.extend({
|
|
90
118
|
position: z.enum(RowLabelPosition),
|
|
91
119
|
style: z.enum(["plain", "pill"]).optional(),
|
|
92
120
|
rotationDeg: angle.optional(),
|
|
93
121
|
});
|
|
122
|
+
export const buyerPhotoSchema = z.strictObject({ assetId: uuid });
|
|
94
123
|
export const seatPresentationSchema = z.strictObject({
|
|
124
|
+
buyerPhoto: buyerPhotoSchema.optional(),
|
|
95
125
|
gap: z.boolean().optional(),
|
|
96
126
|
buyerNote: text(160).optional(),
|
|
97
127
|
labelStyle: labelStyle.optional(),
|
|
98
128
|
});
|
|
99
129
|
export const rowPresentationSchema = z.strictObject({
|
|
130
|
+
buyerPhoto: buyerPhotoSchema.optional(),
|
|
131
|
+
bookingLabel: storedLabelSchema.optional(),
|
|
100
132
|
buyerNoun: text(80).optional(),
|
|
101
133
|
buyerNote: text(160).optional(),
|
|
102
134
|
labelStyle: rowLabelStyle.optional(),
|
|
@@ -107,14 +139,11 @@ const seat = z.strictObject({
|
|
|
107
139
|
seatShape: seatShapeSchema.optional(),
|
|
108
140
|
id: uuid,
|
|
109
141
|
categoryId: uuid.nullable().optional(),
|
|
110
|
-
labelOverride:
|
|
142
|
+
labelOverride: storedLabelSchema.optional(),
|
|
111
143
|
attributes: z
|
|
112
144
|
.strictObject({
|
|
113
145
|
wheelchair: z.enum(["seat", "space"]).optional(),
|
|
114
|
-
accessNeeds: z
|
|
115
|
-
.array(z.enum(AccessNeed))
|
|
116
|
-
.max(Object.keys(AccessNeed).length)
|
|
117
|
-
.optional(),
|
|
146
|
+
accessNeeds: z.array(z.enum(AccessNeed)).max(Object.keys(AccessNeed).length).optional(),
|
|
118
147
|
obstructedView: z.boolean().optional(),
|
|
119
148
|
premium: z.boolean().optional(),
|
|
120
149
|
restrictedView: z.boolean().optional(),
|
|
@@ -132,16 +161,40 @@ const seat = z.strictObject({
|
|
|
132
161
|
export const rowLayoutSchema = z.strictObject({
|
|
133
162
|
originM: point,
|
|
134
163
|
seatPitchM: dimension,
|
|
135
|
-
curveDeg: finite
|
|
164
|
+
curveDeg: finite,
|
|
136
165
|
rotationDeg: finite.min(-180).max(180),
|
|
137
166
|
seatRotationOffsetDeg: finite.min(-180).max(180).optional(),
|
|
138
167
|
});
|
|
168
|
+
export const entranceSchema = z.discriminatedUnion("kind", [
|
|
169
|
+
z.strictObject({ kind: z.literal(EntranceKind.Gate), gateId: uuid, label: storedLabelSchema.optional() }),
|
|
170
|
+
z.strictObject({ kind: z.literal(EntranceKind.Text), label: storedLabelSchema }),
|
|
171
|
+
]);
|
|
172
|
+
const gateDetails = z.strictObject({
|
|
173
|
+
use: z.enum(GateUse),
|
|
174
|
+
stepFree: z.boolean().optional(),
|
|
175
|
+
opens: text(120).optional(),
|
|
176
|
+
showToBuyers: z.boolean().optional(),
|
|
177
|
+
});
|
|
139
178
|
const row = z.strictObject({
|
|
179
|
+
entrance: entranceSchema.optional(),
|
|
180
|
+
fillOrigin: z
|
|
181
|
+
.strictObject({
|
|
182
|
+
sectionId: uuid,
|
|
183
|
+
rowIndex: finite
|
|
184
|
+
.int()
|
|
185
|
+
.min(0)
|
|
186
|
+
.max(DocumentLimits.PhysicalSeats - 1),
|
|
187
|
+
partIndex: finite
|
|
188
|
+
.int()
|
|
189
|
+
.min(0)
|
|
190
|
+
.max(DocumentLimits.PhysicalSeats - 1),
|
|
191
|
+
})
|
|
192
|
+
.optional(),
|
|
193
|
+
zIndex: finite.int().min(-2147483648).max(2147483647).optional(),
|
|
140
194
|
...rowPresentationSchema.shape,
|
|
141
195
|
id: uuid,
|
|
142
196
|
categoryId: uuid.nullable().optional(),
|
|
143
|
-
labelOverride:
|
|
144
|
-
bookingLabel: label.optional(),
|
|
197
|
+
labelOverride: storedLabelSchema.optional(),
|
|
145
198
|
offsetM: point.optional(),
|
|
146
199
|
seatSequenceOverride: sequence.optional(),
|
|
147
200
|
layout: rowLayoutSchema.optional(),
|
|
@@ -149,6 +202,7 @@ const row = z.strictObject({
|
|
|
149
202
|
seats: z.array(seat).min(1).max(DocumentLimits.PhysicalSeats),
|
|
150
203
|
});
|
|
151
204
|
const drawable = {
|
|
205
|
+
floorId: uuid.describe("Physical floor identity when the map defines levels.").optional(),
|
|
152
206
|
id: uuid,
|
|
153
207
|
parentId: uuid.nullable(),
|
|
154
208
|
transform,
|
|
@@ -176,6 +230,7 @@ const standingSelling = z.discriminatedUnion("mode", [
|
|
|
176
230
|
}),
|
|
177
231
|
]);
|
|
178
232
|
const groupBase = {
|
|
233
|
+
entrance: entranceSchema.optional(),
|
|
179
234
|
...drawable,
|
|
180
235
|
categoryId: uuid.nullable().optional(),
|
|
181
236
|
name,
|
|
@@ -191,19 +246,22 @@ const rowsLabels = z.strictObject({
|
|
|
191
246
|
});
|
|
192
247
|
export const segmentedRowSchema = z.strictObject({
|
|
193
248
|
id: uuid,
|
|
194
|
-
label,
|
|
249
|
+
label: storedLabelSchema.min(1, "Use a nonempty connected row label."),
|
|
195
250
|
sequence,
|
|
251
|
+
qualifySeatLabels: z.boolean().optional(),
|
|
196
252
|
smoothCorners: z.boolean().optional(),
|
|
197
253
|
parts: z
|
|
198
254
|
.array(z.strictObject({
|
|
199
255
|
rowId: uuid,
|
|
200
256
|
joinBefore: z.enum(RowJoin).nullable(),
|
|
257
|
+
labelOverride: storedLabelSchema.optional(),
|
|
201
258
|
}))
|
|
202
|
-
.min(
|
|
259
|
+
.min(1)
|
|
203
260
|
.max(DocumentLimits.PhysicalSeats),
|
|
204
261
|
});
|
|
262
|
+
const inventoryNaming = { code: label, name: label.optional() };
|
|
205
263
|
const tableLabels = z.strictObject({
|
|
206
|
-
|
|
264
|
+
...inventoryNaming,
|
|
207
265
|
chairs: sequence,
|
|
208
266
|
tableStyle: labelStyle,
|
|
209
267
|
});
|
|
@@ -232,6 +290,32 @@ const longTableLayout = z
|
|
|
232
290
|
}),
|
|
233
291
|
})
|
|
234
292
|
.refine((value) => Object.values(value.sides).some(Boolean), "Choose at least one table side.");
|
|
293
|
+
const arcFanRecipeSchema = z
|
|
294
|
+
.strictObject({
|
|
295
|
+
rowCount: finite.int().min(1).max(ArcFanMaximumRows),
|
|
296
|
+
innerRadiusM: dimension,
|
|
297
|
+
rowPitchM: dimension,
|
|
298
|
+
seatPitchM: dimension,
|
|
299
|
+
startAngleDeg: finite,
|
|
300
|
+
endAngleDeg: finite,
|
|
301
|
+
taperDeg: finite,
|
|
302
|
+
skewDeg: finite,
|
|
303
|
+
fit: z.enum(ArcFanFit),
|
|
304
|
+
facing: z.enum(ArcFanFacing),
|
|
305
|
+
seatsPerRow: finite.int().min(2).max(DocumentLimits.PhysicalSeats).optional(),
|
|
306
|
+
aisles: z.strictObject({ left: nonNegative, center: nonNegative, right: nonNegative }),
|
|
307
|
+
})
|
|
308
|
+
.refine((recipe) => recipe.fit !== ArcFanFit.SameCount || recipe.seatsPerRow !== undefined, "A fixed-count fan requires seats per row.");
|
|
309
|
+
const arcFanGenerationSchema = z.strictObject({
|
|
310
|
+
recipe: arcFanRecipeSchema,
|
|
311
|
+
sectionId: uuid.nullable(),
|
|
312
|
+
sectionOrigin: z.enum(ArcFanSectionOrigin),
|
|
313
|
+
members: z
|
|
314
|
+
.array(z.strictObject({ rowId: uuid, bookingLabel: storedLabelSchema, labelOverride: storedLabelSchema.optional() }))
|
|
315
|
+
.min(1)
|
|
316
|
+
.max(ArcFanMaximumRows * ArcFanMaximumPartsPerRow)
|
|
317
|
+
.refine((members) => new Set(members.map((member) => member.rowId)).size === members.length, "Generated fan members must be unique."),
|
|
318
|
+
});
|
|
235
319
|
export const groupSchema = z.discriminatedUnion("kind", [
|
|
236
320
|
z.strictObject({
|
|
237
321
|
...groupBase,
|
|
@@ -240,7 +324,9 @@ export const groupSchema = z.discriminatedUnion("kind", [
|
|
|
240
324
|
seatPitchM: dimension,
|
|
241
325
|
rowPitchM: dimension,
|
|
242
326
|
rowAlignment: z.enum(RowAlignment).optional(),
|
|
327
|
+
stagger: z.enum(RowStagger).optional(),
|
|
243
328
|
}),
|
|
329
|
+
arcFan: arcFanGenerationSchema.optional(),
|
|
244
330
|
labels: rowsLabels,
|
|
245
331
|
rows: z.array(row).min(1).max(DocumentLimits.PhysicalSeats),
|
|
246
332
|
}),
|
|
@@ -267,6 +353,7 @@ export const groupSchema = z.discriminatedUnion("kind", [
|
|
|
267
353
|
}),
|
|
268
354
|
]),
|
|
269
355
|
}),
|
|
356
|
+
arcFan: arcFanGenerationSchema.optional(),
|
|
270
357
|
labels: rowsLabels,
|
|
271
358
|
rows: z.array(row).min(1).max(DocumentLimits.PhysicalSeats),
|
|
272
359
|
}),
|
|
@@ -306,6 +393,8 @@ export const decorationStyleSchema = z.strictObject({
|
|
|
306
393
|
});
|
|
307
394
|
const decorationBase = {
|
|
308
395
|
...drawable,
|
|
396
|
+
label: storedLabelSchema.optional(),
|
|
397
|
+
heightM: nonNegative.optional(),
|
|
309
398
|
style: decorationStyleSchema.optional(),
|
|
310
399
|
};
|
|
311
400
|
const decoration = z.discriminatedUnion("kind", [
|
|
@@ -320,6 +409,7 @@ const decoration = z.discriminatedUnion("kind", [
|
|
|
320
409
|
.strictObject({
|
|
321
410
|
...decorationBase,
|
|
322
411
|
kind: z.literal(DecorationKind.Rectangle),
|
|
412
|
+
gate: gateDetails.optional(),
|
|
323
413
|
sizeM: size,
|
|
324
414
|
cornerRadiusM: nonNegative,
|
|
325
415
|
})
|
|
@@ -332,11 +422,17 @@ const decoration = z.discriminatedUnion("kind", [
|
|
|
332
422
|
z.strictObject({
|
|
333
423
|
...decorationBase,
|
|
334
424
|
kind: z.literal(DecorationKind.Line),
|
|
425
|
+
route: z.strictObject({ stepFree: z.boolean() }).optional(),
|
|
426
|
+
lineCap: z.enum(LineCap).optional(),
|
|
427
|
+
lineJoin: z.enum(LineJoin).optional(),
|
|
428
|
+
startEnding: z.enum(LineEnding).optional(),
|
|
429
|
+
endEnding: z.enum(LineEnding).optional(),
|
|
335
430
|
pointsM: z.array(point).min(2).max(10000),
|
|
336
431
|
}),
|
|
337
432
|
z.strictObject({
|
|
338
433
|
...decorationBase,
|
|
339
434
|
kind: z.literal(DecorationKind.Polygon),
|
|
435
|
+
gate: gateDetails.optional(),
|
|
340
436
|
boundary: polygon,
|
|
341
437
|
}),
|
|
342
438
|
z.strictObject({
|
|
@@ -354,10 +450,11 @@ const decoration = z.discriminatedUnion("kind", [
|
|
|
354
450
|
}),
|
|
355
451
|
]);
|
|
356
452
|
const areaBase = {
|
|
453
|
+
entrance: entranceSchema.optional(),
|
|
357
454
|
...drawable,
|
|
455
|
+
...inventoryNaming,
|
|
358
456
|
categoryId: uuid.nullable().optional(),
|
|
359
457
|
sectionId: uuid.nullable(),
|
|
360
|
-
label,
|
|
361
458
|
labelStyle,
|
|
362
459
|
capacity: finite.int().min(1).max(2147483647),
|
|
363
460
|
shape: z.discriminatedUnion("kind", [
|
|
@@ -394,14 +491,11 @@ export const categorySchema = z
|
|
|
394
491
|
.strictObject({
|
|
395
492
|
id: uuid,
|
|
396
493
|
name,
|
|
397
|
-
color:
|
|
494
|
+
color: hexColourSchema,
|
|
398
495
|
defaultPrice: templatePrice.nullable().optional(),
|
|
399
496
|
onSale: z.boolean().optional(),
|
|
400
497
|
seatShape: seatShapeSchema.optional(),
|
|
401
|
-
ticketOptions: z
|
|
402
|
-
.array(ticketOptionSchema)
|
|
403
|
-
.max(TicketOptionLimit)
|
|
404
|
-
.optional(),
|
|
498
|
+
ticketOptions: z.array(ticketOptionSchema).max(TicketOptionLimit).optional(),
|
|
405
499
|
})
|
|
406
500
|
.superRefine((category, context) => {
|
|
407
501
|
const names = new Set();
|
|
@@ -422,10 +516,7 @@ export const categoriesSchema = z
|
|
|
422
516
|
.superRefine((categories, context) => {
|
|
423
517
|
const ids = new Set();
|
|
424
518
|
for (const [index, category] of categories.entries()) {
|
|
425
|
-
for (const id of [
|
|
426
|
-
category.id,
|
|
427
|
-
...(category.ticketOptions ?? []).map((option) => option.id),
|
|
428
|
-
]) {
|
|
519
|
+
for (const id of [category.id, ...(category.ticketOptions ?? []).map((option) => option.id)]) {
|
|
429
520
|
if (ids.has(id))
|
|
430
521
|
context.addIssue({
|
|
431
522
|
code: "custom",
|
|
@@ -437,6 +528,7 @@ export const categoriesSchema = z
|
|
|
437
528
|
}
|
|
438
529
|
});
|
|
439
530
|
export const documentSchema = z.strictObject({
|
|
531
|
+
buyerPhoto: buyerPhotoSchema.optional(),
|
|
440
532
|
schemaVersion: z.literal(1),
|
|
441
533
|
mapId: uuid,
|
|
442
534
|
name,
|
|
@@ -448,14 +540,47 @@ export const documentSchema = z.strictObject({
|
|
|
448
540
|
}),
|
|
449
541
|
background: paint,
|
|
450
542
|
categories: categoriesSchema.optional(),
|
|
543
|
+
floors: z
|
|
544
|
+
.array(z.strictObject({ id: uuid, name, baseHeightM: coordinate, focalPoint }))
|
|
545
|
+
.min(1)
|
|
546
|
+
.max(1024)
|
|
547
|
+
.describe("Physical levels in display order. When present, every section, collection and drawable must reference one of these floor identities.")
|
|
548
|
+
.optional(),
|
|
549
|
+
zones: z
|
|
550
|
+
.array(z.strictObject({ id: uuid, name, color: hexColourSchema, focalPoint }))
|
|
551
|
+
.max(1024)
|
|
552
|
+
.describe("Section groups in display order, independent of physical floors.")
|
|
553
|
+
.optional(),
|
|
451
554
|
sections: z
|
|
452
555
|
.array(z.strictObject({
|
|
556
|
+
entrance: entranceSchema.optional(),
|
|
557
|
+
buyerPhoto: buyerPhotoSchema.optional(),
|
|
453
558
|
id: uuid,
|
|
454
|
-
label,
|
|
559
|
+
label: storedLabelSchema,
|
|
560
|
+
floorId: uuid.describe("Physical floor identity when the map defines levels.").optional(),
|
|
561
|
+
zoneId: uuid.describe("Optional chart-wide zone membership.").optional(),
|
|
562
|
+
elevation: z
|
|
563
|
+
.strictObject({
|
|
564
|
+
tier: z.enum(SectionTier).optional(),
|
|
565
|
+
rakeDeg: finite.min(SectionRake.min).max(SectionRake.max).optional(),
|
|
566
|
+
frontRowHeightM: finite.min(SectionFrontRowHeight.min).max(SectionFrontRowHeight.max).optional(),
|
|
567
|
+
})
|
|
568
|
+
.describe("Authored section slope and front-row elevation relative to its floor.")
|
|
569
|
+
.optional(),
|
|
455
570
|
categoryId: uuid.nullable().optional(),
|
|
456
571
|
displayLabel: text(80, true).optional(),
|
|
457
572
|
outline: polygon.optional(),
|
|
458
573
|
outlineRole: z.enum(SectionOutlineRole).optional(),
|
|
574
|
+
rotationDeg: z.number().int().min(SectionRotation.min).max(SectionRotation.max).optional(),
|
|
575
|
+
scalePercent: z.number().min(SectionScale.min).max(SectionScale.max).optional(),
|
|
576
|
+
outlineGrowthFactor: finite.positive().optional(),
|
|
577
|
+
rowRefitStrength: z
|
|
578
|
+
.number()
|
|
579
|
+
.int()
|
|
580
|
+
.min(RowRefitStrength.min)
|
|
581
|
+
.max(RowRefitStrength.max)
|
|
582
|
+
.describe("Last accepted row refit strength in percent.")
|
|
583
|
+
.optional(),
|
|
459
584
|
style: decorationStyleSchema.optional(),
|
|
460
585
|
labelPlacement: z
|
|
461
586
|
.strictObject({
|
|
@@ -469,21 +594,13 @@ export const documentSchema = z.strictObject({
|
|
|
469
594
|
.max(1024),
|
|
470
595
|
collections: z.array(z.strictObject({ ...drawable, name })).max(10000),
|
|
471
596
|
seatingGroups: z.array(groupSchema).max(DocumentLimits.PhysicalSeats),
|
|
472
|
-
segmentedRows: z
|
|
473
|
-
.array(segmentedRowSchema)
|
|
474
|
-
.max(DocumentLimits.PhysicalSeats)
|
|
475
|
-
.optional(),
|
|
597
|
+
segmentedRows: z.array(segmentedRowSchema).max(DocumentLimits.PhysicalSeats).optional(),
|
|
476
598
|
areas: z.array(area).max(10000),
|
|
477
599
|
decorations: z.array(decoration).max(10000),
|
|
478
600
|
assets: z
|
|
479
601
|
.array(z.strictObject({
|
|
480
602
|
id: uuid,
|
|
481
|
-
mimeType: z.enum([
|
|
482
|
-
"image/png",
|
|
483
|
-
"image/jpeg",
|
|
484
|
-
"image/webp",
|
|
485
|
-
"image/svg+xml",
|
|
486
|
-
]),
|
|
603
|
+
mimeType: z.enum(["image/png", "image/jpeg", "image/webp", "image/svg+xml"]),
|
|
487
604
|
}))
|
|
488
605
|
.max(256),
|
|
489
606
|
});
|
|
@@ -496,14 +613,13 @@ export const paintSchema = paint;
|
|
|
496
613
|
export const transformSchema = transform;
|
|
497
614
|
export const mapNameSchema = name;
|
|
498
615
|
export const sectionSchema = documentSchema.shape.sections.element;
|
|
616
|
+
export const floorsSchema = documentSchema.shape.floors.unwrap();
|
|
617
|
+
export const zonesSchema = documentSchema.shape.zones.unwrap();
|
|
499
618
|
export const uuidSchema = uuid;
|
|
500
619
|
export const dimensionSchema = dimension;
|
|
501
620
|
export const coordinateSchema = coordinate;
|
|
502
621
|
export const rotationSchema = angle;
|
|
503
|
-
export const positiveCountSchema = finite
|
|
504
|
-
.int()
|
|
505
|
-
.min(1)
|
|
506
|
-
.max(DocumentLimits.PhysicalSeats);
|
|
622
|
+
export const positiveCountSchema = finite.int().min(1).max(DocumentLimits.PhysicalSeats);
|
|
507
623
|
export const labelSequenceSchema = sequence;
|
|
508
624
|
export const inventoryLabelSchema = label;
|
|
509
625
|
export const attributesSchema = seat.shape.attributes;
|
|
@@ -522,8 +638,7 @@ export var DocumentParseStatus;
|
|
|
522
638
|
DocumentParseStatus["Rejected"] = "rejected";
|
|
523
639
|
})(DocumentParseStatus || (DocumentParseStatus = {}));
|
|
524
640
|
export function groupSeatCount(group) {
|
|
525
|
-
return group.kind === SeatingKind.Straight ||
|
|
526
|
-
group.kind === SeatingKind.Curved
|
|
641
|
+
return group.kind === SeatingKind.Straight || group.kind === SeatingKind.Curved
|
|
527
642
|
? group.rows.reduce((n, r) => n + r.seats.length, 0)
|
|
528
643
|
: group.kind === SeatingKind.Round
|
|
529
644
|
? group.chairs.length
|
|
@@ -570,24 +685,52 @@ export function capacity(document) {
|
|
|
570
685
|
return { physicalSeats, gaQuantity };
|
|
571
686
|
}
|
|
572
687
|
export function structuralIssues(document, changedGroups) {
|
|
573
|
-
const errors =
|
|
688
|
+
const errors = [];
|
|
574
689
|
const ids = new Set([document.mapId]);
|
|
575
690
|
const add = (id) => {
|
|
576
691
|
if (ids.has(id))
|
|
577
|
-
errors.push(issue(IssueCode.DuplicateId, "Physical identities must be unique.", [
|
|
578
|
-
id,
|
|
579
|
-
]));
|
|
692
|
+
errors.push(issue(IssueCode.DuplicateId, "Physical identities must be unique.", [id]));
|
|
580
693
|
ids.add(id);
|
|
581
694
|
};
|
|
695
|
+
const floors = new Set((document.floors ?? []).map((floor) => floor.id));
|
|
696
|
+
for (const floor of document.floors ?? [])
|
|
697
|
+
add(floor.id);
|
|
698
|
+
for (const member of [
|
|
699
|
+
...document.sections,
|
|
700
|
+
...document.collections,
|
|
701
|
+
...document.seatingGroups,
|
|
702
|
+
...document.areas,
|
|
703
|
+
...document.decorations,
|
|
704
|
+
]) {
|
|
705
|
+
if (member.floorId ? !floors.has(member.floorId) : floors.size > 0) {
|
|
706
|
+
errors.push(issue(IssueCode.UnknownFloor, "Physical objects must reference an existing floor when levels are defined.", [
|
|
707
|
+
member.id,
|
|
708
|
+
]));
|
|
709
|
+
}
|
|
710
|
+
}
|
|
582
711
|
const sections = new Set(document.sections.map((s) => s.id));
|
|
583
712
|
const parents = new Map(document.collections.map((c) => [c.id, c]));
|
|
713
|
+
const floorById = new Map([
|
|
714
|
+
...document.sections,
|
|
715
|
+
...document.collections,
|
|
716
|
+
...document.seatingGroups,
|
|
717
|
+
...document.areas,
|
|
718
|
+
...document.decorations,
|
|
719
|
+
].map((object) => [object.id, object.floorId]));
|
|
584
720
|
let vertices = 0;
|
|
585
|
-
const visitPolygon = (
|
|
586
|
-
if (
|
|
587
|
-
vertices +=
|
|
721
|
+
const visitPolygon = (polygon) => {
|
|
722
|
+
if (polygon)
|
|
723
|
+
vertices += polygonContourVertexCount(polygon) + polygon.holes.reduce((total, hole) => total + hole.length, 0);
|
|
588
724
|
};
|
|
725
|
+
const zones = new Set();
|
|
726
|
+
for (const zone of document.zones ?? []) {
|
|
727
|
+
add(zone.id);
|
|
728
|
+
zones.add(zone.id);
|
|
729
|
+
}
|
|
589
730
|
for (const s of document.sections) {
|
|
590
731
|
add(s.id);
|
|
732
|
+
if (s.zoneId && !zones.has(s.zoneId))
|
|
733
|
+
errors.push(issue(IssueCode.UnknownZone, "Section zone reference does not exist.", [s.id]));
|
|
591
734
|
visitPolygon(s.outline);
|
|
592
735
|
}
|
|
593
736
|
for (const category of document.categories ?? []) {
|
|
@@ -604,18 +747,23 @@ export function structuralIssues(document, changedGroups) {
|
|
|
604
747
|
...document.decorations,
|
|
605
748
|
]) {
|
|
606
749
|
add(object.id);
|
|
750
|
+
if ("sectionId" in object && object.sectionId !== null && !sections.has(object.sectionId))
|
|
751
|
+
errors.push(issue(IssueCode.UnknownSection, "Section reference does not exist.", [object.id]));
|
|
607
752
|
if ("sectionId" in object &&
|
|
608
753
|
object.sectionId !== null &&
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
754
|
+
sections.has(object.sectionId) &&
|
|
755
|
+
floorById.get(object.sectionId) !== object.floorId)
|
|
756
|
+
errors.push(issue(IssueCode.UnknownSection, "A section and its contents must belong to the same floor.", [object.id]));
|
|
757
|
+
if (object.parentId && parents.has(object.parentId) && floorById.get(object.parentId) !== object.floorId)
|
|
758
|
+
errors.push(issue(IssueCode.InvalidParent, "A collection and its contents must belong to the same floor.", [object.id]));
|
|
613
759
|
const visited = new Set([object.id]);
|
|
614
760
|
let parent = object.parentId;
|
|
615
761
|
let depth = 0;
|
|
616
762
|
while (parent) {
|
|
617
763
|
if (visited.has(parent) || !parents.has(parent) || ++depth > 64) {
|
|
618
|
-
errors.push(issue(IssueCode.InvalidParent, "Parent must be an existing acyclic collection, within depth 64.", [
|
|
764
|
+
errors.push(issue(IssueCode.InvalidParent, "Parent must be an existing acyclic collection, within depth 64.", [
|
|
765
|
+
object.id,
|
|
766
|
+
]));
|
|
619
767
|
break;
|
|
620
768
|
}
|
|
621
769
|
visited.add(parent);
|
|
@@ -623,6 +771,13 @@ export function structuralIssues(document, changedGroups) {
|
|
|
623
771
|
}
|
|
624
772
|
}
|
|
625
773
|
for (const g of document.seatingGroups) {
|
|
774
|
+
if ("arcFan" in g && g.arcFan?.sectionId) {
|
|
775
|
+
const target = g.arcFan.sectionId;
|
|
776
|
+
if (!sections.has(target))
|
|
777
|
+
errors.push(issue(IssueCode.UnknownSection, "Generated fan section reference does not exist.", [g.id]));
|
|
778
|
+
else if (floorById.get(target) !== g.floorId)
|
|
779
|
+
errors.push(issue(IssueCode.UnknownSection, "A generated fan and its section must belong to the same floor.", [g.id]));
|
|
780
|
+
}
|
|
626
781
|
visitPolygon(g.boundary);
|
|
627
782
|
if (g.kind === SeatingKind.Straight || g.kind === SeatingKind.Curved)
|
|
628
783
|
for (const r of g.rows) {
|
|
@@ -634,22 +789,18 @@ export function structuralIssues(document, changedGroups) {
|
|
|
634
789
|
for (const s of generateGroup(g))
|
|
635
790
|
add(s.id);
|
|
636
791
|
}
|
|
637
|
-
const rowOwners = new Map(document.seatingGroups.flatMap((group) => "rows" in group
|
|
638
|
-
? group.rows.map((row) => [row.id, { group, row }])
|
|
639
|
-
: []));
|
|
792
|
+
const rowOwners = new Map(document.seatingGroups.flatMap((group) => "rows" in group ? group.rows.map((row) => [row.id, { group, row }]) : []));
|
|
640
793
|
const assignedRows = new Set();
|
|
641
794
|
for (const logical of document.segmentedRows ?? []) {
|
|
642
795
|
add(logical.id);
|
|
643
|
-
const sectionId = rowOwners.get(logical.parts[0].rowId)?.group.sectionId;
|
|
644
796
|
for (let index = 0; index < logical.parts.length; index++) {
|
|
645
797
|
const part = logical.parts[index];
|
|
646
798
|
const owner = rowOwners.get(part.rowId);
|
|
647
799
|
if (!owner ||
|
|
648
800
|
assignedRows.has(part.rowId) ||
|
|
649
801
|
!owner.row.layout ||
|
|
650
|
-
owner.group.sectionId !== sectionId ||
|
|
651
802
|
(index === 0 ? part.joinBefore !== null : part.joinBefore === null))
|
|
652
|
-
errors.push(issue(IssueCode.InvalidStructure, "Each row part must have independent geometry, one logical owner
|
|
803
|
+
errors.push(issue(IssueCode.InvalidStructure, "Each row part must have independent geometry, one logical owner and a valid join.", [logical.id, part.rowId]));
|
|
653
804
|
assignedRows.add(part.rowId);
|
|
654
805
|
}
|
|
655
806
|
}
|
|
@@ -671,10 +822,10 @@ export function structuralIssues(document, changedGroups) {
|
|
|
671
822
|
if (errors.length)
|
|
672
823
|
return errors;
|
|
673
824
|
const matrices = worldMatrices(document);
|
|
674
|
-
const within = (p) => Number.isFinite(p.x) &&
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
825
|
+
const within = (p) => Number.isFinite(p.x) && Number.isFinite(p.y) && Math.abs(p.x) <= 10000 && Math.abs(p.y) <= 10000;
|
|
826
|
+
for (const section of document.sections)
|
|
827
|
+
if (section.outline && polygonContour(section.outline).outer.some((point) => !within(point)))
|
|
828
|
+
errors.push(issue(IssueCode.WorldBounds, "Derived section geometry exceeds its safety bounds.", [section.id]));
|
|
678
829
|
for (const g of document.seatingGroups) {
|
|
679
830
|
if (changedGroups && !changedGroups.has(g.id))
|
|
680
831
|
continue;
|
|
@@ -688,25 +839,20 @@ export function structuralIssues(document, changedGroups) {
|
|
|
688
839
|
if (d.kind === DecorationKind.Line)
|
|
689
840
|
points = d.pointsM;
|
|
690
841
|
else if (d.kind === DecorationKind.Polygon)
|
|
691
|
-
points = [...d.boundary.outer, ...d.boundary.holes.flat()];
|
|
692
|
-
else if ((d.kind === AreaKind.GeneralAdmission || d.kind === AreaKind.Booth) &&
|
|
693
|
-
d.shape.
|
|
694
|
-
points = [...d.shape.boundary.outer, ...d.shape.boundary.holes.flat()];
|
|
842
|
+
points = [...polygonContour(d.boundary).outer, ...d.boundary.holes.flat()];
|
|
843
|
+
else if ((d.kind === AreaKind.GeneralAdmission || d.kind === AreaKind.Booth) && d.shape.kind === ShapeKind.Polygon)
|
|
844
|
+
points = [...polygonContour(d.shape.boundary).outer, ...d.shape.boundary.holes.flat()];
|
|
695
845
|
else {
|
|
696
846
|
const w = d.kind === DecorationKind.Circle
|
|
697
847
|
? d.radiusM * 2
|
|
698
|
-
: (d.kind === AreaKind.GeneralAdmission ||
|
|
699
|
-
d.kind === AreaKind.Booth) &&
|
|
700
|
-
d.shape.kind === ShapeKind.Rectangle
|
|
848
|
+
: (d.kind === AreaKind.GeneralAdmission || d.kind === AreaKind.Booth) && d.shape.kind === ShapeKind.Rectangle
|
|
701
849
|
? d.shape.widthM
|
|
702
850
|
: "sizeM" in d
|
|
703
851
|
? d.sizeM.width
|
|
704
852
|
: 0;
|
|
705
853
|
const h = d.kind === DecorationKind.Circle
|
|
706
854
|
? d.radiusM * 2
|
|
707
|
-
: (d.kind === AreaKind.GeneralAdmission ||
|
|
708
|
-
d.kind === AreaKind.Booth) &&
|
|
709
|
-
d.shape.kind === ShapeKind.Rectangle
|
|
855
|
+
: (d.kind === AreaKind.GeneralAdmission || d.kind === AreaKind.Booth) && d.shape.kind === ShapeKind.Rectangle
|
|
710
856
|
? d.shape.heightM
|
|
711
857
|
: "sizeM" in d
|
|
712
858
|
? d.sizeM.height
|
|
@@ -726,9 +872,7 @@ export function structuralIssues(document, changedGroups) {
|
|
|
726
872
|
export function parsePhysicalDocument(input) {
|
|
727
873
|
let raw = input;
|
|
728
874
|
try {
|
|
729
|
-
if (typeof raw !== "string" &&
|
|
730
|
-
new TextEncoder().encode(JSON.stringify(raw)).byteLength >
|
|
731
|
-
DocumentLimits.JsonBytes)
|
|
875
|
+
if (typeof raw !== "string" && new TextEncoder().encode(JSON.stringify(raw)).byteLength > DocumentLimits.JsonBytes)
|
|
732
876
|
return {
|
|
733
877
|
status: DocumentParseStatus.Rejected,
|
|
734
878
|
issues: [issue(IssueCode.Limit, "Document exceeds 64MiB.", [])],
|
|
@@ -745,9 +889,7 @@ export function parsePhysicalDocument(input) {
|
|
|
745
889
|
catch {
|
|
746
890
|
return {
|
|
747
891
|
status: DocumentParseStatus.Rejected,
|
|
748
|
-
issues: [
|
|
749
|
-
issue(IssueCode.InvalidJson, "Document is not readable JSON.", []),
|
|
750
|
-
],
|
|
892
|
+
issues: [issue(IssueCode.InvalidJson, "Document is not readable JSON.", [])],
|
|
751
893
|
};
|
|
752
894
|
}
|
|
753
895
|
const result = documentSchema.safeParse(raw);
|
|
@@ -756,9 +898,7 @@ export function parsePhysicalDocument(input) {
|
|
|
756
898
|
status: DocumentParseStatus.Rejected,
|
|
757
899
|
issues: result.error.issues
|
|
758
900
|
.slice(0, 50)
|
|
759
|
-
.map((e) => issue(e.path[0] === "schemaVersion"
|
|
760
|
-
? IssueCode.UnsupportedVersion
|
|
761
|
-
: IssueCode.InvalidStructure, e.message, [], e.path.map(String).join("."))),
|
|
901
|
+
.map((e) => issue(e.path[0] === "schemaVersion" ? IssueCode.UnsupportedVersion : IssueCode.InvalidStructure, e.message, [], e.path.map(String).join("."))),
|
|
762
902
|
};
|
|
763
903
|
const document = result.data;
|
|
764
904
|
const errors = structuralIssues(document);
|
|
@@ -769,17 +909,13 @@ export function parsePhysicalDocument(input) {
|
|
|
769
909
|
/** Prepared entity schemas have already passed. Recheck global references and only changed world geometry. */
|
|
770
910
|
export function validatePreparedDocument(document, changedGroups) {
|
|
771
911
|
const { seatingGroups, ...metadata } = document;
|
|
772
|
-
const result = documentSchema
|
|
773
|
-
.omit({ seatingGroups: true })
|
|
774
|
-
.safeParse(metadata);
|
|
912
|
+
const result = documentSchema.omit({ seatingGroups: true }).safeParse(metadata);
|
|
775
913
|
if (!result.success)
|
|
776
914
|
return result.error.issues
|
|
777
915
|
.slice(0, 50)
|
|
778
916
|
.map((error) => issue(IssueCode.InvalidStructure, error.message, [], error.path.map(String).join(".")));
|
|
779
917
|
if (seatingGroups.length > DocumentLimits.PhysicalSeats)
|
|
780
|
-
return [
|
|
781
|
-
issue(IssueCode.Limit, "Too many seating owners.", [document.mapId]),
|
|
782
|
-
];
|
|
918
|
+
return [issue(IssueCode.Limit, "Too many seating owners.", [document.mapId])];
|
|
783
919
|
return structuralIssues(document, changedGroups);
|
|
784
920
|
}
|
|
785
921
|
export function serializePhysicalDocument(document) {
|