From 355737a86f27d91d65ad34953b338fe5123abeb6 Mon Sep 17 00:00:00 2001 From: zomars Date: Mon, 21 Feb 2022 16:14:46 -0700 Subject: [PATCH] WIP --- appStore/_example/package.json | 17 +++++++ appStore/zoomvideo/pages/api/index.ts | 0 appStore/zoomvideo/pages/index.ts | 0 apps/docs/pages/meta.json | 15 ------- .../lib/apps/calendar/interfaces/Calendar.ts | 31 ++----------- .../interfaces/GoogleCalendar.ts | 5 --- apps/web/lib/apps/meta.json | 14 ++++++ apps/web/lib/errors.ts | 34 +------------- apps/web/lib/videoClient.ts | 38 ++++++---------- apps/web/next.config.js | 1 + apps/web/package.json | 1 + apps/web/pages/api/integrations/[...args].ts | 45 +++++++++++++++++++ apps/web/pages/apps/_appRegistry.ts | 30 ++++++++++++- package.json | 2 +- packages/app-store/_example/package.json | 17 +++++++ packages/app-store/index.ts | 7 +++ packages/app-store/package.json | 8 ++++ packages/app-store/tsconfig.json | 5 +++ .../app-store/zoomvideo}/api/add.ts | 1 - .../app-store/zoomvideo}/api/callback.ts | 1 - packages/app-store/zoomvideo/api/index.ts | 2 + packages/app-store/zoomvideo/index.ts | 2 + .../zoomvideo/lib/VideoApiAdapter.ts | 11 +++-- packages/app-store/zoomvideo/lib/index.ts | 1 + .../app-store}/zoomvideo/package.json | 3 ++ packages/lib/errors.ts | 32 +++++++++++++ packages/types/CalendarEvent.d.ts | 35 +++++++++++++++ packages/types/VideoApiAdapter.d.ts | 22 +++++++++ packages/types/next.d.ts | 3 +- {appStore => packages/types}/tsconfig.json | 2 +- 30 files changed, 267 insertions(+), 118 deletions(-) create mode 100644 appStore/_example/package.json delete mode 100644 appStore/zoomvideo/pages/api/index.ts delete mode 100644 appStore/zoomvideo/pages/index.ts delete mode 100644 apps/docs/pages/meta.json delete mode 100644 apps/web/lib/apps/google_calendar/interfaces/GoogleCalendar.ts create mode 100644 apps/web/lib/apps/meta.json create mode 100644 apps/web/pages/api/integrations/[...args].ts create mode 100644 packages/app-store/_example/package.json create mode 100644 packages/app-store/index.ts create mode 100644 packages/app-store/package.json create mode 100644 packages/app-store/tsconfig.json rename {appStore/zoomvideo/pages => packages/app-store/zoomvideo}/api/add.ts (96%) rename {appStore/zoomvideo/pages => packages/app-store/zoomvideo}/api/callback.ts (97%) create mode 100644 packages/app-store/zoomvideo/api/index.ts create mode 100644 packages/app-store/zoomvideo/index.ts rename apps/web/lib/integrations/Zoom/ZoomVideoApiAdapter.ts => packages/app-store/zoomvideo/lib/VideoApiAdapter.ts (95%) create mode 100644 packages/app-store/zoomvideo/lib/index.ts rename {appStore => packages/app-store}/zoomvideo/package.json (92%) create mode 100644 packages/lib/errors.ts create mode 100644 packages/types/CalendarEvent.d.ts create mode 100644 packages/types/VideoApiAdapter.d.ts rename {appStore => packages/types}/tsconfig.json (72%) diff --git a/appStore/_example/package.json b/appStore/_example/package.json new file mode 100644 index 0000000000..e9f4affd47 --- /dev/null +++ b/appStore/_example/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "zoom", + "label": "Zoom", + "⬇️ needs to be the same as the folder name": 1, + "slug": "zoom", + "category": "Video Conferencing", + "description": "Zoom is the most popular video conferencing platform, joinable on the web or via desktop/mobile apps.", + "logo": "/apps/zoom.svg", + "publisher": "Cal.com", + "url": "https://zoom.us/", + "verified": true, + "⬇️ TODO: placeholder for now, pull this from TrustPilot or G2": 1, + "rating": 4.3, + "⬇️ TODO 2: placeholder for now, pull this from TrustPilot or G2": 1, + "reviews": 69 +} diff --git a/appStore/zoomvideo/pages/api/index.ts b/appStore/zoomvideo/pages/api/index.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/appStore/zoomvideo/pages/index.ts b/appStore/zoomvideo/pages/index.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/apps/docs/pages/meta.json b/apps/docs/pages/meta.json deleted file mode 100644 index 487b4b86ac..0000000000 --- a/apps/docs/pages/meta.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "index": "Home", - "self-hosting": "Self-hosting", - "availability": "Availability", - "bookings": "Bookings", - "event-types": "Event Types", - "teams": "Teams", - "integrations": "Integrations", - "webhooks": "Webhooks", - "settings": "Settings", - "import": "Import", - "billing": "Billing", - "developer": "Developer", - "faq": "FAQs" -} diff --git a/apps/web/lib/apps/calendar/interfaces/Calendar.ts b/apps/web/lib/apps/calendar/interfaces/Calendar.ts index 6444f3bde5..f428782a6c 100644 --- a/apps/web/lib/apps/calendar/interfaces/Calendar.ts +++ b/apps/web/lib/apps/calendar/interfaces/Calendar.ts @@ -1,13 +1,11 @@ -import { DestinationCalendar, SelectedCalendar } from "@prisma/client"; +import { SelectedCalendar } from "@prisma/client"; -import { PaymentInfo } from "@ee/lib/stripe/server"; +import type { CalendarEvent, ConferenceData } from "@calcom/types/CalendarEvent"; import type { Event } from "@lib/events/EventManager"; import { Ensure } from "@lib/types/utils"; -import { VideoCallData } from "@lib/videoClient"; -import { ConferenceData } from "../../google_calendar/interfaces/GoogleCalendar"; -import { NewCalendarEventType, Person } from "../types/CalendarTypes"; +import { NewCalendarEventType } from "../types/CalendarTypes"; export interface EntryPoint { entryPointType?: string; @@ -26,29 +24,6 @@ export interface AdditionInformation { hangoutLink?: string; } -export interface CalendarEvent { - type: string; - title: string; - startTime: string; - endTime: string; - description?: string | null; - team?: { - name: string; - members: string[]; - }; - location?: string | null; - organizer: Person; - attendees: Person[]; - conferenceData?: ConferenceData; - additionInformation?: AdditionInformation; - uid?: string | null; - videoCallData?: VideoCallData; - paymentInfo?: PaymentInfo | null; - destinationCalendar?: DestinationCalendar | null; - cancellationReason?: string | null; - rejectionReason?: string | null; -} - export interface IntegrationCalendar extends Ensure, "externalId"> { primary?: boolean; name?: string; diff --git a/apps/web/lib/apps/google_calendar/interfaces/GoogleCalendar.ts b/apps/web/lib/apps/google_calendar/interfaces/GoogleCalendar.ts deleted file mode 100644 index a76d26a58b..0000000000 --- a/apps/web/lib/apps/google_calendar/interfaces/GoogleCalendar.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { calendar_v3 } from "googleapis"; - -export interface ConferenceData { - createRequest?: calendar_v3.Schema$CreateConferenceRequest; -} diff --git a/apps/web/lib/apps/meta.json b/apps/web/lib/apps/meta.json new file mode 100644 index 0000000000..83456d51c1 --- /dev/null +++ b/apps/web/lib/apps/meta.json @@ -0,0 +1,14 @@ +{ + "index": 1, + "self-hosting": 1, + "availability": 1, + "bookings": 1, + "event-types": 1, + "teams": 1, + "integrations": 1, + "webhooks": 1, + "settings": 1, + "import": 1, + "billing": 1, + "developer": 1 +} diff --git a/apps/web/lib/errors.ts b/apps/web/lib/errors.ts index 78d35001e5..15d05a1bc9 100644 --- a/apps/web/lib/errors.ts +++ b/apps/web/lib/errors.ts @@ -1,32 +1,2 @@ -import { Prisma } from "@prisma/client"; - -export function getErrorFromUnknown(cause: unknown): Error & { statusCode?: number; code?: string } { - if (cause instanceof Prisma.PrismaClientKnownRequestError) { - return cause; - } - if (cause instanceof Error) { - return cause; - } - if (typeof cause === "string") { - // @ts-expect-error https://github.com/tc39/proposal-error-cause - return new Error(cause, { cause }); - } - - return new Error(`Unhandled error of type '${typeof cause}''`); -} - -export function handleErrorsJson(response: Response) { - if (!response.ok) { - response.json().then(console.log); - throw Error(response.statusText); - } - return response.json(); -} - -export function handleErrorsRaw(response: Response) { - if (!response.ok) { - response.text().then(console.log); - throw Error(response.statusText); - } - return response.text(); -} +// TODO: Remove this file once everything is imported from `@calcom/lib` +export * from "@calcom/lib/errors"; diff --git a/apps/web/lib/videoClient.ts b/apps/web/lib/videoClient.ts index 577eca4ad9..5c4845398b 100644 --- a/apps/web/lib/videoClient.ts +++ b/apps/web/lib/videoClient.ts @@ -2,48 +2,36 @@ import { Credential } from "@prisma/client"; import short from "short-uuid"; import { v5 as uuidv5 } from "uuid"; +import appStore from "@calcom/app-store"; +import type { CalendarEvent } from "@calcom/types/CalendarEvent"; +import type { PartialReference } from "@calcom/types/EventManager"; +import type { VideoApiAdapter, VideoApiAdapterFactory } from "@calcom/types/VideoApiAdapter"; + import { getUid } from "@lib/CalEventParser"; import { EventResult } from "@lib/events/EventManager"; -import { PartialReference } from "@lib/events/EventManager"; import Huddle01VideoApiAdapter from "@lib/integrations/Huddle01/Huddle01VideoApiAdapter"; import JitsiVideoApiAdapter from "@lib/integrations/Jitsi/JitsiVideoApiAdapter"; import logger from "@lib/logger"; import DailyVideoApiAdapter from "./integrations/Daily/DailyVideoApiAdapter"; import TandemVideoApiAdapter from "./integrations/Tandem/TandemVideoApiAdapter"; -import ZoomVideoApiAdapter from "./integrations/Zoom/ZoomVideoApiAdapter"; -import { CalendarEvent } from "./integrations/calendar/interfaces/Calendar"; const log = logger.getChildLogger({ prefix: ["[lib] videoClient"] }); const translator = short(); -export interface VideoCallData { - type: string; - id: string; - password: string; - url: string; -} - -type EventBusyDate = Record<"start" | "end", Date>; - -export interface VideoApiAdapter { - createMeeting(event: CalendarEvent): Promise; - - updateMeeting(bookingRef: PartialReference, event: CalendarEvent): Promise; - - deleteMeeting(uid: string): Promise; - - getAvailability(dateFrom?: string, dateTo?: string): Promise; -} - // factory const getVideoAdapters = (withCredentials: Credential[]): VideoApiAdapter[] => withCredentials.reduce((acc, cred) => { + const appName = cred.type.split("_").join(""); // Transform `zoom_video` to `zoomvideo`; + const makeVideoApiAdapter = appStore[appName].lib?.VideoApiAdapter as VideoApiAdapterFactory; + if (typeof makeVideoApiAdapter !== "undefined") { + const videoAdapter = makeVideoApiAdapter(cred); + acc.push(videoAdapter); + return acc; + } + switch (cred.type) { - case "zoom_video": - acc.push(ZoomVideoApiAdapter(cred)); - break; case "daily_video": acc.push(DailyVideoApiAdapter(cred)); break; diff --git a/apps/web/next.config.js b/apps/web/next.config.js index cc986162de..8e64462bd7 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -1,4 +1,5 @@ const withTM = require("@vercel/edge-functions-ui/transpile")([ + "@calcom/app-store", "@calcom/lib", "@calcom/prisma", "@calcom/ui", diff --git a/apps/web/package.json b/apps/web/package.json index f92d33b979..e64631007a 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -26,6 +26,7 @@ }, "dependencies": { "@boxyhq/saml-jackson": "0.3.6", + "@calcom/app-store": "*", "@calcom/lib": "*", "@calcom/prisma": "*", "@calcom/tsconfig": "*", diff --git a/apps/web/pages/api/integrations/[...args].ts b/apps/web/pages/api/integrations/[...args].ts new file mode 100644 index 0000000000..27acececbc --- /dev/null +++ b/apps/web/pages/api/integrations/[...args].ts @@ -0,0 +1,45 @@ +import { NextApiRequest, NextApiResponse } from "next"; + +import appStore from "@calcom/app-store"; + +import { getSession } from "@lib/auth"; +import { HttpError } from "@lib/core/http/error"; + +const handler = async (req: NextApiRequest, res: NextApiResponse) => { + // Check that user is authenticated + req.session = await getSession({ req }); + + if (!req.session?.user?.id) { + res.status(401).json({ message: "You must be logged in to do this" }); + return; + } + + const { args } = req.query; + + if (!Array.isArray(args)) { + return res.status(404).json({ message: `API route not found` }); + } + + const [appName, apiEndpoint] = args; + + try { + // TODO: Find a way to dynamically import these modules + // const app = (await import(`@calcom/${appName}`)).default; + const handler = appStore[appName].api[apiEndpoint]; + if (typeof handler !== "function") + throw new HttpError({ statusCode: 404, message: `API handler not found` }); + + const response = await handler(req, res); + console.log("response", response); + + res.status(200); + } catch (error) { + console.error(error); + if (error instanceof HttpError) { + return res.status(error.statusCode).json({ message: error.message }); + } + return res.status(404).json({ message: `API handler not found` }); + } +}; + +export default handler; diff --git a/apps/web/pages/apps/_appRegistry.ts b/apps/web/pages/apps/_appRegistry.ts index 09d30eaf3c..868e117450 100644 --- a/apps/web/pages/apps/_appRegistry.ts +++ b/apps/web/pages/apps/_appRegistry.ts @@ -1,4 +1,32 @@ -// TODO: maybe we wanna do this dynamically later based on folder structure +import fs from "fs"; +import path from "path"; + +// It won't be called on client-side. +export async function getStaticProps() { + const appStoreDir = path.join(process.cwd(), "packages/appStore"); + const filenames = fs.readdirSync(appStoreDir); + + const apps = filenames.map((filename) => { + const filePath = path.join(appStoreDir, filename); + const fileContents = fs.readFileSync(filePath, "utf8"); + + // Generally you would parse/transform the contents + // For example you can transform markdown to HTML here + + return { + filename, + content: fileContents, + }; + }); + // By returning { props: posts }, the Blog component + // will receive `posts` as a prop at build time + return { + props: { + posts: apps, + }, + }; +} + export function appRegistry() { return [ { diff --git a/package.json b/package.json index 6dad566a7e..36a639c0f4 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "workspaces": [ "apps/*", "packages/*", - "appStore/*" + "packages/app-store/*" ], "scripts": { "build": "turbo run build --scope=\"@calcom/web\" --include-dependencies", diff --git a/packages/app-store/_example/package.json b/packages/app-store/_example/package.json new file mode 100644 index 0000000000..e9f4affd47 --- /dev/null +++ b/packages/app-store/_example/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "zoom", + "label": "Zoom", + "⬇️ needs to be the same as the folder name": 1, + "slug": "zoom", + "category": "Video Conferencing", + "description": "Zoom is the most popular video conferencing platform, joinable on the web or via desktop/mobile apps.", + "logo": "/apps/zoom.svg", + "publisher": "Cal.com", + "url": "https://zoom.us/", + "verified": true, + "⬇️ TODO: placeholder for now, pull this from TrustPilot or G2": 1, + "rating": 4.3, + "⬇️ TODO 2: placeholder for now, pull this from TrustPilot or G2": 1, + "reviews": 69 +} diff --git a/packages/app-store/index.ts b/packages/app-store/index.ts new file mode 100644 index 0000000000..621380ecbe --- /dev/null +++ b/packages/app-store/index.ts @@ -0,0 +1,7 @@ +import * as zoomvideo from "./zoomvideo"; + +const appStore = { + zoomvideo, +}; + +export default appStore; diff --git a/packages/app-store/package.json b/packages/app-store/package.json new file mode 100644 index 0000000000..a2ffa43828 --- /dev/null +++ b/packages/app-store/package.json @@ -0,0 +1,8 @@ +{ + "name": "@calcom/app-store", + "version": "0.0.0", + "main": "./index.ts", + "dependencies": { + "@calcom/zoomvideo": "*" + } +} diff --git a/packages/app-store/tsconfig.json b/packages/app-store/tsconfig.json new file mode 100644 index 0000000000..da602aa136 --- /dev/null +++ b/packages/app-store/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@calcom/tsconfig/base.json", + "include": [".", "@calcom/types"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/appStore/zoomvideo/pages/api/add.ts b/packages/app-store/zoomvideo/api/add.ts similarity index 96% rename from appStore/zoomvideo/pages/api/add.ts rename to packages/app-store/zoomvideo/api/add.ts index dab6f30c6e..87acc52266 100644 --- a/appStore/zoomvideo/pages/api/add.ts +++ b/packages/app-store/zoomvideo/api/add.ts @@ -2,7 +2,6 @@ import type { NextApiRequest, NextApiResponse } from "next"; import { stringify } from "querystring"; import prisma from "@calcom/prisma"; -import "@calcom/types/next"; const BASE_URL = process.env.BASE_URL || `https://${process.env.VERCEL_URL}`; diff --git a/appStore/zoomvideo/pages/api/callback.ts b/packages/app-store/zoomvideo/api/callback.ts similarity index 97% rename from appStore/zoomvideo/pages/api/callback.ts rename to packages/app-store/zoomvideo/api/callback.ts index de70b68e3c..133936bc73 100644 --- a/appStore/zoomvideo/pages/api/callback.ts +++ b/packages/app-store/zoomvideo/api/callback.ts @@ -1,7 +1,6 @@ import type { NextApiRequest, NextApiResponse } from "next"; import prisma from "@calcom/prisma"; -import "@calcom/types/next"; const BASE_URL = process.env.BASE_URL || `https://${process.env.VERCEL_URL}`; diff --git a/packages/app-store/zoomvideo/api/index.ts b/packages/app-store/zoomvideo/api/index.ts new file mode 100644 index 0000000000..eb12c1b4ed --- /dev/null +++ b/packages/app-store/zoomvideo/api/index.ts @@ -0,0 +1,2 @@ +export { default as add } from "./add"; +export { default as callback } from "./callback"; diff --git a/packages/app-store/zoomvideo/index.ts b/packages/app-store/zoomvideo/index.ts new file mode 100644 index 0000000000..e2e9d7b029 --- /dev/null +++ b/packages/app-store/zoomvideo/index.ts @@ -0,0 +1,2 @@ +export * as api from "./api"; +export * as lib from "./lib"; diff --git a/apps/web/lib/integrations/Zoom/ZoomVideoApiAdapter.ts b/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts similarity index 95% rename from apps/web/lib/integrations/Zoom/ZoomVideoApiAdapter.ts rename to packages/app-store/zoomvideo/lib/VideoApiAdapter.ts index ed5146120a..a581d86034 100644 --- a/apps/web/lib/integrations/Zoom/ZoomVideoApiAdapter.ts +++ b/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts @@ -1,11 +1,10 @@ import { Credential } from "@prisma/client"; -import { handleErrorsJson, handleErrorsRaw } from "@lib/errors"; -import { PartialReference } from "@lib/events/EventManager"; -import prisma from "@lib/prisma"; -import { VideoApiAdapter, VideoCallData } from "@lib/videoClient"; - -import { CalendarEvent } from "../calendar/interfaces/Calendar"; +import { handleErrorsJson, handleErrorsRaw } from "@calcom/lib/errors"; +import prisma from "@calcom/prisma"; +import type { CalendarEvent } from "@calcom/types/CalendarEvent"; +import type { PartialReference } from "@calcom/types/EventManager"; +import type { VideoApiAdapter, VideoCallData } from "@calcom/types/VideoApiAdapter"; /** @link https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate */ export interface ZoomEventResult { diff --git a/packages/app-store/zoomvideo/lib/index.ts b/packages/app-store/zoomvideo/lib/index.ts new file mode 100644 index 0000000000..dc61768d60 --- /dev/null +++ b/packages/app-store/zoomvideo/lib/index.ts @@ -0,0 +1 @@ +export { default as VideoApiAdapter } from "./VideoApiAdapter"; diff --git a/appStore/zoomvideo/package.json b/packages/app-store/zoomvideo/package.json similarity index 92% rename from appStore/zoomvideo/package.json rename to packages/app-store/zoomvideo/package.json index f4ac1ecfb9..b8d49bb35d 100644 --- a/appStore/zoomvideo/package.json +++ b/packages/app-store/zoomvideo/package.json @@ -16,6 +16,9 @@ "⬇️ TODO 2: placeholder for now, pull this from TrustPilot or G2": 1, "reviews": 69, "dependencies": { + "@calcom/prisma": "*" + }, + "devDependencies": { "@calcom/types": "*" } } diff --git a/packages/lib/errors.ts b/packages/lib/errors.ts new file mode 100644 index 0000000000..78d35001e5 --- /dev/null +++ b/packages/lib/errors.ts @@ -0,0 +1,32 @@ +import { Prisma } from "@prisma/client"; + +export function getErrorFromUnknown(cause: unknown): Error & { statusCode?: number; code?: string } { + if (cause instanceof Prisma.PrismaClientKnownRequestError) { + return cause; + } + if (cause instanceof Error) { + return cause; + } + if (typeof cause === "string") { + // @ts-expect-error https://github.com/tc39/proposal-error-cause + return new Error(cause, { cause }); + } + + return new Error(`Unhandled error of type '${typeof cause}''`); +} + +export function handleErrorsJson(response: Response) { + if (!response.ok) { + response.json().then(console.log); + throw Error(response.statusText); + } + return response.json(); +} + +export function handleErrorsRaw(response: Response) { + if (!response.ok) { + response.text().then(console.log); + throw Error(response.statusText); + } + return response.text(); +} diff --git a/packages/types/CalendarEvent.d.ts b/packages/types/CalendarEvent.d.ts new file mode 100644 index 0000000000..61f7d013c8 --- /dev/null +++ b/packages/types/CalendarEvent.d.ts @@ -0,0 +1,35 @@ +import type { DestinationCalendar } from "@prisma/client"; +import type { calendar_v3 } from "googleapis"; + +export interface ConferenceData { + createRequest?: calendar_v3.Schema$CreateConferenceRequest; +} + +export interface AdditionInformation { + conferenceData?: ConferenceData; + entryPoints?: EntryPoint[]; + hangoutLink?: string; +} + +export interface CalendarEvent { + type: string; + title: string; + startTime: string; + endTime: string; + description?: string | null; + team?: { + name: string; + members: string[]; + }; + location?: string | null; + organizer: Person; + attendees: Person[]; + conferenceData?: ConferenceData; + additionInformation?: AdditionInformation; + uid?: string | null; + videoCallData?: VideoCallData; + paymentInfo?: PaymentInfo | null; + destinationCalendar?: DestinationCalendar | null; + cancellationReason?: string | null; + rejectionReason?: string | null; +} diff --git a/packages/types/VideoApiAdapter.d.ts b/packages/types/VideoApiAdapter.d.ts new file mode 100644 index 0000000000..d04d8010bd --- /dev/null +++ b/packages/types/VideoApiAdapter.d.ts @@ -0,0 +1,22 @@ +import type { Credential } from "@prisma/client"; + +export interface VideoCallData { + type: string; + id: string; + password: string; + url: string; +} + +export type EventBusyDate = Record<"start" | "end", Date>; + +export interface VideoApiAdapter { + createMeeting(event: CalendarEvent): Promise; + + updateMeeting(bookingRef: PartialReference, event: CalendarEvent): Promise; + + deleteMeeting(uid: string): Promise; + + getAvailability(dateFrom?: string, dateTo?: string): Promise; +} + +export type VideoApiAdapterFactory = (credential: Credential) => VideoApiAdapter; diff --git a/packages/types/next.d.ts b/packages/types/next.d.ts index fcc87fcd14..fc1126adb6 100644 --- a/packages/types/next.d.ts +++ b/packages/types/next.d.ts @@ -1,6 +1,5 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ import type { IncomingMessage } from "http"; -import { Session } from "next-auth"; +import type { Session } from "next-auth"; import "./next-auth"; diff --git a/appStore/tsconfig.json b/packages/types/tsconfig.json similarity index 72% rename from appStore/tsconfig.json rename to packages/types/tsconfig.json index 361a3cd7c8..f9701e8ae8 100644 --- a/appStore/tsconfig.json +++ b/packages/types/tsconfig.json @@ -1,5 +1,5 @@ { "extends": "@calcom/tsconfig/base.json", - "include": ["", "@calcom/types"], + "include": ["."], "exclude": ["dist", "build", "node_modules"] }