fix(registry): align registry integrations with updated auth, storage, repository, and audit models
This commit is contained in:
@@ -39,6 +39,12 @@ export class Repository extends plugins.smartdata.SmartDataDbDoc<Repository, Rep
|
||||
@plugins.smartdata.svDb()
|
||||
public starCount: number = 0;
|
||||
|
||||
@plugins.smartdata.svDb()
|
||||
public packageCount: number = 0;
|
||||
|
||||
@plugins.smartdata.svDb()
|
||||
public storageBytes: number = 0;
|
||||
|
||||
@plugins.smartdata.svDb()
|
||||
@plugins.smartdata.index()
|
||||
public createdAt: Date = new Date();
|
||||
@@ -128,6 +134,20 @@ export class Repository extends plugins.smartdata.SmartDataDbDoc<Repository, Rep
|
||||
return await Repository.getInstances(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this repository is public
|
||||
*/
|
||||
public get isPublic(): boolean {
|
||||
return this.visibility === 'public';
|
||||
}
|
||||
|
||||
/**
|
||||
* Find repository by ID
|
||||
*/
|
||||
public static async findById(id: string): Promise<Repository | null> {
|
||||
return await Repository.getInstance({ id });
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment download count
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user