Skip to content

BeechCMS


BeechCMS / @beechcms/core / ISeedRegistry

Interface: ISeedRegistry ​

Methods ​

all() ​

all(): Seed[]

Returns all seeds as a flat array, preserving insertion order. Decouples callers from the internal storage shape so the registry implementation can change without touching every route handler.

Returns ​

Seed[]


draftEnabled() ​

draftEnabled(): Seed[]

Returns seeds that have the draft workflow enabled. Eliminates the seeds.filter(s => s.allowDrafts) pattern.

Returns ​

Seed[]


get() ​

get(slug): Seed | null

Returns the seed with the given slug, or null if not found. Provides a single lookup point that can be overridden in tests without rebuilding the full registry object.

Parameters ​

slug ​

string

Returns ​

Seed | null


publicReadable() ​

publicReadable(): Seed[]

Returns seeds that have allowPublicRead enabled. Eliminates the seeds.filter(s => s.allowPublicRead) pattern.

Returns ​

Seed[]


visibleInDashboard() ​

visibleInDashboard(): Seed[]

Returns seeds that are visible in the dashboard sidebar. A seed is visible when dashboard.hidden is not explicitly true. Eliminates the seeds.filter(s => !s.dashboard?.hidden) pattern that would otherwise be duplicated across route handlers.

Returns ​

Seed[]