( token: string, projectName: string, teamId?: string | null, )
| 149 | } |
| 150 | |
| 151 | async function fetchExistingProject( |
| 152 | token: string, |
| 153 | projectName: string, |
| 154 | teamId?: string | null, |
| 155 | ): Promise<VercelProjectResponse | null> { |
| 156 | try { |
| 157 | const project = await vercelFetch<VercelProjectResponse>( |
| 158 | token, |
| 159 | `/v9/projects/${encodeURIComponent(projectName)}`, |
| 160 | { |
| 161 | method: 'GET', |
| 162 | teamId, |
| 163 | }, |
| 164 | ); |
| 165 | return project; |
| 166 | } catch (error) { |
| 167 | if (error instanceof VercelError && error.status === 404) { |
| 168 | return null; |
| 169 | } |
| 170 | throw error; |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | export async function connectVercelProject( |
| 175 | projectId: string, |
no outgoing calls
no test coverage detected