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

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.cts CHANGED
@@ -1,214 +1,269 @@
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_dumbo0 from "@event-driven-io/dumbo";
2
+ import { AnyConnection, DatabaseTransaction, Dumbo, MigrationStyle, QueryResultRow, RunSQLMigrationsResult, SQL, SQLExecutor, SQLMigration } from "@event-driven-io/dumbo";
3
+ import * as _$_event_driven_io_emmett0 from "@event-driven-io/emmett";
4
+ 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";
5
+ import { PgClient, PgClientConnection, PgConnection, PgDriverType, PgPool, PgPoolClientConnection, PgPoolOptions, PgTransaction } from "@event-driven-io/dumbo/pg";
6
+ import pg from "pg";
7
+ import { PongoClient, PongoDBCollectionOptions, PongoDocument, PongoFilter, WithId } from "@event-driven-io/pongo";
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
+ };
180
216
  } & ({
181
- evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
217
+ getDocumentId: (event: ReadEvent<EventType>) => string | null;
218
+ getDocumentIds?: never;
219
+ } | {
220
+ getDocumentId?: never;
221
+ getDocumentIds: (event: ReadEvent<EventType>) => string[];
222
+ }) & ({
223
+ evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
182
224
  } | {
183
- evolve: PongoWithNotNullDocumentEvolve<Document, EventType, EventMetaDataType>;
184
- initialState: () => Document;
185
- });
225
+ evolve: PongoWithNotNullDocumentEvolve<Document, EventType, EventMetaDataType>;
226
+ initialState: () => Document;
227
+ }) & JSONSerializationOptions;
186
228
  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
229
  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
- };
230
+ canHandle: CanHandle<EventType>;
231
+ version?: number;
232
+ collectionName: string;
233
+ collectionOptions?: PongoDBCollectionOptions<Document, DocumentPayload>;
234
+ eventsOptions?: {
235
+ schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
236
+ };
196
237
  } & ({
197
- evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
238
+ getDocumentId: (event: ReadEvent<EventType>) => string | null;
239
+ getDocumentIds?: never;
198
240
  } | {
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
-
241
+ getDocumentId?: never;
242
+ getDocumentIds: (event: ReadEvent<EventType>) => string[];
243
+ } | {
244
+ getDocumentId?: never;
245
+ getDocumentIds?: never;
246
+ }) & ({
247
+ evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
248
+ } | {
249
+ evolve: PongoWithNotNullDocumentEvolve<Document, EventType, EventMetaDataType>;
250
+ initialState: () => Document;
251
+ }) & JSONSerializationOptions;
252
+ declare const pongoSingleStreamProjection: <Document extends PongoDocument, EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata, EventPayloadType extends Event = EventType>({
253
+ getDocumentId,
254
+ getDocumentIds,
255
+ ...options
256
+ }: PongoSingleStreamProjectionOptions<Document, EventType, EventMetaDataType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
257
+ //#endregion
258
+ //#region src/eventStore/projections/pongo/pongoProjectionSpec.d.ts
204
259
  type PongoAssertOptions = {
205
- inCollection: string;
206
- inDatabase?: string;
260
+ inCollection: string;
261
+ inDatabase?: string;
207
262
  };
208
263
  type FilterOrId<Doc extends PongoDocument | WithId<PongoDocument>> = {
209
- withId: string;
264
+ withId: string;
210
265
  } | {
211
- matchingFilter: PongoFilter<Doc>;
266
+ matchingFilter: PongoFilter<Doc>;
212
267
  };
213
268
  declare const documentExists: <Doc extends PongoDocument | WithId<PongoDocument>>(document: Doc, options: PongoAssertOptions & FilterOrId<Doc>) => PostgreSQLProjectionAssert;
214
269
  declare const documentsAreTheSame: <Doc extends PongoDocument | WithId<PongoDocument>>(documents: Doc[], options: PongoAssertOptions & FilterOrId<Doc>) => PostgreSQLProjectionAssert;
@@ -216,259 +271,258 @@ declare const documentsMatchingHaveCount: <Doc extends PongoDocument | WithId<Po
216
271
  declare const documentMatchingExists: <Doc extends PongoDocument | WithId<PongoDocument>>(options: PongoAssertOptions & FilterOrId<Doc>) => PostgreSQLProjectionAssert;
217
272
  declare const documentDoesNotExist: <Doc extends PongoDocument | WithId<PongoDocument>>(options: PongoAssertOptions & FilterOrId<Doc>) => PostgreSQLProjectionAssert;
218
273
  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
- };
274
+ fromCollection: <Doc extends PongoDocument | WithId<PongoDocument>>(collectionName: string) => {
275
+ withId: (id: string) => {
276
+ toBeEqual: (document: Doc) => PostgreSQLProjectionAssert;
277
+ toExist: () => PostgreSQLProjectionAssert;
278
+ notToExist: () => PostgreSQLProjectionAssert;
231
279
  };
280
+ matching: <Doc_1 extends PongoDocument | WithId<PongoDocument>>(filter: PongoFilter<Doc_1>) => {
281
+ toBeTheSame: (documents: Doc_1[]) => PostgreSQLProjectionAssert;
282
+ toHaveCount: (expectedCount: number) => PostgreSQLProjectionAssert;
283
+ toExist: () => PostgreSQLProjectionAssert;
284
+ notToExist: () => PostgreSQLProjectionAssert;
285
+ };
286
+ };
232
287
  };
