@pipedream/asana 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/actions/add-task-to-section/add-task-to-section.mjs +6 -4
  2. package/actions/common/common.mjs +3 -2
  3. package/actions/create-project/create-project.mjs +6 -4
  4. package/actions/create-subtask/create-subtask.mjs +6 -4
  5. package/actions/create-task/create-task.mjs +6 -4
  6. package/actions/create-task-comment/create-task-comment.mjs +6 -4
  7. package/actions/delete-task/delete-task.mjs +6 -4
  8. package/actions/find-task-by-id/find-task-by-id.mjs +6 -3
  9. package/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs +9 -7
  10. package/actions/search-projects/search-projects.mjs +9 -5
  11. package/actions/search-sections/search-sections.mjs +6 -3
  12. package/actions/search-tasks/search-tasks.mjs +6 -5
  13. package/actions/search-user-projects/search-user-projects.mjs +13 -5
  14. package/actions/update-task/update-task.mjs +7 -5
  15. package/asana.app.mjs +292 -145
  16. package/package.json +3 -2
  17. package/sources/common/common.mjs +5 -4
  18. package/sources/new-completed-task/new-completed-task.mjs +4 -2
  19. package/sources/new-project/new-project.mjs +4 -2
  20. package/sources/new-story/new-story.mjs +4 -2
  21. package/sources/new-subtask/new-subtask.mjs +4 -2
  22. package/sources/new-tag/new-tag.mjs +6 -4
  23. package/sources/new-task/new-task.mjs +8 -3
  24. package/sources/new-team/new-team.mjs +5 -3
  25. package/sources/new-user/new-user.mjs +7 -3
  26. package/sources/new-workspace/new-workspace.mjs +6 -5
  27. package/sources/tag-added-to-task/tag-added-to-task.mjs +7 -3
  28. package/sources/tags-added-to-any-task/tags-added-to-any-task.mjs +8 -7
  29. package/sources/task-assigned-in-project/task-assigned-in-project.mjs +5 -3
  30. package/sources/task-field-updated-in-project/task-field-updated-in-project.mjs +5 -3
  31. package/sources/task-updated-in-project/task-updated-in-project.mjs +4 -2
