context.dev 1.36.0 → 2.0.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.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +16 -9
  4. data/lib/context_dev/client.rb +7 -0
  5. data/lib/context_dev/models/brand_retrieve_params.rb +1036 -174
  6. data/lib/context_dev/models/monitor_create_params.rb +361 -0
  7. data/lib/context_dev/models/monitor_create_response.rb +484 -0
  8. data/lib/context_dev/models/monitor_delete_params.rb +20 -0
  9. data/lib/context_dev/models/monitor_delete_response.rb +22 -0
  10. data/lib/context_dev/models/monitor_list_account_changes_params.rb +93 -0
  11. data/lib/context_dev/models/monitor_list_account_changes_response.rb +199 -0
  12. data/lib/context_dev/models/monitor_list_account_runs_params.rb +55 -0
  13. data/lib/context_dev/models/monitor_list_account_runs_response.rb +227 -0
  14. data/lib/context_dev/models/monitor_list_changes_params.rb +57 -0
  15. data/lib/context_dev/models/monitor_list_changes_response.rb +198 -0
  16. data/lib/context_dev/models/monitor_list_params.rb +161 -0
  17. data/lib/context_dev/models/monitor_list_response.rb +507 -0
  18. data/lib/context_dev/models/monitor_list_runs_params.rb +62 -0
  19. data/lib/context_dev/models/monitor_list_runs_response.rb +227 -0
  20. data/lib/context_dev/models/monitor_retrieve_change_params.rb +20 -0
  21. data/lib/context_dev/models/monitor_retrieve_change_response.rb +271 -0
  22. data/lib/context_dev/models/monitor_retrieve_params.rb +20 -0
  23. data/lib/context_dev/models/monitor_retrieve_response.rb +484 -0
  24. data/lib/context_dev/models/monitor_run_params.rb +20 -0
  25. data/lib/context_dev/models/monitor_run_response.rb +35 -0
  26. data/lib/context_dev/models/monitor_update_params.rb +368 -0
  27. data/lib/context_dev/models/monitor_update_response.rb +484 -0
  28. data/lib/context_dev/models/utility_prefetch_params.rb +70 -6
  29. data/lib/context_dev/models/utility_prefetch_response.rb +23 -1
  30. data/lib/context_dev/models/web_extract_response.rb +17 -1
  31. data/lib/context_dev/models/web_web_crawl_md_params.rb +11 -1
  32. data/lib/context_dev/models/web_web_scrape_html_params.rb +11 -1
  33. data/lib/context_dev/models/web_web_scrape_html_response.rb +10 -2
  34. data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -1
  35. data/lib/context_dev/models/web_web_scrape_md_params.rb +11 -1
  36. data/lib/context_dev/models.rb +20 -12
  37. data/lib/context_dev/resources/ai.rb +0 -33
  38. data/lib/context_dev/resources/brand.rb +7 -204
  39. data/lib/context_dev/resources/monitors.rb +352 -0
  40. data/lib/context_dev/resources/utility.rb +9 -35
  41. data/lib/context_dev/resources/web.rb +14 -4
  42. data/lib/context_dev/version.rb +1 -1
  43. data/lib/context_dev.rb +23 -14
  44. data/rbi/context_dev/client.rbi +6 -0
  45. data/rbi/context_dev/models/brand_retrieve_params.rbi +3792 -679
  46. data/rbi/context_dev/models/monitor_create_params.rbi +640 -0
  47. data/rbi/context_dev/models/monitor_create_response.rbi +820 -0
  48. data/rbi/context_dev/models/monitor_delete_params.rbi +35 -0
  49. data/rbi/context_dev/models/monitor_delete_response.rbi +29 -0
  50. data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +211 -0
  51. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +376 -0
  52. data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +125 -0
  53. data/rbi/context_dev/models/monitor_list_account_runs_response.rbi +464 -0
  54. data/rbi/context_dev/models/monitor_list_changes_params.rbi +91 -0
  55. data/rbi/context_dev/models/monitor_list_changes_response.rbi +372 -0
  56. data/rbi/context_dev/models/monitor_list_params.rbi +332 -0
  57. data/rbi/context_dev/models/monitor_list_response.rbi +885 -0
  58. data/rbi/context_dev/models/monitor_list_runs_params.rbi +125 -0
  59. data/rbi/context_dev/models/monitor_list_runs_response.rbi +455 -0
  60. data/rbi/context_dev/models/monitor_retrieve_change_params.rbi +38 -0
  61. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +478 -0
  62. data/rbi/context_dev/models/monitor_retrieve_params.rbi +38 -0
  63. data/rbi/context_dev/models/monitor_retrieve_response.rbi +828 -0
  64. data/rbi/context_dev/models/monitor_run_params.rbi +35 -0
  65. data/rbi/context_dev/models/monitor_run_response.rbi +48 -0
  66. data/rbi/context_dev/models/monitor_update_params.rbi +680 -0
  67. data/rbi/context_dev/models/monitor_update_response.rbi +820 -0
  68. data/rbi/context_dev/models/utility_prefetch_params.rbi +129 -7
  69. data/rbi/context_dev/models/utility_prefetch_response.rbi +55 -3
  70. data/rbi/context_dev/models/web_extract_response.rbi +10 -0
  71. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +15 -0
  72. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +15 -0
  73. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +29 -3
  74. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +17 -0
  75. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +15 -0
  76. data/rbi/context_dev/models.rbi +23 -15
  77. data/rbi/context_dev/resources/ai.rbi +0 -28
  78. data/rbi/context_dev/resources/brand.rbi +13 -228
  79. data/rbi/context_dev/resources/monitors.rbi +286 -0
  80. data/rbi/context_dev/resources/utility.rbi +14 -29
  81. data/rbi/context_dev/resources/web.rbi +21 -0
  82. data/sig/context_dev/client.rbs +2 -0
  83. data/sig/context_dev/models/brand_retrieve_params.rbs +1560 -281
  84. data/sig/context_dev/models/monitor_create_params.rbs +311 -0
  85. data/sig/context_dev/models/monitor_create_response.rbs +369 -0
  86. data/sig/context_dev/models/monitor_delete_params.rbs +23 -0
  87. data/sig/context_dev/models/monitor_delete_response.rbs +15 -0
  88. data/sig/context_dev/models/monitor_list_account_changes_params.rbs +104 -0
  89. data/sig/context_dev/models/monitor_list_account_changes_response.rbs +176 -0
  90. data/sig/context_dev/models/monitor_list_account_runs_params.rbs +58 -0
  91. data/sig/context_dev/models/monitor_list_account_runs_response.rbs +184 -0
  92. data/sig/context_dev/models/monitor_list_changes_params.rbs +61 -0
  93. data/sig/context_dev/models/monitor_list_changes_response.rbs +176 -0
  94. data/sig/context_dev/models/monitor_list_params.rbs +160 -0
  95. data/sig/context_dev/models/monitor_list_response.rbs +396 -0
  96. data/sig/context_dev/models/monitor_list_runs_params.rbs +63 -0
  97. data/sig/context_dev/models/monitor_list_runs_response.rbs +184 -0
  98. data/sig/context_dev/models/monitor_retrieve_change_params.rbs +23 -0
  99. data/sig/context_dev/models/monitor_retrieve_change_response.rbs +228 -0
  100. data/sig/context_dev/models/monitor_retrieve_params.rbs +23 -0
  101. data/sig/context_dev/models/monitor_retrieve_response.rbs +369 -0
  102. data/sig/context_dev/models/monitor_run_params.rbs +23 -0
  103. data/sig/context_dev/models/monitor_run_response.rbs +18 -0
  104. data/sig/context_dev/models/monitor_update_params.rbs +331 -0
  105. data/sig/context_dev/models/monitor_update_response.rbs +369 -0
  106. data/sig/context_dev/models/utility_prefetch_params.rbs +52 -4
  107. data/sig/context_dev/models/utility_prefetch_response.rbs +22 -3
  108. data/sig/context_dev/models/web_extract_response.rbs +5 -0
  109. data/sig/context_dev/models/web_web_crawl_md_params.rbs +7 -0
  110. data/sig/context_dev/models/web_web_scrape_html_params.rbs +7 -0
  111. data/sig/context_dev/models/web_web_scrape_html_response.rbs +8 -0
  112. data/sig/context_dev/models/web_web_scrape_images_params.rbs +7 -0
  113. data/sig/context_dev/models/web_web_scrape_md_params.rbs +7 -0
  114. data/sig/context_dev/models.rbs +20 -12
  115. data/sig/context_dev/resources/ai.rbs +0 -8
  116. data/sig/context_dev/resources/brand.rbs +1 -56
  117. data/sig/context_dev/resources/monitors.rbs +101 -0
  118. data/sig/context_dev/resources/utility.rbs +2 -7
  119. data/sig/context_dev/resources/web.rbs +4 -0
  120. metadata +71 -44
  121. data/lib/context_dev/models/ai_ai_query_params.rb +0 -235
  122. data/lib/context_dev/models/ai_ai_query_response.rb +0 -133
  123. data/lib/context_dev/models/brand_identify_from_transaction_params.rb +0 -474
  124. data/lib/context_dev/models/brand_identify_from_transaction_response.rb +0 -1074
  125. data/lib/context_dev/models/brand_retrieve_by_email_params.rb +0 -195
  126. data/lib/context_dev/models/brand_retrieve_by_email_response.rb +0 -1071
  127. data/lib/context_dev/models/brand_retrieve_by_isin_params.rb +0 -195
  128. data/lib/context_dev/models/brand_retrieve_by_isin_response.rb +0 -1070
  129. data/lib/context_dev/models/brand_retrieve_by_name_params.rb +0 -452
  130. data/lib/context_dev/models/brand_retrieve_by_name_response.rb +0 -1070
  131. data/lib/context_dev/models/brand_retrieve_by_ticker_params.rb +0 -283
  132. data/lib/context_dev/models/brand_retrieve_by_ticker_response.rb +0 -1072
  133. data/lib/context_dev/models/utility_prefetch_by_email_params.rb +0 -37
  134. data/lib/context_dev/models/utility_prefetch_by_email_response.rb +0 -68
  135. data/rbi/context_dev/models/ai_ai_query_params.rbi +0 -504
  136. data/rbi/context_dev/models/ai_ai_query_response.rbi +0 -267
  137. data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +0 -2020
  138. data/rbi/context_dev/models/brand_identify_from_transaction_response.rbi +0 -3515
  139. data/rbi/context_dev/models/brand_retrieve_by_email_params.rbi +0 -743
  140. data/rbi/context_dev/models/brand_retrieve_by_email_response.rbi +0 -3511
  141. data/rbi/context_dev/models/brand_retrieve_by_isin_params.rbi +0 -743
  142. data/rbi/context_dev/models/brand_retrieve_by_isin_response.rbi +0 -3510
  143. data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +0 -1982
  144. data/rbi/context_dev/models/brand_retrieve_by_name_response.rbi +0 -3510
  145. data/rbi/context_dev/models/brand_retrieve_by_ticker_params.rbi +0 -1153
  146. data/rbi/context_dev/models/brand_retrieve_by_ticker_response.rbi +0 -3512
  147. data/rbi/context_dev/models/utility_prefetch_by_email_params.rbi +0 -65
  148. data/rbi/context_dev/models/utility_prefetch_by_email_response.rbi +0 -132
  149. data/sig/context_dev/models/ai_ai_query_params.rbs +0 -218
  150. data/sig/context_dev/models/ai_ai_query_response.rbs +0 -121
  151. data/sig/context_dev/models/brand_identify_from_transaction_params.rbs +0 -822
  152. data/sig/context_dev/models/brand_identify_from_transaction_response.rbs +0 -1441
  153. data/sig/context_dev/models/brand_retrieve_by_email_params.rbs +0 -305
  154. data/sig/context_dev/models/brand_retrieve_by_email_response.rbs +0 -1441
  155. data/sig/context_dev/models/brand_retrieve_by_isin_params.rbs +0 -305
  156. data/sig/context_dev/models/brand_retrieve_by_isin_response.rbs +0 -1441
  157. data/sig/context_dev/models/brand_retrieve_by_name_params.rbs +0 -801
  158. data/sig/context_dev/models/brand_retrieve_by_name_response.rbs +0 -1441
  159. data/sig/context_dev/models/brand_retrieve_by_ticker_params.rbs +0 -467
  160. data/sig/context_dev/models/brand_retrieve_by_ticker_response.rbs +0 -1441
  161. data/sig/context_dev/models/utility_prefetch_by_email_params.rbs +0 -30
  162. data/sig/context_dev/models/utility_prefetch_by_email_response.rbs +0 -64
