atriusmaps-node-sdk 3.3.893 → 3.3.894
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
CHANGED
|
@@ -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
|
|
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;
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t="web-engine",e="3.3.
|
|
1
|
+
var t="web-engine",e="3.3.894",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{DateTime as t}from"luxon";import{pick as e,propOr as a,
|
|
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