// The registry of content types this CMS serves. Adding a type = declaring it // in a `*.contentType.ts` file and adding it here (+ its entities in // database/schema.ts). The handlers look a type up by name through // `contentTypeByName`; the editor lists them via the content.types action. import type { ContentType } from '@voltro/cms' import { blogPost } from './blogPost.contentType' import { page } from './page.contentType' export { blogPost, page } export const contentTypes: ReadonlyArray = [blogPost, page] /** Look a content type up by name — the guard the dynamic handlers run before * touching a `_drafts` / `_published` table (an unknown name never * reaches a table string). */ export const contentTypeByName: ReadonlyMap = new Map( contentTypes.map((t) => [t.name, t]), )