Daily.co app (#2022)
* Daily.co app * Update packages/app-store/dailyvideo/lib/VideoApiAdapter.ts Co-authored-by: Omar López <zomars@me.com> * Update packages/app-store/dailyvideo/lib/VideoApiAdapter.ts Co-authored-by: Omar López <zomars@me.com> * Missing deps for newly added contants to lib Co-authored-by: Omar López <zomars@me.com>
This commit is contained in:
parent
3643d62ce6
commit
f0438ed35d
|
@ -6,25 +6,6 @@ import type { App } from "@calcom/types/App";
|
|||
import { validJson } from "@lib/jsonUtils";
|
||||
|
||||
export const APPS = {
|
||||
daily_video: {
|
||||
installed: !!process.env.DAILY_API_KEY,
|
||||
type: "daily_video",
|
||||
title: "Daily.co Video",
|
||||
name: "Daily",
|
||||
description: "Video Conferencing",
|
||||
imageSrc: "apps/daily.svg",
|
||||
variant: "conferencing",
|
||||
label: "",
|
||||
slug: "",
|
||||
category: "",
|
||||
logo: "",
|
||||
publisher: "",
|
||||
url: "",
|
||||
verified: true,
|
||||
trending: true,
|
||||
rating: 0,
|
||||
reviews: 0,
|
||||
},
|
||||
jitsi_video: {
|
||||
installed: true,
|
||||
type: "jitsi_video",
|
||||
|
|
|
@ -51,10 +51,7 @@ export function hasIntegration(apps: AppMeta, type: string): boolean {
|
|||
app.type === type &&
|
||||
!!app.installed &&
|
||||
/* TODO: find a better way to do this */
|
||||
(type === "daily_video" ||
|
||||
type === "jitsi_video" ||
|
||||
type === "huddle01_video" ||
|
||||
app.credentials.length > 0)
|
||||
(type === "jitsi_video" || type === "huddle01_video" || app.credentials.length > 0)
|
||||
);
|
||||
}
|
||||
export function hasIntegrationInstalled(type: App["type"]): boolean {
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
export const BASE_URL = process.env.BASE_URL || `https://${process.env.VERCEL_URL}`;
|
||||
export const WEBSITE_URL = process.env.NEXT_PUBLIC_APP_URL || "https://cal.com";
|
||||
export const IS_PRODUCTION = process.env.NODE_ENV === "production";
|
||||
export const TRIAL_LIMIT_DAYS = 14;
|
||||
export const HOSTED_CAL_FEATURES = process.env.HOSTED_CAL_FEATURES || BASE_URL === "https://app.cal.com";
|
||||
export const NEXT_PUBLIC_BASE_URL = process.env.NEXT_PUBLIC_BASE_URL || `https://${process.env.VERCEL_URL}`;
|
||||
// TODO: Remove this file once everything is imported from `@calcom/lib`
|
||||
export * from "@calcom/lib/constants";
|
||||
|
|
|
@ -13,7 +13,6 @@ import Huddle01VideoApiAdapter from "@lib/integrations/Huddle01/Huddle01VideoApi
|
|||
import JitsiVideoApiAdapter from "@lib/integrations/Jitsi/JitsiVideoApiAdapter";
|
||||
import logger from "@lib/logger";
|
||||
|
||||
import DailyVideoApiAdapter from "./integrations/Daily/DailyVideoApiAdapter";
|
||||
import TandemVideoApiAdapter from "./integrations/Tandem/TandemVideoApiAdapter";
|
||||
|
||||
const log = logger.getChildLogger({ prefix: ["[lib] videoClient"] });
|
||||
|
@ -32,9 +31,6 @@ const getVideoAdapters = (withCredentials: Credential[]): VideoApiAdapter[] =>
|
|||
}
|
||||
|
||||
switch (cred.type) {
|
||||
case "daily_video":
|
||||
acc.push(DailyVideoApiAdapter(cred));
|
||||
break;
|
||||
case "jitsi_video":
|
||||
acc.push(JitsiVideoApiAdapter());
|
||||
break;
|
||||
|
|
|
@ -507,7 +507,7 @@ function ConnectOrDisconnectIntegrationButton(props: {
|
|||
);
|
||||
}
|
||||
/** We don't need to "Connect", just show that it's installed */
|
||||
if (["daily_video", "huddle01_video", "jitsi_video"].includes(props.type)) {
|
||||
if (["huddle01_video", "jitsi_video"].includes(props.type)) {
|
||||
return (
|
||||
<div className="truncate px-3 py-2">
|
||||
<h3 className="text-sm font-medium text-gray-700">{t("installed")}</h3>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import type { App } from "@calcom/types/App";
|
||||
|
||||
import _metadata from "./package.json";
|
||||
|
||||
export const metadata = {
|
||||
..._metadata,
|
||||
installed: !!process.env.DAILY_API_KEY,
|
||||
type: "daily_video",
|
||||
imageSrc: "apps/daily.svg",
|
||||
variant: "conferencing",
|
||||
url: "https://daily.co/",
|
||||
trending: true,
|
||||
} as Partial<App>;
|
||||
|
||||
export * as lib from "./lib";
|
|
@ -1,13 +1,13 @@
|
|||
import { Credential } from "@prisma/client";
|
||||
|
||||
import { BASE_URL } from "@calcom/lib/constants";
|
||||
import { handleErrorsJson } 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";
|
||||
|
||||
import { BASE_URL } from "@lib/config/constants";
|
||||
import { handleErrorsJson } from "@lib/errors";
|
||||
import prisma from "@lib/prisma";
|
||||
|
||||
/** @link https://docs.daily.co/reference/rest-api/rooms/create-room */
|
||||
export interface DailyReturnType {
|
||||
/** Long UID string ie: 987b5eb5-d116-4a4e-8e2c-14fcb5710966 */
|
||||
id: string;
|
||||
|
@ -19,7 +19,9 @@ export interface DailyReturnType {
|
|||
url: string;
|
||||
created_at: string;
|
||||
config: {
|
||||
/** Timestamps expressed in seconds, not in milliseconds */
|
||||
nbf: number;
|
||||
/** Timestamps expressed in seconds, not in milliseconds */
|
||||
exp: number;
|
||||
enable_chat: boolean;
|
||||
enable_knocking: boolean;
|
|
@ -0,0 +1 @@
|
|||
export { default as VideoApiAdapter } from "./VideoApiAdapter";
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"private": true,
|
||||
"name": "@calcom/dailyvideo",
|
||||
"version": "0.0.0",
|
||||
"main": "./index.ts",
|
||||
"title": "Daily.co Video",
|
||||
"slug": "dailyvideo",
|
||||
"category": "video",
|
||||
"description": "Video Conferencing",
|
||||
"logo": "/apps/daily.svg",
|
||||
"publisher": "Cal.com",
|
||||
"url": "https://daily.co/",
|
||||
"verified": true,
|
||||
"rating": 0,
|
||||
"reviews": 0,
|
||||
"dependencies": {
|
||||
"@calcom/prisma": "*",
|
||||
"@calcom/lib": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@calcom/types": "*"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<svg width="56" height="56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="56" height="56" rx="12" fill="#292929" />
|
||||
<path
|
||||
d="M18.628 36.781c2.846 0 4.946-1.096 6.183-2.59l-2.38-2.03c-.957 1.05-2.147 1.587-3.733 1.587-3.22 0-5.204-2.427-5.204-5.413 0-2.987 1.984-5.46 5.134-5.46 1.47 0 2.683.513 3.663 1.54l2.31-2.007c-1.47-1.75-3.313-2.567-5.973-2.567-5.04 0-8.517 3.803-8.517 8.493 0 4.667 3.663 8.447 8.517 8.447ZM31.69 36.781c2.17 0 3.267-.91 3.92-2.286v1.983h3.057V24.344H35.54v1.914c-.653-1.307-1.75-2.17-3.85-2.17-3.337 0-5.997 2.87-5.997 6.37s2.66 6.323 5.997 6.323Zm-2.847-6.346c0-1.89 1.354-3.5 3.36-3.5 2.077 0 3.407 1.633 3.407 3.523 0 1.89-1.33 3.477-3.407 3.477-2.006 0-3.36-1.657-3.36-3.5ZM41.472 36.478h3.15V19.444h-3.15v17.034Z"
|
||||
fill="#fff" />
|
||||
</svg>
|
After Width: | Height: | Size: 806 B |
|
@ -1,8 +1,10 @@
|
|||
import * as example from "./_example";
|
||||
import * as dailyvideo from "./dailyvideo";
|
||||
import * as zoomvideo from "./zoomvideo";
|
||||
|
||||
const appStore = {
|
||||
example,
|
||||
dailyvideo,
|
||||
zoomvideo,
|
||||
};
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"version": "0.0.0",
|
||||
"main": "./index.ts",
|
||||
"dependencies": {
|
||||
"@calcom/zoomvideo": "*"
|
||||
"@calcom/zoomvideo": "*",
|
||||
"@calcom/dailyvideo": "*"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { stringify } from "querystring";
|
||||
|
||||
import { BASE_URL } from "@calcom/lib/constants";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
const BASE_URL = process.env.BASE_URL || `https://${process.env.VERCEL_URL}`;
|
||||
|
||||
const client_id = process.env.ZOOM_CLIENT_ID;
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
import { BASE_URL } from "@calcom/lib/constants";
|
||||
import prisma from "@calcom/prisma";
|
||||
|
||||
const BASE_URL = process.env.BASE_URL || `https://${process.env.VERCEL_URL}`;
|
||||
|
||||
const client_id = process.env.ZOOM_CLIENT_ID;
|
||||
const client_secret = process.env.ZOOM_CLIENT_SECRET;
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
"rating": 4.3,
|
||||
"reviews": 69,
|
||||
"dependencies": {
|
||||
"@calcom/prisma": "*"
|
||||
"@calcom/prisma": "*",
|
||||
"@calcom/lib": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@calcom/types": "*"
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
export const BASE_URL = process.env.BASE_URL || `https://${process.env.VERCEL_URL}`;
|
||||
export const WEBSITE_URL = process.env.NEXT_PUBLIC_APP_URL || "https://cal.com";
|
||||
export const IS_PRODUCTION = process.env.NODE_ENV === "production";
|
||||
export const TRIAL_LIMIT_DAYS = 14;
|
||||
export const HOSTED_CAL_FEATURES = process.env.HOSTED_CAL_FEATURES || BASE_URL === "https://app.cal.com";
|
||||
export const NEXT_PUBLIC_BASE_URL = process.env.NEXT_PUBLIC_BASE_URL || `https://${process.env.VERCEL_URL}`;
|
Loading…
Reference in New Issue
Block a user