affine-mcp-server 1.2.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -23
- package/bin/affine-mcp +0 -0
- package/dist/index.js +1 -3
- package/dist/tools/accessTokens.js +3 -23
- package/dist/tools/auth.js +0 -8
- package/dist/tools/blobStorage.js +59 -35
- package/dist/tools/comments.js +4 -48
- package/dist/tools/docs.js +331 -197
- package/dist/tools/history.js +0 -36
- package/dist/tools/notifications.js +25 -54
- package/dist/tools/user.js +0 -5
- package/dist/tools/userCRUD.js +20 -152
- package/dist/tools/workspaces.js +35 -106
- package/dist/ws.js +25 -3
- package/package.json +15 -5
- package/dist/tools/updates.js +0 -32
package/dist/tools/updates.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { text } from "../util/mcp.js";
|
|
3
|
-
export function registerUpdateTools(server, gql, defaults) {
|
|
4
|
-
const applyDocUpdatesHandler = async (parsed) => {
|
|
5
|
-
const workspaceId = parsed.workspaceId || defaults.workspaceId || parsed.workspaceId;
|
|
6
|
-
if (!workspaceId)
|
|
7
|
-
throw new Error("workspaceId required (or set AFFINE_WORKSPACE_ID)");
|
|
8
|
-
const query = `query Apply($workspaceId:String!,$docId:String!,$op:String!,$updates:String!){ applyDocUpdates(workspaceId:$workspaceId, docId:$docId, op:$op, updates:$updates) }`;
|
|
9
|
-
const data = await gql.request(query, { workspaceId, docId: parsed.docId, op: parsed.op, updates: parsed.updates });
|
|
10
|
-
return text(data.applyDocUpdates);
|
|
11
|
-
};
|
|
12
|
-
server.registerTool("affine_apply_doc_updates", {
|
|
13
|
-
title: "Apply Document Updates",
|
|
14
|
-
description: "Apply CRDT updates to a doc (advanced).",
|
|
15
|
-
inputSchema: {
|
|
16
|
-
workspaceId: z.string().optional(),
|
|
17
|
-
docId: z.string(),
|
|
18
|
-
op: z.string(),
|
|
19
|
-
updates: z.string()
|
|
20
|
-
}
|
|
21
|
-
}, applyDocUpdatesHandler);
|
|
22
|
-
server.registerTool("apply_doc_updates", {
|
|
23
|
-
title: "Apply Document Updates",
|
|
24
|
-
description: "Apply CRDT updates to a doc (advanced).",
|
|
25
|
-
inputSchema: {
|
|
26
|
-
workspaceId: z.string().optional(),
|
|
27
|
-
docId: z.string(),
|
|
28
|
-
op: z.string(),
|
|
29
|
-
updates: z.string()
|
|
30
|
-
}
|
|
31
|
-
}, applyDocUpdatesHandler);
|
|
32
|
-
}
|