From 413aba6e52757f088bd74479f3ad37cd18c1d728 Mon Sep 17 00:00:00 2001 From: Somay Chauhan Date: Wed, 19 Mar 2025 02:11:35 +0530 Subject: [PATCH] fix: add documentation to the possible values of :app in conferencing controller (#20164) Co-authored-by: Keith Williams --- .../controllers/conferencing.controller.ts | 34 +++++++++++++++++-- apps/api/v2/swagger/documentation.json | 27 +++++++++++++++ docs/api-reference/v2/openapi.json | 10 ++++++ 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/apps/api/v2/src/modules/conferencing/controllers/conferencing.controller.ts b/apps/api/v2/src/modules/conferencing/controllers/conferencing.controller.ts index fead0f07e3..dd42e671b0 100644 --- a/apps/api/v2/src/modules/conferencing/controllers/conferencing.controller.ts +++ b/apps/api/v2/src/modules/conferencing/controllers/conferencing.controller.ts @@ -37,11 +37,11 @@ import { Req, HttpException, } from "@nestjs/common"; -import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger"; +import { ApiOperation, ApiParam, ApiTags as DocsTags } from "@nestjs/swagger"; import { plainToInstance } from "class-transformer"; import { Request } from "express"; -import { GOOGLE_MEET, ZOOM, SUCCESS_STATUS, OFFICE_365_VIDEO } from "@calcom/platform-constants"; +import { GOOGLE_MEET, ZOOM, SUCCESS_STATUS, OFFICE_365_VIDEO, CAL_VIDEO } from "@calcom/platform-constants"; export type OAuthCallbackState = { accessToken: string; @@ -71,6 +71,12 @@ export class ConferencingController { @HttpCode(HttpStatus.OK) @UseGuards(ApiAuthGuard) @ApiOperation({ summary: "Connect your conferencing application" }) + @ApiParam({ + name: "app", + description: "Conferencing application type", + enum: [GOOGLE_MEET], + required: true, + }) async connect( @GetUser("id") userId: number, @Param("app") app: string @@ -93,6 +99,12 @@ export class ConferencingController { @HttpCode(HttpStatus.OK) @UseGuards(ApiAuthGuard) @ApiOperation({ summary: "Get OAuth conferencing app auth url" }) + @ApiParam({ + name: "app", + description: "Conferencing application type", + enum: [ZOOM, OFFICE_365_VIDEO], + required: true, + }) async redirect( @Req() req: Request, @Headers("Authorization") authorization: string, @@ -138,6 +150,12 @@ export class ConferencingController { @UseGuards() @Redirect(undefined, 301) @ApiOperation({ summary: "conferencing apps oauths callback" }) + @ApiParam({ + name: "app", + description: "Conferencing application type", + enum: [ZOOM, OFFICE_365_VIDEO], + required: true, + }) async save( @Query("state") state: string, @Param("app") app: string, @@ -203,6 +221,12 @@ export class ConferencingController { @HttpCode(HttpStatus.OK) @UseGuards(ApiAuthGuard) @ApiOperation({ summary: "Set your default conferencing application" }) + @ApiParam({ + name: "app", + description: "Conferencing application type", + enum: [GOOGLE_MEET, ZOOM, OFFICE_365_VIDEO, CAL_VIDEO], + required: true, + }) async default( @GetUser() user: UserWithProfile, @Param("app") app: string @@ -224,6 +248,12 @@ export class ConferencingController { @HttpCode(HttpStatus.OK) @UseGuards(ApiAuthGuard) @ApiOperation({ summary: "Disconnect your conferencing application" }) + @ApiParam({ + name: "app", + description: "Conferencing application type", + enum: [GOOGLE_MEET, ZOOM, OFFICE_365_VIDEO], + required: true, + }) async disconnect( @GetUser() user: UserWithProfile, @Param("app") app: string diff --git a/apps/api/v2/swagger/documentation.json b/apps/api/v2/swagger/documentation.json index 6ca4ad0acd..1103394076 100644 --- a/apps/api/v2/swagger/documentation.json +++ b/apps/api/v2/swagger/documentation.json @@ -4742,7 +4742,11 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": [ + "google-meet" + ], "type": "string" } } @@ -4781,7 +4785,12 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": [ + "zoom", + "msteams" + ], "type": "string" } }, @@ -4836,7 +4845,12 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": [ + "zoom", + "msteams" + ], "type": "string" } }, @@ -4890,7 +4904,14 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": [ + "google-meet", + "zoom", + "msteams", + "daily-video" + ], "type": "string" } } @@ -4943,7 +4964,13 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": [ + "google-meet", + "zoom", + "msteams" + ], "type": "string" } } diff --git a/docs/api-reference/v2/openapi.json b/docs/api-reference/v2/openapi.json index d6481110e1..fd2f273549 100644 --- a/docs/api-reference/v2/openapi.json +++ b/docs/api-reference/v2/openapi.json @@ -4472,7 +4472,9 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": ["google-meet"], "type": "string" } } @@ -4509,7 +4511,9 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": ["zoom", "msteams"], "type": "string" } }, @@ -4562,7 +4566,9 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": ["zoom", "msteams"], "type": "string" } }, @@ -4612,7 +4618,9 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": ["google-meet", "zoom", "msteams", "daily-video"], "type": "string" } } @@ -4661,7 +4669,9 @@ "name": "app", "required": true, "in": "path", + "description": "Conferencing application type", "schema": { + "enum": ["google-meet", "zoom", "msteams"], "type": "string" } }