Skip to content

Commit dfb6323

Browse files
Merge branch 'master' into confluence-cursor-link
2 parents 9e34c99 + ebbc0e6 commit dfb6323

File tree

121 files changed

+1721
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+1721
-237
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import common from "../common/common.mjs";
2+
3+
export default {
4+
key: "asana-list-task-stories",
5+
name: "List Task Stories",
6+
description: "List stories (including comments) for a task. [See the documentation](https://developers.asana.com/reference/getstoriesfortask)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
...common.props,
11+
taskId: {
12+
label: "Task GID",
13+
description: "The ID of the task to retrieve stories for",
14+
type: "string",
15+
propDefinition: [
16+
common.props.asana,
17+
"tasks",
18+
(c) => ({
19+
project: c.project,
20+
}),
21+
],
22+
},
23+
commentsOnly: {
24+
type: "boolean",
25+
label: "Comments Only",
26+
description: "Only return comments",
27+
optional: true,
28+
},
29+
optFields: {
30+
type: "string[]",
31+
label: "Opt Fields",
32+
description: "This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. See the [documentation](https://developers.asana.com/reference/stories) for available fields.",
33+
optional: true,
34+
},
35+
maxResults: {
36+
type: "integer",
37+
label: "Max Results",
38+
description: "The maximum number of results to return",
39+
default: 100,
40+
optional: true,
41+
},
42+
},
43+
methods: {
44+
async getStoriesForTask({
45+
taskId, ...opts
46+
}) {
47+
return this.asana._makeRequest({
48+
path: `tasks/${taskId}/stories`,
49+
...opts,
50+
});
51+
},
52+
},
53+
async run({ $ }) {
54+
let hasMore, count = 0;
55+
56+
const params = {
57+
limit: this.maxResults,
58+
opt_fields: this.optFields
59+
? this.optFields?.join(",")
60+
: undefined,
61+
};
62+
63+
const results = [];
64+
65+
do {
66+
const {
67+
data, next_page: next,
68+
} = await this.getStoriesForTask({
69+
$,
70+
taskId: this.taskId,
71+
params,
72+
});
73+
74+
hasMore = next;
75+
params.offset = next?.offset;
76+
77+
if (data.length === 0) {
78+
break;
79+
}
80+
81+
for (const story of data) {
82+
if (this.commentsOnly && story.type !== "comment") {
83+
continue;
84+
}
85+
results.push(story);
86+
if (++count >= this.maxResults) {
87+
hasMore = false;
88+
break;
89+
}
90+
}
91+
} while (hasMore);
92+
93+
$.export("$summary", `Found ${results.length} stories`);
94+
return results;
95+
},
96+
};

components/asana/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/asana",
3-
"version": "0.7.4",
3+
"version": "0.8.0",
44
"description": "Pipedream Asana Components",
55
"main": "asana.app.mjs",
66
"keywords": [

components/attio/actions/create-note/create-note.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "attio-create-note",
55
name: "Create Note",
66
description: "Creates a new note for a given record. The note will be linked to the specified record. [See the documentation](https://developers.attio.com/reference/post_v2-notes)",
7-
version: "0.0.4",
7+
version: "0.0.5",
88
type: "action",
99
props: {
1010
attio,

components/attio/actions/create-person/create-person.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "attio-create-person",
66
name: "Create Person",
77
description: "Creates a new person. [See the documentation](https://developers.attio.com/reference/post_v2-objects-people-records).",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
type: "action",
1010
props: {
1111
attio,

components/attio/actions/create-task/create-task.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "attio-create-task",
77
name: "Create Task",
88
description: "Creates a new task. [See the documentation](https://docs.attio.com/rest-api/endpoint-reference/tasks/create-a-task)",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
type: "action",
1111
props: {
1212
attio,

components/attio/actions/create-update-record/create-update-record.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "attio-create-update-record",
77
name: "Create or Update Record",
88
description: "Creates or updates a specific record such as a person or a deal. If the record already exists, it's updated. Otherwise, a new record is created. [See the documentation](https://developers.attio.com/reference/put_v2-objects-object-records)",
9-
version: "0.0.4",
9+
version: "0.0.5",
1010
type: "action",
1111
props: {
1212
attio,

components/attio/actions/delete-list-entry/delete-list-entry.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "attio-delete-list-entry",
55
name: "Delete List Entry",
66
description: "Deletes an existing entry from a specific list. [See the documentation](https://developers.attio.com/reference/delete_v2-lists-list-entries-entry-id)",
7-
version: "0.0.4",
7+
version: "0.0.5",
88
type: "action",
99
props: {
1010
attio,

components/attio/actions/get-record/get-record.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "attio-get-record",
55
name: "Get Record",
66
description: "Retrieves the record with the specified ID. [See the documentation](https://docs.attio.com/rest-api/endpoint-reference/records/get-a-record)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
attio,

components/attio/actions/update-person/update-person.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "attio-update-person",
66
name: "Update Person",
77
description: "Update an existing person. [See the documentation](https://developers.attio.com/reference/patch_v2-objects-people-records-record-id).",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
type: "action",
1010
props: {
1111
attio,

components/attio/attio.app.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ export default {
99
type: "string",
1010
label: "First Name",
1111
description: "The person's first name.",
12+
optional: true,
1213
},
1314
lastName: {
1415
type: "string",
1516
label: "Last Name",
1617
description: "The person's last name.",
18+
optional: true,
1719
},
1820
emailAddress: {
1921
type: "string",

0 commit comments

Comments
 (0)