@cratis/chronicle 6.21.0 → 6.22.1
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/eventSequences/EventSequence.d.ts.map +1 -1
- package/dist/eventSequences/EventSequence.js +1 -1
- package/dist/eventSequences/EventSequence.js.map +1 -1
- package/dist/reactors/ReactorDispatcher.d.ts +20 -0
- package/dist/reactors/ReactorDispatcher.d.ts.map +1 -0
- package/dist/reactors/ReactorDispatcher.js +76 -0
- package/dist/reactors/ReactorDispatcher.js.map +1 -0
- package/dist/reactors/ReactorSideEffects.d.ts +3 -0
- package/dist/reactors/ReactorSideEffects.d.ts.map +1 -1
- package/dist/reactors/ReactorSideEffects.js +16 -11
- package/dist/reactors/ReactorSideEffects.js.map +1 -1
- package/dist/reactors/Reactors.d.ts +0 -1
- package/dist/reactors/Reactors.d.ts.map +1 -1
- package/dist/reactors/Reactors.js +5 -71
- package/dist/reactors/Reactors.js.map +1 -1
- package/dist/testing/InProcessEventSequence.d.ts +8 -0
- package/dist/testing/InProcessEventSequence.d.ts.map +1 -1
- package/dist/testing/InProcessEventSequence.js +14 -1
- package/dist/testing/InProcessEventSequence.js.map +1 -1
- package/dist/testing/ReactorDeliveryResult.d.ts +10 -0
- package/dist/testing/ReactorDeliveryResult.d.ts.map +1 -0
- package/dist/testing/ReactorDeliveryResult.js +4 -0
- package/dist/testing/ReactorDeliveryResult.js.map +1 -0
- package/dist/testing/ReactorScenario.d.ts +55 -0
- package/dist/testing/ReactorScenario.d.ts.map +1 -0
- package/dist/testing/ReactorScenario.js +275 -0
- package/dist/testing/ReactorScenario.js.map +1 -0
- package/dist/testing/ReactorScenarioOptions.d.ts +17 -0
- package/dist/testing/ReactorScenarioOptions.d.ts.map +1 -0
- package/dist/testing/ReactorScenarioOptions.js +4 -0
- package/dist/testing/ReactorScenarioOptions.js.map +1 -0
- package/dist/testing/RecordedReactorSideEffect.d.ts +13 -0
- package/dist/testing/RecordedReactorSideEffect.d.ts.map +1 -0
- package/dist/testing/RecordedReactorSideEffect.js +4 -0
- package/dist/testing/RecordedReactorSideEffect.js.map +1 -0
- package/dist/testing/UnsupportedReactorOperation.d.ts +7 -0
- package/dist/testing/UnsupportedReactorOperation.d.ts.map +1 -0
- package/dist/testing/UnsupportedReactorOperation.js +14 -0
- package/dist/testing/UnsupportedReactorOperation.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eventSequences/EventSequence.spec.ts +37 -2
- package/eventSequences/EventSequence.ts +17 -12
- package/events/constraints/for_Constraints/when_resolving_violation_messages.spec.ts +9 -4
- package/package.json +1 -1
- package/reactors/ReactorDispatcher.ts +95 -0
- package/reactors/ReactorSideEffects.ts +21 -13
- package/reactors/Reactors.ts +11 -83
- package/testing/InProcessEventSequence.ts +16 -1
- package/testing/ReactorDeliveryResult.ts +13 -0
- package/testing/ReactorScenario.rejections.spec.ts +100 -0
- package/testing/ReactorScenario.spec.ts +611 -0
- package/testing/ReactorScenario.ts +279 -0
- package/testing/ReactorScenarioOptions.ts +20 -0
- package/testing/RecordedReactorSideEffect.ts +16 -0
- package/testing/UnsupportedReactorOperation.ts +10 -0
- package/testing/index.ts +5 -0
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
/** An operation whose kernel/observer semantics have not been established for this scenario. */
|
|
4
|
+
export class UnsupportedReactorOperation extends Error {
|
|
5
|
+
operation;
|
|
6
|
+
artifact;
|
|
7
|
+
constructor(operation, artifact, reason) {
|
|
8
|
+
super(`Unsupported reactor operation '${operation}' for '${artifact}': ${reason} Use a kernel-backed test.`);
|
|
9
|
+
this.operation = operation;
|
|
10
|
+
this.artifact = artifact;
|
|
11
|
+
this.name = 'UnsupportedReactorOperation';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=UnsupportedReactorOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedReactorOperation.js","sourceRoot":"","sources":["../../testing/UnsupportedReactorOperation.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,gGAAgG;AAChG,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IAC7B,SAAS;IAAmB,QAAQ;IAAzD,YAAqB,SAAiB,EAAW,QAAgB,EAAE,MAAc;QAC7E,KAAK,CAAC,kCAAkC,SAAS,UAAU,QAAQ,MAAM,MAAM,4BAA4B,CAAC,CAAC;yBAD5F,SAAS;wBAAmB,QAAQ;QAErD,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC9C,CAAC;CACJ"}
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export { EventScenario } from './EventScenario.js';
|
|
2
|
+
export { ReactorScenario } from './ReactorScenario.js';
|
|
3
|
+
export type { ReactorScenarioOptions } from './ReactorScenarioOptions.js';
|
|
4
|
+
export type { ReactorDeliveryResult } from './ReactorDeliveryResult.js';
|
|
5
|
+
export type { RecordedReactorSideEffect } from './RecordedReactorSideEffect.js';
|
|
6
|
+
export { UnsupportedReactorOperation } from './UnsupportedReactorOperation.js';
|
|
2
7
|
export type { EventScenarioOptions } from './EventScenarioOptions.js';
|
|
3
8
|
export { EventScenarioGivenBuilder } from './EventScenarioGivenBuilder.js';
|
|
4
9
|
export { EventScenarioGiven } from './EventScenarioGiven.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAC"}
|
package/dist/testing/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Cratis. All rights reserved.
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
export { EventScenario } from './EventScenario.js';
|
|
4
|
+
export { ReactorScenario } from './ReactorScenario.js';
|
|
5
|
+
export { UnsupportedReactorOperation } from './UnsupportedReactorOperation.js';
|
|
4
6
|
export { EventScenarioGivenBuilder } from './EventScenarioGivenBuilder.js';
|
|
5
7
|
export { EventScenarioGiven } from './EventScenarioGiven.js';
|
|
6
8
|
export { EventScenarioWhenBuilder } from './EventScenarioWhenBuilder.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAC"}
|
|
@@ -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/ActivatedArtifact.ts","../artifacts/ArtifactActivationContext.ts","../artifacts/ArtifactCompletionFailed.ts","../artifacts/ArtifactDelivery.ts","../artifacts/ArtifactInvocationContext.ts","../artifacts/ArtifactKind.ts","../artifacts/ClientArtifactsActivator.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../artifacts/validateArtifactSchemas.ts","../artifacts/withActivatedArtifact.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/createAppendNotification.ts","../eventSequences/index.ts","../eventSequences/prepareBatchAppend.ts","../eventSequences/prepareSingleAppend.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/CompiledProjectionDefinitions.ts","../projections/GlobalHandlerPropertyNotOnVariant.ts","../projections/IProjections.ts","../projections/InvalidEventContextPropertyError.ts","../projections/ProjectionCapabilityProvenance.ts","../projections/ProjectionDefinitionCompiler.ts","../projections/ProjectionEventSchema.ts","../projections/ProjectionId.ts","../projections/ProjectionQueryResult.ts","../projections/ProjectionState.ts","../projections/Projections.ts","../projections/ResolvedModelBoundMetadata.ts","../projections/UnableToQueryProjection.ts","../projections/VariantMustDeclareEntersOnEvent.ts","../projections/VariantReclassifier.ts","../projections/canonicalStringify.ts","../projections/captureProjectionProvenance.ts","../projections/constantValueExpression.ts","../projections/eventContextPropertyExpression.ts","../projections/eventContractPath.ts","../projections/index.ts","../projections/invalidEventContextPropertyInProjection.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/declarative/projectionBuilderProvenance.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/isModelBoundProjection.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/ReactorServices.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/EventScenario.ts","../testing/EventScenarioGiven.ts","../testing/EventScenarioGivenBuilder.ts","../testing/EventScenarioOptions.ts","../testing/EventScenarioSeed.ts","../testing/EventScenarioWhen.ts","../testing/EventScenarioWhenBuilder.ts","../testing/IReadModelProcessor.ts","../testing/InProcessEventSequence.ts","../testing/ReadModelScenario.ts","../testing/ReadModelScenarioGiven.ts","../testing/ReadModelScenarioGivenBuilder.ts","../testing/ReadModelState.ts","../testing/ReducerReadModelProcessor.ts","../testing/ScenarioEvent.ts","../testing/UnsupportedEventSequenceOperation.ts","../testing/index.ts","../testing/projections/ProjectionCapabilities.ts","../testing/projections/ProjectionExpressionEvaluator.ts","../testing/projections/ProjectionReadModelProcessor.ts","../testing/projections/ProjectionValueConverter.ts","../testing/projections/UnsupportedProjectionOperation.ts","../testing/projections/for_ProjectionCapabilities/given/Changed.ts","../testing/projections/for_ProjectionCapabilities/given/Model.ts","../testing/projections/for_ProjectionCapabilities/given/Removed.ts","../testing/projections/for_ProjectionCapabilities/given/compile.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/modelBoundPropertyMetadata.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/ActivatedArtifact.ts","../artifacts/ArtifactActivationContext.ts","../artifacts/ArtifactCompletionFailed.ts","../artifacts/ArtifactDelivery.ts","../artifacts/ArtifactInvocationContext.ts","../artifacts/ArtifactKind.ts","../artifacts/ClientArtifactsActivator.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../artifacts/validateArtifactSchemas.ts","../artifacts/withActivatedArtifact.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/createAppendNotification.ts","../eventSequences/index.ts","../eventSequences/prepareBatchAppend.ts","../eventSequences/prepareSingleAppend.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/CompiledProjectionDefinitions.ts","../projections/GlobalHandlerPropertyNotOnVariant.ts","../projections/IProjections.ts","../projections/InvalidEventContextPropertyError.ts","../projections/ProjectionCapabilityProvenance.ts","../projections/ProjectionDefinitionCompiler.ts","../projections/ProjectionEventSchema.ts","../projections/ProjectionId.ts","../projections/ProjectionQueryResult.ts","../projections/ProjectionState.ts","../projections/Projections.ts","../projections/ResolvedModelBoundMetadata.ts","../projections/UnableToQueryProjection.ts","../projections/VariantMustDeclareEntersOnEvent.ts","../projections/VariantReclassifier.ts","../projections/canonicalStringify.ts","../projections/captureProjectionProvenance.ts","../projections/constantValueExpression.ts","../projections/eventContextPropertyExpression.ts","../projections/eventContractPath.ts","../projections/index.ts","../projections/invalidEventContextPropertyInProjection.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/declarative/projectionBuilderProvenance.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/isModelBoundProjection.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/ReactorDispatcher.ts","../reactors/ReactorId.ts","../reactors/ReactorResultHandler.ts","../reactors/ReactorServices.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/EventScenario.ts","../testing/EventScenarioGiven.ts","../testing/EventScenarioGivenBuilder.ts","../testing/EventScenarioOptions.ts","../testing/EventScenarioSeed.ts","../testing/EventScenarioWhen.ts","../testing/EventScenarioWhenBuilder.ts","../testing/IReadModelProcessor.ts","../testing/InProcessEventSequence.ts","../testing/ReactorDeliveryResult.ts","../testing/ReactorScenario.ts","../testing/ReactorScenarioOptions.ts","../testing/ReadModelScenario.ts","../testing/ReadModelScenarioGiven.ts","../testing/ReadModelScenarioGivenBuilder.ts","../testing/ReadModelState.ts","../testing/RecordedReactorSideEffect.ts","../testing/ReducerReadModelProcessor.ts","../testing/ScenarioEvent.ts","../testing/UnsupportedEventSequenceOperation.ts","../testing/UnsupportedReactorOperation.ts","../testing/index.ts","../testing/projections/ProjectionCapabilities.ts","../testing/projections/ProjectionExpressionEvaluator.ts","../testing/projections/ProjectionReadModelProcessor.ts","../testing/projections/ProjectionValueConverter.ts","../testing/projections/UnsupportedProjectionOperation.ts","../testing/projections/for_ProjectionCapabilities/given/Changed.ts","../testing/projections/for_ProjectionCapabilities/given/Model.ts","../testing/projections/for_ProjectionCapabilities/given/Removed.ts","../testing/projections/for_ProjectionCapabilities/given/compile.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/modelBoundPropertyMetadata.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"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
|
|
4
4
|
import { describe, expect, it, vi } from 'vitest';
|
|
5
|
+
import { ConstraintType, type ConstraintViolation as ContractsConstraintViolation } from '@cratis/chronicle.contracts';
|
|
5
6
|
import type { ChronicleConnection } from '../connection/index.js';
|
|
6
7
|
import { causationManager, CausationType } from '../auditing/index.js';
|
|
7
8
|
import type { IUnitOfWorkManager } from '../transactions/IUnitOfWorkManager.js';
|
|
@@ -661,12 +662,43 @@ describe('EventSequence', () => {
|
|
|
661
662
|
});
|
|
662
663
|
});
|
|
663
664
|
|
|
665
|
+
describe('when a single append fails schema validation', () => {
|
|
666
|
+
const { eventSequence } = createEventSequence({
|
|
667
|
+
append: vi.fn().mockResolvedValue({ Response: {
|
|
668
|
+
SequenceNumber: 18446744073709551615n,
|
|
669
|
+
ConstraintViolations: [{
|
|
670
|
+
EventTypeId: 'a3f6a2f0-6f2f-4a3c-9d3f-6f2f4a3c9d3f',
|
|
671
|
+
SequenceNumber: 0n,
|
|
672
|
+
ConstraintType: ConstraintType.Schema,
|
|
673
|
+
ConstraintName: 'SchemaValidation',
|
|
674
|
+
Message: 'Invalid event content',
|
|
675
|
+
Details: { path: '$.total', kind: 'type' }
|
|
676
|
+
} satisfies ContractsConstraintViolation],
|
|
677
|
+
Errors: []
|
|
678
|
+
} })
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
it('should preserve the schema constraint name and details from the wire response', async () => {
|
|
682
|
+
const result = await eventSequence.append('some-event-source', new SomethingHappened('a'));
|
|
683
|
+
|
|
684
|
+
expect(result.isSuccess).toBe(false);
|
|
685
|
+
expect(result.constraintViolations).toEqual([{
|
|
686
|
+
constraintId: 'SchemaValidation',
|
|
687
|
+
message: 'Invalid event content',
|
|
688
|
+
details: { path: '$.total', kind: 'type' }
|
|
689
|
+
}]);
|
|
690
|
+
});
|
|
691
|
+
});
|
|
692
|
+
|
|
664
693
|
describe('when waiting for completion after an append that itself failed', () => {
|
|
665
694
|
const { eventSequence, waitForCompletion } = createEventSequence({
|
|
666
695
|
append: vi.fn().mockResolvedValue({
|
|
667
696
|
Response: {
|
|
668
697
|
SequenceNumber: 0n,
|
|
669
|
-
ConstraintViolations: [{
|
|
698
|
+
ConstraintViolations: [{
|
|
699
|
+
EventTypeId: '', SequenceNumber: 0n, ConstraintType: ConstraintType.Unique,
|
|
700
|
+
ConstraintName: 'unique', Message: 'Value must be unique', Details: {}
|
|
701
|
+
} satisfies ContractsConstraintViolation],
|
|
670
702
|
Errors: []
|
|
671
703
|
}
|
|
672
704
|
})
|
|
@@ -711,7 +743,10 @@ describe('EventSequence', () => {
|
|
|
711
743
|
appendManyForEventSources: vi.fn().mockResolvedValue({
|
|
712
744
|
Response: {
|
|
713
745
|
SequenceNumbers: [],
|
|
714
|
-
ConstraintViolations: [{
|
|
746
|
+
ConstraintViolations: [{
|
|
747
|
+
EventTypeId: '', SequenceNumber: 0n, ConstraintType: ConstraintType.Unique,
|
|
748
|
+
ConstraintName: 'unique', Message: 'Value must be unique', Details: { value: 'a' }
|
|
749
|
+
} satisfies ContractsConstraintViolation],
|
|
715
750
|
Errors: ['Batch rejected']
|
|
716
751
|
}
|
|
717
752
|
})
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
import { ChronicleConnection } from '../connection/index.js';
|
|
5
5
|
import { SpanStatusCode } from '@opentelemetry/api';
|
|
6
|
-
import type {
|
|
6
|
+
import type {
|
|
7
|
+
AppendedEventResponse as ContractsAppendedEvent,
|
|
8
|
+
AppendManyResponse as ContractsAppendManyResponse,
|
|
9
|
+
AppendResponse as ContractsAppendResponse
|
|
10
|
+
} from '@cratis/chronicle.contracts';
|
|
7
11
|
import { Constructor } from '@cratis/fundamentals';
|
|
8
12
|
import { prepareSingleAppend } from './prepareSingleAppend.js';
|
|
9
13
|
import { prepareBatchAppend } from './prepareBatchAppend.js';
|
|
@@ -210,10 +214,11 @@ export class EventSequence implements IEventSequence {
|
|
|
210
214
|
// Mirrors the C# client: every per-event AppendResult in a batch carries all
|
|
211
215
|
// constraint violations and the first concurrency violation of the whole batch —
|
|
212
216
|
// the wire response doesn't correlate either back to a specific event index.
|
|
213
|
-
const firstConcurrencyViolation
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
const
|
|
217
|
+
const firstConcurrencyViolation: ContractsAppendManyResponse['ConcurrencyViolations'][number] | undefined =
|
|
218
|
+
(appendManyResponse.ConcurrencyViolations ?? [])[0];
|
|
219
|
+
const sequenceNumbers: ContractsAppendManyResponse['SequenceNumbers'] = appendManyResponse.SequenceNumbers ?? [];
|
|
220
|
+
const constraintViolations: ContractsAppendManyResponse['ConstraintViolations'] = appendManyResponse.ConstraintViolations ?? [];
|
|
221
|
+
const errors: ContractsAppendManyResponse['Errors'] = appendManyResponse.Errors ?? [];
|
|
217
222
|
const batchWasRejected = sequenceNumbers.length === 0 &&
|
|
218
223
|
(constraintViolations.length > 0 || errors.length > 0 || firstConcurrencyViolation !== undefined);
|
|
219
224
|
if (sequenceNumbers.length === 0 && eventsForEventSourceIds.length > 0 && !batchWasRejected) {
|
|
@@ -221,11 +226,11 @@ export class EventSequence implements IEventSequence {
|
|
|
221
226
|
}
|
|
222
227
|
const result = batchWasRejected
|
|
223
228
|
? eventsForEventSourceIds.map(() => this.mapAppendResponse(0n, constraintViolations, errors, firstConcurrencyViolation))
|
|
224
|
-
: sequenceNumbers.map((sequenceNumber
|
|
229
|
+
: sequenceNumbers.map((sequenceNumber, index) =>
|
|
225
230
|
this.mapAppendResponse(
|
|
226
231
|
sequenceNumber,
|
|
227
232
|
constraintViolations,
|
|
228
|
-
errors.filter((_
|
|
233
|
+
errors.filter((_, errorIndex) => errorIndex === index),
|
|
229
234
|
firstConcurrencyViolation
|
|
230
235
|
)
|
|
231
236
|
);
|
|
@@ -585,14 +590,14 @@ export class EventSequence implements IEventSequence {
|
|
|
585
590
|
}
|
|
586
591
|
|
|
587
592
|
private mapAppendResponse(
|
|
588
|
-
sequenceNumber:
|
|
589
|
-
constraintViolations:
|
|
590
|
-
errors:
|
|
591
|
-
concurrencyViolation
|
|
593
|
+
sequenceNumber: ContractsAppendResponse['SequenceNumber'],
|
|
594
|
+
constraintViolations: ContractsAppendResponse['ConstraintViolations'],
|
|
595
|
+
errors: ContractsAppendResponse['Errors'],
|
|
596
|
+
concurrencyViolation: ContractsAppendResponse['ConcurrencyViolation']
|
|
592
597
|
): AppendResult {
|
|
593
598
|
const mappedViolations: ConstraintViolation[] = constraintViolations.map(violation => {
|
|
594
599
|
const mapped = {
|
|
595
|
-
constraintId: violation.
|
|
600
|
+
constraintId: violation.ConstraintName ?? '',
|
|
596
601
|
message: violation.Message ?? '',
|
|
597
602
|
details: violation.Details ?? {}
|
|
598
603
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Cratis. All rights reserved.
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
|
|
4
|
+
import { ConstraintType, type ConstraintViolation as ContractsConstraintViolation } from '@cratis/chronicle.contracts';
|
|
4
5
|
import { chai, describe, it, vi } from 'vitest';
|
|
5
6
|
import type { ChronicleConnection } from '../../../connection/ChronicleConnection.js';
|
|
6
7
|
import type { IClientArtifactsProvider } from '../../../artifacts/IClientArtifactsProvider.js';
|
|
@@ -57,13 +58,15 @@ describe('when resolving violation messages', () => {
|
|
|
57
58
|
const connection = {
|
|
58
59
|
eventSequences: { append: vi.fn().mockResolvedValue({ Response: {
|
|
59
60
|
SequenceNumber: 0n, Errors: [], ConstraintViolations: [{
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
EventTypeId: 'message-registered', SequenceNumber: 0n, ConstraintType: ConstraintType.Unique,
|
|
62
|
+
ConstraintName: 'SharedAddress', Message: 'Kernel default', Details: { email: 'a$b' }
|
|
63
|
+
} satisfies ContractsConstraintViolation]
|
|
62
64
|
} }) }
|
|
63
65
|
} as unknown as ChronicleConnection;
|
|
64
66
|
const sequence = new EventSequence(EventSequenceId.eventLog, 'store', 'namespace', connection,
|
|
65
67
|
{} as IUnitOfWorkManager, discovered.resolveMessageFor.bind(discovered));
|
|
66
68
|
const result = await sequence.append('source', new Registered());
|
|
69
|
+
result.constraintViolations[0].constraintId.should.equal('SharedAddress');
|
|
67
70
|
result.constraintViolations[0].message.should.equal('Address a$b already registered');
|
|
68
71
|
});
|
|
69
72
|
|
|
@@ -80,13 +83,15 @@ describe('when resolving violation messages', () => {
|
|
|
80
83
|
const connection = {
|
|
81
84
|
eventSequences: { append: vi.fn().mockResolvedValue({ Response: {
|
|
82
85
|
SequenceNumber: 0n, Errors: [], ConstraintViolations: [{
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
EventTypeId: 'message-once', SequenceNumber: 0n, ConstraintType: ConstraintType.UniqueEventType,
|
|
87
|
+
ConstraintName: 'OneRegistration', Message: 'Kernel default', Details: {}
|
|
88
|
+
} satisfies ContractsConstraintViolation]
|
|
85
89
|
} }) }
|
|
86
90
|
} as unknown as ChronicleConnection;
|
|
87
91
|
const sequence = new EventSequence(EventSequenceId.eventLog, 'store', 'namespace', connection,
|
|
88
92
|
{} as IUnitOfWorkManager, discovered.resolveMessageFor.bind(discovered));
|
|
89
93
|
const result = await sequence.append('source', new OnlyOnce());
|
|
94
|
+
result.constraintViolations[0].constraintId.should.equal('OneRegistration');
|
|
90
95
|
result.constraintViolations[0].message.should.equal('Already registered');
|
|
91
96
|
});
|
|
92
97
|
});
|
package/package.json
CHANGED
|
@@ -0,0 +1,95 @@
|
|
|
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 { EventObservationState } from '@cratis/chronicle.contracts';
|
|
5
|
+
import type { Constructor } from '@cratis/fundamentals';
|
|
6
|
+
import type { ActivatedArtifact } from '../artifacts/ActivatedArtifact.js';
|
|
7
|
+
import { ArtifactDelivery } from '../artifacts/ArtifactDelivery.js';
|
|
8
|
+
import { runActivated } from '../artifacts/withActivatedArtifact.js';
|
|
9
|
+
import type { EventContext } from '../events/EventContext.js';
|
|
10
|
+
import { getEventTypeMetadata } from '../events/eventTypeDecorator.js';
|
|
11
|
+
import { isOnceOnly } from './onceOnly.js';
|
|
12
|
+
import { getReplayEventType } from './replay.js';
|
|
13
|
+
import type { ReactorServices } from './ReactorServices.js';
|
|
14
|
+
|
|
15
|
+
/** Internal handler catalog shared by live observations and in-process deliveries. */
|
|
16
|
+
export interface ReactorEventTypeEntry {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly generation: number;
|
|
19
|
+
readonly methodName?: string;
|
|
20
|
+
readonly replayMethodName?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function getReactorEventTypes(reactorType: Constructor, registeredTypes: readonly Constructor[]): ReactorEventTypeEntry[] {
|
|
24
|
+
const proto = reactorType.prototype as Record<string, unknown>;
|
|
25
|
+
const entries: ReactorEventTypeEntry[] = [];
|
|
26
|
+
const replayHandlers = new Map<string, string>();
|
|
27
|
+
const eventTypes = new Map<string, { eventTypeClass: Function; id: string; generation: number }>();
|
|
28
|
+
|
|
29
|
+
for (const eventTypeClass of registeredTypes) {
|
|
30
|
+
const metadata = getEventTypeMetadata(eventTypeClass);
|
|
31
|
+
if (metadata) {
|
|
32
|
+
eventTypes.set((eventTypeClass as Function).name, {
|
|
33
|
+
eventTypeClass: eventTypeClass as Function,
|
|
34
|
+
id: metadata.eventType.id.value,
|
|
35
|
+
generation: metadata.eventType.generation.value
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// A derived method shadows a base method of the same name, even if it is not marked for replay.
|
|
41
|
+
const seenMethods = new Set<string>();
|
|
42
|
+
for (let current = proto; current && current !== Object.prototype; current = Object.getPrototypeOf(current) as Record<string, unknown>) {
|
|
43
|
+
for (const name of Object.getOwnPropertyNames(current)) {
|
|
44
|
+
if (seenMethods.has(name)) continue;
|
|
45
|
+
seenMethods.add(name);
|
|
46
|
+
const method = current[name];
|
|
47
|
+
if (typeof method !== 'function') continue;
|
|
48
|
+
const replayEventType = getReplayEventType(method);
|
|
49
|
+
if (replayEventType === undefined) continue;
|
|
50
|
+
|
|
51
|
+
const eventType = replayEventType === true
|
|
52
|
+
? eventTypes.get(name.startsWith('replay') ? name.slice('replay'.length) : '')
|
|
53
|
+
: [...eventTypes.values()].find(candidate => candidate.eventTypeClass === replayEventType);
|
|
54
|
+
if (!eventType) {
|
|
55
|
+
throw new Error(`Replay handler '${name}' on reactor '${(reactorType as Function).name}' has no registered event type.`);
|
|
56
|
+
}
|
|
57
|
+
if (replayHandlers.has(eventType.id)) {
|
|
58
|
+
throw new Error(`Reactor '${(reactorType as Function).name}' has multiple replay handlers for event type '${eventType.id}': '${replayHandlers.get(eventType.id)}' and '${name}'.`);
|
|
59
|
+
}
|
|
60
|
+
replayHandlers.set(eventType.id, name);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
for (const [className, eventType] of eventTypes) {
|
|
65
|
+
const methodName = className.charAt(0).toLowerCase() + className.slice(1);
|
|
66
|
+
const liveMethod = proto[methodName];
|
|
67
|
+
const liveMethodName = typeof liveMethod === 'function' && getReplayEventType(liveMethod) === undefined ? methodName : undefined;
|
|
68
|
+
const replayMethodName = replayHandlers.get(eventType.id);
|
|
69
|
+
if (liveMethodName || replayMethodName) {
|
|
70
|
+
entries.push({ id: eventType.id, generation: eventType.generation, methodName: liveMethodName, replayMethodName });
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return entries;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function selectReactorHandler(entries: readonly ReactorEventTypeEntry[], reactorType: Constructor,
|
|
77
|
+
instance: Record<string, Function> | undefined, id: string | undefined, observationState: number):
|
|
78
|
+
{ methodName: string | undefined; isReplay: boolean; skipReplay: boolean } | undefined {
|
|
79
|
+
const entry = entries.find(candidate => candidate.id === id);
|
|
80
|
+
if (!entry) return undefined;
|
|
81
|
+
const isReplay = (observationState & EventObservationState.Replay) !== 0;
|
|
82
|
+
const methodName = isReplay ? (entry.replayMethodName ?? entry.methodName) : entry.methodName;
|
|
83
|
+
const method = methodName ? (instance?.[methodName] ?? (reactorType.prototype as Record<string, Function>)[methodName]) : undefined;
|
|
84
|
+
return { methodName, isReplay, skipReplay: isReplay && method !== undefined && isOnceOnly(method) };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Handler and returned effects execute in the same production activation boundary. */
|
|
88
|
+
export async function invokeReactorHandler(artifact: ActivatedArtifact<Record<string, Function>>, methodName: string,
|
|
89
|
+
content: Record<string, unknown>, context: EventContext, services: ReactorServices | undefined,
|
|
90
|
+
handleResult: (value: unknown) => Promise<void>): Promise<void> {
|
|
91
|
+
await runActivated(artifact, async () => {
|
|
92
|
+
const result = await artifact.instance[methodName](content, context, services);
|
|
93
|
+
await handleResult(result);
|
|
94
|
+
}, { delivery: ArtifactDelivery.Events, eventContext: context, methodName });
|
|
95
|
+
}
|
|
@@ -72,6 +72,26 @@ export async function appendReactorSideEffects(
|
|
|
72
72
|
return noSideEffects;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
const events = normalizeReactorSideEffects(handlerResult, triggeringEventSourceId,
|
|
76
|
+
triggeringEventStreamType, triggeringEventStreamId);
|
|
77
|
+
if (events.length === 0) {
|
|
78
|
+
return noSideEffects;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const results = await eventLog.appendMany(events);
|
|
82
|
+
const errors = results
|
|
83
|
+
.filter(result => !result.isSuccess)
|
|
84
|
+
.flatMap(result => [
|
|
85
|
+
...result.constraintViolations.map(violation => violation.message),
|
|
86
|
+
...result.errors.map(error => error.message)
|
|
87
|
+
]);
|
|
88
|
+
|
|
89
|
+
return { isSuccess: errors.length === 0, errors };
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Production return-shape normalization; unknown values are ignored by production dispatch. */
|
|
93
|
+
export function normalizeReactorSideEffects(handlerResult: unknown, triggeringEventSourceId: string,
|
|
94
|
+
triggeringEventStreamType: string, triggeringEventStreamId: string): EventForEventSourceId[] {
|
|
75
95
|
const items = Array.isArray(handlerResult) ? handlerResult : [handlerResult];
|
|
76
96
|
const events: EventForEventSourceId[] = [];
|
|
77
97
|
|
|
@@ -92,17 +112,5 @@ export async function appendReactorSideEffects(
|
|
|
92
112
|
// silently ignored, the same as a handler that returns Task/void.
|
|
93
113
|
}
|
|
94
114
|
|
|
95
|
-
|
|
96
|
-
return noSideEffects;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const results = await eventLog.appendMany(events);
|
|
100
|
-
const errors = results
|
|
101
|
-
.filter(result => !result.isSuccess)
|
|
102
|
-
.flatMap(result => [
|
|
103
|
-
...result.constraintViolations.map(violation => violation.message),
|
|
104
|
-
...result.errors.map(error => error.message)
|
|
105
|
-
]);
|
|
106
|
-
|
|
107
|
-
return { isSuccess: errors.length === 0, errors };
|
|
115
|
+
return events;
|
|
108
116
|
}
|