@pipedream/asana 1.0.0 → 1.1.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.
- package/actions/add-task-to-section/add-task-to-section.mjs +1 -1
- package/actions/common/constants.mjs +10 -0
- package/actions/create-project/create-project.mjs +1 -1
- package/actions/create-subtask/create-subtask.mjs +1 -1
- package/actions/create-task/create-task.mjs +1 -1
- package/actions/create-task-comment/create-task-comment.mjs +1 -1
- package/actions/create-task-from-template/create-task-from-template.mjs +1 -1
- package/actions/delete-task/delete-task.mjs +1 -1
- package/actions/find-task-by-id/find-task-by-id.mjs +14 -1
- package/actions/get-portfolio/get-portfolio.mjs +46 -0
- package/actions/get-tasks-from-task-list/get-tasks-from-task-list.mjs +12 -1
- package/actions/list-organizations-options/list-organizations-options.mjs +1 -1
- package/actions/list-portfolio-items/list-portfolio-items.mjs +94 -0
- package/actions/list-portfolios/list-portfolios.mjs +83 -0
- package/actions/list-task-stories/list-task-stories.mjs +1 -1
- package/actions/list-teams/list-teams.mjs +1 -1
- package/actions/list-users/list-users.mjs +1 -1
- package/actions/list-workspaces/list-workspaces.mjs +1 -1
- package/actions/search-projects/search-projects.mjs +22 -1
- package/actions/search-sections/search-sections.mjs +1 -1
- package/actions/search-tasks/search-tasks.mjs +22 -1
- package/actions/search-tasks-premium/search-tasks-premium.mjs +1 -1
- package/actions/search-user-projects/search-user-projects.mjs +26 -2
- package/actions/update-task/update-task.mjs +1 -1
- package/asana.app.mjs +52 -0
- package/package.json +1 -1
- package/sources/new-completed-task/new-completed-task.mjs +1 -1
- package/sources/new-project/new-project.mjs +1 -1
- package/sources/new-story/new-story.mjs +1 -1
- package/sources/new-subtask/new-subtask.mjs +1 -1
- package/sources/new-tag/new-tag.mjs +1 -1
- package/sources/new-task/new-task.mjs +1 -1
- package/sources/new-team/new-team.mjs +1 -1
- package/sources/new-user/new-user.mjs +1 -1
- package/sources/new-workspace/new-workspace.mjs +1 -1
- package/sources/tag-added-to-task/tag-added-to-task.mjs +1 -1
- package/sources/tags-added-to-any-task/tags-added-to-any-task.mjs +1 -1
- package/sources/task-assigned-in-project/task-assigned-in-project.mjs +1 -1
- package/sources/task-field-updated-in-project/task-field-updated-in-project.mjs +1 -1
- 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.
|
|
8
|
+
version: "0.2.15",
|
|
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.
|
|
8
|
+
version: "0.10.9",
|
|
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.
|
|
8
|
+
version: "0.4.8",
|
|
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.
|
|
8
|
+
version: "0.4.8",
|
|
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.
|
|
8
|
+
version: "0.2.15",
|
|
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.
|
|
7
|
+
version: "0.0.10",
|
|
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.
|
|
8
|
+
version: "0.0.16",
|
|
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.
|
|
8
|
+
version: "0.3.0",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -26,10 +26,23 @@ export default {
|
|
|
26
26
|
}),
|
|
27
27
|
],
|
|
28
28
|
},
|
|
29
|
+
optFields: {
|
|
30
|
+
propDefinition: [
|
|
31
|
+
asana,
|
|
32
|
+
"optFields",
|
|
33
|
+
],
|
|
34
|
+
description: "Optional task properties to include in the response (e.g. `created_at`, `due_on`, `custom_fields`). Nested paths are allowed; `gid` is always returned. [See the documentation](https://developers.asana.com/docs/get-a-task)",
|
|
35
|
+
optional: true,
|
|
36
|
+
},
|
|
29
37
|
},
|
|
30
38
|
async run({ $ }) {
|
|
31
39
|
const { data: response } = await this.asana.getTask({
|
|
32
40
|
taskId: this.task_gid,
|
|
41
|
+
params: {
|
|
42
|
+
opt_fields: this.optFields?.length
|
|
43
|
+
? this.optFields.join(",")
|
|
44
|
+
: undefined,
|
|
45
|
+
},
|
|
33
46
|
$,
|
|
34
47
|
});
|
|
35
48
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import asana from "../../asana.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "asana-get-portfolio",
|
|
5
|
+
name: "Get Portfolio",
|
|
6
|
+
description: "Returns the complete portfolio record for a single portfolio. Use this after **List Portfolios** to retrieve full portfolio details including custom fields, members, and owner; the `optFields` prop requests specific properties (e.g. `custom_field_settings`, `members`, `start_on`, `due_on`). [See the documentation](https://developers.asana.com/reference/getportfolio)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
asana,
|
|
16
|
+
portfolioId: {
|
|
17
|
+
propDefinition: [
|
|
18
|
+
asana,
|
|
19
|
+
"portfolioId",
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
optFields: {
|
|
23
|
+
propDefinition: [
|
|
24
|
+
asana,
|
|
25
|
+
"optFields",
|
|
26
|
+
],
|
|
27
|
+
description: "Optional portfolio properties to include in the response (e.g. `custom_field_settings`, `custom_fields`, `members`, `owner`, `start_on`, `due_on`, `created_at`). Nested paths are allowed; `gid` is always returned. [See the documentation](https://developers.asana.com/reference/getportfolio)",
|
|
28
|
+
optional: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
async run({ $ }) {
|
|
32
|
+
const { data: portfolio } = await this.asana.getPortfolio({
|
|
33
|
+
portfolioId: this.portfolioId,
|
|
34
|
+
params: {
|
|
35
|
+
opt_fields: this.optFields?.length
|
|
36
|
+
? this.optFields.join(",")
|
|
37
|
+
: undefined,
|
|
38
|
+
},
|
|
39
|
+
$,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
$.export("$summary", `Successfully retrieved portfolio ${portfolio.name || this.portfolioId}`);
|
|
43
|
+
|
|
44
|
+
return portfolio;
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "asana-get-tasks-from-task-list",
|
|
5
5
|
name: "Get Tasks From Task List",
|
|
6
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.
|
|
7
|
+
version: "1.1.0",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -22,6 +22,14 @@ export default {
|
|
|
22
22
|
"workspaces",
|
|
23
23
|
],
|
|
24
24
|
},
|
|
25
|
+
optFields: {
|
|
26
|
+
propDefinition: [
|
|
27
|
+
asana,
|
|
28
|
+
"optFields",
|
|
29
|
+
],
|
|
30
|
+
description: "Optional task properties to include in the response (e.g. `created_at`, `due_on`, `custom_fields`). Nested paths are allowed; `gid` is always returned. [See the documentation](https://developers.asana.com/reference/gettasksforusertasklist)",
|
|
31
|
+
optional: true,
|
|
32
|
+
},
|
|
25
33
|
maxResults: {
|
|
26
34
|
propDefinition: [
|
|
27
35
|
asana,
|
|
@@ -40,6 +48,9 @@ export default {
|
|
|
40
48
|
|
|
41
49
|
let hasMore, count = 0;
|
|
42
50
|
const params = {
|
|
51
|
+
opt_fields: this.optFields?.length
|
|
52
|
+
? this.optFields.join(",")
|
|
53
|
+
: undefined,
|
|
43
54
|
limit: 100,
|
|
44
55
|
};
|
|
45
56
|
const results = [];
|
|
@@ -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.
|
|
7
|
+
version: "0.0.3",
|
|
8
8
|
type: "action",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import asana from "../../asana.app.mjs";
|
|
2
|
+
import constants from "../common/constants.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
key: "asana-list-portfolio-items",
|
|
6
|
+
name: "List Portfolio Items",
|
|
7
|
+
description: "Returns a list of the items (projects) in the given portfolio. Use this after **List Portfolios** to answer count, timing, and spend questions; the default Opt Fields include `created_at`, `start_on`, `due_on`, and `custom_fields`. Archived filtering happens client-side because Asana has no server-side filter on this endpoint. [See the documentation](https://developers.asana.com/reference/getitemsforportfolio)",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: false,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
readOnlyHint: true,
|
|
13
|
+
},
|
|
14
|
+
type: "action",
|
|
15
|
+
props: {
|
|
16
|
+
asana,
|
|
17
|
+
portfolioId: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
asana,
|
|
20
|
+
"portfolioId",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
optFields: {
|
|
24
|
+
propDefinition: [
|
|
25
|
+
asana,
|
|
26
|
+
"optFields",
|
|
27
|
+
],
|
|
28
|
+
description: "Optional item properties to include in the response (defaults to `name`, `archived`, `created_at`, `start_on`, `due_on`, `owner`, `resource_type`, `custom_fields`). Nested paths are allowed; `gid` is always returned. [See the documentation](https://developers.asana.com/reference/getitemsforportfolio)",
|
|
29
|
+
optional: true,
|
|
30
|
+
default: constants.DEFAULT_PORTFOLIO_ITEM_OPT_FIELDS,
|
|
31
|
+
},
|
|
32
|
+
excludeArchived: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
label: "Exclude Archived",
|
|
35
|
+
description: "Filter out archived projects from the results. The filter is applied client-side because Asana has no server-side archived filter on this endpoint.",
|
|
36
|
+
optional: true,
|
|
37
|
+
default: false,
|
|
38
|
+
},
|
|
39
|
+
maxResults: {
|
|
40
|
+
propDefinition: [
|
|
41
|
+
asana,
|
|
42
|
+
"maxResults",
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
async run({ $ }) {
|
|
47
|
+
const optFields = [
|
|
48
|
+
...(this.optFields ?? []),
|
|
49
|
+
];
|
|
50
|
+
if (this.excludeArchived && !optFields.includes("archived")) {
|
|
51
|
+
optFields.push("archived");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let hasMore, count = 0;
|
|
55
|
+
const params = {
|
|
56
|
+
opt_fields: optFields.length
|
|
57
|
+
? optFields.join(",")
|
|
58
|
+
: undefined,
|
|
59
|
+
limit: 100,
|
|
60
|
+
};
|
|
61
|
+
const results = [];
|
|
62
|
+
|
|
63
|
+
do {
|
|
64
|
+
const {
|
|
65
|
+
data, next_page: next,
|
|
66
|
+
} = await this.asana.getPortfolioItems({
|
|
67
|
+
portfolioId: this.portfolioId,
|
|
68
|
+
params,
|
|
69
|
+
$,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
hasMore = next;
|
|
73
|
+
params.offset = next?.offset;
|
|
74
|
+
|
|
75
|
+
if (data.length === 0) break;
|
|
76
|
+
|
|
77
|
+
for (const item of data) {
|
|
78
|
+
if (this.excludeArchived && item.archived) continue;
|
|
79
|
+
results.push(item);
|
|
80
|
+
if (++count >= this.maxResults) {
|
|
81
|
+
hasMore = false;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} while (hasMore);
|
|
86
|
+
|
|
87
|
+
$.export("$summary", `${results.length} item${results.length !== 1
|
|
88
|
+
? "s"
|
|
89
|
+
: ""} retrieved${results.length >= this.maxResults
|
|
90
|
+
? " (maxResults reached)"
|
|
91
|
+
: ""}`);
|
|
92
|
+
return results;
|
|
93
|
+
},
|
|
94
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import asana from "../../asana.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "asana-list-portfolios",
|
|
5
|
+
name: "List Portfolios",
|
|
6
|
+
description: "Returns a list of portfolios in the given workspace owned by the given user. Use this to discover portfolio GIDs before calling **Get Portfolio** or **List Portfolio Items**. Owner defaults to the authenticated user; regular API users can only list portfolios they own. [See the documentation](https://developers.asana.com/reference/getportfolios)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
openWorldHint: true,
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
},
|
|
13
|
+
type: "action",
|
|
14
|
+
props: {
|
|
15
|
+
asana,
|
|
16
|
+
workspace: {
|
|
17
|
+
type: "string",
|
|
18
|
+
label: "Workspace",
|
|
19
|
+
description: "The workspace or organization GID to filter portfolios on. Use the **List Workspaces** action to find available workspace GIDs.",
|
|
20
|
+
},
|
|
21
|
+
owner: {
|
|
22
|
+
type: "string",
|
|
23
|
+
label: "Owner",
|
|
24
|
+
description: "The GID of the user who owns the portfolios. Defaults to the authenticated user (`me`). Use the **List Users** action to find user GIDs. Regular API users can only list portfolios they own; service accounts may specify any user.",
|
|
25
|
+
optional: true,
|
|
26
|
+
},
|
|
27
|
+
optFields: {
|
|
28
|
+
propDefinition: [
|
|
29
|
+
asana,
|
|
30
|
+
"optFields",
|
|
31
|
+
],
|
|
32
|
+
description: "Optional portfolio properties to include in the response (e.g. `created_at`, `due_on`, `members`). Nested paths are allowed; `gid` is always returned. [See the documentation](https://developers.asana.com/reference/getportfolios)",
|
|
33
|
+
optional: true,
|
|
34
|
+
},
|
|
35
|
+
maxResults: {
|
|
36
|
+
propDefinition: [
|
|
37
|
+
asana,
|
|
38
|
+
"maxResults",
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
async run({ $ }) {
|
|
43
|
+
let hasMore, count = 0;
|
|
44
|
+
const params = {
|
|
45
|
+
workspace: this.workspace,
|
|
46
|
+
owner: this.owner || "me",
|
|
47
|
+
opt_fields: this.optFields?.length
|
|
48
|
+
? this.optFields.join(",")
|
|
49
|
+
: undefined,
|
|
50
|
+
limit: 100,
|
|
51
|
+
};
|
|
52
|
+
const results = [];
|
|
53
|
+
|
|
54
|
+
do {
|
|
55
|
+
const {
|
|
56
|
+
data, next_page: next,
|
|
57
|
+
} = await this.asana.getPortfolios({
|
|
58
|
+
params,
|
|
59
|
+
$,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
hasMore = next;
|
|
63
|
+
params.offset = next?.offset;
|
|
64
|
+
|
|
65
|
+
if (data.length === 0) break;
|
|
66
|
+
|
|
67
|
+
for (const portfolio of data) {
|
|
68
|
+
results.push(portfolio);
|
|
69
|
+
if (++count >= this.maxResults) {
|
|
70
|
+
hasMore = false;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
} while (hasMore);
|
|
75
|
+
|
|
76
|
+
$.export("$summary", `${results.length} portfolio${results.length !== 1
|
|
77
|
+
? "s"
|
|
78
|
+
: ""} retrieved${results.length >= this.maxResults
|
|
79
|
+
? " (maxResults reached)"
|
|
80
|
+
: ""}`);
|
|
81
|
+
return results;
|
|
82
|
+
},
|
|
83
|
+
};
|
|
@@ -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.
|
|
7
|
+
version: "0.0.6",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -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: "1.0.
|
|
7
|
+
version: "1.0.1",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -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: "1.0.
|
|
7
|
+
version: "1.0.1",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -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: "1.0.
|
|
7
|
+
version: "1.0.1",
|
|
8
8
|
type: "action",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
@@ -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.
|
|
6
|
+
version: "0.3.0",
|
|
7
7
|
annotations: {
|
|
8
8
|
destructiveHint: false,
|
|
9
9
|
openWorldHint: true,
|
|
@@ -34,6 +34,14 @@ export default {
|
|
|
34
34
|
type: "boolean",
|
|
35
35
|
optional: true,
|
|
36
36
|
},
|
|
37
|
+
optFields: {
|
|
38
|
+
propDefinition: [
|
|
39
|
+
asana,
|
|
40
|
+
"optFields",
|
|
41
|
+
],
|
|
42
|
+
description: "Optional project properties to include in the response (e.g. `created_at`, `start_on`, `due_on`, `archived`, `custom_fields`). Nested paths are allowed; `gid` is always returned. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)",
|
|
43
|
+
optional: true,
|
|
44
|
+
},
|
|
37
45
|
maxResults: {
|
|
38
46
|
propDefinition: [
|
|
39
47
|
asana,
|
|
@@ -42,10 +50,23 @@ export default {
|
|
|
42
50
|
},
|
|
43
51
|
},
|
|
44
52
|
async run({ $ }) {
|
|
53
|
+
const optFields = Array.isArray(this.optFields)
|
|
54
|
+
? [
|
|
55
|
+
...this.optFields,
|
|
56
|
+
]
|
|
57
|
+
: [];
|
|
58
|
+
if (this.name && optFields.length && !optFields.includes("name")) {
|
|
59
|
+
// the name filter below needs project.name present in the response
|
|
60
|
+
optFields.push("name");
|
|
61
|
+
}
|
|
62
|
+
|
|
45
63
|
let hasMore, count = 0;
|
|
46
64
|
const params = {
|
|
47
65
|
workspace: this.workspace,
|
|
48
66
|
archived: this.archived,
|
|
67
|
+
opt_fields: optFields.length
|
|
68
|
+
? optFields.join(",")
|
|
69
|
+
: undefined,
|
|
49
70
|
limit: 100,
|
|
50
71
|
};
|
|
51
72
|
const results = [];
|
|
@@ -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.3.
|
|
7
|
+
version: "0.3.1",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -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.
|
|
9
|
+
version: "0.5.0",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -62,6 +62,14 @@ 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
|
+
optFields: {
|
|
66
|
+
propDefinition: [
|
|
67
|
+
asana,
|
|
68
|
+
"optFields",
|
|
69
|
+
],
|
|
70
|
+
description: "Optional task properties to include in the response (e.g. `created_at`, `due_on`, `custom_fields`). Nested paths are allowed; `gid` is always returned. [See the documentation](https://developers.asana.com/docs/get-multiple-tasks)",
|
|
71
|
+
optional: true,
|
|
72
|
+
},
|
|
65
73
|
maxResults: {
|
|
66
74
|
propDefinition: [
|
|
67
75
|
asana,
|
|
@@ -78,10 +86,23 @@ export default {
|
|
|
78
86
|
throw new ConfigurationError("Must specify only one of Assignee, Project, or Project + Section");
|
|
79
87
|
}
|
|
80
88
|
|
|
89
|
+
const optFields = Array.isArray(this.optFields)
|
|
90
|
+
? [
|
|
91
|
+
...this.optFields,
|
|
92
|
+
]
|
|
93
|
+
: [];
|
|
94
|
+
if (optFields.length && !optFields.includes("name")) {
|
|
95
|
+
// the name filter below needs task.name present in the response
|
|
96
|
+
optFields.push("name");
|
|
97
|
+
}
|
|
98
|
+
|
|
81
99
|
let hasMore, count = 0;
|
|
82
100
|
const params = {
|
|
83
101
|
completed_since: this.completedSince,
|
|
84
102
|
modified_since: this.modifiedSince,
|
|
103
|
+
opt_fields: optFields.length
|
|
104
|
+
? optFields.join(",")
|
|
105
|
+
: undefined,
|
|
85
106
|
limit: 100,
|
|
86
107
|
};
|
|
87
108
|
|
|
@@ -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.
|
|
8
|
+
version: "0.0.4",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "asana-search-user-projects",
|
|
5
5
|
name: "Get list of user projects",
|
|
6
6
|
description: "Return list of projects given the user and workspace gid. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)",
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.6.0",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -34,6 +34,14 @@ export default {
|
|
|
34
34
|
}),
|
|
35
35
|
],
|
|
36
36
|
},
|
|
37
|
+
optFields: {
|
|
38
|
+
propDefinition: [
|
|
39
|
+
asana,
|
|
40
|
+
"optFields",
|
|
41
|
+
],
|
|
42
|
+
description: "Optional project properties to include in the response (e.g. `created_at`, `start_on`, `due_on`, `archived`, `custom_fields`). Nested paths are allowed; `gid` is always returned. [See the documentation](https://developers.asana.com/docs/get-multiple-projects)",
|
|
43
|
+
optional: true,
|
|
44
|
+
},
|
|
37
45
|
maxResults: {
|
|
38
46
|
propDefinition: [
|
|
39
47
|
asana,
|
|
@@ -42,11 +50,27 @@ export default {
|
|
|
42
50
|
},
|
|
43
51
|
},
|
|
44
52
|
async run({ $ }) {
|
|
53
|
+
// membership filtering below reads project.members, so always request the
|
|
54
|
+
// base fields; merge in any user-requested opt_fields on top.
|
|
55
|
+
const optFields = new Set([
|
|
56
|
+
"gid",
|
|
57
|
+
"name",
|
|
58
|
+
"resource_type",
|
|
59
|
+
"members",
|
|
60
|
+
]);
|
|
61
|
+
if (Array.isArray(this.optFields)) {
|
|
62
|
+
for (const field of this.optFields) {
|
|
63
|
+
optFields.add(field);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
45
67
|
let hasMore, count = 0;
|
|
46
68
|
const params = {
|
|
47
69
|
workspace: this.workspace,
|
|
70
|
+
opt_fields: [
|
|
71
|
+
...optFields,
|
|
72
|
+
].join(","),
|
|
48
73
|
limit: 100,
|
|
49
|
-
opt_fields: "gid,name,resource_type,members",
|
|
50
74
|
};
|
|
51
75
|
const allProjects = [];
|
|
52
76
|
|
|
@@ -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.
|
|
8
|
+
version: "0.4.8",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
package/asana.app.mjs
CHANGED
|
@@ -281,6 +281,17 @@ export default {
|
|
|
281
281
|
max: 9999,
|
|
282
282
|
optional: true,
|
|
283
283
|
},
|
|
284
|
+
optFields: {
|
|
285
|
+
type: "string[]",
|
|
286
|
+
label: "Opt Fields",
|
|
287
|
+
description: "Optional properties to include in the response, as a list of field paths. Nested paths are allowed (e.g. `owner.name`, `custom_fields.name`); `gid` is always returned. [See the documentation](https://developers.asana.com/docs/inputoutput-options)",
|
|
288
|
+
optional: true,
|
|
289
|
+
},
|
|
290
|
+
portfolioId: {
|
|
291
|
+
type: "string",
|
|
292
|
+
label: "Portfolio",
|
|
293
|
+
description: "The portfolio GID. Use the **List Portfolios** action to find available portfolio GIDs.",
|
|
294
|
+
},
|
|
284
295
|
},
|
|
285
296
|
methods: {
|
|
286
297
|
/**
|
|
@@ -422,6 +433,47 @@ export default {
|
|
|
422
433
|
...opts,
|
|
423
434
|
});
|
|
424
435
|
},
|
|
436
|
+
/**
|
|
437
|
+
* Get an Asana Portfolio.
|
|
438
|
+
*
|
|
439
|
+
* @param {string} portfolioId - The portfolio GID.
|
|
440
|
+
*
|
|
441
|
+
* @returns {string} An Asana Portfolio.
|
|
442
|
+
*/
|
|
443
|
+
getPortfolio({
|
|
444
|
+
portfolioId, ...opts
|
|
445
|
+
}) {
|
|
446
|
+
return this._makeRequest({
|
|
447
|
+
path: `portfolios/${portfolioId}`,
|
|
448
|
+
...opts,
|
|
449
|
+
});
|
|
450
|
+
},
|
|
451
|
+
/**
|
|
452
|
+
* Get an Asana Portfolio list.
|
|
453
|
+
*
|
|
454
|
+
* @returns {string} An Asana Portfolio list.
|
|
455
|
+
*/
|
|
456
|
+
getPortfolios(opts = {}) {
|
|
457
|
+
return this._makeRequest({
|
|
458
|
+
path: "portfolios",
|
|
459
|
+
...opts,
|
|
460
|
+
});
|
|
461
|
+
},
|
|
462
|
+
/**
|
|
463
|
+
* Get the items in an Asana Portfolio.
|
|
464
|
+
*
|
|
465
|
+
* @param {string} portfolioId - The portfolio GID.
|
|
466
|
+
*
|
|
467
|
+
* @returns {string} An Asana Project list.
|
|
468
|
+
*/
|
|
469
|
+
getPortfolioItems({
|
|
470
|
+
portfolioId, ...opts
|
|
471
|
+
}) {
|
|
472
|
+
return this._makeRequest({
|
|
473
|
+
path: `portfolios/${portfolioId}/items`,
|
|
474
|
+
...opts,
|
|
475
|
+
});
|
|
476
|
+
},
|
|
425
477
|
/**
|
|
426
478
|
* Get an Asana Story.
|
|
427
479
|
*
|
package/package.json
CHANGED
|
@@ -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.
|
|
9
|
+
version: "0.1.14",
|
|
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 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.
|
|
10
|
+
version: "0.1.14",
|
|
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.
|
|
10
|
+
version: "0.0.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 Task Assigned in Project (Instant)",
|
|
9
9
|
description: "Emit new event each time a task is assigned, reassigned or unassigned.",
|
|
10
|
-
version: "0.1.
|
|
10
|
+
version: "0.1.7",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
13
13
|
...common.props,
|