Skip to content

Commit f3f5523

Browse files
authored
fix: add missing OpenAPI ApiParam decorators to API v2 controllers (calcom#28305)
* fix: add missing apiparam decorators * chore: move api param to class level * revert oasdiff * chore * fix: update oasdiff-err-ignore.txt * chore
1 parent e756141 commit f3f5523

21 files changed

Lines changed: 689 additions & 27 deletions

.github/oasdiff-err-ignore.txt

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,80 @@ PATCH /v2/webhooks/{webhookId} removed the enum value 'RECORDING_TRANSCRIPTION_G
250250
PATCH /v2/webhooks/{webhookId} removed the enum value 'WRONG_ASSIGNMENT_REPORT' of the request property 'triggers'
251251
PATCH /v2/webhooks/{webhookId} the 'triggers' request property type/format changed from 'string'/'' to 'array'/''
252252
PATCH /v2/webhooks/{webhookId} the 'data/triggers/items/' response's property type/format changed from 'object'/'' to 'string'/'' for status '200'
253+
DELETE /v2/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'eventTypeId'
254+
GET /v2/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'eventTypeId'
255+
PATCH /v2/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'eventTypeId'
256+
DELETE /v2/oauth-clients/{clientId}/webhooks/{webhookId} added the new path request parameter 'clientId'
257+
GET /v2/oauth-clients/{clientId}/webhooks/{webhookId} added the new path request parameter 'clientId'
258+
PATCH /v2/oauth-clients/{clientId}/webhooks/{webhookId} added the new path request parameter 'clientId'
259+
DELETE /v2/organizations/{orgId}/organizations/{managedOrganizationId} added the new path request parameter 'orgId'
260+
GET /v2/organizations/{orgId}/organizations/{managedOrganizationId} added the new path request parameter 'orgId'
261+
GET /v2/organizations/{orgId}/teams/{teamId} added the new path request parameter 'orgId'
262+
GET /v2/organizations/{orgId}/teams/{teamId} added the new path request parameter 'teamId'
263+
GET /v2/organizations/{orgId}/teams/{teamId}/bookings/{bookingUid}/references added the new path request parameter 'orgId'
264+
GET /v2/organizations/{orgId}/teams/{teamId}/bookings/{bookingUid}/references added the new path request parameter 'teamId'
265+
GET /v2/organizations/{orgId}/teams/{teamId}/conferencing added the new path request parameter 'orgId'
266+
GET /v2/organizations/{orgId}/teams/{teamId}/conferencing/default added the new path request parameter 'orgId'
267+
POST /v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/default added the new path request parameter 'orgId'
268+
DELETE /v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/disconnect added the new path request parameter 'orgId'
269+
GET /v2/organizations/{orgId}/teams/{teamId}/conferencing/{app}/oauth/auth-url for the 'path' request parameter 'orgId', the type/format was changed from 'string'/'' to 'number'/''
270+
GET /v2/organizations/{orgId}/teams/{teamId}/event-types added the new path request parameter 'orgId'
271+
DELETE /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId} added the new path request parameter 'orgId'
272+
GET /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId} added the new path request parameter 'orgId'
273+
PATCH /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId} added the new path request parameter 'orgId'
274+
POST /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/create-phone-call added the new path request parameter 'teamId'
275+
GET /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/private-links added the new path request parameter 'orgId'
276+
POST /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/private-links added the new path request parameter 'orgId'
277+
DELETE /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/private-links/{linkId} added the new path request parameter 'orgId'
278+
PATCH /v2/organizations/{orgId}/teams/{teamId}/event-types/{eventTypeId}/private-links/{linkId} added the new path request parameter 'orgId'
279+
PATCH /v2/organizations/{orgId}/teams/{teamId}/routing-forms/{routingFormId}/responses/{responseId} added the new path request parameter 'orgId'
280+
GET /v2/organizations/{orgId}/teams/{teamId}/stripe/check added the new path request parameter 'orgId'
281+
GET /v2/organizations/{orgId}/teams/{teamId}/stripe/connect for the 'path' request parameter 'orgId', the type/format was changed from 'string'/'' to 'number'/''
282+
GET /v2/organizations/{orgId}/teams/{teamId}/stripe/save added the new path request parameter 'orgId'
283+
GET /v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails added the new path request parameter 'orgId'
284+
POST /v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/verification-code/request added the new path request parameter 'orgId'
285+
POST /v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/verification-code/request added the new path request parameter 'teamId'
286+
POST /v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/verification-code/verify added the new path request parameter 'orgId'
287+
GET /v2/organizations/{orgId}/teams/{teamId}/verified-resources/emails/{id} added the new path request parameter 'orgId'
288+
GET /v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones added the new path request parameter 'orgId'
289+
POST /v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/request added the new path request parameter 'orgId'
290+
POST /v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/request added the new path request parameter 'teamId'
291+
POST /v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/verification-code/verify added the new path request parameter 'orgId'
292+
GET /v2/organizations/{orgId}/teams/{teamId}/verified-resources/phones/{id} added the new path request parameter 'orgId'
293+
POST /v2/organizations/{orgId}/teams/{teamId}/workflows added the new path request parameter 'orgId'
294+
POST /v2/organizations/{orgId}/teams/{teamId}/workflows/routing-form added the new path request parameter 'orgId'
295+
DELETE /v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId} added the new path request parameter 'orgId'
296+
GET /v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId} added the new path request parameter 'orgId'
297+
PATCH /v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId} added the new path request parameter 'orgId'
298+
DELETE /v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form added the new path request parameter 'orgId'
299+
GET /v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form added the new path request parameter 'orgId'
300+
PATCH /v2/organizations/{orgId}/teams/{teamId}/workflows/{workflowId}/routing-form added the new path request parameter 'orgId'
301+
POST /v2/organizations/{orgId}/users added the new path request parameter 'orgId'
302+
GET /v2/organizations/{orgId}/users/{userId}/ooo added the new path request parameter 'orgId'
303+
POST /v2/organizations/{orgId}/users/{userId}/ooo added the new path request parameter 'orgId'
304+
DELETE /v2/organizations/{orgId}/users/{userId}/ooo/{oooId} added the new path request parameter 'orgId'
305+
DELETE /v2/organizations/{orgId}/users/{userId}/ooo/{oooId} added the new path request parameter 'userId'
306+
PATCH /v2/organizations/{orgId}/users/{userId}/ooo/{oooId} added the new path request parameter 'orgId'
307+
GET /v2/organizations/{orgId}/users/{userId}/schedules added the new path request parameter 'orgId'
308+
POST /v2/organizations/{orgId}/users/{userId}/schedules added the new path request parameter 'orgId'
309+
DELETE /v2/organizations/{orgId}/users/{userId}/schedules/{scheduleId} added the new path request parameter 'orgId'
310+
GET /v2/organizations/{orgId}/users/{userId}/schedules/{scheduleId} added the new path request parameter 'orgId'
311+
PATCH /v2/organizations/{orgId}/users/{userId}/schedules/{scheduleId} added the new path request parameter 'orgId'
312+
DELETE /v2/organizations/{orgId}/webhooks/{webhookId} added the new path request parameter 'orgId'
313+
GET /v2/organizations/{orgId}/webhooks/{webhookId} added the new path request parameter 'orgId'
314+
PATCH /v2/organizations/{orgId}/webhooks/{webhookId} added the new path request parameter 'orgId'
315+
POST /v2/teams/{teamId}/event-types/{eventTypeId}/create-phone-call added the new path request parameter 'teamId'
316+
DELETE /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks added the new path request parameter 'teamId'
317+
GET /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks added the new path request parameter 'teamId'
318+
POST /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks added the new path request parameter 'teamId'
319+
DELETE /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'eventTypeId'
320+
DELETE /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'teamId'
321+
GET /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'eventTypeId'
322+
GET /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'teamId'
323+
PATCH /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'eventTypeId'
324+
PATCH /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'teamId'
325+
POST /v2/teams/{teamId}/verified-resources/emails/verification-code/request added the new path request parameter 'teamId'
326+
POST /v2/teams/{teamId}/verified-resources/phones/verification-code/request added the new path request parameter 'teamId'
253327
GET /v2/organizations/{orgId}/routing-forms/{routingFormId}/responses the 'data' response's property type/format changed from 'object'/'' to 'array'/'' for status '200'
254328
GET /v2/organizations/{orgId}/routing-forms/{routingFormId}/responses removed the required property 'data/createdAt' from the response with the '200' status
255329
GET /v2/organizations/{orgId}/routing-forms/{routingFormId}/responses removed the required property 'data/formFillerId' from the response with the '200' status

