Files
calendar/packages/types/VideoApiAdapter.d.ts
T
b66d36a98e 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 <65426560+joeauyeung@users.noreply.github.com>
2024-06-11 15:41:56 +00:00

48 lines
1.7 KiB
TypeScript

import type {
TSubmitBatchProcessorJobRes,
batchProcessorBody,
TGetTranscriptAccessLink,
} from "@calcom/app-store/dailyvideo/zod";
import type { GetRecordingsResponseSchema, GetAccessLinkResponseSchema } from "@calcom/prisma/zod-utils";
import type { EventBusyDate } from "./Calendar";
import type { CredentialPayload } from "./Credential";
export interface VideoCallData {
type: string;
id: string;
password: string;
url: string;
}
// VideoApiAdapter is defined by the Video App. The App currently can choose to not define it. So, consider in type that VideoApiAdapter can be undefined.
export type VideoApiAdapter =
| {
createMeeting(event: CalendarEvent): Promise<VideoCallData>;
updateMeeting(bookingRef: PartialReference, event: CalendarEvent): Promise<VideoCallData>;
deleteMeeting(uid: string): Promise<unknown>;
getAvailability(dateFrom?: string, dateTo?: string): Promise<EventBusyDate[]>;
getRecordings?(roomName: string): Promise<GetRecordingsResponseSchema>;
getRecordingDownloadLink?(recordingId: string): Promise<GetAccessLinkResponseSchema>;
createInstantCalVideoRoom?(endTime: string): Promise<VideoCallData>;
getAllTranscriptsAccessLinkFromRoomName?(roomName: string): Promise<Array<string>>;
submitBatchProcessorJob?(body: batchProcessorBody): Promise<TSubmitBatchProcessorJobRes>;
getTranscriptsAccessLinkFromRecordingId?(
recordingId: string
): Promise<TGetTranscriptAccessLink["transcription"] | { message: string }>;
checkIfRoomNameMatchesInRecording?(roomName: string, recordingId: string): Promise<boolean>;
}
| undefined;
export type VideoApiAdapterFactory = (credential: CredentialPayload) => VideoApiAdapter;