@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/README.md +437 -0
- package/dist/index.cjs +2920 -4720
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +550 -509
- package/dist/index.d.ts +550 -509
- package/dist/index.js +2517 -4402
- package/dist/index.js.map +1 -1
- package/package.json +20 -19
package/dist/index.d.ts
CHANGED
|
@@ -1,214 +1,252 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
type: 'STOP';
|
|
14
|
+
reason?: string;
|
|
15
|
+
error?: EmmettError;
|
|
14
16
|
};
|
|
15
17
|
type PostgreSQLEventStoreMessageBatchPullerOptions<MessageType extends Message = Message> = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
28
|
+
lastCheckpoint: ProcessorCheckpoint;
|
|
27
29
|
} | 'BEGINNING' | 'END';
|
|
28
30
|
type PostgreSQLEventStoreMessageBatchPullerStartOptions = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
startFrom: PostgreSQLEventStoreMessageBatchPullerStartFrom;
|
|
32
|
+
signal?: AbortSignal;
|
|
33
|
+
started?: AsyncAwaiter<void>;
|
|
31
34
|
};
|
|
32
35
|
type PostgreSQLEventStoreMessageBatchPuller = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
declare const postgreSQLEventStoreMessageBatchPuller: <MessageType extends Message = Message>({
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
66
|
+
type: 'fail';
|
|
56
67
|
} | {
|
|
57
|
-
|
|
68
|
+
type: 'skip';
|
|
58
69
|
} | {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
93
|
+
execute: SQLExecutor;
|
|
82
94
|
};
|
|
83
95
|
type PostgreSQLProcessorLock = {
|
|
84
|
-
|
|
85
|
-
|
|
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: ({
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
118
|
+
projectionName: string;
|
|
119
|
+
partition: string;
|
|
120
|
+
version: number;
|
|
121
|
+
lockKey?: string | bigint;
|
|
103
122
|
};
|
|
104
123
|
type PostgreSQLProjectionLockContext = {
|
|
105
|
-
|
|
124
|
+
execute: SQLExecutor;
|
|
106
125
|
};
|
|
107
126
|
type PostgreSQLProjectionLock = {
|
|
108
|
-
|
|
109
|
-
|
|
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: ({
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
143
|
+
registered: boolean;
|
|
120
144
|
}>;
|
|
121
145
|
declare const activateProjection: (execute: SQLExecutor, options: {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
146
|
+
name: string;
|
|
147
|
+
partition: string;
|
|
148
|
+
version: number;
|
|
125
149
|
}) => Promise<{
|
|
126
|
-
|
|
150
|
+
activated: boolean;
|
|
127
151
|
}>;
|
|
128
152
|
declare const deactivateProjection: (execute: SQLExecutor, options: {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
153
|
+
name: string;
|
|
154
|
+
partition: string;
|
|
155
|
+
version: number;
|
|
132
156
|
}) => Promise<{
|
|
133
|
-
|
|
157
|
+
deactivated: boolean;
|
|
134
158
|
}>;
|
|
135
159
|
type ProjectionRegistrationWithMandatoryData = ProjectionRegistration<ProjectionHandlingType> & {
|
|
136
|
-
|
|
160
|
+
projection: Required<Pick<ProjectionDefinition, 'kind' | 'version' | 'name'>>;
|
|
137
161
|
};
|
|
138
162
|
type ReadProjectionInfoResult = {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
};
|
|
145
|
-
declare const readProjectionInfo: (execute: SQLExecutor, {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
};
|
|
169
|
-
declare const pongoProjection: <EventType extends Event, EventPayloadType extends Event = EventType>({
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
-
|
|
218
|
+
evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
|
|
182
219
|
} | {
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
-
|
|
234
|
+
evolve: PongoWithNullableDocumentEvolve<Document, EventType, EventMetaDataType>;
|
|
198
235
|
} | {
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
|
|
206
|
-
|
|
243
|
+
inCollection: string;
|
|
244
|
+
inDatabase?: string;
|
|
207
245
|
};
|
|
208
246
|
type FilterOrId<Doc extends PongoDocument | WithId<PongoDocument>> = {
|
|
209
|
-
|
|
247
|
+
withId: string;
|
|
210
248
|
} | {
|
|
211
|
-
|
|
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
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
|
|
274
|
+
metadata?: Partial<EventMetaDataType>;
|
|
236
275
|
};
|
|
237
276
|
type PostgreSQLProjectionSpecWhenOptions = {
|
|
238
|
-
|
|
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
|
-
|
|
242
|
-
|
|
286
|
+
pool: Dumbo;
|
|
287
|
+
connectionString: string;
|
|
243
288
|
}) => Promise<void | boolean>;
|
|
244
289
|
type PostgreSQLProjectionSpecOptions<EventType extends Event> = {
|
|
245
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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
|
-
|
|
299
|
-
|
|
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
|
-
|
|
302
|
-
|
|
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
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
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
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
transactionId: string;
|
|
358
|
+
success: true;
|
|
359
|
+
nextStreamPosition: bigint;
|
|
360
|
+
checkpoints: PostgreSQLEventStoreCheckpoint[];
|
|
324
361
|
} | {
|
|
325
|
-
|
|
362
|
+
success: false;
|
|
326
363
|
};
|
|
327
364
|
type AppendToStreamBeforeCommitHook = (messages: RecordedMessage[], context: {
|
|
328
|
-
|
|
365
|
+
transaction: PgTransaction;
|
|
329
366
|
}) => Promise<void>;
|
|
330
|
-
declare const appendToStream: (
|
|
331
|
-
|
|
332
|
-
|
|
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
|
-
|
|
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
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
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
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
445
|
+
lockKey: string;
|
|
446
|
+
name: string;
|
|
447
|
+
partition: string;
|
|
448
|
+
version: number;
|
|
396
449
|
};
|
|
397
450
|
declare const callDeactivateProjection: (params: CallDeactivateProjectionParams) => SQL;
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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
|
-
|
|
462
|
+
lastProcessedCheckpoint: ProcessorCheckpoint | null;
|
|
430
463
|
};
|
|
431
464
|
declare const readProcessorCheckpoint: (execute: SQLExecutor, options: {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
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
|
-
|
|
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
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
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
|
-
|
|
453
|
-
|
|
487
|
+
success: true;
|
|
488
|
+
newCheckpoint: ProcessorCheckpoint | null;
|
|
454
489
|
} | {
|
|
455
|
-
|
|
456
|
-
|
|
490
|
+
success: false;
|
|
491
|
+
reason: 'IGNORED' | 'MISMATCH' | 'CURRENT_AHEAD';
|
|
457
492
|
};
|
|
458
493
|
declare const storeProcessorCheckpoint: (execute: SQLExecutor, options: {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
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
|
-
|
|
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
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
};
|
|
526
|
+
dryRun?: boolean | undefined;
|
|
527
|
+
ignoreMigrationHashMismatch?: boolean | undefined;
|
|
528
|
+
migrationTimeoutMs?: number | undefined;
|
|
529
|
+
} & JSONSerializationOptions;
|
|
493
530
|
type EventStoreSchemaMigrationOptions = {
|
|
494
|
-
|
|
531
|
+
migrationOptions?: CreateEventStoreSchemaOptions;
|
|
495
532
|
};
|
|
496
533
|
declare const createEventStoreSchema: (connectionString: string, pool: PgPool, hooks?: PostgresEventStoreOptions["hooks"], options?: CreateEventStoreSchemaOptions) => Promise<RunSQLMigrationsResult>;
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
}
|
|
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
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
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
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
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
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
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
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
601
|
+
connector?: PgDriverType;
|
|
602
|
+
connectionString?: string;
|
|
603
|
+
database?: string;
|
|
604
|
+
pooled: true;
|
|
605
|
+
pool: pg.Pool;
|
|
567
606
|
} | {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
607
|
+
connector?: PgDriverType;
|
|
608
|
+
connectionString?: string;
|
|
609
|
+
database?: string;
|
|
610
|
+
pool: pg.Pool;
|
|
572
611
|
} | {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
612
|
+
connector?: PgDriverType;
|
|
613
|
+
connectionString?: string;
|
|
614
|
+
database?: string;
|
|
615
|
+
pooled: true;
|
|
577
616
|
} | {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
617
|
+
connector?: PgDriverType;
|
|
618
|
+
connectionString?: string;
|
|
619
|
+
database?: string;
|
|
581
620
|
};
|
|
582
621
|
type PostgresEventStoreNotPooledOptions = {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
622
|
+
connector?: PgDriverType;
|
|
623
|
+
connectionString?: string;
|
|
624
|
+
database?: string;
|
|
625
|
+
pooled: false;
|
|
626
|
+
client: pg.Client;
|
|
588
627
|
} | {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
628
|
+
connector?: PgDriverType;
|
|
629
|
+
connectionString?: string;
|
|
630
|
+
database?: string;
|
|
631
|
+
client: pg.Client;
|
|
593
632
|
} | {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
633
|
+
connector?: PgDriverType;
|
|
634
|
+
connectionString?: string;
|
|
635
|
+
database?: string;
|
|
636
|
+
pooled: false;
|
|
598
637
|
} | {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
638
|
+
connector?: PgDriverType;
|
|
639
|
+
connectionString?: string;
|
|
640
|
+
database?: string;
|
|
641
|
+
connection: PgPoolClientConnection | PgClientConnection;
|
|
642
|
+
pooled?: false;
|
|
604
643
|
} | {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
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
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
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
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}
|
|
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
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
689
|
+
connector?: PgDriverType;
|
|
690
|
+
database?: string;
|
|
691
|
+
pooled: true;
|
|
692
|
+
pool: pg.Pool;
|
|
653
693
|
} | {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
694
|
+
connector?: PgDriverType;
|
|
695
|
+
database?: string;
|
|
696
|
+
pool: pg.Pool;
|
|
657
697
|
} | {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
698
|
+
connector?: PgDriverType;
|
|
699
|
+
database?: string;
|
|
700
|
+
pooled: true;
|
|
661
701
|
} | {
|
|
662
|
-
|
|
663
|
-
|
|
702
|
+
connector?: PgDriverType;
|
|
703
|
+
database?: string;
|
|
664
704
|
};
|
|
665
705
|
type PostgreSQLProcessorNotPooledOptions = {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
706
|
+
connector?: PgDriverType;
|
|
707
|
+
database?: string;
|
|
708
|
+
pooled: false;
|
|
709
|
+
client: pg.Client;
|
|
670
710
|
} | {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
711
|
+
connector?: PgDriverType;
|
|
712
|
+
database?: string;
|
|
713
|
+
client: pg.Client;
|
|
674
714
|
} | {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
715
|
+
connector?: PgDriverType;
|
|
716
|
+
database?: string;
|
|
717
|
+
pooled: false;
|
|
678
718
|
} | {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
719
|
+
connector?: PgDriverType;
|
|
720
|
+
database?: string;
|
|
721
|
+
connection: PgPoolClientConnection | PgClientConnection;
|
|
722
|
+
pooled?: false;
|
|
683
723
|
} | {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
724
|
+
connector?: PgDriverType;
|
|
725
|
+
database?: string;
|
|
726
|
+
dumbo: PgPool;
|
|
727
|
+
pooled?: false;
|
|
688
728
|
};
|
|
689
729
|
type PostgreSQLProcessorConnectionOptions = {
|
|
690
|
-
|
|
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
|
-
|
|
696
|
-
};
|
|
735
|
+
connectionOptions?: PostgreSQLProcessorConnectionOptions;
|
|
736
|
+
} & JSONSerializationOptions;
|
|
697
737
|
type PostgreSQLProcessorOptionsBase = PostgreSQLConnectionOptions & {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
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
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
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
|
-
|
|
723
|
-
|
|
762
|
+
connectionString: string;
|
|
763
|
+
pool?: Dumbo;
|
|
724
764
|
};
|
|
725
765
|
type PostgreSQLEventStoreConsumer<ConsumerMessageType extends AnyMessage = any> = MessageConsumer<ConsumerMessageType> & Readonly<{
|
|
726
|
-
|
|
727
|
-
|
|
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
|
-
|
|
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
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
};
|
|
775
|
+
lock?: {
|
|
776
|
+
acquisitionPolicy?: LockAcquisitionPolicy;
|
|
777
|
+
timeoutSeconds?: number;
|
|
778
|
+
};
|
|
739
779
|
} & ({
|
|
740
|
-
|
|
780
|
+
projections: (ProjectorOptions<EventType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext> | PostgreSQLProjectionDefinition<EventType>)[];
|
|
741
781
|
} | ProjectorOptions<EventType, ReadEventMetadataWithGlobalPosition, PostgreSQLProcessorHandlerContext>)) => PostgreSQLEventStoreConsumer<EventType>;
|
|
742
|
-
|
|
743
|
-
export {
|
|
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
|