context.dev 1.36.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 +35 -0
- data/README.md +16 -9
- data/lib/context_dev/client.rb +7 -0
- data/lib/context_dev/models/brand_retrieve_params.rb +1079 -174
- data/lib/context_dev/models/monitor_create_params.rb +364 -0
- data/lib/context_dev/models/monitor_create_response.rb +608 -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 +631 -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 +264 -0
- data/lib/context_dev/models/monitor_retrieve_params.rb +20 -0
- data/lib/context_dev/models/monitor_retrieve_response.rb +608 -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 +371 -0
- data/lib/context_dev/models/monitor_update_response.rb +608 -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_web_crawl_md_params.rb +11 -1
- data/lib/context_dev/models/web_web_scrape_html_params.rb +11 -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 +11 -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 +9 -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 +14 -4
- 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 +3858 -678
- data/rbi/context_dev/models/monitor_create_params.rbi +641 -0
- data/rbi/context_dev/models/monitor_create_response.rbi +1020 -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 +335 -0
- data/rbi/context_dev/models/monitor_list_response.rbi +1089 -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 +469 -0
- data/rbi/context_dev/models/monitor_retrieve_params.rbi +38 -0
- data/rbi/context_dev/models/monitor_retrieve_response.rbi +1028 -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 +681 -0
- data/rbi/context_dev/models/monitor_update_response.rbi +1020 -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_web_crawl_md_params.rbi +15 -0
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +15 -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 +15 -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 +16 -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 +21 -0
- data/sig/context_dev/client.rbs +2 -0
- data/sig/context_dev/models/brand_retrieve_params.rbs +1586 -281
- data/sig/context_dev/models/monitor_create_params.rbs +301 -0
- data/sig/context_dev/models/monitor_create_response.rbs +433 -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 +460 -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 +221 -0
- data/sig/context_dev/models/monitor_retrieve_params.rbs +23 -0
- data/sig/context_dev/models/monitor_retrieve_response.rbs +433 -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 +321 -0
- data/sig/context_dev/models/monitor_update_response.rbs +433 -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_web_crawl_md_params.rbs +7 -0
- data/sig/context_dev/models/web_web_scrape_html_params.rbs +7 -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 +7 -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 +4 -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,1089 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
class MonitorListResponse < ContextDev::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ContextDev::Models::MonitorListResponse,
|
|
10
|
+
ContextDev::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(T::Array[ContextDev::Models::MonitorListResponse::Data]) }
|
|
15
|
+
attr_accessor :data
|
|
16
|
+
|
|
17
|
+
sig { returns(T::Boolean) }
|
|
18
|
+
attr_accessor :has_more
|
|
19
|
+
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_accessor :next_cursor
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
data: T::Array[ContextDev::Models::MonitorListResponse::Data::OrHash],
|
|
26
|
+
has_more: T::Boolean,
|
|
27
|
+
next_cursor: T.nilable(String)
|
|
28
|
+
).returns(T.attached_class)
|
|
29
|
+
end
|
|
30
|
+
def self.new(data:, has_more:, next_cursor:)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
override.returns(
|
|
35
|
+
{
|
|
36
|
+
data: T::Array[ContextDev::Models::MonitorListResponse::Data],
|
|
37
|
+
has_more: T::Boolean,
|
|
38
|
+
next_cursor: T.nilable(String)
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
class Data < ContextDev::Internal::Type::BaseModel
|
|
46
|
+
OrHash =
|
|
47
|
+
T.type_alias do
|
|
48
|
+
T.any(
|
|
49
|
+
ContextDev::Models::MonitorListResponse::Data,
|
|
50
|
+
ContextDev::Internal::AnyHash
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
sig { returns(String) }
|
|
55
|
+
attr_accessor :id
|
|
56
|
+
|
|
57
|
+
# Discriminated union describing how changes are detected.
|
|
58
|
+
sig do
|
|
59
|
+
returns(
|
|
60
|
+
ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Variants
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
attr_accessor :change_detection
|
|
64
|
+
|
|
65
|
+
sig { returns(Time) }
|
|
66
|
+
attr_accessor :created_at
|
|
67
|
+
|
|
68
|
+
# Top-level monitor category. Always `web` today; the concrete behavior is
|
|
69
|
+
# described by `target` and `change_detection`.
|
|
70
|
+
sig do
|
|
71
|
+
returns(
|
|
72
|
+
ContextDev::Models::MonitorListResponse::Data::Mode::TaggedSymbol
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
attr_accessor :mode
|
|
76
|
+
|
|
77
|
+
sig { returns(String) }
|
|
78
|
+
attr_accessor :name
|
|
79
|
+
|
|
80
|
+
# Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
|
|
81
|
+
# every 6 hours or every 2 days. The total interval (frequency × unit) must be
|
|
82
|
+
# between 10 minutes and 1 year.
|
|
83
|
+
sig { returns(ContextDev::Models::MonitorListResponse::Data::Schedule) }
|
|
84
|
+
attr_reader :schedule
|
|
85
|
+
|
|
86
|
+
sig do
|
|
87
|
+
params(
|
|
88
|
+
schedule:
|
|
89
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::OrHash
|
|
90
|
+
).void
|
|
91
|
+
end
|
|
92
|
+
attr_writer :schedule
|
|
93
|
+
|
|
94
|
+
# Monitor lifecycle status. `failed` means the most recent run failed (see the
|
|
95
|
+
# monitor's `last_error`); failed monitors keep running on schedule and flip back
|
|
96
|
+
# to `active` on the next successful run. Monitors are auto-`paused` after
|
|
97
|
+
# repeated consecutive failures or insufficient-credit skips; resume by PATCHing
|
|
98
|
+
# status to `active`.
|
|
99
|
+
sig do
|
|
100
|
+
returns(
|
|
101
|
+
ContextDev::Models::MonitorListResponse::Data::Status::TaggedSymbol
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
attr_accessor :status
|
|
105
|
+
|
|
106
|
+
# Discriminated union describing what the monitor watches.
|
|
107
|
+
sig do
|
|
108
|
+
returns(
|
|
109
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Variants
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
attr_accessor :target
|
|
113
|
+
|
|
114
|
+
sig { returns(Time) }
|
|
115
|
+
attr_accessor :updated_at
|
|
116
|
+
|
|
117
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
118
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
119
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
120
|
+
# after a target or change_detection update, which resets the baseline).
|
|
121
|
+
sig do
|
|
122
|
+
returns(
|
|
123
|
+
T.nilable(
|
|
124
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::Variants
|
|
125
|
+
)
|
|
126
|
+
)
|
|
127
|
+
end
|
|
128
|
+
attr_accessor :baseline
|
|
129
|
+
|
|
130
|
+
sig { returns(T.nilable(Time)) }
|
|
131
|
+
attr_accessor :last_change_at
|
|
132
|
+
|
|
133
|
+
# Error from the most recent failed run; null when the last run succeeded.
|
|
134
|
+
sig do
|
|
135
|
+
returns(
|
|
136
|
+
T.nilable(ContextDev::Models::MonitorListResponse::Data::LastError)
|
|
137
|
+
)
|
|
138
|
+
end
|
|
139
|
+
attr_reader :last_error
|
|
140
|
+
|
|
141
|
+
sig do
|
|
142
|
+
params(
|
|
143
|
+
last_error:
|
|
144
|
+
T.nilable(
|
|
145
|
+
ContextDev::Models::MonitorListResponse::Data::LastError::OrHash
|
|
146
|
+
)
|
|
147
|
+
).void
|
|
148
|
+
end
|
|
149
|
+
attr_writer :last_error
|
|
150
|
+
|
|
151
|
+
sig { returns(T.nilable(Time)) }
|
|
152
|
+
attr_accessor :last_run_at
|
|
153
|
+
|
|
154
|
+
# When the next scheduled run is due.
|
|
155
|
+
sig { returns(T.nilable(Time)) }
|
|
156
|
+
attr_accessor :next_run_at
|
|
157
|
+
|
|
158
|
+
# User-defined tags for grouping and filtering monitors and their changes.
|
|
159
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
160
|
+
attr_reader :tags
|
|
161
|
+
|
|
162
|
+
sig { params(tags: T::Array[String]).void }
|
|
163
|
+
attr_writer :tags
|
|
164
|
+
|
|
165
|
+
sig do
|
|
166
|
+
returns(
|
|
167
|
+
T.nilable(ContextDev::Models::MonitorListResponse::Data::Webhook)
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
attr_reader :webhook
|
|
171
|
+
|
|
172
|
+
sig do
|
|
173
|
+
params(
|
|
174
|
+
webhook:
|
|
175
|
+
T.nilable(
|
|
176
|
+
ContextDev::Models::MonitorListResponse::Data::Webhook::OrHash
|
|
177
|
+
)
|
|
178
|
+
).void
|
|
179
|
+
end
|
|
180
|
+
attr_writer :webhook
|
|
181
|
+
|
|
182
|
+
# A web monitor. `mode` is the constant `web`; behavior is described by `target`
|
|
183
|
+
# (page/sitemap/extract) and `change_detection` (exact/semantic).
|
|
184
|
+
sig do
|
|
185
|
+
params(
|
|
186
|
+
id: String,
|
|
187
|
+
change_detection:
|
|
188
|
+
T.any(
|
|
189
|
+
ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact::OrHash,
|
|
190
|
+
ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic::OrHash
|
|
191
|
+
),
|
|
192
|
+
created_at: Time,
|
|
193
|
+
mode: ContextDev::Models::MonitorListResponse::Data::Mode::OrSymbol,
|
|
194
|
+
name: String,
|
|
195
|
+
schedule:
|
|
196
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::OrHash,
|
|
197
|
+
status:
|
|
198
|
+
ContextDev::Models::MonitorListResponse::Data::Status::OrSymbol,
|
|
199
|
+
target:
|
|
200
|
+
T.any(
|
|
201
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Page::OrHash,
|
|
202
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Sitemap::OrHash,
|
|
203
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Extract::OrHash
|
|
204
|
+
),
|
|
205
|
+
updated_at: Time,
|
|
206
|
+
baseline:
|
|
207
|
+
T.nilable(
|
|
208
|
+
T.any(
|
|
209
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline::OrHash,
|
|
210
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline::OrHash,
|
|
211
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline::OrHash
|
|
212
|
+
)
|
|
213
|
+
),
|
|
214
|
+
last_change_at: T.nilable(Time),
|
|
215
|
+
last_error:
|
|
216
|
+
T.nilable(
|
|
217
|
+
ContextDev::Models::MonitorListResponse::Data::LastError::OrHash
|
|
218
|
+
),
|
|
219
|
+
last_run_at: T.nilable(Time),
|
|
220
|
+
next_run_at: T.nilable(Time),
|
|
221
|
+
tags: T::Array[String],
|
|
222
|
+
webhook:
|
|
223
|
+
T.nilable(
|
|
224
|
+
ContextDev::Models::MonitorListResponse::Data::Webhook::OrHash
|
|
225
|
+
)
|
|
226
|
+
).returns(T.attached_class)
|
|
227
|
+
end
|
|
228
|
+
def self.new(
|
|
229
|
+
id:,
|
|
230
|
+
# Discriminated union describing how changes are detected.
|
|
231
|
+
change_detection:,
|
|
232
|
+
created_at:,
|
|
233
|
+
# Top-level monitor category. Always `web` today; the concrete behavior is
|
|
234
|
+
# described by `target` and `change_detection`.
|
|
235
|
+
mode:,
|
|
236
|
+
name:,
|
|
237
|
+
# Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
|
|
238
|
+
# every 6 hours or every 2 days. The total interval (frequency × unit) must be
|
|
239
|
+
# between 10 minutes and 1 year.
|
|
240
|
+
schedule:,
|
|
241
|
+
# Monitor lifecycle status. `failed` means the most recent run failed (see the
|
|
242
|
+
# monitor's `last_error`); failed monitors keep running on schedule and flip back
|
|
243
|
+
# to `active` on the next successful run. Monitors are auto-`paused` after
|
|
244
|
+
# repeated consecutive failures or insufficient-credit skips; resume by PATCHing
|
|
245
|
+
# status to `active`.
|
|
246
|
+
status:,
|
|
247
|
+
# Discriminated union describing what the monitor watches.
|
|
248
|
+
target:,
|
|
249
|
+
updated_at:,
|
|
250
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
251
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
252
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
253
|
+
# after a target or change_detection update, which resets the baseline).
|
|
254
|
+
baseline: nil,
|
|
255
|
+
last_change_at: nil,
|
|
256
|
+
# Error from the most recent failed run; null when the last run succeeded.
|
|
257
|
+
last_error: nil,
|
|
258
|
+
last_run_at: nil,
|
|
259
|
+
# When the next scheduled run is due.
|
|
260
|
+
next_run_at: nil,
|
|
261
|
+
# User-defined tags for grouping and filtering monitors and their changes.
|
|
262
|
+
tags: nil,
|
|
263
|
+
webhook: nil
|
|
264
|
+
)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
sig do
|
|
268
|
+
override.returns(
|
|
269
|
+
{
|
|
270
|
+
id: String,
|
|
271
|
+
change_detection:
|
|
272
|
+
ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Variants,
|
|
273
|
+
created_at: Time,
|
|
274
|
+
mode:
|
|
275
|
+
ContextDev::Models::MonitorListResponse::Data::Mode::TaggedSymbol,
|
|
276
|
+
name: String,
|
|
277
|
+
schedule: ContextDev::Models::MonitorListResponse::Data::Schedule,
|
|
278
|
+
status:
|
|
279
|
+
ContextDev::Models::MonitorListResponse::Data::Status::TaggedSymbol,
|
|
280
|
+
target:
|
|
281
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Variants,
|
|
282
|
+
updated_at: Time,
|
|
283
|
+
baseline:
|
|
284
|
+
T.nilable(
|
|
285
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::Variants
|
|
286
|
+
),
|
|
287
|
+
last_change_at: T.nilable(Time),
|
|
288
|
+
last_error:
|
|
289
|
+
T.nilable(
|
|
290
|
+
ContextDev::Models::MonitorListResponse::Data::LastError
|
|
291
|
+
),
|
|
292
|
+
last_run_at: T.nilable(Time),
|
|
293
|
+
next_run_at: T.nilable(Time),
|
|
294
|
+
tags: T::Array[String],
|
|
295
|
+
webhook:
|
|
296
|
+
T.nilable(
|
|
297
|
+
ContextDev::Models::MonitorListResponse::Data::Webhook
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
end
|
|
302
|
+
def to_hash
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Discriminated union describing how changes are detected.
|
|
306
|
+
module ChangeDetection
|
|
307
|
+
extend ContextDev::Internal::Type::Union
|
|
308
|
+
|
|
309
|
+
Variants =
|
|
310
|
+
T.type_alias do
|
|
311
|
+
T.any(
|
|
312
|
+
ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact,
|
|
313
|
+
ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic
|
|
314
|
+
)
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
class Exact < ContextDev::Internal::Type::BaseModel
|
|
318
|
+
OrHash =
|
|
319
|
+
T.type_alias do
|
|
320
|
+
T.any(
|
|
321
|
+
ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Exact,
|
|
322
|
+
ContextDev::Internal::AnyHash
|
|
323
|
+
)
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
sig { returns(Symbol) }
|
|
327
|
+
attr_accessor :type
|
|
328
|
+
|
|
329
|
+
# Detect exact changes. For page targets, this means visible text diffs. For
|
|
330
|
+
# sitemap targets, this means URL additions and removals.
|
|
331
|
+
sig { params(type: Symbol).returns(T.attached_class) }
|
|
332
|
+
def self.new(type: :exact)
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
sig { override.returns({ type: Symbol }) }
|
|
336
|
+
def to_hash
|
|
337
|
+
end
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
class Semantic < ContextDev::Internal::Type::BaseModel
|
|
341
|
+
OrHash =
|
|
342
|
+
T.type_alias do
|
|
343
|
+
T.any(
|
|
344
|
+
ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Semantic,
|
|
345
|
+
ContextDev::Internal::AnyHash
|
|
346
|
+
)
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
sig { returns(Symbol) }
|
|
350
|
+
attr_accessor :type
|
|
351
|
+
|
|
352
|
+
sig { returns(T.nilable(Float)) }
|
|
353
|
+
attr_reader :confidence_threshold
|
|
354
|
+
|
|
355
|
+
sig { params(confidence_threshold: Float).void }
|
|
356
|
+
attr_writer :confidence_threshold
|
|
357
|
+
|
|
358
|
+
# Detect meaning-level changes to the extracted data, ignoring cosmetic or
|
|
359
|
+
# paraphrase-only differences. What is watched is determined by the extract
|
|
360
|
+
# target's `schema` and `instructions`.
|
|
361
|
+
sig do
|
|
362
|
+
params(confidence_threshold: Float, type: Symbol).returns(
|
|
363
|
+
T.attached_class
|
|
364
|
+
)
|
|
365
|
+
end
|
|
366
|
+
def self.new(confidence_threshold: nil, type: :semantic)
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
sig do
|
|
370
|
+
override.returns({ type: Symbol, confidence_threshold: Float })
|
|
371
|
+
end
|
|
372
|
+
def to_hash
|
|
373
|
+
end
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
sig do
|
|
377
|
+
override.returns(
|
|
378
|
+
T::Array[
|
|
379
|
+
ContextDev::Models::MonitorListResponse::Data::ChangeDetection::Variants
|
|
380
|
+
]
|
|
381
|
+
)
|
|
382
|
+
end
|
|
383
|
+
def self.variants
|
|
384
|
+
end
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
# Top-level monitor category. Always `web` today; the concrete behavior is
|
|
388
|
+
# described by `target` and `change_detection`.
|
|
389
|
+
module Mode
|
|
390
|
+
extend ContextDev::Internal::Type::Enum
|
|
391
|
+
|
|
392
|
+
TaggedSymbol =
|
|
393
|
+
T.type_alias do
|
|
394
|
+
T.all(Symbol, ContextDev::Models::MonitorListResponse::Data::Mode)
|
|
395
|
+
end
|
|
396
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
397
|
+
|
|
398
|
+
WEB =
|
|
399
|
+
T.let(
|
|
400
|
+
:web,
|
|
401
|
+
ContextDev::Models::MonitorListResponse::Data::Mode::TaggedSymbol
|
|
402
|
+
)
|
|
403
|
+
|
|
404
|
+
sig do
|
|
405
|
+
override.returns(
|
|
406
|
+
T::Array[
|
|
407
|
+
ContextDev::Models::MonitorListResponse::Data::Mode::TaggedSymbol
|
|
408
|
+
]
|
|
409
|
+
)
|
|
410
|
+
end
|
|
411
|
+
def self.values
|
|
412
|
+
end
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
class Schedule < ContextDev::Internal::Type::BaseModel
|
|
416
|
+
OrHash =
|
|
417
|
+
T.type_alias do
|
|
418
|
+
T.any(
|
|
419
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule,
|
|
420
|
+
ContextDev::Internal::AnyHash
|
|
421
|
+
)
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
# Number of units between runs. The resulting interval (frequency × unit) must be
|
|
425
|
+
# at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
|
|
426
|
+
# maximum 365 when unit is days).
|
|
427
|
+
sig { returns(Integer) }
|
|
428
|
+
attr_accessor :frequency
|
|
429
|
+
|
|
430
|
+
sig do
|
|
431
|
+
returns(
|
|
432
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Type::TaggedSymbol
|
|
433
|
+
)
|
|
434
|
+
end
|
|
435
|
+
attr_accessor :type
|
|
436
|
+
|
|
437
|
+
sig do
|
|
438
|
+
returns(
|
|
439
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Unit::TaggedSymbol
|
|
440
|
+
)
|
|
441
|
+
end
|
|
442
|
+
attr_accessor :unit
|
|
443
|
+
|
|
444
|
+
# Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
|
|
445
|
+
# every 6 hours or every 2 days. The total interval (frequency × unit) must be
|
|
446
|
+
# between 10 minutes and 1 year.
|
|
447
|
+
sig do
|
|
448
|
+
params(
|
|
449
|
+
frequency: Integer,
|
|
450
|
+
type:
|
|
451
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Type::OrSymbol,
|
|
452
|
+
unit:
|
|
453
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Unit::OrSymbol
|
|
454
|
+
).returns(T.attached_class)
|
|
455
|
+
end
|
|
456
|
+
def self.new(
|
|
457
|
+
# Number of units between runs. The resulting interval (frequency × unit) must be
|
|
458
|
+
# at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
|
|
459
|
+
# maximum 365 when unit is days).
|
|
460
|
+
frequency:,
|
|
461
|
+
type:,
|
|
462
|
+
unit:
|
|
463
|
+
)
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
sig do
|
|
467
|
+
override.returns(
|
|
468
|
+
{
|
|
469
|
+
frequency: Integer,
|
|
470
|
+
type:
|
|
471
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Type::TaggedSymbol,
|
|
472
|
+
unit:
|
|
473
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Unit::TaggedSymbol
|
|
474
|
+
}
|
|
475
|
+
)
|
|
476
|
+
end
|
|
477
|
+
def to_hash
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
module Type
|
|
481
|
+
extend ContextDev::Internal::Type::Enum
|
|
482
|
+
|
|
483
|
+
TaggedSymbol =
|
|
484
|
+
T.type_alias do
|
|
485
|
+
T.all(
|
|
486
|
+
Symbol,
|
|
487
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Type
|
|
488
|
+
)
|
|
489
|
+
end
|
|
490
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
491
|
+
|
|
492
|
+
INTERVAL =
|
|
493
|
+
T.let(
|
|
494
|
+
:interval,
|
|
495
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Type::TaggedSymbol
|
|
496
|
+
)
|
|
497
|
+
|
|
498
|
+
sig do
|
|
499
|
+
override.returns(
|
|
500
|
+
T::Array[
|
|
501
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Type::TaggedSymbol
|
|
502
|
+
]
|
|
503
|
+
)
|
|
504
|
+
end
|
|
505
|
+
def self.values
|
|
506
|
+
end
|
|
507
|
+
end
|
|
508
|
+
|
|
509
|
+
module Unit
|
|
510
|
+
extend ContextDev::Internal::Type::Enum
|
|
511
|
+
|
|
512
|
+
TaggedSymbol =
|
|
513
|
+
T.type_alias do
|
|
514
|
+
T.all(
|
|
515
|
+
Symbol,
|
|
516
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Unit
|
|
517
|
+
)
|
|
518
|
+
end
|
|
519
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
520
|
+
|
|
521
|
+
MINUTES =
|
|
522
|
+
T.let(
|
|
523
|
+
:minutes,
|
|
524
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Unit::TaggedSymbol
|
|
525
|
+
)
|
|
526
|
+
HOURS =
|
|
527
|
+
T.let(
|
|
528
|
+
:hours,
|
|
529
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Unit::TaggedSymbol
|
|
530
|
+
)
|
|
531
|
+
DAYS =
|
|
532
|
+
T.let(
|
|
533
|
+
:days,
|
|
534
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Unit::TaggedSymbol
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
sig do
|
|
538
|
+
override.returns(
|
|
539
|
+
T::Array[
|
|
540
|
+
ContextDev::Models::MonitorListResponse::Data::Schedule::Unit::TaggedSymbol
|
|
541
|
+
]
|
|
542
|
+
)
|
|
543
|
+
end
|
|
544
|
+
def self.values
|
|
545
|
+
end
|
|
546
|
+
end
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
# Monitor lifecycle status. `failed` means the most recent run failed (see the
|
|
550
|
+
# monitor's `last_error`); failed monitors keep running on schedule and flip back
|
|
551
|
+
# to `active` on the next successful run. Monitors are auto-`paused` after
|
|
552
|
+
# repeated consecutive failures or insufficient-credit skips; resume by PATCHing
|
|
553
|
+
# status to `active`.
|
|
554
|
+
module Status
|
|
555
|
+
extend ContextDev::Internal::Type::Enum
|
|
556
|
+
|
|
557
|
+
TaggedSymbol =
|
|
558
|
+
T.type_alias do
|
|
559
|
+
T.all(
|
|
560
|
+
Symbol,
|
|
561
|
+
ContextDev::Models::MonitorListResponse::Data::Status
|
|
562
|
+
)
|
|
563
|
+
end
|
|
564
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
565
|
+
|
|
566
|
+
ACTIVE =
|
|
567
|
+
T.let(
|
|
568
|
+
:active,
|
|
569
|
+
ContextDev::Models::MonitorListResponse::Data::Status::TaggedSymbol
|
|
570
|
+
)
|
|
571
|
+
PAUSED =
|
|
572
|
+
T.let(
|
|
573
|
+
:paused,
|
|
574
|
+
ContextDev::Models::MonitorListResponse::Data::Status::TaggedSymbol
|
|
575
|
+
)
|
|
576
|
+
FAILED =
|
|
577
|
+
T.let(
|
|
578
|
+
:failed,
|
|
579
|
+
ContextDev::Models::MonitorListResponse::Data::Status::TaggedSymbol
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
sig do
|
|
583
|
+
override.returns(
|
|
584
|
+
T::Array[
|
|
585
|
+
ContextDev::Models::MonitorListResponse::Data::Status::TaggedSymbol
|
|
586
|
+
]
|
|
587
|
+
)
|
|
588
|
+
end
|
|
589
|
+
def self.values
|
|
590
|
+
end
|
|
591
|
+
end
|
|
592
|
+
|
|
593
|
+
# Discriminated union describing what the monitor watches.
|
|
594
|
+
module Target
|
|
595
|
+
extend ContextDev::Internal::Type::Union
|
|
596
|
+
|
|
597
|
+
Variants =
|
|
598
|
+
T.type_alias do
|
|
599
|
+
T.any(
|
|
600
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Page,
|
|
601
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Sitemap,
|
|
602
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Extract
|
|
603
|
+
)
|
|
604
|
+
end
|
|
605
|
+
|
|
606
|
+
class Page < ContextDev::Internal::Type::BaseModel
|
|
607
|
+
OrHash =
|
|
608
|
+
T.type_alias do
|
|
609
|
+
T.any(
|
|
610
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Page,
|
|
611
|
+
ContextDev::Internal::AnyHash
|
|
612
|
+
)
|
|
613
|
+
end
|
|
614
|
+
|
|
615
|
+
sig { returns(Symbol) }
|
|
616
|
+
attr_accessor :type
|
|
617
|
+
|
|
618
|
+
sig { returns(String) }
|
|
619
|
+
attr_accessor :url
|
|
620
|
+
|
|
621
|
+
# Normalize whitespace before comparing or analyzing text.
|
|
622
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
623
|
+
attr_reader :normalize_whitespace
|
|
624
|
+
|
|
625
|
+
sig { params(normalize_whitespace: T::Boolean).void }
|
|
626
|
+
attr_writer :normalize_whitespace
|
|
627
|
+
|
|
628
|
+
# Watch a single web page.
|
|
629
|
+
sig do
|
|
630
|
+
params(
|
|
631
|
+
url: String,
|
|
632
|
+
normalize_whitespace: T::Boolean,
|
|
633
|
+
type: Symbol
|
|
634
|
+
).returns(T.attached_class)
|
|
635
|
+
end
|
|
636
|
+
def self.new(
|
|
637
|
+
url:,
|
|
638
|
+
# Normalize whitespace before comparing or analyzing text.
|
|
639
|
+
normalize_whitespace: nil,
|
|
640
|
+
type: :page
|
|
641
|
+
)
|
|
642
|
+
end
|
|
643
|
+
|
|
644
|
+
sig do
|
|
645
|
+
override.returns(
|
|
646
|
+
{ type: Symbol, url: String, normalize_whitespace: T::Boolean }
|
|
647
|
+
)
|
|
648
|
+
end
|
|
649
|
+
def to_hash
|
|
650
|
+
end
|
|
651
|
+
end
|
|
652
|
+
|
|
653
|
+
class Sitemap < ContextDev::Internal::Type::BaseModel
|
|
654
|
+
OrHash =
|
|
655
|
+
T.type_alias do
|
|
656
|
+
T.any(
|
|
657
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Sitemap,
|
|
658
|
+
ContextDev::Internal::AnyHash
|
|
659
|
+
)
|
|
660
|
+
end
|
|
661
|
+
|
|
662
|
+
sig { returns(Symbol) }
|
|
663
|
+
attr_accessor :type
|
|
664
|
+
|
|
665
|
+
# Sitemap URL to monitor.
|
|
666
|
+
sig { returns(String) }
|
|
667
|
+
attr_accessor :url
|
|
668
|
+
|
|
669
|
+
# URL path patterns to exclude.
|
|
670
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
671
|
+
attr_reader :exclude
|
|
672
|
+
|
|
673
|
+
sig { params(exclude: T::Array[String]).void }
|
|
674
|
+
attr_writer :exclude
|
|
675
|
+
|
|
676
|
+
# URL path patterns to include.
|
|
677
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
678
|
+
attr_reader :include
|
|
679
|
+
|
|
680
|
+
sig { params(include: T::Array[String]).void }
|
|
681
|
+
attr_writer :include
|
|
682
|
+
|
|
683
|
+
# Maximum number of sitemap URLs to track (capped at 10,000).
|
|
684
|
+
sig { returns(T.nilable(Integer)) }
|
|
685
|
+
attr_reader :max_urls
|
|
686
|
+
|
|
687
|
+
sig { params(max_urls: Integer).void }
|
|
688
|
+
attr_writer :max_urls
|
|
689
|
+
|
|
690
|
+
# Watch a sitemap for URL additions and removals. Crawled URLs are normalized
|
|
691
|
+
# (lowercased host, no trailing slash/fragment) and scoped to the monitored site
|
|
692
|
+
# and its subdomains before comparison. On a detected difference the sitemap is
|
|
693
|
+
# re-fetched within the same run and only URLs both observations agree on are
|
|
694
|
+
# reported, suppressing transient crawl flaps.
|
|
695
|
+
sig do
|
|
696
|
+
params(
|
|
697
|
+
url: String,
|
|
698
|
+
exclude: T::Array[String],
|
|
699
|
+
include: T::Array[String],
|
|
700
|
+
max_urls: Integer,
|
|
701
|
+
type: Symbol
|
|
702
|
+
).returns(T.attached_class)
|
|
703
|
+
end
|
|
704
|
+
def self.new(
|
|
705
|
+
# Sitemap URL to monitor.
|
|
706
|
+
url:,
|
|
707
|
+
# URL path patterns to exclude.
|
|
708
|
+
exclude: nil,
|
|
709
|
+
# URL path patterns to include.
|
|
710
|
+
include: nil,
|
|
711
|
+
# Maximum number of sitemap URLs to track (capped at 10,000).
|
|
712
|
+
max_urls: nil,
|
|
713
|
+
type: :sitemap
|
|
714
|
+
)
|
|
715
|
+
end
|
|
716
|
+
|
|
717
|
+
sig do
|
|
718
|
+
override.returns(
|
|
719
|
+
{
|
|
720
|
+
type: Symbol,
|
|
721
|
+
url: String,
|
|
722
|
+
exclude: T::Array[String],
|
|
723
|
+
include: T::Array[String],
|
|
724
|
+
max_urls: Integer
|
|
725
|
+
}
|
|
726
|
+
)
|
|
727
|
+
end
|
|
728
|
+
def to_hash
|
|
729
|
+
end
|
|
730
|
+
end
|
|
731
|
+
|
|
732
|
+
class Extract < ContextDev::Internal::Type::BaseModel
|
|
733
|
+
OrHash =
|
|
734
|
+
T.type_alias do
|
|
735
|
+
T.any(
|
|
736
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Extract,
|
|
737
|
+
ContextDev::Internal::AnyHash
|
|
738
|
+
)
|
|
739
|
+
end
|
|
740
|
+
|
|
741
|
+
# Natural-language instructions guiding which pages and facts to track and which
|
|
742
|
+
# changes to report.
|
|
743
|
+
sig { returns(String) }
|
|
744
|
+
attr_accessor :instructions
|
|
745
|
+
|
|
746
|
+
sig { returns(Symbol) }
|
|
747
|
+
attr_accessor :type
|
|
748
|
+
|
|
749
|
+
# Root URL to extract structured data from.
|
|
750
|
+
sig { returns(String) }
|
|
751
|
+
attr_accessor :url
|
|
752
|
+
|
|
753
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
754
|
+
attr_reader :follow_subdomains
|
|
755
|
+
|
|
756
|
+
sig { params(follow_subdomains: T::Boolean).void }
|
|
757
|
+
attr_writer :follow_subdomains
|
|
758
|
+
|
|
759
|
+
# Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
760
|
+
sig { returns(T.nilable(Integer)) }
|
|
761
|
+
attr_reader :max_depth
|
|
762
|
+
|
|
763
|
+
sig { params(max_depth: Integer).void }
|
|
764
|
+
attr_writer :max_depth
|
|
765
|
+
|
|
766
|
+
# Maximum number of pages to track.
|
|
767
|
+
sig { returns(T.nilable(Integer)) }
|
|
768
|
+
attr_reader :max_pages
|
|
769
|
+
|
|
770
|
+
sig { params(max_pages: Integer).void }
|
|
771
|
+
attr_writer :max_pages
|
|
772
|
+
|
|
773
|
+
# JSON Schema describing the data you care about. It guides which pages are
|
|
774
|
+
# selected for tracking and gives the change judge context on what matters. If
|
|
775
|
+
# omitted, a default summary + key-points schema is used.
|
|
776
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
777
|
+
attr_reader :schema
|
|
778
|
+
|
|
779
|
+
sig { params(schema: T::Hash[Symbol, T.anything]).void }
|
|
780
|
+
attr_writer :schema
|
|
781
|
+
|
|
782
|
+
# Watch the monitor-relevant pages of a site for meaningful changes. A crawl
|
|
783
|
+
# guided by `schema`/`instructions` selects up to `max_pages` relevant pages to
|
|
784
|
+
# track; each run re-checks exactly those pages, and confirmed content changes are
|
|
785
|
+
# judged against the monitor's instructions. The tracked page set is refreshed by
|
|
786
|
+
# a periodic re-discovery crawl.
|
|
787
|
+
sig do
|
|
788
|
+
params(
|
|
789
|
+
instructions: String,
|
|
790
|
+
url: String,
|
|
791
|
+
follow_subdomains: T::Boolean,
|
|
792
|
+
max_depth: Integer,
|
|
793
|
+
max_pages: Integer,
|
|
794
|
+
schema: T::Hash[Symbol, T.anything],
|
|
795
|
+
type: Symbol
|
|
796
|
+
).returns(T.attached_class)
|
|
797
|
+
end
|
|
798
|
+
def self.new(
|
|
799
|
+
# Natural-language instructions guiding which pages and facts to track and which
|
|
800
|
+
# changes to report.
|
|
801
|
+
instructions:,
|
|
802
|
+
# Root URL to extract structured data from.
|
|
803
|
+
url:,
|
|
804
|
+
follow_subdomains: nil,
|
|
805
|
+
# Optional maximum link depth from the starting URL (0 = only the starting page).
|
|
806
|
+
max_depth: nil,
|
|
807
|
+
# Maximum number of pages to track.
|
|
808
|
+
max_pages: nil,
|
|
809
|
+
# JSON Schema describing the data you care about. It guides which pages are
|
|
810
|
+
# selected for tracking and gives the change judge context on what matters. If
|
|
811
|
+
# omitted, a default summary + key-points schema is used.
|
|
812
|
+
schema: nil,
|
|
813
|
+
type: :extract
|
|
814
|
+
)
|
|
815
|
+
end
|
|
816
|
+
|
|
817
|
+
sig do
|
|
818
|
+
override.returns(
|
|
819
|
+
{
|
|
820
|
+
instructions: String,
|
|
821
|
+
type: Symbol,
|
|
822
|
+
url: String,
|
|
823
|
+
follow_subdomains: T::Boolean,
|
|
824
|
+
max_depth: Integer,
|
|
825
|
+
max_pages: Integer,
|
|
826
|
+
schema: T::Hash[Symbol, T.anything]
|
|
827
|
+
}
|
|
828
|
+
)
|
|
829
|
+
end
|
|
830
|
+
def to_hash
|
|
831
|
+
end
|
|
832
|
+
end
|
|
833
|
+
|
|
834
|
+
sig do
|
|
835
|
+
override.returns(
|
|
836
|
+
T::Array[
|
|
837
|
+
ContextDev::Models::MonitorListResponse::Data::Target::Variants
|
|
838
|
+
]
|
|
839
|
+
)
|
|
840
|
+
end
|
|
841
|
+
def self.variants
|
|
842
|
+
end
|
|
843
|
+
end
|
|
844
|
+
|
|
845
|
+
# Current baseline: the last observed value the monitor compares new snapshots
|
|
846
|
+
# against. Its shape follows `target.type` (page/sitemap/extract). Only populated
|
|
847
|
+
# on GET /monitors/{monitor_id}; null until the first baseline run completes (and
|
|
848
|
+
# after a target or change_detection update, which resets the baseline).
|
|
849
|
+
module Baseline
|
|
850
|
+
extend ContextDev::Internal::Type::Union
|
|
851
|
+
|
|
852
|
+
Variants =
|
|
853
|
+
T.type_alias do
|
|
854
|
+
T.any(
|
|
855
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline,
|
|
856
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline,
|
|
857
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline
|
|
858
|
+
)
|
|
859
|
+
end
|
|
860
|
+
|
|
861
|
+
class MonitorsPageBaseline < ContextDev::Internal::Type::BaseModel
|
|
862
|
+
OrHash =
|
|
863
|
+
T.type_alias do
|
|
864
|
+
T.any(
|
|
865
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsPageBaseline,
|
|
866
|
+
ContextDev::Internal::AnyHash
|
|
867
|
+
)
|
|
868
|
+
end
|
|
869
|
+
|
|
870
|
+
# When this baseline was last captured or replaced.
|
|
871
|
+
sig { returns(Time) }
|
|
872
|
+
attr_accessor :captured_at
|
|
873
|
+
|
|
874
|
+
# The page's visible text as last observed.
|
|
875
|
+
sig { returns(String) }
|
|
876
|
+
attr_accessor :text
|
|
877
|
+
|
|
878
|
+
# Current baseline of a `page` monitor: the visible page text as last observed.
|
|
879
|
+
sig do
|
|
880
|
+
params(captured_at: Time, text: String).returns(T.attached_class)
|
|
881
|
+
end
|
|
882
|
+
def self.new(
|
|
883
|
+
# When this baseline was last captured or replaced.
|
|
884
|
+
captured_at:,
|
|
885
|
+
# The page's visible text as last observed.
|
|
886
|
+
text:
|
|
887
|
+
)
|
|
888
|
+
end
|
|
889
|
+
|
|
890
|
+
sig { override.returns({ captured_at: Time, text: String }) }
|
|
891
|
+
def to_hash
|
|
892
|
+
end
|
|
893
|
+
end
|
|
894
|
+
|
|
895
|
+
class MonitorsSitemapBaseline < ContextDev::Internal::Type::BaseModel
|
|
896
|
+
OrHash =
|
|
897
|
+
T.type_alias do
|
|
898
|
+
T.any(
|
|
899
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsSitemapBaseline,
|
|
900
|
+
ContextDev::Internal::AnyHash
|
|
901
|
+
)
|
|
902
|
+
end
|
|
903
|
+
|
|
904
|
+
# When this baseline was last captured or replaced.
|
|
905
|
+
sig { returns(Time) }
|
|
906
|
+
attr_accessor :captured_at
|
|
907
|
+
|
|
908
|
+
# Number of URLs in the baseline.
|
|
909
|
+
sig { returns(Integer) }
|
|
910
|
+
attr_accessor :url_count
|
|
911
|
+
|
|
912
|
+
# The sitemap URLs as last observed (sorted, normalized).
|
|
913
|
+
sig { returns(T::Array[String]) }
|
|
914
|
+
attr_accessor :urls
|
|
915
|
+
|
|
916
|
+
# Current baseline of a `sitemap` monitor: the normalized URL set as last
|
|
917
|
+
# observed.
|
|
918
|
+
sig do
|
|
919
|
+
params(
|
|
920
|
+
captured_at: Time,
|
|
921
|
+
url_count: Integer,
|
|
922
|
+
urls: T::Array[String]
|
|
923
|
+
).returns(T.attached_class)
|
|
924
|
+
end
|
|
925
|
+
def self.new(
|
|
926
|
+
# When this baseline was last captured or replaced.
|
|
927
|
+
captured_at:,
|
|
928
|
+
# Number of URLs in the baseline.
|
|
929
|
+
url_count:,
|
|
930
|
+
# The sitemap URLs as last observed (sorted, normalized).
|
|
931
|
+
urls:
|
|
932
|
+
)
|
|
933
|
+
end
|
|
934
|
+
|
|
935
|
+
sig do
|
|
936
|
+
override.returns(
|
|
937
|
+
{
|
|
938
|
+
captured_at: Time,
|
|
939
|
+
url_count: Integer,
|
|
940
|
+
urls: T::Array[String]
|
|
941
|
+
}
|
|
942
|
+
)
|
|
943
|
+
end
|
|
944
|
+
def to_hash
|
|
945
|
+
end
|
|
946
|
+
end
|
|
947
|
+
|
|
948
|
+
class MonitorsExtractBaseline < ContextDev::Internal::Type::BaseModel
|
|
949
|
+
OrHash =
|
|
950
|
+
T.type_alias do
|
|
951
|
+
T.any(
|
|
952
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::MonitorsExtractBaseline,
|
|
953
|
+
ContextDev::Internal::AnyHash
|
|
954
|
+
)
|
|
955
|
+
end
|
|
956
|
+
|
|
957
|
+
# When this baseline was last captured or replaced.
|
|
958
|
+
sig { returns(Time) }
|
|
959
|
+
attr_accessor :captured_at
|
|
960
|
+
|
|
961
|
+
# The extracted structured data, matching the monitor's extraction schema (same
|
|
962
|
+
# shape as the /web/extract endpoint's `data`). Refreshed when the monitor
|
|
963
|
+
# re-discovers its page set (at most about once a day); `null` when no extraction
|
|
964
|
+
# has been captured yet.
|
|
965
|
+
sig { returns(T.anything) }
|
|
966
|
+
attr_accessor :data
|
|
967
|
+
|
|
968
|
+
# The page URLs the monitor tracks and analyzes for changes.
|
|
969
|
+
sig { returns(T::Array[String]) }
|
|
970
|
+
attr_accessor :urls_analyzed
|
|
971
|
+
|
|
972
|
+
# Current baseline of an `extract` monitor: the pages it tracks and the structured
|
|
973
|
+
# data as last extracted.
|
|
974
|
+
sig do
|
|
975
|
+
params(
|
|
976
|
+
captured_at: Time,
|
|
977
|
+
data: T.anything,
|
|
978
|
+
urls_analyzed: T::Array[String]
|
|
979
|
+
).returns(T.attached_class)
|
|
980
|
+
end
|
|
981
|
+
def self.new(
|
|
982
|
+
# When this baseline was last captured or replaced.
|
|
983
|
+
captured_at:,
|
|
984
|
+
# The extracted structured data, matching the monitor's extraction schema (same
|
|
985
|
+
# shape as the /web/extract endpoint's `data`). Refreshed when the monitor
|
|
986
|
+
# re-discovers its page set (at most about once a day); `null` when no extraction
|
|
987
|
+
# has been captured yet.
|
|
988
|
+
data:,
|
|
989
|
+
# The page URLs the monitor tracks and analyzes for changes.
|
|
990
|
+
urls_analyzed:
|
|
991
|
+
)
|
|
992
|
+
end
|
|
993
|
+
|
|
994
|
+
sig do
|
|
995
|
+
override.returns(
|
|
996
|
+
{
|
|
997
|
+
captured_at: Time,
|
|
998
|
+
data: T.anything,
|
|
999
|
+
urls_analyzed: T::Array[String]
|
|
1000
|
+
}
|
|
1001
|
+
)
|
|
1002
|
+
end
|
|
1003
|
+
def to_hash
|
|
1004
|
+
end
|
|
1005
|
+
end
|
|
1006
|
+
|
|
1007
|
+
sig do
|
|
1008
|
+
override.returns(
|
|
1009
|
+
T::Array[
|
|
1010
|
+
ContextDev::Models::MonitorListResponse::Data::Baseline::Variants
|
|
1011
|
+
]
|
|
1012
|
+
)
|
|
1013
|
+
end
|
|
1014
|
+
def self.variants
|
|
1015
|
+
end
|
|
1016
|
+
end
|
|
1017
|
+
|
|
1018
|
+
class LastError < ContextDev::Internal::Type::BaseModel
|
|
1019
|
+
OrHash =
|
|
1020
|
+
T.type_alias do
|
|
1021
|
+
T.any(
|
|
1022
|
+
ContextDev::Models::MonitorListResponse::Data::LastError,
|
|
1023
|
+
ContextDev::Internal::AnyHash
|
|
1024
|
+
)
|
|
1025
|
+
end
|
|
1026
|
+
|
|
1027
|
+
sig { returns(String) }
|
|
1028
|
+
attr_accessor :code
|
|
1029
|
+
|
|
1030
|
+
sig { returns(String) }
|
|
1031
|
+
attr_accessor :message
|
|
1032
|
+
|
|
1033
|
+
# Error from the most recent failed run; null when the last run succeeded.
|
|
1034
|
+
sig do
|
|
1035
|
+
params(code: String, message: String).returns(T.attached_class)
|
|
1036
|
+
end
|
|
1037
|
+
def self.new(code:, message:)
|
|
1038
|
+
end
|
|
1039
|
+
|
|
1040
|
+
sig { override.returns({ code: String, message: String }) }
|
|
1041
|
+
def to_hash
|
|
1042
|
+
end
|
|
1043
|
+
end
|
|
1044
|
+
|
|
1045
|
+
class Webhook < ContextDev::Internal::Type::BaseModel
|
|
1046
|
+
OrHash =
|
|
1047
|
+
T.type_alias do
|
|
1048
|
+
T.any(
|
|
1049
|
+
ContextDev::Models::MonitorListResponse::Data::Webhook,
|
|
1050
|
+
ContextDev::Internal::AnyHash
|
|
1051
|
+
)
|
|
1052
|
+
end
|
|
1053
|
+
|
|
1054
|
+
# Webhook URL called when a change is detected.
|
|
1055
|
+
sig { returns(String) }
|
|
1056
|
+
attr_accessor :url
|
|
1057
|
+
|
|
1058
|
+
# Signing secret used to verify webhook authenticity. Each delivery includes an
|
|
1059
|
+
# `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
|
|
1060
|
+
# `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
|
|
1061
|
+
# compare and reject stale timestamps to prevent replay. Generated by the API;
|
|
1062
|
+
# cannot be set by clients.
|
|
1063
|
+
sig { returns(T.nilable(String)) }
|
|
1064
|
+
attr_reader :secret
|
|
1065
|
+
|
|
1066
|
+
sig { params(secret: String).void }
|
|
1067
|
+
attr_writer :secret
|
|
1068
|
+
|
|
1069
|
+
sig { params(url: String, secret: String).returns(T.attached_class) }
|
|
1070
|
+
def self.new(
|
|
1071
|
+
# Webhook URL called when a change is detected.
|
|
1072
|
+
url:,
|
|
1073
|
+
# Signing secret used to verify webhook authenticity. Each delivery includes an
|
|
1074
|
+
# `X-Context-Signature: t=<unix>,v1=<hmac>` header, where the HMAC is SHA-256 over
|
|
1075
|
+
# `"{t}.{rawRequestBody}"` keyed by this secret. Recompute it with a constant-time
|
|
1076
|
+
# compare and reject stale timestamps to prevent replay. Generated by the API;
|
|
1077
|
+
# cannot be set by clients.
|
|
1078
|
+
secret: nil
|
|
1079
|
+
)
|
|
1080
|
+
end
|
|
1081
|
+
|
|
1082
|
+
sig { override.returns({ url: String, secret: String }) }
|
|
1083
|
+
def to_hash
|
|
1084
|
+
end
|
|
1085
|
+
end
|
|
1086
|
+
end
|
|
1087
|
+
end
|
|
1088
|
+
end
|
|
1089
|
+
end
|