@mikitasazan/notify 1.4.0 → 1.4.2

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/setup.js CHANGED
@@ -23,21 +23,21 @@ const createTopic = async (token, chat, name, color) => {
23
23
  });
24
24
  const body = (await res.json());
25
25
  if (!body.ok || !body.result) {
26
- log(`не удалось создать «${name}»: ${body.description ?? `HTTP ${res.status}`}`);
26
+ log(`could not create "${name}": ${body.description ?? `HTTP ${res.status}`}`);
27
27
  return null;
28
28
  }
29
29
  return body.result.message_thread_id;
30
30
  }
31
31
  catch (err) {
32
32
  // Сеть/таймаут/нечитаемый ответ — не роняем CLI (его контракт: всегда exit 0).
33
- log(`не удалось создать «${name}»: ${err instanceof Error ? err.message : String(err)}`);
33
+ log(`could not create "${name}": ${err instanceof Error ? err.message : String(err)}`);
34
34
  return null;
35
35
  }
36
36
  };
37
37
  export const setupTopic = async (chatId, projectKey) => {
38
38
  const token = process.env.OPS_BOT_TOKEN?.trim();
39
39
  if (!token) {
40
- log('нет OPS_BOT_TOKEN — не могу создать вкладки');
40
+ log('no OPS_BOT_TOKEN — cannot create the tabs');
41
41
  return;
42
42
  }
43
43
  const ops = await createTopic(token, chatId, '⚙️ Ops', 9367192);
@@ -45,16 +45,16 @@ export const setupTopic = async (chatId, projectKey) => {
45
45
  // Частичный успех: если создался только Ops — печатаем его, иначе повторный
46
46
  // запуск создал бы ДРУГУЮ тему Ops, а старый id потерялся бы.
47
47
  if (ops === null) {
48
- log('Ops не созданпроверь: бот админ группы с правом «Управление темами», темы включены?');
48
+ log('Ops was not created check: is the bot a group admin with "Manage topics", and are topics on?');
49
49
  return;
50
50
  }
51
51
  if (dev === null) {
52
- log(`Ops создан (id=${ops}), Dev нетдобавь Dev вручную или повтори, и возьми ops=${ops}`);
53
- log('добавь в src/routes.ts (dev подставь после):');
54
- log(` ${JSON.stringify(projectKey)}: { chat: '${chatId}', ops: ${ops}, dev: <вставь> },`);
52
+ log(`Ops created (id=${ops}), Dev was not add Dev by hand or run again, and keep ops=${ops}`);
53
+ log('add to src/routes.ts (fill dev in afterwards):');
54
+ log(` ${JSON.stringify(projectKey)}: { chat: '${chatId}', ops: ${ops}, dev: <fill in> },`);
55
55
  return;
56
56
  }
57
- log(`вкладки созданы: Ops=${ops}, Dev=${dev}`);
58
- log('добавь в src/routes.ts:');
57
+ log(`tabs created: Ops=${ops}, Dev=${dev}`);
58
+ log('add to src/routes.ts:');
59
59
  log(` ${JSON.stringify(projectKey)}: { chat: '${chatId}', ops: ${ops}, dev: ${dev} },`);
60
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikitasazan/notify",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Единая типизированная отправка Telegram-уведомлений (форум-темы, маршрутизация, ретраи) для всех проектов",
5
5
  "type": "module",
6
6
  "license": "MIT",