@cratis/chronicle 6.13.0 → 6.14.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/reducers/ReducerEventDispatcher.d.ts +14 -0
- package/dist/reducers/ReducerEventDispatcher.d.ts.map +1 -0
- package/dist/reducers/ReducerEventDispatcher.js +35 -0
- package/dist/reducers/ReducerEventDispatcher.js.map +1 -0
- package/dist/reducers/ReducerEventHandler.d.ts +7 -0
- package/dist/reducers/ReducerEventHandler.d.ts.map +1 -0
- package/dist/reducers/ReducerEventHandler.js +4 -0
- package/dist/reducers/ReducerEventHandler.js.map +1 -0
- package/dist/reducers/Reducers.d.ts +0 -1
- package/dist/reducers/Reducers.d.ts.map +1 -1
- package/dist/reducers/Reducers.js +11 -30
- package/dist/reducers/Reducers.js.map +1 -1
- package/dist/testing/ReadModelScenario.d.ts +33 -0
- package/dist/testing/ReadModelScenario.d.ts.map +1 -0
- package/dist/testing/ReadModelScenario.js +137 -0
- package/dist/testing/ReadModelScenario.js.map +1 -0
- package/dist/testing/ReadModelScenarioGiven.d.ts +11 -0
- package/dist/testing/ReadModelScenarioGiven.d.ts.map +1 -0
- package/dist/testing/ReadModelScenarioGiven.js +18 -0
- package/dist/testing/ReadModelScenarioGiven.js.map +1 -0
- package/dist/testing/ReadModelScenarioGivenBuilder.d.ts +10 -0
- package/dist/testing/ReadModelScenarioGivenBuilder.d.ts.map +1 -0
- package/dist/testing/ReadModelScenarioGivenBuilder.js +15 -0
- package/dist/testing/ReadModelScenarioGivenBuilder.js.map +1 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +6 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -1
- package/reducers/ReducerEventDispatcher.ts +47 -0
- package/reducers/ReducerEventHandler.ts +9 -0
- package/reducers/Reducers.ts +13 -42
- package/testing/ReadModelScenario.example.ts +29 -0
- package/testing/ReadModelScenario.spec.ts +191 -0
- package/testing/ReadModelScenario.ts +151 -0
- package/testing/ReadModelScenarioGiven.ts +16 -0
- package/testing/ReadModelScenarioGivenBuilder.ts +15 -0
- package/testing/index.ts +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"7.0.2","root":["../ChronicleClient.ts","../ChronicleOptions.ts","../EventStore.ts","../EventStoreName.ts","../EventStoreNamespaceName.ts","../IChronicleClient.ts","../IEventStore.ts","../Metrics.ts","../Tracing.ts","../index.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../artifacts/validateArtifactSchemas.ts","../auditing/Causation.ts","../auditing/CausationManager.ts","../auditing/CausationType.ts","../auditing/ICausationManager.ts","../auditing/index.ts","../compliance/ComplianceContracts.ts","../compliance/ComplianceMetadata.ts","../compliance/ComplianceMetadataResolver.ts","../compliance/ComplianceMetadataType.ts","../compliance/IPIIManager.ts","../compliance/PIIManager.ts","../compliance/PIINotSupportedOnEventSourceId.ts","../compliance/index.ts","../compliance/pii.ts","../compliance/subject.ts","../confidentiality/EncryptedNotSupportedOnEventSourceId.ts","../confidentiality/EncryptionScope.ts","../confidentiality/PIIAndEncryptedCombinedNotSupported.ts","../confidentiality/SecurityMetadata.ts","../confidentiality/SecurityMetadataResolver.ts","../confidentiality/SecurityMetadataType.ts","../confidentiality/encrypted.ts","../confidentiality/index.ts","../connection/ChronicleConnection.ts","../connection/ChronicleConnectionString.ts","../connection/ChronicleServerAddressResolver.ts","../connection/ChronicleServices.ts","../connection/ChronicleSrvResolutionError.ts","../connection/ChronicleSrvResolver.ts","../connection/CompatibilityPreflight.ts","../connection/ConnectionLifecycle.ts","../connection/DateTimeOffset.ts","../connection/Guid.ts","../connection/ILoadBalancerStrategy.ts","../connection/IncompatibleChronicleServer.ts","../connection/KernelKeepAlive.ts","../connection/LeastConnectionsLoadBalancerStrategy.ts","../connection/LoadBalancerMode.ts","../connection/LoadBalancerStrategyFactory.ts","../connection/RandomLoadBalancerStrategy.ts","../connection/RejectedChronicleCredentials.ts","../connection/RoundRobinLoadBalancerStrategy.ts","../connection/TokenProvider.ts","../connection/callResults.ts","../connection/clientVersion.ts","../connection/fetchOAuthAccessToken.ts","../connection/formatServerAddress.ts","../connection/index.ts","../correlation/CorrelationId.ts","../correlation/CorrelationIdManager.ts","../correlation/ICorrelationIdAccessor.ts","../correlation/ICorrelationIdSetter.ts","../correlation/index.ts","../eventSequences/AppendError.ts","../eventSequences/AppendOperationsBroadcaster.ts","../eventSequences/AppendOptions.ts","../eventSequences/AppendResult.ts","../eventSequences/AppendedEventWithResult.ts","../eventSequences/CompleteStreamError.ts","../eventSequences/CompleteStreamResult.ts","../eventSequences/ConcurrencyScope.ts","../eventSequences/ConcurrencyViolation.ts","../eventSequences/ConstraintViolation.ts","../eventSequences/EventForEventSourceId.ts","../eventSequences/EventLog.ts","../eventSequences/EventSequence.ts","../eventSequences/EventSequenceId.ts","../eventSequences/EventSequenceNumber.ts","../eventSequences/IEventLog.ts","../eventSequences/IEventSequence.ts","../eventSequences/ITransactionalEventSequence.ts","../eventSequences/TransactionalEventSequence.ts","../eventSequences/WaitForCompletionOptions.ts","../eventSequences/WaitForCompletionResult.ts","../eventSequences/index.ts","../eventStoreSubscriptions/EventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/EventStoreSubscriptionDefinition.ts","../eventStoreSubscriptions/EventStoreSubscriptionId.ts","../eventStoreSubscriptions/EventStoreSubscriptions.ts","../eventStoreSubscriptions/IEventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/IEventStoreSubscriptions.ts","../eventStoreSubscriptions/contracts.ts","../eventStoreSubscriptions/index.ts","../events/AppendedEvent.ts","../events/CausationEntry.ts","../events/EventContext.ts","../events/EventType.ts","../events/EventTypeGeneration.ts","../events/EventTypeId.ts","../events/EventTypes.ts","../events/IEventTypes.ts","../events/Tag.ts","../events/WireEventContext.ts","../events/eventTypeDecorator.ts","../events/filterEventsByTagDecorator.ts","../events/index.ts","../events/isRegisteredEvent.ts","../events/mergeTags.ts","../events/tagDecorator.ts","../events/toClientEventContext.ts","../events/constraints/ConstraintBuilder.ts","../events/constraints/ConstraintId.ts","../events/constraints/Constraints.ts","../events/constraints/IConstraint.ts","../events/constraints/IConstraintBuilder.ts","../events/constraints/IConstraints.ts","../events/constraints/IUniqueConstraintBuilder.ts","../events/constraints/UniqueConstraintBuilder.ts","../events/constraints/constraint.ts","../events/constraints/index.ts","../events/constraints/removeConstraint.ts","../events/constraints/unique.ts","../events/migrations/EventMigrationBuilder.ts","../events/migrations/EventMigrationPropertyBuilder.ts","../events/migrations/EventTypeMigrators.ts","../events/migrations/IEventMigrationBuilder.ts","../events/migrations/IEventMigrationPropertyBuilder.ts","../events/migrations/IEventTypeMigration.ts","../events/migrations/IEventTypeMigrators.ts","../events/migrations/InvalidMigrationGenerationGap.ts","../events/migrations/eventTypeMigration.ts","../events/migrations/index.ts","../externalServices/ExternalServiceBuilder.ts","../externalServices/ExternalServices.ts","../externalServices/IExternalServiceBuilder.ts","../externalServices/IExternalServices.ts","../externalServices/index.ts","../identities/IIdentityManager.ts","../identities/IdentityManager.ts","../identities/index.ts","../identity/IIdentityProvider.ts","../identity/Identity.ts","../identity/IdentityProvider.ts","../identity/index.ts","../jobs/IJobs.ts","../jobs/JobId.ts","../jobs/Jobs.ts","../jobs/index.ts","../observation/FailedPartition.ts","../observation/FailedPartitionAttempt.ts","../observation/FailedPartitions.ts","../observation/ICanBeNotifiedWhenPartitionReplayed.ts","../observation/ICanBeNotifiedWhenReplay.ts","../observation/IFailedPartitions.ts","../observation/IObservers.ts","../observation/ObserverId.ts","../observation/ObserverInformation.ts","../observation/ObserverRemovalOutcome.ts","../observation/ObserverRemovalResult.ts","../observation/ObserverRunningState.ts","../observation/ObserverType.ts","../observation/Observers.ts","../observation/index.ts","../observation/notifyReplayLifecycle.ts","../observation/toClientFailedPartition.ts","../observation/toObserverInformation.ts","../observation/toObserverRemovalResult.ts","../observation/toObserverRunningState.ts","../projections/GlobalHandlerPropertyNotOnVariant.ts","../projections/IProjections.ts","../projections/ProjectionId.ts","../projections/ProjectionQueryResult.ts","../projections/ProjectionState.ts","../projections/Projections.ts","../projections/UnableToQueryProjection.ts","../projections/VariantMustDeclareEntersOnEvent.ts","../projections/VariantReclassifier.ts","../projections/constantValueExpression.ts","../projections/index.ts","../projections/notSetPropertyPath.ts","../projections/declarative/AddBuilder.ts","../projections/declarative/AddChildBuilder.ts","../projections/declarative/AllSetBuilder.ts","../projections/declarative/ChildrenBuilder.ts","../projections/declarative/CompositeKeyBuilder.ts","../projections/declarative/FromBuilder.ts","../projections/declarative/FromEveryBuilder.ts","../projections/declarative/IAddBuilder.ts","../projections/declarative/IAddChildBuilder.ts","../projections/declarative/IAllSetBuilder.ts","../projections/declarative/IChildrenBuilder.ts","../projections/declarative/ICompositeKeyBuilder.ts","../projections/declarative/IFromBuilder.ts","../projections/declarative/IFromEveryBuilder.ts","../projections/declarative/IJoinBuilder.ts","../projections/declarative/INestedBuilder.ts","../projections/declarative/IProjectionBuilder.ts","../projections/declarative/IProjectionBuilderFor.ts","../projections/declarative/IProjectionFor.ts","../projections/declarative/IReadModelPropertiesBuilder.ts","../projections/declarative/IRemovedWithBuilder.ts","../projections/declarative/IRemovedWithJoinBuilder.ts","../projections/declarative/ISetBuilder.ts","../projections/declarative/ISubtractBuilder.ts","../projections/declarative/JoinBuilder.ts","../projections/declarative/NestedBuilder.ts","../projections/declarative/ProjectionBuilderCore.ts","../projections/declarative/ProjectionBuilderFor.ts","../projections/declarative/RemovedWithBuilder.ts","../projections/declarative/RemovedWithJoinBuilder.ts","../projections/declarative/SetBuilder.ts","../projections/declarative/SubtractBuilder.ts","../projections/declarative/index.ts","../projections/declarative/projection.ts","../projections/modelBound/FromEventMetadata.ts","../projections/modelBound/FromEventOptions.ts","../projections/modelBound/addFrom.ts","../projections/modelBound/childrenAndNestedBuilder.ts","../projections/modelBound/childrenFrom.ts","../projections/modelBound/clearWith.ts","../projections/modelBound/count.ts","../projections/modelBound/decrement.ts","../projections/modelBound/entersOn.ts","../projections/modelBound/eventSequence.ts","../projections/modelBound/fromAll.ts","../projections/modelBound/fromEvent.ts","../projections/modelBound/fromEvery.ts","../projections/modelBound/globalFor.ts","../projections/modelBound/increment.ts","../projections/modelBound/index.ts","../projections/modelBound/join.ts","../projections/modelBound/nested.ts","../projections/modelBound/noAutoMap.ts","../projections/modelBound/notRewindable.ts","../projections/modelBound/passive.ts","../projections/modelBound/removedWith.ts","../projections/modelBound/removedWithJoin.ts","../projections/modelBound/setFrom.ts","../projections/modelBound/setFromContext.ts","../projections/modelBound/setValue.ts","../projections/modelBound/subtractFrom.ts","../projections/modelBound/variantOf.ts","../reactors/IReactors.ts","../reactors/ReactorId.ts","../reactors/ReactorResultHandler.ts","../reactors/ReactorSideEffects.ts","../reactors/Reactors.ts","../reactors/index.ts","../reactors/onceOnly.ts","../reactors/reactor.ts","../reactors/replay.ts","../readModels/IMaterializedReadModels.ts","../readModels/IReadModels.ts","../readModels/MaterializedReadModels.ts","../readModels/ReadModelChangeset.ts","../readModels/ReadModelId.ts","../readModels/ReadModelSnapshot.ts","../readModels/ReadModelSubjectResolver.ts","../readModels/ReadModels.ts","../readModels/assertUniqueReadModelIds.ts","../readModels/buildReadModelDefinition.ts","../readModels/deserializeReadModel.ts","../readModels/index.ts","../readModels/indexDecorator.ts","../readModels/readModel.ts","../readModels/rootReadModelTypes.ts","../reducers/IReducers.ts","../reducers/ReducerId.ts","../reducers/Reducers.ts","../reducers/index.ts","../reducers/reducer.ts","../schemas/JsonSchema.ts","../schemas/JsonSchemaGenerator.ts","../schemas/createDeferredSchema.ts","../schemas/index.ts","../schemas/jsonSchemaProperty.ts","../seeding/EventSeeding.ts","../seeding/ICanSeedEvents.ts","../seeding/IEventSeeding.ts","../seeding/IEventSeedingBuilder.ts","../seeding/IEventSeedingScopeBuilder.ts","../seeding/index.ts","../seeding/seeder.ts","../sinks/WellKnownSinks.ts","../sinks/index.ts","../transactions/IUnitOfWork.ts","../transactions/IUnitOfWorkManager.ts","../transactions/NoUnitOfWorkHasBeenStarted.ts","../transactions/UnitOfWork.ts","../transactions/UnitOfWorkManager.ts","../transactions/index.ts","../types/DecoratorType.ts","../types/TypeDiscoverer.ts","../types/TypeIntrospector.ts","../types/conceptValueType.ts","../types/index.ts","../types/modelBoundProperty.ts","../types/propertyDecoratorMetadata.ts","../types/standardDecoratorMetadata.ts","../webhooks/IWebhook.ts","../webhooks/IWebhookDefinitionBuilder.ts","../webhooks/IWebhooks.ts","../webhooks/WebhookDefinitionBuilder.ts","../webhooks/WebhookId.ts","../webhooks/WebhookTargetUrl.ts","../webhooks/Webhooks.ts","../webhooks/index.ts","../webhooks/webhook.ts"],"packageJsons":["../package.json","../../node_modules/@bufbuild/protobuf/dist/esm/package.json","../../node_modules/@bufbuild/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/package.json","../../node_modules/@cratis/fundamentals/dist/esm/package.json","../../node_modules/@cratis/fundamentals/package.json","../../node_modules/@grpc/grpc-js/package.json","../../node_modules/@grpc/proto-loader/package.json","../../node_modules/@js-sdsl/ordered-map/package.json","../../node_modules/@opentelemetry/api/package.json","../../node_modules/@types/node/package.json","../../node_modules/glob/dist/esm/package.json","../../node_modules/glob/package.json","../../node_modules/long/package.json","../../node_modules/long/umd/package.json","../../node_modules/lru-cache/dist/esm/package.json","../../node_modules/lru-cache/package.json","../../node_modules/minimatch/dist/esm/package.json","../../node_modules/minimatch/package.json","../../node_modules/minipass/dist/esm/package.json","../../node_modules/minipass/package.json","../../node_modules/nice-grpc-common/package.json","../../node_modules/nice-grpc/package.json","../../node_modules/path-scurry/dist/esm/package.json","../../node_modules/path-scurry/package.json","../../node_modules/protobufjs/package.json","../../node_modules/reflect-metadata/package.json","../../node_modules/ts-error/package.json","../../node_modules/undici-types/package.json","../../node_modules/undici/package.json"],"missingPackageJsons":["../../node_modules/@bufbuild/protobuf/dist/esm/codegenv1/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/codegenv2/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/reflect/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wire/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/package.json","../../node_modules/@bufbuild/protobuf/wire/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/google/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/google/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/protobuf-net/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/package.json","../../node_modules/@cratis/chronicle.contracts/dist/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/reflect/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wire/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/wire/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/nice-grpc-common/package.json","../../node_modules/@cratis/fundamentals/dist/esm/geospatial/package.json","../../node_modules/@cratis/fundamentals/dist/esm/json/package.json","../../node_modules/@grpc/grpc-js/build/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/google/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/google/protobuf/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/orca/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/orca/v3/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/orca/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/orca/v3/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/package.json","../../node_modules/@grpc/grpc-js/build/src/package.json","../../node_modules/@grpc/proto-loader/build/package.json","../../node_modules/@grpc/proto-loader/build/src/package.json","../../node_modules/@js-sdsl/ordered-map/dist/esm/package.json","../../node_modules/@js-sdsl/ordered-map/dist/package.json","../../node_modules/@opentelemetry/api/build/package.json","../../node_modules/@opentelemetry/api/build/src/api/package.json","../../node_modules/@opentelemetry/api/build/src/baggage/internal/package.json","../../node_modules/@opentelemetry/api/build/src/baggage/package.json","../../node_modules/@opentelemetry/api/build/src/common/package.json","../../node_modules/@opentelemetry/api/build/src/context/package.json","../../node_modules/@opentelemetry/api/build/src/diag/package.json","../../node_modules/@opentelemetry/api/build/src/metrics/package.json","../../node_modules/@opentelemetry/api/build/src/package.json","../../node_modules/@opentelemetry/api/build/src/propagation/package.json","../../node_modules/@opentelemetry/api/build/src/trace/internal/package.json","../../node_modules/@opentelemetry/api/build/src/trace/package.json","../../node_modules/@types/assert/package.json","../../node_modules/@types/assert/strict/package.json","../../node_modules/@types/async_hooks/package.json","../../node_modules/@types/buffer/package.json","../../node_modules/@types/child_process/package.json","../../node_modules/@types/cluster/package.json","../../node_modules/@types/console/package.json","../../node_modules/@types/constants/package.json","../../node_modules/@types/crypto/package.json","../../node_modules/@types/dgram/package.json","../../node_modules/@types/diagnostics_channel/package.json","../../node_modules/@types/dns/package.json","../../node_modules/@types/dns/promises/package.json","../../node_modules/@types/domain/package.json","../../node_modules/@types/events/package.json","../../node_modules/@types/fs/package.json","../../node_modules/@types/fs/promises/package.json","../../node_modules/@types/http/package.json","../../node_modules/@types/http2/package.json","../../node_modules/@types/https/package.json","../../node_modules/@types/inspector/package.json","../../node_modules/@types/inspector/promises/package.json","../../node_modules/@types/module/package.json","../../node_modules/@types/net/package.json","../../node_modules/@types/node/assert/package.json","../../node_modules/@types/node/dns/package.json","../../node_modules/@types/node/fs/package.json","../../node_modules/@types/node/inspector/package.json","../../node_modules/@types/node/path/package.json","../../node_modules/@types/node/readline/package.json","../../node_modules/@types/node/stream/package.json","../../node_modules/@types/node/test/package.json","../../node_modules/@types/node/timers/package.json","../../node_modules/@types/node/util/package.json","../../node_modules/@types/node/web-globals/package.json","../../node_modules/@types/node/zlib/package.json","../../node_modules/@types/os/package.json","../../node_modules/@types/path/package.json","../../node_modules/@types/path/posix/package.json","../../node_modules/@types/path/win32/package.json","../../node_modules/@types/perf_hooks/package.json","../../node_modules/@types/process/package.json","../../node_modules/@types/punycode/package.json","../../node_modules/@types/querystring/package.json","../../node_modules/@types/readline/package.json","../../node_modules/@types/readline/promises/package.json","../../node_modules/@types/repl/package.json","../../node_modules/@types/stream/consumers/package.json","../../node_modules/@types/stream/iter/package.json","../../node_modules/@types/stream/package.json","../../node_modules/@types/stream/promises/package.json","../../node_modules/@types/stream/web/package.json","../../node_modules/@types/string_decoder/package.json","../../node_modules/@types/timers/package.json","../../node_modules/@types/timers/promises/package.json","../../node_modules/@types/tls/package.json","../../node_modules/@types/trace_events/package.json","../../node_modules/@types/tty/package.json","../../node_modules/@types/url/package.json","../../node_modules/@types/util/package.json","../../node_modules/@types/util/types/package.json","../../node_modules/@types/v8/package.json","../../node_modules/@types/vm/package.json","../../node_modules/@types/wasi/package.json","../../node_modules/@types/worker_threads/package.json","../../node_modules/@types/zlib/package.json","../../node_modules/assert/package.json","../../node_modules/assert/strict/package.json","../../node_modules/async_hooks/package.json","../../node_modules/buffer/package.json","../../node_modules/child_process/package.json","../../node_modules/cluster/package.json","../../node_modules/console/package.json","../../node_modules/constants/package.json","../../node_modules/crypto/package.json","../../node_modules/dgram/package.json","../../node_modules/diagnostics_channel/package.json","../../node_modules/dns/package.json","../../node_modules/dns/promises/package.json","../../node_modules/domain/package.json","../../node_modules/events/package.json","../../node_modules/fs/package.json","../../node_modules/fs/promises/package.json","../../node_modules/http/package.json","../../node_modules/http2/package.json","../../node_modules/https/package.json","../../node_modules/inspector/package.json","../../node_modules/inspector/promises/package.json","../../node_modules/module/package.json","../../node_modules/net/package.json","../../node_modules/nice-grpc-common/lib/client/package.json","../../node_modules/nice-grpc-common/lib/package.json","../../node_modules/nice-grpc-common/lib/server/package.json","../../node_modules/nice-grpc/lib/client/package.json","../../node_modules/nice-grpc/lib/package.json","../../node_modules/nice-grpc/lib/server/package.json","../../node_modules/nice-grpc/lib/service-definitions/package.json","../../node_modules/nice-grpc/lib/utils/package.json","../../node_modules/os/package.json","../../node_modules/path/package.json","../../node_modules/path/posix/package.json","../../node_modules/path/win32/package.json","../../node_modules/perf_hooks/package.json","../../node_modules/process/package.json","../../node_modules/protobufjs/ext/descriptor/package.json","../../node_modules/protobufjs/ext/package.json","../../node_modules/protobufjs/node_modules/@types/long/package.json","../../node_modules/protobufjs/node_modules/long/package.json","../../node_modules/punycode/package.json","../../node_modules/querystring/package.json","../../node_modules/readline/package.json","../../node_modules/readline/promises/package.json","../../node_modules/repl/package.json","../../node_modules/stream/consumers/package.json","../../node_modules/stream/iter/package.json","../../node_modules/stream/package.json","../../node_modules/stream/promises/package.json","../../node_modules/stream/web/package.json","../../node_modules/string_decoder/package.json","../../node_modules/timers/package.json","../../node_modules/timers/promises/package.json","../../node_modules/tls/package.json","../../node_modules/trace_events/package.json","../../node_modules/ts-error/lib/package.json","../../node_modules/tty/package.json","../../node_modules/undici/types/package.json","../../node_modules/url/package.json","../../node_modules/util/package.json","../../node_modules/util/types/package.json","../../node_modules/v8/package.json","../../node_modules/vm/package.json","../../node_modules/wasi/package.json","../../node_modules/worker_threads/package.json","../../node_modules/zlib/package.json"]}
|
|
1
|
+
{"version":"7.0.2","root":["../ChronicleClient.ts","../ChronicleOptions.ts","../EventStore.ts","../EventStoreName.ts","../EventStoreNamespaceName.ts","../IChronicleClient.ts","../IEventStore.ts","../Metrics.ts","../Tracing.ts","../index.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../artifacts/validateArtifactSchemas.ts","../auditing/Causation.ts","../auditing/CausationManager.ts","../auditing/CausationType.ts","../auditing/ICausationManager.ts","../auditing/index.ts","../compliance/ComplianceContracts.ts","../compliance/ComplianceMetadata.ts","../compliance/ComplianceMetadataResolver.ts","../compliance/ComplianceMetadataType.ts","../compliance/IPIIManager.ts","../compliance/PIIManager.ts","../compliance/PIINotSupportedOnEventSourceId.ts","../compliance/index.ts","../compliance/pii.ts","../compliance/subject.ts","../confidentiality/EncryptedNotSupportedOnEventSourceId.ts","../confidentiality/EncryptionScope.ts","../confidentiality/PIIAndEncryptedCombinedNotSupported.ts","../confidentiality/SecurityMetadata.ts","../confidentiality/SecurityMetadataResolver.ts","../confidentiality/SecurityMetadataType.ts","../confidentiality/encrypted.ts","../confidentiality/index.ts","../connection/ChronicleConnection.ts","../connection/ChronicleConnectionString.ts","../connection/ChronicleServerAddressResolver.ts","../connection/ChronicleServices.ts","../connection/ChronicleSrvResolutionError.ts","../connection/ChronicleSrvResolver.ts","../connection/CompatibilityPreflight.ts","../connection/ConnectionLifecycle.ts","../connection/DateTimeOffset.ts","../connection/Guid.ts","../connection/ILoadBalancerStrategy.ts","../connection/IncompatibleChronicleServer.ts","../connection/KernelKeepAlive.ts","../connection/LeastConnectionsLoadBalancerStrategy.ts","../connection/LoadBalancerMode.ts","../connection/LoadBalancerStrategyFactory.ts","../connection/RandomLoadBalancerStrategy.ts","../connection/RejectedChronicleCredentials.ts","../connection/RoundRobinLoadBalancerStrategy.ts","../connection/TokenProvider.ts","../connection/callResults.ts","../connection/clientVersion.ts","../connection/fetchOAuthAccessToken.ts","../connection/formatServerAddress.ts","../connection/index.ts","../correlation/CorrelationId.ts","../correlation/CorrelationIdManager.ts","../correlation/ICorrelationIdAccessor.ts","../correlation/ICorrelationIdSetter.ts","../correlation/index.ts","../eventSequences/AppendError.ts","../eventSequences/AppendOperationsBroadcaster.ts","../eventSequences/AppendOptions.ts","../eventSequences/AppendResult.ts","../eventSequences/AppendedEventWithResult.ts","../eventSequences/CompleteStreamError.ts","../eventSequences/CompleteStreamResult.ts","../eventSequences/ConcurrencyScope.ts","../eventSequences/ConcurrencyViolation.ts","../eventSequences/ConstraintViolation.ts","../eventSequences/EventForEventSourceId.ts","../eventSequences/EventLog.ts","../eventSequences/EventSequence.ts","../eventSequences/EventSequenceId.ts","../eventSequences/EventSequenceNumber.ts","../eventSequences/IEventLog.ts","../eventSequences/IEventSequence.ts","../eventSequences/ITransactionalEventSequence.ts","../eventSequences/TransactionalEventSequence.ts","../eventSequences/WaitForCompletionOptions.ts","../eventSequences/WaitForCompletionResult.ts","../eventSequences/index.ts","../eventStoreSubscriptions/EventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/EventStoreSubscriptionDefinition.ts","../eventStoreSubscriptions/EventStoreSubscriptionId.ts","../eventStoreSubscriptions/EventStoreSubscriptions.ts","../eventStoreSubscriptions/IEventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/IEventStoreSubscriptions.ts","../eventStoreSubscriptions/contracts.ts","../eventStoreSubscriptions/index.ts","../events/AppendedEvent.ts","../events/CausationEntry.ts","../events/EventContext.ts","../events/EventType.ts","../events/EventTypeGeneration.ts","../events/EventTypeId.ts","../events/EventTypes.ts","../events/IEventTypes.ts","../events/Tag.ts","../events/WireEventContext.ts","../events/eventTypeDecorator.ts","../events/filterEventsByTagDecorator.ts","../events/index.ts","../events/isRegisteredEvent.ts","../events/mergeTags.ts","../events/tagDecorator.ts","../events/toClientEventContext.ts","../events/constraints/ConstraintBuilder.ts","../events/constraints/ConstraintId.ts","../events/constraints/Constraints.ts","../events/constraints/IConstraint.ts","../events/constraints/IConstraintBuilder.ts","../events/constraints/IConstraints.ts","../events/constraints/IUniqueConstraintBuilder.ts","../events/constraints/UniqueConstraintBuilder.ts","../events/constraints/constraint.ts","../events/constraints/index.ts","../events/constraints/removeConstraint.ts","../events/constraints/unique.ts","../events/migrations/EventMigrationBuilder.ts","../events/migrations/EventMigrationPropertyBuilder.ts","../events/migrations/EventTypeMigrators.ts","../events/migrations/IEventMigrationBuilder.ts","../events/migrations/IEventMigrationPropertyBuilder.ts","../events/migrations/IEventTypeMigration.ts","../events/migrations/IEventTypeMigrators.ts","../events/migrations/InvalidMigrationGenerationGap.ts","../events/migrations/eventTypeMigration.ts","../events/migrations/index.ts","../externalServices/ExternalServiceBuilder.ts","../externalServices/ExternalServices.ts","../externalServices/IExternalServiceBuilder.ts","../externalServices/IExternalServices.ts","../externalServices/index.ts","../identities/IIdentityManager.ts","../identities/IdentityManager.ts","../identities/index.ts","../identity/IIdentityProvider.ts","../identity/Identity.ts","../identity/IdentityProvider.ts","../identity/index.ts","../jobs/IJobs.ts","../jobs/JobId.ts","../jobs/Jobs.ts","../jobs/index.ts","../observation/FailedPartition.ts","../observation/FailedPartitionAttempt.ts","../observation/FailedPartitions.ts","../observation/ICanBeNotifiedWhenPartitionReplayed.ts","../observation/ICanBeNotifiedWhenReplay.ts","../observation/IFailedPartitions.ts","../observation/IObservers.ts","../observation/ObserverId.ts","../observation/ObserverInformation.ts","../observation/ObserverRemovalOutcome.ts","../observation/ObserverRemovalResult.ts","../observation/ObserverRunningState.ts","../observation/ObserverType.ts","../observation/Observers.ts","../observation/index.ts","../observation/notifyReplayLifecycle.ts","../observation/toClientFailedPartition.ts","../observation/toObserverInformation.ts","../observation/toObserverRemovalResult.ts","../observation/toObserverRunningState.ts","../projections/GlobalHandlerPropertyNotOnVariant.ts","../projections/IProjections.ts","../projections/ProjectionId.ts","../projections/ProjectionQueryResult.ts","../projections/ProjectionState.ts","../projections/Projections.ts","../projections/UnableToQueryProjection.ts","../projections/VariantMustDeclareEntersOnEvent.ts","../projections/VariantReclassifier.ts","../projections/constantValueExpression.ts","../projections/index.ts","../projections/notSetPropertyPath.ts","../projections/declarative/AddBuilder.ts","../projections/declarative/AddChildBuilder.ts","../projections/declarative/AllSetBuilder.ts","../projections/declarative/ChildrenBuilder.ts","../projections/declarative/CompositeKeyBuilder.ts","../projections/declarative/FromBuilder.ts","../projections/declarative/FromEveryBuilder.ts","../projections/declarative/IAddBuilder.ts","../projections/declarative/IAddChildBuilder.ts","../projections/declarative/IAllSetBuilder.ts","../projections/declarative/IChildrenBuilder.ts","../projections/declarative/ICompositeKeyBuilder.ts","../projections/declarative/IFromBuilder.ts","../projections/declarative/IFromEveryBuilder.ts","../projections/declarative/IJoinBuilder.ts","../projections/declarative/INestedBuilder.ts","../projections/declarative/IProjectionBuilder.ts","../projections/declarative/IProjectionBuilderFor.ts","../projections/declarative/IProjectionFor.ts","../projections/declarative/IReadModelPropertiesBuilder.ts","../projections/declarative/IRemovedWithBuilder.ts","../projections/declarative/IRemovedWithJoinBuilder.ts","../projections/declarative/ISetBuilder.ts","../projections/declarative/ISubtractBuilder.ts","../projections/declarative/JoinBuilder.ts","../projections/declarative/NestedBuilder.ts","../projections/declarative/ProjectionBuilderCore.ts","../projections/declarative/ProjectionBuilderFor.ts","../projections/declarative/RemovedWithBuilder.ts","../projections/declarative/RemovedWithJoinBuilder.ts","../projections/declarative/SetBuilder.ts","../projections/declarative/SubtractBuilder.ts","../projections/declarative/index.ts","../projections/declarative/projection.ts","../projections/modelBound/FromEventMetadata.ts","../projections/modelBound/FromEventOptions.ts","../projections/modelBound/addFrom.ts","../projections/modelBound/childrenAndNestedBuilder.ts","../projections/modelBound/childrenFrom.ts","../projections/modelBound/clearWith.ts","../projections/modelBound/count.ts","../projections/modelBound/decrement.ts","../projections/modelBound/entersOn.ts","../projections/modelBound/eventSequence.ts","../projections/modelBound/fromAll.ts","../projections/modelBound/fromEvent.ts","../projections/modelBound/fromEvery.ts","../projections/modelBound/globalFor.ts","../projections/modelBound/increment.ts","../projections/modelBound/index.ts","../projections/modelBound/join.ts","../projections/modelBound/nested.ts","../projections/modelBound/noAutoMap.ts","../projections/modelBound/notRewindable.ts","../projections/modelBound/passive.ts","../projections/modelBound/removedWith.ts","../projections/modelBound/removedWithJoin.ts","../projections/modelBound/setFrom.ts","../projections/modelBound/setFromContext.ts","../projections/modelBound/setValue.ts","../projections/modelBound/subtractFrom.ts","../projections/modelBound/variantOf.ts","../reactors/IReactors.ts","../reactors/ReactorId.ts","../reactors/ReactorResultHandler.ts","../reactors/ReactorSideEffects.ts","../reactors/Reactors.ts","../reactors/index.ts","../reactors/onceOnly.ts","../reactors/reactor.ts","../reactors/replay.ts","../readModels/IMaterializedReadModels.ts","../readModels/IReadModels.ts","../readModels/MaterializedReadModels.ts","../readModels/ReadModelChangeset.ts","../readModels/ReadModelId.ts","../readModels/ReadModelSnapshot.ts","../readModels/ReadModelSubjectResolver.ts","../readModels/ReadModels.ts","../readModels/assertUniqueReadModelIds.ts","../readModels/buildReadModelDefinition.ts","../readModels/deserializeReadModel.ts","../readModels/index.ts","../readModels/indexDecorator.ts","../readModels/readModel.ts","../readModels/rootReadModelTypes.ts","../reducers/IReducers.ts","../reducers/ReducerEventDispatcher.ts","../reducers/ReducerEventHandler.ts","../reducers/ReducerId.ts","../reducers/Reducers.ts","../reducers/index.ts","../reducers/reducer.ts","../schemas/JsonSchema.ts","../schemas/JsonSchemaGenerator.ts","../schemas/createDeferredSchema.ts","../schemas/index.ts","../schemas/jsonSchemaProperty.ts","../seeding/EventSeeding.ts","../seeding/ICanSeedEvents.ts","../seeding/IEventSeeding.ts","../seeding/IEventSeedingBuilder.ts","../seeding/IEventSeedingScopeBuilder.ts","../seeding/index.ts","../seeding/seeder.ts","../sinks/WellKnownSinks.ts","../sinks/index.ts","../testing/ReadModelScenario.ts","../testing/ReadModelScenarioGiven.ts","../testing/ReadModelScenarioGivenBuilder.ts","../testing/index.ts","../transactions/IUnitOfWork.ts","../transactions/IUnitOfWorkManager.ts","../transactions/NoUnitOfWorkHasBeenStarted.ts","../transactions/UnitOfWork.ts","../transactions/UnitOfWorkManager.ts","../transactions/index.ts","../types/DecoratorType.ts","../types/TypeDiscoverer.ts","../types/TypeIntrospector.ts","../types/conceptValueType.ts","../types/index.ts","../types/modelBoundProperty.ts","../types/propertyDecoratorMetadata.ts","../types/standardDecoratorMetadata.ts","../webhooks/IWebhook.ts","../webhooks/IWebhookDefinitionBuilder.ts","../webhooks/IWebhooks.ts","../webhooks/WebhookDefinitionBuilder.ts","../webhooks/WebhookId.ts","../webhooks/WebhookTargetUrl.ts","../webhooks/Webhooks.ts","../webhooks/index.ts","../webhooks/webhook.ts"],"packageJsons":["../package.json","../../node_modules/@bufbuild/protobuf/dist/esm/package.json","../../node_modules/@bufbuild/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/package.json","../../node_modules/@cratis/fundamentals/dist/esm/package.json","../../node_modules/@cratis/fundamentals/package.json","../../node_modules/@grpc/grpc-js/package.json","../../node_modules/@grpc/proto-loader/package.json","../../node_modules/@js-sdsl/ordered-map/package.json","../../node_modules/@opentelemetry/api/package.json","../../node_modules/@types/node/package.json","../../node_modules/glob/dist/esm/package.json","../../node_modules/glob/package.json","../../node_modules/long/package.json","../../node_modules/long/umd/package.json","../../node_modules/lru-cache/dist/esm/package.json","../../node_modules/lru-cache/package.json","../../node_modules/minimatch/dist/esm/package.json","../../node_modules/minimatch/package.json","../../node_modules/minipass/dist/esm/package.json","../../node_modules/minipass/package.json","../../node_modules/nice-grpc-common/package.json","../../node_modules/nice-grpc/package.json","../../node_modules/path-scurry/dist/esm/package.json","../../node_modules/path-scurry/package.json","../../node_modules/protobufjs/package.json","../../node_modules/reflect-metadata/package.json","../../node_modules/ts-error/package.json","../../node_modules/undici-types/package.json","../../node_modules/undici/package.json"],"missingPackageJsons":["../../node_modules/@bufbuild/protobuf/dist/esm/codegenv1/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/codegenv2/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/reflect/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wire/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/package.json","../../node_modules/@bufbuild/protobuf/wire/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/google/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/google/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/protobuf-net/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/package.json","../../node_modules/@cratis/chronicle.contracts/dist/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/reflect/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wire/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/wire/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/nice-grpc-common/package.json","../../node_modules/@cratis/fundamentals/dist/esm/geospatial/package.json","../../node_modules/@cratis/fundamentals/dist/esm/json/package.json","../../node_modules/@grpc/grpc-js/build/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/google/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/google/protobuf/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/orca/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/orca/v3/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/orca/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/orca/v3/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/package.json","../../node_modules/@grpc/grpc-js/build/src/package.json","../../node_modules/@grpc/proto-loader/build/package.json","../../node_modules/@grpc/proto-loader/build/src/package.json","../../node_modules/@js-sdsl/ordered-map/dist/esm/package.json","../../node_modules/@js-sdsl/ordered-map/dist/package.json","../../node_modules/@opentelemetry/api/build/package.json","../../node_modules/@opentelemetry/api/build/src/api/package.json","../../node_modules/@opentelemetry/api/build/src/baggage/internal/package.json","../../node_modules/@opentelemetry/api/build/src/baggage/package.json","../../node_modules/@opentelemetry/api/build/src/common/package.json","../../node_modules/@opentelemetry/api/build/src/context/package.json","../../node_modules/@opentelemetry/api/build/src/diag/package.json","../../node_modules/@opentelemetry/api/build/src/metrics/package.json","../../node_modules/@opentelemetry/api/build/src/package.json","../../node_modules/@opentelemetry/api/build/src/propagation/package.json","../../node_modules/@opentelemetry/api/build/src/trace/internal/package.json","../../node_modules/@opentelemetry/api/build/src/trace/package.json","../../node_modules/@types/assert/package.json","../../node_modules/@types/assert/strict/package.json","../../node_modules/@types/async_hooks/package.json","../../node_modules/@types/buffer/package.json","../../node_modules/@types/child_process/package.json","../../node_modules/@types/cluster/package.json","../../node_modules/@types/console/package.json","../../node_modules/@types/constants/package.json","../../node_modules/@types/crypto/package.json","../../node_modules/@types/dgram/package.json","../../node_modules/@types/diagnostics_channel/package.json","../../node_modules/@types/dns/package.json","../../node_modules/@types/dns/promises/package.json","../../node_modules/@types/domain/package.json","../../node_modules/@types/events/package.json","../../node_modules/@types/fs/package.json","../../node_modules/@types/fs/promises/package.json","../../node_modules/@types/http/package.json","../../node_modules/@types/http2/package.json","../../node_modules/@types/https/package.json","../../node_modules/@types/inspector/package.json","../../node_modules/@types/inspector/promises/package.json","../../node_modules/@types/module/package.json","../../node_modules/@types/net/package.json","../../node_modules/@types/node/assert/package.json","../../node_modules/@types/node/dns/package.json","../../node_modules/@types/node/fs/package.json","../../node_modules/@types/node/inspector/package.json","../../node_modules/@types/node/path/package.json","../../node_modules/@types/node/readline/package.json","../../node_modules/@types/node/stream/package.json","../../node_modules/@types/node/test/package.json","../../node_modules/@types/node/timers/package.json","../../node_modules/@types/node/util/package.json","../../node_modules/@types/node/web-globals/package.json","../../node_modules/@types/node/zlib/package.json","../../node_modules/@types/os/package.json","../../node_modules/@types/path/package.json","../../node_modules/@types/path/posix/package.json","../../node_modules/@types/path/win32/package.json","../../node_modules/@types/perf_hooks/package.json","../../node_modules/@types/process/package.json","../../node_modules/@types/punycode/package.json","../../node_modules/@types/querystring/package.json","../../node_modules/@types/readline/package.json","../../node_modules/@types/readline/promises/package.json","../../node_modules/@types/repl/package.json","../../node_modules/@types/stream/consumers/package.json","../../node_modules/@types/stream/iter/package.json","../../node_modules/@types/stream/package.json","../../node_modules/@types/stream/promises/package.json","../../node_modules/@types/stream/web/package.json","../../node_modules/@types/string_decoder/package.json","../../node_modules/@types/timers/package.json","../../node_modules/@types/timers/promises/package.json","../../node_modules/@types/tls/package.json","../../node_modules/@types/trace_events/package.json","../../node_modules/@types/tty/package.json","../../node_modules/@types/url/package.json","../../node_modules/@types/util/package.json","../../node_modules/@types/util/types/package.json","../../node_modules/@types/v8/package.json","../../node_modules/@types/vm/package.json","../../node_modules/@types/wasi/package.json","../../node_modules/@types/worker_threads/package.json","../../node_modules/@types/zlib/package.json","../../node_modules/assert/package.json","../../node_modules/assert/strict/package.json","../../node_modules/async_hooks/package.json","../../node_modules/buffer/package.json","../../node_modules/child_process/package.json","../../node_modules/cluster/package.json","../../node_modules/console/package.json","../../node_modules/constants/package.json","../../node_modules/crypto/package.json","../../node_modules/dgram/package.json","../../node_modules/diagnostics_channel/package.json","../../node_modules/dns/package.json","../../node_modules/dns/promises/package.json","../../node_modules/domain/package.json","../../node_modules/events/package.json","../../node_modules/fs/package.json","../../node_modules/fs/promises/package.json","../../node_modules/http/package.json","../../node_modules/http2/package.json","../../node_modules/https/package.json","../../node_modules/inspector/package.json","../../node_modules/inspector/promises/package.json","../../node_modules/module/package.json","../../node_modules/net/package.json","../../node_modules/nice-grpc-common/lib/client/package.json","../../node_modules/nice-grpc-common/lib/package.json","../../node_modules/nice-grpc-common/lib/server/package.json","../../node_modules/nice-grpc/lib/client/package.json","../../node_modules/nice-grpc/lib/package.json","../../node_modules/nice-grpc/lib/server/package.json","../../node_modules/nice-grpc/lib/service-definitions/package.json","../../node_modules/nice-grpc/lib/utils/package.json","../../node_modules/os/package.json","../../node_modules/path/package.json","../../node_modules/path/posix/package.json","../../node_modules/path/win32/package.json","../../node_modules/perf_hooks/package.json","../../node_modules/process/package.json","../../node_modules/protobufjs/ext/descriptor/package.json","../../node_modules/protobufjs/ext/package.json","../../node_modules/protobufjs/node_modules/@types/long/package.json","../../node_modules/protobufjs/node_modules/long/package.json","../../node_modules/punycode/package.json","../../node_modules/querystring/package.json","../../node_modules/readline/package.json","../../node_modules/readline/promises/package.json","../../node_modules/repl/package.json","../../node_modules/stream/consumers/package.json","../../node_modules/stream/iter/package.json","../../node_modules/stream/package.json","../../node_modules/stream/promises/package.json","../../node_modules/stream/web/package.json","../../node_modules/string_decoder/package.json","../../node_modules/timers/package.json","../../node_modules/timers/promises/package.json","../../node_modules/tls/package.json","../../node_modules/trace_events/package.json","../../node_modules/ts-error/lib/package.json","../../node_modules/tty/package.json","../../node_modules/undici/types/package.json","../../node_modules/url/package.json","../../node_modules/util/package.json","../../node_modules/util/types/package.json","../../node_modules/v8/package.json","../../node_modules/vm/package.json","../../node_modules/wasi/package.json","../../node_modules/worker_threads/package.json","../../node_modules/zlib/package.json"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cratis/chronicle",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.14.0",
|
|
4
4
|
"description": "Event sourcing for TypeScript and Node.js — the idiomatic client for Cratis Chronicle, the open-source event-sourcing database",
|
|
5
5
|
"author": "Cratis",
|
|
6
6
|
"license": "MIT",
|
|
@@ -76,6 +76,11 @@
|
|
|
76
76
|
"import": "./dist/reducers/index.js",
|
|
77
77
|
"default": "./dist/reducers/index.js"
|
|
78
78
|
},
|
|
79
|
+
"./testing": {
|
|
80
|
+
"types": "./dist/testing/index.d.ts",
|
|
81
|
+
"import": "./dist/testing/index.js",
|
|
82
|
+
"default": "./dist/testing/index.js"
|
|
83
|
+
},
|
|
79
84
|
"./seeding": {
|
|
80
85
|
"types": "./dist/seeding/index.d.ts",
|
|
81
86
|
"import": "./dist/seeding/index.js",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import type { Constructor } from '@cratis/fundamentals';
|
|
5
|
+
import { getEventTypeMetadata } from '../events/eventTypeDecorator.js';
|
|
6
|
+
import type { EventContext } from '../events/EventContext.js';
|
|
7
|
+
import type { ReducerEventHandler } from './ReducerEventHandler.js';
|
|
8
|
+
|
|
9
|
+
/** Selects and invokes the same reducer handlers for kernel deliveries and in-process scenarios. */
|
|
10
|
+
export class ReducerEventDispatcher {
|
|
11
|
+
readonly handlers: ReducerEventHandler[];
|
|
12
|
+
|
|
13
|
+
/** Discovers event methods from the artifact event types. */
|
|
14
|
+
constructor(reducerType: Constructor, eventTypes: readonly Constructor[]) {
|
|
15
|
+
const proto = reducerType.prototype as Record<string, unknown>;
|
|
16
|
+
this.handlers = [];
|
|
17
|
+
for (const eventTypeClass of eventTypes) {
|
|
18
|
+
const metadata = getEventTypeMetadata(eventTypeClass);
|
|
19
|
+
if (!metadata) continue;
|
|
20
|
+
const className = (eventTypeClass as Function).name;
|
|
21
|
+
const methodName = className.charAt(0).toLowerCase() + className.slice(1);
|
|
22
|
+
if (typeof proto[methodName] === 'function') {
|
|
23
|
+
this.handlers.push({
|
|
24
|
+
id: metadata.eventType.id.value,
|
|
25
|
+
generation: metadata.eventType.generation.value,
|
|
26
|
+
methodName
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Resolves a registered event type, or returns undefined for an unsubscribed event. */
|
|
33
|
+
handlerFor(eventTypeId: string): ReducerEventHandler | undefined {
|
|
34
|
+
return this.handlers.find(handler => handler.id === eventTypeId);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Calls the selected handler with the event, current state, and context. */
|
|
38
|
+
async invoke(
|
|
39
|
+
instance: Record<string, Function>,
|
|
40
|
+
handler: ReducerEventHandler,
|
|
41
|
+
event: unknown,
|
|
42
|
+
currentState: unknown,
|
|
43
|
+
context: EventContext
|
|
44
|
+
): Promise<unknown> {
|
|
45
|
+
return await instance[handler.methodName](event, currentState, context) as unknown;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
/** Event type and camel-case method selected for a reducer observation. */
|
|
5
|
+
export interface ReducerEventHandler {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly generation: number;
|
|
8
|
+
readonly methodName: string;
|
|
9
|
+
}
|
package/reducers/Reducers.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { ObservationState, ReadModelObserverType, ReducerMessage } from '@cratis
|
|
|
8
8
|
import { IClientArtifactsProvider } from '../artifacts/index.js';
|
|
9
9
|
import { ChronicleConnection } from '../connection/index.js';
|
|
10
10
|
import { ConnectionLifecycle } from '../connection/ConnectionLifecycle.js';
|
|
11
|
-
import { getEventTypeMetadata } from '../events/eventTypeDecorator.js';
|
|
12
11
|
import { toClientEventContext } from '../events/toClientEventContext.js';
|
|
13
12
|
import { getTagsFor } from '../events/tagDecorator.js';
|
|
14
13
|
import { getFilterTagsFor } from '../events/filterEventsByTagDecorator.js';
|
|
@@ -16,6 +15,7 @@ import { EventSequenceId } from '../eventSequences/EventSequenceId.js';
|
|
|
16
15
|
import { notifyReplayLifecycle } from '../observation/notifyReplayLifecycle.js';
|
|
17
16
|
import { IReducers } from './IReducers.js';
|
|
18
17
|
import { getReducerMetadata } from './reducer.js';
|
|
18
|
+
import { ReducerEventDispatcher } from './ReducerEventDispatcher.js';
|
|
19
19
|
import { getReadModelMetadata } from '../readModels/index.js';
|
|
20
20
|
import { getReadModelId } from '../readModels/readModel.js';
|
|
21
21
|
import { buildReadModelDefinition } from '../readModels/buildReadModelDefinition.js';
|
|
@@ -28,12 +28,6 @@ const EVENT_SOURCE_ID_KEY = '$eventSourceId';
|
|
|
28
28
|
/** Sentinel sequence number sent back when no event was successfully processed. */
|
|
29
29
|
const SEQUENCE_NUMBER_UNAVAILABLE = 4294967295n;
|
|
30
30
|
|
|
31
|
-
interface EventTypeEntry {
|
|
32
|
-
readonly id: string;
|
|
33
|
-
readonly generation: number;
|
|
34
|
-
readonly methodName: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
31
|
/**
|
|
38
32
|
* A push-based async queue that implements {@link AsyncIterable} for use with nice-grpc
|
|
39
33
|
* bidirectional streaming. Values pushed via {@link send} are yielded in order to
|
|
@@ -229,29 +223,29 @@ export class Reducers implements IReducers {
|
|
|
229
223
|
if (this._disposed) return;
|
|
230
224
|
const metadata = getReducerMetadata(reducerType)!;
|
|
231
225
|
const eventSequenceId = metadata.eventSequenceId ?? EventSequenceId.eventLog.value;
|
|
232
|
-
const
|
|
226
|
+
const dispatcher = new ReducerEventDispatcher(reducerType, this._clientArtifacts.eventTypes);
|
|
233
227
|
const readModelName = this.getReducerReadModelIdentifier(reducerType);
|
|
234
228
|
|
|
235
229
|
this._logger.info('Starting reducer observation', {
|
|
236
230
|
reducerId: id,
|
|
237
231
|
eventSequenceId,
|
|
238
232
|
readModel: readModelName,
|
|
239
|
-
handlerCount:
|
|
240
|
-
handlers:
|
|
233
|
+
handlerCount: dispatcher.handlers.length,
|
|
234
|
+
handlers: dispatcher.handlers.map(e => e.methodName)
|
|
241
235
|
});
|
|
242
236
|
|
|
243
|
-
void this.runObservation(id, reducerType, eventSequenceId,
|
|
237
|
+
void this.runObservation(id, reducerType, eventSequenceId, readModelName, dispatcher);
|
|
244
238
|
}
|
|
245
239
|
|
|
246
240
|
private async runObservation(
|
|
247
241
|
id: string,
|
|
248
242
|
reducerType: Constructor,
|
|
249
243
|
eventSequenceId: string,
|
|
250
|
-
|
|
251
|
-
|
|
244
|
+
readModelName: string,
|
|
245
|
+
dispatcher: ReducerEventDispatcher
|
|
252
246
|
): Promise<void> {
|
|
253
247
|
try {
|
|
254
|
-
await this.observeReducer(id, reducerType, eventSequenceId,
|
|
248
|
+
await this.observeReducer(id, reducerType, eventSequenceId, readModelName, dispatcher);
|
|
255
249
|
} catch (error) {
|
|
256
250
|
this._logger.error('Reducer observation loop exited with error', { reducerId: id, error: String(error) });
|
|
257
251
|
}
|
|
@@ -301,8 +295,8 @@ export class Reducers implements IReducers {
|
|
|
301
295
|
id: string,
|
|
302
296
|
reducerType: Constructor,
|
|
303
297
|
eventSequenceId: string,
|
|
304
|
-
|
|
305
|
-
|
|
298
|
+
readModelName: string,
|
|
299
|
+
dispatcher: ReducerEventDispatcher
|
|
306
300
|
): Promise<void> {
|
|
307
301
|
const queue = new AsyncQueue<ReducerMessage>();
|
|
308
302
|
const controller = new AbortController();
|
|
@@ -319,7 +313,7 @@ export class Reducers implements IReducers {
|
|
|
319
313
|
Reducer: {
|
|
320
314
|
ReducerId: id,
|
|
321
315
|
EventSequenceId: eventSequenceId,
|
|
322
|
-
EventTypes:
|
|
316
|
+
EventTypes: dispatcher.handlers.map(et => ({
|
|
323
317
|
EventType: { Id: et.id, Generation: et.generation, Tombstone: false },
|
|
324
318
|
Key: EVENT_SOURCE_ID_KEY
|
|
325
319
|
})),
|
|
@@ -377,7 +371,7 @@ export class Reducers implements IReducers {
|
|
|
377
371
|
continue;
|
|
378
372
|
}
|
|
379
373
|
|
|
380
|
-
const entry =
|
|
374
|
+
const entry = dispatcher.handlerFor(eventTypeId);
|
|
381
375
|
if (!entry) {
|
|
382
376
|
this._logger.debug('No handler registered for event type — skipping', { reducerId: id, eventTypeId });
|
|
383
377
|
lastSuccessfullyObservedEvent = event.Context!.SequenceNumber;
|
|
@@ -395,7 +389,7 @@ export class Reducers implements IReducers {
|
|
|
395
389
|
hasState: currentState !== undefined
|
|
396
390
|
});
|
|
397
391
|
|
|
398
|
-
currentState = await reducerInstance
|
|
392
|
+
currentState = await dispatcher.invoke(reducerInstance, entry, content, currentState, context);
|
|
399
393
|
lastSuccessfullyObservedEvent = event.Context!.SequenceNumber;
|
|
400
394
|
} catch (err) {
|
|
401
395
|
this._logger.error('Error handling event in reducer', { reducerId: id, error: String(err) });
|
|
@@ -442,29 +436,6 @@ export class Reducers implements IReducers {
|
|
|
442
436
|
}
|
|
443
437
|
}
|
|
444
438
|
|
|
445
|
-
private getEventTypesFor(reducerType: Constructor): EventTypeEntry[] {
|
|
446
|
-
const proto = reducerType.prototype as Record<string, unknown>;
|
|
447
|
-
const entries: EventTypeEntry[] = [];
|
|
448
|
-
|
|
449
|
-
for (const eventTypeClass of this._clientArtifacts.eventTypes) {
|
|
450
|
-
const eventTypeMeta = getEventTypeMetadata(eventTypeClass);
|
|
451
|
-
if (!eventTypeMeta) continue;
|
|
452
|
-
|
|
453
|
-
const className = (eventTypeClass as Function).name;
|
|
454
|
-
const methodName = className.charAt(0).toLowerCase() + className.slice(1);
|
|
455
|
-
|
|
456
|
-
if (typeof proto[methodName] === 'function') {
|
|
457
|
-
entries.push({
|
|
458
|
-
id: eventTypeMeta.eventType.id.value,
|
|
459
|
-
generation: eventTypeMeta.eventType.generation.value,
|
|
460
|
-
methodName
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
return entries;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
439
|
private disconnectAll(): void {
|
|
469
440
|
for (const controller of this._observations.values()) controller.abort();
|
|
470
441
|
for (const queue of this._queues.values()) queue.complete();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { eventType } from '../events/eventTypeDecorator.js';
|
|
5
|
+
import { reducer } from '../reducers/reducer.js';
|
|
6
|
+
import { ReadModelScenario } from './index.js';
|
|
7
|
+
|
|
8
|
+
class BookBorrowed {
|
|
9
|
+
constructor(readonly title: string) {}
|
|
10
|
+
}
|
|
11
|
+
eventType('book-borrowed')(BookBorrowed);
|
|
12
|
+
|
|
13
|
+
class BookStatus {
|
|
14
|
+
title = '';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class BookStatusReducer {
|
|
18
|
+
bookBorrowed(event: BookBorrowed): BookStatus {
|
|
19
|
+
return { title: event.title };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
reducer('book-status-reducer', undefined, BookStatus)(BookStatusReducer);
|
|
23
|
+
|
|
24
|
+
/** An in-process read model example compiled with the SDK. */
|
|
25
|
+
export async function readModelScenarioExample(): Promise<BookStatus | null> {
|
|
26
|
+
const scenario = new ReadModelScenario(BookStatus);
|
|
27
|
+
scenario.given.forEventSource('book-42').events(new BookBorrowed('Dune'));
|
|
28
|
+
return await scenario.instanceForEventSourceId('book-42');
|
|
29
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import { ConceptAs, field } from '@cratis/fundamentals';
|
|
6
|
+
import type { Constructor } from '@cratis/fundamentals';
|
|
7
|
+
import { eventType } from '../events/eventTypeDecorator.js';
|
|
8
|
+
import type { EventContext } from '../events/EventContext.js';
|
|
9
|
+
import { fromEvent } from '../projections/modelBound/fromEvent.js';
|
|
10
|
+
import { projection } from '../projections/declarative/projection.js';
|
|
11
|
+
import { reducer } from '../reducers/reducer.js';
|
|
12
|
+
import { ReadModelScenario, ReadModelScenarioGivenBuilder } from './index.js';
|
|
13
|
+
import { readModelScenarioExample } from './ReadModelScenario.example.js';
|
|
14
|
+
|
|
15
|
+
class ItemAdded {
|
|
16
|
+
constructor(readonly amount: number) {}
|
|
17
|
+
}
|
|
18
|
+
eventType('scenario-item-added')(ItemAdded);
|
|
19
|
+
class ItemRemoved {}
|
|
20
|
+
eventType('scenario-item-removed')(ItemRemoved);
|
|
21
|
+
class UnrelatedEvent {}
|
|
22
|
+
eventType('scenario-unrelated')(UnrelatedEvent);
|
|
23
|
+
class BookTitle extends ConceptAs<string> {
|
|
24
|
+
static readonly valueType = String;
|
|
25
|
+
}
|
|
26
|
+
class BookNamed {
|
|
27
|
+
@field(BookTitle) title: BookTitle;
|
|
28
|
+
constructor(title: BookTitle) { this.title = title; }
|
|
29
|
+
}
|
|
30
|
+
eventType('scenario-book-named')(BookNamed);
|
|
31
|
+
class BookState { title = ''; }
|
|
32
|
+
class BookReducer {
|
|
33
|
+
bookNamed(event: { title: string }): BookState { return { title: event.title }; }
|
|
34
|
+
}
|
|
35
|
+
reducer('scenario-book-reducer', undefined, BookState)(BookReducer);
|
|
36
|
+
|
|
37
|
+
const nullableStates: unknown[] = [];
|
|
38
|
+
class NullableState { count = 0; }
|
|
39
|
+
class NullableReducer {
|
|
40
|
+
itemAdded(_event: ItemAdded, current: NullableState | null | undefined): null {
|
|
41
|
+
nullableStates.push(current);
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
reducer('scenario-nullable-reducer', undefined, NullableState)(NullableReducer);
|
|
46
|
+
|
|
47
|
+
const reducerFailure = new Error('broken handler');
|
|
48
|
+
class FailingState {}
|
|
49
|
+
class FailingReducer {
|
|
50
|
+
itemAdded(): never { throw reducerFailure; }
|
|
51
|
+
}
|
|
52
|
+
reducer('scenario-failing-reducer', undefined, FailingState)(FailingReducer);
|
|
53
|
+
|
|
54
|
+
class ItemState {
|
|
55
|
+
count = 0;
|
|
56
|
+
}
|
|
57
|
+
const contexts: EventContext[] = [];
|
|
58
|
+
const incomingStates: Array<ItemState | undefined> = [];
|
|
59
|
+
class ItemReducer {
|
|
60
|
+
async itemAdded(event: ItemAdded, current: ItemState | undefined, context: EventContext): Promise<ItemState> {
|
|
61
|
+
contexts.push(context);
|
|
62
|
+
incomingStates.push(current);
|
|
63
|
+
await Promise.resolve();
|
|
64
|
+
return { count: (current?.count ?? 0) + event.amount };
|
|
65
|
+
}
|
|
66
|
+
itemRemoved(): undefined { return undefined; }
|
|
67
|
+
}
|
|
68
|
+
reducer('scenario-item-reducer', undefined, ItemState)(ItemReducer);
|
|
69
|
+
|
|
70
|
+
const artifacts = {
|
|
71
|
+
reducers: [ItemReducer],
|
|
72
|
+
eventTypes: [ItemAdded, ItemRemoved, UnrelatedEvent],
|
|
73
|
+
projections: [] as Constructor[]
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
describe('ReadModelScenario', () => {
|
|
77
|
+
it('runs the compiled documentation example', async () => {
|
|
78
|
+
expect(await readModelScenarioExample()).toEqual({ title: 'Dune' });
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('exposes a named given builder for selecting an event source', () => {
|
|
82
|
+
const scenario = new ReadModelScenario(ItemState, artifacts);
|
|
83
|
+
expect(scenario.given).toBeInstanceOf(ReadModelScenarioGivenBuilder);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('returns null without matching events and distinguishes that from deletion', async () => {
|
|
87
|
+
const scenario = new ReadModelScenario(ItemState, artifacts);
|
|
88
|
+
scenario.given.forEventSource('A').events(new UnrelatedEvent());
|
|
89
|
+
expect(await scenario.instance).toBeNull();
|
|
90
|
+
expect(await scenario.instanceForEventSourceId('A')).toBeNull();
|
|
91
|
+
expect(await scenario.wasDeletedForEventSourceId('A')).toBe(false);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('passes each event, current state, and realistic ordered contexts to an async reducer', async () => {
|
|
95
|
+
contexts.length = 0;
|
|
96
|
+
incomingStates.length = 0;
|
|
97
|
+
const scenario = new ReadModelScenario(ItemState, artifacts);
|
|
98
|
+
scenario.given.forEventSource('A').events(new ItemAdded(2), new ItemAdded(3));
|
|
99
|
+
expect(await scenario.instance).toEqual({ count: 5 });
|
|
100
|
+
expect(incomingStates).toEqual([undefined, { count: 2 }]);
|
|
101
|
+
expect(contexts.map(context => context.sequenceNumber)).toEqual([0n, 1n]);
|
|
102
|
+
expect(contexts.map(context => context.eventSourceId)).toEqual(['A', 'A']);
|
|
103
|
+
expect(contexts.map(context => context.eventSourceType)).toEqual(['Default', 'Default']);
|
|
104
|
+
expect(contexts.map(context => context.eventStreamType)).toEqual(['All', 'All']);
|
|
105
|
+
expect(contexts.map(context => context.eventStreamId)).toEqual(['Default', 'Default']);
|
|
106
|
+
expect(contexts.map(context => context.eventStore)).toEqual(['[NotSet]', '[NotSet]']);
|
|
107
|
+
expect(contexts.map(context => context.namespace)).toEqual(['[NotSet]', '[NotSet]']);
|
|
108
|
+
expect(contexts.map(context => context.eventType.id.value)).toEqual(['scenario-item-added', 'scenario-item-added']);
|
|
109
|
+
expect(contexts.map(context => context.eventType.generation.value)).toEqual([1, 1]);
|
|
110
|
+
expect(contexts.every(context => context.occurred instanceof Date && !Number.isNaN(context.occurred.getTime()))).toBe(true);
|
|
111
|
+
expect(contexts.map(context => context.correlationId)).toEqual([
|
|
112
|
+
'00000000-0000-0000-0000-000000000000', '00000000-0000-0000-0000-000000000000'
|
|
113
|
+
]);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('keeps interleaved event sources separate and rejects an ambiguous single instance', async () => {
|
|
117
|
+
contexts.length = 0;
|
|
118
|
+
const scenario = new ReadModelScenario(ItemState, artifacts);
|
|
119
|
+
scenario.given.forEventSource('A').events(new ItemAdded(2));
|
|
120
|
+
scenario.given.forEventSource('B').events(new ItemAdded(7));
|
|
121
|
+
scenario.given.forEventSource('A').events(new ItemAdded(3));
|
|
122
|
+
expect(await scenario.instanceForEventSourceId('A')).toEqual({ count: 5 });
|
|
123
|
+
expect(await scenario.instanceForEventSourceId('B')).toEqual({ count: 7 });
|
|
124
|
+
expect(contexts.map(context => context.sequenceNumber)).toEqual([0n, 1n, 2n]);
|
|
125
|
+
expect(contexts.map(context => context.eventSourceId)).toEqual(['A', 'B', 'A']);
|
|
126
|
+
await expect(scenario.instance).rejects.toThrow('Multiple read model instances');
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('replays added events after an earlier result was read', async () => {
|
|
130
|
+
const scenario = new ReadModelScenario(ItemState, artifacts);
|
|
131
|
+
scenario.given.forEventSource('A').events(new ItemAdded(2));
|
|
132
|
+
expect(await scenario.instance).toEqual({ count: 2 });
|
|
133
|
+
scenario.given.forEventSource('A').events(new ItemAdded(3));
|
|
134
|
+
expect(await scenario.instance).toEqual({ count: 5 });
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('treats an undefined reducer result as deletion, not missing history', async () => {
|
|
138
|
+
incomingStates.length = 0;
|
|
139
|
+
const scenario = new ReadModelScenario(ItemState, artifacts);
|
|
140
|
+
scenario.given.forEventSource('A').events(new ItemAdded(2), new ItemRemoved());
|
|
141
|
+
expect(await scenario.instanceForEventSourceId('A')).toBeNull();
|
|
142
|
+
expect(await scenario.wasDeletedForEventSourceId('A')).toBe(true);
|
|
143
|
+
scenario.given.forEventSource('A').events(new ItemAdded(4));
|
|
144
|
+
expect(await scenario.instance).toEqual({ count: 4 });
|
|
145
|
+
expect(incomingStates.at(-1)).toBeUndefined();
|
|
146
|
+
expect(await scenario.wasDeletedForEventSourceId('A')).toBe(false);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('serializes concept properties as primitives, like production append', async () => {
|
|
150
|
+
const scenario = new ReadModelScenario(BookState, {
|
|
151
|
+
reducers: [BookReducer], eventTypes: [BookNamed], projections: []
|
|
152
|
+
});
|
|
153
|
+
scenario.given.forEventSource('book-42').events(new BookNamed(new BookTitle('Dune')));
|
|
154
|
+
expect(await scenario.instance).toEqual({ title: 'Dune' });
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('preserves a null reducer result as null state rather than a deletion', async () => {
|
|
158
|
+
nullableStates.length = 0;
|
|
159
|
+
const scenario = new ReadModelScenario(NullableState, {
|
|
160
|
+
reducers: [NullableReducer], eventTypes: [ItemAdded], projections: []
|
|
161
|
+
});
|
|
162
|
+
scenario.given.forEventSource('A').events(new ItemAdded(1), new ItemAdded(2));
|
|
163
|
+
expect(await scenario.instanceForEventSourceId('A')).toBeNull();
|
|
164
|
+
expect(await scenario.wasDeletedForEventSourceId('A')).toBe(false);
|
|
165
|
+
expect(nullableStates).toEqual([undefined, null]);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('wraps reducer failures with the read model and reducer names and preserves the cause', async () => {
|
|
169
|
+
const scenario = new ReadModelScenario(FailingState, {
|
|
170
|
+
reducers: [FailingReducer], eventTypes: [ItemAdded], projections: []
|
|
171
|
+
});
|
|
172
|
+
scenario.given.forEventSource('A').events(new ItemAdded(1));
|
|
173
|
+
await expect(scenario.instance).rejects.toMatchObject({
|
|
174
|
+
message: expect.stringContaining('FailingState'),
|
|
175
|
+
cause: reducerFailure
|
|
176
|
+
});
|
|
177
|
+
await expect(scenario.instance).rejects.toThrow('FailingReducer');
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('rejects model-bound and declarative projections rather than silently returning null', () => {
|
|
181
|
+
class ProjectedState {}
|
|
182
|
+
fromEvent(ItemAdded)(ProjectedState);
|
|
183
|
+
expect(() => new ReadModelScenario(ProjectedState, artifacts)).toThrow('not supported yet; use a kernel-backed test');
|
|
184
|
+
|
|
185
|
+
class FluentState {}
|
|
186
|
+
class FluentProjection {}
|
|
187
|
+
projection('scenario-fluent-projection', FluentState)(FluentProjection);
|
|
188
|
+
expect(() => new ReadModelScenario(FluentState, { ...artifacts, projections: [FluentProjection] }))
|
|
189
|
+
.toThrow('not supported yet; use a kernel-backed test');
|
|
190
|
+
});
|
|
191
|
+
});
|