@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/dbScheme/project.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ObjectId } from '
|
|
2
|
-
import { ProjectNotificationsRuleDBScheme } from '../../index';
|
|
3
|
-
import { ProjectEventGroupingPatternsDBScheme } from '../../index';
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
|
+
import type { ProjectNotificationsRuleDBScheme } from '../../index.ts';
|
|
3
|
+
import type { ProjectEventGroupingPatternsDBScheme } from '../../index.ts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Structure represents a Project in DataBase
|
|
@@ -13,7 +13,6 @@ export interface ProjectDBScheme {
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Unique integration id, that's used as collector domain url for sending events
|
|
16
|
-
*
|
|
17
16
|
* @example `wss://${integrationId}.k1.hawk.so/ws`
|
|
18
17
|
*/
|
|
19
18
|
integrationId: string;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Project admin can specify regular expression patterns to group events into categories.
|
|
5
|
+
* We store them in the database to be able to use them in the UI.
|
|
6
|
+
*/
|
|
3
7
|
export interface ProjectEventGroupingPatternsDBScheme {
|
|
4
8
|
/**
|
|
5
9
|
* If of the pattern
|
|
6
10
|
*/
|
|
7
|
-
_id: ObjectId
|
|
11
|
+
_id: ObjectId;
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* String that represents regular expression pattern
|
|
11
15
|
*/
|
|
12
|
-
pattern: string
|
|
13
|
-
}
|
|
16
|
+
pattern: string;
|
|
17
|
+
}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
2
|
-
import { ReceiveTypes } from
|
|
3
|
-
import { NotificationsChannelsDBScheme } from
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
|
+
import type { ReceiveTypes } from '../../index.ts';
|
|
3
|
+
import type { NotificationsChannelsDBScheme } from './notificationsChannels.ts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* This structure represents a single rule of notifications settings
|
|
7
7
|
*/
|
|
8
8
|
export interface ProjectNotificationsRuleDBScheme {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Id of Rule
|
|
11
|
+
*/
|
|
12
|
+
_id: ObjectId;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Allows to disable rule without removing
|
|
16
|
+
*/
|
|
17
|
+
isEnabled: boolean;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Creator of the rule
|
|
21
|
+
*/
|
|
22
|
+
uidAdded: ObjectId;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Receive type: 'SEEN_MORE' or 'ONLY_NEW'
|
|
26
|
+
*/
|
|
27
|
+
whatToReceive: ReceiveTypes;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Only those which contains passed words
|
|
31
|
+
*/
|
|
32
|
+
including: string[];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Skip those which contains passed words
|
|
36
|
+
*/
|
|
37
|
+
excluding: string[];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Available channels to receive
|
|
41
|
+
*/
|
|
42
|
+
channels: NotificationsChannelsDBScheme;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* If this number of events is reached in the eventThresholdPeriod, the rule will be triggered
|
|
46
|
+
*/
|
|
47
|
+
threshold?: number;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Size of period (in milliseconds) to count events to compare to rule threshold
|
|
51
|
+
*/
|
|
52
|
+
thresholdPeriod?: number;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* If rule is created automatically (on project creation or conversion of old projects)
|
|
56
|
+
*/
|
|
57
|
+
autoAdded?: string;
|
|
58
58
|
}
|
package/src/dbScheme/release.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
2
|
-
import { SourceMapDataExtended } from './sourceMap';
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
|
+
import type { SourceMapDataExtended } from './sourceMap.ts';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Git commit data stored in the release
|
|
@@ -7,28 +7,24 @@ import { SourceMapDataExtended } from './sourceMap';
|
|
|
7
7
|
export interface CommitData {
|
|
8
8
|
/**
|
|
9
9
|
* Commit hash
|
|
10
|
-
*
|
|
11
10
|
* @example 599575d00e62924d08b031defe0a6b10133a75fc
|
|
12
11
|
*/
|
|
13
12
|
hash: string;
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Title of the commit
|
|
17
|
-
*
|
|
18
16
|
* @example Hot fix
|
|
19
17
|
*/
|
|
20
18
|
title: string;
|
|
21
19
|
|
|
22
20
|
/**
|
|
23
21
|
* Commit author
|
|
24
|
-
*
|
|
25
22
|
* @example codex-team@codex.so
|
|
26
23
|
*/
|
|
27
24
|
author: string;
|
|
28
25
|
|
|
29
26
|
/**
|
|
30
27
|
* Commit date
|
|
31
|
-
*
|
|
32
28
|
* @example 2021-04-23T10:54:01.000+00:00
|
|
33
29
|
*/
|
|
34
30
|
date: Date;
|
|
@@ -44,13 +40,12 @@ export interface ReleaseDBScheme {
|
|
|
44
40
|
_id: ObjectId;
|
|
45
41
|
|
|
46
42
|
/**
|
|
47
|
-
* ProjectId associated with the release
|
|
43
|
+
* ProjectId associated with the release
|
|
48
44
|
*/
|
|
49
45
|
projectId: string;
|
|
50
46
|
|
|
51
47
|
/**
|
|
52
48
|
* Release name
|
|
53
|
-
*
|
|
54
49
|
* @example Version 1.0
|
|
55
50
|
*/
|
|
56
51
|
release: string;
|
|
@@ -1,48 +1,57 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
2
|
-
import { DecodedEventData, EncodedEventData, EventData } from '../base/event/event';
|
|
3
|
-
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 { EventAddons } from '../base/event/addons/index.ts';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Repetition - is a record about event that was already processed. It stores only difference between original event and repetition.
|
|
7
|
+
*/
|
|
5
8
|
export interface RepetitionDBScheme {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Internal mongo id
|
|
11
|
+
*/
|
|
12
|
+
_id?: ObjectId;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Hash for grouping similar events
|
|
16
|
+
*/
|
|
17
|
+
groupHash: string;
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated use delta instead
|
|
21
|
+
* And any of EventData field with diff
|
|
22
|
+
* except fields that used in groupHash
|
|
23
|
+
*/
|
|
24
|
+
payload?: EventData<EventAddons>;
|
|
15
25
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
payload?: EventData<EventAddons>;
|
|
26
|
+
/**
|
|
27
|
+
* Delta between original event and repetition
|
|
28
|
+
*/
|
|
29
|
+
delta?: string;
|
|
22
30
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* Occurrence time
|
|
30
|
-
* Unix timestamp in seconds (example: 1567009247.576)
|
|
31
|
-
* (created by the Collector)
|
|
32
|
-
*/
|
|
33
|
-
timestamp: number;
|
|
31
|
+
/**
|
|
32
|
+
* Occurrence time
|
|
33
|
+
* Unix timestamp in seconds (example: 1567009247.576)
|
|
34
|
+
* (created by the Collector)
|
|
35
|
+
*/
|
|
36
|
+
timestamp: number;
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
/**
|
|
37
40
|
* Repetition with decoded event data
|
|
38
41
|
*/
|
|
39
42
|
export interface DecodedRepetition {
|
|
40
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Event data where 'context' and 'addons' are objects
|
|
45
|
+
*/
|
|
46
|
+
payload: DecodedEventData<EventAddons>;
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
/**
|
|
44
50
|
* Repetition with decoded event data
|
|
45
51
|
*/
|
|
46
52
|
export interface EncodedRepetition {
|
|
47
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Event data where 'context' and 'addons' are json strings
|
|
55
|
+
*/
|
|
56
|
+
payload: EncodedEventData;
|
|
48
57
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ObjectId, Timestamp } from 'bson';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Source map with parsed file names, stored in the release
|
|
@@ -6,14 +6,12 @@ import { ObjectID, Timestamp } from 'mongodb';
|
|
|
6
6
|
export interface SourceMapDataExtended {
|
|
7
7
|
/**
|
|
8
8
|
* Name of source-map file
|
|
9
|
-
*
|
|
10
9
|
* @example main.min.js.map
|
|
11
10
|
*/
|
|
12
11
|
mapFileName: string;
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Bundle or chunk name
|
|
16
|
-
*
|
|
17
15
|
* @example main.min.js
|
|
18
16
|
*/
|
|
19
17
|
originFileName: string;
|
|
@@ -27,19 +25,18 @@ export interface SourceMapDataExtended {
|
|
|
27
25
|
/**
|
|
28
26
|
* When file will be saved to GridFS, there will be its id instead of 'content'
|
|
29
27
|
*/
|
|
30
|
-
_id?:
|
|
28
|
+
_id?: ObjectId;
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
34
32
|
* Object represents a file structure stored in Mongo GridFS
|
|
35
|
-
*
|
|
36
33
|
* @see https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst#definitions
|
|
37
34
|
*/
|
|
38
35
|
export interface SourceMapFileChunk {
|
|
39
36
|
/**
|
|
40
37
|
* Unique id of a file chunk
|
|
41
38
|
*/
|
|
42
|
-
_id:
|
|
39
|
+
_id: ObjectId;
|
|
43
40
|
|
|
44
41
|
/**
|
|
45
42
|
* Chunk size in bytes
|
|
@@ -53,7 +50,6 @@ export interface SourceMapFileChunk {
|
|
|
53
50
|
|
|
54
51
|
/**
|
|
55
52
|
* Uploading date stored as a BSON datetime value 'Timestamp'.
|
|
56
|
-
*
|
|
57
53
|
* @example 2020-02-18T14:51:40.400Z
|
|
58
54
|
*/
|
|
59
55
|
uploadDate: Timestamp;
|
|
@@ -82,4 +78,4 @@ export interface SourcemapCollectedData {
|
|
|
82
78
|
* Source map body
|
|
83
79
|
*/
|
|
84
80
|
payload: string;
|
|
85
|
-
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSO configuration types for database schema
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SAML attribute mapping configuration
|
|
7
|
+
*/
|
|
8
|
+
export interface SamlAttributeMapping {
|
|
9
|
+
/**
|
|
10
|
+
* Attribute name for email in SAML Assertion
|
|
11
|
+
* @example "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
|
|
12
|
+
* to get email from XML like this:
|
|
13
|
+
* <Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress">
|
|
14
|
+
* <AttributeValue>alice@company.com</AttributeValue>
|
|
15
|
+
* </Attribute>
|
|
16
|
+
*/
|
|
17
|
+
email: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Attribute name for user name in SAML Assertion
|
|
21
|
+
*/
|
|
22
|
+
name?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* SAML SSO configuration
|
|
27
|
+
*/
|
|
28
|
+
export interface SamlConfig {
|
|
29
|
+
/**
|
|
30
|
+
* IdP Entity ID.
|
|
31
|
+
* Used to validate "this response is intended for Hawk"
|
|
32
|
+
* @example "urn:hawk:tracker:saml"
|
|
33
|
+
*/
|
|
34
|
+
idpEntityId: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* SSO URL for redirecting user to IdP
|
|
38
|
+
* Used to redirect user to IdP for authentication
|
|
39
|
+
* @example "https://idp.example.com/sso"
|
|
40
|
+
*/
|
|
41
|
+
ssoUrl: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* X.509 certificate for signature verification
|
|
45
|
+
* @example "-----BEGIN CERTIFICATE-----\nMIIDYjCCAkqgAwIBAgI...END CERTIFICATE-----"
|
|
46
|
+
*/
|
|
47
|
+
x509Cert: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Desired NameID format
|
|
51
|
+
* @example "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
|
|
52
|
+
*/
|
|
53
|
+
nameIdFormat?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Attribute mapping configuration
|
|
57
|
+
* Used to extract user attributes from SAML Response
|
|
58
|
+
*/
|
|
59
|
+
attributeMapping: SamlAttributeMapping;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* SSO configuration for workspace
|
|
64
|
+
*/
|
|
65
|
+
export interface WorkspaceSsoConfig {
|
|
66
|
+
/**
|
|
67
|
+
* Is SSO enabled
|
|
68
|
+
*/
|
|
69
|
+
enabled: boolean;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Is SSO enforced (only SSO login allowed)
|
|
73
|
+
* If true, login via email/password is not allowed
|
|
74
|
+
*/
|
|
75
|
+
enforced: boolean;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* SSO provider type
|
|
79
|
+
* Currently only SAML is supported. In future we can add other providers (OAuth 2, etc.)
|
|
80
|
+
*/
|
|
81
|
+
type: 'saml';
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* SAML-specific configuration.
|
|
85
|
+
* Got from IdP metadata.
|
|
86
|
+
*/
|
|
87
|
+
saml: SamlConfig;
|
|
88
|
+
}
|
package/src/dbScheme/user.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ObjectId } from '
|
|
2
|
-
import { UserNotificationsDBScheme } from '../../index';
|
|
3
|
-
import { BankCard } from './bankCard';
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
|
+
import type { UserNotificationsDBScheme } from '../../index.ts';
|
|
3
|
+
import type { BankCard } from './bankCard.ts';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Interface representing how user is stored in DB
|
|
@@ -81,4 +81,26 @@ export interface UserDBScheme {
|
|
|
81
81
|
*/
|
|
82
82
|
term?: string;
|
|
83
83
|
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* External identities for SSO (keyed by workspaceId)
|
|
87
|
+
*/
|
|
88
|
+
identities?: {
|
|
89
|
+
[workspaceId: string]: {
|
|
90
|
+
/**
|
|
91
|
+
* SAML-mode params
|
|
92
|
+
*/
|
|
93
|
+
saml: {
|
|
94
|
+
/**
|
|
95
|
+
* NameID value from IdP (stable identifier)
|
|
96
|
+
*/
|
|
97
|
+
id: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Email at the time of linking (for audit)
|
|
101
|
+
*/
|
|
102
|
+
email: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
84
106
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { NotificationsChannelsDBScheme, UserNotificationType } from
|
|
1
|
+
import type { NotificationsChannelsDBScheme, UserNotificationType } from '../../index.ts';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* This structure represents how user notifications are stored at the DB (in 'users' collection)
|
|
5
5
|
*/
|
|
6
6
|
export interface UserNotificationsDBScheme {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Channels with their settings
|
|
9
|
+
*/
|
|
10
|
+
channels: NotificationsChannelsDBScheme;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Types of notifications to receive
|
|
14
|
+
*/
|
|
15
|
+
whatToReceive: { [key in UserNotificationType]: boolean };
|
|
16
16
|
}
|
|
@@ -1,84 +1,90 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
|
+
import type { WorkspaceSsoConfig } from './sso.ts';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Workspace representation in DataBase
|
|
5
6
|
*/
|
|
6
7
|
export interface WorkspaceDBScheme {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Workspace's id
|
|
10
|
+
*/
|
|
11
|
+
_id: ObjectId;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Workspace's name
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Workspace's invite hash
|
|
20
|
+
*/
|
|
21
|
+
inviteHash: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Workspace account uuid in accounting microservice
|
|
25
|
+
*/
|
|
26
|
+
accountId: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Workspace's description
|
|
30
|
+
*/
|
|
31
|
+
description?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Workspace's image URL
|
|
35
|
+
*/
|
|
36
|
+
image?: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Id of the Workspace's plan
|
|
40
|
+
*/
|
|
41
|
+
tariffPlanId: ObjectId;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Workspace balance
|
|
45
|
+
*/
|
|
46
|
+
balance: number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Date when workspace was charged last time
|
|
50
|
+
*/
|
|
51
|
+
lastChargeDate: Date;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Date when subscription will be expired
|
|
55
|
+
* Used for pre-paid plans for several months
|
|
56
|
+
*/
|
|
57
|
+
paidUntil?: Date;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Total number of errors since the last charge date
|
|
61
|
+
*/
|
|
62
|
+
billingPeriodEventsCount: number;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* ID of subscription if it subscribed
|
|
66
|
+
* Returns from CloudPayments
|
|
67
|
+
*/
|
|
68
|
+
subscriptionId?: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Is workspace blocked for catching new events
|
|
72
|
+
*/
|
|
73
|
+
isBlocked?: boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Date when workspace was blocked
|
|
77
|
+
*/
|
|
78
|
+
blockedDate?: Date;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* List of last dates for notifications
|
|
82
|
+
* Used to reduce frequency of some system messages
|
|
83
|
+
*/
|
|
84
|
+
lastNotificationDate?: { [key: string]: Date };
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* SSO configuration (optional, only for workspaces with SSO enabled)
|
|
88
|
+
*/
|
|
89
|
+
sso?: WorkspaceSsoConfig;
|
|
84
90
|
}
|