@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.
Files changed (287) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +149 -0
  3. package/dist/api/client.d.ts +85 -0
  4. package/dist/api/client.d.ts.map +1 -0
  5. package/dist/api/client.js +272 -0
  6. package/dist/api/client.js.map +1 -0
  7. package/dist/api/common.d.ts +14 -0
  8. package/dist/api/common.d.ts.map +1 -0
  9. package/dist/api/common.js +25 -0
  10. package/dist/api/common.js.map +1 -0
  11. package/dist/api/drive.d.ts +22 -0
  12. package/dist/api/drive.d.ts.map +1 -0
  13. package/dist/api/drive.js +86 -0
  14. package/dist/api/drive.js.map +1 -0
  15. package/dist/api/messenger.d.ts +56 -0
  16. package/dist/api/messenger.d.ts.map +1 -0
  17. package/dist/api/messenger.js +49 -0
  18. package/dist/api/messenger.js.map +1 -0
  19. package/dist/api/projects.d.ts +147 -0
  20. package/dist/api/projects.d.ts.map +1 -0
  21. package/dist/api/projects.js +485 -0
  22. package/dist/api/projects.js.map +1 -0
  23. package/dist/api/wiki.d.ts +38 -0
  24. package/dist/api/wiki.d.ts.map +1 -0
  25. package/dist/api/wiki.js +139 -0
  26. package/dist/api/wiki.js.map +1 -0
  27. package/dist/index.d.ts +7 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +736 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/tools/common/get-my-member-info.d.ts +29 -0
  32. package/dist/tools/common/get-my-member-info.d.ts.map +1 -0
  33. package/dist/tools/common/get-my-member-info.js +95 -0
  34. package/dist/tools/common/get-my-member-info.js.map +1 -0
  35. package/dist/tools/drive/copy-drive-file.d.ts +62 -0
  36. package/dist/tools/drive/copy-drive-file.d.ts.map +1 -0
  37. package/dist/tools/drive/copy-drive-file.js +91 -0
  38. package/dist/tools/drive/copy-drive-file.js.map +1 -0
  39. package/dist/tools/drive/create-drive-folder.d.ts +55 -0
  40. package/dist/tools/drive/create-drive-folder.d.ts.map +1 -0
  41. package/dist/tools/drive/create-drive-folder.js +91 -0
  42. package/dist/tools/drive/create-drive-folder.js.map +1 -0
  43. package/dist/tools/drive/delete-drive-file.d.ts +48 -0
  44. package/dist/tools/drive/delete-drive-file.d.ts.map +1 -0
  45. package/dist/tools/drive/delete-drive-file.js +87 -0
  46. package/dist/tools/drive/delete-drive-file.js.map +1 -0
  47. package/dist/tools/drive/download-drive-file.d.ts +55 -0
  48. package/dist/tools/drive/download-drive-file.d.ts.map +1 -0
  49. package/dist/tools/drive/download-drive-file.js +160 -0
  50. package/dist/tools/drive/download-drive-file.js.map +1 -0
  51. package/dist/tools/drive/get-drive-file-list.d.ts +77 -0
  52. package/dist/tools/drive/get-drive-file-list.d.ts.map +1 -0
  53. package/dist/tools/drive/get-drive-file-list.js +89 -0
  54. package/dist/tools/drive/get-drive-file-list.js.map +1 -0
  55. package/dist/tools/drive/get-drive-file-meta.d.ts +41 -0
  56. package/dist/tools/drive/get-drive-file-meta.d.ts.map +1 -0
  57. package/dist/tools/drive/get-drive-file-meta.js +74 -0
  58. package/dist/tools/drive/get-drive-file-meta.js.map +1 -0
  59. package/dist/tools/drive/get-drive-list.d.ts +63 -0
  60. package/dist/tools/drive/get-drive-list.d.ts.map +1 -0
  61. package/dist/tools/drive/get-drive-list.js +84 -0
  62. package/dist/tools/drive/get-drive-list.js.map +1 -0
  63. package/dist/tools/drive/move-drive-file.d.ts +55 -0
  64. package/dist/tools/drive/move-drive-file.d.ts.map +1 -0
  65. package/dist/tools/drive/move-drive-file.js +92 -0
  66. package/dist/tools/drive/move-drive-file.js.map +1 -0
  67. package/dist/tools/drive/rename-drive-file.d.ts +55 -0
  68. package/dist/tools/drive/rename-drive-file.d.ts.map +1 -0
  69. package/dist/tools/drive/rename-drive-file.js +88 -0
  70. package/dist/tools/drive/rename-drive-file.js.map +1 -0
  71. package/dist/tools/drive/update-drive-file.d.ts +55 -0
  72. package/dist/tools/drive/update-drive-file.d.ts.map +1 -0
  73. package/dist/tools/drive/update-drive-file.js +119 -0
  74. package/dist/tools/drive/update-drive-file.js.map +1 -0
  75. package/dist/tools/drive/upload-drive-file.d.ts +55 -0
  76. package/dist/tools/drive/upload-drive-file.d.ts.map +1 -0
  77. package/dist/tools/drive/upload-drive-file.js +118 -0
  78. package/dist/tools/drive/upload-drive-file.js.map +1 -0
  79. package/dist/tools/messenger/get-channel-messages.d.ts +55 -0
  80. package/dist/tools/messenger/get-channel-messages.d.ts.map +1 -0
  81. package/dist/tools/messenger/get-channel-messages.js +115 -0
  82. package/dist/tools/messenger/get-channel-messages.js.map +1 -0
  83. package/dist/tools/messenger/get-channels.d.ts +30 -0
  84. package/dist/tools/messenger/get-channels.d.ts.map +1 -0
  85. package/dist/tools/messenger/get-channels.js +87 -0
  86. package/dist/tools/messenger/get-channels.js.map +1 -0
  87. package/dist/tools/messenger/send-channel-message.d.ts +48 -0
  88. package/dist/tools/messenger/send-channel-message.d.ts.map +1 -0
  89. package/dist/tools/messenger/send-channel-message.js +108 -0
  90. package/dist/tools/messenger/send-channel-message.js.map +1 -0
  91. package/dist/tools/messenger/send-direct-message.d.ts +48 -0
  92. package/dist/tools/messenger/send-direct-message.d.ts.map +1 -0
  93. package/dist/tools/messenger/send-direct-message.js +112 -0
  94. package/dist/tools/messenger/send-direct-message.js.map +1 -0
  95. package/dist/tools/projects/create-project-template.d.ts +305 -0
  96. package/dist/tools/projects/create-project-template.d.ts.map +1 -0
  97. package/dist/tools/projects/create-project-template.js +262 -0
  98. package/dist/tools/projects/create-project-template.js.map +1 -0
  99. package/dist/tools/projects/create-tag.d.ts +55 -0
  100. package/dist/tools/projects/create-tag.d.ts.map +1 -0
  101. package/dist/tools/projects/create-tag.js +134 -0
  102. package/dist/tools/projects/create-tag.js.map +1 -0
  103. package/dist/tools/projects/create-task-comment.d.ts +92 -0
  104. package/dist/tools/projects/create-task-comment.d.ts.map +1 -0
  105. package/dist/tools/projects/create-task-comment.js +171 -0
  106. package/dist/tools/projects/create-task-comment.js.map +1 -0
  107. package/dist/tools/projects/create-task.d.ts +198 -0
  108. package/dist/tools/projects/create-task.d.ts.map +1 -0
  109. package/dist/tools/projects/create-task.js +230 -0
  110. package/dist/tools/projects/create-task.js.map +1 -0
  111. package/dist/tools/projects/delete-attachment.d.ts +55 -0
  112. package/dist/tools/projects/delete-attachment.d.ts.map +1 -0
  113. package/dist/tools/projects/delete-attachment.js +115 -0
  114. package/dist/tools/projects/delete-attachment.js.map +1 -0
  115. package/dist/tools/projects/delete-project-template.d.ts +48 -0
  116. package/dist/tools/projects/delete-project-template.d.ts.map +1 -0
  117. package/dist/tools/projects/delete-project-template.js +108 -0
  118. package/dist/tools/projects/delete-project-template.js.map +1 -0
  119. package/dist/tools/projects/download-attachment.d.ts +62 -0
  120. package/dist/tools/projects/download-attachment.d.ts.map +1 -0
  121. package/dist/tools/projects/download-attachment.js +195 -0
  122. package/dist/tools/projects/download-attachment.js.map +1 -0
  123. package/dist/tools/projects/get-attachment-list.d.ts +48 -0
  124. package/dist/tools/projects/get-attachment-list.d.ts.map +1 -0
  125. package/dist/tools/projects/get-attachment-list.js +118 -0
  126. package/dist/tools/projects/get-attachment-list.js.map +1 -0
  127. package/dist/tools/projects/get-attachment-metadata.d.ts +55 -0
  128. package/dist/tools/projects/get-attachment-metadata.d.ts.map +1 -0
  129. package/dist/tools/projects/get-attachment-metadata.js +120 -0
  130. package/dist/tools/projects/get-attachment-metadata.js.map +1 -0
  131. package/dist/tools/projects/get-milestone-list.d.ts +49 -0
  132. package/dist/tools/projects/get-milestone-list.d.ts.map +1 -0
  133. package/dist/tools/projects/get-milestone-list.js +112 -0
  134. package/dist/tools/projects/get-milestone-list.js.map +1 -0
  135. package/dist/tools/projects/get-project-list.d.ts +50 -0
  136. package/dist/tools/projects/get-project-list.d.ts.map +1 -0
  137. package/dist/tools/projects/get-project-list.js +113 -0
  138. package/dist/tools/projects/get-project-list.js.map +1 -0
  139. package/dist/tools/projects/get-project-member-group-list.d.ts +55 -0
  140. package/dist/tools/projects/get-project-member-group-list.d.ts.map +1 -0
  141. package/dist/tools/projects/get-project-member-group-list.js +127 -0
  142. package/dist/tools/projects/get-project-member-group-list.js.map +1 -0
  143. package/dist/tools/projects/get-project-member-list.d.ts +66 -0
  144. package/dist/tools/projects/get-project-member-list.d.ts.map +1 -0
  145. package/dist/tools/projects/get-project-member-list.js +159 -0
  146. package/dist/tools/projects/get-project-member-list.js.map +1 -0
  147. package/dist/tools/projects/get-project-template-list.d.ts +55 -0
  148. package/dist/tools/projects/get-project-template-list.d.ts.map +1 -0
  149. package/dist/tools/projects/get-project-template-list.js +127 -0
  150. package/dist/tools/projects/get-project-template-list.js.map +1 -0
  151. package/dist/tools/projects/get-project-template.d.ts +48 -0
  152. package/dist/tools/projects/get-project-template.d.ts.map +1 -0
  153. package/dist/tools/projects/get-project-template.js +132 -0
  154. package/dist/tools/projects/get-project-template.js.map +1 -0
  155. package/dist/tools/projects/get-project-workflow-list.d.ts +41 -0
  156. package/dist/tools/projects/get-project-workflow-list.d.ts.map +1 -0
  157. package/dist/tools/projects/get-project-workflow-list.js +107 -0
  158. package/dist/tools/projects/get-project-workflow-list.js.map +1 -0
  159. package/dist/tools/projects/get-project.d.ts +41 -0
  160. package/dist/tools/projects/get-project.d.ts.map +1 -0
  161. package/dist/tools/projects/get-project.js +110 -0
  162. package/dist/tools/projects/get-project.js.map +1 -0
  163. package/dist/tools/projects/get-tag-list.d.ts +55 -0
  164. package/dist/tools/projects/get-tag-list.d.ts.map +1 -0
  165. package/dist/tools/projects/get-tag-list.js +145 -0
  166. package/dist/tools/projects/get-tag-list.js.map +1 -0
  167. package/dist/tools/projects/get-tag.d.ts +48 -0
  168. package/dist/tools/projects/get-tag.d.ts.map +1 -0
  169. package/dist/tools/projects/get-tag.js +124 -0
  170. package/dist/tools/projects/get-tag.js.map +1 -0
  171. package/dist/tools/projects/get-task-comment-list.d.ts +63 -0
  172. package/dist/tools/projects/get-task-comment-list.d.ts.map +1 -0
  173. package/dist/tools/projects/get-task-comment-list.js +136 -0
  174. package/dist/tools/projects/get-task-comment-list.js.map +1 -0
  175. package/dist/tools/projects/get-task-list.d.ts +184 -0
  176. package/dist/tools/projects/get-task-list.d.ts.map +1 -0
  177. package/dist/tools/projects/get-task-list.js +257 -0
  178. package/dist/tools/projects/get-task-list.js.map +1 -0
  179. package/dist/tools/projects/get-task.d.ts +48 -0
  180. package/dist/tools/projects/get-task.d.ts.map +1 -0
  181. package/dist/tools/projects/get-task.js +130 -0
  182. package/dist/tools/projects/get-task.js.map +1 -0
  183. package/dist/tools/projects/update-project-template.d.ts +312 -0
  184. package/dist/tools/projects/update-project-template.d.ts.map +1 -0
  185. package/dist/tools/projects/update-project-template.js +266 -0
  186. package/dist/tools/projects/update-project-template.js.map +1 -0
  187. package/dist/tools/projects/update-tag-group.d.ts +62 -0
  188. package/dist/tools/projects/update-tag-group.d.ts.map +1 -0
  189. package/dist/tools/projects/update-tag-group.js +162 -0
  190. package/dist/tools/projects/update-tag-group.js.map +1 -0
  191. package/dist/tools/projects/update-task-comment.d.ts +92 -0
  192. package/dist/tools/projects/update-task-comment.d.ts.map +1 -0
  193. package/dist/tools/projects/update-task-comment.js +176 -0
  194. package/dist/tools/projects/update-task-comment.js.map +1 -0
  195. package/dist/tools/projects/update-task.d.ts +203 -0
  196. package/dist/tools/projects/update-task.d.ts.map +1 -0
  197. package/dist/tools/projects/update-task.js +261 -0
  198. package/dist/tools/projects/update-task.js.map +1 -0
  199. package/dist/tools/projects/upload-attachment.d.ts +55 -0
  200. package/dist/tools/projects/upload-attachment.d.ts.map +1 -0
  201. package/dist/tools/projects/upload-attachment.js +143 -0
  202. package/dist/tools/projects/upload-attachment.js.map +1 -0
  203. package/dist/tools/wiki/create-wiki-comment.d.ts +55 -0
  204. package/dist/tools/wiki/create-wiki-comment.d.ts.map +1 -0
  205. package/dist/tools/wiki/create-wiki-comment.js +72 -0
  206. package/dist/tools/wiki/create-wiki-comment.js.map +1 -0
  207. package/dist/tools/wiki/create-wiki-page.d.ts +127 -0
  208. package/dist/tools/wiki/create-wiki-page.d.ts.map +1 -0
  209. package/dist/tools/wiki/create-wiki-page.js +116 -0
  210. package/dist/tools/wiki/create-wiki-page.js.map +1 -0
  211. package/dist/tools/wiki/delete-wiki-comment.d.ts +55 -0
  212. package/dist/tools/wiki/delete-wiki-comment.d.ts.map +1 -0
  213. package/dist/tools/wiki/delete-wiki-comment.js +72 -0
  214. package/dist/tools/wiki/delete-wiki-comment.js.map +1 -0
  215. package/dist/tools/wiki/delete-wiki-page-file.d.ts +55 -0
  216. package/dist/tools/wiki/delete-wiki-page-file.d.ts.map +1 -0
  217. package/dist/tools/wiki/delete-wiki-page-file.js +115 -0
  218. package/dist/tools/wiki/delete-wiki-page-file.js.map +1 -0
  219. package/dist/tools/wiki/download-wiki-attach-file.d.ts +55 -0
  220. package/dist/tools/wiki/download-wiki-attach-file.d.ts.map +1 -0
  221. package/dist/tools/wiki/download-wiki-attach-file.js +176 -0
  222. package/dist/tools/wiki/download-wiki-attach-file.js.map +1 -0
  223. package/dist/tools/wiki/download-wiki-page-file.d.ts +62 -0
  224. package/dist/tools/wiki/download-wiki-page-file.d.ts.map +1 -0
  225. package/dist/tools/wiki/download-wiki-page-file.js +189 -0
  226. package/dist/tools/wiki/download-wiki-page-file.js.map +1 -0
  227. package/dist/tools/wiki/get-wiki-comment-list.d.ts +62 -0
  228. package/dist/tools/wiki/get-wiki-comment-list.d.ts.map +1 -0
  229. package/dist/tools/wiki/get-wiki-comment-list.js +74 -0
  230. package/dist/tools/wiki/get-wiki-comment-list.js.map +1 -0
  231. package/dist/tools/wiki/get-wiki-comment.d.ts +55 -0
  232. package/dist/tools/wiki/get-wiki-comment.d.ts.map +1 -0
  233. package/dist/tools/wiki/get-wiki-comment.js +72 -0
  234. package/dist/tools/wiki/get-wiki-comment.js.map +1 -0
  235. package/dist/tools/wiki/get-wiki-list.d.ts +47 -0
  236. package/dist/tools/wiki/get-wiki-list.d.ts.map +1 -0
  237. package/dist/tools/wiki/get-wiki-list.js +76 -0
  238. package/dist/tools/wiki/get-wiki-list.js.map +1 -0
  239. package/dist/tools/wiki/get-wiki-page-list.d.ts +48 -0
  240. package/dist/tools/wiki/get-wiki-page-list.d.ts.map +1 -0
  241. package/dist/tools/wiki/get-wiki-page-list.js +70 -0
  242. package/dist/tools/wiki/get-wiki-page-list.js.map +1 -0
  243. package/dist/tools/wiki/get-wiki-page.d.ts +48 -0
  244. package/dist/tools/wiki/get-wiki-page.d.ts.map +1 -0
  245. package/dist/tools/wiki/get-wiki-page.js +78 -0
  246. package/dist/tools/wiki/get-wiki-page.js.map +1 -0
  247. package/dist/tools/wiki/update-wiki-comment.d.ts +62 -0
  248. package/dist/tools/wiki/update-wiki-comment.d.ts.map +1 -0
  249. package/dist/tools/wiki/update-wiki-comment.js +74 -0
  250. package/dist/tools/wiki/update-wiki-comment.js.map +1 -0
  251. package/dist/tools/wiki/update-wiki-page.d.ts +117 -0
  252. package/dist/tools/wiki/update-wiki-page.d.ts.map +1 -0
  253. package/dist/tools/wiki/update-wiki-page.js +111 -0
  254. package/dist/tools/wiki/update-wiki-page.js.map +1 -0
  255. package/dist/tools/wiki/upload-wiki-file.d.ts +49 -0
  256. package/dist/tools/wiki/upload-wiki-file.d.ts.map +1 -0
  257. package/dist/tools/wiki/upload-wiki-file.js +145 -0
  258. package/dist/tools/wiki/upload-wiki-file.js.map +1 -0
  259. package/dist/tools/wiki/upload-wiki-page-file.d.ts +55 -0
  260. package/dist/tools/wiki/upload-wiki-page-file.d.ts.map +1 -0
  261. package/dist/tools/wiki/upload-wiki-page-file.js +147 -0
  262. package/dist/tools/wiki/upload-wiki-page-file.js.map +1 -0
  263. package/dist/types/config.d.ts +18 -0
  264. package/dist/types/config.d.ts.map +1 -0
  265. package/dist/types/config.js +6 -0
  266. package/dist/types/config.js.map +1 -0
  267. package/dist/types/dooray-api.d.ts +717 -0
  268. package/dist/types/dooray-api.d.ts.map +1 -0
  269. package/dist/types/dooray-api.js +7 -0
  270. package/dist/types/dooray-api.js.map +1 -0
  271. package/dist/utils/errors.d.ts +28 -0
  272. package/dist/utils/errors.d.ts.map +1 -0
  273. package/dist/utils/errors.js +60 -0
  274. package/dist/utils/errors.js.map +1 -0
  275. package/dist/utils/logger.d.ts +22 -0
  276. package/dist/utils/logger.d.ts.map +1 -0
  277. package/dist/utils/logger.js +50 -0
  278. package/dist/utils/logger.js.map +1 -0
  279. package/dist/utils/member-transform.d.ts +20 -0
  280. package/dist/utils/member-transform.d.ts.map +1 -0
  281. package/dist/utils/member-transform.js +48 -0
  282. package/dist/utils/member-transform.js.map +1 -0
  283. package/dist/utils/response-filters.d.ts +105 -0
  284. package/dist/utils/response-filters.d.ts.map +1 -0
  285. package/dist/utils/response-filters.js +152 -0
  286. package/dist/utils/response-filters.js.map +1 -0
  287. package/package.json +54 -0
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ /**
3
+ * Get Drive List Tool
4
+ * Get list of accessible drives
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.getDriveListTool = exports.getDriveListSchema = void 0;
41
+ exports.getDriveListHandler = getDriveListHandler;
42
+ const zod_1 = require("zod");
43
+ const driveApi = __importStar(require("../../api/drive.js"));
44
+ const errors_js_1 = require("../../utils/errors.js");
45
+ exports.getDriveListSchema = zod_1.z.object({
46
+ type: zod_1.z.enum(['private', 'project']).optional().describe('Drive type: private (personal) or project'),
47
+ scope: zod_1.z.enum(['private', 'public']).optional().describe('Project scope (only when type=project): private or public'),
48
+ state: zod_1.z.string().optional().describe('Project state filter (e.g. "active", "archived"). Default: active'),
49
+ projectId: zod_1.z.string().optional().describe('Filter by project ID'),
50
+ });
51
+ async function getDriveListHandler(args) {
52
+ try {
53
+ const result = await driveApi.getDrives(args);
54
+ return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
55
+ }
56
+ catch (error) {
57
+ return { content: [{ type: 'text', text: `Error: ${(0, errors_js_1.formatError)(error)}` }], isError: true };
58
+ }
59
+ }
60
+ exports.getDriveListTool = {
61
+ name: 'get-drive-list',
62
+ description: `Get list of accessible Dooray drives.
63
+
64
+ **Drive Types:**
65
+ - private: Personal drive (default)
66
+ - project: Project drives (use scope to filter private/public projects)
67
+
68
+ **Examples:**
69
+ - Personal drive: { "type": "private" }
70
+ - Project drives: { "type": "project", "scope": "private" }
71
+ - Public project drives: { "type": "project", "scope": "public" }
72
+
73
+ Returns: drive ID, name, type, and associated project info.`,
74
+ inputSchema: {
75
+ type: 'object',
76
+ properties: {
77
+ type: { type: 'string', enum: ['private', 'project'], description: 'Drive type: private or project' },
78
+ scope: { type: 'string', enum: ['private', 'public'], description: 'Project scope (only when type=project)' },
79
+ state: { type: 'string', description: 'Project state filter (default: active)' },
80
+ projectId: { type: 'string', description: 'Filter by project ID' },
81
+ },
82
+ },
83
+ };
84
+ //# sourceMappingURL=get-drive-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-drive-list.js","sourceRoot":"","sources":["../../../src/tools/drive/get-drive-list.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeH,kDAOC;AApBD,6BAAwB;AACxB,6DAA+C;AAC/C,qDAAoD;AAEvC,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACrG,KAAK,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;IACrH,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mEAAmE,CAAC;IAC1G,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;CAClE,CAAC,CAAC;AAII,KAAK,UAAU,mBAAmB,CAAC,IAAuB;IAC/D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC9C,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,gBAAgB,GAAG;IAC9B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE;;;;;;;;;;;4DAW6C;IAC1D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE;YACrG,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE;YAC7G,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;YAChF,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE;SACnE;KACF;CACF,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Move Drive File Tool
3
+ * Move a file or folder to another location
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const moveDriveFileSchema: z.ZodObject<{
7
+ driveId: z.ZodString;
8
+ fileId: z.ZodString;
9
+ destinationFileId: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ fileId: string;
12
+ driveId: string;
13
+ destinationFileId: string;
14
+ }, {
15
+ fileId: string;
16
+ driveId: string;
17
+ destinationFileId: string;
18
+ }>;
19
+ export type MoveDriveFileInput = z.infer<typeof moveDriveFileSchema>;
20
+ export declare function moveDriveFileHandler(args: MoveDriveFileInput): 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 moveDriveFileTool: {
34
+ name: string;
35
+ description: string;
36
+ inputSchema: {
37
+ type: string;
38
+ properties: {
39
+ driveId: {
40
+ type: string;
41
+ description: string;
42
+ };
43
+ fileId: {
44
+ type: string;
45
+ description: string;
46
+ };
47
+ destinationFileId: {
48
+ type: string;
49
+ description: string;
50
+ };
51
+ };
52
+ required: string[];
53
+ };
54
+ };
55
+ //# sourceMappingURL=move-drive-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-drive-file.d.ts","sourceRoot":"","sources":["../../../src/tools/drive/move-drive-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB;;;;;;;;;;;;GAgBlE;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;CAuB7B,CAAC"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ /**
3
+ * Move Drive File Tool
4
+ * Move a file or folder to another location
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.moveDriveFileTool = exports.moveDriveFileSchema = void 0;
41
+ exports.moveDriveFileHandler = moveDriveFileHandler;
42
+ const zod_1 = require("zod");
43
+ const driveApi = __importStar(require("../../api/drive.js"));
44
+ const errors_js_1 = require("../../utils/errors.js");
45
+ exports.moveDriveFileSchema = zod_1.z.object({
46
+ driveId: zod_1.z.string().describe('Drive ID'),
47
+ fileId: zod_1.z.string().describe('File or folder ID to move'),
48
+ destinationFileId: zod_1.z.string().describe('Destination folder ID. Use "trash" to move to trash'),
49
+ });
50
+ async function moveDriveFileHandler(args) {
51
+ try {
52
+ await driveApi.moveDriveFile(args);
53
+ const dest = args.destinationFileId === 'trash' ? 'trash' : `folder ${args.destinationFileId}`;
54
+ return {
55
+ content: [{
56
+ type: 'text',
57
+ text: JSON.stringify({
58
+ success: true,
59
+ message: `File/folder moved to ${dest} successfully.`,
60
+ }, null, 2),
61
+ }],
62
+ };
63
+ }
64
+ catch (error) {
65
+ return { content: [{ type: 'text', text: `Error: ${(0, errors_js_1.formatError)(error)}` }], isError: true };
66
+ }
67
+ }
68
+ exports.moveDriveFileTool = {
69
+ name: 'move-drive-file',
70
+ description: `Move a file or folder in a Dooray drive.
71
+
72
+ **Required:**
73
+ - driveId: The drive ID
74
+ - fileId: File or folder ID to move
75
+ - destinationFileId: Target folder ID, or "trash" to move to trash
76
+
77
+ **Examples:**
78
+ - Move to folder: { "driveId": "123", "fileId": "456", "destinationFileId": "789" }
79
+ - Move to trash: { "driveId": "123", "fileId": "456", "destinationFileId": "trash" }
80
+
81
+ **Note:** To permanently delete, first move to trash, then use delete-drive-file.`,
82
+ inputSchema: {
83
+ type: 'object',
84
+ properties: {
85
+ driveId: { type: 'string', description: 'Drive ID' },
86
+ fileId: { type: 'string', description: 'File or folder ID to move' },
87
+ destinationFileId: { type: 'string', description: 'Destination folder ID or "trash"' },
88
+ },
89
+ required: ['driveId', 'fileId', 'destinationFileId'],
90
+ },
91
+ };
92
+ //# sourceMappingURL=move-drive-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move-drive-file.js","sourceRoot":"","sources":["../../../src/tools/drive/move-drive-file.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcH,oDAgBC;AA5BD,6BAAwB;AACxB,6DAA+C;AAC/C,qDAAoD;AAEvC,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;IACxC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IACxD,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qDAAqD,CAAC;CAC9F,CAAC,CAAC;AAII,KAAK,UAAU,oBAAoB,CAAC,IAAwB;IACjE,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC/F,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,wBAAwB,IAAI,gBAAgB;qBACtD,EAAE,IAAI,EAAE,CAAC,CAAC;iBACZ,CAAC;SACH,CAAC;IACJ,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,iBAAiB,GAAG;IAC/B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE;;;;;;;;;;;kFAWmE;IAChF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE;YACpD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;YACpE,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;SACvF;QACD,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,mBAAmB,CAAC;KACrD;CACF,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Rename Drive File Tool
3
+ * Rename a file or folder in a drive
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const renameDriveFileSchema: z.ZodObject<{
7
+ driveId: z.ZodString;
8
+ fileId: z.ZodString;
9
+ name: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ name: string;
12
+ fileId: string;
13
+ driveId: string;
14
+ }, {
15
+ name: string;
16
+ fileId: string;
17
+ driveId: string;
18
+ }>;
19
+ export type RenameDriveFileInput = z.infer<typeof renameDriveFileSchema>;
20
+ export declare function renameDriveFileHandler(args: RenameDriveFileInput): 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 renameDriveFileTool: {
34
+ name: string;
35
+ description: string;
36
+ inputSchema: {
37
+ type: string;
38
+ properties: {
39
+ driveId: {
40
+ type: string;
41
+ description: string;
42
+ };
43
+ fileId: {
44
+ type: string;
45
+ description: string;
46
+ };
47
+ name: {
48
+ type: string;
49
+ description: string;
50
+ };
51
+ };
52
+ required: string[];
53
+ };
54
+ };
55
+ //# sourceMappingURL=rename-drive-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rename-drive-file.d.ts","sourceRoot":"","sources":["../../../src/tools/drive/rename-drive-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEzE,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB;;;;;;;;;;;;GAetE;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;CAoB/B,CAAC"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ /**
3
+ * Rename Drive File Tool
4
+ * Rename a file or folder in a drive
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.renameDriveFileTool = exports.renameDriveFileSchema = void 0;
41
+ exports.renameDriveFileHandler = renameDriveFileHandler;
42
+ const zod_1 = require("zod");
43
+ const driveApi = __importStar(require("../../api/drive.js"));
44
+ const errors_js_1 = require("../../utils/errors.js");
45
+ exports.renameDriveFileSchema = zod_1.z.object({
46
+ driveId: zod_1.z.string().describe('Drive ID'),
47
+ fileId: zod_1.z.string().describe('File or folder ID to rename'),
48
+ name: zod_1.z.string().describe('New name'),
49
+ });
50
+ async function renameDriveFileHandler(args) {
51
+ try {
52
+ await driveApi.renameDriveFile(args);
53
+ return {
54
+ content: [{
55
+ type: 'text',
56
+ text: JSON.stringify({
57
+ success: true,
58
+ message: `File/folder renamed to "${args.name}" successfully.`,
59
+ }, null, 2),
60
+ }],
61
+ };
62
+ }
63
+ catch (error) {
64
+ return { content: [{ type: 'text', text: `Error: ${(0, errors_js_1.formatError)(error)}` }], isError: true };
65
+ }
66
+ }
67
+ exports.renameDriveFileTool = {
68
+ name: 'rename-drive-file',
69
+ description: `Rename a file or folder in a Dooray drive.
70
+
71
+ **Required:**
72
+ - driveId: The drive ID
73
+ - fileId: File or folder ID to rename
74
+ - name: New name
75
+
76
+ **Example:**
77
+ { "driveId": "123", "fileId": "456", "name": "new-name.txt" }`,
78
+ inputSchema: {
79
+ type: 'object',
80
+ properties: {
81
+ driveId: { type: 'string', description: 'Drive ID' },
82
+ fileId: { type: 'string', description: 'File or folder ID' },
83
+ name: { type: 'string', description: 'New name' },
84
+ },
85
+ required: ['driveId', 'fileId', 'name'],
86
+ },
87
+ };
88
+ //# sourceMappingURL=rename-drive-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rename-drive-file.js","sourceRoot":"","sources":["../../../src/tools/drive/rename-drive-file.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcH,wDAeC;AA3BD,6BAAwB;AACxB,6DAA+C;AAC/C,qDAAoD;AAEvC,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;IACxC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IAC1D,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC;CACtC,CAAC,CAAC;AAII,KAAK,UAAU,sBAAsB,CAAC,IAA0B;IACrE,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,2BAA2B,IAAI,CAAC,IAAI,iBAAiB;qBAC/D,EAAE,IAAI,EAAE,CAAC,CAAC;iBACZ,CAAC;SACH,CAAC;IACJ,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,mBAAmB,GAAG;IACjC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE;;;;;;;;8DAQ+C;IAC5D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE;YACpD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE;YAC5D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE;SAClD;QACD,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC;KACxC;CACF,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Update Drive File Tool
3
+ * Upload a new version of an existing file using curl (307 redirect handling)
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const updateDriveFileSchema: z.ZodObject<{
7
+ driveId: z.ZodString;
8
+ fileId: z.ZodString;
9
+ filePath: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ filePath: string;
12
+ fileId: string;
13
+ driveId: string;
14
+ }, {
15
+ filePath: string;
16
+ fileId: string;
17
+ driveId: string;
18
+ }>;
19
+ export type UpdateDriveFileInput = z.infer<typeof updateDriveFileSchema>;
20
+ export declare function updateDriveFileHandler(args: UpdateDriveFileInput): 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 updateDriveFileTool: {
34
+ name: string;
35
+ description: string;
36
+ inputSchema: {
37
+ type: string;
38
+ properties: {
39
+ driveId: {
40
+ type: string;
41
+ description: string;
42
+ };
43
+ fileId: {
44
+ type: string;
45
+ description: string;
46
+ };
47
+ filePath: {
48
+ type: string;
49
+ description: string;
50
+ };
51
+ };
52
+ required: string[];
53
+ };
54
+ };
55
+ //# sourceMappingURL=update-drive-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-drive-file.d.ts","sourceRoot":"","sources":["../../../src/tools/drive/update-drive-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEzE,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB;;;;;;;;;;;;GAiFtE;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;CAwB/B,CAAC"}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ /**
3
+ * Update Drive File Tool
4
+ * Upload a new version of an existing file using curl (307 redirect handling)
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.updateDriveFileTool = exports.updateDriveFileSchema = void 0;
11
+ exports.updateDriveFileHandler = updateDriveFileHandler;
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.updateDriveFileSchema = zod_1.z.object({
21
+ driveId: zod_1.z.string().describe('Drive ID'),
22
+ fileId: zod_1.z.string().describe('File ID to update'),
23
+ filePath: zod_1.z.string().describe('Absolute path to the new version of the file'),
24
+ });
25
+ async function updateDriveFileHandler(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
+ if (!fs_1.default.existsSync(args.filePath)) {
32
+ throw new Error(`File not found: ${args.filePath}`);
33
+ }
34
+ const fileName = path_1.default.basename(args.filePath);
35
+ const baseUrl = process.env.DOORAY_API_BASE_URL || 'https://api.dooray.com';
36
+ const apiUrl = `${baseUrl}/drive/v1/drives/${args.driveId}/files/${args.fileId}?media=raw`;
37
+ // Step 1: Initial PUT request to get 307 redirect
38
+ logger_js_1.logger.debug(`Drive update step 1: PUT ${apiUrl}`);
39
+ const step1Command = `curl -s -X PUT '${apiUrl}' \
40
+ --header 'Authorization: dooray-api ${apiToken}' \
41
+ --form 'file=@"${args.filePath}"' \
42
+ -w '\\n%{http_code}\\n%{redirect_url}' \
43
+ -o /dev/null`;
44
+ const step1Result = await execAsync(step1Command);
45
+ const step1Lines = step1Result.stdout.trim().split('\n');
46
+ const httpCode = step1Lines[step1Lines.length - 2];
47
+ const redirectUrl = step1Lines[step1Lines.length - 1];
48
+ logger_js_1.logger.debug(`Step 1 response: HTTP ${httpCode}, redirect: ${redirectUrl}`);
49
+ let result;
50
+ if (httpCode === '307' && redirectUrl) {
51
+ // Step 2: Follow redirect with PUT
52
+ logger_js_1.logger.debug(`Drive update step 2: PUT ${redirectUrl}`);
53
+ const step2Command = `curl -s -X PUT '${redirectUrl}' \
54
+ --header 'Authorization: dooray-api ${apiToken}' \
55
+ --form 'file=@"${args.filePath}"'`;
56
+ const step2Result = await execAsync(step2Command);
57
+ const response = JSON.parse(step2Result.stdout);
58
+ if (!response.header?.isSuccessful) {
59
+ throw new Error(response.header?.resultMessage || 'Update failed');
60
+ }
61
+ result = response.result;
62
+ }
63
+ else if (httpCode === '200' || httpCode === '201') {
64
+ const directCommand = `curl -s -X PUT '${apiUrl}' \
65
+ --header 'Authorization: dooray-api ${apiToken}' \
66
+ --form 'file=@"${args.filePath}"'`;
67
+ const directResult = await execAsync(directCommand);
68
+ const response = JSON.parse(directResult.stdout);
69
+ if (!response.header?.isSuccessful) {
70
+ throw new Error(response.header?.resultMessage || 'Update failed');
71
+ }
72
+ result = response.result;
73
+ }
74
+ else {
75
+ throw new Error(`Unexpected HTTP status: ${httpCode}`);
76
+ }
77
+ return {
78
+ content: [{
79
+ type: 'text',
80
+ text: JSON.stringify({
81
+ success: true,
82
+ fileId: result.id,
83
+ version: result.version,
84
+ fileName: fileName,
85
+ message: `File "${fileName}" updated successfully (new version uploaded).`,
86
+ }, null, 2),
87
+ }],
88
+ };
89
+ }
90
+ catch (error) {
91
+ return { content: [{ type: 'text', text: `Error: ${(0, errors_js_1.formatError)(error)}` }], isError: true };
92
+ }
93
+ }
94
+ exports.updateDriveFileTool = {
95
+ name: 'update-drive-file',
96
+ description: `Upload a new version of an existing file in a Dooray drive.
97
+
98
+ **Required:**
99
+ - driveId: The drive ID
100
+ - fileId: The file ID to update
101
+ - filePath: Absolute path to the new version of the file
102
+
103
+ **Example:**
104
+ { "driveId": "123", "fileId": "456", "filePath": "/Users/name/updated-document.pdf" }
105
+
106
+ Returns: File ID and new version number.
107
+
108
+ **Note:** This replaces the file content with a new version. The file must exist at the specified path.`,
109
+ inputSchema: {
110
+ type: 'object',
111
+ properties: {
112
+ driveId: { type: 'string', description: 'Drive ID' },
113
+ fileId: { type: 'string', description: 'File ID to update' },
114
+ filePath: { type: 'string', description: 'Absolute path to the new file version' },
115
+ },
116
+ required: ['driveId', 'fileId', 'filePath'],
117
+ },
118
+ };
119
+ //# sourceMappingURL=update-drive-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-drive-file.js","sourceRoot":"","sources":["../../../src/tools/drive/update-drive-file.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Upload Drive File Tool
3
+ * Upload a file to a drive folder using curl (307 redirect handling)
4
+ */
5
+ import { z } from 'zod';
6
+ export declare const uploadDriveFileSchema: z.ZodObject<{
7
+ driveId: z.ZodString;
8
+ parentId: z.ZodString;
9
+ filePath: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ filePath: string;
12
+ parentId: string;
13
+ driveId: string;
14
+ }, {
15
+ filePath: string;
16
+ parentId: string;
17
+ driveId: string;
18
+ }>;
19
+ export type UploadDriveFileInput = z.infer<typeof uploadDriveFileSchema>;
20
+ export declare function uploadDriveFileHandler(args: UploadDriveFileInput): 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 uploadDriveFileTool: {
34
+ name: string;
35
+ description: string;
36
+ inputSchema: {
37
+ type: string;
38
+ properties: {
39
+ driveId: {
40
+ type: string;
41
+ description: string;
42
+ };
43
+ parentId: {
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-drive-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-drive-file.d.ts","sourceRoot":"","sources":["../../../src/tools/drive/upload-drive-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEzE,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB;;;;;;;;;;;;GAgFtE;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;CAwB/B,CAAC"}