atriusmaps-node-sdk 3.3.1175 → 3.3.1177
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/package.json.js +1 -1
- package/dist/cjs/plugins/venueDataLoader/src/loadInteractiveVenue.js +1 -1
- package/dist/cjs/src/app.js +6 -3
- package/dist/cjs/src/env.js +14 -8
- package/dist/package.json.js +1 -1
- package/dist/plugins/venueDataLoader/src/loadInteractiveVenue.js +1 -1
- package/dist/src/app.js +1 -1
- package/dist/src/env.js +1 -1
- package/dist/types/src/app.d.ts +2 -1
- package/dist/types/src/env.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/package.json.js
CHANGED
|
@@ -15,7 +15,7 @@ const MANIFEST_BASE_URL = "https://assets-api.locuslabs.com/prod";
|
|
|
15
15
|
const buildInteractiveManifestEndpoint = ({ accountId, venueId, assetStage }) => {
|
|
16
16
|
const base = MANIFEST_BASE_URL;
|
|
17
17
|
const path = `${base}/asset-manifest/accounts/${encodeURIComponent(accountId)}/venue/${encodeURIComponent(venueId)}`;
|
|
18
|
-
return assetStage ? `${path}?assetStage=${encodeURIComponent(assetStage)}
|
|
18
|
+
return assetStage ? `${path}?assetStage=${encodeURIComponent(assetStage)}` : path;
|
|
19
19
|
};
|
|
20
20
|
const hop1StatusToReason = (status) => {
|
|
21
21
|
switch (status) {
|
package/dist/cjs/src/app.js
CHANGED
|
@@ -159,11 +159,13 @@ async function create(rawConfig) {
|
|
|
159
159
|
isInitialState.startInitialStateListener();
|
|
160
160
|
LayerManager.initLayerManager(appInstance);
|
|
161
161
|
HistoryManager.initHistoryManager(appInstance);
|
|
162
|
-
appInstance.destroy = () =>
|
|
162
|
+
appInstance.destroy = () => {
|
|
163
|
+
appInstance.env.dispose();
|
|
164
|
+
return LayerManager.destroy();
|
|
165
|
+
};
|
|
163
166
|
});
|
|
164
167
|
} else {
|
|
165
|
-
appInstance.destroy = () =>
|
|
166
|
-
};
|
|
168
|
+
appInstance.destroy = () => appInstance.env.dispose();
|
|
167
169
|
}
|
|
168
170
|
if (config.plugins) {
|
|
169
171
|
for (const { id, pluginConfig, loaded } of pluginLoads) {
|
|
@@ -201,3 +203,4 @@ async function create(rawConfig) {
|
|
|
201
203
|
}
|
|
202
204
|
|
|
203
205
|
exports.create = create;
|
|
206
|
+
exports.extendConfig = extendConfig;
|
package/dist/cjs/src/env.js
CHANGED
|
@@ -19,16 +19,22 @@ function buildEnv(app) {
|
|
|
19
19
|
isDesktop,
|
|
20
20
|
supportsTouch
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
isVeryNarrow: env.isVeryNarrow()
|
|
28
|
-
});
|
|
22
|
+
const onResize = () => {
|
|
23
|
+
app.bus.send("env/resize", {
|
|
24
|
+
isMobile: env.isMobile(),
|
|
25
|
+
isMobileReflow: env.isMobileReflow(),
|
|
26
|
+
isVeryNarrow: env.isVeryNarrow()
|
|
29
27
|
});
|
|
28
|
+
};
|
|
29
|
+
if (isBrowser) {
|
|
30
|
+
window.addEventListener("resize", onResize);
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
const dispose = () => {
|
|
33
|
+
if (isBrowser) {
|
|
34
|
+
window.removeEventListener("resize", onResize);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return { ...env, dispose };
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
exports.buildEnv = buildEnv;
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a="3.3.
|
|
1
|
+
var a="3.3.1177",e={version:a};export{e as default,a as version};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LOAD_FAILURE_REASON as t}from"./constants.js";import{awaitAuthentication as e}from"./interactiveAuthGate.js";class s extends Error{reason;constructor(t,e){super(`Venue load failed: ${t}`,e),this.name="VenueLoadFailedError",this.reason=t}}const n="https://assets-api.locuslabs.com/prod",a=({accountId:t,venueId:e,assetStage:s})=>{const a=`${n}/asset-manifest/accounts/${encodeURIComponent(t)}/venue/${encodeURIComponent(e)}`;return s?`${a}?assetStage=${encodeURIComponent(s)}
|
|
1
|
+
import{LOAD_FAILURE_REASON as t}from"./constants.js";import{awaitAuthentication as e}from"./interactiveAuthGate.js";class s extends Error{reason;constructor(t,e){super(`Venue load failed: ${t}`,e),this.name="VenueLoadFailedError",this.reason=t}}const n="https://assets-api.locuslabs.com/prod",a=({accountId:t,venueId:e,assetStage:s})=>{const a=`${n}/asset-manifest/accounts/${encodeURIComponent(t)}/venue/${encodeURIComponent(e)}`;return s?`${a}?assetStage=${encodeURIComponent(s)}`:a},r=async({bus:n,fetch:a,manifestEndpoint:r})=>{const o=async t=>{throw await n.send("venueData/loadFailed",{reason:t}),new s(t)},c=await e(n,()=>n.send("auth/signIn"));if(!c.ok)return o(c.reason);const i=async e=>{try{return await e()}catch{return o(t.SERVICE_ERROR)}},u=await i(()=>n.getFirst("auth/getAccessToken",{forceRefresh:!0}));if("string"!=typeof u||""===u)return o(t.SESSION_EXPIRED);const E=await i(()=>a(r,{headers:{"x-api-key":u},redirect:"error"}));if(200!==E.status)return o((e=>{switch(e){case 401:return t.SESSION_EXPIRED;case 403:return t.ACCESS_DENIED;default:return t.SERVICE_ERROR}})(E.status));const R=await i(()=>E.json()),d=R?.data?.url;if("string"!=typeof d||""===d)return o(t.SERVICE_ERROR);const I=await i(()=>a(d));return 200!==I.status?o(403===I.status?t.LINK_EXPIRED:t.SERVICE_ERROR):i(()=>I.json())};export{n as MANIFEST_BASE_URL,s as VenueLoadFailedError,a as buildInteractiveManifestEndpoint,r as loadInteractiveManifest};
|
package/dist/src/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{map as t,mergeDeepRight as e}from"ramda";import{evaluateResults as o}from"zousan/evaluate";import{series as n}from"zousan/series";import i from"./utils/i18n.js";import{startInitialStateListener as a}from"./utils/isInitialState.js";import{version as s}from"../package.json.js";import r from"./debugTools.js";import{buildEnv as l}from"./env.js";import{create as u}from"./extModules/bustle.js";import{initLog as c}from"./extModules/log.js";const g="undefined"!=typeof window;async function p(t,e,o){return o?void 0!==o.active&&(!1===o.active||"notLocalhost"===o.active&&t.env.isLocalhost())?(t.log.info(`Plugin ${e} explicitly deativated`),null):e.includes("/")?(()=>{const[t,o]=e.split("/");return import(`../plugins/${t}/${o}/src/index.js`)})():import(`../plugins/${e}/src/index.js`):(t.log.info(`Plugin ${e} explicitly disabled`),null)}async function d(t){return g?import(`./configs/${t}.json`):import(`./configs/${t}.json.js`)}async function m(t,o){let n={};const i=await Promise.all(o.map(d));for(const t of i){let o=t.default;o=o.extends?await m(o,o.extends):o,n=e(n,o)}return n=e(n,t),n}const f=t=>e=>import(`./configs/postproc-${t}.ts`).then(t=>t.process(e));async function w(e){const d=Object.create(null);let w=e.extends?await m(e,e.extends):e;if(w.plugins?.monitoring&&!1!==w.plugins.monitoring.active){const t=w.plugins.monitoring;try{const e=await(import("../_virtual/_empty_module_placeholder.js"));await e.activate(t)}catch(t){const e=t instanceof Error?t.message:String(t);console.warn("Monitoring plugin failed to load (continuing without it):",e)}}if(w=await(async t=>t.configPostProc?n(t,...t.configPostProc.map(f)):t)(w),g&&w.plugins?.posthog&&!1!==w.plugins.posthog.active)try{const{activate:t}=await(import("../plugins/posthog/src/posthog.js"));await t(w.plugins.posthog)}catch(t){console.warn("PostHog failed to start (continuing without it):",t)}const h=(t=>{const e=t.supportedLanguages||["am","ar","de","el-GR","en","es","fr","hi","is","it","ja","ko","nl","pl","pt","ru","so","th","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let t=new URLSearchParams(location.search).get("lang")||navigator.language;for(;t;){if(t&&e.includes(t))return t;t=t.substring(0,t.lastIndexOf("-"))}}return t.defaultLanguage||"en"})(w),y=await i(h,{debug:w.debug});d.i18n=()=>y,d.gt=()=>y.t.bind(y),d.config=w,d.plugins={};const j=c("web-engine",{enabled:!!w.debug,isBrowser:g,color:"cyan",logFilter:w.logFilter,truncateObjects:!g,trace:false});d.log=j.sublog(w.name),d.bus=u({showEvents:!0,reportAllErrors:!0,log:j}),d.info={wePkg:{version:s}},"undefined"!=typeof window&&(w.debug?(d.debug=t(t=>t.bind(d),r),r.dndGo.call(d)):d.debug={},window._app=d,window.document&&window.document.title&&w.setWindowTitle&&(document.title=w.name)),d.env=l(d);const v=Object.entries(w.plugins??{}).map(([t,e])=>({id:t,pluginConfig:e,loaded:p(d,t,e).then(t=>({status:"fulfilled",pluginModule:t}),t=>({status:"rejected",error:t}))})),{theme:b}=w;if(b?await o({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:t,HistoryManager:e,ThemeManagerModule:o})=>{const n=o.initThemeManager(d);d.themePack=await n.buildTheme(b,w.defaultTheme),a(),t.initLayerManager(d),e.initHistoryManager(d),d.destroy=()=>t.destroy()}):d.destroy=()=>
|
|
1
|
+
import{map as t,mergeDeepRight as e}from"ramda";import{evaluateResults as o}from"zousan/evaluate";import{series as n}from"zousan/series";import i from"./utils/i18n.js";import{startInitialStateListener as a}from"./utils/isInitialState.js";import{version as s}from"../package.json.js";import r from"./debugTools.js";import{buildEnv as l}from"./env.js";import{create as u}from"./extModules/bustle.js";import{initLog as c}from"./extModules/log.js";const g="undefined"!=typeof window;async function p(t,e,o){return o?void 0!==o.active&&(!1===o.active||"notLocalhost"===o.active&&t.env.isLocalhost())?(t.log.info(`Plugin ${e} explicitly deativated`),null):e.includes("/")?(()=>{const[t,o]=e.split("/");return import(`../plugins/${t}/${o}/src/index.js`)})():import(`../plugins/${e}/src/index.js`):(t.log.info(`Plugin ${e} explicitly disabled`),null)}async function d(t){return g?import(`./configs/${t}.json`):import(`./configs/${t}.json.js`)}async function m(t,o){let n={};const i=await Promise.all(o.map(d));for(const t of i){let o=t.default;o=o.extends?await m(o,o.extends):o,n=e(n,o)}return n=e(n,t),n}const f=t=>e=>import(`./configs/postproc-${t}.ts`).then(t=>t.process(e));async function w(e){const d=Object.create(null);let w=e.extends?await m(e,e.extends):e;if(w.plugins?.monitoring&&!1!==w.plugins.monitoring.active){const t=w.plugins.monitoring;try{const e=await(import("../_virtual/_empty_module_placeholder.js"));await e.activate(t)}catch(t){const e=t instanceof Error?t.message:String(t);console.warn("Monitoring plugin failed to load (continuing without it):",e)}}if(w=await(async t=>t.configPostProc?n(t,...t.configPostProc.map(f)):t)(w),g&&w.plugins?.posthog&&!1!==w.plugins.posthog.active)try{const{activate:t}=await(import("../plugins/posthog/src/posthog.js"));await t(w.plugins.posthog)}catch(t){console.warn("PostHog failed to start (continuing without it):",t)}const h=(t=>{const e=t.supportedLanguages||["am","ar","de","el-GR","en","es","fr","hi","is","it","ja","ko","nl","pl","pt","ru","so","th","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let t=new URLSearchParams(location.search).get("lang")||navigator.language;for(;t;){if(t&&e.includes(t))return t;t=t.substring(0,t.lastIndexOf("-"))}}return t.defaultLanguage||"en"})(w),y=await i(h,{debug:w.debug});d.i18n=()=>y,d.gt=()=>y.t.bind(y),d.config=w,d.plugins={};const j=c("web-engine",{enabled:!!w.debug,isBrowser:g,color:"cyan",logFilter:w.logFilter,truncateObjects:!g,trace:false});d.log=j.sublog(w.name),d.bus=u({showEvents:!0,reportAllErrors:!0,log:j}),d.info={wePkg:{version:s}},"undefined"!=typeof window&&(w.debug?(d.debug=t(t=>t.bind(d),r),r.dndGo.call(d)):d.debug={},window._app=d,window.document&&window.document.title&&w.setWindowTitle&&(document.title=w.name)),d.env=l(d);const v=Object.entries(w.plugins??{}).map(([t,e])=>({id:t,pluginConfig:e,loaded:p(d,t,e).then(t=>({status:"fulfilled",pluginModule:t}),t=>({status:"rejected",error:t}))})),{theme:b}=w;if(b?await o({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:t,HistoryManager:e,ThemeManagerModule:o})=>{const n=o.initThemeManager(d);d.themePack=await n.buildTheme(b,w.defaultTheme),a(),t.initLayerManager(d),e.initHistoryManager(d),d.destroy=()=>(d.env.dispose(),t.destroy())}):d.destroy=()=>d.env.dispose(),w.plugins){for(const{id:t,pluginConfig:e,loaded:o}of v)try{if(d.plugins[t])throw Error(`Duplicate plugin name "${t}"`);const n=await o;if("rejected"===n.status)throw n.error;if(n.pluginModule){j.info(`Creating plugin ${t}`);const o=await n.pluginModule.create(d,e);o&&(d.plugins[t]=o)}}catch(e){j.error("Error instantiating plugin "+t),j.error(e)}for(const t in d.plugins)d.plugins[t].init()}return"undefined"!=typeof window&&d.bus.send("appInsights/log",{name:"app/loaded",properties:{deploymentHost:window.location.host}}),d}export{w as create,m as extendConfig};
|
package/dist/src/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function i(i){const o=i.config.desktopViewMinWidth||0,e="undefined"!=typeof window,s=e&&("ontouchstart"in window||navigator.maxTouchPoints>0),t=()=>e&&innerWidth<o,n=()=>t(),r={isBrowser:e,isMobile:n,isMobileReflow:()=>n()&&innerHeight<360,isVeryNarrow:()=>n()&&innerWidth<320,isLocalhost:()=>location.host.startsWith("localhost")||location.host.startsWith("127.0.0.1"),isDesktop:()=>e&&!t(),supportsTouch:s}
|
|
1
|
+
function i(i){const o=i.config.desktopViewMinWidth||0,e="undefined"!=typeof window,s=e&&("ontouchstart"in window||navigator.maxTouchPoints>0),t=()=>e&&innerWidth<o,n=()=>t(),r={isBrowser:e,isMobile:n,isMobileReflow:()=>n()&&innerHeight<360,isVeryNarrow:()=>n()&&innerWidth<320,isLocalhost:()=>location.host.startsWith("localhost")||location.host.startsWith("127.0.0.1"),isDesktop:()=>e&&!t(),supportsTouch:s},w=()=>{i.bus.send("env/resize",{isMobile:r.isMobile(),isMobileReflow:r.isMobileReflow(),isVeryNarrow:r.isVeryNarrow()})};e&&window.addEventListener("resize",w);return{...r,dispose:()=>{e&&window.removeEventListener("resize",w)}}}export{i as buildEnv};
|
package/dist/types/src/app.d.ts
CHANGED
|
@@ -58,5 +58,6 @@ declare global {
|
|
|
58
58
|
R: typeof import('ramda');
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
declare function extendConfig(config: AppConfig, extendsConfigs: string[]): Promise<AppConfig>;
|
|
61
62
|
declare function create(rawConfig: AppConfig): Promise<AppInstance>;
|
|
62
|
-
export { create };
|
|
63
|
+
export { create, extendConfig };
|
package/dist/types/src/env.d.ts
CHANGED
package/package.json
CHANGED