@pipedream/zoom 0.6.0 → 0.7.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.
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import zoom from "../../zoom.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "zoom-get-meeting-transcript",
|
|
5
|
+
name: "Get Meeting Transcript",
|
|
6
|
+
description: "Get the transcript of a meeting. [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/cloud-recording/get/meetings/{meetingId}/transcript)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
zoom,
|
|
11
|
+
meetingId: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
zoom,
|
|
14
|
+
"meetingId",
|
|
15
|
+
],
|
|
16
|
+
description: "The meeting ID to get the transcript for",
|
|
17
|
+
optional: false,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
methods: {
|
|
21
|
+
getMeetingTranscript({
|
|
22
|
+
meetingId, ...opts
|
|
23
|
+
}) {
|
|
24
|
+
return this.zoom._makeRequest({
|
|
25
|
+
path: `/meetings/${meetingId}/transcript`,
|
|
26
|
+
...opts,
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
async run({ $: step }) {
|
|
31
|
+
const transcript = await this.getMeetingTranscript({
|
|
32
|
+
step,
|
|
33
|
+
meetingId: this.meetingId,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
step.export("$summary", `Retrieved transcript for meeting ${this.meetingId}`);
|
|
37
|
+
return transcript;
|
|
38
|
+
},
|
|
39
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/zoom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Pipedream Zoom Components",
|
|
5
5
|
"main": "zoom.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pipedream/platform": "^1.
|
|
17
|
+
"@pipedream/platform": "^3.1.0"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import common from "../common/common.mjs";
|
|
2
|
+
import constants from "../common/constants.mjs";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
...common,
|
|
6
|
+
key: "zoom-new-recording-transcript-completed",
|
|
7
|
+
name: "New Recording Transcript Completed (Instant)",
|
|
8
|
+
description: "Emit new event each time a recording transcript is completed",
|
|
9
|
+
version: "0.0.1",
|
|
10
|
+
type: "source",
|
|
11
|
+
dedupe: "unique",
|
|
12
|
+
props: {
|
|
13
|
+
...common.props,
|
|
14
|
+
// eslint-disable-next-line pipedream/props-label, pipedream/props-description
|
|
15
|
+
apphook: {
|
|
16
|
+
type: "$.interface.apphook",
|
|
17
|
+
appProp: "app",
|
|
18
|
+
eventNames() {
|
|
19
|
+
return [
|
|
20
|
+
constants.CUSTOM_EVENT_TYPES.RECORDING_TRANSCRIPT_COMPLETED,
|
|
21
|
+
];
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
hooks: {
|
|
26
|
+
async deploy() {
|
|
27
|
+
const { meetings } = await this.app.listMeetings({
|
|
28
|
+
params: {
|
|
29
|
+
from: this.monthAgo(),
|
|
30
|
+
to: new Date().toISOString()
|
|
31
|
+
.slice(0, 10),
|
|
32
|
+
page_size: 25,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
if (!meetings || meetings.length === 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
for (const meeting of meetings) {
|
|
39
|
+
if (!this.isMeetingRelevant(meeting)) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
for (const file of meeting.recording_files) {
|
|
43
|
+
if (!this.isFileRelevant(file)) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
this.emitEvent(file, meeting);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
...common.methods,
|
|
53
|
+
isMeetingRelevant(meeting) {
|
|
54
|
+
return meeting.recording_files && meeting.recording_files.length > 0;
|
|
55
|
+
},
|
|
56
|
+
isFileRelevant(file) {
|
|
57
|
+
return file.file_type === "TRANSCRIPT" && file.status === "completed";
|
|
58
|
+
},
|
|
59
|
+
emitEvent(file, meeting) {
|
|
60
|
+
this.$emit({
|
|
61
|
+
meeting,
|
|
62
|
+
file,
|
|
63
|
+
}, this.generateMeta(file, meeting));
|
|
64
|
+
},
|
|
65
|
+
generateMeta(file, meeting) {
|
|
66
|
+
return {
|
|
67
|
+
id: file.id,
|
|
68
|
+
summary: `Transcript completed for ${meeting.topic}`,
|
|
69
|
+
ts: +new Date(file.recording_end),
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
async run(event) {
|
|
74
|
+
if (event.event !== constants.CUSTOM_EVENT_TYPES.RECORDING_TRANSCRIPT_COMPLETED) {
|
|
75
|
+
console.log("Not a recording.transcript.completed event. Exiting");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const { payload } = event;
|
|
79
|
+
const { object } = payload;
|
|
80
|
+
const { recording_files: recordingFiles } = object;
|
|
81
|
+
|
|
82
|
+
if (!this.isMeetingRelevant(object)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
for (const file of recordingFiles) {
|
|
87
|
+
if (!this.isFileRelevant(file)) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
this.emitEvent(file, object);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
};
|