@event-nest/mongodb 3.1.0 → 3.2.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.1.0",
3
+ "version": "3.2.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",
@@ -31,7 +31,8 @@
31
31
  "dependencies": {
32
32
  "class-transformer": "^0.5.1",
33
33
  "tslib": "^2.3.0",
34
- "@event-nest/core": "3.1.0"
34
+ "@event-nest/core": "3.2.1"
35
35
  },
36
- "main": "./src/index.js"
36
+ "main": "./src/index.js",
37
+ "types": "./src/index.d.ts"
37
38
  }
package/src/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./lib/event-nest-mongodb.module";
2
2
  export * from "./lib/mongodb-module-options";
3
+ export * from "./lib/storage/mongo-event-store";
package/src/index.js CHANGED
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./lib/event-nest-mongodb.module"), exports);
5
5
  tslib_1.__exportStar(require("./lib/mongodb-module-options"), exports);
6
+ tslib_1.__exportStar(require("./lib/storage/mongo-event-store"), exports);
6
7
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/mongodb/src/index.ts"],"names":[],"mappings":";;;AAAA,0EAAgD;AAChD,uEAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/mongodb/src/index.ts"],"names":[],"mappings":";;;AAAA,0EAAgD;AAChD,uEAA6C;AAC7C,0EAAgD"}
@@ -6,7 +6,29 @@ export declare class EventNestMongoDbModule implements OnApplicationBootstrap {
6
6
  private readonly _eventEmitter;
7
7
  private readonly _modulesContainer;
8
8
  constructor(_eventEmitter: DomainEventEmitter, _modulesContainer: ModulesContainer);
9
+ /**
10
+ * Registers the event-nest module globally with the provided options. The exported providers will be available
11
+ * across the application without having to import the module more than once.
12
+ * @param options The options to configure the PostgreSQL connection.
13
+ */
14
+ static forRoot(options: MongodbModuleOptions): DynamicModule;
15
+ /**
16
+ * Registers the event-nest module globally with the provided options. The exported providers will be available
17
+ * across the application without having to import the module more than once.
18
+ * @param options An options object which includes the factory that should be called to resolve the final module options.
19
+ */
20
+ static forRootAsync(options: MongoDbModuleAsyncOptions): DynamicModule;
21
+ /**
22
+ * Registers the event-nest module with the provided options. The exported providers will be available only for the
23
+ * module that imports this module.
24
+ * @param options The options to configure the PostgreSQL connection.
25
+ */
9
26
  static register(options: MongodbModuleOptions): DynamicModule;
27
+ /**
28
+ * Registers the event-nest module with the provided options. The exported providers will be available only for the
29
+ * module that imports this module.
30
+ * @param options An options object which includes the factory that should be called to resolve the final module options.
31
+ */
10
32
  static registerAsync(options: MongoDbModuleAsyncOptions): DynamicModule;
11
33
  onApplicationBootstrap(): void;
12
34
  }
@@ -12,16 +12,54 @@ let EventNestMongoDbModule = EventNestMongoDbModule_1 = class EventNestMongoDbMo
12
12
  this._eventEmitter = _eventEmitter;
13
13
  this._modulesContainer = _modulesContainer;
14
14
  }
15
+ /**
16
+ * Registers the event-nest module globally with the provided options. The exported providers will be available
17
+ * across the application without having to import the module more than once.
18
+ * @param options The options to configure the PostgreSQL connection.
19
+ */
20
+ static forRoot(options) {
21
+ return {
22
+ exports: [core_1.EVENT_STORE],
23
+ global: true,
24
+ module: EventNestMongoDbModule_1,
25
+ providers: module_providers_1.ModuleProviders.create(options)
26
+ };
27
+ }
28
+ /**
29
+ * Registers the event-nest module globally with the provided options. The exported providers will be available
30
+ * across the application without having to import the module more than once.
31
+ * @param options An options object which includes the factory that should be called to resolve the final module options.
32
+ */
33
+ static forRootAsync(options) {
34
+ return {
35
+ exports: [core_1.EVENT_STORE],
36
+ global: true,
37
+ module: EventNestMongoDbModule_1,
38
+ providers: module_providers_1.ModuleProviders.createAsync(options)
39
+ };
40
+ }
41
+ /**
42
+ * Registers the event-nest module with the provided options. The exported providers will be available only for the
43
+ * module that imports this module.
44
+ * @param options The options to configure the PostgreSQL connection.
45
+ */
15
46
  static register(options) {
16
47
  return {
17
48
  exports: [core_1.EVENT_STORE],
49
+ global: false,
18
50
  module: EventNestMongoDbModule_1,
19
51
  providers: module_providers_1.ModuleProviders.create(options)
20
52
  };
21
53
  }
