atriusmaps-node-sdk 3.3.1118 → 3.3.1120
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.
- package/dist/cjs/package.json.js +1 -1
- package/dist/cjs/plugins/venueDataLoader/src/fixedOffsetZones.js +22 -0
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +2 -1
- package/dist/package.json.js +1 -1
- package/dist/plugins/venueDataLoader/src/fixedOffsetZones.js +1 -0
- package/dist/plugins/venueDataLoader/src/venueDataLoader.js +1 -1
- package/package.json +1 -1
package/dist/cjs/package.json.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FIXED_OFFSET_ZONES = {
|
|
4
|
+
// Each of these stayed on its 2026 summer offset and skips the 2026-11-01 fall-back.
|
|
5
|
+
// Browsers with tzdata older than the listed release still fall back.
|
|
6
|
+
// British Columbia: permanent UTC−7 (tzdata 2026b, 2026-04-22)
|
|
7
|
+
"America/Vancouver": "Etc/GMT+7",
|
|
8
|
+
// Alberta, plus most of the Northwest Territories: permanent UTC−6 (tzdata 2026c, 2026-07-08)
|
|
9
|
+
"America/Edmonton": "Etc/GMT+6",
|
|
10
|
+
// Northwest Territories (Inuvik): permanent UTC−6 (tzdata 2026d, 2026-09-11)
|
|
11
|
+
"America/Inuvik": "Etc/GMT+6",
|
|
12
|
+
// Manitoba: permanent UTC−5 (tzdata 2026e, 2026-09-29)
|
|
13
|
+
"America/Winnipeg": "Etc/GMT+5"
|
|
14
|
+
};
|
|
15
|
+
function resolveVenueTimezone(tz) {
|
|
16
|
+
if (!tz || !FIXED_OFFSET_ZONES[tz]) {
|
|
17
|
+
return tz;
|
|
18
|
+
}
|
|
19
|
+
return FIXED_OFFSET_ZONES[tz];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.resolveVenueTimezone = resolveVenueTimezone;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var R = require('ramda');
|
|
4
4
|
var Zousan = require('zousan');
|
|
5
|
+
var fixedOffsetZones = require('./fixedOffsetZones.js');
|
|
5
6
|
var venueLoadingUtils = require('./venueLoadingUtils.js');
|
|
6
7
|
|
|
7
8
|
function _interopNamespaceDefault(e) {
|
|
@@ -283,7 +284,7 @@ async function create(app, config) {
|
|
|
283
284
|
app.bus.on("venueData/getVenueData", () => venueDataLoaded);
|
|
284
285
|
app.bus.on("venueData/getVenueName", getVenueDataProp("name"));
|
|
285
286
|
app.bus.on("venueData/getVenueCategory", getVenueDataProp("category"));
|
|
286
|
-
app.bus.on("venueData/getVenueTimezone",
|
|
287
|
+
app.bus.on("venueData/getVenueTimezone", () => venueDataLoaded.then((venueData) => fixedOffsetZones.resolveVenueTimezone(venueData.tz)));
|
|
287
288
|
app.bus.on("venueData/getAccountId", () => config.accountId);
|
|
288
289
|
app.bus.on("venueData/getVenueId", getVenueDataProp("id"));
|
|
289
290
|
app.bus.on("venueData/getPositioningSupported", getVenueDataProp("positioningSupported"));
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a="3.3.
|
|
1
|
+
var a="3.3.1120",e={version:a};export{e as default,a as version};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const c={"America/Vancouver":"Etc/GMT+7","America/Edmonton":"Etc/GMT+6","America/Inuvik":"Etc/GMT+6","America/Winnipeg":"Etc/GMT+5"};function n(n){return n&&c[n]?c[n]:n}export{n as resolveVenueTimezone};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import t from"zousan";import{fetchStyleDoc as
|
|
1
|
+
import*as e from"ramda";import t from"zousan";import{resolveVenueTimezone as a}from"./fixedOffsetZones.js";import{fetchStyleDoc as n,normalizeCoords as s,getVenueDataFromUrls as r,buildStructures as u,createFetchJson as o,createFetchText as i,createFetchManifestJson as d}from"./venueLoadingUtils.js";async function l(l,c){const p=l.log.sublog("venueDataLoader");let v=new t,g=new t;const f=t=>t.defaultStructureId||e.path(["structureOrder",0],t)||e.path(["selectorOrder",0],t)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(t),b=(e,t)=>e.split("").reduce((a,n,s)=>e.substring(0,s+1)===t.substring(0,s+1)?s:a,-1)+1,m=e=>((e,t)=>Object.values(e.venueList).filter(e=>e.locale===t).sort((t,a)=>b(a.id,e.id)-b(t.id,e.id)).at(0))(e,"en")?.id;async function h(t,a){const n=o(),s=i(),c=d(t.auth,e=>l.bus.send("venueData/authError",{reason:"signedManifestForbidden",status:e})),p=await r(t,n,a,c),{accountId:g,venueId:b}=t;return p.assetStage=t.assetStage,p.defaultOrdinal=p.defaultOrdinal||function(t){const a=f(t),n=Object.values(t.structures).find(e.propEq(a,"id"));return n.levels[n.defaultLevelId].ordinal}(p),p.structures=u(p),p.baseVenueId=m(p),p.getTranslatedContentPath=e=>`https://content.locuslabs.com/${p.category}/${e}/${b}/${g}`,p.fetchJson=n,p.fetchText=s,l.config.debug&&l.env.isBrowser&&(window._venueData=p),p.queueTypes&&(p.securityQueueTypes=(()=>{const e=p.queueTypes.find(e=>"SecurityLane"===e.id);return e?e.subtypes.map(e=>e.id):[]})()),l.bus.send("venueData/venueDataLoaded",{venueData:p}),v.resolve(p),v}function y(e){const t={id:"venueDataLoader"};return e.id!==c.venueId&&(t.vid=e.id),t.lang=l.i18n().language,"prod"!==e.assetStage&&(t.stage=e.assetStage),l.bus.send("deepLinking/notifyState",t),e}l.bus.on("debugTools/fileDrop",async({file:e,content:t})=>{if("application/json"===e.type){const e=JSON.parse(t);if(e.basemap&&e["basemap.venue"])return n=JSON.parse(t),void l.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return a=t,void l.bus.send("map/replaceStyle",{styleSrc:a})}var a,n});async function D(e){const t={...e},a=await l.bus.get("poi/getAll");return Object.values(t).forEach(e=>e.filter(e=>"poi"===e.properties.aiLayer&&"Point"===e.geometry.type).forEach(e=>{const t=a[e.properties.id];t?t.mapLabel?e.properties.text=t.mapLabel:!1!==c.copyPOINamesToMap&&(e.properties.text=function(e){let t=e.name;return c.poiMapNameXForm?(Object.keys(c.poiMapNameXForm).filter(t=>((e,t)=>e===t||0===e.indexOf(t+"."))(e.category,t)).forEach(e=>{c.poiMapNameXForm[e].forEach(e=>t=t.replace(new RegExp(e.replace),e.with))}),t):t}(t)):p.warn(`Unknown poi in style: ${e.properties.id}`)})),t}async function I(a){return e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.keys),e.prepend(a.id),e.map(e=>a.files.geoJson.replace("${geoJsonId}",e)),e.map(a.fetchJson),e.map(e.andThen(e=>[e.id,w(e.id,e.features,a.id,a.structures)])),e=>t.all(e),e.andThen(e.fromPairs))(a)}const w=(t,a,n,s)=>{const r=t.replace(/-[^-]*$/,""),u=r===n?"landscape-background":`ordinal: ${s.find(e.hasPath(["levels",t])).levels[t].ordinal}`;return a.map(a=>{var s,o,i;return s="properties",o={venueId:n,structureId:r,ordinalId:u,levelId:t},i=a,a=e.over(e.lensProp(s),t=>e.mergeRight(t||{},o),i),a=e.assoc("id",a.properties.subid,a)})};l.bus.on("venueData/loadMap",async()=>{v.then(async e=>{const t=e.files.spritesheet,a=e.files.glyphs,{id:s,bounds:r,structures:u,venueCenter:o,venueRadius:i,defaultOrdinal:d}=e,[p,v,f]=await Promise.all([n(e.baseVenueId,e.category),e.fetchJson(e.files.theme),e.venueList[s].mapTokens?Promise.resolve({[s]:[]}):I(e).then(D)]),b={mapFeatures:f,mapStyleSource:p,mapTheme:v,badgesSpriteUrl:t,mapGlyphsUrl:a,structures:u,defaultOrdinal:d,venueBounds:{n:r.ne.lat,s:r.sw.lat,e:r.ne.lng,w:r.sw.lng},venueId:s,venueCenter:o,venueRadius:i,accountId:c.accountId,secure:void 0!==c.auth,tileServerAuthInfo:e.tileServerAuthInfo};g.resolve(b),l.bus.send("venueData/mapDataLoaded",b)})});const O=e=>null==e.shouldDisplay||e.shouldDisplay;l.bus.on("venueData/loadBuildingSelectorData",()=>v.then(async t=>{const a={buildings:t.structures.filter(O).map(e.evolve({levels:e.pipe(e.values,e.sortWith([e.descend(e.prop("ordinal"))]))})),structureOrder:t.structureOrder,selectorOrder:t.selectorOrder};return l.bus.send("venueData/buildingSelectorDataLoaded",a),a})),l.bus.on("venueData/normalizeCoords",({coords:e})=>v.then(t=>s(e,t.bounds)));const S={edges:[],nodes:[]};l.bus.on("venueData/loadNavGraph",async()=>v.then(async e=>{const t={navGraphData:e.files.nav?await e.fetchJson(e.files.nav):S,structures:e.structures};return l.bus.send("venueData/navGraphLoaded",t),t})),l.bus.on("venueData/loadPoiData",async()=>v.then(async e=>{const t=c.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld;if(t){const a=await e.fetchJson(t);l.bus.send("venueData/poiDataLoaded",{pois:a,structures:e.structures})}})),l.bus.on("venueData/getVenueCenter",async()=>v.then(async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))),l.bus.on("venueData/getContentUrl",({type:e,name:t=""})=>v.then(a=>a.files[e]+t)),l.bus.on("venueData/getFloorIdToNameMap",()=>v.then(e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.values),e.map(e.props(["id","name"])),e.fromPairs))),l.bus.on("venueData/getFloorIdName",({floorId:t})=>v.then(async a=>{const n=e.pipe(e.values,e.find(e.hasPath(["levels",t])))(a.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[t].name}:null}));const T=(t,a)=>()=>v.then(e.pipe(e.prop(t),e.defaultTo(a)));function P(e,t){const a=L(t);if(a.includes(e))return e;const n=e.split("-").slice(1).join("-");return a.find(e=>new RegExp(`${t.baseVenueId}.?.?-${n}`).test(e))}l.bus.on("venueData/getVenueData",()=>v),l.bus.on("venueData/getVenueName",T("name")),l.bus.on("venueData/getVenueCategory",T("category")),l.bus.on("venueData/getVenueTimezone",()=>v.then(e=>a(e.tz))),l.bus.on("venueData/getAccountId",()=>c.accountId),l.bus.on("venueData/getVenueId",T("id")),l.bus.on("venueData/getPositioningSupported",T("positioningSupported")),l.bus.on("venueData/getStructures",T("structures")),l.bus.on("venueData/loadNewVenue",async({venueId:e,accountId:a,assetStage:n=c.assetStage})=>{v.reject(new Error("loadNewVenue called - previous loading ignored")),g.reject(new Error("loadNewVenue called - previous loading ignored")),v=new t,g=new t,h({...c,venueId:e,accountId:a,assetStage:n},[]).then(y)}),l.bus.on("venueData/getPoiImageUrl",({imageName:e,size:t})=>`https://img.locuslabs.com/resize/${c.accountId}/png/transparent/${t}contain/poi/${e}`),l.bus.on("venueData/getDistributionId",()=>v.then(e=>`${e.baseVenueId}-${c.accountId}`)),l.bus.on("venueData/getCustomKeywords",()=>v.then(e=>{const t=c.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(t)})),l.bus.on("venueData/isGrabEnabled",T("enableGrab")),l.bus.on("venueData/getGrabPoiIds",T("grabPoiIds",[])),l.bus.on("venueData/getAssetsTimestamp",T("version")),l.bus.on("venueData/getTranslatedFloorId",async({floorId:e})=>v.then(t=>P(e,t)));const L=e=>e.structures.reduce((e,t)=>e.concat(Object.keys(t.levels)),[]);l.bus.on("venueData/getQueueTypes",()=>v.then(e=>{const t=["tsapre","clear","globalEntry"];return e.queueTypes?e.queueTypes.reduce((e,a)=>{const{id:n,subtypes:s}=a,r=s.map(e=>{const a=t.includes(e.id)&&`security-logo-${e.id.toLowerCase()}`;return{...e,imageId:a}});return e[n]=r,e},{}):{}}));return{init:async()=>{let e=[];null===new URLSearchParams("undefined"==typeof window?"":window.location.search).get("lang")&&(e="undefined"==typeof window?[]:navigator.languages);const t=c.deepLinkProps||{};t.lang&&e.unshift(t.lang);const a=t.vid||c.venueId,n=c.useDynamicUrlParams&&t.stage?t.stage:c.assetStage,s=t.accountId||("alpha"===n?"A1VPTJKREFJWX5":c.accountId);h({...c,venueId:a,accountId:s,assetStage:n},e).then(y)},runTest:async({testRoutine:e,reset:a=!1,venueData:n=null})=>{let s,r;return(a||n)&&(v=new t,g=new t),n&&(v=t.resolve(n)),await e(),v.v&&(s=await v),g.v&&(r=await g),{venueDataObj:s,mapDataObj:r}},internal:{calculateBaseVenueId:m,getDefaultStructureId:f,getTranslatedFloorId:P,setConfigProperty:(e,t)=>{c[e]=t}}}}export{l as create};
|
package/package.json
CHANGED