atriusmaps-node-sdk 3.3.946 → 3.3.947

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.946";
5
+ var version = "3.3.947";
6
6
  var pkg = {
7
7
  version: version};
8
8
 
@@ -68,11 +68,11 @@ function handleHeadless(app) {
68
68
  }
69
69
  const routeRecord = route;
70
70
  return {
71
- distance: routeRecord.distance,
72
- time: routeRecord.time,
73
- steps: routeRecord.steps,
74
- navline: routeRecord.navline,
75
- waypoints: routeRecord.waypoints
71
+ distance: Number(routeRecord.distance ?? 0),
72
+ time: Number(routeRecord.time ?? 0),
73
+ steps: Array.isArray(routeRecord.steps) ? routeRecord.steps : [],
74
+ navline: Array.isArray(routeRecord.navline) ? routeRecord.navline : void 0,
75
+ waypoints: Array.isArray(routeRecord.waypoints) ? routeRecord.waypoints : void 0
76
76
  };
77
77
  };
78
78
  app.bus.on("clientAPI/destroy", async () => app.destroy?.());
@@ -86,37 +86,31 @@ function handleHeadless(app) {
86
86
  const route = await app.bus.get("wayfinder/getRoute", { fromEndpoint, toEndpoint, options });
87
87
  return pickRouteSummary(route);
88
88
  });
