@event-driven-io/emmett-postgresql 0.43.0-beta.3 → 0.43.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,214 +1,266 @@
1
- import { SQLExecutor, Dumbo, QueryResultRow, SQL, SQLMigration, RunSQLMigrationsResult, DatabaseTransaction, AnyConnection, MigrationStyle } from '@event-driven-io/dumbo';
2
- import * as _event_driven_io_emmett from '@event-driven-io/emmett';
3
- import { EmmettError, Message, BatchRecordedMessageHandlerWithoutContext, ReadEventMetadataWithGlobalPosition, ProcessorCheckpoint, ProjectionHandlingType, AnyReadEventMetadata, DefaultRecord, ProjectionRegistration, ProjectionDefinition, Event, ReadEvent, CanHandle, TruncateProjection, EventStoreReadSchemaOptions, ThenThrows, RecordedMessage, AppendToStreamOptions, RecordedMessageMetadata, RecordedMessageMetadataWithGlobalPosition, ReadStreamOptions, ReadStreamResult, StreamExistsResult, ProjectionHandler, ProjectionInitOptions, EventStore, EventStoreSessionFactory, AppendToStreamResultWithGlobalPosition, AnyMessage, ReactorOptions, MessageProcessor, AnyEvent, AnyCommand, AnyRecordedMessageMetadata, WorkflowProcessorContext, WorkflowProcessorOptions, ProjectorOptions, SingleRecordedMessageHandlerWithContext, BatchRecordedMessageHandlerWithContext, Checkpointer, MessageConsumerOptions, MessageConsumer } from '@event-driven-io/emmett';
4
- import { PgPoolOptions, PgTransaction, PgPool, PgClient, PgDriverType, PgPoolClientConnection, PgClientConnection } from '@event-driven-io/dumbo/pg';
5
- import pg from 'pg';
6
- import { PongoClient, PongoDocument, PongoDBCollectionOptions, WithId, PongoFilter } from '@event-driven-io/pongo';
1
+ import * as _$_event_driven_io_emmett0 from "@event-driven-io/emmett";
2
+ import { AnyCommand, AnyEvent, AnyMessage, AnyReadEventMetadata, AnyRecordedMessageMetadata, AppendToStreamOptions, AppendToStreamResultWithGlobalPosition, AsyncAwaiter, BatchRecordedMessageHandlerWithContext, BatchRecordedMessageHandlerWithoutContext, CanHandle, Checkpointer, CurrentMessageProcessorPosition, DefaultRecord, EmmettError, EmmettObservabilityConfig, Event, EventStore, EventStoreReadSchemaOptions, EventStoreSessionFactory, JSONSerializationOptions, Message, MessageConsumer, MessageConsumerOptions, MessageHandlerContext, MessageProcessor, ProcessorCheckpoint, ProjectionDefinition, ProjectionHandler, ProjectionHandlerContext, ProjectionHandlingType, ProjectionInitOptions, ProjectionRegistration, ProjectorOptions, ReactorOptions, ReadEvent, ReadEventMetadataWithGlobalPosition, ReadStreamOptions, ReadStreamResult, RecordedMessage, RecordedMessageMetadata, RecordedMessageMetadataWithGlobalPosition, SingleRecordedMessageHandlerWithContext, StreamExistsResult, ThenThrows, TruncateProjection, WorkflowProcessorContext, WorkflowProcessorOptions } from "@event-driven-io/emmett";
3
+ import * as _$_event_driven_io_dumbo0 from "@event-driven-io/dumbo";
4
+ import { AnyConnection, DatabaseTransaction, Dumbo, MigrationStyle, QueryResultRow, RunSQLMigrationsResult, SQL, SQLExecutor, SQLMigration } from "@event-driven-io/dumbo";
5
+ import { PongoClient, PongoDBCollectionOptions, PongoDocument, PongoFilter, WithId } from "@event-driven-io/pongo";
6
+ import { PgClient, PgClientConnection, PgConnection, PgDriverType, PgPool, PgPoolClientConnection, PgPoolOptions, PgTransaction } from "@event-driven-io/dumbo/pg";
7
+ import pg from "pg";
7
8
 
9
+ //#region src/eventStore/consumers/messageBatchProcessing/index.d.ts
8
10
  declare const DefaultPostgreSQLEventStoreProcessorBatchSize = 100;
9
11
  declare const DefaultPostgreSQLEventStoreProcessorPullingFrequencyInMs = 50;
10
12
  type PostgreSQLEventStoreMessagesBatchHandlerResult = void | {
11
- type: 'STOP';
12
- reason?: string;
13
- error?: EmmettError;
13
+ type: 'STOP';
14
+ reason?: string;
15
+ error?: EmmettError;
14
16
  };
15
17
  type PostgreSQLEventStoreMessageBatchPullerOptions<MessageType extends Message = Message> = {
16
- executor: SQLExecutor;
17
- pullingFrequencyInMs: number;
18
- batchSize: number;
19
- eachBatch: BatchRecordedMessageHandlerWithoutContext<MessageType, ReadEventMetadataWithGlobalPosition>;
20
- stopWhen?: {
21
- noMessagesLeft?: boolean;
22
- };
23
- signal: AbortSignal;
24
- };
25
- type PostgreSQLEventStoreMessageBatchPullerStartFrom = {
26
- lastCheckpoint: ProcessorCheckpoint;
27
- } | 'BEGINNING' | 'END';
18
+ executor: SQLExecutor;
19
+ pullingFrequencyInMs: number;
20
+ batchSize: number;
21
+ eachBatch: BatchRecordedMessageHandlerWithoutContext<MessageType, ReadEventMetadataWithGlobalPosition>;
22
+ stopWhen?: {
23
+ noMessagesLeft?: boolean;
24
+ };
25
+ signal: AbortSignal;
26
+ };
27
+ type PostgreSQLEventStoreMessageBatchPullerStartFrom = CurrentMessageProcessorPosition;
28
28
  type PostgreSQLEventStoreMessageBatchPullerStartOptions = {
29
- startFrom: PostgreSQLEventStoreMessageBatchPullerStartFrom;
30
- signal?: AbortSignal;
29
+ startFrom: PostgreSQLEventStoreMessageBatchPullerStartFrom;
30
+ signal?: AbortSignal;
31
+ started?: AsyncAwaiter<void>;
31
32
  };
32
33
  type PostgreSQLEventStoreMessageBatchPuller = {
33
- isRunning: boolean;
34
- start(options: PostgreSQLEventStoreMessageBatchPullerStartOptions): Promise<void>;
35
- stop(): Promise<void>;
36
- };
37
- declare const postgreSQLEventStoreMessageBatchPuller: <MessageType extends Message = Message>({ executor, batchSize, eachBatch, pullingFrequencyInMs, stopWhen, signal, }: PostgreSQLEventStoreMessageBatchPullerOptions<MessageType>) => PostgreSQLEventStoreMessageBatchPuller;
38
- declare const zipPostgreSQLEventStoreMessageBatchPullerStartFrom: (options: (PostgreSQLEventStoreMessageBatchPullerStartFrom | undefined)[]) => PostgreSQLEventStoreMessageBatchPullerStartFrom;
39
-
34
+ isRunning: boolean;
35
+ start(options: PostgreSQLEventStoreMessageBatchPullerStartOptions): Promise<void>;
36
+ stop(): Promise<void>;
37
+ };
38
+ declare const postgreSQLEventStoreMessageBatchPuller: <MessageType extends Message = Message>({
39
+ executor,
40
+ batchSize,
41
+ eachBatch,
42
+ pullingFrequencyInMs,
43
+ stopWhen,
44
+ signal
45
+ }: PostgreSQLEventStoreMessageBatchPullerOptions<MessageType>) => PostgreSQLEventStoreMessageBatchPuller;
46
+ //#endregion
47
+ //#region src/eventStore/projections/locks/tryAcquireProcessorLock.d.ts
40
48
  type TryAcquireProcessorLockOptions = {
41
- processorId: string;
49
+ processorId: string;
50
+ version: number;
51
+ partition: string;
52
+ processorInstanceId: string;
53
+ projection?: {
54
+ name: string;
55
+ handlingType: ProjectionHandlingType;
56
+ kind: string;
42
57
  version: number;
43
- partition: string;
44
- processorInstanceId: string;
45
- projection?: {
46
- name: string;
47
- handlingType: ProjectionHandlingType;
48
- kind: string;
49
- version: number;
50
- };
51
- lockKey: string | bigint;
52
- lockTimeoutSeconds?: number;
58
+ };
59
+ lockKey: string | bigint;
60
+ lockTimeoutSeconds?: number;
53
61
  };
54
62
  type LockAcquisitionPolicy = {
55
- type: 'fail';
63
+ type: 'fail';
56
64
  } | {
57
- type: 'skip';
65
+ type: 'skip';
58
66
  } | {
59
- type: 'retry';
60
- retries: number;
61
- minTimeout?: number;
62
- maxTimeout?: number;
67
+ type: 'retry';
68
+ retries: number;
69
+ minTimeout?: number;
70
+ maxTimeout?: number;
63
71
  };
64
-
72
+ //#endregion
73
+ //#region src/eventStore/projections/locks/postgreSQLProcessorLock.d.ts
65
74
  type PostgreSQLProcessorLockOptions = {
66
- processorId: string;
75
+ processorId: string;
76
+ version: number;
77
+ partition: string;
78
+ processorInstanceId: string;
79
+ projection?: {
80
+ name: string;
81
+ handlingType: ProjectionHandlingType;
82
+ kind: string;
67
83
  version: number;
68
- partition: string;
69
- processorInstanceId: string;
70
- projection?: {
71
- name: string;
72
- handlingType: ProjectionHandlingType;
73
- kind: string;
74
- version: number;
75
- };
76
- lockKey?: string | bigint;
77
- lockTimeoutSeconds?: number;
78
- lockAcquisitionPolicy?: LockAcquisitionPolicy;
84
+ };
85
+ lockKey?: string | bigint;
86
+ lockTimeoutSeconds?: number;
87
+ lockAcquisitionPolicy?: LockAcquisitionPolicy;
79
88
  };
