Catalog packages

This commit is contained in:
Paul Schneider 2021-08-29 00:08:34 +01:00
commit b7dae240cd
10 changed files with 413 additions and 41 deletions

View file

@ -152,7 +152,8 @@ namespace isnd.Controllers
Patch = version.Patch,
IsPrerelease = version.IsPrerelease,
FullString = version.ToFullString(),
Type = "<null-type>"
Type = "<null-type>",
LatestCommit = commit
});
else
foreach (var type in types)
@ -165,7 +166,8 @@ namespace isnd.Controllers
Patch = version.Patch,
IsPrerelease = version.IsPrerelease,
FullString = version.ToFullString(),
Type = type.Name
Type = type.Name,
LatestCommit = commit
};
_dbContext.PackageVersions.Add(pkgver);
}

View file

@ -105,9 +105,16 @@ namespace isnd.Controllers
[HttpGet(_pkgRootPrefix)]
public IActionResult Index()
{
// https://docs.microsoft.com/en-us/nuget/api/catalog-resource#versioning
// https://docs.microsoft.com/en-us/nuget/api/catalog-resource#versioning
return Ok(PackageManager.CurrentCatalogIndex);
}
[HttpGet(_pkgRootPrefix + "/index-{id}")]
public IActionResult Index(string id)
{
// https://docs.microsoft.com/en-us/nuget/api/catalog-resource#versioning
return Ok(PackageManager.CurrentCatalogPages[int.Parse(id)]);
}
// GET /autocomplete?id=isn.protocol&prerelease=true
[HttpGet(_pkgRootPrefix + "/autocomplete")]