BaseReadItem
Presents one Item as the active principal sees it inside one Workspace.
Remarks
Section titled “Remarks”Property values pass through the principal’s Grants: Properties the principal is not granted are absent
from properties and propertyValues, and a stored value that no longer fits its definition reads as invalid.
Sudo and system contexts see every Property. Items the principal holds no Grant on are not returned at all.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”createdAt
Section titled “createdAt”
readonlycreatedAt:Date
When the Item was created, taken from the execution time of the execution that created it.
definition
Section titled “definition”
readonlydefinition:TemplateDefinition
The Template definition the Item was created from, with any extension Properties of its parent merged in.
readonlyid:string
The Item identifier, a UUID.
properties
Section titled “properties”
readonlyproperties:PropertyMap
Plain Property values keyed by Property key, ready for application logic.
Remarks
Section titled “Remarks”Select values are reduced to option keys: a single-select reads as its option key or null, a
multi-select as an array of option keys. instant and datetime values are Luxon DateTime objects. A
Property that is unset, invalid or not granted to the principal reads as undefined.
propertyValues
Section titled “propertyValues”
readonlypropertyValues:PropertyValueMap
Property values keyed by Property key, each tagged with its data type.
Remarks
Section titled “Remarks”Use this form when the data type is significant, for example to tell an unset value from a stored value that has become invalid. Properties the principal is not granted are absent.
relations
Section titled “relations”
readonlyrelations:Record<string,ReadRelationInstance>
Relations declared on the Item’s Template, keyed by Relation key and navigated from this Item’s side.
readonlystate:ReadStateInstance<string|null> |null
The Item’s current state, or null when its Template declares no states.
templatePrn
Section titled “templatePrn”
readonlytemplatePrn:string
The PRN of the Template the Item was created from.
workspaceId
Section titled “workspaceId”
readonlyworkspaceId:string
The identifier of the Workspace holding the Item.
Methods
Section titled “Methods”assertRole()
Section titled “assertRole()”assertRole(
role):Promise<true>
Confirms that the active principal holds a Template Role on this Item.
Parameters
Section titled “Parameters”A Role from the Template’s roles.
Returns
Section titled “Returns”Promise<true>
true when the Role is held.
Throws
Section titled “Throws”AssertRoleFailedError when the active principal does not hold the Role on this Item.
checkRole()
Section titled “checkRole()”checkRole(
role):Promise<boolean>
Reports whether the active principal holds a Template Role on this Item.
Parameters
Section titled “Parameters”A Role from the Template’s roles.
Returns
Section titled “Returns”Promise<boolean>
currentRoles()
Section titled “currentRoles()”currentRoles():
Promise<BaseRoleInstance[]>
Lists the Template Roles the active principal holds on this Item.
Returns
Section titled “Returns”Promise<BaseRoleInstance[]>
Remarks
Section titled “Remarks”Sudo and system contexts hold every Role the Template declares.
getAncestors()
Section titled “getAncestors()”getAncestors():
Promise<ReadItem[]>
Loads the ancestors of this Item, nearest parent first, up to and including the Workspace Item.
Returns
Section titled “Returns”Promise<ReadItem[]>
The ancestors the active principal can read, stopping at the first unreadable one; the Workspace Item has none.
getChildByKey()
Section titled “getChildByKey()”getChildByKey(
key):Promise<ReadItem|undefined>
Finds the child of this Item that carries a key.
Parameters
Section titled “Parameters”string
The child’s key, relative to this Item.
Returns
Section titled “Returns”Promise<ReadItem | undefined>
The child, or undefined when no child the active principal can read carries the key.
getParent()
Section titled “getParent()”getParent():
Promise<ReadItem|undefined>
Loads the parent of this Item.
Returns
Section titled “Returns”Promise<ReadItem | undefined>
The parent, or undefined for the Workspace Item, which has no parent.

