atriusmaps-node-sdk 3.3.31 → 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.
Files changed (122) hide show
  1. package/README.md +19 -1
  2. package/dist/cjs/_virtual/_empty_module_placeholder.js +2 -2
  3. package/dist/cjs/deploy/prepareSDKConfig.js +152 -2
  4. package/dist/cjs/nodesdk/nodeEntry.js +109 -0
  5. package/dist/cjs/package.json.js +190 -7
  6. package/dist/cjs/plugins/clientAPI/src/clientAPI.js +11 -2
  7. package/dist/cjs/plugins/dynamicPois/src/dynamicPois.js +218 -21
  8. package/dist/cjs/plugins/poiDataManager/src/poiDataManager.js +292 -21
  9. package/dist/cjs/plugins/sdkServer/src/sdkHeadless.js +99 -20
  10. package/dist/cjs/plugins/sdkServer/src/sdkServer.js +219 -2
  11. package/dist/cjs/plugins/sdkServer/src/util.js +16 -3
  12. package/dist/cjs/plugins/searchService/src/poiSearch.js +57 -19
  13. package/dist/cjs/plugins/searchService/src/searchService.js +246 -21
  14. package/dist/cjs/plugins/searchService/src/searchTypeahead.js +60 -3
  15. package/dist/cjs/plugins/searchService/src/utils.js +23 -4
  16. package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +472 -23
  17. package/dist/cjs/plugins/venueDataLoader/src/venueLoadingUtils.js +191 -23
  18. package/dist/cjs/plugins/wayfinder/src/findRoute.js +147 -19
  19. package/dist/cjs/plugins/wayfinder/src/minPriorityQueue.js +88 -2
  20. package/dist/cjs/plugins/wayfinder/src/navGraph.js +393 -5
  21. package/dist/cjs/plugins/wayfinder/src/navGraphDebug.js +110 -20
  22. package/dist/cjs/plugins/wayfinder/src/segmentBadges.js +28 -2
  23. package/dist/cjs/plugins/wayfinder/src/segmentBuilder.js +257 -19
  24. package/dist/cjs/plugins/wayfinder/src/segmentCategories.js +29 -2
  25. package/dist/cjs/plugins/wayfinder/src/stepBuilder.js +238 -3
  26. package/dist/cjs/plugins/wayfinder/src/wayfinder.js +597 -22
  27. package/dist/cjs/src/app.js +191 -25
  28. package/dist/cjs/src/configs/postproc-mol-url-parms.js +58 -2
  29. package/dist/cjs/src/configs/postproc-stateTracking.js +53 -19
  30. package/dist/cjs/src/controller.js +43 -4
  31. package/dist/cjs/src/debugTools.js +128 -23
  32. package/dist/cjs/src/env.js +17 -2
  33. package/dist/cjs/src/extModules/bustle.js +128 -4
  34. package/dist/cjs/src/extModules/flexapi/src/help.js +23 -4
  35. package/dist/cjs/src/extModules/flexapi/src/index.js +65 -4
  36. package/dist/cjs/src/extModules/flexapi/src/validate.js +133 -5
  37. package/dist/cjs/src/extModules/geohasher.js +90 -3
  38. package/dist/cjs/src/extModules/log.js +69 -2
  39. package/dist/cjs/src/historyManager.js +29 -2
  40. package/dist/cjs/src/utils/bounds.js +22 -4
  41. package/dist/cjs/src/utils/buildStructureLookup.js +31 -19
  42. package/dist/cjs/src/utils/configUtils.js +71 -3
  43. package/dist/cjs/src/utils/dom.js +48 -5
  44. package/dist/cjs/src/utils/funcs.js +30 -7
  45. package/dist/cjs/src/utils/geodesy.js +35 -3
  46. package/dist/cjs/src/utils/geom.js +212 -25
  47. package/dist/cjs/src/utils/i18n.js +69 -5
  48. package/dist/cjs/src/utils/observable.js +73 -2
  49. package/dist/cjs/src/utils/rand.js +82 -3
  50. package/dist/nodesdk/nodeEntry.js +1 -0
  51. package/dist/package.json.js +1 -0
  52. package/dist/plugins/dynamicPois/src/dynamicPois.js +1 -0
  53. package/dist/plugins/sdkServer/src/sdkHeadless.js +1 -0
  54. package/{lib → dist}/plugins/sdkServer/src/sdkServer.js +1 -1
  55. package/dist/plugins/searchService/src/poiSearch.js +1 -0
  56. package/dist/plugins/searchService/src/searchService.js +1 -0
  57. package/dist/plugins/venueDataLoader/src/venueDataLoader.js +1 -0
  58. package/dist/plugins/venueDataLoader/src/venueLoadingUtils.js +1 -0
  59. package/dist/plugins/wayfinder/src/navGraph.js +1 -0
  60. package/{lib → dist}/plugins/wayfinder/src/segmentBuilder.js +1 -1
  61. package/dist/plugins/wayfinder/src/stepBuilder.js +1 -0
  62. package/dist/plugins/wayfinder/src/wayfinder.js +1 -0
  63. package/dist/src/app.js +1 -0
  64. package/dist/src/configs/postproc-mol-url-parms.js +1 -0
  65. package/{lib → dist}/src/configs/sdkHeadless.json.js +1 -1
  66. package/dist/src/extModules/bustle.js +1 -0
  67. package/dist/src/extModules/log.js +1 -0
  68. package/dist/src/utils/funcs.js +1 -0
  69. package/dist/src/utils/geom.js +1 -0
  70. package/dist/src/utils/i18n.js +1 -0
  71. package/package.json +17 -9
  72. package/config/rollup.config.cjs.js +0 -31
  73. package/dist/cjs/deploy/nodeEntry.js +0 -15
  74. package/dist/cjs/src/auth/Auth.js +0 -23
  75. package/lib/deploy/nodeEntry.js +0 -1
  76. package/lib/package.json.js +0 -1
  77. package/lib/plugins/dynamicPois/src/dynamicPois.js +0 -1
  78. package/lib/plugins/sdkServer/src/sdkHeadless.js +0 -1
  79. package/lib/plugins/searchService/src/poiSearch.js +0 -1
  80. package/lib/plugins/searchService/src/searchService.js +0 -1
  81. package/lib/plugins/venueDataLoader/src/venueDataLoader.js +0 -1
  82. package/lib/plugins/venueDataLoader/src/venueLoadingUtils.js +0 -1
  83. package/lib/plugins/wayfinder/src/navGraph.js +0 -1
  84. package/lib/plugins/wayfinder/src/stepBuilder.js +0 -1
  85. package/lib/plugins/wayfinder/src/wayfinder.js +0 -1
  86. package/lib/src/app.js +0 -1
  87. package/lib/src/auth/Auth.js +0 -1
  88. package/lib/src/configs/postproc-mol-url-parms.js +0 -1
  89. package/lib/src/configs/sdkHeadless.json +0 -28
  90. package/lib/src/extModules/bustle.js +0 -1
  91. package/lib/src/extModules/log.js +0 -1
  92. package/lib/src/utils/funcs.js +0 -1
  93. package/lib/src/utils/geom.js +0 -1
  94. package/lib/src/utils/i18n.js +0 -1
  95. /package/{lib → dist}/_virtual/_empty_module_placeholder.js +0 -0
  96. /package/{lib → dist}/deploy/prepareSDKConfig.js +0 -0
  97. /package/{lib → dist}/plugins/clientAPI/src/clientAPI.js +0 -0
  98. /package/{lib → dist}/plugins/poiDataManager/src/poiDataManager.js +0 -0
  99. /package/{lib → dist}/plugins/sdkServer/src/util.js +0 -0
  100. /package/{lib → dist}/plugins/searchService/src/searchTypeahead.js +0 -0
  101. /package/{lib → dist}/plugins/searchService/src/utils.js +0 -0
  102. /package/{lib → dist}/plugins/wayfinder/src/findRoute.js +0 -0
  103. /package/{lib → dist}/plugins/wayfinder/src/minPriorityQueue.js +0 -0
  104. /package/{lib → dist}/plugins/wayfinder/src/navGraphDebug.js +0 -0
  105. /package/{lib → dist}/plugins/wayfinder/src/segmentBadges.js +0 -0
  106. /package/{lib → dist}/plugins/wayfinder/src/segmentCategories.js +0 -0
  107. /package/{lib → dist}/src/configs/postproc-stateTracking.js +0 -0
  108. /package/{lib → dist}/src/controller.js +0 -0
  109. /package/{lib → dist}/src/debugTools.js +0 -0
  110. /package/{lib → dist}/src/env.js +0 -0
  111. /package/{lib → dist}/src/extModules/flexapi/src/help.js +0 -0
  112. /package/{lib → dist}/src/extModules/flexapi/src/index.js +0 -0
  113. /package/{lib → dist}/src/extModules/flexapi/src/validate.js +0 -0
  114. /package/{lib → dist}/src/extModules/geohasher.js +0 -0
  115. /package/{lib → dist}/src/historyManager.js +0 -0
  116. /package/{lib → dist}/src/utils/bounds.js +0 -0
  117. /package/{lib → dist}/src/utils/buildStructureLookup.js +0 -0
  118. /package/{lib → dist}/src/utils/configUtils.js +0 -0
  119. /package/{lib → dist}/src/utils/dom.js +0 -0
  120. /package/{lib → dist}/src/utils/geodesy.js +0 -0
  121. /package/{lib → dist}/src/utils/observable.js +0 -0
  122. /package/{lib → dist}/src/utils/rand.js +0 -0
