@pipedream/asana 0.12.0 → 1.0.0

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 (36) hide show
  1. package/actions/add-task-to-section/add-task-to-section.mjs +1 -1
  2. package/actions/create-project/create-project.mjs +1 -1
  3. package/actions/create-subtask/create-subtask.mjs +1 -1
  4. package/actions/create-task/create-task.mjs +1 -1
  5. package/actions/create-task-comment/create-task-comment.mjs +1 -1
  6. package/actions/create-task-from-template/create-task-from-template.mjs +1 -1
  7. package/actions/delete-task/delete-task.mjs +1 -1
  8. package/actions/find-task-by-id/find-task-by-id.mjs +1 -1
  9. package/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs +51 -8
  10. package/actions/list-organizations-options/list-organizations-options.mjs +1 -1
  11. package/actions/list-task-stories/list-task-stories.mjs +5 -3
  12. package/actions/list-teams/list-teams.mjs +12 -3
  13. package/actions/list-users/list-users.mjs +12 -3
  14. package/actions/list-workspaces/list-workspaces.mjs +12 -3
  15. package/actions/search-projects/search-projects.mjs +38 -18
  16. package/actions/search-sections/search-sections.mjs +39 -8
  17. package/actions/search-tasks/search-tasks.mjs +38 -8
  18. package/actions/search-tasks-premium/search-tasks-premium.mjs +12 -3
  19. package/actions/search-user-projects/search-user-projects.mjs +36 -18
  20. package/actions/update-task/update-task.mjs +1 -1
  21. package/asana.app.mjs +24 -11
  22. package/package.json +1 -1
  23. package/sources/new-completed-task/new-completed-task.mjs +1 -1
  24. package/sources/new-project/new-project.mjs +1 -1
  25. package/sources/new-story/new-story.mjs +1 -1
  26. package/sources/new-subtask/new-subtask.mjs +1 -1
  27. package/sources/new-tag/new-tag.mjs +1 -1
  28. package/sources/new-task/new-task.mjs +1 -1
  29. package/sources/new-team/new-team.mjs +1 -1
  30. package/sources/new-user/new-user.mjs +1 -1
  31. package/sources/new-workspace/new-workspace.mjs +1 -1
  32. package/sources/tag-added-to-task/tag-added-to-task.mjs +1 -1
  33. package/sources/tags-added-to-any-task/tags-added-to-any-task.mjs +1 -1
  34. package/sources/task-assigned-in-project/task-assigned-in-project.mjs +1 -1
  35. package/sources/task-field-updated-in-project/task-field-updated-in-project.mjs +1 -1
  36. package/sources/task-updated-in-project/task-updated-in-project.mjs +1 -1
@@ -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.13",
8
+ version: "0.2.14",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -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.10.7",
8
+ version: "0.10.8",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -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.4.6",
8
+ version: "0.4.7",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -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.4.6",
8
+ version: "0.4.7",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -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.13",
8
+ version: "0.2.14",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  name: "Create Task from Template",
5
5
  key: "asana-create-task-from-template",
6
6
  description: "Creates a new task from a task template. [See the documentation](https://developers.asana.com/reference/instantiatetask)",
