@hawk.so/types 0.1.37 → 0.2.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/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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
  */
@@ -57,6 +57,10 @@ export interface WorkspaceDBScheme {
57
57
  * Is workspace blocked for catching new events
58
58
  */
59
59
  isBlocked?: boolean;
60
+ /**
61
+ * Date when workspace was blocked
62
+ */
63
+ blockedDate?: Date;
60
64
  /**
61
65
  * List of last dates for notifications
62
66
  * Used to reduce frequency of some system messages
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hawk.so/types",
3
- "version": "0.1.37",
3
+ "version": "0.2.0",
4
4
  "description": "TypeScript definitions for Hawk",
5
5
  "types": "build/index.d.ts",
6
6
  "main": "build/index.js",
@@ -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
+
@@ -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
  */
@@ -71,6 +71,11 @@ export interface WorkspaceDBScheme {
71
71
  */
72
72
  isBlocked?: boolean;
73
73
 
74
+ /**
75
+ * Date when workspace was blocked
76
+ */
77
+ blockedDate?: Date;
78
+
74
79
  /**
75
80
  * List of last dates for notifications
76
81
  * Used to reduce frequency of some system messages