atriusmaps-node-sdk 3.3.332 → 3.3.333

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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var name = "web-engine";
6
- var version = "3.3.332";
6
+ var version = "3.3.333";
7
7
  var license = "UNLICENSED";
8
8
  var type = "module";
9
9
  var main = "src/main.js";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var R = require('ramda');
6
- var util = require('./util.js');
6
+ var location = require('../../../src/utils/location.js');
7
7
 
8
8
  function _interopNamespace(e) {
9
9
  if (e && e.__esModule) return e;
@@ -61,8 +61,8 @@ function handleHeadless (app) {
61
61
  app.bus.on('clientAPI/destroy', async () => app.destroy());
62
62
 
63
63
  app.bus.on('clientAPI/getDirections', async ({ from, to, accessible, queueTypes }) => {
64
- const fromEndpoint = await util.locationToEndpoint(app, from);
65
- const toEndpoint = await util.locationToEndpoint(app, to);
64
+ const fromEndpoint = await location.locationToEndpoint(app, from);
65
+ const toEndpoint = await location.locationToEndpoint(app, to);
66
66
  const options = { requiresAccessibility: !!accessible };
67
67
  if (queueTypes)
68
68
  options.selectedSecurityLanes = { SecurityLane: queueTypes };
@@ -71,7 +71,7 @@ function handleHeadless (app) {
71
71
  });
72
72
 
73
73
  app.bus.on('clientAPI/getDirectionsMultiple', async ({ locations, accessible, queueTypes }) => {
74
- const endpoints = await Promise.all(locations.map(async l => util.locationToEndpoint(app, l)));
74
+ const endpoints = await Promise.all(locations.map(async l => location.locationToEndpoint(app, l)));
75
75
  const options = { requiresAccessibility: !!accessible };
76
76
  if (queueTypes)
77
77
  options.selectedSecurityLanes = { SecurityLane: queueTypes };
@@ -91,7 +91,7 @@ function handleHeadless (app) {
91
91
 
92
92
  app.bus.on('clientAPI/getAllPOIs', async () => app.bus.get('poi/getAll'));
93
93
 
94
- app.bus.on('clientAPI/getStructures', () => util.getStructures(app));
94
+ app.bus.on('clientAPI/getStructures', () => location.getStructures(app));
95
95
 
96
96
  const isNotFunction = o => typeof o !== 'function';
97
97
  app.bus.on('clientAPI/getVenueData', async () => {
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var geom = require('./geom.js');
6
+
7
+ /**
8
+ * Allows for flexibility in the manner in which you specify a location. This may call to getVenueData, so you should not
9
+ * call this function until you are in the init stage of your plugin, to ensure the venueDataLoader plugin has had a chance
10
+ * to register its getVenueData listener.
11
+ *
12
+ * @param {Object} app The app object
13
+ * @param {Object} location A location in the map, which can be a {poid} or {lat,lng,ord} or {lat,lng,ordinal} or {lat,lng,floorId}
14
+ * @returns an Endpoint { lat, lng, ordinal, floorId, title }
15
+ */
16
+ async function locationToEndpoint (app, location) {
17
+ if (location.poiId)
18
+ return app.bus.get('wayfinder/getNavigationEndpoint', { ep: location.poiId })
19
+ let { lat, lng, ord, ordinal, floorId, title = '' } = location;
20
+ if (ordinal === undefined && ord !== undefined)
21
+ ordinal = ord; // normalize on "ordinal"
22
+ if (ordinal !== undefined && floorId !== undefined) // we are good to go
23
+ return { lat, lng, ordinal, floorId, title }
24
+
25
+ // We are missing either an ordinal or a floorId.. we can get a floor object from either one and retrieve the other
26
+ const structures = await getStructures(app);
27
+
28
+ // Note: floor can be legitimately null here - if floorId was null and the location is not within a building...
29
+ const floor = ordinal !== undefined ? geom.getFloorAt(structures, lat, lng, ordinal) : geom.getFloor(structures, floorId);
30
+
31
+ if (ordinal !== undefined)
32
+ return { lat, lng, ordinal, floorId: floor ? floor.id : null, title }
33
+
34
+ // if ordinal was not defined, then we need a floor, so if floor is still null here, bad dog.
35
+ if (!floor)
36
+ throw Error('Call to locationToEndpoint with no ordinal and no floorId (or an invalid one): ' + floorId)
37
+
38
+ return { lat, lng, floorId, ordinal: floor.ordinal, title }
39
+ }
40
+
41
+ const getStructures = async app => app.bus.get('venueData/getVenueData').then(vd => vd.structures);
42
+
43
+ exports.getStructures = getStructures;
44
+ exports.locationToEndpoint = locationToEndpoint;
@@ -1 +1 @@
1
- var e="web-engine",s="3.3.332",o="UNLICENSED",l="module",r="src/main.js",t=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],a={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:a11y":"APPLITOOLS_IS_DISABLED=true && cypress open --browser chrome --env INPUT_MODALITY='keyboard'","cypress:comp":"APPLITOOLS_IS_DISABLED=true && cypress open --component --browser chrome","cypress:e2e":"APPLITOOLS_IS_DISABLED=true && cypress open --e2e --browser chrome",e2eSDKTest:"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./cypress/e2e/sdk && npx http-server' 8080 'yarn cypress run --spec cypress/e2e/sdk/**'",demo:"cd demo/ && yarn start","e2e:comp":"cypress run --component","e2e:record":"yarn cypress run --env RECORD_MODE=true",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",i18nOverrides:"yarn node utils/i18nOverrideCli src/i18n src/i18n-overrides",lint:"eslint .",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol",prepare:"husky install","test:vitest":"vitest",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:e2e:video":"cypress run"},i=["defaults"],n={"@azure/event-hubs":"^5.6.0","@dnd-kit/core":"^6.0.8","@dnd-kit/modifiers":"^7.0.0","@dnd-kit/sortable":"^7.0.2","@dnd-kit/utilities":"^3.2.1","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-default-theme":"^0.0.113","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@locus-labs/mol-desktop-building-level-selector":"^0.1.119","@locus-labs/mol-desktop-compass":"^0.1.120","@locus-labs/mol-desktop-default-theme":"^0.2.105","@locus-labs/mol-desktop-icon":"^0.1.131","@locus-labs/mol-desktop-logo":"^0.1.101","@locus-labs/mol-desktop-map-nav-button":"^0.1.130","@locus-labs/mol-desktop-tooltip":"^0.3.102","@locus-labs/mol-desktop-zoom-control":"^0.1.141","@locus-labs/mol-mobile-box":"^0.1.115","@locus-labs/mol-mobile-floating-action-button":"^0.0.117","@locus-labs/mol-mobile-icon":"^0.1.118","@locus-labs/mol-mobile-text":"^0.1.116","@locus-labs/mol-mobile-toast":"^0.1.102","@mapbox/mapbox-gl-draw":"^1.3.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.1.2","@turf/circle":"^6.5.0","@turf/helpers":"^6.5.0","@turf/point-to-line-distance":"^6.5.0","@vitejs/plugin-react":"^4.0.1",IObject:"^0.7.2","axe-core":"^4.9.0","crypto-browserify":"^3.12.0","cypress-axe":"^1.5.0","file-loader":"^6.2.0",flexsearch:"^0.7.31","h3-js":"^4.1.0",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"4.0.1",jsdom:"^25.0.0",jsonschema:"^1.2.6",luxon:"^3.3.0","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"^8.1.0",ramda:"^0.28.0",react:"^17.0.2","react-compound-slider":"^3.3.1","react-dom":"^17.0.2","react-json-editor-ajrm":"^2.5.13","react-qr-svg":"^2.2.1","react-svg":"^16.1.29","react-tageditor":"^0.2.3","react-virtualized-auto-sizer":"^1.0.2","smoothscroll-polyfill":"^0.4.4","styled-components":"5.1.0","styled-normalize":"^8.0.6","throttle-debounce":"^3.0.1",trackjs:"^3.7.4","ua-parser-js":"^0.7.23",uuid:"3.3.2",zousan:"^3.0.1","zousan-plus":"^4.0.1"},c={"@applitools/eyes-cypress":"^3.44.0","@babel/core":"^7.14.8","@babel/eslint-parser":"^7.24.7","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.20.0","@babel/plugin-transform-modules-commonjs":"^7.8.3","@babel/plugin-transform-runtime":"^7.8.3","@babel/preset-env":"^7.14.8","@babel/preset-react":"^7.8.3","@percy/cli":"^1.0.0-beta.60","@percy/cypress":"^3.1.0","@testing-library/jest-dom":"^6.5.0","@typescript-eslint/eslint-plugin":"^7.13.0","@typescript-eslint/parser":"^7.13.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^5.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"^12.17.2","cypress-browser-permissions":"^1.1.0","cypress-real-events":"^1.11.0","cypress-wait-until":"^1.7.1",eslint:"^8.57.0","eslint-config-standard":"^16.0.3","eslint-import-resolver-typescript":"^3.6.1","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^28.6.0","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-react":"^7.12.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.3.0",glob:"^10.3.3",husky:"^6.0.0",jest:"27.5.1","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",nx:"19.4.2","nx-remotecache-azure":"^19.0.0","start-server-and-test":"^2.0.0",typescript:"^5.4.5",vite:"^4.3.9",vitest:"^2.0.5",webpack:"^5.84.1","webpack-merge":"^5.8.0"},p="yarn@4.3.1",d={node:">=20"},m={},u={name:e,version:s,private:!0,license:o,type:l,main:r,workspaces:t,scripts:a,"lint-staged":{"*.js":["eslint --fix"]},browserslist:i,dependencies:n,devDependencies:c,packageManager:p,engines:d,nx:m};export{i as browserslist,u as default,n as dependencies,c as devDependencies,d as engines,o as license,r as main,e as name,m as nx,p as packageManager,a as scripts,l as type,s as version,t as workspaces};
1
+ var e="web-engine",s="3.3.333",o="UNLICENSED",l="module",r="src/main.js",t=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],a={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:a11y":"APPLITOOLS_IS_DISABLED=true && cypress open --browser chrome --env INPUT_MODALITY='keyboard'","cypress:comp":"APPLITOOLS_IS_DISABLED=true && cypress open --component --browser chrome","cypress:e2e":"APPLITOOLS_IS_DISABLED=true && cypress open --e2e --browser chrome",e2eSDKTest:"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./cypress/e2e/sdk && npx http-server' 8080 'yarn cypress run --spec cypress/e2e/sdk/**'",demo:"cd demo/ && yarn start","e2e:comp":"cypress run --component","e2e:record":"yarn cypress run --env RECORD_MODE=true",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",i18nOverrides:"yarn node utils/i18nOverrideCli src/i18n src/i18n-overrides",lint:"eslint .",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol",prepare:"husky install","test:vitest":"vitest",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:e2e:video":"cypress run"},i=["defaults"],n={"@azure/event-hubs":"^5.6.0","@dnd-kit/core":"^6.0.8","@dnd-kit/modifiers":"^7.0.0","@dnd-kit/sortable":"^7.0.2","@dnd-kit/utilities":"^3.2.1","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-default-theme":"^0.0.113","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@locus-labs/mol-desktop-building-level-selector":"^0.1.119","@locus-labs/mol-desktop-compass":"^0.1.120","@locus-labs/mol-desktop-default-theme":"^0.2.105","@locus-labs/mol-desktop-icon":"^0.1.131","@locus-labs/mol-desktop-logo":"^0.1.101","@locus-labs/mol-desktop-map-nav-button":"^0.1.130","@locus-labs/mol-desktop-tooltip":"^0.3.102","@locus-labs/mol-desktop-zoom-control":"^0.1.141","@locus-labs/mol-mobile-box":"^0.1.115","@locus-labs/mol-mobile-floating-action-button":"^0.0.117","@locus-labs/mol-mobile-icon":"^0.1.118","@locus-labs/mol-mobile-text":"^0.1.116","@locus-labs/mol-mobile-toast":"^0.1.102","@mapbox/mapbox-gl-draw":"^1.3.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.1.2","@turf/circle":"^6.5.0","@turf/helpers":"^6.5.0","@turf/point-to-line-distance":"^6.5.0","@vitejs/plugin-react":"^4.0.1",IObject:"^0.7.2","axe-core":"^4.9.0","crypto-browserify":"^3.12.0","cypress-axe":"^1.5.0","file-loader":"^6.2.0",flexsearch:"^0.7.31","h3-js":"^4.1.0",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"4.0.1",jsdom:"^25.0.0",jsonschema:"^1.2.6",luxon:"^3.3.0","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"^8.1.0",ramda:"^0.28.0",react:"^17.0.2","react-compound-slider":"^3.3.1","react-dom":"^17.0.2","react-json-editor-ajrm":"^2.5.13","react-qr-svg":"^2.2.1","react-svg":"^16.1.29","react-tageditor":"^0.2.3","react-virtualized-auto-sizer":"^1.0.2","smoothscroll-polyfill":"^0.4.4","styled-components":"5.1.0","styled-normalize":"^8.0.6","throttle-debounce":"^3.0.1",trackjs:"^3.7.4","ua-parser-js":"^0.7.23",uuid:"3.3.2",zousan:"^3.0.1","zousan-plus":"^4.0.1"},c={"@applitools/eyes-cypress":"^3.44.0","@babel/core":"^7.14.8","@babel/eslint-parser":"^7.24.7","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.20.0","@babel/plugin-transform-modules-commonjs":"^7.8.3","@babel/plugin-transform-runtime":"^7.8.3","@babel/preset-env":"^7.14.8","@babel/preset-react":"^7.8.3","@percy/cli":"^1.0.0-beta.60","@percy/cypress":"^3.1.0","@testing-library/jest-dom":"^6.5.0","@typescript-eslint/eslint-plugin":"^7.13.0","@typescript-eslint/parser":"^7.13.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^5.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"^12.17.2","cypress-browser-permissions":"^1.1.0","cypress-real-events":"^1.11.0","cypress-wait-until":"^1.7.1",eslint:"^8.57.0","eslint-config-standard":"^16.0.3","eslint-import-resolver-typescript":"^3.6.1","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^28.6.0","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-react":"^7.12.4","eslint-plugin-standard":"^5.0.0","fetch-mock-jest":"^1.3.0",glob:"^10.3.3",husky:"^6.0.0",jest:"27.5.1","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",nx:"19.4.2","nx-remotecache-azure":"^19.0.0","start-server-and-test":"^2.0.0",typescript:"^5.4.5",vite:"^4.3.9",vitest:"^2.0.5",webpack:"^5.84.1","webpack-merge":"^5.8.0"},p="yarn@4.3.1",d={node:">=20"},m={},u={name:e,version:s,private:!0,license:o,type:l,main:r,workspaces:t,scripts:a,"lint-staged":{"*.js":["eslint --fix"]},browserslist:i,dependencies:n,devDependencies:c,packageManager:p,engines:d,nx:m};export{i as browserslist,u as default,n as dependencies,c as devDependencies,d as engines,o as license,r as main,e as name,m as nx,p as packageManager,a as scripts,l as type,s as version,t as workspaces};
@@ -1 +1 @@
1
- import*as e from"ramda";import{locationToEndpoint as t,getStructures as n}from"./util.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:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]}];function i(s){s.bus.on("clientAPI/destroy",(async()=>s.destroy())),s.bus.on("clientAPI/getDirections",(async({from:n,to:i,accessible:a,queueTypes:o})=>{const c=await t(s,n),r=await t(s,i),l={requiresAccessibility:!!a};return o&&(l.selectedSecurityLanes={SecurityLane:o}),s.bus.get("wayfinder/getRoute",{fromEndpoint:c,toEndpoint:r,options:l}).then(e.pick(["distance","time","steps","navline","waypoints"]))})),s.bus.on("clientAPI/getDirectionsMultiple",(async({locations:n,accessible:i,queueTypes:a})=>{const o=await Promise.all(n.map((async e=>t(s,e)))),c={requiresAccessibility:!!i};a&&(c.selectedSecurityLanes={SecurityLane:a});const r=await Promise.all(e.aperture(2,o).map((async e=>s.bus.get("wayfinder/getRoute",{fromEndpoint:e[0],toEndpoint:e[1],options:c})))),l=e.map(e.pick(["distance","time","steps","navline","waypoints"]),r);return{total:{distance:e.sum(e.map((e=>e.distance),l)),time:e.sum(e.map((e=>e.time),l))},directions:l}})),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)));const i=e=>"function"!=typeof e;s.bus.on("clientAPI/getVenueData",(async()=>{const t=await s.bus.get("venueData/getVenueData");return e.filter(i,t)})),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}))))}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:"search",args:[{name:"term",type:"string",minLength:2},{name:"details",type:"boolean",optional:!0}]}];function i(s){s.bus.on("clientAPI/destroy",(async()=>s.destroy())),s.bus.on("clientAPI/getDirections",(async({from:n,to:i,accessible:a,queueTypes:o})=>{const c=await t(s,n),r=await t(s,i),l={requiresAccessibility:!!a};return o&&(l.selectedSecurityLanes={SecurityLane:o}),s.bus.get("wayfinder/getRoute",{fromEndpoint:c,toEndpoint:r,options:l}).then(e.pick(["distance","time","steps","navline","waypoints"]))})),s.bus.on("clientAPI/getDirectionsMultiple",(async({locations:n,accessible:i,queueTypes:a})=>{const o=await Promise.all(n.map((async e=>t(s,e)))),c={requiresAccessibility:!!i};a&&(c.selectedSecurityLanes={SecurityLane:a});const r=await Promise.all(e.aperture(2,o).map((async e=>s.bus.get("wayfinder/getRoute",{fromEndpoint:e[0],toEndpoint:e[1],options:c})))),l=e.map(e.pick(["distance","time","steps","navline","waypoints"]),r);return{total:{distance:e.sum(e.map((e=>e.distance),l)),time:e.sum(e.map((e=>e.time),l))},directions:l}})),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)));const i=e=>"function"!=typeof e;s.bus.on("clientAPI/getVenueData",(async()=>{const t=await s.bus.get("venueData/getVenueData");return e.filter(i,t)})),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}))))}export{i as handleHeadless,s as headlessCommands};
@@ -0,0 +1 @@
1
+ import{getFloorAt as o,getFloor as t}from"./geom.js";async function n(n,r){if(r.poiId)return n.bus.get("wayfinder/getNavigationEndpoint",{ep:r.poiId});let{lat:l,lng:a,ord:d,ordinal:e,floorId:f,title:u=""}=r;if(void 0===e&&void 0!==d&&(e=d),void 0!==e&&void 0!==f)return{lat:l,lng:a,ordinal:e,floorId:f,title:u};const g=await i(n),s=void 0!==e?o(g,l,a,e):t(g,f);if(void 0!==e)return{lat:l,lng:a,ordinal:e,floorId:s?s.id:null,title:u};if(!s)throw Error("Call to locationToEndpoint with no ordinal and no floorId (or an invalid one): "+f);return{lat:l,lng:a,floorId:f,ordinal:s.ordinal,title:u}}const i=async o=>o.bus.get("venueData/getVenueData").then((o=>o.structures));export{i as getStructures,n as locationToEndpoint};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.332",
3
+ "version": "3.3.333",
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",
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var geom = require('../../../src/utils/geom.js');
6
-
7
- const getStructures = async app => app.bus.get('venueData/getVenueData').then(vd => vd.structures);
8
-
9
- async function locationToEndpoint (app, location) {
10
- if (location.poiId)
11
- return app.bus.get('wayfinder/getNavigationEndpoint', { ep: location.poiId })
12
- const { lat, lng, ord, floorId, title = '' } = location;
13
- const structures = await getStructures(app);
14
- const floor = ord !== undefined ? geom.getFloorAt(structures, lat, lng, ord) : geom.getFloor(structures, floorId);
15
- if (ord !== undefined)
16
- return { lat, lng, ordinal: ord, floorId: floor ? floor.id : null, title }
17
- if (!floor)
18
- throw Error('Call to locationToEndpoint with no ordinal and no floorId (or an invalid one): ' + floorId)
19
- return { lat, lng, floorId, ordinal: floor.ordinal, title }
20
- }
21
-
22
- exports.getStructures = getStructures;
23
- exports.locationToEndpoint = locationToEndpoint;
@@ -1 +0,0 @@
1
- import{getFloorAt as o,getFloor as t}from"../../../src/utils/geom.js";const n=async o=>o.bus.get("venueData/getVenueData").then((o=>o.structures));async function i(i,r){if(r.poiId)return i.bus.get("wayfinder/getNavigationEndpoint",{ep:r.poiId});const{lat:l,lng:a,ord:e,floorId:d,title:u=""}=r,s=await n(i),f=void 0!==e?o(s,l,a,e):t(s,d);if(void 0!==e)return{lat:l,lng:a,ordinal:e,floorId:f?f.id:null,title:u};if(!f)throw Error("Call to locationToEndpoint with no ordinal and no floorId (or an invalid one): "+d);return{lat:l,lng:a,floorId:d,ordinal:f.ordinal,title:u}}export{n as getStructures,i as locationToEndpoint};