54
+ /**
55
+ * Registers the event-nest module with the provided options. The exported providers will be available only for the
56
+ * module that imports this module.
57
+ * @param options An options object which includes the factory that should be called to resolve the final module options.
58
+ */
22
59
  static registerAsync(options) {
23
60
  return {
24
61
  exports: [core_1.EVENT_STORE],
62
+ global: false,
25
63
  module: EventNestMongoDbModule_1,
26
64
  providers: module_providers_1.ModuleProviders.createAsync(options)
27
65
  };
@@ -32,7 +70,6 @@ let EventNestMongoDbModule = EventNestMongoDbModule_1 = class EventNestMongoDbMo
32
70
  };
33
71
  exports.EventNestMongoDbModule = EventNestMongoDbModule;
34
72
  exports.EventNestMongoDbModule = EventNestMongoDbModule = EventNestMongoDbModule_1 = tslib_1.__decorate([
35
- (0, common_1.Global)(),
36
73
  (0, common_1.Module)({}),
37
74
  tslib_1.__metadata("design:paramtypes", [core_1.DomainEventEmitter,
38
75
  core_2.ModulesContainer])
@@ -1 +1 @@
1
- {"version":3,"file":"event-nest-mongodb.module.js","sourceRoot":"","sources":["../../../../../libs/mongodb/src/lib/event-nest-mongodb.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAmE;AACnE,2CAAuF;AACvF,uCAAgD;AAEhD,yDAAqD;AAK9C,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAC/B,YACqB,aAAiC,EACjC,iBAAmC;QADnC,kBAAa,GAAb,aAAa,CAAoB;QACjC,sBAAiB,GAAjB,iBAAiB,CAAkB;IACrD,CAAC;IAEJ,MAAM,CAAC,QAAQ,CAAC,OAA6B;QACzC,OAAO;YACH,OAAO,EAAE,CAAC,kBAAW,CAAC;YACtB,MAAM,EAAE,wBAAsB;YAC9B,SAAS,EAAE,kCAAe,CAAC,MAAM,CAAC,OAAO,CAAC;SAC7C,CAAC;IACN,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,OAAkC;QACnD,OAAO;YACH,OAAO,EAAE,CAAC,kBAAW,CAAC;YACtB,MAAM,EAAE,wBAAsB;YAC9B,SAAS,EAAE,kCAAe,CAAC,WAAW,CAAC,OAAO,CAAC;SAClD,CAAC;IACN,CAAC;IAED,sBAAsB;QAClB,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACjE,CAAC;CACJ,CAAA;AAzBY,wDAAsB;iCAAtB,sBAAsB;IAFlC,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC,EAAE,CAAC;6CAG6B,yBAAkB;QACd,uBAAgB;GAH/C,sBAAsB,CAyBlC"}
1
+ {"version":3,"file":"event-nest-mongodb.module.js","sourceRoot":"","sources":["../../../../../libs/mongodb/src/lib/event-nest-mongodb.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAmE;AACnE,2CAAuF;AACvF,uCAAgD;AAEhD,yDAAqD;AAI9C,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAC/B,YACqB,aAAiC,EACjC,iBAAmC;QADnC,kBAAa,GAAb,aAAa,CAAoB;QACjC,sBAAiB,GAAjB,iBAAiB,CAAkB;IACrD,CAAC;IAEJ;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,OAA6B;QACxC,OAAO;YACH,OAAO,EAAE,CAAC,kBAAW,CAAC;YACtB,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,wBAAsB;YAC9B,SAAS,EAAE,kCAAe,CAAC,MAAM,CAAC,OAAO,CAAC;SAC7C,CAAC;IACN,CAAC;IAED;;;;OAIG;IACH,MA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