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: { async function saveGiteaProvider(input: {
applicationId: string applicationId: string
giteaOwner: string owner: string
giteaRepository: string repository: string
giteaBranch: string branch: string
giteaBuildPath?: string | null buildPath?: string | null
giteaId?: string | null id?: string | null
}): Promise<void> { }): Promise<void> {
await call('/application.saveGiteaProvider', { await call('/application.saveGiteaProvider', {
applicationId: input.applicationId, applicationId: input.applicationId,
giteaOwner: input.giteaOwner, owner: input.owner,
giteaRepository: input.giteaRepository, repository: input.repository,
giteaBranch: input.giteaBranch, branch: input.branch,
giteaBuildPath: input.giteaBuildPath ?? '/', buildPath: input.buildPath ?? '/',
giteaId: input.giteaId ?? null, id: input.id ?? null,
}) })
} }
async function saveGitProvider(input: { async function saveGitProvider(input: {
applicationId: string applicationId: string
gitProviderOwner?: string | null owner?: string | null
gitProviderRepository?: string | null repository?: string | null
gitProviderBranch?: string branch?: string
gitProviderBuildPath?: string | null buildPath?: string | null
gitProviderId?: string | null id?: string | null
}): Promise<void> { }): Promise<void> {
await call('/application.saveGitProvider', { await call('/application.saveGitProvider', {
applicationId: input.applicationId, applicationId: input.applicationId,
gitProviderOwner: input.gitProviderOwner ?? null, owner: input.owner ?? null,
gitProviderRepository: input.gitProviderRepository ?? null, repository: input.repository ?? null,
gitProviderBranch: input.gitProviderBranch ?? 'main', branch: input.branch ?? 'main',
gitProviderBuildPath: input.gitProviderBuildPath ?? '/', buildPath: input.buildPath ?? '/',
gitProviderId: input.gitProviderId ?? null, id: input.id ?? null,
}) })
} }
async function saveGithubProvider(input: { async function saveGithubProvider(input: {
applicationId: string applicationId: string
githubOwner: string owner: string
githubRepository: string repository: string
githubBranch: string branch: string
githubBuildPath?: string | null buildPath?: string | null
githubId?: string | null githubId?: string | null
}): Promise<void> { }): Promise<void> {
await call('/application.saveGithubProvider', { await call('/application.saveGithubProvider', {
applicationId: input.applicationId, applicationId: input.applicationId,
githubOwner: input.githubOwner, owner: input.owner,
githubRepository: input.githubRepository, repository: input.repository,
githubBranch: input.githubBranch, branch: input.branch,
githubBuildPath: input.githubBuildPath ?? '/', buildPath: input.buildPath ?? '/',
githubId: input.githubId ?? null, githubId: input.githubId ?? null,
}) })
} }
@@ -293,27 +293,27 @@ export function createDokployClient(config: DokployConfig) {
if (input.gitProvider === 'github' || input.gitRepo.includes('github.com')) { if (input.gitProvider === 'github' || input.gitRepo.includes('github.com')) {
await saveGithubProvider({ await saveGithubProvider({
applicationId: app.applicationId, applicationId: app.applicationId,
githubOwner: owner, owner,
githubRepository: repo, repository: repo,
githubBranch: input.gitBranch, branch: input.gitBranch,
githubBuildPath: input.buildPath ?? '/', buildPath: input.buildPath ?? '/',
}) })
} else if (input.gitProvider === 'gitea' || input.gitRepo.includes('git.dfmpanel.eu')) { } else if (input.gitProvider === 'gitea' || input.gitRepo.includes('git.dfmpanel.eu')) {
await saveGiteaProvider({ await saveGiteaProvider({
applicationId: app.applicationId, applicationId: app.applicationId,
giteaOwner: owner, owner,
giteaRepository: repo, repository: repo,
giteaBranch: input.gitBranch, branch: input.gitBranch,
giteaBuildPath: input.buildPath ?? '/', buildPath: input.buildPath ?? '/',
}) })
} else { } else {
// Generic git // Generic git
await saveGitProvider({ await saveGitProvider({
applicationId: app.applicationId, applicationId: app.applicationId,
gitProviderOwner: owner, owner,
gitProviderRepository: repo, repository: repo,
gitProviderBranch: input.gitBranch, branch: input.gitBranch,
gitProviderBuildPath: input.buildPath ?? '/', buildPath: input.buildPath ?? '/',
}) })
} }