2023-05-30 10:35:08 +03:00
const hosts = {
ui : process . env . UI _HOST ? ` http:// ${ process . env . UI _HOST } ` : 'http://localhost:5000' ,
api : process . env . API _HOST ? ` http:// ${ process . env . API _HOST } ` : 'http://localhost:5000'
} ;
const sortCriteria = {
relevance : 'RELEVANCE' ,
updateTime : 'UPDATE_TIME' ,
alphabetic : 'ALPHABETIC_ASC' ,
alphabeticDesc : 'ALPHABETIC_DSC' ,
downloads : 'DOWNLOADS'
} ;
const pageSizes = {
EXPLORE : 10 ,
HOME : 10
} ;
const endpoints = {
2023-12-07 17:36:54 +03:00
repoList : ` /v2/_zot/ext/search?query={RepoListWithNewestImage(requestedPage:%20{limit:15%20offset:0}){Results%20{Name%20LastUpdated%20Size%20Platforms%20{Os%20Arch}%20%20NewestImage%20{%20Tag%20Vulnerabilities%20{MaxSeverity%20Count}%20Description%20%20Licenses%20Logo%20Title%20Source%20IsSigned%20Documentation%20Vendor%20Labels}%20StarCount%20DownloadCount}}} ` ,
2023-05-30 10:35:08 +03:00
detailedRepoInfo : ( name ) =>
2023-12-08 18:14:35 +03:00
` /v2/_zot/ext/search?query={ExpandedRepoInfo(repo:%22 ${ name } %22){Images%20{Manifests%20{Digest%20Platform%20{Os%20Arch}%20Size}%20Vulnerabilities%20{MaxSeverity%20Count}%20Tag%20LastUpdated%20Vendor%20IsDeletable%20}%20Summary%20{Name%20LastUpdated%20Size%20Platforms%20{Os%20Arch}%20Vendors%20NewestImage%20{RepoName%20IsSigned%20Vulnerabilities%20{MaxSeverity%20Count}%20Manifests%20{Digest}%20Tag%20Title%20Documentation%20DownloadCount%20Source%20Description%20Licenses}}}} ` ,
2023-05-30 10:35:08 +03:00
globalSearch : ( searchTerm , sortCriteria , pageNumber = 1 , pageSize = 10 ) =>
` /v2/_zot/ext/search?query={GlobalSearch(query:%22 ${ searchTerm } %22,%20requestedPage:%20{limit: ${ pageSize } %20offset: ${
10 * ( pageNumber - 1 )
2023-12-07 17:36:54 +03:00
} % 20 sortBy : % 20 $ { sortCriteria } } % 20 ) % 20 { Page % 20 { TotalCount % 20 ItemCount } % 20 Repos % 20 { Name % 20 LastUpdated % 20 Size % 20 Platforms % 20 { % 20 Os % 20 Arch % 20 } % 20 IsStarred % 20 IsBookmarked % 20 NewestImage % 20 { % 20 Tag % 20 Vulnerabilities % 20 { MaxSeverity % 20 Count } % 20 Description % 20 IsSigned % 20 SignatureInfo % 20 { % 20 Tool % 20 IsTrusted % 20 Author % 20 } % 20 Licenses % 20 Vendor % 20 Labels % 20 } % 20 StarCount % 20 DownloadCount } } } ` ,
2023-05-30 10:35:08 +03:00
image : ( name ) =>
2023-10-02 21:09:47 +03:00
` /v2/_zot/ext/search?query={Image(image:%20%22 ${ name } %22){RepoName%20IsSigned%20SignatureInfo%20{%20Tool%20IsTrusted%20Author%20}%20Vulnerabilities%20{MaxSeverity%20Count}%20%20Referrers%20{MediaType%20ArtifactType%20Size%20Digest%20Annotations{Key%20Value}}%20Tag%20Manifests%20{History%20{Layer%20{Size%20Digest}%20HistoryDescription%20{CreatedBy%20EmptyLayer}}%20Digest%20ConfigDigest%20LastUpdated%20Size%20Platform%20{Os%20Arch}}%20Vendor%20Licenses%20}} `
2023-05-30 10:35:08 +03:00
} ;
export { hosts , endpoints , sortCriteria , pageSizes } ;