@kendew-agency/clickup-sdk 0.1.1

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 (119) hide show
  1. package/README.md +545 -0
  2. package/dist/clickup.d.ts +37 -0
  3. package/dist/clickup.d.ts.map +1 -0
  4. package/dist/clickup.js +44 -0
  5. package/dist/clickup.js.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +3 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/interfaces.d.ts +14 -0
  11. package/dist/interfaces.d.ts.map +1 -0
  12. package/dist/interfaces.js +2 -0
  13. package/dist/interfaces.js.map +1 -0
  14. package/dist/methods/attachments/attachments.d.ts +13 -0
  15. package/dist/methods/attachments/attachments.d.ts.map +1 -0
  16. package/dist/methods/attachments/attachments.js +27 -0
  17. package/dist/methods/attachments/attachments.js.map +1 -0
  18. package/dist/methods/attachments/types.d.ts +28 -0
  19. package/dist/methods/attachments/types.d.ts.map +1 -0
  20. package/dist/methods/attachments/types.js +2 -0
  21. package/dist/methods/attachments/types.js.map +1 -0
  22. package/dist/methods/authorization/authorization.d.ts +18 -0
  23. package/dist/methods/authorization/authorization.d.ts.map +1 -0
  24. package/dist/methods/authorization/authorization.js +28 -0
  25. package/dist/methods/authorization/authorization.js.map +1 -0
  26. package/dist/methods/authorization/types.d.ts +13 -0
  27. package/dist/methods/authorization/types.d.ts.map +1 -0
  28. package/dist/methods/authorization/types.js +2 -0
  29. package/dist/methods/authorization/types.js.map +1 -0
  30. package/dist/methods/base.d.ts +161 -0
  31. package/dist/methods/base.d.ts.map +1 -0
  32. package/dist/methods/base.js +314 -0
  33. package/dist/methods/base.js.map +1 -0
  34. package/dist/methods/comments/comments.d.ts +94 -0
  35. package/dist/methods/comments/comments.d.ts.map +1 -0
  36. package/dist/methods/comments/comments.js +158 -0
  37. package/dist/methods/comments/comments.js.map +1 -0
  38. package/dist/methods/comments/types.d.ts +70 -0
  39. package/dist/methods/comments/types.d.ts.map +1 -0
  40. package/dist/methods/comments/types.js +2 -0
  41. package/dist/methods/comments/types.js.map +1 -0
  42. package/dist/methods/custom-fields/custom-fields.d.ts +32 -0
  43. package/dist/methods/custom-fields/custom-fields.d.ts.map +1 -0
  44. package/dist/methods/custom-fields/custom-fields.js +43 -0
  45. package/dist/methods/custom-fields/custom-fields.js.map +1 -0
  46. package/dist/methods/custom-fields/types.d.ts +58 -0
  47. package/dist/methods/custom-fields/types.d.ts.map +1 -0
  48. package/dist/methods/custom-fields/types.js +2 -0
  49. package/dist/methods/custom-fields/types.js.map +1 -0
  50. package/dist/methods/custom-task-types/custom-task-types.d.ts +12 -0
  51. package/dist/methods/custom-task-types/custom-task-types.d.ts.map +1 -0
  52. package/dist/methods/custom-task-types/custom-task-types.js +15 -0
  53. package/dist/methods/custom-task-types/custom-task-types.js.map +1 -0
  54. package/dist/methods/custom-task-types/types.d.ts +15 -0
  55. package/dist/methods/custom-task-types/types.d.ts.map +1 -0
  56. package/dist/methods/custom-task-types/types.js +2 -0
  57. package/dist/methods/custom-task-types/types.js.map +1 -0
  58. package/dist/methods/folders/folders.d.ts +211 -0
  59. package/dist/methods/folders/folders.d.ts.map +1 -0
  60. package/dist/methods/folders/folders.js +80 -0
  61. package/dist/methods/folders/folders.js.map +1 -0
  62. package/dist/methods/folders/types.d.ts +71 -0
  63. package/dist/methods/folders/types.d.ts.map +1 -0
  64. package/dist/methods/folders/types.js +2 -0
  65. package/dist/methods/folders/types.js.map +1 -0
  66. package/dist/methods/goals/goals.d.ts +51 -0
  67. package/dist/methods/goals/goals.d.ts.map +1 -0
  68. package/dist/methods/goals/goals.js +86 -0
  69. package/dist/methods/goals/goals.js.map +1 -0
  70. package/dist/methods/goals/types.d.ts +92 -0
  71. package/dist/methods/goals/types.d.ts.map +1 -0
  72. package/dist/methods/goals/types.js +2 -0
  73. package/dist/methods/goals/types.js.map +1 -0
  74. package/dist/methods/lists/lists.d.ts +252 -0
  75. package/dist/methods/lists/lists.d.ts.map +1 -0
  76. package/dist/methods/lists/lists.js +132 -0
  77. package/dist/methods/lists/lists.js.map +1 -0
  78. package/dist/methods/lists/types.d.ts +91 -0
  79. package/dist/methods/lists/types.d.ts.map +1 -0
  80. package/dist/methods/lists/types.js +2 -0
  81. package/dist/methods/lists/types.js.map +1 -0
  82. package/dist/methods/spaces/spaces.d.ts +187 -0
  83. package/dist/methods/spaces/spaces.d.ts.map +1 -0
  84. package/dist/methods/spaces/spaces.js +87 -0
  85. package/dist/methods/spaces/spaces.js.map +1 -0
  86. package/dist/methods/spaces/types.d.ts +71 -0
  87. package/dist/methods/spaces/types.d.ts.map +1 -0
  88. package/dist/methods/spaces/types.js +2 -0
  89. package/dist/methods/spaces/types.js.map +1 -0
  90. package/dist/methods/tags/tags.d.ts +54 -0
  91. package/dist/methods/tags/tags.d.ts.map +1 -0
  92. package/dist/methods/tags/tags.js +65 -0
  93. package/dist/methods/tags/tags.js.map +1 -0
  94. package/dist/methods/tags/types.d.ts +27 -0
  95. package/dist/methods/tags/types.d.ts.map +1 -0
  96. package/dist/methods/tags/types.js +2 -0
  97. package/dist/methods/tags/types.js.map +1 -0
  98. package/dist/methods/tasks/tasks.d.ts +366 -0
  99. package/dist/methods/tasks/tasks.d.ts.map +1 -0
  100. package/dist/methods/tasks/tasks.js +214 -0
  101. package/dist/methods/tasks/tasks.js.map +1 -0
  102. package/dist/methods/tasks/types.d.ts +163 -0
  103. package/dist/methods/tasks/types.d.ts.map +1 -0
  104. package/dist/methods/tasks/types.js +2 -0
  105. package/dist/methods/tasks/types.js.map +1 -0
  106. package/dist/types/clickup.types.d.ts +35 -0
  107. package/dist/types/clickup.types.d.ts.map +1 -0
  108. package/dist/types/clickup.types.js +2 -0
  109. package/dist/types/clickup.types.js.map +1 -0
  110. package/dist/types/config.types.d.ts +14 -0
  111. package/dist/types/config.types.d.ts.map +1 -0
  112. package/dist/types/config.types.js +2 -0
  113. package/dist/types/config.types.js.map +1 -0
  114. package/dist/types/index.d.ts +14 -0
  115. package/dist/types/index.d.ts.map +1 -0
  116. package/dist/types/index.js +15 -0
  117. package/dist/types/index.js.map +1 -0
  118. package/licence +21 -0
  119. package/package.json +57 -0