80
89
  type PostgreSQLProcessorLockContext = {
81
- execute: SQLExecutor;
90
+ execute: SQLExecutor;
82
91
  };
83
92
  type PostgreSQLProcessorLock = {
84
- tryAcquire: (options: PostgreSQLProcessorLockContext) => Promise<boolean>;
85
- release: (options: PostgreSQLProcessorLockContext) => Promise<void>;
93
+ tryAcquire: (options: PostgreSQLProcessorLockContext) => Promise<boolean>;
94
+ release: (options: PostgreSQLProcessorLockContext) => Promise<void>;
86
95
  };
87
96
  declare const DefaultPostgreSQLProcessorLockPolicy: LockAcquisitionPolicy;
88
97
  declare const postgreSQLProcessorLock: (options: PostgreSQLProcessorLockOptions) => PostgreSQLProcessorLock;
89
- declare const toProcessorLockKey: ({ projection, processorId, partition, version, }: Pick<TryAcquireProcessorLockOptions, "projection" | "processorId" | "version" | "partition">) => string;
90
-
98
+ declare const toProcessorLockKey: ({
99
+ projection,
100
+ processorId,
101
+ partition,
102
+ version
103
+ }: Pick<TryAcquireProcessorLockOptions, "projection" | "processorId" | "version" | "partition">) => string;
104
+ //#endregion
105
+ //#region src/eventStore/projections/locks/tryAcquireProjectionLock.d.ts
91
106
  type TryAcquireProjectionLockOptions = {
92
- projectionName: string;
93
- partition: string;
94
- version: number;
95
- lockKey: string | bigint;
107
+ projectionName: string;
108
+ partition: string;
109
+ version: number;
110
+ lockKey: string | bigint;
96
111
  };
97
-
112
+ //#endregion
113
+ //#region src/eventStore/projections/locks/postgreSQLProjectionLock.d.ts
98
114
  type PostgreSQLProjectionLockOptions = {
99
- projectionName: string;
100
- partition: string;
101
- version: number;
102
- lockKey?: string | bigint;
115
+ projectionName: string;
116
+ partition: string;
117
+ version: number;
118
+ lockKey?: string | bigint;
103
119
  };
104
120
  type PostgreSQLProjectionLockContext = {
105
- execute: SQLExecutor;
121
+ execute: SQLExecutor;
106
122
  };
107
123
  type PostgreSQLProjectionLock = {
108
- tryAcquire: (options: PostgreSQLProjectionLockContext) => Promise<boolean>;
109
- release: (options: PostgreSQLProjectionLockContext) => void;
124
+ tryAcquire: (options: PostgreSQLProjectionLockContext) => Promise<boolean>;
125
+ release: (options: PostgreSQLProjectionLockContext) => void;
110
126
  };
111
127
  declare const postgreSQLProjectionLock: (options: PostgreSQLProjectionLockOptions) => PostgreSQLProjectionLock;
