-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanifest-schema.ts
More file actions
38 lines (33 loc) · 934 Bytes
/
manifest-schema.ts
File metadata and controls
38 lines (33 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { z } from 'zod'
export const DEFAULT_PATCH_MANIFEST_PATH = '.socket/manifest.json'
export const PatchRecordSchema = z.object({
uuid: z.string().uuid(),
exportedAt: z.string(),
files: z.record(
z.string(), // File path
z.object({
beforeHash: z.string(),
afterHash: z.string(),
}),
),
vulnerabilities: z.record(
z.string(), // Vulnerability ID like "GHSA-jrhj-2j3q-xf3v"
z.object({
cves: z.array(z.string()),
summary: z.string(),
severity: z.string(),
description: z.string(),
}),
),
description: z.string(),
license: z.string(),
tier: z.string(),
})
export type PatchRecord = z.infer<typeof PatchRecordSchema>
export const PatchManifestSchema = z.object({
patches: z.record(
z.string(), // Package identifier like "npm:simplehttpserver@0.0.6"
PatchRecordSchema,
),
})
export type PatchManifest = z.infer<typeof PatchManifestSchema>