sdk
sdk copied to clipboard
fix(v4): lowercase proxyCountryCode in Browsers.create() and Runs.create() browserSettings
Problem
The v2 and v3 SDK layers consistently normalise proxyCountryCode to lowercase before sending it to the API (both Sessions.create() and Browsers.create() in v2, Sessions.create() in v3). The v4 layer skips this normalisation entirely.
Current Behavior
v4 Browsers.create({ proxyCountryCode: "US" })sends"US"to the API as-is.v4 Runs.create({ task: "...", browserSettings: { proxyCountryCode: "US" } })sends"US"insidebrowserSettingsas-is.
Both can result in a validation error from the Cloud API, which only accepts lowercase ISO 3166-1 alpha-2 codes.
Expected Behavior
Both calls should silently normalise the value to lowercase, matching the behaviour of every other SDK version.
Reproduction
Pass an uppercase country code to v4 Browsers.create() or v4 Runs.create() — the API rejects it.
Technical Context
src/v2/resources/browsers.tsline 34 - lowercasesproxyCountryCodesrc/v2/resources/sessions.tsline 23 - lowercasesproxyCountryCodesrc/v3/resources/sessions.tsline 42 - lowercasesproxyCountryCode(added by #191)src/v4/resources/browsers.ts- no normalisationsrc/v4/resources/runs.ts- no normalisation forbrowserSettings.proxyCountryCode
The fix mirrors the existing pattern from #191 (v3 Sessions) applied to the two missing v4 entry points.