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,484 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContextDev
4
+ module Models
5
+ # @see ContextDev::Resources::Monitors#update
6
+ class MonitorUpdateResponse < ContextDev::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute change_detection
13
+ # Discriminated union describing how changes are detected.
14
+ #
15
+ # @return [ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Exact, ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Semantic]
16
+ required :change_detection, union: -> { ContextDev::Models::MonitorUpdateResponse::ChangeDetection }
17
+
18
+ # @!attribute created_at
19
+ #
20
+ # @return [Time]
21
+ required :created_at, Time
22
+
23
+ # @!attribute mode
24
+ # Top-level monitor category. Always `web` today; the concrete behavior is
25
+ # described by `target` and `change_detection`.
26
+ #
27
+ # @return [Symbol, ContextDev::Models::MonitorUpdateResponse::Mode]
28
+ required :mode, enum: -> { ContextDev::Models::MonitorUpdateResponse::Mode }
29
+
30
+ # @!attribute name
31
+ #
32
+ # @return [String]
33
+ required :name, String
34
+
35
+ # @!attribute schedule
36
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
37
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
38
+ # between 10 minutes and 1 year.
39
+ #
40
+ # @return [ContextDev::Models::MonitorUpdateResponse::Schedule]
41
+ required :schedule, -> { ContextDev::Models::MonitorUpdateResponse::Schedule }
42
+
43
+ # @!attribute status
44
+ # Monitor lifecycle status. `failed` means the most recent run failed (see the
45
+ # monitor's `last_error`); failed monitors keep running on schedule and flip back
46
+ # to `active` on the next successful run. Monitors are auto-`paused` after
47
+ # repeated consecutive failures or insufficient-credit skips; resume by PATCHing
48
+ # status to `active`.
49
+ #
50
+ # @return [Symbol, ContextDev::Models::MonitorUpdateResponse::Status]
51
+ required :status, enum: -> { ContextDev::Models::MonitorUpdateResponse::Status }
52
+
53
+ # @!attribute target
54
+ # Discriminated union describing what the monitor watches.
55
+ #
56
+ # @return [ContextDev::Models::MonitorUpdateResponse::Target::Page, ContextDev::Models::MonitorUpdateResponse::Target::Sitemap, ContextDev::Models::MonitorUpdateResponse::Target::Extract]
57
+ required :target, union: -> { ContextDev::Models::MonitorUpdateResponse::Target }
58
+
59
+ # @!attribute updated_at
60
+ #
61
+ # @return [Time]
62
+ required :updated_at, Time
63
+
64
+ # @!attribute last_change_at
65
+ #
66
+ # @return [Time, nil]
67
+ optional :last_change_at, Time, nil?: true
68
+
69
+ # @!attribute last_error
70
+ # Error from the most recent failed run; null when the last run succeeded.
71
+ #
72
+ # @return [ContextDev::Models::MonitorUpdateResponse::LastError, nil]
73
+ optional :last_error, -> { ContextDev::Models::MonitorUpdateResponse::LastError }, nil?: true
74
+
75
+ # @!attribute last_run_at
76
+ #
77
+ # @return [Time, nil]
78
+ optional :last_run_at, Time, nil?: true
79
+
80
+ # @!attribute next_run_at
81
+ # When the next scheduled run is due.
82
+ #
83
+ # @return [Time, nil]
84
+ optional :next_run_at, Time, nil?: true
85
+
86
+ # @!attribute tags
87
+ # User-defined tags for grouping and filtering monitors and their changes.
88
+ #
89
+ # @return [Array<String>, nil]
90
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
91
+
92
+ # @!attribute webhook
93
+ #
94
+ # @return [ContextDev::Models::MonitorUpdateResponse::Webhook, nil]
95
+ optional :webhook, -> { ContextDev::Models::MonitorUpdateResponse::Webhook }, nil?: true
96
+
97
+ # @!method initialize(id:, change_detection:, created_at:, mode:, name:, schedule:, status:, target:, updated_at:, last_change_at: nil, last_error: nil, last_run_at: nil, next_run_at: nil, tags: nil, webhook: nil)
98
+ # Some parameter documentations has been truncated, see
99
+ # {ContextDev::Models::MonitorUpdateResponse} for more details.
100
+ #
101
+ # A web monitor. `mode` is the constant `web`; behavior is described by `target`
102
+ # (page/sitemap/extract) and `change_detection` (exact/semantic).
103
+ #
104
+ # @param id [String]
105
+ #
106
+ # @param change_detection [ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Exact, ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Semantic] Discriminated union describing how changes are detected.
107
+ #
108
+ # @param created_at [Time]
109
+ #
110
+ # @param mode [Symbol, ContextDev::Models::MonitorUpdateResponse::Mode] Top-level monitor category. Always `web` today; the concrete behavior is describ
111
+ #
112
+ # @param name [String]
113
+ #
114
+ # @param schedule [ContextDev::Models::MonitorUpdateResponse::Schedule] Run the monitor on a fixed interval defined by a frequency and a unit, e.g. ever
115
+ #
116
+ # @param status [Symbol, ContextDev::Models::MonitorUpdateResponse::Status] Monitor lifecycle status. `failed` means the most recent run failed (see the mon
117
+ #
118
+ # @param target [ContextDev::Models::MonitorUpdateResponse::Target::Page, ContextDev::Models::MonitorUpdateResponse::Target::Sitemap, ContextDev::Models::MonitorUpdateResponse::Target::Extract] Discriminated union describing what the monitor watches.
119
+ #
120
+ # @param updated_at [Time]
121
+ #
122
+ # @param last_change_at [Time, nil]
123
+ #
124
+ # @param last_error [ContextDev::Models::MonitorUpdateResponse::LastError, nil] Error from the most recent failed run; null when the last run succeeded.
125
+ #
126
+ # @param last_run_at [Time, nil]
127
+ #
128
+ # @param next_run_at [Time, nil] When the next scheduled run is due.
129
+ #
130
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
131
+ #
132
+ # @param webhook [ContextDev::Models::MonitorUpdateResponse::Webhook, nil]
133
+
134
+ # Discriminated union describing how changes are detected.
135
+ #
136
+ # @see ContextDev::Models::MonitorUpdateResponse#change_detection
137
+ module ChangeDetection
138
+ extend ContextDev::Internal::Type::Union
139
+
140
+ discriminator :type
141
+
142
+ # Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
143
+ variant :exact, -> { ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Exact }
144
+
145
+ # Detect meaning-level changes that match a natural language query.
146
+ variant :semantic, -> { ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Semantic }
147
+
148
+ class Exact < ContextDev::Internal::Type::BaseModel
149
+ # @!attribute type
150
+ #
151
+ # @return [Symbol, :exact]
152
+ required :type, const: :exact
153
+
154
+ # @!method initialize(type: :exact)
155
+ # Detect exact changes. For page targets, this means visible text diffs. For
156
+ # sitemap targets, this means URL additions and removals.
157
+ #
158
+ # @param type [Symbol, :exact]
159
+ end
160
+
161
+ class Semantic < ContextDev::Internal::Type::BaseModel
162
+ # @!attribute query
163
+ #
164
+ # @return [String]
165
+ required :query, String
166
+
167
+ # @!attribute type
168
+ #
169
+ # @return [Symbol, :semantic]
170
+ required :type, const: :semantic
171
+
172
+ # @!attribute confidence_threshold
173
+ #
174
+ # @return [Float, nil]
175
+ optional :confidence_threshold, Float
176
+
177
+ # @!method initialize(query:, confidence_threshold: nil, type: :semantic)
178
+ # Detect meaning-level changes that match a natural language query.
179
+ #
180
+ # @param query [String]
181
+ # @param confidence_threshold [Float]
182
+ # @param type [Symbol, :semantic]
183
+ end
184
+
185
+ # @!method self.variants
186
+ # @return [Array(ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Exact, ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Semantic)]
187
+ end
188
+
189
+ # Top-level monitor category. Always `web` today; the concrete behavior is
190
+ # described by `target` and `change_detection`.
191
+ #
192
+ # @see ContextDev::Models::MonitorUpdateResponse#mode
193
+ module Mode
194
+ extend ContextDev::Internal::Type::Enum
195
+
196
+ WEB = :web
197
+
198
+ # @!method self.values
199
+ # @return [Array<Symbol>]
200
+ end
201
+
202
+ # @see ContextDev::Models::MonitorUpdateResponse#schedule
203
+ class Schedule < ContextDev::Internal::Type::BaseModel
204
+ # @!attribute frequency
205
+ # Number of units between runs. The resulting interval (frequency × unit) must be
206
+ # at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
207
+ # maximum 365 when unit is days).
208
+ #
209
+ # @return [Integer]
210
+ required :frequency, Integer
211
+
212
+ # @!attribute type
213
+ #
214
+ # @return [Symbol, ContextDev::Models::MonitorUpdateResponse::Schedule::Type]
215
+ required :type, enum: -> { ContextDev::Models::MonitorUpdateResponse::Schedule::Type }
216
+
217
+ # @!attribute unit
218
+ #
219
+ # @return [Symbol, ContextDev::Models::MonitorUpdateResponse::Schedule::Unit]
220
+ required :unit, enum: -> { ContextDev::Models::MonitorUpdateResponse::Schedule::Unit }
221
+
222
+ # @!method initialize(frequency:, type:, unit:)
223
+ # Some parameter documentations has been truncated, see
224
+ # {ContextDev::Models::MonitorUpdateResponse::Schedule} for more details.
225
+ #
226
+ # Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
227
+ # every 6 hours or every 2 days. The total interval (frequency × unit) must be
228
+ # between 10 minutes and 1 year.
229
+ #
230
+ # @param frequency [Integer] Number of units between runs. The resulting interval (frequency × unit) must be
231
+ #
232
+ # @param type [Symbol, ContextDev::Models::MonitorUpdateResponse::Schedule::Type]
233
+ #
234
+ # @param unit [Symbol, ContextDev::Models::MonitorUpdateResponse::Schedule::Unit]
235
+
236
+ # @see ContextDev::Models::MonitorUpdateResponse::Schedule#type
237
+ module Type
238
+ extend ContextDev::Internal::Type::Enum
239
+
240
+ INTERVAL = :interval
241
+
242
+ # @!method self.values
243
+ # @return [Array<Symbol>]
244
+ end
245
+
246
+ # @see ContextDev::Models::MonitorUpdateResponse::Schedule#unit
247
+ module Unit
248
+ extend ContextDev::Internal::Type::Enum
249
+
250
+ MINUTES = :minutes
251
+ HOURS = :hours
252
+ DAYS = :days
253
+
254
+ # @!method self.values
255
+ # @return [Array<Symbol>]
256
+ end
257
+ end
258
+
259
+ # Monitor lifecycle status. `failed` means the most recent run failed (see the
260
+ # monitor's `last_error`); failed monitors keep running on schedule and flip back
261
+ # to `active` on the next successful run. Monitors are auto-`paused` after
262
+ # repeated consecutive failures or insufficient-credit skips; resume by PATCHing
263
+ # status to `active`.
264
+ #
265
+ # @see ContextDev::Models::MonitorUpdateResponse#status
266
+ module Status
267
+ extend ContextDev::Internal::Type::Enum
268
+
269
+ ACTIVE = :active
270
+ PAUSED = :paused
271
+ FAILED = :failed
272
+
273
+ # @!method self.values
274
+ # @return [Array<Symbol>]
275
+ end
276
+
277
+ # Discriminated union describing what the monitor watches.
278
+ #
279
+ # @see ContextDev::Models::MonitorUpdateResponse#target
280
+ module Target
281
+ extend ContextDev::Internal::Type::Union
282
+
283
+ discriminator :type
284
+
285
+ # Watch a single web page.
286
+ variant :page, -> { ContextDev::Models::MonitorUpdateResponse::Target::Page }
287
+
288
+ # Watch a sitemap for URL additions and removals. Crawled URLs are normalized (lowercased host, no trailing slash/fragment) and scoped to the monitored site and its subdomains before comparison. A new URL set must be observed on two consecutive runs before a change is reported, suppressing one-run crawl flaps.
289
+ variant :sitemap, -> { ContextDev::Models::MonitorUpdateResponse::Target::Sitemap }
290
+
291
+ # Watch a site's extracted structured data.
292
+ variant :extract, -> { ContextDev::Models::MonitorUpdateResponse::Target::Extract }
293
+
294
+ class Page < ContextDev::Internal::Type::BaseModel
295
+ # @!attribute type
296
+ #
297
+ # @return [Symbol, :page]
298
+ required :type, const: :page
299
+
300
+ # @!attribute url
301
+ #
302
+ # @return [String]
303
+ required :url, String
304
+
305
+ # @!attribute normalize_whitespace
306
+ # Normalize whitespace before comparing or analyzing text.
307
+ #
308
+ # @return [Boolean, nil]
309
+ optional :normalize_whitespace, ContextDev::Internal::Type::Boolean
310
+
311
+ # @!method initialize(url:, normalize_whitespace: nil, type: :page)
312
+ # Watch a single web page.
313
+ #
314
+ # @param url [String]
315
+ #
316
+ # @param normalize_whitespace [Boolean] Normalize whitespace before comparing or analyzing text.
317
+ #
318
+ # @param type [Symbol, :page]
319
+ end
320
+
321
+ class Sitemap < ContextDev::Internal::Type::BaseModel
322
+ # @!attribute type
323
+ #
324
+ # @return [Symbol, :sitemap]
325
+ required :type, const: :sitemap
326
+
327
+ # @!attribute url
328
+ # Sitemap URL to monitor.
329
+ #
330
+ # @return [String]
331
+ required :url, String
332
+
333
+ # @!attribute exclude
334
+ # URL path patterns to exclude.
335
+ #
336
+ # @return [Array<String>, nil]
337
+ optional :exclude, ContextDev::Internal::Type::ArrayOf[String]
338
+
339
+ # @!attribute include
340
+ # URL path patterns to include.
341
+ #
342
+ # @return [Array<String>, nil]
343
+ optional :include, ContextDev::Internal::Type::ArrayOf[String]
344
+
345
+ # @!attribute max_urls
346
+ # Maximum number of sitemap URLs to track (capped at 10,000).
347
+ #
348
+ # @return [Integer, nil]
349
+ optional :max_urls, Integer
350
+
351
+ # @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
352
+ # Watch a sitemap for URL additions and removals. Crawled URLs are normalized
353
+ # (lowercased host, no trailing slash/fragment) and scoped to the monitored site
354
+ # and its subdomains before comparison. A new URL set must be observed on two
355
+ # consecutive runs before a change is reported, suppressing one-run crawl flaps.
356
+ #
357
+ # @param url [String] Sitemap URL to monitor.
358
+ #
359
+ # @param exclude [Array<String>] URL path patterns to exclude.
360
+ #
361
+ # @param include [Array<String>] URL path patterns to include.
362
+ #
363
+ # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000).
364
+ #
365
+ # @param type [Symbol, :sitemap]
366
+ end
367
+
368
+ class Extract < ContextDev::Internal::Type::BaseModel
369
+ # @!attribute type
370
+ #
371
+ # @return [Symbol, :extract]
372
+ required :type, const: :extract
373
+
374
+ # @!attribute url
375
+ # Root URL to extract structured data from.
376
+ #
377
+ # @return [String]
378
+ required :url, String
379
+
380
+ # @!attribute follow_subdomains
381
+ #
382
+ # @return [Boolean, nil]
383
+ optional :follow_subdomains, ContextDev::Internal::Type::Boolean
384
+
385
+ # @!attribute instructions
386
+ # Optional natural-language instructions guiding what to extract.
387
+ #
388
+ # @return [String, nil]
389
+ optional :instructions, String
390
+
391
+ # @!attribute max_depth
392
+ # Optional maximum link depth from the starting URL (0 = only the starting page).
393
+ #
394
+ # @return [Integer, nil]
395
+ optional :max_depth, Integer
396
+
397
+ # @!attribute max_pages
398
+ # Maximum number of pages to analyze during extraction.
399
+ #
400
+ # @return [Integer, nil]
401
+ optional :max_pages, Integer
402
+
403
+ # @!attribute schema
404
+ # JSON Schema describing the structured data to extract and watch for changes. If
405
+ # omitted, a default summary + key-points schema is used.
406
+ #
407
+ # @return [Hash{Symbol=>Object}, nil]
408
+ optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
409
+
410
+ # @!method initialize(url:, follow_subdomains: nil, instructions: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
411
+ # Some parameter documentations has been truncated, see
412
+ # {ContextDev::Models::MonitorUpdateResponse::Target::Extract} for more details.
413
+ #
414
+ # Watch a site's extracted structured data.
415
+ #
416
+ # @param url [String] Root URL to extract structured data from.
417
+ #
418
+ # @param follow_subdomains [Boolean]
419
+ #
420
+ # @param instructions [String] Optional natural-language instructions guiding what to extract.
421
+ #
422
+ # @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
423
+ #
424
+ # @param max_pages [Integer] Maximum number of pages to analyze during extraction.
425
+ #
426
+ # @param schema [Hash{Symbol=>Object}] JSON Schema describing the structured data to extract and watch for changes. If
427
+ #
428
+ # @param type [Symbol, :extract]
429
+ end
430
+
431
+ # @!method self.variants
432
+ # @return [Array(ContextDev::Models::MonitorUpdateResponse::Target::Page, ContextDev::Models::MonitorUpdateResponse::Target::Sitemap, ContextDev::Models::MonitorUpdateResponse::Target::Extract)]
433
+ end
434
+
435
+ # @see ContextDev::Models::MonitorUpdateResponse#last_error
436
+ class LastError < ContextDev::Internal::Type::BaseModel
437
+ # @!attribute code
438
+ #
439
+ # @return [String]
440
+ required :code, String
441
+
442
+ # @!attribute message
443
+ #
444
+ # @return [String]
445
+ required :message, String
446
+
447
+ # @!method initialize(code:, message:)
448
+ # Error from the most recent failed run; null when the last run succeeded.
449
+ #
450
+ # @param code [String]
451
+ # @param message [String]
452
+ end
453
+
454
+ # @see ContextDev::Models::MonitorUpdateResponse#webhook
455
+ class Webhook < ContextDev::Internal::Type::BaseModel
456
+ # @!attribute url
457
+ # Webhook URL called when a change is detected.
458
+ #
459
+ # @return [String]
460
+ required :url, String
461
+
462
+ response_only do
463
+ # @!attribute secret
464
+ # Signing secret used to verify webhook authenticity. Each delivery includes an
465
+ # `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
466
+ # `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
467
+ # compare and reject stale timestamps to prevent replay. Generated by the API;
468
+ # cannot be set by clients.
469
+ #
470
+ # @return [String, nil]
471
+ optional :secret, String
472
+ end
473
+
474
+ # @!method initialize(url:, secret: nil)
475
+ # Some parameter documentations has been truncated, see
476
+ # {ContextDev::Models::MonitorUpdateResponse::Webhook} for more details.
477
+ #
478
+ # @param url [String] Webhook URL called when a change is detected.
479
+ #
480
+ # @param secret [String] Signing secret used to verify webhook authenticity. Each delivery includes an `X
481
+ end
482
+ end
483
+ end
484
+ end
@@ -7,11 +7,17 @@ module ContextDev
7
7
  extend ContextDev::Internal::Type::RequestParameters::Converter
