@hawk.so/types 0.1.32-rc.2 → 0.1.32-rc.4

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.
@@ -4,7 +4,7 @@ import { EventAddons } from './addons';
4
4
  import { Json } from '../../utils';
5
5
  /**
6
6
  * Information about event (Payload of the event)
7
- * That object will be send as 'payload' to the Collector
7
+ * That object will be sent as 'payload' from the Collector to the workers
8
8
  */
9
9
  export interface EventData<Addons extends EventAddons> {
10
10
  /**
@@ -23,7 +23,7 @@ export interface EventData<Addons extends EventAddons> {
23
23
  /**
24
24
  * Catcher-specific information
25
25
  */
26
- addons?: Addons | string;
26
+ addons?: Addons;
27
27
  /**
28
28
  * Current release (aka version, revision) of an application
29
29
  */
@@ -41,36 +41,29 @@ export interface EventData<Addons extends EventAddons> {
41
41
  */
42
42
  catcherVersion?: string;
43
43
  }
44
- /**
45
- * Event accepted and processed by Collector.
46
- * It sets the timestamp to the event payload.
47
- */
48
- export interface EventDataAccepted<Addons extends EventAddons> extends EventData<Addons> {
49
- }
50
44
  /**
51
45
  * Event data with decoded unsafe fields
52
46
  */
53
- export interface DecodedEventData<Addons extends EventAddons> extends EventDataAccepted<Addons> {
47
+ export interface DecodedEventData<Addons extends EventAddons> extends EventData<Addons> {
54
48
  /**
55
- * Decoded context
49
+ * Json parsed context string
56
50
  */
57
51
  context?: EventContext;
58
52
  /**
59
- * Decoded addons
53
+ * Json parsed addons string
60
54
  */
61
55
  addons?: Addons;
62
56
  }
63
57
  /**
64
58
  * Event data with encoded unsafe fields
65
- *
66
59
  */
67
- export interface EncodedEventData extends EventDataAccepted<EventAddons> {
60
+ export interface EncodedEventData extends EventData<EventAddons> {
68
61
  /**
69
- * Encoded context
62
+ * Stringified context object
70
63
  */
71
64
  context?: string;
72
65
  /**
73
- * Encoded addons
66
+ * Stringified addons object
74
67
  */
75
68
  addons?: string;
76
69
  }
@@ -1,5 +1,4 @@
1
1
  import { EventData } from '../base/event/event';
2
- import { LogData } from '../base/log/log';
3
2
  import { PerformanceData } from '../base/performance/performance';
4
3
  import type { JavaScriptAddons, PhpAddons, NodeJSAddons, GoAddons, PythonAddons } from '../base/event/addons';
5
4
  /**
@@ -7,29 +6,22 @@ import type { JavaScriptAddons, PhpAddons, NodeJSAddons, GoAddons, PythonAddons
7
6
  */
8
7
  declare type ErrorsCatcherType = 'errors/javascript' | 'errors/php' | 'errors/nodejs' | 'errors/go' | 'errors/python';
9
8
  /**
10
- * Type that represents all supported Catcher message types for logs
11
- * @todo implement log catcher types
12
- */
13
- declare type LogsCatcherType = 'logs/javascript';
14
- /**
15
- * Type that represents all supported Catcher message types for metrics
16
- * @todo implement performance catcher types
9
+ * Type that represents all supported Catcher message types for performance
17
10
  */
18
11
  declare type MetricsCatcherType = 'performance';
19
12
  /**
20
13
  * Union type that represents all supported Catcher message types
21
14
  */
22
- declare type CatcherMessageType = ErrorsCatcherType | LogsCatcherType | MetricsCatcherType;
15
+ export declare type CatcherMessageType = ErrorsCatcherType | MetricsCatcherType;
23
16
  /**
24
17
  * Type that represents the payload of a Catcher message based on its type
25
18
  */
26
- declare type CatcherMessagePayload<Type extends CatcherMessageType> = {
19
+ export declare type CatcherMessagePayload<Type extends CatcherMessageType> = {
27
20
  'errors/javascript': EventData<JavaScriptAddons>;
28
21
  'errors/php': EventData<PhpAddons>;
29
22
  'errors/nodejs': EventData<NodeJSAddons>;
30
23
  'errors/go': EventData<GoAddons>;
31
24
  'errors/python': EventData<PythonAddons>;
32
- 'logs/javascript': LogData;
33
25
  'performance': PerformanceData;
34
26
  }[Type];
35
27
  /**
@@ -1,5 +1,5 @@
1
1
  import { ObjectId } from "mongodb";
2
- import { DecodedEventData, EncodedEventData, EventDataAccepted } from "../base/event/event";
2
+ import { DecodedEventData, EncodedEventData, EventData } from "../base/event/event";
3
3
  import { UserDBScheme } from "./user";
4
4
  import { EventAddons } from '../base/event/addons';
5
5
  /**
@@ -25,7 +25,7 @@ export interface GroupedEventDBScheme {
25
25
  /**
26
26
  * Event data
27
27
  */
28
- payload: EventDataAccepted<EventAddons>;
28
+ payload: EventData<EventAddons>;
29
29
  /**
30
30
  * How many users catch this error
31
31
  */
@@ -37,7 +37,7 @@ export interface GroupedEventDBScheme {
37
37
  /**
38
38
  * Occurrence time
39
39
  * Unix timestamp in seconds (example: 1567009247.576)
40
- * (Set by the Collector)
40
+ * (created by the Collector)
41
41
  */
42
42
  timestamp: number;
43
43
  }
@@ -1,5 +1,5 @@
1
1
  import { ObjectId } from "mongodb";
2
- import { DecodedEventData, EncodedEventData, EventDataAccepted } from '../base/event/event';
2
+ import { DecodedEventData, EncodedEventData, EventData } from '../base/event/event';
3
3
  import { EventAddons } from '../base/event/addons';
4
4
  export interface RepetitionDBScheme {
5
5
  /**
@@ -12,10 +12,10 @@ export interface RepetitionDBScheme {
12
12
  groupHash: string;
13
13
  /**
14
14
  * @deprecated, use delta instead
15
- * And any of EventDataAccepted field with diff
15
+ * And any of EventData field with diff
16
16
  * except fields that used in groupHash
17
17
  */
18
- payload?: EventDataAccepted<EventAddons>;
18
+ payload?: EventData<EventAddons>;
19
19
  /**
20
20
  * Delta between original event and repetition
21
21
  */
@@ -23,7 +23,7 @@ export interface RepetitionDBScheme {
23
23
  /**
24
24
  * Occurrence time
25
25
  * Unix timestamp in seconds (example: 1567009247.576)
26
- * (Set by the Collector)
26
+ * (created by the Collector)
27
27
  */
28
28
  timestamp: number;
29
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hawk.so/types",
3
- "version": "0.1.32-rc.2",
3
+ "version": "0.1.32-rc.4",
4
4
  "description": "TypeScript definitions for Hawk",
5
5
  "types": "build/index.d.ts",
6
6
  "main": "build/index.js",
@@ -22,12 +22,12 @@ type MetricsCatcherType = 'performance';
22
22
  /**
23
23
  * Union type that represents all supported Catcher message types
24
24
  */
25
- type CatcherMessageType = ErrorsCatcherType | MetricsCatcherType;
25
+ export type CatcherMessageType = ErrorsCatcherType | MetricsCatcherType;
26
26
 
27
27
  /**
28
28
  * Type that represents the payload of a Catcher message based on its type
29
29
  */
30
- type CatcherMessagePayload<Type extends CatcherMessageType> = {
30
+ export type CatcherMessagePayload<Type extends CatcherMessageType> = {
31
31
  'errors/javascript': EventData<JavaScriptAddons>;
32
32
  'errors/php': EventData<PhpAddons>;
33
33
  'errors/nodejs': EventData<NodeJSAddons>;