mirror of
https://github.com/hanzo-apps/dataroom.git
synced 2026-10-30 14:47:36 +00:00
The browser upload path was the last of it. `uploadImage` called Vercel Blob's `upload`, which round-tripped a client token through their storage; it now presigns against our own bucket and PUTs straight to it — the shape /api/file/s3/get-presigned-post-url already uses for documents. That route wants a teamId and a docId, which an avatar has neither of, so images keep their own entry point at /api/file/image-upload, rewritten from a Vercel token minter into a presigner. The limits Vercel used to enforce when it issued the token are kept: content type is checked at the route, and size is checked client-side for a decent error — but the store is what actually enforces it, because the browser's word on how big a file is has never been worth anything. /api/file/browser-upload is deleted rather than ported: nothing called it. The six remaining `put()` calls in the webhooks service (meta images and favicons) write through putFileServer. package.json now has no @vercel/* dependency at all — functions, edge-config and blob are all out, lockfile regenerated. Verified with npx tsc --noEmit: 99 before, 99 after, and PER-FILE error counts are identical — which is the check that survives both the line shifts from added imports and the type-rendering churn that made five untouched files look new. Co-authored-by: Hanzo Dev <[email protected]>