233
-
288
+ //#endregion
289
+ //#region src/eventStore/projections/postgresProjectionSpec.d.ts
234
290
  type PostgreSQLProjectionSpecEvent<EventType extends Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata> = EventType & {
235
- metadata?: Partial<EventMetaDataType>;
291
+ metadata?: Partial<EventMetaDataType>;
236
292
  };
237
293
  type PostgreSQLProjectionSpecWhenOptions = {
238
- numberOfTimes: number;
294
+ numberOfTimes: number;
295
+ };
296
+ type PostgreSQLProjectionSpec<EventType extends Event> = (givenEvents: PostgreSQLProjectionSpecEvent<EventType>[]) => {
297
+ when: (events: PostgreSQLProjectionSpecEvent<EventType>[], options?: PostgreSQLProjectionSpecWhenOptions) => {
298
+ then: (assert: PostgreSQLProjectionAssert, message?: string) => Promise<void>;
299
+ thenThrows: <ErrorType extends Error = Error>(...args: Parameters<ThenThrows<ErrorType>>) => Promise<void>;
300
+ };
239
301
  };
240
302
  type PostgreSQLProjectionAssert = (options: {
241
- pool: Dumbo;
242
- connectionString: string;
303
+ pool: Dumbo;
304
+ connectionString: string;
243
305
  }) => Promise<void | boolean>;
244
306
  type PostgreSQLProjectionSpecOptions<EventType extends Event> = {
245
- projection: PostgreSQLProjectionDefinition<EventType>;
307
+ projection: PostgreSQLProjectionDefinition<EventType>;
246
308
  } & 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
309
  declare const PostgreSQLProjectionSpec: {
254
- for: <EventType extends Event>(options: PostgreSQLProjectionSpecOptions<EventType>) => PostgreSQLProjectionSpec<EventType>;
310
+ for: <EventType extends Event>(options: PostgreSQLProjectionSpecOptions<EventType>) => PostgreSQLProjectionSpec<EventType>;
255
311
  };
256
312
  declare const eventInStream: <EventType extends Event = Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata>(streamName: string, event: PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>) => PostgreSQLProjectionSpecEvent<EventType, EventMetaDataType>;
257
313
  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>[];
314
+ 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
315
  declare const assertSQLQueryResultMatches: <T extends QueryResultRow>(sql: SQL, rows: T[]) => PostgreSQLProjectionAssert;
260
316
  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
- };
317
+ query: (sql: SQL) => {
318
+ resultRows: {
319
+ toBeTheSame: <T extends QueryResultRow>(rows: T[]) => PostgreSQLProjectionAssert;
296
320
  };
321
+ };
322
+ };
323
+ //#endregion
324
+ //#region src/eventStore/schema/readMessagesBatch.d.ts
325
+ declare const PostgreSQLEventStoreCheckpoint: {
326
+ default: {
327
+ transactionId: bigint;
328
+ globalPosition: bigint;
329
+ };
330
+ parse: (checkPoint: ProcessorCheckpoint | undefined | null) => PostgreSQLEventStoreCheckpoint;
331
+ toProcessorCheckpoint: (checkPoint: PostgreSQLEventStoreCheckpoint) => ProcessorCheckpoint;
332
+ };
333
+ type PostgreSQLEventStoreCheckpoint = {
334
+ transactionId: bigint;
335
+ globalPosition: bigint;
297
336
  };
