Каркас monorepo: scheduler, data_collector, khbuild_assistant_prep, khb_common; миграции; CI/CD
Some checks failed
ci / test (push) Failing after 20s
ci / deploy (push) Has been skipped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 09:44:50 +03:00
commit ebb1cb7950
101 changed files with 4971 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import type { CommonSettings } from "../settings/index.js";
/** Уведомление ИТ-команде в Slack. Без настроек itAlerts возвращает false (вызывающий пишет в лог). */
export async function itNotify(
settings: Pick<CommonSettings, "itAlerts">,
text: string,
fetchFn: typeof fetch = fetch,
): Promise<boolean> {
const cfg = settings.itAlerts;
if (!cfg) return false;
const res = await fetchFn("https://slack.com/api/chat.postMessage", {
method: "POST",
headers: { "content-type": "application/json", authorization: `Bearer ${cfg.slackBotToken}` },
body: JSON.stringify({ channel: cfg.slackChannelId, text }),
});
const body = (await res.json()) as { ok?: boolean };
return res.ok && body.ok === true;
}