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
@@ -0,0 +1,352 @@
1
+ # frozen_string_literal: true
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
+ # Some parameter documentations has been truncated, see
10
+ # {ContextDev::Models::MonitorCreateParams} for more details.
11
+ #
12
+ # Creates a monitor. The request body is a union of the supported target/change
13
+ # detection combinations. The monitor runs immediately after creation to create
14
+ # its initial baseline.
15
+ #
16
+ # @overload create(change_detection:, name:, schedule:, target:, mode: nil, tags: nil, webhook: nil, request_options: {})
17
+ #
18
+ # @param change_detection [ContextDev::Models::MonitorCreateParams::ChangeDetection::Exact, ContextDev::Models::MonitorCreateParams::ChangeDetection::Semantic] Discriminated union describing how changes are detected.
19
+ #
20
+ # @param name [String]
21
+ #
22
+ # @param schedule [ContextDev::Models::MonitorCreateParams::Schedule] Run the monitor on a fixed interval defined by a frequency and a unit, e.g. ever
23
+ #
24
+ # @param target [ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract] Discriminated union describing what the monitor watches.
25
+ #
26
+ # @param mode [Symbol, ContextDev::Models::MonitorCreateParams::Mode] Top-level monitor category. Always `web` today; the concrete behavior is describ
27
+ #
28
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
29
+ #
30
+ # @param webhook [ContextDev::Models::MonitorCreateParams::Webhook, nil]
31
+ #
32
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
33
+ #
34
+ # @return [ContextDev::Models::MonitorCreateResponse]
35
+ #
36
+ # @see ContextDev::Models::MonitorCreateParams
37
+ def create(params)
38
+ parsed, options = ContextDev::MonitorCreateParams.dump_request(params)
39
+ @client.request(
40
+ method: :post,
41
+ path: "monitors",
42
+ body: parsed,
43
+ model: ContextDev::Models::MonitorCreateResponse,
44
+ options: options
45
+ )
46
+ end
47
+
48
+ # Get a monitor
49
+ #
50
+ # @overload retrieve(monitor_id, request_options: {})
51
+ #
52
+ # @param monitor_id [String]
53
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
54
+ #
55
+ # @return [ContextDev::Models::MonitorRetrieveResponse]
56
+ #
57
+ # @see ContextDev::Models::MonitorRetrieveParams
58
+ def retrieve(monitor_id, params = {})
59
+ @client.request(
60
+ method: :get,
61
+ path: ["monitors/%1$s", monitor_id],
62
+ model: ContextDev::Models::MonitorRetrieveResponse,
63
+ options: params[:request_options]
64
+ )
65
+ end
66
+
67
+ # Some parameter documentations has been truncated, see
68
+ # {ContextDev::Models::MonitorUpdateParams} for more details.
69
+ #
70
+ # Updates a monitor. If `target` or `change_detection` changes, the monitor
71
+ # creates a new baseline. Unsupported target/change detection combinations are
72
+ # rejected.
73
+ #
74
+ # @overload update(monitor_id, change_detection: nil, name: nil, schedule: nil, status: nil, tags: nil, target: nil, webhook: nil, request_options: {})
75
+ #
76
+ # @param monitor_id [String]
77
+ #
78
+ # @param change_detection [ContextDev::Models::MonitorUpdateParams::ChangeDetection::Exact, ContextDev::Models::MonitorUpdateParams::ChangeDetection::Semantic] Discriminated union describing how changes are detected.
79
+ #
80
+ # @param name [String]
81
+ #
82
+ # @param schedule [ContextDev::Models::MonitorUpdateParams::Schedule] Run the monitor on a fixed interval defined by a frequency and a unit, e.g. ever
83
+ #
84
+ # @param status [Symbol, ContextDev::Models::MonitorUpdateParams::Status]
85
+ #
86
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
87
+ #
88
+ # @param target [ContextDev::Models::MonitorUpdateParams::Target::Page, ContextDev::Models::MonitorUpdateParams::Target::Sitemap, ContextDev::Models::MonitorUpdateParams::Target::Extract] Discriminated union describing what the monitor watches.
89
+ #
90
+ # @param webhook [ContextDev::Models::MonitorUpdateParams::Webhook, nil] Set to null to remove the webhook.
91
+ #
92
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
93
+ #
94
+ # @return [ContextDev::Models::MonitorUpdateResponse]
95
+ #
96
+ # @see ContextDev::Models::MonitorUpdateParams
97
+ def update(monitor_id, params = {})
98
+ parsed, options = ContextDev::MonitorUpdateParams.dump_request(params)
99
+ @client.request(
100
+ method: :patch,
101
+ path: ["monitors/%1$s", monitor_id],
102
+ body: parsed,
103
+ model: ContextDev::Models::MonitorUpdateResponse,
104
+ options: options
105
+ )
106
+ end
107
+
108
+ # Some parameter documentations has been truncated, see
109
+ # {ContextDev::Models::MonitorListParams} for more details.
110
+ #
111
+ # Lists monitors for the authenticated organization. Supports free-text search
112
+ # (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus
113
+ # status/type/tag filters. Results are paginated via the opaque `cursor`.
114
+ #
115
+ # @overload list(change_detection_type: nil, cursor: nil, limit: nil, q: nil, search_by: nil, search_type: nil, status: nil, tag: nil, tags: nil, target_type: nil, request_options: {})
116
+ #
117
+ # @param change_detection_type [Symbol, ContextDev::Models::MonitorListParams::ChangeDetectionType]
118
+ #
119
+ # @param cursor [String]
120
+ #
121
+ # @param limit [Integer]
122
+ #
123
+ # @param q [String] Free-text search term, matched against the fields named in `search_by`.
124
+ #
125
+ # @param search_by [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>] Comma-separated fields to search with `q`. Defaults to all of them. Note `query`
126
+ #
127
+ # @param search_type [Symbol, ContextDev::Models::MonitorListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match
128
+ #
129
+ # @param status [Symbol, ContextDev::Models::MonitorListParams::Status] Monitor lifecycle status. `failed` means the most recent run failed (see the mon
130
+ #
131
+ # @param tag [String] Filter to items that have this tag.
132
+ #
133
+ # @param tags [Array<String>] Comma-separated list of tags to filter by (matches monitors having any of them).
134
+ #
135
+ # @param target_type [Symbol, ContextDev::Models::MonitorListParams::TargetType]
136
+ #
137
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
138
+ #
139
+ # @return [ContextDev::Models::MonitorListResponse]
140
+ #
141
+ # @see ContextDev::Models::MonitorListParams
142
+ def list(params = {})
143
+ parsed, options = ContextDev::MonitorListParams.dump_request(params)
144
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
145
+ @client.request(
146
+ method: :get,
147
+ path: "monitors",
148
+ query: query,
149
+ model: ContextDev::Models::MonitorListResponse,
150
+ options: options
151
+ )
152
+ end
153
+
154
+ # Delete a monitor
155
+ #
156
+ # @overload delete(monitor_id, request_options: {})
157
+ #
158
+ # @param monitor_id [String]
159
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
160
+ #
161
+ # @return [ContextDev::Models::MonitorDeleteResponse]
162
+ #
163
+ # @see ContextDev::Models::MonitorDeleteParams
164
+ def delete(monitor_id, params = {})
165
+ @client.request(
166
+ method: :delete,
167
+ path: ["monitors/%1$s", monitor_id],
168
+ model: ContextDev::Models::MonitorDeleteResponse,
169
+ options: params[:request_options]
170
+ )
171
+ end
172
+
173
+ # Returns an account-wide feed of detected changes across monitors.
174
+ #
175
+ # @overload list_account_changes(change_detection_type: nil, cursor: nil, limit: nil, monitor_id: nil, since: nil, tag: nil, target_type: nil, until_: nil, request_options: {})
176
+ #
177
+ # @param change_detection_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::ChangeDetectionType]
178
+ #
179
+ # @param cursor [String]
180
+ #
181
+ # @param limit [Integer]
182
+ #
183
+ # @param monitor_id [String]
184
+ #
185
+ # @param since [Time]
186
+ #
187
+ # @param tag [String] Filter to items that have this tag.
188
+ #
189
+ # @param target_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::TargetType]
190
+ #
191
+ # @param until_ [Time]
192
+ #
193
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
194
+ #
195
+ # @return [ContextDev::Models::MonitorListAccountChangesResponse]
196
+ #
197
+ # @see ContextDev::Models::MonitorListAccountChangesParams
198
+ def list_account_changes(params = {})
199
+ parsed, options = ContextDev::MonitorListAccountChangesParams.dump_request(params)
200
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
201
+ @client.request(
202
+ method: :get,
203
+ path: "monitors/changes",
204
+ query: query.transform_keys(until_: "until"),
205
+ model: ContextDev::Models::MonitorListAccountChangesResponse,
206
+ options: options
207
+ )
208
+ end
209
+
210
+ # Some parameter documentations has been truncated, see
211
+ # {ContextDev::Models::MonitorListAccountRunsParams} for more details.
212
+ #
213
+ # Returns an account-wide feed of monitor runs across all monitors.
214
+ #
215
+ # @overload list_account_runs(cursor: nil, limit: nil, status: nil, request_options: {})
216
+ #
217
+ # @param cursor [String]
218
+ #
219
+ # @param limit [Integer]
220
+ #
221
+ # @param status [Symbol, ContextDev::Models::MonitorListAccountRunsParams::Status] Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (in
222
+ #
223
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
224
+ #
225
+ # @return [ContextDev::Models::MonitorListAccountRunsResponse]
226
+ #
227
+ # @see ContextDev::Models::MonitorListAccountRunsParams
228
+ def list_account_runs(params = {})
229
+ parsed, options = ContextDev::MonitorListAccountRunsParams.dump_request(params)
230
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
231
+ @client.request(
232
+ method: :get,
233
+ path: "monitors/runs",
234
+ query: query,
235
+ model: ContextDev::Models::MonitorListAccountRunsResponse,
236
+ options: options
237
+ )
238
+ end
239
+
240
+ # List changes for a monitor
241
+ #
242
+ # @overload list_changes(monitor_id, cursor: nil, limit: nil, since: nil, tag: nil, until_: nil, request_options: {})
243
+ #
244
+ # @param monitor_id [String]
245
+ #
246
+ # @param cursor [String]
247
+ #
248
+ # @param limit [Integer]
249
+ #
250
+ # @param since [Time]
251
+ #
252
+ # @param tag [String] Filter to items that have this tag.
253
+ #
254
+ # @param until_ [Time]
255
+ #
256
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
257
+ #
258
+ # @return [ContextDev::Models::MonitorListChangesResponse]
259
+ #
260
+ # @see ContextDev::Models::MonitorListChangesParams
261
+ def list_changes(monitor_id, params = {})
262
+ parsed, options = ContextDev::MonitorListChangesParams.dump_request(params)
263
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
264
+ @client.request(
265
+ method: :get,
266
+ path: ["monitors/%1$s/changes", monitor_id],
267
+ query: query.transform_keys(until_: "until"),
268
+ model: ContextDev::Models::MonitorListChangesResponse,
269
+ options: options
270
+ )
271
+ end
272
+
273
+ # Some parameter documentations has been truncated, see
274
+ # {ContextDev::Models::MonitorListRunsParams} for more details.
275
+ #
276
+ # List monitor runs
277
+ #
278
+ # @overload list_runs(monitor_id, cursor: nil, limit: nil, status: nil, request_options: {})
279
+ #
280
+ # @param monitor_id [String]
281
+ #
282
+ # @param cursor [String]
283
+ #
284
+ # @param limit [Integer]
285
+ #
286
+ # @param status [Symbol, ContextDev::Models::MonitorListRunsParams::Status] Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (in
287
+ #
288
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
289
+ #
290
+ # @return [ContextDev::Models::MonitorListRunsResponse]
291
+ #
292
+ # @see ContextDev::Models::MonitorListRunsParams
293
+ def list_runs(monitor_id, params = {})
294
+ parsed, options = ContextDev::MonitorListRunsParams.dump_request(params)
295
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
296
+ @client.request(
297
+ method: :get,
298
+ path: ["monitors/%1$s/runs", monitor_id],
299
+ query: query,
300
+ model: ContextDev::Models::MonitorListRunsResponse,
301
+ options: options
302
+ )
303
+ end
304
+
305
+ # Get a change
306
+ #
307
+ # @overload retrieve_change(change_id, request_options: {})
308
+ #
309
+ # @param change_id [String]
310
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
311
+ #
312
+ # @return [ContextDev::Models::MonitorRetrieveChangeResponse]
313
+ #
314
+ # @see ContextDev::Models::MonitorRetrieveChangeParams
315
+ def retrieve_change(change_id, params = {})
316
+ @client.request(
317
+ method: :get,
318
+ path: ["monitors/changes/%1$s", change_id],
319
+ model: ContextDev::Models::MonitorRetrieveChangeResponse,
320
+ options: params[:request_options]
321
+ )
322
+ end
323
+
324
+ # Triggers an immediate run of the monitor outside its normal schedule. The run is
325
+ # queued and processed asynchronously.
326
+ #
327
+ # @overload run(monitor_id, request_options: {})
328
+ #
329
+ # @param monitor_id [String]
330
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
331
+ #
332
+ # @return [ContextDev::Models::MonitorRunResponse]
333
+ #
334
+ # @see ContextDev::Models::MonitorRunParams
335
+ def run(monitor_id, params = {})
336
+ @client.request(
337
+ method: :post,
338
+ path: ["monitors/%1$s/run", monitor_id],
339
+ model: ContextDev::Models::MonitorRunResponse,
340
+ options: params[:request_options]
341
+ )
342
+ end
343
+
344
+ # @api private
345
+ #
346
+ # @param client [ContextDev::Client]
347
+ def initialize(client:)
348
+ @client = client
349
+ end
350
+ end
351
+ end
352
+ end
@@ -6,12 +6,16 @@ module ContextDev
6
6
  # Some parameter documentations has been truncated, see
