fix: migrate API client to REST endpoints - #45
Conversation
The CLI calls /trpc/ endpoints but the server only responds on /api/ REST endpoints Fixes Dokploy#39
|
Independent validation ✅ Checked out this branch and ran it against a live Dokploy server (v0.29.x) with a real API key. On
The REST migration is the correct root-cause fix: current Dokploy servers expose these procedures under The |
|
Independent verification against a live Dokploy v0.29.13 panel using So the breakage is every parameterized read, not just Raw requests isolate the cause — same procedure, three shapes: Two details that support this PR's direction:
So dropping Scope caveat on my end: I verified the GET side live. I did not exercise the POST side against a real server (that panel is production), so |
Runtime, tooling and tests move to Bun; the bundled entrypoint is a single 0.33 MB script that runs on the installed Bun instead of a standalone binary. The API client now calls the REST routes described by openapi.json, sending GET parameters as named query keys and POST payloads as a JSON body, which fixes every parameterized read (upstream Dokploy#39, Dokploy#46, Dokploy#48). Transport direction follows upstream PR Dokploy#45. Requests use the built-in fetch, so axios is gone, and server errors report status, code and message. Credentials move to ${XDG_CONFIG_HOME:-~/.config}/dokploy/config.json with mode 0600 so a relocatable bundle no longer writes into its own install directory. The npm release workflow is removed because it published upstream's package name with a secret this fork does not hold; CI now runs typecheck, lint, build and tests on Bun.
Summary
/trpctransport to Dokploy's REST endpoints under/apiRoot cause
The generated commands call
apiGetandapiPost, but those helpers still used tRPC URLs and payload envelopes. Current Dokploy servers expose these procedures through REST endpoints, causing parameterized commands such asproject oneto fail with HTTP 400.This incorporates and preserves the original commits from #40 by @OskarWiedeweg, then adds encoded query handling and regression tests.
Fixes #39.
Validation
project alland parameterizedproject oneagainst a live Dokploy instance