@event-nest/core 4.0.2 → 5.0.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/README.md +249 -4
- package/package.json +2 -1
- package/src/index.d.ts +16 -0
- package/src/index.js +16 -0
- package/src/index.js.map +1 -1
- package/src/lib/aggregate-root/aggregate-root-config.d.ts +37 -0
- package/src/lib/aggregate-root/aggregate-root-config.js +25 -0
- package/src/lib/aggregate-root/aggregate-root-config.js.map +1 -0
- package/src/lib/aggregate-root/aggregate-root-name.d.ts +1 -1
- package/src/lib/aggregate-root/aggregate-root-name.js +1 -5
- package/src/lib/aggregate-root/aggregate-root-name.js.map +1 -1
- package/src/lib/aggregate-root/aggregate-root.d.ts +3 -5
- package/src/lib/aggregate-root/aggregate-root.js +10 -9
- package/src/lib/aggregate-root/aggregate-root.js.map +1 -1
- package/src/lib/aggregate-root/apply-event.decorator.d.ts +1 -1
- package/src/lib/aggregate-root/apply-event.decorator.js.map +1 -1
- package/src/lib/aggregate-root/reflection.d.ts +1 -1
- package/src/lib/aggregate-root/snapshot-aware.d.ts +47 -0
- package/src/lib/aggregate-root/snapshot-aware.js +52 -0
- package/src/lib/aggregate-root/snapshot-aware.js.map +1 -0
- package/src/lib/domain-event-registrations.d.ts +1 -1
- package/src/lib/domain-event-registrations.js.map +1 -1
- package/src/lib/domain-event-subscription.d.ts +1 -1
- package/src/lib/domain-event-subscription.js.map +1 -1
- package/src/lib/exceptions/aggregate-class-not-snapshot-aware-exception.d.ts +6 -0
- package/src/lib/exceptions/aggregate-class-not-snapshot-aware-exception.js +13 -0
- package/src/lib/exceptions/aggregate-class-not-snapshot-aware-exception.js.map +1 -0
- package/src/lib/exceptions/aggregate-instance-not-snapshot-aware-exception.d.ts +6 -0
- package/src/lib/exceptions/aggregate-instance-not-snapshot-aware-exception.js +13 -0
- package/src/lib/exceptions/aggregate-instance-not-snapshot-aware-exception.js.map +1 -0
- package/src/lib/exceptions/snapshot-revision-mismatch-exception.d.ts +6 -0
- package/src/lib/exceptions/snapshot-revision-mismatch-exception.js +14 -0
- package/src/lib/exceptions/snapshot-revision-mismatch-exception.js.map +1 -0
- package/src/lib/metadata-keys.d.ts +1 -0
- package/src/lib/metadata-keys.js +2 -1
- package/src/lib/metadata-keys.js.map +1 -1
- package/src/lib/snapshot-strategy/all-of-snapshot-strategy.d.ts +29 -0
- package/src/lib/snapshot-strategy/all-of-snapshot-strategy.js +40 -0
- package/src/lib/snapshot-strategy/all-of-snapshot-strategy.js.map +1 -0
- package/src/lib/snapshot-strategy/any-of-snapshot-strategy.d.ts +30 -0
- package/src/lib/snapshot-strategy/any-of-snapshot-strategy.js +41 -0
- package/src/lib/snapshot-strategy/any-of-snapshot-strategy.js.map +1 -0
- package/src/lib/snapshot-strategy/for-aggregate-roots-strategy.d.ts +30 -0
- package/src/lib/snapshot-strategy/for-aggregate-roots-strategy.js +51 -0
- package/src/lib/snapshot-strategy/for-aggregate-roots-strategy.js.map +1 -0
- package/src/lib/snapshot-strategy/for-count-snapshot-strategy.d.ts +28 -0
- package/src/lib/snapshot-strategy/for-count-snapshot-strategy.js +41 -0
- package/src/lib/snapshot-strategy/for-count-snapshot-strategy.js.map +1 -0
- package/src/lib/snapshot-strategy/for-events-snapshot-strategy.d.ts +33 -0
- package/src/lib/snapshot-strategy/for-events-snapshot-strategy.js +37 -0
- package/src/lib/snapshot-strategy/for-events-snapshot-strategy.js.map +1 -0
- package/src/lib/snapshot-strategy/no-snapshot-strategy.d.ts +18 -0
- package/src/lib/snapshot-strategy/no-snapshot-strategy.js +25 -0
- package/src/lib/snapshot-strategy/no-snapshot-strategy.js.map +1 -0
- package/src/lib/snapshot-strategy/snapshot-strategy.d.ts +26 -0
- package/src/lib/snapshot-strategy/snapshot-strategy.js +20 -0
- package/src/lib/snapshot-strategy/snapshot-strategy.js.map +1 -0
- package/src/lib/storage/abstract-event-store.d.ts +8 -2
- package/src/lib/storage/abstract-event-store.js +8 -3
- package/src/lib/storage/abstract-event-store.js.map +1 -1
- package/src/lib/storage/event-store.d.ts +29 -0
- package/src/lib/storage/event-store.js.map +1 -1
- package/src/lib/storage/snapshot/abstract-snapshot-store.d.ts +14 -0
- package/src/lib/storage/snapshot/abstract-snapshot-store.js +26 -0
- package/src/lib/storage/snapshot/abstract-snapshot-store.js.map +1 -0
- package/src/lib/storage/snapshot/no-op-snapshot-store.d.ts +11 -0
- package/src/lib/storage/snapshot/no-op-snapshot-store.js +25 -0
- package/src/lib/storage/snapshot/no-op-snapshot-store.js.map +1 -0
- package/src/lib/storage/snapshot/snapshot-store.d.ts +38 -0
- package/src/lib/storage/snapshot/snapshot-store.js +5 -0
- package/src/lib/storage/snapshot/snapshot-store.js.map +1 -0
- package/src/lib/storage/snapshot/stored-snapshot.d.ts +17 -0
- package/src/lib/storage/snapshot/stored-snapshot.js +36 -0
- package/src/lib/storage/snapshot/stored-snapshot.js.map +1 -0
- package/src/lib/storage/stored-event.d.ts +1 -1
- package/src/lib/storage/stored-event.js.map +1 -1
- package/src/lib/utils/type-utils.d.ts +4 -0
- package/src/lib/utils/type-utils.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"for-events-snapshot-strategy.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/snapshot-strategy/for-events-snapshot-strategy.ts"],"names":[],"mappings":";;;AAEA,2DAAuD;AAMvD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,yBAA0B,SAAQ,oCAAgB;IAC3D,YAA6B,MAAuC;QAChE,KAAK,EAAE,CAAC;QADiB,WAAM,GAAN,MAAM,CAAiC;IAEpE,CAAC;IAED,oBAAoB,CAAC,aAA4B;QAC7C,OAAO,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CACnD,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,YAAY,MAAM,CAAC,CAC9E,CAAC;IACN,CAAC;CACJ;AAVD,8DAUC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SnapshotStrategy } from "./snapshot-strategy";
|
|
2
|
+
/**
|
|
3
|
+
* The default snapshot strategy used by the event-nest module when no snapshot strategy
|
|
4
|
+
* is explicitly configured. This strategy never creates snapshots, regardless of the
|
|
5
|
+
* aggregate root's state or events.
|
|
6
|
+
*
|
|
7
|
+
* If you want to enable snapshot creation, you should choose one of the other available
|
|
8
|
+
* snapshot strategies or build your own.
|
|
9
|
+
* Built-in strategies:
|
|
10
|
+
* - {@link ForCountSnapshotStrategy} - Create snapshots based on event count
|
|
11
|
+
* - {@link ForAggregateRootsStrategy} - Create snapshots for specific aggregate types
|
|
12
|
+
* - {@link ForEventsSnapshotStrategy} - Create snapshots when specific events occur
|
|
13
|
+
* - {@link AllOfSnapshotStrategy} - Combine multiple strategies with AND logic
|
|
14
|
+
* - {@link AnyOfSnapshotStrategy} - Combine multiple strategies with OR logic
|
|
15
|
+
*/
|
|
16
|
+
export declare class NoSnapshotStrategy extends SnapshotStrategy {
|
|
17
|
+
shouldCreateSnapshot(): boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoSnapshotStrategy = void 0;
|
|
4
|
+
const snapshot_strategy_1 = require("./snapshot-strategy");
|
|
5
|
+
/**
|
|
6
|
+
* The default snapshot strategy used by the event-nest module when no snapshot strategy
|
|
7
|
+
* is explicitly configured. This strategy never creates snapshots, regardless of the
|
|
8
|
+
* aggregate root's state or events.
|
|
9
|
+
*
|
|
10
|
+
* If you want to enable snapshot creation, you should choose one of the other available
|
|
11
|
+
* snapshot strategies or build your own.
|
|
12
|
+
* Built-in strategies:
|
|
13
|
+
* - {@link ForCountSnapshotStrategy} - Create snapshots based on event count
|
|
14
|
+
* - {@link ForAggregateRootsStrategy} - Create snapshots for specific aggregate types
|
|
15
|
+
* - {@link ForEventsSnapshotStrategy} - Create snapshots when specific events occur
|
|
16
|
+
* - {@link AllOfSnapshotStrategy} - Combine multiple strategies with AND logic
|
|
17
|
+
* - {@link AnyOfSnapshotStrategy} - Combine multiple strategies with OR logic
|
|
18
|
+
*/
|
|
19
|
+
class NoSnapshotStrategy extends snapshot_strategy_1.SnapshotStrategy {
|
|
20
|
+
shouldCreateSnapshot() {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.NoSnapshotStrategy = NoSnapshotStrategy;
|
|
25
|
+
//# sourceMappingURL=no-snapshot-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-snapshot-strategy.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/snapshot-strategy/no-snapshot-strategy.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AAEvD;;;;;;;;;;;;;GAaG;AACH,MAAa,kBAAmB,SAAQ,oCAAgB;IACpD,oBAAoB;QAChB,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAJD,gDAIC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AggregateRoot } from "../aggregate-root/aggregate-root";
|
|
2
|
+
/**
|
|
3
|
+
* Abstract base class for snapshot strategies. Snapshot strategies determine when snapshots
|
|
4
|
+
* should be created for aggregate roots.
|
|
5
|
+
*
|
|
6
|
+
* You can extend this class to create custom snapshot strategies that implement your own
|
|
7
|
+
* logic for determining when snapshots should be created. The built-in strategies include:
|
|
8
|
+
* - {@link NoSnapshotStrategy} - Never creates snapshots (default)
|
|
9
|
+
* - {@link ForCountSnapshotStrategy} - Creates snapshots based on event count
|
|
10
|
+
* - {@link ForAggregateRootsStrategy} - Creates snapshots for specific aggregate types
|
|
11
|
+
* - {@link ForEventsSnapshotStrategy} - Creates snapshots when specific events occur
|
|
12
|
+
* - {@link AllOfSnapshotStrategy} - Combines multiple strategies with AND logic
|
|
13
|
+
* - {@link AnyOfSnapshotStrategy} - Combines multiple strategies with OR logic
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class SnapshotStrategy {
|
|
16
|
+
/**
|
|
17
|
+
* Determines whether a snapshot should be created for the given aggregate root.
|
|
18
|
+
* This method is called before committing events to decide if a snapshot should be
|
|
19
|
+
* created at that point.
|
|
20
|
+
*
|
|
21
|
+
* @param aggregateRoot The aggregate root to evaluate
|
|
22
|
+
* @returns true if a snapshot should be created, false otherwise. Can return a Promise
|
|
23
|
+
* for asynchronous evaluation.
|
|
24
|
+
*/
|
|
25
|
+
abstract shouldCreateSnapshot(aggregateRoot: AggregateRoot): boolean | Promise<boolean>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SnapshotStrategy = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Abstract base class for snapshot strategies. Snapshot strategies determine when snapshots
|
|
6
|
+
* should be created for aggregate roots.
|
|
7
|
+
*
|
|
8
|
+
* You can extend this class to create custom snapshot strategies that implement your own
|
|
9
|
+
* logic for determining when snapshots should be created. The built-in strategies include:
|
|
10
|
+
* - {@link NoSnapshotStrategy} - Never creates snapshots (default)
|
|
11
|
+
* - {@link ForCountSnapshotStrategy} - Creates snapshots based on event count
|
|
12
|
+
* - {@link ForAggregateRootsStrategy} - Creates snapshots for specific aggregate types
|
|
13
|
+
* - {@link ForEventsSnapshotStrategy} - Creates snapshots when specific events occur
|
|
14
|
+
* - {@link AllOfSnapshotStrategy} - Combines multiple strategies with AND logic
|
|
15
|
+
* - {@link AnyOfSnapshotStrategy} - Combines multiple strategies with OR logic
|
|
16
|
+
*/
|
|
17
|
+
class SnapshotStrategy {
|
|
18
|
+
}
|
|
19
|
+
exports.SnapshotStrategy = SnapshotStrategy;
|
|
20
|
+
//# sourceMappingURL=snapshot-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-strategy.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/snapshot-strategy/snapshot-strategy.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;GAYG;AACH,MAAsB,gBAAgB;CAWrC;AAXD,4CAWC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AggregateRoot } from "../aggregate-root/aggregate-root";
|
|
2
2
|
import { DomainEventEmitter } from "../domain-event-emitter";
|
|
3
|
-
import { AggregateRootClass, EventStore } from "./event-store";
|
|
3
|
+
import { AggregateRootClass, AggregateRootSnapshot, EventStore } from "./event-store";
|
|
4
|
+
import { AbstractSnapshotStore } from "./snapshot/abstract-snapshot-store";
|
|
4
5
|
import { StoredAggregateRoot } from "./stored-aggregate-root";
|
|
5
6
|
import { StoredEvent } from "./stored-event";
|
|
6
7
|
/**
|
|
@@ -10,11 +11,16 @@ import { StoredEvent } from "./stored-event";
|
|
|
10
11
|
*/
|
|
11
12
|
export declare abstract class AbstractEventStore implements EventStore {
|
|
12
13
|
private _eventEmitter;
|
|
13
|
-
protected
|
|
14
|
+
protected _snapshotStore: AbstractSnapshotStore;
|
|
15
|
+
protected constructor(_eventEmitter: DomainEventEmitter, _snapshotStore: AbstractSnapshotStore);
|
|
14
16
|
addPublisher<T extends AggregateRoot>(aggregateRoot: T): T;
|
|
15
17
|
abstract findAggregateRootVersion(id: string): Promise<number>;
|
|
16
18
|
abstract findByAggregateRootId<T extends AggregateRoot>(aggregateRootClass: AggregateRootClass<T>, id: string): Promise<Array<StoredEvent>>;
|
|
17
19
|
abstract findByAggregateRootIds<T extends AggregateRoot>(aggregateRootClass: AggregateRootClass<T>, ids: string[]): Promise<Record<string, Array<StoredEvent>>>;
|
|
20
|
+
abstract findWithSnapshot<T extends AggregateRoot>(aggregateRootClass: AggregateRootClass<T>, id: string): Promise<{
|
|
21
|
+
events: Array<StoredEvent>;
|
|
22
|
+
snapshot?: AggregateRootSnapshot<T>;
|
|
23
|
+
}>;
|
|
18
24
|
abstract generateEntityId(): Promise<string>;
|
|
19
25
|
abstract save(events: Array<StoredEvent>, aggregate: StoredAggregateRoot): Promise<Array<StoredEvent>>;
|
|
20
26
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AbstractEventStore = void 0;
|
|
4
4
|
const es_toolkit_1 = require("es-toolkit");
|
|
5
|
-
const
|
|
5
|
+
const aggregate_root_config_1 = require("../aggregate-root/aggregate-root-config");
|
|
6
6
|
const id_generation_exception_1 = require("../exceptions/id-generation-exception");
|
|
7
7
|
const missing_aggregate_root_name_exception_1 = require("../exceptions/missing-aggregate-root-name-exception");
|
|
8
8
|
const unknown_event_version_exception_1 = require("../exceptions/unknown-event-version-exception");
|
|
@@ -15,12 +15,13 @@ const stored_event_1 = require("./stored-event");
|
|
|
15
15
|
* of the {@link EventStore:addPublisher} method and this is why this class exists.
|
|
16
16
|
*/
|
|
17
17
|
class AbstractEventStore {
|
|
18
|
-
constructor(_eventEmitter) {
|
|
18
|
+
constructor(_eventEmitter, _snapshotStore) {
|
|
19
19
|
this._eventEmitter = _eventEmitter;
|
|
20
|
+
this._snapshotStore = _snapshotStore;
|
|
20
21
|
}
|
|
21
22
|
addPublisher(aggregateRoot) {
|
|
22
23
|
aggregateRoot.publish = async (events) => {
|
|
23
|
-
const aggregateRootName = (0,
|
|
24
|
+
const aggregateRootName = (0, aggregate_root_config_1.getAggregateRootName)(aggregateRoot.constructor);
|
|
24
25
|
if ((0, es_toolkit_1.isNil)(aggregateRootName)) {
|
|
25
26
|
throw new missing_aggregate_root_name_exception_1.MissingAggregateRootNameException(aggregateRoot.constructor.name);
|
|
26
27
|
}
|
|
@@ -31,6 +32,7 @@ class AbstractEventStore {
|
|
|
31
32
|
if (ids.length !== events.length || !(0, type_utils_1.hasAllValues)(ids)) {
|
|
32
33
|
throw new id_generation_exception_1.IdGenerationException(ids.length, events.length);
|
|
33
34
|
}
|
|
35
|
+
const shouldCreateSnapshot = this._snapshotStore.shouldCreateSnapshot(aggregateRoot);
|
|
34
36
|
const published = [];
|
|
35
37
|
const storedEvents = [];
|
|
36
38
|
for (const event of events) {
|
|
@@ -44,6 +46,9 @@ class AbstractEventStore {
|
|
|
44
46
|
}
|
|
45
47
|
const toStore = new stored_aggregate_root_1.StoredAggregateRoot(aggregateRoot.id, aggregateRoot.version);
|
|
46
48
|
const saved = await this.save(storedEvents, toStore);
|
|
49
|
+
if (shouldCreateSnapshot) {
|
|
50
|
+
await this._snapshotStore.create(aggregateRoot);
|
|
51
|
+
}
|
|
47
52
|
for (const publishedEvent of published) {
|
|
48
53
|
const found = saved.find((s) => s.id === publishedEvent.eventId);
|
|
49
54
|
if ((0, es_toolkit_1.isNil)(found)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-event-store.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/abstract-event-store.ts"],"names":[],"mappings":";;;AAAA,2CAAmC;
|
|
1
|
+
{"version":3,"file":"abstract-event-store.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/abstract-event-store.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { AggregateRoot } from "../aggregate-root/aggregate-root";
|
|
2
|
+
import { SnapshotAware } from "../aggregate-root/snapshot-aware";
|
|
2
3
|
import { StoredAggregateRoot } from "./stored-aggregate-root";
|
|
3
4
|
import { StoredEvent } from "./stored-event";
|
|
4
5
|
export type AggregateRootClass<T> = Function & {
|
|
5
6
|
prototype: T;
|
|
6
7
|
};
|
|
8
|
+
export type AggregateRootSnapshot<T extends AggregateRoot = AggregateRoot> = T extends SnapshotAware<infer Snapshot> ? Snapshot : unknown;
|
|
9
|
+
/**
|
|
10
|
+
* Branded type to confirm that AggregateRoot instance correctly implements the SnapshotAware and AggregateRootClass has snapshotRevision attached.
|
|
11
|
+
* Should be created with caution @see {assertAggregateRootSnapshotAware}
|
|
12
|
+
*/
|
|
13
|
+
export type SnapshotAwareAggregateRoot<T extends AggregateRoot = AggregateRoot> = SnapshotAware<unknown> & T & {
|
|
14
|
+
readonly __snapshotAwareAggregateRootSymbol: unique symbol;
|
|
15
|
+
constructor: AggregateRootClass<SnapshotAwareAggregateRoot<T>>;
|
|
16
|
+
};
|
|
7
17
|
/**
|
|
8
18
|
* A unique symbol that can be used to inject the event store into other classes.
|
|
9
19
|
*/
|
|
@@ -44,6 +54,25 @@ export interface EventStore {
|
|
|
44
54
|
* @returns A map where the key is the aggregate root id and the value is an array of events that are associated with that id
|
|
45
55
|
*/
|
|
46
56
|
findByAggregateRootIds<T extends AggregateRoot>(aggregateRootClass: AggregateRootClass<T>, ids: string[]): Promise<Record<string, Array<StoredEvent>>>;
|
|
57
|
+
/**
|
|
58
|
+
* Finds a snapshot and all events that occurred after that snapshot for the specified aggregate root.
|
|
59
|
+
* This method retrieves the most recent stored snapshot (obtained from the aggregate's `.toSnapshot()` method)
|
|
60
|
+
* and returns it along with all events that were stored after the snapshot was written to the database.
|
|
61
|
+
*
|
|
62
|
+
* @param aggregateRootClass The snapshot-aware aggregate root class.
|
|
63
|
+
* @param id The unique id of the aggregate root object
|
|
64
|
+
* @returns An object containing:
|
|
65
|
+
* - `snapshot` (optional): the snapshot of the aggregate, if found
|
|
66
|
+
* - `events`: an array of events that occurred after the snapshot;
|
|
67
|
+
* if `snapshot` is undefined, this array contains **all events associated with the aggregate root**
|
|
68
|
+
* @throws {SnapshotRevisionMismatchException} If the current snapshotRevision does not match the snapshot revision in the stored snapshot record
|
|
69
|
+
* @throws {AggregateClassNotSnapshotAwareException} If the aggregate root class is missing the snapshot revision configuration
|
|
70
|
+
* @throws {MissingAggregateRootNameException} If the aggregate root name is missing
|
|
71
|
+
*/
|
|
72
|
+
findWithSnapshot<T extends AggregateRoot>(aggregateRootClass: AggregateRootClass<T>, id: string): Promise<{
|
|
73
|
+
events: Array<StoredEvent>;
|
|
74
|
+
snapshot?: AggregateRootSnapshot<T>;
|
|
75
|
+
}>;
|
|
47
76
|
/**
|
|
48
77
|
* Each storage solution has its own way of dealing with unique ids. This method's implementation should reflect
|
|
49
78
|
* the way the storage solution generates unique ids. For example, in a MongoDB database this would usually return
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-store.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/event-store.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"event-store.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/event-store.ts"],"names":[],"mappings":";;;AAqBA;;GAEG;AACU,QAAA,WAAW,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AggregateRoot } from "../../aggregate-root/aggregate-root";
|
|
2
|
+
import { SnapshotStrategy } from "../../snapshot-strategy/snapshot-strategy";
|
|
3
|
+
import { SnapshotAwareAggregateRoot } from "../event-store";
|
|
4
|
+
import { SnapshotStore } from "./snapshot-store";
|
|
5
|
+
import { StoredSnapshot } from "./stored-snapshot";
|
|
6
|
+
export declare abstract class AbstractSnapshotStore implements SnapshotStore {
|
|
7
|
+
private readonly snapshotStrategy;
|
|
8
|
+
constructor(snapshotStrategy: SnapshotStrategy);
|
|
9
|
+
create(aggregateRoot: SnapshotAwareAggregateRoot): Promise<StoredSnapshot | undefined>;
|
|
10
|
+
abstract findLatestSnapshotByAggregateId(id: string): Promise<StoredSnapshot | undefined>;
|
|
11
|
+
abstract generateEntityId(): Promise<string>;
|
|
12
|
+
abstract save(snapshot: StoredSnapshot): Promise<StoredSnapshot | undefined>;
|
|
13
|
+
shouldCreateSnapshot(aggregateRoot: AggregateRoot): aggregateRoot is SnapshotAwareAggregateRoot;
|
|
14
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AbstractSnapshotStore = void 0;
|
|
4
|
+
const aggregate_root_config_1 = require("../../aggregate-root/aggregate-root-config");
|
|
5
|
+
const snapshot_aware_1 = require("../../aggregate-root/snapshot-aware");
|
|
6
|
+
const stored_snapshot_1 = require("./stored-snapshot");
|
|
7
|
+
class AbstractSnapshotStore {
|
|
8
|
+
constructor(snapshotStrategy) {
|
|
9
|
+
this.snapshotStrategy = snapshotStrategy;
|
|
10
|
+
}
|
|
11
|
+
async create(aggregateRoot) {
|
|
12
|
+
const snapshotRevision = (0, aggregate_root_config_1.getAggregateRootSnapshotRevision)(aggregateRoot.constructor);
|
|
13
|
+
const snapshot = stored_snapshot_1.StoredSnapshot.create(await this.generateEntityId(), aggregateRoot.version, snapshotRevision, await aggregateRoot.toSnapshot(), aggregateRoot.id);
|
|
14
|
+
const saved = await this.save(snapshot);
|
|
15
|
+
return saved;
|
|
16
|
+
}
|
|
17
|
+
shouldCreateSnapshot(aggregateRoot) {
|
|
18
|
+
if (!this.snapshotStrategy.shouldCreateSnapshot(aggregateRoot)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
(0, snapshot_aware_1.assertIsSnapshotAwareAggregateRoot)(aggregateRoot);
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.AbstractSnapshotStore = AbstractSnapshotStore;
|
|
26
|
+
//# sourceMappingURL=abstract-snapshot-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-snapshot-store.js","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/storage/snapshot/abstract-snapshot-store.ts"],"names":[],"mappings":";;;AACA,sFAA8F;AAC9F,wEAAyF;AAIzF,uDAAmD;AAEnD,MAAsB,qBAAqB;IACvC,YAA6B,gBAAkC;QAAlC,qBAAgB,GAAhB,gBAAgB,CAAkB;IAAG,CAAC;IAEnE,KAAK,CAAC,MAAM,CAAC,aAAyC;QAClD,MAAM,gBAAgB,GAAG,IAAA,wDAAgC,EAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QAErF,MAAM,QAAQ,GAAG,gCAAc,CAAC,MAAM,CAClC,MAAM,IAAI,CAAC,gBAAgB,EAAE,EAC7B,aAAa,CAAC,OAAO,EACrB,gBAAgB,EAChB,MAAM,aAAa,CAAC,UAAU,EAAE,EAChC,aAAa,CAAC,EAAE,CACnB,CAAC;QAEF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,KAAK,CAAC;IACjB,CAAC;IAOD,oBAAoB,CAAC,aAA4B;QAC7C,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,aAAa,CAAC,EAAE,CAAC;YAC7D,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,IAAA,mDAAkC,EAAC,aAAa,CAAC,CAAC;QAElD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAjCD,sDAiCC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractSnapshotStore } from "./abstract-snapshot-store";
|
|
2
|
+
/**
|
|
3
|
+
* This is a no-operation implementation of the snapshot store. It effectively disables snapshot functionality
|
|
4
|
+
* by providing methods that do not perform any actions or return any meaningful data.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NoOpSnapshotStore extends AbstractSnapshotStore {
|
|
7
|
+
constructor();
|
|
8
|
+
findLatestSnapshotByAggregateId(): Promise<undefined>;
|
|
9
|
+
generateEntityId(): Promise<string>;
|
|
10
|
+
save(): Promise<undefined>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoOpSnapshotStore = void 0;
|
|
4
|
+
const no_snapshot_strategy_1 = require("../../snapshot-strategy/no-snapshot-strategy");
|
|
5
|
+
const abstract_snapshot_store_1 = require("./abstract-snapshot-store");
|
|
6
|
+
/**
|
|
7
|
+
* This is a no-operation implementation of the snapshot store. It effectively disables snapshot functionality
|
|
8
|
+
* by providing methods that do not perform any actions or return any meaningful data.
|
|
9
|
+
*/
|
|
10
|
+
class NoOpSnapshotStore extends abstract_snapshot_store_1.AbstractSnapshotStore {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(new no_snapshot_strategy_1.NoSnapshotStrategy());
|
|
13
|
+
}
|
|
14
|
+
findLatestSnapshotByAggregateId() {
|
|
15
|
+
return Promise.resolve(void 0);
|
|
16
|
+
}
|
|
17
|
+
generateEntityId() {
|
|
18
|
+
return Promise.resolve("");
|
|
19
|
+
}
|
|
20
|
+
save() {
|
|
21
|
+
return Promise.resolve(void 0);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.NoOpSnapshotStore = NoOpSnapshotStore;
|
|
25
|
+
//# sourceMappingURL=no-op-snapshot-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-op-snapshot-store.js","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/storage/snapshot/no-op-snapshot-store.ts"],"names":[],"mappings":";;;AAAA,uFAAkF;AAClF,uEAAkE;AAElE;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,+CAAqB;IACxD;QACI,KAAK,CAAC,IAAI,yCAAkB,EAAE,CAAC,CAAC;IACpC,CAAC;IAEQ,+BAA+B;QACpC,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACnC,CAAC;IAEQ,gBAAgB;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAEQ,IAAI;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACnC,CAAC;CACJ;AAhBD,8CAgBC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AggregateRoot } from "../../aggregate-root/aggregate-root";
|
|
2
|
+
import { SnapshotAwareAggregateRoot } from "../event-store";
|
|
3
|
+
import { StoredSnapshot } from "./stored-snapshot";
|
|
4
|
+
export declare const SNAPSHOT_STORE: unique symbol;
|
|
5
|
+
export interface SnapshotStore {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a snapshot for the given aggregate root
|
|
8
|
+
* Accepts a SnapshotAwareAggregateRoot, meaning the snapshot-awareness check should already be done.
|
|
9
|
+
* @param aggregateRoot The aggregate root instance to create a snapshot for
|
|
10
|
+
* @returns Promise that resolves to the saved snapshot, or undefined if the save operation did not complete
|
|
11
|
+
*/
|
|
12
|
+
create(aggregateRoot: SnapshotAwareAggregateRoot): Promise<StoredSnapshot | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Finds the most recent snapshot for a given aggregate root by its ID.
|
|
15
|
+
* @param id The unique identifier of the aggregate root
|
|
16
|
+
* @returns Promise that resolves to the latest stored snapshot, or undefined if no snapshot exists
|
|
17
|
+
*/
|
|
18
|
+
findLatestSnapshotByAggregateId(id: string): Promise<StoredSnapshot | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* Each storage solution has its own way of dealing with unique ids. This method's implementation should reflect
|
|
21
|
+
* the way the storage solution generates unique ids. For example, in a MongoDB database this would usually return
|
|
22
|
+
* a String representation of a MongoDB ObjectId.
|
|
23
|
+
*/
|
|
24
|
+
generateEntityId(): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Saves a snapshot to the storage
|
|
27
|
+
* @param snapshot The snapshot to be saved
|
|
28
|
+
* @returns Promise that resolves to the saved snapshot, or undefined if the save operation did not complete
|
|
29
|
+
*/
|
|
30
|
+
save(snapshot: StoredSnapshot): Promise<StoredSnapshot | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* Asserts the snapshot should be created for an aggregate.
|
|
33
|
+
* The result assersion is used for .create() method of SnapshotStore
|
|
34
|
+
* @throws If the strategy matches, but the aggregate is not snapshot aware, an error will be thrown.
|
|
35
|
+
* @param aggregate The aggregate root instance to potentially create a snapshot for
|
|
36
|
+
*/
|
|
37
|
+
shouldCreateSnapshot(aggregate: AggregateRoot): aggregate is SnapshotAwareAggregateRoot;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot-store.js","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/storage/snapshot/snapshot-store.ts"],"names":[],"mappings":";;;AAIa,QAAA,cAAc,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a snapshot of an aggregate root's state at a specific point in time.
|
|
3
|
+
*/
|
|
4
|
+
export declare class StoredSnapshot<T = unknown> {
|
|
5
|
+
private _aggregateRootId;
|
|
6
|
+
private _aggregateRootVersion;
|
|
7
|
+
private readonly _id;
|
|
8
|
+
private _payload;
|
|
9
|
+
private _revision;
|
|
10
|
+
private constructor();
|
|
11
|
+
static create<T>(id: string, aggregateRootVersion: number, revision: number, payload: T, aggregateRootId: string): StoredSnapshot<T>;
|
|
12
|
+
get aggregateRootId(): string;
|
|
13
|
+
get aggregateRootVersion(): number;
|
|
14
|
+
get id(): string;
|
|
15
|
+
get payload(): T;
|
|
16
|
+
get revision(): number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StoredSnapshot = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Represents a snapshot of an aggregate root's state at a specific point in time.
|
|
6
|
+
*/
|
|
7
|
+
class StoredSnapshot {
|
|
8
|
+
constructor(id) {
|
|
9
|
+
this._id = id;
|
|
10
|
+
}
|
|
11
|
+
static create(id, aggregateRootVersion, revision, payload, aggregateRootId) {
|
|
12
|
+
const snapshot = new StoredSnapshot(id);
|
|
13
|
+
snapshot._aggregateRootVersion = aggregateRootVersion;
|
|
14
|
+
snapshot._payload = payload;
|
|
15
|
+
snapshot._revision = revision;
|
|
16
|
+
snapshot._aggregateRootId = aggregateRootId;
|
|
17
|
+
return snapshot;
|
|
18
|
+
}
|
|
19
|
+
get aggregateRootId() {
|
|
20
|
+
return this._aggregateRootId;
|
|
21
|
+
}
|
|
22
|
+
get aggregateRootVersion() {
|
|
23
|
+
return this._aggregateRootVersion;
|
|
24
|
+
}
|
|
25
|
+
get id() {
|
|
26
|
+
return this._id;
|
|
27
|
+
}
|
|
28
|
+
get payload() {
|
|
29
|
+
return this._payload;
|
|
30
|
+
}
|
|
31
|
+
get revision() {
|
|
32
|
+
return this._revision;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.StoredSnapshot = StoredSnapshot;
|
|
36
|
+
//# sourceMappingURL=stored-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stored-snapshot.js","sourceRoot":"","sources":["../../../../../../../libs/core/src/lib/storage/snapshot/stored-snapshot.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,cAAc;IAOvB,YAAoB,EAAU;QAC1B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,MAAM,CACT,EAAU,EACV,oBAA4B,EAC5B,QAAgB,EAChB,OAAU,EACV,eAAuB;QAEvB,MAAM,QAAQ,GAAsB,IAAI,cAAc,CAAC,EAAE,CAAC,CAAC;QAC3D,QAAQ,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;QACtD,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC5B,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,QAAQ,CAAC,gBAAgB,GAAG,eAAe,CAAC;QAE5C,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,IAAI,eAAe;QACf,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,IAAI,oBAAoB;QACpB,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACtC,CAAC;IAED,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;CACJ;AA9CD,wCA8CC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Class } from "type-
|
|
1
|
+
import { Class } from "../utils/type-utils";
|
|
2
2
|
/**
|
|
3
3
|
* Represents an event that will be persisted according to the storage solution that is used.
|
|
4
4
|
* The event is defined by metadata like aggregate root id, version and creation date, and it also includes its payload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stored-event.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/stored-event.ts"],"names":[],"mappings":";;;AAAA,yDAAkE;AAClE,2CAAmC;
|
|
1
|
+
{"version":3,"file":"stored-event.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/stored-event.ts"],"names":[],"mappings":";;;AAAA,yDAAkE;AAClE,2CAAmC;AAEnC,8EAA6D;AAG7D;;;;;;;;;GASG;AACH,MAAa,WAAW;IAUpB,YAAoB,EAAU,EAAE,eAAuB;QACnD,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;IAClB,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,kBAAkB,CACrB,EAAU,EACV,eAAuB,EACvB,iBAAyB,EACzB,OAAe,EACf,UAAgB;QAEhB,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;QACtD,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;QACjC,QAAQ,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;QAEhD,MAAM,SAAS,GAAG,IAAA,yCAAY,EAAC,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,IAAA,kBAAK,EAAC,SAAS,CAAC,EAAE,CAAC;YACpB,QAAQ,CAAC,QAAQ,GAAG,IAAA,mCAAe,EAAC,OAAO,CAAC,CAAC;YAC7C,QAAQ,CAAC,UAAU,GAAG,SAAS,CAAC;QACpC,CAAC;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,WAAW,CACd,EAAU,EACV,eAAuB,EACvB,SAAiB,EACjB,SAAe,EACf,oBAA4B,EAC5B,iBAAyB,EACzB,OAAgB;QAEhB,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;QACtD,QAAQ,CAAC,UAAU,GAAG,SAAS,CAAC;QAChC,QAAQ,CAAC,UAAU,GAAG,SAAS,CAAC;QAChC,QAAQ,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;QACrD,QAAQ,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;QAChD,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC5B,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,IAAI,eAAe;QACf,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,IAAI,iBAAiB;QACjB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAEM,YAAY,CAAI,YAAsB;QACzC,OAAO,IAAA,gCAAY,EAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrD,CAAC;CACJ;AAvGD,kCAuGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/utils/type-utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/utils/type-utils.ts"],"names":[],"mappings":";;AAQA,oCAEC;AAVD,2CAAmC;AAQnC,SAAgB,YAAY,CAAI,OAAoC;IAChE,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAA,kBAAK,EAAC,IAAI,CAAC,CAAC,CAAC;AACjD,CAAC"}
|