54 lines
1.1 KiB
TypeScript
54 lines
1.1 KiB
TypeScript
|
|
// ============================================================================
|
||
|
|
// Package Data Types
|
||
|
|
// ============================================================================
|
||
|
|
|
||
|
|
export type TRegistryProtocol =
|
||
|
|
| 'oci'
|
||
|
|
| 'npm'
|
||
|
|
| 'maven'
|
||
|
|
| 'cargo'
|
||
|
|
| 'composer'
|
||
|
|
| 'pypi'
|
||
|
|
| 'rubygems';
|
||
|
|
|
||
|
|
export interface IPackage {
|
||
|
|
id: string;
|
||
|
|
name: string;
|
||
|
|
description?: string;
|
||
|
|
protocol: TRegistryProtocol;
|
||
|
|
organizationId: string;
|
||
|
|
repositoryId: string;
|
||
|
|
latestVersion?: string;
|
||
|
|
isPrivate: boolean;
|
||
|
|
downloadCount: number;
|
||
|
|
starCount: number;
|
||
|
|
storageBytes: number;
|
||
|
|
updatedAt: string;
|
||
|
|
createdAt: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IPackageDetail extends IPackage {
|
||
|
|
distTags: Record<string, string>;
|
||
|
|
versions: string[];
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IPackageVersion {
|
||
|
|
version: string;
|
||
|
|
publishedAt: string;
|
||
|
|
size: number;
|
||
|
|
downloads: number;
|
||
|
|
checksum?: {
|
||
|
|
sha256?: string;
|
||
|
|
sha512?: string;
|
||
|
|
md5?: string;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface IPackageSearchParams {
|
||
|
|
query?: string;
|
||
|
|
protocol?: TRegistryProtocol;
|
||
|
|
organizationId?: string;
|
||
|
|
limit?: number;
|
||
|
|
offset?: number;
|
||
|
|
}
|