atriusmaps-node-sdk 3.3.917 → 3.3.918

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.
@@ -1 +1 @@
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){i.bus.on("clientAPI/destroy",async()=>i.destroy()),i.bus.on("clientAPI/getDirections",async({from:n,to:s,accessible:a,queueTypes:o})=>{const c=await t(i,n),r=await t(i,s),m={requiresAccessibility:!!a};return o&&(m.selectedSecurityLanes={SecurityLane:o}),i.bus.get("wayfinder/getRoute",{fromEndpoint:c,toEndpoint:r,options:m}).then(e.pick(["distance","time","steps","navline","waypoints"]))}),i.bus.on("clientAPI/getDirectionsMultiple",async({locations:n,accessible:s,queueTypes:a})=>{const o=await Promise.all(n.map(async e=>t(i,e))),c={requiresAccessibility:!!s};a&&(c.selectedSecurityLanes={SecurityLane:a});const r=await Promise.all(e.aperture(2,o).map(async e=>i.bus.get("wayfinder/getRoute",{fromEndpoint:e[0],toEndpoint:e[1],options:c}))),m=e.map(e.pick(["distance","time","steps","navline","waypoints"]),r);return{total:{distance:e.sum(e.map(e=>e.distance,m)),time:e.sum(e.map(e=>e.time,m))},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}));const s=e=>"function"!=typeof e;i.bus.on("clientAPI/getVenueData",async()=>{const t=await i.bus.get("venueData/getVenueData");return e.filter(s,t)}),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);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};
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 +1 @@
1
- import{throttle as e}from"throttle-debounce";import{getStructureAndFloorAtPoint as o}from"../../../src/utils/geom.js";import t from"../../../src/utils/observable.js";import{headlessCommands as n,handleHeadless as s}from"./sdkHeadless.js";let a=null;function r(e,o){return"null"===e?"null-origin":e===o?"same-origin":"cross-origin"}function i(e,{messageType:o,senderOrigin:t,command:n,iframeOrigin:s}){e.send("appInsights/log",{name:"browserMessageObserved",properties:{command:n,deploymentHost:window.location.host,iframeOrigin:s,messageType:o,relation:r(t,s),senderOrigin:t,wouldRejectCrossOrigin:!l(t,s)}})}function l(e,o){return e===o}function d(e){const o=(e,o)=>{const t={payload:e,type:"LL-server"};o&&(t.clientMsgId=o);try{window.postMessage(t,"*")}catch{window.postMessage((e=>JSON.parse(JSON.stringify(e)))(t),"*")}};function t(t){const n=t.data;if(n&&"LL-client"===n.type){const s=window.location.origin;if(i(e.bus,{messageType:"LL-client",senderOrigin:t.origin,command:n.payload?.command,iframeOrigin:s}),!l(t.origin,s))return;e.bus.get("clientAPI/execute",n.payload).then(e=>o(e,n.msgId)).catch(o=>{e.config.debug&&console.error(o),((e,o)=>{const t={error:!0,payload:e,type:"LL-server"};o&&(t.clientMsgId=o),window.postMessage(t,"*")})(o.message,n.msgId)})}}return a&&a(),window.addEventListener("message",t),a=()=>window.removeEventListener("message",t),(e,o)=>{const t={event:e,payload:o,type:"LL-server"};window.postMessage(t,"*")}}async function m(a,r){const i=a.env.isBrowser?d(a):function(e){const o=t();return e.eventListener=o,(e,t)=>o.fire(e,t)}(a);return function(t,n){t.bus.monitor("map/userMoveStart",async({pitch:e,zoom:o,bearing:s})=>{const{lat:a,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");n("userMoveStart",{lat:a,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:o,bearing:s})}),t.bus.monitor("map/userMoving",e(500,async({pitch:e,zoom:o,bearing:s})=>{const{lat:a,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");n("userMoving",{lat:a,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:o,bearing:s})})),t.bus.monitor("map/moveEnd",async({pitch:e,zoom:o,bearing:s})=>{const{lat:a,lng:r,floorId:i,ordinal:l,structureId:d}=await t.bus.get("map/getMapCenter");n("moveEnd",{lat:a,lng:r,floorId:i,ord:l,structureId:d,pitch:e,zoom:o,bearing:s})}),t.bus.monitor("map/floorChanged",({structure:e,floor:o})=>n("levelChange",{floorId:o?o.id:null,floorName:o?o.name:null,ord:o?o.ordinal:null,structureId:e?e.id:null,structureName:e?e.name:null})),t.bus.monitor("map/poiClicked",({poi:e})=>n("poiSelected",e)),t.bus.monitor("poiDetails/showPoi",({poi:e})=>n("poiShown",e)),t.bus.monitor("map/click",async({lat:e,lng:s,ord:a})=>{const r=await t.bus.get("venueData/getStructures"),i=await t.bus.get("map/getViewBBox"),{building:l,floor:d}=o(r,e,s,a,i,!0);n("mapClicked",{lat:e,lng:s,ord:a,building:l,floor:d})})}(a,i),{init:async()=>{!function(e){e.bus.send("clientAPI/registerCustomType",{name:"latLngOrdLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"ord",type:"integer"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"latLngFloorLocation",spec:{type:"object",props:[{name:"lat",type:"float"},{name:"lng",type:"float"},{name:"floorId",type:"string"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"poiIdLocation",spec:{type:"object",props:[{name:"poiId",type:"integer",min:0}]}}),e.bus.send("clientAPI/registerCustomType",{name:"location",spec:{type:"multi",types:[{type:"poiIdLocation"},{type:"latLngOrdLocation"},{type:"latLngFloorLocation"}]}}),e.bus.send("clientAPI/registerCustomType",{name:"viewSettings",spec:{type:"object",props:[{name:"zoom",type:"float",optional:!0},{name:"pitch",type:"float",optional:!0},{name:"bearing",type:"float",optional:!0}]}})}(a),n.forEach(e=>a.bus.send("clientAPI/registerCommand",e)),s(a),r.headless||await import("../../../_virtual/_empty_module_placeholder.js").then(e=>{e.visualCommands.forEach(e=>a.bus.send("clientAPI/registerCommand",e)),e.handleVisual(a,i)});const e=async()=>{await a.bus.send("system/readywhenyouare"),a.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then(e=>i("ready",{commandJSON:e})),!r.headless&&a.config.uiHide&&a.config.uiHide.sidebar&&a.env.isDesktop()&&a.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}})};r.headless?Promise.all([new Promise(e=>a.bus.monitor("venueData/navGraphLoaded",e)),new Promise(e=>a.bus.monitor("venueData/poiDataLoaded",e))]).then(e):a.bus.on("map/mapReadyToShow",e),a.bus.on("sdkServer/sendEvent",({eventName:e,...o})=>i(e,o))}}}export{m as create,r as describeMessageRelation,l as isSameOriginBrowserMessage,i as logBrowserMessageTelemetry};
1
+ import{throttle as e}from"throttle-debounce";import{getStructureAndFloorAtPoint as o}from"../../../src/utils/geom.js";import n from"../../../src/utils/observable.js";import{headlessCommands as t,handleHeadless as a}from"./sdkHeadless.js";let i=null;function r(e,o){return"null"===e?"null-origin":e===o?"same-origin":"cross-origin"}function s(e,o){e.send("appInsights/log",{name:"browserMessageObserved",properties:{command:o.command,deploymentHost:window.location.host,iframeOrigin:o.iframeOrigin,messageType:o.messageType,relation:r(o.senderOrigin,o.iframeOrigin),senderOrigin:o.senderOrigin,wouldRejectCrossOrigin:!l(o.senderOrigin,o.iframeOrigin)}})}function l(e,o){return e===o}function m(e){const o=(e,o)=>{const n={payload:e,type:"LL-server",clientMsgId:o};try{window.postMessage(n,"*")}catch{window.postMessage((t=n,JSON.parse(JSON.stringify(t))),"*")}var t},n=n=>{const t=n.data;if(!t||"LL-client"!==t.type)return;const a=window.location.origin;s(e.bus,{messageType:"LL-client",senderOrigin:n.origin,command:t.payload?.command,iframeOrigin:a}),l(n.origin,a)&&e.bus.get("clientAPI/execute",t.payload).then(e=>o(e,t.msgId)).catch(o=>{var n,a;e.config.debug&&console.error(o),n=o.message,a=t.msgId,window.postMessage({error:!0,payload:n,type:"LL-server",clientMsgId:a},"*")})};return i&&i(),window.addEventListener("message",n),i=()=>window.removeEventListener("message",n),(e,o)=>{window.postMessage({event:e,payload:o,type:"LL-server"},"*")}}async function d(i,r){const s=i.env.isBrowser?m(i):function(e){const o=n();return e.eventListener=o,(e,n)=>o.fire(e,n)}(i);return function(n,t){const a=async(e,o)=>{const{lat:a,lng:i,floorId:r,ordinal:s,structureId:l}=await n.bus.get("map/getMapCenter");t(e,{lat:a,lng:i,floorId:r,ord:s,structureId:l,...o})};n.bus.monitor("map/userMoveStart",e=>{a("userMoveStart",e)}),n.bus.monitor("map/userMoving",e(500,e=>{a("userMoving",e)})),n.bus.monitor("map/moveEnd",e=>{a("moveEnd",e)}),n.bus.monitor("map/floorChanged",({structure:e,floor:o})=>t("levelChange",{floorId:o?.id??null,floorName:o?.name??null,ord:o?.ordinal??null,structureId:e?.id??null,structureName:e?.name??null})),n.bus.monitor("map/poiClicked",({poi:e})=>t("poiSelected",e)),n.bus.monitor("poiDetails/showPoi",({poi:e})=>t("poiShown",e)),n.bus.monitor("map/click",async({lat:e,lng:a,ord:i})=>{const r=await n.bus.get("venueData/getStructures"),s=await n.bus.get("map/getViewBBox"),{building:l,floor:m}=o(r,e,a,i,s,!0);t("mapClicked",{lat:e,lng:a,ord:i,building:l,floor:m})})}(i,s),{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(o=>{e.bus.send("clientAPI/registerCustomType",o)})}(i),t.forEach(e=>i.bus.send("clientAPI/registerCommand",e)),a(i),r.headless||await import("../../../_virtual/_empty_module_placeholder.js").then(e=>{e.visualCommands.forEach(e=>i.bus.send("clientAPI/registerCommand",e)),e.handleVisual(i,s)});const e=async()=>{await i.bus.send("system/readywhenyouare"),i.bus.get("clientAPI/execute",{command:"getCommandJSON"}).then(e=>s("ready",{commandJSON:e})),!r.headless&&i.config.uiHide?.sidebar&&i.env.isDesktop()&&i.bus.send("map/changePadding",{padding:{left:55,right:55,top:72,bottom:22}})};r.headless?Promise.all([new Promise(e=>i.bus.monitor("venueData/navGraphLoaded",e)),new Promise(e=>i.bus.monitor("venueData/poiDataLoaded",e))]).then(e):i.bus.on("map/mapReadyToShow",e),i.bus.on("sdkServer/sendEvent",({eventName:e,...o})=>s(e,o))}}}export{d as create,r as describeMessageRelation,l as isSameOriginBrowserMessage,s as logBrowserMessageTelemetry};
@@ -1 +1 @@
1
- const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",waypoints:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",accountId:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",visualTest:"mapRenderer",refInstallId:"analytics2",disableZoomToExplorePopup:"levelIndicator"};function o(o,n,r){if(n.has("lldebug"))try{o.debug=JSON.parse(n.get("lldebug")),null===o.debug&&(o.debug={})}catch{o.debug=!0}return Object.keys(e).forEach(i=>{if(n.has(i)){let a=e[i];Array.isArray(a)||(a=[a]),a.forEach(e=>{let a=o.plugins[e];!a&&r&&(a=o.plugins[e]={}),a.deepLinkProps={...a.deepLinkProps,[i]:n.get(i)}})}}),n.has("poiId")&&n.has("showNav")&&delete o.plugins["online/poiView"].deepLinkProps.poiId,o}export{o as setDeepLinksForParms};
1
+ const e={navFrom:"online/getDirectionsFromTo",navTo:"online/getDirectionsFromTo",waypoints:"online/getDirectionsFromTo",accessible:"online/getDirectionsFromTo",showNav:"online/getDirectionsFromTo",poiId:["online/getDirectionsFromTo","online/poiView"],vid:"venueDataLoader",stage:"venueDataLoader",contentStage:"venueDataLoader",accountId:"venueDataLoader",search:"online/headerOnline",ho:["online/getDirectionsFromTo","analytics2"],home:"online/homeView",zoom:"mapRenderer",pitch:"mapRenderer",bearing:"mapRenderer",lat:"mapRenderer",lng:"mapRenderer",radius:"mapRenderer",buildingId:"mapRenderer",floorId:"mapRenderer",visualTest:"mapRenderer",refInstallId:"analytics2",disableZoomToExplorePopup:"levelIndicator"};function n(n,o,r=!1){if(o.has("lldebug"))try{const e=JSON.parse(o.get("lldebug")??"null");n.debug=null===e?{}:e}catch{n.debug=!0}return Object.keys(e).forEach(i=>{if(!o.has(i))return;const a=e[i];(Array.isArray(a)?a:[a]).forEach(e=>{let a=n.plugins[e];!a&&r&&(a=n.plugins[e]={}),a&&(a.deepLinkProps={...a.deepLinkProps,[i]:o.get(i)})})}),o.has("poiId")&&o.has("showNav")&&delete n.plugins["online/poiView"]?.deepLinkProps?.poiId,n}export{n as setDeepLinksForParms};
@@ -1 +1 @@
1
- import*as e from"ramda";import"zousan";function o(o,r,n){const p=JSON.parse(r);return Object.keys(p).forEach(r=>{const s=p[r];let t=o.plugins[r];if(!t&&n&&(t=o.plugins[r]={}),t){const o=t.deepLinkProps;t.deepLinkProps=o?e.mergeDeepRight(o,s):s}}),o}export{o as setStateFromStateString};
1
+ import*as e from"ramda";import"zousan";function r(r,n,o=!1){const t=JSON.parse(n);return Object.keys(t).forEach(n=>{const p=t[n];let s=r.plugins[n];if(!s&&o&&(s=r.plugins[n]={}),!s)return;const i=s.deepLinkProps;s.deepLinkProps=i?e.mergeDeepRight(i,p):p}),r}export{r as setStateFromStateString};
@@ -1 +1 @@
1
- function t(t){this._observers.splice(this._observers.indexOf(t),1)}function e(t){const e=s();return this.observe(function(...r){t.apply(this,r)&&e.fire(...r)}),e}function r(t){return e.call(this,function(e){return t===e})}const n={detach:t,filter:e,fire:function(...t){const e=this._observers;if(e){for(let r=0;r<e.length;r++)try{e[r].apply(this,t)}catch(t){console.error(t)}return this}},observe:function(e){return this._observers||(this._observers=[]),this._observers.push(e),{detach:t.bind(this,e),ob:this}},on:function(t,e){return r.call(this,t).observe(e)}};function s(t){return t?function(t,e){for(const r in e)t[r]=e[r];return t}(t,n):Object.create(n)}export{s as default};
1
+ function t(t){this._observers?.splice(this._observers.indexOf(t),1)}function e(t){const e=n();return this.observe(function(...r){t.apply(this,r)&&e.fire(...r)}),e}function r(t){return e.call(this,function(e){return t===e})}const s={detach:t,filter:e,fire:function(...t){const e=this._observers;if(e){for(let r=0;r<e.length;r++)try{e[r].apply(this,t)}catch(t){console.error(t)}return this}},observe:function(e){return this._observers||(this._observers=[]),this._observers.push(e),{detach:t.bind(this,e),ob:this}},on:function(t,e){return r.call(this,t).observe(e)}};function n(t){return t?(e=t,r=s,Object.assign(e,r)):Object.create(s);var e,r}export{n as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.917",
3
+ "version": "3.3.918",
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",