From 4f99206d34184bbcf1f5207542c413155dd49fb8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2026 09:02:46 +0000 Subject: [PATCH 1/7] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9673209..21c2cfc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 41 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b0c72d2fe5911c9ce155275b954198bf2152e915a7e5b9f719aad50e222b9ef8.yml -openapi_spec_hash: 5cf943ea5718059b7975417b012cee28 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-5f711a43f60f18016c38794f4dbd4fa86221e2ac2e50f9875ae84f5a247db136.yml +openapi_spec_hash: 1000553b31fbfe8574b5c7ed47b2166e config_hash: 0fb0ceca5946298c416cec0cca5260c7 From bf5cbe15abd1593fb321ae5cfa99c2403f583aae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2026 09:40:05 +0000 Subject: [PATCH 2/7] feat(api): api update --- .stats.yml | 4 ++-- news.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 21c2cfc..ab4d401 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 41 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-5f711a43f60f18016c38794f4dbd4fa86221e2ac2e50f9875ae84f5a247db136.yml -openapi_spec_hash: 1000553b31fbfe8574b5c7ed47b2166e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-f6a6ca581fd279a5c8028e3e00d84fd5114c0ba206f15e84c24d8abeedbf47d9.yml +openapi_spec_hash: 07010001ef5726f6f0f6ecdea1b36b51 config_hash: 0fb0ceca5946298c416cec0cca5260c7 diff --git a/news.go b/news.go index e4ea612..3257b57 100644 --- a/news.go +++ b/news.go @@ -412,8 +412,9 @@ type NewsSearchParamsFilterBy struct { Date NewsSearchParamsFilterByDate `json:"date,omitzero"` // Publisher countries to include, as lowercase ISO 3166-1 alpha-2 codes. Up to 3. // - // Any of "ae", "ar", "au", "ca", "cg", "ch", "cl", "de", "fi", "fr", "gb", "hk", - // "il", "in", "jp", "kr", "mx", "ng", "nl", "qa", "sa", "se", "sg", "us", "za". + // Any of "ae", "ar", "au", "ca", "cg", "ch", "cl", "cz", "de", "fi", "fr", "gb", + // "hk", "il", "in", "jp", "kr", "mx", "ng", "nl", "qa", "sa", "se", "sg", "us", + // "za". SourceCountry []string `json:"sourceCountry,omitzero"` // Publisher domains to include. Up to 3. SourceDomain []string `json:"sourceDomain,omitzero"` From d9808a58681c7d20a76c739581ddf75a9b251da0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Aug 2026 12:28:26 +0000 Subject: [PATCH 3/7] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ab4d401..91ac12d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 41 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-f6a6ca581fd279a5c8028e3e00d84fd5114c0ba206f15e84c24d8abeedbf47d9.yml -openapi_spec_hash: 07010001ef5726f6f0f6ecdea1b36b51 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-29a5e9392b60f02d4c19d457b92666bf54d49479670e719f36f23a5d3943f188.yml +openapi_spec_hash: 8a9c44d740853834fb6d7174013c1984 config_hash: 0fb0ceca5946298c416cec0cca5260c7 From 38af1ba1e07bd6ca04baf4269cf8940d8facfe94 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 02:21:24 +0000 Subject: [PATCH 4/7] feat(api): api update --- .stats.yml | 4 ++-- web.go | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 91ac12d..44d1600 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 41 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-29a5e9392b60f02d4c19d457b92666bf54d49479670e719f36f23a5d3943f188.yml -openapi_spec_hash: 8a9c44d740853834fb6d7174013c1984 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d4c568ebc1a0f853b02c55ba800c7d7b66189bc6dd22c3cb565a81361c832e2b.yml +openapi_spec_hash: 9a0ecdc06874eee29a3a58a699923405 config_hash: 0fb0ceca5946298c416cec0cca5260c7 diff --git a/web.go b/web.go index b05988b..e889277 100644 --- a/web.go +++ b/web.go @@ -3511,13 +3511,15 @@ type WebWebCrawlMdParams struct { // than this value, it will be aborted with a 408 status code. Maximum allowed // value is 300000ms (5 minutes). TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"` - // Regex pattern. Only URLs matching this pattern will be followed and scraped. + // Regex pattern. Only URLs matching this pattern will be followed and scraped. An + // automatic prefix scope in the form ^ follows a redirect of the + // starting page. URLRegex param.Opt[string] `json:"urlRegex,omitzero"` // Extract only the main content, stripping headers, footers, sidebars, and // navigation UseMainContentOnly param.Opt[bool] `json:"useMainContentOnly,omitzero"` - // Optional browser wait time in milliseconds after initial page load for each - // crawled page. Min: 0. Max: 30000 (30 seconds). + // Browser wait time in milliseconds after initial page load for each crawled page. + // Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds). WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"` // Fetch the target page through a residential proxy in this country (ISO 3166-1 // alpha-2). From 89a783e511be0409ecdf18b5268d5b41a869de7c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 07:21:53 +0000 Subject: [PATCH 5/7] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 44d1600..e115f20 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 41 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d4c568ebc1a0f853b02c55ba800c7d7b66189bc6dd22c3cb565a81361c832e2b.yml -openapi_spec_hash: 9a0ecdc06874eee29a3a58a699923405 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7e6b2353ee8631f506bd8ef7657f1684cddf84805c01d89c691d7f98c42127f7.yml +openapi_spec_hash: b63b980d90fc9c2b896b2739a8e15a59 config_hash: 0fb0ceca5946298c416cec0cca5260c7 From fa6ce4add1573e8b1e663f93a770854a0cb91341 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:54:55 +0000 Subject: [PATCH 6/7] feat(api): api update --- .stats.yml | 4 +- ai.go | 24 ++++++++++ web.go | 131 ++++++++++++++++++++++++++++++++++++++++++++++------ web_test.go | 7 ++- 4 files changed, 149 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index e115f20..4aa99bd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 41 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-7e6b2353ee8631f506bd8ef7657f1684cddf84805c01d89c691d7f98c42127f7.yml -openapi_spec_hash: b63b980d90fc9c2b896b2739a8e15a59 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-bf7ffa610bd4a02ea5bcb157521d17a041a48f78d87bf8fe8d812d3cbb87b489.yml +openapi_spec_hash: 90142d96969dea44c46a01abb683c426 config_hash: 0fb0ceca5946298c416cec0cca5260c7 diff --git a/ai.go b/ai.go index fd7bc1b..b6ec0be 100644 --- a/ai.go +++ b/ai.go @@ -129,6 +129,11 @@ type AIExtractProductResponseProduct struct { Tags []string `json:"tags" api:"required"` // Target audience for the product (array of strings) TargetAudience []string `json:"target_audience" api:"required"` + // Normalized stock or ordering availability + // + // Any of "in_stock", "out_of_stock", "limited_availability", "preorder", + // "backorder", "made_to_order", "discontinued". + Availability string `json:"availability" api:"nullable"` // Billing frequency for the product // // Any of "monthly", "yearly", "one_time", "usage_based". @@ -137,6 +142,8 @@ type AIExtractProductResponseProduct struct { Category string `json:"category" api:"nullable"` // Currency code for the price (e.g., USD, EUR) Currency string `json:"currency" api:"nullable"` + // Dimension statements shown for the product, preserving labels, values, and units + Dimensions []string `json:"dimensions"` // URL to the product image ImageURL string `json:"image_url" api:"nullable"` // Price of the product @@ -145,6 +152,8 @@ type AIExtractProductResponseProduct struct { // // Any of "per_seat", "flat", "tiered", "freemium", "custom". PricingModel string `json:"pricing_model" api:"nullable"` + // Original or regular price before a displayed discount + RegularPrice float64 `json:"regular_price" api:"nullable"` // URL to the product page URL string `json:"url" api:"nullable"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. @@ -156,12 +165,15 @@ type AIExtractProductResponseProduct struct { SKU respjson.Field Tags respjson.Field TargetAudience respjson.Field + Availability respjson.Field BillingFrequency respjson.Field Category respjson.Field Currency respjson.Field + Dimensions respjson.Field ImageURL respjson.Field Price respjson.Field PricingModel respjson.Field + RegularPrice respjson.Field URL respjson.Field ExtraFields map[string]respjson.Field raw string @@ -232,6 +244,11 @@ type AIExtractProductsResponseProduct struct { Tags []string `json:"tags" api:"required"` // Target audience for the product (array of strings) TargetAudience []string `json:"target_audience" api:"required"` + // Normalized stock or ordering availability + // + // Any of "in_stock", "out_of_stock", "limited_availability", "preorder", + // "backorder", "made_to_order", "discontinued". + Availability string `json:"availability" api:"nullable"` // Billing frequency for the product // // Any of "monthly", "yearly", "one_time", "usage_based". @@ -240,6 +257,8 @@ type AIExtractProductsResponseProduct struct { Category string `json:"category" api:"nullable"` // Currency code for the price (e.g., USD, EUR) Currency string `json:"currency" api:"nullable"` + // Dimension statements shown for the product, preserving labels, values, and units + Dimensions []string `json:"dimensions"` // URL to the product image ImageURL string `json:"image_url" api:"nullable"` // Price of the product @@ -248,6 +267,8 @@ type AIExtractProductsResponseProduct struct { // // Any of "per_seat", "flat", "tiered", "freemium", "custom". PricingModel string `json:"pricing_model" api:"nullable"` + // Original or regular price before a displayed discount + RegularPrice float64 `json:"regular_price" api:"nullable"` // URL to the product page URL string `json:"url" api:"nullable"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. @@ -259,12 +280,15 @@ type AIExtractProductsResponseProduct struct { SKU respjson.Field Tags respjson.Field TargetAudience respjson.Field + Availability respjson.Field BillingFrequency respjson.Field Category respjson.Field Currency respjson.Field + Dimensions respjson.Field ImageURL respjson.Field Price respjson.Field PricingModel respjson.Field + RegularPrice respjson.Field URL respjson.Field ExtraFields map[string]respjson.Field raw string diff --git a/web.go b/web.go index e889277..c159e14 100644 --- a/web.go +++ b/web.go @@ -208,16 +208,19 @@ type WebExtractResponseMetadata struct { NumSkipped int64 `json:"numSkipped" api:"required"` NumSucceeded int64 `json:"numSucceeded" api:"required"` NumURLs int64 `json:"numUrls" api:"required"` + // One verified outcome per requested browser action, in request order. + ActionsApplied []WebExtractResponseMetadataActionsApplied `json:"actionsApplied"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - MaxCrawlDepth respjson.Field - NumBlocked respjson.Field - NumFailed respjson.Field - NumSkipped respjson.Field - NumSucceeded respjson.Field - NumURLs respjson.Field - ExtraFields map[string]respjson.Field - raw string + MaxCrawlDepth respjson.Field + NumBlocked respjson.Field + NumFailed respjson.Field + NumSkipped respjson.Field + NumSucceeded respjson.Field + NumURLs respjson.Field + ActionsApplied respjson.Field + ExtraFields map[string]respjson.Field + raw string } `json:"-"` } @@ -227,6 +230,39 @@ func (r *WebExtractResponseMetadata) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +type WebExtractResponseMetadataActionsApplied struct { + Instruction string `json:"instruction" api:"required"` + // Applied means the requested page state was visibly verified. Failed means it was + // not verified. Skipped means it was not attempted. + // + // Any of "applied", "failed", "skipped". + Status string `json:"status" api:"required"` + // Visible page evidence used to verify an applied action. + CompletionEvidence string `json:"completionEvidence"` + DurationMs float64 `json:"durationMs"` + Error string `json:"error"` + Method string `json:"method"` + TargetDescription string `json:"targetDescription"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + Instruction respjson.Field + Status respjson.Field + CompletionEvidence respjson.Field + DurationMs respjson.Field + Error respjson.Field + Method respjson.Field + TargetDescription respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r WebExtractResponseMetadataActionsApplied) RawJSON() string { return r.JSON.raw } +func (r *WebExtractResponseMetadataActionsApplied) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Metadata about the API key used for the request. Included in every response // whenever a valid API key is provided, even when the response status is not 200. type WebExtractResponseKeyMetadata struct { @@ -2538,9 +2574,11 @@ func (r *WebWebScrapeSitemapResponseKeyMetadata) UnmarshalJSON(data []byte) erro } type WebExtractParams struct { - // JSON Schema for the returned data object. TypeScript Zod users can pass a JSON - // Schema generated from a Zod object; Python users can pass the equivalent JSON - // Schema object. + // JSON Schema for the returned data object. Image fields such as `image_urls` or + // `product_photos` automatically make page image references available to + // extraction, so product data and photos can be returned in one call. TypeScript + // Zod users can pass a JSON Schema generated from a Zod object; Python users can + // pass the equivalent JSON Schema object. Schema map[string]any `json:"schema,omitzero" api:"required"` // The starting website URL to crawl and extract from. Must include http:// or // https://. @@ -2572,7 +2610,8 @@ type WebExtractParams struct { // exchange for more stable output on animated pages. SettleAnimations param.Opt[bool] `json:"settleAnimations,omitzero"` // Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 - // (110s). Default: 80000 (80s). + // (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are + // provided. StopAfterMs param.Opt[int64] `json:"stopAfterMs,omitzero"` // Optional timeout in milliseconds for the request. If the request takes longer // than this value, it will be aborted with a 408 status code. Maximum allowed @@ -2580,8 +2619,12 @@ type WebExtractParams struct { TimeoutMs param.Opt[int64] `json:"timeoutMS,omitzero"` // Optional browser wait time in milliseconds after initial page load for each // crawled page. - WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"` - Pdf WebExtractParamsPdf `json:"pdf,omitzero"` + WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"` + // Optional browser actions executed in order on the requested page after it loads + // and before extraction. Requires a paid plan. When actions are provided and + // stopAfterMs is omitted, the crawl budget defaults to 110000 ms. + Actions []WebExtractParamsActionUnion `json:"actions,omitzero"` + Pdf WebExtractParamsPdf `json:"pdf,omitzero"` // Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. Tags []string `json:"tags,omitzero"` paramObj @@ -2595,6 +2638,66 @@ func (r *WebExtractParams) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// Only one field can be non-zero. +// +// Use [param.IsOmitted] to confirm if a field is set. +type WebExtractParamsActionUnion struct { + OfWait *WebExtractParamsActionWait `json:",omitzero,inline"` + OfPerform *WebExtractParamsActionPerform `json:",omitzero,inline"` + paramUnion +} + +func (u WebExtractParamsActionUnion) MarshalJSON() ([]byte, error) { + return param.MarshalUnion(u, u.OfWait, u.OfPerform) +} +func (u *WebExtractParamsActionUnion) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, u) +} + +func init() { + apijson.RegisterUnion[WebExtractParamsActionUnion]( + "do", + apijson.Discriminator[WebExtractParamsActionWait]("wait"), + apijson.Discriminator[WebExtractParamsActionPerform]("perform"), + ) +} + +// Pause for a fixed number of milliseconds before continuing to the next action. +// +// The properties Do, TimeMs are required. +type WebExtractParamsActionWait struct { + TimeMs int64 `json:"timeMs" api:"required"` + // This field can be elided, and will marshal its zero value as "wait". + Do constant.Wait `json:"do" default:"wait"` + paramObj +} + +func (r WebExtractParamsActionWait) MarshalJSON() (data []byte, err error) { + type shadow WebExtractParamsActionWait + return param.MarshalObject(r, (*shadow)(&r)) +} +func (r *WebExtractParamsActionWait) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + +// Resolve and perform one natural-language browser action. +// +// The properties Action, Do are required. +type WebExtractParamsActionPerform struct { + Action string `json:"action" api:"required"` + // This field can be elided, and will marshal its zero value as "perform". + Do constant.Perform `json:"do" default:"perform"` + paramObj +} + +func (r WebExtractParamsActionPerform) MarshalJSON() (data []byte, err error) { + type shadow WebExtractParamsActionPerform + return param.MarshalObject(r, (*shadow)(&r)) +} +func (r *WebExtractParamsActionPerform) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + type WebExtractParamsPdf struct { // Last 1-based PDF page to parse. Must be greater than or equal to start when both // are provided. diff --git a/web_test.go b/web_test.go index 5e480d7..c3096ba 100644 --- a/web_test.go +++ b/web_test.go @@ -33,7 +33,12 @@ func TestWebExtractWithOptionalParams(t *testing.T) { "required": "bar", "additionalProperties": "bar", }, - URL: "https://example.com", + URL: "https://example.com", + Actions: []contextdev.WebExtractParamsActionUnion{{ + OfWait: &contextdev.WebExtractParamsActionWait{ + TimeMs: 0, + }, + }}, FactCheck: contextdev.Bool(true), FollowSubdomains: contextdev.Bool(true), IncludeFrames: contextdev.Bool(true), From 75ca6ba0d9f6d036772675c321fac16949583492 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 10:55:21 +0000 Subject: [PATCH 7/7] release: 2.12.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 10 ++++++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e6c39ad..0746cbe 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.11.0" + ".": "2.12.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 064adc7..c7a0ce1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 2.12.0 (2026-08-21) + +Full Changelog: [v2.11.0...v2.12.0](https://github.com/context-dot-dev/context-go-sdk/compare/v2.11.0...v2.12.0) + +### Features + +* **api:** api update ([fa6ce4a](https://github.com/context-dot-dev/context-go-sdk/commit/fa6ce4add1573e8b1e663f93a770854a0cb91341)) +* **api:** api update ([38af1ba](https://github.com/context-dot-dev/context-go-sdk/commit/38af1ba1e07bd6ca04baf4269cf8940d8facfe94)) +* **api:** api update ([bf5cbe1](https://github.com/context-dot-dev/context-go-sdk/commit/bf5cbe15abd1593fb321ae5cfa99c2403f583aae)) + ## 2.11.0 (2026-08-18) Full Changelog: [v2.10.0...v2.11.0](https://github.com/context-dot-dev/context-go-sdk/compare/v2.10.0...v2.11.0) diff --git a/README.md b/README.md index fc8ec9d..22c70eb 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Or to pin the version: ```sh -go get -u 'github.com/context-dot-dev/context-go-sdk@v2.11.0' +go get -u 'github.com/context-dot-dev/context-go-sdk@v2.12.0' ``` diff --git a/internal/version.go b/internal/version.go index 4d3ca74..d2db0fd 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "2.11.0" // x-release-please-version +const PackageVersion = "2.12.0" // x-release-please-version