Skip to content

Commit 8de3ac4

Browse files
authored
Merge branch 'main' into verify-email
2 parents 96cd23f + 74288b0 commit 8de3ac4

59 files changed

Lines changed: 333 additions & 219 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.

.yarn/versions/d483660a.yml

Whitespace-only changes.

apps/api/v1/lib/validations/booking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const bookingCancelSchema = z.object({
4141
id: z.number(),
4242
allRemainingBookings: z.boolean().optional(),
4343
cancelSubsequentBookings: z.boolean().optional(),
44-
cancellationReason: z.string().min(1).optional(),
44+
cancellationReason: z.string().optional().default("Not Provided"),
4545
seatReferenceUid: z.string().optional(),
4646
cancelledBy: z.string().email({ message: "Invalid email" }).optional(),
4747
internalNote: z

apps/api/v1/next.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { withAxiom } = require("next-axiom");
22
const { withSentryConfig } = require("@sentry/nextjs");
3+
const { PrismaPlugin } = require("@prisma/nextjs-monorepo-workaround-plugin");
34

45
const plugins = [withAxiom];
56

@@ -14,6 +15,12 @@ const nextConfig = {
1415
"@calcom/prisma",
1516
"@calcom/trpc",
1617
],
18+
webpack: (config, { isServer }) => {
19+
if (isServer) {
20+
config.plugins = [...config.plugins, new PrismaPlugin()];
21+
}
22+
return config;
23+
},
1724
async headers() {
1825
return [
1926
{

apps/api/v1/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@calcom/lib": "*",
3131
"@calcom/prisma": "*",
3232
"@calcom/trpc": "*",
33+
"@prisma/nextjs-monorepo-workaround-plugin": "^6.16.1",
3334
"@sentry/nextjs": "^9.15.0",
3435
"bcryptjs": "^2.4.3",
3536
"memory-cache": "^0.2.0",

apps/api/v2/src/modules/auth/guards/optional-api-auth/optional-api-auth.guard.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
import { ApiAuthGuard } from "@/modules/auth/guards/api-auth/api-auth.guard";
2-
import { NO_AUTH_PROVIDED_MESSAGE } from "@/modules/auth/strategies/api-auth/api-auth.strategy";
2+
import {
3+
NO_AUTH_PROVIDED_MESSAGE,
4+
ONLY_CLIENT_ID_PROVIDED_MESSAGE,
5+
} from "@/modules/auth/strategies/api-auth/api-auth.strategy";
36

47
export class OptionalApiAuthGuard extends ApiAuthGuard {
58
handleRequest(error: Error, user: any) {
69
// note(Lauris): optional means that auth is not required but if it is invalid then still throw error.
710
const noAuthProvided = error && error.message.includes(NO_AUTH_PROVIDED_MESSAGE);
11+
const onlyClientIdProvided = error && error.message.includes(ONLY_CLIENT_ID_PROVIDED_MESSAGE);
12+
13+
if (onlyClientIdProvided) {
14+
return null;
15+
}
16+
817
if (user || noAuthProvided || !error) {
918
return user || null;
1019
} else {

apps/api/v2/src/modules/auth/strategies/api-auth/api-auth.strategy.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export type ApiAuthGuardRequest = Request & {
3232
export const NO_AUTH_PROVIDED_MESSAGE =
3333
"No authentication method provided. Either pass an API key as 'Bearer' header or OAuth client credentials as 'x-cal-secret-key' and 'x-cal-client-id' headers";
3434

35+
export const ONLY_CLIENT_ID_PROVIDED_MESSAGE =
36+
"Only 'x-cal-client-id' header provided. Please also provide 'x-cal-secret-key' header or Auth bearer token as 'Authentication' header";
37+
3538
@Injectable()
3639
export class ApiAuthStrategy extends PassportStrategy(BaseStrategy, "api-auth") {
3740
private readonly logger = new Logger("ApiAuthStrategy");
@@ -117,10 +120,15 @@ export class ApiAuthStrategy extends PassportStrategy(BaseStrategy, "api-auth")
117120
}
118121

119122
const noAuthProvided = !oAuthClientId && !oAuthClientSecret && !bearerToken && !nextAuthToken;
123+
const onlyClientIdProvided = !!oAuthClientId && !oAuthClientSecret && !bearerToken && !nextAuthToken;
120124
if (noAuthProvided) {
121125
throw new UnauthorizedException(`ApiAuthStrategy - ${NO_AUTH_PROVIDED_MESSAGE}`);
122126
}
123127

128+
if (onlyClientIdProvided) {
129+
throw new UnauthorizedException(`ApiAuthStrategy - ${ONLY_CLIENT_ID_PROVIDED_MESSAGE}`);
130+
}
131+
124132
throw new UnauthorizedException(
125133
`ApiAuthStrategy - Invalid authentication method. Please provide one of the allowed methods: ${
126134
allowedMethods && allowedMethods.length > 0 ? allowedMethods.join(", ") : "Any supported method"

apps/web/app/(booking-page-wrapper)/team/[slug]/[type]/queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { GetServerSidePropsContext } from "next";
22
import { unstable_cache } from "next/cache";
33

4+
import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";
45
import { getTeamData } from "@calcom/features/ee/teams/lib/getTeamData";
56
import {
67
getEventTypeHosts,
@@ -17,7 +18,6 @@ import { UserRepository } from "@calcom/lib/server/repository/user";
1718
import { prisma } from "@calcom/prisma";
1819
import type { Prisma } from "@calcom/prisma/client";
1920
import type { SchedulingType } from "@calcom/prisma/enums";
20-
import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/prisma/zod-utils";
2121

2222
export async function getCachedTeamData(teamSlug: string, orgSlug: string | null) {
2323
return unstable_cache(async () => getTeamData(teamSlug, orgSlug), ["team-data", teamSlug, orgSlug ?? ""], {

apps/web/modules/apps/installation/[[...step]]/step-view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { z } from "zod";
99
import checkForMultiplePaymentApps from "@calcom/app-store/_utils/payments/checkForMultiplePaymentApps";
1010
import useAddAppMutation from "@calcom/app-store/_utils/useAddAppMutation";
1111
import type { EventTypeAppSettingsComponentProps, EventTypeModel } from "@calcom/app-store/types";
12+
import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";
1213
import type { LocationFormValues } from "@calcom/features/eventtypes/lib/types";
1314
import { AppOnboardingSteps } from "@calcom/lib/apps/appOnboardingSteps";
1415
import { getAppOnboardingUrl } from "@calcom/lib/apps/getAppOnboardingUrl";
@@ -17,7 +18,6 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
1718
import type { LocationObject } from "@calcom/lib/location";
1819
import type { Team } from "@calcom/prisma/client";
1920
import type { eventTypeBookingFields } from "@calcom/prisma/zod-utils";
20-
import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/prisma/zod-utils";
2121
import type { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
2222
import { trpc } from "@calcom/trpc/react";
2323
import type { AppMeta } from "@calcom/types/App";

apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createRouterCaller } from "app/_trpc/context";
22
import type { GetServerSidePropsContext } from "next";
33
import { z } from "zod";
44

5+
import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";
56
import { orgDomainConfig } from "@calcom/ee/organizations/lib/orgDomains";
67
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
78
import getBookingInfo from "@calcom/features/bookings/lib/getBookingInfo";
@@ -12,7 +13,7 @@ import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
1213
import { maybeGetBookingUidFromSeat } from "@calcom/lib/server/maybeGetBookingUidFromSeat";
1314
import { BookingRepository } from "@calcom/lib/server/repository/booking";
1415
import prisma from "@calcom/prisma";
15-
import { customInputSchema, eventTypeMetaDataSchemaWithTypedApps } from "@calcom/prisma/zod-utils";
16+
import { customInputSchema } from "@calcom/prisma/zod-utils";
1617
import { meRouter } from "@calcom/trpc/server/routers/viewer/me/_router";
1718

1819
import type { inferSSRProps } from "@lib/types/inferSSRProps";

apps/web/modules/bookings/views/bookings-single-view.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager";
1313
import type { getEventLocationValue } from "@calcom/app-store/locations";
1414
import { getSuccessPageLocationMessage, guessEventLocationType } from "@calcom/app-store/locations";
1515
import { getEventTypeAppData } from "@calcom/app-store/utils";
16+
import { eventTypeMetaDataSchemaWithTypedApps } from "@calcom/app-store/zod-utils";
1617
import type { ConfigType } from "@calcom/dayjs";
1718
import dayjs from "@calcom/dayjs";
1819
import {
@@ -45,7 +46,7 @@ import { getIs24hClockFromLocalStorage, isBrowserLocale24h } from "@calcom/lib/t
4546
import { CURRENT_TIMEZONE } from "@calcom/lib/timezoneConstants";
4647
import { localStorage } from "@calcom/lib/webstorage";
4748
import { BookingStatus, SchedulingType } from "@calcom/prisma/enums";
48-
import { bookingMetadataSchema, eventTypeMetaDataSchemaWithTypedApps } from "@calcom/prisma/zod-utils";
49+
import { bookingMetadataSchema } from "@calcom/prisma/zod-utils";
4950
import { trpc } from "@calcom/trpc/react";
5051
import { Alert } from "@calcom/ui/components/alert";
5152
import { Avatar } from "@calcom/ui/components/avatar";

0 commit comments

Comments
 (0)