diff --git a/build/src/dbScheme/projectNotificationsRule.d.ts b/build/src/dbScheme/projectNotificationsRule.d.ts index b504b8b..14ab780 100644 --- a/build/src/dbScheme/projectNotificationsRule.d.ts +++ b/build/src/dbScheme/projectNotificationsRule.d.ts @@ -18,7 +18,7 @@ export interface ProjectNotificationsRuleDBScheme { */ uidAdded: ObjectId; /** - * Receive type: 'ALL' or 'ONLY_NEW' + * Receive type: 'SEEN_MORE' or 'ONLY_NEW' */ whatToReceive: ReceiveTypes; /** @@ -33,4 +33,12 @@ export interface ProjectNotificationsRuleDBScheme { * Available channels to receive */ channels: NotificationsChannelsDBScheme; + /** + * If this number of events is reached in the eventThresholdPeriod, the rule will be triggered + */ + threshold?: number; + /** + * Size of period (in milliseconds) to count events to compare to rule threshold + */ + thresholdPeriod?: number; } diff --git a/build/src/notifications/receiveTypes.d.ts b/build/src/notifications/receiveTypes.d.ts index 45d7041..2c650fd 100644 --- a/build/src/notifications/receiveTypes.d.ts +++ b/build/src/notifications/receiveTypes.d.ts @@ -3,9 +3,9 @@ */ export declare enum ReceiveTypes { /** - * All notifications + * If event seen more than threshold in thresholdPeriod */ - ALL = "ALL", + SEEN_MORE = "SEEN_MORE", /** * Only first occurrence */ diff --git a/build/src/notifications/receiveTypes.js b/build/src/notifications/receiveTypes.js index 4e43dfd..c44682d 100644 --- a/build/src/notifications/receiveTypes.js +++ b/build/src/notifications/receiveTypes.js @@ -7,9 +7,9 @@ exports.ReceiveTypes = void 0; var ReceiveTypes; (function (ReceiveTypes) { /** - * All notifications + * If event seen more than threshold in thresholdPeriod */ - ReceiveTypes["ALL"] = "ALL"; + ReceiveTypes["SEEN_MORE"] = "SEEN_MORE"; /** * Only first occurrence */ diff --git a/package.json b/package.json index 3fb96ae..9556c10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hawk.so/types", - "version": "0.1.21", + "version": "0.1.22", "description": "TypeScript definitions for Hawk", "types": "build/index.d.ts", "main": "build/index.js", diff --git a/src/dbScheme/projectNotificationsRule.ts b/src/dbScheme/projectNotificationsRule.ts index cb16c2c..412d874 100644 --- a/src/dbScheme/projectNotificationsRule.ts +++ b/src/dbScheme/projectNotificationsRule.ts @@ -22,7 +22,7 @@ export interface ProjectNotificationsRuleDBScheme { uidAdded: ObjectId; /** - * Receive type: 'ALL' or 'ONLY_NEW' + * Receive type: 'SEEN_MORE' or 'ONLY_NEW' */ whatToReceive: ReceiveTypes; @@ -40,4 +40,14 @@ export interface ProjectNotificationsRuleDBScheme { * Available channels to receive */ channels: NotificationsChannelsDBScheme; + + /** + * If this number of events is reached in the eventThresholdPeriod, the rule will be triggered + */ + threshold?: number; + + /** + * Size of period (in milliseconds) to count events to compare to rule threshold + */ + thresholdPeriod?: number; } diff --git a/src/notifications/receiveTypes.ts b/src/notifications/receiveTypes.ts index 3309401..514c5ed 100644 --- a/src/notifications/receiveTypes.ts +++ b/src/notifications/receiveTypes.ts @@ -3,12 +3,12 @@ */ export enum ReceiveTypes { /** - * All notifications + * If event seen more than threshold in thresholdPeriod */ - ALL = 'ALL', + SEEN_MORE = 'SEEN_MORE', /** * Only first occurrence */ ONLY_NEW = 'ONLY_NEW', -} \ No newline at end of file +}