motionmcp 2.5.0 → 2.7.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/dist/handlers/CommentHandler.d.ts.map +1 -1
- package/dist/handlers/CommentHandler.js +4 -3
- package/dist/handlers/CommentHandler.js.map +1 -1
- package/dist/handlers/CustomFieldHandler.d.ts.map +1 -1
- package/dist/handlers/CustomFieldHandler.js +44 -21
- package/dist/handlers/CustomFieldHandler.js.map +1 -1
- package/dist/handlers/HandlerFactory.d.ts +0 -5
- package/dist/handlers/HandlerFactory.d.ts.map +1 -1
- package/dist/handlers/HandlerFactory.js +0 -15
- package/dist/handlers/HandlerFactory.js.map +1 -1
- package/dist/handlers/ProjectHandler.d.ts.map +1 -1
- package/dist/handlers/ProjectHandler.js +2 -1
- package/dist/handlers/ProjectHandler.js.map +1 -1
- package/dist/handlers/RecurringTaskHandler.d.ts.map +1 -1
- package/dist/handlers/RecurringTaskHandler.js +16 -10
- package/dist/handlers/RecurringTaskHandler.js.map +1 -1
- package/dist/handlers/ScheduleHandler.d.ts +1 -1
- package/dist/handlers/ScheduleHandler.d.ts.map +1 -1
- package/dist/handlers/ScheduleHandler.js +4 -26
- package/dist/handlers/ScheduleHandler.js.map +1 -1
- package/dist/handlers/SearchHandler.d.ts +1 -2
- package/dist/handlers/SearchHandler.d.ts.map +1 -1
- package/dist/handlers/SearchHandler.js +24 -70
- package/dist/handlers/SearchHandler.js.map +1 -1
- package/dist/handlers/TaskHandler.d.ts +11 -5
- package/dist/handlers/TaskHandler.d.ts.map +1 -1
- package/dist/handlers/TaskHandler.js +101 -63
- package/dist/handlers/TaskHandler.js.map +1 -1
- package/dist/handlers/UserHandler.js +6 -6
- package/dist/handlers/UserHandler.js.map +1 -1
- package/dist/handlers/WorkspaceHandler.d.ts +0 -1
- package/dist/handlers/WorkspaceHandler.d.ts.map +1 -1
- package/dist/handlers/WorkspaceHandler.js +0 -9
- package/dist/handlers/WorkspaceHandler.js.map +1 -1
- package/dist/handlers/base/BaseHandler.d.ts +4 -5
- package/dist/handlers/base/BaseHandler.d.ts.map +1 -1
- package/dist/handlers/base/BaseHandler.js +0 -12
- package/dist/handlers/base/BaseHandler.js.map +1 -1
- package/dist/handlers/base/HandlerInterface.d.ts +0 -5
- package/dist/handlers/base/HandlerInterface.d.ts.map +1 -1
- package/dist/handlers/index.d.ts +1 -1
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/mcp-server.js +3 -3
- package/dist/mcp-server.js.map +1 -1
- package/dist/schemas/motion.d.ts +12 -255
- package/dist/schemas/motion.d.ts.map +1 -1
- package/dist/schemas/motion.js +4 -17
- package/dist/schemas/motion.js.map +1 -1
- package/dist/services/api/ApiClient.d.ts +22 -0
- package/dist/services/api/ApiClient.d.ts.map +1 -0
- package/dist/services/api/ApiClient.js +198 -0
- package/dist/services/api/ApiClient.js.map +1 -0
- package/dist/services/api/CacheManager.d.ts +21 -0
- package/dist/services/api/CacheManager.d.ts.map +1 -0
- package/dist/services/api/CacheManager.js +25 -0
- package/dist/services/api/CacheManager.js.map +1 -0
- package/dist/services/api/comments.d.ts +8 -0
- package/dist/services/api/comments.d.ts.map +1 -0
- package/dist/services/api/comments.js +86 -0
- package/dist/services/api/comments.js.map +1 -0
- package/dist/services/api/customFields.d.ts +21 -0
- package/dist/services/api/customFields.d.ts.map +1 -0
- package/dist/services/api/customFields.js +277 -0
- package/dist/services/api/customFields.js.map +1 -0
- package/dist/services/api/index.d.ts +22 -0
- package/dist/services/api/index.d.ts.map +1 -0
- package/dist/services/api/index.js +64 -0
- package/dist/services/api/index.js.map +1 -0
- package/dist/services/api/projects.d.ts +18 -0
- package/dist/services/api/projects.d.ts.map +1 -0
- package/dist/services/api/projects.js +346 -0
- package/dist/services/api/projects.js.map +1 -0
- package/dist/services/api/recurringTasks.d.ts +15 -0
- package/dist/services/api/recurringTasks.d.ts.map +1 -0
- package/dist/services/api/recurringTasks.js +143 -0
- package/dist/services/api/recurringTasks.js.map +1 -0
- package/dist/services/api/schedules.d.ts +8 -0
- package/dist/services/api/schedules.d.ts.map +1 -0
- package/dist/services/api/schedules.js +70 -0
- package/dist/services/api/schedules.js.map +1 -0
- package/dist/services/api/search.d.ts +29 -0
- package/dist/services/api/search.d.ts.map +1 -0
- package/dist/services/api/search.js +415 -0
- package/dist/services/api/search.js.map +1 -0
- package/dist/services/api/statuses.d.ts +7 -0
- package/dist/services/api/statuses.d.ts.map +1 -0
- package/dist/services/api/statuses.js +67 -0
- package/dist/services/api/statuses.js.map +1 -0
- package/dist/services/api/tasks.d.ts +34 -0
- package/dist/services/api/tasks.d.ts.map +1 -0
- package/dist/services/api/tasks.js +474 -0
- package/dist/services/api/tasks.js.map +1 -0
- package/dist/services/api/types.d.ts +54 -0
- package/dist/services/api/types.d.ts.map +1 -0
- package/dist/services/api/types.js +9 -0
- package/dist/services/api/types.js.map +1 -0
- package/dist/services/api/users.d.ts +8 -0
- package/dist/services/api/users.d.ts.map +1 -0
- package/dist/services/api/users.js +93 -0
- package/dist/services/api/users.js.map +1 -0
- package/dist/services/api/workspaces.d.ts +7 -0
- package/dist/services/api/workspaces.d.ts.map +1 -0
- package/dist/services/api/workspaces.js +59 -0
- package/dist/services/api/workspaces.js.map +1 -0
- package/dist/services/motionApi.d.ts +41 -175
- package/dist/services/motionApi.d.ts.map +1 -1
- package/dist/services/motionApi.js +90 -2015
- package/dist/services/motionApi.js.map +1 -1
- package/dist/tools/ToolConfigurator.d.ts +1 -7
- package/dist/tools/ToolConfigurator.d.ts.map +1 -1
- package/dist/tools/ToolConfigurator.js +0 -31
- package/dist/tools/ToolConfigurator.js.map +1 -1
- package/dist/tools/ToolDefinitions.d.ts.map +1 -1
- package/dist/tools/ToolDefinitions.js +60 -82
- package/dist/tools/ToolDefinitions.js.map +1 -1
- package/dist/tools/ToolRegistry.d.ts +1 -22
- package/dist/tools/ToolRegistry.d.ts.map +1 -1
- package/dist/tools/ToolRegistry.js +0 -31
- package/dist/tools/ToolRegistry.js.map +1 -1
- package/dist/types/mcp-tool-args.d.ts +46 -61
- package/dist/types/mcp-tool-args.d.ts.map +1 -1
- package/dist/types/mcp-tool-args.js +2 -4
- package/dist/types/mcp-tool-args.js.map +1 -1
- package/dist/types/mcp.d.ts +5 -1
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/types/motion.d.ts +40 -20
- package/dist/types/motion.d.ts.map +1 -1
- package/dist/utils/cache.d.ts +0 -5
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/cache.js +0 -8
- package/dist/utils/cache.js.map +1 -1
- package/dist/utils/constants.d.ts +4 -11
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +13 -53
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/errorHandling.d.ts +0 -12
- package/dist/utils/errorHandling.d.ts.map +1 -1
- package/dist/utils/errorHandling.js +2 -23
- package/dist/utils/errorHandling.js.map +1 -1
- package/dist/utils/errors.d.ts +89 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +276 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/frequencyTransform.d.ts +0 -5
- package/dist/utils/frequencyTransform.d.ts.map +1 -1
- package/dist/utils/frequencyTransform.js +1 -9
- package/dist/utils/frequencyTransform.js.map +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -5
- package/dist/utils/index.js.map +1 -1
- 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 +0 -5
- package/dist/utils/paginationNew.d.ts.map +1 -1
- package/dist/utils/paginationNew.js +5 -9
- package/dist/utils/paginationNew.js.map +1 -1
- package/dist/utils/parameterUtils.d.ts +15 -10
- package/dist/utils/parameterUtils.d.ts.map +1 -1
- package/dist/utils/parameterUtils.js +8 -22
- package/dist/utils/parameterUtils.js.map +1 -1
- package/dist/utils/responseFormatters.d.ts +3 -2
- package/dist/utils/responseFormatters.d.ts.map +1 -1
- package/dist/utils/responseFormatters.js +67 -24
- package/dist/utils/responseFormatters.js.map +1 -1
- package/dist/utils/responseWrapper.js +1 -1
- package/dist/utils/responseWrapper.js.map +1 -1
- package/dist/utils/sanitize.d.ts.map +1 -1
- package/dist/utils/sanitize.js +2 -5
- package/dist/utils/sanitize.js.map +1 -1
- package/dist/utils/serverInstructions.d.ts +2 -0
- package/dist/utils/serverInstructions.d.ts.map +1 -0
- package/dist/utils/serverInstructions.js +21 -0
- package/dist/utils/serverInstructions.js.map +1 -0
- package/dist/utils/userFacingErrors.d.ts +0 -8
- package/dist/utils/userFacingErrors.d.ts.map +1 -1
- package/dist/utils/userFacingErrors.js +0 -19
- package/dist/utils/userFacingErrors.js.map +1 -1
- package/dist/utils/workspaceResolver.d.ts +5 -1
- package/dist/utils/workspaceResolver.d.ts.map +1 -1
- package/dist/utils/workspaceResolver.js +46 -25
- package/dist/utils/workspaceResolver.js.map +1 -1
- package/package.json +6 -2
- package/dist/mcp-server-old.d.ts +0 -29
- package/dist/mcp-server-old.d.ts.map +0 -1
- package/dist/mcp-server-old.js +0 -1304
- package/dist/mcp-server-old.js.map +0 -1
- package/dist/utils/jsonSchemaToZod.d.ts +0 -33
- package/dist/utils/jsonSchemaToZod.d.ts.map +0 -1
- package/dist/utils/jsonSchemaToZod.js +0 -110
- package/dist/utils/jsonSchemaToZod.js.map +0 -1
- package/dist/worker.d.ts +0 -17
- package/dist/worker.d.ts.map +0 -1
- package/dist/worker.js +0 -61
- package/dist/worker.js.map +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* User resource module — getUsers, getCurrentUser
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getUsers = getUsers;
|
|
7
|
+
exports.getCurrentUser = getCurrentUser;
|
|
8
|
+
const axios_1 = require("axios");
|
|
9
|
+
const constants_1 = require("../../utils/constants");
|
|
10
|
+
const logger_1 = require("../../utils/logger");
|
|
11
|
+
const ApiClient_1 = require("./ApiClient");
|
|
12
|
+
async function getUsers(ctx, workspaceId, teamId) {
|
|
13
|
+
const parts = [workspaceId && `ws:${workspaceId}`, teamId && `team:${teamId}`].filter(Boolean);
|
|
14
|
+
const cacheKey = parts.length > 0 ? `users:${parts.join(':')}` : 'users:all';
|
|
15
|
+
return ctx.cache.user.withCache(cacheKey, async () => {
|
|
16
|
+
try {
|
|
17
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.DEBUG, 'Fetching users from Motion API', {
|
|
18
|
+
method: 'getUsers',
|
|
19
|
+
workspaceId,
|
|
20
|
+
teamId
|
|
21
|
+
});
|
|
22
|
+
const params = new URLSearchParams();
|
|
23
|
+
if (workspaceId) {
|
|
24
|
+
params.append('workspaceId', workspaceId);
|
|
25
|
+
}
|
|
26
|
+
if (teamId) {
|
|
27
|
+
params.append('teamId', teamId);
|
|
28
|
+
}
|
|
29
|
+
const queryString = params.toString();
|
|
30
|
+
const url = queryString ? `/users?${queryString}` : '/users';
|
|
31
|
+
const response = await ctx.api.requestWithRetry(() => ctx.api.client.get(url));
|
|
32
|
+
// The Motion API might wrap the users in a 'users' array
|
|
33
|
+
const usersData = response.data?.users || response.data || [];
|
|
34
|
+
const users = Array.isArray(usersData) ? usersData : [];
|
|
35
|
+
if (!Array.isArray(response.data?.users) && !Array.isArray(response.data)) {
|
|
36
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.WARN, 'Unexpected users response shape', {
|
|
37
|
+
method: 'getUsers',
|
|
38
|
+
workspaceId,
|
|
39
|
+
responseType: response.data === null ? 'null' : typeof response.data
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Users fetched successfully', {
|
|
43
|
+
method: 'getUsers',
|
|
44
|
+
count: users.length,
|
|
45
|
+
workspaceId
|
|
46
|
+
});
|
|
47
|
+
return users;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to fetch users', {
|
|
51
|
+
method: 'getUsers',
|
|
52
|
+
error: (0, ApiClient_1.getErrorMessage)(error),
|
|
53
|
+
apiStatus: (0, axios_1.isAxiosError)(error) ? error.response?.status : undefined,
|
|
54
|
+
apiMessage: (0, axios_1.isAxiosError)(error) ? error.response?.data?.message : undefined
|
|
55
|
+
});
|
|
56
|
+
throw ctx.api.formatApiError(error, 'fetch', 'user');
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async function getCurrentUser(ctx) {
|
|
61
|
+
const cacheKey = 'currentUser';
|
|
62
|
+
// Use userCache but with a special single-user wrapper
|
|
63
|
+
const cachedUsers = await ctx.cache.user.withCache(cacheKey, async () => {
|
|
64
|
+
try {
|
|
65
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.DEBUG, 'Fetching current user from Motion API', {
|
|
66
|
+
method: 'getCurrentUser'
|
|
67
|
+
});
|
|
68
|
+
const response = await ctx.api.requestWithRetry(() => ctx.api.client.get('/users/me'));
|
|
69
|
+
const user = response.data;
|
|
70
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Current user fetched successfully', {
|
|
71
|
+
method: 'getCurrentUser',
|
|
72
|
+
userId: user.id,
|
|
73
|
+
email: user.email
|
|
74
|
+
});
|
|
75
|
+
return [user]; // Wrap in array for cache compatibility
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to fetch current user', {
|
|
79
|
+
method: 'getCurrentUser',
|
|
80
|
+
error: (0, ApiClient_1.getErrorMessage)(error),
|
|
81
|
+
apiStatus: (0, axios_1.isAxiosError)(error) ? error.response?.status : undefined,
|
|
82
|
+
apiMessage: (0, axios_1.isAxiosError)(error) ? error.response?.data?.message : undefined
|
|
83
|
+
});
|
|
84
|
+
throw ctx.api.formatApiError(error, 'fetch', 'user');
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const user = cachedUsers[0];
|
|
88
|
+
if (!user) {
|
|
89
|
+
throw ctx.api.formatApiError(new Error('No user returned from API'), 'fetch', 'user');
|
|
90
|
+
}
|
|
91
|
+
return user;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=users.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/services/api/users.ts"],"names":[],"mappings":";AAAA;;GAEG;;AASH,4BAsDC;AAED,wCAqCC;AApGD,iCAAoD;AAEpD,qDAAmD;AACnD,+CAA4C;AAE5C,2CAA8C;AAEvC,KAAK,UAAU,QAAQ,CAAC,GAAoB,EAAE,WAAoB,EAAE,MAAe;IACxF,MAAM,KAAK,GAAG,CAAC,WAAW,IAAI,MAAM,WAAW,EAAE,EAAE,MAAM,IAAI,QAAQ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/F,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;IAE7E,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QACnD,IAAI,CAAC;YACH,IAAA,eAAM,EAAC,sBAAU,CAAC,KAAK,EAAE,gCAAgC,EAAE;gBACzD,MAAM,EAAE,UAAU;gBAClB,WAAW;gBACX,MAAM;aACP,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;YACrC,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,CAAC,MA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,mCAAmC,EAAE;gBAC3D,MAAM,EAAE,gBAAgB;gBACxB,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC,CAAC;YAEH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,wCAAwC;QACzD,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAA,eAAM,EAAC,sBAAU,CAAC,KAAK,EAAE,8BAA8B,EAAE;gBACvD,MAAM,EAAE,gBAAgB;gBACxB,KAAK,EAAE,IAAA,2BAAe,EAAC,KAAK,CAAC;gBAC7B,SAAS,EAAE,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS;gBACnE,UAAU,EAAE,IAAA,oBAAY,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;aAC5E,CAAC,CAAC;YACH,MAAM,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACxF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace resource module — getWorkspaces, fetchWorkspaces
|
|
3
|
+
*/
|
|
4
|
+
import { MotionWorkspace } from '../../types/motion';
|
|
5
|
+
import { ResourceContext } from './types';
|
|
6
|
+
export declare function getWorkspaces(ctx: ResourceContext, ids?: string[]): Promise<MotionWorkspace[]>;
|
|
7
|
+
//# sourceMappingURL=workspaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/services/api/workspaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAmD1C,wBAAsB,aAAa,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAQpG"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Workspace resource module — getWorkspaces, fetchWorkspaces
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getWorkspaces = getWorkspaces;
|
|
7
|
+
const axios_1 = require("axios");
|
|
8
|
+
const constants_1 = require("../../utils/constants");
|
|
9
|
+
const logger_1 = require("../../utils/logger");
|
|
10
|
+
const motion_1 = require("../../schemas/motion");
|
|
11
|
+
const ApiClient_1 = require("./ApiClient");
|
|
12
|
+
async function fetchWorkspaces(ctx, ids) {
|
|
13
|
+
try {
|
|
14
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.DEBUG, 'Fetching workspaces from Motion API', {
|
|
15
|
+
method: 'getWorkspaces',
|
|
16
|
+
filterIds: ids
|
|
17
|
+
});
|
|
18
|
+
const params = new URLSearchParams();
|
|
19
|
+
if (ids && ids.length > 0) {
|
|
20
|
+
for (const id of ids) {
|
|
21
|
+
params.append('ids', id);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const queryString = params.toString();
|
|
25
|
+
const url = queryString ? `/workspaces?${queryString}` : '/workspaces';
|
|
26
|
+
const response = await ctx.api.requestWithRetry(() => ctx.api.client.get(url));
|
|
27
|
+
// Validate the response structure
|
|
28
|
+
const validatedResponse = ctx.api.validateResponse(response.data, motion_1.WorkspacesListResponseSchema, 'getWorkspaces');
|
|
29
|
+
// Extract workspaces array (handle both wrapped and unwrapped responses)
|
|
30
|
+
const workspaces = Array.isArray(validatedResponse)
|
|
31
|
+
? validatedResponse
|
|
32
|
+
: validatedResponse.workspaces;
|
|
33
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.INFO, 'Workspaces fetched successfully', {
|
|
34
|
+
method: 'getWorkspaces',
|
|
35
|
+
count: workspaces.length,
|
|
36
|
+
workspaceNames: workspaces.map((w) => w.name)
|
|
37
|
+
});
|
|
38
|
+
return workspaces;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
(0, logger_1.mcpLog)(constants_1.LOG_LEVELS.ERROR, 'Failed to fetch workspaces', {
|
|
42
|
+
method: 'getWorkspaces',
|
|
43
|
+
error: (0, ApiClient_1.getErrorMessage)(error),
|
|
44
|
+
apiStatus: (0, axios_1.isAxiosError)(error) ? error.response?.status : undefined,
|
|
45
|
+
apiMessage: (0, axios_1.isAxiosError)(error) ? error.response?.data?.message : undefined
|
|
46
|
+
});
|
|
47
|
+
throw ctx.api.formatApiError(error, 'fetch', 'workspace');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function getWorkspaces(ctx, ids) {
|
|
51
|
+
// Skip caching when filtering by IDs — filtered results are unlikely to be reused
|
|
52
|
+
if (ids && ids.length > 0) {
|
|
53
|
+
return fetchWorkspaces(ctx, ids);
|
|
54
|
+
}
|
|
55
|
+
return ctx.cache.workspace.withCache('workspaces', async () => {
|
|
56
|
+
return fetchWorkspaces(ctx);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=workspaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../src/services/api/workspaces.ts"],"names":[],"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.
|
|
3
|
+
*
|
|
4
|
+
* All business logic lives in `src/services/api/*.ts` modules. This class
|
|
5
|
+
* preserves the original public API surface so existing consumers (handlers,
|
|
6
|
+
* tests) don't need to change.
|
|
7
|
+
*/
|
|
8
|
+
import { MotionWorkspace, MotionProject, MotionTask, MotionTaskCreateData, MotionTaskUpdateData, MotionUser, MotionComment, CreateCommentData, MotionCustomField, MotionCustomFieldValue, CreateCustomFieldData, MotionRecurringTask, CreateRecurringTaskData, MotionSchedule, MotionStatus, MotionPaginatedResponse } from '../types/motion';
|
|
3
9
|
import { ListResult } from '../types/mcp';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
projectId?: string;
|
|
7
|
-
status?: string | string[];
|
|
8
|
-
includeAllStatuses?: boolean;
|
|
9
|
-
assigneeId?: string;
|
|
10
|
-
priority?: ValidPriority;
|
|
11
|
-
dueDate?: string;
|
|
12
|
-
labels?: string[];
|
|
13
|
-
limit?: number;
|
|
14
|
-
maxPages?: number;
|
|
15
|
-
}
|
|
10
|
+
import type { GetTasksOptions } from './api/tasks';
|
|
11
|
+
import type { ResolveUserIdentifierOptions } from './api/search';
|
|
16
12
|
export declare class MotionApiService {
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
private client;
|
|
20
|
-
private workspaceCache;
|
|
21
|
-
private userCache;
|
|
22
|
-
private projectCache;
|
|
23
|
-
private singleProjectCache;
|
|
24
|
-
private commentCache;
|
|
25
|
-
private customFieldCache;
|
|
26
|
-
private recurringTaskCache;
|
|
27
|
-
private scheduleCache;
|
|
28
|
-
private statusCache;
|
|
29
|
-
/**
|
|
30
|
-
* Validate API response against schema
|
|
31
|
-
* Handles strict/lenient/off modes based on configuration
|
|
32
|
-
*/
|
|
33
|
-
private validateResponse;
|
|
13
|
+
private _api;
|
|
14
|
+
private _cache;
|
|
34
15
|
constructor(apiKey?: string);
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*/
|
|
49
|
-
private requestWithRetry;
|
|
16
|
+
/** ResourceContext for delegating to extracted resource modules. */
|
|
17
|
+
private get _ctx();
|
|
18
|
+
getWorkspaces(ids?: string[]): Promise<MotionWorkspace[]>;
|
|
19
|
+
getUsers(workspaceId?: string, teamId?: string): Promise<MotionUser[]>;
|
|
20
|
+
getCurrentUser(): Promise<MotionUser>;
|
|
21
|
+
getTasks(options: GetTasksOptions): Promise<ListResult<MotionTask>>;
|
|
22
|
+
getTask(taskId: string): Promise<MotionTask>;
|
|
23
|
+
createTask(taskData: MotionTaskCreateData): Promise<MotionTask>;
|
|
24
|
+
updateTask(taskId: string, updates: MotionTaskUpdateData): Promise<MotionTask>;
|
|
25
|
+
deleteTask(taskId: string): Promise<void>;
|
|
26
|
+
moveTask(taskId: string, targetWorkspaceId: string, assigneeId?: string): Promise<MotionTask | undefined>;
|
|
27
|
+
unassignTask(taskId: string): Promise<MotionTask | undefined>;
|
|
28
|
+
getAllUncompletedTasks(limit?: number, assigneeId?: string): Promise<ListResult<MotionTask>>;
|
|
50
29
|
getProjects(workspaceId: string, options?: {
|
|
51
30
|
maxPages?: number;
|
|
52
31
|
limit?: number;
|
|
@@ -56,155 +35,42 @@ export declare class MotionApiService {
|
|
|
56
35
|
createProject(projectData: Partial<MotionProject>): Promise<MotionProject>;
|
|
57
36
|
updateProject(projectId: string, updates: Partial<MotionProject>): Promise<MotionProject>;
|
|
58
37
|
deleteProject(projectId: string): Promise<void>;
|
|
59
|
-
|
|
60
|
-
getTask(taskId: string): Promise<MotionTask>;
|
|
61
|
-
createTask(taskData: Partial<MotionTask>): Promise<MotionTask>;
|
|
62
|
-
updateTask(taskId: string, updates: Partial<MotionTask>): Promise<MotionTask>;
|
|
63
|
-
deleteTask(taskId: string): Promise<void>;
|
|
64
|
-
moveTask(taskId: string, targetProjectId?: string | null, targetWorkspaceId?: string | null): Promise<MotionTask>;
|
|
65
|
-
unassignTask(taskId: string): Promise<MotionTask>;
|
|
66
|
-
getWorkspaces(): Promise<MotionWorkspace[]>;
|
|
67
|
-
getUsers(workspaceId?: string): Promise<MotionUser[]>;
|
|
68
|
-
getCurrentUser(): Promise<MotionUser>;
|
|
69
|
-
/**
|
|
70
|
-
* Resolves a project identifier (either projectId or projectName) to a MotionProject
|
|
71
|
-
* Searches across all workspaces if not found in the specified workspace
|
|
72
|
-
* @param identifier Object containing either projectId or projectName
|
|
73
|
-
* @param workspaceId Workspace to start searching in
|
|
74
|
-
* @returns Resolved MotionProject with workspace info, or undefined if not found
|
|
75
|
-
*/
|
|
76
|
-
resolveProjectIdentifier(identifier: {
|
|
77
|
-
projectId?: string;
|
|
78
|
-
projectName?: string;
|
|
79
|
-
}, workspaceId: string): Promise<MotionProject | undefined>;
|
|
80
|
-
/**
|
|
81
|
-
* Resolves a user identifier (either userId or userName/email) to a MotionUser
|
|
82
|
-
* Searches across all workspaces if not found in the specified workspace
|
|
83
|
-
* @param identifier Object containing either userId or userName
|
|
84
|
-
* @param workspaceId Workspace to start searching in (optional)
|
|
85
|
-
* @returns Resolved MotionUser with workspace info, or undefined if not found
|
|
86
|
-
*/
|
|
87
|
-
resolveUserIdentifier(identifier: {
|
|
88
|
-
userId?: string;
|
|
89
|
-
userName?: string;
|
|
90
|
-
}, workspaceId?: string): Promise<MotionUser | undefined>;
|
|
91
|
-
getProjectByName(projectName: string, workspaceId: string): Promise<MotionProject | undefined>;
|
|
92
|
-
searchTasks(query: string, workspaceId: string, limit?: number): Promise<ListResult<MotionTask>>;
|
|
93
|
-
searchProjects(query: string, workspaceId: string, limit?: number): Promise<ListResult<MotionProject>>;
|
|
94
|
-
/**
|
|
95
|
-
* Get comments for a task with proper pagination support
|
|
96
|
-
* @param taskId Task ID to get comments for
|
|
97
|
-
* @param cursor Optional cursor for pagination
|
|
98
|
-
* @returns Paginated response with comments and metadata
|
|
99
|
-
*/
|
|
38
|
+
getProjectByName(projectName: string, workspaceId?: string): Promise<MotionProject | undefined>;
|
|
100
39
|
getComments(taskId: string, cursor?: string): Promise<MotionPaginatedResponse<MotionComment>>;
|
|
101
40
|
createComment(commentData: CreateCommentData): Promise<MotionComment>;
|
|
102
|
-
/**
|
|
103
|
-
* Fetch custom fields from Motion API
|
|
104
|
-
* @param workspaceId - Required workspace ID to get custom fields for
|
|
105
|
-
* @returns Array of custom fields
|
|
106
|
-
*/
|
|
107
41
|
getCustomFields(workspaceId: string): Promise<MotionCustomField[]>;
|
|
108
|
-
/**
|
|
109
|
-
* Create a new custom field
|
|
110
|
-
* @param workspaceId - Required workspace ID to create custom field in
|
|
111
|
-
* @param fieldData - Data for creating the custom field
|
|
112
|
-
* @returns The created custom field
|
|
113
|
-
*/
|
|
114
42
|
createCustomField(workspaceId: string, fieldData: CreateCustomFieldData): Promise<MotionCustomField>;
|
|
115
|
-
/**
|
|
116
|
-
* Delete a custom field
|
|
117
|
-
* @param workspaceId - Required workspace ID containing the custom field
|
|
118
|
-
* @param fieldId - ID of the custom field to delete
|
|
119
|
-
* @returns Success indicator
|
|
120
|
-
*/
|
|
121
43
|
deleteCustomField(workspaceId: string, fieldId: string): Promise<{
|
|
122
44
|
success: boolean;
|
|
123
45
|
}>;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
* @param projectId - ID of the project
|
|
127
|
-
* @param fieldId - ID of the custom field
|
|
128
|
-
* @param value - Optional value for the field
|
|
129
|
-
* @returns Updated project data
|
|
130
|
-
*/
|
|
131
|
-
addCustomFieldToProject(projectId: string, fieldId: string, value?: string | number | boolean | string[] | null): Promise<MotionProject>;
|
|
132
|
-
/**
|
|
133
|
-
* Remove a custom field from a project
|
|
134
|
-
* @param projectId - ID of the project
|
|
135
|
-
* @param fieldId - ID of the custom field
|
|
136
|
-
* @returns Success indicator
|
|
137
|
-
*/
|
|
138
|
-
removeCustomFieldFromProject(projectId: string, fieldId: string): Promise<{
|
|
46
|
+
addCustomFieldToProject(projectId: string, fieldId: string, value?: string | number | boolean | string[] | null, fieldType?: string): Promise<MotionCustomFieldValue>;
|
|
47
|
+
removeCustomFieldFromProject(projectId: string, valueId: string): Promise<{
|
|
139
48
|
success: boolean;
|
|
140
49
|
}>;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
* @param taskId - ID of the task
|
|
144
|
-
* @param fieldId - ID of the custom field
|
|
145
|
-
* @param value - Optional value for the field
|
|
146
|
-
* @returns Updated task data
|
|
147
|
-
*/
|
|
148
|
-
addCustomFieldToTask(taskId: string, fieldId: string, value?: string | number | boolean | string[] | null): Promise<MotionTask>;
|
|
149
|
-
/**
|
|
150
|
-
* Remove a custom field from a task
|
|
151
|
-
* @param taskId - ID of the task
|
|
152
|
-
* @param fieldId - ID of the custom field
|
|
153
|
-
* @returns Success indicator
|
|
154
|
-
*/
|
|
155
|
-
removeCustomFieldFromTask(taskId: string, fieldId: string): Promise<{
|
|
50
|
+
addCustomFieldToTask(taskId: string, fieldId: string, value?: string | number | boolean | string[] | null, fieldType?: string): Promise<MotionCustomFieldValue>;
|
|
51
|
+
removeCustomFieldFromTask(taskId: string, valueId: string): Promise<{
|
|
156
52
|
success: boolean;
|
|
157
53
|
}>;
|
|
158
|
-
/**
|
|
159
|
-
* Fetch recurring tasks from Motion API with automatic pagination
|
|
160
|
-
* @param workspaceId - Optional workspace ID to filter recurring tasks
|
|
161
|
-
* @param options - Optional configuration for maxPages and limit
|
|
162
|
-
* @returns Array of recurring tasks from all pages
|
|
163
|
-
*/
|
|
164
54
|
getRecurringTasks(workspaceId?: string, options?: {
|
|
165
55
|
maxPages?: number;
|
|
166
56
|
limit?: number;
|
|
167
57
|
}): Promise<ListResult<MotionRecurringTask>>;
|
|
168
|
-
/**
|
|
169
|
-
* Create a new recurring task
|
|
170
|
-
* @param taskData - Data for creating the recurring task
|
|
171
|
-
* @returns The created recurring task
|
|
172
|
-
*/
|
|
173
58
|
createRecurringTask(taskData: CreateRecurringTaskData): Promise<MotionRecurringTask>;
|
|
174
|
-
/**
|
|
175
|
-
* Delete a recurring task
|
|
176
|
-
* @param recurringTaskId - ID of the recurring task to delete
|
|
177
|
-
* @returns Success indicator
|
|
178
|
-
*/
|
|
179
59
|
deleteRecurringTask(recurringTaskId: string): Promise<{
|
|
180
60
|
success: boolean;
|
|
181
61
|
}>;
|
|
182
|
-
/**
|
|
183
|
-
* Get available schedule names for auto-scheduling
|
|
184
|
-
* @param workspaceId - Optional workspace ID to filter schedules (currently unused by Motion API)
|
|
185
|
-
* @returns Array of schedule names
|
|
186
|
-
*/
|
|
187
62
|
getAvailableScheduleNames(workspaceId?: string): Promise<string[]>;
|
|
188
|
-
|
|
189
|
-
* Fetch schedules from Motion API
|
|
190
|
-
* @param userId - Optional user ID to filter schedules
|
|
191
|
-
* @param startDate - Optional start date (ISO 8601) to filter schedules
|
|
192
|
-
* @param endDate - Optional end date (ISO 8601) to filter schedules
|
|
193
|
-
* @returns Array of schedules
|
|
194
|
-
*/
|
|
195
|
-
getSchedules(userId?: string, startDate?: string, endDate?: string): Promise<MotionSchedule[]>;
|
|
196
|
-
/**
|
|
197
|
-
* Retrieves available workflow statuses from Motion
|
|
198
|
-
* @param workspaceId - Optional workspace ID to filter statuses
|
|
199
|
-
* @returns Promise resolving to array of Motion statuses
|
|
200
|
-
* @throws {Error} If the API request fails
|
|
201
|
-
*/
|
|
63
|
+
getSchedules(): Promise<MotionSchedule[]>;
|
|
202
64
|
getStatuses(workspaceId?: string): Promise<MotionStatus[]>;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
65
|
+
searchTasks(query: string, workspaceId: string, limit?: number): Promise<ListResult<MotionTask>>;
|
|
66
|
+
searchProjects(query: string, workspaceId: string, limit?: number): Promise<ListResult<MotionProject>>;
|
|
67
|
+
resolveProjectIdentifier(identifier: {
|
|
68
|
+
projectId?: string;
|
|
69
|
+
projectName?: string;
|
|
70
|
+
}, workspaceId?: string): Promise<MotionProject | undefined>;
|
|
71
|
+
resolveUserIdentifier(identifier: {
|
|
72
|
+
userId?: string;
|
|
73
|
+
userName?: string;
|
|
74
|
+
}, workspaceId?: string, options?: ResolveUserIdentifierOptions): Promise<MotionUser | undefined>;
|
|
208
75
|
}
|
|
209
|
-
export {};
|
|
210
76
|
//# sourceMappingURL=motionApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motionApi.d.ts","sourceRoot":"","sources":["../../src/services/motionApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"motionApi.d.ts","sourceRoot":"","sources":["../../src/services/motionApi.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,EACf,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQnD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAEjE,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,MAAM,CAAe;gBAEjB,MAAM,CAAC,EAAE,MAAM;IAK3B,oEAAoE;IACpE,OAAO,KAAK,IAAI,GAEf;IAMK,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAQzD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAItE,cAAc,IAAI,OAAO,CAAC,UAAU,CAAC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