@atolis-hq/wake 0.3.67 → 0.3.68
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.
|
@@ -17,10 +17,16 @@ export class RunRepository {
|
|
|
17
17
|
return events.map(decodeRunExecutionEvent);
|
|
18
18
|
}
|
|
19
19
|
async list(activationId) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const grouped = new Map();
|
|
21
|
+
for (const event of await this.journal.readAll(0)) {
|
|
22
|
+
if (!isRunStream(event.stream))
|
|
23
|
+
continue;
|
|
24
|
+
const id = runId(event.stream.id);
|
|
25
|
+
const events = grouped.get(id) ?? [];
|
|
26
|
+
events.push(decodeRunExecutionEvent(event));
|
|
27
|
+
grouped.set(id, events);
|
|
28
|
+
}
|
|
29
|
+
const runs = (await Promise.all([...grouped.values()].map(foldRun))).filter((run) => run !== null);
|
|
24
30
|
return activationId === undefined
|
|
25
31
|
? runs
|
|
26
32
|
: runs.filter((run) => run.activationId === activationId);
|