@event-nest/mongodb 3.4.2 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-nest/mongodb",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Event sourcing module for NestJS using MongoDB. It uses MongoDB collections and transactions to store events and object information",
|
|
6
6
|
"author": "Nick Tsitlakidis",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "https://github.com/NickTsitlakidis/event-nest.git"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
12
|
+
"node": ">= 20"
|
|
13
13
|
},
|
|
14
14
|
"type": "commonjs",
|
|
15
15
|
"keywords": [
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"postgresql"
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@nestjs/common": "
|
|
26
|
-
"@nestjs/core": "^
|
|
27
|
-
"mongodb": "^
|
|
25
|
+
"@nestjs/common": "^^10.0.0 || ^11.0.0",
|
|
26
|
+
"@nestjs/core": "^10.0.0 || ^11.0.0",
|
|
27
|
+
"mongodb": "^6.15.0",
|
|
28
28
|
"reflect-metadata": "^0.1.12 || ^0.2.0",
|
|
29
29
|
"rxjs": "^7.2.0"
|
|
30
30
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"class-transformer": "^0.5.1",
|
|
33
33
|
"es-toolkit": "^1.32.0",
|
|
34
34
|
"tslib": "^2.3.0",
|
|
35
|
-
"@event-nest/core": "
|
|
35
|
+
"@event-nest/core": "4.0.1"
|
|
36
36
|
},
|
|
37
37
|
"types": "./src/index.d.ts",
|
|
38
38
|
"main": "./src/index.js"
|
|
@@ -17,7 +17,7 @@ class ModuleProviders {
|
|
|
17
17
|
inject: [core_1.DomainEventEmitter],
|
|
18
18
|
provide: core_1.EVENT_STORE,
|
|
19
19
|
useFactory: (eventEmitter) => {
|
|
20
|
-
return new mongo_event_store_1.MongoEventStore(eventEmitter, new mongodb_1.MongoClient(options.connectionUri), options.aggregatesCollection, options.eventsCollection);
|
|
20
|
+
return new mongo_event_store_1.MongoEventStore(eventEmitter, new mongodb_1.MongoClient(options.connectionUri, options.mongoClientConfiguration), options.aggregatesCollection, options.eventsCollection);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
];
|
|
@@ -41,7 +41,7 @@ class ModuleProviders {
|
|
|
41
41
|
inject: ["EVENT_NEST_OPTIONS", core_1.DomainEventEmitter],
|
|
42
42
|
provide: core_1.EVENT_STORE,
|
|
43
43
|
useFactory: (options, eventBus) => {
|
|
44
|
-
const mongoClient = new mongodb_1.MongoClient(options.connectionUri);
|
|
44
|
+
const mongoClient = new mongodb_1.MongoClient(options.connectionUri, options.mongoClientConfiguration);
|
|
45
45
|
return new mongo_event_store_1.MongoEventStore(eventBus, mongoClient, options.aggregatesCollection, options.eventsCollection);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-providers.js","sourceRoot":"","sources":["../../../../../libs/mongodb/src/lib/module-providers.ts"],"names":[],"mappings":";;;AAAA,2CAAmE;AAEnE,qCAAsC;AAItC,mEAA8D;AAE9D,MAAa,eAAe;IACxB,MAAM,CAAC,MAAM,CAAC,OAA6B;QACvC,OAAO;YACH;gBACI,OAAO,EAAE,yBAAkB;gBAC3B,UAAU,EAAE,GAAG,EAAE;oBACb,OAAO,IAAI,yBAAkB,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;gBACnE,CAAC;aACJ;YACD;gBACI,MAAM,EAAE,CAAC,yBAAkB,CAAC;gBAC5B,OAAO,EAAE,kBAAW;gBACpB,UAAU,EAAE,CAAC,YAAgC,EAAE,EAAE;oBAC7C,OAAO,IAAI,mCAAe,CACtB,YAAY,EACZ,IAAI,qBAAW,CAAC,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"module-providers.js","sourceRoot":"","sources":["../../../../../libs/mongodb/src/lib/module-providers.ts"],"names":[],"mappings":";;;AAAA,2CAAmE;AAEnE,qCAAsC;AAItC,mEAA8D;AAE9D,MAAa,eAAe;IACxB,MAAM,CAAC,MAAM,CAAC,OAA6B;QACvC,OAAO;YACH;gBACI,OAAO,EAAE,yBAAkB;gBAC3B,UAAU,EAAE,GAAG,EAAE;oBACb,OAAO,IAAI,yBAAkB,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;gBACnE,CAAC;aACJ;YACD;gBACI,MAAM,EAAE,CAAC,yBAAkB,CAAC;gBAC5B,OAAO,EAAE,kBAAW;gBACpB,UAAU,EAAE,CAAC,YAAgC,EAAE,EAAE;oBAC7C,OAAO,IAAI,mCAAe,CACtB,YAAY,EACZ,IAAI,qBAAW,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,wBAAwB,CAAC,EACxE,OAAO,CAAC,oBAAoB,EAC5B,OAAO,CAAC,gBAAgB,CAC3B,CAAC;gBACN,CAAC;aACJ;SACJ,CAAC;IACN,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,OAAkC;QACjD,MAAM,eAAe,GAAG;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,oBAAoB;YAC7B,UAAU,EAAE,KAAK,EAAE,GAAG,UAAqB,EAAE,EAAE;gBAC3C,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC;YACnD,CAAC;SACJ,CAAC;QAEF,MAAM,gBAAgB,GAAG;YACrB,MAAM,EAAE,CAAC,oBAAoB,CAAC;YAC9B,OAAO,EAAE,yBAAkB;YAC3B,UAAU,EAAE,CAAC,OAA6B,EAAE,EAAE;gBAC1C,OAAO,IAAI,yBAAkB,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;YACnE,CAAC;SACJ,CAAC;QAEF,MAAM,kBAAkB,GAAG;YACvB,MAAM,EAAE,CAAC,oBAAoB,EAAE,yBAAkB,CAAC;YAClD,OAAO,EAAE,kBAAW;YACpB,UAAU,EAAE,CAAC,OAA6B,EAAE,QAA4B,EAAE,EAAE;gBACxE,MAAM,WAAW,GAAG,IAAI,qBAAW,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;gBAC7F,OAAO,IAAI,mCAAe,CACtB,QAAQ,EACR,WAAW,EACX,OAAO,CAAC,oBAAoB,EAC5B,OAAO,CAAC,gBAAgB,CAC3B,CAAC;YACN,CAAC;SACJ,CAAC;QAEF,OAAO,CAAC,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;IACnE,CAAC;CACJ;AAzDD,0CAyDC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CoreModuleOptions } from "@event-nest/core";
|
|
2
|
+
import { MongoClientOptions } from "mongodb";
|
|
2
3
|
export interface MongoDbModuleAsyncOptions {
|
|
3
4
|
inject?: any[];
|
|
4
5
|
useFactory: (...parameters: any[]) => MongodbModuleOptions | Promise<MongodbModuleOptions>;
|
|
@@ -16,4 +17,10 @@ export interface MongodbModuleOptions extends CoreModuleOptions {
|
|
|
16
17
|
* The name of the collection which will be used to store the event objects
|
|
17
18
|
*/
|
|
18
19
|
eventsCollection: string;
|
|
20
|
+
/**
|
|
21
|
+
* Configuration options for the MongoDB client.
|
|
22
|
+
* The options follow the MongoDB Node.js driver options, and they will
|
|
23
|
+
* be passed to the MongoClient constructor.
|
|
24
|
+
*/
|
|
25
|
+
mongoClientConfiguration?: MongoClientOptions;
|
|
19
26
|
}
|