apps/api/v2/src/ee/event-types-private-links/controllers/organizations-event-types-private-links.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { RolesGuard } from "@/modules/auth/guards/roles/roles.guard";
1414
import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard";
1515
import { TeamsEventTypesService } from "@/modules/teams/event-types/services/teams-event-types.service";
1616
import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post, UseGuards } from "@nestjs/common";
17-
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
17+
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
1818

1919
import { SUCCESS_STATUS } from "@calcom/platform-constants";
2020
import {
@@ -36,6 +36,7 @@ import { PrivateLinksService } from "../services/private-links.service";
3636
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
3737
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
3838
@ApiHeader(OPTIONAL_API_KEY_HEADER)
39+
@ApiParam({ name: "orgId", type: Number, required: true })
3940
export class OrganizationsEventTypesPrivateLinksController {
4041
constructor(
4142
private readonly privateLinksService: PrivateLinksService,

apps/api/v2/src/modules/event-types/controllers/event-types-webhooks.controller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import type { Webhook } from "@calcom/prisma/client";
4040
@UseGuards(ApiAuthGuard, IsUserEventTypeWebhookGuard)
4141
@DocsTags("Event Types / Webhooks")
4242
@ApiHeader(API_KEY_OR_ACCESS_TOKEN_HEADER)
43+
@ApiParam({ name: "eventTypeId", type: Number, required: true })
4344
export class EventTypeWebhooksController {
4445
constructor(
4546
private readonly webhooksService: WebhooksService,

apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-webhooks/oauth-client-webhooks.controller.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { OAuthClientGuard } from "../../guards/oauth-client-guard";
3636
description: "OAuth client secret key",
3737
required: true,
3838
})
39+
@ApiParam({ name: "clientId", type: String, required: true })
3940
export class OAuthClientWebhooksController {
4041
constructor(
4142
private readonly webhooksService: WebhooksService,

apps/api/v2/src/modules/organizations/conferencing/organizations-conferencing.controller.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export type OAuthCallbackState = {
6161
version: API_VERSIONS_VALUES,
6262
})
6363
@DocsTags("Orgs / Teams / Conferencing")
64+
@ApiParam({ name: "orgId", type: Number, required: true })
6465
export class OrganizationsConferencingController {
6566
constructor(
6667
private readonly conferencingService: ConferencingService,
@@ -184,12 +185,6 @@ export class OrganizationsConferencingController {
184185
@Get("/teams/:teamId/conferencing/default")
185186
@HttpCode(HttpStatus.OK)
186187
@ApiOperation({ summary: "Get team default conferencing application" })
187-
@ApiParam({
188-
name: "app",
189-
description: "Conferencing application type",
190-
enum: [GOOGLE_MEET, ZOOM, OFFICE_365_VIDEO, CAL_VIDEO],
191-
required: true,
192-
})
193188
async getTeamDefaultApp(
194189
@GetUser() user: UserWithProfile,
195190
@Param("teamId", ParseIntPipe) teamId: number

apps/api/v2/src/modules/organizations/event-types/organizations-event-types.controller.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
Query,
4242
Logger,
4343
} from "@nestjs/common";
44-
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
44+
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
4545

4646
import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";
4747
import { handleCreatePhoneCall } from "@calcom/platform-libraries";
@@ -66,6 +66,7 @@ export type EventTypeHandlerResponse = {
6666
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
6767
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
6868
@ApiHeader(OPTIONAL_API_KEY_HEADER)
69+
@ApiParam({ name: "orgId", type: Number, required: true })
6970
export class OrganizationsEventTypesController {
7071
private readonly logger = new Logger("OrganizationsEventTypesController");
7172

@@ -136,6 +137,7 @@ export class OrganizationsEventTypesController {
136137
@Post("/teams/:teamId/event-types/:eventTypeId/create-phone-call")
137138
@UseGuards(ApiAuthGuard, IsOrgGuard, IsTeamInOrg, RolesGuard)
138139
@ApiOperation({ summary: "Create a phone call" })
140+
@ApiParam({ name: "teamId", type: Number, required: true })
139141
async createPhoneCall(
140142
@Param("eventTypeId") eventTypeId: number,
141143
@Param("orgId", ParseIntPipe) orgId: number,

apps/api/v2/src/modules/organizations/organizations/organizations-organizations.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
Query,
1515
UseGuards,
1616
} from "@nestjs/common";
17-
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
17+
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
1818
import { API_VERSIONS_VALUES } from "@/lib/api-versions";
1919
import { X_CAL_CLIENT_ID_HEADER, X_CAL_SECRET_KEY_HEADER } from "@/lib/docs/headers";
2020
import { Throttle } from "@/lib/endpoint-throttler-decorator";
@@ -46,6 +46,7 @@ const SCALE = "SCALE";
4646
@DocsTags("Managed Orgs")
4747
@ApiHeader(X_CAL_CLIENT_ID_HEADER)
4848
@ApiHeader(X_CAL_SECRET_KEY_HEADER)
49+
@ApiParam({ name: "orgId", type: Number, required: true })
4950
export class OrganizationsOrganizationsController {
5051
constructor(private readonly managedOrganizationsService: ManagedOrganizationsService) {}
5152

apps/api/v2/src/modules/organizations/schedules/organizations-schedules.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
HttpStatus,
2929
Query,
3030
} from "@nestjs/common";
31-
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
31+
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
3232

3333
import { SUCCESS_STATUS } from "@calcom/platform-constants";
3434
import {
@@ -50,6 +50,7 @@ import { SkipTakePagination } from "@calcom/platform-types";
5050
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
5151
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
5252
@ApiHeader(OPTIONAL_API_KEY_HEADER)
53+
@ApiParam({ name: "orgId", type: Number, required: true })
5354
export class OrganizationsSchedulesController {
5455
constructor(
5556
private schedulesService: SchedulesService_2024_06_11,

apps/api/v2/src/modules/organizations/stripe/organizations-stripe.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
Redirect,
3434
BadRequestException,
3535
} from "@nestjs/common";
36-
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
36+
import { ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
3737
import { plainToClass } from "class-transformer";
3838
import { Request } from "express";
3939
import { stringify } from "querystring";
@@ -54,6 +54,7 @@ export type OAuthCallbackState = {
5454
version: API_VERSIONS_VALUES,
5555
})
5656
@DocsTags("Orgs / Teams / Stripe")
57+
@ApiParam({ name: "orgId", type: Number, required: true })
5758
export class OrganizationsStripeController {
5859
constructor(
5960
private readonly organizationsStripeService: OrganizationsStripeService,

apps/api/v2/src/modules/organizations/teams/bookings/organizations-teams-bookings.controller.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { IsTeamInOrg } from "@/modules/auth/guards/teams/is-team-in-org.guard";
2323
import { GetOrganizationsTeamsBookingsInput_2024_08_13 } from "@/modules/organizations/teams/bookings/inputs/get-organizations-teams-bookings.input";
2424
import { UserWithProfile } from "@/modules/users/users.repository";
2525
import { Controller, UseGuards, Get, Param, ParseIntPipe, Query, HttpStatus, HttpCode } from "@nestjs/common";
26-
import { ApiHeader, ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
26+
import { ApiHeader, ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger";
2727

2828
import { SUCCESS_STATUS, BOOKING_READ } from "@calcom/platform-constants";
2929
import { GetBookingsOutput_2024_08_13 } from "@calcom/platform-types";
@@ -37,6 +37,8 @@ import { GetBookingsOutput_2024_08_13 } from "@calcom/platform-types";
3737
@ApiHeader(OPTIONAL_X_CAL_CLIENT_ID_HEADER)
3838
@ApiHeader(OPTIONAL_X_CAL_SECRET_KEY_HEADER)
3939
@ApiHeader(OPTIONAL_API_KEY_HEADER)
40+
@ApiParam({ name: "orgId", type: Number, required: true })
41+
@ApiParam({ name: "teamId", type: Number, required: true })
4042
export class OrganizationsTeamsBookingsController {
4143
constructor(
4244
private readonly bookingsService: BookingsService_2024_08_13,

0 commit comments

Comments
 (0)