@hawk.so/types 0.1.36 → 0.1.38
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/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/src/base/event/breadcrumb.d.ts +59 -0
- package/build/src/base/event/breadcrumb.js +2 -0
- package/build/src/base/event/event.d.ts +5 -0
- package/build/src/dbScheme/notificationsChannels.d.ts +4 -0
- package/index.ts +1 -0
- package/package.json +1 -1
- package/src/base/event/breadcrumb.ts +74 -0
- package/src/base/event/event.ts +6 -0
- package/src/dbScheme/notificationsChannels.ts +5 -0
package/build/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./src/base/businessOperation/businessOperation";
|
|
|
3
3
|
export * from "./src/billing/planProlongrationPayload";
|
|
4
4
|
export * from "./src/base/event/affectedUser";
|
|
5
5
|
export * from "./src/base/event/backtraceFrame";
|
|
6
|
+
export * from "./src/base/event/breadcrumb";
|
|
6
7
|
export * from "./src/base/event/event";
|
|
7
8
|
export * from "./src/base/event/sourceCodeLine";
|
|
8
9
|
export * from "./src/base/event/addons";
|
package/build/index.js
CHANGED
|
@@ -15,6 +15,7 @@ __exportStar(require("./src/base/businessOperation/businessOperation"), exports)
|
|
|
15
15
|
__exportStar(require("./src/billing/planProlongrationPayload"), exports);
|
|
16
16
|
__exportStar(require("./src/base/event/affectedUser"), exports);
|
|
17
17
|
__exportStar(require("./src/base/event/backtraceFrame"), exports);
|
|
18
|
+
__exportStar(require("./src/base/event/breadcrumb"), exports);
|
|
18
19
|
__exportStar(require("./src/base/event/event"), exports);
|
|
19
20
|
__exportStar(require("./src/base/event/sourceCodeLine"), exports);
|
|
20
21
|
__exportStar(require("./src/base/event/addons"), exports);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Json } from '../../utils';
|
|
2
|
+
/**
|
|
3
|
+
* Breadcrumb severity level
|
|
4
|
+
*/
|
|
5
|
+
export declare type BreadcrumbLevel = 'fatal' | 'error' | 'warning' | 'info' | 'debug';
|
|
6
|
+
/**
|
|
7
|
+
* Breadcrumb type - controls categorization and UI appearance
|
|
8
|
+
* Common types suitable for both client and backend
|
|
9
|
+
*/
|
|
10
|
+
export declare type BreadcrumbType = 'default' | 'request' | 'ui' | 'navigation' | 'logic' | 'error';
|
|
11
|
+
/**
|
|
12
|
+
* Single breadcrumb entry - represents an event that occurred before the error
|
|
13
|
+
*/
|
|
14
|
+
export interface Breadcrumb {
|
|
15
|
+
/**
|
|
16
|
+
* Timestamp when the breadcrumb occurred
|
|
17
|
+
* Unix timestamp in milliseconds since epoch (e.g., 1701867896789)
|
|
18
|
+
*
|
|
19
|
+
* Note: This field uses milliseconds format
|
|
20
|
+
*
|
|
21
|
+
* @example 1701867896789
|
|
22
|
+
*/
|
|
23
|
+
timestamp: number;
|
|
24
|
+
/**
|
|
25
|
+
* Type of breadcrumb - controls UI categorization
|
|
26
|
+
*/
|
|
27
|
+
type?: BreadcrumbType;
|
|
28
|
+
/**
|
|
29
|
+
* Category of the event - more specific than type, provides detailed classification
|
|
30
|
+
*
|
|
31
|
+
* Examples:
|
|
32
|
+
* - For type='ui': "ui.click", "ui.scroll", "ui.mousemove"
|
|
33
|
+
* - For type='request': "fetch", "xhr", "db.query", "db.insert"
|
|
34
|
+
* - For type='logic': "gql.resolver", "service.method", "middleware.auth"
|
|
35
|
+
* - For type='navigation': "history.push", "history.replace", "route.change"
|
|
36
|
+
*
|
|
37
|
+
* @example "ui.click"
|
|
38
|
+
* @example "fetch"
|
|
39
|
+
* @example "gql.resolver"
|
|
40
|
+
*/
|
|
41
|
+
category?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Human-readable message describing the event
|
|
44
|
+
*
|
|
45
|
+
* @example "GET /api/profile 200"
|
|
46
|
+
* @example "Click on button#submit"
|
|
47
|
+
* @example "Navigated to /dashboard"
|
|
48
|
+
* @example "User logged in"
|
|
49
|
+
*/
|
|
50
|
+
message?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Severity level of the breadcrumb
|
|
53
|
+
*/
|
|
54
|
+
level?: BreadcrumbLevel;
|
|
55
|
+
/**
|
|
56
|
+
* Arbitrary key-value data associated with the breadcrumb
|
|
57
|
+
*/
|
|
58
|
+
data?: Record<string, Json>;
|
|
59
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BacktraceFrame } from './backtraceFrame';
|
|
2
2
|
import { AffectedUser } from './affectedUser';
|
|
3
3
|
import { EventAddons } from './addons';
|
|
4
|
+
import { Breadcrumb } from './breadcrumb';
|
|
4
5
|
import { Json } from '../../utils';
|
|
5
6
|
/**
|
|
6
7
|
* Information about event (Payload of the event)
|
|
@@ -28,6 +29,10 @@ export interface EventData<Addons extends EventAddons> {
|
|
|
28
29
|
* Current release (aka version, revision) of an application
|
|
29
30
|
*/
|
|
30
31
|
release?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Breadcrumbs - chronological trail of events before the error
|
|
34
|
+
*/
|
|
35
|
+
breadcrumbs?: Breadcrumb[];
|
|
31
36
|
/**
|
|
32
37
|
* Current authenticated user
|
|
33
38
|
*/
|
package/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./src/billing/planProlongrationPayload";
|
|
|
6
6
|
|
|
7
7
|
export * from "./src/base/event/affectedUser";
|
|
8
8
|
export * from "./src/base/event/backtraceFrame";
|
|
9
|
+
export * from "./src/base/event/breadcrumb";
|
|
9
10
|
export * from "./src/base/event/event";
|
|
10
11
|
export * from "./src/base/event/sourceCodeLine";
|
|
11
12
|
export * from "./src/base/event/addons";
|
package/package.json
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Json } from '../../utils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Breadcrumb severity level
|
|
5
|
+
*/
|
|
6
|
+
export type BreadcrumbLevel = 'fatal' | 'error' | 'warning' | 'info' | 'debug';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Breadcrumb type - controls categorization and UI appearance
|
|
10
|
+
* Common types suitable for both client and backend
|
|
11
|
+
*/
|
|
12
|
+
export type BreadcrumbType =
|
|
13
|
+
| 'default'
|
|
14
|
+
| 'request' // fetch, xhr, db calls, etc
|
|
15
|
+
| 'ui' // click, mousemove, scroll, etc
|
|
16
|
+
| 'navigation' // page open, route change, etc
|
|
17
|
+
| 'logic' // gql resolvers, internal methods calls, etc
|
|
18
|
+
| 'error'; // errors, exceptions, etc
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Single breadcrumb entry - represents an event that occurred before the error
|
|
22
|
+
*/
|
|
23
|
+
export interface Breadcrumb {
|
|
24
|
+
/**
|
|
25
|
+
* Timestamp when the breadcrumb occurred
|
|
26
|
+
* Unix timestamp in milliseconds since epoch (e.g., 1701867896789)
|
|
27
|
+
*
|
|
28
|
+
* Note: This field uses milliseconds format
|
|
29
|
+
*
|
|
30
|
+
* @example 1701867896789
|
|
31
|
+
*/
|
|
32
|
+
timestamp: number;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Type of breadcrumb - controls UI categorization
|
|
36
|
+
*/
|
|
37
|
+
type?: BreadcrumbType;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Category of the event - more specific than type, provides detailed classification
|
|
41
|
+
*
|
|
42
|
+
* Examples:
|
|
43
|
+
* - For type='ui': "ui.click", "ui.scroll", "ui.mousemove"
|
|
44
|
+
* - For type='request': "fetch", "xhr", "db.query", "db.insert"
|
|
45
|
+
* - For type='logic': "gql.resolver", "service.method", "middleware.auth"
|
|
46
|
+
* - For type='navigation': "history.push", "history.replace", "route.change"
|
|
47
|
+
*
|
|
48
|
+
* @example "ui.click"
|
|
49
|
+
* @example "fetch"
|
|
50
|
+
* @example "gql.resolver"
|
|
51
|
+
*/
|
|
52
|
+
category?: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Human-readable message describing the event
|
|
56
|
+
*
|
|
57
|
+
* @example "GET /api/profile 200"
|
|
58
|
+
* @example "Click on button#submit"
|
|
59
|
+
* @example "Navigated to /dashboard"
|
|
60
|
+
* @example "User logged in"
|
|
61
|
+
*/
|
|
62
|
+
message?: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Severity level of the breadcrumb
|
|
66
|
+
*/
|
|
67
|
+
level?: BreadcrumbLevel;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Arbitrary key-value data associated with the breadcrumb
|
|
71
|
+
*/
|
|
72
|
+
data?: Record<string, Json>;
|
|
73
|
+
}
|
|
74
|
+
|
package/src/base/event/event.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BacktraceFrame } from './backtraceFrame';
|
|
2
2
|
import { AffectedUser } from './affectedUser';
|
|
3
3
|
import { EventAddons } from './addons';
|
|
4
|
+
import { Breadcrumb } from './breadcrumb';
|
|
4
5
|
import { Json } from '../../utils';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -34,6 +35,11 @@ export interface EventData<Addons extends EventAddons> {
|
|
|
34
35
|
*/
|
|
35
36
|
release?: string;
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Breadcrumbs - chronological trail of events before the error
|
|
40
|
+
*/
|
|
41
|
+
breadcrumbs?: Breadcrumb[];
|
|
42
|
+
|
|
37
43
|
/**
|
|
38
44
|
* Current authenticated user
|
|
39
45
|
*/
|