(visibility: 'private' | 'internal' | 'public' | 'all' = 'all', api: InstanceType<typeof Gitlab>)
| 295 | } |
| 296 | |
| 297 | export const getProjectsForAuthenticatedUser = async (visibility: 'private' | 'internal' | 'public' | 'all' = 'all', api: InstanceType<typeof Gitlab>) => { |
| 298 | try { |
| 299 | const fetchFn = () => api.Projects.all({ |
| 300 | ...(visibility !== 'all' ? { |
| 301 | visibility, |
| 302 | } : {}), |
| 303 | perPage: 100, |
| 304 | }); |
| 305 | const response = await fetchWithRetry(fetchFn, `authenticated user`, logger); |
| 306 | return response; |
| 307 | } catch (error) { |
| 308 | Sentry.captureException(error); |
| 309 | logger.error(`Failed to fetch projects for authenticated user.`, error); |
| 310 | throw error; |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | // Fetches OAuth scopes for the authenticated user. |
| 315 | // @see: https://github.com/doorkeeper-gem/doorkeeper/wiki/API-endpoint-descriptions-and-examples#get----oauthtokeninfo |
no test coverage detected