wingbot 3.69.3 → 3.69.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.69.3",
3
+ "version": "3.69.5",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
@@ -69,7 +69,7 @@ async function trackingEvent (req, res) {
69
69
  const a = compileWithState(req, res, action).trim();
70
70
  const l = compileWithState(req, res, label).trim();
71
71
  const v = parseFloat(compileWithState(req, res, value)
72
- .replace(/[^0-9.]+/, '')) || 0;
72
+ .replace(/[^0-9.,-]+/g, '').replace(/,+/g, '.')) || 0;
73
73
 
74
74
  const {
75
75
  '§gi': clientId,
@@ -15,7 +15,7 @@ const uuid = require('uuid');
15
15
  * @typedef {object} Target
16
16
  * @prop {string} senderId
17
17
  * @prop {string} pageId
18
- * @prop {{ [key: string]: object }} [meta]
18
+ * @prop {Object<string,object>} [meta]
19
19
  */
20
20
 
21
21
  /**
@@ -23,7 +23,7 @@ const uuid = require('uuid');
23
23
  * @prop {string} senderId
24
24
  * @prop {string} pageId
25
25
  * @prop {string[]} subs
26
- * @prop {{ [key: string]: object }} [meta]
26
+ * @prop {Object<string,object>} [meta]
27
27
  */
28
28
 
29
29
  /**
@@ -91,7 +91,7 @@ const uuid = require('uuid');
91
91
  * @prop {string} senderId
92
92
  * @prop {string[]} tags
93
93
  * @prop {boolean} [remove]
94
- * @prop {{ [key: string]: object }} [meta]
94
+ * @prop {Object<string,object>} [meta]
95
95
  */
96
96
 
97
97
  const MAX_TS = 9999999999999;
@@ -53,7 +53,7 @@ function getFields (info) {
53
53
  * @prop {string} senderId
54
54
  * @prop {string[]} tags
55
55
  * @prop {boolean} [remove]
56
- * @prop {{ [key: string]: object }} [meta]
56
+ * @prop {Object<string,object>} [meta]
57
57
  */
58
58
 
59
59
  /**
@@ -275,7 +275,7 @@ function notificationsApiFactory (storage, notifications, acl, options = {}) {
275
275
  * @prop {string} senderId
276
276
  * @prop {string[]} tags
277
277
  * @prop {boolean} [remove]
278
- * @prop {{ [key: string]: object }} [meta]
278
+ * @prop {Object<string,object>} [meta]
279
279
  */
280
280
 
281
281
  /**
@@ -289,7 +289,13 @@ function notificationsApiFactory (storage, notifications, acl, options = {}) {
289
289
  return null;
290
290
  }
291
291
 
292
- const { subscriptions } = args;
292
+ let { subscriptions } = args;
293
+
294
+ if (typeof options.preprocessSubscribe === 'function') {
295
+ subscriptions = await Promise.resolve(
296
+ options.preprocessSubscribe(subscriptions)
297
+ );
298
+ }
293
299
 
294
300
  await storage.batchSubscribe(subscriptions, true);
295
301
  return true;