package/README.md CHANGED
@@ -24,7 +24,12 @@ The Init object contains 3 methods:
24
24
  - `Init.getVersion()` : Returns the current version of the library
25
25
  - `Init.newMap(Object configuration)` : This is how your initialize a new map. This returns a Promise that resolves to your map.
26
26
 
27
- The configuration object is documented in full at https://locusmapsjs.readme.io/docs/sdk-configuration - with the only difference being that headless is forced to true for this node (non-browser) version.
27
+ The configuration object recognizes the following properties:
28
+
29
+ - `accountId`: This is the customer account against which you wish to display a map. Each account is associated with a list of 1 or more venues that it is authorized to display.
30
+ - `venueId`: The venue ID you wish the map to render.
31
+ - `agent` (optional): An instance of the http.agent to handle network fetches. See https://github.com/node-fetch/node-fetch#custom-agent for more information.
32
+ - `proxy` (optional): An object containing a `host` and `port` property to utilize a forwarding proxy for all network requests. (see example below)
28
33
 
29
34
  At a minimum, a configuration would contain an accountId and a venueId:
30
35
 
@@ -35,6 +40,19 @@ const config = {
35
40
  }
36
41
  ```
37
42
 
43
+ An example of utilizing a proxy:
44
+
45
+ ```js
46
+ const config = {
47
+ venueId: '<venueId>',
48
+ accountId: '<accountId>',
49
+ proxy: {
50
+ host: 'example.com',
51
+ port: 9108
52
+ }
53
+ }
54
+ ```
55
+
38
56
  You then initialize your map:
39
57
 
40
58
  ```js
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var a={};
3
+ var _empty_module_placeholder = {};
4
4
 