@@ -3,240 +3,25 @@
3
3
  module ContextDev
4
4
  module Resources
5
5
  class Brand
6
- # Retrieve logos, backdrops, colors, industry, description, and more from any
7
- # domain
6
+ # Retrieve logos, backdrops, colors, industry, description, and more. Provide
7
+ # exactly one lookup identifier in the request body: a domain, company name, email
8
+ # address, stock ticker, or transaction descriptor.
8
9
  sig do
9
10
  params(
10
- domain: String,
11
- force_language:
12
- ContextDev::BrandRetrieveParams::ForceLanguage::OrSymbol,
13
- max_age_ms: Integer,
14
- max_speed: T::Boolean,
15
- timeout_ms: Integer,
11
+ body:
12
+ T.any(
13
+ ContextDev::BrandRetrieveParams::Body::ByDomain::OrHash,
14
+ ContextDev::BrandRetrieveParams::Body::ByName::OrHash,
15
+ ContextDev::BrandRetrieveParams::Body::ByEmail::OrHash,
16
+ ContextDev::BrandRetrieveParams::Body::ByTicker::OrHash,
17
+ ContextDev::BrandRetrieveParams::Body::ByTransaction::OrHash
18
+ ),
16
19
  request_options: ContextDev::RequestOptions::OrHash
17
20
  ).returns(ContextDev::Models::BrandRetrieveResponse)
