@chykalophia/clickup-mcp-server 3.2.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 +21 -0
- package/README.md +467 -0
- package/bin/clickup-mcp-server-ai.js +9 -0
- package/bin/clickup-mcp-server-basic.js +9 -0
- package/bin/clickup-mcp-server-efficiency.js +9 -0
- package/bin/clickup-mcp-server-enhanced.js +9 -0
- package/build/app.d.ts +1 -0
- package/build/app.js +2 -0
- package/build/app.js.map +1 -0
- package/build/clickup-client/attachments-enhanced.d.ts +128 -0
- package/build/clickup-client/attachments-enhanced.js +212 -0
- package/build/clickup-client/attachments-enhanced.js.map +1 -0
- package/build/clickup-client/auth.d.ts +254 -0
- package/build/clickup-client/auth.js +105 -0
- package/build/clickup-client/auth.js.map +1 -0
- package/build/clickup-client/chat-enhanced.d.ts +141 -0
- package/build/clickup-client/chat-enhanced.js +196 -0
- package/build/clickup-client/chat-enhanced.js.map +1 -0
- package/build/clickup-client/checklists.d.ts +87 -0
- package/build/clickup-client/checklists.js +63 -0
- package/build/clickup-client/checklists.js.map +1 -0
- package/build/clickup-client/comments-enhanced.d.ts +176 -0
- package/build/clickup-client/comments-enhanced.js +230 -0
- package/build/clickup-client/comments-enhanced.js.map +1 -0
- package/build/clickup-client/comments.d.ts +173 -0
- package/build/clickup-client/comments.js +312 -0
- package/build/clickup-client/comments.js.map +1 -0
- package/build/clickup-client/custom-fields-enhanced.d.ts +286 -0
- package/build/clickup-client/custom-fields-enhanced.js +416 -0
- package/build/clickup-client/custom-fields-enhanced.js.map +1 -0
- package/build/clickup-client/dependencies-enhanced.d.ts +144 -0
- package/build/clickup-client/dependencies-enhanced.js +142 -0
- package/build/clickup-client/dependencies-enhanced.js.map +1 -0
- package/build/clickup-client/docs-enhanced.d.ts +176 -0
- package/build/clickup-client/docs-enhanced.js +374 -0
- package/build/clickup-client/docs-enhanced.js.map +1 -0
- package/build/clickup-client/docs.d.ts +84 -0
- package/build/clickup-client/docs.js +156 -0
- package/build/clickup-client/docs.js.map +1 -0
- package/build/clickup-client/folders.d.ts +62 -0
- package/build/clickup-client/folders.js +53 -0
- package/build/clickup-client/folders.js.map +1 -0
- package/build/clickup-client/goals-enhanced.d.ts +163 -0
- package/build/clickup-client/goals-enhanced.js +309 -0
- package/build/clickup-client/goals-enhanced.js.map +1 -0
- package/build/clickup-client/index.d.ts +16 -0
- package/build/clickup-client/index.js +61 -0
- package/build/clickup-client/index.js.map +1 -0
- package/build/clickup-client/lists.d.ts +105 -0
- package/build/clickup-client/lists.js +108 -0
- package/build/clickup-client/lists.js.map +1 -0
- package/build/clickup-client/secure-client.d.ts +88 -0
- package/build/clickup-client/secure-client.js +275 -0
- package/build/clickup-client/secure-client.js.map +1 -0
- package/build/clickup-client/spaces.d.ts +58 -0
- package/build/clickup-client/spaces.js +28 -0
- package/build/clickup-client/spaces.js.map +1 -0
- package/build/clickup-client/tasks.d.ts +161 -0
- package/build/clickup-client/tasks.js +99 -0
- package/build/clickup-client/tasks.js.map +1 -0
- package/build/clickup-client/time-tracking-enhanced.d.ts +153 -0
- package/build/clickup-client/time-tracking-enhanced.js +292 -0
- package/build/clickup-client/time-tracking-enhanced.js.map +1 -0
- package/build/clickup-client/views-enhanced.d.ts +149 -0
- package/build/clickup-client/views-enhanced.js +210 -0
- package/build/clickup-client/views-enhanced.js.map +1 -0
- package/build/clickup-client/webhooks-enhanced.d.ts +119 -0
- package/build/clickup-client/webhooks-enhanced.js +169 -0
- package/build/clickup-client/webhooks-enhanced.js.map +1 -0
- package/build/controllers/lists.controller.d.ts +1 -0
- package/build/controllers/lists.controller.js +2 -0
- package/build/controllers/lists.controller.js.map +1 -0
- package/build/index-efficiency-simple.d.ts +2 -0
- package/build/index-efficiency-simple.js +379 -0
- package/build/index-efficiency-simple.js.map +1 -0
- package/build/index-enhanced-efficiency.d.ts +2 -0
- package/build/index-enhanced-efficiency.js +275 -0
- package/build/index-enhanced-efficiency.js.map +1 -0
- package/build/index-enhanced.d.ts +2 -0
- package/build/index-enhanced.js +74 -0
- package/build/index-enhanced.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +77 -0
- package/build/index.js.map +1 -0
- package/build/resources/checklist-resources.d.ts +2 -0
- package/build/resources/checklist-resources.js +102 -0
- package/build/resources/checklist-resources.js.map +1 -0
- package/build/resources/comment-resources.d.ts +2 -0
- package/build/resources/comment-resources.js +152 -0
- package/build/resources/comment-resources.js.map +1 -0
- package/build/resources/doc-resources.d.ts +2 -0
- package/build/resources/doc-resources.js +77 -0
- package/build/resources/doc-resources.js.map +1 -0
- package/build/resources/folder-resources.d.ts +2 -0
- package/build/resources/folder-resources.js +160 -0
- package/build/resources/folder-resources.js.map +1 -0
- package/build/resources/list-resources.d.ts +2 -0
- package/build/resources/list-resources.js +104 -0
- package/build/resources/list-resources.js.map +1 -0
- package/build/resources/space-resources.d.ts +2 -0
- package/build/resources/space-resources.js +104 -0
- package/build/resources/space-resources.js.map +1 -0
- package/build/resources/task-resources.d.ts +2 -0
- package/build/resources/task-resources.js +57 -0
- package/build/resources/task-resources.js.map +1 -0
- package/build/routes/lists.routes.d.ts +1 -0
- package/build/routes/lists.routes.js +2 -0
- package/build/routes/lists.routes.js.map +1 -0
- package/build/schemas/attachments-schemas.d.ts +201 -0
- package/build/schemas/attachments-schemas.js +250 -0
- package/build/schemas/attachments-schemas.js.map +1 -0
- package/build/schemas/chat-schemas.d.ts +478 -0
- package/build/schemas/chat-schemas.js +173 -0
- package/build/schemas/chat-schemas.js.map +1 -0
- package/build/schemas/custom-field-schemas.d.ts +1617 -0
- package/build/schemas/custom-field-schemas.js +384 -0
- package/build/schemas/custom-field-schemas.js.map +1 -0
- package/build/schemas/dependencies-schemas.d.ts +274 -0
- package/build/schemas/dependencies-schemas.js +176 -0
- package/build/schemas/dependencies-schemas.js.map +1 -0
- package/build/schemas/document-schemas.d.ts +433 -0
- package/build/schemas/document-schemas.js +168 -0
- package/build/schemas/document-schemas.js.map +1 -0
- package/build/schemas/goals-schemas.d.ts +961 -0
- package/build/schemas/goals-schemas.js +293 -0
- package/build/schemas/goals-schemas.js.map +1 -0
- package/build/schemas/time-tracking-schemas.d.ts +741 -0
- package/build/schemas/time-tracking-schemas.js +234 -0
- package/build/schemas/time-tracking-schemas.js.map +1 -0
- package/build/schemas/views-schemas.d.ts +1168 -0
- package/build/schemas/views-schemas.js +221 -0
- package/build/schemas/views-schemas.js.map +1 -0
- package/build/schemas/webhook-schemas.d.ts +1127 -0
- package/build/schemas/webhook-schemas.js +137 -0
- package/build/schemas/webhook-schemas.js.map +1 -0
- package/build/services/lists.service.d.ts +1 -0
- package/build/services/lists.service.js +2 -0
- package/build/services/lists.service.js.map +1 -0
- package/build/tools/attachments-tools-setup.d.ts +2 -0
- package/build/tools/attachments-tools-setup.js +387 -0
- package/build/tools/attachments-tools-setup.js.map +1 -0
- package/build/tools/chat-tools-enhanced.d.ts +5 -0
- package/build/tools/chat-tools-enhanced.js +396 -0
- package/build/tools/chat-tools-enhanced.js.map +1 -0
- package/build/tools/chat-tools.d.ts +2 -0
- package/build/tools/chat-tools.js +614 -0
- package/build/tools/chat-tools.js.map +1 -0
- package/build/tools/checklist-tools.d.ts +2 -0
- package/build/tools/checklist-tools.js +139 -0
- package/build/tools/checklist-tools.js.map +1 -0
- package/build/tools/comment-tools.d.ts +2 -0
- package/build/tools/comment-tools.js +295 -0
- package/build/tools/comment-tools.js.map +1 -0
- package/build/tools/custom-field-tools.d.ts +2 -0
- package/build/tools/custom-field-tools.js +578 -0
- package/build/tools/custom-field-tools.js.map +1 -0
- package/build/tools/dependencies-tools-setup.d.ts +2 -0
- package/build/tools/dependencies-tools-setup.js +319 -0
- package/build/tools/dependencies-tools-setup.js.map +1 -0
- package/build/tools/doc-tools-enhanced.d.ts +2 -0
- package/build/tools/doc-tools-enhanced.js +417 -0
- package/build/tools/doc-tools-enhanced.js.map +1 -0
- package/build/tools/doc-tools.d.ts +2 -0
- package/build/tools/doc-tools.js +109 -0
- package/build/tools/doc-tools.js.map +1 -0
- package/build/tools/goals-tools.d.ts +2 -0
- package/build/tools/goals-tools.js +422 -0
- package/build/tools/goals-tools.js.map +1 -0
- package/build/tools/helper-tools.d.ts +2 -0
- package/build/tools/helper-tools.js +363 -0
- package/build/tools/helper-tools.js.map +1 -0
- package/build/tools/space-tools.d.ts +2 -0
- package/build/tools/space-tools.js +45 -0
- package/build/tools/space-tools.js.map +1 -0
- package/build/tools/task-tools.d.ts +2 -0
- package/build/tools/task-tools.js +415 -0
- package/build/tools/task-tools.js.map +1 -0
- package/build/tools/time-tracking-tools.d.ts +2 -0
- package/build/tools/time-tracking-tools.js +329 -0
- package/build/tools/time-tracking-tools.js.map +1 -0
- package/build/tools/views-tools-setup.d.ts +2 -0
- package/build/tools/views-tools-setup.js +358 -0
- package/build/tools/views-tools-setup.js.map +1 -0
- package/build/tools/webhook-tools-setup.d.ts +2 -0
- package/build/tools/webhook-tools-setup.js +304 -0
- package/build/tools/webhook-tools-setup.js.map +1 -0
- package/build/tools/webhook-tools.d.ts +4 -0
- package/build/tools/webhook-tools.js +345 -0
- package/build/tools/webhook-tools.js.map +1 -0
- package/build/utils/clickup-comment-formatter.d.ts +124 -0
- package/build/utils/clickup-comment-formatter.js +504 -0
- package/build/utils/clickup-comment-formatter.js.map +1 -0
- package/build/utils/context-aware-suggestions.d.ts +45 -0
- package/build/utils/context-aware-suggestions.js +360 -0
- package/build/utils/context-aware-suggestions.js.map +1 -0
- package/build/utils/error-handling.d.ts +140 -0
- package/build/utils/error-handling.js +392 -0
- package/build/utils/error-handling.js.map +1 -0
- package/build/utils/markdown-styling.d.ts +40 -0
- package/build/utils/markdown-styling.js +344 -0
- package/build/utils/markdown-styling.js.map +1 -0
- package/build/utils/markdown.d.ts +54 -0
- package/build/utils/markdown.js +243 -0
- package/build/utils/markdown.js.map +1 -0
- package/build/utils/security.d.ts +79 -0
- package/build/utils/security.js +303 -0
- package/build/utils/security.js.map +1 -0
- package/build/utils/tool-efficiency.d.ts +59 -0
- package/build/utils/tool-efficiency.js +247 -0
- package/build/utils/tool-efficiency.js.map +1 -0
- package/package.json +130 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { ClickUpClient } from './index.js';
|
|
2
|
+
export class AttachmentsEnhancedClient extends ClickUpClient {
|
|
3
|
+
constructor(apiToken) {
|
|
4
|
+
super({ apiToken });
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Upload a new attachment
|
|
8
|
+
*/
|
|
9
|
+
async uploadAttachment(request) {
|
|
10
|
+
const endpoint = this.getParentEndpoint(request.parent_type, request.parent_id);
|
|
11
|
+
const payload = {
|
|
12
|
+
filename: request.filename,
|
|
13
|
+
source: request.source,
|
|
14
|
+
description: request.description,
|
|
15
|
+
tags: request.tags
|
|
16
|
+
};
|
|
17
|
+
if (request.file_data) {
|
|
18
|
+
payload.file_data = request.file_data;
|
|
19
|
+
}
|
|
20
|
+
else if (request.file_url) {
|
|
21
|
+
payload.file_url = request.file_url;
|
|
22
|
+
}
|
|
23
|
+
const response = await this.post(`${endpoint}/attachment`, payload);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get attachments for a parent object
|
|
28
|
+
*/
|
|
29
|
+
async getAttachments(filter) {
|
|
30
|
+
const endpoint = this.getParentEndpoint(filter.parent_type, filter.parent_id);
|
|
31
|
+
const params = new URLSearchParams();
|
|
32
|
+
if (filter.type)
|
|
33
|
+
params.append('type', filter.type);
|
|
34
|
+
if (filter.filename_contains)
|
|
35
|
+
params.append('filename_contains', filter.filename_contains);
|
|
36
|
+
if (filter.tags)
|
|
37
|
+
params.append('tags', filter.tags.join(','));
|
|
38
|
+
if (filter.date_from)
|
|
39
|
+
params.append('date_from', filter.date_from.toString());
|
|
40
|
+
if (filter.date_to)
|
|
41
|
+
params.append('date_to', filter.date_to.toString());
|
|
42
|
+
if (filter.limit)
|
|
43
|
+
params.append('limit', filter.limit.toString());
|
|
44
|
+
if (filter.offset)
|
|
45
|
+
params.append('offset', filter.offset.toString());
|
|
46
|
+
const queryString = params.toString();
|
|
47
|
+
const fullEndpoint = `${endpoint}/attachment${queryString ? `?${queryString}` : ''}`;
|
|
48
|
+
const response = await this.get(fullEndpoint);
|
|
49
|
+
return response;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get a specific attachment by ID
|
|
53
|
+
*/
|
|
54
|
+
async getAttachment(attachmentId) {
|
|
55
|
+
const response = await this.get(`/attachment/${attachmentId}`);
|
|
56
|
+
return response.attachment;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Update attachment metadata
|
|
60
|
+
*/
|
|
61
|
+
async updateAttachmentMetadata(request) {
|
|
62
|
+
const updateData = {};
|
|
63
|
+
if (request.filename)
|
|
64
|
+
updateData.filename = request.filename;
|
|
65
|
+
if (request.description !== undefined)
|
|
66
|
+
updateData.description = request.description;
|
|
67
|
+
if (request.tags)
|
|
68
|
+
updateData.tags = request.tags;
|
|
69
|
+
const response = await this.put(`/attachment/${request.attachment_id}`, updateData);
|
|
70
|
+
return response.attachment;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Delete an attachment
|
|
74
|
+
*/
|
|
75
|
+
async deleteAttachment(attachmentId) {
|
|
76
|
+
await this.delete(`/attachment/${attachmentId}`);
|
|
77
|
+
return { success: true };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Download an attachment
|
|
81
|
+
*/
|
|
82
|
+
async downloadAttachment(attachmentId) {
|
|
83
|
+
const response = await this.get(`/attachment/${attachmentId}/download`);
|
|
84
|
+
return response;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get attachment info without downloading
|
|
88
|
+
*/
|
|
89
|
+
async getAttachmentInfo(attachmentId) {
|
|
90
|
+
const response = await this.get(`/attachment/${attachmentId}/info`);
|
|
91
|
+
return response;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Update attachment sharing settings
|
|
95
|
+
*/
|
|
96
|
+
async updateAttachmentSharing(request) {
|
|
97
|
+
const payload = {
|
|
98
|
+
access_level: request.access_level,
|
|
99
|
+
expires_at: request.expires_at ? new Date(request.expires_at * 1000).toISOString() : undefined,
|
|
100
|
+
password: request.password
|
|
101
|
+
};
|
|
102
|
+
const response = await this.put(`/attachment/${request.attachment_id}/sharing`, payload);
|
|
103
|
+
return response.attachment;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Perform bulk attachment operations
|
|
107
|
+
*/
|
|
108
|
+
async bulkAttachmentOperations(operation) {
|
|
109
|
+
const response = await this.post('/attachment/bulk', operation);
|
|
110
|
+
return response;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get attachment statistics for a workspace
|
|
114
|
+
*/
|
|
115
|
+
async getAttachmentStats(workspaceId) {
|
|
116
|
+
const response = await this.get(`/team/${workspaceId}/attachment/stats`);
|
|
117
|
+
return response;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Search attachments across workspace
|
|
121
|
+
*/
|
|
122
|
+
async searchAttachments(workspaceId, query) {
|
|
123
|
+
const params = new URLSearchParams();
|
|
124
|
+
if (query.search_term)
|
|
125
|
+
params.append('search_term', query.search_term);
|
|
126
|
+
if (query.type)
|
|
127
|
+
params.append('type', query.type);
|
|
128
|
+
if (query.parent_type)
|
|
129
|
+
params.append('parent_type', query.parent_type);
|
|
130
|
+
if (query.tags)
|
|
131
|
+
params.append('tags', query.tags.join(','));
|
|
132
|
+
if (query.date_from)
|
|
133
|
+
params.append('date_from', query.date_from.toString());
|
|
134
|
+
if (query.date_to)
|
|
135
|
+
params.append('date_to', query.date_to.toString());
|
|
136
|
+
if (query.min_size)
|
|
137
|
+
params.append('min_size', query.min_size.toString());
|
|
138
|
+
if (query.max_size)
|
|
139
|
+
params.append('max_size', query.max_size.toString());
|
|
140
|
+
if (query.uploaded_by)
|
|
141
|
+
params.append('uploaded_by', query.uploaded_by.toString());
|
|
142
|
+
if (query.limit)
|
|
143
|
+
params.append('limit', query.limit.toString());
|
|
144
|
+
if (query.offset)
|
|
145
|
+
params.append('offset', query.offset.toString());
|
|
146
|
+
const queryString = params.toString();
|
|
147
|
+
const endpoint = `/team/${workspaceId}/attachment/search${queryString ? `?${queryString}` : ''}`;
|
|
148
|
+
const response = await this.get(endpoint);
|
|
149
|
+
return response;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Generate attachment thumbnail
|
|
153
|
+
*/
|
|
154
|
+
async generateAttachmentThumbnail(attachmentId, options) {
|
|
155
|
+
const params = new URLSearchParams();
|
|
156
|
+
if (options?.width)
|
|
157
|
+
params.append('width', options.width.toString());
|
|
158
|
+
if (options?.height)
|
|
159
|
+
params.append('height', options.height.toString());
|
|
160
|
+
if (options?.quality)
|
|
161
|
+
params.append('quality', options.quality.toString());
|
|
162
|
+
const queryString = params.toString();
|
|
163
|
+
const endpoint = `/attachment/${attachmentId}/thumbnail${queryString ? `?${queryString}` : ''}`;
|
|
164
|
+
const response = await this.post(endpoint);
|
|
165
|
+
return response;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Copy attachment to another parent
|
|
169
|
+
*/
|
|
170
|
+
async copyAttachment(attachmentId, targetParentId, targetParentType) {
|
|
171
|
+
const payload = {
|
|
172
|
+
target_parent_id: targetParentId,
|
|
173
|
+
target_parent_type: targetParentType
|
|
174
|
+
};
|
|
175
|
+
const response = await this.post(`/attachment/${attachmentId}/copy`, payload);
|
|
176
|
+
return response.attachment;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Move attachment to another parent
|
|
180
|
+
*/
|
|
181
|
+
async moveAttachment(attachmentId, targetParentId, targetParentType) {
|
|
182
|
+
const payload = {
|
|
183
|
+
target_parent_id: targetParentId,
|
|
184
|
+
target_parent_type: targetParentType
|
|
185
|
+
};
|
|
186
|
+
const response = await this.put(`/attachment/${attachmentId}/move`, payload);
|
|
187
|
+
return response.attachment;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Get attachment version history
|
|
191
|
+
*/
|
|
192
|
+
async getAttachmentVersions(attachmentId) {
|
|
193
|
+
const response = await this.get(`/attachment/${attachmentId}/versions`);
|
|
194
|
+
return response;
|
|
195
|
+
}
|
|
196
|
+
// Helper methods
|
|
197
|
+
getParentEndpoint(parentType, parentId) {
|
|
198
|
+
switch (parentType) {
|
|
199
|
+
case 'task':
|
|
200
|
+
return `/task/${parentId}`;
|
|
201
|
+
case 'comment':
|
|
202
|
+
return `/comment/${parentId}`;
|
|
203
|
+
case 'doc':
|
|
204
|
+
return `/doc/${parentId}`;
|
|
205
|
+
case 'chat':
|
|
206
|
+
return `/chat/${parentId}`;
|
|
207
|
+
default:
|
|
208
|
+
throw new Error(`Invalid parent type: ${parentType}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=attachments-enhanced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments-enhanced.js","sourceRoot":"","sources":["../../src/clickup-client/attachments-enhanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAa3C,MAAM,OAAO,yBAA0B,SAAQ,aAAa;IAC1D,YAAY,QAAgB;QAC1B,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CAAC,OAAgC;QACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhF,MAAM,OAAO,GAAQ;YACnB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC;QAEF,IAAI,OA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AAC;QACxD,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { ClickUpClient } from './index.js';
|
|
2
|
+
export interface AuthorizedUser {
|
|
3
|
+
id: number;
|
|
4
|
+
username: string;
|
|
5
|
+
email: string;
|
|
6
|
+
color: string;
|
|
7
|
+
profilePicture: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Workspace {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
color: string;
|
|
13
|
+
avatar: string;
|
|
14
|
+
members: Array<{
|
|
15
|
+
user: {
|
|
16
|
+
id: number;
|
|
17
|
+
username: string;
|
|
18
|
+
email: string;
|
|
19
|
+
color: string;
|
|
20
|
+
profilePicture: string;
|
|
21
|
+
};
|
|
22
|
+
role: number;
|
|
23
|
+
custom_role?: string;
|
|
24
|
+
}>;
|
|
25
|
+
}
|
|
26
|
+
export declare class AuthClient {
|
|
27
|
+
private client;
|
|
28
|
+
constructor(client: ClickUpClient);
|
|
29
|
+
/**
|
|
30
|
+
* Get the authorized user's information
|
|
31
|
+
* @returns The authorized user's information
|
|
32
|
+
*/
|
|
33
|
+
getAuthorizedUser(): Promise<AuthorizedUser>;
|
|
34
|
+
/**
|
|
35
|
+
* Get the workspaces (teams) that the authorized user belongs to
|
|
36
|
+
* @returns A list of workspaces
|
|
37
|
+
*/
|
|
38
|
+
getWorkspaces(): Promise<{
|
|
39
|
+
teams: Workspace[];
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the spaces in a workspace
|
|
43
|
+
* @param workspaceId The ID of the workspace to get spaces from
|
|
44
|
+
* @returns A list of spaces
|
|
45
|
+
*/
|
|
46
|
+
getSpaces(workspaceId: string): Promise<{
|
|
47
|
+
spaces: Array<{
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
private: boolean;
|
|
51
|
+
statuses: Array<{
|
|
52
|
+
id: string;
|
|
53
|
+
status: string;
|
|
54
|
+
type: string;
|
|
55
|
+
orderindex: number;
|
|
56
|
+
color: string;
|
|
57
|
+
}>;
|
|
58
|
+
multiple_assignees: boolean;
|
|
59
|
+
features: {
|
|
60
|
+
due_dates: {
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
start_date: boolean;
|
|
63
|
+
remap_due_dates: boolean;
|
|
64
|
+
remap_closed_due_date: boolean;
|
|
65
|
+
};
|
|
66
|
+
time_tracking: {
|
|
67
|
+
enabled: boolean;
|
|
68
|
+
};
|
|
69
|
+
tags: {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
};
|
|
72
|
+
time_estimates: {
|
|
73
|
+
enabled: boolean;
|
|
74
|
+
};
|
|
75
|
+
checklists: {
|
|
76
|
+
enabled: boolean;
|
|
77
|
+
};
|
|
78
|
+
custom_fields: {
|
|
79
|
+
enabled: boolean;
|
|
80
|
+
};
|
|
81
|
+
remap_dependencies: {
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
};
|
|
84
|
+
dependency_warning: {
|
|
85
|
+
enabled: boolean;
|
|
86
|
+
};
|
|
87
|
+
portfolios: {
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
}>;
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* Get the folders in a space
|
|
95
|
+
* @param spaceId The ID of the space to get folders from
|
|
96
|
+
* @returns A list of folders
|
|
97
|
+
*/
|
|
98
|
+
getFolders(spaceId: string): Promise<{
|
|
99
|
+
folders: Array<{
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
orderindex: number;
|
|
103
|
+
override_statuses: boolean;
|
|
104
|
+
hidden: boolean;
|
|
105
|
+
space: {
|
|
106
|
+
id: string;
|
|
107
|
+
name: string;
|
|
108
|
+
};
|
|
109
|
+
task_count: string;
|
|
110
|
+
lists: Array<{
|
|
111
|
+
id: string;
|
|
112
|
+
name: string;
|
|
113
|
+
orderindex: number;
|
|
114
|
+
status: {
|
|
115
|
+
status: string;
|
|
116
|
+
color: string;
|
|
117
|
+
hide_label: boolean;
|
|
118
|
+
};
|
|
119
|
+
priority: {
|
|
120
|
+
priority: string;
|
|
121
|
+
color: string;
|
|
122
|
+
};
|
|
123
|
+
assignee: {
|
|
124
|
+
id: number;
|
|
125
|
+
username: string;
|
|
126
|
+
color: string;
|
|
127
|
+
initials: string;
|
|
128
|
+
email: string;
|
|
129
|
+
profilePicture: string;
|
|
130
|
+
};
|
|
131
|
+
task_count: number;
|
|
132
|
+
due_date: string;
|
|
133
|
+
start_date: string;
|
|
134
|
+
folder: {
|
|
135
|
+
id: string;
|
|
136
|
+
name: string;
|
|
137
|
+
hidden: boolean;
|
|
138
|
+
access: boolean;
|
|
139
|
+
};
|
|
140
|
+
space: {
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
access: boolean;
|
|
144
|
+
};
|
|
145
|
+
archived: boolean;
|
|
146
|
+
override_statuses: boolean;
|
|
147
|
+
permission_level: string;
|
|
148
|
+
}>;
|
|
149
|
+
permission_level: string;
|
|
150
|
+
}>;
|
|
151
|
+
}>;
|
|
152
|
+
/**
|
|
153
|
+
* Get the lists in a folder
|
|
154
|
+
* @param folderId The ID of the folder to get lists from
|
|
155
|
+
* @returns A list of lists
|
|
156
|
+
*/
|
|
157
|
+
getLists(folderId: string): Promise<{
|
|
158
|
+
lists: Array<{
|
|
159
|
+
id: string;
|
|
160
|
+
name: string;
|
|
161
|
+
orderindex: number;
|
|
162
|
+
status: {
|
|
163
|
+
status: string;
|
|
164
|
+
color: string;
|
|
165
|
+
hide_label: boolean;
|
|
166
|
+
};
|
|
167
|
+
priority: {
|
|
168
|
+
priority: string;
|
|
169
|
+
color: string;
|
|
170
|
+
};
|
|
171
|
+
assignee: {
|
|
172
|
+
id: number;
|
|
173
|
+
username: string;
|
|
174
|
+
color: string;
|
|
175
|
+
initials: string;
|
|
176
|
+
email: string;
|
|
177
|
+
profilePicture: string;
|
|
178
|
+
};
|
|
179
|
+
task_count: number;
|
|
180
|
+
due_date: string;
|
|
181
|
+
start_date: string;
|
|
182
|
+
folder: {
|
|
183
|
+
id: string;
|
|
184
|
+
name: string;
|
|
185
|
+
hidden: boolean;
|
|
186
|
+
access: boolean;
|
|
187
|
+
};
|
|
188
|
+
space: {
|
|
189
|
+
id: string;
|
|
190
|
+
name: string;
|
|
191
|
+
access: boolean;
|
|
192
|
+
};
|
|
193
|
+
archived: boolean;
|
|
194
|
+
override_statuses: boolean;
|
|
195
|
+
permission_level: string;
|
|
196
|
+
}>;
|
|
197
|
+
}>;
|
|
198
|
+
/**
|
|
199
|
+
* Get the lists in a space
|
|
200
|
+
* @param spaceId The ID of the space to get lists from
|
|
201
|
+
* @returns A list of lists
|
|
202
|
+
*/
|
|
203
|
+
getListsFromSpace(spaceId: string): Promise<{
|
|
204
|
+
lists: Array<{
|
|
205
|
+
id: string;
|
|
206
|
+
name: string;
|
|
207
|
+
orderindex: number;
|
|
208
|
+
status: {
|
|
209
|
+
status: string;
|
|
210
|
+
color: string;
|
|
211
|
+
hide_label: boolean;
|
|
212
|
+
};
|
|
213
|
+
priority: {
|
|
214
|
+
priority: string;
|
|
215
|
+
color: string;
|
|
216
|
+
};
|
|
217
|
+
assignee: {
|
|
218
|
+
id: number;
|
|
219
|
+
username: string;
|
|
220
|
+
color: string;
|
|
221
|
+
initials: string;
|
|
222
|
+
email: string;
|
|
223
|
+
profilePicture: string;
|
|
224
|
+
};
|
|
225
|
+
task_count: number;
|
|
226
|
+
due_date: string;
|
|
227
|
+
start_date: string;
|
|
228
|
+
space: {
|
|
229
|
+
id: string;
|
|
230
|
+
name: string;
|
|
231
|
+
access: boolean;
|
|
232
|
+
};
|
|
233
|
+
archived: boolean;
|
|
234
|
+
override_statuses: boolean;
|
|
235
|
+
permission_level: string;
|
|
236
|
+
}>;
|
|
237
|
+
}>;
|
|
238
|
+
/**
|
|
239
|
+
* Get the seats information for a workspace
|
|
240
|
+
* @param workspaceId The ID of the workspace to get seats information for
|
|
241
|
+
* @returns Seats information including used, total, and available seats
|
|
242
|
+
*/
|
|
243
|
+
getWorkspaceSeats(workspaceId: string): Promise<{
|
|
244
|
+
members: object;
|
|
245
|
+
filled_members_seats: number;
|
|
246
|
+
total_member_seats: number;
|
|
247
|
+
empty_member_seats: number;
|
|
248
|
+
guests: object;
|
|
249
|
+
filled_guest_seats: number;
|
|
250
|
+
total_guest_seats: number;
|
|
251
|
+
empty_guest_seats: number;
|
|
252
|
+
}>;
|
|
253
|
+
}
|
|
254
|
+
export declare const createAuthClient: (client: ClickUpClient) => AuthClient;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export class AuthClient {
|
|
2
|
+
constructor(client) {
|
|
3
|
+
this.client = client;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Get the authorized user's information
|
|
7
|
+
* @returns The authorized user's information
|
|
8
|
+
*/
|
|
9
|
+
async getAuthorizedUser() {
|
|
10
|
+
try {
|
|
11
|
+
return await this.client.get('/user');
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
console.error('Error getting authorized user:', error);
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the workspaces (teams) that the authorized user belongs to
|
|
20
|
+
* @returns A list of workspaces
|
|
21
|
+
*/
|
|
22
|
+
async getWorkspaces() {
|
|
23
|
+
try {
|
|
24
|
+
return await this.client.get('/team');
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Error getting workspaces:', error);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get the spaces in a workspace
|
|
33
|
+
* @param workspaceId The ID of the workspace to get spaces from
|
|
34
|
+
* @returns A list of spaces
|
|
35
|
+
*/
|
|
36
|
+
async getSpaces(workspaceId) {
|
|
37
|
+
try {
|
|
38
|
+
return await this.client.get(`/team/${workspaceId}/space`);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
console.error('Error getting spaces:', error);
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get the folders in a space
|
|
47
|
+
* @param spaceId The ID of the space to get folders from
|
|
48
|
+
* @returns A list of folders
|
|
49
|
+
*/
|
|
50
|
+
async getFolders(spaceId) {
|
|
51
|
+
try {
|
|
52
|
+
return await this.client.get(`/space/${spaceId}/folder`);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.error('Error getting folders:', error);
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get the lists in a folder
|
|
61
|
+
* @param folderId The ID of the folder to get lists from
|
|
62
|
+
* @returns A list of lists
|
|
63
|
+
*/
|
|
64
|
+
async getLists(folderId) {
|
|
65
|
+
try {
|
|
66
|
+
return await this.client.get(`/folder/${folderId}/list`);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.error('Error getting lists:', error);
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get the lists in a space
|
|
75
|
+
* @param spaceId The ID of the space to get lists from
|
|
76
|
+
* @returns A list of lists
|
|
77
|
+
*/
|
|
78
|
+
async getListsFromSpace(spaceId) {
|
|
79
|
+
try {
|
|
80
|
+
return await this.client.get(`/space/${spaceId}/list`);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
console.error('Error getting lists from space:', error);
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get the seats information for a workspace
|
|
89
|
+
* @param workspaceId The ID of the workspace to get seats information for
|
|
90
|
+
* @returns Seats information including used, total, and available seats
|
|
91
|
+
*/
|
|
92
|
+
async getWorkspaceSeats(workspaceId) {
|
|
93
|
+
try {
|
|
94
|
+
return await this.client.get(`/team/${workspaceId}/seats`);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error('Error getting workspace seats:', error);
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export const createAuthClient = (client) => {
|
|
103
|
+
return new AuthClient(client);
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/clickup-client/auth.ts"],"names":[],"mappings":"AA4BA,MAAM,OAAO,UAAU;IAGrB,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,iBAAiB;QACrB,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;YACvD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa;QACjB,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;YAClD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,SAAS,CAAC,WAAmB;QA6CjC,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,WAAW,QAAQ,CAAC,CAAC;QAC7D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,C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