5
- module.exports = a;
5
+ module.exports = _empty_module_placeholder;
@@ -4,6 +4,156 @@ 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 o(o){const{name:s,debug:r,headless:a,theme:l,defaultSearchTerms:c,venueId:p,accountId:d,poiCategories:u,preserveStateInURL:g,supportURLDeepLinks:h,initState:m,deepLinkParms:f,uiHide:v,renderDiv:S,parentConfig:k,desktopViewMinWidth:P,forceDesktop:V,hostAppId:w,hostAppVersion:A,hostAppProperties:b,logFilter:y,searchPlaceholder:L,dataFetch:D,engineName:I,dynamicPoisUrlBaseV1:j,plugins:Z,anaytics2ActiveFlag:F,enablePoiSelection:T,minZoom:x,maxZoom:C}=o,R=k?[k]:a?["sdkHeadless"]:["sdkVisual"],U=(e,i)=>e&&e.length>i?e.substring(0,i):e,W={name:s,engineName:I,extends:R,debug:r,logFilter:y,theme:l,uiHide:v,renderDiv:S,configPostProc:[],plugins:{venueDataLoader:{dataFetch:D,venueId:p,accountId:d},sdkServer:{headless:a},analytics2:{hostAppId:(e=>e?U(e.toString(),128):void 0)(w),hostAppVersion:(e=>e?U(e.toString(),128):void 0)(A),hostAppProperties:(e=>{if(!e||"object"!=typeof e)return;const i={},t=Object.keys(e);return t.length>10&&(t.length=10),t.forEach((t=>{let o=U(t.toString().replaceAll(/[^a-zA-Z0-9_]/g,""),128);o.match(/^[a-zA-Z]+/)||(o="X"+o);let n=e[t];null==n&&(n=""),n=U(n.toString(),128),i[o]=n;})),i})(b)}},uuid:"undefined"!=typeof document&&document&&document.location?document.location.host:"unknown"};void 0!==F&&(W.plugins.analytics2.active=F);const H=(e,i)=>void 0!==i?{[e]:i}:{};return a||(W.plugins["online/headerOnline"]={searchPlaceholder:L},W.plugins.mapRenderer={...H("enablePoiSelection",T),viewLimits:{...H("maxZoom",C),...H("minZoom",x)}}),W.plugins.searchService=c?{defaultSearchTerms:c}:{},n(o,"defaultSearchTerms",W.plugins.searchService),R.includes("sdkVisual")&&(W.plugins["online/homeView"]=u?{poiCategories:u}:{},n(o,"poiCategories",W.plugins["online/homeView"])),Z&&(Z.draw&&(W.plugins.draw=Z.draw),Z.flightStatus&&(W.plugins.flightStatus=Z.flightStatus,W.plugins["online/flightDetails"]={},W.plugins["online/flightDetailsSearch"]={})),g&&(W.configPostProc.push("stateTracking"),W.plugins.deepLinking={trackURL:!0}),h&&W.configPostProc.push("mol-url-parms"),m&&postprocStateTracking.setStateFromStateString(W,atob(m),!0),f&&postprocMolUrlParms.setDeepLinksForParms(W,f,!0),void 0!==P&&(W.desktopViewMinWidth=P),V&&(W.desktopViewMinWidth=0),j&&(W.plugins.dynamicPois={urlBaseV1:j}),funcs.filterOb(((e,i)=>void 0!==i),W)}function n(e,i,t){Object.keys(e).filter((e=>e.startsWith(i+"-"))).forEach((i=>t[i]=e[i]));}
7
+ function prepareSDKConfig (sc) {
8
+ const {
9
+ name, debug, headless, theme, defaultSearchTerms, venueId, accountId,
10
+ poiCategories, preserveStateInURL, supportURLDeepLinks, initState,
11
+ deepLinkParms, uiHide, renderDiv, parentConfig, desktopViewMinWidth,
12
+ forceDesktop, hostAppId, hostAppVersion, hostAppProperties, logFilter,
13
+ searchPlaceholder, dataFetch, engineName, dynamicPoisUrlBaseV1, plugins,
14
+ anaytics2ActiveFlag, enablePoiSelection, minZoom, maxZoom
15
+ } = sc;
8
16
 
9
- module.exports = o;
17
+ const extendsConfig = parentConfig ? [parentConfig] : (headless ? ['sdkHeadless'] : ['sdkVisual']);
18
+
19
+ const trunc = (str, len) => str && str.length > len ? str.substring(0, len) : str;
20
+
21
+ const validateHostAppId = hostAppId => hostAppId ? trunc(hostAppId.toString(), 128) : undefined;
22
+ const validateHostAppVersion = hostAppVersion => hostAppVersion ? trunc(hostAppVersion.toString(), 128) : undefined;
23
+ const validateHostAppProperties = hostAppProperties => {
24
+ if (!hostAppProperties || typeof hostAppProperties !== 'object')
25
+ return undefined
26
+
27
+ const ret = { }; // lets build this back up ourselves to ensure its purity
28
+
29
+ const keys = Object.keys(hostAppProperties);
30
+
31
+ if (keys.length > 10)
32
+ keys.length = 10;
33
+
34
+ keys.forEach(key => {
35
+ let cleanKey = trunc(key.toString().replaceAll(/[^a-zA-Z0-9_]/g, ''), 128);
36
+ if (!cleanKey.match(/^[a-zA-Z]+/))
37
+ cleanKey = 'X' + cleanKey; // force to start with alpha char
38
+ let cleanVal = hostAppProperties[key];
39
+ if (cleanVal === null || cleanVal === undefined)
40
+ cleanVal = '';
41
+ cleanVal = trunc(cleanVal.toString(), 128);
42
+ ret[cleanKey] = cleanVal;
43
+ });
44
+
45
+ return ret
46
+ };
47
+
48
+ const config = {
49
+ name,
50
+ engineName,
51
+ extends: extendsConfig,
52
+ debug,
53
+ logFilter,
54
+ theme,
55
+ uiHide,
56
+ renderDiv,
57
+ configPostProc: [],
58
+ plugins: {
59
+ venueDataLoader: {
60
+ dataFetch,
61
+ venueId,
62
+ accountId
63
+ },
64
+ sdkServer: {
65
+ headless
66
+ },
67
+ analytics2: {
68
+ hostAppId: validateHostAppId(hostAppId),
69
+ hostAppVersion: validateHostAppVersion(hostAppVersion),
70
+ hostAppProperties: validateHostAppProperties(hostAppProperties)
71
+ }
72
+ },
73
+ uuid: typeof (document) !== 'undefined' && document && document.location ? document.location.host : 'unknown' // used in analytics
74
+ };
75
+
76
+ if (anaytics2ActiveFlag !== undefined)
77
+ config.plugins.analytics2.active = anaytics2ActiveFlag;
78
+
79
+ // return an object with the named property set to the specified value, unless the
80
+ // value is undefined, then return an empty object
81
+ const setIfDef = (name, value) => value !== undefined ? { [name]: value } : { };
82
+
83
+ if (!headless) {
84
+ config.plugins['online/headerOnline'] = { searchPlaceholder };
85
+ config.plugins.mapRenderer = {
86
+ ...setIfDef('enablePoiSelection', enablePoiSelection),
87
+ viewLimits: {
88
+ ...setIfDef('maxZoom', maxZoom),
89
+ ...setIfDef('minZoom', minZoom)
90
+ }
91
+ };
92
+ }
93
+
94
+ config.plugins.searchService = defaultSearchTerms
95
+ ? { defaultSearchTerms }
96
+ : { };
97
+ handleI18NParm(sc, 'defaultSearchTerms', config.plugins.searchService);
98
+
99
+ if (extendsConfig.includes('sdkVisual')) {
100
+ if (poiCategories)
101
+ config.plugins['online/homeView'] = { poiCategories };
102
+ else
103
+ config.plugins['online/homeView'] = { };
104
+ handleI18NParm(sc, 'poiCategories', config.plugins['online/homeView']);
105
+ }
106
+
107
+ // Allow *specific* additional plugins
108
+ if (plugins) {
109
+ // for now, this is just for internal use
110
+ if (plugins.draw)
111
+ config.plugins.draw = plugins.draw;
112
+
113
+ // To get flight status working, one needs 3 plugins. This is a bad design, there should just be one and it provides
114
+ // all 3 of these services. Lets migrate to a single plugin at some point - but until then, lets at least make it look
115
+ // like a single plugin for SDK users. The only plugin that currently has configurable properties is "flightStatus" - so
116
+ // lets let SDK users define that one and its single property (apiKey) and we'll just create the other two by default.
117
+ if (plugins.flightStatus) {
118
+ config.plugins.flightStatus = plugins.flightStatus;
119
+ config.plugins['online/flightDetails'] = { }; // these really shouldn't be separate plugins (!)
120
+ config.plugins['online/flightDetailsSearch'] = { }; // these really shouldn't be separate plugins (!)
121
+ }
122
+ }
123
+
124
+ if (preserveStateInURL) {
125
+ config.configPostProc.push('stateTracking');
126
+ config.plugins.deepLinking = { trackURL: true };
127
+ }
128
+
129
+ if (supportURLDeepLinks)
130
+ config.configPostProc.push('mol-url-parms');
131
+
132
+ if (initState)
133
+ postprocStateTracking.setStateFromStateString(config, atob(initState), true);
134
+
135
+ if (deepLinkParms)
136
+ postprocMolUrlParms.setDeepLinksForParms(config, deepLinkParms, true);
137
+
138
+ if (desktopViewMinWidth !== undefined)
139
+ config.desktopViewMinWidth = desktopViewMinWidth;
140
+
141
+ if (forceDesktop)
142
+ config.desktopViewMinWidth = 0;
143
+
144
+ if (dynamicPoisUrlBaseV1) {
145
+ config.plugins.dynamicPois = {
146
+ urlBaseV1: dynamicPoisUrlBaseV1
147
+ };
148
+ }
149
+
150
+ return funcs.filterOb((k, v) => v !== undefined, config) // remove any undefined values
151
+ }
152
+
153
+ function handleI18NParm (sdkConfig, prefix, configDest) {
154
+ Object.keys(sdkConfig)
155
+ .filter(key => key.startsWith(prefix + '-'))
156
+ .forEach(key => (configDest[key] = sdkConfig[key]));
157
+ }
158
+
159
+ module.exports = prepareSDKConfig;
@@ -0,0 +1,109 @@
1
+ 'use strict';
2
+
3
+ var http = require('node:http');
4
+ var https = require('node:https');
5
+ var httpsProxyAgent = require('https-proxy-agent');
6
+ var fetch = require('node-fetch');
7
+ var prepareSDKConfig = require('../deploy/prepareSDKConfig.js');
8
+ var _package = require('../package.json.js');
9
+ var controller = require('../src/controller.js');
10
+ var observable = require('../src/utils/observable.js');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var http__default = /*#__PURE__*/_interopDefaultLegacy(http);
15
+ var https__default = /*#__PURE__*/_interopDefaultLegacy(https);
16
+ var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
17
+
18
+ const version = _package["default"].version;
19
+ const LIB_NAME = 'Atrius Maps JS SDK Client';
20
+
21
+ function setupFetch (config) {
22
+ const httpAgent = new http__default["default"].Agent({ keepAlive: true });
23
+ const httpsAgent = new https__default["default"].Agent({ keepAlive: true });
24
+
25
+ // provide easy proxy handling via config.proxy in form of { host, port }
26
+ const proxyAgent = config.proxy ? new httpsProxyAgent.HttpsProxyAgent(`http://${config.proxy.host}:${config.proxy.port}`) : null;
27
+
28
+ // Support a user defined agent - or a proxy agent - else we specify our own, forcing keepAlive to true (which is default in Node >= 19)
29
+ const agent = config.agent || proxyAgent || (url => url.protocol === 'http:' ? httpAgent : httpsAgent);
30
+
31
+ global.fetch = async (url, options) => fetch__default["default"](url, { ...options, agent });
32
+ }
33
+
34
+ // logging setup
35
+ let sdkLogging = false;
36
+ const pad2 = x => x.toString().length < 2 ? '0' + x : x;
37
+ const ts = () => { const d = new Date(); return `${d.getHours()}:${pad2(d.getMinutes())}:${pad2(d.getSeconds())}.${d.getMilliseconds()}` };
38
+ const logPre = () => `AtriusMaps Node SDK (${ts()}): `;
39
+ const log = function () {
40
+ if (sdkLogging) {
41
+ let msg = logPre() + Array.from(arguments).map(arg => typeof arg === 'object' ? JSON.stringify(arg) : arg).join(' ');
42
+ const lines = msg.split('\n');
43
+ if (lines.length > 1)
44
+ msg = lines[0] + `… (+ ${lines.length - 1} lines)`;
45
+ else
46
+ if (msg.length > 256)
47
+ msg = msg.substring(0, 255) + `… (length: ${msg.length} chars)`;
48
+ console.log(msg);
49
+ }
50
+ };
51
+
52
+ // this iterates through available commands and makes them member functions of map
53
+ function addCommands (map, commands) {
54
+ commands.forEach(sig => {
55
+ map[sig.command] = function () {
56
+ const cob = { command: sig.command };
57
+ for (let i = 0; i < arguments.length; i++)
58
+ cob[sig.args[i].name] = arguments[i];
59
+ return map(cob)
60
+ };
61
+ });
62
+ }
63
+
64
+ async function newMap (sdkConfig) {
65
+ return new Promise((resolve, reject) => {
66
+ sdkConfig.headless = true;
67
+
68
+ setupFetch(sdkConfig); // This installs the fetch function globally (overriding native if exists)
69
+
70
+ const config = prepareSDKConfig(sdkConfig);
71
+
72
+ controller.create(config)
73
+ .then(app => {
74
+ const map = (payload, arg2) => {
75
+ if (typeof payload === 'string')
76
+ payload = { ...arg2, command: payload };
77
+ log('Sending command object: ', payload);
78
+ return app.bus.get('clientAPI/execute', payload)
79
+ .then(result => {
80
+ log('Received Message: ', result);
81
+ return result
82
+ })
83
+ .catch(e => {
84
+ log('Error: ', e.message); // doesn't seem to ever get called?? WTF?
85
+ throw e
86
+ })
87
+ };
88
+ // map._app = app
89
+
90
+ observable(map); // make map handle events pub/sub
91
+ app.eventListener.observe(function () { map.fire.apply(map, arguments); }); // pass it on...
92
+
93
+ map.on('ready', (eName, data) => {
94
+ const { commands/*, customTypes */ } = data.commandJSON;
95
+ addCommands(map, commands);
96
+ resolve(map);
97
+ log('map ready');
98
+ });
99
+ });
100
+ })
101
+ }
102
+
103
+ const Init = {
104
+ getVersion: () => version,
105
+ newMap: config => newMap(config),
106
+ setLogging: flag => { sdkLogging = flag; if (flag) log(`${LIB_NAME} v${version} Logging enabled.`); }
107
+ };
108
+
109
+ module.exports = Init;
@@ -2,11 +2,194 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var t=["demo","deploy","pagesSrc","src/extModules/flexapi"],r={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"},n=["defaults"],i={"@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","@mapbox/mapbox-gl-draw":"^1.3.0","@mapbox/mapbox-gl-draw-static-mode":"^1.0.1","@turf/circle":"^6.5.0",IObject:"^0.6.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",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"},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":"^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"},p={name:"web-engine",version:"3.3.31",private:!0,license:"UNLICENSED",type:"module",main:"src/main.js",workspaces:t,scripts:r,"lint-staged":{"*.js":["eslint --fix"]},browserslist:n,dependencies:i,devDependencies:c,packageManager:"yarn@3.2.2"};
5
+ var name = "web-engine";
6
+ var version = "3.3.225";
7
+ var license = "UNLICENSED";
8
+ var type = "module";
9
+ var main = "src/main.js";
10
+ var workspaces = [
11
+ "demo",
12
+ "deploy",
13
+ "nodesdk",
14
+ "pagesSrc",
15
+ "src/extModules/flexapi"
16
+ ];
17
+ var scripts = {
18
+ colors: "cat utils/colors1.txt && node utils/processColors.js | pbcopy && cat utils/colors2.txt",
19
+ "cypress:a11y": "APPLITOOLS_IS_DISABLED=true && cypress open --browser chrome --env INPUT_MODALITY='keyboard'",
20
+ "cypress:comp": "APPLITOOLS_IS_DISABLED=true && cypress open --component --browser chrome",
21
+ "cypress:e2e": "APPLITOOLS_IS_DISABLED=true && cypress open --e2e --browser chrome",
22
+ demo: "cd demo/ && yarn start",
23
+ "e2e:record": "yarn cypress run --env RECORD_MODE=true",
24
+ e2eTest: "percy exec -- cypress run --browser chrome",
25
+ goProd: "cd deploy && scripts/goProd.sh",
26
+ goStaging: "deploy/scripts/goStaging.sh",
27
+ lint: "eslint . --max-warnings=0",
28
+ mod: "demo/startMod.sh",
29
+ mol: "demo/startMol.sh",
30
+ molProd: "cd deploy && yarn buildAndRunMol",
31
+ mos: "demo/startMos.sh",
32
+ prepare: "husky install",
33
+ test: "jest --no-cache --verbose",
34
+ "test-watch": "jest --verbose --watch",
35
+ "test:e2e:video": "cypress run"
36
+ };
37
+ var browserslist = [
38
+ "defaults"
39
+ ];
40
+ var dependencies = {
41
+ "@azure/event-hubs": "^5.6.0",
42
+ "@dnd-kit/core": "^6.0.8",
43
+ "@dnd-kit/sortable": "^7.0.2",
44
+ "@dnd-kit/utilities": "^3.2.1",
45
+ "@john-osullivan/react-window-dynamic-fork": "^1.9.0-alpha.1",
46
+ "@locus-labs/mod-badge": "^0.1.102",
47
+ "@locus-labs/mod-default-theme": "^0.0.113",
48
+ "@locus-labs/mod-footer": "^0.0.111",
49
+ "@locus-labs/mod-header": "^0.0.105",
50
+ "@locus-labs/mod-location-marker": "^0.0.104",
51
+ "@locus-labs/mod-map-legend": "^0.0.104",
52
+ "@locus-labs/mod-offscreen-indicator": "^0.0.104",
53
+ "@locus-labs/mod-pin": "^0.0.104",
54
+ "@locus-labs/mod-qr-code-card": "^0.0.104",
55
+ "@locus-labs/mod-qr-code-window": "^0.0.105",
56
+ "@locus-labs/mod-walk-time-matrix": "^0.0.103",
57
+ "@locus-labs/mol-desktop-building-level-selector": "^0.1.108",
58
+ "@locus-labs/mol-desktop-compass": "^0.1.120",
59
+ "@locus-labs/mol-desktop-default-theme": "^0.2.105",
60
+ "@locus-labs/mol-desktop-icon": "^0.1.131",
61
+ "@locus-labs/mol-desktop-logo": "^0.1.101",
62
+ "@locus-labs/mol-desktop-map-nav-button": "^0.1.130",
63
+ "@locus-labs/mol-desktop-submenu": "^0.1.121",
64
+ "@locus-labs/mol-desktop-tooltip": "^0.3.102",
65
+ "@locus-labs/mol-desktop-zoom-control": "^0.1.134",
66
+ "@locus-labs/mol-mobile-floating-action-button": "^0.0.106",
67
+ "@locus-labs/mol-mobile-toast": "^0.1.102",
68
+ "@mapbox/mapbox-gl-draw": "^1.3.0",
69
+ "@mapbox/mapbox-gl-draw-static-mode": "^1.0.1",
70
+ "@microsoft/applicationinsights-web": "^3.1.2",
71
+ "@turf/circle": "^6.5.0",
72
+ "@turf/helpers": "^6.5.0",
73
+ "@turf/point-to-line-distance": "^6.5.0",
74
+ "@vitejs/plugin-react": "^4.0.1",
75
+ IObject: "^0.7.2",
76
+ "axe-core": "^4.9.0",
77
+ "crypto-browserify": "^3.12.0",
78
+ "cypress-axe": "^1.5.0",
79
+ "file-loader": "^6.2.0",
80
+ flexsearch: "^0.7.31",
81
+ "h3-js": "^4.1.0",
82
+ i18next: "^20.3.4",
83
+ "i18next-browser-languagedetector": "^6.1.1",
84
+ "jest-transform-css": "4.0.1",
85
+ jsonschema: "^1.2.6",
86
+ luxon: "^3.3.0",
87
+ "maplibre-gl": "~2.1.9",
88
+ "mini-css-extract-plugin": "^1.6.0",
89
+ "node-polyfill-webpack-plugin": "^1.1.4",
90
+ "path-browserify": "^1.0.1",
91
+ polished: "^4.0.2",
92
+ "prop-types": "^15.7.2",
93
+ "query-string": "^8.1.0",
94
+ ramda: "^0.28.0",
95
+ react: "^17.0.2",
96
+ "react-compound-slider": "^3.3.1",
97
+ "react-dom": "^17.0.2",
98
+ "react-json-editor-ajrm": "^2.5.13",
99
+ "react-qr-svg": "^2.2.1",
100
+ "react-svg": "^16.1.29",
101
+ "react-tageditor": "^0.2.3",
102
+ "react-virtualized-auto-sizer": "^1.0.2",
103
+ "smoothscroll-polyfill": "^0.4.4",
104
+ "styled-components": "5.1.0",
105
+ "styled-normalize": "^8.0.6",
106
+ "throttle-debounce": "^3.0.1",
107
+ trackjs: "^3.7.4",
108
+ "ua-parser-js": "^0.7.23",
109
+ uuid: "3.3.2",
110
+ zousan: "^3.0.1",
111
+ "zousan-plus": "^4.0.1"
112
+ };
113
+ var devDependencies = {
114
+ "@applitools/eyes-cypress": "^3.44.0",
115
+ "@babel/core": "^7.14.8",
116
+ "@babel/plugin-proposal-class-properties": "^7.8.3",
117
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
118
+ "@babel/plugin-syntax-import-assertions": "^7.20.0",
119
+ "@babel/plugin-transform-modules-commonjs": "^7.8.3",
120
+ "@babel/plugin-transform-runtime": "^7.8.3",
121
+ "@babel/preset-env": "^7.14.8",
122
+ "@babel/preset-react": "^7.8.3",
123
+ "@percy/cli": "^1.0.0-beta.60",
124
+ "@percy/cypress": "^3.1.0",
125
+ "babel-eslint": "^10.0.1",
126
+ "babel-jest": "^27.0.6",
127
+ "babel-loader": "^8.2.2",
128
+ "babel-plugin-inline-json-import": "^0.3.2",
129
+ "babel-plugin-module-resolver": "^5.0.0",
130
+ "babel-polyfill": "^6.26.0",
131
+ "chai-colors": "^1.0.1",
132
+ "css-loader": "^5.2.4",
133
+ cypress: "^12.17.2",
134
+ "cypress-browser-permissions": "^1.1.0",
135
+ "cypress-real-events": "^1.11.0",
136
+ "cypress-wait-until": "^1.7.1",
137
+ eslint: "^7.4.0",
138
+ "eslint-config-standard": "^16.0.3",
139
+ "eslint-plugin-cypress": "^2.11.1",
140
+ "eslint-plugin-import": "^2.16.0",
141
+ "eslint-plugin-jest": "^24.3.6",
142
+ "eslint-plugin-node": "^11.1.0",
143
+ "eslint-plugin-promise": "^5.1.0",
144
+ "eslint-plugin-react": "^7.12.4",
145
+ "eslint-plugin-standard": "^5.0.0",
146
+ "fetch-mock-jest": "^1.3.0",
147
+ glob: "^10.3.3",
148
+ husky: "^6.0.0",
149
+ jest: "27.5.1",
150
+ "lint-staged": "^11.0.1",
151
+ "node-fetch": "^2.6.0",
152
+ "null-loader": "^4.0.1",
153
+ "start-server-and-test": "^2.0.0",
154
+ vite: "^4.3.9",
155
+ webpack: "^5.84.1",
156
+ "webpack-merge": "^5.8.0"
157
+ };
158
+ var packageManager = "yarn@4.0.2";
159
+ var engines = {
160
+ node: ">=20"
161
+ };
162
+ var pkg = {
163
+ name: name,
164
+ version: version,
165
+ "private": true,
166
+ license: license,
167
+ type: type,
168
+ main: main,
169
+ workspaces: workspaces,
170
+ scripts: scripts,
171
+ "lint-staged": {
172
+ "*.js": [
173
+ "eslint --fix"
174
+ ]
175
+ },
176
+ browserslist: browserslist,
177
+ dependencies: dependencies,
178
+ devDependencies: devDependencies,
179
+ packageManager: packageManager,
180
+ engines: engines
181
+ };
6
182
 