7
7
  # {ContextDev::Models::UtilityPrefetchParams} for more details.
8
8
  #
9
- # Signal that you may fetch brand data for a particular domain soon to improve
10
- # latency.
9
+ # Signal that you may fetch brand data soon to improve latency. The type field
10
+ # selects what to prefetch (currently only 'brand') and identifier carries exactly
11
+ # one lookup key: a domain, or an email whose domain is extracted and validated
12
+ # (free email providers and disposable email addresses are not allowed).
11
13
  #
12
- # @overload prefetch(domain:, timeout_ms: nil, request_options: {})
14
+ # @overload prefetch(identifier:, type:, timeout_ms: nil, request_options: {})
13
15
  #
14
- # @param domain [String] Domain name to prefetch brand data for
16
+ # @param identifier [ContextDev::Models::UtilityPrefetchParams::Identifier::UtilityPrefetchDomainIdentifier, ContextDev::Models::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier] Identifier of the brand to prefetch. Provide exactly one of domain or email.
17
+ #
18
+ # @param type [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] What to prefetch. Currently only 'brand' is supported.
15
19
  #
16
20
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
17
21
  #
@@ -24,43 +28,13 @@ module ContextDev
24
28
  parsed, options = ContextDev::UtilityPrefetchParams.dump_request(params)
