motionmcp 1.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +241 -450
- package/dist/handlers/CommentHandler.d.ts +9 -0
- package/dist/handlers/CommentHandler.d.ts.map +1 -0
- package/dist/handlers/CommentHandler.js +66 -0
- package/dist/handlers/CommentHandler.js.map +1 -0
- package/dist/handlers/CustomFieldHandler.d.ts +14 -0
- package/dist/handlers/CustomFieldHandler.d.ts.map +1 -0
- package/dist/handlers/CustomFieldHandler.js +95 -0
- package/dist/handlers/CustomFieldHandler.js.map +1 -0
- package/dist/handlers/HandlerFactory.d.ts +15 -0
- package/dist/handlers/HandlerFactory.d.ts.map +1 -0
- package/dist/handlers/HandlerFactory.js +58 -0
- package/dist/handlers/HandlerFactory.js.map +1 -0
- package/dist/handlers/ProjectHandler.d.ts +10 -0
- package/dist/handlers/ProjectHandler.d.ts.map +1 -0
- package/dist/handlers/ProjectHandler.js +63 -0
- package/dist/handlers/ProjectHandler.js.map +1 -0
- package/dist/handlers/RecurringTaskHandler.d.ts +10 -0
- package/dist/handlers/RecurringTaskHandler.d.ts.map +1 -0
- package/dist/handlers/RecurringTaskHandler.js +68 -0
- package/dist/handlers/RecurringTaskHandler.js.map +1 -0
- package/dist/handlers/ScheduleHandler.d.ts +8 -0
- package/dist/handlers/ScheduleHandler.d.ts.map +1 -0
- package/dist/handlers/ScheduleHandler.js +43 -0
- package/dist/handlers/ScheduleHandler.js.map +1 -0
- package/dist/handlers/SearchHandler.d.ts +10 -0
- package/dist/handlers/SearchHandler.d.ts.map +1 -0
- package/dist/handlers/SearchHandler.js +116 -0
- package/dist/handlers/SearchHandler.js.map +1 -0
- package/dist/handlers/StatusHandler.d.ts +8 -0
- package/dist/handlers/StatusHandler.d.ts.map +1 -0
- package/dist/handlers/StatusHandler.js +22 -0
- package/dist/handlers/StatusHandler.js.map +1 -0
- package/dist/handlers/TaskHandler.d.ts +22 -0
- package/dist/handlers/TaskHandler.d.ts.map +1 -0
- package/dist/handlers/TaskHandler.js +324 -0
- package/dist/handlers/TaskHandler.js.map +1 -0
- package/dist/handlers/UserHandler.d.ts +9 -0
- package/dist/handlers/UserHandler.d.ts.map +1 -0
- package/dist/handlers/UserHandler.js +36 -0
- package/dist/handlers/UserHandler.js.map +1 -0
- package/dist/handlers/WorkspaceHandler.d.ts +10 -0
- package/dist/handlers/WorkspaceHandler.d.ts.map +1 -0
- package/dist/handlers/WorkspaceHandler.js +49 -0
- package/dist/handlers/WorkspaceHandler.js.map +1 -0
- package/dist/handlers/base/BaseHandler.d.ts +16 -0
- package/dist/handlers/base/BaseHandler.d.ts.map +1 -0
- package/dist/handlers/base/BaseHandler.js +31 -0
- package/dist/handlers/base/BaseHandler.js.map +1 -0
- package/dist/handlers/base/HandlerInterface.d.ts +18 -0
- package/dist/handlers/base/HandlerInterface.d.ts.map +1 -0
- package/dist/handlers/base/HandlerInterface.js +3 -0
- package/dist/handlers/base/HandlerInterface.js.map +1 -0
- package/dist/handlers/index.d.ts +14 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +31 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/mcp-server.d.ts +15 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +145 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/schemas/motion.d.ts +4971 -0
- package/dist/schemas/motion.d.ts.map +1 -0
- package/dist/schemas/motion.js +328 -0
- package/dist/schemas/motion.js.map +1 -0
- package/dist/services/motionApi.d.ts +199 -0
- package/dist/services/motionApi.d.ts.map +1 -0
- package/dist/services/motionApi.js +1950 -0
- package/dist/services/motionApi.js.map +1 -0
- package/dist/tools/ToolConfigurator.d.ts +19 -0
- package/dist/tools/ToolConfigurator.d.ts.map +1 -0
- package/dist/tools/ToolConfigurator.js +89 -0
- package/dist/tools/ToolConfigurator.js.map +1 -0
- package/dist/tools/ToolDefinitions.d.ts +25 -0
- package/dist/tools/ToolDefinitions.d.ts.map +1 -0
- package/dist/tools/ToolDefinitions.js +508 -0
- package/dist/tools/ToolDefinitions.js.map +1 -0
- package/dist/tools/ToolRegistry.d.ts +16 -0
- package/dist/tools/ToolRegistry.d.ts.map +1 -0
- package/dist/tools/ToolRegistry.js +89 -0
- package/dist/tools/ToolRegistry.js.map +1 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +21 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types/mcp-tool-args.d.ts +123 -0
- package/dist/types/mcp-tool-args.d.ts.map +1 -0
- package/dist/types/mcp-tool-args.js +7 -0
- package/dist/types/mcp-tool-args.js.map +1 -0
- package/dist/types/mcp.d.ts +32 -0
- package/dist/types/mcp.d.ts.map +1 -0
- package/dist/types/mcp.js +3 -0
- package/dist/types/mcp.js.map +1 -0
- package/dist/types/motion.d.ts +304 -0
- package/dist/types/motion.d.ts.map +1 -0
- package/dist/types/motion.js +3 -0
- package/dist/types/motion.js.map +1 -0
- package/dist/utils/cache.d.ts +25 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +135 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/constants.d.ts +88 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +188 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/errorHandling.d.ts +50 -0
- package/dist/utils/errorHandling.d.ts.map +1 -0
- package/dist/utils/errorHandling.js +86 -0
- package/dist/utils/errorHandling.js.map +1 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +38 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +47 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/pagination.d.ts +61 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +168 -0
- package/dist/utils/pagination.js.map +1 -0
- package/dist/utils/paginationNew.d.ts +44 -0
- package/dist/utils/paginationNew.d.ts.map +1 -0
- package/dist/utils/paginationNew.js +149 -0
- package/dist/utils/paginationNew.js.map +1 -0
- package/dist/utils/parameterUtils.d.ts +79 -0
- package/dist/utils/parameterUtils.d.ts.map +1 -0
- package/dist/utils/parameterUtils.js +189 -0
- package/dist/utils/parameterUtils.js.map +1 -0
- package/dist/utils/responseFormatters.d.ts +95 -0
- package/dist/utils/responseFormatters.d.ts.map +1 -0
- package/dist/utils/responseFormatters.js +342 -0
- package/dist/utils/responseFormatters.js.map +1 -0
- package/dist/utils/responseWrapper.d.ts +38 -0
- package/dist/utils/responseWrapper.d.ts.map +1 -0
- package/dist/utils/responseWrapper.js +201 -0
- package/dist/utils/responseWrapper.js.map +1 -0
- package/dist/utils/sanitize.d.ts +51 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/sanitize.js +138 -0
- package/dist/utils/sanitize.js.map +1 -0
- package/dist/utils/validator.d.ts +37 -0
- package/dist/utils/validator.d.ts.map +1 -0
- package/dist/utils/validator.js +74 -0
- package/dist/utils/validator.js.map +1 -0
- package/dist/utils/workspaceResolver.d.ts +40 -0
- package/dist/utils/workspaceResolver.d.ts.map +1 -0
- package/dist/utils/workspaceResolver.js +207 -0
- package/dist/utils/workspaceResolver.js.map +1 -0
- package/package.json +41 -17
- package/.claude/settings.local.json +0 -15
- package/.env.example +0 -3
- package/sample.png +0 -0
- package/src/index.js +0 -179
- package/src/mcp-server.js +0 -1137
- package/src/routes/motion.js +0 -152
- package/src/services/motionApi.js +0 -1177
- package/src/worker.js +0 -248
package/src/routes/motion.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
const express = require('express');
|
|
2
|
-
const MotionApiService = require('../services/motionApi');
|
|
3
|
-
|
|
4
|
-
const router = express.Router();
|
|
5
|
-
let motionService;
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
motionService = new MotionApiService();
|
|
9
|
-
} catch (error) {
|
|
10
|
-
console.error('Failed to initialize Motion API service:', error.message);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const asyncHandler = (fn) => (req, res, next) => {
|
|
14
|
-
Promise.resolve(fn(req, res, next)).catch(next);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const validateMotionService = (req, res, next) => {
|
|
18
|
-
if (!motionService) {
|
|
19
|
-
return res.status(503).json({
|
|
20
|
-
error: 'Motion API service unavailable. Check MOTION_API_KEY configuration.'
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
next();
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
router.get('/projects', validateMotionService, asyncHandler(async (req, res) => {
|
|
27
|
-
const projects = await motionService.getProjects();
|
|
28
|
-
res.json(projects);
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
router.post('/projects', validateMotionService, asyncHandler(async (req, res) => {
|
|
32
|
-
const { name, description, color, status } = req.body;
|
|
33
|
-
|
|
34
|
-
if (!name) {
|
|
35
|
-
return res.status(400).json({ error: 'Project name is required' });
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const projectData = { name };
|
|
39
|
-
if (description) projectData.description = description;
|
|
40
|
-
if (color) projectData.color = color;
|
|
41
|
-
if (status) projectData.status = status;
|
|
42
|
-
|
|
43
|
-
const project = await motionService.createProject(projectData);
|
|
44
|
-
res.status(201).json(project);
|
|
45
|
-
}));
|
|
46
|
-
|
|
47
|
-
router.get('/projects/:id', validateMotionService, asyncHandler(async (req, res) => {
|
|
48
|
-
const project = await motionService.getProject(req.params.id);
|
|
49
|
-
res.json(project);
|
|
50
|
-
}));
|
|
51
|
-
|
|
52
|
-
router.patch('/projects/:id', validateMotionService, asyncHandler(async (req, res) => {
|
|
53
|
-
const { name, description, color, status } = req.body;
|
|
54
|
-
|
|
55
|
-
const updateData = {};
|
|
56
|
-
if (name) updateData.name = name;
|
|
57
|
-
if (description !== undefined) updateData.description = description;
|
|
58
|
-
if (color) updateData.color = color;
|
|
59
|
-
if (status) updateData.status = status;
|
|
60
|
-
|
|
61
|
-
if (Object.keys(updateData).length === 0) {
|
|
62
|
-
return res.status(400).json({ error: 'No valid fields to update' });
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const project = await motionService.updateProject(req.params.id, updateData);
|
|
66
|
-
res.json(project);
|
|
67
|
-
}));
|
|
68
|
-
|
|
69
|
-
router.delete('/projects/:id', validateMotionService, asyncHandler(async (req, res) => {
|
|
70
|
-
await motionService.deleteProject(req.params.id);
|
|
71
|
-
res.status(204).send();
|
|
72
|
-
}));
|
|
73
|
-
|
|
74
|
-
router.get('/tasks', validateMotionService, asyncHandler(async (req, res) => {
|
|
75
|
-
const options = {};
|
|
76
|
-
if (req.query.projectId) options.projectId = req.query.projectId;
|
|
77
|
-
if (req.query.status) options.status = req.query.status;
|
|
78
|
-
if (req.query.assigneeId) options.assigneeId = req.query.assigneeId;
|
|
79
|
-
|
|
80
|
-
const tasks = await motionService.getTasks(options);
|
|
81
|
-
res.json(tasks);
|
|
82
|
-
}));
|
|
83
|
-
|
|
84
|
-
router.post('/tasks', validateMotionService, asyncHandler(async (req, res) => {
|
|
85
|
-
const { name, description, status, priority, dueDate, projectId, assigneeId } = req.body;
|
|
86
|
-
|
|
87
|
-
if (!name) {
|
|
88
|
-
return res.status(400).json({ error: 'Task name is required' });
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const taskData = { name };
|
|
92
|
-
if (description) taskData.description = description;
|
|
93
|
-
if (status) taskData.status = status;
|
|
94
|
-
if (priority) taskData.priority = priority;
|
|
95
|
-
if (dueDate) taskData.dueDate = dueDate;
|
|
96
|
-
if (projectId) taskData.projectId = projectId;
|
|
97
|
-
if (assigneeId) taskData.assigneeId = assigneeId;
|
|
98
|
-
|
|
99
|
-
const task = await motionService.createTask(taskData);
|
|
100
|
-
res.status(201).json(task);
|
|
101
|
-
}));
|
|
102
|
-
|
|
103
|
-
router.get('/tasks/:id', validateMotionService, asyncHandler(async (req, res) => {
|
|
104
|
-
const task = await motionService.getTask(req.params.id);
|
|
105
|
-
res.json(task);
|
|
106
|
-
}));
|
|
107
|
-
|
|
108
|
-
router.patch('/tasks/:id', validateMotionService, asyncHandler(async (req, res) => {
|
|
109
|
-
const { name, description, status, priority, dueDate, projectId, assigneeId } = req.body;
|
|
110
|
-
|
|
111
|
-
const updateData = {};
|
|
112
|
-
if (name) updateData.name = name;
|
|
113
|
-
if (description !== undefined) updateData.description = description;
|
|
114
|
-
if (status) updateData.status = status;
|
|
115
|
-
if (priority) updateData.priority = priority;
|
|
116
|
-
if (dueDate !== undefined) updateData.dueDate = dueDate;
|
|
117
|
-
if (projectId) updateData.projectId = projectId;
|
|
118
|
-
if (assigneeId) updateData.assigneeId = assigneeId;
|
|
119
|
-
|
|
120
|
-
if (Object.keys(updateData).length === 0) {
|
|
121
|
-
return res.status(400).json({ error: 'No valid fields to update' });
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const task = await motionService.updateTask(req.params.id, updateData);
|
|
125
|
-
res.json(task);
|
|
126
|
-
}));
|
|
127
|
-
|
|
128
|
-
router.delete('/tasks/:id', validateMotionService, asyncHandler(async (req, res) => {
|
|
129
|
-
await motionService.deleteTask(req.params.id);
|
|
130
|
-
res.status(204).send();
|
|
131
|
-
}));
|
|
132
|
-
|
|
133
|
-
router.get('/workspaces', validateMotionService, asyncHandler(async (req, res) => {
|
|
134
|
-
const workspaces = await motionService.getWorkspaces();
|
|
135
|
-
res.json(workspaces);
|
|
136
|
-
}));
|
|
137
|
-
|
|
138
|
-
router.get('/users', validateMotionService, asyncHandler(async (req, res) => {
|
|
139
|
-
const users = await motionService.getUsers();
|
|
140
|
-
res.json(users);
|
|
141
|
-
}));
|
|
142
|
-
|
|
143
|
-
router.use((error, req, res, next) => {
|
|
144
|
-
if (error.message.includes('Failed to')) {
|
|
145
|
-
const statusCode = error.message.includes('not found') ? 404 : 400;
|
|
146
|
-
return res.status(statusCode).json({ error: error.message });
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
res.status(500).json({ error: 'Internal server error' });
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
module.exports = router;
|