chore: Add summaries for all API v2 endpoints (#16776)

* chore: Add summaries for all API v2 endpoints

* Updated to Get all calendars

* Fix build issues

* Removed unneeded Swagger UI options

* Fix issues with OpenAPI spec
This commit is contained in:
Keith Williams authored and GitHub committed 2024-09-24 08:12:46 -03:00
1 parent 2e2a6c73b1
commit f94494b91e
28 files changed
+490 -202

No files matched your search

@@ -20,6 +20,7 @@ import { GetAllAttributeOptionOutput } from "@/modules/organizations/outputs/att
import { UpdateAttributeOptionOutput } from "@/modules/organizations/outputs/attributes/options/update-option.output";
import { OrganizationAttributeOptionService } from "@/modules/organizations/services/attributes/organization-attributes-option.service";
import { Body, Controller, Delete, Get, Param, ParseIntPipe, Patch, Post, UseGuards } from "@nestjs/common";
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -28,13 +29,14 @@ import { SUCCESS_STATUS } from "@calcom/platform-constants";
version: API_VERSIONS_VALUES,
})
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@DocsTags("Orgs / Attributes / Options")
export class OrganizationsOptionsAttributesController {
constructor(private readonly organizationsAttributesOptionsService: OrganizationAttributeOptionService) {}
// Creates an attribute option for an attribute
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Post("/attributes/:attributeId/options")
@ApiOperation({ summary: "Create an attribute option" })
async createOrganizationAttributeOption(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("attributeId") attributeId: string,
@@ -52,10 +54,10 @@ export class OrganizationsOptionsAttributesController {
};
}
// Deletes an attribute option for an attribute
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Delete("/attributes/:attributeId/options/:optionId")
@ApiOperation({ summary: "Delete an attribute option" })
async deleteOrganizationAttributeOption(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("attributeId") attributeId: string,
@@ -73,10 +75,10 @@ export class OrganizationsOptionsAttributesController {
};
}
// Updates an attribute option for an attribute
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Patch("/attributes/:attributeId/options/:optionId")
@ApiOperation({ summary: "Update an attribute option" })
async updateOrganizationAttributeOption(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("attributeId") attributeId: string,
@@ -96,10 +98,10 @@ export class OrganizationsOptionsAttributesController {
};
}
// Gets all attribute options for an attribute
@Roles("ORG_MEMBER")
@PlatformPlan("ESSENTIALS")
@Get("/attributes/:attributeId/options")
@ApiOperation({ summary: "Get all attribute options" })
async getOrganizationAttributeOptions(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("attributeId") attributeId: string
@@ -114,10 +116,10 @@ export class OrganizationsOptionsAttributesController {
};
}
// Assign attribute option to user
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Post("/attributes/options/:userId")
@ApiOperation({ summary: "Assign an attribute to a user" })
async assignOrganizationAttributeOptionToUser(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("userId", ParseIntPipe) userId: number,
@@ -135,10 +137,10 @@ export class OrganizationsOptionsAttributesController {
};
}
// Unassign attribute option from user
@Roles("ORG_MEMBER")
@PlatformPlan("ESSENTIALS")
@Delete("/attributes/options/:userId/:attributeOptionId")
@ApiOperation({ summary: "Unassign an attribute from a user" })
async unassignOrganizationAttributeOptionFromUser(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("userId", ParseIntPipe) userId: number,
@@ -159,6 +161,7 @@ export class OrganizationsOptionsAttributesController {
@Roles("ORG_MEMBER")
@PlatformPlan("ESSENTIALS")
@Get("/attributes/options/:userId")
@ApiOperation({ summary: "Get all attribute options for a user" })
async getOrganizationAttributeOptionsForUser(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("userId", ParseIntPipe) userId: number
@@ -28,6 +28,7 @@ import {
Query,
UseGuards,
} from "@nestjs/common";
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
import { SkipTakePagination } from "@calcom/platform-types";
@@ -37,12 +38,14 @@ import { SkipTakePagination } from "@calcom/platform-types";
version: API_VERSIONS_VALUES,
})
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@DocsTags("Orgs / Attributes")
export class OrganizationsAttributesController {
constructor(private readonly organizationsAttributesService: OrganizationAttributesService) {}
// Gets all attributes for an organization
@Roles("ORG_MEMBER")
@PlatformPlan("ESSENTIALS")
@Get("/attributes")
@ApiOperation({ summary: "Get all attributes" })
async getOrganizationAttributes(
@Param("orgId", ParseIntPipe) orgId: number,
@Query() queryParams: SkipTakePagination
@@ -60,6 +63,7 @@ export class OrganizationsAttributesController {
@Roles("ORG_MEMBER")
@PlatformPlan("ESSENTIALS")
@Get("/attributes/:attributeId")
@ApiOperation({ summary: "Get an attribute" })
async getOrganizationAttribute(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("attributeId") attributeId: string
@@ -75,6 +79,7 @@ export class OrganizationsAttributesController {
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Post("/attributes")
@ApiOperation({ summary: "Create an attribute" })
async createOrganizationAttribute(
@Param("orgId", ParseIntPipe) orgId: number,
@Body() bodyAttribute: CreateOrganizationAttributeInput
@@ -93,6 +98,7 @@ export class OrganizationsAttributesController {
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Patch("/attributes/:attributeId")
@ApiOperation({ summary: "Update an attribute" })
async updateOrganizationAttribute(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("attributeId") attributeId: string,
@@ -113,6 +119,7 @@ export class OrganizationsAttributesController {
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Delete("/attributes/:attributeId")
@ApiOperation({ summary: "Delete an attribute" })
async deleteOrganizationAttribute(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("attributeId") attributeId: string
@@ -36,7 +36,7 @@ import {
NotFoundException,
Query,
} from "@nestjs/common";
import { ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { ERROR_STATUS, SUCCESS_STATUS } from "@calcom/platform-constants";
import { handleCreatePhoneCall } from "@calcom/platform-libraries";
@@ -57,7 +57,7 @@ export type EventTypeHandlerResponse = {
path: "/v2/organizations/:orgId",
version: API_VERSIONS_VALUES,
})
@DocsTags("Organizations Event Types")
@DocsTags("Orgs / Event Types")
export class OrganizationsEventTypesController {
constructor(
private readonly organizationsEventTypesService: OrganizationsEventTypesService,
@@ -70,6 +70,7 @@ export class OrganizationsEventTypesController {
@PlatformPlan("ESSENTIALS")
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, IsTeamInOrg, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@Post("/teams/:teamId/event-types")
@ApiOperation({ summary: "Create an event type" })
async createTeamEventType(
@GetUser() user: UserWithProfile,
@Param("teamId", ParseIntPipe) teamId: number,
@@ -99,6 +100,7 @@ export class OrganizationsEventTypesController {
@PlatformPlan("ESSENTIALS")
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, IsTeamInOrg, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@Get("/teams/:teamId/event-types/:eventTypeId")
@ApiOperation({ summary: "Get an event type" })
async getTeamEventType(
@Param("teamId", ParseIntPipe) teamId: number,
@Param("eventTypeId") eventTypeId: number
@@ -120,6 +122,7 @@ export class OrganizationsEventTypesController {
@Roles("TEAM_ADMIN")
@Post("/teams/:teamId/event-types/:eventTypeId/create-phone-call")
@UseGuards(ApiAuthGuard, IsOrgGuard, IsTeamInOrg, RolesGuard)
@ApiOperation({ summary: "Create a phone call" })
async createPhoneCall(
@Param("eventTypeId") eventTypeId: number,
@Param("orgId", ParseIntPipe) orgId: number,
@@ -143,6 +146,7 @@ export class OrganizationsEventTypesController {
@UseGuards(IsOrgGuard, IsTeamInOrg, IsAdminAPIEnabledGuard)
@Get("/teams/:teamId/event-types")
@ApiOperation({ summary: "Get a team event type" })
async getTeamEventTypes(
@Param("teamId", ParseIntPipe) teamId: number,
@Query() queryParams: GetTeamEventTypesQuery_2024_06_14
@@ -170,6 +174,7 @@ export class OrganizationsEventTypesController {
@PlatformPlan("ESSENTIALS")
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@Get("/teams/event-types")
@ApiOperation({ summary: "Get all team event types" })
async getTeamsEventTypes(
@Param("orgId", ParseIntPipe) orgId: number,
@Query() queryParams: SkipTakePagination
@@ -187,6 +192,7 @@ export class OrganizationsEventTypesController {
@PlatformPlan("ESSENTIALS")
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, IsTeamInOrg, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@Patch("/teams/:teamId/event-types/:eventTypeId")
@ApiOperation({ summary: "Update a team event type" })
async updateTeamEventType(
@Param("teamId", ParseIntPipe) teamId: number,
@Param("eventTypeId", ParseIntPipe) eventTypeId: number,
@@ -218,6 +224,7 @@ export class OrganizationsEventTypesController {
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, IsTeamInOrg, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@Delete("/teams/:teamId/event-types/:eventTypeId")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Delete a team event type" })
async deleteTeamEventType(
@Param("teamId", ParseIntPipe) teamId: number,
@Param("eventTypeId", ParseIntPipe) eventTypeId: number
@@ -30,7 +30,7 @@ import {
HttpCode,
HttpStatus,
} from "@nestjs/common";
import { ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { plainToClass } from "class-transformer";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -41,7 +41,7 @@ import { SkipTakePagination } from "@calcom/platform-types";
version: API_VERSIONS_VALUES,
})
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@DocsTags("Organizations Memberships")
@DocsTags("Orgs / Memberships")
export class OrganizationsMembershipsController {
constructor(private organizationsMembershipService: OrganizationsMembershipService) {}
@@ -49,6 +49,7 @@ export class OrganizationsMembershipsController {
@PlatformPlan("ESSENTIALS")
@Get("/")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Get all memberships" })
async getAllMemberships(
@Param("orgId", ParseIntPipe) orgId: number,
@Query() queryParams: SkipTakePagination
@@ -71,6 +72,7 @@ export class OrganizationsMembershipsController {
@PlatformPlan("ESSENTIALS")
@Post("/")
@HttpCode(HttpStatus.CREATED)
@ApiOperation({ summary: "Create a membership" })
async createMembership(
@Param("orgId", ParseIntPipe) orgId: number,
@Body() body: CreateOrgMembershipDto
@@ -87,6 +89,7 @@ export class OrganizationsMembershipsController {
@UseGuards(IsMembershipInOrg)
@Get("/:membershipId")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Get a membership" })
async getOrgMembership(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("membershipId", ParseIntPipe) membershipId: number
@@ -103,6 +106,7 @@ export class OrganizationsMembershipsController {
@UseGuards(IsMembershipInOrg)
@Delete("/:membershipId")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Delete a membership" })
async deleteMembership(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("membershipId", ParseIntPipe) membershipId: number
@@ -119,6 +123,7 @@ export class OrganizationsMembershipsController {
@PlatformPlan("ESSENTIALS")
@Patch("/:membershipId")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Update a membership" })
async updateMembership(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("membershipId", ParseIntPipe) membershipId: number,
@@ -23,7 +23,7 @@ import {
HttpStatus,
Query,
} from "@nestjs/common";
import { ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
import {
@@ -42,7 +42,7 @@ import { SkipTakePagination } from "@calcom/platform-types";
version: API_VERSIONS_VALUES,
})
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@DocsTags("Organizations Schedules")
@DocsTags("Orgs / Schedules")
export class OrganizationsSchedulesController {
constructor(
private schedulesService: SchedulesService_2024_06_11,
@@ -52,6 +52,7 @@ export class OrganizationsSchedulesController {
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Get("/schedules")
@ApiOperation({ summary: "Get all schedules" })
async getOrganizationSchedules(
@Param("orgId", ParseIntPipe) orgId: number,
@Query() queryParams: SkipTakePagination
@@ -70,6 +71,8 @@ export class OrganizationsSchedulesController {
@PlatformPlan("ESSENTIALS")
@UseGuards(IsUserInOrg)
@Post("/users/:userId/schedules")
@DocsTags("Orgs / Users / Schedules")
@ApiOperation({ summary: "Create a schedule" })
async createUserSchedule(
@Param("userId", ParseIntPipe) userId: number,
@Body() bodySchedule: CreateScheduleInput_2024_06_11
@@ -86,6 +89,8 @@ export class OrganizationsSchedulesController {
@PlatformPlan("ESSENTIALS")
@UseGuards(IsUserInOrg)
@Get("/users/:userId/schedules/:scheduleId")
@DocsTags("Orgs / Users / Schedules")
@ApiOperation({ summary: "Get a schedule" })
async getUserSchedule(
@Param("userId", ParseIntPipe) userId: number,
@Param("scheduleId") scheduleId: number
@@ -102,6 +107,8 @@ export class OrganizationsSchedulesController {
@PlatformPlan("ESSENTIALS")
@UseGuards(IsUserInOrg)
@Get("/users/:userId/schedules")
@DocsTags("Orgs / Users / Schedules")
@ApiOperation({ summary: "Get all schedules" })
async getUserSchedules(
@Param("userId", ParseIntPipe) userId: number
): Promise<GetSchedulesOutput_2024_06_11> {
@@ -117,6 +124,8 @@ export class OrganizationsSchedulesController {
@PlatformPlan("ESSENTIALS")
@UseGuards(IsUserInOrg)
@Patch("/users/:userId/schedules/:scheduleId")
@DocsTags("Orgs / Users / Schedules")
@ApiOperation({ summary: "Update a schedule" })
async updateUserSchedule(
@Param("userId", ParseIntPipe) userId: number,
@Param("scheduleId", ParseIntPipe) scheduleId: number,
@@ -135,6 +144,8 @@ export class OrganizationsSchedulesController {
@UseGuards(IsUserInOrg)
@Delete("/users/:userId/schedules/:scheduleId")
@HttpCode(HttpStatus.OK)
@DocsTags("Orgs / Users / Schedules")
@ApiOperation({ summary: "Delete a schedule" })
async deleteUserSchedule(
@Param("userId", ParseIntPipe) userId: number,
@Param("scheduleId", ParseIntPipe) scheduleId: number
@@ -42,7 +42,7 @@ import { SkipTakePagination } from "@calcom/platform-types";
version: API_VERSIONS_VALUES,
})
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, IsTeamInOrg, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@DocsTags("Organizations Teams")
@DocsTags("Orgs / Teams / Memberships")
export class OrganizationsTeamsMembershipsController {
constructor(
private organizationsTeamsMembershipsService: OrganizationsTeamsMembershipsService,
@@ -50,7 +50,7 @@ export class OrganizationsTeamsMembershipsController {
) {}
@Get("/")
@ApiOperation({ summary: "Get all the memberships of a team of an organization." })
@ApiOperation({ summary: "Get all memberships" })
@UseGuards()
@Roles("TEAM_ADMIN")
@PlatformPlan("ESSENTIALS")
@@ -76,7 +76,7 @@ export class OrganizationsTeamsMembershipsController {
}
@Get("/:membershipId")
@ApiOperation({ summary: "Get the membership of an organization's team by ID" })
@ApiOperation({ summary: "Get a membership" })
@UseGuards()
@Roles("TEAM_ADMIN")
@PlatformPlan("ESSENTIALS")
@@ -101,7 +101,7 @@ export class OrganizationsTeamsMembershipsController {
@PlatformPlan("ESSENTIALS")
@Delete("/:membershipId")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Delete the membership of an organization's team by ID" })
@ApiOperation({ summary: "Delete a membership" })
async deleteOrgTeamMembership(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("teamId", ParseIntPipe) teamId: number,
@@ -122,7 +122,7 @@ export class OrganizationsTeamsMembershipsController {
@PlatformPlan("ESSENTIALS")
@Patch("/:membershipId")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Update the membership of an organization's team by ID" })
@ApiOperation({ summary: "Update a membership" })
async updateOrgTeamMembership(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("teamId", ParseIntPipe) teamId: number,
@@ -145,7 +145,7 @@ export class OrganizationsTeamsMembershipsController {
@PlatformPlan("ESSENTIALS")
@Post("/")
@HttpCode(HttpStatus.CREATED)
@ApiOperation({ summary: "Create a membership of an organization's team" })
@ApiOperation({ summary: "Create a membership" })
async createOrgTeamMembership(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("teamId", ParseIntPipe) teamId: number,
@@ -45,12 +45,13 @@ import { Team } from "@calcom/prisma/client";
version: API_VERSIONS_VALUES,
})
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@DocsTags("Organizations Teams")
@DocsTags("Orgs / Teams")
export class OrganizationsTeamsController {
constructor(private organizationsTeamsService: OrganizationsTeamsService) {}
@Get()
@ApiOperation({ summary: "Get all the teams of an organization." })
@DocsTags("Teams")
@ApiOperation({ summary: "Get all teams" })
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
async getAllTeams(
@@ -66,7 +67,7 @@ export class OrganizationsTeamsController {
}
@Get("/me")
@ApiOperation({ summary: "Get the organization's teams user is a member of" })
@ApiOperation({ summary: "Get team membership for user" })
@Roles("ORG_MEMBER")
@PlatformPlan("ESSENTIALS")
async getMyTeams(
@@ -97,7 +98,7 @@ export class OrganizationsTeamsController {
@Roles("TEAM_ADMIN")
@PlatformPlan("ESSENTIALS")
@Get("/:teamId")
@ApiOperation({ summary: "Get a team of the organization by ID." })
@ApiOperation({ summary: "Get a team" })
async getTeam(@GetTeam() team: Team): Promise<OrgTeamOutputResponseDto> {
return {
status: SUCCESS_STATUS,
@@ -109,7 +110,7 @@ export class OrganizationsTeamsController {
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Delete("/:teamId")
@ApiOperation({ summary: "Delete a team of the organization by ID." })
@ApiOperation({ summary: "Delete a team" })
async deleteTeam(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("teamId", ParseIntPipe) teamId: number
@@ -125,7 +126,7 @@ export class OrganizationsTeamsController {
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@Patch("/:teamId")
@ApiOperation({ summary: "Update a team of the organization by ID." })
@ApiOperation({ summary: "Update a team" })
async updateTeam(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("teamId", ParseIntPipe) teamId: number,
@@ -141,7 +142,7 @@ export class OrganizationsTeamsController {
@Post()
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@ApiOperation({ summary: "Create a team for an organization." })
@ApiOperation({ summary: "Create a team" })
async createTeam(
@Param("orgId", ParseIntPipe) orgId: number,
@Body() body: CreateOrgTeamDto,
@@ -31,7 +31,7 @@ import {
Query,
} from "@nestjs/common";
import { ClassSerializerInterceptor } from "@nestjs/common";
import { ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { plainToInstance } from "class-transformer";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -44,13 +44,14 @@ import { Team } from "@calcom/prisma/client";
@UseInterceptors(ClassSerializerInterceptor)
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@UseGuards(IsOrgGuard)
@DocsTags("Organizations Users")
@DocsTags("Orgs / Users")
export class OrganizationsUsersController {
constructor(private readonly organizationsUsersService: OrganizationsUsersService) {}
@Get()
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@ApiOperation({ summary: "Get all users" })
async getOrganizationsUsers(
@Param("orgId", ParseIntPipe) orgId: number,
@Query() query: GetOrganizationsUsersInput
@@ -71,6 +72,7 @@ export class OrganizationsUsersController {
@Post()
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@ApiOperation({ summary: "Create a user" })
async createOrganizationUser(
@Param("orgId", ParseIntPipe) orgId: number,
@GetOrg() org: Team,
@@ -92,6 +94,7 @@ export class OrganizationsUsersController {
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@UseGuards(IsUserInOrg)
@ApiOperation({ summary: "Update a user" })
async updateOrganizationUser(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("userId", ParseIntPipe) userId: number,
@@ -109,6 +112,7 @@ export class OrganizationsUsersController {
@Roles("ORG_ADMIN")
@PlatformPlan("ESSENTIALS")
@UseGuards(IsUserInOrg)
@ApiOperation({ summary: "Delete a user" })
async deleteOrganizationUser(
@Param("orgId", ParseIntPipe) orgId: number,
@Param("userId", ParseIntPipe) userId: number
@@ -32,7 +32,7 @@ import {
HttpCode,
HttpStatus,
} from "@nestjs/common";
import { ApiTags as DocsTags } from "@nestjs/swagger";
import { ApiOperation, ApiTags as DocsTags } from "@nestjs/swagger";
import { plainToClass } from "class-transformer";
import { SUCCESS_STATUS } from "@calcom/platform-constants";
@@ -43,7 +43,7 @@ import { SkipTakePagination } from "@calcom/platform-types";
version: API_VERSIONS_VALUES,
})
@UseGuards(ApiAuthGuard, IsOrgGuard, RolesGuard, PlatformPlanGuard, IsAdminAPIEnabledGuard)
@DocsTags("Organizations Webhooks")
@DocsTags("Orgs / Webhooks")
export class OrganizationsWebhooksController {
constructor(
private organizationsWebhooksService: OrganizationsWebhooksService,
@@ -54,6 +54,7 @@ export class OrganizationsWebhooksController {
@PlatformPlan("ESSENTIALS")
@Get("/")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Get all webhooks" })
async getAllOrganizationWebhooks(
@Param("orgId", ParseIntPipe) orgId: number,
@Query() queryParams: SkipTakePagination
@@ -78,6 +79,7 @@ export class OrganizationsWebhooksController {
@PlatformPlan("ESSENTIALS")
@Post("/")
@HttpCode(HttpStatus.CREATED)
@ApiOperation({ summary: "Create a webhook" })
async createOrganizationWebhook(
@Param("orgId", ParseIntPipe) orgId: number,
@Body() body: CreateWebhookInputDto
@@ -99,6 +101,7 @@ export class OrganizationsWebhooksController {
@UseGuards(IsWebhookInOrg)
@Get("/:webhookId")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Get a webhook" })
async getOrganizationWebhook(@Param("webhookId") webhookId: string): Promise<OrgWebhookOutputResponseDto> {
const webhook = await this.organizationsWebhooksService.getWebhook(webhookId);
return {
@@ -114,6 +117,7 @@ export class OrganizationsWebhooksController {
@UseGuards(IsWebhookInOrg)
@Delete("/:webhookId")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Delete a webhook" })
async deleteWebhook(@Param("webhookId") webhookId: string): Promise<OrgWebhookOutputResponseDto> {
const webhook = await this.webhooksService.deleteWebhook(webhookId);
return {
@@ -129,6 +133,7 @@ export class OrganizationsWebhooksController {
@UseGuards(IsWebhookInOrg)
@Patch("/:webhookId")
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: "Update a webhook" })
async updateOrgWebhook(
@Param("webhookId") webhookId: string,
@Body() body: UpdateWebhookInputDto