forked from exceptionless/Exceptionless.JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.ts
More file actions
56 lines (53 loc) · 1.82 KB
/
Event.ts
File metadata and controls
56 lines (53 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { ErrorInfo } from "./data/ErrorInfo.js";
import { EnvironmentInfo } from "./data/EnvironmentInfo.js";
import { RequestInfo } from "./data/RequestInfo.js";
import { UserInfo } from "./data/UserInfo.js";
import { UserDescription } from "./data/UserDescription.js";
import { ManualStackingInfo } from "./data/ManualStackingInfo.js";
export interface Event {
/** The event type (ie. error, log message, feature usage). */
type?: string;
/** The event source (ie. machine name, log name, feature name). */
source?: string;
/** The date that the event occurred on. */
date?: Date;
/** A list of tags used to categorize this event. */
tags?: string[];
/** The event message. */
message?: string;
/** The geo coordinates where the event happened. */
geo?: string;
/** The value of the event if any. */
value?: number;
/** The number of duplicated events. */
count?: number;
/** An optional identifier to be used for referencing this event instance at a later time. */
reference_id?: string;
/** Optional data entries that contain additional information about this event. */
data?: IData;
}
export const enum KnownEventDataKeys {
Error = "@error",
SimpleError = "@simple_error",
RequestInfo = "@request",
TraceLog = "@trace",
EnvironmentInfo = "@environment",
UserInfo = "@user",
UserDescription = "@user_description",
Version = "@version",
Level = "@level",
SubmissionMethod = "@submission_method",
ManualStackingInfo = "@stack",
}
interface IData extends Record<string, any> {
"@error": ErrorInfo;
"@simple_error": any; // TODO: Need a model for simple error
"@request": RequestInfo;
"@environment": EnvironmentInfo;
"@user": UserInfo;
"@user_description": UserDescription;
"@version": string;
"@level": string;
"@submission_method": string;
"@stack": ManualStackingInfo;
}