Implement Backend API to List Packages within a Project

This commit is contained in:
Mondo Diaz
2025-12-11 18:47:46 -06:00
parent 1793fd3a8f
commit dea03c4a12
7 changed files with 365 additions and 8 deletions

View File

@@ -45,7 +45,8 @@ export async function getProject(name: string): Promise<Project> {
// Package API
export async function listPackages(projectName: string): Promise<Package[]> {
const response = await fetch(`${API_BASE}/project/${projectName}/packages`);
return handleResponse<Package[]>(response);
const data = await handleResponse<PaginatedResponse<Package>>(response);
return data.items;
}
export async function createPackage(projectName: string, data: { name: string; description?: string }): Promise<Package> {

View File

@@ -8,13 +8,28 @@ export interface Project {
created_by: string;
}
export interface TagSummary {
name: string;
artifact_id: string;
created_at: string;
}
export interface Package {
id: string;
project_id: string;
name: string;
description: string | null;
format: string;
platform: string;
created_at: string;
updated_at: string;
// Aggregated fields (from PackageDetailResponse)
tag_count?: number;
artifact_count?: number;
total_size?: number;
latest_tag?: string | null;
latest_upload_at?: string | null;
recent_tags?: TagSummary[];
}
export interface Artifact {