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