import { a as EmmettError, C as ConcurrencyError, e as ErrorConstructor } from './index-Amos00J7.js'; export { l as ConcurrencyInMemoryDatabaseError, i as EmmettCliCommand, d as EmmettCliPlugin, g as EmmettCliPluginRegistration, c as EmmettPlugin, f as EmmettPluginConfig, h as EmmettPluginRegistration, b as EmmettPluginType, E as EmmettPluginsConfig, I as IllegalStateError, N as NotFoundError, V as ValidationError, k as isErrorConstructor, j as isPluginConfig } from './index-Amos00J7.js'; import retry from 'async-retry'; type Primitive = undefined | null | boolean | string | number | bigint | symbol | Function; type ImmutableTypes = Date | RegExp; type DeepReadonly = T extends Primitive | ImmutableTypes ? T : T extends Array ? ReadonlyArray> : T extends Map ? ReadonlyMap, DeepReadonly> : T extends Set ? ReadonlySet> : T extends Promise ? Promise> : T extends object ? DeepReadonlyObject : Readonly; type DeepReadonlyObject = { readonly [P in keyof T]: DeepReadonly; }; type Mutable = T extends Primitive ? T : T extends ReadonlyArray ? MutableArray : T extends ReadonlyMap ? MutableMap : T extends ReadonlySet ? MutableSet : T extends Function ? T : T extends object ? MutableObject : unknown; type MutableArray = Array>; type MutableMap = Map, Mutable>; type MutableSet = Set>; type MutableObject = { -readonly [P in keyof T]: Mutable; }; type Command = Readonly; metadata?: DefaultCommandMetadata | undefined; } : { type: CommandType; data: CommandData; metadata: CommandMetaData; }> & { readonly kind?: 'Command'; }; type AnyCommand = Command; type CommandTypeOf = T['type']; type CommandDataOf = T['data']; type CommandMetaDataOf = T extends { metadata: infer M; } ? M : undefined; type CreateCommandType = Readonly & { readonly kind?: 'Command'; }; declare const command: >(...args: CommandMetaDataOf extends undefined ? [type: CommandTypeOf, data: CommandDataOf, metadata?: DefaultCommandMetadata | undefined] : [type: CommandTypeOf, data: CommandDataOf, metadata: CommandMetaDataOf]) => CommandType; type DefaultCommandMetadata = { now: Date; }; type Message = Command | Event; type AnyMessage = AnyEvent | AnyCommand; type MessageKindOf = T['kind']; type MessageTypeOf = T['type']; type MessageDataOf = T['data']; type MessageMetaDataOf = T extends { metadata: infer M; } ? M : undefined; type CanHandle = MessageTypeOf[]; declare const message: >(...args: MessageMetaDataOf extends undefined ? [kind: MessageKindOf, type: MessageTypeOf, data: MessageDataOf] : [kind: MessageKindOf, type: MessageTypeOf, data: MessageDataOf, metadata: MessageMetaDataOf]) => MessageType; type CombinedMessageMetadata = MessageMetaDataOf extends undefined ? MessageMetaDataType : MessageMetaDataOf & MessageMetaDataType; type CombineMetadata = MessageType & { metadata: CombinedMessageMetadata; }; type RecordedMessage = CombineMetadata & { kind: NonNullable>; }; type CommonRecordedMessageMetadata = Readonly<{ messageId: string; streamPosition: StreamPosition; streamName: string; }>; type WithGlobalPosition = Readonly<{ globalPosition: GlobalPosition; }>; type RecordedMessageMetadata = CommonRecordedMessageMetadata & (GlobalPosition extends undefined ? {} : WithGlobalPosition); type AnyRecordedMessage = Message; type AnyRecordedMessageMetadata = RecordedMessageMetadata; type RecordedMessageMetadataWithGlobalPosition = RecordedMessageMetadata; type RecordedMessageMetadataWithoutGlobalPosition = RecordedMessageMetadata; type GlobalPositionTypeOfRecordedMessageMetadata = RecordedMessageMetadataType extends RecordedMessageMetadata ? GP : never; type StreamPositionTypeOfRecordedMessageMetadata = RecordedMessageMetadataType extends RecordedMessageMetadata ? SV : never; type BigIntStreamPosition = bigint; type BigIntGlobalPosition = bigint; type Event = Readonly & { readonly kind?: 'Event'; }; type AnyEvent = Event; type EventTypeOf = T['type']; type EventDataOf = T['data']; type EventMetaDataOf = T extends { metadata: infer M; } ? M : undefined; type CreateEventType = Readonly & { readonly kind?: 'Event'; }; declare const event: >(...args: EventMetaDataOf extends undefined ? [type: EventTypeOf, data: EventDataOf] : [type: EventTypeOf, data: EventDataOf, metadata: EventMetaDataOf]) => EventType; type CombinedReadEventMetadata = CombinedMessageMetadata; type ReadEvent = RecordedMessage; type AnyReadEvent = ReadEvent; type CommonReadEventMetadata = CommonRecordedMessageMetadata; type ReadEventMetadata = RecordedMessageMetadata; type AnyReadEventMetadata = AnyRecordedMessageMetadata; type ReadEventMetadataWithGlobalPosition = RecordedMessageMetadataWithGlobalPosition; type ReadEventMetadataWithoutGlobalPosition = RecordedMessageMetadataWithoutGlobalPosition; type GlobalPositionTypeOfReadEventMetadata = GlobalPositionTypeOfRecordedMessageMetadata; type StreamPositionTypeOfReadEventMetadata = StreamPositionTypeOfRecordedMessageMetadata; type SingleRawMessageHandlerWithoutContext = (message: MessageType) => Promise | MessageHandlerResult; type SingleRecordedMessageHandlerWithoutContext = (message: RecordedMessage) => Promise | MessageHandlerResult; type SingleMessageHandlerWithoutContext = SingleRawMessageHandlerWithoutContext | SingleRecordedMessageHandlerWithoutContext; type SingleRawMessageHandlerWithContext = (message: MessageType, context: HandlerContext) => Promise | MessageHandlerResult; type SingleRecordedMessageHandlerWithContext = (message: RecordedMessage, context: HandlerContext) => Promise | MessageHandlerResult; type SingleMessageHandlerWithContext = SingleRawMessageHandlerWithContext | SingleRecordedMessageHandlerWithContext; type SingleMessageHandler = HandlerContext extends DefaultRecord ? SingleMessageHandlerWithContext : SingleMessageHandlerWithoutContext; type BatchRawMessageHandlerWithoutContext = (messages: MessageType[]) => Promise | MessageHandlerResult; type BatchRecordedMessageHandlerWithoutContext = (messages: RecordedMessage[]) => Promise | MessageHandlerResult; type BatchMessageHandlerWithoutContext = BatchRawMessageHandlerWithoutContext | BatchRecordedMessageHandlerWithoutContext; type BatchRawMessageHandlerWithContext = (messages: MessageType[], context: HandlerContext) => Promise | MessageHandlerResult; type BatchRecordedMessageHandlerWithContext = (messages: RecordedMessage[], context: HandlerContext) => Promise | MessageHandlerResult; type BatchMessageHandlerWithContext = BatchRawMessageHandlerWithContext | BatchRecordedMessageHandlerWithContext; type BatchMessageHandler = HandlerContext extends DefaultRecord ? BatchMessageHandlerWithContext : BatchMessageHandlerWithoutContext; type MessageHandler = (HandlerContext extends DefaultRecord ? SingleMessageHandler : SingleMessageHandler) | (HandlerContext extends DefaultRecord ? BatchMessageHandler : BatchMessageHandler); type MessageHandlerResult = void | { type: 'SKIP'; reason?: string; } | { type: 'STOP'; reason?: string; error?: EmmettError; }; type Decider = { decide: (command: CommandType, state: State) => StreamEvent | StreamEvent[]; evolve: (currentState: State, event: StreamEvent) => State; initialState: () => State; }; type Workflow = { decide: (command: Input, state: State) => WorkflowOutput[]; evolve: (currentState: State, event: WorkflowEvent) => State; initialState: () => State; }; type WorkflowEvent = Extract; type WorkflowCommand = Extract; type WorkflowOutput = { action: 'Reply'; message: TOutput; } | { action: 'Send'; message: WorkflowCommand; } | { action: 'Publish'; message: WorkflowEvent; } | { action: 'Schedule'; message: TOutput; when: { afterInMs: number; } | { at: Date; }; } | { action: 'Complete'; } | { action: 'Accept'; } | { action: 'Ignore'; reason: string; } | { action: 'Error'; reason: string; }; declare const reply: (message: TOutput) => WorkflowOutput; declare const send: (message: WorkflowCommand) => WorkflowOutput; declare const publish: (message: WorkflowEvent) => WorkflowOutput; declare const schedule: (message: TOutput, when: { afterInMs: number; } | { at: Date; }) => WorkflowOutput; declare const complete: () => WorkflowOutput; declare const ignore: (reason: string) => WorkflowOutput; declare const error: (reason: string) => WorkflowOutput; declare const accept: () => WorkflowOutput; type Brand = K & { readonly __brand: T; }; type Flavour = K & { readonly __brand?: T; }; type DefaultRecord = Record; type AnyRecord = Record; type NonNullable$1 = T extends null | undefined ? never : T; declare const emmettPrefix = "emt"; declare const globalTag = "global"; declare const defaultTag = "emt:default"; declare const unknownTag = "emt:unknown"; type ExpectedStreamVersion = ExpectedStreamVersionWithValue | ExpectedStreamVersionGeneral; type ExpectedStreamVersionWithValue = Flavour; type ExpectedStreamVersionGeneral = Flavour<'STREAM_EXISTS' | 'STREAM_DOES_NOT_EXIST' | 'NO_CONCURRENCY_CHECK', 'StreamVersion'>; declare const STREAM_EXISTS: ExpectedStreamVersionGeneral; declare const STREAM_DOES_NOT_EXIST: ExpectedStreamVersionGeneral; declare const NO_CONCURRENCY_CHECK: ExpectedStreamVersionGeneral; declare const matchesExpectedVersion: (current: StreamVersion | undefined, expected: ExpectedStreamVersion, defaultVersion: StreamVersion) => boolean; declare const assertExpectedVersionMatchesCurrent: (current: StreamVersion, expected: ExpectedStreamVersion | undefined, defaultVersion: StreamVersion) => void; declare class ExpectedVersionConflictError extends ConcurrencyError { constructor(current: VersionType, expected: ExpectedStreamVersion); } declare const isExpectedVersionConflictError: (error: unknown) => error is ExpectedVersionConflictError; interface EventStore { aggregateStream(streamName: string, options: AggregateStreamOptions): Promise>>; readStream(streamName: string, options?: ReadStreamOptions, EventType, EventPayloadType>): Promise>; appendToStream(streamName: string, events: EventType[], options?: AppendToStreamOptions, EventType, EventPayloadType>): Promise>>; streamExists(streamName: string): Promise; } type EventStoreReadEventMetadata = Store extends EventStore ? T extends CommonReadEventMetadata ? T extends WithGlobalPosition ? ReadEventMetadata & T : ReadEventMetadata & T : never : never; type GlobalPositionTypeOfEventStore = GlobalPositionTypeOfReadEventMetadata>; type StreamPositionTypeOfEventStore = StreamPositionTypeOfReadEventMetadata>; type EventStoreSession = { eventStore: EventStoreType; close: () => Promise; }; interface EventStoreSessionFactory { withSession(callback: (session: EventStoreSession) => Promise): Promise; } declare const canCreateEventStoreSession: (eventStore: Store | EventStoreSessionFactory) => eventStore is EventStoreSessionFactory; declare const nulloSessionFactory: (eventStore: EventStoreType) => EventStoreSessionFactory; type EventStoreReadSchemaOptions = { versioning?: { upcast?: (event: StoredEvent) => StreamEvent; }; }; type EventStoreAppendSchemaOptions = { versioning?: { downcast?: (event: StreamEvent) => StoredEvent; }; }; type EventStoreSchemaOptions = EventStoreReadSchemaOptions & EventStoreAppendSchemaOptions; type ReadStreamOptions = { from?: StreamVersion; to?: StreamVersion; maxCount?: bigint; expectedStreamVersion?: ExpectedStreamVersion; schema?: EventStoreReadSchemaOptions; }; type ReadStreamResult = { currentStreamVersion: StreamPositionTypeOfReadEventMetadata; events: ReadEvent[]; streamExists: boolean; }; type Evolve = ((currentState: State, event: EventType) => State) | ((currentState: State, event: ReadEvent) => State) | ((currentState: State, event: ReadEvent) => State); type AggregateStreamOptions = { evolve: Evolve; initialState: () => State; read?: ReadStreamOptions, EventType, EventPayloadType>; }; type AggregateStreamResult = { currentStreamVersion: StreamPosition; state: State; streamExists: boolean; }; type AggregateStreamResultWithGlobalPosition = (AggregateStreamResult & { streamExists: true; lastEventGlobalPosition: GlobalPosition; }) | (AggregateStreamResult & { streamExists: false; }); type AggregateStreamResultOfEventStore = Store['aggregateStream'] extends (...args: any[]) => Promise ? R : never; type AppendToStreamOptions = { expectedStreamVersion?: ExpectedStreamVersion; schema?: EventStoreAppendSchemaOptions; }; type AppendToStreamResult = { nextExpectedStreamVersion: StreamVersion; createdNewStream: boolean; }; type AppendToStreamResultWithGlobalPosition = AppendToStreamResult & { lastEventGlobalPosition: GlobalPosition; }; type AppendStreamResultOfEventStore = Store['appendToStream'] extends (...args: any[]) => Promise ? R : never; type StreamExistsResult = boolean; type DefaultEventStoreOptions = { /** * Pluggable set of hooks informing about the event store internal behaviour. */ hooks?: { /** * This hook will be called **AFTER** events were stored in the event store. * It's designed to handle scenarios where delivery and ordering guarantees do not matter much. * * **WARNINGS:** * * 1. It will be called **EXACTLY ONCE** if append succeded. * 2. If the hook fails, its append **will still silently succeed**, and no error will be thrown. * 3. Wen process crashes after events were committed, but before the hook was called, delivery won't be retried. * That can lead to state inconsistencies. * 4. In the case of high concurrent traffic, **race conditions may cause ordering issues**. * For instance, where the second hook takes longer to process than the first one, ordering won't be guaranteed. * * @type {AfterEventStoreCommitHandler} */ onAfterCommit?: AfterEventStoreCommitHandler; }; }; type AfterEventStoreCommitHandler = HandlerContext extends undefined ? BatchRecordedMessageHandlerWithoutContext> : BatchRecordedMessageHandlerWithContext, NonNullable>; type BeforeEventStoreCommitHandler = HandlerContext extends undefined ? BatchRecordedMessageHandlerWithoutContext> : BatchRecordedMessageHandlerWithContext, NonNullable>; type TryPublishMessagesAfterCommitOptions = { onAfterCommit?: AfterEventStoreCommitHandler; }; declare function tryPublishMessagesAfterCommit(messages: ReadEvent>[], options: TryPublishMessagesAfterCommitOptions | undefined): Promise; declare function tryPublishMessagesAfterCommit(messages: ReadEvent>[], options: TryPublishMessagesAfterCommitOptions | undefined, context: HandlerContext): Promise; interface CommandSender { send(command: CommandType): Promise; } interface EventsPublisher { publish(event: EventType): Promise; } type ScheduleOptions = { afterInMs: number; } | { at: Date; }; interface MessageScheduler { schedule(message: MessageType, when?: ScheduleOptions): void; } interface CommandBus extends CommandSender, MessageScheduler { } interface EventBus extends EventsPublisher, MessageScheduler { } interface MessageBus extends CommandBus, EventBus { schedule(message: MessageType, when?: ScheduleOptions): void; } interface CommandProcessor { handle(commandHandler: SingleMessageHandler, ...commandTypes: CommandTypeOf[]): void; } interface EventSubscription { subscribe(eventHandler: SingleMessageHandler, ...eventTypes: EventTypeOf[]): void; } type ScheduledMessage = { message: Message; options?: ScheduleOptions; }; interface ScheduledMessageProcessor { dequeue(): ScheduledMessage[]; } type MessageSubscription = EventSubscription | CommandProcessor; declare const getInMemoryMessageBus: () => MessageBus & EventSubscription & CommandProcessor & ScheduledMessageProcessor; declare const forwardToMessageBus: (eventPublisher: EventsPublisher) => AfterEventStoreCommitHandler; declare const GlobalStreamCaughtUpType = "__emt:GlobalStreamCaughtUp"; type GlobalStreamCaughtUp = Event<'__emt:GlobalStreamCaughtUp', { globalPosition: bigint; }, { globalPosition: bigint; }>; declare const isGlobalStreamCaughtUp: (event: Event) => event is GlobalStreamCaughtUp; declare const caughtUpEventFrom: (position: bigint) => (event: ReadEvent) => event is ReadEvent; declare const globalStreamCaughtUp: (data: EventDataOf) => GlobalStreamCaughtUp; declare const isSubscriptionEvent: (event: Event) => event is GlobalSubscriptionEvent; declare const isNotInternalEvent: (event: Event) => boolean; type GlobalSubscriptionEvent = GlobalStreamCaughtUp; /** TypeScript Omit (Exclude to be specific) does not work for objects with an "any" indexed type, and breaks discriminated unions @public */ declare type EnhancedOmit = string extends keyof TRecordOrUnion ? TRecordOrUnion : TRecordOrUnion extends any ? Pick> : never; declare type WithId = EnhancedOmit & { _id: string; }; type WithoutId = Omit; declare type WithVersion = EnhancedOmit & { _version: bigint; }; type WithoutVersion = Omit; type WithIdAndVersion = EnhancedOmit & { _id: string; _version: bigint; }; type Document = Record; type DocumentHandler = (document: T | null) => T | null; type ExpectedDocumentVersionGeneral = 'DOCUMENT_EXISTS' | 'DOCUMENT_DOES_NOT_EXIST' | 'NO_CONCURRENCY_CHECK'; type ExpectedDocumentVersion = bigint | ExpectedDocumentVersionGeneral; type ExpectedDocumentVersionValue = bigint; type DatabaseHandleOptions = { expectedVersion?: ExpectedDocumentVersion; }; type OperationResult = { acknowledged: boolean; successful: boolean; assertSuccessful: (errorMessage?: string) => void; }; interface InsertOneResult extends OperationResult { insertedId: string | null; nextExpectedVersion: bigint; } interface InsertManyResult extends OperationResult { insertedIds: string[]; insertedCount: number; } interface UpdateResult extends OperationResult { matchedCount: number; modifiedCount: number; nextExpectedVersion: bigint; } interface UpdateManyResult extends OperationResult { matchedCount: number; modifiedCount: number; } interface DeleteResult extends OperationResult { matchedCount: number; deletedCount: number; } interface DeleteManyResult extends OperationResult { deletedCount: number; } type DatabaseHandleResult = (InsertOneResult & { document: WithIdAndVersion; }) | (UpdateResult & { document: WithIdAndVersion; }) | (DeleteResult & { document: null; }) | (OperationResult & { document: null; }); type DatabaseHandleOptionErrors = { throwOnOperationFailures?: boolean; } | undefined; declare type OptionalId = EnhancedOmit & { _id?: string; }; declare type OptionalVersion = EnhancedOmit & { _version?: bigint; }; declare type OptionalUnlessRequiredId = TSchema extends { _id: string; } ? TSchema : OptionalId; declare type OptionalUnlessRequiredVersion = TSchema extends { _version: bigint; } ? TSchema : OptionalVersion; declare type OptionalUnlessRequiredIdAndVersion = OptionalUnlessRequiredId & OptionalUnlessRequiredVersion; type InsertOneOptions = { expectedVersion?: Extract; }; type InsertManyOptions = { expectedVersion?: Extract; }; type UpdateOneOptions = { expectedVersion?: Exclude; }; type UpdateManyOptions = { expectedVersion?: Extract; }; type ReplaceOneOptions = { expectedVersion?: Exclude; }; type DeleteOneOptions = { expectedVersion?: Exclude; }; type DeleteManyOptions = { expectedVersion?: Extract; }; type FullId = `${Collection}-${Id}`; interface InMemoryDocumentsCollection { handle: (id: string, handle: DocumentHandler, options?: DatabaseHandleOptions) => Promise>; findOne: (predicate?: Predicate) => Promise; find: (predicate?: Predicate) => Promise; insertOne: (document: OptionalUnlessRequiredIdAndVersion) => Promise; deleteOne: (predicate?: Predicate) => Promise; replaceOne: (predicate: Predicate, document: WithoutId, options?: ReplaceOneOptions) => Promise; } interface InMemoryDatabase { collection: (name: string) => InMemoryDocumentsCollection; } type Predicate = (item: T) => boolean; declare const getInMemoryDatabase: () => InMemoryDatabase; type ProjectionHandlingType = 'inline' | 'async'; type ProjectionHandler = BatchRecordedMessageHandlerWithContext; type TruncateProjection = (context: ProjectionHandlerContext) => Promise; type ProjectionInitOptions = { version: number; status?: 'active' | 'inactive'; registrationType: ProjectionHandlingType; context: ProjectionHandlerContext; }; interface ProjectionDefinition { name?: string; version?: number; kind?: string; canHandle: CanHandle; handle: ProjectionHandler; truncate?: TruncateProjection; init?: (options: ProjectionInitOptions) => void | Promise; eventsOptions?: { schema?: EventStoreReadSchemaOptions; }; } type ProjectionRegistration = { type: HandlingType; projection: ProjectionDefinition; }; declare const filterProjections: (type: ProjectionHandlingType, projections: ProjectionRegistration[]) => ProjectionDefinition[]; declare const projection: (definition: ProjectionDefinition) => ProjectionDefinition; declare const inlineProjections: (definitions: ProjectionDefinition[]) => ProjectionRegistration<"inline", ReadEventMetadataType, ProjectionHandlerContext>[]; declare const asyncProjections: (definitions: ProjectionDefinition[]) => ProjectionRegistration<"inline", ReadEventMetadataType, ProjectionHandlerContext>[]; declare const projections: { inline: (definitions: ProjectionDefinition[]) => ProjectionRegistration<"inline", ReadEventMetadataType, ProjectionHandlerContext>[]; async: (definitions: ProjectionDefinition[]) => ProjectionRegistration<"inline", ReadEventMetadataType, ProjectionHandlerContext>[]; }; declare const InMemoryEventStoreDefaultStreamVersion = 0n; type InMemoryEventStore = EventStore & { database: InMemoryDatabase; }; type InMemoryReadEventMetadata = ReadEventMetadataWithGlobalPosition; type InMemoryProjectionHandlerContext = { eventStore?: InMemoryEventStore; database?: InMemoryDatabase; }; type InMemoryEventStoreOptions = DefaultEventStoreOptions & { projections?: ProjectionRegistration<'inline', InMemoryReadEventMetadata, InMemoryProjectionHandlerContext>[]; database?: InMemoryDatabase; }; type InMemoryReadEvent = ReadEvent; declare const getInMemoryEventStore: (eventStoreOptions?: InMemoryEventStoreOptions) => InMemoryEventStore; declare const DATABASE_REQUIRED_ERROR_MESSAGE = "Database is required in context for InMemory projections"; type InMemoryProjectionDefinition = ProjectionDefinition; type InMemoryProjectionHandlerOptions = { projections: InMemoryProjectionDefinition[]; events: ReadEvent[]; database: InMemoryDatabase; eventStore?: InMemoryProjectionHandlerContext['eventStore']; }; /** * Handles projections for the InMemoryEventStore * Similar to the PostgreSQL implementation, this processes events through projections */ declare const handleInMemoryProjections: (options: InMemoryProjectionHandlerOptions) => Promise; type InMemoryWithNotNullDocumentEvolve, EventType extends Event> = (document: DocumentType, event: ReadEvent) => DocumentType | null; type InMemoryWithNullableDocumentEvolve, EventType extends Event> = (document: DocumentType | null, event: ReadEvent) => DocumentType | null; type InMemoryDocumentEvolve, EventType extends Event> = InMemoryWithNotNullDocumentEvolve | InMemoryWithNullableDocumentEvolve; type InMemoryProjectionOptions = { handle: (events: ReadEvent[], context: InMemoryProjectionHandlerContext & { database: InMemoryDatabase; }) => Promise; canHandle: CanHandle; truncate?: TruncateProjection; }; /** * Creates an InMemory projection */ declare const inMemoryProjection: ({ truncate, handle, canHandle, }: InMemoryProjectionOptions) => InMemoryProjectionDefinition; /** * Creates a multi-stream projection for InMemoryDatabase */ type InMemoryMultiStreamProjectionOptions, EventType extends Event> = { canHandle: CanHandle; collectionName: string; getDocumentId: (event: ReadEvent) => string; } & ({ evolve: InMemoryWithNullableDocumentEvolve; } | { evolve: InMemoryWithNotNullDocumentEvolve; initialState: () => DocumentType; }); /** * Creates a projection that handles events across multiple streams */ declare const inMemoryMultiStreamProjection: , EventType extends Event>(options: InMemoryMultiStreamProjectionOptions) => InMemoryProjectionDefinition; /** * Creates a single-stream projection for InMemoryDatabase */ type InMemorySingleStreamProjectionOptions, EventType extends Event> = { canHandle: CanHandle; getDocumentId?: (event: ReadEvent) => string; collectionName: string; } & ({ evolve: InMemoryWithNullableDocumentEvolve; } | { evolve: InMemoryWithNotNullDocumentEvolve; initialState: () => DocumentType; }); /** * Creates a projection that handles events from a single stream */ declare const inMemorySingleStreamProjection: , EventType extends Event>(options: InMemorySingleStreamProjectionOptions) => InMemoryProjectionDefinition; declare class AssertionError extends Error { constructor(message: string); } declare const isSubset: (superObj: unknown, subObj: unknown) => boolean; declare const assertFails: (message?: string) => never; declare const assertThrowsAsync: (fun: () => Promise, errorCheck?: (error: Error) => boolean) => Promise; declare const assertThrows: (fun: () => void, errorCheck?: (error: Error) => boolean) => TError; declare const assertDoesNotThrow: (fun: () => void, errorCheck?: (error: Error) => boolean) => TError | null; declare const assertRejects: (promise: Promise, errorCheck?: ((error: TError) => boolean) | TError) => Promise; declare const assertMatches: (actual: unknown, expected: unknown, message?: string) => void; declare const assertDeepEqual: (actual: T, expected: T, message?: string) => void; declare const assertNotDeepEqual: (actual: T, expected: T, message?: string) => void; declare const assertThat: (item: T) => { isEqualTo: (other: T) => void; }; declare const assertDefined: (value: unknown, message?: string | Error) => asserts value; declare function assertFalse(condition: boolean, message?: string): asserts condition is false; declare function assertTrue(condition: boolean, message?: string): asserts condition is true; declare function assertOk(obj: T | null | undefined, message?: string): asserts obj is T; declare function assertEqual(expected: T | null | undefined, actual: T | null | undefined, message?: string): void; declare function assertNotEqual(obj: T | null | undefined, other: T | null | undefined, message?: string): void; declare function assertIsNotNull(result: T | null): asserts result is T; declare function assertIsNull(result: T | null): asserts result is null; type Call = { arguments: unknown[]; result: unknown; target: unknown; this: unknown; }; type ArgumentMatcher = (arg: unknown) => boolean; declare const argValue: (value: T) => ArgumentMatcher; declare const argMatches: (matches: (arg: T) => boolean) => ArgumentMatcher; type MockedFunction = Function & { mock?: { calls: Call[]; }; }; declare function verifyThat(fn: MockedFunction): { calledTimes: (times: number) => void; notCalled: () => void; called: () => void; calledWith: (...args: unknown[]) => void; calledOnceWith: (...args: unknown[]) => void; calledWithArgumentMatching: (...matches: ArgumentMatcher[]) => void; notCalledWithArgumentMatching: (...matches: ArgumentMatcher[]) => void; }; declare const assertThatArray: (array: T[]) => { isEmpty: () => void; isNotEmpty: () => void; hasSize: (length: number) => void; containsElements: (other: T[]) => void; containsElementsMatching: (other: T[]) => void; containsOnlyElementsMatching: (other: T[]) => void; containsExactlyInAnyOrder: (other: T[]) => void; containsExactlyInAnyOrderElementsOf: (other: T[]) => void; containsExactlyElementsOf: (other: T[]) => void; containsExactly: (elem: T) => void; contains: (elem: T) => void; containsOnlyOnceElementsOf: (other: T[]) => void; containsAnyOf: (other: T[]) => void; allMatch: (matches: (item: T) => boolean) => void; anyMatches: (matches: (item: T) => boolean) => void; allMatchAsync: (matches: (item: T) => Promise) => Promise; }; type ErrorCheck = (error: ErrorType) => boolean; type ThenThrows = (() => void) | ((errorConstructor: ErrorConstructor) => void) | ((errorCheck: ErrorCheck) => void) | ((errorConstructor: ErrorConstructor, errorCheck?: ErrorCheck) => void); type AsyncDeciderSpecification = (givenEvents: Event | Event[]) => { when: (command: Command) => { then: (expectedEvents: Event | Event[]) => Promise; thenNothingHappened: () => Promise; thenThrows: (...args: Parameters>) => Promise; }; }; type DeciderSpecification = (givenEvents: Event | Event[]) => { when: (command: Command) => { then: (expectedEvents: Event | Event[]) => void; thenNothingHappened: () => void; thenThrows: (...args: Parameters>) => void; }; }; declare const DeciderSpecification: { for: typeof deciderSpecificationFor; }; declare function deciderSpecificationFor(decider: { decide: (command: Command, state: State) => Event | Event[]; evolve: (state: State, event: Event) => State; initialState: () => State; }): DeciderSpecification; declare function deciderSpecificationFor(decider: { decide: (command: Command, state: State) => Promise; evolve: (state: State, event: Event) => State; initialState: () => State; }): AsyncDeciderSpecification; type TestEventStream = [ string, EventType[] ]; type EventStoreWrapper = Store & { appendedEvents: Map; setup(streamName: string, events: EventType[]): Promise>>; }; declare const WrapEventStore: (eventStore: Store) => EventStoreWrapper; type DocumentWithId = Document & { _id?: string | number; }; type InMemoryProjectionSpecEvent = EventType & { metadata?: Partial; }; type InMemoryProjectionSpecWhenOptions = { numberOfTimes: number; }; type InMemoryProjectionAssert = (options: { database: InMemoryDatabase; }) => Promise; type InMemoryProjectionSpecOptions = { projection: InMemoryProjectionDefinition; }; type InMemoryProjectionSpec = (givenEvents: InMemoryProjectionSpecEvent[]) => { when: (events: InMemoryProjectionSpecEvent[], options?: InMemoryProjectionSpecWhenOptions) => { then: (assert: InMemoryProjectionAssert, message?: string) => Promise; thenThrows: (...args: Parameters>) => Promise; }; }; declare const InMemoryProjectionSpec: { for: (options: InMemoryProjectionSpecOptions) => InMemoryProjectionSpec; }; declare const eventInStream: (streamName: string, event: InMemoryProjectionSpecEvent) => InMemoryProjectionSpecEvent; declare const eventsInStream: (streamName: string, events: InMemoryProjectionSpecEvent[]) => InMemoryProjectionSpecEvent[]; declare const newEventsInStream: (streamName: string, events: InMemoryProjectionSpecEvent[]) => InMemoryProjectionSpecEvent[]; declare function documentExists(expected: Partial, options: { inCollection: string; withId: string | number; }): InMemoryProjectionAssert; declare const expectInMemoryDocuments: { fromCollection: (collectionName: string) => { withId: (id: string | number) => { toBeEqual: (expected: Partial) => InMemoryProjectionAssert; }; }; }; type MessageDowncast = ((message: RecordedMessage) => RecordedMessage) | ((message: MessageType) => MessagePayloadType); declare const downcastRecordedMessage: (recordedMessage: RecordedMessage | MessageType, options?: { downcast?: MessageDowncast; }) => RecordedMessage; declare const downcastRecordedMessages: (recordedMessages: RecordedMessage[] | MessageType[], options?: { downcast?: MessageDowncast; }) => RecordedMessage[]; type MessageUpcast = ((message: MessagePayloadType) => MessageType) | ((message: RecordedMessage) => RecordedMessage); declare const upcastRecordedMessage: (recordedMessage: RecordedMessage | MessagePayloadType, options?: { upcast?: MessageUpcast; }) => RecordedMessage; declare const upcastRecordedMessages: (recordedMessages: RecordedMessage[] | MessagePayloadType[], options?: { upcast?: MessageUpcast; }) => RecordedMessage[]; type Closeable = { /** * Gracefully cleans up managed resources * * @memberof Closeable */ close: () => Promise; }; declare const merge: (array: T[], item: T, where: (current: T) => boolean, onExisting: (current: T) => T, onNotFound?: () => T | undefined) => T[]; declare const arrayUtils: { merge: (array: T[], item: T, where: (current: T) => boolean, onExisting: (current: T) => T, onNotFound?: () => T | undefined) => T[]; hasDuplicates: (array: ArrayItem[], predicate: (value: ArrayItem, index: number, array: ArrayItem[]) => Mapped) => boolean; getDuplicates: (array: ArrayItem[], predicate: (value: ArrayItem, index: number, array: ArrayItem[]) => Mapped) => ArrayItem[]; }; declare const deepEquals: (left: T, right: T) => boolean; type Equatable = { equals: (right: T) => boolean; } & T; declare const isEquatable: (left: T) => left is Equatable; declare const sum: (iterator: Iterator | Iterator) => number; type LockOptions = { lockId: number; }; type AcquireLockOptions = { lockId: string; }; type ReleaseLockOptions = { lockId: string; }; type Lock = { acquire(options: AcquireLockOptions): Promise; tryAcquire(options: AcquireLockOptions): Promise; release(options: ReleaseLockOptions): Promise; withAcquire: (handle: () => Promise, options: AcquireLockOptions) => Promise; }; declare const InProcessLock: () => Lock; declare const toNormalizedString: (value: bigint) => string; declare const bigInt: { toNormalizedString: (value: bigint) => string; }; declare const delay: (ms: number) => Promise; type AsyncAwaiter = { wait: Promise; resolve: (value: T | PromiseLike) => void; reject: (reason?: any) => void; reset: () => void; }; declare const asyncAwaiter: () => AsyncAwaiter; type AsyncRetryOptions = retry.Options & { shouldRetryResult?: (result: T) => boolean; shouldRetryError?: (error?: unknown) => boolean; }; declare const NoRetries: AsyncRetryOptions; declare const asyncRetry: (fn: () => Promise, opts?: AsyncRetryOptions) => Promise; type ShutdownHandler = () => void | Promise; /** * Registers handlers for OS signals to enable graceful shutdown. * Handles SIGTERM and SIGINT by default. * Works in Node.js, Bun, and Deno. Safely no-ops in Browser/Cloudflare Workers. * * @param handler - Function to call when shutdown signal is received * @returns Cleanup function to unregister the handlers */ declare const onShutdown: (handler: ShutdownHandler) => (() => void); declare const hashText: (text: string) => Promise; declare const CommandHandlerStreamVersionConflictRetryOptions: AsyncRetryOptions; type CommandHandlerRetryOptions = AsyncRetryOptions | { onVersionConflict: true | number | AsyncRetryOptions; }; type CommandHandlerResult = AppendStreamResultOfEventStore & { newState: State; newEvents: StreamEvent[]; }; type CommandHandlerOptions = { evolve: (state: State, event: StreamEvent) => State; initialState: () => State; mapToStreamId?: (id: string) => string; retry?: CommandHandlerRetryOptions; schema?: { versioning?: { upcast?: (event: StoredEvent) => StreamEvent; downcast?: (event: StreamEvent) => StoredEvent; }; }; }; type HandleOptions = Parameters[2] & ({ expectedStreamVersion?: ExpectedStreamVersion>; } | { retry?: CommandHandlerRetryOptions; }); type CommandHandlerFunction = (state: State) => StreamEvent | StreamEvent[] | Promise; declare const CommandHandler: (options: CommandHandlerOptions) => (store: Store, id: string, handle: CommandHandlerFunction | CommandHandlerFunction[], handleOptions?: HandleOptions) => Promise>; type DeciderCommandHandlerOptions = CommandHandlerOptions & Decider; declare const DeciderCommandHandler: (options: DeciderCommandHandlerOptions) => (eventStore: Store, id: string, commands: CommandType | CommandType[], handleOptions?: HandleOptions) => Promise>; type CurrentMessageProcessorPosition = { lastCheckpoint: CheckpointType; } | 'BEGINNING' | 'END'; type GetCheckpoint> = (message: RecordedMessage) => CheckpointType | null; declare const getCheckpoint: >(message: RecordedMessage) => CheckpointType | null; declare const wasMessageHandled: >(message: RecordedMessage, checkpoint: CheckpointType | null) => boolean; type MessageProcessorStartFrom = CurrentMessageProcessorPosition | 'CURRENT'; type MessageProcessorType = 'projector' | 'reactor'; declare const MessageProcessorType: { PROJECTOR: MessageProcessorType; REACTOR: MessageProcessorType; }; type MessageProcessor> = { id: string; instanceId: string; type: string; init: (options: Partial) => Promise; start: (options: Partial) => Promise | undefined>; close: (closeOptions: Partial) => Promise; isActive: boolean; handle: BatchRecordedMessageHandlerWithContext>; }; declare const MessageProcessor: { result: { skip: (options?: { reason?: string; }) => MessageHandlerResult; stop: (options?: { reason?: string; error?: EmmettError; }) => MessageHandlerResult; }; }; type MessageProcessingScope = (handler: (context: HandlerContext) => Result | Promise, partialContext: Partial) => Result | Promise; type Checkpointer> = { read: ReadProcessorCheckpoint; store: StoreProcessorCheckpoint; }; type ProcessorHooks = { onInit?: OnReactorInitHook; onStart?: OnReactorStartHook; onClose?: OnReactorCloseHook; }; type BaseMessageProcessorOptions> = { type?: string; processorId: string; processorInstanceId?: string; version?: number; partition?: string; startFrom?: MessageProcessorStartFrom; stopAfter?: (message: RecordedMessage) => boolean; processingScope?: MessageProcessingScope; checkpoints?: Checkpointer; canHandle?: CanHandle; hooks?: ProcessorHooks; }; type HandlerOptions = { eachMessage: SingleRecordedMessageHandlerWithContext; eachBatch?: never; } | { eachMessage?: never; eachBatch: BatchRecordedMessageHandlerWithContext; }; type OnReactorInitHook = (context: HandlerContext) => Promise; type OnReactorStartHook = (context: HandlerContext) => Promise; type OnReactorCloseHook = (context: HandlerContext) => Promise; type ReactorOptions, MessagePayloadType extends AnyMessage = MessageType> = BaseMessageProcessorOptions & HandlerOptions & { messageOptions?: { schema?: { versioning?: { upcast?: (event: MessagePayloadType) => MessageType; }; }; }; }; type ProjectorOptions, EventPayloadType extends Event = EventType> = Omit, 'type' | 'processorId'> & { processorId?: string; } & { truncateOnStart?: boolean; projection: ProjectionDefinition; }; declare const defaultProcessingMessageProcessingScope: (handler: (context: HandlerContext) => Result | Promise, partialContext: Partial) => Result | Promise; type ReadProcessorCheckpointResult = { lastCheckpoint: CheckpointType | null; }; type ReadProcessorCheckpoint = (options: { processorId: string; partition?: string; }, context: HandlerContext) => Promise>; type StoreProcessorCheckpointResult = { success: true; newCheckpoint: CheckpointType; } | { success: false; reason: 'IGNORED' | 'MISMATCH' | 'CURRENT_AHEAD'; }; type StoreProcessorCheckpoint = ((options: { message: RecordedMessage; processorId: string; version: number | undefined; lastCheckpoint: CheckpointType | null; partition?: string; }, context: HandlerContext) => Promise>) | ((options: { message: RecordedMessage; processorId: string; version: number | undefined; lastCheckpoint: CheckpointType | null; partition?: string; }, context: HandlerContext) => Promise>); declare const defaultProcessorVersion = 1; declare const defaultProcessorPartition = "emt:default"; declare const getProcessorInstanceId: (processorId: string) => string; declare const getProjectorId: (options: { projectionName: string; }) => string; declare const reactor: , MessagePayloadType extends Message = MessageType>(options: ReactorOptions) => MessageProcessor; declare const projector: , EventPayloadType extends Event = EventType>(options: ProjectorOptions) => MessageProcessor; type InMemoryProcessorHandlerContext = { database: InMemoryDatabase; }; type InMemoryProcessor = MessageProcessor & { database: InMemoryDatabase; }; type InMemoryProcessorEachMessageHandler = SingleRecordedMessageHandlerWithContext; type InMemoryProcessorEachBatchHandler = BatchRecordedMessageHandlerWithContext; type InMemoryProcessorConnectionOptions = { database?: InMemoryDatabase; }; type InMemoryCheckpointer = Checkpointer; declare const inMemoryCheckpointer: () => InMemoryCheckpointer; type InMemoryConnectionOptions = { connectionOptions?: InMemoryProcessorConnectionOptions; }; type InMemoryReactorOptions = ReactorOptions & InMemoryConnectionOptions; type InMemoryProjectorOptions = ProjectorOptions & InMemoryConnectionOptions; type InMemoryProcessorOptions = InMemoryReactorOptions | InMemoryProjectorOptions; declare const inMemoryProjector: (options: InMemoryProjectorOptions) => InMemoryProcessor; declare const inMemoryReactor: (options: InMemoryReactorOptions) => InMemoryProcessor; type MessageConsumerOptions = { consumerId?: string; processors?: Array>; }; type MessageConsumer = Readonly<{ consumerId: string; isRunning: boolean; processors: ReadonlyArray>; start: () => Promise; stop: () => Promise; close: () => Promise; }>; declare class ParseError extends Error { constructor(text: string); } type Mapper = ((value: unknown) => To) | ((value: Partial) => To) | ((value: From) => To) | ((value: Partial) => To) | ((value: To) => To) | ((value: Partial) => To) | ((value: To | From) => To); type MapperArgs = Partial & From & Partial & To; type ParseOptions = { reviver?: (key: string, value: unknown) => unknown; map?: Mapper; typeCheck?: (value: unknown) => value is To; }; type StringifyOptions = { map?: Mapper; }; declare const JSONParser: { stringify: (value: From, options?: StringifyOptions) => string; parse: (text: string, options?: ParseOptions) => To | undefined; }; type TaskQueue = TaskQueueItem[]; type TaskQueueItem = { task: () => Promise; options?: EnqueueTaskOptions; }; type TaskProcessorOptions = { maxActiveTasks: number; maxQueueSize: number; maxTaskIdleTime?: number; }; type Task = (context: TaskContext) => Promise; type TaskContext = { ack: () => void; }; type EnqueueTaskOptions = { taskGroupId?: string; }; declare class TaskProcessor { private options; private queue; private isProcessing; private activeTasks; private activeGroups; constructor(options: TaskProcessorOptions); enqueue(task: Task, options?: EnqueueTaskOptions): Promise; waitForEndOfProcessing(): Promise; private schedule; private ensureProcessing; private processQueue; private executeItem; private takeFirstAvailableItem; private hasItemsToProcess; } declare const formatDateToUtcYYYYMMDD: (date: Date) => string; declare const isValidYYYYMMDD: (dateString: string) => boolean; declare const parseDateFromUtcYYYYMMDD: (dateString: string) => Date; declare const enum ValidationErrors { NOT_A_NONEMPTY_STRING = "NOT_A_NONEMPTY_STRING", NOT_A_POSITIVE_NUMBER = "NOT_A_POSITIVE_NUMBER", NOT_AN_UNSIGNED_BIGINT = "NOT_AN_UNSIGNED_BIGINT" } declare const isNumber: (val: unknown) => val is number; declare const isBigint: (val: any) => val is bigint; declare const isString: (val: unknown) => val is string; declare const assertNotEmptyString: (value: unknown) => string; declare const assertPositiveNumber: (value: unknown) => number; declare const assertUnsignedBigInt: (value: string) => bigint; export { type AcquireLockOptions, type AfterEventStoreCommitHandler, type AggregateStreamOptions, type AggregateStreamResult, type AggregateStreamResultOfEventStore, type AggregateStreamResultWithGlobalPosition, type AnyCommand, type AnyEvent, type AnyMessage, type AnyReadEvent, type AnyReadEventMetadata, type AnyRecord, type AnyRecordedMessage, type AnyRecordedMessageMetadata, type AppendStreamResultOfEventStore, type AppendToStreamOptions, type AppendToStreamResult, type AppendToStreamResultWithGlobalPosition, type ArgumentMatcher, AssertionError, type AsyncAwaiter, type AsyncDeciderSpecification, type AsyncRetryOptions, type BaseMessageProcessorOptions, type BatchMessageHandler, type BatchMessageHandlerWithContext, type BatchMessageHandlerWithoutContext, type BatchRawMessageHandlerWithContext, type BatchRawMessageHandlerWithoutContext, type BatchRecordedMessageHandlerWithContext, type BatchRecordedMessageHandlerWithoutContext, type BeforeEventStoreCommitHandler, type BigIntGlobalPosition, type BigIntStreamPosition, type Brand, type CanHandle, type Checkpointer, type Closeable, type CombineMetadata, type CombinedMessageMetadata, type CombinedReadEventMetadata, type Command, type CommandBus, type CommandDataOf, CommandHandler, type CommandHandlerOptions, type CommandHandlerResult, type CommandHandlerRetryOptions, CommandHandlerStreamVersionConflictRetryOptions, type CommandMetaDataOf, type CommandProcessor, type CommandSender, type CommandTypeOf, type CommonReadEventMetadata, type CommonRecordedMessageMetadata, ConcurrencyError, type CreateCommandType, type CreateEventType, type CurrentMessageProcessorPosition, DATABASE_REQUIRED_ERROR_MESSAGE, type DatabaseHandleOptionErrors, type DatabaseHandleOptions, type DatabaseHandleResult, type Decider, DeciderCommandHandler, type DeciderCommandHandlerOptions, DeciderSpecification, type DeepReadonly, type DefaultCommandMetadata, type DefaultEventStoreOptions, type DefaultRecord, type DeleteManyOptions, type DeleteManyResult, type DeleteOneOptions, type DeleteResult, type Document, type DocumentHandler, EmmettError, type EnhancedOmit, type EnqueueTaskOptions, type Equatable, ErrorConstructor, type Event, type EventBus, type EventDataOf, type EventMetaDataOf, type EventStore, type EventStoreAppendSchemaOptions, type EventStoreReadEventMetadata, type EventStoreReadSchemaOptions, type EventStoreSchemaOptions, type EventStoreSession, type EventStoreSessionFactory, type EventStoreWrapper, type EventSubscription, type EventTypeOf, type EventsPublisher, type ExpectedDocumentVersion, type ExpectedDocumentVersionGeneral, type ExpectedDocumentVersionValue, type ExpectedStreamVersion, type ExpectedStreamVersionGeneral, type ExpectedStreamVersionWithValue, ExpectedVersionConflictError, type Flavour, type FullId, type GetCheckpoint, type GlobalPositionTypeOfEventStore, type GlobalPositionTypeOfReadEventMetadata, type GlobalPositionTypeOfRecordedMessageMetadata, type GlobalStreamCaughtUp, GlobalStreamCaughtUpType, type GlobalSubscriptionEvent, type HandleOptions, type HandlerOptions, type InMemoryCheckpointer, type InMemoryDatabase, type InMemoryDocumentEvolve, type InMemoryDocumentsCollection, type InMemoryEventStore, InMemoryEventStoreDefaultStreamVersion, type InMemoryEventStoreOptions, type InMemoryMultiStreamProjectionOptions, type InMemoryProcessor, type InMemoryProcessorConnectionOptions, type InMemoryProcessorEachBatchHandler, type InMemoryProcessorEachMessageHandler, type InMemoryProcessorHandlerContext, type InMemoryProcessorOptions, type InMemoryProjectionAssert, type InMemoryProjectionDefinition, type InMemoryProjectionHandlerContext, type InMemoryProjectionHandlerOptions, type InMemoryProjectionOptions, InMemoryProjectionSpec, type InMemoryProjectionSpecEvent, type InMemoryProjectionSpecOptions, type InMemoryProjectionSpecWhenOptions, type InMemoryProjectorOptions, type InMemoryReactorOptions, type InMemoryReadEvent, type InMemoryReadEventMetadata, type InMemorySingleStreamProjectionOptions, type InMemoryWithNotNullDocumentEvolve, type InMemoryWithNullableDocumentEvolve, InProcessLock, type InsertManyOptions, type InsertManyResult, type InsertOneOptions, type InsertOneResult, JSONParser, type Lock, type LockOptions, type Mapper, type MapperArgs, type Message, type MessageBus, type MessageConsumer, type MessageConsumerOptions, type MessageDataOf, type MessageDowncast, type MessageHandler, type MessageHandlerResult, type MessageKindOf, type MessageMetaDataOf, type MessageProcessingScope, MessageProcessor, type MessageProcessorStartFrom, MessageProcessorType, type MessageScheduler, type MessageSubscription, type MessageTypeOf, type MessageUpcast, type MockedFunction, type Mutable, NO_CONCURRENCY_CHECK, NoRetries, type NonNullable$1 as NonNullable, type OnReactorCloseHook, type OnReactorInitHook, type OnReactorStartHook, type OperationResult, type OptionalId, type OptionalUnlessRequiredId, type OptionalUnlessRequiredIdAndVersion, type OptionalUnlessRequiredVersion, type OptionalVersion, ParseError, type ParseOptions, type ProcessorHooks, type ProjectionDefinition, type ProjectionHandler, type ProjectionHandlingType, type ProjectionInitOptions, type ProjectionRegistration, type ProjectorOptions, type ReactorOptions, type ReadEvent, type ReadEventMetadata, type ReadEventMetadataWithGlobalPosition, type ReadEventMetadataWithoutGlobalPosition, type ReadProcessorCheckpoint, type ReadProcessorCheckpointResult, type ReadStreamOptions, type ReadStreamResult, type RecordedMessage, type RecordedMessageMetadata, type RecordedMessageMetadataWithGlobalPosition, type RecordedMessageMetadataWithoutGlobalPosition, type ReleaseLockOptions, type ReplaceOneOptions, STREAM_DOES_NOT_EXIST, STREAM_EXISTS, type ScheduleOptions, type ScheduledMessage, type ScheduledMessageProcessor, type ShutdownHandler, type SingleMessageHandler, type SingleMessageHandlerWithContext, type SingleMessageHandlerWithoutContext, type SingleRawMessageHandlerWithContext, type SingleRawMessageHandlerWithoutContext, type SingleRecordedMessageHandlerWithContext, type SingleRecordedMessageHandlerWithoutContext, type StoreProcessorCheckpoint, type StoreProcessorCheckpointResult, type StreamExistsResult, type StreamPositionTypeOfEventStore, type StreamPositionTypeOfReadEventMetadata, type StreamPositionTypeOfRecordedMessageMetadata, type StringifyOptions, type Task, type TaskContext, TaskProcessor, type TaskProcessorOptions, type TaskQueue, type TaskQueueItem, type TestEventStream, type ThenThrows, type TruncateProjection, type UpdateManyOptions, type UpdateManyResult, type UpdateOneOptions, type UpdateResult, ValidationErrors, type WithGlobalPosition, type WithId, type WithIdAndVersion, type WithVersion, type WithoutId, type WithoutVersion, type Workflow, type WorkflowCommand, type WorkflowEvent, type WorkflowOutput, WrapEventStore, accept, argMatches, argValue, arrayUtils, assertDeepEqual, assertDefined, assertDoesNotThrow, assertEqual, assertExpectedVersionMatchesCurrent, assertFails, assertFalse, assertIsNotNull, assertIsNull, assertMatches, assertNotDeepEqual, assertNotEmptyString, assertNotEqual, assertOk, assertPositiveNumber, assertRejects, assertThat, assertThatArray, assertThrows, assertThrowsAsync, assertTrue, assertUnsignedBigInt, asyncAwaiter, asyncProjections, asyncRetry, bigInt, canCreateEventStoreSession, caughtUpEventFrom, command, complete, deepEquals, defaultProcessingMessageProcessingScope, defaultProcessorPartition, defaultProcessorVersion, defaultTag, delay, documentExists, downcastRecordedMessage, downcastRecordedMessages, emmettPrefix, error, event, eventInStream, eventsInStream, expectInMemoryDocuments, filterProjections, formatDateToUtcYYYYMMDD, forwardToMessageBus, getCheckpoint, getInMemoryDatabase, getInMemoryEventStore, getInMemoryMessageBus, getProcessorInstanceId, getProjectorId, globalStreamCaughtUp, globalTag, handleInMemoryProjections, hashText, ignore, inMemoryCheckpointer, inMemoryMultiStreamProjection, inMemoryProjection, inMemoryProjector, inMemoryReactor, inMemorySingleStreamProjection, inlineProjections, isBigint, isEquatable, isExpectedVersionConflictError, isGlobalStreamCaughtUp, isNotInternalEvent, isNumber, isString, isSubscriptionEvent, isSubset, isValidYYYYMMDD, matchesExpectedVersion, merge, message, newEventsInStream, nulloSessionFactory, onShutdown, parseDateFromUtcYYYYMMDD, projection, projections, projector, publish, reactor, reply, schedule, send, sum, toNormalizedString, tryPublishMessagesAfterCommit, unknownTag, upcastRecordedMessage, upcastRecordedMessages, verifyThat, wasMessageHandled };