atriusmaps-node-sdk 3.3.1174 → 3.3.1176

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "3.3.1174";
5
+ var version = "3.3.1176";
6
6
  var pkg = {
7
7
  version: version};
8
8
 
@@ -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)}&mode=interactive` : path;
18
+ return assetStage ? `${path}?assetStage=${encodeURIComponent(assetStage)}` : path;
19
19
  };
20
20
  const hop1StatusToReason = (status) => {
21
21
  switch (status) {
@@ -1 +1 @@
1
- var a="3.3.1174",e={version:a};export{e as default,a as version};
1
+ var a="3.3.1176",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)}&mode=interactive`: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};
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.1174",
3
+ "version": "3.3.1176",
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
  "acuitybrands",