@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,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Delete Wiki Page Comment Tool
|
|
4
|
+
* Delete 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.deleteWikiPageCommentTool = exports.deleteWikiPageCommentSchema = void 0;
|
|
41
|
+
exports.deleteWikiPageCommentHandler = deleteWikiPageCommentHandler;
|
|
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.deleteWikiPageCommentSchema = zod_1.z.object({
|
|
46
|
+
wikiId: zod_1.z.string().describe('Wiki ID'),
|
|
47
|
+
pageId: zod_1.z.string().describe('Page ID'),
|
|
48
|
+
commentId: zod_1.z.string().describe('Comment ID'),
|
|
49
|
+
});
|
|
50
|
+
async function deleteWikiPageCommentHandler(args) {
|
|
51
|
+
try {
|
|
52
|
+
await wikiApi.deleteWikiPageComment(args.wikiId, args.pageId, args.commentId);
|
|
53
|
+
return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: 'Comment deleted successfully' }, 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.deleteWikiPageCommentTool = {
|
|
60
|
+
name: 'delete-wiki-page-comment',
|
|
61
|
+
description: 'Delete a comment on a wiki page.',
|
|
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
|
+
commentId: { type: 'string', description: 'Comment ID (required)' },
|
|
68
|
+
},
|
|
69
|
+
required: ['wikiId', 'pageId', 'commentId'],
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=delete-wiki-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-wiki-comment.js","sourceRoot":"","sources":["../../../src/tools/wiki/delete-wiki-comment.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcH,oEAOC;AAnBD,6BAAwB;AACxB,2DAA6C;AA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E,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;SACpE;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC;KAC5C;CACF,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Wiki Page File Tool
|
|
3
|
+
* Delete a file attached to a wiki page
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const deleteWikiPageFileSchema: z.ZodObject<{
|
|
7
|
+
wikiId: z.ZodString;
|
|
8
|
+
pageId: z.ZodString;
|
|
9
|
+
fileId: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
fileId: string;
|
|
12
|
+
wikiId: string;
|
|
13
|
+
pageId: string;
|
|
14
|
+
}, {
|
|
15
|
+
fileId: string;
|
|
16
|
+
wikiId: string;
|
|
17
|
+
pageId: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type DeleteWikiPageFileInput = z.infer<typeof deleteWikiPageFileSchema>;
|
|
20
|
+
export declare function deleteWikiPageFileHandler(args: DeleteWikiPageFileInput): 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 deleteWikiPageFileTool: {
|
|
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
|
+
fileId: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=delete-wiki-page-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-wiki-page-file.d.ts","sourceRoot":"","sources":["../../../src/tools/wiki/delete-wiki-page-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE/E,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,uBAAuB;;;;;;;;;;;;GA8B5E;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;CAqClC,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Delete Wiki Page File Tool
|
|
4
|
+
* Delete a file attached to 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.deleteWikiPageFileTool = exports.deleteWikiPageFileSchema = void 0;
|
|
41
|
+
exports.deleteWikiPageFileHandler = deleteWikiPageFileHandler;
|
|
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.deleteWikiPageFileSchema = zod_1.z.object({
|
|
46
|
+
wikiId: zod_1.z.string().describe('Wiki ID'),
|
|
47
|
+
pageId: zod_1.z.string().describe('Wiki page ID'),
|
|
48
|
+
fileId: zod_1.z.string().describe('File ID to delete (from page detail API: $.result.files.id or $.result.images.id)'),
|
|
49
|
+
});
|
|
50
|
+
async function deleteWikiPageFileHandler(args) {
|
|
51
|
+
try {
|
|
52
|
+
await wikiApi.deleteWikiPageFile(args.wikiId, args.pageId, args.fileId);
|
|
53
|
+
return {
|
|
54
|
+
content: [
|
|
55
|
+
{
|
|
56
|
+
type: 'text',
|
|
57
|
+
text: JSON.stringify({
|
|
58
|
+
success: true,
|
|
59
|
+
message: `File ${args.fileId} successfully deleted from wiki page.`,
|
|
60
|
+
}, null, 2),
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
return {
|
|
67
|
+
content: [
|
|
68
|
+
{
|
|
69
|
+
type: 'text',
|
|
70
|
+
text: `Error: ${(0, errors_js_1.formatError)(error)}`,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
isError: true,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.deleteWikiPageFileTool = {
|
|
78
|
+
name: 'delete-wiki-page-file',
|
|
79
|
+
description: `Delete a file attached to a Dooray wiki page.
|
|
80
|
+
|
|
81
|
+
**Required Parameters:**
|
|
82
|
+
- wikiId: The wiki ID
|
|
83
|
+
- pageId: The wiki page ID
|
|
84
|
+
- fileId: The file ID to delete (get from wiki page detail API: $.result.files.id or $.result.images.id)
|
|
85
|
+
|
|
86
|
+
**Example:**
|
|
87
|
+
{
|
|
88
|
+
"wikiId": "123456",
|
|
89
|
+
"pageId": "789012",
|
|
90
|
+
"fileId": "abc123"
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
**Returns:** Success message confirming deletion.
|
|
94
|
+
|
|
95
|
+
**Note:** This action is irreversible. The file will be permanently removed from the wiki page.`,
|
|
96
|
+
inputSchema: {
|
|
97
|
+
type: 'object',
|
|
98
|
+
properties: {
|
|
99
|
+
wikiId: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
description: 'Wiki ID',
|
|
102
|
+
},
|
|
103
|
+
pageId: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
description: 'Wiki page ID',
|
|
106
|
+
},
|
|
107
|
+
fileId: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
description: 'File ID to delete',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
required: ['wikiId', 'pageId', 'fileId'],
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=delete-wiki-page-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-wiki-page-file.js","sourceRoot":"","sources":["../../../src/tools/wiki/delete-wiki-page-file.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcH,8DA8BC;AA1CD,6BAAwB;AACxB,2DAA6C;AAC7C,qDAAoD;AAEvC,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IAC3C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mFAAmF,CAAC;CACjH,CAAC,CAAC;AAII,KAAK,UAAU,yBAAyB,CAAC,IAA6B;IAC3E,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,kBAAkB,CAC9B,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,CACZ,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,QAAQ,IAAI,CAAC,MAAM,uCAAuC;qBACpE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACZ;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAU,IAAA,uBAAW,EAAC,KAAK,CAAC,EAAE;iBACrC;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC;AAEY,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE;;;;;;;;;;;;;;;;gGAgBiF;IAC9F,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,SAAS;aACvB;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,cAAc;aAC5B;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mBAAmB;aACjC;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC;KACzC;CACF,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Download Wiki Attach File Tool
|
|
3
|
+
* Download a file from wiki using attachFileId
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const downloadWikiAttachFileSchema: z.ZodObject<{
|
|
7
|
+
wikiId: z.ZodString;
|
|
8
|
+
attachFileId: z.ZodString;
|
|
9
|
+
savePath: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
wikiId: string;
|
|
12
|
+
attachFileId: string;
|
|
13
|
+
savePath?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
wikiId: string;
|
|
16
|
+
attachFileId: string;
|
|
17
|
+
savePath?: string | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export type DownloadWikiAttachFileInput = z.infer<typeof downloadWikiAttachFileSchema>;
|
|
20
|
+
export declare function downloadWikiAttachFileHandler(args: DownloadWikiAttachFileInput): 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 downloadWikiAttachFileTool: {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: string;
|
|
38
|
+
properties: {
|
|
39
|
+
wikiId: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
attachFileId: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
savePath: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=download-wiki-attach-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-wiki-attach-file.d.ts","sourceRoot":"","sources":["../../../src/tools/wiki/download-wiki-attach-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;EAIvC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAqBvF,wBAAsB,6BAA6B,CAAC,IAAI,EAAE,2BAA2B;;;;;;;;;;;;GA0EpF;AAED,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;CAkCtC,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Download Wiki Attach File Tool
|
|
4
|
+
* Download a file from wiki using attachFileId
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
|
+
};
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.downloadWikiAttachFileTool = exports.downloadWikiAttachFileSchema = void 0;
|
|
44
|
+
exports.downloadWikiAttachFileHandler = downloadWikiAttachFileHandler;
|
|
45
|
+
const zod_1 = require("zod");
|
|
46
|
+
const fs_1 = __importDefault(require("fs"));
|
|
47
|
+
const path_1 = __importDefault(require("path"));
|
|
48
|
+
const wikiApi = __importStar(require("../../api/wiki.js"));
|
|
49
|
+
const errors_js_1 = require("../../utils/errors.js");
|
|
50
|
+
exports.downloadWikiAttachFileSchema = zod_1.z.object({
|
|
51
|
+
wikiId: zod_1.z.string().describe('Wiki ID'),
|
|
52
|
+
attachFileId: zod_1.z.string().describe('Attach file ID (from page detail API: $.result.files.attachFileId or $.result.images.attachFileId)'),
|
|
53
|
+
savePath: zod_1.z.string().optional().describe('Local file path to save the downloaded file. If omitted, returns base64 data (only suitable for small files)'),
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Extract filename from Content-Disposition header
|
|
57
|
+
*/
|
|
58
|
+
function extractFilename(contentDisposition) {
|
|
59
|
+
if (!contentDisposition)
|
|
60
|
+
return undefined;
|
|
61
|
+
const filenameMatch = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);
|
|
62
|
+
if (filenameMatch) {
|
|
63
|
+
let filename = filenameMatch[1].replace(/['"]/g, '');
|
|
64
|
+
try {
|
|
65
|
+
filename = decodeURIComponent(filename);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// If decoding fails, use as-is
|
|
69
|
+
}
|
|
70
|
+
return filename;
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
async function downloadWikiAttachFileHandler(args) {
|
|
75
|
+
try {
|
|
76
|
+
const result = await wikiApi.downloadWikiAttachFile(args.wikiId, args.attachFileId);
|
|
77
|
+
const filename = extractFilename(result.contentDisposition);
|
|
78
|
+
if (args.savePath) {
|
|
79
|
+
let targetPath = args.savePath;
|
|
80
|
+
const isDirectory = targetPath.endsWith('/') ||
|
|
81
|
+
(fs_1.default.existsSync(targetPath) && fs_1.default.statSync(targetPath).isDirectory());
|
|
82
|
+
if (isDirectory) {
|
|
83
|
+
if (!fs_1.default.existsSync(targetPath)) {
|
|
84
|
+
fs_1.default.mkdirSync(targetPath, { recursive: true });
|
|
85
|
+
}
|
|
86
|
+
targetPath = path_1.default.join(targetPath, filename || `wiki-attach-${args.attachFileId}`);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const dir = path_1.default.dirname(targetPath);
|
|
90
|
+
if (!fs_1.default.existsSync(dir)) {
|
|
91
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
fs_1.default.writeFileSync(targetPath, Buffer.from(result.data));
|
|
95
|
+
return {
|
|
96
|
+
content: [
|
|
97
|
+
{
|
|
98
|
+
type: 'text',
|
|
99
|
+
text: JSON.stringify({
|
|
100
|
+
success: true,
|
|
101
|
+
attachFileId: args.attachFileId,
|
|
102
|
+
filename: filename,
|
|
103
|
+
contentType: result.contentType,
|
|
104
|
+
contentLength: result.contentLength,
|
|
105
|
+
savedTo: targetPath,
|
|
106
|
+
message: `File saved to "${targetPath}" (${result.contentLength} bytes)`,
|
|
107
|
+
}, null, 2),
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const base64Data = Buffer.from(result.data).toString('base64');
|
|
113
|
+
return {
|
|
114
|
+
content: [
|
|
115
|
+
{
|
|
116
|
+
type: 'text',
|
|
117
|
+
text: JSON.stringify({
|
|
118
|
+
success: true,
|
|
119
|
+
attachFileId: args.attachFileId,
|
|
120
|
+
filename: filename,
|
|
121
|
+
contentType: result.contentType,
|
|
122
|
+
contentLength: result.contentLength,
|
|
123
|
+
base64Data: base64Data,
|
|
124
|
+
}, null, 2),
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
return {
|
|
131
|
+
content: [
|
|
132
|
+
{
|
|
133
|
+
type: 'text',
|
|
134
|
+
text: `Error: ${(0, errors_js_1.formatError)(error)}`,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
isError: true,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.downloadWikiAttachFileTool = {
|
|
142
|
+
name: 'download-wiki-attach-file',
|
|
143
|
+
description: `Download a file from a Dooray wiki using attach file ID.
|
|
144
|
+
|
|
145
|
+
**Required Parameters:**
|
|
146
|
+
- wikiId: The wiki ID
|
|
147
|
+
- attachFileId: The attach file ID (get from wiki page detail API: $.result.files.attachFileId or $.result.images.attachFileId)
|
|
148
|
+
|
|
149
|
+
**Optional:**
|
|
150
|
+
- savePath: Local path to save the file. Can be a directory (filename auto-detected) or full file path. **Recommended for large files.**
|
|
151
|
+
|
|
152
|
+
**Examples:**
|
|
153
|
+
- Save to file: { "wikiId": "123", "attachFileId": "456", "savePath": "/tmp/downloads/" }
|
|
154
|
+
- Base64 (small files): { "wikiId": "123", "attachFileId": "456" }
|
|
155
|
+
|
|
156
|
+
**Note:** The attachFileId is different from fileId. Use this endpoint when you have an attachFileId from the page detail API's $.result.files.attachFileId or $.result.images.attachFileId field.`,
|
|
157
|
+
inputSchema: {
|
|
158
|
+
type: 'object',
|
|
159
|
+
properties: {
|
|
160
|
+
wikiId: {
|
|
161
|
+
type: 'string',
|
|
162
|
+
description: 'Wiki ID',
|
|
163
|
+
},
|
|
164
|
+
attachFileId: {
|
|
165
|
+
type: 'string',
|
|
166
|
+
description: 'Attach file ID (from page detail API)',
|
|
167
|
+
},
|
|
168
|
+
savePath: {
|
|
169
|
+
type: 'string',
|
|
170
|
+
description: 'Local path to save (directory or full path). Recommended for large files.',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
required: ['wikiId', 'attachFileId'],
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
//# sourceMappingURL=download-wiki-attach-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2EAA2E;aACzF;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,cAAc,CAAC;KACrC;CACF,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Download Wiki Page File Tool
|
|
3
|
+
* Download a file attached to a wiki page
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const downloadWikiPageFileSchema: z.ZodObject<{
|
|
7
|
+
wikiId: z.ZodString;
|
|
8
|
+
pageId: z.ZodString;
|
|
9
|
+
fileId: z.ZodString;
|
|
10
|
+
savePath: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
fileId: string;
|
|
13
|
+
wikiId: string;
|
|
14
|
+
pageId: string;
|
|
15
|
+
savePath?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
fileId: string;
|
|
18
|
+
wikiId: string;
|
|
19
|
+
pageId: string;
|
|
20
|
+
savePath?: string | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export type DownloadWikiPageFileInput = z.infer<typeof downloadWikiPageFileSchema>;
|
|
23
|
+
export declare function downloadWikiPageFileHandler(args: DownloadWikiPageFileInput): Promise<{
|
|
24
|
+
content: {
|
|
25
|
+
type: string;
|
|
26
|
+
text: string;
|
|
27
|
+
}[];
|
|
28
|
+
isError?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
content: {
|
|
31
|
+
type: string;
|
|
32
|
+
text: string;
|
|
33
|
+
}[];
|
|
34
|
+
isError: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const downloadWikiPageFileTool: {
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: string;
|
|
41
|
+
properties: {
|
|
42
|
+
wikiId: {
|
|
43
|
+
type: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
pageId: {
|
|
47
|
+
type: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
fileId: {
|
|
51
|
+
type: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
savePath: {
|
|
55
|
+
type: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
required: string[];
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=download-wiki-page-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-wiki-page-file.d.ts","sourceRoot":"","sources":["../../../src/tools/wiki/download-wiki-page-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EAKrC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAqBnF,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,yBAAyB;;;;;;;;;;;;GA2EhF;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;CA8CpC,CAAC"}
|