8
8
  include ContextDev::Internal::Type::RequestParameters
9
9
 
10
- # @!attribute domain
11
- # Domain name to prefetch brand data for
10
+ # @!attribute identifier
11
+ # Identifier of the brand to prefetch. Provide exactly one of domain or email.
12
12
  #
13
- # @return [String]
14
- required :domain, String
13
+ # @return [ContextDev::Models::UtilityPrefetchParams::Identifier::UtilityPrefetchDomainIdentifier, ContextDev::Models::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier]
14
+ required :identifier, union: -> { ContextDev::UtilityPrefetchParams::Identifier }
15
+
16
+ # @!attribute type
17
+ # What to prefetch. Currently only 'brand' is supported.
18
+ #
19
+ # @return [Symbol, ContextDev::Models::UtilityPrefetchParams::Type]
20
+ required :type, enum: -> { ContextDev::UtilityPrefetchParams::Type }
15
21
 
16
22
  # @!attribute timeout_ms
17
23
  # Optional timeout in milliseconds for the request. If the request takes longer
@@ -21,15 +27,73 @@ module ContextDev
21
27
  # @return [Integer, nil]
22
28
  optional :timeout_ms, Integer, api_name: :timeoutMS
23
29
 
24
- # @!method initialize(domain:, timeout_ms: nil, request_options: {})
30
+ # @!method initialize(identifier:, type:, timeout_ms: nil, request_options: {})
25
31
  # Some parameter documentations has been truncated, see
