Files
Volnei MunhozGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
53395695b4 fix: resolve useLiteralKeys biome lint issues (#26851)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-01-14 19:13:13 -03:00

44 lines
1.3 KiB
TypeScript

import { VideoApiAdapterMap } from "@calcom/app-store/video.adapters.generated";
import type { TrpcSessionUser } from "@calcom/trpc/server/types";
import { TRPCError } from "@trpc/server";
import type { TGetMeetingInformationInputSchema } from "./getMeetingInformation.schema";
type GetMeetingInformationOptions = {
ctx: {
user: NonNullable<TrpcSessionUser>;
};
input: TGetMeetingInformationInputSchema;
};
export const getMeetingInformationHandler = async ({ ctx: _ctx, input }: GetMeetingInformationOptions) => {
const { roomName } = input;
try {
const dailyVideoAdapterImport = VideoApiAdapterMap.dailyvideo;
if (!dailyVideoAdapterImport) {
throw new TRPCError({
code: "BAD_REQUEST",
message: "Daily video adapter not available",
});
}
const dailyVideoAdapterModule = await dailyVideoAdapterImport;
const videoApiAdapter = dailyVideoAdapterModule.default();
if (!videoApiAdapter || !videoApiAdapter.getMeetingInformation) {
throw new TRPCError({
code: "BAD_REQUEST",
message: "Meeting information feature not available",
});
}
const res = await videoApiAdapter.getMeetingInformation(roomName);
return res;
} catch (err) {
throw new TRPCError({
code: "BAD_REQUEST",
});
}
};