@hawk.so/types 0.2.0 → 0.4.0
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/.github/workflows/bump-version.yml +4 -4
- package/.github/workflows/lint-and-build.yml +4 -4
- package/.github/workflows/npm-publish.yml +4 -4
- package/.nvmrc +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +6 -1
- package/build/src/base/businessOperation/businessOperation.d.ts +4 -4
- package/build/src/base/businessOperation/businessOperation.js +4 -4
- package/build/src/base/event/addons/default.d.ts +1 -1
- package/build/src/base/event/addons/index.d.ts +9 -9
- package/build/src/base/event/addons/javascript.d.ts +2 -2
- package/build/src/base/event/addons/php.d.ts +1 -1
- package/build/src/base/event/addons/sentry.js +1 -0
- package/build/src/base/event/backtraceFrame.d.ts +1 -1
- package/build/src/base/event/breadcrumb.d.ts +3 -6
- package/build/src/base/event/event.d.ts +5 -10
- package/build/src/base/integrations/integrationToken.d.ts +1 -1
- package/build/src/catchers/catcher-message.d.ts +30 -9
- package/build/src/dbScheme/businessOperation.d.ts +2 -2
- package/build/src/dbScheme/groupedEvent.d.ts +12 -6
- package/build/src/dbScheme/membership.d.ts +2 -2
- package/build/src/dbScheme/notificationsChannels.d.ts +1 -1
- package/build/src/dbScheme/plan.d.ts +1 -1
- package/build/src/dbScheme/project.d.ts +3 -4
- package/build/src/dbScheme/projectEventGroupingPattern.d.ts +5 -1
- package/build/src/dbScheme/projectNotificationsRule.d.ts +3 -3
- package/build/src/dbScheme/release.d.ts +2 -7
- package/build/src/dbScheme/repetition.d.ts +13 -4
- package/build/src/dbScheme/sourceMap.d.ts +3 -7
- package/build/src/dbScheme/sso.d.ts +77 -0
- package/build/src/dbScheme/sso.js +5 -0
- package/build/src/dbScheme/user.d.ts +23 -3
- package/build/src/dbScheme/userNotifications.d.ts +1 -1
- package/build/src/dbScheme/workspace.d.ts +6 -1
- package/build/src/notifications/createProjectNotifications.d.ts +2 -2
- package/build/src/notifications/receiveTypes.js +1 -1
- package/build/src/notifications/updateProjectNotifications.d.ts +2 -2
- package/build/src/notifications/userNotification.js +1 -1
- package/build/src/utils/index.d.ts +2 -2
- package/eslint.config.mjs +34 -0
- package/index.ts +1 -0
- package/package.json +11 -6
- package/src/auth/tokensPair.ts +9 -9
- package/src/base/businessOperation/businessOperation.ts +8 -8
- package/src/base/event/addons/default.ts +1 -1
- package/src/base/event/addons/index.ts +11 -12
- package/src/base/event/addons/javascript.ts +2 -2
- package/src/base/event/addons/php.ts +1 -1
- package/src/base/event/addons/sentry.ts +3 -1
- package/src/base/event/affectedUser.ts +16 -16
- package/src/base/event/backtraceFrame.ts +25 -25
- package/src/base/event/breadcrumb.ts +5 -9
- package/src/base/event/event.ts +53 -59
- package/src/base/event/sourceCodeLine.ts +8 -8
- package/src/base/performance/performance.ts +1 -1
- package/src/catchers/catcher-message.ts +29 -8
- package/src/dbScheme/businessOperation.ts +26 -26
- package/src/dbScheme/groupedEvent.ts +52 -46
- package/src/dbScheme/membership.ts +24 -27
- package/src/dbScheme/notificationsChannelSettings.ts +12 -12
- package/src/dbScheme/notificationsChannels.ts +25 -25
- package/src/dbScheme/plan.ts +30 -30
- package/src/dbScheme/project.ts +3 -4
- package/src/dbScheme/projectEventGroupingPattern.ts +8 -4
- package/src/dbScheme/projectNotificationsRule.ts +52 -52
- package/src/dbScheme/release.ts +3 -8
- package/src/dbScheme/repetition.ts +39 -30
- package/src/dbScheme/sourceMap.ts +4 -8
- package/src/dbScheme/sso.ts +88 -0
- package/src/dbScheme/user.ts +25 -3
- package/src/dbScheme/userNotifications.ts +9 -9
- package/src/dbScheme/workspace.ts +84 -78
- package/src/notifications/createProjectNotifications.ts +27 -27
- package/src/notifications/receiveTypes.ts +8 -8
- package/src/notifications/updateProjectNotifications.ts +26 -26
- package/src/notifications/userNotification.ts +12 -12
- package/src/utils/index.ts +1 -1
- package/.eslintrc +0 -12
package/src/base/event/event.ts
CHANGED
|
@@ -1,89 +1,83 @@
|
|
|
1
|
-
import { BacktraceFrame } from './backtraceFrame';
|
|
2
|
-
import { AffectedUser } from './affectedUser';
|
|
3
|
-
import { EventAddons } from './addons';
|
|
4
|
-
import {
|
|
5
|
-
import { Json } from '../../utils';
|
|
1
|
+
import type { BacktraceFrame } from './backtraceFrame.ts';
|
|
2
|
+
import type { AffectedUser } from './affectedUser.ts';
|
|
3
|
+
import type { EventAddons } from './addons/index.ts';
|
|
4
|
+
import type { Json } from '../../utils/index.ts';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Information about event (Payload of the event)
|
|
9
8
|
* That object will be sent as 'payload' from the Collector to the workers
|
|
10
9
|
*/
|
|
11
10
|
export interface EventData<Addons extends EventAddons> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Event title
|
|
13
|
+
*/
|
|
14
|
+
title: string;
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Event type (severity level)
|
|
18
|
+
*/
|
|
19
|
+
type?: string;
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Stack
|
|
23
|
+
* From the latest call to the earliest
|
|
24
|
+
*/
|
|
25
|
+
backtrace?: BacktraceFrame[];
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Catcher-specific information
|
|
29
|
+
*/
|
|
30
|
+
addons?: Addons;
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Current release (aka version, revision) of an application
|
|
34
|
+
*/
|
|
35
|
+
release?: string;
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Current authenticated user
|
|
39
|
+
*/
|
|
40
|
+
user?: AffectedUser;
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Any other information collected and passed by user
|
|
44
|
+
*/
|
|
45
|
+
context?: EventContext | string;
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Catcher version
|
|
55
|
-
*/
|
|
56
|
-
catcherVersion?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Catcher version
|
|
49
|
+
*/
|
|
50
|
+
catcherVersion?: string;
|
|
57
51
|
}
|
|
58
52
|
|
|
59
53
|
/**
|
|
60
54
|
* Event data with decoded unsafe fields
|
|
61
55
|
*/
|
|
62
56
|
export interface DecodedEventData<Addons extends EventAddons> extends EventData<Addons> {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Json parsed context string
|
|
59
|
+
*/
|
|
60
|
+
context?: EventContext;
|
|
67
61
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Json parsed addons string
|
|
64
|
+
*/
|
|
65
|
+
addons?: Addons;
|
|
72
66
|
}
|
|
73
67
|
|
|
74
68
|
/**
|
|
75
69
|
* Event data with encoded unsafe fields
|
|
76
70
|
*/
|
|
77
71
|
export interface EncodedEventData extends EventData<EventAddons> {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Stringified context object
|
|
74
|
+
*/
|
|
75
|
+
context?: string;
|
|
82
76
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Stringified addons object
|
|
79
|
+
*/
|
|
80
|
+
addons?: string;
|
|
87
81
|
}
|
|
88
82
|
|
|
89
83
|
/**
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Used in event.payload.backtrace[].sourceCode
|
|
4
4
|
*/
|
|
5
5
|
export interface SourceCodeLine {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Line number
|
|
8
|
+
*/
|
|
9
|
+
line: number;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Line content
|
|
13
|
+
*/
|
|
14
|
+
content: string;
|
|
15
15
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { DecodedEventData, EventData } from '../base/event/event';
|
|
2
|
-
import { PerformanceData } from '../base/performance/performance';
|
|
1
|
+
import type { DecodedEventData, EventData } from '../base/event/event.ts';
|
|
2
|
+
import type { PerformanceData } from '../base/performance/performance.ts';
|
|
3
3
|
|
|
4
|
-
import type {
|
|
5
|
-
JavaScriptAddons,
|
|
4
|
+
import type {
|
|
5
|
+
JavaScriptAddons,
|
|
6
6
|
PhpAddons,
|
|
7
7
|
NodeJSAddons,
|
|
8
8
|
GoAddons,
|
|
9
9
|
PythonAddons,
|
|
10
|
-
DefaultAddons
|
|
11
|
-
} from '../base/event/addons';
|
|
10
|
+
DefaultAddons
|
|
11
|
+
} from '../base/event/addons/index.ts';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Type that represents all supported Catcher message types for events
|
|
@@ -18,7 +18,7 @@ export type ErrorsCatcherType = 'errors/javascript'
|
|
|
18
18
|
| 'errors/nodejs'
|
|
19
19
|
| 'errors/go'
|
|
20
20
|
| 'errors/python'
|
|
21
|
-
| 'errors/default'
|
|
21
|
+
| 'errors/default';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Type that represents all supported Catcher message types for performance
|
|
@@ -34,13 +34,34 @@ export type CatcherMessageType = ErrorsCatcherType | MetricsCatcherType;
|
|
|
34
34
|
* Type that represents the payload of a Catcher message based on its type
|
|
35
35
|
*/
|
|
36
36
|
export type CatcherMessagePayload<Type extends CatcherMessageType> = {
|
|
37
|
+
/**
|
|
38
|
+
* Addons that can be added to all errors except those which have a separate workers
|
|
39
|
+
*/
|
|
37
40
|
'errors/default': DecodedEventData<DefaultAddons>;
|
|
41
|
+
/**
|
|
42
|
+
* Added by JavaScript SDK
|
|
43
|
+
*/
|
|
38
44
|
'errors/javascript': DecodedEventData<JavaScriptAddons>;
|
|
45
|
+
/**
|
|
46
|
+
* Added by PHP SDK
|
|
47
|
+
*/
|
|
39
48
|
'errors/php': EventData<PhpAddons>;
|
|
49
|
+
/**
|
|
50
|
+
* Added by Node.js SDK
|
|
51
|
+
*/
|
|
40
52
|
'errors/nodejs': EventData<NodeJSAddons>;
|
|
53
|
+
/**
|
|
54
|
+
* Added by Go SDK
|
|
55
|
+
*/
|
|
41
56
|
'errors/go': EventData<GoAddons>;
|
|
57
|
+
/**
|
|
58
|
+
* Added by Python SDK
|
|
59
|
+
*/
|
|
42
60
|
'errors/python': EventData<PythonAddons>;
|
|
43
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Performance monitoring data
|
|
63
|
+
*/
|
|
64
|
+
performance: PerformanceData;
|
|
44
65
|
}[Type];
|
|
45
66
|
|
|
46
67
|
/**
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
2
|
-
import { BusinessOperationStatus, BusinessOperationType, BusinessOperationPayloadType } from
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
|
+
import type { BusinessOperationStatus, BusinessOperationType, BusinessOperationPayloadType } from '../base/businessOperation/businessOperation.ts';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Structure represents a Business operation in DataBase
|
|
6
6
|
*/
|
|
7
7
|
export interface BusinessOperationDBScheme<T extends BusinessOperationPayloadType = BusinessOperationPayloadType> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Business operation ID
|
|
10
|
+
*/
|
|
11
|
+
_id?: ObjectId;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Business operation Transaction ID
|
|
15
|
+
*/
|
|
16
|
+
transactionId: string;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Business operation type
|
|
20
|
+
*/
|
|
21
|
+
type: BusinessOperationType;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Business operation status
|
|
25
|
+
*/
|
|
26
|
+
status: BusinessOperationStatus;
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Business operation payload
|
|
30
|
+
*/
|
|
31
|
+
payload: T;
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Date when operation was created
|
|
35
|
+
*/
|
|
36
|
+
dtCreated: Date;
|
|
37
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
2
|
-
import { DecodedEventData, EncodedEventData, EventData } from
|
|
3
|
-
import { UserDBScheme } from
|
|
4
|
-
import { EventAddons } from '../base/event/addons';
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
|
+
import type { DecodedEventData, EncodedEventData, EventData } from '../base/event/event.ts';
|
|
3
|
+
import type { UserDBScheme } from './user.ts';
|
|
4
|
+
import type { EventAddons } from '../base/event/addons/index.ts';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Event marks interface for tracking event status
|
|
@@ -17,64 +17,70 @@ export interface EventMarks {
|
|
|
17
17
|
* Event data after grouper-worker transformation to store it in database
|
|
18
18
|
*/
|
|
19
19
|
export interface GroupedEventDBScheme {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Internal mongo id
|
|
22
|
+
*/
|
|
23
|
+
_id?: ObjectId;
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Hash for grouping similar events
|
|
27
|
+
*/
|
|
28
|
+
groupHash: string;
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Number of events repetitions
|
|
32
|
+
*/
|
|
33
|
+
totalCount: number;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Error language type
|
|
37
|
+
*/
|
|
38
|
+
catcherType: string;
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Event data
|
|
42
|
+
*/
|
|
43
|
+
payload: EventData<EventAddons>;
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
/**
|
|
46
|
+
* How many users catch this error
|
|
47
|
+
*/
|
|
48
|
+
usersAffected: number;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Array of users who visited this event
|
|
52
|
+
*/
|
|
53
|
+
visitedBy: UserDBScheme[];
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Occurrence time
|
|
57
|
+
* Unix timestamp in seconds (example: 1567009247.576)
|
|
58
|
+
* (created by the Collector)
|
|
59
|
+
*/
|
|
60
|
+
timestamp: number;
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Event marks for tracking status
|
|
64
|
+
*/
|
|
65
|
+
marks?: EventMarks;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* Event where 'context' and 'addons' are decoded from json strings to objects
|
|
70
70
|
*/
|
|
71
71
|
export interface DecodedGroupedEvent extends GroupedEventDBScheme {
|
|
72
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Event data where 'context' and 'addons' are objects
|
|
74
|
+
*/
|
|
75
|
+
payload: DecodedEventData<EventAddons>;
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
/**
|
|
76
|
-
*
|
|
79
|
+
* In database we store 'context' and 'addons' as json strings to avoind mongo keys conflict
|
|
77
80
|
*/
|
|
78
81
|
export interface EncodedGroupedEvent extends GroupedEventDBScheme {
|
|
79
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Event data where 'context' and 'addons' are json strings
|
|
84
|
+
*/
|
|
85
|
+
payload: EncodedEventData;
|
|
80
86
|
}
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents confirmed member info in DB
|
|
5
5
|
*/
|
|
6
6
|
export interface ConfirmedMemberDBScheme {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Document id
|
|
9
|
+
*/
|
|
10
|
+
_id: ObjectId;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Id of the member of workspace
|
|
14
|
+
*/
|
|
15
|
+
userId: ObjectId;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Is user admin in workspace
|
|
19
|
+
*/
|
|
20
|
+
isAdmin?: boolean;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
23
|
/**
|
|
25
24
|
* Represents pending member info in DB
|
|
26
25
|
*/
|
|
27
26
|
export interface PendingMemberDBScheme {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Document id
|
|
29
|
+
*/
|
|
30
|
+
_id: ObjectId;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* User email for invitation
|
|
34
|
+
*/
|
|
35
|
+
userEmail: string;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
|
|
40
38
|
/**
|
|
41
39
|
* Represents full structure of team collection documents
|
|
42
40
|
*/
|
|
43
41
|
export type MemberDBScheme = ConfirmedMemberDBScheme | PendingMemberDBScheme;
|
|
44
|
-
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
* Setting of a channel
|
|
3
3
|
*/
|
|
4
4
|
export interface NotificationsChannelSettingsDBScheme {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Allows to disable channel without removing endpoint
|
|
7
|
+
*/
|
|
8
|
+
isEnabled: boolean;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Endpoint: email, slack webhook, telegram bot webhook, push subscription id, etc
|
|
12
|
+
*/
|
|
13
|
+
endpoint: string;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Minimal pause between second notification, in seconds
|
|
17
|
+
*/
|
|
18
|
+
minPeriod: number;
|
|
19
19
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { NotificationsChannelSettingsDBScheme } from
|
|
1
|
+
import type { NotificationsChannelSettingsDBScheme } from '../../index.ts';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Available channels
|
|
5
5
|
*/
|
|
6
6
|
export interface NotificationsChannelsDBScheme {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Alerts on email
|
|
9
|
+
*/
|
|
10
|
+
email?: NotificationsChannelSettingsDBScheme;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Alerts through the Slack
|
|
14
|
+
*/
|
|
15
|
+
slack?: NotificationsChannelSettingsDBScheme;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Alerts through the Telegram
|
|
19
|
+
*/
|
|
20
|
+
telegram?: NotificationsChannelSettingsDBScheme;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Browser pushes
|
|
24
|
+
*/
|
|
25
|
+
webPush?: NotificationsChannelSettingsDBScheme;
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Pushes through the Hawk Desktop app
|
|
29
|
+
*/
|
|
30
|
+
desktopPush?: NotificationsChannelSettingsDBScheme;
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Alerts through the Loop
|
|
34
|
+
*/
|
|
35
|
+
loop?: NotificationsChannelSettingsDBScheme;
|
|
36
36
|
}
|
package/src/dbScheme/plan.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Plan representation in DataBase
|
|
5
5
|
*/
|
|
6
6
|
export interface PlanDBScheme {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Plan's id
|
|
9
|
+
*/
|
|
10
|
+
_id: ObjectId;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Plan's name
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Monthly charge for plan in currencry specified in `monthlyChargeCurrency`
|
|
19
|
+
*/
|
|
20
|
+
monthlyCharge: number;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Currency of `monthlyCharge`
|
|
24
|
+
*/
|
|
25
|
+
monthlyChargeCurrency: string;
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Maximum amount of events available for plan
|
|
29
|
+
*/
|
|
30
|
+
eventsLimit: number;
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Is this plan used by default?
|
|
34
|
+
*/
|
|
35
|
+
isDefault: boolean;
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Special plans to be selected manually
|
|
39
|
+
* No one cannot be switched to this plan by api
|
|
40
|
+
*/
|
|
41
|
+
isHidden?: boolean;
|
|
42
42
|
}
|