mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-07-14 18:15:56 -04:00
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:
@@ -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)
|
||||
|
||||
@@ -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"]);
|
||||
|
||||
Reference in New Issue
Block a user