Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/oasdiff-err-ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ GET /v2/oauth-clients/{clientId}/webhooks/{webhookId} added the new path request
DELETE /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'webhookId'
GET /v2/teams/{teamId}/event-types/{eventTypeId}/webhooks/{webhookId} added the new path request parameter 'webhookId'
GET /v2/webhooks/{webhookId} added the new path request parameter 'webhookId'
GET /v2/calendars/busy-times added the new required 'query' request parameter 'calendarsToLoad'
GET /v2/calendars/busy-times the 'query' request parameter 'dateFrom' became required
GET /v2/calendars/busy-times the 'query' request parameter 'dateTo' became required
GET /v2/calendars/busy-times deleted the 'query' request parameter 'credentialId'
GET /v2/calendars/busy-times deleted the 'query' request parameter 'externalId'
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,23 @@ export class CalendarsController {
description:
"Get busy times from a calendar. Example request URL is `https://api.cal.com/v2/calendars/busy-times?timeZone=Europe%2FMadrid&dateFrom=2024-12-18&dateTo=2024-12-18&calendarsToLoad[0][credentialId]=135&calendarsToLoad[0][externalId]=skrauciz%40gmail.com`. Note: loggedInUsersTz is deprecated, use timeZone instead.",
})
@ApiQuery({
name: "calendarsToLoad",
required: true,
description:
"An array of Calendar objects representing the calendars to be loaded. Use bracket notation in the URL, e.g.: calendarsToLoad[0][credentialId]=135&calendarsToLoad[0][externalId]=email@example.com",
schema: {
type: "array",
items: {
type: "object",
properties: {
credentialId: { type: "number", example: 135 },
externalId: { type: "string", example: "email@example.com" },
},
required: ["credentialId", "externalId"],
},
},
})
async getBusyTimes(
@Query() queryParams: CalendarBusyTimesInput,
@GetUser() user: UserWithProfile
Expand Down
31 changes: 19 additions & 12 deletions docs/api-reference/v2/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -10499,7 +10499,7 @@
},
{
"name": "dateFrom",
"required": false,
"required": true,
"in": "query",
"description": "The starting date for the busy times query",
"schema": {
Expand All @@ -10509,7 +10509,7 @@
},
{
"name": "dateTo",
"required": false,
"required": true,
"in": "query",
"description": "The ending date for the busy times query",
"schema": {
Expand All @@ -10518,19 +10518,26 @@
}
},
{
"name": "credentialId",
"in": "query",
"name": "calendarsToLoad",
"required": true,
"schema": {
"type": "number"
}
},
{
"name": "externalId",
"in": "query",
"required": true,
"description": "An array of Calendar objects representing the calendars to be loaded. Use bracket notation in the URL, e.g.: calendarsToLoad[0][credentialId]=135&calendarsToLoad[0][externalId]=email@example.com",
"schema": {
"type": "string"
"type": "array",
"items": {
"type": "object",
"properties": {
"credentialId": {
"type": "number",
"example": 135
},
"externalId": {
"type": "string",
"example": "email@example.com"
}
},
"required": ["credentialId", "externalId"]
}
}
},
{
Expand Down
15 changes: 4 additions & 11 deletions packages/platform/types/calendars/inputs/busy-times.input.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { ApiHideProperty, ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { Transform, Type } from "class-transformer";
import {
IsArray,
Expand Down Expand Up @@ -41,11 +41,11 @@ function ValidateTimezoneRequired(
export class Calendar {
@Transform(({ value }: { value: string }) => value && parseInt(value, 10))
@IsNumber()
@ApiProperty()
@ApiHideProperty()
credentialId!: number;

@IsString()
@ApiProperty()
@ApiHideProperty()
externalId!: string;
}

Expand Down Expand Up @@ -73,7 +73,6 @@ export class CalendarBusyTimesInput {
timeZone?: string;

@ApiProperty({
required: false,
description: "The starting date for the busy times query",
example: "2023-10-01",
})
Expand All @@ -82,20 +81,14 @@ export class CalendarBusyTimesInput {
dateFrom!: string;

@ApiProperty({
required: false,
description: "The ending date for the busy times query",
example: "2023-10-31",
})
@IsString()
@IsDateString()
dateTo!: string;

@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" }]`,
})
@ApiHideProperty()
@IsArray()
@ValidateNested({ each: true })
@Type(() => Calendar)
Expand Down
Loading