vtb-appit 0.0.99 → 0.1.0

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.
@@ -186,6 +186,10 @@ class AppitBaseTransformer {
186
186
  const endPath = '/documentdata/';
187
187
  let documents = await this.tsFetchDocuments(jwt, decoded, endPath);
188
188
 
189
+ let baseUrl = (decoded.hasOwnProperty('https://visualtourbuilder.com/app_metadata')) ?
190
+ decoded['https://visualtourbuilder.com/app_metadata'].baseUrl :
191
+ decoded.baseUrl;
192
+
189
193
  let promises = [];
190
194
  documents.forEach(document => {
191
195
  promises.push(new Promise(resolve => {
@@ -193,8 +197,8 @@ class AppitBaseTransformer {
193
197
  headers: {
194
198
  'Authorization': jwt
195
199
  },
196
- hostname: decoded['https://visualtourbuilder.com/app_metadata'].baseUrl.replace('https://', '').replace(/.com\/.*/, '.com').replace(/.app\/.*/, '.app'),
197
- path: decoded['https://visualtourbuilder.com/app_metadata'].baseUrl.replace(/.*?.app/, '').replace(/.*?.com/, '') + endPath + document.id,
200
+ hostname: baseUrl.replace('https://', '').replace(/.com\/.*/, '.com').replace(/.app\/.*/, '.app'),
201
+ path: baseUrl.replace(/.*?.app/, '').replace(/.*?.com/, '') + endPath + document.id,
198
202
  method: 'GET'
199
203
  }, res => {
200
204
  let chunks = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vtb-appit",
3
- "version": "0.0.99",
3
+ "version": "0.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {},