@skillful-ai/piece-clickup-extended 0.1.3 → 0.1.5

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 (178) hide show
  1. package/.eslintrc.json +18 -0
  2. package/package.json +2 -2
  3. package/project.json +51 -0
  4. package/src/index.ts +124 -0
  5. package/src/lib/actions/attachments/create-task-attachment.ts +78 -0
  6. package/src/lib/actions/chat/create-channel-in-space-folder-list.ts +80 -0
  7. package/src/lib/actions/chat/create-channel.ts +64 -0
  8. package/src/lib/actions/chat/create-message-reaction.ts +37 -0
  9. package/src/lib/actions/chat/create-message-reply.ts +52 -0
  10. package/src/lib/actions/chat/create-message.ts +48 -0
  11. package/src/lib/actions/chat/delete-message-reaction.ts +37 -0
  12. package/src/lib/actions/chat/delete-message.ts +32 -0
  13. package/src/lib/actions/chat/get-channel-messages.ts +63 -0
  14. package/src/lib/actions/chat/get-channel.ts +27 -0
  15. package/src/lib/actions/chat/get-channels.ts +55 -0
  16. package/src/lib/actions/chat/get-message-reactions.ts +32 -0
  17. package/src/lib/actions/chat/get-message-replies.ts +32 -0
  18. package/src/lib/actions/chat/update-message.ts +51 -0
  19. package/src/lib/actions/comments/create-task-comment.ts +60 -0
  20. package/src/lib/actions/comments/get-task-comments.ts +29 -0
  21. package/src/lib/actions/custom-fields/get-accessible-custom-fields.ts +21 -0
  22. package/src/lib/actions/custom-fields/set-custom-fields-value.ts +35 -0
  23. package/src/lib/actions/folders/create-folder.ts +30 -0
  24. package/src/lib/actions/folders/get-folders.ts +25 -0
  25. package/src/lib/actions/lists/create-folderless-list.ts +33 -0
  26. package/src/lib/actions/lists/create-list-in-folder.ts +31 -0
  27. package/src/lib/actions/lists/get-list.ts +30 -0
  28. package/src/lib/actions/lists/get-lists-in-folder.ts +26 -0
  29. package/src/lib/actions/spaces/get-space.ts +25 -0
  30. package/src/lib/actions/spaces/get-spaces.ts +52 -0
  31. package/src/lib/actions/tasks/create-subtask.ts +232 -0
  32. package/src/lib/actions/tasks/create-task-from-template.ts +36 -0
  33. package/src/lib/actions/tasks/create-task.ts +230 -0
  34. package/src/lib/actions/tasks/delete-task.ts +31 -0
  35. package/src/lib/actions/tasks/filter-workspace-tasks.ts +121 -0
  36. package/src/lib/actions/tasks/filter-workspace-time-entries.ts +94 -0
  37. package/src/lib/actions/tasks/get-task-by-name.ts +57 -0
  38. package/src/lib/actions/tasks/get-task.ts +36 -0
  39. package/src/lib/actions/tasks/get-tasks-in-list.ts +27 -0
  40. package/src/lib/actions/tasks/update-task.ts +95 -0
  41. package/src/lib/actions/teams/get-teams.ts +23 -0
  42. package/src/lib/clickup.mdx +36 -0
  43. package/src/lib/common/index.ts +652 -0
  44. package/src/lib/common/models.ts +127 -0
  45. package/src/lib/triggers/index.ts +965 -0
  46. package/src/lib/triggers/register-trigger.ts +137 -0
  47. package/src/lib/triggers/task-tag-updated.ts +125 -0
  48. package/tsconfig.json +16 -0
  49. package/tsconfig.lib.json +11 -0
  50. package/src/index.d.ts +0 -2
  51. package/src/index.js +0 -123
  52. package/src/index.js.map +0 -1
  53. package/src/lib/actions/attachments/create-task-attachment.d.ts +0 -10
  54. package/src/lib/actions/attachments/create-task-attachment.js +0 -71
  55. package/src/lib/actions/attachments/create-task-attachment.js.map +0 -1
  56. package/src/lib/actions/chat/create-channel-in-space-folder-list.d.ts +0 -8
  57. package/src/lib/actions/chat/create-channel-in-space-folder-list.js +0 -77
  58. package/src/lib/actions/chat/create-channel-in-space-folder-list.js.map +0 -1
  59. package/src/lib/actions/chat/create-channel.d.ts +0 -7
  60. package/src/lib/actions/chat/create-channel.js +0 -62
  61. package/src/lib/actions/chat/create-channel.js.map +0 -1
  62. package/src/lib/actions/chat/create-message-reaction.d.ts +0 -5
  63. package/src/lib/actions/chat/create-message-reaction.js +0 -36
  64. package/src/lib/actions/chat/create-message-reaction.js.map +0 -1
  65. package/src/lib/actions/chat/create-message-reply.d.ts +0 -6
  66. package/src/lib/actions/chat/create-message-reply.js +0 -51
  67. package/src/lib/actions/chat/create-message-reply.js.map +0 -1
  68. package/src/lib/actions/chat/create-message.d.ts +0 -6
  69. package/src/lib/actions/chat/create-message.js +0 -47
  70. package/src/lib/actions/chat/create-message.js.map +0 -1
  71. package/src/lib/actions/chat/delete-message-reaction.d.ts +0 -5
  72. package/src/lib/actions/chat/delete-message-reaction.js +0 -36
  73. package/src/lib/actions/chat/delete-message-reaction.js.map +0 -1
  74. package/src/lib/actions/chat/delete-message.d.ts +0 -4
  75. package/src/lib/actions/chat/delete-message.js +0 -31
  76. package/src/lib/actions/chat/delete-message.js.map +0 -1
  77. package/src/lib/actions/chat/get-channel-messages.d.ts +0 -6
  78. package/src/lib/actions/chat/get-channel-messages.js +0 -55
  79. package/src/lib/actions/chat/get-channel-messages.js.map +0 -1
  80. package/src/lib/actions/chat/get-channel.d.ts +0 -4
  81. package/src/lib/actions/chat/get-channel.js +0 -26
  82. package/src/lib/actions/chat/get-channel.js.map +0 -1
  83. package/src/lib/actions/chat/get-channels.d.ts +0 -5
  84. package/src/lib/actions/chat/get-channels.js +0 -48
  85. package/src/lib/actions/chat/get-channels.js.map +0 -1
  86. package/src/lib/actions/chat/get-message-reactions.d.ts +0 -4
  87. package/src/lib/actions/chat/get-message-reactions.js +0 -31
  88. package/src/lib/actions/chat/get-message-reactions.js.map +0 -1
  89. package/src/lib/actions/chat/get-message-replies.d.ts +0 -4
  90. package/src/lib/actions/chat/get-message-replies.js +0 -31
  91. package/src/lib/actions/chat/get-message-replies.js.map +0 -1
  92. package/src/lib/actions/chat/update-message.d.ts +0 -6
  93. package/src/lib/actions/chat/update-message.js +0 -50
  94. package/src/lib/actions/chat/update-message.js.map +0 -1
  95. package/src/lib/actions/comments/create-task-comment.d.ts +0 -8
  96. package/src/lib/actions/comments/create-task-comment.js +0 -46
  97. package/src/lib/actions/comments/create-task-comment.js.map +0 -1
  98. package/src/lib/actions/comments/get-task-comments.d.ts +0 -3
  99. package/src/lib/actions/comments/get-task-comments.js +0 -29
  100. package/src/lib/actions/comments/get-task-comments.js.map +0 -1
  101. package/src/lib/actions/custom-fields/get-accessible-custom-fields.d.ts +0 -5
  102. package/src/lib/actions/custom-fields/get-accessible-custom-fields.js +0 -26
  103. package/src/lib/actions/custom-fields/get-accessible-custom-fields.js.map +0 -1
  104. package/src/lib/actions/custom-fields/set-custom-fields-value.d.ts +0 -8
  105. package/src/lib/actions/custom-fields/set-custom-fields-value.js +0 -34
  106. package/src/lib/actions/custom-fields/set-custom-fields-value.js.map +0 -1
  107. package/src/lib/actions/folders/create-folder.d.ts +0 -5
  108. package/src/lib/actions/folders/create-folder.js +0 -31
  109. package/src/lib/actions/folders/create-folder.js.map +0 -1
  110. package/src/lib/actions/folders/get-folders.d.ts +0 -4
  111. package/src/lib/actions/folders/get-folders.js +0 -26
  112. package/src/lib/actions/folders/get-folders.js.map +0 -1
  113. package/src/lib/actions/lists/create-folderless-list.d.ts +0 -5
  114. package/src/lib/actions/lists/create-folderless-list.js +0 -33
  115. package/src/lib/actions/lists/create-folderless-list.js.map +0 -1
  116. package/src/lib/actions/lists/create-list-in-folder.d.ts +0 -6
  117. package/src/lib/actions/lists/create-list-in-folder.js +0 -32
  118. package/src/lib/actions/lists/create-list-in-folder.js.map +0 -1
  119. package/src/lib/actions/lists/get-list.d.ts +0 -3
  120. package/src/lib/actions/lists/get-list.js +0 -29
  121. package/src/lib/actions/lists/get-list.js.map +0 -1
  122. package/src/lib/actions/lists/get-lists-in-folder.d.ts +0 -5
  123. package/src/lib/actions/lists/get-lists-in-folder.js +0 -27
  124. package/src/lib/actions/lists/get-lists-in-folder.js.map +0 -1
  125. package/src/lib/actions/spaces/get-space.d.ts +0 -3
  126. package/src/lib/actions/spaces/get-space.js +0 -25
  127. package/src/lib/actions/spaces/get-space.js.map +0 -1
  128. package/src/lib/actions/spaces/get-spaces.d.ts +0 -3
  129. package/src/lib/actions/spaces/get-spaces.js +0 -43
  130. package/src/lib/actions/spaces/get-spaces.js.map +0 -1
  131. package/src/lib/actions/tasks/create-subtask.d.ts +0 -20
  132. package/src/lib/actions/tasks/create-subtask.js +0 -149
  133. package/src/lib/actions/tasks/create-subtask.js.map +0 -1
  134. package/src/lib/actions/tasks/create-task-from-template.d.ts +0 -7
  135. package/src/lib/actions/tasks/create-task-from-template.js +0 -35
  136. package/src/lib/actions/tasks/create-task-from-template.js.map +0 -1
  137. package/src/lib/actions/tasks/create-task.d.ts +0 -19
  138. package/src/lib/actions/tasks/create-task.js +0 -147
  139. package/src/lib/actions/tasks/create-task.js.map +0 -1
  140. package/src/lib/actions/tasks/delete-task.d.ts +0 -6
  141. package/src/lib/actions/tasks/delete-task.js +0 -28
  142. package/src/lib/actions/tasks/delete-task.js.map +0 -1
  143. package/src/lib/actions/tasks/filter-workspace-tasks.d.ts +0 -12
  144. package/src/lib/actions/tasks/filter-workspace-tasks.js +0 -103
  145. package/src/lib/actions/tasks/filter-workspace-tasks.js.map +0 -1
  146. package/src/lib/actions/tasks/filter-workspace-time-entries.d.ts +0 -12
  147. package/src/lib/actions/tasks/filter-workspace-time-entries.js +0 -77
  148. package/src/lib/actions/tasks/filter-workspace-time-entries.js.map +0 -1
  149. package/src/lib/actions/tasks/get-task-by-name.d.ts +0 -6
  150. package/src/lib/actions/tasks/get-task-by-name.js +0 -48
  151. package/src/lib/actions/tasks/get-task-by-name.js.map +0 -1
  152. package/src/lib/actions/tasks/get-task.d.ts +0 -4
  153. package/src/lib/actions/tasks/get-task.js +0 -35
  154. package/src/lib/actions/tasks/get-task.js.map +0 -1
  155. package/src/lib/actions/tasks/get-tasks-in-list.d.ts +0 -6
  156. package/src/lib/actions/tasks/get-tasks-in-list.js +0 -28
  157. package/src/lib/actions/tasks/get-tasks-in-list.js.map +0 -1
  158. package/src/lib/actions/tasks/update-task.d.ts +0 -12
  159. package/src/lib/actions/tasks/update-task.js +0 -51
  160. package/src/lib/actions/tasks/update-task.js.map +0 -1
  161. package/src/lib/actions/teams/get-teams.d.ts +0 -1
  162. package/src/lib/actions/teams/get-teams.js +0 -22
  163. package/src/lib/actions/teams/get-teams.js.map +0 -1
  164. package/src/lib/common/index.d.ts +0 -69
  165. package/src/lib/common/index.js +0 -497
  166. package/src/lib/common/index.js.map +0 -1
  167. package/src/lib/common/models.d.ts +0 -124
  168. package/src/lib/common/models.js +0 -3
  169. package/src/lib/common/models.js.map +0 -1
  170. package/src/lib/triggers/index.d.ts +0 -112
  171. package/src/lib/triggers/index.js +0 -964
  172. package/src/lib/triggers/index.js.map +0 -1
  173. package/src/lib/triggers/register-trigger.d.ts +0 -27
  174. package/src/lib/triggers/register-trigger.js +0 -89
  175. package/src/lib/triggers/register-trigger.js.map +0 -1
  176. package/src/lib/triggers/task-tag-updated.d.ts +0 -17
  177. package/src/lib/triggers/task-tag-updated.js +0 -97
  178. package/src/lib/triggers/task-tag-updated.js.map +0 -1
