Skip to content

Commit e395920

Browse files
authored
Merge branch 'main' into feat/team-hidden
2 parents 9246448 + d70fa46 commit e395920

File tree

146 files changed

+2862
-535
lines changed

Some content is hidden

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

146 files changed

+2862
-535
lines changed

.github/workflows/e2e-atoms.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ env:
1313
ATOMS_E2E_API_URL: ${{ secrets.ATOMS_E2E_API_URL }}
1414
ATOMS_E2E_ORG_ID: ${{ secrets.ATOMS_E2E_ORG_ID }}
1515
ATOMS_E2E_OAUTH_CLIENT_ID_BOOKER_EMBED: ${{ secrets.ATOMS_E2E_OAUTH_CLIENT_ID_BOOKER_EMBED }}
16+
ATOMS_E2E_APPLE_ID: ${{ secrets.ATOMS_E2E_APPLE_ID }}
17+
ATOMS_E2E_APPLE_CONNECT_APP_SPECIFIC_PASSCODE: ${{ secrets.ATOMS_E2E_APPLE_CONNECT_APP_SPECIFIC_PASSCODE }}
1618
DATABASE_DIRECT_URL: ${{ secrets.CI_DATABASE_URL }}
1719
DATABASE_URL: ${{ secrets.CI_DATABASE_URL }}
1820

apps/api/v1/lib/helpers/rateLimitApiKey.test.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe("rateLimitApiKey middleware", () => {
3030
query: {},
3131
userId: testUserId,
3232
});
33-
33+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3434
await rateLimitApiKey(req, res, vi.fn() as any);
3535

3636
expect(res._getStatusCode()).toBe(401);
@@ -43,14 +43,15 @@ describe("rateLimitApiKey middleware", () => {
4343
query: { apiKey: "test-key" },
4444
userId: testUserId,
4545
});
46-
46+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4747
(checkRateLimitAndThrowError as any).mockResolvedValueOnce({
4848
limit: 100,
4949
remaining: 99,
5050
reset: Date.now(),
5151
});
5252

5353
// @ts-expect-error weird typing between middleware and createMocks
54+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5455
await rateLimitApiKey(req, res, vi.fn() as any);
5556

