EventSourceableRepository

Hierarchy

  • EventSourceableRepository

Implements

Index

Methods

Methods

find

find(EventSourceableType: EventSourceableType, eventSourceableId: string | Guid): Promise‹EventSourceable | undefined›

Implementation of EventSourceableRepository

Returns a re-hydrated instance of event sourceable.

async

Parameters:

NameTypeDescription
EventSourceableTypeEventSourceableTypeEvent sourceable type(constructor).
eventSourceableIdstring | GuidIdentifier as string or Guid instance.

Returns: Promise‹EventSourceable | undefined›

Instance implementing EventSourceable interface, else undefined.


getSnapshotOf

getSnapshotOf(EventSourceableType: EventSourceableType, eventSourceableId: string | Guid): Promise‹EventSourceable | undefined›

Implementation of EventSourceableRepository

Returns snapshot of EventSourceable by identifier.

async

throws {UndefinedSnapshotterError} Thrown f the snapshotter is not available on IoC.

Parameters:

NameTypeDescription
EventSourceableTypeEventSourceableTypeEvent sourceable type(constructor).
eventSourceableIdstring | GuidIdentifier as string or Guid instance.

Returns: Promise‹EventSourceable | undefined›

Instance implementing EventSourceable interface, else undefined.


hasBySourceId

hasBySourceId(eventSourceableId: string | Guid): Promise‹boolean›

Implementation of EventSourceableRepository

Evaluates whether event sourceable with id already exists.

async

Parameters:

NameTypeDescription
eventSourceableIdstring | GuidIdentifier as string or Guid instance.

Returns: Promise‹boolean›

Returns true if event sourceable exists, else false.


isSnapshotting

isSnapshotting(): boolean

Implementation of EventSourceableRepository

Evaluates if application is snapshotting.

Returns: boolean

Returns true if snapshotting is enabled on application, else false.


makeSnapshotOf

makeSnapshotOf(eventSourceable: EventSourceable): Promise‹string | undefined›

Implementation of EventSourceableRepository

Makes a snapshot of EventSourceable.

async

throws {UndefinedSnapshotterError} Thrown f the snapshotter is not available on IoC.

Parameters:

NameTypeDescription
eventSourceableEventSourceableInstance implementing EventSourceable interface.

Returns: Promise‹string | undefined›

String identifier for made snapshot on storage.


save

save(eventSourceable: EventSourceable): Promise‹StorageIdentifiers

Implementation of EventSourceableRepository

Persists event sourceable.

async

Parameters:

NameTypeDescription
eventSourceableEventSourceableInstance implementing EventSourceable interface.

Returns: Promise‹StorageIdentifiers

Object implementing StorageIdentifiers interface.