26
32
  # {ContextDev::Models::UtilityPrefetchParams} for more details.
27
33
  #
28
- # @param domain [String] Domain name to prefetch brand data for
34
+ # @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.
35
+ #
36
+ # @param type [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] What to prefetch. Currently only 'brand' is supported.
29
37
  #
30
38
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
31
39
  #
32
40
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
41
+
42
+ # Identifier of the brand to prefetch. Provide exactly one of domain or email.
43
+ module Identifier
44
+ extend ContextDev::Internal::Type::Union
45
+
46
+ # Prefetch brand data by domain.
47
+ variant -> { ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchDomainIdentifier }
48
+
49
+ # Prefetch brand data by email. The domain will be extracted and validated.
50
+ variant -> { ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier }
51
+
52
+ class UtilityPrefetchDomainIdentifier < ContextDev::Internal::Type::BaseModel
53
+ # @!attribute domain
54
+ # Domain name to prefetch brand data for
55
+ #
56
+ # @return [String]
57
+ required :domain, String
58
+
59
+ # @!method initialize(domain:)
60
+ # Prefetch brand data by domain.
61
+ #
62
+ # @param domain [String] Domain name to prefetch brand data for
63
+ end
64
+
65
+ class UtilityPrefetchEmailIdentifier < ContextDev::Internal::Type::BaseModel
66
+ # @!attribute email
67
+ # Email address to prefetch brand data for. The domain will be extracted from the
68
+ # email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
69
+ # addresses are not allowed.
70
+ #
71
+ # @return [String]
72
+ required :email, String
73
+
74
+ # @!method initialize(email:)
75
+ # Some parameter documentations has been truncated, see
76
+ # {ContextDev::Models::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier}
77
+ # for more details.
78
+ #
79
+ # Prefetch brand data by email. The domain will be extracted and validated.
80
+ #
81
+ # @param email [String] Email address to prefetch brand data for. The domain will be extracted from the
82
+ end
83
+
84
+ # @!method self.variants
85
+ # @return [Array(ContextDev::Models::UtilityPrefetchParams::Identifier::UtilityPrefetchDomainIdentifier, ContextDev::Models::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier)]
86
+ end
87
+
88
+ # What to prefetch. Currently only 'brand' is supported.
89
+ module Type
90
+ extend ContextDev::Internal::Type::Enum
91
+
92
+ BRAND = :brand
93
+
94
+ # @!method self.values
95
+ # @return [Array<Symbol>]
96
+ end
33
97
  end
