Остання активність 3 weeks ago

nuno ревизій цього gist 3 weeks ago. До ревизії

1 file changed, 108 insertions

gistfile1.txt(файл створено)

@@ -0,0 +1,108 @@
1 + /opt/docker/tg-bot-ts-dev/src/subcommands/poll/mark-left.ts:26: const historyKey = TGKey.current({ slot });
2 + /opt/docker/tg-bot-ts-dev/src/subcommands/poll/mark-left.ts:31: historyKey,
3 + /opt/docker/tg-bot-ts-dev/src/subcommands/poll/mark-left.ts:58: const historyKey = TGKey.current({ slot });
4 + /opt/docker/tg-bot-ts-dev/src/subcommands/poll/mark-left.ts:59: Leaves.unmark({ characterName: char.name, historyKey });
5 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:19: [historyKey: TGKey]: UserKey[];
6 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:38: const historyKey = TGKey.current({ slot });
7 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:39: _data[historyKey] = [...lockedYesKeys];
8 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:46: players(historyKey: TGKey): UserKey[] {
9 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:47: return _data[historyKey] ?? [];
10 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:53: includes(historyKey: TGKey, userKey: UserKey): boolean {
11 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:54: return (_data[historyKey] ?? []).includes(userKey);
12 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:60: allSubmitted(historyKey: TGKey): boolean {
13 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:61: const players = _data[historyKey] ?? [];
14 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:65: fs.readFileSync(Paths.data("tg-history", `${historyKey}.json`), "utf8")
15 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:77: all(): TGKey[] {
16 + /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:78: return Object.keys(_data) as TGKey[];
17 + /opt/docker/tg-bot-ts-dev/src/systems/wrank.ts:44: scoreIndex: Record<CharName, TGKey[]>;
18 + /opt/docker/tg-bot-ts-dev/src/systems/wrank.ts:150: historyKey: TGKey
19 + /opt/docker/tg-bot-ts-dev/src/systems/wrank.ts:158: const alreadyCounted = week.scoreIndex[characterName]?.includes(historyKey);
20 + /opt/docker/tg-bot-ts-dev/src/systems/wrank.ts:181: if (!week.scoreIndex[characterName].includes(historyKey)) {
21 + /opt/docker/tg-bot-ts-dev/src/systems/wrank.ts:182: week.scoreIndex[characterName].push(historyKey);
22 + /opt/docker/tg-bot-ts-dev/src/systems/history.ts:8:const HISTORY_DIR = path.join(__dirname, "../../data/tg-history");
23 + /opt/docker/tg-bot-ts-dev/src/systems/history.ts:10:function historyKey(date: string, slot: number): string {
24 + /opt/docker/tg-bot-ts-dev/src/systems/history.ts:19: return Store.read(historyPath(historyKey(date, slot)));
25 + /opt/docker/tg-bot-ts-dev/src/systems/history.ts:23: Store.write(historyPath(historyKey(result.date, result.slot)), result);
26 + /opt/docker/tg-bot-ts-dev/src/systems/updates.ts:82: historyKey: string;
27 + /opt/docker/tg-bot-ts-dev/src/systems/updates.ts:186: Leaves.mark({ characterName: l.characterName, ownerKey: "example", historyKey: l.historyKey as any, markedBy: "example" });
28 + /opt/docker/tg-bot-ts-dev/src/systems/updates.ts:190: Leaves.unmark({ characterName: l.characterName, historyKey: l.historyKey as any });
29 + /opt/docker/tg-bot-ts-dev/src/systems/updates.ts:228: historyKey: exampleData.leaves?.[0]?.historyKey
30 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:52: function getHistoryPath(historyKey: TGKey): string {
31 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:53: return Paths.data("tg-history", `${historyKey}.json`);
32 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:56: function loadHistory(historyKey: TGKey): { scores: TGScore[] } {
33 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:57: return Store.readOrDefault(getHistoryPath(historyKey), { scores: [] });
34 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:59:function saveHistory(historyKey: TGKey, data: { scores: TGScore[] }): void {
35 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:60: Store.write(getHistoryPath(historyKey), data);
36 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:71: const historyKey = TGKey.current({ slot });
37 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:72: const history = loadHistory(historyKey);
38 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:86: for (const historyKey of (week.scoreIndex[character.name] ?? [])) {
39 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:87: const history = loadHistory(historyKey as TGKey);
40 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:128: const historyKey = TGKey.current({ slot });
41 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:129: const history = loadHistory(historyKey);
42 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:165: saveHistory(historyKey, history);
43 + /opt/docker/tg-bot-ts-dev/src/systems/score.ts:174: historyKey
44 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:8: * const key = TGKey.current({ slot: 20 })
45 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:9: * const key = TGKey.from({ date: "2026-06-11", slot: 20 })
46 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:10: * TGKey.parse(key) // { date: "2026-06-11", slot: 20 }
47 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:11: * TGKey.toHistoryPath(key) // ".../tg-history/2026-06-11-20.json"
48 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:18: export const TGKey = {
49 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:19: from({ date, slot }: { date: Date | string; slot: number }): TGKey {
50 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:23: return `${d}-${slot}` as TGKey;
51 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:26: current({ slot }: { slot: number }): TGKey {
52 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:27: return TGKey.from({ date: new Date(), slot });
53 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:30: parse(key: TGKey): { date: string; slot: number } {
54 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:38: toHistoryPath(key: TGKey): string {
55 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:39: return Paths.data("tg-history", `${key}.json`);
56 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:43: toDisplay(key: TGKey): string {
57 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:44: const { date, slot } = TGKey.parse(key);
58 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:49: /** Check if a string is a valid TGKey */
59 + /opt/docker/tg-bot-ts-dev/src/systems/tg-key.ts:50: isValid(key: string): key is TGKey {
60 + /opt/docker/tg-bot-ts-dev/src/systems/scores.ts:74: const historyKey = `${date}-${String(sub.slot).padStart(2, "0")}`;
61 + /opt/docker/tg-bot-ts-dev/src/systems/scores.ts:95: WRank.recordScore(sub.userKey, sub.characterName, sub.cls, sub.nation, sub.pts, historyKey);
62 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:10: * Leaves.mark({ characterName, historyKey, markedBy })
63 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:11: * Leaves.unmark({ characterName, historyKey })
64 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:12: * Leaves.hasLeft({ characterName, historyKey })
65 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:30: historyKey: TGKey;
66 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:61: mark({ characterName, ownerKey, historyKey, markedBy }: {
67 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:64: historyKey: TGKey;
68 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:71: if (char.history.some((r) => r.historyKey === historyKey)) return; // already marked
69 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:72: char.history.push({ historyKey, markedBy, markedAt: new Date().toISOString() });
70 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:77: unmark({ characterName, historyKey }: {
71 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:79: historyKey: TGKey;
72 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:83: (r) => r.historyKey !== historyKey
73 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:89: hasLeft({ characterName, historyKey }: {
74 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:91: historyKey: TGKey;
75 + /opt/docker/tg-bot-ts-dev/src/systems/leaves.ts:93: return _data[characterName]?.history.some((r) => r.historyKey === historyKey) ?? false;
76 + /opt/docker/tg-bot-ts-dev/src/systems/tg.ts:10: * TG.getAttendance({ historyKey })
77 + /opt/docker/tg-bot-ts-dev/src/systems/tg.ts:68: getAttendance({ historyKey, nation }: {
78 + /opt/docker/tg-bot-ts-dev/src/systems/tg.ts:69: historyKey: TGKey;
79 + /opt/docker/tg-bot-ts-dev/src/systems/tg.ts:72: const players = Attendance.players(historyKey);
80 + /opt/docker/tg-bot-ts-dev/src/systems/tg.ts:78: allSubmitted(historyKey: TGKey): boolean {
81 + /opt/docker/tg-bot-ts-dev/src/systems/tg.ts:79: return Attendance.allSubmitted(historyKey);
82 + /opt/docker/tg-bot-ts-dev/src/ui/types.ts:15: historyKey?: TGKey;
83 + /opt/docker/tg-bot-ts-dev/src/ui/types.ts:21: historyKey?: TGKey;
84 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/default.ts:60: if (entry.userKey && context.historyKey) {
85 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/default.ts:61: if (Leaves.hasLeft({ characterName: entry.characterName!, historyKey: context.historyKey })) {
86 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/default.ts:75: options?: { showNationEmoji?: boolean; historyKey?: string }
87 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/default.ts:88: historyKey: options?.historyKey,
88 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/side-by-side.ts:57: if (entry.userKey && entry.characterName && context.historyKey) {
89 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/side-by-side.ts:58: if (Leaves.hasLeft({ characterName: entry.characterName, historyKey: context.historyKey })) {
90 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/side-by-side.ts:71: options?: { showNationEmoji?: boolean; historyKey?: string }
91 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/side-by-side.ts:82: historyKey: options?.historyKey,
92 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/side-by-side.ts:93: historyKey?: string
93 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/side-by-side.ts:95: const context = buildContext(yesEntries, nation, { historyKey });
94 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/side-by-side.ts:138: const historyKey = `${new Date().toISOString().slice(0, 10)}-${state.slot}`;
95 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/side-by-side.ts:162: value: formatNationField(Nation.Capella, yesByNation[Nation.Capella], noVoters, showNoInline, historyKey),
96 + /opt/docker/tg-bot-ts-dev/src/ui/poll/layouts.bak/side-by-side.ts:167: value: formatNationField(Nation.Procyon, yesByNation[Nation.Procyon], noVoters, showNoInline, historyKey),
97 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:74: if (entry.characterName && context.historyKey) {
98 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:75: if (Leaves.hasLeft({ characterName: entry.characterName, historyKey: context.historyKey })) {
99 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:88: options?: { showNationEmoji?: boolean; historyKey?: TGKey }
100 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:106: historyKey: options?.historyKey,
101 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:117: historyKey?: TGKey
102 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:119: const context = buildContext(yesEntries, nation, { historyKey });
103 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:205: const historyKey = options?.historyKey
104 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:206: ?? TGKey.current({ slot: state.slot });
105 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:228: value: formatNationField(Nation.Capella, yesByNation[Nation.Capella], noVoters, showNoInline, historyKey),
106 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:233: value: formatNationField(Nation.Procyon, yesByNation[Nation.Procyon], noVoters, showNoInline, historyKey),
107 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:242: value: formatNationField(Nation.Capella, yesByNation[Nation.Capella], noVoters, showNoInline, historyKey),
108 + /opt/docker/tg-bot-ts-dev/src/ui/poll/base-layout.ts:248: value: formatNationField(Nation.Procyon, yesByNation[Nation.Procyon], noVoters, showNoInline, historyKey),
Новіше Пізніше