@scoutflo/alert-correlation 0.4.15 → 0.4.17

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.
Files changed (109) hide show
  1. package/dist/src/contracts/alertEvidence.d.ts +161 -0
  2. package/dist/src/contracts/alertEvidence.js +44 -0
  3. package/dist/src/contracts/alertEvidence.js.map +1 -0
  4. package/dist/src/contracts/alertRef.d.ts +15 -0
  5. package/dist/src/contracts/alertRef.js +10 -0
  6. package/dist/src/contracts/alertRef.js.map +1 -0
  7. package/dist/src/contracts/context.d.ts +1545 -0
  8. package/dist/src/contracts/context.js +99 -0
  9. package/dist/src/contracts/context.js.map +1 -0
  10. package/dist/src/contracts/decision.d.ts +250 -0
  11. package/dist/src/contracts/decision.js +36 -0
  12. package/dist/src/contracts/decision.js.map +1 -0
  13. package/dist/src/contracts/facts.d.ts +531 -0
  14. package/dist/src/contracts/facts.js +45 -0
  15. package/dist/src/contracts/facts.js.map +1 -0
  16. package/dist/src/contracts/index.d.ts +6 -0
  17. package/dist/src/contracts/index.js +23 -0
  18. package/dist/src/contracts/index.js.map +1 -0
  19. package/dist/src/contracts/topology.d.ts +39 -0
  20. package/dist/src/contracts/topology.js +3 -0
  21. package/dist/src/contracts/topology.js.map +1 -0
  22. package/dist/src/decision/coreCompatibility.d.ts +5 -0
  23. package/dist/src/decision/coreCompatibility.js +54 -0
  24. package/dist/src/decision/coreCompatibility.js.map +1 -0
  25. package/dist/src/decision/decideTarget.d.ts +3 -0
  26. package/dist/src/decision/decideTarget.js +55 -0
  27. package/dist/src/decision/decideTarget.js.map +1 -0
  28. package/dist/src/decision/reasonCodes.d.ts +16 -0
  29. package/dist/src/decision/reasonCodes.js +19 -0
  30. package/dist/src/decision/reasonCodes.js.map +1 -0
  31. package/dist/src/extractors/genericExtractor.d.ts +23 -0
  32. package/dist/src/extractors/genericExtractor.js +180 -0
  33. package/dist/src/extractors/genericExtractor.js.map +1 -0
  34. package/dist/src/extractors/mimirExtractor.d.ts +2 -0
  35. package/dist/src/extractors/mimirExtractor.js +12 -0
  36. package/dist/src/extractors/mimirExtractor.js.map +1 -0
  37. package/dist/src/extractors/prometheusExtractor.d.ts +4 -0
  38. package/dist/src/extractors/prometheusExtractor.js +196 -0
  39. package/dist/src/extractors/prometheusExtractor.js.map +1 -0
  40. package/dist/src/extractors/registry.d.ts +101 -0
  41. package/dist/src/extractors/registry.js +25 -0
  42. package/dist/src/extractors/registry.js.map +1 -0
  43. package/dist/src/extractors/sentryExtractor.d.ts +2 -0
  44. package/dist/src/extractors/sentryExtractor.js +254 -0
  45. package/dist/src/extractors/sentryExtractor.js.map +1 -0
  46. package/dist/src/extractors/types.d.ts +11 -0
  47. package/dist/src/extractors/types.js +3 -0
  48. package/dist/src/extractors/types.js.map +1 -0
  49. package/dist/src/extractors/victoriaMetricsExtractor.d.ts +2 -0
  50. package/dist/src/extractors/victoriaMetricsExtractor.js +12 -0
  51. package/dist/src/extractors/victoriaMetricsExtractor.js.map +1 -0
  52. package/dist/src/index.d.ts +26 -0
  53. package/dist/src/index.js +74 -0
  54. package/dist/src/index.js.map +1 -0
  55. package/dist/src/matchers/providerRelationshipMatcher.d.ts +4 -0
  56. package/dist/src/matchers/providerRelationshipMatcher.js +278 -0
  57. package/dist/src/matchers/providerRelationshipMatcher.js.map +1 -0
  58. package/dist/src/matchers/types.d.ts +10 -0
  59. package/dist/src/matchers/types.js +3 -0
  60. package/dist/src/matchers/types.js.map +1 -0
  61. package/dist/src/resolveAlertCorrelation.d.ts +12 -0
  62. package/dist/src/resolveAlertCorrelation.js +16 -0
  63. package/dist/src/resolveAlertCorrelation.js.map +1 -0
  64. package/dist/src/time/normalizeAlertTime.d.ts +9 -0
  65. package/dist/src/time/normalizeAlertTime.js +26 -0
  66. package/dist/src/time/normalizeAlertTime.js.map +1 -0
  67. package/dist/test/contract-aware-matcher.test.d.ts +1 -0
  68. package/dist/test/contract-aware-matcher.test.js +401 -0
  69. package/dist/test/contract-aware-matcher.test.js.map +1 -0
  70. package/dist/test/contracts.test.d.ts +1 -0
  71. package/dist/test/contracts.test.js +289 -0
  72. package/dist/test/contracts.test.js.map +1 -0
  73. package/dist/test/core-compatibility.test.d.ts +1 -0
  74. package/dist/test/core-compatibility.test.js +146 -0
  75. package/dist/test/core-compatibility.test.js.map +1 -0
  76. package/dist/test/decision.test.d.ts +1 -0
  77. package/dist/test/decision.test.js +50 -0
  78. package/dist/test/decision.test.js.map +1 -0
  79. package/dist/test/fixtures.d.ts +48 -0
  80. package/dist/test/fixtures.js +51 -0
  81. package/dist/test/fixtures.js.map +1 -0
  82. package/dist/test/generic-extractor.test.d.ts +1 -0
  83. package/dist/test/generic-extractor.test.js +48 -0
  84. package/dist/test/generic-extractor.test.js.map +1 -0
  85. package/dist/test/mimir-extractor.test.d.ts +1 -0
  86. package/dist/test/mimir-extractor.test.js +28 -0
  87. package/dist/test/mimir-extractor.test.js.map +1 -0
  88. package/dist/test/prometheus-extractor.test.d.ts +1 -0
  89. package/dist/test/prometheus-extractor.test.js +55 -0
  90. package/dist/test/prometheus-extractor.test.js.map +1 -0
  91. package/dist/test/provider-hardening.test.d.ts +1 -0
  92. package/dist/test/provider-hardening.test.js +279 -0
  93. package/dist/test/provider-hardening.test.js.map +1 -0
  94. package/dist/test/resolve-alert-correlation.test.d.ts +1 -0
  95. package/dist/test/resolve-alert-correlation.test.js +43 -0
  96. package/dist/test/resolve-alert-correlation.test.js.map +1 -0
  97. package/dist/test/sentry-extractor.test.d.ts +1 -0
  98. package/dist/test/sentry-extractor.test.js +30 -0
  99. package/dist/test/sentry-extractor.test.js.map +1 -0
  100. package/dist/test/smoke.test.d.ts +1 -0
  101. package/dist/test/smoke.test.js +12 -0
  102. package/dist/test/smoke.test.js.map +1 -0
  103. package/dist/test/time.test.d.ts +1 -0
  104. package/dist/test/time.test.js +36 -0
  105. package/dist/test/time.test.js.map +1 -0
  106. package/dist/test/victoriametrics-extractor.test.d.ts +1 -0
  107. package/dist/test/victoriametrics-extractor.test.js +27 -0
  108. package/dist/test/victoriametrics-extractor.test.js.map +1 -0
  109. package/package.json +4 -3
