MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / api

Function api

deployments/desktop/static/desktop.js:1722–1737  ·  view source on GitHub ↗
(path, options = {})

Source from the content-addressed store, hash-verified

1720 }
1721
1722 async function api(path, options = {}) {
1723 if (DEMO_MODE) return demoApi(path, options);
1724 const response = await fetch(path, {
1725 headers: { "Content-Type": "application/json" },
1726 ...options
1727 });
1728 const data = await response.json();
1729 if (!data.ok) {
1730 const error = new Error(data.error || ui().common.requestFailed);
1731 error.status = response.status;
1732 error.path = path;
1733 error.payload = data;
1734 throw error;
1735 }
1736 return data;
1737 }
1738
1739 function isUnknownApiRoute(error, route = "") {
1740 return Number(error?.status) === 404

Callers 15

loadUsersFunction · 0.70
loadHealthFunction · 0.70
loadSourceOptionsFunction · 0.70
ensureLlmReadyForReadingFunction · 0.70
loadLatestPushFunction · 0.70
runDailyFunction · 0.70
pollDailyTaskFunction · 0.70
resumeDailyTaskFunction · 0.70
submitFeedbackFunction · 0.70
deleteReportCardFunction · 0.70
refreshReportsFunction · 0.70
pollReadingTaskFunction · 0.70

Calls 3

uiFunction · 0.85
demoApiFunction · 0.70
jsonMethod · 0.45

Tested by

no test coverage detected