context.dev 1.34.0 → 1.36.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd17c0a5c6f2ce8e8539a2173689b2013c87fbaba2cceedc66594c51d9289f2b
4
- data.tar.gz: 6db4666ba083805420a21d4d6bc9094df09fa3175e7773423e612442e34e2ae0
3
+ metadata.gz: b992b047fe68af144930573fcf7afe0e46201c7079c77c3b38b0c6700cd44caf
4
+ data.tar.gz: 98b70840e40a074cbef802cec9842d03883300d201b4a7d0fde34dcb13d8f9b7
5
5
  SHA512:
6
- metadata.gz: c191886c414c10297b0b53fb6f10317183db917af443628ec65b16edbca1067e4258f7e992f0e1b61afe27a85da4f69a88284a9911917c7b4e6c4b545b3ca591
7
- data.tar.gz: 3942beaa1e6fe0113a3ecf025531876a3b90fc0fb92658986062b0205b603cc7c1ac5900b1ee690b6b24f125e9555d7103deabe94e6c51da3d33801b3ee49004
6
+ metadata.gz: 50fe5fca39ab53e19c40eea5c6fce6e762272e42aebc77363fd08bc80a94977fddf3c00edf87eed28fce801af282276f78a4ae8fe542da01d34d174c8c320fda
7
+ data.tar.gz: 6378d2fce07dd46987a7d708a7d62a975f7fb3663e8c2716eb04f488ee1edab072575c930591719ce4549f810ab22794b41a5d42d19b38650e3c62e0634dc333
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.36.0 (2026-06-27)
4
+
5
+ Full Changelog: [v1.35.0...v1.36.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.35.0...v1.36.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([edf39d7](https://github.com/context-dot-dev/context-ruby-sdk/commit/edf39d75e9ca0a7b96ddac6467f9b50ceca0acf1))
10
+ * **api:** api update ([893f11d](https://github.com/context-dot-dev/context-ruby-sdk/commit/893f11d2746ccb636e971e12c24553043046cb11))
11
+ * **api:** api update ([59319b0](https://github.com/context-dot-dev/context-ruby-sdk/commit/59319b0421154c96a444f5e2d45b83e8f4bc9074))
12
+ * **api:** api update ([125ebe5](https://github.com/context-dot-dev/context-ruby-sdk/commit/125ebe5cb023b276c01bdc8c3cafbe8841dffddb))
13
+
14
+ ## 1.35.0 (2026-06-25)
15
+
16
+ Full Changelog: [v1.34.0...v1.35.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.34.0...v1.35.0)
17
+
18
+ ### Features
19
+
20
+ * **api:** api update ([26f4358](https://github.com/context-dot-dev/context-ruby-sdk/commit/26f43582d8d63b9ebd98f0ba04c64e93d61b185f))
21
+
3
22
  ## 1.34.0 (2026-06-19)
4
23
 
5
24
  Full Changelog: [v1.33.0...v1.34.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v1.33.0...v1.34.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "context.dev", "~> 1.34.0"
29
+ gem "context.dev", "~> 1.36.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -206,25 +206,25 @@ context_dev.brand.retrieve(**params)
206
206
  Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:
207
207
 
208
208
  ```ruby
209
- # :true
210
- puts(ContextDev::WebScreenshotParams::FullScreenshot::TRUE)
209
+ # :light
210
+ puts(ContextDev::WebExtractStyleguideParams::ColorScheme::LIGHT)
211
211
 
212
- # Revealed type: `T.all(ContextDev::WebScreenshotParams::FullScreenshot, Symbol)`
213
- T.reveal_type(ContextDev::WebScreenshotParams::FullScreenshot::TRUE)
212
+ # Revealed type: `T.all(ContextDev::WebExtractStyleguideParams::ColorScheme, Symbol)`
213
+ T.reveal_type(ContextDev::WebExtractStyleguideParams::ColorScheme::LIGHT)
214
214
  ```
215
215
 
216
216
  Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
217
217
 
218
218
  ```ruby
219
219
  # Using the enum constants preserves the tagged type information:
220
- context_dev.web.screenshot(
221
- full_screenshot: ContextDev::WebScreenshotParams::FullScreenshot::TRUE,
220
+ context_dev.web.extract_styleguide(
221
+ color_scheme: ContextDev::WebExtractStyleguideParams::ColorScheme::LIGHT,
222
222
  # …
223
223
  )
224
224
 
225
225
  # Literal values are also permissible:
226
- context_dev.web.screenshot(
227
- full_screenshot: :true,
226
+ context_dev.web.extract_styleguide(
227
+ color_scheme: :light,
228
228
  # …
229
229
  )
230
230
  ```
@@ -7,6 +7,13 @@ module ContextDev
7
7
  extend ContextDev::Internal::Type::RequestParameters::Converter
8
8
  include ContextDev::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute color_scheme
11
+ # Optional browser color scheme to emulate for websites that respond to
12
+ # prefers-color-scheme. This value is part of the styleguide cache key.
13
+ #
14
+ # @return [Symbol, ContextDev::Models::WebExtractStyleguideParams::ColorScheme, nil]
15
+ optional :color_scheme, enum: -> { ContextDev::WebExtractStyleguideParams::ColorScheme }
16
+
10
17
  # @!attribute direct_url
11
18
  # A specific URL to fetch the styleguide from directly, bypassing domain
12
19
  # resolution (e.g., 'https://example.com/design-system'). When provided, the
@@ -41,10 +48,12 @@ module ContextDev
41
48
  # @return [Integer, nil]
42
49
  optional :timeout_ms, Integer
43
50
 
44
- # @!method initialize(direct_url: nil, domain: nil, max_age_ms: nil, timeout_ms: nil, request_options: {})
51
+ # @!method initialize(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, timeout_ms: nil, request_options: {})
45
52
  # Some parameter documentations has been truncated, see
46
53
  # {ContextDev::Models::WebExtractStyleguideParams} for more details.
47
54
  #
55
+ # @param color_scheme [Symbol, ContextDev::Models::WebExtractStyleguideParams::ColorScheme] Optional browser color scheme to emulate for websites that respond to prefers-co
56
+ #
48
57
  # @param direct_url [String] A specific URL to fetch the styleguide from directly, bypassing domain resolutio
49
58
  #
50
59
  # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
@@ -54,6 +63,18 @@ module ContextDev
54
63
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
55
64
  #
56
65
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
66
+
67
+ # Optional browser color scheme to emulate for websites that respond to
68
+ # prefers-color-scheme. This value is part of the styleguide cache key.
69
+ module ColorScheme
70
+ extend ContextDev::Internal::Type::Enum
71
+
72
+ LIGHT = :light
73
+ DARK = :dark
74
+
75
+ # @!method self.values
76
+ # @return [Array<Symbol>]
77
+ end
57
78
  end
58
79
  end
59
80
  end
@@ -7,6 +7,20 @@ module ContextDev
7
7
  extend ContextDev::Internal::Type::RequestParameters::Converter
8
8
  include ContextDev::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute color_scheme
11
+ # Optional parameter to choose the site's visual theme in the screenshot. Use
12
+ # 'light' or 'dark' when the site offers both appearances.
13
+ #
14
+ # @return [Symbol, ContextDev::Models::WebScreenshotParams::ColorScheme, nil]
15
+ optional :color_scheme, enum: -> { ContextDev::WebScreenshotParams::ColorScheme }
16
+
17
+ # @!attribute country
18
+ # Two-letter ISO 3166-1 alpha-2 country code for the website request location.
19
+ # When provided, Context.dev fetches the target page from that country.
20
+ #
21
+ # @return [Symbol, ContextDev::Models::WebScreenshotParams::Country, nil]
22
+ optional :country, enum: -> { ContextDev::WebScreenshotParams::Country }
23
+
10
24
  # @!attribute direct_url
11
25
  # A specific URL to screenshot directly, bypassing domain resolution (e.g.,
12
26
  # 'https://example.com/pricing'). When provided, the screenshot is taken of this
@@ -57,6 +71,17 @@ module ContextDev
57
71
  # @return [Symbol, ContextDev::Models::WebScreenshotParams::Page, nil]
58
72
  optional :page, enum: -> { ContextDev::WebScreenshotParams::Page }
59
73
 
74
+ # @!attribute scroll_offset
75
+ # Optional vertical scroll offset in pixels for capturing a long page in
76
+ # viewport-sized chunks. When provided, the full page is captured once and the
77
+ # returned image is the viewport-sized slice that begins at this Y offset (e.g.
78
+ # request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page
79
+ # top to bottom). The final slice may be shorter than the viewport height. Takes
80
+ # precedence over fullScreenshot. Max: 100000.
81
+ #
82
+ # @return [Integer, nil]
83
+ optional :scroll_offset, Integer
84
+
60
85
  # @!attribute timeout_ms
61
86
  # Optional timeout in milliseconds for the request. If the request takes longer
62
87
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -79,10 +104,14 @@ module ContextDev
79
104
  # @return [Integer, nil]
80
105
  optional :wait_for_ms, Integer
81
106
 
82
- # @!method initialize(direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {})
107
+ # @!method initialize(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {})
83
108
  # Some parameter documentations has been truncated, see
84
109
  # {ContextDev::Models::WebScreenshotParams} for more details.
85
110
  #
111
+ # @param color_scheme [Symbol, ContextDev::Models::WebScreenshotParams::ColorScheme] Optional parameter to choose the site's visual theme in the screenshot. Use 'lig
112
+ #
113
+ # @param country [Symbol, ContextDev::Models::WebScreenshotParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe
114
+ #
86
115
  # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https
87
116
  #
88
117
  # @param domain [String] Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domai
@@ -95,6 +124,8 @@ module ContextDev
95
124
  #
96
125
  # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy
97
126
  #
127
+ # @param scroll_offset [Integer] Optional vertical scroll offset in pixels for capturing a long page in viewport-
128
+ #
98
129
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
99
130
  #
100
131
  # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
@@ -103,6 +134,232 @@ module ContextDev
103
134
  #
104
135
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
105
136
 
137
+ # Optional parameter to choose the site's visual theme in the screenshot. Use
138
+ # 'light' or 'dark' when the site offers both appearances.
139
+ module ColorScheme
140
+ extend ContextDev::Internal::Type::Enum
141
+
142
+ LIGHT = :light
143
+ DARK = :dark
144
+
145
+ # @!method self.values
146
+ # @return [Array<Symbol>]
147
+ end
148
+
149
+ # Two-letter ISO 3166-1 alpha-2 country code for the website request location.
150
+ # When provided, Context.dev fetches the target page from that country.
151
+ module Country
152
+ extend ContextDev::Internal::Type::Enum
153
+
154
+ AD = :ad
155
+ AE = :ae
156
+ AF = :af
157
+ AG = :ag
158
+ AI = :ai
159
+ AL = :al
160
+ AM = :am
161
+ AO = :ao
162
+ AR = :ar
163
+ AT = :at
164
+ AU = :au
165
+ AW = :aw
166
+ AZ = :az
167
+ BA = :ba
168
+ BB = :bb
169
+ BD = :bd
170
+ BE = :be
171
+ BF = :bf
172
+ BG = :bg
173
+ BH = :bh
174
+ BI = :bi
175
+ BJ = :bj
176
+ BM = :bm
177
+ BN = :bn
178
+ BO = :bo
179
+ BQ = :bq
180
+ BR = :br
181
+ BS = :bs
182
+ BW = :bw
183
+ BY = :by
184
+ BZ = :bz
185
+ CA = :ca
186
+ CD = :cd
187
+ CF = :cf
188
+ CG = :cg
189
+ CH = :ch
190
+ CI = :ci
191
+ CL = :cl
192
+ CM = :cm
193
+ CN = :cn
194
+ CO = :co
195
+ CR = :cr
196
+ CV = :cv
197
+ CW = :cw
198
+ CY = :cy
199
+ CZ = :cz
200
+ DE = :de
201
+ DJ = :dj
202
+ DK = :dk
203
+ DM = :dm
204
+ DO = :do
205
+ DZ = :dz
206
+ EC = :ec
207
+ EE = :ee
208
+ EG = :eg
209
+ ES = :es
210
+ ET = :et
211
+ FI = :fi
212
+ FJ = :fj
213
+ FR = :fr
214
+ GA = :ga
215
+ GB = :gb
216
+ GD = :gd
217
+ GE = :ge
218
+ GF = :gf
219
+ GG = :gg
220
+ GH = :gh
221
+ GM = :gm
222
+ GN = :gn
223
+ GP = :gp
224
+ GQ = :gq
225
+ GR = :gr
226
+ GT = :gt
227
+ GU = :gu
228
+ GW = :gw
229
+ GY = :gy
230
+ HK = :hk
231
+ HN = :hn
232
+ HR = :hr
233
+ HT = :ht
234
+ HU = :hu
235
+ ID = :id
236
+ IE = :ie
237
+ IL = :il
238
+ IM = :im
239
+ IN = :in
240
+ IQ = :iq
241
+ IR = :ir
242
+ IS = :is
243
+ IT = :it
244
+ JE = :je
245
+ JM = :jm
246
+ JO = :jo
247
+ JP = :jp
248
+ KE = :ke
249
+ KG = :kg
250
+ KH = :kh
251
+ KN = :kn
252
+ KR = :kr
253
+ KW = :kw
254
+ KY = :ky
255
+ KZ = :kz
256
+ LA = :la
257
+ LB = :lb
258
+ LC = :lc
259
+ LK = :lk
260
+ LR = :lr
261
+ LS = :ls
262
+ LT = :lt
263
+ LU = :lu
264
+ LV = :lv
265
+ LY = :ly
266
+ MA = :ma
267
+ MC = :mc
268
+ MD = :md
269
+ ME = :me
270
+ MF = :mf
271
+ MG = :mg
272
+ MK = :mk
273
+ ML = :ml
274
+ MM = :mm
275
+ MN = :mn
276
+ MO = :mo
277
+ MQ = :mq
278
+ MR = :mr
279
+ MT = :mt
280
+ MU = :mu
281
+ MV = :mv
282
+ MW = :mw
283
+ MX = :mx
284
+ MY = :my
285
+ MZ = :mz
286
+ NA = :na
287
+ NC = :nc
288
+ NE = :ne
289
+ NG = :ng
290
+ NI = :ni
291
+ NL = :nl
292
+ NO = :no
293
+ NP = :np
294
+ NZ = :nz
295
+ OM = :om
296
+ PA = :pa
297
+ PE = :pe
298
+ PF = :pf
299
+ PG = :pg
300
+ PH = :ph
301
+ PK = :pk
302
+ PL = :pl
303
+ PR = :pr
304
+ PS = :ps
305
+ PT = :pt
306
+ PY = :py
307
+ QA = :qa
308
+ RE = :re
309
+ RO = :ro
310
+ RS = :rs
311
+ RU = :ru
312
+ RW = :rw
313
+ SA = :sa
314
+ SC = :sc
315
+ SD = :sd
316
+ SE = :se
317
+ SG = :sg
318
+ SI = :si
319
+ SK = :sk
320
+ SL = :sl
321
+ SM = :sm
322
+ SN = :sn
323
+ SO = :so
324
+ SR = :sr
325
+ SS = :ss
326
+ ST = :st
327
+ SV = :sv
328
+ SX = :sx
329
+ SY = :sy
330
+ SZ = :sz
331
+ TC = :tc
332
+ TD = :td
333
+ TG = :tg
334
+ TH = :th
335
+ TJ = :tj
336
+ TL = :tl
337
+ TM = :tm
338
+ TN = :tn
339
+ TR = :tr
340
+ TT = :tt
341
+ TW = :tw
342
+ TZ = :tz
343
+ UA = :ua
344
+ UG = :ug
345
+ US = :us
346
+ UY = :uy
347
+ UZ = :uz
348
+ VC = :vc
349
+ VE = :ve
350
+ VG = :vg
351
+ VI = :vi
352
+ VN = :vn
353
+ YE = :ye
354
+ YT = :yt
355
+ ZA = :za
356
+ ZM = :zm
357
+ ZW = :zw
358
+
359
+ # @!method self.values
360
+ # @return [Array<Symbol>]
361
+ end
362
+
106
363
  # Optional parameter to determine screenshot type. If 'true', takes a full page
107
364
  # screenshot capturing all content. If 'false' or not provided, takes a viewport
108
365
  # screenshot (standard browser view).