@@ -7,7 +7,7 @@ export default {
7
7
  type: "source",
8
8
  name: "New Completed Task (Instant)",
9
9
  description: "Emit new event for each task completed in a project.",
10
- version: "0.1.3",
10
+ version: "0.1.5",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -47,7 +47,9 @@ export default {
47
47
  if (!body || !body.events) return;
48
48
 
49
49
  for (const e of body.events) {
50
- const task = await this.asana.getTask(e.resource.gid);
50
+ const { data: task } = await this.asana.getTask({
51
+ taskId: e.resource.gid,
52
+ });
51
53
 
52
54
  this.$emit(task, {
53
55
  id: task.gid,
@@ -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.3",
9
+ version: "0.1.5",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  ...common.props,
@@ -37,7 +37,9 @@ export default {
37
37
  if (!body || !body.events) return;
38
38
 
39
39
  for (const e of body.events) {
40
- const project = await this.asana.getProject(e.resource.gid);
40
+ const { data: project } = await this.asana.getProject({
41
+ projectId: e.resource.gid,
42
+ });
41
43
 
42
44
  this.$emit(project, {
43
45
  id: project.gid,
@@ -7,7 +7,7 @@ export default {
7
7
  type: "source",
8
8
  name: "New Story Added To Project (Instant)",
9
9
  description: "Emit new event for each story added to a project.",
10
- version: "0.1.3",
10
+ version: "0.1.5",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -44,7 +44,9 @@ export default {
44
44
  if (!body || !body.events) return;
45
45
 
46
46
  for (const e of body.events) {
47
- const story = await this.asana.getStory(e.resource.gid);
47
+ const { data: story } = await this.asana.getStory({
48
+ storyId: e.resource.gid,
49
+ });
48
50
 
49
51
  this.$emit(story, {
50
52
  id: story.gid,
@@ -7,7 +7,7 @@ export default {
7
7
  type: "source",
8
8
  name: "New Subtask (Instant)",
9
9
  description: "Emit new event for each subtask added to a project.",
10
- version: "1.0.3",
10
+ version: "1.0.5",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -60,7 +60,9 @@ export default {
60
60
  })
61
61
  .map(async (event) => ({
62
62
  event,
63
- task: await this.asana.getTask(event.resource.gid),
63
+ task: (await this.asana.getTask({
64
+ taskId: event.resource.gid,
65
+ })).data,
64
66
  }));
65
67
 
66
68
  const responses = await Promise.all(promises);
@@ -6,7 +6,7 @@ export default {
6
6
  type: "source",
7
7
  name: "New Tag",
8
8
  description: "Emit new event for each tag created in a workspace.",
9
- version: "0.0.5",
9
+ version: "0.0.7",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  asana,
@@ -29,10 +29,12 @@ export default {
29
29
  },
30
30
 
31
31
  async run() {
32
- const tags = await this.asana.getTags(this.organization);
32
+ const { data: tags } = await this.asana.getTags();
33
33
 
34
- for (let tag of tags) {
35
- tag = await this.asana.getTag(tag.gid);
34
+ for (const item of tags) {
35
+ const { data: tag } = await this.asana.getTag({
36
+ tagId: item.gid,
37
+ });
36
38
 
37
39
  if (this.workspace && tag.workspace.gid !== this.workspace) continue;
38
40
 
@@ -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.3",
10
+ version: "0.1.5",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -18,6 +18,9 @@ export default {
18
18
  propDefinition: [
19
19
  asana,
20
20
  "projects",
21
+ (c) => ({
22
+ workspace: c.workspace,
23
+ }),
21
24
  ],
22
25
  },
23
26
  },
@@ -40,10 +43,12 @@ export default {
40
43
  if (!body || !body.events) return;
41
44
 
42
45
  for (const e of body.events) {
43
- // This conditional ignore when Asana fire a new subtask event
46
+ // This conditional ignores when Asana fires a new subtask event
44
47
  if (e.parent && e.parent.resource_type === "task") continue;
45
48
 
46
- const task = await this.asana.getTask(e.resource.gid);
49
+ const { data: task } = await this.asana.getTask({
50
+ taskId: e.resource.gid,
51
+ });
47
52
 
48
53
  this.$emit(task, {
49
54
  id: task.gid,
@@ -6,7 +6,7 @@ export default {
6
6
  type: "source",
7
7
  name: "New Team",
8
8
  description: "Emit new event for each task added to an organization.",
9
- version: "0.1.4",
9
+ version: "0.1.6",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  asana,
@@ -30,8 +30,10 @@ export default {
30
30
  async run() {
31
31
  const teams = await this.asana.getTeams(this.organization);
32
32
 
33
- for (let team of teams) {
34
- team = await this.asana.getTeam(team.gid);
33
+ for (const item of teams) {
34
+ const { data: team } = await this.asana.getTeam({
35
+ teamId: item.gid,
36
+ });
35
37
 
36
38
  this.$emit(team, {
37
39
  id: team.gid,
@@ -6,7 +6,7 @@ export default {
6
6
  type: "source",
7
7
  name: "New User (Instant)",
8
8
  description: "Emit new event for each user added to a workspace.",
9
- version: "0.1.3",
9
+ version: "0.1.5",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  ...common.props,
@@ -36,8 +36,12 @@ export default {
36
36
  if (!body || !body.events) return;
37
37
 
38
38
  for (const e of body.events) {
39
- const membership = await this.asana.getWorkspaceMembership(e.resource.gid);
40
- const user = await this.asana.getUser(membership.user.gid);
39
+ const { data: membership } = await this.asana.getWorkspaceMembership({
40
+ membershipId: e.resource.gid,
41
+ });
42
+ const { data: user } = await this.asana.getUser({
43
+ userId: membership.user.gid,
44
+ });
41
45
 
42
46
  this.$emit(user, {
43
47
  id: user.gid,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "asana-new-workspace",
7
7
  name: "New Workspace Added",
8
8
  description: "Emit new event each time you add a new workspace/organization.",
9
- version: "0.1.4",
9
+ version: "0.1.6",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  asana,
@@ -18,12 +18,13 @@ export default {
18
18
  },
19
19
  },
20
20
  },
21
-
22
21
  async run() {
23
- const workspaces = await this.asana.getWorkspaces();
22
+ const { data: workspaces } = await this.asana.getWorkspaces();
24
23
 
25
- for (let workspace of workspaces) {
26
- workspace = await this.asana.getWorkspace(workspace.gid);
24
+ for (const item of workspaces) {
25
+ const { data: workspace } = await this.asana.getWorkspace({
26
+ workspaceId: item.gid,
27
+ });
27
28
 
28
29
  this.$emit(workspace, {
29
30
  id: workspace.gid,
@@ -7,7 +7,7 @@ export default {
7
7
  type: "source",
8
8
  name: "New Tag Added To Task (Instant)",
9
9
  description: "Emit new event for each new tag added to a task.",
10
- version: "0.1.3",
10
+ version: "0.1.5",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -59,8 +59,12 @@ export default {
59
59
  })
60
60
  .map(async (event) => ({
61
61
  event,
62
- task: await this.asana.getTask(event.resource.gid),
63
- tag: await this.asana.getTag(event.parent.gid),
62
+ task: (await this.asana.getTask({
63
+ taskId: event.resource.gid,
64
+ })).data,
65
+ tag: (await this.asana.getTag({
66
+ tagId: event.parent.gid,
67
+ })).data,
64
68
  }));
65
69
 
66
70
  const responses = await Promise.all(promises);
@@ -6,8 +6,8 @@ export default {
6
6
  key: "asana-tags-added-to-any-task",
7
7
  type: "source",
8
8
  name: "Tags added to any task (Instant)",
9
- description: "Emit a new event each time a tag is added to any task, optionally filtering by a given set of tags.",
10
- version: "0.0.2",
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.4",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -28,9 +28,6 @@ export default {
28
28
  propDefinition: [
29
29
  asana,
30
30
  "tags",
31
- (c) => ({
32
- tags: c.tags,
33
- }),
34
31
  ],
35
32
  },
36
33
  },
@@ -59,8 +56,12 @@ export default {
59
56
  })
60
57
  .map(async (event) => ({
61
58
  event,
62
- task: await this.asana.getTask(event.resource.gid),
63
- tag: await this.asana.getTag(event.parent.gid),
59
+ task: (await this.asana.getTask({
60
+ taskId: event.resource.gid,
61
+ })).data,
62
+ tag: (await this.asana.getTag({
63
+ tagId: event.parent.gid,
64
+ })).data,
64
65
  }));
65
66
 
66
67
  const responses = await Promise.all(promises);
@@ -6,8 +6,8 @@ export default {
6
6
  key: "asana-task-assigned-in-project",
7
7
  type: "source",
8
8
  name: "Task Assigned in Project (Instant)",
9
- description: "Emit an event each time a task is assigned, reassigned or unassigned.",
10
- version: "0.0.2",
9
+ description: "Emit new event each time a task is assigned, reassigned or unassigned.",
10
+ version: "0.0.4",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -59,7 +59,9 @@ export default {
59
59
  || (user?.length > 0 && change.new_value.gid === user))
60
60
  .map(async (event) => ({
61
61
  event,
62
- task: await this.asana.getTask(event.resource.gid),
62
+ task: (await this.asana.getTask({
63
+ taskId: event.resource.gid,
64
+ })).data,
63
65
  }));
64
66
 
65
67
  const responses = await Promise.all(promises);
@@ -6,8 +6,8 @@ export default {
6
6
  key: "asana-task-field-updated-in-project",
7
7
  type: "source",
8
8
  name: "Task Field Updated In Project (Instant)",
9
- description: "Emit a new event whenever given task fields are updated.",
10
- version: "0.0.2",
9
+ description: "Emit new event whenever given task fields are updated.",
10
+ version: "0.0.4",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -53,7 +53,9 @@ export default {
53
53
  const promises = events
54
54
  .map(async (event) => ({
55
55
  event,
56
- task: await this.asana.getTask(event.resource.gid),
56
+ task: (await this.asana.getTask({
57
+ taskId: event.resource.gid,
58
+ })).data,
57
59
  }));
58
60
 
59
61
  const responses = await Promise.all(promises);
@@ -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.1",
10
+ version: "1.1.3",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -71,7 +71,9 @@ export default {
71
71
  })
72
72
  .map(async (event) => ({
73
73
  event,
74
- task: await this.asana.getTask(event.resource.gid),
74
+ task: (await this.asana.getTask({
75
+ taskId: event.resource.gid,
76
+ })).data,
75
77
  }));
76
78
 
77
79
  const responses = await Promise.all(promises);