atriusmaps-node-sdk 3.3.998 → 3.3.999

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "3.3.998";
5
+ var version = "3.3.999";
6
6
  var pkg = {
7
7
  version: version};
8
8
 
@@ -163,7 +163,7 @@ function embellishTilemapVenueData(venueData) {
163
163
  venueData[key] = additionalFields[key];
164
164
  }
165
165
  }
166
- const between = (val, lim1, lim2) => val > lim1 ? val <= lim2 : (val2) => lim2;
166
+ const between = (val, lim1, lim2) => val >= Math.min(lim1, lim2) && val <= Math.max(lim1, lim2);
167
167
  const swapFirstTwoItems = ([c1, c2, ...c3]) => [c2, c1, ...c3];
168
168
  const normalizeCoords = (coords, venueBounds) => {
169
169
  if (!coords || !Array.isArray(coords) || coords.length < 1) {
@@ -1 +1 @@
1
- var a="3.3.998",e={version:a};export{e as default,a as version};
1
+ var a="3.3.999",e={version:a};export{e as default,a as version};
@@ -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()),l=(e,t)=>n(null,`https://style.maps.atrius.com/v2/style?venueId=${e}&category=${t}`).then(e=>e.json()).then(e=>e.data),o=e=>`https://api.content.locuslabs.com/${e}`,r=(t,n,s,a,l)=>e.mapObjIndexed((e,n)=>((e,t,n,s,a,l)=>"theme"===l||"style"===l?`${o(n)}/${t}/${l}/${a}/${s}/${l}.json`:e.replace(/https:\/\/content.locuslabs.com/gi,o(n)))(e,t,s,a,l,n),n),c=[["zh-CN","zh-SG","zh-Hans"],["zh-TW","zh-HK","zh-MO","zh-Hant"]],i=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]},u=(e,t,n=null)=>{for(const s of i(t)){if(n&&s(n.locale))return n;const t=e.find(e=>s(e.locale));if(t)return t}return null},d=async(e,t,n)=>{const s={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:a,accountId:l,formatVersion:o}=e;let{venueId:c}=e;const i=`https://${s[a]||s.prod}/accounts/${l}`,d=o||"v5",h=e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getFiles?await globalThis[e.dataFetch].getFiles(e):await t(`${i}/${d}.json`),g=h[c]?h[c].venueCode:null;if(g){const t=Object.values(h).filter(e=>e.venueCode===g),s=h[c];for(const a of n){const n=u(t,a,s);if(n){c=n.id,e.venueId=`${c}`;break}}}if(!h[c])throw Error(`Attempt to access venue ${c} which is not within venue list: ${Object.keys(h)}`);const f=h[c].files,b=(e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getVenueData?await globalThis[e.dataFetch].getVenueData(e):await t(f.venueData))[c];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=h;const m=(e=>{const t=e.deepLinkProps?e.deepLinkProps.contentStage:null;return"alpha"===t||"beta"===t||"prod"===t?t:null})(e);return b.files=m?r(b.category,f,m,l,c):f,b},h=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 g=([e,t,...n])=>[t,e,...n],f=(e,t)=>{return!e||!Array.isArray(e)||e.length<1?e:(n=e[0][0],s=t.ne.lng,a=t.sw.lng,(n>s?n<=a:e=>a)?e:e.map(g));var n,s,a};export{h as buildStructures,s as createFetchJson,a as createFetchText,l as fetchStyleDoc,u as findVenueForLocale,d as getVenueDataFromUrls,f as normalizeCoords};
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()),l=(e,t)=>n(null,`https://style.maps.atrius.com/v2/style?venueId=${e}&category=${t}`).then(e=>e.json()).then(e=>e.data),o=e=>`https://api.content.locuslabs.com/${e}`,r=(t,n,s,a,l)=>e.mapObjIndexed((e,n)=>((e,t,n,s,a,l)=>"theme"===l||"style"===l?`${o(n)}/${t}/${l}/${a}/${s}/${l}.json`:e.replace(/https:\/\/content.locuslabs.com/gi,o(n)))(e,t,s,a,l,n),n),c=[["zh-CN","zh-SG","zh-Hans"],["zh-TW","zh-HK","zh-MO","zh-Hant"]],i=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]},u=(e,t,n=null)=>{for(const s of i(t)){if(n&&s(n.locale))return n;const t=e.find(e=>s(e.locale));if(t)return t}return null},d=async(e,t,n)=>{const s={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:a,accountId:l,formatVersion:o}=e;let{venueId:c}=e;const i=`https://${s[a]||s.prod}/accounts/${l}`,d=o||"v5",h=e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getFiles?await globalThis[e.dataFetch].getFiles(e):await t(`${i}/${d}.json`),g=h[c]?h[c].venueCode:null;if(g){const t=Object.values(h).filter(e=>e.venueCode===g),s=h[c];for(const a of n){const n=u(t,a,s);if(n){c=n.id,e.venueId=`${c}`;break}}}if(!h[c])throw Error(`Attempt to access venue ${c} which is not within venue list: ${Object.keys(h)}`);const f=h[c].files,m=(e.dataFetch&&globalThis[e.dataFetch]&&globalThis[e.dataFetch].getVenueData?await globalThis[e.dataFetch].getVenueData(e):await t(f.venueData))[c];m.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]}(m),m.venueList=h;const b=(e=>{const t=e.deepLinkProps?e.deepLinkProps.contentStage:null;return"alpha"===t||"beta"===t||"prod"===t?t:null})(e);return m.files=b?r(m.category,f,b,l,c):f,m},h=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 g=([e,t,...n])=>[t,e,...n],f=(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(g));var n,s,a};export{h as buildStructures,s as createFetchJson,a as createFetchText,l as fetchStyleDoc,u as findVenueForLocale,d as getVenueDataFromUrls,f as normalizeCoords};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.998",
3
+ "version": "3.3.999",
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
6
  "map",