diff --git a/apps/api/v2/src/ee/bookings/2024-04-15/inputs/create-booking.input.ts b/apps/api/v2/src/ee/bookings/2024-04-15/inputs/create-booking.input.ts index ed0275acf0..2ae61c8653 100644 --- a/apps/api/v2/src/ee/bookings/2024-04-15/inputs/create-booking.input.ts +++ b/apps/api/v2/src/ee/bookings/2024-04-15/inputs/create-booking.input.ts @@ -1,3 +1,4 @@ +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Transform, Type } from "class-transformer"; import { IsBoolean, @@ -13,53 +14,66 @@ import { class Location { @IsString() + @ApiProperty() optionValue!: string; @IsString() + @ApiProperty() value!: string; } class Response { @IsString() + @ApiProperty() name!: string; @IsEmail() + @ApiProperty() email!: string; @IsArray() @IsString({ each: true }) + @ApiProperty({ type: [String] }) guests!: string[]; @IsOptional() @ValidateNested() @Type(() => Location) + @ApiPropertyOptional({ type: Location }) location?: Location; @IsOptional() @IsString() + @ApiPropertyOptional() notes?: string; } export class CreateBookingInput_2024_04_15 { @IsString() @IsOptional() + @ApiPropertyOptional() end?: string; @IsString() + @ApiProperty() start!: string; @IsNumber() + @ApiProperty() eventTypeId!: number; @IsString() @IsOptional() + @ApiPropertyOptional() eventTypeSlug?: string; @IsString() @IsOptional() + @ApiPropertyOptional() rescheduleUid?: string; @IsTimeZone() + @ApiProperty() timeZone!: string; @Transform(({ value }: { value: string | string[] }) => { @@ -68,38 +82,48 @@ export class CreateBookingInput_2024_04_15 { @IsOptional() @IsArray() @IsString({ each: true }) + @ApiPropertyOptional({ type: [String] }) user?: string[]; @IsString() + @ApiProperty() language!: string; @IsString() @IsOptional() + @ApiPropertyOptional() bookingUid?: string; @IsObject() + @ApiProperty({ type: Object }) metadata!: Record; @IsBoolean() @IsOptional() + @ApiPropertyOptional() hasHashedBookingLink?: boolean; @IsString() @IsOptional() + @ApiPropertyOptional() hashedLink!: string | null; @IsString() @IsOptional() + @ApiPropertyOptional() seatReferenceUid?: string; @Type(() => Response) + @ApiProperty({ type: Response }) responses!: Response; @IsString() @IsOptional() + @ApiPropertyOptional() orgSlug?: string; @IsString() @IsOptional() + @ApiPropertyOptional() locationUrl?: string; } diff --git a/apps/api/v2/src/ee/bookings/2024-04-15/inputs/create-recurring-booking.input.ts b/apps/api/v2/src/ee/bookings/2024-04-15/inputs/create-recurring-booking.input.ts index 7201519bf7..7692748fbe 100644 --- a/apps/api/v2/src/ee/bookings/2024-04-15/inputs/create-recurring-booking.input.ts +++ b/apps/api/v2/src/ee/bookings/2024-04-15/inputs/create-recurring-booking.input.ts @@ -1,4 +1,5 @@ import { CreateBookingInput_2024_04_15 } from "@/ee/bookings/2024-04-15/inputs/create-booking.input"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { IsBoolean, IsString, IsNumber, IsOptional } from "class-validator"; import type { AppsStatus } from "@calcom/platform-libraries"; @@ -6,23 +7,29 @@ import type { AppsStatus } from "@calcom/platform-libraries"; export class CreateRecurringBookingInput_2024_04_15 extends CreateBookingInput_2024_04_15 { @IsBoolean() @IsOptional() + @ApiPropertyOptional() noEmail?: boolean; @IsOptional() @IsNumber() + @ApiPropertyOptional() recurringCount?: number; @IsOptional() + @ApiPropertyOptional({ type: [Object] }) appsStatus?: AppsStatus[] | undefined; @IsOptional() + @ApiPropertyOptional({ type: [Object] }) allRecurringDates?: Record[]; @IsOptional() @IsNumber() + @ApiPropertyOptional() currentRecurringIndex?: number; @IsString() @IsOptional() + @ApiPropertyOptional() recurringEventId?: string; } diff --git a/apps/api/v2/src/ee/bookings/2024-04-15/inputs/mark-no-show.input.ts b/apps/api/v2/src/ee/bookings/2024-04-15/inputs/mark-no-show.input.ts index 017f9edd78..8d8348e124 100644 --- a/apps/api/v2/src/ee/bookings/2024-04-15/inputs/mark-no-show.input.ts +++ b/apps/api/v2/src/ee/bookings/2024-04-15/inputs/mark-no-show.input.ts @@ -1,22 +1,27 @@ +import { ApiPropertyOptional, ApiProperty } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsOptional, IsArray, IsEmail, IsBoolean, ValidateNested } from "class-validator"; class Attendee { @IsEmail() + @ApiProperty() email!: string; @IsBoolean() + @ApiProperty() noShow!: boolean; } export class MarkNoShowInput_2024_04_15 { @IsBoolean() @IsOptional() + @ApiPropertyOptional() noShowHost?: boolean; @ValidateNested() @Type(() => Attendee) @IsArray() @IsOptional() + @ApiPropertyOptional({ type: [Attendee] }) attendees?: Attendee[]; } diff --git a/apps/api/v2/src/ee/bookings/2024-04-15/outputs/get-booking.output.ts b/apps/api/v2/src/ee/bookings/2024-04-15/outputs/get-booking.output.ts index 07e352736e..bf27fa2a18 100644 --- a/apps/api/v2/src/ee/bookings/2024-04-15/outputs/get-booking.output.ts +++ b/apps/api/v2/src/ee/bookings/2024-04-15/outputs/get-booking.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsString, @@ -17,145 +17,185 @@ import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants"; class Metadata { @IsUrl() + @ApiProperty() videoCallUrl!: string; } class Location { @IsString() + @ApiProperty() optionValue!: string; @IsString() + @ApiProperty() value!: string; } class Response { @IsString() + @ApiProperty() name!: string; @IsEmail() + @ApiProperty() email!: string; @IsString() + @ApiProperty() notes!: string; @IsArray() @IsString({ each: true }) + @ApiProperty({ type: [String] }) guests!: string[]; @ValidateNested() @Type(() => Location) + @ApiProperty({ type: Location }) location!: Location; } class User { @IsInt() + @ApiProperty() id!: number; @IsString() + @ApiProperty({ type: String, nullable: true }) name!: string | null; @IsEmail() + @ApiProperty() email!: string; @IsString() + @ApiProperty({ type: String, nullable: true }) username!: string | null; @IsString() + @ApiProperty() timeZone!: string; } class Attendee { @IsString() + @ApiProperty() name!: string; @IsEmail() + @ApiProperty() email!: string; @IsString() + @ApiProperty() timeZone!: string; } class EventType { @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) eventName!: string | null; @IsString() + @ApiProperty() slug!: string; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) timeZone!: string | null; } class GetBookingData_2024_04_15 { @IsString() + @ApiProperty() title!: string; @IsInt() + @ApiProperty() id!: number; @IsString() + @ApiProperty() uid!: string; @IsString() + @ApiProperty({ type: String, nullable: true }) description!: string | null; @IsObject() + @ApiProperty({ type: Object }) customInputs!: any; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) smsReminderNumber!: string | null; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) recurringEventId!: string | null; @IsDateString() + @ApiProperty() startTime!: Date; @IsDateString() + @ApiProperty() endTime!: Date; @IsUrl() + @ApiProperty({ type: String, nullable: true }) location!: string | null; @IsString() + @ApiProperty() status!: string; + @Type(() => Metadata) + @ApiProperty({ type: Metadata }) metadata!: Metadata | any; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) cancellationReason!: string | null; @ValidateNested() @Type(() => Response) + @ApiProperty({ type: Response }) responses!: Response | any; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) rejectionReason!: string | null; @IsString() @IsEmail() + @ApiProperty({ type: String, nullable: true }) userPrimaryEmail!: string | null; @ValidateNested() @Type(() => User) + @ApiProperty({ type: User, nullable: true }) user!: User | null; @ValidateNested() @Type(() => Attendee) @IsArray() + @ApiProperty({ type: [Attendee] }) attendees!: Attendee[]; @IsInt() + @ApiProperty({ type: Number, nullable: true }) eventTypeId!: number | null; @ValidateNested() @Type(() => EventType) + @ApiProperty({ type: EventType, nullable: true }) eventType!: EventType | null; } diff --git a/apps/api/v2/src/ee/bookings/2024-04-15/outputs/get-bookings.output.ts b/apps/api/v2/src/ee/bookings/2024-04-15/outputs/get-bookings.output.ts index 7e27580bc7..91270c24fb 100644 --- a/apps/api/v2/src/ee/bookings/2024-04-15/outputs/get-bookings.output.ts +++ b/apps/api/v2/src/ee/bookings/2024-04-15/outputs/get-bookings.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsString, @@ -26,179 +26,230 @@ enum Status { class Attendee { @IsInt() + @ApiProperty() id!: number; @IsEmail() + @ApiProperty() email!: string; @IsString() + @ApiProperty() name!: string; @IsString() + @ApiProperty() timeZone!: string; @IsString() + @ApiProperty({ type: String, nullable: true }) locale!: string | null; @IsInt() + @ApiProperty({ type: Number, nullable: true }) bookingId!: number | null; } class EventType { - @IsString() @IsOptional() + @IsString() + @ApiPropertyOptional() slug?: string; @IsOptional() @IsInt() + @ApiPropertyOptional() id?: number; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) eventName?: string | null; @IsInt() + @ApiProperty() price!: number; @IsOptional() + @ApiPropertyOptional() recurringEvent?: any; @IsString() + @ApiProperty() currency!: string; @IsObject() + @ApiProperty() metadata!: any; @IsBoolean() @IsOptional() - seatsShowAttendees?: boolean | undefined | null; + @ApiPropertyOptional({ type: Boolean, nullable: true }) + seatsShowAttendees?: boolean | null; @IsBoolean() @IsOptional() - seatsShowAvailabilityCount?: boolean | undefined | null; + @ApiPropertyOptional({ type: Boolean, nullable: true }) + seatsShowAvailabilityCount?: boolean | null; @IsOptional() + @ApiPropertyOptional({ nullable: true }) team?: any | null; } class Reference { @IsInt() + @ApiProperty() id!: number; @IsString() + @ApiProperty() type!: string; @IsString() + @ApiProperty() uid!: string; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) meetingId?: string | null; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) thirdPartyRecurringEventId?: string | null; @IsString() + @ApiProperty({ type: String, nullable: true }) meetingPassword!: string | null; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) meetingUrl?: string | null; @IsInt() + @ApiProperty({ type: Number, nullable: true }) bookingId!: number | null; @IsEmail() + @ApiProperty({ type: String, nullable: true }) externalCalendarId!: string | null; @IsOptional() + @ApiPropertyOptional() deleted?: any; @IsInt() + @ApiProperty({ type: Number, nullable: true }) credentialId!: number | null; } class User { @IsInt() + @ApiProperty() id!: number; @IsString() + @ApiProperty({ type: String, nullable: true }) name!: string | null; @IsEmail() + @ApiProperty() email!: string; } class GetBookingsDataEntry { @IsInt() + @ApiProperty() id!: number; @IsString() + @ApiProperty() title!: string; @IsOptional() @IsEmail() + @ApiProperty({ type: String, nullable: true }) userPrimaryEmail?: string | null; @IsString() + @ApiProperty({ type: String, nullable: true }) description!: string | null; @IsObject() + @ApiProperty({ type: Object }) customInputs!: object | any; @IsDateString() + @ApiProperty() startTime!: string; @IsDateString() + @ApiProperty() endTime!: string; @ValidateNested({ each: true }) @Type(() => Attendee) @IsArray() + @ApiProperty({ type: [Attendee] }) attendees!: Attendee[]; + @ApiProperty() metadata!: any; @IsString() + @ApiProperty() uid!: string; @IsOptional() @IsString() + @ApiProperty({ type: String, nullable: true }) recurringEventId!: string | null; @IsUrl() + @ApiProperty({ type: String, nullable: true }) location!: string | null; @ValidateNested() @Type(() => EventType) + @ApiProperty({ type: EventType }) eventType!: EventType; @IsEnum(Status) - status!: "CANCELLED" | "REJECTED" | "ACCEPTED" | "PENDING" | "AWAITING_HOST"; + @ApiProperty({ enum: Status, type: String }) + status!: Status; @IsBoolean() + @ApiProperty({ type: Boolean }) paid!: boolean; @IsArray() + @ApiProperty() payment!: any[]; @ValidateNested() @Type(() => Reference) @IsArray() + @ApiProperty({ type: [Reference] }) references!: Reference[]; @IsBoolean() + @ApiProperty({ type: Boolean }) isRecorded!: boolean; @IsArray() + @ApiProperty() seatsReferences!: any[]; @ValidateNested() @Type(() => User) + @ApiProperty({ type: User }) user!: User | null; @IsOptional() + @ApiPropertyOptional() rescheduled?: any; } @@ -206,17 +257,20 @@ class GetBookingsData_2024_04_15 { @ValidateNested() @Type(() => GetBookingsDataEntry) @IsArray() + @ApiProperty({ type: [GetBookingsDataEntry] }) bookings!: GetBookingsDataEntry[]; @IsArray() + @ApiProperty() recurringInfo!: any[]; @IsInt() + @ApiProperty({ type: Number, nullable: true }) nextCursor!: number | null; } export class GetBookingsOutput_2024_04_15 { - @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] }) + @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS], type: String }) @IsEnum([SUCCESS_STATUS, ERROR_STATUS]) status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS; diff --git a/apps/api/v2/src/ee/bookings/2024-04-15/outputs/mark-no-show.output.ts b/apps/api/v2/src/ee/bookings/2024-04-15/outputs/mark-no-show.output.ts index c951987c7c..653a0afeea 100644 --- a/apps/api/v2/src/ee/bookings/2024-04-15/outputs/mark-no-show.output.ts +++ b/apps/api/v2/src/ee/bookings/2024-04-15/outputs/mark-no-show.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsString, IsEnum, IsOptional, ValidateNested, IsArray, IsEmail, IsBoolean } from "class-validator"; @@ -6,24 +6,29 @@ import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants"; class Attendee { @IsEmail() + @ApiProperty() email!: string; @IsBoolean() + @ApiProperty() noShow!: boolean; } class HandleMarkNoShowData_2024_04_15 { @IsString() + @ApiProperty() message!: string; @IsBoolean() @IsOptional() + @ApiPropertyOptional() noShowHost?: boolean; @ValidateNested() @Type(() => Attendee) @IsArray() @IsOptional() + @ApiPropertyOptional({ type: [Attendee] }) attendees?: Attendee[]; } diff --git a/apps/api/v2/src/ee/calendars/input/create-ics.input.ts b/apps/api/v2/src/ee/calendars/input/create-ics.input.ts index 17e9893c03..3a605af9e4 100644 --- a/apps/api/v2/src/ee/calendars/input/create-ics.input.ts +++ b/apps/api/v2/src/ee/calendars/input/create-ics.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { ArrayNotEmpty, IsBoolean, @@ -50,11 +50,10 @@ export class CreateIcsFeedInputDto { urls!: string[]; @IsBoolean() - @ApiProperty({ + @ApiPropertyOptional({ example: false, description: "Whether to allowing writing to the calendar or not", type: "boolean", - required: false, default: true, }) @IsOptional() diff --git a/apps/api/v2/src/ee/calendars/outputs/busy-times.output.ts b/apps/api/v2/src/ee/calendars/outputs/busy-times.output.ts index b705c93403..ff9913ae8c 100644 --- a/apps/api/v2/src/ee/calendars/outputs/busy-times.output.ts +++ b/apps/api/v2/src/ee/calendars/outputs/busy-times.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsArray, IsDate, IsEnum, IsOptional, IsString, ValidateNested } from "class-validator"; @@ -6,13 +6,16 @@ import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants"; export class BusyTimesOutput { @IsDate() + @ApiProperty({ type: Date }) start!: Date; @IsDate() + @ApiProperty({ type: Date }) end!: Date; @IsOptional() @IsString() + @ApiPropertyOptional({ type: String, nullable: true }) source?: string | null; } @@ -24,5 +27,6 @@ export class GetBusyTimesOutput { @ValidateNested() @Type(() => BusyTimesOutput) @IsArray() + @ApiProperty({ type: [BusyTimesOutput] }) data!: BusyTimesOutput[]; } diff --git a/apps/api/v2/src/ee/calendars/outputs/connected-calendars.output.ts b/apps/api/v2/src/ee/calendars/outputs/connected-calendars.output.ts index 64d9bced1c..1adbcebdc6 100644 --- a/apps/api/v2/src/ee/calendars/outputs/connected-calendars.output.ts +++ b/apps/api/v2/src/ee/calendars/outputs/connected-calendars.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsArray, @@ -18,195 +18,246 @@ import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants"; class Integration { @IsOptional() @IsObject() + @ApiPropertyOptional({ type: Object, nullable: true }) appData?: object | null; @IsOptional() @IsString() + @ApiPropertyOptional() dirName?: string; @IsOptional() @IsString() + @ApiPropertyOptional() __template?: string; @IsString() + @ApiProperty() name!: string; @IsString() + @ApiProperty() description!: string; @IsOptional() @IsBoolean() + @ApiPropertyOptional() installed?: boolean; @IsString() + @ApiProperty() type!: string; @IsOptional() @IsString() + @ApiPropertyOptional() title?: string; @IsString() + @ApiProperty() variant!: string; @IsOptional() @IsString() + @ApiPropertyOptional() category?: string; @IsArray() @IsString({ each: true }) + @ApiProperty({ type: [String] }) categories!: string[]; @IsString() + @ApiProperty() logo!: string; @IsString() + @ApiProperty() publisher!: string; @IsString() + @ApiProperty() slug!: string; @IsUrl() + @ApiProperty() url!: string; @IsEmail() + @ApiProperty() email!: string; - @IsOptional() @IsObject() + @ApiProperty({ type: Object, nullable: true }) locationOption!: object | null; } class Primary { @IsEmail() + @ApiProperty() externalId!: string; @IsString() @IsOptional() + @ApiPropertyOptional() integration?: string; @IsOptional() @IsEmail() + @ApiPropertyOptional() name?: string; @IsBoolean() + @ApiProperty({ type: Boolean, nullable: true }) primary!: boolean | null; @IsBoolean() + @ApiProperty() readOnly!: boolean; @IsEmail() @IsOptional() + @ApiPropertyOptional() email?: string; @IsBoolean() + @ApiProperty() isSelected!: boolean; @IsInt() + @ApiProperty() credentialId!: number; } export class Calendar { @IsEmail() + @ApiProperty() externalId!: string; @IsString() @IsOptional() + @ApiPropertyOptional() integration?: string; @IsEmail() @IsOptional() + @ApiPropertyOptional() name?: string; @IsOptional() @IsBoolean() + @ApiPropertyOptional({ type: Boolean, nullable: true }) primary?: boolean | null; @IsBoolean() + @ApiProperty() readOnly!: boolean; @IsEmail() @IsOptional() + @ApiPropertyOptional() email?: string; @IsBoolean() + @ApiProperty() isSelected!: boolean; @IsInt() + @ApiProperty() credentialId!: number; } export class ConnectedCalendar { @ValidateNested() @IsObject() + @ApiProperty({ type: Integration }) integration!: Integration; @IsInt() + @ApiProperty() credentialId!: number; @ValidateNested() @IsObject() @IsOptional() + @ApiPropertyOptional({ type: Primary }) primary?: Primary; @ValidateNested({ each: true }) @IsArray() @IsOptional() + @ApiPropertyOptional({ type: [Calendar] }) calendars?: Calendar[]; } class DestinationCalendar { @IsInt() + @ApiProperty() id!: number; @IsString() + @ApiProperty() integration!: string; @IsEmail() + @ApiProperty() externalId!: string; @IsEmail() + @ApiProperty({ type: String, nullable: true }) primaryEmail!: string | null; @IsInt() + @ApiProperty({ nullable: true }) userId!: number | null; @IsOptional() @IsInt() + @ApiProperty({ type: Number, nullable: true }) eventTypeId!: number | null; @IsInt() + @ApiProperty({ type: Number, nullable: true }) credentialId!: number | null; @IsString() @IsOptional() + @ApiPropertyOptional({ type: String, nullable: true }) name?: string | null; @IsBoolean() @IsOptional() + @ApiPropertyOptional() primary?: boolean; @IsBoolean() @IsOptional() + @ApiPropertyOptional() readOnly?: boolean; @IsEmail() @IsOptional() + @ApiPropertyOptional() email?: string; @IsString() @IsOptional() + @ApiPropertyOptional() integrationTitle?: string; } export class ConnectedCalendarsData { @ValidateNested({ each: true }) @IsArray() + @ApiProperty({ type: [ConnectedCalendar] }) connectedCalendars!: ConnectedCalendar[]; @ValidateNested() @IsObject() + @ApiProperty({ type: DestinationCalendar }) destinationCalendar!: DestinationCalendar; } + export class ConnectedCalendarsOutput { @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] }) @IsEnum([SUCCESS_STATUS, ERROR_STATUS]) @@ -214,5 +265,6 @@ export class ConnectedCalendarsOutput { @ValidateNested() @Type(() => ConnectedCalendarsData) + @ApiProperty({ type: ConnectedCalendarsData }) data!: ConnectedCalendarsData; } diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/create-event-type.input.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/create-event-type.input.ts index 9bd7e346bc..ecb9af1d07 100644 --- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/create-event-type.input.ts +++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/create-event-type.input.ts @@ -1,5 +1,5 @@ import { EventTypeLocation_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/inputs/event-type-location.input"; -import { ApiProperty as DocsProperty, ApiHideProperty } from "@nestjs/swagger"; +import { ApiProperty as DocsProperty, ApiPropertyOptional, ApiHideProperty } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsString, @@ -36,7 +36,10 @@ export class CreateEventTypeInput_2024_04_15 { @IsOptional() @IsString() - @DocsProperty({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE }) + @ApiPropertyOptional({ + type: String, + example: CREATE_EVENT_DESCRIPTION_EXAMPLE, + }) description?: string; @IsOptional() @@ -48,30 +51,38 @@ export class CreateEventTypeInput_2024_04_15 { @ValidateNested({ each: true }) @Type(() => EventTypeLocation_2024_04_15) @IsArray() + @ApiPropertyOptional({ + type: [EventTypeLocation_2024_04_15], + }) locations?: EventTypeLocation_2024_04_15[]; - @IsBoolean() @IsOptional() + @IsBoolean() + @ApiPropertyOptional() disableGuests?: boolean; + @IsOptional() @IsInt() @Min(0) - @IsOptional() + @ApiPropertyOptional() slotInterval?: number; + @IsOptional() @IsInt() @Min(0) - @IsOptional() + @ApiPropertyOptional() minimumBookingNotice?: number; + @IsOptional() @IsInt() @Min(0) - @IsOptional() + @ApiPropertyOptional() beforeEventBuffer?: number; + @IsOptional() @IsInt() @Min(0) - @IsOptional() + @ApiPropertyOptional() afterEventBuffer?: number; // @ApiHideProperty() diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/event-type-location.input.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/event-type-location.input.ts index 96ca332e84..bb27e144c6 100644 --- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/event-type-location.input.ts +++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/event-type-location.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty as DocsProperty, ApiHideProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiHideProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { IsString, IsNumber, IsBoolean, IsOptional, IsUrl } from "class-validator"; // note(Lauris): We will gradually expose more properties if any customer needs them. @@ -6,7 +6,7 @@ import { IsString, IsNumber, IsBoolean, IsOptional, IsUrl } from "class-validato export class EventTypeLocation_2024_04_15 { @IsString() - @DocsProperty({ example: "link" }) + @ApiProperty({ example: "link" }) type!: string; @IsOptional() @@ -16,7 +16,7 @@ export class EventTypeLocation_2024_04_15 { @IsOptional() @IsUrl() - @DocsProperty({ example: "https://masterchief.com/argentina/flan/video/9129412" }) + @ApiPropertyOptional({ example: "https://masterchief.com/argentina/flan/video/9129412" }) link?: string; @IsOptional() diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/get-public-event-type-query-params.input.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/get-public-event-type-query-params.input.ts index 02fc93647f..30ee95f842 100644 --- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/get-public-event-type-query-params.input.ts +++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/get-public-event-type-query-params.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { Transform } from "class-transformer"; import { IsBoolean, IsOptional, IsString } from "class-validator"; @@ -6,11 +6,11 @@ export class GetPublicEventTypeQueryParams_2024_04_15 { @Transform(({ value }: { value: string }) => value === "true") @IsBoolean() @IsOptional() - @ApiProperty({ required: false }) + @ApiPropertyOptional() isTeamEvent?: boolean; - @ApiProperty({ required: false }) - @IsString() @IsOptional() + @IsString() + @ApiPropertyOptional({ type: String, nullable: true }) org?: string | null; } diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/update-event-type.input.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/update-event-type.input.ts index 1f1f5c50a7..3867d1beda 100644 --- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/update-event-type.input.ts +++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/inputs/update-event-type.input.ts @@ -2,6 +2,7 @@ import { Editable } from "@/ee/event-types/event-types_2024_04_15/inputs/enums/e import { BaseField } from "@/ee/event-types/event-types_2024_04_15/inputs/enums/field-type"; import { Frequency } from "@/ee/event-types/event-types_2024_04_15/inputs/enums/frequency"; import { EventTypeLocation_2024_04_15 } from "@/ee/event-types/event-types_2024_04_15/inputs/event-type-location.input"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsString, @@ -21,206 +22,259 @@ import { class Option { @IsString() + @ApiProperty() value!: string; @IsString() + @ApiProperty() label!: string; } class Source { @IsString() + @ApiProperty() id!: string; @IsString() + @ApiProperty() type!: string; @IsString() + @ApiProperty() label!: string; @IsOptional() @IsString() + @ApiPropertyOptional() editUrl?: string; @IsOptional() @IsBoolean() + @ApiPropertyOptional() fieldRequired?: boolean; } class View { @IsString() + @ApiProperty() id!: string; @IsString() + @ApiProperty() label!: string; @IsOptional() @IsString() + @ApiPropertyOptional() description?: string; } class OptionsInput { @IsString() + @ApiProperty({ + description: 'Type of the field, can be one of "address", "text", or "phone".', + enum: ["address", "text", "phone"], + example: "text", + }) type!: "address" | "text" | "phone"; @IsOptional() @IsBoolean() + @ApiPropertyOptional() required?: boolean; @IsOptional() @IsString() + @ApiPropertyOptional() placeholder?: string; } class VariantField { @IsString() + @ApiProperty() type!: BaseField; @IsString() + @ApiProperty() name!: string; @IsOptional() @IsString() + @ApiPropertyOptional() label?: string; @IsOptional() @IsString() + @ApiPropertyOptional() labelAsSafeHtml?: string; @IsOptional() @IsString() + @ApiPropertyOptional() placeholder?: string; @IsOptional() @IsBoolean() + @ApiPropertyOptional() required?: boolean; } class Variant { @ValidateNested({ each: true }) @Type(() => VariantField) + @ApiProperty({ type: [VariantField] }) fields!: VariantField[]; } class VariantsConfig { + @ApiProperty({ type: Object }) variants!: Record; } export class BookingField_2024_04_15 { @IsEnum(BaseField) + @ApiProperty({ enum: BaseField }) type!: BaseField; @IsString() + @ApiProperty() name!: string; @IsOptional() @ValidateNested({ each: true }) @Type(() => Option) + @ApiPropertyOptional({ type: [Option] }) options?: Option[]; @IsOptional() @IsString() + @ApiPropertyOptional() label?: string; @IsOptional() @IsString() + @ApiPropertyOptional() labelAsSafeHtml?: string; @IsOptional() @IsString() + @ApiPropertyOptional() defaultLabel?: string; @IsOptional() @IsString() + @ApiPropertyOptional() placeholder?: string; @IsOptional() @IsBoolean() + @ApiPropertyOptional() required?: boolean; @IsOptional() @IsString() + @ApiPropertyOptional() getOptionsAt?: string; @IsOptional() @IsArray() @ValidateNested({ each: true }) @Type(() => OptionsInput) + @ApiPropertyOptional() optionsInputs?: Record; @IsOptional() @IsString() + @ApiPropertyOptional() variant?: string; @IsOptional() @ValidateNested() @Type(() => VariantsConfig) + @ApiPropertyOptional({ type: VariantsConfig }) variantsConfig?: VariantsConfig; @IsOptional() @ValidateNested({ each: true }) @Type(() => View) + @ApiPropertyOptional({ type: [View] }) views?: View[]; @IsOptional() @IsBoolean() + @ApiPropertyOptional() hideWhenJustOneOption?: boolean; @IsOptional() @IsBoolean() + @ApiPropertyOptional() hidden?: boolean; @IsOptional() @IsEnum(Editable) + @ApiPropertyOptional() editable?: Editable; @IsOptional() @ValidateNested({ each: true }) @Type(() => Source) + @ApiPropertyOptional({ type: [Source] }) sources?: Source[]; @IsOptional() @IsBoolean() + @ApiPropertyOptional() disableOnPrefill?: boolean; } export class RecurringEvent_2024_04_15 { @IsDate() @IsOptional() + @ApiPropertyOptional({ type: Date }) dtstart?: Date; @IsInt() + @ApiProperty() interval!: number; @IsInt() + @ApiProperty() count!: number; @IsEnum(Frequency) + @ApiProperty({ enum: Frequency }) freq!: Frequency; @IsDate() @IsOptional() + @ApiPropertyOptional({ type: Date }) until?: Date; @IsString() @IsOptional() + @ApiPropertyOptional() tzid?: string; } export class IntervalLimits_2024_04_15 { @IsNumber() @IsOptional() + @ApiPropertyOptional() PER_DAY?: number; @IsNumber() @IsOptional() + @ApiPropertyOptional() PER_WEEK?: number; @IsNumber() @IsOptional() + @ApiPropertyOptional() PER_MONTH?: number; @IsNumber() @IsOptional() + @ApiPropertyOptional() PER_YEAR?: number; } @@ -228,27 +282,33 @@ export class UpdateEventTypeInput_2024_04_15 { @IsInt() @Min(1) @IsOptional() + @ApiPropertyOptional() length?: number; @IsString() @IsOptional() + @ApiPropertyOptional() slug?: string; @IsString() @IsOptional() + @ApiPropertyOptional() title?: string; @IsString() @IsOptional() + @ApiPropertyOptional() description?: string; @IsBoolean() @IsOptional() + @ApiPropertyOptional() hidden?: boolean; @ValidateNested({ each: true }) @Type(() => EventTypeLocation_2024_04_15) @IsOptional() + @ApiPropertyOptional({ type: [EventTypeLocation_2024_04_15] }) locations?: EventTypeLocation_2024_04_15[]; // @IsInt() @@ -283,6 +343,7 @@ export class UpdateEventTypeInput_2024_04_15 { @IsArray() @ValidateNested({ each: true }) @Type(() => BookingField_2024_04_15) + @ApiPropertyOptional({ type: [BookingField_2024_04_15] }) bookingFields?: BookingField_2024_04_15[]; // @IsString() @@ -328,6 +389,7 @@ export class UpdateEventTypeInput_2024_04_15 { @IsBoolean() @IsOptional() + @ApiPropertyOptional() disableGuests?: boolean; // @IsBoolean() @@ -337,16 +399,19 @@ export class UpdateEventTypeInput_2024_04_15 { @IsInt() @Min(0) @IsOptional() + @ApiPropertyOptional() minimumBookingNotice?: number; @IsInt() @Min(0) @IsOptional() + @ApiPropertyOptional() beforeEventBuffer?: number; @IsInt() @Min(0) @IsOptional() + @ApiPropertyOptional() afterEventBuffer?: number; // @IsInt() @@ -384,6 +449,7 @@ export class UpdateEventTypeInput_2024_04_15 { @IsInt() @Min(0) @IsOptional() + @ApiPropertyOptional() slotInterval?: number; // @IsString() diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/outputs/event-type.output.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/outputs/event-type.output.ts index b95fe6ac80..700f8a4786 100644 --- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/outputs/event-type.output.ts +++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/outputs/event-type.output.ts @@ -12,7 +12,7 @@ import { IntervalLimits_2024_04_15, RecurringEvent_2024_04_15, } from "@/ee/event-types/event-types_2024_04_15/inputs/update-event-type.input"; -import { ApiProperty as DocsProperty, ApiHideProperty } from "@nestjs/swagger"; +import { ApiHideProperty, ApiProperty } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsArray, @@ -29,23 +29,23 @@ import { export class EventTypeOutput { @IsInt() - @DocsProperty({ example: 1 }) + @ApiProperty({ example: 1 }) id!: number; @IsInt() - @DocsProperty({ example: CREATE_EVENT_LENGTH_EXAMPLE }) + @ApiProperty({ example: CREATE_EVENT_LENGTH_EXAMPLE }) length!: number; @IsString() - @DocsProperty({ example: CREATE_EVENT_SLUG_EXAMPLE }) + @ApiProperty({ example: CREATE_EVENT_SLUG_EXAMPLE }) slug!: string; @IsString() - @DocsProperty({ example: CREATE_EVENT_TITLE_EXAMPLE }) + @ApiProperty({ example: CREATE_EVENT_TITLE_EXAMPLE }) title!: string; @IsString() - @DocsProperty({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE }) + @ApiProperty({ example: CREATE_EVENT_DESCRIPTION_EXAMPLE, nullable: true }) description!: string | null; @IsBoolean() @@ -55,6 +55,7 @@ export class EventTypeOutput { @ValidateNested({ each: true }) @Type(() => EventTypeLocation_2024_04_15) @IsArray() + @ApiProperty({ type: [EventTypeLocation_2024_04_15], nullable: true }) locations!: EventTypeLocation_2024_04_15[] | null; @IsInt() diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/outputs/get-event-type-public.output.ts b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/outputs/get-event-type-public.output.ts index 7d71d04965..d19febf2df 100644 --- a/apps/api/v2/src/ee/event-types/event-types_2024_04_15/outputs/get-event-type-public.output.ts +++ b/apps/api/v2/src/ee/event-types/event-types_2024_04_15/outputs/get-event-type-public.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsBoolean, @@ -17,330 +17,421 @@ import { SUCCESS_STATUS, ERROR_STATUS } from "@calcom/platform-constants"; class Location { @IsString() + @ApiProperty() type!: string; } class Source { @IsString() + @ApiProperty() id!: string; @IsString() + @ApiProperty() type!: string; @IsString() + @ApiProperty() label!: string; } class OptionInput { @IsString() + @ApiProperty() type!: string; @IsBoolean() @IsOptional() + @ApiPropertyOptional() required?: boolean; @IsString() @IsOptional() + @ApiPropertyOptional() placeholder?: string; } class BookingField { @IsString() + @ApiProperty() name!: string; @IsString() + @ApiProperty() type!: string; @IsOptional() @IsString() + @ApiPropertyOptional() defaultLabel?: string; @IsString() @IsOptional() + @ApiPropertyOptional() label?: string; @IsString() @IsOptional() + @ApiPropertyOptional() placeholder?: string; @IsBoolean() @IsOptional() + @ApiPropertyOptional() required?: boolean; @IsOptional() + @ApiPropertyOptional() getOptionsAt?: string; @IsObject() @IsOptional() + @ApiPropertyOptional() optionsInputs?: { [key: string]: OptionInput }; @IsBoolean() @IsOptional() + @ApiPropertyOptional() hideWhenJustOneOption?: boolean; @IsString() @IsOptional() + @ApiPropertyOptional() editable?: string; @IsArray() @ValidateNested({ each: true }) @Type(() => Source) @IsOptional() + @ApiPropertyOptional({ type: [Source] }) sources?: Source[]; @IsOptional() @IsBoolean() + @ApiPropertyOptional() disableOnPrefill?: boolean; } class Organization { @IsInt() + @ApiProperty() id!: number; @IsString() @IsOptional() + @ApiPropertyOptional({ type: String, nullable: true }) slug?: string | null; @IsString() + @ApiProperty() name!: string; @IsOptional() - metadata!: Record; + @ApiPropertyOptional({ type: Object }) + metadata?: Record; } class Profile { @IsString() + @ApiProperty({ type: String, nullable: true }) username!: string | null; @IsInt() + @ApiProperty({ type: Number, nullable: true }) id!: number | null; @IsInt() @IsOptional() + @ApiPropertyOptional() userId?: number; @IsString() @IsOptional() + @ApiPropertyOptional() uid?: string; @IsOptional() @IsString() + @ApiPropertyOptional() name?: string; @IsInt() + @ApiProperty({ type: Number, nullable: true }) organizationId!: number | null; @ValidateNested() @Type(() => Organization) + @ApiPropertyOptional({ type: Organization, nullable: true }) organization?: Organization | null; @IsString() + @ApiProperty() upId!: string; @IsString() @IsOptional() + @ApiPropertyOptional() image?: string; @IsString() @IsOptional() + @ApiPropertyOptional() brandColor?: string; @IsString() @IsOptional() + @ApiPropertyOptional() darkBrandColor?: string; @IsString() @IsOptional() + @ApiPropertyOptional() theme?: string; @IsOptional() + @ApiPropertyOptional() bookerLayouts?: any; } class Owner { @IsInt() + @ApiProperty() id!: number; @IsString() @IsOptional() + @ApiPropertyOptional({ type: String, nullable: true }) avatarUrl?: string | null; @IsString() + @ApiProperty({ type: String, nullable: true }) username!: string | null; @IsString() + @ApiProperty({ type: String, nullable: true }) name!: string | null; @IsString() + @ApiProperty() weekStart!: string; @IsString() @IsOptional() + @ApiPropertyOptional({ type: String, nullable: true }) brandColor?: string | null; @IsString() @IsOptional() + @ApiPropertyOptional({ type: String, nullable: true }) darkBrandColor?: string | null; @IsString() @IsOptional() + @ApiPropertyOptional({ type: String, nullable: true }) theme?: string | null; @IsOptional() - metadata!: any; + @ApiPropertyOptional() + metadata?: any; @IsInt() @IsOptional() + @ApiPropertyOptional({ type: Number, nullable: true }) defaultScheduleId?: number | null; @IsString() + @ApiProperty({ type: String, nullable: true }) nonProfileUsername!: string | null; @ValidateNested() @Type(() => Profile) + @ApiProperty({ type: Profile }) profile!: Profile; } class User { @IsString() + @ApiProperty({ type: String, nullable: true }) username!: string | null; @IsString() + @ApiProperty({ type: String, nullable: true }) name!: string | null; @IsString() + @ApiProperty() weekStart!: string; @IsInt() + @IsOptional() + @ApiPropertyOptional() organizationId?: number; @IsString() @IsOptional() + @ApiPropertyOptional({ type: String, nullable: true }) avatarUrl?: string | null; @ValidateNested() + @ApiProperty({ type: Profile }) profile!: Profile; @IsString() + @ApiProperty() bookerUrl!: string; } class Schedule { @IsInt() + @ApiProperty() id!: number; @IsString() + @ApiProperty({ type: String, nullable: true }) timeZone!: string | null; } class PublicEventTypeOutput { @IsInt() + @ApiProperty() id!: number; @IsString() + @ApiProperty() title!: string; @IsString() + @ApiProperty() description!: string; @IsString() @IsOptional() + @ApiPropertyOptional({ type: String, nullable: true }) eventName?: string | null; @IsString() + @ApiProperty() slug!: string; @IsBoolean() + @ApiProperty() isInstantEvent!: boolean; @IsOptional() + @ApiPropertyOptional() aiPhoneCallConfig?: any; @IsOptional() + @ApiPropertyOptional() schedulingType?: any; @IsInt() + @ApiProperty() length!: number; @IsArray() @ValidateNested({ each: true }) @Type(() => Location) + @ApiProperty({ type: [Location] }) locations!: Location[]; @IsArray() + @ApiProperty({ type: [Object] }) customInputs!: any[]; @IsBoolean() + @ApiProperty() disableGuests!: boolean; @IsObject() + @ApiProperty({ type: Object, nullable: true }) metadata!: object | null; @IsBoolean() + @ApiProperty() lockTimeZoneToggleOnBookingPage!: boolean; @IsBoolean() + @ApiProperty() requiresConfirmation!: boolean; @IsBoolean() + @ApiProperty() requiresBookerEmailVerification!: boolean; @IsOptional() + @ApiPropertyOptional() recurringEvent?: any; @IsNumber() + @ApiProperty() price!: number; @IsString() + @ApiProperty() currency!: string; @IsOptional() + @ApiPropertyOptional({ type: Number, nullable: true }) seatsPerTimeSlot?: number | null; @IsBoolean() + @ApiProperty({ type: Boolean, nullable: true }) seatsShowAvailabilityCount!: boolean | null; @IsArray() @ValidateNested({ each: true }) @Type(() => BookingField) + @ApiProperty({ type: [BookingField] }) bookingFields!: BookingField[]; @IsOptional() + @ApiPropertyOptional() team?: any; @IsOptional() @IsUrl() + @ApiPropertyOptional({ type: String, nullable: true }) successRedirectUrl?: string | null; @IsArray() + @ApiProperty() workflows!: any[]; @IsArray() + @ApiProperty() hosts!: any[]; @ValidateNested() @Type(() => Owner) + @ApiProperty({ type: Owner, nullable: true }) owner!: Owner | null; @ValidateNested() @Type(() => Schedule) + @ApiProperty({ type: Schedule, nullable: true }) schedule!: Schedule | null; @IsBoolean() + @ApiProperty() hidden!: boolean; @IsBoolean() + @ApiProperty() assignAllTeamMembers!: boolean; @IsOptional() + @ApiPropertyOptional() bookerLayouts?: any; @IsArray() @ValidateNested({ each: true }) @Type(() => User) + @ApiProperty({ type: [User] }) users!: User[]; @IsObject() + @ApiProperty({ type: Object }) entity!: object; @IsBoolean() diff --git a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/inputs/create-phone-call.input.ts b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/inputs/create-phone-call.input.ts index 8fa63319d2..f2e664ea28 100644 --- a/apps/api/v2/src/ee/event-types/event-types_2024_06_14/inputs/create-phone-call.input.ts +++ b/apps/api/v2/src/ee/event-types/event-types_2024_06_14/inputs/create-phone-call.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty as DocsProperty } from "@nestjs/swagger"; +import { ApiProperty as DocsProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Transform } from "class-transformer"; import { IsString, IsBoolean, IsOptional, IsEnum, Matches } from "class-validator"; @@ -38,34 +38,34 @@ export class CreatePhoneCallInput { @IsOptional() @IsString() - @DocsProperty({ description: "Scheduler name" }) + @ApiPropertyOptional({ description: "Scheduler name" }) schedulerName?: string; @IsOptional() @IsString() @Transform(({ value }) => (value ? value : undefined)) - @DocsProperty({ description: "Guest name" }) + @ApiPropertyOptional({ description: "Guest name" }) guestName?: string; @IsOptional() @IsString() @Transform(({ value }) => (value ? value : undefined)) - @DocsProperty({ description: "Guest email" }) + @ApiPropertyOptional({ description: "Guest email" }) guestEmail?: string; @IsOptional() @IsString() @Transform(({ value }) => (value ? value : undefined)) - @DocsProperty({ description: "Guest company" }) + @ApiPropertyOptional({ description: "Guest company" }) guestCompany?: string; @IsOptional() @IsString() - @DocsProperty({ description: "Begin message" }) + @ApiPropertyOptional({ description: "Begin message" }) beginMessage?: string; @IsOptional() @IsString() - @DocsProperty({ description: "General prompt" }) + @ApiPropertyOptional({ description: "General prompt" }) generalPrompt?: string; } diff --git a/apps/api/v2/src/ee/me/outputs/me.output.ts b/apps/api/v2/src/ee/me/outputs/me.output.ts index 64c3fb6483..2b28cdec90 100644 --- a/apps/api/v2/src/ee/me/outputs/me.output.ts +++ b/apps/api/v2/src/ee/me/outputs/me.output.ts @@ -1,39 +1,51 @@ +import { ApiProperty as DocsProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; -import { IsInt, IsEmail, IsOptional, IsString, ValidateNested } from "class-validator"; +import { IsString, IsOptional, IsInt, IsEmail, ValidateNested } from "class-validator"; export class MeOrgOutput { + @DocsProperty() isPlatform!: boolean; + @DocsProperty() id!: number; } + export class MeOutput { @IsInt() + @DocsProperty() id!: number; @IsString() + @DocsProperty() username!: string; @IsEmail() + @DocsProperty() email!: string; @IsInt() + @DocsProperty() timeFormat!: number; @IsInt() - @IsOptional() + @DocsProperty({ type: Number, nullable: true }) defaultScheduleId!: number | null; @IsString() + @DocsProperty() weekStart!: string; @IsString() + @DocsProperty() timeZone!: string; @IsInt() + @DocsProperty({ type: Number, nullable: true }) organizationId!: number | null; @IsOptional() @ValidateNested() @Type(() => MeOrgOutput) + @ApiPropertyOptional({ type: MeOrgOutput }) organization?: MeOrgOutput; } diff --git a/apps/api/v2/src/ee/schedules/schedules_2024_04_15/inputs/create-schedule.input.ts b/apps/api/v2/src/ee/schedules/schedules_2024_04_15/inputs/create-schedule.input.ts index fad2d245f0..40e0f53abd 100644 --- a/apps/api/v2/src/ee/schedules/schedules_2024_04_15/inputs/create-schedule.input.ts +++ b/apps/api/v2/src/ee/schedules/schedules_2024_04_15/inputs/create-schedule.input.ts @@ -1,20 +1,25 @@ import { CreateAvailabilityInput_2024_04_15 } from "@/ee/schedules/schedules_2024_04_15/inputs/create-availability.input"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsArray, IsBoolean, IsTimeZone, IsOptional, IsString, ValidateNested } from "class-validator"; export class CreateScheduleInput_2024_04_15 { @IsString() + @ApiProperty() name!: string; @IsTimeZone() + @ApiProperty() timeZone!: string; @IsArray() @ValidateNested({ each: true }) @Type(() => CreateAvailabilityInput_2024_04_15) @IsOptional() + @ApiPropertyOptional({ type: [CreateAvailabilityInput_2024_04_15] }) availabilities?: CreateAvailabilityInput_2024_04_15[]; @IsBoolean() + @ApiProperty() isDefault!: boolean; } diff --git a/apps/api/v2/src/ee/schedules/schedules_2024_04_15/outputs/schedule-updated.output.ts b/apps/api/v2/src/ee/schedules/schedules_2024_04_15/outputs/schedule-updated.output.ts index 036e84935a..594792402b 100644 --- a/apps/api/v2/src/ee/schedules/schedules_2024_04_15/outputs/schedule-updated.output.ts +++ b/apps/api/v2/src/ee/schedules/schedules_2024_04_15/outputs/schedule-updated.output.ts @@ -1,95 +1,117 @@ +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsBoolean, IsInt, IsOptional, IsString, ValidateNested, IsArray } from "class-validator"; class EventTypeModel_2024_04_15 { @IsInt() + @ApiProperty() id!: number; @IsOptional() @IsString() + @ApiPropertyOptional({ type: String, nullable: true }) eventName?: string | null; } class AvailabilityModel_2024_04_15 { @IsInt() + @ApiProperty() id!: number; @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) userId?: number | null; @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) scheduleId?: number | null; @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) eventTypeId?: number | null; @IsArray() @IsInt({ each: true }) + @ApiProperty({ type: [Number] }) days!: number[]; @IsOptional() @Type(() => Date) - @IsString() // Assuming date is serialized/deserialized appropriately + @IsString() + @ApiPropertyOptional() startTime?: Date; @IsOptional() @Type(() => Date) - @IsString() // Assuming date is serialized/deserialized appropriately + @IsString() + @ApiPropertyOptional() endTime?: Date; @IsOptional() @Type(() => Date) - @IsString() // Assuming date is serialized/deserialized appropriately + @IsString() + @ApiPropertyOptional({ type: String, nullable: true }) date?: Date | null; } class ScheduleModel_2024_04_15 { @IsInt() + @ApiProperty() id!: number; @IsInt() + @ApiProperty() userId!: number; @IsString() + @ApiProperty() name!: string; @IsOptional() @IsString() + @ApiPropertyOptional({ type: String, nullable: true }) timeZone?: string | null; @IsOptional() @ValidateNested({ each: true }) @Type(() => EventTypeModel_2024_04_15) @IsArray() + @ApiPropertyOptional({ type: [EventTypeModel_2024_04_15] }) eventType?: EventTypeModel_2024_04_15[]; @IsOptional() @ValidateNested({ each: true }) @Type(() => AvailabilityModel_2024_04_15) @IsArray() + @ApiPropertyOptional({ type: [AvailabilityModel_2024_04_15] }) availability?: AvailabilityModel_2024_04_15[]; } export class UpdatedScheduleOutput_2024_04_15 { @ValidateNested() @Type(() => ScheduleModel_2024_04_15) + @ApiProperty({ type: ScheduleModel_2024_04_15 }) schedule!: ScheduleModel_2024_04_15; @IsBoolean() + @ApiProperty() isDefault!: boolean; @IsOptional() @IsString() + @ApiPropertyOptional() timeZone?: string; @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) prevDefaultId?: number | null; @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) currentDefaultId?: number | null; } diff --git a/apps/api/v2/src/ee/schedules/schedules_2024_04_15/outputs/schedule.output.ts b/apps/api/v2/src/ee/schedules/schedules_2024_04_15/outputs/schedule.output.ts index 015bfb77d8..9c462b7062 100644 --- a/apps/api/v2/src/ee/schedules/schedules_2024_04_15/outputs/schedule.output.ts +++ b/apps/api/v2/src/ee/schedules/schedules_2024_04_15/outputs/schedule.output.ts @@ -1,105 +1,132 @@ +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsDate, IsOptional, IsArray, IsBoolean, IsInt, IsString, ValidateNested } from "class-validator"; class AvailabilityModel { @IsInt() + @ApiProperty() id!: number; @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) userId?: number | null; @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) eventTypeId?: number | null; @IsArray() @IsInt({ each: true }) + @ApiProperty({ type: [Number] }) days!: number[]; @IsDate() @Type(() => Date) + @ApiProperty({ type: Date }) startTime!: Date; @IsDate() @Type(() => Date) + @ApiProperty({ type: Date }) endTime!: Date; @IsOptional() @IsDate() @Type(() => Date) + @ApiPropertyOptional({ type: Date, nullable: true }) date?: Date | null; @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) scheduleId?: number | null; } class WorkingHours { @IsArray() @IsInt({ each: true }) + @ApiProperty({ type: [Number] }) days!: number[]; @IsInt() + @ApiProperty() startTime!: number; @IsInt() + @ApiProperty() endTime!: number; @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) userId?: number | null; } class TimeRange { @IsOptional() @IsInt() + @ApiPropertyOptional({ type: Number, nullable: true }) userId?: number | null; @IsDate() + @ApiProperty({ type: Date }) start!: Date; @IsDate() + @ApiProperty({ type: Date }) end!: Date; } export class ScheduleOutput { @IsInt() + @ApiProperty() id!: number; @IsString() + @ApiProperty() name!: string; @IsBoolean() + @ApiProperty() isManaged!: boolean; @ValidateNested({ each: true }) @Type(() => WorkingHours) + @ApiProperty({ type: [WorkingHours] }) workingHours!: WorkingHours[]; @ValidateNested({ each: true }) @Type(() => AvailabilityModel) @IsArray() + @ApiProperty({ type: [AvailabilityModel] }) schedule!: AvailabilityModel[]; + @ApiProperty({ type: [[TimeRange]] }) availability!: TimeRange[][]; @IsString() + @ApiProperty() timeZone!: string; @ValidateNested({ each: true }) @IsArray() + @ApiPropertyOptional({ type: [Object] }) // note(Lauris) it should be // dateOverrides!: { ranges: TimeRange[] }[]; // but docs aren't generating correctly it results in array of strings dateOverrides!: unknown[]; @IsBoolean() + @ApiProperty() isDefault!: boolean; @IsBoolean() + @ApiProperty() isLastSchedule!: boolean; @IsBoolean() + @ApiProperty() readOnly!: boolean; } diff --git a/apps/api/v2/src/modules/atoms/inputs/event-types-app.input.ts b/apps/api/v2/src/modules/atoms/inputs/event-types-app.input.ts index 42f0e7ce1c..422e1c6aa7 100644 --- a/apps/api/v2/src/modules/atoms/inputs/event-types-app.input.ts +++ b/apps/api/v2/src/modules/atoms/inputs/event-types-app.input.ts @@ -1,10 +1,12 @@ -import { Transform, Type } from "class-transformer"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; +import { Transform } from "class-transformer"; import { ArrayNotEmpty, IsArray, IsInt, IsNumber, IsOptional } from "class-validator"; export class EventTypesAppInput { @Transform(({ value }: { value: string }) => value && parseInt(value)) @IsNumber() @IsOptional() + @ApiPropertyOptional() teamId?: number; } @@ -12,5 +14,6 @@ export class BulkUpdateEventTypeToDefaultLocationDto { @IsArray() @ArrayNotEmpty() @IsInt({ each: true }) + @ApiProperty({ type: [Number] }) eventTypeIds!: number[]; } diff --git a/apps/api/v2/src/modules/conferencing/outputs/get-conferencing-apps.output.ts b/apps/api/v2/src/modules/conferencing/outputs/get-conferencing-apps.output.ts index 3327ebc26c..9fa38161ab 100644 --- a/apps/api/v2/src/modules/conferencing/outputs/get-conferencing-apps.output.ts +++ b/apps/api/v2/src/modules/conferencing/outputs/get-conferencing-apps.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Expose, Type } from "class-transformer"; import { IsString, ValidateNested, IsEnum, IsNumber, IsOptional, IsBoolean } from "class-validator"; @@ -20,7 +20,11 @@ export class ConferencingAppsOutputDto { @IsNumber() userId!: number; - @ApiProperty({ example: true, description: "Whether if the connection is working or not." }) + @ApiPropertyOptional({ + example: true, + description: "Whether if the connection is working or not.", + nullable: true, + }) @Expose() @IsBoolean() @IsOptional() @@ -28,24 +32,26 @@ export class ConferencingAppsOutputDto { } export class ConferencingAppsOutputResponseDto { - @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] }) + @ApiProperty({ type: String, enum: [SUCCESS_STATUS, ERROR_STATUS] }) @IsEnum([SUCCESS_STATUS, ERROR_STATUS]) status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS; @Expose() - @ValidateNested() + @ValidateNested({ each: true }) @Type(() => ConferencingAppsOutputDto) + @ApiProperty({ type: [ConferencingAppsOutputDto] }) data!: ConferencingAppsOutputDto[]; } export class ConferencingAppOutputResponseDto { - @ApiProperty({ example: SUCCESS_STATUS, enum: [SUCCESS_STATUS, ERROR_STATUS] }) + @ApiProperty({ type: String, enum: [SUCCESS_STATUS, ERROR_STATUS] }) @IsEnum([SUCCESS_STATUS, ERROR_STATUS]) status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS; @Expose() @ValidateNested() @Type(() => ConferencingAppsOutputDto) + @ApiProperty({ type: ConferencingAppsOutputDto }) data!: ConferencingAppsOutputDto; } diff --git a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-users/outputs/managed-user.output.ts b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-users/outputs/managed-user.output.ts index c8f8eec959..16982d4d83 100644 --- a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-users/outputs/managed-user.output.ts +++ b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-client-users/outputs/managed-user.output.ts @@ -10,10 +10,10 @@ export class ManagedUserOutput { @ApiProperty({ example: "alice+cluo37fwd0001khkzqqynkpj3@example.com" }) email!: string; - @ApiProperty({ example: "alice" }) + @ApiProperty({ example: "alice", nullable: true }) username!: string | null; - @ApiProperty({ example: "alice" }) + @ApiProperty({ example: "alice", nullable: true }) name!: string | null; @ApiProperty({ example: "America/New_York" }) @@ -22,19 +22,19 @@ export class ManagedUserOutput { @ApiProperty({ example: "Sunday" }) weekStart!: string; - @ApiProperty({ example: "2024-04-01T00:00:00.000Z", type: "string" }) + @ApiProperty({ type: String, example: "2024-04-01T00:00:00.000Z" }) @Transform(({ value }) => value.toISOString()) createdDate!: Date; - @ApiProperty({ example: 12, nullable: true }) + @ApiProperty({ type: Number, example: 12, nullable: true }) timeFormat!: number | null; - @ApiProperty({ example: null }) + @ApiProperty({ type: Number, example: null, nullable: true }) defaultScheduleId!: number | null; @IsEnum(Locales) @IsOptional() - @ApiProperty({ example: Locales.EN, enum: Locales }) + @ApiPropertyOptional({ type: String, example: Locales.EN, enum: Locales }) locale?: Locales; @IsUrl() @@ -43,7 +43,7 @@ export class ManagedUserOutput { type: String, example: "https://cal.com/api/avatar/2b735186-b01b-46d3-87da-019b8f61776b.png", description: `URL of the user's avatar image`, - required: false, + nullable: true, }) avatarUrl?: string | null; } diff --git a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-clients/responses/GetOAuthClientResponse.dto.ts b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-clients/responses/GetOAuthClientResponse.dto.ts index e95fd60155..83a7f0cd98 100644 --- a/apps/api/v2/src/modules/oauth-clients/controllers/oauth-clients/responses/GetOAuthClientResponse.dto.ts +++ b/apps/api/v2/src/modules/oauth-clients/controllers/oauth-clients/responses/GetOAuthClientResponse.dto.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsArray, @@ -30,7 +30,7 @@ export class PlatformOAuthClientDto { @IsNumber() permissions!: number; - @ApiProperty({ example: "https://example.com/logo.png", required: false }) + @ApiPropertyOptional({ example: "https://example.com/logo.png" }) @IsOptional() @IsString() logo!: string | null; @@ -54,9 +54,7 @@ export class GetOAuthClientResponseDto { @IsEnum([SUCCESS_STATUS, ERROR_STATUS]) status!: typeof SUCCESS_STATUS | typeof ERROR_STATUS; - @ApiProperty({ - type: PlatformOAuthClientDto, - }) + @ApiProperty({ type: PlatformOAuthClientDto }) @IsNotEmptyObject() @ValidateNested() @Type(() => PlatformOAuthClientDto) diff --git a/apps/api/v2/src/modules/oauth-clients/inputs/update-oauth-client.input.ts b/apps/api/v2/src/modules/oauth-clients/inputs/update-oauth-client.input.ts index 1b2a129576..5282efbddf 100644 --- a/apps/api/v2/src/modules/oauth-clients/inputs/update-oauth-client.input.ts +++ b/apps/api/v2/src/modules/oauth-clients/inputs/update-oauth-client.input.ts @@ -1,32 +1,40 @@ +import { ApiPropertyOptional } from "@nestjs/swagger"; import { IsArray, IsBoolean, IsOptional, IsString } from "class-validator"; export class UpdateOAuthClientInput { @IsOptional() @IsString() + @ApiPropertyOptional() logo?: string; @IsString() @IsOptional() + @ApiPropertyOptional() name?: string; @IsArray() @IsOptional() @IsString({ each: true }) - redirectUris?: string[] = []; + @ApiPropertyOptional({ type: [String] }) + redirectUris?: string[]; @IsOptional() @IsString() + @ApiPropertyOptional() bookingRedirectUri?: string; @IsOptional() @IsString() + @ApiPropertyOptional() bookingCancelRedirectUri?: string; @IsOptional() @IsString() + @ApiPropertyOptional() bookingRescheduleRedirectUri?: string; @IsOptional() @IsBoolean() + @ApiPropertyOptional() areEmailsEnabled?: boolean; } diff --git a/apps/api/v2/src/modules/organizations/inputs/attributes/assign/organizations-attributes-options-assign.input.ts b/apps/api/v2/src/modules/organizations/inputs/attributes/assign/organizations-attributes-options-assign.input.ts index 6654e4eb69..56a8fe4c06 100644 --- a/apps/api/v2/src/modules/organizations/inputs/attributes/assign/organizations-attributes-options-assign.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/attributes/assign/organizations-attributes-options-assign.input.ts @@ -1,17 +1,21 @@ +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { IsNotEmpty, IsOptional, IsString } from "class-validator"; export class AssignOrganizationAttributeOptionToUserInput { @IsOptional() @IsString() @IsNotEmpty() + @ApiPropertyOptional() readonly value?: string; @IsOptional() @IsString() @IsNotEmpty() + @ApiPropertyOptional() readonly attributeOptionId?: string; @IsNotEmpty() @IsString() + @ApiProperty() readonly attributeId!: string; } diff --git a/apps/api/v2/src/modules/organizations/inputs/attributes/create-organization-attribute.input.ts b/apps/api/v2/src/modules/organizations/inputs/attributes/create-organization-attribute.input.ts index 3d5abd7882..d292e5238c 100644 --- a/apps/api/v2/src/modules/organizations/inputs/attributes/create-organization-attribute.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/attributes/create-organization-attribute.input.ts @@ -1,4 +1,5 @@ import { CreateOrganizationAttributeOptionInput } from "@/modules/organizations/inputs/attributes/options/create-organization-attribute-option.input"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { AttributeType } from "@prisma/client"; import { Type } from "class-transformer"; import { @@ -14,22 +15,27 @@ import { export class CreateOrganizationAttributeInput { @IsString() @IsNotEmpty() + @ApiProperty() readonly name!: string; @IsString() @IsNotEmpty() + @ApiProperty() readonly slug!: string; @IsEnum(AttributeType) @IsNotEmpty() + @ApiProperty({ enum: AttributeType }) readonly type!: AttributeType; @IsArray() - @ValidateNested() + @ValidateNested({ each: true }) @Type(() => CreateOrganizationAttributeOptionInput) + @ApiProperty({ type: [CreateOrganizationAttributeOptionInput] }) readonly options!: CreateOrganizationAttributeOptionInput[]; @IsBoolean() @IsOptional() + @ApiPropertyOptional() readonly enabled?: boolean; } diff --git a/apps/api/v2/src/modules/organizations/inputs/attributes/options/update-organizaiton-attribute-option.input.ts.ts b/apps/api/v2/src/modules/organizations/inputs/attributes/options/update-organizaiton-attribute-option.input.ts.ts index 4fdc26abae..ffcf4156ad 100644 --- a/apps/api/v2/src/modules/organizations/inputs/attributes/options/update-organizaiton-attribute-option.input.ts.ts +++ b/apps/api/v2/src/modules/organizations/inputs/attributes/options/update-organizaiton-attribute-option.input.ts.ts @@ -1,11 +1,14 @@ -import { IsNotEmpty, IsOptional, IsString } from "class-validator"; +import { ApiPropertyOptional } from "@nestjs/swagger"; +import { IsString, IsOptional } from "class-validator"; export class UpdateOrganizationAttributeOptionInput { @IsString() @IsOptional() + @ApiPropertyOptional() readonly value?: string; @IsString() @IsOptional() + @ApiPropertyOptional() readonly slug?: string; } diff --git a/apps/api/v2/src/modules/organizations/inputs/attributes/update-organization-attribute.input.ts b/apps/api/v2/src/modules/organizations/inputs/attributes/update-organization-attribute.input.ts index e68f9dc433..6e0483f418 100644 --- a/apps/api/v2/src/modules/organizations/inputs/attributes/update-organization-attribute.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/attributes/update-organization-attribute.input.ts @@ -1,20 +1,25 @@ +import { ApiPropertyOptional } from "@nestjs/swagger"; import { AttributeType } from "@prisma/client"; import { IsBoolean, IsEnum, IsOptional, IsString } from "class-validator"; export class UpdateOrganizationAttributeInput { @IsString() @IsOptional() + @ApiPropertyOptional() readonly name?: string; @IsString() @IsOptional() + @ApiPropertyOptional() readonly slug?: string; @IsEnum(AttributeType) @IsOptional() + @ApiPropertyOptional({ enum: AttributeType }) readonly type?: AttributeType; @IsBoolean() @IsOptional() + @ApiPropertyOptional() readonly enabled?: boolean; } diff --git a/apps/api/v2/src/modules/organizations/inputs/create-organization-membership.input.ts b/apps/api/v2/src/modules/organizations/inputs/create-organization-membership.input.ts index b2e75985a4..29d16c1f94 100644 --- a/apps/api/v2/src/modules/organizations/inputs/create-organization-membership.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/create-organization-membership.input.ts @@ -1,13 +1,15 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { IsBoolean, IsOptional, IsEnum, IsInt } from "class-validator"; export class CreateOrgMembershipDto { @IsInt() + @ApiProperty() readonly userId!: number; @IsOptional() @IsBoolean() + @ApiPropertyOptional({ type: Boolean, default: false }) readonly accepted?: boolean = false; @IsEnum(MembershipRole) @@ -16,5 +18,6 @@ export class CreateOrgMembershipDto { @IsOptional() @IsBoolean() + @ApiPropertyOptional({ type: Boolean, default: false }) readonly disableImpersonation?: boolean = false; } diff --git a/apps/api/v2/src/modules/organizations/inputs/create-organization-team-membership.input.ts b/apps/api/v2/src/modules/organizations/inputs/create-organization-team-membership.input.ts index f7f1e81dfb..f455b2753d 100644 --- a/apps/api/v2/src/modules/organizations/inputs/create-organization-team-membership.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/create-organization-team-membership.input.ts @@ -1,12 +1,14 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { IsBoolean, IsOptional, IsEnum, IsInt } from "class-validator"; export class CreateOrgTeamMembershipDto { @IsInt() + @ApiProperty() readonly userId!: number; @IsOptional() + @ApiPropertyOptional({ type: Boolean, default: false }) @IsBoolean() readonly accepted?: boolean = false; @@ -15,6 +17,7 @@ export class CreateOrgTeamMembershipDto { readonly role: MembershipRole = MembershipRole.MEMBER; @IsOptional() + @ApiPropertyOptional({ type: Boolean, default: false }) @IsBoolean() readonly disableImpersonation?: boolean = false; } diff --git a/apps/api/v2/src/modules/organizations/inputs/create-organization-team.input.ts b/apps/api/v2/src/modules/organizations/inputs/create-organization-team.input.ts index 4ce6bc1a39..e86e4e9beb 100644 --- a/apps/api/v2/src/modules/organizations/inputs/create-organization-team.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/create-organization-team.input.ts @@ -9,7 +9,7 @@ export class CreateOrgTeamDto { @IsOptional() @IsString() - @ApiPropertyOptional({ type: String, description: "Team slug", example: "caltel", required: false }) + @ApiPropertyOptional({ type: String, description: "Team slug", example: "caltel" }) readonly slug?: string; @IsOptional() @@ -18,52 +18,62 @@ export class CreateOrgTeamDto { type: String, example: "https://i.cal.com/api/avatar/b0b58752-68ad-4c0d-8024-4fa382a77752.png", description: `URL of the teams logo image`, - required: false, }) readonly logoUrl?: string; @IsOptional() @IsUrl() + @ApiPropertyOptional() readonly calVideoLogo?: string; @IsOptional() @IsUrl() + @ApiPropertyOptional() readonly appLogo?: string; @IsOptional() @IsUrl() + @ApiPropertyOptional() readonly appIconLogo?: string; @IsOptional() @IsString() + @ApiPropertyOptional() readonly bio?: string; @IsOptional() @IsBoolean() + @ApiPropertyOptional({ type: Boolean, default: false }) readonly hideBranding?: boolean = false; @IsOptional() @IsBoolean() + @ApiPropertyOptional() readonly isPrivate?: boolean; @IsOptional() @IsBoolean() + @ApiPropertyOptional() readonly hideBookATeamMember?: boolean; @IsOptional() @IsString() + @ApiPropertyOptional() readonly metadata?: string; // Assuming metadata is a JSON string. Adjust accordingly if it's a nested object. @IsOptional() @IsString() + @ApiPropertyOptional() readonly theme?: string; @IsOptional() @IsString() + @ApiPropertyOptional() readonly brandColor?: string; @IsOptional() @IsString() + @ApiPropertyOptional() readonly darkBrandColor?: string; @IsOptional() @@ -78,6 +88,7 @@ export class CreateOrgTeamDto { @IsOptional() @IsString() + @ApiPropertyOptional() readonly timeFormat?: number; @IsOptional() @@ -96,12 +107,12 @@ export class CreateOrgTeamDto { @ApiPropertyOptional({ type: String, example: "Monday", - required: false, default: "Sunday", }) readonly weekStart?: string = "Sunday"; @IsOptional() @IsBoolean() + @ApiPropertyOptional({ type: Boolean, default: true }) readonly autoAcceptCreator?: boolean = true; } diff --git a/apps/api/v2/src/modules/organizations/inputs/create-organization-user.input.ts b/apps/api/v2/src/modules/organizations/inputs/create-organization-user.input.ts index b2bd5cf390..2e8bbac85d 100644 --- a/apps/api/v2/src/modules/organizations/inputs/create-organization-user.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/create-organization-user.input.ts @@ -1,17 +1,21 @@ import { CreateUserInput } from "@/modules/users/inputs/create-user.input"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { IsString, IsOptional, IsBoolean, IsEnum } from "class-validator"; export class CreateOrganizationUserInput extends CreateUserInput { @IsOptional() @IsString() + @ApiPropertyOptional({ type: String, default: "en" }) locale = "en"; @IsOptional() @IsEnum(MembershipRole) + @ApiPropertyOptional({ enum: MembershipRole, default: MembershipRole.MEMBER }) organizationRole: MembershipRole = MembershipRole.MEMBER; @IsOptional() @IsBoolean() + @ApiPropertyOptional({ type: Boolean, default: true }) autoAccept = true; } diff --git a/apps/api/v2/src/modules/organizations/inputs/update-organization-membership.input.ts b/apps/api/v2/src/modules/organizations/inputs/update-organization-membership.input.ts index ef1e75a1e0..d21119613c 100644 --- a/apps/api/v2/src/modules/organizations/inputs/update-organization-membership.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/update-organization-membership.input.ts @@ -1,17 +1,20 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { IsBoolean, IsOptional, IsEnum } from "class-validator"; export class UpdateOrgMembershipDto { @IsOptional() @IsBoolean() - readonly accepted?: boolean = false; + @ApiPropertyOptional() + readonly accepted?: boolean; + @IsOptional() @IsEnum(MembershipRole) - @ApiProperty({ enum: ["MEMBER", "OWNER", "ADMIN"] }) - readonly role?: MembershipRole = MembershipRole.MEMBER; + @ApiPropertyOptional({ enum: ["MEMBER", "OWNER", "ADMIN"] }) + readonly role?: MembershipRole; @IsOptional() @IsBoolean() - readonly disableImpersonation?: boolean = false; + @ApiPropertyOptional() + readonly disableImpersonation?: boolean; } diff --git a/apps/api/v2/src/modules/organizations/inputs/update-organization-team-membership.input.ts b/apps/api/v2/src/modules/organizations/inputs/update-organization-team-membership.input.ts index 2784ca48b2..704ac7b824 100644 --- a/apps/api/v2/src/modules/organizations/inputs/update-organization-team-membership.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/update-organization-team-membership.input.ts @@ -1,17 +1,20 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { IsBoolean, IsOptional, IsEnum } from "class-validator"; export class UpdateOrgTeamMembershipDto { @IsOptional() @IsBoolean() - readonly accepted?: boolean = false; + @ApiPropertyOptional() + readonly accepted?: boolean; + @IsOptional() @IsEnum(MembershipRole) - @ApiProperty({ enum: ["MEMBER", "OWNER", "ADMIN"] }) - readonly role?: MembershipRole = MembershipRole.MEMBER; + @ApiPropertyOptional({ enum: ["MEMBER", "OWNER", "ADMIN"] }) + readonly role?: MembershipRole; @IsOptional() @IsBoolean() - readonly disableImpersonation?: boolean = false; + @ApiPropertyOptional() + readonly disableImpersonation?: boolean; } diff --git a/apps/api/v2/src/modules/organizations/inputs/update-organization-team.input.ts b/apps/api/v2/src/modules/organizations/inputs/update-organization-team.input.ts index dd13e2178f..ad220402c9 100644 --- a/apps/api/v2/src/modules/organizations/inputs/update-organization-team.input.ts +++ b/apps/api/v2/src/modules/organizations/inputs/update-organization-team.input.ts @@ -4,12 +4,12 @@ import { IsBoolean, IsOptional, IsString, IsUrl, Length } from "class-validator" export class UpdateOrgTeamDto { @IsString() @Length(1) - @ApiPropertyOptional({ description: "Name of the team", example: "CalTeam", required: false }) + @ApiPropertyOptional({ description: "Name of the team", example: "CalTeam" }) readonly name?: string; @IsOptional() @IsString() - @ApiPropertyOptional({ type: String, description: "Team slug", example: "caltel", required: false }) + @ApiPropertyOptional({ type: String, description: "Team slug", example: "caltel" }) readonly slug?: string; @IsOptional() @@ -18,52 +18,62 @@ export class UpdateOrgTeamDto { type: String, example: "https://i.cal.com/api/avatar/b0b58752-68ad-4c0d-8024-4fa382a77752.png", description: `URL of the teams logo image`, - required: false, }) readonly logoUrl?: string; @IsOptional() @IsUrl() + @ApiPropertyOptional() readonly calVideoLogo?: string; @IsOptional() @IsUrl() + @ApiPropertyOptional() readonly appLogo?: string; @IsOptional() @IsUrl() + @ApiPropertyOptional() readonly appIconLogo?: string; @IsOptional() @IsString() + @ApiPropertyOptional() readonly bio?: string; @IsOptional() @IsBoolean() - readonly hideBranding?: boolean = false; + @ApiPropertyOptional() + readonly hideBranding?: boolean; @IsOptional() @IsBoolean() + @ApiPropertyOptional() readonly isPrivate?: boolean; @IsOptional() @IsBoolean() + @ApiPropertyOptional() readonly hideBookATeamMember?: boolean; @IsOptional() @IsString() + @ApiPropertyOptional() readonly metadata?: string; // Assuming metadata is a JSON string. Adjust accordingly if it's a nested object. @IsOptional() @IsString() + @ApiPropertyOptional() readonly theme?: string; @IsOptional() @IsString() + @ApiPropertyOptional() readonly brandColor?: string; @IsOptional() @IsString() + @ApiPropertyOptional() readonly darkBrandColor?: string; @IsOptional() @@ -72,12 +82,12 @@ export class UpdateOrgTeamDto { type: String, example: "https://i.cal.com/api/avatar/949be534-7a88-4185-967c-c020b0c0bef3.png", description: `URL of the teams banner image which is shown on booker`, - required: false, }) readonly bannerUrl?: string; @IsOptional() @IsString() + @ApiPropertyOptional() readonly timeFormat?: number; @IsOptional() @@ -86,26 +96,24 @@ export class UpdateOrgTeamDto { type: String, example: "America/New_York", description: `Timezone is used to create teams's default schedule from Monday to Friday from 9AM to 5PM. It will default to Europe/London if not passed.`, - required: false, - default: "Europe/London", }) - readonly timeZone?: string = "Europe/London"; + readonly timeZone?: string; @IsOptional() @IsString() @ApiPropertyOptional({ type: String, example: "Monday", - required: false, - default: "Sunday", }) - readonly weekStart?: string = "Sunday"; + readonly weekStart?: string; @IsOptional() @IsString() + @ApiPropertyOptional() readonly bookingLimits?: string; @IsOptional() @IsBoolean() + @ApiPropertyOptional() readonly includeManagedEventsInLimits?: boolean; } diff --git a/apps/api/v2/src/modules/organizations/outputs/attributes/get-organization-attributes.output.ts b/apps/api/v2/src/modules/organizations/outputs/attributes/get-organization-attributes.output.ts index a4104834eb..d77ac00284 100644 --- a/apps/api/v2/src/modules/organizations/outputs/attributes/get-organization-attributes.output.ts +++ b/apps/api/v2/src/modules/organizations/outputs/attributes/get-organization-attributes.output.ts @@ -2,21 +2,21 @@ import { Attribute } from "@/modules/organizations/outputs/attributes/attribute. import { BaseOutputDTO } from "@/modules/organizations/outputs/attributes/base.output"; import { ApiProperty } from "@nestjs/swagger"; import { Expose, Type } from "class-transformer"; -import { IsBoolean, IsInt, IsString, IsEnum, ValidateNested, IsOptional } from "class-validator"; - -import { AttributeType } from "@calcom/prisma/client"; +import { IsOptional, ValidateNested } from "class-validator"; export class GetSingleAttributeOutput extends BaseOutputDTO { @Expose() @ValidateNested() @IsOptional() @Type(() => Attribute) + @ApiProperty({ type: Attribute, nullable: true }) data!: Attribute | null; } export class GetOrganizationAttributesOutput extends BaseOutputDTO { @Expose() - @ValidateNested() + @ValidateNested({ each: true }) @Type(() => Attribute) + @ApiProperty({ type: [Attribute] }) data!: Attribute[]; } diff --git a/apps/api/v2/src/modules/organizations/outputs/organization-membership/membership.output.ts b/apps/api/v2/src/modules/organizations/outputs/organization-membership/membership.output.ts index 4557ec9457..1628087dd1 100644 --- a/apps/api/v2/src/modules/organizations/outputs/organization-membership/membership.output.ts +++ b/apps/api/v2/src/modules/organizations/outputs/organization-membership/membership.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { Expose } from "class-transformer"; import { IsBoolean, IsInt, IsOptional, IsString } from "class-validator"; @@ -6,18 +6,22 @@ import { IsBoolean, IsInt, IsOptional, IsString } from "class-validator"; export class OrgMembershipOutputDto { @IsInt() @Expose() + @ApiProperty() readonly id!: number; @IsInt() @Expose() + @ApiProperty() readonly userId!: number; @IsInt() @Expose() + @ApiProperty() readonly teamId!: number; @IsBoolean() @Expose() + @ApiProperty() readonly accepted!: boolean; @IsString() @@ -28,5 +32,6 @@ export class OrgMembershipOutputDto { @IsOptional() @IsBoolean() @Expose() + @ApiPropertyOptional() readonly disableImpersonation?: boolean; } diff --git a/apps/api/v2/src/modules/organizations/outputs/organization-teams-memberships.output.ts b/apps/api/v2/src/modules/organizations/outputs/organization-teams-memberships.output.ts index a6d3efdf18..1404dd1a94 100644 --- a/apps/api/v2/src/modules/organizations/outputs/organization-teams-memberships.output.ts +++ b/apps/api/v2/src/modules/organizations/outputs/organization-teams-memberships.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { Expose, Type } from "class-transformer"; import { IsArray, IsBoolean, IsEnum, IsInt, IsOptional, IsString, ValidateNested } from "class-validator"; @@ -9,38 +9,46 @@ export class MembershipUserOutputDto { @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly avatarUrl?: string; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly username?: string; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly name?: string; @IsBoolean() @Expose() + @ApiProperty() readonly email!: string; } export class OrgTeamMembershipOutputDto { @IsInt() @Expose() + @ApiProperty() readonly id!: number; @IsInt() @Expose() + @ApiProperty() readonly userId!: number; @IsInt() @Expose() + @ApiProperty() readonly teamId!: number; @IsBoolean() @Expose() + @ApiProperty() readonly accepted!: boolean; @IsString() @@ -51,11 +59,13 @@ export class OrgTeamMembershipOutputDto { @IsOptional() @IsBoolean() @Expose() + @ApiPropertyOptional() readonly disableImpersonation?: boolean; @ValidateNested() @Type(() => MembershipUserOutputDto) @Expose() + @ApiProperty({ type: MembershipUserOutputDto }) user!: MembershipUserOutputDto; } @@ -68,6 +78,7 @@ export class OrgTeamMembershipsOutputResponseDto { @ValidateNested() @Type(() => OrgTeamMembershipOutputDto) @IsArray() + @ApiProperty({ type: [OrgTeamMembershipOutputDto] }) data!: OrgTeamMembershipOutputDto[]; } @@ -79,5 +90,6 @@ export class OrgTeamMembershipOutputResponseDto { @Expose() @ValidateNested() @Type(() => OrgTeamMembershipOutputDto) + @ApiProperty({ type: OrgTeamMembershipOutputDto }) data!: OrgTeamMembershipOutputDto; } diff --git a/apps/api/v2/src/modules/teams/memberships/inputs/create-team-membership.input.ts b/apps/api/v2/src/modules/teams/memberships/inputs/create-team-membership.input.ts index bd6a52d4d8..0e12f97d9f 100644 --- a/apps/api/v2/src/modules/teams/memberships/inputs/create-team-membership.input.ts +++ b/apps/api/v2/src/modules/teams/memberships/inputs/create-team-membership.input.ts @@ -1,20 +1,24 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { IsBoolean, IsOptional, IsEnum, IsInt } from "class-validator"; export class CreateTeamMembershipInput { @IsInt() + @ApiProperty({ type: Number }) readonly userId!: number; @IsOptional() @IsBoolean() + @ApiPropertyOptional({ type: Boolean, default: false }) readonly accepted?: boolean = false; + @IsOptional() @IsEnum(MembershipRole) - @ApiProperty({ enum: ["MEMBER", "OWNER", "ADMIN"] }) + @ApiPropertyOptional({ enum: ["MEMBER", "OWNER", "ADMIN"], default: "MEMBER" }) readonly role: MembershipRole = MembershipRole.MEMBER; @IsOptional() @IsBoolean() + @ApiPropertyOptional({ type: Boolean, default: false }) readonly disableImpersonation?: boolean = false; } diff --git a/apps/api/v2/src/modules/teams/memberships/inputs/update-team-membership.input.ts b/apps/api/v2/src/modules/teams/memberships/inputs/update-team-membership.input.ts index 79c87b92ab..16addbfad2 100644 --- a/apps/api/v2/src/modules/teams/memberships/inputs/update-team-membership.input.ts +++ b/apps/api/v2/src/modules/teams/memberships/inputs/update-team-membership.input.ts @@ -1,17 +1,20 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { IsBoolean, IsOptional, IsEnum } from "class-validator"; export class UpdateTeamMembershipInput { @IsOptional() @IsBoolean() - readonly accepted?: boolean = false; + @ApiPropertyOptional({ type: Boolean }) + readonly accepted?: boolean; + @IsOptional() @IsEnum(MembershipRole) - @ApiProperty({ enum: ["MEMBER", "OWNER", "ADMIN"] }) - readonly role?: MembershipRole = MembershipRole.MEMBER; + @ApiPropertyOptional({ enum: ["MEMBER", "OWNER", "ADMIN"] }) + readonly role?: MembershipRole; @IsOptional() @IsBoolean() - readonly disableImpersonation?: boolean = false; + @ApiPropertyOptional({ type: Boolean }) + readonly disableImpersonation?: boolean; } diff --git a/apps/api/v2/src/modules/teams/memberships/outputs/team-membership.output.ts b/apps/api/v2/src/modules/teams/memberships/outputs/team-membership.output.ts index da32c2cf36..67f19c6282 100644 --- a/apps/api/v2/src/modules/teams/memberships/outputs/team-membership.output.ts +++ b/apps/api/v2/src/modules/teams/memberships/outputs/team-membership.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { MembershipRole } from "@prisma/client"; import { Expose } from "class-transformer"; import { IsBoolean, IsInt, IsOptional, IsString } from "class-validator"; @@ -6,18 +6,22 @@ import { IsBoolean, IsInt, IsOptional, IsString } from "class-validator"; export class TeamMembershipOutput { @IsInt() @Expose() + @ApiProperty() readonly id!: number; @IsInt() @Expose() + @ApiProperty() readonly userId!: number; @IsInt() @Expose() + @ApiProperty() readonly teamId!: number; @IsBoolean() @Expose() + @ApiProperty() readonly accepted!: boolean; @IsString() @@ -28,5 +32,6 @@ export class TeamMembershipOutput { @IsOptional() @IsBoolean() @Expose() + @ApiPropertyOptional() readonly disableImpersonation?: boolean; } diff --git a/apps/api/v2/src/modules/users/inputs/create-managed-user.input.ts b/apps/api/v2/src/modules/users/inputs/create-managed-user.input.ts index d03a694f55..27faa7940b 100644 --- a/apps/api/v2/src/modules/users/inputs/create-managed-user.input.ts +++ b/apps/api/v2/src/modules/users/inputs/create-managed-user.input.ts @@ -16,12 +16,12 @@ export class CreateManagedUserInput { @IsOptional() @IsIn([12, 24], { message: "timeFormat must be a number either 12 or 24" }) - @ApiProperty({ example: 12, enum: [12, 24], description: "Must be a number 12 or 24" }) + @ApiPropertyOptional({ example: 12, enum: [12, 24], description: "Must be a number 12 or 24" }) timeFormat?: TimeFormat; @IsOptional() @IsString() - @ApiProperty({ + @ApiPropertyOptional({ example: "Monday", enum: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], }) @@ -30,7 +30,7 @@ export class CreateManagedUserInput { @IsTimeZone() @IsOptional() @CapitalizeTimeZone() - @ApiProperty({ + @ApiPropertyOptional({ example: "America/New_York", description: `Timezone is used to create user's default schedule from Monday to Friday from 9AM to 5PM. If it is not passed then user does not have a default schedule and it must be created manually via the /schedules endpoint. Until the schedule is created, the user can't access availability atom to set his / her availability nor booked. @@ -49,7 +49,6 @@ export class CreateManagedUserInput { type: String, example: "https://cal.com/api/avatar/2b735186-b01b-46d3-87da-019b8f61776b.png", description: `URL of the user's avatar image`, - required: false, }) avatarUrl?: string; } diff --git a/apps/api/v2/src/modules/users/inputs/get-users.input.ts b/apps/api/v2/src/modules/users/inputs/get-users.input.ts index dae816f944..5818d62775 100644 --- a/apps/api/v2/src/modules/users/inputs/get-users.input.ts +++ b/apps/api/v2/src/modules/users/inputs/get-users.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Transform } from "class-transformer"; import { IsOptional, Validate } from "class-validator"; @@ -12,7 +12,8 @@ export class GetUsersInput extends SkipTakePagination { @Transform(({ value }: { value: string | string[] }) => { return typeof value === "string" ? [value] : value; }) - @ApiProperty({ + @ApiPropertyOptional({ + type: [String], description: "The email address or an array of email addresses to filter by", }) emails?: string[]; diff --git a/apps/api/v2/src/modules/users/inputs/update-managed-user.input.ts b/apps/api/v2/src/modules/users/inputs/update-managed-user.input.ts index a0b3bb33be..c8643e308d 100644 --- a/apps/api/v2/src/modules/users/inputs/update-managed-user.input.ts +++ b/apps/api/v2/src/modules/users/inputs/update-managed-user.input.ts @@ -1,31 +1,34 @@ import { Locales } from "@/lib/enums/locales"; import { CapitalizeTimeZone } from "@/lib/inputs/capitalize-timezone"; import { TimeFormat, WeekDay } from "@/modules/users/inputs/create-managed-user.input"; -import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { IsEnum, IsIn, IsNumber, IsOptional, IsString, IsTimeZone, IsUrl } from "class-validator"; export class UpdateManagedUserInput { @IsString() @IsOptional() + @ApiPropertyOptional() email?: string; @IsString() @IsOptional() + @ApiPropertyOptional() name?: string; @IsOptional() @IsIn([12, 24]) - @ApiProperty({ example: 12, enum: [12, 24], description: "Must be 12 or 24" }) + @ApiPropertyOptional({ example: 12, enum: [12, 24], description: "Must be 12 or 24" }) timeFormat?: TimeFormat; @IsNumber() @IsOptional() + @ApiPropertyOptional() defaultScheduleId?: number; @IsOptional() @IsString() @IsIn(["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]) - @ApiProperty({ + @ApiPropertyOptional({ example: "Monday", enum: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], }) @@ -34,11 +37,12 @@ export class UpdateManagedUserInput { @IsTimeZone() @IsOptional() @CapitalizeTimeZone() + @ApiPropertyOptional() timeZone?: string; @IsEnum(Locales) @IsOptional() - @ApiProperty({ example: Locales.EN, enum: Locales }) + @ApiPropertyOptional({ example: Locales.EN, enum: Locales }) locale?: Locales; @IsUrl() @@ -47,7 +51,6 @@ export class UpdateManagedUserInput { type: String, example: "https://cal.com/api/avatar/2b735186-b01b-46d3-87da-019b8f61776b.png", description: `URL of the user's avatar image`, - required: false, }) avatarUrl?: string; } diff --git a/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts b/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts index 1056d3fdff..cf495f0dca 100644 --- a/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts +++ b/apps/api/v2/src/modules/webhooks/inputs/webhook.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty, PartialType } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional, PartialType } from "@nestjs/swagger"; import { WebhookTriggerEvents } from "@prisma/client"; import { IsArray, IsBoolean, IsEnum, IsOptional, IsString } from "class-validator"; @@ -19,9 +19,11 @@ export class CreateWebhookInputDto { payloadTemplate?: string; @IsBoolean() + @ApiProperty() active!: boolean; @IsString() + @ApiProperty() subscriberUrl!: string; @IsArray() @@ -43,6 +45,7 @@ export class CreateWebhookInputDto { @IsString() @IsOptional() + @ApiPropertyOptional() secret?: string; } diff --git a/apps/api/v2/swagger/documentation.json b/apps/api/v2/swagger/documentation.json index 6a1978bb37..97fe01c4f3 100644 --- a/apps/api/v2/swagger/documentation.json +++ b/apps/api/v2/swagger/documentation.json @@ -3604,16 +3604,19 @@ } }, { - "name": "calendarsToLoad", - "required": true, + "name": "credentialId", "in": "query", - "description": "An array of Calendar objects representing the calendars to be loaded", - "example": "[{ credentialId: \"1\", externalId: \"AQgtJE7RnHEeyisVq2ENs2gAAAgEGAAAACgtJE7RnHEeyisVq2ENs2gAAAhSDAAAA\" }, { credentialId: \"2\", externalId: \"AQM7RnHEeyisVq2ENs2gAAAhFDBBBBB\" }]", + "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "number" + } + }, + { + "name": "externalId", + "in": "query", + "required": true, + "schema": { + "type": "string" } } ], @@ -5103,7 +5106,7 @@ }, { "name": "eventTypeId", - "required": true, + "required": false, "in": "query", "description": "Event Type ID for which slots are being fetched.", "example": 100, @@ -5113,7 +5116,7 @@ }, { "name": "eventTypeSlug", - "required": true, + "required": false, "in": "query", "description": "Slug of the event type for which slots are being fetched.", "schema": { @@ -5122,7 +5125,7 @@ }, { "name": "usernameList", - "required": true, + "required": false, "in": "query", "description": "Only for dynamic events - list of usernames for which slots are being fetched.", "schema": { @@ -5132,15 +5135,49 @@ } } }, + { + "name": "debug", + "required": false, + "in": "query", + "schema": { + "type": "boolean" + } + }, { "name": "duration", - "required": true, + "required": false, "in": "query", "description": "Only for dynamic events - length of returned slots.", "schema": { "type": "number" } }, + { + "name": "rescheduleUid", + "required": false, + "in": "query", + "schema": { + "nullable": true, + "type": "string" + } + }, + { + "name": "timeZone", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "orgSlug", + "required": false, + "in": "query", + "description": "Organization slug.", + "schema": { + "type": "string" + } + }, { "name": "slotFormat", "required": false, @@ -5866,6 +5903,12 @@ ], "type": "string", "example": "en" + }, + "avatarUrl": { + "type": "string", + "nullable": true, + "example": "https://cal.com/api/avatar/2b735186-b01b-46d3-87da-019b8f61776b.png", + "description": "URL of the user's avatar image" } }, "required": [ @@ -5989,6 +6032,11 @@ ], "type": "string", "example": "en" + }, + "avatarUrl": { + "type": "string", + "example": "https://cal.com/api/avatar/2b735186-b01b-46d3-87da-019b8f61776b.png", + "description": "URL of the user's avatar image" } }, "required": [ @@ -6065,6 +6113,12 @@ "UpdateManagedUserInput": { "type": "object", "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + }, "timeFormat": { "type": "number", "enum": [ @@ -6074,6 +6128,9 @@ "example": 12, "description": "Must be 12 or 24" }, + "defaultScheduleId": { + "type": "number" + }, "weekStart": { "type": "string", "enum": [ @@ -6087,6 +6144,9 @@ ], "example": "Monday" }, + "timeZone": { + "type": "string" + }, "locale": { "enum": [ "ar", @@ -6135,17 +6195,10 @@ "type": "string", "example": "en" }, - "email": { - "type": "string" - }, - "name": { - "type": "string" - }, - "defaultScheduleId": { - "type": "number" - }, - "timeZone": { - "type": "string" + "avatarUrl": { + "type": "string", + "example": "https://cal.com/api/avatar/2b735186-b01b-46d3-87da-019b8f61776b.png", + "description": "URL of the user's avatar image" } } }, @@ -6192,7 +6245,40 @@ }, "CreateOAuthClientInput": { "type": "object", - "properties": {} + "properties": { + "logo": { + "type": "string" + }, + "name": { + "type": "string" + }, + "redirectUris": { + "type": "array", + "items": { + "type": "string" + } + }, + "permissions": { + "type": "number" + }, + "bookingRedirectUri": { + "type": "string" + }, + "bookingCancelRedirectUri": { + "type": "string" + }, + "bookingRescheduleRedirectUri": { + "type": "string" + }, + "areEmailsEnabled": { + "type": "boolean" + } + }, + "required": [ + "name", + "redirectUris", + "permissions" + ] }, "DataDto": { "type": "object", @@ -6345,7 +6431,6 @@ "type": "string" }, "redirectUris": { - "default": [], "type": "array", "items": { "type": "string" @@ -7000,6 +7085,10 @@ "type": "number", "description": "The number of bookings per year", "example": 4 + }, + "disabled": { + "type": "boolean", + "default": false } } }, @@ -7476,6 +7565,11 @@ }, "hideCalendarEventDetails": { "type": "boolean" + }, + "successRedirectUrl": { + "type": "string", + "description": "A valid URL where the booker will redirect to, once the booking is completed successfully", + "example": "https://masterchief.com/argentina/flan/video/9129412" } }, "required": [ @@ -7564,7 +7658,7 @@ "unknown" ], "example": "integration", - "description": "only allowed value for type is `integration`" + "description": "Only allowed value for type is `integration`" }, "integration": { "type": "string", @@ -7604,10 +7698,12 @@ "example": "cal-video" }, "link": { - "type": "string" + "type": "string", + "example": "https://example.com" }, "credentialId": { - "type": "number" + "type": "number", + "description": "Credential ID associated with the integration" } }, "required": [ @@ -8632,7 +8728,7 @@ "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.", "type": "array", "items": { - "type": "string" + "type": "number" } }, "title": { @@ -8737,8 +8833,9 @@ "type": "boolean" }, "slotInterval": { - "type": "number", - "example": 60 + "type": "object", + "example": 60, + "nullable": true }, "minimumBookingNotice": { "type": "number", @@ -8753,7 +8850,12 @@ "example": 0 }, "recurrence": { - "type": "object" + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Recurrence_2024_06_14" + } + ] }, "metadata": { "type": "object" @@ -8768,22 +8870,27 @@ "type": "boolean" }, "seatsPerTimeSlot": { - "type": "object" + "type": "object", + "nullable": true }, "forwardParamsSuccessRedirect": { - "type": "object" + "type": "object", + "nullable": true }, "successRedirectUrl": { - "type": "object" + "type": "object", + "nullable": true }, "isInstantEvent": { "type": "boolean" }, "seatsShowAvailabilityCount": { - "type": "object" + "type": "boolean", + "nullable": true }, "scheduleId": { - "type": "object" + "type": "number", + "nullable": true }, "bookingLimitsCount": { "type": "object" @@ -8858,43 +8965,21 @@ "required": [ "id", "lengthInMinutes", - "lengthInMinutesOptions", "title", "slug", "description", "locations", "bookingFields", "disableGuests", - "slotInterval", - "minimumBookingNotice", - "beforeEventBuffer", - "afterEventBuffer", "recurrence", "metadata", "price", "currency", "lockTimeZoneToggleOnBookingPage", - "seatsPerTimeSlot", "forwardParamsSuccessRedirect", "successRedirectUrl", "isInstantEvent", - "seatsShowAvailabilityCount", "scheduleId", - "bookingLimitsCount", - "onlyShowFirstAvailableSlot", - "bookingLimitsDuration", - "bookingWindow", - "bookerLayouts", - "confirmationPolicy", - "requiresBookerEmailVerification", - "hideCalendarNotes", - "color", - "seats", - "offsetStart", - "customName", - "destinationCalendar", - "useDestinationCalendarEmail", - "hideCalendarEventDetails", "ownerId", "users" ] @@ -9205,6 +9290,11 @@ }, "hideCalendarEventDetails": { "type": "boolean" + }, + "successRedirectUrl": { + "type": "string", + "description": "A valid URL where the booker will redirect to, once the booking is completed successfully", + "example": "https://masterchief.com/argentina/flan/video/9129412" } }, "required": [ @@ -9413,7 +9503,8 @@ }, "required": [ "id", - "name" + "name", + "isOrganization" ] }, "OrgTeamsOutputResponseDto": { @@ -9487,13 +9578,19 @@ "properties": { "name": { "type": "string", - "minLength": 1 + "minLength": 1, + "description": "Name of the team", + "example": "CalTeam" }, "slug": { - "type": "string" + "type": "string", + "description": "Team slug", + "example": "caltel" }, "logoUrl": { - "type": "string" + "type": "string", + "example": "https://i.cal.com/api/avatar/b0b58752-68ad-4c0d-8024-4fa382a77752.png", + "description": "URL of the teams logo image" }, "calVideoLogo": { "type": "string" @@ -9508,8 +9605,7 @@ "type": "string" }, "hideBranding": { - "type": "boolean", - "default": false + "type": "boolean" }, "isPrivate": { "type": "boolean" @@ -9530,18 +9626,21 @@ "type": "string" }, "bannerUrl": { - "type": "string" + "type": "string", + "example": "https://i.cal.com/api/avatar/949be534-7a88-4185-967c-c020b0c0bef3.png", + "description": "URL of the teams banner image which is shown on booker" }, "timeFormat": { "type": "number" }, "timeZone": { "type": "string", - "default": "Europe/London" + "example": "America/New_York", + "description": "Timezone is used to create teams's default schedule from Monday to Friday from 9AM to 5PM. It will default to Europe/London if not passed." }, "weekStart": { "type": "string", - "default": "Sunday" + "example": "Monday" }, "bookingLimits": { "type": "string" @@ -9556,13 +9655,19 @@ "properties": { "name": { "type": "string", - "minLength": 1 + "minLength": 1, + "description": "Name of the team", + "example": "CalTeam" }, "slug": { - "type": "string" + "type": "string", + "description": "Team slug", + "example": "caltel" }, "logoUrl": { - "type": "string" + "type": "string", + "example": "https://i.cal.com/api/avatar/b0b58752-68ad-4c0d-8024-4fa382a77752.png", + "description": "URL of the teams logo image" }, "calVideoLogo": { "type": "string" @@ -9599,18 +9704,23 @@ "type": "string" }, "bannerUrl": { - "type": "string" + "type": "string", + "example": "https://i.cal.com/api/avatar/949be534-7a88-4185-967c-c020b0c0bef3.png", + "description": "URL of the teams banner image which is shown on booker" }, "timeFormat": { "type": "number" }, "timeZone": { "type": "string", - "default": "Europe/London" + "default": "Europe/London", + "example": "America/New_York", + "description": "Timezone is used to create teams's default schedule from Monday to Friday from 9AM to 5PM. It will default to Europe/London if not passed." }, "weekStart": { "type": "string", - "default": "Sunday" + "default": "Sunday", + "example": "Monday" }, "autoAcceptCreator": { "type": "boolean", @@ -9625,7 +9735,7 @@ "type": "object", "properties": { "days": { - "type": "string", + "type": "array", "enum": [ "Monday", "Tuesday", @@ -9639,7 +9749,19 @@ "Monday", "Tuesday" ], - "description": "Array of days when schedule is active." + "description": "Array of days when schedule is active.", + "items": { + "type": "string", + "enum": [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday" + ] + } }, "startTime": { "type": "string", @@ -10251,18 +10373,21 @@ "example": "https://example.com/avatar.jpg" }, "organizationRole": { - "type": "object", - "default": "MEMBER" + "type": "string", + "default": "MEMBER", + "enum": [ + "MEMBER", + "ADMIN", + "OWNER" + ] }, "autoAccept": { - "type": "object", + "type": "boolean", "default": true } }, "required": [ - "email", - "organizationRole", - "autoAccept" + "email" ] }, "GetOrganizationUserOutput": { @@ -10292,14 +10417,6 @@ "OrgMembershipOutputDto": { "type": "object", "properties": { - "role": { - "type": "string", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] - }, "id": { "type": "number" }, @@ -10312,16 +10429,24 @@ "accepted": { "type": "boolean" }, + "role": { + "type": "string", + "enum": [ + "MEMBER", + "OWNER", + "ADMIN" + ] + }, "disableImpersonation": { "type": "boolean" } }, "required": [ - "role", "id", "userId", "teamId", - "accepted" + "accepted", + "role" ] }, "GetAllOrgMemberships": { @@ -10347,6 +10472,13 @@ "CreateOrgMembershipDto": { "type": "object", "properties": { + "userId": { + "type": "number" + }, + "accepted": { + "type": "boolean", + "default": false + }, "role": { "type": "string", "default": "MEMBER", @@ -10356,21 +10488,14 @@ "ADMIN" ] }, - "userId": { - "type": "number" - }, - "accepted": { - "type": "boolean", - "default": false - }, "disableImpersonation": { "type": "boolean", "default": false } }, "required": [ - "role", - "userId" + "userId", + "role" ] }, "CreateOrgMembershipOutput": { @@ -10436,22 +10561,19 @@ "UpdateOrgMembershipDto": { "type": "object", "properties": { + "accepted": { + "type": "boolean" + }, "role": { "type": "string", - "default": "MEMBER", "enum": [ "MEMBER", "OWNER", "ADMIN" ] }, - "accepted": { - "type": "boolean", - "default": false - }, "disableImpersonation": { - "type": "boolean", - "default": false + "type": "boolean" } } }, @@ -10740,6 +10862,11 @@ "hideCalendarEventDetails": { "type": "boolean" }, + "successRedirectUrl": { + "type": "string", + "description": "A valid URL where the booker will redirect to, once the booking is completed successfully", + "example": "https://masterchief.com/argentina/flan/video/9129412" + }, "schedulingType": { "type": "object" }, @@ -10819,6 +10946,11 @@ "name": { "type": "string", "example": "John Doe" + }, + "avatarUrl": { + "type": "string", + "nullable": true, + "example": "https://cal.com/api/avatar/d95949bc-ccb1-400f-acf6-045c51a16856.png" } }, "required": [ @@ -10964,10 +11096,12 @@ }, "beforeEventBuffer": { "type": "number", + "minimum": 0, "example": 0 }, "afterEventBuffer": { "type": "number", + "minimum": 0, "example": 0 }, "recurrence": { @@ -11103,6 +11237,9 @@ "COLLECTIVE", "MANAGED" ] + }, + "bannerUrl": { + "type": "string" } }, "required": [ @@ -11508,6 +11645,11 @@ "hideCalendarEventDetails": { "type": "boolean" }, + "successRedirectUrl": { + "type": "string", + "description": "A valid URL where the booker will redirect to, once the booking is completed successfully", + "example": "https://masterchief.com/argentina/flan/video/9129412" + }, "hosts": { "type": "array", "items": { @@ -11596,14 +11738,6 @@ "OrgTeamMembershipOutputDto": { "type": "object", "properties": { - "role": { - "type": "string", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] - }, "id": { "type": "number" }, @@ -11616,6 +11750,14 @@ "accepted": { "type": "boolean" }, + "role": { + "type": "string", + "enum": [ + "MEMBER", + "OWNER", + "ADMIN" + ] + }, "disableImpersonation": { "type": "boolean" }, @@ -11624,11 +11766,11 @@ } }, "required": [ - "role", "id", "userId", "teamId", "accepted", + "role", "user" ] }, @@ -11678,37 +11820,25 @@ "UpdateOrgTeamMembershipDto": { "type": "object", "properties": { + "accepted": { + "type": "boolean" + }, "role": { "type": "string", - "default": "MEMBER", "enum": [ "MEMBER", "OWNER", "ADMIN" ] }, - "accepted": { - "type": "boolean", - "default": false - }, "disableImpersonation": { - "type": "boolean", - "default": false + "type": "boolean" } } }, "CreateOrgTeamMembershipDto": { "type": "object", "properties": { - "role": { - "type": "string", - "default": "MEMBER", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] - }, "userId": { "type": "number" }, @@ -11716,14 +11846,23 @@ "type": "boolean", "default": false }, + "role": { + "type": "string", + "default": "MEMBER", + "enum": [ + "MEMBER", + "OWNER", + "ADMIN" + ] + }, "disableImpersonation": { "type": "boolean", "default": false } }, "required": [ - "role", - "userId" + "userId", + "role" ] }, "Attribute": { @@ -11852,7 +11991,13 @@ "type": "string" }, "type": { - "type": "object" + "type": "string", + "enum": [ + "TEXT", + "NUMBER", + "SINGLE_SELECT", + "MULTI_SELECT" + ] }, "options": { "type": "array", @@ -11901,7 +12046,13 @@ "type": "string" }, "type": { - "type": "object" + "type": "string", + "enum": [ + "TEXT", + "NUMBER", + "SINGLE_SELECT", + "MULTI_SELECT" + ] }, "enabled": { "type": "boolean" @@ -12272,6 +12423,12 @@ "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information", "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}" }, + "active": { + "type": "boolean" + }, + "subscriberUrl": { + "type": "string" + }, "triggers": { "type": "string", "example": [ @@ -12305,20 +12462,14 @@ "FORM_SUBMITTED_NO_EVENT" ] }, - "active": { - "type": "boolean" - }, - "subscriberUrl": { - "type": "string" - }, "secret": { "type": "string" } }, "required": [ - "triggers", "active", - "subscriberUrl" + "subscriberUrl", + "triggers" ] }, "TeamWebhookOutputResponseDto": { @@ -12349,6 +12500,12 @@ "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information", "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}" }, + "active": { + "type": "boolean" + }, + "subscriberUrl": { + "type": "string" + }, "triggers": { "type": "string", "example": [ @@ -12382,12 +12539,6 @@ "FORM_SUBMITTED_NO_EVENT" ] }, - "active": { - "type": "boolean" - }, - "subscriberUrl": { - "type": "string" - }, "secret": { "type": "string" } @@ -13288,7 +13439,6 @@ }, "required": [ "start", - "lengthInMinutes", "eventTypeId", "attendee" ] @@ -13363,7 +13513,6 @@ }, "required": [ "start", - "lengthInMinutes", "eventTypeId", "attendee", "instant" @@ -13439,7 +13588,6 @@ }, "required": [ "start", - "lengthInMinutes", "eventTypeId", "attendee" ] @@ -13616,9 +13764,11 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", - "attendees" + "attendees", + "bookingFieldsResponses" ] }, "RecurringBookingOutput_2024_08_13": { @@ -13753,9 +13903,11 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "attendees", + "bookingFieldsResponses", "recurringBookingUid" ] }, @@ -13766,6 +13918,10 @@ "type": "string", "example": "John Doe" }, + "email": { + "type": "string", + "example": "john@example.com" + }, "timeZone": { "type": "string", "example": "America/New_York" @@ -13842,9 +13998,11 @@ }, "required": [ "name", + "email", "timeZone", "absent", - "seatUid" + "seatUid", + "bookingFieldsResponses" ] }, "CreateSeatedBookingOutput_2024_08_13": { @@ -13962,6 +14120,7 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "seatUid", @@ -14087,6 +14246,7 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "seatUid", @@ -14245,6 +14405,7 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "attendees" @@ -14365,6 +14526,7 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "attendees", @@ -14549,22 +14711,12 @@ "description": "Whether the host was absent" }, "attendees": { - "description": "Toggle whether an attendee was absent or not.", - "example": [ - { - "absent": true, - "email": "someone@gmail.com" - } - ], "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Attendee" } } - }, - "required": [ - "attendees" - ] + } }, "MarkAbsentBookingOutput_2024_08_13": { "type": "object", @@ -14669,6 +14821,13 @@ "CreateTeamMembershipInput": { "type": "object", "properties": { + "userId": { + "type": "number" + }, + "accepted": { + "type": "boolean", + "default": false + }, "role": { "type": "string", "default": "MEMBER", @@ -14678,34 +14837,18 @@ "ADMIN" ] }, - "userId": { - "type": "number" - }, - "accepted": { - "type": "boolean", - "default": false - }, "disableImpersonation": { "type": "boolean", "default": false } }, "required": [ - "role", "userId" ] }, "TeamMembershipOutput": { "type": "object", "properties": { - "role": { - "type": "string", - "enum": [ - "MEMBER", - "OWNER", - "ADMIN" - ] - }, "id": { "type": "number" }, @@ -14718,16 +14861,24 @@ "accepted": { "type": "boolean" }, + "role": { + "type": "string", + "enum": [ + "MEMBER", + "OWNER", + "ADMIN" + ] + }, "disableImpersonation": { "type": "boolean" } }, "required": [ - "role", "id", "userId", "teamId", - "accepted" + "accepted", + "role" ] }, "CreateTeamMembershipOutput": { @@ -14793,22 +14944,19 @@ "UpdateTeamMembershipInput": { "type": "object", "properties": { + "accepted": { + "type": "boolean" + }, "role": { "type": "string", - "default": "MEMBER", "enum": [ "MEMBER", "OWNER", "ADMIN" ] }, - "accepted": { - "type": "boolean", - "default": false - }, "disableImpersonation": { - "type": "boolean", - "default": false + "type": "boolean" } } }, @@ -15249,7 +15397,6 @@ "properties": { "status": { "type": "string", - "example": "success", "enum": [ "success", "error" @@ -15285,7 +15432,6 @@ "properties": { "status": { "type": "string", - "example": "success", "enum": [ "success", "error" diff --git a/docs/api-reference/v2/openapi.json b/docs/api-reference/v2/openapi.json index c6b647791e..4976601980 100644 --- a/docs/api-reference/v2/openapi.json +++ b/docs/api-reference/v2/openapi.json @@ -3420,16 +3420,19 @@ } }, { - "name": "calendarsToLoad", - "required": true, + "name": "credentialId", "in": "query", - "description": "An array of Calendar objects representing the calendars to be loaded", - "example": "[{ credentialId: \"1\", externalId: \"AQgtJE7RnHEeyisVq2ENs2gAAAgEGAAAACgtJE7RnHEeyisVq2ENs2gAAAhSDAAAA\" }, { credentialId: \"2\", externalId: \"AQM7RnHEeyisVq2ENs2gAAAhFDBBBBB\" }]", + "required": true, "schema": { - "type": "array", - "items": { - "type": "string" - } + "type": "number" + } + }, + { + "name": "externalId", + "in": "query", + "required": true, + "schema": { + "type": "string" } } ], @@ -4843,7 +4846,7 @@ }, { "name": "eventTypeId", - "required": true, + "required": false, "in": "query", "description": "Event Type ID for which slots are being fetched.", "example": 100, @@ -4853,7 +4856,7 @@ }, { "name": "eventTypeSlug", - "required": true, + "required": false, "in": "query", "description": "Slug of the event type for which slots are being fetched.", "schema": { @@ -4862,7 +4865,7 @@ }, { "name": "usernameList", - "required": true, + "required": false, "in": "query", "description": "Only for dynamic events - list of usernames for which slots are being fetched.", "schema": { @@ -4872,15 +4875,49 @@ } } }, + { + "name": "debug", + "required": false, + "in": "query", + "schema": { + "type": "boolean" + } + }, { "name": "duration", - "required": true, + "required": false, "in": "query", "description": "Only for dynamic events - length of returned slots.", "schema": { "type": "number" } }, + { + "name": "rescheduleUid", + "required": false, + "in": "query", + "schema": { + "nullable": true, + "type": "string" + } + }, + { + "name": "timeZone", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "orgSlug", + "required": false, + "in": "query", + "description": "Organization slug.", + "schema": { + "type": "string" + } + }, { "name": "slotFormat", "required": false, @@ -5571,6 +5608,12 @@ ], "type": "string", "example": "en" + }, + "avatarUrl": { + "type": "string", + "nullable": true, + "example": "https://cal.com/api/avatar/2b735186-b01b-46d3-87da-019b8f61776b.png", + "description": "URL of the user's avatar image" } }, "required": [ @@ -5677,6 +5720,11 @@ ], "type": "string", "example": "en" + }, + "avatarUrl": { + "type": "string", + "example": "https://cal.com/api/avatar/2b735186-b01b-46d3-87da-019b8f61776b.png", + "description": "URL of the user's avatar image" } }, "required": ["email", "name"] @@ -5733,17 +5781,29 @@ "UpdateManagedUserInput": { "type": "object", "properties": { + "email": { + "type": "string" + }, + "name": { + "type": "string" + }, "timeFormat": { "type": "number", "enum": [12, 24], "example": 12, "description": "Must be 12 or 24" }, + "defaultScheduleId": { + "type": "number" + }, "weekStart": { "type": "string", "enum": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], "example": "Monday" }, + "timeZone": { + "type": "string" + }, "locale": { "enum": [ "ar", @@ -5792,17 +5852,10 @@ "type": "string", "example": "en" }, - "email": { - "type": "string" - }, - "name": { - "type": "string" - }, - "defaultScheduleId": { - "type": "number" - }, - "timeZone": { - "type": "string" + "avatarUrl": { + "type": "string", + "example": "https://cal.com/api/avatar/2b735186-b01b-46d3-87da-019b8f61776b.png", + "description": "URL of the user's avatar image" } } }, @@ -5839,7 +5892,36 @@ }, "CreateOAuthClientInput": { "type": "object", - "properties": {} + "properties": { + "logo": { + "type": "string" + }, + "name": { + "type": "string" + }, + "redirectUris": { + "type": "array", + "items": { + "type": "string" + } + }, + "permissions": { + "type": "number" + }, + "bookingRedirectUri": { + "type": "string" + }, + "bookingCancelRedirectUri": { + "type": "string" + }, + "bookingRescheduleRedirectUri": { + "type": "string" + }, + "areEmailsEnabled": { + "type": "boolean" + } + }, + "required": ["name", "redirectUris", "permissions"] }, "DataDto": { "type": "object", @@ -5961,7 +6043,6 @@ "type": "string" }, "redirectUris": { - "default": [], "type": "array", "items": { "type": "string" @@ -6494,6 +6575,10 @@ "type": "number", "description": "The number of bookings per year", "example": 4 + }, + "disabled": { + "type": "boolean", + "default": false } } }, @@ -6924,6 +7009,11 @@ }, "hideCalendarEventDetails": { "type": "boolean" + }, + "successRedirectUrl": { + "type": "string", + "description": "A valid URL where the booker will redirect to, once the booking is completed successfully", + "example": "https://masterchief.com/argentina/flan/video/9129412" } }, "required": ["lengthInMinutes", "lengthInMinutesOptions", "title", "slug"] @@ -6999,7 +7089,7 @@ "unknown" ], "example": "integration", - "description": "only allowed value for type is `integration`" + "description": "Only allowed value for type is `integration`" }, "integration": { "type": "string", @@ -7039,10 +7129,12 @@ "example": "cal-video" }, "link": { - "type": "string" + "type": "string", + "example": "https://example.com" }, "credentialId": { - "type": "number" + "type": "number", + "description": "Credential ID associated with the integration" } }, "required": ["type", "integration"] @@ -7934,7 +8026,7 @@ "description": "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.", "type": "array", "items": { - "type": "string" + "type": "number" } }, "title": { @@ -8039,8 +8131,9 @@ "type": "boolean" }, "slotInterval": { - "type": "number", - "example": 60 + "type": "object", + "example": 60, + "nullable": true }, "minimumBookingNotice": { "type": "number", @@ -8055,7 +8148,12 @@ "example": 0 }, "recurrence": { - "type": "object" + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/Recurrence_2024_06_14" + } + ] }, "metadata": { "type": "object" @@ -8070,22 +8168,27 @@ "type": "boolean" }, "seatsPerTimeSlot": { - "type": "object" + "type": "object", + "nullable": true }, "forwardParamsSuccessRedirect": { - "type": "object" + "type": "object", + "nullable": true }, "successRedirectUrl": { - "type": "object" + "type": "object", + "nullable": true }, "isInstantEvent": { "type": "boolean" }, "seatsShowAvailabilityCount": { - "type": "object" + "type": "boolean", + "nullable": true }, "scheduleId": { - "type": "object" + "type": "number", + "nullable": true }, "bookingLimitsCount": { "type": "object" @@ -8160,43 +8263,21 @@ "required": [ "id", "lengthInMinutes", - "lengthInMinutesOptions", "title", "slug", "description", "locations", "bookingFields", "disableGuests", - "slotInterval", - "minimumBookingNotice", - "beforeEventBuffer", - "afterEventBuffer", "recurrence", "metadata", "price", "currency", "lockTimeZoneToggleOnBookingPage", - "seatsPerTimeSlot", "forwardParamsSuccessRedirect", "successRedirectUrl", "isInstantEvent", - "seatsShowAvailabilityCount", "scheduleId", - "bookingLimitsCount", - "onlyShowFirstAvailableSlot", - "bookingLimitsDuration", - "bookingWindow", - "bookerLayouts", - "confirmationPolicy", - "requiresBookerEmailVerification", - "hideCalendarNotes", - "color", - "seats", - "offsetStart", - "customName", - "destinationCalendar", - "useDestinationCalendarEmail", - "hideCalendarEventDetails", "ownerId", "users" ] @@ -8485,6 +8566,11 @@ }, "hideCalendarEventDetails": { "type": "boolean" + }, + "successRedirectUrl": { + "type": "string", + "description": "A valid URL where the booker will redirect to, once the booking is completed successfully", + "example": "https://masterchief.com/argentina/flan/video/9129412" } }, "required": ["lengthInMinutesOptions"] @@ -8657,7 +8743,7 @@ "default": "Sunday" } }, - "required": ["id", "name"] + "required": ["id", "name", "isOrganization"] }, "OrgTeamsOutputResponseDto": { "type": "object", @@ -8712,13 +8798,19 @@ "properties": { "name": { "type": "string", - "minLength": 1 + "minLength": 1, + "description": "Name of the team", + "example": "CalTeam" }, "slug": { - "type": "string" + "type": "string", + "description": "Team slug", + "example": "caltel" }, "logoUrl": { - "type": "string" + "type": "string", + "example": "https://i.cal.com/api/avatar/b0b58752-68ad-4c0d-8024-4fa382a77752.png", + "description": "URL of the teams logo image" }, "calVideoLogo": { "type": "string" @@ -8733,8 +8825,7 @@ "type": "string" }, "hideBranding": { - "type": "boolean", - "default": false + "type": "boolean" }, "isPrivate": { "type": "boolean" @@ -8755,18 +8846,21 @@ "type": "string" }, "bannerUrl": { - "type": "string" + "type": "string", + "example": "https://i.cal.com/api/avatar/949be534-7a88-4185-967c-c020b0c0bef3.png", + "description": "URL of the teams banner image which is shown on booker" }, "timeFormat": { "type": "number" }, "timeZone": { "type": "string", - "default": "Europe/London" + "example": "America/New_York", + "description": "Timezone is used to create teams's default schedule from Monday to Friday from 9AM to 5PM. It will default to Europe/London if not passed." }, "weekStart": { "type": "string", - "default": "Sunday" + "example": "Monday" }, "bookingLimits": { "type": "string" @@ -8781,13 +8875,19 @@ "properties": { "name": { "type": "string", - "minLength": 1 + "minLength": 1, + "description": "Name of the team", + "example": "CalTeam" }, "slug": { - "type": "string" + "type": "string", + "description": "Team slug", + "example": "caltel" }, "logoUrl": { - "type": "string" + "type": "string", + "example": "https://i.cal.com/api/avatar/b0b58752-68ad-4c0d-8024-4fa382a77752.png", + "description": "URL of the teams logo image" }, "calVideoLogo": { "type": "string" @@ -8824,18 +8924,23 @@ "type": "string" }, "bannerUrl": { - "type": "string" + "type": "string", + "example": "https://i.cal.com/api/avatar/949be534-7a88-4185-967c-c020b0c0bef3.png", + "description": "URL of the teams banner image which is shown on booker" }, "timeFormat": { "type": "number" }, "timeZone": { "type": "string", - "default": "Europe/London" + "default": "Europe/London", + "example": "America/New_York", + "description": "Timezone is used to create teams's default schedule from Monday to Friday from 9AM to 5PM. It will default to Europe/London if not passed." }, "weekStart": { "type": "string", - "default": "Sunday" + "default": "Sunday", + "example": "Monday" }, "autoAcceptCreator": { "type": "boolean", @@ -8848,10 +8953,14 @@ "type": "object", "properties": { "days": { - "type": "string", + "type": "array", "enum": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], "example": ["Monday", "Tuesday"], - "description": "Array of days when schedule is active." + "description": "Array of days when schedule is active.", + "items": { + "type": "string", + "enum": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] + } }, "startTime": { "type": "string", @@ -9381,15 +9490,16 @@ "example": "https://example.com/avatar.jpg" }, "organizationRole": { - "type": "object", - "default": "MEMBER" + "type": "string", + "default": "MEMBER", + "enum": ["MEMBER", "ADMIN", "OWNER"] }, "autoAccept": { - "type": "object", + "type": "boolean", "default": true } }, - "required": ["email", "organizationRole", "autoAccept"] + "required": ["email"] }, "GetOrganizationUserOutput": { "type": "object", @@ -9412,10 +9522,6 @@ "OrgMembershipOutputDto": { "type": "object", "properties": { - "role": { - "type": "string", - "enum": ["MEMBER", "OWNER", "ADMIN"] - }, "id": { "type": "number" }, @@ -9428,11 +9534,15 @@ "accepted": { "type": "boolean" }, + "role": { + "type": "string", + "enum": ["MEMBER", "OWNER", "ADMIN"] + }, "disableImpersonation": { "type": "boolean" } }, - "required": ["role", "id", "userId", "teamId", "accepted"] + "required": ["id", "userId", "teamId", "accepted", "role"] }, "GetAllOrgMemberships": { "type": "object", @@ -9451,11 +9561,6 @@ "CreateOrgMembershipDto": { "type": "object", "properties": { - "role": { - "type": "string", - "default": "MEMBER", - "enum": ["MEMBER", "OWNER", "ADMIN"] - }, "userId": { "type": "number" }, @@ -9463,12 +9568,17 @@ "type": "boolean", "default": false }, + "role": { + "type": "string", + "default": "MEMBER", + "enum": ["MEMBER", "OWNER", "ADMIN"] + }, "disableImpersonation": { "type": "boolean", "default": false } }, - "required": ["role", "userId"] + "required": ["userId", "role"] }, "CreateOrgMembershipOutput": { "type": "object", @@ -9515,18 +9625,15 @@ "UpdateOrgMembershipDto": { "type": "object", "properties": { + "accepted": { + "type": "boolean" + }, "role": { "type": "string", - "default": "MEMBER", "enum": ["MEMBER", "OWNER", "ADMIN"] }, - "accepted": { - "type": "boolean", - "default": false - }, "disableImpersonation": { - "type": "boolean", - "default": false + "type": "boolean" } } }, @@ -9797,6 +9904,11 @@ "hideCalendarEventDetails": { "type": "boolean" }, + "successRedirectUrl": { + "type": "string", + "description": "A valid URL where the booker will redirect to, once the booking is completed successfully", + "example": "https://masterchief.com/argentina/flan/video/9129412" + }, "schedulingType": { "type": "object" }, @@ -9857,6 +9969,11 @@ "name": { "type": "string", "example": "John Doe" + }, + "avatarUrl": { + "type": "string", + "nullable": true, + "example": "https://cal.com/api/avatar/d95949bc-ccb1-400f-acf6-045c51a16856.png" } }, "required": ["userId", "name"] @@ -9995,10 +10112,12 @@ }, "beforeEventBuffer": { "type": "number", + "minimum": 0, "example": 0 }, "afterEventBuffer": { "type": "number", + "minimum": 0, "example": 0 }, "recurrence": { @@ -10130,6 +10249,9 @@ "type": "string", "nullable": true, "enum": ["ROUND_ROBIN", "COLLECTIVE", "MANAGED"] + }, + "bannerUrl": { + "type": "string" } }, "required": [ @@ -10501,6 +10623,11 @@ "hideCalendarEventDetails": { "type": "boolean" }, + "successRedirectUrl": { + "type": "string", + "description": "A valid URL where the booker will redirect to, once the booking is completed successfully", + "example": "https://masterchief.com/argentina/flan/video/9129412" + }, "hosts": { "type": "array", "items": { @@ -10573,10 +10700,6 @@ "OrgTeamMembershipOutputDto": { "type": "object", "properties": { - "role": { - "type": "string", - "enum": ["MEMBER", "OWNER", "ADMIN"] - }, "id": { "type": "number" }, @@ -10589,6 +10712,10 @@ "accepted": { "type": "boolean" }, + "role": { + "type": "string", + "enum": ["MEMBER", "OWNER", "ADMIN"] + }, "disableImpersonation": { "type": "boolean" }, @@ -10596,7 +10723,7 @@ "$ref": "#/components/schemas/MembershipUserOutputDto" } }, - "required": ["role", "id", "userId", "teamId", "accepted", "user"] + "required": ["id", "userId", "teamId", "accepted", "role", "user"] }, "OrgTeamMembershipsOutputResponseDto": { "type": "object", @@ -10632,29 +10759,21 @@ "UpdateOrgTeamMembershipDto": { "type": "object", "properties": { + "accepted": { + "type": "boolean" + }, "role": { "type": "string", - "default": "MEMBER", "enum": ["MEMBER", "OWNER", "ADMIN"] }, - "accepted": { - "type": "boolean", - "default": false - }, "disableImpersonation": { - "type": "boolean", - "default": false + "type": "boolean" } } }, "CreateOrgTeamMembershipDto": { "type": "object", "properties": { - "role": { - "type": "string", - "default": "MEMBER", - "enum": ["MEMBER", "OWNER", "ADMIN"] - }, "userId": { "type": "number" }, @@ -10662,12 +10781,17 @@ "type": "boolean", "default": false }, + "role": { + "type": "string", + "default": "MEMBER", + "enum": ["MEMBER", "OWNER", "ADMIN"] + }, "disableImpersonation": { "type": "boolean", "default": false } }, - "required": ["role", "userId"] + "required": ["userId", "role"] }, "Attribute": { "type": "object", @@ -10768,7 +10892,8 @@ "type": "string" }, "type": { - "type": "object" + "type": "string", + "enum": ["TEXT", "NUMBER", "SINGLE_SELECT", "MULTI_SELECT"] }, "options": { "type": "array", @@ -10806,7 +10931,8 @@ "type": "string" }, "type": { - "type": "object" + "type": "string", + "enum": ["TEXT", "NUMBER", "SINGLE_SELECT", "MULTI_SELECT"] }, "enabled": { "type": "boolean" @@ -11094,6 +11220,12 @@ "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information", "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}" }, + "active": { + "type": "boolean" + }, + "subscriberUrl": { + "type": "string" + }, "triggers": { "type": "string", "example": [ @@ -11127,17 +11259,11 @@ "FORM_SUBMITTED_NO_EVENT" ] }, - "active": { - "type": "boolean" - }, - "subscriberUrl": { - "type": "string" - }, "secret": { "type": "string" } }, - "required": ["triggers", "active", "subscriberUrl"] + "required": ["active", "subscriberUrl", "triggers"] }, "TeamWebhookOutputResponseDto": { "type": "object", @@ -11161,6 +11287,12 @@ "description": "The template of the payload that will be sent to the subscriberUrl, check cal.com/docs/core-features/webhooks for more information", "example": "{\"content\":\"A new event has been scheduled\",\"type\":\"{{type}}\",\"name\":\"{{title}}\",\"organizer\":\"{{organizer.name}}\",\"booker\":\"{{attendees.0.name}}\"}" }, + "active": { + "type": "boolean" + }, + "subscriberUrl": { + "type": "string" + }, "triggers": { "type": "string", "example": [ @@ -11194,12 +11326,6 @@ "FORM_SUBMITTED_NO_EVENT" ] }, - "active": { - "type": "boolean" - }, - "subscriberUrl": { - "type": "string" - }, "secret": { "type": "string" } @@ -11963,7 +12089,7 @@ } } }, - "required": ["start", "lengthInMinutes", "eventTypeId", "attendee"] + "required": ["start", "eventTypeId", "attendee"] }, "CreateInstantBookingInput_2024_08_13": { "type": "object", @@ -12030,7 +12156,7 @@ "example": true } }, - "required": ["start", "lengthInMinutes", "eventTypeId", "attendee", "instant"] + "required": ["start", "eventTypeId", "attendee", "instant"] }, "CreateRecurringBookingInput_2024_08_13": { "type": "object", @@ -12097,7 +12223,7 @@ "example": 5 } }, - "required": ["start", "lengthInMinutes", "eventTypeId", "attendee"] + "required": ["start", "eventTypeId", "attendee"] }, "BookingHost": { "type": "object", @@ -12255,9 +12381,11 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", - "attendees" + "attendees", + "bookingFieldsResponses" ] }, "RecurringBookingOutput_2024_08_13": { @@ -12384,9 +12512,11 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "attendees", + "bookingFieldsResponses", "recurringBookingUid" ] }, @@ -12397,6 +12527,10 @@ "type": "string", "example": "John Doe" }, + "email": { + "type": "string", + "example": "john@example.com" + }, "timeZone": { "type": "string", "example": "America/New_York" @@ -12471,7 +12605,7 @@ } } }, - "required": ["name", "timeZone", "absent", "seatUid"] + "required": ["name", "email", "timeZone", "absent", "seatUid", "bookingFieldsResponses"] }, "CreateSeatedBookingOutput_2024_08_13": { "type": "object", @@ -12583,6 +12717,7 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "seatUid", @@ -12703,6 +12838,7 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "seatUid", @@ -12850,6 +12986,7 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "attendees" @@ -12965,6 +13102,7 @@ "duration", "eventTypeId", "eventType", + "location", "absentHost", "createdAt", "attendees", @@ -13125,20 +13263,12 @@ "description": "Whether the host was absent" }, "attendees": { - "description": "Toggle whether an attendee was absent or not.", - "example": [ - { - "absent": true, - "email": "someone@gmail.com" - } - ], "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Attendee" } } - }, - "required": ["attendees"] + } }, "MarkAbsentBookingOutput_2024_08_13": { "type": "object", @@ -13227,11 +13357,6 @@ "CreateTeamMembershipInput": { "type": "object", "properties": { - "role": { - "type": "string", - "default": "MEMBER", - "enum": ["MEMBER", "OWNER", "ADMIN"] - }, "userId": { "type": "number" }, @@ -13239,20 +13364,21 @@ "type": "boolean", "default": false }, + "role": { + "type": "string", + "default": "MEMBER", + "enum": ["MEMBER", "OWNER", "ADMIN"] + }, "disableImpersonation": { "type": "boolean", "default": false } }, - "required": ["role", "userId"] + "required": ["userId"] }, "TeamMembershipOutput": { "type": "object", "properties": { - "role": { - "type": "string", - "enum": ["MEMBER", "OWNER", "ADMIN"] - }, "id": { "type": "number" }, @@ -13265,11 +13391,15 @@ "accepted": { "type": "boolean" }, + "role": { + "type": "string", + "enum": ["MEMBER", "OWNER", "ADMIN"] + }, "disableImpersonation": { "type": "boolean" } }, - "required": ["role", "id", "userId", "teamId", "accepted"] + "required": ["id", "userId", "teamId", "accepted", "role"] }, "CreateTeamMembershipOutput": { "type": "object", @@ -13316,18 +13446,15 @@ "UpdateTeamMembershipInput": { "type": "object", "properties": { + "accepted": { + "type": "boolean" + }, "role": { "type": "string", - "default": "MEMBER", "enum": ["MEMBER", "OWNER", "ADMIN"] }, - "accepted": { - "type": "boolean", - "default": false - }, "disableImpersonation": { - "type": "boolean", - "default": false + "type": "boolean" } } }, @@ -13667,7 +13794,6 @@ "properties": { "status": { "type": "string", - "example": "success", "enum": ["success", "error"] }, "data": { @@ -13692,7 +13818,6 @@ "properties": { "status": { "type": "string", - "example": "success", "enum": ["success", "error"] }, "data": { diff --git a/packages/platform/types/bookings/2024-04-15/inputs/index.ts b/packages/platform/types/bookings/2024-04-15/inputs/index.ts index 970650e5fa..3317bda83b 100644 --- a/packages/platform/types/bookings/2024-04-15/inputs/index.ts +++ b/packages/platform/types/bookings/2024-04-15/inputs/index.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type, Transform } from "class-transformer"; import { ValidateNested, @@ -26,25 +26,30 @@ class Filters { @IsOptional() @IsArray() @Type(() => Number) + @ApiPropertyOptional({ type: [Number] }) teamsIds?: number[]; @IsOptional() @IsArray() @Type(() => Number) + @ApiPropertyOptional({ type: [Number] }) userIds?: number[]; @IsEnum(Status_2024_04_15) + @ApiProperty({ enum: Status_2024_04_15 }) status!: BookingStatus; @IsOptional() @IsArray() @Type(() => Number) + @ApiPropertyOptional({ type: [Number] }) eventTypeIds?: number[]; } export class GetBookingsInput_2024_04_15 { @ValidateNested({ each: true }) @Type(() => Filters) + @ApiProperty({ type: Filters }) filters!: Filters; @Transform(({ value }: { value: string }) => value && parseInt(value)) @@ -52,37 +57,45 @@ export class GetBookingsInput_2024_04_15 { @Min(1) @Max(100) @IsOptional() + @ApiPropertyOptional({ description: "Maximum number of bookings to retrieve.", example: 50 }) limit?: number; @Transform(({ value }: { value: string }) => value && parseInt(value)) @IsNumber() @IsOptional() + @ApiPropertyOptional({ description: "Cursor for pagination.", example: 10, nullable: true }) cursor?: number | null; } export class CancelBookingInput_2024_04_15 { @IsNumber() @IsOptional() - @ApiProperty() + @ApiPropertyOptional({ description: "Booking ID to cancel.", example: 123 }) id?: number; @IsString() @IsOptional() - @ApiProperty() + @ApiPropertyOptional() uid?: string; @IsBoolean() @IsOptional() - @ApiProperty() + @ApiPropertyOptional({ + example: true, + }) allRemainingBookings?: boolean; @IsString() @IsOptional() - @ApiProperty() + @ApiPropertyOptional({ + type: String, + description: "Reason for cancellation.", + example: "Scheduling conflict", + }) cancellationReason?: string; @IsString() @IsOptional() - @ApiProperty() + @ApiPropertyOptional() seatReferenceUid?: string; } diff --git a/packages/platform/types/bookings/2024-08-13/inputs/cancel-booking.input.ts b/packages/platform/types/bookings/2024-08-13/inputs/cancel-booking.input.ts index 22e87c2f1c..c8f7498e1b 100644 --- a/packages/platform/types/bookings/2024-08-13/inputs/cancel-booking.input.ts +++ b/packages/platform/types/bookings/2024-08-13/inputs/cancel-booking.input.ts @@ -1,17 +1,17 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { IsBoolean, IsOptional, IsString } from "class-validator"; export class CancelBookingInput_2024_08_13 { @IsString() @IsOptional() - @ApiProperty({ example: "User requested cancellation" }) + @ApiPropertyOptional({ example: "User requested cancellation" }) cancellationReason?: string; @IsBoolean() @IsOptional() - @ApiProperty({ + @ApiPropertyOptional({ description: - "For recurring non-seated booking - if true, cancel booking with the bookingUid of the individual recorrence and all recurrences that come after it.", + "For recurring non-seated booking - if true, cancel booking with the bookingUid of the individual recurrence and all recurrences that come after it.", }) cancelSubsequentBookings?: boolean; } @@ -20,7 +20,7 @@ export class CancelSeatedBookingInput_2024_08_13 { @ApiProperty({ type: String, example: "3be561a9-31f1-4b8e-aefc-9d9a085f0dd1", - description: "Uid of the specific seat withing booking.", + description: "Uid of the specific seat within booking.", }) @IsString() seatUid!: string; diff --git a/packages/platform/types/bookings/2024-08-13/inputs/create-booking.input.ts b/packages/platform/types/bookings/2024-08-13/inputs/create-booking.input.ts index 1ef11d2a7e..785c4c29b2 100644 --- a/packages/platform/types/bookings/2024-08-13/inputs/create-booking.input.ts +++ b/packages/platform/types/bookings/2024-08-13/inputs/create-booking.input.ts @@ -68,7 +68,7 @@ export class CreateBookingInput_2024_08_13 { @IsOptional() @IsInt() @Min(1) - @ApiProperty({ + @ApiPropertyOptional({ example: 30, description: `If it is an event type that has multiple possible lengths that attendee can pick from, you can pass the desired booking length here. If not provided then event type default length will be used for the booking.`, diff --git a/packages/platform/types/bookings/2024-08-13/inputs/decline-booking.input.ts b/packages/platform/types/bookings/2024-08-13/inputs/decline-booking.input.ts index bfd345ff43..c345968037 100644 --- a/packages/platform/types/bookings/2024-08-13/inputs/decline-booking.input.ts +++ b/packages/platform/types/bookings/2024-08-13/inputs/decline-booking.input.ts @@ -1,12 +1,11 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { IsOptional, IsString } from "class-validator"; export class DeclineBookingInput_2024_08_13 { @IsString() @IsOptional() - @ApiProperty({ + @ApiPropertyOptional({ example: "Host has to take another call", - required: false, description: "Reason for declining a booking that requires a confirmation", }) reason?: string; diff --git a/packages/platform/types/bookings/2024-08-13/inputs/mark-absent.input.ts b/packages/platform/types/bookings/2024-08-13/inputs/mark-absent.input.ts index 4dc28920e4..19e2b6a650 100644 --- a/packages/platform/types/bookings/2024-08-13/inputs/mark-absent.input.ts +++ b/packages/platform/types/bookings/2024-08-13/inputs/mark-absent.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsOptional, IsBoolean, IsEmail, IsArray, ArrayMinSize, ValidateNested } from "class-validator"; @@ -15,18 +15,14 @@ class Attendee { export class MarkAbsentBookingInput_2024_08_13 { @IsBoolean() @IsOptional() - @ApiProperty({ example: false, required: false, description: "Whether the host was absent" }) + @ApiPropertyOptional({ example: false, description: "Whether the host was absent" }) host?: boolean; @ArrayMinSize(1) - @ApiProperty({ - type: [String], - description: "Toggle whether an attendee was absent or not.", - example: [{ absent: true, email: "someone@gmail.com" }], - }) - @ValidateNested() - @Type(() => Attendee) @IsArray() + @ValidateNested({ each: true }) + @Type(() => Attendee) @IsOptional() + @ApiPropertyOptional({ type: [Attendee] }) attendees?: Attendee[]; } diff --git a/packages/platform/types/bookings/2024-08-13/inputs/reassign-to-user.input.ts b/packages/platform/types/bookings/2024-08-13/inputs/reassign-to-user.input.ts index f36fc2c48c..81c9e7e41f 100644 --- a/packages/platform/types/bookings/2024-08-13/inputs/reassign-to-user.input.ts +++ b/packages/platform/types/bookings/2024-08-13/inputs/reassign-to-user.input.ts @@ -1,12 +1,11 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { IsOptional, IsString } from "class-validator"; export class ReassignToUserBookingInput_2024_08_13 { @IsString() @IsOptional() - @ApiProperty({ + @ApiPropertyOptional({ example: "Host has to take another call", - required: false, description: "Reason for reassigning the booking", }) reason?: string; diff --git a/packages/platform/types/bookings/2024-08-13/inputs/reschedule-booking.input.ts b/packages/platform/types/bookings/2024-08-13/inputs/reschedule-booking.input.ts index c249a6d5f8..3417a6e04d 100644 --- a/packages/platform/types/bookings/2024-08-13/inputs/reschedule-booking.input.ts +++ b/packages/platform/types/bookings/2024-08-13/inputs/reschedule-booking.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { IsDateString, IsOptional, IsString } from "class-validator"; export class RescheduleBookingInput_2024_08_13 { @@ -11,10 +11,9 @@ export class RescheduleBookingInput_2024_08_13 { @IsString() @IsOptional() - @ApiProperty({ + @ApiPropertyOptional({ example: "User requested reschedule", description: "Reason for rescheduling the booking", - required: false, }) reschedulingReason?: string; } @@ -30,7 +29,7 @@ export class RescheduleSeatedBookingInput_2024_08_13 { @ApiProperty({ type: String, example: "3be561a9-31f1-4b8e-aefc-9d9a085f0dd1", - description: "Uid of the specific seat withing booking.", + description: "Uid of the specific seat within booking.", }) @IsString() seatUid!: string; diff --git a/packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts b/packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts index f43348d5de..0f6022721d 100644 --- a/packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts +++ b/packages/platform/types/bookings/2024-08-13/outputs/booking.output.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Expose, Type } from "class-transformer"; import { IsArray, @@ -34,7 +34,7 @@ class Attendee { @Expose() timeZone!: string; - @ApiProperty({ enum: BookingLanguage, required: false, example: "en" }) + @ApiPropertyOptional({ enum: BookingLanguage, example: "en" }) @IsEnum(BookingLanguage) @Expose() @IsOptional() @@ -57,16 +57,15 @@ export class SeatedAttendee extends Attendee { description: "Booking field responses consisting of an object with booking field slug as keys and user response as values.", example: { customField: "customValue" }, - required: false, + required: true, }) @IsObject() @Expose() bookingFieldsResponses!: Record; - @ApiProperty({ + @ApiPropertyOptional({ type: Object, example: { key: "value" }, - required: false, }) @IsObject() @IsOptional() @@ -140,19 +139,19 @@ class BaseBookingOutput_2024_08_13 { @Expose() status!: "cancelled" | "accepted" | "rejected" | "pending"; - @ApiProperty({ type: String, required: false, example: "User requested cancellation" }) + @ApiPropertyOptional({ type: String, example: "User requested cancellation" }) @IsString() @IsOptional() @Expose() cancellationReason?: string; - @ApiProperty({ type: String, required: false, example: "User rescheduled the event" }) + @ApiPropertyOptional({ type: String, example: "User rescheduled the event" }) @IsString() @IsOptional() @Expose() reschedulingReason?: string; - @ApiProperty({ type: String, required: false, example: "previous_uid_123" }) + @ApiPropertyOptional({ type: String, example: "previous_uid_123" }) @IsString() @IsOptional() @Expose() @@ -188,9 +187,9 @@ class BaseBookingOutput_2024_08_13 { @Expose() eventType!: EventType; - @ApiProperty({ + @ApiPropertyOptional({ type: String, - required: false, + description: "Deprecated - rely on 'location' field instead.", example: "https://example.com/recurring-meeting", deprecated: true, @@ -200,8 +199,7 @@ class BaseBookingOutput_2024_08_13 { @Expose() meetingUrl?: string; - @ApiProperty({ type: String, required: false, example: "https://example.com/meeting" }) - @IsOptional() + @ApiProperty({ type: String, example: "https://example.com/meeting" }) @Expose() location!: string; @@ -215,10 +213,9 @@ class BaseBookingOutput_2024_08_13 { @Expose() createdAt!: string; - @ApiProperty({ + @ApiPropertyOptional({ type: Object, example: { key: "value" }, - required: false, }) @IsObject() @IsOptional() @@ -233,7 +230,10 @@ export class BookingOutput_2024_08_13 extends BaseBookingOutput_2024_08_13 { @Expose() attendees!: Attendee[]; - @ApiProperty({ type: [String], required: false, example: ["guest1@example.com", "guest2@example.com"] }) + @ApiPropertyOptional({ + type: [String], + example: ["guest1@example.com", "guest2@example.com"], + }) @IsArray() @IsString({ each: true }) @IsOptional() @@ -245,7 +245,6 @@ export class BookingOutput_2024_08_13 extends BaseBookingOutput_2024_08_13 { description: "Booking field responses consisting of an object with booking field slug as keys and user response as values.", example: { customField: "customValue" }, - required: false, }) @IsObject() @Expose() @@ -263,7 +262,6 @@ export class RecurringBookingOutput_2024_08_13 extends BookingOutput_2024_08_13 description: "Booking field responses consisting of an object with booking field slug as keys and user response as values.", example: { customField: "customValue" }, - required: false, }) @IsObject() @Expose() diff --git a/packages/platform/types/calendars.ts b/packages/platform/types/calendars.ts index 0801c1ee22..3ea42a10ed 100644 --- a/packages/platform/types/calendars.ts +++ b/packages/platform/types/calendars.ts @@ -8,9 +8,11 @@ import { IsYearMonthDays } from "./validators/isYearMonthDays"; export class Calendar { @Transform(({ value }: { value: string }) => value && parseInt(value)) @IsNumber() + @ApiProperty() credentialId!: number; @IsString() + @ApiProperty() externalId!: string; } @@ -27,6 +29,7 @@ export class CalendarBusyTimesInput { required: false, description: "The starting date for the busy times query", example: "2023-10-01", + nullable: true, }) @IsString() @IsOptional() @@ -37,6 +40,7 @@ export class CalendarBusyTimesInput { required: false, description: "The ending date for the busy times query", example: "2023-10-31", + nullable: true, }) @IsString() @IsOptional() @@ -44,6 +48,7 @@ export class CalendarBusyTimesInput { dateTo?: string | null; @ApiProperty({ + type: [Calendar], required: true, description: "An array of Calendar objects representing the calendars to be loaded", example: `[{ credentialId: "1", externalId: "AQgtJE7RnHEeyisVq2ENs2gAAAgEGAAAACgtJE7RnHEeyisVq2ENs2gAAAhSDAAAA" }, { credentialId: "2", externalId: "AQM7RnHEeyisVq2ENs2gAAAhFDBBBBB" }]`, diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-count.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-count.input.ts index bb9d8ef9ec..7203feb02d 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-count.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-limits-count.input.ts @@ -49,6 +49,7 @@ export class BaseBookingLimitsCount_2024_06_14 { @IsOptional() @IsBoolean() + @ApiPropertyOptional({ type: Boolean, default: false }) disabled?: boolean = false; } @@ -60,6 +61,7 @@ class BookingLimitsCountValidator implements ValidatorConstraintInterface { invalidLimit?: string; comparedLimit?: string; } = {}; + validate(value: BookingLimitsCount_2024_06_14) { if (!value) return false; if ("disabled" in value) { @@ -101,10 +103,10 @@ class BookingLimitsCountValidator implements ValidatorConstraintInterface { } } -export function ValidateBookingLimistsCount(validationOptions?: ValidationOptions) { +export function ValidateBookingLimitsCount(validationOptions?: ValidationOptions) { return function (object: any, propertyName: string) { registerDecorator({ - name: "ValidateBookingLimistsCount", + name: "ValidateBookingLimitsCount", target: object.constructor, propertyName: propertyName, options: validationOptions, diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts index e1d754290c..fd4d580cd1 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/create-event-type.input.ts @@ -38,7 +38,7 @@ import { import type { InputBookingField_2024_06_14 } from "./booking-fields.input"; import { ValidateInputBookingFields_2024_06_14 } from "./booking-fields.input"; import type { BookingLimitsCount_2024_06_14 } from "./booking-limits-count.input"; -import { BaseBookingLimitsCount_2024_06_14, ValidateBookingLimistsCount } from "./booking-limits-count.input"; +import { BaseBookingLimitsCount_2024_06_14, ValidateBookingLimitsCount } from "./booking-limits-count.input"; import type { BookingLimitsDuration_2024_06_14 } from "./booking-limits-duration.input"; import { BaseBookingLimitsDuration_2024_06_14, @@ -226,7 +226,7 @@ export class CreateEventTypeInput_2024_06_14 { scheduleId?: number; @IsOptional() - @ValidateBookingLimistsCount() + @ValidateBookingLimitsCount() @DocsPropertyOptional({ description: "Limit how many times this event can be booked", oneOf: [ diff --git a/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts b/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts index ba11751b3f..8d5a4a8c36 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/inputs/update-event-type.input.ts @@ -35,7 +35,7 @@ import { ValidateInputBookingFields_2024_06_14, } from "./booking-fields.input"; import type { BookingLimitsCount_2024_06_14 } from "./booking-limits-count.input"; -import { BaseBookingLimitsCount_2024_06_14, ValidateBookingLimistsCount } from "./booking-limits-count.input"; +import { BaseBookingLimitsCount_2024_06_14, ValidateBookingLimitsCount } from "./booking-limits-count.input"; import type { BookingLimitsDuration_2024_06_14 } from "./booking-limits-duration.input"; import { BaseBookingLimitsDuration_2024_06_14, @@ -227,7 +227,7 @@ export class UpdateEventTypeInput_2024_06_14 { scheduleId?: number; @IsOptional() - @ValidateBookingLimistsCount() + @ValidateBookingLimitsCount() @DocsPropertyOptional({ description: "Limit how many times this event can be booked", oneOf: [ diff --git a/packages/platform/types/event-types/event-types_2024_06_14/outputs/event-type.output.ts b/packages/platform/types/event-types/event-types_2024_06_14/outputs/event-type.output.ts index 6d43d6acef..afc1543c8f 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/outputs/event-type.output.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/outputs/event-type.output.ts @@ -1,4 +1,9 @@ -import { ApiProperty as DocsProperty, ApiExtraModels, getSchemaPath } from "@nestjs/swagger"; +import { + ApiProperty as DocsProperty, + ApiPropertyOptional, + ApiExtraModels, + getSchemaPath, +} from "@nestjs/swagger"; import { Type } from "class-transformer"; import { ArrayNotEmpty, @@ -71,27 +76,35 @@ export type EventTypesOutputSchedulingType = "ROUND_ROBIN" | "COLLECTIVE" | "MAN class User_2024_06_14 { @IsInt() + @DocsProperty() id!: number; @IsString() + @DocsProperty({ nullable: true }) name!: string | null; @IsString() + @DocsProperty({ nullable: true, type: String }) username!: string | null; @IsString() + @DocsProperty({ nullable: true, type: String }) avatarUrl!: string | null; @IsString() + @DocsProperty({ type: String }) weekStart!: string; @IsString() + @DocsProperty({ type: String, nullable: true }) brandColor!: string | null; @IsString() + @DocsProperty({ type: String, nullable: true }) darkBrandColor!: string | null; @Type(() => Object) + @DocsProperty({ type: Object }) metadata!: Record; } @@ -141,7 +154,8 @@ class BaseEventTypeOutput_2024_06_14 { @ArrayUnique() @IsInt({ each: true }) @Min(1, { each: true }) - @DocsProperty({ + @ApiPropertyOptional({ + type: [Number], example: [15, 30, 60], description: "If you want that user can choose between different lengths of the event you can specify them here. Must include the provided `lengthInMinutes`.", @@ -164,6 +178,7 @@ class BaseEventTypeOutput_2024_06_14 { @ValidateOutputLocations_2024_06_14() @DocsProperty({ + required: true, oneOf: [ { $ref: getSchemaPath(OutputAddressLocation_2024_06_14) }, { $ref: getSchemaPath(OutputLinkLocation_2024_06_14) }, @@ -180,6 +195,7 @@ class BaseEventTypeOutput_2024_06_14 { @ValidateOutputBookingFields_2024_06_14() @DocsProperty() @DocsProperty({ + required: true, oneOf: [ { $ref: getSchemaPath(NameDefaultFieldOutput_2024_06_14) }, { $ref: getSchemaPath(EmailDefaultFieldOutput_2024_06_14) }, @@ -211,31 +227,38 @@ class BaseEventTypeOutput_2024_06_14 { @IsInt() @IsOptional() - @DocsProperty({ example: 60, type: Number }) + @ApiPropertyOptional({ example: 60, nullable: true }) slotInterval?: number | null; + @IsOptional() @IsInt() @Min(0) - @IsOptional() - @DocsProperty({ example: 0 }) + @ApiPropertyOptional({ example: 0 }) minimumBookingNotice?: number; - @IsInt() @IsOptional() - @DocsProperty({ example: 0 }) + @IsInt() + @Min(0) + @ApiPropertyOptional({ example: 0 }) beforeEventBuffer?: number; - @IsInt() @IsOptional() - @DocsProperty({ example: 0 }) + @IsInt() + @Min(0) + @ApiPropertyOptional({ example: 0 }) afterEventBuffer?: number; @Type(() => Recurrence_2024_06_14) - @DocsProperty() + @DocsProperty({ + type: Recurrence_2024_06_14, + nullable: true, + }) recurrence!: Recurrence_2024_06_14 | null; @Type(() => Object) - @DocsProperty() + @DocsProperty({ + type: Object, + }) metadata!: Record; @IsInt() @@ -251,16 +274,16 @@ class BaseEventTypeOutput_2024_06_14 { lockTimeZoneToggleOnBookingPage!: boolean; @IsInt() - @DocsProperty() + @ApiPropertyOptional({ nullable: true }) @IsOptional() seatsPerTimeSlot?: number | null; @IsBoolean() - @DocsProperty() + @DocsProperty({ nullable: true }) forwardParamsSuccessRedirect!: boolean | null; @IsString() - @DocsProperty() + @DocsProperty({ nullable: true }) successRedirectUrl!: string | null; @IsBoolean() @@ -269,28 +292,28 @@ class BaseEventTypeOutput_2024_06_14 { @IsOptional() @IsBoolean() - @DocsProperty() + @ApiPropertyOptional({ type: Boolean, nullable: true }) seatsShowAvailabilityCount?: boolean | null; @IsInt() - @DocsProperty() + @DocsProperty({ type: Number, nullable: true }) scheduleId!: number | null; @IsOptional() - @DocsProperty() + @ApiPropertyOptional() bookingLimitsCount?: BookingLimitsCount_2024_06_14; @IsOptional() @IsBoolean() - @DocsProperty() + @ApiPropertyOptional() onlyShowFirstAvailableSlot?: boolean; @IsOptional() - @DocsProperty() + @ApiPropertyOptional() bookingLimitsDuration?: BookingLimitsDuration_2024_06_14; @IsOptional() - @DocsProperty({ + @ApiPropertyOptional({ description: "Limit how far in the future this event can be booked", oneOf: [ { $ref: getSchemaPath(BusinessDaysWindow_2024_06_14) }, @@ -304,57 +327,57 @@ class BaseEventTypeOutput_2024_06_14 { @IsOptional() @Type(() => BookerLayouts_2024_06_14) - @DocsProperty() + @ApiPropertyOptional() bookerLayouts?: BookerLayouts_2024_06_14; @IsOptional() - @DocsProperty() + @ApiPropertyOptional() confirmationPolicy?: ConfirmationPolicy_2024_06_14; @IsOptional() @IsBoolean() - @DocsProperty() + @ApiPropertyOptional() requiresBookerEmailVerification?: boolean; @IsOptional() @IsBoolean() - @DocsProperty() + @ApiPropertyOptional() hideCalendarNotes?: boolean; @IsOptional() @Type(() => EventTypeColor_2024_06_14) - @DocsProperty() + @ApiPropertyOptional({ type: EventTypeColor_2024_06_14 }) color?: EventTypeColor_2024_06_14; @IsOptional() @Type(() => Seats_2024_06_14) - @DocsProperty() + @ApiPropertyOptional({ type: Seats_2024_06_14 }) seats?: Seats_2024_06_14; @IsOptional() @IsInt() @Min(1) - @DocsProperty() + @ApiPropertyOptional() offsetStart?: number; @IsOptional() @IsString() - @DocsProperty() + @ApiPropertyOptional() customName?: string; @IsOptional() @Type(() => DestinationCalendar_2024_06_14) - @DocsProperty() + @ApiPropertyOptional({ type: DestinationCalendar_2024_06_14 }) destinationCalendar?: DestinationCalendar_2024_06_14; @IsOptional() @IsBoolean() - @DocsProperty() + @ApiPropertyOptional() useDestinationCalendarEmail?: boolean; @IsOptional() @IsBoolean() - @DocsProperty() + @ApiPropertyOptional() hideCalendarEventDetails?: boolean; } @@ -365,7 +388,10 @@ export class TeamEventTypeResponseHost extends TeamEventTypeHostInput { @IsString() @IsOptional() - @DocsProperty({ example: "https://cal.com/api/avatar/d95949bc-ccb1-400f-acf6-045c51a16856.png" }) + @ApiPropertyOptional({ + example: "https://cal.com/api/avatar/d95949bc-ccb1-400f-acf6-045c51a16856.png", + nullable: true, + }) avatarUrl?: string | null; } @@ -383,19 +409,20 @@ export class EventTypeOutput_2024_06_14 extends BaseEventTypeOutput_2024_06_14 { export class TeamEventTypeOutput_2024_06_14 extends BaseEventTypeOutput_2024_06_14 { @IsInt() @IsOptional() - @DocsProperty() + @ApiPropertyOptional({ nullable: true }) teamId?: number | null; @IsInt() @IsOptional() - @DocsProperty() + @ApiPropertyOptional({ nullable: true }) ownerId?: number | null; @IsInt() @IsOptional() - @DocsProperty({ + @ApiPropertyOptional({ description: "For managed event types, parent event type is the event type that this event type is based on", + nullable: true, }) parentEventTypeId?: number | null; @@ -407,20 +434,20 @@ export class TeamEventTypeOutput_2024_06_14 extends BaseEventTypeOutput_2024_06_ @IsBoolean() @IsOptional() - @DocsProperty() + @ApiPropertyOptional() assignAllTeamMembers?: boolean; @IsEnum(SchedulingTypeEnum) - @DocsProperty({ enum: SchedulingTypeEnum }) + @DocsProperty({ enum: SchedulingTypeEnum, nullable: true }) schedulingType!: EventTypesOutputSchedulingType | null; @IsOptional() @IsBoolean() - @DocsProperty() + @ApiPropertyOptional() hideCalendarEventDetails?: boolean; @IsString() @IsOptional() - @DocsProperty() + @ApiPropertyOptional() bannerUrl?: string; } diff --git a/packages/platform/types/event-types/event-types_2024_06_14/outputs/locations.output.ts b/packages/platform/types/event-types/event-types_2024_06_14/outputs/locations.output.ts index e23388e73b..df12f3317b 100644 --- a/packages/platform/types/event-types/event-types_2024_06_14/outputs/locations.output.ts +++ b/packages/platform/types/event-types/event-types_2024_06_14/outputs/locations.output.ts @@ -1,5 +1,5 @@ import { BadRequestException } from "@nestjs/common"; -import { ApiProperty as DocsProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional, ApiProperty as DocsProperty } from "@nestjs/swagger"; import { plainToInstance } from "class-transformer"; import { IsUrl, IsIn, IsOptional, IsNumber, IsString } from "class-validator"; import type { ValidationOptions, ValidatorConstraintInterface } from "class-validator"; @@ -61,19 +61,29 @@ export type OutputIntegration_2024_06_14 = (typeof integrationsValues)[number]; export class OutputIntegrationLocation_2024_06_14 { @IsIn(outputLocations) - @DocsProperty({ example: "integration", description: "only allowed value for type is `integration`" }) + @DocsProperty({ + example: "integration", + description: "Only allowed value for type is `integration`", + }) type!: "integration"; @IsIn(integrationsValues) @DocsProperty({ example: integrationsValues[0], enum: integrationsValues }) integration!: OutputIntegration_2024_06_14; - @IsUrl() @IsOptional() + @IsUrl() + @ApiPropertyOptional({ + type: String, + example: "https://example.com", + }) link?: string; - @IsNumber() @IsOptional() + @IsNumber() + @ApiPropertyOptional({ + description: "Credential ID associated with the integration", + }) credentialId?: number; } @@ -89,6 +99,7 @@ export class OutputUnknownLocation_2024_06_14 { type!: "unknown"; @IsString() + @DocsProperty() location!: string; } diff --git a/packages/platform/types/oauth-clients.ts b/packages/platform/types/oauth-clients.ts index 1613c18997..98efa17b0b 100644 --- a/packages/platform/types/oauth-clients.ts +++ b/packages/platform/types/oauth-clients.ts @@ -1,40 +1,50 @@ +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { IsArray, IsNumber, IsOptional, IsBoolean, IsString } from "class-validator"; import { z } from "zod"; export class CreateOAuthClientInput { @IsOptional() @IsString() + @ApiPropertyOptional() logo?: string; @IsString() + @ApiProperty() name!: string; @IsArray() @IsString({ each: true }) + @ApiProperty({ type: [String] }) redirectUris!: string[]; @IsNumber() + @ApiProperty() permissions!: number; @IsOptional() @IsString() + @ApiPropertyOptional() bookingRedirectUri?: string; @IsOptional() @IsString() + @ApiPropertyOptional() bookingCancelRedirectUri?: string; @IsOptional() @IsString() + @ApiPropertyOptional() bookingRescheduleRedirectUri?: string; @IsOptional() @IsBoolean() + @ApiPropertyOptional() areEmailsEnabled?: boolean; } export class DeleteOAuthClientInput { @IsString() + @ApiProperty() id!: string; } diff --git a/packages/platform/types/organizations/teams/outputs/team.output.ts b/packages/platform/types/organizations/teams/outputs/team.output.ts index d3cac09e70..eccfdd855d 100644 --- a/packages/platform/types/organizations/teams/outputs/team.output.ts +++ b/packages/platform/types/organizations/teams/outputs/team.output.ts @@ -1,107 +1,129 @@ +import { ApiProperty as DocsProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Expose } from "class-transformer"; import { IsBoolean, IsInt, IsOptional, IsString, IsUrl, Length } from "class-validator"; export class OrgTeamOutputDto { @IsInt() @Expose() + @DocsProperty() readonly id!: number; @IsInt() @IsOptional() @Expose() + @ApiPropertyOptional() readonly parentId?: number; @IsString() @Length(1) @Expose() + @DocsProperty() readonly name!: string; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly slug?: string; @IsOptional() @IsUrl() @Expose() + @ApiPropertyOptional() readonly logoUrl?: string; @IsOptional() @IsUrl() @Expose() + @ApiPropertyOptional() readonly calVideoLogo?: string; @IsOptional() @IsUrl() @Expose() + @ApiPropertyOptional() readonly appLogo?: string; @IsOptional() @IsUrl() @Expose() + @ApiPropertyOptional() readonly appIconLogo?: string; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly bio?: string; @IsOptional() @IsBoolean() @Expose() + @ApiPropertyOptional() readonly hideBranding?: boolean; @IsBoolean() @Expose() - readonly isOrganization?: boolean; + @DocsProperty() + readonly isOrganization!: boolean; @IsOptional() @IsBoolean() @Expose() + @ApiPropertyOptional() readonly isPrivate?: boolean; @IsOptional() @IsBoolean() @Expose() + @ApiPropertyOptional() readonly hideBookATeamMember?: boolean = false; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly metadata?: string; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly theme?: string; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly brandColor?: string; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly darkBrandColor?: string; @IsOptional() @IsUrl() @Expose() + @ApiPropertyOptional() readonly bannerUrl?: string; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional() readonly timeFormat?: number; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional({ type: String, default: "Europe/London" }) readonly timeZone?: string = "Europe/London"; @IsOptional() @IsString() @Expose() + @ApiPropertyOptional({ type: String, default: "Sunday" }) readonly weekStart?: string = "Sunday"; } diff --git a/packages/platform/types/schedules/schedules-2024-06-11/inputs/create-schedule.input.ts b/packages/platform/types/schedules/schedules-2024-06-11/inputs/create-schedule.input.ts index 106b800ff1..10992b9f5a 100644 --- a/packages/platform/types/schedules/schedules-2024-06-11/inputs/create-schedule.input.ts +++ b/packages/platform/types/schedules/schedules-2024-06-11/inputs/create-schedule.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsBoolean, @@ -19,6 +19,7 @@ export class ScheduleAvailabilityInput_2024_06_11 { @IsArray() @IsIn(WEEK_DAYS, { each: true }) @ApiProperty({ + type: [String], example: ["Monday", "Tuesday"], description: "Array of days when schedule is active.", enum: WEEK_DAYS, @@ -27,38 +28,56 @@ export class ScheduleAvailabilityInput_2024_06_11 { @IsString() @Matches(TIME_FORMAT_HH_MM, { message: "startTime must be a valid time format HH:MM" }) - @ApiProperty({ example: "08:00", description: "startTime must be a valid time in format HH:MM e.g. 08:00" }) + @ApiProperty({ + example: "08:00", + description: "startTime must be a valid time in format HH:MM e.g. 08:00", + }) startTime!: string; @IsString() @Matches(TIME_FORMAT_HH_MM, { message: "endTime must be a valid time format HH:MM" }) - @ApiProperty({ example: "15:00", description: "endTime must be a valid time in format HH:MM e.g. 15:00" }) + @ApiProperty({ + example: "15:00", + description: "endTime must be a valid time in format HH:MM e.g. 15:00", + }) endTime!: string; } export class ScheduleOverrideInput_2024_06_11 { @IsISO8601({ strict: true }) - @ApiProperty({ example: "2024-05-20" }) + @ApiProperty({ + example: "2024-05-20", + }) date!: string; @IsString() @Matches(TIME_FORMAT_HH_MM, { message: "startTime must be a valid time format HH:MM" }) - @ApiProperty({ example: "12:00", description: "startTime must be a valid time in format HH:MM e.g. 12:00" }) + @ApiProperty({ + example: "12:00", + description: "startTime must be a valid time in format HH:MM e.g. 12:00", + }) startTime!: string; @IsString() @Matches(TIME_FORMAT_HH_MM, { message: "endTime must be a valid time format HH:MM" }) - @ApiProperty({ example: "13:00", description: "endTime must be a valid time in format HH:MM e.g. 13:00" }) + @ApiProperty({ + example: "13:00", + description: "endTime must be a valid time in format HH:MM e.g. 13:00", + }) endTime!: string; } export class CreateScheduleInput_2024_06_11 { @IsString() - @ApiProperty({ example: "Catch up hours" }) + @ApiProperty({ + type: String, + example: "Catch up hours", + }) name!: string; @IsTimeZone() @ApiProperty({ + type: String, example: "Europe/Rome", description: "Timezone is used to calculate available times when an event using the schedule is booked.", }) @@ -68,7 +87,7 @@ export class CreateScheduleInput_2024_06_11 { @IsOptional() @ValidateNested({ each: true }) @Type(() => ScheduleAvailabilityInput_2024_06_11) - @ApiProperty({ + @ApiPropertyOptional({ type: [ScheduleAvailabilityInput_2024_06_11], description: "Each object contains days and times when the user is available. If not passed, the default availability is Monday to Friday from 09:00 to 17:00.", @@ -84,12 +103,12 @@ export class CreateScheduleInput_2024_06_11 { endTime: "20:00", }, ], - required: false, }) availability?: ScheduleAvailabilityInput_2024_06_11[]; @IsBoolean() @ApiProperty({ + type: Boolean, example: true, description: `Each user should have 1 default schedule. If you specified \`timeZone\` when creating managed user, then the default schedule will be created with that timezone. Default schedule means that if an event type is not tied to a specific schedule then the default schedule is used.`, @@ -100,7 +119,7 @@ export class CreateScheduleInput_2024_06_11 { @IsOptional() @ValidateNested({ each: true }) @Type(() => ScheduleOverrideInput_2024_06_11) - @ApiProperty({ + @ApiPropertyOptional({ type: [ScheduleOverrideInput_2024_06_11], description: "Need to change availability for a specific date? Add an override.", example: [ @@ -110,7 +129,6 @@ export class CreateScheduleInput_2024_06_11 { endTime: "21:00", }, ], - required: false, }) overrides?: ScheduleOverrideInput_2024_06_11[]; } diff --git a/packages/platform/types/schedules/schedules-2024-06-11/inputs/update-schedule.input.ts b/packages/platform/types/schedules/schedules-2024-06-11/inputs/update-schedule.input.ts index cb53aa2a68..3aed3d2776 100644 --- a/packages/platform/types/schedules/schedules-2024-06-11/inputs/update-schedule.input.ts +++ b/packages/platform/types/schedules/schedules-2024-06-11/inputs/update-schedule.input.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from "@nestjs/swagger"; +import { ApiPropertyOptional } from "@nestjs/swagger"; import { Type } from "class-transformer"; import { IsString, IsBoolean, IsOptional, ValidateNested, IsArray, IsTimeZone } from "class-validator"; @@ -10,19 +10,19 @@ import { export class UpdateScheduleInput_2024_06_11 { @IsString() @IsOptional() - @ApiProperty({ example: "One-on-one coaching", required: false }) + @ApiPropertyOptional({ type: String, example: "One-on-one coaching" }) name?: string; @IsTimeZone() @IsOptional() - @ApiProperty({ example: "Europe/Rome", required: false }) + @ApiPropertyOptional({ type: String, example: "Europe/Rome" }) timeZone?: string; @IsArray() @IsOptional() @ValidateNested({ each: true }) @Type(() => ScheduleAvailabilityInput_2024_06_11) - @ApiProperty({ + @ApiPropertyOptional({ type: [ScheduleAvailabilityInput_2024_06_11], example: [ { @@ -31,20 +31,19 @@ export class UpdateScheduleInput_2024_06_11 { endTime: "10:00", }, ], - required: false, }) availability?: ScheduleAvailabilityInput_2024_06_11[]; @IsBoolean() @IsOptional() - @ApiProperty({ example: true, required: false }) + @ApiPropertyOptional({ type: Boolean, example: true }) isDefault?: boolean; @IsArray() @IsOptional() @ValidateNested({ each: true }) @Type(() => ScheduleOverrideInput_2024_06_11) - @ApiProperty({ + @ApiPropertyOptional({ type: [ScheduleOverrideInput_2024_06_11], example: [ { @@ -53,7 +52,6 @@ export class UpdateScheduleInput_2024_06_11 { endTime: "14:00", }, ], - required: false, }) overrides?: ScheduleOverrideInput_2024_06_11[]; } diff --git a/packages/platform/types/schedules/schedules-2024-06-11/outputs/schedule.output.ts b/packages/platform/types/schedules/schedules-2024-06-11/outputs/schedule.output.ts index f00b493590..f8731c96d7 100644 --- a/packages/platform/types/schedules/schedules-2024-06-11/outputs/schedule.output.ts +++ b/packages/platform/types/schedules/schedules-2024-06-11/outputs/schedule.output.ts @@ -1,14 +1,6 @@ import { ApiProperty } from "@nestjs/swagger"; import { Type } from "class-transformer"; -import { - IsBoolean, - IsOptional, - IsString, - ValidateNested, - IsArray, - IsTimeZone, - IsNumber, -} from "class-validator"; +import { IsBoolean, IsString, ValidateNested, IsArray, IsTimeZone, IsNumber } from "class-validator"; import { ScheduleAvailabilityInput_2024_06_11, @@ -57,7 +49,6 @@ export class ScheduleOutput_2024_06_11 { isDefault!: boolean; @IsArray() - @IsOptional() @ValidateNested({ each: true }) @Type(() => ScheduleOverrideInput_2024_06_11) @ApiProperty({ diff --git a/packages/platform/types/slots.ts b/packages/platform/types/slots.ts index 3b5d3d9618..aee9b67f98 100644 --- a/packages/platform/types/slots.ts +++ b/packages/platform/types/slots.ts @@ -32,43 +32,48 @@ export class GetAvailableSlotsInput { @Transform(({ value }: { value: string }) => value && parseInt(value)) @IsNumber() @IsOptional() - @ApiProperty({ description: "Event Type ID for which slots are being fetched.", example: 100 }) + @ApiPropertyOptional({ description: "Event Type ID for which slots are being fetched.", example: 100 }) eventTypeId?: number; @IsString() @IsOptional() - @ApiProperty({ description: "Slug of the event type for which slots are being fetched." }) + @ApiPropertyOptional({ description: "Slug of the event type for which slots are being fetched." }) eventTypeSlug?: string; @IsArray() @IsString({ each: true }) @IsOptional() - @ApiProperty({ + @ApiPropertyOptional({ + type: [String], description: "Only for dynamic events - list of usernames for which slots are being fetched.", }) usernameList?: string[]; @IsBoolean() @IsOptional() + @ApiPropertyOptional() debug?: boolean; @Transform(({ value }: { value: string }) => value && parseInt(value)) @IsNumber() @IsOptional() @Min(1, { message: "Duration must be a positive number" }) - @ApiProperty({ description: "Only for dynamic events - length of returned slots." }) + @ApiPropertyOptional({ description: "Only for dynamic events - length of returned slots." }) duration?: number; @IsOptional() @IsString() + @ApiPropertyOptional({ type: String, nullable: true }) rescheduleUid?: string | null; @IsString() @IsOptional() + @ApiPropertyOptional() timeZone?: string; @IsString() @IsOptional() + @ApiPropertyOptional({ description: "Organization slug." }) orgSlug?: string; @IsString()