feat: add session endpoint and booking access pbac (#24637)

* feat: add session endpoint

* fix: remove participant id

* refactor; feedback

* fix: e2e test

* refactor: add pbac

* refactor: use constant

* tests: add booking tests

* fix: conflicts

* chore: test

* fix: tests

* fix: tests

* chore: remove un necessary

* chore: docs

* fix: desc

* fix: booking-pbac gurd

* fix: booking-pbac gurd

* test: add unit tests

* fix: remove legacy pbac

* fix: chore remove

* fix: update tests

* test: add more test

* test: move it to new file

* chore: comment auth

* chore: add message

* chore: add message

---------

Co-authored-by: Morgan <[email protected]>
This commit is contained in:
Udit TakkarandMorgan authored and GitHub committed 2025-12-04 05:45:17 +00:00
1 parent 3a8bf7014c
commit a11f7e6510
22 files changed
+1186 -71

No files matched your search

@@ -2,4 +2,7 @@ export {
getRecordingsOfCalVideoByRoomName,
getDownloadLinkOfCalVideoByRecordingId,
getAllTranscriptsAccessLinkFromRoomName,
getCalVideoMeetingSessionsByRoomName,
} from "@calcom/features/conferencing/lib/videoClient";
export type { CalMeetingParticipant, CalMeetingSession } from "@calcom/app-store/dailyvideo/zod";
+2
View File
@@ -128,3 +128,5 @@ export { sendEmailVerificationByCode } from "@calcom/features/auth/lib/verifyEma
export { checkEmailVerificationRequired } from "@calcom/trpc/server/routers/publicViewer/checkIfUserEmailVerificationRequired.handler";
export { TeamService } from "@calcom/features/ee/teams/services/teamService";
export { BookingAccessService } from "@calcom/features/bookings/services/BookingAccessService";
@@ -55,4 +55,12 @@ export class GetBookingRecordingsOutput {
@ValidateNested({ each: true })
@Type(() => RecordingItem)
data!: RecordingItem[];
@ApiProperty({
example: "This endpoint will require authentication in a future release.",
required: false,
})
@IsString()
@IsOptional()
message?: string;
}
@@ -14,4 +14,11 @@ export class GetBookingTranscriptsOutput {
@IsArray()
@IsString({ each: true })
data!: string[];
@ApiProperty({
example: "This endpoint will require authentication in a future release.",
required: false,
})
@IsString()
message?: string;
}
@@ -0,0 +1,68 @@
import { ApiProperty } from "@nestjs/swagger";
import { Type } from "class-transformer";
import { IsEnum, ValidateNested, IsNumber, IsString, IsBoolean, IsArray } from "class-validator";
import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
export class CalMeetingParticipant {
@ApiProperty({ example: "user123", nullable: true })
@IsString()
userId!: string | null;
@ApiProperty({ example: "John Doe", nullable: true })
@IsString()
userName!: string | null;
@ApiProperty({ example: 1678901234 })
@IsNumber()
joinTime!: number;
@ApiProperty({ example: 3600 })
@IsNumber()
duration!: number;
}
export class CalMeetingSession {
@ApiProperty({ example: "session123" })
@IsString()
id!: string;
@ApiProperty({ example: "daily-video-room-123" })
@IsString()
room!: string;
@ApiProperty({ example: 1678901234 })
@IsNumber()
startTime!: number;
@ApiProperty({ example: 3600 })
@IsNumber()
duration!: number;
@ApiProperty({ example: false })
@IsBoolean()
ongoing!: boolean;
@ApiProperty({ example: 10 })
@IsNumber()
maxParticipants!: number;
@ApiProperty({ type: [CalMeetingParticipant] })
@IsArray()
@ValidateNested({ each: true })
@Type(() => CalMeetingParticipant)
participants!: CalMeetingParticipant[];
}
export class GetBookingVideoSessionsOutput {
@ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
@IsEnum([SUCCESS_STATUS, ERROR_STATUS])
status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
error?: Error;
@ApiProperty({ type: [CalMeetingSession] })
@ValidateNested({ each: true })
@Type(() => CalMeetingSession)
data!: CalMeetingSession[];
}
@@ -3,3 +3,4 @@ export * from "./get-booking.output";
export * from "./get-bookings.output";
export * from "./get-booking-recordings.output";
export * from "./get-booking-transcripts.output";
export * from "./get-booking-video-sessions.output";