@event-driven-io/emmett 0.23.0-alpha.4 → 0.23.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7;
2
2
 
3
3
 
4
4
 
@@ -371,6 +371,178 @@ var sum = (iterator) => {
371
371
  return sum2;
372
372
  };
373
373
 
374
+ // src/taskProcessing/taskProcessor.ts
375
+ var TaskProcessor = (_class2 = class {
376
+ constructor(options) {;_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);
377
+ this.options = options;
378
+ }
379
+ __init3() {this.queue = []}
380
+ __init4() {this.isProcessing = false}
381
+ __init5() {this.activeTasks = 0}
382
+ __init6() {this.activeGroups = /* @__PURE__ */ new Set()}
383
+ enqueue(task, options) {
384
+ if (this.queue.length >= this.options.maxQueueSize) {
385
+ return Promise.reject(
386
+ new (0, _chunkFNITWKARcjs.EmmettError)(
387
+ "Too many pending connections. Please try again later."
388
+ )
389
+ );
390
+ }
391
+ return this.schedule(task, options);
392
+ }
393
+ waitForEndOfProcessing() {
394
+ return this.schedule(({ ack }) => Promise.resolve(ack()));
395
+ }
396
+ schedule(task, options) {
397
+ return promiseWithDeadline(
398
+ (resolve, reject) => {
399
+ const taskWithContext = () => {
400
+ return new Promise((resolveTask, failTask) => {
401
+ const taskPromise = task({
402
+ ack: resolveTask
403
+ });
404
+ taskPromise.then(resolve).catch((err) => {
405
+ failTask(err);
406
+ reject(err);
407
+ });
408
+ });
409
+ };
410
+ this.queue.push({ task: taskWithContext, options });
411
+ if (!this.isProcessing) {
412
+ this.ensureProcessing();
413
+ }
414
+ },
415
+ { deadline: this.options.maxTaskIdleTime }
416
+ );
417
+ }
418
+ ensureProcessing() {
419
+ if (this.isProcessing) return;
420
+ this.isProcessing = true;
421
+ this.processQueue();
422
+ }
423
+ processQueue() {
424
+ try {
425
+ while (this.activeTasks < this.options.maxActiveTasks && this.queue.length > 0) {
426
+ const item = this.takeFirstAvailableItem();
427
+ if (item === null) return;
428
+ const groupId = _optionalChain([item, 'access', _18 => _18.options, 'optionalAccess', _19 => _19.taskGroupId]);
429
+ if (groupId) {
430
+ this.activeGroups.add(groupId);
431
+ }
432
+ this.activeTasks++;
433
+ void this.executeItem(item);
434
+ }
435
+ } catch (error2) {
436
+ console.error(error2);
437
+ throw error2;
438
+ } finally {
439
+ this.isProcessing = false;
440
+ if (this.hasItemsToProcess() && this.activeTasks < this.options.maxActiveTasks) {
441
+ this.ensureProcessing();
442
+ }
443
+ }
444
+ }
445
+ async executeItem({ task, options }) {
446
+ try {
447
+ await task();
448
+ } finally {
449
+ this.activeTasks--;
450
+ if (options && options.taskGroupId) {
451
+ this.activeGroups.delete(options.taskGroupId);
452
+ }
453
+ this.ensureProcessing();
454
+ }
455
+ }
456
+ __init7() {this.takeFirstAvailableItem = () => {
457
+ const taskIndex = this.queue.findIndex(
458
+ (item2) => !_optionalChain([item2, 'access', _20 => _20.options, 'optionalAccess', _21 => _21.taskGroupId]) || !this.activeGroups.has(item2.options.taskGroupId)
459
+ );
460
+ if (taskIndex === -1) {
461
+ return null;
462
+ }
463
+ const [item] = this.queue.splice(taskIndex, 1);
464
+ return _nullishCoalesce(item, () => ( null));
465
+ }}
466
+ __init8() {this.hasItemsToProcess = () => this.queue.findIndex(
467
+ (item) => !_optionalChain([item, 'access', _22 => _22.options, 'optionalAccess', _23 => _23.taskGroupId]) || !this.activeGroups.has(item.options.taskGroupId)
468
+ ) !== -1}
469
+ }, _class2);
470
+ var DEFAULT_PROMISE_DEADLINE = 2147483647;
471
+ var promiseWithDeadline = (executor, options) => {
472
+ return new Promise((resolve, reject) => {
473
+ let taskStarted = false;
474
+ const maxWaitingTime = options.deadline || DEFAULT_PROMISE_DEADLINE;
475
+ let timeoutId = setTimeout(() => {
476
+ if (!taskStarted) {
477
+ reject(
478
+ new Error("Task was not started within the maximum waiting time")
479
+ );
480
+ }
481
+ }, maxWaitingTime);
482
+ executor((value) => {
483
+ taskStarted = true;
484
+ if (timeoutId) {
485
+ clearTimeout(timeoutId);
486
+ }
487
+ timeoutId = null;
488
+ resolve(value);
489
+ }, reject);
490
+ });
491
+ };
492
+
493
+ // src/utils/locking/index.ts
494
+ var InProcessLock = () => {
495
+ const taskProcessor = new TaskProcessor({
496
+ maxActiveTasks: Number.MAX_VALUE,
497
+ maxQueueSize: Number.MAX_VALUE
498
+ });
499
+ const locks = /* @__PURE__ */ new Map();
500
+ return {
501
+ async acquire({ lockId }) {
502
+ await new Promise((resolve, reject) => {
503
+ taskProcessor.enqueue(
504
+ ({ ack }) => {
505
+ locks.set(lockId, ack);
506
+ resolve();
507
+ return Promise.resolve();
508
+ },
509
+ { taskGroupId: lockId }
510
+ ).catch(reject);
511
+ });
512
+ },
513
+ async tryAcquire({ lockId }) {
514
+ if (locks.has(lockId)) {
515
+ return false;
516
+ }
517
+ await this.acquire({ lockId });
518
+ return true;
519
+ },
520
+ release({ lockId }) {
521
+ const ack = locks.get(lockId);
522
+ if (ack === void 0) {
523
+ return Promise.resolve(true);
524
+ }
525
+ locks.delete(lockId);
526
+ ack();
527
+ return Promise.resolve(true);
528
+ },
529
+ async withAcquire(handle, { lockId }) {
530
+ return taskProcessor.enqueue(
531
+ async ({ ack }) => {
532
+ locks.set(lockId, ack);
533
+ try {
534
+ return await handle();
535
+ } finally {
536
+ locks.delete(lockId);
537
+ ack();
538
+ }
539
+ },
540
+ { taskGroupId: lockId }
541
+ );
542
+ }
543
+ };
544
+ };
545
+
374
546
  // src/utils/merge.ts
