@zeeshan60/event-processor 1.0.14 → 1.0.16

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.
Files changed (148) hide show
  1. package/README.md +29 -22
  2. package/dist/ActivityEventHandler.d.ts +5 -6
  3. package/dist/ActivityEventHandler.d.ts.map +1 -1
  4. package/dist/ActivityEventHandler.js +16 -8
  5. package/dist/ActivityLogEvents.d.ts.map +1 -1
  6. package/dist/BaseEventHandler.d.ts +8 -0
  7. package/dist/BaseEventHandler.d.ts.map +1 -0
  8. package/dist/BaseEventHandler.js +13 -0
  9. package/dist/EventProcessorSDK.d.ts +10 -2
  10. package/dist/EventProcessorSDK.d.ts.map +1 -1
  11. package/dist/EventProcessorSDK.js +21 -5
  12. package/dist/FriendEventHandler.d.ts +6 -2
  13. package/dist/FriendEventHandler.d.ts.map +1 -1
  14. package/dist/FriendEventHandler.js +50 -45
  15. package/dist/GroupEventHandler.d.ts +5 -8
  16. package/dist/GroupEventHandler.d.ts.map +1 -1
  17. package/dist/GroupEventHandler.js +241 -186
  18. package/dist/GroupEvents.d.ts.map +1 -1
  19. package/dist/GroupTransactionEventHandler.d.ts +3 -2
  20. package/dist/GroupTransactionEventHandler.d.ts.map +1 -1
  21. package/dist/GroupTransactionEventHandler.js +11 -10
  22. package/dist/GroupTransactionEvents.d.ts.map +1 -1
  23. package/dist/ModelChangeEmitter.d.ts +1 -1
  24. package/dist/ModelChangeEmitter.d.ts.map +1 -1
  25. package/dist/TransactionEventHandler.d.ts +5 -5
  26. package/dist/TransactionEventHandler.d.ts.map +1 -1
  27. package/dist/TransactionEventHandler.js +19 -30
  28. package/dist/TransactionEvents.d.ts.map +1 -1
  29. package/dist/UserEventHandler.d.ts +4 -3
  30. package/dist/UserEventHandler.d.ts.map +1 -1
  31. package/dist/UserEventHandler.js +16 -40
  32. package/dist/UserEvents.d.ts.map +1 -1
  33. package/dist/__tests__/test-helpers/IMActivityLogEventStore.d.ts +1 -2
  34. package/dist/__tests__/test-helpers/IMActivityLogEventStore.d.ts.map +1 -1
  35. package/dist/__tests__/test-helpers/IMActivityLogModelStore.d.ts +1 -2
  36. package/dist/__tests__/test-helpers/IMActivityLogModelStore.d.ts.map +1 -1
  37. package/dist/__tests__/test-helpers/IMCurrencyStore.d.ts +8 -0
  38. package/dist/__tests__/test-helpers/IMCurrencyStore.d.ts.map +1 -0
  39. package/dist/__tests__/test-helpers/IMCurrencyStore.js +16 -0
  40. package/dist/__tests__/test-helpers/IMFriendEventStore.d.ts +1 -2
  41. package/dist/__tests__/test-helpers/IMFriendEventStore.d.ts.map +1 -1
  42. package/dist/__tests__/test-helpers/IMFriendModelStore.d.ts +1 -2
  43. package/dist/__tests__/test-helpers/IMFriendModelStore.d.ts.map +1 -1
  44. package/dist/__tests__/test-helpers/IMGroupEventStore.d.ts +1 -2
  45. package/dist/__tests__/test-helpers/IMGroupEventStore.d.ts.map +1 -1
  46. package/dist/__tests__/test-helpers/IMGroupModelStore.d.ts +1 -2
  47. package/dist/__tests__/test-helpers/IMGroupModelStore.d.ts.map +1 -1
  48. package/dist/__tests__/test-helpers/IMGroupTransactionEventStore.d.ts +1 -2
  49. package/dist/__tests__/test-helpers/IMGroupTransactionEventStore.d.ts.map +1 -1
  50. package/dist/__tests__/test-helpers/IMGroupTransactionModelStore.d.ts +1 -2
  51. package/dist/__tests__/test-helpers/IMGroupTransactionModelStore.d.ts.map +1 -1
  52. package/dist/__tests__/test-helpers/IMTransactionEventStore.d.ts +1 -2
  53. package/dist/__tests__/test-helpers/IMTransactionEventStore.d.ts.map +1 -1
  54. package/dist/__tests__/test-helpers/IMTransactionModelStore.d.ts +3 -2
  55. package/dist/__tests__/test-helpers/IMTransactionModelStore.d.ts.map +1 -1
  56. package/dist/__tests__/test-helpers/IMTransactionModelStore.js +20 -0
  57. package/dist/__tests__/test-helpers/IMUserEventStore.d.ts +1 -2
  58. package/dist/__tests__/test-helpers/IMUserEventStore.d.ts.map +1 -1
  59. package/dist/__tests__/test-helpers/IMUserModelStore.d.ts +4 -2
  60. package/dist/__tests__/test-helpers/IMUserModelStore.d.ts.map +1 -1
  61. package/dist/__tests__/test-helpers/IMUserModelStore.js +10 -0
  62. package/dist/client/controllers/FriendController.d.ts +4 -0
  63. package/dist/client/controllers/FriendController.d.ts.map +1 -1
  64. package/dist/client/controllers/FriendController.js +45 -15
  65. package/dist/client/controllers/TransactionController.d.ts +18 -0
  66. package/dist/client/controllers/TransactionController.d.ts.map +1 -0
  67. package/dist/client/controllers/TransactionController.js +275 -0
  68. package/dist/client/handlers/UIEventHandler.d.ts +0 -1
  69. package/dist/client/handlers/UIEventHandler.d.ts.map +1 -1
  70. package/dist/client/handlers/UIEventHandler.js +4 -62
  71. package/dist/common/CurrencyRate.d.ts +7 -0
  72. package/dist/common/CurrencyRate.d.ts.map +1 -0
  73. package/dist/common/CurrencyRate.js +2 -0
  74. package/dist/common/DomainEvents.d.ts +0 -70
  75. package/dist/common/DomainEvents.d.ts.map +1 -1
  76. package/dist/common/DomainEvents.js +0 -89
  77. package/dist/contracts/expenses/index.d.ts.map +1 -1
  78. package/dist/contracts/friends/index.d.ts +1 -9
  79. package/dist/contracts/friends/index.d.ts.map +1 -1
  80. package/dist/contracts/groups/index.d.ts.map +1 -1
  81. package/dist/contracts/transactions/index.d.ts +1 -1
  82. package/dist/contracts/transactions/index.d.ts.map +1 -1
  83. package/dist/converters/ActivityLogConverters.d.ts +9 -0
  84. package/dist/converters/ActivityLogConverters.d.ts.map +1 -0
  85. package/dist/converters/ActivityLogConverters.js +39 -0
  86. package/dist/converters/EventConverterCore.d.ts +67 -0
  87. package/dist/converters/EventConverterCore.d.ts.map +1 -0
  88. package/dist/converters/EventConverterCore.js +59 -0
  89. package/dist/converters/FriendConverters.d.ts +33 -0
  90. package/dist/converters/FriendConverters.d.ts.map +1 -0
  91. package/dist/converters/FriendConverters.js +142 -0
  92. package/dist/converters/GroupConverters.d.ts +39 -0
  93. package/dist/converters/GroupConverters.d.ts.map +1 -0
  94. package/dist/converters/GroupConverters.js +160 -0
  95. package/dist/converters/GroupTransactionConverters.d.ts +57 -0
  96. package/dist/converters/GroupTransactionConverters.d.ts.map +1 -0
  97. package/dist/converters/GroupTransactionConverters.js +249 -0
  98. package/dist/converters/TransactionConverters.d.ts +51 -0
  99. package/dist/converters/TransactionConverters.d.ts.map +1 -0
  100. package/dist/converters/TransactionConverters.js +234 -0
  101. package/dist/converters/UserConverters.d.ts +51 -0
  102. package/dist/converters/UserConverters.d.ts.map +1 -0
  103. package/dist/converters/UserConverters.js +226 -0
  104. package/dist/converters/eventConverter.d.ts +10 -15
  105. package/dist/converters/eventConverter.d.ts.map +1 -1
  106. package/dist/converters/eventConverter.js +96 -377
  107. package/dist/environment.d.ts +12 -0
  108. package/dist/environment.d.ts.map +1 -0
  109. package/dist/environment.js +50 -0
  110. package/dist/events.d.ts +2 -1
  111. package/dist/events.d.ts.map +1 -1
  112. package/dist/events.js +7 -3
  113. package/dist/index.d.ts +7 -7
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +13 -31
  116. package/dist/store/ActivityLogModelStore.d.ts.map +1 -1
  117. package/dist/store/CurrencyStore.d.ts +5 -0
  118. package/dist/store/CurrencyStore.d.ts.map +1 -0
  119. package/dist/store/CurrencyStore.js +6 -0
  120. package/dist/store/FriendModelStore.d.ts.map +1 -1
  121. package/dist/store/GroupModelStore.d.ts.map +1 -1
  122. package/dist/store/GroupTransactionModelStore.d.ts.map +1 -1
  123. package/dist/store/TransactionModelStore.d.ts +2 -0
  124. package/dist/store/TransactionModelStore.d.ts.map +1 -1
  125. package/dist/store/UserModelStore.d.ts +1 -0
  126. package/dist/store/UserModelStore.d.ts.map +1 -1
  127. package/dist/utils/BalanceUtil.d.ts +13 -0
  128. package/dist/utils/BalanceUtil.d.ts.map +1 -0
  129. package/dist/utils/BalanceUtil.js +97 -0
  130. package/package.json +1 -1
  131. package/dist/client/handlers/UIFriendEventHandler.d.ts +0 -16
  132. package/dist/client/handlers/UIFriendEventHandler.d.ts.map +0 -1
  133. package/dist/client/handlers/UIFriendEventHandler.js +0 -27
  134. package/dist/client/handlers/UIGroupEventHandler.d.ts +0 -18
  135. package/dist/client/handlers/UIGroupEventHandler.d.ts.map +0 -1
  136. package/dist/client/handlers/UIGroupEventHandler.js +0 -28
  137. package/dist/client/handlers/UIGroupTransactionEventHandler.d.ts +0 -18
  138. package/dist/client/handlers/UIGroupTransactionEventHandler.d.ts.map +0 -1
  139. package/dist/client/handlers/UIGroupTransactionEventHandler.js +0 -28
  140. package/dist/client/handlers/UITransactionEventHandler.d.ts +0 -14
  141. package/dist/client/handlers/UITransactionEventHandler.d.ts.map +0 -1
  142. package/dist/client/handlers/UITransactionEventHandler.js +0 -26
  143. package/dist/client/handlers/UIUserEventHandler.d.ts +0 -12
  144. package/dist/client/handlers/UIUserEventHandler.d.ts.map +0 -1
  145. package/dist/client/handlers/UIUserEventHandler.js +0 -29
  146. package/dist/utils/userPathUtils.d.ts +0 -6
  147. package/dist/utils/userPathUtils.d.ts.map +0 -1
  148. package/dist/utils/userPathUtils.js +0 -16
