@zeeshan60/event-processor 1.0.1 → 1.0.2
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 +41 -0
- package/dist/ActivityLogEvents.d.ts.map +1 -0
- package/dist/ActivityLogEvents.js +37 -0
- package/dist/FriendEvents.d.ts +122 -0
- package/dist/FriendEvents.d.ts.map +1 -0
- package/dist/FriendEvents.js +213 -0
- package/dist/TransactionEvents.d.ts +77 -56
- package/dist/TransactionEvents.d.ts.map +1 -1
- package/dist/TransactionEvents.js +274 -26
- package/dist/UserEvents.d.ts +54 -49
- package/dist/UserEvents.d.ts.map +1 -1
- package/dist/UserEvents.js +108 -8
- package/dist/common/Event.d.ts +3 -2
- package/dist/common/Event.d.ts.map +1 -1
- package/dist/common/Model.d.ts +0 -1
- package/dist/common/Model.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -3
- package/package.json +5 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TransactionDateChanged = exports.CurrencyChanged = exports.SplitTypeChanged = exports.TotalAmountChanged = exports.DescriptionChanged = exports.TransactionDeleted = exports.TransactionCreated = exports.ChangeHistory = exports.TransactionEventType = exports.SplitType = void 0;
|
|
4
|
+
const ActivityLogEvents_1 = require("./ActivityLogEvents");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
4
6
|
// Enums
|
|
5
7
|
var SplitType;
|
|
6
8
|
(function (SplitType) {
|
|
@@ -36,6 +38,7 @@ class TransactionCreated {
|
|
|
36
38
|
this.splitType = props.splitType;
|
|
37
39
|
this.totalAmount = props.totalAmount;
|
|
38
40
|
this.amount = props.amount;
|
|
41
|
+
this.isOwed = props.isOwed;
|
|
39
42
|
this.transactionDate = props.transactionDate;
|
|
40
43
|
this.groupId = props.groupId;
|
|
41
44
|
this.groupTransactionId = props.groupTransactionId;
|
|
@@ -45,8 +48,10 @@ class TransactionCreated {
|
|
|
45
48
|
this.version = props.version;
|
|
46
49
|
}
|
|
47
50
|
apply(_existing) {
|
|
51
|
+
if (!this.userId) {
|
|
52
|
+
throw new Error('userId is required for TransactionModel');
|
|
53
|
+
}
|
|
48
54
|
return {
|
|
49
|
-
id: null,
|
|
50
55
|
streamId: this.streamId,
|
|
51
56
|
logicalTransactionId: this.logicalTransactionId,
|
|
52
57
|
userId: this.userId,
|
|
@@ -56,6 +61,7 @@ class TransactionCreated {
|
|
|
56
61
|
splitType: this.splitType,
|
|
57
62
|
totalAmount: this.totalAmount,
|
|
58
63
|
amount: this.amount,
|
|
64
|
+
isOwed: this.isOwed,
|
|
59
65
|
transactionDate: this.transactionDate,
|
|
60
66
|
createdAt: this.createdAt,
|
|
61
67
|
updatedAt: this.createdAt,
|
|
@@ -68,27 +74,29 @@ class TransactionCreated {
|
|
|
68
74
|
history: ChangeHistory.empty(),
|
|
69
75
|
};
|
|
70
76
|
}
|
|
77
|
+
activityLog(_existing, actorName) {
|
|
78
|
+
if (!this.userId) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const actor = actorName ?? 'You';
|
|
82
|
+
const logMessage = `${actor} created transaction "${this.description}" for ${this.totalAmount} ${this.currency}`;
|
|
83
|
+
return {
|
|
84
|
+
userId: this.userId,
|
|
85
|
+
activityByUid: this.createdBy,
|
|
86
|
+
sourceStreamId: this.streamId,
|
|
87
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
88
|
+
logMessage,
|
|
89
|
+
date: this.transactionDate,
|
|
90
|
+
createdAt: this.createdAt,
|
|
91
|
+
createdBy: this.createdBy,
|
|
92
|
+
streamId: (0, uuid_1.v4)(),
|
|
93
|
+
version: 1,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
71
96
|
}
|
|
72
97
|
exports.TransactionCreated = TransactionCreated;
|
|
73
|
-
var TransactionChangeType;
|
|
74
|
-
(function (TransactionChangeType) {
|
|
75
|
-
TransactionChangeType["TRANSACTION_DATE"] = "TRANSACTION_DATE";
|
|
76
|
-
TransactionChangeType["DESCRIPTION"] = "DESCRIPTION";
|
|
77
|
-
TransactionChangeType["TOTAL_AMOUNT"] = "TOTAL_AMOUNT";
|
|
78
|
-
TransactionChangeType["CURRENCY"] = "CURRENCY";
|
|
79
|
-
TransactionChangeType["SPLIT_TYPE"] = "SPLIT_TYPE";
|
|
80
|
-
TransactionChangeType["DELETED"] = "DELETED";
|
|
81
|
-
})(TransactionChangeType || (exports.TransactionChangeType = TransactionChangeType = {}));
|
|
82
|
-
var ActivityType;
|
|
83
|
-
(function (ActivityType) {
|
|
84
|
-
ActivityType["CREATED"] = "CREATED";
|
|
85
|
-
ActivityType["UPDATED"] = "UPDATED";
|
|
86
|
-
ActivityType["DELETED"] = "DELETED";
|
|
87
|
-
})(ActivityType || (exports.ActivityType = ActivityType = {}));
|
|
88
98
|
class TransactionDeleted {
|
|
89
99
|
constructor(props) {
|
|
90
|
-
this.userId = props.userId;
|
|
91
|
-
this.recipientUserId = props.recipientUserId;
|
|
92
100
|
this.streamId = props.streamId;
|
|
93
101
|
this.version = props.version;
|
|
94
102
|
this.createdAt = props.createdAt;
|
|
@@ -96,7 +104,7 @@ class TransactionDeleted {
|
|
|
96
104
|
}
|
|
97
105
|
apply(existing) {
|
|
98
106
|
if (!existing) {
|
|
99
|
-
throw new Error('TransactionModel
|
|
107
|
+
throw new Error('TransactionModel is required for deletion');
|
|
100
108
|
}
|
|
101
109
|
const existingTx = existing;
|
|
102
110
|
return {
|
|
@@ -107,12 +115,30 @@ class TransactionDeleted {
|
|
|
107
115
|
updatedAt: this.createdAt,
|
|
108
116
|
};
|
|
109
117
|
}
|
|
118
|
+
activityLog(existing, actorName) {
|
|
119
|
+
if (!existing) {
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
const existingTx = existing;
|
|
123
|
+
const actor = actorName ?? 'You';
|
|
124
|
+
const logMessage = `${actor} deleted transaction "${existingTx.description}"`;
|
|
125
|
+
return {
|
|
126
|
+
userId: existingTx.userId,
|
|
127
|
+
activityByUid: this.createdBy,
|
|
128
|
+
sourceStreamId: this.streamId,
|
|
129
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
130
|
+
logMessage,
|
|
131
|
+
date: this.createdAt,
|
|
132
|
+
createdAt: this.createdAt,
|
|
133
|
+
createdBy: this.createdBy,
|
|
134
|
+
streamId: (0, uuid_1.v4)(),
|
|
135
|
+
version: 1,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
110
138
|
}
|
|
111
139
|
exports.TransactionDeleted = TransactionDeleted;
|
|
112
140
|
class DescriptionChanged {
|
|
113
141
|
constructor(props) {
|
|
114
|
-
this.userId = props.userId;
|
|
115
|
-
this.recipientUserId = props.recipientUserId;
|
|
116
142
|
this.description = props.description;
|
|
117
143
|
this.streamId = props.streamId;
|
|
118
144
|
this.version = props.version;
|
|
@@ -121,23 +147,51 @@ class DescriptionChanged {
|
|
|
121
147
|
}
|
|
122
148
|
apply(existing) {
|
|
123
149
|
if (!existing) {
|
|
124
|
-
throw new Error('TransactionModel
|
|
150
|
+
throw new Error('TransactionModel is required');
|
|
125
151
|
}
|
|
126
152
|
const existingTx = existing;
|
|
153
|
+
const descriptionChange = {
|
|
154
|
+
type: 'DESCRIPTION_UPDATED',
|
|
155
|
+
changedAt: this.createdAt,
|
|
156
|
+
changedBy: this.createdBy,
|
|
157
|
+
oldValue: existingTx.description,
|
|
158
|
+
newValue: this.description,
|
|
159
|
+
};
|
|
127
160
|
return {
|
|
128
161
|
...existingTx,
|
|
129
162
|
description: this.description,
|
|
130
163
|
version: this.version,
|
|
131
164
|
updatedBy: this.createdBy,
|
|
132
165
|
updatedAt: this.createdAt,
|
|
166
|
+
history: {
|
|
167
|
+
changes: [descriptionChange, ...existingTx.history.changes],
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
activityLog(existing, actorName) {
|
|
172
|
+
if (!existing) {
|
|
173
|
+
return undefined;
|
|
174
|
+
}
|
|
175
|
+
const existingTx = existing;
|
|
176
|
+
const actor = actorName ?? 'You';
|
|
177
|
+
const logMessage = `${actor} changed description from "${existingTx.description}" to "${this.description}"`;
|
|
178
|
+
return {
|
|
179
|
+
userId: existingTx.userId,
|
|
180
|
+
activityByUid: this.createdBy,
|
|
181
|
+
sourceStreamId: this.streamId,
|
|
182
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
183
|
+
logMessage,
|
|
184
|
+
date: this.createdAt,
|
|
185
|
+
createdAt: this.createdAt,
|
|
186
|
+
createdBy: this.createdBy,
|
|
187
|
+
streamId: (0, uuid_1.v4)(),
|
|
188
|
+
version: 1,
|
|
133
189
|
};
|
|
134
190
|
}
|
|
135
191
|
}
|
|
136
192
|
exports.DescriptionChanged = DescriptionChanged;
|
|
137
193
|
class TotalAmountChanged {
|
|
138
194
|
constructor(props) {
|
|
139
|
-
this.userId = props.userId;
|
|
140
|
-
this.recipientUserId = props.recipientUserId;
|
|
141
195
|
this.totalAmount = props.totalAmount;
|
|
142
196
|
this.streamId = props.streamId;
|
|
143
197
|
this.version = props.version;
|
|
@@ -146,16 +200,210 @@ class TotalAmountChanged {
|
|
|
146
200
|
}
|
|
147
201
|
apply(existing) {
|
|
148
202
|
if (!existing) {
|
|
149
|
-
throw new Error('TransactionModel
|
|
203
|
+
throw new Error('TransactionModel is required');
|
|
150
204
|
}
|
|
151
205
|
const existingTx = existing;
|
|
206
|
+
const amountChange = {
|
|
207
|
+
type: 'AMOUNT_UPDATED',
|
|
208
|
+
changedAt: this.createdAt,
|
|
209
|
+
changedBy: this.createdBy,
|
|
210
|
+
oldValue: existingTx.totalAmount,
|
|
211
|
+
newValue: this.totalAmount,
|
|
212
|
+
};
|
|
152
213
|
return {
|
|
153
214
|
...existingTx,
|
|
154
215
|
totalAmount: this.totalAmount,
|
|
155
216
|
version: this.version,
|
|
156
217
|
updatedBy: this.createdBy,
|
|
157
218
|
updatedAt: this.createdAt,
|
|
219
|
+
history: {
|
|
220
|
+
changes: [amountChange, ...existingTx.history.changes],
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
activityLog(existing, actorName) {
|
|
225
|
+
if (!existing) {
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
const existingTx = existing;
|
|
229
|
+
const actor = actorName ?? 'You';
|
|
230
|
+
const logMessage = `${actor} changed amount from ${existingTx.totalAmount} ${existingTx.currency} to ${this.totalAmount} ${existingTx.currency}`;
|
|
231
|
+
return {
|
|
232
|
+
userId: existingTx.userId,
|
|
233
|
+
activityByUid: this.createdBy,
|
|
234
|
+
sourceStreamId: this.streamId,
|
|
235
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
236
|
+
logMessage,
|
|
237
|
+
date: this.createdAt,
|
|
238
|
+
createdAt: this.createdAt,
|
|
239
|
+
createdBy: this.createdBy,
|
|
240
|
+
streamId: (0, uuid_1.v4)(),
|
|
241
|
+
version: 1,
|
|
158
242
|
};
|
|
159
243
|
}
|
|
160
244
|
}
|
|
161
245
|
exports.TotalAmountChanged = TotalAmountChanged;
|
|
246
|
+
class SplitTypeChanged {
|
|
247
|
+
constructor(props) {
|
|
248
|
+
this.splitType = props.splitType;
|
|
249
|
+
this.totalAmount = props.totalAmount;
|
|
250
|
+
this.amount = props.amount;
|
|
251
|
+
this.isOwed = props.isOwed;
|
|
252
|
+
this.streamId = props.streamId;
|
|
253
|
+
this.version = props.version;
|
|
254
|
+
this.createdAt = props.createdAt;
|
|
255
|
+
this.createdBy = props.createdBy;
|
|
256
|
+
}
|
|
257
|
+
apply(existing) {
|
|
258
|
+
if (!existing) {
|
|
259
|
+
throw new Error('TransactionModel is required');
|
|
260
|
+
}
|
|
261
|
+
const existingTx = existing;
|
|
262
|
+
const splitTypeChange = {
|
|
263
|
+
type: 'SPLIT_TYPE_UPDATED',
|
|
264
|
+
changedAt: this.createdAt,
|
|
265
|
+
changedBy: this.createdBy,
|
|
266
|
+
oldValue: existingTx.splitType,
|
|
267
|
+
newValue: this.splitType,
|
|
268
|
+
};
|
|
269
|
+
return {
|
|
270
|
+
...existingTx,
|
|
271
|
+
splitType: this.splitType,
|
|
272
|
+
amount: this.amount,
|
|
273
|
+
isOwed: this.isOwed,
|
|
274
|
+
version: this.version,
|
|
275
|
+
updatedBy: this.createdBy,
|
|
276
|
+
updatedAt: this.createdAt,
|
|
277
|
+
history: {
|
|
278
|
+
changes: [splitTypeChange, ...existingTx.history.changes],
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
activityLog(existing, actorName) {
|
|
283
|
+
if (!existing) {
|
|
284
|
+
return undefined;
|
|
285
|
+
}
|
|
286
|
+
const existingTx = existing;
|
|
287
|
+
const actor = actorName ?? 'You';
|
|
288
|
+
const logMessage = `${actor} changed split type from ${existingTx.splitType} to ${this.splitType}`;
|
|
289
|
+
return {
|
|
290
|
+
userId: existingTx.userId,
|
|
291
|
+
activityByUid: this.createdBy,
|
|
292
|
+
sourceStreamId: this.streamId,
|
|
293
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
294
|
+
logMessage,
|
|
295
|
+
date: this.createdAt,
|
|
296
|
+
createdAt: this.createdAt,
|
|
297
|
+
createdBy: this.createdBy,
|
|
298
|
+
streamId: (0, uuid_1.v4)(),
|
|
299
|
+
version: 1,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
exports.SplitTypeChanged = SplitTypeChanged;
|
|
304
|
+
class CurrencyChanged {
|
|
305
|
+
constructor(props) {
|
|
306
|
+
this.currency = props.currency;
|
|
307
|
+
this.streamId = props.streamId;
|
|
308
|
+
this.version = props.version;
|
|
309
|
+
this.createdAt = props.createdAt;
|
|
310
|
+
this.createdBy = props.createdBy;
|
|
311
|
+
}
|
|
312
|
+
apply(existing) {
|
|
313
|
+
if (!existing) {
|
|
314
|
+
throw new Error('TransactionModel is required');
|
|
315
|
+
}
|
|
316
|
+
const existingTx = existing;
|
|
317
|
+
const currencyChange = {
|
|
318
|
+
type: 'CURRENCY_UPDATED',
|
|
319
|
+
changedAt: this.createdAt,
|
|
320
|
+
changedBy: this.createdBy,
|
|
321
|
+
oldValue: existingTx.currency,
|
|
322
|
+
newValue: this.currency,
|
|
323
|
+
};
|
|
324
|
+
return {
|
|
325
|
+
...existingTx,
|
|
326
|
+
currency: this.currency,
|
|
327
|
+
version: this.version,
|
|
328
|
+
updatedBy: this.createdBy,
|
|
329
|
+
updatedAt: this.createdAt,
|
|
330
|
+
history: {
|
|
331
|
+
changes: [currencyChange, ...existingTx.history.changes],
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
activityLog(existing, actorName) {
|
|
336
|
+
if (!existing) {
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
const existingTx = existing;
|
|
340
|
+
const actor = actorName ?? 'You';
|
|
341
|
+
const logMessage = `${actor} changed currency from ${existingTx.currency} to ${this.currency}`;
|
|
342
|
+
return {
|
|
343
|
+
userId: existingTx.userId,
|
|
344
|
+
activityByUid: this.createdBy,
|
|
345
|
+
sourceStreamId: this.streamId,
|
|
346
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
347
|
+
logMessage,
|
|
348
|
+
date: this.createdAt,
|
|
349
|
+
createdAt: this.createdAt,
|
|
350
|
+
createdBy: this.createdBy,
|
|
351
|
+
streamId: (0, uuid_1.v4)(),
|
|
352
|
+
version: 1,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
exports.CurrencyChanged = CurrencyChanged;
|
|
357
|
+
class TransactionDateChanged {
|
|
358
|
+
constructor(props) {
|
|
359
|
+
this.transactionDate = props.transactionDate;
|
|
360
|
+
this.streamId = props.streamId;
|
|
361
|
+
this.version = props.version;
|
|
362
|
+
this.createdAt = props.createdAt;
|
|
363
|
+
this.createdBy = props.createdBy;
|
|
364
|
+
}
|
|
365
|
+
apply(existing) {
|
|
366
|
+
if (!existing) {
|
|
367
|
+
throw new Error('TransactionModel is required');
|
|
368
|
+
}
|
|
369
|
+
const existingTx = existing;
|
|
370
|
+
const dateChange = {
|
|
371
|
+
type: 'TRANSACTION_DATE_UPDATED',
|
|
372
|
+
changedAt: this.createdAt,
|
|
373
|
+
changedBy: this.createdBy,
|
|
374
|
+
oldValue: existingTx.transactionDate,
|
|
375
|
+
newValue: this.transactionDate,
|
|
376
|
+
};
|
|
377
|
+
return {
|
|
378
|
+
...existingTx,
|
|
379
|
+
transactionDate: this.transactionDate,
|
|
380
|
+
version: this.version,
|
|
381
|
+
updatedBy: this.createdBy,
|
|
382
|
+
updatedAt: this.createdAt,
|
|
383
|
+
history: {
|
|
384
|
+
changes: [dateChange, ...existingTx.history.changes],
|
|
385
|
+
},
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
activityLog(existing, actorName) {
|
|
389
|
+
if (!existing) {
|
|
390
|
+
return undefined;
|
|
391
|
+
}
|
|
392
|
+
const existingTx = existing;
|
|
393
|
+
const actor = actorName ?? 'You';
|
|
394
|
+
const logMessage = `${actor} changed transaction date from ${existingTx.transactionDate.toLocaleDateString()} to ${this.transactionDate.toLocaleDateString()}`;
|
|
395
|
+
return {
|
|
396
|
+
userId: existingTx.userId,
|
|
397
|
+
activityByUid: this.createdBy,
|
|
398
|
+
sourceStreamId: this.streamId,
|
|
399
|
+
sourceType: ActivityLogEvents_1.SourceType.Transaction,
|
|
400
|
+
logMessage,
|
|
401
|
+
date: this.createdAt,
|
|
402
|
+
createdAt: this.createdAt,
|
|
403
|
+
createdBy: this.createdBy,
|
|
404
|
+
streamId: (0, uuid_1.v4)(),
|
|
405
|
+
version: 1,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
exports.TransactionDateChanged = TransactionDateChanged;
|
package/dist/UserEvents.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Event } from './common/Event';
|
|
2
2
|
import { Model } from './common/Model';
|
|
3
|
+
import { ActivityLogCreatedProps } from './ActivityLogEvents';
|
|
3
4
|
export declare enum UserEventType {
|
|
4
5
|
USER_CREATED = "USER_CREATED",
|
|
5
6
|
PLACEHOLDER_USER_CREATED = "PLACEHOLDER_USER_CREATED",
|
|
@@ -11,12 +12,12 @@ export declare enum UserEventType {
|
|
|
11
12
|
USER_CONVERTED_TO_PLACEHOLDER = "USER_CONVERTED_TO_PLACEHOLDER"
|
|
12
13
|
}
|
|
13
14
|
export interface UserModel extends Model {
|
|
14
|
-
uid
|
|
15
|
+
uid?: string;
|
|
15
16
|
displayName: string;
|
|
16
|
-
phoneNumber
|
|
17
|
-
currency
|
|
18
|
-
email
|
|
19
|
-
photoUrl
|
|
17
|
+
phoneNumber?: string;
|
|
18
|
+
currency?: string;
|
|
19
|
+
email?: string;
|
|
20
|
+
photoUrl?: string;
|
|
20
21
|
emailVerified: boolean;
|
|
21
22
|
isPlaceholder: boolean;
|
|
22
23
|
createdAt: Date;
|
|
@@ -25,12 +26,12 @@ export interface UserModel extends Model {
|
|
|
25
26
|
updatedBy: string;
|
|
26
27
|
}
|
|
27
28
|
export interface UserCreatedProps {
|
|
28
|
-
userId
|
|
29
|
+
userId?: string;
|
|
29
30
|
firebaseUid: string;
|
|
30
31
|
displayName: string;
|
|
31
|
-
phoneNumber
|
|
32
|
-
email
|
|
33
|
-
photoUrl
|
|
32
|
+
phoneNumber?: string;
|
|
33
|
+
email?: string;
|
|
34
|
+
photoUrl?: string;
|
|
34
35
|
emailVerified: boolean;
|
|
35
36
|
createdAt: Date;
|
|
36
37
|
createdBy: string;
|
|
@@ -38,80 +39,83 @@ export interface UserCreatedProps {
|
|
|
38
39
|
version: number;
|
|
39
40
|
}
|
|
40
41
|
export declare class UserCreated implements Event {
|
|
41
|
-
userId
|
|
42
|
+
userId?: string;
|
|
42
43
|
firebaseUid: string;
|
|
43
44
|
displayName: string;
|
|
44
|
-
phoneNumber
|
|
45
|
-
email
|
|
46
|
-
photoUrl
|
|
45
|
+
phoneNumber?: string;
|
|
46
|
+
email?: string;
|
|
47
|
+
photoUrl?: string;
|
|
47
48
|
emailVerified: boolean;
|
|
48
49
|
createdAt: Date;
|
|
49
50
|
createdBy: string;
|
|
50
51
|
streamId: string;
|
|
51
52
|
version: number;
|
|
52
53
|
constructor(props: UserCreatedProps);
|
|
53
|
-
apply(_existing
|
|
54
|
+
apply(_existing?: Model): UserModel;
|
|
55
|
+
activityLog(_existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
54
56
|
}
|
|
55
57
|
export interface PlaceholderUserCreatedProps {
|
|
56
|
-
userId
|
|
58
|
+
userId?: string;
|
|
57
59
|
displayName: string;
|
|
58
|
-
phoneNumber
|
|
59
|
-
email
|
|
60
|
+
phoneNumber?: string;
|
|
61
|
+
email?: string;
|
|
60
62
|
createdAt: Date;
|
|
61
63
|
createdBy: string;
|
|
62
64
|
streamId: string;
|
|
63
65
|
version: number;
|
|
64
66
|
}
|
|
65
67
|
export declare class PlaceholderUserCreated implements Event {
|
|
66
|
-
userId
|
|
68
|
+
userId?: string;
|
|
67
69
|
displayName: string;
|
|
68
|
-
phoneNumber
|
|
69
|
-
email
|
|
70
|
+
phoneNumber?: string;
|
|
71
|
+
email?: string;
|
|
70
72
|
createdAt: Date;
|
|
71
73
|
createdBy: string;
|
|
72
74
|
streamId: string;
|
|
73
75
|
version: number;
|
|
74
76
|
constructor(props: PlaceholderUserCreatedProps);
|
|
75
|
-
apply(_existing
|
|
77
|
+
apply(_existing?: Model): UserModel;
|
|
76
78
|
}
|
|
77
79
|
export interface UserCurrencyChangedProps {
|
|
78
|
-
userId
|
|
79
|
-
currency
|
|
80
|
+
userId?: string;
|
|
81
|
+
currency?: string;
|
|
80
82
|
createdAt: Date;
|
|
81
83
|
createdBy: string;
|
|
82
84
|
streamId: string;
|
|
83
85
|
version: number;
|
|
84
86
|
}
|
|
85
87
|
export declare class UserCurrencyChanged implements Event {
|
|
86
|
-
userId
|
|
87
|
-
currency
|
|
88
|
+
userId?: string;
|
|
89
|
+
currency?: string;
|
|
88
90
|
createdAt: Date;
|
|
89
91
|
createdBy: string;
|
|
90
92
|
streamId: string;
|
|
91
93
|
version: number;
|
|
92
94
|
constructor(props: UserCurrencyChangedProps);
|
|
93
|
-
apply(existing
|
|
95
|
+
apply(existing?: Model): UserModel;
|
|
96
|
+
activityLog(existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
94
97
|
}
|
|
95
98
|
export interface UserPhoneNumberChangedProps {
|
|
96
|
-
userId
|
|
97
|
-
phoneNumber
|
|
99
|
+
userId?: string;
|
|
100
|
+
phoneNumber?: string;
|
|
98
101
|
createdAt: Date;
|
|
99
102
|
createdBy: string;
|
|
100
103
|
streamId: string;
|
|
101
104
|
version: number;
|
|
102
105
|
}
|
|
103
106
|
export declare class UserPhoneNumberChanged implements Event {
|
|
104
|
-
userId
|
|
105
|
-
phoneNumber
|
|
107
|
+
userId?: string;
|
|
108
|
+
phoneNumber?: string;
|
|
106
109
|
createdAt: Date;
|
|
107
110
|
createdBy: string;
|
|
108
111
|
streamId: string;
|
|
109
112
|
version: number;
|
|
110
113
|
constructor(props: UserPhoneNumberChangedProps);
|
|
111
|
-
apply(existing
|
|
114
|
+
apply(existing?: Model): UserModel;
|
|
115
|
+
activityLog(existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
112
116
|
}
|
|
113
117
|
export interface UserDisplayNameChangedProps {
|
|
114
|
-
userId
|
|
118
|
+
userId?: string;
|
|
115
119
|
displayName: string;
|
|
116
120
|
createdAt: Date;
|
|
117
121
|
createdBy: string;
|
|
@@ -119,38 +123,39 @@ export interface UserDisplayNameChangedProps {
|
|
|
119
123
|
version: number;
|
|
120
124
|
}
|
|
121
125
|
export declare class UserDisplayNameChanged implements Event {
|
|
122
|
-
userId
|
|
126
|
+
userId?: string;
|
|
123
127
|
displayName: string;
|
|
124
128
|
createdAt: Date;
|
|
125
129
|
createdBy: string;
|
|
126
130
|
streamId: string;
|
|
127
131
|
version: number;
|
|
128
132
|
constructor(props: UserDisplayNameChangedProps);
|
|
129
|
-
apply(existing
|
|
133
|
+
apply(existing?: Model): UserModel;
|
|
134
|
+
activityLog(existing?: Model, actorName?: string): ActivityLogCreatedProps | undefined;
|
|
130
135
|
}
|
|
131
136
|
export interface UserDeletedProps {
|
|
132
|
-
userId
|
|
137
|
+
userId?: string;
|
|
133
138
|
createdAt: Date;
|
|
134
139
|
createdBy: string;
|
|
135
140
|
streamId: string;
|
|
136
141
|
version: number;
|
|
137
142
|
}
|
|
138
143
|
export declare class UserDeleted implements Event {
|
|
139
|
-
userId
|
|
144
|
+
userId?: string;
|
|
140
145
|
createdAt: Date;
|
|
141
146
|
createdBy: string;
|
|
142
147
|
streamId: string;
|
|
143
148
|
version: number;
|
|
144
149
|
constructor(props: UserDeletedProps);
|
|
145
|
-
apply(existing
|
|
150
|
+
apply(existing?: Model): UserModel;
|
|
146
151
|
}
|
|
147
152
|
export interface PlaceholderUserMergedProps {
|
|
148
|
-
userId
|
|
153
|
+
userId?: string;
|
|
149
154
|
firebaseUid: string;
|
|
150
155
|
displayName: string;
|
|
151
|
-
email
|
|
152
|
-
phoneNumber
|
|
153
|
-
photoUrl
|
|
156
|
+
email?: string;
|
|
157
|
+
phoneNumber?: string;
|
|
158
|
+
photoUrl?: string;
|
|
154
159
|
emailVerified: boolean;
|
|
155
160
|
createdAt: Date;
|
|
156
161
|
createdBy: string;
|
|
@@ -158,34 +163,34 @@ export interface PlaceholderUserMergedProps {
|
|
|
158
163
|
version: number;
|
|
159
164
|
}
|
|
160
165
|
export declare class PlaceholderUserMerged implements Event {
|
|
161
|
-
userId
|
|
166
|
+
userId?: string;
|
|
162
167
|
firebaseUid: string;
|
|
163
168
|
displayName: string;
|
|
164
|
-
email
|
|
165
|
-
phoneNumber
|
|
166
|
-
photoUrl
|
|
169
|
+
email?: string;
|
|
170
|
+
phoneNumber?: string;
|
|
171
|
+
photoUrl?: string;
|
|
167
172
|
emailVerified: boolean;
|
|
168
173
|
createdAt: Date;
|
|
169
174
|
createdBy: string;
|
|
170
175
|
streamId: string;
|
|
171
176
|
version: number;
|
|
172
177
|
constructor(props: PlaceholderUserMergedProps);
|
|
173
|
-
apply(existing
|
|
178
|
+
apply(existing?: Model): UserModel;
|
|
174
179
|
}
|
|
175
180
|
export interface UserConvertedToPlaceholderProps {
|
|
176
|
-
userId
|
|
181
|
+
userId?: string;
|
|
177
182
|
createdAt: Date;
|
|
178
183
|
createdBy: string;
|
|
179
184
|
streamId: string;
|
|
180
185
|
version: number;
|
|
181
186
|
}
|
|
182
187
|
export declare class UserConvertedToPlaceholder implements Event {
|
|
183
|
-
userId
|
|
188
|
+
userId?: string;
|
|
184
189
|
createdAt: Date;
|
|
185
190
|
createdBy: string;
|
|
186
191
|
streamId: string;
|
|
187
192
|
version: number;
|
|
188
193
|
constructor(props: UserConvertedToPlaceholderProps);
|
|
189
|
-
apply(existing
|
|
194
|
+
apply(existing?: Model): UserModel;
|
|
190
195
|
}
|
|
191
196
|
//# sourceMappingURL=UserEvents.d.ts.map
|
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;
|
|
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;AAI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