feat(api): CRM parity mutations and recent-errors filters (BIT-726)

Add POST /api/error-monitoring/resolve, bulk-resolve, and purge-resolved with
resolve key or admin JWT (errors:triage / errors:delete). Extend GET
recent-errors with status, severity, project_slug, q, offset, and stable
ordering. Document contracts in api/docs/ERROR_MONITORING_PUBLIC_API.md;
add vitest for public auth helpers. Proxy new routes and widen admin-ui
middleware for /api/error-monitoring/*.

Paperclip-Issue: BIT-726
Paperclip-Run: 3fbf92be-736e-4b11-8e90-cf993d8cd5ca
Paperclip-Agent: Pedro Alves (id d706f4e6-5d05-4cec-b6e8-f8fb1f203aae)
Made-with: Cursor
This commit is contained in:
David Santos committed 2026-04-02 10:50:06 +00:00
1 parent e0af92eda1
commit 8b0044be82
10 files changed
+919 -49

No files matched your search

+2 -2
View File
@@ -22,8 +22,8 @@ function _allowWithoutSession(): boolean {
export function middleware(request: NextRequest) {
const { pathname } = request.nextUrl;
/** Paperclip error loop + CRM contract: JSON GET with api_key; must not 307 to /login. */
if (pathname.startsWith("/api/error-monitoring/recent-errors")) {
/** Paperclip + CRM contract: JSON with api_key on Fastify; proxy routes must not 307 to /login. */
if (pathname.startsWith("/api/error-monitoring/")) {
return NextResponse.next();
}