@@ -14,6 +14,9 @@ import { gerritSchema } from "@sourcebot/schemas/v3/gerrit.schema";
1414import { giteaSchema } from "@sourcebot/schemas/v3/gitea.schema" ;
1515import { githubSchema } from "@sourcebot/schemas/v3/github.schema" ;
1616import { gitlabSchema } from "@sourcebot/schemas/v3/gitlab.schema" ;
17+ import { GithubConnectionConfig } from "@sourcebot/schemas/v3/github.type" ;
18+ import { GitlabConnectionConfig } from "@sourcebot/schemas/v3/gitlab.type" ;
19+ import { GiteaConnectionConfig } from "@sourcebot/schemas/v3/gitea.type" ;
1720import Ajv from "ajv" ;
1821import { StatusCodes } from "http-status-codes" ;
1922import { cookies , headers } from "next/headers" ;
@@ -1735,6 +1738,7 @@ export const getRepoImage = async (repoId: number, domain: string): Promise<Resp
17351738
17361739 // Only proxy images from self-hosted instances that might require authentication
17371740 const imageUrl = new URL ( repo . imageUrl ) ;
1741+
17381742 const publicHostnames = [
17391743 'github.com' ,
17401744 'gitlab.com' ,
@@ -1752,21 +1756,21 @@ export const getRepoImage = async (repoId: number, domain: string): Promise<Resp
17521756 for ( const { connection } of repo . connections ) {
17531757 try {
17541758 if ( connection . connectionType === 'github' ) {
1755- const config = connection . config as unknown as import ( '@sourcebot/schemas/v3/github.type' ) . GithubConnectionConfig ;
1759+ const config = connection . config as unknown as GithubConnectionConfig ;
17561760 if ( config . token ) {
17571761 const token = await getTokenFromConfig ( config . token , connection . orgId , prisma ) ;
17581762 authHeaders [ 'Authorization' ] = `token ${ token } ` ;
17591763 break ;
17601764 }
17611765 } else if ( connection . connectionType === 'gitlab' ) {
1762- const config = connection . config as unknown as import ( '@sourcebot/schemas/v3/gitlab.type' ) . GitlabConnectionConfig ;
1766+ const config = connection . config as unknown as GitlabConnectionConfig ;
17631767 if ( config . token ) {
17641768 const token = await getTokenFromConfig ( config . token , connection . orgId , prisma ) ;
17651769 authHeaders [ 'Authorization' ] = `Bearer ${ token } ` ;
17661770 break ;
17671771 }
17681772 } else if ( connection . connectionType === 'gitea' ) {
1769- const config = connection . config as unknown as import ( '@sourcebot/schemas/v3/gitea.type' ) . GiteaConnectionConfig ;
1773+ const config = connection . config as unknown as GiteaConnectionConfig ;
17701774 if ( config . token ) {
17711775 const token = await getTokenFromConfig ( config . token , connection . orgId , prisma ) ;
17721776 authHeaders [ 'Authorization' ] = `token ${ token } ` ;
0 commit comments