@minmaps-dev/mm-web-sdk 1.0.0-rc.42 → 1.0.0-rc.43

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
@@ -499,6 +499,13 @@ interface SDKOptions {
499
499
  * max-bounds clamping.
500
500
  */
501
501
  maxBounds?: Bounds | number | false;
502
+ /**
503
+ * Whether the venue's kiosk anchors a "You are here" marker, and the opening
504
+ * view / default route origin. Defaults to `true`. Set `false` for non-kiosk
505
+ * consumers (e.g. a browser map): no device is resolved, even via the
506
+ * "first placed device" fallback, so the marker is never drawn.
507
+ */
508
+ kiosk?: boolean;
502
509
  /**
503
510
  * Pitch (deg) for the opening view, applied centred on the kiosk ("You
504
511
  * are here"). Omit for top-down.
@@ -1633,6 +1640,15 @@ declare class MinuteMaps {
1633
1640
  animate?: boolean;
1634
1641
  duration?: number;
1635
1642
  }): void;
1643
+ /**
1644
+ * Find the POI placed on a given waypoint, searching every floor. A
1645
+ * waypoint is a single placement, so this resolves the exact amenity
1646
+ * instance or destination a kiosk routed to — unlike an amenity id, which
1647
+ * is shared by all of its instances. The kiosk's own "You are here" POI is
1648
+ * skipped. Returns `null` when nothing is placed on that waypoint (stale id,
1649
+ * or a floor whose geometry hasn't loaded).
1650
+ */
1651
+ getPOIByWaypointId(waypointId: string | number): POI | null;
1636
1652
  searchPOIs(query: string, floor?: Floor): POI[];
1637
1653
  /**
1638
1654
  * Search POIs across every floor in the venue. Returns raw matches —
@@ -1659,6 +1675,35 @@ declare class MinuteMaps {
1659
1675
  navigateFromKioskToPOI(poi: POI, options?: {
1660
1676
  avoidStairs?: boolean;
1661
1677
  }): Promise<any>;
1678
+ /**
1679
+ * Route between two arbitrary POIs — the browser/mobile counterpart of
1680
+ * `navigateFromKioskToPOI`, for visitors who aren't standing at a kiosk
1681
+ * and pick their own starting point. Same events (`routeReady` /
1682
+ * `routeFailed`) and the same `centerMode: 'route'` framing. Switches to
1683
+ * the origin's floor first, because the route starts there.
1684
+ *
1685
+ * Emits `routeFailed` with `origin_unavailable` / `destination_unavailable`
1686
+ * when either POI has no waypoint, `no_route` when no path connects them.
1687
+ */
1688
+ navigateBetweenPOIs(from: POI, to: POI, options?: {
1689
+ avoidStairs?: boolean;
1690
+ }): Promise<any>;
1691
+ /**
1692
+ * Distance + walking time between two arbitrary POIs over the path graph —
1693
+ * `getWalkTimeFromKiosk` with a caller-chosen origin. `null` when either POI
1694
+ * has no waypoint on the graph or no path resolves.
1695
+ */
1696
+ getWalkTimeBetween(from: POI, target: Parameters<MinuteMaps['getWalkTimeFromKiosk']>[0], opts?: {
1697
+ walkingSpeedFps?: number;
1698
+ avoidStairs?: boolean;
1699
+ }): {
1700
+ feet: number;
1701
+ seconds: number;
1702
+ effortSeconds: number;
1703
+ pathNodeCount: number;
1704
+ } | null;
1705
+ /** Shared tail of the route entry points: path, camera fit, steps, events. */
1706
+ private routeToPoi;
1662
1707
  /** Build the landmark / floor-name context the directions module needs.
1663
1708
  * Pulled out so `setLocale()` or `setActiveStep()` can rebuild it on
1664
1709
  * demand if we ever surface a locale-aware variant. */
@@ -2061,6 +2106,253 @@ declare class MinuteMaps {
2061
2106
  }
2062
2107
  declare function createMinuteMapsSDK(config: SDKConfig): MinuteMaps;
2063
2108
 
2109
+ type JacsProviderConfig = {
2110
+ mode: 'proxy';
2111
+ proxyBaseUrl?: string;
2112
+ fetchImpl?: typeof fetch;
2113
+ } | {
2114
+ mode: 'direct';
2115
+ host: string;
2116
+ clientId: string;
2117
+ username: string;
2118
+ password: string;
2119
+ fetchImpl?: typeof fetch;
2120
+ };
2121
+ type GetBuildingsArgs = {
2122
+ customerId: number | string;
2123
+ venueId: number | string;
2124
+ };
2125
+ type GetFloorsArgs = {
2126
+ customerId: number | string;
2127
+ venueId: number | string;
2128
+ buildingId: number | string;
2129
+ /** BCP-47 code (`es`, `en-US`). When set, JACS resolves floor `name` /
2130
+ * `description` to that locale instead of the customer's default. */
2131
+ locale?: string;
2132
+ };
2133
+ type GetDestinationsArgs = {
2134
+ customerId: number | string;
2135
+ venueId: number | string;
2136
+ /** See {@link GetFloorsArgs.locale}. */
2137
+ locale?: string;
2138
+ };
2139
+ type GetAmenitiesArgs = {
2140
+ customerId: number | string;
2141
+ /** See {@link GetFloorsArgs.locale}. */
2142
+ locale?: string;
2143
+ };
2144
+ type GetZonesArgs = {
2145
+ customerId: number | string;
2146
+ venueId: number | string;
2147
+ /** See {@link GetFloorsArgs.locale}. */
2148
+ locale?: string;
2149
+ };
2150
+ type GetMapLabelsArgs = {
2151
+ customerId: number | string;
2152
+ venueId: number | string;
2153
+ /** See {@link GetFloorsArgs.locale}. */
2154
+ locale?: string;
2155
+ };
2156
+ type GetVenueArgs = {
2157
+ customerId: number | string;
2158
+ venueId: number | string;
2159
+ };
2160
+ type JacsVenue = Record<string, any>;
2161
+ type GetBuildingFullArgs = {
2162
+ customerId: number | string;
2163
+ venueId: number | string;
2164
+ buildingId: number | string;
2165
+ mapProfile?: string;
2166
+ geojson?: boolean;
2167
+ };
2168
+ type JacsBuildingFull = Record<string, any>;
2169
+ type JacsVenueAll = Record<string, any>;
2170
+ type GetStylesheet3dArgs = {
2171
+ customerId: number | string;
2172
+ venueId: number | string;
2173
+ buildingId: number | string;
2174
+ };
2175
+ type GetFloorMapGeoJsonArgs = {
2176
+ customerId: number | string;
2177
+ venueId: number | string;
2178
+ buildingId: number | string;
2179
+ floorId: number | string;
2180
+ };
2181
+ type GetPolygonLayersArgs = {
2182
+ customerId: number | string;
2183
+ };
2184
+ type GetFloorMapTemplate3dArgs = {
2185
+ customerId: number | string;
2186
+ venueId: number | string;
2187
+ buildingId: number | string;
2188
+ floorId: number | string;
2189
+ };
2190
+ type JacsBuilding = {
2191
+ id?: number | string;
2192
+ buildingId?: number | string;
2193
+ name?: string;
2194
+ isDefault?: boolean;
2195
+ default?: boolean;
2196
+ [key: string]: any;
2197
+ };
2198
+ type JacsFloor = Record<string, any>;
2199
+ type JacsDestination = Record<string, any>;
2200
+ type JacsAmenity = Record<string, any>;
2201
+ type JacsZone = Record<string, any>;
2202
+ type JacsMapLabel = Record<string, any>;
2203
+ type JacsPolygonLayer = Record<string, any>;
2204
+ /**
2205
+ * This matches the “map-template/3d” shape you pasted earlier:
2206
+ * rows keyed by layerName with paint-ish properties like fill, line-color, etc.
2207
+ */
2208
+ type JacsMapTemplate3dRow = {
2209
+ layerName: string;
2210
+ fill?: string | null;
2211
+ 'fill-opacity'?: number | null;
2212
+ fillAntialias?: boolean | null;
2213
+ 'fill-pattern'?: string | null;
2214
+ 'line-color'?: string | null;
2215
+ 'line-width'?: number | null;
2216
+ lineOpacity?: number | null;
2217
+ strokeWidth?: number | null;
2218
+ strokeOpacity?: number | null;
2219
+ 'fill-extrusion-color'?: string | null;
2220
+ 'fill-extrusion-height'?: number | null;
2221
+ 'fill-extrusion-opacity'?: number | null;
2222
+ 'fill-extrusion-base'?: number | null;
2223
+ 'fill-extrusion-pattern'?: string | null;
2224
+ [key: string]: any;
2225
+ };
2226
+ declare class JacsProvider {
2227
+ private mode;
2228
+ private proxyBaseUrl;
2229
+ private direct;
2230
+ private fetchImpl;
2231
+ private tokenCache;
2232
+ constructor(config: JacsProviderConfig);
2233
+ /** `/customer/all` — every customer with its venues, for a venue picker. Each
2234
+ * entry is `{ customer, venues[] }`. Not venue-scoped. */
2235
+ getCustomersAll(): Promise<Record<string, any>[]>;
2236
+ getPolygonLayers(args: GetPolygonLayersArgs): Promise<JacsPolygonLayer[]>;
2237
+ getFloorMapTemplate3d(args: GetFloorMapTemplate3dArgs): Promise<JacsMapTemplate3dRow[]>;
2238
+ getFloors(args: GetFloorsArgs): Promise<JacsFloor[]>;
2239
+ /**
2240
+ * Hits the JEM venue full-call aggregator at /customer/{cid}/venue/{vid}/all.
2241
+ * Unlike /building/{bid}/full this endpoint does NOT go through Redis — JACS
2242
+ * assembles the response server-side from many controllers on every call, so
2243
+ * SDK consumers always see fresh data regardless of cache invalidation state.
2244
+ *
2245
+ * Response shape: { customer, venue, buildings: [{ floors }], waypoints[],
2246
+ * destinations[], amenities[], paths[], mapLabels[], devices[], zones[],
2247
+ * pathTypes[], mapProfiles[] }. Floor geojson is NOT included — the SDK
2248
+ * lazy-loads it via ensureFloorGeojson.
2249
+ */
2250
+ getVenueAll(args: GetVenueArgs): Promise<JacsVenueAll>;
2251
+ getVenue(args: GetVenueArgs): Promise<JacsVenue>;
2252
+ getFloorMapGeojson(args: GetFloorMapGeoJsonArgs): Promise<GeoJSON.FeatureCollection>;
2253
+ getBuildingFull(args: GetBuildingFullArgs): Promise<JacsBuildingFull>;
2254
+ getDestinations(args: GetDestinationsArgs): Promise<JacsDestination[]>;
2255
+ /** Zones (department groupings). `name` / `description` are localized. */
2256
+ getZones(args: GetZonesArgs): Promise<JacsZone[]>;
2257
+ /**
2258
+ * CMS-authored map labels (street / area / wing names). The endpoint is
2259
+ * `/label`, not `/map-label` — the latter 404s. The localized `name` is on
2260
+ * the label template; each `instances[]` placement carries its own internal
2261
+ * `name` ("Parking Lot E - Instance 1") which is authoring metadata and is
2262
+ * never displayed.
2263
+ */
2264
+ getMapLabels(args: GetMapLabelsArgs): Promise<JacsMapLabel[]>;
2265
+ /**
2266
+ * Amenities are **customer-scoped**, not venue-scoped. A
2267
+ * `/customer/{id}/venue/{id}/amenity` path also exists and returns the same
2268
+ * records, but it silently ignores `?locale=` — it answers with the base
2269
+ * (en-US) names for every locale, which reads as "translations aren't
2270
+ * working" rather than as a wrong URL. Only `/customer/{id}/amenity`
2271
+ * resolves the locale. Don't reintroduce the venue segment.
2272
+ */
2273
+ getAmenities(args: GetAmenitiesArgs): Promise<JacsAmenity[]>;
2274
+ getBuildings(args: GetBuildingsArgs): Promise<JacsBuilding[]>;
2275
+ getStylesheet3d(args: GetStylesheet3dArgs): Promise<StyleSpecification>;
2276
+ invalidateToken(): void;
2277
+ getJson<T>(path: string): Promise<T>;
2278
+ private extractArray;
2279
+ private getJwtToken;
2280
+ private normalizeHost;
2281
+ private joinUrl;
2282
+ private safeReadText;
2283
+ }
2284
+
2285
+ /** The slice of `/customer/all`'s `customer` object a client acts on. Audit
2286
+ * fields, quotas and SSO config are dropped on purpose. */
2287
+ type Customer = {
2288
+ id: number | string;
2289
+ name: string;
2290
+ /** `null` when JACS has no localized name; use {@link customerDisplayName}. */
2291
+ localizedName: string | null;
2292
+ /** Environment/partition the customer lives in; test customers carry a
2293
+ * different one, which is what the `tenantId` filter keys on. */
2294
+ tenantId: number | null;
2295
+ uuid: string | null;
2296
+ /** BCP-47 code of `defaultLocale.locale`. */
2297
+ defaultLocale: string | null;
2298
+ };
2299
+ /** A venue as listed under a customer — a summary, not the loaded venue model. */
2300
+ type VenueSummary = {
2301
+ id: number | string;
2302
+ customerId: number | string;
2303
+ name: string;
2304
+ /** South-west corner (`bottomLng`, `bottomLat`); `null` if JACS omitted coordinates. */
2305
+ southWest: [number, number] | null;
2306
+ /** North-east corner (`topLng`, `topLat`). */
2307
+ northEast: [number, number] | null;
2308
+ /** JACS's `status` flag. Not filtered here — a picker decides whether to hide
2309
+ * `false` (unpublished) venues. */
2310
+ status: boolean;
2311
+ locked: boolean;
2312
+ uuid: string | null;
2313
+ /** JACS's `externalId`; `null` when the venue has none. */
2314
+ externalId: string | null;
2315
+ /** JACS `extensors` — free-form per-venue key/values (`GO_LIVE`, `MOBILE_APP`,
2316
+ * `KIOSK_LOCATIONS`, analytics ids, …). Values are the raw strings JACS sends
2317
+ * (`KIOSK_LOCATIONS` is a JSON-encoded string); non-scalar values are dropped. */
2318
+ extensors: Record<string, string>;
2319
+ /** UUID of the venue's default map template; `null` when not set. */
2320
+ defaultMapTemplateId: string | null;
2321
+ /** JACS `labelType` enum value; `null` if omitted. */
2322
+ labelType: number | null;
2323
+ /** Whether the venue's map uses marker clustering. */
2324
+ clustering: boolean;
2325
+ /** Whether JACS publishes the venue's edits automatically. */
2326
+ autoPublish: boolean;
2327
+ };
2328
+ /** One entry of `/customer/all`: a customer and the venues it owns. Hand a
2329
+ * venue's `customerId` and `id` to the SDK's `jacs`/`venue` config to load it. */
2330
+ type CustomerVenues = {
2331
+ customer: Customer;
2332
+ venues: VenueSummary[];
2333
+ };
2334
+ type ListCustomerVenuesOptions = {
2335
+ /** Keep only customers with this `tenantId`, so test customers living in
2336
+ * other tenants are left out. A customer with no `tenantId` never matches.
2337
+ * Omit to return every customer the proxy exposes. */
2338
+ tenantId?: number;
2339
+ };
2340
+ /** `customer.localizedName` when non-blank, else `customer.name`. */
2341
+ declare function customerDisplayName(customer: Customer): string;
2342
+ /**
2343
+ * Lists the customers and venues a user can pick from — the data behind a
2344
+ * "select your hospital" screen. Unlike the `MinuteMaps` class this isn't
2345
+ * bound to a venue: it runs *before* one is chosen.
2346
+ *
2347
+ * Accepts either JACS config (proxy or direct) or an existing `JacsProvider`.
2348
+ */
2349
+ declare class VenueDirectory {
2350
+ private jacs;
2351
+ constructor(config: JacsProviderConfig | JacsProvider);
2352
+ /** `/customer/all`, optionally narrowed to one `tenantId`. */
2353
+ listCustomerVenues(options?: ListCustomerVenuesOptions): Promise<CustomerVenues[]>;
2354
+ }
2355
+
2064
2356
  type TransitionStep = Extract<WayfindStep, {
2065
2357
  type: 'transition';
2066
2358
  }>;
@@ -2169,5 +2461,5 @@ type ResolvedIconSource = {
2169
2461
  */
2170
2462
  declare function resolveAmenityIconSource(amenity: AmenityLike, preferredLocale?: string): ResolvedIconSource | null;
2171
2463
 
2172
- 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, activeSectionIndex, createMinuteMapsSDK, getOpenStatus, groupStepsIntoFloorSections, isConnectorAmenity, parseBuildingName, parseImageAlt, parseOpenHours, parsePhone, parsePointOfInterest, resolveAmenityIconSource };
2173
- export type { Amenity, AmenityBadgeStyle, AmenityWithFloor, Bounds, BoundsPadding, CameraState, DayKey, Destination, DestinationPhone, EventCallback, Floor, FloorMetadata, HoursRange, JMapAuth, JMapConfig, JacsAuth, JacsConfig, MapEvent, OpenHours, OpenHoursTransition, OpenStatus, OpenStatusOptions, POI, POISearchResult, ResolvedIconSource, RouteFloorSection, RoutePoint, RoutingOptions, SDKConfig, SDKOptions, ThemeName, TransitionStep, ViewOptions, WayfindCenterMode, WayfindStep, Waypoint, Zone };
2464
+ 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 };
2465
+ 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 };