fix: remove @sofa/core and @sofa/api deps from public-api to fix Vercel runtime compatibility

- Drop `@sofa/core` and `@sofa/api` from `apps/public-api` — importing workspace packages with DB/Node dependencies broke the Vercel edge runtime
- `fetchUserData` on Trakt and Simkl importers now returns raw `unknown` API responses; parsing is deferred to the self-hosted server
- Add `source` + `rawPayload` fields to `ParsePayloadInput`; `parsePayload` procedure now dispatches to `parseTraktPayload`/`parseSimklPayload` and returns full warnings + diagnostics
- Export `ProviderEnum` from `apps/public-api/src/importers/index.ts` instead of defining it inline in `app.ts`
This commit is contained in:
2026-03-23 12:48:04 -04:00
parent 9df1075040
commit cc8909d64e
19 changed files with 250 additions and 396 deletions
+2 -2
View File
@@ -749,9 +749,9 @@ export const contract = {
method: "POST",
path: "/imports/parse-payload",
tags: ["Imports"],
summary: "Preview normalized import data",
summary: "Parse raw OAuth import data",
description:
"Accept pre-normalized import data from the OAuth proxy and return a preview with item counts. No parsing is needed — data is already in NormalizedImport format.",
"Accept raw API responses from the OAuth proxy, parse them into normalized import format, and return a preview with item counts.",
successDescription: "Preview of importable items with counts",
})
.input(ParsePayloadInput)
+2 -1
View File
@@ -1048,7 +1048,8 @@ export const ParseFileInput = z.object({
});
export const ParsePayloadInput = z.object({
data: NormalizedImportSchema,
source: z.enum(["trakt", "simkl"]).describe("OAuth import provider"),
rawPayload: z.unknown().describe("Raw aggregated API response from the OAuth proxy"),
});
export const ImportJobStatusEnum = z.enum(["pending", "running", "success", "error", "cancelled"]);