@event-nest/core 1.3.1 → 2.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 +66 -18
- package/package.json +5 -2
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/aggregate-root/aggregate-root-event.d.ts +4 -4
- package/src/lib/aggregate-root/aggregate-root.d.ts +14 -14
- package/src/lib/aggregate-root/aggregate-root.js +34 -34
- package/src/lib/aggregate-root/aggregate-root.js.map +1 -1
- package/src/lib/aggregate-root/event-processor.d.ts +1 -1
- package/src/lib/aggregate-root/event-processor.js.map +1 -1
- package/src/lib/domain-event-emitter.d.ts +3 -3
- package/src/lib/domain-event-emitter.js +7 -8
- package/src/lib/domain-event-emitter.js.map +1 -1
- 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.js +1 -1
- package/src/lib/domain-event-subscription.js.map +1 -1
- package/src/lib/domain-event.js +2 -2
- package/src/lib/domain-event.js.map +1 -1
- package/src/lib/exceptions/event-concurrency-exception.d.ts +3 -0
- package/src/lib/exceptions/event-concurrency-exception.js +10 -0
- package/src/lib/exceptions/event-concurrency-exception.js.map +1 -0
- package/src/lib/storage/abstract-event-store.d.ts +6 -6
- package/src/lib/storage/abstract-event-store.js +4 -4
- package/src/lib/storage/abstract-event-store.js.map +1 -1
- package/src/lib/storage/event-store.d.ts +12 -12
- package/src/lib/storage/stored-aggregate-root.js.map +1 -1
- package/src/lib/storage/stored-event.d.ts +7 -7
- package/src/lib/storage/stored-event.js +12 -12
- package/src/lib/storage/stored-event.js.map +1 -1
package/README.md
CHANGED
|
@@ -22,10 +22,12 @@ It would also probably help to make some distinctions about what Event Nest is n
|
|
|
22
22
|
## Table of contents
|
|
23
23
|
- [Why?](#why)
|
|
24
24
|
- [Getting Started](#getting-started)
|
|
25
|
+
- [MongoDB setup](#mongodb-setup)
|
|
26
|
+
- [PostgreSQL setup](#postgresql-setup)
|
|
25
27
|
- [Concepts](#concepts)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
- [Event](#event)
|
|
29
|
+
- [Aggregate Root](#aggregate-root)
|
|
30
|
+
- [Domain Event Subscription](#domain-event-subscription)
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
## Why?
|
|
@@ -42,15 +44,17 @@ simpler, the library is not depending on the official module, so you can use it
|
|
|
42
44
|
|
|
43
45
|
## Getting Started
|
|
44
46
|
Depending on the storage solution you intend to use, you will need to install the corresponding packages.
|
|
45
|
-
At the moment,
|
|
47
|
+
At the moment, the supported storage solutions are MongoDB and PostgreSQL.
|
|
48
|
+
|
|
49
|
+
### MongoDB setup
|
|
46
50
|
|
|
47
51
|
```bash
|
|
48
52
|
npm install --save @event-nest/core @event-nest/mongodb
|
|
49
53
|
```
|
|
50
54
|
After installation, import the `EventNestMongoDbModule` to your nest.js application :
|
|
51
55
|
```typescript
|
|
52
|
-
import { Module } from "@nestjs/common";
|
|
53
56
|
import { EventNestMongoDbModule } from "@event-nest/mongodb";
|
|
57
|
+
import { Module } from "@nestjs/common";
|
|
54
58
|
|
|
55
59
|
@Module({
|
|
56
60
|
imports: [
|
|
@@ -64,9 +68,53 @@ import { EventNestMongoDbModule } from "@event-nest/mongodb";
|
|
|
64
68
|
export class AppModule {}
|
|
65
69
|
```
|
|
66
70
|
The collection settings define which MongoDB collections will be used to store the aggregates and the events.
|
|
67
|
-
Use any collection you want but be sure to create it before running the application.
|
|
68
71
|
|
|
69
72
|
|
|
73
|
+
### PostgreSQL setup
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm install --save @event-nest/core @event-nest/postgresql
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
After installation, import the `EventNestPostgreSQLModule` to your nest.js application :
|
|
80
|
+
```typescript
|
|
81
|
+
import { EventNestPostgreSQLModule } from "@event-nest/postgresql";
|
|
82
|
+
import { Module } from "@nestjs/common";
|
|
83
|
+
|
|
84
|
+
@Module({
|
|
85
|
+
imports: [
|
|
86
|
+
EventNestPostgreSQLModule.register({
|
|
87
|
+
aggregatesTableName: "aggregates",
|
|
88
|
+
connectionUri: "postgresql://postgres:password@localhost:5432/event_nest",
|
|
89
|
+
eventsTableName: "events",
|
|
90
|
+
schemaName: "event_nest_schema"
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
})
|
|
94
|
+
export class AppModule {}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
To avoid requiring a user with elevated privileges, the library will not create the tables in your database. You will have to create them manually based on the following guidelines.
|
|
98
|
+
|
|
99
|
+
**Aggregates Table :**
|
|
100
|
+
|
|
101
|
+
| Column Name | Type | Description |
|
|
102
|
+
|-------------|---------|-------------------------------------------------------------------------------------------------------------|
|
|
103
|
+
| id | uuid | The unique identifier of the aggregate root. <br/>Must be set as NOT NULL and it is the table's primary key |
|
|
104
|
+
| version | integer | The current version of the aggregate root. <br/>Must be set as NOT NULL |
|
|
105
|
+
|
|
106
|
+
**Events Table :**
|
|
107
|
+
|
|
108
|
+
| Column Name | Type | Description |
|
|
109
|
+
|------------------------|--------------------------|-------------------------------------------------------------------------------------------------------------------------------|
|
|
110
|
+
| id | uuid | The unique identifier of the event. <br/>Must be set as NOT NULL and it is the table's primary key |
|
|
111
|
+
| aggregate_root_id | uuid | The id of the aggregate that produced the event.<br/> Must be set as NOT NULL and it is a foreign key to the aggregates table |
|
|
112
|
+
| aggregate_root_version | integer | The version of the aggregate root when the event was produced. <br/>Must be set as NOT NULL |
|
|
113
|
+
| aggregate_root_name | text | The unique name of the aggregate root. <br/>Must be set as NOT NULL |
|
|
114
|
+
| event_name | text | The unique name of the event. <br/>Must be set as NOT NULL |
|
|
115
|
+
| payload | jsonb | A JSON representation of the event's additional data. |
|
|
116
|
+
| created_at | timestamp with time zone | The timestamp when the event was produced. <br/>Must be set as NOT NULL |
|
|
117
|
+
|
|
70
118
|
|
|
71
119
|
## Concepts
|
|
72
120
|
### Event
|
|
@@ -239,10 +287,10 @@ import { PublishedDomainEvent, DomainEventSubscription, OnDomainEvent } from "@e
|
|
|
239
287
|
@DomainEventSubscription(UserCreatedEvent, UserUpdatedEvent)
|
|
240
288
|
export class UserEventSubscription implements OnDomainEvent<UserCreatedEvent | UserUpdatedEvent> {
|
|
241
289
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
290
|
+
onDomainEvent(event: PublishedDomainEvent<UserCreatedEvent | UserUpdatedEvent>): Promise<unknown> {
|
|
291
|
+
//Here you can create/update your read model based on the event and your custom logic.
|
|
292
|
+
return Promise.resolve(undefined);
|
|
293
|
+
}
|
|
246
294
|
|
|
247
295
|
}
|
|
248
296
|
```
|
|
@@ -255,14 +303,14 @@ and your logic doesn't depend on the order of the events, you can change this se
|
|
|
255
303
|
|
|
256
304
|
```typescript
|
|
257
305
|
@Module({
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
306
|
+
imports: [
|
|
307
|
+
EventNestMongoDbModule.register({
|
|
308
|
+
connectionUri: "mongodb://localhost:27017/example",
|
|
309
|
+
aggregatesCollection: "aggregates-collection",
|
|
310
|
+
eventsCollection: "events-collection",
|
|
311
|
+
concurrentSubscriptions:true
|
|
312
|
+
})
|
|
313
|
+
]
|
|
266
314
|
})
|
|
267
315
|
export class AppModule {}
|
|
268
316
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-nest/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Nick Tsitlakidis",
|
|
6
6
|
"description": "Event sourcing module for NestJS. It provides a set of decorators and classes to build an application based on event sourcing.",
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
"nestjs",
|
|
9
9
|
"event sourcing",
|
|
10
10
|
"cqrs",
|
|
11
|
-
"ddd"
|
|
11
|
+
"ddd",
|
|
12
|
+
"mongodb",
|
|
13
|
+
"sql",
|
|
14
|
+
"postgresql"
|
|
12
15
|
],
|
|
13
16
|
"repository": {
|
|
14
17
|
"type": "git",
|
package/src/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./lib/aggregate-root/event-processor";
|
|
|
4
4
|
export * from "./lib/exceptions/event-name-conflict-exception";
|
|
5
5
|
export * from "./lib/exceptions/unknown-event-exception";
|
|
6
6
|
export * from "./lib/exceptions/missing-aggregate-root-name-exception";
|
|
7
|
+
export * from "./lib/exceptions/event-concurrency-exception";
|
|
7
8
|
export * from "./lib/domain-event";
|
|
8
9
|
export * from "./lib/published-domain-event";
|
|
9
10
|
export * from "./lib/domain-event-subscription";
|
package/src/index.js
CHANGED
|
@@ -7,6 +7,7 @@ tslib_1.__exportStar(require("./lib/aggregate-root/event-processor"), exports);
|
|
|
7
7
|
tslib_1.__exportStar(require("./lib/exceptions/event-name-conflict-exception"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./lib/exceptions/unknown-event-exception"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./lib/exceptions/missing-aggregate-root-name-exception"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/exceptions/event-concurrency-exception"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./lib/domain-event"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./lib/published-domain-event"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./lib/domain-event-subscription"), exports);
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/core/src/index.ts"],"names":[],"mappings":";;;AAAA,8EAAoD;AACpD,mFAAyD;AACzD,+EAAqD;AAErD,yFAA+D;AAC/D,mFAAyD;AACzD,iGAAuE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/core/src/index.ts"],"names":[],"mappings":";;;AAAA,8EAAoD;AACpD,mFAAyD;AACzD,+EAAqD;AAErD,yFAA+D;AAC/D,mFAAyD;AACzD,iGAAuE;AACvE,uFAA6D;AAE7D,6DAAmC;AACnC,uEAA6C;AAC7C,0EAAgD;AAEhD,gEAAsC;AACtC,qEAA2C;AAC3C,oEAA0C;AAE1C,qEAA2C;AAC3C,8EAAoD;AACpD,6EAAmD;AACnD,oEAA0C;AAE1C,iEAAuC"}
|
|
@@ -3,13 +3,13 @@ export interface AggregateRootEvent<T> {
|
|
|
3
3
|
* The unique id of the aggregate root that published the event
|
|
4
4
|
*/
|
|
5
5
|
aggregateRootId: string;
|
|
6
|
+
/**
|
|
7
|
+
* A UTC timestamp that defines when the event occurred.
|
|
8
|
+
*/
|
|
9
|
+
occurredAt: Date;
|
|
6
10
|
/**
|
|
7
11
|
* The payload of the event. The type of this object depends on the events
|
|
8
12
|
* you register using the {@link DomainEvent} decorator.
|
|
9
13
|
*/
|
|
10
14
|
payload: T;
|
|
11
|
-
/**
|
|
12
|
-
* A UTC timestamp that defines when the event occurred.
|
|
13
|
-
*/
|
|
14
|
-
occurredAt: Date;
|
|
15
15
|
}
|
|
@@ -4,15 +4,14 @@ import { AggregateRootEvent } from "./aggregate-root-event";
|
|
|
4
4
|
export declare abstract class AggregateRoot {
|
|
5
5
|
private readonly _id;
|
|
6
6
|
private _appendedEvents;
|
|
7
|
-
private _version;
|
|
8
7
|
private readonly _logger;
|
|
8
|
+
private _version;
|
|
9
9
|
protected constructor(_id: string, logger?: Logger);
|
|
10
|
-
get id(): string;
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
* each time an event is persisted.
|
|
11
|
+
* Returns a clone array of all the currently appended events of the entity.
|
|
14
12
|
*/
|
|
15
|
-
get
|
|
13
|
+
get appendedEvents(): Array<AggregateRootEvent<object>>;
|
|
14
|
+
get id(): string;
|
|
16
15
|
get logger(): Logger;
|
|
17
16
|
/**
|
|
18
17
|
* Publishes all the provided events using a connected event publisher. To connect a publisher, use the
|
|
@@ -22,15 +21,11 @@ export declare abstract class AggregateRoot {
|
|
|
22
21
|
* If a publisher is not connected, the method will return a rejected promise.
|
|
23
22
|
* @param events The events to be published
|
|
24
23
|
*/
|
|
25
|
-
publish(events: Array<AggregateRootEvent<object>>): Promise<Array<StoredEvent>>;
|
|
26
24
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* During publishing, the events will be saved and after the successful save, all the application event
|
|
30
|
-
* handlers will be called to take care of async updates.
|
|
31
|
-
* Call this once all the events you want, have been appended.
|
|
25
|
+
* Defines the current version of the aggregate root. The version is increased
|
|
26
|
+
* each time an event is persisted.
|
|
32
27
|
*/
|
|
33
|
-
|
|
28
|
+
get version(): number;
|
|
34
29
|
/**
|
|
35
30
|
* Adds an event to the currently existing events of the entity. This will not publish the event. Use the {@link commit}
|
|
36
31
|
* method once all the events you want are appended.
|
|
@@ -38,9 +33,14 @@ export declare abstract class AggregateRoot {
|
|
|
38
33
|
*/
|
|
39
34
|
append(event: object): void;
|
|
40
35
|
/**
|
|
41
|
-
*
|
|
36
|
+
* All the events that have been previously appended will be committed once this method runs. After publishing,
|
|
37
|
+
* the appended events will be deleted so that the next commit publishes newer events.
|
|
38
|
+
* During publishing, the events will be saved and after the successful save, all the application event
|
|
39
|
+
* handlers will be called to take care of async updates.
|
|
40
|
+
* Call this once all the events you want, have been appended.
|
|
42
41
|
*/
|
|
43
|
-
|
|
42
|
+
commit(): Promise<AggregateRoot>;
|
|
43
|
+
publish(events: Array<AggregateRootEvent<object>>): Promise<Array<StoredEvent>>;
|
|
44
44
|
/**
|
|
45
45
|
* Used when a set of events have been retrieved from the database. These events can be passed to the method and the
|
|
46
46
|
* method will trigger all the matching {@link EventProcessor} functions of the entity to populate the object based on
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AggregateRoot = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
|
-
const
|
|
5
|
+
const domain_event_registrations_1 = require("../domain-event-registrations");
|
|
6
6
|
const unknown_event_exception_1 = require("../exceptions/unknown-event-exception");
|
|
7
|
-
const type_utils_1 = require("../utils/type-utils");
|
|
8
7
|
const unregistered_event_exception_1 = require("../exceptions/unregistered-event-exception");
|
|
9
|
-
const
|
|
8
|
+
const type_utils_1 = require("../utils/type-utils");
|
|
9
|
+
const event_processor_1 = require("./event-processor");
|
|
10
10
|
class AggregateRoot {
|
|
11
11
|
constructor(_id, logger) {
|
|
12
12
|
this._id = _id;
|
|
@@ -14,15 +14,14 @@ class AggregateRoot {
|
|
|
14
14
|
this._version = 0;
|
|
15
15
|
this._logger = (0, type_utils_1.isNil)(logger) ? new common_1.Logger(AggregateRoot.name) : logger;
|
|
16
16
|
}
|
|
17
|
-
get id() {
|
|
18
|
-
return this._id;
|
|
19
|
-
}
|
|
20
17
|
/**
|
|
21
|
-
*
|
|
22
|
-
* each time an event is persisted.
|
|
18
|
+
* Returns a clone array of all the currently appended events of the entity.
|
|
23
19
|
*/
|
|
24
|
-
get
|
|
25
|
-
return this.
|
|
20
|
+
get appendedEvents() {
|
|
21
|
+
return this._appendedEvents.slice(0);
|
|
22
|
+
}
|
|
23
|
+
get id() {
|
|
24
|
+
return this._id;
|
|
26
25
|
}
|
|
27
26
|
get logger() {
|
|
28
27
|
return this._logger;
|
|
@@ -35,25 +34,12 @@ class AggregateRoot {
|
|
|
35
34
|
* If a publisher is not connected, the method will return a rejected promise.
|
|
36
35
|
* @param events The events to be published
|
|
37
36
|
*/
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
|
-
publish(events) {
|
|
40
|
-
this.logger.error("There is no event publisher assigned");
|
|
41
|
-
return Promise.reject("There is no event publisher assigned");
|
|
42
|
-
}
|
|
43
37
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* During publishing, the events will be saved and after the successful save, all the application event
|
|
47
|
-
* handlers will be called to take care of async updates.
|
|
48
|
-
* Call this once all the events you want, have been appended.
|
|
38
|
+
* Defines the current version of the aggregate root. The version is increased
|
|
39
|
+
* each time an event is persisted.
|
|
49
40
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this._appendedEvents = [];
|
|
53
|
-
if (toPublish.length > 0) {
|
|
54
|
-
return this.publish(toPublish).then(() => Promise.resolve(this));
|
|
55
|
-
}
|
|
56
|
-
return Promise.resolve(this);
|
|
41
|
+
get version() {
|
|
42
|
+
return this._version;
|
|
57
43
|
}
|
|
58
44
|
/**
|
|
59
45
|
* Adds an event to the currently existing events of the entity. This will not publish the event. Use the {@link commit}
|
|
@@ -67,15 +53,29 @@ class AggregateRoot {
|
|
|
67
53
|
}
|
|
68
54
|
this._appendedEvents.push({
|
|
69
55
|
aggregateRootId: this.id,
|
|
70
|
-
|
|
71
|
-
|
|
56
|
+
occurredAt: new Date(Date.now()),
|
|
57
|
+
payload: event
|
|
72
58
|
});
|
|
73
59
|
}
|
|
74
60
|
/**
|
|
75
|
-
*
|
|
61
|
+
* All the events that have been previously appended will be committed once this method runs. After publishing,
|
|
62
|
+
* the appended events will be deleted so that the next commit publishes newer events.
|
|
63
|
+
* During publishing, the events will be saved and after the successful save, all the application event
|
|
64
|
+
* handlers will be called to take care of async updates.
|
|
65
|
+
* Call this once all the events you want, have been appended.
|
|
76
66
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
commit() {
|
|
68
|
+
const toPublish = this._appendedEvents.slice(0);
|
|
69
|
+
this._appendedEvents = [];
|
|
70
|
+
if (toPublish.length > 0) {
|
|
71
|
+
return this.publish(toPublish).then(() => Promise.resolve(this));
|
|
72
|
+
}
|
|
73
|
+
return Promise.resolve(this);
|
|
74
|
+
}
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
76
|
+
publish(events) {
|
|
77
|
+
this.logger.error("There is no event publisher assigned");
|
|
78
|
+
return Promise.reject("There is no event publisher assigned");
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Used when a set of events have been retrieved from the database. These events can be passed to the method and the
|
|
@@ -126,8 +126,8 @@ class AggregateRoot {
|
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
128
|
known.push({
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
payload: ev.getPayloadAs(eventClass),
|
|
130
|
+
processorKey
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-root.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/aggregate-root/aggregate-root.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"aggregate-root.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/aggregate-root/aggregate-root.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,8EAA4E;AAC5E,mFAA8E;AAC9E,6FAAwF;AAExF,oDAA4C;AAE5C,uDAA4D;AAO5D,MAAsB,aAAa;IAK/B,YACqB,GAAW,EAC5B,MAAe;QADE,QAAG,GAAH,GAAG,CAAQ;QAG5B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAA,kBAAK,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,eAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED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EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,oBAAoB,GAAG,EAAE,CAAC,oBAAoB,CAAC,CAAC;IACtF,CAAC;IAEO,WAAW,CAAC,MAA0B;QAC1C,MAAM,KAAK,GAAsB,EAAE,CAAC;QACpC,MAAM,YAAY,GAAkB,EAAE,CAAC;QACvC,MAAM,gBAAgB,GAAkB,EAAE,CAAC;QAE3C,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;YAClB,MAAM,UAAU,GAAG,IAAA,0CAAa,EAAC,EAAE,CAAC,SAAS,CAAC,CAAC;YAC/C,IAAI,IAAA,kBAAK,EAAC,UAAU,CAAC,EAAE,CAAC;gBACpB,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;YACpC,CAAC;iBAAM,CAAC;gBACJ,MAAM,YAAY,GAAG,IAAA,yCAAuB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;gBAC/D,IAAI,IAAA,kBAAK,EAAC,YAAY,CAAC,EAAE,CAAC;oBACtB,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;gBACxC,CAAC;qBAAM,CAAC;oBACJ,KAAK,CAAC,IAAI,CAAC;wBACP,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC;wBACpC,YAAY;qBACf,CAAC,CAAC;gBACP,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,YAAY,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;CACJ;AAlJD,sCAkJC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import { AggregateRoot } from "./aggregate-root";
|
|
3
2
|
import { ClassConstructor } from "class-transformer";
|
|
3
|
+
import { AggregateRoot } from "./aggregate-root";
|
|
4
4
|
export declare function getDecoratedPropertyKey(entity: AggregateRoot, eventClass: ClassConstructor<unknown>): string | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* A decorator to mark a method as an event processor.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-processor.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/aggregate-root/event-processor.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;
|
|
1
|
+
{"version":3,"file":"event-processor.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/aggregate-root/event-processor.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAI1B,oDAAuD;AAGvD,SAAgB,uBAAuB,CACnC,MAAqB,EACrB,UAAqC;IAErC,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IACrD,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAC5C,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;QAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC1D,OAAO,QAAQ,CAAC,UAAU,KAAK,UAAU,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC;AACxD,CAAC;AAnBD,0DAmBC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,UAAqC;IAChE,OAAO,CAAC,cAAc,EAAE,WAAW,EAAE,EAAE;QACnC,OAAO,CAAC,cAAc,CAClB,mCAAmB,GAAG,GAAG,GAAG,WAAW,CAAC,QAAQ,EAAE,EAClD,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,EAC5C,cAAc,CACjB,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AARD,wCAQC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Module } from "@nestjs/core/injector/module";
|
|
2
1
|
import { OnModuleDestroy } from "@nestjs/common";
|
|
2
|
+
import { Module } from "@nestjs/core/injector/module";
|
|
3
3
|
import { PublishedDomainEvent } from "./published-domain-event";
|
|
4
4
|
export declare class DomainEventEmitter implements OnModuleDestroy {
|
|
5
5
|
private readonly _concurrentSubscriptions;
|
|
6
6
|
private readonly _handlers;
|
|
7
7
|
private readonly _logger;
|
|
8
8
|
constructor(_concurrentSubscriptions?: boolean);
|
|
9
|
-
get
|
|
10
|
-
onModuleDestroy(): void;
|
|
9
|
+
get concurrentSubscriptions(): boolean;
|
|
11
10
|
bindSubscriptions(injectorModules: Map<string, Module>): void;
|
|
12
11
|
emit(withAggregate: PublishedDomainEvent<object>): Promise<unknown>;
|
|
13
12
|
emitMultiple(withAggregate: PublishedDomainEvent<object>[]): Promise<unknown>;
|
|
13
|
+
onModuleDestroy(): void;
|
|
14
14
|
}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DomainEventEmitter = void 0;
|
|
4
|
-
const domain_event_subscription_1 = require("./domain-event-subscription");
|
|
5
|
-
const type_utils_1 = require("./utils/type-utils");
|
|
6
4
|
const common_1 = require("@nestjs/common");
|
|
7
5
|
const rxjs_1 = require("rxjs");
|
|
6
|
+
const domain_event_subscription_1 = require("./domain-event-subscription");
|
|
7
|
+
const type_utils_1 = require("./utils/type-utils");
|
|
8
8
|
class DomainEventEmitter {
|
|
9
9
|
constructor(_concurrentSubscriptions = false) {
|
|
10
10
|
this._concurrentSubscriptions = _concurrentSubscriptions;
|
|
11
11
|
this._handlers = new Map();
|
|
12
12
|
this._logger = new common_1.Logger(DomainEventEmitter.name);
|
|
13
13
|
}
|
|
14
|
-
get
|
|
14
|
+
get concurrentSubscriptions() {
|
|
15
15
|
return this._concurrentSubscriptions;
|
|
16
16
|
}
|
|
17
|
-
onModuleDestroy() {
|
|
18
|
-
this._handlers.clear();
|
|
19
|
-
}
|
|
20
17
|
bindSubscriptions(injectorModules) {
|
|
21
18
|
injectorModules.forEach((module) => {
|
|
22
19
|
module.providers.forEach((provider) => {
|
|
@@ -52,8 +49,7 @@ class DomainEventEmitter {
|
|
|
52
49
|
return async () => {
|
|
53
50
|
// eslint-disable-next-line no-useless-catch
|
|
54
51
|
try {
|
|
55
|
-
|
|
56
|
-
return result;
|
|
52
|
+
return await handler.onDomainEvent(withAggregate);
|
|
57
53
|
}
|
|
58
54
|
catch (error) {
|
|
59
55
|
this._logger.error(`Error while emitting event ${withAggregate.payload.constructor.name} : ${error.message}`);
|
|
@@ -71,6 +67,9 @@ class DomainEventEmitter {
|
|
|
71
67
|
this._logger.debug(`Error while emitting events sequentially: ${error.message}`);
|
|
72
68
|
});
|
|
73
69
|
}
|
|
70
|
+
onModuleDestroy() {
|
|
71
|
+
this._handlers.clear();
|
|
72
|
+
}
|
|
74
73
|
}
|
|
75
74
|
exports.DomainEventEmitter = DomainEventEmitter;
|
|
76
75
|
//# sourceMappingURL=domain-event-emitter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event-emitter.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/domain-event-emitter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"domain-event-emitter.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/domain-event-emitter.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AAEzD,+BAA+D;AAE/D,2EAIqC;AAGrC,mDAA2C;AAE3C,MAAa,kBAAkB;IAI3B,YAA6B,2BAA2B,KAAK;QAAhC,6BAAwB,GAAxB,wBAAwB,CAAQ;QACzD,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAwC,CAAC;QACjE,IAAI,CAAC,OAAO,GAAG,IAAI,eAAM,CAAC,kBA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,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAChC,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC/E,CAAC;QAED,OAAO,IAAA,oBAAa,EAChB,IAAA,WAAI,EAAC,aAAa,CAAC,CAAC,IAAI,CACpB,IAAA,gBAAS,EAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,WAAI,EAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAC5C,IAAA,cAAO,GAAE,CACZ,CACJ,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACd,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,6CAA8C,KAAa,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9F,CAAC,CAAC,CAAC;IACP,CAAC;IAED,eAAe;QACX,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACJ;AAxFD,gDAwFC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event-registrations.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/domain-event-registrations.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"domain-event-registrations.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/domain-event-registrations.ts"],"names":[],"mappings":";;;AAEA,8FAAwF;AACxF,mDAA2C;AAO3C,MAAM,aAAa,GAAwB,EAAE,CAAC;AAE9C;;;GAGG;AACH,SAAgB,YAAY,CAAC,MAAc;IACvC,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,KAAK,MAAM,CAAC,WAAW,CAAC,CAAC;IACnG,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,CAAC;AAHD,oCAGC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAI,IAAY;IACzC,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC;IACpF,OAAO,IAAA,kBAAK,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,KAAK,CAAC,UAAkC,CAAC;AAChF,CAAC;AAHD,sCAGC;AAED,SAAgB,YAAY,CAAC,KAAa;IACtC,OAAO,CAAC,IAAA,kBAAK,EAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACvC,CAAC;AAFD,oCAEC;AAED,SAAgB,aAAa,CAAC,eAA6B;IACvD,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,KAAK,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7F,MAAM,IAAI,0DAA0B,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACpE,CAAC;IAED,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AACxC,CAAC;AAND,sCAMC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getEventId = exports.getEventsFromDomainEventSubscription = exports.isDomainEventSubscription = exports.DomainEventSubscription = void 0;
|
|
4
|
-
const metadata_keys_1 = require("./metadata-keys");
|
|
5
4
|
const crypto_1 = require("crypto");
|
|
5
|
+
const metadata_keys_1 = require("./metadata-keys");
|
|
6
6
|
const type_utils_1 = require("./utils/type-utils");
|
|
7
7
|
const DomainEventSubscription = (...events) => {
|
|
8
8
|
return (target) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event-subscription.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/domain-event-subscription.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"domain-event-subscription.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/domain-event-subscription.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEpC,mDAAkF;AAElF,mDAA2C;AAEpC,MAAM,uBAAuB,GAAG,CAAC,GAAG,MAAa,EAAkB,EAAE;IACxE,OAAO,CAAC,MAAc,EAAE,EAAE;QACtB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACrB,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,gCAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;gBACnD,OAAO,CAAC,cAAc,CAAC,gCAAgB,EAAE,EAAE,mBAAmB,EAAE,IAAA,mBAAU,GAAE,EAAE,EAAE,KAAK,CAAC,CAAC;YAC3F,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,cAAc,CAAC,6CAA6B,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;IAC9E,CAAC,CAAC;AACN,CAAC,CAAC;AAVW,QAAA,uBAAuB,2BAUlC;AAEF,SAAgB,yBAAyB,CAAC,cAAsB;IAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,6CAA6B,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACtG,OAAO,WAAW,IAAI,OAAQ,cAAyC,CAAC,aAAa,KAAK,UAAU,CAAC;AACzG,CAAC;AAHD,8DAGC;AAED,SAAgB,oCAAoC,CAAC,oBAA4C;IAC7F,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,6CAA6B,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;IACtG,OAAO,IAAA,kBAAK,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;AAClD,CAAC;AAHD,oFAGC;AAED,wDAAwD;AACxD,SAAgB,UAAU,CAAC,gBAA0B;IACjD,OAAO,OAAO,CAAC,WAAW,CAAC,gCAAgB,EAAE,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;AACxF,CAAC;AAFD,gCAEC"}
|
package/src/lib/domain-event.js
CHANGED
|
@@ -16,8 +16,8 @@ const domain_event_registrations_1 = require("./domain-event-registrations");
|
|
|
16
16
|
function DomainEvent(eventName) {
|
|
17
17
|
return (target) => {
|
|
18
18
|
(0, domain_event_registrations_1.registerEvent)({
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
eventClass: target,
|
|
20
|
+
eventName: eventName
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/domain-event.ts"],"names":[],"mappings":";;;AAAA,6EAA6D;AAE7D;;;;;;;;;;GAUG;AACH,SAAgB,WAAW,CAAC,SAAiB;IACzC,OAAO,CAAC,MAAM,EAAE,EAAE;QACd,IAAA,0CAAa,EAAC;YACV,
|
|
1
|
+
{"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../../../libs/core/src/lib/domain-event.ts"],"names":[],"mappings":";;;AAAA,6EAA6D;AAE7D;;;;;;;;;;GAUG;AACH,SAAgB,WAAW,CAAC,SAAiB;IACzC,OAAO,CAAC,MAAM,EAAE,EAAE;QACd,IAAA,0CAAa,EAAC;YACV,UAAU,EAAE,MAAM;YAClB,SAAS,EAAE,SAAS;SACvB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAPD,kCAOC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventConcurrencyException = void 0;
|
|
4
|
+
class EventConcurrencyException extends Error {
|
|
5
|
+
constructor(aggregateRootId, databaseVersion, version) {
|
|
6
|
+
super(`Concurrency issue for aggregate ${aggregateRootId}. Expected ${version}. Stored ${databaseVersion}`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.EventConcurrencyException = EventConcurrencyException;
|
|
10
|
+
//# sourceMappingURL=event-concurrency-exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-concurrency-exception.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/exceptions/event-concurrency-exception.ts"],"names":[],"mappings":";;;AAAA,MAAa,yBAA0B,SAAQ,KAAK;IAChD,YAAY,eAAuB,EAAE,eAAuB,EAAE,OAAe;QACzE,KAAK,CAAC,mCAAmC,eAAe,cAAc,OAAO,YAAY,eAAe,EAAE,CAAC,CAAC;IAChH,CAAC;CACJ;AAJD,8DAIC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AggregateRootClass, EventStore } from "./event-store";
|
|
2
|
-
import { StoredEvent } from "./stored-event";
|
|
3
1
|
import { AggregateRoot } from "../aggregate-root/aggregate-root";
|
|
4
|
-
import { StoredAggregateRoot } from "./stored-aggregate-root";
|
|
5
2
|
import { DomainEventEmitter } from "../domain-event-emitter";
|
|
3
|
+
import { AggregateRootClass, EventStore } from "./event-store";
|
|
4
|
+
import { StoredAggregateRoot } from "./stored-aggregate-root";
|
|
5
|
+
import { StoredEvent } from "./stored-event";
|
|
6
6
|
/**
|
|
7
7
|
* An abstract implementation of the {@link EventStore} interface.
|
|
8
8
|
* Regardless of the database technology, all subclasses should have a common implementation
|
|
@@ -11,9 +11,9 @@ import { DomainEventEmitter } from "../domain-event-emitter";
|
|
|
11
11
|
export declare abstract class AbstractEventStore implements EventStore {
|
|
12
12
|
private _eventEmitter;
|
|
13
13
|
protected constructor(_eventEmitter: DomainEventEmitter);
|
|
14
|
-
|
|
14
|
+
addPublisher<T extends AggregateRoot>(aggregateRoot: T): T;
|
|
15
15
|
abstract findAggregateRootVersion(id: string): Promise<number>;
|
|
16
|
-
abstract
|
|
16
|
+
abstract findByAggregateRootId<T extends AggregateRoot>(aggregateRootClass: AggregateRootClass<T>, id: string): Promise<Array<StoredEvent>>;
|
|
17
17
|
abstract generateEntityId(): Promise<string>;
|
|
18
|
-
|
|
18
|
+
abstract save(events: Array<StoredEvent>, aggregate: StoredAggregateRoot): Promise<Array<StoredEvent>>;
|
|
19
19
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AbstractEventStore = void 0;
|
|
4
|
-
const stored_event_1 = require("./stored-event");
|
|
5
|
-
const stored_aggregate_root_1 = require("./stored-aggregate-root");
|
|
6
|
-
const id_generation_exception_1 = require("../exceptions/id-generation-exception");
|
|
7
|
-
const type_utils_1 = require("../utils/type-utils");
|
|
8
4
|
const aggregate_root_name_1 = require("../aggregate-root/aggregate-root-name");
|
|
5
|
+
const id_generation_exception_1 = require("../exceptions/id-generation-exception");
|
|
9
6
|
const missing_aggregate_root_name_exception_1 = require("../exceptions/missing-aggregate-root-name-exception");
|
|
10
7
|
const unknown_event_version_exception_1 = require("../exceptions/unknown-event-version-exception");
|
|
8
|
+
const type_utils_1 = require("../utils/type-utils");
|
|
9
|
+
const stored_aggregate_root_1 = require("./stored-aggregate-root");
|
|
10
|
+
const stored_event_1 = require("./stored-event");
|
|
11
11
|
/**
|
|
12
12
|
* An abstract implementation of the {@link EventStore} interface.
|
|
13
13
|
* Regardless of the database technology, all subclasses should have a common implementation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-event-store.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/abstract-event-store.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"abstract-event-store.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/abstract-event-store.ts"],"names":[],"mappings":";;;AAEA,+EAA6E;AAE7E,mFAA8E;AAC9E,+GAAwG;AACxG,mGAA6F;AAE7F,oDAA0D;AAE1D,mEAA8D;AAC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,KAAK,CAAC,UAAU,CACnB,CACJ,CAAC;gBACF,SAAS,CAAC,IAAI,CAAC;oBACX,GAAG,KAAK;oBACR,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE,aAAa,CAAC,OAAO;iBACjC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,IAAI,2CAAmB,CAAC,aAAa,CAAC,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;YACjF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YACrD,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBACxB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC;gBACxD,IAAI,IAAA,kBAAK,EAAC,KAAK,CAAC,EAAE,CAAC;oBACf,MAAM,IAAI,8DAA4B,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;gBACjF,CAAC;gBAED,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,oBAAoB,CAAC;YAC/C,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;YAC3C,aAAa,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YACpC,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;QACF,OAAO,aAAa,CAAC;IACzB,CAAC;CAYJ;AApED,gDAoEC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StoredEvent } from "./stored-event";
|
|
2
|
-
import { StoredAggregateRoot } from "./stored-aggregate-root";
|
|
3
1
|
import { AggregateRoot } from "../aggregate-root/aggregate-root";
|
|
2
|
+
import { StoredAggregateRoot } from "./stored-aggregate-root";
|
|
3
|
+
import { StoredEvent } from "./stored-event";
|
|
4
4
|
export type AggregateRootClass<T> = Function & {
|
|
5
5
|
prototype: T;
|
|
6
6
|
};
|
|
@@ -19,6 +19,12 @@ export interface EventStore {
|
|
|
19
19
|
* @param aggregateRoot The aggregate root object to which we want to add a publish method.
|
|
20
20
|
*/
|
|
21
21
|
addPublisher<T extends AggregateRoot>(aggregateRoot: T): T;
|
|
22
|
+
/**
|
|
23
|
+
* Finds the version of the aggregate root object that is associated with the provided id. If the aggregate root is not found
|
|
24
|
+
* or there's no version information, the method will return -1
|
|
25
|
+
* @param id The id of the aggregate root object
|
|
26
|
+
*/
|
|
27
|
+
findAggregateRootVersion(id: string): Promise<number>;
|
|
22
28
|
/**
|
|
23
29
|
* Finds all events that are associated with the provided aggregate root id and match the aggregate root name which
|
|
24
30
|
* is resolved from the aggregate root class. These events can later be used to recreate an aggregate root object.
|
|
@@ -27,11 +33,11 @@ export interface EventStore {
|
|
|
27
33
|
*/
|
|
28
34
|
findByAggregateRootId<T extends AggregateRoot>(aggregateRootClass: AggregateRootClass<T>, id: string): Promise<Array<StoredEvent>>;
|
|
29
35
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
36
|
+
* Each storage solution has its own way of dealing with unique ids. This method's implementation should reflect
|
|
37
|
+
* the way the storage solution generates unique ids. For example, in a MongoDB database this would usually return
|
|
38
|
+
* a String representation of a MongoDB ObjectId.
|
|
33
39
|
*/
|
|
34
|
-
|
|
40
|
+
generateEntityId(): Promise<string>;
|
|
35
41
|
/**
|
|
36
42
|
* Saves the provided event and aggregate root object. Before saving the aggregate root object, the method will check
|
|
37
43
|
* if the version of the aggregate root object is the same as the version of the aggregate root object in the database.
|
|
@@ -41,10 +47,4 @@ export interface EventStore {
|
|
|
41
47
|
* @param aggregate The aggregate root object that matches the events
|
|
42
48
|
*/
|
|
43
49
|
save(events: Array<StoredEvent>, aggregate: StoredAggregateRoot): Promise<Array<StoredEvent>>;
|
|
44
|
-
/**
|
|
45
|
-
* Each storage solution has its own way of dealing with unique ids. This method's implementation should reflect
|
|
46
|
-
* the way the storage solution generates unique ids. For example, in a MongoDB database this would usually return
|
|
47
|
-
* a String representation of a MongoDB ObjectId.
|
|
48
|
-
*/
|
|
49
|
-
generateEntityId(): Promise<string>;
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stored-aggregate-root.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/stored-aggregate-root.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,mBAAmB;IAC5B,
|
|
1
|
+
{"version":3,"file":"stored-aggregate-root.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/stored-aggregate-root.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,mBAAmB;IAC5B,YACW,EAAU,EACV,OAAe;QADf,OAAE,GAAF,EAAE,CAAQ;QACV,YAAO,GAAP,OAAO,CAAQ;IACvB,CAAC;CACP;AALD,kDAKC"}
|
|
@@ -11,12 +11,12 @@ import { ClassConstructor } from "class-transformer";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class StoredEvent {
|
|
13
13
|
aggregateRootVersion: number;
|
|
14
|
-
private readonly _id;
|
|
15
14
|
private readonly _aggregateRootId;
|
|
15
|
+
private _aggregateRootName;
|
|
16
16
|
private _createdAt;
|
|
17
|
-
private _payload;
|
|
18
17
|
private _eventName;
|
|
19
|
-
private
|
|
18
|
+
private readonly _id;
|
|
19
|
+
private _payload;
|
|
20
20
|
private constructor();
|
|
21
21
|
/**
|
|
22
22
|
* Factory method that will create a new event based on the provided info. Typically, it should be used when
|
|
@@ -44,11 +44,11 @@ export declare class StoredEvent {
|
|
|
44
44
|
* @param payload The event payload as an object.
|
|
45
45
|
*/
|
|
46
46
|
static fromStorage(id: string, aggregateRootId: string, eventName: string, createdAt: Date, aggregateRootVersion: number, aggregateRootName: string, payload: unknown): StoredEvent;
|
|
47
|
-
getPayloadAs<T>(payloadClass: ClassConstructor<T>): T;
|
|
48
|
-
get payload(): unknown;
|
|
49
|
-
get id(): string;
|
|
50
47
|
get aggregateRootId(): string;
|
|
48
|
+
get aggregateRootName(): string;
|
|
51
49
|
get createdAt(): Date;
|
|
52
50
|
get eventName(): string;
|
|
53
|
-
get
|
|
51
|
+
get id(): string;
|
|
52
|
+
get payload(): unknown;
|
|
53
|
+
getPayloadAs<T>(payloadClass: ClassConstructor<T>): T;
|
|
54
54
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StoredEvent = void 0;
|
|
4
4
|
const class_transformer_1 = require("class-transformer");
|
|
5
|
-
const type_utils_1 = require("../utils/type-utils");
|
|
6
5
|
const domain_event_registrations_1 = require("../domain-event-registrations");
|
|
6
|
+
const type_utils_1 = require("../utils/type-utils");
|
|
7
7
|
/**
|
|
8
8
|
* Represents an event that will be persisted according to the storage solution that is used.
|
|
9
9
|
* The event is defined by metadata like aggregate root id, version and creation date, and it also includes its payload
|
|
@@ -63,26 +63,26 @@ class StoredEvent {
|
|
|
63
63
|
newEvent._payload = payload;
|
|
64
64
|
return newEvent;
|
|
65
65
|
}
|
|
66
|
-
getPayloadAs(payloadClass) {
|
|
67
|
-
return (0, class_transformer_1.plainToClass)(payloadClass, this._payload);
|
|
68
|
-
}
|
|
69
|
-
get payload() {
|
|
70
|
-
return this._payload;
|
|
71
|
-
}
|
|
72
|
-
get id() {
|
|
73
|
-
return this._id;
|
|
74
|
-
}
|
|
75
66
|
get aggregateRootId() {
|
|
76
67
|
return this._aggregateRootId;
|
|
77
68
|
}
|
|
69
|
+
get aggregateRootName() {
|
|
70
|
+
return this._aggregateRootName;
|
|
71
|
+
}
|
|
78
72
|
get createdAt() {
|
|
79
73
|
return this._createdAt;
|
|
80
74
|
}
|
|
81
75
|
get eventName() {
|
|
82
76
|
return this._eventName;
|
|
83
77
|
}
|
|
84
|
-
get
|
|
85
|
-
return this.
|
|
78
|
+
get id() {
|
|
79
|
+
return this._id;
|
|
80
|
+
}
|
|
81
|
+
get payload() {
|
|
82
|
+
return this._payload;
|
|
83
|
+
}
|
|
84
|
+
getPayloadAs(payloadClass) {
|
|
85
|
+
return (0, class_transformer_1.plainToClass)(payloadClass, this._payload);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
exports.StoredEvent = StoredEvent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stored-event.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/stored-event.ts"],"names":[],"mappings":";;;AAAA,yDAAoF;
|
|
1
|
+
{"version":3,"file":"stored-event.js","sourceRoot":"","sources":["../../../../../../libs/core/src/lib/storage/stored-event.ts"],"names":[],"mappings":";;;AAAA,yDAAoF;AAEpF,8EAA6D;AAC7D,oDAA4C;AAE5C;;;;;;;;;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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