@alanse/clickup-multi-mcp-server 1.0.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.
Files changed (56) hide show
  1. package/Dockerfile +38 -0
  2. package/LICENSE +21 -0
  3. package/README.md +470 -0
  4. package/build/config.js +237 -0
  5. package/build/index.js +87 -0
  6. package/build/logger.js +163 -0
  7. package/build/middleware/security.js +231 -0
  8. package/build/server.js +288 -0
  9. package/build/services/clickup/base.js +432 -0
  10. package/build/services/clickup/bulk.js +180 -0
  11. package/build/services/clickup/document.js +159 -0
  12. package/build/services/clickup/folder.js +136 -0
  13. package/build/services/clickup/index.js +76 -0
  14. package/build/services/clickup/list.js +191 -0
  15. package/build/services/clickup/tag.js +239 -0
  16. package/build/services/clickup/task/index.js +32 -0
  17. package/build/services/clickup/task/task-attachments.js +105 -0
  18. package/build/services/clickup/task/task-comments.js +114 -0
  19. package/build/services/clickup/task/task-core.js +604 -0
  20. package/build/services/clickup/task/task-custom-fields.js +107 -0
  21. package/build/services/clickup/task/task-search.js +986 -0
  22. package/build/services/clickup/task/task-service.js +104 -0
  23. package/build/services/clickup/task/task-tags.js +113 -0
  24. package/build/services/clickup/time.js +244 -0
  25. package/build/services/clickup/types.js +33 -0
  26. package/build/services/clickup/workspace.js +397 -0
  27. package/build/services/shared.js +61 -0
  28. package/build/sse_server.js +277 -0
  29. package/build/tools/documents.js +489 -0
  30. package/build/tools/folder.js +331 -0
  31. package/build/tools/index.js +16 -0
  32. package/build/tools/list.js +428 -0
  33. package/build/tools/member.js +106 -0
  34. package/build/tools/tag.js +833 -0
  35. package/build/tools/task/attachments.js +357 -0
  36. package/build/tools/task/attachments.types.js +9 -0
  37. package/build/tools/task/bulk-operations.js +338 -0
  38. package/build/tools/task/handlers.js +919 -0
  39. package/build/tools/task/index.js +30 -0
  40. package/build/tools/task/main.js +233 -0
  41. package/build/tools/task/single-operations.js +469 -0
  42. package/build/tools/task/time-tracking.js +575 -0
  43. package/build/tools/task/utilities.js +310 -0
  44. package/build/tools/task/workspace-operations.js +258 -0
  45. package/build/tools/tool-enhancer.js +37 -0
  46. package/build/tools/utils.js +12 -0
  47. package/build/tools/workspace-helper.js +44 -0
  48. package/build/tools/workspace.js +73 -0
  49. package/build/utils/color-processor.js +183 -0
  50. package/build/utils/concurrency-utils.js +248 -0
  51. package/build/utils/date-utils.js +542 -0
  52. package/build/utils/resolver-utils.js +135 -0
  53. package/build/utils/sponsor-service.js +93 -0
  54. package/build/utils/token-utils.js +49 -0
  55. package/package.json +77 -0
  56. package/smithery.yaml +23 -0
@@ -0,0 +1,107 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: © 2025 Talib Kareem <taazkareem@icloud.com>
3
+ * SPDX-License-Identifier: MIT
4
+ *
5
+ * ClickUp Task Service - Custom Fields Module
6
+ *
7
+ * Handles custom fields operations for ClickUp tasks, including:
8
+ * - Setting custom field values
9
+ * - Retrieving custom field values
10
+ *
11
+ * REFACTORED: Now uses composition instead of inheritance.
12
+ * Only depends on TaskServiceCore for getTask() and base functionality.
13
+ */
14
+ /**
15
+ * Custom fields functionality for the TaskService
16
+ *
17
+ * This service handles all custom field operations for ClickUp tasks.
18
+ * It uses composition to access core functionality instead of inheritance.
19
+ */
20
+ export class TaskServiceCustomFields {
21
+ constructor(core) {
22
+ this.core = core;
23
+ }
24
+ /**
25
+ * Set a single custom field value on a task
26
+ *
27
+ * @param taskId ID of the task
28
+ * @param fieldId ID of the custom field
29
+ * @param value Value to set for the custom field
30
+ * @returns Success response
31
+ */
32
+ async setCustomFieldValue(taskId, fieldId, value) {
33
+ this.core.logOperation('setCustomFieldValue', { taskId, fieldId, value });
34
+ try {
35
+ const payload = {
36
+ value
37
+ };
38
+ await this.core.makeRequest(async () => {
39
+ return await this.core.client.post(`/task/${taskId}/field/${fieldId}`, payload);
40
+ });
41
+ return true;
42
+ }
43
+ catch (error) {
44
+ throw this.core.handleError(error, `Failed to set custom field "${fieldId}" value`);
45
+ }
46
+ }
47
+ /**
48
+ * Set multiple custom field values on a task
49
+ *
50
+ * @param taskId ID of the task
51
+ * @param customFields Array of custom field ID and value pairs
52
+ * @returns Success response
53
+ */
54
+ async setCustomFieldValues(taskId, customFields) {
55
+ this.core.logOperation('setCustomFieldValues', { taskId, customFields });
56
+ try {
57
+ // Execute each update sequentially
58
+ for (const field of customFields) {
59
+ await this.setCustomFieldValue(taskId, field.id, field.value);
60
+ }
61
+ return true;
62
+ }
63
+ catch (error) {
64
+ throw this.core.handleError(error, 'Failed to set custom field values');
65
+ }
66
+ }
67
+ /**
68
+ * Get all custom field values for a task
69
+ *
70
+ * @param taskId ID of the task
71
+ * @returns Record mapping field IDs to their values
72
+ */
73
+ async getCustomFieldValues(taskId) {
74
+ this.core.logOperation('getCustomFieldValues', { taskId });
75
+ try {
76
+ // We need to fetch the full task to get its custom fields
77
+ const task = await this.core.getTask(taskId);
78
+ return task.custom_fields || {};
79
+ }
80
+ catch (error) {
81
+ throw this.core.handleError(error, 'Failed to get custom field values');
82
+ }
83
+ }
84
+ /**
85
+ * Get a specific custom field value for a task
86
+ *
87
+ * @param taskId ID of the task
88
+ * @param fieldId ID of the custom field
89
+ * @returns The value of the custom field
90
+ * @throws ClickUpServiceError if the field doesn't exist
91
+ */
92
+ async getCustomFieldValue(taskId, fieldId) {
93
+ this.core.logOperation('getCustomFieldValue', { taskId, fieldId });
94
+ try {
95
+ const customFields = await this.getCustomFieldValues(taskId);
96
+ if (fieldId in customFields) {
97
+ return customFields[fieldId];
98
+ }
99
+ else {
100
+ throw this.core.handleError(new Error(`Custom field "${fieldId}" not found on task`), `Custom field "${fieldId}" not found on task`);
101
+ }
102
+ }
103
+ catch (error) {
104
+ throw this.core.handleError(error, `Failed to get custom field "${fieldId}" value`);
105
+ }
106
+ }
107
+ }