Purview.EventSourcing.Admin.API
2.0.0-prerelease.31
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
<PackageReference Include="Purview.EventSourcing.Admin.API" Version="2.0.0-prerelease.31" />
<PackageVersion Include="Purview.EventSourcing.Admin.API" Version="2.0.0-prerelease.31" />
<PackageReference Include="Purview.EventSourcing.Admin.API" />
paket add Purview.EventSourcing.Admin.API --version 2.0.0-prerelease.31
#r "nuget: Purview.EventSourcing.Admin.API, 2.0.0-prerelease.31"
#:package Purview.EventSourcing.Admin.API@2.0.0-prerelease.31
#addin nuget:?package=Purview.EventSourcing.Admin.API&version=2.0.0-prerelease.31&prerelease
#tool nuget:?package=Purview.EventSourcing.Admin.API&version=2.0.0-prerelease.31&prerelease
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; whenfalse, no endpoints are mapped (defaulttrue)RoutePrefix- route group prefix (default/admin/api)Features- per-capability toggles for search, aggregate view, event history, point-in-time projection, and exportPaging-DefaultPageSize(default50) andMaxPageSize(default500)Projections-MaxVersionsPerQuery(default10000) andMaxTimeRangePerQuery(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:
PageandPageSizemust be positive;PageSizeis clamped toAdminPagingOptions.MaxPageSizeVersionFrom/VersionTomust be positive andVersionFrom <= VersionTowhen both are presentFromUtc/ToUtcmust satisfyFromUtc <= ToUtcwhen both are presentSortmust match afield asc|descshape- Projection
asOfUtcmust 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 theIAdminAggregateQueryService,IAdminEventQueryService, andIAdminProjectionServiceimplementations. - 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.
Related packages
- 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 | Versions 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. |
-
net10.0
- Microsoft.AspNetCore.Authorization (>= 10.0.12)
- Microsoft.AspNetCore.OpenApi (>= 10.0.12)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Telemetry.Abstractions (>= 10.10.0)
- Purview.EventSourcing (>= 2.0.0-prerelease.31)
- Purview.EventSourcing.Admin.Abstractions (>= 2.0.0-prerelease.31)
- Purview.EventSourcing.Admin.Security (>= 2.0.0-prerelease.31)
- Purview.ZodSharp (>= 2.0.0-prerelease.5)
- Purview.ZodSharp.AspNetCore (>= 2.0.0-prerelease.5)
- Purview.ZodSharp.SystemTextJson (>= 2.0.0-prerelease.5)
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 |