@hawk.so/types 0.2.0 → 0.3.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.js +5 -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/user.d.ts +3 -3
- package/build/src/dbScheme/userNotifications.d.ts +1 -1
- package/build/src/dbScheme/workspace.d.ts +1 -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/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/user.ts +3 -3
- package/src/dbScheme/userNotifications.ts +9 -9
- package/src/dbScheme/workspace.ts +64 -64
- 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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Represents simple JSON-like document
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type Json = {
|
|
5
5
|
[key: string]: JsonNode;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* Represents possible field values in Dict
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type JsonNode = string | number | boolean | Json;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import codex from 'eslint-config-codex';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
...codex,
|
|
10
|
+
{
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parserOptions: {
|
|
13
|
+
project: path.resolve(__dirname, 'tsconfig.json'),
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
'object-curly-spacing': ['error', 'always'],
|
|
18
|
+
'@typescript-eslint/no-empty-interface': 'off',
|
|
19
|
+
'@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'always' }],
|
|
20
|
+
'@typescript-eslint/naming-convention': [
|
|
21
|
+
'error',
|
|
22
|
+
{
|
|
23
|
+
selector: 'property',
|
|
24
|
+
filter: {
|
|
25
|
+
regex: '^_id$',
|
|
26
|
+
match: true,
|
|
27
|
+
},
|
|
28
|
+
format: null,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
|
package/package.json
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hawk.so/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "TypeScript definitions for Hawk",
|
|
5
5
|
"types": "build/index.d.ts",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"repository": "https://github.com/codex-team/hawk.types.git",
|
|
8
8
|
"license": "AGPL-3.0-only",
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": "24.x",
|
|
11
|
+
"yarn": ">=1.22.0"
|
|
12
|
+
},
|
|
13
|
+
"packageManager": "yarn@1.22.0",
|
|
9
14
|
"scripts": {
|
|
10
|
-
"lint": "eslint src/ --
|
|
15
|
+
"lint": "eslint src/ --fix",
|
|
11
16
|
"build": "tsc"
|
|
12
17
|
},
|
|
13
18
|
"dependencies": {
|
|
14
|
-
"
|
|
19
|
+
"bson": "^7.0.0"
|
|
15
20
|
},
|
|
16
21
|
"devDependencies": {
|
|
17
|
-
"eslint": "^
|
|
18
|
-
"eslint-config-codex": "^
|
|
19
|
-
"typescript": "^
|
|
22
|
+
"eslint": "^9.39.2",
|
|
23
|
+
"eslint-config-codex": "^2.0.3",
|
|
24
|
+
"typescript": "^5.9.3"
|
|
20
25
|
}
|
|
21
26
|
}
|
package/src/auth/tokensPair.ts
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Authorization by access token and refreshing pair by refresh token (after access token was expired).
|
|
4
4
|
*/
|
|
5
5
|
export interface TokensPair {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* User's access token
|
|
8
|
+
*/
|
|
9
|
+
accessToken: string;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
11
|
+
/**
|
|
12
|
+
* User's refresh token for getting new tokens pair
|
|
13
|
+
*/
|
|
14
|
+
refreshToken: string;
|
|
15
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ObjectId } from '
|
|
1
|
+
import type { ObjectId } from 'bson';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Business operations statuses
|
|
@@ -7,17 +7,17 @@ export enum BusinessOperationStatus {
|
|
|
7
7
|
/**
|
|
8
8
|
* Business operation is pending
|
|
9
9
|
*/
|
|
10
|
-
Pending='PENDING',
|
|
10
|
+
Pending = 'PENDING',
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Business operation is confirmed
|
|
14
14
|
*/
|
|
15
|
-
Confirmed='CONFIRMED',
|
|
15
|
+
Confirmed = 'CONFIRMED',
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Business operation is rejected
|
|
19
19
|
*/
|
|
20
|
-
Rejected='REJECTED'
|
|
20
|
+
Rejected = 'REJECTED'
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -34,13 +34,13 @@ export enum BusinessOperationType {
|
|
|
34
34
|
*/
|
|
35
35
|
DepositByUser = 'DEPOSIT_BY_USER',
|
|
36
36
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
* Charge minimal amount of money to link a card for further recurrent payments
|
|
38
|
+
*/
|
|
39
39
|
CardLinkCharge = 'CARD_LINK_CHARGE',
|
|
40
40
|
/**
|
|
41
41
|
* Refund the money that were charged to link a card
|
|
42
42
|
*/
|
|
43
|
-
CardLinkRefund = 'CARD_LINK_REFUND'
|
|
43
|
+
CardLinkRefund = 'CARD_LINK_REFUND'
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
@@ -100,7 +100,7 @@ export interface PayloadOfWorkspacePlanPurchase {
|
|
|
100
100
|
/**
|
|
101
101
|
* Id of the workspace tariff plan
|
|
102
102
|
*/
|
|
103
|
-
tariffPlanId: ObjectId
|
|
103
|
+
tariffPlanId: ObjectId;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
/**
|
|
10
10
|
* Union Type describing all catcher-specific additional data
|
|
@@ -16,11 +16,10 @@ type EventAddons =
|
|
|
16
16
|
| NodeJSAddons
|
|
17
17
|
| GoAddons
|
|
18
18
|
| PythonAddons
|
|
19
|
-
| DefaultAddons
|
|
20
|
-
| SentryAddons;
|
|
21
19
|
|
|
20
|
+
| SentryAddons;
|
|
22
21
|
|
|
23
|
-
export {
|
|
22
|
+
export type {
|
|
24
23
|
WindowData,
|
|
25
24
|
VueIntegrationAddons,
|
|
26
25
|
BeautifiedUserAgent,
|
|
@@ -32,5 +31,5 @@ export {
|
|
|
32
31
|
NodeJSAddons,
|
|
33
32
|
GoAddons,
|
|
34
33
|
PythonAddons,
|
|
35
|
-
SentryAddons
|
|
36
|
-
}
|
|
34
|
+
SentryAddons
|
|
35
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
2
2
|
/**
|
|
3
3
|
* Additional data extracted from the Sentry event payload
|
|
4
4
|
*/
|
|
@@ -17,6 +17,7 @@ export interface SentryAddons {
|
|
|
17
17
|
request?: {
|
|
18
18
|
url?: string;
|
|
19
19
|
method?: string;
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
21
|
data?: any;
|
|
21
22
|
query_string?: string | {
|
|
22
23
|
[key: string]: string;
|
|
@@ -41,3 +42,4 @@ export interface SentryAddons {
|
|
|
41
42
|
};
|
|
42
43
|
extra?: Record<string, unknown>;
|
|
43
44
|
}
|
|
45
|
+
/* eslint-enable jsdoc/require-jsdoc */
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
* Represents affected user object
|
|
3
3
|
*/
|
|
4
4
|
export interface AffectedUser {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Internal user's identifier inside an app
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/**
|
|
11
|
+
* User public name
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* URL for user's details page
|
|
17
|
+
*/
|
|
18
|
+
url?: string;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
/**
|
|
21
|
+
* User's public picture
|
|
22
|
+
*/
|
|
23
|
+
photo?: string;
|
|
24
24
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { SourceCodeLine } from
|
|
1
|
+
import type { SourceCodeLine } from './sourceCodeLine.ts';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Single item of backtrace
|
|
5
5
|
*/
|
|
6
6
|
export interface BacktraceFrame {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* File
|
|
9
|
+
*/
|
|
10
|
+
file: string;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Line number
|
|
14
|
+
*/
|
|
15
|
+
line: number;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Column number
|
|
19
|
+
*/
|
|
20
|
+
column?: number;
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Sibling source code lines: some above and some below
|
|
24
|
+
*/
|
|
25
|
+
sourceCode?: SourceCodeLine[];
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Function name extracted from current stack frame
|
|
29
|
+
*/
|
|
30
|
+
function?: string;
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Function arguments extracted from current stack frame
|
|
34
|
+
*/
|
|
35
|
+
arguments?: string[];
|
|
36
36
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Json } from '../../utils';
|
|
1
|
+
import type { Json } from '../../utils/index.ts';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Breadcrumb severity level
|
|
@@ -11,11 +11,11 @@ export type BreadcrumbLevel = 'fatal' | 'error' | 'warning' | 'info' | 'debug';
|
|
|
11
11
|
*/
|
|
12
12
|
export type BreadcrumbType =
|
|
13
13
|
| 'default'
|
|
14
|
-
| 'request'
|
|
15
|
-
| 'ui'
|
|
14
|
+
| 'request' // fetch, xhr, db calls, etc
|
|
15
|
+
| 'ui' // click, mousemove, scroll, etc
|
|
16
16
|
| 'navigation' // page open, route change, etc
|
|
17
|
-
| 'logic'
|
|
18
|
-
| 'error';
|
|
17
|
+
| 'logic' // gql resolvers, internal methods calls, etc
|
|
18
|
+
| 'error'; // errors, exceptions, etc
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Single breadcrumb entry - represents an event that occurred before the error
|
|
@@ -26,7 +26,6 @@ export interface Breadcrumb {
|
|
|
26
26
|
* Unix timestamp in milliseconds since epoch (e.g., 1701867896789)
|
|
27
27
|
*
|
|
28
28
|
* Note: This field uses milliseconds format
|
|
29
|
-
*
|
|
30
29
|
* @example 1701867896789
|
|
31
30
|
*/
|
|
32
31
|
timestamp: number;
|
|
@@ -44,7 +43,6 @@ export interface Breadcrumb {
|
|
|
44
43
|
* - For type='request': "fetch", "xhr", "db.query", "db.insert"
|
|
45
44
|
* - For type='logic': "gql.resolver", "service.method", "middleware.auth"
|
|
46
45
|
* - For type='navigation': "history.push", "history.replace", "route.change"
|
|
47
|
-
*
|
|
48
46
|
* @example "ui.click"
|
|
49
47
|
* @example "fetch"
|
|
50
48
|
* @example "gql.resolver"
|
|
@@ -53,7 +51,6 @@ export interface Breadcrumb {
|
|
|
53
51
|
|
|
54
52
|
/**
|
|
55
53
|
* Human-readable message describing the event
|
|
56
|
-
*
|
|
57
54
|
* @example "GET /api/profile 200"
|
|
58
55
|
* @example "Click on button#submit"
|
|
59
56
|
* @example "Navigated to /dashboard"
|
|
@@ -71,4 +68,3 @@ export interface Breadcrumb {
|
|
|
71
68
|
*/
|
|
72
69
|
data?: Record<string, Json>;
|
|
73
70
|
}
|
|
74
|
-
|
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
|
/**
|