25
29
  @client.request(
26
30
  method: :post,
27
- path: "brand/prefetch",
31
+ path: "utility/prefetch",
28
32
  body: parsed,
29
33
  model: ContextDev::Models::UtilityPrefetchResponse,
30
34
  options: options
31
35
  )
32
36
  end
33
37
 
34
- # Some parameter documentations has been truncated, see
35
- # {ContextDev::Models::UtilityPrefetchByEmailParams} for more details.
36
- #
37
- # Signal that you may fetch brand data for a particular domain soon to improve
38
- # latency. This endpoint accepts an email address, extracts the domain from it,
39
- # validates that it's not a disposable or free email provider, and queues the
40
- # domain for prefetching.
41
- #
42
- # @overload prefetch_by_email(email:, timeout_ms: nil, request_options: {})
43
- #
44
- # @param email [String] Email address to prefetch brand data for. The domain will be extracted from the
45
- #
46
- # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
47
- #
48
- # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
49
- #
50
- # @return [ContextDev::Models::UtilityPrefetchByEmailResponse]
51
- #
52
- # @see ContextDev::Models::UtilityPrefetchByEmailParams
53
- def prefetch_by_email(params)
54
- parsed, options = ContextDev::UtilityPrefetchByEmailParams.dump_request(params)
55
- @client.request(
56
- method: :post,
57
- path: "brand/prefetch-by-email",
58
- body: parsed,
59
- model: ContextDev::Models::UtilityPrefetchByEmailResponse,
60
- options: options
61
- )
62
- end
63
-
64
38
  # @api private