112
- declare const toProjectionLockKey: ({ projectionName, partition, version, }: Pick<TryAcquireProjectionLockOptions, "projectionName" | "partition" | "version">) => string;
113
-
114
- declare const registerProjection: <ReadEventMetadataType extends AnyReadEventMetadata = AnyReadEventMetadata, ProjectionHandlerContext extends DefaultRecord = DefaultRecord>(execute: SQLExecutor, options: {
115
- partition: string;
116
- status: "active" | "inactive";
117
- registration: ProjectionRegistration<ProjectionHandlingType, ReadEventMetadataType, ProjectionHandlerContext>;
128
+ declare const toProjectionLockKey: ({
129
+ projectionName,
130
+ partition,
131
+ version
132
+ }: Pick<TryAcquireProjectionLockOptions, "projectionName" | "partition" | "version">) => string;
133
+ //#endregion
134
+ //#region src/eventStore/projections/management/projectionManagement.d.ts
135
+ declare const registerProjection: <ReadEventMetadataType extends AnyReadEventMetadata = AnyReadEventMetadata, HandlerContext extends ProjectionHandlerContext = ProjectionHandlerContext>(execute: SQLExecutor, options: {
136
+ partition: string;
137
+ status: "active" | "inactive";
138
+ registration: ProjectionRegistration<ProjectionHandlingType, ReadEventMetadataType, HandlerContext>;
118
139
  }) => Promise<{
119
- registered: boolean;
140
+ registered: boolean;
120
141
  }>;
121
142
  declare const activateProjection: (execute: SQLExecutor, options: {
122
- name: string;
123
- partition: string;
124
- version: number;
143
+ name: string;
144
+ partition: string;
145
+ version: number;
125
146
  }) => Promise<{
126
- activated: boolean;
147
+ activated: boolean;
127
148
  }>;
128
149
  declare const deactivateProjection: (execute: SQLExecutor, options: {
129
- name: string;
130
- partition: string;
131
- version: number;
150
+ name: string;
151
+ partition: string;
152
+ version: number;
132
153
  }) => Promise<{
133
- deactivated: boolean;
154
+ deactivated: boolean;
134
155
  }>;
135
156
  type ProjectionRegistrationWithMandatoryData = ProjectionRegistration<ProjectionHandlingType> & {
136
- projection: Required<Pick<ProjectionDefinition, 'kind' | 'version' | 'name'>>;
157
+ projection: Required<Pick<ProjectionDefinition, 'kind' | 'version' | 'name'>>;
137
158
  };
138
159
  type ReadProjectionInfoResult = {
139
- partition: string;
140
- status: 'active' | 'inactive';
141
- registration: ProjectionRegistrationWithMandatoryData;
142
- createdAt: Date;
143
- lastUpdated: Date;
144
- };
145
- declare const readProjectionInfo: (execute: SQLExecutor, { name, partition, version, }: {
146
- name: string;
147
- partition: string;
148
- version: number;
160
+ partition: string;
161
+ status: 'active' | 'inactive';
162
+ registration: ProjectionRegistrationWithMandatoryData;
163
+ createdAt: Date;
164
+ lastUpdated: Date;
165
+ };
166
+ declare const readProjectionInfo: (execute: SQLExecutor, {
167
+ name,
168
+ partition,
169
+ version
170
+ }: {
171
+ name: string;
172
+ partition: string;
173
+ version: number;
149
174
  }) => Promise<ReadProjectionInfoResult | null>;
150
-
175
+ //#endregion
176
+ //#region src/eventStore/projections/pongo/pongoProjections.d.ts
151
177
  type PongoProjectionHandlerContext = PostgreSQLProjectionHandlerContext & {
152
- pongo: PongoClient;
178
+ pongo: PongoClient;
153
179
  };
154
180
  type PongoWithNotNullDocumentEvolve<Document extends PongoDocument, EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata> = ((document: Document, event: ReadEvent<EventType, EventMetaDataType>) => Document | null) | ((document: Document, event: ReadEvent<EventType>) => Promise<Document | null>);
155
181
  type PongoWithNullableDocumentEvolve<Document extends PongoDocument, EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata> = ((document: Document | null, event: ReadEvent<EventType, EventMetaDataType>) => Document | null) | ((document: Document | null, event: ReadEvent<EventType>) => Promise<Document | null>);
156
182
  type PongoDocumentEvolve<Document extends PongoDocument, EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata> = PongoWithNotNullDocumentEvolve<Document, EventType, EventMetaDataType> | PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
157
183
  type PongoProjectionOptions<EventType extends Event, EventPayloadType extends Event = EventType> = {
158
- name: string;
159
- kind?: string;
160
- version?: number;
161
- handle: (events: ReadEvent<EventType, PostgresReadEventMetadata>[], context: PongoProjectionHandlerContext) => Promise<void>;
162
- canHandle: CanHandle<EventType>;
163
- truncate?: TruncateProjection<PongoProjectionHandlerContext>;
164
- init?: (context: PongoProjectionHandlerContext) => void | Promise<void>;
165
- eventsOptions?: {
166
- schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
167
- };
168
- };
169
- declare const pongoProjection: <EventType extends Event, EventPayloadType extends Event = EventType>({ name, kind, version, truncate, handle, canHandle, eventsOptions, }: PongoProjectionOptions<EventType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
184
+ name: string;
185
+ kind?: string;
186
+ version?: number;
187
+ handle: (events: ReadEvent<EventType, PostgresReadEventMetadata>[], context: PongoProjectionHandlerContext) => Promise<void>;
188
+ canHandle: CanHandle<EventType>;
189
+ truncate?: TruncateProjection<PongoProjectionHandlerContext>;
190
+ init?: (context: PongoProjectionHandlerContext) => void | Promise<void>;
191
+ eventsOptions?: {
192
+ schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
193
+ };
194
+ } & JSONSerializationOptions;
195
+ declare const pongoProjection: <EventType extends Event, EventPayloadType extends Event = EventType>({
196
+ name,
197
+ kind,
198
+ version,
199
+ truncate,
200
+ handle,
201
+ canHandle,
202
+ eventsOptions
203
+ }: PongoProjectionOptions<EventType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
170
204
  type PongoMultiStreamProjectionOptions<Document extends PongoDocument, EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata, EventPayloadType extends Event = EventType, DocumentPayload extends PongoDocument = Document> = {
171
- kind?: string;
172
- canHandle: CanHandle<EventType>;
173
- version?: number;
174
- collectionName: string;
175
- collectionOptions?: PongoDBCollectionOptions<Document, DocumentPayload>;
176
- eventsOptions?: {
177
- schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
178
- };
179
- getDocumentId: (event: ReadEvent<EventType>) => string;
205
+ kind?: string;
206
+ canHandle: CanHandle<EventType>;
207
+ version?: number;
208
+ collectionName: string;
209
+ collectionOptions?: PongoDBCollectionOptions<Document, DocumentPayload>;
210
+ eventsOptions?: {
211
+ schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
212
+ };
180
213
  } & ({
181
- evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
214
+ getDocumentId: (event: ReadEvent<EventType>) => string | null;
215
+ getDocumentIds?: never;
182
216
  } | {
183
- evolve: PongoWithNotNullDocumentEvolve<Document, EventType, EventMetaDataType>;
184
- initialState: () => Document;
185
- });
217
+ getDocumentId?: never;
218
+ getDocumentIds: (event: ReadEvent<EventType>) => string[];
219
+ }) & ({
220
+ evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
221
+ } | {
222
+ evolve: PongoWithNotNullDocumentEvolve<Document, EventType, EventMetaDataType>;
223
+ initialState: () => Document;
224
+ }) & JSONSerializationOptions;
186
225
  declare const pongoMultiStreamProjection: <Document extends PongoDocument, EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata, EventPayloadType extends Event = EventType>(options: PongoMultiStreamProjectionOptions<Document, EventType, EventMetaDataType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
187
226
  type PongoSingleStreamProjectionOptions<Document extends PongoDocument, EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata, EventPayloadType extends Event = EventType, DocumentPayload extends PongoDocument = Document> = {
188
- canHandle: CanHandle<EventType>;
189
- getDocumentId?: (event: ReadEvent<EventType>) => string;
190
- version?: number;
191
- collectionName: string;
192
- collectionOptions?: PongoDBCollectionOptions<Document, DocumentPayload>;
193
- eventsOptions?: {
194
- schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
195
- };
227
+ canHandle: CanHandle<EventType>;
228
+ version?: number;
229
+ collectionName: string;
230
+ collectionOptions?: PongoDBCollectionOptions<Document, DocumentPayload>;
231
+ eventsOptions?: {
232
+ schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
233
+ };
196
234
  } & ({
197
- evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
235
+ getDocumentId: (event: ReadEvent<EventType>) => string | null;
236
+ getDocumentIds?: never;
198
237
  } | {
199
- evolve: PongoWithNotNullDocumentEvolve<Document, EventType, EventMetaDataType>;
200
- initialState: () => Document;
201
- });
202
- declare const pongoSingleStreamProjection: <Document extends PongoDocument, EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata, EventPayloadType extends Event = EventType>(options: PongoSingleStreamProjectionOptions<Document, EventType, EventMetaDataType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
203
-
238
+ getDocumentId?: never;
239
+ getDocumentIds: (event: ReadEvent<EventType>) => string[];
240
+ } | {
241
+ getDocumentId?: never;
242
+ getDocumentIds?: never;
243
+ }) & ({
244
+ evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
245
+ } | {
246
+ evolve: PongoWithNotNullDocumentEvolve<Document, EventType, EventMetaDataType>;
247
+ initialState: () => Document;
248
+ }) & JSONSerializationOptions;
249
+ declare const pongoSingleStreamProjection: <Document extends PongoDocument, EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata, EventPayloadType extends Event = EventType>({
250
+ getDocumentId,
251
+ getDocumentIds,
252
+ ...options
253
+ }: PongoSingleStreamProjectionOptions<Document, EventType, EventMetaDataType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
254
+ //#endregion
255
+ //#region src/eventStore/projections/pongo/pongoProjectionSpec.d.ts
204
256
  type PongoAssertOptions = {
205
- inCollection: string;
206
- inDatabase?: string;
257
+ inCollection: string;
258
+ inDatabase?: string;
207
259
  };
208
260
  type FilterOrId<Doc extends PongoDocument | WithId<PongoDocument>> = {
209
- withId: string;
261
+ withId: string;
210
262
  } | {
211
- matchingFilter: PongoFilter<Doc>;
263
+ matchingFilter: PongoFilter<Doc>;
212
264
  };
213
265
  declare const documentExists: <Doc extends PongoDocument | WithId<PongoDocument>>(document: Doc, options: PongoAssertOptions & FilterOrId<Doc>) => PostgreSQLProjectionAssert;
214
266
  declare const documentsAreTheSame: <Doc extends PongoDocument | WithId<PongoDocument>>(documents: Doc[], options: PongoAssertOptions & FilterOrId<Doc>) => PostgreSQLProjectionAssert;
@@ -216,259 +268,259 @@ declare const documentsMatchingHaveCount: <Doc extends PongoDocument | WithId<Po
216
268
  declare const documentMatchingExists: <Doc extends PongoDocument | WithId<PongoDocument>>(options: PongoAssertOptions & FilterOrId<Doc>) => PostgreSQLProjectionAssert;
217
269
  declare const documentDoesNotExist: <Doc extends PongoDocument | WithId<PongoDocument>>(options: PongoAssertOptions & FilterOrId<Doc>) => PostgreSQLProjectionAssert;
218
270
  declare const expectPongoDocuments: {
219
- fromCollection: <Doc extends PongoDocument | WithId<PongoDocument>>(collectionName: string) => {
220
- withId: (id: string) => {
221
- toBeEqual: (document: Doc) => PostgreSQLProjectionAssert;
222
- toExist: () => PostgreSQLProjectionAssert;
223
- notToExist: () => PostgreSQLProjectionAssert;
224
- };
225
- matching: <Doc_1 extends PongoDocument | WithId<PongoDocument>>(filter: PongoFilter<Doc_1>) => {
226
- toBeTheSame: (documents: Doc_1[]) => PostgreSQLProjectionAssert;
227
- toHaveCount: (expectedCount: number) => PostgreSQLProjectionAssert;
228
- toExist: () => PostgreSQLProjectionAssert;
229
- notToExist: () => PostgreSQLProjectionAssert;
230
- };
271
+ fromCollection: <Doc extends PongoDocument | WithId<PongoDocument>>(collectionName: string) => {
272
+ withId: (id: string) => {
273
+ toBeEqual: (document: Doc) => PostgreSQLProjectionAssert;
274
+ toExist: () => PostgreSQLProjectionAssert;
275
+ notToExist: () => PostgreSQLProjectionAssert;
276
+ };
277
+ matching: <Doc_1 extends PongoDocument | WithId<PongoDocument>>(filter: PongoFilter<Doc_1>) => {
278
+ toBeTheSame: (documents: Doc_1[]) => PostgreSQLProjectionAssert;
279
+ toHaveCount: (expectedCount: number) => PostgreSQLProjectionAssert;
280
+ toExist: () => PostgreSQLProjectionAssert;
281
+ notToExist: () => PostgreSQLProjectionAssert;
231
282
  };
283
+ };
232
284
  };
233
-
285
+ //#endregion
286
+ //#region src/eventStore/projections/postgresProjectionSpec.d.ts
234
287
  type PostgreSQLProjectionSpecEvent<EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata> = EventType & {
235
- metadata?: Partial<EventMetaDataType>;
288
+ metadata?: Partial<EventMetaDataType>;
236
289
  };
237
290
  type PostgreSQLProjectionSpecWhenOptions = {
238
- numberOfTimes: number;
291
+ numberOfTimes: number;
292
+ };
293
+ type PostgreSQLProjectionSpec<EventType extends Event> = (givenEvents: PostgreSQLProjectionSpecEvent<EventType>[]) => {
294
+ when: (events: PostgreSQLProjectionSpecEvent<EventType>[], options?: PostgreSQLProjectionSpecWhenOptions) => {
295
+ then: (assert: PostgreSQLProjectionAssert, message?: string) => Promise<void>;
296
+ thenThrows: <ErrorType extends Error = Error>(...args: Parameters<ThenThrows<ErrorType>>) => Promise<void>;
297
+ };
239
298
  };
240
299
  type PostgreSQLProjectionAssert = (options: {
241
- pool: Dumbo;
242
- connectionString: string;
300
+ pool: Dumbo;
301
+ connectionString: string;
243
302
  }) => Promise<void | boolean>;
244
303
  type PostgreSQLProjectionSpecOptions<EventType extends Event> = {
245
- projection: PostgreSQLProjectionDefinition<EventType>;
304
+ projection: PostgreSQLProjectionDefinition<EventType>;
246
305
  } & PgPoolOptions;
247
- type PostgreSQLProjectionSpec<EventType extends Event> = (givenEvents: PostgreSQLProjectionSpecEvent<EventType>[]) => {
248
- when: (events: PostgreSQLProjectionSpecEvent<EventType>[], options?: PostgreSQLProjectionSpecWhenOptions) => {
249
- then: (assert: PostgreSQLProjectionAssert, message?: string) => Promise<void>;
250
- thenThrows: <ErrorType extends Error = Error>(...args: Parameters<ThenThrows<ErrorType>>) => Promise<void>;
251
- };
252
- };
253
306
  declare const PostgreSQLProjectionSpec: {
254
- for: <EventType extends Event>(options: PostgreSQLProjectionSpecOptions<EventType>) => PostgreSQLProjectionSpec<EventType>;
307
+ for: <EventType extends Event>(options: PostgreSQLProjectionSpecOptions<EventType>) => PostgreSQLProjectionSpec<EventType>;
255
308
  };
256
309
  declare const eventInStream: <EventType extends Event = Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata>(streamName: string, event: PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>) => PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>;
257
310
  declare const eventsInStream: <EventType extends Event = Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata>(streamName: string, events: PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>[]) => PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>[];
258
- declare const newEventsInStream: <EventType extends Event = Event, EventMetaDataType extends PostgresReadEventMetadata = _event_driven_io_emmett.RecordedMessageMetadataWithGlobalPosition>(streamName: string, events: PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>[]) => PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>[];
311
+ declare const newEventsInStream: <EventType extends Event = Event, EventMetaDataType extends PostgresReadEventMetadata = _$_event_driven_io_emmett0.RecordedMessageMetadataWithGlobalPosition>(streamName: string, events: PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>[]) => PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>[];
259
312
  declare const assertSQLQueryResultMatches: <T extends QueryResultRow>(sql: SQL, rows: T[]) => PostgreSQLProjectionAssert;
260
313
  declare const expectSQL: {
261
- query: (sql: SQL) => {
262
- resultRows: {
263
- toBeTheSame: <T extends QueryResultRow>(rows: T[]) => PostgreSQLProjectionAssert;
264
- };
265
- };
266
- };
267
-
268
- declare const emmettPrefix = "emt";
269
- declare const globalTag = "global";
270
- declare const defaultTag = "emt:default";
271
- declare const unknownTag = "emt:unknown";
272
- declare const globalNames: {
273
- module: string;
274
- tenant: string;
275
- };
276
- declare const streamsTable: {
277
- name: string;
278
- columns: {
279
- partition: {
280
- name: string;
281
- };
282
- isArchived: {
283
- name: string;
284
- };
285
- };
286
- };
287
- declare const messagesTable: {
288
- name: string;
289
- columns: {
290
- partition: {
291
- name: string;
292
- };
293
- isArchived: {
294
- name: string;
295
- };
314
+ query: (sql: SQL) => {
315
+ resultRows: {
316
+ toBeTheSame: <T extends QueryResultRow>(rows: T[]) => PostgreSQLProjectionAssert;
296
317
  };
318
+ };
319
+ };
320
+ //#endregion
321
+ //#region src/eventStore/schema/readMessagesBatch.d.ts
322
+ declare const PostgreSQLEventStoreCheckpoint: {
323
+ default: {
324
+ transactionId: bigint;
325
+ globalPosition: bigint;
326
+ };
327
+ parse: (checkPoint: ProcessorCheckpoint | undefined | null) => PostgreSQLEventStoreCheckpoint;
328
+ toProcessorCheckpoint: (checkPoint: PostgreSQLEventStoreCheckpoint) => ProcessorCheckpoint;
329
+ };
330
+ type PostgreSQLEventStoreCheckpoint = {
331
+ transactionId: bigint;
332
+ globalPosition: bigint;
297
333
  };
298
- declare const processorsTable: {
299
- name: string;
334
+ type ReadMessagesBatchOptions = {
335
+ after: PostgreSQLEventStoreCheckpoint;
336
+ batchSize: number;
337
+ } | {
338
+ from: PostgreSQLEventStoreCheckpoint;
339
+ batchSize: number;
340
+ } | {
341
+ to: PostgreSQLEventStoreCheckpoint;
342
+ batchSize: number;
343
+ } | {
344
+ from: PostgreSQLEventStoreCheckpoint;
345
+ to: PostgreSQLEventStoreCheckpoint;
300
346
  };
301
- declare const projectionsTable: {
302
- name: string;
347
+ type ReadMessagesBatchResult<MessageType extends Message, MessageMetadataType extends RecordedMessageMetadata = RecordedMessageMetadata> = {
348
+ currentCheckpoint: PostgreSQLEventStoreCheckpoint;
349
+ messages: RecordedMessage<MessageType, MessageMetadataType>[];
350
+ areMessagesLeft: boolean;
303
351
  };
304
-
352
+ declare const readMessagesBatch: <MessageType extends Message, RecordedMessageMetadataType extends RecordedMessageMetadataWithGlobalPosition = RecordedMessageMetadataWithGlobalPosition>(execute: SQLExecutor, options: ReadMessagesBatchOptions & {
353
+ partition?: string;
354
+ }) => Promise<ReadMessagesBatchResult<MessageType, RecordedMessageMetadataType>>;
355
+ //#endregion
356
+ //#region src/eventStore/schema/appendToStream.d.ts
305
357
  declare const appendToStreamSQL: SQL;
306
358
  type CallAppendToStreamParams = {
307
- messageIds: string[];
308
- messagesData: DefaultRecord[];
309
- messagesMetadata: DefaultRecord[];
310
- schemaVersions: string[];
311
- messageTypes: string[];
312
- messageKinds: string[];
313
- streamId: string;
314
- streamType: string;
315
- expectedStreamPosition: bigint | null;
316
- partition: string;
359
+ messageIds: string[];
360
+ messagesData: DefaultRecord[];
361
+ messagesMetadata: DefaultRecord[];
362
+ schemaVersions: string[];
363
+ messageTypes: string[];
364
+ messageKinds: string[];
365
+ streamId: string;
366
+ streamType: string;
367
+ expectedStreamPosition: bigint | null;
368
+ partition: string;
317
369
  };
318
370
  declare const callAppendToStream: (params: CallAppendToStreamParams) => SQL;
319
371
  type AppendToStreamResult = {
320
- success: true;
321
- nextStreamPosition: bigint;
322
- globalPositions: bigint[];
323
- transactionId: string;
372
+ success: true;
373
+ nextStreamPosition: bigint;
374
+ checkpoints: PostgreSQLEventStoreCheckpoint[];
324
375
  } | {
325
- success: false;
376
+ success: false;
326
377
  };
327
378
  type AppendToStreamBeforeCommitHook = (messages: RecordedMessage[], context: {
328
- transaction: PgTransaction;
379
+ transaction: PgTransaction;
329
380
  }) => Promise<void>;
330
- declare const appendToStream: (pool: PgPool, streamName: string, streamType: string, messages: Message[], options?: AppendToStreamOptions & {
331
- partition?: string;
332
- beforeCommitHook?: AppendToStreamBeforeCommitHook;
381
+ declare const appendToStream: (connection: PgConnection, streamName: string, streamType: string, messages: Message[], options?: AppendToStreamOptions & {
382
+ partition?: string;
383
+ messageIdGenerator?: () => string;
384
+ beforeCommitHook?: AppendToStreamBeforeCommitHook;
333
385
  }) => Promise<AppendToStreamResult>;
334
-
335
- declare const cleanupLegacySubscriptionTables: (connectionString: string) => Promise<void>;
336
-
386
+ type AppendToStreamSqlResult = {
387
+ success: boolean;
388
+ next_stream_position: string | null;
389
+ global_positions: string[] | null;
390
+ transaction_id: string | null | undefined;
391
+ };
392
+ declare const appentToStreamRaw: (execute: SQLExecutor, streamId: string, streamType: string, messages: RecordedMessage[], options?: {
393
+ expectedStreamVersion: bigint | null;
394
+ partition?: string;
395
+ }) => Promise<AppendToStreamSqlResult>;
396
+ //#endregion
397
+ //#region src/eventStore/schema/migrations/index.d.ts
398
+ declare const currentPostgreSQLEventStoreSchemaVersion = "0.43.0";
399
+ declare const pastEventStoreSchemaMigrations: SQLMigration[];
400
+ declare const eventStoreSchemaMigrations: SQLMigration[];
401
+ //#endregion
402
+ //#region src/eventStore/schema/processors/processorsLocks.d.ts
337
403
  declare const tryAcquireProcessorLockSQL: SQL;
338
404
  declare const releaseProcessorLockSQL: SQL;
339
405
  type CallTryAcquireProcessorLockParams = {
340
- lockKey: string;
341
- processorId: string;
342
- version: number;
343
- partition: string;
344
- processorInstanceId: string;
345
- projectionName: string | null;
346
- projectionType: 'i' | 'a' | null;
347
- projectionKind: string | null;
348
- lockTimeoutSeconds: number;
406
+ lockKey: string;
407
+ processorId: string;
408
+ version: number;
409
+ partition: string;
410
+ processorInstanceId: string;
411
+ projectionName: string | null;
412
+ projectionType: 'i' | 'a' | null;
413
+ projectionKind: string | null;
414
+ lockTimeoutSeconds: number;
349
415
  };
350
416
  declare const callTryAcquireProcessorLock: (params: CallTryAcquireProcessorLockParams) => SQL;
351
417
  type CallReleaseProcessorLockParams = {
352
- lockKey: string;
353
- processorId: string;
354
- partition: string;
355
- version: number;
356
- processorInstanceId: string;
357
- projectionName: string | null;
418
+ lockKey: string;
419
+ processorId: string;
420
+ partition: string;
421
+ version: number;
422
+ processorInstanceId: string;
423
+ projectionName: string | null;
358
424
  };
359
425
  declare const callReleaseProcessorLock: (params: CallReleaseProcessorLockParams) => SQL;
360
-
426
+ //#endregion
427
+ //#region src/eventStore/schema/projections/projectionsLocks.d.ts
361
428
  declare const tryAcquireProjectionLockSQL: SQL;
362
429
  type CallTryAcquireProjectionLockParams = {
363
- lockKey: string;
364
- partition: string;
365
- name: string;
366
- version: number;
430
+ lockKey: string;
431
+ partition: string;
432
+ name: string;
433
+ version: number;
367
434
  };
368
435
  declare const callTryAcquireProjectionLock: (params: CallTryAcquireProjectionLockParams) => SQL;
369
-
436
+ //#endregion
437
+ //#region src/eventStore/schema/projections/registerProjection.d.ts
370
438
  declare const registerProjectionSQL: SQL;
371
439
  declare const activateProjectionSQL: SQL;
372
440
  declare const deactivateProjectionSQL: SQL;
373
441
  type CallRegisterProjectionParams = {
374
- lockKey: string;
375
- name: string;
376
- partition: string;
377
- version: number;
378
- type: 'i' | 'a';
379
- kind: string;
380
- status: string;
381
- definition: string;
442
+ lockKey: string;
443
+ name: string;
444
+ partition: string;
445
+ version: number;
446
+ type: 'i' | 'a';
447
+ kind: string;
448
+ status: string;
449
+ definition: string;
382
450
  };
383
451
  declare const callRegisterProjection: (params: CallRegisterProjectionParams) => SQL;
384
452
  type CallActivateProjectionParams = {
385
- lockKey: string;
386
- name: string;
387
- partition: string;
388
- version: number;
453
+ lockKey: string;
454
+ name: string;
455
+ partition: string;
456
+ version: number;
389
457
  };
390
458
  declare const callActivateProjection: (params: CallActivateProjectionParams) => SQL;
391
459
  type CallDeactivateProjectionParams = {
392
- lockKey: string;
393
- name: string;
394
- partition: string;
395
- version: number;
460
+ lockKey: string;
461
+ name: string;
462
+ partition: string;
463
+ version: number;
396
464
  };
397
465
  declare const callDeactivateProjection: (params: CallDeactivateProjectionParams) => SQL;
398
-
399
- type ReadLastMessageGlobalPositionResult = {
400
- currentGlobalPosition: bigint | null;
401
- };
402
- declare const readLastMessageGlobalPosition: (execute: SQLExecutor, options?: {
403
- partition?: string;
404
- }) => Promise<ReadLastMessageGlobalPositionResult>;
405
-
406
- type ReadMessagesBatchOptions = {
407
- after: bigint;
408
- batchSize: number;
409
- } | {
410
- from: bigint;
411
- batchSize: number;
412
- } | {
413
- to: bigint;
414
- batchSize: number;
415
- } | {
416
- from: bigint;
417
- to: bigint;
418
- };
419
- type ReadMessagesBatchResult<MessageType extends Message, MessageMetadataType extends RecordedMessageMetadata = RecordedMessageMetadata> = {
420
- currentGlobalPosition: bigint;
421
- messages: RecordedMessage<MessageType, MessageMetadataType>[];
422
- areMessagesLeft: boolean;
423
- };
424
- declare const readMessagesBatch: <MessageType extends Message, RecordedMessageMetadataType extends RecordedMessageMetadataWithGlobalPosition = RecordedMessageMetadataWithGlobalPosition>(execute: SQLExecutor, options: ReadMessagesBatchOptions & {
425
- partition?: string;
426
- }) => Promise<ReadMessagesBatchResult<MessageType, RecordedMessageMetadataType>>;
427
-
466
+ //#endregion
467
+ //#region src/eventStore/schema/readLastMessageCheckpoint.d.ts
468
+ type ReadLastMessageCheckpointResult = {
469
+ currentCheckpoint: PostgreSQLEventStoreCheckpoint | null;
470
+ };
471
+ declare const readLastMessageCheckpoint: (execute: SQLExecutor, options?: {
472
+ partition?: string;
473
+ }) => Promise<ReadLastMessageCheckpointResult>;
474
+ //#endregion
475
+ //#region src/eventStore/schema/readProcessorCheckpoint.d.ts
428
476
  type ReadProcessorCheckpointResult = {
429
- lastProcessedCheckpoint: ProcessorCheckpoint | null;
477
+ lastProcessedCheckpoint: ProcessorCheckpoint | null;
430
478
  };
431
479
  declare const readProcessorCheckpoint: (execute: SQLExecutor, options: {
432
- processorId: string;
433
- partition?: string;
434
- version?: number;
480
+ processorId: string;
481
+ partition?: string;
482
+ version?: number;
435
483
  }) => Promise<ReadProcessorCheckpointResult>;
436
-
484
+ //#endregion
485
+ //#region src/eventStore/schema/readStream.d.ts
437
486
  declare const readStream: <EventType extends Event, EventPayloadType extends Event = EventType>(execute: SQLExecutor, streamId: string, options?: ReadStreamOptions<EventType, EventPayloadType> & {
438
- partition?: string;
487
+ partition?: string;
439
488
  }) => Promise<ReadStreamResult<EventType, ReadEventMetadataWithGlobalPosition>>;
440
-
489
+ //#endregion
490
+ //#region src/eventStore/schema/storeProcessorCheckpoint.d.ts
441
491
  declare const storeSubscriptionCheckpointSQL: SQL;
442
492
  type CallStoreProcessorCheckpointParams = {
443
- processorId: string;
444
- version: number;
445
- position: string | null;
446
- checkPosition: string | null;
447
- partition: string;
448
- processorInstanceId: string;
493
+ processorId: string;
494
+ version: number;
495
+ position: string | null;
496
+ checkPosition: string | null;
497
+ partition: string;
498
+ processorInstanceId: string;
449
499
  };
450
500
  declare const callStoreProcessorCheckpoint: (params: CallStoreProcessorCheckpointParams) => SQL;
451
501
  type StoreProcessorCheckpointResult = {
452
- success: true;
453
- newCheckpoint: ProcessorCheckpoint | null;
502
+ success: true;
503
+ newCheckpoint: ProcessorCheckpoint | null;
454
504
  } | {
455
- success: false;
456
- reason: 'IGNORED' | 'MISMATCH' | 'CURRENT_AHEAD';
505
+ success: false;
506
+ reason: 'IGNORED' | 'MISMATCH' | 'CURRENT_AHEAD';
457
507
  };
458
508
  declare const storeProcessorCheckpoint: (execute: SQLExecutor, options: {
459
- processorId: string;
460
- version: number | undefined;
461
- newCheckpoint: ProcessorCheckpoint | null;
462
- lastProcessedCheckpoint: ProcessorCheckpoint | null;
463
- partition?: string;
464
- processorInstanceId?: string;
509
+ processorId: string;
510
+ version: number | undefined;
511
+ newCheckpoint: ProcessorCheckpoint | null;
512
+ lastProcessedCheckpoint: ProcessorCheckpoint | null;
513
+ partition?: string;
514
+ processorInstanceId?: string;
465
515
  }) => Promise<StoreProcessorCheckpointResult>;
466
-
516
+ //#endregion
517
+ //#region src/eventStore/schema/streamExists.d.ts
467
518
  type PostgresStreamExistsOptions = {
468
- partition: string;
519
+ partition: string;
469
520
  };
470
521
  declare const streamExists: (execute: SQLExecutor, streamId: string, options?: PostgresStreamExistsOptions) => Promise<StreamExistsResult>;
471
-
522
+ //#endregion
523
+ //#region src/eventStore/schema/tables.d.ts
472
524
  declare const streamsTableSQL: SQL;
473
525
  declare const messagesTableSQL: SQL;
474
526
  declare const processorsTableSQL: SQL;
@@ -481,225 +533,229 @@ declare const addTenantSQL: SQL;
481
533
  declare const addModuleForAllTenantsSQL: SQL;
482
534
  declare const addTenantForAllModulesSQL: SQL;
483
535
  declare const addDefaultPartitionSQL: SQL;
484
-
536
+ //#endregion
537
+ //#region src/eventStore/schema/index.d.ts
485
538
  declare const schemaSQL: SQL[];
486
- declare const schemaMigration: SQLMigration;
487
- declare const eventStoreSchemaMigrations: SQLMigration[];
539
+ declare const schemaMigration: _$_event_driven_io_dumbo0.SQLMigration;
488
540
  type CreateEventStoreSchemaOptions = {
489
- dryRun?: boolean | undefined;
490
- ignoreMigrationHashMismatch?: boolean | undefined;
491
- migrationTimeoutMs?: number | undefined;
492
- };
541
+ dryRun?: boolean | undefined;
542
+ ignoreMigrationHashMismatch?: boolean | undefined;
543
+ migrationTimeoutMs?: number | undefined;
544
+ } & JSONSerializationOptions;
493
545
  type EventStoreSchemaMigrationOptions = {
494
- migrationOptions?: CreateEventStoreSchemaOptions;
546
+ migrationOptions?: CreateEventStoreSchemaOptions;
495
547
  };
496
548
  declare const createEventStoreSchema: (connectionString: string, pool: PgPool, hooks?: PostgresEventStoreOptions["hooks"], options?: CreateEventStoreSchemaOptions) => Promise<RunSQLMigrationsResult>;
497
-
498
- type PostgreSQLProjectionHandlerContext = {
499
- execute: SQLExecutor;
500
- connection: {
501
- connectionString: string;
502
- client: PgClient;
503
- transaction: PgTransaction;
504
- pool: Dumbo;
505
- };
506
- } & EventStoreSchemaMigrationOptions;
549
+ //#endregion
550
+ //#region src/eventStore/projections/postgreSQLProjection.d.ts
551
+ type PostgreSQLProjectionHandlerContext = ProjectionHandlerContext<{
552
+ execute: SQLExecutor;
553
+ connection: {
554
+ connectionString: string;
555
+ client: PgClient;
556
+ transaction: PgTransaction;
557
+ pool: Dumbo;
558
+ };
559
+ } & EventStoreSchemaMigrationOptions>;
507
560
  declare const transactionToPostgreSQLProjectionHandlerContext: (connectionString: string, pool: Dumbo, transaction: PgTransaction | DatabaseTransaction<AnyConnection>) => Promise<PostgreSQLProjectionHandlerContext>;
508
561
  type PostgreSQLProjectionHandler<EventType extends Event = Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata> = ProjectionHandler<EventType, EventMetaDataType, PostgreSQLProjectionHandlerContext>;
509
562
  type PostgreSQLProjectionDefinition<EventType extends Event = Event, EventPayloadType extends Event = EventType> = ProjectionDefinition<EventType, PostgresReadEventMetadata, PostgreSQLProjectionHandlerContext, EventPayloadType>;
510
563
  type PostgreSQLProjectionHandlerOptions<EventType extends Event = Event> = {
511
- events: ReadEvent<EventType, PostgresReadEventMetadata>[];
512
- projections: PostgreSQLProjectionDefinition<EventType>[];
513
- partition?: string;
564
+ events: ReadEvent<EventType, PostgresReadEventMetadata>[];
565
+ projections: PostgreSQLProjectionDefinition<EventType>[];
566
+ partition?: string;
514
567
  } & PostgreSQLProjectionHandlerContext;
515
568
  declare const handleProjections: <EventType extends Event = Event>(options: PostgreSQLProjectionHandlerOptions<EventType>) => Promise<void>;
516
569
  declare const postgreSQLProjection: <EventType extends Event, EventPayloadType extends Event = EventType>(definition: PostgreSQLProjectionDefinition<EventType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
517
570
  type PostgreSQLRawBatchSQLProjection<EventType extends Event, EventPayloadType extends Event = EventType> = {
518
- name: string;
519
- kind?: string;
520
- version?: number;
521
- evolve: (events: EventType[], context: PostgreSQLProjectionHandlerContext) => Promise<SQL[]> | SQL[];
522
- canHandle: CanHandle<EventType>;
523
- init?: (context: ProjectionInitOptions<PostgreSQLProjectionHandlerContext>) => void | Promise<void> | SQL | Promise<SQL> | Promise<SQL[]> | SQL[];
524
- eventsOptions?: {
525
- schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
526
- };
527
- };
571
+ name: string;
572
+ kind?: string;
573
+ version?: number;
574
+ evolve: (events: EventType[], context: PostgreSQLProjectionHandlerContext) => Promise<SQL[]> | SQL[];
575
+ canHandle: CanHandle<EventType>;
576
+ init?: (context: ProjectionInitOptions<PostgreSQLProjectionHandlerContext>) => void | Promise<void> | SQL | Promise<SQL> | Promise<SQL[]> | SQL[];
577
+ eventsOptions?: {
578
+ schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
579
+ };
580
+ } & JSONSerializationOptions;
528
581
  declare const postgreSQLRawBatchSQLProjection: <EventType extends Event, EventPayloadType extends Event = EventType>(options: PostgreSQLRawBatchSQLProjection<EventType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
529
582
  type PostgreSQLRawSQLProjection<EventType extends Event, EventPayloadType extends Event = EventType> = {
530
- name: string;
531
- kind?: string;
532
- version?: number;
533
- evolve: (events: EventType, context: PostgreSQLProjectionHandlerContext) => Promise<SQL[]> | SQL[] | Promise<SQL> | SQL;
534
- canHandle: CanHandle<EventType>;
535
- init?: (context: ProjectionInitOptions<PostgreSQLProjectionHandlerContext>) => void | Promise<void> | SQL | Promise<SQL> | Promise<SQL[]> | SQL[];
536
- eventsOptions?: {
537
- schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
538
- };
539
- };
583
+ name: string;
584
+ kind?: string;
585
+ version?: number;
586
+ evolve: (events: EventType, context: PostgreSQLProjectionHandlerContext) => Promise<SQL[]> | SQL[] | Promise<SQL> | SQL;
587
+ canHandle: CanHandle<EventType>;
588
+ init?: (context: ProjectionInitOptions<PostgreSQLProjectionHandlerContext>) => void | Promise<void> | SQL | Promise<SQL> | Promise<SQL[]> | SQL[];
589
+ eventsOptions?: {
590
+ schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
591
+ };
592
+ } & JSONSerializationOptions;
540
593
  declare const postgreSQLRawSQLProjection: <EventType extends Event, EventPayloadType extends Event = EventType>(options: PostgreSQLRawSQLProjection<EventType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
541
-
594
+ //#endregion
595
+ //#region src/eventStore/postgreSQLEventStore.d.ts
542
596
  interface PostgresEventStore extends EventStore<PostgresReadEventMetadata>, EventStoreSessionFactory<PostgresEventStore> {
543
- appendToStream<EventType extends Event, EventPayloadType extends Event = EventType>(streamName: string, events: EventType[], options?: AppendToStreamOptions<EventType, EventPayloadType>): Promise<AppendToStreamResultWithGlobalPosition>;
544
- consumer<ConsumerEventType extends Event = Event>(options?: PostgreSQLEventStoreConsumerConfig<ConsumerEventType>): PostgreSQLEventStoreConsumer<ConsumerEventType>;
545
- close(): Promise<void>;
546
- streamExists(streamName: string, options?: PostgresStreamExistsOptions): Promise<StreamExistsResult>;
547
- schema: {
548
- sql(): string;
549
- print(): void;
550
- migrate(options?: CreateEventStoreSchemaOptions): Promise<RunSQLMigrationsResult>;
551
- dangerous: {
552
- truncate(options?: {
553
- resetSequences?: boolean;
554
- truncateProjections?: boolean;
555
- }): Promise<void>;
556
- };
597
+ appendToStream<EventType extends Event, EventPayloadType extends Event = EventType>(streamName: string, events: EventType[], options?: AppendToStreamOptions<EventType, EventPayloadType>): Promise<AppendToStreamResultWithGlobalPosition>;
598
+ consumer<ConsumerEventType extends Event = Event>(options?: PostgreSQLEventStoreConsumerConfig<ConsumerEventType>): PostgreSQLEventStoreConsumer<ConsumerEventType>;
599
+ close(): Promise<void>;
600
+ streamExists(streamName: string, options?: PostgresStreamExistsOptions): Promise<StreamExistsResult>;
601
+ schema: {
602
+ sql(): string;
603
+ print(): void;
604
+ migrate(options?: CreateEventStoreSchemaOptions): Promise<RunSQLMigrationsResult>;
605
+ dangerous: {
606
+ truncate(options?: {
607
+ resetSequences?: boolean;
608
+ truncateProjections?: boolean;
609
+ }): Promise<void>;
557
610
  };
611
+ };
558
612
  }
559
613
  type PostgresReadEventMetadata = ReadEventMetadataWithGlobalPosition;
560
614
  type PostgresReadEvent<EventType extends Event = Event> = ReadEvent<EventType, PostgresReadEventMetadata>;
561
615
  type PostgresEventStorePooledOptions = {
562
- connector?: PgDriverType;
563
- connectionString?: string;
564
- database?: string;
565
- pooled: true;
566
- pool: pg.Pool;
616
+ connector?: PgDriverType;
617
+ connectionString?: string;
618
+ database?: string;
619
+ pooled: true;
620
+ pool: pg.Pool;
567
621
  } | {
568
- connector?: PgDriverType;
569
- connectionString?: string;
570
- database?: string;
571
- pool: pg.Pool;
622
+ connector?: PgDriverType;
623
+ connectionString?: string;
624
+ database?: string;
625
+ pool: pg.Pool;
572
626
  } | {
573
- connector?: PgDriverType;
574
- connectionString?: string;
575
- database?: string;
576
- pooled: true;
627
+ connector?: PgDriverType;
628
+ connectionString?: string;
629
+ database?: string;
630
+ pooled: true;
577
631
  } | {
578
- connector?: PgDriverType;
579
- connectionString?: string;
580
- database?: string;
632
+ connector?: PgDriverType;
633
+ connectionString?: string;
634
+ database?: string;
581
635
  };
582
636
  type PostgresEventStoreNotPooledOptions = {
583
- connector?: PgDriverType;
584
- connectionString?: string;
585
- database?: string;
586
- pooled: false;
587
- client: pg.Client;
637
+ connector?: PgDriverType;
638
+ connectionString?: string;
639
+ database?: string;
640
+ pooled: false;
641
+ client: pg.Client;
588
642
  } | {
589
- connector?: PgDriverType;
590
- connectionString?: string;
591
- database?: string;
592
- client: pg.Client;
643
+ connector?: PgDriverType;
644
+ connectionString?: string;
645
+ database?: string;
646
+ client: pg.Client;
593
647
  } | {
594
- connector?: PgDriverType;
595
- connectionString?: string;
596
- database?: string;
597
- pooled: false;
648
+ connector?: PgDriverType;
649
+ connectionString?: string;
650
+ database?: string;
651
+ pooled: false;
598
652
  } | {
599
- connector?: PgDriverType;
600
- connectionString?: string;
601
- database?: string;
602
- connection: PgPoolClientConnection | PgClientConnection;
603
- pooled?: false;
653
+ connector?: PgDriverType;
654
+ connectionString?: string;
655
+ database?: string;
656
+ connection: PgPoolClientConnection | PgClientConnection;
657
+ pooled?: false;
604
658
  } | {
605
- connector?: PgDriverType;
606
- connectionString?: string;
607
- database?: string;
608
- dumbo: PgPool;
609
- pooled?: false;
659
+ connector?: PgDriverType;
660
+ connectionString?: string;
661
+ database?: string;
662
+ dumbo: PgPool;
663
+ pooled?: false;
610
664
  };
611
665
  type PostgresEventStoreConnectionOptions = PostgresEventStorePooledOptions | PostgresEventStoreNotPooledOptions;
612
666
  type PostgresEventStoreOptions = {
613
- projections?: ProjectionRegistration<'inline', PostgresReadEventMetadata, PostgreSQLProjectionHandlerContext>[];
614
- schema?: {
615
- autoMigration?: MigrationStyle;
616
- };
617
- connectionOptions?: PostgresEventStoreConnectionOptions;
618
- hooks?: {
619
- /**
620
- * This hook will be called **BEFORE** event store schema is created
621
- */
622
- onBeforeSchemaCreated?: (context: PostgreSQLProjectionHandlerContext) => Promise<void> | void;
623
- /**
624
- * This hook will be called **AFTER** event store schema was created but before transaction commits
625
- */
626
- onAfterSchemaCreated?: (context: PostgreSQLProjectionHandlerContext) => Promise<void> | void;
627
- };
628
- };
667
+ projections?: ProjectionRegistration<'inline', PostgresReadEventMetadata, PostgreSQLProjectionHandlerContext>[];
668
+ observability?: EmmettObservabilityConfig;
669
+ schema?: {
670
+ autoMigration?: MigrationStyle;
671
+ };
672
+ connectionOptions?: PostgresEventStoreConnectionOptions;
673
+ hooks?: {
674
+ /**
675
+ * This hook will be called **BEFORE** event store schema is created
676
+ */
677
+ onBeforeSchemaCreated?: (context: PostgreSQLProjectionHandlerContext) => Promise<void> | void;
678
+ /**
679
+ * This hook will be called **AFTER** event store schema was created but before transaction commits
680
+ */
681
+ onAfterSchemaCreated?: (context: PostgreSQLProjectionHandlerContext) => Promise<void> | void;
682
+ };
683
+ } & JSONSerializationOptions;
629
684
  declare const defaultPostgreSQLOptions: PostgresEventStoreOptions;
630
685
  declare const PostgreSQLEventStoreDefaultStreamVersion = 0n;
631
686
  declare const getPostgreSQLEventStore: (connectionString: string, options?: PostgresEventStoreOptions) => PostgresEventStore;
632
-
633
- type PostgreSQLProcessorHandlerContext = {
634
- partition: string;
635
- execute: SQLExecutor;
636
- connection: {
637
- connectionString: string;
638
- client: PgClient;
639
- transaction: PgTransaction;
640
- pool: Dumbo;
641
- messageStore: PostgresEventStore;
642
- };
643
- } & EventStoreSchemaMigrationOptions;
687
+ //#endregion
688
+ //#region src/eventStore/consumers/postgreSQLProcessor.d.ts
689
+ type PostgreSQLProcessorHandlerContext = MessageHandlerContext<{
690
+ partition: string;
691
+ execute: SQLExecutor;
692
+ connection: {
693
+ connectionString: string;
694
+ client: PgClient;
695
+ transaction: PgTransaction;
696
+ pool: Dumbo;
697
+ messageStore: PostgresEventStore;
698
+ };
699
+ } & EventStoreSchemaMigrationOptions>;
644
700
  type PostgreSQLProcessor<MessageType extends Message = AnyMessage> = MessageProcessor<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>;
645
701
  type PostgreSQLProcessorEachMessageHandler<MessageType extends Message = Message> = SingleRecordedMessageHandlerWithContext<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>;
646
702
  type PostgreSQLProcessorEachBatchHandler<MessageType extends Message = Message> = BatchRecordedMessageHandlerWithContext<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>;
647
703
  type PostgreSQLProcessorStartFrom = PostgreSQLEventStoreMessageBatchPullerStartFrom | 'CURRENT';
648
704
  type PostgreSQLProcessorPooledOptions = {
649
- connector?: PgDriverType;
650
- database?: string;
651
- pooled: true;
652
- pool: pg.Pool;
705
+ connector?: PgDriverType;
706
+ database?: string;
707
+ pooled: true;
708
+ pool: pg.Pool;
653
709
  } | {
654
- connector?: PgDriverType;
655
- database?: string;
656
- pool: pg.Pool;
710
+ connector?: PgDriverType;
711
+ database?: string;
712
+ pool: pg.Pool;
657
713
  } | {
658
- connector?: PgDriverType;
659
- database?: string;
660
- pooled: true;
714
+ connector?: PgDriverType;
715
+ database?: string;
716
+ pooled: true;
661
717
  } | {
662
- connector?: PgDriverType;
663
- database?: string;
718
+ connector?: PgDriverType;
719
+ database?: string;
664
720
  };
665
721
  type PostgreSQLProcessorNotPooledOptions = {
666
- connector?: PgDriverType;
667
- database?: string;
668
- pooled: false;
669
- client: pg.Client;
722
+ connector?: PgDriverType;
723
+ database?: string;
724
+ pooled: false;
725
+ client: pg.Client;
670
726
  } | {
671
- connector?: PgDriverType;
672
- database?: string;
673
- client: pg.Client;
727
+ connector?: PgDriverType;
728
+ database?: string;
729
+ client: pg.Client;
674
730
  } | {
675
- connector?: PgDriverType;
676
- database?: string;
677
- pooled: false;
731
+ connector?: PgDriverType;
732
+ database?: string;
733
+ pooled: false;
678
734
  } | {
679
- connector?: PgDriverType;
680
- database?: string;
681
- connection: PgPoolClientConnection | PgClientConnection;
682
- pooled?: false;
735
+ connector?: PgDriverType;
736
+ database?: string;
737
+ connection: PgPoolClientConnection | PgClientConnection;
738
+ pooled?: false;
683
739
  } | {
684
- connector?: PgDriverType;
685
- database?: string;
686
- dumbo: PgPool;
687
- pooled?: false;
740
+ connector?: PgDriverType;
741
+ database?: string;
742
+ dumbo: PgPool;
743
+ pooled?: false;
688
744
  };
689
745
  type PostgreSQLProcessorConnectionOptions = {
690
- connectionString: string;
746
+ connectionString: string;
691
747
  } & (PostgreSQLProcessorPooledOptions | PostgreSQLProcessorNotPooledOptions);
692
748
  type PostgreSQLCheckpointer<MessageType extends AnyMessage = AnyMessage> = Checkpointer<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>;
693
749
  declare const postgreSQLCheckpointer: <MessageType extends Message = Message>() => PostgreSQLCheckpointer<MessageType>;
694
750
  type PostgreSQLConnectionOptions = {
695
- connectionOptions?: PostgreSQLProcessorConnectionOptions;
696
- };
751
+ connectionOptions?: PostgreSQLProcessorConnectionOptions;
752
+ } & JSONSerializationOptions;
697
753
  type PostgreSQLProcessorOptionsBase = PostgreSQLConnectionOptions & {
698
- lock?: {
699
- acquisitionPolicy?: LockAcquisitionPolicy;
700
- timeoutSeconds?: number;
701
- };
702
- partition?: string;
754
+ lock?: {
755
+ acquisitionPolicy?: LockAcquisitionPolicy;
756
+ timeoutSeconds?: number;
757
+ };
758
+ partition?: string;
703
759
  };
704
760
  type PostgreSQLReactorOptions<MessageType extends Message = Message, MessagePayloadType extends AnyMessage = MessageType> = ReactorOptions<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext, MessagePayloadType> & PostgreSQLProcessorOptionsBase;
705
761
  type PostgreSQLProjectorOptions<EventType extends AnyEvent = AnyEvent, EventPayloadType extends Event = EventType> = ProjectorOptions<EventType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext, EventPayloadType> & PostgreSQLProcessorOptionsBase & EventStoreSchemaMigrationOptions;
@@ -707,35 +763,38 @@ type PostgreSQLWorkflowProcessorOptions<Input extends AnyEvent | AnyCommand, Sta
707
763
  declare const postgreSQLProjector: <EventType extends Event = Event, EventPayloadType extends Event = EventType>(options: PostgreSQLProjectorOptions<EventType, EventPayloadType>) => PostgreSQLProcessor<EventType>;
708
764
  declare const postgreSQLWorkflowProcessor: <Input extends AnyEvent | AnyCommand, State, Output extends AnyEvent | AnyCommand, MetaDataType extends AnyRecordedMessageMetadata = AnyRecordedMessageMetadata, HandlerContext extends PostgreSQLProcessorHandlerContext & WorkflowProcessorContext = PostgreSQLProcessorHandlerContext & WorkflowProcessorContext, StoredMessage extends AnyEvent | AnyCommand = Output>(options: PostgreSQLWorkflowProcessorOptions<Input, State, Output, MetaDataType, HandlerContext, StoredMessage>) => PostgreSQLProcessor<Input | Output>;
709
765
  declare const postgreSQLReactor: <MessageType extends Message = Message, MessagePayloadType extends AnyMessage = MessageType>(options: PostgreSQLReactorOptions<MessageType, MessagePayloadType>) => PostgreSQLProcessor<MessageType>;
710
-
766
+ //#endregion
767
+ //#region src/eventStore/consumers/postgreSQLEventStoreConsumer.d.ts
711
768
  type PostgreSQLEventStoreConsumerConfig<ConsumerMessageType extends Message = any> = MessageConsumerOptions<ConsumerMessageType> & {
712
- stopWhen?: {
713
- noMessagesLeft?: boolean;
714
- };
715
- pulling?: {
716
- batchSize?: number;
717
- pullingFrequencyInMs?: number;
718
- };
719
- };
769
+ stopWhen?: {
770
+ noMessagesLeft?: boolean;
771
+ };
772
+ pulling?: {
773
+ batchSize?: number;
774
+ pullingFrequencyInMs?: number;
775
+ };
776
+ } & JSONSerializationOptions;
720
777
  type PostgreSQLEventStoreConsumerOptions<ConsumerMessageType extends Message = Message> = PostgreSQLEventStoreConsumerConfig<ConsumerMessageType> & {
721
- connectionString: string;
722
- pool?: Dumbo;
778
+ connectionString: string;
779
+ pool?: Dumbo;
723
780
  };
724
781
  type PostgreSQLEventStoreConsumer<ConsumerMessageType extends AnyMessage = any> = MessageConsumer<ConsumerMessageType> & Readonly<{
725
- reactor: <MessageType extends AnyMessage = ConsumerMessageType>(options: PostgreSQLReactorOptions<MessageType>) => PostgreSQLProcessor<MessageType>;
726
- workflowProcessor: <Input extends AnyEvent | AnyCommand, State, Output extends AnyEvent | AnyCommand, MetaDataType extends AnyRecordedMessageMetadata = AnyRecordedMessageMetadata, HandlerContext extends PostgreSQLProcessorHandlerContext & WorkflowProcessorContext = PostgreSQLProcessorHandlerContext & WorkflowProcessorContext, StoredMessage extends AnyEvent | AnyCommand = Output>(options: PostgreSQLWorkflowProcessorOptions<Input, State, Output, MetaDataType, HandlerContext, StoredMessage>) => PostgreSQLProcessor<Input | Output>;
782
+ reactor: <MessageType extends AnyMessage = ConsumerMessageType>(options: PostgreSQLReactorOptions<MessageType>) => PostgreSQLProcessor<MessageType>;
783
+ workflowProcessor: <Input extends AnyEvent | AnyCommand, State, Output extends AnyEvent | AnyCommand, MetaDataType extends AnyRecordedMessageMetadata = AnyRecordedMessageMetadata, HandlerContext extends PostgreSQLProcessorHandlerContext & WorkflowProcessorContext = PostgreSQLProcessorHandlerContext & WorkflowProcessorContext, StoredMessage extends AnyEvent | AnyCommand = Output>(options: PostgreSQLWorkflowProcessorOptions<Input, State, Output, MetaDataType, HandlerContext, StoredMessage>) => PostgreSQLProcessor<Input | Output>;
727
784
  }> & (AnyEvent extends ConsumerMessageType ? Readonly<{
728
- projector: <EventType extends AnyEvent = ConsumerMessageType & AnyEvent>(options: PostgreSQLProjectorOptions<EventType>) => PostgreSQLProcessor<EventType>;
785
+ projector: <EventType extends AnyEvent = ConsumerMessageType & AnyEvent>(options: PostgreSQLProjectorOptions<EventType>) => PostgreSQLProcessor<EventType>;
729
786
  }> : object);
730
787
  declare const postgreSQLEventStoreConsumer: <ConsumerMessageType extends Message = AnyMessage>(options: PostgreSQLEventStoreConsumerOptions<ConsumerMessageType>) => PostgreSQLEventStoreConsumer<ConsumerMessageType>;
731
-
788
+ //#endregion
789
+ //#region src/eventStore/consumers/rebuildPostgreSQLProjections.d.ts
732
790
  declare const rebuildPostgreSQLProjections: <EventType extends AnyEvent = AnyEvent>(options: Omit<PostgreSQLEventStoreConsumerOptions<EventType>, "stopWhen" | "processors"> & {
733
- lock?: {
734
- acquisitionPolicy?: LockAcquisitionPolicy;
735
- timeoutSeconds?: number;
736
- };
791
+ lock?: {
792
+ acquisitionPolicy?: LockAcquisitionPolicy;
793
+ timeoutSeconds?: number;
794
+ };
737
795
  } & ({
738
- projections: (ProjectorOptions<EventType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext> | PostgreSQLProjectionDefinition<EventType>)[];
796
+ projections: (ProjectorOptions<EventType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext> | PostgreSQLProjectionDefinition<EventType>)[];
739
797
  } | ProjectorOptions<EventType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>)) => PostgreSQLEventStoreConsumer<EventType>;
740
-
741
- export { type AppendToStreamBeforeCommitHook, type CreateEventStoreSchemaOptions, DefaultPostgreSQLEventStoreProcessorBatchSize, DefaultPostgreSQLEventStoreProcessorPullingFrequencyInMs, DefaultPostgreSQLProcessorLockPolicy, type EventStoreSchemaMigrationOptions, type LockAcquisitionPolicy, type PongoAssertOptions, type PongoDocumentEvolve, type PongoMultiStreamProjectionOptions, type PongoProjectionHandlerContext, type PongoProjectionOptions, type PongoSingleStreamProjectionOptions, type PongoWithNotNullDocumentEvolve, type PongoWithNullableDocumentEvolve, type PostgreSQLCheckpointer, type PostgreSQLEventStoreConsumer, type PostgreSQLEventStoreConsumerConfig, type PostgreSQLEventStoreConsumerOptions, PostgreSQLEventStoreDefaultStreamVersion, type PostgreSQLEventStoreMessageBatchPuller, type PostgreSQLEventStoreMessageBatchPullerOptions, type PostgreSQLEventStoreMessageBatchPullerStartFrom, type PostgreSQLEventStoreMessageBatchPullerStartOptions, type PostgreSQLEventStoreMessagesBatchHandlerResult, type PostgreSQLProcessor, type PostgreSQLProcessorConnectionOptions, type PostgreSQLProcessorEachBatchHandler, type PostgreSQLProcessorEachMessageHandler, type PostgreSQLProcessorHandlerContext, type PostgreSQLProcessorLock, type PostgreSQLProcessorLockContext, type PostgreSQLProcessorLockOptions, type PostgreSQLProcessorStartFrom, type PostgreSQLProjectionAssert, type PostgreSQLProjectionDefinition, type PostgreSQLProjectionHandler, type PostgreSQLProjectionHandlerContext, type PostgreSQLProjectionHandlerOptions, type PostgreSQLProjectionLock, type PostgreSQLProjectionLockContext, type PostgreSQLProjectionLockOptions, PostgreSQLProjectionSpec, type PostgreSQLProjectionSpecEvent, type PostgreSQLProjectionSpecOptions, type PostgreSQLProjectionSpecWhenOptions, type PostgreSQLProjectorOptions, type PostgreSQLRawBatchSQLProjection, type PostgreSQLRawSQLProjection, type PostgreSQLReactorOptions, type PostgreSQLWorkflowProcessorOptions, type PostgresEventStore, type PostgresEventStoreConnectionOptions, type PostgresEventStoreOptions, type PostgresReadEvent, type PostgresReadEventMetadata, type PostgresStreamExistsOptions, type ReadLastMessageGlobalPositionResult, type ReadMessagesBatchOptions, type ReadMessagesBatchResult, type ReadProcessorCheckpointResult, type ReadProjectionInfoResult, type StoreProcessorCheckpointResult, activateProjection, activateProjectionSQL, addDefaultPartitionSQL, addModuleForAllTenantsSQL, addModuleSQL, addPartitionSQL, addTablePartitions, addTenantForAllModulesSQL, addTenantSQL, appendToStream, appendToStreamSQL, assertSQLQueryResultMatches, callActivateProjection, callAppendToStream, callDeactivateProjection, callRegisterProjection, callReleaseProcessorLock, callStoreProcessorCheckpoint, callTryAcquireProcessorLock, callTryAcquireProjectionLock, cleanupLegacySubscriptionTables, createEventStoreSchema, deactivateProjection, deactivateProjectionSQL, defaultPostgreSQLOptions, defaultTag, documentDoesNotExist, documentExists, documentMatchingExists, documentsAreTheSame, documentsMatchingHaveCount, emmettPrefix, eventInStream, eventStoreSchemaMigrations, eventsInStream, expectPongoDocuments, expectSQL, getPostgreSQLEventStore, globalNames, globalTag, handleProjections, messagesTable, messagesTableSQL, newEventsInStream, pongoMultiStreamProjection, pongoProjection, pongoSingleStreamProjection, postgreSQLCheckpointer, postgreSQLEventStoreConsumer, postgreSQLEventStoreMessageBatchPuller, postgreSQLProcessorLock, postgreSQLProjection, postgreSQLProjectionLock, postgreSQLProjector, postgreSQLRawBatchSQLProjection, postgreSQLRawSQLProjection, postgreSQLReactor, postgreSQLWorkflowProcessor, processorsTable, processorsTableSQL, projectionsTable, projectionsTableSQL, readLastMessageGlobalPosition, readMessagesBatch, readProcessorCheckpoint, readProjectionInfo, readStream, rebuildPostgreSQLProjections, registerProjection, registerProjectionSQL, releaseProcessorLockSQL, sanitizeNameSQL, schemaMigration, schemaSQL, storeProcessorCheckpoint, storeSubscriptionCheckpointSQL, streamExists, streamsTable, streamsTableSQL, toProcessorLockKey, toProjectionLockKey, transactionToPostgreSQLProjectionHandlerContext, tryAcquireProcessorLockSQL, tryAcquireProjectionLockSQL, unknownTag, zipPostgreSQLEventStoreMessageBatchPullerStartFrom };
798
+ //#endregion
799
+ export { AppendToStreamBeforeCommitHook, CreateEventStoreSchemaOptions, DefaultPostgreSQLEventStoreProcessorBatchSize, DefaultPostgreSQLEventStoreProcessorPullingFrequencyInMs, DefaultPostgreSQLProcessorLockPolicy, EventStoreSchemaMigrationOptions, type LockAcquisitionPolicy, PongoAssertOptions, PongoDocumentEvolve, PongoMultiStreamProjectionOptions, PongoProjectionHandlerContext, PongoProjectionOptions, PongoSingleStreamProjectionOptions, PongoWithNotNullDocumentEvolve, PongoWithNullableDocumentEvolve, PostgreSQLCheckpointer, PostgreSQLEventStoreCheckpoint, PostgreSQLEventStoreConsumer, PostgreSQLEventStoreConsumerConfig, PostgreSQLEventStoreConsumerOptions, PostgreSQLEventStoreDefaultStreamVersion, PostgreSQLEventStoreMessageBatchPuller, PostgreSQLEventStoreMessageBatchPullerOptions, PostgreSQLEventStoreMessageBatchPullerStartFrom, PostgreSQLEventStoreMessageBatchPullerStartOptions, PostgreSQLEventStoreMessagesBatchHandlerResult, PostgreSQLProcessor, PostgreSQLProcessorConnectionOptions, PostgreSQLProcessorEachBatchHandler, PostgreSQLProcessorEachMessageHandler, PostgreSQLProcessorHandlerContext, PostgreSQLProcessorLock, PostgreSQLProcessorLockContext, PostgreSQLProcessorLockOptions, PostgreSQLProcessorStartFrom, PostgreSQLProjectionAssert, PostgreSQLProjectionDefinition, PostgreSQLProjectionHandler, PostgreSQLProjectionHandlerContext, PostgreSQLProjectionHandlerOptions, PostgreSQLProjectionLock, PostgreSQLProjectionLockContext, PostgreSQLProjectionLockOptions, PostgreSQLProjectionSpec, PostgreSQLProjectionSpecEvent, PostgreSQLProjectionSpecOptions, PostgreSQLProjectionSpecWhenOptions, PostgreSQLProjectorOptions, PostgreSQLRawBatchSQLProjection, PostgreSQLRawSQLProjection, PostgreSQLReactorOptions, PostgreSQLWorkflowProcessorOptions, PostgresEventStore, PostgresEventStoreConnectionOptions, PostgresEventStoreOptions, PostgresReadEvent, PostgresReadEventMetadata, PostgresStreamExistsOptions, ReadLastMessageCheckpointResult, ReadMessagesBatchOptions, ReadMessagesBatchResult, ReadProcessorCheckpointResult, ReadProjectionInfoResult, StoreProcessorCheckpointResult, activateProjection, activateProjectionSQL, addDefaultPartitionSQL, addModuleForAllTenantsSQL, addModuleSQL, addPartitionSQL, addTablePartitions, addTenantForAllModulesSQL, addTenantSQL, appendToStream, appendToStreamSQL, appentToStreamRaw, assertSQLQueryResultMatches, callActivateProjection, callAppendToStream, callDeactivateProjection, callRegisterProjection, callReleaseProcessorLock, callStoreProcessorCheckpoint, callTryAcquireProcessorLock, callTryAcquireProjectionLock, createEventStoreSchema, currentPostgreSQLEventStoreSchemaVersion, deactivateProjection, deactivateProjectionSQL, defaultPostgreSQLOptions, documentDoesNotExist, documentExists, documentMatchingExists, documentsAreTheSame, documentsMatchingHaveCount, eventInStream, eventStoreSchemaMigrations, eventsInStream, expectPongoDocuments, expectSQL, getPostgreSQLEventStore, handleProjections, messagesTableSQL, newEventsInStream, pastEventStoreSchemaMigrations, pongoMultiStreamProjection, pongoProjection, pongoSingleStreamProjection, postgreSQLCheckpointer, postgreSQLEventStoreConsumer, postgreSQLEventStoreMessageBatchPuller, postgreSQLProcessorLock, postgreSQLProjection, postgreSQLProjectionLock, postgreSQLProjector, postgreSQLRawBatchSQLProjection, postgreSQLRawSQLProjection, postgreSQLReactor, postgreSQLWorkflowProcessor, processorsTableSQL, projectionsTableSQL, readLastMessageCheckpoint, readMessagesBatch, readProcessorCheckpoint, readProjectionInfo, readStream, rebuildPostgreSQLProjections, registerProjection, registerProjectionSQL, releaseProcessorLockSQL, sanitizeNameSQL, schemaMigration, schemaSQL, storeProcessorCheckpoint, storeSubscriptionCheckpointSQL, streamExists, streamsTableSQL, toProcessorLockKey, toProjectionLockKey, transactionToPostgreSQLProjectionHandlerContext, tryAcquireProcessorLockSQL, tryAcquireProjectionLockSQL };
800
+ //# sourceMappingURL=index.d.ts.map