@pipedream/asana 0.6.2 → 0.6.3

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 CHANGED
@@ -1,6 +1,11 @@
1
1
  # Overview
2
2
 
3
- Using the Asana API, you can build software that integrates with Asana to help
4
- your team track their work. For example, you could build a tool to help your
5
- team plan their work for the week, or a reporting tool to help you track
6
- progress on a project.
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/asana",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
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.2.0",
14
- "axios": "^0.21.1",
13
+ "@pipedream/platform": "^1.6.4",
15
14
  "lodash": "^4.17.21"
16
15
  },
17
16
  "gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",
@@ -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.3",
10
+ version: "1.1.4",
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
  },