calcom/packages/app-store/_appRegistry.ts
Omar López ba73960a02
App store metadata refactor (#2495)
* Delete api

* Fixes circular dependencies

* Revert "Delete api"

This reverts commit 174177a8331fc376b2dc7abda2c7adc56b24dd60.

* Delete _metadata.ts

* Update metadata.ts
2022-04-14 20:04:21 -06:00

15 lines
515 B
TypeScript

import { App } from "@calcom/types/App";
import appStoreMetadata from "./metadata";
/** Mainly to use in listings for the frontend, use in getStaticProps or getServerSideProps */
export function getAppRegistry() {
return Object.values(appStoreMetadata).reduce((apps, app) => {
// Skip if app isn't installed
if (!app.installed) return apps;
// Let's not leak api keys to the front end
const { key, ...metadata } = app;
apps.push(metadata);
return apps;
}, [] as Omit<App, "key">[]);
}