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.
@@ -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
- const req = https.request(media[i].url, res => {
236
- let chunks = [];
237
- res.on('data', chunk => {
238
- chunks.push(chunk);
239
- })
240
-
241
- res.on('end', () => {
242
- const buffer = Buffer.concat(chunks).toString('base64');
243
- let base64Data = 'data:' + res.headers['content-type'] + ';base64,';
244
- base64Data += buffer;
245
-
246
- let frags = media[i].url.split('/');
247
-
248
- resolve({
249
- title: '',
250
- name: frags[frags.length - 1],
251
- content: base64Data
252
- });
253
- })
254
- });
255
-
256
- req.end();
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vtb-appit",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {