diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b429f96..db00cae 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.66.0" + ".": "0.67.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 5ad6924..a164009 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 119 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-e66c3f8aedccc39104386a3ec619f3fdcef7e8b00d9e5aa82e414a1b387351c2.yml -openapi_spec_hash: afeddf18ebc3da1521b3e6f6739411fa -config_hash: 80eef1b592110714ea55cd26c470fabb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-51549f813f3002e18c6ca8d850cc0c7932828d511c151e0412c73b6798d19e30.yml +openapi_spec_hash: ee77b293c4bda91c1a32cfdd12b8739e +config_hash: 57567e00b41af47cef1b78e51b747aa0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8510537..a9a1c6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.67.0 (2026-06-11) + +Full Changelog: [v0.66.0...v0.67.0](https://github.com/kernel/kernel-go-sdk/compare/v0.66.0...v0.67.0) + +### Features + +* Add project_id SDK client option mapped to X-Kernel-Project-Id ([fc37447](https://github.com/kernel/kernel-go-sdk/commit/fc37447ec9fc09e21c04d1ecee2009dc44010363)) + + +### Documentation + +* **api:** correct project-scoping descriptions in OpenAPI spec ([d10587c](https://github.com/kernel/kernel-go-sdk/commit/d10587c1131648662d969b25ed921264063e36a4)) + ## 0.66.0 (2026-06-10) Full Changelog: [v0.65.0...v0.66.0](https://github.com/kernel/kernel-go-sdk/compare/v0.65.0...v0.66.0) diff --git a/README.md b/README.md index de19a92..737e769 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.66.0' +go get -u 'github.com/kernel/kernel-go-sdk@v0.67.0' ``` diff --git a/authconnection.go b/authconnection.go index 11f8b81..a40d864 100644 --- a/authconnection.go +++ b/authconnection.go @@ -735,8 +735,8 @@ type ManagedAuthCreateRequestParam struct { // - { provider, path } for external provider item // - { provider, auto: true } for external provider domain lookup Credential ManagedAuthCreateRequestCredentialParam `json:"credential,omitzero"` - // Proxy selection. Provide either id or name. The proxy must belong to the - // caller's org. + // Proxy selection. Provide either id or name. The proxy must be in the same + // project as the resource referencing it. Proxy ManagedAuthCreateRequestProxyParam `json:"proxy,omitzero"` paramObj } @@ -774,8 +774,8 @@ func (r *ManagedAuthCreateRequestCredentialParam) UnmarshalJSON(data []byte) err return apijson.UnmarshalRoot(data, r) } -// Proxy selection. Provide either id or name. The proxy must belong to the -// caller's org. +// Proxy selection. Provide either id or name. The proxy must be in the same +// project as the resource referencing it. type ManagedAuthCreateRequestProxyParam struct { // Proxy ID ID param.Opt[string] `json:"id,omitzero"` @@ -823,8 +823,8 @@ type ManagedAuthUpdateRequestParam struct { // - { provider, path } for external provider item // - { provider, auto: true } for external provider domain lookup Credential ManagedAuthUpdateRequestCredentialParam `json:"credential,omitzero"` - // Proxy selection. Provide either id or name. The proxy must belong to the - // caller's org. + // Proxy selection. Provide either id or name. The proxy must be in the same + // project as the resource referencing it. Proxy ManagedAuthUpdateRequestProxyParam `json:"proxy,omitzero"` paramObj } @@ -862,8 +862,8 @@ func (r *ManagedAuthUpdateRequestCredentialParam) UnmarshalJSON(data []byte) err return apijson.UnmarshalRoot(data, r) } -// Proxy selection. Provide either id or name. The proxy must belong to the -// caller's org. +// Proxy selection. Provide either id or name. The proxy must be in the same +// project as the resource referencing it. type ManagedAuthUpdateRequestProxyParam struct { // Proxy ID ID param.Opt[string] `json:"id,omitzero"` @@ -1298,8 +1298,8 @@ type AuthConnectionLoginParams struct { // Override the connection's default for recording this login's browser session. // When omitted, the connection's record_session default is used. RecordSession param.Opt[bool] `json:"record_session,omitzero"` - // Proxy selection. Provide either id or name. The proxy must belong to the - // caller's org. + // Proxy selection. Provide either id or name. The proxy must be in the same + // project as the resource referencing it. Proxy AuthConnectionLoginParamsProxy `json:"proxy,omitzero"` paramObj } @@ -1312,8 +1312,8 @@ func (r *AuthConnectionLoginParams) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } -// Proxy selection. Provide either id or name. The proxy must belong to the -// caller's org. +// Proxy selection. Provide either id or name. The proxy must be in the same +// project as the resource referencing it. type AuthConnectionLoginParamsProxy struct { // Proxy ID ID param.Opt[string] `json:"id,omitzero"` diff --git a/browser.go b/browser.go index cc42ba4..d88b84f 100644 --- a/browser.go +++ b/browser.go @@ -679,8 +679,8 @@ type BrowserNewParams struct { // the dashboard. Must be unique among active sessions within the project. Can be // changed later via PATCH /browsers/{id_or_name}. Name param.Opt[string] `json:"name,omitzero"` - // Optional proxy to associate to the browser session. Must reference a proxy - // belonging to the caller's org. + // Optional proxy to associate to the browser session. Must reference a proxy in + // the same project as the browser session. ProxyID param.Opt[string] `json:"proxy_id,omitzero"` // Optional URL to open when the browser session is created. Navigation is // best-effort, so navigation failures do not prevent the session from being diff --git a/browserpool.go b/browserpool.go index dc4360f..7c50d82 100644 --- a/browserpool.go +++ b/browserpool.go @@ -74,7 +74,7 @@ func (r *BrowserPoolService) Update(ctx context.Context, idOrName string, body B return res, err } -// List browser pools owned by the caller's organization. +// List browser pools in the resolved project. func (r *BrowserPoolService) List(ctx context.Context, query BrowserPoolListParams, opts ...option.RequestOption) (res *pagination.OffsetPagination[BrowserPool], err error) { var raw *http.Response opts = slices.Concat(r.Options, opts) @@ -92,7 +92,7 @@ func (r *BrowserPoolService) List(ctx context.Context, query BrowserPoolListPara return res, nil } -// List browser pools owned by the caller's organization. +// List browser pools in the resolved project. func (r *BrowserPoolService) ListAutoPaging(ctx context.Context, query BrowserPoolListParams, opts ...option.RequestOption) *pagination.OffsetPaginationAutoPager[BrowserPool] { return pagination.NewOffsetPaginationAutoPager(r.List(ctx, query, opts...)) } @@ -211,8 +211,8 @@ type BrowserPoolBrowserPoolConfig struct { // specified, the matching profile will be loaded into the browser session. // Profiles must be created beforehand. Profile shared.BrowserProfile `json:"profile"` - // Optional proxy to associate to the browser session. Must reference a proxy - // belonging to the caller's org. + // Optional proxy to associate to the browser session. Must reference a proxy in + // the same project as the browser session. ProxyID string `json:"proxy_id"` // Optional URL to navigate to when a new browser is warmed into the pool. // Best-effort: failures to navigate do not fail pool fill. Only applied to @@ -379,8 +379,8 @@ type BrowserPoolNewParams struct { KioskMode param.Opt[bool] `json:"kiosk_mode,omitzero"` // Optional name for the browser pool. Must be unique within the project. Name param.Opt[string] `json:"name,omitzero"` - // Optional proxy to associate to the browser session. Must reference a proxy - // belonging to the caller's org. + // Optional proxy to associate to the browser session. Must reference a proxy in + // the same project as the browser session. ProxyID param.Opt[string] `json:"proxy_id,omitzero"` // Optional URL to navigate to when a new browser is warmed into the pool. // Best-effort: failures to navigate do not fail pool fill. Only applied to @@ -442,8 +442,8 @@ type BrowserPoolUpdateParams struct { KioskMode param.Opt[bool] `json:"kiosk_mode,omitzero"` // Optional name for the browser pool. Must be unique within the project. Name param.Opt[string] `json:"name,omitzero"` - // Optional proxy to associate to the browser session. Must reference a proxy - // belonging to the caller's org. + // Optional proxy to associate to the browser session. Must reference a proxy in + // the same project as the browser session. ProxyID param.Opt[string] `json:"proxy_id,omitzero"` // Number of browsers to maintain in the pool. The maximum size is determined by // your organization's pooled sessions limit (the sum of all pool sizes cannot diff --git a/credential.go b/credential.go index 5980b80..67241fb 100644 --- a/credential.go +++ b/credential.go @@ -75,8 +75,7 @@ func (r *CredentialService) Update(ctx context.Context, idOrName string, body Cr return res, err } -// List credentials owned by the caller's organization. Credential values are not -// returned. +// List credentials in the resolved project. Credential values are not returned. func (r *CredentialService) List(ctx context.Context, query CredentialListParams, opts ...option.RequestOption) (res *pagination.OffsetPagination[Credential], err error) { var raw *http.Response opts = slices.Concat(r.Options, opts) @@ -94,8 +93,7 @@ func (r *CredentialService) List(ctx context.Context, query CredentialListParams return res, nil } -// List credentials owned by the caller's organization. Credential values are not -// returned. +// List credentials in the resolved project. Credential values are not returned. func (r *CredentialService) ListAutoPaging(ctx context.Context, query CredentialListParams, opts ...option.RequestOption) *pagination.OffsetPaginationAutoPager[Credential] { return pagination.NewOffsetPaginationAutoPager(r.List(ctx, query, opts...)) } diff --git a/extension.go b/extension.go index 36bb65b..102df22 100644 --- a/extension.go +++ b/extension.go @@ -45,7 +45,7 @@ func NewExtensionService(opts ...option.RequestOption) (r ExtensionService) { return } -// List extensions owned by the caller's organization. +// List extensions in the resolved project. func (r *ExtensionService) List(ctx context.Context, query ExtensionListParams, opts ...option.RequestOption) (res *pagination.OffsetPagination[ExtensionListResponse], err error) { var raw *http.Response opts = slices.Concat(r.Options, opts) @@ -63,7 +63,7 @@ func (r *ExtensionService) List(ctx context.Context, query ExtensionListParams, return res, nil } -// List extensions owned by the caller's organization. +// List extensions in the resolved project. func (r *ExtensionService) ListAutoPaging(ctx context.Context, query ExtensionListParams, opts ...option.RequestOption) *pagination.OffsetPaginationAutoPager[ExtensionListResponse] { return pagination.NewOffsetPaginationAutoPager(r.List(ctx, query, opts...)) } diff --git a/internal/requestconfig/requestconfig.go b/internal/requestconfig/requestconfig.go index 6595f2b..334b381 100644 --- a/internal/requestconfig/requestconfig.go +++ b/internal/requestconfig/requestconfig.go @@ -219,6 +219,7 @@ type RequestConfig struct { HTTPClient *http.Client Middlewares []middleware APIKey string + ProjectID string // If ResponseBodyInto not nil, then we will attempt to deserialize into // ResponseBodyInto. If Destination is a []byte, then it will return the body as // is. @@ -593,6 +594,7 @@ func (cfg *RequestConfig) Clone(ctx context.Context) *RequestConfig { HTTPClient: cfg.HTTPClient, Middlewares: cfg.Middlewares, APIKey: cfg.APIKey, + ProjectID: cfg.ProjectID, } return new diff --git a/internal/version.go b/internal/version.go index 0ccbf2a..1137ca0 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.66.0" // x-release-please-version +const PackageVersion = "0.67.0" // x-release-please-version diff --git a/option/requestoption.go b/option/requestoption.go index fd632db..9b0d4f8 100644 --- a/option/requestoption.go +++ b/option/requestoption.go @@ -280,3 +280,11 @@ func WithAPIKey(value string) RequestOption { return r.Apply(WithHeader("authorization", fmt.Sprintf("Bearer %s", r.APIKey))) }) } + +// WithProjectID returns a RequestOption that sets the client setting "project_id". +func WithProjectID(value string) RequestOption { + return requestconfig.RequestOptionFunc(func(r *requestconfig.RequestConfig) error { + r.ProjectID = value + return r.Apply(WithHeader("X-Kernel-Project-Id", value)) + }) +} diff --git a/proxy.go b/proxy.go index 58e41b1..6897d1d 100644 --- a/proxy.go +++ b/proxy.go @@ -42,7 +42,7 @@ func NewProxyService(opts ...option.RequestOption) (r ProxyService) { return } -// Create a new proxy configuration for the caller's organization. +// Create a new proxy configuration in the resolved project. func (r *ProxyService) New(ctx context.Context, body ProxyNewParams, opts ...option.RequestOption) (res *ProxyNewResponse, err error) { opts = slices.Concat(r.Options, opts) path := "proxies" @@ -50,7 +50,7 @@ func (r *ProxyService) New(ctx context.Context, body ProxyNewParams, opts ...opt return res, err } -// Retrieve a proxy belonging to the caller's organization by ID. +// Retrieve a proxy in the resolved project by ID. func (r *ProxyService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *ProxyGetResponse, err error) { opts = slices.Concat(r.Options, opts) if id == "" { @@ -62,7 +62,7 @@ func (r *ProxyService) Get(ctx context.Context, id string, opts ...option.Reques return res, err } -// List proxies owned by the caller's organization. +// List proxies in the resolved project. func (r *ProxyService) List(ctx context.Context, query ProxyListParams, opts ...option.RequestOption) (res *pagination.OffsetPagination[ProxyListResponse], err error) { var raw *http.Response opts = slices.Concat(r.Options, opts) @@ -80,7 +80,7 @@ func (r *ProxyService) List(ctx context.Context, query ProxyListParams, opts ... return res, nil } -// List proxies owned by the caller's organization. +// List proxies in the resolved project. func (r *ProxyService) ListAutoPaging(ctx context.Context, query ProxyListParams, opts ...option.RequestOption) *pagination.OffsetPaginationAutoPager[ProxyListResponse] { return pagination.NewOffsetPaginationAutoPager(r.List(ctx, query, opts...)) }