diff --git a/apps/web/lib/apps/conferencing/config.ts b/apps/web/lib/apps/conferencing/config.ts index 2de6e158a1..488ca7bf7c 100644 --- a/apps/web/lib/apps/conferencing/config.ts +++ b/apps/web/lib/apps/conferencing/config.ts @@ -1,5 +1,10 @@ +import { Prisma } from "@prisma/client"; +import _ from "lodash"; + import type { App } from "@calcom/types/App"; +import { validJson } from "@lib/jsonUtils"; + export const APPS = { daily_video: { installed: !!process.env.DAILY_API_KEY, @@ -20,4 +25,72 @@ export const APPS = { rating: 0, reviews: 0, }, + jitsi_video: { + installed: true, + type: "jitsi_video", + title: "Jitsi Meet", + imageSrc: "integrations/jitsi.svg", + description: "Video Conferencing", + variant: "conferencing", + name: "Daily", + label: "", + slug: "", + category: "", + logo: "", + publisher: "", + url: "", + verified: true, + trending: true, + rating: 0, + reviews: 0, + }, + huddle01_video: { + installed: true, + type: "huddle01_video", + title: "Huddle01", + imageSrc: "integrations/huddle.svg", + description: "Video Conferencing", + variant: "conferencing", + name: "Daily", + label: "", + slug: "", + category: "", + logo: "", + publisher: "", + url: "", + verified: true, + trending: true, + rating: 0, + reviews: 0, + }, + tandem_video: { + installed: !!(process.env.TANDEM_CLIENT_ID && process.env.TANDEM_CLIENT_SECRET), + type: "tandem_video", + title: "Tandem Video", + imageSrc: "integrations/tandem.svg", + description: "Virtual Office | Video Conferencing", + variant: "conferencing", + name: "Daily", + label: "", + slug: "", + category: "", + logo: "", + publisher: "", + url: "", + verified: true, + trending: true, + rating: 0, + reviews: 0, + }, } as Record; + +export const ALL_INTEGRATIONS = [ + { + installed: true, + type: "metamask_web3", + title: "Metamask", + imageSrc: "integrations/apple-calendar.svg", + description: "For personal and business calendars", + variant: "web3", + }, +]; diff --git a/packages/app-store/_example/api/example.ts b/packages/app-store/_example/api/example.ts new file mode 100644 index 0000000000..f0988db139 --- /dev/null +++ b/packages/app-store/_example/api/example.ts @@ -0,0 +1,10 @@ +import type { NextApiRequest, NextApiResponse } from "next"; + +/** + * This is an example endoint for an app, these will run under `/api/integrations/[...args]` + * @param req + * @param res + */ +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + res.status(200); +} diff --git a/packages/app-store/_example/api/index.ts b/packages/app-store/_example/api/index.ts new file mode 100644 index 0000000000..c10a1b92b3 --- /dev/null +++ b/packages/app-store/_example/api/index.ts @@ -0,0 +1 @@ +export { default as example } from "./example"; diff --git a/packages/app-store/_example/index.ts b/packages/app-store/_example/index.ts new file mode 100644 index 0000000000..98904674e7 --- /dev/null +++ b/packages/app-store/_example/index.ts @@ -0,0 +1,26 @@ +import type { App } from "@calcom/types/App"; + +import _package from "./package.json"; + +export const metadata = { + name: _package.name, + description: _package.description, + installed: true, + category: "video", + imageSrc: "/cal-com-icon.svg", + label: "Example App", + logo: "/cal-com-icon.svg", + publisher: "Cal.com", + rating: 5, + reviews: 69, + slug: "example_video", + title: "Example App", + trending: true, + type: "example_video", + url: "https://cal.com/", + variant: "conferencing", + verified: true, +} as App; + +export * as api from "./api"; +export * as lib from "./lib"; diff --git a/packages/app-store/_example/lib/VideoApiAdapter.ts b/packages/app-store/_example/lib/VideoApiAdapter.ts new file mode 100644 index 0000000000..86609db478 --- /dev/null +++ b/packages/app-store/_example/lib/VideoApiAdapter.ts @@ -0,0 +1,36 @@ +import type { VideoApiAdapterFactory } from "@calcom/types/VideoApiAdapter"; + +/** This is a barebones factory function for a video integration */ +const ExampleVideoApiAdapter: VideoApiAdapterFactory = (credential) => { + return { + getAvailability: async () => { + try { + return []; + } catch (err) { + console.error(err); + return []; + } + }, + createMeeting: async (event) => { + return Promise.resolve({ + type: "example_video", + id: "", + password: "", + url: "", + }); + }, + deleteMeeting: async (uid) => { + return Promise.resolve(); + }, + updateMeeting: async (bookingRef, event) => { + return Promise.resolve({ + type: "example_video", + id: bookingRef.meetingId as string, + password: bookingRef.meetingPassword as string, + url: bookingRef.meetingUrl as string, + }); + }, + }; +}; + +export default ExampleVideoApiAdapter; diff --git a/packages/app-store/_example/lib/index.ts b/packages/app-store/_example/lib/index.ts new file mode 100644 index 0000000000..dc61768d60 --- /dev/null +++ b/packages/app-store/_example/lib/index.ts @@ -0,0 +1 @@ +export { default as VideoApiAdapter } from "./VideoApiAdapter"; diff --git a/packages/app-store/_example/package.json b/packages/app-store/_example/package.json index e9f4affd47..757b0296d3 100644 --- a/packages/app-store/_example/package.json +++ b/packages/app-store/_example/package.json @@ -1,17 +1,14 @@ { + "$schema": "https://json.schemastore.org/package.json", "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 + "name": "@calcom/example-app", + "version": "0.0.0", + "main": "./index.ts", + "description": "This is a brief description for the Example App.", + "dependencies": { + "@calcom/prisma": "*" + }, + "devDependencies": { + "@calcom/types": "*" + } } diff --git a/packages/app-store/_example/static/icon.svg b/packages/app-store/_example/static/icon.svg new file mode 100644 index 0000000000..d8f2d80f09 --- /dev/null +++ b/packages/app-store/_example/static/icon.svg @@ -0,0 +1,6 @@ + + + + diff --git a/packages/app-store/index.ts b/packages/app-store/index.ts index 621380ecbe..5512edd02d 100644 --- a/packages/app-store/index.ts +++ b/packages/app-store/index.ts @@ -1,6 +1,8 @@ +import * as example from "./_example"; import * as zoomvideo from "./zoomvideo"; const appStore = { + example, zoomvideo, }; diff --git a/packages/app-store/zoomvideo/package.json b/packages/app-store/zoomvideo/package.json index c07329c03c..c85718c5a6 100644 --- a/packages/app-store/zoomvideo/package.json +++ b/packages/app-store/zoomvideo/package.json @@ -1,4 +1,5 @@ { + "private": true, "name": "@calcom/zoomvideo", "version": "0.0.0", "main": "./index.ts", @@ -10,9 +11,7 @@ "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, "dependencies": { "@calcom/prisma": "*"