diff --git a/Makefile b/Makefile index f064960..85ce8a9 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,9 @@ changelog: tags: deno run --unstable --allow-read utils/tags.js +qa-summary: + deno run --unstable --allow-read utils/exec.js qaSummary + schedule: plan plan: diff --git a/utils/engine.js b/utils/engine.js index dde9367..c5d986e 100644 --- a/utils/engine.js +++ b/utils/engine.js @@ -160,6 +160,10 @@ export class UTXOEngine { }, ); + // write QA output of events (schedules) + const qa = this.qaSummary(entryId); + await this._jsonWrite([entryDir, "qa-summary.json"], qa); + // done entriesIndex.push({ @@ -198,6 +202,29 @@ export class UTXOEngine { } } + qaSummary(entry) { + const arr = []; + for ( + const ev of this.entries[entry].specs.events.filter((ev) => + ev.type !== "lightning" + ) + ) { + const s = this.entries[entry].specs.schedule.find((s) => + s.event === ev.id + ); + if (!s) { + throw new Error(`Schedule not found (?): ${ev.id}`); + } + arr.push({ + id: s.id, + eventId: ev.id, + name: ev.name, + period: s.period, + }); + } + return arr; + } + schemaUrl(version = "1", type = "index") { return `${baseUrl}/schema/${version}/${type}.json`; }