@mavenmachines/event-handler-lib 1.4.5-7 → 1.4.5-8

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mavenmachines/event-handler-lib",
3
- "version": "1.4.5-7",
3
+ "version": "1.4.5-8",
4
4
  "description": "Helper libraries for creating an Event Handler",
5
5
  "module": "./dist/src/index.mjs",
6
6
  "types": "./dist/src/index.d.ts",
@@ -8,10 +8,4 @@ export declare abstract class SyncReferenceIdsPlugin<ProjectionT extends Record<
8
8
  protected getExistingReferenceIds(projection: EventSourcedProjection<ProjectionT>): Promise<Record<string, ReferenceIdsType>>;
9
9
  abstract createReferenceIds(projection: EventSourcedProjection<ProjectionT>): Promise<Record<string, ReferenceIdsType>>;
10
10
  setReferenceIds(projection: EventSourcedProjection<ProjectionT>, previous: Record<string, ReferenceIdsType>, updated: Record<string, ReferenceIdsType>): Promise<Record<string, ReferenceIdsType>>;
11
- onCreate(projection: EventSourcedProjection<ProjectionT>): Promise<Record<string, ReferenceIdsType>>;
12
- onUpdate(projection: EventSourcedProjection<ProjectionT>): Promise<Record<string, ReferenceIdsType>>;
13
- onDelete(projection: EventSourcedProjection<ProjectionT>): Promise<Record<string, ReferenceIdsType>>;
14
- rollbackOnCreate(projection: EventSourcedProjection<ProjectionT>, data: Record<string, ReferenceIdsType>): Promise<void>;
15
- rollbackOnUpdate(projection: EventSourcedProjection<ProjectionT>, data: Record<string, ReferenceIdsType>): Promise<void>;
16
- rollbackOnDelete(projection: EventSourcedProjection<ProjectionT>, data: Record<string, ReferenceIdsType>): Promise<void>;
17
11
  }
@@ -26,31 +26,6 @@ let SyncReferenceIdsPlugin = class SyncReferenceIdsPlugin extends projectionModi
26
26
  async setReferenceIds(projection, previous, updated) {
27
27
  return updated;
28
28
  }
29
- async onCreate(projection) {
30
- const existingReferenceIds = await this.getExistingReferenceIds(projection);
31
- return this.setReferenceIds(projection, {}, existingReferenceIds);
32
- }
33
- async onUpdate(projection) {
34
- const existingReferenceIds = await this.getExistingReferenceIds(projection);
35
- const newReferenceIds = await this.createReferenceIds(projection);
36
- return this.setReferenceIds(projection, existingReferenceIds, newReferenceIds);
37
- }
38
- async onDelete(projection) {
39
- const existingReferenceIds = await this.getExistingReferenceIds(projection);
40
- return this.setReferenceIds(projection, existingReferenceIds, {});
41
- }
42
- async rollbackOnCreate(projection, data) {
43
- const existingReferenceIds = await this.getExistingReferenceIds(projection);
44
- this.setReferenceIds(projection, existingReferenceIds, data);
45
- }
46
- async rollbackOnUpdate(projection, data) {
47
- const existingReferenceIds = await this.getExistingReferenceIds(projection);
48
- this.setReferenceIds(projection, existingReferenceIds, data);
49
- }
50
- async rollbackOnDelete(projection, data) {
51
- const existingReferenceIds = await this.getExistingReferenceIds(projection);
52
- this.setReferenceIds(projection, existingReferenceIds, data);
53
- }
54
29
  };
55
30
  exports.SyncReferenceIdsPlugin = SyncReferenceIdsPlugin;
56
31
  exports.SyncReferenceIdsPlugin = SyncReferenceIdsPlugin = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"syncReferencIdsPlugin.js","sourceRoot":"","sources":["../../../../src/helpers/plugins/syncReferencIdsPlugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAWA,yEAAsE;AACtE,2CAIuB;AAEvB,yCAA+C;AAIxC,IAAe,sBAAsB,GAArC,MAAe,sBAEpB,SAAQ,mDAGT;IACC,YACyB,aAA4B;QAInD,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAMS,KAAK,CAAC,uBAAuB,CACrC,UAA+C;QAoB/C,OAAO,EAAE,CAAC;IACZ,CAAC;IAMD,KAAK,CAAC,eAAe,CACnB,UAA+C,EAC/C,QAA0C,EAC1C,OAAyC;QAiDzC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,UAA+C;QAE/C,MAAM,oBAAoB,GAAG,MAA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AC,UAAU,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;CACF,CAAA;AAtJqB,wDAAsB;iCAAtB,sBAAsB;IAD3C,IAAA,sBAAU,GAAE;IAQR,WAAA,IAAA,kBAAM,EAAC,uBAAa,CAAC,CAAA;qCAAgB,uBAAa;GAPjC,sBAAsB,CAsJ3C"}
1
+ {"version":3,"file":"syncReferencIdsPlugin.js","sourceRoot":"","sources":["../../../../src/helpers/plugins/syncReferencIdsPlugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAWA,yEAAsE;AACtE,2CAIuB;AAEvB,yCAA+C;AAIxC,IAAe,sBAAsB,GAArC,MAAe,sBAEpB,SAAQ,mDAGT;IACC,YACyB,aAA4B;QAInD,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAMS,KAAK,CAAC,uBAAuB,CACrC,UAA+C;QAoB/C,OAAO,EAAE,CAAC;IACZ,CAAC;IAMD,KAAK,CAAC,eAAe,CACnB,UAA+C,EAC/C,QAA0C,EAC1C,OAAyC;QAiDzC,OAAO,OAAO,CAAC;IACjB,CAAC;CAmDF,CAAA;AAtJqB,wDAAsB;iCAAtB,sBAAsB;IAD3C,IAAA,sBAAU,GAAE;IAQR,WAAA,IAAA,kBAAM,EAAC,uBAAa,CAAC,CAAA;qCAAgB,uBAAa;GAPjC,sBAAsB,CAsJ3C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mavenmachines/event-handler-lib",
3
- "version": "1.4.5-7",
3
+ "version": "1.4.5-8",
4
4
  "description": "Helper libraries for creating an Event Handler",
5
5
  "module": "./dist/src/index.mjs",
6
6
  "types": "./dist/src/index.d.ts",