375
547
  var merge = (array, item, where, onExisting, onNotFound = () => void 0) => {
376
548
  let wasFound = false;
@@ -399,7 +571,7 @@ var asyncRetry = async (fn, opts) => {
399
571
  try {
400
572
  return await fn();
401
573
  } catch (error2) {
402
- if (_optionalChain([opts, 'optionalAccess', _14 => _14.shouldRetryError]) && !opts.shouldRetryError(error2)) {
574
+ if (_optionalChain([opts, 'optionalAccess', _24 => _24.shouldRetryError]) && !opts.shouldRetryError(error2)) {
403
575
  bail(error2);
404
576
  }
405
577
  throw error2;
@@ -443,7 +615,7 @@ var CommandHandler = (options) => async (store, id, handle, handleOptions) => as
443
615
  // expected stream version is passed to fail fast
444
616
  // if stream is in the wrong state
445
617
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
446
- expectedStreamVersion: _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess', _15 => _15.expectedStreamVersion]), () => ( NO_CONCURRENCY_CHECK))
618
+ expectedStreamVersion: _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess', _25 => _25.expectedStreamVersion]), () => ( NO_CONCURRENCY_CHECK))
447
619
  }
448
620
  });
449
621
  const {
@@ -465,7 +637,7 @@ var CommandHandler = (options) => async (store, id, handle, handleOptions) => as
465
637
  createdNewStream: false
466
638
  };
467
639
  }
