mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-22 05:26:17 +00:00
The endpoint map and validation schemas have fallen behind what the web app actually exchanges with the API: - the memories grid and the X-bookmarks status query filter @post/documents/documents by `categories`, a field DocumentsWithMemoriesQuerySchema doesn't declare — both smuggle it past client validation with disableValidation, and any future caller that forgets the flag gets the key silently stripped and a filter that no-ops - @post/documents/documents/facets was never registered: DocumentFacetsQuerySchema sits unused in the validation package while the grid calls the endpoint as an untyped raw URL and hand-casts the response - @patch/documents/:id was never registered even though MemoryUpdateSchema exists for exactly this pairing; the document-edit and file-metadata mutations PATCH via template-literal URLs with no request/response typing Add `categories` to the documents query schema, introduce DocumentFacetSchema/DocumentFacetsResponseSchema (total optional — the UI already guards its absence) and register the facets endpoint with the previously-dead query schema, register @patch/documents/:id with MemoryUpdateSchema/MemoryResponseSchema/params, and convert both PATCH call sites to the typed route. The existing disableValidation flags are deliberately left in place: every current caller of @post/documents/documents sets one, so output validation has never been exercised against production responses; removing them is a follow-up that needs verification against the live API. With the schemas now truthful, that cleanup becomes mechanical. Tested: bun test in packages/validation (12 pass, 4 new), tsc --noEmit on packages/validation, bun test + bun run build in apps/web, biome clean on all touched files. |
||
|---|---|---|
| .. | ||
| app | ||
| components | ||
| hooks | ||
| lib | ||
| public | ||
| stores | ||
| .env.example | ||
| .gitignore | ||
| biome.json | ||
| components.json | ||
| globals.css | ||
| instrumentation-client.ts | ||
| middleware.ts | ||
| next.config.ts | ||
| open-next.config.ts | ||
| package.json | ||
| postcss.config.mjs | ||
| README.md | ||
| tsconfig.json | ||
| wrangler.jsonc | ||