Skip to content

TemplateSelectPropertyBuilder

Configures a single-select Property of a Template, including its options and index.

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.

SelectPropertyBuilder.isArchived


readonly key: string

Property key within its Template.

SelectPropertyBuilder.key


readonly label: string

Display label, which defaults to the key.

SelectPropertyBuilder.label


readonly options: SelectOptionDefinition[]

Options declared so far, in declaration order.

SelectPropertyBuilder.options


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.

SelectPropertyBuilder.type

addOption(key, input): this

Adds an option to the select.

string

Option key, 1 to 128 characters; it is the stored value.

AddOptionInput

Display attributes; pass {} for none.

this

This builder for chaining.

When key is empty or longer than 128 characters, or the option limit is exceeded.

Declaring the options of an installation Property

const installation = addon.addProperty('installation', 'single-select');
installation.addOption('uninstalled', {});
installation.addOption('requested', { label: 'Requested' });
installation.addOption('installed', {});

SelectPropertyBuilder.addOption


annotate(…annotations): this

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

…PropertyAnnotation[]

this

SelectPropertyBuilder.annotate


archive(): this

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

this

This builder for chaining.

SelectPropertyBuilder.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.

SelectPropertyBuilder.setLabel


toDefinition(): PropertyDefinition

Emits the Definition of this Property.

PropertyDefinition

SelectPropertyBuilder.toDefinition


unarchive(): this

Reverses PropertyBuilder.archive.

this

This builder for chaining.

SelectPropertyBuilder.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