@mikitasazan/notify 1.16.0 → 1.18.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/README.md +4 -4
- package/dist/cli.js +4 -4
- package/dist/events.d.ts +2 -2
- package/dist/render.js +2 -2
- package/dist/routes.d.ts +13 -5
- package/dist/routes.js +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Единая типизированная отправка Telegram-уведомлений: **форум на проект**,
|
|
4
4
|
внутри вкладки «⚙️ Ops» (роботы) и «💬 Dev» (люди), один бот, семь типов
|
|
5
5
|
событий. Заменяет 18 разных имён переменных и 4+ независимых реализации
|
|
6
|
-
`jq | curl`, что были в playhub,
|
|
6
|
+
`jq | curl`, что были в playhub, zabukai, game-publisher до 26.07.2026.
|
|
7
7
|
|
|
8
8
|
**Почему форум на проект, а не один общий форум с темой на проект.** Второе
|
|
9
9
|
пробовали первым — не работает: Telegram не умеет закрывать отдельную тему от
|
|
@@ -180,8 +180,8 @@ notify report --project playhub --json < payload.json # весь объект
|
|
|
180
180
|
|
|
181
181
|
| Отправитель | Старый тег (авто из русского названия) | Новый тег (из `--key`) |
|
|
182
182
|
|---|---|---|
|
|
183
|
-
| `
|
|
184
|
-
| `
|
|
183
|
+
| `zabukai-eval-report.sh`, отчёт по эвалу | `#eval_качество_ответов_бота` | `#zabukai_eval` |
|
|
184
|
+
| `zabukai-eval-report.sh`, файл диалогов | нет — шёл мимо пакета, сырым `sendDocument` Bot API | `#zabukai_eval_dialogues` |
|
|
185
185
|
| `daily-digest.sh`, дайджест задач (`job`) | `#дайджест_задач` | `#daily_digest` |
|
|
186
186
|
| `daily-digest.sh`, дайджест задач (`report`) | `#дайджест_задач` (то же слово, другой тип-тег: `#report` вместо `#job`) | `#daily_digest` |
|
|
187
187
|
| `daily-digest.sh`, отключённые Actions | `#github_actions_выключены` | `#actions_off` |
|
|
@@ -197,7 +197,7 @@ notify report --project playhub --json < payload.json # весь объект
|
|
|
197
197
|
- Автосоздания темы при первой отправке — сбой мог бы наплодить дублей;
|
|
198
198
|
создание — явная команда `notify setup`.
|
|
199
199
|
- Любых зависимостей, сборки, MarkdownV2, мультиязычности, троттла (троттл —
|
|
200
|
-
забота вызывающего кода, он есть в `
|
|
200
|
+
забота вызывающего кода, он есть в `zabukai/web/src/server/alert.ts` и там
|
|
201
201
|
и остаётся: работает только внутри долгоживущего процесса, а CLI стартует
|
|
202
202
|
заново на каждый вызов).
|
|
203
203
|
|
package/dist/cli.js
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* notify deploy --project playhub --status ok --commit "msg" [--commit-url "..."] --url "..."
|
|
14
14
|
* notify job --project playhub --job "Game import" --status ok --stat "added=5" [--via vps] [--took "4m 12s"]
|
|
15
15
|
* notify report --project playhub --title "Daily summary" --line "Games=1284"
|
|
16
|
-
* notify ci --project
|
|
17
|
-
* notify pr --project
|
|
18
|
-
* notify incident --project
|
|
16
|
+
* notify ci --project zabukai --status fail --branch master
|
|
17
|
+
* notify pr --project zabukai --action opened --number 142 --title "..."
|
|
18
|
+
* notify incident --project zabukai --title "Redis is unreachable" --detail "$ERR"
|
|
19
19
|
* notify session --project mac-config --action "burning the limit" # DEPRECATED alias of incident
|
|
20
|
-
* notify file --project
|
|
20
|
+
* notify file --project zabukai --title "Full dialogues" --path ./out.txt [--filename name.txt]
|
|
21
21
|
* notify <type> [--key stable-key] # the task's key on the card's last line
|
|
22
22
|
* notify <type> --json < payload.json # the whole event object on stdin
|
|
23
23
|
* notify setup <forum chat_id> <project key> # create the tabs, see setup.ts
|
package/dist/events.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - required fields are never added — only a new event type.
|
|
11
11
|
* That keeps old caller code and a new package compatible both ways.
|
|
12
12
|
*/
|
|
13
|
-
export type Project = 'playhub' | 'one-q' | '
|
|
13
|
+
export type Project = 'playhub' | 'one-q' | 'zabukai' | 'game-publisher' | 'vault' | 'mac-config' | 'alitools' | 'playgust';
|
|
14
14
|
/**
|
|
15
15
|
* A stable machine key for the task — the instance tag on the FIRST line of
|
|
16
16
|
* every card, shaped as `#key` (with no project name: the card already sits
|
|
@@ -28,7 +28,7 @@ export type Project = 'playhub' | 'one-q' | 'arvent' | 'game-publisher' | 'vault
|
|
|
28
28
|
/**
|
|
29
29
|
* The common part of any event. `path` is a local file that travels WITH the
|
|
30
30
|
* card: the card becomes a caption on the attachment. There has been no
|
|
31
|
-
* separate `file` type since 25.08.2026 — an
|
|
31
|
+
* separate `file` type since 25.08.2026 — an Zabukai run used to send the
|
|
32
32
|
* verdict and the log as two cards about one piece of news.
|
|
33
33
|
*/
|
|
34
34
|
type Keyed = {
|
package/dist/render.js
CHANGED
|
@@ -168,7 +168,7 @@ const fieldLink = (label, url, text) => {
|
|
|
168
168
|
return null;
|
|
169
169
|
}
|
|
170
170
|
// `firstLine` here for the same reason `field` has it: the linked case used to
|
|
171
|
-
// skip it, so a multi-line value (
|
|
171
|
+
// skip it, so a multi-line value (zabukai's two-line `commit`) became two-line
|
|
172
172
|
// LINK TEXT instead of one identifier.
|
|
173
173
|
return url
|
|
174
174
|
? `<b>${esc(cap(label))}:</b> <a href="${esc(url)}">${esc(firstLine(text))}</a>`
|
|
@@ -1048,7 +1048,7 @@ const RENDERERS = {
|
|
|
1048
1048
|
};
|
|
1049
1049
|
// The tag at the top of the card AND the parser's machine key are ONE AND THE
|
|
1050
1050
|
// SAME value (the owner's decision, 20.08.2026): they used to be two separate
|
|
1051
|
-
// representations of one fact (a hyphenated `#ci-
|
|
1051
|
+
// representations of one fact (a hyphenated `#ci-zabukai` at the bottom, tags
|
|
1052
1052
|
// typed by hand at the top), and that read as duplication. The separator is
|
|
1053
1053
|
// an underscore, not a hyphen: a hyphen splits a Telegram hashtag in the
|
|
1054
1054
|
// middle of a word (`#mac-config` links only as `#mac`), and the tag MUST be
|
package/dist/routes.d.ts
CHANGED
|
@@ -3,8 +3,13 @@
|
|
|
3
3
|
* touches: add a row to `ROUTES` — no new bot, no new secret, no edits in
|
|
4
4
|
* the projects themselves.
|
|
5
5
|
*
|
|
6
|
-
* The scheme: ONE
|
|
7
|
-
* notifications) and a "💬 Dev" tab
|
|
6
|
+
* The scheme: ONE CHAT PER PROJECT. A project with a team is a forum
|
|
7
|
+
* supergroup with an "⚙️ Ops" tab (robot notifications) and a "💬 Dev" tab
|
|
8
|
+
* (people's live chat). A project the owner runs alone is a plain
|
|
9
|
+
* supergroup without topics — the robots post straight into it and there
|
|
10
|
+
* is nobody to talk to in a Dev tab (owner's rule of 2026-09-05; the first
|
|
11
|
+
* such chat is `playgust`). A plain chat has no `ops` number: the message
|
|
12
|
+
* goes to the chat itself.
|
|
8
13
|
*
|
|
9
14
|
* Why not one shared forum with a topic per project — that was the first
|
|
10
15
|
* version, and it turned out to be a mistake: Telegram cannot hide one
|
|
@@ -23,10 +28,13 @@
|
|
|
23
28
|
*/
|
|
24
29
|
import type { NotifyEvent, Project } from './events.ts';
|
|
25
30
|
type Forum = {
|
|
26
|
-
/** The id of the project's forum
|
|
31
|
+
/** The id of the project's supergroup (forum or plain). */
|
|
27
32
|
chat: string;
|
|
28
|
-
/**
|
|
29
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The "⚙️ Ops" tab — robots write here. Absent for a plain chat without
|
|
35
|
+
* topics (a solo project): the message then goes to the chat itself.
|
|
36
|
+
*/
|
|
37
|
+
ops?: number;
|
|
30
38
|
/**
|
|
31
39
|
* The "💬 Dev" tab — people. The bot does not write here; the field is
|
|
32
40
|
* kept for completeness. Optional: an infrastructure forum has no people
|
package/dist/routes.js
CHANGED
|
@@ -4,7 +4,7 @@ export const ROUTES = {
|
|
|
4
4
|
// 27.07.2026, and Telegram removes a topic's messages along with it. A
|
|
5
5
|
// recreated topic gets a NEW id — a topic's id is the id of its first
|
|
6
6
|
// message, it is never reused.
|
|
7
|
-
|
|
7
|
+
zabukai: { chat: '-1004299939100', ops: 22, dev: 23 },
|
|
8
8
|
playhub: { chat: '-1004418379613', ops: 3, dev: 4 },
|
|
9
9
|
'game-publisher': { chat: '-1004292453693', ops: 3, dev: 4 },
|
|
10
10
|
'one-q': { chat: '-1004466909784', ops: 3, dev: 4 },
|
|
@@ -20,7 +20,11 @@ export const ROUTES = {
|
|
|
20
20
|
// publish delivered" (ali98x-sentry). No `dev` — the project's team lives
|
|
21
21
|
// in other systems, there are no people here. Until 18.08.2026 reports
|
|
22
22
|
// were getting lost on "unknown project" for weeks.
|
|
23
|
-
alitools: { chat: '-1003904331479', ops: 3 }
|
|
23
|
+
alitools: { chat: '-1003904331479', ops: 3 },
|
|
24
|
+
// Solo project, plain supergroup without topics (owner's rule 05.09.2026):
|
|
25
|
+
// no `ops`, no `dev`, the bot posts into the chat itself. Created
|
|
26
|
+
// 05.09.2026 as «Playgust · Ops».
|
|
27
|
+
playgust: { chat: '-1004334723487' }
|
|
24
28
|
};
|
|
25
29
|
/**
|
|
26
30
|
* Where an event goes. Everything goes to its own project's "Ops" tab; a
|
|
@@ -42,5 +46,5 @@ export const targets = (e) => {
|
|
|
42
46
|
console.error(`[notify] unknown project "${e.project}" — known: ${Object.keys(ROUTES).join(', ')}`);
|
|
43
47
|
return [];
|
|
44
48
|
}
|
|
45
|
-
return [{ chat: forum.chat, thread: forum.ops, silent: severity(e) === 'info' }];
|
|
49
|
+
return [{ chat: forum.chat, ...(forum.ops === undefined ? {} : { thread: forum.ops }), silent: severity(e) === 'info' }];
|
|
46
50
|
};
|
package/package.json
CHANGED