Purview.EventSourcing.Admin.API 2.0.0-prerelease.31

This is a prerelease version of Purview.EventSourcing.Admin.API.
dotnet add package Purview.EventSourcing.Admin.API --version 2.0.0-prerelease.31
                    
NuGet\Install-Package Purview.EventSourcing.Admin.API -Version 2.0.0-prerelease.31
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Purview.EventSourcing.Admin.API" Version="2.0.0-prerelease.31" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Purview.EventSourcing.Admin.API" Version="2.0.0-prerelease.31" />
                    
Directory.Packages.props
<PackageReference Include="Purview.EventSourcing.Admin.API" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Purview.EventSourcing.Admin.API --version 2.0.0-prerelease.31
                    
#r "nuget: Purview.EventSourcing.Admin.API, 2.0.0-prerelease.31"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Purview.EventSourcing.Admin.API@2.0.0-prerelease.31
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Purview.EventSourcing.Admin.API&version=2.0.0-prerelease.31&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Purview.EventSourcing.Admin.API&version=2.0.0-prerelease.31&prerelease
                    
Install as a Cake Tool

Purview.EventSourcing.Admin.Api

Purview.EventSourcing.Admin.Api provides minimal-API endpoints for the Purview EventSourcing admin portal: aggregate search, aggregate details, event-history inspection, point-in-time projection, and event export.

Install

dotnet add package Purview.EventSourcing.Admin.Api

Register and map the endpoints

builder.Services.AddPurviewEventSourcingAdminApi(options =>
{
    options.Enabled = true;
    options.RoutePrefix = "/admin/api";
    options.Features.SearchAggregates = true;
    options.Features.ViewAggregate = true;
    options.Features.ViewEvents = true;
    options.Features.ProjectPointInTime = true;
    options.Features.ExportEvents = true;
});

var app = builder.Build();

app.MapPurviewEventSourcingAdminAPI();

Configuration

AdminPortalOptions binds from the AdminPortal configuration section and can also be configured inline. Key settings:

  • Enabled - master switch; when false, no endpoints are mapped (default true)
  • RoutePrefix - route group prefix (default /admin/api)
  • Features - per-capability toggles for search, aggregate view, event history, point-in-time projection, and export
  • Paging - DefaultPageSize (default 50) and MaxPageSize (default 500)
  • Projections - MaxVersionsPerQuery (default 10000) and MaxTimeRangePerQuery (default 365 days)
{
  "AdminPortal": {
    "Enabled": true,
    "RoutePrefix": "/admin/api",
    "Features": {
      "SearchAggregates": true,
      "ViewAggregate": true,
      "ViewEvents": true,
      "ProjectPointInTime": true,
      "ExportEvents": false
    }
  }
}

Endpoints

Host authorization and endpoint conventions

The built-in policies remain the defaults, but a host can require its own policy for any feature and apply standard endpoint conventions such as rate limiting, CORS, tags, or additional metadata:

app.MapPurviewEventSourcingAdminAPI(configureEndpoints: endpoints =>
{
    endpoints.RequirePolicy(AdminFeature.ViewEvents, "OperationsEventReader");
    endpoints.GroupConvention = group => group.RequireRateLimiting("admin");
    endpoints.EndpointConvention = (feature, endpoint) =>
        endpoint.WithMetadata(new AdminAuditMetadata(feature));
});

The named policies must be registered by the host through ASP.NET Core authorization. The framework's default feature policies continue to use IAdminPermissionProvider and deny access unless permissions are explicitly granted.

All endpoints are grouped under RoutePrefix and require authorization:

  • Search aggregates: POST /aggregates/search
  • Aggregate details: GET /aggregates/{aggregateType}/{aggregateId}
  • Event range: GET /aggregates/{aggregateType}/{aggregateId}/events
  • Project at version: GET /aggregates/{aggregateType}/{aggregateId}/projection?version={version}
  • Project at time: GET /aggregates/{aggregateType}/{aggregateId}/projection/time?asOfUtc={utcTimestamp}
  • Export events: GET /aggregates/{aggregateType}/{aggregateId}/events/export (JSON Lines, application/x-ndjson)

Request validation

Request contracts (AggregateSearchRequest, EventRangeRequest) are validated with source-generated ZodSharp schemas driven by DataAnnotations. Invalid requests return RFC 7807 application/problem+json with 400 Bad Request. Validation covers:

  • Page and PageSize must be positive; PageSize is clamped to AdminPagingOptions.MaxPageSize
  • VersionFrom/VersionTo must be positive and VersionFrom <= VersionTo when both are present
  • FromUtc/ToUtc must satisfy FromUtc <= ToUtc when both are present
  • Sort must match a field asc|desc shape
  • Projection asOfUtc must be a UTC timestamp (zero offset)

404 Not Found is returned only when the aggregate stream does not exist; malformed input returns 400.

OpenAPI

The Admin API exposes a dedicated OpenAPI document for typed-client generation:

builder.Services.AddPurviewEventSourcingAdminOpenApi();
app.MapOpenApi(); // /openapi/admin.json

The document contains only the Admin API paths, declares a global bearer security requirement, and is consumed by the generated Purview.EventSourcing.Admin.Client package (NSwag).

Dependencies

You must also register:

  • An admin storage adapter (for example Purview.EventSourcing.Admin.SqlServer) that provides the IAdminAggregateQueryService, IAdminEventQueryService, and IAdminProjectionService implementations.
  • The authorization policies defined in Purview.EventSourcing.Admin.Security.

Request validation uses ZodSharp; ZodSharp, ZodSharp.AspNetCore, and ZodSharp.SystemTextJson are direct dependencies of this package.

  • Admin abstractions: Purview.EventSourcing.Admin.Abstractions
  • Admin client: Purview.EventSourcing.Admin.Client
  • Admin security: Purview.EventSourcing.Admin.Security
  • Admin UI: Purview.EventSourcing.Admin.Site
  • Storage adapters: Purview.EventSourcing.Admin.SqlServer, Purview.EventSourcing.Admin.MongoDB, Purview.EventSourcing.Admin.Postgres, Purview.EventSourcing.Admin.AzureStorage
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Purview.EventSourcing.Admin.API:

Package Downloads
Purview.EventSourcing.Admin.Site

Ready-to-use Razor Pages admin dashboard for Purview EventSourcing Admin Portal. Provides web UI for aggregate search, event inspection, and point-in-time projection queries.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-prerelease.31 0 9/12/2026
2.0.0-prerelease.30 56 9/8/2026
2.0.0-prerelease.29 80 8/3/2026