@minmaps-dev/mm-web-sdk 1.0.0-rc.44 → 1.0.0-rc.45

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { Map, IControl, ControlPosition, StyleSpecification } from 'maplibre-gl';
1
+ import { Map, StyleSpecification, IControl, ControlPosition } from 'maplibre-gl';
2
2
 
3
3
  /**
4
4
  * Represents a floor in a building
@@ -637,7 +637,10 @@ type SDKConfig = {
637
637
  deviceId?: string | number;
638
638
  };
639
639
  jacs: {
640
- mode: 'proxy' | 'direct';
640
+ /** `snapshot` reads published venue snapshots from a CDN — what clients
641
+ * should use. `proxy`/`direct` read live JACS (the draft): local dev and
642
+ * CMS preview. */
643
+ mode: 'proxy' | 'direct' | 'snapshot';
641
644
  host?: string;
642
645
  auth?: {
643
646
  clientId: string;
@@ -645,6 +648,7 @@ type SDKConfig = {
645
648
  password: string;
646
649
  };
647
650
  proxyBaseUrl?: string;
651
+ baseUrl?: string;
648
652
  };
649
653
  options?: SDKOptions;
650
654
  };
@@ -1083,6 +1087,321 @@ declare function parseOpenHours(raw: unknown): OpenHours | null;
1083
1087
  */
1084
1088
  declare function getOpenStatus(hours: OpenHours, now?: Date, options?: OpenStatusOptions): OpenStatus;
1085
1089
 
