@debugbundle/shared-types 1.0.1 → 1.1.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.
@@ -25,8 +25,46 @@ export interface RequestAnomalyThreshold {
25
25
  minimum_ratio_5m_to_1h: number;
26
26
  }
27
27
  export declare const RECOMMENDED_IMMEDIATE_CLIENT_ERROR_STATUSES: readonly [401, 403, 409, 422];
28
+ export declare const HTTP_METHOD_VALUES: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"];
29
+ export type HttpMethod = (typeof HTTP_METHOD_VALUES)[number];
28
30
  export declare function normalizeImmediateClientErrorStatuses(statuses: readonly number[]): number[];
29
31
  export declare const ImmediateClientErrorStatusesSchema: z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, number[], number[]>;
32
+ export interface ImmediateClientErrorPathRule {
33
+ status_code: number;
34
+ path_pattern: string;
35
+ methods: HttpMethod[];
36
+ }
37
+ export declare function normalizeImmediateClientErrorPathRules(rules: readonly ImmediateClientErrorPathRule[]): ImmediateClientErrorPathRule[];
38
+ export declare const ImmediateClientErrorPathRuleSchema: z.ZodObject<{
39
+ status_code: z.ZodNumber;
40
+ path_pattern: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
41
+ methods: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>, "many">>>, ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[], ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ status_code: number;
44
+ path_pattern: string;
45
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[];
46
+ }, {
47
+ status_code: number;
48
+ path_pattern: string;
49
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
50
+ }>;
51
+ export declare const ImmediateClientErrorPathRulesSchema: z.ZodEffects<z.ZodArray<z.ZodObject<{
52
+ status_code: z.ZodNumber;
53
+ path_pattern: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
54
+ methods: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>, "many">>>, ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[], ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined>;
55
+ }, "strip", z.ZodTypeAny, {
56
+ status_code: number;
57
+ path_pattern: string;
58
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[];
59
+ }, {
60
+ status_code: number;
61
+ path_pattern: string;
62
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
63
+ }>, "many">, ImmediateClientErrorPathRule[], {
64
+ status_code: number;
65
+ path_pattern: string;
66
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
67
+ }[]>;
30
68
  export interface ResolvedCapturePolicy {
31
69
  preset: CapturePreset;
32
70
  capture_logs: CaptureLogs;
@@ -34,6 +72,7 @@ export interface ResolvedCapturePolicy {
34
72
  capture_breadcrumbs: CaptureBreadcrumbs;
35
73
  capture_probe_events: CaptureProbeEvents;
36
74
  immediate_client_error_statuses: number[];
75
+ immediate_client_error_path_rules: ImmediateClientErrorPathRule[];
37
76
  }
38
77
  export declare const ResolvedCapturePolicySchema: z.ZodObject<{
39
78
  preset: z.ZodEnum<["minimal", "balanced", "investigative"]>;
@@ -42,6 +81,23 @@ export declare const ResolvedCapturePolicySchema: z.ZodObject<{
42
81
  capture_breadcrumbs: z.ZodEnum<["local_only", "exception_only", "standalone"]>;
43
82
  capture_probe_events: z.ZodEnum<["buffer_only", "standalone_when_activated"]>;
44
83
  immediate_client_error_statuses: z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, number[], number[]>;
84
+ immediate_client_error_path_rules: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
85
+ status_code: z.ZodNumber;
86
+ path_pattern: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
87
+ methods: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>, "many">>>, ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[], ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ status_code: number;
90
+ path_pattern: string;
91
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[];
92
+ }, {
93
+ status_code: number;
94
+ path_pattern: string;
95
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
96
+ }>, "many">, ImmediateClientErrorPathRule[], {
97
+ status_code: number;
98
+ path_pattern: string;
99
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
100
+ }[]>>;
45
101
  }, "strip", z.ZodTypeAny, {
46
102
  preset: "minimal" | "balanced" | "investigative";
47
103
  capture_logs: "off" | "error" | "warning" | "info";
@@ -49,6 +105,7 @@ export declare const ResolvedCapturePolicySchema: z.ZodObject<{
49
105
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone";
50
106
  capture_probe_events: "buffer_only" | "standalone_when_activated";
51
107
  immediate_client_error_statuses: number[];
108
+ immediate_client_error_path_rules: ImmediateClientErrorPathRule[];
52
109
  }, {
53
110
  preset: "minimal" | "balanced" | "investigative";
54
111
  capture_logs: "off" | "error" | "warning" | "info";
@@ -56,6 +113,11 @@ export declare const ResolvedCapturePolicySchema: z.ZodObject<{
56
113
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone";
57
114
  capture_probe_events: "buffer_only" | "standalone_when_activated";
58
115
  immediate_client_error_statuses: number[];
116
+ immediate_client_error_path_rules?: {
117
+ status_code: number;
118
+ path_pattern: string;
119
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
120
+ }[] | undefined;
59
121
  }>;
60
122
  export interface CapturePolicyOverrides {
61
123
  capture_logs: CaptureLogs | null;
@@ -63,6 +125,7 @@ export interface CapturePolicyOverrides {
63
125
  capture_breadcrumbs: CaptureBreadcrumbs | null;
64
126
  capture_probe_events: CaptureProbeEvents | null;
65
127
  immediate_client_error_statuses: number[] | null;
128
+ immediate_client_error_path_rules: ImmediateClientErrorPathRule[] | null;
66
129
  }
67
130
  export declare const CapturePolicyOverridesSchema: z.ZodObject<{
68
131
  capture_logs: z.ZodNullable<z.ZodEnum<["off", "error", "warning", "info"]>>;
@@ -70,18 +133,41 @@ export declare const CapturePolicyOverridesSchema: z.ZodObject<{
70
133
  capture_breadcrumbs: z.ZodNullable<z.ZodEnum<["local_only", "exception_only", "standalone"]>>;
71
134
  capture_probe_events: z.ZodNullable<z.ZodEnum<["buffer_only", "standalone_when_activated"]>>;
72
135
  immediate_client_error_statuses: z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, number[], number[]>>;
136
+ immediate_client_error_path_rules: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
137
+ status_code: z.ZodNumber;
138
+ path_pattern: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
139
+ methods: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>, "many">>>, ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[], ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined>;
140
+ }, "strip", z.ZodTypeAny, {
141
+ status_code: number;
142
+ path_pattern: string;
143
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[];
144
+ }, {
145
+ status_code: number;
146
+ path_pattern: string;
147
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
148
+ }>, "many">, ImmediateClientErrorPathRule[], {
149
+ status_code: number;
150
+ path_pattern: string;
151
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
152
+ }[]>>>;
73
153
  }, "strip", z.ZodTypeAny, {
74
154
  capture_logs: "off" | "error" | "warning" | "info" | null;
75
155
  capture_request_events: "off" | "failures_only" | "filtered" | "all" | null;
76
156
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone" | null;
77
157
  capture_probe_events: "buffer_only" | "standalone_when_activated" | null;
78
158
  immediate_client_error_statuses: number[] | null;
159
+ immediate_client_error_path_rules: ImmediateClientErrorPathRule[] | null;
79
160
  }, {
80
161
  capture_logs: "off" | "error" | "warning" | "info" | null;
81
162
  capture_request_events: "off" | "failures_only" | "filtered" | "all" | null;
82
163
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone" | null;
83
164
  capture_probe_events: "buffer_only" | "standalone_when_activated" | null;
84
165
  immediate_client_error_statuses: number[] | null;
166
+ immediate_client_error_path_rules?: {
167
+ status_code: number;
168
+ path_pattern: string;
169
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
170
+ }[] | null | undefined;
85
171
  }>;
86
172
  export interface CapturePolicyResponse {
87
173
  access_mode: "manage" | "preview";
@@ -97,6 +183,23 @@ export declare const CapturePolicyResponseSchema: z.ZodObject<{
97
183
  capture_breadcrumbs: z.ZodEnum<["local_only", "exception_only", "standalone"]>;
98
184
  capture_probe_events: z.ZodEnum<["buffer_only", "standalone_when_activated"]>;
99
185
  immediate_client_error_statuses: z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, number[], number[]>;
186
+ immediate_client_error_path_rules: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodObject<{
187
+ status_code: z.ZodNumber;
188
+ path_pattern: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
189
+ methods: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>, "many">>>, ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[], ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined>;
190
+ }, "strip", z.ZodTypeAny, {
191
+ status_code: number;
192
+ path_pattern: string;
193
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[];
194
+ }, {
195
+ status_code: number;
196
+ path_pattern: string;
197
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
198
+ }>, "many">, ImmediateClientErrorPathRule[], {
199
+ status_code: number;
200
+ path_pattern: string;
201
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
202
+ }[]>>;
100
203
  }, "strip", z.ZodTypeAny, {
101
204
  preset: "minimal" | "balanced" | "investigative";
102
205
  capture_logs: "off" | "error" | "warning" | "info";
@@ -104,6 +207,7 @@ export declare const CapturePolicyResponseSchema: z.ZodObject<{
104
207
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone";
105
208
  capture_probe_events: "buffer_only" | "standalone_when_activated";
106
209
  immediate_client_error_statuses: number[];
210
+ immediate_client_error_path_rules: ImmediateClientErrorPathRule[];
107
211
  }, {
108
212
  preset: "minimal" | "balanced" | "investigative";
109
213
  capture_logs: "off" | "error" | "warning" | "info";
@@ -111,6 +215,11 @@ export declare const CapturePolicyResponseSchema: z.ZodObject<{
111
215
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone";
112
216
  capture_probe_events: "buffer_only" | "standalone_when_activated";
113
217
  immediate_client_error_statuses: number[];
218
+ immediate_client_error_path_rules?: {
219
+ status_code: number;
220
+ path_pattern: string;
221
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
222
+ }[] | undefined;
114
223
  }>;
115
224
  overrides: z.ZodObject<{
116
225
  capture_logs: z.ZodNullable<z.ZodEnum<["off", "error", "warning", "info"]>>;
@@ -118,18 +227,41 @@ export declare const CapturePolicyResponseSchema: z.ZodObject<{
118
227
  capture_breadcrumbs: z.ZodNullable<z.ZodEnum<["local_only", "exception_only", "standalone"]>>;
119
228
  capture_probe_events: z.ZodNullable<z.ZodEnum<["buffer_only", "standalone_when_activated"]>>;
120
229
  immediate_client_error_statuses: z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, number[], number[]>>;
230
+ immediate_client_error_path_rules: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
231
+ status_code: z.ZodNumber;
232
+ path_pattern: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
233
+ methods: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>, "many">>>, ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[], ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined>;
234
+ }, "strip", z.ZodTypeAny, {
235
+ status_code: number;
236
+ path_pattern: string;
237
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[];
238
+ }, {
239
+ status_code: number;
240
+ path_pattern: string;
241
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
242
+ }>, "many">, ImmediateClientErrorPathRule[], {
243
+ status_code: number;
244
+ path_pattern: string;
245
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
246
+ }[]>>>;
121
247
  }, "strip", z.ZodTypeAny, {
122
248
  capture_logs: "off" | "error" | "warning" | "info" | null;
123
249
  capture_request_events: "off" | "failures_only" | "filtered" | "all" | null;
124
250
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone" | null;
125
251
  capture_probe_events: "buffer_only" | "standalone_when_activated" | null;
126
252
  immediate_client_error_statuses: number[] | null;
253
+ immediate_client_error_path_rules: ImmediateClientErrorPathRule[] | null;
127
254
  }, {
128
255
  capture_logs: "off" | "error" | "warning" | "info" | null;
129
256
  capture_request_events: "off" | "failures_only" | "filtered" | "all" | null;
130
257
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone" | null;
131
258
  capture_probe_events: "buffer_only" | "standalone_when_activated" | null;
132
259
  immediate_client_error_statuses: number[] | null;
260
+ immediate_client_error_path_rules?: {
261
+ status_code: number;
262
+ path_pattern: string;
263
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
264
+ }[] | null | undefined;
133
265
  }>;
134
266
  }, "strip", z.ZodTypeAny, {
135
267
  access_mode: "manage" | "preview";
@@ -140,6 +272,7 @@ export declare const CapturePolicyResponseSchema: z.ZodObject<{
140
272
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone";
141
273
  capture_probe_events: "buffer_only" | "standalone_when_activated";
142
274
  immediate_client_error_statuses: number[];
275
+ immediate_client_error_path_rules: ImmediateClientErrorPathRule[];
143
276
  };
144
277
  overrides: {
145
278
  capture_logs: "off" | "error" | "warning" | "info" | null;
@@ -147,6 +280,7 @@ export declare const CapturePolicyResponseSchema: z.ZodObject<{
147
280
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone" | null;
148
281
  capture_probe_events: "buffer_only" | "standalone_when_activated" | null;
149
282
  immediate_client_error_statuses: number[] | null;
283
+ immediate_client_error_path_rules: ImmediateClientErrorPathRule[] | null;
150
284
  };
151
285
  }, {
152
286
  access_mode: "manage" | "preview";
@@ -157,6 +291,11 @@ export declare const CapturePolicyResponseSchema: z.ZodObject<{
157
291
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone";
158
292
  capture_probe_events: "buffer_only" | "standalone_when_activated";
159
293
  immediate_client_error_statuses: number[];
294
+ immediate_client_error_path_rules?: {
295
+ status_code: number;
296
+ path_pattern: string;
297
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
298
+ }[] | undefined;
160
299
  };
161
300
  overrides: {
162
301
  capture_logs: "off" | "error" | "warning" | "info" | null;
@@ -164,6 +303,11 @@ export declare const CapturePolicyResponseSchema: z.ZodObject<{
164
303
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone" | null;
165
304
  capture_probe_events: "buffer_only" | "standalone_when_activated" | null;
166
305
  immediate_client_error_statuses: number[] | null;
306
+ immediate_client_error_path_rules?: {
307
+ status_code: number;
308
+ path_pattern: string;
309
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
310
+ }[] | null | undefined;
167
311
  };
168
312
  }>;
169
313
  export declare const CapturePolicySchema: z.ZodObject<{
@@ -174,6 +318,23 @@ export declare const CapturePolicySchema: z.ZodObject<{
174
318
  capture_breadcrumbs: z.ZodNullable<z.ZodEnum<["local_only", "exception_only", "standalone"]>>;
175
319
  capture_probe_events: z.ZodNullable<z.ZodEnum<["buffer_only", "standalone_when_activated"]>>;
176
320
  immediate_client_error_statuses: z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, number[], number[]>>;
321
+ immediate_client_error_path_rules: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
322
+ status_code: z.ZodNumber;
323
+ path_pattern: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
324
+ methods: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>, "many">>>, ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[], ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ status_code: number;
327
+ path_pattern: string;
328
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[];
329
+ }, {
330
+ status_code: number;
331
+ path_pattern: string;
332
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
333
+ }>, "many">, ImmediateClientErrorPathRule[], {
334
+ status_code: number;
335
+ path_pattern: string;
336
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
337
+ }[]>>>;
177
338
  updated_at: z.ZodString;
178
339
  }, "strip", z.ZodTypeAny, {
179
340
  preset: "minimal" | "balanced" | "investigative";
@@ -182,6 +343,7 @@ export declare const CapturePolicySchema: z.ZodObject<{
182
343
  capture_breadcrumbs: "local_only" | "exception_only" | "standalone" | null;
183
344
  capture_probe_events: "buffer_only" | "standalone_when_activated" | null;
184
345
  immediate_client_error_statuses: number[] | null;
346
+ immediate_client_error_path_rules: ImmediateClientErrorPathRule[] | null;
185
347
  project_id: string;
186
348
  updated_at: string;
187
349
  }, {
@@ -193,6 +355,11 @@ export declare const CapturePolicySchema: z.ZodObject<{
193
355
  immediate_client_error_statuses: number[] | null;
194
356
  project_id: string;
195
357
  updated_at: string;
358
+ immediate_client_error_path_rules?: {
359
+ status_code: number;
360
+ path_pattern: string;
361
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
362
+ }[] | null | undefined;
196
363
  }>;
197
364
  export type CapturePolicyRecord = z.infer<typeof CapturePolicySchema>;
198
365
  export declare const CapturePolicyUpdateSchema: z.ZodObject<{
@@ -202,6 +369,23 @@ export declare const CapturePolicyUpdateSchema: z.ZodObject<{
202
369
  capture_breadcrumbs: z.ZodOptional<z.ZodNullable<z.ZodEnum<["local_only", "exception_only", "standalone"]>>>;
203
370
  capture_probe_events: z.ZodOptional<z.ZodNullable<z.ZodEnum<["buffer_only", "standalone_when_activated"]>>>;
204
371
  immediate_client_error_statuses: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, number[], number[]>>>;
372
+ immediate_client_error_path_rules: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
373
+ status_code: z.ZodNumber;
374
+ path_pattern: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
375
+ methods: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>, "many">>>, ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[], ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined>;
376
+ }, "strip", z.ZodTypeAny, {
377
+ status_code: number;
378
+ path_pattern: string;
379
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[];
380
+ }, {
381
+ status_code: number;
382
+ path_pattern: string;
383
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
384
+ }>, "many">, ImmediateClientErrorPathRule[], {
385
+ status_code: number;
386
+ path_pattern: string;
387
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
388
+ }[]>>>;
205
389
  }, "strip", z.ZodTypeAny, {
206
390
  preset?: "minimal" | "balanced" | "investigative" | undefined;
207
391
  capture_logs?: "off" | "error" | "warning" | "info" | null | undefined;
@@ -209,6 +393,7 @@ export declare const CapturePolicyUpdateSchema: z.ZodObject<{
209
393
  capture_breadcrumbs?: "local_only" | "exception_only" | "standalone" | null | undefined;
210
394
  capture_probe_events?: "buffer_only" | "standalone_when_activated" | null | undefined;
211
395
  immediate_client_error_statuses?: number[] | null | undefined;
396
+ immediate_client_error_path_rules?: ImmediateClientErrorPathRule[] | null | undefined;
212
397
  }, {
213
398
  preset?: "minimal" | "balanced" | "investigative" | undefined;
214
399
  capture_logs?: "off" | "error" | "warning" | "info" | null | undefined;
@@ -216,6 +401,11 @@ export declare const CapturePolicyUpdateSchema: z.ZodObject<{
216
401
  capture_breadcrumbs?: "local_only" | "exception_only" | "standalone" | null | undefined;
217
402
  capture_probe_events?: "buffer_only" | "standalone_when_activated" | null | undefined;
218
403
  immediate_client_error_statuses?: number[] | null | undefined;
404
+ immediate_client_error_path_rules?: {
405
+ status_code: number;
406
+ path_pattern: string;
407
+ methods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS")[] | undefined;
408
+ }[] | null | undefined;
219
409
  }>;
220
410
  export type CapturePolicyUpdate = z.infer<typeof CapturePolicyUpdateSchema>;
221
411
  export declare const PRESET_DEFAULTS: Record<CapturePreset, Omit<ResolvedCapturePolicy, "preset">>;
@@ -230,15 +420,27 @@ export declare function getCapturePolicyOverrides(record: CapturePolicyRecord):
230
420
  * Get the default preset for a plan string. Unknown plans fall back to "minimal".
231
421
  */
232
422
  export declare function getDefaultPreset(plan: string | undefined): CapturePreset;
423
+ export declare function matchesImmediateClientErrorPathRule(input: {
424
+ responseStatus: number | null;
425
+ requestPath?: unknown;
426
+ httpMethod?: unknown;
427
+ immediateClientErrorPathRules?: readonly ImmediateClientErrorPathRule[];
428
+ }): boolean;
233
429
  export declare function classifyRequestStatus(input: {
234
430
  responseStatus: number | null;
431
+ requestPath?: unknown;
432
+ httpMethod?: unknown;
235
433
  capturePreset: CapturePreset;
236
434
  immediateClientErrorStatuses?: readonly number[];
435
+ immediateClientErrorPathRules?: readonly ImmediateClientErrorPathRule[];
237
436
  }): RequestSignalClassification;
238
437
  export declare function isImmediateRequestIncident(input: {
239
438
  responseStatus: number | null;
439
+ requestPath?: unknown;
440
+ httpMethod?: unknown;
240
441
  capturePreset: CapturePreset;
241
442
  immediateClientErrorStatuses?: readonly number[];
443
+ immediateClientErrorPathRules?: readonly ImmediateClientErrorPathRule[];
242
444
  }): boolean;
243
445
  export declare function getRequestAnomalyThreshold(input: {
244
446
  responseStatus: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"capture-policy.d.ts","sourceRoot":"","sources":["../src/capture-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,gBAAgB,sEAInB,CAAC;AAEX,eAAO,MAAM,gBAAgB,wEAA2B,CAAC;AACzD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM1D,eAAO,MAAM,mBAAmB,mDAItB,CAAC;AAEX,eAAO,MAAM,mBAAmB,qDAA8B,CAAC;AAC/D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMhE,eAAO,MAAM,iBAAiB,8CAA+C,CAAC;AAC9E,eAAO,MAAM,iBAAiB,gDAA4B,CAAC;AAC3D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,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