@@ -18,7 +18,7 @@ import { IEventStore } from './IEventStore';
1818import { EventSourceId } from './EventSourceId' ;
1919import { UncommittedEvent } from './UncommittedEvent' ;
2020import { EventConverters } from './EventConverters' ;
21- import { CommitEventsResponse } from './CommitEventsResponse ' ;
21+ import { CommitEventsResult } from './CommitEventsResult ' ;
2222import { Guid } from '@dolittle/rudiments' ;
2323
2424/**
@@ -41,9 +41,9 @@ export class EventStore implements IEventStore {
4141 }
4242
4343 /** @inheritdoc */
44- commit ( event : any , eventSourceId : Guid | string , eventType ?: EventType | Guid | string , cancellation ?: Cancellation ) : Promise < CommitEventsResponse > ;
45- commit ( events : UncommittedEvent [ ] , cancellation ?: Cancellation ) : Promise < CommitEventsResponse > ;
46- commit ( eventOrEvents : any , eventSourceIdOrCancellation ?: Guid | string | Cancellation , eventType ?: EventType | Guid | string , cancellation ?: Cancellation ) : Promise < CommitEventsResponse > {
44+ commit ( event : any , eventSourceId : Guid | string , eventType ?: EventType | Guid | string , cancellation ?: Cancellation ) : Promise < CommitEventsResult > ;
45+ commit ( events : UncommittedEvent [ ] , cancellation ?: Cancellation ) : Promise < CommitEventsResult > ;
46+ commit ( eventOrEvents : any , eventSourceIdOrCancellation ?: Guid | string | Cancellation , eventType ?: EventType | Guid | string , cancellation ?: Cancellation ) : Promise < CommitEventsResult > {
4747 if ( this . isArrayOfUncommittedEvents ( eventOrEvents ) ) {
4848 return this . commitInternal ( eventOrEvents , eventSourceIdOrCancellation as Cancellation ) ;
4949 }
@@ -52,7 +52,7 @@ export class EventStore implements IEventStore {
5252 }
5353
5454 /** @inheritdoc */
55- commitPublic ( event : any , eventSourceId : Guid | string , eventType ?: EventType | Guid | string , cancellation ?: Cancellation ) : Promise < CommitEventsResponse > {
55+ commitPublic ( event : any , eventSourceId : Guid | string , eventType ?: EventType | Guid | string , cancellation ?: Cancellation ) : Promise < CommitEventsResult > {
5656 const events : UncommittedEvent [ ] = [ this . toUncommittedEvent ( event , eventSourceId , eventType , true ) ] ;
5757 return this . commitInternal ( events , cancellation ) ;
5858 }
@@ -61,7 +61,7 @@ export class EventStore implements IEventStore {
6161 return Array . isArray ( eventOrEvents ) && eventOrEvents . length > 0 && eventOrEvents [ 0 ] . eventSourceId && eventOrEvents [ 0 ] . content ;
6262 }
6363
64- private async commitInternal ( events : UncommittedEvent [ ] , cancellation = Cancellation . default ) : Promise < CommitEventsResponse > {
64+ private async commitInternal ( events : UncommittedEvent [ ] , cancellation = Cancellation . default ) : Promise < CommitEventsResult > {
6565 const uncommittedEvents = events . map ( event =>
6666 EventConverters . getUncommittedEventFrom (
6767 event . content ,
@@ -76,7 +76,7 @@ export class EventStore implements IEventStore {
7676 return reactiveUnary ( this . _eventStoreClient , this . _eventStoreClient . commit , request , cancellation )
7777 . pipe ( map ( response => {
7878 const committedEvents = new CommittedEvents ( ...response . getEventsList ( ) . map ( event => EventConverters . toSDK ( event ) ) ) ;
79- return new CommitEventsResponse ( committedEvents , failures . toSDK ( response . getFailure ( ) ) ) ;
79+ return new CommitEventsResult ( committedEvents , failures . toSDK ( response . getFailure ( ) ) ) ;
8080 } ) ) . toPromise ( ) ;
8181 }
8282
0 commit comments