@pipedream/asana 1.1.1 → 2.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 (43) hide show
  1. package/actions/add-task-to-section/add-task-to-section.mjs +4 -16
  2. package/actions/common/common.mjs +3 -6
  3. package/actions/create-project/create-project.mjs +8 -16
  4. package/actions/create-subtask/create-subtask.mjs +9 -23
  5. package/actions/create-task/create-task.mjs +9 -23
  6. package/actions/create-task-comment/create-task-comment.mjs +5 -7
  7. package/actions/create-task-from-template/create-task-from-template.mjs +4 -6
  8. package/actions/delete-task/delete-task.mjs +4 -6
  9. package/actions/find-task-by-id/find-task-by-id.mjs +5 -7
  10. package/actions/get-portfolio/get-portfolio.mjs +2 -2
  11. package/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs +2 -2
  12. package/actions/list-organizations-options/list-organizations-options.mjs +10 -3
  13. package/actions/list-portfolio-items/list-portfolio-items.mjs +2 -2
  14. package/actions/list-portfolios/list-portfolios.mjs +3 -3
  15. package/actions/list-tags/list-tags.mjs +69 -0
  16. package/actions/list-task-stories/list-task-stories.mjs +28 -17
  17. package/actions/list-task-templates/list-task-templates.mjs +61 -0
  18. package/actions/list-teams/list-teams.mjs +3 -3
  19. package/actions/list-users/list-users.mjs +3 -3
  20. package/actions/list-workspaces/list-workspaces.mjs +2 -2
  21. package/actions/search-projects/search-projects.mjs +82 -35
  22. package/actions/search-sections/search-sections.mjs +9 -6
  23. package/actions/search-tasks/search-tasks.mjs +9 -14
  24. package/actions/search-tasks-premium/search-tasks-premium.mjs +9 -13
  25. package/actions/search-user-projects/search-user-projects.mjs +16 -9
  26. package/actions/update-task/update-task.mjs +6 -13
  27. package/asana.app.mjs +77 -88
  28. package/package.json +1 -1
  29. package/sources/common/common.mjs +1 -1
  30. package/sources/new-completed-task/new-completed-task.mjs +2 -2
  31. package/sources/new-project/new-project.mjs +1 -1
  32. package/sources/new-story/new-story.mjs +2 -2
  33. package/sources/new-subtask/new-subtask.mjs +3 -3
  34. package/sources/new-tag/new-tag.mjs +2 -2
  35. package/sources/new-task/new-task.mjs +2 -2
  36. package/sources/new-team/new-team.mjs +1 -1
  37. package/sources/new-user/new-user.mjs +1 -1
  38. package/sources/new-workspace/new-workspace.mjs +1 -1
  39. package/sources/tag-added-to-task/tag-added-to-task.mjs +3 -3
  40. package/sources/tags-added-to-any-task/tags-added-to-any-task.mjs +3 -3
  41. package/sources/task-assigned-in-project/task-assigned-in-project.mjs +3 -3
  42. package/sources/task-field-updated-in-project/task-field-updated-in-project.mjs +2 -5
  43. package/sources/task-updated-in-project/task-updated-in-project.mjs +4 -4
