Added bodies and responses for availability calls (#569)

Co-authored-by: bailey <bailey@calendso.com>
pull/571/head
Bailey Pumfleet 2021-09-04 11:28:05 +01:00 committed by GitHub
parent 2f1ede9bcd
commit 9195ef41f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 323 additions and 25 deletions

View File

@ -7,19 +7,20 @@ info:
email: support@calendso.com email: support@calendso.com
license: license:
name: MIT License name: MIT License
url: https://opensource.org/licenses/MIT url: 'https://opensource.org/licenses/MIT'
version: 1.0.0 version: 1.0.0
termsOfService: 'https://calendso.com/terms'
server: server:
url: http://localhost:{port} url: 'http://localhost:{port}'
description: Local Development Server description: Local Development Server
variables: variables:
port: port:
default: '3000' default: '3000'
tags: tags:
- name: Authentication - name: Authentication
description: Auth routes, powered by Next-Auth.js description: 'Auth routes, powered by Next-Auth.js'
externalDocs: externalDocs:
url: http://next-auth.js.org/ url: 'http://next-auth.js.org/'
- name: Availability - name: Availability
description: Checking and setting user availability description: Checking and setting user availability
- name: Booking - name: Booking
@ -37,15 +38,15 @@ paths:
summary: Displays the sign in page summary: Displays the sign in page
tags: tags:
- Authentication - Authentication
/api/auth/signin/:provider: '/api/auth/signin/:provider':
post: post:
description: Starts an OAuth signin flow for the specified provider. The POST submission requires CSRF token from /api/auth/csrf. description: Starts an OAuth signin flow for the specified provider. The POST submission requires CSRF token from /api/auth/csrf.
summary: Starts an OAuth signin flow for the specified provider summary: Starts an OAuth signin flow for the specified provider
tags: tags:
- Authentication - Authentication
/api/auth/callback/:provider: '/api/auth/callback/:provider':
get: get:
description: Handles returning requests from OAuth services during sign in. For OAuth 2.0 providers that support the state option, the value of the state parameter is checked against the one that was generated when the sign in flow was started - this uses a hash of the CSRF token which MUST match for both the POST and GET calls during sign in. description: 'Handles returning requests from OAuth services during sign in. For OAuth 2.0 providers that support the state option, the value of the state parameter is checked against the one that was generated when the sign in flow was started - this uses a hash of the CSRF token which MUST match for both the POST and GET calls during sign in.'
summary: Handles returning requests from OAuth services summary: Handles returning requests from OAuth services
tags: tags:
- Authentication - Authentication
@ -74,7 +75,7 @@ paths:
- Authentication - Authentication
/api/auth/csrf: /api/auth/csrf:
get: get:
description: Returns object containing CSRF token. In NextAuth.js, CSRF protection is present on all authentication routes. It uses the "double submit cookie method", which uses a signed HttpOnly, host-only cookie. The CSRF token returned by this endpoint must be passed as form variable named csrfToken in all POST submissions to any API endpoint. description: 'Returns object containing CSRF token. In NextAuth.js, CSRF protection is present on all authentication routes. It uses the "double submit cookie method", which uses a signed HttpOnly, host-only cookie. The CSRF token returned by this endpoint must be passed as form variable named csrfToken in all POST submissions to any API endpoint.'
summary: Returns object containing CSRF token summary: Returns object containing CSRF token
tags: tags:
- Authentication - Authentication
@ -102,62 +103,354 @@ paths:
summary: Reset a user's password summary: Reset a user's password
tags: tags:
- Authentication - Authentication
/api/availability/:user: '/api/availability/{user}?dateFrom={dateFrom}&dateTo={dateTo}':
get: get:
description: Gets the busy times for a particular user, by username. description: 'Gets the busy times for a particular user, by username.'
summary: Gets the busy times for a user summary: Gets the busy times for a user
tags: tags:
- Availability - Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
description: ''
minItems: 1
uniqueItems: true
x-examples:
example-1:
- start: 'Fri, 03 Sep 2021 17:00:00 GMT'
end: 'Fri, 03 Sep 2021 17:40:00 GMT'
items:
type: object
properties:
start:
type: string
minLength: 1
end:
type: string
minLength: 1
required:
- start
- end
'500':
description: Internal Server Error
parameters:
- schema:
type: string
name: user
in: path
required: true
description: The username of who you want to check availability for
- schema:
type: string
name: dateFrom
in: path
required: true
description: The timestamp of which time you want to get busy times from
- schema:
type: string
name: dateTo
in: path
required: true
description: The timestamp of which time you want to get busy times until
/api/availability/calendar: /api/availability/calendar:
get: get:
description: Gets the user's selected calendars. description: Gets the user's selected calendars.
summary: Gets the user's selected calendars summary: Gets the user's selected calendars
tags: tags:
- Availability - Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
description: ''
minItems: 1
uniqueItems: true
items:
type: object
required:
- selected
- externalId
- integration
- name
- primary
properties:
selected:
type: boolean
externalId:
type: string
minLength: 1
integration:
type: string
minLength: 1
name:
type: string
minLength: 1
primary:
type: boolean
x-examples:
example-1:
- selected: false
externalId: en.uk#holiday@group.v.calendar.google.com
integration: google_calendar
name: Holidays in United Kingdom
- selected: false
externalId: addressbook#contacts@group.v.calendar.google.com
integration: google_calendar
name: Birthdays
- selected: true
externalId: bailey@calendso.com
integration: google_calendar
name: Calendso
primary: true
- selected: true
externalId: bpumfleet@gmail.com
integration: google_calendar
name: Personal
- selected: false
externalId: connor@cal.com
integration: google_calendar
name: connor@cal.com
- selected: false
externalId: c_feunmui1m8el5o1oo885fu48k8@group.calendar.google.com
integration: google_calendar
name: 1.0 Launch
'500':
description: Internal Server Error
post: post:
description: Adds a selected calendar for the user. description: Adds a selected calendar for the user.
summary: Adds a selected calendar for the user summary: Adds a selected calendar for the user
tags: tags:
- Availability - Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
message:
type: string
'500':
description: Internal Server Error
requestBody:
content:
application/json:
schema:
type: object
properties:
integration:
type: string
externalId:
type: string
delete: delete:
description: Removes a selected calendar for the user. description: Removes a selected calendar for the user.
summary: Removes a selected calendar for the user summary: Removes a selected calendar for the user
tags: tags:
- Availability - Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
message:
type: string
'500':
description: Internal Server Error
requestBody:
content:
application/json:
schema:
type: object
properties:
externalId:
type: string
integration:
type: string
/api/availability/day: /api/availability/day:
patch: patch:
description: Updates the start and end times for a user's availability. description: Updates the start and end times for a user's availability.
summary: Updates the user's start and end times summary: Updates the user's start and end times
tags: tags:
- Availability - Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
message:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
startMins:
type: string
endMins:
type: string
bufferMins:
type: string
description: ''
/api/availability/eventtype: /api/availability/eventtype:
post: post:
description: Adds a new event type for the user. description: Adds a new event type for the user.
summary: Adds a new event type summary: Adds a new event type
tags: tags:
- Availability - Availability
requestBody:
content:
application/json:
schema:
type: object
properties:
title:
type: string
slug:
type: string
description:
type: string
length:
type: string
hidden:
type: boolean
requiresConfirmation:
type: boolean
locations:
type: array
items: {}
eventName:
type: string
customInputs:
type: array
items: {}
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
eventType:
type: object
properties:
title:
type: string
slug:
type: string
description:
type: string
length:
type: string
hidden:
type: boolean
requiresConfirmation:
type: boolean
locations:
type: array
items: {}
eventName:
type: string
customInputs:
type: array
items: {}
'500':
description: Internal Server Error
patch: patch:
description: Updates an event type for the user. description: Updates an event type for the user.
summary: Updates an event type summary: Updates an event type
tags: tags:
- Availability - Availability
requestBody:
content:
application/json:
schema:
type: object
properties:
title:
type: string
slug:
type: string
description:
type: string
length:
type: string
hidden:
type: boolean
requiresConfirmation:
type: boolean
locations:
type: array
items: {}
eventName:
type: string
customInputs:
type: array
items: {}
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
eventType:
type: object
properties:
title:
type: string
slug:
type: string
description:
type: string
length:
type: string
hidden:
type: boolean
requiresConfirmation:
type: boolean
locations:
type: array
items: {}
eventName:
type: string
customInputs:
type: array
items: {}
'500':
description: Internal Server Error
delete: delete:
description: Deletes an event type for the user. description: Deletes an event type for the user.
summary: Deletes an event type summary: Deletes an event type
tags: tags:
- Availability - Availability
/api/availability/calendars: responses:
post: '200':
description: Selects calendar for availability checking. description: OK
summary: Adds selected calendar content:
tags: application/json:
- Availability schema:
delete: type: object
description: Removes a calendar from availability checking. properties: {}
summary: Deletes a selected calendar '500':
tags: description: Internal Server Error
- Availability '/api/book/:user':
/api/book/:user:
post: post:
description: Creates a booking in the user's calendar. description: Creates a booking in the user's calendar.
summary: Creates a booking for a user summary: Creates a booking for a user
@ -238,19 +531,19 @@ paths:
summary: Leave team or decline team invite. summary: Leave team or decline team invite.
tags: tags:
- User - User
/api/:team: '/api/:team':
delete: delete:
description: Deletes a team description: Deletes a team
summary: Deletes a team summary: Deletes a team
tags: tags:
- Teams - Teams
/api/:team/invite: '/api/:team/invite':
post: post:
description: Invites someone to a team. description: Invites someone to a team.
summary: Invites someone to a team summary: Invites someone to a team
tags: tags:
- Teams - Teams
/api/:team/membership: '/api/:team/membership':
get: get:
description: Lists the members of a team. description: Lists the members of a team.
summary: Lists members of a team summary: Lists members of a team
@ -261,3 +554,8 @@ paths:
summary: Cancels a membership summary: Cancels a membership
tags: tags:
- Teams - Teams
servers:
- url: 'https://app.calendso.com'
description: Production
components:
securitySchemes: {}