feat: generate transcription from recording and API endpoint (#15358)

* feat: generate transcription from recording

* fix: api

* chore: undo

* tests: add unit tests

* chore: refactor move zod type

* fix: add more security check

* chore: update test

* chore: type err

* chore: test

* chore: fix tyoe

* fix: build err

* chore: add try .. catch

* chore: update desc

---------

Co-authored-by: Joe Au-Yeung <[email protected]>
This commit is contained in:
Udit TakkarandJoe Au-Yeung authored and GitHub committed 2024-06-11 15:41:56 +00:00
1 parent 68ce9524eb
commit b66d36a98e
9 files changed
+451 -2

No files matched your search

+11 -1
View File
@@ -3,7 +3,10 @@ import { createHmac } from "crypto";
import type { NextApiRequest, NextApiResponse } from "next";
import { z } from "zod";
import { getDownloadLinkOfCalVideoByRecordingId } from "@calcom/core/videoClient";
import {
getDownloadLinkOfCalVideoByRecordingId,
submitBatchProcessorTranscriptionJob,
} from "@calcom/core/videoClient";
import { sendDailyVideoRecordingEmails } from "@calcom/emails";
import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks";
import sendPayload from "@calcom/features/webhooks/lib/sendOrSchedulePayload";
@@ -268,6 +271,13 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
},
});
try {
// Submit Transcription Batch Processor Job
await submitBatchProcessorTranscriptionJob(recording_id);
} catch (err) {
log.error("Failed to Submit Transcription Batch Processor Job:", safeStringify(err));
}
// send emails to all attendees only when user has team plan
await sendDailyVideoRecordingEmails(evt, downloadLink);
return res.status(200).json({ message: "Success" });