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