@cratis/chronicle 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChronicleClient.ts +453 -0
- package/ChronicleOptions.ts +104 -0
- package/EventSequences/AppendError.ts +10 -0
- package/EventSequences/AppendOptions.ts +15 -0
- package/EventSequences/AppendResult.ts +23 -0
- package/EventSequences/ConstraintViolation.ts +16 -0
- package/EventSequences/EventLog.ts +21 -0
- package/EventSequences/EventSequence.ts +372 -0
- package/EventSequences/EventSequenceId.ts +17 -0
- package/EventSequences/EventSequenceNumber.ts +38 -0
- package/EventSequences/IEventLog.ts +10 -0
- package/EventSequences/IEventSequence.ts +47 -0
- package/EventSequences/index.ts +13 -0
- package/EventStore.ts +132 -0
- package/EventStoreName.ts +14 -0
- package/EventStoreNamespaceName.ts +17 -0
- package/Events/AppendedEvent.ts +19 -0
- package/Events/CausationEntry.ts +13 -0
- package/Events/Constraints/ConstraintBuilder.ts +86 -0
- package/Events/Constraints/ConstraintId.ts +14 -0
- package/Events/Constraints/Constraints.ts +117 -0
- package/Events/Constraints/IConstraint.ts +18 -0
- package/Events/Constraints/IConstraintBuilder.ts +44 -0
- package/Events/Constraints/IConstraints.ts +28 -0
- package/Events/Constraints/IUniqueConstraintBuilder.ts +52 -0
- package/Events/Constraints/UniqueConstraintBuilder.ts +97 -0
- package/Events/Constraints/constraint.ts +56 -0
- package/Events/Constraints/index.ts +15 -0
- package/Events/EventContext.ts +28 -0
- package/Events/EventType.ts +41 -0
- package/Events/EventTypeGeneration.ts +20 -0
- package/Events/EventTypeId.ts +19 -0
- package/Events/EventTypes.ts +95 -0
- package/Events/IEventTypes.ts +39 -0
- package/Events/eventTypeDecorator.ts +147 -0
- package/Events/index.ts +14 -0
- package/IChronicleClient.ts +39 -0
- package/IEventStore.ts +56 -0
- package/Metrics.ts +109 -0
- package/Observation/ObserverId.ts +14 -0
- package/Observation/ObserverRunningState.ts +34 -0
- package/Observation/index.ts +5 -0
- package/Projections/IProjections.ts +19 -0
- package/Projections/ProjectionId.ts +14 -0
- package/Projections/Projections.ts +463 -0
- package/Projections/declarative/AllSetBuilder.ts +39 -0
- package/Projections/declarative/FromBuilder.ts +144 -0
- package/Projections/declarative/FromEveryBuilder.ts +46 -0
- package/Projections/declarative/IAddBuilder.ts +18 -0
- package/Projections/declarative/IAddChildBuilder.ts +25 -0
- package/Projections/declarative/IAllSetBuilder.ts +31 -0
- package/Projections/declarative/IChildrenBuilder.ts +31 -0
- package/Projections/declarative/ICompositeKeyBuilder.ts +22 -0
- package/Projections/declarative/IFromBuilder.ts +12 -0
- package/Projections/declarative/IFromEveryBuilder.ts +24 -0
- package/Projections/declarative/IJoinBuilder.ts +20 -0
- package/Projections/declarative/INestedBuilder.ts +19 -0
- package/Projections/declarative/IProjectionBuilder.ts +98 -0
- package/Projections/declarative/IProjectionBuilderFor.ts +38 -0
- package/Projections/declarative/IProjectionFor.ts +18 -0
- package/Projections/declarative/IReadModelPropertiesBuilder.ts +132 -0
- package/Projections/declarative/IRemovedWithBuilder.ts +25 -0
- package/Projections/declarative/IRemovedWithJoinBuilder.ts +25 -0
- package/Projections/declarative/ISetBuilder.ts +38 -0
- package/Projections/declarative/ISubtractBuilder.ts +18 -0
- package/Projections/declarative/JoinBuilder.ts +148 -0
- package/Projections/declarative/ProjectionBuilderFor.ts +277 -0
- package/Projections/declarative/RemovedWithBuilder.ts +40 -0
- package/Projections/declarative/RemovedWithJoinBuilder.ts +43 -0
- package/Projections/declarative/SetBuilder.ts +46 -0
- package/Projections/declarative/index.ts +26 -0
- package/Projections/declarative/projection.ts +59 -0
- package/Projections/index.ts +8 -0
- package/Projections/modelBound/FromEventMetadata.ts +10 -0
- package/Projections/modelBound/FromEventOptions.ts +12 -0
- package/Projections/modelBound/addFrom.ts +41 -0
- package/Projections/modelBound/childrenFrom.ts +52 -0
- package/Projections/modelBound/clearWith.ts +54 -0
- package/Projections/modelBound/count.ts +41 -0
- package/Projections/modelBound/decrement.ts +41 -0
- package/Projections/modelBound/fromEvent.ts +40 -0
- package/Projections/modelBound/fromEvery.ts +39 -0
- package/Projections/modelBound/increment.ts +41 -0
- package/Projections/modelBound/index.ts +38 -0
- package/Projections/modelBound/join.ts +44 -0
- package/Projections/modelBound/modelBound.ts +59 -0
- package/Projections/modelBound/nested.ts +29 -0
- package/Projections/modelBound/notRewindable.ts +24 -0
- package/Projections/modelBound/removedWith.ts +60 -0
- package/Projections/modelBound/removedWithJoin.ts +55 -0
- package/Projections/modelBound/setFrom.ts +41 -0
- package/Projections/modelBound/setFromContext.ts +41 -0
- package/Projections/modelBound/setValue.ts +41 -0
- package/Projections/modelBound/subtractFrom.ts +41 -0
- package/README.md +69 -0
- package/Reactors/IReactors.ts +19 -0
- package/Reactors/ReactorId.ts +14 -0
- package/Reactors/Reactors.ts +320 -0
- package/Reactors/index.ts +8 -0
- package/Reactors/reactor.ts +75 -0
- package/ReadModels/ReadModelId.ts +14 -0
- package/ReadModels/index.ts +6 -0
- package/ReadModels/readModel.ts +89 -0
- package/Reducers/IReducers.ts +19 -0
- package/Reducers/ReducerId.ts +14 -0
- package/Reducers/Reducers.ts +322 -0
- package/Reducers/index.ts +8 -0
- package/Reducers/reducer.ts +87 -0
- package/Schemas/JsonSchema.ts +18 -0
- package/Schemas/JsonSchemaGenerator.ts +107 -0
- package/Schemas/index.ts +6 -0
- package/Schemas/jsonSchemaProperty.ts +24 -0
- package/Tracing.ts +21 -0
- package/artifacts/DefaultClientArtifactsProvider.ts +56 -0
- package/artifacts/IClientArtifactsProvider.ts +30 -0
- package/artifacts/index.ts +5 -0
- package/connection/ChronicleConnection.ts +226 -0
- package/connection/ChronicleConnectionString.ts +4 -0
- package/connection/ChronicleServices.ts +4 -0
- package/connection/ConnectionLifecycle.ts +77 -0
- package/connection/DateTimeOffset.ts +4 -0
- package/connection/Guid.ts +4 -0
- package/connection/TokenProvider.ts +13 -0
- package/connection/index.ts +9 -0
- package/dist/ChronicleClient.d.ts +55 -0
- package/dist/ChronicleClient.d.ts.map +1 -0
- package/dist/ChronicleClient.js +396 -0
- package/dist/ChronicleClient.js.map +1 -0
- package/dist/ChronicleOptions.d.ts +54 -0
- package/dist/ChronicleOptions.d.ts.map +1 -0
- package/dist/ChronicleOptions.js +75 -0
- package/dist/ChronicleOptions.js.map +1 -0
- package/dist/EventSequences/AppendError.d.ts +8 -0
- package/dist/EventSequences/AppendError.d.ts.map +1 -0
- package/dist/EventSequences/AppendError.js +4 -0
- package/dist/EventSequences/AppendError.js.map +1 -0
- package/dist/EventSequences/AppendOptions.d.ts +11 -0
- package/dist/EventSequences/AppendOptions.d.ts.map +1 -0
- package/dist/EventSequences/AppendOptions.js +4 -0
- package/dist/EventSequences/AppendOptions.js.map +1 -0
- package/dist/EventSequences/AppendResult.d.ts +17 -0
- package/dist/EventSequences/AppendResult.d.ts.map +1 -0
- package/dist/EventSequences/AppendResult.js +4 -0
- package/dist/EventSequences/AppendResult.js.map +1 -0
- package/dist/EventSequences/ConstraintViolation.d.ts +12 -0
- package/dist/EventSequences/ConstraintViolation.d.ts.map +1 -0
- package/dist/EventSequences/ConstraintViolation.js +4 -0
- package/dist/EventSequences/ConstraintViolation.js.map +1 -0
- package/dist/EventSequences/EventLog.d.ts +11 -0
- package/dist/EventSequences/EventLog.d.ts.map +1 -0
- package/dist/EventSequences/EventLog.js +14 -0
- package/dist/EventSequences/EventLog.js.map +1 -0
- package/dist/EventSequences/EventSequence.d.ts +27 -0
- package/dist/EventSequences/EventSequence.d.ts.map +1 -0
- package/dist/EventSequences/EventSequence.js +337 -0
- package/dist/EventSequences/EventSequence.js.map +1 -0
- package/dist/EventSequences/EventSequenceId.d.ts +12 -0
- package/dist/EventSequences/EventSequenceId.d.ts.map +1 -0
- package/dist/EventSequences/EventSequenceId.js +18 -0
- package/dist/EventSequences/EventSequenceId.js.map +1 -0
- package/dist/EventSequences/EventSequenceNumber.d.ts +26 -0
- package/dist/EventSequences/EventSequenceNumber.d.ts.map +1 -0
- package/dist/EventSequences/EventSequenceNumber.js +36 -0
- package/dist/EventSequences/EventSequenceNumber.js.map +1 -0
- package/dist/EventSequences/IEventLog.d.ts +8 -0
- package/dist/EventSequences/IEventLog.d.ts.map +1 -0
- package/dist/EventSequences/IEventLog.js +4 -0
- package/dist/EventSequences/IEventLog.js.map +1 -0
- package/dist/EventSequences/IEventSequence.d.ts +40 -0
- package/dist/EventSequences/IEventSequence.d.ts.map +1 -0
- package/dist/EventSequences/IEventSequence.js +4 -0
- package/dist/EventSequences/IEventSequence.js.map +1 -0
- package/dist/EventSequences/index.d.ts +11 -0
- package/dist/EventSequences/index.d.ts.map +1 -0
- package/dist/EventSequences/index.js +7 -0
- package/dist/EventSequences/index.js.map +1 -0
- package/dist/EventStore.d.ts +42 -0
- package/dist/EventStore.d.ts.map +1 -0
- package/dist/EventStore.js +111 -0
- package/dist/EventStore.js.map +1 -0
- package/dist/EventStoreName.d.ts +10 -0
- package/dist/EventStoreName.d.ts.map +1 -0
- package/dist/EventStoreName.js +16 -0
- package/dist/EventStoreName.js.map +1 -0
- package/dist/EventStoreNamespaceName.d.ts +12 -0
- package/dist/EventStoreNamespaceName.d.ts.map +1 -0
- package/dist/EventStoreNamespaceName.js +18 -0
- package/dist/EventStoreNamespaceName.js.map +1 -0
- package/dist/Events/AppendedEvent.d.ts +14 -0
- package/dist/Events/AppendedEvent.d.ts.map +1 -0
- package/dist/Events/AppendedEvent.js +4 -0
- package/dist/Events/AppendedEvent.js.map +1 -0
- package/dist/Events/CausationEntry.d.ts +10 -0
- package/dist/Events/CausationEntry.d.ts.map +1 -0
- package/dist/Events/CausationEntry.js +4 -0
- package/dist/Events/CausationEntry.js.map +1 -0
- package/dist/Events/Constraints/ConstraintBuilder.d.ts +42 -0
- package/dist/Events/Constraints/ConstraintBuilder.d.ts.map +1 -0
- package/dist/Events/Constraints/ConstraintBuilder.js +55 -0
- package/dist/Events/Constraints/ConstraintBuilder.js.map +1 -0
- package/dist/Events/Constraints/ConstraintId.d.ts +10 -0
- package/dist/Events/Constraints/ConstraintId.d.ts.map +1 -0
- package/dist/Events/Constraints/ConstraintId.js +16 -0
- package/dist/Events/Constraints/ConstraintId.js.map +1 -0
- package/dist/Events/Constraints/Constraints.d.ts +27 -0
- package/dist/Events/Constraints/Constraints.d.ts.map +1 -0
- package/dist/Events/Constraints/Constraints.js +104 -0
- package/dist/Events/Constraints/Constraints.js.map +1 -0
- package/dist/Events/Constraints/IConstraint.d.ts +15 -0
- package/dist/Events/Constraints/IConstraint.d.ts.map +1 -0
- package/dist/Events/Constraints/IConstraint.js +4 -0
- package/dist/Events/Constraints/IConstraint.js.map +1 -0
- package/dist/Events/Constraints/IConstraintBuilder.d.ts +37 -0
- package/dist/Events/Constraints/IConstraintBuilder.d.ts.map +1 -0
- package/dist/Events/Constraints/IConstraintBuilder.js +4 -0
- package/dist/Events/Constraints/IConstraintBuilder.js.map +1 -0
- package/dist/Events/Constraints/IConstraints.d.ts +23 -0
- package/dist/Events/Constraints/IConstraints.d.ts.map +1 -0
- package/dist/Events/Constraints/IConstraints.js +4 -0
- package/dist/Events/Constraints/IConstraints.js.map +1 -0
- package/dist/Events/Constraints/IUniqueConstraintBuilder.d.ts +44 -0
- package/dist/Events/Constraints/IUniqueConstraintBuilder.d.ts.map +1 -0
- package/dist/Events/Constraints/IUniqueConstraintBuilder.js +4 -0
- package/dist/Events/Constraints/IUniqueConstraintBuilder.js.map +1 -0
- package/dist/Events/Constraints/UniqueConstraintBuilder.d.ts +42 -0
- package/dist/Events/Constraints/UniqueConstraintBuilder.d.ts.map +1 -0
- package/dist/Events/Constraints/UniqueConstraintBuilder.js +72 -0
- package/dist/Events/Constraints/UniqueConstraintBuilder.js.map +1 -0
- package/dist/Events/Constraints/constraint.d.ts +29 -0
- package/dist/Events/Constraints/constraint.d.ts.map +1 -0
- package/dist/Events/Constraints/constraint.js +39 -0
- package/dist/Events/Constraints/constraint.js.map +1 -0
- package/dist/Events/Constraints/index.d.ts +13 -0
- package/dist/Events/Constraints/index.d.ts.map +1 -0
- package/dist/Events/Constraints/index.js +8 -0
- package/dist/Events/Constraints/index.js.map +1 -0
- package/dist/Events/EventContext.d.ts +20 -0
- package/dist/Events/EventContext.d.ts.map +1 -0
- package/dist/Events/EventContext.js +4 -0
- package/dist/Events/EventContext.js.map +1 -0
- package/dist/Events/EventType.d.ts +23 -0
- package/dist/Events/EventType.d.ts.map +1 -0
- package/dist/Events/EventType.js +40 -0
- package/dist/Events/EventType.js.map +1 -0
- package/dist/Events/EventTypeGeneration.d.ts +14 -0
- package/dist/Events/EventTypeGeneration.d.ts.map +1 -0
- package/dist/Events/EventTypeGeneration.js +20 -0
- package/dist/Events/EventTypeGeneration.js.map +1 -0
- package/dist/Events/EventTypeId.d.ts +14 -0
- package/dist/Events/EventTypeId.d.ts.map +1 -0
- package/dist/Events/EventTypeId.js +20 -0
- package/dist/Events/EventTypeId.js.map +1 -0
- package/dist/Events/EventTypes.d.ts +33 -0
- package/dist/Events/EventTypes.d.ts.map +1 -0
- package/dist/Events/EventTypes.js +83 -0
- package/dist/Events/EventTypes.js.map +1 -0
- package/dist/Events/IEventTypes.d.ts +32 -0
- package/dist/Events/IEventTypes.d.ts.map +1 -0
- package/dist/Events/IEventTypes.js +4 -0
- package/dist/Events/IEventTypes.js.map +1 -0
- package/dist/Events/eventTypeDecorator.d.ts +71 -0
- package/dist/Events/eventTypeDecorator.d.ts.map +1 -0
- package/dist/Events/eventTypeDecorator.js +86 -0
- package/dist/Events/eventTypeDecorator.js.map +1 -0
- package/dist/Events/index.d.ts +12 -0
- package/dist/Events/index.d.ts.map +1 -0
- package/dist/Events/index.js +9 -0
- package/dist/Events/index.js.map +1 -0
- package/dist/Grpc.d.ts +19 -0
- package/dist/Grpc.d.ts.map +1 -0
- package/dist/Grpc.js +33 -0
- package/dist/Grpc.js.map +1 -0
- package/dist/IChronicleClient.d.ts +33 -0
- package/dist/IChronicleClient.d.ts.map +1 -0
- package/dist/IChronicleClient.js +4 -0
- package/dist/IChronicleClient.js.map +1 -0
- package/dist/IEventStore.d.ts +44 -0
- package/dist/IEventStore.d.ts.map +1 -0
- package/dist/IEventStore.js +4 -0
- package/dist/IEventStore.js.map +1 -0
- package/dist/Metrics.d.ts +70 -0
- package/dist/Metrics.d.ts.map +1 -0
- package/dist/Metrics.js +100 -0
- package/dist/Metrics.js.map +1 -0
- package/dist/Observation/ObserverId.d.ts +10 -0
- package/dist/Observation/ObserverId.d.ts.map +1 -0
- package/dist/Observation/ObserverId.js +16 -0
- package/dist/Observation/ObserverId.js.map +1 -0
- package/dist/Observation/ObserverRunningState.d.ts +24 -0
- package/dist/Observation/ObserverRunningState.d.ts.map +1 -0
- package/dist/Observation/ObserverRunningState.js +27 -0
- package/dist/Observation/ObserverRunningState.js.map +1 -0
- package/dist/Observation/index.d.ts +3 -0
- package/dist/Observation/index.d.ts.map +1 -0
- package/dist/Observation/index.js +5 -0
- package/dist/Observation/index.js.map +1 -0
- package/dist/Projections/IProjections.d.ts +16 -0
- package/dist/Projections/IProjections.d.ts.map +1 -0
- package/dist/Projections/IProjections.js +4 -0
- package/dist/Projections/IProjections.js.map +1 -0
- package/dist/Projections/ProjectionId.d.ts +10 -0
- package/dist/Projections/ProjectionId.d.ts.map +1 -0
- package/dist/Projections/ProjectionId.js +16 -0
- package/dist/Projections/ProjectionId.js.map +1 -0
- package/dist/Projections/Projections.d.ts +36 -0
- package/dist/Projections/Projections.d.ts.map +1 -0
- package/dist/Projections/Projections.js +390 -0
- package/dist/Projections/Projections.js.map +1 -0
- package/dist/Projections/declarative/AllSetBuilder.d.ts +20 -0
- package/dist/Projections/declarative/AllSetBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/AllSetBuilder.js +37 -0
- package/dist/Projections/declarative/AllSetBuilder.js.map +1 -0
- package/dist/Projections/declarative/FromBuilder.d.ts +56 -0
- package/dist/Projections/declarative/FromBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/FromBuilder.js +105 -0
- package/dist/Projections/declarative/FromBuilder.js.map +1 -0
- package/dist/Projections/declarative/FromEveryBuilder.d.ts +22 -0
- package/dist/Projections/declarative/FromEveryBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/FromEveryBuilder.js +28 -0
- package/dist/Projections/declarative/FromEveryBuilder.js.map +1 -0
- package/dist/Projections/declarative/IAddBuilder.d.ts +15 -0
- package/dist/Projections/declarative/IAddBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IAddBuilder.js +4 -0
- package/dist/Projections/declarative/IAddBuilder.js.map +1 -0
- package/dist/Projections/declarative/IAddChildBuilder.d.ts +21 -0
- package/dist/Projections/declarative/IAddChildBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IAddChildBuilder.js +4 -0
- package/dist/Projections/declarative/IAddChildBuilder.js.map +1 -0
- package/dist/Projections/declarative/IAllSetBuilder.d.ts +26 -0
- package/dist/Projections/declarative/IAllSetBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IAllSetBuilder.js +4 -0
- package/dist/Projections/declarative/IAllSetBuilder.js.map +1 -0
- package/dist/Projections/declarative/IChildrenBuilder.d.ts +22 -0
- package/dist/Projections/declarative/IChildrenBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IChildrenBuilder.js +4 -0
- package/dist/Projections/declarative/IChildrenBuilder.js.map +1 -0
- package/dist/Projections/declarative/ICompositeKeyBuilder.d.ts +16 -0
- package/dist/Projections/declarative/ICompositeKeyBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/ICompositeKeyBuilder.js +4 -0
- package/dist/Projections/declarative/ICompositeKeyBuilder.js.map +1 -0
- package/dist/Projections/declarative/IFromBuilder.d.ts +9 -0
- package/dist/Projections/declarative/IFromBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IFromBuilder.js +4 -0
- package/dist/Projections/declarative/IFromBuilder.js.map +1 -0
- package/dist/Projections/declarative/IFromEveryBuilder.d.ts +20 -0
- package/dist/Projections/declarative/IFromEveryBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IFromEveryBuilder.js +4 -0
- package/dist/Projections/declarative/IFromEveryBuilder.js.map +1 -0
- package/dist/Projections/declarative/IJoinBuilder.d.ts +16 -0
- package/dist/Projections/declarative/IJoinBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IJoinBuilder.js +4 -0
- package/dist/Projections/declarative/IJoinBuilder.js.map +1 -0
- package/dist/Projections/declarative/INestedBuilder.d.ts +15 -0
- package/dist/Projections/declarative/INestedBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/INestedBuilder.js +4 -0
- package/dist/Projections/declarative/INestedBuilder.js.map +1 -0
- package/dist/Projections/declarative/IProjectionBuilder.d.ts +80 -0
- package/dist/Projections/declarative/IProjectionBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IProjectionBuilder.js +4 -0
- package/dist/Projections/declarative/IProjectionBuilder.js.map +1 -0
- package/dist/Projections/declarative/IProjectionBuilderFor.d.ts +31 -0
- package/dist/Projections/declarative/IProjectionBuilderFor.d.ts.map +1 -0
- package/dist/Projections/declarative/IProjectionBuilderFor.js +4 -0
- package/dist/Projections/declarative/IProjectionBuilderFor.js.map +1 -0
- package/dist/Projections/declarative/IProjectionFor.d.ts +15 -0
- package/dist/Projections/declarative/IProjectionFor.d.ts.map +1 -0
- package/dist/Projections/declarative/IProjectionFor.js +4 -0
- package/dist/Projections/declarative/IProjectionFor.js.map +1 -0
- package/dist/Projections/declarative/IReadModelPropertiesBuilder.d.ts +111 -0
- package/dist/Projections/declarative/IReadModelPropertiesBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IReadModelPropertiesBuilder.js +4 -0
- package/dist/Projections/declarative/IReadModelPropertiesBuilder.js.map +1 -0
- package/dist/Projections/declarative/IRemovedWithBuilder.d.ts +21 -0
- package/dist/Projections/declarative/IRemovedWithBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IRemovedWithBuilder.js +4 -0
- package/dist/Projections/declarative/IRemovedWithBuilder.js.map +1 -0
- package/dist/Projections/declarative/IRemovedWithJoinBuilder.d.ts +21 -0
- package/dist/Projections/declarative/IRemovedWithJoinBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/IRemovedWithJoinBuilder.js +4 -0
- package/dist/Projections/declarative/IRemovedWithJoinBuilder.js.map +1 -0
- package/dist/Projections/declarative/ISetBuilder.d.ts +32 -0
- package/dist/Projections/declarative/ISetBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/ISetBuilder.js +4 -0
- package/dist/Projections/declarative/ISetBuilder.js.map +1 -0
- package/dist/Projections/declarative/ISubtractBuilder.d.ts +15 -0
- package/dist/Projections/declarative/ISubtractBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/ISubtractBuilder.js +4 -0
- package/dist/Projections/declarative/ISubtractBuilder.js.map +1 -0
- package/dist/Projections/declarative/JoinBuilder.d.ts +58 -0
- package/dist/Projections/declarative/JoinBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/JoinBuilder.js +107 -0
- package/dist/Projections/declarative/JoinBuilder.js.map +1 -0
- package/dist/Projections/declarative/ProjectionBuilderFor.d.ts +68 -0
- package/dist/Projections/declarative/ProjectionBuilderFor.d.ts.map +1 -0
- package/dist/Projections/declarative/ProjectionBuilderFor.js +207 -0
- package/dist/Projections/declarative/ProjectionBuilderFor.js.map +1 -0
- package/dist/Projections/declarative/RemovedWithBuilder.d.ts +22 -0
- package/dist/Projections/declarative/RemovedWithBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/RemovedWithBuilder.js +28 -0
- package/dist/Projections/declarative/RemovedWithBuilder.js.map +1 -0
- package/dist/Projections/declarative/RemovedWithJoinBuilder.d.ts +22 -0
- package/dist/Projections/declarative/RemovedWithJoinBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/RemovedWithJoinBuilder.js +31 -0
- package/dist/Projections/declarative/RemovedWithJoinBuilder.js.map +1 -0
- package/dist/Projections/declarative/SetBuilder.d.ts +23 -0
- package/dist/Projections/declarative/SetBuilder.d.ts.map +1 -0
- package/dist/Projections/declarative/SetBuilder.js +43 -0
- package/dist/Projections/declarative/SetBuilder.js.map +1 -0
- package/dist/Projections/declarative/index.d.ts +24 -0
- package/dist/Projections/declarative/index.d.ts.map +1 -0
- package/dist/Projections/declarative/index.js +8 -0
- package/dist/Projections/declarative/index.js.map +1 -0
- package/dist/Projections/declarative/projection.d.ts +31 -0
- package/dist/Projections/declarative/projection.d.ts.map +1 -0
- package/dist/Projections/declarative/projection.js +39 -0
- package/dist/Projections/declarative/projection.js.map +1 -0
- package/dist/Projections/index.d.ts +6 -0
- package/dist/Projections/index.d.ts.map +1 -0
- package/dist/Projections/index.js +7 -0
- package/dist/Projections/index.js.map +1 -0
- package/dist/Projections/modelBound/FromEventMetadata.d.ts +7 -0
- package/dist/Projections/modelBound/FromEventMetadata.d.ts.map +1 -0
- package/dist/Projections/modelBound/FromEventMetadata.js +4 -0
- package/dist/Projections/modelBound/FromEventMetadata.js.map +1 -0
- package/dist/Projections/modelBound/FromEventOptions.d.ts +10 -0
- package/dist/Projections/modelBound/FromEventOptions.d.ts.map +1 -0
- package/dist/Projections/modelBound/FromEventOptions.js +4 -0
- package/dist/Projections/modelBound/FromEventOptions.js.map +1 -0
- package/dist/Projections/modelBound/addFrom.d.ts +23 -0
- package/dist/Projections/modelBound/addFrom.d.ts.map +1 -0
- package/dist/Projections/modelBound/addFrom.js +30 -0
- package/dist/Projections/modelBound/addFrom.js.map +1 -0
- package/dist/Projections/modelBound/childrenFrom.d.ts +29 -0
- package/dist/Projections/modelBound/childrenFrom.d.ts.map +1 -0
- package/dist/Projections/modelBound/childrenFrom.js +32 -0
- package/dist/Projections/modelBound/childrenFrom.js.map +1 -0
- package/dist/Projections/modelBound/clearWith.d.ts +28 -0
- package/dist/Projections/modelBound/clearWith.d.ts.map +1 -0
- package/dist/Projections/modelBound/clearWith.js +45 -0
- package/dist/Projections/modelBound/clearWith.js.map +1 -0
- package/dist/Projections/modelBound/count.d.ts +23 -0
- package/dist/Projections/modelBound/count.d.ts.map +1 -0
- package/dist/Projections/modelBound/count.js +30 -0
- package/dist/Projections/modelBound/count.js.map +1 -0
- package/dist/Projections/modelBound/decrement.d.ts +23 -0
- package/dist/Projections/modelBound/decrement.d.ts.map +1 -0
- package/dist/Projections/modelBound/decrement.js +30 -0
- package/dist/Projections/modelBound/decrement.js.map +1 -0
- package/dist/Projections/modelBound/fromEvent.d.ts +23 -0
- package/dist/Projections/modelBound/fromEvent.d.ts.map +1 -0
- package/dist/Projections/modelBound/fromEvent.js +34 -0
- package/dist/Projections/modelBound/fromEvent.js.map +1 -0
- package/dist/Projections/modelBound/fromEvery.d.ts +23 -0
- package/dist/Projections/modelBound/fromEvery.d.ts.map +1 -0
- package/dist/Projections/modelBound/fromEvery.js +28 -0
- package/dist/Projections/modelBound/fromEvery.js.map +1 -0
- package/dist/Projections/modelBound/increment.d.ts +23 -0
- package/dist/Projections/modelBound/increment.d.ts.map +1 -0
- package/dist/Projections/modelBound/increment.js +30 -0
- package/dist/Projections/modelBound/increment.js.map +1 -0
- package/dist/Projections/modelBound/index.d.ts +36 -0
- package/dist/Projections/modelBound/index.d.ts.map +1 -0
- package/dist/Projections/modelBound/index.js +21 -0
- package/dist/Projections/modelBound/index.js.map +1 -0
- package/dist/Projections/modelBound/join.d.ts +26 -0
- package/dist/Projections/modelBound/join.d.ts.map +1 -0
- package/dist/Projections/modelBound/join.js +31 -0
- package/dist/Projections/modelBound/join.js.map +1 -0
- package/dist/Projections/modelBound/modelBound.d.ts +31 -0
- package/dist/Projections/modelBound/modelBound.d.ts.map +1 -0
- package/dist/Projections/modelBound/modelBound.js +39 -0
- package/dist/Projections/modelBound/modelBound.js.map +1 -0
- package/dist/Projections/modelBound/nested.d.ts +16 -0
- package/dist/Projections/modelBound/nested.d.ts.map +1 -0
- package/dist/Projections/modelBound/nested.js +26 -0
- package/dist/Projections/modelBound/nested.js.map +1 -0
- package/dist/Projections/modelBound/notRewindable.d.ts +14 -0
- package/dist/Projections/modelBound/notRewindable.d.ts.map +1 -0
- package/dist/Projections/modelBound/notRewindable.js +21 -0
- package/dist/Projections/modelBound/notRewindable.js.map +1 -0
- package/dist/Projections/modelBound/removedWith.d.ts +34 -0
- package/dist/Projections/modelBound/removedWith.d.ts.map +1 -0
- package/dist/Projections/modelBound/removedWith.js +47 -0
- package/dist/Projections/modelBound/removedWith.js.map +1 -0
- package/dist/Projections/modelBound/removedWithJoin.d.ts +29 -0
- package/dist/Projections/modelBound/removedWithJoin.d.ts.map +1 -0
- package/dist/Projections/modelBound/removedWithJoin.js +44 -0
- package/dist/Projections/modelBound/removedWithJoin.js.map +1 -0
- package/dist/Projections/modelBound/setFrom.d.ts +23 -0
- package/dist/Projections/modelBound/setFrom.d.ts.map +1 -0
- package/dist/Projections/modelBound/setFrom.js +30 -0
- package/dist/Projections/modelBound/setFrom.js.map +1 -0
- package/dist/Projections/modelBound/setFromContext.d.ts +23 -0
- package/dist/Projections/modelBound/setFromContext.d.ts.map +1 -0
- package/dist/Projections/modelBound/setFromContext.js +30 -0
- package/dist/Projections/modelBound/setFromContext.js.map +1 -0
- package/dist/Projections/modelBound/setValue.d.ts +23 -0
- package/dist/Projections/modelBound/setValue.d.ts.map +1 -0
- package/dist/Projections/modelBound/setValue.js +30 -0
- package/dist/Projections/modelBound/setValue.js.map +1 -0
- package/dist/Projections/modelBound/subtractFrom.d.ts +23 -0
- package/dist/Projections/modelBound/subtractFrom.d.ts.map +1 -0
- package/dist/Projections/modelBound/subtractFrom.js +30 -0
- package/dist/Projections/modelBound/subtractFrom.js.map +1 -0
- package/dist/Reactors/IReactors.d.ts +16 -0
- package/dist/Reactors/IReactors.d.ts.map +1 -0
- package/dist/Reactors/IReactors.js +4 -0
- package/dist/Reactors/IReactors.js.map +1 -0
- package/dist/Reactors/ReactorId.d.ts +10 -0
- package/dist/Reactors/ReactorId.d.ts.map +1 -0
- package/dist/Reactors/ReactorId.js +16 -0
- package/dist/Reactors/ReactorId.js.map +1 -0
- package/dist/Reactors/Reactors.d.ts +38 -0
- package/dist/Reactors/Reactors.d.ts.map +1 -0
- package/dist/Reactors/Reactors.js +279 -0
- package/dist/Reactors/Reactors.js.map +1 -0
- package/dist/Reactors/index.d.ts +6 -0
- package/dist/Reactors/index.d.ts.map +1 -0
- package/dist/Reactors/index.js +6 -0
- package/dist/Reactors/index.js.map +1 -0
- package/dist/Reactors/reactor.d.ts +47 -0
- package/dist/Reactors/reactor.d.ts.map +1 -0
- package/dist/Reactors/reactor.js +55 -0
- package/dist/Reactors/reactor.js.map +1 -0
- package/dist/ReadModels/ReadModelId.d.ts +10 -0
- package/dist/ReadModels/ReadModelId.d.ts.map +1 -0
- package/dist/ReadModels/ReadModelId.js +16 -0
- package/dist/ReadModels/ReadModelId.js.map +1 -0
- package/dist/ReadModels/index.d.ts +4 -0
- package/dist/ReadModels/index.d.ts.map +1 -0
- package/dist/ReadModels/index.js +5 -0
- package/dist/ReadModels/index.js.map +1 -0
- package/dist/ReadModels/readModel.d.ts +33 -0
- package/dist/ReadModels/readModel.d.ts.map +1 -0
- package/dist/ReadModels/readModel.js +64 -0
- package/dist/ReadModels/readModel.js.map +1 -0
- package/dist/Reducers/IReducers.d.ts +16 -0
- package/dist/Reducers/IReducers.d.ts.map +1 -0
- package/dist/Reducers/IReducers.js +4 -0
- package/dist/Reducers/IReducers.js.map +1 -0
- package/dist/Reducers/ReducerId.d.ts +10 -0
- package/dist/Reducers/ReducerId.d.ts.map +1 -0
- package/dist/Reducers/ReducerId.js +16 -0
- package/dist/Reducers/ReducerId.js.map +1 -0
- package/dist/Reducers/Reducers.d.ts +38 -0
- package/dist/Reducers/Reducers.d.ts.map +1 -0
- package/dist/Reducers/Reducers.js +279 -0
- package/dist/Reducers/Reducers.js.map +1 -0
- package/dist/Reducers/index.d.ts +6 -0
- package/dist/Reducers/index.d.ts.map +1 -0
- package/dist/Reducers/index.js +6 -0
- package/dist/Reducers/index.js.map +1 -0
- package/dist/Reducers/reducer.d.ts +51 -0
- package/dist/Reducers/reducer.d.ts.map +1 -0
- package/dist/Reducers/reducer.js +59 -0
- package/dist/Reducers/reducer.js.map +1 -0
- package/dist/Schemas/JsonSchema.d.ts +16 -0
- package/dist/Schemas/JsonSchema.d.ts.map +1 -0
- package/dist/Schemas/JsonSchema.js +4 -0
- package/dist/Schemas/JsonSchema.js.map +1 -0
- package/dist/Schemas/JsonSchemaGenerator.d.ts +26 -0
- package/dist/Schemas/JsonSchemaGenerator.d.ts.map +1 -0
- package/dist/Schemas/JsonSchemaGenerator.js +90 -0
- package/dist/Schemas/JsonSchemaGenerator.js.map +1 -0
- package/dist/Schemas/index.d.ts +4 -0
- package/dist/Schemas/index.d.ts.map +1 -0
- package/dist/Schemas/index.js +5 -0
- package/dist/Schemas/index.js.map +1 -0
- package/dist/Schemas/jsonSchemaProperty.d.ts +13 -0
- package/dist/Schemas/jsonSchemaProperty.d.ts.map +1 -0
- package/dist/Schemas/jsonSchemaProperty.js +22 -0
- package/dist/Schemas/jsonSchemaProperty.js.map +1 -0
- package/dist/Tracing.d.ts +16 -0
- package/dist/Tracing.d.ts.map +1 -0
- package/dist/Tracing.js +19 -0
- package/dist/Tracing.js.map +1 -0
- package/dist/artifacts/DefaultClientArtifactsProvider.d.ts +31 -0
- package/dist/artifacts/DefaultClientArtifactsProvider.d.ts.map +1 -0
- package/dist/artifacts/DefaultClientArtifactsProvider.js +48 -0
- package/dist/artifacts/DefaultClientArtifactsProvider.js.map +1 -0
- package/dist/artifacts/IClientArtifactsProvider.d.ts +21 -0
- package/dist/artifacts/IClientArtifactsProvider.d.ts.map +1 -0
- package/dist/artifacts/IClientArtifactsProvider.js +4 -0
- package/dist/artifacts/IClientArtifactsProvider.js.map +1 -0
- package/dist/artifacts/index.d.ts +3 -0
- package/dist/artifacts/index.d.ts.map +1 -0
- package/dist/artifacts/index.js +4 -0
- package/dist/artifacts/index.js.map +1 -0
- package/dist/connection/ChronicleConnection.d.ts +117 -0
- package/dist/connection/ChronicleConnection.d.ts.map +1 -0
- package/dist/connection/ChronicleConnection.js +194 -0
- package/dist/connection/ChronicleConnection.js.map +1 -0
- package/dist/connection/ChronicleConnectionString.d.ts +2 -0
- package/dist/connection/ChronicleConnectionString.d.ts.map +1 -0
- package/dist/connection/ChronicleConnectionString.js +4 -0
- package/dist/connection/ChronicleConnectionString.js.map +1 -0
- package/dist/connection/ChronicleServices.d.ts +2 -0
- package/dist/connection/ChronicleServices.d.ts.map +1 -0
- package/dist/connection/ChronicleServices.js +4 -0
- package/dist/connection/ChronicleServices.js.map +1 -0
- package/dist/connection/ConnectionLifecycle.d.ts +41 -0
- package/dist/connection/ConnectionLifecycle.d.ts.map +1 -0
- package/dist/connection/ConnectionLifecycle.js +66 -0
- package/dist/connection/ConnectionLifecycle.js.map +1 -0
- package/dist/connection/DateTimeOffset.d.ts +2 -0
- package/dist/connection/DateTimeOffset.d.ts.map +1 -0
- package/dist/connection/DateTimeOffset.js +4 -0
- package/dist/connection/DateTimeOffset.js.map +1 -0
- package/dist/connection/Guid.d.ts +2 -0
- package/dist/connection/Guid.d.ts.map +1 -0
- package/dist/connection/Guid.js +4 -0
- package/dist/connection/Guid.js.map +1 -0
- package/dist/connection/TokenProvider.d.ts +5 -0
- package/dist/connection/TokenProvider.d.ts.map +1 -0
- package/dist/connection/TokenProvider.js +4 -0
- package/dist/connection/TokenProvider.js.map +1 -0
- package/dist/connection/index.d.ts +7 -0
- package/dist/connection/index.d.ts.map +1 -0
- package/dist/connection/index.js +7 -0
- package/dist/connection/index.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/DecoratorType.d.ts +20 -0
- package/dist/types/DecoratorType.d.ts.map +1 -0
- package/dist/types/DecoratorType.js +23 -0
- package/dist/types/DecoratorType.js.map +1 -0
- package/dist/types/TypeDiscoverer.d.ts +54 -0
- package/dist/types/TypeDiscoverer.d.ts.map +1 -0
- package/dist/types/TypeDiscoverer.js +91 -0
- package/dist/types/TypeDiscoverer.js.map +1 -0
- package/dist/types/TypeIntrospector.d.ts +30 -0
- package/dist/types/TypeIntrospector.d.ts.map +1 -0
- package/dist/types/TypeIntrospector.js +154 -0
- package/dist/types/TypeIntrospector.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/index.ts +24 -0
- package/package.json +38 -0
- package/types/DecoratorType.ts +28 -0
- package/types/TypeDiscoverer.ts +109 -0
- package/types/TypeIntrospector.ts +176 -0
- package/types/index.ts +6 -0
|
@@ -0,0 +1,207 @@
|
|
|
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 { AutoMap } from '@cratis/chronicle.contracts';
|
|
4
|
+
import { getEventTypeFor } from '../../Events/eventTypeDecorator';
|
|
5
|
+
import { EventSequenceId } from '../../EventSequences/EventSequenceId';
|
|
6
|
+
import { JoinBuilder } from './JoinBuilder';
|
|
7
|
+
import { FromEveryBuilder } from './FromEveryBuilder';
|
|
8
|
+
import { FromBuilder } from './FromBuilder';
|
|
9
|
+
import { RemovedWithBuilder } from './RemovedWithBuilder';
|
|
10
|
+
import { RemovedWithJoinBuilder } from './RemovedWithJoinBuilder';
|
|
11
|
+
/**
|
|
12
|
+
* Concrete implementation of {@link IProjectionBuilderFor} that accumulates projection
|
|
13
|
+
* configuration and produces a Chronicle-compatible projection definition payload.
|
|
14
|
+
* @template TReadModel - The read model type this projection produces.
|
|
15
|
+
*/
|
|
16
|
+
export class ProjectionBuilderFor {
|
|
17
|
+
_eventSequenceId = EventSequenceId.eventLog.value;
|
|
18
|
+
_containerName;
|
|
19
|
+
_rewindable = true;
|
|
20
|
+
_active = true;
|
|
21
|
+
_autoMap = AutoMap.Enabled;
|
|
22
|
+
_initialState = '{}';
|
|
23
|
+
_from = [];
|
|
24
|
+
_join = [];
|
|
25
|
+
_removedWith = [];
|
|
26
|
+
_removedWithJoin = [];
|
|
27
|
+
_all = {
|
|
28
|
+
Properties: {},
|
|
29
|
+
IncludeChildren: false,
|
|
30
|
+
AutoMap: AutoMap.Inherit
|
|
31
|
+
};
|
|
32
|
+
/** @inheritdoc */
|
|
33
|
+
fromEventSequence(eventSequenceId) {
|
|
34
|
+
this._eventSequenceId = eventSequenceId;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
/** @inheritdoc */
|
|
38
|
+
containerName(name) {
|
|
39
|
+
this._containerName = name;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
/** @inheritdoc */
|
|
43
|
+
notRewindable() {
|
|
44
|
+
this._rewindable = false;
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
/** @inheritdoc */
|
|
48
|
+
passive() {
|
|
49
|
+
this._active = false;
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
/** @inheritdoc */
|
|
53
|
+
autoMap() {
|
|
54
|
+
this._autoMap = AutoMap.Enabled;
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
/** @inheritdoc */
|
|
58
|
+
noAutoMap() {
|
|
59
|
+
this._autoMap = AutoMap.Disabled;
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
/** @inheritdoc */
|
|
63
|
+
withInitialValues(initialValueProvider) {
|
|
64
|
+
this._initialState = JSON.stringify(initialValueProvider());
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
/** @inheritdoc */
|
|
68
|
+
from(eventType, builderCallback) {
|
|
69
|
+
const contractType = this.toContractEventType(eventType);
|
|
70
|
+
const fromBuilder = new FromBuilder();
|
|
71
|
+
builderCallback?.(fromBuilder);
|
|
72
|
+
this._from.push({
|
|
73
|
+
Key: contractType,
|
|
74
|
+
Value: {
|
|
75
|
+
Properties: fromBuilder.entry.properties,
|
|
76
|
+
Key: fromBuilder.entry.key,
|
|
77
|
+
ParentKey: fromBuilder.entry.parentKey
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
/** @inheritdoc */
|
|
83
|
+
join(eventType, builderCallback) {
|
|
84
|
+
const contractType = this.toContractEventType(eventType);
|
|
85
|
+
const joinBuilder = new JoinBuilder();
|
|
86
|
+
builderCallback?.(joinBuilder);
|
|
87
|
+
this._join.push({
|
|
88
|
+
Key: contractType,
|
|
89
|
+
Value: {
|
|
90
|
+
On: joinBuilder.entry.on,
|
|
91
|
+
Properties: joinBuilder.entry.properties,
|
|
92
|
+
Key: joinBuilder.entry.key
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
/** @inheritdoc */
|
|
98
|
+
fromEvery(builderCallback) {
|
|
99
|
+
const builder = new FromEveryBuilder();
|
|
100
|
+
builderCallback(builder);
|
|
101
|
+
this._all = {
|
|
102
|
+
Properties: {
|
|
103
|
+
...this._all.Properties,
|
|
104
|
+
...builder.entry.properties
|
|
105
|
+
},
|
|
106
|
+
IncludeChildren: builder.entry.includeChildren,
|
|
107
|
+
AutoMap: AutoMap.Inherit
|
|
108
|
+
};
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
/** @inheritdoc */
|
|
112
|
+
removedWith(eventType, builderCallback) {
|
|
113
|
+
const contractType = this.toContractEventType(eventType);
|
|
114
|
+
const removedWithBuilder = new RemovedWithBuilder();
|
|
115
|
+
builderCallback?.(removedWithBuilder);
|
|
116
|
+
this._removedWith.push({
|
|
117
|
+
Key: contractType,
|
|
118
|
+
Value: {
|
|
119
|
+
Key: removedWithBuilder.entry.key,
|
|
120
|
+
ParentKey: removedWithBuilder.entry.parentKey
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
/** @inheritdoc */
|
|
126
|
+
removedWithJoin(eventType, builderCallback) {
|
|
127
|
+
const contractType = this.toContractEventType(eventType);
|
|
128
|
+
const removedWithJoinBuilder = new RemovedWithJoinBuilder();
|
|
129
|
+
builderCallback?.(removedWithJoinBuilder);
|
|
130
|
+
this._removedWithJoin.push({
|
|
131
|
+
Key: contractType,
|
|
132
|
+
Value: {
|
|
133
|
+
Key: removedWithJoinBuilder.entry.key
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return this;
|
|
137
|
+
}
|
|
138
|
+
/** @inheritdoc */
|
|
139
|
+
children(_targetPropertyAccessor, _builderCallback) {
|
|
140
|
+
throw new Error('children is not implemented yet.');
|
|
141
|
+
}
|
|
142
|
+
/** @inheritdoc */
|
|
143
|
+
nested(_targetPropertyAccessor, _builderCallback) {
|
|
144
|
+
throw new Error('nested is not implemented yet.');
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Builds the contract-compatible projection definition payload.
|
|
148
|
+
* @param identifier - The projection identifier.
|
|
149
|
+
* @param readModelName - The read model container name.
|
|
150
|
+
* @returns The projection definition object ready to send to the kernel.
|
|
151
|
+
*/
|
|
152
|
+
build(identifier, readModelName) {
|
|
153
|
+
return {
|
|
154
|
+
EventSequenceId: this._eventSequenceId,
|
|
155
|
+
Identifier: identifier,
|
|
156
|
+
ReadModel: this._containerName ?? readModelName,
|
|
157
|
+
IsActive: this._active,
|
|
158
|
+
IsRewindable: this._rewindable,
|
|
159
|
+
InitialModelState: this._initialState,
|
|
160
|
+
From: this._from,
|
|
161
|
+
Join: this._join,
|
|
162
|
+
Children: {},
|
|
163
|
+
FromEvery: [],
|
|
164
|
+
All: this._all,
|
|
165
|
+
FromEventProperty: undefined,
|
|
166
|
+
RemovedWith: this._removedWith,
|
|
167
|
+
RemovedWithJoin: this._removedWithJoin,
|
|
168
|
+
LastUpdated: { Value: new Date().toISOString() },
|
|
169
|
+
Tags: [],
|
|
170
|
+
AutoMap: this._autoMap,
|
|
171
|
+
Nested: {}
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Gets the set of read model properties referenced by configured mappings.
|
|
176
|
+
* @returns Unique read model property names used by from/join/fromEvery mappings.
|
|
177
|
+
*/
|
|
178
|
+
getMappedReadModelProperties() {
|
|
179
|
+
const mappedProperties = new Set();
|
|
180
|
+
for (const from of this._from) {
|
|
181
|
+
for (const property of Object.keys(from.Value.Properties)) {
|
|
182
|
+
mappedProperties.add(property);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
for (const join of this._join) {
|
|
186
|
+
for (const property of Object.keys(join.Value.Properties)) {
|
|
187
|
+
mappedProperties.add(property);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
for (const property of Object.keys(this._all.Properties)) {
|
|
191
|
+
mappedProperties.add(property);
|
|
192
|
+
}
|
|
193
|
+
return Array.from(mappedProperties.values());
|
|
194
|
+
}
|
|
195
|
+
toContractEventType(eventTypeConstructor) {
|
|
196
|
+
const eventType = getEventTypeFor(eventTypeConstructor);
|
|
197
|
+
if (eventType.id.value === '') {
|
|
198
|
+
throw new Error(`Event type '${eventTypeConstructor.name}' is not decorated with @eventType().`);
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
Id: eventType.id.value,
|
|
202
|
+
Generation: eventType.generation.value,
|
|
203
|
+
Tombstone: false
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=ProjectionBuilderFor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectionBuilderFor.js","sourceRoot":"","sources":["../../../Projections/declarative/ProjectionBuilderFor.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AASvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5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ulated removal configuration for a removedWith clause.
|
|
5
|
+
*/
|
|
6
|
+
export interface RemovedWithEntry {
|
|
7
|
+
key: string;
|
|
8
|
+
parentKey: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Concrete implementation of {@link IRemovedWithBuilder}.
|
|
12
|
+
* @template TReadModel - The read model type.
|
|
13
|
+
* @template TEvent - The event type.
|
|
14
|
+
*/
|
|
15
|
+
export declare class RemovedWithBuilder<TReadModel, TEvent> implements IRemovedWithBuilder<TReadModel, TEvent> {
|
|
16
|
+
readonly entry: RemovedWithEntry;
|
|
17
|
+
/** @inheritdoc */
|
|
18
|
+
usingKey(keyAccessor: PropertyAccessor<TEvent>): this;
|
|
19
|
+
/** @inheritdoc */
|
|
20
|
+
usingKeyFromContext(contextPropertyName: string): this;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=RemovedWithBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemovedWithBuilder.d.ts","sourceRoot":"","sources":["../../../Projections/declarative/RemovedWithBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,qBAAa,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAE,YAAW,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC;IAClG,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAG9B;IAEF,kBAAkB;IAClB,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,IAAI;IAQrD,kBAAkB;IAClB,mBAAmB,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI;CAIzD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* Concrete implementation of {@link IRemovedWithBuilder}.
|
|
6
|
+
* @template TReadModel - The read model type.
|
|
7
|
+
* @template TEvent - The event type.
|
|
8
|
+
*/
|
|
9
|
+
export class RemovedWithBuilder {
|
|
10
|
+
entry = {
|
|
11
|
+
key: '$eventSourceId',
|
|
12
|
+
parentKey: ''
|
|
13
|
+
};
|
|
14
|
+
/** @inheritdoc */
|
|
15
|
+
usingKey(keyAccessor) {
|
|
16
|
+
const handler = new PropertyPathResolverProxyHandler();
|
|
17
|
+
const proxy = new Proxy({}, handler);
|
|
18
|
+
keyAccessor(proxy);
|
|
19
|
+
this.entry.key = handler.property;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
/** @inheritdoc */
|
|
23
|
+
usingKeyFromContext(contextPropertyName) {
|
|
24
|
+
this.entry.key = `$context.${contextPropertyName}`;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=RemovedWithBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemovedWithBuilder.js","sourceRoot":"","sources":["../../../Projections/declarative/RemovedWithBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAW1F;;;;GAIG;AACH,MAAM,OAAO,kBAAkB;IAClB,KAAK,GAAqB;QAC/B,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,EAAE;KAChB,CAAC;IAEF,kBAAkB;IAClB,QAAQ,CAAC,WAAqC;QAC1C,MAAM,OAAO,GAAG,IAAI,gCAAgC,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACrC,WAAW,CAAC,KAAe,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,kBAAkB;IAClB,mBAAmB,CAAC,mBAA2B;QAC3C,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,YAAY,mBAAmB,EAAE,CAAC;QACnD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PropertyAccessor } from '@cratis/fundamentals';
|
|
2
|
+
import { IRemovedWithJoinBuilder } from './IRemovedWithJoinBuilder';
|
|
3
|
+
/**
|
|
4
|
+
* Accumulated removal configuration for a removedWithJoin clause.
|
|
5
|
+
*/
|
|
6
|
+
export interface RemovedWithJoinEntry {
|
|
7
|
+
on: string;
|
|
8
|
+
key: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Concrete implementation of {@link IRemovedWithJoinBuilder}.
|
|
12
|
+
* @template TReadModel - The read model type.
|
|
13
|
+
* @template TEvent - The event type.
|
|
14
|
+
*/
|
|
15
|
+
export declare class RemovedWithJoinBuilder<TReadModel, TEvent> implements IRemovedWithJoinBuilder<TReadModel, TEvent> {
|
|
16
|
+
readonly entry: RemovedWithJoinEntry;
|
|
17
|
+
/** @inheritdoc */
|
|
18
|
+
on(readModelPropertyAccessor: PropertyAccessor<TReadModel>): this;
|
|
19
|
+
/** @inheritdoc */
|
|
20
|
+
usingKey(keyAccessor: PropertyAccessor<TEvent>): this;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=RemovedWithJoinBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemovedWithJoinBuilder.d.ts","sourceRoot":"","sources":["../../../Projections/declarative/RemovedWithJoinBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,qBAAa,sBAAsB,CAAC,UAAU,EAAE,MAAM,CAAE,YAAW,uBAAuB,CAAC,UAAU,EAAE,MAAM,CAAC;IAC1G,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAGlC;IAEF,kBAAkB;IAClB,EAAE,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,UAAU,CAAC,GAAG,IAAI;IAQjE,kBAAkB;IAClB,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,IAAI;CAOxD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
import { PropertyPathResolverProxyHandler } from '@cratis/fundamentals';
|
|
4
|
+
/**
|
|
5
|
+
* Concrete implementation of {@link IRemovedWithJoinBuilder}.
|
|
6
|
+
* @template TReadModel - The read model type.
|
|
7
|
+
* @template TEvent - The event type.
|
|
8
|
+
*/
|
|
9
|
+
export class RemovedWithJoinBuilder {
|
|
10
|
+
entry = {
|
|
11
|
+
on: '',
|
|
12
|
+
key: '$eventSourceId'
|
|
13
|
+
};
|
|
14
|
+
/** @inheritdoc */
|
|
15
|
+
on(readModelPropertyAccessor) {
|
|
16
|
+
const handler = new PropertyPathResolverProxyHandler();
|
|
17
|
+
const proxy = new Proxy({}, handler);
|
|
18
|
+
readModelPropertyAccessor(proxy);
|
|
19
|
+
this.entry.on = handler.property;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
/** @inheritdoc */
|
|
23
|
+
usingKey(keyAccessor) {
|
|
24
|
+
const handler = new PropertyPathResolverProxyHandler();
|
|
25
|
+
const proxy = new Proxy({}, handler);
|
|
26
|
+
keyAccessor(proxy);
|
|
27
|
+
this.entry.key = handler.property;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=RemovedWithJoinBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemovedWithJoinBuilder.js","sourceRoot":"","sources":["../../../Projections/declarative/RemovedWithJoinBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAW1F;;;;GAIG;AACH,MAAM,OAAO,sBAAsB;IACtB,KAAK,GAAyB;QACnC,EAAE,EAAE,EAAE;QACN,GAAG,EAAE,gBAAgB;KACxB,CAAC;IAEF,kBAAkB;IAClB,EAAE,CAAC,yBAAuD;QACtD,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,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,kBAAkB;IAClB,QAAQ,CAAC,WAAqC;QAC1C,MAAM,OAAO,GAAG,IAAI,gCAAgC,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACrC,WAAW,CAAC,KAAe,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PropertyAccessor } from '@cratis/fundamentals';
|
|
2
|
+
import { ISetBuilder } from './ISetBuilder';
|
|
3
|
+
/**
|
|
4
|
+
* Concrete implementation of {@link ISetBuilder} that records the property mapping
|
|
5
|
+
* into the owning from/join builder.
|
|
6
|
+
* @template TEvent - The event type.
|
|
7
|
+
* @template TParentBuilder - The parent builder type.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SetBuilder<TEvent, TParentBuilder> implements ISetBuilder<TEvent, TParentBuilder> {
|
|
10
|
+
private readonly _readModelProperty;
|
|
11
|
+
private readonly _setProperty;
|
|
12
|
+
private readonly _parent;
|
|
13
|
+
constructor(_readModelProperty: string, _setProperty: (readModelProp: string, expression: string) => void, _parent: TParentBuilder);
|
|
14
|
+
/** @inheritdoc */
|
|
15
|
+
to(eventPropertyAccessor: PropertyAccessor<TEvent>): TParentBuilder;
|
|
16
|
+
/** @inheritdoc */
|
|
17
|
+
toValue<TProperty>(value: TProperty): TParentBuilder;
|
|
18
|
+
/** @inheritdoc */
|
|
19
|
+
toEventContextProperty(contextPropertyName: string): TParentBuilder;
|
|
20
|
+
/** @inheritdoc */
|
|
21
|
+
toEventSourceId(): TParentBuilder;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=SetBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetBuilder.d.ts","sourceRoot":"","sources":["../../../Projections/declarative/SetBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAoC,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;GAKG;AACH,qBAAa,UAAU,CAAC,MAAM,EAAE,cAAc,CAAE,YAAW,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC;IAEtF,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAFP,kBAAkB,EAAE,MAAM,EAC1B,YAAY,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,EACjE,OAAO,EAAE,cAAc;IAG5C,kBAAkB;IAClB,EAAE,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,MAAM,CAAC,GAAG,cAAc;IAQnE,kBAAkB;IAClB,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,cAAc;IAKpD,kBAAkB;IAClB,sBAAsB,CAAC,mBAAmB,EAAE,MAAM,GAAG,cAAc;IAKnE,kBAAkB;IAClB,eAAe,IAAI,cAAc;CAIpC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* Concrete implementation of {@link ISetBuilder} that records the property mapping
|
|
6
|
+
* into the owning from/join builder.
|
|
7
|
+
* @template TEvent - The event type.
|
|
8
|
+
* @template TParentBuilder - The parent builder type.
|
|
9
|
+
*/
|
|
10
|
+
export class SetBuilder {
|
|
11
|
+
_readModelProperty;
|
|
12
|
+
_setProperty;
|
|
13
|
+
_parent;
|
|
14
|
+
constructor(_readModelProperty, _setProperty, _parent) {
|
|
15
|
+
this._readModelProperty = _readModelProperty;
|
|
16
|
+
this._setProperty = _setProperty;
|
|
17
|
+
this._parent = _parent;
|
|
18
|
+
}
|
|
19
|
+
/** @inheritdoc */
|
|
20
|
+
to(eventPropertyAccessor) {
|
|
21
|
+
const handler = new PropertyPathResolverProxyHandler();
|
|
22
|
+
const proxy = new Proxy({}, handler);
|
|
23
|
+
eventPropertyAccessor(proxy);
|
|
24
|
+
this._setProperty(this._readModelProperty, handler.property);
|
|
25
|
+
return this._parent;
|
|
26
|
+
}
|
|
27
|
+
/** @inheritdoc */
|
|
28
|
+
toValue(value) {
|
|
29
|
+
this._setProperty(this._readModelProperty, JSON.stringify(value));
|
|
30
|
+
return this._parent;
|
|
31
|
+
}
|
|
32
|
+
/** @inheritdoc */
|
|
33
|
+
toEventContextProperty(contextPropertyName) {
|
|
34
|
+
this._setProperty(this._readModelProperty, `$context.${contextPropertyName}`);
|
|
35
|
+
return this._parent;
|
|
36
|
+
}
|
|
37
|
+
/** @inheritdoc */
|
|
38
|
+
toEventSourceId() {
|
|
39
|
+
this._setProperty(this._readModelProperty, '$eventSourceId');
|
|
40
|
+
return this._parent;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=SetBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetBuilder.js","sourceRoot":"","sources":["../../../Projections/declarative/SetBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAG1F;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IAEE;IACA;IACA;IAHrB,YACqB,kBAA0B,EAC1B,YAAiE,EACjE,OAAuB;QAFvB,uBAAkB,GAAlB,kBAAkB,CAAQ;QAC1B,iBAAY,GAAZ,YAAY,CAAqD;QACjE,YAAO,GAAP,OAAO,CAAgB;IACzC,CAAC;IAEJ,kBAAkB;IAClB,EAAE,CAAC,qBAA+C;QAC9C,MAAM,OAAO,GAAG,IAAI,gCAAgC,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACrC,qBAAqB,CAAC,KAAe,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,kBAAkB;IAClB,OAAO,CAAY,KAAgB;QAC/B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,kBAAkB;IAClB,sBAAsB,CAAC,mBAA2B;QAC9C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,kBAAkB,EAAE,YAAY,mBAAmB,EAAE,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,kBAAkB;IAClB,eAAe;QACX,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { projection, getProjectionMetadata, isProjection } from './projection';
|
|
2
|
+
export type { ProjectionMetadata } from './projection';
|
|
3
|
+
export { ProjectionBuilderFor } from './ProjectionBuilderFor';
|
|
4
|
+
export { FromBuilder } from './FromBuilder';
|
|
5
|
+
export { SetBuilder } from './SetBuilder';
|
|
6
|
+
export { RemovedWithBuilder } from './RemovedWithBuilder';
|
|
7
|
+
export type { IProjectionFor } from './IProjectionFor';
|
|
8
|
+
export type { IProjectionBuilderFor } from './IProjectionBuilderFor';
|
|
9
|
+
export type { IProjectionBuilder } from './IProjectionBuilder';
|
|
10
|
+
export type { IFromBuilder } from './IFromBuilder';
|
|
11
|
+
export type { IJoinBuilder } from './IJoinBuilder';
|
|
12
|
+
export type { IFromEveryBuilder } from './IFromEveryBuilder';
|
|
13
|
+
export type { IReadModelPropertiesBuilder } from './IReadModelPropertiesBuilder';
|
|
14
|
+
export type { ICompositeKeyBuilder } from './ICompositeKeyBuilder';
|
|
15
|
+
export type { ISetBuilder } from './ISetBuilder';
|
|
16
|
+
export type { IAllSetBuilder } from './IAllSetBuilder';
|
|
17
|
+
export type { IAddBuilder } from './IAddBuilder';
|
|
18
|
+
export type { ISubtractBuilder } from './ISubtractBuilder';
|
|
19
|
+
export type { IAddChildBuilder } from './IAddChildBuilder';
|
|
20
|
+
export type { IChildrenBuilder } from './IChildrenBuilder';
|
|
21
|
+
export type { INestedBuilder } from './INestedBuilder';
|
|
22
|
+
export type { IRemovedWithBuilder } from './IRemovedWithBuilder';
|
|
23
|
+
export type { IRemovedWithJoinBuilder } from './IRemovedWithJoinBuilder';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Projections/declarative/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC/E,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,YAAY,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
export { projection, getProjectionMetadata, isProjection } from './projection';
|
|
4
|
+
export { ProjectionBuilderFor } from './ProjectionBuilderFor';
|
|
5
|
+
export { FromBuilder } from './FromBuilder';
|
|
6
|
+
export { SetBuilder } from './SetBuilder';
|
|
7
|
+
export { RemovedWithBuilder } from './RemovedWithBuilder';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Projections/declarative/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { ProjectionId } from '../ProjectionId';
|
|
3
|
+
/**
|
|
4
|
+
* Metadata stored on a declarative projection class.
|
|
5
|
+
*/
|
|
6
|
+
export interface ProjectionMetadata {
|
|
7
|
+
/** The unique identifier for the projection. */
|
|
8
|
+
readonly id: ProjectionId;
|
|
9
|
+
/** The optional explicit event sequence identifier. */
|
|
10
|
+
readonly eventSequenceId: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* TypeScript decorator that marks a class as a declarative projection.
|
|
14
|
+
* @param id - The unique identifier for the projection. Defaults to the class name if omitted.
|
|
15
|
+
* @param eventSequenceId - Optional explicit event sequence identifier.
|
|
16
|
+
* @returns A class decorator.
|
|
17
|
+
*/
|
|
18
|
+
export declare function projection(id?: string, eventSequenceId?: string): ClassDecorator;
|
|
19
|
+
/**
|
|
20
|
+
* Gets the {@link ProjectionMetadata} associated with a class decorated with {@link projection}.
|
|
21
|
+
* @param target - The class constructor to retrieve metadata for.
|
|
22
|
+
* @returns The associated metadata, or undefined if not decorated.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getProjectionMetadata(target: Function): ProjectionMetadata | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Checks whether a class has been decorated with {@link projection}.
|
|
27
|
+
* @param target - The class constructor to check.
|
|
28
|
+
* @returns True if the class has a projection decorator; false otherwise.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isProjection(target: Function): boolean;
|
|
31
|
+
//# sourceMappingURL=projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../Projections/declarative/projection.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAM/C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAE1B,uDAAuD;IACvD,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EAAE,GAAE,MAAW,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,cAAc,CAYpF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,kBAAkB,GAAG,SAAS,CAEtF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { ProjectionId } from '../ProjectionId';
|
|
5
|
+
import { DecoratorType, TypeDiscoverer } from '../../types';
|
|
6
|
+
/** Metadata key used to store declarative projection information on a class. */
|
|
7
|
+
const PROJECTION_METADATA_KEY = 'chronicle:projection';
|
|
8
|
+
/**
|
|
9
|
+
* TypeScript decorator that marks a class as a declarative projection.
|
|
10
|
+
* @param id - The unique identifier for the projection. Defaults to the class name if omitted.
|
|
11
|
+
* @param eventSequenceId - Optional explicit event sequence identifier.
|
|
12
|
+
* @returns A class decorator.
|
|
13
|
+
*/
|
|
14
|
+
export function projection(id = '', eventSequenceId) {
|
|
15
|
+
return (target) => {
|
|
16
|
+
const constructor = target;
|
|
17
|
+
const projectionId = new ProjectionId(id || constructor.name);
|
|
18
|
+
const metadata = { id: projectionId, eventSequenceId };
|
|
19
|
+
Reflect.defineMetadata(PROJECTION_METADATA_KEY, metadata, target);
|
|
20
|
+
TypeDiscoverer.default.register(DecoratorType.Projection, constructor, projectionId.value);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Gets the {@link ProjectionMetadata} associated with a class decorated with {@link projection}.
|
|
25
|
+
* @param target - The class constructor to retrieve metadata for.
|
|
26
|
+
* @returns The associated metadata, or undefined if not decorated.
|
|
27
|
+
*/
|
|
28
|
+
export function getProjectionMetadata(target) {
|
|
29
|
+
return Reflect.getMetadata(PROJECTION_METADATA_KEY, target);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Checks whether a class has been decorated with {@link projection}.
|
|
33
|
+
* @param target - The class constructor to check.
|
|
34
|
+
* @returns True if the class has a projection decorator; false otherwise.
|
|
35
|
+
*/
|
|
36
|
+
export function isProjection(target) {
|
|
37
|
+
return Reflect.hasMetadata(PROJECTION_METADATA_KEY, target);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../../../Projections/declarative/projection.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE5D,gFAAgF;AAChF,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAavD;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,EAAE,eAAwB;IAChE,OAAO,CAAC,MAAc,EAAE,EAAE;QACtB,MAAM,WAAW,GAAG,MAAkB,CAAC;QACvC,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9D,MAAM,QAAQ,GAAuB,EAAE,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;QAC3E,OAAO,CAAC,cAAc,CAAC,uBAAuB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAClE,cAAc,CAAC,OAAO,CAAC,QAAQ,CAC3B,aAAa,CAAC,UAAU,EACxB,WAA0B,EAC1B,YAAY,CAAC,KAAK,CACrB,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAgB;IAClD,OAAO,OAAO,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;AAChE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAgB;IACzC,OAAO,OAAO,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Projections/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
export { ProjectionId } from './ProjectionId';
|
|
4
|
+
export { Projections } from './Projections';
|
|
5
|
+
export * from './declarative';
|
|
6
|
+
export * from './modelBound';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Projections/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FromEventOptions } from './FromEventOptions';
|
|
2
|
+
/** Metadata stored by the fromEvent decorator on a class. */
|
|
3
|
+
export interface FromEventMetadata extends FromEventOptions {
|
|
4
|
+
/** The event constructor associated with this annotation. */
|
|
5
|
+
readonly eventType: Function;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=FromEventMetadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FromEventMetadata.d.ts","sourceRoot":"","sources":["../../../Projections/modelBound/FromEventMetadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,6DAA6D;AAC7D,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FromEventMetadata.js","sourceRoot":"","sources":["../../../Projections/modelBound/FromEventMetadata.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Options for the fromEvent class decorator. */
|
|
2
|
+
export interface FromEventOptions {
|
|
3
|
+
/** The event property name to use as the key to identify the read model instance. */
|
|
4
|
+
readonly key?: string;
|
|
5
|
+
/** The event property name to use as the parent key for child relationships. */
|
|
6
|
+
readonly parentKey?: string;
|
|
7
|
+
/** A constant string value to use as the key. All events will update the same instance. */
|
|
8
|
+
readonly constantKey?: string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=FromEventOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FromEventOptions.d.ts","sourceRoot":"","sources":["../../../Projections/modelBound/FromEventOptions.ts"],"names":[],"mappings":"AAGA,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC7B,qFAAqF;IACrF,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,2FAA2F;IAC3F,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FromEventOptions.js","sourceRoot":"","sources":["../../../Projections/modelBound/FromEventOptions.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|