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

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-9",
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",
@@ -1,17 +1,6 @@
1
1
  import { EsReferenceIdsType } from "@mavenmachines/event-sourcing-types";
2
- import { GetAggregateReferencesRequest } from "@mavenmachines/es-references-store-client";
3
2
  import { ProjectionModifierPlugin } from "./projectionModifierPlugin";
4
- import { EventSourcedProjection, LoggerService, ReferenceIdsType } from "../../exports";
3
+ import { LoggerService } from "../../exports";
5
4
  export declare abstract class SyncReferenceIdsPlugin<ProjectionT extends Record<string, any>> extends ProjectionModifierPlugin<ProjectionT, Record<string, EsReferenceIdsType>> {
6
5
  constructor(loggerService: LoggerService);
7
- abstract createGetAggregateReferenceRequests(projection: EventSourcedProjection<ProjectionT>): GetAggregateReferencesRequest[];
8
- protected getExistingReferenceIds(projection: EventSourcedProjection<ProjectionT>): Promise<Record<string, ReferenceIdsType>>;
9
- abstract createReferenceIds(projection: EventSourcedProjection<ProjectionT>): Promise<Record<string, ReferenceIdsType>>;
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
6
  }
@@ -20,37 +20,6 @@ let SyncReferenceIdsPlugin = class SyncReferenceIdsPlugin extends projectionModi
20
20
  constructor(loggerService) {
21
21
  super(loggerService);
22
22
  }
23
- async getExistingReferenceIds(projection) {
24
- return {};
25
- }
26
- async setReferenceIds(projection, previous, updated) {
27
- return updated;
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
23
  };
55
24
  exports.SyncReferenceIdsPlugin = SyncReferenceIdsPlugin;
56
25
  exports.SyncReferenceIdsPlugin = SyncReferenceIdsPlugin = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"syncReferencIdsPlugin.js","sourceRoot":"","sources":["../../../../src/helpers/plugins/syncReferencIdsPlugin.ts"],"names":[],"mappings":";;;;;;;;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E,oBAAoB,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,gBAAgB,CACpB,UAA+C,EAC/C,IAAsC;QAEtC,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QAC5E,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,gBAAgB,CACpB,UAA+C,EAC/C,IAAsC;QAEtC,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;QAC5E,IAAI,CAAC,eAAe,CAAC,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;CA0IF,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-9",
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",