diff options
| author | Dhravya Shah <[email protected]> | 2025-09-15 19:02:24 -0700 |
|---|---|---|
| committer | Dhravya Shah <[email protected]> | 2025-09-15 19:02:24 -0700 |
| commit | 27ea75b4a2d46de9d49388bb6a750d7a1bdb152a (patch) | |
| tree | 8aae321a3e57b7676dc79ccac2a09a85cc7e5556 /packages | |
| parent | Merge branch 'main' of https://github.com/supermemoryai/supermemory (diff) | |
| download | supermemory-27ea75b4a2d46de9d49388bb6a750d7a1bdb152a.tar.xz supermemory-27ea75b4a2d46de9d49388bb6a750d7a1bdb152a.zip | |
change /memories to /documents, remove unwanted dependency, biome format
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/lib/api.ts | 14 | ||||
| -rw-r--r-- | packages/lib/queries.ts | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/packages/lib/api.ts b/packages/lib/api.ts index e6ca8555..ad343050 100644 --- a/packages/lib/api.ts +++ b/packages/lib/api.ts @@ -127,11 +127,11 @@ export const apiSchema = createSchema({ output: SettingsResponseSchema, }, // Memory operations - "@post/memories": { + "@post/documents": { input: MemoryAddSchema, output: MemoryResponseSchema, }, - "@post/memories/list": { + "@post/documents/list": { body: z .object({ limit: z.number().optional(), @@ -142,11 +142,11 @@ export const apiSchema = createSchema({ .optional(), output: ListMemoriesResponseSchema, }, - "@post/memories/documents": { + "@post/documents/documents": { input: DocumentsWithMemoriesQuerySchema, output: DocumentsWithMemoriesResponseSchema, }, - "@post/memories/documents/by-ids": { + "@post/documents/documents/by-ids": { input: z.object({ ids: z.array(z.string()), by: z.enum(["id", "customId"]).optional(), @@ -154,13 +154,13 @@ export const apiSchema = createSchema({ }), output: DocumentsWithMemoriesResponseSchema, }, - "@post/memories/migrate-mcp": { + "@post/documents/migrate-mcp": { input: MigrateMCPRequestSchema, output: MigrateMCPResponseSchema, }, // Delete a memory - "@delete/memories/:id": { + "@delete/documents/:id": { output: z.any(), // 204 No-Content params: z.object({ id: z.string() }), }, @@ -200,7 +200,7 @@ export const apiSchema = createSchema({ output: z.object({ message: z.string(), }), - } + }, }) export const $fetch = createFetch({ diff --git a/packages/lib/queries.ts b/packages/lib/queries.ts index 0902f378..3e9e1ab9 100644 --- a/packages/lib/queries.ts +++ b/packages/lib/queries.ts @@ -1,9 +1,9 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query" import type { useCustomer } from "autumn-js/react" -import { $fetch } from "./api" import { toast } from "sonner" -import type { DocumentsWithMemoriesResponseSchema } from "../validation/api" import type { z } from "zod" +import type { DocumentsWithMemoriesResponseSchema } from "../validation/api" +import { $fetch } from "./api" type DocumentsResponse = z.infer<typeof DocumentsWithMemoriesResponseSchema> type DocumentWithMemories = DocumentsResponse["documents"][0] @@ -98,7 +98,7 @@ export const useDeleteDocument = (selectedProject: string) => { return useMutation({ mutationFn: async (documentId: string) => { // context for LLM: delete/memories/:documentId is documents delete endpoint not memories delete endpoint - const response = await $fetch(`@delete/memories/${documentId}`) + const response = await $fetch(`@delete/documents/${documentId}`) if (response.error) { throw new Error(response.error?.message || "Failed to delete document") } |