@minmaps-dev/mm-web-sdk 1.0.0-rc.5 → 1.0.0-rc.50

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/jacs.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";function e(e){return e?`?locale=${encodeURIComponent(e)}`:""}!function(e){const t=Boolean(e?.enabled),n=function(e){const t=String(e).trim();return t?`[${t}]`:""}(e?.prefix)}({enabled:!0,prefix:"MinuteMapsSDK"});class t extends Error{reason;customerId;venueId;constructor(e,t,n){super(`${null===n?`Customer ${t}`:`Venue ${n} (customer ${t})`} is ${"withdrawn"===e?"no longer available":"not published"}`),this.reason=e,this.customerId=t,this.venueId=n,this.name="SnapshotUnavailableError"}}class n extends Error{folder;constructor(e,t){super(`Snapshot GET ${t} failed (404): version ${e} is no longer published`),this.folder=e,this.name="VersionGoneError"}}const o=e=>encodeURIComponent(String(e));function s(e,t,n){if(!e)return n;const o=e.toLowerCase(),s=t.find(e=>e.toLowerCase()===o);if(s)return s;const r=o.split("-")[0];return t.find(e=>e.toLowerCase().split("-")[0]===r)??n}exports.JacsProvider=class{mode;proxyBaseUrl;direct;fetchImpl;tokenCache=null;constructor(e){const t="undefined"!=typeof window?window:globalThis,n=e.fetchImpl??t.fetch;if("function"!=typeof n)throw new Error("Fetch API is not available in this environment");this.fetchImpl=n.bind(t),this.mode=e.mode,this.proxyBaseUrl=("proxy"===e.mode?e.proxyBaseUrl:void 0)||"/api/jacs","direct"===e.mode?this.direct={host:this.normalizeHost(e.host),clientId:e.clientId,username:e.username,password:e.password}:this.direct=null}async getCustomersAll(){const e=await this.getJson("/customer/all");return this.extractArray(e)}async getPolygonLayers(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/polygon-layer`,n=await this.getJson(t);return this.extractArray(n)}async getFloorMapTemplate3d(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building/${encodeURIComponent(String(e.buildingId))}/floor/${encodeURIComponent(String(e.floorId))}/map-template/3d`,n=await this.getJson(t);return this.extractArray(n)}async getFloors(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/venue/${encodeURIComponent(String(t.venueId))}/building/${encodeURIComponent(String(t.buildingId))}/floor`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getVenueAll(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/all`,n=await this.getJson(t),o=n?.data||n?.result||n;if(!o||"object"!=typeof o)throw new Error("JACS venue/all response was not a JSON object");return o}async getVenue(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}`,n=await this.getJson(t),o=n?.venue||n?.data||n;if(!o||"object"!=typeof o)throw new Error("JACS venue response was not a JSON object");return o}async getFloorMapGeojson(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building/${encodeURIComponent(String(e.buildingId))}/floor/${encodeURIComponent(String(e.floorId))}/map/geojson?layers=Back-of-house%2CBackground%2CBoundary%2CCorridor%2C%20Corridors%2CCustomArtLayer-1%2CCustomArtLayer-2%2CCustomArtLayer-3%2CCustomArtLayer-4%2CCustomArtLayer-5%2CCustomArtLayer-6%2CCustomArtLayer-7%2CElevators%2CEscalators%2CInterior-ParkingLots%2CKiosks%2CLBox%2CMall-Boundary%2CMedians%2CObstacles%2CParking-Equipment%2CParking-Lots%2CParking-Obstacles%2CParking-Space%2CParking-Text%2CParking-Zones%2CPattern-1%2CPattern-2%2CPattern-3%2CPattern-Grass%2CPattern-Indoor-FoodCourt-Seating%2CPattern-Lounge%2CPattern-OutdoorTerrace%2CPattern-Pavement%2CPattern-Trees%2CPattern-Water%2CRamp-Markings%2CRamps%2CRestrooms%2CStairs%2CStreets-Major%2CStreets-Minor%2CStreets-SmallAlleys%2CUnits%2CXMLID%20`,n=await this.getJson(t),o=n?.geojson||n?.data||n;if(!o||"FeatureCollection"!==o.type||!Array.isArray(o.features))throw new Error("JACS floor geojson did not look like a GeoJSON FeatureCollection");return o}async getBuildingFull(e){const t=new URLSearchParams;t.set("mapProfile",String(e.mapProfile??"public")),t.set("geojson",String(e.geojson??!0));const n=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building/${encodeURIComponent(String(e.buildingId))}/full?${t.toString()}`,o=await this.getJson(n),s=o?.data||o?.result||o;if(!s||"object"!=typeof s)throw new Error("JACS building full response was not a JSON object");return s}async getDestinations(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/venue/${encodeURIComponent(String(t.venueId))}/destination`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getZones(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/venue/${encodeURIComponent(String(t.venueId))}/zone`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getMapLabels(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/venue/${encodeURIComponent(String(t.venueId))}/label`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getAmenities(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/amenity`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getBuildings(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building`,n=await this.getJson(t);return this.extractArray(n)}async getStylesheet3d(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building/${encodeURIComponent(String(e.buildingId))}/stylesheet/3d`,n=await this.getJson(t),o=n?.style||n?.data||n;if(!o||"object"!=typeof o)throw new Error("JACS stylesheet response was not a JSON object");return o}invalidateToken(){this.tokenCache=null}async getJson(e){if("proxy"===this.mode){const t=this.proxyBaseUrl.replace(/\/+$/,""),n=e.startsWith("/")?e:`/${e}`,o=await this.fetchImpl(`${t}${n}`,{method:"GET",headers:{Accept:"application/json"}});if(!o.ok){const e=await this.safeReadText(o);throw new Error(`JACS proxy GET failed (${o.status} ${o.statusText}) :: ${e}`)}return await o.json()}const t=this.direct;if(!t)throw new Error("JacsProvider is not configured for direct mode");const n=await this.getJwtToken(),o=this.joinUrl(t.host,e),s=await this.fetchImpl(o,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}});if(!s.ok){const e=await this.safeReadText(s);throw new Error(`JACS GET failed (${s.status} ${s.statusText}) :: ${e}`)}return await s.json()}extractArray(e){return(Array.isArray(e)?e:null)||(Array.isArray(e?.data)?e.data:null)||(Array.isArray(e?.items)?e.items:null)||(Array.isArray(e?.results)?e.results:null)||[]}async getJwtToken(){const e=this.direct;if(!e)throw new Error("getJwtToken should not be called in proxy mode");const t=Date.now(),n=this.tokenCache;if(n?.token&&t<n.expiresAtMs-3e4)return n.token;const o=this.joinUrl(e.host,"/auth/token"),s=new URLSearchParams;s.set("grant_type","password"),s.set("client_id",e.clientId),s.set("username",e.username),s.set("password",e.password);const r=await this.fetchImpl(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:s.toString()});if(!r.ok){const e=await this.safeReadText(r);throw new Error(`JACS auth failed (${r.status} ${r.statusText}) :: ${e}`)}const a=await r.json(),i=a?.access_token||a?.token||a?.jwt||a?.accessToken;if(!i)throw new Error("JACS auth response did not contain a token");const c=a?.expires_in??a?.expiresIn??a?.expires??a?.ttl,l="number"==typeof c?c:Number(c),u=Number.isFinite(l)&&l>0?l:600;return this.tokenCache={token:i,expiresAtMs:Date.now()+1e3*u},i}normalizeHost(e){return String(e||"").replace(/\/+$/,"")}joinUrl(e,t){const n=this.normalizeHost(e),o=String(t||"");return o?`${n}${o.startsWith("/")?"":"/"}${o}`:n}async safeReadText(e){try{return await e.text()}catch{return""}}},exports.SnapshotProvider=class{baseUrl;fetchImpl;snapshots=new Map;files=new Map;constructor(e){if(!e.baseUrl)throw new Error("SnapshotProvider needs a baseUrl");const t="undefined"!=typeof window?window:globalThis,n=e.fetchImpl??t.fetch;if("function"!=typeof n)throw new Error("Fetch API is not available in this environment");this.fetchImpl=n.bind(t),this.baseUrl=e.baseUrl.replace(/\/+$/,"")}async getCustomersAll(){const e=await this.fetchJson("directory.json");return Array.isArray(e?.customers)?e.customers:[]}async getVenueAll(e){return this.pinned([this.venueRef(e.customerId,e.venueId),this.customerRef(e.customerId)],async([e,t])=>{const[n,o]=await Promise.all([this.file(e,"venue.json"),this.file(t,"customer.json")]);return{...n,customer:o?.customer??null,pathTypes:Array.isArray(o?.pathTypes)?o.pathTypes:[],mapProfiles:[]}})}async getFloorMapGeojson(e){const t=`floors/${e.floorId}.geojson`;return this.pinned([this.venueRef(e.customerId,e.venueId)],async([n])=>{if(!n.manifest.files.includes(t))throw new Error(`Snapshot has no geojson for floor ${e.floorId} (404)`);const o=await this.file(n,t);if(!o||"FeatureCollection"!==o.type||!Array.isArray(o.features))throw new Error("Snapshot floor geojson did not look like a GeoJSON FeatureCollection");return o})}async getDestinations(e){return this.venueLocalized(e,"destinations.json")}async getFloors(e){return this.venueLocalized(e,"floors.json")}async getZones(e){return this.venueLocalized(e,"zones.json")}async getMapLabels(e){return this.venueLocalized(e,"labels.json")}async getAmenities(e){return this.pinned([this.customerRef(e.customerId)],([t])=>{const n=s(e.locale,t.manifest.locales,t.manifest.defaultLocale);return this.list(t,`${n}/amenities.json`)})}async getPolygonLayers(e){return this.pinned([this.customerRef(e.customerId)],([e])=>this.list(e,"polygon-layers.json"))}async getVersions(e,t){const[n,o]=await Promise.all([this.snapshot(this.customerRef(e)),this.snapshot(this.venueRef(e,t))]);return{customer:n.manifest.version,venue:o.manifest.version}}async checkForUpdate(e,t){const n=await this.getVersions(e,t),[o,s]=await Promise.all([this.fetchJson(`${this.customerRef(e).prefix}manifest.json`,{notFound:null}),this.fetchJson(`${this.venueRef(e,t).prefix}manifest.json`,{notFound:null})]),r=[o,s];if(r.some(e=>null===e))return{status:"unavailable",loaded:n,reason:"not-published"};if(r.some(e=>"withdrawn"===e.state))return{status:"unavailable",loaded:n,reason:"withdrawn"};const a=r.find(e=>"number"!=typeof e.schemaVersion||e.schemaVersion>1);if(a)return{status:"incompatible",loaded:n,schemaVersion:a.schemaVersion};const i={customer:o.version,venue:s.version};return i.customer!==n.customer||i.venue!==n.venue?{status:"available",loaded:n,latest:i}:{status:"current",loaded:n}}async venueLocalized(e,t){return this.pinned([this.venueRef(e.customerId,e.venueId),this.customerRef(e.customerId)],([n,o])=>{const r=n.manifest.locales.filter(e=>o.manifest.locales.includes(e)),a=s(e.locale,r,n.manifest.defaultLocale);return this.list(n,`${a}/${t}`)})}customerRef(e){return{prefix:`c/${o(e)}/`,customerId:String(e),venueId:null}}venueRef(e,t){return{prefix:`c/${o(e)}/v/${o(t)}/`,customerId:String(e),venueId:String(t)}}async pinned(e,t){const o=e.map(e=>this.snapshot(e)),s=await Promise.all(o);try{return await t(s)}catch(r){if(!(r instanceof n))throw r;e.forEach((e,t)=>{s[t].folder===r.folder&&this.snapshots.get(e.prefix)===o[t]&&this.snapshots.delete(e.prefix)});const a=await Promise.all(e.map(e=>this.snapshot(e)));if(a.every((e,t)=>e.folder===s[t].folder))throw r;return t(a)}}snapshot({prefix:e,customerId:n,venueId:o}){let s=this.snapshots.get(e);return s||(s=(async()=>{const s=await this.fetchJson(`${e}manifest.json`,{notFound:null});if(null===s)throw new t("not-published",n,o);if("withdrawn"===s.state)throw new t("withdrawn",n,o);if("number"!=typeof s.schemaVersion||s.schemaVersion>1)throw new Error(`Snapshot ${e} has schema version ${s.schemaVersion}; this SDK reads up to 1. Update the SDK.`);return{folder:`${e}${s.version}/`,manifest:s}})(),this.snapshots.set(e,s),s.catch(()=>this.snapshots.delete(e))),s}file(e,t){const o=e.folder+t;let s=this.files.get(o);return s||(s=this.fetchJson(o,{notFound:null}).then(t=>{if(null===t)throw new n(e.folder,o);return t}),this.files.set(o,s),s.catch(()=>this.files.delete(o))),s}async list(e,t){const n=await this.file(e,t);return Array.isArray(n)?n:[]}async fetchJson(e,t={}){const n=await this.fetchImpl(`${this.baseUrl}/${e}`,{headers:{Accept:"application/json"}});if(404===n.status&&"notFound"in t)return t.notFound;if(!n.ok)throw new Error(`Snapshot GET ${e} failed (${n.status} ${n.statusText})`);return n.json()}},exports.SnapshotUnavailableError=t,exports.resolveSnapshotLocale=s;
2
+ //# sourceMappingURL=jacs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jacs.cjs","sources":["../src/data/jacsProvider.ts","../src/logger.ts","../src/data/snapshotProvider.ts"],"sourcesContent":[null,null,null],"names":["localeQuery","locale","encodeURIComponent","opts","enabled","Boolean","prefix","p","String","trim","fmtPrefix","createLogger","SnapshotUnavailableError","Error","reason","customerId","venueId","constructor","super","this","name","VersionGoneError","folder","path","id","v","resolveSnapshotLocale","requested","available","fallback","want","toLowerCase","exact","find","l","language","split","mode","proxyBaseUrl","direct","fetchImpl","tokenCache","config","scope","window","globalThis","rawFetch","fetch","bind","undefined","host","normalizeHost","clientId","username","password","getCustomersAll","json","getJson","extractArray","getPolygonLayers","args","getFloorMapTemplate3d","buildingId","floorId","getFloors","getVenueAll","data","result","getVenue","venue","getFloorMapGeojson","fc","geojson","type","Array","isArray","features","getBuildingFull","query","URLSearchParams","set","mapProfile","toString","full","getDestinations","getZones","getMapLabels","getAmenities","getBuildings","getStylesheet3d","style","invalidateToken","base","replace","startsWith","res","method","headers","Accept","ok","body","safeReadText","status","statusText","token","getJwtToken","url","joinUrl","Authorization","items","results","now","Date","cached","expiresAtMs","tokenUrl","formBody","access_token","jwt","accessToken","expiresInSecRaw","expires_in","expiresIn","expires","ttl","expiresInSec","Number","ttlSec","isFinite","b","text","baseUrl","snapshots","Map","files","directory","fetchJson","customers","pinned","venueRef","customerRef","async","customer","venueJson","customerJson","Promise","all","file","pathTypes","mapProfiles","manifest","includes","venueLocalized","locales","defaultLocale","list","getVersions","snapshot","version","checkForUpdate","loaded","notFound","manifests","some","m","state","unreadable","schemaVersion","latest","shared","filter","refs","read","pending","map","ref","e","forEach","i","get","delete","current","every","s","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nI,KAAKiH,UAAUpD,IAAI1E,EAAQuK,GAC3BA,EAAQW,MAAM,IAAMrK,KAAKiH,UAAUgD,OAAO9K,KAErCuK,CACT,CAGQ,IAAA1B,CAAKU,EAAoBzI,GAC/B,MAAMG,EAAOsI,EAASvI,OAASF,EAC/B,IAAIyJ,EAAU1J,KAAKmH,MAAM6C,IAAI5J,GAS7B,OARKsJ,IACHA,EAAU1J,KAAKqH,UAAUjH,EAAM,CAAE0I,SAAU,OAAQwB,KAAMjI,IACvD,GAAa,OAATA,EAAe,MAAM,IAAInC,EAAiBwI,EAASvI,OAAQC,GAC/D,OAAOiC,IAETrC,KAAKmH,MAAMtD,IAAIzD,EAAMsJ,GACrBA,EAAQW,MAAM,IAAMrK,KAAKmH,MAAM8C,OAAO7J,KAEjCsJ,CACT,CAEQ,UAAMlB,CAAKE,EAAoBzI,GACrC,MAAMoC,QAAarC,KAAKgI,KAAKU,EAAUzI,GACvC,OAAOsD,MAAMC,QAAQnB,GAAQA,EAAO,EACtC,CAEQ,eAAMgF,CAAUjH,EAAcmK,EAA+B,IACnE,MAAM3F,QAAY5E,KAAKqB,UAAU,GAAGrB,KAAKgH,WAAW5G,IAAQ,CAAE0E,QAAS,CAAEC,OAAQ,sBACjF,GAAmB,MAAfH,EAAIO,QAAkB,aAAcoF,EAAS,OAAOA,EAAQzB,SAChE,IAAKlE,EAAII,GAAI,MAAM,IAAItF,MAAM,gBAAgBU,aAAgBwE,EAAIO,UAAUP,EAAIQ,eAC/E,OAAOR,EAAIvC,MACb"}
package/dist/jacs.d.ts ADDED
@@ -0,0 +1,319 @@
1
+ import { StyleSpecification } from 'maplibre-gl';
2
+
3
+ type JacsProviderConfig = {
4
+ mode: 'proxy';
5
+ proxyBaseUrl?: string;
6
+ fetchImpl?: typeof fetch;
7
+ } | {
8
+ mode: 'direct';
9
+ host: string;
10
+ clientId: string;
11
+ username: string;
12
+ password: string;
13
+ fetchImpl?: typeof fetch;
14
+ };
15
+ type GetBuildingsArgs = {
16
+ customerId: number | string;
17
+ venueId: number | string;
18
+ };
19
+ type GetFloorsArgs = {
20
+ customerId: number | string;
21
+ venueId: number | string;
22
+ buildingId: number | string;
23
+ /** BCP-47 code (`es`, `en-US`). When set, JACS resolves floor `name` /
24
+ * `description` to that locale instead of the customer's default. */
25
+ locale?: string;
26
+ };
27
+ type GetDestinationsArgs = {
28
+ customerId: number | string;
29
+ venueId: number | string;
30
+ /** See {@link GetFloorsArgs.locale}. */
31
+ locale?: string;
32
+ };
33
+ type GetAmenitiesArgs = {
34
+ customerId: number | string;
35
+ /** See {@link GetFloorsArgs.locale}. */
36
+ locale?: string;
37
+ };
38
+ type GetZonesArgs = {
39
+ customerId: number | string;
40
+ venueId: number | string;
41
+ /** See {@link GetFloorsArgs.locale}. */
42
+ locale?: string;
43
+ };
44
+ type GetMapLabelsArgs = {
45
+ customerId: number | string;
46
+ venueId: number | string;
47
+ /** See {@link GetFloorsArgs.locale}. */
48
+ locale?: string;
49
+ };
50
+ type GetVenueArgs = {
51
+ customerId: number | string;
52
+ venueId: number | string;
53
+ };
54
+ type JacsVenue = Record<string, any>;
55
+ type GetBuildingFullArgs = {
56
+ customerId: number | string;
57
+ venueId: number | string;
58
+ buildingId: number | string;
59
+ mapProfile?: string;
60
+ geojson?: boolean;
61
+ };
62
+ type JacsBuildingFull = Record<string, any>;
63
+ type JacsVenueAll = Record<string, any>;
64
+ type GetStylesheet3dArgs = {
65
+ customerId: number | string;
66
+ venueId: number | string;
67
+ buildingId: number | string;
68
+ };
69
+ type GetFloorMapGeoJsonArgs = {
70
+ customerId: number | string;
71
+ venueId: number | string;
72
+ buildingId: number | string;
73
+ floorId: number | string;
74
+ };
75
+ type GetPolygonLayersArgs = {
76
+ customerId: number | string;
77
+ };
78
+ type GetFloorMapTemplate3dArgs = {
79
+ customerId: number | string;
80
+ venueId: number | string;
81
+ buildingId: number | string;
82
+ floorId: number | string;
83
+ };
84
+ type JacsBuilding = {
85
+ id?: number | string;
86
+ buildingId?: number | string;
87
+ name?: string;
88
+ isDefault?: boolean;
89
+ default?: boolean;
90
+ [key: string]: any;
91
+ };
92
+ type JacsFloor = Record<string, any>;
93
+ type JacsDestination = Record<string, any>;
94
+ type JacsAmenity = Record<string, any>;
95
+ type JacsZone = Record<string, any>;
96
+ type JacsMapLabel = Record<string, any>;
97
+ type JacsPolygonLayer = Record<string, any>;
98
+ /**
99
+ * This matches the “map-template/3d” shape you pasted earlier:
100
+ * rows keyed by layerName with paint-ish properties like fill, line-color, etc.
101
+ */
102
+ type JacsMapTemplate3dRow = {
103
+ layerName: string;
104
+ fill?: string | null;
105
+ 'fill-opacity'?: number | null;
106
+ fillAntialias?: boolean | null;
107
+ 'fill-pattern'?: string | null;
108
+ 'line-color'?: string | null;
109
+ 'line-width'?: number | null;
110
+ lineOpacity?: number | null;
111
+ strokeWidth?: number | null;
112
+ strokeOpacity?: number | null;
113
+ 'fill-extrusion-color'?: string | null;
114
+ 'fill-extrusion-height'?: number | null;
115
+ 'fill-extrusion-opacity'?: number | null;
116
+ 'fill-extrusion-base'?: number | null;
117
+ 'fill-extrusion-pattern'?: string | null;
118
+ [key: string]: any;
119
+ };
120
+ declare class JacsProvider {
121
+ private mode;
122
+ private proxyBaseUrl;
123
+ private direct;
124
+ private fetchImpl;
125
+ private tokenCache;
126
+ constructor(config: JacsProviderConfig);
127
+ /** `/customer/all` — every customer with its venues, for a venue picker. Each
128
+ * entry is `{ customer, venues[] }`. Not venue-scoped. */
129
+ getCustomersAll(): Promise<Record<string, any>[]>;
130
+ getPolygonLayers(args: GetPolygonLayersArgs): Promise<JacsPolygonLayer[]>;
131
+ getFloorMapTemplate3d(args: GetFloorMapTemplate3dArgs): Promise<JacsMapTemplate3dRow[]>;
132
+ getFloors(args: GetFloorsArgs): Promise<JacsFloor[]>;
133
+ /**
134
+ * Hits the JEM venue full-call aggregator at /customer/{cid}/venue/{vid}/all.
135
+ * Unlike /building/{bid}/full this endpoint does NOT go through Redis — JACS
136
+ * assembles the response server-side from many controllers on every call, so
137
+ * SDK consumers always see fresh data regardless of cache invalidation state.
138
+ *
139
+ * Response shape: { customer, venue, buildings: [{ floors }], waypoints[],
140
+ * destinations[], amenities[], paths[], mapLabels[], devices[], zones[],
141
+ * pathTypes[], mapProfiles[] }. Floor geojson is NOT included — the SDK
142
+ * lazy-loads it via ensureFloorGeojson.
143
+ */
144
+ getVenueAll(args: GetVenueArgs): Promise<JacsVenueAll>;
145
+ getVenue(args: GetVenueArgs): Promise<JacsVenue>;
146
+ getFloorMapGeojson(args: GetFloorMapGeoJsonArgs): Promise<GeoJSON.FeatureCollection>;
147
+ getBuildingFull(args: GetBuildingFullArgs): Promise<JacsBuildingFull>;
148
+ getDestinations(args: GetDestinationsArgs): Promise<JacsDestination[]>;
149
+ /** Zones (department groupings). `name` / `description` are localized. */
150
+ getZones(args: GetZonesArgs): Promise<JacsZone[]>;
151
+ /**
152
+ * CMS-authored map labels (street / area / wing names). The endpoint is
153
+ * `/label`, not `/map-label` — the latter 404s. The localized `name` is on
154
+ * the label template; each `instances[]` placement carries its own internal
155
+ * `name` ("Parking Lot E - Instance 1") which is authoring metadata and is
156
+ * never displayed.
157
+ */
158
+ getMapLabels(args: GetMapLabelsArgs): Promise<JacsMapLabel[]>;
159
+ /**
160
+ * Amenities are **customer-scoped**, not venue-scoped. A
161
+ * `/customer/{id}/venue/{id}/amenity` path also exists and returns the same
162
+ * records, but it silently ignores `?locale=` — it answers with the base
163
+ * (en-US) names for every locale, which reads as "translations aren't
164
+ * working" rather than as a wrong URL. Only `/customer/{id}/amenity`
165
+ * resolves the locale. Don't reintroduce the venue segment.
166
+ */
167
+ getAmenities(args: GetAmenitiesArgs): Promise<JacsAmenity[]>;
168
+ getBuildings(args: GetBuildingsArgs): Promise<JacsBuilding[]>;
169
+ getStylesheet3d(args: GetStylesheet3dArgs): Promise<StyleSpecification>;
170
+ invalidateToken(): void;
171
+ getJson<T>(path: string): Promise<T>;
172
+ private extractArray;
173
+ private getJwtToken;
174
+ private normalizeHost;
175
+ private joinUrl;
176
+ private safeReadText;
177
+ }
178
+
179
+ /** The JacsProvider methods the SDK's data layer reads. Both JacsProvider (live
180
+ * JACS) and SnapshotProvider (published snapshots) implement them. */
181
+ type JacsReader = Pick<JacsProvider, 'getVenueAll' | 'getFloorMapGeojson' | 'getDestinations' | 'getFloors' | 'getZones' | 'getMapLabels' | 'getAmenities' | 'getPolygonLayers' | 'getCustomersAll'>;
182
+ type SnapshotProviderConfig = {
183
+ /** Root of the snapshot host, e.g. `https://snapshots.example.com`. */
184
+ baseUrl: string;
185
+ fetchImpl?: typeof fetch;
186
+ };
187
+ /**
188
+ * The venue (or its customer) can't be shown from snapshots: it was never
189
+ * published, or it was withdrawn (unpublished, disabled or deleted). Thrown
190
+ * from `init()`; check `reason` to show "not published" vs "no longer
191
+ * available".
192
+ */
193
+ declare class SnapshotUnavailableError extends Error {
194
+ readonly reason: 'not-published' | 'withdrawn';
195
+ readonly customerId: string;
196
+ readonly venueId: string | null;
197
+ constructor(reason: 'not-published' | 'withdrawn', customerId: string, venueId: string | null);
198
+ }
199
+ /** The customer and venue snapshot versions a load is using. */
200
+ type SnapshotVersions = {
201
+ customer: number;
202
+ venue: number;
203
+ };
204
+ /**
205
+ * Result of `checkForUpdate`: whether what's published now differs from what
206
+ * this instance loaded.
207
+ *
208
+ * - `current` — nothing newer is published.
209
+ * - `available` — a newer customer or venue version is published; reload to
210
+ * show it.
211
+ * - `unavailable` — the venue (or its customer) has since been withdrawn or
212
+ * was never published; a reload would fail with `SnapshotUnavailableError`.
213
+ * - `incompatible` — a newer version is published in a schema this SDK can't
214
+ * read; don't reload until the SDK is updated.
215
+ */
216
+ type SnapshotUpdateCheck = {
217
+ status: 'current';
218
+ loaded: SnapshotVersions;
219
+ } | {
220
+ status: 'available';
221
+ loaded: SnapshotVersions;
222
+ latest: SnapshotVersions;
223
+ } | {
224
+ status: 'unavailable';
225
+ loaded: SnapshotVersions;
226
+ reason: 'not-published' | 'withdrawn';
227
+ } | {
228
+ status: 'incompatible';
229
+ loaded: SnapshotVersions;
230
+ schemaVersion: number;
231
+ };
232
+ /**
233
+ * Picks the locale folder to read. Exact (case-insensitive) match first, then a
234
+ * same-language match (`es` → `es-US`), then `fallback` — so a locale the
235
+ * customer added after this venue was last published falls back to the default
236
+ * language until the venue is republished.
237
+ */
238
+ declare function resolveSnapshotLocale(requested: string | undefined, available: string[], fallback: string): string;
239
+ declare class SnapshotProvider implements JacsReader {
240
+ private baseUrl;
241
+ private fetchImpl;
242
+ private snapshots;
243
+ private files;
244
+ constructor(config: SnapshotProviderConfig);
245
+ /** `directory.json` — published, public customers with their venues, in
246
+ * `/customer/all`'s `{ customer, venues[] }` shape. */
247
+ getCustomersAll(): Promise<Record<string, any>[]>;
248
+ /** venue.json with the customer-wide pieces put back where `/all` has them. */
249
+ getVenueAll(args: {
250
+ customerId: number | string;
251
+ venueId: number | string;
252
+ }): Promise<JacsVenueAll>;
253
+ getFloorMapGeojson(args: {
254
+ customerId: number | string;
255
+ venueId: number | string;
256
+ floorId: number | string;
257
+ }): Promise<GeoJSON.FeatureCollection>;
258
+ getDestinations(args: {
259
+ customerId: number | string;
260
+ venueId: number | string;
261
+ locale?: string;
262
+ }): Promise<JacsDestination[]>;
263
+ /** The snapshot holds the first building's floors only — the one the SDK reads. */
264
+ getFloors(args: {
265
+ customerId: number | string;
266
+ venueId: number | string;
267
+ locale?: string;
268
+ }): Promise<JacsFloor[]>;
269
+ getZones(args: {
270
+ customerId: number | string;
271
+ venueId: number | string;
272
+ locale?: string;
273
+ }): Promise<JacsZone[]>;
274
+ getMapLabels(args: {
275
+ customerId: number | string;
276
+ venueId: number | string;
277
+ locale?: string;
278
+ }): Promise<JacsMapLabel[]>;
279
+ getAmenities(args: {
280
+ customerId: number | string;
281
+ locale?: string;
282
+ }): Promise<JacsAmenity[]>;
283
+ getPolygonLayers(args: {
284
+ customerId: number | string;
285
+ }): Promise<JacsPolygonLayer[]>;
286
+ /** The manifest versions this instance is reading, once loaded. */
287
+ getVersions(customerId: number | string, venueId: number | string): Promise<{
288
+ customer: number;
289
+ venue: number;
290
+ }>;
291
+ /**
292
+ * Re-reads both manifests (without changing what this instance reads) and
293
+ * compares them with the versions it loaded. Rejects when a manifest can't
294
+ * be fetched — a network failure says nothing about what's published, so
295
+ * try again later.
296
+ */
297
+ checkForUpdate(customerId: number | string, venueId: number | string): Promise<SnapshotUpdateCheck>;
298
+ private venueLocalized;
299
+ private customerRef;
300
+ private venueRef;
301
+ /**
302
+ * Runs `read` against the pinned snapshots. The publisher keeps old versions
303
+ * for a while, but a long-running client (a kiosk) can outlive one: if a
304
+ * pinned version's file is gone, re-read that manifest and retry once on the
305
+ * current version. Data already loaded from the old version stays as it was;
306
+ * files fetched from now on come from the new one.
307
+ */
308
+ private pinned;
309
+ /** The current manifest, read once per instance: a loaded venue keeps
310
+ * reading the version it started with (see `pinned` for when it can't). */
311
+ private snapshot;
312
+ /** Versioned files are immutable, so one fetch per file per instance. */
313
+ private file;
314
+ private list;
315
+ private fetchJson;
316
+ }
317
+
318
+ export { JacsProvider, SnapshotProvider, SnapshotUnavailableError, resolveSnapshotLocale };
319
+ export type { JacsAmenity, JacsDestination, JacsFloor, JacsMapLabel, JacsPolygonLayer, JacsProviderConfig, JacsReader, JacsVenueAll, JacsZone, SnapshotProviderConfig };
package/dist/jacs.js ADDED
@@ -0,0 +1,2 @@
1
+ function e(e){return e?`?locale=${encodeURIComponent(e)}`:""}!function(e){const t=Boolean(e?.enabled),n=function(e){const t=String(e).trim();return t?`[${t}]`:""}(e?.prefix)}({enabled:!0,prefix:"MinuteMapsSDK"});class t{mode;proxyBaseUrl;direct;fetchImpl;tokenCache=null;constructor(e){const t="undefined"!=typeof window?window:globalThis,n=e.fetchImpl??t.fetch;if("function"!=typeof n)throw new Error("Fetch API is not available in this environment");this.fetchImpl=n.bind(t),this.mode=e.mode,this.proxyBaseUrl=("proxy"===e.mode?e.proxyBaseUrl:void 0)||"/api/jacs","direct"===e.mode?this.direct={host:this.normalizeHost(e.host),clientId:e.clientId,username:e.username,password:e.password}:this.direct=null}async getCustomersAll(){const e=await this.getJson("/customer/all");return this.extractArray(e)}async getPolygonLayers(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/polygon-layer`,n=await this.getJson(t);return this.extractArray(n)}async getFloorMapTemplate3d(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building/${encodeURIComponent(String(e.buildingId))}/floor/${encodeURIComponent(String(e.floorId))}/map-template/3d`,n=await this.getJson(t);return this.extractArray(n)}async getFloors(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/venue/${encodeURIComponent(String(t.venueId))}/building/${encodeURIComponent(String(t.buildingId))}/floor`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getVenueAll(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/all`,n=await this.getJson(t),o=n?.data||n?.result||n;if(!o||"object"!=typeof o)throw new Error("JACS venue/all response was not a JSON object");return o}async getVenue(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}`,n=await this.getJson(t),o=n?.venue||n?.data||n;if(!o||"object"!=typeof o)throw new Error("JACS venue response was not a JSON object");return o}async getFloorMapGeojson(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building/${encodeURIComponent(String(e.buildingId))}/floor/${encodeURIComponent(String(e.floorId))}/map/geojson?layers=Back-of-house%2CBackground%2CBoundary%2CCorridor%2C%20Corridors%2CCustomArtLayer-1%2CCustomArtLayer-2%2CCustomArtLayer-3%2CCustomArtLayer-4%2CCustomArtLayer-5%2CCustomArtLayer-6%2CCustomArtLayer-7%2CElevators%2CEscalators%2CInterior-ParkingLots%2CKiosks%2CLBox%2CMall-Boundary%2CMedians%2CObstacles%2CParking-Equipment%2CParking-Lots%2CParking-Obstacles%2CParking-Space%2CParking-Text%2CParking-Zones%2CPattern-1%2CPattern-2%2CPattern-3%2CPattern-Grass%2CPattern-Indoor-FoodCourt-Seating%2CPattern-Lounge%2CPattern-OutdoorTerrace%2CPattern-Pavement%2CPattern-Trees%2CPattern-Water%2CRamp-Markings%2CRamps%2CRestrooms%2CStairs%2CStreets-Major%2CStreets-Minor%2CStreets-SmallAlleys%2CUnits%2CXMLID%20`,n=await this.getJson(t),o=n?.geojson||n?.data||n;if(!o||"FeatureCollection"!==o.type||!Array.isArray(o.features))throw new Error("JACS floor geojson did not look like a GeoJSON FeatureCollection");return o}async getBuildingFull(e){const t=new URLSearchParams;t.set("mapProfile",String(e.mapProfile??"public")),t.set("geojson",String(e.geojson??!0));const n=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building/${encodeURIComponent(String(e.buildingId))}/full?${t.toString()}`,o=await this.getJson(n),s=o?.data||o?.result||o;if(!s||"object"!=typeof s)throw new Error("JACS building full response was not a JSON object");return s}async getDestinations(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/venue/${encodeURIComponent(String(t.venueId))}/destination`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getZones(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/venue/${encodeURIComponent(String(t.venueId))}/zone`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getMapLabels(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/venue/${encodeURIComponent(String(t.venueId))}/label`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getAmenities(t){const n=`/customer/${encodeURIComponent(String(t.customerId))}/amenity`+e(t.locale),o=await this.getJson(n);return this.extractArray(o)}async getBuildings(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building`,n=await this.getJson(t);return this.extractArray(n)}async getStylesheet3d(e){const t=`/customer/${encodeURIComponent(String(e.customerId))}/venue/${encodeURIComponent(String(e.venueId))}/building/${encodeURIComponent(String(e.buildingId))}/stylesheet/3d`,n=await this.getJson(t),o=n?.style||n?.data||n;if(!o||"object"!=typeof o)throw new Error("JACS stylesheet response was not a JSON object");return o}invalidateToken(){this.tokenCache=null}async getJson(e){if("proxy"===this.mode){const t=this.proxyBaseUrl.replace(/\/+$/,""),n=e.startsWith("/")?e:`/${e}`,o=await this.fetchImpl(`${t}${n}`,{method:"GET",headers:{Accept:"application/json"}});if(!o.ok){const e=await this.safeReadText(o);throw new Error(`JACS proxy GET failed (${o.status} ${o.statusText}) :: ${e}`)}return await o.json()}const t=this.direct;if(!t)throw new Error("JacsProvider is not configured for direct mode");const n=await this.getJwtToken(),o=this.joinUrl(t.host,e),s=await this.fetchImpl(o,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}});if(!s.ok){const e=await this.safeReadText(s);throw new Error(`JACS GET failed (${s.status} ${s.statusText}) :: ${e}`)}return await s.json()}extractArray(e){return(Array.isArray(e)?e:null)||(Array.isArray(e?.data)?e.data:null)||(Array.isArray(e?.items)?e.items:null)||(Array.isArray(e?.results)?e.results:null)||[]}async getJwtToken(){const e=this.direct;if(!e)throw new Error("getJwtToken should not be called in proxy mode");const t=Date.now(),n=this.tokenCache;if(n?.token&&t<n.expiresAtMs-3e4)return n.token;const o=this.joinUrl(e.host,"/auth/token"),s=new URLSearchParams;s.set("grant_type","password"),s.set("client_id",e.clientId),s.set("username",e.username),s.set("password",e.password);const r=await this.fetchImpl(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:s.toString()});if(!r.ok){const e=await this.safeReadText(r);throw new Error(`JACS auth failed (${r.status} ${r.statusText}) :: ${e}`)}const a=await r.json(),i=a?.access_token||a?.token||a?.jwt||a?.accessToken;if(!i)throw new Error("JACS auth response did not contain a token");const c=a?.expires_in??a?.expiresIn??a?.expires??a?.ttl,l="number"==typeof c?c:Number(c),u=Number.isFinite(l)&&l>0?l:600;return this.tokenCache={token:i,expiresAtMs:Date.now()+1e3*u},i}normalizeHost(e){return String(e||"").replace(/\/+$/,"")}joinUrl(e,t){const n=this.normalizeHost(e),o=String(t||"");return o?`${n}${o.startsWith("/")?"":"/"}${o}`:n}async safeReadText(e){try{return await e.text()}catch{return""}}}class n extends Error{reason;customerId;venueId;constructor(e,t,n){super(`${null===n?`Customer ${t}`:`Venue ${n} (customer ${t})`} is ${"withdrawn"===e?"no longer available":"not published"}`),this.reason=e,this.customerId=t,this.venueId=n,this.name="SnapshotUnavailableError"}}class o extends Error{folder;constructor(e,t){super(`Snapshot GET ${t} failed (404): version ${e} is no longer published`),this.folder=e,this.name="VersionGoneError"}}const s=e=>encodeURIComponent(String(e));function r(e,t,n){if(!e)return n;const o=e.toLowerCase(),s=t.find(e=>e.toLowerCase()===o);if(s)return s;const r=o.split("-")[0];return t.find(e=>e.toLowerCase().split("-")[0]===r)??n}class a{baseUrl;fetchImpl;snapshots=new Map;files=new Map;constructor(e){if(!e.baseUrl)throw new Error("SnapshotProvider needs a baseUrl");const t="undefined"!=typeof window?window:globalThis,n=e.fetchImpl??t.fetch;if("function"!=typeof n)throw new Error("Fetch API is not available in this environment");this.fetchImpl=n.bind(t),this.baseUrl=e.baseUrl.replace(/\/+$/,"")}async getCustomersAll(){const e=await this.fetchJson("directory.json");return Array.isArray(e?.customers)?e.customers:[]}async getVenueAll(e){return this.pinned([this.venueRef(e.customerId,e.venueId),this.customerRef(e.customerId)],async([e,t])=>{const[n,o]=await Promise.all([this.file(e,"venue.json"),this.file(t,"customer.json")]);return{...n,customer:o?.customer??null,pathTypes:Array.isArray(o?.pathTypes)?o.pathTypes:[],mapProfiles:[]}})}async getFloorMapGeojson(e){const t=`floors/${e.floorId}.geojson`;return this.pinned([this.venueRef(e.customerId,e.venueId)],async([n])=>{if(!n.manifest.files.includes(t))throw new Error(`Snapshot has no geojson for floor ${e.floorId} (404)`);const o=await this.file(n,t);if(!o||"FeatureCollection"!==o.type||!Array.isArray(o.features))throw new Error("Snapshot floor geojson did not look like a GeoJSON FeatureCollection");return o})}async getDestinations(e){return this.venueLocalized(e,"destinations.json")}async getFloors(e){return this.venueLocalized(e,"floors.json")}async getZones(e){return this.venueLocalized(e,"zones.json")}async getMapLabels(e){return this.venueLocalized(e,"labels.json")}async getAmenities(e){return this.pinned([this.customerRef(e.customerId)],([t])=>{const n=r(e.locale,t.manifest.locales,t.manifest.defaultLocale);return this.list(t,`${n}/amenities.json`)})}async getPolygonLayers(e){return this.pinned([this.customerRef(e.customerId)],([e])=>this.list(e,"polygon-layers.json"))}async getVersions(e,t){const[n,o]=await Promise.all([this.snapshot(this.customerRef(e)),this.snapshot(this.venueRef(e,t))]);return{customer:n.manifest.version,venue:o.manifest.version}}async checkForUpdate(e,t){const n=await this.getVersions(e,t),[o,s]=await Promise.all([this.fetchJson(`${this.customerRef(e).prefix}manifest.json`,{notFound:null}),this.fetchJson(`${this.venueRef(e,t).prefix}manifest.json`,{notFound:null})]),r=[o,s];if(r.some(e=>null===e))return{status:"unavailable",loaded:n,reason:"not-published"};if(r.some(e=>"withdrawn"===e.state))return{status:"unavailable",loaded:n,reason:"withdrawn"};const a=r.find(e=>"number"!=typeof e.schemaVersion||e.schemaVersion>1);if(a)return{status:"incompatible",loaded:n,schemaVersion:a.schemaVersion};const i={customer:o.version,venue:s.version};return i.customer!==n.customer||i.venue!==n.venue?{status:"available",loaded:n,latest:i}:{status:"current",loaded:n}}async venueLocalized(e,t){return this.pinned([this.venueRef(e.customerId,e.venueId),this.customerRef(e.customerId)],([n,o])=>{const s=n.manifest.locales.filter(e=>o.manifest.locales.includes(e)),a=r(e.locale,s,n.manifest.defaultLocale);return this.list(n,`${a}/${t}`)})}customerRef(e){return{prefix:`c/${s(e)}/`,customerId:String(e),venueId:null}}venueRef(e,t){return{prefix:`c/${s(e)}/v/${s(t)}/`,customerId:String(e),venueId:String(t)}}async pinned(e,t){const n=e.map(e=>this.snapshot(e)),s=await Promise.all(n);try{return await t(s)}catch(r){if(!(r instanceof o))throw r;e.forEach((e,t)=>{s[t].folder===r.folder&&this.snapshots.get(e.prefix)===n[t]&&this.snapshots.delete(e.prefix)});const a=await Promise.all(e.map(e=>this.snapshot(e)));if(a.every((e,t)=>e.folder===s[t].folder))throw r;return t(a)}}snapshot({prefix:e,customerId:t,venueId:o}){let s=this.snapshots.get(e);return s||(s=(async()=>{const s=await this.fetchJson(`${e}manifest.json`,{notFound:null});if(null===s)throw new n("not-published",t,o);if("withdrawn"===s.state)throw new n("withdrawn",t,o);if("number"!=typeof s.schemaVersion||s.schemaVersion>1)throw new Error(`Snapshot ${e} has schema version ${s.schemaVersion}; this SDK reads up to 1. Update the SDK.`);return{folder:`${e}${s.version}/`,manifest:s}})(),this.snapshots.set(e,s),s.catch(()=>this.snapshots.delete(e))),s}file(e,t){const n=e.folder+t;let s=this.files.get(n);return s||(s=this.fetchJson(n,{notFound:null}).then(t=>{if(null===t)throw new o(e.folder,n);return t}),this.files.set(n,s),s.catch(()=>this.files.delete(n))),s}async list(e,t){const n=await this.file(e,t);return Array.isArray(n)?n:[]}async fetchJson(e,t={}){const n=await this.fetchImpl(`${this.baseUrl}/${e}`,{headers:{Accept:"application/json"}});if(404===n.status&&"notFound"in t)return t.notFound;if(!n.ok)throw new Error(`Snapshot GET ${e} failed (${n.status} ${n.statusText})`);return n.json()}}export{t as JacsProvider,a as SnapshotProvider,n as SnapshotUnavailableError,r as resolveSnapshotLocale};
2
+ //# sourceMappingURL=jacs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jacs.js","sources":["../src/data/jacsProvider.ts","../src/logger.ts","../src/data/snapshotProvider.ts"],"sourcesContent":[null,null,null],"names":["localeQuery","locale","encodeURIComponent","opts","enabled","Boolean","prefix","p","String","trim","fmtPrefix","createLogger","JacsProvider","mode","proxyBaseUrl","direct","fetchImpl","tokenCache","constructor","config","scope","window","globalThis","rawFetch","fetch","Error","this","bind","undefined","host","normalizeHost","clientId","username","password","getCustomersAll","json","getJson","extractArray","getPolygonLayers","args","path","customerId","getFloorMapTemplate3d","venueId","buildingId","floorId","getFloors","getVenueAll","data","result","getVenue","venue","getFloorMapGeojson","fc","geojson","type","Array","isArray","features","getBuildingFull","query","URLSearchParams","set","mapProfile","toString","full","getDestinations","getZones","getMapLabels","getAmenities","getBuildings","getStylesheet3d","style","invalidateToken","base","replace","startsWith","res","method","headers","Accept","ok","body","safeReadText","status","statusText","token","getJwtToken","url","joinUrl","Authorization","items","results","now","Date","cached","expiresAtMs","tokenUrl","formBody","access_token","jwt","accessToken","expiresInSecRaw","expires_in","expiresIn","expires","ttl","expiresInSec","Number","ttlSec","isFinite","b","text","SnapshotUnavailableError","reason","super","name","VersionGoneError","folder","id","v","resolveSnapshotLocale","requested","available","fallback","want","toLowerCase","exact","find","l","language","split","SnapshotProvider","baseUrl","snapshots","Map","files","directory","fetchJson","customers","pinned","venueRef","customerRef","async","customer","venueJson","customerJson","Promise","all","file","pathTypes","mapProfiles","manifest","includes","venueLocalized","locales","defaultLocale","list","getVersions","snapshot","version","checkForUpdate","loaded","notFound","manifests","some","m","state","unreadable","schemaVersion","latest","shared","filter","refs","read","pending","map","ref","e","forEach","i","get","delete","current","every","s","catch","then","options"],"mappings":"AASA,SAASA,EAAYC,GACnB,OAAKA,EACE,WAAWC,mBAAmBD,KADjB,EAEtB,ECIM,SAAuBE,GAC3B,MAAMC,EAAUC,QAAQF,GAAMC,SACxBE,EAPR,SAAmBA,GACjB,MAAMC,EAAIC,OAAOF,GAAcG,OAC/B,OAAOF,EAAI,IAAIA,KAAO,EACxB,CAIiBG,CAAUP,GAAMG,OAiBjC,CD/BYK,CAAa,CAAEP,SAAS,EAAME,OAAQ,wBAsKrCM,EACHC,KACAC,aACAC,OAEAC,UACAC,WAAgC,KAExC,WAAAC,CAAYC,GACV,MAAMC,EAA+B,oBAAXC,OAAyBA,OAASC,WACtDC,EAAgBJ,EAAOH,WAAaI,EAAMI,MAChD,GAAwB,mBAAbD,EACT,MAAM,IAAIE,MAAM,kDAElBC,KAAKV,UAAYO,EAASI,KAAKP,GAE/BM,KAAKb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