298
- declare const processorsTable: {
299
- name: string;
337
+ type ReadMessagesBatchOptions = {
338
+ after: PostgreSQLEventStoreCheckpoint;
339
+ batchSize: number;
340
+ } | {
341
+ from: PostgreSQLEventStoreCheckpoint;
342
+ batchSize: number;
343
+ } | {
344
+ to: PostgreSQLEventStoreCheckpoint;
345
+ batchSize: number;
346
+ } | {
347
+ from: PostgreSQLEventStoreCheckpoint;
348
+ to: PostgreSQLEventStoreCheckpoint;
300
349
  };
301
- declare const projectionsTable: {
302
- name: string;
350
+ type ReadMessagesBatchResult<MessageType extends Message, MessageMetadataType extends RecordedMessageMetadata = RecordedMessageMetadata> = {
351
+ currentCheckpoint: PostgreSQLEventStoreCheckpoint;
352
+ messages: RecordedMessage<MessageType, MessageMetadataType>[];
353
+ areMessagesLeft: boolean;
303
354
  };
304
-
355
+ declare const readMessagesBatch: <MessageType extends Message, RecordedMessageMetadataType extends RecordedMessageMetadataWithGlobalPosition = RecordedMessageMetadataWithGlobalPosition>(execute: SQLExecutor, options: ReadMessagesBatchOptions & {
356
+ partition?: string;
357
+ }) => Promise<ReadMessagesBatchResult<MessageType, RecordedMessageMetadataType>>;
358
+ //#endregion
359
+ //#region src/eventStore/schema/appendToStream.d.ts
305
360
  declare const appendToStreamSQL: SQL;
306
361
  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;
362
+ messageIds: string[];
363
+ messagesData: DefaultRecord[];
364
+ messagesMetadata: DefaultRecord[];
365
+ schemaVersions: string[];
366
+ messageTypes: string[];
367
+ messageKinds: string[];
368
+ streamId: string;
369
+ streamType: string;
370
+ expectedStreamPosition: bigint | null;
371
+ partition: string;
317
372
  };
318
373
  declare const callAppendToStream: (params: CallAppendToStreamParams) => SQL;
319
374
  type AppendToStreamResult = {
320
- success: true;
321
- nextStreamPosition: bigint;
322
- globalPositions: bigint[];
323
- transactionId: string;
375
+ success: true;
376
+ nextStreamPosition: bigint;
377
+ checkpoints: PostgreSQLEventStoreCheckpoint[];
324
378
  } | {
325
- success: false;
379
+ success: false;
326
380
  };
327
381
  type AppendToStreamBeforeCommitHook = (messages: RecordedMessage[], context: {
328
- transaction: PgTransaction;
382
+ transaction: PgTransaction;
329
383
  }) => Promise<void>;
330
- declare const appendToStream: (pool: PgPool, streamName: string, streamType: string, messages: Message[], options?: AppendToStreamOptions & {
331
- partition?: string;
332
- beforeCommitHook?: AppendToStreamBeforeCommitHook;
384
+ declare const appendToStream: (connection: PgConnection, streamName: string, streamType: string, messages: Message[], options?: AppendToStreamOptions & {
385
+ partition?: string;
386
+ beforeCommitHook?: AppendToStreamBeforeCommitHook;
333
387
  }) => Promise<AppendToStreamResult>;
334
-
335
- declare const cleanupLegacySubscriptionTables: (connectionString: string) => Promise<void>;
336
-
388
+ type AppendToStreamSqlResult = {
389
+ success: boolean;
390
+ next_stream_position: string | null;
391
+ global_positions: string[] | null;
392
+ transaction_id: string | null | undefined;
393
+ };
394
+ declare const appentToStreamRaw: (execute: SQLExecutor, streamId: string, streamType: string, messages: RecordedMessage[], options?: {
395
+ expectedStreamVersion: bigint | null;
396
+ partition?: string;
397
+ }) => Promise<AppendToStreamSqlResult>;
398
+ //#endregion
399
+ //#region src/eventStore/schema/migrations/index.d.ts
400
+ declare const currentPostgreSQLEventStoreSchemaVersion = "0.43.0";
401
+ declare const pastEventStoreSchemaMigrations: SQLMigration[];
402
+ declare const eventStoreSchemaMigrations: SQLMigration[];
403
+ //#endregion
404
+ //#region src/eventStore/schema/processors/processorsLocks.d.ts
337
405
  declare const tryAcquireProcessorLockSQL: SQL;
338
406
  declare const releaseProcessorLockSQL: SQL;
339
407
  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;
408
+ lockKey: string;
409
+ processorId: string;
410
+ version: number;
411
+ partition: string;
412
+ processorInstanceId: string;
413
+ projectionName: string | null;
414
+ projectionType: 'i' | 'a' | null;
415
+ projectionKind: string | null;
416
+ lockTimeoutSeconds: number;
349
417
  };
350
418
  declare const callTryAcquireProcessorLock: (params: CallTryAcquireProcessorLockParams) => SQL;
351
419
  type CallReleaseProcessorLockParams = {
352
- lockKey: string;
353
- processorId: string;
354
- partition: string;
355
- version: number;
356
- processorInstanceId: string;
357
- projectionName: string | null;
420
+ lockKey: string;
421
+ processorId: string;
422
+ partition: string;
423
+ version: number;
424
+ processorInstanceId: string;
425
+ projectionName: string | null;
358
426
  };
359
427
  declare const callReleaseProcessorLock: (params: CallReleaseProcessorLockParams) => SQL;
360
-
428
+ //#endregion
429
+ //#region src/eventStore/schema/projections/projectionsLocks.d.ts
361
430
  declare const tryAcquireProjectionLockSQL: SQL;
362
431
  type CallTryAcquireProjectionLockParams = {
363
- lockKey: string;
364
- partition: string;
365
- name: string;
366
- version: number;
432
+ lockKey: string;
433
+ partition: string;
434
+ name: string;
435
+ version: number;
367
436
  };
368
437
  declare const callTryAcquireProjectionLock: (params: CallTryAcquireProjectionLockParams) => SQL;
369
-
438
+ //#endregion
439
+ //#region src/eventStore/schema/projections/registerProjection.d.ts
370
440
  declare const registerProjectionSQL: SQL;
371
441
  declare const activateProjectionSQL: SQL;
372
442
  declare const deactivateProjectionSQL: SQL;
373
443
  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;
444
+ lockKey: string;
445
+ name: string;
446
+ partition: string;
447
+ version: number;
448
+ type: 'i' | 'a';
449
+ kind: string;
450
+ status: string;
451
+ definition: string;
382
452
  };
383
453
  declare const callRegisterProjection: (params: CallRegisterProjectionParams) => SQL;
384
454
  type CallActivateProjectionParams = {
385
- lockKey: string;
386
- name: string;
387
- partition: string;
388
- version: number;
455
+ lockKey: string;
456
+ name: string;
457
+ partition: string;
458
+ version: number;
389
459
  };
390
460
  declare const callActivateProjection: (params: CallActivateProjectionParams) => SQL;
391
461
  type CallDeactivateProjectionParams = {
392
- lockKey: string;
393
- name: string;
394
- partition: string;
395
- version: number;
462
+ lockKey: string;
463
+ name: string;
464
+ partition: string;
465
+ version: number;
396
466
  };
397
467
  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
-
468
+ //#endregion
469
+ //#region src/eventStore/schema/readLastMessageCheckpoint.d.ts
470
+ type ReadLastMessageCheckpointResult = {
471
+ currentCheckpoint: PostgreSQLEventStoreCheckpoint | null;
472
+ };
473
+ declare const readLastMessageCheckpoint: (execute: SQLExecutor, options?: {
474
+ partition?: string;
475
+ }) => Promise<ReadLastMessageCheckpointResult>;
476
+ //#endregion
477
+ //#region src/eventStore/schema/readProcessorCheckpoint.d.ts
428
478
  type ReadProcessorCheckpointResult = {
429
- lastProcessedCheckpoint: ProcessorCheckpoint | null;
479
+ lastProcessedCheckpoint: ProcessorCheckpoint | null;
430
480
  };
431
481
  declare const readProcessorCheckpoint: (execute: SQLExecutor, options: {
432
- processorId: string;
433
- partition?: string;
434
- version?: number;
482
+ processorId: string;
483
+ partition?: string;
484
+ version?: number;
435
485
  }) => Promise<ReadProcessorCheckpointResult>;
436
-
486
+ //#endregion
487
+ //#region src/eventStore/schema/readStream.d.ts
437
488
  declare const readStream: <EventType extends Event, EventPayloadType extends Event = EventType>(execute: SQLExecutor, streamId: string, options?: ReadStreamOptions<EventType, EventPayloadType> & {
438
- partition?: string;
489
+ partition?: string;
439
490
  }) => Promise<ReadStreamResult<EventType, ReadEventMetadataWithGlobalPosition>>;
440
-
491
+ //#endregion
492
+ //#region src/eventStore/schema/storeProcessorCheckpoint.d.ts
441
493
  declare const storeSubscriptionCheckpointSQL: SQL;
442
494
  type CallStoreProcessorCheckpointParams = {
443
- processorId: string;
444
- version: number;
445
- position: string | null;
446
- checkPosition: string | null;
447
- partition: string;
448
- processorInstanceId: string;
495
+ processorId: string;
496
+ version: number;
497
+ position: string | null;
498
+ checkPosition: string | null;
499
+ partition: string;
500
+ processorInstanceId: string;
449
501
  };
450
502
  declare const callStoreProcessorCheckpoint: (params: CallStoreProcessorCheckpointParams) => SQL;
451
503
  type StoreProcessorCheckpointResult = {
452
- success: true;
453
- newCheckpoint: ProcessorCheckpoint | null;
504
+ success: true;
505
+ newCheckpoint: ProcessorCheckpoint | null;
454
506
  } | {
455
- success: false;
456
- reason: 'IGNORED' | 'MISMATCH' | 'CURRENT_AHEAD';
507
+ success: false;
508
+ reason: 'IGNORED' | 'MISMATCH' | 'CURRENT_AHEAD';
457
509
  };
458
510
  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;
511
+ processorId: string;
512
+ version: number | undefined;
513
+ newCheckpoint: ProcessorCheckpoint | null;
514
+ lastProcessedCheckpoint: ProcessorCheckpoint | null;
515
+ partition?: string;
516
+ processorInstanceId?: string;
465
517
  }) => Promise<StoreProcessorCheckpointResult>;