@@ -0,0 +1,531 @@
1
+ import { z } from 'zod';
2
+ import { type CorrelationFact, type FactKind as CoreFactKind } from '@scoutflo/correlation-core';
3
+ export declare const alertFactKindSchema: z.ZodEnum<["label", "tag", "annotation", "provider_identity", "resource_hint", "text_derived", "time"]>;
4
+ export type FactKind = Extract<CoreFactKind, z.infer<typeof alertFactKindSchema>>;
5
+ export declare const alertFactSchema: z.ZodObject<{
6
+ key: z.ZodString;
7
+ value: z.ZodString;
8
+ sourcePath: z.ZodString;
9
+ confidence: z.ZodNumber;
10
+ rawValue: z.ZodOptional<z.ZodUnknown>;
11
+ normalizedValue: z.ZodOptional<z.ZodString>;
12
+ namespace: z.ZodOptional<z.ZodString>;
13
+ provider: z.ZodOptional<z.ZodString>;
14
+ observedAt: z.ZodOptional<z.ZodString>;
15
+ schemaVersion: z.ZodOptional<z.ZodString>;
16
+ } & {
17
+ kind: z.ZodEnum<["label", "tag", "annotation", "provider_identity", "resource_hint", "text_derived", "time"]>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ value: string;
20
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
21
+ key: string;
22
+ sourcePath: string;
23
+ confidence: number;
24
+ provider?: string | undefined;
25
+ observedAt?: string | undefined;
26
+ schemaVersion?: string | undefined;
27
+ rawValue?: unknown;
28
+ normalizedValue?: string | undefined;
29
+ namespace?: string | undefined;
30
+ }, {
31
+ value: string;
32
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
33
+ key: string;
34
+ sourcePath: string;
35
+ confidence: number;
36
+ provider?: string | undefined;
37
+ observedAt?: string | undefined;
38
+ schemaVersion?: string | undefined;
39
+ rawValue?: unknown;
40
+ normalizedValue?: string | undefined;
41
+ namespace?: string | undefined;
42
+ }>;
43
+ export type Fact = Omit<CorrelationFact, 'kind'> & {
44
+ kind: FactKind;
45
+ };
46
+ export declare const alertTimeWindowSchema: z.ZodObject<{
47
+ capturedAt: z.ZodString;
48
+ observedAt: z.ZodOptional<z.ZodString>;
49
+ startsAt: z.ZodString;
50
+ endsAt: z.ZodOptional<z.ZodString>;
51
+ lastSeen: z.ZodOptional<z.ZodString>;
52
+ isOpenEnded: z.ZodBoolean;
53
+ }, "strict", z.ZodTypeAny, {
54
+ capturedAt: string;
55
+ startsAt: string;
56
+ isOpenEnded: boolean;
57
+ observedAt?: string | undefined;
58
+ endsAt?: string | undefined;
59
+ lastSeen?: string | undefined;
60
+ }, {
61
+ capturedAt: string;
62
+ startsAt: string;
63
+ isOpenEnded: boolean;
64
+ observedAt?: string | undefined;
65
+ endsAt?: string | undefined;
66
+ lastSeen?: string | undefined;
67
+ }>;
68
+ export type AlertTimeWindow = z.infer<typeof alertTimeWindowSchema>;
69
+ export declare const alertCorrelationFactsSchema: z.ZodObject<{
70
+ provider: z.ZodString;
71
+ integrationId: z.ZodString;
72
+ alertKey: z.ZodString;
73
+ occurrenceId: z.ZodString;
74
+ evidenceRef: z.ZodString;
75
+ evidenceSource: z.ZodString;
76
+ extractor: z.ZodObject<{
77
+ name: z.ZodString;
78
+ version: z.ZodString;
79
+ }, "strict", z.ZodTypeAny, {
80
+ name: string;
81
+ version: string;
82
+ }, {
83
+ name: string;
84
+ version: string;
85
+ }>;
86
+ time: z.ZodObject<{
87
+ capturedAt: z.ZodString;
88
+ observedAt: z.ZodOptional<z.ZodString>;
89
+ startsAt: z.ZodString;
90
+ endsAt: z.ZodOptional<z.ZodString>;
91
+ lastSeen: z.ZodOptional<z.ZodString>;
92
+ isOpenEnded: z.ZodBoolean;
93
+ }, "strict", z.ZodTypeAny, {
94
+ capturedAt: string;
95
+ startsAt: string;
96
+ isOpenEnded: boolean;
97
+ observedAt?: string | undefined;
98
+ endsAt?: string | undefined;
99
+ lastSeen?: string | undefined;
100
+ }, {
101
+ capturedAt: string;
102
+ startsAt: string;
103
+ isOpenEnded: boolean;
104
+ observedAt?: string | undefined;
105
+ endsAt?: string | undefined;
106
+ lastSeen?: string | undefined;
107
+ }>;
108
+ labels: z.ZodArray<z.ZodObject<{
109
+ key: z.ZodString;
110
+ value: z.ZodString;
111
+ sourcePath: z.ZodString;
112
+ confidence: z.ZodNumber;
113
+ rawValue: z.ZodOptional<z.ZodUnknown>;
114
+ normalizedValue: z.ZodOptional<z.ZodString>;
115
+ namespace: z.ZodOptional<z.ZodString>;
116
+ provider: z.ZodOptional<z.ZodString>;
117
+ observedAt: z.ZodOptional<z.ZodString>;
118
+ schemaVersion: z.ZodOptional<z.ZodString>;
119
+ } & {
120
+ kind: z.ZodEnum<["label", "tag", "annotation", "provider_identity", "resource_hint", "text_derived", "time"]>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ value: string;
123
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
124
+ key: string;
125
+ sourcePath: string;
126
+ confidence: number;
127
+ provider?: string | undefined;
128
+ observedAt?: string | undefined;
129
+ schemaVersion?: string | undefined;
130
+ rawValue?: unknown;
131
+ normalizedValue?: string | undefined;
132
+ namespace?: string | undefined;
133
+ }, {
134
+ value: string;
135
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
136
+ key: string;
137
+ sourcePath: string;
138
+ confidence: number;
139
+ provider?: string | undefined;
140
+ observedAt?: string | undefined;
141
+ schemaVersion?: string | undefined;
142
+ rawValue?: unknown;
143
+ normalizedValue?: string | undefined;
144
+ namespace?: string | undefined;
145
+ }>, "many">;
146
+ identifiers: z.ZodArray<z.ZodObject<{
147
+ key: z.ZodString;
148
+ value: z.ZodString;
149
+ sourcePath: z.ZodString;
150
+ confidence: z.ZodNumber;
151
+ rawValue: z.ZodOptional<z.ZodUnknown>;
152
+ normalizedValue: z.ZodOptional<z.ZodString>;
153
+ namespace: z.ZodOptional<z.ZodString>;
154
+ provider: z.ZodOptional<z.ZodString>;
155
+ observedAt: z.ZodOptional<z.ZodString>;
156
+ schemaVersion: z.ZodOptional<z.ZodString>;
157
+ } & {
158
+ kind: z.ZodEnum<["label", "tag", "annotation", "provider_identity", "resource_hint", "text_derived", "time"]>;
159
+ }, "strip", z.ZodTypeAny, {
160
+ value: string;
161
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
162
+ key: string;
163
+ sourcePath: string;
164
+ confidence: number;
165
+ provider?: string | undefined;
166
+ observedAt?: string | undefined;
167
+ schemaVersion?: string | undefined;
168
+ rawValue?: unknown;
169
+ normalizedValue?: string | undefined;
170
+ namespace?: string | undefined;
171
+ }, {
172
+ value: string;
173
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
174
+ key: string;
175
+ sourcePath: string;
176
+ confidence: number;
177
+ provider?: string | undefined;
178
+ observedAt?: string | undefined;
179
+ schemaVersion?: string | undefined;
180
+ rawValue?: unknown;
181
+ normalizedValue?: string | undefined;
182
+ namespace?: string | undefined;
183
+ }>, "many">;
184
+ resourceHints: z.ZodArray<z.ZodObject<{
185
+ key: z.ZodString;
186
+ value: z.ZodString;
187
+ sourcePath: z.ZodString;
188
+ confidence: z.ZodNumber;
189
+ rawValue: z.ZodOptional<z.ZodUnknown>;
190
+ normalizedValue: z.ZodOptional<z.ZodString>;
191
+ namespace: z.ZodOptional<z.ZodString>;
192
+ provider: z.ZodOptional<z.ZodString>;
193
+ observedAt: z.ZodOptional<z.ZodString>;
194
+ schemaVersion: z.ZodOptional<z.ZodString>;
195
+ } & {
196
+ kind: z.ZodEnum<["label", "tag", "annotation", "provider_identity", "resource_hint", "text_derived", "time"]>;
197
+ }, "strip", z.ZodTypeAny, {
198
+ value: string;
199
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
200
+ key: string;
201
+ sourcePath: string;
202
+ confidence: number;
203
+ provider?: string | undefined;
204
+ observedAt?: string | undefined;
205
+ schemaVersion?: string | undefined;
206
+ rawValue?: unknown;
207
+ normalizedValue?: string | undefined;
208
+ namespace?: string | undefined;
209
+ }, {
210
+ value: string;
211
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
212
+ key: string;
213
+ sourcePath: string;
214
+ confidence: number;
215
+ provider?: string | undefined;
216
+ observedAt?: string | undefined;
217
+ schemaVersion?: string | undefined;
218
+ rawValue?: unknown;
219
+ normalizedValue?: string | undefined;
220
+ namespace?: string | undefined;
221
+ }>, "many">;
222
+ textHints: z.ZodArray<z.ZodObject<{
223
+ key: z.ZodString;
224
+ value: z.ZodString;
225
+ sourcePath: z.ZodString;
226
+ confidence: z.ZodNumber;
227
+ rawValue: z.ZodOptional<z.ZodUnknown>;
228
+ normalizedValue: z.ZodOptional<z.ZodString>;
229
+ namespace: z.ZodOptional<z.ZodString>;
230
+ provider: z.ZodOptional<z.ZodString>;
231
+ observedAt: z.ZodOptional<z.ZodString>;
232
+ schemaVersion: z.ZodOptional<z.ZodString>;
233
+ } & {
234
+ kind: z.ZodEnum<["label", "tag", "annotation", "provider_identity", "resource_hint", "text_derived", "time"]>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ value: string;
237
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
238
+ key: string;
239
+ sourcePath: string;
240
+ confidence: number;
241
+ provider?: string | undefined;
242
+ observedAt?: string | undefined;
243
+ schemaVersion?: string | undefined;
244
+ rawValue?: unknown;
245
+ normalizedValue?: string | undefined;
246
+ namespace?: string | undefined;
247
+ }, {
248
+ value: string;
249
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
250
+ key: string;
251
+ sourcePath: string;
252
+ confidence: number;
253
+ provider?: string | undefined;
254
+ observedAt?: string | undefined;
255
+ schemaVersion?: string | undefined;
256
+ rawValue?: unknown;
257
+ normalizedValue?: string | undefined;
258
+ namespace?: string | undefined;
259
+ }>, "many">;
260
+ severity: z.ZodOptional<z.ZodObject<{
261
+ key: z.ZodString;
262
+ value: z.ZodString;
263
+ sourcePath: z.ZodString;
264
+ confidence: z.ZodNumber;
265
+ rawValue: z.ZodOptional<z.ZodUnknown>;
266
+ normalizedValue: z.ZodOptional<z.ZodString>;
267
+ namespace: z.ZodOptional<z.ZodString>;
268
+ provider: z.ZodOptional<z.ZodString>;
269
+ observedAt: z.ZodOptional<z.ZodString>;
270
+ schemaVersion: z.ZodOptional<z.ZodString>;
271
+ } & {
272
+ kind: z.ZodEnum<["label", "tag", "annotation", "provider_identity", "resource_hint", "text_derived", "time"]>;
273
+ }, "strip", z.ZodTypeAny, {
274
+ value: string;
275
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
276
+ key: string;
277
+ sourcePath: string;
278
+ confidence: number;
279
+ provider?: string | undefined;
280
+ observedAt?: string | undefined;
281
+ schemaVersion?: string | undefined;
282
+ rawValue?: unknown;
283
+ normalizedValue?: string | undefined;
284
+ namespace?: string | undefined;
285
+ }, {
286
+ value: string;
287
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
288
+ key: string;
289
+ sourcePath: string;
290
+ confidence: number;
291
+ provider?: string | undefined;
292
+ observedAt?: string | undefined;
293
+ schemaVersion?: string | undefined;
294
+ rawValue?: unknown;
295
+ normalizedValue?: string | undefined;
296
+ namespace?: string | undefined;
297
+ }>>;
298
+ title: z.ZodOptional<z.ZodObject<{
299
+ key: z.ZodString;
300
+ value: z.ZodString;
301
+ sourcePath: z.ZodString;
302
+ confidence: z.ZodNumber;
303
+ rawValue: z.ZodOptional<z.ZodUnknown>;
304
+ normalizedValue: z.ZodOptional<z.ZodString>;
305
+ namespace: z.ZodOptional<z.ZodString>;
306
+ provider: z.ZodOptional<z.ZodString>;
307
+ observedAt: z.ZodOptional<z.ZodString>;
308
+ schemaVersion: z.ZodOptional<z.ZodString>;
309
+ } & {
310
+ kind: z.ZodEnum<["label", "tag", "annotation", "provider_identity", "resource_hint", "text_derived", "time"]>;
311
+ }, "strip", z.ZodTypeAny, {
312
+ value: string;
313
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
314
+ key: string;
315
+ sourcePath: string;
316
+ confidence: number;
317
+ provider?: string | undefined;
318
+ observedAt?: string | undefined;
319
+ schemaVersion?: string | undefined;
320
+ rawValue?: unknown;
321
+ normalizedValue?: string | undefined;
322
+ namespace?: string | undefined;
323
+ }, {
324
+ value: string;
325
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
326
+ key: string;
327
+ sourcePath: string;
328
+ confidence: number;
329
+ provider?: string | undefined;
330
+ observedAt?: string | undefined;
331
+ schemaVersion?: string | undefined;
332
+ rawValue?: unknown;
333
+ normalizedValue?: string | undefined;
334
+ namespace?: string | undefined;
335
+ }>>;
336
+ }, "strict", z.ZodTypeAny, {
337
+ integrationId: string;
338
+ provider: string;
339
+ alertKey: string;
340
+ occurrenceId: string;
341
+ evidenceRef: string;
342
+ evidenceSource: string;
343
+ labels: {
344
+ value: string;
345
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
346
+ key: string;
347
+ sourcePath: string;
348
+ confidence: number;
349
+ provider?: string | undefined;
350
+ observedAt?: string | undefined;
351
+ schemaVersion?: string | undefined;
352
+ rawValue?: unknown;
353
+ normalizedValue?: string | undefined;
354
+ namespace?: string | undefined;
355
+ }[];
356
+ time: {
357
+ capturedAt: string;
358
+ startsAt: string;
359
+ isOpenEnded: boolean;
360
+ observedAt?: string | undefined;
361
+ endsAt?: string | undefined;
362
+ lastSeen?: string | undefined;
363
+ };
364
+ extractor: {
365
+ name: string;
366
+ version: string;
367
+ };
368
+ identifiers: {
369
+ value: string;
370
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
371
+ key: string;
372
+ sourcePath: string;
373
+ confidence: number;
374
+ provider?: string | undefined;
375
+ observedAt?: string | undefined;
376
+ schemaVersion?: string | undefined;
377
+ rawValue?: unknown;
378
+ normalizedValue?: string | undefined;
379
+ namespace?: string | undefined;
380
+ }[];
381
+ resourceHints: {
382
+ value: string;
383
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
384
+ key: string;
385
+ sourcePath: string;
386
+ confidence: number;
387
+ provider?: string | undefined;
388
+ observedAt?: string | undefined;
389
+ schemaVersion?: string | undefined;
390
+ rawValue?: unknown;
391
+ normalizedValue?: string | undefined;
392
+ namespace?: string | undefined;
393
+ }[];
394
+ textHints: {
395
+ value: string;
396
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
397
+ key: string;
398
+ sourcePath: string;
399
+ confidence: number;
400
+ provider?: string | undefined;
401
+ observedAt?: string | undefined;
402
+ schemaVersion?: string | undefined;
403
+ rawValue?: unknown;
404
+ normalizedValue?: string | undefined;
405
+ namespace?: string | undefined;
406
+ }[];
407
+ title?: {
408
+ value: string;
409
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
410
+ key: string;
411
+ sourcePath: string;
412
+ confidence: number;
413
+ provider?: string | undefined;
414
+ observedAt?: string | undefined;
415
+ schemaVersion?: string | undefined;
416
+ rawValue?: unknown;
417
+ normalizedValue?: string | undefined;
418
+ namespace?: string | undefined;
419
+ } | undefined;
420
+ severity?: {
421
+ value: string;
422
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
423
+ key: string;
424
+ sourcePath: string;
425
+ confidence: number;
426
+ provider?: string | undefined;
427
+ observedAt?: string | undefined;
428
+ schemaVersion?: string | undefined;
429
+ rawValue?: unknown;
430
+ normalizedValue?: string | undefined;
431
+ namespace?: string | undefined;
432
+ } | undefined;
433
+ }, {
434
+ integrationId: string;
435
+ provider: string;
436
+ alertKey: string;
437
+ occurrenceId: string;
438
+ evidenceRef: string;
439
+ evidenceSource: string;
440
+ labels: {
441
+ value: string;
442
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
443
+ key: string;
444
+ sourcePath: string;
445
+ confidence: number;
446
+ provider?: string | undefined;
447
+ observedAt?: string | undefined;
448
+ schemaVersion?: string | undefined;
449
+ rawValue?: unknown;
450
+ normalizedValue?: string | undefined;
451
+ namespace?: string | undefined;
452
+ }[];
453
+ time: {
454
+ capturedAt: string;
455
+ startsAt: string;
456
+ isOpenEnded: boolean;
457
+ observedAt?: string | undefined;
458
+ endsAt?: string | undefined;
459
+ lastSeen?: string | undefined;
460
+ };
461
+ extractor: {
462
+ name: string;
463
+ version: string;
464
+ };
465
+ identifiers: {
466
+ value: string;
467
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
468
+ key: string;
469
+ sourcePath: string;
470
+ confidence: number;
471
+ provider?: string | undefined;
472
+ observedAt?: string | undefined;
473
+ schemaVersion?: string | undefined;
474
+ rawValue?: unknown;
475
+ normalizedValue?: string | undefined;
476
+ namespace?: string | undefined;
477
+ }[];
478
+ resourceHints: {
479
+ value: string;
480
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
481
+ key: string;
482
+ sourcePath: string;
483
+ confidence: number;
484
+ provider?: string | undefined;
485
+ observedAt?: string | undefined;
486
+ schemaVersion?: string | undefined;
487
+ rawValue?: unknown;
488
+ normalizedValue?: string | undefined;
489
+ namespace?: string | undefined;
490
+ }[];
491
+ textHints: {
492
+ value: string;
493
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
494
+ key: string;
495
+ sourcePath: string;
496
+ confidence: number;
497
+ provider?: string | undefined;
498
+ observedAt?: string | undefined;
499
+ schemaVersion?: string | undefined;
500
+ rawValue?: unknown;
501
+ normalizedValue?: string | undefined;
502
+ namespace?: string | undefined;
503
+ }[];
504
+ title?: {
505
+ value: string;
506
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
507
+ key: string;
508
+ sourcePath: string;
509
+ confidence: number;
510
+ provider?: string | undefined;
511
+ observedAt?: string | undefined;
512
+ schemaVersion?: string | undefined;
513
+ rawValue?: unknown;
514
+ normalizedValue?: string | undefined;
515
+ namespace?: string | undefined;
516
+ } | undefined;
517
+ severity?: {
518
+ value: string;
519
+ kind: "label" | "tag" | "annotation" | "provider_identity" | "resource_hint" | "text_derived" | "time";
520
+ key: string;
521
+ sourcePath: string;
522
+ confidence: number;
523
+ provider?: string | undefined;
524
+ observedAt?: string | undefined;
525
+ schemaVersion?: string | undefined;
526
+ rawValue?: unknown;
527
+ normalizedValue?: string | undefined;
528
+ namespace?: string | undefined;
529
+ } | undefined;
530
+ }>;
531
+ export type AlertCorrelationFacts = z.infer<typeof alertCorrelationFactsSchema>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.alertCorrelationFactsSchema = exports.alertTimeWindowSchema = exports.alertFactSchema = exports.alertFactKindSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const correlation_core_1 = require("@scoutflo/correlation-core");
6
+ exports.alertFactKindSchema = zod_1.z.enum([
7
+ 'label',
8
+ 'tag',
9
+ 'annotation',
10
+ 'provider_identity',
11
+ 'resource_hint',
12
+ 'text_derived',
13
+ 'time',
14
+ ]);
15
+ exports.alertFactSchema = correlation_core_1.correlationFactSchema.extend({
16
+ kind: exports.alertFactKindSchema,
17
+ });
18
+ exports.alertTimeWindowSchema = zod_1.z.object({
19
+ capturedAt: zod_1.z.string().datetime(),
20
+ observedAt: zod_1.z.string().datetime().optional(),
21
+ startsAt: zod_1.z.string().datetime(),
22
+ endsAt: zod_1.z.string().datetime().optional(),
23
+ lastSeen: zod_1.z.string().datetime().optional(),
24
+ isOpenEnded: zod_1.z.boolean(),
25
+ }).strict();
26
+ exports.alertCorrelationFactsSchema = zod_1.z.object({
27
+ provider: zod_1.z.string().min(1),
28
+ integrationId: zod_1.z.string().min(1),
29
+ alertKey: zod_1.z.string().min(1),
30
+ occurrenceId: zod_1.z.string().min(1),
31
+ evidenceRef: zod_1.z.string().min(1),
32
+ evidenceSource: zod_1.z.string().min(1),
33
+ extractor: zod_1.z.object({
34
+ name: zod_1.z.string().min(1),
35
+ version: zod_1.z.string().min(1),
36
+ }).strict(),
37
+ time: exports.alertTimeWindowSchema,
38
+ labels: zod_1.z.array(exports.alertFactSchema),
39
+ identifiers: zod_1.z.array(exports.alertFactSchema),
40
+ resourceHints: zod_1.z.array(exports.alertFactSchema),
41
+ textHints: zod_1.z.array(exports.alertFactSchema),
42
+ severity: exports.alertFactSchema.optional(),
43
+ title: exports.alertFactSchema.optional(),
44
+ }).strict();
45
+ //# sourceMappingURL=facts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facts.js","sourceRoot":"","sources":["../../../src/contracts/facts.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iEAIoC;AAEvB,QAAA,mBAAmB,GAAG,OAAC,CAAC,IAAI,CAAC;IACxC,OAAO;IACP,KAAK;IACL,YAAY;IACZ,mBAAmB;IACnB,eAAe;IACf,cAAc;IACd,MAAM;CACP,CAAC,CAAC;AAOU,QAAA,eAAe,GAAG,wCAAqB,CAAC,MAAM,CAAC;IAC1D,IAAI,EAAE,2BAAmB;CAC1B,CAAC,CAAC;AAMU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACxC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC1C,WAAW,EAAE,OAAC,CAAC,OAAO,EAAE;CACzB,CAAC,CAAC,MAAM,EAAE,CAAC;AAIC,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,SAAS,EAAE,OAAC,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC3B,CAAC,CAAC,MAAM,EAAE;IACX,IAAI,EAAE,6BAAqB;IAC3B,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,uBAAe,CAAC;IAChC,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,uBAAe,CAAC;IACrC,aAAa,EAAE,OAAC,CAAC,KAAK,CAAC,uBAAe,CAAC;IACvC,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,uBAAe,CAAC;IACnC,QAAQ,EAAE,uBAAe,CAAC,QAAQ,EAAE;IACpC,KAAK,EAAE,uBAAe,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC,MAAM,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './alertRef';
2
+ export * from './alertEvidence';
3
+ export * from './facts';
4
+ export * from './topology';
5
+ export * from './decision';
6
+ export * from './context';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./alertRef"), exports);
18
+ __exportStar(require("./alertEvidence"), exports);
19
+ __exportStar(require("./facts"), exports);
20
+ __exportStar(require("./topology"), exports);
21
+ __exportStar(require("./decision"), exports);
22
+ __exportStar(require("./context"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,kDAAgC;AAChC,0CAAwB;AACxB,6CAA2B;AAC3B,6CAA2B;AAC3B,4CAA0B"}
@@ -0,0 +1,39 @@
1
+ import type { CorrelationEntityRef, CorrelationEntityType } from '@scoutflo/correlation-core';
2
+ import type { TopologyCorrelationContractKey, TopologyCorrelationContractVersion } from '@scoutflo/topology-contracts';
3
+ export type { CorrelationEntityType };
4
+ export type CorrelationTopologyEntityRef = CorrelationEntityRef;
5
+ export interface CorrelationService {
6
+ id: string;
7
+ name: string;
8
+ displayName?: string;
9
+ attributes?: Record<string, unknown>;
10
+ }
11
+ export interface CorrelationTopologyResource {
12
+ id: string;
13
+ name: string;
14
+ provider?: string;
15
+ resourceType?: string;
16
+ attributes?: Record<string, unknown>;
17
+ }
18
+ export interface CorrelationRelationship {
19
+ id: string;
20
+ relation: string;
21
+ from: CorrelationTopologyEntityRef;
22
+ to: CorrelationTopologyEntityRef;
23
+ attributeSchemaKey?: string;
24
+ attribute_schema_key?: string;
25
+ correlationContractKey?: TopologyCorrelationContractKey;
26
+ correlationContractVersion?: TopologyCorrelationContractVersion;
27
+ correlation_contract_key?: TopologyCorrelationContractKey;
28
+ correlation_contract_version?: TopologyCorrelationContractVersion;
29
+ attributes?: Record<string, unknown>;
30
+ sourceAttributes?: Record<string, unknown>;
31
+ source_attributes?: Record<string, unknown>;
32
+ }
33
+ export interface TopologyCandidateInput {
34
+ sourceResource: CorrelationTopologyResource | null;
35
+ monitoredByRelationships: CorrelationRelationship[];
36
+ deployedAsRelationships: CorrelationRelationship[];
37
+ services: CorrelationService[];
38
+ resources: CorrelationTopologyResource[];
39
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=topology.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topology.js","sourceRoot":"","sources":["../../../src/contracts/topology.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { CorrelationCandidate as CoreCorrelationCandidate, CorrelationDecision as CoreCorrelationDecision, CorrelationEvidence as CoreCorrelationEvidence } from '@scoutflo/correlation-core';
2
+ import type { AlertCorrelationDecision, CorrelationCandidate, CorrelationEvidence } from '../contracts/decision';
3
+ export declare function legacyEvidenceToCoreEvidence(evidence: CorrelationEvidence): CoreCorrelationEvidence;
4
+ export declare function legacyCandidateToCoreCandidate(candidate: CorrelationCandidate): CoreCorrelationCandidate;
5
+ export declare function legacyDecisionToCoreDecision(decision: AlertCorrelationDecision): CoreCorrelationDecision;