18
21
  end
19
22
  def retrieve(
20
- # Domain name to retrieve brand data for (e.g., 'example.com', 'google.com').
21
- # Cannot be used with name or ticker parameters.
22
- domain:,
23
- # Optional parameter to force the language of the retrieved brand data.
24
- force_language: nil,
25
- # Maximum age in milliseconds for cached brand data before the API performs a hard
26
- # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
27
- # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
28
- # year.
29
- max_age_ms: nil,
30
- # Optional parameter to optimize the API call for maximum speed. When set to true,
31
- # the API will skip time-consuming operations for faster response at the cost of
32
- # less comprehensive data. Works with all three lookup methods.
33
- max_speed: nil,
34
- # Optional timeout in milliseconds for the request. If the request takes longer
35
- # than this value, it will be aborted with a 408 status code. Maximum allowed
36
- # value is 300000ms (5 minutes).
37
- timeout_ms: nil,
38
- request_options: {}
39
- )
40
- end
41
-
42
- # Endpoint specially designed for platforms that want to identify transaction data
43
- # by the transaction title.
44
- sig do
45
- params(
46
- transaction_info: String,
47
- city: String,
48
- country_gl:
49
- ContextDev::BrandIdentifyFromTransactionParams::CountryGl::OrSymbol,
50
- force_language:
51
- ContextDev::BrandIdentifyFromTransactionParams::ForceLanguage::OrSymbol,
52
- high_confidence_only: T::Boolean,
53
- max_speed: T::Boolean,
54
- mcc: String,
55
- phone: Float,
56
- timeout_ms: Integer,
57
- request_options: ContextDev::RequestOptions::OrHash
58
- ).returns(ContextDev::Models::BrandIdentifyFromTransactionResponse)
59
- end
60
- def identify_from_transaction(
61
- # Transaction information to identify the brand
62
- transaction_info:,
63
- # Optional city name to prioritize when searching for the brand.
64
- city: nil,
65
- # Optional country code (GL parameter) to specify the country. This affects the
66
- # geographic location used for search queries.
67
- country_gl: nil,
68
- # Optional parameter to force the language of the retrieved brand data.
69
- force_language: nil,
70
- # When set to true, the API will perform an additional verification steps to
71
- # ensure the identified brand matches the transaction with high confidence.
72
- high_confidence_only: nil,
73
- # Optional parameter to optimize the API call for maximum speed. When set to true,
74
- # the API will skip time-consuming operations for faster response at the cost of
75
- # less comprehensive data.
76
- max_speed: nil,
77
- # Optional Merchant Category Code (MCC) to help identify the business
78
- # category/industry.
79
- mcc: nil,
80
- # Optional phone number from the transaction to help verify brand match.
81
- phone: nil,
82
- # Optional timeout in milliseconds for the request. If the request takes longer
83
- # than this value, it will be aborted with a 408 status code. Maximum allowed
84
- # value is 300000ms (5 minutes).
85
- timeout_ms: nil,
86
- request_options: {}
87
- )
88
- end
89
-
90
- # Retrieve brand information using an email address while detecting disposable and
91
- # free email addresses. Disposable and free email addresses (like gmail.com,
92
- # yahoo.com) will throw a 422 error.
93
- sig do
94
- params(
95
- email: String,
96
- force_language:
97
- ContextDev::BrandRetrieveByEmailParams::ForceLanguage::OrSymbol,
98
- max_age_ms: Integer,
99
- max_speed: T::Boolean,
100
- timeout_ms: Integer,
101
- request_options: ContextDev::RequestOptions::OrHash
102
- ).returns(ContextDev::Models::BrandRetrieveByEmailResponse)
103
- end
104
- def retrieve_by_email(
105
- # Email address to retrieve brand data for (e.g., 'contact@example.com'). The
106
- # domain will be extracted from the email. Free email providers (gmail.com,
107
- # yahoo.com, etc.) and disposable email addresses are not allowed.
108
- email:,
109
- # Optional parameter to force the language of the retrieved brand data.
110
- force_language: nil,
111
- # Maximum age in milliseconds for cached brand data before the API performs a hard
112
- # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
113
- # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
114
- # year.
115
- max_age_ms: nil,
116
- # Optional parameter to optimize the API call for maximum speed. When set to true,
117
- # the API will skip time-consuming operations for faster response at the cost of
118
- # less comprehensive data.
119
- max_speed: nil,
120
- # Optional timeout in milliseconds for the request. If the request takes longer
121
- # than this value, it will be aborted with a 408 status code. Maximum allowed
122
- # value is 300000ms (5 minutes).
123
- timeout_ms: nil,
124
- request_options: {}
125
- )
126
- end
127
-
128
- # Retrieve brand information using an ISIN (International Securities
129
- # Identification Number).
130
- sig do
131
- params(
132
- isin: String,
133
- force_language:
134
- ContextDev::BrandRetrieveByIsinParams::ForceLanguage::OrSymbol,
135
- max_age_ms: Integer,
136
- max_speed: T::Boolean,
137
- timeout_ms: Integer,
138
- request_options: ContextDev::RequestOptions::OrHash
139
- ).returns(ContextDev::Models::BrandRetrieveByIsinResponse)
140
- end
141
- def retrieve_by_isin(
142
- # ISIN (International Securities Identification Number) to retrieve brand data for
143
- # (e.g., 'AU000000IMD5', 'US0378331005'). Must be exactly 12 characters: 2 letters
144
- # followed by 9 alphanumeric characters and ending with a digit.
145
- isin:,
146
- # Optional parameter to force the language of the retrieved brand data.
147
- force_language: nil,
148
- # Maximum age in milliseconds for cached brand data before the API performs a hard
149
- # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
150
- # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
151
- # year.
152
- max_age_ms: nil,
153
- # Optional parameter to optimize the API call for maximum speed. When set to true,
154
- # the API will skip time-consuming operations for faster response at the cost of
155
- # less comprehensive data.
156
- max_speed: nil,
157
- # Optional timeout in milliseconds for the request. If the request takes longer
158
- # than this value, it will be aborted with a 408 status code. Maximum allowed
159
- # value is 300000ms (5 minutes).
160
- timeout_ms: nil,
161
- request_options: {}
162
- )
163
- end
164
-
165
- # Retrieve brand information using a company name.
166
- sig do
167
- params(
168
- name: String,
169
- country_gl:
170
- ContextDev::BrandRetrieveByNameParams::CountryGl::OrSymbol,
171
- force_language:
172
- ContextDev::BrandRetrieveByNameParams::ForceLanguage::OrSymbol,
173
- max_age_ms: Integer,
174
- max_speed: T::Boolean,
175
- timeout_ms: Integer,
176
- request_options: ContextDev::RequestOptions::OrHash
177
- ).returns(ContextDev::Models::BrandRetrieveByNameResponse)
178
- end
179
- def retrieve_by_name(
180
- # Company name to retrieve brand data for (e.g., 'Apple Inc', 'Microsoft
181
- # Corporation'). Must be 3-30 characters.
182
- name:,
183
- # Optional country code hint (GL parameter) to specify the country for the company
184
- # name.
185
- country_gl: nil,
186
- # Optional parameter to force the language of the retrieved brand data.
187
- force_language: nil,
188
- # Maximum age in milliseconds for cached brand data before the API performs a hard
189
- # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
190
- # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
191
- # year.
192
- max_age_ms: nil,
193
- # Optional parameter to optimize the API call for maximum speed. When set to true,
194
- # the API will skip time-consuming operations for faster response at the cost of
195
- # less comprehensive data.
196
- max_speed: nil,
197
- # Optional timeout in milliseconds for the request. If the request takes longer
198
- # than this value, it will be aborted with a 408 status code. Maximum allowed
199
- # value is 300000ms (5 minutes).
200
- timeout_ms: nil,
201
- request_options: {}
202
- )
203
- end
204
-
205
- # Retrieve brand information using a stock ticker symbol.
206
- sig do
207
- params(
208
- ticker: String,
209
- force_language:
210
- ContextDev::BrandRetrieveByTickerParams::ForceLanguage::OrSymbol,
211
- max_age_ms: Integer,
212
- max_speed: T::Boolean,
213
- ticker_exchange:
214
- ContextDev::BrandRetrieveByTickerParams::TickerExchange::OrSymbol,
215
- timeout_ms: Integer,
216
- request_options: ContextDev::RequestOptions::OrHash
217
- ).returns(ContextDev::Models::BrandRetrieveByTickerResponse)
218
- end
219
- def retrieve_by_ticker(
220
- # Stock ticker symbol to retrieve brand data for (e.g., 'AAPL', 'GOOGL', 'BRK.A').
221
- # Must be 1-15 characters, letters/numbers/dots only.
222
- ticker:,
223
- # Optional parameter to force the language of the retrieved brand data.
224
- force_language: nil,
225
- # Maximum age in milliseconds for cached brand data before the API performs a hard
226
- # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms)
227
- # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1
228
- # year.
229
- max_age_ms: nil,
230
- # Optional parameter to optimize the API call for maximum speed. When set to true,
231
- # the API will skip time-consuming operations for faster response at the cost of
232
- # less comprehensive data.
233
- max_speed: nil,
234
- # Optional stock exchange for the ticker. Defaults to NASDAQ if not specified.
235
- ticker_exchange: nil,
236
- # Optional timeout in milliseconds for the request. If the request takes longer
237
- # than this value, it will be aborted with a 408 status code. Maximum allowed
238
- # value is 300000ms (5 minutes).
239
- timeout_ms: nil,
23
+ # Exactly one lookup type must be provided.
24
+ body:,
240
25
  request_options: {}
241
26
  )
