diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b1f655..adbaa6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht ## [Unreleased] +### Removed +- **Section-header / banner comment noise (~30 lines).** Cleared the empty-divider `// ──────────────────────────────────────────────────` separators in `DashboardMessagesController`, `DashboardAnalyticsController`, `DashboardEndpointController` (5 banners), and the `// ============================================================` banner pairs in `WebhookEngine.Sdk/Models.cs` (5 banners — Response envelope, Event Types, Endpoints, Messages, Common query parameters). All carried no `WHY` content; class names and IDE folding already cover navigation. Section-titled banners in test files (`// ── Read paths ──`, `// ── Plumbing ──`, etc.) are preserved as deliberate test-grouping markers. + ### Changed - **`PATCH /api/v1/portal/endpoints/{id}` replaces `PUT`.** Portal endpoint update was tagged `[HttpPut]` but its body semantics were partial-replace (every field optional, only non-null fields applied) — that is the contract for `PATCH`, not `PUT`. Switching the method aligns the wire surface with the actual behaviour and avoids confusing REST consumers that expect `PUT` to be full-replace. The route, request shape, and response shape are unchanged. Minor breaking change for any direct HTTP caller hitting this route; the embeddable `` component already uses the new method. - **`POST /api/v1/dashboard/applications/{appId}/portal/disable` no longer wipes `AllowedPortalOriginsJson`.** Disable revokes the auth surface (`PortalSigningKey` + `PortalRotatedAt`) but preserves the operator-curated CORS allowlist so a re-enable doesn't lose origin configuration. To explicitly clear the allowlist, send `PUT /portal/origins` with `{"origins": []}`. The audit log entry's `before/after` snapshot still records the change accurately. diff --git a/src/WebhookEngine.API/Controllers/DashboardAnalyticsController.cs b/src/WebhookEngine.API/Controllers/DashboardAnalyticsController.cs index 3047f91..1e49b6a 100644 --- a/src/WebhookEngine.API/Controllers/DashboardAnalyticsController.cs +++ b/src/WebhookEngine.API/Controllers/DashboardAnalyticsController.cs @@ -90,10 +90,6 @@ ORDER BY 1 return Ok(ApiEnvelope.Success(HttpContext, new { buckets })); } - // ────────────────────────────────────────────────── - // Helper - // ────────────────────────────────────────────────── - private static (DateTime StartTime, int IntervalMinutes) ParseTimelineParams(string period, string interval) { var startTime = period switch diff --git a/src/WebhookEngine.API/Controllers/DashboardEndpointController.cs b/src/WebhookEngine.API/Controllers/DashboardEndpointController.cs index df0fe52..58d6c74 100644 --- a/src/WebhookEngine.API/Controllers/DashboardEndpointController.cs +++ b/src/WebhookEngine.API/Controllers/DashboardEndpointController.cs @@ -54,10 +54,6 @@ public DashboardEndpointController( _auditLogger = auditLogger; } - // ────────────────────────────────────────────────── - // Endpoints (cross-app, for dashboard admin) - // ────────────────────────────────────────────────── - [HttpGet("endpoints")] public async Task ListEndpoints( [FromQuery] Guid? appId, @@ -364,10 +360,6 @@ public async Task TestEndpoint( return Ok(ApiEnvelope.Success(HttpContext, result)); } - // ────────────────────────────────────────────────── - // Payload Transformation - // ────────────────────────────────────────────────── - [HttpPost("transform/validate")] public IActionResult ValidateTransform([FromBody] ValidateTransformRequest request) { @@ -381,10 +373,6 @@ public IActionResult ValidateTransform([FromBody] ValidateTransformRequest reque })); } - // ────────────────────────────────────────────────── - // Event Types - // ────────────────────────────────────────────────── - [HttpGet("event-types")] public async Task ListEventTypes( [FromQuery] Guid appId, diff --git a/src/WebhookEngine.API/Controllers/DashboardMessagesController.cs b/src/WebhookEngine.API/Controllers/DashboardMessagesController.cs index 502c41d..d0529be 100644 --- a/src/WebhookEngine.API/Controllers/DashboardMessagesController.cs +++ b/src/WebhookEngine.API/Controllers/DashboardMessagesController.cs @@ -42,10 +42,6 @@ public DashboardMessagesController( _messageQueue = messageQueue; } - // ────────────────────────────────────────────────── - // Messages (cross-app, for dashboard admin) - // ────────────────────────────────────────────────── - [HttpGet("messages")] public async Task ListMessages( [FromQuery] Guid? appId, diff --git a/src/WebhookEngine.Sdk/Models.cs b/src/WebhookEngine.Sdk/Models.cs index ede5e33..bfb51e0 100644 --- a/src/WebhookEngine.Sdk/Models.cs +++ b/src/WebhookEngine.Sdk/Models.cs @@ -3,10 +3,6 @@ namespace WebhookEngine.Sdk; -// ============================================================ -// Response envelope -// ============================================================ - public class ApiResponse { public T? Data { get; set; } @@ -43,10 +39,6 @@ public class ApiErrorDetail public string? Message { get; set; } } -// ============================================================ -// Event Types -// ============================================================ - public class CreateEventTypeRequest { public string Name { get; set; } = string.Empty; @@ -71,10 +63,6 @@ public class EventTypeResponse public DateTime CreatedAt { get; set; } } -// ============================================================ -// Endpoints -// ============================================================ - public class CreateEndpointRequest { public string Url { get; set; } = string.Empty; @@ -121,10 +109,6 @@ public class EndpointStatsResponse public double P95LatencyMs { get; set; } } -// ============================================================ -// Messages -// ============================================================ - public class SendMessageRequest { public string EventType { get; set; } = string.Empty; @@ -228,10 +212,6 @@ public class MessageAttemptResponse public DateTime CreatedAt { get; set; } } -// ============================================================ -// Common query parameters -// ============================================================ - public class ListOptions { public int Page { get; set; } = 1;