Skip to content

WriteUnionInstance

Presents a Union inside a read-write execution, returning writable Items.

TWriteItem extends WriteItem = WriteItem

The writable Item type generated for this Union’s members.

readonly prn: string

The PRN of the resource, for example prn::identity:template/user.

ReadUnionInstance.prn

getItem(id): Promise<TWriteItem | undefined>

Loads an Item by identifier when it belongs to a member Template, writable in the current execution.

string

The Item identifier.

Promise<TWriteItem | undefined>

The Item, or undefined when the active principal cannot read it or its Template is not a member.

ReadUnionInstance.getItem


isMember(template): boolean

Reports whether a Template belongs to this Union.

PrnInstance

The Template, or anything carrying its PRN.

boolean

ReadUnionInstance.isMember


isType(value): value is TWriteItem

Reports whether a value is an Item of one of the member Templates, narrowing it to the writable Item type.

unknown

The value to test.

value is TWriteItem

ReadUnionInstance.isType


memberPrns(): string[]

Lists the PRNs of the member Templates.

string[]

ReadUnionInstance.memberPrns


selectItems(): UnionCursorSelector<WriteItem<ItemInstanceTypes>>

Starts a selection over the Items of every member Template, returning writable Items.

UnionCursorSelector<WriteItem<ItemInstanceTypes>>

ReadUnionInstance.selectItems