Skip to content

Commit 9ccf5f3

Browse files
authored
chore: add auto recording (calcom#22723)
* feat: add auto recording setting in API v2 * test: add e2e test * test: add tests * chore: save progress * chore: update zod
1 parent 91ee225 commit 9ccf5f3

8 files changed

Lines changed: 5810 additions & 52 deletions

File tree

apps/api/v2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@axiomhq/winston": "^1.2.0",
3939
"@calcom/platform-constants": "*",
4040
"@calcom/platform-enums": "*",
41-
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.258",
41+
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.266",
4242
"@calcom/platform-types": "*",
4343
"@calcom/platform-utils": "*",
4444
"@calcom/prisma": "*",

apps/api/v2/src/ee/event-types/event-types_2024_06_14/controllers/event-types.controller.e2e-spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ describe("Event types Endpoints", () => {
967967
calVideoSettings: {
968968
disableRecordingForGuests: true,
969969
disableRecordingForOrganizer: true,
970+
enableAutomaticRecordingForOrganizer: true,
970971
},
971972
bookingFields: [
972973
nameBookingField,
@@ -1095,6 +1096,9 @@ describe("Event types Endpoints", () => {
10951096
expect(updatedEventType.calVideoSettings?.disableRecordingForOrganizer).toEqual(
10961097
body.calVideoSettings?.disableRecordingForOrganizer
10971098
);
1099+
expect(updatedEventType.calVideoSettings?.enableAutomaticRecordingForOrganizer).toEqual(
1100+
body.calVideoSettings?.enableAutomaticRecordingForOrganizer
1101+
);
10981102

10991103
eventType.title = newTitle;
11001104
eventType.scheduleId = secondSchedule.id;
@@ -1115,6 +1119,7 @@ describe("Event types Endpoints", () => {
11151119
eventType.lockTimeZoneToggleOnBookingPage = updatedEventType.lockTimeZoneToggleOnBookingPage;
11161120
eventType.color = updatedEventType.color;
11171121
eventType.bookingFields = updatedEventType.bookingFields;
1122+
eventType.calVideoSettings = updatedEventType.calVideoSettings;
11181123
});
11191124
});
11201125

@@ -1871,6 +1876,7 @@ describe("Event types Endpoints", () => {
18711876
calVideoSettings: {
18721877
disableRecordingForGuests: true,
18731878
disableRecordingForOrganizer: true,
1879+
enableAutomaticRecordingForOrganizer: true,
18741880
},
18751881
locations: [
18761882
{
@@ -1893,6 +1899,7 @@ describe("Event types Endpoints", () => {
18931899
expect(createdEventType.locations).toEqual(body.locations);
18941900
expect(createdEventType.calVideoSettings?.disableRecordingForGuests).toEqual(true);
18951901
expect(createdEventType.calVideoSettings?.disableRecordingForOrganizer).toEqual(true);
1902+
expect(createdEventType.calVideoSettings?.enableAutomaticRecordingForOrganizer).toEqual(true);
18961903
firstCreatedEventType = responseBody.data;
18971904
});
18981905
});

apps/api/v2/swagger/documentation.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15705,6 +15705,10 @@
1570515705
"redirectUrlOnExit": {
1570615706
"type": "object",
1570715707
"description": "URL to which participants are redirected when they exit the call"
15708+
},
15709+
"enableAutomaticRecordingForOrganizer": {
15710+
"type": "boolean",
15711+
"description": "If true, enables the automatic recording for the event when organizer joins the call"
1570815712
}
1570915713
}
1571015714
},

docs/api-reference/v2/openapi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15705,6 +15705,10 @@
1570515705
"redirectUrlOnExit": {
1570615706
"type": "object",
1570715707
"description": "URL to which participants are redirected when they exit the call"
15708+
},
15709+
"enableAutomaticRecordingForOrganizer": {
15710+
"type": "boolean",
15711+
"description": "If true, enables the automatic recording for the event when organizer joins the call"
1570815712
}
1570915713
}
1571015714
},

packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ export class CalVideoSettings {
145145
description: "URL to which participants are redirected when they exit the call",
146146
})
147147
redirectUrlOnExit?: string | null;
148+
149+
@IsOptional()
150+
@IsBoolean()
151+
@DocsPropertyOptional({
152+
description: "If true, enables the automatic recording for the event when organizer joins the call",
153+
})
154+
enableAutomaticRecordingForOrganizer?: boolean;
148155
}
149156

150157
class BaseCreateEventTypeInput {

packages/prisma/zod/custom/eventtype.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ import { MIN_EVENT_DURATION_MINUTES, MAX_EVENT_DURATION_MINUTES } from "@calcom/
77

88
const calVideoSettingsSchema = z
99
.object({
10-
disableRecordingForGuests: z.boolean().optional().nullable(),
11-
disableRecordingForOrganizer: z.boolean().optional().nullable(),
12-
redirectUrlOnExit: z.string().url().optional().nullable(),
10+
disableRecordingForGuests: z.boolean().nullish(),
11+
disableRecordingForOrganizer: z.boolean().nullish(),
12+
redirectUrlOnExit: z.string().url().nullish(),
13+
enableAutomaticRecordingForOrganizer: z.boolean().nullish(),
14+
enableAutomaticTranscription: z.boolean().nullish(),
15+
disableTranscriptionForGuests: z.boolean().nullish(),
16+
disableTranscriptionForOrganizer: z.boolean().nullish(),
1317
})
1418
.optional()
1519
.nullable();

packages/trpc/server/routers/viewer/eventTypes/create.handler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ export const createHandler = async ({ ctx, input }: CreateOptions) => {
7171
create: {
7272
disableRecordingForGuests: calVideoSettings.disableRecordingForGuests ?? false,
7373
disableRecordingForOrganizer: calVideoSettings.disableRecordingForOrganizer ?? false,
74+
enableAutomaticTranscription: calVideoSettings.enableAutomaticTranscription ?? false,
75+
enableAutomaticRecordingForOrganizer: calVideoSettings.enableAutomaticRecordingForOrganizer ?? false,
76+
disableTranscriptionForGuests: calVideoSettings.disableTranscriptionForGuests ?? false,
77+
disableTranscriptionForOrganizer: calVideoSettings.disableTranscriptionForOrganizer ?? false,
7478
redirectUrlOnExit: calVideoSettings.redirectUrlOnExit ?? null,
7579
},
7680
};

0 commit comments

Comments
 (0)