242
27
  end
@@ -0,0 +1,286 @@
1
+ # typed: strong
2
+
3
+ module ContextDev
4
+ module Resources
5
+ # Monitor pages, sitemaps, and extracted website data for exact or semantic
6
+ # changes. The change.detected webhook payload is documented by the
7
+ # MonitorsChangeDetectedWebhookPayload schema.
8
+ class Monitors
9
+ # Creates a monitor. The request body is a union of the supported target/change
10
+ # detection combinations. The monitor runs immediately after creation to create
11
+ # its initial baseline.
12
+ sig do
13
+ params(
14
+ change_detection:
15
+ T.any(
16
+ ContextDev::MonitorCreateParams::ChangeDetection::Exact::OrHash,
17
+ ContextDev::MonitorCreateParams::ChangeDetection::Semantic::OrHash
18
+ ),
19
+ name: String,
20
+ schedule: ContextDev::MonitorCreateParams::Schedule::OrHash,
21
+ target:
22
+ T.any(
23
+ ContextDev::MonitorCreateParams::Target::Page::OrHash,
24
+ ContextDev::MonitorCreateParams::Target::Sitemap::OrHash,
25
+ ContextDev::MonitorCreateParams::Target::Extract::OrHash
26
+ ),
27
+ mode: ContextDev::MonitorCreateParams::Mode::OrSymbol,
28
+ tags: T::Array[String],
29
+ webhook: T.nilable(ContextDev::MonitorCreateParams::Webhook::OrHash),
30
+ request_options: ContextDev::RequestOptions::OrHash
31
+ ).returns(ContextDev::Models::MonitorCreateResponse)
32
+ end
33
+ def create(
34
+ # Discriminated union describing how changes are detected.
35
+ change_detection:,
36
+ name:,
37
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
38
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
39
+ # between 10 minutes and 1 year.
40
+ schedule:,
41
+ # Discriminated union describing what the monitor watches.
42
+ target:,
43
+ # Top-level monitor category. Always `web` today; the concrete behavior is
44
+ # described by `target` and `change_detection`.
45
+ mode: nil,
46
+ # User-defined tags for grouping and filtering monitors and their changes.
47
+ tags: nil,
48
+ webhook: nil,
49
+ request_options: {}
50
+ )
51
+ end
52
+
53
+ # Get a monitor
54
+ sig do
55
+ params(
56
+ monitor_id: String,
57
+ request_options: ContextDev::RequestOptions::OrHash
58
+ ).returns(ContextDev::Models::MonitorRetrieveResponse)
59
+ end
60
+ def retrieve(monitor_id, request_options: {})
61
+ end
62
+
63
+ # Updates a monitor. If `target` or `change_detection` changes, the monitor
64
+ # creates a new baseline. Unsupported target/change detection combinations are
65
+ # rejected.
66
+ sig do
67
+ params(
68
+ monitor_id: String,
69
+ change_detection:
70
+ T.any(
71
+ ContextDev::MonitorUpdateParams::ChangeDetection::Exact::OrHash,
72
+ ContextDev::MonitorUpdateParams::ChangeDetection::Semantic::OrHash
73
+ ),
74
+ name: String,
75
+ schedule: ContextDev::MonitorUpdateParams::Schedule::OrHash,
76
+ status: ContextDev::MonitorUpdateParams::Status::OrSymbol,
77
+ tags: T::Array[String],
78
+ target:
79
+ T.any(
80
+ ContextDev::MonitorUpdateParams::Target::Page::OrHash,
81
+ ContextDev::MonitorUpdateParams::Target::Sitemap::OrHash,
82
+ ContextDev::MonitorUpdateParams::Target::Extract::OrHash
83
+ ),
84
+ webhook: T.nilable(ContextDev::MonitorUpdateParams::Webhook::OrHash),
85
+ request_options: ContextDev::RequestOptions::OrHash
86
+ ).returns(ContextDev::Models::MonitorUpdateResponse)
87
+ end
88
+ def update(
89
+ monitor_id,
90
+ # Discriminated union describing how changes are detected.
91
+ change_detection: nil,
92
+ name: nil,
93
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
94
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
95
+ # between 10 minutes and 1 year.
96
+ schedule: nil,
97
+ status: nil,
98
+ # User-defined tags for grouping and filtering monitors and their changes.
99
+ tags: nil,
100
+ # Discriminated union describing what the monitor watches.
101
+ target: nil,
102
+ # Set to null to remove the webhook.
103
+ webhook: nil,
104
+ request_options: {}
105
+ )
106
+ end
107
+
108
+ # Lists monitors for the authenticated organization. Supports free-text search
109
+ # (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus
110
+ # status/type/tag filters. Results are paginated via the opaque `cursor`.
111
+ sig do
112
+ params(
113
+ change_detection_type:
114
+ ContextDev::MonitorListParams::ChangeDetectionType::OrSymbol,
115
+ cursor: String,
116
+ limit: Integer,
117
+ q: String,
118
+ search_by:
119
+ T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol],
120
+ search_type: ContextDev::MonitorListParams::SearchType::OrSymbol,
121
+ status: ContextDev::MonitorListParams::Status::OrSymbol,
122
+ tag: String,
123
+ tags: T::Array[String],
124
+ target_type: ContextDev::MonitorListParams::TargetType::OrSymbol,
125
+ request_options: ContextDev::RequestOptions::OrHash
126
+ ).returns(ContextDev::Models::MonitorListResponse)
127
+ end
128
+ def list(
129
+ change_detection_type: nil,
130
+ cursor: nil,
131
+ limit: nil,
132
+ # Free-text search term, matched against the fields named in `search_by`.
133
+ q: nil,
134
+ # Comma-separated fields to search with `q`. Defaults to all of them. Note `query`
135
+ # only exists on semantic monitors.
136
+ search_by: nil,
137
+ # `prefix` for as-you-type prefix matching (default), `exact` for full-token
138
+ # matching.
139
+ search_type: nil,
140
+ # Monitor lifecycle status. `failed` means the most recent run failed (see the
141
+ # monitor's `last_error`); failed monitors keep running on schedule and flip back
142
+ # to `active` on the next successful run. Monitors are auto-`paused` after
143
+ # repeated consecutive failures or insufficient-credit skips; resume by PATCHing
144
+ # status to `active`.
145
+ status: nil,
146
+ # Filter to items that have this tag.
147
+ tag: nil,
148
+ # Comma-separated list of tags to filter by (matches monitors having any of them).
149
+ tags: nil,
150
+ target_type: nil,
151
+ request_options: {}
152
+ )
153
+ end
154
+
155
+ # Delete a monitor
156
+ sig do
157
+ params(
158
+ monitor_id: String,
159
+ request_options: ContextDev::RequestOptions::OrHash
160
+ ).returns(ContextDev::Models::MonitorDeleteResponse)
161
+ end
162
+ def delete(monitor_id, request_options: {})
163
+ end
164
+
165
+ # Returns an account-wide feed of detected changes across monitors.
166
+ sig do
167
+ params(
168
+ change_detection_type:
169
+ ContextDev::MonitorListAccountChangesParams::ChangeDetectionType::OrSymbol,
170
+ cursor: String,
171
+ limit: Integer,
172
+ monitor_id: String,
173
+ since: Time,
174
+ tag: String,
175
+ target_type:
176
+ ContextDev::MonitorListAccountChangesParams::TargetType::OrSymbol,
177
+ until_: Time,
178
+ request_options: ContextDev::RequestOptions::OrHash
179
+ ).returns(ContextDev::Models::MonitorListAccountChangesResponse)
180
+ end
181
+ def list_account_changes(
182
+ change_detection_type: nil,
183
+ cursor: nil,
184
+ limit: nil,
185
+ monitor_id: nil,
186
+ since: nil,
187
+ # Filter to items that have this tag.
188
+ tag: nil,
189
+ target_type: nil,
190
+ until_: nil,
191
+ request_options: {}
192
+ )
193
+ end
194
+
195
+ # Returns an account-wide feed of monitor runs across all monitors.
196
+ sig do
197
+ params(
198
+ cursor: String,
199
+ limit: Integer,
200
+ status: ContextDev::MonitorListAccountRunsParams::Status::OrSymbol,
201
+ request_options: ContextDev::RequestOptions::OrHash
202
+ ).returns(ContextDev::Models::MonitorListAccountRunsResponse)
203
+ end
204
+ def list_account_runs(
205
+ cursor: nil,
206
+ limit: nil,
207
+ # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
208
+ # (insufficient credits, monitor paused, or superseded by a concurrent run).
209
+ status: nil,
210
+ request_options: {}
211
+ )
212
+ end
213
+
214
+ # List changes for a monitor
215
+ sig do
216
+ params(
217
+ monitor_id: String,
218
+ cursor: String,
219
+ limit: Integer,
220
+ since: Time,
221
+ tag: String,
222
+ until_: Time,
223
+ request_options: ContextDev::RequestOptions::OrHash
224
+ ).returns(ContextDev::Models::MonitorListChangesResponse)
225
+ end
226
+ def list_changes(
227
+ monitor_id,
228
+ cursor: nil,
229
+ limit: nil,
230
+ since: nil,
231
+ # Filter to items that have this tag.
232
+ tag: nil,
233
+ until_: nil,
234
+ request_options: {}
235
+ )
236
+ end
237
+
238
+ # List monitor runs
239
+ sig do
240
+ params(
241
+ monitor_id: String,
242
+ cursor: String,
243
+ limit: Integer,
244
+ status: ContextDev::MonitorListRunsParams::Status::OrSymbol,
245
+ request_options: ContextDev::RequestOptions::OrHash
246
+ ).returns(ContextDev::Models::MonitorListRunsResponse)
247
+ end
248
+ def list_runs(
249
+ monitor_id,
250
+ cursor: nil,
251
+ limit: nil,
252
+ # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
253
+ # (insufficient credits, monitor paused, or superseded by a concurrent run).
254
+ status: nil,
255
+ request_options: {}
256
+ )
257
+ end
258
+
259
+ # Get a change
260
+ sig do
261
+ params(
262
+ change_id: String,
263
+ request_options: ContextDev::RequestOptions::OrHash
264
+ ).returns(ContextDev::Models::MonitorRetrieveChangeResponse)
265
+ end
266
+ def retrieve_change(change_id, request_options: {})
267
+ end
268
+
269
+ # Triggers an immediate run of the monitor outside its normal schedule. The run is
270
+ # queued and processed asynchronously.
271
+ sig do
272
+ params(
273
+ monitor_id: String,
274
+ request_options: ContextDev::RequestOptions::OrHash
275
+ ).returns(ContextDev::Models::MonitorRunResponse)
276
+ end
277
+ def run(monitor_id, request_options: {})
278
+ end
279
+
280
+ # @api private
281
+ sig { params(client: ContextDev::Client).returns(T.attached_class) }
282
+ def self.new(client:)
283
+ end
284
+ end
285
+ end
286
+ end
@@ -3,42 +3,27 @@
3
3
  module ContextDev
