@daiso-tech/core 0.14.0 → 0.16.0
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/cjs/_module.js +3 -2
- package/dist/cjs/_module.js.map +1 -1
- package/dist/cjs/async/_module.js +20 -0
- package/dist/cjs/async/_module.js.map +1 -0
- package/dist/cjs/{utilities/async/_shared.js → async/async.errors.js} +1 -1
- package/dist/cjs/async/async.errors.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/_module.js +4 -4
- package/dist/cjs/async/backof-policies/_module.js.map +1 -0
- package/dist/cjs/async/backof-policies/_shared.js.map +1 -0
- package/dist/cjs/{serializer/implementations/sql-serializer → async/backof-policies/constant-backoff-policy}/_module.js +1 -1
- package/dist/cjs/async/backof-policies/constant-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/constant-backoff-policy/constant-backoff-policy.js +1 -1
- package/dist/cjs/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
- package/dist/cjs/{serializer/implementations/_shared/test-utilities → async/backof-policies/exponential-backoff-policy}/_module.js +1 -1
- package/dist/cjs/async/backof-policies/exponential-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +1 -1
- package/dist/cjs/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
- package/dist/cjs/{serializer/implementations/mongodb-serializer → async/backof-policies/linear-backoff-policy}/_module.js +1 -1
- package/dist/cjs/async/backof-policies/linear-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/linear-backoff-policy/linear-backoff-policy.js +1 -1
- package/dist/cjs/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
- package/dist/cjs/async/backof-policies/polynomial-backoff-policy/_module.js +18 -0
- package/dist/cjs/async/backof-policies/polynomial-backoff-policy/_module.js.map +1 -0
- package/dist/cjs/{utilities → async}/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +1 -1
- package/dist/cjs/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
- package/dist/cjs/{event-bus/implementations/_shared/test-utilities → async/utilities}/_module.js +2 -1
- package/dist/cjs/async/utilities/_module.js.map +1 -0
- package/dist/cjs/async/utilities/abort/_module.js +19 -0
- package/dist/cjs/async/utilities/abort/_module.js.map +1 -0
- package/dist/cjs/async/utilities/abort/abort-and-fail.js +45 -0
- package/dist/cjs/async/utilities/abort/abort-and-fail.js.map +1 -0
- package/dist/cjs/async/utilities/abort/abort.js +18 -0
- package/dist/cjs/async/utilities/abort/abort.js.map +1 -0
- package/dist/cjs/{utilities/async → async/utilities}/delay/_module.js +1 -1
- package/dist/cjs/async/utilities/delay/_module.js.map +1 -0
- package/dist/cjs/async/utilities/delay/delay.js +20 -0
- package/dist/cjs/async/utilities/delay/delay.js.map +1 -0
- package/dist/cjs/{utilities/async → async/utilities}/lazy-promise/_module.js +1 -1
- package/dist/cjs/async/utilities/lazy-promise/_module.js.map +1 -0
- package/dist/cjs/async/utilities/lazy-promise/lazy-promise.js +110 -0
- package/dist/cjs/async/utilities/lazy-promise/lazy-promise.js.map +1 -0
- package/dist/cjs/async/utilities/retry/_module.js +19 -0
- package/dist/cjs/async/utilities/retry/_module.js.map +1 -0
- package/dist/cjs/async/utilities/retry/retry-or-fail.js +36 -0
- package/dist/cjs/async/utilities/retry/retry-or-fail.js.map +1 -0
- package/dist/cjs/async/utilities/retry/retry.js +18 -0
- package/dist/cjs/async/utilities/retry/retry.js.map +1 -0
- package/dist/cjs/{utilities/async → async/utilities}/timeout/_module.js +2 -1
- package/dist/cjs/async/utilities/timeout/_module.js.map +1 -0
- package/dist/cjs/async/utilities/timeout/timeout-and-fail.js +25 -0
- package/dist/cjs/async/utilities/timeout/timeout-and-fail.js.map +1 -0
- package/dist/cjs/async/utilities/timeout/timeout.js +18 -0
- package/dist/cjs/async/utilities/timeout/timeout.js.map +1 -0
- package/dist/cjs/cache/contracts/cache.events.js +0 -11
- package/dist/cjs/cache/contracts/cache.events.js.map +1 -1
- package/dist/cjs/cache/implementations/_shared/cache-adapter.test-suite.js +257 -177
- package/dist/cjs/cache/implementations/_shared/cache-adapter.test-suite.js.map +1 -1
- package/dist/cjs/cache/implementations/_shared/cache.test-suite.js +59 -37
- package/dist/cjs/cache/implementations/_shared/cache.test-suite.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js +59 -18
- package/dist/cjs/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +16 -6
- package/dist/cjs/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +58 -39
- package/dist/cjs/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +63 -26
- package/dist/cjs/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +10 -1
- package/dist/cjs/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +44 -19
- package/dist/cjs/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +17 -7
- package/dist/cjs/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
- package/dist/cjs/cache/implementations/derivables/_module.js +0 -1
- package/dist/cjs/cache/implementations/derivables/_module.js.map +1 -1
- package/dist/cjs/cache/implementations/derivables/cache-factory.js +4 -7
- package/dist/cjs/cache/implementations/derivables/cache-factory.js.map +1 -1
- package/dist/cjs/cache/implementations/derivables/cache.js +303 -61
- package/dist/cjs/cache/implementations/derivables/cache.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/_module.js +4 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +27 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js +14 -7
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js +33 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js.map +1 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js +36 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js.map +1 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js +48 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js.map +1 -0
- package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js +63 -42
- package/dist/cjs/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/_shared/merge-iterable.js +6 -7
- package/dist/cjs/collection/implementations/iterable-collection/_shared/merge-iterable.js.map +1 -1
- package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js +16 -7
- package/dist/cjs/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/cjs/collection/implementations/list-collection/list-collection.js +18 -5
- package/dist/cjs/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/cjs/event-bus/contracts/event-bus.errors.js +3 -3
- package/dist/cjs/event-bus/contracts/event-bus.errors.js.map +1 -1
- package/dist/cjs/event-bus/implementations/_module.js +1 -1
- package/dist/cjs/event-bus/implementations/_module.js.map +1 -1
- package/dist/cjs/event-bus/implementations/_shared/_module.js +19 -0
- package/dist/cjs/event-bus/implementations/_shared/_module.js.map +1 -0
- package/dist/cjs/event-bus/implementations/_shared/event-bus-adapter.test-suite.js +96 -0
- package/dist/cjs/event-bus/implementations/_shared/event-bus-adapter.test-suite.js.map +1 -0
- package/dist/cjs/event-bus/implementations/_shared/event-bus.test-suite.js +335 -0
- package/dist/cjs/event-bus/implementations/_shared/event-bus.test-suite.js.map +1 -0
- package/dist/cjs/event-bus/implementations/adapters/_module.js +1 -1
- package/dist/cjs/event-bus/implementations/adapters/_module.js.map +1 -1
- package/dist/cjs/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +19 -9
- package/dist/cjs/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
- package/dist/cjs/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +7 -1
- package/dist/cjs/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
- package/dist/cjs/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module.js.map +1 -0
- package/dist/cjs/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +52 -0
- package/dist/cjs/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -0
- package/dist/cjs/event-bus/implementations/derivables/event-bus-factory.js +6 -7
- package/dist/cjs/event-bus/implementations/derivables/event-bus-factory.js.map +1 -1
- package/dist/cjs/event-bus/implementations/derivables/event-bus.js +96 -33
- package/dist/cjs/event-bus/implementations/derivables/event-bus.js.map +1 -1
- package/dist/cjs/{utilities/async/retry → serde/contracts}/_module.js +2 -1
- package/dist/cjs/serde/contracts/_module.js.map +1 -0
- package/dist/cjs/{serializer/contracts/serializer.contract.js → serde/contracts/serde.contract.js} +1 -1
- package/dist/cjs/serde/contracts/serde.contract.js.map +1 -0
- package/dist/cjs/{serializer/contracts/serializer.errors.js → serde/contracts/serde.errors.js} +7 -7
- package/dist/cjs/serde/contracts/serde.errors.js.map +1 -0
- package/dist/cjs/{_shared/redis → serde/implementations}/_module.js +5 -3
- package/dist/cjs/serde/implementations/_module.js.map +1 -0
- package/dist/cjs/{serializer/implementations/redis-serializer → serde/implementations/_shared/test-utilities}/_module.js +1 -1
- package/dist/cjs/serde/implementations/_shared/test-utilities/_module.js.map +1 -0
- package/dist/{esm/serializer/implementations/_shared/test-utilities/serializer.test-suite.js → cjs/serde/implementations/_shared/test-utilities/serde.test-suite.js} +65 -62
- package/dist/cjs/serde/implementations/_shared/test-utilities/serde.test-suite.js.map +1 -0
- package/dist/cjs/{_shared/kysely → serde/implementations/mongodb-serde}/_module.js +1 -1
- package/dist/cjs/serde/implementations/mongodb-serde/_module.js.map +1 -0
- package/dist/cjs/serde/implementations/mongodb-serde/mongodb-serde.js +36 -0
- package/dist/cjs/serde/implementations/mongodb-serde/mongodb-serde.js.map +1 -0
- package/dist/cjs/{utilities/async/delay-iterable → serde/implementations/redis-serde}/_module.js +1 -1
- package/dist/cjs/serde/implementations/redis-serde/_module.js.map +1 -0
- package/dist/cjs/serde/implementations/redis-serde/redis-serde.js +37 -0
- package/dist/cjs/serde/implementations/redis-serde/redis-serde.js.map +1 -0
- package/dist/cjs/{utilities/async/abortable → serde/implementations/sql-serde}/_module.js +1 -1
- package/dist/cjs/serde/implementations/sql-serde/_module.js.map +1 -0
- package/dist/cjs/serde/implementations/sql-serde/sql-serde.js +37 -0
- package/dist/cjs/serde/implementations/sql-serde/sql-serde.js.map +1 -0
- package/dist/cjs/{utilities/async/abortable-iterable → serde/implementations/super-json-serde}/_module.js +1 -1
- package/dist/cjs/serde/implementations/super-json-serde/_module.js.map +1 -0
- package/dist/cjs/{serializer/implementations/super-json-serializer/super-json-serializer.js → serde/implementations/super-json-serde/super-json-serde.js} +74 -100
- package/dist/cjs/serde/implementations/super-json-serde/super-json-serde.js.map +1 -0
- package/dist/cjs/utilities/_module.js +5 -4
- package/dist/cjs/utilities/_module.js.map +1 -1
- package/dist/cjs/{serializer → utilities}/contracts/_module.js +2 -2
- package/dist/cjs/utilities/contracts/_module.js.map +1 -0
- package/dist/cjs/utilities/contracts/deinitizable.contract.js +3 -0
- package/dist/cjs/utilities/contracts/deinitizable.contract.js.map +1 -0
- package/dist/cjs/utilities/contracts/initizable.contract.js +3 -0
- package/dist/cjs/utilities/contracts/initizable.contract.js.map +1 -0
- package/dist/cjs/utilities/{global-errors.js → errors.js} +1 -1
- package/dist/cjs/utilities/errors.js.map +1 -0
- package/dist/cjs/{_shared/utilities.js → utilities/functions.js} +6 -6
- package/dist/cjs/utilities/functions.js.map +1 -0
- package/dist/cjs/utilities/kysely/_module.js +18 -0
- package/dist/cjs/utilities/kysely/_module.js.map +1 -0
- package/dist/cjs/utilities/kysely/kysely-table-name-transformer-plugin.js.map +1 -0
- package/dist/cjs/utilities/time-span/time-span.js +8 -0
- package/dist/cjs/utilities/time-span/time-span.js.map +1 -1
- package/dist/cjs/{_shared → utilities}/types.js.map +1 -1
- package/dist/esm/_module.js +3 -2
- package/dist/esm/_module.js.map +1 -1
- package/dist/esm/async/_module.js +4 -0
- package/dist/esm/async/_module.js.map +1 -0
- package/dist/esm/{utilities/async/_shared.js → async/async.errors.js} +1 -1
- package/dist/esm/async/async.errors.js.map +1 -0
- package/dist/esm/async/backof-policies/_module.js +5 -0
- package/dist/esm/async/backof-policies/_module.js.map +1 -0
- package/dist/esm/async/backof-policies/_shared.js.map +1 -0
- package/dist/esm/async/backof-policies/constant-backoff-policy/_module.js +2 -0
- package/dist/esm/async/backof-policies/constant-backoff-policy/_module.js.map +1 -0
- package/dist/esm/{utilities → async}/backof-policies/constant-backoff-policy/constant-backoff-policy.js +1 -1
- package/dist/esm/async/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +1 -0
- package/dist/esm/async/backof-policies/exponential-backoff-policy/_module.js +2 -0
- package/dist/esm/async/backof-policies/exponential-backoff-policy/_module.js.map +1 -0
- package/dist/esm/{utilities → async}/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js +1 -1
- package/dist/esm/async/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +1 -0
- package/dist/esm/async/backof-policies/linear-backoff-policy/_module.js +2 -0
- package/dist/esm/async/backof-policies/linear-backoff-policy/_module.js.map +1 -0
- package/dist/esm/{utilities → async}/backof-policies/linear-backoff-policy/linear-backoff-policy.js +1 -1
- package/dist/esm/async/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +1 -0
- package/dist/esm/async/backof-policies/polynomial-backoff-policy/_module.js +2 -0
- package/dist/esm/async/backof-policies/polynomial-backoff-policy/_module.js.map +1 -0
- package/dist/esm/{utilities → async}/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js +1 -1
- package/dist/esm/async/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +1 -0
- package/dist/esm/async/utilities/_module.js +3 -0
- package/dist/esm/async/utilities/_module.js.map +1 -0
- package/dist/esm/async/utilities/abort/_module.js +3 -0
- package/dist/esm/async/utilities/abort/_module.js.map +1 -0
- package/dist/esm/{utilities/async/abortable/abortable.js → async/utilities/abort/abort-and-fail.js} +13 -16
- package/dist/esm/async/utilities/abort/abort-and-fail.js.map +1 -0
- package/dist/esm/async/utilities/abort/abort.js +15 -0
- package/dist/esm/async/utilities/abort/abort.js.map +1 -0
- package/dist/esm/async/utilities/delay/_module.js +2 -0
- package/dist/esm/async/utilities/delay/_module.js.map +1 -0
- package/dist/esm/async/utilities/delay/delay.js +17 -0
- package/dist/esm/async/utilities/delay/delay.js.map +1 -0
- package/dist/esm/async/utilities/lazy-promise/_module.js +2 -0
- package/dist/esm/async/utilities/lazy-promise/_module.js.map +1 -0
- package/dist/esm/async/utilities/lazy-promise/lazy-promise.js +106 -0
- package/dist/esm/async/utilities/lazy-promise/lazy-promise.js.map +1 -0
- package/dist/esm/async/utilities/retry/_module.js +3 -0
- package/dist/esm/async/utilities/retry/_module.js.map +1 -0
- package/dist/esm/async/utilities/retry/retry-or-fail.js +33 -0
- package/dist/esm/async/utilities/retry/retry-or-fail.js.map +1 -0
- package/dist/esm/async/utilities/retry/retry.js +15 -0
- package/dist/esm/async/utilities/retry/retry.js.map +1 -0
- package/dist/esm/async/utilities/timeout/_module.js +3 -0
- package/dist/esm/async/utilities/timeout/_module.js.map +1 -0
- package/dist/esm/async/utilities/timeout/timeout-and-fail.js +22 -0
- package/dist/esm/async/utilities/timeout/timeout-and-fail.js.map +1 -0
- package/dist/esm/async/utilities/timeout/timeout.js +15 -0
- package/dist/esm/async/utilities/timeout/timeout.js.map +1 -0
- package/dist/esm/cache/contracts/cache.events.js +0 -10
- package/dist/esm/cache/contracts/cache.events.js.map +1 -1
- package/dist/esm/cache/implementations/_shared/cache-adapter.test-suite.js +258 -178
- package/dist/esm/cache/implementations/_shared/cache-adapter.test-suite.js.map +1 -1
- package/dist/esm/cache/implementations/_shared/cache.test-suite.js +25 -3
- package/dist/esm/cache/implementations/_shared/cache.test-suite.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js +60 -19
- package/dist/esm/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js +16 -6
- package/dist/esm/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js +58 -39
- package/dist/esm/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js +63 -23
- package/dist/esm/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js +10 -1
- package/dist/esm/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js +44 -19
- package/dist/esm/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js +16 -6
- package/dist/esm/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.js.map +1 -1
- package/dist/esm/cache/implementations/derivables/_module.js +0 -1
- package/dist/esm/cache/implementations/derivables/_module.js.map +1 -1
- package/dist/esm/cache/implementations/derivables/cache-factory.js +2 -5
- package/dist/esm/cache/implementations/derivables/cache-factory.js.map +1 -1
- package/dist/esm/cache/implementations/derivables/cache.js +304 -62
- package/dist/esm/cache/implementations/derivables/cache.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/_module.js +4 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/_module.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js +23 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.js.map +1 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js +14 -7
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js +29 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.js.map +1 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js +32 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.js.map +1 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js +44 -0
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.js.map +1 -0
- package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js +61 -40
- package/dist/esm/collection/implementations/async-iterable-collection/async-iterable-collection.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/_shared/merge-iterable.js +6 -7
- package/dist/esm/collection/implementations/iterable-collection/_shared/merge-iterable.js.map +1 -1
- package/dist/esm/collection/implementations/iterable-collection/iterable-collection.js +12 -3
- package/dist/esm/collection/implementations/iterable-collection/iterable-collection.js.map +1 -1
- package/dist/esm/collection/implementations/list-collection/list-collection.js +14 -1
- package/dist/esm/collection/implementations/list-collection/list-collection.js.map +1 -1
- package/dist/esm/event-bus/contracts/event-bus.errors.js +3 -3
- package/dist/esm/event-bus/contracts/event-bus.errors.js.map +1 -1
- package/dist/esm/event-bus/implementations/_module.js +1 -1
- package/dist/esm/event-bus/implementations/_module.js.map +1 -1
- package/dist/esm/event-bus/implementations/_shared/_module.js +3 -0
- package/dist/esm/event-bus/implementations/_shared/_module.js.map +1 -0
- package/dist/esm/event-bus/implementations/_shared/event-bus-adapter.test-suite.js +93 -0
- package/dist/esm/event-bus/implementations/_shared/event-bus-adapter.test-suite.js.map +1 -0
- package/dist/esm/event-bus/implementations/_shared/event-bus.test-suite.js +332 -0
- package/dist/esm/event-bus/implementations/_shared/event-bus.test-suite.js.map +1 -0
- package/dist/esm/event-bus/implementations/adapters/_module.js +1 -1
- package/dist/esm/event-bus/implementations/adapters/_module.js.map +1 -1
- package/dist/esm/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js +19 -9
- package/dist/esm/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.js.map +1 -1
- package/dist/esm/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js +7 -1
- package/dist/esm/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.js.map +1 -1
- package/dist/esm/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module.js.map +1 -0
- package/dist/esm/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js +48 -0
- package/dist/esm/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.js.map +1 -0
- package/dist/esm/event-bus/implementations/derivables/event-bus-factory.js +4 -5
- package/dist/esm/event-bus/implementations/derivables/event-bus-factory.js.map +1 -1
- package/dist/esm/event-bus/implementations/derivables/event-bus.js +97 -34
- package/dist/esm/event-bus/implementations/derivables/event-bus.js.map +1 -1
- package/dist/esm/serde/contracts/_module.js +3 -0
- package/dist/esm/serde/contracts/_module.js.map +1 -0
- package/dist/esm/serde/contracts/serde.contract.js +1 -0
- package/dist/esm/serde/contracts/serde.contract.js.map +1 -0
- package/dist/esm/{serializer/contracts/serializer.errors.js → serde/contracts/serde.errors.js} +5 -5
- package/dist/esm/serde/contracts/serde.errors.js.map +1 -0
- package/dist/esm/serde/implementations/_module.js +6 -0
- package/dist/esm/serde/implementations/_module.js.map +1 -0
- package/dist/esm/serde/implementations/_shared/test-utilities/_module.js +2 -0
- package/dist/esm/serde/implementations/_shared/test-utilities/_module.js.map +1 -0
- package/dist/{cjs/serializer/implementations/_shared/test-utilities/serializer.test-suite.js → esm/serde/implementations/_shared/test-utilities/serde.test-suite.js} +62 -65
- package/dist/esm/serde/implementations/_shared/test-utilities/serde.test-suite.js.map +1 -0
- package/dist/esm/serde/implementations/mongodb-serde/_module.js +2 -0
- package/dist/esm/serde/implementations/mongodb-serde/_module.js.map +1 -0
- package/dist/esm/{serializer/implementations/mongodb-serializer/mongodb-serializer.js → serde/implementations/mongodb-serde/mongodb-serde.js} +10 -10
- package/dist/esm/serde/implementations/mongodb-serde/mongodb-serde.js.map +1 -0
- package/dist/esm/serde/implementations/redis-serde/_module.js +2 -0
- package/dist/esm/serde/implementations/redis-serde/_module.js.map +1 -0
- package/dist/esm/{serializer/implementations/sql-serializer/sql-serializer.js → serde/implementations/redis-serde/redis-serde.js} +10 -10
- package/dist/esm/serde/implementations/redis-serde/redis-serde.js.map +1 -0
- package/dist/esm/serde/implementations/sql-serde/_module.js +2 -0
- package/dist/esm/serde/implementations/sql-serde/_module.js.map +1 -0
- package/dist/esm/{serializer/implementations/redis-serializer/redis-serializer.js → serde/implementations/sql-serde/sql-serde.js} +10 -10
- package/dist/esm/serde/implementations/sql-serde/sql-serde.js.map +1 -0
- package/dist/esm/serde/implementations/super-json-serde/_module.js +2 -0
- package/dist/esm/serde/implementations/super-json-serde/_module.js.map +1 -0
- package/dist/esm/{serializer/implementations/super-json-serializer/super-json-serializer.js → serde/implementations/super-json-serde/super-json-serde.js} +52 -55
- package/dist/esm/serde/implementations/super-json-serde/super-json-serde.js.map +1 -0
- package/dist/esm/utilities/_module.js +5 -4
- package/dist/esm/utilities/_module.js.map +1 -1
- package/dist/esm/utilities/contracts/_module.js +3 -0
- package/dist/esm/utilities/contracts/_module.js.map +1 -0
- package/dist/esm/utilities/contracts/deinitizable.contract.js +1 -0
- package/dist/esm/utilities/contracts/deinitizable.contract.js.map +1 -0
- package/dist/esm/utilities/contracts/initizable.contract.js +1 -0
- package/dist/esm/utilities/contracts/initizable.contract.js.map +1 -0
- package/dist/esm/utilities/{global-errors.js → errors.js} +1 -1
- package/dist/esm/utilities/errors.js.map +1 -0
- package/dist/esm/{_shared/utilities.js → utilities/functions.js} +5 -5
- package/dist/esm/utilities/functions.js.map +1 -0
- package/dist/esm/utilities/kysely/_module.js +2 -0
- package/dist/esm/utilities/kysely/_module.js.map +1 -0
- package/dist/esm/utilities/kysely/kysely-table-name-transformer-plugin.js.map +1 -0
- package/dist/esm/utilities/time-span/time-span.js +8 -0
- package/dist/esm/utilities/time-span/time-span.js.map +1 -1
- package/dist/esm/{_shared → utilities}/types.js.map +1 -1
- package/dist/types/_module.d.ts +3 -2
- package/dist/types/async/_module.d.ts +3 -0
- package/dist/types/{utilities/async/_shared.d.ts → async/async.errors.d.ts} +6 -6
- package/dist/types/async/backof-policies/_module.d.ts +5 -0
- package/dist/types/{utilities → async}/backof-policies/_shared.d.ts +1 -1
- package/dist/types/async/backof-policies/constant-backoff-policy/_module.d.ts +1 -0
- package/dist/types/{utilities → async}/backof-policies/constant-backoff-policy/constant-backoff-policy.d.ts +2 -2
- package/dist/types/async/backof-policies/exponential-backoff-policy/_module.d.ts +1 -0
- package/dist/types/{utilities → async}/backof-policies/exponential-backoff-policy/exponential-backoff-policy.d.ts +2 -2
- package/dist/types/async/backof-policies/linear-backoff-policy/_module.d.ts +1 -0
- package/dist/types/{utilities → async}/backof-policies/linear-backoff-policy/linear-backoff-policy.d.ts +2 -2
- package/dist/types/async/backof-policies/polynomial-backoff-policy/_module.d.ts +1 -0
- package/dist/types/{utilities → async}/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.d.ts +2 -2
- package/dist/types/async/utilities/_module.d.ts +2 -0
- package/dist/types/async/utilities/abort/_module.d.ts +2 -0
- package/dist/types/async/utilities/abort/abort-and-fail.d.ts +4 -0
- package/dist/types/async/utilities/abort/abort.d.ts +9 -0
- package/dist/types/async/utilities/delay/_module.d.ts +1 -0
- package/dist/types/async/utilities/delay/delay.d.ts +19 -0
- package/dist/types/async/utilities/lazy-promise/_module.d.ts +1 -0
- package/dist/types/async/utilities/lazy-promise/lazy-promise.d.ts +222 -0
- package/dist/types/async/utilities/retry/_module.d.ts +2 -0
- package/dist/types/async/utilities/retry/retry-or-fail.d.ts +23 -0
- package/dist/types/async/utilities/retry/retry.d.ts +10 -0
- package/dist/types/async/utilities/timeout/_module.d.ts +2 -0
- package/dist/types/async/utilities/timeout/timeout-and-fail.d.ts +5 -0
- package/dist/types/async/utilities/timeout/timeout.d.ts +10 -0
- package/dist/types/cache/contracts/cache-adapter.contract.d.ts +20 -6
- package/dist/types/cache/contracts/cache-factory.contract.d.ts +4 -4
- package/dist/types/cache/contracts/cache.contract.d.ts +25 -43
- package/dist/types/cache/contracts/cache.events.d.ts +38 -91
- package/dist/types/cache/implementations/_shared/cache-adapter.test-suite.d.ts +34 -25
- package/dist/types/cache/implementations/_shared/cache.test-suite.d.ts +54 -43
- package/dist/types/cache/implementations/adapters/kysely-sqlite-cache-adapter/kysely-sqlite-cache-adapter.d.ts +11 -5
- package/dist/types/cache/implementations/adapters/libsql-cache-adapter/libsql-cache-adapter.d.ts +22 -9
- package/dist/types/cache/implementations/adapters/memory-cache-adapter/memory-cache-adapter.d.ts +12 -6
- package/dist/types/cache/implementations/adapters/mongodb-cache-adapter/mongodb-cache-adapter.d.ts +24 -11
- package/dist/types/cache/implementations/adapters/no-op-cache-adapter/no-op-cache-adapter.d.ts +5 -2
- package/dist/types/cache/implementations/adapters/redis-cache-adapter/redis-cache-adapter.d.ts +20 -13
- package/dist/types/cache/implementations/adapters/sqlite-cache-adapter/sqlite-cache-adapter.d.ts +22 -9
- package/dist/types/cache/implementations/derivables/_module.d.ts +0 -1
- package/dist/types/cache/implementations/derivables/cache-factory.d.ts +5 -11
- package/dist/types/cache/implementations/derivables/cache.d.ts +37 -42
- package/dist/types/collection/contracts/async-collection.contract.d.ts +10 -6
- package/dist/types/collection/contracts/collection.contract.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/_module.d.ts +4 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-chunk-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-chunk-while-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-cross-join-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-delay-iterable.d.ts +13 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-entries-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-group-by-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-insert-after-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-insert-before-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-merge-iterable.d.ts +5 -6
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-pad-end-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-pad-start-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-partion-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-repeat-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-retry-iterable.d.ts +13 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-reverse-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-split-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-take-until-abort-iterable.d.ts +9 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-take-until-timeout-iterable.d.ts +13 -0
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-zip-iterable.d.ts +1 -1
- package/dist/types/collection/implementations/async-iterable-collection/async-iterable-collection.d.ts +10 -4
- package/dist/types/collection/implementations/iterable-collection/_shared/merge-iterable.d.ts +4 -5
- package/dist/types/collection/implementations/iterable-collection/iterable-collection.d.ts +4 -1
- package/dist/types/collection/implementations/list-collection/list-collection.d.ts +4 -1
- package/dist/types/event-bus/contracts/_shared.d.ts +2 -5
- package/dist/types/event-bus/contracts/event-bus-adapter.contract.d.ts +12 -6
- package/dist/types/event-bus/contracts/event-bus-factory.contract.d.ts +4 -5
- package/dist/types/event-bus/contracts/event-bus.contract.d.ts +58 -27
- package/dist/types/event-bus/contracts/event-bus.errors.d.ts +3 -3
- package/dist/types/event-bus/implementations/_module.d.ts +1 -1
- package/dist/types/event-bus/implementations/_shared/_module.d.ts +2 -0
- package/dist/types/event-bus/implementations/_shared/event-bus-adapter.test-suite.d.ts +68 -0
- package/dist/types/event-bus/implementations/_shared/event-bus.test-suite.d.ts +72 -0
- package/dist/types/event-bus/implementations/adapters/_module.d.ts +1 -1
- package/dist/types/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.d.ts +10 -5
- package/dist/types/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.d.ts +4 -1
- package/dist/types/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.d.ts +50 -0
- package/dist/types/event-bus/implementations/derivables/event-bus-factory.d.ts +7 -8
- package/dist/types/event-bus/implementations/derivables/event-bus.d.ts +20 -46
- package/dist/types/serde/contracts/_module.d.ts +2 -0
- package/dist/types/serde/contracts/serde.contract.d.ts +41 -0
- package/dist/types/{serializer/contracts/serializer.errors.d.ts → serde/contracts/serde.errors.d.ts} +4 -4
- package/dist/types/serde/implementations/_module.d.ts +5 -0
- package/dist/types/serde/implementations/_shared/test-utilities/_module.d.ts +1 -0
- package/dist/types/serde/implementations/_shared/test-utilities/serde.test-suite.d.ts +18 -0
- package/dist/types/serde/implementations/mongodb-serde/_module.d.ts +1 -0
- package/dist/types/serde/implementations/mongodb-serde/mongodb-serde.d.ts +13 -0
- package/dist/types/serde/implementations/redis-serde/_module.d.ts +1 -0
- package/dist/types/serde/implementations/redis-serde/redis-serde.d.ts +13 -0
- package/dist/types/serde/implementations/sql-serde/_module.d.ts +1 -0
- package/dist/types/serde/implementations/sql-serde/sql-serde.d.ts +13 -0
- package/dist/types/serde/implementations/super-json-serde/_module.d.ts +1 -0
- package/dist/types/serde/implementations/super-json-serde/super-json-serde.d.ts +25 -0
- package/dist/types/utilities/_module.d.ts +5 -4
- package/dist/types/utilities/contracts/_module.d.ts +2 -0
- package/dist/types/utilities/contracts/deinitizable.contract.d.ts +9 -0
- package/dist/types/utilities/contracts/initizable.contract.d.ts +9 -0
- package/dist/types/utilities/{global-errors.d.ts → errors.d.ts} +10 -1
- package/dist/types/{_shared/utilities.d.ts → utilities/functions.d.ts} +4 -4
- package/dist/types/utilities/kysely/_module.d.ts +1 -0
- package/dist/types/{_shared → utilities}/kysely/kysely-table-name-transformer-plugin.d.ts +1 -1
- package/dist/types/utilities/time-span/time-span.d.ts +11 -2
- package/dist/types/{_shared → utilities}/types.d.ts +3 -8
- package/package.json +3 -9
- package/dist/cjs/_shared/kysely/_module.js.map +0 -1
- package/dist/cjs/_shared/kysely/kysely-table-name-transformer-plugin.js.map +0 -1
- package/dist/cjs/_shared/redis/_module.js.map +0 -1
- package/dist/cjs/_shared/redis/clear-iterable.js +0 -25
- package/dist/cjs/_shared/redis/clear-iterable.js.map +0 -1
- package/dist/cjs/_shared/redis/escape-redis-chars.js +0 -41
- package/dist/cjs/_shared/redis/escape-redis-chars.js.map +0 -1
- package/dist/cjs/_shared/redis/is-redis-type-error.js +0 -9
- package/dist/cjs/_shared/redis/is-redis-type-error.js.map +0 -1
- package/dist/cjs/_shared/utilities.js.map +0 -1
- package/dist/cjs/cache/implementations/derivables/base-cache.js +0 -262
- package/dist/cjs/cache/implementations/derivables/base-cache.js.map +0 -1
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js +0 -31
- package/dist/cjs/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js.map +0 -1
- package/dist/cjs/event-bus/implementations/_shared/test-utilities/_module.js.map +0 -1
- package/dist/cjs/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js +0 -51
- package/dist/cjs/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js.map +0 -1
- package/dist/cjs/event-bus/implementations/adapters/redis-event-bus-adapter/_module.js.map +0 -1
- package/dist/cjs/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js +0 -45
- package/dist/cjs/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js.map +0 -1
- package/dist/cjs/event-bus/implementations/derivables/base-event-bus.js +0 -47
- package/dist/cjs/event-bus/implementations/derivables/base-event-bus.js.map +0 -1
- package/dist/cjs/event-bus/implementations/derivables/with-namespace-event-bus-adapter.js +0 -42
- package/dist/cjs/event-bus/implementations/derivables/with-namespace-event-bus-adapter.js.map +0 -1
- package/dist/cjs/serializer/contracts/_module.js.map +0 -1
- package/dist/cjs/serializer/contracts/serializer.contract.js.map +0 -1
- package/dist/cjs/serializer/contracts/serializer.errors.js.map +0 -1
- package/dist/cjs/serializer/implementations/_module.js +0 -22
- package/dist/cjs/serializer/implementations/_module.js.map +0 -1
- package/dist/cjs/serializer/implementations/_shared/test-utilities/_module.js.map +0 -1
- package/dist/cjs/serializer/implementations/_shared/test-utilities/serializer.test-suite.js.map +0 -1
- package/dist/cjs/serializer/implementations/mongodb-serializer/_module.js.map +0 -1
- package/dist/cjs/serializer/implementations/mongodb-serializer/mongodb-serializer.js +0 -36
- package/dist/cjs/serializer/implementations/mongodb-serializer/mongodb-serializer.js.map +0 -1
- package/dist/cjs/serializer/implementations/redis-serializer/_module.js.map +0 -1
- package/dist/cjs/serializer/implementations/redis-serializer/redis-serializer.js +0 -37
- package/dist/cjs/serializer/implementations/redis-serializer/redis-serializer.js.map +0 -1
- package/dist/cjs/serializer/implementations/sql-serializer/_module.js.map +0 -1
- package/dist/cjs/serializer/implementations/sql-serializer/sql-serializer.js +0 -37
- package/dist/cjs/serializer/implementations/sql-serializer/sql-serializer.js.map +0 -1
- package/dist/cjs/serializer/implementations/super-json-serializer/_module.js +0 -18
- package/dist/cjs/serializer/implementations/super-json-serializer/_module.js.map +0 -1
- package/dist/cjs/serializer/implementations/super-json-serializer/super-json-serializer.js.map +0 -1
- package/dist/cjs/utilities/async/_module.js +0 -29
- package/dist/cjs/utilities/async/_module.js.map +0 -1
- package/dist/cjs/utilities/async/_shared.js.map +0 -1
- package/dist/cjs/utilities/async/abortable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/abortable/abortable.js +0 -48
- package/dist/cjs/utilities/async/abortable/abortable.js.map +0 -1
- package/dist/cjs/utilities/async/abortable-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/abortable-iterable/abortable-iterable.js +0 -32
- package/dist/cjs/utilities/async/abortable-iterable/abortable-iterable.js.map +0 -1
- package/dist/cjs/utilities/async/delay/_module.js.map +0 -1
- package/dist/cjs/utilities/async/delay/delay.js +0 -24
- package/dist/cjs/utilities/async/delay/delay.js.map +0 -1
- package/dist/cjs/utilities/async/delay-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/delay-iterable/delay-iterable.js +0 -36
- package/dist/cjs/utilities/async/delay-iterable/delay-iterable.js.map +0 -1
- package/dist/cjs/utilities/async/lazy-promise/_module.js.map +0 -1
- package/dist/cjs/utilities/async/lazy-promise/lazy-promise.js +0 -22
- package/dist/cjs/utilities/async/lazy-promise/lazy-promise.js.map +0 -1
- package/dist/cjs/utilities/async/retry/_module.js.map +0 -1
- package/dist/cjs/utilities/async/retry/retry.js +0 -43
- package/dist/cjs/utilities/async/retry/retry.js.map +0 -1
- package/dist/cjs/utilities/async/retry-iterable/_module.js +0 -18
- package/dist/cjs/utilities/async/retry-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/retry-iterable/retry-iterable.js +0 -32
- package/dist/cjs/utilities/async/retry-iterable/retry-iterable.js.map +0 -1
- package/dist/cjs/utilities/async/timeout/_module.js.map +0 -1
- package/dist/cjs/utilities/async/timeout/timeout.js +0 -28
- package/dist/cjs/utilities/async/timeout/timeout.js.map +0 -1
- package/dist/cjs/utilities/async/timeout-iterable/_module.js +0 -18
- package/dist/cjs/utilities/async/timeout-iterable/_module.js.map +0 -1
- package/dist/cjs/utilities/async/timeout-iterable/timeout-iterable.js +0 -11
- package/dist/cjs/utilities/async/timeout-iterable/timeout-iterable.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/_shared.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/constant-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/backof-policies/constant-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/linear-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/backof-policies/linear-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/_module.js +0 -18
- package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
- package/dist/cjs/utilities/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
- package/dist/cjs/utilities/global-errors.js.map +0 -1
- package/dist/cjs/utilities/validation/_module.js +0 -22
- package/dist/cjs/utilities/validation/_module.js.map +0 -1
- package/dist/esm/_shared/kysely/_module.js +0 -2
- package/dist/esm/_shared/kysely/_module.js.map +0 -1
- package/dist/esm/_shared/kysely/kysely-table-name-transformer-plugin.js.map +0 -1
- package/dist/esm/_shared/redis/_module.js +0 -4
- package/dist/esm/_shared/redis/_module.js.map +0 -1
- package/dist/esm/_shared/redis/clear-iterable.js +0 -21
- package/dist/esm/_shared/redis/clear-iterable.js.map +0 -1
- package/dist/esm/_shared/redis/escape-redis-chars.js +0 -38
- package/dist/esm/_shared/redis/escape-redis-chars.js.map +0 -1
- package/dist/esm/_shared/redis/is-redis-type-error.js +0 -6
- package/dist/esm/_shared/redis/is-redis-type-error.js.map +0 -1
- package/dist/esm/_shared/utilities.js.map +0 -1
- package/dist/esm/cache/implementations/derivables/base-cache.js +0 -258
- package/dist/esm/cache/implementations/derivables/base-cache.js.map +0 -1
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js +0 -27
- package/dist/esm/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.js.map +0 -1
- package/dist/esm/event-bus/implementations/_shared/test-utilities/_module.js +0 -2
- package/dist/esm/event-bus/implementations/_shared/test-utilities/_module.js.map +0 -1
- package/dist/esm/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js +0 -48
- package/dist/esm/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.js.map +0 -1
- package/dist/esm/event-bus/implementations/adapters/redis-event-bus-adapter/_module.js.map +0 -1
- package/dist/esm/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js +0 -41
- package/dist/esm/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.js.map +0 -1
- package/dist/esm/event-bus/implementations/derivables/base-event-bus.js +0 -43
- package/dist/esm/event-bus/implementations/derivables/base-event-bus.js.map +0 -1
- package/dist/esm/event-bus/implementations/derivables/with-namespace-event-bus-adapter.js +0 -38
- package/dist/esm/event-bus/implementations/derivables/with-namespace-event-bus-adapter.js.map +0 -1
- package/dist/esm/serializer/contracts/_module.js +0 -3
- package/dist/esm/serializer/contracts/_module.js.map +0 -1
- package/dist/esm/serializer/contracts/serializer.contract.js +0 -1
- package/dist/esm/serializer/contracts/serializer.contract.js.map +0 -1
- package/dist/esm/serializer/contracts/serializer.errors.js.map +0 -1
- package/dist/esm/serializer/implementations/_module.js +0 -6
- package/dist/esm/serializer/implementations/_module.js.map +0 -1
- package/dist/esm/serializer/implementations/_shared/test-utilities/_module.js +0 -2
- package/dist/esm/serializer/implementations/_shared/test-utilities/_module.js.map +0 -1
- package/dist/esm/serializer/implementations/_shared/test-utilities/serializer.test-suite.js.map +0 -1
- package/dist/esm/serializer/implementations/mongodb-serializer/_module.js +0 -2
- package/dist/esm/serializer/implementations/mongodb-serializer/_module.js.map +0 -1
- package/dist/esm/serializer/implementations/mongodb-serializer/mongodb-serializer.js.map +0 -1
- package/dist/esm/serializer/implementations/redis-serializer/_module.js +0 -2
- package/dist/esm/serializer/implementations/redis-serializer/_module.js.map +0 -1
- package/dist/esm/serializer/implementations/redis-serializer/redis-serializer.js.map +0 -1
- package/dist/esm/serializer/implementations/sql-serializer/_module.js +0 -2
- package/dist/esm/serializer/implementations/sql-serializer/_module.js.map +0 -1
- package/dist/esm/serializer/implementations/sql-serializer/sql-serializer.js.map +0 -1
- package/dist/esm/serializer/implementations/super-json-serializer/_module.js +0 -2
- package/dist/esm/serializer/implementations/super-json-serializer/_module.js.map +0 -1
- package/dist/esm/serializer/implementations/super-json-serializer/super-json-serializer.js.map +0 -1
- package/dist/esm/utilities/async/_module.js +0 -11
- package/dist/esm/utilities/async/_module.js.map +0 -1
- package/dist/esm/utilities/async/_shared.js.map +0 -1
- package/dist/esm/utilities/async/abortable/_module.js +0 -2
- package/dist/esm/utilities/async/abortable/_module.js.map +0 -1
- package/dist/esm/utilities/async/abortable/abortable.js.map +0 -1
- package/dist/esm/utilities/async/abortable-iterable/_module.js +0 -2
- package/dist/esm/utilities/async/abortable-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async/abortable-iterable/abortable-iterable.js +0 -29
- package/dist/esm/utilities/async/abortable-iterable/abortable-iterable.js.map +0 -1
- package/dist/esm/utilities/async/delay/_module.js +0 -2
- package/dist/esm/utilities/async/delay/_module.js.map +0 -1
- package/dist/esm/utilities/async/delay/delay.js +0 -21
- package/dist/esm/utilities/async/delay/delay.js.map +0 -1
- package/dist/esm/utilities/async/delay-iterable/_module.js +0 -2
- package/dist/esm/utilities/async/delay-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async/delay-iterable/delay-iterable.js +0 -33
- package/dist/esm/utilities/async/delay-iterable/delay-iterable.js.map +0 -1
- package/dist/esm/utilities/async/lazy-promise/_module.js +0 -2
- package/dist/esm/utilities/async/lazy-promise/_module.js.map +0 -1
- package/dist/esm/utilities/async/lazy-promise/lazy-promise.js +0 -17
- package/dist/esm/utilities/async/lazy-promise/lazy-promise.js.map +0 -1
- package/dist/esm/utilities/async/retry/_module.js +0 -2
- package/dist/esm/utilities/async/retry/_module.js.map +0 -1
- package/dist/esm/utilities/async/retry/retry.js +0 -40
- package/dist/esm/utilities/async/retry/retry.js.map +0 -1
- package/dist/esm/utilities/async/retry-iterable/_module.js +0 -2
- package/dist/esm/utilities/async/retry-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async/retry-iterable/retry-iterable.js +0 -29
- package/dist/esm/utilities/async/retry-iterable/retry-iterable.js.map +0 -1
- package/dist/esm/utilities/async/timeout/_module.js +0 -2
- package/dist/esm/utilities/async/timeout/_module.js.map +0 -1
- package/dist/esm/utilities/async/timeout/timeout.js +0 -25
- package/dist/esm/utilities/async/timeout/timeout.js.map +0 -1
- package/dist/esm/utilities/async/timeout-iterable/_module.js +0 -2
- package/dist/esm/utilities/async/timeout-iterable/_module.js.map +0 -1
- package/dist/esm/utilities/async/timeout-iterable/timeout-iterable.js +0 -8
- package/dist/esm/utilities/async/timeout-iterable/timeout-iterable.js.map +0 -1
- package/dist/esm/utilities/backof-policies/_module.js +0 -5
- package/dist/esm/utilities/backof-policies/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/_shared.js.map +0 -1
- package/dist/esm/utilities/backof-policies/constant-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/backof-policies/constant-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/constant-backoff-policy/constant-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/backof-policies/exponential-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/backof-policies/exponential-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/exponential-backoff-policy/exponential-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/backof-policies/linear-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/backof-policies/linear-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/linear-backoff-policy/linear-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/_module.js +0 -2
- package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/_module.js.map +0 -1
- package/dist/esm/utilities/backof-policies/polynomial-backoff-policy/polynomial-backoff-policy.js.map +0 -1
- package/dist/esm/utilities/global-errors.js.map +0 -1
- package/dist/esm/utilities/validation/_module.js +0 -17
- package/dist/esm/utilities/validation/_module.js.map +0 -1
- package/dist/types/_shared/kysely/_module.d.ts +0 -1
- package/dist/types/_shared/redis/_module.d.ts +0 -3
- package/dist/types/_shared/redis/clear-iterable.d.ts +0 -13
- package/dist/types/_shared/redis/escape-redis-chars.d.ts +0 -7
- package/dist/types/_shared/redis/is-redis-type-error.d.ts +0 -7
- package/dist/types/cache/implementations/derivables/base-cache.d.ts +0 -57
- package/dist/types/collection/implementations/async-iterable-collection/_shared/async-error-handler-iterable.d.ts +0 -12
- package/dist/types/event-bus/implementations/_shared/test-utilities/_module.d.ts +0 -1
- package/dist/types/event-bus/implementations/_shared/test-utilities/event-bus-adapter.test-suite.d.ts +0 -36
- package/dist/types/event-bus/implementations/adapters/redis-event-bus-adapter/redis-event-bus-adapter.d.ts +0 -43
- package/dist/types/event-bus/implementations/derivables/base-event-bus.d.ts +0 -23
- package/dist/types/event-bus/implementations/derivables/with-namespace-event-bus-adapter.d.ts +0 -16
- package/dist/types/serializer/contracts/_module.d.ts +0 -2
- package/dist/types/serializer/contracts/serializer.contract.d.ts +0 -16
- package/dist/types/serializer/implementations/_module.d.ts +0 -5
- package/dist/types/serializer/implementations/_shared/test-utilities/_module.d.ts +0 -1
- package/dist/types/serializer/implementations/_shared/test-utilities/serializer.test-suite.d.ts +0 -18
- package/dist/types/serializer/implementations/mongodb-serializer/_module.d.ts +0 -1
- package/dist/types/serializer/implementations/mongodb-serializer/mongodb-serializer.d.ts +0 -13
- package/dist/types/serializer/implementations/redis-serializer/_module.d.ts +0 -1
- package/dist/types/serializer/implementations/redis-serializer/redis-serializer.d.ts +0 -13
- package/dist/types/serializer/implementations/sql-serializer/_module.d.ts +0 -1
- package/dist/types/serializer/implementations/sql-serializer/sql-serializer.d.ts +0 -13
- package/dist/types/serializer/implementations/super-json-serializer/_module.d.ts +0 -1
- package/dist/types/serializer/implementations/super-json-serializer/super-json-serializer.d.ts +0 -37
- package/dist/types/utilities/async/_module.d.ts +0 -10
- package/dist/types/utilities/async/abortable/_module.d.ts +0 -1
- package/dist/types/utilities/async/abortable/abortable.d.ts +0 -39
- package/dist/types/utilities/async/abortable-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async/abortable-iterable/abortable-iterable.d.ts +0 -36
- package/dist/types/utilities/async/delay/_module.d.ts +0 -1
- package/dist/types/utilities/async/delay/delay.d.ts +0 -38
- package/dist/types/utilities/async/delay-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async/delay-iterable/delay-iterable.d.ts +0 -57
- package/dist/types/utilities/async/lazy-promise/_module.d.ts +0 -1
- package/dist/types/utilities/async/lazy-promise/lazy-promise.d.ts +0 -28
- package/dist/types/utilities/async/retry/_module.d.ts +0 -1
- package/dist/types/utilities/async/retry/retry.d.ts +0 -89
- package/dist/types/utilities/async/retry-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async/retry-iterable/retry-iterable.d.ts +0 -86
- package/dist/types/utilities/async/timeout/_module.d.ts +0 -1
- package/dist/types/utilities/async/timeout/timeout.d.ts +0 -40
- package/dist/types/utilities/async/timeout-iterable/_module.d.ts +0 -1
- package/dist/types/utilities/async/timeout-iterable/timeout-iterable.d.ts +0 -64
- package/dist/types/utilities/backof-policies/_module.d.ts +0 -5
- package/dist/types/utilities/backof-policies/constant-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/backof-policies/exponential-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/backof-policies/linear-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/backof-policies/polynomial-backoff-policy/_module.d.ts +0 -1
- package/dist/types/utilities/validation/_module.d.ts +0 -32
- /package/dist/cjs/{utilities → async}/backof-policies/_shared.js +0 -0
- /package/dist/cjs/event-bus/implementations/adapters/{redis-event-bus-adapter → redis-pub-sub-event-bus-adapter}/_module.js +0 -0
- /package/dist/cjs/{_shared → utilities}/kysely/kysely-table-name-transformer-plugin.js +0 -0
- /package/dist/cjs/{_shared → utilities}/types.js +0 -0
- /package/dist/esm/{utilities → async}/backof-policies/_shared.js +0 -0
- /package/dist/esm/event-bus/implementations/adapters/{redis-event-bus-adapter → redis-pub-sub-event-bus-adapter}/_module.js +0 -0
- /package/dist/esm/{_shared → utilities}/kysely/kysely-table-name-transformer-plugin.js +0 -0
- /package/dist/esm/{_shared → utilities}/types.js +0 -0
- /package/dist/types/event-bus/implementations/adapters/{redis-event-bus-adapter → redis-pub-sub-event-bus-adapter}/_module.d.ts +0 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.eventBusTestSuite = eventBusTestSuite;
|
|
4
|
+
const _module_1 = require("../../../utilities/_module");
|
|
5
|
+
const _module_2 = require("../../../async/_module");
|
|
6
|
+
function eventBusTestSuite(settings) {
|
|
7
|
+
const { expect, test, describe, createEventBusA, createEventBusB, beforeEach, } = settings;
|
|
8
|
+
let eventBusA;
|
|
9
|
+
let eventBusB;
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
eventBusA = await createEventBusA();
|
|
12
|
+
eventBusB = await createEventBusB();
|
|
13
|
+
});
|
|
14
|
+
const TTL = _module_1.TimeSpan.fromMilliseconds(50);
|
|
15
|
+
describe("Api tests:", () => {
|
|
16
|
+
describe("method: addListener, removeListener, dispatch", () => {
|
|
17
|
+
test("Should be null when listener added and event is not triggered", async () => {
|
|
18
|
+
const TYPE = "type";
|
|
19
|
+
let result = null;
|
|
20
|
+
await eventBusA.addListener(TYPE, (event) => {
|
|
21
|
+
result = event;
|
|
22
|
+
});
|
|
23
|
+
expect(result).toBeNull();
|
|
24
|
+
});
|
|
25
|
+
test("Should be IBaseEvent when listener added and event is triggered", async () => {
|
|
26
|
+
const event = {
|
|
27
|
+
type: "type",
|
|
28
|
+
};
|
|
29
|
+
let result = null;
|
|
30
|
+
await eventBusA.addListener(event.type, (event) => {
|
|
31
|
+
result = event;
|
|
32
|
+
});
|
|
33
|
+
await eventBusA.dispatch(event);
|
|
34
|
+
await (0, _module_2.delay)(TTL);
|
|
35
|
+
expect(result).toEqual(event);
|
|
36
|
+
});
|
|
37
|
+
test("Should be null when listener removed and event is triggered", async () => {
|
|
38
|
+
const event = {
|
|
39
|
+
type: "type",
|
|
40
|
+
};
|
|
41
|
+
let result = null;
|
|
42
|
+
const listener = (event) => {
|
|
43
|
+
result = event;
|
|
44
|
+
};
|
|
45
|
+
await eventBusA.addListener(event.type, listener);
|
|
46
|
+
await eventBusA.removeListener(event.type, listener);
|
|
47
|
+
await eventBusA.dispatch(event);
|
|
48
|
+
await (0, _module_2.delay)(TTL);
|
|
49
|
+
expect(result).toBeNull();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe("method: addListenerMany, removeListenerMany, dispatch", () => {
|
|
53
|
+
test("Should be null when listener added and event is not triggered", async () => {
|
|
54
|
+
const TYPE_1 = "type_1";
|
|
55
|
+
const TYPE_2 = "type_2";
|
|
56
|
+
let result = null;
|
|
57
|
+
await eventBusA.addListenerMany([TYPE_1, TYPE_2], (event) => {
|
|
58
|
+
result = event;
|
|
59
|
+
});
|
|
60
|
+
expect(result).toBeNull();
|
|
61
|
+
});
|
|
62
|
+
test("Should be IBaseEvent when listener added and event is triggered", async () => {
|
|
63
|
+
const event_1 = {
|
|
64
|
+
type: "type_1",
|
|
65
|
+
};
|
|
66
|
+
const event_2 = {
|
|
67
|
+
type: "type_2",
|
|
68
|
+
};
|
|
69
|
+
let result_1 = null;
|
|
70
|
+
let result_2 = null;
|
|
71
|
+
await eventBusA.addListenerMany([event_1.type, event_2.type], (eventObj) => {
|
|
72
|
+
if (eventObj.type === event_1.type) {
|
|
73
|
+
result_1 = eventObj;
|
|
74
|
+
}
|
|
75
|
+
if (eventObj.type === event_2.type) {
|
|
76
|
+
result_2 = eventObj;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
await eventBusA.dispatchMany([event_1, event_2]);
|
|
80
|
+
await (0, _module_2.delay)(TTL);
|
|
81
|
+
expect(result_1).toEqual(event_1);
|
|
82
|
+
expect(result_2).toEqual(event_2);
|
|
83
|
+
});
|
|
84
|
+
test("Should be null when listener removed and event is triggered", async () => {
|
|
85
|
+
const event_A = {
|
|
86
|
+
type: "type_a",
|
|
87
|
+
};
|
|
88
|
+
const event_B = {
|
|
89
|
+
type: "type_b",
|
|
90
|
+
};
|
|
91
|
+
let result = null;
|
|
92
|
+
const listener = (event) => {
|
|
93
|
+
result = event;
|
|
94
|
+
};
|
|
95
|
+
await eventBusA.addListenerMany([event_A.type, event_B.type], listener);
|
|
96
|
+
await eventBusA.removeListenerMany([event_A.type, event_B.type], listener);
|
|
97
|
+
await eventBusA.dispatchMany([event_A, event_B]);
|
|
98
|
+
await (0, _module_2.delay)(TTL);
|
|
99
|
+
expect(result).toBeNull();
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
describe("method: subscribe", () => {
|
|
103
|
+
test("Should be null when listener added and event is not triggered", async () => {
|
|
104
|
+
const TYPE = "type";
|
|
105
|
+
let result = null;
|
|
106
|
+
await eventBusA.subscribe(TYPE, (event) => {
|
|
107
|
+
result = event;
|
|
108
|
+
});
|
|
109
|
+
expect(result).toBeNull();
|
|
110
|
+
});
|
|
111
|
+
test("Should be IBaseEvent when listener added and event is triggered", async () => {
|
|
112
|
+
const event = {
|
|
113
|
+
type: "type",
|
|
114
|
+
};
|
|
115
|
+
let result = null;
|
|
116
|
+
await eventBusA.subscribe(event.type, (event) => {
|
|
117
|
+
result = event;
|
|
118
|
+
});
|
|
119
|
+
await (0, _module_2.delay)(TTL);
|
|
120
|
+
await eventBusA.dispatch(event);
|
|
121
|
+
expect(result).toEqual(event);
|
|
122
|
+
});
|
|
123
|
+
test("Should be null when listener removed and event is triggered", async () => {
|
|
124
|
+
const event = {
|
|
125
|
+
type: "type",
|
|
126
|
+
};
|
|
127
|
+
let result = null;
|
|
128
|
+
const listener = (event) => {
|
|
129
|
+
result = event;
|
|
130
|
+
};
|
|
131
|
+
const unsubscribe = await eventBusA.subscribe(event.type, listener);
|
|
132
|
+
await unsubscribe();
|
|
133
|
+
await eventBusA.dispatch(event);
|
|
134
|
+
await (0, _module_2.delay)(TTL);
|
|
135
|
+
expect(result).toBeNull();
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
describe("method: subscribeMany", () => {
|
|
139
|
+
test("Should be null when listener added and event is not triggered", async () => {
|
|
140
|
+
const TYPE_1 = "type_1";
|
|
141
|
+
const TYPE_2 = "type_2";
|
|
142
|
+
let result = null;
|
|
143
|
+
await eventBusA.subscribeMany([TYPE_1, TYPE_2], (event) => {
|
|
144
|
+
result = event;
|
|
145
|
+
});
|
|
146
|
+
expect(result).toBeNull();
|
|
147
|
+
});
|
|
148
|
+
test("Should be IBaseEvent when listener added and event is triggered", async () => {
|
|
149
|
+
const event_1 = {
|
|
150
|
+
type: "type_1",
|
|
151
|
+
};
|
|
152
|
+
const event_2 = {
|
|
153
|
+
type: "type_2",
|
|
154
|
+
};
|
|
155
|
+
let result_1 = null;
|
|
156
|
+
let result_2 = null;
|
|
157
|
+
await eventBusA.subscribeMany([event_1.type, event_2.type], (eventObj) => {
|
|
158
|
+
if (eventObj.type === event_1.type) {
|
|
159
|
+
result_1 = eventObj;
|
|
160
|
+
}
|
|
161
|
+
if (eventObj.type === event_2.type) {
|
|
162
|
+
result_2 = eventObj;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
await (0, _module_2.delay)(TTL);
|
|
166
|
+
await eventBusA.dispatchMany([event_1, event_2]);
|
|
167
|
+
expect(result_1).toEqual(event_1);
|
|
168
|
+
expect(result_2).toEqual(event_2);
|
|
169
|
+
});
|
|
170
|
+
test("Should be null when listener removed and event is triggered", async () => {
|
|
171
|
+
const event_A = {
|
|
172
|
+
type: "type_a",
|
|
173
|
+
};
|
|
174
|
+
const event_B = {
|
|
175
|
+
type: "type_b",
|
|
176
|
+
};
|
|
177
|
+
let result = null;
|
|
178
|
+
const listener = (event) => {
|
|
179
|
+
result = event;
|
|
180
|
+
};
|
|
181
|
+
const unsubscribe = await eventBusA.subscribeMany([event_A.type, event_B.type], listener);
|
|
182
|
+
await unsubscribe();
|
|
183
|
+
await eventBusA.dispatchMany([event_A, event_B]);
|
|
184
|
+
await (0, _module_2.delay)(TTL);
|
|
185
|
+
expect(result).toBeNull();
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
describe("method: listenOnce", () => {
|
|
189
|
+
test("Should be null when listener added and event is not triggered", async () => {
|
|
190
|
+
const TYPE = "type";
|
|
191
|
+
let result = null;
|
|
192
|
+
await eventBusA.listenOnce(TYPE, (event) => {
|
|
193
|
+
result = event;
|
|
194
|
+
});
|
|
195
|
+
expect(result).toBeNull();
|
|
196
|
+
});
|
|
197
|
+
test("Should be IBaseEvent when listener added and event is triggered", async () => {
|
|
198
|
+
const event = {
|
|
199
|
+
type: "type",
|
|
200
|
+
};
|
|
201
|
+
let result = null;
|
|
202
|
+
await eventBusA.listenOnce(event.type, (event) => {
|
|
203
|
+
result = event;
|
|
204
|
+
});
|
|
205
|
+
await eventBusA.dispatch(event);
|
|
206
|
+
await (0, _module_2.delay)(TTL);
|
|
207
|
+
expect(result).toEqual(event);
|
|
208
|
+
});
|
|
209
|
+
test("Should only listen for event once", async () => {
|
|
210
|
+
const event = {
|
|
211
|
+
type: "type",
|
|
212
|
+
};
|
|
213
|
+
let i = 0;
|
|
214
|
+
await eventBusA.listenOnce(event.type, () => {
|
|
215
|
+
i++;
|
|
216
|
+
});
|
|
217
|
+
await eventBusA.dispatch(event);
|
|
218
|
+
await eventBusA.dispatch(event);
|
|
219
|
+
await (0, _module_2.delay)(TTL);
|
|
220
|
+
expect(i).toBe(1);
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
describe("Group tests:", () => {
|
|
225
|
+
test("method: addListener / dispatch", async () => {
|
|
226
|
+
const event = {
|
|
227
|
+
type: "type",
|
|
228
|
+
};
|
|
229
|
+
let result_a = null;
|
|
230
|
+
await eventBusA.addListener(event.type, (event) => {
|
|
231
|
+
result_a = event;
|
|
232
|
+
});
|
|
233
|
+
let result_b = null;
|
|
234
|
+
await eventBusB.addListener(event.type, (event) => {
|
|
235
|
+
result_b = event;
|
|
236
|
+
});
|
|
237
|
+
await eventBusA.dispatch(event);
|
|
238
|
+
expect(result_a).toEqual(event);
|
|
239
|
+
expect(result_b).toBeNull();
|
|
240
|
+
});
|
|
241
|
+
test("method: addListenerMany / dispatch", async () => {
|
|
242
|
+
const event = {
|
|
243
|
+
type: "type",
|
|
244
|
+
};
|
|
245
|
+
let result_a = null;
|
|
246
|
+
await eventBusA.addListenerMany([event.type], (event) => {
|
|
247
|
+
result_a = event;
|
|
248
|
+
});
|
|
249
|
+
let result_b = null;
|
|
250
|
+
await eventBusB.addListenerMany([event.type], (event) => {
|
|
251
|
+
result_b = event;
|
|
252
|
+
});
|
|
253
|
+
await eventBusA.dispatch(event);
|
|
254
|
+
expect(result_a).toEqual(event);
|
|
255
|
+
expect(result_b).toBeNull();
|
|
256
|
+
});
|
|
257
|
+
test("method: removeListener / addListener / dispatch", async () => {
|
|
258
|
+
const event = {
|
|
259
|
+
type: "type",
|
|
260
|
+
};
|
|
261
|
+
let result_a = null;
|
|
262
|
+
await eventBusA.addListener(event.type, (event) => {
|
|
263
|
+
result_a = event;
|
|
264
|
+
});
|
|
265
|
+
let result_b = null;
|
|
266
|
+
const listenerB = (event) => {
|
|
267
|
+
result_b = event;
|
|
268
|
+
};
|
|
269
|
+
await eventBusB.addListener(event.type, listenerB);
|
|
270
|
+
await eventBusB.removeListener(event.type, listenerB);
|
|
271
|
+
await eventBusA.dispatch(event);
|
|
272
|
+
await eventBusB.dispatch(event);
|
|
273
|
+
expect(result_a).toEqual(event);
|
|
274
|
+
expect(result_b).toBeNull();
|
|
275
|
+
});
|
|
276
|
+
test("method: removeListenerMany / addListener / dispatch", async () => {
|
|
277
|
+
const event = {
|
|
278
|
+
type: "type",
|
|
279
|
+
};
|
|
280
|
+
let result_a = null;
|
|
281
|
+
await eventBusA.addListener(event.type, (event) => {
|
|
282
|
+
result_a = event;
|
|
283
|
+
});
|
|
284
|
+
let result_b = null;
|
|
285
|
+
const listenerB = (event) => {
|
|
286
|
+
result_b = event;
|
|
287
|
+
};
|
|
288
|
+
await eventBusB.addListener(event.type, listenerB);
|
|
289
|
+
await eventBusB.removeListenerMany([event.type], listenerB);
|
|
290
|
+
await eventBusA.dispatch(event);
|
|
291
|
+
await eventBusB.dispatch(event);
|
|
292
|
+
expect(result_a).toEqual(event);
|
|
293
|
+
expect(result_b).toBeNull();
|
|
294
|
+
});
|
|
295
|
+
test("method: subscribe / dispatch", async () => {
|
|
296
|
+
const event = {
|
|
297
|
+
type: "type",
|
|
298
|
+
};
|
|
299
|
+
let result_a = null;
|
|
300
|
+
await eventBusA.subscribe(event.type, (event) => {
|
|
301
|
+
result_a = event;
|
|
302
|
+
});
|
|
303
|
+
let result_b = null;
|
|
304
|
+
const listenerB = (event) => {
|
|
305
|
+
result_b = event;
|
|
306
|
+
};
|
|
307
|
+
const unsubscribe = await eventBusB.subscribe(event.type, listenerB);
|
|
308
|
+
await unsubscribe();
|
|
309
|
+
await eventBusA.dispatch(event);
|
|
310
|
+
await eventBusB.dispatch(event);
|
|
311
|
+
expect(result_a).toEqual(event);
|
|
312
|
+
expect(result_b).toBeNull();
|
|
313
|
+
});
|
|
314
|
+
test("method: subscribeMany / dispatch", async () => {
|
|
315
|
+
const event = {
|
|
316
|
+
type: "type",
|
|
317
|
+
};
|
|
318
|
+
let result_a = null;
|
|
319
|
+
await eventBusA.subscribeMany([event.type], (event) => {
|
|
320
|
+
result_a = event;
|
|
321
|
+
});
|
|
322
|
+
let result_b = null;
|
|
323
|
+
const listenerB = (event) => {
|
|
324
|
+
result_b = event;
|
|
325
|
+
};
|
|
326
|
+
const unsubscribe = await eventBusB.subscribeMany([event.type], listenerB);
|
|
327
|
+
await unsubscribe();
|
|
328
|
+
await eventBusA.dispatch(event);
|
|
329
|
+
await eventBusB.dispatch(event);
|
|
330
|
+
expect(result_a).toEqual(event);
|
|
331
|
+
expect(result_b).toBeNull();
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=event-bus.test-suite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-bus.test-suite.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/_shared/event-bus.test-suite.ts"],"names":[],"mappings":";;AAiFA,8CA+XC;AApcD,iDAA+C;AAC/C,6CAAwC;AAoExC,SAAgB,iBAAiB,CAAC,QAAmC;IACjE,MAAM,EACF,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,eAAe,EACf,UAAU,GACb,GAAG,QAAQ,CAAC;IACb,IAAI,SAAoB,CAAC;IACzB,IAAI,SAAoB,CAAC;IACzB,UAAU,CAAC,KAAK,IAAI,EAAE;QAClB,SAAS,GAAG,MAAM,eAAe,EAAE,CAAC;QACpC,SAAS,GAAG,MAAM,eAAe,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,MAAM,GAAG,GAAG,kBAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;QACxB,QAAQ,CAAC,+CAA+C,EAAE,GAAG,EAAE;YAC3D,IAAI,CAAC,+DAA+D,EAAE,KAAK,IAAI,EAAE;gBAC7E,MAAM,IAAI,GAAG,MAAM,CAAC;gBACpB,IAAI,MAAM,GAAsB,IAAI,CAAC;gBACrC,MAAM,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,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,EAAE,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;YAChD,MAAM,KAAK,GAAe;gBACtB,IAAI,EAAE,MAAM;aACf,CAAC;YAEF,IAAI,QAAQ,GAAsB,IAAI,CAAC;YACvC,MAAM,SAAS,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClD,QAAQ,GAAG,KAAK,CAAC;YACrB,CAAC,CAAC,CAAC;YAEH,IAAI,QAAQ,GAAsB,IAAI,CAAC;YACvC,MAAM,SAAS,GAAG,CAAC,KAAiB,EAAE,EAAE;gBACpC,QAAQ,GAAG,KAAK,CAAC;YACrB,CAAC,CAAC;YACF,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,aAAa,CAC7C,CAAC,KAAK,CAAC,IAAI,CAAC,EACZ,SAAS,CACZ,CAAC;YACF,MAAM,WAAW,EAAE,CAAC;YAEpB,MAAM,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEhC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAChC,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;QAChC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -16,5 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("../../../event-bus/implementations/adapters/memory-event-bus-adapter/_module"), exports);
|
|
18
18
|
__exportStar(require("../../../event-bus/implementations/adapters/no-op-event-bus-adapter/_module"), exports);
|
|
19
|
-
__exportStar(require("../../../event-bus/implementations/adapters/redis-event-bus-adapter/_module"), exports);
|
|
19
|
+
__exportStar(require("../../../event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module"), exports);
|
|
20
20
|
//# sourceMappingURL=_module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/adapters/_module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wGAAsF;AACtF,uGAAqF;AACrF
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/adapters/_module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wGAAsF;AACtF,uGAAqF;AACrF,+GAA6F"}
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MemoryEventBusAdapter = void 0;
|
|
4
|
+
const _module_1 = require("../../../../utilities/_module");
|
|
4
5
|
const node_events_1 = require("node:events");
|
|
5
6
|
class MemoryEventBusAdapter {
|
|
6
7
|
eventEmiter;
|
|
7
|
-
|
|
8
|
+
group;
|
|
9
|
+
constructor(defaultGroup, eventEmiter = new node_events_1.EventEmitter()) {
|
|
8
10
|
this.eventEmiter = eventEmiter;
|
|
11
|
+
this.group = (0, _module_1.simplifyGroupName)(defaultGroup);
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
this.
|
|
13
|
+
getGroup() {
|
|
14
|
+
return this.group;
|
|
12
15
|
}
|
|
13
|
-
|
|
14
|
-
this.
|
|
16
|
+
withGroup(group) {
|
|
17
|
+
return new MemoryEventBusAdapter([this.group, (0, _module_1.simplifyGroupName)(group)], this.eventEmiter);
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
withPrefix(event) {
|
|
20
|
+
return (0, _module_1.simplifyGroupName)([this.group, event]);
|
|
21
|
+
}
|
|
22
|
+
async addListener(eventName, listener) {
|
|
23
|
+
this.eventEmiter.on(this.withPrefix(eventName), listener);
|
|
24
|
+
}
|
|
25
|
+
async removeListener(eventName, listener) {
|
|
26
|
+
this.eventEmiter.off(this.withPrefix(eventName), listener);
|
|
27
|
+
}
|
|
28
|
+
async dispatch(event) {
|
|
29
|
+
this.eventEmiter.emit(this.withPrefix(event.type), event);
|
|
20
30
|
}
|
|
21
31
|
}
|
|
22
32
|
exports.MemoryEventBusAdapter = MemoryEventBusAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../../src/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"memory-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../../src/event-bus/implementations/adapters/memory-event-bus-adapter/memory-event-bus-adapter.ts"],"names":[],"mappings":";;;AAIA,iDAAwE;AAMxE,6CAA2C;AAqB3C,MAAa,qBAAqB;IAKT;IAJJ,KAAK,CAAS;IAE/B,YACI,YAA+B,EACd,cAAc,IAAI,0BAAY,EAAE;QAAhC,gBAAW,GAAX,WAAW,CAAqB;QAEjD,IAAI,CAAC,KAAK,GAAG,IAAA,2BAAiB,EAAC,YAAY,CAAC,CAAC;IACjD,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,SAAS,CAAC,KAAwB;QAC9B,OAAO,IAAI,qBAAqB,CAC5B,CAAC,IAAI,CAAC,KAAK,EAAE,IAAA,2BAAiB,EAAC,KAAK,CAAC,CAAC,EACtC,IAAI,CAAC,WAAW,CACnB,CAAC;IACN,CAAC;IAEO,UAAU,CAAC,KAAa;QAC5B,OAAO,IAAA,2BAAiB,EAAC,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAClD,CAAC;IAGD,KAAK,CAAC,WAAW,CACb,SAAiB,EACjB,QAA8B;QAG9B,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;IAGD,KAAK,CAAC,cAAc,CAChB,SAAiB,EACjB,QAA8B;QAG9B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC/D,CAAC;IAGD,KAAK,CAAC,QAAQ,CAAC,KAAiB;QAC5B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;CACJ;AA/CD,sDA+CC"}
|
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NoOpEventBusAdapter = void 0;
|
|
4
4
|
class NoOpEventBusAdapter {
|
|
5
|
+
getGroup() {
|
|
6
|
+
return "";
|
|
7
|
+
}
|
|
8
|
+
withGroup(_group) {
|
|
9
|
+
return new NoOpEventBusAdapter();
|
|
10
|
+
}
|
|
5
11
|
addListener(_event, _listener) {
|
|
6
12
|
return Promise.resolve();
|
|
7
13
|
}
|
|
8
14
|
removeListener(_event, _listener) {
|
|
9
15
|
return Promise.resolve();
|
|
10
16
|
}
|
|
11
|
-
dispatch(
|
|
17
|
+
dispatch(_event) {
|
|
12
18
|
return Promise.resolve();
|
|
13
19
|
}
|
|
14
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-op-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../../src/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"no-op-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../../src/event-bus/implementations/adapters/no-op-event-bus-adapter/no-op-event-bus-adapter.ts"],"names":[],"mappings":";;;AAgBA,MAAa,mBAAmB;IAC5B,QAAQ;QACJ,OAAO,EAAE,CAAC;IACd,CAAC;IAED,SAAS,CAAC,MAAyB;QAC/B,OAAO,IAAI,mBAAmB,EAAE,CAAC;IACrC,CAAC;IACD,WAAW,CACP,MAAc,EACd,SAA+B;QAE/B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,cAAc,CACV,MAAc,EACd,SAA+B;QAE/B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,QAAQ,CAAC,MAAkB;QACvB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ;AAzBD,kDAyBC"}
|
package/dist/cjs/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_module.js","sourceRoot":"","sources":["../../../../../../src/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/_module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wGAAsF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisPubSubEventBusAdapter = void 0;
|
|
4
|
+
const _module_1 = require("../../../../serde/implementations/_module");
|
|
5
|
+
const node_events_1 = require("node:events");
|
|
6
|
+
const _module_2 = require("../../../../utilities/_module");
|
|
7
|
+
class RedisPubSubEventBusAdapter {
|
|
8
|
+
group;
|
|
9
|
+
serde;
|
|
10
|
+
redisSerde;
|
|
11
|
+
dispatcherClient;
|
|
12
|
+
listenerClient;
|
|
13
|
+
eventEmitter = new node_events_1.EventEmitter();
|
|
14
|
+
constructor({ dispatcherClient, listenerClient, serde, rootGroup, }) {
|
|
15
|
+
this.group = (0, _module_2.simplifyGroupName)(rootGroup);
|
|
16
|
+
this.dispatcherClient = dispatcherClient;
|
|
17
|
+
this.listenerClient = listenerClient;
|
|
18
|
+
this.serde = serde;
|
|
19
|
+
this.redisSerde = new _module_1.RedisSerde(serde);
|
|
20
|
+
}
|
|
21
|
+
getGroup() {
|
|
22
|
+
return this.group;
|
|
23
|
+
}
|
|
24
|
+
withGroup(group) {
|
|
25
|
+
return new RedisPubSubEventBusAdapter({
|
|
26
|
+
listenerClient: this.listenerClient,
|
|
27
|
+
dispatcherClient: this.dispatcherClient,
|
|
28
|
+
serde: this.serde,
|
|
29
|
+
rootGroup: [this.group, (0, _module_2.simplifyGroupName)(group)],
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
withPrefix(eventName) {
|
|
33
|
+
return (0, _module_2.simplifyGroupName)([this.group, eventName]);
|
|
34
|
+
}
|
|
35
|
+
redisListener = (channel, message) => {
|
|
36
|
+
this.eventEmitter.emit(channel, this.redisSerde.deserialize(message));
|
|
37
|
+
};
|
|
38
|
+
async addListener(eventName, listener) {
|
|
39
|
+
this.eventEmitter.on(this.withPrefix(eventName), listener);
|
|
40
|
+
await this.listenerClient.subscribe(this.withPrefix(eventName));
|
|
41
|
+
this.listenerClient.on("message", this.redisListener);
|
|
42
|
+
}
|
|
43
|
+
async removeListener(eventName, listener) {
|
|
44
|
+
this.eventEmitter.off(this.withPrefix(eventName), listener);
|
|
45
|
+
await this.listenerClient.unsubscribe(this.withPrefix(eventName));
|
|
46
|
+
}
|
|
47
|
+
async dispatch(event) {
|
|
48
|
+
await this.dispatcherClient.publish(this.withPrefix(event.type), this.redisSerde.serialize(event));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.RedisPubSubEventBusAdapter = RedisPubSubEventBusAdapter;
|
|
52
|
+
//# sourceMappingURL=redis-pub-sub-event-bus-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-pub-sub-event-bus-adapter.js","sourceRoot":"","sources":["../../../../../../src/event-bus/implementations/adapters/redis-pub-sub-event-bus-adapter/redis-pub-sub-event-bus-adapter.ts"],"names":[],"mappings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K,CAAC,WAAW,CACb,SAAiB,EACjB,QAA8B;QAG9B,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;QAE3D,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;QAGhE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,cAAc,CAChB,SAAiB,EACjB,QAA8B;QAG9B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;QAE5D,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAAiB;QAC5B,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAC3B,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CACnC,CAAC;IACN,CAAC;CACJ;AAvED,gEAuEC"}
|
|
@@ -2,27 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EventBusFactory = void 0;
|
|
4
4
|
const event_bus_1 = require("../../../event-bus/implementations/derivables/event-bus");
|
|
5
|
-
const
|
|
5
|
+
const _module_1 = require("../../../utilities/_module");
|
|
6
6
|
class EventBusFactory {
|
|
7
7
|
drivers;
|
|
8
8
|
defaultDriver;
|
|
9
|
-
|
|
9
|
+
lazyPromiseSettings;
|
|
10
10
|
constructor(settings) {
|
|
11
|
-
const { drivers, defaultDriver
|
|
11
|
+
const { drivers, defaultDriver } = settings;
|
|
12
12
|
this.drivers = drivers;
|
|
13
13
|
this.defaultDriver = defaultDriver;
|
|
14
|
-
this.rootNamespace = rootNamespace;
|
|
15
14
|
}
|
|
16
15
|
use(driverName = this.defaultDriver) {
|
|
17
16
|
if (driverName === undefined) {
|
|
18
|
-
throw new
|
|
17
|
+
throw new _module_1.DefaultDriverNotDefinedError(EventBusFactory.name);
|
|
19
18
|
}
|
|
20
19
|
const selectedAdapter = this.drivers[driverName];
|
|
21
20
|
if (selectedAdapter === undefined) {
|
|
22
|
-
throw new
|
|
21
|
+
throw new _module_1.UnregisteredDriverError(driverName);
|
|
23
22
|
}
|
|
24
23
|
return new event_bus_1.EventBus(selectedAdapter, {
|
|
25
|
-
|
|
24
|
+
lazyPromiseSettings: this.lazyPromiseSettings,
|
|
26
25
|
});
|
|
27
26
|
}
|
|
28
27
|
withType() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus-factory.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/derivables/event-bus-factory.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"event-bus-factory.js","sourceRoot":"","sources":["../../../../../src/event-bus/implementations/derivables/event-bus-factory.ts"],"names":[],"mappings":";;;AAWA,gFAA4E;AAC5E,iDAG6B;AAqC7B,MAAa,eAAe;IAKP,OAAO,CAA6B;IACpC,aAAa,CAAa;IAC1B,mBAAmB,CAAuB;IAE3D,YAAY,QAA4C;QACpD,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;IAED,GAAG,CACC,aAAoC,IAAI,CAAC,aAAa;QAEtD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,sCAA4B,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACjE,CAAC;QACD,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,IAAI,iCAAuB,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,IAAI,oBAAQ,CAAC,eAAe,EAAE;YACjC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAChD,CAAC,CAAC;IACP,CAAC;IAED,QAAQ;QAKJ,OAAO,IAAW,CAAC;IACvB,CAAC;CACJ;AArCD,0CAqCC"}
|