ldn-inbox-server 1.4.7 → 1.4.8

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/lib/index.js CHANGED
@@ -8,7 +8,8 @@ const {
8
8
  backOff_fetch,
9
9
  sendNotification,
10
10
  moveTo,
11
- parseAsJSON
11
+ parseAsJSON,
12
+ generateId
12
13
  } = require('../lib/util');
13
14
  const { handle_inbox } = require('../lib/handler');
14
15
  const logger = getLogger();
@@ -283,5 +284,6 @@ module.exports = {
283
284
  fetchOriginal ,
284
285
  moveTo ,
285
286
  sendNotification ,
286
- handle_inbox
287
+ handle_inbox ,
288
+ generateId
287
289
  };
package/lib/util.js CHANGED
@@ -56,7 +56,7 @@ async function sendNotification(url,json,options) {
56
56
  }
57
57
 
58
58
  if (!json['id']) {
59
- json['id'] = 'urn:uuid:' + uuidv4();
59
+ json['id'] = generateId();
60
60
  }
61
61
 
62
62
  let fetcher = (options && options['fetch']) ? options['fetch'] : backOff_fetch;
@@ -227,8 +227,13 @@ function parseLocalResource(url,options) {
227
227
  return { filePath, metaPath, json };
228
228
  }
229
229
 
230
+ function generateId() {
231
+ return 'urn:uuid:' + uuidv4();
232
+ }
233
+
230
234
  module.exports = {
231
235
  getLogger ,
236
+ generateId ,
232
237
  backOff_fetch ,
233
238
  fetchOriginal ,
234
239
  moveTo ,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ldn-inbox-server",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "A demonstration Event Notifications Inbox server",
5
5
  "main": "lib/index.js",
6
6
  "author": "Patrick Hochstenbach <Patrick.Hochstenbach@UGent.be>",