@event-driven-io/emmett 0.43.0-beta.12 → 0.43.0-beta.13
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 +591 -0
- package/dist/index.cjs +145 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -14
- package/dist/index.d.ts +30 -14
- package/dist/index.js +83 -37
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -116,6 +116,15 @@ var _uuid = require('uuid');
|
|
|
116
116
|
// src/database/inMemoryDatabase.ts
|
|
117
117
|
|
|
118
118
|
|
|
119
|
+
// src/utils/async/mapAsync.ts
|
|
120
|
+
async function reduceAsync(items, fn, initial) {
|
|
121
|
+
let accumulator = initial;
|
|
122
|
+
for (let i = 0; i < items.length; i++) {
|
|
123
|
+
accumulator = await fn(accumulator, items[i], i);
|
|
124
|
+
}
|
|
125
|
+
return accumulator;
|
|
126
|
+
}
|
|
127
|
+
|
|
119
128
|
// src/utils/collections/duplicates.ts
|
|
120
129
|
var hasDuplicates = (array, predicate) => {
|
|
121
130
|
const mapped = array.map(predicate);
|
|
@@ -1207,7 +1216,40 @@ var reactor = (options) => {
|
|
|
1207
1216
|
canHandle,
|
|
1208
1217
|
stopAfter
|
|
1209
1218
|
} = options;
|
|
1210
|
-
const
|
|
1219
|
+
const isCustomBatch = "eachBatch" in options && !!options.eachBatch;
|
|
1220
|
+
const eachBatch = isCustomBatch ? options.eachBatch : async (messages, context) => {
|
|
1221
|
+
let result = void 0;
|
|
1222
|
+
for (let i = 0; i < messages.length; i++) {
|
|
1223
|
+
const message2 = messages[i];
|
|
1224
|
+
const messageProcessingResult = await options.eachMessage(
|
|
1225
|
+
message2,
|
|
1226
|
+
context
|
|
1227
|
+
);
|
|
1228
|
+
if (messageProcessingResult && messageProcessingResult.type === "STOP") {
|
|
1229
|
+
result = {
|
|
1230
|
+
...messageProcessingResult,
|
|
1231
|
+
lastSuccessfulMessage: messageProcessingResult.error ? messages[i - 1] : message2
|
|
1232
|
+
};
|
|
1233
|
+
break;
|
|
1234
|
+
}
|
|
1235
|
+
if (stopAfter && stopAfter(message2)) {
|
|
1236
|
+
result = {
|
|
1237
|
+
type: "STOP",
|
|
1238
|
+
reason: "Stop condition reached",
|
|
1239
|
+
lastSuccessfulMessage: message2
|
|
1240
|
+
};
|
|
1241
|
+
break;
|
|
1242
|
+
}
|
|
1243
|
+
if (messageProcessingResult && messageProcessingResult.type === "SKIP") {
|
|
1244
|
+
result = {
|
|
1245
|
+
...messageProcessingResult,
|
|
1246
|
+
lastSuccessfulMessage: message2
|
|
1247
|
+
};
|
|
1248
|
+
continue;
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
return result;
|
|
1252
|
+
};
|
|
1211
1253
|
let isInitiated = false;
|
|
1212
1254
|
let isActive = false;
|
|
1213
1255
|
let lastCheckpoint = null;
|
|
@@ -1245,10 +1287,11 @@ var reactor = (options) => {
|
|
|
1245
1287
|
await init(startOptions);
|
|
1246
1288
|
isActive = true;
|
|
1247
1289
|
closeSignal = onShutdown(() => close(startOptions));
|
|
1248
|
-
if (lastCheckpoint !== null)
|
|
1290
|
+
if (lastCheckpoint !== null) {
|
|
1249
1291
|
return {
|
|
1250
1292
|
lastCheckpoint
|
|
1251
1293
|
};
|
|
1294
|
+
}
|
|
1252
1295
|
return await processingScope(async (context) => {
|
|
1253
1296
|
if (hooks.onStart) {
|
|
1254
1297
|
await hooks.onStart(context);
|
|
@@ -1277,46 +1320,48 @@ var reactor = (options) => {
|
|
|
1277
1320
|
handle: async (messages, partialContext) => {
|
|
1278
1321
|
if (!isActive) return Promise.resolve();
|
|
1279
1322
|
return await processingScope(async (context) => {
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1323
|
+
const messagesAboveCheckpoint = messages.filter(
|
|
1324
|
+
(message2) => !wasMessageHandled(message2, lastCheckpoint)
|
|
1325
|
+
);
|
|
1326
|
+
const upcastedMessages = messagesAboveCheckpoint.map(
|
|
1327
|
+
(message2) => upcastRecordedMessage(
|
|
1284
1328
|
// TODO: Make it smarter
|
|
1285
1329
|
message2,
|
|
1286
1330
|
_optionalChain([options, 'access', _50 => _50.messageOptions, 'optionalAccess', _51 => _51.schema, 'optionalAccess', _52 => _52.versioning])
|
|
1331
|
+
)
|
|
1332
|
+
).filter(
|
|
1333
|
+
(upcasted) => !canHandle || canHandle.includes(upcasted.type)
|
|
1334
|
+
);
|
|
1335
|
+
const stopMessageIndex = isCustomBatch && stopAfter ? upcastedMessages.findIndex(stopAfter) : -1;
|
|
1336
|
+
const unhandledMessages = stopMessageIndex !== -1 ? upcastedMessages.slice(0, stopMessageIndex + 1) : upcastedMessages;
|
|
1337
|
+
const batchResult = await eachBatch(unhandledMessages, context);
|
|
1338
|
+
const messageProcessingResult = _optionalChain([batchResult, 'optionalAccess', _53 => _53.type]) === "STOP" ? batchResult : stopMessageIndex !== -1 ? {
|
|
1339
|
+
type: "STOP",
|
|
1340
|
+
reason: "Stop condition reached",
|
|
1341
|
+
lastSuccessfulMessage: unhandledMessages[stopMessageIndex]
|
|
1342
|
+
} : batchResult;
|
|
1343
|
+
const isStop = messageProcessingResult && messageProcessingResult.type === "STOP";
|
|
1344
|
+
const checkpointMessage = _optionalChain([messageProcessingResult, 'optionalAccess', _54 => _54.type]) === "STOP" ? messageProcessingResult.lastSuccessfulMessage : messagesAboveCheckpoint[messagesAboveCheckpoint.length - 1];
|
|
1345
|
+
if (checkpointMessage && checkpoints) {
|
|
1346
|
+
const storeCheckpointResult = await checkpoints.store(
|
|
1347
|
+
{
|
|
1348
|
+
processorId,
|
|
1349
|
+
version,
|
|
1350
|
+
message: checkpointMessage,
|
|
1351
|
+
lastCheckpoint,
|
|
1352
|
+
partition
|
|
1353
|
+
},
|
|
1354
|
+
context
|
|
1287
1355
|
);
|
|
1288
|
-
if (
|
|
1289
|
-
|
|
1290
|
-
const messageProcessingResult = await eachMessage(upcasted, context);
|
|
1291
|
-
if (checkpoints) {
|
|
1292
|
-
const storeCheckpointResult = await checkpoints.store(
|
|
1293
|
-
{
|
|
1294
|
-
processorId,
|
|
1295
|
-
version,
|
|
1296
|
-
message: upcasted,
|
|
1297
|
-
lastCheckpoint,
|
|
1298
|
-
partition
|
|
1299
|
-
},
|
|
1300
|
-
context
|
|
1301
|
-
);
|
|
1302
|
-
if (storeCheckpointResult.success) {
|
|
1303
|
-
lastCheckpoint = storeCheckpointResult.newCheckpoint;
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
if (messageProcessingResult && messageProcessingResult.type === "STOP") {
|
|
1307
|
-
isActive = false;
|
|
1308
|
-
result = messageProcessingResult;
|
|
1309
|
-
break;
|
|
1356
|
+
if (storeCheckpointResult.success) {
|
|
1357
|
+
lastCheckpoint = storeCheckpointResult.newCheckpoint;
|
|
1310
1358
|
}
|
|
1311
|
-
if (stopAfter && stopAfter(upcasted)) {
|
|
1312
|
-
isActive = false;
|
|
1313
|
-
result = { type: "STOP", reason: "Stop condition reached" };
|
|
1314
|
-
break;
|
|
1315
|
-
}
|
|
1316
|
-
if (messageProcessingResult && messageProcessingResult.type === "SKIP")
|
|
1317
|
-
continue;
|
|
1318
1359
|
}
|
|
1319
|
-
|
|
1360
|
+
if (isStop) {
|
|
1361
|
+
isActive = false;
|
|
1362
|
+
return messageProcessingResult;
|
|
1363
|
+
}
|
|
1364
|
+
return void 0;
|
|
1320
1365
|
}, partialContext);
|
|
1321
1366
|
}
|
|
1322
1367
|
};
|
|
@@ -1336,15 +1381,15 @@ var projector = (options) => {
|
|
|
1336
1381
|
processorId,
|
|
1337
1382
|
messageOptions: options.projection.eventsOptions,
|
|
1338
1383
|
hooks: {
|
|
1339
|
-
onInit: _optionalChain([options, 'access',
|
|
1340
|
-
onStart: options.truncateOnStart && options.projection.truncate || _optionalChain([options, 'access',
|
|
1384
|
+
onInit: _optionalChain([options, 'access', _55 => _55.hooks, 'optionalAccess', _56 => _56.onInit]),
|
|
1385
|
+
onStart: options.truncateOnStart && options.projection.truncate || _optionalChain([options, 'access', _57 => _57.hooks, 'optionalAccess', _58 => _58.onStart]) ? async (context) => {
|
|
1341
1386
|
if (options.truncateOnStart && options.projection.truncate)
|
|
1342
1387
|
await options.projection.truncate(context);
|
|
1343
|
-
if (_optionalChain([options, 'access',
|
|
1388
|
+
if (_optionalChain([options, 'access', _59 => _59.hooks, 'optionalAccess', _60 => _60.onStart])) await _optionalChain([options, 'access', _61 => _61.hooks, 'optionalAccess', _62 => _62.onStart, 'call', _63 => _63(context)]);
|
|
1344
1389
|
} : void 0,
|
|
1345
|
-
onClose: _optionalChain([options, 'access',
|
|
1390
|
+
onClose: _optionalChain([options, 'access', _64 => _64.hooks, 'optionalAccess', _65 => _65.onClose])
|
|
1346
1391
|
},
|
|
1347
|
-
|
|
1392
|
+
eachBatch: async (events, context) => projection2.handle(events, context)
|
|
1348
1393
|
});
|
|
1349
1394
|
};
|
|
1350
1395
|
|
|
@@ -1354,7 +1399,7 @@ var inMemoryCheckpointer = () => {
|
|
|
1354
1399
|
read: async ({ processorId }, { database }) => {
|
|
1355
1400
|
const checkpoint = await database.collection("emt_processor_checkpoints").findOne((d) => d._id === processorId);
|
|
1356
1401
|
return Promise.resolve({
|
|
1357
|
-
lastCheckpoint: _nullishCoalesce(_optionalChain([checkpoint, 'optionalAccess',
|
|
1402
|
+
lastCheckpoint: _nullishCoalesce(_optionalChain([checkpoint, 'optionalAccess', _66 => _66.lastCheckpoint]), () => ( null))
|
|
1358
1403
|
});
|
|
1359
1404
|
},
|
|
1360
1405
|
store: async (context, { database }) => {
|
|
@@ -1365,7 +1410,7 @@ var inMemoryCheckpointer = () => {
|
|
|
1365
1410
|
const checkpoint = await checkpoints.findOne(
|
|
1366
1411
|
(d) => d._id === processorId
|
|
1367
1412
|
);
|
|
1368
|
-
const currentPosition = _nullishCoalesce(_optionalChain([checkpoint, 'optionalAccess',
|
|
1413
|
+
const currentPosition = _nullishCoalesce(_optionalChain([checkpoint, 'optionalAccess', _67 => _67.lastCheckpoint]), () => ( null));
|
|
1369
1414
|
const newCheckpoint = getCheckpoint(message2);
|
|
1370
1415
|
if (currentPosition && (currentPosition === newCheckpoint || currentPosition !== lastCheckpoint)) {
|
|
1371
1416
|
return {
|
|
@@ -1385,7 +1430,7 @@ var inMemoryCheckpointer = () => {
|
|
|
1385
1430
|
var inMemoryProcessingScope = (options) => {
|
|
1386
1431
|
const processorDatabase = options.database;
|
|
1387
1432
|
const processingScope = (handler, partialContext) => {
|
|
1388
|
-
const database = _nullishCoalesce(processorDatabase, () => ( _optionalChain([partialContext, 'optionalAccess',
|
|
1433
|
+
const database = _nullishCoalesce(processorDatabase, () => ( _optionalChain([partialContext, 'optionalAccess', _68 => _68.database])));
|
|
1389
1434
|
if (!database)
|
|
1390
1435
|
throw new (0, _chunkWND32L6Pcjs.EmmettError)(
|
|
1391
1436
|
`InMemory processor '${options.processorId}' is missing database. Ensure that you passed it through options`
|
|
@@ -1395,12 +1440,12 @@ var inMemoryProcessingScope = (options) => {
|
|
|
1395
1440
|
return processingScope;
|
|
1396
1441
|
};
|
|
1397
1442
|
var inMemoryProjector = (options) => {
|
|
1398
|
-
const database = _nullishCoalesce(_optionalChain([options, 'access',
|
|
1443
|
+
const database = _nullishCoalesce(_optionalChain([options, 'access', _69 => _69.connectionOptions, 'optionalAccess', _70 => _70.database]), () => ( getInMemoryDatabase()));
|
|
1399
1444
|
const hooks = {
|
|
1400
|
-
onInit: _optionalChain([options, 'access',
|
|
1401
|
-
onStart: _optionalChain([options, 'access',
|
|
1402
|
-
onClose: _optionalChain([options, 'access',
|
|
1403
|
-
if (_optionalChain([options, 'access',
|
|
1445
|
+
onInit: _optionalChain([options, 'access', _71 => _71.hooks, 'optionalAccess', _72 => _72.onInit]),
|
|
1446
|
+
onStart: _optionalChain([options, 'access', _73 => _73.hooks, 'optionalAccess', _74 => _74.onStart]),
|
|
1447
|
+
onClose: _optionalChain([options, 'access', _75 => _75.hooks, 'optionalAccess', _76 => _76.onClose]) ? async (context) => {
|
|
1448
|
+
if (_optionalChain([options, 'access', _77 => _77.hooks, 'optionalAccess', _78 => _78.onClose])) await _optionalChain([options, 'access', _79 => _79.hooks, 'optionalAccess', _80 => _80.onClose, 'call', _81 => _81(context)]);
|
|
1404
1449
|
} : void 0
|
|
1405
1450
|
};
|
|
1406
1451
|
const processor = projector({
|
|
@@ -1415,11 +1460,11 @@ var inMemoryProjector = (options) => {
|
|
|
1415
1460
|
return Object.assign(processor, { database });
|
|
1416
1461
|
};
|
|
1417
1462
|
var inMemoryReactor = (options) => {
|
|
1418
|
-
const database = _nullishCoalesce(_optionalChain([options, 'access',
|
|
1463
|
+
const database = _nullishCoalesce(_optionalChain([options, 'access', _82 => _82.connectionOptions, 'optionalAccess', _83 => _83.database]), () => ( getInMemoryDatabase()));
|
|
1419
1464
|
const hooks = {
|
|
1420
|
-
onInit: _optionalChain([options, 'access',
|
|
1421
|
-
onStart: _optionalChain([options, 'access',
|
|
1422
|
-
onClose: _optionalChain([options, 'access',
|
|
1465
|
+
onInit: _optionalChain([options, 'access', _84 => _84.hooks, 'optionalAccess', _85 => _85.onInit]),
|
|
1466
|
+
onStart: _optionalChain([options, 'access', _86 => _86.hooks, 'optionalAccess', _87 => _87.onStart]),
|
|
1467
|
+
onClose: _optionalChain([options, 'access', _88 => _88.hooks, 'optionalAccess', _89 => _89.onClose])
|
|
1423
1468
|
};
|
|
1424
1469
|
const processor = reactor({
|
|
1425
1470
|
...options,
|
|
@@ -1675,39 +1720,39 @@ var argMatches = (matches) => (arg) => matches(arg);
|
|
|
1675
1720
|
function verifyThat(fn) {
|
|
1676
1721
|
return {
|
|
1677
1722
|
calledTimes: (times) => {
|
|
1678
|
-
assertEqual(_optionalChain([fn, 'access',
|
|
1723
|
+
assertEqual(_optionalChain([fn, 'access', _90 => _90.mock, 'optionalAccess', _91 => _91.calls, 'optionalAccess', _92 => _92.length]), times);
|
|
1679
1724
|
},
|
|
1680
1725
|
notCalled: () => {
|
|
1681
|
-
assertEqual(_optionalChain([fn, 'optionalAccess',
|
|
1726
|
+
assertEqual(_optionalChain([fn, 'optionalAccess', _93 => _93.mock, 'optionalAccess', _94 => _94.calls, 'optionalAccess', _95 => _95.length]), 0);
|
|
1682
1727
|
},
|
|
1683
1728
|
called: () => {
|
|
1684
1729
|
assertTrue(
|
|
1685
|
-
_optionalChain([fn, 'access',
|
|
1730
|
+
_optionalChain([fn, 'access', _96 => _96.mock, 'optionalAccess', _97 => _97.calls, 'access', _98 => _98.length]) !== void 0 && fn.mock.calls.length > 0
|
|
1686
1731
|
);
|
|
1687
1732
|
},
|
|
1688
1733
|
calledWith: (...args) => {
|
|
1689
1734
|
assertTrue(
|
|
1690
|
-
_optionalChain([fn, 'access',
|
|
1735
|
+
_optionalChain([fn, 'access', _99 => _99.mock, 'optionalAccess', _100 => _100.calls, 'access', _101 => _101.length]) !== void 0 && fn.mock.calls.length >= 1 && fn.mock.calls.some((call) => deepEquals(call.arguments, args))
|
|
1691
1736
|
);
|
|
1692
1737
|
},
|
|
1693
1738
|
calledOnceWith: (...args) => {
|
|
1694
1739
|
assertTrue(
|
|
1695
|
-
_optionalChain([fn, 'access',
|
|
1740
|
+
_optionalChain([fn, 'access', _102 => _102.mock, 'optionalAccess', _103 => _103.calls, 'access', _104 => _104.length]) !== void 0 && fn.mock.calls.length === 1 && fn.mock.calls.some((call) => deepEquals(call.arguments, args))
|
|
1696
1741
|
);
|
|
1697
1742
|
},
|
|
1698
1743
|
calledWithArgumentMatching: (...matches) => {
|
|
1699
1744
|
assertTrue(
|
|
1700
|
-
_optionalChain([fn, 'access',
|
|
1745
|
+
_optionalChain([fn, 'access', _105 => _105.mock, 'optionalAccess', _106 => _106.calls, 'access', _107 => _107.length]) !== void 0 && fn.mock.calls.length >= 1
|
|
1701
1746
|
);
|
|
1702
1747
|
assertTrue(
|
|
1703
|
-
_optionalChain([fn, 'access',
|
|
1748
|
+
_optionalChain([fn, 'access', _108 => _108.mock, 'optionalAccess', _109 => _109.calls, 'access', _110 => _110.length]) !== void 0 && fn.mock.calls.length >= 1 && fn.mock.calls.some(
|
|
1704
1749
|
(call) => call.arguments && call.arguments.length >= matches.length && matches.every((match, index) => match(call.arguments[index]))
|
|
1705
1750
|
)
|
|
1706
1751
|
);
|
|
1707
1752
|
},
|
|
1708
1753
|
notCalledWithArgumentMatching: (...matches) => {
|
|
1709
1754
|
assertFalse(
|
|
1710
|
-
_optionalChain([fn, 'access',
|
|
1755
|
+
_optionalChain([fn, 'access', _111 => _111.mock, 'optionalAccess', _112 => _112.calls, 'access', _113 => _113.length]) !== void 0 && fn.mock.calls.length >= 1 && fn.mock.calls[0].arguments && fn.mock.calls[0].arguments.length >= matches.length && matches.every(
|
|
1711
1756
|
(match, index) => match(fn.mock.calls[0].arguments[index])
|
|
1712
1757
|
)
|
|
1713
1758
|
);
|
|
@@ -1852,18 +1897,18 @@ function thenThrowsErrorHandler(error, args) {
|
|
|
1852
1897
|
if (!_chunkWND32L6Pcjs.isErrorConstructor.call(void 0, args[0])) {
|
|
1853
1898
|
assertTrue(
|
|
1854
1899
|
args[0](error),
|
|
1855
|
-
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess',
|
|
1900
|
+
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess', _114 => _114.toString, 'call', _115 => _115()])}`
|
|
1856
1901
|
);
|
|
1857
1902
|
return;
|
|
1858
1903
|
}
|
|
1859
1904
|
assertTrue(
|
|
1860
1905
|
error instanceof args[0],
|
|
1861
|
-
`Caught error is not an instance of the expected type: ${_optionalChain([error, 'optionalAccess',
|
|
1906
|
+
`Caught error is not an instance of the expected type: ${_optionalChain([error, 'optionalAccess', _116 => _116.toString, 'call', _117 => _117()])}`
|
|
1862
1907
|
);
|
|
1863
1908
|
if (args[1]) {
|
|
1864
1909
|
assertTrue(
|
|
1865
1910
|
args[1](error),
|
|
1866
|
-
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess',
|
|
1911
|
+
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess', _118 => _118.toString, 'call', _119 => _119()])}`
|
|
1867
1912
|
);
|
|
1868
1913
|
}
|
|
1869
1914
|
}
|
|
@@ -1921,18 +1966,18 @@ function thenThrowsErrorHandler2(error, args) {
|
|
|
1921
1966
|
if (!_chunkWND32L6Pcjs.isErrorConstructor.call(void 0, args[0])) {
|
|
1922
1967
|
assertTrue(
|
|
1923
1968
|
args[0](error),
|
|
1924
|
-
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess',
|
|
1969
|
+
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess', _120 => _120.toString, 'call', _121 => _121()])}`
|
|
1925
1970
|
);
|
|
1926
1971
|
return;
|
|
1927
1972
|
}
|
|
1928
1973
|
assertTrue(
|
|
1929
1974
|
error instanceof args[0],
|
|
1930
|
-
`Caught error is not an instance of the expected type: ${_optionalChain([error, 'optionalAccess',
|
|
1975
|
+
`Caught error is not an instance of the expected type: ${_optionalChain([error, 'optionalAccess', _122 => _122.toString, 'call', _123 => _123()])}`
|
|
1931
1976
|
);
|
|
1932
1977
|
if (args[1]) {
|
|
1933
1978
|
assertTrue(
|
|
1934
1979
|
args[1](error),
|
|
1935
|
-
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess',
|
|
1980
|
+
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess', _124 => _124.toString, 'call', _125 => _125()])}`
|
|
1936
1981
|
);
|
|
1937
1982
|
}
|
|
1938
1983
|
}
|
|
@@ -1988,7 +2033,7 @@ var InMemoryProjectionSpec = {
|
|
|
1988
2033
|
const allEvents = [];
|
|
1989
2034
|
const run = async (database) => {
|
|
1990
2035
|
let globalPosition = 0n;
|
|
1991
|
-
const numberOfTimes = _nullishCoalesce(_optionalChain([options2, 'optionalAccess',
|
|
2036
|
+
const numberOfTimes = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _126 => _126.numberOfTimes]), () => ( 1));
|
|
1992
2037
|
for (const event2 of [
|
|
1993
2038
|
...givenEvents,
|
|
1994
2039
|
...Array.from({ length: numberOfTimes }).flatMap(() => events)
|
|
@@ -1997,7 +2042,7 @@ var InMemoryProjectionSpec = {
|
|
|
1997
2042
|
checkpoint: bigIntProcessorCheckpoint(++globalPosition),
|
|
1998
2043
|
globalPosition,
|
|
1999
2044
|
streamPosition: globalPosition,
|
|
2000
|
-
streamName: _nullishCoalesce(_optionalChain([event2, 'access',
|
|
2045
|
+
streamName: _nullishCoalesce(_optionalChain([event2, 'access', _127 => _127.metadata, 'optionalAccess', _128 => _128.streamName]), () => ( `test-${_uuid.v4.call(void 0, )}`)),
|
|
2001
2046
|
messageId: _uuid.v4.call(void 0, )
|
|
2002
2047
|
};
|
|
2003
2048
|
allEvents.push({
|
|
@@ -2064,18 +2109,18 @@ var InMemoryProjectionSpec = {
|
|
|
2064
2109
|
if (!_chunkWND32L6Pcjs.isErrorConstructor.call(void 0, args[0])) {
|
|
2065
2110
|
assertTrue(
|
|
2066
2111
|
args[0](error),
|
|
2067
|
-
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess',
|
|
2112
|
+
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess', _129 => _129.toString, 'call', _130 => _130()])}`
|
|
2068
2113
|
);
|
|
2069
2114
|
return;
|
|
2070
2115
|
}
|
|
2071
2116
|
assertTrue(
|
|
2072
2117
|
error instanceof args[0],
|
|
2073
|
-
`Caught error is not an instance of the expected type: ${_optionalChain([error, 'optionalAccess',
|
|
2118
|
+
`Caught error is not an instance of the expected type: ${_optionalChain([error, 'optionalAccess', _131 => _131.toString, 'call', _132 => _132()])}`
|
|
2074
2119
|
);
|
|
2075
2120
|
if (args[1]) {
|
|
2076
2121
|
assertTrue(
|
|
2077
2122
|
args[1](error),
|
|
2078
|
-
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess',
|
|
2123
|
+
`Error didn't match the error condition: ${_optionalChain([error, 'optionalAccess', _133 => _133.toString, 'call', _134 => _134()])}`
|
|
2079
2124
|
);
|
|
2080
2125
|
}
|
|
2081
2126
|
}
|
|
@@ -2091,7 +2136,7 @@ var eventInStream = (streamName, event2) => {
|
|
|
2091
2136
|
...event2,
|
|
2092
2137
|
metadata: {
|
|
2093
2138
|
..._nullishCoalesce(event2.metadata, () => ( {})),
|
|
2094
|
-
streamName: _nullishCoalesce(_optionalChain([event2, 'access',
|
|
2139
|
+
streamName: _nullishCoalesce(_optionalChain([event2, 'access', _135 => _135.metadata, 'optionalAccess', _136 => _136.streamName]), () => ( streamName))
|
|
2095
2140
|
}
|
|
2096
2141
|
};
|
|
2097
2142
|
};
|
|
@@ -2135,7 +2180,7 @@ var expectInMemoryDocuments = {
|
|
|
2135
2180
|
|
|
2136
2181
|
// src/eventStore/versioning/downcasting.ts
|
|
2137
2182
|
var downcastRecordedMessage = (recordedMessage, options) => {
|
|
2138
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
2183
|
+
if (!_optionalChain([options, 'optionalAccess', _137 => _137.downcast]))
|
|
2139
2184
|
return recordedMessage;
|
|
2140
2185
|
const downcasted = options.downcast(
|
|
2141
2186
|
recordedMessage
|
|
@@ -2153,7 +2198,7 @@ var downcastRecordedMessage = (recordedMessage, options) => {
|
|
|
2153
2198
|
};
|
|
2154
2199
|
};
|
|
2155
2200
|
var downcastRecordedMessages = (recordedMessages, options) => {
|
|
2156
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
2201
|
+
if (!_optionalChain([options, 'optionalAccess', _138 => _138.downcast]))
|
|
2157
2202
|
return recordedMessages;
|
|
2158
2203
|
return recordedMessages.map(
|
|
2159
2204
|
(recordedMessage) => downcastRecordedMessage(recordedMessage, options)
|
|
@@ -2162,7 +2207,7 @@ var downcastRecordedMessages = (recordedMessages, options) => {
|
|
|
2162
2207
|
|
|
2163
2208
|
// src/eventStore/versioning/upcasting.ts
|
|
2164
2209
|
var upcastRecordedMessage = (recordedMessage, options) => {
|
|
2165
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
2210
|
+
if (!_optionalChain([options, 'optionalAccess', _139 => _139.upcast]))
|
|
2166
2211
|
return recordedMessage;
|
|
2167
2212
|
const upcasted = options.upcast(
|
|
2168
2213
|
recordedMessage
|
|
@@ -2180,7 +2225,7 @@ var upcastRecordedMessage = (recordedMessage, options) => {
|
|
|
2180
2225
|
};
|
|
2181
2226
|
};
|
|
2182
2227
|
var upcastRecordedMessages = (recordedMessages, options) => {
|
|
2183
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
2228
|
+
if (!_optionalChain([options, 'optionalAccess', _140 => _140.upcast]))
|
|
2184
2229
|
return recordedMessages;
|
|
2185
2230
|
return recordedMessages.map(
|
|
2186
2231
|
(recordedMessage) => upcastRecordedMessage(recordedMessage, options)
|
|
@@ -2194,8 +2239,8 @@ var getInMemoryEventStore = (eventStoreOptions) => {
|
|
|
2194
2239
|
const getAllEventsCount = () => {
|
|
2195
2240
|
return Array.from(streams.values()).map((s) => s.length).reduce((p, c) => p + c, 0);
|
|
2196
2241
|
};
|
|
2197
|
-
const database = _optionalChain([eventStoreOptions, 'optionalAccess',
|
|
2198
|
-
const inlineProjections2 = (_nullishCoalesce(_optionalChain([eventStoreOptions, 'optionalAccess',
|
|
2242
|
+
const database = _optionalChain([eventStoreOptions, 'optionalAccess', _141 => _141.database]) || getInMemoryDatabase();
|
|
2243
|
+
const inlineProjections2 = (_nullishCoalesce(_optionalChain([eventStoreOptions, 'optionalAccess', _142 => _142.projections]), () => ( []))).filter(({ type }) => type === "inline").map(({ projection: projection2 }) => projection2);
|
|
2199
2244
|
const eventStore = {
|
|
2200
2245
|
database,
|
|
2201
2246
|
async aggregateStream(streamName, options) {
|
|
@@ -2204,7 +2249,7 @@ var getInMemoryEventStore = (eventStoreOptions) => {
|
|
|
2204
2249
|
streamName,
|
|
2205
2250
|
read
|
|
2206
2251
|
);
|
|
2207
|
-
const events = _nullishCoalesce(_optionalChain([result, 'optionalAccess',
|
|
2252
|
+
const events = _nullishCoalesce(_optionalChain([result, 'optionalAccess', _143 => _143.events]), () => ( []));
|
|
2208
2253
|
const state = events.reduce((s, e) => evolve(s, e), initialState());
|
|
2209
2254
|
return {
|
|
2210
2255
|
currentStreamVersion: BigInt(events.length),
|
|
@@ -2217,16 +2262,16 @@ var getInMemoryEventStore = (eventStoreOptions) => {
|
|
|
2217
2262
|
const currentStreamVersion = events ? BigInt(events.length) : InMemoryEventStoreDefaultStreamVersion;
|
|
2218
2263
|
assertExpectedVersionMatchesCurrent(
|
|
2219
2264
|
currentStreamVersion,
|
|
2220
|
-
_optionalChain([readOptions, 'optionalAccess',
|
|
2265
|
+
_optionalChain([readOptions, 'optionalAccess', _144 => _144.expectedStreamVersion]),
|
|
2221
2266
|
InMemoryEventStoreDefaultStreamVersion
|
|
2222
2267
|
);
|
|
2223
|
-
const from = Number(_nullishCoalesce(_optionalChain([readOptions, 'optionalAccess',
|
|
2268
|
+
const from = Number(_nullishCoalesce(_optionalChain([readOptions, 'optionalAccess', _145 => _145.from]), () => ( 0)));
|
|
2224
2269
|
const to = Number(
|
|
2225
|
-
_nullishCoalesce(_optionalChain([readOptions, 'optionalAccess',
|
|
2270
|
+
_nullishCoalesce(_optionalChain([readOptions, 'optionalAccess', _146 => _146.to]), () => ( (_optionalChain([readOptions, 'optionalAccess', _147 => _147.maxCount]) ? (_nullishCoalesce(readOptions.from, () => ( 0n))) + readOptions.maxCount : _nullishCoalesce(_optionalChain([events, 'optionalAccess', _148 => _148.length]), () => ( 1)))))
|
|
2226
2271
|
);
|
|
2227
2272
|
const resultEvents = events !== void 0 && events.length > 0 ? upcastRecordedMessages(
|
|
2228
2273
|
events.slice(from, to),
|
|
2229
|
-
_optionalChain([readOptions, 'optionalAccess',
|
|
2274
|
+
_optionalChain([readOptions, 'optionalAccess', _149 => _149.schema, 'optionalAccess', _150 => _150.versioning])
|
|
2230
2275
|
) : [];
|
|
2231
2276
|
const result = {
|
|
2232
2277
|
currentStreamVersion,
|
|
@@ -2240,7 +2285,7 @@ var getInMemoryEventStore = (eventStoreOptions) => {
|
|
|
2240
2285
|
const currentStreamVersion = currentEvents.length > 0 ? BigInt(currentEvents.length) : InMemoryEventStoreDefaultStreamVersion;
|
|
2241
2286
|
assertExpectedVersionMatchesCurrent(
|
|
2242
2287
|
currentStreamVersion,
|
|
2243
|
-
_optionalChain([options, 'optionalAccess',
|
|
2288
|
+
_optionalChain([options, 'optionalAccess', _151 => _151.expectedStreamVersion]),
|
|
2244
2289
|
InMemoryEventStoreDefaultStreamVersion
|
|
2245
2290
|
);
|
|
2246
2291
|
const newEvents = events.map((event2, index) => {
|
|
@@ -2266,7 +2311,7 @@ var getInMemoryEventStore = (eventStoreOptions) => {
|
|
|
2266
2311
|
);
|
|
2267
2312
|
streams.set(streamName, [
|
|
2268
2313
|
...currentEvents,
|
|
2269
|
-
...downcastRecordedMessages(newEvents, _optionalChain([options, 'optionalAccess',
|
|
2314
|
+
...downcastRecordedMessages(newEvents, _optionalChain([options, 'optionalAccess', _152 => _152.schema, 'optionalAccess', _153 => _153.versioning]))
|
|
2270
2315
|
]);
|
|
2271
2316
|
if (inlineProjections2.length > 0) {
|
|
2272
2317
|
await handleInMemoryProjections({
|
|
@@ -2282,7 +2327,7 @@ var getInMemoryEventStore = (eventStoreOptions) => {
|
|
|
2282
2327
|
};
|
|
2283
2328
|
await tryPublishMessagesAfterCommit(
|
|
2284
2329
|
newEvents,
|
|
2285
|
-
_optionalChain([eventStoreOptions, 'optionalAccess',
|
|
2330
|
+
_optionalChain([eventStoreOptions, 'optionalAccess', _154 => _154.hooks])
|
|
2286
2331
|
);
|
|
2287
2332
|
return result;
|
|
2288
2333
|
},
|
|
@@ -2330,7 +2375,7 @@ var CommandHandler = (options) => async (store, id, handle, handleOptions) => as
|
|
|
2330
2375
|
serialization: options.serialization,
|
|
2331
2376
|
// expected stream version is passed to fail fast
|
|
2332
2377
|
// if stream is in the wrong state
|
|
2333
|
-
expectedStreamVersion: _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess',
|
|
2378
|
+
expectedStreamVersion: _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess', _155 => _155.expectedStreamVersion]), () => ( NO_CONCURRENCY_CHECK))
|
|
2334
2379
|
}
|
|
2335
2380
|
});
|
|
2336
2381
|
const {
|
|
@@ -2358,7 +2403,7 @@ var CommandHandler = (options) => async (store, id, handle, handleOptions) => as
|
|
|
2358
2403
|
createdNewStream: false
|
|
2359
2404
|
};
|
|
2360
2405
|
}
|
|
2361
|
-
const expectedStreamVersion = _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess',
|
|
2406
|
+
const expectedStreamVersion = _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess', _156 => _156.expectedStreamVersion]), () => ( (aggregationResult.streamExists ? currentStreamVersion : STREAM_DOES_NOT_EXIST)));
|
|
2362
2407
|
const appendResult = await eventStore.appendToStream(
|
|
2363
2408
|
streamName,
|
|
2364
2409
|
eventsToAppend,
|
|
@@ -2534,11 +2579,11 @@ var createWrappedEvolve = (evolve, workflowName, separateInputInboxFromProcessin
|
|
|
2534
2579
|
return (state, event2) => {
|
|
2535
2580
|
const metadata = event2.metadata;
|
|
2536
2581
|
let processedInputIds = state.processedInputIds;
|
|
2537
|
-
if (_optionalChain([metadata, 'optionalAccess',
|
|
2582
|
+
if (_optionalChain([metadata, 'optionalAccess', _157 => _157.input]) === true && typeof _optionalChain([metadata, 'optionalAccess', _158 => _158.originalMessageId]) === "string") {
|
|
2538
2583
|
processedInputIds = new Set(state.processedInputIds);
|
|
2539
2584
|
processedInputIds.add(metadata.originalMessageId);
|
|
2540
2585
|
}
|
|
2541
|
-
if (separateInputInboxFromProcessing && _optionalChain([metadata, 'optionalAccess',
|
|
2586
|
+
if (separateInputInboxFromProcessing && _optionalChain([metadata, 'optionalAccess', _159 => _159.input]) === true) {
|
|
2542
2587
|
return {
|
|
2543
2588
|
userState: state.userState,
|
|
2544
2589
|
processedInputIds
|
|
@@ -2568,7 +2613,7 @@ var WorkflowHandler = (options) => async (store, message2, handleOptions) => asy
|
|
|
2568
2613
|
} = options;
|
|
2569
2614
|
const inputMessageId = (
|
|
2570
2615
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2571
|
-
_nullishCoalesce(("metadata" in message2 && _optionalChain([message2, 'access',
|
|
2616
|
+
_nullishCoalesce(("metadata" in message2 && _optionalChain([message2, 'access', _160 => _160.metadata, 'optionalAccess', _161 => _161.messageId]) ? (
|
|
2572
2617
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2573
2618
|
message2.metadata.messageId
|
|
2574
2619
|
) : void 0), () => ( _uuid.v7.call(void 0, )))
|
|
@@ -2604,7 +2649,7 @@ var WorkflowHandler = (options) => async (store, message2, handleOptions) => asy
|
|
|
2604
2649
|
[inputToStore2],
|
|
2605
2650
|
{
|
|
2606
2651
|
...handleOptions,
|
|
2607
|
-
expectedStreamVersion: _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess',
|
|
2652
|
+
expectedStreamVersion: _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess', _162 => _162.expectedStreamVersion]), () => ( NO_CONCURRENCY_CHECK))
|
|
2608
2653
|
}
|
|
2609
2654
|
);
|
|
2610
2655
|
return {
|
|
@@ -2625,7 +2670,7 @@ var WorkflowHandler = (options) => async (store, message2, handleOptions) => asy
|
|
|
2625
2670
|
...handleOptions,
|
|
2626
2671
|
// expected stream version is passed to fail fast
|
|
2627
2672
|
// if stream is in the wrong state
|
|
2628
|
-
expectedStreamVersion: _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess',
|
|
2673
|
+
expectedStreamVersion: _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess', _163 => _163.expectedStreamVersion]), () => ( NO_CONCURRENCY_CHECK))
|
|
2629
2674
|
}
|
|
2630
2675
|
});
|
|
2631
2676
|
const { currentStreamVersion } = aggregationResult;
|
|
@@ -2649,7 +2694,7 @@ var WorkflowHandler = (options) => async (store, message2, handleOptions) => asy
|
|
|
2649
2694
|
metadata: inputMetadata
|
|
2650
2695
|
};
|
|
2651
2696
|
const outputMessages = (Array.isArray(result2) ? result2 : [result2]).filter((msg) => msg !== void 0 && msg !== null);
|
|
2652
|
-
const outputCommandTypes = _nullishCoalesce(_optionalChain([options, 'access',
|
|
2697
|
+
const outputCommandTypes = _nullishCoalesce(_optionalChain([options, 'access', _164 => _164.outputs, 'optionalAccess', _165 => _165.commands]), () => ( []));
|
|
2653
2698
|
const taggedOutputMessages = outputMessages.map((msg) => {
|
|
2654
2699
|
const action = outputCommandTypes.includes(
|
|
2655
2700
|
msg.type
|
|
@@ -2660,7 +2705,7 @@ var WorkflowHandler = (options) => async (store, message2, handleOptions) => asy
|
|
|
2660
2705
|
if (messagesToAppend.length === 0) {
|
|
2661
2706
|
return emptyHandlerResult(currentStreamVersion);
|
|
2662
2707
|
}
|
|
2663
|
-
const expectedStreamVersion = _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess',
|
|
2708
|
+
const expectedStreamVersion = _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess', _166 => _166.expectedStreamVersion]), () => ( (aggregationResult.streamExists ? currentStreamVersion : STREAM_DOES_NOT_EXIST)));
|
|
2664
2709
|
const appendResult = await eventStore.appendToStream(
|
|
2665
2710
|
streamName,
|
|
2666
2711
|
// TODO: Fix this cast
|
|
@@ -2715,7 +2760,7 @@ var workflowProcessor = (options) => {
|
|
|
2715
2760
|
eachMessage: async (message2, context) => {
|
|
2716
2761
|
const messageType = message2.type;
|
|
2717
2762
|
const metadata = message2.metadata;
|
|
2718
|
-
const isInput = _optionalChain([metadata, 'optionalAccess',
|
|
2763
|
+
const isInput = _optionalChain([metadata, 'optionalAccess', _167 => _167.input]) === true;
|
|
2719
2764
|
if (isInput || inputs.includes(messageType)) {
|
|
2720
2765
|
const result = await handle(
|
|
2721
2766
|
context.connection.messageStore,
|
|
@@ -2733,7 +2778,7 @@ var workflowProcessor = (options) => {
|
|
|
2733
2778
|
}
|
|
2734
2779
|
return;
|
|
2735
2780
|
}
|
|
2736
|
-
if (_optionalChain([options, 'access',
|
|
2781
|
+
if (_optionalChain([options, 'access', _168 => _168.outputHandler, 'optionalAccess', _169 => _169.canHandle, 'access', _170 => _170.includes, 'call', _171 => _171(messageType)]) === true) {
|
|
2737
2782
|
const recordedMessage = message2;
|
|
2738
2783
|
const handledOutputMessages = options.outputHandler.eachBatch ? await options.outputHandler.eachBatch([recordedMessage], context) : await options.outputHandler.eachMessage(recordedMessage, context);
|
|
2739
2784
|
if (handledOutputMessages instanceof _chunkWND32L6Pcjs.EmmettError) {
|
|
@@ -2911,5 +2956,6 @@ var workflowProcessor = (options) => {
|
|
|
2911
2956
|
|
|
2912
2957
|
|
|
2913
2958
|
|
|
2914
|
-
|
|
2959
|
+
|
|
2960
|
+
exports.AssertionError = AssertionError; exports.CommandHandler = CommandHandler; exports.CommandHandlerStreamVersionConflictRetryOptions = CommandHandlerStreamVersionConflictRetryOptions; exports.ConcurrencyError = _chunkWND32L6Pcjs.ConcurrencyError; exports.ConcurrencyInMemoryDatabaseError = _chunkWND32L6Pcjs.ConcurrencyInMemoryDatabaseError; exports.DATABASE_REQUIRED_ERROR_MESSAGE = DATABASE_REQUIRED_ERROR_MESSAGE; exports.DeciderCommandHandler = DeciderCommandHandler; exports.DeciderSpecification = DeciderSpecification; exports.EmmettError = _chunkWND32L6Pcjs.EmmettError; exports.ExpectedVersionConflictError = ExpectedVersionConflictError; exports.GlobalStreamCaughtUpType = GlobalStreamCaughtUpType; exports.IllegalStateError = _chunkWND32L6Pcjs.IllegalStateError; exports.InMemoryEventStoreDefaultStreamVersion = InMemoryEventStoreDefaultStreamVersion; exports.InMemoryProjectionSpec = InMemoryProjectionSpec; exports.InProcessLock = InProcessLock; exports.JSONCodec = JSONCodec; exports.JSONReplacer = JSONReplacer; exports.JSONReplacers = JSONReplacers; exports.JSONReviver = JSONReviver; exports.JSONRevivers = JSONRevivers; exports.JSONSerializer = JSONSerializer; exports.MessageProcessor = MessageProcessor; exports.MessageProcessorType = MessageProcessorType; exports.NO_CONCURRENCY_CHECK = NO_CONCURRENCY_CHECK; exports.NoRetries = NoRetries; exports.NotFoundError = _chunkWND32L6Pcjs.NotFoundError; exports.STREAM_DOES_NOT_EXIST = STREAM_DOES_NOT_EXIST; exports.STREAM_EXISTS = STREAM_EXISTS; exports.TaskProcessor = TaskProcessor; exports.ValidationError = _chunkWND32L6Pcjs.ValidationError; exports.ValidationErrors = _chunkWND32L6Pcjs.ValidationErrors; exports.Workflow = Workflow; exports.WorkflowHandler = WorkflowHandler; exports.WorkflowHandlerStreamVersionConflictRetryOptions = WorkflowHandlerStreamVersionConflictRetryOptions; exports.WorkflowSpecification = WorkflowSpecification; exports.WrapEventStore = WrapEventStore; exports.argMatches = argMatches; exports.argValue = argValue; exports.arrayUtils = arrayUtils; exports.assertDeepEqual = assertDeepEqual; exports.assertDefined = assertDefined; exports.assertDoesNotThrow = assertDoesNotThrow; exports.assertEqual = assertEqual; exports.assertExpectedVersionMatchesCurrent = assertExpectedVersionMatchesCurrent; exports.assertFails = assertFails; exports.assertFalse = assertFalse; exports.assertIsNotNull = assertIsNotNull; exports.assertIsNull = assertIsNull; exports.assertMatches = assertMatches; exports.assertNotDeepEqual = assertNotDeepEqual; exports.assertNotEmptyString = _chunkWND32L6Pcjs.assertNotEmptyString; exports.assertNotEqual = assertNotEqual; exports.assertOk = assertOk; exports.assertPositiveNumber = _chunkWND32L6Pcjs.assertPositiveNumber; exports.assertRejects = assertRejects; exports.assertThat = assertThat; exports.assertThatArray = assertThatArray; exports.assertThrows = assertThrows; exports.assertThrowsAsync = assertThrowsAsync; exports.assertTrue = assertTrue; exports.assertUnsignedBigInt = _chunkWND32L6Pcjs.assertUnsignedBigInt; exports.asyncAwaiter = asyncAwaiter; exports.asyncProjections = asyncProjections; exports.asyncRetry = asyncRetry; exports.bigInt = bigInt; exports.bigIntProcessorCheckpoint = bigIntProcessorCheckpoint; exports.canCreateEventStoreSession = canCreateEventStoreSession; exports.caughtUpEventFrom = caughtUpEventFrom; exports.command = command; exports.composeJSONReplacers = composeJSONReplacers; exports.composeJSONRevivers = composeJSONRevivers; exports.deepEquals = deepEquals; exports.defaultProcessingMessageProcessingScope = defaultProcessingMessageProcessingScope; exports.defaultProcessorPartition = defaultProcessorPartition; exports.defaultProcessorVersion = defaultProcessorVersion; exports.defaultTag = defaultTag; exports.delay = delay; exports.documentExists = documentExists; exports.downcastRecordedMessage = downcastRecordedMessage; exports.downcastRecordedMessages = downcastRecordedMessages; exports.emmettPrefix = emmettPrefix; exports.event = event; exports.eventInStream = eventInStream; exports.eventsInStream = eventsInStream; exports.expectInMemoryDocuments = expectInMemoryDocuments; exports.filterProjections = filterProjections; exports.formatDateToUtcYYYYMMDD = _chunkWND32L6Pcjs.formatDateToUtcYYYYMMDD; exports.forwardToMessageBus = forwardToMessageBus; exports.getCheckpoint = getCheckpoint; exports.getInMemoryDatabase = getInMemoryDatabase; exports.getInMemoryEventStore = getInMemoryEventStore; exports.getInMemoryMessageBus = getInMemoryMessageBus; exports.getProcessorInstanceId = getProcessorInstanceId; exports.getProjectorId = getProjectorId; exports.getWorkflowId = getWorkflowId; exports.globalStreamCaughtUp = globalStreamCaughtUp; exports.globalTag = globalTag; exports.guardBoundedAccess = guardBoundedAccess; exports.guardExclusiveAccess = guardExclusiveAccess; exports.guardInitializedOnce = guardInitializedOnce; exports.handleInMemoryProjections = handleInMemoryProjections; exports.hashText = hashText; exports.inMemoryCheckpointer = inMemoryCheckpointer; exports.inMemoryMultiStreamProjection = inMemoryMultiStreamProjection; exports.inMemoryProjection = inMemoryProjection; exports.inMemoryProjector = inMemoryProjector; exports.inMemoryReactor = inMemoryReactor; exports.inMemorySingleStreamProjection = inMemorySingleStreamProjection; exports.inlineProjections = inlineProjections; exports.isBigint = _chunkWND32L6Pcjs.isBigint; exports.isEquatable = isEquatable; exports.isErrorConstructor = _chunkWND32L6Pcjs.isErrorConstructor; exports.isExpectedVersionConflictError = isExpectedVersionConflictError; exports.isGlobalStreamCaughtUp = isGlobalStreamCaughtUp; exports.isNotInternalEvent = isNotInternalEvent; exports.isNumber = _chunkWND32L6Pcjs.isNumber; exports.isPluginConfig = _chunkWND32L6Pcjs.isPluginConfig; exports.isString = _chunkWND32L6Pcjs.isString; exports.isSubscriptionEvent = isSubscriptionEvent; exports.isSubset = isSubset; exports.isValidYYYYMMDD = _chunkWND32L6Pcjs.isValidYYYYMMDD; exports.jsonSerializer = jsonSerializer; exports.matchesExpectedVersion = matchesExpectedVersion; exports.merge = merge; exports.message = message; exports.newEventsInStream = newEventsInStream; exports.nulloSessionFactory = nulloSessionFactory; exports.onShutdown = onShutdown; exports.parseBigIntProcessorCheckpoint = parseBigIntProcessorCheckpoint; exports.parseDateFromUtcYYYYMMDD = _chunkWND32L6Pcjs.parseDateFromUtcYYYYMMDD; exports.projection = projection; exports.projections = projections; exports.projector = projector; exports.reactor = reactor; exports.reduceAsync = reduceAsync; exports.sum = sum; exports.toNormalizedString = toNormalizedString; exports.tryPublishMessagesAfterCommit = tryPublishMessagesAfterCommit; exports.unknownTag = unknownTag; exports.upcastRecordedMessage = upcastRecordedMessage; exports.upcastRecordedMessages = upcastRecordedMessages; exports.verifyThat = verifyThat; exports.wasMessageHandled = wasMessageHandled; exports.workflowOutputHandler = workflowOutputHandler; exports.workflowProcessor = workflowProcessor; exports.workflowStreamName = workflowStreamName;
|
|
2915
2961
|
//# sourceMappingURL=index.cjs.map
|