-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Zoom & Zoom Admin - new transcript components #18036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import zoom from "../../zoom.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "zoom-get-meeting-transcript", | ||
| name: "Get Meeting Transcript", | ||
| description: "Get the transcript of a meeting. [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/cloud-recording/get/meetings/{meetingId}/transcript)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| zoom, | ||
| meetingId: { | ||
| propDefinition: [ | ||
| zoom, | ||
| "meetingId", | ||
| ], | ||
| description: "The meeting ID to get the transcript for", | ||
| optional: false, | ||
| }, | ||
| }, | ||
| methods: { | ||
| getMeetingTranscript({ | ||
| meetingId, ...opts | ||
| }) { | ||
| return this.zoom._makeRequest({ | ||
| path: `/meetings/${meetingId}/transcript`, | ||
| ...opts, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $: step }) { | ||
| const transcript = await this.getMeetingTranscript({ | ||
| step, | ||
| meetingId: this.meetingId, | ||
| }); | ||
|
|
||
| step.export("$summary", `Retrieved transcript for meeting ${this.meetingId}`); | ||
| return transcript; | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| import common from "../common/common.mjs"; | ||
| import constants from "../common/constants.mjs"; | ||
|
|
||
| export default { | ||
| ...common, | ||
| key: "zoom-new-recording-transcript-completed", | ||
| name: "New Recording Transcript Completed (Instant)", | ||
| description: "Emit new event each time a recording transcript is completed", | ||
| version: "0.0.1", | ||
| type: "source", | ||
| dedupe: "unique", | ||
| props: { | ||
| ...common.props, | ||
| // eslint-disable-next-line pipedream/props-label, pipedream/props-description | ||
| apphook: { | ||
| type: "$.interface.apphook", | ||
| appProp: "app", | ||
| eventNames() { | ||
| return [ | ||
| constants.CUSTOM_EVENT_TYPES.RECORDING_TRANSCRIPT_COMPLETED, | ||
| ]; | ||
| }, | ||
| }, | ||
| }, | ||
| hooks: { | ||
| async deploy() { | ||
| const { meetings } = await this.app.listMeetings({ | ||
| params: { | ||
| from: this.monthAgo(), | ||
| to: new Date().toISOString() | ||
| .slice(0, 10), | ||
| page_size: 25, | ||
| }, | ||
| }); | ||
| if (!meetings || meetings.length === 0) { | ||
| return; | ||
| } | ||
| for (const meeting of meetings) { | ||
| if (!this.isMeetingRelevant(meeting)) { | ||
| continue; | ||
| } | ||
| for (const file of meeting.recording_files) { | ||
| if (!this.isFileRelevant(file)) { | ||
| continue; | ||
| } | ||
| this.emitEvent(file, meeting); | ||
| } | ||
| } | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| methods: { | ||
| ...common.methods, | ||
| isMeetingRelevant(meeting) { | ||
| return meeting.recording_files && meeting.recording_files.length > 0; | ||
| }, | ||
| isFileRelevant(file) { | ||
| return file.file_type === "TRANSCRIPT" && file.status === "completed"; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| emitEvent(file, meeting) { | ||
| this.$emit({ | ||
| meeting, | ||
| file, | ||
| }, this.generateMeta(file, meeting)); | ||
| }, | ||
| generateMeta(file, meeting) { | ||
| return { | ||
| id: file.id, | ||
| summary: `Transcript completed for ${meeting.topic}`, | ||
| ts: +new Date(file.recording_end), | ||
| }; | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| async run(event) { | ||
| if (event.event !== constants.CUSTOM_EVENT_TYPES.RECORDING_TRANSCRIPT_COMPLETED) { | ||
| console.log("Not a recording.transcript.completed event. Exiting"); | ||
| return; | ||
| } | ||
| const { payload } = event; | ||
| const { object } = payload; | ||
| const { recording_files: recordingFiles } = object; | ||
|
|
||
| if (!this.isMeetingRelevant(object)) { | ||
| return; | ||
| } | ||
|
|
||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| for (const file of recordingFiles) { | ||
| if (!this.isFileRelevant(file)) { | ||
| continue; | ||
| } | ||
|
|
||
| this.emitEvent(file, object); | ||
| } | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import zoomAdmin from "../../zoom_admin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "zoom_admin-get-meeting-transcript", | ||
| name: "Get Meeting Transcript", | ||
| description: "Get the transcript of a meeting. [See the documentation](https://developers.zoom.us/docs/api/meetings/#tag/cloud-recording/get/meetings/{meetingId}/transcript)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| zoomAdmin, | ||
| meetingId: { | ||
| propDefinition: [ | ||
| zoomAdmin, | ||
| "meeting", | ||
| ], | ||
| description: "The meeting ID to get the transcript for", | ||
| }, | ||
| }, | ||
| methods: { | ||
| getMeetingTranscript({ | ||
| meetingId, ...opts | ||
| }) { | ||
| return this.zoomAdmin._makeRequest({ | ||
| path: `/meetings/${meetingId}/transcript`, | ||
| ...opts, | ||
| }); | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const meetingId = this.meetingId.value || this.meetingId; | ||
| const { data: transcript } = await this.getMeetingTranscript({ | ||
| $, | ||
| meetingId, | ||
| }); | ||
|
|
||
| $.export("$summary", `Retrieved transcript for meeting ${meetingId}`); | ||
| return transcript; | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| import zoomAdmin from "../../zoom_admin.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "zoom_admin-new-recording-transcript-completed", | ||
| name: "New Recording Transcript Completed (Instant)", | ||
| description: "Emit new event each time a recording transcript is completed", | ||
| version: "0.0.1", | ||
| type: "source", | ||
| dedupe: "unique", | ||
| props: { | ||
| zoomAdmin, | ||
| zoomApphook: { | ||
|
Check warning on line 12 in components/zoom_admin/sources/new-recording-transcript-completed/new-recording-transcript-completed.mjs
|
||
| type: "$.interface.apphook", | ||
| appProp: "zoomAdmin", | ||
| eventNames: [ | ||
| "recording.transcript_completed", | ||
| ], | ||
| }, | ||
| }, | ||
| hooks: { | ||
| async deploy() { | ||
| const { meetings } = await this.zoomAdmin.listMeetings({ | ||
| params: { | ||
| from: this.monthAgo(), | ||
| to: new Date().toISOString() | ||
| .slice(0, 10), | ||
| page_size: 25, | ||
| }, | ||
| }); | ||
| if (!meetings || meetings.length === 0) { | ||
| return; | ||
| } | ||
| for (const meeting of meetings) { | ||
| if (!this.isMeetingRelevant(meeting)) { | ||
| continue; | ||
| } | ||
| for (const file of meeting.recording_files) { | ||
| if (!this.isFileRelevant(file)) { | ||
| continue; | ||
| } | ||
| this.emitEvent(file, meeting); | ||
| } | ||
| } | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| methods: { | ||
| monthAgo() { | ||
| const now = new Date(); | ||
| const monthAgo = new Date(now.getTime()); | ||
| monthAgo.setMonth(monthAgo.getMonth() - 1); | ||
| return monthAgo.toISOString().slice(0, 10); | ||
| }, | ||
| isMeetingRelevant(meeting) { | ||
| return meeting.recording_files && meeting.recording_files.length > 0; | ||
| }, | ||
| isFileRelevant(file) { | ||
| return file.file_type === "TRANSCRIPT" && file.status === "completed"; | ||
| }, | ||
| emitEvent(file, meeting) { | ||
| this.$emit({ | ||
| meeting, | ||
| file, | ||
| }, this.generateMeta(file, meeting)); | ||
| }, | ||
| generateMeta(file, meeting) { | ||
| return { | ||
| id: file.id, | ||
| summary: `Transcript completed for ${meeting.topic}`, | ||
| ts: +new Date(file.recording_end), | ||
| }; | ||
| }, | ||
| }, | ||
| async run(event) { | ||
| if (event.event !== "recording.transcript_completed") { | ||
| console.log("Not a recording.transcript_completed event. Exiting"); | ||
| return; | ||
| } | ||
| const { payload } = event; | ||
| const { object } = payload; | ||
| const { recording_files: recordingFiles } = object; | ||
|
|
||
| if (!this.isMeetingRelevant(object)) { | ||
| return; | ||
| } | ||
|
|
||
| for (const file of recordingFiles) { | ||
| if (!this.isFileRelevant(file)) { | ||
| continue; | ||
| } | ||
|
|
||
| this.emitEvent(file, object); | ||
| } | ||
| }, | ||
michelle0927 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.