MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / studioJson

Function studioJson

scripts/studio-host-provider.mjs:615–628  ·  view source on GitHub ↗
(config, path, body)

Source from the content-addressed store, hash-verified

613}
614
615async function studioJson(config, path, body) {
616 const response = await fetch(`${config.studioUrl}${path}`, {
617 body: JSON.stringify(body),
618 headers: { "content-type": "application/json" },
619 method: "POST",
620 });
621 if (!response.ok) {
622 const message = await response.text().catch(() => "");
623 throw new Error(
624 `Studio request ${path} failed: HTTP ${response.status}${message ? `: ${message}` : ""}`,
625 );
626 }
627 return response.json();
628}
629
630async function loadConfig(args) {
631 const configPath = args["config"] || defaultConfigPath;

Callers 5

heartbeatFunction · 0.85
pollJobFunction · 0.85
pollRpcFunction · 0.85
completeJobFunction · 0.85
completeRpcFunction · 0.85

Calls 3

fetchFunction · 0.85
jsonMethod · 0.80
textMethod · 0.65

Tested by

no test coverage detected