Skip to content

PlatformInstance

Defined in: runtime/index.ts:67

readonly auth: AlpyneAuthContext

Defined in: runtime/index.ts:72

Current authentication context for this instance. Read-only and not mutable.


readonly workspaceId: string

Defined in: runtime/index.ts:77

The workspace identifier (UUID) for this instance.

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).

TResult

"read"

RuntimeReadFn<TResult>

Promise<TResult>

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.

TWriteAppInstance extends WriteRuntimeInstance = WriteRuntimeInstance

TResult = unknown

"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>

ReadWriteExecuteOptions

Promise<TResult>

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.

TResult

RuntimeMode

RuntimeExternalEvent | RuntimeInternalEvent | RuntimeReadFn<TResult>

RuntimeReadWriteFn<TResult, WriteRuntimeInstance>

ReadWriteExecuteOptions

Promise<TResult>


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.

Omit<AlpyneExternalEvent, "workspaceId"> | Omit<AlpyneExternalEvent, "workspaceId">[]

Promise<void>


runCreate(event): Promise<void>

Defined in: runtime/index.ts:118

Runs the onCreate event for the given App.

RuntimeExternalEvent

Promise<void>


runSeed(event): Promise<void>

Defined in: runtime/index.ts:123

Runs the onSeed event for the given App.

RuntimeExternalEvent

Promise<void>


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.

string

DurationLikeObject | { immediate: true; }

Luxon Duration object or object containing immediate:true

Promise<WriteItem<ItemInstanceTypes> | undefined>