1090
+ type JacsProviderConfig = {
1091
+ mode: 'proxy';
1092
+ proxyBaseUrl?: string;
1093
+ fetchImpl?: typeof fetch;
1094
+ } | {
1095
+ mode: 'direct';
1096
+ host: string;
1097
+ clientId: string;
1098
+ username: string;
1099
+ password: string;
1100
+ fetchImpl?: typeof fetch;
1101
+ };
1102
+ type GetBuildingsArgs = {
1103
+ customerId: number | string;
1104
+ venueId: number | string;
1105
+ };
1106
+ type GetFloorsArgs = {
1107
+ customerId: number | string;
1108
+ venueId: number | string;
1109
+ buildingId: number | string;
1110
+ /** BCP-47 code (`es`, `en-US`). When set, JACS resolves floor `name` /
1111
+ * `description` to that locale instead of the customer's default. */
1112
+ locale?: string;
1113
+ };
1114
+ type GetDestinationsArgs = {
1115
+ customerId: number | string;
1116
+ venueId: number | string;
1117
+ /** See {@link GetFloorsArgs.locale}. */
1118
+ locale?: string;
1119
+ };
1120
+ type GetAmenitiesArgs = {
1121
+ customerId: number | string;
1122
+ /** See {@link GetFloorsArgs.locale}. */
1123
+ locale?: string;
1124
+ };
1125
+ type GetZonesArgs = {
1126
+ customerId: number | string;
1127
+ venueId: number | string;
1128
+ /** See {@link GetFloorsArgs.locale}. */
1129
+ locale?: string;
1130
+ };
1131
+ type GetMapLabelsArgs = {
1132
+ customerId: number | string;
1133
+ venueId: number | string;
1134
+ /** See {@link GetFloorsArgs.locale}. */
1135
+ locale?: string;
1136
+ };
1137
+ type GetVenueArgs = {
1138
+ customerId: number | string;
1139
+ venueId: number | string;
1140
+ };
1141
+ type JacsVenue = Record<string, any>;
1142
+ type GetBuildingFullArgs = {
1143
+ customerId: number | string;
1144
+ venueId: number | string;
1145
+ buildingId: number | string;
1146
+ mapProfile?: string;
1147
+ geojson?: boolean;
1148
+ };
1149
+ type JacsBuildingFull = Record<string, any>;
1150
+ type JacsVenueAll = Record<string, any>;
1151
+ type GetStylesheet3dArgs = {
1152
+ customerId: number | string;
1153
+ venueId: number | string;
1154
+ buildingId: number | string;
1155
+ };
1156
+ type GetFloorMapGeoJsonArgs = {
1157
+ customerId: number | string;
1158
+ venueId: number | string;
1159
+ buildingId: number | string;
1160
+ floorId: number | string;
1161
+ };
1162
+ type GetPolygonLayersArgs = {
1163
+ customerId: number | string;
1164
+ };
1165
+ type GetFloorMapTemplate3dArgs = {
1166
+ customerId: number | string;
1167
+ venueId: number | string;
1168
+ buildingId: number | string;
1169
+ floorId: number | string;
1170
+ };
1171
+ type JacsBuilding = {
1172
+ id?: number | string;
1173
+ buildingId?: number | string;
1174
+ name?: string;
1175
+ isDefault?: boolean;
1176
+ default?: boolean;
1177
+ [key: string]: any;
1178
+ };
1179
+ type JacsFloor = Record<string, any>;
1180
+ type JacsDestination = Record<string, any>;
1181
+ type JacsAmenity = Record<string, any>;
1182
+ type JacsZone = Record<string, any>;
1183
+ type JacsMapLabel = Record<string, any>;
1184
+ type JacsPolygonLayer = Record<string, any>;
1185
+ /**
1186
+ * This matches the “map-template/3d” shape you pasted earlier:
1187
+ * rows keyed by layerName with paint-ish properties like fill, line-color, etc.
1188
+ */
1189
+ type JacsMapTemplate3dRow = {
1190
+ layerName: string;
1191
+ fill?: string | null;
1192
+ 'fill-opacity'?: number | null;
1193
+ fillAntialias?: boolean | null;
1194
+ 'fill-pattern'?: string | null;
1195
+ 'line-color'?: string | null;
1196
+ 'line-width'?: number | null;
1197
+ lineOpacity?: number | null;
1198
+ strokeWidth?: number | null;
1199
+ strokeOpacity?: number | null;
1200
+ 'fill-extrusion-color'?: string | null;
1201
+ 'fill-extrusion-height'?: number | null;
1202
+ 'fill-extrusion-opacity'?: number | null;
1203
+ 'fill-extrusion-base'?: number | null;
1204
+ 'fill-extrusion-pattern'?: string | null;
1205
+ [key: string]: any;
1206
+ };
1207
+ declare class JacsProvider {
1208
+ private mode;
1209
+ private proxyBaseUrl;
1210
+ private direct;
1211
+ private fetchImpl;
1212
+ private tokenCache;
1213
+ constructor(config: JacsProviderConfig);
1214
+ /** `/customer/all` — every customer with its venues, for a venue picker. Each
1215
+ * entry is `{ customer, venues[] }`. Not venue-scoped. */
1216
+ getCustomersAll(): Promise<Record<string, any>[]>;
1217
+ getPolygonLayers(args: GetPolygonLayersArgs): Promise<JacsPolygonLayer[]>;
1218
+ getFloorMapTemplate3d(args: GetFloorMapTemplate3dArgs): Promise<JacsMapTemplate3dRow[]>;
1219
+ getFloors(args: GetFloorsArgs): Promise<JacsFloor[]>;
1220
+ /**
1221
+ * Hits the JEM venue full-call aggregator at /customer/{cid}/venue/{vid}/all.
1222
+ * Unlike /building/{bid}/full this endpoint does NOT go through Redis — JACS
1223
+ * assembles the response server-side from many controllers on every call, so
1224
+ * SDK consumers always see fresh data regardless of cache invalidation state.
1225
+ *
1226
+ * Response shape: { customer, venue, buildings: [{ floors }], waypoints[],
1227
+ * destinations[], amenities[], paths[], mapLabels[], devices[], zones[],
1228
+ * pathTypes[], mapProfiles[] }. Floor geojson is NOT included — the SDK
1229
+ * lazy-loads it via ensureFloorGeojson.
1230
+ */
1231
+ getVenueAll(args: GetVenueArgs): Promise<JacsVenueAll>;
1232
+ getVenue(args: GetVenueArgs): Promise<JacsVenue>;
1233
+ getFloorMapGeojson(args: GetFloorMapGeoJsonArgs): Promise<GeoJSON.FeatureCollection>;
1234
+ getBuildingFull(args: GetBuildingFullArgs): Promise<JacsBuildingFull>;
1235
+ getDestinations(args: GetDestinationsArgs): Promise<JacsDestination[]>;
1236
+ /** Zones (department groupings). `name` / `description` are localized. */
1237
+ getZones(args: GetZonesArgs): Promise<JacsZone[]>;
1238
+ /**
1239
+ * CMS-authored map labels (street / area / wing names). The endpoint is
1240
+ * `/label`, not `/map-label` — the latter 404s. The localized `name` is on
1241
+ * the label template; each `instances[]` placement carries its own internal
1242
+ * `name` ("Parking Lot E - Instance 1") which is authoring metadata and is
1243
+ * never displayed.
1244
+ */
1245
+ getMapLabels(args: GetMapLabelsArgs): Promise<JacsMapLabel[]>;
1246
+ /**
1247
+ * Amenities are **customer-scoped**, not venue-scoped. A
1248
+ * `/customer/{id}/venue/{id}/amenity` path also exists and returns the same
1249
+ * records, but it silently ignores `?locale=` — it answers with the base
1250
+ * (en-US) names for every locale, which reads as "translations aren't
1251
+ * working" rather than as a wrong URL. Only `/customer/{id}/amenity`
1252
+ * resolves the locale. Don't reintroduce the venue segment.
1253
+ */
1254
+ getAmenities(args: GetAmenitiesArgs): Promise<JacsAmenity[]>;
1255
+ getBuildings(args: GetBuildingsArgs): Promise<JacsBuilding[]>;
1256
+ getStylesheet3d(args: GetStylesheet3dArgs): Promise<StyleSpecification>;
1257
+ invalidateToken(): void;
1258
+ getJson<T>(path: string): Promise<T>;
1259
+ private extractArray;
1260
+ private getJwtToken;
1261
+ private normalizeHost;
1262
+ private joinUrl;
1263
+ private safeReadText;
1264
+ }
1265
+
1266
+ /** The JacsProvider methods the SDK's data layer reads. Both JacsProvider (live
1267
+ * JACS) and SnapshotProvider (published snapshots) implement them. */
1268
+ type JacsReader = Pick<JacsProvider, 'getVenueAll' | 'getFloorMapGeojson' | 'getDestinations' | 'getFloors' | 'getZones' | 'getMapLabels' | 'getAmenities' | 'getPolygonLayers' | 'getCustomersAll'>;
1269
+ type SnapshotProviderConfig = {
1270
+ /** Root of the snapshot host, e.g. `https://snapshots.example.com`. */
1271
+ baseUrl: string;
1272
+ fetchImpl?: typeof fetch;
1273
+ };
1274
+ /**
1275
+ * The venue (or its customer) can't be shown from snapshots: it was never
1276
+ * published, or it was withdrawn (unpublished, disabled or deleted). Thrown
1277
+ * from `init()`; check `reason` to show "not published" vs "no longer
1278
+ * available".
1279
+ */
1280
+ declare class SnapshotUnavailableError extends Error {
1281
+ readonly reason: 'not-published' | 'withdrawn';
1282
+ readonly customerId: string;
1283
+ readonly venueId: string | null;
1284
+ constructor(reason: 'not-published' | 'withdrawn', customerId: string, venueId: string | null);
1285
+ }
1286
+ /** The customer and venue snapshot versions a load is using. */
1287
+ type SnapshotVersions = {
1288
+ customer: number;
1289
+ venue: number;
1290
+ };
1291
+ /**
1292
+ * Result of `checkForUpdate`: whether what's published now differs from what
1293
+ * this instance loaded.
1294
+ *
1295
+ * - `current` — nothing newer is published.
1296
+ * - `available` — a newer customer or venue version is published; reload to
1297
+ * show it.
1298
+ * - `unavailable` — the venue (or its customer) has since been withdrawn or
1299
+ * was never published; a reload would fail with `SnapshotUnavailableError`.
1300
+ * - `incompatible` — a newer version is published in a schema this SDK can't
1301
+ * read; don't reload until the SDK is updated.
1302
+ */
1303
+ type SnapshotUpdateCheck = {
1304
+ status: 'current';
1305
+ loaded: SnapshotVersions;
1306
+ } | {
1307
+ status: 'available';
1308
+ loaded: SnapshotVersions;
1309
+ latest: SnapshotVersions;
1310
+ } | {
1311
+ status: 'unavailable';
1312
+ loaded: SnapshotVersions;
1313
+ reason: 'not-published' | 'withdrawn';
1314
+ } | {
1315
+ status: 'incompatible';
1316
+ loaded: SnapshotVersions;
1317
+ schemaVersion: number;
1318
+ };
1319
+ /**
1320
+ * Picks the locale folder to read. Exact (case-insensitive) match first, then a
1321
+ * same-language match (`es` → `es-US`), then `fallback` — so a locale the
1322
+ * customer added after this venue was last published falls back to the default
1323
+ * language until the venue is republished.
1324
+ */
1325
+ declare function resolveSnapshotLocale(requested: string | undefined, available: string[], fallback: string): string;
1326
+ declare class SnapshotProvider implements JacsReader {
1327
+ private baseUrl;
1328
+ private fetchImpl;
1329
+ private snapshots;
1330
+ private files;
1331
+ constructor(config: SnapshotProviderConfig);
1332
+ /** `directory.json` — published, public customers with their venues, in
1333
+ * `/customer/all`'s `{ customer, venues[] }` shape. */
1334
+ getCustomersAll(): Promise<Record<string, any>[]>;
1335
+ /** venue.json with the customer-wide pieces put back where `/all` has them. */
1336
+ getVenueAll(args: {
1337
+ customerId: number | string;
1338
+ venueId: number | string;
1339
+ }): Promise<JacsVenueAll>;
1340
+ getFloorMapGeojson(args: {
1341
+ customerId: number | string;
1342
+ venueId: number | string;
1343
+ floorId: number | string;
1344
+ }): Promise<GeoJSON.FeatureCollection>;
1345
+ getDestinations(args: {
1346
+ customerId: number | string;
1347
+ venueId: number | string;
1348
+ locale?: string;
1349
+ }): Promise<JacsDestination[]>;
1350
+ /** The snapshot holds the first building's floors only — the one the SDK reads. */
1351
+ getFloors(args: {
1352
+ customerId: number | string;
1353
+ venueId: number | string;
1354
+ locale?: string;
1355
+ }): Promise<JacsFloor[]>;
1356
+ getZones(args: {
1357
+ customerId: number | string;
1358
+ venueId: number | string;
1359
+ locale?: string;
1360
+ }): Promise<JacsZone[]>;
1361
+ getMapLabels(args: {
1362
+ customerId: number | string;
1363
+ venueId: number | string;
1364
+ locale?: string;
1365
+ }): Promise<JacsMapLabel[]>;
1366
+ getAmenities(args: {
1367
+ customerId: number | string;
1368
+ locale?: string;
1369
+ }): Promise<JacsAmenity[]>;
1370
+ getPolygonLayers(args: {
1371
+ customerId: number | string;
1372
+ }): Promise<JacsPolygonLayer[]>;
1373
+ /** The manifest versions this instance is reading, once loaded. */
1374
+ getVersions(customerId: number | string, venueId: number | string): Promise<{
1375
+ customer: number;
1376
+ venue: number;
1377
+ }>;
1378
+ /**
1379
+ * Re-reads both manifests (without changing what this instance reads) and
1380
+ * compares them with the versions it loaded. Rejects when a manifest can't
1381
+ * be fetched — a network failure says nothing about what's published, so
1382
+ * try again later.
1383
+ */
1384
+ checkForUpdate(customerId: number | string, venueId: number | string): Promise<SnapshotUpdateCheck>;
1385
+ private venueLocalized;
1386
+ private customerRef;
1387
+ private venueRef;
1388
+ /**
1389
+ * Runs `read` against the pinned snapshots. The publisher keeps old versions
1390
+ * for a while, but a long-running client (a kiosk) can outlive one: if a
1391
+ * pinned version's file is gone, re-read that manifest and retry once on the
1392
+ * current version. Data already loaded from the old version stays as it was;
1393
+ * files fetched from now on come from the new one.
1394
+ */
1395
+ private pinned;
1396
+ /** The current manifest, read once per instance: a loaded venue keeps
1397
+ * reading the version it started with (see `pinned` for when it can't). */
1398
+ private snapshot;
1399
+ /** Versioned files are immutable, so one fetch per file per instance. */
1400
+ private file;
1401
+ private list;
1402
+ private fetchJson;
1403
+ }
1404
+
1086
1405
  declare class MinuteMaps {
1087
1406
  private config;
1088
1407
  private map;
@@ -1153,6 +1472,10 @@ declare class MinuteMaps {
1153
1472
  * `setLocale()` can rebuild + re-emit `routeReady` with retranslated
1154
1473
  * step text without recomputing the path. Cleared on route failure. */
1155
1474
  private lastRouteDestinationPoi;
1475
+ /** Waypoint ids (stringified) of the connector(s) the active transition
1476
+ * step rides — empty unless `setActiveStep` is on a transition. Drives
1477
+ * `applyRouteConnectorHighlight`. */
1478
+ private activeTransitionWaypointIds;
1156
1479
  private amenityManager;
1157
1480
  private wayfinding;
1158
1481
  private highlightManager;
@@ -1415,6 +1738,18 @@ declare class MinuteMaps {
1415
1738
  * repeatedly; the fetch for a given code happens once.
1416
1739
  */
1417
1740
  prefetchLocale(locale: string): Promise<void>;
1741
+ /**
1742
+ * Whether newer data has been published since this venue loaded, for
1743
+ * long-running displays (kiosks) that should pick up a publish. Snapshot
1744
+ * mode only: it re-reads the venue's and customer's manifests and compares
1745
+ * them with the versions in use; `{ status: 'unsupported' }` in live
1746
+ * (`proxy`/`direct`) modes. A loaded venue never switches versions by
1747
+ * itself — on `available`, reload (ideally while nobody is using the
1748
+ * screen). Rejects when the manifests can't be fetched; try again later.
1749
+ */
1750
+ checkForUpdate(): Promise<SnapshotUpdateCheck | {
1751
+ status: 'unsupported';
1752
+ }>;
1418
1753
  /** Currently active locale (BCP-47), or `undefined` when no locale has
1419
1754
  * been set — meaning JACS resolves names to the customer's default. */
1420
1755
  getActiveLocale(): string | undefined;
@@ -1732,9 +2067,10 @@ declare class MinuteMaps {
1732
2067
  * theme's `route-line-active` layer paints it in gold over the
1733
2068
  * muted base route.
1734
2069
  *
1735
- * Transition steps (cross-floor elevator / stair hops) clear the
1736
- * highlight — the overlay text carries the action, and there's no
1737
- * meaningful on-floor segment to paint.
2070
+ * Transition steps (cross-floor elevator / stair hops) clear the line
2071
+ * highlight — there's no meaningful on-floor segment to paint — and
2072
+ * instead swap the connector(s) the step rides to their highlighted
2073
+ * sprite badge (`CONNECTOR_HIGHLIGHTED_ICON_SUFFIX`).
1738
2074
  *
1739
2075
  * Pass `null` to clear the highlight without changing the floor or
1740
2076
  * tearing down the route.
@@ -1742,6 +2078,17 @@ declare class MinuteMaps {
1742
2078
  setActiveStep(step: WayfindStep | null): Promise<void>;
1743
2079
  private writeActiveStepHighlight;
1744
2080
  private clearActiveStepHighlight;
2081
+ /**
2082
+ * Point `ROUTE_CONNECTOR_LAYER_ID`'s `icon-image` at the highlighted badge
2083
+ * for the connector(s) the active transition step rides, and back at the
2084
+ * plain `iconId` otherwise. Imperative like the layer's filter, so it's
2085
+ * re-run from `updateRouteFloorFilter` after a theme swap drops it.
2086
+ *
2087
+ * `coalesce` over `image` falls back to the plain badge when the sprite has
2088
+ * no `-highlighted` copy of an id (a custom CMS connector icon, or a sprite
2089
+ * that predates the variant) rather than drawing nothing.
2090
+ */
2091
+ private applyRouteConnectorHighlight;
1745
2092
  clearRoute(): void;
1746
2093
  /**
1747
2094
  * Put the end-of-route marker on `poi`, or take it down (`null`). With
@@ -2109,182 +2456,12 @@ declare class MinuteMaps {
2109
2456
  }
2110
2457
  declare function createMinuteMapsSDK(config: SDKConfig): MinuteMaps;
2111
2458
 
2112
- type JacsProviderConfig = {
2113
- mode: 'proxy';
2114
- proxyBaseUrl?: string;
2115
- fetchImpl?: typeof fetch;
2116
- } | {
2117
- mode: 'direct';
2118
- host: string;
2119
- clientId: string;
2120
- username: string;
2121
- password: string;
2122
- fetchImpl?: typeof fetch;
2123
- };
2124
- type GetBuildingsArgs = {
2125
- customerId: number | string;
2126
- venueId: number | string;
2127
- };
2128
- type GetFloorsArgs = {
2129
- customerId: number | string;
2130
- venueId: number | string;
2131
- buildingId: number | string;
2132
- /** BCP-47 code (`es`, `en-US`). When set, JACS resolves floor `name` /
2133
- * `description` to that locale instead of the customer's default. */
2134
- locale?: string;
2135
- };
2136
- type GetDestinationsArgs = {
2137
- customerId: number | string;
2138
- venueId: number | string;
2139
- /** See {@link GetFloorsArgs.locale}. */
2140
- locale?: string;
2141
- };
2142
- type GetAmenitiesArgs = {
2143
- customerId: number | string;
2144
- /** See {@link GetFloorsArgs.locale}. */
2145
- locale?: string;
2146
- };
2147
- type GetZonesArgs = {
2148
- customerId: number | string;
2149
- venueId: number | string;
2150
- /** See {@link GetFloorsArgs.locale}. */
2151
- locale?: string;
2152
- };
2153
- type GetMapLabelsArgs = {
2154
- customerId: number | string;
2155
- venueId: number | string;
2156
- /** See {@link GetFloorsArgs.locale}. */
2157
- locale?: string;
2158
- };
2159
- type GetVenueArgs = {
2160
- customerId: number | string;
2161
- venueId: number | string;
2162
- };
2163
- type JacsVenue = Record<string, any>;
2164
- type GetBuildingFullArgs = {
2165
- customerId: number | string;
2166
- venueId: number | string;
2167
- buildingId: number | string;
2168
- mapProfile?: string;
2169
- geojson?: boolean;
2170
- };
2171
- type JacsBuildingFull = Record<string, any>;
2172
- type JacsVenueAll = Record<string, any>;
2173
- type GetStylesheet3dArgs = {
2174
- customerId: number | string;
2175
- venueId: number | string;
2176
- buildingId: number | string;
2177
- };
2178
- type GetFloorMapGeoJsonArgs = {
2179
- customerId: number | string;
2180
- venueId: number | string;
2181
- buildingId: number | string;
2182
- floorId: number | string;
2183
- };
2184
- type GetPolygonLayersArgs = {
2185
- customerId: number | string;
2186
- };
2187
- type GetFloorMapTemplate3dArgs = {
2188
- customerId: number | string;
2189
- venueId: number | string;
2190
- buildingId: number | string;
2191
- floorId: number | string;
2192
- };
2193
- type JacsBuilding = {
2194
- id?: number | string;
2195
- buildingId?: number | string;
2196
- name?: string;
2197
- isDefault?: boolean;
2198
- default?: boolean;
2199
- [key: string]: any;
2200
- };
2201
- type JacsFloor = Record<string, any>;
2202
- type JacsDestination = Record<string, any>;
2203
- type JacsAmenity = Record<string, any>;
2204
- type JacsZone = Record<string, any>;
2205
- type JacsMapLabel = Record<string, any>;
2206
- type JacsPolygonLayer = Record<string, any>;
2207
- /**
2208
- * This matches the “map-template/3d” shape you pasted earlier:
2209
- * rows keyed by layerName with paint-ish properties like fill, line-color, etc.
2210
- */
2211
- type JacsMapTemplate3dRow = {
2212
- layerName: string;
2213
- fill?: string | null;
2214
- 'fill-opacity'?: number | null;
2215
- fillAntialias?: boolean | null;
2216
- 'fill-pattern'?: string | null;
2217
- 'line-color'?: string | null;
2218
- 'line-width'?: number | null;
2219
- lineOpacity?: number | null;
2220
- strokeWidth?: number | null;
2221
- strokeOpacity?: number | null;
2222
- 'fill-extrusion-color'?: string | null;
2223
- 'fill-extrusion-height'?: number | null;
2224
- 'fill-extrusion-opacity'?: number | null;
2225
- 'fill-extrusion-base'?: number | null;
2226
- 'fill-extrusion-pattern'?: string | null;
2227
- [key: string]: any;
2228
- };
2229
- declare class JacsProvider {
2230
- private mode;
2231
- private proxyBaseUrl;
2232
- private direct;
2233
- private fetchImpl;
2234
- private tokenCache;
2235
- constructor(config: JacsProviderConfig);
2236
- /** `/customer/all` — every customer with its venues, for a venue picker. Each
2237
- * entry is `{ customer, venues[] }`. Not venue-scoped. */
2238
- getCustomersAll(): Promise<Record<string, any>[]>;
2239
- getPolygonLayers(args: GetPolygonLayersArgs): Promise<JacsPolygonLayer[]>;
2240
- getFloorMapTemplate3d(args: GetFloorMapTemplate3dArgs): Promise<JacsMapTemplate3dRow[]>;
2241
- getFloors(args: GetFloorsArgs): Promise<JacsFloor[]>;
2242
- /**
2243
- * Hits the JEM venue full-call aggregator at /customer/{cid}/venue/{vid}/all.
2244
- * Unlike /building/{bid}/full this endpoint does NOT go through Redis — JACS
2245
- * assembles the response server-side from many controllers on every call, so
2246
- * SDK consumers always see fresh data regardless of cache invalidation state.
2247
- *
2248
- * Response shape: { customer, venue, buildings: [{ floors }], waypoints[],
2249
- * destinations[], amenities[], paths[], mapLabels[], devices[], zones[],
2250
- * pathTypes[], mapProfiles[] }. Floor geojson is NOT included — the SDK
2251
- * lazy-loads it via ensureFloorGeojson.
2252
- */
2253
- getVenueAll(args: GetVenueArgs): Promise<JacsVenueAll>;
2254
- getVenue(args: GetVenueArgs): Promise<JacsVenue>;
2255
- getFloorMapGeojson(args: GetFloorMapGeoJsonArgs): Promise<GeoJSON.FeatureCollection>;
2256
- getBuildingFull(args: GetBuildingFullArgs): Promise<JacsBuildingFull>;
2257
- getDestinations(args: GetDestinationsArgs): Promise<JacsDestination[]>;
2258
- /** Zones (department groupings). `name` / `description` are localized. */
2259
- getZones(args: GetZonesArgs): Promise<JacsZone[]>;
2260
- /**
2261
- * CMS-authored map labels (street / area / wing names). The endpoint is
2262
- * `/label`, not `/map-label` — the latter 404s. The localized `name` is on
2263
- * the label template; each `instances[]` placement carries its own internal
2264
- * `name` ("Parking Lot E - Instance 1") which is authoring metadata and is
2265
- * never displayed.
2266
- */
2267
- getMapLabels(args: GetMapLabelsArgs): Promise<JacsMapLabel[]>;
2268
- /**
2269
- * Amenities are **customer-scoped**, not venue-scoped. A
2270
- * `/customer/{id}/venue/{id}/amenity` path also exists and returns the same
2271
- * records, but it silently ignores `?locale=` — it answers with the base
2272
- * (en-US) names for every locale, which reads as "translations aren't
2273
- * working" rather than as a wrong URL. Only `/customer/{id}/amenity`
2274
- * resolves the locale. Don't reintroduce the venue segment.
2275
- */
2276
- getAmenities(args: GetAmenitiesArgs): Promise<JacsAmenity[]>;
2277
- getBuildings(args: GetBuildingsArgs): Promise<JacsBuilding[]>;
2278
- getStylesheet3d(args: GetStylesheet3dArgs): Promise<StyleSpecification>;
2279
- invalidateToken(): void;
2280
- getJson<T>(path: string): Promise<T>;
2281
- private extractArray;
2282
- private getJwtToken;
2283
- private normalizeHost;
2284
- private joinUrl;
2285
- private safeReadText;
2286
- }
2287
-
2459
+ /** Where a `VenueDirectory` reads from: live JACS (`proxy`/`direct`, which
2460
+ * reads `/customer/all`) or published snapshots (`snapshot`, which reads
2461
+ * `directory.json` — published venues only). */
2462
+ type VenueDirectoryConfig = JacsProviderConfig | ({
2463
+ mode: 'snapshot';
2464
+ } & SnapshotProviderConfig);
2288
2465
  /** The slice of `/customer/all`'s `customer` object a client acts on. Audit
2289
2466
  * fields, quotas and SSO config are dropped on purpose. */
2290
2467
  type Customer = {
@@ -2347,11 +2524,12 @@ declare function customerDisplayName(customer: Customer): string;
2347
2524
  * "select your hospital" screen. Unlike the `MinuteMaps` class this isn't
2348
2525
  * bound to a venue: it runs *before* one is chosen.
2349
2526
  *
2350
- * Accepts either JACS config (proxy or direct) or an existing `JacsProvider`.
2527
+ * Accepts JACS config (proxy or direct), snapshot config, or an existing
2528
+ * `JacsProvider` / `SnapshotProvider`.
2351
2529
  */
2352
2530
  declare class VenueDirectory {
2353
2531
  private jacs;
2354
- constructor(config: JacsProviderConfig | JacsProvider);
2532
+ constructor(config: VenueDirectoryConfig | JacsReader);
2355
2533
  /** `/customer/all`, optionally narrowed to one `tenantId`. */
2356
2534
  listCustomerVenues(options?: ListCustomerVenuesOptions): Promise<CustomerVenues[]>;
2357
2535
  }
@@ -2464,5 +2642,5 @@ type ResolvedIconSource = {
2464
2642
  */
2465
2643
  declare function resolveAmenityIconSource(amenity: AmenityLike, preferredLocale?: string): ResolvedIconSource | null;
2466
2644
 
2467
- export { BUILDING_NAME_EXTENSOR_KEY, DAY_KEYS, IMAGE_ALT_EXTENSOR_KEY, MinuteMaps, OPEN_HOURS_EXTENSOR_KEY, OPEN_HOURS_VERSION, PHONE_EXTENSOR_KEY, POINT_OF_INTEREST_EXTENSOR_KEY, RESERVED_EXTENSOR_PREFIX, VenueDirectory, activeSectionIndex, createMinuteMapsSDK, customerDisplayName, getOpenStatus, groupStepsIntoFloorSections, isConnectorAmenity, parseBuildingName, parseImageAlt, parseOpenHours, parsePhone, parsePointOfInterest, resolveAmenityIconSource };
2468
- export type { Amenity, AmenityBadgeStyle, AmenityWithFloor, Bounds, BoundsPadding, CameraState, Customer, CustomerVenues, DayKey, Destination, DestinationPhone, EventCallback, Floor, FloorMetadata, HoursRange, JMapAuth, JMapConfig, JacsAuth, JacsConfig, JacsProviderConfig, ListCustomerVenuesOptions, MapEvent, OpenHours, OpenHoursTransition, OpenStatus, OpenStatusOptions, POI, POISearchResult, ResolvedIconSource, RouteFloorSection, RoutePoint, RoutingOptions, SDKConfig, SDKOptions, ThemeName, TransitionStep, VenueSummary, ViewOptions, WayfindCenterMode, WayfindStep, Waypoint, Zone };
2645
+ export { BUILDING_NAME_EXTENSOR_KEY, DAY_KEYS, IMAGE_ALT_EXTENSOR_KEY, MinuteMaps, OPEN_HOURS_EXTENSOR_KEY, OPEN_HOURS_VERSION, PHONE_EXTENSOR_KEY, POINT_OF_INTEREST_EXTENSOR_KEY, RESERVED_EXTENSOR_PREFIX, SnapshotProvider, SnapshotUnavailableError, VenueDirectory, activeSectionIndex, createMinuteMapsSDK, customerDisplayName, getOpenStatus, groupStepsIntoFloorSections, isConnectorAmenity, parseBuildingName, parseImageAlt, parseOpenHours, parsePhone, parsePointOfInterest, resolveAmenityIconSource, resolveSnapshotLocale };
2646
+ export type { Amenity, AmenityBadgeStyle, AmenityWithFloor, Bounds, BoundsPadding, CameraState, Customer, CustomerVenues, DayKey, Destination, DestinationPhone, EventCallback, Floor, FloorMetadata, HoursRange, JMapAuth, JMapConfig, JacsAuth, JacsConfig, JacsProviderConfig, JacsReader, ListCustomerVenuesOptions, MapEvent, OpenHours, OpenHoursTransition, OpenStatus, OpenStatusOptions, POI, POISearchResult, ResolvedIconSource, RouteFloorSection, RoutePoint, RoutingOptions, SDKConfig, SDKOptions, SnapshotProviderConfig, SnapshotUpdateCheck, SnapshotVersions, ThemeName, TransitionStep, VenueDirectoryConfig, VenueSummary, ViewOptions, WayfindCenterMode, WayfindStep, Waypoint, Zone };