({ owner, name })
| 63 | } |
| 64 | |
| 65 | async function readGitlab({ owner, name }) { |
| 66 | const headers = gitlabToken ? { Authorization: `Bearer ${gitlabToken}` } : {} |
| 67 | const encoded = encodeURIComponent(`${owner}/${name}`) |
| 68 | const data = await requestJson(`https://gitlab.com/api/v4/projects/${encoded}`, headers) |
| 69 | const avatar = data.namespace?.avatar_url ?? null |
| 70 | |
| 71 | return { |
| 72 | stars: data.star_count ?? 0, |
| 73 | updatedAt: data.last_activity_at ?? null, |
| 74 | ownerAvatar: avatar?.startsWith('/') ? `https://gitlab.com${avatar}` : avatar, |
| 75 | accessible: true |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | async function readCodeberg({ owner, name }) { |
| 80 | const headers = codebergToken ? { Authorization: `token ${codebergToken}` } : {} |
no test coverage detected