Skip to content

SelectPropertyBuilder

Configures a single-select or multi-select Property and its options.

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 options: SelectOptionDefinition[]

Options declared so far, in declaration order.


readonly prn: string

Platform Resource Name of the Property, derived from its Template and key.

PropertyBuilder.prn


readonly type: PropertyDefinitionType

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

PropertyBuilder.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', {});

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


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