@@ -4,8 +4,9 @@ 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 documentation](https://developers.asana.com/docs/update-a-task)",
8
- version: "0.4.8",
7
+ description: "Updates one or more fields on an existing Asana task (name, assignee, due date, completion status, notes, custom fields, etc.). All fields are optional — supply only the ones you want to change; unchanged fields retain their current values. Use **Find Task by ID** or **Search Tasks** to obtain the task GID first. Returns the updated task record. Example: call with `task_gid: '1202345678901234'`, `completed: true` → marks the task complete and returns the updated record. [See the documentation](https://developers.asana.com/docs/update-a-task)",
8
+ version: "0.4.9",
9
+ ai: "optimized",
9
10
  annotations: {
10
11
  destructiveHint: false,
11
12
  openWorldHint: true,
@@ -21,40 +22,32 @@ export default {
21
22
  propDefinition: [
22
23
  asana,
23
24
  "tasks",
24
- (c) => ({
25
- project: c.project,
26
- }),
27
25
  ],
28
26
  },
29
27
  name: {
30
28
  label: "Name",
31
29
  description: "Name of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.",
32
30
  type: "string",
31
+ optional: true,
33
32
  },
34
33
  assignee: {
35
34
  label: "Assignee",
36
- description: "Gid of a user.",
35
+ description: "Gid of a user. Use **List Users** to find available user GIDs.",
37
36
  type: "string",
38
37
  optional: true,
39
38
  propDefinition: [
40
39
  asana,
41
40
  "users",
42
- ({ workspace }) => ({
43
- workspace,
44
- }),
45
41
  ],
46
42
  },
47
43
  assignee_section: {
48
44
  label: "Assignee Section",
49
- description: "The assignee section is a subdivision of a project that groups tasks together in the assignee's \"My Tasks\" list.",
45
+ description: "The assignee section is a subdivision of a project that groups tasks together in the assignee's \"My Tasks\" list (a section GID, e.g. `1203456789012345`). Use **Get Tasks From Task List** with `optFields` including `assignee_section` to retrieve the authenticated user's own My Tasks section GIDs. GIDs for another assignee's sections must come from that person's own My Tasks list, not from this account.",
50
46
  type: "string",
51
47
  optional: true,
52
48
  propDefinition: [
53
49
  asana,
54
50
  "sections",
55
- (c) => ({
56
- project: c.project,
57
- }),
58
51
  ],
59
52
  },
60
53
  completed: {
package/asana.app.mjs CHANGED
@@ -1,4 +1,8 @@
1
1
  import { axios } from "@pipedream/platform";
2
+
3
+ // Sources run in Pipedream's workflow builder (not MCP), so they keep
4
+ // auto-populating dropdowns via async `options()`. Their propDefinitions are
5
+ // suffixed `Async` and kept separate from the static, MCP-safe ones actions use.
2
6
  const DEFAULT_LIMIT = 25;
3
7
 
4
8
  export default {
@@ -9,6 +13,8 @@ export default {
9
13
  label: "Organizations",
10
14
  description: "List of organizations. This field uses the organization GID.",
11
15
  type: "string[]",
16
+ // Only used by sources (workflow builder), never by MCP actions, so an
17
+ // auto-populating dropdown is safe here.
12
18
  async options() {
13
19
  const organizations = await this.getOrganizations();
14
20
  return organizations?.map((organization) => ({
@@ -19,7 +25,12 @@ export default {
19
25
  },
20
26
  workspaces: {
21
27
  label: "Workspaces",
22
- description: "List of workspaces. Use the **List Workspaces** action to retrieve available workspace GIDs.",
28
+ description: "List of workspaces. This field uses the workspace GID (e.g. `1200123456789012`). Use the **List Workspaces** action to retrieve available workspace GIDs.",
29
+ type: "string[]",
30
+ },
31
+ workspacesAsync: {
32
+ label: "Workspaces",
33
+ description: "List of workspaces. This field uses the workspace GID (e.g. `1200123456789012`).",
23
34
  type: "string[]",
24
35
  async options({ prevContext }) {
25
36
  const params = {
@@ -49,17 +60,15 @@ export default {
49
60
  label: "Teams",
50
61
  description: "List of teams. Use the **List Teams** action to retrieve available team GIDs.",
51
62
  type: "string[]",
52
- async options({ workspace }) {
53
- const teams = await this.getTeams(workspace);
54
- return teams?.map((team) => ({
55
- label: team.name,
56
- value: team.gid,
57
- })) || [];
58
- },
59
63
  },
60
64
  projects: {
61
65
  label: "Projects",
62
- description: "List of projects. This field uses the project GID.",
66
+ description: "List of projects. This field uses the project GID (e.g. `1204567890123456`). Use **Search Projects** to find available project GIDs (the `gid` field).",
67
+ type: "string[]",
68
+ },
69
+ projectsAsync: {
70
+ label: "Projects",
71
+ description: "List of projects. This field uses the project GID (e.g. `1204567890123456`).",
63
72
  type: "string[]",
64
73
  async options({
65
74
  workspace, prevContext,
@@ -90,7 +99,12 @@ export default {
90
99
  },
91
100
  tags: {
92
101
  label: "Tags",
93
- description: "List of tags. This field uses the tag GID.",
102
+ description: "List of tags. This field uses the tag GID (e.g. `1202345678901234`). Use **List Tags** to find available tag GIDs (the `gid` field).",
103
+ type: "string[]",
104
+ },
105
+ tagsAsync: {
106
+ label: "Tags",
107
+ description: "List of tags. This field uses the tag GID (e.g. `1202345678901234`).",
94
108
  type: "string[]",
95
109
  async options({
96
110
  prevContext, workspace,
@@ -121,7 +135,12 @@ export default {
121
135
  },
122
136
  users: {
123
137
  label: "Users",
124
- description: "List of users. Use the **List Users** action to retrieve available user GIDs.",
138
+ description: "List of users. This field uses the user `gid` (e.g. `1198765432109876`). Use the **List Users** action to retrieve available user GIDs.",
139
+ type: "string[]",
140
+ },
141
+ usersAsync: {
142
+ label: "Users",
143
+ description: "List of users. This field uses the user `gid` (e.g. `1198765432109876`).",
125
144
  type: "string[]",
126
145
  async options({
127
146
  prevContext, workspace,
@@ -152,7 +171,12 @@ export default {
152
171
  },
153
172
  tasks: {
154
173
  label: "Tasks",
155
- description: "List of tasks. This field uses the task GID.",
174
+ description: "List of tasks. This field uses the task GID (e.g. `1202345678901234`). Use **Search Tasks** to find available task GIDs (the `gid` field). Requires a project GID from **Search Projects**.",
175
+ type: "string[]",
176
+ },
177
+ tasksAsync: {
178
+ label: "Tasks",
179
+ description: "List of tasks. This field uses the task GID (e.g. `1202345678901234`).",
156
180
  type: "string[]",
157
181
  async options({
158
182
  project, prevContext,
@@ -188,89 +212,53 @@ export default {
188
212
  },
189
213
  sections: {
190
214
  label: "Sections",
191
- description: "List of sections. This field uses the section GID.",
215
+ description: "List of sections. This field uses the section GID (e.g. `1203456789012345`). Use **Search Sections** to find available section GIDs (the `gid` field). Requires a project GID from **Search Projects**.",
192
216
  type: "string[]",
193
- async options({
194
- project, prevContext,
195
- }) {
196
- if (!project) {
197
- return [];
198
- }
199
- const params = {
200
- limit: DEFAULT_LIMIT,
201
- };
202
- if (prevContext?.offset) {
203
- params.offset = prevContext.offset;
204
- }
205
- const {
206
- data: sections, next_page: next,
207
- } = await this.getSections({
208
- project,
209
- params,
210
- });
211
- const options = sections?.map((section) => ({
212
- label: section.name,
213
- value: section.gid,
214
- })) || [];
215
- return {
216
- options,
217
- context: {
218
- offset: next?.offset,
219
- },
220
- };
221
- },
222
217
  },
223
218
  taskFields: {
224
219
  label: "Task Fields",
225
- description: "List of task fields that will emit events when updated. This field uses the field code.",
220
+ description: "List of task fields that will emit events when updated.",
226
221
  type: "string[]",
227
- async options({ project }) {
228
- const { data: tasks } = await this.getTasks({
229
- params: {
230
- project,
231
- limit: 1,
232
- },
233
- });
234
- if (!tasks || tasks.length === 0) {
235
- return [];
236
- }
237
- const { data: task } = await this.getTask({
238
- taskId: tasks[0].gid,
239
- });
240
- return Object.keys(task);
241
- },
222
+ // Asana task fields that can be reported as changed by a webhook event
223
+ // (developers.asana.com/reference/task). Many of these — custom_fields,
224
+ // tags, followers, dependencies, dependents, parent, memberships — are
225
+ // omitted from a task's default GET response unless explicitly
226
+ // requested via opt_fields, so this is a fixed catalog rather than
227
+ // anything derived from a live task sample.
228
+ options: [
229
+ "approval_status",
230
+ "assignee",
231
+ "assignee_section",
232
+ "assignee_status",
233
+ "actual_time_minutes",
234
+ "completed",
235
+ "completed_at",
236
+ "custom_fields",
237
+ "dependencies",
238
+ "dependents",
239
+ "due_at",
240
+ "due_on",
241
+ "external",
242
+ "followers",
243
+ "html_notes",
244
+ "is_rendered_as_separator",
245
+ "liked",
246
+ "memberships",
247
+ "name",
248
+ "notes",
249
+ "num_subtasks",
250
+ "parent",
251
+ "projects",
252
+ "start_at",
253
+ "start_on",
254
+ "tags",
255
+ "workspace",
256
+ ],
242
257
  },
243
258
  taskTemplate: {
244
259
  type: "string",
245
260
  label: "Task Template",
246
- description: "The identifier of a task template",
247
- async options({
248
- project, prevContext,
249
- }) {
250
- const params = {
251
- project,
252
- limit: DEFAULT_LIMIT,
253
- };
254
- if (prevContext?.offset) {
255
- params.offset = prevContext.offset;
256
- }
257
- const {
258
- data, next_page: next,
259
- } = await this.listTaskTemplates({
260
- params,
261
- });
262
- return {
263
- options: data?.map(({
264
- gid: value, name: label,
265
- }) => ({
266
- value,
267
- label,
268
- })) || [],
269
- context: {
270
- offset: next?.offset,
271
- },
272
- };
273
- },
261
+ description: "The GID of a task template, e.g. `1205678901234567`. Use **List Task Templates** to find available template GIDs (the `gid` field).",
274
262
  },
275
263
  maxResults: {
276
264
  type: "integer",
@@ -390,9 +378,9 @@ export default {
390
378
  *
391
379
  * @returns {string} An Asana Organizations list.
392
380
  */
393
- async getOrganizations() {
381
+ async getOrganizations({ $ } = {}) {
394
382
  const params = {
395
- opt_fields: "is_organization",
383
+ opt_fields: "is_organization,name",
396
384
  };
397
385
  const workspaces = [];
398
386
  do {
@@ -400,6 +388,7 @@ export default {
400
388
  data, next_page: next,
401
389
  } = await this.getWorkspaces({
402
390
  params,
391
+ $,
403
392
  });
404
393
  workspaces.push(...data);
405
394
  params.offset = next?.offset;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/asana",
3
- "version": "1.1.1",
3
+ "version": "2.0.0",
4
4
  "description": "Pipedream Asana Components",
5
5
  "main": "asana.app.mjs",
6
6
  "keywords": [
@@ -14,7 +14,7 @@ export default {
14
14
  type: "string",
15
15
  propDefinition: [
16
16
  asana,
17
- "workspaces",
17
+ "workspacesAsync",
18
18
  ],
19
19
  },
20
20
  },
@@ -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.14",
10
+ version: "0.1.15",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -17,7 +17,7 @@ export default {
17
17
  type: "string",
18
18
  propDefinition: [
19
19
  asana,
20
- "projects",
20
+ "projectsAsync",
21
21
  (c) => ({
22
22
  workspace: c.workspace,
23
23
  }),
@@ -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.14",
9
+ version: "0.1.15",
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.14",
10
+ version: "0.1.15",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -17,7 +17,7 @@ export default {
17
17
  type: "string",
18
18
  propDefinition: [
19
19
  asana,
20
- "projects",
20
+ "projectsAsync",
21
21
  (c) => ({
22
22
  workspace: c.workspace,
23
23
  }),
@@ -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.14",
10
+ version: "1.0.15",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -17,7 +17,7 @@ export default {
17
17
  type: "string",
18
18
  propDefinition: [
19
19
  asana,
20
- "projects",
20
+ "projectsAsync",
21
21
  (c) => ({
22
22
  workspace: c.workspace,
23
23
  }),
@@ -27,7 +27,7 @@ export default {
27
27
  optional: true,
28
28
  propDefinition: [
29
29
  asana,
30
- "tasks",
30
+ "tasksAsync",
31
31
  (c) => ({
32
32
  project: c.project,
33
33
  }),
@@ -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.16",
9
+ version: "0.0.17",
10
10
  dedupe: "unique",
11
11
  props: {
12
12
  asana,
@@ -16,7 +16,7 @@ export default {
16
16
  type: "string",
17
17
  propDefinition: [
18
18
  asana,
19
- "workspaces",
19
+ "workspacesAsync",
20
20
  ],
21
21
  optional: true,
22
22
  },
@@ -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.14",
10
+ version: "0.1.15",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -17,7 +17,7 @@ export default {
17
17
  type: "string",
18
18
  propDefinition: [
19
19
  asana,
20
- "projects",
20
+ "projectsAsync",
21
21
  (c) => ({
22
22
  workspace: c.workspace,
23
23
  }),
@@ -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.15",
9
+ version: "0.1.16",
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.14",
9
+ version: "0.1.15",
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.15",
9
+ version: "0.1.16",
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.14",
10
+ version: "0.1.15",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -17,7 +17,7 @@ export default {
17
17
  type: "string",
18
18
  propDefinition: [
19
19
  asana,
20
- "projects",
20
+ "projectsAsync",
21
21
  (c) => ({
22
22
  workspace: c.workspace,
23
23
  }),
@@ -27,7 +27,7 @@ export default {
27
27
  optional: true,
28
28
  propDefinition: [
29
29
  asana,
30
- "tasks",
30
+ "tasksAsync",
31
31
  (c) => ({
32
32
  project: c.project,
33
33
  }),
@@ -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.13",
10
+ version: "0.0.14",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -17,7 +17,7 @@ export default {
17
17
  type: "string",
18
18
  propDefinition: [
19
19
  asana,
20
- "projects",
20
+ "projectsAsync",
21
21
  (c) => ({
22
22
  workspace: c.workspace,
23
23
  }),
@@ -27,7 +27,7 @@ export default {
27
27
  optional: true,
28
28
  propDefinition: [
29
29
  asana,
30
- "tags",
30
+ "tagsAsync",
31
31
  (c) => ({
32
32
  workspace: c.workspace,
33
33
  }),
@@ -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.7",
10
+ version: "0.1.8",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -17,7 +17,7 @@ export default {
17
17
  type: "string",
18
18
  propDefinition: [
19
19
  asana,
20
- "projects",
20
+ "projectsAsync",
21
21
  (c) => ({
22
22
  workspace: c.workspace,
23
23
  }),
@@ -29,7 +29,7 @@ export default {
29
29
  description: "Only emit events when tasks are assigned to this user GID",
30
30
  propDefinition: [
31
31
  asana,
32
- "users",
32
+ "usersAsync",
33
33
  ({ workspace }) => ({
34
34
  workspace,
35
35
  }),
@@ -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.13",
10
+ version: "0.0.14",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -17,7 +17,7 @@ export default {
17
17
  type: "string",
18
18
  propDefinition: [
19
19
  asana,
20
- "projects",
20
+ "projectsAsync",
21
21
  (c) => ({
22
22
  workspace: c.workspace,
23
23
  }),
@@ -27,9 +27,6 @@ export default {
27
27
  propDefinition: [
28
28
  asana,
29
29
  "taskFields",
30
- (c) => ({
31
- project: c.project,
32
- }),
33
30
  ],
34
31
  },
35
32
  },
@@ -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.13",
10
+ version: "1.1.14",
11
11
  dedupe: "unique",
12
12
  props: {
13
13
  ...common.props,
@@ -17,7 +17,7 @@ export default {
17
17
  type: "string",
18
18
  propDefinition: [
19
19
  asana,
20
- "projects",
20
+ "projectsAsync",
21
21
  (c) => ({
22
22
  workspace: c.workspace,
23
23
  }),
@@ -27,7 +27,7 @@ export default {
27
27
  optional: true,
28
28
  propDefinition: [
29
29
  asana,
30
- "tasks",
30
+ "tasksAsync",
31
31
  (c) => ({
32
32
  project: c.project,
33
33
  }),
@@ -40,7 +40,7 @@ export default {
40
40
  optional: true,
41
41
  propDefinition: [
42
42
  asana,
43
- "users",
43
+ "usersAsync",
44
44
  ({ workspace }) => ({
45
45
  workspace,
46
46
  }),