Skip to content

WriteTemplate

Presents a Template inside a read-write execution, returning writable Items and creating new ones.

TWriteItem extends WriteItem = WriteItem

The writable Item type generated for this Template.

readonly definition: TemplateDefinition

The complete Template definition.

ReadTemplate.definition


readonly grants: TemplateGrantInstance[]

Grants declared on the Template, one per granted Role.

ReadTemplate.grants


readonly isExtensible: boolean

Whether parent Items may extend this Template’s Properties for their children; see ReadTemplateExtension.

ReadTemplate.isExtensible


readonly prn: string

The PRN identifying this Template, for example prn::identity:template/user.

ReadTemplate.prn


readonly properties: Readonly<Record<string, PropertyDefinition>>

Property definitions declared by the Template, keyed by Property key.

ReadTemplate.properties


readonly relations: Record<string, RelationDefinition>

Relations declared from and to this Template, keyed by Relation key.

ReadTemplate.relations


readonly roles: Record<string, TemplateRoleInstance>

Template Roles declared by the Template, keyed by Role key.

ReadTemplate.roles

assertType(value): asserts value is TWriteItem

Narrows a value to an Item of this Template, throwing when it is not one.

unknown

The value to test.

asserts value is TWriteItem

when value is not an Item of this Template.

WriteTemplate.isType


createItem(parent, options): Promise<TWriteItem>

Creates an Item of this Template under a parent; equivalent to parent.createChild(template, options).

BaseWriteItem

The Item to create the new Item under.

CreateChildOptions

Key, Property values and initial state for the new Item.

Promise<TWriteItem>

The created Item.

BaseWriteItem.createChild


getItem(id): Promise<TWriteItem | undefined>

Loads an Item of this Template by identifier, writable in the current execution.

string

The Item identifier.

Promise<TWriteItem | undefined>

The Item, or undefined when the active principal cannot read it or it is not of this Template.

ReadTemplate.getItem


isType(value): value is TWriteItem

Reports whether a value is an Item of this Template, narrowing it to the writable Item type when it is.

unknown

The value to test.

value is TWriteItem

ReadTemplate.isType


selectItems(): TemplateItemCursorSelector<TWriteItem>

Starts a selection over every Item of this Template in the Workspace, returning writable Items.

TemplateItemCursorSelector<TWriteItem>

ReadTemplate.selectItems