MCPcopy
hub / github.com/prisma/prisma / status

Method status

packages/cli/src/utils/nps/status.ts:17–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16export class ProdNpsStatusLookup implements NpsStatusLookup {
17 async status(): Promise<NpsStatus> {
18 const resp = await fetch(npsStatusUrl.href)
19
20 if (resp.status === 404) {
21 return {}
22 }
23 if (!resp.ok) {
24 throw new Error(`Failed to fetch NPS survey status: ${resp.statusText}`)
25 }
26
27 const obj = await resp.json()
28 if (!this.checkSchema(obj)) {
29 throw new Error('Invalid NPS status schema')
30 }
31 return obj
32 }
33
34 checkSchema(obj: any): obj is NpsStatus {
35 return (

Callers 1

handleNpsSurveyImplFunction · 0.80

Calls 2

checkSchemaMethod · 0.95
fetchFunction · 0.50

Tested by

no test coverage detected