@zeeshan60/event-processor 1.0.5 → 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/ActivityLogEvents.d.ts +2 -0
- package/dist/ActivityLogEvents.d.ts.map +1 -1
- package/dist/ActivityLogEvents.js +1 -0
- package/dist/FriendEventHandler.d.ts.map +1 -1
- package/dist/FriendEventHandler.js +5 -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.map +1 -1
- package/dist/GroupEventHandler.js +8 -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.map +1 -1
- package/dist/GroupTransactionEventHandler.js +7 -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.map +1 -1
- package/dist/TransactionEventHandler.js +7 -0
- package/dist/TransactionEvents.d.ts +16 -0
- package/dist/TransactionEvents.d.ts.map +1 -1
- package/dist/TransactionEvents.js +16 -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/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/utils/eventConverter.d.ts +0 -23
- package/dist/utils/eventConverter.d.ts.map +0 -1
- package/dist/utils/eventConverter.js +0 -370
package/dist/UserEvents.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export interface UserCreatedProps {
|
|
|
37
37
|
createdBy: string;
|
|
38
38
|
streamId: string;
|
|
39
39
|
version: number;
|
|
40
|
+
systemGenerated: boolean;
|
|
40
41
|
}
|
|
41
42
|
export declare class UserCreated implements Event {
|
|
42
43
|
userId?: string;
|
|
@@ -50,6 +51,7 @@ export declare class UserCreated implements Event {
|
|
|
50
51
|
createdBy: string;
|
|
51
52
|
streamId: string;
|
|
52
53
|
version: number;
|
|
54
|
+
systemGenerated: boolean;
|
|
53
55
|
constructor(props: UserCreatedProps);
|
|
54
56
|
apply(_existing?: Model): UserModel;
|
|
55
57
|
activityLog(_existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
@@ -63,6 +65,7 @@ export interface PlaceholderUserCreatedProps {
|
|
|
63
65
|
createdBy: string;
|
|
64
66
|
streamId: string;
|
|
65
67
|
version: number;
|
|
68
|
+
systemGenerated: boolean;
|
|
66
69
|
}
|
|
67
70
|
export declare class PlaceholderUserCreated implements Event {
|
|
68
71
|
userId?: string;
|
|
@@ -73,6 +76,7 @@ export declare class PlaceholderUserCreated implements Event {
|
|
|
73
76
|
createdBy: string;
|
|
74
77
|
streamId: string;
|
|
75
78
|
version: number;
|
|
79
|
+
systemGenerated: boolean;
|
|
76
80
|
constructor(props: PlaceholderUserCreatedProps);
|
|
77
81
|
apply(_existing?: Model): UserModel;
|
|
78
82
|
}
|
|
@@ -83,6 +87,7 @@ export interface UserCurrencyChangedProps {
|
|
|
83
87
|
createdBy: string;
|
|
84
88
|
streamId: string;
|
|
85
89
|
version: number;
|
|
90
|
+
systemGenerated: boolean;
|
|
86
91
|
}
|
|
87
92
|
export declare class UserCurrencyChanged implements Event {
|
|
88
93
|
userId?: string;
|
|
@@ -91,6 +96,7 @@ export declare class UserCurrencyChanged implements Event {
|
|
|
91
96
|
createdBy: string;
|
|
92
97
|
streamId: string;
|
|
93
98
|
version: number;
|
|
99
|
+
systemGenerated: boolean;
|
|
94
100
|
constructor(props: UserCurrencyChangedProps);
|
|
95
101
|
apply(existing?: Model): UserModel;
|
|
96
102
|
activityLog(existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
@@ -102,6 +108,7 @@ export interface UserPhoneNumberChangedProps {
|
|
|
102
108
|
createdBy: string;
|
|
103
109
|
streamId: string;
|
|
104
110
|
version: number;
|
|
111
|
+
systemGenerated: boolean;
|
|
105
112
|
}
|
|
106
113
|
export declare class UserPhoneNumberChanged implements Event {
|
|
107
114
|
userId?: string;
|
|
@@ -110,6 +117,7 @@ export declare class UserPhoneNumberChanged implements Event {
|
|
|
110
117
|
createdBy: string;
|
|
111
118
|
streamId: string;
|
|
112
119
|
version: number;
|
|
120
|
+
systemGenerated: boolean;
|
|
113
121
|
constructor(props: UserPhoneNumberChangedProps);
|
|
114
122
|
apply(existing?: Model): UserModel;
|
|
115
123
|
activityLog(existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
@@ -121,6 +129,7 @@ export interface UserDisplayNameChangedProps {
|
|
|
121
129
|
createdBy: string;
|
|
122
130
|
streamId: string;
|
|
123
131
|
version: number;
|
|
132
|
+
systemGenerated: boolean;
|
|
124
133
|
}
|
|
125
134
|
export declare class UserDisplayNameChanged implements Event {
|
|
126
135
|
userId?: string;
|
|
@@ -129,6 +138,7 @@ export declare class UserDisplayNameChanged implements Event {
|
|
|
129
138
|
createdBy: string;
|
|
130
139
|
streamId: string;
|
|
131
140
|
version: number;
|
|
141
|
+
systemGenerated: boolean;
|
|
132
142
|
constructor(props: UserDisplayNameChangedProps);
|
|
133
143
|
apply(existing?: Model): UserModel;
|
|
134
144
|
activityLog(existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
@@ -139,6 +149,7 @@ export interface UserDeletedProps {
|
|
|
139
149
|
createdBy: string;
|
|
140
150
|
streamId: string;
|
|
141
151
|
version: number;
|
|
152
|
+
systemGenerated: boolean;
|
|
142
153
|
}
|
|
143
154
|
export declare class UserDeleted implements Event {
|
|
144
155
|
userId?: string;
|
|
@@ -146,6 +157,7 @@ export declare class UserDeleted implements Event {
|
|
|
146
157
|
createdBy: string;
|
|
147
158
|
streamId: string;
|
|
148
159
|
version: number;
|
|
160
|
+
systemGenerated: boolean;
|
|
149
161
|
constructor(props: UserDeletedProps);
|
|
150
162
|
apply(existing?: Model): UserModel;
|
|
151
163
|
}
|
|
@@ -161,6 +173,7 @@ export interface PlaceholderUserMergedProps {
|
|
|
161
173
|
createdBy: string;
|
|
162
174
|
streamId: string;
|
|
163
175
|
version: number;
|
|
176
|
+
systemGenerated: boolean;
|
|
164
177
|
}
|
|
165
178
|
export declare class PlaceholderUserMerged implements Event {
|
|
166
179
|
userId?: string;
|
|
@@ -174,6 +187,7 @@ export declare class PlaceholderUserMerged implements Event {
|
|
|
174
187
|
createdBy: string;
|
|
175
188
|
streamId: string;
|
|
176
189
|
version: number;
|
|
190
|
+
systemGenerated: boolean;
|
|
177
191
|
constructor(props: PlaceholderUserMergedProps);
|
|
178
192
|
apply(existing?: Model): UserModel;
|
|
179
193
|
}
|
|
@@ -183,6 +197,7 @@ export interface UserConvertedToPlaceholderProps {
|
|
|
183
197
|
createdBy: string;
|
|
184
198
|
streamId: string;
|
|
185
199
|
version: number;
|
|
200
|
+
systemGenerated: boolean;
|
|
186
201
|
}
|
|
187
202
|
export declare class UserConvertedToPlaceholder implements Event {
|
|
188
203
|
userId?: string;
|
|
@@ -190,6 +205,7 @@ export declare class UserConvertedToPlaceholder implements Event {
|
|
|
190
205
|
createdBy: string;
|
|
191
206
|
streamId: string;
|
|
192
207
|
version: number;
|
|
208
|
+
systemGenerated: boolean;
|
|
193
209
|
constructor(props: UserConvertedToPlaceholderProps);
|
|
194
210
|
apply(existing?: Model): UserModel;
|
|
195
211
|
}
|
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,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAc,MAAM,qBAAqB,CAAC;AAI1E,oBAAY,aAAa;IACvB,YAAY,iBAAiB;IAC7B,wBAAwB,6BAA6B;IACrD,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,uBAAuB,4BAA4B;IACnD,6BAA6B,kCAAkC;CAChE;AAGD,MAAM,WAAW,SAAU,SAAQ,KAAK;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAA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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"}
|