Версия и дата сборки на странице ручных тестов (BUILD_DATE в образе); исправление теста
All checks were successful
ci / test (push) Successful in 39s
ci / deploy (push) Successful in 2m46s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 10:20:07 +03:00
parent 62dfe89f96
commit d1e3f18817
5 changed files with 19 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import { createHmac } from "node:crypto";
import Fastify, { type FastifyInstance } from "fastify";
import { QboAuth, ReauthNeeded } from "./service.js";
import type { QboSync } from "./sync.js";
import { TESTS_PAGE } from "./tests-page.js";
import { renderTestsPage } from "./tests-page.js";
import { parseWebhook, verifyWebhook } from "./webhook.js";
export interface WebhookOptions {
@@ -65,7 +65,7 @@ export function buildApi(auth: QboAuth, token: string, sync?: QboSync, webhook?:
* Наружу: /api/qbo/tests/<slug>.
*/
const tests = (req: { params: unknown }): boolean => (req.params as { slug?: string }).slug === slug;
app.get("/tests/:slug", async (req, reply) => (tests(req) ? reply.type("text/html").send(TESTS_PAGE) : reply.code(404).send({ error: "not_found" })));
app.get("/tests/:slug", async (req, reply) => (tests(req) ? reply.type("text/html").send(renderTestsPage()) : reply.code(404).send({ error: "not_found" })));
app.get("/tests/:slug/status", async (req, reply) => {
if (!tests(req)) return reply.code(404).send({ error: "not_found" });
const st = await auth.status();