65
39
  #
66
40
  # @param client [ContextDev::Client]
@@ -265,7 +265,7 @@ module ContextDev
265
265
  # Performs a crawl starting from a given URL, extracts page content as Markdown,
266
266
  # and returns results for all crawled pages.
267
267
  #
268
- # @overload web_crawl_md(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, shorten_base64_images: nil, stop_after_ms: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
268
+ # @overload web_crawl_md(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
269
269
  #
270
270
  # @param url [String] The starting URL for the crawl (must include http:// or https:// protocol)
271
271
  #
@@ -291,6 +291,8 @@ module ContextDev
291
291
  #
292
292
  # @param pdf [ContextDev::Models::WebWebCrawlMdParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and OCR to an inclu
293
293
  #
294
+ # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr
295
+ #
294
296
  # @param shorten_base64_images [Boolean] Truncate base64-encoded image data in the Markdown output
295
297
  #
296
298
  # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. After each scrape, the crawler c
@@ -324,7 +326,7 @@ module ContextDev
324
326
  #
325
327
  # Scrapes the given URL and returns the raw HTML content of the page.
326
328
  #
327
- # @overload web_scrape_html(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
329
+ # @overload web_scrape_html(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
328
330
  #
329
331
  # @param url [String] Full URL to scrape (must include http:// or https:// protocol)
