WIP NuGet API 3.5.0

This commit is contained in:
2022-04-17 14:10:20 +01:00
parent c06f518836
commit a4a1c6e271
12 changed files with 172 additions and 98 deletions

View File

@ -3,9 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using isn.abst;
using isn.Abstract;
using isnd.Controllers;
using isnd.Data;
using isnd.Data.Catalog;
using isnd.Entities;
@ -21,6 +19,7 @@ namespace isnd.Services
{
public class PackageManager : IPackageManager
{
public const string BASE_API_LEVEL = "3.5.0";
ApplicationDbContext dbContext;
public PackageManager(ApplicationDbContext dbContext,
@ -43,7 +42,7 @@ namespace isnd.Services
new Resource
{
Id = extUrl + ApiConfig.Publish,
Type = Constants.PublishCommandId,
Type = "PackagePublish/2.0.0", // TODO BASE_API_LEVEL
Comment = "Package Publish service"
});
// under dev, only leash in release mode
@ -52,7 +51,7 @@ namespace isnd.Services
new Resource
{
Id = extUrl + ApiConfig.Base,
Type = "PackageBaseAddress/3.0.0",
Type = "PackageBaseAddress/" + BASE_API_LEVEL,
Comment = "Package Base Address service"
});
if (unleashClient.IsEnabled("pkg-autocomplete", false))
@ -60,17 +59,23 @@ namespace isnd.Services
new Resource
{
Id = extUrl + ApiConfig.AutoComplete,
Type = "SearchAutocompleteService/3.5.0",
Type = "SearchAutocompleteService/" + BASE_API_LEVEL,
Comment = "Auto complete service"
});
if (unleashClient.IsEnabled("pkg-search", false))
if (unleashClient.IsEnabled("pkg-search", true))
res.Add(
new Resource
{
Id = extUrl + ApiConfig.Search,
Type = "SearchQueryService/3.5.0",
Type = "SearchQueryService/" + BASE_API_LEVEL,
Comment = "Search Query service"
});
/*
{
"@id": "https://api-v2v3search-0.nuget.org/query",
"@type": "SearchQueryService/3.0.0-rc",
"comment": "Query endpoint of NuGet Search service (primary) used by RC clients"
},
if (unleashClient.IsEnabled("pkg-catalog", false))
res.Add(
@ -79,7 +84,17 @@ namespace isnd.Services
Id = extUrl + ApiConfig.Catalog,
Type = "Catalog/3.0.0",
Comment = "Package Catalog Index"
});
});*/
/* TODO ? {
"@id": "https://api.nuget.org/v3/registration5-gz-semver2/",
"@type": "RegistrationsBaseUrl/Versioned",
"clientVersion": "4.3.0-alpha",
"comment": "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages."
},
*/
return res;
}