(id: string, title: string, type: ArtifactType, file: string, now: string, note?: string)
| 99 | |
| 100 | /** Build a fresh manifest for a new artifact's first version. */ |
| 101 | export function buildManifest(id: string, title: string, type: ArtifactType, file: string, now: string, note?: string): ArtifactManifest { |
| 102 | return { |
| 103 | id, title, type, |
| 104 | createdAt: now, updatedAt: now, |
| 105 | current: 1, |
| 106 | versions: [{ v: 1, file, createdAt: now, ...(note ? { note } : {}) }], |
| 107 | }; |
| 108 | } |
| 109 | |
| 110 | /** Append a new version to a manifest and make it current (immutably). */ |
| 111 | export function addVersion(manifest: ArtifactManifest, file: string, now: string, note?: string): ArtifactManifest { |
no outgoing calls
no test coverage detected