Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions core/src/artifacts/base_artifact_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export interface SaveArtifactRequest {
filename: string;
/** The artifact to save. */
artifact: Part;
/**
* Optional custom metadata to save with the artifact.
*/
customMetadata?: Record<string, unknown>;
}

/**
Expand Down Expand Up @@ -81,6 +85,20 @@ export interface ListVersionsRequest {
filename: string;
}

/**
* Metadata for a file artifact version.
*/
export interface ArtifactVersion {
/** The version number. */
version: number;
/** The canonical URI of the artifact. */
canonicalUri?: string;
/** Custom metadata associated with the artifact. */
customMetadata?: Record<string, unknown>;
/** The MIME type of the artifact. */
mimeType?: string;
}

/**
* Interface for artifact services.
*/
Expand Down Expand Up @@ -135,4 +153,24 @@ export interface BaseArtifactService {
* artifact.
*/
listVersions(request: ListVersionsRequest): Promise<number[]>;

/**
* Lists metadata for each artifact version.
*
* @param request The request to list artifact versions.
* @return A promise that resolves to a list of artifact version metadata.
*/
listArtifactVersions(
request: ListVersionsRequest,
): Promise<ArtifactVersion[]>;

/**
* Gets metadata for a specific artifact version.
*
* @param request The request to get an artifact version.
* @return A promise that resolves to the artifact version metadata or undefined.
*/
getArtifactVersion(
request: LoadArtifactRequest,
): Promise<ArtifactVersion | undefined>;
}
Loading
Loading