Skip to content

Commit 0a7b783

Browse files
authored
Merge branch 'master' into issue-17798
2 parents d0c4f12 + 4a0c6aa commit 0a7b783

File tree

276 files changed

+5276
-688
lines changed

Some content is hidden

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

276 files changed

+5276
-688
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/assemblyai/actions/create-captions/create-captions.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assemblyai from "../../assemblyai.app.mjs";
22

33
export default {
44
name: "Create Captions",
5-
description: "Export your completed transcripts in SRT (srt) or VTT (vtt) format, which can be used for subtitles and closed captions in videos. [See the documentation](https://www.assemblyai.com/docs/API%20reference/transcript)",
5+
description: "Export your completed transcripts in SRT (srt) or VTT (vtt) format, which can be used for subtitles and closed captions in videos. [See the documentation](https://www.assemblyai.com/docs/api-reference/transcripts/get-subtitles)",
66
key: "assemblyai-create-captions",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
type: "action",
99
props: {
1010
assemblyai,

components/assemblyai/actions/get-transcription/get-transcription.mjs

Lines changed: 9 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,95 +2,26 @@ import assemblyai from "../../assemblyai.app.mjs";
22

33
export default {
44
name: "Get Transcription",
5-
description: "Fetches a specific transcribed result from the AssemblyAI API. [See the documentation](https://www.assemblyai.com/docs/API%20reference/transcript)",
5+
description: "Fetches a specific transcribed result from the AssemblyAI API. [See the documentation](https://www.assemblyai.com/docs/api-reference/transcripts/get)",
66
key: "assemblyai-get-transcription",
7-
version: "0.0.4",
7+
version: "0.1.0",
88
type: "action",
99
props: {
1010
assemblyai,
11-
url: {
12-
type: "string",
13-
label: "URL",
14-
description: "The URL of your media file to transcribe.",
15-
},
16-
languageCode: {
11+
transcriptId: {
1712
propDefinition: [
1813
assemblyai,
19-
"languageCode",
14+
"transcriptId",
2015
],
2116
},
22-
punctuate: {
23-
type: "boolean",
24-
label: "Punctuate",
25-
description: "Enable Automatic Punctuation",
26-
optional: true,
27-
},
28-
speakerLabels: {
29-
type: "boolean",
30-
label: "Speaker Labels",
31-
description: "Enable Speaker diarization",
32-
optional: true,
33-
},
34-
contentSafety: {
35-
type: "boolean",
36-
label: "Content Safety",
37-
description: "Enable Content Moderation",
38-
optional: true,
39-
},
40-
sentimentAnalysis: {
41-
type: "boolean",
42-
label: "Sentiment Analysis",
43-
description: "Enable Sentiment Analysis",
44-
optional: true,
45-
},
46-
webhookUrl: {
47-
type: "string",
48-
label: "Webhook URL",
49-
description: "The URL we should send webhooks to when your transcript is complete",
50-
optional: true,
51-
},
52-
callbackWithRerun: {
53-
type: "boolean",
54-
label: "Callback With Rerun",
55-
description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the transcription is completed. Overrides the `webhookUrl` prop. This will increase execution time and credit usage as a result. [See the documentation(https://pipedream.com/docs/code/nodejs/rerun/#flow-rerun). Not available in Pipedream Connect.",
56-
optional: true,
57-
},
5817
},
5918
async run({ $ }) {
60-
let response;
61-
const context = $.context;
62-
const run = context
63-
? context.run
64-
: {
65-
runs: 1,
66-
};
67-
if (run.runs === 1) {
68-
let webhookUrl = this.webhookUrl;
69-
if (context && this.callbackWithRerun) {
70-
({ resume_url: webhookUrl } = $.flow.rerun(600000, null, 1));
71-
}
72-
response = await this.assemblyai.createTranscript({
73-
data: {
74-
audio_url: this.url,
75-
language_code: this.languageCode,
76-
punctuate: this.punctuate,
77-
speaker_labels: this.speakerLabels,
78-
content_safety: this.contentSafety,
79-
sentiment_analysis: this.sentimentAnalysis,
80-
webhook_url: webhookUrl,
81-
},
82-
$,
83-
});
84-
}
85-
if (run.callback_request) {
86-
response = await this.assemblyai.getTranscript({
87-
transcriptId: run.callback_request.body.transcript_id,
88-
});
89-
}
19+
const response = await this.assemblyai.getTranscript({
20+
transcriptId: this.transcriptId,
21+
$,
22+
});
9023

91-
if (response?.id) {
92-
$.export("$summary", `Successfully created transcription with ID ${response.id}.`);
93-
}
24+
$.export("$summary", `Successfully retrieved transcription for transcript with ID ${this.transcriptId}.`);
9425

9526
return response;
9627
},
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import assemblyai from "../../assemblyai.app.mjs";
2+
3+
export default {
4+
name: "Transcribe Audio",
5+
description: "Create a transcript from a media file that is accessible via a URL. [See the documentation](https://www.assemblyai.com/docs/api-reference/transcripts/submit)",
6+
key: "assemblyai-transcribe-audio",
7+
version: "0.1.0",
8+
type: "action",
9+
props: {
10+
assemblyai,
11+
url: {
12+
type: "string",
13+
label: "URL",
14+
description: "The URL of your media file to transcribe.",
15+
},
16+
languageCode: {
17+
propDefinition: [
18+
assemblyai,
19+
"languageCode",
20+
],
21+
},
22+
punctuate: {
23+
type: "boolean",
24+
label: "Punctuate",
25+
description: "Enable Automatic Punctuation",
26+
optional: true,
27+
},
28+
speakerLabels: {
29+
type: "boolean",
30+
label: "Speaker Labels",
31+
description: "Enable Speaker diarization",
32+
optional: true,
33+
},
34+
contentSafety: {
35+
type: "boolean",
36+
label: "Content Safety",
37+
description: "Enable Content Moderation",
38+
optional: true,
39+
},
40+
sentimentAnalysis: {
41+
type: "boolean",
42+
label: "Sentiment Analysis",
43+
description: "Enable Sentiment Analysis",
44+
optional: true,
45+
},
46+
webhookUrl: {
47+
type: "string",
48+
label: "Webhook URL",
49+
description: "The URL we should send webhooks to when your transcript is complete",
50+
optional: true,
51+
},
52+
callbackWithRerun: {
53+
type: "boolean",
54+
label: "Callback With Rerun",
55+
description: "Use the `$.flow.rerun` Node.js helper to rerun the step when the transcription is completed. Overrides the `webhookUrl` prop. This will increase execution time and credit usage as a result. [See the documentation](https://pipedream.com/docs/code/nodejs/rerun/#flow-rerun). Not available in Pipedream Connect.",
56+
optional: true,
57+
},
58+
},
59+
async run({ $ }) {
60+
let response;
61+
const context = $.context;
62+
const run = context
63+
? context.run
64+
: {
65+
runs: 1,
66+
};
67+
if (run.runs === 1) {
68+
let webhookUrl = this.webhookUrl;
69+
if (context && this.callbackWithRerun) {
70+
({ resume_url: webhookUrl } = $.flow.rerun(600000, null, 1));
71+
}
72+
response = await this.assemblyai.createTranscript({
73+
data: {
74+
audio_url: this.url,
75+
language_code: this.languageCode,
76+
punctuate: this.punctuate,
77+
speaker_labels: this.speakerLabels,
78+
content_safety: this.contentSafety,
79+
sentiment_analysis: this.sentimentAnalysis,
80+
webhook_url: webhookUrl,
81+
},
82+
$,
83+
});
84+
}
85+
if (run.callback_request) {
86+
response = await this.assemblyai.getTranscript({
87+
transcriptId: run.callback_request.body.transcript_id,
88+
});
89+
}
90+
91+
if (response?.id) {
92+
$.export("$summary", `Successfully created transcription with ID ${response.id}.`);
93+
}
94+
95+
return response;
96+
},
97+
};

components/assemblyai/package.json

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

components/assemblyai/sources/new-transcription-completed/new-transcription-completed.mjs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
33

44
export default {
55
name: "New Transcription Completed",
6-
description: "Emit new event when a transcribed audio file from AssemblyAI is ready. [See the documentation](https://www.assemblyai.com/docs/API%20reference/transcript)",
6+
description: "Emit new event when a transcribed audio file from AssemblyAI is ready. [See the documentation](https://www.assemblyai.com/docs/api-reference/transcripts/list)",
77
key: "assemblyai-new-transcription-completed",
8-
version: "0.0.2",
8+
version: "0.1.0",
99
type: "source",
1010
dedupe: "unique",
1111
props: {
@@ -30,7 +30,7 @@ export default {
3030
return;
3131
}
3232
this._setLastId(transcripts[0].id);
33-
transcripts.reverse().forEach((transcript) => this.emitEvent(transcript));
33+
await this.emitTranscripts(transcripts);
3434
},
3535
},
3636
methods: {
@@ -44,6 +44,14 @@ export default {
4444
const meta = this.generateMeta(transcript);
4545
this.$emit(transcript, meta);
4646
},
47+
async emitTranscripts(transcripts) {
48+
for (const transcript of transcripts.reverse()) {
49+
const data = await this.assemblyai.getTranscript({
50+
transcriptId: transcript.id,
51+
});
52+
this.emitEvent(data);
53+
}
54+
},
4755
generateMeta(transcript) {
4856
return {
4957
id: transcript.id,
@@ -63,7 +71,9 @@ export default {
6371
if (!transcripts.length) {
6472
return;
6573
}
66-
transcripts.forEach((transcript) => this.emitEvent(transcript));
74+
6775
this._setLastId(transcripts[0].id);
76+
77+
await this.emitTranscripts(transcripts);
6878
},
6979
};

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.3",
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.1",
8+
version: "0.0.3",
99
type: "action",
1010
props: {
1111
attio,

0 commit comments

Comments
 (0)