@pipedream/asana 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/actions/add-task-to-section/add-task-to-section.mjs +1 -1
- package/actions/create-project/create-project.mjs +1 -1
- package/actions/create-subtask/create-subtask.mjs +1 -1
- package/actions/create-task/create-task.mjs +1 -1
- package/actions/create-task-comment/create-task-comment.mjs +1 -1
- package/actions/create-task-from-template/create-task-from-template.mjs +40 -0
- package/actions/delete-task/delete-task.mjs +1 -1
- package/actions/find-task-by-id/find-task-by-id.mjs +1 -1
- package/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs +1 -1
- package/actions/search-projects/search-projects.mjs +1 -1
- package/actions/search-sections/search-sections.mjs +1 -1
- package/actions/search-tasks/search-tasks.mjs +1 -1
- package/actions/search-user-projects/search-user-projects.mjs +1 -1
- package/actions/update-task/update-task.mjs +1 -1
- package/asana.app.mjs +47 -0
- package/package.json +2 -3
- package/sources/new-completed-task/new-completed-task.mjs +1 -1
- package/sources/new-project/new-project.mjs +1 -1
- package/sources/new-story/new-story.mjs +1 -1
- package/sources/new-subtask/new-subtask.mjs +1 -1
- package/sources/new-tag/new-tag.mjs +1 -1
- package/sources/new-task/new-task.mjs +1 -1
- package/sources/new-team/new-team.mjs +1 -1
- package/sources/new-user/new-user.mjs +1 -1
- package/sources/new-workspace/new-workspace.mjs +1 -1
- package/sources/tag-added-to-task/tag-added-to-task.mjs +1 -1
- package/sources/tags-added-to-any-task/tags-added-to-any-task.mjs +1 -1
- package/sources/task-assigned-in-project/task-assigned-in-project.mjs +1 -1
- package/sources/task-field-updated-in-project/task-field-updated-in-project.mjs +1 -1
- package/sources/task-updated-in-project/task-updated-in-project.mjs +28 -4
package/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
The Asana API taps into the feature-rich project management platform, allowing you to automate tasks, sync data across apps, and enhance team collaboration. With the Asana API on Pipedream, you can create tasks, update project timelines, and trigger workflows from events within Asana—like new tasks or comments—streamlining your project management processes. Pipedream’s serverless platform empowers you to build complex workflows with minimal overhead, integrating Asana with numerous other services to maximize productivity and reduce manual workload.
|
|
4
|
+
|
|
5
|
+
# Example Use Cases
|
|
6
|
+
|
|
7
|
+
- **Task Creation from Emails**: Automatically create Asana tasks from incoming emails. When you receive an email tagged with a specific label or keyword, a Pipedream workflow can parse the email content and create a new task in Asana with appropriate details, ensuring that action items from emails are never missed.
|
|
8
|
+
|
|
9
|
+
- **GitHub Commit Linked Project Updates**: Keep your development work in sync with project management by triggering Asana task updates when new commits are pushed to a GitHub repository. This Pipedream workflow can be set to update a task's status, add comments, or create subtasks, providing real-time project tracking for software teams.
|
|
10
|
+
|
|
11
|
+
- **Slack Notifications for Task Completion**: Improve team communication by sending a notification to a designated Slack channel whenever a task in Asana is completed. This ensures all team members are immediately updated about project progress and can celebrate milestones or quickly move on to the next task.
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Add Task To Section",
|
|
6
6
|
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)",
|
|
7
7
|
key: "asana-add-task-to-section",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "asana-create-project",
|
|
6
6
|
name: "Create Project",
|
|
7
7
|
description: "Create a new project in a workspace or team. [See the documentation](https://developers.asana.com/docs/create-a-project)",
|
|
8
|
-
version: "0.9.
|
|
8
|
+
version: "0.9.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
asana,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "asana-create-subtask",
|
|
6
6
|
name: "Create Subtask",
|
|
7
7
|
description: "Creates a new subtask and adds it to the parent task. [See the documentation](https://developers.asana.com/docs/create-a-subtask)",
|
|
8
|
-
version: "0.3.
|
|
8
|
+
version: "0.3.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "asana-create-task",
|
|
6
6
|
name: "Create Task",
|
|
7
7
|
description: "Creates a new task. [See the documentation](https://developers.asana.com/docs/create-a-task)",
|
|
8
|
-
version: "0.3.
|
|
8
|
+
version: "0.3.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "asana-create-task-comment",
|
|
6
6
|
name: "Create Task Comment",
|
|
7
7
|
description: "Adds a comment to a task. [See the documentation](https://developers.asana.com/docs/create-a-story-on-a-task)",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import common from "../common/common.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: "Create Task from Template",
|
|
5
|
+
key: "asana-create-task-from-template",
|
|
6
|
+
description: "Creates a new task from a task template. [See the documentation](https://developers.asana.com/reference/instantiatetask)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
...common.props,
|
|
11
|
+
taskTemplateId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
common.props.asana,
|
|
14
|
+
"taskTemplate",
|
|
15
|
+
(c) => ({
|
|
16
|
+
project: c.project,
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
name: {
|
|
21
|
+
type: "string",
|
|
22
|
+
label: "Name",
|
|
23
|
+
description: "The name of the new task. If not provided, the name of the task template will be used.",
|
|
24
|
+
optional: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
async run({ $ }) {
|
|
28
|
+
const response = await this.asana.createTaskFromTemplate({
|
|
29
|
+
$,
|
|
30
|
+
taskTemplateId: this.taskTemplateId,
|
|
31
|
+
data: {
|
|
32
|
+
data: {
|
|
33
|
+
name: this.name,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
$.export("$summary", `Successfully created task with ID ${response.data.new_task.gid}`);
|
|
38
|
+
return response;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "asana-delete-task",
|
|
6
6
|
name: "Delete Task",
|
|
7
7
|
description: "Deletes a specific and existing task. [See the documentation](https://developers.asana.com/docs/delete-a-task)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "asana-find-task-by-id",
|
|
6
6
|
name: "Find Task by ID",
|
|
7
7
|
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)",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "asana-get-tasks-from-task-list",
|
|
5
5
|
name: "Get Tasks From Task List",
|
|
6
6
|
description: "Returns the compact list of tasks in a user’s My Tasks list. [See the documentation](https://developers.asana.com/reference/gettasksforusertasklist)",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
...common.props,
|
|
@@ -3,7 +3,7 @@ import asana from "../../asana.app.mjs";
|
|
|
3
3
|
export default {
|
|
4
4
|
type: "action",
|
|
5
5
|
key: "asana-search-projects",
|
|
6
|
-
version: "0.2.
|
|
6
|
+
version: "0.2.6",
|
|
7
7
|
name: "Search Projects",
|
|
8
8
|
description: "Finds an existing project. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)",
|
|
9
9
|
props: {
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "asana-search-sections",
|
|
5
5
|
name: "Search Sections",
|
|
6
6
|
description: "Searches for a section by name within a particular project. [See the documentation](https://developers.asana.com/docs/get-sections-in-a-project)",
|
|
7
|
-
version: "0.2.
|
|
7
|
+
version: "0.2.6",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "asana-search-tasks",
|
|
6
6
|
name: "Search Tasks",
|
|
7
7
|
description: "Searches for a Task by name within a Project. [See the documentation](https://developers.asana.com/docs/get-multiple-tasks)",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "asana-search-user-projects",
|
|
6
6
|
name: "Get list of user projects",
|
|
7
7
|
description: "Return list of projects given the user and workspace gid. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)",
|
|
8
|
-
version: "0.4.
|
|
8
|
+
version: "0.4.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
asana,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "asana-update-task",
|
|
6
6
|
name: "Update Task",
|
|
7
7
|
description: "Updates a specific and existing task. [See the documentation](https://developers.asana.com/docs/update-a-task)",
|
|
8
|
-
version: "0.3.
|
|
8
|
+
version: "0.3.6",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
package/asana.app.mjs
CHANGED
|
@@ -232,6 +232,38 @@ export default {
|
|
|
232
232
|
return Object.keys(task);
|
|
233
233
|
},
|
|
234
234
|
},
|
|
235
|
+
taskTemplate: {
|
|
236
|
+
type: "string",
|
|
237
|
+
label: "Task Template",
|
|
238
|
+
description: "The identifier of a task template",
|
|
239
|
+
async options({
|
|
240
|
+
project, prevContext,
|
|
241
|
+
}) {
|
|
242
|
+
const params = {
|
|
243
|
+
project,
|
|
244
|
+
limit: DEFAULT_LIMIT,
|
|
245
|
+
};
|
|
246
|
+
if (prevContext?.offset) {
|
|
247
|
+
params.offset = prevContext.offset;
|
|
248
|
+
}
|
|
249
|
+
const {
|
|
250
|
+
data, next_page: next,
|
|
251
|
+
} = await this.listTaskTemplates({
|
|
252
|
+
params,
|
|
253
|
+
});
|
|
254
|
+
return {
|
|
255
|
+
options: data?.map(({
|
|
256
|
+
gid: value, name: label,
|
|
257
|
+
}) => ({
|
|
258
|
+
value,
|
|
259
|
+
label,
|
|
260
|
+
})) || [],
|
|
261
|
+
context: {
|
|
262
|
+
offset: next?.offset,
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
},
|
|
235
267
|
},
|
|
236
268
|
methods: {
|
|
237
269
|
/**
|
|
@@ -561,5 +593,20 @@ export default {
|
|
|
561
593
|
$,
|
|
562
594
|
});
|
|
563
595
|
},
|
|
596
|
+
listTaskTemplates(opts = {}) {
|
|
597
|
+
return this._makeRequest({
|
|
598
|
+
path: "task_templates",
|
|
599
|
+
...opts,
|
|
600
|
+
});
|
|
601
|
+
},
|
|
602
|
+
createTaskFromTemplate({
|
|
603
|
+
taskTemplateId, ...opts
|
|
604
|
+
}) {
|
|
605
|
+
return this._makeRequest({
|
|
606
|
+
method: "POST",
|
|
607
|
+
path: `task_templates/${taskTemplateId}/instantiateTask`,
|
|
608
|
+
...opts,
|
|
609
|
+
});
|
|
610
|
+
},
|
|
564
611
|
},
|
|
565
612
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/asana",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Pipedream Asana Components",
|
|
5
5
|
"main": "asana.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
"homepage": "https://pipedream.com/apps/asana",
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@pipedream/platform": "^1.
|
|
14
|
-
"axios": "^0.21.1",
|
|
13
|
+
"@pipedream/platform": "^1.6.4",
|
|
15
14
|
"lodash": "^4.17.21"
|
|
16
15
|
},
|
|
17
16
|
"gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "asana-new-project",
|
|
7
7
|
name: "New Project Added To Workspace (Instant)",
|
|
8
8
|
description: "Emit new event for each new project added to a workspace.",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.6",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
type: "source",
|
|
8
8
|
name: "New Task (Instant)",
|
|
9
9
|
description: "Emit new event for each task added to a project. [See docs here](https://developers.asana.com/docs/establish-a-webhook)",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.6",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
13
13
|
...common.props,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
type: "source",
|
|
8
8
|
name: "Tags added to any task (Instant)",
|
|
9
9
|
description: "Emit new event each time a tag is added to any task, optionally filtering by a given set of tags.",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.5",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
13
13
|
...common.props,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
type: "source",
|
|
8
8
|
name: "Task Updated In Project (Instant)",
|
|
9
9
|
description: "Emit new event for each update to a task.",
|
|
10
|
-
version: "1.1.
|
|
10
|
+
version: "1.1.5",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
13
13
|
...common.props,
|
|
@@ -43,9 +43,33 @@ export default {
|
|
|
43
43
|
"users",
|
|
44
44
|
],
|
|
45
45
|
},
|
|
46
|
+
delay: {
|
|
47
|
+
type: "integer",
|
|
48
|
+
label: "Delay In Seconds",
|
|
49
|
+
description: "How long to wait before emitting events.",
|
|
50
|
+
default: 15,
|
|
51
|
+
optional: true,
|
|
52
|
+
},
|
|
46
53
|
},
|
|
47
54
|
methods: {
|
|
48
55
|
...common.methods,
|
|
56
|
+
getLastEventDate() {
|
|
57
|
+
return this.db.get("lastEventDate");
|
|
58
|
+
},
|
|
59
|
+
setLastEventDate(value) {
|
|
60
|
+
this.db.set("lastEventDate", value);
|
|
61
|
+
},
|
|
62
|
+
debounce(fn, delay = 15000) {
|
|
63
|
+
const lastEventDate = this.getLastEventDate();
|
|
64
|
+
if (lastEventDate) {
|
|
65
|
+
const diff = Date.now() - new Date(lastEventDate).getTime();
|
|
66
|
+
if (diff < delay) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
fn();
|
|
71
|
+
this.setLastEventDate(new Date());
|
|
72
|
+
},
|
|
49
73
|
getWebhookFilter() {
|
|
50
74
|
return {
|
|
51
75
|
filters: [
|
|
@@ -59,7 +83,7 @@ export default {
|
|
|
59
83
|
},
|
|
60
84
|
async emitEvent(event) {
|
|
61
85
|
const {
|
|
62
|
-
tasks, user,
|
|
86
|
+
tasks, user, delay,
|
|
63
87
|
} = this;
|
|
64
88
|
const { events = [] } = event.body || {};
|
|
65
89
|
|
|
@@ -84,11 +108,11 @@ export default {
|
|
|
84
108
|
event, task,
|
|
85
109
|
}) => {
|
|
86
110
|
const ts = Date.parse(event.created_at);
|
|
87
|
-
this.$emit(task, {
|
|
111
|
+
this.debounce(() => this.$emit(task, {
|
|
88
112
|
id: `${task.gid}-${ts}`,
|
|
89
113
|
summary: task.name,
|
|
90
114
|
ts,
|
|
91
|
-
});
|
|
115
|
+
}), delay * 1000);
|
|
92
116
|
});
|
|
93
117
|
},
|
|
94
118
|
},
|