New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event source concept #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have commented all the places where the Guid should come back if it needs to
@@ -193,7 +193,7 @@ export class EventStore extends IEventStore { | |||
return new CommittedAggregateEvents(eventSourceId, aggregateRootId, ...convertedEvents); | |||
} | |||
|
|||
private toUncommittedEvent(content: any, eventSourceId: EventSourceId | Guid | string, eventTypeOrId?: EventType | EventTypeId | Guid | string, isPublic = false): UncommittedEvent { | |||
private toUncommittedEvent(content: any, eventSourceId: EventSourceId | string, eventTypeOrId?: EventType | EventTypeId | Guid | string, isPublic = false): UncommittedEvent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's bring the Guid conversions back until we get the poll data :)
*/ | ||
fromProducerPartition(partitionId: PartitionId | Guid | string): SubscriptionBuilderForProducerPartition { | ||
fromProducerPartition(partitionId: PartitionId | string): SubscriptionBuilderForProducerPartition { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guid here
@@ -13,9 +13,9 @@ export class PartitionedFilterResult { | |||
/** | |||
* Initializes a new instance of {@link PartitionedFilterResult}. | |||
* @param {boolean} shouldInclude Tells whether or not the event should be included. | |||
* @param {PartitionId | Guid | string} partitionId Tells which partition the event should be partitioned into. | |||
* @param {PartitionId | string} partitionId Tells which partition the event should be partitioned into. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guid here
@@ -31,8 +31,8 @@ export class EventSourceId extends ConceptAs<Guid, '@dolittle/sdk.events.EventSo | |||
* @param {EventSourceId | Guid | string)} id | |||
* @returns {EventSourceId} | |||
*/ | |||
static from(id: EventSourceId | Guid | string): EventSourceId { | |||
static from(id: EventSourceId | string): EventSourceId { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guid here
commit(event: any, eventSourceId: EventSourceId | string, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult>; | ||
commit(eventOrEvents: UncommittedEvent | UncommittedEvent[], cancellation?: Cancellation): Promise<CommitEventsResult>; | ||
commit(eventOrEvents: any, eventSourceIdOrCancellation?: EventSourceId | Guid | string | Cancellation, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult> { | ||
commit(eventOrEvents: any, eventSourceIdOrCancellation?: EventSourceId | string | Cancellation, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guid here
return this.commitInternal([this.toUncommittedEvent(eventOrEvents, eventSourceId, eventType, false)], cancellation); | ||
} | ||
|
||
/** @inheritdoc */ | ||
commitPublic(event: any, eventSourceId: EventSourceId | Guid | string, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult> { | ||
commitPublic(event: any, eventSourceId: EventSourceId | string, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitEventsResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guid here
commitForAggregate(event: any, eventSourceId: EventSourceId | string, aggregateRootId: AggregateRootId, expectedAggregateRootVersion: AggregateRootVersion, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitAggregateEventsResult>; | ||
commitForAggregate(events: UncommittedAggregateEvents, cancellation?: Cancellation): Promise<CommitAggregateEventsResult>; | ||
commitForAggregate(eventOrEvents: any, eventSourceIdOrCancellation?: EventSourceId | Guid | string | Cancellation, aggregateRootId?: AggregateRootId, expectedAggregateRootVersion?: AggregateRootVersion, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitAggregateEventsResult> { | ||
commitForAggregate(eventOrEvents: any, eventSourceIdOrCancellation?: EventSourceId | string | Cancellation, aggregateRootId?: AggregateRootId, expectedAggregateRootVersion?: AggregateRootVersion, eventType?: EventType | EventTypeId | Guid | string, cancellation?: Cancellation): Promise<CommitAggregateEventsResult> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guid here
Merging this in as I've said that I will fix the SDK that is in the wrong :) |
…ing Contracts v6.0.0, and fix little Embedding bug (#61) * Add eventsource prerelease branch * Event source concept (#62) * Update references to contracts * Change partition and event source id to be string instead of guid and fix all build errors * "Update packages and workspace dependencies to 18.0.0-eventsource.0" * Revert Guid types for event source id and partition id (#63) * "Update packages and workspace dependencies to 18.0.0-eventsource.1" * Upgrade contracts to released 6.0.0 (#64) * Upgrade to released 6.0.0 contracts * Fix references to event types * "Update packages and workspace dependencies to 18.0.0-eventsource.2" * Fix a little non breaking space * Fix some small typing issues. * Fix bug when returning multiple events from an embedding update/delete. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jakob Høgenes <1014990+jakhog@users.noreply.github.com>
Summary
Update to new contracts that changes partition and event source id to be a string instead of a guid. Fix all build errors that