Skip to content

Commit b2ac227

Browse files
authored
fix: add missing api v2 swagger DTOs (calcom#24065)
1 parent f0aec4e commit b2ac227

11 files changed

Lines changed: 658 additions & 975 deletions

File tree

apps/api/v2/src/ee/bookings/2024-08-13/outputs/reassign-booking.output.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { ApiProperty, getSchemaPath } from "@nestjs/swagger";
1+
import { ApiExtraModels, ApiProperty, getSchemaPath } from "@nestjs/swagger";
22
import { Type } from "class-transformer";
33
import { IsEnum, ValidateNested } from "class-validator";
44

55
import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants";
66
import { ReassignBookingOutput_2024_08_13 as ReassignBookingOutputData_2024_08_13 } from "@calcom/platform-types";
77

8+
@ApiExtraModels(ReassignBookingOutputData_2024_08_13)
89
export class ReassignBookingOutput_2024_08_13 {
910
@ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
1011
@IsEnum([SUCCESS_STATUS, ERROR_STATUS])

apps/api/v2/src/ee/bookings/2024-08-13/outputs/reschedule-booking.output.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import {
77
BookingOutput_2024_08_13,
88
CreateRecurringSeatedBookingOutput_2024_08_13,
99
CreateSeatedBookingOutput_2024_08_13,
10-
GetRecurringSeatedBookingOutput_2024_08_13,
11-
GetSeatedBookingOutput_2024_08_13,
1210
RecurringBookingOutput_2024_08_13,
1311
} from "@calcom/platform-types";
1412

apps/api/v2/src/modules/cal-unified-calendars/outputs/get-unified-calendar-event.output.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ApiProperty, ApiPropertyOptional, getSchemaPath } from "@nestjs/swagger";
1+
import { ApiExtraModels, ApiProperty, ApiPropertyOptional, getSchemaPath } from "@nestjs/swagger";
22
import { Type } from "class-transformer";
33
import { IsEnum, IsISO8601, IsOptional, IsString, ValidateNested } from "class-validator";
44

@@ -297,6 +297,12 @@ export class DateTimeWithZone {
297297
timeZone!: string;
298298
}
299299

300+
@ApiExtraModels(
301+
CalendarEventVideoLocation,
302+
CalendarEventPhoneLocation,
303+
CalendarEventSipLocation,
304+
CalendarEventMoreLocation
305+
)
300306
export class UnifiedCalendarEventOutput {
301307
@ValidateNested()
302308
@Type(() => DateTimeWithZone)

apps/api/v2/src/modules/organizations/delegation-credentials/inputs/create-delegation-credential.input.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import {
44
MicrosoftServiceAccountKeyInput,
55
} from "@/modules/organizations/delegation-credentials/inputs/service-account-key.input";
66
import { ApiProperty, getSchemaPath } from "@nestjs/swagger";
7+
import { ApiExtraModels } from "@nestjs/swagger";
78
import { Expose, Type } from "class-transformer";
8-
import { IsString, IsNotEmpty, ValidateNested, Validate } from "class-validator";
9+
import { IsString, IsNotEmpty, Validate } from "class-validator";
910

11+
@ApiExtraModels(GoogleServiceAccountKeyInput, MicrosoftServiceAccountKeyInput)
1012
export class CreateDelegationCredentialInput {
1113
@IsString()
1214
@IsNotEmpty()

apps/api/v2/src/modules/organizations/delegation-credentials/inputs/update-delegation-credential.input.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import {
33
MicrosoftServiceAccountKeyInput,
44
ServiceAccountKeyValidator,
55
} from "@/modules/organizations/delegation-credentials/inputs/service-account-key.input";
6-
import { ApiPropertyOptional, getSchemaPath } from "@nestjs/swagger";
7-
import { Expose, plainToClass, Transform, Type } from "class-transformer";
8-
import { IsBoolean, IsOptional, Validate, ValidateNested } from "class-validator";
6+
import { ApiExtraModels, ApiPropertyOptional, getSchemaPath } from "@nestjs/swagger";
7+
import { Expose, Type } from "class-transformer";
8+
import { IsBoolean, IsOptional, Validate } from "class-validator";
99

10+
@ApiExtraModels(GoogleServiceAccountKeyInput, MicrosoftServiceAccountKeyInput)
1011
export class UpdateDelegationCredentialInput {
1112
@IsBoolean()
1213
@IsOptional()

apps/api/v2/src/modules/organizations/routing-forms/outputs/create-routing-form-response.output.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ApiProperty, ApiPropertyOptional, getSchemaPath } from "@nestjs/swagger";
1+
import { ApiExtraModels, ApiProperty, ApiPropertyOptional, getSchemaPath } from "@nestjs/swagger";
22
import { Type } from "class-transformer";
33
import { IsArray, IsBoolean, IsInt, IsNumber, IsOptional, IsString, ValidateNested } from "class-validator";
44

@@ -75,6 +75,7 @@ class Routing {
7575
crmOwnerRecordType?: string;
7676
}
7777

78+
@ApiExtraModels(SlotsOutput_2024_09_04, RangeSlotsOutput_2024_09_04)
7879
export class CreateRoutingFormResponseOutputData {
7980
@ApiPropertyOptional({
8081
type: Number,

apps/api/v2/src/modules/teams/event-types/outputs/create-team-event-type.output.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { ApiProperty, getSchemaPath } from "@nestjs/swagger";
1+
import { ApiExtraModels, ApiProperty, getSchemaPath } from "@nestjs/swagger";
22
import { Type } from "class-transformer";
33
import { IsNotEmptyObject, ValidateNested } from "class-validator";
44

55
import { ApiResponseWithoutData, TeamEventTypeOutput_2024_06_14 } from "@calcom/platform-types";
66

7+
@ApiExtraModels(TeamEventTypeOutput_2024_06_14)
78
export class CreateTeamEventTypeOutput extends ApiResponseWithoutData {
89
@IsNotEmptyObject()
910
@ValidateNested()

apps/api/v2/src/modules/teams/event-types/outputs/update-team-event-type.output.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { ApiProperty, getSchemaPath } from "@nestjs/swagger";
1+
import { ApiExtraModels, ApiProperty, getSchemaPath } from "@nestjs/swagger";
22
import { Type } from "class-transformer";
33
import { IsNotEmptyObject, ValidateNested } from "class-validator";
44

55
import { ApiResponseWithoutData, TeamEventTypeOutput_2024_06_14 } from "@calcom/platform-types";
66

7+
@ApiExtraModels(TeamEventTypeOutput_2024_06_14)
78
export class UpdateTeamEventTypeOutput extends ApiResponseWithoutData {
89
@IsNotEmptyObject()
910
@ValidateNested()

apps/api/v2/src/modules/teams/teams/outputs/teams/create-team.output.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { ApiProperty, getSchemaPath } from "@nestjs/swagger";
1+
import { ApiExtraModels, ApiProperty, getSchemaPath } from "@nestjs/swagger";
22
import { Expose } from "class-transformer";
33
import { IsEnum, ValidateNested, IsString, IsUrl } from "class-validator";
44

55
import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";
66
import { TeamOutputDto } from "@calcom/platform-types";
77

8-
class Output {
8+
class CreateTeamOutputData {
99
@Expose()
1010
@IsString()
1111
message!: string;
@@ -19,16 +19,17 @@ class Output {
1919
pendingTeam!: TeamOutputDto;
2020
}
2121

22+
@ApiExtraModels(TeamOutputDto, CreateTeamOutputData)
2223
export class CreateTeamOutput {
2324
@ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] })
2425
@IsEnum([SUCCESS_STATUS, ERROR_STATUS])
2526
status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS;
2627

2728
@ApiProperty({
28-
oneOf: [{ $ref: getSchemaPath(Output) }, { $ref: getSchemaPath(TeamOutputDto) }],
29+
oneOf: [{ $ref: getSchemaPath(CreateTeamOutputData) }, { $ref: getSchemaPath(TeamOutputDto) }],
2930
description: "Either an Output object or a TeamOutputDto.",
3031
})
3132
@Expose()
3233
@ValidateNested()
33-
data!: Output | TeamOutputDto;
34+
data!: CreateTeamOutputData | TeamOutputDto;
3435
}

0 commit comments

Comments
 (0)