468
- const expectedStreamVersion = _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess', _16 => _16.expectedStreamVersion]), () => ( (aggregationResult.streamExists ? currentStreamVersion : STREAM_DOES_NOT_EXIST)));
640
+ const expectedStreamVersion = _nullishCoalesce(_optionalChain([handleOptions, 'optionalAccess', _26 => _26.expectedStreamVersion]), () => ( (aggregationResult.streamExists ? currentStreamVersion : STREAM_DOES_NOT_EXIST)));
469
641
  const appendResult = await eventStore.appendToStream(
470
642
  streamName,
471
643
  newEvents,
@@ -573,17 +745,17 @@ var ParseError = class extends Error {
573
745
  var JSONParser = {
574
746
  stringify: (value, options) => {
575
747
  return JSON.stringify(
576
- _optionalChain([options, 'optionalAccess', _17 => _17.map]) ? options.map(value) : value,
748
+ _optionalChain([options, 'optionalAccess', _27 => _27.map]) ? options.map(value) : value,
577
749
  //TODO: Consider adding support to DateTime and adding specific format to mark that's a bigint
578
750
  // eslint-disable-next-line @typescript-eslint/no-unsafe-return
579
751
  (_, v) => typeof v === "bigint" ? v.toString() : v
580
752
  );
581
753
  },
582
754
  parse: (text, options) => {
583
- const parsed = JSON.parse(text, _optionalChain([options, 'optionalAccess', _18 => _18.reviver]));
584
- if (_optionalChain([options, 'optionalAccess', _19 => _19.typeCheck]) && !_optionalChain([options, 'optionalAccess', _20 => _20.typeCheck, 'call', _21 => _21(parsed)]))
755
+ const parsed = JSON.parse(text, _optionalChain([options, 'optionalAccess', _28 => _28.reviver]));
756
+ if (_optionalChain([options, 'optionalAccess', _29 => _29.typeCheck]) && !_optionalChain([options, 'optionalAccess', _30 => _30.typeCheck, 'call', _31 => _31(parsed)]))
585
757
  throw new ParseError(text);
586
- return _optionalChain([options, 'optionalAccess', _22 => _22.map]) ? options.map(parsed) : parsed;
758
+ return _optionalChain([options, 'optionalAccess', _32 => _32.map]) ? options.map(parsed) : parsed;
587
759
  }
588
760
  };
589
761
 
@@ -609,8 +781,8 @@ var collect = async (stream) => {
609
781
  };
610
782
 
611
783
  // src/streaming/decoders/binary.ts
612
- var BinaryJsonDecoder = (_class2 = class {constructor() { _class2.prototype.__init3.call(this); }
613
- __init3() {this.buffer = []}
784
+ var BinaryJsonDecoder = (_class3 = class {constructor() { _class3.prototype.__init9.call(this); }
785
+ __init9() {this.buffer = []}
614
786
  addToBuffer(data) {
615
787
  this.buffer.push(data);
616
788
  }
@@ -637,15 +809,15 @@ var BinaryJsonDecoder = (_class2 = class {constructor() { _class2.prototype.__in
637
809
  this.buffer = remaining.byteLength > 0 ? [remaining] : [];
638
810
  return JSON.parse(jsonString);
639
811
  }
640
- }, _class2);
812
+ }, _class3);
641
813
 
642
814
  // src/streaming/decoders/string.ts
643
- var StringDecoder = (_class3 = class {
644
- constructor(transform) {;_class3.prototype.__init4.call(this);
815
+ var StringDecoder = (_class4 = class {
816
+ constructor(transform) {;_class4.prototype.__init10.call(this);
645
817
  this.transform = transform;
646
818
  this.transform = transform;
647
819
  }
648
- __init4() {this.buffer = []}
820
+ __init10() {this.buffer = []}
649
821
  addToBuffer(data) {
650
822
  this.buffer.push(data);
651
823
  }
@@ -668,7 +840,7 @@ var StringDecoder = (_class3 = class {
668
840
  this.buffer = [completeString.slice(delimiterIndex + 1)];
669
841
  return this.transform(message);
670
842
  }
671
- }, _class3);
843
+ }, _class4);
672
844
 
673
845
  // src/streaming/decoders/json.ts
674
846
  var JsonDecoder = class extends StringDecoder {
@@ -678,8 +850,8 @@ var JsonDecoder = class extends StringDecoder {
678
850
  };
679
851
 
680
852
  // src/streaming/decoders/object.ts
681
- var ObjectDecoder = (_class4 = class {constructor() { _class4.prototype.__init5.call(this); }
682
- __init5() {this.buffer = null}
853
+ var ObjectDecoder = (_class5 = class {constructor() { _class5.prototype.__init11.call(this); }
854
+ __init11() {this.buffer = null}
683
855
  addToBuffer(data) {
684
856
  this.buffer = data;
685
857
  }
@@ -697,7 +869,7 @@ var ObjectDecoder = (_class4 = class {constructor() { _class4.prototype.__init5.
697
869
  this.clearBuffer();
698
870
  return data;
699
871
  }
700
- }, _class4);
872
+ }, _class5);
701
873
 
702
874
  // src/streaming/decoders/composite.ts
703
875
  var CompositeDecoder = class {
@@ -710,7 +882,7 @@ var CompositeDecoder = class {
710
882
  return decoder[1];
711
883
  }
712
884
  addToBuffer(data) {
713
- _optionalChain([this, 'access', _23 => _23.decoderFor, 'call', _24 => _24(data), 'optionalAccess', _25 => _25.addToBuffer, 'call', _26 => _26(data)]);
885
+ _optionalChain([this, 'access', _33 => _33.decoderFor, 'call', _34 => _34(data), 'optionalAccess', _35 => _35.addToBuffer, 'call', _36 => _36(data)]);
714
886
  }
715
887
  clearBuffer() {
716
888
  for (const decoder of this.decoders.map((d) => d[1])) {
@@ -722,7 +894,7 @@ var CompositeDecoder = class {
722
894
  }
723
895
  decode() {
724
896
  const decoder = this.decoders.map((d) => d[1]).find((d) => d.hasCompleteMessage());
725
- return _nullishCoalesce(_optionalChain([decoder, 'optionalAccess', _27 => _27.decode, 'call', _28 => _28()]), () => ( null));
897
+ return _nullishCoalesce(_optionalChain([decoder, 'optionalAccess', _37 => _37.decode, 'call', _38 => _38()]), () => ( null));
726
898
  }
727
899
  };
728
900
  var DefaultDecoder = class extends CompositeDecoder {
@@ -824,8 +996,8 @@ var onRestream = async (createSourceStream, handleChunk2, controller) => {
824
996
  // src/streaming/transformations/skip.ts
825
997
 
826
998
  var skip = (limit) => new SkipTransformStream(limit);
827
- var SkipTransformStream = (_class5 = class extends _webstreamspolyfill.TransformStream {
828
- __init6() {this.count = 0}
999
+ var SkipTransformStream = (_class6 = class extends _webstreamspolyfill.TransformStream {
1000
+ __init12() {this.count = 0}
829
1001
 
830
1002
  constructor(skip2) {
831
1003
  super({
@@ -835,10 +1007,10 @@ var SkipTransformStream = (_class5 = class extends _webstreamspolyfill.Transform
835
1007
  controller.enqueue(chunk);
836
1008
  }
837
1009
  }
838
- });_class5.prototype.__init6.call(this);;
1010
+ });_class6.prototype.__init12.call(this);;
839
1011
  this.skip = skip2;
840
1012
  }
841
- }, _class5);
1013
+ }, _class6);
842
1014
 
843
1015
  // src/streaming/transformations/stopAfter.ts
844
1016
 
@@ -867,8 +1039,8 @@ var stopOn = (stopCondition) => new (0, _webstreamspolyfill.TransformStream)({
867
1039
  // src/streaming/transformations/take.ts
868
1040
 
869
1041
  var take = (limit) => new TakeTransformStream(limit);
870
- var TakeTransformStream = (_class6 = class extends _webstreamspolyfill.TransformStream {
871
- __init7() {this.count = 0}
1042
+ var TakeTransformStream = (_class7 = class extends _webstreamspolyfill.TransformStream {
1043
+ __init13() {this.count = 0}
872
1044
 
873
1045
  constructor(limit) {
874
1046
  super({
@@ -880,10 +1052,10 @@ var TakeTransformStream = (_class6 = class extends _webstreamspolyfill.Transform
880
1052
  controller.terminate();
881
1053
  }
882
1054
  }
883
- });_class6.prototype.__init7.call(this);;
1055
+ });_class7.prototype.__init13.call(this);;
884
1056
  this.limit = limit;
885
1057
  }
886
- }, _class6);
1058
+ }, _class7);
887
1059
 
888
1060
  // src/streaming/transformations/waitAtMost.ts
889
1061
 
@@ -937,7 +1109,7 @@ var decodeAndTransform = (decoder, transform, controller) => {
937
1109
  const transformed = transform(decoded);
938
1110
  controller.enqueue(transformed);
939
1111
  } catch (error2) {
940
- controller.error(new Error(`Decoding error: ${_optionalChain([error2, 'optionalAccess', _29 => _29.toString, 'call', _30 => _30()])}`));
1112
+ controller.error(new Error(`Decoding error: ${_optionalChain([error2, 'optionalAccess', _39 => _39.toString, 'call', _40 => _40()])}`));
941
1113
  }
942
1114
  };
943
1115
 
@@ -1098,39 +1270,39 @@ var argMatches = (matches) => (arg) => matches(arg);
1098
1270
  function verifyThat(fn) {
1099
1271
  return {
1100
1272
  calledTimes: (times) => {
1101
- assertEqual(_optionalChain([fn, 'access', _31 => _31.mock, 'optionalAccess', _32 => _32.calls, 'optionalAccess', _33 => _33.length]), times);
1273
+ assertEqual(_optionalChain([fn, 'access', _41 => _41.mock, 'optionalAccess', _42 => _42.calls, 'optionalAccess', _43 => _43.length]), times);
1102
1274
  },
1103
1275
  notCalled: () => {
1104
- assertEqual(_optionalChain([fn, 'optionalAccess', _34 => _34.mock, 'optionalAccess', _35 => _35.calls, 'optionalAccess', _36 => _36.length]), 0);
1276
+ assertEqual(_optionalChain([fn, 'optionalAccess', _44 => _44.mock, 'optionalAccess', _45 => _45.calls, 'optionalAccess', _46 => _46.length]), 0);
1105
1277
  },
1106
1278
  called: () => {
1107
1279
  assertTrue(
1108
- _optionalChain([fn, 'access', _37 => _37.mock, 'optionalAccess', _38 => _38.calls, 'access', _39 => _39.length]) !== void 0 && fn.mock.calls.length > 0
1280
+ _optionalChain([fn, 'access', _47 => _47.mock, 'optionalAccess', _48 => _48.calls, 'access', _49 => _49.length]) !== void 0 && fn.mock.calls.length > 0
1109
1281
  );
1110
1282
  },
1111
1283
  calledWith: (...args) => {
1112
1284
  assertTrue(
1113
- _optionalChain([fn, 'access', _40 => _40.mock, 'optionalAccess', _41 => _41.calls, 'access', _42 => _42.length]) !== void 0 && fn.mock.calls.length >= 1 && fn.mock.calls.some((call) => deepEquals(call.arguments, args))
1285
+ _optionalChain([fn, 'access', _50 => _50.mock, 'optionalAccess', _51 => _51.calls, 'access', _52 => _52.length]) !== void 0 && fn.mock.calls.length >= 1 && fn.mock.calls.some((call) => deepEquals(call.arguments, args))
1114
1286
  );
1115
1287
  },
1116
1288
  calledOnceWith: (...args) => {
1117
1289
  assertTrue(
1118
- _optionalChain([fn, 'access', _43 => _43.mock, 'optionalAccess', _44 => _44.calls, 'access', _45 => _45.length]) !== void 0 && fn.mock.calls.length === 1 && fn.mock.calls.some((call) => deepEquals(call.arguments, args))
1290
+ _optionalChain([fn, 'access', _53 => _53.mock, 'optionalAccess', _54 => _54.calls, 'access', _55 => _55.length]) !== void 0 && fn.mock.calls.length === 1 && fn.mock.calls.some((call) => deepEquals(call.arguments, args))
1119
1291
  );
1120
1292
  },
1121
1293
  calledWithArgumentMatching: (...matches) => {
1122
1294
  assertTrue(
1123
- _optionalChain([fn, 'access', _46 => _46.mock, 'optionalAccess', _47 => _47.calls, 'access', _48 => _48.length]) !== void 0 && fn.mock.calls.length >= 1
1295
+ _optionalChain([fn, 'access', _56 => _56.mock, 'optionalAccess', _57 => _57.calls, 'access', _58 => _58.length]) !== void 0 && fn.mock.calls.length >= 1
1124
1296
  );
1125
1297
  assertTrue(
1126
- _optionalChain([fn, 'access', _49 => _49.mock, 'optionalAccess', _50 => _50.calls, 'access', _51 => _51.length]) !== void 0 && fn.mock.calls.length >= 1 && fn.mock.calls.some(
1298
+ _optionalChain([fn, 'access', _59 => _59.mock, 'optionalAccess', _60 => _60.calls, 'access', _61 => _61.length]) !== void 0 && fn.mock.calls.length >= 1 && fn.mock.calls.some(
1127
1299
  (call) => call.arguments && call.arguments.length >= matches.length && matches.every((match, index) => match(call.arguments[index]))
1128
1300
  )
1129
1301
  );
1130
1302
  },
1131
1303
  notCalledWithArgumentMatching: (...matches) => {
1132
1304
  assertFalse(
1133
- _optionalChain([fn, 'access', _52 => _52.mock, 'optionalAccess', _53 => _53.calls, 'access', _54 => _54.length]) !== void 0 && fn.mock.calls.length >= 1 && fn.mock.calls[0].arguments && fn.mock.calls[0].arguments.length >= matches.length && matches.every(
1305
+ _optionalChain([fn, 'access', _62 => _62.mock, 'optionalAccess', _63 => _63.calls, 'access', _64 => _64.length]) !== void 0 && fn.mock.calls.length >= 1 && fn.mock.calls[0].arguments && fn.mock.calls[0].arguments.length >= matches.length && matches.every(
1134
1306
  (match, index) => match(fn.mock.calls[0].arguments[index])
1135
1307
  )
1136
1308
  );
@@ -1223,7 +1395,7 @@ var DeciderSpecification = {
1223
1395
  expectedEventsArray
1224
1396
  );
1225
1397
  },
1226
- thenDoesNothing: () => {
1398
+ thenNothingHappened: () => {
1227
1399
  const resultEvents = handle();
1228
1400
  const resultEventsArray = Array.isArray(resultEvents) ? resultEvents : [resultEvents];
1229
1401
  assertThatArray(resultEventsArray).isEmpty();
@@ -1238,18 +1410,18 @@ var DeciderSpecification = {
1238
1410
  if (!_chunkFNITWKARcjs.isErrorConstructor.call(void 0, args[0])) {
1239
1411
  assertTrue(
1240
1412
  args[0](error2),
1241
- `Error didn't match the error condition: ${_optionalChain([error2, 'optionalAccess', _55 => _55.toString, 'call', _56 => _56()])}`
1413
+ `Error didn't match the error condition: ${_optionalChain([error2, 'optionalAccess', _65 => _65.toString, 'call', _66 => _66()])}`
1242
1414
  );
1243
1415
  return;
1244
1416
  }
1245
1417
  assertTrue(
1246
1418
  error2 instanceof args[0],
1247
- `Caught error is not an instance of the expected type: ${_optionalChain([error2, 'optionalAccess', _57 => _57.toString, 'call', _58 => _58()])}`
1419
+ `Caught error is not an instance of the expected type: ${_optionalChain([error2, 'optionalAccess', _67 => _67.toString, 'call', _68 => _68()])}`
1248
1420
  );
1249
1421
  if (args[1]) {
1250
1422
  assertTrue(
1251
1423
  args[1](error2),
1252
- `Error didn't match the error condition: ${_optionalChain([error2, 'optionalAccess', _59 => _59.toString, 'call', _60 => _60()])}`
1424
+ `Error didn't match the error condition: ${_optionalChain([error2, 'optionalAccess', _69 => _69.toString, 'call', _70 => _70()])}`
1253
1425
  );
1254
1426
  }
1255
1427
  }
@@ -1399,5 +1571,7 @@ var WrapEventStore = (eventStore) => {
1399
1571
 
1400
1572
 
1401
1573
 
1402
- exports.AssertionError = AssertionError; exports.BinaryJsonDecoder = BinaryJsonDecoder; exports.CaughtUpTransformStream = CaughtUpTransformStream; exports.CommandHandler = CommandHandler; exports.CommandHandlerStreamVersionConflictRetryOptions = CommandHandlerStreamVersionConflictRetryOptions; exports.CompositeDecoder = CompositeDecoder; exports.ConcurrencyError = _chunkFNITWKARcjs.ConcurrencyError; exports.DeciderCommandHandler = DeciderCommandHandler; exports.DeciderSpecification = DeciderSpecification; exports.DefaultDecoder = DefaultDecoder; exports.EmmettError = _chunkFNITWKARcjs.EmmettError; exports.ExpectedVersionConflictError = ExpectedVersionConflictError; exports.GlobalStreamCaughtUpType = GlobalStreamCaughtUpType; exports.IllegalStateError = _chunkFNITWKARcjs.IllegalStateError; exports.InMemoryEventStoreDefaultStreamVersion = InMemoryEventStoreDefaultStreamVersion; exports.JSONParser = JSONParser; exports.JsonDecoder = JsonDecoder; exports.NO_CONCURRENCY_CHECK = NO_CONCURRENCY_CHECK; exports.NoRetries = NoRetries; exports.NotFoundError = _chunkFNITWKARcjs.NotFoundError; exports.ObjectDecoder = ObjectDecoder; exports.ParseError = ParseError; exports.STREAM_DOES_NOT_EXIST = STREAM_DOES_NOT_EXIST; exports.STREAM_EXISTS = STREAM_EXISTS; exports.StreamingCoordinator = StreamingCoordinator; exports.StringDecoder = StringDecoder; exports.ValidationError = _chunkFNITWKARcjs.ValidationError; exports.ValidationErrors = _chunkFNITWKARcjs.ValidationErrors; exports.WrapEventStore = WrapEventStore; exports.accept = accept; exports.argMatches = argMatches; exports.argValue = argValue; exports.assertDeepEqual = assertDeepEqual; 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 = _chunkFNITWKARcjs.assertNotEmptyString; exports.assertNotEqual = assertNotEqual; exports.assertOk = assertOk; exports.assertPositiveNumber = _chunkFNITWKARcjs.assertPositiveNumber; exports.assertRejects = assertRejects; exports.assertThat = assertThat; exports.assertThatArray = assertThatArray; exports.assertThrows = assertThrows; exports.assertThrowsAsync = assertThrowsAsync; exports.assertTrue = assertTrue; exports.assertUnsignedBigInt = _chunkFNITWKARcjs.assertUnsignedBigInt; exports.asyncProjections = asyncProjections; exports.asyncRetry = asyncRetry; exports.canCreateEventStoreSession = canCreateEventStoreSession; exports.caughtUpEventFrom = caughtUpEventFrom; exports.collect = collect; exports.command = command; exports.complete = complete; exports.concatUint8Arrays = concatUint8Arrays; exports.deepEquals = deepEquals; exports.error = error; exports.event = event; exports.formatDateToUtcYYYYMMDD = _chunkFNITWKARcjs.formatDateToUtcYYYYMMDD; exports.getInMemoryEventStore = getInMemoryEventStore; exports.getInMemoryMessageBus = getInMemoryMessageBus; exports.globalStreamCaughtUp = globalStreamCaughtUp; exports.ignore = ignore; exports.inlineProjections = inlineProjections; exports.isEquatable = isEquatable; exports.isErrorConstructor = _chunkFNITWKARcjs.isErrorConstructor; exports.isExpectedVersionConflictError = isExpectedVersionConflictError; exports.isGlobalStreamCaughtUp = isGlobalStreamCaughtUp; exports.isNotInternalEvent = isNotInternalEvent; exports.isNumber = _chunkFNITWKARcjs.isNumber; exports.isPluginConfig = _chunkFNITWKARcjs.isPluginConfig; exports.isString = _chunkFNITWKARcjs.isString; exports.isSubscriptionEvent = isSubscriptionEvent; exports.isSubset = isSubset; exports.isValidYYYYMMDD = _chunkFNITWKARcjs.isValidYYYYMMDD; exports.matchesExpectedVersion = matchesExpectedVersion; exports.merge = merge; exports.nulloSessionFactory = nulloSessionFactory; exports.parseDateFromUtcYYYYMMDD = _chunkFNITWKARcjs.parseDateFromUtcYYYYMMDD; exports.projection = projection; exports.projections = projections; exports.publish = publish; exports.reply = reply; exports.restream = restream; exports.schedule = schedule; exports.send = send; exports.streamGenerators = streamGenerators; exports.streamTrackingGlobalPosition = streamTrackingGlobalPosition; exports.streamTransformations = streamTransformations; exports.sum = sum; exports.verifyThat = verifyThat;
1574
+
1575
+
1576
+ exports.AssertionError = AssertionError; exports.BinaryJsonDecoder = BinaryJsonDecoder; exports.CaughtUpTransformStream = CaughtUpTransformStream; exports.CommandHandler = CommandHandler; exports.CommandHandlerStreamVersionConflictRetryOptions = CommandHandlerStreamVersionConflictRetryOptions; exports.CompositeDecoder = CompositeDecoder; exports.ConcurrencyError = _chunkFNITWKARcjs.ConcurrencyError; exports.DeciderCommandHandler = DeciderCommandHandler; exports.DeciderSpecification = DeciderSpecification; exports.DefaultDecoder = DefaultDecoder; exports.EmmettError = _chunkFNITWKARcjs.EmmettError; exports.ExpectedVersionConflictError = ExpectedVersionConflictError; exports.GlobalStreamCaughtUpType = GlobalStreamCaughtUpType; exports.IllegalStateError = _chunkFNITWKARcjs.IllegalStateError; exports.InMemoryEventStoreDefaultStreamVersion = InMemoryEventStoreDefaultStreamVersion; exports.InProcessLock = InProcessLock; exports.JSONParser = JSONParser; exports.JsonDecoder = JsonDecoder; exports.NO_CONCURRENCY_CHECK = NO_CONCURRENCY_CHECK; exports.NoRetries = NoRetries; exports.NotFoundError = _chunkFNITWKARcjs.NotFoundError; exports.ObjectDecoder = ObjectDecoder; exports.ParseError = ParseError; exports.STREAM_DOES_NOT_EXIST = STREAM_DOES_NOT_EXIST; exports.STREAM_EXISTS = STREAM_EXISTS; exports.StreamingCoordinator = StreamingCoordinator; exports.StringDecoder = StringDecoder; exports.TaskProcessor = TaskProcessor; exports.ValidationError = _chunkFNITWKARcjs.ValidationError; exports.ValidationErrors = _chunkFNITWKARcjs.ValidationErrors; exports.WrapEventStore = WrapEventStore; exports.accept = accept; exports.argMatches = argMatches; exports.argValue = argValue; exports.assertDeepEqual = assertDeepEqual; 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 = _chunkFNITWKARcjs.assertNotEmptyString; exports.assertNotEqual = assertNotEqual; exports.assertOk = assertOk; exports.assertPositiveNumber = _chunkFNITWKARcjs.assertPositiveNumber; exports.assertRejects = assertRejects; exports.assertThat = assertThat; exports.assertThatArray = assertThatArray; exports.assertThrows = assertThrows; exports.assertThrowsAsync = assertThrowsAsync; exports.assertTrue = assertTrue; exports.assertUnsignedBigInt = _chunkFNITWKARcjs.assertUnsignedBigInt; exports.asyncProjections = asyncProjections; exports.asyncRetry = asyncRetry; exports.canCreateEventStoreSession = canCreateEventStoreSession; exports.caughtUpEventFrom = caughtUpEventFrom; exports.collect = collect; exports.command = command; exports.complete = complete; exports.concatUint8Arrays = concatUint8Arrays; exports.deepEquals = deepEquals; exports.error = error; exports.event = event; exports.formatDateToUtcYYYYMMDD = _chunkFNITWKARcjs.formatDateToUtcYYYYMMDD; exports.getInMemoryEventStore = getInMemoryEventStore; exports.getInMemoryMessageBus = getInMemoryMessageBus; exports.globalStreamCaughtUp = globalStreamCaughtUp; exports.ignore = ignore; exports.inlineProjections = inlineProjections; exports.isEquatable = isEquatable; exports.isErrorConstructor = _chunkFNITWKARcjs.isErrorConstructor; exports.isExpectedVersionConflictError = isExpectedVersionConflictError; exports.isGlobalStreamCaughtUp = isGlobalStreamCaughtUp; exports.isNotInternalEvent = isNotInternalEvent; exports.isNumber = _chunkFNITWKARcjs.isNumber; exports.isPluginConfig = _chunkFNITWKARcjs.isPluginConfig; exports.isString = _chunkFNITWKARcjs.isString; exports.isSubscriptionEvent = isSubscriptionEvent; exports.isSubset = isSubset; exports.isValidYYYYMMDD = _chunkFNITWKARcjs.isValidYYYYMMDD; exports.matchesExpectedVersion = matchesExpectedVersion; exports.merge = merge; exports.nulloSessionFactory = nulloSessionFactory; exports.parseDateFromUtcYYYYMMDD = _chunkFNITWKARcjs.parseDateFromUtcYYYYMMDD; exports.projection = projection; exports.projections = projections; exports.publish = publish; exports.reply = reply; exports.restream = restream; exports.schedule = schedule; exports.send = send; exports.streamGenerators = streamGenerators; exports.streamTrackingGlobalPosition = streamTrackingGlobalPosition; exports.streamTransformations = streamTransformations; exports.sum = sum; exports.verifyThat = verifyThat;
1403
1577
  //# sourceMappingURL=index.cjs.map