@nestjs-cqrs-eventsourcing/core
Version:
Event sourcing for nestjs CQRS
20 lines (19 loc) • 985 B
TypeScript
import { EventstoreInterface, EventStoreOptions, Query, StorableEvent } from '@nestjs-cqrs-eventsourcing/core/src';
export declare class EventstoreProvider<Event extends StorableEvent = StorableEvent> implements EventstoreInterface {
private readonly eventstore;
private eventStoreLaunched;
private eventStreamCache;
constructor(options: EventStoreOptions);
isInitiated(): boolean;
getAggregateEvents(aggregate: string, id: string | number, take?: number, back?: number): Promise<Event[]>;
getEvents(query: Query, skip?: number, limit?: number): Promise<Event[]>;
countEvents(query: Query): Promise<number>;
getEvent(index: number): Promise<Event | null>;
storeEvent(event: StorableEvent): Promise<void>;
commit(aggregateId: string): Promise<void>;
logUncommitted(): void;
createSequence(name: string, startValue?: number): Promise<void>;
private getStream;
private getStorableEventFromPayload;
private getAggregateId;
}