chore: recategorize apps (#9306)

* Remove unused code in InstalledAppsLayout

* Add new app categories "crm", "conferencing" and "messaging"

* Sort getAppCategories entries alphabetically

* Fix 404s on new category pages (and remove hardcoded category lists)

* Fix admin apps list not showing "no available apps" for new categories

* Recategorise apps

* Sync seed-app-store categories with config files

* Replace unnecessary seed-app-store.config.json with appStoreMetadata

* Copy video.svg to conferencing.svg

* Add messaging.svg

* Remove web3 from getAppCategories (used by installed apps, admin apps)

* Fix app-store-cli categories

- Add conferencing
- Add CRM
- Remove video
- Remove web3

* Remove outdated web3 comment in seed-app-store

* Update apps/web/public/static/locales/en/common.json

* Add cron script to keep db apps in sync with app metadata

* Add redirect for app category "video" to "conferencing"

* Fix up "video" category overrides to apply to conferencing

* Fix conferencing apps not showing as a location for non-team users

* Restore "installed_app" string for conferencing apps

* Make linter happier

* Remove my "installed_app_conferencing_description" as this was fixed upstream

* Quick tidy up

* Add dry-run to syncAppMeta via  CRON_ENABLE_APP_SYNC env

* Replace console.log with logger in syncAppMeta

---------

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: alannnc <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Omar López <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-06-28 18:22:51 +02:00
1 parent 8cfb9902ff
commit 171827f547
57 files changed
+304 -373

No files matched your search

@@ -82,14 +82,17 @@ export const AppForm = ({
label: "Category of App",
name: "category",
type: "select",
// TODO: Refactor and reuse getAppCategories or type as Record<AppCategories,> to enforce consistency
options: [
{ label: "Calendar", value: "calendar" },
{ label: "Video", value: "video" },
{ label: "Payment", value: "payment" },
{ label: "Messaging", value: "messaging" },
{ label: "Web3", value: "web3" },
{ label: "Automation", value: "automation" },
// Manually sorted alphabetically
{ label: "Analytics", value: "analytics" },
{ label: "Automation", value: "automation" },
{ label: "Calendar", value: "calendar" },
{ label: "Conferencing", value: "conferencing" },
{ label: "CRM", value: "crm" },
{ label: "Messaging", value: "messaging" },
{ label: "Payment", value: "payment" },
{ label: "Other", value: "other" },
],
defaultValue: "",
+41 -17
View File
@@ -1,5 +1,16 @@
import { WEBAPP_URL } from "@calcom/lib/constants";
import { Calendar, Video, CreditCard, Share2, BarChart, Grid } from "@calcom/ui/components/icon";
import type { AppCategories } from "@calcom/prisma/enums";
import type { LucideIcon } from "@calcom/ui/components/icon";
import {
Calendar,
Video,
CreditCard,
Share2,
BarChart,
Grid,
Mail,
Contact,
} from "@calcom/ui/components/icon";
function getHref(baseURL: string, category: string, useQueryParam: boolean) {
const baseUrlParsed = new URL(baseURL, WEBAPP_URL);
@@ -7,8 +18,26 @@ function getHref(baseURL: string, category: string, useQueryParam: boolean) {
return useQueryParam ? `${baseUrlParsed.toString()}` : `${baseURL}/${category}`;
}
const getAppCategories = (baseURL: string, useQueryParam: boolean) => {
type AppCategoryEntry = {
name: AppCategories;
href: string;
icon: LucideIcon;
};
const getAppCategories = (baseURL: string, useQueryParam: boolean): AppCategoryEntry[] => {
// Manually sorted alphabetically, but leaving "Other" at the end
// TODO: Refactor and type with Record<AppCategories, AppCategoryEntry> to enforce consistency
return [
{
name: "analytics",
href: getHref(baseURL, "analytics", useQueryParam),
icon: BarChart,
},
{
name: "automation",
href: getHref(baseURL, "automation", useQueryParam),
icon: Share2,
},
{
name: "calendar",
href: getHref(baseURL, "calendar", useQueryParam),
@@ -19,26 +48,21 @@ const getAppCategories = (baseURL: string, useQueryParam: boolean) => {
href: getHref(baseURL, "conferencing", useQueryParam),
icon: Video,
},
{
name: "crm",
href: getHref(baseURL, "crm", useQueryParam),
icon: Contact,
},
{
name: "messaging",
href: getHref(baseURL, "messaging", useQueryParam),
icon: Mail,
},
{
name: "payment",
href: getHref(baseURL, "payment", useQueryParam),
icon: CreditCard,
},
{
name: "automation",
href: getHref(baseURL, "automation", useQueryParam),
icon: Share2,
},
{
name: "analytics",
href: getHref(baseURL, "analytics", useQueryParam),
icon: BarChart,
},
{
name: "web3",
href: getHref(baseURL, "web3", useQueryParam),
icon: BarChart,
},
{
name: "other",
href: getHref(baseURL, "other", useQueryParam),
@@ -1,8 +1,8 @@
import z from "zod";
import { InstalledAppVariants } from "../utils";
import { AppCategories } from "@calcom/prisma/enums";
const variantSchema = z.enum(InstalledAppVariants);
const variantSchema = z.nativeEnum(AppCategories);
export default function getInstalledAppPath(
{ variant, slug }: { variant?: string; slug?: string },
+1 -1
View File
@@ -7,7 +7,7 @@
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Cal.com",
"email": "[email protected]",
"description": "Discover radically unique video calls designed to help hybrid-remote teams create, collaborate and celebrate together.",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Feel connected with your remote team. Team events, new hire onboardings, coffee chats, all on Campfire. No more awkward Zoom calls.\r\r",
+1 -1
View File
@@ -7,7 +7,7 @@
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "other",
"categories": ["other"],
"categories": ["crm"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Close is the inside sales CRM of choice for startups and SMBs. Make more calls, send more emails and close more deals starting today.",
+2 -2
View File
@@ -9,10 +9,10 @@ export const metadata = {
type: "daily_video",
variant: "conferencing",
url: "https://daily.co",
categories: ["video"],
categories: ["conferencing"],
logo: "icon.svg",
publisher: "Cal.com",
category: "video",
category: "conferencing",
slug: "daily-video",
title: "Cal Video",
isGlobal: true,
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.svg",
"url": "https://discord.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"appData": {
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.svg",
"url": "https://github.com/shivamklr",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Shivam Kalra",
"email": "[email protected]",
"appData": {
+1 -1
View File
@@ -7,7 +7,7 @@
"logo": "icon.svg",
"url": "https://github.com/Mythie",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Lucas Smith",
"email": "[email protected]",
"description": "Facetime makes it super simple for collaborating teams to jump on a video call.",
+2 -2
View File
@@ -8,8 +8,8 @@ export const metadata = {
description: _package.description,
installed: !!(process.env.GOOGLE_API_CREDENTIALS && validJson(process.env.GOOGLE_API_CREDENTIALS)),
slug: "google-meet",
category: "video",
categories: ["video"],
category: "conferencing",
categories: ["conferencing"],
type: "google_video",
title: "Google Meet",
variant: "conferencing",
+1 -1
View File
@@ -11,7 +11,7 @@ export const metadata = {
logo: "icon.svg",
publisher: "Cal.com",
url: "https://hubspot.com/",
categories: ["other"],
categories: ["crm"],
label: "HubSpot CRM",
slug: "hubspot",
title: "HubSpot CRM",
@@ -9,11 +9,11 @@ export const metadata = {
installed: true,
type: "huddle01_video",
variant: "conferencing",
categories: ["video", "web3"],
categories: ["conferencing"],
logo: "icon.svg",
publisher: "huddle01.com",
url: "https://huddle01.com",
category: "web3",
category: "conferencing",
slug: "huddle01",
title: "Huddle01",
isGlobal: false,
+1 -1
View File
@@ -8,7 +8,7 @@ export const metadata = {
installed: true,
type: "jitsi_video",
variant: "conferencing",
categories: ["video"],
categories: ["conferencing"],
logo: "icon.svg",
publisher: "Cal.com",
url: "https://jitsi.org/",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"appData": {
@@ -9,8 +9,7 @@
"verified": true,
"rating": 4.3,
"reviews": 69,
"category": "video",
"categories": ["video"],
"categories": ["conferencing"],
"slug": "msteams",
"title": "MS Teams (Requires work/school account)",
"trending": true,
+1 -1
View File
@@ -7,7 +7,7 @@
"logo": "icon.svg",
"url": "https://ping.gg",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Ping.gg",
"email": "[email protected]",
"description": "Ping.gg makes high quality video collaborations easier than ever. Think 'Zoom for streamers and creators'. Join a call in 3 clicks, manage audio and video like a pro, and copy-paste your guests straight into OBS",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.svg",
"url": "https://github.com/eluce2",
"variant": "other",
"categories": ["other"],
"categories": ["automation"],
"publisher": "Eric Luce",
"email": "[email protected]",
"description": "Quickly share your Cal.com meeting links with Raycast",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon-dark.svg",
"url": "https://cal.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Your online recording studio. The easiest way to record podcasts and videos in studio quality from anywhere. All from the browser.",
+1 -1
View File
@@ -7,7 +7,7 @@
"logo": "icon-dark.svg",
"url": "https://cal.com/resources/feature/routing-forms",
"variant": "other",
"categories": ["other"],
"categories": ["automation"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"licenseRequired": true,
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.png",
"url": "https://cal.com/",
"variant": "other_calendar",
"categories": ["other"],
"categories": ["crm"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Salesforce (Sales Cloud) is a cloud-based application designed to help your salespeople sell smarter and faster by centralizing customer information, logging their interactions with your company, and automating many of the tasks salespeople do every day.",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "logo.png",
"url": "https://cal.com/",
"variant": "other_calendar",
"categories": ["other"],
"categories": ["crm"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "SendGrid delivers your transactional and marketing emails through the world's largest cloud-based email delivery platform.",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["messaging"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Schedule a chat with your guests or have a Signal Video call.",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon-dark.svg",
"url": "https://cal.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Video meetings made for music.\rCreate your own virtual music classroom, easily.",
+1 -1
View File
@@ -7,7 +7,7 @@
"logo": "icon.svg",
"url": "https://sylaps.com",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Sylaps Inc",
"email": "[email protected]",
"description": "Free Audio and Video Conferencing, Online Collaboration, Screen Sharing on web browser, mobile and desktop.",
+2 -2
View File
@@ -8,9 +8,9 @@ export const metadata = {
type: "tandem_video",
title: "Tandem Video",
variant: "conferencing",
categories: ["video"],
categories: ["conferencing"],
slug: "tandem",
category: "video",
category: "conferencing",
logo: "icon.svg",
publisher: "",
url: "",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["messaging"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Schedule a chat with your guests or have a Telegram Video call.",
@@ -6,7 +6,7 @@
"logo": "icon.svg",
"url": "https://example.com/link",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Cal.com Inc",
"email": "[email protected]",
"appData": {
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon-dark.svg",
"url": "https://cal.com/",
"variant": "other",
"categories": ["other"],
"categories": ["automation"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Adds a link to copy Typeform Redirect URL",
+8 -12
View File
@@ -6,6 +6,7 @@ import type { TFunction } from "next-i18next";
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
import type { EventLocationType } from "@calcom/app-store/locations";
import { defaultLocations } from "@calcom/app-store/locations";
import { AppCategories } from "@calcom/prisma/enums";
import type { App, AppMeta } from "@calcom/types/App";
export * from "./_utils/getEventTypeAppData";
@@ -37,16 +38,6 @@ const credentialData = Prisma.validator<Prisma.CredentialArgs>()({
export type CredentialData = Prisma.CredentialGetPayload<typeof credentialData>;
export const InstalledAppVariants = [
"conferencing",
"calendar",
"payment",
"analytics",
"automation",
"other",
"web3",
] as const;
export const ALL_APPS = Object.values(ALL_APPS_MAP);
export function getLocationGroupedOptions(integrations: ReturnType<typeof getApps>, t: TFunction) {
@@ -58,8 +49,13 @@ export function getLocationGroupedOptions(integrations: ReturnType<typeof getApp
if (app.locationOption) {
// All apps that are labeled as a locationOption are video apps. Extract the secondary category if available
let category =
app.categories.length >= 2 ? app.categories.find((category) => category !== "video") : app.category;
if (!category) category = "video";
app.categories.length >= 2
? app.categories.find(
(category) =>
!([AppCategories.video, AppCategories.conferencing] as string[]).includes(category)
)
: app.category;
if (!category) category = AppCategories.conferencing;
const option = { ...app.locationOption, icon: app.logo, slug: app.slug };
if (apps[category]) {
apps[category] = [...apps[category], option];
+2 -2
View File
@@ -6,8 +6,8 @@ export const metadata = {
name: "Vital",
description: _package.description,
installed: true,
category: "other",
categories: ["other"],
category: "automation",
categories: ["automation"],
logo: "icon.svg",
label: "Vital",
publisher: "Vital",
+1 -1
View File
@@ -8,7 +8,7 @@
"logo": "/icon.ico",
"url": "https://github.com/aar2dee2",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "aar2dee2",
"email": "[email protected]",
"description": "Create meetings with Cisco Webex",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["messaging"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Schedule a chat with your guests or have a WhatsApp Video call.",
+1 -1
View File
@@ -7,7 +7,7 @@
"logo": "icon-dark.svg",
"url": "https://cal.com/",
"variant": "conferencing",
"categories": ["video"],
"categories": ["conferencing"],
"publisher": "Cal.com, Inc.",
"email": "[email protected]",
"description": "Whereby makes it super simple for collaborating teams to jump on a video call.",
@@ -6,8 +6,8 @@ export const metadata = {
name: _package.name,
description: _package.description,
installed: true,
category: "other",
categories: ["other"],
category: "automation",
categories: ["automation"],
// If using static next public folder, can then be referenced from the base URL (/).
logo: "icon-dark.svg",
publisher: "Cal.com",
+1 -1
View File
@@ -6,7 +6,7 @@
"logo": "icon.png",
"url": "https://github.com/jatinsandilya",
"variant": "other",
"categories": ["other"],
"categories": ["crm"],
"publisher": "Jatin Sandilya",
"email": "[email protected]",
"description": "Zoho CRM is a cloud-based application designed to help your salespeople sell smarter and faster by centralizing customer information, logging their interactions with your company, and automating many of the tasks salespeople do every day",
+2 -2
View File
@@ -7,12 +7,12 @@ export const metadata = {
name: "Zoom Video",
description: _package.description,
type: "zoom_video",
categories: ["video"],
categories: ["conferencing"],
variant: "conferencing",
logo: "icon.svg",
publisher: "Cal.com",
url: "https://zoom.us/",
category: "video",
category: "conferencing",
slug: "zoom",
title: "Zoom Video",
email: "[email protected]",
+1 -1
View File
@@ -292,7 +292,7 @@ const AdminAppsListContainer = () => {
if (isLoading) return <SkeletonLoader />;
if (!apps) {
if (!apps || apps.length === 0) {
return (
<EmptyScreen
Icon={AlertCircle}
@@ -0,0 +1,10 @@
-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.
ALTER TYPE "AppCategories" ADD VALUE 'conferencing';
ALTER TYPE "AppCategories" ADD VALUE 'crm';
+4 -2
View File
@@ -614,10 +614,12 @@ enum AppCategories {
messaging
other
payment
video
web3
video // deprecated, please use 'conferencing' instead
web3 // deprecated, we should no longer have any web3 apps
automation
analytics
conferencing
crm
}
model App {
-244
View File
@@ -1,244 +0,0 @@
[
{
"/*": "This file is deprecated now. No new entry should be added to it.",
"dirName": "routing-forms",
"categories": ["other"],
"slug": "routing-forms",
"type": "routing-forms_other"
},
{
"dirName": "whereby",
"categories": ["video"],
"slug": "whereby",
"type": "whereby_video"
},
{
"dirName": "around",
"categories": ["video"],
"slug": "around",
"type": "around_video"
},
{
"dirName": "riverside",
"categories": ["video"],
"slug": "riverside",
"type": "riverside_video"
},
{
"dirName": "typeform",
"categories": ["other"],
"slug": "typeform",
"type": "typeform_other"
},
{
"dirName": "ping",
"categories": ["video"],
"slug": "ping",
"type": "ping_video"
},
{
"dirName": "campfire",
"categories": ["video"],
"slug": "campfire",
"type": "campfire_video"
},
{
"dirName": "raycast",
"categories": ["other"],
"slug": "raycast",
"type": "raycast_other"
},
{
"dirName": "n8n",
"categories": ["automation"],
"slug": "n8n",
"type": "n8n_automation"
},
{
"dirName": "exchangecalendar",
"categories": ["calendar"],
"slug": "exchange",
"type": "exchange_calendar"
},
{
"dirName": "qr_code",
"categories": ["other"],
"slug": "qr_code",
"type": "qr_code_other"
},
{
"dirName": "weather_in_your_calendar",
"categories": ["other"],
"slug": "weather_in_your_calendar",
"type": "weather_in_your_calendar_other"
},
{
"dirName": "fathom",
"categories": ["analytics"],
"slug": "fathom",
"type": "fathom_analytics"
},
{
"dirName": "plausible",
"categories": ["analytics"],
"slug": "plausible",
"type": "plausible_analytics"
},
{
"dirName": "wordpress",
"categories": ["other"],
"slug": "wordpress",
"type": "wordpress_other"
},
{
"dirName": "ga4",
"categories": ["analytics"],
"slug": "ga4",
"type": "ga4_analytics"
},
{
"dirName": "pipedream",
"categories": ["automation"],
"slug": "pipedream",
"type": "pipedream_automation"
},
{
"dirName": "sirius_video",
"categories": ["video"],
"slug": "sirius_video",
"type": "sirius_video_video"
},
{
"dirName": "sendgrid",
"categories": ["other"],
"slug": "sendgrid",
"type": "sendgrid_other_calendar"
},
{
"dirName": "closecom",
"categories": ["other"],
"slug": "closecom",
"type": "closecom_other_calendar"
},
{
"dirName": "whatsapp",
"categories": ["video"],
"slug": "whatsapp",
"type": "whatsapp_video"
},
{
"dirName": "telegram",
"categories": ["video"],
"slug": "telegram",
"type": "telegram_video"
},
{
"dirName": "signal",
"categories": ["video"],
"slug": "signal",
"type": "signal_video"
},
{
"dirName": "vimcal",
"categories": ["calendar"],
"slug": "vimcal",
"type": "vimcal_other"
},
{
"dirName": "amie",
"categories": ["calendar"],
"slug": "amie",
"type": "amie_other"
},
{
"dirName": "booking-pages-tag",
"categories": ["analytics"],
"slug": "booking-pages-tag",
"type": "booking-pages-tag_other",
"isTemplate": true
},
{
"dirName": "event-type-app-card",
"categories": ["other"],
"slug": "event-type-app-card",
"type": "event-type-app-card_other",
"isTemplate": true
},
{
"dirName": "event-type-location-video-static",
"categories": ["video"],
"slug": "event-type-location-video-static",
"type": "event-type-location-video-static_other",
"isTemplate": true
},
{
"dirName": "general-app-settings",
"categories": ["other"],
"slug": "general-app-settings",
"type": "general-app-settings_other",
"isTemplate": true
},
{
"dirName": "link-as-an-app",
"categories": ["other"],
"slug": "link-as-an-app",
"type": "link-as-an-app_other",
"isTemplate": true
},
{
"dirName": "basic",
"categories": ["other"],
"slug": "basic",
"type": "basic_other",
"isTemplate": true
},
{
"dirName": "facetime",
"categories": ["video"],
"slug": "facetime",
"type": "facetime_video",
"isTemplate": false
},
{
"dirName": "zohocrm",
"categories": ["other"],
"slug": "zohocrm",
"type": "zohocrm_other_calendar",
"isTemplate": false
},
{
"dirName": "webex",
"categories": ["video"],
"slug": "webex",
"type": "webex_video",
"isTemplate": false
},
{
"dirName": "cron",
"categories": ["calendar"],
"slug": "cron",
"type": "cron_other",
"isTemplate": false
},
{
"dirName": "gtm",
"categories": ["analytics"],
"slug": "gtm",
"type": "gtm_analytics",
"isTemplate": false
},
{
"dirName": "discord",
"categories": ["video"],
"slug": "discord",
"type": "discord_video",
"isTemplate": false
},
{
"dirName": "sylapsvideo",
"categories": ["video"],
"slug": "sylapsvideo",
"type": "sylaps_video",
"isTemplate": false
}
]
+27 -26
View File
@@ -4,10 +4,11 @@
*/
import type { Prisma } from "@prisma/client";
import dotEnv from "dotenv";
import fs from "fs";
import path from "path";
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
import prisma from ".";
import { AppCategories } from "./enums";
dotEnv.config({ path: "../../.env.appStore" });
@@ -235,7 +236,7 @@ export default async function main() {
client_secret,
redirect_uris,
});
await createApp("google-meet", "googlevideo", ["video"], "google_video", {
await createApp("google-meet", "googlevideo", ["conferencing"], "google_video", {
client_id,
client_secret,
redirect_uris,
@@ -248,7 +249,7 @@ export default async function main() {
client_id: process.env.MS_GRAPH_CLIENT_ID,
client_secret: process.env.MS_GRAPH_CLIENT_SECRET,
});
await createApp("msteams", "office365video", ["video"], "office365_video", {
await createApp("msteams", "office365video", ["conferencing"], "office365_video", {
client_id: process.env.MS_GRAPH_CLIENT_ID,
client_secret: process.env.MS_GRAPH_CLIENT_SECRET,
});
@@ -266,45 +267,45 @@ export default async function main() {
}
// Video apps
if (process.env.DAILY_API_KEY) {
await createApp("daily-video", "dailyvideo", ["video"], "daily_video", {
await createApp("daily-video", "dailyvideo", ["conferencing"], "daily_video", {
api_key: process.env.DAILY_API_KEY,
scale_plan: process.env.DAILY_SCALE_PLAN,
});
}
if (process.env.TANDEM_CLIENT_ID && process.env.TANDEM_CLIENT_SECRET) {
await createApp("tandem", "tandemvideo", ["video"], "tandem_video", {
await createApp("tandem", "tandemvideo", ["conferencing"], "tandem_video", {
client_id: process.env.TANDEM_CLIENT_ID as string,
client_secret: process.env.TANDEM_CLIENT_SECRET as string,
base_url: (process.env.TANDEM_BASE_URL as string) || "https://tandem.chat",
});
}
if (process.env.ZOOM_CLIENT_ID && process.env.ZOOM_CLIENT_SECRET) {
await createApp("zoom", "zoomvideo", ["video"], "zoom_video", {
await createApp("zoom", "zoomvideo", ["conferencing"], "zoom_video", {
client_id: process.env.ZOOM_CLIENT_ID,
client_secret: process.env.ZOOM_CLIENT_SECRET,
});
}
await createApp("jitsi", "jitsivideo", ["video"], "jitsi_video");
await createApp("jitsi", "jitsivideo", ["conferencing"], "jitsi_video");
// Other apps
if (process.env.HUBSPOT_CLIENT_ID && process.env.HUBSPOT_CLIENT_SECRET) {
await createApp("hubspot", "hubspot", ["other"], "hubspot_other_calendar", {
await createApp("hubspot", "hubspot", ["crm"], "hubspot_other_calendar", {
client_id: process.env.HUBSPOT_CLIENT_ID,
client_secret: process.env.HUBSPOT_CLIENT_SECRET,
});
}
if (process.env.SALESFORCE_CONSUMER_KEY && process.env.SALESFORCE_CONSUMER_SECRET) {
await createApp("salesforce", "salesforce", ["other"], "salesforce_other_calendar", {
await createApp("salesforce", "salesforce", ["crm"], "salesforce_other_calendar", {
consumer_key: process.env.SALESFORCE_CONSUMER_KEY,
consumer_secret: process.env.SALESFORCE_CONSUMER_SECRET,
});
}
if (process.env.ZOHOCRM_CLIENT_ID && process.env.ZOHOCRM_CLIENT_SECRET) {
await createApp("zohocrm", "zohocrm", ["other"], "zohocrm_other_calendar", {
await createApp("zohocrm", "zohocrm", ["crm"], "zohocrm_other_calendar", {
client_id: process.env.ZOHOCRM_CLIENT_ID,
client_secret: process.env.ZOHOCRM_CLIENT_SECRET,
});
}
await createApp("wipe-my-cal", "wipemycalother", ["other"], "wipemycal_other");
await createApp("wipe-my-cal", "wipemycalother", ["automation"], "wipemycal_other");
if (process.env.GIPHY_API_KEY) {
await createApp("giphy", "giphy", ["other"], "giphy_other", {
api_key: process.env.GIPHY_API_KEY,
@@ -312,7 +313,7 @@ export default async function main() {
}
if (process.env.VITAL_API_KEY && process.env.VITAL_WEBHOOK_SECRET) {
await createApp("vital-automation", "vital", ["other"], "vital_other", {
await createApp("vital-automation", "vital", ["automation"], "vital_other", {
mode: process.env.VITAL_DEVELOPMENT_MODE || "sandbox",
region: process.env.VITAL_REGION || "us",
api_key: process.env.VITAL_API_KEY,
@@ -326,8 +327,7 @@ export default async function main() {
});
}
// Web3 apps
await createApp("huddle01", "huddle01video", ["web3", "video"], "huddle01_video");
await createApp("huddle01", "huddle01video", ["conferencing"], "huddle01_video");
// Payment apps
if (
@@ -348,21 +348,22 @@ export default async function main() {
});
}
const generatedApps = JSON.parse(
fs.readFileSync(path.join(__dirname, "seed-app-store.config.json"), "utf8")
);
for (let i = 0; i < generatedApps.length; i++) {
const generatedApp = generatedApps[i];
if (generatedApp.isTemplate && process.argv[2] !== "seed-templates") {
for (const [, app] of Object.entries(appStoreMetadata)) {
if (app.isTemplate && process.argv[2] !== "seed-templates") {
continue;
}
const validatedCategories = app.categories.filter(
(category): category is AppCategories => category in AppCategories
);
await createApp(
generatedApp.slug,
generatedApp.dirName,
generatedApp.categories,
generatedApp.type,
app.slug,
app.dirName ?? app.slug,
validatedCategories,
app.type,
undefined,
generatedApp.isTemplate
app.isTemplate
);
}
@@ -17,7 +17,7 @@ type ListLocalOptions = {
export const listLocalHandler = async ({ ctx, input }: ListLocalOptions) => {
const { prisma } = ctx;
const category = input.category === "conferencing" ? "video" : input.category;
const category = input.category;
const localApps = getLocalAppMetadata();
const dbApps = await prisma.app.findMany({
@@ -3,7 +3,7 @@ import type { PrismaClient } from "@prisma/client";
import { getLocalAppMetadata } from "@calcom/app-store/utils";
import { sendDisabledAppEmail } from "@calcom/emails";
import { getTranslation } from "@calcom/lib/server";
import type { AppCategories } from "@calcom/prisma/enums";
import { AppCategories } from "@calcom/prisma/enums";
import { TRPCError } from "@trpc/server";
@@ -53,7 +53,13 @@ export const toggleHandler = async ({ input, ctx }: ToggleOptions) => {
// If disabling an app then we need to alert users basesd on the app type
if (!enabled) {
const translations = new Map();
if (app.categories.some((category) => ["calendar", "video"].includes(category))) {
if (
app.categories.some((category) =>
(
[AppCategories.calendar, AppCategories.video, AppCategories.conferencing] as AppCategories[]
).includes(category)
)
) {
// Find all users with the app credentials
const appCredentials = await prisma.credential.findMany({
where: {
+1
View File
@@ -21,6 +21,7 @@ declare namespace NodeJS {
readonly EMAIL_SERVER_USER: string | undefined;
readonly EMAIL_SERVER_PASSWORD: string | undefined;
readonly CRON_API_KEY: string | undefined;
readonly CRON_ENABLE_APP_SYNC: string | undefined;
readonly NEXT_PUBLIC_STRIPE_PUBLIC_KEY: string | undefined;
readonly STRIPE_PRIVATE_KEY: string | undefined;
readonly STRIPE_CLIENT_ID: string | undefined;