7
- version: "0.0.8",
7
+ version: "0.0.9",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -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.14",
8
+ version: "0.0.15",
9
9
  annotations: {
10
10
  destructiveHint: true,
11
11
  openWorldHint: true,
@@ -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.13",
8
+ version: "0.2.14",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -1,10 +1,10 @@
1
- import common from "../common/common.mjs";
1
+ import asana from "../../asana.app.mjs";
2
2
 
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.11",
6
+ description: "Returns tasks from the user's personal **My Tasks** inbox — NOT a project task list. Use this when the user asks for 'my tasks', 'my task list', or 'My Tasks'. Only a workspace GID is needed; no project GID required. [See the documentation](https://developers.asana.com/reference/gettasksforusertasklist)",
7
+ version: "1.0.0",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -12,19 +12,62 @@ export default {
12
12
  },
13
13
  type: "action",
14
14
  props: {
15
- ...common.props,
15
+ asana,
16
+ workspace: {
17
+ label: "Workspace",
18
+ description: "The workspace GID to retrieve the user task list from. Use the **List Workspaces** action to find available workspace GIDs.",
19
+ type: "string",
20
+ propDefinition: [
21
+ asana,
22
+ "workspaces",
23
+ ],
24
+ },
25
+ maxResults: {
26
+ propDefinition: [
27
+ asana,
28
+ "maxResults",
29
+ ],
30
+ },
16
31
  },
17
32
  async run({ $ }) {
18
- const { data: response } = await this.asana.getTasksFromUserTaskList({
33
+ const { data: taskList } = await this.asana.getUserTaskList({
34
+ userId: "me",
19
35
  params: {
20
36
  workspace: this.workspace,
21
- project: this.project,
22
37
  },
23
38
  $,
24
39
  });
25
40
 
26
- $.export("$summary", `Successfully retrieved ${response.length} tasks`);
41
+ let hasMore, count = 0;
42
+ const params = {
43
+ limit: 100,
44
+ };
45
+ const results = [];
27
46
 
28
- return response;
47
+ do {
48
+ const {
49
+ data, next_page: next,
50
+ } = await this.asana.getTasksForUserTaskList({
51
+ userTaskListId: taskList.gid,
52
+ params,
53
+ $,
54
+ });
55
+
56
+ hasMore = next;
57
+ params.offset = next?.offset;
58
+
59
+ if (data.length === 0) break;
60
+
61
+ for (const task of data) {
62
+ results.push(task);
63
+ if (++count >= this.maxResults) {
64
+ hasMore = false;
65
+ break;
66
+ }
67
+ }
68
+ } while (hasMore);
69
+
70
+ $.export("$summary", `Successfully retrieved ${results.length} tasks`);
71
+ return results;
29
72
  },
30
73
  };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "asana-list-organizations-options",
5
5
  name: "List Organizations Options",
6
6
  description: "Retrieves available options for the Organizations field.",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
8
  type: "action",
9
9
  annotations: {
10
10
  destructiveHint: false,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "asana-list-task-stories",
5
5
  name: "List Task Stories",
6
6
  description: "List stories (including comments) for a task. [See the documentation](https://developers.asana.com/reference/getstoriesfortask)",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -40,8 +40,10 @@ export default {
40
40
  maxResults: {
41
41
  type: "integer",
42
42
  label: "Max Results",
43
- description: "The maximum number of results to return",
43
+ description: "The maximum total number of results to return across all paginated API calls. Each page fetches up to 100 items (Asana's maximum); this cap is applied after auto-pagination completes.",
44
44
  default: 100,
45
+ min: 1,
46
+ max: 9999,
45
47
  optional: true,
46
48
  },
47
49
  },
@@ -59,7 +61,7 @@ export default {
59
61
  let hasMore, count = 0;
60
62
 
61
63
  const params = {
62
- limit: this.maxResults,
64
+ limit: 100,
63
65
  opt_fields: this.optFields
64
66
  ? this.optFields?.join(",")
65
67
  : undefined,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "asana-list-teams",
5
5
  name: "List Teams",
6
6
  description: "Retrieves all teams in a specified Asana workspace. Use this action to discover available teams for creating projects, adding team members, or organizing work by department. Requires a workspace GID, which you can obtain from the **List Workspaces** action. The authenticated user must have access to the workspace; only teams visible to the user are returned. Results are paginated (default 25, max 100 per page); use the returned offset token to fetch additional pages. To include optional fields like description, visibility, or access levels, specify them in Opt Fields. Consider following up with **Create Project** to create a project under a team, or **List Users** to find team members. [See the documentation](https://developers.asana.com/reference/getteamsforworkspace)",
7
- version: "0.0.1",
7
+ version: "1.0.0",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -74,7 +74,16 @@ export default {
74
74
  offset: this.offset?.trim() || undefined,
75
75
  },
76
76
  });
77
- $.export("$summary", `Successfully fetched ${response.data?.length} teams`);
78
- return response;
77
+ const truncated = !!response.next_page?.offset;
78
+ $.export("$summary", `Successfully fetched ${response.data?.length} teams${
79
+ truncated
80
+ ? " (more pages available)"
81
+ : ""
82
+ }`);
83
+ return {
84
+ data: response.data,
85
+ truncated,
86
+ next_offset: response.next_page?.offset || null,
87
+ };
79
88
  },
80
89
  };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "asana-list-users",
5
5
  name: "List Users",
6
6
  description: "Retrieves all users in a specified Asana workspace. Use this action to populate assignee choices for tasks, verify workspace membership, or audit user access. Requires a workspace GID, which you can obtain from the **List Workspaces** action. The authenticated user must have access to the workspace. Results are paginated; use the returned offset token to fetch additional pages. To include optional fields like email or photo, specify them in Opt Fields. Consider following up with **Create Task** or **Update Task** to assign work to the retrieved users. [See the documentation](https://developers.asana.com/reference/getusersforworkspace)",
7
- version: "0.0.1",
7
+ version: "1.0.0",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -54,7 +54,16 @@ export default {
54
54
  offset: this.offset?.trim() || undefined,
55
55
  },
56
56
  });
