@pipedream/asana 0.6.0 → 0.6.1

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 -0
  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 +288 -146
  16. package/package.json +3 -2
  17. package/sources/common/common.mjs +5 -3
  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
@@ -3,9 +3,9 @@ import common from "../common/common.mjs";
3
3
 
4
4
  export default {
5
5
  name: "Add Task To Section",
6
- description: "Add a task to a specific, existing section. This will remove the task from other sections of the project. [See the docs here](https://developers.asana.com/docs/add-task-to-section)",
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.3",
8
+ version: "0.2.4",
9
9
  type: "action",
10
10
  props: {
11
11
  ...common.props,
@@ -61,7 +61,8 @@ export default {
61
61
  },
62
62
  },
63
63
  async run({ $ }) {
64
- const response = await this.asana._makeRequest(`sections/${this.section_gid}/addTask`, {
64
+ const response = await this.asana._makeRequest({
65
+ path: `sections/${this.section_gid}/addTask`,
65
66
  method: "post",
66
67
  data: {
67
68
  data: {
@@ -70,7 +71,8 @@ export default {
70
71
  insert_after: this.insert_after,
71
72
  },
72
73
  },
73
- }, $);
74
+ $,
75
+ });
74
76
 
75
77
  $.export("$summary", "Successfully added task to section");
76
78
 
@@ -19,6 +19,9 @@ export default {
19
19
  propDefinition: [
20
20
  asana,
21
21
  "projects",
22
+ (c) => ({
23
+ workspace: c.workspace,
24
+ }),
22
25
  ],
23
26
  optional: true,
24
27
  },
@@ -4,8 +4,8 @@ import constants from "../common/constants.mjs";
4
4
  export default {
5
5
  key: "asana-create-project",
6
6
  name: "Create Project",
7
- description: "Create a new project in a workspace or team. [See the docs here](https://developers.asana.com/docs/create-a-project)",
8
- version: "0.9.3",
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.4",
9
9
  type: "action",
10
10
  props: {
11
11
  asana,
@@ -113,7 +113,8 @@ export default {
113
113
  },
114
114
  },
115
115
  async run({ $ }) {
116
- const response = await this.asana._makeRequest("projects", {
116
+ const response = await this.asana._makeRequest({
117
+ path: "projects",
117
118
  method: "post",
118
119
  data: {
119
120
  data: {
@@ -133,7 +134,8 @@ export default {
133
134
  owner: this.owner,
134
135
  },
135
136
  },
136
- }, $);
137
+ $,
138
+ });
137
139
 
138
140
  $.export("$summary", "Successfully created project");
139
141
 
@@ -4,8 +4,8 @@ import common from "../common/common.mjs";
4
4
  export default {
5
5
  key: "asana-create-subtask",
6
6
  name: "Create Subtask",
7
- description: "Creates a new subtask and adds it to the parent task. [See the docs here](https://developers.asana.com/docs/create-a-subtask)",
8
- version: "0.3.3",
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.4",
9
9
  type: "action",
10
10
  props: {
11
11
  ...common.props,
@@ -104,7 +104,8 @@ export default {
104
104
  },
105
105
  },
106
106
  async run({ $ }) {
107
- const response = await this.asana._makeRequest(`tasks/${this.task_gid}/subtasks`, {
107
+ const response = await this.asana._makeRequest({
108
+ path: `tasks/${this.task_gid}/subtasks`,
108
109
  method: "post",
109
110
  data: {
110
111
  data: {
@@ -123,7 +124,8 @@ export default {
123
124
  workspace: this.workspace,
124
125
  },
125
126
  },
126
- }, $);
127
+ $,
128
+ });
127
129
 
128
130
  $.export("$summary", "Successfully created subtask");
129
131
 
@@ -4,8 +4,8 @@ import common from "../common/common.mjs";
4
4
  export default {
5
5
  key: "asana-create-task",
6
6
  name: "Create Task",
7
- description: "Creates a new task. [See the docs here](https://developers.asana.com/docs/create-a-task)",
8
- version: "0.3.3",
7
+ description: "Creates a new task. [See the documentation](https://developers.asana.com/docs/create-a-task)",
8
+ version: "0.3.4",
9
9
  type: "action",
10
10
  props: {
11
11
  ...common.props,
@@ -117,7 +117,8 @@ export default {
117
117
  let customFields;
118
118
  if (this.custom_fields) customFields = JSON.parse(this.custom_fields);
119
119
 
120
- const response = await this.asana._makeRequest("tasks", {
120
+ const response = await this.asana._makeRequest({
121
+ path: "tasks",
121
122
  method: "post",
122
123
  data: {
123
124
  data: {
@@ -138,7 +139,8 @@ export default {
138
139
  custom_fields: customFields,
139
140
  },
140
141
  },
141
- }, $);
142
+ $,
143
+ });
142
144
 
143
145
  $.export("$summary", "Successfully created task");
144
146
 
@@ -4,8 +4,8 @@ import common from "../common/common.mjs";
4
4
  export default {
5
5
  key: "asana-create-task-comment",
6
6
  name: "Create Task Comment",
7
- description: "Adds a comment to a task. [See the docs here](https://developers.asana.com/docs/create-a-story-on-a-task)",
8
- version: "0.2.3",
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.4",
9
9
  type: "action",
10
10
  props: {
11
11
  ...common.props,
@@ -47,7 +47,8 @@ export default {
47
47
  },
48
48
  },
49
49
  async run({ $ }) {
50
- const response = await this.asana._makeRequest(`tasks/${this.task_gid}/stories`, {
50
+ const response = await this.asana._makeRequest({
51
+ path: `tasks/${this.task_gid}/stories`,
51
52
  method: "post",
52
53
  data: {
53
54
  data: {
@@ -57,7 +58,8 @@ export default {
57
58
  sticker_name: this.sticker_name,
58
59
  },
59
60
  },
60
- }, $);
61
+ $,
62
+ });
61
63
 
62
64
  $.export("$summary", "Successfully created task comment");
63
65
 
@@ -4,8 +4,8 @@ import common from "../common/common.mjs";
4
4
  export default {
5
5
  key: "asana-delete-task",
6
6
  name: "Delete Task",
7
- description: "Deletes a specific and existing task. [See the docs here](https://developers.asana.com/docs/delete-a-task)",
8
- version: "0.0.4",
7
+ description: "Deletes a specific and existing task. [See the documentation](https://developers.asana.com/docs/delete-a-task)",
8
+ version: "0.0.5",
9
9
  type: "action",
10
10
  props: {
11
11
  ...common.props,
@@ -23,9 +23,11 @@ export default {
23
23
  },
24
24
  },
25
25
  async run({ $ }) {
26
- const response = await this.asana._makeRequest(`tasks/${this.task_gid}`, {
26
+ const response = await this.asana._makeRequest({
27
+ path: `tasks/${this.task_gid}`,
27
28
  method: "delete",
28
- }, $);
29
+ $,
30
+ });
29
31
 
30
32
  $.export("$summary", "Successfully deleted task");
31
33
 
@@ -4,8 +4,8 @@ import common from "../common/common.mjs";
4
4
  export default {
5
5
  key: "asana-find-task-by-id",
6
6
  name: "Find Task by ID",
7
- description: "Searches for a task by id. Returns the complete task record for a single task. [See the docs here](https://developers.asana.com/docs/get-a-task)",
8
- version: "0.2.3",
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.4",
9
9
  type: "action",
10
10
  props: {
11
11
  ...common.props,
@@ -23,7 +23,10 @@ export default {
23
23
  },
24
24
  },
25
25
  async run({ $ }) {
26
- const response = await this.asana.getTask(this.task_gid, $);
26
+ const { data: response } = await this.asana.getTask({
27
+ taskId: this.task_gid,
28
+ $,
29
+ });
27
30
 
28
31
  $.export("$summary", "Successfully retrieved task");
29
32
 
@@ -3,18 +3,20 @@ import common from "../common/common.mjs";
3
3
  export default {
4
4
  key: "asana-get-tasks-from-task-list",
5
5
  name: "Get Tasks From Task List",
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.1",
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.2",
8
8
  type: "action",
9
9
  props: {
10
10
  ...common.props,
11
11
  },
12
12
  async run({ $ }) {
13
- const response = await this.asana.getTasksFromUserTaskList({
14
- workspace: this.workspace,
15
- project: this.project,
16
- userId: this.userId,
17
- }, $);
13
+ const { data: response } = await this.asana.getTasksFromUserTaskList({
14
+ params: {
15
+ workspace: this.workspace,
16
+ project: this.project,
17
+ },
18
+ $,
19
+ });
18
20
 
19
21
  $.export("$summary", `Successfully retrieved ${response.length} tasks`);
20
22
 
@@ -3,9 +3,9 @@ import asana from "../../asana.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "asana-search-projects",
6
- version: "0.2.3",
6
+ version: "0.2.4",
7
7
  name: "Search Projects",
8
- description: "Finds an existing project. [See the docs here](https://developers.asana.com/docs/get-multiple-projects)",
8
+ description: "Finds an existing project. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)",
9
9
  props: {
10
10
  asana,
11
11
  name: {
@@ -38,9 +38,13 @@ export default {
38
38
  archived,
39
39
  } = this;
40
40
 
41
- const projects = await this.asana.getProjects(workspace, {
42
- archived,
43
- }, $);
41
+ const { data: projects } = await this.asana.getProjects({
42
+ params: {
43
+ workspace,
44
+ archived,
45
+ },
46
+ $,
47
+ });
44
48
 
45
49
  $.export("$summary", "Successfully retrieved projects");
46
50
 
@@ -3,8 +3,8 @@ import common from "../common/common.mjs";
3
3
  export default {
4
4
  key: "asana-search-sections",
5
5
  name: "Search Sections",
6
- description: "Searches for a section by name within a particular project. [See the docs here](https://developers.asana.com/docs/get-sections-in-a-project)",
7
- version: "0.2.3",
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.4",
8
8
  type: "action",
9
9
  props: {
10
10
  ...common.props,
@@ -15,7 +15,10 @@ export default {
15
15
  },
16
16
  },
17
17
  async run({ $ }) {
18
- const sections = await this.asana.getSections(this.project, $);
18
+ const { data: sections } = await this.asana.getSections({
19
+ project: this.project,
20
+ $,
21
+ });
19
22
 
20
23
  $.export("$summary", "Successfully retrieved sections");
21
24
 
@@ -4,8 +4,8 @@ import common from "../common/common.mjs";
4
4
  export default {
5
5
  key: "asana-search-tasks",
6
6
  name: "Search Tasks",
7
- description: "Searches for a Task by name within a Project. [See the docs here](https://developers.asana.com/docs/get-multiple-tasks)",
8
- version: "0.2.3",
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.4",
9
9
  type: "action",
10
10
  props: {
11
11
  ...common.props,
@@ -52,10 +52,10 @@ export default {
52
52
  },
53
53
  async run({ $ }) {
54
54
  if ((!this.workspace || !this.assignee) && !this.project && !this.section) {
55
- throw new Error("You must specify exactly one of workspace, project, or section");
55
+ throw new Error("You must specify a Project or Section if you do not specify Assignee and Workspace");
56
56
  }
57
57
 
58
- const tasks = await this.asana.getTasks({
58
+ const { data: tasks } = await this.asana.getTasks({
59
59
  params: {
60
60
  assignee: this.assignee,
61
61
  project: this.project,
@@ -64,7 +64,8 @@ export default {
64
64
  completed_since: this.completed_since,
65
65
  modified_since: this.modified_since,
66
66
  },
67
- }, $);
67
+ $,
68
+ });
68
69
 
69
70
  $.export("$summary", "Successfully retrieved tasks");
70
71
 
@@ -4,8 +4,8 @@ import _ from "lodash";
4
4
  export default {
5
5
  key: "asana-search-user-projects",
6
6
  name: "Get list of user projects",
7
- description: "Return list of projects given the user and workspace gid. [See the docs here](https://developers.asana.com/docs/get-multiple-projects)",
8
- version: "0.4.3",
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.4",
9
9
  type: "action",
10
10
  props: {
11
11
  asana,
@@ -30,12 +30,20 @@ export default {
30
30
  },
31
31
  },
32
32
  async run({ $ }) {
33
- let projects = await this.asana.getProjects(this.workspace, {}, $);
33
+ let { data: projects } = await this.asana.getProjects({
34
+ params: {
35
+ workspace: this.workspace,
36
+ },
37
+ $,
38
+ });
34
39
 
35
40
  projects = projects.filter(async (project) => {
36
- project = await this.asana.getProject(project.gid);
41
+ const { data } = await this.asana.getProject({
42
+ projectId: project.gid,
43
+ $,
44
+ });
37
45
 
38
- return project.members && !!_.find(project.members, {
46
+ return data.members && !!_.find(data.members, {
39
47
  gid: this.user,
40
48
  });
41
49
  });
@@ -4,8 +4,8 @@ import common from "../common/common.mjs";
4
4
  export default {
5
5
  key: "asana-update-task",
6
6
  name: "Update Task",
7
- description: "Updates a specific and existing task. [See the docs here](https://developers.asana.com/docs/update-a-task)",
8
- version: "0.3.3",
7
+ description: "Updates a specific and existing task. [See the documentation](https://developers.asana.com/docs/update-a-task)",
8
+ version: "0.3.4",
9
9
  type: "action",
10
10
  props: {
11
11
  ...common.props,
@@ -99,7 +99,8 @@ export default {
99
99
  let customFields;
100
100
  if (this.custom_fields) customFields = JSON.parse(this.custom_fields);
101
101
 
102
- const response = await this.asana._makeRequest(`tasks/${this.task_gid}`, {
102
+ const { data: response } = await this.asana._makeRequest({
103
+ path: `tasks/${this.task_gid}`,
103
104
  method: "put",
104
105
  data: {
105
106
  data: {
@@ -116,10 +117,11 @@ export default {
116
117
  custom_fields: customFields,
117
118
  },
118
119
  },
119
- }, $);
120
+ $,
121
+ });
120
122
 
121
123
  $.export("$summary", "Successfully updated task");
122
124
 
123
- return response.data;
125
+ return response;
124
126
  },
125
127
  };