---
title: "Shared shapes"
description: "Generated from the doc schema (CatalogDocSchema, @canonify/kernel-catalog/doc): each field’s type, default and description are the schema’s own, and each example is a bundle file that readBundle…"
order: 13
id: "model/shapes"
---

# Shared shapes

Generated from the doc schema (`CatalogDocSchema`, @canonify/kernel-catalog/doc): each field’s type, default and description are the schema’s own, and each example is a bundle file that readBundle decodes. A field’s Example is its value in one of those examples.

## Text {#text}

Tenant text: one string per locale; the org default locale is required at compile.

In a bundle file, a Text that holds only the org default locale may be written as a plain string.

| Field | Type | Required | Default | Example | Description |
|---|---|---|---|---|---|
| `en` | string | no | — | `"Customer"` | The English text. |
| `da` | string | no | — | `"Besøg"` | The Danish text. |

Any `label` (here a type’s): one string per locale. A bundle file may write a Text in the org default locale as a plain string.

```json
{ "en": "Customer", "da": "Kunde" }
```

## Expr {#expr}

A CX expression: its source and, once the service bound it, its bound tree.

In a bundle file, an expression may be written as its `src` string.

| Field | Type | Required | Default | Example | Description |
|---|---|---|---|---|---|
| `src` | string | yes | — | `"name"` | The CX source text, as authored (cx.md §2.1). |
| `bound` | [BoundAst](shapes.md#boundast) | no (the catalog service records it) | — | — | The bound tree of src (cx.md §2.2), filled by the catalog service at propose: every catalog element by id. |

Any CX expression field (here a derived property’s `expr`). A bundle file may write it as its `src` string.

```json
{ "src": "quantity * unit_price" }
```

## BoundAst {#boundast}

The bound tree of src (cx.md §2.2), filled by the catalog service at propose: every catalog element by id.

Type: JSON.

## MsgRef {#msgref}

A message: text with placeholders, each a CX expression.

| Field | Type | Required | Default | Example | Description |
|---|---|---|---|---|---|
| `text` | [Text](shapes.md#text) | yes | — | `"A booking cannot end before it starts."` | The message template per locale (messages ICU subset), with {name} placeholders. |
| `params` | Record<[Ident](shapes.md#ident), [Expr](shapes.md#expr)> | no | — | `{"room":"room","starts":"starts"}` | The CX expression of each placeholder, by name; present writes its value in the reader’s convention. |

Any message (here a check invariant’s `message`). Its `text` is a Text, so a plain string in the default locale.

```json
{
  "text": "The total must be at least {min}.",
  "params": { "min": "minimum_total" }
}
```

## PropRef {#propref}

A property of a type.

| Field | Type | Required | Default | Example | Description |
|---|---|---|---|---|---|
| `type` | [TypeId](shapes.md#typeid) | yes | — | `"ty_3f8v6h2n0c"` | The type the property is on. |
| `prop` | [PropId](shapes.md#propid) | yes | — | `"pr_4p6r8t0v2x"` | The property. |

Any property reference (here an input’s `writes`).

```json
{ "type": "ty_3f8v6h2n0c", "prop": "pr_4p6r8t0v2x" }
```

## StateRef {#stateref}

A state of a lifecycle.

| Field | Type | Required | Default | Example | Description |
|---|---|---|---|---|---|
| `lifecycle` | [FsmId](shapes.md#fsmid) | yes | — | `"lc_2k4m6p8r0t"` | The lifecycle. |
| `state` | [StateId](shapes.md#stateid) | yes | — | `"st_5m7p9r1t3v"` | The state of that lifecycle. |

Any lifecycle state reference (here a trigger’s `on.enter`).

```json
{ "lifecycle": "lc_2k4m6p8r0t", "state": "st_5m7p9r1t3v" }
```

## PropPath {#proppath}

A path of property ids along required to-one refs, ending at the property it reads (C23).

Type: [PropId](shapes.md#propid)[] (at least one).

## Ident {#ident}

A name: lower case, starting with a letter, then letters, digits or single underscores; at most 48 characters.

Type: string (matching `^(?!.*__)[a-z][a-z0-9_]{0,47}$`).

## TypeId {#typeid}

A type id (`ty_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## PropId {#propid}

A property id (`pr_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## EnumValueId {#enumvalueid}

An enum value id (`ev_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## ActionId {#actionid}

An action id (`ac_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## FsmId {#fsmid}

A lifecycle id (`lc_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## StateId {#stateid}

A lifecycle state id (`st_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## TransitionId {#transitionid}

A lifecycle transition id (`tn_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## TriggerId {#triggerid}

A trigger id (`tr_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## PolicyId {#policyid}

A policy id (`po_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## GroupId {#groupid}

A group id (`gr_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## ViewId {#viewid}

A view id (`vw_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## AppId {#appid}

An app id (`ap_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## FormId {#formid}

A public form id (`fm_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## FnId {#fnid}

A shared function id (`fn_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## InvariantId {#invariantid}

An invariant id (`iv_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## PersonaId {#personaid}

A persona id (`pe_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## MeasureId {#measureid}

A measure id (`ms_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).

## EnumId {#enumid}

A shared enum id (`en_…`); renames keep it.

Type: string (matching `^[a-z0-9][a-z0-9_]{0,63}$`).