package/README.md CHANGED
@@ -11,7 +11,7 @@ This package provides the core building blocks for implementing event sourcing p
11
11
  - **Base Interfaces**: `Event` and `Model` interfaces for type-safe event sourcing
12
12
  - **Abstract Stores**: `EventStore` and `ModelStore` base classes
13
13
  - **In-Memory Implementations**: Ready-to-use in-memory stores for testing
14
- - **Environment Configuration**: Detect and configure behavior based on runtime environment (Google Cloud Functions vs Client)
14
+ - **Runtime Context Detection**: `residence.isClient` flag to differentiate between client and server behavior
15
15
 
16
16
  ## Installation
17
17
 
@@ -103,40 +103,48 @@ const model = event.apply(null);
103
103
  await modelStore.save(model);
104
104
  ```
105
105
 
106
- ## Environment Configuration
106
+ ## Runtime Context Configuration
107
107
 
108
- The event-processor package includes environment detection to identify whether it's running in Google Cloud Functions or a client application. This enables environment-specific behavior.
108
+ The event-processor package uses the `residence.isClient` flag to differentiate between client and server execution contexts. This enables environment-specific behavior.
109
109
 
110
110
  ### Quick Start
111
111
 
112
112
  ```typescript
113
- import { EventProcessorSource, setEventProcessorSource, isGCFun, isClient } from '@zeeshan60/event-processor';
113
+ import { residence } from '@zeeshan60/event-processor';
114
114
 
