@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.
Files changed (78) hide show
  1. package/.github/workflows/bump-version.yml +4 -4
  2. package/.github/workflows/lint-and-build.yml +4 -4
  3. package/.github/workflows/npm-publish.yml +4 -4
  4. package/.nvmrc +1 -0
  5. package/build/index.d.ts +1 -0
  6. package/build/index.js +6 -1
  7. package/build/src/base/businessOperation/businessOperation.d.ts +4 -4
  8. package/build/src/base/businessOperation/businessOperation.js +4 -4
  9. package/build/src/base/event/addons/default.d.ts +1 -1
  10. package/build/src/base/event/addons/index.d.ts +9 -9
  11. package/build/src/base/event/addons/javascript.d.ts +2 -2
  12. package/build/src/base/event/addons/php.d.ts +1 -1
  13. package/build/src/base/event/addons/sentry.js +1 -0
  14. package/build/src/base/event/backtraceFrame.d.ts +1 -1
  15. package/build/src/base/event/breadcrumb.d.ts +3 -6
  16. package/build/src/base/event/event.d.ts +5 -10
  17. package/build/src/base/integrations/integrationToken.d.ts +1 -1
  18. package/build/src/catchers/catcher-message.d.ts +30 -9
  19. package/build/src/dbScheme/businessOperation.d.ts +2 -2
  20. package/build/src/dbScheme/groupedEvent.d.ts +12 -6
  21. package/build/src/dbScheme/membership.d.ts +2 -2
  22. package/build/src/dbScheme/notificationsChannels.d.ts +1 -1
  23. package/build/src/dbScheme/plan.d.ts +1 -1
  24. package/build/src/dbScheme/project.d.ts +3 -4
  25. package/build/src/dbScheme/projectEventGroupingPattern.d.ts +5 -1
  26. package/build/src/dbScheme/projectNotificationsRule.d.ts +3 -3
  27. package/build/src/dbScheme/release.d.ts +2 -7
  28. package/build/src/dbScheme/repetition.d.ts +13 -4
  29. package/build/src/dbScheme/sourceMap.d.ts +3 -7
  30. package/build/src/dbScheme/sso.d.ts +77 -0
  31. package/build/src/dbScheme/sso.js +5 -0
  32. package/build/src/dbScheme/user.d.ts +23 -3
  33. package/build/src/dbScheme/userNotifications.d.ts +1 -1
  34. package/build/src/dbScheme/workspace.d.ts +6 -1
  35. package/build/src/notifications/createProjectNotifications.d.ts +2 -2
  36. package/build/src/notifications/receiveTypes.js +1 -1
  37. package/build/src/notifications/updateProjectNotifications.d.ts +2 -2
  38. package/build/src/notifications/userNotification.js +1 -1
  39. package/build/src/utils/index.d.ts +2 -2
  40. package/eslint.config.mjs +34 -0
  41. package/index.ts +1 -0
  42. package/package.json +11 -6
  43. package/src/auth/tokensPair.ts +9 -9
  44. package/src/base/businessOperation/businessOperation.ts +8 -8
  45. package/src/base/event/addons/default.ts +1 -1
  46. package/src/base/event/addons/index.ts +11 -12
  47. package/src/base/event/addons/javascript.ts +2 -2
  48. package/src/base/event/addons/php.ts +1 -1
  49. package/src/base/event/addons/sentry.ts +3 -1
  50. package/src/base/event/affectedUser.ts +16 -16
  51. package/src/base/event/backtraceFrame.ts +25 -25
  52. package/src/base/event/breadcrumb.ts +5 -9
  53. package/src/base/event/event.ts +53 -59
  54. package/src/base/event/sourceCodeLine.ts +8 -8
  55. package/src/base/performance/performance.ts +1 -1
  56. package/src/catchers/catcher-message.ts +29 -8
  57. package/src/dbScheme/businessOperation.ts +26 -26
  58. package/src/dbScheme/groupedEvent.ts +52 -46
  59. package/src/dbScheme/membership.ts +24 -27
  60. package/src/dbScheme/notificationsChannelSettings.ts +12 -12
  61. package/src/dbScheme/notificationsChannels.ts +25 -25
  62. package/src/dbScheme/plan.ts +30 -30
  63. package/src/dbScheme/project.ts +3 -4
  64. package/src/dbScheme/projectEventGroupingPattern.ts +8 -4
  65. package/src/dbScheme/projectNotificationsRule.ts +52 -52
  66. package/src/dbScheme/release.ts +3 -8
  67. package/src/dbScheme/repetition.ts +39 -30
  68. package/src/dbScheme/sourceMap.ts +4 -8
  69. package/src/dbScheme/sso.ts +88 -0
  70. package/src/dbScheme/user.ts +25 -3
  71. package/src/dbScheme/userNotifications.ts +9 -9
  72. package/src/dbScheme/workspace.ts +84 -78
  73. package/src/notifications/createProjectNotifications.ts +27 -27
  74. package/src/notifications/receiveTypes.ts +8 -8
  75. package/src/notifications/updateProjectNotifications.ts +26 -26
  76. package/src/notifications/userNotification.ts +12 -12
  77. package/src/utils/index.ts +1 -1
  78. package/.eslintrc +0 -12