package/README.md ADDED
@@ -0,0 +1,545 @@
1
+ # @kendew-agency/clickup-sdk
2
+
3
+ A type-safe Node.js SDK for the ClickUp API, built with TypeScript.
4
+
5
+ > **⚠️ Work in Progress**: This SDK is under active development. Not all ClickUp API methods are implemented yet. Check the [API Methods](#api-methods) section below for currently available endpoints. Some endpoints may also miss some functions.
6
+
7
+ > **📝 Note on ClickUp API**: The actual data returned by ClickUp's API may sometimes differ from their official documentation. We strive to keep our types accurate based on real-world API responses, but discrepancies may occur. Please report any type mismatches you encounter.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @kendew-agency/clickup-sdk
13
+ ```
14
+
15
+ ```bash
16
+ pnpm add @kendew-agency/clickup-sdk
17
+ ```
18
+
19
+ ```bash
20
+ yarn add @kendew-agency/clickup-sdk
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ ```typescript
26
+ import { ClickUp } from "@kendew-agency/clickup-sdk";
27
+
28
+ const clickup = new ClickUp({
29
+ apiToken: "your_api_token_here",
30
+ });
31
+
32
+ // Get authorized user
33
+ const user = await clickup.authorization.getAuthorizedUser();
34
+
35
+ // Get tasks from a list
36
+ const tasks = await clickup.tasks.getTasks("list_id");
37
+
38
+ // Create a task
39
+ const newTask = await clickup.tasks.createTask("list_id", {
40
+ name: "My new task",
41
+ description: "Task description",
42
+ });
43
+ ```
44
+
45
+ ## Authentication
46
+
47
+ The SDK supports two authentication methods:
48
+
49
+ ### Personal API Token
50
+
51
+ Generate a personal API token from your ClickUp settings:
52
+
53
+ ```typescript
54
+ const clickup = new ClickUp({
55
+ apiToken: "pk_your_personal_token",
56
+ });
57
+ ```
58
+
59
+ ### OAuth Token
60
+
61
+ Use OAuth for user-specific access:
62
+
63
+ ```typescript
64
+ // Exchange authorization code for access token
65
+ const tokenResponse = await clickup.authorization.getAccessToken({
66
+ client_id: "your_client_id",
67
+ client_secret: "your_client_secret",
68
+ code: "authorization_code",
69
+ });
70
+
71
+ // Create SDK instance with OAuth token
72
+ const clickup = new ClickUp({
73
+ apiToken: tokenResponse.access_token,
74
+ });
75
+ ```
76
+
77
+ ## Configuration
78
+
79
+ ### Basic Configuration
80
+
81
+ ```typescript
82
+ const clickup = new ClickUp({
83
+ apiToken: "your_token",
84
+ });
85
+ ```
86
+
87
+ ### Custom Headers
88
+
89
+ Add custom headers to all requests (useful for Next.js tags, etc.):
90
+
91
+ ```typescript
92
+ const clickup = new ClickUp({
93
+ apiToken: "your_token",
94
+ headers: {
95
+ "X-Custom-Header": "value",
96
+ },
97
+ });
98
+ ```
99
+
100
+ ### Configuration Override
101
+
102
+ Create a new instance with modified configuration:
103
+
104
+ ```typescript
105
+ const clickupWithCustomHeaders = clickup.withConfig({
106
+ headers: {
107
+ "X-Request-ID": "unique-id",
108
+ },
109
+ });
110
+ ```
111
+
112
+ ## API Methods
113
+
114
+ ### Currently Implemented
115
+
116
+ The following API endpoints are currently implemented in this SDK:
117
+
118
+ - **Authorization**: OAuth token exchange, get authorized user
119
+ - **Tasks**: Get, create, update, delete tasks, manage dependencies and links
120
+ - **Comments**: Task, list, and chat view comments with threading support
121
+ - **Attachments**: Upload task attachments
122
+ - **Custom Task Types**: Get workspace custom task types
123
+ - **Spaces**: Get, create, update, delete spaces
124
+ - **Folders**: Get, create, update, delete folders
125
+ - **Lists**: Get, create, update, delete lists
126
+ - **Goals**: Get, create, update, delete goals
127
+ - **Tags**: Get, create, update, delete tags, manage task tags
128
+ - **Custom Fields**: Get accessible fields, set and remove values
129
+
130
+ Additional ClickUp API endpoints will be added in future releases. Contributions are welcome!
131
+
132
+ ### Authorization
133
+
134
+ ```typescript
135
+ // Get access token via OAuth
136
+ const token = await clickup.authorization.getAccessToken({
137
+ client_id: "your_client_id",
138
+ client_secret: "your_client_secret",
139
+ code: "authorization_code",
140
+ });
141
+
142
+ // Get authorized user information
143
+ const user = await clickup.authorization.getAuthorizedUser();
144
+ ```
145
+
146
+ ### Tasks
147
+
148
+ ```typescript
149
+ // Get tasks from a list
150
+ const tasks = await clickup.tasks.getTasks("list_id", {
151
+ page: 0,
152
+ order_by: "created",
153
+ reverse: true,
154
+ subtasks: true,
155
+ include_closed: false,
156
+ });
157
+
158
+ // Get a single task
159
+ const task = await clickup.tasks.getTask("task_id");
160
+
161
+ // Create a task
162
+ const newTask = await clickup.tasks.createTask("list_id", {
163
+ name: "Task name",
164
+ description: "Task description",
165
+ assignees: [123],
166
+ tags: ["tag1"],
167
+ status: "Open",
168
+ priority: 3,
169
+ due_date: 1508369194377,
170
+ notify_all: true,
171
+ });
172
+
173
+ // Update a task
174
+ const updated = await clickup.tasks.updateTask("task_id", {
175
+ name: "Updated name",
176
+ status: "In Progress",
177
+ priority: 2,
178
+ });
179
+
180
+ // Delete a task
181
+ await clickup.tasks.deleteTask("task_id");
182
+
183
+ // Add task dependency
184
+ await clickup.tasks.addDependency("task_id", {
185
+ depends_on: "other_task_id",
186
+ });
187
+
188
+ // Delete task dependency
189
+ await clickup.tasks.deleteDependency("task_id", {
190
+ depends_on: "other_task_id",
191
+ });
192
+
193
+ // Add task link
194
+ await clickup.tasks.addTaskLink("task_id", {
195
+ links_to: "other_task_id",
196
+ });
197
+
198
+ // Delete task link
199
+ await clickup.tasks.deleteTaskLink("task_id", {
200
+ links_to: "other_task_id",
201
+ });
202
+ ```
203
+
204
+ ### Comments
205
+
206
+ ```typescript
207
+ // Get task comments (paginated, max 25 per request)
208
+ const comments = await clickup.comments.getTaskComments("task_id", {
209
+ start: 0,
210
+ });
211
+
212
+ // Create task comment
213
+ const comment = await clickup.comments.createTaskComment("task_id", {
214
+ comment_text: "This is a comment",
215
+ notify_all: true,
216
+ });
217
+
218
+ // Update comment
219
+ await clickup.comments.updateComment("comment_id", {
220
+ comment_text: "Updated comment",
221
+ });
222
+
223
+ // Delete comment
224
+ await clickup.comments.deleteComment("comment_id");
225
+
226
+ // Get threaded comments
227
+ const replies = await clickup.comments.getThreadedComments("comment_id");
228
+
229
+ // Create threaded comment
230
+ await clickup.comments.createThreadedComment("comment_id", {
231
+ comment_text: "Reply to comment",
232
+ });
233
+
234
+ // Get chat view comments
235
+ const chatComments = await clickup.comments.getChatViewComments("view_id", {
236
+ start: 0,
237
+ });
238
+
239
+ // Create chat view comment
240
+ await clickup.comments.createChatViewComment("view_id", {
241
+ comment_text: "Chat message",
242
+ });
243
+
244
+ // Get list comments
245
+ const listComments = await clickup.comments.getListComments("list_id", {
246
+ start: 0,
247
+ });
248
+
249
+ // Create list comment
250
+ await clickup.comments.createListComment("list_id", {
251
+ comment_text: "List comment",
252
+ });
253
+ ```
254
+
255
+ ### Attachments
256
+
257
+ ```typescript
258
+ // Upload task attachment
259
+ const attachment = await clickup.attachments.uploadTaskAttachment(
260
+ "task_id",
261
+ {
262
+ attachment: fileBuffer, // Buffer or File object
263
+ filename: "document.pdf",
264
+ },
265
+ );
266
+ ```
267
+
268
+ ### Custom Task Types
269
+
270
+ ```typescript
271
+ // Get workspace custom task types
272
+ const taskTypes = await clickup.customTaskTypes.getCustomTaskTypes(
273
+ "workspace_id",
274
+ );
275
+ ```
276
+
277
+ ### Spaces
278
+
279
+ ```typescript
280
+ // Get spaces in a workspace
281
+ const spaces = await clickup.spaces.getSpaces("workspace_id", {
282
+ archived: false,
283
+ });
284
+
285
+ // Get a single space
286
+ const space = await clickup.spaces.getSpace("space_id");
287
+
288
+ // Create a space
289
+ const newSpace = await clickup.spaces.createSpace("workspace_id", {
290
+ name: "New Space",
291
+ multiple_assignees: true,
292
+ features: {
293
+ due_dates: { enabled: true },
294
+ time_tracking: { enabled: true },
295
+ },
296
+ });
297
+
298
+ // Update a space
299
+ await clickup.spaces.updateSpace("space_id", {
300
+ name: "Updated Space",
301
+ });
302
+
303
+ // Delete a space
304
+ await clickup.spaces.deleteSpace("space_id");
305
+ ```
306
+
307
+ ### Folders
308
+
309
+ ```typescript
310
+ // Get folders in a space
311
+ const folders = await clickup.folders.getFolders("space_id", {
312
+ archived: false,
313
+ });
314
+
315
+ // Get a single folder
316
+ const folder = await clickup.folders.getFolder("folder_id");
317
+
318
+ // Create a folder
319
+ const newFolder = await clickup.folders.createFolder("space_id", {
320
+ name: "New Folder",
321
+ });
322
+
323
+ // Update a folder
324
+ await clickup.folders.updateFolder("folder_id", {
325
+ name: "Updated Folder",
326
+ });
327
+
328
+ // Delete a folder
329
+ await clickup.folders.deleteFolder("folder_id");
330
+ ```
331
+
332
+ ### Lists
333
+
334
+ ```typescript
335
+ // Get lists in a folder
336
+ const lists = await clickup.lists.getLists("folder_id", {
337
+ archived: false,
338
+ });
339
+
340
+ // Get folderless lists in a space
341
+ const folderlessLists = await clickup.lists.getFolderlessLists("space_id", {
342
+ archived: false,
343
+ });
344
+
345
+ // Get a single list
346
+ const list = await clickup.lists.getList("list_id");
347
+
348
+ // Create a list
349
+ const newList = await clickup.lists.createList("folder_id", {
350
+ name: "New List",
351
+ content: "List description",
352
+ priority: 1,
353
+ status: "active",
354
+ });
355
+
356
+ // Update a list
357
+ await clickup.lists.updateList("list_id", {
358
+ name: "Updated List",
359
+ });
360
+
361
+ // Delete a list
362
+ await clickup.lists.deleteList("list_id");
363
+ ```
364
+
365
+ ### Goals
366
+
367
+ ```typescript
368
+ // Get goals in a workspace
369
+ const goals = await clickup.goals.getGoals("workspace_id");
370
+
371
+ // Get a single goal
372
+ const goal = await clickup.goals.getGoal("goal_id");
373
+
374
+ // Create a goal
375
+ const newGoal = await clickup.goals.createGoal("workspace_id", {
376
+ name: "Q1 Goals",
377
+ due_date: 1609459200000,
378
+ description: "First quarter objectives",
379
+ multiple_owners: true,
380
+ owners: [123],
381
+ color: "#32a852",
382
+ });
383
+
384
+ // Update a goal
385
+ await clickup.goals.updateGoal("goal_id", {
386
+ name: "Updated Goal",
387
+ });
388
+
389
+ // Delete a goal
390
+ await clickup.goals.deleteGoal("goal_id");
391
+ ```
392
+
393
+ ### Tags
394
+
395
+ ```typescript
396
+ // Get tags in a space
397
+ const tags = await clickup.tags.getTags("space_id");
398
+
399
+ // Create a tag
400
+ const newTag = await clickup.tags.createTag("space_id", {
401
+ name: "urgent",
402
+ });
403
+
404
+ // Update a tag
405
+ await clickup.tags.updateTag("space_id", "tag_name", {
406
+ name: "high-priority",
407
+ });
408
+
409
+ // Delete a tag
410
+ await clickup.tags.deleteTag("space_id", "tag_name");
411
+
412
+ // Add tag to task
413
+ await clickup.tags.addTagToTask("task_id", {
414
+ tag_name: "urgent",
415
+ });
416
+
417
+ // Remove tag from task
418
+ await clickup.tags.removeTagFromTask("task_id", "tag_name");
419
+ ```
420
+
421
+ ### Custom Fields
422
+
423
+ ```typescript
424
+ // Get accessible custom fields
425
+ const customFields = await clickup.customFields.getAccessibleCustomFields(
426
+ "list_id",
427
+ );
428
+
429
+ // Set custom field value
430
+ await clickup.customFields.setCustomFieldValue("task_id", "field_id", {
431
+ value: "custom value",
432
+ });
433
+
434
+ // Remove custom field value
435
+ await clickup.customFields.removeCustomFieldValue("task_id", "field_id");
436
+ ```
437
+
438
+ ## Pagination
439
+
440
+ Many endpoints support pagination using `start` and `start_id` parameters:
441
+
442
+ ```typescript
443
+ // First page
444
+ const firstPage = await clickup.comments.getTaskComments("task_id", {
445
+ start: 0,
446
+ });
447
+
448
+ // Next page
449
+ const nextPage = await clickup.comments.getTaskComments("task_id", {
450
+ start: 25,
451
+ start_id: firstPage.comments[24].id,
452
+ });
453
+ ```
454
+
455
+ ## Custom Task IDs
456
+
457
+ ClickUp supports custom task IDs. Enable them in your requests:
458
+
459
+ ```typescript
460
+ const task = await clickup.tasks.getTask("CUSTOM-123", {
461
+ custom_task_ids: true,
462
+ team_id: "your_team_id",
463
+ });
464
+ ```
465
+
466
+ ## Error Handling
467
+
468
+ The SDK uses a `Response<T>` type that includes error information:
469
+
470
+ ```typescript
471
+ const result = await clickup.tasks.getTask("task_id");
472
+
473
+ if ("err" in result) {
474
+ console.error("Error:", result.err);
475
+ console.error("Error code:", result.ECODE);
476
+ } else {
477
+ console.log("Task:", result);
478
+ }
479
+ ```
480
+
481
+ ## TypeScript Support
482
+
483
+ The SDK is written in TypeScript and provides full type definitions:
484
+
485
+ ```typescript
486
+ import type {
487
+ CreateTaskParams,
488
+ GetTaskResponse,
489
+ ClickUpConfig,
490
+ } from "@kendew-agency/clickup-sdk";
491
+ ```
492
+
493
+ Import types from the `/types` export:
494
+
495
+ ```typescript
496
+ import type { User, Pagination } from "@kendew-agency/clickup-sdk/types";
497
+ ```
498
+
499
+ ## Development
500
+
501
+ ```bash
502
+ # Install dependencies
503
+ pnpm install
504
+
505
+ # Build the project
506
+ pnpm build
507
+
508
+ # Run tests
509
+ pnpm test
510
+
511
+ # Run tests in watch mode
512
+ pnpm test:watch
513
+
514
+ # Run tests with UI
515
+ pnpm test:ui
516
+
517
+ # Run tests with coverage
518
+ pnpm test:coverage
519
+
520
+ # Lint and format
521
+ pnpm biome check
522
+
523
+ # Auto-fix linting and formatting issues
524
+ pnpm biome check --write
525
+ ```
526
+
527
+ ## License
528
+
529
+ MIT
530
+
531
+ ## Links
532
+
533
+ - [ClickUp API Documentation](https://developer.clickup.com/docs/)
534
+ - [GitHub Repository](https://github.com/Kendew-Agency/clickup-sdk)
535
+ - [Issue Tracker](https://github.com/Kendew-Agency/clickup-sdk/issues)
536
+
537
+ ## Contributing
538
+
539
+ Contributions are welcome! Please feel free to submit a Pull Request.
540
+
541
+ ### Known Issues
542
+
543
+ - Not all ClickUp API endpoints are implemented yet
544
+ - Some response types may not perfectly match ClickUp's documentation due to discrepancies between documented and actual API responses
545
+ - If you encounter type mismatches or missing methods, please open an issue with details about the endpoint and expected vs actual behavior
@@ -0,0 +1,37 @@
1
+ import { Attachments } from "./methods/attachments/attachments";
2
+ import { Authorization } from "./methods/authorization/authorization";
3
+ import { Comments } from "./methods/comments/comments";
4
+ import { CustomFields } from "./methods/custom-fields/custom-fields";
5
+ import { CustomTaskTypes } from "./methods/custom-task-types/custom-task-types";
6
+ import { Folders } from "./methods/folders/folders";
7
+ import { Goals } from "./methods/goals/goals";
8
+ import { Lists } from "./methods/lists/lists";
9
+ import { Spaces } from "./methods/spaces/spaces";
10
+ import { Tags } from "./methods/tags/tags";
11
+ import { Tasks } from "./methods/tasks/tasks";
12
+ import type { ClickUpConfig } from "./types/config.types";
13
+ /**
14
+ * ClickUp SDK
15
+ * @see https://developer.clickup.com/docs/
16
+ */
17
+ export declare class ClickUp {
18
+ private config;
19
+ attachments: Attachments;
20
+ authorization: Authorization;
21
+ comments: Comments;
22
+ customFields: CustomFields;
23
+ customTaskTypes: CustomTaskTypes;
24
+ folders: Folders;
25
+ goals: Goals;
26
+ lists: Lists;
27
+ spaces: Spaces;
28
+ tags: Tags;
29
+ tasks: Tasks;
30
+ constructor(config: ClickUpConfig);
31
+ /**
32
+ * Modify the ClickUp SDK instance
33
+ * @description This shallow merges the current config with the new config and returns a new instance
34
+ */
35
+ withConfig(overrides: Partial<ClickUpConfig>): ClickUp;
36
+ }
37
+ //# sourceMappingURL=clickup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clickup.d.ts","sourceRoot":"","sources":["../src/clickup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,MAAM,CAAgB;IAEvB,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;gBAER,MAAM,EAAE,aAAa;IAiBjC;;;OAGG;IACI,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO;CAM9D"}
@@ -0,0 +1,44 @@
1
+ import { Attachments } from "./methods/attachments/attachments";
2
+ import { Authorization } from "./methods/authorization/authorization";
3
+ import { Comments } from "./methods/comments/comments";
4
+ import { CustomFields } from "./methods/custom-fields/custom-fields";
5
+ import { CustomTaskTypes } from "./methods/custom-task-types/custom-task-types";
6
+ import { Folders } from "./methods/folders/folders";
7
+ import { Goals } from "./methods/goals/goals";
8
+ import { Lists } from "./methods/lists/lists";
9
+ import { Spaces } from "./methods/spaces/spaces";
10
+ import { Tags } from "./methods/tags/tags";
11
+ import { Tasks } from "./methods/tasks/tasks";
12
+ /**
13
+ * ClickUp SDK
14
+ * @see https://developer.clickup.com/docs/
15
+ */
16
+ export class ClickUp {
17
+ constructor(config) {
18
+ if (!config.apiToken)
19
+ throw new Error("API token is required");
20
+ this.config = config;
21
+ this.attachments = new Attachments(this.config);
22
+ this.authorization = new Authorization(this.config);
23
+ this.comments = new Comments(this.config);
24
+ this.customFields = new CustomFields(this.config);
25
+ this.customTaskTypes = new CustomTaskTypes(this.config);
26
+ this.folders = new Folders(this.config);
27
+ this.goals = new Goals(this.config);
28
+ this.lists = new Lists(this.config);
29
+ this.spaces = new Spaces(this.config);
30
+ this.tags = new Tags(this.config);
31
+ this.tasks = new Tasks(this.config);
32
+ }
33
+ /**
34
+ * Modify the ClickUp SDK instance
35
+ * @description This shallow merges the current config with the new config and returns a new instance
36
+ */
37
+ withConfig(overrides) {
38
+ return new ClickUp({
39
+ ...this.config,
40
+ ...overrides,
41
+ });
42
+ }
43
+ }
44
+ //# sourceMappingURL=clickup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clickup.js","sourceRoot":"","sources":["../src/clickup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAG9C;;;GAGG;AACH,MAAM,OAAO,OAAO;IAelB,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC/D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,SAAiC;QACjD,OAAO,IAAI,OAAO,CAAC;YACjB,GAAG,IAAI,CAAC,MAAM;YACd,GAAG,SAAS;SACb,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export { ClickUp } from "./clickup";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { ClickUp } from "./clickup";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type CLICKUP_ERROR_CODE_KEY = "unauthorized" | "unknow_error";
2
+ export type Response<T> = {
3
+ data: T;
4
+ error: null;
5
+ } | {
6
+ error: ErrorResponse;
7
+ data: null;
8
+ };
9
+ export type ErrorResponse = {
10
+ message: string;
11
+ statusCode: number | null;
12
+ name: CLICKUP_ERROR_CODE_KEY;
13
+ };
14
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,cAAc,CAAC;AAErE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAClB;IACE,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,IAAI,CAAC;CACb,GACD;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzC,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,sBAAsB,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { Base } from "../base";
2
+ import type { CreateTaskAttachemntParams, CreateTaskAttachemntResponse } from "./types";
3
+ export declare class Attachments extends Base {
4
+ /**
5
+ * Create a new task attachment
6
+ *
7
+ * @param params paramaters for creating a task attachment
8
+ * @returns the file stored in ClickUp or an error
9
+ * @see https://developer.clickup.com/reference/createtaskattachment
10
+ */
11
+ createTaskAttachement(params: CreateTaskAttachemntParams): Promise<import("../../interfaces").Response<CreateTaskAttachemntResponse>>;
12
+ }
13
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../../src/methods/attachments/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,KAAK,EACV,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AAEjB,qBAAa,WAAY,SAAQ,IAAI;IACnC;;;;;;OAMG;IACU,qBAAqB,CAAC,MAAM,EAAE,0BAA0B;CAqBtE"}