@cratis/chronicle 6.62.0 → 6.64.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/ChronicleClient.ts +86 -3
- package/artifacts/DefaultClientArtifactsProvider.ts +5 -0
- package/artifacts/IClientArtifactsProvider.ts +3 -0
- package/connection/ConnectionLifecycle.ts +42 -1
- package/dist/ChronicleClient.d.ts +28 -1
- package/dist/ChronicleClient.d.ts.map +1 -1
- package/dist/ChronicleClient.js +71 -3
- package/dist/ChronicleClient.js.map +1 -1
- package/dist/artifacts/DefaultClientArtifactsProvider.d.ts +2 -0
- package/dist/artifacts/DefaultClientArtifactsProvider.d.ts.map +1 -1
- package/dist/artifacts/DefaultClientArtifactsProvider.js +4 -0
- package/dist/artifacts/DefaultClientArtifactsProvider.js.map +1 -1
- package/dist/artifacts/IClientArtifactsProvider.d.ts +2 -0
- package/dist/artifacts/IClientArtifactsProvider.d.ts.map +1 -1
- package/dist/connection/ConnectionLifecycle.d.ts +24 -0
- package/dist/connection/ConnectionLifecycle.d.ts.map +1 -1
- package/dist/connection/ConnectionLifecycle.js +40 -1
- package/dist/connection/ConnectionLifecycle.js.map +1 -1
- package/dist/observation/ObservationReconnectBackoff.d.ts +64 -0
- package/dist/observation/ObservationReconnectBackoff.d.ts.map +1 -0
- package/dist/observation/ObservationReconnectBackoff.js +75 -0
- package/dist/observation/ObservationReconnectBackoff.js.map +1 -0
- package/dist/observation/ObservationStreamOutcome.d.ts +10 -0
- package/dist/observation/ObservationStreamOutcome.d.ts.map +1 -0
- package/dist/observation/ObservationStreamOutcome.js +4 -0
- package/dist/observation/ObservationStreamOutcome.js.map +1 -0
- package/dist/observation/classifyStreamError.d.ts +25 -0
- package/dist/observation/classifyStreamError.d.ts.map +1 -0
- package/dist/observation/classifyStreamError.js +55 -0
- package/dist/observation/classifyStreamError.js.map +1 -0
- package/dist/observation/for_ObservationReconnectBackoff/given/a_backoff.d.ts +13 -0
- package/dist/observation/for_ObservationReconnectBackoff/given/a_backoff.d.ts.map +1 -0
- package/dist/observation/for_ObservationReconnectBackoff/given/a_backoff.js +25 -0
- package/dist/observation/for_ObservationReconnectBackoff/given/a_backoff.js.map +1 -0
- package/dist/observation/for_ObservationReconnectBackoff/given/a_scripted_stream.d.ts +27 -0
- package/dist/observation/for_ObservationReconnectBackoff/given/a_scripted_stream.d.ts.map +1 -0
- package/dist/observation/for_ObservationReconnectBackoff/given/a_scripted_stream.js +36 -0
- package/dist/observation/for_ObservationReconnectBackoff/given/a_scripted_stream.js.map +1 -0
- package/dist/projections/for_Graphs/given/a_discovered_graph.d.ts +2 -1
- package/dist/projections/for_Graphs/given/a_discovered_graph.d.ts.map +1 -1
- package/dist/projections/for_Graphs/given/a_discovered_graph.js +3 -2
- package/dist/projections/for_Graphs/given/a_discovered_graph.js.map +1 -1
- package/dist/projections/for_Graphs/given/a_graph_with_views.d.ts +40 -0
- package/dist/projections/for_Graphs/given/a_graph_with_views.d.ts.map +1 -0
- package/dist/projections/for_Graphs/given/a_graph_with_views.js +80 -0
- package/dist/projections/for_Graphs/given/a_graph_with_views.js.map +1 -0
- package/dist/projections/for_Graphs/given/organization.d.ts +2 -1
- package/dist/projections/for_Graphs/given/organization.d.ts.map +1 -1
- package/dist/projections/for_Graphs/given/organization.js +3 -2
- package/dist/projections/for_Graphs/given/organization.js.map +1 -1
- package/dist/projections/graphs/Graphs.d.ts +5 -0
- package/dist/projections/graphs/Graphs.d.ts.map +1 -1
- package/dist/projections/graphs/Graphs.js +43 -0
- package/dist/projections/graphs/Graphs.js.map +1 -1
- package/dist/projections/graphs/IGraphs.d.ts +9 -2
- package/dist/projections/graphs/IGraphs.d.ts.map +1 -1
- package/dist/projections/graphs/index.d.ts +1 -0
- package/dist/projections/graphs/index.d.ts.map +1 -1
- package/dist/projections/graphs/index.js +1 -0
- package/dist/projections/graphs/index.js.map +1 -1
- package/dist/projections/graphs/views/AmbiguousDirection.d.ts +16 -0
- package/dist/projections/graphs/views/AmbiguousDirection.d.ts.map +1 -0
- package/dist/projections/graphs/views/AmbiguousDirection.js +21 -0
- package/dist/projections/graphs/views/AmbiguousDirection.js.map +1 -0
- package/dist/projections/graphs/views/DuplicateViewName.d.ts +16 -0
- package/dist/projections/graphs/views/DuplicateViewName.d.ts.map +1 -0
- package/dist/projections/graphs/views/DuplicateViewName.js +21 -0
- package/dist/projections/graphs/views/DuplicateViewName.js.map +1 -0
- package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.d.ts +17 -0
- package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.d.ts.map +1 -0
- package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.js +22 -0
- package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.js.map +1 -0
- package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.d.ts +14 -0
- package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.d.ts.map +1 -0
- package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.js +19 -0
- package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.js.map +1 -0
- package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.d.ts +15 -0
- package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.d.ts.map +1 -0
- package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.js +20 -0
- package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.js.map +1 -0
- package/dist/projections/graphs/views/FollowsOptions.d.ts +16 -0
- package/dist/projections/graphs/views/FollowsOptions.d.ts.map +1 -0
- package/dist/projections/graphs/views/FollowsOptions.js +4 -0
- package/dist/projections/graphs/views/FollowsOptions.js.map +1 -0
- package/dist/projections/graphs/views/GraphEdgeDirection.d.ts +10 -0
- package/dist/projections/graphs/views/GraphEdgeDirection.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphEdgeDirection.js +13 -0
- package/dist/projections/graphs/views/GraphEdgeDirection.js.map +1 -0
- package/dist/projections/graphs/views/GraphView.d.ts +13 -0
- package/dist/projections/graphs/views/GraphView.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphView.js +4 -0
- package/dist/projections/graphs/views/GraphView.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewBuildResult.d.ts +15 -0
- package/dist/projections/graphs/views/GraphViewBuildResult.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewBuildResult.js +4 -0
- package/dist/projections/graphs/views/GraphViewBuildResult.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewCardinality.d.ts +10 -0
- package/dist/projections/graphs/views/GraphViewCardinality.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewCardinality.js +13 -0
- package/dist/projections/graphs/views/GraphViewCardinality.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewDefinition.d.ts +15 -0
- package/dist/projections/graphs/views/GraphViewDefinition.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewDefinition.js +4 -0
- package/dist/projections/graphs/views/GraphViewDefinition.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewDefinitionBuilder.d.ts +30 -0
- package/dist/projections/graphs/views/GraphViewDefinitionBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewDefinitionBuilder.js +259 -0
- package/dist/projections/graphs/views/GraphViewDefinitionBuilder.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewDefinitionSerializer.d.ts +21 -0
- package/dist/projections/graphs/views/GraphViewDefinitionSerializer.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewDefinitionSerializer.js +77 -0
- package/dist/projections/graphs/views/GraphViewDefinitionSerializer.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewEdgeReference.d.ts +6 -0
- package/dist/projections/graphs/views/GraphViewEdgeReference.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewEdgeReference.js +4 -0
- package/dist/projections/graphs/views/GraphViewEdgeReference.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewMember.d.ts +8 -0
- package/dist/projections/graphs/views/GraphViewMember.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewMember.js +4 -0
- package/dist/projections/graphs/views/GraphViewMember.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewMemberKind.d.ts +12 -0
- package/dist/projections/graphs/views/GraphViewMemberKind.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewMemberKind.js +15 -0
- package/dist/projections/graphs/views/GraphViewMemberKind.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewMemberMetadata.d.ts +22 -0
- package/dist/projections/graphs/views/GraphViewMemberMetadata.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewMemberMetadata.js +4 -0
- package/dist/projections/graphs/views/GraphViewMemberMetadata.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewPropertyMember.d.ts +13 -0
- package/dist/projections/graphs/views/GraphViewPropertyMember.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewPropertyMember.js +4 -0
- package/dist/projections/graphs/views/GraphViewPropertyMember.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewReason.d.ts +33 -0
- package/dist/projections/graphs/views/GraphViewReason.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewReason.js +36 -0
- package/dist/projections/graphs/views/GraphViewReason.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewRelationMember.d.ts +21 -0
- package/dist/projections/graphs/views/GraphViewRelationMember.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewRelationMember.js +4 -0
- package/dist/projections/graphs/views/GraphViewRelationMember.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewSchema.d.ts +10 -0
- package/dist/projections/graphs/views/GraphViewSchema.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewSchema.js +4 -0
- package/dist/projections/graphs/views/GraphViewSchema.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewSchemaEdge.d.ts +14 -0
- package/dist/projections/graphs/views/GraphViewSchemaEdge.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewSchemaEdge.js +4 -0
- package/dist/projections/graphs/views/GraphViewSchemaEdge.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewSchemaNode.d.ts +10 -0
- package/dist/projections/graphs/views/GraphViewSchemaNode.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewSchemaNode.js +4 -0
- package/dist/projections/graphs/views/GraphViewSchemaNode.js.map +1 -0
- package/dist/projections/graphs/views/GraphViewSerializerOptions.d.ts +9 -0
- package/dist/projections/graphs/views/GraphViewSerializerOptions.d.ts.map +1 -0
- package/dist/projections/graphs/views/GraphViewSerializerOptions.js +4 -0
- package/dist/projections/graphs/views/GraphViewSerializerOptions.js.map +1 -0
- package/dist/projections/graphs/views/RecursiveView.d.ts +15 -0
- package/dist/projections/graphs/views/RecursiveView.d.ts.map +1 -0
- package/dist/projections/graphs/views/RecursiveView.js +20 -0
- package/dist/projections/graphs/views/RecursiveView.js.map +1 -0
- package/dist/projections/graphs/views/RelationTargetNotAView.d.ts +16 -0
- package/dist/projections/graphs/views/RelationTargetNotAView.d.ts.map +1 -0
- package/dist/projections/graphs/views/RelationTargetNotAView.js +21 -0
- package/dist/projections/graphs/views/RelationTargetNotAView.js.map +1 -0
- package/dist/projections/graphs/views/TargetLabelMismatch.d.ts +18 -0
- package/dist/projections/graphs/views/TargetLabelMismatch.d.ts.map +1 -0
- package/dist/projections/graphs/views/TargetLabelMismatch.js +23 -0
- package/dist/projections/graphs/views/TargetLabelMismatch.js.map +1 -0
- package/dist/projections/graphs/views/UnknownEdge.d.ts +16 -0
- package/dist/projections/graphs/views/UnknownEdge.d.ts.map +1 -0
- package/dist/projections/graphs/views/UnknownEdge.js +21 -0
- package/dist/projections/graphs/views/UnknownEdge.js.map +1 -0
- package/dist/projections/graphs/views/UnknownEdgeProperty.d.ts +17 -0
- package/dist/projections/graphs/views/UnknownEdgeProperty.d.ts.map +1 -0
- package/dist/projections/graphs/views/UnknownEdgeProperty.js +22 -0
- package/dist/projections/graphs/views/UnknownEdgeProperty.js.map +1 -0
- package/dist/projections/graphs/views/UnknownNodeProperty.d.ts +17 -0
- package/dist/projections/graphs/views/UnknownNodeProperty.d.ts.map +1 -0
- package/dist/projections/graphs/views/UnknownNodeProperty.js +22 -0
- package/dist/projections/graphs/views/UnknownNodeProperty.js.map +1 -0
- package/dist/projections/graphs/views/ViewIsAlsoSchema.d.ts +14 -0
- package/dist/projections/graphs/views/ViewIsAlsoSchema.d.ts.map +1 -0
- package/dist/projections/graphs/views/ViewIsAlsoSchema.js +19 -0
- package/dist/projections/graphs/views/ViewIsAlsoSchema.js.map +1 -0
- package/dist/projections/graphs/views/ViewOfMetadata.d.ts +8 -0
- package/dist/projections/graphs/views/ViewOfMetadata.d.ts.map +1 -0
- package/dist/projections/graphs/views/ViewOfMetadata.js +4 -0
- package/dist/projections/graphs/views/ViewOfMetadata.js.map +1 -0
- package/dist/projections/graphs/views/ViewOfOptions.d.ts +6 -0
- package/dist/projections/graphs/views/ViewOfOptions.d.ts.map +1 -0
- package/dist/projections/graphs/views/ViewOfOptions.js +4 -0
- package/dist/projections/graphs/views/ViewOfOptions.js.map +1 -0
- package/dist/projections/graphs/views/ViewRootNotANode.d.ts +16 -0
- package/dist/projections/graphs/views/ViewRootNotANode.d.ts.map +1 -0
- package/dist/projections/graphs/views/ViewRootNotANode.js +21 -0
- package/dist/projections/graphs/views/ViewRootNotANode.js.map +1 -0
- package/dist/projections/graphs/views/declareGraphViewMember.d.ts +17 -0
- package/dist/projections/graphs/views/declareGraphViewMember.d.ts.map +1 -0
- package/dist/projections/graphs/views/declareGraphViewMember.js +31 -0
- package/dist/projections/graphs/views/declareGraphViewMember.js.map +1 -0
- package/dist/projections/graphs/views/follows.d.ts +13 -0
- package/dist/projections/graphs/views/follows.d.ts.map +1 -0
- package/dist/projections/graphs/views/follows.js +24 -0
- package/dist/projections/graphs/views/follows.js.map +1 -0
- package/dist/projections/graphs/views/fromEdge.d.ts +10 -0
- package/dist/projections/graphs/views/fromEdge.d.ts.map +1 -0
- package/dist/projections/graphs/views/fromEdge.js +15 -0
- package/dist/projections/graphs/views/fromEdge.js.map +1 -0
- package/dist/projections/graphs/views/index.d.ts +41 -0
- package/dist/projections/graphs/views/index.d.ts.map +1 -0
- package/dist/projections/graphs/views/index.js +28 -0
- package/dist/projections/graphs/views/index.js.map +1 -0
- package/dist/projections/graphs/views/viewKey.d.ts +8 -0
- package/dist/projections/graphs/views/viewKey.d.ts.map +1 -0
- package/dist/projections/graphs/views/viewKey.js +13 -0
- package/dist/projections/graphs/views/viewKey.js.map +1 -0
- package/dist/projections/graphs/views/viewOf.d.ts +22 -0
- package/dist/projections/graphs/views/viewOf.d.ts.map +1 -0
- package/dist/projections/graphs/views/viewOf.js +41 -0
- package/dist/projections/graphs/views/viewOf.js.map +1 -0
- package/dist/projections/graphs/views/viewProperty.d.ts +9 -0
- package/dist/projections/graphs/views/viewProperty.d.ts.map +1 -0
- package/dist/projections/graphs/views/viewProperty.js +14 -0
- package/dist/projections/graphs/views/viewProperty.js.map +1 -0
- package/dist/reactors/Reactors.d.ts +15 -5
- package/dist/reactors/Reactors.d.ts.map +1 -1
- package/dist/reactors/Reactors.js +95 -18
- package/dist/reactors/Reactors.js.map +1 -1
- package/dist/reactors/for_Reactors/when_reconnecting_the_observation_stream/given/a_reactor_whose_stream_ends.d.ts +26 -0
- package/dist/reactors/for_Reactors/when_reconnecting_the_observation_stream/given/a_reactor_whose_stream_ends.d.ts.map +1 -0
- package/dist/reactors/for_Reactors/when_reconnecting_the_observation_stream/given/a_reactor_whose_stream_ends.js +64 -0
- package/dist/reactors/for_Reactors/when_reconnecting_the_observation_stream/given/a_reactor_whose_stream_ends.js.map +1 -0
- package/dist/reducers/Reducers.d.ts +11 -5
- package/dist/reducers/Reducers.d.ts.map +1 -1
- package/dist/reducers/Reducers.js +93 -19
- package/dist/reducers/Reducers.js.map +1 -1
- package/dist/reducers/for_Reducers/when_reconnecting_the_observation_stream/given/a_reducer_whose_stream_ends.d.ts +25 -0
- package/dist/reducers/for_Reducers/when_reconnecting_the_observation_stream/given/a_reducer_whose_stream_ends.d.ts.map +1 -0
- package/dist/reducers/for_Reducers/when_reconnecting_the_observation_stream/given/a_reducer_whose_stream_ends.js +70 -0
- package/dist/reducers/for_Reducers/when_reconnecting_the_observation_stream/given/a_reducer_whose_stream_ends.js.map +1 -0
- package/dist/testing/InProcessAppendMetadata.d.ts +30 -0
- package/dist/testing/InProcessAppendMetadata.d.ts.map +1 -0
- package/dist/testing/InProcessAppendMetadata.js +107 -0
- package/dist/testing/InProcessAppendMetadata.js.map +1 -0
- package/dist/testing/InProcessBatchAppend.d.ts +62 -0
- package/dist/testing/InProcessBatchAppend.d.ts.map +1 -0
- package/dist/testing/InProcessBatchAppend.js +131 -0
- package/dist/testing/InProcessBatchAppend.js.map +1 -0
- package/dist/testing/InProcessEventPayload.d.ts +23 -0
- package/dist/testing/InProcessEventPayload.d.ts.map +1 -0
- package/dist/testing/InProcessEventPayload.js +94 -0
- package/dist/testing/InProcessEventPayload.js.map +1 -0
- package/dist/testing/InProcessEventReadCriteria.d.ts +9 -0
- package/dist/testing/InProcessEventReadCriteria.d.ts.map +1 -0
- package/dist/testing/InProcessEventReadCriteria.js +4 -0
- package/dist/testing/InProcessEventReadCriteria.js.map +1 -0
- package/dist/testing/InProcessEventReadFilter.d.ts +14 -0
- package/dist/testing/InProcessEventReadFilter.d.ts.map +1 -0
- package/dist/testing/InProcessEventReadFilter.js +31 -0
- package/dist/testing/InProcessEventReadFilter.js.map +1 -0
- package/dist/testing/InProcessEventSequence.d.ts +8 -5
- package/dist/testing/InProcessEventSequence.d.ts.map +1 -1
- package/dist/testing/InProcessEventSequence.js +59 -275
- package/dist/testing/InProcessEventSequence.js.map +1 -1
- package/dist/testing/InProcessEventSequenceEnvironment.d.ts +13 -0
- package/dist/testing/InProcessEventSequenceEnvironment.d.ts.map +1 -0
- package/dist/testing/InProcessEventSequenceEnvironment.js +4 -0
- package/dist/testing/InProcessEventSequenceEnvironment.js.map +1 -0
- package/dist/testing/InProcessSingleAppend.d.ts +34 -0
- package/dist/testing/InProcessSingleAppend.d.ts.map +1 -0
- package/dist/testing/InProcessSingleAppend.js +95 -0
- package/dist/testing/InProcessSingleAppend.js.map +1 -0
- package/dist/testing/projections/ProjectionCapabilities.d.ts +0 -8
- package/dist/testing/projections/ProjectionCapabilities.d.ts.map +1 -1
- package/dist/testing/projections/ProjectionCapabilities.js +21 -312
- package/dist/testing/projections/ProjectionCapabilities.js.map +1 -1
- package/dist/testing/projections/ProjectionCapabilityReject.d.ts +3 -0
- package/dist/testing/projections/ProjectionCapabilityReject.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionCapabilityReject.js +4 -0
- package/dist/testing/projections/ProjectionCapabilityReject.js.map +1 -0
- package/dist/testing/projections/ProjectionCapabilityReporter.d.ts +12 -0
- package/dist/testing/projections/ProjectionCapabilityReporter.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionCapabilityReporter.js +33 -0
- package/dist/testing/projections/ProjectionCapabilityReporter.js.map +1 -0
- package/dist/testing/projections/ProjectionDefinitionCapabilities.d.ts +11 -0
- package/dist/testing/projections/ProjectionDefinitionCapabilities.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionDefinitionCapabilities.js +45 -0
- package/dist/testing/projections/ProjectionDefinitionCapabilities.js.map +1 -0
- package/dist/testing/projections/ProjectionEventSchemaResolver.d.ts +13 -0
- package/dist/testing/projections/ProjectionEventSchemaResolver.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionEventSchemaResolver.js +22 -0
- package/dist/testing/projections/ProjectionEventSchemaResolver.js.map +1 -0
- package/dist/testing/projections/ProjectionExpressionCapabilities.d.ts +19 -0
- package/dist/testing/projections/ProjectionExpressionCapabilities.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionExpressionCapabilities.js +103 -0
- package/dist/testing/projections/ProjectionExpressionCapabilities.js.map +1 -0
- package/dist/testing/projections/ProjectionInitialValueCapabilities.d.ts +16 -0
- package/dist/testing/projections/ProjectionInitialValueCapabilities.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionInitialValueCapabilities.js +72 -0
- package/dist/testing/projections/ProjectionInitialValueCapabilities.js.map +1 -0
- package/dist/testing/projections/ProjectionMappingCapabilities.d.ts +21 -0
- package/dist/testing/projections/ProjectionMappingCapabilities.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionMappingCapabilities.js +86 -0
- package/dist/testing/projections/ProjectionMappingCapabilities.js.map +1 -0
- package/dist/testing/projections/ProjectionMappingValidation.d.ts +9 -0
- package/dist/testing/projections/ProjectionMappingValidation.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionMappingValidation.js +4 -0
- package/dist/testing/projections/ProjectionMappingValidation.js.map +1 -0
- package/dist/testing/projections/ProjectionReadModelCapabilities.d.ts +11 -0
- package/dist/testing/projections/ProjectionReadModelCapabilities.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionReadModelCapabilities.js +40 -0
- package/dist/testing/projections/ProjectionReadModelCapabilities.js.map +1 -0
- package/dist/testing/projections/ProjectionRootCapabilities.d.ts +20 -0
- package/dist/testing/projections/ProjectionRootCapabilities.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionRootCapabilities.js +73 -0
- package/dist/testing/projections/ProjectionRootCapabilities.js.map +1 -0
- package/dist/testing/projections/ProjectionScalarConverter.d.ts +21 -0
- package/dist/testing/projections/ProjectionScalarConverter.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionScalarConverter.js +105 -0
- package/dist/testing/projections/ProjectionScalarConverter.js.map +1 -0
- package/dist/testing/projections/ProjectionSchemaCapabilities.d.ts +26 -0
- package/dist/testing/projections/ProjectionSchemaCapabilities.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionSchemaCapabilities.js +109 -0
- package/dist/testing/projections/ProjectionSchemaCapabilities.js.map +1 -0
- package/dist/testing/projections/ProjectionValueConverter.d.ts +5 -0
- package/dist/testing/projections/ProjectionValueConverter.d.ts.map +1 -1
- package/dist/testing/projections/ProjectionValueConverter.js +36 -84
- package/dist/testing/projections/ProjectionValueConverter.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/DecoratorType.d.ts +3 -1
- package/dist/types/DecoratorType.d.ts.map +1 -1
- package/dist/types/DecoratorType.js +2 -0
- package/dist/types/DecoratorType.js.map +1 -1
- package/for_ChronicleClient/when_reconnecting/and_an_observation_stream_lost_its_session.spec.ts +212 -0
- package/observation/ObservationReconnectBackoff.ts +109 -0
- package/observation/ObservationStreamOutcome.ts +12 -0
- package/observation/classifyStreamError.ts +67 -0
- package/observation/for_ObservationReconnectBackoff/given/a_backoff.ts +29 -0
- package/observation/for_ObservationReconnectBackoff/given/a_scripted_stream.ts +52 -0
- package/observation/for_ObservationReconnectBackoff/when_a_stream_delivered_before_it_ended.spec.ts +23 -0
- package/observation/for_ObservationReconnectBackoff/when_a_stream_stayed_open_before_it_ended.spec.ts +25 -0
- package/observation/for_ObservationReconnectBackoff/when_jittering_the_delay.spec.ts +24 -0
- package/observation/for_ObservationReconnectBackoff/when_streams_keep_ending_without_working.spec.ts +24 -0
- package/observation/for_ObservationReconnectBackoff/when_the_base_delay_is_not_positive.spec.ts +18 -0
- package/observation/for_ObservationReconnectBackoff/when_the_settings_are_not_finite.spec.ts +32 -0
- package/observation/for_ObservationReconnectBackoff/when_using_the_defaults.spec.ts +29 -0
- package/observation/for_classifyStreamError/when_classifying_a_stream_error.spec.ts +36 -0
- package/package.json +2 -2
- package/projections/for_Graphs/given/a_discovered_graph.ts +3 -2
- package/projections/for_Graphs/given/a_graph_with_views.ts +91 -0
- package/projections/for_Graphs/given/organization.ts +3 -2
- package/projections/for_Graphs/given/organization_with_views.fixture.ts +129 -0
- package/projections/for_Graphs/when_building_graph_views.spec.ts +218 -0
- package/projections/for_Graphs/when_declaring_an_invalid_graph_view.spec.ts +229 -0
- package/projections/for_Graphs/when_declaring_graph_views.standard.spec.ts +49 -0
- package/projections/for_Graphs/when_discovering_graph_views.spec.ts +58 -0
- package/projections/graphs/Graphs.ts +44 -0
- package/projections/graphs/IGraphs.ts +10 -2
- package/projections/graphs/index.ts +1 -0
- package/projections/graphs/views/AmbiguousDirection.ts +23 -0
- package/projections/graphs/views/DuplicateViewName.ts +23 -0
- package/projections/graphs/views/EdgeNotIncidentOnRoot.ts +24 -0
- package/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.ts +21 -0
- package/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.ts +22 -0
- package/projections/graphs/views/FollowsOptions.ts +20 -0
- package/projections/graphs/views/GraphEdgeDirection.ts +13 -0
- package/projections/graphs/views/GraphView.ts +18 -0
- package/projections/graphs/views/GraphViewBuildResult.ts +19 -0
- package/projections/graphs/views/GraphViewCardinality.ts +13 -0
- package/projections/graphs/views/GraphViewDefinition.ts +20 -0
- package/projections/graphs/views/GraphViewDefinitionBuilder.ts +322 -0
- package/projections/graphs/views/GraphViewDefinitionSerializer.ts +90 -0
- package/projections/graphs/views/GraphViewEdgeReference.ts +8 -0
- package/projections/graphs/views/GraphViewMember.ts +11 -0
- package/projections/graphs/views/GraphViewMemberKind.ts +16 -0
- package/projections/graphs/views/GraphViewMemberMetadata.ts +31 -0
- package/projections/graphs/views/GraphViewPropertyMember.ts +18 -0
- package/projections/graphs/views/GraphViewReason.ts +47 -0
- package/projections/graphs/views/GraphViewRelationMember.ts +29 -0
- package/projections/graphs/views/GraphViewSchema.ts +14 -0
- package/projections/graphs/views/GraphViewSchemaEdge.ts +20 -0
- package/projections/graphs/views/GraphViewSchemaNode.ts +14 -0
- package/projections/graphs/views/GraphViewSerializerOptions.ts +11 -0
- package/projections/graphs/views/RecursiveView.ts +22 -0
- package/projections/graphs/views/RelationTargetNotAView.ts +23 -0
- package/projections/graphs/views/TargetLabelMismatch.ts +25 -0
- package/projections/graphs/views/UnknownEdge.ts +23 -0
- package/projections/graphs/views/UnknownEdgeProperty.ts +24 -0
- package/projections/graphs/views/UnknownNodeProperty.ts +24 -0
- package/projections/graphs/views/ViewIsAlsoSchema.ts +21 -0
- package/projections/graphs/views/ViewOfMetadata.ts +11 -0
- package/projections/graphs/views/ViewOfOptions.ts +8 -0
- package/projections/graphs/views/ViewRootNotANode.ts +23 -0
- package/projections/graphs/views/declareGraphViewMember.ts +36 -0
- package/projections/graphs/views/follows.ts +28 -0
- package/projections/graphs/views/fromEdge.ts +17 -0
- package/projections/graphs/views/index.ts +43 -0
- package/projections/graphs/views/viewKey.ts +15 -0
- package/projections/graphs/views/viewOf.ts +50 -0
- package/projections/graphs/views/viewProperty.ts +16 -0
- package/reactors/Reactors.ts +101 -18
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/and_a_handler_failed_with_a_lost_session.spec.ts +32 -0
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/and_a_replaced_stream_fails_late.spec.ts +28 -0
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/and_a_stream_delivered_before_it_ended.spec.ts +24 -0
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/and_a_stream_stayed_open_before_it_ended.spec.ts +23 -0
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/and_it_is_disposed_while_waiting_to_reopen.spec.ts +27 -0
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/and_streams_keep_ending_without_working.spec.ts +24 -0
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/and_the_client_reconnected_after_streams_kept_ending.spec.ts +24 -0
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/and_the_client_reconnected_while_waiting_to_reopen.spec.ts +25 -0
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/and_the_kernel_lost_the_session.spec.ts +24 -0
- package/reactors/for_Reactors/when_reconnecting_the_observation_stream/given/a_reactor_whose_stream_ends.ts +69 -0
- package/reducers/Reducers.ts +99 -19
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/and_a_reducer_failed_with_a_lost_session.spec.ts +33 -0
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/and_a_replaced_stream_fails_late.spec.ts +28 -0
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/and_a_stream_delivered_before_it_ended.spec.ts +24 -0
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/and_a_stream_stayed_open_before_it_ended.spec.ts +23 -0
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/and_it_is_disposed_while_waiting_to_reopen.spec.ts +27 -0
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/and_streams_keep_ending_without_working.spec.ts +24 -0
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/and_the_client_reconnected_after_streams_kept_ending.spec.ts +24 -0
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/and_the_client_reconnected_while_waiting_to_reopen.spec.ts +25 -0
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/and_the_kernel_lost_the_session.spec.ts +24 -0
- package/reducers/for_Reducers/when_reconnecting_the_observation_stream/given/a_reducer_whose_stream_ends.ts +69 -0
- package/testing/InProcessAppendMetadata.ts +119 -0
- package/testing/InProcessBatchAppend.ts +142 -0
- package/testing/InProcessEventPayload.ts +100 -0
- package/testing/InProcessEventReadCriteria.ts +11 -0
- package/testing/InProcessEventReadFilter.ts +37 -0
- package/testing/InProcessEventSequence.ts +63 -257
- package/testing/InProcessEventSequenceEnvironment.ts +16 -0
- package/testing/InProcessSingleAppend.ts +99 -0
- package/testing/for_InProcessEventSequence/when_preserving_validation_and_commit_order.spec.ts +95 -0
- package/testing/projections/ProjectionCapabilities.ts +23 -279
- package/testing/projections/ProjectionCapabilityReject.ts +5 -0
- package/testing/projections/ProjectionCapabilityReporter.ts +31 -0
- package/testing/projections/ProjectionDefinitionCapabilities.ts +45 -0
- package/testing/projections/ProjectionEventSchemaResolver.ts +23 -0
- package/testing/projections/ProjectionExpressionCapabilities.ts +101 -0
- package/testing/projections/ProjectionInitialValueCapabilities.ts +73 -0
- package/testing/projections/ProjectionMappingCapabilities.ts +85 -0
- package/testing/projections/ProjectionMappingValidation.ts +12 -0
- package/testing/projections/ProjectionReadModelCapabilities.ts +42 -0
- package/testing/projections/ProjectionRootCapabilities.ts +75 -0
- package/testing/projections/ProjectionScalarConverter.ts +106 -0
- package/testing/projections/ProjectionSchemaCapabilities.ts +112 -0
- package/testing/projections/ProjectionValueConverter.ts +37 -76
- package/testing/projections/for_ProjectionCapabilities/when_reporting_the_first_unsupported_operation.spec.ts +74 -0
- package/testing/projections/for_ProjectionValueConverter/when_converting_structured_and_scalar_values.spec.ts +64 -0
- package/types/DecoratorType.ts +4 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { AppendedEvent } from '../events/AppendedEvent.js';
|
|
2
|
+
import type { AppendOptions } from '../eventSequences/AppendOptions.js';
|
|
3
|
+
import type { AppendResult } from '../eventSequences/AppendResult.js';
|
|
4
|
+
import type { EventForEventSourceId } from '../eventSequences/EventForEventSourceId.js';
|
|
5
|
+
import { EventSequenceNumber } from '../eventSequences/EventSequenceNumber.js';
|
|
6
|
+
import { InProcessEventPayload } from './InProcessEventPayload.js';
|
|
7
|
+
import type { InProcessEventSequenceEnvironment } from './InProcessEventSequenceEnvironment.js';
|
|
8
|
+
/** Stages a complete batch; the sequence alone decides whether to commit it. */
|
|
9
|
+
export declare class InProcessBatchAppend {
|
|
10
|
+
private readonly environment;
|
|
11
|
+
private readonly payload;
|
|
12
|
+
private readonly success;
|
|
13
|
+
private readonly metadata;
|
|
14
|
+
constructor(environment: InProcessEventSequenceEnvironment, payload: InProcessEventPayload, success: (sequence: EventSequenceNumber, artifact: string) => AppendResult);
|
|
15
|
+
prepare(sourceOrEvents: string | EventForEventSourceId[], eventsOrOptions: object[] | AppendOptions | undefined, options: AppendOptions | undefined, position: number): {
|
|
16
|
+
prepared: {
|
|
17
|
+
eventsForEventSourceIds: EventForEventSourceId[];
|
|
18
|
+
appendOptions: AppendOptions | undefined;
|
|
19
|
+
correlationId: import("@cratis/fundamentals").Guid;
|
|
20
|
+
batchCausationChain: readonly import("../index.js").Causation[];
|
|
21
|
+
identity: import("../index.js").Identity;
|
|
22
|
+
concurrencyScopes: Map<string, import("../index.js").ConcurrencyScope | undefined>;
|
|
23
|
+
eventsToAppend: {
|
|
24
|
+
EventSourceType: string | undefined;
|
|
25
|
+
EventSourceId: string;
|
|
26
|
+
EventStreamType: string | undefined;
|
|
27
|
+
EventStreamId: string | undefined;
|
|
28
|
+
EventType: {
|
|
29
|
+
Id: string;
|
|
30
|
+
Generation: number;
|
|
31
|
+
Tombstone: boolean;
|
|
32
|
+
};
|
|
33
|
+
Content: string;
|
|
34
|
+
Tags: string[];
|
|
35
|
+
Occurred: {
|
|
36
|
+
Value: string;
|
|
37
|
+
} | undefined;
|
|
38
|
+
Subject: string;
|
|
39
|
+
}[];
|
|
40
|
+
namedTags: import("../index.js").NamedTag[][];
|
|
41
|
+
};
|
|
42
|
+
staged: {
|
|
43
|
+
stored: AppendedEvent<Record<string, unknown>>;
|
|
44
|
+
result: AppendResult;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
private validateEntries;
|
|
48
|
+
private sharedOccurrence;
|
|
49
|
+
private array;
|
|
50
|
+
private serialize;
|
|
51
|
+
private options;
|
|
52
|
+
private withCorrelation;
|
|
53
|
+
private context;
|
|
54
|
+
private batchContext;
|
|
55
|
+
private stage;
|
|
56
|
+
private eventInstance;
|
|
57
|
+
private registeredEvent;
|
|
58
|
+
private route;
|
|
59
|
+
private routeIdentifier;
|
|
60
|
+
private tags;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=InProcessBatchAppend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InProcessBatchAppend.d.ts","sourceRoot":"","sources":["../../testing/InProcessBatchAppend.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAIhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM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|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
import { EventObservationState } from '@cratis/chronicle.contracts';
|
|
4
|
+
import { getEventTypeFor } from '../events/eventTypeDecorator.js';
|
|
5
|
+
import { Tag } from '../events/Tag.js';
|
|
6
|
+
import { EventSequenceNumber } from '../eventSequences/EventSequenceNumber.js';
|
|
7
|
+
import { prepareBatchAppend } from '../eventSequences/prepareBatchAppend.js';
|
|
8
|
+
import { InProcessAppendMetadata } from './InProcessAppendMetadata.js';
|
|
9
|
+
import { UnsupportedEventSequenceOperation } from './UnsupportedEventSequenceOperation.js';
|
|
10
|
+
/** Stages a complete batch; the sequence alone decides whether to commit it. */
|
|
11
|
+
export class InProcessBatchAppend {
|
|
12
|
+
environment;
|
|
13
|
+
payload;
|
|
14
|
+
success;
|
|
15
|
+
metadata;
|
|
16
|
+
constructor(environment, payload, success) {
|
|
17
|
+
this.environment = environment;
|
|
18
|
+
this.payload = payload;
|
|
19
|
+
this.success = success;
|
|
20
|
+
this.metadata = new InProcessAppendMetadata(environment);
|
|
21
|
+
}
|
|
22
|
+
prepare(sourceOrEvents, eventsOrOptions, options, position) {
|
|
23
|
+
const entries = typeof sourceOrEvents === 'string' ? eventsOrOptions : sourceOrEvents;
|
|
24
|
+
const shared = typeof sourceOrEvents === 'string' ? options : eventsOrOptions;
|
|
25
|
+
this.validateEntries(entries, shared, typeof sourceOrEvents === 'string');
|
|
26
|
+
const prepared = this.serialize(sourceOrEvents, entries, shared);
|
|
27
|
+
this.metadata.guid(prepared.correlationId, 'appendMany.correlationId');
|
|
28
|
+
this.context(prepared, entries.length);
|
|
29
|
+
const staged = prepared.eventsForEventSourceIds.map((_, index) => this.stage(prepared, index, position));
|
|
30
|
+
return { prepared, staged };
|
|
31
|
+
}
|
|
32
|
+
validateEntries(entries, shared, sameSource) {
|
|
33
|
+
this.array(entries);
|
|
34
|
+
this.metadata.batch(shared);
|
|
35
|
+
this.sharedOccurrence(shared);
|
|
36
|
+
for (const entry of entries) {
|
|
37
|
+
if (sameSource)
|
|
38
|
+
break;
|
|
39
|
+
this.metadata.entry(entry);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
sharedOccurrence(shared) {
|
|
43
|
+
if (shared?.occurred !== undefined)
|
|
44
|
+
this.metadata.checkedDate(shared.occurred, 'appendMany.occurred');
|
|
45
|
+
}
|
|
46
|
+
array(entries) {
|
|
47
|
+
if (!Array.isArray(entries))
|
|
48
|
+
throw this.environment.unsupported('appendMany.arguments', this.environment.sequenceId, 'Events must be an array.');
|
|
49
|
+
if (!entries.length)
|
|
50
|
+
throw this.environment.unsupported('appendMany.empty', this.environment.sequenceId, 'The kernel rejects an empty batch.');
|
|
51
|
+
}
|
|
52
|
+
serialize(sourceOrEvents, entries, shared) {
|
|
53
|
+
try {
|
|
54
|
+
const batchOptions = this.options(shared);
|
|
55
|
+
if (batchOptions?.correlationId !== undefined)
|
|
56
|
+
this.metadata.guid(batchOptions.correlationId, 'appendMany.correlationId');
|
|
57
|
+
return typeof sourceOrEvents === 'string'
|
|
58
|
+
? prepareBatchAppend(sourceOrEvents, entries, batchOptions)
|
|
59
|
+
: prepareBatchAppend(sourceOrEvents, batchOptions);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (error instanceof UnsupportedEventSequenceOperation)
|
|
63
|
+
throw error;
|
|
64
|
+
throw this.environment.unsupported('appendMany.serialization', this.environment.sequenceId, `Batch preparation failed: ${String(error)}.`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
options(shared) {
|
|
68
|
+
return shared?.correlationId === undefined && this.environment.correlationId ? this.withCorrelation(shared) : shared;
|
|
69
|
+
}
|
|
70
|
+
withCorrelation(shared) {
|
|
71
|
+
const metadata = shared ?? {};
|
|
72
|
+
return { correlationId: this.environment.correlationId(), sourceType: metadata.sourceType, streamType: metadata.streamType,
|
|
73
|
+
streamId: metadata.streamId, subject: metadata.subject, occurred: metadata.occurred, tags: metadata.tags,
|
|
74
|
+
namedTags: metadata.namedTags };
|
|
75
|
+
}
|
|
76
|
+
context({ identity, batchCausationChain }, count) {
|
|
77
|
+
if (!this.metadata.ambientContext(identity, batchCausationChain) || !this.batchContext(batchCausationChain, count)) {
|
|
78
|
+
throw this.environment.unsupported('appendMany.context', this.environment.sequenceId, 'Ambient identity or causation metadata is not fixture-backed.');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
batchContext(chain, count) {
|
|
82
|
+
return chain[1].type.name === 'TypeScriptClient.AppendMany' && chain[1].properties.count === String(count);
|
|
83
|
+
}
|
|
84
|
+
stage(prepared, index, position) {
|
|
85
|
+
const { eventSourceId, event } = prepared.eventsForEventSourceIds[index];
|
|
86
|
+
this.eventInstance(event);
|
|
87
|
+
this.metadata.source(eventSourceId, 'appendMany.source');
|
|
88
|
+
const wire = prepared.eventsToAppend[index];
|
|
89
|
+
this.route(wire);
|
|
90
|
+
this.tags(wire, event);
|
|
91
|
+
const occurred = wire.Occurred ? this.metadata.checkedDate(new Date(wire.Occurred.Value), 'appendMany.occurred')
|
|
92
|
+
: this.metadata.checkedDate(this.environment.clock(), 'appendMany.clock');
|
|
93
|
+
const content = this.payload.checkedContent(event, wire.Content, 'appendMany.content');
|
|
94
|
+
const hash = this.payload.hash(wire.EventType.Id, eventSourceId, content);
|
|
95
|
+
const sequenceNumber = new EventSequenceNumber(BigInt(position + index));
|
|
96
|
+
const eventType = getEventTypeFor(event.constructor);
|
|
97
|
+
const stored = { eventType, content, context: {
|
|
98
|
+
eventStore: this.environment.store, namespace: this.environment.namespace, sequenceNumber: sequenceNumber.value, eventSourceId,
|
|
99
|
+
eventSourceType: wire.EventSourceType || 'Default', eventStreamType: wire.EventStreamType || 'All',
|
|
100
|
+
eventStreamId: wire.EventStreamId || 'Default', subject: this.metadata.storedSubject(wire.Subject, eventSourceId), hash, causedBy: prepared.identity,
|
|
101
|
+
observationState: EventObservationState.Initial, eventType, occurred, correlationId: prepared.correlationId.toString(),
|
|
102
|
+
causation: prepared.batchCausationChain.map(item => ({ type: item.type.name, occurred: item.occurred, properties: { ...item.properties } })),
|
|
103
|
+
tags: wire.Tags.map(tag => new Tag(tag)), namedTags: []
|
|
104
|
+
} };
|
|
105
|
+
return { stored, result: this.success(sequenceNumber, event.constructor.name) };
|
|
106
|
+
}
|
|
107
|
+
eventInstance(event) {
|
|
108
|
+
if (!this.registeredEvent(event)) {
|
|
109
|
+
throw this.environment.unsupported('appendMany.event', event?.constructor?.name ?? this.environment.sequenceId, 'Event is not in the selected catalog.');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
registeredEvent(event) {
|
|
113
|
+
return !!event && typeof event === 'object' && this.environment.catalog.has(event.constructor);
|
|
114
|
+
}
|
|
115
|
+
route(wire) {
|
|
116
|
+
for (const [name, value] of Object.entries({ sourceType: wire.EventSourceType, streamType: wire.EventStreamType, streamId: wire.EventStreamId })) {
|
|
117
|
+
if (value !== undefined && !this.routeIdentifier(value)) {
|
|
118
|
+
throw this.environment.unsupported(`appendMany.${name}`, String(value), 'Only simple metadata identifiers are fixture-backed.');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
routeIdentifier(value) {
|
|
123
|
+
return typeof value === 'string' && /^[A-Za-z0-9_-]*$/.test(value);
|
|
124
|
+
}
|
|
125
|
+
tags(wire, event) {
|
|
126
|
+
if (wire.Tags.some(tag => !/^[A-Za-z0-9_-]+$/.test(tag))) {
|
|
127
|
+
throw this.environment.unsupported('appendMany.tags', event.constructor.name, 'Only simple string tags are fixture-backed.');
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=InProcessBatchAppend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InProcessBatchAppend.js","sourceRoot":"","sources":["../../testing/InProcessBatchAppend.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAE,qBAAqB,EAAE,M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AC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtD,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,cAAc,IAAI,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,sDAAsD,CAAC,CAAC;YACpI,CAAC;QACL,CAAC;IACL,CAAC;IAEO,eAAe,CAAC,KAAc;QAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvE,CAAC;IAEO,IAAI,CAAC,IAAqE,EAAE,KAAa;QAC7F,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,iBAAiB,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,6CAA6C,CAAC,CAAC;QACjI,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AppendedEvent } from '../events/AppendedEvent.js';
|
|
2
|
+
import type { InProcessConstraints } from './InProcessConstraints.js';
|
|
3
|
+
import type { InProcessEventSequenceEnvironment } from './InProcessEventSequenceEnvironment.js';
|
|
4
|
+
/** Schema-bound payload validation, canonical hashing, and isolated history snapshots. */
|
|
5
|
+
export declare class InProcessEventPayload {
|
|
6
|
+
private readonly environment;
|
|
7
|
+
private readonly constraints?;
|
|
8
|
+
constructor(environment: InProcessEventSequenceEnvironment, constraints?: InProcessConstraints | undefined);
|
|
9
|
+
checkedContent(event: object, serialized: string, operation: string, mismatchReason?: string): Record<string, unknown>;
|
|
10
|
+
hash(typeId: string, source: string, content: Record<string, unknown>): string;
|
|
11
|
+
snapshot(event: AppendedEvent): AppendedEvent;
|
|
12
|
+
private parse;
|
|
13
|
+
private objectWithProperties;
|
|
14
|
+
private isObject;
|
|
15
|
+
private matchesProperties;
|
|
16
|
+
private matchesSchema;
|
|
17
|
+
private matchesProperty;
|
|
18
|
+
private matchesText;
|
|
19
|
+
private matchesConstraint;
|
|
20
|
+
private matchesConstrainedValue;
|
|
21
|
+
private serializedConcept;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=InProcessEventPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InProcessEventPayload.d.ts","sourceRoot":"","sources":["../../testing/InProcessEventPayload.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQhE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAEhG,0FAA0F;AAC1F,qBAAa,qBAAqB;IAClB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAAqC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAA1G,YAA6B,WAAW,EAAE,iCAAiC,EAAmB,WAAW,CAAC,EAAE,oBAAoB,YAAA,EAAI;IAEpI,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAC/D,cAAc,SAA2C,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQtF;IAED,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAG7E;IAED,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CAa5C;IAED,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,iBAAiB;CAI5B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { conceptAsTypeKey, JsonSerializer, typeKeyOf } from '@cratis/fundamentals';
|
|
5
|
+
import { EventType } from '../events/EventType.js';
|
|
6
|
+
import { EventTypeId } from '../events/EventTypeId.js';
|
|
7
|
+
import { EventTypeGeneration } from '../events/EventTypeGeneration.js';
|
|
8
|
+
import { Tag } from '../events/Tag.js';
|
|
9
|
+
import { Identity } from '../identity/Identity.js';
|
|
10
|
+
import { matchesEventField } from './EventFieldSchema.js';
|
|
11
|
+
/** Schema-bound payload validation, canonical hashing, and isolated history snapshots. */
|
|
12
|
+
export class InProcessEventPayload {
|
|
13
|
+
environment;
|
|
14
|
+
constraints;
|
|
15
|
+
constructor(environment, constraints) {
|
|
16
|
+
this.environment = environment;
|
|
17
|
+
this.constraints = constraints;
|
|
18
|
+
}
|
|
19
|
+
checkedContent(event, serialized, operation, mismatchReason = 'Content differs from the event schema.') {
|
|
20
|
+
const content = this.parse(serialized, event, operation);
|
|
21
|
+
const metadata = this.environment.catalog.get(event.constructor);
|
|
22
|
+
const properties = metadata.schema.properties;
|
|
23
|
+
if (!this.objectWithProperties(content, properties) || !this.matchesProperties(event, content, properties)) {
|
|
24
|
+
throw this.environment.unsupported(operation, event.constructor.name, mismatchReason);
|
|
25
|
+
}
|
|
26
|
+
return content;
|
|
27
|
+
}
|
|
28
|
+
hash(typeId, source, content) {
|
|
29
|
+
const canonical = Object.fromEntries(Object.entries(content).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
|
|
30
|
+
return createHash('sha256').update(`${typeId}|${source}|${JSON.stringify(canonical)}`).digest('base64');
|
|
31
|
+
}
|
|
32
|
+
snapshot(event) {
|
|
33
|
+
const eventType = new EventType(new EventTypeId(event.eventType.id.value), new EventTypeGeneration(event.eventType.generation.value), event.eventType.tombstone);
|
|
34
|
+
const causedBy = event.context.causedBy;
|
|
35
|
+
return {
|
|
36
|
+
eventType,
|
|
37
|
+
content: JSON.parse(JSON.stringify(event.content)),
|
|
38
|
+
context: { ...event.context, eventType, occurred: new Date(event.context.occurred),
|
|
39
|
+
causedBy: causedBy && new Identity(causedBy.subject, causedBy.name, causedBy.userName, causedBy.onBehalfOf),
|
|
40
|
+
causation: event.context.causation.map(item => ({ ...item, occurred: item.occurred && new Date(item.occurred), properties: { ...item.properties } })),
|
|
41
|
+
tags: event.context.tags.map(item => new Tag(item.value)),
|
|
42
|
+
namedTags: [...(event.context.namedTags ?? [])] }
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
parse(serialized, event, operation) {
|
|
46
|
+
try {
|
|
47
|
+
return JSON.parse(serialized);
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
throw this.environment.unsupported(operation, event.constructor.name, 'Content must be valid JSON.');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
objectWithProperties(content, properties) {
|
|
54
|
+
if (!this.isObject(content))
|
|
55
|
+
return false;
|
|
56
|
+
return Object.keys(content).length === Object.keys(properties).length;
|
|
57
|
+
}
|
|
58
|
+
isObject(content) {
|
|
59
|
+
return !!content && typeof content === 'object' && !Array.isArray(content);
|
|
60
|
+
}
|
|
61
|
+
matchesProperties(event, content, properties) {
|
|
62
|
+
return Object.entries(properties).every(property => this.matchesSchema(event, content, property));
|
|
63
|
+
}
|
|
64
|
+
matchesSchema(event, content, [key, property]) {
|
|
65
|
+
return this.matchesProperty(content, key, property) && this.matchesConstraint(event, content, key) && this.matchesText(content[key], property);
|
|
66
|
+
}
|
|
67
|
+
matchesProperty(content, key, property) {
|
|
68
|
+
return Object.hasOwn(content, key) && matchesEventField(content[key], property);
|
|
69
|
+
}
|
|
70
|
+
matchesText(value, property) {
|
|
71
|
+
if (property.type !== 'string' || property.format !== undefined)
|
|
72
|
+
return true;
|
|
73
|
+
return /^[\x20-\x21\x23-\x5b\x5d-\x7e\u00e9]*$/.test(value);
|
|
74
|
+
}
|
|
75
|
+
matchesConstraint(event, content, key) {
|
|
76
|
+
const metadata = this.environment.catalog.get(event.constructor);
|
|
77
|
+
if (!this.constraints?.isConstrainedProperty(metadata.eventType.id.value, key))
|
|
78
|
+
return true;
|
|
79
|
+
return this.matchesConstrainedValue(Reflect.get(event, key), content[key]);
|
|
80
|
+
}
|
|
81
|
+
matchesConstrainedValue(value, content) {
|
|
82
|
+
// Use production serialization for concepts, not their wrapper object's runtime type.
|
|
83
|
+
// Keep rejecting other unproven conversions, such as a Date assigned to a string field.
|
|
84
|
+
if (this.serializedConcept(value))
|
|
85
|
+
return JsonSerializer.serialize(value) === JSON.stringify(content);
|
|
86
|
+
return value === content;
|
|
87
|
+
}
|
|
88
|
+
serializedConcept(value) {
|
|
89
|
+
if (!value || typeof value !== 'object')
|
|
90
|
+
return false;
|
|
91
|
+
return [conceptAsTypeKey, 'Guid'].includes(typeKeyOf(value.constructor) ?? '');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=InProcessEventPayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InProcessEventPayload.js","sourceRoot":"","sources":["../../testing/InProcessEventPayload.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAoB,MAAM,sBAAsB,CAAC;AAErG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,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F;QACxF,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;YAAE,OAAO,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtG,OAAO,KAAK,KAAK,OAAO,CAAC;IAC7B,CAAC;IAEO,iBAAiB,CAAC,KAAc;QACpC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QACtD,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,WAA0B,CAAC,IAAI,EAAE,CAAC,CAAC;IAClG,CAAC;CACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Validated read criteria; route sentinels deliberately do not narrow history. */
|
|
2
|
+
export interface InProcessEventReadCriteria {
|
|
3
|
+
readonly source?: string;
|
|
4
|
+
readonly sourceType?: string;
|
|
5
|
+
readonly streamType?: string;
|
|
6
|
+
readonly streamId?: string;
|
|
7
|
+
readonly ids: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=InProcessEventReadCriteria.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InProcessEventReadCriteria.d.ts","sourceRoot":"","sources":["../../testing/InProcessEventReadCriteria.ts"],"names":[],"mappings":"AAGA,mFAAmF;AACnF,MAAM,WAAW,0BAA0B;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InProcessEventReadCriteria.js","sourceRoot":"","sources":["../../testing/InProcessEventReadCriteria.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AppendedEvent } from '../events/AppendedEvent.js';
|
|
2
|
+
import type { InProcessEventReadCriteria } from './InProcessEventReadCriteria.js';
|
|
3
|
+
/** Applies the same source, route-sentinel, and event-type semantics to each read surface. */
|
|
4
|
+
export declare class InProcessEventReadFilter {
|
|
5
|
+
private readonly criteria;
|
|
6
|
+
constructor(criteria: InProcessEventReadCriteria);
|
|
7
|
+
matches(event: AppendedEvent): boolean;
|
|
8
|
+
private source;
|
|
9
|
+
private sourceType;
|
|
10
|
+
private streamType;
|
|
11
|
+
private streamId;
|
|
12
|
+
private eventType;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=InProcessEventReadFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InProcessEventReadFilter.d.ts","sourceRoot":"","sources":["../../testing/InProcessEventReadFilter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAElF,8FAA8F;AAC9F,qBAAa,wBAAwB;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAArC,YAA6B,QAAQ,EAAE,0BAA0B,EAAI;IAErE,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAErC;IAED,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,SAAS;CAGpB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
/** Applies the same source, route-sentinel, and event-type semantics to each read surface. */
|
|
4
|
+
export class InProcessEventReadFilter {
|
|
5
|
+
criteria;
|
|
6
|
+
constructor(criteria) {
|
|
7
|
+
this.criteria = criteria;
|
|
8
|
+
}
|
|
9
|
+
matches(event) {
|
|
10
|
+
return this.source(event) && this.sourceType(event) && this.streamType(event) && this.streamId(event) && this.eventType(event);
|
|
11
|
+
}
|
|
12
|
+
source(event) {
|
|
13
|
+
return this.criteria.source === undefined || event.context.eventSourceId === this.criteria.source;
|
|
14
|
+
}
|
|
15
|
+
sourceType(event) {
|
|
16
|
+
const value = this.criteria.sourceType;
|
|
17
|
+
return value === undefined || value === 'Default' || event.context.eventSourceType === value;
|
|
18
|
+
}
|
|
19
|
+
streamType(event) {
|
|
20
|
+
const value = this.criteria.streamType;
|
|
21
|
+
return value === undefined || value === 'All' || event.context.eventStreamType === value;
|
|
22
|
+
}
|
|
23
|
+
streamId(event) {
|
|
24
|
+
const value = this.criteria.streamId;
|
|
25
|
+
return value === undefined || value === 'Default' || event.context.eventStreamId === value;
|
|
26
|
+
}
|
|
27
|
+
eventType(event) {
|
|
28
|
+
return !this.criteria.ids.length || this.criteria.ids.includes(event.eventType.id.value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=InProcessEventReadFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InProcessEventReadFilter.js","sourceRoot":"","sources":["../../testing/InProcessEventReadFilter.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAKrG,8FAA8F;AAC9F,MAAM,OAAO,wBAAwB;IACJ,QAAQ;IAArC,YAA6B,QAAoC;wBAApC,QAAQ;IAA+B,CAAC;IAErE,OAAO,CAAC,KAAoB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACnI,CAAC;IAEO,MAAM,CAAC,KAAoB;QAC/B,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,KAAK,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IACtG,CAAC;IAEO,UAAU,CAAC,KAAoB;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;QACvC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,KAAK,KAAK,CAAC;IACjG,CAAC;IAEO,UAAU,CAAC,KAAoB;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;QACvC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,KAAK,KAAK,CAAC;IAC7F,CAAC;IAEO,QAAQ,CAAC,KAAoB;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACrC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,KAAK,KAAK,CAAC;IAC/F,CAAC;IAEO,SAAS,CAAC,KAAoB;QAClC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAC7F,CAAC;CACJ"}
|
|
@@ -32,6 +32,9 @@ export declare class InProcessEventSequence implements IEventSequence {
|
|
|
32
32
|
private readonly _namespace;
|
|
33
33
|
private readonly _clock;
|
|
34
34
|
private readonly _correlationId?;
|
|
35
|
+
private readonly _payload;
|
|
36
|
+
private readonly _singleAppend;
|
|
37
|
+
private readonly _batchAppend;
|
|
35
38
|
private _setup;
|
|
36
39
|
private _allowSeedAppend;
|
|
37
40
|
private _stagedSeeds?;
|
|
@@ -46,6 +49,9 @@ export declare class InProcessEventSequence implements IEventSequence {
|
|
|
46
49
|
seed(source: string, events: object[], options?: AppendOptions): Promise<void>;
|
|
47
50
|
get transactional(): ITransactionalEventSequence;
|
|
48
51
|
append(eventSourceId: string, event: object, options?: AppendOptions): Promise<AppendResult>;
|
|
52
|
+
private appendBusy;
|
|
53
|
+
private commitSingle;
|
|
54
|
+
private notifySingle;
|
|
49
55
|
appendMany(eventSourceId: string, events: object[], options?: AppendOptions): Promise<AppendResult[]>;
|
|
50
56
|
appendMany(events: EventForEventSourceId[], options?: AppendOptions): Promise<AppendResult[]>;
|
|
51
57
|
getNextSequenceNumber(): Promise<EventSequenceNumber>;
|
|
@@ -63,16 +69,13 @@ export declare class InProcessEventSequence implements IEventSequence {
|
|
|
63
69
|
beginImport(): Promise<IEventImport>;
|
|
64
70
|
private filterIds;
|
|
65
71
|
private validateRouteFilters;
|
|
66
|
-
private
|
|
67
|
-
private validateGuid;
|
|
68
|
-
private checkedDate;
|
|
69
|
-
private validateSource;
|
|
70
|
-
private checkedContent;
|
|
72
|
+
private simpleRouteFilter;
|
|
71
73
|
private validateConstraints;
|
|
72
74
|
private rejected;
|
|
73
75
|
private success;
|
|
74
76
|
private snapshot;
|
|
75
77
|
private validateReadSource;
|
|
78
|
+
private simpleReadSource;
|
|
76
79
|
private unsupported;
|
|
77
80
|
}
|
|
78
81
|
//# sourceMappingURL=InProcessEventSequence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InProcessEventSequence.d.ts","sourceRoot":"","sources":["../../testing/InProcessEventSequence.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InProcessEventSequence.d.ts","sourceRoot":"","sources":["../../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