* getBulkEventTypes * 2 eventtypes related utils to features * locationsResolver * checkForEmptyAssignment * mv defaultEvents to features * update imports * PrismaAppRepository * mv currencyConversions from appstore to lib * useAppsData * videoClient * analytics files * fix * mv * prettier * use named import
27 lines
678 B
TypeScript
27 lines
678 B
TypeScript
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
|
|
import { prisma } from "@calcom/prisma";
|
|
|
|
export class PrismaAppRepository {
|
|
static async seedApp(dirName: string, keys?: any) {
|
|
const appMetadata = appStoreMetadata[dirName as keyof typeof appStoreMetadata];
|
|
|
|
if (!appMetadata) {
|
|
throw new Error(`App ${dirName} not found`);
|
|
}
|
|
|
|
await prisma.app.create({
|
|
data: {
|
|
slug: appMetadata.slug,
|
|
categories: appMetadata.categories,
|
|
dirName: dirName,
|
|
keys,
|
|
enabled: true,
|
|
},
|
|
});
|
|
}
|
|
|
|
static async findAppStore() {
|
|
return await prisma.app.findMany({ select: { slug: true } });
|
|
}
|
|
}
|