MCPcopy Create free account
hub / github.com/ForgeAILab/forge / apiFetch

Function apiFetch

web/src/api/client.ts:104–112  ·  view source on GitHub ↗
(path: string, init?: ApiFetchInit)

Source from the content-addressed store, hash-verified

102}
103
104export async function apiFetch<T>(path: string, init?: ApiFetchInit): Promise<T> {
105 const response = await apiResponse(path, init)
106 const text = await response.text()
107 if (response.status === 204 || text.length === 0) {
108 return undefined as T
109 }
110
111 return JSON.parse(text) as T
112}
113
114export async function apiFetchBlob(path: string, init?: ApiFetchInit): Promise<Blob> {
115 const response = await apiResponse(path, init)

Callers 15

router.tsxFile · 0.90
ProjectHooksSectionFunction · 0.90
TaskDetailPageFunction · 0.90
ExecutionDetailPageFunction · 0.90
TaskExecutionsTabFunction · 0.90
createTerminalSessionFunction · 0.90
listTerminalSessionsFunction · 0.90
getTerminalSessionFunction · 0.90
getTerminalAvailabilityFunction · 0.90
issueTerminalAttachTokenFunction · 0.90
resizeTerminalSessionFunction · 0.90
terminateTerminalSessionFunction · 0.90

Calls 2

apiResponseFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected