SystemWriteRuntimeInstance
Defined in: runtime/runtime.ts:105
This interface is only availabe in specific “system” access contexts. Specifically, this instance is available in App Hooks like onCreate/onSeed. Methods in this interface MUST NOT be available to a regular principal accessing the system.
Extends
Section titled “Extends”Properties
Section titled “Properties”
readonlyapps:Record<string,WriteAppInstance>
Defined in: runtime/runtime.ts:74
Inherited from
Section titled “Inherited from”
readonlynow:DateTime
Defined in: runtime/runtime.ts:39
Inherited from
Section titled “Inherited from”principalId
Section titled “principalId”
readonlyprincipalId:string
Defined in: runtime/runtime.ts:40
Inherited from
Section titled “Inherited from”WriteRuntimeInstance.principalId
readonlyroot:WriteAppInstance
Defined in: runtime/runtime.ts:75
Inherited from
Section titled “Inherited from”workspaceId
Section titled “workspaceId”
readonlyworkspaceId:string
Defined in: runtime/index.ts:39
Inherited from
Section titled “Inherited from”WriteRuntimeInstance.workspaceId
Methods
Section titled “Methods”getItem()
Section titled “getItem()”getItem(
id):Promise<WriteItem<ItemInstanceTypes> |undefined>
Defined in: runtime/runtime.ts:76
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<WriteItem<ItemInstanceTypes> | undefined>
Inherited from
Section titled “Inherited from”getItemByKeyPath()
Section titled “getItemByKeyPath()”getItemByKeyPath(…
parts):Promise<WriteItem<ItemInstanceTypes> |undefined>
Defined in: runtime/runtime.ts:77
Parameters
Section titled “Parameters”…[string, ...string[]]
Returns
Section titled “Returns”Promise<WriteItem<ItemInstanceTypes> | undefined>
Inherited from
Section titled “Inherited from”WriteRuntimeInstance.getItemByKeyPath
getWorkspaceItem()
Section titled “getWorkspaceItem()”getWorkspaceItem():
Promise<WriteWorkspaceItem>
Defined in: runtime/runtime.ts:78
Returns
Section titled “Returns”Promise<WriteWorkspaceItem>
Inherited from
Section titled “Inherited from”WriteRuntimeInstance.getWorkspaceItem
getWorkspaceTemplate()
Section titled “getWorkspaceTemplate()”getWorkspaceTemplate():
ReadTemplate
Defined in: runtime/runtime.ts:45
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”WriteRuntimeInstance.getWorkspaceTemplate
hashKey()
Section titled “hashKey()”hashKey(
source):Promise<string>
Defined in: runtime/runtime.ts:52
Creates a key by hashing the provided value. The source can be up to 1,024 characters.
Parameters
Section titled “Parameters”source
Section titled “source”string
Returns
Section titled “Returns”Promise<string>
Inherited from
Section titled “Inherited from”log(
message, …optional):void
Defined in: runtime/runtime.ts:46
Parameters
Section titled “Parameters”message
Section titled “message”any
optional
Section titled “optional”…any[]
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”seed()
Section titled “seed()”seed(
options):Promise<void>
Defined in: runtime/runtime.ts:116
Performs a batch seed operation. This is a managed upsert of the value provided in the options.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<void>
seedId()
Section titled “seedId()”seedId(
key):string
Defined in: runtime/runtime.ts:126
Returns a stable identifier based upon the provided key. This
is generated from the Workspace Id and the provided value.
Supplying the same value will generate the same identifier. This
method is mostly useful for using the seed function.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
SystemWriteRuntimeInstance#seed
selectEvents()
Section titled “selectEvents()”selectEvents():
EventCursorSelector<EventInstance>
Defined in: runtime/runtime.ts:110
Returns an event selection builder that allows querying events in this workspace.
Returns
Section titled “Returns”EventCursorSelector<EventInstance>
selectItems()
Section titled “selectItems()”selectItems():
ItemCursorSelector<WriteItem<ItemInstanceTypes>>
Defined in: runtime/runtime.ts:84
Returns an item selection builder that allows retrieving items that are in this workspace
Returns
Section titled “Returns”ItemCursorSelector<WriteItem<ItemInstanceTypes>>
Inherited from
Section titled “Inherited from”WriteRuntimeInstance.selectItems
sudo()
Section titled “sudo()”sudo<
TResult>(fn):Promise<TResult>
Defined in: runtime/runtime.ts:91
Moves into a readwrite sudo role: This is effectively system, but tracked against the existing principal (if any). Calling this from system does nothing. If you are already sudo, the existing sudo is retained.
Type Parameters
Section titled “Type Parameters”TResult
Section titled “TResult”TResult
Parameters
Section titled “Parameters”(ctx) => Promise<TResult>
Returns
Section titled “Returns”Promise<TResult>
Inherited from
Section titled “Inherited from”template()
Section titled “template()”template(
prn):Promise<WriteTemplate<WriteItem<ItemInstanceTypes>> |undefined>
Defined in: runtime/runtime.ts:96
Return the template matching the supplied prn.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<WriteTemplate<WriteItem<ItemInstanceTypes>> | undefined>
Inherited from
Section titled “Inherited from”workspaceSeedId()
Section titled “workspaceSeedId()”workspaceSeedId(
key):string
Defined in: runtime/runtime.ts:135
Returns a workspace-scoped stable identifier based on the provided key.
This is for use inside the seed function when the runtime id is needed
outside of the id, parent_id, and relationships: like inside content.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
SystemWriteRuntimeInstance#seed