@expofp/schema 0.0.0-experimental.2d6c681

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.
Files changed (49) hide show
  1. package/dist/index.d.ts +24 -0
  2. package/dist/index.js +23 -0
  3. package/dist/lib/booth.d.ts +74 -0
  4. package/dist/lib/booth.js +35 -0
  5. package/dist/lib/branding.d.ts +21 -0
  6. package/dist/lib/branding.js +20 -0
  7. package/dist/lib/camera.d.ts +24 -0
  8. package/dist/lib/camera.js +36 -0
  9. package/dist/lib/categories.d.ts +9 -0
  10. package/dist/lib/categories.js +7 -0
  11. package/dist/lib/config-defaults.d.ts +147 -0
  12. package/dist/lib/config-defaults.js +164 -0
  13. package/dist/lib/config.d.ts +2146 -0
  14. package/dist/lib/config.js +438 -0
  15. package/dist/lib/exhibitor.d.ts +66 -0
  16. package/dist/lib/exhibitor.js +69 -0
  17. package/dist/lib/filters.d.ts +23 -0
  18. package/dist/lib/filters.js +24 -0
  19. package/dist/lib/flags.d.ts +17 -0
  20. package/dist/lib/flags.js +63 -0
  21. package/dist/lib/fp-geo.d.ts +105 -0
  22. package/dist/lib/fp-geo.js +55 -0
  23. package/dist/lib/fp-svg.d.ts +399 -0
  24. package/dist/lib/fp-svg.js +196 -0
  25. package/dist/lib/heatmap.d.ts +23 -0
  26. package/dist/lib/heatmap.js +24 -0
  27. package/dist/lib/intents.d.ts +173 -0
  28. package/dist/lib/intents.js +153 -0
  29. package/dist/lib/journey.d.ts +27 -0
  30. package/dist/lib/journey.js +26 -0
  31. package/dist/lib/kiosk.d.ts +39 -0
  32. package/dist/lib/kiosk.js +65 -0
  33. package/dist/lib/maplibre.d.ts +43 -0
  34. package/dist/lib/maplibre.js +51 -0
  35. package/dist/lib/maps.d.ts +22 -0
  36. package/dist/lib/maps.js +19 -0
  37. package/dist/lib/poi-types.d.ts +13 -0
  38. package/dist/lib/poi-types.js +17 -0
  39. package/dist/lib/schedule.d.ts +25 -0
  40. package/dist/lib/schedule.js +20 -0
  41. package/dist/lib/search.d.ts +51 -0
  42. package/dist/lib/search.js +36 -0
  43. package/dist/lib/venues.d.ts +222 -0
  44. package/dist/lib/venues.js +150 -0
  45. package/dist/lib/visibility.d.ts +17 -0
  46. package/dist/lib/visibility.js +23 -0
  47. package/dist/lib/wayfinding.d.ts +104 -0
  48. package/dist/lib/wayfinding.js +52 -0
  49. package/package.json +35 -0
