The raw events data to be converted
An array of EventEnvelope objects
Converts raw stream data into an array of EventEnvelope objects.
The Magek configuration object
The context from the raw stream
The deduplicated event stream
An array of EventEnvelope objects
Deduplicates raw events and returns them as an EventStream.
The Magek configuration object
The raw events data to deduplicate
A promise that resolves to a deduplicated EventStream
Produces events to an external event stream (e.g., Kafka).
The name of the entity type
The unique identifier of the entity
The array of EventEnvelope objects to produce
The Magek configuration object
A promise that resolves when events are produced
Retrieves events for a specific entity since a given time
The Magek configuration object
The type name of the entity
The ID of the entity
Optionalsince: stringThe time to retrieve events since (optional)
A promise that resolves to an array of EventEnvelope objects
Retrieves the latest snapshot of an entity
The Magek configuration object
The type name of the entity
The ID of the entity
A promise that resolves to the latest EventEnvelope for the entity, or null if none exist
Searches for events based on specific parameters
The Magek configuration object
The search parameters
A promise that resolves to an array of EventSearchResponse objects
Searches for entities IDs based on a specific entity type and pagination parameters
The Magek configuration object
The maximum number of entities IDs to retrieve
The cursor to retrieve entities IDs after (optional)
The type name of the entities to search for
A promise that resolves to a PaginatedEntitiesIdsResult object
Streams an event to the corresponding event handler
The array of NonPersistedEventEnvelope objects to store
The Magek configuration object
A promise that resolves with the list of EventEnvelopes when the events have been stored
Stores a snapshot of an entity
The NonPersistedEntitySnapshotEnvelope object to store
The Magek configuration object
A promise that resolves with the EntitySnapshotEnvelope when the snapshot has been stored
Stores an event envelope that has been dispatched in the dispatched events table.
The EventEnvelope to store.
The Magek configuration object.
true if the dispatched event was stored, false if the event already exists in the dispatched events
table, throws an error on any other type of error.
Finds all events matching the deletion criteria.
The Magek configuration object
The parameters specifying which events to find for deletion
A promise that resolves to an array of EventEnvelopeFromDatabase objects
Finds all snapshots matching the deletion criteria.
The Magek configuration object
The parameters specifying which snapshots to find for deletion
A promise that resolves to an array of EntitySnapshotEnvelopeFromDatabase objects
Soft-deletes events by marking them with a deletedAt timestamp.
The Magek configuration object
The array of events to delete
A promise that resolves when the events are deleted
Soft-deletes snapshots by marking them with a deletedAt timestamp.
The Magek configuration object
The array of snapshots to delete
A promise that resolves when the snapshots are deleted
OptionalfetchFetches the next batch of unprocessed events. The adapter manages the cursor internally to track processing position. Batch size is read from config.eventProcessingBatchSize.
The Magek configuration object
A promise that resolves to an array of EventEnvelope objects
OptionalmarkMarks a single event as processed and advances the internal cursor. Should be called after each event has been successfully dispatched.
The Magek configuration object
The ID of the event that was processed
A promise that resolves when the event is marked and cursor is updated
OptionalhealthHealth check methods for the event store.
Checks if the event store is up and running.
The Magek configuration object
A promise that resolves to true if the event store is healthy
Gets detailed health information about the event store.
The Magek configuration object
A promise that resolves to health details
Gets the URLs/endpoints of the event store.
The Magek configuration object
A promise that resolves to an array of URL strings
Converts raw events data into an array of EventEnvelope objects