@cratis/chronicle 6.58.0 → 6.60.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 +2 -2
- package/artifacts/DefaultClientArtifactsProvider.ts +13 -1
- package/artifacts/IClientArtifactsProvider.ts +6 -0
- package/connection/ChronicleConnection.ts +2 -2
- package/connection/ChronicleConnectionString.spec.ts +21 -0
- package/connection/ChronicleConnectionString.ts +16 -6
- package/connection/LeastConnectionsLoadBalancerStrategy.ts +1 -1
- package/connection/LoadBalancerStrategyFactory.ts +2 -2
- package/connection/TokenProvider.ts +2 -1
- package/connection/fetchOAuthAccessToken.ts +3 -3
- package/connection/for_ChronicleConnection/when_warning_about_tls_validation/tls_validation_warning.spec.ts +6 -1
- 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/connection/ChronicleConnection.js +2 -2
- package/dist/connection/ChronicleConnection.js.map +1 -1
- package/dist/connection/ChronicleConnectionString.d.ts +7 -2
- package/dist/connection/ChronicleConnectionString.d.ts.map +1 -1
- package/dist/connection/ChronicleConnectionString.js +14 -6
- package/dist/connection/ChronicleConnectionString.js.map +1 -1
- package/dist/connection/LeastConnectionsLoadBalancerStrategy.d.ts +1 -1
- package/dist/connection/LeastConnectionsLoadBalancerStrategy.js +1 -1
- package/dist/connection/LoadBalancerStrategyFactory.d.ts +2 -2
- package/dist/connection/LoadBalancerStrategyFactory.js +2 -2
- package/dist/connection/TokenProvider.d.ts +2 -1
- package/dist/connection/TokenProvider.d.ts.map +1 -1
- package/dist/connection/TokenProvider.js +2 -1
- package/dist/connection/TokenProvider.js.map +1 -1
- package/dist/connection/fetchOAuthAccessToken.d.ts +1 -1
- package/dist/connection/fetchOAuthAccessToken.js +3 -3
- package/dist/connection/fetchOAuthAccessToken.js.map +1 -1
- package/dist/projections/Projections.d.ts.map +1 -1
- package/dist/projections/Projections.js +3 -30
- package/dist/projections/Projections.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 +145 -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 +8 -0
- package/dist/projections/graphs/GraphMemberMappings.d.ts.map +1 -0
- package/dist/projections/graphs/GraphMemberMappings.js +54 -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/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 +48 -0
- package/dist/projections/graphs/index.d.ts.map +1 -0
- package/dist/projections/graphs/index.js +27 -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 +1 -0
- package/dist/projections/index.d.ts.map +1 -1
- package/dist/projections/index.js +1 -0
- package/dist/projections/index.js.map +1 -1
- 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/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/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/Projections.ts +4 -29
- 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 +91 -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 +199 -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/graphs/EdgeCanHaveOnlyOneIdentifyingKey.ts +16 -0
- package/projections/graphs/EdgeMustHaveOneSourceAndOneTarget.ts +16 -0
- package/projections/graphs/GraphDeclaredMoreThanOnce.ts +16 -0
- package/projections/graphs/GraphDefinitionBuilder.ts +166 -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 +57 -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/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 +50 -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 +1 -0
- package/projections/registerProjectionWithRetry.ts +53 -0
- package/readModels/rootReadModelTypes.ts +3 -1
- package/sinks/WellKnownSinks.ts +7 -1
- package/types/DecoratorType.ts +7 -1
|
@@ -27,7 +27,7 @@ export class OAuthTokenHttpError extends Error {
|
|
|
27
27
|
* @param tokenEndpoint - The token endpoint URL.
|
|
28
28
|
* @param clientId - The client identifier.
|
|
29
29
|
* @param clientSecret - The client secret.
|
|
30
|
-
* @param skipTlsValidation -
|
|
30
|
+
* @param skipTlsValidation - The effective setting: `true` skips TLS certificate chain validation, `false` requires it.
|
|
31
31
|
* @returns The parsed token response; rejects when the request fails or the response is not a valid token.
|
|
32
32
|
*/
|
|
33
33
|
export function fetchOAuthAccessToken(tokenEndpoint, clientId, clientSecret, skipTlsValidation) {
|
|
@@ -46,8 +46,8 @@ export function fetchOAuthAccessToken(tokenEndpoint, clientId, clientSecret, ski
|
|
|
46
46
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
47
47
|
'Content-Length': Buffer.byteLength(body)
|
|
48
48
|
},
|
|
49
|
-
// Chain validation is skipped only when skipTlsValidation is
|
|
50
|
-
// matching the gRPC channel's credentials for the same connection string.
|
|
49
|
+
// Chain validation is skipped only when the effective skipTlsValidation is true
|
|
50
|
+
// (an explicit false always requires it), matching the gRPC channel's credentials for the same connection string.
|
|
51
51
|
...(isHttps && skipTlsValidation ? { rejectUnauthorized: false } : {})
|
|
52
52
|
}, response => {
|
|
53
53
|
let data = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchOAuthAccessToken.js","sourceRoot":"","sources":["../../connection/fetchOAuthAccessToken.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAGrB,UAAU;IAFtB,SAAS,CAAU;IAE5B,YAAqB,UAAkB,EAAE,IAAY;QACjD,KAAK,CAAC,oCAAoC,UAAU,KAAK,IAAI,EAAE,CAAC,CAAC;0BADhD,UAAU;QAE3B,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,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kB;IACZ,MAAM,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAchE;IAED,kBAAkB;IAClB,cAAc,CAAC,aAAa,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,CAEzD;IAED,kBAAkB;IACZ,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,GAAE,MAAuC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAezH;IAED,OAAO,CAAC,mBAAmB;IAI3B;;;;;OAKG;IACH,OAAO,CAAC,2BAA2B;IAmBnC;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAcjC,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,yBAAyB;CAYpC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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 { createLogger } from '../logging/createLogger.js';
|
|
4
|
-
import { ProjectionOwner } from '@cratis/chronicle.contracts';
|
|
5
4
|
import { Guid } from '@cratis/fundamentals';
|
|
6
5
|
import { EventSequenceId } from '../eventSequences/EventSequenceId.js';
|
|
7
6
|
import { EventSequenceNumber } from '../eventSequences/EventSequenceNumber.js';
|
|
@@ -16,6 +15,7 @@ import { getEventSequenceMetadata } from './modelBound/eventSequence.js';
|
|
|
16
15
|
import { isModelBoundProjection } from './modelBound/isModelBoundProjection.js';
|
|
17
16
|
import { ProjectionId } from './ProjectionId.js';
|
|
18
17
|
import { ProjectionDefinitionCompiler } from './ProjectionDefinitionCompiler.js';
|
|
18
|
+
import { registerProjectionWithRetry } from './registerProjectionWithRetry.js';
|
|
19
19
|
import { UnableToQueryProjection } from './UnableToQueryProjection.js';
|
|
20
20
|
/**
|
|
21
21
|
* Implements {@link IProjections}, managing discovery and registration of projections
|
|
@@ -231,35 +231,8 @@ export class Projections {
|
|
|
231
231
|
}
|
|
232
232
|
return EventSequenceId.eventLog.value;
|
|
233
233
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
237
|
-
try {
|
|
238
|
-
this._logger.info('Registering projection', { identifier, readModel: projection.ReadModel, attempt });
|
|
239
|
-
await this._connection.projections.register({
|
|
240
|
-
EventStore: this._eventStore,
|
|
241
|
-
Owner: ProjectionOwner.PROJECTION_OWNER_Client,
|
|
242
|
-
Projections: [projection]
|
|
243
|
-
});
|
|
244
|
-
this._logger.info('Projection registered successfully', { identifier });
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
catch (error) {
|
|
248
|
-
const msg = String(error);
|
|
249
|
-
const isTransient = msg.includes('UNKNOWN') || msg.includes('UNAVAILABLE') || msg.includes('INTERNAL');
|
|
250
|
-
if (!isTransient || attempt === maxAttempts) {
|
|
251
|
-
throw new Error(`Failed to register projection '${identifier}' after ${attempt} attempt(s): ${msg}`);
|
|
252
|
-
}
|
|
253
|
-
this._logger.warn('Projection registration failed with transient error, retrying', {
|
|
254
|
-
identifier,
|
|
255
|
-
attempt,
|
|
256
|
-
nextAttemptInMs: delay,
|
|
257
|
-
error
|
|
258
|
-
});
|
|
259
|
-
await new Promise(resolve => setTimeout(resolve, delay));
|
|
260
|
-
delay = Math.min(delay * 2, 15000);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
234
|
+
registerWithRetry(projection, identifier) {
|
|
235
|
+
return registerProjectionWithRetry(this._connection, this._eventStore, this._logger, projection, identifier);
|
|
263
236
|
}
|
|
264
237
|
resolveModelBoundMetadata(type) {
|
|
265
238
|
if (isModelBoundProjection(type)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Projections.js","sourceRoot":"","sources":["../../projections/Projections.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"Projections.js","sourceRoot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} from '@cratis/fundamentals';
|
|
2
|
+
import { Graphs } from '../../graphs/Graphs.js';
|
|
3
|
+
/**
|
|
4
|
+
* Discovers the graphs of the given nodes, edges and fluent graph projections.
|
|
5
|
+
* @param graphElements - The nodes and edges.
|
|
6
|
+
* @param graphProjections - The fluent graph projections.
|
|
7
|
+
* @param sinkTypeId - The sink type of the graphs.
|
|
8
|
+
* @returns The graphs, once discovered, and what is needed to look at what they registered.
|
|
9
|
+
*/
|
|
10
|
+
export declare function discoverGraphs(graphElements: Constructor[], graphProjections?: Constructor[], sinkTypeId?: string): Promise<{
|
|
11
|
+
connection: import("../../../connection/ChronicleConnection.js").ChronicleConnection;
|
|
12
|
+
readModelRequests: {
|
|
13
|
+
EventStore: string;
|
|
14
|
+
Owner: number;
|
|
15
|
+
ReadModels: Array<{
|
|
16
|
+
Type: {
|
|
17
|
+
Identifier: string;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
Source: number;
|
|
21
|
+
}[];
|
|
22
|
+
projectionRequests: {
|
|
23
|
+
EventStore: string;
|
|
24
|
+
Owner: number;
|
|
25
|
+
Projections: any[];
|
|
26
|
+
}[];
|
|
27
|
+
graphs: Graphs;
|
|
28
|
+
}>;
|
|
29
|
+
//# sourceMappingURL=a_discovered_graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a_discovered_graph.d.ts","sourceRoot":"","sources":["../../../../projections/for_Graphs/given/a_discovered_graph.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAIhD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,aAAa,EAAE,WAAW,EAAE,EAAE,gBAAgB,GAAE,WAAW,EAAO,EAAE,UAAU,SAAU;;;;;;;;;;;;;;;;;;GAK5H"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { Graphs } from '../../graphs/Graphs.js';
|
|
4
|
+
import { aFakeConnection } from './a_fake_connection.js';
|
|
5
|
+
import { artifactsWith } from './organization.js';
|
|
6
|
+
/**
|
|
7
|
+
* Discovers the graphs of the given nodes, edges and fluent graph projections.
|
|
8
|
+
* @param graphElements - The nodes and edges.
|
|
9
|
+
* @param graphProjections - The fluent graph projections.
|
|
10
|
+
* @param sinkTypeId - The sink type of the graphs.
|
|
11
|
+
* @returns The graphs, once discovered, and what is needed to look at what they registered.
|
|
12
|
+
*/
|
|
13
|
+
export async function discoverGraphs(graphElements, graphProjections = [], sinkTypeId = 'Neo4j') {
|
|
14
|
+
const fake = aFakeConnection();
|
|
15
|
+
const graphs = new Graphs('the-store', fake.connection, artifactsWith(graphElements, graphProjections), sinkTypeId);
|
|
16
|
+
await graphs.discover();
|
|
17
|
+
return { graphs, ...fake };
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=a_discovered_graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a_discovered_graph.js","sourceRoot":"","sources":["../../../../projections/for_Graphs/given/a_discovered_graph.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,aAA4B,EAAE,gBAAgB,GAAkB,EAAE,EAAE,UAAU,GAAG,OAAO;IACzH,MAAM,IAAI,GAAG,eAAe,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,aAAa,EAAE,gBAAgB,CAAC,EAAE,UAAU,CAAC,CAAC;IACpH,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ChronicleConnection } from '../../../connection/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a connection that records what is registered.
|
|
4
|
+
* @returns The connection and what was registered with it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function aFakeConnection(): {
|
|
7
|
+
connection: ChronicleConnection;
|
|
8
|
+
readModelRequests: {
|
|
9
|
+
EventStore: string;
|
|
10
|
+
Owner: number;
|
|
11
|
+
ReadModels: Array<{
|
|
12
|
+
Type: {
|
|
13
|
+
Identifier: string;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
Source: number;
|
|
17
|
+
}[];
|
|
18
|
+
projectionRequests: {
|
|
19
|
+
EventStore: string;
|
|
20
|
+
Owner: number;
|
|
21
|
+
Projections: any[];
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=a_fake_connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a_fake_connection.d.ts","sourceRoot":"","sources":["../../../../projections/for_Graphs/given/a_fake_connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE;;;GAGG;AACH,wBAAgB,eAAe;;;oBACkB,MAAM;eAAS,MAAM;oBAAc,KAAK,CAAC;YAAE,IAAI,EAAE;gBAAE,UAAU,EAAE,MAAM,CAAA;aAAE,CAAA;SAAE,CAAC;gBAAU,MAAM;;;oBACzF,MAAM;eAAS,MAAM;qBAAe,GAAG,EAAE;;EAO1F"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* Creates a connection that records what is registered.
|
|
5
|
+
* @returns The connection and what was registered with it.
|
|
6
|
+
*/
|
|
7
|
+
export function aFakeConnection() {
|
|
8
|
+
const readModelRequests = [];
|
|
9
|
+
const projectionRequests = [];
|
|
10
|
+
const connection = {
|
|
11
|
+
logger: undefined,
|
|
12
|
+
readModels: { registerMany: async (request) => { readModelRequests.push(request); return {}; } },
|
|
13
|
+
projections: { register: async (request) => { projectionRequests.push(request); return {}; } }
|
|
14
|
+
};
|
|
15
|
+
return { connection, readModelRequests, projectionRequests };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=a_fake_connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a_fake_connection.js","sourceRoot":"","sources":["../../../../projections/for_Graphs/given/a_fake_connection.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAIrG;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC3B,MAAM,iBAAiB,GAAsH,EAAE,CAAC;IAChJ,MAAM,kBAAkB,GAAqE,EAAE,CAAC;IAChG,MAAM,UAAU,GAAG;QACf,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,OAA2C,EAAE,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE;QACpI,WAAW,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,OAA4C,EAAE,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE;KACpG,CAAC;IACpC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { IClientArtifactsProvider } from '../../../artifacts/IClientArtifactsProvider.js';
|
|
3
|
+
import type { Constructor } from '@cratis/fundamentals';
|
|
4
|
+
export declare class PersonRegistered {
|
|
5
|
+
personId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class PersonRemoved {
|
|
9
|
+
personId: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class GroupCreated {
|
|
12
|
+
groupId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class MemberAdded {
|
|
16
|
+
personId: string;
|
|
17
|
+
groupId: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class MemberRemoved {
|
|
20
|
+
personId: string;
|
|
21
|
+
groupId: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class Person {
|
|
24
|
+
personId: string;
|
|
25
|
+
name: string;
|
|
26
|
+
}
|
|
27
|
+
export declare class Group {
|
|
28
|
+
groupId: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class MemberOf {
|
|
32
|
+
personId: string;
|
|
33
|
+
groupId: string;
|
|
34
|
+
since: Date;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a provider that finds only the given graph artifacts.
|
|
38
|
+
* @param graphElements - The nodes and edges.
|
|
39
|
+
* @param graphProjections - The fluent graph projections.
|
|
40
|
+
* @returns The provider.
|
|
41
|
+
*/
|
|
42
|
+
export declare function artifactsWith(graphElements: Constructor[], graphProjections?: Constructor[]): IClientArtifactsProvider;
|
|
43
|
+
//# sourceMappingURL=organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../../../projections/for_Graphs/given/organization.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAa/F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,qBAAa,gBAAgB;IACzB,QAAQ,SAAM;IACd,IAAI,SAAM;CACb;AAGD,qBAAa,aAAa;IACtB,QAAQ,SAAM;CACjB;AAGD,qBAAa,YAAY;IACrB,OAAO,SAAM;IACb,IAAI,SAAM;CACb;AAGD,qBAAa,WAAW;IACpB,QAAQ,SAAM;IACd,OAAO,SAAM;CAChB;AAGD,qBAAa,aAAa;IACtB,QAAQ,SAAM;IACd,OAAO,SAAM;CAChB;AAGD,qBAAa,MAAM;IACf,QAAQ,SAAM;IACd,IAAI,SAAM;CACb;AAOD,qBAAa,KAAK;IACd,OAAO,SAAM;IACb,IAAI,SAAM;CACb;AAMD,qBAAa,QAAQ;IACjB,QAAQ,SAAM;IACd,OAAO,SAAM;IACb,KAAK,OAAc;CACtB;AAUD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,aAAa,EAAE,WAAW,EAAE,EAAE,gBAAgB,GAAE,WAAW,EAAO,GAAG,wBAAwB,CAK1H"}
|
|
@@ -0,0 +1,84 @@
|
|
|
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 'reflect-metadata';
|
|
4
|
+
import { field } from '@cratis/fundamentals';
|
|
5
|
+
import { eventType } from '../../../events/eventTypeDecorator.js';
|
|
6
|
+
import { edge } from '../../graphs/edge.js';
|
|
7
|
+
import { edgeFrom } from '../../graphs/edgeFrom.js';
|
|
8
|
+
import { edgeRemovedWith } from '../../graphs/edgeRemovedWith.js';
|
|
9
|
+
import { edgeSource } from '../../graphs/edgeSource.js';
|
|
10
|
+
import { edgeTarget } from '../../graphs/edgeTarget.js';
|
|
11
|
+
import { graph } from '../../graphs/graph.js';
|
|
12
|
+
import { graphKey } from '../../graphs/graphKey.js';
|
|
13
|
+
import { node } from '../../graphs/node.js';
|
|
14
|
+
import { nodeFrom } from '../../graphs/nodeFrom.js';
|
|
15
|
+
import { nodeRemovedWith } from '../../graphs/nodeRemovedWith.js';
|
|
16
|
+
import { setFromContext } from '../../modelBound/setFromContext.js';
|
|
17
|
+
// Decorators are applied as plain function calls so the fixtures do not depend on decorator-syntax support.
|
|
18
|
+
export class PersonRegistered {
|
|
19
|
+
personId = '';
|
|
20
|
+
name = '';
|
|
21
|
+
}
|
|
22
|
+
eventType()(PersonRegistered);
|
|
23
|
+
export class PersonRemoved {
|
|
24
|
+
personId = '';
|
|
25
|
+
}
|
|
26
|
+
eventType()(PersonRemoved);
|
|
27
|
+
export class GroupCreated {
|
|
28
|
+
groupId = '';
|
|
29
|
+
name = '';
|
|
30
|
+
}
|
|
31
|
+
eventType()(GroupCreated);
|
|
32
|
+
export class MemberAdded {
|
|
33
|
+
personId = '';
|
|
34
|
+
groupId = '';
|
|
35
|
+
}
|
|
36
|
+
eventType()(MemberAdded);
|
|
37
|
+
export class MemberRemoved {
|
|
38
|
+
personId = '';
|
|
39
|
+
groupId = '';
|
|
40
|
+
}
|
|
41
|
+
eventType()(MemberRemoved);
|
|
42
|
+
export class Person {
|
|
43
|
+
personId = '';
|
|
44
|
+
name = '';
|
|
45
|
+
}
|
|
46
|
+
graph('Organization')(Person);
|
|
47
|
+
node()(Person);
|
|
48
|
+
graphKey()(Person.prototype, 'personId');
|
|
49
|
+
nodeFrom(PersonRegistered, { key: 'personId' })(Person);
|
|
50
|
+
nodeRemovedWith(PersonRemoved, { key: 'personId', detach: true })(Person);
|
|
51
|
+
export class Group {
|
|
52
|
+
groupId = '';
|
|
53
|
+
name = '';
|
|
54
|
+
}
|
|
55
|
+
graph('Organization')(Group);
|
|
56
|
+
node()(Group);
|
|
57
|
+
graphKey()(Group.prototype, 'groupId');
|
|
58
|
+
nodeFrom(GroupCreated, { key: 'groupId' })(Group);
|
|
59
|
+
export class MemberOf {
|
|
60
|
+
personId = '';
|
|
61
|
+
groupId = '';
|
|
62
|
+
since = new Date();
|
|
63
|
+
}
|
|
64
|
+
field(Date)(MemberOf.prototype, 'since');
|
|
65
|
+
graph('Organization')(MemberOf);
|
|
66
|
+
edge('MEMBER_OF')(MemberOf);
|
|
67
|
+
edgeSource(Person)(MemberOf.prototype, 'personId');
|
|
68
|
+
edgeTarget(Group)(MemberOf.prototype, 'groupId');
|
|
69
|
+
setFromContext(MemberAdded, 'occurred')(MemberOf.prototype, 'since');
|
|
70
|
+
edgeFrom(MemberAdded, { sourceKey: 'personId', targetKey: 'groupId' })(MemberOf);
|
|
71
|
+
edgeRemovedWith(MemberRemoved, { sourceKey: 'personId', targetKey: 'groupId' })(MemberOf);
|
|
72
|
+
/**
|
|
73
|
+
* Creates a provider that finds only the given graph artifacts.
|
|
74
|
+
* @param graphElements - The nodes and edges.
|
|
75
|
+
* @param graphProjections - The fluent graph projections.
|
|
76
|
+
* @returns The provider.
|
|
77
|
+
*/
|
|
78
|
+
export function artifactsWith(graphElements, graphProjections = []) {
|
|
79
|
+
return {
|
|
80
|
+
eventTypes: [], readModels: [], reactors: [], reducers: [], seeders: [], constraints: [], projections: [],
|
|
81
|
+
webhooks: [], eventTypeMigrations: [], globalForHandlers: [], graphElements, graphProjections
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=organization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../../../projections/for_Graphs/given/organization.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,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AC,CAAC,QAAQ,CAAC,CAAC;AACjF,eAAe,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,aAA4B,EAAE,gBAAgB,GAAkB,EAAE;IAC5F,OAAO;QACH,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE;QACzG,QAAQ,EAAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,aAAa,EAAE,gBAAgB;KAChG,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when an edge type has more than one identifying key.
|
|
3
|
+
*/
|
|
4
|
+
export declare class EdgeCanHaveOnlyOneIdentifyingKey extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new {@link EdgeCanHaveOnlyOneIdentifyingKey}.
|
|
7
|
+
* @param type - The edge type.
|
|
8
|
+
*/
|
|
9
|
+
constructor(type: Function);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=EdgeCanHaveOnlyOneIdentifyingKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EdgeCanHaveOnlyOneIdentifyingKey.d.ts","sourceRoot":"","sources":["../../../projections/graphs/EdgeCanHaveOnlyOneIdentifyingKey.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,gCAAiC,SAAQ,KAAK;IACvD;;;OAGG;IACH,YAAY,IAAI,EAAE,QAAQ,EAGzB;CACJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when an edge type has more than one identifying key.
|
|
5
|
+
*/
|
|
6
|
+
export class EdgeCanHaveOnlyOneIdentifyingKey extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new {@link EdgeCanHaveOnlyOneIdentifyingKey}.
|
|
9
|
+
* @param type - The edge type.
|
|
10
|
+
*/
|
|
11
|
+
constructor(type) {
|
|
12
|
+
super(`The edge type '${type.name}' can have at most one member with the graphKey decorator, the one that identifies the edge.`);
|
|
13
|
+
this.name = 'EdgeCanHaveOnlyOneIdentifyingKey';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=EdgeCanHaveOnlyOneIdentifyingKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EdgeCanHaveOnlyOneIdentifyingKey.js","sourceRoot":"","sources":["../../../projections/graphs/EdgeCanHaveOnlyOneIdentifyingKey.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;GAEG;AACH,MAAM,OAAO,gCAAiC,SAAQ,KAAK;IACvD;;;OAGG;IACH,YAAY,IAAc;QACtB,KAAK,CAAC,kBAAkB,IAAI,CAAC,IAAI,8FAA8F,CAAC,CAAC;QACjI,IAAI,CAAC,IAAI,GAAG,kCAAkC,CAAC;IACnD,CAAC;CACJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when an edge type does not name its end nodes.
|
|
3
|
+
*/
|
|
4
|
+
export declare class EdgeMustHaveOneSourceAndOneTarget extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new {@link EdgeMustHaveOneSourceAndOneTarget}.
|
|
7
|
+
* @param type - The edge type.
|
|
8
|
+
*/
|
|
9
|
+
constructor(type: Function);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=EdgeMustHaveOneSourceAndOneTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EdgeMustHaveOneSourceAndOneTarget.d.ts","sourceRoot":"","sources":["../../../projections/graphs/EdgeMustHaveOneSourceAndOneTarget.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,iCAAkC,SAAQ,KAAK;IACxD;;;OAGG;IACH,YAAY,IAAI,EAAE,QAAQ,EAGzB;CACJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when an edge type does not name its end nodes.
|
|
5
|
+
*/
|
|
6
|
+
export class EdgeMustHaveOneSourceAndOneTarget extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new {@link EdgeMustHaveOneSourceAndOneTarget}.
|
|
9
|
+
* @param type - The edge type.
|
|
10
|
+
*/
|
|
11
|
+
constructor(type) {
|
|
12
|
+
super(`The edge type '${type.name}' must have exactly one member with the edgeSource decorator and exactly one with the edgeTarget decorator.`);
|
|
13
|
+
this.name = 'EdgeMustHaveOneSourceAndOneTarget';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=EdgeMustHaveOneSourceAndOneTarget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EdgeMustHaveOneSourceAndOneTarget.js","sourceRoot":"","sources":["../../../projections/graphs/EdgeMustHaveOneSourceAndOneTarget.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;GAEG;AACH,MAAM,OAAO,iCAAkC,SAAQ,KAAK;IACxD;;;OAGG;IACH,YAAY,IAAc;QACtB,KAAK,CAAC,kBAAkB,IAAI,CAAC,IAAI,6GAA6G,CAAC,CAAC;QAChJ,IAAI,CAAC,IAAI,GAAG,mCAAmC,CAAC;IACpD,CAAC;CACJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when two declarations produce a graph with the same name.
|
|
3
|
+
*/
|
|
4
|
+
export declare class GraphDeclaredMoreThanOnce extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new {@link GraphDeclaredMoreThanOnce}.
|
|
7
|
+
* @param graph - The name of the graph.
|
|
8
|
+
*/
|
|
9
|
+
constructor(graph: string);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=GraphDeclaredMoreThanOnce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphDeclaredMoreThanOnce.d.ts","sourceRoot":"","sources":["../../../projections/graphs/GraphDeclaredMoreThanOnce.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAChD;;;OAGG;IACH,YAAY,KAAK,EAAE,MAAM,EAGxB;CACJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when two declarations produce a graph with the same name.
|
|
5
|
+
*/
|
|
6
|
+
export class GraphDeclaredMoreThanOnce extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new {@link GraphDeclaredMoreThanOnce}.
|
|
9
|
+
* @param graph - The name of the graph.
|
|
10
|
+
*/
|
|
11
|
+
constructor(graph) {
|
|
12
|
+
super(`The graph '${graph}' is declared by more than one graph projection. A graph is the read model of exactly one projection.`);
|
|
13
|
+
this.name = 'GraphDeclaredMoreThanOnce';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=GraphDeclaredMoreThanOnce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphDeclaredMoreThanOnce.js","sourceRoot":"","sources":["../../../projections/graphs/GraphDeclaredMoreThanOnce.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAChD;;;OAGG;IACH,YAAY,KAAa;QACrB,KAAK,CAAC,cAAc,KAAK,uGAAuG,CAAC,CAAC;QAClI,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC5C,CAAC;CACJ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { GraphModel } from './GraphModel.js';
|
|
2
|
+
import type { GraphRegistration } from './GraphRegistration.js';
|
|
3
|
+
/**
|
|
4
|
+
* Turns a {@link GraphModel} into the definitions that are registered with the kernel. The shape follows the
|
|
5
|
+
* .NET client's GraphDefinitionBuilder, so the same graph declared with either client registers the same definition.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GraphDefinitionBuilder {
|
|
8
|
+
private readonly _schemaWriter;
|
|
9
|
+
/**
|
|
10
|
+
* Builds the registration of a graph.
|
|
11
|
+
* @param model - The {@link GraphModel}.
|
|
12
|
+
* @param projectionId - The identifier of the projection that fills the graph.
|
|
13
|
+
* @param sinkTypeId - The identifier of the sink type that stores the graph.
|
|
14
|
+
* @returns The {@link GraphRegistration}.
|
|
15
|
+
*/
|
|
16
|
+
build(model: GraphModel, projectionId: string, sinkTypeId: string): GraphRegistration;
|
|
17
|
+
private node;
|
|
18
|
+
private edge;
|
|
19
|
+
private eventTypeOf;
|
|
20
|
+
private identity;
|
|
21
|
+
private properties;
|
|
22
|
+
private eventPropertyNamed;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=GraphDefinitionBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphDefinitionBuilder.d.ts","sourceRoot":"","sources":["../../../projections/graphs/GraphDefinitionBuilder.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAMhE;;;GAGG;AACH,qBAAa,sBAAsB;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2B;IAEzD;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,iBAAiB,CAiDpF;IAED,OAAO,CAAC,IAAI;IAkBZ,OAAO,CAAC,IAAI;IAwBZ,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,kBAAkB;CAM7B"}
|