refactor: migrate route handlers to internal tRPC procedures#585
refactor: migrate route handlers to internal tRPC procedures#585jeevanpillay wants to merge 1 commit intomainfrom
Conversation
Move all business logic from 4 platform route handlers into internal tRPC procedures (webhooks.ingest, oauth.buildAuthorizeUrl, oauth.processCallback, oauth.pollResult). Route handlers become thin HTTP adapters that parse requests and delegate to platform.* procedures. Also fixes manual err instanceof Error ternary in oauth/callback.ts with parseError(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: e4e1e7876791
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note
|
Summary
webhooks.ingest,oauth.buildAuthorizeUrl,oauth.processCallback,oauth.pollResult)err instanceof Errorternary inoauth/callback.tswithparseError()Changes
New files:
api/platform/src/router/internal/webhooks.ts— webhook ingestion procedure (HMAC verification, DB persist, Inngest dispatch)api/platform/src/router/internal/oauth.ts— OAuth authorize, callback, and poll proceduresModified files:
api/platform/src/internal.ts— replaced ping PoC with real sub-routers (webhooks, oauth)api/platform/src/lib/oauth/callback.ts—parseError(err)replaces manual ternaryplatform.*proceduresArchitecture
Test plan
pnpm --filter @api/platform typecheckpassespnpm --filter @lightfast/platform typecheckpassespnpm build:platformpassespnpm checkpasses (lint/format)@db/app,@api/platform/lib, or Inngest client imports in route handlers🤖 Generated with Claude Code