From 9eee221f472e3d7e4f64b91cd3903afafd4f074c Mon Sep 17 00:00:00 2001 From: Jorge Cortes Date: Thu, 1 Aug 2024 20:37:30 -0500 Subject: [PATCH] Clickup fix: Refactored list props to filter by folder id dinamically as an alternative --- .../actions/common/checklist-item-props.mjs | 26 -- .../actions/common/checklist-props.mjs | 25 -- .../clickup/actions/common/comment-props.mjs | 68 +----- .../clickup/actions/common/list-props.mjs | 23 -- .../clickup/actions/common/task-props.mjs | 17 -- .../clickup/actions/common/view-props.mjs | 51 ---- .../create-chat-view-comment.mjs | 73 ++---- .../create-checklist-item.mjs | 19 +- .../create-checklist/create-checklist.mjs | 16 +- .../actions/create-folder/create-folder.mjs | 3 +- .../create-list-comment.mjs | 12 +- .../actions/create-list/create-list.mjs | 2 +- .../actions/create-space/create-space.mjs | 2 +- .../create-task-comment.mjs | 17 +- .../create-task-from-template.mjs | 11 +- .../actions/create-task/create-task.mjs | 42 ++-- .../create-view-comment.mjs | 73 ++---- .../delete-checklist-item.mjs | 27 ++- .../delete-checklist/delete-checklist.mjs | 23 +- .../actions/delete-comment/delete-comment.mjs | 13 +- .../actions/delete-folder/delete-folder.mjs | 4 +- .../actions/delete-list/delete-list.mjs | 15 +- .../actions/delete-space/delete-space.mjs | 4 +- .../actions/delete-task/delete-task.mjs | 23 +- .../get-custom-fields/get-custom-fields.mjs | 15 +- .../get-folder-views/get-folder-views.mjs | 4 +- .../clickup/actions/get-folder/get-folder.mjs | 4 +- .../actions/get-folders/get-folders.mjs | 3 +- .../get-list-comments/get-list-comments.mjs | 15 +- .../actions/get-list-views/get-list-views.mjs | 15 +- .../clickup/actions/get-list/get-list.mjs | 15 +- .../clickup/actions/get-lists/get-lists.mjs | 3 +- .../get-space-views/get-space-views.mjs | 4 +- .../clickup/actions/get-space/get-space.mjs | 4 +- .../clickup/actions/get-spaces/get-spaces.mjs | 2 +- .../get-task-comments/get-task-comments.mjs | 25 +- .../get-task-templates/get-task-templates.mjs | 2 +- .../clickup/actions/get-task/get-task.mjs | 23 +- .../clickup/actions/get-tasks/get-tasks.mjs | 11 +- .../actions/get-team-views/get-team-views.mjs | 4 +- .../get-view-comments/get-view-comments.mjs | 24 +- .../actions/get-view-tasks/get-view-tasks.mjs | 20 +- .../clickup/actions/get-view/get-view.mjs | 24 +- .../remove-task-custom-field.mjs | 21 +- .../start-time-entry/start-time-entry.mjs | 21 +- .../stop-time-entry/stop-time-entry.mjs | 4 +- .../update-checklist-item.mjs | 36 ++- .../update-checklist/update-checklist.mjs | 22 +- .../actions/update-comment/update-comment.mjs | 9 +- .../actions/update-folder/update-folder.mjs | 3 +- .../actions/update-list/update-list.mjs | 11 +- .../actions/update-space/update-space.mjs | 3 +- .../update-task-custom-field.mjs | 29 ++- .../actions/update-task/update-task.mjs | 52 ++-- components/clickup/clickup.app.mjs | 227 +----------------- components/clickup/common/builder.mjs | 84 +++++++ components/clickup/common/props-fragments.mjs | 223 +++++++++++++++++ components/clickup/package.json | 4 +- .../clickup/sources/new-folder/new-folder.mjs | 2 +- .../clickup/sources/new-list/new-list.mjs | 2 +- .../new-task-advanced/new-task-advanced.mjs | 30 +-- .../clickup/sources/new-task/new-task.mjs | 24 +- .../sources/updated-task/updated-task.mjs | 42 ++-- pnpm-lock.yaml | 4 +- 64 files changed, 928 insertions(+), 731 deletions(-) delete mode 100644 components/clickup/actions/common/checklist-item-props.mjs delete mode 100644 components/clickup/actions/common/checklist-props.mjs delete mode 100644 components/clickup/actions/common/view-props.mjs create mode 100644 components/clickup/common/builder.mjs create mode 100644 components/clickup/common/props-fragments.mjs diff --git a/components/clickup/actions/common/checklist-item-props.mjs b/components/clickup/actions/common/checklist-item-props.mjs deleted file mode 100644 index f4d3f8f8df367..0000000000000 --- a/components/clickup/actions/common/checklist-item-props.mjs +++ /dev/null @@ -1,26 +0,0 @@ -/* eslint-disable pipedream/props-description */ -/* eslint-disable pipedream/props-label */ -import common from "./checklist-props.mjs"; - -export default { - props: { - ...common.props, - checklistId: { - ...common.props.checklistId, - optional: true, - }, - checklistItemId: { - propDefinition: [ - common.props.clickup, - "checklistItems", - (c) => ({ - taskId: c.taskId, - checklistId: c.checklistId, - useCustomTaskIds: c.useCustomTaskIds, - authorizedTeamId: c.authorizedTeamId, - }), - ], - description: "To show options please select a **Task and Checklist** first", - }, - }, -}; diff --git a/components/clickup/actions/common/checklist-props.mjs b/components/clickup/actions/common/checklist-props.mjs deleted file mode 100644 index c33022b4d87e3..0000000000000 --- a/components/clickup/actions/common/checklist-props.mjs +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable pipedream/props-description */ -/* eslint-disable pipedream/props-label */ -import common from "./task-props.mjs"; - -export default { - props: { - ...common.props, - taskId: { - ...common.props.taskId, - optional: true, - }, - checklistId: { - propDefinition: [ - common.props.clickup, - "checklists", - (c) => ({ - taskId: c.taskId, - useCustomTaskIds: c.useCustomTaskIds, - authorizedTeamId: c.authorizedTeamId, - }), - ], - description: "To show options please select a **Task** first", - }, - }, -}; diff --git a/components/clickup/actions/common/comment-props.mjs b/components/clickup/actions/common/comment-props.mjs index 519be622847e7..d663d86659bed 100644 --- a/components/clickup/actions/common/comment-props.mjs +++ b/components/clickup/actions/common/comment-props.mjs @@ -1,4 +1,6 @@ import common from "./workspace-prop.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { props: { @@ -11,65 +13,13 @@ export default { workspaceId: c.workspaceId, }), ], - optional: true, - }, - folderId: { - propDefinition: [ - common.props.clickup, - "folders", - (c) => ({ - spaceId: c.spaceId, - }), - ], - optional: true, - }, - listId: { - propDefinition: [ - common.props.clickup, - "lists", - (c) => ({ - folderId: c.folderId, - spaceId: c.spaceId, - }), - ], - optional: true, - }, - taskId: { - propDefinition: [ - common.props.clickup, - "tasks", - (c) => ({ - listId: c.listId, - useCustomTaskIds: c.useCustomTaskIds, - }), - ], - optional: true, - }, - viewId: { - propDefinition: [ - common.props.clickup, - "views", - (c) => ({ - workspaceId: c.workspaceId, - spaceId: c.spaceId, - listId: c.listId, - folderId: c.folderId, - }), - ], - optional: true, - }, - commentId: { - propDefinition: [ - common.props.clickup, - "comments", - (c) => ({ - listId: c.listId, - taskId: c.taskId, - viewId: c.viewId, - useCustomTaskIds: c.useCustomTaskIds, - authorizedTeamId: c.authorizedTeamId, - }), - ], }, }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: propsFragments.taskId, + viewId: propsFragments.viewId, + commentId: propsFragments.commentId, + }, + }), }; diff --git a/components/clickup/actions/common/list-props.mjs b/components/clickup/actions/common/list-props.mjs index c0e582169958a..48127111d5980 100644 --- a/components/clickup/actions/common/list-props.mjs +++ b/components/clickup/actions/common/list-props.mjs @@ -12,29 +12,6 @@ export default { }), ], description: "If selected, the **Lists** will be filtered by this Space ID", - optional: true, - }, - folderId: { - propDefinition: [ - common.props.clickup, - "folders", - (c) => ({ - spaceId: c.spaceId, - }), - ], - description: "If selected, the **Lists** will be filtered by this Folder ID", - optional: true, - }, - listId: { - propDefinition: [ - common.props.clickup, - "lists", - (c) => ({ - workspaceId: c.workspaceId, - spaceId: c.spaceId, - folderId: c.folderId, - }), - ], }, }, }; diff --git a/components/clickup/actions/common/task-props.mjs b/components/clickup/actions/common/task-props.mjs index 64bce54116be6..1b3aeb678425e 100644 --- a/components/clickup/actions/common/task-props.mjs +++ b/components/clickup/actions/common/task-props.mjs @@ -1,14 +1,8 @@ -/* eslint-disable pipedream/props-description */ -/* eslint-disable pipedream/props-label */ import common from "./list-props.mjs"; export default { props: { ...common.props, - listId: { - ...common.props.listId, - optional: true, - }, useCustomTaskIds: { propDefinition: [ common.props.clickup, @@ -21,16 +15,5 @@ export default { "authorizedTeamId", ], }, - taskId: { - propDefinition: [ - common.props.clickup, - "tasks", - (c) => ({ - listId: c.listId, - useCustomTaskIds: c.useCustomTaskIds, - }), - ], - description: "To show options please select a **List** first", - }, }, }; diff --git a/components/clickup/actions/common/view-props.mjs b/components/clickup/actions/common/view-props.mjs deleted file mode 100644 index 4fa3bf11dea07..0000000000000 --- a/components/clickup/actions/common/view-props.mjs +++ /dev/null @@ -1,51 +0,0 @@ -import common from "./workspace-prop.mjs"; - -export default { - props: { - ...common.props, - spaceId: { - propDefinition: [ - common.props.clickup, - "spaces", - (c) => ({ - workspaceId: c.workspaceId, - }), - ], - optional: true, - }, - folderId: { - propDefinition: [ - common.props.clickup, - "folders", - (c) => ({ - spaceId: c.spaceId, - }), - ], - optional: true, - }, - listId: { - propDefinition: [ - common.props.clickup, - "lists", - (c) => ({ - workspaceId: c.workspaceId, - spaceId: c.spaceId, - folderId: c.folderId, - }), - ], - optional: true, - }, - viewId: { - propDefinition: [ - common.props.clickup, - "views", - (c) => ({ - workspaceId: c.workspaceId, - spaceId: c.spaceId, - listId: c.listId, - folderId: c.folderId, - }), - ], - }, - }, -}; diff --git a/components/clickup/actions/create-chat-view-comment/create-chat-view-comment.mjs b/components/clickup/actions/create-chat-view-comment/create-chat-view-comment.mjs index 66183fed9ff68..383f68cd9d059 100644 --- a/components/clickup/actions/create-chat-view-comment/create-chat-view-comment.mjs +++ b/components/clickup/actions/create-chat-view-comment/create-chat-view-comment.mjs @@ -1,62 +1,16 @@ -import clickup from "../../clickup.app.mjs"; +import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-create-chat-view-comment", name: "Create Chat View Comment", description: "Creates a chat view comment. See the docs [here](https://clickup.com/api) in **Comments / Create Chat View Comment** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { - clickup, - workspaceId: { - propDefinition: [ - clickup, - "workspaces", - ], - }, - spaceId: { - propDefinition: [ - clickup, - "spaces", - (c) => ({ - workspaceId: c.workspaceId, - }), - ], - optional: true, - }, - folderId: { - propDefinition: [ - clickup, - "folders", - (c) => ({ - spaceId: c.spaceId, - }), - ], - optional: true, - }, - listId: { - propDefinition: [ - clickup, - "lists", - (c) => ({ - spaceId: c.spaceId, - folderId: c.folderId, - }), - ], - optional: true, - }, - viewId: { - propDefinition: [ - clickup, - "views", - (c) => ({ - workspaceId: c.workspaceId, - spaceId: c.spaceId, - listId: c.listId, - folderId: c.folderId, - }), - ], - }, + ...common.props, commentText: { label: "Comment Text", description: "The text of the comment", @@ -71,7 +25,7 @@ export default { }, assignees: { propDefinition: [ - clickup, + common.props.clickup, "assignees", (c) => ({ workspaceId: c.workspaceId, @@ -79,7 +33,20 @@ export default { ], optional: true, }, + listWithFolder: { + optional: true, + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + tailProps: { + viewId: propsFragments.viewId, + }, + }), async run({ $ }) { const { viewId, diff --git a/components/clickup/actions/create-checklist-item/create-checklist-item.mjs b/components/clickup/actions/create-checklist-item/create-checklist-item.mjs index fd617160d23d0..3ed977147de6e 100644 --- a/components/clickup/actions/create-checklist-item/create-checklist-item.mjs +++ b/components/clickup/actions/create-checklist-item/create-checklist-item.mjs @@ -1,10 +1,13 @@ -import common from "../common/checklist-props.mjs"; +import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-create-checklist-item", name: "Create Checklist Item", description: "Creates a new item in a checklist. See the docs [here](https://clickup.com/api) in **Checklists / Create Checklist Item** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -25,7 +28,19 @@ export default { ], optional: true, }, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: propsFragments.taskId, + checklistId: propsFragments.checklistId, + }, + }), async run({ $ }) { const { taskId, diff --git a/components/clickup/actions/create-checklist/create-checklist.mjs b/components/clickup/actions/create-checklist/create-checklist.mjs index e670cc8053265..8983a82a6b80e 100644 --- a/components/clickup/actions/create-checklist/create-checklist.mjs +++ b/components/clickup/actions/create-checklist/create-checklist.mjs @@ -1,10 +1,13 @@ import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-create-checklist", name: "Create Checklist", description: "Creates a new checklist in a task. See the docs [here](https://clickup.com/api) in **Checklists / Create Checklist** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -13,7 +16,18 @@ export default { type: "string", description: "The name of checklist", }, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: propsFragments.taskId, + }, + }), async run({ $ }) { const { taskId, diff --git a/components/clickup/actions/create-folder/create-folder.mjs b/components/clickup/actions/create-folder/create-folder.mjs index 07991eda9a402..147e0a2c2a8e2 100644 --- a/components/clickup/actions/create-folder/create-folder.mjs +++ b/components/clickup/actions/create-folder/create-folder.mjs @@ -1,10 +1,11 @@ import common from "../common/space-props.mjs"; export default { + ...common, key: "clickup-create-folder", name: "Create Folder", description: "Creates a new folder. See the docs [here](https://clickup.com/api) in **Folders / Create Folder** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, diff --git a/components/clickup/actions/create-list-comment/create-list-comment.mjs b/components/clickup/actions/create-list-comment/create-list-comment.mjs index 167e72964b67b..0361fa3b5b6bd 100644 --- a/components/clickup/actions/create-list-comment/create-list-comment.mjs +++ b/components/clickup/actions/create-list-comment/create-list-comment.mjs @@ -1,11 +1,13 @@ import clickup from "../../clickup.app.mjs"; import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; export default { + ...common, key: "clickup-create-list-comment", name: "Create List Comment", description: "Creates a list comment. See the docs [here](https://clickup.com/api) in **Comments / Create List Comment** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -31,8 +33,14 @@ export default { ], optional: true, }, - + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps(), async run({ $ }) { const { listId, diff --git a/components/clickup/actions/create-list/create-list.mjs b/components/clickup/actions/create-list/create-list.mjs index 1963d2c36f6fc..93f8af75cc939 100644 --- a/components/clickup/actions/create-list/create-list.mjs +++ b/components/clickup/actions/create-list/create-list.mjs @@ -5,7 +5,7 @@ export default { key: "clickup-create-list", name: "Create List", description: "Creates a new list. See the docs [here](https://clickup.com/api) in **Lists / Create List** section.", - version: "0.0.12", + version: "0.0.13", type: "action", props: { clickup, diff --git a/components/clickup/actions/create-space/create-space.mjs b/components/clickup/actions/create-space/create-space.mjs index c4f84cca222b2..fcb4023fccb1f 100644 --- a/components/clickup/actions/create-space/create-space.mjs +++ b/components/clickup/actions/create-space/create-space.mjs @@ -4,7 +4,7 @@ export default { key: "clickup-create-space", name: "Create Space", description: "Creates a new space. See the docs [here](https://clickup.com/api) in **Spaces / Create Space** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, diff --git a/components/clickup/actions/create-task-comment/create-task-comment.mjs b/components/clickup/actions/create-task-comment/create-task-comment.mjs index 6faf56e7a918c..3d471d9d2b3f0 100644 --- a/components/clickup/actions/create-task-comment/create-task-comment.mjs +++ b/components/clickup/actions/create-task-comment/create-task-comment.mjs @@ -1,10 +1,13 @@ import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-create-task-comment", name: "Create Task Comment", description: "Creates a task comment. See the docs [here](https://clickup.com/api) in **Comments / Create Task Comment** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -30,8 +33,18 @@ export default { ], optional: true, }, - + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: propsFragments.taskId, + }, + }), async run({ $ }) { const { taskId, diff --git a/components/clickup/actions/create-task-from-template/create-task-from-template.mjs b/components/clickup/actions/create-task-from-template/create-task-from-template.mjs index a2bee79b6f288..85621ea49f255 100644 --- a/components/clickup/actions/create-task-from-template/create-task-from-template.mjs +++ b/components/clickup/actions/create-task-from-template/create-task-from-template.mjs @@ -1,11 +1,13 @@ import clickup from "../../clickup.app.mjs"; import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; export default { + ...common, key: "clickup-create-task-from-template", name: "Create Task From Template", description: "Creates a new task from a template. See the docs [here](https://clickup.com/api) in **Task Templates / Create Task From Template** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -23,7 +25,14 @@ export default { type: "string", description: "The name of task", }, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps(), async run({ $ }) { const { listId, diff --git a/components/clickup/actions/create-task/create-task.mjs b/components/clickup/actions/create-task/create-task.mjs index cbda718d80aaf..14b40eb3ab6ac 100644 --- a/components/clickup/actions/create-task/create-task.mjs +++ b/components/clickup/actions/create-task/create-task.mjs @@ -1,12 +1,15 @@ import clickup from "../../clickup.app.mjs"; import common from "../common/list-props.mjs"; import constants from "../common/constants.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-create-task", name: "Create Task", description: "Creates a new task. See the docs [here](https://clickup.com/api) in **Tasks / Create Task** section.", - version: "0.0.12", + version: "0.0.13", type: "action", props: { ...common.props, @@ -54,27 +57,6 @@ export default { ], optional: true, }, - status: { - propDefinition: [ - clickup, - "statuses", - (c) => ({ - listId: c.listId, - }), - ], - optional: true, - }, - parent: { - label: "Parent Task", - propDefinition: [ - clickup, - "tasks", - (c) => ({ - listId: c.listId, - }), - ], - optional: true, - }, dueDate: { type: "string", label: "Due Date", @@ -87,7 +69,23 @@ export default { description: "If set `true`, due date will be given with time. If not it will only be the closest date", optional: true, }, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + tailProps: { + status: propsFragments.status, + parent: { + ...propsFragments.taskId, + label: "Parent Task", + optional: true, + }, + }, + }), async run({ $ }) { const { listId, diff --git a/components/clickup/actions/create-view-comment/create-view-comment.mjs b/components/clickup/actions/create-view-comment/create-view-comment.mjs index 9d48257e50d54..d4f6bd181d8a9 100644 --- a/components/clickup/actions/create-view-comment/create-view-comment.mjs +++ b/components/clickup/actions/create-view-comment/create-view-comment.mjs @@ -1,62 +1,15 @@ -import clickup from "../../clickup.app.mjs"; +import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { key: "clickup-create-view-comment", name: "Create View Comment", description: "Creates a view comment. See the docs [here](https://clickup.com/api) in **Comments / Create Chat View Comment** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { - clickup, - workspaceId: { - propDefinition: [ - clickup, - "workspaces", - ], - }, - spaceId: { - propDefinition: [ - clickup, - "spaces", - (c) => ({ - workspaceId: c.workspaceId, - }), - ], - optional: true, - }, - folderId: { - propDefinition: [ - clickup, - "folders", - (c) => ({ - spaceId: c.spaceId, - }), - ], - optional: true, - }, - listId: { - propDefinition: [ - clickup, - "lists", - (c) => ({ - spaceId: c.spaceId, - folderId: c.folderId, - }), - ], - optional: true, - }, - viewId: { - propDefinition: [ - clickup, - "views", - (c) => ({ - workspaceId: c.workspaceId, - spaceId: c.spaceId, - listId: c.listId, - folderId: c.folderId, - }), - ], - }, + ...common.props, commentText: { label: "Comment Text", description: "The text of the comment", @@ -71,7 +24,7 @@ export default { }, assignees: { propDefinition: [ - clickup, + common.props.clickup, "assignees", (c) => ({ workspaceId: c.workspaceId, @@ -79,8 +32,20 @@ export default { ], optional: true, }, - + listWithFolder: { + optional: true, + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + tailProps: { + viewId: propsFragments.viewId, + }, + }), async run({ $ }) { const { viewId, diff --git a/components/clickup/actions/delete-checklist-item/delete-checklist-item.mjs b/components/clickup/actions/delete-checklist-item/delete-checklist-item.mjs index 96e3247d0fbe1..c3a20b5a94e1c 100644 --- a/components/clickup/actions/delete-checklist-item/delete-checklist-item.mjs +++ b/components/clickup/actions/delete-checklist-item/delete-checklist-item.mjs @@ -1,12 +1,33 @@ -import common from "../common/checklist-item-props.mjs"; +import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-delete-checklist-item", name: "Delete Checklist Item", description: "Deletes item in a checklist. See the docs [here](https://clickup.com/api) in **Checklists / Delete Checklist Item** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + checklistId: propsFragments.checklistId, + checklistItemId: propsFragments.checklistItemId, + }, + }), async run({ $ }) { const { checklistId, diff --git a/components/clickup/actions/delete-checklist/delete-checklist.mjs b/components/clickup/actions/delete-checklist/delete-checklist.mjs index 4471bc4e2b01e..f1d87590030a9 100644 --- a/components/clickup/actions/delete-checklist/delete-checklist.mjs +++ b/components/clickup/actions/delete-checklist/delete-checklist.mjs @@ -1,12 +1,29 @@ -import common from "../common/checklist-props.mjs"; +import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-delete-checklist", name: "Delete Checklist", description: "Deletes a checklist in a task. See the docs [here](https://clickup.com/api) in **Checklists / Delete Checklist** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: propsFragments.taskId, + checklistId: propsFragments.checklistId, + }, + }), async run({ $ }) { const { checklistId } = this; diff --git a/components/clickup/actions/delete-comment/delete-comment.mjs b/components/clickup/actions/delete-comment/delete-comment.mjs index 681a0f3dcb231..dede2329d80c0 100644 --- a/components/clickup/actions/delete-comment/delete-comment.mjs +++ b/components/clickup/actions/delete-comment/delete-comment.mjs @@ -1,12 +1,21 @@ import common from "../common/comment-props.mjs"; export default { + ...common, key: "clickup-delete-comment", name: "Delete Comment", description: "Deletes a comment. See the docs [here](https://clickup.com/api) in **Comments / Deleet Comment** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, async run({ $ }) { const { commentId } = this; diff --git a/components/clickup/actions/delete-folder/delete-folder.mjs b/components/clickup/actions/delete-folder/delete-folder.mjs index 282048e1d2aae..f9e376410a835 100644 --- a/components/clickup/actions/delete-folder/delete-folder.mjs +++ b/components/clickup/actions/delete-folder/delete-folder.mjs @@ -1,12 +1,12 @@ import common from "../common/folder-props.mjs"; export default { + ...common, key: "clickup-delete-folder", name: "Delete Folder", description: "Delete a folder. See the docs [here](https://clickup.com/api) in **Folders / Delete Folder** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, async run({ $ }) { const { folderId } = this; diff --git a/components/clickup/actions/delete-list/delete-list.mjs b/components/clickup/actions/delete-list/delete-list.mjs index 9416bee26b2b2..6e20795c6940d 100644 --- a/components/clickup/actions/delete-list/delete-list.mjs +++ b/components/clickup/actions/delete-list/delete-list.mjs @@ -1,12 +1,23 @@ import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; export default { + ...common, key: "clickup-delete-list", name: "Delete List", description: "Delete a list. See the docs [here](https://clickup.com/api) in **Lists / Delete List** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps(), async run({ $ }) { const { listId } = this; diff --git a/components/clickup/actions/delete-space/delete-space.mjs b/components/clickup/actions/delete-space/delete-space.mjs index 3868faa1c6875..0e9205c4d0502 100644 --- a/components/clickup/actions/delete-space/delete-space.mjs +++ b/components/clickup/actions/delete-space/delete-space.mjs @@ -1,12 +1,12 @@ import common from "../common/space-props.mjs"; export default { + ...common, key: "clickup-delete-space", name: "Delete Space", description: "Delete a space. See the docs [here](https://clickup.com/api) in **Spaces / Delete Space** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, async run({ $ }) { const { spaceId } = this; diff --git a/components/clickup/actions/delete-task/delete-task.mjs b/components/clickup/actions/delete-task/delete-task.mjs index 703c7cdc4086d..2ad7d55507226 100644 --- a/components/clickup/actions/delete-task/delete-task.mjs +++ b/components/clickup/actions/delete-task/delete-task.mjs @@ -1,12 +1,31 @@ import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-delete-task", name: "Delete Task", description: "Delete a task. See the docs [here](https://clickup.com/api) in **Tasks / Delete Task** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + }, + }), async run({ $ }) { const { taskId } = this; diff --git a/components/clickup/actions/get-custom-fields/get-custom-fields.mjs b/components/clickup/actions/get-custom-fields/get-custom-fields.mjs index f50ffbeecbab4..3c1260a93d230 100644 --- a/components/clickup/actions/get-custom-fields/get-custom-fields.mjs +++ b/components/clickup/actions/get-custom-fields/get-custom-fields.mjs @@ -1,12 +1,23 @@ import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; export default { + ...common, key: "clickup-get-custom-fields", name: "Get Custom Fields", description: "Get a list of custom fields. See the docs [here](https://clickup.com/api) in **Custom Fields / Get Accessible Custom Fields** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps(), async run({ $ }) { const { listId } = this; diff --git a/components/clickup/actions/get-folder-views/get-folder-views.mjs b/components/clickup/actions/get-folder-views/get-folder-views.mjs index 06e485be6e0f3..2eb5d8b35c6a5 100644 --- a/components/clickup/actions/get-folder-views/get-folder-views.mjs +++ b/components/clickup/actions/get-folder-views/get-folder-views.mjs @@ -1,12 +1,12 @@ import common from "../common/folder-props.mjs"; export default { + ...common, key: "clickup-get-folder-views", name: "Get Folder Views", description: "Get all views of a folder. See the docs [here](https://clickup.com/api) in **Views / Get Folder Views** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, async run({ $ }) { const { folderId } = this; diff --git a/components/clickup/actions/get-folder/get-folder.mjs b/components/clickup/actions/get-folder/get-folder.mjs index 9e9c05224765f..f6c79a6dbec9d 100644 --- a/components/clickup/actions/get-folder/get-folder.mjs +++ b/components/clickup/actions/get-folder/get-folder.mjs @@ -1,12 +1,12 @@ import common from "../common/folder-props.mjs"; export default { + ...common, key: "clickup-get-folder", name: "Get Folder", description: "Get a folder in a workplace. See the docs [here](https://clickup.com/api) in **Folders / Get Folder** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, async run({ $ }) { const { folderId } = this; diff --git a/components/clickup/actions/get-folders/get-folders.mjs b/components/clickup/actions/get-folders/get-folders.mjs index bf0bc4e22be7d..6dff53be03033 100644 --- a/components/clickup/actions/get-folders/get-folders.mjs +++ b/components/clickup/actions/get-folders/get-folders.mjs @@ -1,10 +1,11 @@ import common from "../common/space-props.mjs"; export default { + ...common, key: "clickup-get-folders", name: "Get Folders", description: "Get a list of folders in a workplace. See the docs [here](https://clickup.com/api) in **Folders / Get Folders** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, diff --git a/components/clickup/actions/get-list-comments/get-list-comments.mjs b/components/clickup/actions/get-list-comments/get-list-comments.mjs index cba6c65c23aee..934c27da1a23c 100644 --- a/components/clickup/actions/get-list-comments/get-list-comments.mjs +++ b/components/clickup/actions/get-list-comments/get-list-comments.mjs @@ -1,12 +1,23 @@ import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; export default { + ...common, key: "clickup-get-list-comments", name: "Get List Comments", description: "Get a list comments. See the docs [here](https://clickup.com/api) in **Comments / Get List Comments** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps(), async run({ $ }) { const { listId } = this; diff --git a/components/clickup/actions/get-list-views/get-list-views.mjs b/components/clickup/actions/get-list-views/get-list-views.mjs index f1a76f293a298..fe13d93fa835b 100644 --- a/components/clickup/actions/get-list-views/get-list-views.mjs +++ b/components/clickup/actions/get-list-views/get-list-views.mjs @@ -1,12 +1,23 @@ import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; export default { + ...common, key: "clickup-get-list-views", name: "Get List Views", description: "Get all views of a list. See the docs [here](https://clickup.com/api) in **Views / Get List Views** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps(), async run({ $ }) { const { listId } = this; diff --git a/components/clickup/actions/get-list/get-list.mjs b/components/clickup/actions/get-list/get-list.mjs index e836b4178d49b..1797c58869f6a 100644 --- a/components/clickup/actions/get-list/get-list.mjs +++ b/components/clickup/actions/get-list/get-list.mjs @@ -1,12 +1,23 @@ import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; export default { + ...common, key: "clickup-get-list", name: "Get List", description: "Get a list. See the docs [here](https://clickup.com/api) in **Lists / Get List** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps(), async run({ $ }) { const { listId } = this; diff --git a/components/clickup/actions/get-lists/get-lists.mjs b/components/clickup/actions/get-lists/get-lists.mjs index e720cc6fed2b4..d5ff8e225c5e1 100644 --- a/components/clickup/actions/get-lists/get-lists.mjs +++ b/components/clickup/actions/get-lists/get-lists.mjs @@ -1,10 +1,11 @@ import common from "../common/folder-props.mjs"; export default { + ...common, key: "clickup-get-lists", name: "Get Lists", description: "Get a list of lists. See the docs [here](https://clickup.com/api) in **Lists / Get Lists** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, diff --git a/components/clickup/actions/get-space-views/get-space-views.mjs b/components/clickup/actions/get-space-views/get-space-views.mjs index 26f46d024e0f3..89e09e312d409 100644 --- a/components/clickup/actions/get-space-views/get-space-views.mjs +++ b/components/clickup/actions/get-space-views/get-space-views.mjs @@ -1,12 +1,12 @@ import common from "../common/space-props.mjs"; export default { + ...common, key: "clickup-get-space-views", name: "Get Space Views", description: "Get all views of a space. See the docs [here](https://clickup.com/api) in **Views / Get Space Views** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, async run({ $ }) { const { spaceId } = this; diff --git a/components/clickup/actions/get-space/get-space.mjs b/components/clickup/actions/get-space/get-space.mjs index 99d647dad7385..6b9360adb2e99 100644 --- a/components/clickup/actions/get-space/get-space.mjs +++ b/components/clickup/actions/get-space/get-space.mjs @@ -1,12 +1,12 @@ import common from "../common/space-props.mjs"; export default { + ...common, key: "clickup-get-space", name: "Get Space", description: "Get a space in a workplace. See the docs [here](https://clickup.com/api) in **Spaces / Get Space** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, async run({ $ }) { const { spaceId } = this; diff --git a/components/clickup/actions/get-spaces/get-spaces.mjs b/components/clickup/actions/get-spaces/get-spaces.mjs index fed4e41adc2f1..ed628572dc7b6 100644 --- a/components/clickup/actions/get-spaces/get-spaces.mjs +++ b/components/clickup/actions/get-spaces/get-spaces.mjs @@ -4,7 +4,7 @@ export default { key: "clickup-get-spaces", name: "Get Spaces", description: "Get a list of spaces in a workplace. See the docs [here](https://clickup.com/api) in **Spaces / Get Spaces** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, diff --git a/components/clickup/actions/get-task-comments/get-task-comments.mjs b/components/clickup/actions/get-task-comments/get-task-comments.mjs index 5c74ae533413f..bfde7dcb39702 100644 --- a/components/clickup/actions/get-task-comments/get-task-comments.mjs +++ b/components/clickup/actions/get-task-comments/get-task-comments.mjs @@ -1,12 +1,33 @@ import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-get-task-comments", name: "Get Task Comments", description: "Get a task comments. See the docs [here](https://clickup.com/api) in **Comments / Get Task Comments** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + optional: true, + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + }, + }), async run({ $ }) { const { taskId } = this; diff --git a/components/clickup/actions/get-task-templates/get-task-templates.mjs b/components/clickup/actions/get-task-templates/get-task-templates.mjs index a6b052ef649e5..974c354822b3f 100644 --- a/components/clickup/actions/get-task-templates/get-task-templates.mjs +++ b/components/clickup/actions/get-task-templates/get-task-templates.mjs @@ -4,7 +4,7 @@ export default { key: "clickup-get-task-templates", name: "Get Task Templates", description: "Get a list of templates. See the docs [here](https://clickup.com/api) in **Task Templates / Get Task Templates** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, diff --git a/components/clickup/actions/get-task/get-task.mjs b/components/clickup/actions/get-task/get-task.mjs index a1b956d4423e3..7d91d1be0750e 100644 --- a/components/clickup/actions/get-task/get-task.mjs +++ b/components/clickup/actions/get-task/get-task.mjs @@ -1,12 +1,31 @@ import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-get-task", name: "Get Task", description: "Get a task. See the docs [here](https://clickup.com/api) in **Tasks / Get Task** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + }, + }), async run({ $ }) { const { taskId } = this; diff --git a/components/clickup/actions/get-tasks/get-tasks.mjs b/components/clickup/actions/get-tasks/get-tasks.mjs index 5dcba8b72f1ac..bf223c541f234 100644 --- a/components/clickup/actions/get-tasks/get-tasks.mjs +++ b/components/clickup/actions/get-tasks/get-tasks.mjs @@ -1,11 +1,13 @@ import clickup from "../../clickup.app.mjs"; import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; export default { + ...common, key: "clickup-get-tasks", name: "Get Tasks", description: "Get a list of tasks. See the docs [here](https://clickup.com/api) in **Tasks / Get Tasks** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -47,7 +49,14 @@ export default { ], optional: true, }, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps(), async run({ $ }) { const { listId, diff --git a/components/clickup/actions/get-team-views/get-team-views.mjs b/components/clickup/actions/get-team-views/get-team-views.mjs index 956166290729c..0d44ec7e9b364 100644 --- a/components/clickup/actions/get-team-views/get-team-views.mjs +++ b/components/clickup/actions/get-team-views/get-team-views.mjs @@ -1,12 +1,12 @@ import common from "../common/workspace-prop.mjs"; export default { + ...common, key: "clickup-get-team-views", name: "Get Team Views", description: "Get all views of a team. See the docs [here](https://clickup.com/api) in **Views / Get Team Views** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, async run({ $ }) { const { workspaceId } = this; diff --git a/components/clickup/actions/get-view-comments/get-view-comments.mjs b/components/clickup/actions/get-view-comments/get-view-comments.mjs index f2ef2b8351999..3f754997aef1e 100644 --- a/components/clickup/actions/get-view-comments/get-view-comments.mjs +++ b/components/clickup/actions/get-view-comments/get-view-comments.mjs @@ -1,12 +1,30 @@ -import common from "../common/view-props.mjs"; +import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-get-view-comments", name: "Get View Comments", description: "Get a view comments. See the docs [here](https://clickup.com/api) in **Comments / Get Chat View Comments** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + optional: true, + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + tailProps: { + viewId: propsFragments.viewId, + }, + }), async run({ $ }) { const { viewId } = this; diff --git a/components/clickup/actions/get-view-tasks/get-view-tasks.mjs b/components/clickup/actions/get-view-tasks/get-view-tasks.mjs index 0211ab0d63e8a..25ee656efa48a 100644 --- a/components/clickup/actions/get-view-tasks/get-view-tasks.mjs +++ b/components/clickup/actions/get-view-tasks/get-view-tasks.mjs @@ -1,10 +1,13 @@ -import common from "../common/view-props.mjs"; +import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-get-view-tasks", name: "Get View Tasks", description: "Get all tasks of a view. See the docs [here](https://clickup.com/api) in **Views / Get View Tasks** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -16,7 +19,20 @@ export default { default: 0, optional: true, }, + listWithFolder: { + optional: true, + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + tailProps: { + viewId: propsFragments.viewId, + }, + }), async run({ $ }) { const { viewId, diff --git a/components/clickup/actions/get-view/get-view.mjs b/components/clickup/actions/get-view/get-view.mjs index 3353ca233d13a..2184b36a7bc92 100644 --- a/components/clickup/actions/get-view/get-view.mjs +++ b/components/clickup/actions/get-view/get-view.mjs @@ -1,12 +1,30 @@ -import common from "../common/view-props.mjs"; +import common from "../common/list-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-get-view", name: "Get View", description: "Get a view. See the docs [here](https://clickup.com/api) in **Views / Get View** section.", - version: "0.0.7", + version: "0.0.8", type: "action", - props: common.props, + props: { + ...common.props, + listWithFolder: { + optional: true, + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, + }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + tailProps: { + viewId: propsFragments.viewId, + }, + }), async run({ $ }) { const { viewId } = this; diff --git a/components/clickup/actions/remove-task-custom-field/remove-task-custom-field.mjs b/components/clickup/actions/remove-task-custom-field/remove-task-custom-field.mjs index b68522da1da78..e6055f07b43fb 100644 --- a/components/clickup/actions/remove-task-custom-field/remove-task-custom-field.mjs +++ b/components/clickup/actions/remove-task-custom-field/remove-task-custom-field.mjs @@ -1,23 +1,32 @@ import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-remove-task-custom-field", name: "Remove Task Custom Field", description: "Remove custom field from a task. See the docs [here](https://clickup.com/api) in **Custom Fields / Remove Custom Field Value** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, - customFieldId: { + listWithFolder: { propDefinition: [ common.props.clickup, - "customFields", - (c) => ({ - listId: c.listId, - }), + "listWithFolder", ], }, }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + customFieldId: propsFragments.customFieldId, + }, + }), async run({ $ }) { const { taskId, diff --git a/components/clickup/actions/start-time-entry/start-time-entry.mjs b/components/clickup/actions/start-time-entry/start-time-entry.mjs index 1d5e2f08086f2..4f812bd593bfc 100644 --- a/components/clickup/actions/start-time-entry/start-time-entry.mjs +++ b/components/clickup/actions/start-time-entry/start-time-entry.mjs @@ -1,10 +1,13 @@ import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-start-time-entry", name: "Start Time Entry", description: "Start time entry. [See documentation here](https://clickup.com/api/clickupreference/operation/StartatimeEntry)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { ...common.props, @@ -13,7 +16,23 @@ export default { description: "Description of the time entry", type: "string", }, + listWithFolder: { + optional: true, + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + }, + }), async run({ $ }) { const response = await this.clickup.startTimeEntry({ $, diff --git a/components/clickup/actions/stop-time-entry/stop-time-entry.mjs b/components/clickup/actions/stop-time-entry/stop-time-entry.mjs index c6edb2b00d655..d03eab6035a2a 100644 --- a/components/clickup/actions/stop-time-entry/stop-time-entry.mjs +++ b/components/clickup/actions/stop-time-entry/stop-time-entry.mjs @@ -1,12 +1,12 @@ import common from "../common/workspace-prop.mjs"; export default { + ...common, key: "clickup-stop-time-entry", name: "Stop Time Entry", description: "Stop time entry. [See documentation here](https://clickup.com/api/clickupreference/operation/StopatimeEntry)", - version: "0.0.2", + version: "0.0.3", type: "action", - props: common.props, async run({ $ }) { const response = await this.clickup.stopTimeEntry({ $, diff --git a/components/clickup/actions/update-checklist-item/update-checklist-item.mjs b/components/clickup/actions/update-checklist-item/update-checklist-item.mjs index 03ac7ad983b2f..14ac2343ee483 100644 --- a/components/clickup/actions/update-checklist-item/update-checklist-item.mjs +++ b/components/clickup/actions/update-checklist-item/update-checklist-item.mjs @@ -1,10 +1,13 @@ -import common from "../common/checklist-item-props.mjs"; +import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-update-checklist-item", name: "Update Checklist Item", description: "Updates item in a checklist. See the docs [here](https://clickup.com/api) in **Checklists / Edit Checklist Item** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -31,22 +34,29 @@ export default { type: "boolean", optional: true, }, - parent: { - label: "Checklist Parent", - description: "Set another checklist item as parent", + listWithFolder: { propDefinition: [ common.props.clickup, - "checklistItems", - (c) => ({ - taskId: c.taskId, - checklistId: c.checklistId, - useCustomTaskIds: c.useCustomTaskIds, - authorizedTeamId: c.authorizedTeamId, - }), + "listWithFolder", ], - optional: true, }, }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + checklistId: propsFragments.checklistId, + checklistItemId: propsFragments.checklistItemId, + parent: { + ...propsFragments.checklistItemId, + label: "Checklist Parent", + description: "Set another checklist item as parent", + optional: true, + }, + }, + }), async run({ $ }) { const { checklistId, diff --git a/components/clickup/actions/update-checklist/update-checklist.mjs b/components/clickup/actions/update-checklist/update-checklist.mjs index 7f1ac192cdb6c..200b17f4c1809 100644 --- a/components/clickup/actions/update-checklist/update-checklist.mjs +++ b/components/clickup/actions/update-checklist/update-checklist.mjs @@ -1,10 +1,13 @@ -import common from "../common/checklist-props.mjs"; +import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-update-checklist", name: "Update Checklist", description: "Updates a checklist in a task. See the docs [here](https://clickup.com/api) in **Checklists / Edit Checklist** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -20,7 +23,22 @@ export default { min: 0, optional: true, }, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + checklistId: propsFragments.checklistId, + }, + }), async run({ $ }) { const { checklistId, diff --git a/components/clickup/actions/update-comment/update-comment.mjs b/components/clickup/actions/update-comment/update-comment.mjs index ee5e8d7f31746..5126b37fb2408 100644 --- a/components/clickup/actions/update-comment/update-comment.mjs +++ b/components/clickup/actions/update-comment/update-comment.mjs @@ -1,10 +1,11 @@ import common from "../common/comment-props.mjs"; export default { + ...common, key: "clickup-update-comment", name: "Update Comment", description: "Updates a comment. See the docs [here](https://clickup.com/api) in **Comments / Update Comment** section.", - version: "0.0.9", + version: "0.0.10", type: "action", props: { ...common.props, @@ -32,6 +33,12 @@ export default { type: "boolean", optional: true, }, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, async run({ $ }) { const { diff --git a/components/clickup/actions/update-folder/update-folder.mjs b/components/clickup/actions/update-folder/update-folder.mjs index 0667181df22e7..8cd3bba922830 100644 --- a/components/clickup/actions/update-folder/update-folder.mjs +++ b/components/clickup/actions/update-folder/update-folder.mjs @@ -1,10 +1,11 @@ import common from "../common/folder-props.mjs"; export default { + ...common, key: "clickup-update-folder", name: "Update Folder", description: "Update a folder. See the docs [here](https://clickup.com/api) in **Folders / Update Folder** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, diff --git a/components/clickup/actions/update-list/update-list.mjs b/components/clickup/actions/update-list/update-list.mjs index bda2a55516503..7b586db22eff5 100644 --- a/components/clickup/actions/update-list/update-list.mjs +++ b/components/clickup/actions/update-list/update-list.mjs @@ -1,12 +1,14 @@ import clickup from "../../clickup.app.mjs"; import common from "../common/list-props.mjs"; import constants from "../common/constants.mjs"; +import builder from "../../common/builder.mjs"; export default { + ...common, key: "clickup-update-list", name: "Update List", description: "Update a list. See the docs [here](https://clickup.com/api) in **Lists / Update List** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, @@ -38,7 +40,14 @@ export default { ], optional: true, }, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps(), async run({ $ }) { const { listId, diff --git a/components/clickup/actions/update-space/update-space.mjs b/components/clickup/actions/update-space/update-space.mjs index ebf5a9a5769c4..a29555ce3dc2c 100644 --- a/components/clickup/actions/update-space/update-space.mjs +++ b/components/clickup/actions/update-space/update-space.mjs @@ -1,10 +1,11 @@ import common from "../common/space-props.mjs"; export default { + ...common, key: "clickup-update-space", name: "Update Space", description: "Update a space. See the docs [here](https://clickup.com/api) in **Spaces / Update Space** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, diff --git a/components/clickup/actions/update-task-custom-field/update-task-custom-field.mjs b/components/clickup/actions/update-task-custom-field/update-task-custom-field.mjs index f3535a95590e3..471fc78dc1a2e 100644 --- a/components/clickup/actions/update-task-custom-field/update-task-custom-field.mjs +++ b/components/clickup/actions/update-task-custom-field/update-task-custom-field.mjs @@ -1,28 +1,37 @@ import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-update-task-custom-field", name: "Update Task Custom Field", description: "Update custom field value of a task. See the docs [here](https://clickup.com/api) in **Custom Fields / Set Custom Field Value** section.", - version: "0.0.7", + version: "0.0.8", type: "action", props: { ...common.props, - customFieldId: { - propDefinition: [ - common.props.clickup, - "customFields", - (c) => ({ - listId: c.listId, - }), - ], - }, value: { label: "Value", type: "any", description: "The value of custom field", }, + listWithFolder: { + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + customFieldId: propsFragments.customFieldId, + }, + }), async run({ $ }) { const { taskId, diff --git a/components/clickup/actions/update-task/update-task.mjs b/components/clickup/actions/update-task/update-task.mjs index 1bee08da87110..8ebd20349916d 100644 --- a/components/clickup/actions/update-task/update-task.mjs +++ b/components/clickup/actions/update-task/update-task.mjs @@ -1,12 +1,15 @@ +import { ConfigurationError } from "@pipedream/platform"; import common from "../common/task-props.mjs"; +import builder from "../../common/builder.mjs"; import constants from "../common/constants.mjs"; -import { ConfigurationError } from "@pipedream/platform"; +import propsFragments from "../../common/props-fragments.mjs"; export default { + ...common, key: "clickup-update-task", name: "Update Task", description: "Update a task. See the docs [here](https://clickup.com/api) in **Tasks / Update Task** section.", - version: "0.0.9", + version: "0.0.10", type: "action", props: { ...common.props, @@ -39,29 +42,6 @@ export default { ], optional: true, }, - status: { - propDefinition: [ - common.props.clickup, - "statuses", - (c) => ({ - listId: c.listId, - }), - ], - optional: true, - }, - parent: { - label: "Parent Task", - propDefinition: [ - common.props.clickup, - "tasks", - (c) => ({ - listId: c.listId, - useCustomTaskIds: c.useCustomTaskIds, - authorizedTeamId: c.authorizedTeamId, - }), - ], - optional: true, - }, dueDate: { label: "Due Date", type: "string", @@ -74,7 +54,29 @@ export default { description: "The start date of task, please use `YYYY-MM-DD` format", optional: true, }, + listWithFolder: { + optional: true, + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], + }, }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + tailProps: { + taskId: { + ...propsFragments.taskId, + description: "To show options please select a **List** first", + }, + status: propsFragments.status, + parent: { + ...propsFragments.taskId, + label: "Parent Task", + optional: true, + }, + }, + }), async run({ $ }) { const { taskId, diff --git a/components/clickup/clickup.app.mjs b/components/clickup/clickup.app.mjs index 89e5dfe812e87..9f34385b347a6 100644 --- a/components/clickup/clickup.app.mjs +++ b/components/clickup/clickup.app.mjs @@ -52,35 +52,6 @@ export default { })); }, }, - lists: { - type: "string", - label: "List", - description: "The id of a list", - async options({ - workspaceId, folderId, spaceId, - }) { - const lists = []; - - if (!folderId && !spaceId) { - lists.push(...await this.getAllLists({ - workspaceId, - })); - } else if (folderId) { - lists.push(...await this.getLists({ - folderId, - })); - } else if (spaceId) { - lists.push(...await this.getFolderlessLists({ - spaceId, - })); - } - - return lists.map((list) => ({ - label: list.name, - value: list.id, - })); - }, - }, useCustomTaskIds: { type: "boolean", label: "Use custom task ids", @@ -101,35 +72,6 @@ export default { })); }, }, - tasks: { - type: "string", - label: "Task", - description: "The id of a task", - async options({ - listId, page, useCustomTaskIds, - }) { - const tasks = await this.getTasks({ - listId, - params: { - page, - }, - }); - - const tasksHasCustomId = tasks.some((task) => task.custom_id); - if (useCustomTaskIds && !tasksHasCustomId) { - throw new ConfigurationError("Custom task id is a ClickApp, and it must to be enabled on ClickUp settings."); - } - - console.log(tasks); - - return tasks.map((task) => ({ - label: task.name, - value: useCustomTaskIds ? - task.custom_id : - task.id, - })); - }, - }, assignees: { type: "string[]", label: "Assignees", @@ -157,122 +99,6 @@ export default { return tags.map((tag) => tag.name); }, }, - checklists: { - type: "string", - label: "Checklist", - description: "The id of a checklist", - async options({ - taskId, useCustomTaskIds, authorizedTeamId, - }) { - if (!taskId) return []; - - const params = this.getParamsForCustomTaskIdCall(useCustomTaskIds, authorizedTeamId); - - const checklists = await this.getChecklists({ - taskId, - params, - }); - - return checklists.map((checklist) => ({ - label: checklist.name, - value: checklist.id, - })); - }, - }, - checklistItems: { - type: "string", - label: "Checklist Item", - description: "The id of a checklist item", - async options({ - taskId, checklistId, useCustomTaskIds, authorizedTeamId, - }) { - if (!taskId || !checklistId) return []; - - const params = this.getParamsForCustomTaskIdCall(useCustomTaskIds, authorizedTeamId); - - const items = await this.getChecklistItems({ - taskId, - checklistId, - params, - }); - - return items.map((item) => ({ - label: item.name, - value: item.id, - })); - }, - }, - comments: { - type: "string", - label: "Comment", - description: "The id of a comment", - async options({ - taskId, listId, viewId, useCustomTaskIds, authorizedTeamId, - }) { - if (!taskId && !listId && !viewId) { - throw new ConfigurationError("Please enter the List, View, or Task to retrieve Comments from"); - } - let comments = []; - - const params = this.getParamsForCustomTaskIdCall(useCustomTaskIds, authorizedTeamId); - - if (taskId) comments = comments.concat(await this.getTaskComments({ - taskId, - params, - })); - if (listId) comments = comments.concat(await this.getListComments({ - listId, - })); - if (viewId) comments = comments.concat(await this.getViewComments({ - viewId, - })); - - return comments.map((comment) => ({ - label: comment.comment_text, - value: comment.id, - })); - }, - }, - views: { - type: "string", - label: "Views", - description: "The id of a view", - async options({ - workspaceId, spaceId, folderId, listId, - }) { - let views = []; - - if (workspaceId) views = views.concat(await this.getTeamViews({ - workspaceId, - })); - if (spaceId) views = views.concat(await this.getSpaceViews({ - spaceId, - })); - if (folderId) views = views.concat(await this.getFolderViews({ - folderId, - })); - if (listId) views = views.concat(await this.getListViews({ - listId, - })); - - return views.map((view) => ({ - label: view.name, - value: view.id, - })); - }, - }, - statuses: { - type: "string", - label: "Status", - description: "Select a status", - async options({ listId }) { - const { statuses } = await this.getList({ - listId, - }); - - return statuses.map((status) => status.status); - }, - }, taskTemplates: { type: "string", label: "Task Templates", @@ -293,23 +119,6 @@ export default { })); }, }, - customFields: { - type: "string", - label: "Custom Field", - description: "Select a custom field", - async options({ listId }) { - if (!listId) return []; - - const fields = await this.getCustomFields({ - listId, - }); - - return fields.map((field) => ({ - label: field.name, - value: field.id, - })); - }, - }, priorities: { type: "string", label: "Priority", @@ -317,6 +126,12 @@ export default { options: Object.keys(constants.PRIORITIES), default: "Normal", }, + listWithFolder: { + type: "boolean", + label: "Filter List ID By Folder?", + description: "If `TRUE`, the **List ID** field will be filtered by the selected **Folder ID**", + reloadProps: true, + }, }, methods: { /** @@ -473,36 +288,6 @@ export default { method: "DELETE", }, $); }, - async getAllLists({ - workspaceId, params, $, - }) { - const lists = []; - const foldersPromises = []; - - const spaces = await this.getSpaces({ - workspaceId, - params, - $, - }); - - for (const { id: spaceId } of spaces) { - foldersPromises.push(this.getFolders({ - spaceId, - })); - lists.push(...await this.getFolderlessLists({ - spaceId, - })); - } - - const folders = (await Promise.all(foldersPromises)).flat(); - for (const { id: folderId } of folders) { - lists.push(...await this.getLists({ - folderId, - })); - } - - return lists; - }, async getLists({ folderId, params, $, }) { diff --git a/components/clickup/common/builder.mjs b/components/clickup/common/builder.mjs new file mode 100644 index 0000000000000..c33efd4f56b01 --- /dev/null +++ b/components/clickup/common/builder.mjs @@ -0,0 +1,84 @@ +const buildListProps = ({ + listPropsOptional: optional = false, + tailProps, +} = {}) => function additionalProps() { + if (!this.listWithFolder) { + return { + listId: { + type: "string", + label: "List ID", + description: "The id of a list", + optional, + options: async () => { + const { + app, + clickup, + spaceId, + } = this; + const lists = await (clickup || app).getFolderlessLists({ + spaceId, + }); + return lists.map(({ + name: label, id: value, + }) => ({ + label, + value, + })); + }, + }, + ...tailProps, + }; + } + + return { + folderId: { + type: "string", + label: "Folder ID", + description: "The id of a folder", + optional, + options: async () => { + const { + app, + clickup, + spaceId, + } = this; + const folders = await (clickup || app).getFolders({ + spaceId, + }); + return folders.map(({ + name: label, id: value, + }) => ({ + label, + value, + })); + }, + }, + listId: { + type: "string", + label: "List ID", + description: "The id of a list", + optional, + options: async () => { + const { + app, + clickup, + folderId, + } = this; + const lists = await (clickup || app).getLists({ + folderId, + }); + return lists.map(({ + name: label, id: value, + }) => ({ + label, + value, + })); + }, + }, + ...tailProps, + }; +}; + +export default { + buildListProps, +}; diff --git a/components/clickup/common/props-fragments.mjs b/components/clickup/common/props-fragments.mjs new file mode 100644 index 0000000000000..508359ab9b2a0 --- /dev/null +++ b/components/clickup/common/props-fragments.mjs @@ -0,0 +1,223 @@ +import { ConfigurationError } from "@pipedream/platform"; + +export default { + viewId: { + type: "string", + label: "View Id", + description: "The id of a view", + options: async () => { + const { + app, + clickup, + workspaceId, + spaceId, + folderId, + listId, + } = this; + + let views = []; + if (workspaceId) { + views = views.concat(await (clickup || app).getTeamViews({ + workspaceId, + })); + } + if (spaceId) { + views = views.concat(await (clickup || app).getSpaceViews({ + spaceId, + })); + } + if (folderId) { + views = views.concat(await (clickup || app).getFolderViews({ + folderId, + })); + } + if (listId) { + views = views.concat(await (clickup || app).getListViews({ + listId, + })); + } + return views.map((view) => ({ + label: view.name, + value: view.id, + })); + }, + }, + taskId: { + type: "string", + label: "Task", + description: "The id of a task", + options: async ({ page }) => { + const { + app, + clickup, + listId, + useCustomTaskIds, + } = this; + + const tasks = await (clickup || app).getTasks({ + listId, + params: { + page, + }, + }); + + const tasksHasCustomId = tasks.some((task) => task.custom_id); + if (useCustomTaskIds && !tasksHasCustomId) { + throw new ConfigurationError("Custom task id is a ClickApp, and it must to be enabled on ClickUp settings."); + } + + return tasks.map((task) => ({ + label: task.name, + value: useCustomTaskIds ? + task.custom_id : + task.id, + })); + }, + }, + status: { + type: "string", + label: "Status", + description: "Select a status", + optional: true, + options: async () => { + const { + app, + clickup, + listId, + } = this; + + const { statuses } = await (clickup || app).getList({ + listId, + }); + return statuses.map(({ status }) => status); + }, + }, + checklistId: { + type: "string", + label: "Checklist", + description: "To show options please select a **Task** first", + options: async () => { + const { + app, + clickup, + taskId, + useCustomTaskIds, + authorizedTeamId, + } = this; + + if (!taskId) { + return []; + } + + const params = + (clickup || app).getParamsForCustomTaskIdCall(useCustomTaskIds, authorizedTeamId); + + const checklists = await (clickup || app).getChecklists({ + taskId, + params, + }); + + return checklists.map((checklist) => ({ + label: checklist.name, + value: checklist.id, + })); + }, + }, + checklistItemId: { + type: "string", + label: "Checklist Item", + description: "To show options please select a **Task and Checklist** first", + options: async () => { + const { + app, + clickup, + taskId, + checklistId, + useCustomTaskIds, + authorizedTeamId, + } = this; + + if (!taskId || !checklistId) { + return []; + } + + const params = + (clickup || app).getParamsForCustomTaskIdCall(useCustomTaskIds, authorizedTeamId); + + const items = await (clickup || app).getChecklistItems({ + taskId, + checklistId, + params, + }); + + return items.map((item) => ({ + label: item.name, + value: item.id, + })); + }, + }, + customFieldId: { + type: "string", + label: "Custom Field", + description: "Select a custom field", + options: async () => { + const { + app, + clickup, + listId, + } = this; + if (!listId) { + return []; + } + const fields = await (clickup || app).getCustomFields({ + listId, + }); + + return fields.map((field) => ({ + label: field.name, + value: field.id, + })); + }, + }, + commentId: { + type: "string", + label: "Comment", + description: "The id of a comment", + options: async () => { + const { + app, + clickup, + taskId, + listId, + viewId, + } = this; + + if (!taskId && !listId && !viewId) { + throw new ConfigurationError("Please enter the List, View, or Task to retrieve Comments from"); + } + let comments = []; + + if (taskId) { + comments = comments.concat(await (clickup || app).getTaskComments({ + taskId, + params: {}, + })); + } + if (listId) { + comments = comments.concat(await (clickup || app).getListComments({ + listId, + })); + } + if (viewId) { + comments = comments.concat(await (clickup || app).getViewComments({ + viewId, + })); + } + + return comments.map((comment) => ({ + label: comment.comment_text, + value: comment.id, + })); + }, + }, +}; diff --git a/components/clickup/package.json b/components/clickup/package.json index dd67e03676d45..95385b1e35d51 100644 --- a/components/clickup/package.json +++ b/components/clickup/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/clickup", - "version": "0.2.1", + "version": "0.2.2", "description": "Pipedream Clickup Components", "main": "clickup.app.mjs", "keywords": [ @@ -14,7 +14,7 @@ "access": "public" }, "dependencies": { - "@pipedream/platform": "^0.10.0", + "@pipedream/platform": "^3.0.0", "crypto": "^1.0.1", "lodash": "^4.17.21" } diff --git a/components/clickup/sources/new-folder/new-folder.mjs b/components/clickup/sources/new-folder/new-folder.mjs index f1129269090cf..59b15ff060aa0 100644 --- a/components/clickup/sources/new-folder/new-folder.mjs +++ b/components/clickup/sources/new-folder/new-folder.mjs @@ -5,7 +5,7 @@ export default { key: "clickup-new-folder", name: "New Folder (Instant)", description: "Emit new event when a new folder is created", - version: "0.0.6", + version: "0.0.7", dedupe: "unique", type: "source", methods: { diff --git a/components/clickup/sources/new-list/new-list.mjs b/components/clickup/sources/new-list/new-list.mjs index e2ed36c6eb4c7..c698897c76e8b 100644 --- a/components/clickup/sources/new-list/new-list.mjs +++ b/components/clickup/sources/new-list/new-list.mjs @@ -5,7 +5,7 @@ export default { key: "clickup-new-list", name: "New List (Instant)", description: "Emit new event when a new list is created", - version: "0.0.6", + version: "0.0.7", dedupe: "unique", type: "source", methods: { diff --git a/components/clickup/sources/new-task-advanced/new-task-advanced.mjs b/components/clickup/sources/new-task-advanced/new-task-advanced.mjs index 258cae7b27c68..643159131ebeb 100644 --- a/components/clickup/sources/new-task-advanced/new-task-advanced.mjs +++ b/components/clickup/sources/new-task-advanced/new-task-advanced.mjs @@ -1,11 +1,12 @@ import common from "../common/common.mjs"; +import builder from "../../common/builder.mjs"; export default { ...common, key: "clickup-new-task-advanced", name: "New Task Advanced (Instant)", description: "Emit new event when a new task is created matching the filter", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", type: "source", props: { @@ -18,33 +19,18 @@ export default { workspaceId: c.workspaceId, }), ], - description: "If selected, the **Lists** will be filtered by this Space ID", - optional: true, }, - folderId: { - propDefinition: [ - common.props.app, - "folders", - (c) => ({ - spaceId: c.spaceId, - }), - ], - description: "If selected, the **Lists** will be filtered by this Folder ID", + listWithFolder: { optional: true, - }, - listId: { propDefinition: [ - common.props.app, - "lists", - (c) => ({ - workspaceId: c.workspaceId, - spaceId: c.spaceId, - folderId: c.folderId, - }), + common.props.clickup, + "listWithFolder", ], - optional: true, }, }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + }), methods: { ...common.methods, _getMeta({ task_id: taskId }) { diff --git a/components/clickup/sources/new-task/new-task.mjs b/components/clickup/sources/new-task/new-task.mjs index 670daf5fe0307..a57673b01b486 100644 --- a/components/clickup/sources/new-task/new-task.mjs +++ b/components/clickup/sources/new-task/new-task.mjs @@ -1,28 +1,36 @@ import common from "../common/common.mjs"; -import app from "../../clickup.app.mjs"; +import builder from "../../common/builder.mjs"; export default { ...common, key: "clickup-new-task", name: "New Task (Instant)", description: "Emit new event when a new task is created", - version: "0.1.2", + version: "0.1.3", dedupe: "unique", type: "source", props: { ...common.props, - listId: { + spaceId: { propDefinition: [ - app, - "lists", - ({ workspaceId }) => ({ - workspaceId, + common.props.app, + "spaces", + (c) => ({ + workspaceId: c.workspaceId, }), ], - description: "If a list is selected, only tasks created in this list will emit an event", + }, + listWithFolder: { optional: true, + propDefinition: [ + common.props.clickup, + "listWithFolder", + ], }, }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + }), methods: { ...common.methods, _getMeta({ task_id: taskId }) { diff --git a/components/clickup/sources/updated-task/updated-task.mjs b/components/clickup/sources/updated-task/updated-task.mjs index a1a6d05d5ee4c..f86d7acbfcbf3 100644 --- a/components/clickup/sources/updated-task/updated-task.mjs +++ b/components/clickup/sources/updated-task/updated-task.mjs @@ -1,26 +1,24 @@ import common from "../common/common.mjs"; -import app from "../../clickup.app.mjs"; import constants from "../common/constants.mjs"; +import builder from "../../common/builder.mjs"; +import propsFragments from "../../common/props-fragments.mjs"; export default { ...common, key: "clickup-updated-task", name: "New Updated Task (Instant)", description: "Emit new event when a new task is updated", - version: "0.0.8", + version: "0.0.9", dedupe: "unique", type: "source", props: { ...common.props, - listId: { - description: "If a list is selected, only tasks updated in this list will emit an event", - optional: true, - reloadProps: true, + spaceId: { propDefinition: [ - app, - "lists", - ({ workspaceId }) => ({ - workspaceId, + common.props.app, + "spaces", + (c) => ({ + workspaceId: c.workspaceId, }), ], }, @@ -31,20 +29,26 @@ export default { options: constants.TASK_FIELDS, optional: true, }, - customFieldIds: { - label: "Custom Fields", - type: "string[]", - description: "Select a custom field to filter", + listWithFolder: { optional: true, propDefinition: [ - app, - "customFields", - ({ listId }) => ({ - listId, - }), + common.props.clickup, + "listWithFolder", ], }, }, + additionalProps: builder.buildListProps({ + listPropsOptional: true, + tailProps: { + customFieldIds: { + ...propsFragments.customFieldId, + label: "Custom Fields", + type: "string[]", + description: "Select a custom field to filter", + optional: true, + }, + }, + }), methods: { ...common.methods, _getMeta(historyItems) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0eba625c5f63f..43d3d3ece09a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1605,11 +1605,11 @@ importers: components/clickup: specifiers: - '@pipedream/platform': ^0.10.0 + '@pipedream/platform': ^3.0.0 crypto: ^1.0.1 lodash: ^4.17.21 dependencies: - '@pipedream/platform': 0.10.0 + '@pipedream/platform': 3.0.0 crypto: 1.0.1 lodash: 4.17.21