@shirudo/ddd-kit 3.0.0-rc.6 → 3.0.0-rc.7
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/dist/chunks/snapshot-store.d.ts +4 -2
- package/dist/index.d.ts +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -931,9 +931,11 @@ interface AggregateSnapshot<TState> {
|
|
|
931
931
|
* part of this surface. The application shell holds that authority.
|
|
932
932
|
*
|
|
933
933
|
* @template TId - The aggregate root identifier (branded via `Id<Tag>`)
|
|
934
|
-
* @template TEvent - The domain-event union
|
|
934
|
+
* @template TEvent - The domain-event union. Defaults to `AnyDomainEvent`,
|
|
935
|
+
* so a bound written as `Aggregate<TId>` admits every aggregate root,
|
|
936
|
+
* with or without events.
|
|
935
937
|
*/
|
|
936
|
-
interface Aggregate<TId extends Id<string>, TEvent extends AnyDomainEvent =
|
|
938
|
+
interface Aggregate<TId extends Id<string>, TEvent extends AnyDomainEvent = AnyDomainEvent> {
|
|
937
939
|
readonly id: TId;
|
|
938
940
|
readonly version: Version;
|
|
939
941
|
readonly pendingEvents: ReadonlyArray<PendingDomainEvent<TEvent>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1533,6 +1533,12 @@ interface RepositoryTracking<TAggregate extends Aggregate<Id<string>, AnyDomainE
|
|
|
1533
1533
|
* the exact moment at which the application registered its write intent.
|
|
1534
1534
|
* Adapters must use the expected/current version pair for their OCC predicate
|
|
1535
1535
|
* and must not read mutable write state back from an aggregate reference.
|
|
1536
|
+
*
|
|
1537
|
+
* The predicate itself is adapter code. The compare-and-set must run in the
|
|
1538
|
+
* store's own write statement. The kit does not know the store, so it cannot
|
|
1539
|
+
* write that statement. The kit owns the version pair and
|
|
1540
|
+
* {@link ConcurrencyConflictError}; the repository contract suite proves the
|
|
1541
|
+
* predicate.
|
|
1536
1542
|
*/
|
|
1537
1543
|
interface AggregatePersistenceWrite<TAggregate extends Aggregate<Id<string>, AnyDomainEvent>, TChangeSet> {
|
|
1538
1544
|
readonly intent: AggregateWriteIntent;
|
|
@@ -1731,7 +1737,12 @@ interface RunOptions {
|
|
|
1731
1737
|
declare const repositoryDefinitionBrand: unique symbol;
|
|
1732
1738
|
/** Adapter wiring accepted by {@link defineRepository}. */
|
|
1733
1739
|
interface RepositoryDefinitionOptions<TCtx, TRepositoryPort extends object, TAggregate extends Aggregate<Id<string>, AnyDomainEvent>, TBaseline, TChangeSet, TRemoval extends boolean = false> {
|
|
1734
|
-
/**
|
|
1740
|
+
/**
|
|
1741
|
+
* Concrete aggregate class used as the Identity Map key, and for nothing
|
|
1742
|
+
* else. The read adapter passes the same class to `identityMap.get`, so
|
|
1743
|
+
* the class is exported. Its protected constructor keeps `new` out of
|
|
1744
|
+
* reach; the static factories stay the only door.
|
|
1745
|
+
*/
|
|
1735
1746
|
readonly aggregate: AggregateClass<TAggregate>;
|
|
1736
1747
|
/** Adapter-owned projection, baseline, and change-set policy. */
|
|
1737
1748
|
readonly persistence: PersistenceModel<TAggregate, TBaseline, TChangeSet>;
|
|
@@ -4017,7 +4028,7 @@ declare class InMemoryEventStore<Evt extends AnyDomainEvent> implements EventSto
|
|
|
4017
4028
|
* @template TAggregate - Aggregate root loaded and registered by the port.
|
|
4018
4029
|
* @template TId - Branded aggregate identifier.
|
|
4019
4030
|
*/
|
|
4020
|
-
interface AggregatePersistence<TAggregate extends Aggregate<TId>, TId extends Id<string>> {
|
|
4031
|
+
interface AggregatePersistence<TAggregate extends Aggregate<TId, AnyDomainEvent>, TId extends Id<string>> {
|
|
4021
4032
|
/**
|
|
4022
4033
|
* Finds an aggregate by identity.
|
|
4023
4034
|
*
|
|
@@ -4066,7 +4077,7 @@ interface AggregatePersistence<TAggregate extends Aggregate<TId>, TId extends Id
|
|
|
4066
4077
|
* by an order command, while read-heavy access remains on a projection or query
|
|
4067
4078
|
* port.
|
|
4068
4079
|
*/
|
|
4069
|
-
interface Repository<TAggregate extends Aggregate<TId>, TId extends Id<string>> extends AggregatePersistence<TAggregate, TId> {
|
|
4080
|
+
interface Repository<TAggregate extends Aggregate<TId, AnyDomainEvent>, TId extends Id<string>> extends AggregatePersistence<TAggregate, TId> {
|
|
4070
4081
|
/**
|
|
4071
4082
|
* Registers a tracked aggregate for physical removal at commit.
|
|
4072
4083
|
*
|