@mikitasazan/notify 1.7.0 → 1.8.1

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/dist/routes.d.ts CHANGED
@@ -1,34 +1,37 @@
1
1
  /**
2
- * Маршрутизация «событиекуда слать». ЕДИНСТВЕННОЕ место, которое трогает
3
- * новый проект: добавить строку в `ROUTES` — ни нового бота, ни нового
4
- * секрета, ни правок в проектах.
2
+ * Routing "eventwhere to send." The ONLY place that a new project
3
+ * touches: add a row to `ROUTES` — no new bot, no new secret, no edits in
4
+ * the projects themselves.
5
5
  *
6
- * Схема: ФОРУМ НА ПРОЕКТ, внутри вкладки «⚙️ Ops» (уведомления роботов) и
7
- * «💬 Dev» (живой чат людей).
6
+ * The scheme: ONE FORUM PER PROJECT, with an "⚙️ Ops" tab (robot
7
+ * notifications) and a "💬 Dev" tab (people's live chat) inside it.
8
8
  *
9
- * Почему не один общий форум с темой на проекттак было в первой редакции
10
- * и это оказалось ошибкой: Telegram не умеет закрывать отдельную тему от
11
- * участника, кто в группевидит ВСЕ вкладки. Значит сотрудников туда не
12
- * пустить, им нужен свой чат, и один проект начинает жить в двух местах
13
- * сразу («тема у владельца» + «канал у команды»). Форум на проект убирает
14
- * дублирование: сотрудник добавляется в форум своего проекта и чужих не
15
- * видит, а схема одна для всех появились люди на новом проекте, просто
16
- * добавь их туда же.
9
+ * Why not one shared forum with a topic per project that was the first
10
+ * version, and it turned out to be a mistake: Telegram cannot hide one
11
+ * topic from a memberwhoever is in the group sees ALL the tabs. That
12
+ * means employees cannot be let in, they need their own chat, and one
13
+ * project ends up living in two places at once ("the owner's topic" +
14
+ * "the team's channel"). A forum per project removes the duplication: an
15
+ * employee is added to their own project's forum and does not see anyone
16
+ * else's, and the scheme is the same for everyone — people show up on a
17
+ * new project, just add them to the same forum.
17
18
  *
18
- * Id чатов и тем не секрет: без токена бота они бесполезны. Поэтому живут
19
- * в коде, а не в переменных окружения (иначе «добавить проект» = правка в
20
- * трёх местах). Секрет ровно один — `OPS_BOT_TOKEN`.
19
+ * Chat and topic ids are not a secret: without the bot's token they are
20
+ * useless. So they live in code, not in environment variables (otherwise
21
+ * "add a project" means edits in three places). There is exactly one
22
+ * secret — `OPS_BOT_TOKEN`.
21
23
  */
22
24
  import type { NotifyEvent, Project } from './events.ts';
23
25
  type Forum = {
24
- /** Id форума-супергруппы проекта. */
26
+ /** The id of the project's forum supergroup. */
25
27
  chat: string;
26
- /** Вкладка «⚙️ Ops»сюда пишут роботы. */
28
+ /** The "⚙️ Ops" tab robots write here. */
27
29
  ops: number;
28
30
  /**
29
- * Вкладка «💬 Dev»люди. Бот сюда не пишет; поле держим для полноты.
30
- * Необязательное: у инфраструктурного форума людей нет и обсуждать нечего,
31
- * а пустая вкладка читается как забытая настройка, а не как задел.
31
+ * The "💬 Dev" tab people. The bot does not write here; the field is
32
+ * kept for completeness. Optional: an infrastructure forum has no people
33
+ * and nothing to discuss, and an empty tab would read as a forgotten
34
+ * setting, not as room to grow into.
32
35
  */
33
36
  dev?: number;
34
37
  };
@@ -39,13 +42,14 @@ export type Target = {
39
42
  silent: boolean;
40
43
  };
41
44
  /**
42
- * Куда уходит событие. Всё во вкладку «Ops» своего проекта; красное
43
- * приходит туда же, но со звуком.
45
+ * Where an event goes. Everything goes to its own project's "Ops" tab; a
46
+ * red one arrives there too, just with sound.
44
47
  *
45
- * Отдельной темы «инциденты» больше нет: она имела смысл, пока форум был
46
- * общий на все проекты. Теперь у каждого проекта своя группа, и авария
47
- * видна в его же ленте сводить их в одно место незачем, а звук и так
48
- * отличает аварию от рядового сообщения.
48
+ * There is no separate "incidents" topic any more: it made sense while the
49
+ * forum was shared across all projects. Now every project has its own
50
+ * group, and an incident is visible in that same feed there is no reason
51
+ * to funnel them into one place, and the sound already tells an incident
52
+ * apart from an ordinary message.
49
53
  */
