Версия и дата сборки на странице ручных тестов (BUILD_DATE в образе); исправление теста
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user