save checkpoint: save features

This commit is contained in:
master
2026-02-12 10:27:23 +02:00
parent dca86e1248
commit 5bca406787
8837 changed files with 1796879 additions and 5294 deletions

View File

@@ -160,7 +160,7 @@ app.MapPost("/api/v1/packs", async (PackUploadRequest request, PackService servi
.Produces(StatusCodes.Status400BadRequest)
.Produces(StatusCodes.Status401Unauthorized);
app.MapGet("/api/v1/packs", async (string? tenant, PackService service, HttpContext context, AuthOptions auth, CancellationToken cancellationToken) =>
app.MapGet("/api/v1/packs", async (string? tenant, bool? includeDeprecated, PackService service, LifecycleService lifecycleService, HttpContext context, AuthOptions auth, CancellationToken cancellationToken) =>
{
if (!IsAuthorized(context, auth, out var unauthorizedResult))
{
@@ -180,6 +180,16 @@ app.MapGet("/api/v1/packs", async (string? tenant, PackService service, HttpCont
}
var packs = await service.ListAsync(effectiveTenant, cancellationToken).ConfigureAwait(false);
if (includeDeprecated is not true)
{
var lifecycle = await lifecycleService.ListAsync(effectiveTenant, cancellationToken).ConfigureAwait(false);
var deprecatedPackIds = lifecycle
.Where(static l => string.Equals(l.State, "deprecated", StringComparison.OrdinalIgnoreCase))
.Select(static l => l.PackId)
.ToHashSet(StringComparer.OrdinalIgnoreCase);
packs = packs.Where(p => !deprecatedPackIds.Contains(p.PackId)).ToList();
}
return Results.Ok(packs.Select(PackResponse.From));
})
.Produces<IEnumerable<PackResponse>>(StatusCodes.Status200OK)