@cratis/chronicle 6.59.0 → 6.61.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 +1 -1
- package/ChronicleOptions.ts +11 -0
- package/EventStore.ts +9 -1
- package/IEventStore.ts +7 -0
- package/README.md +1 -1
- package/artifacts/DefaultClientArtifactsProvider.ts +13 -1
- package/artifacts/IClientArtifactsProvider.ts +6 -0
- package/dist/ChronicleClient.js +1 -1
- package/dist/ChronicleClient.js.map +1 -1
- package/dist/ChronicleOptions.d.ts +7 -0
- package/dist/ChronicleOptions.d.ts.map +1 -1
- package/dist/ChronicleOptions.js +8 -0
- package/dist/ChronicleOptions.js.map +1 -1
- package/dist/EventStore.d.ts +3 -1
- package/dist/EventStore.d.ts.map +1 -1
- package/dist/EventStore.js +7 -1
- package/dist/EventStore.js.map +1 -1
- package/dist/IEventStore.d.ts +6 -0
- package/dist/IEventStore.d.ts.map +1 -1
- package/dist/artifacts/DefaultClientArtifactsProvider.d.ts +4 -0
- package/dist/artifacts/DefaultClientArtifactsProvider.d.ts.map +1 -1
- package/dist/artifacts/DefaultClientArtifactsProvider.js +11 -1
- package/dist/artifacts/DefaultClientArtifactsProvider.js.map +1 -1
- package/dist/artifacts/IClientArtifactsProvider.d.ts +4 -0
- package/dist/artifacts/IClientArtifactsProvider.d.ts.map +1 -1
- package/dist/projections/ChildrenOrderingNotSupportedByContracts.d.ts +15 -0
- package/dist/projections/ChildrenOrderingNotSupportedByContracts.d.ts.map +1 -0
- package/dist/projections/ChildrenOrderingNotSupportedByContracts.js +22 -0
- package/dist/projections/ChildrenOrderingNotSupportedByContracts.js.map +1 -0
- package/dist/projections/InvalidCausedByProperty.d.ts +10 -0
- package/dist/projections/InvalidCausedByProperty.d.ts.map +1 -0
- package/dist/projections/InvalidCausedByProperty.js +16 -0
- package/dist/projections/InvalidCausedByProperty.js.map +1 -0
- package/dist/projections/Projections.d.ts.map +1 -1
- package/dist/projections/Projections.js +7 -30
- package/dist/projections/Projections.js.map +1 -1
- package/dist/projections/causedBy.d.ts +15 -0
- package/dist/projections/causedBy.d.ts.map +1 -0
- package/dist/projections/causedBy.js +24 -0
- package/dist/projections/causedBy.js.map +1 -0
- package/dist/projections/childrenOrdering.d.ts +38 -0
- package/dist/projections/childrenOrdering.d.ts.map +1 -0
- package/dist/projections/childrenOrdering.js +37 -0
- package/dist/projections/childrenOrdering.js.map +1 -0
- package/dist/projections/childrenOrderingSupport.d.ts +14 -0
- package/dist/projections/childrenOrderingSupport.d.ts.map +1 -0
- package/dist/projections/childrenOrderingSupport.js +37 -0
- package/dist/projections/childrenOrderingSupport.js.map +1 -0
- package/dist/projections/declarative/AllSetBuilder.d.ts +3 -0
- package/dist/projections/declarative/AllSetBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/AllSetBuilder.js +6 -0
- package/dist/projections/declarative/AllSetBuilder.js.map +1 -1
- package/dist/projections/declarative/ChildrenBuilder.d.ts +9 -0
- package/dist/projections/declarative/ChildrenBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/ChildrenBuilder.js +29 -1
- package/dist/projections/declarative/ChildrenBuilder.js.map +1 -1
- package/dist/projections/declarative/ChildrenOrderingAlreadyDefined.d.ts +6 -0
- package/dist/projections/declarative/ChildrenOrderingAlreadyDefined.d.ts.map +1 -0
- package/dist/projections/declarative/ChildrenOrderingAlreadyDefined.js +11 -0
- package/dist/projections/declarative/ChildrenOrderingAlreadyDefined.js.map +1 -0
- package/dist/projections/declarative/DictionaryKey.d.ts +48 -0
- package/dist/projections/declarative/DictionaryKey.d.ts.map +1 -0
- package/dist/projections/declarative/DictionaryKey.js +82 -0
- package/dist/projections/declarative/DictionaryKey.js.map +1 -0
- package/dist/projections/declarative/FromAllBuilder.d.ts +2 -0
- package/dist/projections/declarative/FromAllBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/FromAllBuilder.js +5 -0
- package/dist/projections/declarative/FromAllBuilder.js.map +1 -1
- package/dist/projections/declarative/FromBuilder.d.ts +18 -6
- package/dist/projections/declarative/FromBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/FromBuilder.js +34 -31
- package/dist/projections/declarative/FromBuilder.js.map +1 -1
- package/dist/projections/declarative/FromEveryBuilder.d.ts +2 -0
- package/dist/projections/declarative/FromEveryBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/FromEveryBuilder.js +7 -0
- package/dist/projections/declarative/FromEveryBuilder.js.map +1 -1
- package/dist/projections/declarative/IAllSetBuilder.d.ts +7 -0
- package/dist/projections/declarative/IAllSetBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/IChildrenBuilder.d.ts +19 -0
- package/dist/projections/declarative/IChildrenBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/IFromAllBuilder.d.ts +6 -0
- package/dist/projections/declarative/IFromAllBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/IFromEveryBuilder.d.ts +6 -0
- package/dist/projections/declarative/IFromEveryBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/IReadModelPropertiesBuilder.d.ts +37 -6
- package/dist/projections/declarative/IReadModelPropertiesBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/ISetBuilder.d.ts +7 -0
- package/dist/projections/declarative/ISetBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/InvalidDictionaryKey.d.ts +10 -0
- package/dist/projections/declarative/InvalidDictionaryKey.d.ts.map +1 -0
- package/dist/projections/declarative/InvalidDictionaryKey.js +16 -0
- package/dist/projections/declarative/InvalidDictionaryKey.js.map +1 -0
- package/dist/projections/declarative/JoinBuilder.d.ts +18 -6
- package/dist/projections/declarative/JoinBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/JoinBuilder.js +34 -31
- package/dist/projections/declarative/JoinBuilder.js.map +1 -1
- package/dist/projections/declarative/ProjectionBuilderCore.d.ts +2 -0
- package/dist/projections/declarative/ProjectionBuilderCore.d.ts.map +1 -1
- package/dist/projections/declarative/ProjectionBuilderCore.js.map +1 -1
- package/dist/projections/declarative/SetBuilder.d.ts +3 -0
- package/dist/projections/declarative/SetBuilder.d.ts.map +1 -1
- package/dist/projections/declarative/SetBuilder.js +6 -0
- package/dist/projections/declarative/SetBuilder.js.map +1 -1
- package/dist/projections/declarative/index.d.ts +4 -0
- package/dist/projections/declarative/index.d.ts.map +1 -1
- package/dist/projections/declarative/index.js +3 -0
- package/dist/projections/declarative/index.js.map +1 -1
- package/dist/projections/for_Graphs/given/a_discovered_graph.d.ts +29 -0
- package/dist/projections/for_Graphs/given/a_discovered_graph.d.ts.map +1 -0
- package/dist/projections/for_Graphs/given/a_discovered_graph.js +19 -0
- package/dist/projections/for_Graphs/given/a_discovered_graph.js.map +1 -0
- package/dist/projections/for_Graphs/given/a_fake_connection.d.ts +24 -0
- package/dist/projections/for_Graphs/given/a_fake_connection.d.ts.map +1 -0
- package/dist/projections/for_Graphs/given/a_fake_connection.js +17 -0
- package/dist/projections/for_Graphs/given/a_fake_connection.js.map +1 -0
- package/dist/projections/for_Graphs/given/organization.d.ts +43 -0
- package/dist/projections/for_Graphs/given/organization.d.ts.map +1 -0
- package/dist/projections/for_Graphs/given/organization.js +84 -0
- package/dist/projections/for_Graphs/given/organization.js.map +1 -0
- package/dist/projections/graphs/EdgeCanHaveOnlyOneIdentifyingKey.d.ts +11 -0
- package/dist/projections/graphs/EdgeCanHaveOnlyOneIdentifyingKey.d.ts.map +1 -0
- package/dist/projections/graphs/EdgeCanHaveOnlyOneIdentifyingKey.js +16 -0
- package/dist/projections/graphs/EdgeCanHaveOnlyOneIdentifyingKey.js.map +1 -0
- package/dist/projections/graphs/EdgeMustHaveOneSourceAndOneTarget.d.ts +11 -0
- package/dist/projections/graphs/EdgeMustHaveOneSourceAndOneTarget.d.ts.map +1 -0
- package/dist/projections/graphs/EdgeMustHaveOneSourceAndOneTarget.js +16 -0
- package/dist/projections/graphs/EdgeMustHaveOneSourceAndOneTarget.js.map +1 -0
- package/dist/projections/graphs/GraphDeclaredMoreThanOnce.d.ts +11 -0
- package/dist/projections/graphs/GraphDeclaredMoreThanOnce.d.ts.map +1 -0
- package/dist/projections/graphs/GraphDeclaredMoreThanOnce.js +16 -0
- package/dist/projections/graphs/GraphDeclaredMoreThanOnce.js.map +1 -0
- package/dist/projections/graphs/GraphDefinitionBuilder.d.ts +24 -0
- package/dist/projections/graphs/GraphDefinitionBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/GraphDefinitionBuilder.js +148 -0
- package/dist/projections/graphs/GraphDefinitionBuilder.js.map +1 -0
- package/dist/projections/graphs/GraphEdgeBuilder.d.ts +41 -0
- package/dist/projections/graphs/GraphEdgeBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/GraphEdgeBuilder.js +94 -0
- package/dist/projections/graphs/GraphEdgeBuilder.js.map +1 -0
- package/dist/projections/graphs/GraphEdgeFromBuilder.d.ts +25 -0
- package/dist/projections/graphs/GraphEdgeFromBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/GraphEdgeFromBuilder.js +37 -0
- package/dist/projections/graphs/GraphEdgeFromBuilder.js.map +1 -0
- package/dist/projections/graphs/GraphEdgeFromModel.d.ts +16 -0
- package/dist/projections/graphs/GraphEdgeFromModel.d.ts.map +1 -0
- package/dist/projections/graphs/GraphEdgeFromModel.js +4 -0
- package/dist/projections/graphs/GraphEdgeFromModel.js.map +1 -0
- package/dist/projections/graphs/GraphEdgeModel.d.ts +24 -0
- package/dist/projections/graphs/GraphEdgeModel.d.ts.map +1 -0
- package/dist/projections/graphs/GraphEdgeModel.js +4 -0
- package/dist/projections/graphs/GraphEdgeModel.js.map +1 -0
- package/dist/projections/graphs/GraphEdgeRemovedWithBuilder.d.ts +21 -0
- package/dist/projections/graphs/GraphEdgeRemovedWithBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/GraphEdgeRemovedWithBuilder.js +31 -0
- package/dist/projections/graphs/GraphEdgeRemovedWithBuilder.js.map +1 -0
- package/dist/projections/graphs/GraphEdgeRemovedWithModel.d.ts +14 -0
- package/dist/projections/graphs/GraphEdgeRemovedWithModel.d.ts.map +1 -0
- package/dist/projections/graphs/GraphEdgeRemovedWithModel.js +4 -0
- package/dist/projections/graphs/GraphEdgeRemovedWithModel.js.map +1 -0
- package/dist/projections/graphs/GraphElementCannotBeReadModel.d.ts +11 -0
- package/dist/projections/graphs/GraphElementCannotBeReadModel.d.ts.map +1 -0
- package/dist/projections/graphs/GraphElementCannotBeReadModel.js +16 -0
- package/dist/projections/graphs/GraphElementCannotBeReadModel.js.map +1 -0
- package/dist/projections/graphs/GraphHasDuplicateElement.d.ts +13 -0
- package/dist/projections/graphs/GraphHasDuplicateElement.d.ts.map +1 -0
- package/dist/projections/graphs/GraphHasDuplicateElement.js +18 -0
- package/dist/projections/graphs/GraphHasDuplicateElement.js.map +1 -0
- package/dist/projections/graphs/GraphKeyPropertyNotFound.d.ts +12 -0
- package/dist/projections/graphs/GraphKeyPropertyNotFound.d.ts.map +1 -0
- package/dist/projections/graphs/GraphKeyPropertyNotFound.js +17 -0
- package/dist/projections/graphs/GraphKeyPropertyNotFound.js.map +1 -0
- package/dist/projections/graphs/GraphMappingBuilder.d.ts +32 -0
- package/dist/projections/graphs/GraphMappingBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/GraphMappingBuilder.js +48 -0
- package/dist/projections/graphs/GraphMappingBuilder.js.map +1 -0
- package/dist/projections/graphs/GraphMemberMappings.d.ts +9 -0
- package/dist/projections/graphs/GraphMemberMappings.d.ts.map +1 -0
- package/dist/projections/graphs/GraphMemberMappings.js +59 -0
- package/dist/projections/graphs/GraphMemberMappings.js.map +1 -0
- package/dist/projections/graphs/GraphModel.d.ts +15 -0
- package/dist/projections/graphs/GraphModel.d.ts.map +1 -0
- package/dist/projections/graphs/GraphModel.js +4 -0
- package/dist/projections/graphs/GraphModel.js.map +1 -0
- package/dist/projections/graphs/GraphNameRequired.d.ts +11 -0
- package/dist/projections/graphs/GraphNameRequired.d.ts.map +1 -0
- package/dist/projections/graphs/GraphNameRequired.js +16 -0
- package/dist/projections/graphs/GraphNameRequired.js.map +1 -0
- package/dist/projections/graphs/GraphNodeBuilder.d.ts +34 -0
- package/dist/projections/graphs/GraphNodeBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/GraphNodeBuilder.js +66 -0
- package/dist/projections/graphs/GraphNodeBuilder.js.map +1 -0
- package/dist/projections/graphs/GraphNodeFromBuilder.d.ts +21 -0
- package/dist/projections/graphs/GraphNodeFromBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/GraphNodeFromBuilder.js +30 -0
- package/dist/projections/graphs/GraphNodeFromBuilder.js.map +1 -0
- package/dist/projections/graphs/GraphNodeFromModel.d.ts +14 -0
- package/dist/projections/graphs/GraphNodeFromModel.d.ts.map +1 -0
- package/dist/projections/graphs/GraphNodeFromModel.js +4 -0
- package/dist/projections/graphs/GraphNodeFromModel.js.map +1 -0
- package/dist/projections/graphs/GraphNodeModel.d.ts +18 -0
- package/dist/projections/graphs/GraphNodeModel.d.ts.map +1 -0
- package/dist/projections/graphs/GraphNodeModel.js +4 -0
- package/dist/projections/graphs/GraphNodeModel.js.map +1 -0
- package/dist/projections/graphs/GraphNodeRemovedWithBuilder.d.ts +17 -0
- package/dist/projections/graphs/GraphNodeRemovedWithBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/GraphNodeRemovedWithBuilder.js +24 -0
- package/dist/projections/graphs/GraphNodeRemovedWithBuilder.js.map +1 -0
- package/dist/projections/graphs/GraphNodeRemovedWithModel.d.ts +12 -0
- package/dist/projections/graphs/GraphNodeRemovedWithModel.d.ts.map +1 -0
- package/dist/projections/graphs/GraphNodeRemovedWithModel.js +4 -0
- package/dist/projections/graphs/GraphNodeRemovedWithModel.js.map +1 -0
- package/dist/projections/graphs/GraphProjectionBuilder.d.ts +25 -0
- package/dist/projections/graphs/GraphProjectionBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/GraphProjectionBuilder.js +36 -0
- package/dist/projections/graphs/GraphProjectionBuilder.js.map +1 -0
- package/dist/projections/graphs/GraphRegistration.d.ts +14 -0
- package/dist/projections/graphs/GraphRegistration.d.ts.map +1 -0
- package/dist/projections/graphs/GraphRegistration.js +4 -0
- package/dist/projections/graphs/GraphRegistration.js.map +1 -0
- package/dist/projections/graphs/GraphSchemaWriter.d.ts +28 -0
- package/dist/projections/graphs/GraphSchemaWriter.d.ts.map +1 -0
- package/dist/projections/graphs/GraphSchemaWriter.js +76 -0
- package/dist/projections/graphs/GraphSchemaWriter.js.map +1 -0
- package/dist/projections/graphs/Graphs.d.ts +39 -0
- package/dist/projections/graphs/Graphs.d.ts.map +1 -0
- package/dist/projections/graphs/Graphs.js +144 -0
- package/dist/projections/graphs/Graphs.js.map +1 -0
- package/dist/projections/graphs/IGraphEdgeBuilder.d.ts +37 -0
- package/dist/projections/graphs/IGraphEdgeBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphEdgeBuilder.js +4 -0
- package/dist/projections/graphs/IGraphEdgeBuilder.js.map +1 -0
- package/dist/projections/graphs/IGraphEdgeFromBuilder.d.ts +29 -0
- package/dist/projections/graphs/IGraphEdgeFromBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphEdgeFromBuilder.js +4 -0
- package/dist/projections/graphs/IGraphEdgeFromBuilder.js.map +1 -0
- package/dist/projections/graphs/IGraphEdgeRemovedWithBuilder.d.ts +27 -0
- package/dist/projections/graphs/IGraphEdgeRemovedWithBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphEdgeRemovedWithBuilder.js +4 -0
- package/dist/projections/graphs/IGraphEdgeRemovedWithBuilder.js.map +1 -0
- package/dist/projections/graphs/IGraphMappingBuilder.d.ts +49 -0
- package/dist/projections/graphs/IGraphMappingBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphMappingBuilder.js +4 -0
- package/dist/projections/graphs/IGraphMappingBuilder.js.map +1 -0
- package/dist/projections/graphs/IGraphNodeBuilder.d.ts +32 -0
- package/dist/projections/graphs/IGraphNodeBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphNodeBuilder.js +4 -0
- package/dist/projections/graphs/IGraphNodeBuilder.js.map +1 -0
- package/dist/projections/graphs/IGraphNodeFromBuilder.d.ts +21 -0
- package/dist/projections/graphs/IGraphNodeFromBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphNodeFromBuilder.js +4 -0
- package/dist/projections/graphs/IGraphNodeFromBuilder.js.map +1 -0
- package/dist/projections/graphs/IGraphNodeRemovedWithBuilder.d.ts +19 -0
- package/dist/projections/graphs/IGraphNodeRemovedWithBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphNodeRemovedWithBuilder.js +4 -0
- package/dist/projections/graphs/IGraphNodeRemovedWithBuilder.js.map +1 -0
- package/dist/projections/graphs/IGraphProjection.d.ts +13 -0
- package/dist/projections/graphs/IGraphProjection.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphProjection.js +4 -0
- package/dist/projections/graphs/IGraphProjection.js.map +1 -0
- package/dist/projections/graphs/IGraphProjectionBuilder.d.ts +26 -0
- package/dist/projections/graphs/IGraphProjectionBuilder.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphProjectionBuilder.js +4 -0
- package/dist/projections/graphs/IGraphProjectionBuilder.js.map +1 -0
- package/dist/projections/graphs/IGraphs.d.ts +27 -0
- package/dist/projections/graphs/IGraphs.d.ts.map +1 -0
- package/dist/projections/graphs/IGraphs.js +4 -0
- package/dist/projections/graphs/IGraphs.js.map +1 -0
- package/dist/projections/graphs/ModelBoundGraphReader.d.ts +30 -0
- package/dist/projections/graphs/ModelBoundGraphReader.d.ts.map +1 -0
- package/dist/projections/graphs/ModelBoundGraphReader.js +112 -0
- package/dist/projections/graphs/ModelBoundGraphReader.js.map +1 -0
- package/dist/projections/graphs/NestedObjectInGraph.d.ts +12 -0
- package/dist/projections/graphs/NestedObjectInGraph.d.ts.map +1 -0
- package/dist/projections/graphs/NestedObjectInGraph.js +17 -0
- package/dist/projections/graphs/NestedObjectInGraph.js.map +1 -0
- package/dist/projections/graphs/NodeMustHaveExactlyOneKey.d.ts +12 -0
- package/dist/projections/graphs/NodeMustHaveExactlyOneKey.d.ts.map +1 -0
- package/dist/projections/graphs/NodeMustHaveExactlyOneKey.js +17 -0
- package/dist/projections/graphs/NodeMustHaveExactlyOneKey.js.map +1 -0
- package/dist/projections/graphs/SetOnceNotSupportedInGraph.d.ts +13 -0
- package/dist/projections/graphs/SetOnceNotSupportedInGraph.d.ts.map +1 -0
- package/dist/projections/graphs/SetOnceNotSupportedInGraph.js +18 -0
- package/dist/projections/graphs/SetOnceNotSupportedInGraph.js.map +1 -0
- package/dist/projections/graphs/UnknownGraphEventProperty.d.ts +13 -0
- package/dist/projections/graphs/UnknownGraphEventProperty.d.ts.map +1 -0
- package/dist/projections/graphs/UnknownGraphEventProperty.js +18 -0
- package/dist/projections/graphs/UnknownGraphEventProperty.js.map +1 -0
- package/dist/projections/graphs/UnknownGraphNode.d.ts +12 -0
- package/dist/projections/graphs/UnknownGraphNode.d.ts.map +1 -0
- package/dist/projections/graphs/UnknownGraphNode.js +17 -0
- package/dist/projections/graphs/UnknownGraphNode.js.map +1 -0
- package/dist/projections/graphs/edge.d.ts +23 -0
- package/dist/projections/graphs/edge.d.ts.map +1 -0
- package/dist/projections/graphs/edge.js +29 -0
- package/dist/projections/graphs/edge.js.map +1 -0
- package/dist/projections/graphs/edgeFrom.d.ts +31 -0
- package/dist/projections/graphs/edgeFrom.d.ts.map +1 -0
- package/dist/projections/graphs/edgeFrom.js +26 -0
- package/dist/projections/graphs/edgeFrom.js.map +1 -0
- package/dist/projections/graphs/edgeRemovedWith.d.ts +22 -0
- package/dist/projections/graphs/edgeRemovedWith.d.ts.map +1 -0
- package/dist/projections/graphs/edgeRemovedWith.js +25 -0
- package/dist/projections/graphs/edgeRemovedWith.js.map +1 -0
- package/dist/projections/graphs/edgeSource.d.ts +22 -0
- package/dist/projections/graphs/edgeSource.d.ts.map +1 -0
- package/dist/projections/graphs/edgeSource.js +30 -0
- package/dist/projections/graphs/edgeSource.js.map +1 -0
- package/dist/projections/graphs/edgeTarget.d.ts +22 -0
- package/dist/projections/graphs/edgeTarget.d.ts.map +1 -0
- package/dist/projections/graphs/edgeTarget.js +30 -0
- package/dist/projections/graphs/edgeTarget.js.map +1 -0
- package/dist/projections/graphs/graph.d.ts +16 -0
- package/dist/projections/graphs/graph.d.ts.map +1 -0
- package/dist/projections/graphs/graph.js +24 -0
- package/dist/projections/graphs/graph.js.map +1 -0
- package/dist/projections/graphs/graphKey.d.ts +16 -0
- package/dist/projections/graphs/graphKey.d.ts.map +1 -0
- package/dist/projections/graphs/graphKey.js +28 -0
- package/dist/projections/graphs/graphKey.js.map +1 -0
- package/dist/projections/graphs/graphProjection.d.ts +21 -0
- package/dist/projections/graphs/graphProjection.d.ts.map +1 -0
- package/dist/projections/graphs/graphProjection.js +28 -0
- package/dist/projections/graphs/graphProjection.js.map +1 -0
- package/dist/projections/graphs/index.d.ts +49 -0
- package/dist/projections/graphs/index.d.ts.map +1 -0
- package/dist/projections/graphs/index.js +28 -0
- package/dist/projections/graphs/index.js.map +1 -0
- package/dist/projections/graphs/isGraphElement.d.ts +7 -0
- package/dist/projections/graphs/isGraphElement.d.ts.map +1 -0
- package/dist/projections/graphs/isGraphElement.js +13 -0
- package/dist/projections/graphs/isGraphElement.js.map +1 -0
- package/dist/projections/graphs/node.d.ts +22 -0
- package/dist/projections/graphs/node.d.ts.map +1 -0
- package/dist/projections/graphs/node.js +29 -0
- package/dist/projections/graphs/node.js.map +1 -0
- package/dist/projections/graphs/nodeFrom.d.ts +31 -0
- package/dist/projections/graphs/nodeFrom.d.ts.map +1 -0
- package/dist/projections/graphs/nodeFrom.js +26 -0
- package/dist/projections/graphs/nodeFrom.js.map +1 -0
- package/dist/projections/graphs/nodeRemovedWith.d.ts +28 -0
- package/dist/projections/graphs/nodeRemovedWith.d.ts.map +1 -0
- package/dist/projections/graphs/nodeRemovedWith.js +25 -0
- package/dist/projections/graphs/nodeRemovedWith.js.map +1 -0
- package/dist/projections/graphs/propertyPathOf.d.ts +8 -0
- package/dist/projections/graphs/propertyPathOf.d.ts.map +1 -0
- package/dist/projections/graphs/propertyPathOf.js +14 -0
- package/dist/projections/graphs/propertyPathOf.js.map +1 -0
- package/dist/projections/index.d.ts +6 -0
- package/dist/projections/index.d.ts.map +1 -1
- package/dist/projections/index.js +4 -0
- package/dist/projections/index.js.map +1 -1
- package/dist/projections/modelBound/ConflictingChildrenOrdering.d.ts +10 -0
- package/dist/projections/modelBound/ConflictingChildrenOrdering.d.ts.map +1 -0
- package/dist/projections/modelBound/ConflictingChildrenOrdering.js +16 -0
- package/dist/projections/modelBound/ConflictingChildrenOrdering.js.map +1 -0
- package/dist/projections/modelBound/childrenAndNestedBuilder.d.ts +2 -0
- package/dist/projections/modelBound/childrenAndNestedBuilder.d.ts.map +1 -1
- package/dist/projections/modelBound/childrenAndNestedBuilder.js +9 -5
- package/dist/projections/modelBound/childrenAndNestedBuilder.js.map +1 -1
- package/dist/projections/modelBound/childrenFrom.d.ts +39 -1
- package/dist/projections/modelBound/childrenFrom.d.ts.map +1 -1
- package/dist/projections/modelBound/childrenFrom.js +30 -1
- package/dist/projections/modelBound/childrenFrom.js.map +1 -1
- package/dist/projections/modelBound/index.d.ts +3 -2
- package/dist/projections/modelBound/index.d.ts.map +1 -1
- package/dist/projections/modelBound/index.js +1 -0
- package/dist/projections/modelBound/index.js.map +1 -1
- package/dist/projections/modelBound/setFrom.d.ts +26 -0
- package/dist/projections/modelBound/setFrom.d.ts.map +1 -1
- package/dist/projections/modelBound/setFrom.js +15 -8
- package/dist/projections/modelBound/setFrom.js.map +1 -1
- package/dist/projections/modelBound/setFromContext.d.ts +23 -1
- package/dist/projections/modelBound/setFromContext.d.ts.map +1 -1
- package/dist/projections/modelBound/setFromContext.js +20 -2
- package/dist/projections/modelBound/setFromContext.js.map +1 -1
- package/dist/projections/propertyExpressions.d.ts +9 -0
- package/dist/projections/propertyExpressions.d.ts.map +1 -0
- package/dist/projections/propertyExpressions.js +13 -0
- package/dist/projections/propertyExpressions.js.map +1 -0
- package/dist/projections/registerProjectionWithRetry.d.ts +15 -0
- package/dist/projections/registerProjectionWithRetry.d.ts.map +1 -0
- package/dist/projections/registerProjectionWithRetry.js +44 -0
- package/dist/projections/registerProjectionWithRetry.js.map +1 -0
- package/dist/readModels/rootReadModelTypes.d.ts.map +1 -1
- package/dist/readModels/rootReadModelTypes.js +3 -1
- package/dist/readModels/rootReadModelTypes.js.map +1 -1
- package/dist/reducers/Reducers.d.ts.map +1 -1
- package/dist/reducers/Reducers.js +2 -1
- package/dist/reducers/Reducers.js.map +1 -1
- package/dist/sinks/WellKnownSinks.d.ts +4 -0
- package/dist/sinks/WellKnownSinks.d.ts.map +1 -1
- package/dist/sinks/WellKnownSinks.js +5 -1
- package/dist/sinks/WellKnownSinks.js.map +1 -1
- package/dist/testing/projections/ProjectionCapabilities.d.ts.map +1 -1
- package/dist/testing/projections/ProjectionCapabilities.js +2 -0
- package/dist/testing/projections/ProjectionCapabilities.js.map +1 -1
- package/dist/testing/projections/ProjectionChildrenCapabilities.d.ts.map +1 -1
- package/dist/testing/projections/ProjectionChildrenCapabilities.js +2 -0
- package/dist/testing/projections/ProjectionChildrenCapabilities.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/DecoratorType.d.ts +5 -1
- package/dist/types/DecoratorType.d.ts.map +1 -1
- package/dist/types/DecoratorType.js +4 -0
- package/dist/types/DecoratorType.js.map +1 -1
- package/for_ChronicleOptions/when_configuring_the_graph_sink/with_graph_sink_type.spec.ts +22 -0
- package/package.json +3 -3
- package/projections/ChildrenOrderingNotSupportedByContracts.ts +18 -0
- package/projections/InvalidCausedByProperty.ts +14 -0
- package/projections/Projections.ts +8 -29
- package/projections/causedBy.ts +30 -0
- package/projections/childrenOrdering.ts +53 -0
- package/projections/childrenOrderingSupport.ts +40 -0
- package/projections/declarative/AllSetBuilder.ts +7 -0
- package/projections/declarative/ChildrenBuilder.ts +34 -1
- package/projections/declarative/ChildrenOrderingAlreadyDefined.ts +11 -0
- package/projections/declarative/DictionaryKey.ts +88 -0
- package/projections/declarative/FromAllBuilder.ts +10 -0
- package/projections/declarative/FromBuilder.ts +42 -32
- package/projections/declarative/FromEveryBuilder.ts +12 -0
- package/projections/declarative/IAllSetBuilder.ts +8 -0
- package/projections/declarative/IChildrenBuilder.ts +22 -0
- package/projections/declarative/IFromAllBuilder.ts +7 -0
- package/projections/declarative/IFromEveryBuilder.ts +7 -0
- package/projections/declarative/IReadModelPropertiesBuilder.ts +39 -6
- package/projections/declarative/ISetBuilder.ts +8 -0
- package/projections/declarative/InvalidDictionaryKey.ts +14 -0
- package/projections/declarative/JoinBuilder.ts +41 -32
- package/projections/declarative/ProjectionBuilderCore.ts +2 -0
- package/projections/declarative/SetBuilder.ts +7 -0
- package/projections/declarative/for_ChildrenBuilder/when_ordering_children.spec.ts +52 -0
- package/projections/declarative/for_FromAllBuilder/when_setting_once.spec.ts +29 -0
- package/projections/declarative/for_FromBuilder/when_setting_once.spec.ts +39 -0
- package/projections/declarative/for_FromBuilder/when_targeting_dictionary_entries.spec.ts +99 -0
- package/projections/declarative/for_JoinBuilder/when_setting_once_and_targeting_dictionary_entries.spec.ts +36 -0
- package/projections/declarative/for_SetBuilder/when_setting_to_the_causing_identity.spec.ts +37 -0
- package/projections/declarative/index.ts +4 -0
- package/projections/for_Graphs/given/a_discovered_graph.ts +21 -0
- package/projections/for_Graphs/given/a_fake_connection.ts +19 -0
- package/projections/for_Graphs/given/organization.ts +96 -0
- package/projections/for_Graphs/when_building_a_fluent_graph.spec.ts +112 -0
- package/projections/for_Graphs/when_building_a_model_bound_graph.spec.ts +92 -0
- package/projections/for_Graphs/when_declaring_an_edge_with_an_identity.spec.ts +137 -0
- package/projections/for_Graphs/when_declaring_an_invalid_graph.spec.ts +227 -0
- package/projections/for_Graphs/when_declaring_with_standard_decorators.standard.spec.ts +92 -0
- package/projections/for_Graphs/when_discovering_graph_elements.spec.ts +32 -0
- package/projections/for_Graphs/when_mapping_properties.spec.ts +159 -0
- package/projections/for_Graphs/when_registering_graphs.spec.ts +56 -0
- package/projections/for_Projections/when_registering_ordered_children.spec.ts +66 -0
- package/projections/for_childrenOrderingSupport/when_detecting_support_in_the_pinned_contracts.spec.ts +22 -0
- package/projections/for_childrenOrderingSupport/when_ensuring_children_ordering_is_supported.spec.ts +35 -0
- package/projections/graphs/EdgeCanHaveOnlyOneIdentifyingKey.ts +16 -0
- package/projections/graphs/EdgeMustHaveOneSourceAndOneTarget.ts +16 -0
- package/projections/graphs/GraphDeclaredMoreThanOnce.ts +16 -0
- package/projections/graphs/GraphDefinitionBuilder.ts +169 -0
- package/projections/graphs/GraphEdgeBuilder.ts +107 -0
- package/projections/graphs/GraphEdgeFromBuilder.ts +47 -0
- package/projections/graphs/GraphEdgeFromModel.ts +22 -0
- package/projections/graphs/GraphEdgeModel.ts +34 -0
- package/projections/graphs/GraphEdgeRemovedWithBuilder.ts +39 -0
- package/projections/graphs/GraphEdgeRemovedWithModel.ts +19 -0
- package/projections/graphs/GraphElementCannotBeReadModel.ts +16 -0
- package/projections/graphs/GraphHasDuplicateElement.ts +18 -0
- package/projections/graphs/GraphKeyPropertyNotFound.ts +17 -0
- package/projections/graphs/GraphMappingBuilder.ts +65 -0
- package/projections/graphs/GraphMemberMappings.ts +60 -0
- package/projections/graphs/GraphModel.ts +20 -0
- package/projections/graphs/GraphNameRequired.ts +16 -0
- package/projections/graphs/GraphNodeBuilder.ts +76 -0
- package/projections/graphs/GraphNodeFromBuilder.ts +38 -0
- package/projections/graphs/GraphNodeFromModel.ts +19 -0
- package/projections/graphs/GraphNodeModel.ts +25 -0
- package/projections/graphs/GraphNodeRemovedWithBuilder.ts +30 -0
- package/projections/graphs/GraphNodeRemovedWithModel.ts +16 -0
- package/projections/graphs/GraphProjectionBuilder.ts +52 -0
- package/projections/graphs/GraphRegistration.ts +19 -0
- package/projections/graphs/GraphSchemaWriter.ts +80 -0
- package/projections/graphs/Graphs.ts +165 -0
- package/projections/graphs/IGraphEdgeBuilder.ts +43 -0
- package/projections/graphs/IGraphEdgeFromBuilder.ts +34 -0
- package/projections/graphs/IGraphEdgeRemovedWithBuilder.ts +32 -0
- package/projections/graphs/IGraphMappingBuilder.ts +57 -0
- package/projections/graphs/IGraphNodeBuilder.ts +37 -0
- package/projections/graphs/IGraphNodeFromBuilder.ts +25 -0
- package/projections/graphs/IGraphNodeRemovedWithBuilder.ts +23 -0
- package/projections/graphs/IGraphProjection.ts +16 -0
- package/projections/graphs/IGraphProjectionBuilder.ts +34 -0
- package/projections/graphs/IGraphs.ts +33 -0
- package/projections/graphs/ModelBoundGraphReader.ts +119 -0
- package/projections/graphs/NestedObjectInGraph.ts +17 -0
- package/projections/graphs/NodeMustHaveExactlyOneKey.ts +17 -0
- package/projections/graphs/SetOnceNotSupportedInGraph.ts +18 -0
- package/projections/graphs/UnknownGraphEventProperty.ts +18 -0
- package/projections/graphs/UnknownGraphNode.ts +17 -0
- package/projections/graphs/edge.ts +40 -0
- package/projections/graphs/edgeFrom.ts +48 -0
- package/projections/graphs/edgeRemovedWith.ts +36 -0
- package/projections/graphs/edgeSource.ts +39 -0
- package/projections/graphs/edgeTarget.ts +39 -0
- package/projections/graphs/graph.ts +28 -0
- package/projections/graphs/graphKey.ts +31 -0
- package/projections/graphs/graphProjection.ts +39 -0
- package/projections/graphs/index.ts +51 -0
- package/projections/graphs/isGraphElement.ts +14 -0
- package/projections/graphs/node.ts +40 -0
- package/projections/graphs/nodeFrom.ts +48 -0
- package/projections/graphs/nodeRemovedWith.ts +44 -0
- package/projections/graphs/propertyPathOf.ts +15 -0
- package/projections/index.ts +6 -0
- package/projections/modelBound/ConflictingChildrenOrdering.ts +14 -0
- package/projections/modelBound/childrenAndNestedBuilder.ts +11 -5
- package/projections/modelBound/childrenFrom.ts +62 -2
- package/projections/modelBound/for_childrenFrom/when_ordering_children.spec.ts +91 -0
- package/projections/modelBound/for_setFrom/when_setting_once.spec.ts +52 -0
- package/projections/modelBound/index.ts +3 -2
- package/projections/modelBound/setFrom.ts +37 -2
- package/projections/modelBound/setFromContext.ts +38 -3
- package/projections/propertyExpressions.ts +14 -0
- package/projections/registerProjectionWithRetry.ts +53 -0
- package/readModels/rootReadModelTypes.ts +3 -1
- package/reducers/Reducers.ts +2 -1
- package/sinks/WellKnownSinks.ts +7 -1
- package/testing/projections/ProjectionCapabilities.ts +1 -0
- package/testing/projections/ProjectionChildrenCapabilities.ts +1 -0
- package/testing/projections/for_ProjectionCapabilities/when_rejecting_set_once_dictionary_entries_and_ordered_children.spec.ts +52 -0
- package/types/DecoratorType.ts +7 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChildrenOrderingAlreadyDefined.js","sourceRoot":"","sources":["../../../projections/declarative/ChildrenOrderingAlreadyDefined.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,+EAA+E;AAC/E,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACrD,yBAAyB;IACzB;QACI,KAAK,CAAC,+GAA+G,CAAC,CAAC;QACvH,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;IACjD,CAAC;CACJ"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PropertyAccessor } from '@cratis/fundamentals';
|
|
2
|
+
import type { EventContext } from '../../events/EventContext.js';
|
|
3
|
+
import { CausedByProperty } from '../causedBy.js';
|
|
4
|
+
/**
|
|
5
|
+
* Where the key of a dictionary entry comes from when a projection maps into a dictionary-typed read model property.
|
|
6
|
+
* Pass a plain accessor on the event for the common case; use the factory methods for keys from the event content,
|
|
7
|
+
* the event context or the identity that caused the event.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DictionaryKey {
|
|
10
|
+
readonly expression: string;
|
|
11
|
+
private constructor();
|
|
12
|
+
/**
|
|
13
|
+
* The key is read from a property of the event content. Nested paths are supported; the kernel requires the
|
|
14
|
+
* property to exist on the event (case-sensitively) and an event without a value for it leaves the dictionary as it is.
|
|
15
|
+
* @param eventPropertyAccessor - Accessor for the event property holding the key.
|
|
16
|
+
* @returns The dictionary key.
|
|
17
|
+
*/
|
|
18
|
+
static fromEventContent<TEvent>(eventPropertyAccessor: PropertyAccessor<TEvent>): DictionaryKey;
|
|
19
|
+
/**
|
|
20
|
+
* The key is read from the event context, for instance `eventSourceId` or `causedBy.subject`.
|
|
21
|
+
* @param contextProperty - The event context property name, or an accessor on the {@link EventContext}.
|
|
22
|
+
* @returns The dictionary key.
|
|
23
|
+
*/
|
|
24
|
+
static fromEventContext(contextProperty: string | PropertyAccessor<EventContext>): DictionaryKey;
|
|
25
|
+
/**
|
|
26
|
+
* The key is a member of the identity that caused the event.
|
|
27
|
+
* @param property - The identity member: `subject`, `name` or `userName`.
|
|
28
|
+
* @returns The dictionary key.
|
|
29
|
+
*/
|
|
30
|
+
static causedBy(property: CausedByProperty): DictionaryKey;
|
|
31
|
+
}
|
|
32
|
+
/** A dictionary key: an accessor on the event (the key is read from the event content) or a {@link DictionaryKey}. */
|
|
33
|
+
export type DictionaryKeySource<TEvent> = PropertyAccessor<TEvent> | DictionaryKey;
|
|
34
|
+
/**
|
|
35
|
+
* Resolves a dictionary key source to its {@link DictionaryKey}.
|
|
36
|
+
* @param key - The key source.
|
|
37
|
+
* @returns The dictionary key.
|
|
38
|
+
*/
|
|
39
|
+
export declare function toDictionaryKey<TEvent>(key: DictionaryKeySource<TEvent>): DictionaryKey;
|
|
40
|
+
/**
|
|
41
|
+
* Builds the target property path of a dictionary entry: `<dictionary>.<key expression>`, for example
|
|
42
|
+
* `slots.$eventContent.category`.
|
|
43
|
+
* @param dictionaryProperty - The dictionary-typed read model property.
|
|
44
|
+
* @param key - Where the key of the entry comes from.
|
|
45
|
+
* @returns The dynamic property path the kernel resolves per event.
|
|
46
|
+
*/
|
|
47
|
+
export declare function dictionaryEntryPath<TEvent>(dictionaryProperty: string, key: DictionaryKeySource<TEvent>): string;
|
|
48
|
+
//# sourceMappingURL=DictionaryKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DictionaryKey.d.ts","sourceRoot":"","sources":["../../../projections/declarative/DictionaryKey.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAoB,MAAM,gBAAgB,CAAC;AAKpE;;;;GAIG;AACH,qBAAa,aAAa;IACF,QAAQ,CAAC,UAAU,EAAE,MAAM;IAA/C,OAAO,eAA4C;IAEnD;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,qBAAqB,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,aAAa,CAQ9F;IAED;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,gBAAgB,CAAC,YAAY,CAAC,GAAG,aAAa,CAe/F;IAED;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,aAAa,CAEzD;CACJ;AAED,sHAAsH;AACtH,MAAM,MAAM,mBAAmB,CAAC,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC;AAEnF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG,aAAa,CAEvF;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG,MAAM,CAEhH"}
|
|
@@ -0,0 +1,82 @@
|
|
|
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 { PropertyPathResolverProxyHandler } from '@cratis/fundamentals';
|
|
4
|
+
import { causedByProperty } from '../causedBy.js';
|
|
5
|
+
import { eventContextPropertyExpression } from '../eventContextPropertyExpression.js';
|
|
6
|
+
import { InvalidEventContextPropertyError } from '../InvalidEventContextPropertyError.js';
|
|
7
|
+
import { InvalidDictionaryKey } from './InvalidDictionaryKey.js';
|
|
8
|
+
/**
|
|
9
|
+
* Where the key of a dictionary entry comes from when a projection maps into a dictionary-typed read model property.
|
|
10
|
+
* Pass a plain accessor on the event for the common case; use the factory methods for keys from the event content,
|
|
11
|
+
* the event context or the identity that caused the event.
|
|
12
|
+
*/
|
|
13
|
+
export class DictionaryKey {
|
|
14
|
+
expression;
|
|
15
|
+
constructor(expression) {
|
|
16
|
+
this.expression = expression;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The key is read from a property of the event content. Nested paths are supported; the kernel requires the
|
|
20
|
+
* property to exist on the event (case-sensitively) and an event without a value for it leaves the dictionary as it is.
|
|
21
|
+
* @param eventPropertyAccessor - Accessor for the event property holding the key.
|
|
22
|
+
* @returns The dictionary key.
|
|
23
|
+
*/
|
|
24
|
+
static fromEventContent(eventPropertyAccessor) {
|
|
25
|
+
const handler = new PropertyPathResolverProxyHandler();
|
|
26
|
+
eventPropertyAccessor(new Proxy({}, handler));
|
|
27
|
+
const path = handler.path;
|
|
28
|
+
if (!/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(path) || path.split('.').some(segment => segment.startsWith('$'))) {
|
|
29
|
+
throw new InvalidDictionaryKey(path);
|
|
30
|
+
}
|
|
31
|
+
return new DictionaryKey(`$eventContent.${path}`);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The key is read from the event context, for instance `eventSourceId` or `causedBy.subject`.
|
|
35
|
+
* @param contextProperty - The event context property name, or an accessor on the {@link EventContext}.
|
|
36
|
+
* @returns The dictionary key.
|
|
37
|
+
*/
|
|
38
|
+
static fromEventContext(contextProperty) {
|
|
39
|
+
let path;
|
|
40
|
+
if (typeof contextProperty === 'function') {
|
|
41
|
+
const handler = new PropertyPathResolverProxyHandler();
|
|
42
|
+
contextProperty(new Proxy({}, handler));
|
|
43
|
+
path = handler.path;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
path = contextProperty;
|
|
47
|
+
}
|
|
48
|
+
if (path.endsWith('()')) {
|
|
49
|
+
throw new InvalidEventContextPropertyError(path);
|
|
50
|
+
}
|
|
51
|
+
eventContextPropertyExpression(path);
|
|
52
|
+
const camelCased = path.split('.').map(segment => segment.charAt(0).toLowerCase() + segment.slice(1)).join('.');
|
|
53
|
+
return new DictionaryKey(`$eventContext.${camelCased}`);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The key is a member of the identity that caused the event.
|
|
57
|
+
* @param property - The identity member: `subject`, `name` or `userName`.
|
|
58
|
+
* @returns The dictionary key.
|
|
59
|
+
*/
|
|
60
|
+
static causedBy(property) {
|
|
61
|
+
return new DictionaryKey(`$causedBy.${causedByProperty(property)}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Resolves a dictionary key source to its {@link DictionaryKey}.
|
|
66
|
+
* @param key - The key source.
|
|
67
|
+
* @returns The dictionary key.
|
|
68
|
+
*/
|
|
69
|
+
export function toDictionaryKey(key) {
|
|
70
|
+
return key instanceof DictionaryKey ? key : DictionaryKey.fromEventContent(key);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Builds the target property path of a dictionary entry: `<dictionary>.<key expression>`, for example
|
|
74
|
+
* `slots.$eventContent.category`.
|
|
75
|
+
* @param dictionaryProperty - The dictionary-typed read model property.
|
|
76
|
+
* @param key - Where the key of the entry comes from.
|
|
77
|
+
* @returns The dynamic property path the kernel resolves per event.
|
|
78
|
+
*/
|
|
79
|
+
export function dictionaryEntryPath(dictionaryProperty, key) {
|
|
80
|
+
return `${dictionaryProperty}.${toDictionaryKey(key).expression}`;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=DictionaryKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DictionaryKey.js","sourceRoot":"","sources":["../../../projections/declarative/DictionaryKey.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAE1F,OAAO,EAAoB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,OAAO,aAAa;IACO,UAAU;IAAvC,YAA6B,UAAkB;0BAAlB,UAAU;IAAW,CAAC;IAEnD;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAS,qBAA+C;QAC3E,MAAM,OAAO,GAAG,IAAI,gCAAgC,EAAE,CAAC;QACvD,qBAAqB,CAAC,IAAI,KAAK,CAAC,EAAE,EAAE,OAAO,CAAW,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,2CAA2C,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACtH,MAAM,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,aAAa,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,eAAwD;QAC5E,IAAI,IAAY,CAAC;QACjB,IAAI,OAAO,eAAe,KAAK,UAAU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6 +7,8 @@ export declare class FromAllBuilder<TReadModel> implements IFromAllBuilder<TRead
|
|
|
7
7
|
/** @inheritdoc */
|
|
8
8
|
set(readModelPropertyAccessor: PropertyAccessor<TReadModel>): IAllSetBuilder<TReadModel, IFromAllBuilder<TReadModel>>;
|
|
9
9
|
/** @inheritdoc */
|
|
10
|
+
setOnce(readModelPropertyAccessor: PropertyAccessor<TReadModel>): IAllSetBuilder<TReadModel, IFromAllBuilder<TReadModel>>;
|
|
11
|
+
/** @inheritdoc */
|
|
10
12
|
count(readModelPropertyAccessor: PropertyAccessor<TReadModel>, contextPropertyName?: string): IFromAllBuilder<TReadModel>;
|
|
11
13
|
/** @inheritdoc */
|
|
12
14
|
increment(readModelPropertyAccessor: PropertyAccessor<TReadModel>, contextPropertyName?: string): IFromAllBuilder<TReadModel>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromAllBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/FromAllBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"FromAllBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/FromAllBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;AAG1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,gGAAgG;AAChG,qBAAa,cAAc,CAAC,UAAU,CAAE,YAAW,eAAe,CAAC,UAAU,CAAC;IAC1E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAEjD,kBAAkB;IAClB,GAAG,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,UAAU,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC,CAMpH;IAED,kBAAkB;IAClB,OAAO,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,UAAU,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC,CAMxH;IAED,kBAAkB;IAClB,KAAK,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAExH;IAED,kBAAkB;IAClB,SAAS,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAE5H;IAED,kBAAkB;IAClB,SAAS,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAE5H;IAED,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,cAAc;CAKzB"}
|
|
@@ -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
|
import { PropertyPathResolverProxyHandler } from '@cratis/fundamentals';
|
|
4
|
+
import { setOnceExpression } from '../propertyExpressions.js';
|
|
4
5
|
import { AllSetBuilder } from './AllSetBuilder.js';
|
|
5
6
|
/** Accumulates all-event mappings without restricting the event subscription to known types. */
|
|
6
7
|
export class FromAllBuilder {
|
|
@@ -10,6 +11,10 @@ export class FromAllBuilder {
|
|
|
10
11
|
return new AllSetBuilder(this.targetProperty(readModelPropertyAccessor), (property, expression) => { this.properties[property] = expression; }, this);
|
|
11
12
|
}
|
|
12
13
|
/** @inheritdoc */
|
|
14
|
+
setOnce(readModelPropertyAccessor) {
|
|
15
|
+
return new AllSetBuilder(this.targetProperty(readModelPropertyAccessor), (property, expression) => { this.properties[property] = setOnceExpression(expression); }, this);
|
|
16
|
+
}
|
|
17
|
+
/** @inheritdoc */
|
|
13
18
|
count(readModelPropertyAccessor, contextPropertyName) {
|
|
14
19
|
return this.operation(readModelPropertyAccessor, '$count', contextPropertyName);
|
|
15
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromAllBuilder.js","sourceRoot":"","sources":["../../../projections/declarative/FromAllBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAInD,gGAAgG;AAChG,MAAM,OAAO,cAAc;IACd,UAAU,GAA2B,EAAE,CAAC;IAEjD,kBAAkB;IAClB,GAAG,CAAC,yBAAuD;QACvD,OAAO,IAAI,aAAa,CACpB,IAAI,CAAC,cAAc,CAAC,yBAAyB,CAAC,EAC9C,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EACrE,IAAI,CACP,CAAC;IACN,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,yBAAuD,EAAE,mBAA4B;QACvF,OAAO,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IACpF,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,yBAAuD,EAAE,mBAA4B;QAC3F,OAAO,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;IACxF,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,yBAAuD,EAAE,mBAA4B;QAC3F,OAAO,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;IACxF,CAAC;IAEO,SAAS,CAAC,QAAsC,EAAE,UAAkB,EAAE,mBA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essor } from '@cratis/fundamentals';
|
|
2
2
|
import { ChildAdditionEntry } from './AddChildBuilder.js';
|
|
3
|
+
import { DictionaryKeySource } from './DictionaryKey.js';
|
|
3
4
|
import { IAddBuilder } from './IAddBuilder.js';
|
|
4
5
|
import { IAddChildBuilder } from './IAddChildBuilder.js';
|
|
5
6
|
import { ICompositeKeyBuilder } from './ICompositeKeyBuilder.js';
|
|
@@ -23,7 +24,11 @@ export interface FromEntry {
|
|
|
23
24
|
export declare class FromBuilder<TReadModel, TEvent> implements IFromBuilder<TReadModel, TEvent> {
|
|
24
25
|
readonly entry: FromEntry;
|
|
25
26
|
/** @inheritdoc */
|
|
26
|
-
set(readModelPropertyAccessor: PropertyAccessor<TReadModel>): ISetBuilder<TEvent, IFromBuilder<TReadModel, TEvent>>;
|
|
27
|
+
set(readModelPropertyAccessor: PropertyAccessor<TReadModel>, key?: DictionaryKeySource<TEvent>): ISetBuilder<TEvent, IFromBuilder<TReadModel, TEvent>>;
|
|
28
|
+
/** @inheritdoc */
|
|
29
|
+
setOnce(readModelPropertyAccessor: PropertyAccessor<TReadModel>, key?: DictionaryKeySource<TEvent>): ISetBuilder<TEvent, IFromBuilder<TReadModel, TEvent>>;
|
|
30
|
+
/** @inheritdoc */
|
|
31
|
+
removeKey(readModelPropertyAccessor: PropertyAccessor<TReadModel>, key: DictionaryKeySource<TEvent>): this;
|
|
27
32
|
/** @inheritdoc */
|
|
28
33
|
usingKey(keyAccessor: PropertyAccessor<TEvent>): this;
|
|
29
34
|
/** @inheritdoc */
|
|
@@ -41,15 +46,15 @@ export declare class FromBuilder<TReadModel, TEvent> implements IFromBuilder<TRe
|
|
|
41
46
|
/** @inheritdoc */
|
|
42
47
|
usingConstantParentKey(value: string): this;
|
|
43
48
|
/** @inheritdoc */
|
|
44
|
-
increment(readModelPropertyAccessor: PropertyAccessor<TReadModel>): this;
|
|
49
|
+
increment(readModelPropertyAccessor: PropertyAccessor<TReadModel>, key?: DictionaryKeySource<TEvent>): this;
|
|
45
50
|
/** @inheritdoc */
|
|
46
|
-
decrement(readModelPropertyAccessor: PropertyAccessor<TReadModel>): this;
|
|
51
|
+
decrement(readModelPropertyAccessor: PropertyAccessor<TReadModel>, key?: DictionaryKeySource<TEvent>): this;
|
|
47
52
|
/** @inheritdoc */
|
|
48
|
-
add(readModelPropertyAccessor: PropertyAccessor<TReadModel>): IAddBuilder<TEvent, this>;
|
|
53
|
+
add(readModelPropertyAccessor: PropertyAccessor<TReadModel>, key?: DictionaryKeySource<TEvent>): IAddBuilder<TEvent, this>;
|
|
49
54
|
/** @inheritdoc */
|
|
50
|
-
subtract(readModelPropertyAccessor: PropertyAccessor<TReadModel>): ISubtractBuilder<TEvent, this>;
|
|
55
|
+
subtract(readModelPropertyAccessor: PropertyAccessor<TReadModel>, key?: DictionaryKeySource<TEvent>): ISubtractBuilder<TEvent, this>;
|
|
51
56
|
/** @inheritdoc */
|
|
52
|
-
count(readModelPropertyAccessor: PropertyAccessor<TReadModel>): this;
|
|
57
|
+
count(readModelPropertyAccessor: PropertyAccessor<TReadModel>, key?: DictionaryKeySource<TEvent>): this;
|
|
53
58
|
/** @inheritdoc */
|
|
54
59
|
addChild<TChildModel>(targetPropertyAccessor: (model: TReadModel) => readonly TChildModel[] | null | undefined, builderCallback: (builder: IAddChildBuilder<TChildModel, TEvent> & TEvent) => void): this;
|
|
55
60
|
/** @inheritdoc */
|
|
@@ -58,5 +63,12 @@ export declare class FromBuilder<TReadModel, TEvent> implements IFromBuilder<TRe
|
|
|
58
63
|
addChild<TChildModel>(targetPropertyAccessor: PropertyAccessor<TReadModel>, eventPropertyAccessorOrBuilderCallback: PropertyAccessor<TEvent> | ((builder: IAddChildBuilder<TChildModel, TEvent>) => void)): this;
|
|
59
64
|
/** @inheritdoc */
|
|
60
65
|
setThisValue(): ISetBuilder<TEvent, this>;
|
|
66
|
+
/**
|
|
67
|
+
* Resolves the target property path: the property itself, or the entry of a dictionary-typed property.
|
|
68
|
+
* @param readModelPropertyAccessor - Accessor for the read model property.
|
|
69
|
+
* @param key - Optional dictionary key.
|
|
70
|
+
* @returns The target property path.
|
|
71
|
+
*/
|
|
72
|
+
private targetOf;
|
|
61
73
|
}
|
|
62
74
|
//# sourceMappingURL=FromBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/FromBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"FromBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/FromBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;AAK1F,OAAO,EAAmB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAuB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAKzD;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAClC;AAED;;;;GAIG;AACH,qBAAa,WAAW,CAAC,UAAU,EAAE,MAAM,CAAE,YAAW,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC;IACpF,QAAQ,CAAC,KAAK,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IAAI,GAAG,SAAS,EAAE,qBAAqB,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACvK,kBAAkB;IAClB,QAAQ,CAAC,WAAW,EAChB,sBAAsB,EAAE,gBAAgB,CAAC,UAAU,CAAC,EACpD,sCAAsC,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC,GAC9H,IAAI,CAAC;IAmBR,kBAAkB;IAClB,YAAY,IAAI,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAMxC;IAED;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;CAKnB"}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
import { PropertyPathResolverProxyHandler } from '@cratis/fundamentals';
|
|
4
4
|
import { constantValueExpression } from '../constantValueExpression.js';
|
|
5
5
|
import { eventContextPropertyExpression } from '../eventContextPropertyExpression.js';
|
|
6
|
+
import { removeExpression, setOnceExpression } from '../propertyExpressions.js';
|
|
6
7
|
import { AddBuilder } from './AddBuilder.js';
|
|
7
8
|
import { AddChildBuilder } from './AddChildBuilder.js';
|
|
8
9
|
import { CompositeKeyBuilder } from './CompositeKeyBuilder.js';
|
|
10
|
+
import { dictionaryEntryPath } from './DictionaryKey.js';
|
|
9
11
|
import { SetBuilder } from './SetBuilder.js';
|
|
10
12
|
import { SubtractBuilder } from './SubtractBuilder.js';
|
|
11
13
|
import { recordKeyDeclaration } from './projectionBuilderProvenance.js';
|
|
@@ -22,12 +24,17 @@ export class FromBuilder {
|
|
|
22
24
|
children: []
|
|
23
25
|
};
|
|
24
26
|
/** @inheritdoc */
|
|
25
|
-
set(readModelPropertyAccessor) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return new SetBuilder(
|
|
27
|
+
set(readModelPropertyAccessor, key) {
|
|
28
|
+
return new SetBuilder(this.targetOf(readModelPropertyAccessor, key), (property, expression) => { this.entry.properties[property] = expression; }, this);
|
|
29
|
+
}
|
|
30
|
+
/** @inheritdoc */
|
|
31
|
+
setOnce(readModelPropertyAccessor, key) {
|
|
32
|
+
return new SetBuilder(this.targetOf(readModelPropertyAccessor, key), (property, expression) => { this.entry.properties[property] = setOnceExpression(expression); }, this);
|
|
33
|
+
}
|
|
34
|
+
/** @inheritdoc */
|
|
35
|
+
removeKey(readModelPropertyAccessor, key) {
|
|
36
|
+
this.entry.properties[this.targetOf(readModelPropertyAccessor, key)] = removeExpression;
|
|
37
|
+
return this;
|
|
31
38
|
}
|
|
32
39
|
/** @inheritdoc */
|
|
33
40
|
usingKey(keyAccessor) {
|
|
@@ -88,41 +95,26 @@ export class FromBuilder {
|
|
|
88
95
|
return this;
|
|
89
96
|
}
|
|
90
97
|
/** @inheritdoc */
|
|
91
|
-
increment(readModelPropertyAccessor) {
|
|
92
|
-
|
|
93
|
-
const proxy = new Proxy({}, handler);
|
|
94
|
-
readModelPropertyAccessor(proxy);
|
|
95
|
-
this.entry.properties[handler.property] = '$increment';
|
|
98
|
+
increment(readModelPropertyAccessor, key) {
|
|
99
|
+
this.entry.properties[this.targetOf(readModelPropertyAccessor, key)] = '$increment';
|
|
96
100
|
return this;
|
|
97
101
|
}
|
|
98
102
|
/** @inheritdoc */
|
|
99
|
-
decrement(readModelPropertyAccessor) {
|
|
100
|
-
|
|
101
|
-
const proxy = new Proxy({}, handler);
|
|
102
|
-
readModelPropertyAccessor(proxy);
|
|
103
|
-
this.entry.properties[handler.property] = '$decrement';
|
|
103
|
+
decrement(readModelPropertyAccessor, key) {
|
|
104
|
+
this.entry.properties[this.targetOf(readModelPropertyAccessor, key)] = '$decrement';
|
|
104
105
|
return this;
|
|
105
106
|
}
|
|
106
107
|
/** @inheritdoc */
|
|
107
|
-
add(readModelPropertyAccessor) {
|
|
108
|
-
|
|
109
|
-
const proxy = new Proxy({}, handler);
|
|
110
|
-
readModelPropertyAccessor(proxy);
|
|
111
|
-
return new AddBuilder(handler.property, (property, expression) => { this.entry.properties[property] = expression; }, this);
|
|
108
|
+
add(readModelPropertyAccessor, key) {
|
|
109
|
+
return new AddBuilder(this.targetOf(readModelPropertyAccessor, key), (property, expression) => { this.entry.properties[property] = expression; }, this);
|
|
112
110
|
}
|
|
113
111
|
/** @inheritdoc */
|
|
114
|
-
subtract(readModelPropertyAccessor) {
|
|
115
|
-
|
|
116
|
-
const proxy = new Proxy({}, handler);
|
|
117
|
-
readModelPropertyAccessor(proxy);
|
|
118
|
-
return new SubtractBuilder(handler.property, (property, expression) => { this.entry.properties[property] = expression; }, this);
|
|
112
|
+
subtract(readModelPropertyAccessor, key) {
|
|
113
|
+
return new SubtractBuilder(this.targetOf(readModelPropertyAccessor, key), (property, expression) => { this.entry.properties[property] = expression; }, this);
|
|
119
114
|
}
|
|
120
115
|
/** @inheritdoc */
|
|
121
|
-
count(readModelPropertyAccessor) {
|
|
122
|
-
|
|
123
|
-
const proxy = new Proxy({}, handler);
|
|
124
|
-
readModelPropertyAccessor(proxy);
|
|
125
|
-
this.entry.properties[handler.property] = '$count';
|
|
116
|
+
count(readModelPropertyAccessor, key) {
|
|
117
|
+
this.entry.properties[this.targetOf(readModelPropertyAccessor, key)] = '$count';
|
|
126
118
|
return this;
|
|
127
119
|
}
|
|
128
120
|
addChild(targetPropertyAccessor, eventPropertyAccessorOrBuilderCallback) {
|
|
@@ -141,5 +133,16 @@ export class FromBuilder {
|
|
|
141
133
|
setThisValue() {
|
|
142
134
|
return new SetBuilder('$this', (rp, expr) => { this.entry.properties[rp] = expr; }, this);
|
|
143
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Resolves the target property path: the property itself, or the entry of a dictionary-typed property.
|
|
138
|
+
* @param readModelPropertyAccessor - Accessor for the read model property.
|
|
139
|
+
* @param key - Optional dictionary key.
|
|
140
|
+
* @returns The target property path.
|
|
141
|
+
*/
|
|
142
|
+
targetOf(readModelPropertyAccessor, key) {
|
|
143
|
+
const handler = new PropertyPathResolverProxyHandler();
|
|
144
|
+
readModelPropertyAccessor(new Proxy({}, handler));
|
|
145
|
+
return key === undefined ? handler.property : dictionaryEntryPath(handler.property, key);
|
|
146
|
+
}
|
|
144
147
|
}
|
|
145
148
|
//# sourceMappingURL=FromBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromBuilder.js","sourceRoot":"","sources":["../../../projections/declarative/FromBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAsB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"FromBuilder.js","sourceRoot":"","sources":["../../../projections/declarative/FromBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAsB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAuB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAO9E,OAAO,EAAE,UAAU,EAA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mE,CAAC,UAAU,CAAC,CAAC;QAEjF,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa;YACxC,CAAC,CAAC,EAAE,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,oBAAoB,EAAE,QAAQ,EAAE,KAAK,CAAC,gBAAgB,EAAE,cAAc,EAAE,KAAK,CAAC,sBAAsB,EAAE;YACtK,CAAC,CAAC,EAAE,cAAc,EAAE,aAAa,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAClG,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,kBAAkB;IAClB,YAAY;QACR,OAAO,IAAI,UAAU,CACjB,OAAO,EACP,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,EACnD,IAAI,CACP,CAAC;IACN,CAAC;IAED;;;;;OAKG;IACK,QAAQ,CAAC,yBAAuD,EAAE,GAAiC;QACvG,MAAM,OAAO,GAAG,IAAI,gCAAgC,EAAE,CAAC;QACvD,yBAAyB,CAAC,IAAI,KAAK,CAAC,EAAE,EAAE,OAAO,CAAe,CAAC,CAAC;QAChE,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7F,CAAC;CACJ"}
|
|
@@ -17,6 +17,8 @@ export declare class FromEveryBuilder<TReadModel> implements IFromEveryBuilder<T
|
|
|
17
17
|
/** @inheritdoc */
|
|
18
18
|
set(readModelPropertyAccessor: PropertyAccessor<TReadModel>): IAllSetBuilder<TReadModel, IFromEveryBuilder<TReadModel>>;
|
|
19
19
|
/** @inheritdoc */
|
|
20
|
+
setOnce(readModelPropertyAccessor: PropertyAccessor<TReadModel>): IAllSetBuilder<TReadModel, IFromEveryBuilder<TReadModel>>;
|
|
21
|
+
/** @inheritdoc */
|
|
20
22
|
count(readModelPropertyAccessor: PropertyAccessor<TReadModel>, contextPropertyName: string): IFromEveryBuilder<TReadModel>;
|
|
21
23
|
/** @inheritdoc */
|
|
22
24
|
increment(readModelPropertyAccessor: PropertyAccessor<TReadModel>, contextPropertyName: string): IFromEveryBuilder<TReadModel>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromEveryBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/FromEveryBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"FromEveryBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/FromEveryBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,eAAe,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,qBAAa,gBAAgB,CAAC,UAAU,CAAE,YAAW,iBAAiB,CAAC,UAAU,CAAC;IAC9E,QAAQ,CAAC,KAAK,EAAE,cAAc,CAG5B;IAEF,kBAAkB;IAClB,GAAG,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAWtH;IAED,kBAAkB;IAClB,OAAO,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAQ1H;IAED,kBAAkB;IAClB,KAAK,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,mBAAmB,EAAE,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAOzH;IAED,kBAAkB;IAClB,SAAS,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,mBAAmB,EAAE,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAO7H;IAED,kBAAkB;IAClB,SAAS,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,mBAAmB,EAAE,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAO7H;IAED,kBAAkB;IAClB,uBAAuB,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAGvD;CACJ"}
|
|
@@ -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
|
import { PropertyPathResolverProxyHandler } from '@cratis/fundamentals';
|
|
4
|
+
import { setOnceExpression } from '../propertyExpressions.js';
|
|
4
5
|
import { AllSetBuilder } from './AllSetBuilder.js';
|
|
5
6
|
/**
|
|
6
7
|
* Concrete implementation of {@link IFromEveryBuilder}.
|
|
@@ -20,6 +21,12 @@ export class FromEveryBuilder {
|
|
|
20
21
|
return new AllSetBuilder(property, (targetProperty, expression) => { this.entry.properties[targetProperty] = expression; }, this);
|
|
21
22
|
}
|
|
22
23
|
/** @inheritdoc */
|
|
24
|
+
setOnce(readModelPropertyAccessor) {
|
|
25
|
+
const handler = new PropertyPathResolverProxyHandler();
|
|
26
|
+
readModelPropertyAccessor(new Proxy({}, handler));
|
|
27
|
+
return new AllSetBuilder(handler.property, (targetProperty, expression) => { this.entry.properties[targetProperty] = setOnceExpression(expression); }, this);
|
|
28
|
+
}
|
|
29
|
+
/** @inheritdoc */
|
|
23
30
|
count(readModelPropertyAccessor, contextPropertyName) {
|
|
24
31
|
const handler = new PropertyPathResolverProxyHandler();
|
|
25
32
|
const proxy = new Proxy({}, handler);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromEveryBuilder.js","sourceRoot":"","sources":["../../../projections/declarative/FromEveryBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAG1F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAUnD;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAChB,KAAK,GAAmB;QAC7B,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,IAAI;KACxB,CAAC;IAEF,kBAAkB;IAClB,GAAG,CAAC,yBAAuD;QACvD,MAAM,OAAO,GAAG,IAAI,gCAAgC,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACrC,yBAAyB,CAAC,KAAmB,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAElC,OAAO,IAAI,aAAa,CACpB,QAAQ,EACR,CAAC,cAAc,EAAE,UAAU,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EACvF,IAAI,CACP,CAAC;IACN,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,yBAAuD,EAAE,mBAA2B;QACtF,MAAM,OAAO,GAAG,IAAI,gCAAgC,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACrC,yBAAyB,CAAC,K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AG,KAAK,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PropertyAccessor } from '@cratis/fundamentals';
|
|
2
|
+
import type { CausedByProperty } from '../causedBy.js';
|
|
2
3
|
/**
|
|
3
4
|
* Defines a builder for set operations that apply to all events (fromEvery).
|
|
4
5
|
* @template TReadModel - The read model type.
|
|
@@ -22,5 +23,11 @@ export interface IAllSetBuilder<TReadModel, TParentBuilder> {
|
|
|
22
23
|
* @returns The parent builder for fluent chaining.
|
|
23
24
|
*/
|
|
24
25
|
toEventSourceId(): TParentBuilder;
|
|
26
|
+
/**
|
|
27
|
+
* Maps the read model property from the identity that caused the event, or one of its members.
|
|
28
|
+
* @param property - Optional identity member: `subject`, `name` or `userName`. Omit it for the whole identity.
|
|
29
|
+
* @returns The parent builder for fluent chaining.
|
|
30
|
+
*/
|
|
31
|
+
toCausedBy(property?: CausedByProperty): TParentBuilder;
|
|
25
32
|
}
|
|
26
33
|
//# sourceMappingURL=IAllSetBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAllSetBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/IAllSetBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"IAllSetBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/IAllSetBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,cAAc,CAAC,UAAU,EAAE,cAAc;IACtD;;;;OAIG;IACH,EAAE,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC;IAE5E;;;;OAIG;IACH,sBAAsB,CAAC,mBAAmB,EAAE,MAAM,GAAG,cAAc,CAAC;IAEpE;;;OAGG;IACH,eAAe,IAAI,cAAc,CAAC;IAElC;;;;OAIG;IACH,UAAU,CAAC,QAAQ,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC;CAC3D"}
|
|
@@ -18,5 +18,24 @@ export interface IChildrenBuilder<TParentReadModel, TChildReadModel> extends IPr
|
|
|
18
18
|
* @returns This builder for fluent chaining.
|
|
19
19
|
*/
|
|
20
20
|
fromEventProperty<TEvent>(propertyAccessor: PropertyAccessor<TEvent>): IChildrenBuilder<TParentReadModel, TChildReadModel>;
|
|
21
|
+
/**
|
|
22
|
+
* Adds new children at the start of the collection instead of the end. Updating an existing child never moves it.
|
|
23
|
+
* @returns This builder for fluent chaining.
|
|
24
|
+
*/
|
|
25
|
+
prepend(): IChildrenBuilder<TParentReadModel, TChildReadModel>;
|
|
26
|
+
/**
|
|
27
|
+
* Inserts new children at their position when sorted ascending by a child property. Children without a value sort
|
|
28
|
+
* first and updating an existing child never moves it, even when the property changes.
|
|
29
|
+
* @param propertyAccessor - Accessor for the child property to sort by.
|
|
30
|
+
* @returns This builder for fluent chaining.
|
|
31
|
+
*/
|
|
32
|
+
orderBy(propertyAccessor: PropertyAccessor<TChildReadModel>): IChildrenBuilder<TParentReadModel, TChildReadModel>;
|
|
33
|
+
/**
|
|
34
|
+
* Inserts new children at their position when sorted descending by a child property. Children without a value sort
|
|
35
|
+
* last and updating an existing child never moves it, even when the property changes.
|
|
36
|
+
* @param propertyAccessor - Accessor for the child property to sort by.
|
|
37
|
+
* @returns This builder for fluent chaining.
|
|
38
|
+
*/
|
|
39
|
+
orderByDescending(propertyAccessor: PropertyAccessor<TChildReadModel>): IChildrenBuilder<TParentReadModel, TChildReadModel>;
|
|
21
40
|
}
|
|
22
41
|
//# sourceMappingURL=IChildrenBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IChildrenBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/IChildrenBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAC/D,SAAQ,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAChG;;;;OAIG;IACH,YAAY,CACR,gBAAgB,EAAE,gBAAgB,CAAC,eAAe,CAAC,GACpD,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAEvD;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EACpB,gBAAgB,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAC3C,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"IChildrenBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/IChildrenBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAC/D,SAAQ,kBAAkB,CAAC,eAAe,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAChG;;;;OAIG;IACH,YAAY,CACR,gBAAgB,EAAE,gBAAgB,CAAC,eAAe,CAAC,GACpD,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAEvD;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EACpB,gBAAgB,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAC3C,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAEvD;;;OAGG;IACH,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,eAAe,CAAC,GAAG,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAElH;;;;;OAKG;IACH,iBAAiB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,eAAe,CAAC,GAAG,gBAAgB,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;CAC/H"}
|
|
@@ -8,6 +8,12 @@ export interface IFromAllBuilder<TReadModel> {
|
|
|
8
8
|
* @returns The assignment builder, continuing with this all-events builder.
|
|
9
9
|
*/
|
|
10
10
|
set(readModelPropertyAccessor: PropertyAccessor<TReadModel>): IAllSetBuilder<TReadModel, IFromAllBuilder<TReadModel>>;
|
|
11
|
+
/**
|
|
12
|
+
* Starts an assignment that only sets the read-model property while it has no value yet; later events leave it as it is.
|
|
13
|
+
* @param readModelPropertyAccessor - Target property accessor.
|
|
14
|
+
* @returns The assignment builder, continuing with this builder.
|
|
15
|
+
*/
|
|
16
|
+
setOnce(readModelPropertyAccessor: PropertyAccessor<TReadModel>): IAllSetBuilder<TReadModel, IFromAllBuilder<TReadModel>>;
|
|
11
17
|
/**
|
|
12
18
|
* Counts every event, optionally under a dynamic dictionary key.
|
|
13
19
|
* @param readModelPropertyAccessor - Scalar or dictionary target accessor.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IFromAllBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/IFromAllBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,qGAAqG;AACrG,MAAM,WAAW,eAAe,CAAC,UAAU;IACvC;;;;OAIG;IACH,GAAG,CAAC,yBAAyB,EAAE,gBAA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;;OAKG;IACH,SAAS,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAE9H;;;;;OAKG;IACH,SAAS,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;CACjI"}
|
|
@@ -11,6 +11,12 @@ export interface IFromEveryBuilder<TReadModel> {
|
|
|
11
11
|
* @returns An all-set builder for specifying the value source.
|
|
12
12
|
*/
|
|
13
13
|
set(readModelPropertyAccessor: PropertyAccessor<TReadModel>): IAllSetBuilder<TReadModel, IFromEveryBuilder<TReadModel>>;
|
|
14
|
+
/**
|
|
15
|
+
* Starts an assignment that only sets the read-model property while it has no value yet; later events leave it as it is.
|
|
16
|
+
* @param readModelPropertyAccessor - Target property accessor.
|
|
17
|
+
* @returns The assignment builder, continuing with this builder.
|
|
18
|
+
*/
|
|
19
|
+
setOnce(readModelPropertyAccessor: PropertyAccessor<TReadModel>): IAllSetBuilder<TReadModel, IFromEveryBuilder<TReadModel>>;
|
|
14
20
|
/**
|
|
15
21
|
* Counts every projected event into a dictionary property, using a dynamic key resolved from an event context property.
|
|
16
22
|
* The dictionary value at the resolved key is incremented by one for each matching event.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IFromEveryBuilder.d.ts","sourceRoot":"","sources":["../../../projections/declarative/IFromEveryBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,iBAAiB,CAAC,UAAU;IACzC;;;;OAIG;IACH,GAAG,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,UAAU,EAAE,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