@@ -8,7 +8,7 @@ jobs:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
10
  # Checkout to target branch
11
- - uses: actions/checkout@v2
11
+ - uses: actions/checkout@v4
12
12
  with:
13
13
  fetch-depth: 0
14
14
 
@@ -36,12 +36,12 @@ jobs:
36
36
  runs-on: ubuntu-latest
37
37
  steps:
38
38
  # Checkout to target branch
39
- - uses: actions/checkout@v2
39
+ - uses: actions/checkout@v4
40
40
 
41
41
  # Setup node environment
42
- - uses: actions/setup-node@v1
42
+ - uses: actions/setup-node@v4
43
43
  with:
44
- node-version: 15
44
+ node-version-file: '.nvmrc'
45
45
  registry-url: https://registry.npmjs.org/
46
46
 
47
47
  # Bump version to the next prerelease (patch) with rc suffix
@@ -7,11 +7,11 @@ jobs:
7
7
  name: Lint and Build
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
- - uses: actions/checkout@v2
11
- - name: Use Node.js 15
12
- uses: actions/setup-node@v1
10
+ - uses: actions/checkout@v4
11
+ - name: Setup Node.js
12
+ uses: actions/setup-node@v4
13
13
  with:
14
- node-version: 15
14
+ node-version-file: '.nvmrc'
15
15
 
16
16
  - run: yarn
17
17
  - run: yarn lint
@@ -9,10 +9,10 @@ jobs:
9
9
  publish:
10
10
  runs-on: ubuntu-latest
11
11
  steps:
12
- - uses: actions/checkout@v2
13
- - uses: actions/setup-node@v1
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-node@v4
14
14
  with:
15
- node-version: 12
15
+ node-version-file: '.nvmrc'
16
16
  registry-url: https://registry.npmjs.org/
17
17
  - run: yarn
18
18
  - run: yarn lint
@@ -24,7 +24,7 @@ jobs:
24
24
  needs: publish
25
25
  runs-on: ubuntu-latest
26
26
  steps:
27
- - uses: actions/checkout@v2
27
+ - uses: actions/checkout@v4
28
28
  - name: Get package info
29
29
  id: package
30
30
  uses: codex-team/action-nodejs-package-info@v1
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v24.11.1
package/build/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export * from "./src/dbScheme/user";
23
23
  export * from "./src/dbScheme/userNotifications";
24
24
  export * from "./src/dbScheme/workspace";
25
25
  export * from "./src/dbScheme/bankCard";
26
+ export * from "./src/dbScheme/sso";
26
27
  export * from "./src/dbScheme/projectEventGroupingPattern";
27
28
  export * from "./src/notifications/createProjectNotifications";
28
29
  export * from "./src/notifications/receiveTypes";
package/build/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -35,6 +39,7 @@ __exportStar(require("./src/dbScheme/user"), exports);
35
39
  __exportStar(require("./src/dbScheme/userNotifications"), exports);
36
40
  __exportStar(require("./src/dbScheme/workspace"), exports);
37
41
  __exportStar(require("./src/dbScheme/bankCard"), exports);
42
+ __exportStar(require("./src/dbScheme/sso"), exports);
38
43
  __exportStar(require("./src/dbScheme/projectEventGroupingPattern"), exports);
39
44
  __exportStar(require("./src/notifications/createProjectNotifications"), exports);