89
- app.bus.on(
90
- "clientAPI/getDirectionsMultiple",
91
- async ({ locations, accessible, queueTypes }) => {
92
- const endpoints = await Promise.all(locations.map(async (location$1) => location.locationToEndpoint(app, location$1)));
93
- const options = { requiresAccessibility: !!accessible };
94
- if (queueTypes) {
95
- options.selectedSecurityLanes = { SecurityLane: queueTypes };
96
- }
97
- const routes = await Promise.all(
98
- R__namespace.aperture(2, endpoints).map(
99
- async (pair) => app.bus.get("wayfinder/getRoute", {
100
- fromEndpoint: pair[0],
101
- toEndpoint: pair[1],
102
- options
103
- })
104
- )
105
- );
106
- const directions = routes.map(pickRouteSummary);
107
- return {
108
- total: {
109
- distance: R__namespace.sum(directions.map((direction) => Number(direction.distance ?? 0))),
110
- time: R__namespace.sum(directions.map((direction) => Number(direction.time ?? 0)))
111
- },
112
- directions
113
- };
89
+ app.bus.on("clientAPI/getDirectionsMultiple", async ({ locations, accessible, queueTypes }) => {
90
+ const endpoints = await Promise.all(locations.map(async (location$1) => location.locationToEndpoint(app, location$1)));
91
+ const options = { requiresAccessibility: !!accessible };
92
+ if (queueTypes) {
93
+ options.selectedSecurityLanes = { SecurityLane: queueTypes };
114
94
  }
115
- );
116
- app.bus.on(
117
- "clientAPI/getPOIDetails",
118
- async ({ poiId }) => app.bus.get("poi/getById", { id: poiId })
119
- );
95
+ const routes = await Promise.all(
96
+ R__namespace.aperture(2, endpoints).map(
97
+ async (pair) => app.bus.get("wayfinder/getRoute", {
98
+ fromEndpoint: pair[0],
99
+ toEndpoint: pair[1],
100
+ options
101
+ })
102
+ )
103
+ );
104
+ const directions = routes.map(pickRouteSummary);
105
+ return {
106
+ total: {
107
+ distance: R__namespace.sum(directions.map((direction) => Number(direction.distance ?? 0))),
108
+ time: R__namespace.sum(directions.map((direction) => Number(direction.time ?? 0)))
109
+ },
110
+ directions
111
+ };
112
+ });
113
+ app.bus.on("clientAPI/getPOIDetails", async ({ poiId }) => app.bus.get("poi/getById", { id: poiId }));
120
114
  app.bus.on("clientAPI/getAllPOIs", async () => app.bus.get("poi/getAll"));
121
115
  app.bus.on("clientAPI/getStructures", () => location.getStructures(app));
122
116
  app.bus.on(
@@ -130,7 +124,7 @@ function handleHeadless(app) {
130
124
  app.bus.on(
131
125
  "clientAPI/search",
132
126
  async ({ term, details }) => app.bus.get("search/queryAsync", { term }).then((poiList) => {
133
- const poiIdList = poiList.map((poi) => poi.poiId);
127
+ const poiIdList = poiList.map((poi) => poi.poiId).filter((poiId) => poiId !== void 0);
134
128
  app.bus.send("event/search", {
135
129
  referrer: "prog",
136
130
  searchMethod: null,
@@ -142,10 +136,7 @@ function handleHeadless(app) {
142
136
  );
143
137
  app.bus.on(
144
138
  "clientAPI/getFlightStatus",
145
- async ({ term, type = "all" }) => app.bus.get(
146
- "flightStatus/query",
147
- { term, type }
148
- )
139
+ async ({ term, type = "all" }) => app.bus.get("flightStatus/query", { term, type })
149
140
  );
150
141
  }
151
142
 
@@ -1 +1 @@
1
- var a="3.3.946",e={version:a};export{e as default,a as version};
1
+ var a="3.3.947",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=>{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};
1
+ import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"../../../src/utils/location.js";const i=[{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 s(i){const s=e=>{if(null==e)throw new Error("Route is unreachable");const t=e;return{distance:Number(t.distance??0),time:Number(t.time??0),steps:Array.isArray(t.steps)?t.steps:[],navline:Array.isArray(t.navline)?t.navline:void 0,waypoints:Array.isArray(t.waypoints)?t.waypoints:void 0}};i.bus.on("clientAPI/destroy",async()=>i.destroy?.()),i.bus.on("clientAPI/getDirections",async({from:e,to:n,accessible:a,queueTypes:o})=>{const r=await t(i,e),c=await t(i,n),m={requiresAccessibility:!!a};o&&(m.selectedSecurityLanes={SecurityLane:o});const l=await i.bus.get("wayfinder/getRoute",{fromEndpoint:r,toEndpoint:c,options:m});return s(l)}),i.bus.on("clientAPI/getDirectionsMultiple",async({locations:n,accessible:a,queueTypes:o})=>{const r=await Promise.all(n.map(async e=>t(i,e))),c={requiresAccessibility:!!a};o&&(c.selectedSecurityLanes={SecurityLane:o});const m=(await Promise.all(e.aperture(2,r).map(async e=>i.bus.get("wayfinder/getRoute",{fromEndpoint:e[0],toEndpoint:e[1],options:c})))).map(s);return{total:{distance:e.sum(m.map(e=>Number(e.distance??0))),time:e.sum(m.map(e=>Number(e.time??0)))},directions:m}}),i.bus.on("clientAPI/getPOIDetails",async({poiId:e})=>i.bus.get("poi/getById",{id:e})),i.bus.on("clientAPI/getAllPOIs",async()=>i.bus.get("poi/getAll")),i.bus.on("clientAPI/getStructures",()=>n(i)),i.bus.on("clientAPI/getSecurityWaitTimes",async({isOpen:e})=>i.bus.get("dynamicPois/getSecurityWaitTimes",{isOpen:e})),i.bus.on("clientAPI/getVenueData",async()=>{const e=await i.bus.get("venueData/getVenueData");return Object.fromEntries(Object.entries(e).filter(([,e])=>"function"!=typeof e))}),i.bus.on("clientAPI/search",async({term:e,details:t})=>i.bus.get("search/queryAsync",{term:e}).then(n=>{const s=n.map(e=>e.poiId).filter(e=>void 0!==e);return i.bus.send("event/search",{referrer:"prog",searchMethod:null,query:e,entities:s}),t?n:s})),i.bus.on("clientAPI/getFlightStatus",async({term:e,type:t="all"})=>i.bus.get("flightStatus/query",{term:e,type:t}))}export{s as handleHeadless,i as headlessCommands};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.946",
3
+ "version": "3.3.947",
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",