@event-driven-io/emmett 0.43.0-beta.16 → 0.43.0-beta.18
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 +1 -1
- package/dist/index.cjs +10 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -36
- package/dist/index.d.ts +39 -36
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -979,10 +979,16 @@ const getInMemoryDatabase = () => {
|
|
|
979
979
|
};
|
|
980
980
|
|
|
981
981
|
//#endregion
|
|
982
|
-
//#region src/processors/
|
|
982
|
+
//#region src/processors/checkpoints.ts
|
|
983
|
+
const ProcessorCheckpoint = (checkpoint) => checkpoint;
|
|
984
|
+
const bigIntProcessorCheckpoint = (value) => bigInt.toNormalizedString(value);
|
|
985
|
+
const parseBigIntProcessorCheckpoint = (value) => BigInt(value);
|
|
983
986
|
const getCheckpoint = (message) => {
|
|
984
987
|
return message.metadata.checkpoint;
|
|
985
988
|
};
|
|
989
|
+
|
|
990
|
+
//#endregion
|
|
991
|
+
//#region src/processors/processors.ts
|
|
986
992
|
const wasMessageHandled = (message, checkpoint) => {
|
|
987
993
|
const messageCheckpoint = getCheckpoint(message);
|
|
988
994
|
return messageCheckpoint !== null && messageCheckpoint !== void 0 && checkpoint !== null && checkpoint !== void 0 && messageCheckpoint <= checkpoint;
|
|
@@ -1002,8 +1008,6 @@ const MessageProcessor = { result: {
|
|
|
1002
1008
|
})
|
|
1003
1009
|
} };
|
|
1004
1010
|
const defaultProcessingMessageProcessingScope = (handler, partialContext) => handler(partialContext);
|
|
1005
|
-
const bigIntProcessorCheckpoint = (value) => bigInt.toNormalizedString(value);
|
|
1006
|
-
const parseBigIntProcessorCheckpoint = (value) => BigInt(value);
|
|
1007
1011
|
const defaultProcessorVersion = 1;
|
|
1008
1012
|
const defaultProcessorPartition = defaultTag;
|
|
1009
1013
|
const getProcessorInstanceId = (processorId) => `${processorId}:${(0, uuid.v7)()}`;
|
|
@@ -1657,7 +1661,7 @@ const InMemoryProjectionSpec = { for: (options) => {
|
|
|
1657
1661
|
for (const event of [...givenEvents, ...Array.from({ length: numberOfTimes }).flatMap(() => events)]) {
|
|
1658
1662
|
const metadata = {
|
|
1659
1663
|
checkpoint: bigIntProcessorCheckpoint(++globalPosition),
|
|
1660
|
-
globalPosition,
|
|
1664
|
+
globalPosition: bigIntProcessorCheckpoint(globalPosition),
|
|
1661
1665
|
streamPosition: globalPosition,
|
|
1662
1666
|
streamName: event.metadata?.streamName ?? `test-${(0, uuid.v4)()}`,
|
|
1663
1667
|
messageId: (0, uuid.v4)()
|
|
@@ -1851,7 +1855,7 @@ const getInMemoryEventStore = (eventStoreOptions) => {
|
|
|
1851
1855
|
streamName,
|
|
1852
1856
|
messageId: (0, uuid.v4)(),
|
|
1853
1857
|
streamPosition: BigInt(currentEvents.length + index + 1),
|
|
1854
|
-
globalPosition,
|
|
1858
|
+
globalPosition: bigIntProcessorCheckpoint(globalPosition),
|
|
1855
1859
|
checkpoint: bigIntProcessorCheckpoint(globalPosition)
|
|
1856
1860
|
};
|
|
1857
1861
|
return {
|
|
@@ -2537,6 +2541,7 @@ exports.MessageProcessorType = MessageProcessorType;
|
|
|
2537
2541
|
exports.NO_CONCURRENCY_CHECK = NO_CONCURRENCY_CHECK;
|
|
2538
2542
|
exports.NoRetries = NoRetries;
|
|
2539
2543
|
exports.NotFoundError = require_plugins.NotFoundError;
|
|
2544
|
+
exports.ProcessorCheckpoint = ProcessorCheckpoint;
|
|
2540
2545
|
exports.STREAM_DOES_NOT_EXIST = STREAM_DOES_NOT_EXIST;
|
|
2541
2546
|
exports.STREAM_EXISTS = STREAM_EXISTS;
|
|
2542
2547
|
exports.TaskProcessor = TaskProcessor;
|