466
-
518
+ //#endregion
519
+ //#region src/eventStore/schema/streamExists.d.ts
467
520
  type PostgresStreamExistsOptions = {
468
- partition: string;
521
+ partition: string;
469
522
  };
470
523
  declare const streamExists: (execute: SQLExecutor, streamId: string, options?: PostgresStreamExistsOptions) => Promise<StreamExistsResult>;
471
-
524
+ //#endregion
525
+ //#region src/eventStore/schema/tables.d.ts
472
526
  declare const streamsTableSQL: SQL;
473
527
  declare const messagesTableSQL: SQL;
474
528
  declare const processorsTableSQL: SQL;
@@ -481,263 +535,267 @@ declare const addTenantSQL: SQL;
481
535
  declare const addModuleForAllTenantsSQL: SQL;
482
536
  declare const addTenantForAllModulesSQL: SQL;
483
537
  declare const addDefaultPartitionSQL: SQL;
484
-
538
+ //#endregion
539
+ //#region src/eventStore/schema/index.d.ts
485
540
  declare const schemaSQL: SQL[];
486
- declare const schemaMigration: SQLMigration;
487
- declare const eventStoreSchemaMigrations: SQLMigration[];
541
+ declare const schemaMigration: _$_event_driven_io_dumbo0.SQLMigration;
488
542
  type CreateEventStoreSchemaOptions = {
489
- dryRun?: boolean | undefined;
490
- ignoreMigrationHashMismatch?: boolean | undefined;
491
- migrationTimeoutMs?: number | undefined;
492
- };
543
+ dryRun?: boolean | undefined;
544
+ ignoreMigrationHashMismatch?: boolean | undefined;
545
+ migrationTimeoutMs?: number | undefined;
546
+ } & JSONSerializationOptions;
493
547
  type EventStoreSchemaMigrationOptions = {
494
- migrationOptions?: CreateEventStoreSchemaOptions;
548
+ migrationOptions?: CreateEventStoreSchemaOptions;
495
549
  };
