@zeeshan60/event-processor 1.0.4 → 1.0.6
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/ActivityEventHandler.d.ts +12 -0
- package/dist/ActivityEventHandler.d.ts.map +1 -0
- package/dist/ActivityEventHandler.js +35 -0
- package/dist/ActivityLogEvents.d.ts +2 -0
- package/dist/ActivityLogEvents.d.ts.map +1 -1
- package/dist/ActivityLogEvents.js +1 -0
- package/dist/FriendEventHandler.d.ts +21 -0
- package/dist/FriendEventHandler.d.ts.map +1 -0
- package/dist/FriendEventHandler.js +180 -0
- package/dist/FriendEvents.d.ts +10 -0
- package/dist/FriendEvents.d.ts.map +1 -1
- package/dist/FriendEvents.js +9 -0
- package/dist/GroupEventHandler.d.ts +25 -0
- package/dist/GroupEventHandler.d.ts.map +1 -0
- package/dist/GroupEventHandler.js +278 -0
- package/dist/GroupEvents.d.ts +12 -0
- package/dist/GroupEvents.d.ts.map +1 -1
- package/dist/GroupEvents.js +12 -0
- package/dist/GroupTransactionEventHandler.d.ts +25 -0
- package/dist/GroupTransactionEventHandler.d.ts.map +1 -0
- package/dist/GroupTransactionEventHandler.js +303 -0
- package/dist/GroupTransactionEvents.d.ts +18 -0
- package/dist/GroupTransactionEvents.d.ts.map +1 -1
- package/dist/GroupTransactionEvents.js +18 -0
- package/dist/TransactionEventHandler.d.ts +11 -7
- package/dist/TransactionEventHandler.d.ts.map +1 -1
- package/dist/TransactionEventHandler.js +146 -10
- package/dist/TransactionEvents.d.ts +16 -0
- package/dist/TransactionEvents.d.ts.map +1 -1
- package/dist/TransactionEvents.js +16 -0
- package/dist/UserEventHandler.d.ts +17 -0
- package/dist/UserEventHandler.d.ts.map +1 -0
- package/dist/UserEventHandler.js +82 -0
- package/dist/UserEvents.d.ts +16 -0
- package/dist/UserEvents.d.ts.map +1 -1
- package/dist/UserEvents.js +12 -0
- package/dist/__tests__/test-helpers/IMActivityLogEventStore.d.ts +9 -0
- package/dist/__tests__/test-helpers/IMActivityLogEventStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMActivityLogEventStore.js +21 -0
- package/dist/__tests__/test-helpers/IMActivityLogModelStore.d.ts +11 -0
- package/dist/__tests__/test-helpers/IMActivityLogModelStore.d.ts.map +1 -0
- package/dist/{store/InMemoryModelStore.js → __tests__/test-helpers/IMActivityLogModelStore.js} +14 -13
- package/dist/__tests__/test-helpers/IMFriendEventStore.d.ts +9 -0
- package/dist/__tests__/test-helpers/IMFriendEventStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMFriendEventStore.js +20 -0
- package/dist/__tests__/test-helpers/IMFriendModelStore.d.ts +16 -0
- package/dist/__tests__/test-helpers/IMFriendModelStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMFriendModelStore.js +74 -0
- package/dist/__tests__/test-helpers/IMGroupEventStore.d.ts +9 -0
- package/dist/__tests__/test-helpers/IMGroupEventStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMGroupEventStore.js +20 -0
- package/dist/__tests__/test-helpers/IMGroupModelStore.d.ts +14 -0
- package/dist/__tests__/test-helpers/IMGroupModelStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMGroupModelStore.js +53 -0
- package/dist/__tests__/test-helpers/IMGroupTransactionEventStore.d.ts +9 -0
- package/dist/__tests__/test-helpers/IMGroupTransactionEventStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMGroupTransactionEventStore.js +22 -0
- package/dist/__tests__/test-helpers/IMGroupTransactionModelStore.d.ts +14 -0
- package/dist/__tests__/test-helpers/IMGroupTransactionModelStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMGroupTransactionModelStore.js +55 -0
- package/dist/__tests__/test-helpers/IMTransactionEventStore.d.ts +10 -0
- package/dist/__tests__/test-helpers/IMTransactionEventStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMTransactionEventStore.js +23 -0
- package/dist/__tests__/test-helpers/IMTransactionModelStore.d.ts +14 -0
- package/dist/__tests__/test-helpers/IMTransactionModelStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMTransactionModelStore.js +56 -0
- package/dist/__tests__/test-helpers/IMUserEventStore.d.ts +10 -0
- package/dist/__tests__/test-helpers/IMUserEventStore.d.ts.map +1 -0
- package/dist/{store/InMemoryEventStore.js → __tests__/test-helpers/IMUserEventStore.js} +5 -5
- package/dist/__tests__/test-helpers/IMUserModelStore.d.ts +15 -0
- package/dist/__tests__/test-helpers/IMUserModelStore.d.ts.map +1 -0
- package/dist/__tests__/test-helpers/IMUserModelStore.js +58 -0
- package/dist/common/Event.d.ts +1 -0
- package/dist/common/Event.d.ts.map +1 -1
- package/dist/events.d.ts +30 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +60 -0
- package/dist/index.d.ts +1 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -86
- package/dist/utils/splitTypeUtils.d.ts +7 -0
- package/dist/utils/splitTypeUtils.d.ts.map +1 -0
- package/dist/utils/splitTypeUtils.js +45 -0
- package/dist/utils/userPathUtils.d.ts +6 -0
- package/dist/utils/userPathUtils.d.ts.map +1 -0
- package/dist/utils/userPathUtils.js +16 -0
- package/package.json +1 -1
- package/dist/common/EventStore.d.ts +0 -5
- package/dist/common/EventStore.d.ts.map +0 -1
- package/dist/common/EventStore.js +0 -6
- package/dist/common/ModelStore.d.ts +0 -6
- package/dist/common/ModelStore.d.ts.map +0 -1
- package/dist/common/ModelStore.js +0 -6
- package/dist/store/InMemoryEventStore.d.ts +0 -10
- package/dist/store/InMemoryEventStore.d.ts.map +0 -1
- package/dist/store/InMemoryModelStore.d.ts +0 -11
- package/dist/store/InMemoryModelStore.d.ts.map +0 -1
package/dist/UserEvents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserEvents.d.ts","sourceRoot":"","sources":["../src/UserEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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C;AAGD,MAAM,WAAW,+BAA+B;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,qBAAa,0BAA2B,YAAW,KAAK;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,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,+BAA+B;IASlD,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS;CAmBnC"}
|
package/dist/UserEvents.js
CHANGED
|
@@ -28,6 +28,7 @@ class UserCreated {
|
|
|
28
28
|
this.createdBy = props.createdBy;
|
|
29
29
|
this.streamId = props.streamId;
|
|
30
30
|
this.version = props.version;
|
|
31
|
+
this.systemGenerated = props.systemGenerated;
|
|
31
32
|
}
|
|
32
33
|
apply(_existing) {
|
|
33
34
|
if (!this.userId) {
|
|
@@ -69,6 +70,7 @@ class UserCreated {
|
|
|
69
70
|
createdAt: this.createdAt,
|
|
70
71
|
createdBy: this.createdBy,
|
|
71
72
|
streamId: (0, uuid_1.v4)(),
|
|
73
|
+
systemGenerated: true,
|
|
72
74
|
version: 1,
|
|
73
75
|
};
|
|
74
76
|
}
|
|
@@ -84,6 +86,7 @@ class PlaceholderUserCreated {
|
|
|
84
86
|
this.createdBy = props.createdBy;
|
|
85
87
|
this.streamId = props.streamId;
|
|
86
88
|
this.version = props.version;
|
|
89
|
+
this.systemGenerated = props.systemGenerated;
|
|
87
90
|
}
|
|
88
91
|
apply(_existing) {
|
|
89
92
|
if (!this.userId) {
|
|
@@ -118,6 +121,7 @@ class UserCurrencyChanged {
|
|
|
118
121
|
this.createdBy = props.createdBy;
|
|
119
122
|
this.streamId = props.streamId;
|
|
120
123
|
this.version = props.version;
|
|
124
|
+
this.systemGenerated = props.systemGenerated;
|
|
121
125
|
}
|
|
122
126
|
apply(existing) {
|
|
123
127
|
if (!existing) {
|
|
@@ -152,6 +156,7 @@ class UserCurrencyChanged {
|
|
|
152
156
|
createdAt: this.createdAt,
|
|
153
157
|
createdBy: this.createdBy,
|
|
154
158
|
streamId: (0, uuid_1.v4)(),
|
|
159
|
+
systemGenerated: true,
|
|
155
160
|
version: 1,
|
|
156
161
|
};
|
|
157
162
|
}
|
|
@@ -165,6 +170,7 @@ class UserPhoneNumberChanged {
|
|
|
165
170
|
this.createdBy = props.createdBy;
|
|
166
171
|
this.streamId = props.streamId;
|
|
167
172
|
this.version = props.version;
|
|
173
|
+
this.systemGenerated = props.systemGenerated;
|
|
168
174
|
}
|
|
169
175
|
apply(existing) {
|
|
170
176
|
if (!existing) {
|
|
@@ -206,6 +212,7 @@ class UserPhoneNumberChanged {
|
|
|
206
212
|
createdAt: this.createdAt,
|
|
207
213
|
createdBy: this.createdBy,
|
|
208
214
|
streamId: (0, uuid_1.v4)(),
|
|
215
|
+
systemGenerated: true,
|
|
209
216
|
version: 1,
|
|
210
217
|
};
|
|
211
218
|
}
|
|
@@ -219,6 +226,7 @@ class UserDisplayNameChanged {
|
|
|
219
226
|
this.createdBy = props.createdBy;
|
|
220
227
|
this.streamId = props.streamId;
|
|
221
228
|
this.version = props.version;
|
|
229
|
+
this.systemGenerated = props.systemGenerated;
|
|
222
230
|
}
|
|
223
231
|
apply(existing) {
|
|
224
232
|
if (!existing) {
|
|
@@ -251,6 +259,7 @@ class UserDisplayNameChanged {
|
|
|
251
259
|
createdAt: this.createdAt,
|
|
252
260
|
createdBy: this.createdBy,
|
|
253
261
|
streamId: (0, uuid_1.v4)(),
|
|
262
|
+
systemGenerated: true,
|
|
254
263
|
version: 1,
|
|
255
264
|
};
|
|
256
265
|
}
|
|
@@ -263,6 +272,7 @@ class UserDeleted {
|
|
|
263
272
|
this.createdBy = props.createdBy;
|
|
264
273
|
this.streamId = props.streamId;
|
|
265
274
|
this.version = props.version;
|
|
275
|
+
this.systemGenerated = props.systemGenerated;
|
|
266
276
|
}
|
|
267
277
|
apply(existing) {
|
|
268
278
|
if (!existing) {
|
|
@@ -292,6 +302,7 @@ class PlaceholderUserMerged {
|
|
|
292
302
|
this.createdBy = props.createdBy;
|
|
293
303
|
this.streamId = props.streamId;
|
|
294
304
|
this.version = props.version;
|
|
305
|
+
this.systemGenerated = props.systemGenerated;
|
|
295
306
|
}
|
|
296
307
|
apply(existing) {
|
|
297
308
|
if (!existing) {
|
|
@@ -324,6 +335,7 @@ class UserConvertedToPlaceholder {
|
|
|
324
335
|
this.createdBy = props.createdBy;
|
|
325
336
|
this.streamId = props.streamId;
|
|
326
337
|
this.version = props.version;
|
|
338
|
+
this.systemGenerated = props.systemGenerated;
|
|
327
339
|
}
|
|
328
340
|
apply(existing) {
|
|
329
341
|
if (!existing) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActivityLogEventStore } from '../..';
|
|
2
|
+
import { Event } from '../..';
|
|
3
|
+
export declare class IMActivityLogEventStore extends ActivityLogEventStore {
|
|
4
|
+
private events;
|
|
5
|
+
addEvent(_userId: string, event: Event): Promise<void>;
|
|
6
|
+
getAllEvents(): Event[];
|
|
7
|
+
clear(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=IMActivityLogEventStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMActivityLogEventStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMActivityLogEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAC,KAAK,EAAC,MAAM,OAAO,CAAC;AAE5B,qBAAa,uBAAwB,SAAQ,qBAAqB;IAChE,OAAO,CAAC,MAAM,CAAe;IAEvB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D,YAAY,IAAI,KAAK,EAAE;IAIvB,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMActivityLogEventStore = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
class IMActivityLogEventStore extends __1.ActivityLogEventStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.events = [];
|
|
9
|
+
}
|
|
10
|
+
async addEvent(_userId, event) {
|
|
11
|
+
this.events.push(event);
|
|
12
|
+
}
|
|
13
|
+
// Test helper methods
|
|
14
|
+
getAllEvents() {
|
|
15
|
+
return [...this.events];
|
|
16
|
+
}
|
|
17
|
+
clear() {
|
|
18
|
+
this.events = [];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.IMActivityLogEventStore = IMActivityLogEventStore;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActivityLogModelStore } from '../..';
|
|
2
|
+
import { ActivityLogModel } from '../..';
|
|
3
|
+
export declare class IMActivityLogModelStore extends ActivityLogModelStore {
|
|
4
|
+
private models;
|
|
5
|
+
getByStreamId(streamId: string): Promise<ActivityLogModel | undefined>;
|
|
6
|
+
getByStreamIdWhereDeletedIsFalse(streamId: string): Promise<ActivityLogModel | undefined>;
|
|
7
|
+
save(model: ActivityLogModel): Promise<void>;
|
|
8
|
+
clear(): void;
|
|
9
|
+
getAllModels(): ActivityLogModel[];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=IMActivityLogModelStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMActivityLogModelStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMActivityLogModelStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,OAAO,CAAC;AAEvC,qBAAa,uBAAwB,SAAQ,qBAAqB;IAChE,OAAO,CAAC,MAAM,CAA4C;IAEpD,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAItE,gCAAgC,CACpC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAQlC,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD,KAAK,IAAI,IAAI;IAIb,YAAY,IAAI,gBAAgB,EAAE;CAGnC"}
|
package/dist/{store/InMemoryModelStore.js → __tests__/test-helpers/IMActivityLogModelStore.js}
RENAMED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
class
|
|
3
|
+
exports.IMActivityLogModelStore = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
class IMActivityLogModelStore extends __1.ActivityLogModelStore {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
8
|
this.models = new Map();
|
|
9
9
|
}
|
|
10
|
+
async getByStreamId(streamId) {
|
|
11
|
+
return this.models.get(streamId);
|
|
12
|
+
}
|
|
10
13
|
async getByStreamIdWhereDeletedIsFalse(streamId) {
|
|
11
14
|
const model = this.models.get(streamId);
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
15
|
+
if (model && !model.deleted) {
|
|
16
|
+
return model;
|
|
14
17
|
}
|
|
15
|
-
return
|
|
18
|
+
return undefined;
|
|
16
19
|
}
|
|
17
20
|
async save(model) {
|
|
18
21
|
this.models.set(model.streamId, model);
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
return Array.from(this.models.values());
|
|
22
|
-
}
|
|
23
|
-
getAllWhereDeletedIsFalse() {
|
|
24
|
-
return Array.from(this.models.values()).filter((model) => !model.deleted);
|
|
25
|
-
}
|
|
23
|
+
// Test helper methods
|
|
26
24
|
clear() {
|
|
27
25
|
this.models.clear();
|
|
28
26
|
}
|
|
27
|
+
getAllModels() {
|
|
28
|
+
return Array.from(this.models.values());
|
|
29
|
+
}
|
|
29
30
|
}
|
|
30
|
-
exports.
|
|
31
|
+
exports.IMActivityLogModelStore = IMActivityLogModelStore;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FriendEventStore } from '../..';
|
|
2
|
+
import { Event } from '../..';
|
|
3
|
+
export declare class IMFriendEventStore extends FriendEventStore {
|
|
4
|
+
private events;
|
|
5
|
+
addEvent(_userId: string, event: Event): Promise<void>;
|
|
6
|
+
getAll(): Event[];
|
|
7
|
+
clear(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=IMFriendEventStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMFriendEventStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMFriendEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,KAAK,EAAC,MAAM,OAAO,CAAC;AAE5B,qBAAa,kBAAmB,SAAQ,gBAAgB;IACpD,OAAO,CAAC,MAAM,CAAe;IAEvB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,MAAM,IAAI,KAAK,EAAE;IAIjB,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMFriendEventStore = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
class IMFriendEventStore extends __1.FriendEventStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.events = [];
|
|
9
|
+
}
|
|
10
|
+
async addEvent(_userId, event) {
|
|
11
|
+
this.events.push(event);
|
|
12
|
+
}
|
|
13
|
+
getAll() {
|
|
14
|
+
return this.events;
|
|
15
|
+
}
|
|
16
|
+
clear() {
|
|
17
|
+
this.events = [];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.IMFriendEventStore = IMFriendEventStore;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FriendModelStore } from '../..';
|
|
2
|
+
import { FriendModel } from '../..';
|
|
3
|
+
export declare class IMFriendModelStore extends FriendModelStore {
|
|
4
|
+
private models;
|
|
5
|
+
getByStreamId(streamId: string): Promise<FriendModel | undefined>;
|
|
6
|
+
getByStreamIdWhereDeletedIsFalse(streamId: string): Promise<FriendModel | undefined>;
|
|
7
|
+
findByUserIdAndStreamIdAndDeletedIsFalse(userId: string, streamId: string): Promise<FriendModel | undefined>;
|
|
8
|
+
findByUserIdAndFriendIdAndDeletedIsFalse(userId: string, friendId: string): Promise<FriendModel | undefined>;
|
|
9
|
+
findByUserIdAndFriendEmailAndDeletedIsFalse(userId: string, email: string): Promise<FriendModel | undefined>;
|
|
10
|
+
findByUserIdAndFriendPhoneNumberAndDeletedIsFalse(userId: string, phoneNumber: string): Promise<FriendModel | undefined>;
|
|
11
|
+
save(model: FriendModel): Promise<void>;
|
|
12
|
+
getAll(): FriendModel[];
|
|
13
|
+
getAllWhereDeletedIsFalse(): FriendModel[];
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=IMFriendModelStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMFriendModelStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMFriendModelStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,OAAO,CAAC;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,OAAO,CAAC;AAElC,qBAAa,kBAAmB,SAAQ,gBAAgB;IACpD,OAAO,CAAC,MAAM,CAAuC;IAE/C,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAKjE,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAQpF,wCAAwC,CAC1C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAW7B,wCAAwC,CAC1C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAW7B,2CAA2C,CAC7C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAW7B,iDAAiD,CACnD,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAW7B,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,MAAM,IAAI,WAAW,EAAE;IAIvB,yBAAyB,IAAI,WAAW,EAAE;IAI1C,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMFriendModelStore = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
class IMFriendModelStore extends __1.FriendModelStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.models = new Map();
|
|
9
|
+
}
|
|
10
|
+
async getByStreamId(streamId) {
|
|
11
|
+
const model = this.models.get(streamId);
|
|
12
|
+
return model;
|
|
13
|
+
}
|
|
14
|
+
async getByStreamIdWhereDeletedIsFalse(streamId) {
|
|
15
|
+
const model = this.models.get(streamId);
|
|
16
|
+
if (!model || model.deleted) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return model;
|
|
20
|
+
}
|
|
21
|
+
async findByUserIdAndStreamIdAndDeletedIsFalse(userId, streamId) {
|
|
22
|
+
for (const model of this.models.values()) {
|
|
23
|
+
if (model.userId === userId &&
|
|
24
|
+
model.streamId === streamId &&
|
|
25
|
+
!model.deleted) {
|
|
26
|
+
return model;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
async findByUserIdAndFriendIdAndDeletedIsFalse(userId, friendId) {
|
|
32
|
+
for (const model of this.models.values()) {
|
|
33
|
+
if (model.userId === userId &&
|
|
34
|
+
model.friendId === friendId &&
|
|
35
|
+
!model.deleted) {
|
|
36
|
+
return model;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
async findByUserIdAndFriendEmailAndDeletedIsFalse(userId, email) {
|
|
42
|
+
for (const model of this.models.values()) {
|
|
43
|
+
if (model.userId === userId &&
|
|
44
|
+
model.friendEmail === email &&
|
|
45
|
+
!model.deleted) {
|
|
46
|
+
return model;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
async findByUserIdAndFriendPhoneNumberAndDeletedIsFalse(userId, phoneNumber) {
|
|
52
|
+
for (const model of this.models.values()) {
|
|
53
|
+
if (model.userId === userId &&
|
|
54
|
+
model.friendPhoneNumber === phoneNumber &&
|
|
55
|
+
!model.deleted) {
|
|
56
|
+
return model;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
async save(model) {
|
|
62
|
+
this.models.set(model.streamId, model);
|
|
63
|
+
}
|
|
64
|
+
getAll() {
|
|
65
|
+
return Array.from(this.models.values());
|
|
66
|
+
}
|
|
67
|
+
getAllWhereDeletedIsFalse() {
|
|
68
|
+
return Array.from(this.models.values()).filter((model) => !model.deleted);
|
|
69
|
+
}
|
|
70
|
+
clear() {
|
|
71
|
+
this.models.clear();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.IMFriendModelStore = IMFriendModelStore;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GroupEventStore } from '../..';
|
|
2
|
+
import { Event } from '../..';
|
|
3
|
+
export declare class IMGroupEventStore extends GroupEventStore {
|
|
4
|
+
private events;
|
|
5
|
+
addEvent(_userId: string, event: Event): Promise<void>;
|
|
6
|
+
getAll(): Event[];
|
|
7
|
+
clear(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=IMGroupEventStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMGroupEventStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMGroupEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,KAAK,EAAC,MAAM,OAAO,CAAC;AAE5B,qBAAa,iBAAkB,SAAQ,eAAe;IAClD,OAAO,CAAC,MAAM,CAAe;IAEvB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,MAAM,IAAI,KAAK,EAAE;IAIjB,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMGroupEventStore = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
class IMGroupEventStore extends __1.GroupEventStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.events = [];
|
|
9
|
+
}
|
|
10
|
+
async addEvent(_userId, event) {
|
|
11
|
+
this.events.push(event);
|
|
12
|
+
}
|
|
13
|
+
getAll() {
|
|
14
|
+
return this.events;
|
|
15
|
+
}
|
|
16
|
+
clear() {
|
|
17
|
+
this.events = [];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.IMGroupEventStore = IMGroupEventStore;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GroupModelStore } from '../..';
|
|
2
|
+
import { GroupModel } from '../..';
|
|
3
|
+
export declare class IMGroupModelStore extends GroupModelStore {
|
|
4
|
+
private models;
|
|
5
|
+
getByStreamId(streamId: string): Promise<GroupModel | undefined>;
|
|
6
|
+
getByStreamIdWhereDeletedIsFalse(streamId: string): Promise<GroupModel | undefined>;
|
|
7
|
+
findByUserIdAndGroupIdAndDeletedIsFalse(userId: string, groupId: string): Promise<GroupModel | undefined>;
|
|
8
|
+
findAllByGroupIdAndDeletedIsFalse(groupId: string): Promise<GroupModel[]>;
|
|
9
|
+
save(model: GroupModel): Promise<void>;
|
|
10
|
+
getAll(): GroupModel[];
|
|
11
|
+
getAllWhereDeletedIsFalse(): GroupModel[];
|
|
12
|
+
clear(): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=IMGroupModelStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMGroupModelStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMGroupModelStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AAEjC,qBAAa,iBAAkB,SAAQ,eAAe;IAClD,OAAO,CAAC,MAAM,CAAsC;IAE9C,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAKhE,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAQnF,uCAAuC,CACzC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAW5B,iCAAiC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAUzE,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5C,MAAM,IAAI,UAAU,EAAE;IAItB,yBAAyB,IAAI,UAAU,EAAE;IAIzC,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMGroupModelStore = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
class IMGroupModelStore extends __1.GroupModelStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.models = new Map();
|
|
9
|
+
}
|
|
10
|
+
async getByStreamId(streamId) {
|
|
11
|
+
const model = this.models.get(streamId);
|
|
12
|
+
return model;
|
|
13
|
+
}
|
|
14
|
+
async getByStreamIdWhereDeletedIsFalse(streamId) {
|
|
15
|
+
const model = this.models.get(streamId);
|
|
16
|
+
if (!model || model.deleted) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return model;
|
|
20
|
+
}
|
|
21
|
+
async findByUserIdAndGroupIdAndDeletedIsFalse(userId, groupId) {
|
|
22
|
+
for (const model of this.models.values()) {
|
|
23
|
+
if (model.userId === userId &&
|
|
24
|
+
model.groupId === groupId &&
|
|
25
|
+
!model.deleted) {
|
|
26
|
+
return model;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
async findAllByGroupIdAndDeletedIsFalse(groupId) {
|
|
32
|
+
const results = [];
|
|
33
|
+
for (const model of this.models.values()) {
|
|
34
|
+
if (model.groupId === groupId && !model.deleted) {
|
|
35
|
+
results.push(model);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return results;
|
|
39
|
+
}
|
|
40
|
+
async save(model) {
|
|
41
|
+
this.models.set(model.streamId, model);
|
|
42
|
+
}
|
|
43
|
+
getAll() {
|
|
44
|
+
return Array.from(this.models.values());
|
|
45
|
+
}
|
|
46
|
+
getAllWhereDeletedIsFalse() {
|
|
47
|
+
return Array.from(this.models.values()).filter((model) => !model.deleted);
|
|
48
|
+
}
|
|
49
|
+
clear() {
|
|
50
|
+
this.models.clear();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.IMGroupModelStore = IMGroupModelStore;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GroupTransactionEventStore } from '../..';
|
|
2
|
+
import { Event } from '../..';
|
|
3
|
+
export declare class IMGroupTransactionEventStore extends GroupTransactionEventStore {
|
|
4
|
+
private events;
|
|
5
|
+
addEvent(userId: string, event: Event): Promise<void>;
|
|
6
|
+
getEvents(userId: string): Event[];
|
|
7
|
+
clear(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=IMGroupTransactionEventStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMGroupTransactionEventStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMGroupTransactionEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,0BAA0B,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,KAAK,EAAC,MAAM,OAAO,CAAC;AAE5B,qBAAa,4BAA6B,SAAQ,0BAA0B;IACxE,OAAO,CAAC,MAAM,CAAmC;IAE3C,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3D,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE;IAIlC,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMGroupTransactionEventStore = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
class IMGroupTransactionEventStore extends __1.GroupTransactionEventStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.events = new Map();
|
|
9
|
+
}
|
|
10
|
+
async addEvent(userId, event) {
|
|
11
|
+
const userEvents = this.events.get(userId) || [];
|
|
12
|
+
userEvents.push(event);
|
|
13
|
+
this.events.set(userId, userEvents);
|
|
14
|
+
}
|
|
15
|
+
getEvents(userId) {
|
|
16
|
+
return this.events.get(userId) || [];
|
|
17
|
+
}
|
|
18
|
+
clear() {
|
|
19
|
+
this.events.clear();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.IMGroupTransactionEventStore = IMGroupTransactionEventStore;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GroupTransactionModelStore } from '../..';
|
|
2
|
+
import { GroupTransactionModel } from '../..';
|
|
3
|
+
export declare class IMGroupTransactionModelStore extends GroupTransactionModelStore {
|
|
4
|
+
private models;
|
|
5
|
+
getByStreamId(streamId: string): Promise<GroupTransactionModel | undefined>;
|
|
6
|
+
getByStreamIdWhereDeletedIsFalse(streamId: string): Promise<GroupTransactionModel | undefined>;
|
|
7
|
+
findAllByGroupIdAndTransactionIdAndDeletedIsFalse(groupId: string, transactionId: string): Promise<GroupTransactionModel[]>;
|
|
8
|
+
findByUserIdAndTransactionId(userId: string, transactionId: string): Promise<GroupTransactionModel | undefined>;
|
|
9
|
+
save(model: GroupTransactionModel): Promise<void>;
|
|
10
|
+
getAll(): GroupTransactionModel[];
|
|
11
|
+
getAllWhereDeletedIsFalse(): GroupTransactionModel[];
|
|
12
|
+
clear(): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=IMGroupTransactionModelStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMGroupTransactionModelStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMGroupTransactionModelStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,0BAA0B,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,EAAC,qBAAqB,EAAC,MAAM,OAAO,CAAC;AAE5C,qBAAa,4BAA6B,SAAQ,0BAA0B;IACxE,OAAO,CAAC,MAAM,CAAiD;IAEzD,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAK3E,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAQ9F,iDAAiD,CACnD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAY7B,4BAA4B,CAC9B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAWvC,IAAI,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvD,MAAM,IAAI,qBAAqB,EAAE;IAIjC,yBAAyB,IAAI,qBAAqB,EAAE;IAIpD,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMGroupTransactionModelStore = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
class IMGroupTransactionModelStore extends __1.GroupTransactionModelStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.models = new Map();
|
|
9
|
+
}
|
|
10
|
+
async getByStreamId(streamId) {
|
|
11
|
+
const model = this.models.get(streamId);
|
|
12
|
+
return model;
|
|
13
|
+
}
|
|
14
|
+
async getByStreamIdWhereDeletedIsFalse(streamId) {
|
|
15
|
+
const model = this.models.get(streamId);
|
|
16
|
+
if (!model || model.deleted) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return model;
|
|
20
|
+
}
|
|
21
|
+
async findAllByGroupIdAndTransactionIdAndDeletedIsFalse(groupId, transactionId) {
|
|
22
|
+
const results = [];
|
|
23
|
+
for (const model of this.models.values()) {
|
|
24
|
+
if (model.groupId === groupId &&
|
|
25
|
+
model.transactionId === transactionId &&
|
|
26
|
+
!model.deleted) {
|
|
27
|
+
results.push(model);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return results;
|
|
31
|
+
}
|
|
32
|
+
async findByUserIdAndTransactionId(userId, transactionId) {
|
|
33
|
+
for (const model of this.models.values()) {
|
|
34
|
+
if (model.userId === userId &&
|
|
35
|
+
model.transactionId === transactionId &&
|
|
36
|
+
!model.deleted) {
|
|
37
|
+
return model;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
async save(model) {
|
|
43
|
+
this.models.set(model.streamId, model);
|
|
44
|
+
}
|
|
45
|
+
getAll() {
|
|
46
|
+
return Array.from(this.models.values());
|
|
47
|
+
}
|
|
48
|
+
getAllWhereDeletedIsFalse() {
|
|
49
|
+
return Array.from(this.models.values()).filter((model) => !model.deleted);
|
|
50
|
+
}
|
|
51
|
+
clear() {
|
|
52
|
+
this.models.clear();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.IMGroupTransactionModelStore = IMGroupTransactionModelStore;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TransactionEventStore } from '../..';
|
|
2
|
+
import { Event } from '../..';
|
|
3
|
+
export declare class IMTransactionEventStore extends TransactionEventStore {
|
|
4
|
+
private events;
|
|
5
|
+
addEvent(_userId: string, event: Event): Promise<void>;
|
|
6
|
+
getEvents(): Event[];
|
|
7
|
+
getEventsByStreamId(streamId: string): Event[];
|
|
8
|
+
clear(): void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=IMTransactionEventStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMTransactionEventStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMTransactionEventStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAC,KAAK,EAAC,MAAM,OAAO,CAAC;AAE5B,qBAAa,uBAAwB,SAAQ,qBAAqB;IAC9D,OAAO,CAAC,MAAM,CAAe;IAEvB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5D,SAAS,IAAI,KAAK,EAAE;IAIpB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,EAAE;IAI9C,KAAK,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMTransactionEventStore = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
class IMTransactionEventStore extends __1.TransactionEventStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.events = [];
|
|
9
|
+
}
|
|
10
|
+
async addEvent(_userId, event) {
|
|
11
|
+
this.events.push(event);
|
|
12
|
+
}
|
|
13
|
+
getEvents() {
|
|
14
|
+
return [...this.events];
|
|
15
|
+
}
|
|
16
|
+
getEventsByStreamId(streamId) {
|
|
17
|
+
return this.events.filter((event) => event.streamId === streamId);
|
|
18
|
+
}
|
|
19
|
+
clear() {
|
|
20
|
+
this.events = [];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.IMTransactionEventStore = IMTransactionEventStore;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TransactionModelStore } from '../..';
|
|
2
|
+
import { TransactionModel } from '../..';
|
|
3
|
+
export declare class IMTransactionModelStore extends TransactionModelStore {
|
|
4
|
+
private models;
|
|
5
|
+
getByStreamId(streamId: string): Promise<TransactionModel | undefined>;
|
|
6
|
+
getByStreamIdWhereDeletedIsFalse(streamId: string): Promise<TransactionModel | undefined>;
|
|
7
|
+
findByUserAndLogicalTransactionId(userId: string, recipientUserId: string, logicalTransactionId: string): Promise<TransactionModel | undefined>;
|
|
8
|
+
findByGroupTransactionId(userId: string, groupTransactionId: string): Promise<TransactionModel[]>;
|
|
9
|
+
save(model: TransactionModel): Promise<void>;
|
|
10
|
+
getAll(): TransactionModel[];
|
|
11
|
+
getAllWhereDeletedIsFalse(): TransactionModel[];
|
|
12
|
+
clear(): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=IMTransactionModelStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMTransactionModelStore.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-helpers/IMTransactionModelStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,OAAO,CAAC;AAEvC,qBAAa,uBAAwB,SAAQ,qBAAqB;IAC9D,OAAO,CAAC,MAAM,CAA4C;IAEpD,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAKtE,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAQzF,iCAAiC,CACnC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EACvB,oBAAoB,EAAE,MAAM,GAC7B,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAclC,wBAAwB,CAC1B,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,MAAM,GAC3B,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAcxB,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlD,MAAM,IAAI,gBAAgB,EAAE;IAI5B,yBAAyB,IAAI,gBAAgB,EAAE;IAI/C,KAAK,IAAI,IAAI;CAGhB"}
|