MCPcopy
hub / github.com/prisma/prisma / queryStatusAPI

Function queryStatusAPI

packages/cli/src/status-page.ts:154–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152 | { parseError: string }
153
154async function queryStatusAPI(): Promise<StatusResult> {
155 try {
156 const response = await fetch(SUMMARY_API_URL, { signal: AbortSignal.timeout(10_000) })
157 if (!response.ok) return { httpError: response.status }
158 const parsed = StatusPageSummarySchema.safeParse(await response.json())
159 if (!parsed.success) return { parseError: `unexpected API response: ${parsed.error.message}` }
160 return { summary: parsed.data }
161 } catch (e) {
162 return { networkError: e instanceof Error ? e.message : String(e) }
163 }
164}
165
166/** Fetches status from the Prisma status page API and returns formatted output. */
167export async function fetchStatus(isJson: boolean): Promise<string> {

Callers 1

fetchStatusFunction · 0.85

Calls 1

fetchFunction · 0.50

Tested by

no test coverage detected