4
4
  module Resources
5
5
  class Utility
6
- # Signal that you may fetch brand data for a particular domain soon to improve
7
- # latency.
6
+ # Signal that you may fetch brand data soon to improve latency. The type field
7
+ # selects what to prefetch (currently only 'brand') and identifier carries exactly
8
+ # one lookup key: a domain, or an email whose domain is extracted and validated
9
+ # (free email providers and disposable email addresses are not allowed).
8
10
  sig do
9
11
  params(
10
- domain: String,
12
+ identifier:
13
+ T.any(
14
+ ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchDomainIdentifier::OrHash,
15
+ ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier::OrHash
16
+ ),
17
+ type: ContextDev::UtilityPrefetchParams::Type::OrSymbol,
11
18
  timeout_ms: Integer,
12
19
  request_options: ContextDev::RequestOptions::OrHash
13
20
  ).returns(ContextDev::Models::UtilityPrefetchResponse)
14
21
  end
15
22
  def prefetch(
16
- # Domain name to prefetch brand data for
17
- domain:,
18
- # Optional timeout in milliseconds for the request. If the request takes longer
19
- # than this value, it will be aborted with a 408 status code. Maximum allowed
20
- # value is 300000ms (5 minutes).
21
- timeout_ms: nil,
22
- request_options: {}
23
- )
24
- end
25
-
26
- # Signal that you may fetch brand data for a particular domain soon to improve
27
- # latency. This endpoint accepts an email address, extracts the domain from it,
28
- # validates that it's not a disposable or free email provider, and queues the
29
- # domain for prefetching.
30
- sig do
31
- params(
32
- email: String,
33
- timeout_ms: Integer,
34
- request_options: ContextDev::RequestOptions::OrHash
35
- ).returns(ContextDev::Models::UtilityPrefetchByEmailResponse)
36
- end
37
- def prefetch_by_email(
38
- # Email address to prefetch brand data for. The domain will be extracted from the
39
- # email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
40
- # addresses are not allowed.
41
- email:,
23
+ # Identifier of the brand to prefetch. Provide exactly one of domain or email.
24
+ identifier:,
25
+ # What to prefetch. Currently only 'brand' is supported.
26
+ type:,
42
27
  # Optional timeout in milliseconds for the request. If the request takes longer
43
28
  # than this value, it will be aborted with a 408 status code. Maximum allowed
44
29
  # value is 300000ms (5 minutes).
@@ -299,6 +299,7 @@ module ContextDev
299
299
  max_depth: Integer,
300
300
  max_pages: Integer,
301
301
  pdf: ContextDev::WebWebCrawlMdParams::Pdf::OrHash,
302
+ settle_animations: T::Boolean,
302
303
  shorten_base64_images: T::Boolean,
303
304
  stop_after_ms: Integer,
304
305
  timeout_ms: Integer,
@@ -346,6 +347,10 @@ module ContextDev
346
347
  # PDF parsing controls. Use start/end to limit text extraction and OCR to an
347
348
  # inclusive 1-based page range.
348
349
  pdf: nil,
350
+ # When true, waits briefly for CSS and transition animations to settle before
351
+ # extracting each crawled page. Defaults to false. This adds a bit of latency in
352
+ # exchange for more stable output on animated pages.
353
+ settle_animations: nil,
349
354
  # Truncate base64-encoded image data in the Markdown output
350
355
  shorten_base64_images: nil,
351
356
  # Soft time budget for the crawl in milliseconds. After each scrape, the crawler
@@ -380,6 +385,7 @@ module ContextDev
380
385
  include_selectors: T::Array[String],
381
386
  max_age_ms: Integer,
382
387
  pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash,
388
+ settle_animations: T::Boolean,
383
389
  timeout_ms: Integer,
384
390
  use_main_content_only: T::Boolean,
385
391
  wait_for_ms: Integer,
@@ -413,6 +419,10 @@ module ContextDev
413
419
  # PDF parsing controls. Use start/end to limit text extraction and OCR to an
414
420
  # inclusive 1-based page range.
415
421
  pdf: nil,
422
+ # When true, waits briefly for CSS and transition animations to settle before
423
+ # extracting HTML. Defaults to false. This adds a bit of latency in exchange for
424
+ # more stable output on animated pages.
425
+ settle_animations: nil,
416
426
  # Optional timeout in milliseconds for the request. If the request takes longer
417
427
  # than this value, it will be aborted with a 408 status code. Maximum allowed
418
428
  # value is 300000ms (5 minutes).
@@ -434,6 +444,7 @@ module ContextDev
434
444
  sig do
435
445
  params(
436
446
  url: String,
447
+ dedupe: T::Boolean,
437
448
  enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash,
438
449
  headers: T::Hash[Symbol, String],
439
450
  max_age_ms: Integer,
@@ -445,6 +456,11 @@ module ContextDev
445
456
  def web_scrape_images(
446
457
  # Page URL to inspect. Must include http:// or https://.
447
458
  url:,
459
+ # When true, visually duplicate images are removed: every image is loaded and
460
+ # perceptually hashed, and only the highest-resolution copy of each duplicate
461
+ # group is kept. Images that cannot be downloaded or hashed are kept. Default:
462
+ # false.
463
+ dedupe: nil,
448
464
  # Optional per-image processing, sent as deep-object query params such as
449
465
  # enrichment[resolution]=true.
450
466
  enrichment: nil,
@@ -479,6 +495,7 @@ module ContextDev
479
495
  include_selectors: T::Array[String],
480
496
  max_age_ms: Integer,
481
497
  pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash,
498
+ settle_animations: T::Boolean,
482
499
  shorten_base64_images: T::Boolean,
483
500
  timeout_ms: Integer,
484
501
  use_main_content_only: T::Boolean,
@@ -518,6 +535,10 @@ module ContextDev
518
535
  # PDF parsing controls. Use start/end to limit text extraction and OCR to an
519
536
  # inclusive 1-based page range.
520
537
  pdf: nil,
538
+ # When true, waits briefly for CSS and transition animations to settle before
539
+ # converting to Markdown. Defaults to false. This adds a bit of latency in
540
+ # exchange for more stable output on animated pages.
541
+ settle_animations: nil,
521
542
  # Shorten base64-encoded image data in the Markdown output
522
543
  shorten_base64_images: nil,
523
544
  # Optional timeout in milliseconds for the request. If the request takes longer
@@ -20,6 +20,8 @@ module ContextDev
20
20
 
21
21
  attr_reader utility: ContextDev::Resources::Utility
22
22
 
23
+ attr_reader monitors: ContextDev::Resources::Monitors
24
+
23
25
  private def auth_headers: -> ::Hash[String, String]
24
26
 
25
27
  def initialize: (