diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 21f6056..e6c39ad 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.10.0" + ".": "2.11.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 4b9b1cb..9673209 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-5dbe631ce516ca688273053ddcb58870561bd6dc76fa75df354c954d7af65a3c.yml -openapi_spec_hash: 53a74c4cccbdec8590db38183840a446 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-b0c72d2fe5911c9ce155275b954198bf2152e915a7e5b9f719aad50e222b9ef8.yml +openapi_spec_hash: 5cf943ea5718059b7975417b012cee28 config_hash: 0fb0ceca5946298c416cec0cca5260c7 diff --git a/CHANGELOG.md b/CHANGELOG.md index 69e4ef2..e27ef3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 2.11.0 (2026-08-18) + +Full Changelog: [v2.10.0...v2.11.0](https://github.com/context-dot-dev/context-php-sdk/compare/v2.10.0...v2.11.0) + +### Features + +* **api:** api update ([6884bcc](https://github.com/context-dot-dev/context-php-sdk/commit/6884bccdb59931c30a1778e0ce6dfe8566eac781)) +* **api:** api update ([12c8df5](https://github.com/context-dot-dev/context-php-sdk/commit/12c8df51b59e9fefe8ebf3dd17ee2ddbc8ef3af7)) +* **api:** api update ([5f91017](https://github.com/context-dot-dev/context-php-sdk/commit/5f910173f3c49527bd7d5408a198885b11c4fd29)) + + +### Chores + +* **internal:** codegen related update ([dc83cc4](https://github.com/context-dot-dev/context-php-sdk/commit/dc83cc446beff270d9352e6962eec7541219a691)) + ## 2.10.0 (2026-08-17) Full Changelog: [v2.9.0...v2.10.0](https://github.com/context-dot-dev/context-php-sdk/compare/v2.9.0...v2.10.0) diff --git a/README.md b/README.md index 462850f..e315b06 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The REST API documentation can be found on [docs.context.dev](https://docs.conte ``` -composer require "context-dev/context-dev-php 2.10.0" +composer require "context-dev/context-dev-php 2.11.0" ``` diff --git a/src/Brand/BrandGetResponse/Brand/Color.php b/src/Brand/BrandGetResponse/Brand/Color.php index 5f07da9..aedc263 100644 --- a/src/Brand/BrandGetResponse/Brand/Color.php +++ b/src/Brand/BrandGetResponse/Brand/Color.php @@ -4,12 +4,15 @@ namespace ContextDev\Brand\BrandGetResponse\Brand; +use ContextDev\Brand\BrandGetResponse\Brand\Color\Source; use ContextDev\Core\Attributes\Optional; use ContextDev\Core\Concerns\SdkModel; use ContextDev\Core\Contracts\BaseModel; /** - * @phpstan-type ColorShape = array{hex?: string|null, name?: string|null} + * @phpstan-type ColorShape = array{ + * hex?: string|null, name?: string|null, source?: null|Source|value-of + * } */ final class Color implements BaseModel { @@ -28,6 +31,14 @@ final class Color implements BaseModel #[Optional] public ?string $name; + /** + * Where the color was observed: 'site' colors come from the website's own theme signals (rendered page colors, manifest, theme-color meta), 'logo' colors from logo image pixels. + * + * @var value-of|null $source + */ + #[Optional(enum: Source::class)] + public ?string $source; + public function __construct() { $this->initialize(); @@ -37,13 +48,19 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Source|value-of|null $source */ - public static function with(?string $hex = null, ?string $name = null): self - { + public static function with( + ?string $hex = null, + ?string $name = null, + Source|string|null $source = null + ): self { $self = new self; null !== $hex && $self['hex'] = $hex; null !== $name && $self['name'] = $name; + null !== $source && $self['source'] = $source; return $self; } @@ -69,4 +86,17 @@ public function withName(string $name): self return $self; } + + /** + * Where the color was observed: 'site' colors come from the website's own theme signals (rendered page colors, manifest, theme-color meta), 'logo' colors from logo image pixels. + * + * @param Source|value-of $source + */ + public function withSource(Source|string $source): self + { + $self = clone $this; + $self['source'] = $source; + + return $self; + } } diff --git a/src/Brand/BrandGetResponse/Brand/Color/Source.php b/src/Brand/BrandGetResponse/Brand/Color/Source.php new file mode 100644 index 0000000..c70a0aa --- /dev/null +++ b/src/Brand/BrandGetResponse/Brand/Color/Source.php @@ -0,0 +1,15 @@ + + * } */ final class Color implements BaseModel { @@ -28,6 +31,14 @@ final class Color implements BaseModel #[Optional] public ?string $name; + /** + * Where the color was observed: 'site' colors come from the website's own theme signals (rendered page colors, manifest, theme-color meta), 'logo' colors from logo image pixels. + * + * @var value-of|null $source + */ + #[Optional(enum: Source::class)] + public ?string $source; + public function __construct() { $this->initialize(); @@ -37,13 +48,19 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Source|value-of|null $source */ - public static function with(?string $hex = null, ?string $name = null): self - { + public static function with( + ?string $hex = null, + ?string $name = null, + Source|string|null $source = null + ): self { $self = new self; null !== $hex && $self['hex'] = $hex; null !== $name && $self['name'] = $name; + null !== $source && $self['source'] = $source; return $self; } @@ -69,4 +86,17 @@ public function withName(string $name): self return $self; } + + /** + * Where the color was observed: 'site' colors come from the website's own theme signals (rendered page colors, manifest, theme-color meta), 'logo' colors from logo image pixels. + * + * @param Source|value-of $source + */ + public function withSource(Source|string $source): self + { + $self = clone $this; + $self['source'] = $source; + + return $self; + } } diff --git a/src/Brand/BrandGetSimplifiedResponse/Brand/Color/Source.php b/src/Brand/BrandGetSimplifiedResponse/Brand/Color/Source.php new file mode 100644 index 0000000..6f1fc87 --- /dev/null +++ b/src/Brand/BrandGetSimplifiedResponse/Brand/Color/Source.php @@ -0,0 +1,15 @@ + $mergedQuery */ - $mergedQuery = array_merge_recursive( - $query, - $options->extraQueryParams ?? [] - ); + $mergedQuery = [...$query, ...($options->extraQueryParams ?? [])]; $uri = Util::joinUri($this->baseUrl, path: $parsedPath, query: $mergedQuery)->__toString(); $idempotencyHeaders = $this->idempotencyHeader && !array_key_exists($this->idempotencyHeader, array: $headers) ? [$this->idempotencyHeader => $this->generateIdempotencyKey()] diff --git a/src/Core/Concerns/SdkModel.php b/src/Core/Concerns/SdkModel.php index c5c096e..289c50b 100644 --- a/src/Core/Concerns/SdkModel.php +++ b/src/Core/Concerns/SdkModel.php @@ -97,6 +97,26 @@ public function __get(string $key): mixed return null; } + /** + * @internal + * + * Like {@link __unserialize()}, but for raw API payloads, whose keys are + * API property names rather than PHP property names + * + * @param array $data + */ + public function unserializeFromApiPayload(array $data): void + { + foreach (self::$converter->properties as $name => $info) { + if ($name !== $info->apiName && array_key_exists($info->apiName, array: $data)) { + $data[$name] = $data[$info->apiName]; + unset($data[$info->apiName]); + } + } + + $this->__unserialize($data); + } + /** * @internal * diff --git a/src/Core/Util.php b/src/Core/Util.php index c163479..e0e1f87 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -207,7 +207,7 @@ public static function joinUri( parse_str($base->getQuery(), $q1); parse_str($parsed['query'] ?? '', $q2); - $mergedQuery = array_merge_recursive($q1, $q2, $query); + $mergedQuery = [...$q1, ...$q2, ...$query]; /** @var array */ $normalizedQuery = self::mapRecursive( diff --git a/src/News/NewsSearchResponse.php b/src/News/NewsSearchResponse.php index 99ddc01..728aa1f 100644 --- a/src/News/NewsSearchResponse.php +++ b/src/News/NewsSearchResponse.php @@ -30,16 +30,29 @@ final class NewsSearchResponse implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var list $data */ + /** + * Articles matching the search, in the requested order. + * + * @var list $data + */ #[Required(list: Data::class)] public array $data; + /** + * True when more results are available beyond this page. + */ #[Required('has_more')] public bool $hasMore; + /** + * Summary information about this response. + */ #[Required] public Meta $meta; + /** + * Pass as cursor in the next request to fetch the following page. Null when there are no more results. + */ #[Required('next_cursor')] public ?string $nextCursor; @@ -101,6 +114,8 @@ public static function with( } /** + * Articles matching the search, in the requested order. + * * @param list $data */ public function withData(array $data): self @@ -111,6 +126,9 @@ public function withData(array $data): self return $self; } + /** + * True when more results are available beyond this page. + */ public function withHasMore(bool $hasMore): self { $self = clone $this; @@ -120,6 +138,8 @@ public function withHasMore(bool $hasMore): self } /** + * Summary information about this response. + * * @param Meta|MetaShape $meta */ public function withMeta(Meta|array $meta): self @@ -130,6 +150,9 @@ public function withMeta(Meta|array $meta): self return $self; } + /** + * Pass as cursor in the next request to fetch the following page. Null when there are no more results. + */ public function withNextCursor(?string $nextCursor): self { $self = clone $this; diff --git a/src/News/NewsSearchResponse/Data.php b/src/News/NewsSearchResponse/Data.php index f7a21ba..243f693 100644 --- a/src/News/NewsSearchResponse/Data.php +++ b/src/News/NewsSearchResponse/Data.php @@ -35,44 +35,79 @@ final class Data implements BaseModel /** @use SdkModel */ use SdkModel; + /** + * Stable unique identifier for this article. Use it to deduplicate or reference an article across requests. + */ #[Required] public string $id; - /** @var list $authors */ + /** + * Bylined authors. Empty when no byline is available. + * + * @var list $authors + */ #[Required(list: 'string')] public array $authors; + /** + * Short summary or excerpt of the article, when the publisher provides one. + */ #[Required] public ?string $description; + /** + * Lead image for the article, when one is available. + */ #[Required('image_url')] public ?string $imageURL; + /** + * Language the article is written in, as a lowercase ISO 639-1 code such as en. Null when unknown. + */ #[Required] public ?string $language; + /** + * How the article relates to the company you searched for. + */ #[Required] public Match_ $match; + /** + * When the article was published, as an ISO 8601 timestamp. Null when the publisher does not state a reliable date. + */ #[Required('published_at')] public ?\DateTimeInterface $publishedAt; + /** + * The publication that published the article. + */ #[Required] public Source $source; /** - * Groups matching normalized headlines published on the same UTC day. + * Shared by articles covering the same story on the same day. Use it to group or collapse syndicated copies of one announcement across outlets. */ #[Required('story_id')] public string $storyID; + /** + * Article headline. + */ #[Required] public string $title; - /** @var value-of $type */ + /** + * Kind of coverage. Use it to separate independent reporting (editorial) from company-issued content (press_release, regulatory_filing, advisory). + * + * @var value-of $type + */ #[Required(enum: Type::class)] public string $type; + /** + * Link to the article on the publisher site. + */ #[Required] public string $url; @@ -162,6 +197,9 @@ public static function with( return $self; } + /** + * Stable unique identifier for this article. Use it to deduplicate or reference an article across requests. + */ public function withID(string $id): self { $self = clone $this; @@ -171,6 +209,8 @@ public function withID(string $id): self } /** + * Bylined authors. Empty when no byline is available. + * * @param list $authors */ public function withAuthors(array $authors): self @@ -181,6 +221,9 @@ public function withAuthors(array $authors): self return $self; } + /** + * Short summary or excerpt of the article, when the publisher provides one. + */ public function withDescription(?string $description): self { $self = clone $this; @@ -189,6 +232,9 @@ public function withDescription(?string $description): self return $self; } + /** + * Lead image for the article, when one is available. + */ public function withImageURL(?string $imageURL): self { $self = clone $this; @@ -197,6 +243,9 @@ public function withImageURL(?string $imageURL): self return $self; } + /** + * Language the article is written in, as a lowercase ISO 639-1 code such as en. Null when unknown. + */ public function withLanguage(?string $language): self { $self = clone $this; @@ -206,6 +255,8 @@ public function withLanguage(?string $language): self } /** + * How the article relates to the company you searched for. + * * @param Match_|MatchShape $match */ public function withMatch(Match_|array $match): self @@ -216,6 +267,9 @@ public function withMatch(Match_|array $match): self return $self; } + /** + * When the article was published, as an ISO 8601 timestamp. Null when the publisher does not state a reliable date. + */ public function withPublishedAt(?\DateTimeInterface $publishedAt): self { $self = clone $this; @@ -225,6 +279,8 @@ public function withPublishedAt(?\DateTimeInterface $publishedAt): self } /** + * The publication that published the article. + * * @param Source|SourceShape $source */ public function withSource(Source|array $source): self @@ -236,7 +292,7 @@ public function withSource(Source|array $source): self } /** - * Groups matching normalized headlines published on the same UTC day. + * Shared by articles covering the same story on the same day. Use it to group or collapse syndicated copies of one announcement across outlets. */ public function withStoryID(string $storyID): self { @@ -246,6 +302,9 @@ public function withStoryID(string $storyID): self return $self; } + /** + * Article headline. + */ public function withTitle(string $title): self { $self = clone $this; @@ -255,6 +314,8 @@ public function withTitle(string $title): self } /** + * Kind of coverage. Use it to separate independent reporting (editorial) from company-issued content (press_release, regulatory_filing, advisory). + * * @param Type|value-of $type */ public function withType(Type|string $type): self @@ -265,6 +326,9 @@ public function withType(Type|string $type): self return $self; } + /** + * Link to the article on the publisher site. + */ public function withURL(string $url): self { $self = clone $this; diff --git a/src/News/NewsSearchResponse/Data/Match_.php b/src/News/NewsSearchResponse/Data/Match_.php index c046da1..5d2a07f 100644 --- a/src/News/NewsSearchResponse/Data/Match_.php +++ b/src/News/NewsSearchResponse/Data/Match_.php @@ -10,6 +10,8 @@ use ContextDev\News\NewsSearchResponse\Data\Match_\Level; /** + * How the article relates to the company you searched for. + * * @phpstan-type MatchShape = array{ * confidence: float|null, level: Level|value-of * } @@ -19,10 +21,17 @@ final class Match_ implements BaseModel /** @use SdkModel */ use SdkModel; + /** + * How confident the match is, from 0 to 1. Null when a score is unavailable. + */ #[Required] public ?float $confidence; - /** @var value-of $level */ + /** + * primary when the article is mainly about the company, secondary when the company is mentioned but is not the main subject. + * + * @var value-of $level + */ #[Required(enum: Level::class)] public string $level; @@ -62,6 +71,9 @@ public static function with(?float $confidence, Level|string $level): self return $self; } + /** + * How confident the match is, from 0 to 1. Null when a score is unavailable. + */ public function withConfidence(?float $confidence): self { $self = clone $this; @@ -71,6 +83,8 @@ public function withConfidence(?float $confidence): self } /** + * primary when the article is mainly about the company, secondary when the company is mentioned but is not the main subject. + * * @param Level|value-of $level */ public function withLevel(Level|string $level): self diff --git a/src/News/NewsSearchResponse/Data/Match_/Level.php b/src/News/NewsSearchResponse/Data/Match_/Level.php index 9f11b38..08be938 100644 --- a/src/News/NewsSearchResponse/Data/Match_/Level.php +++ b/src/News/NewsSearchResponse/Data/Match_/Level.php @@ -4,6 +4,9 @@ namespace ContextDev\News\NewsSearchResponse\Data\Match_; +/** + * primary when the article is mainly about the company, secondary when the company is mentioned but is not the main subject. + */ enum Level: string { case PRIMARY = 'primary'; diff --git a/src/News/NewsSearchResponse/Data/Source.php b/src/News/NewsSearchResponse/Data/Source.php index 27b0bc8..76a1822 100644 --- a/src/News/NewsSearchResponse/Data/Source.php +++ b/src/News/NewsSearchResponse/Data/Source.php @@ -9,6 +9,8 @@ use ContextDev\Core\Contracts\BaseModel; /** + * The publication that published the article. + * * @phpstan-type SourceShape = array{direct: bool, domain: string, name: string} */ final class Source implements BaseModel @@ -22,9 +24,15 @@ final class Source implements BaseModel #[Required] public bool $direct; + /** + * Website domain of the publication. + */ #[Required] public string $domain; + /** + * Name of the publication, such as Reuters. + */ #[Required] public string $name; @@ -77,6 +85,9 @@ public function withDirect(bool $direct): self return $self; } + /** + * Website domain of the publication. + */ public function withDomain(string $domain): self { $self = clone $this; @@ -85,6 +96,9 @@ public function withDomain(string $domain): self return $self; } + /** + * Name of the publication, such as Reuters. + */ public function withName(string $name): self { $self = clone $this; diff --git a/src/News/NewsSearchResponse/Data/Type.php b/src/News/NewsSearchResponse/Data/Type.php index 42d802a..a3cb9fc 100644 --- a/src/News/NewsSearchResponse/Data/Type.php +++ b/src/News/NewsSearchResponse/Data/Type.php @@ -4,6 +4,9 @@ namespace ContextDev\News\NewsSearchResponse\Data; +/** + * Kind of coverage. Use it to separate independent reporting (editorial) from company-issued content (press_release, regulatory_filing, advisory). + */ enum Type: string { case EDITORIAL = 'editorial'; diff --git a/src/News/NewsSearchResponse/Meta.php b/src/News/NewsSearchResponse/Meta.php index e188ea2..8e0909a 100644 --- a/src/News/NewsSearchResponse/Meta.php +++ b/src/News/NewsSearchResponse/Meta.php @@ -9,6 +9,8 @@ use ContextDev\Core\Contracts\BaseModel; /** + * Summary information about this response. + * * @phpstan-type MetaShape = array{count: int} */ final class Meta implements BaseModel @@ -16,6 +18,9 @@ final class Meta implements BaseModel /** @use SdkModel */ use SdkModel; + /** + * Number of articles in this page. + */ #[Required] public int $count; @@ -52,6 +57,9 @@ public static function with(int $count): self return $self; } + /** + * Number of articles in this page. + */ public function withCount(int $count): self { $self = clone $this; diff --git a/src/ServiceContracts/WebContract.php b/src/ServiceContracts/WebContract.php index 06b1654..ddf3b08 100644 --- a/src/ServiceContracts/WebContract.php +++ b/src/ServiceContracts/WebContract.php @@ -150,6 +150,7 @@ public function extractStyleguide( /** * @api * + * @param bool $clearPopups Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or not provided, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently. * @param \ContextDev\Web\WebScreenshotParams\ColorScheme|value-of<\ContextDev\Web\WebScreenshotParams\ColorScheme> $colorScheme Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances. * @param Country|value-of $country fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2) * @param string $directURL A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both. @@ -169,6 +170,7 @@ public function extractStyleguide( * @throws APIException */ public function screenshot( + bool $clearPopups = false, \ContextDev\Web\WebScreenshotParams\ColorScheme|string|null $colorScheme = null, Country|string|null $country = null, ?string $directURL = null, diff --git a/src/Services/WebRawService.php b/src/Services/WebRawService.php index 953cac3..12cb21d 100644 --- a/src/Services/WebRawService.php +++ b/src/Services/WebRawService.php @@ -231,6 +231,7 @@ public function extractStyleguide( * Capture a screenshot of a website. * * @param array{ + * clearPopups?: bool, * colorScheme?: WebScreenshotParams\ColorScheme|value-of, * country?: value-of, * directURL?: string, diff --git a/src/Services/WebService.php b/src/Services/WebService.php index acf43ad..e4a4019 100644 --- a/src/Services/WebService.php +++ b/src/Services/WebService.php @@ -246,6 +246,7 @@ public function extractStyleguide( * * Capture a screenshot of a website. * + * @param bool $clearPopups Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or not provided, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently. * @param \ContextDev\Web\WebScreenshotParams\ColorScheme|value-of<\ContextDev\Web\WebScreenshotParams\ColorScheme> $colorScheme Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances. * @param Country|value-of $country fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2) * @param string $directURL A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both. @@ -265,6 +266,7 @@ public function extractStyleguide( * @throws APIException */ public function screenshot( + bool $clearPopups = false, \ContextDev\Web\WebScreenshotParams\ColorScheme|string|null $colorScheme = null, Country|string|null $country = null, ?string $directURL = null, @@ -283,6 +285,7 @@ public function screenshot( ): WebScreenshotResponse { $params = Util::removeNulls( [ + 'clearPopups' => $clearPopups, 'colorScheme' => $colorScheme, 'country' => $country, 'directURL' => $directURL, diff --git a/src/Version.php b/src/Version.php index 220673a..41b0b98 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace ContextDev; // x-release-please-start-version -const VERSION = '2.10.0'; +const VERSION = '2.11.0'; // x-release-please-end diff --git a/src/Web/WebScreenshotParams.php b/src/Web/WebScreenshotParams.php index 0b40e88..43e8346 100644 --- a/src/Web/WebScreenshotParams.php +++ b/src/Web/WebScreenshotParams.php @@ -23,6 +23,7 @@ * @phpstan-import-type ViewportShape from \ContextDev\Web\WebScreenshotParams\Viewport * * @phpstan-type WebScreenshotParamsShape = array{ + * clearPopups?: bool|null, * colorScheme?: null|ColorScheme|value-of, * country?: null|Country|value-of, * directURL?: string|null, @@ -45,6 +46,12 @@ final class WebScreenshotParams implements BaseModel use SdkModel; use SdkParams; + /** + * Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or not provided, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently. + */ + #[Optional] + public ?bool $clearPopups; + /** * Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances. * @@ -160,6 +167,7 @@ public function __construct() * @param Zdr|value-of|null $zdr */ public static function with( + ?bool $clearPopups = null, ColorScheme|string|null $colorScheme = null, Country|string|null $country = null, ?string $directURL = null, @@ -177,6 +185,7 @@ public static function with( ): self { $self = new self; + null !== $clearPopups && $self['clearPopups'] = $clearPopups; null !== $colorScheme && $self['colorScheme'] = $colorScheme; null !== $country && $self['country'] = $country; null !== $directURL && $self['directURL'] = $directURL; @@ -195,6 +204,17 @@ public static function with( return $self; } + /** + * Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or not provided, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently. + */ + public function withClearPopups(bool $clearPopups): self + { + $self = clone $this; + $self['clearPopups'] = $clearPopups; + + return $self; + } + /** * Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances. *