context.dev 1.35.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/README.md +24 -17
- data/lib/context_dev/client.rb +7 -0
- data/lib/context_dev/models/brand_retrieve_params.rb +1036 -174
- data/lib/context_dev/models/monitor_create_params.rb +361 -0
- data/lib/context_dev/models/monitor_create_response.rb +484 -0
- data/lib/context_dev/models/monitor_delete_params.rb +20 -0
- data/lib/context_dev/models/monitor_delete_response.rb +22 -0
- data/lib/context_dev/models/monitor_list_account_changes_params.rb +93 -0
- data/lib/context_dev/models/monitor_list_account_changes_response.rb +199 -0
- data/lib/context_dev/models/monitor_list_account_runs_params.rb +55 -0
- data/lib/context_dev/models/monitor_list_account_runs_response.rb +227 -0
- data/lib/context_dev/models/monitor_list_changes_params.rb +57 -0
- data/lib/context_dev/models/monitor_list_changes_response.rb +198 -0
- data/lib/context_dev/models/monitor_list_params.rb +161 -0
- data/lib/context_dev/models/monitor_list_response.rb +507 -0
- data/lib/context_dev/models/monitor_list_runs_params.rb +62 -0
- data/lib/context_dev/models/monitor_list_runs_response.rb +227 -0
- data/lib/context_dev/models/monitor_retrieve_change_params.rb +20 -0
- data/lib/context_dev/models/monitor_retrieve_change_response.rb +271 -0
- data/lib/context_dev/models/monitor_retrieve_params.rb +20 -0
- data/lib/context_dev/models/monitor_retrieve_response.rb +484 -0
- data/lib/context_dev/models/monitor_run_params.rb +20 -0
- data/lib/context_dev/models/monitor_run_response.rb +35 -0
- data/lib/context_dev/models/monitor_update_params.rb +368 -0
- data/lib/context_dev/models/monitor_update_response.rb +484 -0
- data/lib/context_dev/models/utility_prefetch_params.rb +70 -6
- data/lib/context_dev/models/utility_prefetch_response.rb +23 -1
- data/lib/context_dev/models/web_extract_response.rb +17 -1
- data/lib/context_dev/models/web_extract_styleguide_params.rb +22 -1
- data/lib/context_dev/models/web_screenshot_params.rb +245 -1
- data/lib/context_dev/models/web_search_params.rb +270 -3
- data/lib/context_dev/models/web_web_crawl_md_params.rb +236 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +234 -1
- data/lib/context_dev/models/web_web_scrape_html_response.rb +10 -2
- data/lib/context_dev/models/web_web_scrape_images_params.rb +12 -1
- data/lib/context_dev/models/web_web_scrape_md_params.rb +234 -1
- data/lib/context_dev/models.rb +20 -12
- data/lib/context_dev/resources/ai.rb +0 -33
- data/lib/context_dev/resources/brand.rb +7 -204
- data/lib/context_dev/resources/monitors.rb +352 -0
- data/lib/context_dev/resources/utility.rb +9 -35
- data/lib/context_dev/resources/web.rb +36 -8
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +23 -14
- data/rbi/context_dev/client.rbi +6 -0
- data/rbi/context_dev/models/brand_retrieve_params.rbi +3792 -679
- data/rbi/context_dev/models/monitor_create_params.rbi +640 -0
- data/rbi/context_dev/models/monitor_create_response.rbi +820 -0
- data/rbi/context_dev/models/monitor_delete_params.rbi +35 -0
- data/rbi/context_dev/models/monitor_delete_response.rbi +29 -0
- data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +211 -0
- data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +376 -0
- data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +125 -0
- data/rbi/context_dev/models/monitor_list_account_runs_response.rbi +464 -0
- data/rbi/context_dev/models/monitor_list_changes_params.rbi +91 -0
- data/rbi/context_dev/models/monitor_list_changes_response.rbi +372 -0
- data/rbi/context_dev/models/monitor_list_params.rbi +332 -0
- data/rbi/context_dev/models/monitor_list_response.rbi +885 -0
- data/rbi/context_dev/models/monitor_list_runs_params.rbi +125 -0
- data/rbi/context_dev/models/monitor_list_runs_response.rbi +455 -0
- data/rbi/context_dev/models/monitor_retrieve_change_params.rbi +38 -0
- data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +478 -0
- data/rbi/context_dev/models/monitor_retrieve_params.rbi +38 -0
- data/rbi/context_dev/models/monitor_retrieve_response.rbi +828 -0
- data/rbi/context_dev/models/monitor_run_params.rbi +35 -0
- data/rbi/context_dev/models/monitor_run_response.rbi +48 -0
- data/rbi/context_dev/models/monitor_update_params.rbi +680 -0
- data/rbi/context_dev/models/monitor_update_response.rbi +820 -0
- data/rbi/context_dev/models/utility_prefetch_params.rbi +129 -7
- data/rbi/context_dev/models/utility_prefetch_response.rbi +55 -3
- data/rbi/context_dev/models/web_extract_response.rbi +10 -0
- data/rbi/context_dev/models/web_extract_styleguide_params.rbi +59 -0
- data/rbi/context_dev/models/web_screenshot_params.rbi +295 -0
- data/rbi/context_dev/models/web_search_params.rbi +288 -2
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +260 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +465 -0
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +29 -3
- data/rbi/context_dev/models/web_web_scrape_images_params.rbi +17 -0
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +259 -0
- data/rbi/context_dev/models.rbi +23 -15
- data/rbi/context_dev/resources/ai.rbi +0 -28
- data/rbi/context_dev/resources/brand.rbi +13 -228
- data/rbi/context_dev/resources/monitors.rbi +286 -0
- data/rbi/context_dev/resources/utility.rbi +14 -29
- data/rbi/context_dev/resources/web.rbi +56 -1
- data/sig/context_dev/client.rbs +2 -0
- data/sig/context_dev/models/brand_retrieve_params.rbs +1560 -281
- data/sig/context_dev/models/monitor_create_params.rbs +311 -0
- data/sig/context_dev/models/monitor_create_response.rbs +369 -0
- data/sig/context_dev/models/monitor_delete_params.rbs +23 -0
- data/sig/context_dev/models/monitor_delete_response.rbs +15 -0
- data/sig/context_dev/models/monitor_list_account_changes_params.rbs +104 -0
- data/sig/context_dev/models/monitor_list_account_changes_response.rbs +176 -0
- data/sig/context_dev/models/monitor_list_account_runs_params.rbs +58 -0
- data/sig/context_dev/models/monitor_list_account_runs_response.rbs +184 -0
- data/sig/context_dev/models/monitor_list_changes_params.rbs +61 -0
- data/sig/context_dev/models/monitor_list_changes_response.rbs +176 -0
- data/sig/context_dev/models/monitor_list_params.rbs +160 -0
- data/sig/context_dev/models/monitor_list_response.rbs +396 -0
- data/sig/context_dev/models/monitor_list_runs_params.rbs +63 -0
- data/sig/context_dev/models/monitor_list_runs_response.rbs +184 -0
- data/sig/context_dev/models/monitor_retrieve_change_params.rbs +23 -0
- data/sig/context_dev/models/monitor_retrieve_change_response.rbs +228 -0
- data/sig/context_dev/models/monitor_retrieve_params.rbs +23 -0
- data/sig/context_dev/models/monitor_retrieve_response.rbs +369 -0
- data/sig/context_dev/models/monitor_run_params.rbs +23 -0
- data/sig/context_dev/models/monitor_run_response.rbs +18 -0
- data/sig/context_dev/models/monitor_update_params.rbs +331 -0
- data/sig/context_dev/models/monitor_update_response.rbs +369 -0
- data/sig/context_dev/models/utility_prefetch_params.rbs +52 -4
- data/sig/context_dev/models/utility_prefetch_response.rbs +22 -3
- data/sig/context_dev/models/web_extract_response.rbs +5 -0
- data/sig/context_dev/models/web_extract_styleguide_params.rbs +20 -0
- data/sig/context_dev/models/web_screenshot_params.rbs +446 -0
- data/sig/context_dev/models/web_search_params.rbs +503 -0
- data/sig/context_dev/models/web_web_crawl_md_params.rbs +433 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +433 -0
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +8 -0
- data/sig/context_dev/models/web_web_scrape_images_params.rbs +7 -0
- data/sig/context_dev/models/web_web_scrape_md_params.rbs +433 -0
- data/sig/context_dev/models.rbs +20 -12
- data/sig/context_dev/resources/ai.rbs +0 -8
- data/sig/context_dev/resources/brand.rbs +1 -56
- data/sig/context_dev/resources/monitors.rbs +101 -0
- data/sig/context_dev/resources/utility.rbs +2 -7
- data/sig/context_dev/resources/web.rbs +12 -0
- metadata +71 -44
- data/lib/context_dev/models/ai_ai_query_params.rb +0 -235
- data/lib/context_dev/models/ai_ai_query_response.rb +0 -133
- data/lib/context_dev/models/brand_identify_from_transaction_params.rb +0 -474
- data/lib/context_dev/models/brand_identify_from_transaction_response.rb +0 -1074
- data/lib/context_dev/models/brand_retrieve_by_email_params.rb +0 -195
- data/lib/context_dev/models/brand_retrieve_by_email_response.rb +0 -1071
- data/lib/context_dev/models/brand_retrieve_by_isin_params.rb +0 -195
- data/lib/context_dev/models/brand_retrieve_by_isin_response.rb +0 -1070
- data/lib/context_dev/models/brand_retrieve_by_name_params.rb +0 -452
- data/lib/context_dev/models/brand_retrieve_by_name_response.rb +0 -1070
- data/lib/context_dev/models/brand_retrieve_by_ticker_params.rb +0 -283
- data/lib/context_dev/models/brand_retrieve_by_ticker_response.rb +0 -1072
- data/lib/context_dev/models/utility_prefetch_by_email_params.rb +0 -37
- data/lib/context_dev/models/utility_prefetch_by_email_response.rb +0 -68
- data/rbi/context_dev/models/ai_ai_query_params.rbi +0 -504
- data/rbi/context_dev/models/ai_ai_query_response.rbi +0 -267
- data/rbi/context_dev/models/brand_identify_from_transaction_params.rbi +0 -2020
- data/rbi/context_dev/models/brand_identify_from_transaction_response.rbi +0 -3515
- data/rbi/context_dev/models/brand_retrieve_by_email_params.rbi +0 -743
- data/rbi/context_dev/models/brand_retrieve_by_email_response.rbi +0 -3511
- data/rbi/context_dev/models/brand_retrieve_by_isin_params.rbi +0 -743
- data/rbi/context_dev/models/brand_retrieve_by_isin_response.rbi +0 -3510
- data/rbi/context_dev/models/brand_retrieve_by_name_params.rbi +0 -1982
- data/rbi/context_dev/models/brand_retrieve_by_name_response.rbi +0 -3510
- data/rbi/context_dev/models/brand_retrieve_by_ticker_params.rbi +0 -1153
- data/rbi/context_dev/models/brand_retrieve_by_ticker_response.rbi +0 -3512
- data/rbi/context_dev/models/utility_prefetch_by_email_params.rbi +0 -65
- data/rbi/context_dev/models/utility_prefetch_by_email_response.rbi +0 -132
- data/sig/context_dev/models/ai_ai_query_params.rbs +0 -218
- data/sig/context_dev/models/ai_ai_query_response.rbs +0 -121
- data/sig/context_dev/models/brand_identify_from_transaction_params.rbs +0 -822
- data/sig/context_dev/models/brand_identify_from_transaction_response.rbs +0 -1441
- data/sig/context_dev/models/brand_retrieve_by_email_params.rbs +0 -305
- data/sig/context_dev/models/brand_retrieve_by_email_response.rbs +0 -1441
- data/sig/context_dev/models/brand_retrieve_by_isin_params.rbs +0 -305
- data/sig/context_dev/models/brand_retrieve_by_isin_response.rbs +0 -1441
- data/sig/context_dev/models/brand_retrieve_by_name_params.rbs +0 -801
- data/sig/context_dev/models/brand_retrieve_by_name_response.rbs +0 -1441
- data/sig/context_dev/models/brand_retrieve_by_ticker_params.rbs +0 -467
- data/sig/context_dev/models/brand_retrieve_by_ticker_response.rbs +0 -1441
- data/sig/context_dev/models/utility_prefetch_by_email_params.rbs +0 -30
- data/sig/context_dev/models/utility_prefetch_by_email_response.rbs +0 -64
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Resources
|
|
5
|
+
# Monitor pages, sitemaps, and extracted website data for exact or semantic
|
|
6
|
+
# changes. The change.detected webhook payload is documented by the
|
|
7
|
+
# MonitorsChangeDetectedWebhookPayload schema.
|
|
8
|
+
class Monitors
|
|
9
|
+
# Creates a monitor. The request body is a union of the supported target/change
|
|
10
|
+
# detection combinations. The monitor runs immediately after creation to create
|
|
11
|
+
# its initial baseline.
|
|
12
|
+
sig do
|
|
13
|
+
params(
|
|
14
|
+
change_detection:
|
|
15
|
+
T.any(
|
|
16
|
+
ContextDev::MonitorCreateParams::ChangeDetection::Exact::OrHash,
|
|
17
|
+
ContextDev::MonitorCreateParams::ChangeDetection::Semantic::OrHash
|
|
18
|
+
),
|
|
19
|
+
name: String,
|
|
20
|
+
schedule: ContextDev::MonitorCreateParams::Schedule::OrHash,
|
|
21
|
+
target:
|
|
22
|
+
T.any(
|
|
23
|
+
ContextDev::MonitorCreateParams::Target::Page::OrHash,
|
|
24
|
+
ContextDev::MonitorCreateParams::Target::Sitemap::OrHash,
|
|
25
|
+
ContextDev::MonitorCreateParams::Target::Extract::OrHash
|
|
26
|
+
),
|
|
27
|
+
mode: ContextDev::MonitorCreateParams::Mode::OrSymbol,
|
|
28
|
+
tags: T::Array[String],
|
|
29
|
+
webhook: T.nilable(ContextDev::MonitorCreateParams::Webhook::OrHash),
|
|
30
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
31
|
+
).returns(ContextDev::Models::MonitorCreateResponse)
|
|
32
|
+
end
|
|
33
|
+
def create(
|
|
34
|
+
# Discriminated union describing how changes are detected.
|
|
35
|
+
change_detection:,
|
|
36
|
+
name:,
|
|
37
|
+
# Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
|
|
38
|
+
# every 6 hours or every 2 days. The total interval (frequency × unit) must be
|
|
39
|
+
# between 10 minutes and 1 year.
|
|
40
|
+
schedule:,
|
|
41
|
+
# Discriminated union describing what the monitor watches.
|
|
42
|
+
target:,
|
|
43
|
+
# Top-level monitor category. Always `web` today; the concrete behavior is
|
|
44
|
+
# described by `target` and `change_detection`.
|
|
45
|
+
mode: nil,
|
|
46
|
+
# User-defined tags for grouping and filtering monitors and their changes.
|
|
47
|
+
tags: nil,
|
|
48
|
+
webhook: nil,
|
|
49
|
+
request_options: {}
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Get a monitor
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
monitor_id: String,
|
|
57
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
58
|
+
).returns(ContextDev::Models::MonitorRetrieveResponse)
|
|
59
|
+
end
|
|
60
|
+
def retrieve(monitor_id, request_options: {})
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Updates a monitor. If `target` or `change_detection` changes, the monitor
|
|
64
|
+
# creates a new baseline. Unsupported target/change detection combinations are
|
|
65
|
+
# rejected.
|
|
66
|
+
sig do
|
|
67
|
+
params(
|
|
68
|
+
monitor_id: String,
|
|
69
|
+
change_detection:
|
|
70
|
+
T.any(
|
|
71
|
+
ContextDev::MonitorUpdateParams::ChangeDetection::Exact::OrHash,
|
|
72
|
+
ContextDev::MonitorUpdateParams::ChangeDetection::Semantic::OrHash
|
|
73
|
+
),
|
|
74
|
+
name: String,
|
|
75
|
+
schedule: ContextDev::MonitorUpdateParams::Schedule::OrHash,
|
|
76
|
+
status: ContextDev::MonitorUpdateParams::Status::OrSymbol,
|
|
77
|
+
tags: T::Array[String],
|
|
78
|
+
target:
|
|
79
|
+
T.any(
|
|
80
|
+
ContextDev::MonitorUpdateParams::Target::Page::OrHash,
|
|
81
|
+
ContextDev::MonitorUpdateParams::Target::Sitemap::OrHash,
|
|
82
|
+
ContextDev::MonitorUpdateParams::Target::Extract::OrHash
|
|
83
|
+
),
|
|
84
|
+
webhook: T.nilable(ContextDev::MonitorUpdateParams::Webhook::OrHash),
|
|
85
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
86
|
+
).returns(ContextDev::Models::MonitorUpdateResponse)
|
|
87
|
+
end
|
|
88
|
+
def update(
|
|
89
|
+
monitor_id,
|
|
90
|
+
# Discriminated union describing how changes are detected.
|
|
91
|
+
change_detection: nil,
|
|
92
|
+
name: nil,
|
|
93
|
+
# Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
|
|
94
|
+
# every 6 hours or every 2 days. The total interval (frequency × unit) must be
|
|
95
|
+
# between 10 minutes and 1 year.
|
|
96
|
+
schedule: nil,
|
|
97
|
+
status: nil,
|
|
98
|
+
# User-defined tags for grouping and filtering monitors and their changes.
|
|
99
|
+
tags: nil,
|
|
100
|
+
# Discriminated union describing what the monitor watches.
|
|
101
|
+
target: nil,
|
|
102
|
+
# Set to null to remove the webhook.
|
|
103
|
+
webhook: nil,
|
|
104
|
+
request_options: {}
|
|
105
|
+
)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Lists monitors for the authenticated organization. Supports free-text search
|
|
109
|
+
# (`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus
|
|
110
|
+
# status/type/tag filters. Results are paginated via the opaque `cursor`.
|
|
111
|
+
sig do
|
|
112
|
+
params(
|
|
113
|
+
change_detection_type:
|
|
114
|
+
ContextDev::MonitorListParams::ChangeDetectionType::OrSymbol,
|
|
115
|
+
cursor: String,
|
|
116
|
+
limit: Integer,
|
|
117
|
+
q: String,
|
|
118
|
+
search_by:
|
|
119
|
+
T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol],
|
|
120
|
+
search_type: ContextDev::MonitorListParams::SearchType::OrSymbol,
|
|
121
|
+
status: ContextDev::MonitorListParams::Status::OrSymbol,
|
|
122
|
+
tag: String,
|
|
123
|
+
tags: T::Array[String],
|
|
124
|
+
target_type: ContextDev::MonitorListParams::TargetType::OrSymbol,
|
|
125
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
126
|
+
).returns(ContextDev::Models::MonitorListResponse)
|
|
127
|
+
end
|
|
128
|
+
def list(
|
|
129
|
+
change_detection_type: nil,
|
|
130
|
+
cursor: nil,
|
|
131
|
+
limit: nil,
|
|
132
|
+
# Free-text search term, matched against the fields named in `search_by`.
|
|
133
|
+
q: nil,
|
|
134
|
+
# Comma-separated fields to search with `q`. Defaults to all of them. Note `query`
|
|
135
|
+
# only exists on semantic monitors.
|
|
136
|
+
search_by: nil,
|
|
137
|
+
# `prefix` for as-you-type prefix matching (default), `exact` for full-token
|
|
138
|
+
# matching.
|
|
139
|
+
search_type: nil,
|
|
140
|
+
# Monitor lifecycle status. `failed` means the most recent run failed (see the
|
|
141
|
+
# monitor's `last_error`); failed monitors keep running on schedule and flip back
|
|
142
|
+
# to `active` on the next successful run. Monitors are auto-`paused` after
|
|
143
|
+
# repeated consecutive failures or insufficient-credit skips; resume by PATCHing
|
|
144
|
+
# status to `active`.
|
|
145
|
+
status: nil,
|
|
146
|
+
# Filter to items that have this tag.
|
|
147
|
+
tag: nil,
|
|
148
|
+
# Comma-separated list of tags to filter by (matches monitors having any of them).
|
|
149
|
+
tags: nil,
|
|
150
|
+
target_type: nil,
|
|
151
|
+
request_options: {}
|
|
152
|
+
)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Delete a monitor
|
|
156
|
+
sig do
|
|
157
|
+
params(
|
|
158
|
+
monitor_id: String,
|
|
159
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
160
|
+
).returns(ContextDev::Models::MonitorDeleteResponse)
|
|
161
|
+
end
|
|
162
|
+
def delete(monitor_id, request_options: {})
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Returns an account-wide feed of detected changes across monitors.
|
|
166
|
+
sig do
|
|
167
|
+
params(
|
|
168
|
+
change_detection_type:
|
|
169
|
+
ContextDev::MonitorListAccountChangesParams::ChangeDetectionType::OrSymbol,
|
|
170
|
+
cursor: String,
|
|
171
|
+
limit: Integer,
|
|
172
|
+
monitor_id: String,
|
|
173
|
+
since: Time,
|
|
174
|
+
tag: String,
|
|
175
|
+
target_type:
|
|
176
|
+
ContextDev::MonitorListAccountChangesParams::TargetType::OrSymbol,
|
|
177
|
+
until_: Time,
|
|
178
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
179
|
+
).returns(ContextDev::Models::MonitorListAccountChangesResponse)
|
|
180
|
+
end
|
|
181
|
+
def list_account_changes(
|
|
182
|
+
change_detection_type: nil,
|
|
183
|
+
cursor: nil,
|
|
184
|
+
limit: nil,
|
|
185
|
+
monitor_id: nil,
|
|
186
|
+
since: nil,
|
|
187
|
+
# Filter to items that have this tag.
|
|
188
|
+
tag: nil,
|
|
189
|
+
target_type: nil,
|
|
190
|
+
until_: nil,
|
|
191
|
+
request_options: {}
|
|
192
|
+
)
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Returns an account-wide feed of monitor runs across all monitors.
|
|
196
|
+
sig do
|
|
197
|
+
params(
|
|
198
|
+
cursor: String,
|
|
199
|
+
limit: Integer,
|
|
200
|
+
status: ContextDev::MonitorListAccountRunsParams::Status::OrSymbol,
|
|
201
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
202
|
+
).returns(ContextDev::Models::MonitorListAccountRunsResponse)
|
|
203
|
+
end
|
|
204
|
+
def list_account_runs(
|
|
205
|
+
cursor: nil,
|
|
206
|
+
limit: nil,
|
|
207
|
+
# Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
|
|
208
|
+
# (insufficient credits, monitor paused, or superseded by a concurrent run).
|
|
209
|
+
status: nil,
|
|
210
|
+
request_options: {}
|
|
211
|
+
)
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# List changes for a monitor
|
|
215
|
+
sig do
|
|
216
|
+
params(
|
|
217
|
+
monitor_id: String,
|
|
218
|
+
cursor: String,
|
|
219
|
+
limit: Integer,
|
|
220
|
+
since: Time,
|
|
221
|
+
tag: String,
|
|
222
|
+
until_: Time,
|
|
223
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
224
|
+
).returns(ContextDev::Models::MonitorListChangesResponse)
|
|
225
|
+
end
|
|
226
|
+
def list_changes(
|
|
227
|
+
monitor_id,
|
|
228
|
+
cursor: nil,
|
|
229
|
+
limit: nil,
|
|
230
|
+
since: nil,
|
|
231
|
+
# Filter to items that have this tag.
|
|
232
|
+
tag: nil,
|
|
233
|
+
until_: nil,
|
|
234
|
+
request_options: {}
|
|
235
|
+
)
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# List monitor runs
|
|
239
|
+
sig do
|
|
240
|
+
params(
|
|
241
|
+
monitor_id: String,
|
|
242
|
+
cursor: String,
|
|
243
|
+
limit: Integer,
|
|
244
|
+
status: ContextDev::MonitorListRunsParams::Status::OrSymbol,
|
|
245
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
246
|
+
).returns(ContextDev::Models::MonitorListRunsResponse)
|
|
247
|
+
end
|
|
248
|
+
def list_runs(
|
|
249
|
+
monitor_id,
|
|
250
|
+
cursor: nil,
|
|
251
|
+
limit: nil,
|
|
252
|
+
# Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
|
|
253
|
+
# (insufficient credits, monitor paused, or superseded by a concurrent run).
|
|
254
|
+
status: nil,
|
|
255
|
+
request_options: {}
|
|
256
|
+
)
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Get a change
|
|
260
|
+
sig do
|
|
261
|
+
params(
|
|
262
|
+
change_id: String,
|
|
263
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
264
|
+
).returns(ContextDev::Models::MonitorRetrieveChangeResponse)
|
|
265
|
+
end
|
|
266
|
+
def retrieve_change(change_id, request_options: {})
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Triggers an immediate run of the monitor outside its normal schedule. The run is
|
|
270
|
+
# queued and processed asynchronously.
|
|
271
|
+
sig do
|
|
272
|
+
params(
|
|
273
|
+
monitor_id: String,
|
|
274
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
275
|
+
).returns(ContextDev::Models::MonitorRunResponse)
|
|
276
|
+
end
|
|
277
|
+
def run(monitor_id, request_options: {})
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# @api private
|
|
281
|
+
sig { params(client: ContextDev::Client).returns(T.attached_class) }
|
|
282
|
+
def self.new(client:)
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
end
|
|
@@ -3,42 +3,27 @@
|
|
|
3
3
|
module ContextDev
|
|
4
4
|
module Resources
|
|
5
5
|
class Utility
|
|
6
|
-
# Signal that you may fetch brand data
|
|
7
|
-
#
|
|
6
|
+
# Signal that you may fetch brand data soon to improve latency. The type field
|
|
7
|
+
# selects what to prefetch (currently only 'brand') and identifier carries exactly
|
|
8
|
+
# one lookup key: a domain, or an email whose domain is extracted and validated
|
|
9
|
+
# (free email providers and disposable email addresses are not allowed).
|
|
8
10
|
sig do
|
|
9
11
|
params(
|
|
10
|
-
|
|
12
|
+
identifier:
|
|
13
|
+
T.any(
|
|
14
|
+
ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchDomainIdentifier::OrHash,
|
|
15
|
+
ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier::OrHash
|
|
16
|
+
),
|
|
17
|
+
type: ContextDev::UtilityPrefetchParams::Type::OrSymbol,
|
|
11
18
|
timeout_ms: Integer,
|
|
12
19
|
request_options: ContextDev::RequestOptions::OrHash
|
|
13
20
|
).returns(ContextDev::Models::UtilityPrefetchResponse)
|
|
14
21
|
end
|
|
15
22
|
def prefetch(
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
#
|
|
19
|
-
|
|
20
|
-
# value is 300000ms (5 minutes).
|
|
21
|
-
timeout_ms: nil,
|
|
22
|
-
request_options: {}
|
|
23
|
-
)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# Signal that you may fetch brand data for a particular domain soon to improve
|
|
27
|
-
# latency. This endpoint accepts an email address, extracts the domain from it,
|
|
28
|
-
# validates that it's not a disposable or free email provider, and queues the
|
|
29
|
-
# domain for prefetching.
|
|
30
|
-
sig do
|
|
31
|
-
params(
|
|
32
|
-
email: String,
|
|
33
|
-
timeout_ms: Integer,
|
|
34
|
-
request_options: ContextDev::RequestOptions::OrHash
|
|
35
|
-
).returns(ContextDev::Models::UtilityPrefetchByEmailResponse)
|
|
36
|
-
end
|
|
37
|
-
def prefetch_by_email(
|
|
38
|
-
# Email address to prefetch brand data for. The domain will be extracted from the
|
|
39
|
-
# email. Free email providers (gmail.com, yahoo.com, etc.) and disposable email
|
|
40
|
-
# addresses are not allowed.
|
|
41
|
-
email:,
|
|
23
|
+
# Identifier of the brand to prefetch. Provide exactly one of domain or email.
|
|
24
|
+
identifier:,
|
|
25
|
+
# What to prefetch. Currently only 'brand' is supported.
|
|
26
|
+
type:,
|
|
42
27
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
43
28
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
44
29
|
# value is 300000ms (5 minutes).
|
|
@@ -129,6 +129,8 @@ module ContextDev
|
|
|
129
129
|
# typography, spacing, shadows, and UI components.
|
|
130
130
|
sig do
|
|
131
131
|
params(
|
|
132
|
+
color_scheme:
|
|
133
|
+
ContextDev::WebExtractStyleguideParams::ColorScheme::OrSymbol,
|
|
132
134
|
direct_url: String,
|
|
133
135
|
domain: String,
|
|
134
136
|
max_age_ms: Integer,
|
|
@@ -137,6 +139,9 @@ module ContextDev
|
|
|
137
139
|
).returns(ContextDev::Models::WebExtractStyleguideResponse)
|
|
138
140
|
end
|
|
139
141
|
def extract_styleguide(
|
|
142
|
+
# Optional browser color scheme to emulate for websites that respond to
|
|
143
|
+
# prefers-color-scheme. This value is part of the styleguide cache key.
|
|
144
|
+
color_scheme: nil,
|
|
140
145
|
# A specific URL to fetch the styleguide from directly, bypassing domain
|
|
141
146
|
# resolution (e.g., 'https://example.com/design-system'). When provided, the
|
|
142
147
|
# styleguide is extracted from this exact URL. You must provide either 'domain' or
|
|
@@ -162,6 +167,8 @@ module ContextDev
|
|
|
162
167
|
# Capture a screenshot of a website.
|
|
163
168
|
sig do
|
|
164
169
|
params(
|
|
170
|
+
color_scheme: ContextDev::WebScreenshotParams::ColorScheme::OrSymbol,
|
|
171
|
+
country: ContextDev::WebScreenshotParams::Country::OrSymbol,
|
|
165
172
|
direct_url: String,
|
|
166
173
|
domain: String,
|
|
167
174
|
full_screenshot:
|
|
@@ -178,6 +185,12 @@ module ContextDev
|
|
|
178
185
|
).returns(ContextDev::Models::WebScreenshotResponse)
|
|
179
186
|
end
|
|
180
187
|
def screenshot(
|
|
188
|
+
# Optional parameter to choose the site's visual theme in the screenshot. Use
|
|
189
|
+
# 'light' or 'dark' when the site offers both appearances.
|
|
190
|
+
color_scheme: nil,
|
|
191
|
+
# Two-letter ISO 3166-1 alpha-2 country code for the website request location.
|
|
192
|
+
# When provided, Context.dev fetches the target page from that country.
|
|
193
|
+
country: nil,
|
|
181
194
|
# A specific URL to screenshot directly, bypassing domain resolution (e.g.,
|
|
182
195
|
# 'https://example.com/pricing'). When provided, the screenshot is taken of this
|
|
183
196
|
# exact URL. You must provide either 'domain' or 'directUrl', but not both.
|
|
@@ -229,19 +242,25 @@ module ContextDev
|
|
|
229
242
|
sig do
|
|
230
243
|
params(
|
|
231
244
|
query: String,
|
|
245
|
+
country: ContextDev::WebSearchParams::Country::OrSymbol,
|
|
232
246
|
exclude_domains: T::Array[String],
|
|
233
247
|
freshness: ContextDev::WebSearchParams::Freshness::OrSymbol,
|
|
234
248
|
include_domains: T::Array[String],
|
|
235
249
|
markdown_options:
|
|
236
250
|
ContextDev::WebSearchParams::MarkdownOptions::OrHash,
|
|
251
|
+
num_results: Integer,
|
|
237
252
|
query_fanout: T::Boolean,
|
|
238
253
|
timeout_ms: Integer,
|
|
239
254
|
request_options: ContextDev::RequestOptions::OrHash
|
|
240
255
|
).returns(ContextDev::Models::WebSearchResponse)
|
|
241
256
|
end
|
|
242
257
|
def search(
|
|
243
|
-
#
|
|
258
|
+
# Search query. Accepts natural language as well as Google-style search operators
|
|
259
|
+
# such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`.
|
|
244
260
|
query:,
|
|
261
|
+
# Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific
|
|
262
|
+
# country (maps to Google's `gl` parameter). Example: "us", "gb", "de".
|
|
263
|
+
country: nil,
|
|
245
264
|
# Blocklist — drop results from these domains. Example: ["pinterest.com",
|
|
246
265
|
# "reddit.com"].
|
|
247
266
|
exclude_domains: nil,
|
|
@@ -252,6 +271,8 @@ module ContextDev
|
|
|
252
271
|
include_domains: nil,
|
|
253
272
|
# Inline Markdown scraping for each result. Set `enabled: true` to activate.
|
|
254
273
|
markdown_options: nil,
|
|
274
|
+
# Number of results to request and return (10–100). Defaults to 10.
|
|
275
|
+
num_results: nil,
|
|
255
276
|
# Expand the query into multiple parallel variants for broader recall.
|
|
256
277
|
query_fanout: nil,
|
|
257
278
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
@@ -267,6 +288,7 @@ module ContextDev
|
|
|
267
288
|
sig do
|
|
268
289
|
params(
|
|
269
290
|
url: String,
|
|
291
|
+
country: ContextDev::WebWebCrawlMdParams::Country::OrSymbol,
|
|
270
292
|
exclude_selectors: T::Array[String],
|
|
271
293
|
follow_subdomains: T::Boolean,
|
|
272
294
|
include_frames: T::Boolean,
|
|
@@ -277,6 +299,7 @@ module ContextDev
|
|
|
277
299
|
max_depth: Integer,
|
|
278
300
|
max_pages: Integer,
|
|
279
301
|
pdf: ContextDev::WebWebCrawlMdParams::Pdf::OrHash,
|
|
302
|
+
settle_animations: T::Boolean,
|
|
280
303
|
shorten_base64_images: T::Boolean,
|
|
281
304
|
stop_after_ms: Integer,
|
|
282
305
|
timeout_ms: Integer,
|
|
@@ -289,6 +312,10 @@ module ContextDev
|
|
|
289
312
|
def web_crawl_md(
|
|
290
313
|
# The starting URL for the crawl (must include http:// or https:// protocol)
|
|
291
314
|
url:,
|
|
315
|
+
# Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev
|
|
316
|
+
# residential proxy exit location. Must be one of Context.dev's supported
|
|
317
|
+
# countries. When provided, Context.dev fetches the target page from that country.
|
|
318
|
+
country: nil,
|
|
292
319
|
# CSS selectors to remove before each crawled page is converted to Markdown.
|
|
293
320
|
# Applied after includeSelectors. Exclusion takes precedence: an element matching
|
|
294
321
|
# both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
|
|
@@ -320,6 +347,10 @@ module ContextDev
|
|
|
320
347
|
# PDF parsing controls. Use start/end to limit text extraction and OCR to an
|
|
321
348
|
# inclusive 1-based page range.
|
|
322
349
|
pdf: nil,
|
|
350
|
+
# When true, waits briefly for CSS and transition animations to settle before
|
|
351
|
+
# extracting each crawled page. Defaults to false. This adds a bit of latency in
|
|
352
|
+
# exchange for more stable output on animated pages.
|
|
353
|
+
settle_animations: nil,
|
|
323
354
|
# Truncate base64-encoded image data in the Markdown output
|
|
324
355
|
shorten_base64_images: nil,
|
|
325
356
|
# Soft time budget for the crawl in milliseconds. After each scrape, the crawler
|
|
@@ -347,12 +378,14 @@ module ContextDev
|
|
|
347
378
|
sig do
|
|
348
379
|
params(
|
|
349
380
|
url: String,
|
|
381
|
+
country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol,
|
|
350
382
|
exclude_selectors: T::Array[String],
|
|
351
383
|
headers: T::Hash[Symbol, String],
|
|
352
384
|
include_frames: T::Boolean,
|
|
353
385
|
include_selectors: T::Array[String],
|
|
354
386
|
max_age_ms: Integer,
|
|
355
387
|
pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash,
|
|
388
|
+
settle_animations: T::Boolean,
|
|
356
389
|
timeout_ms: Integer,
|
|
357
390
|
use_main_content_only: T::Boolean,
|
|
358
391
|
wait_for_ms: Integer,
|
|
@@ -362,6 +395,9 @@ module ContextDev
|
|
|
362
395
|
def web_scrape_html(
|
|
363
396
|
# Full URL to scrape (must include http:// or https:// protocol)
|
|
364
397
|
url:,
|
|
398
|
+
# Two-letter ISO 3166-1 alpha-2 country code for the website request location.
|
|
399
|
+
# When provided, Context.dev fetches the target page from that country.
|
|
400
|
+
country: nil,
|
|
365
401
|
# CSS selectors to remove from the result. Applied after includeSelectors.
|
|
366
402
|
# Exclusion takes precedence: an element matching both is removed. Examples:
|
|
367
403
|
# "nav", "footer", ".ad-banner", "[aria-hidden=true]".
|
|
@@ -383,6 +419,10 @@ module ContextDev
|
|
|
383
419
|
# PDF parsing controls. Use start/end to limit text extraction and OCR to an
|
|
384
420
|
# inclusive 1-based page range.
|
|
385
421
|
pdf: nil,
|
|
422
|
+
# When true, waits briefly for CSS and transition animations to settle before
|
|
423
|
+
# extracting HTML. Defaults to false. This adds a bit of latency in exchange for
|
|
424
|
+
# more stable output on animated pages.
|
|
425
|
+
settle_animations: nil,
|
|
386
426
|
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
387
427
|
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
388
428
|
# value is 300000ms (5 minutes).
|
|
@@ -404,6 +444,7 @@ module ContextDev
|
|
|
404
444
|
sig do
|
|
405
445
|
params(
|
|
406
446
|
url: String,
|
|
447
|
+
dedupe: T::Boolean,
|
|
407
448
|
enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash,
|
|
408
449
|
headers: T::Hash[Symbol, String],
|
|
409
450
|
max_age_ms: Integer,
|
|
@@ -415,6 +456,11 @@ module ContextDev
|
|
|
415
456
|
def web_scrape_images(
|
|
416
457
|
# Page URL to inspect. Must include http:// or https://.
|
|
417
458
|
url:,
|
|
459
|
+
# When true, visually duplicate images are removed: every image is loaded and
|
|
460
|
+
# perceptually hashed, and only the highest-resolution copy of each duplicate
|
|
461
|
+
# group is kept. Images that cannot be downloaded or hashed are kept. Default:
|
|
462
|
+
# false.
|
|
463
|
+
dedupe: nil,
|
|
418
464
|
# Optional per-image processing, sent as deep-object query params such as
|
|
419
465
|
# enrichment[resolution]=true.
|
|
420
466
|
enrichment: nil,
|
|
@@ -440,6 +486,7 @@ module ContextDev
|
|
|
440
486
|
sig do
|
|
441
487
|
params(
|
|
442
488
|
url: String,
|
|
489
|
+
country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol,
|
|
443
490
|
exclude_selectors: T::Array[String],
|
|
444
491
|
headers: T::Hash[Symbol, String],
|
|
445
492
|
include_frames: T::Boolean,
|
|
@@ -448,6 +495,7 @@ module ContextDev
|
|
|
448
495
|
include_selectors: T::Array[String],
|
|
449
496
|
max_age_ms: Integer,
|
|
450
497
|
pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash,
|
|
498
|
+
settle_animations: T::Boolean,
|
|
451
499
|
shorten_base64_images: T::Boolean,
|
|
452
500
|
timeout_ms: Integer,
|
|
453
501
|
use_main_content_only: T::Boolean,
|
|
@@ -459,6 +507,9 @@ module ContextDev
|
|
|
459
507
|
# Full URL to scrape into LLM usable Markdown (must include http:// or https://
|
|
460
508
|
# protocol)
|
|
461
509
|
url:,
|
|
510
|
+
# Two-letter ISO 3166-1 alpha-2 country code for the website request location.
|
|
511
|
+
# When provided, Context.dev fetches the target page from that country.
|
|
512
|
+
country: nil,
|
|
462
513
|
# CSS selectors to remove before conversion to Markdown. Applied after
|
|
463
514
|
# includeSelectors. Exclusion takes precedence: an element matching both is
|
|
464
515
|
# removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".
|
|
@@ -484,6 +535,10 @@ module ContextDev
|
|
|
484
535
|
# PDF parsing controls. Use start/end to limit text extraction and OCR to an
|
|
485
536
|
# inclusive 1-based page range.
|
|
486
537
|
pdf: nil,
|
|
538
|
+
# When true, waits briefly for CSS and transition animations to settle before
|
|
539
|
+
# converting to Markdown. Defaults to false. This adds a bit of latency in
|
|
540
|
+
# exchange for more stable output on animated pages.
|
|
541
|
+
settle_animations: nil,
|
|
487
542
|
# Shorten base64-encoded image data in the Markdown output
|
|
488
543
|
shorten_base64_images: nil,
|
|
489
544
|
# Optional timeout in milliseconds for the request. If the request takes longer
|