CommitStore
Hierarchy
- CommitStore
 
Implements
- CommitStore
 - CommitStore
 
Index
Methods
Methods
createCommit
▸ createCommit(eventSourceable: EventSourceable): Promise‹Commit›
Implementation of CommitStore
Create Commit from event sourceable instance.
async 
Parameters:
| Name | Type | Description | 
|---|---|---|
eventSourceable | EventSourceable | Instance implementing EventSourceable interface. | 
Returns: Promise‹Commit›
Instance implementing Commit interface.
findById
▸ findById(commitId: string): Promise‹Commit | undefined›
Implementation of CommitStore
Returns commit by commit id.
Parameters:
| Name | Type | Description | 
|---|---|---|
commitId | string | Identifier of Commit. | 
Returns: Promise‹Commit | undefined›
Instance implementing Commit interface, else undefined.
generateId
▸ generateId(): Promise‹string›
Implementation of CommitStore
Generates identifier compatible with commit storage.
async 
Returns: Promise‹string›
Identifier for commit compatible with storage implementation.
getAllEvents
▸ getAllEvents(): Promise‹Event[]›
Implementation of CommitStore
Returns events from all existing commits on storage.
async 
Returns: Promise‹Event[]›
List of all published Events.
getEvents
▸ getEvents(eventSourceableId: string | Guid, versionOffset?: number): Promise‹Event[]›
Implementation of CommitStore
Returns all events associated with commits that exceeds or are equal to provided version offset.
async 
Parameters:
| Name | Type | Description | 
|---|---|---|
eventSourceableId | string | Guid | Identifier as string or Guid instance. | 
versionOffset? | number | Version number from which version events should be returned. | 
Returns: Promise‹Event[]›
List of all Events associated with resolved commits for version offset.
hasBySourceId
▸ hasBySourceId(eventSourceableId: string | Guid): Promise‹boolean›
Implementation of CommitStore
Evaluates whether event sourceable with id already exists.
async 
Parameters:
| Name | Type | Description | 
|---|---|---|
eventSourceableId | string | Guid | Identifier as string or Guid instance. | 
Returns: Promise‹boolean›
Returns true if event sourceable exists, else false.
save
▸ save(commit: Commit): Promise‹string›
Implementation of CommitStore
Adds commit to storage and publishes changes.
async 
Parameters:
| Name | Type | Description | 
|---|---|---|
commit | Commit | Instance implementing Commit interface. | 
Returns: Promise‹string›
Identifier of commit on commit storage.