57
- $.export("$summary", `Successfully fetched ${response.data?.length} users`);
58
- return response;
57
+ const truncated = !!response.next_page?.offset;
58
+ $.export("$summary", `Successfully fetched ${response.data?.length} users${
59
+ truncated
60
+ ? " (more pages available)"
61
+ : ""
62
+ }`);
63
+ return {
64
+ data: response.data,
65
+ truncated,
66
+ next_offset: response.next_page?.offset || null,
67
+ };
59
68
  },
60
69
  };
@@ -4,7 +4,7 @@ export default {
4
4
  key: "asana-list-workspaces",
5
5
  name: "List Workspaces",
6
6
  description: "List workspaces available to the authenticated Asana account. Use this when you need a workspace GID before running **List Teams** or other workspace-scoped actions. `optFields` can include optional workspace properties such as `email_domains` and `is_organization`; leave `offset` empty for the first page and pass a returned offset token (for example, `3:0:abcdef123456`) to fetch the next page. [See the documentation](https://developers.asana.com/reference/getworkspaces)",
7
- version: "0.0.1",
7
+ version: "1.0.0",
8
8
  type: "action",
9
9
  annotations: {
10
10
  destructiveHint: false,
@@ -52,7 +52,16 @@ export default {
52
52
  offset: this.offset?.trim() || undefined,
53
53
  },
54
54
  });
55
- $.export("$summary", `Successfully fetched ${response.data?.length} workspaces`);
56
- return response;
55
+ const truncated = !!response.next_page?.offset;
56
+ $.export("$summary", `Successfully fetched ${response.data?.length} workspaces${
57
+ truncated
58
+ ? " (more pages available)"
59
+ : ""
60
+ }`);
61
+ return {
62
+ data: response.data,
63
+ truncated,
64
+ next_offset: response.next_page?.offset || null,
65
+ };
57
66
  },
58
67
  };
@@ -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.13",
6
+ version: "0.2.14",
7
7
  annotations: {
8
8
  destructiveHint: false,
9
9
  openWorldHint: true,
@@ -21,9 +21,8 @@ export default {
21
21
  },
22
22
  workspace: {
23
23
  label: "Workspace",
24
- description: "The workspace or organization to filter projects on.",
24
+ description: "The workspace or organization to filter projects on. Use the **List Workspaces** action to find available workspace GIDs.",
25
25
  type: "string",
26
- optional: true,
27
26
  propDefinition: [
28
27
  asana,
29
28
  "workspaces",
@@ -35,25 +34,46 @@ export default {
35
34
  type: "boolean",
36
35
  optional: true,
37
36
  },
37
+ maxResults: {
38
+ propDefinition: [
39
+ asana,
40
+ "maxResults",
41
+ ],
42
+ },
38
43
  },
39
44
  async run({ $ }) {
40
- const {
41
- name,
42
- workspace,
43
- archived,
44
- } = this;
45
+ let hasMore, count = 0;
46
+ const params = {
47
+ workspace: this.workspace,
48
+ archived: this.archived,
49
+ limit: 100,
50
+ };
51
+ const results = [];
45
52
 
46
- const { data: projects } = await this.asana.getProjects({
47
- params: {
48
- workspace,
49
- archived,
50
- },
51
- $,
52
- });
53
+ do {
54
+ const {
55
+ data, next_page: next,
56
+ } = await this.asana.getProjects({
57
+ params,
58
+ $,
59
+ });
53
60
 
54
- $.export("$summary", "Successfully retrieved projects");
61
+ hasMore = next;
62
+ params.offset = next?.offset;
63
+
64
+ if (data.length === 0) break;
55
65
 
56
- if (this.name) return projects.filter((project) => project.name.includes(name));
57
- else return projects;
66
+ for (const project of data) {
67
+ if (this.name && !project.name.includes(this.name)) continue;
68
+ results.push(project);
69
+ if (++count >= this.maxResults) {
70
+ hasMore = false;
71
+ break;
72
+ }
73
+ }
74
+ } while (hasMore);
75
+
76
+ $.export("$summary", "Successfully retrieved projects");
77
+ return results;
58
78
  },
59
79
  };
@@ -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.13",
7
+ version: "0.3.0",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -18,16 +18,47 @@ export default {
18
18
  description: "The name of the section to search for.",
19
19
  type: "string",
20
20
  },
21
+ maxResults: {
22
+ propDefinition: [
23
+ common.props.asana,
24
+ "maxResults",
25
+ ],
26
+ },
21
27
  },