7
- exports.browserslist = n;
8
- exports["default"] = p;
9
- exports.dependencies = i;
10
- exports.devDependencies = c;
11
- exports.scripts = r;
12
- exports.workspaces = t;
183
+ exports.browserslist = browserslist;
184
+ exports["default"] = pkg;
185
+ exports.dependencies = dependencies;
186
+ exports.devDependencies = devDependencies;
187
+ exports.engines = engines;
188
+ exports.license = license;
189
+ exports.main = main;
190
+ exports.name = name;
191
+ exports.packageManager = packageManager;
192
+ exports.scripts = scripts;
193
+ exports.type = type;
194
+ exports.version = version;
195
+ exports.workspaces = workspaces;
@@ -4,6 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var index = require('../../../src/extModules/flexapi/src/index.js');
6
6
 
7
- function t(t,n){const s=index();return t.bus.on("clientAPI/registerCommand",(e=>s.registerCommand(e,(e=>t.bus.get(`clientAPI/${e.command}`,e))))),t.bus.on("clientAPI/registerCustomType",(({name:e,spec:t})=>s.registerCustomType(e,t))),t.bus.on("clientAPI/execute",(e=>s.execute(e))),{init:()=>{}}}
7
+ function create (app, config) {
8
+ const api = index();
9
+ app.bus.on('clientAPI/registerCommand', ob => api.registerCommand(ob, cob => app.bus.get(`clientAPI/${cob.command}`, cob)));
10
+ app.bus.on('clientAPI/registerCustomType', ({ name, spec }) => api.registerCustomType(name, spec));
11
+ app.bus.on('clientAPI/execute', cob => api.execute(cob));
8
12
 
9
- exports.create = t;
13
+ return {
14
+ init: () => {} // nothing more to do
15
+ }
16
+ }
17
+
18
+ exports.create = create;