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

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,37 @@ 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
+ * `originPoi` is the start a visitor picked (`navigateBetweenPOIs`), which
1707
+ * gets a start pin; a kiosk route passes none — "You are here" marks it. */
1708
+ private routeToPoi;
1662
1709
  /** Build the landmark / floor-name context the directions module needs.
1663
1710
  * Pulled out so `setLocale()` or `setActiveStep()` can rebuild it on
1664
1711
  * demand if we ever surface a locale-aware variant. */
@@ -1697,7 +1744,8 @@ declare class MinuteMaps {
1697
1744
  private clearActiveStepHighlight;
1698
1745
  clearRoute(): void;
1699
1746
  /**
1700
- * Put the end-of-route marker on `poi`, or take it down (`null`).
1747
+ * Put the end-of-route marker on `poi`, or take it down (`null`). With
1748
+ * `start`, the route's start also gets the sprite's `marker-start` pin.
1701
1749
  *
1702
1750
  * A destination gets a flag in place of its dot; an amenity instance gets an
1703
1751
  * enlarged copy of its own icon (`map/routeEnd.ts`). Both are drawn from a
@@ -2061,6 +2109,253 @@ declare class MinuteMaps {
2061
2109
  }
2062
2110
  declare function createMinuteMapsSDK(config: SDKConfig): MinuteMaps;
2063
2111
 
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
+
2288
+ /** The slice of `/customer/all`'s `customer` object a client acts on. Audit
2289
+ * fields, quotas and SSO config are dropped on purpose. */
2290
+ type Customer = {
2291
+ id: number | string;
2292
+ name: string;
2293
+ /** `null` when JACS has no localized name; use {@link customerDisplayName}. */
2294
+ localizedName: string | null;
2295
+ /** Environment/partition the customer lives in; test customers carry a
2296
+ * different one, which is what the `tenantId` filter keys on. */
2297
+ tenantId: number | null;
2298
+ uuid: string | null;
2299
+ /** BCP-47 code of `defaultLocale.locale`. */
2300
+ defaultLocale: string | null;
2301
+ };
2302
+ /** A venue as listed under a customer — a summary, not the loaded venue model. */
2303
+ type VenueSummary = {
2304
+ id: number | string;
2305
+ customerId: number | string;
2306
+ name: string;
2307
+ /** South-west corner (`bottomLng`, `bottomLat`); `null` if JACS omitted coordinates. */
2308
+ southWest: [number, number] | null;
2309
+ /** North-east corner (`topLng`, `topLat`). */
2310
+ northEast: [number, number] | null;
2311
+ /** JACS's `status` flag. Not filtered here — a picker decides whether to hide
2312
+ * `false` (unpublished) venues. */
2313
+ status: boolean;
2314
+ locked: boolean;
2315
+ uuid: string | null;
2316
+ /** JACS's `externalId`; `null` when the venue has none. */
2317
+ externalId: string | null;
2318
+ /** JACS `extensors` — free-form per-venue key/values (`GO_LIVE`, `MOBILE_APP`,
2319
+ * `KIOSK_LOCATIONS`, analytics ids, …). Values are the raw strings JACS sends
2320
+ * (`KIOSK_LOCATIONS` is a JSON-encoded string); non-scalar values are dropped. */
2321
+ extensors: Record<string, string>;
2322
+ /** UUID of the venue's default map template; `null` when not set. */
2323
+ defaultMapTemplateId: string | null;
2324
+ /** JACS `labelType` enum value; `null` if omitted. */
2325
+ labelType: number | null;
2326
+ /** Whether the venue's map uses marker clustering. */
2327
+ clustering: boolean;
2328
+ /** Whether JACS publishes the venue's edits automatically. */
2329
+ autoPublish: boolean;
2330
+ };
2331
+ /** One entry of `/customer/all`: a customer and the venues it owns. Hand a
2332
+ * venue's `customerId` and `id` to the SDK's `jacs`/`venue` config to load it. */
2333
+ type CustomerVenues = {
2334
+ customer: Customer;
2335
+ venues: VenueSummary[];
2336
+ };
2337
+ type ListCustomerVenuesOptions = {
2338
+ /** Keep only customers with this `tenantId`, so test customers living in
2339
+ * other tenants are left out. A customer with no `tenantId` never matches.
2340
+ * Omit to return every customer the proxy exposes. */
2341
+ tenantId?: number;
2342
+ };
2343
+ /** `customer.localizedName` when non-blank, else `customer.name`. */
2344
+ declare function customerDisplayName(customer: Customer): string;
2345
+ /**
2346
+ * Lists the customers and venues a user can pick from — the data behind a
2347
+ * "select your hospital" screen. Unlike the `MinuteMaps` class this isn't
2348
+ * bound to a venue: it runs *before* one is chosen.
2349
+ *
2350
+ * Accepts either JACS config (proxy or direct) or an existing `JacsProvider`.
2351
+ */
2352
+ declare class VenueDirectory {
2353
+ private jacs;
2354
+ constructor(config: JacsProviderConfig | JacsProvider);
2355
+ /** `/customer/all`, optionally narrowed to one `tenantId`. */
2356
+ listCustomerVenues(options?: ListCustomerVenuesOptions): Promise<CustomerVenues[]>;
2357
+ }
2358
+
2064
2359
  type TransitionStep = Extract<WayfindStep, {
2065
2360
  type: 'transition';
2066
2361
  }>;
@@ -2169,5 +2464,5 @@ type ResolvedIconSource = {
2169
2464
  */
2170
2465
  declare function resolveAmenityIconSource(amenity: AmenityLike, preferredLocale?: string): ResolvedIconSource | null;
2171
2466
 
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 };
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 };