Fix missing return values, URL inconsistencies, and comparison operators#206
Open
JoshSalway wants to merge 1 commit into
Open
Fix missing return values, URL inconsistencies, and comparison operators#206JoshSalway wants to merge 1 commit into
JoshSalway wants to merge 1 commit into
Conversation
…d getSiteCommand return type - Add missing return in reconnectToServer() (fixes #1) - Add missing return in installCertificate() when wait=true (fixes #2) - Add missing return in activateCertificate() when wait=true (fixes #3) - Add missing return in restartWorker() when wait=true (fixes #4) - Remove /api/v1/ prefix from deployment history methods (fixes #5) - Use strict === for all status code comparisons (fixes #6) - Return single SiteCommand instead of collection in getSiteCommand() (fixes #7) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #209
Summary
Fixes several bugs and inconsistencies across the SDK:
Missing return values
reconnectToServer(): Missingreturnkeyword — extractedpublic_keybut never returned itinstallCertificate(): Returns void when$wait = true— now returns theCertificateinstanceactivateCertificate(): Same issue — now returnsCertificateafter waitingrestartWorker(): Returns void when$wait = true— now returns theWorkerinstanceURL style inconsistency
deploymentHistory(),deploymentHistoryDeployment(),deploymentHistoryOutput(): Used absolute paths (/api/v1/servers/...) while every other method uses relative paths (servers/...). Both resolve to the same final URL since the base URI already includes/api/v1/, but relative paths are used consistently everywhere else.Other fixes
getSiteCommand(): Was wrapping a single command intransformCollection()returning an array — now returns a singleSiteCommandinstancehandleRequestError(): Standardised status code comparisons to use strict===consistently (422, 404, 400 used loose==while 403 already used===)Test plan
reconnectToServer()now returns the public key stringinstallCertificate()returnsCertificateinstance after waitingactivateCertificate()returnsCertificateinstance after waitingrestartWorker()returnsWorkerinstance after waitinggetSiteCommand()returns a singleSiteCommand, not an array🤖 Generated with Claude Code