refactor: split git provider adapters

This commit is contained in:
Tom Boullay
2026-05-17 14:12:09 +02:00
parent 377ed7cfb3
commit 81c513ee1f
13 changed files with 779 additions and 644 deletions
+36
View File
@@ -0,0 +1,36 @@
import type { PushFile, RemoteFile } from '@/lib/types'
export type GitProviderName = 'github' | 'gitea'
export interface GitRemoteConfig {
apiBaseUrl: string
lfsBatchUrl: string
owner: string
provider: GitProviderName
repo: string
token: string
username?: string
webUrl: string
}
export interface LfsObject {
oid: string
size: number
contentBase64: string
}
export type LfsPushFile = PushFile & {
oid: string
size: number
}
export interface PushFilesParams {
commitMessage: string
deletePaths: string[]
files: PushFile[]
}
export interface GitProvider {
getRemoteFolder(folderPath: string): Promise<{ exists: boolean; files: RemoteFile[] }>
pushFiles(params: PushFilesParams): Promise<{ commitUrl: string }>
}