496
550
  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;
551
+ //#endregion
552
+ //#region src/eventStore/projections/postgreSQLProjection.d.ts
553
+ type PostgreSQLProjectionHandlerContext = ProjectionHandlerContext<{
554
+ execute: SQLExecutor;
555
+ connection: {
556
+ connectionString: string;
557
+ client: PgClient;
558
+ transaction: PgTransaction;
559
+ pool: Dumbo;
560
+ };
561
+ } & EventStoreSchemaMigrationOptions>;
507
562
  declare const transactionToPostgreSQLProjectionHandlerContext: (connectionString: string, pool: Dumbo, transaction: PgTransaction | DatabaseTransaction<AnyConnection>) => Promise<PostgreSQLProjectionHandlerContext>;
508
563
  type PostgreSQLProjectionHandler<EventType extends Event = Event, EventMetaDataType extends PostgresReadEventMetadata = PostgresReadEventMetadata> = ProjectionHandler<EventType, EventMetaDataType, PostgreSQLProjectionHandlerContext>;
509
564
  type PostgreSQLProjectionDefinition<EventType extends Event = Event, EventPayloadType extends Event = EventType> = ProjectionDefinition<EventType, PostgresReadEventMetadata, PostgreSQLProjectionHandlerContext, EventPayloadType>;
510
565
  type PostgreSQLProjectionHandlerOptions<EventType extends Event = Event> = {
511
- events: ReadEvent<EventType, PostgresReadEventMetadata>[];
512
- projections: PostgreSQLProjectionDefinition<EventType>[];
513
- partition?: string;
566
+ events: ReadEvent<EventType, PostgresReadEventMetadata>[];
567
+ projections: PostgreSQLProjectionDefinition<EventType>[];
568
+ partition?: string;
514
569
  } & PostgreSQLProjectionHandlerContext;
515
570
  declare const handleProjections: <EventType extends Event = Event>(options: PostgreSQLProjectionHandlerOptions<EventType>) => Promise<void>;
516
571
  declare const postgreSQLProjection: <EventType extends Event, EventPayloadType extends Event = EventType>(definition: PostgreSQLProjectionDefinition<EventType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
517
572
  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
- };
573
+ name: string;
574
+ kind?: string;
575
+ version?: number;
576
+ evolve: (events: EventType[], context: PostgreSQLProjectionHandlerContext) => Promise<SQL[]> | SQL[];
577
+ canHandle: CanHandle<EventType>;
578
+ init?: (context: ProjectionInitOptions<PostgreSQLProjectionHandlerContext>) => void | Promise<void> | SQL | Promise<SQL> | Promise<SQL[]> | SQL[];
579
+ eventsOptions?: {
580
+ schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
581
+ };
582
+ } & JSONSerializationOptions;
528
583
  declare const postgreSQLRawBatchSQLProjection: <EventType extends Event, EventPayloadType extends Event = EventType>(options: PostgreSQLRawBatchSQLProjection<EventType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
529
584
  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
- };
585
+ name: string;
586
+ kind?: string;
587
+ version?: number;
588
+ evolve: (events: EventType, context: PostgreSQLProjectionHandlerContext) => Promise<SQL[]> | SQL[] | Promise<SQL> | SQL;
589
+ canHandle: CanHandle<EventType>;
590
+ init?: (context: ProjectionInitOptions<PostgreSQLProjectionHandlerContext>) => void | Promise<void> | SQL | Promise<SQL> | Promise<SQL[]> | SQL[];
591
+ eventsOptions?: {
592
+ schema?: EventStoreReadSchemaOptions<EventType, EventPayloadType>;
593
+ };
594
+ } & JSONSerializationOptions;
540
595
  declare const postgreSQLRawSQLProjection: <EventType extends Event, EventPayloadType extends Event = EventType>(options: PostgreSQLRawSQLProjection<EventType, EventPayloadType>) => PostgreSQLProjectionDefinition<EventType, EventPayloadType>;
