@wix/monitoring-types 0.9.0 → 0.10.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.mts +21 -4
- package/build/index.d.ts +21 -4
- package/package.json +6 -6
package/build/index.d.mts
CHANGED
|
@@ -62,10 +62,17 @@ interface Span {
|
|
|
62
62
|
spanContext(): SpanContextData;
|
|
63
63
|
end(): void;
|
|
64
64
|
}
|
|
65
|
+
interface ManualSpan {
|
|
66
|
+
end(): void;
|
|
67
|
+
fail(error: unknown): void;
|
|
68
|
+
}
|
|
65
69
|
interface SpanOptions {
|
|
66
70
|
name: string;
|
|
67
71
|
tags?: Tags;
|
|
68
72
|
}
|
|
73
|
+
interface EndSpanOptions {
|
|
74
|
+
name: string;
|
|
75
|
+
}
|
|
69
76
|
interface Breadcrumb {
|
|
70
77
|
type?: string;
|
|
71
78
|
category?: string;
|
|
@@ -83,14 +90,12 @@ interface MonitoringClient {
|
|
|
83
90
|
* Captures an exception event and sends it to Sentry.
|
|
84
91
|
* @param error The error to capture
|
|
85
92
|
* @param captureContext Optional additional data to attach to the Sentry e vent.
|
|
86
|
-
* @returns the id of the captured Sentry event.
|
|
87
93
|
*/
|
|
88
94
|
captureException(error: unknown, captureContext?: CaptureContext): void;
|
|
89
95
|
/**
|
|
90
96
|
* Captures a message event and sends it to Sentry.
|
|
91
97
|
* @param message The message to capture
|
|
92
98
|
* @param captureContext Define the level of the message or pass in additional data to attach to the message.
|
|
93
|
-
* @returns the id of the captured message.
|
|
94
99
|
*/
|
|
95
100
|
captureMessage(message: string, captureContext?: CaptureContext): void;
|
|
96
101
|
/**
|
|
@@ -99,7 +104,19 @@ interface MonitoringClient {
|
|
|
99
104
|
* @param callback The function to wrap with a span
|
|
100
105
|
* @returns The return value of the callback
|
|
101
106
|
*/
|
|
102
|
-
startSpan<T>(spanOptions: SpanOptions, callback: (span: Span | undefined) => T):
|
|
107
|
+
startSpan<T>(spanOptions: SpanOptions, callback: (span: Span | undefined) => T): T;
|
|
108
|
+
/**
|
|
109
|
+
* Starts a manual span. The span needs to be finished manually by either calling end() or fail() using the returned span object or by calling endSpanManual().
|
|
110
|
+
* @param spanOptions The options for the span
|
|
111
|
+
* @returns A span object that allows to end the span successfully or fail it.
|
|
112
|
+
*/
|
|
113
|
+
startSpanManual(spanOptions: SpanOptions): ManualSpan;
|
|
114
|
+
/**
|
|
115
|
+
* Ends a manual span and sends it to Sentry. Spans can be ended using a MonitoringClient instance which wasn't necessarily used to start the span.
|
|
116
|
+
* Calling this method will end the last span with the same name that was started using startSpanManual() and will ignore the others.
|
|
117
|
+
* @param spanOptions The options for the span
|
|
118
|
+
*/
|
|
119
|
+
endSpanManual(spanOptions: EndSpanOptions): void;
|
|
103
120
|
/**
|
|
104
121
|
* Records a new breadcrumb which will be attached to future events.
|
|
105
122
|
* Breadcrumbs will be added to subsequent events to provide more context on user's actions prior to an error or crash.
|
|
@@ -167,4 +184,4 @@ interface AppMonitoringUnknownConfig {
|
|
|
167
184
|
*/
|
|
168
185
|
type AppMonitoringConfig = AppMonitoringSentryConfig | AppMonitoringUnknownConfig;
|
|
169
186
|
|
|
170
|
-
export type { AppMonitoringConfig, AppMonitoringSentryConfig, AppMonitoringUnknownConfig, Breadcrumb, CaptureContext, Context, Contexts, EventContexts, EventData, EventTags, HostMonitoringContext, MonitoringClient, Primitive, Span, SpanContextData, SpanOptions, Tags };
|
|
187
|
+
export type { AppMonitoringConfig, AppMonitoringSentryConfig, AppMonitoringUnknownConfig, Breadcrumb, CaptureContext, Context, Contexts, EndSpanOptions, EventContexts, EventData, EventTags, HostMonitoringContext, ManualSpan, MonitoringClient, Primitive, Span, SpanContextData, SpanOptions, Tags };
|
package/build/index.d.ts
CHANGED
|
@@ -62,10 +62,17 @@ interface Span {
|
|
|
62
62
|
spanContext(): SpanContextData;
|
|
63
63
|
end(): void;
|
|
64
64
|
}
|
|
65
|
+
interface ManualSpan {
|
|
66
|
+
end(): void;
|
|
67
|
+
fail(error: unknown): void;
|
|
68
|
+
}
|
|
65
69
|
interface SpanOptions {
|
|
66
70
|
name: string;
|
|
67
71
|
tags?: Tags;
|
|
68
72
|
}
|
|
73
|
+
interface EndSpanOptions {
|
|
74
|
+
name: string;
|
|
75
|
+
}
|
|
69
76
|
interface Breadcrumb {
|
|
70
77
|
type?: string;
|
|
71
78
|
category?: string;
|
|
@@ -83,14 +90,12 @@ interface MonitoringClient {
|
|
|
83
90
|
* Captures an exception event and sends it to Sentry.
|
|
84
91
|
* @param error The error to capture
|
|
85
92
|
* @param captureContext Optional additional data to attach to the Sentry e vent.
|
|
86
|
-
* @returns the id of the captured Sentry event.
|
|
87
93
|
*/
|
|
88
94
|
captureException(error: unknown, captureContext?: CaptureContext): void;
|
|
89
95
|
/**
|
|
90
96
|
* Captures a message event and sends it to Sentry.
|
|
91
97
|
* @param message The message to capture
|
|
92
98
|
* @param captureContext Define the level of the message or pass in additional data to attach to the message.
|
|
93
|
-
* @returns the id of the captured message.
|
|
94
99
|
*/
|
|
95
100
|
captureMessage(message: string, captureContext?: CaptureContext): void;
|
|
96
101
|
/**
|
|
@@ -99,7 +104,19 @@ interface MonitoringClient {
|
|
|
99
104
|
* @param callback The function to wrap with a span
|
|
100
105
|
* @returns The return value of the callback
|
|
101
106
|
*/
|
|
102
|
-
startSpan<T>(spanOptions: SpanOptions, callback: (span: Span | undefined) => T):
|
|
107
|
+
startSpan<T>(spanOptions: SpanOptions, callback: (span: Span | undefined) => T): T;
|
|
108
|
+
/**
|
|
109
|
+
* Starts a manual span. The span needs to be finished manually by either calling end() or fail() using the returned span object or by calling endSpanManual().
|
|
110
|
+
* @param spanOptions The options for the span
|
|
111
|
+
* @returns A span object that allows to end the span successfully or fail it.
|
|
112
|
+
*/
|
|
113
|
+
startSpanManual(spanOptions: SpanOptions): ManualSpan;
|
|
114
|
+
/**
|
|
115
|
+
* Ends a manual span and sends it to Sentry. Spans can be ended using a MonitoringClient instance which wasn't necessarily used to start the span.
|
|
116
|
+
* Calling this method will end the last span with the same name that was started using startSpanManual() and will ignore the others.
|
|
117
|
+
* @param spanOptions The options for the span
|
|
118
|
+
*/
|
|
119
|
+
endSpanManual(spanOptions: EndSpanOptions): void;
|
|
103
120
|
/**
|
|
104
121
|
* Records a new breadcrumb which will be attached to future events.
|
|
105
122
|
* Breadcrumbs will be added to subsequent events to provide more context on user's actions prior to an error or crash.
|
|
@@ -167,4 +184,4 @@ interface AppMonitoringUnknownConfig {
|
|
|
167
184
|
*/
|
|
168
185
|
type AppMonitoringConfig = AppMonitoringSentryConfig | AppMonitoringUnknownConfig;
|
|
169
186
|
|
|
170
|
-
export type { AppMonitoringConfig, AppMonitoringSentryConfig, AppMonitoringUnknownConfig, Breadcrumb, CaptureContext, Context, Contexts, EventContexts, EventData, EventTags, HostMonitoringContext, MonitoringClient, Primitive, Span, SpanContextData, SpanOptions, Tags };
|
|
187
|
+
export type { AppMonitoringConfig, AppMonitoringSentryConfig, AppMonitoringUnknownConfig, Breadcrumb, CaptureContext, Context, Contexts, EndSpanOptions, EventContexts, EventData, EventTags, HostMonitoringContext, ManualSpan, MonitoringClient, Primitive, Span, SpanContextData, SpanOptions, Tags };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/monitoring-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Gili Shohat",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"*.{js,ts}": "yarn lint"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^20.17.
|
|
32
|
+
"@types/node": "^20.17.30",
|
|
33
33
|
"eslint": "^8.57.1",
|
|
34
34
|
"eslint-config-sdk": "0.0.0",
|
|
35
|
-
"tsup": "^8.
|
|
36
|
-
"type-fest": "^4.
|
|
37
|
-
"typescript": "^5.
|
|
35
|
+
"tsup": "^8.4.0",
|
|
36
|
+
"type-fest": "^4.39.1",
|
|
37
|
+
"typescript": "^5.8.3"
|
|
38
38
|
},
|
|
39
39
|
"eslintConfig": {
|
|
40
40
|
"extends": "sdk"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
]
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"falconPackageHash": "
|
|
56
|
+
"falconPackageHash": "49a1d3fec1a95572eb4b0cd7588b3cfd544a1da040cefaf91eaf9fa2"
|
|
57
57
|
}
|