5657
expect(checkRateLimitAndThrowError).toHaveBeenCalledWith({
@@ -74,15 +75,14 @@ describe("rateLimitApiKey middleware", () => {
7475
success: true,
7576
};
7677

77-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
78-
// @ts-ignore
78+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
7979
(checkRateLimitAndThrowError as any).mockImplementationOnce(
8080
({ onRateLimiterResponse }: { onRateLimiterResponse: (response: RatelimitResponse) => void }) => {
8181
onRateLimiterResponse(rateLimiterResponse);
8282
}
8383
);
84-
8584
// @ts-expect-error weird typing between middleware and createMocks
85+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8686
await rateLimitApiKey(req, res, vi.fn() as any);
8787

8888
expect(res.getHeader("X-RateLimit-Limit")).toBe(rateLimiterResponse.limit);
@@ -96,10 +96,11 @@ describe("rateLimitApiKey middleware", () => {
9696
query: { apiKey: "test-key" },
9797
userId: testUserId,
9898
});
99-
99+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
100100
(checkRateLimitAndThrowError as any).mockRejectedValue(new Error("Rate limit exceeded"));
101101

102102
// @ts-expect-error weird typing between middleware and createMocks
103+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
103104
await rateLimitApiKey(req, res, vi.fn() as any);
104105

105106
expect(res._getStatusCode()).toBe(429);
@@ -121,6 +122,7 @@ describe("rateLimitApiKey middleware", () => {
121122
};
122123

123124
// Mock rate limiter to trigger the onRateLimiterResponse callback
125+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
124126
(checkRateLimitAndThrowError as any).mockImplementationOnce(
125127
({ onRateLimiterResponse }: { onRateLimiterResponse: (response: RatelimitResponse) => void }) => {
126128
onRateLimiterResponse(rateLimiterResponse);
@@ -131,6 +133,7 @@ describe("rateLimitApiKey middleware", () => {
131133
vi.mocked(handleAutoLock).mockResolvedValueOnce(true);
132134

133135
// @ts-expect-error weird typing between middleware and createMocks
136+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
134137
await rateLimitApiKey(req, res, vi.fn() as any);
135138

136139
expect(handleAutoLock).toHaveBeenCalledWith({
@@ -158,6 +161,7 @@ describe("rateLimitApiKey middleware", () => {
158161
};
159162

160163
// Mock rate limiter to trigger the onRateLimiterResponse callback
164+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
161165
(checkRateLimitAndThrowError as any).mockImplementationOnce(
162166
({ onRateLimiterResponse }: { onRateLimiterResponse: (response: RatelimitResponse) => void }) => {
163167
onRateLimiterResponse(rateLimiterResponse);
@@ -168,6 +172,7 @@ describe("rateLimitApiKey middleware", () => {
168172
vi.mocked(handleAutoLock).mockRejectedValueOnce(new Error("No user found for this API key."));
169173

170174
// @ts-expect-error weird typing between middleware and createMocks
175+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
171176
await rateLimitApiKey(req, res, vi.fn() as any);
172177

173178
expect(handleAutoLock).toHaveBeenCalledWith({
@@ -195,6 +200,7 @@ describe("rateLimitApiKey middleware", () => {
195200
};
196201

197202
// Mock rate limiter to trigger the onRateLimiterResponse callback
203+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
198204
(checkRateLimitAndThrowError as any).mockImplementationOnce(
199205
({ onRateLimiterResponse }: { onRateLimiterResponse: (response: RatelimitResponse) => void }) => {
200206
onRateLimiterResponse(rateLimiterResponse);
@@ -235,6 +241,7 @@ describe("rateLimitApiKey middleware", () => {
235241
);
236242

237243
// @ts-expect-error weird typing between middleware and createMocks
244+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
238245
await rateLimitApiKey(req, res, vi.fn() as any);
239246

240247
expect(res._getStatusCode()).toBe(429);

apps/api/v1/pages/api/bookings/[id]/_get.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ export async function getHandler(req: NextApiRequest) {
102102
const booking = await prisma.booking.findUnique({
103103
where: { id },
104104
include: {
105+
// eslint-disable-next-line @calcom/eslint/no-prisma-include-true
105106
attendees: true,
107+
// eslint-disable-next-line @calcom/eslint/no-prisma-include-true
106108
user: true,
109+
// eslint-disable-next-line @calcom/eslint/no-prisma-include-true
107110
payment: true,
108111
eventType: expand.includes("team") ? { include: { team: true } } : false,
109112
},

apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export async function getHandler(req: NextApiRequest) {
6363

6464
const booking = await prisma.booking.findUnique({
6565
where: { id },
66+
// eslint-disable-next-line @calcom/eslint/no-prisma-include-true
6667
include: { references: true },
6768
});
6869

apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export async function getHandler(req: NextApiRequest) {
6161
const checkIfRecordingBelongsToBooking = async (bookingId: number, recordingId: string) => {
6262
const booking = await prisma.booking.findUnique({
6363
where: { id: bookingId },
64+
// eslint-disable-next-line @calcom/eslint/no-prisma-include-true
6465
include: { references: true },
6566
});
6667

apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export async function getHandler(req: NextApiRequest) {
4444

4545
const booking = await prisma.booking.findUnique({
4646
where: { id },
47+
// eslint-disable-next-line @calcom/eslint/no-prisma-include-true
4748
include: { references: true },
4849
});
4950

apps/api/v1/pages/api/destination-calendars/[id]/_patch.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import type { NextApiRequest } from "next";
22
import type { z } from "zod";
33

4-
import { getCalendarCredentialsWithoutDelegation, getConnectedCalendars } from "@calcom/lib/CalendarManager";
4+
import {
5+
getCalendarCredentialsWithoutDelegation,
6+
getConnectedCalendars,
7+
} from "@calcom/features/calendars/lib/CalendarManager";
58
import { HttpError } from "@calcom/lib/http-error";
69
import { defaultResponder } from "@calcom/lib/server/defaultResponder";
710
import prisma from "@calcom/prisma";

apps/api/v1/pages/api/destination-calendars/_post.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { NextApiRequest } from "next";
22

3-
import { getCalendarCredentialsWithoutDelegation, getConnectedCalendars } from "@calcom/lib/CalendarManager";
3+
import {
4+
getCalendarCredentialsWithoutDelegation,
5+
getConnectedCalendars,
6+
} from "@calcom/features/calendars/lib/CalendarManager";
47
import { HttpError } from "@calcom/lib/http-error";
58
import { defaultResponder } from "@calcom/lib/server/defaultResponder";
69
import prisma from "@calcom/prisma";

apps/api/v1/pages/api/event-types/_get.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ async function getHandler(req: NextApiRequest) {
5555
slug: slug, // slug will be undefined if not provided in query
5656
},
5757
include: {
58+
// eslint-disable-next-line @calcom/eslint/no-prisma-include-true
5859
customInputs: true,
5960
hashedLink: { select: { link: true } },
6061
team: { select: { slug: true } },

apps/api/v1/pages/api/payments/[id].ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export async function paymentById(
4646
if (safeQuery.success && method === "GET") {
4747
const userWithBookings = await prisma.user.findUnique({
4848
where: { id: userId },
49+
// eslint-disable-next-line @calcom/eslint/no-prisma-include-true
4950
include: { bookings: true },
5051
});
5152
await prisma.payment

0 commit comments

Comments
 (0)