()
| 15 | export const severitySchema = z.enum(['critical', 'high', 'medium', 'low', 'info', 'none']); |
| 16 | |
| 17 | export const analyticsResultSchema = () => |
| 18 | withPortMeta( |
| 19 | z |
| 20 | .object({ |
| 21 | scanner: z.string().describe('Scanner/component that produced this result'), |
| 22 | finding_hash: z.string().describe('Stable 16-char hash for deduplication'), |
| 23 | severity: severitySchema.describe('Finding severity level, use "none" if not applicable'), |
| 24 | asset_key: z |
| 25 | .string() |
| 26 | .optional() |
| 27 | .describe('Primary asset identifier (auto-detected if missing)'), |
| 28 | }) |
| 29 | .passthrough(), // Allow scanner-specific fields |
| 30 | { schemaName: analyticsResultContractName } |
| 31 | ); |
| 32 | |
| 33 | export type AnalyticsResult = z.infer<ReturnType<typeof analyticsResultSchema>>; |
| 34 | export type Severity = z.infer<typeof severitySchema>; |
no test coverage detected