MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / getProjectsForAuthenticatedUser

Function getProjectsForAuthenticatedUser

packages/backend/src/gitlab.ts:297–312  ·  view source on GitHub ↗
(visibility: 'private' | 'internal' | 'public' | 'all' = 'all', api: InstanceType<typeof Gitlab>)

Source from the content-addressed store, hash-verified

295}
296
297export 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

Callers 1

Calls 1

fetchWithRetryFunction · 0.70

Tested by

no test coverage detected