atriusmaps-node-sdk 3.3.196 → 3.3.225
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/_virtual/_empty_module_placeholder.js +2 -2
- package/dist/cjs/deploy/prepareSDKConfig.js +152 -2
- package/dist/cjs/nodesdk/nodeEntry.js +109 -0
- package/dist/cjs/package.json.js +190 -14
- package/dist/cjs/plugins/clientAPI/src/clientAPI.js +11 -2
- package/dist/cjs/plugins/dynamicPois/src/dynamicPois.js +218 -21
- package/dist/cjs/plugins/poiDataManager/src/poiDataManager.js +292 -21
- package/dist/cjs/plugins/sdkServer/src/sdkHeadless.js +99 -20
- package/dist/cjs/plugins/sdkServer/src/sdkServer.js +219 -2
- package/dist/cjs/plugins/sdkServer/src/util.js +16 -3
- package/dist/cjs/plugins/searchService/src/poiSearch.js +57 -19
- package/dist/cjs/plugins/searchService/src/searchService.js +246 -21
- package/dist/cjs/plugins/searchService/src/searchTypeahead.js +60 -3
- package/dist/cjs/plugins/searchService/src/utils.js +23 -4
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +472 -21
- package/dist/cjs/plugins/venueDataLoader/src/venueLoadingUtils.js +191 -23
- package/dist/cjs/plugins/wayfinder/src/findRoute.js +147 -19
- package/dist/cjs/plugins/wayfinder/src/minPriorityQueue.js +88 -2
- package/dist/cjs/plugins/wayfinder/src/navGraph.js +393 -5
- package/dist/cjs/plugins/wayfinder/src/navGraphDebug.js +110 -20
- package/dist/cjs/plugins/wayfinder/src/segmentBadges.js +28 -2
- package/dist/cjs/plugins/wayfinder/src/segmentBuilder.js +257 -19
- package/dist/cjs/plugins/wayfinder/src/segmentCategories.js +29 -2
- package/dist/cjs/plugins/wayfinder/src/stepBuilder.js +238 -3
- package/dist/cjs/plugins/wayfinder/src/wayfinder.js +597 -22
- package/dist/cjs/src/app.js +191 -25
- package/dist/cjs/src/configs/postproc-mol-url-parms.js +58 -2
- package/dist/cjs/src/configs/postproc-stateTracking.js +53 -19
- package/dist/cjs/src/controller.js +43 -4
- package/dist/cjs/src/debugTools.js +128 -23
- package/dist/cjs/src/env.js +17 -2
- package/dist/cjs/src/extModules/bustle.js +128 -4
- package/dist/cjs/src/extModules/flexapi/src/help.js +23 -4
- package/dist/cjs/src/extModules/flexapi/src/index.js +65 -4
- package/dist/cjs/src/extModules/flexapi/src/validate.js +133 -5
- package/dist/cjs/src/extModules/geohasher.js +90 -3
- package/dist/cjs/src/extModules/log.js +69 -2
- package/dist/cjs/src/historyManager.js +29 -2
- package/dist/cjs/src/utils/bounds.js +22 -4
- package/dist/cjs/src/utils/buildStructureLookup.js +31 -19
- package/dist/cjs/src/utils/configUtils.js +71 -3
- package/dist/cjs/src/utils/dom.js +48 -5
- package/dist/cjs/src/utils/funcs.js +30 -3
- package/dist/cjs/src/utils/geodesy.js +35 -3
- package/dist/cjs/src/utils/geom.js +209 -27
- package/dist/cjs/src/utils/i18n.js +69 -5
- package/dist/cjs/src/utils/observable.js +73 -2
- package/dist/cjs/src/utils/rand.js +82 -3
- package/dist/nodesdk/nodeEntry.js +1 -0
- package/dist/package.json.js +1 -0
- package/dist/plugins/searchService/src/searchService.js +1 -0
- package/dist/plugins/venueDataLoader/src/venueDataLoader.js +1 -0
- package/dist/plugins/venueDataLoader/src/venueLoadingUtils.js +1 -0
- package/dist/src/app.js +1 -0
- package/package.json +13 -9
- package/.yarnrc.yml +0 -1
- package/config/rollup.config.cjs.js +0 -31
- package/dist/cjs/deploy/nodeEntry.js +0 -20
- package/dist/cjs/src/auth/Auth.js +0 -23
- package/lib/deploy/nodeEntry.js +0 -1
- package/lib/package.json.js +0 -1
- package/lib/plugins/searchService/src/searchService.js +0 -1
- package/lib/plugins/venueDataLoader/src/venueDataLoader.js +0 -1
- package/lib/plugins/venueDataLoader/src/venueLoadingUtils.js +0 -1
- package/lib/src/app.js +0 -1
- package/lib/src/configs/sdkHeadless.json +0 -28
- /package/{lib → dist}/_virtual/_empty_module_placeholder.js +0 -0
- /package/{lib → dist}/deploy/prepareSDKConfig.js +0 -0
- /package/{lib → dist}/plugins/clientAPI/src/clientAPI.js +0 -0
- /package/{lib → dist}/plugins/dynamicPois/src/dynamicPois.js +0 -0
- /package/{lib → dist}/plugins/poiDataManager/src/poiDataManager.js +0 -0
- /package/{lib → dist}/plugins/sdkServer/src/sdkHeadless.js +0 -0
- /package/{lib → dist}/plugins/sdkServer/src/sdkServer.js +0 -0
- /package/{lib → dist}/plugins/sdkServer/src/util.js +0 -0
- /package/{lib → dist}/plugins/searchService/src/poiSearch.js +0 -0
- /package/{lib → dist}/plugins/searchService/src/searchTypeahead.js +0 -0
- /package/{lib → dist}/plugins/searchService/src/utils.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/findRoute.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/minPriorityQueue.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/navGraph.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/navGraphDebug.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/segmentBadges.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/segmentBuilder.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/segmentCategories.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/stepBuilder.js +0 -0
- /package/{lib → dist}/plugins/wayfinder/src/wayfinder.js +0 -0
- /package/{lib → dist}/src/configs/postproc-mol-url-parms.js +0 -0
- /package/{lib → dist}/src/configs/postproc-stateTracking.js +0 -0
- /package/{lib → dist}/src/configs/sdkHeadless.json.js +0 -0
- /package/{lib → dist}/src/controller.js +0 -0
- /package/{lib → dist}/src/debugTools.js +0 -0
- /package/{lib → dist}/src/env.js +0 -0
- /package/{lib → dist}/src/extModules/bustle.js +0 -0
- /package/{lib → dist}/src/extModules/flexapi/src/help.js +0 -0
- /package/{lib → dist}/src/extModules/flexapi/src/index.js +0 -0
- /package/{lib → dist}/src/extModules/flexapi/src/validate.js +0 -0
- /package/{lib → dist}/src/extModules/geohasher.js +0 -0
- /package/{lib → dist}/src/extModules/log.js +0 -0
- /package/{lib → dist}/src/historyManager.js +0 -0
- /package/{lib → dist}/src/utils/bounds.js +0 -0
- /package/{lib → dist}/src/utils/buildStructureLookup.js +0 -0
- /package/{lib → dist}/src/utils/configUtils.js +0 -0
- /package/{lib → dist}/src/utils/dom.js +0 -0
- /package/{lib → dist}/src/utils/funcs.js +0 -0
- /package/{lib → dist}/src/utils/geodesy.js +0 -0
- /package/{lib → dist}/src/utils/geom.js +0 -0
- /package/{lib → dist}/src/utils/i18n.js +0 -0
- /package/{lib → dist}/src/utils/observable.js +0 -0
- /package/{lib → dist}/src/utils/rand.js +0 -0
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function fire () {
|
|
4
|
+
const ob = this._observers;
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
if (!ob)
|
|
7
|
+
return undefined
|
|
8
|
+
|
|
9
|
+
for (let x = 0; x < ob.length; x++)
|
|
10
|
+
try { ob[x].apply(this, arguments); } catch (err) { console.error(err); }
|
|
11
|
+
|
|
12
|
+
return this
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function observe (cb) {
|
|
16
|
+
if (!this._observers)
|
|
17
|
+
this._observers = [];
|
|
18
|
+
|
|
19
|
+
this._observers.push(cb);
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
detach: detach.bind(this, cb),
|
|
23
|
+
ob: this
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function detach (cb) {
|
|
28
|
+
this._observers.splice(this._observers.indexOf(cb), 1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Returns a new derivitive observer that fires events when the observed object fires iff
|
|
32
|
+
// the event passes the predicate function specified here.
|
|
33
|
+
function filter (fn) {
|
|
34
|
+
const o2 = create();
|
|
35
|
+
|
|
36
|
+
this.observe(function () {
|
|
37
|
+
if (fn.apply(this, arguments))
|
|
38
|
+
o2.fire.apply(o2, arguments);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return o2
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// When first argument denotes an event name, this is a convenience
|
|
45
|
+
// method to filter by that name
|
|
46
|
+
function filterByName (eventName) {
|
|
47
|
+
return filter.call(this, function (name) {
|
|
48
|
+
return eventName === name
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Filters on equivilence of first argument (often the event name) and observes
|
|
53
|
+
// the result - calling the callback function when triggered
|
|
54
|
+
function on (value, cb) {
|
|
55
|
+
return filterByName.call(this, value).observe(cb)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const observable = { detach, filter, fire, observe, on };
|
|
59
|
+
|
|
60
|
+
// extend `to` argument with properties from `from`
|
|
61
|
+
// [short version]
|
|
62
|
+
function extend (to, from) {
|
|
63
|
+
for (const prop in from)
|
|
64
|
+
to[prop] = from[prop];
|
|
65
|
+
|
|
66
|
+
return to
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function create (ob) {
|
|
70
|
+
if (ob)
|
|
71
|
+
return extend(ob, observable)
|
|
72
|
+
|
|
73
|
+
return Object.create(observable)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
module.exports = create;
|
|
@@ -2,7 +2,86 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const jsRandom = () => ({
|
|
6
|
+
nextInt: max => Math.floor(Math.random() * max)
|
|
7
|
+
});
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
const defaultRandom = jsRandom();
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Returns a random list of length size of numbers from 0 to max-1, which represents a set of
|
|
13
|
+
* those numbers. i.e. no number will repeat. (size is forced to not be bigger than max)
|
|
14
|
+
*
|
|
15
|
+
* Can be used to choose a random selection from a list of selections. Or if
|
|
16
|
+
* size = max, it becomes a random ordering of a List.
|
|
17
|
+
*
|
|
18
|
+
* NOTE: if the setSize is 0, max will set to 0 and you get an empty List object
|
|
19
|
+
*
|
|
20
|
+
* ForExample:
|
|
21
|
+
* randomSet(3, 5) = [3, 2, 0]
|
|
22
|
+
* randomSet(3, 5) = [1, 0, 3]
|
|
23
|
+
* randomSet(3, 5) = [1, 4, 2]
|
|
24
|
+
*
|
|
25
|
+
* @param size the number of values to return
|
|
26
|
+
* @param max a positive integer
|
|
27
|
+
* @param r an optional Random instance (else one is generated)
|
|
28
|
+
* @return a List of random values from 0 to max-1 with no number repeating
|
|
29
|
+
*/
|
|
30
|
+
function randomSet (size, max, r) {
|
|
31
|
+
r = r || defaultRandom;
|
|
32
|
+
|
|
33
|
+
let i;
|
|
34
|
+
|
|
35
|
+
if (!max)
|
|
36
|
+
max = size;
|
|
37
|
+
|
|
38
|
+
if (size > max)
|
|
39
|
+
size = max;
|
|
40
|
+
|
|
41
|
+
const list = [];
|
|
42
|
+
|
|
43
|
+
if (((max / size) >= 2.0) || (max < 40)) {
|
|
44
|
+
// if the set we are choosing from is considerably bigger than the number we are selecting
|
|
45
|
+
// then let's just grab random values and check to see if they are in our new list yet.
|
|
46
|
+
while (list.length < size) {
|
|
47
|
+
i = r.nextInt(max);
|
|
48
|
+
if (list.indexOf(i) < 0)
|
|
49
|
+
list.push(i);
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
// if the list is to be nearly same size as what we are choosing from, let's build a source
|
|
53
|
+
// list of the numbers and grab from them one at a time.
|
|
54
|
+
const source = [];
|
|
55
|
+
for (i = 0; i < max; i++)
|
|
56
|
+
source.push(i);
|
|
57
|
+
|
|
58
|
+
for (i = 0; i < size; i++) {
|
|
59
|
+
const index = r.nextInt(source.length);
|
|
60
|
+
list.push(source[index]);
|
|
61
|
+
source.splice(index, 1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return list
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Pass in a source array and a map array of indices, and this returns a new
|
|
69
|
+
// array of the members of the first based on the indices of the second. Useful when
|
|
70
|
+
// used along with randomset above.
|
|
71
|
+
// i.e.
|
|
72
|
+
// a1 = [ "a", "b", "c", "d", "e", "f" ]
|
|
73
|
+
// a2 = [ 2, 3, 5, 4, 0, 1]
|
|
74
|
+
// a3 = getMappedArray(a1, a2) = [ "c", "d", "f", "e", "a", "b" ]
|
|
75
|
+
const getMappedArray = (array, map) => map.map(i => array[i]);
|
|
76
|
+
|
|
77
|
+
// Randomly pick a number of items from an array and return them in an array
|
|
78
|
+
// leaving the original array untouched. If no number is specified, a length
|
|
79
|
+
// of 1 is returned.
|
|
80
|
+
const arrayPick = (array, num) => {
|
|
81
|
+
num = num || 1;
|
|
82
|
+
const map = randomSet(num, array.length);
|
|
83
|
+
return getMappedArray(array, map)
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
exports.arrayPick = arrayPick;
|
|
87
|
+
exports.randomSet = randomSet;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"node:http";import t from"node:https";import{HttpsProxyAgent as n}from"https-proxy-agent";import o from"node-fetch";import r from"../deploy/prepareSDKConfig.js";import s from"../package.json.js";import{create as c}from"../src/controller.js";import i from"../src/utils/observable.js";const a=s.version;let g=!1;const m=e=>e.toString().length<2?"0"+e:e,p=()=>`AtriusMaps Node SDK (${(()=>{const e=new Date;return`${e.getHours()}:${m(e.getMinutes())}:${m(e.getSeconds())}.${e.getMilliseconds()}`})()}): `,l=function(){if(g){let e=p()+Array.from(arguments).map((e=>"object"==typeof e?JSON.stringify(e):e)).join(" ");const t=e.split("\n");t.length>1?e=t[0]+`… (+ ${t.length-1} lines)`:e.length>256&&(e=e.substring(0,255)+`… (length: ${e.length} chars)`),console.log(e)}};async function f(s){return new Promise(((a,g)=>{s.headless=!0,function(r){const s=new e.Agent({keepAlive:!0}),c=new t.Agent({keepAlive:!0}),i=r.proxy?new n(`http://${r.proxy.host}:${r.proxy.port}`):null,a=r.agent||i||(e=>"http:"===e.protocol?s:c);global.fetch=async(e,t)=>o(e,{...t,agent:a})}(s);const m=r(s);c(m).then((e=>{const t=(t,n)=>("string"==typeof t&&(t={...n,command:t}),l("Sending command object: ",t),e.bus.get("clientAPI/execute",t).then((e=>(l("Received Message: ",e),e))).catch((e=>{throw l("Error: ",e.message),e})));i(t),e.eventListener.observe((function(){t.fire.apply(t,arguments)})),t.on("ready",((e,n)=>{const{commands:o}=n.commandJSON;!function(e,t){t.forEach((t=>{e[t.command]=function(){const n={command:t.command};for(let e=0;e<arguments.length;e++)n[t.args[e].name]=arguments[e];return e(n)}}))}(t,o),a(t),l("map ready")}))}))}))}const h={getVersion:()=>a,newMap:e=>f(e),setLogging:e=>{g=e,e&&l(`Atrius Maps JS SDK Client v${a} Logging enabled.`)}};export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e="web-engine",s="3.3.225",o="UNLICENSED",l="module",t="src/main.js",r=["demo","deploy","nodesdk","pagesSrc","src/extModules/flexapi"],a={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt","cypress:a11y":"APPLITOOLS_IS_DISABLED=true && cypress open --browser chrome --env INPUT_MODALITY='keyboard'","cypress:comp":"APPLITOOLS_IS_DISABLED=true && cypress open --component --browser chrome","cypress:e2e":"APPLITOOLS_IS_DISABLED=true && cypress open --e2e --browser chrome",demo:"cd demo/ && yarn start","e2e:record":"yarn cypress run --env RECORD_MODE=true",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",lint:"eslint . --max-warnings=0",mod:"demo/startMod.sh",mol:"demo/startMol.sh",molProd:"cd deploy && yarn buildAndRunMol",mos:"demo/startMos.sh",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:e2e:video":"cypress run"},n=["defaults"],c={"@azure/event-hubs":"^5.6.0","@dnd-kit/core":"^6.0.8","@dnd-kit/sortable":"^7.0.2","@dnd-kit/utilities":"^3.2.1","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-default-theme":"^0.0.113","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@locus-labs/mol-desktop-building-level-selector":"^0.1.108","@locus-labs/mol-desktop-compass":"^0.1.120","@locus-labs/mol-desktop-default-theme":"^0.2.105","@locus-labs/mol-desktop-icon":"^0.1.131","@locus-labs/mol-desktop-logo":"^0.1.101","@locus-labs/mol-desktop-map-nav-button":"^0.1.130","@locus-labs/mol-desktop-submenu":"^0.1.121","@locus-labs/mol-desktop-tooltip":"^0.3.102","@locus-labs/mol-desktop-zoom-control":"^0.1.134","@locus-labs/mol-mobile-floating-action-button":"^0.0.106","@locus-labs/mol-mobile-toast":"^0.1.102","@mapbox/mapbox-gl-draw":"^1.3.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@microsoft/applicationinsights-web":"^3.1.2","@turf/circle":"^6.5.0","@turf/helpers":"^6.5.0","@turf/point-to-line-distance":"^6.5.0","@vitejs/plugin-react":"^4.0.1",IObject:"^0.7.2","axe-core":"^4.9.0","crypto-browserify":"^3.12.0","cypress-axe":"^1.5.0","file-loader":"^6.2.0",flexsearch:"^0.7.31","h3-js":"^4.1.0",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"4.0.1",jsonschema:"^1.2.6",luxon:"^3.3.0","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"^8.1.0",ramda:"^0.28.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":"^16.1.29","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"},i={"@applitools/eyes-cypress":"^3.44.0","@babel/core":"^7.14.8","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.20.0","@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":"^5.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"^12.17.2","cypress-browser-permissions":"^1.1.0","cypress-real-events":"^1.11.0","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",glob:"^10.3.3",husky:"^6.0.0",jest:"27.5.1","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1","start-server-and-test":"^2.0.0",vite:"^4.3.9",webpack:"^5.84.1","webpack-merge":"^5.8.0"},p="yarn@4.0.2",d={node:">=20"},m={name:e,version:s,private:!0,license:o,type:l,main:t,workspaces:r,scripts:a,"lint-staged":{"*.js":["eslint --fix"]},browserslist:n,dependencies:c,devDependencies:i,packageManager:p,engines:d};export{n as browserslist,m as default,c as dependencies,i as devDependencies,d as engines,o as license,t as main,e as name,p as packageManager,a as scripts,l as type,s as version,r as workspaces};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"ramda";import r from"zousan";import{getLocalized as a}from"../../../src/utils/configUtils.js";import{arrayPick as s}from"../../../src/utils/rand.js";import t from"./poiSearch.js";import n from"./searchTypeahead.js";function o(o,i){const c={poiSearch:null,typeahead:null,indexesCreated:new r,defaultSearchTerms:null,specialQueryTerms:{}},u=async()=>{const e=await o.bus.get("poi/getAll");c.poiSearch=t(e,o.i18n().language),c.typeahead=n(e,c.poiSearch.search,o.i18n().language),c.defaultSearchTerms=a(i,"defaultSearchTerms",o.i18n().language),c.indexesCreated.resolve()};async function d(){const r=await o.bus.get("user/getPhysicalLocation");if(!r?.floorId)return[];const a=await o.bus.get("poi/getByFloorId",{floorId:r?.floorId}),s=Object.values(e.pickBy((e=>-1===e.category.indexOf("portal")&&"element.door"!==e.category),a)),t=await o.bus.get("wayfinder/addPathTimeMultiple",{pois:s,startLocation:r});return e.sortBy(e.prop("distance"),Object.values(t)).slice(0,50)}o.bus.on("search/queryNearby",(async()=>{const e=await d();return o.bus.send("search/showNearby",{pois:e,term:"Nearby"}),e})),o.bus.on("search/queryNearbyAsync",d),o.bus.on("search/queryCategory",(async({category:e,categoryName:r,searchTerm:a})=>{const s=await c.indexesCreated.then((()=>c.poiSearch.search({query:a||e})));return o.bus.send("search/showCategory",{pois:s,category:e,categoryName:r}),s})),o.bus.on("search/query",(({term:e})=>c.indexesCreated.then((()=>{const r=c.poiSearch.search({query:e});return o.bus.send("search/showSearchResults",{results:r,term:e}),r})))),o.bus.on("search/queryAsync",(({term:e})=>c.indexesCreated.then((()=>c.poiSearch.search({query:e}))))),o.bus.on("search/queryWithSpecial",(({term:e})=>{if(c.specialQueryTerms[e]){const{event:r,params:a}=c.specialQueryTerms[e];return o.bus.send(r,a)}return o.bus.get("search/query",{term:e})})),o.bus.on("search/getDefaultSearchTerms",(async({limit:e=5}={})=>{const r=c.defaultSearchTerms,a=r&&r.length?r:await async function(e){const r=(await o.bus.send("poi/getAllCategories"))[0],a=Array.from(new Set(r));return function(e){for(let r=e.length-1;r>0;r--){const a=Math.floor(Math.random()*(r+1));[e[r],e[a]]=[e[a],e[r]]}return e}(a).slice(0,e)}(e);return o.bus.send("search/showDefaultSearchKeywords",{keywords:a}),a})),o.bus.on("search/getDefaultSearchPois",(async({limit:r=5}={})=>{const a=await o.bus.get("poi/getAll"),t=e.pickBy(((e,r)=>e.isNavigable),a);return s(Object.values(t),r)})),o.bus.on("search/registerSpecialQuery",(({term:e,event:r,params:a,addKeyword:s=!0})=>{c.indexesCreated.then((()=>{s&&c.typeahead.addKeyword(e),c.specialQueryTerms[e]={event:r,params:a}}))})),o.bus.on("search/addKeywords",(({keywords:e})=>c.indexesCreated.then((()=>e.forEach((e=>c.typeahead.addKeyword(e))))))),o.bus.on("search/typeahead",(({term:e,limit:r})=>c.indexesCreated.then((()=>{const{keywords:a,pois:s}=c.typeahead.query(e,r);return{keywords:a,pois:s,term:e}})))),o.bus.on("venueData/loadNewVenue",(()=>{c.indexesCreated=new r,u()})),o.bus.on("poi/setDynamicData",(async({plugin:e,idValuesMap:r})=>{if("grab"!==e)return;const a=Object.keys(r).map((e=>o.bus.get("poi/getById",{id:e})));return Promise.all(a).then((e=>c.indexesCreated.then((()=>c.poiSearch.updateMultiple(e)))))}));return{init:u,runTest:async(e,r)=>(await r(),c)}}export{o as create};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"ramda";import a from"zousan";import{normalizeCoords as t,getVenueDataFromUrls as n,buildStructures as s,createFetchJson as u,createFetchText as o}from"./venueLoadingUtils.js";async function r(r,i){const d=r.log.sublog("venueDataLoader");let l=new a,c=new a;const p=a=>a.defaultStructureId||e.path(["structureOrder",0],a)||e.path(["selectorOrder",0],a)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(a),v=e=>{const a=i.availableLanguages.find((a=>a.langCode===e));return a||{langCode:e,assetSuffix:""}};async function g(a,t){a.assetStage&&"prod"!==a.assetStage&&location.hostname;const i=u(),c=o(),g=await n(a,i,t),{accountId:f,venueId:b}=a;g.assetStage=a.assetStage,g.defaultOrdinal=g.defaultOrdinal||function(a){const t=p(a),n=Object.values(a.structures).find(e.propEq("id",t));return n.levels[n.defaultLevelId].ordinal}(g),g.structures=s(g);const m=r.i18n().language,h=v(m);return g.bareVenueId=b.slice(0,b.length-h.assetSuffix.length),g.getTranslatedContentPath=e=>`https://content.locuslabs.com/${g.category}/${e}/${b}/${f}`,g.fetchJson=i,g.fetchText=c,d.info("venueData ",g,h,m),r.config.debug&&r.env.isBrowser&&(window._venueData=g),g.queueTypes&&(g.securityQueueTypes=(()=>{const e=g.queueTypes.find((e=>"SecurityLane"===e.id));return e?e.subtypes.map((e=>e.id)):[]})()),r.bus.send("venueData/venueDataLoaded",{venueData:g}),l.resolve(g),l}function f(e){const a={id:"venueDataLoader"};return e.id!==i.venueId&&(a.vid=e.id),a.lang=r.i18n().language,"prod"!==e.assetStage&&(a.stage=e.assetStage),r.bus.send("deepLinking/notifyState",a),e}r.bus.on("debugTools/fileDrop",(async({file:e,content:a})=>{if("application/json"===e.type){const e=JSON.parse(a);if(e.basemap&&e["basemap.venue"])return n=JSON.parse(a),void r.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return t=a,void r.bus.send("map/replaceStyle",{styleSrc:t})}var t,n}));const b=(e,a)=>e===a||0===e.indexOf(a+".");async function m(e){const a={...e},t=await r.bus.get("poi/getAll");return Object.values(a).forEach((e=>e.filter((e=>"poi"===e.properties.aiLayer&&"Point"===e.geometry.type)).forEach((e=>{const a=t[e.properties.id];a?a.mapLabel?e.properties.text=a.mapLabel:!1!==i.copyPOINamesToMap&&(e.properties.text=function(e){let a=e.name;return i.poiMapNameXForm?(Object.keys(i.poiMapNameXForm).filter((a=>b(e.category,a))).forEach((e=>{i.poiMapNameXForm[e].forEach((e=>a=a.replace(new RegExp(e.replace),e.with)))})),a):a}(a)):d.warn(`Unknown poi in style: ${e.properties.id}`)})))),a}const h=(a,t,n,s)=>{const u=a.replace(/-[^-]*$/,""),o=u===n?"landscape-background":`ordinal: ${s.find(e.hasPath(["levels",a])).levels[a].ordinal}`;return t.map((t=>{var s,r,i;return s="properties",r={venueId:n,structureId:u,ordinalId:o,levelId:a},i=t,t=e.over(e.lensProp(s),(a=>e.mergeRight(a||{},r)),i),t=e.assoc("id",t.properties.subid,t)}))};r.bus.on("venueData/loadMap",(async()=>{l.then((async t=>{const n=await t.fetchText(t.files.style),s=await t.fetchJson(t.files.theme),u=t.files.spritesheet,o=t.files.glyphs,{id:d,bounds:l,structures:p,venueCenter:v,venueRadius:g,defaultOrdinal:f}=t,b=t.venueList[d].mapTokens?{[d]:[]}:await async function(t){return e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.keys),e.prepend(t.id),e.map((e=>t.files.geoJson.replace("${geoJsonId}",e))),e.map(t.fetchJson),e.map(e.andThen((e=>[e.id,h(e.id,e.features,t.id,t.structures)]))),(e=>a.all(e)),e.andThen(e.fromPairs))(t)}(t).then(m),y={mapFeatures:b,mapStyleSource:n,mapTheme:s,badgesSpriteUrl:u,mapGlyphsUrl:o,structures:p,defaultOrdinal:f,venueBounds:{n:l.ne.lat,s:l.sw.lat,e:l.ne.lng,w:l.sw.lng},venueId:d,venueCenter:v,venueRadius:g,accountId:i.accountId,secure:void 0!==i.auth,tileServerAuthInfo:t.tileServerAuthInfo};c.resolve(y),r.bus.send("venueData/mapDataLoaded",y)}))}));const y=e=>null==e.shouldDisplay||e.shouldDisplay;r.bus.on("venueData/loadBuildingSelectorData",(()=>l.then((async a=>{const t={buildings:a.structures.filter(y).map(e.evolve({levels:e.pipe(e.values,e.sortWith([e.descend(e.prop("ordinal"))]))})),structureOrder:a.structureOrder,selectorOrder:a.selectorOrder};return r.bus.send("venueData/buildingSelectorDataLoaded",t),t})))),r.bus.on("venueData/normalizeCoords",(({coords:e})=>l.then((a=>t(e,a.bounds)))));const D={edges:[],nodes:[]};r.bus.on("venueData/loadNavGraph",(async()=>l.then((async e=>{const a={navGraphData:e.files.nav?await e.fetchJson(e.files.nav):D,structures:e.structures};return r.bus.send("venueData/navGraphLoaded",a),a})))),r.bus.on("venueData/loadPoiData",(async()=>l.then((async e=>{const a=i.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld;if(a){const t=await e.fetchJson(a);r.bus.send("venueData/poiDataLoaded",{pois:t,structures:e.structures})}})))),r.bus.on("venueData/getVenueCenter",(async()=>l.then((async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))))),r.bus.on("venueData/getContentUrl",(({type:e,name:a=""})=>l.then((t=>t.files[e]+a)))),r.bus.on("venueData/getFloorIdToNameMap",(()=>l.then(e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.values),e.map(e.props(["id","name"])),e.fromPairs)))),r.bus.on("venueData/getFloorIdName",(({floorId:a})=>l.then((async t=>{const n=e.pipe(e.values,e.find(e.hasPath(["levels",a])))(t.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[a].name}:null}))));const I=(a,t)=>()=>l.then(e.pipe(e.prop(a),e.defaultTo(t)));r.bus.on("venueData/getVenueData",(()=>l)),r.bus.on("venueData/getVenueName",I("name")),r.bus.on("venueData/getVenueCategory",I("category")),r.bus.on("venueData/getVenueTimezone",I("tz")),r.bus.on("venueData/getAccountId",(()=>i.accountId)),r.bus.on("venueData/getVenueId",I("id")),r.bus.on("venueData/getPositioningSupported",I("positioningSupported")),r.bus.on("venueData/getStructures",I("structures")),r.bus.on("venueData/loadNewVenue",(async({venueId:e,accountId:t,assetStage:n=i.assetStage})=>{l.reject(new Error("loadNewVenue called - previous loading ignored")),c.reject(new Error("loadNewVenue called - previous loading ignored")),l=new a,c=new a,g({...i,venueId:e,accountId:t,assetStage:n},[]).then(f)})),r.bus.on("venueData/changeVenueLanguage",(async({lang:e})=>l.then((async a=>{const t=v(e),n=`${a.bareVenueId}${t.assetSuffix}`;r.bus.send("venueData/loadNewVenue",{accountId:i.accountId,venueId:n})})))),r.bus.on("venueData/getPoiImageUrl",(({imageName:e,size:a})=>`https://img.locuslabs.com/resize/${i.accountId}/${a}cc/poi/${e}`)),r.bus.on("venueData/getDistributionId",(()=>l.then((e=>`${e.bareVenueId}-${i.accountId}`)))),r.bus.on("venueData/getCustomKeywords",(()=>l.then((e=>{const a=i.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(a)})))),r.bus.on("venueData/isGrabEnabled",I("enableGrab")),r.bus.on("venueData/getGrabPoiIds",I("grabPoiIds",[])),r.bus.on("venueData/getAssetsTimestamp",I("version")),r.bus.on("venueData/getTranslatedFloorId",(async({floorId:e})=>l.then((a=>{const t=r.i18n().language,n=v(t);return`${a.bareVenueId}${n.assetSuffix}-${e.split("-").slice(1).join("-")}`})))),r.bus.on("venueData/getQueueTypes",(()=>l.then((e=>{const a=["tsapre","clear","globalEntry"];return e.queueTypes?e.queueTypes.reduce(((e,t)=>{const{id:n,subtypes:s}=t,u=s.map((e=>{const t=a.includes(e.id)&&`security-logo-${e.id.toLowerCase()}`;return{...e,imageId:t}}));return e[n]=u,e}),{}):{}}))));return{init:async()=>{let e=[];null===new URLSearchParams("undefined"==typeof window?"":window.location.search).get("lang")&&(e="undefined"==typeof window?[]:navigator.languages);const a=i.deepLinkProps||{};a.lang&&e.unshift(a.lang);const t=a.vid||i.venueId,n=i.useDynamicUrlParams&&a.stage?a.stage:i.assetStage,s=a.accountId||("alpha"===n?"A1VPTJKREFJWX5":i.accountId);g({...i,venueId:t,accountId:s,assetStage:n},e).then(f)},runTest:async({testRoutine:e,reset:t=!1,venueData:n=null})=>{let s,u;return(t||n)&&(l=new a,c=new a),n&&(l=a.resolve(n)),await e(),l.v&&(s=await l),c.v&&(u=await c),{venueDataObj:s,mapDataObj:u}},internal:{getDefaultStructureId:p}}}export{r as create};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"ramda";import{findBoundsOfCoordinates as t}from"../../../src/utils/bounds.js";import{global as a}from"../../../src/utils/configUtils.js";const n=async(e,t)=>e?fetch(t,{headers:{Authorization:e}}):fetch(t),s=e=>t=>n(e,t).then((e=>e.json())),o=e=>t=>n(e,t).then((e=>e.text())),l=e=>`https://api.content.locuslabs.com/${e}`,r=(t,a,n,s,o)=>e.mapObjIndexed(((e,a)=>((e,t,a,n,s,o)=>"theme"===o||"style"===o?`${l(a)}/${t}/${o}/${s}/${n}/${o}.json`:e.replace(/https:\/\/content.locuslabs.com/gi,l(a)))(e,t,n,s,o,a)),a),i=async(e,t,n)=>{const s={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:o,accountId:l,formatVersion:i}=e;let{venueId:c}=e;const u=`https://${s[o]||s.prod}/accounts/${l}`,d=i||"v5",g=e.dataFetch&&a[e.dataFetch]&&a[e.dataFetch].getFiles?await a[e.dataFetch].getFiles(e):await t(`${u}/${d}.json`);if(n.length>0){const t=n.map((e=>e.slice(0,2)));for(let a=0;a<t.length;a+=1)if(g[`${c}${t[a]}`]){c=`${c}${t[a]}`,e.venueId=`${c}`;break}}if(!g[c])throw Error(`Attempt to access venue ${c} which is not within venue list: ${Object.keys(g)}`);const h=g[c].files,m=(e.dataFetch&&a[e.dataFetch]&&a[e.dataFetch].getVenueData?await a[e.dataFetch].getVenueData(e):await t(h.venueData))[c];m.tileServerAuthInfo&&function(e){const t={defaultOrdinal:0,defaultStructureId:"singleBuilding",formatVersion:"v5",structures:{singleBuilding:{name:"singleBuilding",boundsPolygon:[],defaultLevelId:"singleLevel",id:"singleBuilding",levels:{singleLevel:{boundsPolygon:[],clfloor:0,details:"",id:"singleLevel",name:"singleLevel",ordinal:0}}}},structureOrder:["singleBuilding"]};for(const a in t)e[a]=t[a]}(m),m.venueList=g;const p=(e=>{const t=e.deepLinkProps?e.deepLinkProps.contentStage:null;return"alpha"===t||"beta"===t||"prod"===t?t:null})(e);return m.files=p?r(m.category,h,p,l,c):h,m},c=e=>{const{structureOrder:a,structures:n}=e;return a.map((e=>{const a=n[e],s=t(a.boundsPolygon);return{...a,bounds:s}}))};const u=([e,t,...a])=>[t,e,...a],d=(e,t)=>{return!e||!Array.isArray(e)||e.length<1?e:(a=e[0][0],n=t.ne.lng,s=t.sw.lng,(a>n?a<=s:e=>s)?e:e.map(u));var a,n,s};export{c as buildStructures,s as createFetchJson,o as createFetchText,i as getVenueDataFromUrls,d as normalizeCoords};
|
package/dist/src/app.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ApplicationInsights as e}from"@microsoft/applicationinsights-web";import n from"IObject";import t from"query-string";import{map as o,mergeDeepRight as i}from"ramda";import r from"zousan-plus";import a from"../package.json.js";import s from"./debugTools.js";import{buildEnv as l}from"./env.js";import{create as c}from"./extModules/bustle.js";import{initLog as u}from"./extModules/log.js";import g from"./utils/i18n.js";const p="undefined"!=typeof window;async function d(e,n,t){let o=n;if(o.includes("/")){const e=o.split("/");o=e[e.length-1]}return void 0!==t.active&&(!1===t.active||"notLocalhost"===t.active&&e.env.isLocalhost())?(e.log.info(`Plugin ${n} explicitly deativated`),null):import(`../plugins/${n}/src/${o}.js`).then((o=>(e.log.info(`Creating plugin ${n}`),o.create(e,t))))}async function m(e){return p?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function f(e,n){let t={};const o=await Promise.all(n.map(m));for(const e of o){let n=e.default;n=n.extends?await f(n,n.extends):n,t=i(t,n)}return t=i(t,e),t}const w=e=>n=>import(`./configs/postproc-${e}.js`).then((e=>e.process(n)));async function h(i){const m=Object.create(null);let h=i.extends?await f(i,i.extends):i;h.plugins.monitoring&&import("../_virtual/_empty_module_placeholder.js").then((e=>e.activate(h))),h=await(async e=>e.configPostProc?r.series(e,...e.configPostProc.map(w)):e)(h);const y=(e=>{const n=e.supportedLanguages||["ar","en","es","fr","ja","ko","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=t.parse(location.search).lang||navigator.language;for(;e;){if(e&&n.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"))}}return e.defaultLanguage||"en"})(h),b=await g(y,{debug:h.debug});m.i18n=()=>b,m.gt=()=>b.t.bind(b),m.config=h,m.plugins=new n;const j=u("web-engine",{enabled:!!h.debug,isBrowser:p,color:"cyan",logFilter:h.logFilter,truncateObjects:!p});if(m.log=j.sublog(h.name),m.bus=c({trace:!1,showEvents:!0,reportAllErrors:!0,log:j}),m.info={wePkg:a},process.env.APP_INSIGHTS){const n=new e({config:{connectionString:process.env.APP_INSIGHTS,disableAjaxTracking:!0,disableFetchTracking:!0}});n.loadAppInsights(),m.bus.on("appInsights/log",(e=>{e.properties.location=window.location.origin,n.trackEvent({...e}),n.flush()}))}if("undefined"!=typeof window&&(h.debug?(m.debug=o((e=>e.bind(m)),s),s.dndGo.call(m)):m.debug={},window._app=m,window.document&&window.document.title&&h.setWindowTitle&&(document.title=h.name)),m.env=l(m),h.theme?await r.evaluate({name:"ThemeManagerModule",value:import("../_virtual/_empty_module_placeholder.js")},{name:"HistoryManager",value:import("./historyManager.js")},{name:"LayerManager",value:import("../_virtual/_empty_module_placeholder.js")}).then((async({LayerManager:e,HistoryManager:n,ThemeManagerModule:t})=>{const o=t.initThemeManager(m);m.themePack=await o.buildTheme(h.theme,h.defaultTheme),e.initLayerManager(m),n.initHistoryManager(m),m.destroy=()=>e.destroy(m)})):m.destroy=()=>{},h.plugins){for(const e in h.plugins)try{const n=h.plugins[e];if(m.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const t=await d(m,e,n);t&&(m.plugins=m.plugins.set(e,t))}catch(n){j.error("Error instantiating plugin "+e),j.error(n)}for(const e in m.plugins)m.plugins[e].init()}return m}export{h as create};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atriusmaps-node-sdk",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.225",
|
|
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",
|
|
@@ -14,23 +14,26 @@
|
|
|
14
14
|
"atrius",
|
|
15
15
|
"acuitybrands"
|
|
16
16
|
],
|
|
17
|
-
"repository": "https://gitlab.com/locuslabspublic/atriusmaps-node-sdk",
|
|
18
17
|
"license": "UNLICENSED",
|
|
19
18
|
"author": "Glenn Crownover <crownover@locuslabs.com>",
|
|
20
19
|
"type": "module",
|
|
21
20
|
"exports": {
|
|
22
21
|
".": {
|
|
23
|
-
"import": "./
|
|
24
|
-
"require": "./dist/cjs/
|
|
25
|
-
"default": "./dist/cjs/
|
|
22
|
+
"import": "./dist/nodesdk/nodeEntry.js",
|
|
23
|
+
"require": "./dist/cjs/nodesdk/nodeEntry.js",
|
|
24
|
+
"default": "./dist/cjs/nodesdk/nodeEntry.js"
|
|
26
25
|
},
|
|
27
26
|
"./package.json": "./package.json"
|
|
28
27
|
},
|
|
29
|
-
"main": "./dist/cjs/
|
|
30
|
-
"module": "./lib/
|
|
28
|
+
"main": "./dist/cjs/nodesdk/nodeEntry.js",
|
|
29
|
+
"module": "./lib/nodesdk/nodeEntry.js",
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
31
33
|
"scripts": {
|
|
32
|
-
"build": "
|
|
33
|
-
"
|
|
34
|
+
"build": "rollup -c rollup.config.js && cp package-cjs.json dist/cjs/package.json",
|
|
35
|
+
"test": "yarn build && yarn test:nobuild",
|
|
36
|
+
"test:nobuild": "jest --no-cache --verbose --forceExit --testMatch='**/test/**.js'"
|
|
34
37
|
},
|
|
35
38
|
"dependencies": {
|
|
36
39
|
"@turf/circle": "^6.5.0",
|
|
@@ -47,6 +50,7 @@
|
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
52
|
"@rollup/plugin-json": "^4.1.0",
|
|
53
|
+
"jest": "^29.7.0",
|
|
50
54
|
"rollup": "^2.59.0"
|
|
51
55
|
}
|
|
52
56
|
}
|
package/.yarnrc.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodeLinker: node-modules
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import json from '@rollup/plugin-json'
|
|
2
|
-
// import { terser } from 'rollup-plugin-terser'
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
input: [
|
|
6
|
-
'./lib/src/configs/sdkHeadless.json',
|
|
7
|
-
'./lib/src/utils/observable.js',
|
|
8
|
-
'./lib/plugins/clientAPI/src/clientAPI.js',
|
|
9
|
-
'./lib/plugins/dynamicPois/src/dynamicPois.js',
|
|
10
|
-
'./lib/plugins/poiDataManager/src/poiDataManager.js',
|
|
11
|
-
'./lib/plugins/sdkServer/src/sdkServer.js',
|
|
12
|
-
'./lib/plugins/searchService/src/searchService.js',
|
|
13
|
-
'./lib/plugins/venueDataLoader/src/venueDataLoader.js',
|
|
14
|
-
'./lib/plugins/wayfinder/src/wayfinder.js',
|
|
15
|
-
'./lib/deploy/nodeEntry.js'
|
|
16
|
-
],
|
|
17
|
-
output: {
|
|
18
|
-
format: 'cjs',
|
|
19
|
-
plugins: [
|
|
20
|
-
// terser()
|
|
21
|
-
],
|
|
22
|
-
inlineDynamicImports: false,
|
|
23
|
-
preserveModules: true,
|
|
24
|
-
preserveModulesRoot: "lib",
|
|
25
|
-
// file: 'dist/cjs/atriusmaps.js'
|
|
26
|
-
dir: 'dist/cjs/'
|
|
27
|
-
},
|
|
28
|
-
plugins: [
|
|
29
|
-
json()
|
|
30
|
-
]
|
|
31
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var e = require('node:http');
|
|
4
|
-
var t = require('node:https');
|
|
5
|
-
var httpsProxyAgent = require('https-proxy-agent');
|
|
6
|
-
var o = require('node-fetch');
|
|
7
|
-
var package_json = require('../package.json.js');
|
|
8
|
-
var controller = require('../src/controller.js');
|
|
9
|
-
var observable = require('../src/utils/observable.js');
|
|
10
|
-
var prepareSDKConfig = require('./prepareSDKConfig.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var e__default = /*#__PURE__*/_interopDefaultLegacy(e);
|
|
15
|
-
var t__default = /*#__PURE__*/_interopDefaultLegacy(t);
|
|
16
|
-
var o__default = /*#__PURE__*/_interopDefaultLegacy(o);
|
|
17
|
-
|
|
18
|
-
const a=package_json["default"].version;let g=!1;const m=e=>e.toString().length<2?"0"+e:e,p=()=>`AtriusMaps Node SDK (${(()=>{const e=new Date;return `${e.getHours()}:${m(e.getMinutes())}:${m(e.getSeconds())}.${e.getMilliseconds()}`})()}): `,l=function(){if(g){let e=p()+Array.from(arguments).map((e=>"object"==typeof e?JSON.stringify(e):e)).join(" ");const t=e.split("\n");t.length>1?e=t[0]+`… (+ ${t.length-1} lines)`:e.length>256&&(e=e.substring(0,255)+`… (length: ${e.length} chars)`),console.log(e);}};async function f(r){return new Promise(((a,g)=>{r.headless=!0,function(r){const s=new e__default["default"].Agent({keepAlive:!0}),c=new t__default["default"].Agent({keepAlive:!0}),i=r.proxy?new httpsProxyAgent.HttpsProxyAgent(`http://${r.proxy.host}:${r.proxy.port}`):null,a=r.agent||i||(e=>"http:"===e.protocol?s:c);global.fetch=async(e,t)=>o__default["default"](e,{...t,agent:a});}(r);const m=prepareSDKConfig(r);controller.create(m).then((e=>{const t=(t,n)=>("string"==typeof t&&(t={...n,command:t}),l("Sending command object: ",t),e.bus.get("clientAPI/execute",t).then((e=>(l("Received Message: ",e),e))).catch((e=>{throw l("Error: ",e.message),e})));observable(t),e.eventListener.observe((function(){t.fire.apply(t,arguments);})),t.on("ready",((e,n)=>{const{commands:o}=n.commandJSON;!function(e,t){t.forEach((t=>{e[t.command]=function(){const n={command:t.command};for(let e=0;e<arguments.length;e++)n[t.args[e].name]=arguments[e];return e(n)};}));}(t,o),a(t),l("map ready");}));}));}))}const h={getVersion:()=>a,newMap:e=>f(e),setLogging:e=>{g=e,e&&l(`Atrius Maps JS SDK Client v${a} Logging enabled.`);}};
|
|
19
|
-
|
|
20
|
-
module.exports = h;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function _interopNamespace(e) {
|
|
4
|
-
if (e && e.__esModule) return e;
|
|
5
|
-
var n = Object.create(null);
|
|
6
|
-
if (e) {
|
|
7
|
-
Object.keys(e).forEach(function (k) {
|
|
8
|
-
if (k !== 'default') {
|
|
9
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () { return e[k]; }
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
n["default"] = e;
|
|
18
|
-
return Object.freeze(n);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async function t(t,e){const o=await(async()=>{if(!t||!t.type)throw Error("No authentication type found in config");return Promise.resolve((t=>{switch(t.type){case"ms":return "MSAuth";case"cognito":return "CognitoAuth";case"google":return "GoogleAuth";default:throw Error(`Unknown auth type: '${t.type}'`)}})(t)).then((t=>(function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`./${t}`))).then((o=>o.default(t.config,e)))})();return {getToken:async()=>o.getToken(),isLoggedIn:async()=>o.isLoggedIn(),federatedLogin:async()=>o.federatedLogin(),logout:()=>o.logout(),getAccountInfo:()=>o.getAccountInfo(),getType:()=>t.type}}
|
|
22
|
-
|
|
23
|
-
module.exports = t;
|
package/lib/deploy/nodeEntry.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"node:http";import t from"node:https";import{HttpsProxyAgent as n}from"https-proxy-agent";import o from"node-fetch";import r from"../package.json.js";import{create as s}from"../src/controller.js";import c from"../src/utils/observable.js";import i from"./prepareSDKConfig.js";const a=r.version;let g=!1;const m=e=>e.toString().length<2?"0"+e:e,p=()=>`AtriusMaps Node SDK (${(()=>{const e=new Date;return`${e.getHours()}:${m(e.getMinutes())}:${m(e.getSeconds())}.${e.getMilliseconds()}`})()}): `,l=function(){if(g){let e=p()+Array.from(arguments).map((e=>"object"==typeof e?JSON.stringify(e):e)).join(" ");const t=e.split("\n");t.length>1?e=t[0]+`… (+ ${t.length-1} lines)`:e.length>256&&(e=e.substring(0,255)+`… (length: ${e.length} chars)`),console.log(e)}};async function f(r){return new Promise(((a,g)=>{r.headless=!0,function(r){const s=new e.Agent({keepAlive:!0}),c=new t.Agent({keepAlive:!0}),i=r.proxy?new n(`http://${r.proxy.host}:${r.proxy.port}`):null,a=r.agent||i||(e=>"http:"===e.protocol?s:c);global.fetch=async(e,t)=>o(e,{...t,agent:a})}(r);const m=i(r);s(m).then((e=>{const t=(t,n)=>("string"==typeof t&&(t={...n,command:t}),l("Sending command object: ",t),e.bus.get("clientAPI/execute",t).then((e=>(l("Received Message: ",e),e))).catch((e=>{throw l("Error: ",e.message),e})));c(t),e.eventListener.observe((function(){t.fire.apply(t,arguments)})),t.on("ready",((e,n)=>{const{commands:o}=n.commandJSON;!function(e,t){t.forEach((t=>{e[t.command]=function(){const n={command:t.command};for(let e=0;e<arguments.length;e++)n[t.args[e].name]=arguments[e];return e(n)}}))}(t,o),a(t),l("map ready")}))}))}))}const h={getVersion:()=>a,newMap:e=>f(e),setLogging:e=>{g=e,e&&l(`Atrius Maps JS SDK Client v${a} Logging enabled.`)}};export{h as default};
|
package/lib/package.json.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e="web-engine",s="3.3.196",o="UNLICENSED",l="module",t="src/main.js",a=["demo","deploy","pagesSrc","src/extModules/flexapi"],r={colors:"cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt",demo:"cd demo/ && yarn start","e2e:record":"yarn cypress run --env RECORD_MODE=true",e2eTest:"percy exec -- cypress run --browser chrome",goProd:"cd deploy && scripts/goProd.sh",goStaging:"deploy/scripts/goStaging.sh",lint:"eslint . --max-warnings=0",mod:"demo/startMod.sh",mol:"demo/startMol.sh",molProd:"cd deploy && yarn buildAndRunMol",mos:"demo/startMos.sh",prepare:"husky install",test:"jest --no-cache --verbose","test-watch":"jest --verbose --watch","test:e2e:video":"cypress run","cypress:comp":"cypress open --component --browser chrome"},n=["defaults"],i={"@azure/event-hubs":"^5.6.0","@dnd-kit/core":"^6.0.8","@dnd-kit/sortable":"^7.0.2","@dnd-kit/utilities":"^3.2.1","@john-osullivan/react-window-dynamic-fork":"^1.9.0-alpha.1","@locus-labs/mod-badge":"^0.1.102","@locus-labs/mod-default-theme":"^0.0.113","@locus-labs/mod-footer":"^0.0.111","@locus-labs/mod-header":"^0.0.105","@locus-labs/mod-location-marker":"^0.0.104","@locus-labs/mod-map-legend":"^0.0.104","@locus-labs/mod-offscreen-indicator":"^0.0.104","@locus-labs/mod-pin":"^0.0.104","@locus-labs/mod-qr-code-card":"^0.0.104","@locus-labs/mod-qr-code-window":"^0.0.105","@locus-labs/mod-walk-time-matrix":"^0.0.103","@locus-labs/mol-desktop-building-level-selector":"^0.1.108","@locus-labs/mol-desktop-compass":"^0.1.120","@locus-labs/mol-desktop-default-theme":"^0.2.105","@locus-labs/mol-desktop-icon":"^0.1.131","@locus-labs/mol-desktop-logo":"^0.1.101","@locus-labs/mol-desktop-map-nav-button":"^0.1.130","@locus-labs/mol-desktop-submenu":"^0.1.116","@locus-labs/mol-desktop-tooltip":"^0.3.102","@locus-labs/mol-desktop-zoom-control":"^0.1.128","@locus-labs/mol-mobile-floating-action-button":"^0.0.106","@locus-labs/mol-mobile-toast":"^0.1.102","@mapbox/mapbox-gl-draw":"^1.3.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@turf/circle":"^6.5.0","@turf/helpers":"^6.5.0","@turf/point-to-line-distance":"^6.5.0","@vitejs/plugin-react":"^4.0.1",IObject:"^0.7.2","crypto-browserify":"^3.12.0","file-loader":"^6.2.0",flexsearch:"^0.7.31","h3-js":"^4.1.0",i18next:"^20.3.4","i18next-browser-languagedetector":"^6.1.1","jest-transform-css":"4.0.1",jsonschema:"^1.2.6",luxon:"^3.3.0","maplibre-gl":"~2.1.9","mini-css-extract-plugin":"^1.6.0","node-polyfill-webpack-plugin":"^1.1.4","path-browserify":"^1.0.1",polished:"^4.0.2","prop-types":"^15.7.2","query-string":"^8.1.0",ramda:"^0.28.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":"^16.1.29","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"},c={"@babel/core":"^7.14.8","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.20.0","@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":"^5.0.0","babel-polyfill":"^6.26.0","chai-colors":"^1.0.1","css-loader":"^5.2.4",cypress:"^12.17.2","cypress-browser-permissions":"^1.1.0","cypress-real-events":"^1.11.0","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",glob:"^10.3.3",husky:"^6.0.0",jest:"27.5.1","lint-staged":"^11.0.1","node-fetch":"^2.6.0","null-loader":"^4.0.1","start-server-and-test":"^2.0.0",vite:"^4.3.9",webpack:"^5.84.1","webpack-merge":"^5.8.0"},d="yarn@4.0.2",p={node:">=20"},m={name:e,version:s,private:!0,license:o,type:l,main:t,workspaces:a,scripts:r,"lint-staged":{"*.js":["eslint --fix"]},browserslist:n,dependencies:i,devDependencies:c,packageManager:d,engines:p};export{n as browserslist,m as default,i as dependencies,c as devDependencies,p as engines,o as license,t as main,e as name,d as packageManager,r as scripts,l as type,s as version,a as workspaces};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"ramda";import r from"zousan";import{getLocalized as a}from"../../../src/utils/configUtils.js";import{arrayPick as s}from"../../../src/utils/rand.js";import t from"./poiSearch.js";import n from"./searchTypeahead.js";function o(o,i){const c={poiSearch:null,typeahead:null,indexesCreated:new r,defaultSearchTerms:null,specialQueryTerms:{}},u=async()=>{const e=await o.bus.get("poi/getAll");c.poiSearch=t(e,o.i18n().language),c.typeahead=n(e,c.poiSearch.search,o.i18n().language),c.defaultSearchTerms=a(i,"defaultSearchTerms",o.i18n().language),c.indexesCreated.resolve()};async function d(){const r=await o.bus.get("user/getPhysicalLocation"),a=await o.bus.get("poi/getByFloorId",{floorId:r.floorId}),s=Object.values(e.pickBy((e=>-1===e.category.indexOf("portal")&&"element.door"!==e.category),a)),t=await o.bus.get("wayfinder/addPathTimeMultiple",{pois:s,startLocation:r});return e.sortBy(e.prop("distance"),Object.values(t)).slice(0,50)}o.bus.on("search/queryNearby",(async()=>{const e=await d();return o.bus.send("search/showNearby",{pois:e,term:"Nearby"}),e})),o.bus.on("search/queryNearbyAsync",d),o.bus.on("search/queryCategory",(async({category:e,categoryName:r,searchTerm:a})=>{const s=await c.indexesCreated.then((()=>c.poiSearch.search({query:a||e})));return o.bus.send("search/showCategory",{pois:s,category:e,categoryName:r}),s})),o.bus.on("search/query",(({term:e})=>c.indexesCreated.then((()=>{const r=c.poiSearch.search({query:e});return o.bus.send("search/showSearchResults",{results:r,term:e}),r})))),o.bus.on("search/queryAsync",(({term:e})=>c.indexesCreated.then((()=>c.poiSearch.search({query:e}))))),o.bus.on("search/queryWithSpecial",(({term:e})=>{if(c.specialQueryTerms[e]){const{event:r,params:a}=c.specialQueryTerms[e];return o.bus.send(r,a)}return o.bus.get("search/query",{term:e})})),o.bus.on("search/getDefaultSearchTerms",(async({limit:e=5}={})=>{const r=c.defaultSearchTerms,a=r&&r.length?r:await async function(e){const r=(await o.bus.send("poi/getAllCategories"))[0],a=Array.from(new Set(r));return function(e){for(let r=e.length-1;r>0;r--){const a=Math.floor(Math.random()*(r+1));[e[r],e[a]]=[e[a],e[r]]}return e}(a).slice(0,e)}(e);return o.bus.send("search/showDefaultSearchKeywords",{keywords:a}),a})),o.bus.on("search/getDefaultSearchPois",(async({limit:r=5}={})=>{const a=await o.bus.get("poi/getAll"),t=e.pickBy(((e,r)=>e.isNavigable),a);return s(Object.values(t),r)})),o.bus.on("search/registerSpecialQuery",(({term:e,event:r,params:a,addKeyword:s=!0})=>{c.indexesCreated.then((()=>{s&&c.typeahead.addKeyword(e),c.specialQueryTerms[e]={event:r,params:a}}))})),o.bus.on("search/addKeywords",(({keywords:e})=>c.indexesCreated.then((()=>e.forEach((e=>c.typeahead.addKeyword(e))))))),o.bus.on("search/typeahead",(({term:e,limit:r})=>c.indexesCreated.then((()=>{const{keywords:a,pois:s}=c.typeahead.query(e,r);return{keywords:a,pois:s,term:e}})))),o.bus.on("venueData/loadNewVenue",(()=>{c.indexesCreated=new r,u()})),o.bus.on("poi/setDynamicData",(async({plugin:e,idValuesMap:r})=>{if("grab"!==e)return;const a=Object.keys(r).map((e=>o.bus.get("poi/getById",{id:e})));return Promise.all(a).then((e=>c.indexesCreated.then((()=>c.poiSearch.updateMultiple(e)))))}));return{init:u,runTest:async(e,r)=>(await r(),c)}}export{o as create};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"ramda";import a from"zousan";import{normalizeCoords as t,getVenueDataFromUrls as n,buildStructures as s,createFetchJson as u,createFetchText as o}from"./venueLoadingUtils.js";async function r(r,i){const d=r.log.sublog("venueDataLoader");let l=new a,c=new a;const p=a=>a.defaultStructureId||e.path(["structureOrder",0],a)||e.path(["selectorOrder",0],a)||e.pipe(e.prop("structures"),Object.values,e.path([0,"id"]))(a),v=e=>{const a=i.availableLanguages.find((a=>a.langCode===e));return a||{langCode:e,assetSuffix:""}};async function g(a){a.assetStage&&"prod"!==a.assetStage&&location.hostname;const t=u(),i=o(),c=await n(a,t),{accountId:g,venueId:f}=a;c.assetStage=a.assetStage,c.defaultOrdinal=c.defaultOrdinal||function(a){const t=p(a),n=Object.values(a.structures).find(e.propEq("id",t));return n.levels[n.defaultLevelId].ordinal}(c),c.structures=s(c);const b=r.i18n().language,m=v(b);return c.bareVenueId=f.slice(0,f.length-m.assetSuffix.length),c.getTranslatedContentPath=e=>`https://content.locuslabs.com/${c.category}/${e}/${f}/${g}`,c.fetchJson=t,c.fetchText=i,d.info("venueData ",c,m,b),r.config.debug&&r.env.isBrowser&&(window._venueData=c),c.queueTypes&&(c.securityQueueTypes=(()=>{const e=c.queueTypes.find((e=>"SecurityLane"===e.id));return e?e.subtypes.map((e=>e.id)):[]})()),r.bus.send("venueData/venueDataLoaded",{venueData:c}),l.resolve(c),l}function f(e){const a={id:"venueDataLoader"};return e.id!==i.venueId&&(a.vid=e.id),a.lang=r.i18n().language,"prod"!==e.assetStage&&(a.stage=e.assetStage),r.bus.send("deepLinking/notifyState",a),e}r.bus.on("debugTools/fileDrop",(async({file:e,content:a})=>{if("application/json"===e.type){const e=JSON.parse(a);if(e.basemap&&e["basemap.venue"])return n=JSON.parse(a),void r.bus.send("map/replaceTheme",{theme:n});if(e.metadata&&e.metadata["mapbox:type"])return t=a,void r.bus.send("map/replaceStyle",{styleSrc:t})}var t,n}));const b=(e,a)=>e===a||0===e.indexOf(a+".");async function m(e){const a={...e},t=await r.bus.get("poi/getAll");return Object.values(a).forEach((e=>e.filter((e=>"poi"===e.properties.aiLayer&&"Point"===e.geometry.type)).forEach((e=>{const a=t[e.properties.id];a?a.mapLabel?e.properties.text=a.mapLabel:!1!==i.copyPOINamesToMap&&(e.properties.text=function(e){let a=e.name;return i.poiMapNameXForm?(Object.keys(i.poiMapNameXForm).filter((a=>b(e.category,a))).forEach((e=>{i.poiMapNameXForm[e].forEach((e=>a=a.replace(new RegExp(e.replace),e.with)))})),a):a}(a)):d.warn(`Unknown poi in style: ${e.properties.id}`)})))),a}const h=(a,t,n,s)=>{const u=a.replace(/-[^-]*$/,""),o=u===n?"landscape-background":`ordinal: ${s.find(e.hasPath(["levels",a])).levels[a].ordinal}`;return t.map((t=>{var s,r,i;return s="properties",r={venueId:n,structureId:u,ordinalId:o,levelId:a},i=t,t=e.over(e.lensProp(s),(a=>e.mergeRight(a||{},r)),i),t=e.assoc("id",t.properties.subid,t)}))};r.bus.on("venueData/loadMap",(async()=>{l.then((async t=>{const n=await t.fetchText(t.files.style),s=await t.fetchJson(t.files.theme),u=t.files.spritesheet,o=t.files.glyphs,{id:d,bounds:l,structures:p,venueCenter:v,venueRadius:g,defaultOrdinal:f}=t,b=t.venueList[d].mapTokens?{[d]:[]}:await async function(t){return e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.keys),e.prepend(t.id),e.map((e=>t.files.geoJson.replace("${geoJsonId}",e))),e.map(t.fetchJson),e.map(e.andThen((e=>[e.id,h(e.id,e.features,t.id,t.structures)]))),(e=>a.all(e)),e.andThen(e.fromPairs))(t)}(t).then(m),y={mapFeatures:b,mapStyleSource:n,mapTheme:s,badgesSpriteUrl:u,mapGlyphsUrl:o,structures:p,defaultOrdinal:f,venueBounds:{n:l.ne.lat,s:l.sw.lat,e:l.ne.lng,w:l.sw.lng},venueId:d,venueCenter:v,venueRadius:g,accountId:i.accountId,secure:void 0!==i.auth,tileServerAuthInfo:t.tileServerAuthInfo};c.resolve(y),r.bus.send("venueData/mapDataLoaded",y)}))}));const y=e=>null==e.shouldDisplay||e.shouldDisplay;r.bus.on("venueData/loadBuildingSelectorData",(()=>l.then((async a=>{const t={buildings:a.structures.filter(y).map(e.evolve({levels:e.pipe(e.values,e.sortWith([e.descend(e.prop("ordinal"))]))})),structureOrder:a.structureOrder,selectorOrder:a.selectorOrder};return r.bus.send("venueData/buildingSelectorDataLoaded",t),t})))),r.bus.on("venueData/normalizeCoords",(({coords:e})=>l.then((a=>t(e,a.bounds)))));const D={edges:[],nodes:[]};r.bus.on("venueData/loadNavGraph",(async()=>l.then((async e=>{const a={navGraphData:e.files.nav?await e.fetchJson(e.files.nav):D,structures:e.structures};return r.bus.send("venueData/navGraphLoaded",a),a})))),r.bus.on("venueData/loadPoiData",(async()=>l.then((async e=>{const a=i.useOldDataModel?e.files.poisOld||e.files.pois:e.files.pois||e.files.poisOld;if(a){const t=await e.fetchJson(a);r.bus.send("venueData/poiDataLoaded",{pois:t,structures:e.structures})}})))),r.bus.on("venueData/getVenueCenter",(async()=>l.then((async e=>({lat:e.venueCenter[0],lng:e.venueCenter[1],ordinal:0}))))),r.bus.on("venueData/getContentUrl",(({type:e,name:a=""})=>l.then((t=>t.files[e]+a)))),r.bus.on("venueData/getFloorIdToNameMap",(()=>l.then(e.pipe(e.prop("structures"),e.map(e.prop("levels")),e.chain(e.values),e.map(e.props(["id","name"])),e.fromPairs)))),r.bus.on("venueData/getFloorIdName",(({floorId:a})=>l.then((async t=>{const n=e.pipe(e.values,e.find(e.hasPath(["levels",a])))(t.structures);return n?{structureId:n.id,structureName:n.name,floorName:n.levels[a].name}:null}))));const I=(a,t)=>()=>l.then(e.pipe(e.prop(a),e.defaultTo(t)));r.bus.on("venueData/getVenueData",(()=>l)),r.bus.on("venueData/getVenueName",I("name")),r.bus.on("venueData/getVenueCategory",I("category")),r.bus.on("venueData/getVenueTimezone",I("tz")),r.bus.on("venueData/getAccountId",(()=>i.accountId)),r.bus.on("venueData/getVenueId",I("id")),r.bus.on("venueData/getPositioningSupported",I("positioningSupported")),r.bus.on("venueData/getStructures",I("structures")),r.bus.on("venueData/loadNewVenue",(async({venueId:e,accountId:t,assetStage:n=i.assetStage})=>{l.reject(new Error("loadNewVenue called - previous loading ignored")),c.reject(new Error("loadNewVenue called - previous loading ignored")),l=new a,c=new a,g({...i,venueId:e,accountId:t,assetStage:n}).then(f)})),r.bus.on("venueData/changeVenueLanguage",(async({lang:e})=>l.then((async a=>{const t=v(e),n=`${a.bareVenueId}${t.assetSuffix}`;r.bus.send("venueData/loadNewVenue",{accountId:i.accountId,venueId:n})})))),r.bus.on("venueData/getPoiImageUrl",(({imageName:e,size:a})=>`https://img.locuslabs.com/resize/${i.accountId}/${a}cc/poi/${e}`)),r.bus.on("venueData/getDistributionId",(()=>l.then((e=>`${e.bareVenueId}-${i.accountId}`)))),r.bus.on("venueData/getCustomKeywords",(()=>l.then((e=>{const a=i.useOldDataModel&&e.files.searchOld||e.files.search;return e.fetchJson(a)})))),r.bus.on("venueData/isGrabEnabled",I("enableGrab")),r.bus.on("venueData/getGrabPoiIds",I("grabPoiIds",[])),r.bus.on("venueData/getAssetsTimestamp",I("version")),r.bus.on("venueData/getTranslatedFloorId",(async({floorId:e})=>l.then((a=>{const t=r.i18n().language,n=v(t);return`${a.bareVenueId}${n.assetSuffix}-${e.split("-").slice(1).join("-")}`})))),r.bus.on("venueData/getQueueTypes",(()=>l.then((e=>{const a=["tsapre","clear","globalEntry"];return e.queueTypes?e.queueTypes.reduce(((e,t)=>{const{id:n,subtypes:s}=t,u=s.map((e=>{const t=a.includes(e.id)&&`security-logo-${e.id.toLowerCase()}`;return{...e,imageId:t}}));return e[n]=u,e}),{}):{}}))));return{init:async()=>{const e=i.deepLinkProps||{},a=e.vid||i.venueId,t=i.useDynamicUrlParams&&e.stage?e.stage:i.assetStage,n=e.accountId||("alpha"===t?"A1VPTJKREFJWX5":i.accountId);g({...i,venueId:a,accountId:n,assetStage:t}).then(f)},runTest:async({testRoutine:e,reset:t=!1,venueData:n=null})=>{let s,u;return(t||n)&&(l=new a,c=new a),n&&(l=a.resolve(n)),await e(),l.v&&(s=await l),c.v&&(u=await c),{venueDataObj:s,mapDataObj:u}},internal:{getDefaultStructureId:p}}}export{r as create};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as t from"ramda";import{findBoundsOfCoordinates as e}from"../../../src/utils/bounds.js";import{global as a}from"../../../src/utils/configUtils.js";const n=async(t,e)=>t?fetch(e,{headers:{Authorization:t}}):fetch(e),s=t=>e=>n(t,e).then((t=>t.json())),o=t=>e=>n(t,e).then((t=>t.text())),l=t=>`https://api.content.locuslabs.com/${t}`,r=(e,a,n,s,o)=>t.mapObjIndexed(((t,a)=>((t,e,a,n,s,o)=>"theme"===o||"style"===o?`${l(a)}/${e}/${o}/${s}/${n}/${o}.json`:t.replace(/https:\/\/content.locuslabs.com/gi,l(a)))(t,e,n,s,o,a)),a),i=async(t,e)=>{const n={alpha:"alpha-a.locuslabs.com",beta:"beta-a.locuslabs.com",gamma:"gamma-a.locuslabs.com",prod:"a.locuslabs.com"},{assetStage:s,venueId:o,accountId:l,formatVersion:i}=t,c=`https://${n[s]||n.prod}/accounts/${l}`,u=i||"v5",d=t.dataFetch&&a[t.dataFetch]&&a[t.dataFetch].getFiles?await a[t.dataFetch].getFiles(t):await e(`${c}/${u}.json`);if(!d[o])throw Error(`Attempt to access venue ${o} which is not within venue list: ${Object.keys(d)}`);const g=d[o].files,h=(t.dataFetch&&a[t.dataFetch]&&a[t.dataFetch].getVenueData?await a[t.dataFetch].getVenueData(t):await e(g.venueData))[o];h.tileServerAuthInfo&&function(t){const e={defaultOrdinal:0,defaultStructureId:"singleBuilding",formatVersion:"v5",structures:{singleBuilding:{name:"singleBuilding",boundsPolygon:[],defaultLevelId:"singleLevel",id:"singleBuilding",levels:{singleLevel:{boundsPolygon:[],clfloor:0,details:"",id:"singleLevel",name:"singleLevel",ordinal:0}}}},structureOrder:["singleBuilding"]};for(const a in e)t[a]=e[a]}(h),h.venueList=d;const m=(t=>{const e=t.deepLinkProps?t.deepLinkProps.contentStage:null;return"alpha"===e||"beta"===e||"prod"===e?e:null})(t);return h.files=m?r(h.category,g,m,l,o):g,h},c=t=>{const{structureOrder:a,structures:n}=t;return a.map((t=>{const a=n[t],s=e(a.boundsPolygon);return{...a,bounds:s}}))};const u=([t,e,...a])=>[e,t,...a],d=(t,e)=>{return!t||!Array.isArray(t)||t.length<1?t:(a=t[0][0],n=e.ne.lng,s=e.sw.lng,(a>n?a<=s:t=>s)?t:t.map(u));var a,n,s};export{c as buildStructures,s as createFetchJson,o as createFetchText,i as getVenueDataFromUrls,d as normalizeCoords};
|
package/lib/src/app.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"IObject";import t from"query-string";import{map as n,mergeDeepRight as o}from"ramda";import i from"zousan-plus";import r from"../package.json.js";import a from"./debugTools.js";import{buildEnv as s}from"./env.js";import{create as l}from"./extModules/bustle.js";import{initLog as u}from"./extModules/log.js";import c from"./utils/i18n.js";const g="undefined"!=typeof window;async function p(e,t,n){let o=t;if(o.includes("/")){const e=o.split("/");o=e[e.length-1]}return void 0!==n.active&&(!1===n.active||"notLocalhost"===n.active&&e.env.isLocalhost())?(e.log.info(`Plugin ${t} explicitly deativated`),null):import(`../plugins/${t}/src/${o}.js`).then((o=>(e.log.info(`Creating plugin ${t}`),o.create(e,n))))}async function d(e){return g?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function m(e,t){let n={};const i=await Promise.all(t.map(d));for(const e of i){let t=e.default;t=t.extends?await m(t,t.extends):t,n=o(n,t)}return n=o(n,e),n}const f=e=>t=>import(`./configs/postproc-${e}.js`).then((e=>e.process(t)));async function w(o){const d=Object.create(null);let w=o.extends?await m(o,o.extends):o;w.plugins.monitoring&&import("../_virtual/_empty_module_placeholder.js").then((e=>e.activate(w))),w=await(async e=>e.configPostProc?i.series(e,...e.configPostProc.map(f)):e)(w);const y=(e=>{const n=e.supportedLanguages||["ar","en","es","fr","ja","ko","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=t.parse(location.search).lang||navigator.language;for(;e;){if(e&&n.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"))}}return e.defaultLanguage||"en"})(w),h=await c(y,{debug:w.debug});d.i18n=()=>h,d.gt=()=>h.t.bind(h),d.config=w,d.plugins=new e;const j=u("web-engine",{enabled:!!w.debug,isBrowser:g,color:"cyan",logFilter:w.logFilter,truncateObjects:!g});if(d.log=j.sublog(w.name),d.bus=l({trace:!1,showEvents:!0,reportAllErrors:!0,log:j}),d.info={wePkg:r},"undefined"!=typeof window&&(w.debug?(d.debug=n((e=>e.bind(d)),a),a.dndGo.call(d)):d.debug={},window._app=d,window.document&&window.document.title&&w.setWindowTitle&&(document.title=w.name)),d.env=s(d),w.theme?await i.evaluate({name:"ThemeManagerModule",value:import("../_virtual/_empty_module_placeholder.js")},{name:"HistoryManager",value:import("./historyManager.js")},{name:"LayerManager",value:import("../_virtual/_empty_module_placeholder.js")}).then((async({LayerManager:e,HistoryManager:t,ThemeManagerModule:n})=>{const o=n.initThemeManager(d);d.themePack=await o.buildTheme(w.theme,w.defaultTheme),e.initLayerManager(d),t.initHistoryManager(d),d.destroy=()=>e.destroy(d)})):d.destroy=()=>{},w.plugins){for(const e in w.plugins)try{const t=w.plugins[e];if(d.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const n=await p(d,e,t);n&&(d.plugins=d.plugins.set(e,n))}catch(t){j.error("Error instantiating plugin "+e),j.error(t)}for(const e in d.plugins)d.plugins[e].init()}return d}export{w as create};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "SDK headless",
|
|
3
|
-
"plugins": {
|
|
4
|
-
"analytics2": {
|
|
5
|
-
"productName": "LocusMaps JS SDK",
|
|
6
|
-
"active": false,
|
|
7
|
-
"disableSending": false
|
|
8
|
-
},
|
|
9
|
-
"clientAPI": {},
|
|
10
|
-
"dynamicPois": {},
|
|
11
|
-
"poiDataManager": {},
|
|
12
|
-
"sdkServer": { },
|
|
13
|
-
"searchService": {},
|
|
14
|
-
"venueDataLoader": {
|
|
15
|
-
"assetStage": "prod",
|
|
16
|
-
"formatVersion": "v5",
|
|
17
|
-
"availableLanguages": [
|
|
18
|
-
{
|
|
19
|
-
"langCode": "en",
|
|
20
|
-
"assetSuffix": ""
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
"wayfinder": {
|
|
25
|
-
"compareFindPaths": false
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{lib → dist}/src/env.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|