@@ -0,0 +1,150 @@
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
+ });
@@ -0,0 +1,17 @@
1
+ import * as z from 'zod';
2
+ /**
3
+ * A map-chrome visibility request — the argument of `FloorPlan.setVisibility`
4
+ * and the `setVisibility` intent. Every field is optional, but the semantics
5
+ * are rebuild-not-merge (the legacy `?hide=` contract): a field set to `false`
6
+ * hides its element, and every omitted field resets to visible.
7
+ */
8
+ export declare const VisibilitySchema: z.ZodObject<{
9
+ controls: z.ZodOptional<z.ZodBoolean>;
10
+ levels: z.ZodOptional<z.ZodBoolean>;
11
+ header: z.ZodOptional<z.ZodBoolean>;
12
+ overlay: z.ZodOptional<z.ZodBoolean>;
13
+ searchButtons: z.ZodOptional<z.ZodBoolean>;
14
+ }, z.core.$strip>;
15
+ export interface Visibility extends z.infer<typeof VisibilitySchema> {
16
+ }
17
+ //# sourceMappingURL=visibility.d.ts.map
@@ -0,0 +1,23 @@
1
+ import * as z from 'zod';
2
+ /**
3
+ * A map-chrome visibility request — the argument of `FloorPlan.setVisibility`
4
+ * and the `setVisibility` intent. Every field is optional, but the semantics
5
+ * are rebuild-not-merge (the legacy `?hide=` contract): a field set to `false`
6
+ * hides its element, and every omitted field resets to visible.
7
+ */
8
+ export const VisibilitySchema = z.object({
9
+ /** The map controls (zoom buttons, …). */
10
+ controls: z.boolean().optional(),
11
+ /** The floor selector. */
12
+ levels: z.boolean().optional(),
13
+ /** The header bar — logos and the free/demo badge. */
14
+ header: z.boolean().optional(),
15
+ /** The overlay panel — search, lists, entity details. */
16
+ overlay: z.boolean().optional(),
17
+ /**
18
+ * The search-filter buttons row. Omitted, it follows `overlay`; an explicit
19
+ * `true` keeps the buttons while the overlay is hidden — clicking one opens
20
+ * the overlay on demand (`?visibility[overlay]=false&visibility[searchButtons]=true`).
21
+ */
22
+ searchButtons: z.boolean().optional(),
23
+ });
@@ -0,0 +1,104 @@
1
+ import * as z from 'zod';
2
+ /**
3
+ * Schema for the legacy `wf.data.js` wayfinding payload served next to
4
+ * `data.js`. Like `fp.svg.js` it is a `window`-assigning `.js` script,
5
+ * evaluated by `evalJsToJson` (`@expofp/utils`) and reached through a `.js`
6
+ * `$ref` by `resolve` (`@expofp/resolve`); the runtime consumes the graph in
7
+ * `wayfinding/adapters/graphDataSource.ts` (`lines` + `lineEnds`; `walls` has no
8
+ * consumer).
9
+ */
10
+ /** A wayfinding graph vertex. `layer` is omitted on some virtual endpoints. */
11
+ export declare const WfPointSchema: z.ZodObject<{
12
+ x: z.ZodNumber;
13
+ y: z.ZodNumber;
14
+ layer: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$loose>;
16
+ /**
17
+ * One wayfinding graph edge — the raw form of `GraphLine`
18
+ * (`wayfinding/core/types.ts`); omitted booleans read as `false` and an omitted
19
+ * `weight` as the default line weight.
20
+ */
21
+ export declare const WfLineSchema: z.ZodObject<{
22
+ p0: z.ZodObject<{
23
+ x: z.ZodNumber;
24
+ y: z.ZodNumber;
25
+ layer: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$loose>;
27
+ p1: z.ZodObject<{
28
+ x: z.ZodNumber;
29
+ y: z.ZodNumber;
30
+ layer: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$loose>;
32
+ weight: z.ZodOptional<z.ZodNumber>;
33
+ virtual: z.ZodOptional<z.ZodBoolean>;
34
+ unaccessible: z.ZodOptional<z.ZodBoolean>;
35
+ unidirection: z.ZodOptional<z.ZodBoolean>;
36
+ virtualLength: z.ZodOptional<z.ZodNumber>;
37
+ }, z.core.$loose>;
38
+ /** `__wfData`: the wayfinding graph. */
39
+ export declare const WfDataSchema: z.ZodObject<{
40
+ lines: z.ZodOptional<z.ZodArray<z.ZodObject<{
41
+ p0: z.ZodObject<{
42
+ x: z.ZodNumber;
43
+ y: z.ZodNumber;
44
+ layer: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$loose>;
46
+ p1: z.ZodObject<{
47
+ x: z.ZodNumber;
48
+ y: z.ZodNumber;
49
+ layer: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$loose>;
51
+ weight: z.ZodOptional<z.ZodNumber>;
52
+ virtual: z.ZodOptional<z.ZodBoolean>;
53
+ unaccessible: z.ZodOptional<z.ZodBoolean>;
54
+ unidirection: z.ZodOptional<z.ZodBoolean>;
55
+ virtualLength: z.ZodOptional<z.ZodNumber>;
56
+ }, z.core.$loose>>>;
57
+ lineEnds: z.ZodOptional<z.ZodArray<z.ZodObject<{
58
+ x: z.ZodNumber;
59
+ y: z.ZodNumber;
60
+ layer: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$loose>>>;
62
+ walls: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
63
+ }, z.core.$loose>;
64
+ /** The evaluated `wf.data.js` payload. */
65
+ export declare const WfDataJsSchema: z.ZodObject<{
66
+ __wfData: z.ZodOptional<z.ZodObject<{
67
+ lines: z.ZodOptional<z.ZodArray<z.ZodObject<{
68
+ p0: z.ZodObject<{
69
+ x: z.ZodNumber;
70
+ y: z.ZodNumber;
71
+ layer: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$loose>;
73
+ p1: z.ZodObject<{
74
+ x: z.ZodNumber;
75
+ y: z.ZodNumber;
76
+ layer: z.ZodOptional<z.ZodString>;
77
+ }, z.core.$loose>;
78
+ weight: z.ZodOptional<z.ZodNumber>;
79
+ virtual: z.ZodOptional<z.ZodBoolean>;
80
+ unaccessible: z.ZodOptional<z.ZodBoolean>;
81
+ unidirection: z.ZodOptional<z.ZodBoolean>;
82
+ virtualLength: z.ZodOptional<z.ZodNumber>;
83
+ }, z.core.$loose>>>;
84
+ lineEnds: z.ZodOptional<z.ZodArray<z.ZodObject<{
85
+ x: z.ZodNumber;
86
+ y: z.ZodNumber;
87
+ layer: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$loose>>>;
89
+ walls: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
90
+ }, z.core.$loose>>;
91
+ }, z.core.$loose>;
92
+ /**
93
+ * A `$ref` to the expo's `wf.data.js`. The graph is not loaded eagerly:
94
+ * `resolve()` evaluates the ref on demand into a {@link WfDataJsSchema} payload.
95
+ */
96
+ export declare const WfDataJsRefSchema: z.ZodObject<{
97
+ $ref: z.ZodString;
98
+ }, z.core.$strip>;
99
+ export type WfPoint = z.infer<typeof WfPointSchema>;
100
+ export type WfLine = z.infer<typeof WfLineSchema>;
101
+ export type WfData = z.infer<typeof WfDataSchema>;
102
+ export type WfDataJs = z.infer<typeof WfDataJsSchema>;
103
+ export type WfDataJsRef = z.infer<typeof WfDataJsRefSchema>;
104
+ //# sourceMappingURL=wayfinding.d.ts.map
@@ -0,0 +1,52 @@
1
+ import * as z from 'zod';
2
+ /**
3
+ * Schema for the legacy `wf.data.js` wayfinding payload served next to
4
+ * `data.js`. Like `fp.svg.js` it is a `window`-assigning `.js` script,
5
+ * evaluated by `evalJsToJson` (`@expofp/utils`) and reached through a `.js`
6
+ * `$ref` by `resolve` (`@expofp/resolve`); the runtime consumes the graph in
7
+ * `wayfinding/adapters/graphDataSource.ts` (`lines` + `lineEnds`; `walls` has no
8
+ * consumer).
9
+ */
10
+ /** A wayfinding graph vertex. `layer` is omitted on some virtual endpoints. */
11
+ export const WfPointSchema = z.looseObject({
12
+ x: z.number(),
13
+ y: z.number(),
14
+ layer: z.string().optional(),
15
+ });
16
+ /**
17
+ * One wayfinding graph edge — the raw form of `GraphLine`
18
+ * (`wayfinding/core/types.ts`); omitted booleans read as `false` and an omitted
19
+ * `weight` as the default line weight.
20
+ */
21
+ export const WfLineSchema = z.looseObject({
22
+ p0: WfPointSchema,
23
+ p1: WfPointSchema,
24
+ weight: z.number().optional(),
25
+ /** A virtual (floor-transition) link rather than a physical path segment. */
26
+ virtual: z.boolean().optional(),
27
+ /** Excluded when routing accessible-only. */
28
+ unaccessible: z.boolean().optional(),
29
+ /** One-way edge: no reverse link in oriented mode. */
30
+ unidirection: z.boolean().optional(),
31
+ /** Custom cost for virtual links ("Virtual length" in the designer). */
32
+ virtualLength: z.number().optional(),
33
+ });
34
+ /** `__wfData`: the wayfinding graph. */
35
+ export const WfDataSchema = z.looseObject({
36
+ lines: z.array(WfLineSchema).optional(),
37
+ lineEnds: z.array(WfPointSchema).optional(),
38
+ walls: z.array(z.unknown()).optional(),
39
+ });
40
+ /** The evaluated `wf.data.js` payload. */
41
+ export const WfDataJsSchema = z.looseObject({
42
+ __wfData: WfDataSchema.optional(),
43
+ });
44
+ /**
45
+ * A `$ref` to the expo's `wf.data.js`. The graph is not loaded eagerly:
46
+ * `resolve()` evaluates the ref on demand into a {@link WfDataJsSchema} payload.
47
+ */
48
+ export const WfDataJsRefSchema = z
49
+ .object({
50
+ $ref: z.string(),
51
+ })
52
+ .meta({ refSchema: WfDataJsSchema });
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@expofp/schema",
3
+ "version": "0.0.0-experimental.2d6c681",
4
+ "type": "module",
5
+ "description": "ExpoFP SDK internal: expo data schemas and types",
6
+ "homepage": "https://developer.expofp.com/",
7
+ "license": "MIT",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "main": "./dist/index.js",
12
+ "module": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ "./package.json": "./package.json",
16
+ ".": {
17
+ "@expofp/source": "./src/index.ts",
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "default": "./dist/index.js"
21
+ }
22
+ },
23
+ "dependencies": {
24
+ "tslib": "^2.3.0",
25
+ "zod": "4.4.3"
26
+ },
27
+ "devDependencies": {
28
+ "@expofp/utils": "0.0.0-experimental.2d6c681"
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "!**/*.tsbuildinfo",
33
+ "!**/*.map"
34
+ ]
35
+ }