34
98
  end
35
99
  end
@@ -29,7 +29,14 @@ module ContextDev
29
29
  # @return [String, nil]
30
30
  optional :status, String
31
31
 
32
- # @!method initialize(domain: nil, key_metadata: nil, message: nil, status: nil)
32
+ # @!attribute type
33
+ # The type of prefetch that was queued, echoed from the request (currently always
34
+ # 'brand')
35
+ #
36
+ # @return [Symbol, ContextDev::Models::UtilityPrefetchResponse::Type, nil]
37
+ optional :type, enum: -> { ContextDev::Models::UtilityPrefetchResponse::Type }
38
+
39
+ # @!method initialize(domain: nil, key_metadata: nil, message: nil, status: nil, type: nil)
33
40
  # Some parameter documentations has been truncated, see
34
41
  # {ContextDev::Models::UtilityPrefetchResponse} for more details.
35
42
  #
@@ -40,6 +47,8 @@ module ContextDev
40
47
  # @param message [String] Success message
41
48
  #
42
49
  # @param status [String] Status of the response, e.g., 'ok'
50
+ #
51
+ # @param type [Symbol, ContextDev::Models::UtilityPrefetchResponse::Type] The type of prefetch that was queued, echoed from the request (currently always
43
52
 
44
53
  # @see ContextDev::Models::UtilityPrefetchResponse#key_metadata
