@expofp/schema 0.0.0-experimental.2632d13 → 0.0.0-experimental.3b0db16
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/index.d.ts +0 -4
- package/dist/index.js +0 -4
- package/dist/lib/camera.d.ts +0 -1
- package/dist/lib/camera.js +0 -7
- package/dist/lib/config-defaults.d.ts +0 -27
- package/dist/lib/config-defaults.js +0 -35
- package/dist/lib/config.d.ts +0 -342
- package/dist/lib/config.js +0 -75
- package/dist/lib/flags.d.ts +0 -5
- package/dist/lib/flags.js +0 -44
- package/dist/lib/fp-svg.d.ts +0 -129
- package/dist/lib/fp-svg.js +1 -19
- package/dist/lib/intents.d.ts +0 -1
- package/package.json +2 -2
- package/dist/lib/branding.d.ts +0 -21
- package/dist/lib/branding.js +0 -20
- package/dist/lib/journey.d.ts +0 -27
- package/dist/lib/journey.js +0 -26
- package/dist/lib/maps.d.ts +0 -22
- package/dist/lib/maps.js +0 -19
- package/dist/lib/venues.d.ts +0 -222
- package/dist/lib/venues.js +0 -150
package/dist/lib/venues.d.ts
DELETED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* The multi-venue contract (docs/specs/multi-venue-data-contract.md, currently
|
|
4
|
-
* Revision 4).
|
|
5
|
-
*
|
|
6
|
-
* `VenueSchema` is deliberately the PERMISSIVE shape the config parses with —
|
|
7
|
-
* a malformed venue must not fail the plan. Venues arrive inside `data.js`
|
|
8
|
-
* alongside everything else, so a strict `ConfigSchema.parse` would throw on
|
|
9
|
-
* one bad `order` and take the whole floor plan down with it. The loose shape
|
|
10
|
-
* here lets the payload through; per-venue enforcement of the published
|
|
11
|
-
* contract (every documented constraint, plus diagnostics) lives in the
|
|
12
|
-
* imperative parser at `packages/floorplan/src/data/venues.ts`, which is the
|
|
13
|
-
* contract's one source of truth — not a zod schema.
|
|
14
|
-
*
|
|
15
|
-
* **Hand-sync is the accepted permanent cost, not a pending TODO.** Three
|
|
16
|
-
* copies encode the contract's rules and each must be updated together:
|
|
17
|
-
*
|
|
18
|
-
* 1. `packages/floorplan/src/data/venues.ts` — runtime parsing + diagnostics
|
|
19
|
-
* 2. `docs/specs/validate-venues.mjs` — the export gate (Guard 2, §12)
|
|
20
|
-
* 3. `docs/specs/multi-venue-data-contract.schema.json` — structural schema
|
|
21
|
-
*
|
|
22
|
-
* An earlier TODO here proposed generating 2 and 3 from a strict zod schema in
|
|
23
|
-
* this module. That schema was deleted as dead code (it had zero consumers and
|
|
24
|
-
* had already drifted from the parser), so the TODO went with it: the parser
|
|
25
|
-
* enforces referential and geometric rules that no JSON Schema can express,
|
|
26
|
-
* which is why it — not zod — is the source of truth.
|
|
27
|
-
*
|
|
28
|
-
* What keeps the copies honest is
|
|
29
|
-
* `packages/floorplan/src/data/validate-venues.test.ts`, which runs all three
|
|
30
|
-
* implementations over shared fixtures and asserts they agree on the `code`,
|
|
31
|
-
* `effect` and `path` of every diagnostic. `message` and `consequence` are
|
|
32
|
-
* deliberately excluded, so either implementation may reword its prose freely.
|
|
33
|
-
* Add a parity case there whenever you add a rule.
|
|
34
|
-
*/
|
|
35
|
-
/** A point in floor-plan projected coordinates. */
|
|
36
|
-
export declare const VenuePointSchema: z.ZodObject<{
|
|
37
|
-
x: z.ZodNumber;
|
|
38
|
-
y: z.ZodNumber;
|
|
39
|
-
}, z.core.$strip>;
|
|
40
|
-
/** How an auxiliary venue layer is drawn. */
|
|
41
|
-
export declare const VenueRenderModeSchema: z.ZodEnum<{
|
|
42
|
-
marker: "marker";
|
|
43
|
-
scene: "scene";
|
|
44
|
-
}>;
|
|
45
|
-
/**
|
|
46
|
-
* Upper size bound for an aux layer: a pixel size, or `'detail'` to track the
|
|
47
|
-
* venue's own detail cutoff instead of a fixed number.
|
|
48
|
-
*/
|
|
49
|
-
export declare const VenueSizeBoundSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"detail">]>;
|
|
50
|
-
/** One level of a venue, bound to a plan layer. */
|
|
51
|
-
export declare const VenueLevelSchema: z.ZodObject<{
|
|
52
|
-
layer: z.ZodString;
|
|
53
|
-
ordinal: z.ZodInt;
|
|
54
|
-
name: z.ZodOptional<z.ZodString>;
|
|
55
|
-
initial: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
-
}, z.core.$loose>;
|
|
57
|
-
/** A non-level layer a venue draws — a replacing scene or a marker. */
|
|
58
|
-
export declare const VenueAuxLayerSchema: z.ZodObject<{
|
|
59
|
-
layer: z.ZodString;
|
|
60
|
-
render: z.ZodEnum<{
|
|
61
|
-
marker: "marker";
|
|
62
|
-
scene: "scene";
|
|
63
|
-
}>;
|
|
64
|
-
replacesDefault: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
-
suppressesLabel: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
-
minSizePx: z.ZodOptional<z.ZodNumber>;
|
|
67
|
-
maxSizePx: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"detail">]>>;
|
|
68
|
-
}, z.core.$loose>;
|
|
69
|
-
/**
|
|
70
|
-
* A venue entrance: the authored point where a venue meets the outside world.
|
|
71
|
-
*
|
|
72
|
-
* Plan-local on one of the venue's own levels, and therefore geo-projectable
|
|
73
|
-
* through the plan's GPS anchors — which is what lets a cross-venue journey
|
|
74
|
-
* hand a maps app a door rather than the middle of a building footprint. The
|
|
75
|
-
* wayfinding engine never learns the concept: an entrance reaches it as an
|
|
76
|
-
* ordinary route endpoint, exactly as a kiosk anchor does.
|
|
77
|
-
*
|
|
78
|
-
* A venue may author several; the SDK chooses between them by cost and never
|
|
79
|
-
* asks the visitor to pick. Authoring none is permanent, supported behavior —
|
|
80
|
-
* such a venue keeps marker-point targeting forever.
|
|
81
|
-
*/
|
|
82
|
-
export declare const VenueEntranceSchema: z.ZodObject<{
|
|
83
|
-
layer: z.ZodString;
|
|
84
|
-
point: z.ZodObject<{
|
|
85
|
-
x: z.ZodNumber;
|
|
86
|
-
y: z.ZodNumber;
|
|
87
|
-
}, z.core.$strip>;
|
|
88
|
-
name: z.ZodOptional<z.ZodString>;
|
|
89
|
-
}, z.core.$loose>;
|
|
90
|
-
/**
|
|
91
|
-
* The plan's whole-campus frame (Revision 9): an axis-aligned rectangle in
|
|
92
|
-
* plan-local coordinates, with no angle. Plan-wide although a venue carries it
|
|
93
|
-
* — the first carrier by `order` wins. A usable one has finite members and a
|
|
94
|
-
* positive `width` and `height`; that, like every venue constraint, is the
|
|
95
|
-
* parser's to enforce (`campus-viewbox-invalid`), not this schema's.
|
|
96
|
-
*/
|
|
97
|
-
export declare const VenueCampusViewboxSchema: z.ZodObject<{
|
|
98
|
-
x: z.ZodNumber;
|
|
99
|
-
y: z.ZodNumber;
|
|
100
|
-
width: z.ZodNumber;
|
|
101
|
-
height: z.ZodNumber;
|
|
102
|
-
}, z.core.$loose>;
|
|
103
|
-
/**
|
|
104
|
-
* The shape the config parses with: same fields, no constraints. Anything
|
|
105
|
-
* structurally venue-like survives into the payload so the quarantine — not the
|
|
106
|
-
* parser — decides what to drop.
|
|
107
|
-
*/
|
|
108
|
-
export declare const VenueSchema: z.ZodObject<{
|
|
109
|
-
id: z.ZodString;
|
|
110
|
-
name: z.ZodString;
|
|
111
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
112
|
-
levels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
113
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
114
|
-
ordinal: z.ZodOptional<z.ZodInt>;
|
|
115
|
-
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
116
|
-
initial: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
117
|
-
}, z.core.$loose>>>;
|
|
118
|
-
contour: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
119
|
-
x: z.ZodNumber;
|
|
120
|
-
y: z.ZodNumber;
|
|
121
|
-
}, z.core.$strip>>>;
|
|
122
|
-
markerPoint: z.ZodOptional<z.ZodObject<{
|
|
123
|
-
x: z.ZodNumber;
|
|
124
|
-
y: z.ZodNumber;
|
|
125
|
-
}, z.core.$strip>>;
|
|
126
|
-
detailMinSizePx: z.ZodOptional<z.ZodNumber>;
|
|
127
|
-
markerMaxSizePx: z.ZodOptional<z.ZodNumber>;
|
|
128
|
-
layers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
129
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
130
|
-
render: z.ZodOptional<z.ZodEnum<{
|
|
131
|
-
marker: "marker";
|
|
132
|
-
scene: "scene";
|
|
133
|
-
}>>;
|
|
134
|
-
replacesDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
135
|
-
suppressesLabel: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
136
|
-
minSizePx: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
137
|
-
maxSizePx: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"detail">]>>>;
|
|
138
|
-
}, z.core.$loose>>>;
|
|
139
|
-
entrances: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
140
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
141
|
-
point: z.ZodOptional<z.ZodObject<{
|
|
142
|
-
x: z.ZodNumber;
|
|
143
|
-
y: z.ZodNumber;
|
|
144
|
-
}, z.core.$strip>>;
|
|
145
|
-
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
146
|
-
}, z.core.$loose>>>;
|
|
147
|
-
campusViewbox: z.ZodOptional<z.ZodObject<{
|
|
148
|
-
x: z.ZodOptional<z.ZodNumber>;
|
|
149
|
-
y: z.ZodOptional<z.ZodNumber>;
|
|
150
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
151
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
152
|
-
}, z.core.$loose>>;
|
|
153
|
-
}, z.core.$loose>;
|
|
154
|
-
/** Wire version of the multi-venue payload. Revision 2 defines version 1. */
|
|
155
|
-
export declare const VenuesVersionSchema: z.ZodLiteral<1>;
|
|
156
|
-
/**
|
|
157
|
-
* The venue-bearing slice of the `data.js` payload, as the parser receives it.
|
|
158
|
-
*
|
|
159
|
-
* Both fields are optional and the object is loose: callers hand the whole data
|
|
160
|
-
* module over, and a plan with no venues omits them entirely. A payload that
|
|
161
|
-
* carries `venues` under a version the runtime does not know is the parser's
|
|
162
|
-
* problem to report, not a reason to reject the shape here.
|
|
163
|
-
*/
|
|
164
|
-
export declare const VenuePayloadSchema: z.ZodObject<{
|
|
165
|
-
venuesVersion: z.ZodOptional<z.ZodLiteral<1>>;
|
|
166
|
-
venues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
167
|
-
id: z.ZodString;
|
|
168
|
-
name: z.ZodString;
|
|
169
|
-
order: z.ZodOptional<z.ZodNumber>;
|
|
170
|
-
levels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
171
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
172
|
-
ordinal: z.ZodOptional<z.ZodInt>;
|
|
173
|
-
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
174
|
-
initial: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
175
|
-
}, z.core.$loose>>>;
|
|
176
|
-
contour: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
177
|
-
x: z.ZodNumber;
|
|
178
|
-
y: z.ZodNumber;
|
|
179
|
-
}, z.core.$strip>>>;
|
|
180
|
-
markerPoint: z.ZodOptional<z.ZodObject<{
|
|
181
|
-
x: z.ZodNumber;
|
|
182
|
-
y: z.ZodNumber;
|
|
183
|
-
}, z.core.$strip>>;
|
|
184
|
-
detailMinSizePx: z.ZodOptional<z.ZodNumber>;
|
|
185
|
-
markerMaxSizePx: z.ZodOptional<z.ZodNumber>;
|
|
186
|
-
layers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
187
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
188
|
-
render: z.ZodOptional<z.ZodEnum<{
|
|
189
|
-
marker: "marker";
|
|
190
|
-
scene: "scene";
|
|
191
|
-
}>>;
|
|
192
|
-
replacesDefault: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
193
|
-
suppressesLabel: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
194
|
-
minSizePx: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
195
|
-
maxSizePx: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"detail">]>>>;
|
|
196
|
-
}, z.core.$loose>>>;
|
|
197
|
-
entrances: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
198
|
-
layer: z.ZodOptional<z.ZodString>;
|
|
199
|
-
point: z.ZodOptional<z.ZodObject<{
|
|
200
|
-
x: z.ZodNumber;
|
|
201
|
-
y: z.ZodNumber;
|
|
202
|
-
}, z.core.$strip>>;
|
|
203
|
-
name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
204
|
-
}, z.core.$loose>>>;
|
|
205
|
-
campusViewbox: z.ZodOptional<z.ZodObject<{
|
|
206
|
-
x: z.ZodOptional<z.ZodNumber>;
|
|
207
|
-
y: z.ZodOptional<z.ZodNumber>;
|
|
208
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
209
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
210
|
-
}, z.core.$loose>>;
|
|
211
|
-
}, z.core.$loose>>>;
|
|
212
|
-
}, z.core.$loose>;
|
|
213
|
-
export type VenuePoint = z.infer<typeof VenuePointSchema>;
|
|
214
|
-
export type VenueRenderMode = z.infer<typeof VenueRenderModeSchema>;
|
|
215
|
-
export type VenueSizeBound = z.infer<typeof VenueSizeBoundSchema>;
|
|
216
|
-
export type RawVenueLevel = z.infer<typeof VenueLevelSchema>;
|
|
217
|
-
export type RawVenueAuxLayer = z.infer<typeof VenueAuxLayerSchema>;
|
|
218
|
-
export type RawVenueEntrance = z.infer<typeof VenueEntranceSchema>;
|
|
219
|
-
export type VenueCampusViewbox = z.infer<typeof VenueCampusViewboxSchema>;
|
|
220
|
-
export type RawVenue = z.infer<typeof VenueSchema>;
|
|
221
|
-
export type VenuePayload = z.infer<typeof VenuePayloadSchema>;
|
|
222
|
-
//# sourceMappingURL=venues.d.ts.map
|
package/dist/lib/venues.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* The multi-venue contract (docs/specs/multi-venue-data-contract.md, currently
|
|
4
|
-
* Revision 4).
|
|
5
|
-
*
|
|
6
|
-
* `VenueSchema` is deliberately the PERMISSIVE shape the config parses with —
|
|
7
|
-
* a malformed venue must not fail the plan. Venues arrive inside `data.js`
|
|
8
|
-
* alongside everything else, so a strict `ConfigSchema.parse` would throw on
|
|
9
|
-
* one bad `order` and take the whole floor plan down with it. The loose shape
|
|
10
|
-
* here lets the payload through; per-venue enforcement of the published
|
|
11
|
-
* contract (every documented constraint, plus diagnostics) lives in the
|
|
12
|
-
* imperative parser at `packages/floorplan/src/data/venues.ts`, which is the
|
|
13
|
-
* contract's one source of truth — not a zod schema.
|
|
14
|
-
*
|
|
15
|
-
* **Hand-sync is the accepted permanent cost, not a pending TODO.** Three
|
|
16
|
-
* copies encode the contract's rules and each must be updated together:
|
|
17
|
-
*
|
|
18
|
-
* 1. `packages/floorplan/src/data/venues.ts` — runtime parsing + diagnostics
|
|
19
|
-
* 2. `docs/specs/validate-venues.mjs` — the export gate (Guard 2, §12)
|
|
20
|
-
* 3. `docs/specs/multi-venue-data-contract.schema.json` — structural schema
|
|
21
|
-
*
|
|
22
|
-
* An earlier TODO here proposed generating 2 and 3 from a strict zod schema in
|
|
23
|
-
* this module. That schema was deleted as dead code (it had zero consumers and
|
|
24
|
-
* had already drifted from the parser), so the TODO went with it: the parser
|
|
25
|
-
* enforces referential and geometric rules that no JSON Schema can express,
|
|
26
|
-
* which is why it — not zod — is the source of truth.
|
|
27
|
-
*
|
|
28
|
-
* What keeps the copies honest is
|
|
29
|
-
* `packages/floorplan/src/data/validate-venues.test.ts`, which runs all three
|
|
30
|
-
* implementations over shared fixtures and asserts they agree on the `code`,
|
|
31
|
-
* `effect` and `path` of every diagnostic. `message` and `consequence` are
|
|
32
|
-
* deliberately excluded, so either implementation may reword its prose freely.
|
|
33
|
-
* Add a parity case there whenever you add a rule.
|
|
34
|
-
*/
|
|
35
|
-
/** A point in floor-plan projected coordinates. */
|
|
36
|
-
export const VenuePointSchema = z.object({
|
|
37
|
-
/** Horizontal coordinate. */
|
|
38
|
-
x: z.number(),
|
|
39
|
-
/** Vertical coordinate. */
|
|
40
|
-
y: z.number(),
|
|
41
|
-
});
|
|
42
|
-
/** How an auxiliary venue layer is drawn. */
|
|
43
|
-
export const VenueRenderModeSchema = z.enum(['scene', 'marker']);
|
|
44
|
-
/**
|
|
45
|
-
* Upper size bound for an aux layer: a pixel size, or `'detail'` to track the
|
|
46
|
-
* venue's own detail cutoff instead of a fixed number.
|
|
47
|
-
*/
|
|
48
|
-
export const VenueSizeBoundSchema = z.union([z.number().min(0), z.literal('detail')]);
|
|
49
|
-
/** One level of a venue, bound to a plan layer. */
|
|
50
|
-
export const VenueLevelSchema = z.looseObject({
|
|
51
|
-
/** Plan layer name carrying this level's drawing. */
|
|
52
|
-
layer: z.string().min(1),
|
|
53
|
-
/** Storey index; orders the level list and need not start at 0. */
|
|
54
|
-
ordinal: z.int(),
|
|
55
|
-
/** Display name; falls back to the layer name. */
|
|
56
|
-
name: z.string().min(1).optional(),
|
|
57
|
-
/** Level shown when the venue is first focused. */
|
|
58
|
-
initial: z.boolean().optional(),
|
|
59
|
-
});
|
|
60
|
-
/** A non-level layer a venue draws — a replacing scene or a marker. */
|
|
61
|
-
export const VenueAuxLayerSchema = z.looseObject({
|
|
62
|
-
/** Plan layer name carrying the drawing. */
|
|
63
|
-
layer: z.string().min(1),
|
|
64
|
-
render: VenueRenderModeSchema,
|
|
65
|
-
/** When a `scene` layer suppresses the procedural venue scene (default true). */
|
|
66
|
-
replacesDefault: z.boolean().optional(),
|
|
67
|
-
/**
|
|
68
|
-
* Whether this layer's artwork stands in for the venue name label while it is
|
|
69
|
-
* visible. Defaults to `replacesDefault` on a `scene` layer — map-scaled
|
|
70
|
-
* contour artwork letters itself — and to `false` on a `marker`.
|
|
71
|
-
*/
|
|
72
|
-
suppressesLabel: z.boolean().optional(),
|
|
73
|
-
/** Hide the layer below this projected size in pixels. */
|
|
74
|
-
minSizePx: z.number().min(0).optional(),
|
|
75
|
-
/** Hide the layer above this projected size in pixels. */
|
|
76
|
-
maxSizePx: VenueSizeBoundSchema.optional(),
|
|
77
|
-
});
|
|
78
|
-
/**
|
|
79
|
-
* A venue entrance: the authored point where a venue meets the outside world.
|
|
80
|
-
*
|
|
81
|
-
* Plan-local on one of the venue's own levels, and therefore geo-projectable
|
|
82
|
-
* through the plan's GPS anchors — which is what lets a cross-venue journey
|
|
83
|
-
* hand a maps app a door rather than the middle of a building footprint. The
|
|
84
|
-
* wayfinding engine never learns the concept: an entrance reaches it as an
|
|
85
|
-
* ordinary route endpoint, exactly as a kiosk anchor does.
|
|
86
|
-
*
|
|
87
|
-
* A venue may author several; the SDK chooses between them by cost and never
|
|
88
|
-
* asks the visitor to pick. Authoring none is permanent, supported behavior —
|
|
89
|
-
* such a venue keeps marker-point targeting forever.
|
|
90
|
-
*/
|
|
91
|
-
export const VenueEntranceSchema = z.looseObject({
|
|
92
|
-
/** Plan layer of the venue level this door sits on. */
|
|
93
|
-
layer: z.string().min(1),
|
|
94
|
-
/** Where the door is, in plan-local coordinates. */
|
|
95
|
-
point: VenuePointSchema,
|
|
96
|
-
/** Display name — "North Door". Falls back to the venue's own name. */
|
|
97
|
-
name: z.string().min(1).optional(),
|
|
98
|
-
});
|
|
99
|
-
/**
|
|
100
|
-
* The plan's whole-campus frame (Revision 9): an axis-aligned rectangle in
|
|
101
|
-
* plan-local coordinates, with no angle. Plan-wide although a venue carries it
|
|
102
|
-
* — the first carrier by `order` wins. A usable one has finite members and a
|
|
103
|
-
* positive `width` and `height`; that, like every venue constraint, is the
|
|
104
|
-
* parser's to enforce (`campus-viewbox-invalid`), not this schema's.
|
|
105
|
-
*/
|
|
106
|
-
export const VenueCampusViewboxSchema = z.looseObject({
|
|
107
|
-
x: z.number(),
|
|
108
|
-
y: z.number(),
|
|
109
|
-
width: z.number(),
|
|
110
|
-
height: z.number(),
|
|
111
|
-
});
|
|
112
|
-
/**
|
|
113
|
-
* The shape the config parses with: same fields, no constraints. Anything
|
|
114
|
-
* structurally venue-like survives into the payload so the quarantine — not the
|
|
115
|
-
* parser — decides what to drop.
|
|
116
|
-
*/
|
|
117
|
-
export const VenueSchema = z.looseObject({
|
|
118
|
-
id: z.string(),
|
|
119
|
-
name: z.string(),
|
|
120
|
-
/**
|
|
121
|
-
* Contractually required (§9): a producer must author it on every venue.
|
|
122
|
-
* Optional here only because this shape is permissive by design — the parser
|
|
123
|
-
* falls back to array position and reports `venue-order-invalid` when one is
|
|
124
|
-
* missing or unusable.
|
|
125
|
-
*/
|
|
126
|
-
order: z.number().optional(),
|
|
127
|
-
levels: z.array(VenueLevelSchema.partial()).optional(),
|
|
128
|
-
contour: z.array(VenuePointSchema).optional(),
|
|
129
|
-
markerPoint: VenuePointSchema.optional(),
|
|
130
|
-
detailMinSizePx: z.number().optional(),
|
|
131
|
-
/** The marker ⇄ scene edge (§4, Revision 5). Defaults to 60 when absent or unusable. */
|
|
132
|
-
markerMaxSizePx: z.number().optional(),
|
|
133
|
-
layers: z.array(VenueAuxLayerSchema.partial()).optional(),
|
|
134
|
-
entrances: z.array(VenueEntranceSchema.partial()).optional(),
|
|
135
|
-
campusViewbox: VenueCampusViewboxSchema.partial().optional(),
|
|
136
|
-
});
|
|
137
|
-
/** Wire version of the multi-venue payload. Revision 2 defines version 1. */
|
|
138
|
-
export const VenuesVersionSchema = z.literal(1);
|
|
139
|
-
/**
|
|
140
|
-
* The venue-bearing slice of the `data.js` payload, as the parser receives it.
|
|
141
|
-
*
|
|
142
|
-
* Both fields are optional and the object is loose: callers hand the whole data
|
|
143
|
-
* module over, and a plan with no venues omits them entirely. A payload that
|
|
144
|
-
* carries `venues` under a version the runtime does not know is the parser's
|
|
145
|
-
* problem to report, not a reason to reject the shape here.
|
|
146
|
-
*/
|
|
147
|
-
export const VenuePayloadSchema = z.looseObject({
|
|
148
|
-
venuesVersion: VenuesVersionSchema.optional(),
|
|
149
|
-
venues: z.array(VenueSchema).optional(),
|
|
150
|
-
});
|