wingbot 3.69.2 → 3.69.4
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
|
@@ -10,7 +10,8 @@ const api = require('./api');
|
|
|
10
10
|
const customFn = require('../utils/customFn');
|
|
11
11
|
const customCondition = require('../utils/customCondition');
|
|
12
12
|
|
|
13
|
-
const DEFAULT_LIMIT =
|
|
13
|
+
const DEFAULT_LIMIT = 400;
|
|
14
|
+
const DEFAULT_SEND_LIMIT = 20;
|
|
14
15
|
const DAY = 86400000;
|
|
15
16
|
const WINDOW_24_HOURS = DAY; // 24 hours
|
|
16
17
|
const REMOVED_CAMPAIGN = '<removed campaign>';
|
|
@@ -152,7 +153,7 @@ class Notifications extends EventEmitter {
|
|
|
152
153
|
this.limit = DEFAULT_LIMIT;
|
|
153
154
|
|
|
154
155
|
/** @type {number} */
|
|
155
|
-
this.sendLimit =
|
|
156
|
+
this.sendLimit = DEFAULT_SEND_LIMIT;
|
|
156
157
|
|
|
157
158
|
this._default24Clearance = options.default24Clearance || DEFAULT_24_CLEARANCE;
|
|
158
159
|
this._allAudienceTag = typeof options.allAudienceTag !== 'undefined'
|
|
@@ -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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
-
|
|
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;
|