330
332
  #
@@ -342,6 +344,8 @@ module ContextDev
342
344
  #
343
345
  # @param pdf [ContextDev::Models::WebWebScrapeHTMLParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and OCR to an inclu
344
346
  #
347
+ # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr
348
+ #
345
349
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
346
350
  #
347
351
  # @param use_main_content_only [Boolean] When true, return only the page's main content in the HTML response, excluding h
@@ -364,6 +368,7 @@ module ContextDev
364
368
  include_frames: "includeFrames",
365
369
  include_selectors: "includeSelectors",
366
370
  max_age_ms: "maxAgeMs",
371
+ settle_animations: "settleAnimations",
367
372
  timeout_ms: "timeoutMS",
368
373
  use_main_content_only: "useMainContentOnly",
369
374
  wait_for_ms: "waitForMs"
@@ -381,10 +386,12 @@ module ContextDev
381
386
  # embeds. The base request costs 1 credit. When enrichment is enabled, the entire
382
387
  # call costs 5 credits.
383
388
  #
384
- # @overload web_scrape_images(url:, enrichment: nil, headers: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
389
+ # @overload web_scrape_images(url:, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {})
385
390
  #
386
391
  # @param url [String] Page URL to inspect. Must include http:// or https://.
387
392
  #
393
+ # @param dedupe [Boolean] When true, visually duplicate images are removed: every image is loaded and perc
394
+ #
388
395
  # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment] Optional per-image processing, sent as deep-object query params such as enrichme
389
396
  #
390
397
  # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
@@ -421,7 +428,7 @@ module ContextDev
421
428
  #
422
429
  # Scrapes the given URL into LLM usable Markdown.
423
430
  #
424
- # @overload web_scrape_md(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
431
+ # @overload web_scrape_md(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {})
425
432
  #
426
433
  # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr
427
434
  #
@@ -443,6 +450,8 @@ module ContextDev
443
450
  #
444
451
  # @param pdf [ContextDev::Models::WebWebScrapeMdParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and OCR to an inclu
445
452
  #
453
+ # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before conv
454
+ #
446
455
  # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
447
456
  #
448
457
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
@@ -469,6 +478,7 @@ module ContextDev
469
478
  include_links: "includeLinks",
470
479
  include_selectors: "includeSelectors",
471
480
  max_age_ms: "maxAgeMs",
481
+ settle_animations: "settleAnimations",
472
482
  shorten_base64_images: "shortenBase64Images",
473
483
  timeout_ms: "timeoutMS",
474
484
  use_main_content_only: "useMainContentOnly",
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContextDev
4
- VERSION = "1.36.0"
4
+ VERSION = "2.0.0"
5
5
  end
data/lib/context_dev.rb CHANGED
@@ -52,22 +52,10 @@ require_relative "context_dev/errors"
52
52
  require_relative "context_dev/internal/transport/base_client"
53
53
  require_relative "context_dev/internal/transport/pooled_net_requester"
54
54
  require_relative "context_dev/client"
55
- require_relative "context_dev/models/ai_ai_query_params"
56
- require_relative "context_dev/models/ai_ai_query_response"
57
55
  require_relative "context_dev/models/ai_extract_product_params"
58
56
  require_relative "context_dev/models/ai_extract_product_response"
