@superhero/eventflow-db 4.8.2 → 4.8.3-rc.1.0
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/index.js +26 -11
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -264,10 +264,12 @@ export default class DB
|
|
|
264
264
|
throw error
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
267
|
+
if(deserialize)
|
|
268
|
+
{
|
|
269
|
+
this.deserializeEvents(result)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return result[0]
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
async readEventsByDomainAndPid(domain, pid, deserialize = false)
|
|
@@ -284,10 +286,10 @@ export default class DB
|
|
|
284
286
|
error.code = 'E_EVENTFLOW_DB_EVENT_READ_BY_PID'
|
|
285
287
|
error.cause = reason
|
|
286
288
|
throw error
|
|
287
|
-
}
|
|
289
|
+
}
|
|
288
290
|
|
|
289
291
|
return deserialize
|
|
290
|
-
?
|
|
292
|
+
? this.deserializeEvents(result)
|
|
291
293
|
: result
|
|
292
294
|
}
|
|
293
295
|
|
|
@@ -308,7 +310,7 @@ export default class DB
|
|
|
308
310
|
}
|
|
309
311
|
|
|
310
312
|
return deserialize
|
|
311
|
-
?
|
|
313
|
+
? this.deserializeEvents(result)
|
|
312
314
|
: result
|
|
313
315
|
}
|
|
314
316
|
|
|
@@ -330,7 +332,7 @@ export default class DB
|
|
|
330
332
|
}
|
|
331
333
|
|
|
332
334
|
return deserialize
|
|
333
|
-
?
|
|
335
|
+
? this.deserializeEvents(result)
|
|
334
336
|
: result
|
|
335
337
|
}
|
|
336
338
|
|
|
@@ -421,7 +423,7 @@ export default class DB
|
|
|
421
423
|
}
|
|
422
424
|
|
|
423
425
|
return deserialize
|
|
424
|
-
?
|
|
426
|
+
? this.deserializeEvents(result)
|
|
425
427
|
: result
|
|
426
428
|
}
|
|
427
429
|
|
|
@@ -493,7 +495,7 @@ export default class DB
|
|
|
493
495
|
}
|
|
494
496
|
|
|
495
497
|
return deserialize
|
|
496
|
-
?
|
|
498
|
+
? this.deserializeEvents(result)
|
|
497
499
|
: result
|
|
498
500
|
}
|
|
499
501
|
|
|
@@ -514,7 +516,7 @@ export default class DB
|
|
|
514
516
|
}
|
|
515
517
|
|
|
516
518
|
return deserialize
|
|
517
|
-
?
|
|
519
|
+
? this.deserializeEvents(result)
|
|
518
520
|
: result
|
|
519
521
|
}
|
|
520
522
|
|
|
@@ -874,4 +876,17 @@ export default class DB
|
|
|
874
876
|
throw error
|
|
875
877
|
}
|
|
876
878
|
}
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* @protected
|
|
882
|
+
*/
|
|
883
|
+
deserializeEvents(events)
|
|
884
|
+
{
|
|
885
|
+
for(const event of events)
|
|
886
|
+
{
|
|
887
|
+
event.data = this.serde.deserialize(event.data)
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
return events
|
|
891
|
+
}
|
|
877
892
|
}
|