fix(vapron): rebuild platform client against published tRPC API #4077
ccantynzcommented Jun 10, 2026
Originally written by @vercel[bot] on GitHub.
Deployment failed with the following error:
There is no GitHub account connected to this Vercel account.ccantynzcommented Jun 10, 2026
Originally written by @vercel[bot] on GitHub.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| alec-rae-com-admin | Preview, Comment | Jun 10, 2026 9:17am |
Cross-repo impact
See what breaks downstream if this PR merges.
⮌ Merged
This pull request was merged into main.
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts
Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/AlecRae.com/pull/54
What
Resolves Known Issue #19 — the Vapron platform client was built to a guessed spec and was wrong on transport. This rebuilds it against the real API from the Vapron integration guide.
The problem
The old client talked to
https://api.vapron.ai/api/platform/<thing>with raw JSON bodies. The real platform is a tRPC API with a superjson envelope. Every call would have failed against the live service.Changes
apps/api/src/lib/vapron.ts— rebuilt transport + surface:https://api.vapron.ai/api/trpc{ "json": { ...params } }envelope; GET queries pass?input=<urlenc {"json":...}>result.data.json(tolerant of plainer shapes){ error: { json: { message, data: { code, httpStatus } } } }envelopecustomerEmail.send,aiGateway.complete,objectStorage.listBuckets/objectStorage.createBucket,aiDeploy.quickDeploysecrets.get— there is no such procedure; Vapron secrets are runtime env vars, not API-fetchedai.complete()returns normalized{ text, raw }; text extraction tolerates Anthropic / OpenAI / plaintext|content|completionshapes pending live-call confirmationclaude-sonnet-4-6per the guideapps/api/src/lib/ai.ts— fallback path now callsvapron.ai.complete()and reads.text.Tests — rewritten for the tRPC envelope (
vapron.test.ts), updated fixtures (ai.test.ts,transactional-email.test.ts). All 115 API tests pass.Config —
VAPRON_BASE_URLin.env.productionnow points at/api/trpc.Note on response shapes
The AI-gateway response shape isn't documented, so extraction is deliberately tolerant. The first live call should confirm the actual shape so we can tighten the Zod schema (carried forward in issue #19's note).
Verification
bun run test— 115/115 ✅bun run typecheck— ✅bun run lint— 0 errors (pre-existingconsolewarnings only, none in changed files)bun run docs:check— ✅https://claude.ai/code/session_01McgJLnTbZG9mwhfwd5iAX3
Generated by Claude Code