Skip to content

Commit e4387a5

Browse files
feat(api): api update
1 parent c4da3b6 commit e4387a5

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎.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

‎pkg/cmd/web.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ var webScreenshot = requestflag.WithInnerFlags(cli.Command{
241241
Usage: "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'.",
242242
QueryPath: "page",
243243
},
244+
&requestflag.Flag[int64]{
245+
Name: "scroll-offset",
246+
Usage: "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.",
247+
QueryPath: "scrollOffset",
248+
},
244249
&requestflag.Flag[int64]{
245250
Name: "timeout-ms",
246251
Usage: "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).",

‎pkg/cmd/web_test.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ func TestWebScreenshot(t *testing.T) {
147147
"--handle-cookie-popup", "true",
148148
"--max-age-ms", "0",
149149
"--page", "login",
150+
"--scroll-offset", "0",
150151
"--timeout-ms", "1000",
151152
"--viewport", "{height: 240, width: 240}",
152153
"--wait-for-ms", "0",
@@ -168,6 +169,7 @@ func TestWebScreenshot(t *testing.T) {
168169
"--handle-cookie-popup", "true",
169170
"--max-age-ms", "0",
170171
"--page", "login",
172+
"--scroll-offset", "0",
171173
"--timeout-ms", "1000",
172174
"--viewport.height", "240",
173175
"--viewport.width", "240",

0 commit comments

Comments
 (0)