(projectId: string, api: InstanceType<typeof Gitlab>)
| 279 | } |
| 280 | |
| 281 | export const getProjectMembers = async (projectId: string, api: InstanceType<typeof Gitlab>) => { |
| 282 | try { |
| 283 | const fetchFn = () => api.ProjectMembers.all(projectId, { |
| 284 | perPage: 100, |
| 285 | includeInherited: true, |
| 286 | }); |
| 287 | |
| 288 | const members = await fetchWithRetry(fetchFn, `project ${projectId}`, logger); |
| 289 | return members as Array<{ id: number }>; |
| 290 | } catch (error) { |
| 291 | Sentry.captureException(error); |
| 292 | logger.error(`Failed to fetch members for project ${projectId}.`, error); |
| 293 | throw error; |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | export const getProjectsForAuthenticatedUser = async (visibility: 'private' | 'internal' | 'public' | 'all' = 'all', api: InstanceType<typeof Gitlab>) => { |
| 298 | try { |
no test coverage detected