vtb-appit 0.0.99 → 0.1.1
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/appit-base-transformer.js +6 -2
- package/appit.js +7 -5
- package/package.json +1 -1
|
@@ -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:
|
|
197
|
-
path:
|
|
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/appit.js
CHANGED
|
@@ -252,12 +252,14 @@ class Appit {
|
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
if(this.history.hasOwnProperty('ships')) {
|
|
256
|
+
let nonExisting = this.difference(Object.values(this.history.ships), Object.values(shipsHistory));
|
|
257
|
+
for(let i = 0; i < nonExisting.length; i++) {
|
|
258
|
+
await this.deleteShips(nonExisting[i]);
|
|
259
|
+
}
|
|
259
260
|
|
|
260
|
-
|
|
261
|
+
this.history.ships = shipsHistory;
|
|
262
|
+
}
|
|
261
263
|
}
|
|
262
264
|
|
|
263
265
|
|