40
45
  __exportStar(require("./src/notifications/receiveTypes"), exports);
@@ -1,4 +1,4 @@
1
- import { ObjectId } from 'mongodb';
1
+ import type { ObjectId } from 'bson';
2
2
  /**
3
3
  * Business operations statuses
4
4
  */
@@ -29,8 +29,8 @@ export declare enum BusinessOperationType {
29
29
  */
30
30
  DepositByUser = "DEPOSIT_BY_USER",
31
31
  /**
32
- * Charge minimal amount of money to link a card for further recurrent payments
33
- */
32
+ * Charge minimal amount of money to link a card for further recurrent payments
33
+ */
34
34
  CardLinkCharge = "CARD_LINK_CHARGE",
35
35
  /**
36
36
  * Refund the money that were charged to link a card
@@ -90,4 +90,4 @@ export interface PayloadOfWorkspacePlanPurchase {
90
90
  /**
91
91
  * Type of business operation payload, it depends of type field
92
92
  */
93
- export declare type BusinessOperationPayloadType = PayloadOfDepositByUser | PayloadOfWorkspacePlanPurchase;
93
+ export type BusinessOperationPayloadType = PayloadOfDepositByUser | PayloadOfWorkspacePlanPurchase;
@@ -18,7 +18,7 @@ var BusinessOperationStatus;
18
18
  * Business operation is rejected
19
19
  */
20
20
  BusinessOperationStatus["Rejected"] = "REJECTED";
21
- })(BusinessOperationStatus = exports.BusinessOperationStatus || (exports.BusinessOperationStatus = {}));
21
+ })(BusinessOperationStatus || (exports.BusinessOperationStatus = BusinessOperationStatus = {}));
22
22
  /**
23
23
  * Types of business operations
24
24
  */
@@ -33,11 +33,11 @@ var BusinessOperationType;
33
33
  */
34
34
  BusinessOperationType["DepositByUser"] = "DEPOSIT_BY_USER";
35
35
  /**
36
- * Charge minimal amount of money to link a card for further recurrent payments
37
- */
36
+ * Charge minimal amount of money to link a card for further recurrent payments
37
+ */
38
38
  BusinessOperationType["CardLinkCharge"] = "CARD_LINK_CHARGE";
39
39
  /**
40
40
  * Refund the money that were charged to link a card
41
41
  */
42
42
  BusinessOperationType["CardLinkRefund"] = "CARD_LINK_REFUND";
43
- })(BusinessOperationType = exports.BusinessOperationType || (exports.BusinessOperationType = {}));
43
+ })(BusinessOperationType || (exports.BusinessOperationType = BusinessOperationType = {}));
@@ -1,4 +1,4 @@
1
- import { SentryAddons } from "./sentry";
1
+ import type { SentryAddons } from './sentry.ts';
2
2
  /**
3
3
  * This interface represents data that can be additionally collected by Default Catcher
4
4
  */
@@ -1,12 +1,12 @@
1
- import { JavaScriptAddons, WindowData, VueIntegrationAddons, BeautifiedUserAgent, ConsoleLogEvent } from './javascript';
2
- import { PhpAddons } from './php';
3
- import { NodeJSAddons } from './nodejs';
4
- import { GoAddons } from './go';
5
- import { PythonAddons } from './python';
6
- import { DefaultAddons } from './default';
7
- import { SentryAddons } from './sentry';
1
+ import type { JavaScriptAddons, WindowData, VueIntegrationAddons, BeautifiedUserAgent, ConsoleLogEvent } from './javascript.ts';
2
+ import type { PhpAddons } from './php.ts';
3
+ import type { NodeJSAddons } from './nodejs.ts';
4
+ import type { GoAddons } from './go.ts';
5
+ import type { PythonAddons } from './python.ts';
6
+ import type { DefaultAddons } from './default.ts';
7
+ import type { SentryAddons } from './sentry.ts';
8
8
  /**
9
9
  * Union Type describing all catcher-specific additional data
10
10
  */