541
-
596
+ //#endregion
597
+ //#region src/eventStore/postgreSQLEventStore.d.ts
542
598
  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
- };
599
+ appendToStream<EventType extends Event, EventPayloadType extends Event = EventType>(streamName: string, events: EventType[], options?: AppendToStreamOptions<EventType, EventPayloadType>): Promise<AppendToStreamResultWithGlobalPosition>;
600
+ consumer<ConsumerEventType extends Event = Event>(options?: PostgreSQLEventStoreConsumerConfig<ConsumerEventType>): PostgreSQLEventStoreConsumer<ConsumerEventType>;
601
+ close(): Promise<void>;
602
+ streamExists(streamName: string, options?: PostgresStreamExistsOptions): Promise<StreamExistsResult>;
603
+ schema: {
604
+ sql(): string;
605
+ print(): void;
606
+ migrate(options?: CreateEventStoreSchemaOptions): Promise<RunSQLMigrationsResult>;
607
+ dangerous: {
608
+ truncate(options?: {
609
+ resetSequences?: boolean;
610
+ truncateProjections?: boolean;
611
+ }): Promise<void>;
557
612
  };
613
+ };
558
614
  }
559
615
  type PostgresReadEventMetadata = ReadEventMetadataWithGlobalPosition;
560
616
  type PostgresReadEvent<EventType extends Event = Event> = ReadEvent<EventType, PostgresReadEventMetadata>;
561
617
  type PostgresEventStorePooledOptions = {
562
- connector?: PgDriverType;
563
- connectionString?: string;
564
- database?: string;
565
- pooled: true;
566
- pool: pg.Pool;
618
+ connector?: PgDriverType;
619
+ connectionString?: string;
620
+ database?: string;
621
+ pooled: true;
622
+ pool: pg.Pool;
567
623
  } | {
568
- connector?: PgDriverType;
569
- connectionString?: string;
570
- database?: string;
571
- pool: pg.Pool;
624
+ connector?: PgDriverType;
625
+ connectionString?: string;
626
+ database?: string;
627
+ pool: pg.Pool;
572
628
  } | {
573
- connector?: PgDriverType;
574
- connectionString?: string;
575
- database?: string;
576
- pooled: true;
629
+ connector?: PgDriverType;
630
+ connectionString?: string;
631
+ database?: string;
632
+ pooled: true;
577
633
  } | {
578
- connector?: PgDriverType;
579
- connectionString?: string;
580
- database?: string;
634
+ connector?: PgDriverType;
635
+ connectionString?: string;
636
+ database?: string;
581
637
  };
582
638
  type PostgresEventStoreNotPooledOptions = {
583
- connector?: PgDriverType;
584
- connectionString?: string;
585
- database?: string;
586
- pooled: false;
587
- client: pg.Client;
639
+ connector?: PgDriverType;
640
+ connectionString?: string;
641
+ database?: string;
642
+ pooled: false;
643
+ client: pg.Client;
588
644
  } | {
589
- connector?: PgDriverType;
590
- connectionString?: string;
591
- database?: string;
592
- client: pg.Client;
645
+ connector?: PgDriverType;
646
+ connectionString?: string;
647
+ database?: string;
648
+ client: pg.Client;
593
649
  } | {
594
- connector?: PgDriverType;
595
- connectionString?: string;
596
- database?: string;
597
- pooled: false;
650
+ connector?: PgDriverType;
651
+ connectionString?: string;
652
+ database?: string;
653
+ pooled: false;
598
654
  } | {
599
- connector?: PgDriverType;
600
- connectionString?: string;
601
- database?: string;
602
- connection: PgPoolClientConnection | PgClientConnection;
603
- pooled?: false;
655
+ connector?: PgDriverType;
656
+ connectionString?: string;
657
+ database?: string;
658
+ connection: PgPoolClientConnection | PgClientConnection;
659
+ pooled?: false;
604
660
  } | {
605
- connector?: PgDriverType;
606
- connectionString?: string;
607
- database?: string;
608
- dumbo: PgPool;
609
- pooled?: false;
661
+ connector?: PgDriverType;
662
+ connectionString?: string;
663
+ database?: string;
664
+ dumbo: PgPool;
665
+ pooled?: false;
610
666
  };
