context.dev 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +1 -1
- data/lib/context_dev/models/brand_retrieve_params.rb +46 -3
- data/lib/context_dev/models/monitor_create_params.rb +36 -28
- data/lib/context_dev/models/monitor_create_response.rb +158 -29
- data/lib/context_dev/models/monitor_list_account_runs_response.rb +102 -1
- data/lib/context_dev/models/monitor_list_params.rb +4 -4
- data/lib/context_dev/models/monitor_list_response.rb +158 -29
- data/lib/context_dev/models/monitor_list_runs_response.rb +100 -1
- data/lib/context_dev/models/monitor_retrieve_change_response.rb +1 -8
- data/lib/context_dev/models/monitor_retrieve_response.rb +158 -29
- data/lib/context_dev/models/monitor_update_params.rb +36 -28
- data/lib/context_dev/models/monitor_update_response.rb +158 -29
- data/lib/context_dev/resources/brand.rb +4 -2
- data/lib/context_dev/resources/monitors.rb +1 -1
- data/lib/context_dev/version.rb +1 -1
- data/rbi/context_dev/models/brand_retrieve_params.rbi +67 -0
- data/rbi/context_dev/models/monitor_create_params.rbi +44 -33
- data/rbi/context_dev/models/monitor_create_response.rbi +243 -33
- data/rbi/context_dev/models/monitor_list_account_runs_response.rbi +204 -3
- data/rbi/context_dev/models/monitor_list_params.rbi +9 -6
- data/rbi/context_dev/models/monitor_list_response.rbi +247 -33
- data/rbi/context_dev/models/monitor_list_runs_response.rbi +204 -3
- data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +0 -9
- data/rbi/context_dev/models/monitor_retrieve_response.rbi +243 -33
- data/rbi/context_dev/models/monitor_update_params.rbi +44 -33
- data/rbi/context_dev/models/monitor_update_response.rbi +243 -33
- data/rbi/context_dev/resources/brand.rbi +4 -1
- data/rbi/context_dev/resources/monitors.rbi +2 -2
- data/sig/context_dev/models/brand_retrieve_params.rbs +26 -0
- data/sig/context_dev/models/monitor_create_params.rbs +7 -17
- data/sig/context_dev/models/monitor_create_response.rbs +81 -17
- data/sig/context_dev/models/monitor_list_account_runs_response.rbs +74 -3
- data/sig/context_dev/models/monitor_list_params.rbs +2 -2
- data/sig/context_dev/models/monitor_list_response.rbs +81 -17
- data/sig/context_dev/models/monitor_list_runs_response.rbs +74 -3
- data/sig/context_dev/models/monitor_retrieve_change_response.rbs +0 -7
- data/sig/context_dev/models/monitor_retrieve_response.rbs +81 -17
- data/sig/context_dev/models/monitor_update_params.rbs +7 -17
- data/sig/context_dev/models/monitor_update_response.rbs +81 -17
- metadata +2 -2
|
@@ -106,7 +106,16 @@ module ContextDev
|
|
|
106
106
|
# @return [Time, nil]
|
|
107
107
|
optional :started_at, Time, nil?: true
|
|
108
108
|
|
|
109
|
-
# @!
|
|
109
|
+
# @!attribute webhook_delivery
|
|
110
|
+
# The webhook delivery attempted for a change detected by this run. Omitted when
|
|
111
|
+
# no webhook was attempted, including historical runs created before delivery
|
|
112
|
+
# tracking was added.
|
|
113
|
+
#
|
|
114
|
+
# @return [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery, nil]
|
|
115
|
+
optional :webhook_delivery,
|
|
116
|
+
-> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery }
|
|
117
|
+
|
|
118
|
+
# @!method initialize(id:, baseline_created:, change_detected:, change_detection_type:, credits_charged:, monitor_id:, run_type:, status:, target_type:, change_id: nil, completed_at: nil, error: nil, skip_reason: nil, started_at: nil, webhook_delivery: nil)
|
|
110
119
|
# Some parameter documentations has been truncated, see
|
|
111
120
|
# {ContextDev::Models::MonitorListAccountRunsResponse::Data} for more details.
|
|
112
121
|
#
|
|
@@ -137,6 +146,8 @@ module ContextDev
|
|
|
137
146
|
# @param skip_reason [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::SkipReason, nil] Why a skipped run never executed; null unless status is `skipped`.
|
|
138
147
|
#
|
|
139
148
|
# @param started_at [Time, nil]
|
|
149
|
+
#
|
|
150
|
+
# @param webhook_delivery [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery] The webhook delivery attempted for a change detected by this run. Omitted when n
|
|
140
151
|
|
|
141
152
|
# @see ContextDev::Models::MonitorListAccountRunsResponse::Data#change_detection_type
|
|
142
153
|
module ChangeDetectionType
|
|
@@ -221,6 +232,96 @@ module ContextDev
|
|
|
221
232
|
# @!method self.values
|
|
222
233
|
# @return [Array<Symbol>]
|
|
223
234
|
end
|
|
235
|
+
|
|
236
|
+
# @see ContextDev::Models::MonitorListAccountRunsResponse::Data#webhook_delivery
|
|
237
|
+
class WebhookDelivery < ContextDev::Internal::Type::BaseModel
|
|
238
|
+
# @!attribute attempted_at
|
|
239
|
+
#
|
|
240
|
+
# @return [Time]
|
|
241
|
+
required :attempted_at, Time
|
|
242
|
+
|
|
243
|
+
# @!attribute error
|
|
244
|
+
#
|
|
245
|
+
# @return [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error, nil]
|
|
246
|
+
required :error,
|
|
247
|
+
-> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error },
|
|
248
|
+
nil?: true
|
|
249
|
+
|
|
250
|
+
# @!attribute event_id
|
|
251
|
+
# Identifier sent in the X-Context-Id header.
|
|
252
|
+
#
|
|
253
|
+
# @return [String]
|
|
254
|
+
required :event_id, String
|
|
255
|
+
|
|
256
|
+
# @!attribute http_status
|
|
257
|
+
# The endpoint's final HTTP response status, or null when no response was
|
|
258
|
+
# received.
|
|
259
|
+
#
|
|
260
|
+
# @return [Integer, nil]
|
|
261
|
+
required :http_status, Integer, nil?: true
|
|
262
|
+
|
|
263
|
+
# @!attribute status
|
|
264
|
+
# Delivery outcome. delivered means any 2xx response; rejected means a non-2xx
|
|
265
|
+
# response; failed means no HTTP response was received; skipped_unsafe_url means
|
|
266
|
+
# the URL failed the public-endpoint safety check.
|
|
267
|
+
#
|
|
268
|
+
# @return [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status]
|
|
269
|
+
required :status,
|
|
270
|
+
enum: -> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status }
|
|
271
|
+
|
|
272
|
+
# @!method initialize(attempted_at:, error:, event_id:, http_status:, status:)
|
|
273
|
+
# Some parameter documentations has been truncated, see
|
|
274
|
+
# {ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery} for
|
|
275
|
+
# more details.
|
|
276
|
+
#
|
|
277
|
+
# The webhook delivery attempted for a change detected by this run. Omitted when
|
|
278
|
+
# no webhook was attempted, including historical runs created before delivery
|
|
279
|
+
# tracking was added.
|
|
280
|
+
#
|
|
281
|
+
# @param attempted_at [Time]
|
|
282
|
+
#
|
|
283
|
+
# @param error [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error, nil]
|
|
284
|
+
#
|
|
285
|
+
# @param event_id [String] Identifier sent in the X-Context-Id header.
|
|
286
|
+
#
|
|
287
|
+
# @param http_status [Integer, nil] The endpoint's final HTTP response status, or null when no response was received
|
|
288
|
+
#
|
|
289
|
+
# @param status [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status] Delivery outcome. delivered means any 2xx response; rejected means a non-2xx res
|
|
290
|
+
|
|
291
|
+
# @see ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery#error
|
|
292
|
+
class Error < ContextDev::Internal::Type::BaseModel
|
|
293
|
+
# @!attribute code
|
|
294
|
+
#
|
|
295
|
+
# @return [String]
|
|
296
|
+
required :code, String
|
|
297
|
+
|
|
298
|
+
# @!attribute message
|
|
299
|
+
#
|
|
300
|
+
# @return [String]
|
|
301
|
+
required :message, String
|
|
302
|
+
|
|
303
|
+
# @!method initialize(code:, message:)
|
|
304
|
+
# @param code [String]
|
|
305
|
+
# @param message [String]
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
# Delivery outcome. delivered means any 2xx response; rejected means a non-2xx
|
|
309
|
+
# response; failed means no HTTP response was received; skipped_unsafe_url means
|
|
310
|
+
# the URL failed the public-endpoint safety check.
|
|
311
|
+
#
|
|
312
|
+
# @see ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery#status
|
|
313
|
+
module Status
|
|
314
|
+
extend ContextDev::Internal::Type::Enum
|
|
315
|
+
|
|
316
|
+
DELIVERED = :delivered
|
|
317
|
+
REJECTED = :rejected
|
|
318
|
+
FAILED = :failed
|
|
319
|
+
SKIPPED_UNSAFE_URL = :skipped_unsafe_url
|
|
320
|
+
|
|
321
|
+
# @!method self.values
|
|
322
|
+
# @return [Array<Symbol>]
|
|
323
|
+
end
|
|
324
|
+
end
|
|
224
325
|
end
|
|
225
326
|
end
|
|
226
327
|
end
|
|
@@ -29,8 +29,8 @@ module ContextDev
|
|
|
29
29
|
optional :q, String
|
|
30
30
|
|
|
31
31
|
# @!attribute search_by
|
|
32
|
-
# Comma-separated fields to search with `q`. Defaults to all of them. Note
|
|
33
|
-
# only exists on
|
|
32
|
+
# Comma-separated fields to search with `q`. Defaults to all of them. Note
|
|
33
|
+
# `instructions` only exists on extract monitors.
|
|
34
34
|
#
|
|
35
35
|
# @return [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>, nil]
|
|
36
36
|
optional :search_by,
|
|
@@ -82,7 +82,7 @@ module ContextDev
|
|
|
82
82
|
#
|
|
83
83
|
# @param q [String] Free-text search term, matched against the fields named in `search_by`.
|
|
84
84
|
#
|
|
85
|
-
# @param search_by [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>] Comma-separated fields to search with `q`. Defaults to all of them. Note `
|
|
85
|
+
# @param search_by [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru
|
|
86
86
|
#
|
|
87
87
|
# @param search_type [Symbol, ContextDev::Models::MonitorListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match
|
|
88
88
|
#
|
|
@@ -111,7 +111,7 @@ module ContextDev
|
|
|
111
111
|
|
|
112
112
|
NAME = :name
|
|
113
113
|
URL = :url
|
|
114
|
-
|
|
114
|
+
INSTRUCTIONS = :instructions
|
|
115
115
|
TAGS = :tags
|
|
116
116
|
|
|
117
117
|
# @!method self.values
|
|
@@ -82,6 +82,15 @@ module ContextDev
|
|
|
82
82
|
# @return [Time]
|
|
83
83
|
required :updated_at, Time
|
|
84
84
|
|
|
85
|
+
# @!attribute baseline
|
|
86
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
87
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
88
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
89
|
+
# after a target or change_detection update, which resets the baseline).
|
|
90
|
+
#
|
|
91
|
+
# @return [ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline, nil]
|
|
92
|
+
optional :baseline, union: -> { ContextDev::Models::MonitorListResponse::Data::Baseline }, nil?: true
|
|
93
|
+
|
|
85
94
|
# @!attribute last_change_at
|
|
86
95
|
#
|
|
87
96
|
# @return [Time, nil]
|
|
@@ -115,7 +124,7 @@ module ContextDev
|
|
|
115
124
|
# @return [ContextDev::Models::MonitorListResponse::Data::Webhook, nil]
|
|
116
125
|
optional :webhook, -> { ContextDev::Models::MonitorListResponse::Data::Webhook }, nil?: true
|
|
117
126
|
|
|
118
|
-
# @!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)
|
|
127
|
+
# @!method initialize(id:, change_detection:, created_at:, mode:, name:, schedule:, status:, target:, updated_at:, baseline: nil, last_change_at: nil, last_error: nil, last_run_at: nil, next_run_at: nil, tags: nil, webhook: nil)
|
|
119
128
|
# Some parameter documentations has been truncated, see
|
|
120
129
|
# {ContextDev::Models::MonitorListResponse::Data} for more details.
|
|
121
130
|
#
|
|
@@ -140,6 +149,8 @@ module ContextDev
|
|
|
140
149
|
#
|
|
141
150
|
# @param updated_at [Time]
|
|
142
151
|
#
|
|
152
|
+
# @param baseline [ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline, nil] Current baseline: the last observed value the monitor compares new snapshots aga
|
|
153
|
+
#
|
|
143
154
|
# @param last_change_at [Time, nil]
|
|
144
155
|
#
|
|
145
156
|
# @param last_error [ContextDev::Models::MonitorListResponse::Data::LastError, nil] Error from the most recent failed run; null when the last run succeeded.
|
|
@@ -163,7 +174,7 @@ module ContextDev
|
|
|
163
174
|
# Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
|
|
164
175
|
variant :exact, -> { ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact }
|
|
165
176
|
|
|
166
|
-
# Detect meaning-level changes
|
|
177
|
+
# Detect meaning-level changes to tracked page content, ignoring cosmetic or paraphrase-only differences. Which changes are meaningful is judged against the extract target's `instructions` (and `schema`, when provided).
|
|
167
178
|
variant :semantic, -> { ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic }
|
|
168
179
|
|
|
169
180
|
class Exact < ContextDev::Internal::Type::BaseModel
|
|
@@ -180,11 +191,6 @@ module ContextDev
|
|
|
180
191
|
end
|
|
181
192
|
|
|
182
193
|
class Semantic < ContextDev::Internal::Type::BaseModel
|
|
183
|
-
# @!attribute query
|
|
184
|
-
#
|
|
185
|
-
# @return [String]
|
|
186
|
-
required :query, String
|
|
187
|
-
|
|
188
194
|
# @!attribute type
|
|
189
195
|
#
|
|
190
196
|
# @return [Symbol, :semantic]
|
|
@@ -195,10 +201,11 @@ module ContextDev
|
|
|
195
201
|
# @return [Float, nil]
|
|
196
202
|
optional :confidence_threshold, Float
|
|
197
203
|
|
|
198
|
-
# @!method initialize(
|
|
199
|
-
# Detect meaning-level changes
|
|
204
|
+
# @!method initialize(confidence_threshold: nil, type: :semantic)
|
|
205
|
+
# Detect meaning-level changes to tracked page content, ignoring cosmetic or
|
|
206
|
+
# paraphrase-only differences. Which changes are meaningful is judged against the
|
|
207
|
+
# extract target's `instructions` (and `schema`, when provided).
|
|
200
208
|
#
|
|
201
|
-
# @param query [String]
|
|
202
209
|
# @param confidence_threshold [Float]
|
|
203
210
|
# @param type [Symbol, :semantic]
|
|
204
211
|
end
|
|
@@ -306,10 +313,10 @@ module ContextDev
|
|
|
306
313
|
# Watch a single web page.
|
|
307
314
|
variant :page, -> { ContextDev::Models::MonitorListResponse::Data::Target::Page }
|
|
308
315
|
|
|
309
|
-
# 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.
|
|
316
|
+
# 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. On a detected difference the sitemap is re-fetched within the same run and only URLs both observations agree on are reported, suppressing transient crawl flaps.
|
|
310
317
|
variant :sitemap, -> { ContextDev::Models::MonitorListResponse::Data::Target::Sitemap }
|
|
311
318
|
|
|
312
|
-
# Watch a site's
|
|
319
|
+
# Watch the monitor-relevant pages of a site for meaningful changes. A crawl guided by `schema`/`instructions` selects up to `max_pages` relevant pages to track; each run re-checks exactly those pages, and confirmed content changes are judged for relevance against the monitor's `instructions` (and `schema`, when provided). The tracked page set is refreshed by a periodic re-discovery crawl.
|
|
313
320
|
variant :extract, -> { ContextDev::Models::MonitorListResponse::Data::Target::Extract }
|
|
314
321
|
|
|
315
322
|
class Page < ContextDev::Internal::Type::BaseModel
|
|
@@ -372,8 +379,9 @@ module ContextDev
|
|
|
372
379
|
# @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
|
|
373
380
|
# Watch a sitemap for URL additions and removals. Crawled URLs are normalized
|
|
374
381
|
# (lowercased host, no trailing slash/fragment) and scoped to the monitored site
|
|
375
|
-
# and its subdomains before comparison.
|
|
376
|
-
#
|
|
382
|
+
# and its subdomains before comparison. On a detected difference the sitemap is
|
|
383
|
+
# re-fetched within the same run and only URLs both observations agree on are
|
|
384
|
+
# reported, suppressing transient crawl flaps.
|
|
377
385
|
#
|
|
378
386
|
# @param url [String] Sitemap URL to monitor.
|
|
379
387
|
#
|
|
@@ -387,6 +395,13 @@ module ContextDev
|
|
|
387
395
|
end
|
|
388
396
|
|
|
389
397
|
class Extract < ContextDev::Internal::Type::BaseModel
|
|
398
|
+
# @!attribute instructions
|
|
399
|
+
# Natural-language instructions guiding which pages and facts to track and which
|
|
400
|
+
# changes to report.
|
|
401
|
+
#
|
|
402
|
+
# @return [String]
|
|
403
|
+
required :instructions, String
|
|
404
|
+
|
|
390
405
|
# @!attribute type
|
|
391
406
|
#
|
|
392
407
|
# @return [Symbol, :extract]
|
|
@@ -403,12 +418,6 @@ module ContextDev
|
|
|
403
418
|
# @return [Boolean, nil]
|
|
404
419
|
optional :follow_subdomains, ContextDev::Internal::Type::Boolean
|
|
405
420
|
|
|
406
|
-
# @!attribute instructions
|
|
407
|
-
# Optional natural-language instructions guiding what to extract.
|
|
408
|
-
#
|
|
409
|
-
# @return [String, nil]
|
|
410
|
-
optional :instructions, String
|
|
411
|
-
|
|
412
421
|
# @!attribute max_depth
|
|
413
422
|
# Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
414
423
|
#
|
|
@@ -416,36 +425,46 @@ module ContextDev
|
|
|
416
425
|
optional :max_depth, Integer
|
|
417
426
|
|
|
418
427
|
# @!attribute max_pages
|
|
419
|
-
# Maximum number of pages to
|
|
428
|
+
# Maximum number of pages to track.
|
|
420
429
|
#
|
|
421
430
|
# @return [Integer, nil]
|
|
422
431
|
optional :max_pages, Integer
|
|
423
432
|
|
|
424
433
|
# @!attribute schema
|
|
425
|
-
# JSON Schema describing the
|
|
426
|
-
#
|
|
434
|
+
# JSON Schema describing the data you care about. It is used three ways: it guides
|
|
435
|
+
# which pages are selected for tracking, it gives the change judge extra context
|
|
436
|
+
# on which changes matter (alongside `instructions`), and it defines the shape of
|
|
437
|
+
# the baseline `data` snapshot on GET /monitors/{monitor_id} (refreshed at most
|
|
438
|
+
# about once a day). It is not a response format for changes: change events and
|
|
439
|
+
# webhook payloads always contain diffs, summaries, and evidence excerpts — never
|
|
440
|
+
# data in this schema's shape. If omitted, a default summary + key-points schema
|
|
441
|
+
# is used.
|
|
427
442
|
#
|
|
428
443
|
# @return [Hash{Symbol=>Object}, nil]
|
|
429
444
|
optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
|
|
430
445
|
|
|
431
|
-
# @!method initialize(url:, follow_subdomains: nil,
|
|
446
|
+
# @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
|
|
432
447
|
# Some parameter documentations has been truncated, see
|
|
433
448
|
# {ContextDev::Models::MonitorListResponse::Data::Target::Extract} for more
|
|
434
449
|
# details.
|
|
435
450
|
#
|
|
436
|
-
# Watch a site
|
|
451
|
+
# Watch the monitor-relevant pages of a site for meaningful changes. A crawl
|
|
452
|
+
# guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
|
|
453
|
+
# track; each run re-checks exactly those pages, and confirmed content changes are
|
|
454
|
+
# judged for relevance against the monitor's `instructions` (and `schema`, when
|
|
455
|
+
# provided). The tracked page set is refreshed by a periodic re-discovery crawl.
|
|
456
|
+
#
|
|
457
|
+
# @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
|
|
437
458
|
#
|
|
438
459
|
# @param url [String] Root URL to extract structured data from.
|
|
439
460
|
#
|
|
440
461
|
# @param follow_subdomains [Boolean]
|
|
441
462
|
#
|
|
442
|
-
# @param instructions [String] Optional natural-language instructions guiding what to extract.
|
|
443
|
-
#
|
|
444
463
|
# @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
445
464
|
#
|
|
446
|
-
# @param max_pages [Integer] Maximum number of pages to
|
|
465
|
+
# @param max_pages [Integer] Maximum number of pages to track.
|
|
447
466
|
#
|
|
448
|
-
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the
|
|
467
|
+
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It is used three ways: it guides
|
|
449
468
|
#
|
|
450
469
|
# @param type [Symbol, :extract]
|
|
451
470
|
end
|
|
@@ -454,6 +473,116 @@ module ContextDev
|
|
|
454
473
|
# @return [Array(ContextDev::Models::MonitorListResponse::Data::Target::Page, ContextDev::Models::MonitorListResponse::Data::Target::Sitemap, ContextDev::Models::MonitorListResponse::Data::Target::Extract)]
|
|
455
474
|
end
|
|
456
475
|
|
|
476
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
477
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
478
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
479
|
+
# after a target or change_detection update, which resets the baseline).
|
|
480
|
+
#
|
|
481
|
+
# @see ContextDev::Models::MonitorListResponse::Data#baseline
|
|
482
|
+
module Baseline
|
|
483
|
+
extend ContextDev::Internal::Type::Union
|
|
484
|
+
|
|
485
|
+
# Current baseline of a `page` monitor: the visible page text as last observed.
|
|
486
|
+
variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline }
|
|
487
|
+
|
|
488
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
|
|
489
|
+
variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline }
|
|
490
|
+
|
|
491
|
+
# Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.
|
|
492
|
+
variant -> { ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline }
|
|
493
|
+
|
|
494
|
+
class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel
|
|
495
|
+
# @!attribute captured_at
|
|
496
|
+
# When this baseline was last captured or replaced.
|
|
497
|
+
#
|
|
498
|
+
# @return [Time]
|
|
499
|
+
required :captured_at, Time
|
|
500
|
+
|
|
501
|
+
# @!attribute text
|
|
502
|
+
# The page's visible text as last observed.
|
|
503
|
+
#
|
|
504
|
+
# @return [String]
|
|
505
|
+
required :text, String
|
|
506
|
+
|
|
507
|
+
# @!method initialize(captured_at:, text:)
|
|
508
|
+
# Current baseline of a `page` monitor: the visible page text as last observed.
|
|
509
|
+
#
|
|
510
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
511
|
+
#
|
|
512
|
+
# @param text [String] The page's visible text as last observed.
|
|
513
|
+
end
|
|
514
|
+
|
|
515
|
+
class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel
|
|
516
|
+
# @!attribute captured_at
|
|
517
|
+
# When this baseline was last captured or replaced.
|
|
518
|
+
#
|
|
519
|
+
# @return [Time]
|
|
520
|
+
required :captured_at, Time
|
|
521
|
+
|
|
522
|
+
# @!attribute url_count
|
|
523
|
+
# Number of URLs in the baseline.
|
|
524
|
+
#
|
|
525
|
+
# @return [Integer]
|
|
526
|
+
required :url_count, Integer
|
|
527
|
+
|
|
528
|
+
# @!attribute urls
|
|
529
|
+
# The sitemap URLs as last observed (sorted, normalized).
|
|
530
|
+
#
|
|
531
|
+
# @return [Array<String>]
|
|
532
|
+
required :urls, ContextDev::Internal::Type::ArrayOf[String]
|
|
533
|
+
|
|
534
|
+
# @!method initialize(captured_at:, url_count:, urls:)
|
|
535
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last
|
|
536
|
+
# observed.
|
|
537
|
+
#
|
|
538
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
539
|
+
#
|
|
540
|
+
# @param url_count [Integer] Number of URLs in the baseline.
|
|
541
|
+
#
|
|
542
|
+
# @param urls [Array<String>] The sitemap URLs as last observed (sorted, normalized).
|
|
543
|
+
end
|
|
544
|
+
|
|
545
|
+
class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel
|
|
546
|
+
# @!attribute captured_at
|
|
547
|
+
# When this baseline was last captured or replaced.
|
|
548
|
+
#
|
|
549
|
+
# @return [Time]
|
|
550
|
+
required :captured_at, Time
|
|
551
|
+
|
|
552
|
+
# @!attribute data
|
|
553
|
+
# The extracted structured data, matching the monitor's extraction schema (same
|
|
554
|
+
# shape as the /web/extract endpoint's `data`). Refreshed when the monitor
|
|
555
|
+
# re-discovers its page set (at most about once a day); `null` when no extraction
|
|
556
|
+
# has been captured yet.
|
|
557
|
+
#
|
|
558
|
+
# @return [Object]
|
|
559
|
+
required :data, ContextDev::Internal::Type::Unknown
|
|
560
|
+
|
|
561
|
+
# @!attribute urls_analyzed
|
|
562
|
+
# The page URLs the monitor tracks and analyzes for changes.
|
|
563
|
+
#
|
|
564
|
+
# @return [Array<String>]
|
|
565
|
+
required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String]
|
|
566
|
+
|
|
567
|
+
# @!method initialize(captured_at:, data:, urls_analyzed:)
|
|
568
|
+
# Some parameter documentations has been truncated, see
|
|
569
|
+
# {ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline}
|
|
570
|
+
# for more details.
|
|
571
|
+
#
|
|
572
|
+
# Current baseline of an `extract` monitor: the pages it tracks and the structured
|
|
573
|
+
# data as last extracted.
|
|
574
|
+
#
|
|
575
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
576
|
+
#
|
|
577
|
+
# @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh
|
|
578
|
+
#
|
|
579
|
+
# @param urls_analyzed [Array<String>] The page URLs the monitor tracks and analyzes for changes.
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
# @!method self.variants
|
|
583
|
+
# @return [Array(ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline)]
|
|
584
|
+
end
|
|
585
|
+
|
|
457
586
|
# @see ContextDev::Models::MonitorListResponse::Data#last_error
|
|
458
587
|
class LastError < ContextDev::Internal::Type::BaseModel
|
|
459
588
|
# @!attribute code
|
|
@@ -106,7 +106,15 @@ module ContextDev
|
|
|
106
106
|
# @return [Time, nil]
|
|
107
107
|
optional :started_at, Time, nil?: true
|
|
108
108
|
|
|
109
|
-
# @!
|
|
109
|
+
# @!attribute webhook_delivery
|
|
110
|
+
# The webhook delivery attempted for a change detected by this run. Omitted when
|
|
111
|
+
# no webhook was attempted, including historical runs created before delivery
|
|
112
|
+
# tracking was added.
|
|
113
|
+
#
|
|
114
|
+
# @return [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery, nil]
|
|
115
|
+
optional :webhook_delivery, -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery }
|
|
116
|
+
|
|
117
|
+
# @!method initialize(id:, baseline_created:, change_detected:, change_detection_type:, credits_charged:, monitor_id:, run_type:, status:, target_type:, change_id: nil, completed_at: nil, error: nil, skip_reason: nil, started_at: nil, webhook_delivery: nil)
|
|
110
118
|
# Some parameter documentations has been truncated, see
|
|
111
119
|
# {ContextDev::Models::MonitorListRunsResponse::Data} for more details.
|
|
112
120
|
#
|
|
@@ -137,6 +145,8 @@ module ContextDev
|
|
|
137
145
|
# @param skip_reason [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::SkipReason, nil] Why a skipped run never executed; null unless status is `skipped`.
|
|
138
146
|
#
|
|
139
147
|
# @param started_at [Time, nil]
|
|
148
|
+
#
|
|
149
|
+
# @param webhook_delivery [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery] The webhook delivery attempted for a change detected by this run. Omitted when n
|
|
140
150
|
|
|
141
151
|
# @see ContextDev::Models::MonitorListRunsResponse::Data#change_detection_type
|
|
142
152
|
module ChangeDetectionType
|
|
@@ -221,6 +231,95 @@ module ContextDev
|
|
|
221
231
|
# @!method self.values
|
|
222
232
|
# @return [Array<Symbol>]
|
|
223
233
|
end
|
|
234
|
+
|
|
235
|
+
# @see ContextDev::Models::MonitorListRunsResponse::Data#webhook_delivery
|
|
236
|
+
class WebhookDelivery < ContextDev::Internal::Type::BaseModel
|
|
237
|
+
# @!attribute attempted_at
|
|
238
|
+
#
|
|
239
|
+
# @return [Time]
|
|
240
|
+
required :attempted_at, Time
|
|
241
|
+
|
|
242
|
+
# @!attribute error
|
|
243
|
+
#
|
|
244
|
+
# @return [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error, nil]
|
|
245
|
+
required :error,
|
|
246
|
+
-> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error },
|
|
247
|
+
nil?: true
|
|
248
|
+
|
|
249
|
+
# @!attribute event_id
|
|
250
|
+
# Identifier sent in the X-Context-Id header.
|
|
251
|
+
#
|
|
252
|
+
# @return [String]
|
|
253
|
+
required :event_id, String
|
|
254
|
+
|
|
255
|
+
# @!attribute http_status
|
|
256
|
+
# The endpoint's final HTTP response status, or null when no response was
|
|
257
|
+
# received.
|
|
258
|
+
#
|
|
259
|
+
# @return [Integer, nil]
|
|
260
|
+
required :http_status, Integer, nil?: true
|
|
261
|
+
|
|
262
|
+
# @!attribute status
|
|
263
|
+
# Delivery outcome. delivered means any 2xx response; rejected means a non-2xx
|
|
264
|
+
# response; failed means no HTTP response was received; skipped_unsafe_url means
|
|
265
|
+
# the URL failed the public-endpoint safety check.
|
|
266
|
+
#
|
|
267
|
+
# @return [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status]
|
|
268
|
+
required :status, enum: -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status }
|
|
269
|
+
|
|
270
|
+
# @!method initialize(attempted_at:, error:, event_id:, http_status:, status:)
|
|
271
|
+
# Some parameter documentations has been truncated, see
|
|
272
|
+
# {ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery} for more
|
|
273
|
+
# details.
|
|
274
|
+
#
|
|
275
|
+
# The webhook delivery attempted for a change detected by this run. Omitted when
|
|
276
|
+
# no webhook was attempted, including historical runs created before delivery
|
|
277
|
+
# tracking was added.
|
|
278
|
+
#
|
|
279
|
+
# @param attempted_at [Time]
|
|
280
|
+
#
|
|
281
|
+
# @param error [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error, nil]
|
|
282
|
+
#
|
|
283
|
+
# @param event_id [String] Identifier sent in the X-Context-Id header.
|
|
284
|
+
#
|
|
285
|
+
# @param http_status [Integer, nil] The endpoint's final HTTP response status, or null when no response was received
|
|
286
|
+
#
|
|
287
|
+
# @param status [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status] Delivery outcome. delivered means any 2xx response; rejected means a non-2xx res
|
|
288
|
+
|
|
289
|
+
# @see ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery#error
|
|
290
|
+
class Error < ContextDev::Internal::Type::BaseModel
|
|
291
|
+
# @!attribute code
|
|
292
|
+
#
|
|
293
|
+
# @return [String]
|
|
294
|
+
required :code, String
|
|
295
|
+
|
|
296
|
+
# @!attribute message
|
|
297
|
+
#
|
|
298
|
+
# @return [String]
|
|
299
|
+
required :message, String
|
|
300
|
+
|
|
301
|
+
# @!method initialize(code:, message:)
|
|
302
|
+
# @param code [String]
|
|
303
|
+
# @param message [String]
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Delivery outcome. delivered means any 2xx response; rejected means a non-2xx
|
|
307
|
+
# response; failed means no HTTP response was received; skipped_unsafe_url means
|
|
308
|
+
# the URL failed the public-endpoint safety check.
|
|
309
|
+
#
|
|
310
|
+
# @see ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery#status
|
|
311
|
+
module Status
|
|
312
|
+
extend ContextDev::Internal::Type::Enum
|
|
313
|
+
|
|
314
|
+
DELIVERED = :delivered
|
|
315
|
+
REJECTED = :rejected
|
|
316
|
+
FAILED = :failed
|
|
317
|
+
SKIPPED_UNSAFE_URL = :skipped_unsafe_url
|
|
318
|
+
|
|
319
|
+
# @!method self.values
|
|
320
|
+
# @return [Array<Symbol>]
|
|
321
|
+
end
|
|
322
|
+
end
|
|
224
323
|
end
|
|
225
324
|
end
|
|
226
325
|
end
|
|
@@ -112,11 +112,6 @@ module ContextDev
|
|
|
112
112
|
# @return [Array<String>, nil]
|
|
113
113
|
optional :matched_urls, ContextDev::Internal::Type::ArrayOf[String]
|
|
114
114
|
|
|
115
|
-
# @!attribute query
|
|
116
|
-
#
|
|
117
|
-
# @return [String, nil]
|
|
118
|
-
optional :query, String
|
|
119
|
-
|
|
120
115
|
# @!attribute removed_url_count
|
|
121
116
|
#
|
|
122
117
|
# @return [Integer, nil]
|
|
@@ -134,7 +129,7 @@ module ContextDev
|
|
|
134
129
|
# @return [Array<String>, nil]
|
|
135
130
|
optional :tags, ContextDev::Internal::Type::ArrayOf[String]
|
|
136
131
|
|
|
137
|
-
# @!method initialize(id:, change_detection_type:, detected_at:, mode:, monitor_id:, run_id:, summary:, target_type:, title:, url:, added_url_count: nil, added_urls: nil, after_text_excerpt: nil, before_text_excerpt: nil, confidence: nil, diff: nil, evidence: nil, importance: nil, matched_url_count: nil, matched_urls: nil,
|
|
132
|
+
# @!method initialize(id:, change_detection_type:, detected_at:, mode:, monitor_id:, run_id:, summary:, target_type:, title:, url:, added_url_count: nil, added_urls: nil, after_text_excerpt: nil, before_text_excerpt: nil, confidence: nil, diff: nil, evidence: nil, importance: nil, matched_url_count: nil, matched_urls: nil, removed_url_count: nil, removed_urls: nil, tags: nil)
|
|
138
133
|
# Some parameter documentations has been truncated, see
|
|
139
134
|
# {ContextDev::Models::MonitorRetrieveChangeResponse} for more details.
|
|
140
135
|
#
|
|
@@ -184,8 +179,6 @@ module ContextDev
|
|
|
184
179
|
#
|
|
185
180
|
# @param matched_urls [Array<String>] At most 500 URLs are included; the corresponding count field is always exact.
|
|
186
181
|
#
|
|
187
|
-
# @param query [String]
|
|
188
|
-
#
|
|
189
182
|
# @param removed_url_count [Integer]
|
|
190
183
|
#
|
|
191
184
|
# @param removed_urls [Array<String>] At most 500 URLs are included; the corresponding count field is always exact.
|