Files
upload-gltf/lib/git/types.ts
T
2026-05-17 14:12:09 +02:00

37 lines
753 B
TypeScript

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 }>
}