@mikitasazan/notify 1.17.0 → 1.19.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/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' | 'zabukai' | 'game-publisher' | 'vault' | 'mac-config' | 'alitools';
13
+ export type Project = 'playhub' | 'one-q' | 'zabukai' | 'game-publisher' | 'vault' | 'mac-config' | 'alitools' | 'htmlg';
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
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 FORUM PER PROJECT, with an "⚙️ Ops" tab (robot
7
- * notifications) and a "💬 Dev" tab (people's live chat) inside it.
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 `htmlg`). 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 supergroup. */
31
+ /** The id of the project's supergroup (forum or plain). */
27
32
  chat: string;
28
- /** The "⚙️ Ops" tab — robots write here. */
29
- ops: number;
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
@@ -20,7 +20,12 @@ 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 «HTMLG · Ops» (HTMLG is the HTML5-games business; the brand
27
+ // and domain of its portal may change, the project name does not).
28
+ htmlg: { chat: '-1004334723487' }
24
29
  };
25
30
  /**
26
31
  * Where an event goes. Everything goes to its own project's "Ops" tab; a
@@ -42,5 +47,5 @@ export const targets = (e) => {
42
47
  console.error(`[notify] unknown project "${e.project}" — known: ${Object.keys(ROUTES).join(', ')}`);
43
48
  return [];
44
49
  }
45
- return [{ chat: forum.chat, thread: forum.ops, silent: severity(e) === 'info' }];
50
+ return [{ chat: forum.chat, ...(forum.ops === undefined ? {} : { thread: forum.ops }), silent: severity(e) === 'info' }];
46
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikitasazan/notify",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "description": "Единая типизированная отправка Telegram-уведомлений (форум-темы, маршрутизация, ретраи) для всех проектов",
5
5
  "type": "module",
6
6
  "license": "MIT",