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