22
28
  async run({ $ }) {
23
- const { data: sections } = await this.asana.getSections({
24
- project: this.project,
25
- $,
26
- });
29
+ let hasMore, count = 0;
30
+ const params = {
31
+ limit: 100,
32
+ };
33
+ const results = [];
34
+
35
+ do {
36
+ const {
37
+ data, next_page: next,
38
+ } = await this.asana.getSections({
39
+ project: this.project,
40
+ params,
41
+ $,
42
+ });
43
+
44
+ hasMore = next;
45
+ params.offset = next?.offset;
46
+
47
+ if (data.length === 0) break;
27
48
 
28
- $.export("$summary", "Successfully retrieved sections");
49
+ for (const section of data) {
50
+ if (this.name && !section.name.includes(this.name)) continue;
51
+ results.push(section);
52
+ if (++count >= this.maxResults) {
53
+ hasMore = false;
54
+ break;
55
+ }
56
+ }
57
+ } while (hasMore);
29
58
 
30
- if (this.name) return sections.filter((section) => section.name.includes(this.name));
31
- else return sections;
59
+ $.export("$summary", `Retrieved ${results.length} section${results.length !== 1
60
+ ? "s"
61
+ : ""}`);
62
+ return results;
32
63
  },
33
64
  };
@@ -6,7 +6,7 @@ export default {
6
6
  key: "asana-search-tasks",
7
7
  name: "Search Tasks",
8
8
  description: "Searches for a Task by name within a Project. [See the documentation](https://developers.asana.com/docs/get-multiple-tasks)",
9
- version: "0.3.7",
9
+ version: "0.4.0",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
@@ -62,6 +62,12 @@ export default {
62
62
  description: "Only return tasks that have been modified since the given time. ISO 8601 date string",
63
63
  optional: true,
64
64
  },
65
+ maxResults: {
66
+ propDefinition: [
67
+ asana,
68
+ "maxResults",
69
+ ],
70
+ },
65
71
  },
66
72
  async run({ $ }) {
67
73
  if (!this.project && !this.section && !this.assignee) {
@@ -72,9 +78,11 @@ export default {
72
78
  throw new ConfigurationError("Must specify only one of Assignee, Project, or Project + Section");
73
79
  }
74
80
 
81
+ let hasMore, count = 0;
75
82
  const params = {
76
83
  completed_since: this.completedSince,
77
84
  modified_since: this.modifiedSince,
85
+ limit: 100,
78
86
  };
79
87
 
80
88
  if (this.assignee) {
@@ -86,14 +94,36 @@ export default {
86
94
  params.project = this.project;
87
95
  }
88
96
 
89
- const { data: tasks } = await this.asana.getTasks({
90
- params,
91
- $,
92
- });
97
+ const results = [];
98
+
99
+ do {
100
+ const {
101
+ data, next_page: next,
102
+ } = await this.asana.getTasks({
103
+ params,
104
+ $,
105
+ });
106
+
107
+ hasMore = next;
108
+ params.offset = next?.offset;
109
+
110
+ if (data.length === 0) break;
93
111
 
94
- $.export("$summary", "Successfully retrieved tasks");
112
+ for (const task of data) {
113
+ if (!task.name.includes(this.name)) continue;
114
+ results.push(task);
115
+ if (++count >= this.maxResults) {
116
+ hasMore = false;
117
+ break;
118
+ }
119
+ }
120
+ } while (hasMore);
95
121
 
96
- if (this.name) return tasks.filter((task) => task.name.includes(this.name));
97
- else return tasks;
122
+ $.export("$summary", `${results.length} task${results.length !== 1
123
+ ? "s"
124
+ : ""} retrieved${results.length >= this.maxResults
125
+ ? " (maxResults reached)"
126
+ : ""}`);
127
+ return results;
98
128
  },
99
129
  };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "asana-search-tasks-premium",
6
6
  name: "Search Tasks Premium",
7
7
  description: "Searches for a task by name, assignee, section, project, completed since, and modified since. Requires a Premium Asana account. [See the documentation](https://developers.asana.com/reference/searchtasksforworkspace)",
8
- version: "0.0.2",
8
+ version: "0.0.3",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
@@ -68,6 +68,12 @@ export default {
68
68
  description: "Only return tasks modified since this time. ISO 8601 format (for example: `2026-04-14` or `2026-04-14T00:00:00Z`).",
69
69
  optional: true,
70
70
  },
71
+ maxResults: {
72
+ propDefinition: [
73
+ asana,
74
+ "maxResults",
75
+ ],
76
+ },
71
77
  },
