ux improved
This commit is contained in:
@@ -6,6 +6,26 @@ import { debug as dbg } from "../../shared/debug.js";
|
||||
export async function handleEvolutionWebhook(body) {
|
||||
const t0 = Date.now();
|
||||
const parsed = parseEvolutionWebhook(body);
|
||||
// #region agent log
|
||||
fetch("http://127.0.0.1:7242/ingest/86c7b1cd-c414-4eae-852c-08e57e562b3b", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
sessionId: "debug-session",
|
||||
runId: "pre-fix",
|
||||
hypothesisId: "H1",
|
||||
location: "evolution.js:9",
|
||||
message: "parsed_webhook",
|
||||
data: {
|
||||
ok: parsed?.ok,
|
||||
reason: parsed?.reason || null,
|
||||
has_text: Boolean(parsed?.text),
|
||||
source: parsed?.source || null,
|
||||
},
|
||||
timestamp: Date.now(),
|
||||
}),
|
||||
}).catch(() => {});
|
||||
// #endregion
|
||||
if (!parsed.ok) {
|
||||
return { status: 200, payload: { ok: true, ignored: parsed.reason } };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user