@event-driven-io/emmett-postgresql 0.43.0-beta.2 → 0.43.0-beta.20

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