ReadWorkspaceItem
Presents the Item at the root of a Workspace’s hierarchy, from which every other Item descends.
Remarks
Section titled “Remarks”The Workspace Item has no parent, key or archive state. It is returned to every principal, though its Property values are only readable by principals holding a Grant on the Workspace Template.
Extends
Section titled “Extends”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.
Inherited from
Section titled “Inherited from”definition
Section titled “definition”
readonlydefinition:TemplateDefinition
The Template definition the Item was created from, with any extension Properties of its parent merged in.
Inherited from
Section titled “Inherited from”
readonlyid:string
The Item identifier, a UUID.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”
readonlystate:ReadStateInstance<string|null> |null
The Item’s current state, or null when its Template declares no states.
Inherited from
Section titled “Inherited from”templatePrn
Section titled “templatePrn”
readonlytemplatePrn:string
The PRN of the Template the Item was created from.
Inherited from
Section titled “Inherited from”workspaceId
Section titled “workspaceId”
readonlyworkspaceId:string
The identifier of the Workspace holding the Item.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”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>
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”selectChildren()
Section titled “selectChildren()”selectChildren():
ItemCursorSelector<ReadItem>
Starts a selection over the top-level Items of the Workspace.

