Fix PackageArtifactResponse missing sha256 and version fields

- Add sha256 field to list_package_artifacts response (artifact ID is SHA256)
- Add version field to PackageArtifactResponse schema
- Add version field to frontend PackageArtifact type
- Update getArtifactVersion to prefer direct version field
This commit is contained in:
Mondo Diaz
2026-02-03 16:24:31 -06:00
parent c0c8603d05
commit 1ae989249b
4 changed files with 8 additions and 2 deletions

View File

@@ -313,9 +313,9 @@ function PackagePage() {
}
};
// Helper to get version from artifact metadata
// Helper to get version from artifact - prefer direct version field, fallback to metadata
const getArtifactVersion = (a: PackageArtifact): string | null => {
return (a.format_metadata?.version as string) || null;
return a.version || (a.format_metadata?.version as string) || null;
};
// Helper to get download ref - prefer version, fallback to artifact ID

View File

@@ -58,6 +58,7 @@ export interface PackageArtifact {
created_at: string;
created_by: string;
format_metadata?: Record<string, unknown> | null;
version?: string | null; // Version from PackageVersion if exists
}
export interface PackageVersion {