59
57
  require_relative "context_dev/models/ai_extract_products_params"
60
58
  require_relative "context_dev/models/ai_extract_products_response"
61
- require_relative "context_dev/models/brand_identify_from_transaction_params"
62
- require_relative "context_dev/models/brand_identify_from_transaction_response"
63
- require_relative "context_dev/models/brand_retrieve_by_email_params"
64
- require_relative "context_dev/models/brand_retrieve_by_email_response"
65
- require_relative "context_dev/models/brand_retrieve_by_isin_params"
66
- require_relative "context_dev/models/brand_retrieve_by_isin_response"
67
- require_relative "context_dev/models/brand_retrieve_by_name_params"
68
- require_relative "context_dev/models/brand_retrieve_by_name_response"
69
- require_relative "context_dev/models/brand_retrieve_by_ticker_params"
70
- require_relative "context_dev/models/brand_retrieve_by_ticker_response"
71
59
  require_relative "context_dev/models/brand_retrieve_params"
72
60
  require_relative "context_dev/models/brand_retrieve_response"
73
61
  require_relative "context_dev/models/brand_retrieve_simplified_params"
@@ -76,8 +64,28 @@ require_relative "context_dev/models/industry_retrieve_naics_params"
76
64
  require_relative "context_dev/models/industry_retrieve_naics_response"
77
65
  require_relative "context_dev/models/industry_retrieve_sic_params"
78
66
  require_relative "context_dev/models/industry_retrieve_sic_response"
79
- require_relative "context_dev/models/utility_prefetch_by_email_params"
80
- require_relative "context_dev/models/utility_prefetch_by_email_response"
67
+ require_relative "context_dev/models/monitor_create_params"
68
+ require_relative "context_dev/models/monitor_create_response"
69
+ require_relative "context_dev/models/monitor_delete_params"
70
+ require_relative "context_dev/models/monitor_delete_response"
71
+ require_relative "context_dev/models/monitor_list_account_changes_params"
72
+ require_relative "context_dev/models/monitor_list_account_changes_response"
73
+ require_relative "context_dev/models/monitor_list_account_runs_params"
74
+ require_relative "context_dev/models/monitor_list_account_runs_response"
75
+ require_relative "context_dev/models/monitor_list_changes_params"
76
+ require_relative "context_dev/models/monitor_list_changes_response"
77
+ require_relative "context_dev/models/monitor_list_params"
78
+ require_relative "context_dev/models/monitor_list_response"
79
+ require_relative "context_dev/models/monitor_list_runs_params"
80
+ require_relative "context_dev/models/monitor_list_runs_response"
81
+ require_relative "context_dev/models/monitor_retrieve_change_params"
82
+ require_relative "context_dev/models/monitor_retrieve_change_response"
83
+ require_relative "context_dev/models/monitor_retrieve_params"
84
+ require_relative "context_dev/models/monitor_retrieve_response"
85
+ require_relative "context_dev/models/monitor_run_params"
86
+ require_relative "context_dev/models/monitor_run_response"
87
+ require_relative "context_dev/models/monitor_update_params"
88
+ require_relative "context_dev/models/monitor_update_response"
81
89
  require_relative "context_dev/models/utility_prefetch_params"
82
90
  require_relative "context_dev/models/utility_prefetch_response"
83
91
  require_relative "context_dev/models/web_extract_competitors_params"
@@ -106,5 +114,6 @@ require_relative "context_dev/models"
106
114
  require_relative "context_dev/resources/ai"
107
115
  require_relative "context_dev/resources/brand"
108
116
  require_relative "context_dev/resources/industry"
117
+ require_relative "context_dev/resources/monitors"
109
118
  require_relative "context_dev/resources/utility"
110
119
  require_relative "context_dev/resources/web"
@@ -28,6 +28,12 @@ module ContextDev
28
28
  sig { returns(ContextDev::Resources::Utility) }
29
29
  attr_reader :utility
30
30
 
31
+ # Monitor pages, sitemaps, and extracted website data for exact or semantic
32
+ # changes. The change.detected webhook payload is documented by the
33
+ # MonitorsChangeDetectedWebhookPayload schema.
34
+ sig { returns(ContextDev::Resources::Monitors) }
35
+ attr_reader :monitors
36
+
31
37
  # @api private
32
38
  sig { override.returns(T::Hash[String, String]) }
33
39
  private def auth_headers