2023-02-16 22:39:57 +00:00
|
|
|
import type { AppMeta } from "@calcom/types/App";
|
2023-01-18 22:30:25 +00:00
|
|
|
|
|
|
|
import { appStoreMetadata as rawAppStoreMetadata } from "./apps.metadata.generated";
|
2023-04-26 11:03:34 +00:00
|
|
|
import { getAppAssetFullPath } from "./getAppAssetFullPath";
|
2023-01-18 22:30:25 +00:00
|
|
|
|
|
|
|
type RawAppStoreMetaData = typeof rawAppStoreMetadata;
|
|
|
|
type AppStoreMetaData = {
|
|
|
|
[key in keyof RawAppStoreMetaData]: AppMeta;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const appStoreMetadata = {} as AppStoreMetaData;
|
|
|
|
for (const [key, value] of Object.entries(rawAppStoreMetadata)) {
|
2023-04-26 11:03:34 +00:00
|
|
|
const dirName = "dirName" in value ? value.dirName : value.slug;
|
|
|
|
if (!dirName) {
|
|
|
|
throw new Error(`Couldn't derive dirName for app ${key}`);
|
|
|
|
}
|
|
|
|
const metadata = (appStoreMetadata[key as keyof typeof appStoreMetadata] = {
|
2023-01-18 22:30:25 +00:00
|
|
|
appData: null,
|
2023-04-26 11:03:34 +00:00
|
|
|
dirName,
|
2023-01-18 22:30:25 +00:00
|
|
|
__template: "",
|
|
|
|
...value,
|
2023-04-26 11:03:34 +00:00
|
|
|
} as AppStoreMetaData[keyof AppStoreMetaData]);
|
|
|
|
metadata.logo = getAppAssetFullPath(metadata.logo, {
|
|
|
|
dirName,
|
|
|
|
isTemplate: metadata.isTemplate,
|
|
|
|
});
|
2023-01-18 22:30:25 +00:00
|
|
|
}
|