611
667
  type PostgresEventStoreConnectionOptions = PostgresEventStorePooledOptions | PostgresEventStoreNotPooledOptions;
612
668
  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
- };
669
+ projections?: ProjectionRegistration<'inline', PostgresReadEventMetadata, PostgreSQLProjectionHandlerContext>[];
670
+ schema?: {
671
+ autoMigration?: MigrationStyle;
672
+ };
673
+ connectionOptions?: PostgresEventStoreConnectionOptions;
674
+ hooks?: {
675
+ /**
676
+ * This hook will be called **BEFORE** event store schema is created
677
+ */
678
+ onBeforeSchemaCreated?: (context: PostgreSQLProjectionHandlerContext) => Promise<void> | void;
679
+ /**
680
+ * This hook will be called **AFTER** event store schema was created but before transaction commits
681
+ */
682
+ onAfterSchemaCreated?: (context: PostgreSQLProjectionHandlerContext) => Promise<void> | void;
683
+ };
684
+ } & JSONSerializationOptions;
629
685
  declare const defaultPostgreSQLOptions: PostgresEventStoreOptions;
630
686
  declare const PostgreSQLEventStoreDefaultStreamVersion = 0n;
631
687
  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;
688
+ //#endregion
689
+ //#region src/eventStore/consumers/postgreSQLProcessor.d.ts
690
+ type PostgreSQLProcessorHandlerContext = MessageHandlerContext<{
691
+ partition: string;
692
+ execute: SQLExecutor;
693
+ connection: {
694
+ connectionString: string;
695
+ client: PgClient;
696
+ transaction: PgTransaction;
697
+ pool: Dumbo;
698
+ messageStore: PostgresEventStore;
699
+ };
700
+ } & EventStoreSchemaMigrationOptions>;
644
701
  type PostgreSQLProcessor<MessageType extends Message = AnyMessage> = MessageProcessor<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>;
645
702
  type PostgreSQLProcessorEachMessageHandler<MessageType extends Message = Message> = SingleRecordedMessageHandlerWithContext<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>;
646
703
  type PostgreSQLProcessorEachBatchHandler<MessageType extends Message = Message> = BatchRecordedMessageHandlerWithContext<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>;
647
704
  type PostgreSQLProcessorStartFrom = PostgreSQLEventStoreMessageBatchPullerStartFrom | 'CURRENT';
648
705
  type PostgreSQLProcessorPooledOptions = {
649
- connector?: PgDriverType;
650
- database?: string;
651
- pooled: true;
652
- pool: pg.Pool;
706
+ connector?: PgDriverType;
707
+ database?: string;
708
+ pooled: true;
709
+ pool: pg.Pool;
653
710
  } | {
654
- connector?: PgDriverType;
655
- database?: string;
656
- pool: pg.Pool;
711
+ connector?: PgDriverType;
712
+ database?: string;
713
+ pool: pg.Pool;
657
714
  } | {
658
- connector?: PgDriverType;
659
- database?: string;
660
- pooled: true;
715
+ connector?: PgDriverType;
716
+ database?: string;
717
+ pooled: true;
661
718
  } | {
662
- connector?: PgDriverType;
663
- database?: string;
719
+ connector?: PgDriverType;
720
+ database?: string;
664
721
  };
665
722
  type PostgreSQLProcessorNotPooledOptions = {
666
- connector?: PgDriverType;
667
- database?: string;
668
- pooled: false;
669
- client: pg.Client;
723
+ connector?: PgDriverType;
724
+ database?: string;
725
+ pooled: false;
726
+ client: pg.Client;
670
727
  } | {
671
- connector?: PgDriverType;
672
- database?: string;
673
- client: pg.Client;
728
+ connector?: PgDriverType;
729
+ database?: string;
730
+ client: pg.Client;
674
731
  } | {
675
- connector?: PgDriverType;
676
- database?: string;
677
- pooled: false;
732
+ connector?: PgDriverType;
733
+ database?: string;
734
+ pooled: false;
678
735
  } | {
679
- connector?: PgDriverType;
680
- database?: string;
681
- connection: PgPoolClientConnection | PgClientConnection;
682
- pooled?: false;
736
+ connector?: PgDriverType;
737
+ database?: string;
738
+ connection: PgPoolClientConnection | PgClientConnection;
739
+ pooled?: false;
683
740
  } | {
684
- connector?: PgDriverType;
685
- database?: string;
686
- dumbo: PgPool;
687
- pooled?: false;
741
+ connector?: PgDriverType;
742
+ database?: string;
743
+ dumbo: PgPool;
744
+ pooled?: false;
688
745
  };
689
746
  type PostgreSQLProcessorConnectionOptions = {
690
- connectionString: string;
747
+ connectionString: string;
691
748
  } & (PostgreSQLProcessorPooledOptions | PostgreSQLProcessorNotPooledOptions);
