Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion build/src/dbScheme/projectNotificationsRule.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ProjectNotificationsRuleDBScheme {
*/
uidAdded: ObjectId;
/**
* Receive type: 'ALL' or 'ONLY_NEW'
* Receive type: 'SEEN_MORE' or 'ONLY_NEW'
*/
whatToReceive: ReceiveTypes;
/**
Expand All @@ -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;
}
4 changes: 2 additions & 2 deletions build/src/notifications/receiveTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
4 changes: 2 additions & 2 deletions build/src/notifications/receiveTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 11 additions & 1 deletion src/dbScheme/projectNotificationsRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ProjectNotificationsRuleDBScheme {
uidAdded: ObjectId;

/**
* Receive type: 'ALL' or 'ONLY_NEW'
* Receive type: 'SEEN_MORE' or 'ONLY_NEW'
*/
whatToReceive: ReceiveTypes;

Expand All @@ -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;
}
6 changes: 3 additions & 3 deletions src/notifications/receiveTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
}
Loading