Skip to content

Commit 8653f7d

Browse files
committed
Merge branch 'main' into devin/insights-pbac-1756999558
2 parents 0cd8649 + e33560e commit 8653f7d

255 files changed

Lines changed: 4734 additions & 3901 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,11 @@ UNKEY_ROOT_KEY=
386386
# Used for Cal.ai Voice AI Agents
387387
# https://retellai.com
388388
RETELL_AI_KEY=
389+
# Local testing overrides for Retell AI
390+
RETELL_AI_TEST_MODE=false
391+
# JSON mapping of local to production event type IDs (e.g. {"50": 747280} without any string)
392+
RETELL_AI_TEST_EVENT_TYPE_MAP=
393+
RETELL_AI_TEST_CAL_API_KEY=
389394

390395
# Used for buying phone number for cal ai voice agent
391396
STRIPE_PHONE_NUMBER_MONTHLY_PRICE_ID=

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,17 @@ module.exports = {
1919
],
2020
},
2121
},
22+
{
23+
files: ["packages/app-store/**/*.{ts,tsx,js,jsx}"],
24+
rules: {
25+
"no-restricted-imports": [
26+
"warn",
27+
{
28+
paths: ["@calcom/trpc"],
29+
patterns: ["@calcom/trpc/*"],
30+
},
31+
],
32+
},
33+
},
2234
],
2335
};

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
filters: |
3535
has-files-requiring-all-checks:
36-
- "!(**.md|.github/CODEOWNERS|docs/**|help/**|apps/web/public/static/locales/**/common.json|i18n.lock)"
36+
- "!(**.md|**.mdx|.github/CODEOWNERS|docs/**|help/**|apps/web/public/static/locales/**/common.json|i18n.lock)"
3737
- name: Get Latest Commit SHA
3838
id: get_sha
3939
run: |

.yarn/versions/32a5a051.yml

Whitespace-only changes.

.yarn/versions/59e6cbe4.yml

Whitespace-only changes.

apps/api/v1/pages/api/users/[userId]/_patch.ts

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import type { NextApiRequest } from "next";
33
import { HttpError } from "@calcom/lib/http-error";
44
import { uploadAvatar } from "@calcom/lib/server/avatar";
55
import { defaultResponder } from "@calcom/lib/server/defaultResponder";
6-
import { validateBase64Image } from "@calcom/lib/server/imageValidation";
7-
import { resizeBase64Image } from "@calcom/lib/server/resizeBase64Image";
86
import prisma from "@calcom/prisma";
97
import type { Prisma } from "@calcom/prisma/client";
108

@@ -126,25 +124,10 @@ export async function patchHandler(req: NextApiRequest) {
126124
}
127125

128126
if (avatar) {
129-
const validation = validateBase64Image(avatar);
130-
if (!validation.isValid) {
131-
throw new HttpError({
132-
statusCode: 400,
133-
message: `Invalid avatar image: ${validation.error}`,
134-
});
135-
}
136-
137-
try {
138-
body.avatarUrl = await uploadAvatar({
139-
userId: query.userId,
140-
avatar: await resizeBase64Image(avatar),
141-
});
142-
} catch (error) {
143-
throw new HttpError({
144-
statusCode: 400,
145-
message: error instanceof Error ? error.message : "Failed to upload avatar",
146-
});
147-
}
127+
body.avatarUrl = await uploadAvatar({
128+
userId: query.userId,
129+
avatar: await (await import("@calcom/lib/server/resizeBase64Image")).resizeBase64Image(avatar),
130+
});
148131
}
149132