692
749
  type PostgreSQLCheckpointer<MessageType extends AnyMessage = AnyMessage> = Checkpointer<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>;
693
750
  declare const postgreSQLCheckpointer: <MessageType extends Message = Message>() => PostgreSQLCheckpointer<MessageType>;
694
751
  type PostgreSQLConnectionOptions = {
695
- connectionOptions?: PostgreSQLProcessorConnectionOptions;
696
- };
752
+ connectionOptions?: PostgreSQLProcessorConnectionOptions;
753
+ } & JSONSerializationOptions;
697
754
  type PostgreSQLProcessorOptionsBase = PostgreSQLConnectionOptions & {
698
- lock?: {
699
- acquisitionPolicy?: LockAcquisitionPolicy;
700
- timeoutSeconds?: number;
701
- };
702
- partition?: string;
755
+ lock?: {
756
+ acquisitionPolicy?: LockAcquisitionPolicy;
757
+ timeoutSeconds?: number;
758
+ };
759
+ partition?: string;
703
760
  };
704
761
  type PostgreSQLReactorOptions<MessageType extends Message = Message, MessagePayloadType extends AnyMessage = MessageType> = ReactorOptions<MessageType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext, MessagePayloadType> & PostgreSQLProcessorOptionsBase;
705
762
  type PostgreSQLProjectorOptions<EventType extends AnyEvent = AnyEvent, EventPayloadType extends Event = EventType> = ProjectorOptions<EventType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext, EventPayloadType> & PostgreSQLProcessorOptionsBase & EventStoreSchemaMigrationOptions;
706
763
  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
764
  declare const postgreSQLProjector: <EventType extends Event = Event, EventPayloadType extends Event = EventType>(options: PostgreSQLProjectorOptions<EventType, EventPayloadType>) => PostgreSQLProcessor<EventType>;
709
765
  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
766
  declare const postgreSQLReactor: <MessageType extends Message = Message, MessagePayloadType extends AnyMessage = MessageType>(options: PostgreSQLReactorOptions<MessageType, MessagePayloadType>) => PostgreSQLProcessor<MessageType>;
711
-
767
+ //#endregion
768
+ //#region src/eventStore/consumers/postgreSQLEventStoreConsumer.d.ts
712
769
  type PostgreSQLEventStoreConsumerConfig<ConsumerMessageType extends Message = any> = MessageConsumerOptions<ConsumerMessageType> & {
713
- stopWhen?: {
714
- noMessagesLeft?: boolean;
715
- };
716
- pulling?: {
717
- batchSize?: number;
718
- pullingFrequencyInMs?: number;
719
- };
720
- };
770
+ stopWhen?: {
771
+ noMessagesLeft?: boolean;
772
+ };
773
+ pulling?: {
774
+ batchSize?: number;
775
+ pullingFrequencyInMs?: number;
776
+ };
777
+ } & JSONSerializationOptions;
721
778
  type PostgreSQLEventStoreConsumerOptions<ConsumerMessageType extends Message = Message> = PostgreSQLEventStoreConsumerConfig<ConsumerMessageType> & {
722
- connectionString: string;
723
- pool?: Dumbo;
779
+ connectionString: string;
780
+ pool?: Dumbo;
724
781
  };
725
782
  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>;
783
+ reactor: <MessageType extends AnyMessage = ConsumerMessageType>(options: PostgreSQLReactorOptions<MessageType>) => PostgreSQLProcessor<MessageType>;
784
+ 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
785
  }> & (AnyEvent extends ConsumerMessageType ? Readonly<{
729
- projector: <EventType extends AnyEvent = ConsumerMessageType & AnyEvent>(options: PostgreSQLProjectorOptions<EventType>) => PostgreSQLProcessor<EventType>;
786
+ projector: <EventType extends AnyEvent = ConsumerMessageType & AnyEvent>(options: PostgreSQLProjectorOptions<EventType>) => PostgreSQLProcessor<EventType>;
730
787
  }> : object);
731
788
  declare const postgreSQLEventStoreConsumer: <ConsumerMessageType extends Message = AnyMessage>(options: PostgreSQLEventStoreConsumerOptions<ConsumerMessageType>) => PostgreSQLEventStoreConsumer<ConsumerMessageType>;
732
-
789
+ //#endregion
790
+ //#region src/eventStore/consumers/rebuildPostgreSQLProjections.d.ts
733
791
  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
- };
792
+ lock?: {
793
+ acquisitionPolicy?: LockAcquisitionPolicy;
794
+ timeoutSeconds?: number;
795
+ };
739
796
  } & ({
740
- projections: (ProjectorOptions<EventType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext> | PostgreSQLProjectionDefinition<EventType>)[];
797
+ projections: (ProjectorOptions<EventType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext> | PostgreSQLProjectionDefinition<EventType>)[];
741
798
  } | 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 };
799
+ //#endregion
800
+ 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 };
801
+ //# sourceMappingURL=index.d.cts.map