@cratis/chronicle 0.1.0 → 0.2.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/EventStore.ts +41 -19
- package/IEventStore.ts +24 -8
- package/README.md +1 -1
- package/artifacts/DefaultClientArtifactsProvider.ts +14 -0
- package/artifacts/IClientArtifactsProvider.ts +9 -0
- package/connection/ChronicleConnection.ts +314 -216
- package/connection/ChronicleConnectionString.ts +327 -1
- package/connection/ChronicleServices.ts +42 -1
- package/connection/Guid.ts +2 -4
- package/connection/TokenProvider.ts +128 -6
- package/dist/EventStore.d.ts +16 -8
- package/dist/EventStore.d.ts.map +1 -1
- package/dist/EventStore.js +28 -12
- package/dist/EventStore.js.map +1 -1
- package/dist/IEventStore.d.ts +20 -8
- package/dist/IEventStore.d.ts.map +1 -1
- package/dist/artifacts/DefaultClientArtifactsProvider.d.ts +5 -0
- package/dist/artifacts/DefaultClientArtifactsProvider.d.ts.map +1 -1
- package/dist/artifacts/DefaultClientArtifactsProvider.js +11 -0
- package/dist/artifacts/DefaultClientArtifactsProvider.js.map +1 -1
- package/dist/artifacts/IClientArtifactsProvider.d.ts +6 -0
- package/dist/artifacts/IClientArtifactsProvider.d.ts.map +1 -1
- package/dist/auditing/Causation.d.ts.map +1 -0
- package/dist/auditing/Causation.js.map +1 -0
- package/dist/auditing/CausationManager.d.ts.map +1 -0
- package/dist/auditing/CausationManager.js.map +1 -0
- package/dist/auditing/CausationType.d.ts.map +1 -0
- package/dist/auditing/CausationType.js.map +1 -0
- package/dist/auditing/ICausationManager.d.ts.map +1 -0
- package/dist/auditing/ICausationManager.js.map +1 -0
- package/dist/auditing/index.d.ts.map +1 -0
- package/dist/auditing/index.js.map +1 -0
- package/dist/connection/ChronicleConnection.d.ts +49 -78
- package/dist/connection/ChronicleConnection.d.ts.map +1 -1
- package/dist/connection/ChronicleConnection.js +140 -130
- package/dist/connection/ChronicleConnection.js.map +1 -1
- package/dist/connection/ChronicleConnectionString.d.ts +78 -1
- package/dist/connection/ChronicleConnectionString.d.ts.map +1 -1
- package/dist/connection/ChronicleConnectionString.js +251 -1
- package/dist/connection/ChronicleConnectionString.js.map +1 -1
- package/dist/connection/ChronicleServices.d.ts +23 -1
- package/dist/connection/ChronicleServices.d.ts.map +1 -1
- package/dist/connection/Guid.d.ts.map +1 -1
- package/dist/connection/Guid.js +2 -4
- package/dist/connection/Guid.js.map +1 -1
- package/dist/connection/TokenProvider.d.ts +37 -3
- package/dist/connection/TokenProvider.d.ts.map +1 -1
- package/dist/connection/TokenProvider.js +95 -1
- package/dist/connection/TokenProvider.js.map +1 -1
- package/dist/correlation/CorrelationId.d.ts.map +1 -0
- package/dist/correlation/CorrelationId.js.map +1 -0
- package/dist/correlation/CorrelationIdManager.d.ts.map +1 -0
- package/dist/correlation/CorrelationIdManager.js.map +1 -0
- package/dist/correlation/ICorrelationIdAccessor.d.ts.map +1 -0
- package/dist/correlation/ICorrelationIdAccessor.js.map +1 -0
- package/dist/correlation/ICorrelationIdSetter.d.ts.map +1 -0
- package/dist/correlation/ICorrelationIdSetter.js.map +1 -0
- package/dist/correlation/index.d.ts.map +1 -0
- package/dist/correlation/index.js.map +1 -0
- package/dist/eventSequences/AppendError.d.ts.map +1 -0
- package/dist/eventSequences/AppendError.js.map +1 -0
- package/dist/eventSequences/AppendOptions.d.ts +14 -0
- package/dist/eventSequences/AppendOptions.d.ts.map +1 -0
- package/dist/eventSequences/AppendOptions.js.map +1 -0
- package/dist/eventSequences/AppendResult.d.ts.map +1 -0
- package/dist/eventSequences/AppendResult.js.map +1 -0
- package/dist/eventSequences/ConcurrencyScope.d.ts +19 -0
- package/dist/eventSequences/ConcurrencyScope.d.ts.map +1 -0
- package/dist/eventSequences/ConcurrencyScope.js +4 -0
- package/dist/eventSequences/ConcurrencyScope.js.map +1 -0
- package/dist/eventSequences/ConstraintViolation.d.ts.map +1 -0
- package/dist/eventSequences/ConstraintViolation.js.map +1 -0
- package/dist/eventSequences/EventForEventSourceId.d.ts +10 -0
- package/dist/eventSequences/EventForEventSourceId.d.ts.map +1 -0
- package/dist/eventSequences/EventForEventSourceId.js +4 -0
- package/dist/eventSequences/EventForEventSourceId.js.map +1 -0
- package/dist/eventSequences/EventLog.d.ts +12 -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 +34 -0
- package/dist/eventSequences/EventSequence.d.ts.map +1 -0
- package/dist/eventSequences/EventSequence.js +365 -0
- package/dist/eventSequences/EventSequence.js.map +1 -0
- package/dist/eventSequences/EventSequenceId.d.ts.map +1 -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.map +1 -0
- package/dist/eventSequences/IEventLog.js.map +1 -0
- package/dist/eventSequences/IEventSequence.d.ts +51 -0
- package/dist/eventSequences/IEventSequence.d.ts.map +1 -0
- package/dist/eventSequences/IEventSequence.js.map +1 -0
- package/dist/eventSequences/ITransactionalEventSequence.d.ts +21 -0
- package/dist/eventSequences/ITransactionalEventSequence.d.ts.map +1 -0
- package/dist/eventSequences/ITransactionalEventSequence.js +4 -0
- package/dist/eventSequences/ITransactionalEventSequence.js.map +1 -0
- package/dist/eventSequences/TransactionalEventSequence.d.ts +19 -0
- package/dist/eventSequences/TransactionalEventSequence.d.ts.map +1 -0
- package/dist/eventSequences/TransactionalEventSequence.js +28 -0
- package/dist/eventSequences/TransactionalEventSequence.js.map +1 -0
- package/dist/eventSequences/index.d.ts +15 -0
- package/dist/eventSequences/index.d.ts.map +1 -0
- package/dist/eventSequences/index.js +8 -0
- package/dist/eventSequences/index.js.map +1 -0
- package/dist/events/AppendedEvent.d.ts.map +1 -0
- package/dist/events/AppendedEvent.js.map +1 -0
- package/dist/events/CausationEntry.d.ts.map +1 -0
- package/dist/events/CausationEntry.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.map +1 -0
- package/dist/events/EventType.d.ts.map +1 -0
- package/dist/events/EventType.js.map +1 -0
- package/dist/events/EventTypeGeneration.d.ts.map +1 -0
- package/dist/events/EventTypeGeneration.js.map +1 -0
- package/dist/events/EventTypeId.d.ts.map +1 -0
- package/dist/events/EventTypeId.js.map +1 -0
- package/dist/events/EventTypes.d.ts +35 -0
- package/dist/events/EventTypes.d.ts.map +1 -0
- package/dist/events/EventTypes.js +157 -0
- package/dist/events/EventTypes.js.map +1 -0
- package/dist/events/IEventTypes.d.ts.map +1 -0
- package/dist/events/IEventTypes.js.map +1 -0
- package/dist/events/constraints/ConstraintBuilder.d.ts.map +1 -0
- package/dist/events/constraints/ConstraintBuilder.js.map +1 -0
- package/dist/events/constraints/ConstraintId.d.ts.map +1 -0
- package/dist/events/constraints/ConstraintId.js.map +1 -0
- package/dist/events/constraints/Constraints.d.ts.map +1 -0
- package/dist/events/constraints/Constraints.js.map +1 -0
- package/dist/events/constraints/IConstraint.d.ts.map +1 -0
- package/dist/events/constraints/IConstraint.js.map +1 -0
- package/dist/events/constraints/IConstraintBuilder.d.ts.map +1 -0
- package/dist/events/constraints/IConstraintBuilder.js.map +1 -0
- package/dist/events/constraints/IConstraints.d.ts.map +1 -0
- package/dist/events/constraints/IConstraints.js.map +1 -0
- package/dist/events/constraints/IUniqueConstraintBuilder.d.ts.map +1 -0
- package/dist/events/constraints/IUniqueConstraintBuilder.js.map +1 -0
- package/dist/events/constraints/UniqueConstraintBuilder.d.ts.map +1 -0
- package/dist/events/constraints/UniqueConstraintBuilder.js.map +1 -0
- package/dist/events/constraints/constraint.d.ts.map +1 -0
- package/dist/events/constraints/constraint.js.map +1 -0
- package/dist/events/constraints/index.d.ts.map +1 -0
- package/dist/events/constraints/index.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 +13 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +10 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/migrations/EventMigrationBuilder.d.ts +16 -0
- package/dist/events/migrations/EventMigrationBuilder.d.ts.map +1 -0
- package/dist/events/migrations/EventMigrationBuilder.js +27 -0
- package/dist/events/migrations/EventMigrationBuilder.js.map +1 -0
- package/dist/events/migrations/EventMigrationPropertyBuilder.d.ts +20 -0
- package/dist/events/migrations/EventMigrationPropertyBuilder.d.ts.map +1 -0
- package/dist/events/migrations/EventMigrationPropertyBuilder.js +54 -0
- package/dist/events/migrations/EventMigrationPropertyBuilder.js.map +1 -0
- package/dist/events/migrations/EventTypeMigrators.d.ts +21 -0
- package/dist/events/migrations/EventTypeMigrators.d.ts.map +1 -0
- package/dist/events/migrations/EventTypeMigrators.js +41 -0
- package/dist/events/migrations/EventTypeMigrators.js.map +1 -0
- package/dist/events/migrations/IEventMigrationBuilder.d.ts +12 -0
- package/dist/events/migrations/IEventMigrationBuilder.d.ts.map +1 -0
- package/dist/events/migrations/IEventMigrationBuilder.js +4 -0
- package/dist/events/migrations/IEventMigrationBuilder.js.map +1 -0
- package/dist/events/migrations/IEventMigrationPropertyBuilder.d.ts +37 -0
- package/dist/events/migrations/IEventMigrationPropertyBuilder.d.ts.map +1 -0
- package/dist/events/migrations/IEventMigrationPropertyBuilder.js +4 -0
- package/dist/events/migrations/IEventMigrationPropertyBuilder.js.map +1 -0
- package/dist/events/migrations/IEventTypeMigration.d.ts +17 -0
- package/dist/events/migrations/IEventTypeMigration.d.ts.map +1 -0
- package/dist/events/migrations/IEventTypeMigration.js +4 -0
- package/dist/events/migrations/IEventTypeMigration.js.map +1 -0
- package/dist/events/migrations/IEventTypeMigrators.d.ts +17 -0
- package/dist/events/migrations/IEventTypeMigrators.d.ts.map +1 -0
- package/dist/events/migrations/IEventTypeMigrators.js +4 -0
- package/dist/events/migrations/IEventTypeMigrators.js.map +1 -0
- package/dist/events/migrations/InvalidMigrationGenerationGap.d.ts +7 -0
- package/dist/events/migrations/InvalidMigrationGenerationGap.d.ts.map +1 -0
- package/dist/events/migrations/InvalidMigrationGenerationGap.js +12 -0
- package/dist/events/migrations/InvalidMigrationGenerationGap.js.map +1 -0
- package/dist/events/migrations/eventTypeMigration.d.ts +33 -0
- package/dist/events/migrations/eventTypeMigration.d.ts.map +1 -0
- package/dist/events/migrations/eventTypeMigration.js +52 -0
- package/dist/events/migrations/eventTypeMigration.js.map +1 -0
- package/dist/events/migrations/index.d.ts +11 -0
- package/dist/events/migrations/index.d.ts.map +1 -0
- package/dist/events/migrations/index.js +8 -0
- package/dist/events/migrations/index.js.map +1 -0
- package/dist/identity/IIdentityProvider.d.ts.map +1 -0
- package/dist/identity/IIdentityProvider.js.map +1 -0
- package/dist/identity/Identity.d.ts.map +1 -0
- package/dist/identity/Identity.js.map +1 -0
- package/dist/identity/IdentityProvider.d.ts.map +1 -0
- package/dist/identity/IdentityProvider.js.map +1 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +34 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -11
- package/dist/index.js.map +1 -1
- package/dist/jobs/IJobs.d.ts +41 -0
- package/dist/jobs/IJobs.d.ts.map +1 -0
- package/dist/jobs/IJobs.js +4 -0
- package/dist/jobs/IJobs.js.map +1 -0
- package/dist/jobs/JobId.d.ts +17 -0
- package/dist/jobs/JobId.d.ts.map +1 -0
- package/dist/jobs/JobId.js +25 -0
- package/dist/jobs/JobId.js.map +1 -0
- package/dist/jobs/Jobs.d.ts +35 -0
- package/dist/jobs/Jobs.d.ts.map +1 -0
- package/dist/jobs/Jobs.js +71 -0
- package/dist/jobs/Jobs.js.map +1 -0
- package/dist/jobs/index.d.ts +4 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +5 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/observation/ObserverId.d.ts.map +1 -0
- package/dist/observation/ObserverId.js.map +1 -0
- package/dist/observation/ObserverRunningState.d.ts.map +1 -0
- package/dist/observation/ObserverRunningState.js.map +1 -0
- package/dist/observation/index.d.ts.map +1 -0
- package/dist/observation/index.js.map +1 -0
- package/dist/projections/IProjections.d.ts.map +1 -0
- package/dist/projections/IProjections.js.map +1 -0
- package/dist/projections/ProjectionId.d.ts.map +1 -0
- package/dist/projections/ProjectionId.js.map +1 -0
- package/dist/projections/Projections.d.ts.map +1 -0
- package/dist/projections/Projections.js +441 -0
- package/dist/projections/Projections.js.map +1 -0
- package/dist/projections/declarative/AllSetBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/AllSetBuilder.js.map +1 -0
- package/dist/projections/declarative/FromBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/FromBuilder.js.map +1 -0
- package/dist/projections/declarative/FromEveryBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/FromEveryBuilder.js.map +1 -0
- package/dist/projections/declarative/IAddBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IAddBuilder.js.map +1 -0
- package/dist/projections/declarative/IAddChildBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IAddChildBuilder.js.map +1 -0
- package/dist/projections/declarative/IAllSetBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IAllSetBuilder.js.map +1 -0
- package/dist/projections/declarative/IChildrenBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IChildrenBuilder.js.map +1 -0
- package/dist/projections/declarative/ICompositeKeyBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/ICompositeKeyBuilder.js.map +1 -0
- package/dist/projections/declarative/IFromBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IFromBuilder.js.map +1 -0
- package/dist/projections/declarative/IFromEveryBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IFromEveryBuilder.js.map +1 -0
- package/dist/projections/declarative/IJoinBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IJoinBuilder.js.map +1 -0
- package/dist/projections/declarative/INestedBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/INestedBuilder.js.map +1 -0
- package/dist/projections/declarative/IProjectionBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IProjectionBuilder.js.map +1 -0
- package/dist/projections/declarative/IProjectionBuilderFor.d.ts.map +1 -0
- package/dist/projections/declarative/IProjectionBuilderFor.js.map +1 -0
- package/dist/projections/declarative/IProjectionFor.d.ts.map +1 -0
- package/dist/projections/declarative/IProjectionFor.js.map +1 -0
- package/dist/projections/declarative/IReadModelPropertiesBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IReadModelPropertiesBuilder.js.map +1 -0
- package/dist/projections/declarative/IRemovedWithBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IRemovedWithBuilder.js.map +1 -0
- package/dist/projections/declarative/IRemovedWithJoinBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/IRemovedWithJoinBuilder.js.map +1 -0
- package/dist/projections/declarative/ISetBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/ISetBuilder.js.map +1 -0
- package/dist/projections/declarative/ISubtractBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/ISubtractBuilder.js.map +1 -0
- package/dist/projections/declarative/JoinBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/JoinBuilder.js.map +1 -0
- package/dist/projections/declarative/ProjectionBuilderFor.d.ts.map +1 -0
- package/dist/projections/declarative/ProjectionBuilderFor.js +223 -0
- package/dist/projections/declarative/ProjectionBuilderFor.js.map +1 -0
- package/dist/projections/declarative/RemovedWithBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/RemovedWithBuilder.js.map +1 -0
- package/dist/projections/declarative/RemovedWithJoinBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/RemovedWithJoinBuilder.js.map +1 -0
- package/dist/projections/declarative/SetBuilder.d.ts.map +1 -0
- package/dist/projections/declarative/SetBuilder.js.map +1 -0
- package/dist/projections/declarative/index.d.ts.map +1 -0
- package/dist/projections/declarative/index.js.map +1 -0
- package/dist/projections/declarative/projection.d.ts.map +1 -0
- package/dist/projections/declarative/projection.js.map +1 -0
- package/dist/projections/index.d.ts.map +1 -0
- package/dist/projections/index.js.map +1 -0
- package/dist/projections/modelBound/FromEventMetadata.d.ts.map +1 -0
- package/dist/projections/modelBound/FromEventMetadata.js.map +1 -0
- package/dist/projections/modelBound/FromEventOptions.d.ts.map +1 -0
- package/dist/projections/modelBound/FromEventOptions.js.map +1 -0
- package/dist/projections/modelBound/addFrom.d.ts.map +1 -0
- package/dist/projections/modelBound/addFrom.js.map +1 -0
- package/dist/projections/modelBound/childrenFrom.d.ts.map +1 -0
- package/dist/projections/modelBound/childrenFrom.js.map +1 -0
- package/dist/projections/modelBound/clearWith.d.ts.map +1 -0
- package/dist/projections/modelBound/clearWith.js.map +1 -0
- package/dist/projections/modelBound/count.d.ts.map +1 -0
- package/dist/projections/modelBound/count.js.map +1 -0
- package/dist/projections/modelBound/decrement.d.ts.map +1 -0
- package/dist/projections/modelBound/decrement.js.map +1 -0
- package/dist/projections/modelBound/fromEvent.d.ts.map +1 -0
- package/dist/projections/modelBound/fromEvent.js.map +1 -0
- package/dist/projections/modelBound/fromEvery.d.ts.map +1 -0
- package/dist/projections/modelBound/fromEvery.js.map +1 -0
- package/dist/projections/modelBound/increment.d.ts.map +1 -0
- package/dist/projections/modelBound/increment.js.map +1 -0
- package/dist/projections/modelBound/index.d.ts.map +1 -0
- package/dist/projections/modelBound/index.js.map +1 -0
- package/dist/projections/modelBound/join.d.ts.map +1 -0
- package/dist/projections/modelBound/join.js.map +1 -0
- package/dist/projections/modelBound/nested.d.ts.map +1 -0
- package/dist/projections/modelBound/nested.js.map +1 -0
- package/dist/projections/modelBound/notRewindable.d.ts.map +1 -0
- package/dist/projections/modelBound/notRewindable.js.map +1 -0
- package/dist/projections/modelBound/removedWith.d.ts.map +1 -0
- package/dist/projections/modelBound/removedWith.js.map +1 -0
- package/dist/projections/modelBound/removedWithJoin.d.ts.map +1 -0
- package/dist/projections/modelBound/removedWithJoin.js.map +1 -0
- package/dist/projections/modelBound/setFrom.d.ts.map +1 -0
- package/dist/projections/modelBound/setFrom.js.map +1 -0
- package/dist/projections/modelBound/setFromContext.d.ts +26 -0
- package/dist/projections/modelBound/setFromContext.d.ts.map +1 -0
- package/dist/projections/modelBound/setFromContext.js.map +1 -0
- package/dist/projections/modelBound/setValue.d.ts.map +1 -0
- package/dist/projections/modelBound/setValue.js.map +1 -0
- package/dist/projections/modelBound/subtractFrom.d.ts.map +1 -0
- package/dist/projections/modelBound/subtractFrom.js.map +1 -0
- package/dist/reactors/IReactors.d.ts.map +1 -0
- package/dist/reactors/IReactors.js.map +1 -0
- package/dist/reactors/ReactorId.d.ts.map +1 -0
- package/dist/reactors/ReactorId.js.map +1 -0
- package/dist/reactors/Reactors.d.ts.map +1 -0
- package/dist/reactors/Reactors.js +280 -0
- package/dist/reactors/Reactors.js.map +1 -0
- package/dist/reactors/index.d.ts.map +1 -0
- package/dist/reactors/index.js.map +1 -0
- package/dist/reactors/reactor.d.ts.map +1 -0
- package/dist/reactors/reactor.js.map +1 -0
- package/dist/readModels/ReadModelId.d.ts.map +1 -0
- package/dist/readModels/ReadModelId.js.map +1 -0
- package/dist/readModels/index.d.ts.map +1 -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.map +1 -0
- package/dist/reducers/IReducers.js.map +1 -0
- package/dist/reducers/ReducerId.d.ts.map +1 -0
- package/dist/reducers/ReducerId.js.map +1 -0
- package/dist/reducers/Reducers.d.ts.map +1 -0
- package/dist/reducers/Reducers.js +337 -0
- package/dist/reducers/Reducers.js.map +1 -0
- package/dist/reducers/index.d.ts.map +1 -0
- package/dist/reducers/index.js.map +1 -0
- package/dist/reducers/reducer.d.ts.map +1 -0
- package/dist/reducers/reducer.js.map +1 -0
- package/dist/schemas/JsonSchema.d.ts.map +1 -0
- package/dist/schemas/JsonSchema.js.map +1 -0
- package/dist/schemas/JsonSchemaGenerator.d.ts.map +1 -0
- package/dist/schemas/JsonSchemaGenerator.js.map +1 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/jsonSchemaProperty.d.ts.map +1 -0
- package/dist/schemas/jsonSchemaProperty.js.map +1 -0
- package/dist/seeding/EventSeeding.d.ts +40 -0
- package/dist/seeding/EventSeeding.d.ts.map +1 -0
- package/dist/seeding/EventSeeding.js +150 -0
- package/dist/seeding/EventSeeding.js.map +1 -0
- package/dist/seeding/ICanSeedEvents.d.ts +12 -0
- package/dist/seeding/ICanSeedEvents.d.ts.map +1 -0
- package/dist/seeding/ICanSeedEvents.js +4 -0
- package/dist/seeding/ICanSeedEvents.js.map +1 -0
- package/dist/seeding/IEventSeeding.d.ts +17 -0
- package/dist/seeding/IEventSeeding.d.ts.map +1 -0
- package/dist/seeding/IEventSeeding.js +4 -0
- package/dist/seeding/IEventSeeding.js.map +1 -0
- package/dist/seeding/IEventSeedingBuilder.d.ts +30 -0
- package/dist/seeding/IEventSeedingBuilder.d.ts.map +1 -0
- package/dist/seeding/IEventSeedingBuilder.js +4 -0
- package/dist/seeding/IEventSeedingBuilder.js.map +1 -0
- package/dist/seeding/IEventSeedingScopeBuilder.d.ts +20 -0
- package/dist/seeding/IEventSeedingScopeBuilder.d.ts.map +1 -0
- package/dist/seeding/IEventSeedingScopeBuilder.js +4 -0
- package/dist/seeding/IEventSeedingScopeBuilder.js.map +1 -0
- package/dist/seeding/index.d.ts +8 -0
- package/dist/seeding/index.d.ts.map +1 -0
- package/dist/seeding/index.js +5 -0
- package/dist/seeding/index.js.map +1 -0
- package/dist/seeding/seeder.d.ts +28 -0
- package/dist/seeding/seeder.d.ts.map +1 -0
- package/dist/seeding/seeder.js +37 -0
- package/dist/seeding/seeder.js.map +1 -0
- package/dist/transactions/IUnitOfWork.d.ts +45 -0
- package/dist/transactions/IUnitOfWork.d.ts.map +1 -0
- package/dist/transactions/IUnitOfWork.js +4 -0
- package/dist/transactions/IUnitOfWork.js.map +1 -0
- package/dist/transactions/IUnitOfWorkManager.d.ts +29 -0
- package/dist/transactions/IUnitOfWorkManager.d.ts.map +1 -0
- package/dist/transactions/IUnitOfWorkManager.js +4 -0
- package/dist/transactions/IUnitOfWorkManager.js.map +1 -0
- package/dist/transactions/NoUnitOfWorkHasBeenStarted.d.ts +10 -0
- package/dist/transactions/NoUnitOfWorkHasBeenStarted.d.ts.map +1 -0
- package/dist/transactions/NoUnitOfWorkHasBeenStarted.js +14 -0
- package/dist/transactions/NoUnitOfWorkHasBeenStarted.js.map +1 -0
- package/dist/transactions/UnitOfWork.d.ts +36 -0
- package/dist/transactions/UnitOfWork.d.ts.map +1 -0
- package/dist/transactions/UnitOfWork.js +102 -0
- package/dist/transactions/UnitOfWork.js.map +1 -0
- package/dist/transactions/UnitOfWorkManager.d.ts +25 -0
- package/dist/transactions/UnitOfWorkManager.d.ts.map +1 -0
- package/dist/transactions/UnitOfWorkManager.js +57 -0
- package/dist/transactions/UnitOfWorkManager.js.map +1 -0
- package/dist/transactions/index.d.ts +6 -0
- package/dist/transactions/index.d.ts.map +1 -0
- package/dist/transactions/index.js +6 -0
- package/dist/transactions/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/DecoratorType.d.ts +7 -1
- package/dist/types/DecoratorType.d.ts.map +1 -1
- package/dist/types/DecoratorType.js +6 -0
- package/dist/types/DecoratorType.js.map +1 -1
- package/dist/webhooks/IWebhook.d.ts +12 -0
- package/dist/webhooks/IWebhook.d.ts.map +1 -0
- package/dist/webhooks/IWebhook.js +4 -0
- package/dist/webhooks/IWebhook.js.map +1 -0
- package/dist/webhooks/IWebhookDefinitionBuilder.d.ts +58 -0
- package/dist/webhooks/IWebhookDefinitionBuilder.d.ts.map +1 -0
- package/dist/webhooks/IWebhookDefinitionBuilder.js +4 -0
- package/dist/webhooks/IWebhookDefinitionBuilder.js.map +1 -0
- package/dist/webhooks/IWebhooks.d.ts +34 -0
- package/dist/webhooks/IWebhooks.d.ts.map +1 -0
- package/dist/webhooks/IWebhooks.js +4 -0
- package/dist/webhooks/IWebhooks.js.map +1 -0
- package/dist/webhooks/WebhookDefinitionBuilder.d.ts +49 -0
- package/dist/webhooks/WebhookDefinitionBuilder.d.ts.map +1 -0
- package/dist/webhooks/WebhookDefinitionBuilder.js +122 -0
- package/dist/webhooks/WebhookDefinitionBuilder.js.map +1 -0
- package/dist/webhooks/WebhookId.d.ts +10 -0
- package/dist/webhooks/WebhookId.d.ts.map +1 -0
- package/dist/webhooks/WebhookId.js +16 -0
- package/dist/webhooks/WebhookId.js.map +1 -0
- package/dist/webhooks/WebhookTargetUrl.d.ts +10 -0
- package/dist/webhooks/WebhookTargetUrl.d.ts.map +1 -0
- package/dist/webhooks/WebhookTargetUrl.js +16 -0
- package/dist/webhooks/WebhookTargetUrl.js.map +1 -0
- package/dist/webhooks/Webhooks.d.ts +38 -0
- package/dist/webhooks/Webhooks.d.ts.map +1 -0
- package/dist/webhooks/Webhooks.js +92 -0
- package/dist/webhooks/Webhooks.js.map +1 -0
- package/dist/webhooks/index.d.ts +10 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/index.js +8 -0
- package/dist/webhooks/index.js.map +1 -0
- package/dist/webhooks/webhook.d.ts +41 -0
- package/dist/webhooks/webhook.d.ts.map +1 -0
- package/dist/webhooks/webhook.js +44 -0
- package/dist/webhooks/webhook.js.map +1 -0
- package/eventSequences/AppendOptions.ts +19 -0
- package/eventSequences/ConcurrencyScope.ts +27 -0
- package/eventSequences/EventForEventSourceId.ts +13 -0
- package/eventSequences/EventLog.ts +23 -0
- package/eventSequences/EventSequence.ts +413 -0
- package/eventSequences/EventSequenceNumber.ts +38 -0
- package/eventSequences/IEventSequence.ts +60 -0
- package/eventSequences/ITransactionalEventSequence.ts +26 -0
- package/eventSequences/TransactionalEventSequence.ts +34 -0
- package/eventSequences/index.ts +17 -0
- package/events/EventContext.ts +28 -0
- package/events/EventTypes.ts +186 -0
- package/events/eventTypeDecorator.ts +147 -0
- package/events/index.ts +15 -0
- package/events/migrations/EventMigrationBuilder.ts +31 -0
- package/events/migrations/EventMigrationPropertyBuilder.ts +77 -0
- package/events/migrations/EventTypeMigrators.ts +48 -0
- package/events/migrations/IEventMigrationBuilder.ts +15 -0
- package/events/migrations/IEventMigrationPropertyBuilder.ts +57 -0
- package/events/migrations/IEventTypeMigration.ts +21 -0
- package/events/migrations/IEventTypeMigrators.ts +21 -0
- package/events/migrations/InvalidMigrationGenerationGap.ts +19 -0
- package/events/migrations/eventTypeMigration.ts +82 -0
- package/events/migrations/index.ts +13 -0
- package/index.ts +55 -11
- package/jobs/IJobs.ts +49 -0
- package/jobs/JobId.ts +25 -0
- package/jobs/Jobs.ts +81 -0
- package/jobs/index.ts +6 -0
- package/package.json +103 -2
- package/projections/Projections.ts +518 -0
- package/projections/declarative/ProjectionBuilderFor.ts +294 -0
- package/projections/modelBound/setFromContext.ts +59 -0
- package/reactors/Reactors.ts +321 -0
- package/readModels/readModel.ts +89 -0
- package/reducers/Reducers.ts +386 -0
- package/seeding/EventSeeding.ts +176 -0
- package/seeding/ICanSeedEvents.ts +15 -0
- package/seeding/IEventSeeding.ts +21 -0
- package/seeding/IEventSeedingBuilder.ts +35 -0
- package/seeding/IEventSeedingScopeBuilder.ts +23 -0
- package/seeding/index.ts +10 -0
- package/seeding/seeder.ts +54 -0
- package/transactions/IUnitOfWork.ts +56 -0
- package/transactions/IUnitOfWorkManager.ts +36 -0
- package/transactions/NoUnitOfWorkHasBeenStarted.ts +14 -0
- package/transactions/UnitOfWork.ts +132 -0
- package/transactions/UnitOfWorkManager.ts +70 -0
- package/transactions/index.ts +8 -0
- package/types/DecoratorType.ts +10 -1
- package/webhooks/IWebhook.ts +15 -0
- package/webhooks/IWebhookDefinitionBuilder.ts +68 -0
- package/webhooks/IWebhooks.ts +45 -0
- package/webhooks/WebhookDefinitionBuilder.ts +144 -0
- package/webhooks/WebhookId.ts +14 -0
- package/webhooks/WebhookTargetUrl.ts +14 -0
- package/webhooks/Webhooks.ts +125 -0
- package/webhooks/index.ts +12 -0
- package/webhooks/webhook.ts +83 -0
- package/EventSequences/AppendOptions.ts +0 -15
- package/EventSequences/EventLog.ts +0 -21
- package/EventSequences/EventSequence.ts +0 -370
- package/EventSequences/EventSequenceNumber.ts +0 -38
- package/EventSequences/IEventSequence.ts +0 -47
- package/EventSequences/index.ts +0 -13
- package/Events/EventContext.ts +0 -28
- package/Events/EventTypes.ts +0 -95
- package/Events/eventTypeDecorator.ts +0 -147
- package/Events/index.ts +0 -14
- package/Projections/Projections.ts +0 -518
- package/Projections/declarative/ProjectionBuilderFor.ts +0 -294
- package/Projections/modelBound/setFromContext.ts +0 -59
- package/Reactors/Reactors.ts +0 -321
- package/ReadModels/readModel.ts +0 -89
- package/Reducers/Reducers.ts +0 -386
- package/dist/Auditing/Causation.d.ts.map +0 -1
- package/dist/Auditing/Causation.js.map +0 -1
- package/dist/Auditing/CausationManager.d.ts.map +0 -1
- package/dist/Auditing/CausationManager.js.map +0 -1
- package/dist/Auditing/CausationType.d.ts.map +0 -1
- package/dist/Auditing/CausationType.js.map +0 -1
- package/dist/Auditing/ICausationManager.d.ts.map +0 -1
- package/dist/Auditing/ICausationManager.js.map +0 -1
- package/dist/Auditing/index.d.ts.map +0 -1
- package/dist/Auditing/index.js.map +0 -1
- package/dist/Correlation/CorrelationId.d.ts.map +0 -1
- package/dist/Correlation/CorrelationId.js.map +0 -1
- package/dist/Correlation/CorrelationIdManager.d.ts.map +0 -1
- package/dist/Correlation/CorrelationIdManager.js.map +0 -1
- package/dist/Correlation/ICorrelationIdAccessor.d.ts.map +0 -1
- package/dist/Correlation/ICorrelationIdAccessor.js.map +0 -1
- package/dist/Correlation/ICorrelationIdSetter.d.ts.map +0 -1
- package/dist/Correlation/ICorrelationIdSetter.js.map +0 -1
- package/dist/Correlation/index.d.ts.map +0 -1
- package/dist/Correlation/index.js.map +0 -1
- package/dist/EventSequences/AppendError.d.ts.map +0 -1
- package/dist/EventSequences/AppendError.js.map +0 -1
- package/dist/EventSequences/AppendOptions.d.ts +0 -11
- package/dist/EventSequences/AppendOptions.d.ts.map +0 -1
- package/dist/EventSequences/AppendOptions.js.map +0 -1
- package/dist/EventSequences/AppendResult.d.ts.map +0 -1
- package/dist/EventSequences/AppendResult.js.map +0 -1
- package/dist/EventSequences/ConstraintViolation.d.ts.map +0 -1
- package/dist/EventSequences/ConstraintViolation.js.map +0 -1
- package/dist/EventSequences/EventLog.d.ts +0 -11
- package/dist/EventSequences/EventLog.d.ts.map +0 -1
- package/dist/EventSequences/EventLog.js +0 -14
- package/dist/EventSequences/EventLog.js.map +0 -1
- package/dist/EventSequences/EventSequence.d.ts +0 -27
- package/dist/EventSequences/EventSequence.d.ts.map +0 -1
- package/dist/EventSequences/EventSequence.js +0 -336
- package/dist/EventSequences/EventSequence.js.map +0 -1
- package/dist/EventSequences/EventSequenceId.d.ts.map +0 -1
- package/dist/EventSequences/EventSequenceId.js.map +0 -1
- package/dist/EventSequences/EventSequenceNumber.d.ts +0 -26
- package/dist/EventSequences/EventSequenceNumber.d.ts.map +0 -1
- package/dist/EventSequences/EventSequenceNumber.js +0 -36
- package/dist/EventSequences/EventSequenceNumber.js.map +0 -1
- package/dist/EventSequences/IEventLog.d.ts.map +0 -1
- package/dist/EventSequences/IEventLog.js.map +0 -1
- package/dist/EventSequences/IEventSequence.d.ts +0 -40
- package/dist/EventSequences/IEventSequence.d.ts.map +0 -1
- package/dist/EventSequences/IEventSequence.js.map +0 -1
- package/dist/EventSequences/index.d.ts +0 -11
- package/dist/EventSequences/index.d.ts.map +0 -1
- package/dist/EventSequences/index.js +0 -7
- package/dist/EventSequences/index.js.map +0 -1
- package/dist/Events/AppendedEvent.d.ts.map +0 -1
- package/dist/Events/AppendedEvent.js.map +0 -1
- package/dist/Events/CausationEntry.d.ts.map +0 -1
- package/dist/Events/CausationEntry.js.map +0 -1
- package/dist/Events/Constraints/ConstraintBuilder.d.ts.map +0 -1
- package/dist/Events/Constraints/ConstraintBuilder.js.map +0 -1
- package/dist/Events/Constraints/ConstraintId.d.ts.map +0 -1
- package/dist/Events/Constraints/ConstraintId.js.map +0 -1
- package/dist/Events/Constraints/Constraints.d.ts.map +0 -1
- package/dist/Events/Constraints/Constraints.js.map +0 -1
- package/dist/Events/Constraints/IConstraint.d.ts.map +0 -1
- package/dist/Events/Constraints/IConstraint.js.map +0 -1
- package/dist/Events/Constraints/IConstraintBuilder.d.ts.map +0 -1
- package/dist/Events/Constraints/IConstraintBuilder.js.map +0 -1
- package/dist/Events/Constraints/IConstraints.d.ts.map +0 -1
- package/dist/Events/Constraints/IConstraints.js.map +0 -1
- package/dist/Events/Constraints/IUniqueConstraintBuilder.d.ts.map +0 -1
- package/dist/Events/Constraints/IUniqueConstraintBuilder.js.map +0 -1
- package/dist/Events/Constraints/UniqueConstraintBuilder.d.ts.map +0 -1
- package/dist/Events/Constraints/UniqueConstraintBuilder.js.map +0 -1
- package/dist/Events/Constraints/constraint.d.ts.map +0 -1
- package/dist/Events/Constraints/constraint.js.map +0 -1
- package/dist/Events/Constraints/index.d.ts.map +0 -1
- package/dist/Events/Constraints/index.js.map +0 -1
- package/dist/Events/EventContext.d.ts +0 -20
- package/dist/Events/EventContext.d.ts.map +0 -1
- package/dist/Events/EventContext.js.map +0 -1
- package/dist/Events/EventType.d.ts.map +0 -1
- package/dist/Events/EventType.js.map +0 -1
- package/dist/Events/EventTypeGeneration.d.ts.map +0 -1
- package/dist/Events/EventTypeGeneration.js.map +0 -1
- package/dist/Events/EventTypeId.d.ts.map +0 -1
- package/dist/Events/EventTypeId.js.map +0 -1
- package/dist/Events/EventTypes.d.ts +0 -33
- package/dist/Events/EventTypes.d.ts.map +0 -1
- package/dist/Events/EventTypes.js +0 -83
- package/dist/Events/EventTypes.js.map +0 -1
- package/dist/Events/IEventTypes.d.ts.map +0 -1
- package/dist/Events/IEventTypes.js.map +0 -1
- package/dist/Events/eventTypeDecorator.d.ts +0 -71
- package/dist/Events/eventTypeDecorator.d.ts.map +0 -1
- package/dist/Events/eventTypeDecorator.js +0 -86
- package/dist/Events/eventTypeDecorator.js.map +0 -1
- package/dist/Events/index.d.ts +0 -12
- package/dist/Events/index.d.ts.map +0 -1
- package/dist/Events/index.js +0 -9
- package/dist/Events/index.js.map +0 -1
- package/dist/Identity/IIdentityProvider.d.ts.map +0 -1
- package/dist/Identity/IIdentityProvider.js.map +0 -1
- package/dist/Identity/Identity.d.ts.map +0 -1
- package/dist/Identity/Identity.js.map +0 -1
- package/dist/Identity/IdentityProvider.d.ts.map +0 -1
- package/dist/Identity/IdentityProvider.js.map +0 -1
- package/dist/Identity/index.d.ts.map +0 -1
- package/dist/Identity/index.js.map +0 -1
- package/dist/Observation/ObserverId.d.ts.map +0 -1
- package/dist/Observation/ObserverId.js.map +0 -1
- package/dist/Observation/ObserverRunningState.d.ts.map +0 -1
- package/dist/Observation/ObserverRunningState.js.map +0 -1
- package/dist/Observation/index.d.ts.map +0 -1
- package/dist/Observation/index.js.map +0 -1
- package/dist/Projections/IProjections.d.ts.map +0 -1
- package/dist/Projections/IProjections.js.map +0 -1
- package/dist/Projections/ProjectionId.d.ts.map +0 -1
- package/dist/Projections/ProjectionId.js.map +0 -1
- package/dist/Projections/Projections.d.ts.map +0 -1
- package/dist/Projections/Projections.js +0 -441
- package/dist/Projections/Projections.js.map +0 -1
- package/dist/Projections/declarative/AllSetBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/AllSetBuilder.js.map +0 -1
- package/dist/Projections/declarative/FromBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/FromBuilder.js.map +0 -1
- package/dist/Projections/declarative/FromEveryBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/FromEveryBuilder.js.map +0 -1
- package/dist/Projections/declarative/IAddBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IAddBuilder.js.map +0 -1
- package/dist/Projections/declarative/IAddChildBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IAddChildBuilder.js.map +0 -1
- package/dist/Projections/declarative/IAllSetBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IAllSetBuilder.js.map +0 -1
- package/dist/Projections/declarative/IChildrenBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IChildrenBuilder.js.map +0 -1
- package/dist/Projections/declarative/ICompositeKeyBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/ICompositeKeyBuilder.js.map +0 -1
- package/dist/Projections/declarative/IFromBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IFromBuilder.js.map +0 -1
- package/dist/Projections/declarative/IFromEveryBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IFromEveryBuilder.js.map +0 -1
- package/dist/Projections/declarative/IJoinBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IJoinBuilder.js.map +0 -1
- package/dist/Projections/declarative/INestedBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/INestedBuilder.js.map +0 -1
- package/dist/Projections/declarative/IProjectionBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IProjectionBuilder.js.map +0 -1
- package/dist/Projections/declarative/IProjectionBuilderFor.d.ts.map +0 -1
- package/dist/Projections/declarative/IProjectionBuilderFor.js.map +0 -1
- package/dist/Projections/declarative/IProjectionFor.d.ts.map +0 -1
- package/dist/Projections/declarative/IProjectionFor.js.map +0 -1
- package/dist/Projections/declarative/IReadModelPropertiesBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IReadModelPropertiesBuilder.js.map +0 -1
- package/dist/Projections/declarative/IRemovedWithBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IRemovedWithBuilder.js.map +0 -1
- package/dist/Projections/declarative/IRemovedWithJoinBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/IRemovedWithJoinBuilder.js.map +0 -1
- package/dist/Projections/declarative/ISetBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/ISetBuilder.js.map +0 -1
- package/dist/Projections/declarative/ISubtractBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/ISubtractBuilder.js.map +0 -1
- package/dist/Projections/declarative/JoinBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/JoinBuilder.js.map +0 -1
- package/dist/Projections/declarative/ProjectionBuilderFor.d.ts.map +0 -1
- package/dist/Projections/declarative/ProjectionBuilderFor.js +0 -223
- package/dist/Projections/declarative/ProjectionBuilderFor.js.map +0 -1
- package/dist/Projections/declarative/RemovedWithBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/RemovedWithBuilder.js.map +0 -1
- package/dist/Projections/declarative/RemovedWithJoinBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/RemovedWithJoinBuilder.js.map +0 -1
- package/dist/Projections/declarative/SetBuilder.d.ts.map +0 -1
- package/dist/Projections/declarative/SetBuilder.js.map +0 -1
- package/dist/Projections/declarative/index.d.ts.map +0 -1
- package/dist/Projections/declarative/index.js.map +0 -1
- package/dist/Projections/declarative/projection.d.ts.map +0 -1
- package/dist/Projections/declarative/projection.js.map +0 -1
- package/dist/Projections/index.d.ts.map +0 -1
- package/dist/Projections/index.js.map +0 -1
- package/dist/Projections/modelBound/FromEventMetadata.d.ts.map +0 -1
- package/dist/Projections/modelBound/FromEventMetadata.js.map +0 -1
- package/dist/Projections/modelBound/FromEventOptions.d.ts.map +0 -1
- package/dist/Projections/modelBound/FromEventOptions.js.map +0 -1
- package/dist/Projections/modelBound/addFrom.d.ts.map +0 -1
- package/dist/Projections/modelBound/addFrom.js.map +0 -1
- package/dist/Projections/modelBound/childrenFrom.d.ts.map +0 -1
- package/dist/Projections/modelBound/childrenFrom.js.map +0 -1
- package/dist/Projections/modelBound/clearWith.d.ts.map +0 -1
- package/dist/Projections/modelBound/clearWith.js.map +0 -1
- package/dist/Projections/modelBound/count.d.ts.map +0 -1
- package/dist/Projections/modelBound/count.js.map +0 -1
- package/dist/Projections/modelBound/decrement.d.ts.map +0 -1
- package/dist/Projections/modelBound/decrement.js.map +0 -1
- package/dist/Projections/modelBound/fromEvent.d.ts.map +0 -1
- package/dist/Projections/modelBound/fromEvent.js.map +0 -1
- package/dist/Projections/modelBound/fromEvery.d.ts.map +0 -1
- package/dist/Projections/modelBound/fromEvery.js.map +0 -1
- package/dist/Projections/modelBound/increment.d.ts.map +0 -1
- package/dist/Projections/modelBound/increment.js.map +0 -1
- package/dist/Projections/modelBound/index.d.ts.map +0 -1
- package/dist/Projections/modelBound/index.js.map +0 -1
- package/dist/Projections/modelBound/join.d.ts.map +0 -1
- package/dist/Projections/modelBound/join.js.map +0 -1
- package/dist/Projections/modelBound/nested.d.ts.map +0 -1
- package/dist/Projections/modelBound/nested.js.map +0 -1
- package/dist/Projections/modelBound/notRewindable.d.ts.map +0 -1
- package/dist/Projections/modelBound/notRewindable.js.map +0 -1
- package/dist/Projections/modelBound/removedWith.d.ts.map +0 -1
- package/dist/Projections/modelBound/removedWith.js.map +0 -1
- package/dist/Projections/modelBound/removedWithJoin.d.ts.map +0 -1
- package/dist/Projections/modelBound/removedWithJoin.js.map +0 -1
- package/dist/Projections/modelBound/setFrom.d.ts.map +0 -1
- package/dist/Projections/modelBound/setFrom.js.map +0 -1
- package/dist/Projections/modelBound/setFromContext.d.ts +0 -26
- package/dist/Projections/modelBound/setFromContext.d.ts.map +0 -1
- package/dist/Projections/modelBound/setFromContext.js.map +0 -1
- package/dist/Projections/modelBound/setValue.d.ts.map +0 -1
- package/dist/Projections/modelBound/setValue.js.map +0 -1
- package/dist/Projections/modelBound/subtractFrom.d.ts.map +0 -1
- package/dist/Projections/modelBound/subtractFrom.js.map +0 -1
- package/dist/Reactors/IReactors.d.ts.map +0 -1
- package/dist/Reactors/IReactors.js.map +0 -1
- package/dist/Reactors/ReactorId.d.ts.map +0 -1
- package/dist/Reactors/ReactorId.js.map +0 -1
- package/dist/Reactors/Reactors.d.ts.map +0 -1
- package/dist/Reactors/Reactors.js +0 -280
- package/dist/Reactors/Reactors.js.map +0 -1
- package/dist/Reactors/index.d.ts.map +0 -1
- package/dist/Reactors/index.js.map +0 -1
- package/dist/Reactors/reactor.d.ts.map +0 -1
- package/dist/Reactors/reactor.js.map +0 -1
- package/dist/ReadModels/ReadModelId.d.ts.map +0 -1
- package/dist/ReadModels/ReadModelId.js.map +0 -1
- package/dist/ReadModels/index.d.ts.map +0 -1
- package/dist/ReadModels/index.js.map +0 -1
- package/dist/ReadModels/readModel.d.ts +0 -33
- package/dist/ReadModels/readModel.d.ts.map +0 -1
- package/dist/ReadModels/readModel.js +0 -64
- package/dist/ReadModels/readModel.js.map +0 -1
- package/dist/Reducers/IReducers.d.ts.map +0 -1
- package/dist/Reducers/IReducers.js.map +0 -1
- package/dist/Reducers/ReducerId.d.ts.map +0 -1
- package/dist/Reducers/ReducerId.js.map +0 -1
- package/dist/Reducers/Reducers.d.ts.map +0 -1
- package/dist/Reducers/Reducers.js +0 -337
- package/dist/Reducers/Reducers.js.map +0 -1
- package/dist/Reducers/index.d.ts.map +0 -1
- package/dist/Reducers/index.js.map +0 -1
- package/dist/Reducers/reducer.d.ts.map +0 -1
- package/dist/Reducers/reducer.js.map +0 -1
- package/dist/Schemas/JsonSchema.d.ts.map +0 -1
- package/dist/Schemas/JsonSchema.js.map +0 -1
- package/dist/Schemas/JsonSchemaGenerator.d.ts.map +0 -1
- package/dist/Schemas/JsonSchemaGenerator.js.map +0 -1
- package/dist/Schemas/index.d.ts.map +0 -1
- package/dist/Schemas/index.js.map +0 -1
- package/dist/Schemas/jsonSchemaProperty.d.ts.map +0 -1
- package/dist/Schemas/jsonSchemaProperty.js.map +0 -1
- /package/{Auditing → auditing}/Causation.ts +0 -0
- /package/{Auditing → auditing}/CausationManager.ts +0 -0
- /package/{Auditing → auditing}/CausationType.ts +0 -0
- /package/{Auditing → auditing}/ICausationManager.ts +0 -0
- /package/{Auditing → auditing}/index.ts +0 -0
- /package/{Correlation → correlation}/CorrelationId.ts +0 -0
- /package/{Correlation → correlation}/CorrelationIdManager.ts +0 -0
- /package/{Correlation → correlation}/ICorrelationIdAccessor.ts +0 -0
- /package/{Correlation → correlation}/ICorrelationIdSetter.ts +0 -0
- /package/{Correlation → correlation}/index.ts +0 -0
- /package/dist/{Auditing → auditing}/Causation.d.ts +0 -0
- /package/dist/{Auditing → auditing}/Causation.js +0 -0
- /package/dist/{Auditing → auditing}/CausationManager.d.ts +0 -0
- /package/dist/{Auditing → auditing}/CausationManager.js +0 -0
- /package/dist/{Auditing → auditing}/CausationType.d.ts +0 -0
- /package/dist/{Auditing → auditing}/CausationType.js +0 -0
- /package/dist/{Auditing → auditing}/ICausationManager.d.ts +0 -0
- /package/dist/{Auditing → auditing}/ICausationManager.js +0 -0
- /package/dist/{Auditing → auditing}/index.d.ts +0 -0
- /package/dist/{Auditing → auditing}/index.js +0 -0
- /package/dist/{Correlation → correlation}/CorrelationId.d.ts +0 -0
- /package/dist/{Correlation → correlation}/CorrelationId.js +0 -0
- /package/dist/{Correlation → correlation}/CorrelationIdManager.d.ts +0 -0
- /package/dist/{Correlation → correlation}/CorrelationIdManager.js +0 -0
- /package/dist/{Correlation → correlation}/ICorrelationIdAccessor.d.ts +0 -0
- /package/dist/{Correlation → correlation}/ICorrelationIdAccessor.js +0 -0
- /package/dist/{Correlation → correlation}/ICorrelationIdSetter.d.ts +0 -0
- /package/dist/{Correlation → correlation}/ICorrelationIdSetter.js +0 -0
- /package/dist/{Correlation → correlation}/index.d.ts +0 -0
- /package/dist/{Correlation → correlation}/index.js +0 -0
- /package/dist/{EventSequences → eventSequences}/AppendError.d.ts +0 -0
- /package/dist/{EventSequences → eventSequences}/AppendError.js +0 -0
- /package/dist/{EventSequences → eventSequences}/AppendOptions.js +0 -0
- /package/dist/{EventSequences → eventSequences}/AppendResult.d.ts +0 -0
- /package/dist/{EventSequences → eventSequences}/AppendResult.js +0 -0
- /package/dist/{EventSequences → eventSequences}/ConstraintViolation.d.ts +0 -0
- /package/dist/{EventSequences → eventSequences}/ConstraintViolation.js +0 -0
- /package/dist/{EventSequences → eventSequences}/EventSequenceId.d.ts +0 -0
- /package/dist/{EventSequences → eventSequences}/EventSequenceId.js +0 -0
- /package/dist/{EventSequences → eventSequences}/IEventLog.d.ts +0 -0
- /package/dist/{EventSequences → eventSequences}/IEventLog.js +0 -0
- /package/dist/{EventSequences → eventSequences}/IEventSequence.js +0 -0
- /package/dist/{Events → events}/AppendedEvent.d.ts +0 -0
- /package/dist/{Events → events}/AppendedEvent.js +0 -0
- /package/dist/{Events → events}/CausationEntry.d.ts +0 -0
- /package/dist/{Events → events}/CausationEntry.js +0 -0
- /package/dist/{Events → events}/EventContext.js +0 -0
- /package/dist/{Events → events}/EventType.d.ts +0 -0
- /package/dist/{Events → events}/EventType.js +0 -0
- /package/dist/{Events → events}/EventTypeGeneration.d.ts +0 -0
- /package/dist/{Events → events}/EventTypeGeneration.js +0 -0
- /package/dist/{Events → events}/EventTypeId.d.ts +0 -0
- /package/dist/{Events → events}/EventTypeId.js +0 -0
- /package/dist/{Events → events}/IEventTypes.d.ts +0 -0
- /package/dist/{Events → events}/IEventTypes.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/ConstraintBuilder.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/ConstraintBuilder.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/ConstraintId.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/ConstraintId.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/Constraints.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/Constraints.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/IConstraint.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/IConstraint.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/IConstraintBuilder.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/IConstraintBuilder.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/IConstraints.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/IConstraints.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/IUniqueConstraintBuilder.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/IUniqueConstraintBuilder.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/UniqueConstraintBuilder.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/UniqueConstraintBuilder.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/constraint.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/constraint.js +0 -0
- /package/dist/{Events/Constraints → events/constraints}/index.d.ts +0 -0
- /package/dist/{Events/Constraints → events/constraints}/index.js +0 -0
- /package/dist/{Identity → identity}/IIdentityProvider.d.ts +0 -0
- /package/dist/{Identity → identity}/IIdentityProvider.js +0 -0
- /package/dist/{Identity → identity}/Identity.d.ts +0 -0
- /package/dist/{Identity → identity}/Identity.js +0 -0
- /package/dist/{Identity → identity}/IdentityProvider.d.ts +0 -0
- /package/dist/{Identity → identity}/IdentityProvider.js +0 -0
- /package/dist/{Identity → identity}/index.d.ts +0 -0
- /package/dist/{Identity → identity}/index.js +0 -0
- /package/dist/{Observation → observation}/ObserverId.d.ts +0 -0
- /package/dist/{Observation → observation}/ObserverId.js +0 -0
- /package/dist/{Observation → observation}/ObserverRunningState.d.ts +0 -0
- /package/dist/{Observation → observation}/ObserverRunningState.js +0 -0
- /package/dist/{Observation → observation}/index.d.ts +0 -0
- /package/dist/{Observation → observation}/index.js +0 -0
- /package/dist/{Projections → projections}/IProjections.d.ts +0 -0
- /package/dist/{Projections → projections}/IProjections.js +0 -0
- /package/dist/{Projections → projections}/ProjectionId.d.ts +0 -0
- /package/dist/{Projections → projections}/ProjectionId.js +0 -0
- /package/dist/{Projections → projections}/Projections.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/AllSetBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/AllSetBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/FromBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/FromBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/FromEveryBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/FromEveryBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IAddBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IAddBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IAddChildBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IAddChildBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IAllSetBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IAllSetBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IChildrenBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IChildrenBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/ICompositeKeyBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/ICompositeKeyBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IFromBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IFromBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IFromEveryBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IFromEveryBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IJoinBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IJoinBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/INestedBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/INestedBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IProjectionBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IProjectionBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IProjectionBuilderFor.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IProjectionBuilderFor.js +0 -0
- /package/dist/{Projections → projections}/declarative/IProjectionFor.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IProjectionFor.js +0 -0
- /package/dist/{Projections → projections}/declarative/IReadModelPropertiesBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IReadModelPropertiesBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IRemovedWithBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IRemovedWithBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/IRemovedWithJoinBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/IRemovedWithJoinBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/ISetBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/ISetBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/ISubtractBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/ISubtractBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/JoinBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/JoinBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/ProjectionBuilderFor.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/RemovedWithBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/RemovedWithBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/RemovedWithJoinBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/RemovedWithJoinBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/SetBuilder.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/SetBuilder.js +0 -0
- /package/dist/{Projections → projections}/declarative/index.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/index.js +0 -0
- /package/dist/{Projections → projections}/declarative/projection.d.ts +0 -0
- /package/dist/{Projections → projections}/declarative/projection.js +0 -0
- /package/dist/{Projections → projections}/index.d.ts +0 -0
- /package/dist/{Projections → projections}/index.js +0 -0
- /package/dist/{Projections → projections}/modelBound/FromEventMetadata.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/FromEventMetadata.js +0 -0
- /package/dist/{Projections → projections}/modelBound/FromEventOptions.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/FromEventOptions.js +0 -0
- /package/dist/{Projections → projections}/modelBound/addFrom.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/addFrom.js +0 -0
- /package/dist/{Projections → projections}/modelBound/childrenFrom.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/childrenFrom.js +0 -0
- /package/dist/{Projections → projections}/modelBound/clearWith.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/clearWith.js +0 -0
- /package/dist/{Projections → projections}/modelBound/count.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/count.js +0 -0
- /package/dist/{Projections → projections}/modelBound/decrement.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/decrement.js +0 -0
- /package/dist/{Projections → projections}/modelBound/fromEvent.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/fromEvent.js +0 -0
- /package/dist/{Projections → projections}/modelBound/fromEvery.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/fromEvery.js +0 -0
- /package/dist/{Projections → projections}/modelBound/increment.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/increment.js +0 -0
- /package/dist/{Projections → projections}/modelBound/index.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/index.js +0 -0
- /package/dist/{Projections → projections}/modelBound/join.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/join.js +0 -0
- /package/dist/{Projections → projections}/modelBound/nested.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/nested.js +0 -0
- /package/dist/{Projections → projections}/modelBound/notRewindable.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/notRewindable.js +0 -0
- /package/dist/{Projections → projections}/modelBound/removedWith.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/removedWith.js +0 -0
- /package/dist/{Projections → projections}/modelBound/removedWithJoin.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/removedWithJoin.js +0 -0
- /package/dist/{Projections → projections}/modelBound/setFrom.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/setFrom.js +0 -0
- /package/dist/{Projections → projections}/modelBound/setFromContext.js +0 -0
- /package/dist/{Projections → projections}/modelBound/setValue.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/setValue.js +0 -0
- /package/dist/{Projections → projections}/modelBound/subtractFrom.d.ts +0 -0
- /package/dist/{Projections → projections}/modelBound/subtractFrom.js +0 -0
- /package/dist/{Reactors → reactors}/IReactors.d.ts +0 -0
- /package/dist/{Reactors → reactors}/IReactors.js +0 -0
- /package/dist/{Reactors → reactors}/ReactorId.d.ts +0 -0
- /package/dist/{Reactors → reactors}/ReactorId.js +0 -0
- /package/dist/{Reactors → reactors}/Reactors.d.ts +0 -0
- /package/dist/{Reactors → reactors}/index.d.ts +0 -0
- /package/dist/{Reactors → reactors}/index.js +0 -0
- /package/dist/{Reactors → reactors}/reactor.d.ts +0 -0
- /package/dist/{Reactors → reactors}/reactor.js +0 -0
- /package/dist/{ReadModels → readModels}/ReadModelId.d.ts +0 -0
- /package/dist/{ReadModels → readModels}/ReadModelId.js +0 -0
- /package/dist/{ReadModels → readModels}/index.d.ts +0 -0
- /package/dist/{ReadModels → readModels}/index.js +0 -0
- /package/dist/{Reducers → reducers}/IReducers.d.ts +0 -0
- /package/dist/{Reducers → reducers}/IReducers.js +0 -0
- /package/dist/{Reducers → reducers}/ReducerId.d.ts +0 -0
- /package/dist/{Reducers → reducers}/ReducerId.js +0 -0
- /package/dist/{Reducers → reducers}/Reducers.d.ts +0 -0
- /package/dist/{Reducers → reducers}/index.d.ts +0 -0
- /package/dist/{Reducers → reducers}/index.js +0 -0
- /package/dist/{Reducers → reducers}/reducer.d.ts +0 -0
- /package/dist/{Reducers → reducers}/reducer.js +0 -0
- /package/dist/{Schemas → schemas}/JsonSchema.d.ts +0 -0
- /package/dist/{Schemas → schemas}/JsonSchema.js +0 -0
- /package/dist/{Schemas → schemas}/JsonSchemaGenerator.d.ts +0 -0
- /package/dist/{Schemas → schemas}/JsonSchemaGenerator.js +0 -0
- /package/dist/{Schemas → schemas}/index.d.ts +0 -0
- /package/dist/{Schemas → schemas}/index.js +0 -0
- /package/dist/{Schemas → schemas}/jsonSchemaProperty.d.ts +0 -0
- /package/dist/{Schemas → schemas}/jsonSchemaProperty.js +0 -0
- /package/{EventSequences → eventSequences}/AppendError.ts +0 -0
- /package/{EventSequences → eventSequences}/AppendResult.ts +0 -0
- /package/{EventSequences → eventSequences}/ConstraintViolation.ts +0 -0
- /package/{EventSequences → eventSequences}/EventSequenceId.ts +0 -0
- /package/{EventSequences → eventSequences}/IEventLog.ts +0 -0
- /package/{Events → events}/AppendedEvent.ts +0 -0
- /package/{Events → events}/CausationEntry.ts +0 -0
- /package/{Events → events}/EventType.ts +0 -0
- /package/{Events → events}/EventTypeGeneration.ts +0 -0
- /package/{Events → events}/EventTypeId.ts +0 -0
- /package/{Events → events}/IEventTypes.ts +0 -0
- /package/{Events/Constraints → events/constraints}/ConstraintBuilder.ts +0 -0
- /package/{Events/Constraints → events/constraints}/ConstraintId.ts +0 -0
- /package/{Events/Constraints → events/constraints}/Constraints.ts +0 -0
- /package/{Events/Constraints → events/constraints}/IConstraint.ts +0 -0
- /package/{Events/Constraints → events/constraints}/IConstraintBuilder.ts +0 -0
- /package/{Events/Constraints → events/constraints}/IConstraints.ts +0 -0
- /package/{Events/Constraints → events/constraints}/IUniqueConstraintBuilder.ts +0 -0
- /package/{Events/Constraints → events/constraints}/UniqueConstraintBuilder.ts +0 -0
- /package/{Events/Constraints → events/constraints}/constraint.ts +0 -0
- /package/{Events/Constraints → events/constraints}/index.ts +0 -0
- /package/{Identity → identity}/IIdentityProvider.ts +0 -0
- /package/{Identity → identity}/Identity.ts +0 -0
- /package/{Identity → identity}/IdentityProvider.ts +0 -0
- /package/{Identity → identity}/index.ts +0 -0
- /package/{Observation → observation}/ObserverId.ts +0 -0
- /package/{Observation → observation}/ObserverRunningState.ts +0 -0
- /package/{Observation → observation}/index.ts +0 -0
- /package/{Projections → projections}/IProjections.ts +0 -0
- /package/{Projections → projections}/ProjectionId.ts +0 -0
- /package/{Projections → projections}/declarative/AllSetBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/FromBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/FromEveryBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IAddBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IAddChildBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IAllSetBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IChildrenBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/ICompositeKeyBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IFromBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IFromEveryBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IJoinBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/INestedBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IProjectionBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IProjectionBuilderFor.ts +0 -0
- /package/{Projections → projections}/declarative/IProjectionFor.ts +0 -0
- /package/{Projections → projections}/declarative/IReadModelPropertiesBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IRemovedWithBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/IRemovedWithJoinBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/ISetBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/ISubtractBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/JoinBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/RemovedWithBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/RemovedWithJoinBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/SetBuilder.ts +0 -0
- /package/{Projections → projections}/declarative/index.ts +0 -0
- /package/{Projections → projections}/declarative/projection.ts +0 -0
- /package/{Projections → projections}/index.ts +0 -0
- /package/{Projections → projections}/modelBound/FromEventMetadata.ts +0 -0
- /package/{Projections → projections}/modelBound/FromEventOptions.ts +0 -0
- /package/{Projections → projections}/modelBound/addFrom.ts +0 -0
- /package/{Projections → projections}/modelBound/childrenFrom.ts +0 -0
- /package/{Projections → projections}/modelBound/clearWith.ts +0 -0
- /package/{Projections → projections}/modelBound/count.ts +0 -0
- /package/{Projections → projections}/modelBound/decrement.ts +0 -0
- /package/{Projections → projections}/modelBound/fromEvent.ts +0 -0
- /package/{Projections → projections}/modelBound/fromEvery.ts +0 -0
- /package/{Projections → projections}/modelBound/increment.ts +0 -0
- /package/{Projections → projections}/modelBound/index.ts +0 -0
- /package/{Projections → projections}/modelBound/join.ts +0 -0
- /package/{Projections → projections}/modelBound/nested.ts +0 -0
- /package/{Projections → projections}/modelBound/notRewindable.ts +0 -0
- /package/{Projections → projections}/modelBound/removedWith.ts +0 -0
- /package/{Projections → projections}/modelBound/removedWithJoin.ts +0 -0
- /package/{Projections → projections}/modelBound/setFrom.ts +0 -0
- /package/{Projections → projections}/modelBound/setValue.ts +0 -0
- /package/{Projections → projections}/modelBound/subtractFrom.ts +0 -0
- /package/{Reactors → reactors}/IReactors.ts +0 -0
- /package/{Reactors → reactors}/ReactorId.ts +0 -0
- /package/{Reactors → reactors}/index.ts +0 -0
- /package/{Reactors → reactors}/reactor.ts +0 -0
- /package/{ReadModels → readModels}/ReadModelId.ts +0 -0
- /package/{ReadModels → readModels}/index.ts +0 -0
- /package/{Reducers → reducers}/IReducers.ts +0 -0
- /package/{Reducers → reducers}/ReducerId.ts +0 -0
- /package/{Reducers → reducers}/index.ts +0 -0
- /package/{Reducers → reducers}/reducer.ts +0 -0
- /package/{Schemas → schemas}/JsonSchema.ts +0 -0
- /package/{Schemas → schemas}/JsonSchemaGenerator.ts +0 -0
- /package/{Schemas → schemas}/index.ts +0 -0
- /package/{Schemas → schemas}/jsonSchemaProperty.ts +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IEventSeedingBuilder } from './IEventSeedingBuilder';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the event seeding API surface.
|
|
4
|
+
*/
|
|
5
|
+
export interface IEventSeeding extends IEventSeedingBuilder {
|
|
6
|
+
/**
|
|
7
|
+
* Discovers all registered event seeders.
|
|
8
|
+
* @returns A promise that resolves when discovery is complete.
|
|
9
|
+
*/
|
|
10
|
+
discover(): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Registers all discovered event seeders by invoking them and sending seed data to the server.
|
|
13
|
+
* @returns A promise that resolves when registration is complete.
|
|
14
|
+
*/
|
|
15
|
+
register(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=IEventSeeding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEventSeeding.d.ts","sourceRoot":"","sources":["../../seeding/IEventSeeding.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,oBAAoB;IACvD;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEventSeeding.js","sourceRoot":"","sources":["../../seeding/IEventSeeding.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EventStoreNamespaceName } from '../EventStoreNamespaceName';
|
|
2
|
+
import { IEventSeedingScopeBuilder } from './IEventSeedingScopeBuilder';
|
|
3
|
+
/**
|
|
4
|
+
* Defines a builder for seeding events in the event store.
|
|
5
|
+
*/
|
|
6
|
+
export interface IEventSeedingBuilder {
|
|
7
|
+
/**
|
|
8
|
+
* Seeds events for a specific event source id.
|
|
9
|
+
* By default, seed data applies to all namespaces globally.
|
|
10
|
+
* @param eventSourceId - The event source id to seed for.
|
|
11
|
+
* @param events - The events to seed.
|
|
12
|
+
* @returns The builder for chaining.
|
|
13
|
+
*/
|
|
14
|
+
for<TEvent extends object>(eventSourceId: string, events: Iterable<TEvent>): IEventSeedingBuilder;
|
|
15
|
+
/**
|
|
16
|
+
* Seeds events of multiple types for a specific event source id.
|
|
17
|
+
* By default, seed data applies to all namespaces globally.
|
|
18
|
+
* @param eventSourceId - The event source id to seed for.
|
|
19
|
+
* @param events - The events to seed.
|
|
20
|
+
* @returns The builder for chaining.
|
|
21
|
+
*/
|
|
22
|
+
forEventSource(eventSourceId: string, events: Iterable<object>): IEventSeedingBuilder;
|
|
23
|
+
/**
|
|
24
|
+
* Configures seed data to be specific to a namespace.
|
|
25
|
+
* @param namespace - The namespace to seed for.
|
|
26
|
+
* @returns A scoped builder for namespace-specific seed data.
|
|
27
|
+
*/
|
|
28
|
+
forNamespace(namespace: string | EventStoreNamespaceName): IEventSeedingScopeBuilder;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=IEventSeedingBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEventSeedingBuilder.d.ts","sourceRoot":"","sources":["../../seeding/IEventSeedingBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC;;;;;;OAMG;IACH,GAAG,CAAC,MAAM,SAAS,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC;IAElG;;;;;;OAMG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC;IAEtF;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,uBAAuB,GAAG,yBAAyB,CAAC;CACxF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEventSeedingBuilder.js","sourceRoot":"","sources":["../../seeding/IEventSeedingBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines a scoped builder for namespace-specific event seeding.
|
|
3
|
+
*/
|
|
4
|
+
export interface IEventSeedingScopeBuilder {
|
|
5
|
+
/**
|
|
6
|
+
* Seeds events for a specific event source id.
|
|
7
|
+
* @param eventSourceId - The event source id to seed for.
|
|
8
|
+
* @param events - The events to seed.
|
|
9
|
+
* @returns The scoped builder for chaining.
|
|
10
|
+
*/
|
|
11
|
+
for<TEvent extends object>(eventSourceId: string, events: Iterable<TEvent>): IEventSeedingScopeBuilder;
|
|
12
|
+
/**
|
|
13
|
+
* Seeds events of multiple types for a specific event source id.
|
|
14
|
+
* @param eventSourceId - The event source id to seed for.
|
|
15
|
+
* @param events - The events to seed.
|
|
16
|
+
* @returns The scoped builder for chaining.
|
|
17
|
+
*/
|
|
18
|
+
forEventSource(eventSourceId: string, events: Iterable<object>): IEventSeedingScopeBuilder;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=IEventSeedingScopeBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEventSeedingScopeBuilder.d.ts","sourceRoot":"","sources":["../../seeding/IEventSeedingScopeBuilder.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC;;;;;OAKG;IACH,GAAG,CAAC,MAAM,SAAS,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,yBAAyB,CAAC;IAEvG;;;;;OAKG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,yBAAyB,CAAC;CAC9F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEventSeedingScopeBuilder.js","sourceRoot":"","sources":["../../seeding/IEventSeedingScopeBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { ICanSeedEvents } from './ICanSeedEvents';
|
|
2
|
+
export type { IEventSeedingScopeBuilder } from './IEventSeedingScopeBuilder';
|
|
3
|
+
export type { IEventSeedingBuilder } from './IEventSeedingBuilder';
|
|
4
|
+
export type { IEventSeeding } from './IEventSeeding';
|
|
5
|
+
export { seeder, getSeederMetadata, isSeeder } from './seeder';
|
|
6
|
+
export type { SeederMetadata } from './seeder';
|
|
7
|
+
export { EventSeeding } from './EventSeeding';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../seeding/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/D,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
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 { seeder, getSeederMetadata, isSeeder } from './seeder';
|
|
4
|
+
export { EventSeeding } from './EventSeeding';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../seeding/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAMrG,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
/**
|
|
3
|
+
* Metadata stored on a seeder class.
|
|
4
|
+
*/
|
|
5
|
+
export interface SeederMetadata {
|
|
6
|
+
/** Marker indicating this type is an event seeder. */
|
|
7
|
+
readonly isSeeder: true;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* TypeScript decorator that marks a class as an event seeder.
|
|
11
|
+
* This is the TypeScript equivalent of a discoverable event seeder artifact.
|
|
12
|
+
*
|
|
13
|
+
* @returns A class decorator.
|
|
14
|
+
*/
|
|
15
|
+
export declare function seeder(): ClassDecorator;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the {@link SeederMetadata} associated with a class decorated with {@link seeder}.
|
|
18
|
+
* @param target - The class constructor to retrieve metadata for.
|
|
19
|
+
* @returns The associated metadata, or undefined if not decorated.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getSeederMetadata(target: Function): SeederMetadata | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Checks whether a class has been decorated with {@link seeder}.
|
|
24
|
+
* @param target - The class constructor to check.
|
|
25
|
+
* @returns True if the class has a seeder decorator; otherwise false.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isSeeder(target: Function): boolean;
|
|
28
|
+
//# sourceMappingURL=seeder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seeder.d.ts","sourceRoot":"","sources":["../../seeding/seeder.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAO1B;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,IAAI,cAAc,CAWvC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,cAAc,GAAG,SAAS,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAElD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { DecoratorType, TypeDiscoverer } from '../types';
|
|
5
|
+
/** Metadata key used to store seeder information on a class. */
|
|
6
|
+
const SEEDER_METADATA_KEY = 'chronicle:seeder';
|
|
7
|
+
/**
|
|
8
|
+
* TypeScript decorator that marks a class as an event seeder.
|
|
9
|
+
* This is the TypeScript equivalent of a discoverable event seeder artifact.
|
|
10
|
+
*
|
|
11
|
+
* @returns A class decorator.
|
|
12
|
+
*/
|
|
13
|
+
export function seeder() {
|
|
14
|
+
return (target) => {
|
|
15
|
+
const constructor = target;
|
|
16
|
+
const metadata = { isSeeder: true };
|
|
17
|
+
Reflect.defineMetadata(SEEDER_METADATA_KEY, metadata, target);
|
|
18
|
+
TypeDiscoverer.default.register(DecoratorType.Seeder, constructor, constructor.name);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets the {@link SeederMetadata} associated with a class decorated with {@link seeder}.
|
|
23
|
+
* @param target - The class constructor to retrieve metadata for.
|
|
24
|
+
* @returns The associated metadata, or undefined if not decorated.
|
|
25
|
+
*/
|
|
26
|
+
export function getSeederMetadata(target) {
|
|
27
|
+
return Reflect.getMetadata(SEEDER_METADATA_KEY, target);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Checks whether a class has been decorated with {@link seeder}.
|
|
31
|
+
* @param target - The class constructor to check.
|
|
32
|
+
* @returns True if the class has a seeder decorator; otherwise false.
|
|
33
|
+
*/
|
|
34
|
+
export function isSeeder(target) {
|
|
35
|
+
return getSeederMetadata(target) !== undefined;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=seeder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seeder.js","sourceRoot":"","sources":["../../seeding/seeder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzD,gEAAgE;AAChE,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAU/C;;;;;GAKG;AACH,MAAM,UAAU,MAAM;IAClB,OAAO,CAAC,MAAc,EAAE,EAAE;QACtB,MAAM,WAAW,GAAG,MAAkB,CAAC;QACvC,MAAM,QAAQ,GAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACpD,OAAO,CAAC,cAAc,CAAC,mBAAmB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9D,cAAc,CAAC,OAAO,CAAC,QAAQ,CAC3B,aAAa,CAAC,MAAM,EACpB,WAA0B,EAC1B,WAAW,CAAC,IAAI,CACnB,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAgB;IAC9C,OAAO,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAgB;IACrC,OAAO,iBAAiB,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Guid } from '@cratis/fundamentals';
|
|
2
|
+
import { EventSequenceId } from '../eventSequences/EventSequenceId';
|
|
3
|
+
import { AppendResult } from '../eventSequences/AppendResult';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a unit of work for buffering event appends and committing them as transactions.
|
|
6
|
+
*/
|
|
7
|
+
export interface IUnitOfWork {
|
|
8
|
+
/** The correlation identifier used for all appends within this unit of work. */
|
|
9
|
+
readonly correlationId: Guid;
|
|
10
|
+
/** Whether the unit of work has been completed (committed or rolled back). */
|
|
11
|
+
readonly isCompleted: boolean;
|
|
12
|
+
/** Whether all append operations in this unit of work succeeded. */
|
|
13
|
+
readonly isSuccess: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Adds an event to the unit of work.
|
|
16
|
+
* @param eventSequenceId - The identifier of the event sequence to append to.
|
|
17
|
+
* @param eventSourceId - The event source identifier.
|
|
18
|
+
* @param event - The event payload.
|
|
19
|
+
*/
|
|
20
|
+
addEvent(eventSequenceId: EventSequenceId, eventSourceId: string, event: object): void;
|
|
21
|
+
/**
|
|
22
|
+
* Gets all events currently buffered in this unit of work.
|
|
23
|
+
* @returns The buffered events in append order.
|
|
24
|
+
*/
|
|
25
|
+
getEvents(): ReadonlyArray<object>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets append results from the latest commit.
|
|
28
|
+
* @returns The append results in append order.
|
|
29
|
+
*/
|
|
30
|
+
getAppendResults(): ReadonlyArray<AppendResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Commits all buffered events.
|
|
33
|
+
*/
|
|
34
|
+
commit(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Rolls back all buffered events.
|
|
37
|
+
*/
|
|
38
|
+
rollback(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Sets a callback that runs when the unit of work completes.
|
|
41
|
+
* @param callback - Callback to invoke on completion.
|
|
42
|
+
*/
|
|
43
|
+
onCompleted(callback: (unitOfWork: IUnitOfWork) => void): void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=IUnitOfWork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUnitOfWork.d.ts","sourceRoot":"","sources":["../../transactions/IUnitOfWork.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,gFAAgF;IAChF,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC;IAE7B,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAE9B,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvF;;;OAGG;IACH,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;IAEnC;;;OAGG;IACH,gBAAgB,IAAI,aAAa,CAAC,YAAY,CAAC,CAAC;IAEhD;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAAC;CAClE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUnitOfWork.js","sourceRoot":"","sources":["../../transactions/IUnitOfWork.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Guid } from '@cratis/fundamentals';
|
|
2
|
+
import { IUnitOfWork } from './IUnitOfWork';
|
|
3
|
+
/**
|
|
4
|
+
* Defines an API for managing units of work in the active async context.
|
|
5
|
+
*/
|
|
6
|
+
export interface IUnitOfWorkManager {
|
|
7
|
+
/** The current unit of work for the active async context. */
|
|
8
|
+
readonly current: IUnitOfWork;
|
|
9
|
+
/** Whether there is a current unit of work for the active async context. */
|
|
10
|
+
readonly hasCurrent: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Tries to get a unit of work by correlation identifier.
|
|
13
|
+
* @param correlationId - Correlation identifier to look up.
|
|
14
|
+
* @returns The unit of work if found; otherwise undefined.
|
|
15
|
+
*/
|
|
16
|
+
tryGetFor(correlationId: string | Guid): IUnitOfWork | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Begins a new unit of work in the active async context.
|
|
19
|
+
* @param correlationId - Optional correlation identifier. A new one is generated if omitted.
|
|
20
|
+
* @returns The created unit of work.
|
|
21
|
+
*/
|
|
22
|
+
begin(correlationId?: string | Guid): IUnitOfWork;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the current unit of work for the active async context.
|
|
25
|
+
* @param unitOfWork - The unit of work to set as current.
|
|
26
|
+
*/
|
|
27
|
+
setCurrent(unitOfWork: IUnitOfWork): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=IUnitOfWorkManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUnitOfWorkManager.d.ts","sourceRoot":"","sources":["../../transactions/IUnitOfWorkManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAE9B,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,SAAS,CAAC;IAEjE;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,CAAC;IAElD;;;OAGG;IACH,UAAU,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IUnitOfWorkManager.js","sourceRoot":"","sources":["../../transactions/IUnitOfWorkManager.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error thrown when there is no current unit of work for the active async context.
|
|
3
|
+
*/
|
|
4
|
+
export declare class NoUnitOfWorkHasBeenStarted extends Error {
|
|
5
|
+
/**
|
|
6
|
+
* Initializes a new instance of the {@link NoUnitOfWorkHasBeenStarted} class.
|
|
7
|
+
*/
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=NoUnitOfWorkHasBeenStarted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoUnitOfWorkHasBeenStarted.d.ts","sourceRoot":"","sources":["../../transactions/NoUnitOfWorkHasBeenStarted.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACjD;;OAEG;;CAIN"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when there is no current unit of work for the active async context.
|
|
5
|
+
*/
|
|
6
|
+
export class NoUnitOfWorkHasBeenStarted extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* Initializes a new instance of the {@link NoUnitOfWorkHasBeenStarted} class.
|
|
9
|
+
*/
|
|
10
|
+
constructor() {
|
|
11
|
+
super('No unit of work has been started for the current async context.');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=NoUnitOfWorkHasBeenStarted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoUnitOfWorkHasBeenStarted.js","sourceRoot":"","sources":["../../transactions/NoUnitOfWorkHasBeenStarted.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACjD;;OAEG;IACH;QACI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IAC7E,CAAC;CACJ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Guid } from '@cratis/fundamentals';
|
|
2
|
+
import { AppendResult } from '../eventSequences/AppendResult';
|
|
3
|
+
import { EventSequenceId } from '../eventSequences/EventSequenceId';
|
|
4
|
+
import { IEventStore } from '../IEventStore';
|
|
5
|
+
import { IUnitOfWork } from './IUnitOfWork';
|
|
6
|
+
/**
|
|
7
|
+
* Represents a unit of work that buffers events and commits them as transaction-like append operations.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UnitOfWork implements IUnitOfWork {
|
|
10
|
+
readonly correlationId: Guid;
|
|
11
|
+
private readonly _eventStore;
|
|
12
|
+
private _events;
|
|
13
|
+
private _appendResults;
|
|
14
|
+
private _isCommitted;
|
|
15
|
+
private _isRolledBack;
|
|
16
|
+
private _onCompleted;
|
|
17
|
+
constructor(correlationId: Guid, onCompleted: (unitOfWork: IUnitOfWork) => void, _eventStore: IEventStore);
|
|
18
|
+
/** @inheritdoc */
|
|
19
|
+
get isCompleted(): boolean;
|
|
20
|
+
/** @inheritdoc */
|
|
21
|
+
get isSuccess(): boolean;
|
|
22
|
+
/** @inheritdoc */
|
|
23
|
+
addEvent(eventSequenceId: EventSequenceId, eventSourceId: string, event: object): void;
|
|
24
|
+
/** @inheritdoc */
|
|
25
|
+
getEvents(): ReadonlyArray<object>;
|
|
26
|
+
/** @inheritdoc */
|
|
27
|
+
getAppendResults(): ReadonlyArray<AppendResult>;
|
|
28
|
+
/** @inheritdoc */
|
|
29
|
+
commit(): Promise<void>;
|
|
30
|
+
/** @inheritdoc */
|
|
31
|
+
rollback(): Promise<void>;
|
|
32
|
+
/** @inheritdoc */
|
|
33
|
+
onCompleted(callback: (unitOfWork: IUnitOfWork) => void): void;
|
|
34
|
+
private throwIfCompleted;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=UnitOfWork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnitOfWork.d.ts","sourceRoot":"","sources":["../../transactions/UnitOfWork.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQ5C;;GAEG;AACH,qBAAa,UAAW,YAAW,WAAW;IAQtC,QAAQ,CAAC,aAAa,EAAE,IAAI;IAE5B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAThC,OAAO,CAAC,OAAO,CAAiD;IAChE,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAoC;gBAG3C,aAAa,EAAE,IAAI,EAC5B,WAAW,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,IAAI,EAC7B,WAAW,EAAE,WAAW;IAK7C,kBAAkB;IAClB,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,kBAAkB;IAClB,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,kBAAkB;IAClB,QAAQ,CAAC,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAYtF,kBAAkB;IAClB,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC;IAIlC,kBAAkB;IAClB,gBAAgB,IAAI,aAAa,CAAC,YAAY,CAAC;IAI/C,kBAAkB;IACZ,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAqC7B,kBAAkB;IACZ,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ/B,kBAAkB;IAClB,WAAW,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI;IAQ9D,OAAO,CAAC,gBAAgB;CAQ3B"}
|
|
@@ -0,0 +1,102 @@
|
|
|
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 { EventSequenceId } from '../eventSequences/EventSequenceId';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a unit of work that buffers events and commits them as transaction-like append operations.
|
|
6
|
+
*/
|
|
7
|
+
export class UnitOfWork {
|
|
8
|
+
correlationId;
|
|
9
|
+
_eventStore;
|
|
10
|
+
_events = [];
|
|
11
|
+
_appendResults = [];
|
|
12
|
+
_isCommitted = false;
|
|
13
|
+
_isRolledBack = false;
|
|
14
|
+
_onCompleted;
|
|
15
|
+
constructor(correlationId, onCompleted, _eventStore) {
|
|
16
|
+
this.correlationId = correlationId;
|
|
17
|
+
this._eventStore = _eventStore;
|
|
18
|
+
this._onCompleted = onCompleted;
|
|
19
|
+
}
|
|
20
|
+
/** @inheritdoc */
|
|
21
|
+
get isCompleted() {
|
|
22
|
+
return this._isCommitted || this._isRolledBack;
|
|
23
|
+
}
|
|
24
|
+
/** @inheritdoc */
|
|
25
|
+
get isSuccess() {
|
|
26
|
+
return this._appendResults.every(_ => _.isSuccess);
|
|
27
|
+
}
|
|
28
|
+
/** @inheritdoc */
|
|
29
|
+
addEvent(eventSequenceId, eventSourceId, event) {
|
|
30
|
+
this.throwIfCompleted();
|
|
31
|
+
this._events.push({
|
|
32
|
+
sequenceNumber: this._events.length,
|
|
33
|
+
eventSequenceId,
|
|
34
|
+
eventForEventSourceId: {
|
|
35
|
+
eventSourceId,
|
|
36
|
+
event
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/** @inheritdoc */
|
|
41
|
+
getEvents() {
|
|
42
|
+
return this._events.map(_ => _.eventForEventSourceId.event);
|
|
43
|
+
}
|
|
44
|
+
/** @inheritdoc */
|
|
45
|
+
getAppendResults() {
|
|
46
|
+
return this._appendResults;
|
|
47
|
+
}
|
|
48
|
+
/** @inheritdoc */
|
|
49
|
+
async commit() {
|
|
50
|
+
this.throwIfCompleted();
|
|
51
|
+
if (this._events.length > 0) {
|
|
52
|
+
const resultsBySequenceNumber = new Map();
|
|
53
|
+
const eventsByEventSequence = new Map();
|
|
54
|
+
for (const eventToAppend of this._events) {
|
|
55
|
+
const key = eventToAppend.eventSequenceId.value;
|
|
56
|
+
const events = eventsByEventSequence.get(key) ?? [];
|
|
57
|
+
events.push(eventToAppend);
|
|
58
|
+
eventsByEventSequence.set(key, events);
|
|
59
|
+
}
|
|
60
|
+
for (const [eventSequenceId, eventsForSequence] of eventsByEventSequence) {
|
|
61
|
+
const sequence = this._eventStore.getEventSequence(new EventSequenceId(eventSequenceId));
|
|
62
|
+
const appendResults = await sequence.appendMany(eventsForSequence.map(_ => _.eventForEventSourceId), { correlationId: this.correlationId });
|
|
63
|
+
appendResults.forEach((appendResult, index) => {
|
|
64
|
+
resultsBySequenceNumber.set(eventsForSequence[index].sequenceNumber, appendResult);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
this._appendResults = [...resultsBySequenceNumber.entries()]
|
|
68
|
+
.sort(([left], [right]) => left - right)
|
|
69
|
+
.map(([, appendResult]) => appendResult);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this._appendResults = [];
|
|
73
|
+
}
|
|
74
|
+
this._isCommitted = true;
|
|
75
|
+
this._onCompleted(this);
|
|
76
|
+
}
|
|
77
|
+
/** @inheritdoc */
|
|
78
|
+
async rollback() {
|
|
79
|
+
this.throwIfCompleted();
|
|
80
|
+
this._isRolledBack = true;
|
|
81
|
+
this._events = [];
|
|
82
|
+
this._appendResults = [];
|
|
83
|
+
this._onCompleted(this);
|
|
84
|
+
}
|
|
85
|
+
/** @inheritdoc */
|
|
86
|
+
onCompleted(callback) {
|
|
87
|
+
const previous = this._onCompleted;
|
|
88
|
+
this._onCompleted = unitOfWork => {
|
|
89
|
+
previous(unitOfWork);
|
|
90
|
+
callback(unitOfWork);
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
throwIfCompleted() {
|
|
94
|
+
if (this._isCommitted) {
|
|
95
|
+
throw new Error(`Unit of work ${this.correlationId} is already committed.`);
|
|
96
|
+
}
|
|
97
|
+
if (this._isRolledBack) {
|
|
98
|
+
throw new Error(`Unit of work ${this.correlationId} is already rolled back.`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=UnitOfWork.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnitOfWork.js","sourceRoot":"","sources":["../../transactions/UnitOfWork.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAKrG,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAUpE;;GAEG;AACH,MAAM,OAAO,UAAU;IAQN;IAEQ;IATb,OAAO,GAA8C,EAAE,CAAC;IACxD,cAAc,GAAmB,EAAE,CAAC;IACpC,YAAY,GAAG,KAAK,CAAC;IACrB,aAAa,GAAG,KAAK,CAAC;IACtB,YAAY,CAAoC;IAExD,YACa,aAAmB,EAC5B,WAA8C,EAC7B,WAAwB;QAFhC,kBAAa,GAAb,aAAa,CAAM;QAEX,gBAAW,GAAX,WAAW,CAAa;QAEzC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IACpC,CAAC;IAED,kBAAkB;IAClB,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,aAAa,CAAC;IACnD,CAAC;IAED,kBAAkB;IAClB,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;IAED,kBAAkB;IAClB,QAAQ,CAAC,eAAgC,EAAE,aAAqB,EAAE,KAAa;QAC3E,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACd,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YACnC,eAAe;YACf,qBAAqB,EAAE;gBACnB,aAAa;gBACb,KAAK;aACR;SACJ,CAAC,CAAC;IACP,CAAC;IAED,kBAAkB;IAClB,SAAS;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC;IAED,kBAAkB;IAClB,gBAAgB;QACZ,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,MAAM;QACR,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAExB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,uBAAuB,GAAG,IAAI,GAAG,EAAwB,CAAC;YAChE,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAqD,CAAC;YAE3F,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACvC,MAAM,GAAG,GAAG,aAAa,CAAC,eAAe,CAAC,KAAK,CAAC;gBAChD,MAAM,MAAM,GAAG,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;gBACpD,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;gBAC3B,qBAAqB,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAC3C,CAAC;YAED,KAAK,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC,IAAI,qBAAqB,EAAE,CAAC;gBACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,eAAe,CAAC,eAAe,CAAC,CAAC,CAAC;gBACzF,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,UAAU,CAC3C,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,EACnD,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CACxC,CAAC;gBAEF,aAAa,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;oBAC1C,uBAAuB,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;gBACvF,CAAC,CAAC,CAAC;YACP,CAAC;YAED,IAAI,CAAC,cAAc,GAAG,CAAC,GAAG,uBAAuB,CAAC,OAAO,EAAE,CAAC;iBACvD,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,KAAK,CAAC;iBACvC,GAAG,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC;QACjD,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,QAAQ;QACV,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,kBAAkB;IAClB,WAAW,CAAC,QAA2C;QACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,EAAE;YAC7B,QAAQ,CAAC,UAAU,CAAC,CAAC;YACrB,QAAQ,CAAC,UAAU,CAAC,CAAC;QACzB,CAAC,CAAC;IACN,CAAC;IAEO,gBAAgB;QACpB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,gBAAgB,IAAI,CAAC,aAAa,wBAAwB,CAAC,CAAC;QAChF,CAAC;QACD,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,gBAAgB,IAAI,CAAC,aAAa,0BAA0B,CAAC,CAAC;QAClF,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Guid } from '@cratis/fundamentals';
|
|
2
|
+
import { IEventStore } from '../IEventStore';
|
|
3
|
+
import { IUnitOfWork } from './IUnitOfWork';
|
|
4
|
+
import { IUnitOfWorkManager } from './IUnitOfWorkManager';
|
|
5
|
+
/**
|
|
6
|
+
* Implements {@link IUnitOfWorkManager} using {@link AsyncLocalStorage} for async-context scoping.
|
|
7
|
+
*/
|
|
8
|
+
export declare class UnitOfWorkManager implements IUnitOfWorkManager {
|
|
9
|
+
private readonly _eventStore;
|
|
10
|
+
private readonly _storage;
|
|
11
|
+
private readonly _unitsOfWork;
|
|
12
|
+
constructor(_eventStore: IEventStore);
|
|
13
|
+
/** @inheritdoc */
|
|
14
|
+
get current(): IUnitOfWork;
|
|
15
|
+
/** @inheritdoc */
|
|
16
|
+
get hasCurrent(): boolean;
|
|
17
|
+
/** @inheritdoc */
|
|
18
|
+
tryGetFor(correlationId: string | Guid): IUnitOfWork | undefined;
|
|
19
|
+
/** @inheritdoc */
|
|
20
|
+
begin(correlationId?: string | Guid): IUnitOfWork;
|
|
21
|
+
/** @inheritdoc */
|
|
22
|
+
setCurrent(unitOfWork: IUnitOfWork): void;
|
|
23
|
+
private unitOfWorkCompleted;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=UnitOfWorkManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnitOfWorkManager.d.ts","sourceRoot":"","sources":["../../transactions/UnitOfWorkManager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI1D;;GAEG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IAI5C,OAAO,CAAC,QAAQ,CAAC,WAAW;IAHxC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoD;IAC7E,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkC;gBAElC,WAAW,EAAE,WAAW;IAErD,kBAAkB;IAClB,IAAI,OAAO,IAAI,WAAW,CAMzB;IAED,kBAAkB;IAClB,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,kBAAkB;IAClB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,SAAS;IAKhE,kBAAkB;IAClB,KAAK,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW;IAUjD,kBAAkB;IAClB,UAAU,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI;IAazC,OAAO,CAAC,mBAAmB;CAI9B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { AsyncLocalStorage } from 'async_hooks';
|
|
4
|
+
import { Guid } from '@cratis/fundamentals';
|
|
5
|
+
import { NoUnitOfWorkHasBeenStarted } from './NoUnitOfWorkHasBeenStarted';
|
|
6
|
+
import { UnitOfWork } from './UnitOfWork';
|
|
7
|
+
/**
|
|
8
|
+
* Implements {@link IUnitOfWorkManager} using {@link AsyncLocalStorage} for async-context scoping.
|
|
9
|
+
*/
|
|
10
|
+
export class UnitOfWorkManager {
|
|
11
|
+
_eventStore;
|
|
12
|
+
_storage = new AsyncLocalStorage();
|
|
13
|
+
_unitsOfWork = new Map();
|
|
14
|
+
constructor(_eventStore) {
|
|
15
|
+
this._eventStore = _eventStore;
|
|
16
|
+
}
|
|
17
|
+
/** @inheritdoc */
|
|
18
|
+
get current() {
|
|
19
|
+
const current = this._storage.getStore();
|
|
20
|
+
if (current === undefined) {
|
|
21
|
+
throw new NoUnitOfWorkHasBeenStarted();
|
|
22
|
+
}
|
|
23
|
+
return current;
|
|
24
|
+
}
|
|
25
|
+
/** @inheritdoc */
|
|
26
|
+
get hasCurrent() {
|
|
27
|
+
return this._storage.getStore() !== undefined;
|
|
28
|
+
}
|
|
29
|
+
/** @inheritdoc */
|
|
30
|
+
tryGetFor(correlationId) {
|
|
31
|
+
const key = Guid.as(correlationId).toString();
|
|
32
|
+
return this._unitsOfWork.get(key);
|
|
33
|
+
}
|
|
34
|
+
/** @inheritdoc */
|
|
35
|
+
begin(correlationId) {
|
|
36
|
+
const unitOfWork = new UnitOfWork(correlationId === undefined ? Guid.create() : Guid.as(correlationId), this.unitOfWorkCompleted.bind(this), this._eventStore);
|
|
37
|
+
this.setCurrent(unitOfWork);
|
|
38
|
+
return unitOfWork;
|
|
39
|
+
}
|
|
40
|
+
/** @inheritdoc */
|
|
41
|
+
setCurrent(unitOfWork) {
|
|
42
|
+
const key = unitOfWork.correlationId.toString();
|
|
43
|
+
const existing = this._unitsOfWork.get(key);
|
|
44
|
+
if (existing === unitOfWork) {
|
|
45
|
+
this._storage.enterWith(unitOfWork);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this._storage.enterWith(unitOfWork);
|
|
49
|
+
this._unitsOfWork.set(key, unitOfWork);
|
|
50
|
+
unitOfWork.onCompleted(this.unitOfWorkCompleted.bind(this));
|
|
51
|
+
}
|
|
52
|
+
unitOfWorkCompleted(unitOfWork) {
|
|
53
|
+
this._unitsOfWork.delete(unitOfWork.correlationId.toString());
|
|
54
|
+
this._storage.enterWith(undefined);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=UnitOfWorkManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnitOfWorkManager.js","sourceRoot":"","sources":["../../transactions/UnitOfWorkManager.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAI5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAIG;IAHZ,QAAQ,GAAG,IAAI,iBAAiB,EAA2B,CAAC;IAC5D,YAAY,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE/D,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAEzD,kBAAkB;IAClB,IAAI,OAAO;QACP,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,0BAA0B,EAAE,CAAC;QAC3C,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,kBAAkB;IAClB,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,SAAS,CAAC;IAClD,CAAC;IAED,kBAAkB;IAClB,SAAS,CAAC,aAA4B;QAClC,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,aAA6B;QAC/B,MAAM,UAAU,GAAG,IAAI,UAAU,CAC7B,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,EACpE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EACnC,IAAI,CAAC,WAAW,CACnB,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC5B,OAAO,UAAU,CAAC;IACtB,CAAC;IAED,kBAAkB;IAClB,UAAU,CAAC,UAAuB;QAC9B,MAAM,GAAG,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;YAC1B,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACpC,OAAO;QACX,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QACvC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,mBAAmB,CAAC,UAAuB;QAC/C,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;CACJ"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { IUnitOfWork } from './IUnitOfWork';
|
|
2
|
+
export type { IUnitOfWorkManager } from './IUnitOfWorkManager';
|
|
3
|
+
export { NoUnitOfWorkHasBeenStarted } from './NoUnitOfWorkHasBeenStarted';
|
|
4
|
+
export { UnitOfWork } from './UnitOfWork';
|
|
5
|
+
export { UnitOfWorkManager } from './UnitOfWorkManager';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../transactions/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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 { NoUnitOfWorkHasBeenStarted } from './NoUnitOfWorkHasBeenStarted';
|
|
4
|
+
export { UnitOfWork } from './UnitOfWork';
|
|
5
|
+
export { UnitOfWorkManager } from './UnitOfWorkManager';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../transactions/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAIrG,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|