@geonheeye/dooray-mcp 0.1.13
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/LICENSE +21 -0
- package/README.md +149 -0
- package/dist/api/client.d.ts +85 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +272 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/common.d.ts +14 -0
- package/dist/api/common.d.ts.map +1 -0
- package/dist/api/common.js +25 -0
- package/dist/api/common.js.map +1 -0
- package/dist/api/drive.d.ts +22 -0
- package/dist/api/drive.d.ts.map +1 -0
- package/dist/api/drive.js +86 -0
- package/dist/api/drive.js.map +1 -0
- package/dist/api/messenger.d.ts +56 -0
- package/dist/api/messenger.d.ts.map +1 -0
- package/dist/api/messenger.js +49 -0
- package/dist/api/messenger.js.map +1 -0
- package/dist/api/projects.d.ts +147 -0
- package/dist/api/projects.d.ts.map +1 -0
- package/dist/api/projects.js +485 -0
- package/dist/api/projects.js.map +1 -0
- package/dist/api/wiki.d.ts +38 -0
- package/dist/api/wiki.d.ts.map +1 -0
- package/dist/api/wiki.js +139 -0
- package/dist/api/wiki.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +736 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/common/get-my-member-info.d.ts +29 -0
- package/dist/tools/common/get-my-member-info.d.ts.map +1 -0
- package/dist/tools/common/get-my-member-info.js +95 -0
- package/dist/tools/common/get-my-member-info.js.map +1 -0
- package/dist/tools/drive/copy-drive-file.d.ts +62 -0
- package/dist/tools/drive/copy-drive-file.d.ts.map +1 -0
- package/dist/tools/drive/copy-drive-file.js +91 -0
- package/dist/tools/drive/copy-drive-file.js.map +1 -0
- package/dist/tools/drive/create-drive-folder.d.ts +55 -0
- package/dist/tools/drive/create-drive-folder.d.ts.map +1 -0
- package/dist/tools/drive/create-drive-folder.js +91 -0
- package/dist/tools/drive/create-drive-folder.js.map +1 -0
- package/dist/tools/drive/delete-drive-file.d.ts +48 -0
- package/dist/tools/drive/delete-drive-file.d.ts.map +1 -0
- package/dist/tools/drive/delete-drive-file.js +87 -0
- package/dist/tools/drive/delete-drive-file.js.map +1 -0
- package/dist/tools/drive/download-drive-file.d.ts +55 -0
- package/dist/tools/drive/download-drive-file.d.ts.map +1 -0
- package/dist/tools/drive/download-drive-file.js +160 -0
- package/dist/tools/drive/download-drive-file.js.map +1 -0
- package/dist/tools/drive/get-drive-file-list.d.ts +77 -0
- package/dist/tools/drive/get-drive-file-list.d.ts.map +1 -0
- package/dist/tools/drive/get-drive-file-list.js +89 -0
- package/dist/tools/drive/get-drive-file-list.js.map +1 -0
- package/dist/tools/drive/get-drive-file-meta.d.ts +41 -0
- package/dist/tools/drive/get-drive-file-meta.d.ts.map +1 -0
- package/dist/tools/drive/get-drive-file-meta.js +74 -0
- package/dist/tools/drive/get-drive-file-meta.js.map +1 -0
- package/dist/tools/drive/get-drive-list.d.ts +63 -0
- package/dist/tools/drive/get-drive-list.d.ts.map +1 -0
- package/dist/tools/drive/get-drive-list.js +84 -0
- package/dist/tools/drive/get-drive-list.js.map +1 -0
- package/dist/tools/drive/move-drive-file.d.ts +55 -0
- package/dist/tools/drive/move-drive-file.d.ts.map +1 -0
- package/dist/tools/drive/move-drive-file.js +92 -0
- package/dist/tools/drive/move-drive-file.js.map +1 -0
- package/dist/tools/drive/rename-drive-file.d.ts +55 -0
- package/dist/tools/drive/rename-drive-file.d.ts.map +1 -0
- package/dist/tools/drive/rename-drive-file.js +88 -0
- package/dist/tools/drive/rename-drive-file.js.map +1 -0
- package/dist/tools/drive/update-drive-file.d.ts +55 -0
- package/dist/tools/drive/update-drive-file.d.ts.map +1 -0
- package/dist/tools/drive/update-drive-file.js +119 -0
- package/dist/tools/drive/update-drive-file.js.map +1 -0
- package/dist/tools/drive/upload-drive-file.d.ts +55 -0
- package/dist/tools/drive/upload-drive-file.d.ts.map +1 -0
- package/dist/tools/drive/upload-drive-file.js +118 -0
- package/dist/tools/drive/upload-drive-file.js.map +1 -0
- package/dist/tools/messenger/get-channel-messages.d.ts +55 -0
- package/dist/tools/messenger/get-channel-messages.d.ts.map +1 -0
- package/dist/tools/messenger/get-channel-messages.js +115 -0
- package/dist/tools/messenger/get-channel-messages.js.map +1 -0
- package/dist/tools/messenger/get-channels.d.ts +30 -0
- package/dist/tools/messenger/get-channels.d.ts.map +1 -0
- package/dist/tools/messenger/get-channels.js +87 -0
- package/dist/tools/messenger/get-channels.js.map +1 -0
- package/dist/tools/messenger/send-channel-message.d.ts +48 -0
- package/dist/tools/messenger/send-channel-message.d.ts.map +1 -0
- package/dist/tools/messenger/send-channel-message.js +108 -0
- package/dist/tools/messenger/send-channel-message.js.map +1 -0
- package/dist/tools/messenger/send-direct-message.d.ts +48 -0
- package/dist/tools/messenger/send-direct-message.d.ts.map +1 -0
- package/dist/tools/messenger/send-direct-message.js +112 -0
- package/dist/tools/messenger/send-direct-message.js.map +1 -0
- package/dist/tools/projects/create-project-template.d.ts +305 -0
- package/dist/tools/projects/create-project-template.d.ts.map +1 -0
- package/dist/tools/projects/create-project-template.js +262 -0
- package/dist/tools/projects/create-project-template.js.map +1 -0
- package/dist/tools/projects/create-tag.d.ts +55 -0
- package/dist/tools/projects/create-tag.d.ts.map +1 -0
- package/dist/tools/projects/create-tag.js +134 -0
- package/dist/tools/projects/create-tag.js.map +1 -0
- package/dist/tools/projects/create-task-comment.d.ts +92 -0
- package/dist/tools/projects/create-task-comment.d.ts.map +1 -0
- package/dist/tools/projects/create-task-comment.js +171 -0
- package/dist/tools/projects/create-task-comment.js.map +1 -0
- package/dist/tools/projects/create-task.d.ts +198 -0
- package/dist/tools/projects/create-task.d.ts.map +1 -0
- package/dist/tools/projects/create-task.js +230 -0
- package/dist/tools/projects/create-task.js.map +1 -0
- package/dist/tools/projects/delete-attachment.d.ts +55 -0
- package/dist/tools/projects/delete-attachment.d.ts.map +1 -0
- package/dist/tools/projects/delete-attachment.js +115 -0
- package/dist/tools/projects/delete-attachment.js.map +1 -0
- package/dist/tools/projects/delete-project-template.d.ts +48 -0
- package/dist/tools/projects/delete-project-template.d.ts.map +1 -0
- package/dist/tools/projects/delete-project-template.js +108 -0
- package/dist/tools/projects/delete-project-template.js.map +1 -0
- package/dist/tools/projects/download-attachment.d.ts +62 -0
- package/dist/tools/projects/download-attachment.d.ts.map +1 -0
- package/dist/tools/projects/download-attachment.js +195 -0
- package/dist/tools/projects/download-attachment.js.map +1 -0
- package/dist/tools/projects/get-attachment-list.d.ts +48 -0
- package/dist/tools/projects/get-attachment-list.d.ts.map +1 -0
- package/dist/tools/projects/get-attachment-list.js +118 -0
- package/dist/tools/projects/get-attachment-list.js.map +1 -0
- package/dist/tools/projects/get-attachment-metadata.d.ts +55 -0
- package/dist/tools/projects/get-attachment-metadata.d.ts.map +1 -0
- package/dist/tools/projects/get-attachment-metadata.js +120 -0
- package/dist/tools/projects/get-attachment-metadata.js.map +1 -0
- package/dist/tools/projects/get-milestone-list.d.ts +49 -0
- package/dist/tools/projects/get-milestone-list.d.ts.map +1 -0
- package/dist/tools/projects/get-milestone-list.js +112 -0
- package/dist/tools/projects/get-milestone-list.js.map +1 -0
- package/dist/tools/projects/get-project-list.d.ts +50 -0
- package/dist/tools/projects/get-project-list.d.ts.map +1 -0
- package/dist/tools/projects/get-project-list.js +113 -0
- package/dist/tools/projects/get-project-list.js.map +1 -0
- package/dist/tools/projects/get-project-member-group-list.d.ts +55 -0
- package/dist/tools/projects/get-project-member-group-list.d.ts.map +1 -0
- package/dist/tools/projects/get-project-member-group-list.js +127 -0
- package/dist/tools/projects/get-project-member-group-list.js.map +1 -0
- package/dist/tools/projects/get-project-member-list.d.ts +66 -0
- package/dist/tools/projects/get-project-member-list.d.ts.map +1 -0
- package/dist/tools/projects/get-project-member-list.js +159 -0
- package/dist/tools/projects/get-project-member-list.js.map +1 -0
- package/dist/tools/projects/get-project-template-list.d.ts +55 -0
- package/dist/tools/projects/get-project-template-list.d.ts.map +1 -0
- package/dist/tools/projects/get-project-template-list.js +127 -0
- package/dist/tools/projects/get-project-template-list.js.map +1 -0
- package/dist/tools/projects/get-project-template.d.ts +48 -0
- package/dist/tools/projects/get-project-template.d.ts.map +1 -0
- package/dist/tools/projects/get-project-template.js +132 -0
- package/dist/tools/projects/get-project-template.js.map +1 -0
- package/dist/tools/projects/get-project-workflow-list.d.ts +41 -0
- package/dist/tools/projects/get-project-workflow-list.d.ts.map +1 -0
- package/dist/tools/projects/get-project-workflow-list.js +107 -0
- package/dist/tools/projects/get-project-workflow-list.js.map +1 -0
- package/dist/tools/projects/get-project.d.ts +41 -0
- package/dist/tools/projects/get-project.d.ts.map +1 -0
- package/dist/tools/projects/get-project.js +110 -0
- package/dist/tools/projects/get-project.js.map +1 -0
- package/dist/tools/projects/get-tag-list.d.ts +55 -0
- package/dist/tools/projects/get-tag-list.d.ts.map +1 -0
- package/dist/tools/projects/get-tag-list.js +145 -0
- package/dist/tools/projects/get-tag-list.js.map +1 -0
- package/dist/tools/projects/get-tag.d.ts +48 -0
- package/dist/tools/projects/get-tag.d.ts.map +1 -0
- package/dist/tools/projects/get-tag.js +124 -0
- package/dist/tools/projects/get-tag.js.map +1 -0
- package/dist/tools/projects/get-task-comment-list.d.ts +63 -0
- package/dist/tools/projects/get-task-comment-list.d.ts.map +1 -0
- package/dist/tools/projects/get-task-comment-list.js +136 -0
- package/dist/tools/projects/get-task-comment-list.js.map +1 -0
- package/dist/tools/projects/get-task-list.d.ts +184 -0
- package/dist/tools/projects/get-task-list.d.ts.map +1 -0
- package/dist/tools/projects/get-task-list.js +257 -0
- package/dist/tools/projects/get-task-list.js.map +1 -0
- package/dist/tools/projects/get-task.d.ts +48 -0
- package/dist/tools/projects/get-task.d.ts.map +1 -0
- package/dist/tools/projects/get-task.js +130 -0
- package/dist/tools/projects/get-task.js.map +1 -0
- package/dist/tools/projects/update-project-template.d.ts +312 -0
- package/dist/tools/projects/update-project-template.d.ts.map +1 -0
- package/dist/tools/projects/update-project-template.js +266 -0
- package/dist/tools/projects/update-project-template.js.map +1 -0
- package/dist/tools/projects/update-tag-group.d.ts +62 -0
- package/dist/tools/projects/update-tag-group.d.ts.map +1 -0
- package/dist/tools/projects/update-tag-group.js +162 -0
- package/dist/tools/projects/update-tag-group.js.map +1 -0
- package/dist/tools/projects/update-task-comment.d.ts +92 -0
- package/dist/tools/projects/update-task-comment.d.ts.map +1 -0
- package/dist/tools/projects/update-task-comment.js +176 -0
- package/dist/tools/projects/update-task-comment.js.map +1 -0
- package/dist/tools/projects/update-task.d.ts +203 -0
- package/dist/tools/projects/update-task.d.ts.map +1 -0
- package/dist/tools/projects/update-task.js +261 -0
- package/dist/tools/projects/update-task.js.map +1 -0
- package/dist/tools/projects/upload-attachment.d.ts +55 -0
- package/dist/tools/projects/upload-attachment.d.ts.map +1 -0
- package/dist/tools/projects/upload-attachment.js +143 -0
- package/dist/tools/projects/upload-attachment.js.map +1 -0
- package/dist/tools/wiki/create-wiki-comment.d.ts +55 -0
- package/dist/tools/wiki/create-wiki-comment.d.ts.map +1 -0
- package/dist/tools/wiki/create-wiki-comment.js +72 -0
- package/dist/tools/wiki/create-wiki-comment.js.map +1 -0
- package/dist/tools/wiki/create-wiki-page.d.ts +127 -0
- package/dist/tools/wiki/create-wiki-page.d.ts.map +1 -0
- package/dist/tools/wiki/create-wiki-page.js +116 -0
- package/dist/tools/wiki/create-wiki-page.js.map +1 -0
- package/dist/tools/wiki/delete-wiki-comment.d.ts +55 -0
- package/dist/tools/wiki/delete-wiki-comment.d.ts.map +1 -0
- package/dist/tools/wiki/delete-wiki-comment.js +72 -0
- package/dist/tools/wiki/delete-wiki-comment.js.map +1 -0
- package/dist/tools/wiki/delete-wiki-page-file.d.ts +55 -0
- package/dist/tools/wiki/delete-wiki-page-file.d.ts.map +1 -0
- package/dist/tools/wiki/delete-wiki-page-file.js +115 -0
- package/dist/tools/wiki/delete-wiki-page-file.js.map +1 -0
- package/dist/tools/wiki/download-wiki-attach-file.d.ts +55 -0
- package/dist/tools/wiki/download-wiki-attach-file.d.ts.map +1 -0
- package/dist/tools/wiki/download-wiki-attach-file.js +176 -0
- package/dist/tools/wiki/download-wiki-attach-file.js.map +1 -0
- package/dist/tools/wiki/download-wiki-page-file.d.ts +62 -0
- package/dist/tools/wiki/download-wiki-page-file.d.ts.map +1 -0
- package/dist/tools/wiki/download-wiki-page-file.js +189 -0
- package/dist/tools/wiki/download-wiki-page-file.js.map +1 -0
- package/dist/tools/wiki/get-wiki-comment-list.d.ts +62 -0
- package/dist/tools/wiki/get-wiki-comment-list.d.ts.map +1 -0
- package/dist/tools/wiki/get-wiki-comment-list.js +74 -0
- package/dist/tools/wiki/get-wiki-comment-list.js.map +1 -0
- package/dist/tools/wiki/get-wiki-comment.d.ts +55 -0
- package/dist/tools/wiki/get-wiki-comment.d.ts.map +1 -0
- package/dist/tools/wiki/get-wiki-comment.js +72 -0
- package/dist/tools/wiki/get-wiki-comment.js.map +1 -0
- package/dist/tools/wiki/get-wiki-list.d.ts +47 -0
- package/dist/tools/wiki/get-wiki-list.d.ts.map +1 -0
- package/dist/tools/wiki/get-wiki-list.js +76 -0
- package/dist/tools/wiki/get-wiki-list.js.map +1 -0
- package/dist/tools/wiki/get-wiki-page-list.d.ts +48 -0
- package/dist/tools/wiki/get-wiki-page-list.d.ts.map +1 -0
- package/dist/tools/wiki/get-wiki-page-list.js +70 -0
- package/dist/tools/wiki/get-wiki-page-list.js.map +1 -0
- package/dist/tools/wiki/get-wiki-page.d.ts +48 -0
- package/dist/tools/wiki/get-wiki-page.d.ts.map +1 -0
- package/dist/tools/wiki/get-wiki-page.js +78 -0
- package/dist/tools/wiki/get-wiki-page.js.map +1 -0
- package/dist/tools/wiki/update-wiki-comment.d.ts +62 -0
- package/dist/tools/wiki/update-wiki-comment.d.ts.map +1 -0
- package/dist/tools/wiki/update-wiki-comment.js +74 -0
- package/dist/tools/wiki/update-wiki-comment.js.map +1 -0
- package/dist/tools/wiki/update-wiki-page.d.ts +117 -0
- package/dist/tools/wiki/update-wiki-page.d.ts.map +1 -0
- package/dist/tools/wiki/update-wiki-page.js +111 -0
- package/dist/tools/wiki/update-wiki-page.js.map +1 -0
- package/dist/tools/wiki/upload-wiki-file.d.ts +49 -0
- package/dist/tools/wiki/upload-wiki-file.d.ts.map +1 -0
- package/dist/tools/wiki/upload-wiki-file.js +145 -0
- package/dist/tools/wiki/upload-wiki-file.js.map +1 -0
- package/dist/tools/wiki/upload-wiki-page-file.d.ts +55 -0
- package/dist/tools/wiki/upload-wiki-page-file.d.ts.map +1 -0
- package/dist/tools/wiki/upload-wiki-page-file.js +147 -0
- package/dist/tools/wiki/upload-wiki-page-file.js.map +1 -0
- package/dist/types/config.d.ts +18 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +6 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/dooray-api.d.ts +717 -0
- package/dist/types/dooray-api.d.ts.map +1 -0
- package/dist/types/dooray-api.js +7 -0
- package/dist/types/dooray-api.js.map +1 -0
- package/dist/utils/errors.d.ts +28 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +60 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +22 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +50 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/member-transform.d.ts +20 -0
- package/dist/utils/member-transform.d.ts.map +1 -0
- package/dist/utils/member-transform.js +48 -0
- package/dist/utils/member-transform.js.map +1 -0
- package/dist/utils/response-filters.d.ts +105 -0
- package/dist/utils/response-filters.d.ts.map +1 -0
- package/dist/utils/response-filters.js +152 -0
- package/dist/utils/response-filters.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upload Attachment Tool
|
|
3
|
+
* Upload a file attachment to a task using curl
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const uploadAttachmentSchema: z.ZodObject<{
|
|
7
|
+
projectId: z.ZodString;
|
|
8
|
+
taskId: z.ZodString;
|
|
9
|
+
filePath: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
projectId: string;
|
|
12
|
+
taskId: string;
|
|
13
|
+
filePath: string;
|
|
14
|
+
}, {
|
|
15
|
+
projectId: string;
|
|
16
|
+
taskId: string;
|
|
17
|
+
filePath: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type UploadAttachmentInput = z.infer<typeof uploadAttachmentSchema>;
|
|
20
|
+
export declare function uploadAttachmentHandler(args: UploadAttachmentInput): Promise<{
|
|
21
|
+
content: {
|
|
22
|
+
type: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
content: {
|
|
28
|
+
type: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
isError: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const uploadAttachmentTool: {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: string;
|
|
38
|
+
properties: {
|
|
39
|
+
projectId: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
taskId: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
filePath: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=upload-attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-attachment.d.ts","sourceRoot":"","sources":["../../../src/tools/projects/upload-attachment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAIjC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE3E,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB;;;;;;;;;;;;GA4FxE;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;CAqChC,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Upload Attachment Tool
|
|
4
|
+
* Upload a file attachment to a task using curl
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.uploadAttachmentTool = exports.uploadAttachmentSchema = void 0;
|
|
11
|
+
exports.uploadAttachmentHandler = uploadAttachmentHandler;
|
|
12
|
+
const zod_1 = require("zod");
|
|
13
|
+
const child_process_1 = require("child_process");
|
|
14
|
+
const util_1 = require("util");
|
|
15
|
+
const path_1 = __importDefault(require("path"));
|
|
16
|
+
const fs_1 = __importDefault(require("fs"));
|
|
17
|
+
const errors_js_1 = require("../../utils/errors.js");
|
|
18
|
+
const logger_js_1 = require("../../utils/logger.js");
|
|
19
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
20
|
+
exports.uploadAttachmentSchema = zod_1.z.object({
|
|
21
|
+
projectId: zod_1.z.string().describe('Project ID'),
|
|
22
|
+
taskId: zod_1.z.string().describe('Task ID (post ID)'),
|
|
23
|
+
filePath: zod_1.z.string().describe('Absolute path to the file to upload'),
|
|
24
|
+
});
|
|
25
|
+
async function uploadAttachmentHandler(args) {
|
|
26
|
+
try {
|
|
27
|
+
const apiToken = process.env.DOORAY_API_TOKEN;
|
|
28
|
+
if (!apiToken) {
|
|
29
|
+
throw new Error('DOORAY_API_TOKEN environment variable is required');
|
|
30
|
+
}
|
|
31
|
+
// Verify file exists
|
|
32
|
+
if (!fs_1.default.existsSync(args.filePath)) {
|
|
33
|
+
throw new Error(`File not found: ${args.filePath}`);
|
|
34
|
+
}
|
|
35
|
+
const fileName = path_1.default.basename(args.filePath);
|
|
36
|
+
const baseUrl = process.env.DOORAY_API_BASE_URL || 'https://api.dooray.com';
|
|
37
|
+
const apiUrl = `${baseUrl}/project/v1/projects/${args.projectId}/posts/${args.taskId}/files`;
|
|
38
|
+
// Step 1: Make initial request to get 307 redirect location
|
|
39
|
+
logger_js_1.logger.debug(`Upload step 1: POST ${apiUrl}`);
|
|
40
|
+
const step1Command = `curl -s -X POST '${apiUrl}' \
|
|
41
|
+
--header 'Authorization: dooray-api ${apiToken}' \
|
|
42
|
+
--form 'file=@"${args.filePath}"' \
|
|
43
|
+
-w '\\n%{http_code}\\n%{redirect_url}' \
|
|
44
|
+
-o /dev/null`;
|
|
45
|
+
const step1Result = await execAsync(step1Command);
|
|
46
|
+
const step1Lines = step1Result.stdout.trim().split('\n');
|
|
47
|
+
const httpCode = step1Lines[step1Lines.length - 2];
|
|
48
|
+
const redirectUrl = step1Lines[step1Lines.length - 1];
|
|
49
|
+
logger_js_1.logger.debug(`Step 1 response: HTTP ${httpCode}, redirect: ${redirectUrl}`);
|
|
50
|
+
let result;
|
|
51
|
+
if (httpCode === '307' && redirectUrl) {
|
|
52
|
+
// Step 2: Follow redirect and upload to file server
|
|
53
|
+
logger_js_1.logger.debug(`Upload step 2: POST ${redirectUrl}`);
|
|
54
|
+
const step2Command = `curl -s -X POST '${redirectUrl}' \
|
|
55
|
+
--header 'Authorization: dooray-api ${apiToken}' \
|
|
56
|
+
--form 'file=@"${args.filePath}"'`;
|
|
57
|
+
const step2Result = await execAsync(step2Command);
|
|
58
|
+
const response = JSON.parse(step2Result.stdout);
|
|
59
|
+
if (!response.header?.isSuccessful) {
|
|
60
|
+
throw new Error(response.header?.resultMessage || 'Upload failed');
|
|
61
|
+
}
|
|
62
|
+
result = response.result;
|
|
63
|
+
}
|
|
64
|
+
else if (httpCode === '200' || httpCode === '201') {
|
|
65
|
+
// Direct upload succeeded (no redirect)
|
|
66
|
+
const directCommand = `curl -s -X POST '${apiUrl}' \
|
|
67
|
+
--header 'Authorization: dooray-api ${apiToken}' \
|
|
68
|
+
--form 'file=@"${args.filePath}"'`;
|
|
69
|
+
const directResult = await execAsync(directCommand);
|
|
70
|
+
const response = JSON.parse(directResult.stdout);
|
|
71
|
+
if (!response.header?.isSuccessful) {
|
|
72
|
+
throw new Error(response.header?.resultMessage || 'Upload failed');
|
|
73
|
+
}
|
|
74
|
+
result = response.result;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
throw new Error(`Unexpected HTTP status: ${httpCode}`);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
content: [
|
|
81
|
+
{
|
|
82
|
+
type: 'text',
|
|
83
|
+
text: JSON.stringify({
|
|
84
|
+
success: true,
|
|
85
|
+
fileId: result.id,
|
|
86
|
+
fileName: fileName,
|
|
87
|
+
message: `File "${fileName}" successfully uploaded to task.`,
|
|
88
|
+
}, null, 2),
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
return {
|
|
95
|
+
content: [
|
|
96
|
+
{
|
|
97
|
+
type: 'text',
|
|
98
|
+
text: `Error: ${(0, errors_js_1.formatError)(error)}`,
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
isError: true,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.uploadAttachmentTool = {
|
|
106
|
+
name: 'upload-attachment',
|
|
107
|
+
description: `Upload a file attachment to a Dooray task.
|
|
108
|
+
|
|
109
|
+
**Required Parameters:**
|
|
110
|
+
- projectId: The project ID
|
|
111
|
+
- taskId: The task ID (post ID) to attach the file to
|
|
112
|
+
- filePath: Absolute path to the file to upload (e.g., "/Users/name/document.pdf")
|
|
113
|
+
|
|
114
|
+
**Example:**
|
|
115
|
+
{
|
|
116
|
+
"projectId": "123456",
|
|
117
|
+
"taskId": "789012",
|
|
118
|
+
"filePath": "/Users/nhn/Downloads/report.pdf"
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
**Returns:** File ID of the uploaded attachment.
|
|
122
|
+
|
|
123
|
+
**Note:** The file must exist at the specified path. Maximum file size depends on Dooray's server limits.`,
|
|
124
|
+
inputSchema: {
|
|
125
|
+
type: 'object',
|
|
126
|
+
properties: {
|
|
127
|
+
projectId: {
|
|
128
|
+
type: 'string',
|
|
129
|
+
description: 'Project ID',
|
|
130
|
+
},
|
|
131
|
+
taskId: {
|
|
132
|
+
type: 'string',
|
|
133
|
+
description: 'Task ID (post ID) to attach the file to',
|
|
134
|
+
},
|
|
135
|
+
filePath: {
|
|
136
|
+
type: 'string',
|
|
137
|
+
description: 'Absolute path to the file to upload',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
required: ['projectId', 'taskId', 'filePath'],
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=upload-attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-attachment.js","sourceRoot":"","sources":["../../../src/tools/projects/upload-attachment.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAoBH,0DA4FC;AA9GD,6BAAwB;AACxB,iDAAqC;AACrC,+BAAiC;AACjC,gDAAwB;AACxB,4CAAoB;AACpB,qDAAoD;AACpD,qDAA+C;AAE/C,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAErB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;IAC5C,MAAM,EAAE,OA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iki page
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const createWikiPageCommentSchema: z.ZodObject<{
|
|
7
|
+
wikiId: z.ZodString;
|
|
8
|
+
pageId: z.ZodString;
|
|
9
|
+
content: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
content: string;
|
|
12
|
+
wikiId: string;
|
|
13
|
+
pageId: string;
|
|
14
|
+
}, {
|
|
15
|
+
content: string;
|
|
16
|
+
wikiId: string;
|
|
17
|
+
pageId: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type CreateWikiPageCommentInput = z.infer<typeof createWikiPageCommentSchema>;
|
|
20
|
+
export declare function createWikiPageCommentHandler(args: CreateWikiPageCommentInput): Promise<{
|
|
21
|
+
content: {
|
|
22
|
+
type: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
content: {
|
|
28
|
+
type: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
isError: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const createWikiPageCommentTool: {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: string;
|
|
38
|
+
properties: {
|
|
39
|
+
wikiId: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
pageId: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
content: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=create-wiki-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-wiki-comment.d.ts","sourceRoot":"","sources":["../../../src/tools/wiki/create-wiki-comment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;EAItC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAErF,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,0BAA0B;;;;;;;;;;;;GAOlF;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;CAYrC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Create Wiki Page Comment Tool
|
|
4
|
+
* Create a comment on a wiki page
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.createWikiPageCommentTool = exports.createWikiPageCommentSchema = void 0;
|
|
41
|
+
exports.createWikiPageCommentHandler = createWikiPageCommentHandler;
|
|
42
|
+
const zod_1 = require("zod");
|
|
43
|
+
const wikiApi = __importStar(require("../../api/wiki.js"));
|
|
44
|
+
const errors_js_1 = require("../../utils/errors.js");
|
|
45
|
+
exports.createWikiPageCommentSchema = zod_1.z.object({
|
|
46
|
+
wikiId: zod_1.z.string().describe('Wiki ID'),
|
|
47
|
+
pageId: zod_1.z.string().describe('Page ID'),
|
|
48
|
+
content: zod_1.z.string().describe('Comment content (markdown)'),
|
|
49
|
+
});
|
|
50
|
+
async function createWikiPageCommentHandler(args) {
|
|
51
|
+
try {
|
|
52
|
+
const result = await wikiApi.createWikiPageComment(args);
|
|
53
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return { content: [{ type: 'text', text: `Error: ${(0, errors_js_1.formatError)(error)}` }], isError: true };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.createWikiPageCommentTool = {
|
|
60
|
+
name: 'create-wiki-page-comment',
|
|
61
|
+
description: 'Create a comment on a wiki page. Content is in markdown format. Returns: id.',
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: {
|
|
65
|
+
wikiId: { type: 'string', description: 'Wiki ID (required)' },
|
|
66
|
+
pageId: { type: 'string', description: 'Wiki page ID (required)' },
|
|
67
|
+
content: { type: 'string', description: 'Comment content in markdown (required)' },
|
|
68
|
+
},
|
|
69
|
+
required: ['wikiId', 'pageId', 'content'],
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=create-wiki-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-wiki-comment.js","sourceRoot":"","sources":["../../../src/tools/wiki/create-wiki-comment.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcH,oEAOC;AAnBD,6BAAwB;AACxB,2DAA6C;AAC7C,qDAAoD;AAEvC,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CAC3D,CAAC,CAAC;AAII,KAAK,UAAU,4BAA4B,CAAC,IAAgC;IACjF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACzD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,IAAA,uBAAW,EAAC,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC9F,CAAC;AACH,CAAC;AAEY,QAAA,yBAAyB,GAAG;IACvC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,8EAA8E;IAC3F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;YAC7D,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE;YAClE,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;SACnF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC;KAC1C;CACF,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Wiki Page Tool
|
|
3
|
+
* Create a new wiki page
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const createWikiPageSchema: z.ZodObject<{
|
|
7
|
+
wikiId: z.ZodString;
|
|
8
|
+
subject: z.ZodString;
|
|
9
|
+
content: z.ZodString;
|
|
10
|
+
parentPageId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
attachFileIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
+
referrers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"member">;
|
|
14
|
+
member: z.ZodObject<{
|
|
15
|
+
organizationMemberId: z.ZodString;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
organizationMemberId: string;
|
|
18
|
+
}, {
|
|
19
|
+
organizationMemberId: string;
|
|
20
|
+
}>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
member: {
|
|
23
|
+
organizationMemberId: string;
|
|
24
|
+
};
|
|
25
|
+
type: "member";
|
|
26
|
+
}, {
|
|
27
|
+
member: {
|
|
28
|
+
organizationMemberId: string;
|
|
29
|
+
};
|
|
30
|
+
type: "member";
|
|
31
|
+
}>, "many">>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
subject: string;
|
|
34
|
+
content: string;
|
|
35
|
+
wikiId: string;
|
|
36
|
+
attachFileIds?: string[] | undefined;
|
|
37
|
+
parentPageId?: string | undefined;
|
|
38
|
+
referrers?: {
|
|
39
|
+
member: {
|
|
40
|
+
organizationMemberId: string;
|
|
41
|
+
};
|
|
42
|
+
type: "member";
|
|
43
|
+
}[] | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
subject: string;
|
|
46
|
+
content: string;
|
|
47
|
+
wikiId: string;
|
|
48
|
+
attachFileIds?: string[] | undefined;
|
|
49
|
+
parentPageId?: string | undefined;
|
|
50
|
+
referrers?: {
|
|
51
|
+
member: {
|
|
52
|
+
organizationMemberId: string;
|
|
53
|
+
};
|
|
54
|
+
type: "member";
|
|
55
|
+
}[] | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
export type CreateWikiPageInput = z.infer<typeof createWikiPageSchema>;
|
|
58
|
+
export declare function createWikiPageHandler(args: CreateWikiPageInput): Promise<{
|
|
59
|
+
content: {
|
|
60
|
+
type: string;
|
|
61
|
+
text: string;
|
|
62
|
+
}[];
|
|
63
|
+
isError?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
content: {
|
|
66
|
+
type: string;
|
|
67
|
+
text: string;
|
|
68
|
+
}[];
|
|
69
|
+
isError: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
export declare const createWikiPageTool: {
|
|
72
|
+
name: string;
|
|
73
|
+
description: string;
|
|
74
|
+
inputSchema: {
|
|
75
|
+
type: string;
|
|
76
|
+
properties: {
|
|
77
|
+
wikiId: {
|
|
78
|
+
type: string;
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
subject: {
|
|
82
|
+
type: string;
|
|
83
|
+
description: string;
|
|
84
|
+
};
|
|
85
|
+
content: {
|
|
86
|
+
type: string;
|
|
87
|
+
description: string;
|
|
88
|
+
};
|
|
89
|
+
parentPageId: {
|
|
90
|
+
type: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
attachFileIds: {
|
|
94
|
+
type: string;
|
|
95
|
+
items: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
description: string;
|
|
99
|
+
};
|
|
100
|
+
referrers: {
|
|
101
|
+
type: string;
|
|
102
|
+
items: {
|
|
103
|
+
type: string;
|
|
104
|
+
properties: {
|
|
105
|
+
type: {
|
|
106
|
+
type: string;
|
|
107
|
+
const: string;
|
|
108
|
+
};
|
|
109
|
+
member: {
|
|
110
|
+
type: string;
|
|
111
|
+
properties: {
|
|
112
|
+
organizationMemberId: {
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
required: string[];
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
required: string[];
|
|
120
|
+
};
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
required: string[];
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=create-wiki-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-wiki-page.d.ts","sourceRoot":"","sources":["../../../src/tools/wiki/create-wiki-page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB;;;;;;;;;;;;GAcpE;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C9B,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Create Wiki Page Tool
|
|
4
|
+
* Create a new wiki page
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.createWikiPageTool = exports.createWikiPageSchema = void 0;
|
|
41
|
+
exports.createWikiPageHandler = createWikiPageHandler;
|
|
42
|
+
const zod_1 = require("zod");
|
|
43
|
+
const wikiApi = __importStar(require("../../api/wiki.js"));
|
|
44
|
+
const errors_js_1 = require("../../utils/errors.js");
|
|
45
|
+
const referrerSchema = zod_1.z.object({
|
|
46
|
+
type: zod_1.z.literal('member'),
|
|
47
|
+
member: zod_1.z.object({ organizationMemberId: zod_1.z.string() }),
|
|
48
|
+
});
|
|
49
|
+
exports.createWikiPageSchema = zod_1.z.object({
|
|
50
|
+
wikiId: zod_1.z.string().describe('Wiki ID'),
|
|
51
|
+
subject: zod_1.z.string().describe('Page title'),
|
|
52
|
+
content: zod_1.z.string().describe('Page content (markdown)'),
|
|
53
|
+
parentPageId: zod_1.z.string().optional().describe('Parent page ID'),
|
|
54
|
+
attachFileIds: zod_1.z.array(zod_1.z.string()).optional().describe('Attachment file IDs'),
|
|
55
|
+
referrers: zod_1.z.array(referrerSchema).optional().describe('Referrers (watchers)'),
|
|
56
|
+
});
|
|
57
|
+
async function createWikiPageHandler(args) {
|
|
58
|
+
try {
|
|
59
|
+
const result = await wikiApi.createWikiPage({
|
|
60
|
+
wikiId: args.wikiId,
|
|
61
|
+
subject: args.subject,
|
|
62
|
+
body: { mimeType: 'text/x-markdown', content: args.content },
|
|
63
|
+
parentPageId: args.parentPageId,
|
|
64
|
+
attachFileIds: args.attachFileIds,
|
|
65
|
+
referrers: args.referrers,
|
|
66
|
+
});
|
|
67
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return { content: [{ type: 'text', text: `Error: ${(0, errors_js_1.formatError)(error)}` }], isError: true };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.createWikiPageTool = {
|
|
74
|
+
name: 'create-wiki-page',
|
|
75
|
+
description: `Create a new wiki page.
|
|
76
|
+
|
|
77
|
+
**Required**: wikiId, subject, content
|
|
78
|
+
**Optional**: attachFileIds, referrers
|
|
79
|
+
|
|
80
|
+
**IMPORTANT - parentPageId**:
|
|
81
|
+
- parentPageId is practically required for creating new pages
|
|
82
|
+
- Without parentPageId, API returns 400 error ("입력한 내용에 오류가 있습니다")
|
|
83
|
+
- To create a page, first use get-wiki-page-list to find the parent page (e.g., Home page)
|
|
84
|
+
- Then provide that page's ID as parentPageId
|
|
85
|
+
|
|
86
|
+
**Workflow**:
|
|
87
|
+
1. Call get-wiki-list to get wikiId
|
|
88
|
+
2. Call get-wiki-page-list with wikiId to find parent page (usually "Home")
|
|
89
|
+
3. Call create-wiki-page with parentPageId set to the Home page ID
|
|
90
|
+
|
|
91
|
+
Content is in markdown format. Returns: id, wikiId, parentPageId, version.`,
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: 'object',
|
|
94
|
+
properties: {
|
|
95
|
+
wikiId: { type: 'string', description: 'Wiki ID (required)' },
|
|
96
|
+
subject: { type: 'string', description: 'Page title (required)' },
|
|
97
|
+
content: { type: 'string', description: 'Page content in markdown (required)' },
|
|
98
|
+
parentPageId: { type: 'string', description: 'Parent page ID (practically required - without this, API returns 400 error)' },
|
|
99
|
+
attachFileIds: { type: 'array', items: { type: 'string' }, description: 'Attachment IDs' },
|
|
100
|
+
referrers: {
|
|
101
|
+
type: 'array',
|
|
102
|
+
items: {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {
|
|
105
|
+
type: { type: 'string', const: 'member' },
|
|
106
|
+
member: { type: 'object', properties: { organizationMemberId: { type: 'string' } }, required: ['organizationMemberId'] },
|
|
107
|
+
},
|
|
108
|
+
required: ['type', 'member'],
|
|
109
|
+
},
|
|
110
|
+
description: 'Referrers (watchers)',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
required: ['wikiId', 'subject', 'content'],
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=create-wiki-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-wiki-page.js","sourceRoot":"","sources":["../../../src/tools/wiki/create-wiki-page.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBH,sDAcC;AAlCD,6BAAwB;AACxB,2DAA6C;AAC7C,qDAAoD;AAEpD,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC;CACvD,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;IAC1C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACvD,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC9D,aAAa,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAC7E,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;CAC/E,CAAC,CAAC;AAII,KAAK,UAAU,qBAAqB,CAAC,IAAyB;IACnE,IAAI,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,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE;YAC1F,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;wBACzC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,sBAAsB,CAAC,EAAE;qBACzH;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;iBAC7B;gBACD,WAAW,EAAE,sBAAsB;aACpC;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;KAC3C;CACF,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Wiki Page Comment Tool
|
|
3
|
+
* Delete a comment on a wiki page
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const deleteWikiPageCommentSchema: z.ZodObject<{
|
|
7
|
+
wikiId: z.ZodString;
|
|
8
|
+
pageId: z.ZodString;
|
|
9
|
+
commentId: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
commentId: string;
|
|
12
|
+
wikiId: string;
|
|
13
|
+
pageId: string;
|
|
14
|
+
}, {
|
|
15
|
+
commentId: string;
|
|
16
|
+
wikiId: string;
|
|
17
|
+
pageId: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type DeleteWikiPageCommentInput = z.infer<typeof deleteWikiPageCommentSchema>;
|
|
20
|
+
export declare function deleteWikiPageCommentHandler(args: DeleteWikiPageCommentInput): Promise<{
|
|
21
|
+
content: {
|
|
22
|
+
type: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
content: {
|
|
28
|
+
type: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
isError: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const deleteWikiPageCommentTool: {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: string;
|
|
38
|
+
properties: {
|
|
39
|
+
wikiId: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
pageId: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
commentId: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=delete-wiki-comment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-wiki-comment.d.ts","sourceRoot":"","sources":["../../../src/tools/wiki/delete-wiki-comment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;EAItC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAErF,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,0BAA0B;;;;;;;;;;;;GAOlF;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;CAYrC,CAAC"}
|