72
78
  async run({ $ }) {
73
79
  const params = {
@@ -77,6 +83,7 @@ export default {
77
83
  "sections.any": this.section,
78
84
  "projects.any": this.project,
79
85
  "text": this.name,
86
+ "limit": 100,
80
87
  };
81
88
 
82
89
  const { data: tasks } = await this.asana.searchTasks({
@@ -85,8 +92,10 @@ export default {
85
92
  $,
86
93
  });
87
94
 
95
+ const limited = this.maxResults
96
+ ? tasks.slice(0, this.maxResults)
97
+ : tasks;
88
98
  $.export("$summary", "Successfully retrieved tasks");
89
-
90
- return tasks;
99
+ return limited;
91
100
  },
92
101
  };
@@ -1,11 +1,10 @@
1
- import _ from "lodash";
2
1
  import asana from "../../asana.app.mjs";
3
2
 
4
3
  export default {
5
4
  key: "asana-search-user-projects",
6
5
  name: "Get list of user projects",
7
6
  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.5.6",
7
+ version: "0.5.7",
9
8
  annotations: {
10
9
  destructiveHint: false,
11
10
  openWorldHint: true,
@@ -16,7 +15,7 @@ export default {
16
15
  asana,
17
16
  workspace: {
18
17
  label: "Workspace",
19
- description: "Gid of a workspace.",
18
+ description: "The workspace GID. Use the **List Workspaces** action to find available workspace GIDs.",
20
19
  type: "string",
21
20
  propDefinition: [
22
21
  asana,
@@ -35,28 +34,47 @@ export default {
35
34
  }),
36
35
  ],
37
36
  },
37
+ maxResults: {
38
+ propDefinition: [
39
+ asana,
40
+ "maxResults",
41
+ ],
42
+ },
38
43
  },
39
44
  async run({ $ }) {
40
- let { data: projects } = await this.asana.getProjects({
41
- params: {
42
- workspace: this.workspace,
43
- },
44
- $,
45
- });
45
+ let hasMore, count = 0;
46
+ const params = {
47
+ workspace: this.workspace,
48
+ limit: 100,
49
+ opt_fields: "gid,name,resource_type,members",
50
+ };
51
+ const allProjects = [];
46
52
 
47
- projects = projects.filter(async (project) => {
48
- const { data } = await this.asana.getProject({
49
- projectId: project.gid,
53
+ do {
54
+ const {
55
+ data, next_page: next,
56
+ } = await this.asana.getProjects({
57
+ params,
50
58
  $,
51
59
  });
52
60
 
53
- return data.members && !!_.find(data.members, {
54
- gid: this.user,
55
- });
56
- });
61
+ hasMore = next;
62
+ params.offset = next?.offset;
57
63
 
58
- $.export("$summary", "Successfully retrieved projects of user");
64
+ if (data.length === 0) break;
59
65
 
60
- return projects;
66
+ for (const project of data) {
67
+ const isMember = project.members && project.members.some((m) => m.gid === this.user);
68
+ if (!isMember) continue;
69
+ allProjects.push(project);
70
+ if (++count >= this.maxResults) {
71
+ hasMore = false;
72
+ break;
73
+ }
74
+ }
75
+ } while (hasMore);
76
+
77
+ $.export("$summary", "Successfully retrieved projects of user");
78
+ return allProjects;
61
79
  },
62
80
  };
@@ -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.4.6",
8
+ version: "0.4.7",
9
9
  annotations: {
10
10
  destructiveHint: false,
11
11
  openWorldHint: true,
package/asana.app.mjs CHANGED
@@ -19,7 +19,7 @@ export default {
19
19
  },
20
20
  workspaces: {
21
21
  label: "Workspaces",
22
- description: "List of workspaces. This field uses the workspace GID.",
22
+ description: "List of workspaces. Use the **List Workspaces** action to retrieve available workspace GIDs.",
23
23
  type: "string[]",
24
24
  async options({ prevContext }) {
25
25
  const params = {
@@ -47,7 +47,7 @@ export default {
47
47
  },
48
48
  teams: {
49
49
  label: "Teams",
50
- description: "List of teams. This field uses the team GID.",
50
+ description: "List of teams. Use the **List Teams** action to retrieve available team GIDs.",
51
51
  type: "string[]",
52
52
  async options({ workspace }) {
53
53
  const teams = await this.getTeams(workspace);
@@ -121,7 +121,7 @@ export default {
121
121
  },
122
122
  users: {
123
123
  label: "Users",
124
- description: "List of users. This field uses the user GID.",
124
+ description: "List of users. Use the **List Users** action to retrieve available user GIDs.",
125
125
  type: "string[]",
126
126
  async options({
127
127
  prevContext, workspace,
@@ -272,6 +272,15 @@ export default {
272
272
  };
273
273
  },
274
274
  },
275
+ maxResults: {
276
+ type: "integer",
277
+ label: "Max Results",
278
+ description: "The maximum total number of results to return across all paginated API calls. Each page fetches up to 100 items (Asana's maximum); this cap is applied after auto-pagination completes.",
279
+ default: 100,
280
+ min: 1,
281
+ max: 9999,
282
+ optional: true,
283
+ },
275
284
  },
276
285
  methods: {
277
286
  /**
@@ -371,7 +380,9 @@ export default {
371
380
  * @returns {string} An Asana Organizations list.
372
381
  */
373
382
  async getOrganizations() {
374
- const params = {};
383
+ const params = {
384
+ opt_fields: "is_organization",
385
+ };
375
386
  const workspaces = [];
376
387
  do {
377
388
  const {
@@ -383,13 +394,7 @@ export default {
383
394
  params.offset = next?.offset;
384
395
  } while (params.offset);
385
396
 
386
- const organizations = workspaces.filter(async (workspace) => {
387
- const { data } = await this.getWorkspace({
388
- workspaceId: workspace.gid,
389
- });
390
- return data?.is_organization;
391
- });
392
- return organizations;
397
+ return workspaces.filter((workspace) => workspace.is_organization);
393
398
  },
394
399
  /**
395
400
  * Get an Asana Project.
@@ -635,6 +640,14 @@ export default {
635
640
  $,
636
641
  });
637
642
  },
643
+ getTasksForUserTaskList({
644
+ userTaskListId, ...opts
645
+ }) {
646
+ return this._makeRequest({
647
+ path: `user_task_lists/${userTaskListId}/tasks`,
648
+ ...opts,
649
+ });
650
+ },
638
651
  listTaskTemplates(opts = {}) {
639
652
  return this._makeRequest({
640
653
  path: "task_templates",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/asana",
3
- "version": "0.12.0",
3
+ "version": "1.0.0",
4
4
  "description": "Pipedream Asana Components",
5
5
  "main": "asana.app.mjs",
6
6
  "keywords": [
@@ -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.12",
10
+ version: "0.1.13",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -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.12",
9
+ version: "0.1.13",
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 Story Added To Project (Instant)",
9
9
  description: "Emit new event for each story added to a project.",
10
- version: "0.1.12",
10
+ version: "0.1.13",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -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.12",
10
+ version: "1.0.13",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -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.14",
9
+ version: "0.0.15",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  asana,
@@ -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.12",
10
+ version: "0.1.13",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -6,7 +6,7 @@ export default {
6
6
  type: "source",
7
7
  name: "New Team",
8
8
  description: "Emit new event for each team added to an organization.",
9
- version: "0.1.13",
9
+ version: "0.1.14",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  asana,
@@ -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.12",
9
+ version: "0.1.13",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  ...common.props,
@@ -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.13",
9
+ version: "0.1.14",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  asana,
@@ -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.12",
10
+ version: "0.1.13",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -7,7 +7,7 @@ export default {
7
7
  type: "source",
8
8
  name: "New 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.11",
10
+ version: "0.0.12",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -7,7 +7,7 @@ export default {
7
7
  type: "source",
8
8
  name: "New Task Assigned in Project (Instant)",
9
9
  description: "Emit new event each time a task is assigned, reassigned or unassigned.",
10
- version: "0.1.5",
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: "New Task Field Updated In Project (Instant)",
9
9
  description: "Emit new event whenever given task fields are updated.",
10
- version: "0.0.11",
10
+ version: "0.0.12",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -7,7 +7,7 @@ export default {
7
7
  type: "source",
8
8
  name: "New Task Updated In Project (Instant)",
9
9
  description: "Emit new event for each update to a task.",
10
- version: "1.1.11",
10
+ version: "1.1.12",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,