WriteItem
Defined in: runtime/item.ts:113
Extends
Section titled “Extends”BaseWriteItem<TItemInstanceTypes>.StandardItem
Type Parameters
Section titled “Type Parameters”TItemInstanceTypes
Section titled “TItemInstanceTypes”TItemInstanceTypes extends ItemInstanceTypes = ItemInstanceTypes
Properties
Section titled “Properties”createdAt
Section titled “createdAt”
readonlycreatedAt:Date
Defined in: runtime/item.ts:28
Inherited from
Section titled “Inherited from”definition
Section titled “definition”
readonlydefinition:TemplateDefinition
Defined in: runtime/item.ts:29
Inherited from
Section titled “Inherited from”events
Section titled “events”
readonlyevents:Record<string,WriteEventPublishInstance>
Defined in: runtime/item.ts:64
Inherited from
Section titled “Inherited from”
readonlyid:string
Defined in: runtime/item.ts:27
Inherited from
Section titled “Inherited from”isArchived
Section titled “isArchived”
readonlyisArchived:boolean
Defined in: runtime/item.ts:91
Inherited from
Section titled “Inherited from”StandardItem.isArchived
isRefreshOverdue
Section titled “isRefreshOverdue”
readonlyisRefreshOverdue:boolean
Defined in: runtime/item.ts:96
Inherited from
Section titled “Inherited from”StandardItem.isRefreshOverdue
isRefreshPending
Section titled “isRefreshPending”
readonlyisRefreshPending:boolean
Defined in: runtime/item.ts:95
Inherited from
Section titled “Inherited from”StandardItem.isRefreshPending
readonlykey:string|undefined
Defined in: runtime/item.ts:92
Inherited from
Section titled “Inherited from”StandardItem.key
parentId
Section titled “parentId”
readonlyparentId:string|undefined
Defined in: runtime/item.ts:93
Inherited from
Section titled “Inherited from”StandardItem.parentId
properties
Section titled “properties”
readonlyproperties:PropertyMap
Defined in: runtime/item.ts:30
Inherited from
Section titled “Inherited from”propertyValues
Section titled “propertyValues”
readonlypropertyValues:PropertyValueMap
Defined in: runtime/item.ts:31
Inherited from
Section titled “Inherited from”refreshBy
Section titled “refreshBy”
readonlyrefreshBy:Date|undefined
Defined in: runtime/item.ts:97
Inherited from
Section titled “Inherited from”StandardItem.refreshBy
refreshedAt
Section titled “refreshedAt”
readonlyrefreshedAt:Date|undefined
Defined in: runtime/item.ts:98
Inherited from
Section titled “Inherited from”StandardItem.refreshedAt
relations
Section titled “relations”
readonlyrelations:Record<string,WriteRelationInstance>
Defined in: runtime/item.ts:65
Inherited from
Section titled “Inherited from”
readonlystate:WriteStateInstance<WriteItem<ItemInstanceTypes>,string|null,TransitionTypes> |null
Defined in: runtime/item.ts:66
Inherited from
Section titled “Inherited from”templatePrn
Section titled “templatePrn”
readonlytemplatePrn:string
Defined in: runtime/item.ts:32
Inherited from
Section titled “Inherited from”workspaceId
Section titled “workspaceId”
readonlyworkspaceId:string
Defined in: runtime/item.ts:35
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”archive()
Section titled “archive()”archive():
Promise<WriteItem<TItemInstanceTypes>>
Defined in: runtime/item.ts:121
Marks this item as “archived”. Archived items are still around, but are excluded by default from any item selectors. If this item is already archived this is effectively a no-op.
Returns
Section titled “Returns”Promise<WriteItem<TItemInstanceTypes>>
assertRole()
Section titled “assertRole()”assertRole(
role):Promise<true>
Defined in: runtime/item.ts:41
Asserts that the current, active item instance has the current role. If successful, this will return true. Otherwise it will throw an Error.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<true>
Inherited from
Section titled “Inherited from”assignParent()
Section titled “assignParent()”assignParent(
parent):Promise<WriteItem<ItemInstanceTypes>>
Defined in: runtime/item.ts:67
Parameters
Section titled “Parameters”parent
Section titled “parent”Returns
Section titled “Returns”Promise<WriteItem<ItemInstanceTypes>>
Inherited from
Section titled “Inherited from”checkRole()
Section titled “checkRole()”checkRole(
role):Promise<boolean>
Defined in: runtime/item.ts:47
Checks that the current, active item instance has the current role; returning true/false if that role is present.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”clearKey()
Section titled “clearKey()”clearKey():
Promise<WriteItem<TItemInstanceTypes>>
Defined in: runtime/item.ts:86
Returns
Section titled “Returns”Promise<WriteItem<TItemInstanceTypes>>
Inherited from
Section titled “Inherited from”createChild()
Section titled “createChild()”createChild<
TReadTemplate>(template,options):Promise<TItemInstanceTypes["WriteItemsByPrn"][TReadTemplate["prn"]]>
Defined in: runtime/item.ts:69
Type Parameters
Section titled “Type Parameters”TReadTemplate
Section titled “TReadTemplate”TReadTemplate extends ReadTemplate<ReadItem>
Parameters
Section titled “Parameters”template
Section titled “template”TReadTemplate
options
Section titled “options”Returns
Section titled “Returns”Promise<TItemInstanceTypes["WriteItemsByPrn"][TReadTemplate["prn"]]>
Inherited from
Section titled “Inherited from”currentRoles()
Section titled “currentRoles()”currentRoles():
Promise<BaseRoleInstance[]>
Defined in: runtime/item.ts:57
Returns the roles that the current user has available on this item. Note that for sudo/system users this will be all available roles.
MATT: This is currently async. Maybe we can revisit that later.
Returns
Section titled “Returns”Promise<BaseRoleInstance[]>
Inherited from
Section titled “Inherited from”extensions()
Section titled “extensions()”extensions<
TReadTemplate>(template):Promise<WriteTemplateExtension>
Defined in: runtime/item.ts:127
Configure property extensions for children of this item. The provided template must be extensible or an error will be thrown.
Type Parameters
Section titled “Type Parameters”TReadTemplate
Section titled “TReadTemplate”TReadTemplate extends ReadTemplate<ReadItem> & object
Parameters
Section titled “Parameters”template
Section titled “template”TReadTemplate
Returns
Section titled “Returns”Promise<WriteTemplateExtension>
getChildByKey()
Section titled “getChildByKey()”getChildByKey(
key):Promise<WriteItem<ItemInstanceTypes> |undefined>
Defined in: runtime/item.ts:82
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<WriteItem<ItemInstanceTypes> | undefined>
Inherited from
Section titled “Inherited from”getParent()
Section titled “getParent()”getParent():
Promise<WriteItem<ItemInstanceTypes> |undefined>
Defined in: runtime/item.ts:83
Returns
Section titled “Returns”Promise<WriteItem<ItemInstanceTypes> | undefined>
Inherited from
Section titled “Inherited from”selectChildren()
Section titled “selectChildren()”selectChildren():
ItemCursorSelector<WriteItem<ItemInstanceTypes>>
Defined in: runtime/item.ts:134
Returns a selector that will return children of this item.
Returns
Section titled “Returns”ItemCursorSelector<WriteItem<ItemInstanceTypes>>
setRefreshBy()
Section titled “setRefreshBy()”setRefreshBy(
duration):Promise<WriteItem<TItemInstanceTypes>>
Defined in: runtime/item.ts:148
Marks an item as pending refresh within the next duration of time. If immediate:true is used then refreshBy will be set to now and uniformly distributed scheduling will be skipped.
Parameters
Section titled “Parameters”duration
Section titled “duration”DurationLikeObject | { immediate: true; }
Luxon Duration object or object containing immediate:true
Returns
Section titled “Returns”Promise<WriteItem<TItemInstanceTypes>>
unarchive()
Section titled “unarchive()”unarchive():
Promise<WriteItem<TItemInstanceTypes>>
Defined in: runtime/item.ts:140
Marks a previously archived item as non-archived. If this item is not archived this is effectively a no-op.
Returns
Section titled “Returns”Promise<WriteItem<TItemInstanceTypes>>
updateKey()
Section titled “updateKey()”updateKey(
key):Promise<WriteItem<TItemInstanceTypes>>
Defined in: runtime/item.ts:85
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<WriteItem<TItemInstanceTypes>>
Inherited from
Section titled “Inherited from”updateProperties()
Section titled “updateProperties()”updateProperties(
input):Promise<WriteItem<TItemInstanceTypes>>
Defined in: runtime/item.ts:84
Parameters
Section titled “Parameters”Record<string, unknown>
Returns
Section titled “Returns”Promise<WriteItem<TItemInstanceTypes>>
Inherited from
Section titled “Inherited from”BaseWriteItem.updateProperties
upsertChildByKey()
Section titled “upsertChildByKey()”upsertChildByKey<
TReadTemplate>(template,options):Promise<TItemInstanceTypes["WriteItemsByPrn"][TReadTemplate["prn"]]>
Defined in: runtime/item.ts:73
Type Parameters
Section titled “Type Parameters”TReadTemplate
Section titled “TReadTemplate”TReadTemplate extends ReadTemplate<ReadItem>
Parameters
Section titled “Parameters”template
Section titled “template”TReadTemplate
options
Section titled “options”Returns
Section titled “Returns”Promise<TItemInstanceTypes["WriteItemsByPrn"][TReadTemplate["prn"]]>
Inherited from
Section titled “Inherited from”BaseWriteItem.upsertChildByKey
upsertChildrenByKey()
Section titled “upsertChildrenByKey()”upsertChildrenByKey<
TReadTemplate>(template,options):Promise<Record<string,TItemInstanceTypes["WriteItemsByPrn"][TReadTemplate["prn"]]>>
Defined in: runtime/item.ts:77
Type Parameters
Section titled “Type Parameters”TReadTemplate
Section titled “TReadTemplate”TReadTemplate extends ReadTemplate<ReadItem>
Parameters
Section titled “Parameters”template
Section titled “template”TReadTemplate
options
Section titled “options”Returns
Section titled “Returns”Promise<Record<string, TItemInstanceTypes["WriteItemsByPrn"][TReadTemplate["prn"]]>>