Skip to content

@codesoul-co/hypha-harness / durable-event-store-bridge

Using this module

Use the Durable event store bridge module for creating, recording, or reading Event contracts. It exports 1 class, 2 interfaces.

Import from the package entrypoint

ts
import {
  DurableEventStoreBridge,
} from '@codesoul-co/hypha-harness';

import type {
  DurableEventStoreBridgeCoordination,
  DurableEventStoreBridgeOptions,
} from '@codesoul-co/hypha-harness';

Usage patterns

  • Use the 2 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
DurableEventStoreBridgeclassnew DurableEventStoreBridge(options: DurableEventStoreBridgeOptions): DurableEventStoreBridgeAdapts the legacy append/list EventStore surface to canonical durable streams. It carries no Run state; every read is rebuilt from the durable Event Runtime.
DurableEventStoreBridgeCoordinationinterfaceinterface DurableEventStoreBridgeCoordinationDurable Event Store Bridge Coordination interface with 5 public fields or methods.
DurableEventStoreBridgeOptionsinterfaceinterface DurableEventStoreBridgeOptionsDurable Event Store Bridge Options interface with 4 public fields or methods.

DurableEventStoreBridge

Adapts the legacy append/list EventStore surface to canonical durable streams. It carries no Run state; every read is rebuilt from the durable Event Runtime.

Declaration

text
export declare class DurableEventStoreBridge implements EventStore, TraceRecorder {
    constructor(options: DurableEventStoreBridgeOptions);
    append(event: FrameworkEvent): Promise<void>;
    record(event: FrameworkEvent): Promise<void>;
    list(filter?: EventFilter): Promise<FrameworkEvent[]>;
}

Public members

MemberKindSignatureDescription
appendmethodappend(event: FrameworkEvent): Promise<void>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: DurableEventStoreBridgeOptions): DurableEventStoreBridgeCreates an instance of this class.
listmethodlist(filter?: EventFilter): Promise<FrameworkEvent[]>Public method; parameters and return type are shown in the signature.
recordmethodrecord(event: FrameworkEvent): Promise<void>Public method; parameters and return type are shown in the signature.

DurableEventStoreBridgeCoordination

Durable Event Store Bridge Coordination interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { DurableEventStoreBridgeCoordination } from '@codesoul-co/hypha-harness';
  • Source module: durable-event-store-bridge

Declaration

text
export interface DurableEventStoreBridgeCoordination {
    runLeases: RunLeaseStore;
    ownerId: string;
    leaseTtlMs: number;
    nextId(namespace: string): string;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
leaseTtlMspropertyleaseTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
nextIdmethodnextId(namespace: string): stringPublic method; parameters and return type are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
ownerIdpropertyownerId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
runLeasespropertyrunLeases: RunLeaseStorePublic property; its type, readonly modifier and optionality are shown in the signature.

DurableEventStoreBridgeOptions

Durable Event Store Bridge Options interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { DurableEventStoreBridgeOptions } from '@codesoul-co/hypha-harness';
  • Source module: durable-event-store-bridge

Declaration

text
export interface DurableEventStoreBridgeOptions {
    events: EventRuntime;
    coordination?: DurableEventStoreBridgeCoordination;
    maxAppendAttempts?: number;
    streamHeadPageSize?: number;
}

Contract members

MemberKindSignatureDescription
coordinationpropertycoordination?: DurableEventStoreBridgeCoordinationPublic property; its type, readonly modifier and optionality are shown in the signature.
eventspropertyevents: EventRuntimePublic property; its type, readonly modifier and optionality are shown in the signature.
maxAppendAttemptspropertymaxAppendAttempts?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
streamHeadPageSizepropertystreamHeadPageSize?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.