atriusmaps-node-sdk 3.3.940 → 3.3.942

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.940";
5
+ var version = "3.3.942";
6
6
  var pkg = {
7
7
  version: version};
8
8
 
@@ -63,6 +63,9 @@ const headlessCommands = [
63
63
  ];
64
64
  function handleHeadless(app) {
65
65
  const pickRouteSummary = (route) => {
66
+ if (route == null) {
67
+ throw new Error("Route is unreachable");
68
+ }
66
69
  const routeRecord = route;
67
70
  return {
68
71
  distance: routeRecord.distance,
@@ -1 +1 @@
1
- var a="3.3.940",e={version:a};export{e as default,a as version};
1
+ var a="3.3.942",e={version:a};export{e as default,a as version};
@@ -1 +1 @@
1
- import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"../../../src/utils/location.js";const s=[{command:"destroy"},{command:"getDirections",args:[{name:"from",type:"location"},{name:"to",type:"location"},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getDirectionsMultiple",args:[{name:"locations",type:"list",itemType:{type:"location"}},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getPOIDetails",args:[{name:"poiId",type:"integer",min:0}]},{command:"getAllPOIs"},{command:"getStructures"},{command:"getVenueData"},{command:"getSecurityWaitTimes",args:[{name:"isOpen",type:"boolean",optional:!0}]},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]},{command:"getFlightStatus",args:[{name:"term",type:"string",optional:!0},{name:"type",type:"string",optional:!0}]}];function i(s){const i=e=>{const t=e;return{distance:t.distance,time:t.time,steps:t.steps,navline:t.navline,waypoints:t.waypoints}};s.bus.on("clientAPI/destroy",async()=>s.destroy?.()),s.bus.on("clientAPI/getDirections",async({from:e,to:n,accessible:a,queueTypes:o})=>{const c=await t(s,e),r=await t(s,n),m={requiresAccessibility:!!a};o&&(m.selectedSecurityLanes={SecurityLane:o});const l=await s.bus.get("wayfinder/getRoute",{fromEndpoint:c,toEndpoint:r,options:m});return i(l)}),s.bus.on("clientAPI/getDirectionsMultiple",async({locations:n,accessible:a,queueTypes:o})=>{const c=await Promise.all(n.map(async e=>t(s,e))),r={requiresAccessibility:!!a};o&&(r.selectedSecurityLanes={SecurityLane:o});const m=(await Promise.all(e.aperture(2,c).map(async e=>s.bus.get("wayfinder/getRoute",{fromEndpoint:e[0],toEndpoint:e[1],options:r})))).map(i);return{total:{distance:e.sum(m.map(e=>Number(e.distance??0))),time:e.sum(m.map(e=>Number(e.time??0)))},directions:m}}),s.bus.on("clientAPI/getPOIDetails",async({poiId:e})=>s.bus.get("poi/getById",{id:e})),s.bus.on("clientAPI/getAllPOIs",async()=>s.bus.get("poi/getAll")),s.bus.on("clientAPI/getStructures",()=>n(s)),s.bus.on("clientAPI/getSecurityWaitTimes",async({isOpen:e})=>s.bus.get("dynamicPois/getSecurityWaitTimes",{isOpen:e})),s.bus.on("clientAPI/getVenueData",async()=>{const e=await s.bus.get("venueData/getVenueData");return Object.fromEntries(Object.entries(e).filter(([,e])=>"function"!=typeof e))}),s.bus.on("clientAPI/search",async({term:e,details:t})=>s.bus.get("search/queryAsync",{term:e}).then(n=>{const i=n.map(e=>e.poiId);return s.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:i}),t?n:i})),s.bus.on("clientAPI/getFlightStatus",async({term:e,type:t="all"})=>s.bus.get("flightStatus/query",{term:e,type:t}))}export{i as handleHeadless,s as headlessCommands};
1
+ import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"../../../src/utils/location.js";const s=[{command:"destroy"},{command:"getDirections",args:[{name:"from",type:"location"},{name:"to",type:"location"},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getDirectionsMultiple",args:[{name:"locations",type:"list",itemType:{type:"location"}},{name:"accessible",type:"boolean",optional:!0},{name:"queueTypes",type:"list",itemType:{type:"string"},optional:!0}]},{command:"getPOIDetails",args:[{name:"poiId",type:"integer",min:0}]},{command:"getAllPOIs"},{command:"getStructures"},{command:"getVenueData"},{command:"getSecurityWaitTimes",args:[{name:"isOpen",type:"boolean",optional:!0}]},{command:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]},{command:"getFlightStatus",args:[{name:"term",type:"string",optional:!0},{name:"type",type:"string",optional:!0}]}];function i(s){const i=e=>{if(null==e)throw new Error("Route is unreachable");const t=e;return{distance:t.distance,time:t.time,steps:t.steps,navline:t.navline,waypoints:t.waypoints}};s.bus.on("clientAPI/destroy",async()=>s.destroy?.()),s.bus.on("clientAPI/getDirections",async({from:e,to:n,accessible:a,queueTypes:o})=>{const r=await t(s,e),c=await t(s,n),m={requiresAccessibility:!!a};o&&(m.selectedSecurityLanes={SecurityLane:o});const l=await s.bus.get("wayfinder/getRoute",{fromEndpoint:r,toEndpoint:c,options:m});return i(l)}),s.bus.on("clientAPI/getDirectionsMultiple",async({locations:n,accessible:a,queueTypes:o})=>{const r=await Promise.all(n.map(async e=>t(s,e))),c={requiresAccessibility:!!a};o&&(c.selectedSecurityLanes={SecurityLane:o});const m=(await Promise.all(e.aperture(2,r).map(async e=>s.bus.get("wayfinder/getRoute",{fromEndpoint:e[0],toEndpoint:e[1],options:c})))).map(i);return{total:{distance:e.sum(m.map(e=>Number(e.distance??0))),time:e.sum(m.map(e=>Number(e.time??0)))},directions:m}}),s.bus.on("clientAPI/getPOIDetails",async({poiId:e})=>s.bus.get("poi/getById",{id:e})),s.bus.on("clientAPI/getAllPOIs",async()=>s.bus.get("poi/getAll")),s.bus.on("clientAPI/getStructures",()=>n(s)),s.bus.on("clientAPI/getSecurityWaitTimes",async({isOpen:e})=>s.bus.get("dynamicPois/getSecurityWaitTimes",{isOpen:e})),s.bus.on("clientAPI/getVenueData",async()=>{const e=await s.bus.get("venueData/getVenueData");return Object.fromEntries(Object.entries(e).filter(([,e])=>"function"!=typeof e))}),s.bus.on("clientAPI/search",async({term:e,details:t})=>s.bus.get("search/queryAsync",{term:e}).then(n=>{const i=n.map(e=>e.poiId);return s.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:i}),t?n:i})),s.bus.on("clientAPI/getFlightStatus",async({term:e,type:t="all"})=>s.bus.get("flightStatus/query",{term:e,type:t}))}export{i as handleHeadless,s as headlessCommands};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.940",
3
+ "version": "3.3.942",
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",