fix: Dokploy git provider field names (owner/repository/branch, not githubOwner/githubRepository/githubBranch)

Verified from @dokploy/mcp source code:
- saveGithubProvider expects: owner, repository, branch, buildPath, githubId
- saveGiteaProvider expects: owner, repository, branch, buildPath, id
- saveGitProvider expects: owner, repository, branch, buildPath, id
Previous code used prefixed field names (githubOwner, giteaOwner, etc.)
which caused HTTP 400 from Dokploy API.
This commit is contained in:
Z User committed 2026-10-29 11:42:50 +00:00
1 parent db8e365932
commit fcf68626f8
1 file changed
+40 -40
+40 -40
View File
@@ -134,54 +134,54 @@ export function createDokployClient(config: DokployConfig) {
async function saveGiteaProvider(input: {
applicationId: string
giteaOwner: string
giteaRepository: string
giteaBranch: string
giteaBuildPath?: string | null
giteaId?: string | null
owner: string
repository: string
branch: string
buildPath?: string | null
id?: string | null
}): Promise<void> {
await call('/application.saveGiteaProvider', {
applicationId: input.applicationId,
giteaOwner: input.giteaOwner,
giteaRepository: input.giteaRepository,
giteaBranch: input.giteaBranch,
giteaBuildPath: input.giteaBuildPath ?? '/',
giteaId: input.giteaId ?? null,
owner: input.owner,
repository: input.repository,
branch: input.branch,
buildPath: input.buildPath ?? '/',
id: input.id ?? null,
})
}
async function saveGitProvider(input: {
applicationId: string
gitProviderOwner?: string | null
gitProviderRepository?: string | null
gitProviderBranch?: string
gitProviderBuildPath?: string | null
gitProviderId?: string | null
owner?: string | null
repository?: string | null
branch?: string
buildPath?: string | null
id?: string | null
}): Promise<void> {
await call('/application.saveGitProvider', {
applicationId: input.applicationId,
gitProviderOwner: input.gitProviderOwner ?? null,
gitProviderRepository: input.gitProviderRepository ?? null,
gitProviderBranch: input.gitProviderBranch ?? 'main',
gitProviderBuildPath: input.gitProviderBuildPath ?? '/',
gitProviderId: input.gitProviderId ?? null,
owner: input.owner ?? null,
repository: input.repository ?? null,
branch: input.branch ?? 'main',
buildPath: input.buildPath ?? '/',
id: input.id ?? null,
})
}
async function saveGithubProvider(input: {
applicationId: string
githubOwner: string
githubRepository: string
githubBranch: string
githubBuildPath?: string | null
owner: string
repository: string
branch: string
buildPath?: string | null
githubId?: string | null
}): Promise<void> {
await call('/application.saveGithubProvider', {
applicationId: input.applicationId,
githubOwner: input.githubOwner,
githubRepository: input.githubRepository,
githubBranch: input.githubBranch,
githubBuildPath: input.githubBuildPath ?? '/',
owner: input.owner,
repository: input.repository,
branch: input.branch,
buildPath: input.buildPath ?? '/',
githubId: input.githubId ?? null,
})
}
@@ -293,27 +293,27 @@ export function createDokployClient(config: DokployConfig) {
if (input.gitProvider === 'github' || input.gitRepo.includes('github.com')) {
await saveGithubProvider({
applicationId: app.applicationId,
githubOwner: owner,
githubRepository: repo,
githubBranch: input.gitBranch,
githubBuildPath: input.buildPath ?? '/',
owner,
repository: repo,
branch: input.gitBranch,
buildPath: input.buildPath ?? '/',
})
} else if (input.gitProvider === 'gitea' || input.gitRepo.includes('git.dfmpanel.eu')) {
await saveGiteaProvider({
applicationId: app.applicationId,
giteaOwner: owner,
giteaRepository: repo,
giteaBranch: input.gitBranch,
giteaBuildPath: input.buildPath ?? '/',
owner,
repository: repo,
branch: input.gitBranch,
buildPath: input.buildPath ?? '/',
})
} else {
// Generic git
await saveGitProvider({
applicationId: app.applicationId,
gitProviderOwner: owner,
gitProviderRepository: repo,
gitProviderBranch: input.gitBranch,
gitProviderBuildPath: input.buildPath ?? '/',
owner,
repository: repo,
branch: input.gitBranch,
buildPath: input.buildPath ?? '/',
})
}