Skip to content

AppDefinition

Describes one App in the composed Definition: its structure, the Apps it imports and its executable behavior.

Every map is keyed by the member’s key, except metrics[*].events, which is keyed by Event PRN. The Builder freezes each map, so treat the definition as immutable. Handlers, hooks and Listeners are functions and are dropped by JSON serialization.

readonly dependencies: Record<string, AppDefinition>

Apps this App imported, keyed by the local dependency key used in the import.


readonly description: string | undefined

Description set with setDescription, or undefined.


readonly events: Record<string, EventDefinition>

App-level Events, keyed by Event key; their PRNs take the form prn::<app>:app/event/<key>.


readonly hooks: AppHookDefinition

Workspace create and seed hooks registered by this App.


readonly isRoot: boolean

Whether this App is the root of the composed Definition.


readonly key: string

Canonical key of the App, unique across the composed Definition.


readonly metricDimensions: Record<string, MetricDimensionDefinition>

Metric Dimensions declared by this App, keyed by Dimension key.


readonly metrics: Record<string, MetricDefinition>

Metrics declared by this App, keyed by Metric key.


readonly mutations: Record<string, MutationDefinition>

Mutations declared by this App, keyed by Mutation key.


readonly prn: string

PRN of the App, prn::<key>.


readonly queries: Record<string, QueryDefinition>

Queries declared by this App, keyed by Query key.


readonly roles: Record<string, AppRoleDefinition>

App Roles declared by this App, keyed by Role key.


readonly searches: Record<string, SearchIndexDefinition>

Search indexes declared by this App, keyed by search key.


readonly templates: Record<string, TemplateDefinition>

Templates keyed by Template key; on the root App this also holds the Workspace Template under workspace.


readonly unions: Record<string, UnionDefinition>

Unions keyed by union key; each search index also registers a Union with the same key.


readonly optional workspaceTemplate?: TemplateDefinition

The Workspace Template shared by every App in the build; omitted from the JSON the compiler emits.