50
54
  export declare const targets: (e: NotifyEvent) => Target[];
51
55
  export {};
package/dist/routes.js CHANGED
@@ -1,38 +1,43 @@
1
1
  import { severity } from "./events.js";
2
2
  export const ROUTES = {
3
- // ops/dev = 22/23, а не 3/4: старые вкладки удалили вручную 27.07.2026, и
4
- // вместе с темой Telegram сносит её сообщения. Пересозданная тема получает
5
- // НОВЫЙ id — id темы это id её первого сообщения, он не переиспользуется.
3
+ // ops/dev = 22/23, not 3/4: the old tabs were deleted by hand on
4
+ // 27.07.2026, and Telegram removes a topic's messages along with it. A
5
+ // recreated topic gets a NEW id — a topic's id is the id of its first
6
+ // message, it is never reused.
6
7
  arvent: { chat: '-1004299939100', ops: 22, dev: 23 },
7
8
  playhub: { chat: '-1004418379613', ops: 3, dev: 4 },
8
9
  'game-publisher': { chat: '-1004292453693', ops: 3, dev: 4 },
9
10
  'one-q': { chat: '-1004466909784', ops: 3, dev: 4 },
10
- // Без `dev`: сейф инфраструктура, обсуждать в нём некому. Только отчёты
11
- // еженедельной проверки, и то лишь когда что-то сломалось.
11
+ // No `dev`: the safe is infrastructure, there is no one to discuss it
12
+ // with. Only reports from the weekly check, and only when something
13
+ // broke.
12
14
  vault: { chat: '-1004459314999', ops: 3 },
13
- // Тоже инфраструктура, без `dev`: дневной дайджест задач и понедельничная
14
- // сводка спотыканий. До этой строки оба тихо умирали на «неизвестный проект».
15
+ // Also infrastructure, no `dev`: the daily task digest and the Monday
16
+ // stumbles summary. Before this row, both used to die silently on
17
+ // "unknown project."
15
18
  'mac-config': { chat: '-1004442522004', ops: 2 },
16
- // Корпоративный проект владельца: только его собственные отчёты «что дала
17
- // выливка» (ali98x-sentry). Без `dev` — команда проекта живёт в чужих
18
- // системах, людей здесь нет. До 18.08.2026 отчёты терялись на «неизвестный
19
- // проект» неделями.
19
+ // The owner's corporate project: only its own reports on "what the
20
+ // publish delivered" (ali98x-sentry). No `dev` — the project's team lives
21
+ // in other systems, there are no people here. Until 18.08.2026 reports
22
+ // were getting lost on "unknown project" for weeks.
20
23
  alitools: { chat: '-1003904331479', ops: 3 }
21
24
  };
22
25
  /**
23
- * Куда уходит событие. Всё во вкладку «Ops» своего проекта; красное
24
- * приходит туда же, но со звуком.
26
+ * Where an event goes. Everything goes to its own project's "Ops" tab; a
27
+ * red one arrives there too, just with sound.
25
28
  *
26
- * Отдельной темы «инциденты» больше нет: она имела смысл, пока форум был
27
- * общий на все проекты. Теперь у каждого проекта своя группа, и авария
28
- * видна в его же ленте сводить их в одно место незачем, а звук и так
29
- * отличает аварию от рядового сообщения.
29
+ * There is no separate "incidents" topic any more: it made sense while the
30
+ * forum was shared across all projects. Now every project has its own
31
+ * group, and an incident is visible in that same feed there is no reason
32
+ * to funnel them into one place, and the sound already tells an incident
33
+ * apart from an ordinary message.
30
34
  */
31
35
  export const targets = (e) => {
32
36
  const forum = ROUTES[e.project];
33
- // Неизвестный проектопечатка в `--project` или проект, забытый в ROUTES.
34
- // Возвращаем пустой список, а не падаем: уведомление не имеет права уронить
35
- // вызвавший его деплой или крон bash с `set -e` падение было бы фатальным).
37
+ // An unknown project a typo in `--project`, or a project forgotten in
38
+ // ROUTES. We return an empty list rather than throw: a notification has
39
+ // no right to bring down the deploy or cron job that called it (in bash
40
+ // with `set -e` a throw here would be fatal).
36
41
  if (!forum) {
37
42
  console.error(`[notify] unknown project "${e.project}" — known: ${Object.keys(ROUTES).join(', ')}`);
38
43
  return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikitasazan/notify",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "Единая типизированная отправка Telegram-уведомлений (форум-темы, маршрутизация, ретраи) для всех проектов",
5
5
  "type": "module",
6
6
  "license": "MIT",