11
- declare type EventAddons = DefaultAddons | JavaScriptAddons | PhpAddons | NodeJSAddons | GoAddons | PythonAddons | DefaultAddons | SentryAddons;
12
- export { WindowData, VueIntegrationAddons, BeautifiedUserAgent, ConsoleLogEvent, EventAddons, DefaultAddons, JavaScriptAddons, PhpAddons, NodeJSAddons, GoAddons, PythonAddons, SentryAddons, };
11
+ type EventAddons = DefaultAddons | JavaScriptAddons | PhpAddons | NodeJSAddons | GoAddons | PythonAddons | SentryAddons;
12
+ export type { WindowData, VueIntegrationAddons, BeautifiedUserAgent, ConsoleLogEvent, EventAddons, DefaultAddons, JavaScriptAddons, PhpAddons, NodeJSAddons, GoAddons, PythonAddons, SentryAddons };
@@ -1,5 +1,5 @@
1
- import { Json } from '../../../utils';
2
- import { SentryAddons } from './sentry';
1
+ import type { Json } from '../../../utils/index.ts';
2
+ import type { SentryAddons } from './sentry.ts';
3
3
  /**
4
4
  * Parsed user agent
5
5
  */
@@ -1,4 +1,4 @@
1
- import { Json } from '../../../utils';
1
+ import type { Json } from '../../../utils/index.ts';
2
2
  /**
3
3
  * This interface represents data that can be additionally collected by PHP Catcher
4
4
  */
@@ -1,2 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* eslint-enable jsdoc/require-jsdoc */
@@ -1,4 +1,4 @@
1
- import { SourceCodeLine } from "./sourceCodeLine";
1
+ import type { SourceCodeLine } from './sourceCodeLine.ts';
2
2
  /**
3
3
  * Single item of backtrace
4
4
  */
@@ -1,13 +1,13 @@
1
- import { Json } from '../../utils';
1
+ import type { Json } from '../../utils/index.ts';
2
2
  /**
3
3
  * Breadcrumb severity level
4
4
  */
5
- export declare type BreadcrumbLevel = 'fatal' | 'error' | 'warning' | 'info' | 'debug';
5
+ export type BreadcrumbLevel = 'fatal' | 'error' | 'warning' | 'info' | 'debug';
6
6
  /**
7
7
  * Breadcrumb type - controls categorization and UI appearance
8
8
  * Common types suitable for both client and backend
9
9
  */
10
- export declare type BreadcrumbType = 'default' | 'request' | 'ui' | 'navigation' | 'logic' | 'error';
10
+ export type BreadcrumbType = 'default' | 'request' | 'ui' | 'navigation' | 'logic' | 'error';
11
11
  /**
12
12
  * Single breadcrumb entry - represents an event that occurred before the error
13
13
  */
