atriusmaps-node-sdk 3.3.893 → 3.3.895

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.893";
6
+ var version = "3.3.895";
7
7
  var license = "UNLICENSED";
8
8
  var type = "module";
9
9
  var main = "src/main.ts";
@@ -135,17 +135,17 @@ function create(app, config = {}) {
135
135
  }
136
136
 
137
137
  /**
138
- * Extracts `dynamicAttributes.name` overrides from each POI in the API response and emits
139
- * `poi/setCoreAttributes` for any changes. A `null` name signals a revert to the original value.
138
+ * Extracts `dynamicData.poiAttributes.name` overrides from each POI in the API response and emits
139
+ * `poi/setCoreAttributes` and `map/mutateFeature` for any changes. A `null` name signals a revert to the original value.
140
140
  * Only emits when a value actually changes to avoid unnecessary downstream updates.
141
141
  *
142
142
  * @param {Object} poiDataMap - The `data` map from the /dynamic-poi API response
143
143
  */
144
- function processDynamicAttributes(poiDataMap) {
144
+ async function processDynamicAttributes(poiDataMap) {
145
145
  const updates = {};
146
146
 
147
147
  for (const [poiId, poiData] of Object.entries(poiDataMap)) {
148
- const name = poiData?.dynamicAttributes?.name ?? null;
148
+ const name = poiData?.dynamicData?.poiAttributes?.name ?? null;
149
149
  const previous = previousNameOverrides.get(poiId); // undefined if never tracked
150
150
 
151
151
  if (previous === undefined) {
@@ -171,6 +171,10 @@ function create(app, config = {}) {
171
171
 
172
172
  if (Object.keys(updates).length > 0) {
173
173
  app.bus.send('poi/setCoreAttributes', updates);
174
+ const originalNames = await getPoiOriginalNames(Object.keys(updates));
175
+ app.bus.send('map/mutateFeature', {
176
+ functor: processors.mutatePoiName(T, updates, originalNames),
177
+ });
174
178
  }
175
179
  }
176
180
 
@@ -190,6 +194,17 @@ function create(app, config = {}) {
190
194
  return nameMap;
191
195
  };
192
196
 
197
+ const getPoiOriginalNames = async idArray => {
198
+ const nameMap = {};
199
+ for (const poiId of idArray) {
200
+ const poi = await app.bus.get('poi/getById', { id: poiId });
201
+ if (poi) {
202
+ nameMap[poiId] = poi._originalName ?? poi.name;
203
+ }
204
+ }
205
+ return nameMap;
206
+ };
207
+
193
208
  /*
194
209
  API response: https://gitlab.com/locuslabs/core-data-team/json-schemas/-/blob/develop/src/api-marketplace/dynamic-queue-data.json
195
210
  */
@@ -41,6 +41,24 @@ const mutateSecurityCheckpointLabel = (T, queueTimes, labels) => feature => {
41
41
  return feature;
42
42
  };
43
43
 
44
+ const mutatePoiName = (_T, nameOverrides, originalNames) => feature => {
45
+ const id = feature.properties?.id;
46
+ const override = id !== undefined && nameOverrides?.[String(id)];
47
+ if (!override) {
48
+ return feature;
49
+ }
50
+ const { name } = override;
51
+ if (name === null) {
52
+ const original = originalNames?.[String(id)];
53
+ if (original) {
54
+ feature.properties.text = original;
55
+ }
56
+ } else {
57
+ feature.properties.text = name;
58
+ }
59
+ return feature;
60
+ };
61
+
44
62
  const processParkingPOIS = poiMap => {
45
63
  const idValuesMap = R__namespace.pipe(
46
64
  R__namespace.filter(poi => poi.category === 'parking'),
@@ -109,6 +127,7 @@ const processRoutingPois = poiMap => {
109
127
  }, poiMap);
110
128
  };
111
129
 
130
+ exports.mutatePoiName = mutatePoiName;
112
131
  exports.mutateSecurityCheckpointLabel = mutateSecurityCheckpointLabel;
113
132
  exports.processOpenClosedPois = processOpenClosedPois;
114
133
  exports.processParkingPOIS = processParkingPOIS;
@@ -98,11 +98,15 @@ function mapFlightDetails(nowDate, flight, T, tz, locale) {
98
98
  // used to sort flights in ASCENDING order of flight arrival/departure time
99
99
  const flightComparator = (flight1, flight2) => flight1.dateStamp - flight2.dateStamp;
100
100
 
101
+ // Matches gate identifiers: optional letter prefix + digits + optional letter suffix (e.g. "B54", "23", "B32a")
102
+ const gateNameRegex = /[A-Z]?\d+[a-zA-Z]?/;
103
+
101
104
  const formatGate = gate => {
102
105
  if (!gate) {
103
106
  return { name: '-' };
104
107
  }
105
- const name = R.last(gate.name.split(' '));
108
+ const match = gate.name.match(gateNameRegex);
109
+ const name = match ? match[0] : gate.name;
106
110
  return { ...gate, name };
107
111
  };
108
112
 
@@ -246,5 +250,7 @@ const getLocalFormattedTime = (dateStr, tz, locale = 'en-US') =>
246
250
 
247
251
  exports.FlightType = FlightType;
248
252
  exports.flightComparator = flightComparator;
253
+ exports.formatGate = formatGate;
254
+ exports.gateNameRegex = gateNameRegex;
249
255
  exports.mapFlightDetails = mapFlightDetails;
250
256
  exports.mapFlightListItem = mapFlightListItem;
@@ -1 +1 @@
1
- var t="web-engine",e="3.3.893",s="UNLICENSED",r="module",o="src/main.ts",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],a={"build-storybook":"storybook build",colors:"cat utils/colors1.txt && node --experimental-strip-types utils/processColors.ts | pbcopy && cat utils/colors2.txt",demo:"cd demo/ && yarn start",dev:"yarn mol e2e","format:check":"yarn prettier . --check","format:fix":"yarn prettier . --write",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh","icons:convert":"node scripts/convertSvgToJsx.mjs",lint:"eslint . --ext .js,.jsx,.ts,.tsx",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol","playwright:ci":"yarn playwright test --grep-invert sdk","playwright:ci:failed":"yarn playwright test --last-failed --grep-invert sdk","playwright:sdk":"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./test/sdk && npx http-server' 8080 'yarn playwright test sdk --ui'","playwright:ui":"yarn playwright test --ui --grep-invert sdk",prepare:"husky",storybook:"storybook dev -p 6006",test:"vitest run --project unit","test-watch":"vitest --watch","test:comp":"vitest run --project browser","test:comp:ci":"vitest run --project browser --reporter=dot","test:comp:ui":"VITE_COMP_UI=1 vitest --project browser --ui --browser.headless=false","test:all":"yarn lint && yarn format:check && yarn test && yarn playwright:ci","test:mod":"playwright test --config=playwright.mod.config.ts",typecheck:"tsc -p tsconfig.checkjs.json"},l=["defaults"],n={"@azure/event-hubs":"^5.12.2","@csstools/normalize.css":"^11.0.1","@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@styled-system/prop-types":"^5.1.5","@turf/area":"^7.2.0","@turf/bbox-clip":"^7.2.0","@turf/bbox-polygon":"^7.2.0","@turf/bearing":"^7.2.0","@turf/circle":"^7.2.0","@turf/helpers":"^7.2.0","@turf/point-to-line-distance":"^7.2.0","@vitejs/plugin-react":"^5.2.0","@zumer/snapdom":"^2.9.0","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1",dompurify:"^3.3.3","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^26.0.0","i18next-browser-languagedetector":"^6.1.1",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^2.9.2","node-polyfill-webpack-plugin":"^4.1.0","path-browserify":"^1.0.1",pmtiles:"^4.4.0","prop-types":"^15.8.1","qrcode.react":"^4.2.0",ramda:"^0.30.1",react:"^19.2.4","react-compound-slider":"^3.4.0","react-dom":"^19.2.4","react-json-editor-ajrm":"^2.5.14","react-svg":"^16.3.0","react-virtualized-auto-sizer":"^1.0.25","react-window":"^1.8.11","smoothscroll-polyfill":"^0.4.4","styled-components":"^6.1.15","styled-normalize":"^8.1.1","styled-system":"^5.1.5","styled-tools":"^1.7.2","throttle-debounce":"^5.0.2",trackjs:"^3.10.4","ua-parser-js":"^0.7.40",uuid:"^11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},p={"@applitools/eyes-playwright":"^1.46.8","@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@playwright/test":"~1.59.1","@storybook/addon-essentials":"^8.6.15","@storybook/blocks":"^8.6.15","@storybook/react":"^8.6.15","@storybook/react-vite":"^8.6.15","@testing-library/dom":"^10.4.1","@testing-library/jest-dom":"^6.6.3","@testing-library/react":"^16.3.0","@testing-library/user-event":"^14.5.2","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","@vitest/browser":"4.1.6","@vitest/browser-playwright":"4.1.6","@vitest/ui":"4.1.6","css-loader":"^7.1.2",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-import-resolver-alias":"^1.1.2","eslint-plugin-playwright":"^2.2.2","eslint-plugin-react":"^7.37.4","eslint-plugin-vitest":"^0.5.4","fetch-mock":"^12.6.0",glob:"^11.0.1",husky:"^9.1.7","lint-staged":"^16.4.0","node-fetch":"^2.7.0",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"^3.8.3","start-server-and-test":"^2.0.11",storybook:"^8.6.15",typescript:"^5.8.2",vite:"^7.3.2",vitest:"^4.1.8","webpack-merge":"^6.0.1"},c="yarn@4.13.0",d={node:"24.x"},y={},u={name:t,version:e,private:!0,license:s,type:r,main:o,workspaces:i,scripts:a,"lint-staged":{"*.{js,ts,tsx}":["eslint --fix","prettier --check"],"*.{json,md,css,ts,tsx,jsx}":["prettier --check"],"src/i18n/**/*.json":["node --experimental-strip-types utils/sort-json.ts","prettier --write"]},browserslist:l,dependencies:n,devDependencies:p,packageManager:c,engines:d,nx:y};export{l as browserslist,u as default,n as dependencies,p as devDependencies,d as engines,s as license,o as main,t as name,y as nx,c as packageManager,a as scripts,r as type,e as version,i as workspaces};
1
+ var t="web-engine",e="3.3.895",s="UNLICENSED",r="module",o="src/main.ts",i=["demo","deploy","nodesdk","src/extModules/flexapi","services/*","libraries/*"],a={"build-storybook":"storybook build",colors:"cat utils/colors1.txt && node --experimental-strip-types utils/processColors.ts | pbcopy && cat utils/colors2.txt",demo:"cd demo/ && yarn start",dev:"yarn mol e2e","format:check":"yarn prettier . --check","format:fix":"yarn prettier . --write",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh","icons:convert":"node scripts/convertSvgToJsx.mjs",lint:"eslint . --ext .js,.jsx,.ts,.tsx",mod:"demo/startMod.sh",mol:"demo/startMol.sh","mol:build":"demo/startMolBuild.sh",molProd:"cd deploy && yarn buildAndRunMol","playwright:ci":"yarn playwright test --grep-invert sdk","playwright:ci:failed":"yarn playwright test --last-failed --grep-invert sdk","playwright:sdk":"yarn start-server-and-test 'cd ./deploy && yarn buildDev && yarn serveLocal' 8085 'cd ./test/sdk && npx http-server' 8080 'yarn playwright test sdk --ui'","playwright:ui":"yarn playwright test --ui --grep-invert sdk",prepare:"husky",storybook:"storybook dev -p 6006",test:"vitest run --project unit","test-watch":"vitest --watch","test:comp":"vitest run --project browser","test:comp:ci":"vitest run --project browser --reporter=dot","test:comp:ui":"VITE_COMP_UI=1 vitest --project browser --ui --browser.headless=false","test:all":"yarn lint && yarn format:check && yarn test && yarn playwright:ci","test:mod":"playwright test --config=playwright.mod.config.ts",typecheck:"tsc -p tsconfig.checkjs.json"},l=["defaults"],n={"@azure/event-hubs":"^5.12.2","@csstools/normalize.css":"^11.0.1","@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@mapbox/mapbox-gl-draw":"^1.5.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.3.6","@styled-system/prop-types":"^5.1.5","@turf/area":"^7.2.0","@turf/bbox-clip":"^7.2.0","@turf/bbox-polygon":"^7.2.0","@turf/bearing":"^7.2.0","@turf/circle":"^7.2.0","@turf/helpers":"^7.2.0","@turf/point-to-line-distance":"^7.2.0","@vitejs/plugin-react":"^5.2.0","@zumer/snapdom":"^2.9.0","axe-core":"^4.10.3",browserslist:"^4.27.0","crypto-browserify":"^3.12.1",dompurify:"^3.3.3","file-loader":"^6.2.0",flexsearch:"^0.7.43","h3-js":"^4.1.0",i18next:"^26.0.0","i18next-browser-languagedetector":"^6.1.1",jsdom:"^25.0.1",jsonschema:"^1.5.0",luxon:"^3.5.0","maplibre-gl":"^4.7.1","mini-css-extract-plugin":"^2.9.2","node-polyfill-webpack-plugin":"^4.1.0","path-browserify":"^1.0.1",pmtiles:"^4.4.0","prop-types":"^15.8.1","qrcode.react":"^4.2.0",ramda:"^0.30.1",react:"^19.2.4","react-compound-slider":"^3.4.0","react-dom":"^19.2.4","react-json-editor-ajrm":"^2.5.14","react-svg":"^16.3.0","react-virtualized-auto-sizer":"^1.0.25","react-window":"^1.8.11","smoothscroll-polyfill":"^0.4.4","styled-components":"^6.1.15","styled-normalize":"^8.1.1","styled-system":"^5.1.5","styled-tools":"^1.7.2","throttle-debounce":"^5.0.2",trackjs:"^3.10.4","ua-parser-js":"^0.7.40",uuid:"^11.1.0",zousan:"^3.0.1","zousan-plus":"^4.0.1"},p={"@applitools/eyes-playwright":"^1.46.8","@axe-core/playwright":"^4.10.2","@azure/identity":"^4.13.0","@azure/playwright":"^1.0.0","@playwright/test":"~1.59.1","@storybook/addon-essentials":"^8.6.15","@storybook/blocks":"^8.6.15","@storybook/react":"^8.6.15","@storybook/react-vite":"^8.6.15","@testing-library/dom":"^10.4.1","@testing-library/jest-dom":"^6.6.3","@testing-library/react":"^16.3.0","@testing-library/user-event":"^14.5.2","@types/react":"^19.0.10","@types/react-dom":"^19.0.4","@typescript-eslint/eslint-plugin":"^8.26.1","@typescript-eslint/parser":"^8.26.1","@vitest/browser":"4.1.6","@vitest/browser-playwright":"4.1.6","@vitest/ui":"4.1.6","css-loader":"^7.1.2",eslint:"^8.57.1","eslint-config-prettier":"^10.1.8","eslint-import-resolver-alias":"^1.1.2","eslint-plugin-playwright":"^2.2.2","eslint-plugin-react":"^7.37.4","eslint-plugin-vitest":"^0.5.4","fetch-mock":"^12.6.0",glob:"^11.0.1",husky:"^9.1.7","lint-staged":"^16.4.0","node-fetch":"^2.7.0",nx:"19.8.14","nx-remotecache-azure":"^19.0.0","os-browserify":"^0.3.0",prettier:"^3.8.3","start-server-and-test":"^2.0.11",storybook:"^8.6.15",typescript:"^5.8.2",vite:"^7.3.2",vitest:"^4.1.8","webpack-merge":"^6.0.1"},c="yarn@4.13.0",d={node:"24.x"},y={},u={name:t,version:e,private:!0,license:s,type:r,main:o,workspaces:i,scripts:a,"lint-staged":{"*.{js,ts,tsx}":["eslint --fix","prettier --check"],"*.{json,md,css,ts,tsx,jsx}":["prettier --check"],"src/i18n/**/*.json":["node --experimental-strip-types utils/sort-json.ts","prettier --write"]},browserslist:l,dependencies:n,devDependencies:p,packageManager:c,engines:d,nx:y};export{l as browserslist,u as default,n as dependencies,p as devDependencies,d as engines,s as license,o as main,t as name,y as nx,c as packageManager,a as scripts,r as type,e as version,i as workspaces};
@@ -1 +1 @@
1
- import e from"zousan";import{processParkingPOIS as t,processOpenClosedPois as n,processSecurityWaitTimes as a,mutateSecurityCheckpointLabel as s,processRoutingPois as o}from"./processors.js";let i=3e4;const c="x-account-id";function r(r,u={}){const l={dynamicDataNotPending:new e},y=r.gt();u._overrideRefreshFrequency&&(i=u._overrideRefreshFrequency);const d=new Map;r.bus.on("system/readywhenyouare",()=>l.dynamicDataNotPending),r.bus.on("dynamicPois/getSecurityWaitTimes",async({isOpen:e}={})=>{const t=await r.bus.get("poi/getAll");return Object.values(t).filter(t=>{return"security.checkpoint"===t.category&&t?.dynamicData?.security&&(n=t?.dynamicData?.security,"object"==typeof n&&null!==n&&!Array.isArray(n))&&(void 0===e||t?.dynamicData?.security?.isTemporarilyClosed!==e);var n}).map(e=>({id:e.poiId,name:e.name,...e.dynamicData.security}))});const m=async e=>{const t={};for(const n of e){const e=await r.bus.get("poi/getById",{id:n});e&&(t[n]=e.name)}return t};return{init:async()=>{const[e,u]=await Promise.all([r.bus.get("venueData/getAccountId"),r.bus.get("venueData/getVenueId")]),p=`https://marketplace.locuslabs.com/venueId/${u}/dynamic-poi`;let f,g=0,b=0;const D=async()=>{const i=await fetch(p,{headers:{[c]:e}});if(i.ok)return i.json().then(({data:e})=>async function(e){(function(e){const n=t(e);r.bus.send("poi/setDynamicData",{plugin:"parking",idValuesMap:n})})(e),function(e){const t=n(e);r.bus.send("poi/setDynamicData",{plugin:"open-closed-status",idValuesMap:t})}(e),async function(e){const t=a(e);r.bus.send("poi/setDynamicData",{plugin:"security",idValuesMap:t});const n=await m(Object.keys(t));r.bus.send("map/mutateFeature",{functor:s(y,t,n)})}(e),async function(e){const t=await o(e);r.bus.send("poi/setDynamicRouting",{plugin:"routing",idValuesMap:t})}(e),function(e){const t={};for(const[n,a]of Object.entries(e)){const e=a?.dynamicAttributes?.name??null,s=d.get(n);void 0===s?null!==e&&(t[n]={name:e},d.set(n,e)):s!==e&&(t[n]={name:e},d.set(n,e))}for(const[n,a]of d.entries())n in e||null===a||(t[n]={name:null},d.set(n,null));Object.keys(t).length>0&&r.bus.send("poi/setCoreAttributes",t)}(e)}(e)).then(()=>{b++}).catch(console.error);console.warn("dynamicPois: fetch response status not ok",i),g++,g>=3&&g>b&&clearInterval(f)};return await D().then(()=>{f=setInterval(D,i),"function"==typeof f.unref&&f.unref()}).finally(()=>l.dynamicDataNotPending.resolve(!0)),()=>clearInterval(f)}}}export{r as create};
1
+ import t from"zousan";import{processParkingPOIS as e,processOpenClosedPois as n,processSecurityWaitTimes as a,mutateSecurityCheckpointLabel as s,processRoutingPois as o,mutatePoiName as i}from"./processors.js";let c=3e4;const r="x-account-id";function u(u,y={}){const l={dynamicDataNotPending:new t},d=u.gt();y._overrideRefreshFrequency&&(c=y._overrideRefreshFrequency);const m=new Map;u.bus.on("system/readywhenyouare",()=>l.dynamicDataNotPending),u.bus.on("dynamicPois/getSecurityWaitTimes",async({isOpen:t}={})=>{const e=await u.bus.get("poi/getAll");return Object.values(e).filter(e=>{return"security.checkpoint"===e.category&&e?.dynamicData?.security&&(n=e?.dynamicData?.security,"object"==typeof n&&null!==n&&!Array.isArray(n))&&(void 0===t||e?.dynamicData?.security?.isTemporarilyClosed!==t);var n}).map(t=>({id:t.poiId,name:t.name,...t.dynamicData.security}))});const p=async t=>{const e={};for(const n of t){const t=await u.bus.get("poi/getById",{id:n});t&&(e[n]=t.name)}return e},f=async t=>{const e={};for(const n of t){const t=await u.bus.get("poi/getById",{id:n});t&&(e[n]=t._originalName??t.name)}return e};return{init:async()=>{const[t,y]=await Promise.all([u.bus.get("venueData/getAccountId"),u.bus.get("venueData/getVenueId")]),g=`https://marketplace.locuslabs.com/venueId/${y}/dynamic-poi`;let b,D=0,h=0;const v=async()=>{const c=await fetch(g,{headers:{[r]:t}});if(c.ok)return c.json().then(({data:t})=>async function(t){(function(t){const n=e(t);u.bus.send("poi/setDynamicData",{plugin:"parking",idValuesMap:n})})(t),function(t){const e=n(t);u.bus.send("poi/setDynamicData",{plugin:"open-closed-status",idValuesMap:e})}(t),async function(t){const e=a(t);u.bus.send("poi/setDynamicData",{plugin:"security",idValuesMap:e});const n=await p(Object.keys(e));u.bus.send("map/mutateFeature",{functor:s(d,e,n)})}(t),async function(t){const e=await o(t);u.bus.send("poi/setDynamicRouting",{plugin:"routing",idValuesMap:e})}(t),async function(t){const e={};for(const[n,a]of Object.entries(t)){const t=a?.dynamicData?.poiAttributes?.name??null,s=m.get(n);void 0===s?null!==t&&(e[n]={name:t},m.set(n,t)):s!==t&&(e[n]={name:t},m.set(n,t))}for(const[n,a]of m.entries())n in t||null===a||(e[n]={name:null},m.set(n,null));if(Object.keys(e).length>0){u.bus.send("poi/setCoreAttributes",e);const t=await f(Object.keys(e));u.bus.send("map/mutateFeature",{functor:i(d,e,t)})}}(t)}(t)).then(()=>{h++}).catch(console.error);console.warn("dynamicPois: fetch response status not ok",c),D++,D>=3&&D>h&&clearInterval(b)};return await v().then(()=>{b=setInterval(v,c),"function"==typeof b.unref&&b.unref()}).finally(()=>l.dynamicDataNotPending.resolve(!0)),()=>clearInterval(b)}}}export{u as create};
@@ -1 +1 @@
1
- import*as t from"ramda";const e=(t,e,a)=>i=>{const r=i.properties.id,o=e[r],n=a[r];if(o){const{queueTime:e,isTemporarilyClosed:a}=o,r=a?t("ui:Closed"):t("ui:_xx_ minute wait",{count:e});i.properties.text=`${n}\n${r}`}return i},a=e=>t.pipe(t.filter(t=>"parking"===t.category),t.map(e=>{const a=e.dynamicAttributes;if(!a)throw Error(`No dynamicAttributes defined for parking POI ${e.poiId}`);return{...(Date.now()-e.timestamp)/1e3<a["parking.timeToLive"]?t.pick(["lotStatus","rateDay","rateHour","timeIsReal","timeToTerminal1","timeToTerminal2"],e):{lotStatus:a["parking.default"],rateDay:"$ -",rateHour:"$ -",timeIsReal:!1},lastUpdated:e.timestamp,lotName:e.lotName}}))(e),i=e=>{const a=["dynamicData","openClosed"],i=t.filter(t.hasPath(a),e),r=t.map(t.path(a),i);if(t.all(t.both(t.has("isOpen"),t.has("expiration")),t.values(r))){const e=t.pipe(t.prop("expiration"),t.lt(Date.now()));return t.filter(e,r)}throw Error("Open Closed poi status is malformed.")},r=e=>{const a=["dynamicData","queue"],i=t.filter(t.hasPath(a),e),r=t.map(t.path(a),i);return t.map(t=>({isTemporarilyClosed:t.isTemporarilyClosed,queueTime:t.queueTime,timeIsReal:!t.isQueueTimeDefault&&t.expiration>Date.now(),lastUpdated:Date.now()}),r)},o=e=>{const a=Date.now();return t.filter(e=>{const i=t.path(["dynamicData","dynamic-routing","navGraphHidden"],e),r=t.path(["dynamicData","dynamic-routing","expiration"],e);return!0===i&&r>a},e)};export{e as mutateSecurityCheckpointLabel,i as processOpenClosedPois,a as processParkingPOIS,o as processRoutingPois,r as processSecurityWaitTimes};
1
+ import*as t from"ramda";const e=(t,e,a)=>i=>{const r=i.properties.id,o=e[r],n=a[r];if(o){const{queueTime:e,isTemporarilyClosed:a}=o,r=a?t("ui:Closed"):t("ui:_xx_ minute wait",{count:e});i.properties.text=`${n}\n${r}`}return i},a=(t,e,a)=>t=>{const i=t.properties?.id,r=void 0!==i&&e?.[String(i)];if(!r)return t;const{name:o}=r;if(null===o){const e=a?.[String(i)];e&&(t.properties.text=e)}else t.properties.text=o;return t},i=e=>t.pipe(t.filter(t=>"parking"===t.category),t.map(e=>{const a=e.dynamicAttributes;if(!a)throw Error(`No dynamicAttributes defined for parking POI ${e.poiId}`);return{...(Date.now()-e.timestamp)/1e3<a["parking.timeToLive"]?t.pick(["lotStatus","rateDay","rateHour","timeIsReal","timeToTerminal1","timeToTerminal2"],e):{lotStatus:a["parking.default"],rateDay:"$ -",rateHour:"$ -",timeIsReal:!1},lastUpdated:e.timestamp,lotName:e.lotName}}))(e),r=e=>{const a=["dynamicData","openClosed"],i=t.filter(t.hasPath(a),e),r=t.map(t.path(a),i);if(t.all(t.both(t.has("isOpen"),t.has("expiration")),t.values(r))){const e=t.pipe(t.prop("expiration"),t.lt(Date.now()));return t.filter(e,r)}throw Error("Open Closed poi status is malformed.")},o=e=>{const a=["dynamicData","queue"],i=t.filter(t.hasPath(a),e),r=t.map(t.path(a),i);return t.map(t=>({isTemporarilyClosed:t.isTemporarilyClosed,queueTime:t.queueTime,timeIsReal:!t.isQueueTimeDefault&&t.expiration>Date.now(),lastUpdated:Date.now()}),r)},n=e=>{const a=Date.now();return t.filter(e=>{const i=t.path(["dynamicData","dynamic-routing","navGraphHidden"],e),r=t.path(["dynamicData","dynamic-routing","expiration"],e);return!0===i&&r>a},e)};export{a as mutatePoiName,e as mutateSecurityCheckpointLabel,r as processOpenClosedPois,i as processParkingPOIS,n as processRoutingPois,o as processSecurityWaitTimes};
@@ -1 +1 @@
1
- import{DateTime as t}from"luxon";import{pick as e,propOr as a,last as r,compose as i,path as l}from"ramda";import{formatTime as s,msToMin as o}from"../../../src/utils/date.js";import{FlightLabelStatus as n}from"../../../utils/constants.js";const m={ARRIVAL:"arr",DEPARTURE:"dep",ALL:"all"};function u(t,e,r,i,l){const{flightId:s,carrierFsCode:o,flightNumber:n,airline:u,flightType:d,departureAirport:g,arrivalAirport:D,airportResources:f,gatePoi:p,status:E}=e,L=A(e),{localTime:C,localOldTime:U}=R(L,i),P=h(d,E,t,C,U),$=d===m.DEPARTURE?"flightDetails:Departs _date_":"flightDetails:Arrives _date_";return{flightId:s,name:`${a("","name",u)} - ${o} ${n}`,status:P,statusText:r(`flightDetails:${T(P)}`),baggageClaim:d===m.ARRIVAL?I(f.arrivalBagClaim,r):void 0,connectionAirport:v(d,g,D,r),time:N(C,i,l),oldTime:N(U,i,l),date:r($,{date:_(C,i,l)}),dateStamp:C.toMillis(),gate:c(p),gateLabel:r("flightDetails:Gate")}}function d(t,r,i,l,s){const{flightNumber:o,flightType:n,departureAirport:u,arrivalAirport:d,airportResources:g,flightStatusUpdates:p,carrierFsCode:E,gatePoi:L,airline:C,status:U}=r,P=e(["city","iata"]),$=A(r),{localTime:y,localOldTime:O}=R($,l),S=h(n,U,t,y,O);return{flightType:n,flightTypeLabel:i(`flightDetails:${n===m.DEPARTURE?"Departure":"Arrival"}`),name:`${a("","name",C)} - ${E} ${o}`,status:S,statusText:i(`flightDetails:${T(S)}`),baggageClaim:n===m.ARRIVAL?I(g.arrivalBagClaim,i):void 0,departure:P(u),arrival:P(d),connectionAirport:v(n,u,d,i),flightIn:D(S,n,t,y,i),time:N(y,l,s),oldTime:N(O,l,s),date:_(y,l,s),lastUpdated:f(t,p,i),flightDuration:"",gateLabel:i("flightDetails:Gate"),gate:c(L),tags:[],flightIconBaseName:n===m.ARRIVAL?"arrivals":"departures"}}const g=(t,e)=>t.dateStamp-e.dateStamp,c=t=>{if(!t)return{name:"-"};const e=r(t.name.split(" "));return{...t,name:e}},D=(t,e,a,r,i)=>{if(t===n.DEPARTED)return i("flightDetails:Departed");if(t===n.ARRIVED)return i("flightDetails:Arrived");if(t===n.CANCELLED)return null;return i(`flightDetails:${e===m.DEPARTURE?"Departs":"Arrives"} in _minutes_ minute`,{count:p(a,r)})},f=(t,e,a)=>{const s=i(l(["updatedAt","dateUtc"]),r)(e),o=p(t,U(s));return o<10?a("flightDetails:Last updated a few minutes ago"):o<60?a("flightDetails:Last updated _minutes_ minutes ago",{minutes:o}):a("flightDetails:Last updated over an hour ago")},p=(t,e)=>{const a=Math.abs(t-e);return o(a)},A=({flightType:t,operationalTimes:e,departureDate:a,arrivalDate:r})=>t===m.DEPARTURE?E(a,e.estimatedGateDeparture):E(r,e.estimatedGateArrival),E=(t,e)=>{const a=t.dateLocal||t.dateUtc,r=e.dateLocal||e.dateUtc;return r&&a!==r?{time:r,oldTime:a}:{time:a}},R=({time:t,oldTime:e},a)=>({localTime:U(t,a),localOldTime:U(e,a)});function h(t,e,a,r,i){return r?a>r?L(t):"C"===(e=e.toUpperCase())?n.CANCELLED:i?r>i?n.DELAYED:n.EARLY:n.ON_TIME:n.UNKNOWN}const T=t=>{switch(t){case n.ON_TIME:return"on-time";case n.EARLY:return"early";case n.DELAYED:return"delayed";case n.CANCELLED:return"cancelled";case n.DEPARTED:return"departed";case n.ARRIVED:return"arrived";default:return"unknown"}},L=t=>t===m.DEPARTURE?n.DEPARTED:n.ARRIVED,v=(t,e,a,r)=>t===m.DEPARTURE?r(C("To"),a):r(C("From"),e),C=t=>`flightDetails:${t} _city_ (_iata_)`,I=(t,e)=>t&&e("flightDetails:Collect luggage from Baggage Claim _claimNum_",{claimNum:t}),U=(e,a)=>e&&t.fromISO(e,{zone:a}),_=(e,a,r="en-US")=>e&&t.fromISO(e,{zone:a}).setLocale(r).toFormat("EEE, d MMMM"),N=(e,a,r="en-US")=>e&&s(t.fromISO(e,{zone:a}),r);export{m as FlightType,g as flightComparator,d as mapFlightDetails,u as mapFlightListItem};
1
+ import{DateTime as t}from"luxon";import{pick as e,propOr as a,compose as r,path as i,last as l}from"ramda";import{formatTime as o,msToMin as s}from"../../../src/utils/date.js";import{FlightLabelStatus as n}from"../../../utils/constants.js";const m={ARRIVAL:"arr",DEPARTURE:"dep",ALL:"all"};function u(t,e,r,i,l){const{flightId:o,carrierFsCode:s,flightNumber:n,airline:u,flightType:d,departureAirport:g,arrivalAirport:c,airportResources:f,gatePoi:A,status:p}=e,R=E(e),{localTime:v,localOldTime:I}=h(R,i),_=T(d,p,t,v,I),$=d===m.DEPARTURE?"flightDetails:Departs _date_":"flightDetails:Arrives _date_";return{flightId:o,name:`${a("","name",u)} - ${s} ${n}`,status:_,statusText:r(`flightDetails:${L(_)}`),baggageClaim:d===m.ARRIVAL?U(f.arrivalBagClaim,r):void 0,connectionAirport:C(d,g,c,r),time:P(v,i,l),oldTime:P(I,i,l),date:r($,{date:N(v,i,l)}),dateStamp:v.toMillis(),gate:D(A),gateLabel:r("flightDetails:Gate")}}function d(t,r,i,l,o){const{flightNumber:s,flightType:n,departureAirport:u,arrivalAirport:d,airportResources:g,flightStatusUpdates:c,carrierFsCode:p,gatePoi:R,airline:v,status:I}=r,_=e(["city","iata"]),$=E(r),{localTime:y,localOldTime:O}=h($,l),S=T(n,I,t,y,O);return{flightType:n,flightTypeLabel:i(`flightDetails:${n===m.DEPARTURE?"Departure":"Arrival"}`),name:`${a("","name",v)} - ${p} ${s}`,status:S,statusText:i(`flightDetails:${L(S)}`),baggageClaim:n===m.ARRIVAL?U(g.arrivalBagClaim,i):void 0,departure:_(u),arrival:_(d),connectionAirport:C(n,u,d,i),flightIn:f(S,n,t,y,i),time:P(y,l,o),oldTime:P(O,l,o),date:N(y,l,o),lastUpdated:A(t,c,i),flightDuration:"",gateLabel:i("flightDetails:Gate"),gate:D(R),tags:[],flightIconBaseName:n===m.ARRIVAL?"arrivals":"departures"}}const g=(t,e)=>t.dateStamp-e.dateStamp,c=/[A-Z]?\d+[a-zA-Z]?/,D=t=>{if(!t)return{name:"-"};const e=t.name.match(c),a=e?e[0]:t.name;return{...t,name:a}},f=(t,e,a,r,i)=>{if(t===n.DEPARTED)return i("flightDetails:Departed");if(t===n.ARRIVED)return i("flightDetails:Arrived");if(t===n.CANCELLED)return null;return i(`flightDetails:${e===m.DEPARTURE?"Departs":"Arrives"} in _minutes_ minute`,{count:p(a,r)})},A=(t,e,a)=>{const o=r(i(["updatedAt","dateUtc"]),l)(e),s=p(t,_(o));return s<10?a("flightDetails:Last updated a few minutes ago"):s<60?a("flightDetails:Last updated _minutes_ minutes ago",{minutes:s}):a("flightDetails:Last updated over an hour ago")},p=(t,e)=>{const a=Math.abs(t-e);return s(a)},E=({flightType:t,operationalTimes:e,departureDate:a,arrivalDate:r})=>t===m.DEPARTURE?R(a,e.estimatedGateDeparture):R(r,e.estimatedGateArrival),R=(t,e)=>{const a=t.dateLocal||t.dateUtc,r=e.dateLocal||e.dateUtc;return r&&a!==r?{time:r,oldTime:a}:{time:a}},h=({time:t,oldTime:e},a)=>({localTime:_(t,a),localOldTime:_(e,a)});function T(t,e,a,r,i){return r?a>r?v(t):"C"===(e=e.toUpperCase())?n.CANCELLED:i?r>i?n.DELAYED:n.EARLY:n.ON_TIME:n.UNKNOWN}const L=t=>{switch(t){case n.ON_TIME:return"on-time";case n.EARLY:return"early";case n.DELAYED:return"delayed";case n.CANCELLED:return"cancelled";case n.DEPARTED:return"departed";case n.ARRIVED:return"arrived";default:return"unknown"}},v=t=>t===m.DEPARTURE?n.DEPARTED:n.ARRIVED,C=(t,e,a,r)=>t===m.DEPARTURE?r(I("To"),a):r(I("From"),e),I=t=>`flightDetails:${t} _city_ (_iata_)`,U=(t,e)=>t&&e("flightDetails:Collect luggage from Baggage Claim _claimNum_",{claimNum:t}),_=(e,a)=>e&&t.fromISO(e,{zone:a}),N=(e,a,r="en-US")=>e&&t.fromISO(e,{zone:a}).setLocale(r).toFormat("EEE, d MMMM"),P=(e,a,r="en-US")=>e&&o(t.fromISO(e,{zone:a}),r);export{m as FlightType,g as flightComparator,D as formatGate,c as gateNameRegex,d as mapFlightDetails,u as mapFlightListItem};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.893",
3
+ "version": "3.3.895",
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",