diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8935e93..b8dda9b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.28.0" + ".": "0.29.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index bcbec15..470e498 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d430a8e3407ceb608d912cabadbcb016b4fcf057ca56b3bbd179ea3b3121b484.yml -openapi_spec_hash: 8adbf013baf77abacaf04ed067749397 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-46c8320dcd9f8fc596f469ef0dd1aafaca591ab36cf2a6f8a7297dc9136bdc71.yml +openapi_spec_hash: 1be1e6589cd94c581b241720e01a65bc config_hash: b470456b217bb9502f5212311d395a6f diff --git a/CHANGELOG.md b/CHANGELOG.md index bf635d7..2e71c79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.29.0 (2026-01-29) + +Full Changelog: [v0.28.0...v0.29.0](https://github.com/kernel/kernel-go-sdk/compare/v0.28.0...v0.29.0) + +### Features + +* add support for 1280x800@60 viewport ([0e0add6](https://github.com/kernel/kernel-go-sdk/commit/0e0add6efe25cbea44be8876e5b24c3b6fd2db02)) +* **client:** add a convenient param.SetJSON helper ([00e86b2](https://github.com/kernel/kernel-go-sdk/commit/00e86b280372cea0186578a4e73bf857310233e8)) + ## 0.28.0 (2026-01-22) Full Changelog: [v0.27.0...v0.28.0](https://github.com/kernel/kernel-go-sdk/compare/v0.27.0...v0.28.0) diff --git a/README.md b/README.md index 06ad356..e8139cf 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the version: ```sh -go get -u 'github.com/kernel/kernel-go-sdk@v0.28.0' +go get -u 'github.com/kernel/kernel-go-sdk@v0.29.0' ``` diff --git a/aliases.go b/aliases.go index a9d71da..c4f3e51 100644 --- a/aliases.go +++ b/aliases.go @@ -51,8 +51,8 @@ type BrowserProfileParam = shared.BrowserProfileParam // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, -// 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be -// automatically determined from the width and height if they match a supported +// 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will +// be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser // @@ -63,8 +63,8 @@ type BrowserViewport = shared.BrowserViewport // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, -// 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be -// automatically determined from the width and height if they match a supported +// 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will +// be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser // diff --git a/browser.go b/browser.go index 506c7bd..34df2b3 100644 --- a/browser.go +++ b/browser.go @@ -263,8 +263,8 @@ type BrowserNewResponse struct { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, - // 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be - // automatically determined from the width and height if they match a supported + // 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will + // be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser Viewport shared.BrowserViewport `json:"viewport"` @@ -326,8 +326,8 @@ type BrowserGetResponse struct { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, - // 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be - // automatically determined from the width and height if they match a supported + // 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will + // be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser Viewport shared.BrowserViewport `json:"viewport"` @@ -389,8 +389,8 @@ type BrowserUpdateResponse struct { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, - // 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be - // automatically determined from the width and height if they match a supported + // 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will + // be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser Viewport shared.BrowserViewport `json:"viewport"` @@ -452,8 +452,8 @@ type BrowserListResponse struct { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, - // 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be - // automatically determined from the width and height if they match a supported + // 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will + // be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser Viewport shared.BrowserViewport `json:"viewport"` @@ -516,8 +516,8 @@ type BrowserNewParams struct { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, - // 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be - // automatically determined from the width and height if they match a supported + // 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will + // be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser Viewport shared.BrowserViewportParam `json:"viewport,omitzero"` diff --git a/browserpool.go b/browserpool.go index 6119f17..4a33a78 100644 --- a/browserpool.go +++ b/browserpool.go @@ -199,8 +199,8 @@ type BrowserPoolBrowserPoolConfig struct { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, - // 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be - // automatically determined from the width and height if they match a supported + // 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will + // be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser Viewport shared.BrowserViewport `json:"viewport"` @@ -260,8 +260,8 @@ type BrowserPoolAcquireResponse struct { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, - // 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be - // automatically determined from the width and height if they match a supported + // 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will + // be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser Viewport shared.BrowserViewport `json:"viewport"` @@ -324,8 +324,8 @@ type BrowserPoolNewParams struct { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, - // 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be - // automatically determined from the width and height if they match a supported + // 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will + // be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser Viewport shared.BrowserViewportParam `json:"viewport,omitzero"` @@ -376,8 +376,8 @@ type BrowserPoolUpdateParams struct { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, - // 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be - // automatically determined from the width and height if they match a supported + // 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will + // be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser Viewport shared.BrowserViewportParam `json:"viewport,omitzero"` diff --git a/internal/version.go b/internal/version.go index 9efbcca..ecc4b71 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.28.0" // x-release-please-version +const PackageVersion = "0.29.0" // x-release-please-version diff --git a/packages/param/param.go b/packages/param/param.go index 75e8528..5d5e08c 100644 --- a/packages/param/param.go +++ b/packages/param/param.go @@ -41,6 +41,19 @@ func Override[T ParamStruct, PtrT InferPtr[T]](v any) T { return *pt } +// SetJSON configures a param struct to serialize with the provided raw JSON data. +// Use this when you have existing JSON that you want to send as request parameters. +// +// var req example.NewUserParams +// var rawJSON = []byte(`{"name": "...", "age": 40}`) +// param.SetJSON(rawJSON, &req) +// res, err := client.Users.New(ctx, req) +// +// Note: The struct's existing fields will be ignored; only the provided JSON is serialized. +func SetJSON(rawJSON []byte, ptr anyParamStruct) { + ptr.setMetadata(json.RawMessage(rawJSON)) +} + // IsOmitted returns true if v is the zero value of its type. // // If IsOmitted is true, and the field uses a `json:"...,omitzero"` tag, @@ -91,6 +104,11 @@ type ParamStruct interface { extraFields() map[string]any } +// A pointer to ParamStruct +type anyParamStruct interface { + setMetadata(any) +} + // This is an implementation detail and should never be explicitly set. type InferPtr[T ParamStruct] interface { setMetadata(any) diff --git a/shared/shared.go b/shared/shared.go index 01ad91b..fe7b089 100644 --- a/shared/shared.go +++ b/shared/shared.go @@ -151,8 +151,8 @@ func (r *BrowserProfileParam) UnmarshalJSON(data []byte) error { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, -// 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be -// automatically determined from the width and height if they match a supported +// 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will +// be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser type BrowserViewport struct { @@ -192,8 +192,8 @@ func (r BrowserViewport) ToParam() BrowserViewportParam { // image defaults apply (1920x1080@25). Only specific viewport configurations are // supported. The server will reject unsupported combinations. Supported // resolutions are: 2560x1440@10, 1920x1080@25, 1920x1200@25, 1440x900@25, -// 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will be -// automatically determined from the width and height if they match a supported +// 1280x800@60, 1024x768@60, 1200x800@60 If refresh_rate is not provided, it will +// be automatically determined from the width and height if they match a supported // configuration exactly. Note: Higher resolutions may affect the responsiveness of // live view browser //