45
54
  class KeyMetadata < ContextDev::Internal::Type::BaseModel
@@ -63,6 +72,19 @@ module ContextDev
63
72
  #
64
73
  # @param credits_remaining [Integer] The number of credits remaining for your organization after this request.
65
74
  end
75
+
76
+ # The type of prefetch that was queued, echoed from the request (currently always
77
+ # 'brand')
78
+ #
79
+ # @see ContextDev::Models::UtilityPrefetchResponse#type
80
+ module Type
81
+ extend ContextDev::Internal::Type::Enum
82
+
83
+ BRAND = :brand
84
+
85
+ # @!method self.values
86
+ # @return [Array<Symbol>]
87
+ end
66
88
  end
67
89
  end
68
90
  end
@@ -63,6 +63,13 @@ module ContextDev
63
63
  # @return [Integer]
64
64
  required :max_crawl_depth, Integer, api_name: :maxCrawlDepth
65
65
 
66
+ # @!attribute num_blocked
67
+ # Number of crawled pages excluded because they were anti-bot challenges, error
68
+ # pages, or parked-domain placeholders.
69
+ #
70
+ # @return [Integer]
71
+ required :num_blocked, Integer, api_name: :numBlocked
72
+
66
73
  # @!attribute num_failed
67
74
  #
68
75
  # @return [Integer]
@@ -83,11 +90,20 @@ module ContextDev
83
90
  # @return [Integer]
84
91
  required :num_urls, Integer, api_name: :numUrls
85
92
 
86
- # @!method initialize(max_crawl_depth:, num_failed:, num_skipped:, num_succeeded:, num_urls:)
93
+ # @!method initialize(max_crawl_depth:, num_blocked:, num_failed:, num_skipped:, num_succeeded:, num_urls:)
94
+ # Some parameter documentations has been truncated, see
95
+ # {ContextDev::Models::WebExtractResponse::Metadata} for more details.
96
+ #
87
97
  # @param max_crawl_depth [Integer]
98
+ #
99
+ # @param num_blocked [Integer] Number of crawled pages excluded because they were anti-bot challenges, error pa
100
+ #
88
101
  # @param num_failed [Integer]
102
+ #
89
103
  # @param num_skipped [Integer]
104
+ #
90
105
  # @param num_succeeded [Integer]
106
+ #
91
107
  # @param num_urls [Integer]
92
108
  end
93
109