115
- // Option 1: Set via environment variable (recommended)
116
- // export EVENT_PROCESSOR_SOURCE=GOOGLE_CLOUD_FUNCTION
115
+ // Client (Mobile App): No configuration needed - defaults to true
116
+ // The residence.isClient flag is true by default
117
117
 
118
- // Option 2: Set programmatically
119
- setEventProcessorSource(EventProcessorSource.GOOGLE_CLOUD_FUNCTION);
118
+ // Google Cloud Functions: Set explicitly to false
119
+ residence.isClient = false;
120
120
 
121
- // Check the environment
122
- if (isGCFun()) {
121
+ // Check the runtime context
122
+ if (residence.isClient) {
123
+ console.log('Running in client application');
124
+ } else {
123
125
  console.log('Running in Google Cloud Functions');
124
126
  }
127
+ ```
125
128
 
126
- if (isClient()) {
127
- console.log('Running in client application');
128
- }
129
+ ### Usage Pattern
130
+
131
+ **Client (Mobile App):**
132
+ ```typescript
133
+ // No setup needed - residence.isClient defaults to true
134
+ // Client creates events, applies to local models
129
135
  ```
130
136
 
131
- ### Available Helper Methods
137
+ **Google Cloud Functions:**
138
+ ```typescript
139
+ import { residence } from '@zeeshan60/event-processor';
140
+
141
+ // Set at function initialization
142
+ residence.isClient = false;
132
143
 
133
- - `isGCFun()`: Returns `true` if running in Google Cloud Functions
134
- - `isClient()`: Returns `true` if running in a client application
135
- - `isUnknown()`: Returns `true` if environment is not configured
136
- - `setEventProcessorSource(source)`: Set the environment programmatically
137
- - `getEventProcessorSource()`: Get the current environment
144
+ // Server processes events, creates mirror events for other users
145
+ ```
138
146
 
139
- For detailed environment configuration, see [ENVIRONMENT_CONFIG.md](./ENVIRONMENT_CONFIG.md).
147
+ For detailed context-specific behavior, see [DUAL_CONTEXT_FLOW.md](./DUAL_CONTEXT_FLOW.md).
140
148
 
141
149
  ## Documentation
142
150
 
@@ -145,7 +153,6 @@ For detailed environment configuration, see [ENVIRONMENT_CONFIG.md](./ENVIRONMEN
145
153
  - **[SDK_USAGE.md](./SDK_USAGE.md)** - 📦 Complete SDK initialization guide with examples and best practices
146
154
  - **[DUAL_CONTEXT_FLOW.md](./DUAL_CONTEXT_FLOW.md)** - 🎯 **START HERE!** Comprehensive guide explaining how the package operates in client vs Google Cloud Functions contexts, complete with diagrams and examples
147
155
  - **[QUICK_REFERENCE.md](./QUICK_REFERENCE.md)** - Quick reference cheat sheet for common patterns, troubleshooting, and best practices
148
- - **[ENVIRONMENT_CONFIG.md](./ENVIRONMENT_CONFIG.md)** - Environment configuration details
149
156
 
150
157
  ### Why Dual-Context Matters
151
158
 
@@ -167,7 +174,7 @@ Understanding when to create events vs when to process them is critical to avoid
167
174
  - **Model**: Base interface for all models/aggregates
168
175
  - **EventStore**: Abstract class for event persistence
169
176
  - **ModelStore**: Abstract class for model/read-model persistence
170
- - **EventProcessorSource**: Context detection (CLIENT vs GOOGLE_CLOUD_FUNCTION)
177
+ - **residence**: Runtime context object with `isClient` flag for client vs server detection
171
178
 
172
179
  ### Event Handlers
173
180
 
@@ -1,13 +1,12 @@
1
- import { Event, Model } from ".";
2
- import { ActivityLogModelStore } from ".";
3
- import { ActivityLogEventStore } from ".";
4
- import { UserModelStore } from ".";
5
- export declare class ActivityEventHandler {
1
+ import { ActivityLogEvent, ActivityLogEventStore, ActivityLogModelStore, Event, Model, UserModelStore } from ".";
2
+ import { BaseEventHandler } from "./BaseEventHandler";
3
+ export declare class ActivityEventHandler extends BaseEventHandler<ActivityLogEvent> {
6
4
  private activityLogModelStore;
7
5
  private activityLogEventStore;
8
6
  private userModelStore;
9
7
  constructor(activityLogModelStore: ActivityLogModelStore, activityLogEventStore: ActivityLogEventStore, userModelStore: UserModelStore);
10
- private shouldSkipSave;
11
8
  createActivityLog(event: Event, existingModel: Model | undefined, updatedModel: Model): Promise<void>;
9
+ handleClientEventFromRemoteListener(event: ActivityLogEvent): Promise<void>;
10
+ handleEvent(event: ActivityLogEvent): Promise<any>;
12
11
  }
13
12
  //# sourceMappingURL=ActivityEventHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActivityEventHandler.d.ts","sourceRoot":"","sources":["../src/ActivityEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAA+C,MAAM,GAAG,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,GAAG,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,GAAG,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAGnC,qBAAa,oBAAoB;IAEzB,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,cAAc;gBAFd,qBAAqB,EAAE,qBAAqB,EAC5C,qBAAqB,EAAE,qBAAqB,EAC5C,cAAc,EAAE,cAAc;IAG1C,OAAO,CAAC,cAAc;IAahB,iBAAiB,CACnB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,KAAK,GAAG,SAAS,EAChC,YAAY,EAAE,KAAK,GACpB,OAAO,CAAC,IAAI,CAAC;CAsCnB"}
1
+ {"version":3,"file":"ActivityEventHandler.d.ts","sourceRoot":"","sources":["../src/ActivityEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,gBAAgB,EAChB,qBAAqB,EAErB,qBAAqB,EACrB,KAAK,EACL,KAAK,EACL,cAAc,EACjB,MAAM,GAAG,CAAC;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,qBAAa,oBACT,SAAQ,gBAAgB,CAAC,gBAAgB,CAAC;IAGtC,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,cAAc;gBAFd,qBAAqB,EAAE,qBAAqB,EAC5C,qBAAqB,EAAE,qBAAqB,EAC5C,cAAc,EAAE,cAAc;IAKpC,iBAAiB,CACnB,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,KAAK,GAAG,SAAS,EAChC,YAAY,EAAE,KAAK,GACpB,OAAO,CAAC,IAAI,CAAC;IAuCV,mCAAmC,CACrC,KAAK,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC;IAehB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC;CAOrD"}
@@ -2,20 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActivityEventHandler = void 0;
4
4
  const _1 = require(".");
5
+ const BaseEventHandler_1 = require("./BaseEventHandler");
5
6
  const EventProcessorSDK_1 = require("./EventProcessorSDK");
6
- class ActivityEventHandler {
7
+ class ActivityEventHandler extends BaseEventHandler_1.BaseEventHandler {
7
8
  constructor(activityLogModelStore, activityLogEventStore, userModelStore) {
9
+ super();
8
10
  this.activityLogModelStore = activityLogModelStore;
9
11
  this.activityLogEventStore = activityLogEventStore;
10
12
  this.userModelStore = userModelStore;
11
13
  }
12
- shouldSkipSave(existingModel, updatedModel) {
13
- if (!existingModel) {
14
- return false;
15
- }
16
- return (existingModel.streamId === updatedModel.streamId &&
17
- existingModel.version === updatedModel.version);
18
- }
19
14
  async createActivityLog(event, existingModel, updatedModel) {
20
15
  if (!event.activityLog) {
21
16
  return;
@@ -44,5 +39,18 @@ class ActivityEventHandler {
44
39
  }
45
40
  }
46
41
  }
42
+ async handleClientEventFromRemoteListener(event) {
43
+ const existingModel = await this.activityLogModelStore.getByStreamIdWhereDeletedIsFalse(event.streamId);
44
+ const updatedModel = event.apply(existingModel);
45
+ if (!this.shouldSkipSave(existingModel, updatedModel)) {
46
+ await this.activityLogModelStore.save(updatedModel);
47
+ EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("ActivityLogModel", updatedModel);
48
+ }
49
+ }
50
+ handleEvent(event) {
51
+ const error = new Error("Method not implemented. ActivityEventHandler only support createActivityLog for this");
52
+ console.error("Method not implemented.", event, error);
53
+ throw error;
54
+ }
47
55
  }
48
56
  exports.ActivityEventHandler = ActivityEventHandler;
@@ -1 +1 @@
1
- {"version":3,"file":"ActivityLogEvents.d.ts","sourceRoot":"","sources":["../src/ActivityLogEvents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,oBAAY,UAAU;IAClB,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,gBAAgB,qBAAqB;CACxC;AAED,MAAM,WAAW,gBAAiB,SAAQ,KAAK;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;CAC5B;AAED,qBAAa,kBAAmB,YAAW,gBAAgB;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,IAAI,CAA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AM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;gBAEpB,KAAK,EAAE,uBAAuB;IAe1C,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,GAAG,gBAAgB;CAa7C"}
@@ -0,0 +1,8 @@
1
+ import { Event } from "./common/Event";
2
+ import { Model } from "./common/Model";
3
+ export declare abstract class BaseEventHandler<T extends Event> {
4
+ abstract handleEvent(event: T): Promise<any>;
5
+ abstract handleClientEventFromRemoteListener(event: T): Promise<void>;
6
+ protected shouldSkipSave(existingModel: Model | undefined, updatedModel: Model): boolean;
7
+ }
8
+ //# sourceMappingURL=BaseEventHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseEventHandler.d.ts","sourceRoot":"","sources":["../src/BaseEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,8BAAsB,gBAAgB,CAAC,CAAC,SAAS,KAAK;IAClD,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAC5C,QAAQ,CAAC,mCAAmC,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAErE,SAAS,CAAC,cAAc,CACpB,aAAa,EAAE,KAAK,GAAG,SAAS,EAChC,YAAY,EAAE,KAAK,GACpB,OAAO;CASb"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BaseEventHandler = void 0;
4
+ class BaseEventHandler {
5
+ shouldSkipSave(existingModel, updatedModel) {
6
+ if (!existingModel) {
7
+ return false;
8
+ }
9
+ return (existingModel.streamId === updatedModel.streamId &&
10
+ existingModel.version >= updatedModel.version);
11
+ }
12
+ }
13
+ exports.BaseEventHandler = BaseEventHandler;
@@ -10,13 +10,15 @@ import { GroupTransactionModelStore } from "./store/GroupTransactionModelStore";
10
10
  import { GroupTransactionEventStore } from "./store/GroupTransactionEventStore";
11
11
  import { ActivityLogModelStore } from "./store/ActivityLogModelStore";
12
12
  import { ActivityLogEventStore } from "./store/ActivityLogEventStore";
13
+ import { CurrencyStore } from "./store/CurrencyStore";
13
14
  import { UserController } from "./client/controllers/UserController";
14
15
  import { FriendController } from "./client/controllers/FriendController";
16
+ import { TransactionController } from "./client/controllers/TransactionController";
15
17
  import { UIEventHandler } from "./client/handlers/UIEventHandler";
16
18
  import { FirebaseAdapter } from "./adapters/FirebaseAdapter";
17
- import { Event, FriendEventHandler, UserEventHandler, TransactionEventHandler, GroupEventHandler, GroupTransactionEventHandler, ActivityEventHandler } from "./events";
18
- import { Model } from "./common/Model";
19
19
  import type { FirestoreEventData } from "./converters/eventConverter";
20
+ import { ActivityEventHandler, Event, FriendEventHandler, GroupEventHandler, GroupTransactionEventHandler, TransactionEventHandler, UserEventHandler } from "./events";
21
+ import { Model } from "./common/Model";
20
22
  import { ModelChange } from "./ModelChangeEmitter";
21
23
  import { Observable } from "rxjs";
22
24
  export type StoreConfig = {
@@ -33,12 +35,14 @@ export type StoreConfig = {
33
35
  groupTransactionEventStore: GroupTransactionEventStore;
34
36
  activityLogModelStore: ActivityLogModelStore;
35
37
  activityLogEventStore: ActivityLogEventStore;
38
+ currencyStore: CurrencyStore;
36
39
  };
37
40
  export declare class EventProcessorSDK {
38
41
  private static instance;
39
42
  private readonly storeConfig;
40
43
  private userControllerInstance;
41
44
  private friendControllerInstance;
45
+ private transactionControllerInstance;
42
46
  private uiEventHandlerInstance;
43
47
  private userEventHandlerInstance;
44
48
  private friendEventHandlerInstance;
@@ -55,6 +59,7 @@ export declare class EventProcessorSDK {
55
59
  getStoreConfig(): StoreConfig;
56
60
  getUserController(): UserController;
57
61
  getFriendController(): FriendController;
62
+ getTransactionController(): TransactionController;
58
63
  getUIEventHandler(): UIEventHandler;
59
64
  getUserEventHandler(): UserEventHandler;
60
65
  getFriendEventHandler(): FriendEventHandler;
@@ -63,12 +68,14 @@ export declare class EventProcessorSDK {
63
68
  getGroupTransactionEventHandler(): GroupTransactionEventHandler;
64
69
  getActivityEventHandler(): ActivityEventHandler;
65
70
  getFirebaseAdapter(): FirebaseAdapter;
71
+ getCurrencyStore(): CurrencyStore;
66
72
  getModelChangeObservable(): Observable<ModelChange>;
67
73
  emitModelChange(modelType: string, model: Model): void;
68
74
  }
69
75
  export declare function initializeSDK(config: StoreConfig): EventProcessorSDK;
70
76
  export declare function getUserController(): UserController;
71
77
  export declare function getFriendController(): FriendController;
78
+ export declare function getTransactionController(): TransactionController;
72
79
  export declare function getUIEventHandler(): UIEventHandler;
73
80
  export declare function getUserEventHandler(): UserEventHandler;
74
81
  export declare function getFriendEventHandler(): FriendEventHandler;
@@ -77,6 +84,7 @@ export declare function getGroupEventHandler(): GroupEventHandler;
77
84
  export declare function getGroupTransactionEventHandler(): GroupTransactionEventHandler;
78
85
  export declare function getActivityEventHandler(): ActivityEventHandler;
79
86
  export declare function getFirebaseAdapter(): FirebaseAdapter;
87
+ export declare function getCurrencyStore(): CurrencyStore;
80
88
  export declare function getModelChangeObservable(): Observable<ModelChange>;
81
89
  export declare function eventToFirestore(event: Event): FirestoreEventData;
82
90
  export declare function firestoreToEvent(data: FirestoreEventData): Event;
@@ -1 +1 @@
1
- {"version":3,"file":"EventProcessorSDK.d.ts","sourceRoot":"","sources":["../src/EventProcessorSDK.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAw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  exports.initializeSDK = initializeSDK;
5
5
  exports.getUserController = getUserController;
6
6
  exports.getFriendController = getFriendController;
7
+ exports.getTransactionController = getTransactionController;
7
8
  exports.getUIEventHandler = getUIEventHandler;
8
9
  exports.getUserEventHandler = getUserEventHandler;
9
10
  exports.getFriendEventHandler = getFriendEventHandler;
@@ -12,6 +13,7 @@ exports.getGroupEventHandler = getGroupEventHandler;
12
13
  exports.getGroupTransactionEventHandler = getGroupTransactionEventHandler;
13
14
  exports.getActivityEventHandler = getActivityEventHandler;
14
15
  exports.getFirebaseAdapter = getFirebaseAdapter;
16
+ exports.getCurrencyStore = getCurrencyStore;
15
17
  exports.getModelChangeObservable = getModelChangeObservable;
16
18
  exports.eventToFirestore = eventToFirestore;
17
19
  exports.firestoreToEvent = firestoreToEvent;
@@ -19,6 +21,7 @@ exports.isSDKInitialized = isSDKInitialized;
19
21
  exports.__resetSDKForTesting = __resetSDKForTesting;
20
22
  const UserController_1 = require("./client/controllers/UserController");
21
23
  const FriendController_1 = require("./client/controllers/FriendController");
24
+ const TransactionController_1 = require("./client/controllers/TransactionController");
22
25
  const UIEventHandler_1 = require("./client/handlers/UIEventHandler");
23
26
  const eventConverter_1 = require("./converters/eventConverter");
24
27
  const events_1 = require("./events");
@@ -59,6 +62,12 @@ class EventProcessorSDK {
59
62
  }
60
63
  return this.friendControllerInstance;
61
64
  }
65
+ getTransactionController() {
66
+ if (!this.transactionControllerInstance) {
67
+ this.transactionControllerInstance = new TransactionController_1.TransactionController();
68
+ }
69
+ return this.transactionControllerInstance;
70
+ }
62
71
  getUIEventHandler() {
63
72
  if (!this.uiEventHandlerInstance) {
64
73
  this.uiEventHandlerInstance = new UIEventHandler_1.UIEventHandler();
@@ -79,7 +88,7 @@ class EventProcessorSDK {
79
88
  }
80
89
  getTransactionEventHandler() {
81
90
  if (!this.transactionEventHandlerInstance) {
82
- this.transactionEventHandlerInstance = new events_1.TransactionEventHandler(this.storeConfig.transactionModelStore, this.storeConfig.transactionEventStore, this.storeConfig.userModelStore, this.getActivityEventHandler());
91
+ this.transactionEventHandlerInstance = new events_1.TransactionEventHandler(this.storeConfig.transactionModelStore, this.storeConfig.transactionEventStore, this.getActivityEventHandler());
83
92
  }
84
93
  return this.transactionEventHandlerInstance;
85
94
  }
@@ -105,6 +114,9 @@ class EventProcessorSDK {
105
114
  getFirebaseAdapter() {
106
115
  return this.storeConfig.firebaseAdapter;
107
116
  }
117
+ getCurrencyStore() {
118
+ return this.storeConfig.currencyStore;
119
+ }
108
120
  getModelChangeObservable() {
109
121
  return this.modelChangeEmitter.asObservable();
110
122
  }
@@ -122,6 +134,9 @@ function getUserController() {
122
134
  function getFriendController() {
123
135
  return EventProcessorSDK.getInstance().getFriendController();
124
136
  }
137
+ function getTransactionController() {
138
+ return EventProcessorSDK.getInstance().getTransactionController();
139
+ }
125
140
  function getUIEventHandler() {
126
141
  return EventProcessorSDK.getInstance().getUIEventHandler();
127
142
  }
@@ -146,16 +161,17 @@ function getActivityEventHandler() {
146
161
  function getFirebaseAdapter() {
147
162
  return EventProcessorSDK.getInstance().getFirebaseAdapter();
148
163
  }
164
+ function getCurrencyStore() {
165
+ return EventProcessorSDK.getInstance().getCurrencyStore();
166
+ }
149
167
  function getModelChangeObservable() {
150
168
  return EventProcessorSDK.getInstance().getModelChangeObservable();
151
169
  }
152
170
  function eventToFirestore(event) {
153
- const adapter = getFirebaseAdapter();
154
- return (0, eventConverter_1.eventToFirestore)(event, adapter);
171
+ return (0, eventConverter_1.eventToFirestore)(event);
155
172
  }
156
173
  function firestoreToEvent(data) {
157
- const adapter = getFirebaseAdapter();
158
- return (0, eventConverter_1.firestoreToEvent)(data, adapter);
174
+ return (0, eventConverter_1.firestoreToEvent)(data);
159
175
  }
160
176
  function isSDKInitialized() {
161
177
  return EventProcessorSDK.isInitialized();
@@ -1,14 +1,18 @@
1
1
  import { FriendCreated, FriendEvent, FriendEventStore, FriendModelStore, UserEventStore, UserModelStore } from ".";
2
+ import { BaseEventHandler } from "./BaseEventHandler";
2
3
  import { ActivityEventHandler } from "./ActivityEventHandler";
3
- export declare class FriendEventHandler {
4
+ export declare class FriendEventHandler extends BaseEventHandler<FriendEvent> {
4
5
  private modelStore;
5
6
  private userModelStore;
6
7
  private friendEventStore;
7
8
  private userEventStore;
8
9
  private activityEventHandler?;
9
10
  constructor(modelStore: FriendModelStore, userModelStore: UserModelStore, friendEventStore: FriendEventStore, userEventStore: UserEventStore, activityEventHandler?: ActivityEventHandler | undefined);
10
- private shouldSkipSave;
11
+ handleClientEventFromRemoteListener(event: FriendEvent): Promise<void>;
11
12
  handleEvent(event: FriendEvent): Promise<void>;
12
13
  handleFriendCreated(event: FriendCreated): Promise<void>;
14
+ handleGenericFriendEvent(event: FriendEvent): Promise<void>;
15
+ handleFriendCreatedOnBackend(event: FriendCreated): Promise<void>;
16
+ private handleFriendCreatedServer;
13
17
  }
14
18
  //# sourceMappingURL=FriendEventHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FriendEventHandler.d.ts","sourceRoot":"","sources":["../src/FriendEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,WAAW,EACX,gBAAgB,EAGhB,gBAAgB,EAGhB,cAAc,EAEd,cAAc,EAEjB,MAAM,GAAG,CAAC;AACX,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAK9D,qBAAa,kBAAkB;IAEvB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,oBAAoB,CAAC;gBAJrB,UAAU,EAAE,gBAAgB,EAC5B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,oBAAoB,CAAC,EAAE,oBAAoB,YAAA;IAGvD,OAAO,CAAC,cAAc;IAahB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAoC9C,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CA0LjE"}
1
+ {"version":3,"file":"FriendEventHandler.d.ts","sourceRoot":"","sources":["../src/FriendEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,WAAW,EACX,gBAAgB,EAGhB,gBAAgB,EAIhB,cAAc,EAEd,cAAc,EACjB,MAAM,GAAG,CAAC;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,qBAAa,kBAAmB,SAAQ,gBAAgB,CAAC,WAAW,CAAC;IAE7D,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,oBAAoB,CAAC;gBAJrB,UAAU,EAAE,gBAAgB,EAC5B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,oBAAoB,CAAC,EAAE,oBAAoB,YAAA;IAK1C,mCAAmC,CAC5C,KAAK,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC;IAgBV,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAW9C,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BxD,wBAAwB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B3D,4BAA4B,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;YAYzD,yBAAyB;CA4I1C"}
@@ -2,56 +2,83 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FriendEventHandler = void 0;
4
4
  const _1 = require(".");
5
- const DomainEvents_1 = require("./common/DomainEvents");
5
+ const BaseEventHandler_1 = require("./BaseEventHandler");
6
6
  const uuid_1 = require("uuid");
7
7
  const EventProcessorSDK_1 = require("./EventProcessorSDK");
8
- class FriendEventHandler {
8
+ class FriendEventHandler extends BaseEventHandler_1.BaseEventHandler {
9
9
  constructor(modelStore, userModelStore, friendEventStore, userEventStore, activityEventHandler) {
10
+ super();
10
11
  this.modelStore = modelStore;
11
12
  this.userModelStore = userModelStore;
12
13
  this.friendEventStore = friendEventStore;
13
14
  this.userEventStore = userEventStore;
14
15
  this.activityEventHandler = activityEventHandler;
15
16
  }
16
- shouldSkipSave(existingModel, updatedModel) {
17
- if (!existingModel) {
18
- return false;
17
+ async handleClientEventFromRemoteListener(event) {
18
+ const existingModel = await this.modelStore.getByStreamId(event.streamId);
19
+ const updatedModel = event.apply(existingModel);
20
+ if (!this.shouldSkipSave(existingModel, updatedModel)) {
21
+ await this.modelStore.save(updatedModel);
22
+ if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
23
+ EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", updatedModel);
24
+ }
19
25
  }
20
- return (existingModel.streamId === updatedModel.streamId &&
21
- existingModel.version === updatedModel.version);
22
26
  }
23
27
  async handleEvent(event) {
24
28
  const eventType = event.constructor.name;
25
- if (!(0, DomainEvents_1.isValidFriendEventType)(eventType)) {
26
- throw new Error(`Unknown friend event type: ${eventType}`);
27
- }
28
- if (!_1.residence.isClient && eventType === "FriendCreated") {
29
- return await this.handleFriendCreated(event);
29
+ switch (eventType) {
30
+ case "FriendCreated":
31
+ return await this.handleFriendCreated(event);
32
+ default:
33
+ return await this.handleGenericFriendEvent(event);
30
34
  }
35
+ }
36
+ async handleFriendCreated(event) {
31
37
  const existingModel = await this.modelStore.getByStreamIdWhereDeletedIsFalse(event.streamId);
32
38
  const updatedModel = event.apply(existingModel);
33
- if (!this.shouldSkipSave(existingModel, updatedModel)) {
34
- await this.modelStore.save(updatedModel);
39
+ if (this.shouldSkipSave(existingModel, updatedModel)) {
40
+ return;
41
+ }
42
+ await this.modelStore.save(updatedModel);
43
+ if (_1.residence.isClient) {
44
+ await this.friendEventStore.addEvent(event);
35
45
  if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
36
46
  EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", updatedModel);
37
47
  }
48
+ if (this.activityEventHandler) {
49
+ await this.activityEventHandler.createActivityLog(event, existingModel, updatedModel);
50
+ }
51
+ }
52
+ else {
53
+ await this.handleFriendCreatedServer(event, updatedModel);
38
54
  }
55
+ }
56
+ async handleGenericFriendEvent(event) {
57
+ const existingModel = await this.modelStore.getByStreamIdWhereDeletedIsFalse(event.streamId);
58
+ const updatedModel = event.apply(existingModel);
59
+ if (this.shouldSkipSave(existingModel, updatedModel)) {
60
+ return;
61
+ }
62
+ await this.modelStore.save(updatedModel);
39
63
  if (_1.residence.isClient) {
40
64
  await this.friendEventStore.addEvent(event);
65
+ if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
66
+ EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", updatedModel);
67
+ }
41
68
  if (this.activityEventHandler) {
42
69
  await this.activityEventHandler.createActivityLog(event, existingModel, updatedModel);
43
70
  }
44
71
  }
45
72
  }
46
- async handleFriendCreated(event) {
73
+ async handleFriendCreatedOnBackend(event) {
47
74
  const existingModel = await this.modelStore.getByStreamIdWhereDeletedIsFalse(event.streamId);
48
75
  const updatedModel = event.apply(existingModel);
49
76
  if (!this.shouldSkipSave(existingModel, updatedModel)) {
50
77
  await this.modelStore.save(updatedModel);
51
- if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
52
- EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", updatedModel);
53
- }
54
78
  }
79
+ await this.handleFriendCreatedServer(event, updatedModel);
80
+ }
81
+ async handleFriendCreatedServer(event, updatedModel) {
55
82
  // Check if friend is already a user (try phone first, then email)
56
83
  let friendUser = null;
57
84
  if (event.friendPhoneNumber) {
@@ -75,12 +102,7 @@ class FriendEventHandler {
75
102
  });
76
103
  await this.friendEventStore.addEvent(friendIdAddedEvent);
77
104
  const modelWithFriendId = friendIdAddedEvent.apply(updatedModel);
78
- if (!this.shouldSkipSave(updatedModel, modelWithFriendId)) {
79
- await this.modelStore.save(modelWithFriendId);
80
- if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
81
- EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", modelWithFriendId);
82
- }
83
- }
105
+ await this.modelStore.save(modelWithFriendId);
84
106
  const primaryUser = await this.userModelStore.getByStreamIdWhereDeletedIsFalse(event.userId);
85
107
  if (primaryUser) {
86
108
  const reciprocalFriendCreated = new _1.FriendCreated({
@@ -99,12 +121,7 @@ class FriendEventHandler {
99
121
  });
100
122
  await this.friendEventStore.addEvent(reciprocalFriendCreated);
101
123
  const reciprocalModel = reciprocalFriendCreated.apply(undefined);
102
- if (!this.shouldSkipSave(undefined, reciprocalModel)) {
103
- await this.modelStore.save(reciprocalModel);
104
- if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
105
- EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", reciprocalModel);
106
- }
107
- }
124
+ await this.modelStore.save(reciprocalModel);
108
125
  if (this.activityEventHandler) {
109
126
  await this.activityEventHandler.createActivityLog(reciprocalFriendCreated, undefined, reciprocalModel);
110
127
  }
@@ -127,9 +144,7 @@ class FriendEventHandler {
127
144
  });
128
145
  await this.userEventStore.addEvent(placeholderUserCreated);
129
146
  const placeholderUser = placeholderUserCreated.apply(undefined);
130
- if (!this.shouldSkipSave(undefined, placeholderUser)) {
131
- await this.userModelStore.save(placeholderUser);
132
- }
147
+ await this.userModelStore.save(placeholderUser);
133
148
  // Link primary user to placeholder
134
149
  const friendIdAddedEvent = new _1.FriendIdAdded({
135
150
  eventId: (0, uuid_1.v4)(),
@@ -143,12 +158,7 @@ class FriendEventHandler {
143
158
  });
144
159
  await this.friendEventStore.addEvent(friendIdAddedEvent);
145
160
  const modelWithPlaceholderId = friendIdAddedEvent.apply(updatedModel);
146
- if (!this.shouldSkipSave(updatedModel, modelWithPlaceholderId)) {
147
- await this.modelStore.save(modelWithPlaceholderId);
148
- if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
149
- EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", modelWithPlaceholderId);
150
- }
151
- }
161
+ await this.modelStore.save(modelWithPlaceholderId);
152
162
  // Create reciprocal friendship for placeholder user
153
163
  const primaryUser = await this.userModelStore.getByStreamIdWhereDeletedIsFalse(event.userId);
154
164
  if (primaryUser) {
@@ -169,12 +179,7 @@ class FriendEventHandler {
169
179
  });
170
180
  await this.friendEventStore.addEvent(reciprocalFriendCreated);
171
181
  const reciprocalModel = reciprocalFriendCreated.apply(undefined);
172
- if (!this.shouldSkipSave(undefined, reciprocalModel)) {
173
- await this.modelStore.save(reciprocalModel);
174
- if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
175
- EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", reciprocalModel);
176
- }
177
- }
182
+ await this.modelStore.save(reciprocalModel);
178
183
  if (this.activityEventHandler) {
179
184
  await this.activityEventHandler.createActivityLog(reciprocalFriendCreated, undefined, reciprocalModel);
180
185
  }
@@ -1,11 +1,7 @@
1
- import { GroupCreated, GroupNameChanged, GroupDescriptionChanged, GroupMembersAdded, GroupMembersRemoved, GroupDeleted, GroupModel, GroupEvent } from ".";
2
- import { GroupModelStore } from ".";
3
- import { FriendModelStore } from ".";
4
- import { UserModelStore } from ".";
5
- import { GroupEventStore } from ".";
6
- import { FriendEventStore } from ".";
1
+ import { FriendEventStore, FriendModelStore, GroupCreated, GroupDeleted, GroupDescriptionChanged, GroupEvent, GroupEventStore, GroupMembersAdded, GroupMembersRemoved, GroupModel, GroupModelStore, GroupNameChanged, UserModelStore } from ".";
2
+ import { BaseEventHandler } from "./BaseEventHandler";
7
3
  import { ActivityEventHandler } from "./ActivityEventHandler";
8
- export declare class GroupEventHandler {
4
+ export declare class GroupEventHandler extends BaseEventHandler<GroupEvent> {
9
5
  private modelStore;
10
6
  private friendModelStore;
11
7
  private userModelStore;
@@ -13,7 +9,8 @@ export declare class GroupEventHandler {
13
9
  private friendEventStore;
14
10
  private activityEventHandler?;
15
11
  constructor(modelStore: GroupModelStore, friendModelStore: FriendModelStore, userModelStore: UserModelStore, groupEventStore: GroupEventStore, friendEventStore: FriendEventStore, activityEventHandler?: ActivityEventHandler | undefined);
16
- private shouldSkipSave;
12
+ handleClientEventFromRemoteListener(event: GroupEvent): Promise<void>;
13
+ currentUserId?: string;
17
14
  handleEvent(event: GroupEvent): Promise<GroupModel>;
18
15
  private ensureBidirectionalFriendship;
19
16
  handleGroupCreated(event: GroupCreated): Promise<GroupModel>;
@@ -1 +1 @@
1
- {"version":3,"file":"GroupEventHandler.d.ts","sourceRoot":"","sources":["../src/GroupEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,UAAU,EAEV,UAAU,EAEb,MAAM,GAAG,CAAC;AACX,OAAO,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAK9D,qBAAa,iBAAiB;IAEtB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,oBAAoB,CAAC;gBALrB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