150133
const data = await prisma.user.update({

apps/api/v2/package.json

Lines changed: 4 additions & 4 deletions
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.335",
41+
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.347",
4242
"@calcom/platform-types": "*",
4343
"@calcom/platform-utils": "*",
4444
"@calcom/prisma": "*",
@@ -55,9 +55,9 @@
5555
"@nestjs/platform-express": "^10.0.0",
5656
"@nestjs/swagger": "^7.3.0",
5757
"@nestjs/throttler": "6.2.1",
58-
"@sentry/nestjs": "^8.37.1",
59-
"@sentry/node": "^8.8.0",
60-
"@sentry/profiling-node": "^8.37.1",
58+
"@sentry/nestjs": "^9.15.0",
59+
"@sentry/node": "^9.15.0",
60+
"@sentry/profiling-node": "^9.15.0",
6161
"@snyk/protect": "latest",
6262
"body-parser": "^1.20.2",
6363
"bull": "^4.12.4",

apps/api/v2/src/ee/bookings/2024-04-15/controllers/bookings.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ import {
5757
getBookingForReschedule,
5858
ErrorCode,
5959
} from "@calcom/platform-libraries";
60+
import { CreationSource } from "@calcom/platform-libraries";
6061
import {
6162
GetBookingsInput_2024_04_15,
6263
CancelBookingInput_2024_04_15,
6364
Status_2024_04_15,
6465
} from "@calcom/platform-types";
6566
import { ApiResponse } from "@calcom/platform-types";
6667
import { PrismaClient } from "@calcom/prisma";
67-
import { CreationSource } from "@calcom/prisma/enums";
6868

6969
type BookingRequest = Request & {
7070
userId?: number;

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/booking-fields.e2e-spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ describe("Bookings Endpoints 2024-08-13", () => {
117117
slug: seatedEventTypeSlug,
118118
length: 60,
119119
seatsPerTimeSlot: 3,
120+
seatsShowAttendees: true,
120121
},
121122
user.id
122123
);

apps/api/v2/src/ee/bookings/2024-08-13/controllers/e2e/seated-bookings.e2e-spec.ts

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ describe("Bookings Endpoints 2024-08-13", () => {
5353
let apiKeyString: string;
5454

5555
let seatedEventTypeId: number;
56+
let seatedEventTypeIdAttendeesDisabledId: number;
5657

5758
const seatedEventSlug = `seated-bookings-event-type-${randomString()}`;
59+
const seatedEventSlugAttendeesDisabled = `seated-bookings-event-type-attendees-disabled-${randomString()}`;
5860

5961
let createdSeatedBooking: CreateSeatedBookingOutput_2024_08_13;
6062
let createdSeatedBooking2: CreateSeatedBookingOutput_2024_08_13;
@@ -121,6 +123,28 @@ describe("Bookings Endpoints 2024-08-13", () => {
121123
);
122124
seatedEventTypeId = seatedEvent.id;
123125

126+
const seatedEventAttendeesDisabled = await eventTypesRepositoryFixture.create(
127+
{
128+
title: `seated-bookings-2024-08-13-event-type-attendees-disabled-${randomString()}`,
129+
slug: seatedEventSlugAttendeesDisabled,
130+
length: 60,
131+
seatsPerTimeSlot: 5,
132+
seatsShowAttendees: false,
133+
seatsShowAvailabilityCount: false,
134+
locations: [{ type: "inPerson", address: "via 10, rome, italy" }],
135+
metadata: {
136+
disableStandardEmails: {
137+
all: {
138+
attendee: true,
139+
host: true,
140+
},
141+
},
142+
},
143+
},
144+
user.id
145+
);
146+
seatedEventTypeIdAttendeesDisabledId = seatedEventAttendeesDisabled.id;
147+
124148
app = moduleRef.createNestApplication();
125149
bootstrap(app as NestExpressApplication);
126150

@@ -414,6 +438,63 @@ describe("Bookings Endpoints 2024-08-13", () => {
414438
});
415439
});
416440

441+
it("should book an event type with attendees disabled", async () => {
442+
const body: CreateBookingInput_2024_08_13 = {
443+
start: new Date(Date.UTC(2030, 0, 9, 14, 0, 0)).toISOString(),
444+
eventTypeId: seatedEventTypeIdAttendeesDisabledId,
445+
attendee: {
446+
name: nameAttendeeOne,
447+
email: emailAttendeeOne,
448+
timeZone: "Europe/Rome",
449+
language: "it",
450+
},
451+
bookingFieldsResponses: {
452+
codingLanguage: "TypeScript",
453+
},
454+
metadata: {
455+
userId: "100",
456+
},
457+
};
458+
459+
return request(app.getHttpServer())
460+
.post("/v2/bookings")
461+
.send(body)
462+
.set(CAL_API_VERSION_HEADER, VERSION_2024_08_13)
463+
.expect(201)
464+
.then(async (response) => {
465+
const responseBody: CreateBookingOutput_2024_08_13 = response.body;
466+
expect(responseBody.status).toEqual(SUCCESS_STATUS);
467+
expect(responseBody.data).toBeDefined();
468+
expect(responseDataIsCreateSeatedBooking(responseBody.data)).toBe(true);
469+
470+
if (responseDataIsCreateSeatedBooking(responseBody.data)) {
471+
const data: CreateSeatedBookingOutput_2024_08_13 = responseBody.data;
472+
expect(data.seatUid).toBeDefined();
473+
expect(data.id).toBeDefined();
474+
expect(data.uid).toBeDefined();
475+
expect(data.hosts[0].id).toEqual(user.id);
476+
expect(data.status).toEqual("accepted");
477+
expect(data.start).toEqual(body.start);
478+
expect(data.end).toEqual(
479+
DateTime.fromISO(body.start, { zone: "utc" }).plus({ hours: 1 }).toISO()
480+
);
481+
expect(data.duration).toEqual(60);
482+
expect(data.eventTypeId).toEqual(seatedEventTypeIdAttendeesDisabledId);
483+
expect(data.eventType).toEqual({
484+
id: seatedEventTypeIdAttendeesDisabledId,
485+
slug: seatedEventSlugAttendeesDisabled,
486+
});
487+
expect(data.attendees.length).toEqual(0);
488+
expect(data.location).toBeDefined();
489+
expect(data.absentHost).toEqual(false);
490+
} else {
491+
throw new Error(
492+
"Invalid response data - expected seated booking but received non array response"
493+
);
494+
}
495+
});
496+
});
497+
417498
describe("cancel seated booking", () => {
418499
describe("cancel seated booking as attendee", () => {
419500
it("should cancel seated booking", async () => {

0 commit comments

Comments
 (0)