@koalarx/nest 3.1.31 → 3.1.33

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.
@@ -9,9 +9,10 @@ export declare class EventQueue {
9
9
  static register(callback: EventJobCallback, handlerClassName: string, eventClassName: string): void;
10
10
  static clearHandlers(): void;
11
11
  static clearMarkedAggregates(): void;
12
+ static findMarkedAggregateByID(id: IComparableId): EventJob<any> | undefined;
13
+ static getMarkedAggregates(): EventJob<any>[];
12
14
  private static dispatchAggregateEvents;
13
15
  private static removeAggregateFromMarkedDispatchList;
14
- private static findMarkedAggregateByID;
15
16
  private static dispatch;
16
17
  }
17
18
  export {};
@@ -34,6 +34,12 @@ class EventQueue {
34
34
  static clearMarkedAggregates() {
35
35
  this.markedAggregates = [];
36
36
  }
37
+ static findMarkedAggregateByID(id) {
38
+ return this.markedAggregates.find((aggregate) => aggregate._id === id);
39
+ }
40
+ static getMarkedAggregates() {
41
+ return this.markedAggregates;
42
+ }
37
43
  static dispatchAggregateEvents(aggregate) {
38
44
  aggregate.eventQueue.forEach((event) => this.dispatch(event));
39
45
  }
@@ -41,9 +47,6 @@ class EventQueue {
41
47
  const index = this.markedAggregates.findIndex((a) => a._id === aggregate._id);
42
48
  this.markedAggregates.splice(index, 1);
43
49
  }
44
- static findMarkedAggregateByID(id) {
45
- return this.markedAggregates.find((aggregate) => aggregate._id === id);
46
- }
47
50
  static dispatch(event) {
48
51
  const eventJobHandlers = this.markedAggregates.find((a) => a.eventQueue.find((e) => e === event));
49
52
  const eventHandler = Object.keys(this.handlersMap).find((handlerName) => eventJobHandlers
@@ -386,7 +386,7 @@ class RepositoryBase {
386
386
  return Promise.all([]);
387
387
  }
388
388
  return Promise.all(relationCreate.relations.map((relation) => {
389
- const relationPropName = this.getPropNameFromEntitySource(relation, relationCreate.entityInstance);
389
+ const relationPropName = this.getPropNameFromEntitySource(relation.constructor, relationCreate.entityInstance);
390
390
  if (relationPropName &&
391
391
  !(relation[relationPropName] instanceof list_1.List)) {
392
392
  relation[relationPropName] =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalarx/nest",
3
- "version": "3.1.31",
3
+ "version": "3.1.33",
4
4
  "description": "",
5
5
  "author": "Igor D. Rangel",
6
6
  "license": "MIT",