diff --git a/components/asana/actions/add-task-to-section/add-task-to-section.mjs b/components/asana/actions/add-task-to-section/add-task-to-section.mjs index f74e5b4fa8ee3..b1c0b141e5e4b 100644 --- a/components/asana/actions/add-task-to-section/add-task-to-section.mjs +++ b/components/asana/actions/add-task-to-section/add-task-to-section.mjs @@ -5,7 +5,7 @@ export default { name: "Add Task To Section", description: "Add a task to a specific, existing section. This will remove the task from other sections of the project. [See the documentation](https://developers.asana.com/docs/add-task-to-section)", key: "asana-add-task-to-section", - version: "0.2.8", + version: "0.2.9", type: "action", props: { ...common.props, diff --git a/components/asana/actions/create-project/create-project.mjs b/components/asana/actions/create-project/create-project.mjs index 88917bbcbb71b..b41187d3baefd 100644 --- a/components/asana/actions/create-project/create-project.mjs +++ b/components/asana/actions/create-project/create-project.mjs @@ -5,7 +5,7 @@ export default { key: "asana-create-project", name: "Create Project", description: "Create a new project in a workspace or team. [See the documentation](https://developers.asana.com/docs/create-a-project)", - version: "0.10.1", + version: "0.10.2", type: "action", props: { asana, diff --git a/components/asana/actions/create-subtask/create-subtask.mjs b/components/asana/actions/create-subtask/create-subtask.mjs index 2bd1e7dadcade..b5f186ce335aa 100644 --- a/components/asana/actions/create-subtask/create-subtask.mjs +++ b/components/asana/actions/create-subtask/create-subtask.mjs @@ -5,7 +5,7 @@ export default { key: "asana-create-subtask", name: "Create Subtask", description: "Creates a new subtask and adds it to the parent task. [See the documentation](https://developers.asana.com/docs/create-a-subtask)", - version: "0.4.1", + version: "0.4.2", type: "action", props: { ...common.props, diff --git a/components/asana/actions/create-task-comment/create-task-comment.mjs b/components/asana/actions/create-task-comment/create-task-comment.mjs index bbf7ade7e5cda..394d573e82d3e 100644 --- a/components/asana/actions/create-task-comment/create-task-comment.mjs +++ b/components/asana/actions/create-task-comment/create-task-comment.mjs @@ -5,7 +5,7 @@ export default { key: "asana-create-task-comment", name: "Create Task Comment", description: "Adds a comment to a task. [See the documentation](https://developers.asana.com/docs/create-a-story-on-a-task)", - version: "0.2.8", + version: "0.2.9", type: "action", props: { ...common.props, diff --git a/components/asana/actions/create-task-from-template/create-task-from-template.mjs b/components/asana/actions/create-task-from-template/create-task-from-template.mjs index b083fd25f05f7..4802679f7663e 100644 --- a/components/asana/actions/create-task-from-template/create-task-from-template.mjs +++ b/components/asana/actions/create-task-from-template/create-task-from-template.mjs @@ -4,7 +4,7 @@ export default { name: "Create Task from Template", key: "asana-create-task-from-template", description: "Creates a new task from a task template. [See the documentation](https://developers.asana.com/reference/instantiatetask)", - version: "0.0.3", + version: "0.0.4", type: "action", props: { ...common.props, diff --git a/components/asana/actions/create-task/create-task.mjs b/components/asana/actions/create-task/create-task.mjs index 5c75c2c225fb1..7a9486ab1b6af 100644 --- a/components/asana/actions/create-task/create-task.mjs +++ b/components/asana/actions/create-task/create-task.mjs @@ -5,7 +5,7 @@ export default { key: "asana-create-task", name: "Create Task", description: "Creates a new task. [See the documentation](https://developers.asana.com/docs/create-a-task)", - version: "0.4.1", + version: "0.4.2", type: "action", props: { ...common.props, diff --git a/components/asana/actions/delete-task/delete-task.mjs b/components/asana/actions/delete-task/delete-task.mjs index 9c31b78f89ec8..a9377d14b766f 100644 --- a/components/asana/actions/delete-task/delete-task.mjs +++ b/components/asana/actions/delete-task/delete-task.mjs @@ -5,7 +5,7 @@ export default { key: "asana-delete-task", name: "Delete Task", description: "Deletes a specific and existing task. [See the documentation](https://developers.asana.com/docs/delete-a-task)", - version: "0.0.9", + version: "0.0.10", type: "action", props: { ...common.props, diff --git a/components/asana/actions/find-task-by-id/find-task-by-id.mjs b/components/asana/actions/find-task-by-id/find-task-by-id.mjs index b184711450368..c26360e96e07b 100644 --- a/components/asana/actions/find-task-by-id/find-task-by-id.mjs +++ b/components/asana/actions/find-task-by-id/find-task-by-id.mjs @@ -5,7 +5,7 @@ export default { key: "asana-find-task-by-id", name: "Find Task by ID", description: "Searches for a task by id. Returns the complete task record for a single task. [See the documentation](https://developers.asana.com/docs/get-a-task)", - version: "0.2.8", + version: "0.2.9", type: "action", props: { ...common.props, diff --git a/components/asana/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs b/components/asana/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs index 1f05c49e87ce9..9e891bce312e9 100644 --- a/components/asana/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs +++ b/components/asana/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs @@ -4,7 +4,7 @@ export default { key: "asana-get-tasks-from-task-list", name: "Get Tasks From Task List", description: "Returns the compact list of tasks in a user’s My Tasks list. [See the documentation](https://developers.asana.com/reference/gettasksforusertasklist)", - version: "0.0.6", + version: "0.0.7", type: "action", props: { ...common.props, diff --git a/components/asana/actions/search-projects/search-projects.mjs b/components/asana/actions/search-projects/search-projects.mjs index ae0e94753627f..37b633eac8faa 100644 --- a/components/asana/actions/search-projects/search-projects.mjs +++ b/components/asana/actions/search-projects/search-projects.mjs @@ -3,7 +3,7 @@ import asana from "../../asana.app.mjs"; export default { type: "action", key: "asana-search-projects", - version: "0.2.8", + version: "0.2.9", name: "Search Projects", description: "Finds an existing project. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)", props: { diff --git a/components/asana/actions/search-sections/search-sections.mjs b/components/asana/actions/search-sections/search-sections.mjs index 4ae087ee978ac..988aae2fff66c 100644 --- a/components/asana/actions/search-sections/search-sections.mjs +++ b/components/asana/actions/search-sections/search-sections.mjs @@ -4,7 +4,7 @@ export default { key: "asana-search-sections", name: "Search Sections", description: "Searches for a section by name within a particular project. [See the documentation](https://developers.asana.com/docs/get-sections-in-a-project)", - version: "0.2.8", + version: "0.2.9", type: "action", props: { ...common.props, diff --git a/components/asana/actions/search-tasks/search-tasks.mjs b/components/asana/actions/search-tasks/search-tasks.mjs index c9e7df888bc8d..06d36f8b9921d 100644 --- a/components/asana/actions/search-tasks/search-tasks.mjs +++ b/components/asana/actions/search-tasks/search-tasks.mjs @@ -6,7 +6,7 @@ export default { key: "asana-search-tasks", name: "Search Tasks", description: "Searches for a Task by name within a Project. [See the documentation](https://developers.asana.com/docs/get-multiple-tasks)", - version: "0.3.2", + version: "0.3.3", type: "action", props: { ...common.props, diff --git a/components/asana/actions/search-user-projects/search-user-projects.mjs b/components/asana/actions/search-user-projects/search-user-projects.mjs index 52d34e99bcb65..5960b2036ba13 100644 --- a/components/asana/actions/search-user-projects/search-user-projects.mjs +++ b/components/asana/actions/search-user-projects/search-user-projects.mjs @@ -5,7 +5,7 @@ export default { key: "asana-search-user-projects", name: "Get list of user projects", description: "Return list of projects given the user and workspace gid. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)", - version: "0.5.1", + version: "0.5.2", type: "action", props: { asana, diff --git a/components/asana/actions/update-task/update-task.mjs b/components/asana/actions/update-task/update-task.mjs index 2f368e2b2cdec..e4328d24305a9 100644 --- a/components/asana/actions/update-task/update-task.mjs +++ b/components/asana/actions/update-task/update-task.mjs @@ -5,7 +5,7 @@ export default { key: "asana-update-task", name: "Update Task", description: "Updates a specific and existing task. [See the documentation](https://developers.asana.com/docs/update-a-task)", - version: "0.4.1", + version: "0.4.2", type: "action", props: { ...common.props, diff --git a/components/asana/asana.app.mjs b/components/asana/asana.app.mjs index 53dc684a34859..4896e6804ce57 100644 --- a/components/asana/asana.app.mjs +++ b/components/asana/asana.app.mjs @@ -225,7 +225,7 @@ export default { description: "List of task fields that will emit events when updated. This field uses the field code.", type: "string[]", async options({ project }) { - const tasks = await this.getTasks({ + const { data: tasks } = await this.getTasks({ params: { project, limit: 1, @@ -234,7 +234,9 @@ export default { if (!tasks || tasks.length === 0) { return []; } - const task = await this.getTask(tasks[0].gid); + const { data: task } = await this.getTask({ + taskId: tasks[0].gid, + }); return Object.keys(task); }, }, diff --git a/components/asana/package.json b/components/asana/package.json index 3222fc12f6a98..2c39efaa1c569 100644 --- a/components/asana/package.json +++ b/components/asana/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/asana", - "version": "0.7.2", + "version": "0.7.3", "description": "Pipedream Asana Components", "main": "asana.app.mjs", "keywords": [ diff --git a/components/asana/sources/new-completed-task/new-completed-task.mjs b/components/asana/sources/new-completed-task/new-completed-task.mjs index 2d81db4f8e252..81acedc45872b 100644 --- a/components/asana/sources/new-completed-task/new-completed-task.mjs +++ b/components/asana/sources/new-completed-task/new-completed-task.mjs @@ -7,7 +7,7 @@ export default { type: "source", name: "New Completed Task (Instant)", description: "Emit new event for each task completed in a project.", - version: "0.1.8", + version: "0.1.9", dedupe: "unique", props: { ...common.props, diff --git a/components/asana/sources/new-project/new-project.mjs b/components/asana/sources/new-project/new-project.mjs index c85a73cefe680..1ca504147d633 100644 --- a/components/asana/sources/new-project/new-project.mjs +++ b/components/asana/sources/new-project/new-project.mjs @@ -6,7 +6,7 @@ export default { key: "asana-new-project", name: "New Project Added To Workspace (Instant)", description: "Emit new event for each new project added to a workspace.", - version: "0.1.8", + version: "0.1.9", dedupe: "unique", props: { ...common.props, diff --git a/components/asana/sources/new-story/new-story.mjs b/components/asana/sources/new-story/new-story.mjs index 6844677f12bc5..ebeb0a0623d19 100644 --- a/components/asana/sources/new-story/new-story.mjs +++ b/components/asana/sources/new-story/new-story.mjs @@ -7,7 +7,7 @@ export default { type: "source", name: "New Story Added To Project (Instant)", description: "Emit new event for each story added to a project.", - version: "0.1.8", + version: "0.1.9", dedupe: "unique", props: { ...common.props, diff --git a/components/asana/sources/new-subtask/new-subtask.mjs b/components/asana/sources/new-subtask/new-subtask.mjs index 70531a86c480f..74fa312576fe3 100644 --- a/components/asana/sources/new-subtask/new-subtask.mjs +++ b/components/asana/sources/new-subtask/new-subtask.mjs @@ -7,7 +7,7 @@ export default { type: "source", name: "New Subtask (Instant)", description: "Emit new event for each subtask added to a project.", - version: "1.0.8", + version: "1.0.9", dedupe: "unique", props: { ...common.props, diff --git a/components/asana/sources/new-tag/new-tag.mjs b/components/asana/sources/new-tag/new-tag.mjs index 9410a116bf939..99d31dbcd7283 100644 --- a/components/asana/sources/new-tag/new-tag.mjs +++ b/components/asana/sources/new-tag/new-tag.mjs @@ -6,7 +6,7 @@ export default { type: "source", name: "New Tag", description: "Emit new event for each tag created in a workspace.", - version: "0.0.10", + version: "0.0.11", dedupe: "unique", props: { asana, diff --git a/components/asana/sources/new-task/new-task.mjs b/components/asana/sources/new-task/new-task.mjs index 17ca2603dc812..9be842c099ce6 100644 --- a/components/asana/sources/new-task/new-task.mjs +++ b/components/asana/sources/new-task/new-task.mjs @@ -7,7 +7,7 @@ export default { type: "source", name: "New Task (Instant)", description: "Emit new event for each task added to a project. [See docs here](https://developers.asana.com/docs/establish-a-webhook)", - version: "0.1.8", + version: "0.1.9", dedupe: "unique", props: { ...common.props, diff --git a/components/asana/sources/new-team/new-team.mjs b/components/asana/sources/new-team/new-team.mjs index 96874a36e3758..182576aaf40e5 100644 --- a/components/asana/sources/new-team/new-team.mjs +++ b/components/asana/sources/new-team/new-team.mjs @@ -6,7 +6,7 @@ export default { type: "source", name: "New Team", description: "Emit new event for each team added to an organization.", - version: "0.1.9", + version: "0.1.10", dedupe: "unique", props: { asana, diff --git a/components/asana/sources/new-user/new-user.mjs b/components/asana/sources/new-user/new-user.mjs index 77446a7b55e45..0eacccadd9c69 100644 --- a/components/asana/sources/new-user/new-user.mjs +++ b/components/asana/sources/new-user/new-user.mjs @@ -6,7 +6,7 @@ export default { type: "source", name: "New User (Instant)", description: "Emit new event for each user added to a workspace.", - version: "0.1.8", + version: "0.1.9", dedupe: "unique", props: { ...common.props, diff --git a/components/asana/sources/new-workspace/new-workspace.mjs b/components/asana/sources/new-workspace/new-workspace.mjs index 40a7d8f1707e9..2c0120958c7cd 100644 --- a/components/asana/sources/new-workspace/new-workspace.mjs +++ b/components/asana/sources/new-workspace/new-workspace.mjs @@ -6,7 +6,7 @@ export default { key: "asana-new-workspace", name: "New Workspace Added", description: "Emit new event each time you add a new workspace/organization.", - version: "0.1.9", + version: "0.1.10", dedupe: "unique", props: { asana, diff --git a/components/asana/sources/tag-added-to-task/tag-added-to-task.mjs b/components/asana/sources/tag-added-to-task/tag-added-to-task.mjs index 805ae85cc6794..37fde3a75ad48 100644 --- a/components/asana/sources/tag-added-to-task/tag-added-to-task.mjs +++ b/components/asana/sources/tag-added-to-task/tag-added-to-task.mjs @@ -7,7 +7,7 @@ export default { type: "source", name: "New Tag Added To Task (Instant)", description: "Emit new event for each new tag added to a task.", - version: "0.1.8", + version: "0.1.9", dedupe: "unique", props: { ...common.props, diff --git a/components/asana/sources/tags-added-to-any-task/tags-added-to-any-task.mjs b/components/asana/sources/tags-added-to-any-task/tags-added-to-any-task.mjs index c966cacc30794..c897a20d57788 100644 --- a/components/asana/sources/tags-added-to-any-task/tags-added-to-any-task.mjs +++ b/components/asana/sources/tags-added-to-any-task/tags-added-to-any-task.mjs @@ -7,7 +7,7 @@ export default { type: "source", name: "New Tags added to any task (Instant)", description: "Emit new event each time a tag is added to any task, optionally filtering by a given set of tags.", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, diff --git a/components/asana/sources/task-assigned-in-project/task-assigned-in-project.mjs b/components/asana/sources/task-assigned-in-project/task-assigned-in-project.mjs index 7e772f53e8be0..3de885c1bbeb9 100644 --- a/components/asana/sources/task-assigned-in-project/task-assigned-in-project.mjs +++ b/components/asana/sources/task-assigned-in-project/task-assigned-in-project.mjs @@ -7,7 +7,7 @@ export default { type: "source", name: "New Task Assigned in Project (Instant)", description: "Emit new event each time a task is assigned, reassigned or unassigned.", - version: "0.1.1", + version: "0.1.2", dedupe: "unique", props: { ...common.props, diff --git a/components/asana/sources/task-field-updated-in-project/task-field-updated-in-project.mjs b/components/asana/sources/task-field-updated-in-project/task-field-updated-in-project.mjs index 3c3a77a7dce70..525058c9cef43 100644 --- a/components/asana/sources/task-field-updated-in-project/task-field-updated-in-project.mjs +++ b/components/asana/sources/task-field-updated-in-project/task-field-updated-in-project.mjs @@ -7,13 +7,13 @@ export default { type: "source", name: "New Task Field Updated In Project (Instant)", description: "Emit new event whenever given task fields are updated.", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, project: { label: "Project", - description: "Gid of a project.", + description: "GID of a project", type: "string", propDefinition: [ asana, @@ -37,20 +37,25 @@ export default { ...common.methods, getWebhookFilter() { return { - filters: [ - { - action: "changed", - resource_type: "task", - fields: this.taskFields, - }, - ], resource: this.project, }; }, + isRelevant({ + resource, change, parent, + }) { + const { taskFields } = this; + return resource.resource_type === "task" + && ( + taskFields.includes(change?.field) + || taskFields.includes(parent?.resource_type) + || taskFields.find((field) => field.slice(0, -1) === parent?.resource_type) + ); + }, async emitEvent(event) { const { events = [] } = event.body || {}; const promises = events + .filter((event) => this.isRelevant(event)) .map(async (event) => ({ event, task: (await this.asana.getTask({ diff --git a/components/asana/sources/task-updated-in-project/task-updated-in-project.mjs b/components/asana/sources/task-updated-in-project/task-updated-in-project.mjs index 83cd975c52f1b..650f7c3754961 100644 --- a/components/asana/sources/task-updated-in-project/task-updated-in-project.mjs +++ b/components/asana/sources/task-updated-in-project/task-updated-in-project.mjs @@ -7,7 +7,7 @@ export default { type: "source", name: "New Task Updated In Project (Instant)", description: "Emit new event for each update to a task.", - version: "1.1.7", + version: "1.1.8", dedupe: "unique", props: { ...common.props, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 444614bbe09b6..196a86def8262 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34735,6 +34735,8 @@ snapshots: '@putout/operator-filesystem': 5.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3)) '@putout/operator-json': 2.2.0 putout: 36.13.1(eslint@8.57.1)(typescript@5.6.3) + transitivePeerDependencies: + - supports-color '@putout/operator-regexp@1.0.0(putout@36.13.1(eslint@8.57.1)(typescript@5.6.3))': dependencies: