@zeeshan60/event-processor 1.0.15 → 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.
- package/README.md +29 -22
- package/dist/ActivityEventHandler.d.ts +3 -3
- package/dist/ActivityEventHandler.d.ts.map +1 -1
- package/dist/ActivityEventHandler.js +3 -8
- package/dist/BaseEventHandler.d.ts +5 -3
- package/dist/BaseEventHandler.d.ts.map +1 -1
- package/dist/BaseEventHandler.js +11 -0
- package/dist/EventProcessorSDK.d.ts +4 -0
- package/dist/EventProcessorSDK.d.ts.map +1 -1
- package/dist/EventProcessorSDK.js +7 -0
- package/dist/FriendEventHandler.d.ts +4 -2
- package/dist/FriendEventHandler.d.ts.map +1 -1
- package/dist/FriendEventHandler.js +50 -36
- package/dist/GroupEventHandler.d.ts +2 -2
- package/dist/GroupEventHandler.d.ts.map +1 -1
- package/dist/GroupEventHandler.js +235 -186
- package/dist/GroupTransactionEventHandler.d.ts +1 -2
- package/dist/GroupTransactionEventHandler.d.ts.map +1 -1
- package/dist/GroupTransactionEventHandler.js +4 -9
- package/dist/TransactionEventHandler.d.ts +1 -2
- package/dist/TransactionEventHandler.d.ts.map +1 -1
- package/dist/TransactionEventHandler.js +4 -9
- package/dist/UserEventHandler.d.ts +1 -2
- package/dist/UserEventHandler.d.ts.map +1 -1
- package/dist/UserEventHandler.js +4 -9
- package/dist/__tests__/test-helpers/IMCurrencyStore.d.ts +8 -0
- package/dist/__tests__/test-helpers/IMCurrencyStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMCurrencyStore.js +16 -0
- package/dist/__tests__/test-helpers/IMTransactionModelStore.d.ts +2 -0
- package/dist/__tests__/test-helpers/IMTransactionModelStore.d.ts.map +1 -1
- package/dist/__tests__/test-helpers/IMTransactionModelStore.js +20 -0
- package/dist/__tests__/test-helpers/IMUserModelStore.d.ts +3 -0
- package/dist/__tests__/test-helpers/IMUserModelStore.d.ts.map +1 -1
- package/dist/__tests__/test-helpers/IMUserModelStore.js +10 -0
- package/dist/client/controllers/FriendController.d.ts +4 -0
- package/dist/client/controllers/FriendController.d.ts.map +1 -1
- package/dist/client/controllers/FriendController.js +45 -15
- package/dist/client/controllers/TransactionController.d.ts +7 -1
- package/dist/client/controllers/TransactionController.d.ts.map +1 -1
- package/dist/client/controllers/TransactionController.js +61 -0
- package/dist/common/CurrencyRate.d.ts +7 -0
- package/dist/common/CurrencyRate.d.ts.map +1 -0
- package/dist/common/CurrencyRate.js +2 -0
- package/dist/contracts/friends/index.d.ts +1 -9
- package/dist/contracts/friends/index.d.ts.map +1 -1
- package/dist/environment.d.ts +12 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +50 -0
- package/dist/events.d.ts +2 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +7 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/store/CurrencyStore.d.ts +5 -0
- package/dist/store/CurrencyStore.d.ts.map +1 -0
- package/dist/store/CurrencyStore.js +6 -0
- package/dist/store/TransactionModelStore.d.ts +2 -0
- package/dist/store/TransactionModelStore.d.ts.map +1 -1
- package/dist/store/UserModelStore.d.ts +1 -0
- package/dist/store/UserModelStore.d.ts.map +1 -1
- package/dist/utils/BalanceUtil.d.ts +13 -0
- package/dist/utils/BalanceUtil.d.ts.map +1 -0
- package/dist/utils/BalanceUtil.js +97 -0
- package/package.json +1 -1
- package/dist/client/handlers/UIFriendEventHandler.d.ts +0 -16
- package/dist/client/handlers/UIFriendEventHandler.d.ts.map +0 -1
- package/dist/client/handlers/UIFriendEventHandler.js +0 -27
- package/dist/client/handlers/UIGroupEventHandler.d.ts +0 -18
- package/dist/client/handlers/UIGroupEventHandler.d.ts.map +0 -1
- package/dist/client/handlers/UIGroupEventHandler.js +0 -28
- package/dist/client/handlers/UIGroupTransactionEventHandler.d.ts +0 -18
- package/dist/client/handlers/UIGroupTransactionEventHandler.d.ts.map +0 -1
- package/dist/client/handlers/UIGroupTransactionEventHandler.js +0 -28
- package/dist/client/handlers/UITransactionEventHandler.d.ts +0 -14
- package/dist/client/handlers/UITransactionEventHandler.d.ts.map +0 -1
- package/dist/client/handlers/UITransactionEventHandler.js +0 -26
- package/dist/client/handlers/UIUserEventHandler.d.ts +0 -12
- package/dist/client/handlers/UIUserEventHandler.d.ts.map +0 -1
- package/dist/client/handlers/UIUserEventHandler.js +0 -29
- package/dist/utils/userPathUtils.d.ts +0 -6
- package/dist/utils/userPathUtils.d.ts.map +0 -1
- 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
|
-
- **
|
|
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
|
-
##
|
|
106
|
+
## Runtime Context Configuration
|
|
107
107
|
|
|
108
|
-
The event-processor package
|
|
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 {
|
|
113
|
+
import { residence } from '@zeeshan60/event-processor';
|
|
114
114
|
|
|
115
|
-
//
|
|
116
|
-
//
|
|
115
|
+
// Client (Mobile App): No configuration needed - defaults to true
|
|
116
|
+
// The residence.isClient flag is true by default
|
|
117
117
|
|
|
118
|
-
//
|
|
119
|
-
|
|
118
|
+
// Google Cloud Functions: Set explicitly to false
|
|
119
|
+
residence.isClient = false;
|
|
120
120
|
|
|
121
|
-
// Check the
|
|
122
|
-
if (
|
|
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
|
-
|
|
127
|
-
|
|
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
|
-
|
|
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
|
-
|
|
134
|
-
|
|
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
|
|
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
|
-
- **
|
|
177
|
+
- **residence**: Runtime context object with `isClient` flag for client vs server detection
|
|
171
178
|
|
|
172
179
|
### Event Handlers
|
|
173
180
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ActivityLogEvent, ActivityLogEventStore, ActivityLogModelStore,
|
|
2
|
-
|
|
1
|
+
import { ActivityLogEvent, ActivityLogEventStore, ActivityLogModelStore, Event, Model, UserModelStore } from ".";
|
|
2
|
+
import { BaseEventHandler } from "./BaseEventHandler";
|
|
3
|
+
export declare class ActivityEventHandler extends BaseEventHandler<ActivityLogEvent> {
|
|
3
4
|
private activityLogModelStore;
|
|
4
5
|
private activityLogEventStore;
|
|
5
6
|
private userModelStore;
|
|
6
7
|
constructor(activityLogModelStore: ActivityLogModelStore, activityLogEventStore: ActivityLogEventStore, userModelStore: UserModelStore);
|
|
7
|
-
private shouldSkipSave;
|
|
8
8
|
createActivityLog(event: Event, existingModel: Model | undefined, updatedModel: Model): Promise<void>;
|
|
9
9
|
handleClientEventFromRemoteListener(event: ActivityLogEvent): Promise<void>;
|
|
10
10
|
handleEvent(event: ActivityLogEvent): Promise<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActivityEventHandler.d.ts","sourceRoot":"","sources":["../src/ActivityEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,gBAAgB,EAChB,qBAAqB,EAErB,qBAAqB,EACrB,
|
|
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;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Event } from "./common/Event";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
5
7
|
}
|
|
6
8
|
//# sourceMappingURL=BaseEventHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEventHandler.d.ts","sourceRoot":"","sources":["../src/BaseEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
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"}
|
package/dist/BaseEventHandler.js
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
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,6 +10,7 @@ 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";
|
|
15
16
|
import { TransactionController } from "./client/controllers/TransactionController";
|
|
@@ -34,6 +35,7 @@ export type StoreConfig = {
|
|
|
34
35
|
groupTransactionEventStore: GroupTransactionEventStore;
|
|
35
36
|
activityLogModelStore: ActivityLogModelStore;
|
|
36
37
|
activityLogEventStore: ActivityLogEventStore;
|
|
38
|
+
currencyStore: CurrencyStore;
|
|
37
39
|
};
|
|
38
40
|
export declare class EventProcessorSDK {
|
|
39
41
|
private static instance;
|
|
@@ -66,6 +68,7 @@ export declare class EventProcessorSDK {
|
|
|
66
68
|
getGroupTransactionEventHandler(): GroupTransactionEventHandler;
|
|
67
69
|
getActivityEventHandler(): ActivityEventHandler;
|
|
68
70
|
getFirebaseAdapter(): FirebaseAdapter;
|
|
71
|
+
getCurrencyStore(): CurrencyStore;
|
|
69
72
|
getModelChangeObservable(): Observable<ModelChange>;
|
|
70
73
|
emitModelChange(modelType: string, model: Model): void;
|
|
71
74
|
}
|
|
@@ -81,6 +84,7 @@ export declare function getGroupEventHandler(): GroupEventHandler;
|
|
|
81
84
|
export declare function getGroupTransactionEventHandler(): GroupTransactionEventHandler;
|
|
82
85
|
export declare function getActivityEventHandler(): ActivityEventHandler;
|
|
83
86
|
export declare function getFirebaseAdapter(): FirebaseAdapter;
|
|
87
|
+
export declare function getCurrencyStore(): CurrencyStore;
|
|
84
88
|
export declare function getModelChangeObservable(): Observable<ModelChange>;
|
|
85
89
|
export declare function eventToFirestore(event: Event): FirestoreEventData;
|
|
86
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,wBAAwB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC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AAE,kBAAkB,GAAG,KAAK,CAEhE;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
|
@@ -13,6 +13,7 @@ exports.getGroupEventHandler = getGroupEventHandler;
|
|
|
13
13
|
exports.getGroupTransactionEventHandler = getGroupTransactionEventHandler;
|
|
14
14
|
exports.getActivityEventHandler = getActivityEventHandler;
|
|
15
15
|
exports.getFirebaseAdapter = getFirebaseAdapter;
|
|
16
|
+
exports.getCurrencyStore = getCurrencyStore;
|
|
16
17
|
exports.getModelChangeObservable = getModelChangeObservable;
|
|
17
18
|
exports.eventToFirestore = eventToFirestore;
|
|
18
19
|
exports.firestoreToEvent = firestoreToEvent;
|
|
@@ -113,6 +114,9 @@ class EventProcessorSDK {
|
|
|
113
114
|
getFirebaseAdapter() {
|
|
114
115
|
return this.storeConfig.firebaseAdapter;
|
|
115
116
|
}
|
|
117
|
+
getCurrencyStore() {
|
|
118
|
+
return this.storeConfig.currencyStore;
|
|
119
|
+
}
|
|
116
120
|
getModelChangeObservable() {
|
|
117
121
|
return this.modelChangeEmitter.asObservable();
|
|
118
122
|
}
|
|
@@ -157,6 +161,9 @@ function getActivityEventHandler() {
|
|
|
157
161
|
function getFirebaseAdapter() {
|
|
158
162
|
return EventProcessorSDK.getInstance().getFirebaseAdapter();
|
|
159
163
|
}
|
|
164
|
+
function getCurrencyStore() {
|
|
165
|
+
return EventProcessorSDK.getInstance().getCurrencyStore();
|
|
166
|
+
}
|
|
160
167
|
function getModelChangeObservable() {
|
|
161
168
|
return EventProcessorSDK.getInstance().getModelChangeObservable();
|
|
162
169
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { FriendCreated, FriendEvent, FriendEventStore, FriendModelStore, UserEventStore, UserModelStore } from ".";
|
|
2
2
|
import { BaseEventHandler } from "./BaseEventHandler";
|
|
3
3
|
import { ActivityEventHandler } from "./ActivityEventHandler";
|
|
4
|
-
export declare class FriendEventHandler
|
|
4
|
+
export declare class FriendEventHandler extends BaseEventHandler<FriendEvent> {
|
|
5
5
|
private modelStore;
|
|
6
6
|
private userModelStore;
|
|
7
7
|
private friendEventStore;
|
|
8
8
|
private userEventStore;
|
|
9
9
|
private activityEventHandler?;
|
|
10
10
|
constructor(modelStore: FriendModelStore, userModelStore: UserModelStore, friendEventStore: FriendEventStore, userEventStore: UserEventStore, activityEventHandler?: ActivityEventHandler | undefined);
|
|
11
|
-
private shouldSkipSave;
|
|
12
11
|
handleClientEventFromRemoteListener(event: FriendEvent): Promise<void>;
|
|
13
12
|
handleEvent(event: FriendEvent): Promise<void>;
|
|
13
|
+
handleFriendCreated(event: FriendCreated): Promise<void>;
|
|
14
|
+
handleGenericFriendEvent(event: FriendEvent): Promise<void>;
|
|
14
15
|
handleFriendCreatedOnBackend(event: FriendCreated): Promise<void>;
|
|
16
|
+
private handleFriendCreatedServer;
|
|
15
17
|
}
|
|
16
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,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,
|
|
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,25 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FriendEventHandler = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
|
+
const BaseEventHandler_1 = require("./BaseEventHandler");
|
|
5
6
|
const uuid_1 = require("uuid");
|
|
6
7
|
const EventProcessorSDK_1 = require("./EventProcessorSDK");
|
|
7
|
-
class FriendEventHandler {
|
|
8
|
+
class FriendEventHandler extends BaseEventHandler_1.BaseEventHandler {
|
|
8
9
|
constructor(modelStore, userModelStore, friendEventStore, userEventStore, activityEventHandler) {
|
|
10
|
+
super();
|
|
9
11
|
this.modelStore = modelStore;
|
|
10
12
|
this.userModelStore = userModelStore;
|
|
11
13
|
this.friendEventStore = friendEventStore;
|
|
12
14
|
this.userEventStore = userEventStore;
|
|
13
15
|
this.activityEventHandler = activityEventHandler;
|
|
14
16
|
}
|
|
15
|
-
shouldSkipSave(existingModel, updatedModel) {
|
|
16
|
-
if (!existingModel) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
return (existingModel.streamId === updatedModel.streamId &&
|
|
20
|
-
existingModel.version === updatedModel.version);
|
|
21
|
-
}
|
|
22
17
|
async handleClientEventFromRemoteListener(event) {
|
|
23
|
-
const existingModel = await this.modelStore.
|
|
18
|
+
const existingModel = await this.modelStore.getByStreamId(event.streamId);
|
|
24
19
|
const updatedModel = event.apply(existingModel);
|
|
25
20
|
if (!this.shouldSkipSave(existingModel, updatedModel)) {
|
|
26
21
|
await this.modelStore.save(updatedModel);
|
|
@@ -31,21 +26,47 @@ class FriendEventHandler {
|
|
|
31
26
|
}
|
|
32
27
|
async handleEvent(event) {
|
|
33
28
|
const eventType = event.constructor.name;
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
switch (eventType) {
|
|
30
|
+
case "FriendCreated":
|
|
31
|
+
return await this.handleFriendCreated(event);
|
|
32
|
+
default:
|
|
33
|
+
return await this.handleGenericFriendEvent(event);
|
|
36
34
|
}
|
|
35
|
+
}
|
|
36
|
+
async handleFriendCreated(event) {
|
|
37
37
|
const existingModel = await this.modelStore.getByStreamIdWhereDeletedIsFalse(event.streamId);
|
|
38
38
|
const updatedModel = event.apply(existingModel);
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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);
|
|
45
|
+
if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
|
|
46
|
+
EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", updatedModel);
|
|
47
|
+
}
|
|
48
|
+
if (this.activityEventHandler) {
|
|
49
|
+
await this.activityEventHandler.createActivityLog(event, existingModel, updatedModel);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
await this.handleFriendCreatedServer(event, updatedModel);
|
|
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);
|
|
63
|
+
if (_1.residence.isClient) {
|
|
64
|
+
await this.friendEventStore.addEvent(event);
|
|
65
|
+
if ((0, EventProcessorSDK_1.isSDKInitialized)()) {
|
|
66
|
+
EventProcessorSDK_1.EventProcessorSDK.getInstance().emitModelChange("FriendModel", updatedModel);
|
|
67
|
+
}
|
|
68
|
+
if (this.activityEventHandler) {
|
|
69
|
+
await this.activityEventHandler.createActivityLog(event, existingModel, updatedModel);
|
|
49
70
|
}
|
|
50
71
|
}
|
|
51
72
|
}
|
|
@@ -55,6 +76,9 @@ class FriendEventHandler {
|
|
|
55
76
|
if (!this.shouldSkipSave(existingModel, updatedModel)) {
|
|
56
77
|
await this.modelStore.save(updatedModel);
|
|
57
78
|
}
|
|
79
|
+
await this.handleFriendCreatedServer(event, updatedModel);
|
|
80
|
+
}
|
|
81
|
+
async handleFriendCreatedServer(event, updatedModel) {
|
|
58
82
|
// Check if friend is already a user (try phone first, then email)
|
|
59
83
|
let friendUser = null;
|
|
60
84
|
if (event.friendPhoneNumber) {
|
|
@@ -78,9 +102,7 @@ class FriendEventHandler {
|
|
|
78
102
|
});
|
|
79
103
|
await this.friendEventStore.addEvent(friendIdAddedEvent);
|
|
80
104
|
const modelWithFriendId = friendIdAddedEvent.apply(updatedModel);
|
|
81
|
-
|
|
82
|
-
await this.modelStore.save(modelWithFriendId);
|
|
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,9 +121,7 @@ class FriendEventHandler {
|
|
|
99
121
|
});
|
|
100
122
|
await this.friendEventStore.addEvent(reciprocalFriendCreated);
|
|
101
123
|
const reciprocalModel = reciprocalFriendCreated.apply(undefined);
|
|
102
|
-
|
|
103
|
-
await this.modelStore.save(reciprocalModel);
|
|
104
|
-
}
|
|
124
|
+
await this.modelStore.save(reciprocalModel);
|
|
105
125
|
if (this.activityEventHandler) {
|
|
106
126
|
await this.activityEventHandler.createActivityLog(reciprocalFriendCreated, undefined, reciprocalModel);
|
|
107
127
|
}
|
|
@@ -124,9 +144,7 @@ class FriendEventHandler {
|
|
|
124
144
|
});
|
|
125
145
|
await this.userEventStore.addEvent(placeholderUserCreated);
|
|
126
146
|
const placeholderUser = placeholderUserCreated.apply(undefined);
|
|
127
|
-
|
|
128
|
-
await this.userModelStore.save(placeholderUser);
|
|
129
|
-
}
|
|
147
|
+
await this.userModelStore.save(placeholderUser);
|
|
130
148
|
// Link primary user to placeholder
|
|
131
149
|
const friendIdAddedEvent = new _1.FriendIdAdded({
|
|
132
150
|
eventId: (0, uuid_1.v4)(),
|
|
@@ -140,9 +158,7 @@ class FriendEventHandler {
|
|
|
140
158
|
});
|
|
141
159
|
await this.friendEventStore.addEvent(friendIdAddedEvent);
|
|
142
160
|
const modelWithPlaceholderId = friendIdAddedEvent.apply(updatedModel);
|
|
143
|
-
|
|
144
|
-
await this.modelStore.save(modelWithPlaceholderId);
|
|
145
|
-
}
|
|
161
|
+
await this.modelStore.save(modelWithPlaceholderId);
|
|
146
162
|
// Create reciprocal friendship for placeholder user
|
|
147
163
|
const primaryUser = await this.userModelStore.getByStreamIdWhereDeletedIsFalse(event.userId);
|
|
148
164
|
if (primaryUser) {
|
|
@@ -163,9 +179,7 @@ class FriendEventHandler {
|
|
|
163
179
|
});
|
|
164
180
|
await this.friendEventStore.addEvent(reciprocalFriendCreated);
|
|
165
181
|
const reciprocalModel = reciprocalFriendCreated.apply(undefined);
|
|
166
|
-
|
|
167
|
-
await this.modelStore.save(reciprocalModel);
|
|
168
|
-
}
|
|
182
|
+
await this.modelStore.save(reciprocalModel);
|
|
169
183
|
if (this.activityEventHandler) {
|
|
170
184
|
await this.activityEventHandler.createActivityLog(reciprocalFriendCreated, undefined, reciprocalModel);
|
|
171
185
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FriendEventStore, FriendModelStore, GroupCreated, GroupDeleted, GroupDescriptionChanged, GroupEvent, GroupEventStore, GroupMembersAdded, GroupMembersRemoved, GroupModel, GroupModelStore, GroupNameChanged, UserModelStore } from ".";
|
|
2
2
|
import { BaseEventHandler } from "./BaseEventHandler";
|
|
3
3
|
import { ActivityEventHandler } from "./ActivityEventHandler";
|
|
4
|
-
export declare class GroupEventHandler
|
|
4
|
+
export declare class GroupEventHandler extends BaseEventHandler<GroupEvent> {
|
|
5
5
|
private modelStore;
|
|
6
6
|
private friendModelStore;
|
|
7
7
|
private userModelStore;
|
|
@@ -9,8 +9,8 @@ export declare class GroupEventHandler implements BaseEventHandler<GroupEvent> {
|
|
|
9
9
|
private friendEventStore;
|
|
10
10
|
private activityEventHandler?;
|
|
11
11
|
constructor(modelStore: GroupModelStore, friendModelStore: FriendModelStore, userModelStore: UserModelStore, groupEventStore: GroupEventStore, friendEventStore: FriendEventStore, activityEventHandler?: ActivityEventHandler | undefined);
|
|
12
|
-
private shouldSkipSave;
|
|
13
12
|
handleClientEventFromRemoteListener(event: GroupEvent): Promise<void>;
|
|
13
|
+
currentUserId?: string;
|
|
14
14
|
handleEvent(event: GroupEvent): Promise<GroupModel>;
|
|
15
15
|
private ensureBidirectionalFriendship;
|
|
16
16
|
handleGroupCreated(event: GroupCreated): Promise<GroupModel>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupEventHandler.d.ts","sourceRoot":"","sources":["../src/GroupEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,gBAAgB,EAEhB,cAAc,EACjB,MAAM,GAAG,CAAC;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,qBAAa,iBAAkB,
|
|
1
|
+
{"version":3,"file":"GroupEventHandler.d.ts","sourceRoot":"","sources":["../src/GroupEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,uBAAuB,EACvB,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,gBAAgB,EAEhB,cAAc,EACjB,MAAM,GAAG,CAAC;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,qBAAa,iBAAkB,SAAQ,gBAAgB,CAAC,UAAU,CAAC;IAE3D,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,UAAU,EAAE,eAAe,EAC3B,gBAAg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