Skip to content

TemplatePropertyBuilder

Configures a typed Property of a Template, including its label, index and archive state.

TemplatePropertiesBuilder.addProperty

readonly annotations: readonly PropertyAnnotation[]

Annotations declared so far, in declaration order.

TemplateSelectPropertyBuilder.annotations


readonly isArchived: boolean

Whether the Property is archived and therefore hidden from new use while its data is kept.

PropertyBuilder.isArchived


readonly key: string

Property key within its Template.

PropertyBuilder.key


readonly label: string

Display label, which defaults to the key.

PropertyBuilder.label


readonly prn: string

Platform Resource Name of the declared resource, derived from the App key and resource key.

BaseBuilder.prn


readonly type: PropertyDefinitionType

Declared data type, or json for a Property parsed by a Zod type.

PropertyBuilder.type

annotate(…annotations): this

Adds annotations to the Property, in declaration order; may be called more than once.

…PropertyAnnotation[]

this

PropertyBuilder.annotate


archive(): this

Archives the Property so it is retired without deleting stored values.

this

This builder for chaining.

PropertyBuilder.archive


index(): this

Marks the Property as indexed so selectors can filter and sort on it.

this

This builder for chaining.

When the Property is already indexed.

TemplatePropertyBase.index


setDescription(description): this

Sets the description emitted into the definition and rendered in generated reference and application assets.

string

Human-readable description of the resource.

this

This builder for chaining.

BaseBuilder.setDescription


setLabel(label): this

Sets the display label, truncated to 500 characters.

string

Human-readable label.

this

This builder for chaining.

PropertyBuilder.setLabel


toDefinition(): PropertyDefinition

Emits the Definition of this Property.

PropertyDefinition

PropertyBuilder.toDefinition


unarchive(): this

Reverses PropertyBuilder.archive.

this

This builder for chaining.

PropertyBuilder.unarchive


unique(): this

Marks the Property as a unique index: no two Items of the Template in a Workspace share a value.

this

This builder for chaining.

TemplatePropertyBase.unique