Enhanced query endpoints with filtering and global artifacts/tags APIs (#18)
- Add search and tag filters to /api/v1/uploads endpoint - Add sort/order parameters to /api/v1/uploads endpoint - Add min_size/max_size filters to package artifacts endpoint - Add sort/order parameters to package artifacts endpoint - Add from/to date filters to tags endpoint - Add global /api/v1/artifacts endpoint with project/package/tag/size/date filters - Add global /api/v1/tags endpoint with project/package/search/date filters - Add GlobalArtifactResponse and GlobalTagResponse schemas
This commit is contained in:
@@ -343,6 +343,44 @@ class PackageArtifactResponse(BaseModel):
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class GlobalArtifactResponse(BaseModel):
|
||||
"""Artifact with project/package context for global listing"""
|
||||
|
||||
id: str
|
||||
sha256: str
|
||||
size: int
|
||||
content_type: Optional[str]
|
||||
original_name: Optional[str]
|
||||
created_at: datetime
|
||||
created_by: str
|
||||
format_metadata: Optional[Dict[str, Any]] = None
|
||||
ref_count: int = 0
|
||||
# Context from tags/packages
|
||||
projects: List[str] = [] # List of project names containing this artifact
|
||||
packages: List[str] = [] # List of "project/package" paths
|
||||
tags: List[str] = [] # List of "project/package:tag" references
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class GlobalTagResponse(BaseModel):
|
||||
"""Tag with project/package context for global listing"""
|
||||
|
||||
id: UUID
|
||||
name: str
|
||||
artifact_id: str
|
||||
created_at: datetime
|
||||
created_by: str
|
||||
project_name: str
|
||||
package_name: str
|
||||
artifact_size: Optional[int] = None
|
||||
artifact_content_type: Optional[str] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# Upload response
|
||||
class UploadResponse(BaseModel):
|
||||
artifact_id: str
|
||||
|
||||
Reference in New Issue
Block a user