14 lines
695 B
C#
14 lines
695 B
C#
using FastEndpoints;
|
|
using Kbx.Shared.Telemetry;
|
|
namespace Kbx.Modules.Common.UxTelemetry.Ingest;
|
|
public sealed class Endpoint(KbxUxTelemetryRepository repository) : Endpoint<KbxUxEventBatchRequest>
|
|
{
|
|
public override void Configure(){Post("/api/kbx/ux/events");Permissions("common.telemetry.write");}
|
|
public override async Task HandleAsync(KbxUxEventBatchRequest req,CancellationToken ct)
|
|
{
|
|
// Replace with the deployment's authenticated tenant accessor.
|
|
var tenantId=Kbx.Shared.Runtime.RuntimeIdentity.TenantId(User);
|
|
await repository.AppendAsync(tenantId,Kbx.Shared.Runtime.RuntimeIdentity.UserId(User),req.Events,ct);await Send.NoContentAsync(ct);
|
|
}
|
|
}
|