2022-02-08 09:25:11 +01:00
|
|
|
import { UTXOEngine } from "./engine.js";
|
|
|
|
|
|
|
|
const utxo = new UTXOEngine({ silent: true });
|
|
|
|
await utxo.init();
|
|
|
|
|
|
|
|
const entryId = "22";
|
|
|
|
const entry = utxo.entries[entryId];
|
|
|
|
|
|
|
|
const pt = entry.specs.team.teams;
|
|
|
|
const teams = Object.keys(pt).map((id) => Object.assign({ id }, pt[id]));
|
|
|
|
|
|
|
|
console.log("----");
|
|
|
|
|
|
|
|
function members(t) {
|
|
|
|
return t.members.map((m) => m === t.lead ? "@" + m : m).sort((m) =>
|
|
|
|
m.substring(0, 1) === "@" ? -1 : 1
|
|
|
|
).join(", ");
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const t of teams.filter((t) => !t.parent)) {
|
2022-02-11 01:37:29 +01:00
|
|
|
console.log((t.id === "core" ? "" : " ") + `[${t.id}] +${members(t)}`);
|
2022-02-08 09:25:11 +01:00
|
|
|
for (const st of teams.filter((tx) => tx.parent === t.id)) {
|
2022-02-11 01:33:01 +01:00
|
|
|
console.log(` [${st.id}] +${members(st)}`);
|
2022-02-09 09:59:52 +01:00
|
|
|
for (const st2 of teams.filter((tx2) => tx2.parent === st.id)) {
|
2022-02-11 01:33:01 +01:00
|
|
|
console.log(` [${st2.id}] +${members(st2)}`);
|
2022-02-09 09:59:52 +01:00
|
|
|
}
|
2022-02-08 09:25:11 +01:00
|
|
|
}
|
|
|
|
}
|