MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / json

Function json

graph-ui/tools/pr-2068-feedback-e2e.mjs:26–36  ·  view source on GitHub ↗
(path, body)

Source from the content-addressed store, hash-verified

24const delay = (ms) => new Promise(done => setTimeout(done, ms));
25
26async function json(path, body) {
27 const response = await fetch(ORIGIN + path, {
28 method: body === undefined ? 'GET' : 'POST',
29 ...(body === undefined ? {} : { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) }),
30 signal: AbortSignal.timeout(30000),
31 });
32 const text = await response.text();
33 report.directRequests.push({ at: new Date().toISOString(), method: body === undefined ? 'GET' : 'POST', path, status: response.status });
34 assert.ok(response.ok, `${path}: HTTP ${response.status}: ${text.slice(0, 300)}`);
35 return JSON.parse(text);
36}
37
38const logs = (project, extra = '') => json(`/api/logs?lines=500&min_level=warn${project === undefined ? '' : `&project=${encodeURIComponent(project)}`}${extra}`);
39

Callers 2

logsFunction · 0.70
mainFunction · 0.70

Calls 2

textMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected