Implement Backend API to List Packages within a Project
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user