Release !
This commit is contained in:
27
.vscode/tasks.json
vendored
27
.vscode/tasks.json
vendored
@ -11,7 +11,8 @@
|
||||
"/consoleloggerparameters:NoSummary",
|
||||
"--ignore-failed-sources"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
"problemMatcher": "$msCompile",
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "build",
|
||||
@ -23,7 +24,8 @@
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
"problemMatcher": "$msCompile",
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "db-upgrade",
|
||||
@ -40,9 +42,9 @@
|
||||
"env": {
|
||||
"ASPNETCORE_ENV": "Development"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
"dependsOn":["build"],
|
||||
"group": "test"
|
||||
},
|
||||
|
||||
{
|
||||
@ -56,7 +58,8 @@
|
||||
"/consoleloggerparameters:NoSummary",
|
||||
"/restore"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
"problemMatcher": "$msCompile",
|
||||
"group": "build"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
@ -73,7 +76,8 @@
|
||||
"problemMatcher": "$msCompile",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
"group": "none"
|
||||
},
|
||||
{
|
||||
"label": "monopublish",
|
||||
@ -90,7 +94,8 @@
|
||||
"label": "copyTestConfig",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [ "build", "/t:CopyTestConfig" ]
|
||||
"args": [ "build", "/t:CopyTestConfig" ],
|
||||
"group": "test"
|
||||
},
|
||||
{
|
||||
"label": "test",
|
||||
@ -107,7 +112,8 @@
|
||||
"--logger:xunit"
|
||||
],
|
||||
"problemMatcher": "$msCompile",
|
||||
"dependsOn": [ "build", "copyTestConfig"]
|
||||
"dependsOn": [ "build", "copyTestConfig"],
|
||||
"group": "test"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
@ -123,7 +129,8 @@
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"problemMatcher": "$msCompile"
|
||||
"problemMatcher": "$msCompile",
|
||||
"group": "test"
|
||||
}
|
||||
]
|
||||
}
|
@ -4,6 +4,7 @@ namespace isnd.Entities
|
||||
{
|
||||
public static class ApiConfig
|
||||
{
|
||||
public const string Index = "/index.json";
|
||||
public const string Catalog = "/catalog";
|
||||
public const string Package = "/package";
|
||||
public const string Search = "/search";
|
||||
@ -11,6 +12,7 @@ namespace isnd.Entities
|
||||
public const string Registration = "/registration";
|
||||
|
||||
public const string Nuspec = "/nuspec";
|
||||
public const string Content = "/content";
|
||||
public const string Nuget = "/nuget";
|
||||
|
||||
public const string Find = "/index/FindPackagesById()"; // /FindPackagesById()?id='isn.abst'&semVerLevel=2.0.0
|
||||
|
@ -4,7 +4,7 @@ using isn.Abstract;
|
||||
using isn.abst;
|
||||
using isnd.Interfaces;
|
||||
using System.Linq;
|
||||
|
||||
using isnd.Entities;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
@ -30,7 +30,7 @@ namespace isnd.Controllers
|
||||
/// API index
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("~" + Constants.ApiVersionPrefix + "/index")]
|
||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.Index)]
|
||||
public IActionResult ApiIndex()
|
||||
{
|
||||
return Ok(new ApiIndexViewModel(packageManager.CatalogBaseUrl){ Version = PackageManager.BASE_API_LEVEL, Resources = resources });
|
||||
|
@ -13,6 +13,8 @@ namespace isnd.Controllers
|
||||
// Web get the paquet
|
||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.Nuget + "/{id}/{lower}/{idf}-{lowerf}."
|
||||
+ Constants.PaquetFileEstension)]
|
||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.Content + "/{id}/{lower}/{idf}-{lowerf}."
|
||||
+ Constants.PaquetFileEstension)]
|
||||
public IActionResult GetPackage(
|
||||
[FromRoute][SafeName][Required] string id,
|
||||
[FromRoute][SafeName][Required] string lower,
|
||||
|
@ -7,7 +7,7 @@ namespace isnd.Controllers
|
||||
{
|
||||
public partial class PackagesController
|
||||
{
|
||||
|
||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.Find)]
|
||||
public IActionResult GetVersions(
|
||||
string id,
|
||||
string lower,
|
||||
|
@ -1,44 +0,0 @@
|
||||
using System.Linq;
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using isnd.Entities;
|
||||
using isn.abst;
|
||||
using isnd.Data.Catalog;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
|
||||
public partial class PackagesController
|
||||
{
|
||||
// GET {@id}?q={QUERY}&skip={SKIP}&take={TAKE}&prerelease={PRERELEASE}&semVerLevel={SEMVERLEVEL}&packageType={PACKAGETYPE}
|
||||
[HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.Find)]
|
||||
[HttpPost("~" + Constants.ApiVersionPrefix + ApiConfig.Find)]
|
||||
public async Task<IActionResult> Search(
|
||||
string id,
|
||||
bool prerelease = false,
|
||||
// string packageType = null,
|
||||
string semVerLevel = null,
|
||||
int skip = 0,
|
||||
int take = 25
|
||||
)
|
||||
{
|
||||
id = id.Trim('\'');
|
||||
if (semVerLevel == "2.0.0") prerelease = true;
|
||||
|
||||
//packageManager.SearchCatalogEntriesById(id, semVerLevel, packageType, prerelease);
|
||||
var regs = await packageManager.SearchPackageAsync(
|
||||
|
||||
new PackageRegistrationQuery
|
||||
{
|
||||
Query = id,
|
||||
Prerelease = prerelease,
|
||||
Take = take,
|
||||
Skip = skip
|
||||
}
|
||||
);
|
||||
return Ok(new { totalHits = regs.Count(), data = regs });
|
||||
}
|
||||
}
|
||||
}
|
@ -56,7 +56,7 @@ namespace isnd.Data.Catalog
|
||||
/// The dependencies of the package, grouped by target framework
|
||||
/// </summary>
|
||||
/// <value>array of objects</value>
|
||||
public DependencyGroup[] dependencyGroups { get; set; }
|
||||
public DependencyGroup[] dependencyGroups { get; set; } = Array.Empty<DependencyGroup>();
|
||||
|
||||
/// <summary>
|
||||
/// The deprecation associated with the package
|
||||
@ -128,6 +128,7 @@ namespace isnd.Data.Catalog
|
||||
public string PackageId { get; set; }
|
||||
|
||||
public IEnumerable<PackageDependencyGroup> DependencySets { get; set; }
|
||||
= Array.Empty<PackageDependencyGroup>();
|
||||
|
||||
public long? DownloadCount { get; set; }
|
||||
|
||||
|
@ -47,12 +47,12 @@ namespace isnd.Services
|
||||
Comment = "URI template used by NuGet Client to construct details URL for packages"
|
||||
},
|
||||
|
||||
new Resource(apiBase + ApiConfig.Nuget,
|
||||
new Resource(apiBase + ApiConfig.Content,
|
||||
"PackageBaseAddress/3.0.0")
|
||||
{
|
||||
Comment = "Package Base Address service - " +
|
||||
"Base URL of where NuGet packages are stored, in the format " +
|
||||
"https://<host>/nupkg/{id-lower}/{version-lower}/{id-lower}.{version-lower}.nupkg"
|
||||
"Base URL of where NuGet packages are stored, in the format "
|
||||
// "https://<host>/nupkg/{id-lower}/{version-lower}/{id-lower}.{version-lower}.nupkg"
|
||||
},
|
||||
|
||||
new Resource(apiBase + ApiConfig.AutoComplete,
|
||||
@ -67,6 +67,7 @@ namespace isnd.Services
|
||||
Comment = "Search Query service"
|
||||
},
|
||||
|
||||
|
||||
new Resource(apiBase + ApiConfig.Registration,
|
||||
"RegistrationsBaseUrl/Versioned")
|
||||
{
|
||||
@ -100,7 +101,7 @@ namespace isnd.Services
|
||||
|
||||
public string[] GetVersions(
|
||||
string id,
|
||||
NuGetVersion parsedVersion,
|
||||
NuGetVersion parsedVersion = null,
|
||||
bool prerelease = false,
|
||||
string packageType = null,
|
||||
int skip = 0,
|
||||
@ -110,7 +111,7 @@ namespace isnd.Services
|
||||
v => v.PackageId == id
|
||||
&& (prerelease || !v.IsPrerelease)
|
||||
&& (packageType == null || v.Type == packageType)
|
||||
&& (parsedVersion.CompareTo
|
||||
&& (parsedVersion==null || parsedVersion.CompareTo
|
||||
(new SemanticVersion(v.Major, v.Minor, v.Patch)) < 0)
|
||||
)
|
||||
.OrderBy(v => v.NugetVersion)
|
||||
@ -287,6 +288,7 @@ namespace isnd.Services
|
||||
.Include(p => p.LatestCommit)
|
||||
.Where(p => p.Id.StartsWith(query.Query)
|
||||
&& (query.Prerelease || p.Versions.Any(p => !p.IsPrerelease)))
|
||||
.OrderBy(p => p.CommitNId)
|
||||
.Skip(query.Skip).Take(query.Take)
|
||||
.ToListAsync()
|
||||
);
|
||||
|
@ -93,7 +93,8 @@ namespace isnd
|
||||
.AddNewtonsoftJson(s =>
|
||||
{
|
||||
s.SerializerSettings.ReferenceResolverProvider = () => new NSJWebApiReferenceResolver();
|
||||
});
|
||||
})
|
||||
.AddXmlSerializerFormatters();
|
||||
services.AddSwaggerGen(options =>
|
||||
{
|
||||
options.SwaggerDoc("v1", new OpenApiInfo
|
||||
|
@ -8,9 +8,4 @@
|
||||
<p>
|
||||
<strong>@Model.PkgCount identifiant(s) de paquet dans le SI</strong>
|
||||
</p>
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<iframe width="560" height="315" src="https://crowdbunker.com/embed/i5PhucYQhBw" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen scrolling="no" ></iframe>
|
||||
<iframe width="560" height="315" src="https://crowdbunker.com/embed/BumpeEansBp" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen scrolling="no" ></iframe>
|
||||
<iframe width="560" height="315" src="https://crowdbunker.com/embed/admChkeiYFP" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen scrolling="no" ></iframe>
|
||||
</div>
|
@ -3,6 +3,6 @@
|
||||
<apikeys>
|
||||
</apikeys>
|
||||
<packageSources>
|
||||
<add key="dev" value="http://localhost:5000/v3/index" protocolVersion="3" />
|
||||
<add key="dev" value="http://localhost:5000/v3/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
|
@ -10,4 +10,7 @@
|
||||
<InformationalVersion>1.0.7+Branch.main.Sha.3695c1742965d93eba0ad851656cfaa3e44ba327</InformationalVersion>
|
||||
<Version>1.0.7</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="isn.abst" Version="1.0.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -54,7 +54,7 @@ namespace isn.tests
|
||||
[Fact]
|
||||
public void GetServerResourcesUsingHttpClientAsyncTest()
|
||||
{
|
||||
var model = SourceHelpers.GetServerResources("Https://isn.pschneider.fr/index.json");
|
||||
var model = SourceHelpers.GetServerResources("Https://isn.pschneider.fr/v3/index");
|
||||
Console.WriteLine(JsonConvert.SerializeObject(model));
|
||||
Assert.NotNull(model.Resources);
|
||||
var pub = model.Resources.FirstOrDefault((r) => r.Type.StartsWith("PackagePublish/"));
|
||||
|
@ -10,12 +10,13 @@
|
||||
<Version>1.0.7</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="XunitXml.TestLogger" Version="3.0.70" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||
<PackageReference Include="XunitXml.TestLogger" Version="3.0.70" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
|
||||
<PackageReference Include="xunit.runner.reporters" Version="2.4.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2" />
|
||||
<PackageToolReference Include="xunit.runner.console" Version="2.4.2" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\isnd\isnd.csproj" />
|
||||
|
Reference in New Issue
Block a user