package/.eslintrc.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": ["../../../../.eslintrc.json"],
3
+ "ignorePatterns": ["!**/*"],
4
+ "overrides": [
5
+ {
6
+ "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7
+ "rules": {}
8
+ },
9
+ {
10
+ "files": ["*.ts", "*.tsx"],
11
+ "rules": {}
12
+ },
13
+ {
14
+ "files": ["*.js", "*.jsx"],
15
+ "rules": {}
16
+ }
17
+ ]
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillful-ai/piece-clickup-extended",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -20,4 +20,4 @@
20
20
  "tslib": "^2.3.0",
21
21
  "zod": "3.25.76"
22
22
  }
23
- }
23
+ }
package/project.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "pieces-clickup-extended",
3
+ "$schema": "../../../../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "packages/pieces/custom/clickup-extended/src",
5
+ "projectType": "library",
6
+ "release": {
7
+ "version": {
8
+ "manifestRootsToUpdate": [
9
+ "dist/{projectRoot}"
10
+ ],
11
+ "currentVersionResolver": "git-tag",
12
+ "fallbackCurrentVersionResolver": "disk"
13
+ }
14
+ },
15
+ "tags": [],
16
+ "targets": {
17
+ "build": {
18
+ "executor": "@nx/js:tsc",
19
+ "outputs": [
20
+ "{options.outputPath}"
21
+ ],
22
+ "options": {
23
+ "outputPath": "dist/packages/pieces/custom/clickup-extended",
24
+ "tsConfig": "packages/pieces/custom/clickup-extended/tsconfig.lib.json",
25
+ "packageJson": "packages/pieces/custom/clickup-extended/package.json",
26
+ "main": "packages/pieces/custom/clickup-extended/src/index.ts",
27
+ "assets": [
28
+ "packages/pieces/custom/clickup-extended/*.md",
29
+ {
30
+ "input": "packages/pieces/custom/clickup-extended/src/i18n",
31
+ "output": "./src/i18n",
32
+ "glob": "**/!(i18n.json)"
33
+ }
34
+ ],
35
+ "buildableProjectDepsInPackageJsonType": "dependencies",
36
+ "updateBuildableProjectDepsInPackageJson": false
37
+ }
38
+ },
39
+ "nx-release-publish": {
40
+ "options": {
41
+ "packageRoot": "dist/{projectRoot}"
42
+ }
43
+ },
44
+ "lint": {
45
+ "executor": "@nx/eslint:lint",
46
+ "outputs": [
47
+ "{options.outputFile}"
48
+ ]
49
+ }
50
+ }
51
+ }
package/src/index.ts ADDED
@@ -0,0 +1,124 @@
1
+ import { createCustomApiCallAction } from '@activepieces/pieces-common';
2
+ import {
3
+ PieceAuth,
4
+ createPiece,
5
+ } from '@activepieces/pieces-framework';
6
+ import { PieceCategory } from '@activepieces/shared';
7
+ import { createClickupTaskComment} from './lib/actions/comments/create-task-comment';
8
+ import { getClickupTaskComments } from './lib/actions/comments/get-task-comments';
9
+ import { getClickupAccessibleCustomFields } from './lib/actions/custom-fields/get-accessible-custom-fields';
10
+ import { setClickupCustomFieldValue } from './lib/actions/custom-fields/set-custom-fields-value';
11
+ import { createClickupFolderlessList } from './lib/actions/lists/create-folderless-list';
12
+ import { getClickupList } from './lib/actions/lists/get-list';
13
+ import { getClickupSpace } from './lib/actions/spaces/get-space';
14
+ import { getClickupSpaces } from './lib/actions/spaces/get-spaces';
15
+ import { createClickupSubtask } from './lib/actions/tasks/create-subtask';
16
+ import { createClickupTask } from './lib/actions/tasks/create-task';
17
+ import { createClickupTaskFromTemplate } from './lib/actions/tasks/create-task-from-template';
18
+ import { deleteClickupTask } from './lib/actions/tasks/delete-task';
19
+ import { filterClickupWorkspaceTasks } from './lib/actions/tasks/filter-workspace-tasks';
20
+ import { filterClickupWorkspaceTimeEntries } from './lib/actions/tasks/filter-workspace-time-entries';
21
+ import { getClickupTask } from './lib/actions/tasks/get-task';
22
+ import { updateClickupTask } from './lib/actions/tasks/update-task';
23
+ import { clickupTriggers as triggers } from './lib/triggers';
24
+ import { getClickupChannels } from './lib/actions/chat/get-channels';
25
+ import { getClickupChannelMessages } from './lib/actions/chat/get-channel-messages';
26
+ import { createClickupChannel } from './lib/actions/chat/create-channel';
27
+ import { createClickupChannelInSpaceFolderOrList } from './lib/actions/chat/create-channel-in-space-folder-list';
28
+ import { getClickupChannel } from './lib/actions/chat/get-channel';
29
+ import { createClickupMessage } from './lib/actions/chat/create-message';
30
+ import { createClickupMessageReply } from './lib/actions/chat/create-message-reply';
31
+ import { createClickupMessageReaction } from './lib/actions/chat/create-message-reaction';
32
+ import { getClickupMessageReactions } from './lib/actions/chat/get-message-reactions';
33
+ import { getClickupMessageReplies } from './lib/actions/chat/get-message-replies';
34
+ import { updateClickupMessage } from './lib/actions/chat/update-message';
35
+ import { deleteClickupMessage } from './lib/actions/chat/delete-message';
36
+ import { deleteClickupMessageReaction } from './lib/actions/chat/delete-message-reaction';
37
+ import { getClickupTaskByName } from './lib/actions/tasks/get-task-by-name';
38
+ // New extended actions
39
+ import { getClickupFolders } from './lib/actions/folders/get-folders';
40
+ import { createClickupFolder } from './lib/actions/folders/create-folder';
41
+ import { getClickupListsInFolder } from './lib/actions/lists/get-lists-in-folder';
42
+ import { createClickupListInFolder } from './lib/actions/lists/create-list-in-folder';
43
+ import { getClickupTasksInList } from './lib/actions/tasks/get-tasks-in-list';
44
+ import { createClickupTaskAttachment } from './lib/actions/attachments/create-task-attachment';
45
+ import { getClickupTeams } from './lib/actions/teams/get-teams';
46
+
47
+ export const clickupAuth = PieceAuth.SecretText({
48
+ displayName: 'Personal API Token',
49
+ description:
50
+ 'Your ClickUp Personal API Token. Go to ClickUp > Settings > Apps to generate one.',
51
+ required: true,
52
+ });
53
+
54
+ export const clickupExtended = createPiece({
55
+ displayName: 'ClickUp Extended',
56
+ description: 'All-in-one productivity platform with extended folder, list, and attachment actions',
57
+ minimumSupportedRelease: '0.0.0',
58
+ logoUrl: 'https://cdn.activepieces.com/pieces/clickup.png',
59
+ categories: [PieceCategory.PRODUCTIVITY],
60
+ auth: clickupAuth,
61
+ actions: [
62
+ // Discovery actions (no required props — agent-friendly)
63
+ getClickupTeams,
64
+ // Original actions
65
+ createClickupTask,
66
+ createClickupTaskFromTemplate,
67
+ createClickupFolderlessList,
68
+ createClickupTaskComment,
69
+ createClickupSubtask,
70
+ createClickupChannel,
71
+ createClickupChannelInSpaceFolderOrList,
72
+ createClickupMessage,
73
+ createClickupMessageReaction,
74
+ createClickupMessageReply,
75
+ getClickupList,
76
+ getClickupTask,
77
+ getClickupTaskByName,
78
+ getClickupSpace,
79
+ getClickupSpaces,
80
+ getClickupTaskComments,
81
+ getClickupChannel,
82
+ getClickupChannels,
83
+ getClickupChannelMessages,
84
+ getClickupMessageReactions,
85
+ getClickupMessageReplies,
86
+ filterClickupWorkspaceTasks,
87
+ filterClickupWorkspaceTimeEntries,
88
+ updateClickupTask,
89
+ updateClickupMessage,
90
+ deleteClickupMessage,
91
+ deleteClickupMessageReaction,
92
+ deleteClickupTask,
93
+ getClickupAccessibleCustomFields,
94
+ setClickupCustomFieldValue,
95
+ // New extended actions
96
+ getClickupFolders,
97
+ createClickupFolder,
98
+ getClickupListsInFolder,
99
+ createClickupListInFolder,
100
+ getClickupTasksInList,
101
+ createClickupTaskAttachment,
102
+ createCustomApiCallAction({
103
+ auth: clickupAuth,
104
+ baseUrl: () => {
105
+ return 'https://api.clickup.com/api/v2/';
106
+ },
107
+ authMapping: async (auth) => {
108
+ return {
109
+ Authorization: `${auth as string}`,
110
+ };
111
+ },
112
+ }),
113
+ ],
114
+ authors: [
115
+ 'kanarelo',
116
+ 'kishanprmr',
117
+ 'MoShizzle',
118
+ 'khaledmashaly',
119
+ 'abuaboud',
120
+ 'AbdulTheActivePiecer',
121
+ 'skillful-ai',
122
+ ],
123
+ triggers,
124
+ });
@@ -0,0 +1,78 @@
1
+ import { Property, createAction } from '@activepieces/pieces-framework';
2
+ import axios from 'axios';
3
+ import { clickupCommon } from '../../common';
4
+ import { clickupAuth } from '../../../';
5
+
6
+ export const createClickupTaskAttachment = createAction({
7
+ auth: clickupAuth,
8
+ name: 'create_task_attachment',
9
+ description:
10
+ 'Uploads a file attachment to a ClickUp task. Accepts either a direct file upload or a URL to download the file from.',
11
+ displayName: 'Create Task Attachment',
12
+ props: {
13
+ workspace_id: clickupCommon.workspace_id(),
14
+ space_id: clickupCommon.space_id(),
15
+ folder_id: clickupCommon.folder_id(),
16
+ list_id: clickupCommon.list_id(),
17
+ task_id: clickupCommon.task_id(),
18
+ file: Property.File({
19
+ displayName: 'File',
20
+ description:
21
+ 'The file to attach (binary upload or URL). When called by an agent, provide the image/file URL.',
22
+ required: false,
23
+ }),
24
+ file_url: Property.ShortText({
25
+ displayName: 'File URL',
26
+ description:
27
+ 'URL to download the file from (alternative to File property). Use this when you have a direct URL to the image or document.',
28
+ required: false,
29
+ }),
30
+ file_name: Property.ShortText({
31
+ displayName: 'File Name',
32
+ description:
33
+ 'The name for the attachment file (including extension, e.g. screenshot.png)',
34
+ required: true,
35
+ }),
36
+ },
37
+ async run(context) {
38
+ const { task_id, file, file_url, file_name } = context.propsValue;
39
+ const accessToken = context.auth as string;
40
+
41
+ let fileBuffer: Buffer;
42
+
43
+ if (file && file.data) {
44
+ // Option 1: File was provided directly (or auto-downloaded by engine from URL)
45
+ fileBuffer = file.data;
46
+ } else if (file_url) {
47
+ // Option 2: Download from explicit URL
48
+ const downloadResponse = await axios.get(file_url, {
49
+ responseType: 'arraybuffer',
50
+ timeout: 30000,
51
+ });
52
+ fileBuffer = Buffer.from(downloadResponse.data);
53
+ } else {
54
+ throw new Error(
55
+ 'Either a file or a file_url must be provided to create an attachment.'
56
+ );
57
+ }
58
+
59
+ // Build multipart form data manually for axios
60
+ // Using FormData with Blob — axios handles Content-Type automatically
61
+ const formData = new FormData();
62
+ const blob = new Blob([fileBuffer]);
63
+ formData.append('attachment', blob, file_name);
64
+
65
+ const response = await axios.post(
66
+ `https://api.clickup.com/api/v2/task/${task_id}/attachment`,
67
+ formData,
68
+ {
69
+ headers: {
70
+ Authorization: accessToken,
71
+ },
72
+ timeout: 60000,
73
+ }
74
+ );
75
+
76
+ return response.data;
77
+ },
78
+ });
@@ -0,0 +1,80 @@
1
+ import { Property } from '@activepieces/pieces-framework';
2
+ import { HttpMethod } from '@activepieces/pieces-common';
3
+ import { callClickUpApi3, clickupCommon } from '../../common';
4
+ import { clickupAuth } from '../../..';
5
+ import { createAction } from '@activepieces/pieces-framework';
6
+
7
+ export const createClickupChannelInSpaceFolderOrList = createAction({
8
+ auth: clickupAuth,
9
+ name: 'create_channel_in_space_folder_list',
10
+ description:
11
+ 'Creates a channel in a ClickUp workspace in a space, folder or list',
12
+ displayName: 'Create Channel in Space/Folder/List',
13
+ props: {
14
+ workspace_id: clickupCommon.workspace_id(),
15
+ description: Property.ShortText({
16
+ description: 'Description of the channel',
17
+ displayName: 'Channel Description',
18
+ required: false,
19
+ defaultValue: '',
20
+ }),
21
+ topic: Property.ShortText({
22
+ description: 'Topic of the channel',
23
+ displayName: 'Channel Topic',
24
+ required: false,
25
+ defaultValue: '',
26
+ }),
27
+ locationType: Property.StaticDropdown({
28
+ description: 'Type of location',
29
+ displayName: 'Location Type',
30
+ required: true,
31
+ options: {
32
+ options: [
33
+ { label: 'Folder', value: 'folder' },
34
+ { label: 'Space', value: 'space' },
35
+ { label: 'List', value: 'list' },
36
+ ],
37
+ },
38
+ defaultValue: 'folder',
39
+ }),
40
+ locationId: Property.ShortText({
41
+ description: 'ID of the location',
42
+ displayName: 'Location ID',
43
+ required: true,
44
+ }),
45
+ // TODO: add user ids
46
+ visibility: Property.StaticDropdown({
47
+ description: 'Visibility of the channel',
48
+ displayName: 'Channel Visibility',
49
+ required: true,
50
+ options: {
51
+ options: [
52
+ { label: 'Public', value: 'PUBLIC' },
53
+ { label: 'Private', value: 'PRIVATE' },
54
+ ],
55
+ },
56
+ defaultValue: 'public',
57
+ }),
58
+ },
59
+
60
+ async run(configValue) {
61
+ const { workspace_id, description, visibility, locationType, locationId,topic } =
62
+ configValue.propsValue;
63
+ const response = await callClickUpApi3(
64
+ HttpMethod.POST,
65
+ `workspaces/${workspace_id}/chat/channels/location`,
66
+ (configValue.auth as string),
67
+ {
68
+ topic,
69
+ description,
70
+ visibility,
71
+ location: {
72
+ id: locationId,
73
+ type: locationType,
74
+ },
75
+ },
76
+ {}
77
+ );
78
+ return response.body;
79
+ },
80
+ });
@@ -0,0 +1,64 @@
1
+ import { Property } from '@activepieces/pieces-framework';
2
+ import { HttpMethod } from '@activepieces/pieces-common';
3
+ import { callClickUpApi3, clickupCommon } from '../../common';
4
+ import { clickupAuth } from '../../../';
5
+ import { createAction } from '@activepieces/pieces-framework';
6
+
7
+ export const createClickupChannel = createAction({
8
+ auth: clickupAuth,
9
+ name: 'create_channel',
10
+ description: 'Creates a channel in a ClickUp workspace',
11
+ displayName: 'Create Channel',
12
+ props: {
13
+ workspace_id: clickupCommon.workspace_id(),
14
+ name: Property.ShortText({
15
+ description: 'Name of the channel',
16
+ displayName: 'Channel Name',
17
+ required: true,
18
+ defaultValue: '',
19
+ }),
20
+ description: Property.ShortText({
21
+ description: 'Description of the channel',
22
+ displayName: 'Channel Description',
23
+ required: false,
24
+ defaultValue: '',
25
+ }),
26
+ topic: Property.ShortText({
27
+ description: 'Topic of the channel',
28
+ displayName: 'Channel Topic',
29
+ required: false,
30
+ defaultValue: '',
31
+ }),
32
+ // TODO: add user ids
33
+ visibility: Property.StaticDropdown({
34
+ description: 'Visibility of the channel',
35
+ displayName: 'Channel Visibility',
36
+ required: true,
37
+ options: {
38
+ options: [
39
+ { label: 'Public', value: 'PUBLIC' },
40
+ { label: 'Private', value: 'PRIVATE' },
41
+ ],
42
+ },
43
+ defaultValue: 'public',
44
+ }),
45
+ },
46
+
47
+ async run(configValue) {
48
+ const { workspace_id, name, description, visibility,topic } =
49
+ configValue.propsValue;
50
+ const response = await callClickUpApi3(
51
+ HttpMethod.POST,
52
+ `workspaces/${workspace_id}/chat/channels`,
53
+ (configValue.auth as string),
54
+ {
55
+ name,
56
+ topic,
57
+ description,
58
+ visibility,
59
+ },
60
+ {}
61
+ );
62
+ return response.body;
63
+ },
64
+ });
@@ -0,0 +1,37 @@
1
+ import { createAction } from '@activepieces/pieces-framework';
2
+ import { Property } from '@activepieces/pieces-framework';
3
+ import { HttpMethod } from '@activepieces/pieces-common';
4
+ import { callClickUpApi3, clickupCommon } from '../../common';
5
+ import { clickupAuth } from '../../../';
6
+
7
+ export const createClickupMessageReaction = createAction({
8
+ auth: clickupAuth,
9
+ name: 'create_message_reaction',
10
+ description: 'Creates a reaction to a message in a ClickUp channel',
11
+ displayName: 'Create Message Reaction',
12
+ props: {
13
+ workspace_id: clickupCommon.workspace_id(),
14
+ message_id: Property.ShortText({
15
+ description: 'ID of the message to create reaction for',
16
+ displayName: 'Message ID',
17
+ required: true,
18
+ }),
19
+ emoji: Property.ShortText({
20
+ description: 'Emoji to react with',
21
+ displayName: 'Emoji',
22
+ required: true,
23
+ }),
24
+ },
25
+
26
+ async run(configValue) {
27
+ const { workspace_id, message_id, emoji } = configValue.propsValue;
28
+ const response = await callClickUpApi3(
29
+ HttpMethod.POST,
30
+ `workspaces/${workspace_id}/chat/messages/${message_id}/reactions`,
31
+ (configValue.auth as string),
32
+ { emoji },
33
+ {}
34
+ );
35
+ return response.body;
36
+ },
37
+ });
@@ -0,0 +1,52 @@
1
+ import { createAction } from '@activepieces/pieces-framework';
2
+ import { Property } from '@activepieces/pieces-framework';
3
+ import { HttpMethod } from '@activepieces/pieces-common';
4
+ import { callClickUpApi3, clickupCommon } from '../../common';
5
+ import { clickupAuth } from '../../../';
6
+
7
+ export const createClickupMessageReply = createAction({
8
+ auth: clickupAuth,
9
+ name: 'create_message_reply',
10
+ description: 'Creates a reply to a message in a ClickUp channel',
11
+ displayName: 'Create Message Reply',
12
+ props: {
13
+ workspace_id: clickupCommon.workspace_id(),
14
+ message_id: Property.ShortText({
15
+ description: 'ID of the message to reply to',
16
+ displayName: 'Message ID',
17
+ required: true,
18
+ }),
19
+ content: Property.LongText({
20
+ description: 'Content of the message',
21
+ displayName: 'Message Content',
22
+ required: true,
23
+ }),
24
+ type: Property.StaticDropdown({
25
+ description: 'Type of the message',
26
+ displayName: 'Message Type',
27
+ required: true,
28
+ options: {
29
+ options: [
30
+ { label: 'Message', value: 'message' },
31
+ { label: 'Post', value: 'post' },
32
+ ],
33
+ },
34
+ defaultValue: 'message',
35
+ }),
36
+ },
37
+
38
+ async run(configValue) {
39
+ const { workspace_id, message_id, content, type } = configValue.propsValue;
40
+ const response = await callClickUpApi3(
41
+ HttpMethod.POST,
42
+ `workspaces/${workspace_id}/chat/messages/${message_id}/replies`,
43
+ (configValue.auth as string),
44
+ {
45
+ content,
46
+ type,
47
+ },
48
+ {}
49
+ );
50
+ return response.body;
51
+ },
52
+ });
@@ -0,0 +1,48 @@
1
+ import { createAction } from '@activepieces/pieces-framework';
2
+ import { Property } from '@activepieces/pieces-framework';
3
+ import { HttpMethod } from '@activepieces/pieces-common';
4
+ import { callClickUpApi3, clickupCommon } from '../../common';
5
+ import { clickupAuth } from '../../../';
6
+
7
+ export const createClickupMessage = createAction({
8
+ auth: clickupAuth,
9
+ name: 'create_message',
10
+ description: 'Creates a message in a ClickUp channel',
11
+ displayName: 'Create Message',
12
+ props: {
13
+ workspace_id: clickupCommon.workspace_id(),
14
+ channel_id: clickupCommon.channel_id(),
15
+ content: Property.LongText({
16
+ description: 'Content of the message',
17
+ displayName: 'Message Content',
18
+ required: true,
19
+ }),
20
+ type: Property.StaticDropdown({
21
+ description: 'Type of the message',
22
+ displayName: 'Message Type',
23
+ required: true,
24
+ options: {
25
+ options: [
26
+ { label: 'Message', value: 'message' },
27
+ { label: 'Post', value: 'post' },
28
+ ],
29
+ },
30
+ defaultValue: 'message',
31
+ }),
32
+ },
33
+
34
+ async run(configValue) {
35
+ const { workspace_id, channel_id, content, type } = configValue.propsValue;
36
+ const response = await callClickUpApi3(
37
+ HttpMethod.POST,
38
+ `workspaces/${workspace_id}/chat/channels/${channel_id}/messages`,
39
+ (configValue.auth as string),
40
+ {
41
+ content,
42
+ type,
43
+ },
44
+ {}
45
+ );
46
+ return response.body;
47
+ },
48
+ });
@@ -0,0 +1,37 @@
1
+ import { createAction } from '@activepieces/pieces-framework';
2
+ import { Property } from '@activepieces/pieces-framework';
3
+ import { HttpMethod } from '@activepieces/pieces-common';
4
+ import { callClickUpApi3, clickupCommon } from '../../common';
5
+ import { clickupAuth } from '../../../';
6
+
7
+ export const deleteClickupMessageReaction = createAction({
8
+ auth: clickupAuth,
9
+ name: 'delete_message_reaction',
10
+ description: 'Deletes a reaction from a message in a ClickUp channel',
11
+ displayName: 'Delete Message Reaction',
12
+ props: {
13
+ workspace_id: clickupCommon.workspace_id(),
14
+ message_id: Property.ShortText({
15
+ description: 'ID of the message to delete reaction from',
16
+ displayName: 'Message ID',
17
+ required: true,
18
+ }),
19
+ reaction_id: Property.ShortText({
20
+ description: 'ID of the reaction to delete',
21
+ displayName: 'Reaction ID',
22
+ required: true,
23
+ }),
24
+ },
25
+
26
+ async run(configValue) {
27
+ const { workspace_id, message_id, reaction_id } = configValue.propsValue;
28
+ const response = await callClickUpApi3(
29
+ HttpMethod.DELETE,
30
+ `workspaces/${workspace_id}/chat/messages/${message_id}/reactions/${reaction_id}`,
31
+ (configValue.auth as string),
32
+ {},
33
+ {}
34
+ );
35
+ return response.body;
36
+ },
37
+ });
@@ -0,0 +1,32 @@
1
+ import { createAction } from '@activepieces/pieces-framework';
2
+ import { Property } from '@activepieces/pieces-framework';
3
+ import { HttpMethod } from '@activepieces/pieces-common';
4
+ import { callClickUpApi3, clickupCommon } from '../../common';
5
+ import { clickupAuth } from '../../../';
6
+
7
+ export const deleteClickupMessage = createAction({
8
+ auth: clickupAuth,
9
+ name: 'delete_message',
10
+ description: 'Deletes a message in a ClickUp channel',
11
+ displayName: 'Delete Message',
12
+ props: {
13
+ workspace_id: clickupCommon.workspace_id(),
14
+ message_id: Property.ShortText({
15
+ description: 'ID of the message to delete',
16
+ displayName: 'Message ID',
17
+ required: true,
18
+ }),
19
+ },
20
+
21
+ async run(configValue) {
22
+ const { workspace_id, message_id } = configValue.propsValue;
23
+ const response = await callClickUpApi3(
24
+ HttpMethod.DELETE,
25
+ `workspaces/${workspace_id}/chat/messages/${message_id}`,
26
+ (configValue.auth as string),
27
+ {},
28
+ {}
29
+ );
30
+ return response.body;
31
+ },
32
+ });