@codesoul-co/hypha-core / modules/runtime/runtime-io-helpers
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/modules/runtime/runtime-io-helpers.ts - Exports: 5
Using this module
Use the Runtime io helpers module for executing runtime behavior at this boundary. It exports 3 classes, 1 function, 1 interface.
Import from the package entrypoint
ts
import {
DefaultRuntimeEventHelper,
DefaultRuntimeResourceHelper,
DurableRuntimeEventCommitPort,
createRuntimeIoHelperSdk,
} from '@codesoul-co/hypha-core';
import type {
DefaultRuntimeEventHelperOptions,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 3 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
- The module exposes 1 function as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
DefaultRuntimeEventHelper | class | new DefaultRuntimeEventHelper(options: DefaultRuntimeEventHelperOptions): DefaultRuntimeEventHelper | Default Runtime Event Helper class with 4 public constructor or member entries; its exact declarations are listed below. |
DefaultRuntimeResourceHelper | class | new DefaultRuntimeResourceHelper(dependencies: RuntimeResourceHelperDependencies): DefaultRuntimeResourceHelper | Default Runtime Resource Helper class with 5 public constructor or member entries; its exact declarations are listed below. |
DurableRuntimeEventCommitPort | class | new DurableRuntimeEventCommitPort(store: DurableEventStore): DurableRuntimeEventCommitPort | Durable Runtime Event Commit Port class with 3 public constructor or member entries; its exact declarations are listed below. |
createRuntimeIoHelperSdk | function | createRuntimeIoHelperSdk(options: { event: DefaultRuntimeEventHelperOptions; resource: RuntimeResourceHelperDependencies; }): RuntimeIoHelperSdk | Create Runtime Io Helper Sdk function with 1 public call signature; parameters and return types are listed below. |
DefaultRuntimeEventHelperOptions | interface | interface DefaultRuntimeEventHelperOptions | Default Runtime Event Helper Options interface with 4 public fields or methods. |
DefaultRuntimeEventHelper
Default Runtime Event Helper class with 4 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { DefaultRuntimeEventHelper } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-io-helpers
Declaration
text
export declare class DefaultRuntimeEventHelper implements RuntimeEventHelper {
constructor(options: DefaultRuntimeEventHelperOptions);
append<T extends RuntimeJsonValue>(type: `runtime.observation.${string}`, payload: T, options?: RuntimeEventAppendOptions): Promise<FrameworkEvent<T>>;
appendBatch(inputs: RuntimeObservationEventInput[]): Promise<FrameworkEvent[]>;
readSince(sequence: number): Promise<FrameworkEvent[]>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
append | method | append<T extends RuntimeJsonValue>(type: | Public method; parameters and return type are shown in the signature. |
appendBatch | method | appendBatch(inputs: RuntimeObservationEventInput[]): Promise<FrameworkEvent[]> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options: DefaultRuntimeEventHelperOptions): DefaultRuntimeEventHelper | Creates an instance of this class. |
readSince | method | readSince(sequence: number): Promise<FrameworkEvent[]> | Public method; parameters and return type are shown in the signature. |
DefaultRuntimeResourceHelper
Default Runtime Resource Helper class with 5 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { DefaultRuntimeResourceHelper } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-io-helpers
Declaration
text
export declare class DefaultRuntimeResourceHelper implements RuntimeResourceHelper {
constructor(dependencies: RuntimeResourceHelperDependencies);
acquire(resources: Omit<RuntimeResourceRequest, 'requestedClaimId'>[], options: RuntimeResourceAcquireOptions): Promise<RuntimeResourceClaim[]>;
renew(claims: RuntimeResourceClaim[], options: RuntimeResourceRenewOptions): Promise<RuntimeResourceClaim[]>;
release(claims: RuntimeResourceClaim[]): Promise<void>;
assertCurrent(claim: RuntimeResourceClaim): Promise<RuntimeResourceClaim>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
acquire | method | acquire(resources: Omit<RuntimeResourceRequest, "requestedClaimId">[], options: RuntimeResourceAcquireOptions): Promise<RuntimeResourceClaim[]> | Public method; parameters and return type are shown in the signature. |
assertCurrent | method | assertCurrent(claim: RuntimeResourceClaim): Promise<RuntimeResourceClaim> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (dependencies: RuntimeResourceHelperDependencies): DefaultRuntimeResourceHelper | Creates an instance of this class. |
release | method | release(claims: RuntimeResourceClaim[]): Promise<void> | Public method; parameters and return type are shown in the signature. |
renew | method | renew(claims: RuntimeResourceClaim[], options: RuntimeResourceRenewOptions): Promise<RuntimeResourceClaim[]> | Public method; parameters and return type are shown in the signature. |
DurableRuntimeEventCommitPort
Durable Runtime Event Commit Port class with 3 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { DurableRuntimeEventCommitPort } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-io-helpers
Declaration
text
export declare class DurableRuntimeEventCommitPort implements RuntimeEventCommitPort {
constructor(store: DurableEventStore);
append(request: RuntimeEventCommitRequest): Promise<FrameworkEvent[]>;
readSince(scope: RuntimeScope, sequence: number): Promise<FrameworkEvent[]>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
append | method | append(request: RuntimeEventCommitRequest): Promise<FrameworkEvent[]> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (store: DurableEventStore): DurableRuntimeEventCommitPort | Creates an instance of this class. |
readSince | method | readSince(scope: RuntimeScope, sequence: number): Promise<FrameworkEvent[]> | Public method; parameters and return type are shown in the signature. |
createRuntimeIoHelperSdk
Create Runtime Io Helper Sdk function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createRuntimeIoHelperSdk } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-io-helpers
Declaration
text
export declare function createRuntimeIoHelperSdk(options: {
event: DefaultRuntimeEventHelperOptions;
resource: RuntimeResourceHelperDependencies;
}): RuntimeIoHelperSdk;Call signature
text
createRuntimeIoHelperSdk(options: { event: DefaultRuntimeEventHelperOptions; resource: RuntimeResourceHelperDependencies; }): RuntimeIoHelperSdkParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | { event: DefaultRuntimeEventHelperOptions; resource: RuntimeResourceHelperDependencies; } | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
RuntimeIoHelperSdk - Description: The return contract is defined by the type shown above.
DefaultRuntimeEventHelperOptions
Default Runtime Event Helper Options interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { DefaultRuntimeEventHelperOptions } from '@codesoul-co/hypha-core'; - Source module:
modules/runtime/runtime-io-helpers
Declaration
text
export interface DefaultRuntimeEventHelperOptions {
execution: RuntimeHelperExecutionScope;
ids: RuntimeIdHelper;
clock: {
now(): Promise<string>;
};
port: RuntimeEventCommitPort;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
clock | property | clock: { now(): Promise<string>; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
execution | property | execution: RuntimeHelperExecutionScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
ids | property | ids: RuntimeIdHelper | Public property; its type, readonly modifier and optionality are shown in the signature. |
port | property | port: RuntimeEventCommitPort | Public property; its type, readonly modifier and optionality are shown in the signature. |
