atriusmaps-node-sdk 3.2.30 → 3.3.1
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/README.md +2 -2
- package/dist/cjs/deploy/prepareSDKConfig.js +2 -2
- package/dist/cjs/package.json.js +3 -3
- package/dist/cjs/plugins/dynamicPois/src/dynamicPois.js +1 -1
- package/lib/deploy/prepareSDKConfig.js +1 -1
- package/lib/package.json.js +1 -1
- package/lib/plugins/dynamicPois/src/dynamicPois.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Then within your code, import the map initializer via:
|
|
|
14
14
|
|
|
15
15
|
or use `require`
|
|
16
16
|
|
|
17
|
-
`const Init = require("
|
|
17
|
+
`const Init = require("atriusmaps-node-sdk")`
|
|
18
18
|
|
|
19
19
|
## To Use
|
|
20
20
|
|
|
@@ -73,4 +73,4 @@ For example:
|
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
75
|
node main.js
|
|
76
|
-
```
|
|
76
|
+
```
|
|
@@ -4,6 +4,6 @@ var postprocMolUrlParms = require('../src/configs/postproc-mol-url-parms.js');
|
|
|
4
4
|
var postprocStateTracking = require('../src/configs/postproc-stateTracking.js');
|
|
5
5
|
var funcs = require('../src/utils/funcs.js');
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function o(o){const{name:n,debug:r,headless:a,theme:c,defaultSearchTerms:d,venueId:l,accountId:p,poiCategories:u,preserveStateInURL:h,supportURLDeepLinks:g,initState:m,deepLinkParms:f,uiHide:k,renderDiv:v,parentConfig:P,desktopViewMinWidth:S,forceDesktop:V,hostAppId:A,hostAppVersion:b,hostAppProperties:y,logFilter:I,searchPlaceholder:L,dataFetch:j,engineName:w,dynamicPoisUrlBaseV1:D}=o,T=P?[P]:a?["sdkHeadless"]:["sdkVisual"],C=(e,t)=>e&&e.length>t?e.substring(0,t):e,F={name:n,engineName:w,extends:T,debug:r,logFilter:I,theme:c,uiHide:k,renderDiv:v,configPostProc:[],plugins:{venueDataLoader:{dataFetch:j,venueId:l,accountId:p},sdkServer:{headless:a},analytics2:{hostAppId:(e=>e?C(e.toString(),128):void 0)(A),hostAppVersion:(e=>e?C(e.toString(),128):void 0)(b),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const t={},i=Object.keys(e);return i.length>10&&(i.length=10),i.forEach((i=>{let o=C(i.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);o.match(/^[a-zA-Z]+/)||(o="X"+o);let s=e[i];null==s&&(s=""),s=C(s.toString(),128),t[o]=s;})),t})(y)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};return a||(F.plugins["online/headerOnline"]={searchPlaceholder:L}),F.plugins.searchService=d?{defaultSearchTerms:d}:{},s(o,"defaultSearchTerms",F.plugins.searchService),T.includes("sdkVisual")&&(F.plugins["online/homeView"]=u?{poiCategories:u}:{},s(o,"poiCategories",F.plugins["online/homeView"])),h&&(F.configPostProc.push("stateTracking"),F.plugins.deepLinking={trackURL:!0}),g&&F.configPostProc.push("mol-url-parms"),m&&postprocStateTracking.setStateFromStateString(F,atob(m),!0),f&&postprocMolUrlParms.setDeepLinksForParms(F,f,!0),void 0!==S&&(F.desktopViewMinWidth=S),V&&(F.desktopViewMinWidth=0),D&&(F.plugins.dynamicPois={urlBaseV1:D}),funcs.filterOb(((e,t)=>void 0!==t),F)}function s(e,t,i){Object.keys(e).filter((e=>e.startsWith(t+"-"))).forEach((t=>i[t]=e[t]));}
|
|
8
8
|
|
|
9
|
-
module.exports =
|
|
9
|
+
module.exports = o;
|
package/dist/cjs/package.json.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var a={demo:"cd demo/ && yarn start",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",mod:"demo/startMod.sh",mol:"demo/startMol.sh",mos:"demo/startMos.sh",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch"},t={"@aws-amplify/auth":"^4.1.2","@azure/event-hubs":"^5.6.0","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.11","@locus-labs/mod-default-theme":"^0.0.27","@locus-labs/mod-footer":"^0.0.25","@locus-labs/mod-header":"^0.0.19","@locus-labs/mod-location-marker":"^0.0.18","@locus-labs/mod-map-legend":"^0.0.18","@locus-labs/mod-offscreen-indicator":"^0.0.18","@locus-labs/mod-pin":"^0.0.18","@locus-labs/mod-qr-code-card":"^0.0.18","@locus-labs/mod-qr-code-window":"^0.0.19","@locus-labs/mod-walk-time-matrix":"^0.0.17","@locus-labs/mol-desktop-building-level-selector":"^0.1.15","@locus-labs/mol-desktop-compass":"^0.1.29","@locus-labs/mol-desktop-default-theme":"^0.2.13","@locus-labs/mol-desktop-icon":"^0.1.45","@locus-labs/mol-desktop-logo":"^0.1.10","@locus-labs/mol-desktop-map-nav-button":"^0.1.39","@locus-labs/mol-desktop-submenu":"^0.1.30","@locus-labs/mol-desktop-tooltip":"^0.3.11","@locus-labs/mol-desktop-zoom-control":"^0.1.37","@locus-labs/mol-mobile-floating-action-button":"^0.0.20","@locus-labs/mol-mobile-toast":"^0.1.11","@turf/circle":"^6.5.0",IObject:"^0.6.2","crypto-browserify":"^3.12.0","file-loader":"^6.2.0",flexsearch:"0.6.32",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1",jsonschema:"^1.2.6",luxon:"^2.0.1","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0",msal:"1.4.11","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"7.0.1",ramda:"^0.27.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":"^11.2.5","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"},r={"@babel/core":"^7.14.8","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@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","babel-eslint":"^10.0.1","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^4.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"9.5.2","cypress-wait-until":"^1.7.1",eslint:"^7.4.0","eslint-config-standard":"^16.0.3","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^24.3.6","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",husky:"^6.0.0",jest:"^26.0.0","jest-transform-css":"^2.0.0","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",webpack:"^5.45.1","webpack-merge":"^5.8.0"},
|
|
5
|
+
var a={demo:"cd demo/ && yarn start",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",mod:"demo/startMod.sh",mol:"demo/startMol.sh",mos:"demo/startMos.sh",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch"},t={"@aws-amplify/auth":"^4.1.2","@azure/event-hubs":"^5.6.0","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.11","@locus-labs/mod-default-theme":"^0.0.27","@locus-labs/mod-footer":"^0.0.25","@locus-labs/mod-header":"^0.0.19","@locus-labs/mod-location-marker":"^0.0.18","@locus-labs/mod-map-legend":"^0.0.18","@locus-labs/mod-offscreen-indicator":"^0.0.18","@locus-labs/mod-pin":"^0.0.18","@locus-labs/mod-qr-code-card":"^0.0.18","@locus-labs/mod-qr-code-window":"^0.0.19","@locus-labs/mod-walk-time-matrix":"^0.0.17","@locus-labs/mol-desktop-building-level-selector":"^0.1.15","@locus-labs/mol-desktop-compass":"^0.1.29","@locus-labs/mol-desktop-default-theme":"^0.2.13","@locus-labs/mol-desktop-icon":"^0.1.45","@locus-labs/mol-desktop-logo":"^0.1.10","@locus-labs/mol-desktop-map-nav-button":"^0.1.39","@locus-labs/mol-desktop-submenu":"^0.1.30","@locus-labs/mol-desktop-tooltip":"^0.3.11","@locus-labs/mol-desktop-zoom-control":"^0.1.37","@locus-labs/mol-mobile-floating-action-button":"^0.0.20","@locus-labs/mol-mobile-toast":"^0.1.11","@turf/circle":"^6.5.0",IObject:"^0.6.2","crypto-browserify":"^3.12.0","file-loader":"^6.2.0",flexsearch:"0.6.32",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1",jsonschema:"^1.2.6",luxon:"^2.0.1","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0",msal:"1.4.11","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"7.0.1",ramda:"^0.27.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":"^11.2.5","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"},r={"@babel/core":"^7.14.8","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@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","babel-eslint":"^10.0.1","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^4.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"9.5.2","cypress-wait-until":"^1.7.1",eslint:"^7.4.0","eslint-config-standard":"^16.0.3","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^24.3.6","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",husky:"^6.0.0",jest:"^26.0.0","jest-transform-css":"^2.0.0","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",webpack:"^5.45.1","webpack-merge":"^5.8.0"},c=["demo","deploy","pageSrc","src/extModules/flexapi"],d={name:"web-engine",version:"3.3.1",main:"src/main.js",type:"module",scripts:a,dependencies:t,devDependencies:r,"lint-staged":{"*.js":["eslint --fix"]},license:"UNLICENSED",workspaces:c,private:!0,packageManager:"yarn@3.2.2"};
|
|
6
6
|
|
|
7
|
-
exports["default"] =
|
|
7
|
+
exports["default"] = d;
|
|
8
8
|
exports.dependencies = t;
|
|
9
9
|
exports.devDependencies = r;
|
|
10
10
|
exports.scripts = a;
|
|
11
|
-
exports.workspaces =
|
|
11
|
+
exports.workspaces = c;
|
|
@@ -28,6 +28,6 @@ function _interopNamespace(e) {
|
|
|
28
28
|
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
29
29
|
var a__default = /*#__PURE__*/_interopDefaultLegacy(a$1);
|
|
30
30
|
|
|
31
|
-
function a(a,
|
|
31
|
+
function a(a,s){let n=new a__default["default"];const i=new a__default["default"];function o(...e){r(...e),p(...e);}function r(t,s){const n=e__namespace.pipe(e__namespace.filter((e=>"parking"===e.category)),e__namespace.map((a=>{const s=a.dynamicAttributes;if(!s)throw Error(`No dynamicAttributes defined for parking POI ${a.poiId}`);return {...(t-a.timestamp)/1e3<s["parking.timeToLive"]?e__namespace.pick(["lotStatus","rateDay","rateHour","timeIsReal","timeToTerminal1","timeToTerminal2"],a):{lotStatus:s["parking.default"],rateDay:"$ -",rateHour:"$ -",timeIsReal:!1},lastUpdated:a.timestamp,lotName:a.lotName}})))(s);a.bus.send("poi/setDynamicData",{plugin:"parking",idValuesMap:n});}function u(t,s){const n=e__namespace.pipe(e__namespace.map((e=>[e.poiId,l(t,e)])),e__namespace.fromPairs)(s);a.bus.send("poi/setDynamicData",{plugin:"security",idValuesMap:n});}const l=(e,t)=>({queueTime:t.queueTime,isTemporarilyClosed:t.isTemporarilyClosed,timeIsReal:!t.isQueueTimeDefault&&t.expiration>e,lastUpdated:e});function p(t,s){const n=["dynamicData","openClosed"],i=e__namespace.filter(e__namespace.hasPath(n),s),o=e__namespace.map(e__namespace.path(n),i);if(!e__namespace.all(e__namespace.both(e__namespace.has("isOpen"),e__namespace.has("expiration")),e__namespace.values(o)))throw Error("Open Closed poi status is malformed.");{const s=e__namespace.pipe(e__namespace.prop("expiration"),e__namespace.lt(t)),n=e__namespace.filter(s,o);a.bus.send("poi/setDynamicData",{plugin:"open-closed-status",idValuesMap:n});}}return a.bus.on("venueData/venueDataLoaded",(({venueData:e})=>{n.v?n=a__default["default"].resolve(e):n.resolve(e);})),a.bus.on("sdk/readyWhenYouAre",(()=>i)),{init:async()=>{const e=s.urlBase||"https://rest.locuslabs.com/v3",t=s.urlBaseV1||s.urlBase||"https://rest.locuslabs.com/v1",r=a.config.plugins.venueDataLoader.accountId;async function l(){return n.then((e=>{let a=`${t}/venue/${e.id}/account/${r}/get-all-dynamic-pois/`;return (t.startsWith("./")||t.endsWith(".json"))&&(a=t),a}))}const p=async()=>n.then((t=>e.startsWith("./")||e.endsWith(".json")?e:`${e}/venueId/${t.id}/accountId/${r}/get-dynamic-queue-times/`)),c=async()=>{Promise.all([l().then(fetch).then((e=>e.json())).then((e=>o(Date.now(),e))),p().then(fetch).then((e=>e.json())).then((e=>u(Date.now(),e)))]).then((()=>i.resolve(!0))).catch((e=>{console.error(e),i.resolve(!0);}));},m=await a.bus.get("venueData/getQueueTypes");m.SecurityLane&&m.SecurityLane.length?n.then(c).then((()=>setInterval(c,3e4))):i.resolve(!0);},internal:{processSecurityWaitTimes:u,processParkingPOIS:r,processOpenClosedPois:p,processDynamicPois:o}}}
|
|
32
32
|
|
|
33
33
|
exports.create = a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setDeepLinksForParms as e}from"../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as t}from"../src/configs/postproc-stateTracking.js";import{filterOb as
|
|
1
|
+
import{setDeepLinksForParms as e}from"../src/configs/postproc-mol-url-parms.js";import{setStateFromStateString as t}from"../src/configs/postproc-stateTracking.js";import{filterOb as i}from"../src/utils/funcs.js";function o(o){const{name:n,debug:r,headless:a,theme:c,defaultSearchTerms:d,venueId:l,accountId:p,poiCategories:u,preserveStateInURL:h,supportURLDeepLinks:g,initState:m,deepLinkParms:f,uiHide:k,renderDiv:v,parentConfig:P,desktopViewMinWidth:S,forceDesktop:V,hostAppId:A,hostAppVersion:b,hostAppProperties:y,logFilter:I,searchPlaceholder:L,dataFetch:j,engineName:w,dynamicPoisUrlBaseV1:D}=o,T=P?[P]:a?["sdkHeadless"]:["sdkVisual"],C=(e,t)=>e&&e.length>t?e.substring(0,t):e,F={name:n,engineName:w,extends:T,debug:r,logFilter:I,theme:c,uiHide:k,renderDiv:v,configPostProc:[],plugins:{venueDataLoader:{dataFetch:j,venueId:l,accountId:p},sdkServer:{headless:a},analytics2:{hostAppId:(e=>e?C(e.toString(),128):void 0)(A),hostAppVersion:(e=>e?C(e.toString(),128):void 0)(b),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const t={},i=Object.keys(e);return i.length>10&&(i.length=10),i.forEach((i=>{let o=C(i.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);o.match(/^[a-zA-Z]+/)||(o="X"+o);let s=e[i];null==s&&(s=""),s=C(s.toString(),128),t[o]=s})),t})(y)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};return a||(F.plugins["online/headerOnline"]={searchPlaceholder:L}),F.plugins.searchService=d?{defaultSearchTerms:d}:{},s(o,"defaultSearchTerms",F.plugins.searchService),T.includes("sdkVisual")&&(F.plugins["online/homeView"]=u?{poiCategories:u}:{},s(o,"poiCategories",F.plugins["online/homeView"])),h&&(F.configPostProc.push("stateTracking"),F.plugins.deepLinking={trackURL:!0}),g&&F.configPostProc.push("mol-url-parms"),m&&t(F,atob(m),!0),f&&e(F,f,!0),void 0!==S&&(F.desktopViewMinWidth=S),V&&(F.desktopViewMinWidth=0),D&&(F.plugins.dynamicPois={urlBaseV1:D}),i(((e,t)=>void 0!==t),F)}function s(e,t,i){Object.keys(e).filter((e=>e.startsWith(t+"-"))).forEach((t=>i[t]=e[t]))}export{o as default};
|
package/lib/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e="web-engine",s="3.
|
|
1
|
+
var e="web-engine",s="3.3.1",o="src/main.js",l="module",a={demo:"cd demo/ && yarn start",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",mod:"demo/startMod.sh",mol:"demo/startMol.sh",mos:"demo/startMos.sh",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch"},t={"@aws-amplify/auth":"^4.1.2","@azure/event-hubs":"^5.6.0","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.11","@locus-labs/mod-default-theme":"^0.0.27","@locus-labs/mod-footer":"^0.0.25","@locus-labs/mod-header":"^0.0.19","@locus-labs/mod-location-marker":"^0.0.18","@locus-labs/mod-map-legend":"^0.0.18","@locus-labs/mod-offscreen-indicator":"^0.0.18","@locus-labs/mod-pin":"^0.0.18","@locus-labs/mod-qr-code-card":"^0.0.18","@locus-labs/mod-qr-code-window":"^0.0.19","@locus-labs/mod-walk-time-matrix":"^0.0.17","@locus-labs/mol-desktop-building-level-selector":"^0.1.15","@locus-labs/mol-desktop-compass":"^0.1.29","@locus-labs/mol-desktop-default-theme":"^0.2.13","@locus-labs/mol-desktop-icon":"^0.1.45","@locus-labs/mol-desktop-logo":"^0.1.10","@locus-labs/mol-desktop-map-nav-button":"^0.1.39","@locus-labs/mol-desktop-submenu":"^0.1.30","@locus-labs/mol-desktop-tooltip":"^0.3.11","@locus-labs/mol-desktop-zoom-control":"^0.1.37","@locus-labs/mol-mobile-floating-action-button":"^0.0.20","@locus-labs/mol-mobile-toast":"^0.1.11","@turf/circle":"^6.5.0",IObject:"^0.6.2","crypto-browserify":"^3.12.0","file-loader":"^6.2.0",flexsearch:"0.6.32",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1",jsonschema:"^1.2.6",luxon:"^2.0.1","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0",msal:"1.4.11","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"7.0.1",ramda:"^0.27.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":"^11.2.5","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"},r={"@babel/core":"^7.14.8","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@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","babel-eslint":"^10.0.1","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-inline-json-import":"^0.3.2","babel-plugin-module-resolver":"^4.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"9.5.2","cypress-wait-until":"^1.7.1",eslint:"^7.4.0","eslint-config-standard":"^16.0.3","eslint-plugin-cypress":"^2.11.1","eslint-plugin-import":"^2.16.0","eslint-plugin-jest":"^24.3.6","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",husky:"^6.0.0",jest:"^26.0.0","jest-transform-css":"^2.0.0","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1",webpack:"^5.45.1","webpack-merge":"^5.8.0"},n="UNLICENSED",c=["demo","deploy","pageSrc","src/extModules/flexapi"],i="yarn@3.2.2",d={name:"web-engine",version:"3.3.1",main:"src/main.js",type:"module",scripts:a,dependencies:t,devDependencies:r,"lint-staged":{"*.js":["eslint --fix"]},license:"UNLICENSED",workspaces:c,private:!0,packageManager:"yarn@3.2.2"};export{d as default,t as dependencies,r as devDependencies,n as license,o as main,e as name,i as packageManager,a as scripts,l as type,s as version,c as workspaces};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"ramda";import t from"zousan";function a(a,
|
|
1
|
+
import*as e from"ramda";import t from"zousan";function a(a,s){let n=new t;const i=new t;function o(...e){r(...e),p(...e)}function r(t,s){const n=e.pipe(e.filter((e=>"parking"===e.category)),e.map((a=>{const s=a.dynamicAttributes;if(!s)throw Error(`No dynamicAttributes defined for parking POI ${a.poiId}`);return{...(t-a.timestamp)/1e3<s["parking.timeToLive"]?e.pick(["lotStatus","rateDay","rateHour","timeIsReal","timeToTerminal1","timeToTerminal2"],a):{lotStatus:s["parking.default"],rateDay:"$ -",rateHour:"$ -",timeIsReal:!1},lastUpdated:a.timestamp,lotName:a.lotName}})))(s);a.bus.send("poi/setDynamicData",{plugin:"parking",idValuesMap:n})}function u(t,s){const n=e.pipe(e.map((e=>[e.poiId,l(t,e)])),e.fromPairs)(s);a.bus.send("poi/setDynamicData",{plugin:"security",idValuesMap:n})}const l=(e,t)=>({queueTime:t.queueTime,isTemporarilyClosed:t.isTemporarilyClosed,timeIsReal:!t.isQueueTimeDefault&&t.expiration>e,lastUpdated:e});function p(t,s){const n=["dynamicData","openClosed"],i=e.filter(e.hasPath(n),s),o=e.map(e.path(n),i);if(!e.all(e.both(e.has("isOpen"),e.has("expiration")),e.values(o)))throw Error("Open Closed poi status is malformed.");{const s=e.pipe(e.prop("expiration"),e.lt(t)),n=e.filter(s,o);a.bus.send("poi/setDynamicData",{plugin:"open-closed-status",idValuesMap:n})}}return a.bus.on("venueData/venueDataLoaded",(({venueData:e})=>{n.v?n=t.resolve(e):n.resolve(e)})),a.bus.on("sdk/readyWhenYouAre",(()=>i)),{init:async()=>{const e=s.urlBase||"https://rest.locuslabs.com/v3",t=s.urlBaseV1||s.urlBase||"https://rest.locuslabs.com/v1",r=a.config.plugins.venueDataLoader.accountId;async function l(){return n.then((e=>{let a=`${t}/venue/${e.id}/account/${r}/get-all-dynamic-pois/`;return(t.startsWith("./")||t.endsWith(".json"))&&(a=t),a}))}const p=async()=>n.then((t=>e.startsWith("./")||e.endsWith(".json")?e:`${e}/venueId/${t.id}/accountId/${r}/get-dynamic-queue-times/`)),c=async()=>{Promise.all([l().then(fetch).then((e=>e.json())).then((e=>o(Date.now(),e))),p().then(fetch).then((e=>e.json())).then((e=>u(Date.now(),e)))]).then((()=>i.resolve(!0))).catch((e=>{console.error(e),i.resolve(!0)}))},m=await a.bus.get("venueData/getQueueTypes");m.SecurityLane&&m.SecurityLane.length?n.then(c).then((()=>setInterval(c,3e4))):i.resolve(!0)},internal:{processSecurityWaitTimes:u,processParkingPOIS:r,processOpenClosedPois:p,processDynamicPois:o}}}export{a as create};
|
package/package.json
CHANGED