Skip to content

Scheduling infrastructure for absolutely everyone.

fix: remove json schema

Agusti Fernandez Pardo4321fec73444
diff --git a/json-schema/json-schema.json b/json-schema/json-schema.json
deleted file mode 100644
index f6a197e4a5a..00000000000
--- a/json-schema/json-schema.json
+++ /dev/null
@@ -1,1064 +0,0 @@
-{
- "$schema": "http://json-schema.org/draft-07/schema#",
- "definitions": {
- "EventType": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "title": {
- "type": "string",
- "description": "@zod.nonempty()"
- },
- "slug": {
- "type": "string",
- "description": "@zod.custom(imports.eventTypeSlug)"
- },
- "description": {
- "type": ["string", "null"]
- },
- "position": {
- "type": "integer",
- "default": 0
- },
- "locations": {
- "type": ["number", "string", "boolean", "object", "array", "null"],
- "description": "@zod.custom(imports.eventTypeLocations)"
- },
- "length": {
- "type": "integer"
- },
- "hidden": {
- "type": "boolean",
- "default": false
- },
- "users": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/User"
- }
- },
- "userId": {
- "type": ["integer", "null"]
- },
- "team": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Team"
- },
- {
- "type": "null"
- }
- ]
- },
- "bookings": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Booking"
- }
- },
- "availability": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Availability"
- }
- },
- "webhooks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Webhook"
- }
- },
- "destinationCalendar": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/DestinationCalendar"
- },
- {
- "type": "null"
- }
- ]
- },
- "eventName": {
- "type": ["string", "null"]
- },
- "customInputs": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EventTypeCustomInput"
- }
- },
- "timeZone": {
- "type": ["string", "null"]
- },
- "periodType": {
- "type": "string",
- "default": "UNLIMITED",
- "enum": ["UNLIMITED", "ROLLING", "RANGE"]
- },
- "periodStartDate": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "periodEndDate": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "periodDays": {
- "type": ["integer", "null"]
- },
- "periodCountCalendarDays": {
- "type": ["boolean", "null"]
- },
- "requiresConfirmation": {
- "type": "boolean",
- "default": false
- },
- "disableGuests": {
- "type": "boolean",
- "default": false
- },
- "minimumBookingNotice": {
- "type": "integer",
- "default": 120
- },
- "beforeEventBuffer": {
- "type": "integer",
- "default": 0
- },
- "afterEventBuffer": {
- "type": "integer",
- "default": 0
- },
- "schedulingType": {
- "type": ["string", "null"],
- "enum": ["ROUND_ROBIN", "COLLECTIVE"]
- },
- "schedule": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Schedule"
- },
- {
- "type": "null"
- }
- ]
- },
- "price": {
- "type": "integer",
- "default": 0
- },
- "currency": {
- "type": "string",
- "default": "usd"
- },
- "slotInterval": {
- "type": ["integer", "null"]
- },
- "metadata": {
- "type": ["number", "string", "boolean", "object", "array", "null"]
- }
- }
- },
- "Credential": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "type": {
- "type": "string"
- },
- "key": {
- "type": ["number", "string", "boolean", "object", "array", "null"]
- },
- "user": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/User"
- },
- {
- "type": "null"
- }
- ]
- }
- }
- },
- "DestinationCalendar": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "integration": {
- "type": "string"
- },
- "externalId": {
- "type": "string"
- },
- "user": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/User"
- },
- {
- "type": "null"
- }
- ]
- },
- "booking": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Booking"
- },
- {
- "type": "null"
- }
- ]
- },
- "eventType": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/EventType"
- },
- {
- "type": "null"
- }
- ]
- }
- }
- },
- "User": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "username": {
- "type": ["string", "null"]
- },
- "name": {
- "type": ["string", "null"]
- },
- "email": {
- "type": "string",
- "description": "@zod.email()"
- },
- "emailVerified": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "password": {
- "type": ["string", "null"]
- },
- "bio": {
- "type": ["string", "null"]
- },
- "avatar": {
- "type": ["string", "null"]
- },
- "timeZone": {
- "type": "string",
- "default": "Europe/London"
- },
- "weekStart": {
- "type": "string",
- "default": "Sunday"
- },
- "startTime": {
- "type": "integer",
- "default": 0
- },
- "endTime": {
- "type": "integer",
- "default": 1440
- },
- "bufferTime": {
- "type": "integer",
- "default": 0
- },
- "hideBranding": {
- "type": "boolean",
- "default": false
- },
- "theme": {
- "type": ["string", "null"]
- },
- "createdDate": {
- "type": "string",
- "format": "date-time"
- },
- "trialEndsAt": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "eventTypes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EventType"
- }
- },
- "credentials": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Credential"
- }
- },
- "teams": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Membership"
- }
- },
- "bookings": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Booking"
- }
- },
- "schedules": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Schedule"
- }
- },
- "defaultScheduleId": {
- "type": ["integer", "null"]
- },
- "selectedCalendars": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/SelectedCalendar"
- }
- },
- "completedOnboarding": {
- "type": "boolean",
- "default": false
- },
- "locale": {
- "type": ["string", "null"]
- },
- "timeFormat": {
- "type": ["integer", "null"],
- "default": 12
- },
- "twoFactorSecret": {
- "type": ["string", "null"]
- },
- "twoFactorEnabled": {
- "type": "boolean",
- "default": false
- },
- "identityProvider": {
- "type": "string",
- "default": "CAL",
- "enum": ["CAL", "GOOGLE", "SAML"]
- },
- "identityProviderId": {
- "type": ["string", "null"]
- },
- "availability": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Availability"
- }
- },
- "invitedTo": {
- "type": ["integer", "null"]
- },
- "plan": {
- "type": "string",
- "default": "TRIAL",
- "enum": ["FREE", "TRIAL", "PRO"]
- },
- "webhooks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Webhook"
- }
- },
- "brandColor": {
- "type": "string",
- "default": "#292929"
- },
- "darkBrandColor": {
- "type": "string",
- "default": "#fafafa"
- },
- "destinationCalendar": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/DestinationCalendar"
- },
- {
- "type": "null"
- }
- ]
- },
- "away": {
- "type": "boolean",
- "default": false
- },
- "metadata": {
- "type": ["number", "string", "boolean", "object", "array", "null"]
- },
- "verified": {
- "type": ["boolean", "null"],
- "default": false
- },
- "apiKeys": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ApiKey"
- }
- }
- }
- },
- "Team": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "name": {
- "type": ["string", "null"]
- },
- "slug": {
- "type": ["string", "null"]
- },
- "logo": {
- "type": ["string", "null"]
- },
- "bio": {
- "type": ["string", "null"]
- },
- "hideBranding": {
- "type": "boolean",
- "default": false
- },
- "members": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Membership"
- }
- },
- "eventTypes": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/EventType"
- }
- }
- }
- },
- "Membership": {
- "type": "object",
- "properties": {
- "accepted": {
- "type": "boolean",
- "default": false
- },
- "role": {
- "type": "string",
- "enum": ["MEMBER", "ADMIN", "OWNER"]
- },
- "team": {
- "$ref": "#/components/schemas/Team"
- },
- "user": {
- "$ref": "#/components/schemas/User"
- }
- }
- },
- "VerificationRequest": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "identifier": {
- "type": "string"
- },
- "token": {
- "type": "string"
- },
- "expires": {
- "type": "string",
- "format": "date-time"
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- },
- "updatedAt": {
- "type": "string",
- "format": "date-time"
- }
- }
- },
- "BookingReference": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "type": {
- "type": "string"
- },
- "uid": {
- "type": "string"
- },
- "meetingId": {
- "type": ["string", "null"]
- },
- "meetingPassword": {
- "type": ["string", "null"]
- },
- "meetingUrl": {
- "type": ["string", "null"]
- },
- "booking": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Booking"
- },
- {
- "type": "null"
- }
- ]
- }
- }
- },
- "Attendee": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "email": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "timeZone": {
- "type": "string"
- },
- "locale": {
- "type": ["string", "null"],
- "default": "en"
- },
- "booking": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Booking"
- },
- {
- "type": "null"
- }
- ]
- }
- }
- },
- "DailyEventReference": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "dailyurl": {
- "type": "string",
- "default": "dailycallurl"
- },
- "dailytoken": {
- "type": "string",
- "default": "dailytoken"
- },
- "booking": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Booking"
- },
- {
- "type": "null"
- }
- ]
- }
- }
- },
- "Booking": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "uid": {
- "type": "string"
- },
- "user": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/User"
- },
- {
- "type": "null"
- }
- ]
- },
- "references": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/BookingReference"
- }
- },
- "eventType": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/EventType"
- },
- {
- "type": "null"
- }
- ]
- },
- "title": {
- "type": "string"
- },
- "description": {
- "type": ["string", "null"]
- },
- "startTime": {
- "type": "string",
- "format": "date-time"
- },
- "endTime": {
- "type": "string",
- "format": "date-time"
- },
- "attendees": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Attendee"
- }
- },
- "location": {
- "type": ["string", "null"]
- },
- "dailyRef": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/DailyEventReference"
- },
- {
- "type": "null"
- }
- ]
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- },
- "updatedAt": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "confirmed": {
- "type": "boolean",
- "default": true
- },
- "rejected": {
- "type": "boolean",
- "default": false
- },
- "status": {
- "type": "string",
- "default": "ACCEPTED",
- "enum": ["CANCELLED", "ACCEPTED", "REJECTED", "PENDING"]
- },
- "paid": {
- "type": "boolean",
- "default": false
- },
- "payment": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Payment"
- }
- },
- "destinationCalendar": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/DestinationCalendar"
- },
- {
- "type": "null"
- }
- ]
- },
- "cancellationReason": {
- "type": ["string", "null"]
- },
- "rejectionReason": {
- "type": ["string", "null"]
- }
- }
- },
- "Schedule": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "user": {
- "$ref": "#/components/schemas/User"
- },
- "eventType": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/EventType"
- },
- {
- "type": "null"
- }
- ]
- },
- "name": {
- "type": "string"
- },
- "timeZone": {
- "type": ["string", "null"]
- },
- "availability": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Availability"
- }
- }
- }
- },
- "Availability": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "user": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/User"
- },
- {
- "type": "null"
- }
- ]
- },
- "eventType": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/EventType"
- },
- {
- "type": "null"
- }
- ]
- },
- "days": {
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "startTime": {
- "type": "string",
- "format": "date-time"
- },
- "endTime": {
- "type": "string",
- "format": "date-time"
- },
- "date": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "Schedule": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Schedule"
- },
- {
- "type": "null"
- }
- ]
- }
- }
- },
- "SelectedCalendar": {
- "type": "object",
- "properties": {
- "user": {
- "$ref": "#/components/schemas/User"
- },
- "integration": {
- "type": "string"
- },
- "externalId": {
- "type": "string"
- }
- }
- },
- "EventTypeCustomInput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "eventType": {
- "$ref": "#/components/schemas/EventType"
- },
- "label": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": ["TEXT", "TEXTLONG", "NUMBER", "BOOL"]
- },
- "required": {
- "type": "boolean"
- },
- "placeholder": {
- "type": "string",
- "default": ""
- }
- }
- },
- "ResetPasswordRequest": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- },
- "updatedAt": {
- "type": "string",
- "format": "date-time"
- },
- "email": {
- "type": "string"
- },
- "expires": {
- "type": "string",
- "format": "date-time"
- }
- }
- },
- "ReminderMail": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "referenceId": {
- "type": "integer"
- },
- "reminderType": {
- "type": "string",
- "enum": ["PENDING_BOOKING_CONFIRMATION"]
- },
- "elapsedMinutes": {
- "type": "integer"
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- }
- }
- },
- "Payment": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "uid": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": ["STRIPE"]
- },
- "booking": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/Booking"
- },
- {
- "type": "null"
- }
- ]
- },
- "amount": {
- "type": "integer"
- },
- "fee": {
- "type": "integer"
- },
- "currency": {
- "type": "string"
- },
- "success": {
- "type": "boolean"
- },
- "refunded": {
- "type": "boolean"
- },
- "data": {
- "type": ["number", "string", "boolean", "object", "array", "null"]
- },
- "externalId": {
- "type": "string"
- }
- }
- },
- "Webhook": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "subscriberUrl": {
- "type": "string"
- },
- "payloadTemplate": {
- "type": ["string", "null"]
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- },
- "active": {
- "type": "boolean",
- "default": true
- },
- "eventTriggers": {
- "type": "array",
- "enum": ["BOOKING_CREATED", "BOOKING_RESCHEDULED", "BOOKING_CANCELLED"]
- },
- "user": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/User"
- },
- {
- "type": "null"
- }
- ]
- },
- "eventType": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/EventType"
- },
- {
- "type": "null"
- }
- ]
- }
- }
- },
- "ApiKey": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "user": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/User"
- },
- {
- "type": "null"
- }
- ]
- },
- "createdAt": {
- "type": "string",
- "format": "date-time"
- },
- "expiresAt": {
- "type": "string",
- "format": "date-time"
- },
- "note": {
- "type": ["string", "null"]
- }
- }
- }
- },
- "type": "object",
- "properties": {
- "eventType": {
- "$ref": "#/components/schemas/EventType"
- },
- "credential": {
- "$ref": "#/components/schemas/Credential"
- },
- "destinationCalendar": {
- "$ref": "#/components/schemas/DestinationCalendar"
- },
- "user": {
- "$ref": "#/components/schemas/User"
- },
- "team": {
- "$ref": "#/components/schemas/Team"
- },
- "membership": {
- "$ref": "#/components/schemas/Membership"
- },
- "verificationRequest": {
- "$ref": "#/components/schemas/VerificationRequest"
- },
- "bookingReference": {
- "$ref": "#/components/schemas/BookingReference"
- },
- "attendee": {
- "$ref": "#/components/schemas/Attendee"
- },
- "dailyEventReference": {
- "$ref": "#/components/schemas/DailyEventReference"
- },
- "booking": {
- "$ref": "#/components/schemas/Booking"
- },
- "schedule": {
- "$ref": "#/components/schemas/Schedule"
- },
- "availability": {
- "$ref": "#/components/schemas/Availability"
- },
- "selectedCalendar": {
- "$ref": "#/components/schemas/SelectedCalendar"
- },
- "eventTypeCustomInput": {
- "$ref": "#/components/schemas/EventTypeCustomInput"
- },
- "resetPasswordRequest": {
- "$ref": "#/components/schemas/ResetPasswordRequest"
- },
- "reminderMail": {
- "$ref": "#/components/schemas/ReminderMail"
- },
- "payment": {
- "$ref": "#/components/schemas/Payment"
- },
- "webhook": {
- "$ref": "#/components/schemas/Webhook"
- },
- "apiKey": {
- "$ref": "#/components/schemas/ApiKey"
- }
- }
-}
diff --git a/next.config.js b/next.config.js
index fa5bc84e10a..1542c7f0ffe 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,5 +1,3 @@
-// https://www.npmjs.com/package/next-transpile-modules
-// This makes our @calcom/prisma package from the monorepo to be transpiled and usable by API
const withTM = require("next-transpile-modules")([
"@calcom/app-store",
"@calcom/prisma",
@@ -7,13 +5,11 @@ const withTM = require("next-transpile-modules")([
"@calcom/ee",
]);
-// use something like withPlugins([withTM], {}) if more plugins added later.
-
module.exports = withTM({
async headers() {
return [
{
- // matching all API routes
+ // @note: disabling CORS matching all API routes as this will be a our Public API
source: "/api/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
@@ -30,12 +26,12 @@ module.exports = withTM({
},
async rewrites() {
return [
- // This redirects requests recieved at / the root to the /api/ folder.
+ // @note: redirects requests from: "/:rest*" the root level to the "/api/:rest*" folder by default.
{
source: "/:rest*",
destination: "/api/:rest*",
},
- // This redirects requests to api/v*/ to /api/ passing version as a query parameter.
+ // @note: redirects requests from api/v*/:rest to /api/:rest?version=* passing version as a query parameter.
{
source: "/api/v:version/:rest*",
destination: "/api/:rest*?version=:version",