atriusmaps-node-sdk 3.3.1029 → 3.3.1031
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/cjs/package.json.js +1 -1
- package/dist/cjs/plugins/sdkServer/src/sdkServer.js +4 -0
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +1 -1
- package/dist/cjs/plugins/venueDataLoader/src/venueLoadingUtils.js +5 -3
- package/dist/package.json.js +1 -1
- package/dist/plugins/sdkServer/src/sdkServer.js +1 -1
- package/dist/plugins/venueDataLoader/src/venueDataLoader.js +1 -1
- package/dist/plugins/venueDataLoader/src/venueLoadingUtils.js +1 -1
- package/package.json +13 -13
package/dist/cjs/package.json.js
CHANGED
|
@@ -139,6 +139,10 @@ function registerEvents(app, sendEvent) {
|
|
|
139
139
|
);
|
|
140
140
|
app.bus.monitor("map/poiClicked", ({ poi }) => sendEvent("poiSelected", poi));
|
|
141
141
|
app.bus.monitor("poiDetails/showPoi", ({ poi }) => sendEvent("poiShown", poi));
|
|
142
|
+
app.bus.monitor(
|
|
143
|
+
"venueData/authError",
|
|
144
|
+
({ reason, status }) => sendEvent("authError", { reason, status })
|
|
145
|
+
);
|
|
142
146
|
app.bus.monitor("map/click", async ({ lat, lng, ord }) => {
|
|
143
147
|
const structures = await app.bus.get("venueData/getStructures");
|
|
144
148
|
const mapviewBBox = await app.bus.get("map/getViewBBox");
|
|
@@ -37,7 +37,7 @@ async function create(app, config) {
|
|
|
37
37
|
const fetchText = venueLoadingUtils.createFetchText();
|
|
38
38
|
const fetchManifestJson = venueLoadingUtils.createFetchManifestJson(
|
|
39
39
|
vConfig.auth,
|
|
40
|
-
() => app.bus.send("venueData/
|
|
40
|
+
(status) => app.bus.send("venueData/authError", { reason: "signedManifestForbidden", status })
|
|
41
41
|
);
|
|
42
42
|
const venueData = await venueLoadingUtils.getVenueDataFromUrls(vConfig, fetchJson, languagesToTry, fetchManifestJson);
|
|
43
43
|
const { accountId, venueId } = vConfig;
|
|
@@ -35,11 +35,13 @@ const fetchURL = async (token, url) => {
|
|
|
35
35
|
};
|
|
36
36
|
const createFetchJson = (token) => (url) => fetchURL(token, url).then((response) => response.json());
|
|
37
37
|
const createFetchText = (token) => (url) => fetchURL(token, url).then((response) => response.text());
|
|
38
|
-
const createFetchManifestJson = (auth,
|
|
38
|
+
const createFetchManifestJson = (auth, onManifestForbidden) => async (url) => {
|
|
39
39
|
const response = await fetch(url);
|
|
40
40
|
if (auth?.type === "kiosk" && response.status === 403) {
|
|
41
|
-
await
|
|
42
|
-
throw new Error(
|
|
41
|
+
await onManifestForbidden?.(response.status);
|
|
42
|
+
throw new Error(
|
|
43
|
+
`Kiosk signed manifest request was forbidden (${response.status}); the signed URL may have expired.`
|
|
44
|
+
);
|
|
43
45
|
}
|
|
44
46
|
return response.json();
|
|
45
47
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a="3.3.
|
|
1
|
+
var a="3.3.1031",e={version:a};export{e as default,a as version};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{throttle as e}from"throttle-debounce";import{getStructureAndFloorAtPoint as
|
|
1
|
+
import{throttle as e}from"throttle-debounce";import{getStructureAndFloorAtPoint as t}from"../../../src/utils/geom.js";import o from"../../../src/utils/observable.js";import{headlessCommands as n,handleHeadless as a}from"./sdkHeadless.js";let s=null;function r(e,t){return e===t}function i(e){const t=(e,t)=>{const o={payload:e,type:"LL-server",clientMsgId:t};try{window.postMessage(o,"*")}catch{window.postMessage((n=o,JSON.parse(JSON.stringify(n))),"*")}var n},o=o=>{const n=o.data;if(!n||"LL-client"!==n.type)return;const a=window.location.origin;r(o.origin,a)&&e.bus.get("clientAPI/execute",n.payload).then(e=>t(e,n.msgId)).catch(t=>{var o,a;e.config.debug&&console.error(t),o=t.message,a=n.msgId,window.postMessage({error:!0,payload:o,type:"LL-server",clientMsgId:a},"*")})};return s&&s(),window.addEventListener("message",o),s=()=>window.removeEventListener("message",o),(e,t)=>{window.postMessage({event:e,payload:t,type:"LL-server"},"*")}}async function l(s,r){const l=s.env.isBrowser?i(s):function(e){const t=o();return e.eventListener=t,(e,o)=>t.fire(e,o)}(s);return function(o,n){const a=async(e,t)=>{const{lat:a,lng:s,floorId:r,ordinal:i,structureId:l}=await o.bus.get("map/getMapCenter");n(e,{lat:a,lng:s,floorId:r,ord:i,structureId:l,...t})};o.bus.monitor("map/userMoveStart",e=>{a("userMoveStart",e)}),o.bus.monitor("map/userMoving",e(500,e=>{a("userMoving",e)})),o.bus.monitor("map/moveEnd",e=>{a("moveEnd",e)}),o.bus.monitor("map/floorChanged",({structure:e,floor:t})=>n("levelChange",{floorId:t?.id??null,floorName:t?.name??null,ord:t?.ordinal??null,structureId:e?.id??null,structureName:e?.name??null})),o.bus.monitor("map/poiClicked",({poi:e})=>n("poiSelected",e)),o.bus.monitor("poiDetails/showPoi",({poi:e})=>n("poiShown",e)),o.bus.monitor("venueData/authError",({reason:e,status:t})=>n("authError",{reason:e,status:t})),o.bus.monitor("map/click",async({lat:e,lng:a,ord:s})=>{const r=await o.bus.get("venueData/getStructures"),i=await o.bus.get("map/getViewBBox"),{building:l,floor:p}=t(r,e,a,s,i,!0);n("mapClicked",{lat:e,lng:a,ord:s,building:l,floor:p})})}(s,l),{init:async()=>{!function(e){[{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}},{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}},{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}},{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}},{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}}].forEach(t=>{e.bus.send("clientAPI/registerCustomType",t)})}(s),n.forEach(e=>s.bus.send("clientAPI/registerCommand",e)),a(s),r.headless||await import("../../../_virtual/_empty_module_placeholder.js").then(e=>{e.visualCommands.forEach(e=>s.bus.send("clientAPI/registerCommand",e)),e.handleVisual(s,l)});const e=async()=>{await s.bus.send("system/readywhenyouare"),s.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then(e=>l("ready",{commandJSON:e})),!r.headless&&s.config.uiHide?.sidebar&&s.env.isDesktop()&&s.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}})};r.headless?Promise.all([new Promise(e=>s.bus.monitor("venueData/navGraphLoaded",e)),new Promise(e=>s.bus.monitor("venueData/poiDataLoaded",e))]).then(e):s.bus.on("map/mapReadyToShow",e),s.bus.on("sdkServer/sendEvent",({eventName:e,...t})=>l(e,t))}}}export{l as create,r as isSameOriginBrowserMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import t from"zousan";import{fetchStyleDoc as a,normalizeCoords as n,getVenueDataFromUrls as s,buildStructures as r,createFetchJson as u,createFetchText as o,createFetchManifestJson as i}from"./venueLoadingUtils.js";async function d(d,l){const c=d.log.sublog("venueDataLoader");let p=new t,v=new t;const g=t=>t.defaultStructureId||e.path(["structureOrder",0],t)||e.path(["selectorOrder",0],t)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(t),b=(e,t)=>e.split("").reduce((a,n,s)=>e.substring(0,s+1)===t.substring(0,s+1)?s:a,-1)+1,f=e=>((e,t)=>Object.values(e.venueList).filter(e=>e.locale===t).sort((t,a)=>b(a.id,e.id)-b(t.id,e.id)).at(0))(e,"en")?.id;async function m(t,a){const n=u(),l=o(),c=i(t.auth,
|
|
1
|
+
import*as e from"ramda";import t from"zousan";import{fetchStyleDoc as a,normalizeCoords as n,getVenueDataFromUrls as s,buildStructures as r,createFetchJson as u,createFetchText as o,createFetchManifestJson as i}from"./venueLoadingUtils.js";async function d(d,l){const c=d.log.sublog("venueDataLoader");let p=new t,v=new t;const g=t=>t.defaultStructureId||e.path(["structureOrder",0],t)||e.path(["selectorOrder",0],t)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(t),b=(e,t)=>e.split("").reduce((a,n,s)=>e.substring(0,s+1)===t.substring(0,s+1)?s:a,-1)+1,f=e=>((e,t)=>Object.values(e.venueList).filter(e=>e.locale===t).sort((t,a)=>b(a.id,e.id)-b(t.id,e.id)).at(0))(e,"en")?.id;async function m(t,a){const n=u(),l=o(),c=i(t.auth,e=>d.bus.send("venueData/authError",{reason:"signedManifestForbidden",status:e})),v=await s(t,n,a,c),{accountId:b,venueId:m}=t;return v.assetStage=t.assetStage,v.defaultOrdinal=v.defaultOrdinal||function(t){const a=g(t),n=Object.values(t.structures).find(e.propEq(a,"id"));return n.levels[n.defaultLevelId].ordinal}(v),v.structures=r(v),v.baseVenueId=f(v),v.getTranslatedContentPath=e=>`https://content.locuslabs.com/${v.category}/${e}/${m}/${b}`,v.fetchJson=n,v.fetchText=l,d.config.debug&&d.env.isBrowser&&(window._venueData=v),v.queueTypes&&(v.securityQueueTypes=(()=>{const e=v.queueTypes.find(e=>"SecurityLane"===e.id);return e?e.subtypes.map(e=>e.id):[]})()),d.bus.send("venueData/venueDataLoaded",{venueData:v}),p.resolve(v),p}function h(e){const t={id:"venueDataLoader"};return e.id!==l.venueId&&(t.vid=e.id),t.lang=d.i18n().language,"prod"!==e.assetStage&&(t.stage=e.assetStage),d.bus.send("deepLinking/notifyState",t),e}d.bus.on("debugTools/fileDrop",async({file:e,content:t})=>{if("application/json"===e.type){const e=JSON.parse(t);if(e.basemap&&e["basemap.venue"])return n=JSON.parse(t),void d.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return a=t,void d.bus.send("map/replaceStyle",{styleSrc:a})}var a,n});async function y(e){const t={...e},a=await d.bus.get("poi/getAll");return Object.values(t).forEach(e=>e.filter(e=>"poi"===e.properties.aiLayer&&"Point"===e.geometry.type).forEach(e=>{const t=a[e.properties.id];t?t.mapLabel?e.properties.text=t.mapLabel:!1!==l.copyPOINamesToMap&&(e.properties.text=function(e){let t=e.name;return l.poiMapNameXForm?(Object.keys(l.poiMapNameXForm).filter(t=>((e,t)=>e===t||0===e.indexOf(t+"."))(e.category,t)).forEach(e=>{l.poiMapNameXForm[e].forEach(e=>t=t.replace(new RegExp(e.replace),e.with))}),t):t}(t)):c.warn(`Unknown poi in style: ${e.properties.id}`)})),t}async function D(a){return e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.keys),e.prepend(a.id),e.map(e=>a.files.geoJson.replace("${geoJsonId}",e)),e.map(a.fetchJson),e.map(e.andThen(e=>[e.id,I(e.id,e.features,a.id,a.structures)])),e=>t.all(e),e.andThen(e.fromPairs))(a)}const I=(t,a,n,s)=>{const r=t.replace(/-[^-]*$/,""),u=r===n?"landscape-background":`ordinal: ${s.find(e.hasPath(["levels",t])).levels[t].ordinal}`;return a.map(a=>{var s,o,i;return s="properties",o={venueId:n,structureId:r,ordinalId:u,levelId:t},i=a,a=e.over(e.lensProp(s),t=>e.mergeRight(t||{},o),i),a=e.assoc("id",a.properties.subid,a)})};d.bus.on("venueData/loadMap",async()=>{p.then(async e=>{const t=e.files.spritesheet,n=e.files.glyphs,{id:s,bounds:r,structures:u,venueCenter:o,venueRadius:i,defaultOrdinal:c}=e,[p,g,b]=await Promise.all([a(e.baseVenueId,e.category),e.fetchJson(e.files.theme),e.venueList[s].mapTokens?Promise.resolve({[s]:[]}):D(e).then(y)]),f={mapFeatures:b,mapStyleSource:p,mapTheme:g,badgesSpriteUrl:t,mapGlyphsUrl:n,structures:u,defaultOrdinal:c,venueBounds:{n:r.ne.lat,s:r.sw.lat,e:r.ne.lng,w:r.sw.lng},venueId:s,venueCenter:o,venueRadius:i,accountId:l.accountId,secure:void 0!==l.auth,tileServerAuthInfo:e.tileServerAuthInfo};v.resolve(f),d.bus.send("venueData/mapDataLoaded",f)})});const w=e=>null==e.shouldDisplay||e.shouldDisplay;d.bus.on("venueData/loadBuildingSelectorData",()=>p.then(async t=>{const a={buildings:t.structures.filter(w).map(e.evolve({levels:e.pipe(e.values,e.sortWith([e.descend(e.prop("ordinal"))]))})),structureOrder:t.structureOrder,selectorOrder:t.selectorOrder};return d.bus.send("venueData/buildingSelectorDataLoaded",a),a})),d.bus.on("venueData/normalizeCoords",({coords:e})=>p.then(t=>n(e,t.bounds)));const S={edges:[],nodes:[]};d.bus.on("venueData/loadNavGraph",async()=>p.then(async e=>{const t={navGraphData:e.files.nav?await e.fetchJson(e.files.nav):S,structures:e.structures};return d.bus.send("venueData/navGraphLoaded",t),t})),d.bus.on("venueData/loadPoiData",async()=>p.then(async e=>{const t=l.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld;if(t){const a=await e.fetchJson(t);d.bus.send("venueData/poiDataLoaded",{pois:a,structures:e.structures})}})),d.bus.on("venueData/getVenueCenter",async()=>p.then(async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))),d.bus.on("venueData/getContentUrl",({type:e,name:t=""})=>p.then(a=>a.files[e]+t)),d.bus.on("venueData/getFloorIdToNameMap",()=>p.then(e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.values),e.map(e.props(["id","name"])),e.fromPairs))),d.bus.on("venueData/getFloorIdName",({floorId:t})=>p.then(async a=>{const n=e.pipe(e.values,e.find(e.hasPath(["levels",t])))(a.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[t].name}:null}));const O=(t,a)=>()=>p.then(e.pipe(e.prop(t),e.defaultTo(a)));function T(e,t){const a=P(t);if(a.includes(e))return e;const n=e.split("-").slice(1).join("-");return a.find(e=>new RegExp(`${t.baseVenueId}.?.?-${n}`).test(e))}d.bus.on("venueData/getVenueData",()=>p),d.bus.on("venueData/getVenueName",O("name")),d.bus.on("venueData/getVenueCategory",O("category")),d.bus.on("venueData/getVenueTimezone",O("tz")),d.bus.on("venueData/getAccountId",()=>l.accountId),d.bus.on("venueData/getVenueId",O("id")),d.bus.on("venueData/getPositioningSupported",O("positioningSupported")),d.bus.on("venueData/getStructures",O("structures")),d.bus.on("venueData/loadNewVenue",async({venueId:e,accountId:a,assetStage:n=l.assetStage})=>{p.reject(new Error("loadNewVenue called - previous loading ignored")),v.reject(new Error("loadNewVenue called - previous loading ignored")),p=new t,v=new t,m({...l,venueId:e,accountId:a,assetStage:n},[]).then(h)}),d.bus.on("venueData/getPoiImageUrl",({imageName:e,size:t})=>`https://img.locuslabs.com/resize/${l.accountId}/png/transparent/${t}contain/poi/${e}`),d.bus.on("venueData/getDistributionId",()=>p.then(e=>`${e.baseVenueId}-${l.accountId}`)),d.bus.on("venueData/getCustomKeywords",()=>p.then(e=>{const t=l.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(t)})),d.bus.on("venueData/isGrabEnabled",O("enableGrab")),d.bus.on("venueData/getGrabPoiIds",O("grabPoiIds",[])),d.bus.on("venueData/getAssetsTimestamp",O("version")),d.bus.on("venueData/getTranslatedFloorId",async({floorId:e})=>p.then(t=>T(e,t)));const P=e=>e.structures.reduce((e,t)=>e.concat(Object.keys(t.levels)),[]);d.bus.on("venueData/getQueueTypes",()=>p.then(e=>{const t=["tsapre","clear","globalEntry"];return e.queueTypes?e.queueTypes.reduce((e,a)=>{const{id:n,subtypes:s}=a,r=s.map(e=>{const a=t.includes(e.id)&&`security-logo-${e.id.toLowerCase()}`;return{...e,imageId:a}});return e[n]=r,e},{}):{}}));return{init:async()=>{let e=[];null===new URLSearchParams("undefined"==typeof window?"":window.location.search).get("lang")&&(e="undefined"==typeof window?[]:navigator.languages);const t=l.deepLinkProps||{};t.lang&&e.unshift(t.lang);const a=t.vid||l.venueId,n=l.useDynamicUrlParams&&t.stage?t.stage:l.assetStage,s=t.accountId||("alpha"===n?"A1VPTJKREFJWX5":l.accountId);m({...l,venueId:a,accountId:s,assetStage:n},e).then(h)},runTest:async({testRoutine:e,reset:a=!1,venueData:n=null})=>{let s,r;return(a||n)&&(p=new t,v=new t),n&&(p=t.resolve(n)),await e(),p.v&&(s=await p),v.v&&(r=await v),{venueDataObj:s,mapDataObj:r}},internal:{calculateBaseVenueId:f,getDefaultStructureId:g,getTranslatedFloorId:T,setConfigProperty:(e,t)=>{l[e]=t}}}}export{d as create};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import{findBoundsOfCoordinates as t}from"../../../src/utils/bounds.js";const n=async(e,t)=>e?fetch(t,{headers:{Authorization:e}}):fetch(t),s=e=>t=>n(e,t).then(e=>e.json()),a=e=>t=>n(e,t).then(e=>e.text()),o=(e,t)=>async n=>{const s=await fetch(n);if("kiosk"===e?.type&&403===s.status)throw await(t?.()),new Error(
|
|
1
|
+
import*as e from"ramda";import{findBoundsOfCoordinates as t}from"../../../src/utils/bounds.js";const n=async(e,t)=>e?fetch(t,{headers:{Authorization:e}}):fetch(t),s=e=>t=>n(e,t).then(e=>e.json()),a=e=>t=>n(e,t).then(e=>e.text()),o=(e,t)=>async n=>{const s=await fetch(n);if("kiosk"===e?.type&&403===s.status)throw await(t?.(s.status)),new Error(`Kiosk signed manifest request was forbidden (${s.status}); the signed URL may have expired.`);return s.json()},r=(e,t)=>n(null,`https://style.maps.atrius.com/v2/style?venueId=${e}&category=${t}`).then(e=>e.json()).then(e=>e.data),l=e=>`https://api.content.locuslabs.com/${e}`,i=e=>{if("string"!=typeof e)return!1;try{const t=new URL(e).searchParams;return["Expires","Signature","Key-Pair-Id"].every(e=>t.has(e))}catch{return!1}},u=(t,n,s,a,o)=>e.mapObjIndexed((e,n)=>((e,t,n,s,a,o)=>i(e)?e:"theme"===o||"style"===o?`${l(n)}/${t}/${o}/${a}/${s}/${o}.json`:e.replace(/https:\/\/content.locuslabs.com/gi,l(n)))(e,t,s,a,o,n),n),c=[["zh-CN","zh-SG","zh-Hans"],["zh-TW","zh-HK","zh-MO","zh-Hant"]],d=e=>{const t=(e=>{const t=c.find(t=>t.includes(e));return t?t.filter(t=>t!==e):[]})(e),n=e.slice(0,2);return[t=>t===e,e=>t.includes(e),e=>e.slice(0,2)===n]},h=(e,t,n=null)=>{for(const s of d(t)){if(n&&s(n.locale))return n;const t=e.find(e=>s(e.locale));if(t)return t}return null},g=async(e,t,n,s=t)=>{const a={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:o,accountId:r,formatVersion:l}=e;let{venueId:i}=e;const c=`https://${a[o]||a.prod}/accounts/${r}`,d=l||"v5",g="kiosk"===e.auth?.type;if(g&&("string"!=typeof e.auth.signedManifestUrl||!e.auth.signedManifestUrl.trim()))throw new Error("Kiosk auth requires a non-empty signedManifestUrl");const f=!g&&e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getFiles?await globalThis[e.dataFetch].getFiles(e):await s(g?e.auth.signedManifestUrl:`${c}/${d}.json`),m=f[i]?f[i].venueCode:null;if(m){const t=Object.values(f).filter(e=>e.venueCode===m),s=f[i];for(const a of n){const n=h(t,a,s);if(n){i=n.id,e.venueId=`${i}`;break}}}if(!f[i])throw Error(`Attempt to access venue ${i} which is not within venue list: ${Object.keys(f)}`);const p=f[i].files,b=(!g&&e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getVenueData?await globalThis[e.dataFetch].getVenueData(e):await t(p.venueData))[i];b.tileServerAuthInfo&&function(e){const t={defaultOrdinal:0,defaultStructureId:"singleBuilding",formatVersion:"v5",structures:{singleBuilding:{name:"singleBuilding",boundsPolygon:[],defaultLevelId:"singleLevel",id:"singleBuilding",levels:{singleLevel:{boundsPolygon:[],clfloor:0,details:"",id:"singleLevel",name:"singleLevel",ordinal:0}}}},structureOrder:["singleBuilding"]};for(const n in t)e[n]=t[n]}(b),b.venueList=f;const v=(e=>{const t=e.deepLinkProps?e.deepLinkProps.contentStage:null;return"alpha"===t||"beta"===t||"prod"===t?t:null})(e);return b.files=v?u(b.category,p,v,r,i):p,b},f=e=>{const{structureOrder:n,structures:s}=e;return n.map(e=>{const n=s[e];Object.values(n.levels).forEach(e=>e.bounds=t(e.boundsPolygon));const a=t(n.boundsPolygon);return{...n,bounds:a}})};const m=([e,t,...n])=>[t,e,...n],p=(e,t)=>{return!e||!Array.isArray(e)||e.length<1?e:(n=e[0][0],s=t.ne.lng,a=t.sw.lng,n>=Math.min(s,a)&&n<=Math.max(s,a)?e:e.map(m));var n,s,a};export{f as buildStructures,s as createFetchJson,o as createFetchManifestJson,a as createFetchText,r as fetchStyleDoc,h as findVenueForLocale,g as getVenueDataFromUrls,p as normalizeCoords};
|
package/package.json
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atriusmaps-node-sdk",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.1031",
|
|
4
4
|
"description": "This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"maps",
|
|
9
|
-
"indoor",
|
|
10
|
-
"venue",
|
|
6
|
+
"acuitybrands",
|
|
7
|
+
"atrius",
|
|
11
8
|
"geolocation",
|
|
12
9
|
"geospatial",
|
|
10
|
+
"indoor",
|
|
13
11
|
"locuslabs",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
12
|
+
"map",
|
|
13
|
+
"mapping",
|
|
14
|
+
"maps",
|
|
15
|
+
"venue"
|
|
16
16
|
],
|
|
17
17
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
18
18
|
"author": "Glenn Crownover <crownover@locuslabs.com>",
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
19
22
|
"type": "module",
|
|
23
|
+
"main": "./dist/cjs/nodesdk/nodeEntry.js",
|
|
24
|
+
"module": "./lib/nodesdk/nodeEntry.js",
|
|
20
25
|
"exports": {
|
|
21
26
|
".": {
|
|
22
27
|
"import": "./dist/nodesdk/nodeEntry.js",
|
|
@@ -26,11 +31,6 @@
|
|
|
26
31
|
"./package.json": "./package.json",
|
|
27
32
|
"./configs/sdkHeadless.json": "./dist/src/configs/sdkHeadless.json"
|
|
28
33
|
},
|
|
29
|
-
"main": "./dist/cjs/nodesdk/nodeEntry.js",
|
|
30
|
-
"module": "./lib/nodesdk/nodeEntry.js",
|
|
31
|
-
"files": [
|
|
32
|
-
"dist"
|
|
33
|
-
],
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "rollup -c rollup.config.js && cp package-cjs.json dist/cjs/package.json",
|
|
36
36
|
"prepublishOnly": "yarn build",
|