Skip to content

Commit 52d02b0

Browse files
authored
Merge pull request #6 from context-dot-dev/release-please--branches--main--changes--next
release: 1.2.0
2 parents 0734a7e + 67d0e7a commit 52d02b0

9 files changed

Lines changed: 39 additions & 5 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.1.0"
2+
".": "1.2.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 25
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2460611c25145e2ca049b14c32be0f9ac9f4ded0b95154d29a83b4a6c1453f3e.yml
3-
openapi_spec_hash: ab3a6473e575381cacd245bf54dcf0f7
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-4903d5902cec6a80f42b9adaa9cf0defa9805ff22d7ae96970d209a4f867e195.yml
3+
openapi_spec_hash: 1097891c23530dfe0155f23170daf973
44
config_hash: c7b0cdaba3b9797b77efd89e1754d803

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.2.0 (2026-06-25)
4+
5+
Full Changelog: [v1.1.0...v1.2.0](https://github.com/context-dot-dev/context-php-sdk/compare/v1.1.0...v1.2.0)
6+
7+
### Features
8+
9+
* **api:** api update ([e984607](https://github.com/context-dot-dev/context-php-sdk/commit/e984607de54b77c8cd7991636bc1c5d95ca42e1e))
10+
311
## 1.1.0 (2026-06-22)
412

513
Full Changelog: [v1.0.0...v1.1.0](https://github.com/context-dot-dev/context-php-sdk/compare/v1.0.0...v1.1.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The REST API documentation can be found on [docs.context.dev](https://docs.conte
1313
<!-- x-release-please-start-version -->
1414

1515
```
16-
composer require "context-dev/context-dev-php 1.1.0"
16+
composer require "context-dev/context-dev-php 1.2.0"
1717
```
1818

1919
<!-- x-release-please-end -->

src/ServiceContracts/WebContract.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public function extractStyleguide(
139139
* @param HandleCookiePopup|value-of<HandleCookiePopup> $handleCookiePopup Optional parameter to control cookie/consent popup handling. If 'true', we dismiss cookie banner before capture. If 'false' or not provided, captures the page without that step.
140140
* @param int $maxAgeMs Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
141141
* @param Page|value-of<Page> $page Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'.
142+
* @param int $scrollOffset Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.
142143
* @param int $timeoutMs 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 value is 300000ms (5 minutes).
143144
* @param Viewport|ViewportShape $viewport Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
144145
* @param int $waitForMs Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted.
@@ -153,6 +154,7 @@ public function screenshot(
153154
HandleCookiePopup|string $handleCookiePopup = 'false',
154155
int $maxAgeMs = 86400000,
155156
Page|string|null $page = null,
157+
?int $scrollOffset = null,
156158
?int $timeoutMs = null,
157159
Viewport|array $viewport = ['width' => 1920, 'height' => 1080],
158160
int $waitForMs = 3000,

src/Services/WebRawService.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ public function extractStyleguide(
221221
* handleCookiePopup?: HandleCookiePopup|value-of<HandleCookiePopup>,
222222
* maxAgeMs?: int,
223223
* page?: Page|value-of<Page>,
224+
* scrollOffset?: int,
224225
* timeoutMs?: int,
225226
* viewport?: Viewport|ViewportShape,
226227
* waitForMs?: int,

src/Services/WebService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ public function extractStyleguide(
229229
* @param HandleCookiePopup|value-of<HandleCookiePopup> $handleCookiePopup Optional parameter to control cookie/consent popup handling. If 'true', we dismiss cookie banner before capture. If 'false' or not provided, captures the page without that step.
230230
* @param int $maxAgeMs Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
231231
* @param Page|value-of<Page> $page Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'.
232+
* @param int $scrollOffset Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.
232233
* @param int $timeoutMs 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 value is 300000ms (5 minutes).
233234
* @param Viewport|ViewportShape $viewport Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
234235
* @param int $waitForMs Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted.
@@ -243,6 +244,7 @@ public function screenshot(
243244
HandleCookiePopup|string $handleCookiePopup = 'false',
244245
int $maxAgeMs = 86400000,
245246
Page|string|null $page = null,
247+
?int $scrollOffset = null,
246248
?int $timeoutMs = null,
247249
Viewport|array $viewport = ['width' => 1920, 'height' => 1080],
248250
int $waitForMs = 3000,
@@ -256,6 +258,7 @@ public function screenshot(
256258
'handleCookiePopup' => $handleCookiePopup,
257259
'maxAgeMs' => $maxAgeMs,
258260
'page' => $page,
261+
'scrollOffset' => $scrollOffset,
259262
'timeoutMs' => $timeoutMs,
260263
'viewport' => $viewport,
261264
'waitForMs' => $waitForMs,

src/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
namespace ContextDev;
66

77
// x-release-please-start-version
8-
const VERSION = '1.1.0';
8+
const VERSION = '1.2.0';
99
// x-release-please-end

src/Web/WebScreenshotParams.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* handleCookiePopup?: null|HandleCookiePopup|value-of<HandleCookiePopup>,
2828
* maxAgeMs?: int|null,
2929
* page?: null|Page|value-of<Page>,
30+
* scrollOffset?: int|null,
3031
* timeoutMs?: int|null,
3132
* viewport?: null|Viewport|ViewportShape,
3233
* waitForMs?: int|null,
@@ -80,6 +81,12 @@ final class WebScreenshotParams implements BaseModel
8081
#[Optional(enum: Page::class)]
8182
public ?string $page;
8283

84+
/**
85+
* Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.
86+
*/
87+
#[Optional]
88+
public ?int $scrollOffset;
89+
8390
/**
8491
* 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 value is 300000ms (5 minutes).
8592
*/
@@ -120,6 +127,7 @@ public static function with(
120127
HandleCookiePopup|string|null $handleCookiePopup = null,
121128
?int $maxAgeMs = null,
122129
Page|string|null $page = null,
130+
?int $scrollOffset = null,
123131
?int $timeoutMs = null,
124132
Viewport|array|null $viewport = null,
125133
?int $waitForMs = null,
@@ -132,6 +140,7 @@ public static function with(
132140
null !== $handleCookiePopup && $self['handleCookiePopup'] = $handleCookiePopup;
133141
null !== $maxAgeMs && $self['maxAgeMs'] = $maxAgeMs;
134142
null !== $page && $self['page'] = $page;
143+
null !== $scrollOffset && $self['scrollOffset'] = $scrollOffset;
135144
null !== $timeoutMs && $self['timeoutMs'] = $timeoutMs;
136145
null !== $viewport && $self['viewport'] = $viewport;
137146
null !== $waitForMs && $self['waitForMs'] = $waitForMs;
@@ -213,6 +222,17 @@ public function withPage(Page|string $page): self
213222
return $self;
214223
}
215224

225+
/**
226+
* Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.
227+
*/
228+
public function withScrollOffset(int $scrollOffset): self
229+
{
230+
$self = clone $this;
231+
$self['scrollOffset'] = $scrollOffset;
232+
233+
return $self;
234+
}
235+
216236
/**
217237
* 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 value is 300000ms (5 minutes).
218238
*/

0 commit comments

Comments
 (0)