@debugbundle/shared-types 1.7.2 → 2.0.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/dist/browser-resource-context.d.ts +90 -0
- package/dist/browser-resource-context.d.ts.map +1 -0
- package/dist/browser-resource-context.js +23 -0
- package/dist/browser-resource-context.js.map +1 -0
- package/dist/browser-resource-routes.d.ts +40 -0
- package/dist/browser-resource-routes.d.ts.map +1 -0
- package/dist/browser-resource-routes.js +64 -0
- package/dist/browser-resource-routes.js.map +1 -0
- package/dist/browser-resource-suggestions.d.ts +8 -0
- package/dist/browser-resource-suggestions.d.ts.map +1 -0
- package/dist/browser-resource-suggestions.js +46 -0
- package/dist/browser-resource-suggestions.js.map +1 -0
- package/dist/browser-resource.d.ts +20 -0
- package/dist/browser-resource.d.ts.map +1 -0
- package/dist/browser-resource.js +116 -0
- package/dist/browser-resource.js.map +1 -0
- package/dist/capture-rule-evaluation.d.ts +6 -6
- package/dist/capture-rule-evaluation.d.ts.map +1 -1
- package/dist/capture-rule-evaluation.js +6 -2
- package/dist/capture-rule-evaluation.js.map +1 -1
- package/dist/capture-rule-schemas.d.ts +132 -132
- package/dist/capture-rule-suggestions.d.ts +60 -51
- package/dist/capture-rule-suggestions.d.ts.map +1 -1
- package/dist/capture-rule-suggestions.js +47 -115
- package/dist/capture-rule-suggestions.js.map +1 -1
- package/dist/event-envelope.d.ts +56 -56
- package/dist/frontend-severity.d.ts +6 -0
- package/dist/frontend-severity.d.ts.map +1 -0
- package/dist/frontend-severity.js +8 -0
- package/dist/frontend-severity.js.map +1 -0
- package/dist/index.d.ts +265 -86
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { type BrowserResource } from "./browser-resource.js";
|
|
2
3
|
export declare const CaptureRuleSuggestionConfidenceSchema: z.ZodEnum<["high", "medium", "low"]>;
|
|
3
4
|
export type CaptureRuleSuggestionConfidence = z.infer<typeof CaptureRuleSuggestionConfidenceSchema>;
|
|
4
5
|
export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
@@ -109,14 +110,14 @@ export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
|
109
110
|
}>>;
|
|
110
111
|
}, "strip", z.ZodTypeAny, {
|
|
111
112
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
112
|
-
|
|
113
|
+
first_party?: boolean | undefined;
|
|
114
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
113
115
|
services?: string[] | undefined;
|
|
114
116
|
environments?: string[] | undefined;
|
|
115
|
-
first_party?: boolean | undefined;
|
|
116
117
|
error_name?: string | undefined;
|
|
117
118
|
message_contains?: string | undefined;
|
|
118
119
|
message_equals?: string | undefined;
|
|
119
|
-
browser_event_kind?: "
|
|
120
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
120
121
|
browser_event_opaque?: boolean | undefined;
|
|
121
122
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
122
123
|
bot_family?: string | undefined;
|
|
@@ -133,14 +134,14 @@ export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
|
133
134
|
} | undefined;
|
|
134
135
|
}, {
|
|
135
136
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
136
|
-
|
|
137
|
+
first_party?: boolean | undefined;
|
|
138
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
137
139
|
services?: string[] | undefined;
|
|
138
140
|
environments?: string[] | undefined;
|
|
139
|
-
first_party?: boolean | undefined;
|
|
140
141
|
error_name?: string | undefined;
|
|
141
142
|
message_contains?: string | undefined;
|
|
142
143
|
message_equals?: string | undefined;
|
|
143
|
-
browser_event_kind?: "
|
|
144
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
144
145
|
browser_event_opaque?: boolean | undefined;
|
|
145
146
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
146
147
|
bot_family?: string | undefined;
|
|
@@ -167,14 +168,14 @@ export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
|
167
168
|
} | undefined;
|
|
168
169
|
}>, import("./capture-rule-schemas.js").CaptureRuleMatcher, {
|
|
169
170
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
170
|
-
|
|
171
|
+
first_party?: boolean | undefined;
|
|
172
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
171
173
|
services?: string[] | undefined;
|
|
172
174
|
environments?: string[] | undefined;
|
|
173
|
-
first_party?: boolean | undefined;
|
|
174
175
|
error_name?: string | undefined;
|
|
175
176
|
message_contains?: string | undefined;
|
|
176
177
|
message_equals?: string | undefined;
|
|
177
|
-
browser_event_kind?: "
|
|
178
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
178
179
|
browser_event_opaque?: boolean | undefined;
|
|
179
180
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
180
181
|
bot_family?: string | undefined;
|
|
@@ -201,14 +202,14 @@ export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
|
201
202
|
} | undefined;
|
|
202
203
|
}>, import("./capture-rule-schemas.js").CaptureRuleMatcher, {
|
|
203
204
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
204
|
-
|
|
205
|
+
first_party?: boolean | undefined;
|
|
206
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
205
207
|
services?: string[] | undefined;
|
|
206
208
|
environments?: string[] | undefined;
|
|
207
|
-
first_party?: boolean | undefined;
|
|
208
209
|
error_name?: string | undefined;
|
|
209
210
|
message_contains?: string | undefined;
|
|
210
211
|
message_equals?: string | undefined;
|
|
211
|
-
browser_event_kind?: "
|
|
212
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
212
213
|
browser_event_opaque?: boolean | undefined;
|
|
213
214
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
214
215
|
bot_family?: string | undefined;
|
|
@@ -257,14 +258,14 @@ export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
|
257
258
|
name: string;
|
|
258
259
|
matcher: {
|
|
259
260
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
260
|
-
|
|
261
|
+
first_party?: boolean | undefined;
|
|
262
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
261
263
|
services?: string[] | undefined;
|
|
262
264
|
environments?: string[] | undefined;
|
|
263
|
-
first_party?: boolean | undefined;
|
|
264
265
|
error_name?: string | undefined;
|
|
265
266
|
message_contains?: string | undefined;
|
|
266
267
|
message_equals?: string | undefined;
|
|
267
|
-
browser_event_kind?: "
|
|
268
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
268
269
|
browser_event_opaque?: boolean | undefined;
|
|
269
270
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
270
271
|
bot_family?: string | undefined;
|
|
@@ -315,14 +316,14 @@ export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
|
315
316
|
name: string;
|
|
316
317
|
matcher: {
|
|
317
318
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
318
|
-
|
|
319
|
+
first_party?: boolean | undefined;
|
|
320
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
319
321
|
services?: string[] | undefined;
|
|
320
322
|
environments?: string[] | undefined;
|
|
321
|
-
first_party?: boolean | undefined;
|
|
322
323
|
error_name?: string | undefined;
|
|
323
324
|
message_contains?: string | undefined;
|
|
324
325
|
message_equals?: string | undefined;
|
|
325
|
-
browser_event_kind?: "
|
|
326
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
326
327
|
browser_event_opaque?: boolean | undefined;
|
|
327
328
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
328
329
|
bot_family?: string | undefined;
|
|
@@ -373,14 +374,14 @@ export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
|
373
374
|
name: string;
|
|
374
375
|
matcher: {
|
|
375
376
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
376
|
-
|
|
377
|
+
first_party?: boolean | undefined;
|
|
378
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
377
379
|
services?: string[] | undefined;
|
|
378
380
|
environments?: string[] | undefined;
|
|
379
|
-
first_party?: boolean | undefined;
|
|
380
381
|
error_name?: string | undefined;
|
|
381
382
|
message_contains?: string | undefined;
|
|
382
383
|
message_equals?: string | undefined;
|
|
383
|
-
browser_event_kind?: "
|
|
384
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
384
385
|
browser_event_opaque?: boolean | undefined;
|
|
385
386
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
386
387
|
bot_family?: string | undefined;
|
|
@@ -444,14 +445,14 @@ export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
|
444
445
|
name: string;
|
|
445
446
|
matcher: {
|
|
446
447
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
447
|
-
|
|
448
|
+
first_party?: boolean | undefined;
|
|
449
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
448
450
|
services?: string[] | undefined;
|
|
449
451
|
environments?: string[] | undefined;
|
|
450
|
-
first_party?: boolean | undefined;
|
|
451
452
|
error_name?: string | undefined;
|
|
452
453
|
message_contains?: string | undefined;
|
|
453
454
|
message_equals?: string | undefined;
|
|
454
|
-
browser_event_kind?: "
|
|
455
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
455
456
|
browser_event_opaque?: boolean | undefined;
|
|
456
457
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
457
458
|
bot_family?: string | undefined;
|
|
@@ -496,6 +497,7 @@ export declare const CaptureRuleSuggestionSchema: z.ZodObject<{
|
|
|
496
497
|
}>;
|
|
497
498
|
export type CaptureRuleSuggestion = z.infer<typeof CaptureRuleSuggestionSchema>;
|
|
498
499
|
export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
500
|
+
access_mode: z.ZodOptional<z.ZodEnum<["manage", "preview"]>>;
|
|
499
501
|
suggestions: z.ZodArray<z.ZodObject<{
|
|
500
502
|
suggestion_id: z.ZodString;
|
|
501
503
|
label: z.ZodString;
|
|
@@ -604,14 +606,14 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
604
606
|
}>>;
|
|
605
607
|
}, "strip", z.ZodTypeAny, {
|
|
606
608
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
607
|
-
|
|
609
|
+
first_party?: boolean | undefined;
|
|
610
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
608
611
|
services?: string[] | undefined;
|
|
609
612
|
environments?: string[] | undefined;
|
|
610
|
-
first_party?: boolean | undefined;
|
|
611
613
|
error_name?: string | undefined;
|
|
612
614
|
message_contains?: string | undefined;
|
|
613
615
|
message_equals?: string | undefined;
|
|
614
|
-
browser_event_kind?: "
|
|
616
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
615
617
|
browser_event_opaque?: boolean | undefined;
|
|
616
618
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
617
619
|
bot_family?: string | undefined;
|
|
@@ -628,14 +630,14 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
628
630
|
} | undefined;
|
|
629
631
|
}, {
|
|
630
632
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
631
|
-
|
|
633
|
+
first_party?: boolean | undefined;
|
|
634
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
632
635
|
services?: string[] | undefined;
|
|
633
636
|
environments?: string[] | undefined;
|
|
634
|
-
first_party?: boolean | undefined;
|
|
635
637
|
error_name?: string | undefined;
|
|
636
638
|
message_contains?: string | undefined;
|
|
637
639
|
message_equals?: string | undefined;
|
|
638
|
-
browser_event_kind?: "
|
|
640
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
639
641
|
browser_event_opaque?: boolean | undefined;
|
|
640
642
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
641
643
|
bot_family?: string | undefined;
|
|
@@ -662,14 +664,14 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
662
664
|
} | undefined;
|
|
663
665
|
}>, import("./capture-rule-schemas.js").CaptureRuleMatcher, {
|
|
664
666
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
665
|
-
|
|
667
|
+
first_party?: boolean | undefined;
|
|
668
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
666
669
|
services?: string[] | undefined;
|
|
667
670
|
environments?: string[] | undefined;
|
|
668
|
-
first_party?: boolean | undefined;
|
|
669
671
|
error_name?: string | undefined;
|
|
670
672
|
message_contains?: string | undefined;
|
|
671
673
|
message_equals?: string | undefined;
|
|
672
|
-
browser_event_kind?: "
|
|
674
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
673
675
|
browser_event_opaque?: boolean | undefined;
|
|
674
676
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
675
677
|
bot_family?: string | undefined;
|
|
@@ -696,14 +698,14 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
696
698
|
} | undefined;
|
|
697
699
|
}>, import("./capture-rule-schemas.js").CaptureRuleMatcher, {
|
|
698
700
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
699
|
-
|
|
701
|
+
first_party?: boolean | undefined;
|
|
702
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
700
703
|
services?: string[] | undefined;
|
|
701
704
|
environments?: string[] | undefined;
|
|
702
|
-
first_party?: boolean | undefined;
|
|
703
705
|
error_name?: string | undefined;
|
|
704
706
|
message_contains?: string | undefined;
|
|
705
707
|
message_equals?: string | undefined;
|
|
706
|
-
browser_event_kind?: "
|
|
708
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
707
709
|
browser_event_opaque?: boolean | undefined;
|
|
708
710
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
709
711
|
bot_family?: string | undefined;
|
|
@@ -752,14 +754,14 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
752
754
|
name: string;
|
|
753
755
|
matcher: {
|
|
754
756
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
755
|
-
|
|
757
|
+
first_party?: boolean | undefined;
|
|
758
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
756
759
|
services?: string[] | undefined;
|
|
757
760
|
environments?: string[] | undefined;
|
|
758
|
-
first_party?: boolean | undefined;
|
|
759
761
|
error_name?: string | undefined;
|
|
760
762
|
message_contains?: string | undefined;
|
|
761
763
|
message_equals?: string | undefined;
|
|
762
|
-
browser_event_kind?: "
|
|
764
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
763
765
|
browser_event_opaque?: boolean | undefined;
|
|
764
766
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
765
767
|
bot_family?: string | undefined;
|
|
@@ -810,14 +812,14 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
810
812
|
name: string;
|
|
811
813
|
matcher: {
|
|
812
814
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
813
|
-
|
|
815
|
+
first_party?: boolean | undefined;
|
|
816
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
814
817
|
services?: string[] | undefined;
|
|
815
818
|
environments?: string[] | undefined;
|
|
816
|
-
first_party?: boolean | undefined;
|
|
817
819
|
error_name?: string | undefined;
|
|
818
820
|
message_contains?: string | undefined;
|
|
819
821
|
message_equals?: string | undefined;
|
|
820
|
-
browser_event_kind?: "
|
|
822
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
821
823
|
browser_event_opaque?: boolean | undefined;
|
|
822
824
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
823
825
|
bot_family?: string | undefined;
|
|
@@ -868,14 +870,14 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
868
870
|
name: string;
|
|
869
871
|
matcher: {
|
|
870
872
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
871
|
-
|
|
873
|
+
first_party?: boolean | undefined;
|
|
874
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
872
875
|
services?: string[] | undefined;
|
|
873
876
|
environments?: string[] | undefined;
|
|
874
|
-
first_party?: boolean | undefined;
|
|
875
877
|
error_name?: string | undefined;
|
|
876
878
|
message_contains?: string | undefined;
|
|
877
879
|
message_equals?: string | undefined;
|
|
878
|
-
browser_event_kind?: "
|
|
880
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
879
881
|
browser_event_opaque?: boolean | undefined;
|
|
880
882
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
881
883
|
bot_family?: string | undefined;
|
|
@@ -939,14 +941,14 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
939
941
|
name: string;
|
|
940
942
|
matcher: {
|
|
941
943
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
942
|
-
|
|
944
|
+
first_party?: boolean | undefined;
|
|
945
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
943
946
|
services?: string[] | undefined;
|
|
944
947
|
environments?: string[] | undefined;
|
|
945
|
-
first_party?: boolean | undefined;
|
|
946
948
|
error_name?: string | undefined;
|
|
947
949
|
message_contains?: string | undefined;
|
|
948
950
|
message_equals?: string | undefined;
|
|
949
|
-
browser_event_kind?: "
|
|
951
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
950
952
|
browser_event_opaque?: boolean | undefined;
|
|
951
953
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
952
954
|
bot_family?: string | undefined;
|
|
@@ -1016,6 +1018,7 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
1016
1018
|
created_rule_enabled: boolean | null;
|
|
1017
1019
|
}[];
|
|
1018
1020
|
bundle_status?: "pending" | "failed" | "ready" | undefined;
|
|
1021
|
+
access_mode?: "manage" | "preview" | undefined;
|
|
1019
1022
|
bundle_reason?: string | null | undefined;
|
|
1020
1023
|
}, {
|
|
1021
1024
|
suggestions: {
|
|
@@ -1025,14 +1028,14 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
1025
1028
|
name: string;
|
|
1026
1029
|
matcher: {
|
|
1027
1030
|
runtime?: ("unknown" | "browser" | "node" | "python" | "php" | "java" | "go" | "ruby")[] | undefined;
|
|
1028
|
-
|
|
1031
|
+
first_party?: boolean | undefined;
|
|
1032
|
+
event_types?: ("backend_exception" | "request_event" | "log_event" | "frontend_breadcrumb" | "frontend_exception" | "deploy_metadata" | "error_suppressed" | "probe_event")[] | undefined;
|
|
1029
1033
|
services?: string[] | undefined;
|
|
1030
1034
|
environments?: string[] | undefined;
|
|
1031
|
-
first_party?: boolean | undefined;
|
|
1032
1035
|
error_name?: string | undefined;
|
|
1033
1036
|
message_contains?: string | undefined;
|
|
1034
1037
|
message_equals?: string | undefined;
|
|
1035
|
-
browser_event_kind?: "
|
|
1038
|
+
browser_event_kind?: "resource_error" | "window_error" | undefined;
|
|
1036
1039
|
browser_event_opaque?: boolean | undefined;
|
|
1037
1040
|
client_kind?: "unknown" | "human" | "bot" | undefined;
|
|
1038
1041
|
bot_family?: string | undefined;
|
|
@@ -1076,6 +1079,7 @@ export declare const CaptureRuleSuggestionsResponseSchema: z.ZodObject<{
|
|
|
1076
1079
|
created_rule_enabled?: boolean | null | undefined;
|
|
1077
1080
|
}[];
|
|
1078
1081
|
bundle_status?: "pending" | "failed" | "ready" | undefined;
|
|
1082
|
+
access_mode?: "manage" | "preview" | undefined;
|
|
1079
1083
|
bundle_reason?: string | null | undefined;
|
|
1080
1084
|
}>;
|
|
1081
1085
|
export type CaptureRuleSuggestionsResponse = z.infer<typeof CaptureRuleSuggestionsResponseSchema>;
|
|
@@ -1121,6 +1125,11 @@ export interface CaptureRuleSuggestionBundle {
|
|
|
1121
1125
|
fingerprint: string;
|
|
1122
1126
|
};
|
|
1123
1127
|
context: {
|
|
1128
|
+
resource_failure?: Pick<BrowserResource, "host" | "path" | "type"> | null | undefined;
|
|
1129
|
+
error?: {
|
|
1130
|
+
name: string;
|
|
1131
|
+
message: string;
|
|
1132
|
+
} | null | undefined;
|
|
1124
1133
|
request?: {
|
|
1125
1134
|
path?: string;
|
|
1126
1135
|
headers?: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-rule-suggestions.d.ts","sourceRoot":"","sources":["../src/capture-rule-suggestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"capture-rule-suggestions.d.ts","sourceRoot":"","sources":["../src/capture-rule-suggestions.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { buildBrowserResourceSuggestions } from "./browser-resource-suggestions.js";
|
|
3
|
+
import { describeBrowserResource } from "./browser-resource.js";
|
|
2
4
|
import { CaptureRuleActionSchema, CaptureRuleCreateSchema, CaptureRuleEventTypeSchema, classifyCaptureRuleClientFromUserAgent } from "./capture-rules.js";
|
|
3
5
|
export const CaptureRuleSuggestionConfidenceSchema = z.enum(["high", "medium", "low"]);
|
|
4
6
|
export const CaptureRuleSuggestionSchema = z.object({
|
|
@@ -13,6 +15,7 @@ export const CaptureRuleSuggestionSchema = z.object({
|
|
|
13
15
|
rule: CaptureRuleCreateSchema
|
|
14
16
|
});
|
|
15
17
|
export const CaptureRuleSuggestionsResponseSchema = z.object({
|
|
18
|
+
access_mode: z.enum(["manage", "preview"]).optional(),
|
|
16
19
|
suggestions: z.array(CaptureRuleSuggestionSchema),
|
|
17
20
|
bundle_status: z.enum(["ready", "pending", "failed"]).optional(),
|
|
18
21
|
bundle_reason: z.string().nullable().optional()
|
|
@@ -24,17 +27,6 @@ export const CreateCaptureRuleFromSuggestionSchema = z.object({
|
|
|
24
27
|
enabled: z.boolean().optional(),
|
|
25
28
|
expires_at: z.string().datetime().nullable().optional()
|
|
26
29
|
});
|
|
27
|
-
function normalizeHostHeader(value) {
|
|
28
|
-
if (typeof value !== "string") {
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
const trimmed = value.trim().toLowerCase();
|
|
32
|
-
if (trimmed.length === 0) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
const withoutPort = trimmed.split(":", 1)[0];
|
|
36
|
-
return withoutPort && withoutPort.length > 0 ? withoutPort : undefined;
|
|
37
|
-
}
|
|
38
30
|
function normalizePath(value) {
|
|
39
31
|
const trimmed = value?.trim();
|
|
40
32
|
if (trimmed === undefined || trimmed.length === 0) {
|
|
@@ -44,7 +36,9 @@ function normalizePath(value) {
|
|
|
44
36
|
if (pathWithoutQueryOrFragment.length === 0) {
|
|
45
37
|
return "/";
|
|
46
38
|
}
|
|
47
|
-
return pathWithoutQueryOrFragment.startsWith("/")
|
|
39
|
+
return pathWithoutQueryOrFragment.startsWith("/")
|
|
40
|
+
? pathWithoutQueryOrFragment
|
|
41
|
+
: `/${pathWithoutQueryOrFragment}`;
|
|
48
42
|
}
|
|
49
43
|
function normalizeUrl(value) {
|
|
50
44
|
const trimmed = value?.trim();
|
|
@@ -64,7 +58,7 @@ function normalizeUrl(value) {
|
|
|
64
58
|
const normalizedPath = normalizePath(parsed.pathname);
|
|
65
59
|
return {
|
|
66
60
|
...(parsed.hostname.length > 0 ? { host: parsed.hostname.toLowerCase() } : {}),
|
|
67
|
-
...(normalizedPath === undefined ? {} : { path: normalizedPath })
|
|
61
|
+
...(normalizedPath === undefined ? {} : { path: normalizedPath })
|
|
68
62
|
};
|
|
69
63
|
}
|
|
70
64
|
}
|
|
@@ -85,7 +79,25 @@ function readFrontendException(bundle) {
|
|
|
85
79
|
if (!Array.isArray(exceptions) || exceptions.length === 0) {
|
|
86
80
|
return null;
|
|
87
81
|
}
|
|
88
|
-
const
|
|
82
|
+
const resource = bundle.context.resource_failure;
|
|
83
|
+
const primaryError = bundle.context.error;
|
|
84
|
+
// Related exceptions can follow the primary signal; only its resource may seed a noise rule.
|
|
85
|
+
const candidates = resource == null && primaryError == null
|
|
86
|
+
? exceptions
|
|
87
|
+
: exceptions.filter((value) => {
|
|
88
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
89
|
+
return false;
|
|
90
|
+
const exception = value;
|
|
91
|
+
if (resource == null)
|
|
92
|
+
return (exception["name"] === primaryError.name &&
|
|
93
|
+
exception["message"] === primaryError.message);
|
|
94
|
+
const candidate = describeBrowserResource(exception["browser_event"]);
|
|
95
|
+
return (candidate !== null &&
|
|
96
|
+
candidate.host === resource.host &&
|
|
97
|
+
candidate.path === resource.path &&
|
|
98
|
+
candidate.type === resource.type);
|
|
99
|
+
});
|
|
100
|
+
const candidate = candidates[candidates.length - 1];
|
|
89
101
|
return typeof candidate === "object" && candidate !== null && !Array.isArray(candidate)
|
|
90
102
|
? candidate
|
|
91
103
|
: null;
|
|
@@ -97,15 +109,17 @@ function buildSuggestionEvidence(incident, bundle) {
|
|
|
97
109
|
const environment = typeof bundle.project?.environment === "string" && bundle.project.environment.trim().length > 0
|
|
98
110
|
? bundle.project.environment.trim()
|
|
99
111
|
: undefined;
|
|
100
|
-
const requestHeaders = bundle.context.request?.headers;
|
|
101
|
-
const requestHost = normalizeHostHeader(requestHeaders?.["host"]) ?? normalizeHostHeader(requestHeaders?.["x-forwarded-host"]);
|
|
102
112
|
const requestPath = normalizePath(bundle.context.request?.path);
|
|
103
|
-
const responseStatusCode = typeof bundle.context.response?.status_code === "number" &&
|
|
113
|
+
const responseStatusCode = typeof bundle.context.response?.status_code === "number" &&
|
|
114
|
+
Number.isInteger(bundle.context.response.status_code)
|
|
104
115
|
? bundle.context.response.status_code
|
|
105
116
|
: undefined;
|
|
106
|
-
const eventType =
|
|
117
|
+
const eventType = bundle.context.resource_failure != null && bundle.signal.signal_type === "frontend_exception"
|
|
118
|
+
? "frontend_exception"
|
|
119
|
+
: toCaptureRuleEventType(bundle.signal.source_event_types[0]);
|
|
107
120
|
const frontendException = readFrontendException(bundle);
|
|
108
|
-
const browserEvent = typeof frontendException?.["browser_event"] === "object" &&
|
|
121
|
+
const browserEvent = typeof frontendException?.["browser_event"] === "object" &&
|
|
122
|
+
frontendException["browser_event"] !== null
|
|
109
123
|
? frontendException["browser_event"]
|
|
110
124
|
: null;
|
|
111
125
|
const browserEventKind = browserEvent?.["kind"] === "window_error" || browserEvent?.["kind"] === "resource_error"
|
|
@@ -113,7 +127,9 @@ function buildSuggestionEvidence(incident, bundle) {
|
|
|
113
127
|
: undefined;
|
|
114
128
|
const browserEventOpaque = typeof browserEvent?.["opaque"] === "boolean" ? browserEvent["opaque"] : undefined;
|
|
115
129
|
const errorName = typeof frontendException?.["name"] === "string" ? frontendException["name"].trim() : undefined;
|
|
116
|
-
const message = typeof frontendException?.["message"] === "string"
|
|
130
|
+
const message = typeof frontendException?.["message"] === "string"
|
|
131
|
+
? frontendException["message"].trim()
|
|
132
|
+
: undefined;
|
|
117
133
|
const target = typeof browserEvent?.["target"] === "object" && browserEvent["target"] !== null
|
|
118
134
|
? browserEvent["target"]
|
|
119
135
|
: null;
|
|
@@ -123,12 +139,12 @@ function buildSuggestionEvidence(incident, bundle) {
|
|
|
123
139
|
? browserEvent["file_name"]
|
|
124
140
|
: undefined;
|
|
125
141
|
const resourceUrl = normalizeUrl(sourceUrl);
|
|
126
|
-
const
|
|
127
|
-
|
|
142
|
+
const client = classifyCaptureRuleClientFromUserAgent(typeof bundle.context.device?.user_agent === "string"
|
|
143
|
+
? bundle.context.device.user_agent
|
|
144
|
+
: undefined);
|
|
128
145
|
return {
|
|
129
146
|
...(serviceName === undefined ? {} : { serviceName }),
|
|
130
147
|
...(environment === undefined ? {} : { environment }),
|
|
131
|
-
...(requestHost === undefined ? {} : { requestHost }),
|
|
132
148
|
...(requestPath === undefined ? {} : { requestPath }),
|
|
133
149
|
...(responseStatusCode === undefined ? {} : { responseStatusCode }),
|
|
134
150
|
...(eventType === undefined ? {} : { eventType }),
|
|
@@ -137,10 +153,8 @@ function buildSuggestionEvidence(incident, bundle) {
|
|
|
137
153
|
...(browserEventKind === undefined ? {} : { browserEventKind }),
|
|
138
154
|
...(browserEventOpaque === undefined ? {} : { browserEventOpaque }),
|
|
139
155
|
...(resourceUrl.host === undefined ? {} : { resourceHost: resourceUrl.host }),
|
|
140
|
-
...(resourceUrl.path === undefined ? {} : { resourcePath: resourceUrl.path }),
|
|
141
|
-
...(resourceFirstParty === undefined ? {} : { resourceFirstParty }),
|
|
142
156
|
clientKind: client.client_kind,
|
|
143
|
-
...(client.bot_family === undefined ? {} : { botFamily: client.bot_family })
|
|
157
|
+
...(client.bot_family === undefined ? {} : { botFamily: client.bot_family })
|
|
144
158
|
};
|
|
145
159
|
}
|
|
146
160
|
function confidenceRank(value) {
|
|
@@ -163,95 +177,13 @@ export function buildCaptureRuleSuggestions(input) {
|
|
|
163
177
|
const evidence = buildSuggestionEvidence(input.incident, input.bundle);
|
|
164
178
|
const suggestions = [];
|
|
165
179
|
if (evidence.eventType === "frontend_exception" &&
|
|
166
|
-
evidence.browserEventKind === "resource_error"
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
confidence: "high",
|
|
174
|
-
reason: "The primary event is an opaque browser resource-load error from a third-party host.",
|
|
175
|
-
rule: {
|
|
176
|
-
name: `Demote resource errors from ${evidence.resourceHost}`,
|
|
177
|
-
description: "Known third-party browser resource-load noise.",
|
|
178
|
-
enabled: true,
|
|
179
|
-
action: "demote",
|
|
180
|
-
matcher: {
|
|
181
|
-
event_types: ["frontend_exception"],
|
|
182
|
-
browser_event_kind: "resource_error",
|
|
183
|
-
resource_url: { host: evidence.resourceHost }
|
|
184
|
-
},
|
|
185
|
-
sample_rate: null,
|
|
186
|
-
sample_event_class: null,
|
|
187
|
-
created_by_user_id: null,
|
|
188
|
-
created_from_incident_id: input.incident.incident_id,
|
|
189
|
-
created_from_event_id: null,
|
|
190
|
-
expires_at: null
|
|
191
|
-
}
|
|
192
|
-
}), createSuggestion({
|
|
193
|
-
suggestion_id: "primary_resource_host_drop",
|
|
194
|
-
label: `Drop resource errors from ${evidence.resourceHost}`,
|
|
195
|
-
recommended_action: "drop",
|
|
196
|
-
confidence: "medium",
|
|
197
|
-
reason: "This third-party resource host appears to be known browser noise and can be dropped entirely if you do not need repeat context.",
|
|
198
|
-
requires_confirmation: true,
|
|
199
|
-
rule: {
|
|
200
|
-
name: `Drop resource errors from ${evidence.resourceHost}`,
|
|
201
|
-
description: "Drop recurring third-party browser resource-load noise.",
|
|
202
|
-
enabled: true,
|
|
203
|
-
action: "drop",
|
|
204
|
-
matcher: {
|
|
205
|
-
event_types: ["frontend_exception"],
|
|
206
|
-
browser_event_kind: "resource_error",
|
|
207
|
-
resource_url: { host: evidence.resourceHost }
|
|
208
|
-
},
|
|
209
|
-
sample_rate: null,
|
|
210
|
-
sample_event_class: null,
|
|
211
|
-
created_by_user_id: null,
|
|
212
|
-
created_from_incident_id: input.incident.incident_id,
|
|
213
|
-
created_from_event_id: null,
|
|
214
|
-
expires_at: null
|
|
215
|
-
}
|
|
216
|
-
}));
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
const resourceMatcher = evidence.resourceHost !== undefined
|
|
220
|
-
? { host: evidence.resourceHost, ...(evidence.resourcePath === undefined ? {} : { path_equals: evidence.resourcePath }) }
|
|
221
|
-
: evidence.resourcePath === undefined
|
|
222
|
-
? undefined
|
|
223
|
-
: { path_equals: evidence.resourcePath };
|
|
224
|
-
if (resourceMatcher !== undefined) {
|
|
225
|
-
suggestions.push(createSuggestion({
|
|
226
|
-
suggestion_id: "primary_resource_sample",
|
|
227
|
-
label: evidence.resourcePath !== undefined
|
|
228
|
-
? `Sample resource errors for ${evidence.resourcePath}`
|
|
229
|
-
: "Sample recurring first-party resource errors",
|
|
230
|
-
recommended_action: "sample",
|
|
231
|
-
confidence: "medium",
|
|
232
|
-
reason: "The primary event is a first-party browser resource-load failure. Sampling keeps incident visibility without letting repeated chunk failures flood the queue.",
|
|
233
|
-
rule: {
|
|
234
|
-
name: evidence.resourcePath !== undefined
|
|
235
|
-
? `Sample resource errors for ${evidence.resourcePath}`
|
|
236
|
-
: "Sample recurring first-party resource errors",
|
|
237
|
-
description: "Sample recurring first-party browser resource-load failures.",
|
|
238
|
-
enabled: true,
|
|
239
|
-
action: "sample",
|
|
240
|
-
matcher: {
|
|
241
|
-
event_types: ["frontend_exception"],
|
|
242
|
-
browser_event_kind: "resource_error",
|
|
243
|
-
resource_url: resourceMatcher
|
|
244
|
-
},
|
|
245
|
-
sample_rate: 0.25,
|
|
246
|
-
sample_event_class: "preserve",
|
|
247
|
-
created_by_user_id: null,
|
|
248
|
-
created_from_incident_id: input.incident.incident_id,
|
|
249
|
-
created_from_event_id: null,
|
|
250
|
-
expires_at: null
|
|
251
|
-
}
|
|
252
|
-
}));
|
|
253
|
-
}
|
|
254
|
-
}
|
|
180
|
+
evidence.browserEventKind === "resource_error") {
|
|
181
|
+
return buildBrowserResourceSuggestions({
|
|
182
|
+
browserEvent: readFrontendException(input.bundle)?.["browser_event"],
|
|
183
|
+
service: evidence.serviceName,
|
|
184
|
+
environment: evidence.environment,
|
|
185
|
+
incident: input.incident
|
|
186
|
+
}).map((suggestion) => CaptureRuleSuggestionSchema.parse(suggestion));
|
|
255
187
|
}
|
|
256
188
|
if (evidence.eventType === "frontend_exception" &&
|
|
257
189
|
evidence.browserEventKind === "window_error" &&
|