context.dev 1.15.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/context_dev/models/web_screenshot_params.rb +40 -1
- data/lib/context_dev/models/web_screenshot_response.rb +17 -1
- data/lib/context_dev/resources/web.rb +10 -2
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/web_screenshot_params.rbi +68 -0
- data/rbi/context_dev/models/web_screenshot_response.rbi +25 -3
- data/rbi/context_dev/resources/web.rbi +8 -0
- data/sig/context_dev/models/web_screenshot_params.rbs +33 -1
- data/sig/context_dev/models/web_screenshot_response.rbs +17 -3
- data/sig/context_dev/resources/web.rbs +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ba57da748751f653f87b57407326a40a8af9b31dc9c10364c61e536a7eb57a6
|
|
4
|
+
data.tar.gz: b10761a87783d8544bae6dd0bad6c3f3275af2fd2c39e734e61709d89de8cd9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53f3f7978e24bcac14e388d76f2ba02b1410354b536264a14074306ce6464725d5741ebf6d59b1d280eeb8b2babc1980c35397c45175213645d38fdbcd89a5c5
|
|
7
|
+
data.tar.gz: 4d9aa2a1af255cd2352c613bfd3fbbef1532d9ab6eb396d8e9e33d1a41f7b4eabd3601c6406a68d3688a338b1f588f3cf76bc7d17b8966ddff0b358dd1cc6d72
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.16.0 (2026-05-07)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.15.0...v1.16.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.15.0...v1.16.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([f0b1f3a](https://github.com/context-dot-dev/context-ruby-sdk/commit/f0b1f3afd885c44cb464393b57d944fa27a6c0b5))
|
|
10
|
+
|
|
3
11
|
## 1.15.0 (2026-05-06)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v1.14.0...v1.15.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.14.0...v1.15.0)
|
data/README.md
CHANGED
|
@@ -31,6 +31,14 @@ module ContextDev
|
|
|
31
31
|
# @return [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot, nil]
|
|
32
32
|
optional :full_screenshot, enum: -> { ContextDev::WebScreenshotParams::FullScreenshot }
|
|
33
33
|
|
|
34
|
+
# @!attribute max_age_ms
|
|
35
|
+
# Return a cached screenshot if a prior screenshot for the same parameters exists
|
|
36
|
+
# and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
37
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
|
|
38
|
+
#
|
|
39
|
+
# @return [Integer, nil]
|
|
40
|
+
optional :max_age_ms, Integer
|
|
41
|
+
|
|
34
42
|
# @!attribute page
|
|
35
43
|
# Optional parameter to specify which page type to screenshot. If provided, the
|
|
36
44
|
# system will scrape the domain's links and use heuristics to find the most
|
|
@@ -49,7 +57,13 @@ module ContextDev
|
|
|
49
57
|
# @return [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize, nil]
|
|
50
58
|
optional :prioritize, enum: -> { ContextDev::WebScreenshotParams::Prioritize }
|
|
51
59
|
|
|
52
|
-
# @!
|
|
60
|
+
# @!attribute viewport
|
|
61
|
+
# Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
62
|
+
#
|
|
63
|
+
# @return [ContextDev::Models::WebScreenshotParams::Viewport, nil]
|
|
64
|
+
optional :viewport, -> { ContextDev::WebScreenshotParams::Viewport }
|
|
65
|
+
|
|
66
|
+
# @!method initialize(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, prioritize: nil, viewport: nil, request_options: {})
|
|
53
67
|
# Some parameter documentations has been truncated, see
|
|
54
68
|
# {ContextDev::Models::WebScreenshotParams} for more details.
|
|
55
69
|
#
|
|
@@ -59,10 +73,14 @@ module ContextDev
|
|
|
59
73
|
#
|
|
60
74
|
# @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc
|
|
61
75
|
#
|
|
76
|
+
# @param max_age_ms [Integer] Return a cached screenshot if a prior screenshot for the same parameters exists
|
|
77
|
+
#
|
|
62
78
|
# @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy
|
|
63
79
|
#
|
|
64
80
|
# @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f
|
|
65
81
|
#
|
|
82
|
+
# @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
83
|
+
#
|
|
66
84
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
|
|
67
85
|
|
|
68
86
|
# Optional parameter to determine screenshot type. If 'true', takes a full page
|
|
@@ -111,6 +129,27 @@ module ContextDev
|
|
|
111
129
|
# @!method self.values
|
|
112
130
|
# @return [Array<Symbol>]
|
|
113
131
|
end
|
|
132
|
+
|
|
133
|
+
class Viewport < ContextDev::Internal::Type::BaseModel
|
|
134
|
+
# @!attribute height
|
|
135
|
+
# Viewport height in pixels.
|
|
136
|
+
#
|
|
137
|
+
# @return [Integer, nil]
|
|
138
|
+
optional :height, Integer
|
|
139
|
+
|
|
140
|
+
# @!attribute width
|
|
141
|
+
# Viewport width in pixels.
|
|
142
|
+
#
|
|
143
|
+
# @return [Integer, nil]
|
|
144
|
+
optional :width, Integer
|
|
145
|
+
|
|
146
|
+
# @!method initialize(height: nil, width: nil)
|
|
147
|
+
# Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
148
|
+
#
|
|
149
|
+
# @param height [Integer] Viewport height in pixels.
|
|
150
|
+
#
|
|
151
|
+
# @param width [Integer] Viewport width in pixels.
|
|
152
|
+
end
|
|
114
153
|
end
|
|
115
154
|
end
|
|
116
155
|
end
|
|
@@ -16,6 +16,12 @@ module ContextDev
|
|
|
16
16
|
# @return [String, nil]
|
|
17
17
|
optional :domain, String
|
|
18
18
|
|
|
19
|
+
# @!attribute height
|
|
20
|
+
# Height in pixels of the returned screenshot image
|
|
21
|
+
#
|
|
22
|
+
# @return [Integer, nil]
|
|
23
|
+
optional :height, Integer
|
|
24
|
+
|
|
19
25
|
# @!attribute screenshot
|
|
20
26
|
# Public URL of the uploaded screenshot image
|
|
21
27
|
#
|
|
@@ -36,16 +42,26 @@ module ContextDev
|
|
|
36
42
|
# @return [String, nil]
|
|
37
43
|
optional :status, String
|
|
38
44
|
|
|
39
|
-
# @!
|
|
45
|
+
# @!attribute width
|
|
46
|
+
# Width in pixels of the returned screenshot image
|
|
47
|
+
#
|
|
48
|
+
# @return [Integer, nil]
|
|
49
|
+
optional :width, Integer
|
|
50
|
+
|
|
51
|
+
# @!method initialize(code: nil, domain: nil, height: nil, screenshot: nil, screenshot_type: nil, status: nil, width: nil)
|
|
40
52
|
# @param code [Integer] HTTP status code
|
|
41
53
|
#
|
|
42
54
|
# @param domain [String] The normalized domain that was processed
|
|
43
55
|
#
|
|
56
|
+
# @param height [Integer] Height in pixels of the returned screenshot image
|
|
57
|
+
#
|
|
44
58
|
# @param screenshot [String] Public URL of the uploaded screenshot image
|
|
45
59
|
#
|
|
46
60
|
# @param screenshot_type [Symbol, ContextDev::Models::WebScreenshotResponse::ScreenshotType] Type of screenshot that was captured
|
|
47
61
|
#
|
|
48
62
|
# @param status [String] Status of the response, e.g., 'ok'
|
|
63
|
+
#
|
|
64
|
+
# @param width [Integer] Width in pixels of the returned screenshot image
|
|
49
65
|
|
|
50
66
|
# Type of screenshot that was captured
|
|
51
67
|
#
|
|
@@ -70,7 +70,7 @@ module ContextDev
|
|
|
70
70
|
#
|
|
71
71
|
# Capture a screenshot of a website.
|
|
72
72
|
#
|
|
73
|
-
# @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, page: nil, prioritize: nil, request_options: {})
|
|
73
|
+
# @overload screenshot(direct_url: nil, domain: nil, full_screenshot: nil, max_age_ms: nil, page: nil, prioritize: nil, viewport: nil, request_options: {})
|
|
74
74
|
#
|
|
75
75
|
# @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https
|
|
76
76
|
#
|
|
@@ -78,10 +78,14 @@ module ContextDev
|
|
|
78
78
|
#
|
|
79
79
|
# @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc
|
|
80
80
|
#
|
|
81
|
+
# @param max_age_ms [Integer] Return a cached screenshot if a prior screenshot for the same parameters exists
|
|
82
|
+
#
|
|
81
83
|
# @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy
|
|
82
84
|
#
|
|
83
85
|
# @param prioritize [Symbol, ContextDev::Models::WebScreenshotParams::Prioritize] Optional parameter to prioritize screenshot capture. If 'speed', optimizes for f
|
|
84
86
|
#
|
|
87
|
+
# @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
88
|
+
#
|
|
85
89
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
86
90
|
#
|
|
87
91
|
# @return [ContextDev::Models::WebScreenshotResponse]
|
|
@@ -93,7 +97,11 @@ module ContextDev
|
|
|
93
97
|
@client.request(
|
|
94
98
|
method: :get,
|
|
95
99
|
path: "web/screenshot",
|
|
96
|
-
query: query.transform_keys(
|
|
100
|
+
query: query.transform_keys(
|
|
101
|
+
direct_url: "directUrl",
|
|
102
|
+
full_screenshot: "fullScreenshot",
|
|
103
|
+
max_age_ms: "maxAgeMs"
|
|
104
|
+
),
|
|
97
105
|
model: ContextDev::Models::WebScreenshotResponse,
|
|
98
106
|
options: options
|
|
99
107
|
)
|
data/lib/context_dev/version.rb
CHANGED
|
@@ -47,6 +47,15 @@ module ContextDev
|
|
|
47
47
|
end
|
|
48
48
|
attr_writer :full_screenshot
|
|
49
49
|
|
|
50
|
+
# Return a cached screenshot if a prior screenshot for the same parameters exists
|
|
51
|
+
# and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
52
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
|
|
53
|
+
sig { returns(T.nilable(Integer)) }
|
|
54
|
+
attr_reader :max_age_ms
|
|
55
|
+
|
|
56
|
+
sig { params(max_age_ms: Integer).void }
|
|
57
|
+
attr_writer :max_age_ms
|
|
58
|
+
|
|
50
59
|
# Optional parameter to specify which page type to screenshot. If provided, the
|
|
51
60
|
# system will scrape the domain's links and use heuristics to find the most
|
|
52
61
|
# appropriate URL for the specified page type (30 supported languages). If not
|
|
@@ -77,14 +86,25 @@ module ContextDev
|
|
|
77
86
|
end
|
|
78
87
|
attr_writer :prioritize
|
|
79
88
|
|
|
89
|
+
# Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
90
|
+
sig { returns(T.nilable(ContextDev::WebScreenshotParams::Viewport)) }
|
|
91
|
+
attr_reader :viewport
|
|
92
|
+
|
|
93
|
+
sig do
|
|
94
|
+
params(viewport: ContextDev::WebScreenshotParams::Viewport::OrHash).void
|
|
95
|
+
end
|
|
96
|
+
attr_writer :viewport
|
|
97
|
+
|
|
80
98
|
sig do
|
|
81
99
|
params(
|
|
82
100
|
direct_url: String,
|
|
83
101
|
domain: String,
|
|
84
102
|
full_screenshot:
|
|
85
103
|
ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol,
|
|
104
|
+
max_age_ms: Integer,
|
|
86
105
|
page: ContextDev::WebScreenshotParams::Page::OrSymbol,
|
|
87
106
|
prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol,
|
|
107
|
+
viewport: ContextDev::WebScreenshotParams::Viewport::OrHash,
|
|
88
108
|
request_options: ContextDev::RequestOptions::OrHash
|
|
89
109
|
).returns(T.attached_class)
|
|
90
110
|
end
|
|
@@ -101,6 +121,10 @@ module ContextDev
|
|
|
101
121
|
# screenshot capturing all content. If 'false' or not provided, takes a viewport
|
|
102
122
|
# screenshot (standard browser view).
|
|
103
123
|
full_screenshot: nil,
|
|
124
|
+
# Return a cached screenshot if a prior screenshot for the same parameters exists
|
|
125
|
+
# and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
126
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
|
|
127
|
+
max_age_ms: nil,
|
|
104
128
|
# Optional parameter to specify which page type to screenshot. If provided, the
|
|
105
129
|
# system will scrape the domain's links and use heuristics to find the most
|
|
106
130
|
# appropriate URL for the specified page type (30 supported languages). If not
|
|
@@ -111,6 +135,8 @@ module ContextDev
|
|
|
111
135
|
# faster capture with basic quality. If 'quality', optimizes for higher quality
|
|
112
136
|
# with longer wait times. Defaults to 'quality' if not provided.
|
|
113
137
|
prioritize: nil,
|
|
138
|
+
# Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
139
|
+
viewport: nil,
|
|
114
140
|
request_options: {}
|
|
115
141
|
)
|
|
116
142
|
end
|
|
@@ -122,8 +148,10 @@ module ContextDev
|
|
|
122
148
|
domain: String,
|
|
123
149
|
full_screenshot:
|
|
124
150
|
ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol,
|
|
151
|
+
max_age_ms: Integer,
|
|
125
152
|
page: ContextDev::WebScreenshotParams::Page::OrSymbol,
|
|
126
153
|
prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol,
|
|
154
|
+
viewport: ContextDev::WebScreenshotParams::Viewport,
|
|
127
155
|
request_options: ContextDev::RequestOptions
|
|
128
156
|
}
|
|
129
157
|
)
|
|
@@ -233,6 +261,46 @@ module ContextDev
|
|
|
233
261
|
def self.values
|
|
234
262
|
end
|
|
235
263
|
end
|
|
264
|
+
|
|
265
|
+
class Viewport < ContextDev::Internal::Type::BaseModel
|
|
266
|
+
OrHash =
|
|
267
|
+
T.type_alias do
|
|
268
|
+
T.any(
|
|
269
|
+
ContextDev::WebScreenshotParams::Viewport,
|
|
270
|
+
ContextDev::Internal::AnyHash
|
|
271
|
+
)
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Viewport height in pixels.
|
|
275
|
+
sig { returns(T.nilable(Integer)) }
|
|
276
|
+
attr_reader :height
|
|
277
|
+
|
|
278
|
+
sig { params(height: Integer).void }
|
|
279
|
+
attr_writer :height
|
|
280
|
+
|
|
281
|
+
# Viewport width in pixels.
|
|
282
|
+
sig { returns(T.nilable(Integer)) }
|
|
283
|
+
attr_reader :width
|
|
284
|
+
|
|
285
|
+
sig { params(width: Integer).void }
|
|
286
|
+
attr_writer :width
|
|
287
|
+
|
|
288
|
+
# Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
289
|
+
sig do
|
|
290
|
+
params(height: Integer, width: Integer).returns(T.attached_class)
|
|
291
|
+
end
|
|
292
|
+
def self.new(
|
|
293
|
+
# Viewport height in pixels.
|
|
294
|
+
height: nil,
|
|
295
|
+
# Viewport width in pixels.
|
|
296
|
+
width: nil
|
|
297
|
+
)
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
sig { override.returns({ height: Integer, width: Integer }) }
|
|
301
|
+
def to_hash
|
|
302
|
+
end
|
|
303
|
+
end
|
|
236
304
|
end
|
|
237
305
|
end
|
|
238
306
|
end
|
|
@@ -25,6 +25,13 @@ module ContextDev
|
|
|
25
25
|
sig { params(domain: String).void }
|
|
26
26
|
attr_writer :domain
|
|
27
27
|
|
|
28
|
+
# Height in pixels of the returned screenshot image
|
|
29
|
+
sig { returns(T.nilable(Integer)) }
|
|
30
|
+
attr_reader :height
|
|
31
|
+
|
|
32
|
+
sig { params(height: Integer).void }
|
|
33
|
+
attr_writer :height
|
|
34
|
+
|
|
28
35
|
# Public URL of the uploaded screenshot image
|
|
29
36
|
sig { returns(T.nilable(String)) }
|
|
30
37
|
attr_reader :screenshot
|
|
@@ -57,14 +64,23 @@ module ContextDev
|
|
|
57
64
|
sig { params(status: String).void }
|
|
58
65
|
attr_writer :status
|
|
59
66
|
|
|
67
|
+
# Width in pixels of the returned screenshot image
|
|
68
|
+
sig { returns(T.nilable(Integer)) }
|
|
69
|
+
attr_reader :width
|
|
70
|
+
|
|
71
|
+
sig { params(width: Integer).void }
|
|
72
|
+
attr_writer :width
|
|
73
|
+
|
|
60
74
|
sig do
|
|
61
75
|
params(
|
|
62
76
|
code: Integer,
|
|
63
77
|
domain: String,
|
|
78
|
+
height: Integer,
|
|
64
79
|
screenshot: String,
|
|
65
80
|
screenshot_type:
|
|
66
81
|
ContextDev::Models::WebScreenshotResponse::ScreenshotType::OrSymbol,
|
|
67
|
-
status: String
|
|
82
|
+
status: String,
|
|
83
|
+
width: Integer
|
|
68
84
|
).returns(T.attached_class)
|
|
69
85
|
end
|
|
70
86
|
def self.new(
|
|
@@ -72,12 +88,16 @@ module ContextDev
|
|
|
72
88
|
code: nil,
|
|
73
89
|
# The normalized domain that was processed
|
|
74
90
|
domain: nil,
|
|
91
|
+
# Height in pixels of the returned screenshot image
|
|
92
|
+
height: nil,
|
|
75
93
|
# Public URL of the uploaded screenshot image
|
|
76
94
|
screenshot: nil,
|
|
77
95
|
# Type of screenshot that was captured
|
|
78
96
|
screenshot_type: nil,
|
|
79
97
|
# Status of the response, e.g., 'ok'
|
|
80
|
-
status: nil
|
|
98
|
+
status: nil,
|
|
99
|
+
# Width in pixels of the returned screenshot image
|
|
100
|
+
width: nil
|
|
81
101
|
)
|
|
82
102
|
end
|
|
83
103
|
|
|
@@ -86,10 +106,12 @@ module ContextDev
|
|
|
86
106
|
{
|
|
87
107
|
code: Integer,
|
|
88
108
|
domain: String,
|
|
109
|
+
height: Integer,
|
|
89
110
|
screenshot: String,
|
|
90
111
|
screenshot_type:
|
|
91
112
|
ContextDev::Models::WebScreenshotResponse::ScreenshotType::TaggedSymbol,
|
|
92
|
-
status: String
|
|
113
|
+
status: String,
|
|
114
|
+
width: Integer
|
|
93
115
|
}
|
|
94
116
|
)
|
|
95
117
|
end
|
|
@@ -65,8 +65,10 @@ module ContextDev
|
|
|
65
65
|
domain: String,
|
|
66
66
|
full_screenshot:
|
|
67
67
|
ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol,
|
|
68
|
+
max_age_ms: Integer,
|
|
68
69
|
page: ContextDev::WebScreenshotParams::Page::OrSymbol,
|
|
69
70
|
prioritize: ContextDev::WebScreenshotParams::Prioritize::OrSymbol,
|
|
71
|
+
viewport: ContextDev::WebScreenshotParams::Viewport::OrHash,
|
|
70
72
|
request_options: ContextDev::RequestOptions::OrHash
|
|
71
73
|
).returns(ContextDev::Models::WebScreenshotResponse)
|
|
72
74
|
end
|
|
@@ -83,6 +85,10 @@ module ContextDev
|
|
|
83
85
|
# screenshot capturing all content. If 'false' or not provided, takes a viewport
|
|
84
86
|
# screenshot (standard browser view).
|
|
85
87
|
full_screenshot: nil,
|
|
88
|
+
# Return a cached screenshot if a prior screenshot for the same parameters exists
|
|
89
|
+
# and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
|
|
90
|
+
# omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
|
|
91
|
+
max_age_ms: nil,
|
|
86
92
|
# Optional parameter to specify which page type to screenshot. If provided, the
|
|
87
93
|
# system will scrape the domain's links and use heuristics to find the most
|
|
88
94
|
# appropriate URL for the specified page type (30 supported languages). If not
|
|
@@ -93,6 +99,8 @@ module ContextDev
|
|
|
93
99
|
# faster capture with basic quality. If 'quality', optimizes for higher quality
|
|
94
100
|
# with longer wait times. Defaults to 'quality' if not provided.
|
|
95
101
|
prioritize: nil,
|
|
102
|
+
# Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
|
|
103
|
+
viewport: nil,
|
|
96
104
|
request_options: {}
|
|
97
105
|
)
|
|
98
106
|
end
|
|
@@ -5,8 +5,10 @@ module ContextDev
|
|
|
5
5
|
direct_url: String,
|
|
6
6
|
domain: String,
|
|
7
7
|
full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot,
|
|
8
|
+
max_age_ms: Integer,
|
|
8
9
|
page: ContextDev::Models::WebScreenshotParams::page,
|
|
9
|
-
prioritize: ContextDev::Models::WebScreenshotParams::prioritize
|
|
10
|
+
prioritize: ContextDev::Models::WebScreenshotParams::prioritize,
|
|
11
|
+
viewport: ContextDev::WebScreenshotParams::Viewport
|
|
10
12
|
}
|
|
11
13
|
& ContextDev::Internal::Type::request_parameters
|
|
12
14
|
|
|
@@ -28,6 +30,10 @@ module ContextDev
|
|
|
28
30
|
ContextDev::Models::WebScreenshotParams::full_screenshot
|
|
29
31
|
) -> ContextDev::Models::WebScreenshotParams::full_screenshot
|
|
30
32
|
|
|
33
|
+
attr_reader max_age_ms: Integer?
|
|
34
|
+
|
|
35
|
+
def max_age_ms=: (Integer) -> Integer
|
|
36
|
+
|
|
31
37
|
attr_reader page: ContextDev::Models::WebScreenshotParams::page?
|
|
32
38
|
|
|
33
39
|
def page=: (
|
|
@@ -40,12 +46,20 @@ module ContextDev
|
|
|
40
46
|
ContextDev::Models::WebScreenshotParams::prioritize
|
|
41
47
|
) -> ContextDev::Models::WebScreenshotParams::prioritize
|
|
42
48
|
|
|
49
|
+
attr_reader viewport: ContextDev::WebScreenshotParams::Viewport?
|
|
50
|
+
|
|
51
|
+
def viewport=: (
|
|
52
|
+
ContextDev::WebScreenshotParams::Viewport
|
|
53
|
+
) -> ContextDev::WebScreenshotParams::Viewport
|
|
54
|
+
|
|
43
55
|
def initialize: (
|
|
44
56
|
?direct_url: String,
|
|
45
57
|
?domain: String,
|
|
46
58
|
?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot,
|
|
59
|
+
?max_age_ms: Integer,
|
|
47
60
|
?page: ContextDev::Models::WebScreenshotParams::page,
|
|
48
61
|
?prioritize: ContextDev::Models::WebScreenshotParams::prioritize,
|
|
62
|
+
?viewport: ContextDev::WebScreenshotParams::Viewport,
|
|
49
63
|
?request_options: ContextDev::request_opts
|
|
50
64
|
) -> void
|
|
51
65
|
|
|
@@ -53,8 +67,10 @@ module ContextDev
|
|
|
53
67
|
direct_url: String,
|
|
54
68
|
domain: String,
|
|
55
69
|
full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot,
|
|
70
|
+
max_age_ms: Integer,
|
|
56
71
|
page: ContextDev::Models::WebScreenshotParams::page,
|
|
57
72
|
prioritize: ContextDev::Models::WebScreenshotParams::prioritize,
|
|
73
|
+
viewport: ContextDev::WebScreenshotParams::Viewport,
|
|
58
74
|
request_options: ContextDev::RequestOptions
|
|
59
75
|
}
|
|
60
76
|
|
|
@@ -104,6 +120,22 @@ module ContextDev
|
|
|
104
120
|
|
|
105
121
|
def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::prioritize]
|
|
106
122
|
end
|
|
123
|
+
|
|
124
|
+
type viewport = { height: Integer, width: Integer }
|
|
125
|
+
|
|
126
|
+
class Viewport < ContextDev::Internal::Type::BaseModel
|
|
127
|
+
attr_reader height: Integer?
|
|
128
|
+
|
|
129
|
+
def height=: (Integer) -> Integer
|
|
130
|
+
|
|
131
|
+
attr_reader width: Integer?
|
|
132
|
+
|
|
133
|
+
def width=: (Integer) -> Integer
|
|
134
|
+
|
|
135
|
+
def initialize: (?height: Integer, ?width: Integer) -> void
|
|
136
|
+
|
|
137
|
+
def to_hash: -> { height: Integer, width: Integer }
|
|
138
|
+
end
|
|
107
139
|
end
|
|
108
140
|
end
|
|
109
141
|
end
|
|
@@ -4,9 +4,11 @@ module ContextDev
|
|
|
4
4
|
{
|
|
5
5
|
code: Integer,
|
|
6
6
|
domain: String,
|
|
7
|
+
height: Integer,
|
|
7
8
|
screenshot: String,
|
|
8
9
|
screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type,
|
|
9
|
-
status: String
|
|
10
|
+
status: String,
|
|
11
|
+
width: Integer
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel
|
|
@@ -18,6 +20,10 @@ module ContextDev
|
|
|
18
20
|
|
|
19
21
|
def domain=: (String) -> String
|
|
20
22
|
|
|
23
|
+
attr_reader height: Integer?
|
|
24
|
+
|
|
25
|
+
def height=: (Integer) -> Integer
|
|
26
|
+
|
|
21
27
|
attr_reader screenshot: String?
|
|
22
28
|
|
|
23
29
|
def screenshot=: (String) -> String
|
|
@@ -32,20 +38,28 @@ module ContextDev
|
|
|
32
38
|
|
|
33
39
|
def status=: (String) -> String
|
|
34
40
|
|
|
41
|
+
attr_reader width: Integer?
|
|
42
|
+
|
|
43
|
+
def width=: (Integer) -> Integer
|
|
44
|
+
|
|
35
45
|
def initialize: (
|
|
36
46
|
?code: Integer,
|
|
37
47
|
?domain: String,
|
|
48
|
+
?height: Integer,
|
|
38
49
|
?screenshot: String,
|
|
39
50
|
?screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type,
|
|
40
|
-
?status: String
|
|
51
|
+
?status: String,
|
|
52
|
+
?width: Integer
|
|
41
53
|
) -> void
|
|
42
54
|
|
|
43
55
|
def to_hash: -> {
|
|
44
56
|
code: Integer,
|
|
45
57
|
domain: String,
|
|
58
|
+
height: Integer,
|
|
46
59
|
screenshot: String,
|
|
47
60
|
screenshot_type: ContextDev::Models::WebScreenshotResponse::screenshot_type,
|
|
48
|
-
status: String
|
|
61
|
+
status: String,
|
|
62
|
+
width: Integer
|
|
49
63
|
}
|
|
50
64
|
|
|
51
65
|
type screenshot_type = :viewport | :fullPage
|
|
@@ -19,8 +19,10 @@ module ContextDev
|
|
|
19
19
|
?direct_url: String,
|
|
20
20
|
?domain: String,
|
|
21
21
|
?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot,
|
|
22
|
+
?max_age_ms: Integer,
|
|
22
23
|
?page: ContextDev::Models::WebScreenshotParams::page,
|
|
23
24
|
?prioritize: ContextDev::Models::WebScreenshotParams::prioritize,
|
|
25
|
+
?viewport: ContextDev::WebScreenshotParams::Viewport,
|
|
24
26
|
?request_options: ContextDev::request_opts
|
|
25
27
|
) -> ContextDev::Models::WebScreenshotResponse
|
|
26
28
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: context.dev
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.16.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Context Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|