PlatformInstance
Defined in: runtime/index.ts:67
Properties
Section titled “Properties”
readonlyauth:AlpyneAuthContext
Defined in: runtime/index.ts:72
Current authentication context for this instance. Read-only and not mutable.
workspaceId
Section titled “workspaceId”
readonlyworkspaceId:string
Defined in: runtime/index.ts:77
The workspace identifier (UUID) for this instance.
Methods
Section titled “Methods”execute()
Section titled “execute()”Call Signature
Section titled “Call Signature”execute<
TResult>(mode,fn):Promise<TResult>
Defined in: runtime/index.ts:85
Executes the given function in “read” mode on the platform. In this mode no modifications to any items are permitted. The items returned are “current”, but may be cached over the execution of the function (this is not specified; it is up to the implementation).
Type Parameters
Section titled “Type Parameters”TResult
Section titled “TResult”TResult
Parameters
Section titled “Parameters”"read"
RuntimeReadFn<TResult>
Returns
Section titled “Returns”Promise<TResult>
Call Signature
Section titled “Call Signature”execute<
TWriteAppInstance,TResult>(mode,event,fn,options?):Promise<TResult>
Defined in: runtime/index.ts:97
Executes the given function in read-write, which gives full access to all items and data (based upon the permission of this instance). However, items marked external (via their template) remain read-only. This mode should be used for access to queries and mutations.
Type Parameters
Section titled “Type Parameters”TWriteAppInstance
Section titled “TWriteAppInstance”TWriteAppInstance extends WriteRuntimeInstance = WriteRuntimeInstance
TResult
Section titled “TResult”TResult = unknown
Parameters
Section titled “Parameters”"readwrite"
RuntimeExternalEvent | RuntimeInternalEvent
additional metadata on how this execution event came to be (e.g. an API call). Since we’re at the instance level the identity is already known.
RuntimeReadWriteFn<TResult, TWriteAppInstance>
options?
Section titled “options?”Returns
Section titled “Returns”Promise<TResult>
Call Signature
Section titled “Call Signature”execute<
TResult>(mode,eventOrFn,fn?,options?):Promise<TResult>
Defined in: runtime/index.ts:108
Executes the function in the current environment. For more information, refer to the specific overloads of this signature.
Type Parameters
Section titled “Type Parameters”TResult
Section titled “TResult”TResult
Parameters
Section titled “Parameters”eventOrFn
Section titled “eventOrFn”RuntimeExternalEvent | RuntimeInternalEvent | RuntimeReadFn<TResult>
RuntimeReadWriteFn<TResult, WriteRuntimeInstance>
options?
Section titled “options?”Returns
Section titled “Returns”Promise<TResult>
publishExternalEvent()
Section titled “publishExternalEvent()”publishExternalEvent(
event):Promise<void>
Defined in: runtime/index.ts:129
Publishes an event directly into the platform. This method only enqueues the event. Execution of the event is handled by the reactor.
Parameters
Section titled “Parameters”Omit<AlpyneExternalEvent, "workspaceId"> | Omit<AlpyneExternalEvent, "workspaceId">[]
Returns
Section titled “Returns”Promise<void>
runCreate()
Section titled “runCreate()”runCreate(
event):Promise<void>
Defined in: runtime/index.ts:118
Runs the onCreate event for the given App.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
runSeed()
Section titled “runSeed()”runSeed(
event):Promise<void>
Defined in: runtime/index.ts:123
Runs the onSeed event for the given App.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
setRefreshBy()
Section titled “setRefreshBy()”setRefreshBy(
itemId,duration):Promise<WriteItem<ItemInstanceTypes> |undefined>
Defined in: runtime/index.ts:137
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”itemId
Section titled “itemId”string
duration
Section titled “duration”DurationLikeObject | { immediate: true; }
Luxon Duration object or object containing immediate:true
Returns
Section titled “Returns”Promise<WriteItem<ItemInstanceTypes> | undefined>