@@ -17,7 +17,6 @@ export interface Breadcrumb {
17
17
  * Unix timestamp in milliseconds since epoch (e.g., 1701867896789)
18
18
  *
19
19
  * Note: This field uses milliseconds format
20
- *
21
20
  * @example 1701867896789
22
21
  */
23
22
  timestamp: number;
@@ -33,7 +32,6 @@ export interface Breadcrumb {
33
32
  * - For type='request': "fetch", "xhr", "db.query", "db.insert"
34
33
  * - For type='logic': "gql.resolver", "service.method", "middleware.auth"
35
34
  * - For type='navigation': "history.push", "history.replace", "route.change"
36
- *
37
35
  * @example "ui.click"
38
36
  * @example "fetch"
39
37
  * @example "gql.resolver"
@@ -41,7 +39,6 @@ export interface Breadcrumb {
41
39
  category?: string;
42
40
  /**
43
41
  * Human-readable message describing the event
44
- *
45
42
  * @example "GET /api/profile 200"
46
43
  * @example "Click on button#submit"
47
44
  * @example "Navigated to /dashboard"
@@ -1,8 +1,7 @@
1
- import { BacktraceFrame } from './backtraceFrame';
2
- import { AffectedUser } from './affectedUser';
3
- import { EventAddons } from './addons';
4
- import { Breadcrumb } from './breadcrumb';
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
  * Information about event (Payload of the event)
8
7
  * That object will be sent as 'payload' from the Collector to the workers
@@ -29,10 +28,6 @@ export interface EventData<Addons extends EventAddons> {
29
28
  * Current release (aka version, revision) of an application
30
29
  */
31
30
  release?: string;
32
- /**
33
- * Breadcrumbs - chronological trail of events before the error
34
- */
35
- breadcrumbs?: Breadcrumb[];
36
31
  /**
37
32
  * Current authenticated user
38
33
  */
@@ -75,4 +70,4 @@ export interface EncodedEventData extends EventData<EventAddons> {
75
70
  /**
76
71
  * Context is any additional data sent by developer
77
72
  */
78
- export declare type EventContext = Json;
73
+ export type EventContext = Json;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Encoded integration token format
3
3
  */
4
- export declare type EncodedIntegrationToken = string;
4
+ export type EncodedIntegrationToken = string;
5
5
  /**
6
6
  * Fields in decoded integration token
7
7
  */
@@ -1,29 +1,50 @@
1
- import { DecodedEventData, EventData } from '../base/event/event';
2
- import { PerformanceData } from '../base/performance/performance';
3
- import type { JavaScriptAddons, PhpAddons, NodeJSAddons, GoAddons, PythonAddons, DefaultAddons } from '../base/event/addons';
1
+ import type { DecodedEventData, EventData } from '../base/event/event.ts';
2
+ import type { PerformanceData } from '../base/performance/performance.ts';
3
+ import type { JavaScriptAddons, PhpAddons, NodeJSAddons, GoAddons, PythonAddons, DefaultAddons } from '../base/event/addons/index.ts';
4
4
  /**
5
5
  * Type that represents all supported Catcher message types for events
6
6
  */
7
- export declare type ErrorsCatcherType = 'errors/javascript' | 'errors/php' | 'errors/nodejs' | 'errors/go' | 'errors/python' | 'errors/default';
7
+ export type ErrorsCatcherType = 'errors/javascript' | 'errors/php' | 'errors/nodejs' | 'errors/go' | 'errors/python' | 'errors/default';
8
8
  /**
9
9
  * Type that represents all supported Catcher message types for performance
10
10
  */
11
- export declare type MetricsCatcherType = 'performance';
11
+ export type MetricsCatcherType = 'performance';
12
12
  /**
13
13
  * Union type that represents all supported Catcher message types
14
14
  */
15
- export declare type CatcherMessageType = ErrorsCatcherType | MetricsCatcherType;
15
+ export type CatcherMessageType = ErrorsCatcherType | MetricsCatcherType;
16
16
  /**
17
17
  * Type that represents the payload of a Catcher message based on its type
18
18
  */
19
- export declare type CatcherMessagePayload<Type extends CatcherMessageType> = {
19
+ export type CatcherMessagePayload<Type extends CatcherMessageType> = {
20
+ /**
21
+ * Addons that can be added to all errors except those which have a separate workers
22
+ */
20
23
  'errors/default': DecodedEventData<DefaultAddons>;
24
+ /**
25
+ * Added by JavaScript SDK
26
+ */
21
27
  'errors/javascript': DecodedEventData<JavaScriptAddons>;
28
+ /**
29
+ * Added by PHP SDK
30
+ */
22
31
  'errors/php': EventData<PhpAddons>;
32
+ /**
33
+ * Added by Node.js SDK
34
+ */
23
35
  'errors/nodejs': EventData<NodeJSAddons>;
36
+ /**
37
+ * Added by Go SDK
38
+ */
24
39
  'errors/go': EventData<GoAddons>;
40
+ /**
41
+ * Added by Python SDK
42
+ */
25
43
  'errors/python': EventData<PythonAddons>;
26
- 'performance': PerformanceData;
44
+ /**
45
+ * Performance monitoring data
46
+ */
47
+ performance: PerformanceData;
27
48
  }[Type];
28
49
  /**
29
50
  * Interface that represents a message sent by a Catcher
@@ -47,7 +68,7 @@ export interface CatcherMessage<Type extends CatcherMessageType> {
47
68
  * Type that represents a Catcher message accepted by the collector
48
69
  * It omits the token field and adds projectId and timestamp
49
70
  */
50
- export declare type CatcherMessageAccepted<Type extends CatcherMessageType> = Omit<CatcherMessage<Type>, 'token'> & {
71
+ export type CatcherMessageAccepted<Type extends CatcherMessageType> = Omit<CatcherMessage<Type>, 'token'> & {
51
72
  /**
52
73
  * Id of the project that sent the message
53
74
  */
@@ -1,5 +1,5 @@
1
- import { ObjectId } from "mongodb";
2
- import { BusinessOperationStatus, BusinessOperationType, BusinessOperationPayloadType } from "../base/businessOperation/businessOperation";
1
+ import type { ObjectId } from 'bson';
2
+ import type { BusinessOperationStatus, BusinessOperationType, BusinessOperationPayloadType } from '../base/businessOperation/businessOperation.ts';
3
3
  /**
4
4
  * Structure represents a Business operation in DataBase
5
5
  */
@@ -1,7 +1,7 @@
1
- import { ObjectId } from "mongodb";
2
- import { DecodedEventData, EncodedEventData, EventData } from "../base/event/event";
3
- import { UserDBScheme } from "./user";
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
  * Event marks interface for tracking event status
7
7
  */
@@ -55,14 +55,20 @@ export interface GroupedEventDBScheme {
55
55
  marks?: EventMarks;
56
56
  }
57
57
  /**
58
- * Grouped event with decoded event data
58
+ * Event where 'context' and 'addons' are decoded from json strings to objects
59
59
  */
60
60
  export interface DecodedGroupedEvent extends GroupedEventDBScheme {
61
+ /**
62
+ * Event data where 'context' and 'addons' are objects
63
+ */
61
64
  payload: DecodedEventData<EventAddons>;
62
65
  }
63
66
  /**
64
- * Grouped event with encoded event data
67
+ * In database we store 'context' and 'addons' as json strings to avoind mongo keys conflict
65
68
  */
66
69
  export interface EncodedGroupedEvent extends GroupedEventDBScheme {
70
+ /**
71
+ * Event data where 'context' and 'addons' are json strings
72
+ */
67
73
  payload: EncodedEventData;
68
74
  }
@@ -1,4 +1,4 @@
1
- import { ObjectId } from "mongodb";
1
+ import type { ObjectId } from 'bson';
2
2
  /**
3
3
  * Represents confirmed member info in DB
4
4
  */
@@ -32,4 +32,4 @@ export interface PendingMemberDBScheme {
32
32
  /**
33
33
  * Represents full structure of team collection documents
34
34
  */
35
- export declare type MemberDBScheme = ConfirmedMemberDBScheme | PendingMemberDBScheme;
35
+ export type MemberDBScheme = ConfirmedMemberDBScheme | PendingMemberDBScheme;
@@ -1,4 +1,4 @@
1
- import { NotificationsChannelSettingsDBScheme } from "../../index";
1
+ import type { NotificationsChannelSettingsDBScheme } from '../../index.ts';
2
2
  /**
3
3
  * Available channels
4
4
  */
@@ -1,4 +1,4 @@
1
- import { ObjectId } from "mongodb";
1
+ import type { ObjectId } from 'bson';
2
2
  /**
3
3
  * Plan representation in DataBase
4
4
  */
@@ -1,6 +1,6 @@
1
- import { ObjectId } from 'mongodb';
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
  * Structure represents a Project in DataBase
6
6
  */
@@ -11,7 +11,6 @@ export interface ProjectDBScheme {
11
11
  _id: ObjectId;
12
12
  /**
13
13
  * Unique integration id, that's used as collector domain url for sending events
14
- *
15
14
  * @example `wss://${integrationId}.k1.hawk.so/ws`
16
15
  */
17
16
  integrationId: string;
@@ -1,4 +1,8 @@
1
- import { ObjectId } from "mongodb";
1
+ import type { ObjectId } from 'bson';
2
+ /**
3
+ * Project admin can specify regular expression patterns to group events into categories.
4
+ * We store them in the database to be able to use them in the UI.
5
+ */
2
6
  export interface ProjectEventGroupingPatternsDBScheme {
3
7
  /**
4
8
  * If of the pattern
@@ -1,6 +1,6 @@
1
- import { ObjectId } from "mongodb";
2
- import { ReceiveTypes } from "../../index";
3
- import { NotificationsChannelsDBScheme } from "./notificationsChannels";
1
+ import type { ObjectId } from 'bson';
2
+ import type { ReceiveTypes } from '../../index.ts';
3
+ import type { NotificationsChannelsDBScheme } from './notificationsChannels.ts';
4
4
  /**
5
5
  * This structure represents a single rule of notifications settings
6
6
  */
@@ -1,30 +1,26 @@
1
- import { ObjectId } from "mongodb";
2
- import { SourceMapDataExtended } from './sourceMap';
1
+ import type { ObjectId } from 'bson';
2
+ import type { SourceMapDataExtended } from './sourceMap.ts';
3
3
  /**
4
4
  * Git commit data stored in the release
5
5
  */
6
6
  export interface CommitData {
7
7
  /**
8
8
  * Commit hash
9
- *
10
9
  * @example 599575d00e62924d08b031defe0a6b10133a75fc
11
10
  */
12
11
  hash: string;
13
12
  /**
14
13
  * Title of the commit
15
- *
16
14
  * @example Hot fix
17
15
  */
18
16
  title: string;
19
17
  /**
20
18
  * Commit author
21
- *
22
19
  * @example codex-team@codex.so
23
20
  */
24
21
  author: string;
25
22
  /**
26
23
  * Commit date
27
- *
28
24
  * @example 2021-04-23T10:54:01.000+00:00
29
25
  */
30
26
  date: Date;
@@ -43,7 +39,6 @@ export interface ReleaseDBScheme {
43
39
  projectId: string;
44
40
  /**
45
41
  * Release name
46
- *
47
42
  * @example Version 1.0
48
43
  */
49
44
  release: string;
@@ -1,6 +1,9 @@
1
- import { ObjectId } from "mongodb";
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
+ /**
5
+ * Repetition - is a record about event that was already processed. It stores only difference between original event and repetition.
6
+ */
4
7
  export interface RepetitionDBScheme {
5
8
  /**
6
9
  * Internal mongo id
@@ -11,7 +14,7 @@ export interface RepetitionDBScheme {
11
14
  */
12
15
  groupHash: string;
13
16
  /**
14
- * @deprecated, use delta instead
17
+ * @deprecated use delta instead
15
18
  * And any of EventData field with diff
16
19
  * except fields that used in groupHash
17
20
  */
@@ -31,11 +34,17 @@ export interface RepetitionDBScheme {
31
34
  * Repetition with decoded event data
32
35
  */
33
36
  export interface DecodedRepetition {
37
+ /**
38
+ * Event data where 'context' and 'addons' are objects
39
+ */
34
40
  payload: DecodedEventData<EventAddons>;
35
41
  }
36
42
  /**
37
43
  * Repetition with decoded event data
38
44
  */
39
45
  export interface EncodedRepetition {
46
+ /**
47
+ * Event data where 'context' and 'addons' are json strings
48
+ */
40
49
  payload: EncodedEventData;
41
50
  }
@@ -1,17 +1,15 @@
1
- import { ObjectID, Timestamp } from 'mongodb';
1
+ import type { ObjectId, Timestamp } from 'bson';
2
2
  /**
3
3
  * Source map with parsed file names, stored in the release
4
4
  */
5
5
  export interface SourceMapDataExtended {
6
6
  /**
7
7
  * Name of source-map file
8
- *
9
8
  * @example main.min.js.map
10
9
  */
11
10
  mapFileName: string;
12
11
  /**
13
12
  * Bundle or chunk name
14
- *
15
13
  * @example main.min.js
16
14
  */
17
15
  originFileName: string;
@@ -23,18 +21,17 @@ export interface SourceMapDataExtended {
23
21
  /**
24
22
  * When file will be saved to GridFS, there will be its id instead of 'content'
25
23
  */
26
- _id?: ObjectID;
24
+ _id?: ObjectId;
27
25
  }
28
26
  /**
29
27
  * Object represents a file structure stored in Mongo GridFS
30
- *
31
28
  * @see https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst#definitions
32
29
  */
33
30
  export interface SourceMapFileChunk {
34
31
  /**
35
32
  * Unique id of a file chunk
36
33
  */
37
- _id: ObjectID;
34
+ _id: ObjectId;
38
35
  /**
39
36
  * Chunk size in bytes
40
37
  */
@@ -45,7 +42,6 @@ export interface SourceMapFileChunk {
45
42
  chunkSize: number;
46
43
  /**
47
44
  * Uploading date stored as a BSON datetime value 'Timestamp'.
48
- *
49
45
  * @example 2020-02-18T14:51:40.400Z
50
46
  */
51
47
  uploadDate: Timestamp;