Merge pull request #21 from calcom/fix/swagger-docs-indent

This commit is contained in:
Agusti Fernandez authored and GitHub committed 2022-04-03 19:04:55 +02:00
commit 11516e7720
72 files changed
+1501 -201

No files matched your search

File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -32,8 +32,8 @@
"prettier": "^2.6.1" "prettier": "^2.6.1"
}, },
"dependencies": { "dependencies": {
"@sentry/nextjs": "^6.19.2", "@sentry/nextjs": "^6.19.3",
"next": "^12.1.0", "next": "^12.1.4",
"next-api-middleware": "^1.0.1", "next-api-middleware": "^1.0.1",
"next-swagger-doc": "^0.2.1", "next-swagger-doc": "^0.2.1",
"next-transpile-modules": "^9.0.0", "next-transpile-modules": "^9.0.0",
+1 -1
View File
@@ -14,7 +14,7 @@ import {
* /api/attendees/{id}/delete: * /api/attendees/{id}/delete:
* delete: * delete:
* summary: Remove an existing attendee * summary: Remove an existing attendee
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+1 -1
View File
@@ -15,7 +15,7 @@ import {
* /api/attendees/{id}/edit: * /api/attendees/{id}/edit:
* patch: * patch:
* summary: Edit an existing attendee * summary: Edit an existing attendee
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+2 -2
View File
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/attendees/{id}: * /api/attendees/{id}:
* get: * get:
* summary: Get a attendee by ID * summary: Get a attendee by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
-7
View File
@@ -11,13 +11,6 @@ import { schemaAttendeeBodyParams, schemaAttendeePublic, withValidAttendee } fro
* /api/attendees/new: * /api/attendees/new:
* post: * post:
* summary: Creates a new attendee * summary: Creates a new attendee
* requestBody:
* description: Optional description in *Markdown*
* required: true
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Attendee'
* tags: * tags:
* - attendees * - attendees
* responses: * responses:
+1 -1
View File
@@ -14,7 +14,7 @@ import {
* /api/availabilites/{id}/delete: * /api/availabilites/{id}/delete:
* delete: * delete:
* summary: Remove an existing availability * summary: Remove an existing availability
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+1 -1
View File
@@ -19,7 +19,7 @@ import {
* /api/availabilites/{id}/edit: * /api/availabilites/{id}/edit:
* patch: * patch:
* summary: Edit an existing availability * summary: Edit an existing availability
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+2 -2
View File
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/availabilites/{id}: * /api/availabilites/{id}:
* get: * get:
* summary: Get a availability by ID * summary: Get a availability by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+5 -6
View File
@@ -15,11 +15,11 @@ import {
* /api/availabilites/new: * /api/availabilites/new:
* post: * post:
* summary: Creates a new availability * summary: Creates a new availability
* requestBody: * requestBody:
* description: Optional description in *Markdown* * description: Optional description in *Markdown*
* required: true * required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* $ref: '#/components/schemas/Availability' * $ref: '#/components/schemas/Availability'
* tags: * tags:
@@ -27,7 +27,6 @@ import {
* responses: * responses:
* 201: * 201:
* description: OK, availability created * description: OK, availability created
* model: Availability
* 400: * 400:
* description: Bad request. Availability body is invalid. * description: Bad request. Availability body is invalid.
* 401: * 401:
+2 -2
View File
@@ -14,7 +14,7 @@ import {
* /api/booking-references/{id}/delete: * /api/booking-references/{id}/delete:
* delete: * delete:
* summary: Remove an existing bookingReference * summary: Remove an existing bookingReference
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -22,7 +22,7 @@ import {
* required: true * required: true
* description: Numeric ID of the bookingReference to delete * description: Numeric ID of the bookingReference to delete
* tags: * tags:
* - bookingReferences * - booking-references
* responses: * responses:
* 201: * 201:
* description: OK, bookingReference removed successfuly * description: OK, bookingReference removed successfuly
+2 -2
View File
@@ -19,7 +19,7 @@ import {
* /api/booking-references/{id}/edit: * /api/booking-references/{id}/edit:
* patch: * patch:
* summary: Edit an existing bookingReference * summary: Edit an existing bookingReference
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -27,7 +27,7 @@ import {
* required: true * required: true
* description: Numeric ID of the bookingReference to edit * description: Numeric ID of the bookingReference to edit
* tags: * tags:
* - bookingReferences * - booking-references
* responses: * responses:
* 201: * 201:
* description: OK, bookingReference edited successfuly * description: OK, bookingReference edited successfuly
+3 -3
View File
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/booking-references/{id}: * /api/booking-references/{id}:
* get: * get:
* summary: Get a bookingReference by ID * summary: Get a bookingReference by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -23,7 +23,7 @@ import {
* required: true * required: true
* description: Numeric ID of the bookingReference to get * description: Numeric ID of the bookingReference to get
* tags: * tags:
* - bookingReferences * - booking-references
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+1 -1
View File
@@ -12,7 +12,7 @@ import { schemaBookingReferencePublic } from "@lib/validations/booking-reference
* get: * get:
* summary: Get all bookingReferences * summary: Get all bookingReferences
* tags: * tags:
* - bookingReferences * - booking-references
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+6 -7
View File
@@ -15,19 +15,18 @@ import {
* /api/booking-references/new: * /api/booking-references/new:
* post: * post:
* summary: Creates a new bookingReference * summary: Creates a new bookingReference
* requestBody: * requestBody:
* description: Optional description in *Markdown* * description: Optional description in *Markdown*
* required: true * required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* $ref: '#/components/schemas/BookingReference' * $ref: '#/components/schemas/BookingReference'
* tags: * tags:
* - bookingReferences * - booking-references
* responses: * responses:
* 201: * 201:
* description: OK, bookingReference created * description: OK, bookingReference created
* model: BookingReference
* 400: * 400:
* description: Bad request. BookingReference body is invalid. * description: Bad request. BookingReference body is invalid.
* 401: * 401:
+1 -1
View File
@@ -14,7 +14,7 @@ import {
* /api/bookings/{id}/delete: * /api/bookings/{id}/delete:
* delete: * delete:
* summary: Remove an existing booking * summary: Remove an existing booking
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+1 -1
View File
@@ -15,7 +15,7 @@ import {
* /api/bookings/{id}/edit: * /api/bookings/{id}/edit:
* patch: * patch:
* summary: Edit an existing booking * summary: Edit an existing booking
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+2 -2
View File
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/bookings/{id}: * /api/bookings/{id}:
* get: * get:
* summary: Get a booking by ID * summary: Get a booking by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+7 -7
View File
@@ -11,13 +11,13 @@ import { schemaBookingBodyParams, schemaBookingPublic, withValidBooking } from "
* /api/bookings/new: * /api/bookings/new:
* post: * post:
* summary: Creates a new booking * summary: Creates a new booking
* requestBody: * requestBody:
* description: Optional description in *Markdown* * description: Optional description in *Markdown*
* required: true * required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* $ref: '#/components/schemas/Booking' * $ref: '#/components/schemas/Booking'
* tags: * tags:
* - bookings * - bookings
* responses: * responses:
+1 -1
View File
@@ -14,7 +14,7 @@ import {
* /api/credentials/{id}/delete: * /api/credentials/{id}/delete:
* delete: * delete:
* summary: Remove an existing credential * summary: Remove an existing credential
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+1 -1
View File
@@ -19,7 +19,7 @@ import {
* /api/credentials/{id}/edit: * /api/credentials/{id}/edit:
* patch: * patch:
* summary: Edit an existing credential * summary: Edit an existing credential
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+2 -2
View File
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/credentials/{id}: * /api/credentials/{id}:
* get: * get:
* summary: Get a credential by ID * summary: Get a credential by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+5 -5
View File
@@ -15,11 +15,11 @@ import {
* /api/credentials/new: * /api/credentials/new:
* post: * post:
* summary: Creates a new credential * summary: Creates a new credential
* requestBody: * requestBody:
* description: Optional description in *Markdown* * description: Optional description in *Markdown*
* required: true * required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* $ref: '#/components/schemas/Credential' * $ref: '#/components/schemas/Credential'
* tags: * tags:
@@ -14,7 +14,7 @@ import {
* /api/daily-event-references/{id}/delete: * /api/daily-event-references/{id}/delete:
* delete: * delete:
* summary: Remove an existing dailyEventReference * summary: Remove an existing dailyEventReference
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -22,7 +22,7 @@ import {
* required: true * required: true
* description: Numeric ID of the dailyEventReference to delete * description: Numeric ID of the dailyEventReference to delete
* tags: * tags:
* - dailyEventReferences * - daily-event-references
* responses: * responses:
* 201: * 201:
* description: OK, dailyEventReference removed successfuly * description: OK, dailyEventReference removed successfuly
@@ -19,7 +19,7 @@ import {
* /api/daily-event-references/{id}/edit: * /api/daily-event-references/{id}/edit:
* patch: * patch:
* summary: Edit an existing dailyEventReference * summary: Edit an existing dailyEventReference
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -27,7 +27,7 @@ import {
* required: true * required: true
* description: Numeric ID of the dailyEventReference to edit * description: Numeric ID of the dailyEventReference to edit
* tags: * tags:
* - dailyEventReferences * - daily-event-references
* responses: * responses:
* 201: * 201:
* description: OK, dailyEventReference edited successfuly * description: OK, dailyEventReference edited successfuly
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/daily-event-references/{id}: * /api/daily-event-references/{id}:
* get: * get:
* summary: Get a dailyEventReference by ID * summary: Get a dailyEventReference by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -23,7 +23,7 @@ import {
* required: true * required: true
* description: Numeric ID of the dailyEventReference to get * description: Numeric ID of the dailyEventReference to get
* tags: * tags:
* - dailyEventReferences * - daily-event-references
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+1 -1
View File
@@ -12,7 +12,7 @@ import { schemaDailyEventReferencePublic } from "@lib/validations/daily-event-re
* get: * get:
* summary: Get all dailyEventReferences * summary: Get all dailyEventReferences
* tags: * tags:
* - dailyEventReferences * - daily-event-references
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+6 -6
View File
@@ -15,15 +15,15 @@ import {
* /api/daily-event-references/new: * /api/daily-event-references/new:
* post: * post:
* summary: Creates a new dailyEventReference * summary: Creates a new dailyEventReference
* requestBody: * requestBody:
* description: Optional description in *Markdown* * description: Optional description in *Markdown*
* required: true * required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* $ref: '#/components/schemas/DailyEventReference' * $ref: '#/components/schemas/DailyEventReference'
* tags: * tags:
* - dailyEventReferences * - daily-event-references
* responses: * responses:
* 201: * 201:
* description: OK, dailyEventReference created * description: OK, dailyEventReference created
@@ -14,7 +14,7 @@ import {
* /api/destination-calendars/{id}/delete: * /api/destination-calendars/{id}/delete:
* delete: * delete:
* summary: Remove an existing destinationCalendar * summary: Remove an existing destinationCalendar
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -22,7 +22,7 @@ import {
* required: true * required: true
* description: Numeric ID of the destinationCalendar to delete * description: Numeric ID of the destinationCalendar to delete
* tags: * tags:
* - destinationCalendars * - destination-calendars
* responses: * responses:
* 201: * 201:
* description: OK, destinationCalendar removed successfuly * description: OK, destinationCalendar removed successfuly
+2 -2
View File
@@ -19,7 +19,7 @@ import {
* /api/destination-calendars/{id}/edit: * /api/destination-calendars/{id}/edit:
* patch: * patch:
* summary: Edit an existing destinationCalendar * summary: Edit an existing destinationCalendar
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -27,7 +27,7 @@ import {
* required: true * required: true
* description: Numeric ID of the destinationCalendar to edit * description: Numeric ID of the destinationCalendar to edit
* tags: * tags:
* - destinationCalendars * - destination-calendars
* responses: * responses:
* 201: * 201:
* description: OK, destinationCalendar edited successfuly * description: OK, destinationCalendar edited successfuly
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/destination-calendars/{id}: * /api/destination-calendars/{id}:
* get: * get:
* summary: Get a destinationCalendar by ID * summary: Get a destinationCalendar by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -23,7 +23,7 @@ import {
* required: true * required: true
* description: Numeric ID of the destinationCalendar to get * description: Numeric ID of the destinationCalendar to get
* tags: * tags:
* - destinationCalendars * - destination-calendars
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+1 -1
View File
@@ -12,7 +12,7 @@ import { schemaDestinationCalendarPublic } from "@lib/validations/destination-ca
* get: * get:
* summary: Get all destinationCalendars * summary: Get all destinationCalendars
* tags: * tags:
* - destinationCalendars * - destination-calendars
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+6 -6
View File
@@ -15,15 +15,15 @@ import {
* /api/destination-calendars/new: * /api/destination-calendars/new:
* post: * post:
* summary: Creates a new destinationCalendar * summary: Creates a new destinationCalendar
* requestBody: * requestBody:
* description: Optional description in *Markdown* * description: Optional description in *Markdown*
* required: true * required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* $ref: '#/components/schemas/DestinationCalendar' * $ref: '#/components/schemas/DestinationCalendar'
* tags: * tags:
* - destinationCalendars * - destination-calendars
* responses: * responses:
* 201: * 201:
* description: OK, destinationCalendar created * description: OK, destinationCalendar created
+5 -1
View File
@@ -1,3 +1,4 @@
import jsonSchema from "@/json-schema/json-schema.json";
import pjson from "@/package.json"; import pjson from "@/package.json";
import { withSwagger } from "next-swagger-doc"; import { withSwagger } from "next-swagger-doc";
@@ -8,8 +9,11 @@ const swaggerHandler = withSwagger({
title: `${pjson.name}: ${pjson.description}`, title: `${pjson.name}: ${pjson.description}`,
version: pjson.version, version: pjson.version,
}, },
tags: ["users", "teams"], components: { schemas: { ...jsonSchema.definitions } },
definitions: jsonSchema.definitions,
}, },
apiFolder: "pages/api", apiFolder: "pages/api",
tags: ["users", "teams", "memeberships"],
sort: true,
}); });
export default swaggerHandler(); export default swaggerHandler();
@@ -14,7 +14,7 @@ import {
* /api/event-type-custom-inputs/{id}/delete: * /api/event-type-custom-inputs/{id}/delete:
* delete: * delete:
* summary: Remove an existing eventTypeCustomInput * summary: Remove an existing eventTypeCustomInput
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -22,7 +22,7 @@ import {
* required: true * required: true
* description: Numeric ID of the eventTypeCustomInput to delete * description: Numeric ID of the eventTypeCustomInput to delete
* tags: * tags:
* - eventTypeCustomInputs * - event-type-custom-inputs
* responses: * responses:
* 201: * 201:
* description: OK, eventTypeCustomInput removed successfuly * description: OK, eventTypeCustomInput removed successfuly
@@ -19,7 +19,7 @@ import {
* /api/event-type-custom-inputs/{id}/edit: * /api/event-type-custom-inputs/{id}/edit:
* patch: * patch:
* summary: Edit an existing eventTypeCustomInput * summary: Edit an existing eventTypeCustomInput
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -27,7 +27,7 @@ import {
* required: true * required: true
* description: Numeric ID of the eventTypeCustomInput to edit * description: Numeric ID of the eventTypeCustomInput to edit
* tags: * tags:
* - eventTypeCustomInputs * - event-type-custom-inputs
* responses: * responses:
* 201: * 201:
* description: OK, eventTypeCustomInput edited successfuly * description: OK, eventTypeCustomInput edited successfuly
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/event-type-custom-inputs/{id}: * /api/event-type-custom-inputs/{id}:
* get: * get:
* summary: Get a eventTypeCustomInput by ID * summary: Get a eventTypeCustomInput by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -23,7 +23,7 @@ import {
* required: true * required: true
* description: Numeric ID of the eventTypeCustomInput to get * description: Numeric ID of the eventTypeCustomInput to get
* tags: * tags:
* - eventTypeCustomInputs * - event-type-custom-inputs
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+1 -1
View File
@@ -12,7 +12,7 @@ import { schemaEventTypeCustomInputPublic } from "@lib/validations/event-type-cu
* get: * get:
* summary: Get all eventTypeCustomInputs * summary: Get all eventTypeCustomInputs
* tags: * tags:
* - eventTypeCustomInputs * - event-type-custom-inputs
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+6 -6
View File
@@ -15,15 +15,15 @@ import {
* /api/event-type-custom-inputs/new: * /api/event-type-custom-inputs/new:
* post: * post:
* summary: Creates a new eventTypeCustomInput * summary: Creates a new eventTypeCustomInput
* requestBody: * requestBody:
* description: Optional description in *Markdown* * description: Optional description in *Markdown*
* required: true * required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* $ref: '#/components/schemas/EventTypeCustomInput' * $ref: '#/components/schemas/EventTypeCustomInput'
* tags: * tags:
* - eventTypeCustomInputs * - event-type-custom-inputs
* responses: * responses:
* 201: * 201:
* description: OK, eventTypeCustomInput created * description: OK, eventTypeCustomInput created
+3 -3
View File
@@ -11,10 +11,10 @@ import {
/** /**
* @swagger * @swagger
* /api/eventTypes/{id}/delete: * /api/event-types/{id}/delete:
* delete: * delete:
* summary: Remove an existing eventType * summary: Remove an existing eventType
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -22,7 +22,7 @@ import {
* required: true * required: true
* description: Numeric ID of the eventType to delete * description: Numeric ID of the eventType to delete
* tags: * tags:
* - eventTypes * - event-types
* responses: * responses:
* 201: * 201:
* description: OK, eventType removed successfuly * description: OK, eventType removed successfuly
+3 -3
View File
@@ -16,10 +16,10 @@ import {
/** /**
* @swagger * @swagger
* /api/eventTypes/{id}/edit: * /api/event-types/{id}/edit:
* patch: * patch:
* summary: Edits an existing eventType * summary: Edits an existing eventType
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -27,7 +27,7 @@ import {
* required: true * required: true
* description: Numeric ID of the eventType to delete * description: Numeric ID of the eventType to delete
* tags: * tags:
* - eventTypes * - event-types
* responses: * responses:
* 201: * 201:
* description: OK, eventType edited successfuly * description: OK, eventType edited successfuly
+4 -2
View File
@@ -12,16 +12,18 @@ import {
/** /**
* @swagger * @swagger
* /api/eventTypes/{id}: * /api/event-types/{id}:
* get: * get:
* summary: find eventType by ID * summary: find eventType by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
* type: integer * type: integer
* required: true * required: true
* description: Numeric ID of the eventType to get * description: Numeric ID of the eventType to get
* tags:
* - event-types
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+2
View File
@@ -11,6 +11,8 @@ import { schemaEventTypePublic } from "@lib/validations/event-type";
* /api/eventTypes: * /api/eventTypes:
* get: * get:
* summary: Returns all eventTypes * summary: Returns all eventTypes
* tags:
* - event-types
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+3 -1
View File
@@ -12,9 +12,11 @@ import {
/** /**
* @swagger * @swagger
* /api/eventTypes/new: * /api/event-types/new:
* post: * post:
* summary: Creates a new eventType * summary: Creates a new eventType
* tags:
* - event-types
* responses: * responses:
* 201: * 201:
* description: OK, eventType created * description: OK, eventType created
+5 -4
View File
@@ -11,14 +11,15 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/
* /api/memberships/{userId}_{teamId}/delete: * /api/memberships/{userId}_{teamId}/delete:
* delete: * delete:
* summary: Remove an existing membership * summary: Remove an existing membership
* parameters: * parameters:
* - in: path * - in: path
* - name: userId * name: userId
* schema: * schema:
* type: integer * type: integer
* required: true * required: true
* description: Numeric ID of the user to get the membership of * description: Numeric ID of the user to get the membership of
* * - name: teamId * - in: path
* name: teamId
* schema: * schema:
* type: integer * type: integer
* required: true * required: true
+1 -1
View File
@@ -12,7 +12,7 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/
* /api/memberships/{userId}_{teamId}: * /api/memberships/{userId}_{teamId}:
* get: * get:
* summary: find membership by userID and teamID * summary: find membership by userID and teamID
* parameters: * parameters:
* - in: path * - in: path
* name: userId * name: userId
* schema: * schema:
+1 -1
View File
@@ -14,7 +14,7 @@ import {
* /api/payments/{id}/delete: * /api/payments/{id}/delete:
* delete: * delete:
* summary: Remove an existing payment * summary: Remove an existing payment
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+1 -1
View File
@@ -15,7 +15,7 @@ import {
* /api/payments/{id}/edit: * /api/payments/{id}/edit:
* patch: * patch:
* summary: Edit an existing payment * summary: Edit an existing payment
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+2 -2
View File
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/payments/{id}: * /api/payments/{id}:
* get: * get:
* summary: Get a payment by ID * summary: Get a payment by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+5 -5
View File
@@ -11,11 +11,11 @@ import { schemaPaymentBodyParams, schemaPaymentPublic, withValidPayment } from "
* /api/payments/new: * /api/payments/new:
* post: * post:
* summary: Creates a new payment * summary: Creates a new payment
* requestBody: * requestBody:
* description: Optional description in *Markdown* * description: Optional description in *Markdown*
* required: true * required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* $ref: '#/components/schemas/Payment' * $ref: '#/components/schemas/Payment'
* tags: * tags:
+3 -3
View File
@@ -13,8 +13,8 @@ import {
* @swagger * @swagger
* /api/reminder-mails/{id}/delete: * /api/reminder-mails/{id}/delete:
* delete: * delete:
* summary: Remove an existing reminderMail * summary: Remove an existing reminder mail
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -22,7 +22,7 @@ import {
* required: true * required: true
* description: Numeric ID of the reminderMail to delete * description: Numeric ID of the reminderMail to delete
* tags: * tags:
* - reminderMails * - reminder-mails
* responses: * responses:
* 201: * 201:
* description: OK, reminderMail removed successfuly * description: OK, reminderMail removed successfuly
+3 -3
View File
@@ -18,8 +18,8 @@ import {
* @swagger * @swagger
* /api/reminder-mails/{id}/edit: * /api/reminder-mails/{id}/edit:
* patch: * patch:
* summary: Edit an existing reminderMail * summary: Edit an existing reminder mail
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -27,7 +27,7 @@ import {
* required: true * required: true
* description: Numeric ID of the reminderMail to edit * description: Numeric ID of the reminderMail to edit
* tags: * tags:
* - reminderMails * - reminder-mails
* responses: * responses:
* 201: * 201:
* description: OK, reminderMail edited successfuly * description: OK, reminderMail edited successfuly
+3 -3
View File
@@ -14,8 +14,8 @@ import {
* @swagger * @swagger
* /api/reminder-mails/{id}: * /api/reminder-mails/{id}:
* get: * get:
* summary: Get a reminderMail by ID * summary: Get a reminder mail by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
@@ -23,7 +23,7 @@ import {
* required: true * required: true
* description: Numeric ID of the reminderMail to get * description: Numeric ID of the reminderMail to get
* tags: * tags:
* - reminderMails * - reminder-mails
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+2 -2
View File
@@ -10,9 +10,9 @@ import { schemaReminderMailPublic } from "@lib/validations/reminder-mail";
* @swagger * @swagger
* /api/reminder-mails: * /api/reminder-mails:
* get: * get:
* summary: Get all reminderMails * summary: Get all reminder mails
* tags: * tags:
* - reminderMails * - reminder-mails
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+7 -7
View File
@@ -14,16 +14,16 @@ import {
* @swagger * @swagger
* /api/reminder-mails/new: * /api/reminder-mails/new:
* post: * post:
* summary: Creates a new reminderMail * summary: Creates a new reminder mail
* requestBody: * requestBody:
* description: Optional description in *Markdown* * description: Optional description in *Markdown*
* required: true * required: true
* content: * content:
* application/json: * application/json:
* schema: * schema:
* $ref: '#/components/schemas/ReminderMail' * $ref: '#/components/schemas/ReminderMail'
* tags: * tags:
* - reminderMails * - reminder-mails
* responses: * responses:
* 201: * 201:
* description: OK, reminderMail created * description: OK, reminderMail created
+1 -1
View File
@@ -11,7 +11,7 @@ import {
/** /**
* @swagger * @swagger
* /api/schedules/:id/delete: * /api/schedules/{id}/delete:
* delete: * delete:
* summary: Remove an existing schedule * summary: Remove an existing schedule
* tags: * tags:
+1 -1
View File
@@ -12,7 +12,7 @@ import {
/** /**
* @swagger * @swagger
* /api/schedules/:id/edit: * /api/schedules/{id}/edit:
* patch: * patch:
* summary: Edits an existing schedule * summary: Edits an existing schedule
* tags: * tags:
+1 -1
View File
@@ -15,7 +15,7 @@ import {
* /api/schedules/{id}: * /api/schedules/{id}:
* get: * get:
* summary: Get schedule by ID * summary: Get schedule by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+10 -11
View File
@@ -10,27 +10,26 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/
* @swagger * @swagger
* /api/selected-calendars/{userId}_{teamId}/delete: * /api/selected-calendars/{userId}_{teamId}/delete:
* delete: * delete:
* summary: Remove an existing selectedCalendar * summary: Remove an existing record of a selected calendar
* parameters: * parameters:
* - in: path * - in: path
* - name: userId * - name: userId
* schema: * schema:
* type: integer * type: integer
* required: true * required: true
* description: Numeric ID of the user to get the selectedCalendar of * description: Numeric ID of the user to get the selected calendar of
* * - name: teamId * - name: teamId
* schema: * schema:
* type: integer * type: integer
* required: true * required: true
* description: Numeric ID of the team to get the selectedCalendar of * description: Numeric ID of the team to get the selected calendar of
* tags: * tags:
* - selectedCalendars * - selected-calendars
* responses: * responses:
* 201: * 201:
* description: OK, selectedCalendar removed successfuly * description: OK, selected calendar removed successfuly
* model: SelectedCalendar
* 400: * 400:
* description: Bad request. SelectedCalendar id is invalid. * description: Bad request. selected calendar id is invalid.
* 401: * 401:
* description: Authorization information is missing or invalid. * description: Authorization information is missing or invalid.
*/ */
+1 -1
View File
@@ -17,7 +17,7 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/
* patch: * patch:
* summary: Edits an existing selectedCalendar * summary: Edits an existing selectedCalendar
* tags: * tags:
* - selectedCalendars * - selected-calendars
* responses: * responses:
* 201: * 201:
* description: OK, selectedCalendar edited successfuly * description: OK, selectedCalendar edited successfuly
+2 -2
View File
@@ -12,7 +12,7 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/
* /api/selected-calendars/{userId}_{teamId}: * /api/selected-calendars/{userId}_{teamId}:
* get: * get:
* summary: find selectedCalendar by userID and teamID * summary: find selectedCalendar by userID and teamID
* parameters: * parameters:
* - in: path * - in: path
* name: userId * name: userId
* schema: * schema:
@@ -26,7 +26,7 @@ import { schemaQueryIdAsString, withValidQueryIdString } from "@lib/validations/
* required: true * required: true
* description: Numeric teamId of the selectedCalendar to get * description: Numeric teamId of the selectedCalendar to get
* tags: * tags:
* - selectedCalendars * - selected-calendars
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+3 -1
View File
@@ -8,9 +8,11 @@ import { schemaSelectedCalendarPublic } from "@lib/validations/selected-calendar
/** /**
* @swagger * @swagger
* /api/selectedCalendars: * /api/selected-calendars:
* get: * get:
* summary: Returns all selected calendars * summary: Returns all selected calendars
* tags:
* - selected-calendars
* responses: * responses:
* 200: * 200:
* description: OK * description: OK
+3 -1
View File
@@ -12,9 +12,11 @@ import {
/** /**
* @swagger * @swagger
* /api/selectedCalendars/new: * /api/selected-calendars/new:
* post: * post:
* summary: Creates a new selected calendar * summary: Creates a new selected calendar
* tags:
* - selected-calendars
* responses: * responses:
* 201: * 201:
* description: OK, selected calendar created * description: OK, selected calendar created
+8 -1
View File
@@ -11,9 +11,16 @@ import {
/** /**
* @swagger * @swagger
* /api/teams/:id/delete: * /api/teams/{id}/delete:
* delete: * delete:
* summary: Remove an existing team * summary: Remove an existing team
* parameters:
* - in: path
* name: id
* schema:
* type: integer
* required: true
* description: Numeric ID of the team to remove
* tags: * tags:
* - teams * - teams
* responses: * responses:
+15 -1
View File
@@ -12,9 +12,23 @@ import { schemaTeamBodyParams, schemaTeamPublic, withValidTeam } from "@lib/vali
/** /**
* @swagger * @swagger
* /api/teams/:id/edit: * /api/teams/{id}/edit:
* patch: * patch:
* summary: Edits an existing team * summary: Edits an existing team
* consumes:
* - application/json
* parameters:
* - in: body
* name: team
* description: The team to edit
* schema: Team
* required: true
* - in: path
* name: id
* schema:
* type: integer
* required: true
* description: Numeric ID of the team to edit
* tags: * tags:
* - teams * - teams
* responses: * responses:
+1 -1
View File
@@ -15,7 +15,7 @@ import { schemaTeamPublic } from "@lib/validations/team";
* /api/teams/{id}: * /api/teams/{id}:
* get: * get:
* summary: find team by ID * summary: find team by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+1 -1
View File
@@ -14,7 +14,7 @@ import {
* /api/users/{id}/delete: * /api/users/{id}/delete:
* delete: * delete:
* summary: Remove an existing user * summary: Remove an existing user
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+10 -1
View File
@@ -15,7 +15,16 @@ import { schemaUserBodyParams, schemaUserPublic, withValidUser } from "@lib/vali
* /api/users/{id}/edit: * /api/users/{id}/edit:
* patch: * patch:
* summary: Edit an existing user * summary: Edit an existing user
* parameters: * consumes:
* - application/json
* parameters:
* - in: body
* name: user
* description: The user to edit
* schema:
* type: object
* $ref: '#/components/schemas/User'
* required: true
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
+8 -8
View File
@@ -14,14 +14,14 @@ import { schemaUserPublic } from "@lib/validations/user";
* @swagger * @swagger
* /api/users/{id}: * /api/users/{id}:
* get: * get:
* summary: Get a user by ID * summary: Get a user by ID
* parameters: * parameters:
* - in: path * - in: path
* name: id * name: id
* schema: * schema:
* type: integer * type: integer
* required: true * required: true
* description: Numeric ID of the user to get * description: Numeric ID of the user to get
* tags: * tags:
* - users * - users
* responses: * responses:
+11 -8
View File
@@ -10,14 +10,17 @@ import { schemaUserBodyParams, schemaUserPublic, withValidUser } from "@lib/vali
* @swagger * @swagger
* /api/users/new: * /api/users/new:
* post: * post:
* summary: Creates a new user * summary: Add a new user
* requestBody: * consumes:
* description: Optional description in *Markdown* * - application/json
* required: true * parameters:
* content: * - in: body
* application/json: * name: user
* schema: * description: The user to edit
* $ref: '#/components/schemas/User' * schema:
* type: object
* $ref: '#/components/schemas/User'
* required: true
* tags: * tags:
* - users * - users
* responses: * responses:
+17 -17
View File
@@ -1,23 +1,23 @@
// import { withValidation } from "next-validations"; import { withValidation } from "next-validations";
// import { z } from "zod"; import { z } from "zod";
// import { _ModelModel as Model } from "@calcom/prisma/zod"; import { _ModelModel as Model } from "@calcom/prisma/zod";
// export const schemaModelBaseBodyParams = Model.omit({ id: true, userId: true, createdAt: true }).partial(); export const schemaModelBaseBodyParams = Model.omit({ id: true, userId: true, createdAt: true }).partial();
// const schemaModelRequiredParams = z.object({ const schemaModelRequiredParams = z.object({
// email: z.string().email(), email: z.string().email(),
// }); });
// export const schemaModelBodyParams = schemaModelBaseBodyParams.merge(schemaModelRequiredParams); export const schemaModelBodyParams = schemaModelBaseBodyParams.merge(schemaModelRequiredParams);
// export const schemaModelPublic = Model.omit({ export const schemaModelPublic = Model.omit({
// id: true, id: true,
// userId: true, userId: true,
// }); });
// export const withValidModel = withValidation({ export const withValidModel = withValidation({
// schema: schemaModelBodyParams, schema: schemaModelBodyParams,
// type: "Zod", type: "Zod",
// mode: "body", mode: "body",
// }); });
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"extends": "@calcom/tsconfig/base.json", "extends": "@calcom/tsconfig/base.json",
"exclude": ["node_modules"], "exclude": ["node_modules", "templates"],
"compilerOptions": { "compilerOptions": {
"strictNullChecks": true, "strictNullChecks": true,
"baseUrl": ".", "baseUrl": ".",
@@ -19,5 +19,5 @@
"@/*": ["*"] "@/*": ["*"]
} }
}, },
"include": ["./**/*.ts"] "include": ["./**/*.ts*"]
} }