vtb-appit 0.0.58 → 0.0.60
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 +36 -22
- package/package.json +1 -1
|
@@ -58,6 +58,16 @@ class AppitBaseTransformer {
|
|
|
58
58
|
return false;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
contacts()
|
|
62
|
+
{
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
notifications()
|
|
67
|
+
{
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
61
71
|
travelInfo()
|
|
62
72
|
{
|
|
63
73
|
return false;
|
|
@@ -232,28 +242,32 @@ class AppitBaseTransformer {
|
|
|
232
242
|
|
|
233
243
|
promises.push(new Promise((resolve, reject) => {
|
|
234
244
|
for(let i = 0; i < media.length; i++) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
245
|
+
try {
|
|
246
|
+
const req = https.request(media[i].url, res => {
|
|
247
|
+
let chunks = [];
|
|
248
|
+
res.on('data', chunk => {
|
|
249
|
+
chunks.push(chunk);
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
res.on('end', () => {
|
|
253
|
+
const buffer = Buffer.concat(chunks).toString('base64');
|
|
254
|
+
let base64Data = 'data:' + res.headers['content-type'] + ';base64,';
|
|
255
|
+
base64Data += buffer;
|
|
256
|
+
|
|
257
|
+
let frags = media[i].url.split('/');
|
|
258
|
+
|
|
259
|
+
resolve({
|
|
260
|
+
title: '',
|
|
261
|
+
name: frags[frags.length - 1],
|
|
262
|
+
content: base64Data
|
|
263
|
+
});
|
|
264
|
+
})
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
req.end();
|
|
268
|
+
} catch(e) {
|
|
269
|
+
resolve({});
|
|
270
|
+
}
|
|
257
271
|
}
|
|
258
272
|
}));
|
|
259
273
|
|