context.dev 2.0.0 → 2.1.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 +11 -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 +30 -27
- data/lib/context_dev/models/monitor_create_response.rb +152 -28
- data/lib/context_dev/models/monitor_list_params.rb +4 -4
- data/lib/context_dev/models/monitor_list_response.rb +152 -28
- data/lib/context_dev/models/monitor_retrieve_change_response.rb +1 -8
- data/lib/context_dev/models/monitor_retrieve_response.rb +152 -28
- data/lib/context_dev/models/monitor_update_params.rb +30 -27
- data/lib/context_dev/models/monitor_update_response.rb +152 -28
- 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 +32 -31
- data/rbi/context_dev/models/monitor_create_response.rbi +231 -31
- data/rbi/context_dev/models/monitor_list_params.rbi +9 -6
- data/rbi/context_dev/models/monitor_list_response.rbi +235 -31
- data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +0 -9
- data/rbi/context_dev/models/monitor_retrieve_response.rbi +231 -31
- data/rbi/context_dev/models/monitor_update_params.rbi +32 -31
- data/rbi/context_dev/models/monitor_update_response.rbi +231 -31
- 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_params.rbs +2 -2
- data/sig/context_dev/models/monitor_list_response.rbs +81 -17
- 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
|
@@ -85,7 +85,7 @@ module ContextDev
|
|
|
85
85
|
# Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
|
|
86
86
|
variant :exact, -> { ContextDev::MonitorUpdateParams::ChangeDetection::Exact }
|
|
87
87
|
|
|
88
|
-
# Detect meaning-level changes
|
|
88
|
+
# Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
|
|
89
89
|
variant :semantic, -> { ContextDev::MonitorUpdateParams::ChangeDetection::Semantic }
|
|
90
90
|
|
|
91
91
|
class Exact < ContextDev::Internal::Type::BaseModel
|
|
@@ -102,11 +102,6 @@ module ContextDev
|
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
class Semantic < ContextDev::Internal::Type::BaseModel
|
|
105
|
-
# @!attribute query
|
|
106
|
-
#
|
|
107
|
-
# @return [String]
|
|
108
|
-
required :query, String
|
|
109
|
-
|
|
110
105
|
# @!attribute type
|
|
111
106
|
#
|
|
112
107
|
# @return [Symbol, :semantic]
|
|
@@ -117,10 +112,11 @@ module ContextDev
|
|
|
117
112
|
# @return [Float, nil]
|
|
118
113
|
optional :confidence_threshold, Float
|
|
119
114
|
|
|
120
|
-
# @!method initialize(
|
|
121
|
-
# Detect meaning-level changes
|
|
115
|
+
# @!method initialize(confidence_threshold: nil, type: :semantic)
|
|
116
|
+
# Detect meaning-level changes to the extracted data, ignoring cosmetic or
|
|
117
|
+
# paraphrase-only differences. What is watched is determined by the extract
|
|
118
|
+
# target's `schema` and `instructions`.
|
|
122
119
|
#
|
|
123
|
-
# @param query [String]
|
|
124
120
|
# @param confidence_threshold [Float]
|
|
125
121
|
# @param type [Symbol, :semantic]
|
|
126
122
|
end
|
|
@@ -204,10 +200,10 @@ module ContextDev
|
|
|
204
200
|
# Watch a single web page.
|
|
205
201
|
variant :page, -> { ContextDev::MonitorUpdateParams::Target::Page }
|
|
206
202
|
|
|
207
|
-
# 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.
|
|
203
|
+
# 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.
|
|
208
204
|
variant :sitemap, -> { ContextDev::MonitorUpdateParams::Target::Sitemap }
|
|
209
205
|
|
|
210
|
-
# Watch a site's
|
|
206
|
+
# 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 against the monitor's instructions. The tracked page set is refreshed by a periodic re-discovery crawl.
|
|
211
207
|
variant :extract, -> { ContextDev::MonitorUpdateParams::Target::Extract }
|
|
212
208
|
|
|
213
209
|
class Page < ContextDev::Internal::Type::BaseModel
|
|
@@ -270,8 +266,9 @@ module ContextDev
|
|
|
270
266
|
# @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
|
|
271
267
|
# Watch a sitemap for URL additions and removals. Crawled URLs are normalized
|
|
272
268
|
# (lowercased host, no trailing slash/fragment) and scoped to the monitored site
|
|
273
|
-
# and its subdomains before comparison.
|
|
274
|
-
#
|
|
269
|
+
# and its subdomains before comparison. On a detected difference the sitemap is
|
|
270
|
+
# re-fetched within the same run and only URLs both observations agree on are
|
|
271
|
+
# reported, suppressing transient crawl flaps.
|
|
275
272
|
#
|
|
276
273
|
# @param url [String] Sitemap URL to monitor.
|
|
277
274
|
#
|
|
@@ -285,6 +282,13 @@ module ContextDev
|
|
|
285
282
|
end
|
|
286
283
|
|
|
287
284
|
class Extract < ContextDev::Internal::Type::BaseModel
|
|
285
|
+
# @!attribute instructions
|
|
286
|
+
# Natural-language instructions guiding which pages and facts to track and which
|
|
287
|
+
# changes to report.
|
|
288
|
+
#
|
|
289
|
+
# @return [String]
|
|
290
|
+
required :instructions, String
|
|
291
|
+
|
|
288
292
|
# @!attribute type
|
|
289
293
|
#
|
|
290
294
|
# @return [Symbol, :extract]
|
|
@@ -301,12 +305,6 @@ module ContextDev
|
|
|
301
305
|
# @return [Boolean, nil]
|
|
302
306
|
optional :follow_subdomains, ContextDev::Internal::Type::Boolean
|
|
303
307
|
|
|
304
|
-
# @!attribute instructions
|
|
305
|
-
# Optional natural-language instructions guiding what to extract.
|
|
306
|
-
#
|
|
307
|
-
# @return [String, nil]
|
|
308
|
-
optional :instructions, String
|
|
309
|
-
|
|
310
308
|
# @!attribute max_depth
|
|
311
309
|
# Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
312
310
|
#
|
|
@@ -314,35 +312,40 @@ module ContextDev
|
|
|
314
312
|
optional :max_depth, Integer
|
|
315
313
|
|
|
316
314
|
# @!attribute max_pages
|
|
317
|
-
# Maximum number of pages to
|
|
315
|
+
# Maximum number of pages to track.
|
|
318
316
|
#
|
|
319
317
|
# @return [Integer, nil]
|
|
320
318
|
optional :max_pages, Integer
|
|
321
319
|
|
|
322
320
|
# @!attribute schema
|
|
323
|
-
# JSON Schema describing the
|
|
321
|
+
# JSON Schema describing the data you care about. It guides which pages are
|
|
322
|
+
# selected for tracking and gives the change judge context on what matters. If
|
|
324
323
|
# omitted, a default summary + key-points schema is used.
|
|
325
324
|
#
|
|
326
325
|
# @return [Hash{Symbol=>Object}, nil]
|
|
327
326
|
optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
|
|
328
327
|
|
|
329
|
-
# @!method initialize(url:, follow_subdomains: nil,
|
|
328
|
+
# @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
|
|
330
329
|
# Some parameter documentations has been truncated, see
|
|
331
330
|
# {ContextDev::Models::MonitorUpdateParams::Target::Extract} for more details.
|
|
332
331
|
#
|
|
333
|
-
# Watch a site
|
|
332
|
+
# Watch the monitor-relevant pages of a site for meaningful changes. A crawl
|
|
333
|
+
# guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
|
|
334
|
+
# track; each run re-checks exactly those pages, and confirmed content changes are
|
|
335
|
+
# judged against the monitor's instructions. The tracked page set is refreshed by
|
|
336
|
+
# a periodic re-discovery crawl.
|
|
337
|
+
#
|
|
338
|
+
# @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
|
|
334
339
|
#
|
|
335
340
|
# @param url [String] Root URL to extract structured data from.
|
|
336
341
|
#
|
|
337
342
|
# @param follow_subdomains [Boolean]
|
|
338
343
|
#
|
|
339
|
-
# @param instructions [String] Optional natural-language instructions guiding what to extract.
|
|
340
|
-
#
|
|
341
344
|
# @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
342
345
|
#
|
|
343
|
-
# @param max_pages [Integer] Maximum number of pages to
|
|
346
|
+
# @param max_pages [Integer] Maximum number of pages to track.
|
|
344
347
|
#
|
|
345
|
-
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the
|
|
348
|
+
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select
|
|
346
349
|
#
|
|
347
350
|
# @param type [Symbol, :extract]
|
|
348
351
|
end
|
|
@@ -61,6 +61,15 @@ module ContextDev
|
|
|
61
61
|
# @return [Time]
|
|
62
62
|
required :updated_at, Time
|
|
63
63
|
|
|
64
|
+
# @!attribute baseline
|
|
65
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
66
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
67
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
68
|
+
# after a target or change_detection update, which resets the baseline).
|
|
69
|
+
#
|
|
70
|
+
# @return [ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline, nil]
|
|
71
|
+
optional :baseline, union: -> { ContextDev::Models::MonitorUpdateResponse::Baseline }, nil?: true
|
|
72
|
+
|
|
64
73
|
# @!attribute last_change_at
|
|
65
74
|
#
|
|
66
75
|
# @return [Time, nil]
|
|
@@ -94,7 +103,7 @@ module ContextDev
|
|
|
94
103
|
# @return [ContextDev::Models::MonitorUpdateResponse::Webhook, nil]
|
|
95
104
|
optional :webhook, -> { ContextDev::Models::MonitorUpdateResponse::Webhook }, nil?: true
|
|
96
105
|
|
|
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)
|
|
106
|
+
# @!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)
|
|
98
107
|
# Some parameter documentations has been truncated, see
|
|
99
108
|
# {ContextDev::Models::MonitorUpdateResponse} for more details.
|
|
100
109
|
#
|
|
@@ -119,6 +128,8 @@ module ContextDev
|
|
|
119
128
|
#
|
|
120
129
|
# @param updated_at [Time]
|
|
121
130
|
#
|
|
131
|
+
# @param baseline [ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline, nil] Current baseline: the last observed value the monitor compares new snapshots aga
|
|
132
|
+
#
|
|
122
133
|
# @param last_change_at [Time, nil]
|
|
123
134
|
#
|
|
124
135
|
# @param last_error [ContextDev::Models::MonitorUpdateResponse::LastError, nil] Error from the most recent failed run; null when the last run succeeded.
|
|
@@ -142,7 +153,7 @@ module ContextDev
|
|
|
142
153
|
# Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.
|
|
143
154
|
variant :exact, -> { ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Exact }
|
|
144
155
|
|
|
145
|
-
# Detect meaning-level changes
|
|
156
|
+
# Detect meaning-level changes to the extracted data, ignoring cosmetic or paraphrase-only differences. What is watched is determined by the extract target's `schema` and `instructions`.
|
|
146
157
|
variant :semantic, -> { ContextDev::Models::MonitorUpdateResponse::ChangeDetection::Semantic }
|
|
147
158
|
|
|
148
159
|
class Exact < ContextDev::Internal::Type::BaseModel
|
|
@@ -159,11 +170,6 @@ module ContextDev
|
|
|
159
170
|
end
|
|
160
171
|
|
|
161
172
|
class Semantic < ContextDev::Internal::Type::BaseModel
|
|
162
|
-
# @!attribute query
|
|
163
|
-
#
|
|
164
|
-
# @return [String]
|
|
165
|
-
required :query, String
|
|
166
|
-
|
|
167
173
|
# @!attribute type
|
|
168
174
|
#
|
|
169
175
|
# @return [Symbol, :semantic]
|
|
@@ -174,10 +180,11 @@ module ContextDev
|
|
|
174
180
|
# @return [Float, nil]
|
|
175
181
|
optional :confidence_threshold, Float
|
|
176
182
|
|
|
177
|
-
# @!method initialize(
|
|
178
|
-
# Detect meaning-level changes
|
|
183
|
+
# @!method initialize(confidence_threshold: nil, type: :semantic)
|
|
184
|
+
# Detect meaning-level changes to the extracted data, ignoring cosmetic or
|
|
185
|
+
# paraphrase-only differences. What is watched is determined by the extract
|
|
186
|
+
# target's `schema` and `instructions`.
|
|
179
187
|
#
|
|
180
|
-
# @param query [String]
|
|
181
188
|
# @param confidence_threshold [Float]
|
|
182
189
|
# @param type [Symbol, :semantic]
|
|
183
190
|
end
|
|
@@ -285,10 +292,10 @@ module ContextDev
|
|
|
285
292
|
# Watch a single web page.
|
|
286
293
|
variant :page, -> { ContextDev::Models::MonitorUpdateResponse::Target::Page }
|
|
287
294
|
|
|
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.
|
|
295
|
+
# 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.
|
|
289
296
|
variant :sitemap, -> { ContextDev::Models::MonitorUpdateResponse::Target::Sitemap }
|
|
290
297
|
|
|
291
|
-
# Watch a site's
|
|
298
|
+
# 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 against the monitor's instructions. The tracked page set is refreshed by a periodic re-discovery crawl.
|
|
292
299
|
variant :extract, -> { ContextDev::Models::MonitorUpdateResponse::Target::Extract }
|
|
293
300
|
|
|
294
301
|
class Page < ContextDev::Internal::Type::BaseModel
|
|
@@ -351,8 +358,9 @@ module ContextDev
|
|
|
351
358
|
# @!method initialize(url:, exclude: nil, include: nil, max_urls: nil, type: :sitemap)
|
|
352
359
|
# Watch a sitemap for URL additions and removals. Crawled URLs are normalized
|
|
353
360
|
# (lowercased host, no trailing slash/fragment) and scoped to the monitored site
|
|
354
|
-
# and its subdomains before comparison.
|
|
355
|
-
#
|
|
361
|
+
# and its subdomains before comparison. On a detected difference the sitemap is
|
|
362
|
+
# re-fetched within the same run and only URLs both observations agree on are
|
|
363
|
+
# reported, suppressing transient crawl flaps.
|
|
356
364
|
#
|
|
357
365
|
# @param url [String] Sitemap URL to monitor.
|
|
358
366
|
#
|
|
@@ -366,6 +374,13 @@ module ContextDev
|
|
|
366
374
|
end
|
|
367
375
|
|
|
368
376
|
class Extract < ContextDev::Internal::Type::BaseModel
|
|
377
|
+
# @!attribute instructions
|
|
378
|
+
# Natural-language instructions guiding which pages and facts to track and which
|
|
379
|
+
# changes to report.
|
|
380
|
+
#
|
|
381
|
+
# @return [String]
|
|
382
|
+
required :instructions, String
|
|
383
|
+
|
|
369
384
|
# @!attribute type
|
|
370
385
|
#
|
|
371
386
|
# @return [Symbol, :extract]
|
|
@@ -382,12 +397,6 @@ module ContextDev
|
|
|
382
397
|
# @return [Boolean, nil]
|
|
383
398
|
optional :follow_subdomains, ContextDev::Internal::Type::Boolean
|
|
384
399
|
|
|
385
|
-
# @!attribute instructions
|
|
386
|
-
# Optional natural-language instructions guiding what to extract.
|
|
387
|
-
#
|
|
388
|
-
# @return [String, nil]
|
|
389
|
-
optional :instructions, String
|
|
390
|
-
|
|
391
400
|
# @!attribute max_depth
|
|
392
401
|
# Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
393
402
|
#
|
|
@@ -395,35 +404,40 @@ module ContextDev
|
|
|
395
404
|
optional :max_depth, Integer
|
|
396
405
|
|
|
397
406
|
# @!attribute max_pages
|
|
398
|
-
# Maximum number of pages to
|
|
407
|
+
# Maximum number of pages to track.
|
|
399
408
|
#
|
|
400
409
|
# @return [Integer, nil]
|
|
401
410
|
optional :max_pages, Integer
|
|
402
411
|
|
|
403
412
|
# @!attribute schema
|
|
404
|
-
# JSON Schema describing the
|
|
413
|
+
# JSON Schema describing the data you care about. It guides which pages are
|
|
414
|
+
# selected for tracking and gives the change judge context on what matters. If
|
|
405
415
|
# omitted, a default summary + key-points schema is used.
|
|
406
416
|
#
|
|
407
417
|
# @return [Hash{Symbol=>Object}, nil]
|
|
408
418
|
optional :schema, ContextDev::Internal::Type::HashOf[ContextDev::Internal::Type::Unknown]
|
|
409
419
|
|
|
410
|
-
# @!method initialize(url:, follow_subdomains: nil,
|
|
420
|
+
# @!method initialize(instructions:, url:, follow_subdomains: nil, max_depth: nil, max_pages: nil, schema: nil, type: :extract)
|
|
411
421
|
# Some parameter documentations has been truncated, see
|
|
412
422
|
# {ContextDev::Models::MonitorUpdateResponse::Target::Extract} for more details.
|
|
413
423
|
#
|
|
414
|
-
# Watch a site
|
|
424
|
+
# Watch the monitor-relevant pages of a site for meaningful changes. A crawl
|
|
425
|
+
# guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
|
|
426
|
+
# track; each run re-checks exactly those pages, and confirmed content changes are
|
|
427
|
+
# judged against the monitor's instructions. The tracked page set is refreshed by
|
|
428
|
+
# a periodic re-discovery crawl.
|
|
429
|
+
#
|
|
430
|
+
# @param instructions [String] Natural-language instructions guiding which pages and facts to track and which c
|
|
415
431
|
#
|
|
416
432
|
# @param url [String] Root URL to extract structured data from.
|
|
417
433
|
#
|
|
418
434
|
# @param follow_subdomains [Boolean]
|
|
419
435
|
#
|
|
420
|
-
# @param instructions [String] Optional natural-language instructions guiding what to extract.
|
|
421
|
-
#
|
|
422
436
|
# @param max_depth [Integer] Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
423
437
|
#
|
|
424
|
-
# @param max_pages [Integer] Maximum number of pages to
|
|
438
|
+
# @param max_pages [Integer] Maximum number of pages to track.
|
|
425
439
|
#
|
|
426
|
-
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the
|
|
440
|
+
# @param schema [Hash{Symbol=>Object}] JSON Schema describing the data you care about. It guides which pages are select
|
|
427
441
|
#
|
|
428
442
|
# @param type [Symbol, :extract]
|
|
429
443
|
end
|
|
@@ -432,6 +446,116 @@ module ContextDev
|
|
|
432
446
|
# @return [Array(ContextDev::Models::MonitorUpdateResponse::Target::Page, ContextDev::Models::MonitorUpdateResponse::Target::Sitemap, ContextDev::Models::MonitorUpdateResponse::Target::Extract)]
|
|
433
447
|
end
|
|
434
448
|
|
|
449
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
450
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
451
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
452
|
+
# after a target or change_detection update, which resets the baseline).
|
|
453
|
+
#
|
|
454
|
+
# @see ContextDev::Models::MonitorUpdateResponse#baseline
|
|
455
|
+
module Baseline
|
|
456
|
+
extend ContextDev::Internal::Type::Union
|
|
457
|
+
|
|
458
|
+
# Current baseline of a `page` monitor: the visible page text as last observed.
|
|
459
|
+
variant -> { ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline }
|
|
460
|
+
|
|
461
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last observed.
|
|
462
|
+
variant -> { ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline }
|
|
463
|
+
|
|
464
|
+
# Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.
|
|
465
|
+
variant -> { ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline }
|
|
466
|
+
|
|
467
|
+
class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel
|
|
468
|
+
# @!attribute captured_at
|
|
469
|
+
# When this baseline was last captured or replaced.
|
|
470
|
+
#
|
|
471
|
+
# @return [Time]
|
|
472
|
+
required :captured_at, Time
|
|
473
|
+
|
|
474
|
+
# @!attribute text
|
|
475
|
+
# The page's visible text as last observed.
|
|
476
|
+
#
|
|
477
|
+
# @return [String]
|
|
478
|
+
required :text, String
|
|
479
|
+
|
|
480
|
+
# @!method initialize(captured_at:, text:)
|
|
481
|
+
# Current baseline of a `page` monitor: the visible page text as last observed.
|
|
482
|
+
#
|
|
483
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
484
|
+
#
|
|
485
|
+
# @param text [String] The page's visible text as last observed.
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel
|
|
489
|
+
# @!attribute captured_at
|
|
490
|
+
# When this baseline was last captured or replaced.
|
|
491
|
+
#
|
|
492
|
+
# @return [Time]
|
|
493
|
+
required :captured_at, Time
|
|
494
|
+
|
|
495
|
+
# @!attribute url_count
|
|
496
|
+
# Number of URLs in the baseline.
|
|
497
|
+
#
|
|
498
|
+
# @return [Integer]
|
|
499
|
+
required :url_count, Integer
|
|
500
|
+
|
|
501
|
+
# @!attribute urls
|
|
502
|
+
# The sitemap URLs as last observed (sorted, normalized).
|
|
503
|
+
#
|
|
504
|
+
# @return [Array<String>]
|
|
505
|
+
required :urls, ContextDev::Internal::Type::ArrayOf[String]
|
|
506
|
+
|
|
507
|
+
# @!method initialize(captured_at:, url_count:, urls:)
|
|
508
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last
|
|
509
|
+
# observed.
|
|
510
|
+
#
|
|
511
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
512
|
+
#
|
|
513
|
+
# @param url_count [Integer] Number of URLs in the baseline.
|
|
514
|
+
#
|
|
515
|
+
# @param urls [Array<String>] The sitemap URLs as last observed (sorted, normalized).
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel
|
|
519
|
+
# @!attribute captured_at
|
|
520
|
+
# When this baseline was last captured or replaced.
|
|
521
|
+
#
|
|
522
|
+
# @return [Time]
|
|
523
|
+
required :captured_at, Time
|
|
524
|
+
|
|
525
|
+
# @!attribute data
|
|
526
|
+
# The extracted structured data, matching the monitor's extraction schema (same
|
|
527
|
+
# shape as the /web/extract endpoint's `data`). Refreshed when the monitor
|
|
528
|
+
# re-discovers its page set (at most about once a day); `null` when no extraction
|
|
529
|
+
# has been captured yet.
|
|
530
|
+
#
|
|
531
|
+
# @return [Object]
|
|
532
|
+
required :data, ContextDev::Internal::Type::Unknown
|
|
533
|
+
|
|
534
|
+
# @!attribute urls_analyzed
|
|
535
|
+
# The page URLs the monitor tracks and analyzes for changes.
|
|
536
|
+
#
|
|
537
|
+
# @return [Array<String>]
|
|
538
|
+
required :urls_analyzed, ContextDev::Internal::Type::ArrayOf[String]
|
|
539
|
+
|
|
540
|
+
# @!method initialize(captured_at:, data:, urls_analyzed:)
|
|
541
|
+
# Some parameter documentations has been truncated, see
|
|
542
|
+
# {ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline}
|
|
543
|
+
# for more details.
|
|
544
|
+
#
|
|
545
|
+
# Current baseline of an `extract` monitor: the pages it tracks and the structured
|
|
546
|
+
# data as last extracted.
|
|
547
|
+
#
|
|
548
|
+
# @param captured_at [Time] When this baseline was last captured or replaced.
|
|
549
|
+
#
|
|
550
|
+
# @param data [Object] The extracted structured data, matching the monitor's extraction schema (same sh
|
|
551
|
+
#
|
|
552
|
+
# @param urls_analyzed [Array<String>] The page URLs the monitor tracks and analyzes for changes.
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
# @!method self.variants
|
|
556
|
+
# @return [Array(ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsPageBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsSitemapBaseline, ContextDev::Models::MonitorUpdateResponse::Baseline::MonitorsExtractBaseline)]
|
|
557
|
+
end
|
|
558
|
+
|
|
435
559
|
# @see ContextDev::Models::MonitorUpdateResponse#last_error
|
|
436
560
|
class LastError < ContextDev::Internal::Type::BaseModel
|
|
437
561
|
# @!attribute code
|
|
@@ -5,11 +5,13 @@ module ContextDev
|
|
|
5
5
|
class Brand
|
|
6
6
|
# Retrieve logos, backdrops, colors, industry, description, and more. Provide
|
|
7
7
|
# exactly one lookup identifier in the request body: a domain, company name, email
|
|
8
|
-
# address, stock ticker, or
|
|
8
|
+
# address, stock ticker, transaction descriptor, or direct URL. Note:
|
|
9
|
+
# `by_direct_url` fetches brand data only from the provided URL — not from the
|
|
10
|
+
# entire internet.
|
|
9
11
|
#
|
|
10
12
|
# @overload retrieve(body:, request_options: {})
|
|
11
13
|
#
|
|
12
|
-
# @param body [ContextDev::Models::BrandRetrieveParams::Body::ByDomain, ContextDev::Models::BrandRetrieveParams::Body::ByName, ContextDev::Models::BrandRetrieveParams::Body::ByEmail, ContextDev::Models::BrandRetrieveParams::Body::ByTicker, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction] Exactly one lookup type must be provided.
|
|
14
|
+
# @param body [ContextDev::Models::BrandRetrieveParams::Body::ByDomain, ContextDev::Models::BrandRetrieveParams::Body::ByName, ContextDev::Models::BrandRetrieveParams::Body::ByEmail, ContextDev::Models::BrandRetrieveParams::Body::ByTicker, ContextDev::Models::BrandRetrieveParams::Body::ByDirectURL, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction] Exactly one lookup type must be provided.
|
|
13
15
|
#
|
|
14
16
|
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
15
17
|
#
|
|
@@ -122,7 +122,7 @@ module ContextDev
|
|
|
122
122
|
#
|
|
123
123
|
# @param q [String] Free-text search term, matched against the fields named in `search_by`.
|
|
124
124
|
#
|
|
125
|
-
# @param search_by [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>] Comma-separated fields to search with `q`. Defaults to all of them. Note `
|
|
125
|
+
# @param search_by [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru
|
|
126
126
|
#
|
|
127
127
|
# @param search_type [Symbol, ContextDev::Models::MonitorListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match
|
|
128
128
|
#
|
data/lib/context_dev/version.rb
CHANGED
|
@@ -19,6 +19,7 @@ module ContextDev
|
|
|
19
19
|
ContextDev::BrandRetrieveParams::Body::ByName,
|
|
20
20
|
ContextDev::BrandRetrieveParams::Body::ByEmail,
|
|
21
21
|
ContextDev::BrandRetrieveParams::Body::ByTicker,
|
|
22
|
+
ContextDev::BrandRetrieveParams::Body::ByDirectURL,
|
|
22
23
|
ContextDev::BrandRetrieveParams::Body::ByTransaction
|
|
23
24
|
)
|
|
24
25
|
)
|
|
@@ -33,6 +34,7 @@ module ContextDev
|
|
|
33
34
|
ContextDev::BrandRetrieveParams::Body::ByName::OrHash,
|
|
34
35
|
ContextDev::BrandRetrieveParams::Body::ByEmail::OrHash,
|
|
35
36
|
ContextDev::BrandRetrieveParams::Body::ByTicker::OrHash,
|
|
37
|
+
ContextDev::BrandRetrieveParams::Body::ByDirectURL::OrHash,
|
|
36
38
|
ContextDev::BrandRetrieveParams::Body::ByTransaction::OrHash
|
|
37
39
|
),
|
|
38
40
|
request_options: ContextDev::RequestOptions::OrHash
|
|
@@ -54,6 +56,7 @@ module ContextDev
|
|
|
54
56
|
ContextDev::BrandRetrieveParams::Body::ByName,
|
|
55
57
|
ContextDev::BrandRetrieveParams::Body::ByEmail,
|
|
56
58
|
ContextDev::BrandRetrieveParams::Body::ByTicker,
|
|
59
|
+
ContextDev::BrandRetrieveParams::Body::ByDirectURL,
|
|
57
60
|
ContextDev::BrandRetrieveParams::Body::ByTransaction
|
|
58
61
|
),
|
|
59
62
|
request_options: ContextDev::RequestOptions
|
|
@@ -74,6 +77,7 @@ module ContextDev
|
|
|
74
77
|
ContextDev::BrandRetrieveParams::Body::ByName,
|
|
75
78
|
ContextDev::BrandRetrieveParams::Body::ByEmail,
|
|
76
79
|
ContextDev::BrandRetrieveParams::Body::ByTicker,
|
|
80
|
+
ContextDev::BrandRetrieveParams::Body::ByDirectURL,
|
|
77
81
|
ContextDev::BrandRetrieveParams::Body::ByTransaction
|
|
78
82
|
)
|
|
79
83
|
end
|
|
@@ -3054,6 +3058,69 @@ module ContextDev
|
|
|
3054
3058
|
end
|
|
3055
3059
|
end
|
|
3056
3060
|
|
|
3061
|
+
class ByDirectURL < ContextDev::Internal::Type::BaseModel
|
|
3062
|
+
OrHash =
|
|
3063
|
+
T.type_alias do
|
|
3064
|
+
T.any(
|
|
3065
|
+
ContextDev::BrandRetrieveParams::Body::ByDirectURL,
|
|
3066
|
+
ContextDev::Internal::AnyHash
|
|
3067
|
+
)
|
|
3068
|
+
end
|
|
3069
|
+
|
|
3070
|
+
# Full http(s) URL to fetch brand data from (e.g.,
|
|
3071
|
+
# 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire
|
|
3072
|
+
# internet.
|
|
3073
|
+
sig { returns(String) }
|
|
3074
|
+
attr_accessor :direct_url
|
|
3075
|
+
|
|
3076
|
+
# Discriminator for direct-URL-based brand retrieval.
|
|
3077
|
+
sig { returns(Symbol) }
|
|
3078
|
+
attr_accessor :type
|
|
3079
|
+
|
|
3080
|
+
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
3081
|
+
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
3082
|
+
# value is 300000ms (5 minutes).
|
|
3083
|
+
sig { returns(T.nilable(Integer)) }
|
|
3084
|
+
attr_reader :timeout_ms
|
|
3085
|
+
|
|
3086
|
+
sig { params(timeout_ms: Integer).void }
|
|
3087
|
+
attr_writer :timeout_ms
|
|
3088
|
+
|
|
3089
|
+
# Retrieve brand data by fetching the provided URL directly. Note: if you use
|
|
3090
|
+
# this, brand data is fetched only from the provided URL — not from the entire
|
|
3091
|
+
# internet — so results are limited to what that single page contains. No domain
|
|
3092
|
+
# resolution, database lookup, or cross-source enrichment is performed. Cannot be
|
|
3093
|
+
# combined with domain, name, email, or ticker.
|
|
3094
|
+
sig do
|
|
3095
|
+
params(
|
|
3096
|
+
direct_url: String,
|
|
3097
|
+
timeout_ms: Integer,
|
|
3098
|
+
type: Symbol
|
|
3099
|
+
).returns(T.attached_class)
|
|
3100
|
+
end
|
|
3101
|
+
def self.new(
|
|
3102
|
+
# Full http(s) URL to fetch brand data from (e.g.,
|
|
3103
|
+
# 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire
|
|
3104
|
+
# internet.
|
|
3105
|
+
direct_url:,
|
|
3106
|
+
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
3107
|
+
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
3108
|
+
# value is 300000ms (5 minutes).
|
|
3109
|
+
timeout_ms: nil,
|
|
3110
|
+
# Discriminator for direct-URL-based brand retrieval.
|
|
3111
|
+
type: :by_direct_url
|
|
3112
|
+
)
|
|
3113
|
+
end
|
|
3114
|
+
|
|
3115
|
+
sig do
|
|
3116
|
+
override.returns(
|
|
3117
|
+
{ direct_url: String, type: Symbol, timeout_ms: Integer }
|
|
3118
|
+
)
|
|
3119
|
+
end
|
|
3120
|
+
def to_hash
|
|
3121
|
+
end
|
|
3122
|
+
end
|
|
3123
|
+
|
|
3057
3124
|
class ByTransaction < ContextDev::Internal::Type::BaseModel
|
|
3058
3125
|
OrHash =
|
|
3059
3126
|
T.type_alias do
|