call
uses tcmts.cli.test.e2e.jobs.hashOf, which uses node:sqlite
POST a server function call, retried once on a keep-alive connection reset (see web.test.ts).
import { hashOf } from "#codebase/tcmts/cli/test/e2e/jobs"; export const call = async (dir: string, url: string, name: string, args: unknown[]): Promise<{ status: number; body: string }> => { const init = { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(args) }; let res: Response; try { res = await fetch(new URL(`/__tcm/rpc/${hashOf(dir, name)}`, url), init); } catch (e) { if ((e as { cause?: { code?: string } }).cause?.code !== "ECONNRESET") throw e; res = await fetch(new URL(`/__tcm/rpc/${hashOf(dir, name)}`, url), init); } return { status: res.status, body: await res.text() }; }