feat(qlik): extract network data via Playwright (in-page ws)

The Qlik proxy refuses a raw server-side websocket (403, even internally), so
extraction now runs through headless Chromium (NTLM via httpCredentials, like
the hermes agent) and opens the Engine websocket in-page — same origin, which
the proxy accepts. Efficient: selects the supplier's article codes on the
"Article Code" field so the hypercube returns only those rows.

- qlik-playwright.ts: browser singleton, in-page hypercube extraction (paginated)
- /api/qlik/sync: use the Playwright extractor
- Dockerfile: install chromium + headless deps, PLAYWRIGHT_CHROMIUM_PATH, copy playwright-core
- deps: playwright-core (lockfiles synced)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Opus 4.8 committed 2026-06-20 23:54:03 +02:00
1 parent 1281b0e21f
commit 694b780160
7 files changed
+177 -3

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { auth } from "@/lib/auth";
import { fetchNetworkMetrics } from "@/lib/qlik-client";
import { fetchNetworkMetricsPlaywright } from "@/lib/qlik-playwright";
import { upsertNetworkMetrics } from "@/lib/qlik-network-cache";
import { pgGetArticlesByFournisseur } from "@/lib/pg-ff-client";
@@ -44,7 +44,7 @@ export async function POST(req: NextRequest) {
});
}
const metrics = await fetchNetworkMetrics(codes);
const metrics = await fetchNetworkMetricsPlaywright(codes);
const count = await upsertNetworkMetrics([...metrics.values()]);
return NextResponse.json({
success: true,