context.dev 2.5.0 → 2.7.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 +23 -0
- data/README.md +1 -1
- data/lib/context_dev/client.rb +4 -0
- data/lib/context_dev/models/batch_cancel_params.rb +22 -0
- data/lib/context_dev/models/batch_cancel_response.rb +241 -0
- data/lib/context_dev/models/batch_get_results_params.rb +42 -0
- data/lib/context_dev/models/batch_get_results_response.rb +463 -0
- data/lib/context_dev/models/batch_list_params.rb +94 -0
- data/lib/context_dev/models/batch_list_response.rb +379 -0
- data/lib/context_dev/models/batch_retrieve_params.rb +22 -0
- data/lib/context_dev/models/batch_retrieve_response.rb +373 -0
- data/lib/context_dev/models/batch_submit_params.rb +56 -0
- data/lib/context_dev/models/batch_submit_response.rb +614 -0
- data/lib/context_dev/models/crawl_controls.rb +126 -0
- data/lib/context_dev/models/failure.rb +27 -0
- data/lib/context_dev/models/intake.rb +62 -0
- data/lib/context_dev/models/monitor_create_params.rb +141 -127
- data/lib/context_dev/models/monitor_create_response.rb +34 -10
- data/lib/context_dev/models/monitor_list_response.rb +21 -7
- data/lib/context_dev/models/monitor_retrieve_response.rb +21 -7
- data/lib/context_dev/models/monitor_update_params.rb +21 -7
- data/lib/context_dev/models/monitor_update_response.rb +21 -7
- data/lib/context_dev/models/page_error_count.rb +26 -0
- data/lib/context_dev/models/web_screenshot_params.rb +5 -7
- data/lib/context_dev/models/web_web_crawl_md_params.rb +5 -7
- data/lib/context_dev/models/web_web_scrape_html_params.rb +5 -7
- data/lib/context_dev/models/web_web_scrape_html_response.rb +93 -1
- data/lib/context_dev/models/web_web_scrape_md_params.rb +5 -7
- data/lib/context_dev/models/web_web_scrape_md_response.rb +93 -1
- data/lib/context_dev/models.rb +18 -0
- data/lib/context_dev/resources/batch.rb +152 -0
- data/lib/context_dev/resources/monitors.rb +5 -5
- data/lib/context_dev/resources/web.rb +4 -4
- data/lib/context_dev/version.rb +1 -1
- data/lib/context_dev.rb +15 -0
- data/rbi/context_dev/client.rbi +3 -0
- data/rbi/context_dev/models/batch_cancel_params.rbi +40 -0
- data/rbi/context_dev/models/batch_cancel_response.rbi +424 -0
- data/rbi/context_dev/models/batch_get_results_params.rbi +70 -0
- data/rbi/context_dev/models/batch_get_results_response.rbi +848 -0
- data/rbi/context_dev/models/batch_list_params.rbi +166 -0
- data/rbi/context_dev/models/batch_list_response.rbi +713 -0
- data/rbi/context_dev/models/batch_retrieve_params.rbi +40 -0
- data/rbi/context_dev/models/batch_retrieve_response.rbi +672 -0
- data/rbi/context_dev/models/batch_submit_params.rbi +105 -0
- data/rbi/context_dev/models/batch_submit_response.rbi +1330 -0
- data/rbi/context_dev/models/crawl_controls.rbi +252 -0
- data/rbi/context_dev/models/failure.rbi +35 -0
- data/rbi/context_dev/models/intake.rbi +88 -0
- data/rbi/context_dev/models/monitor_create_params.rbi +274 -242
- data/rbi/context_dev/models/monitor_create_response.rbi +38 -7
- data/rbi/context_dev/models/monitor_list_response.rbi +24 -5
- data/rbi/context_dev/models/monitor_retrieve_response.rbi +24 -5
- data/rbi/context_dev/models/monitor_update_params.rbi +24 -5
- data/rbi/context_dev/models/monitor_update_response.rbi +24 -5
- data/rbi/context_dev/models/page_error_count.rbi +34 -0
- data/rbi/context_dev/models/web_screenshot_params.rbi +6 -9
- data/rbi/context_dev/models/web_web_crawl_md_params.rbi +6 -9
- data/rbi/context_dev/models/web_web_scrape_html_params.rbi +6 -9
- data/rbi/context_dev/models/web_web_scrape_html_response.rbi +182 -0
- data/rbi/context_dev/models/web_web_scrape_md_params.rbi +6 -9
- data/rbi/context_dev/models/web_web_scrape_md_response.rbi +180 -0
- data/rbi/context_dev/models.rbi +18 -0
- data/rbi/context_dev/resources/batch.rbi +117 -0
- data/rbi/context_dev/resources/monitors.rbi +12 -12
- data/rbi/context_dev/resources/web.rbi +8 -12
- data/sig/context_dev/client.rbs +2 -0
- data/sig/context_dev/models/batch_cancel_params.rbs +23 -0
- data/sig/context_dev/models/batch_cancel_response.rbs +174 -0
- data/sig/context_dev/models/batch_get_results_params.rbs +36 -0
- data/sig/context_dev/models/batch_get_results_response.rbs +399 -0
- data/sig/context_dev/models/batch_list_params.rbs +94 -0
- data/sig/context_dev/models/batch_list_response.rbs +283 -0
- data/sig/context_dev/models/batch_retrieve_params.rbs +23 -0
- data/sig/context_dev/models/batch_retrieve_response.rbs +262 -0
- data/sig/context_dev/models/batch_submit_params.rbs +52 -0
- data/sig/context_dev/models/batch_submit_response.rbs +542 -0
- data/sig/context_dev/models/crawl_controls.rbs +114 -0
- data/sig/context_dev/models/failure.rbs +15 -0
- data/sig/context_dev/models/intake.rbs +40 -0
- data/sig/context_dev/models/monitor_create_params.rbs +117 -97
- data/sig/context_dev/models/monitor_create_response.rbs +18 -1
- data/sig/context_dev/models/monitor_list_response.rbs +13 -1
- data/sig/context_dev/models/monitor_retrieve_response.rbs +13 -1
- data/sig/context_dev/models/monitor_update_params.rbs +13 -1
- data/sig/context_dev/models/monitor_update_response.rbs +13 -1
- data/sig/context_dev/models/page_error_count.rbs +15 -0
- data/sig/context_dev/models/web_web_scrape_html_response.rbs +85 -0
- data/sig/context_dev/models/web_web_scrape_md_response.rbs +85 -0
- data/sig/context_dev/models.rbs +18 -0
- data/sig/context_dev/resources/batch.rbs +41 -0
- data/sig/context_dev/resources/monitors.rbs +2 -2
- metadata +47 -2
|
@@ -52,6 +52,36 @@ module ContextDev
|
|
|
52
52
|
sig { returns(String) }
|
|
53
53
|
attr_accessor :url
|
|
54
54
|
|
|
55
|
+
# One verified outcome per requested browser action, in request order.
|
|
56
|
+
sig do
|
|
57
|
+
returns(
|
|
58
|
+
T.nilable(
|
|
59
|
+
T::Array[
|
|
60
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied
|
|
61
|
+
]
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
attr_reader :actions_applied
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
params(
|
|
69
|
+
actions_applied:
|
|
70
|
+
T::Array[
|
|
71
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::OrHash
|
|
72
|
+
]
|
|
73
|
+
).void
|
|
74
|
+
end
|
|
75
|
+
attr_writer :actions_applied
|
|
76
|
+
|
|
77
|
+
# True when an action was applied but the returned content could not be refreshed
|
|
78
|
+
# afterward.
|
|
79
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
80
|
+
attr_reader :actions_html_stale
|
|
81
|
+
|
|
82
|
+
sig { params(actions_html_stale: T::Boolean).void }
|
|
83
|
+
attr_writer :actions_html_stale
|
|
84
|
+
|
|
55
85
|
# Metadata about the API key used for the request. Included in every response
|
|
56
86
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
57
87
|
sig do
|
|
@@ -78,6 +108,11 @@ module ContextDev
|
|
|
78
108
|
ContextDev::Models::WebWebScrapeHTMLResponse::Success::OrBoolean,
|
|
79
109
|
type: ContextDev::Models::WebWebScrapeHTMLResponse::Type::OrSymbol,
|
|
80
110
|
url: String,
|
|
111
|
+
actions_applied:
|
|
112
|
+
T::Array[
|
|
113
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::OrHash
|
|
114
|
+
],
|
|
115
|
+
actions_html_stale: T::Boolean,
|
|
81
116
|
key_metadata:
|
|
82
117
|
ContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata::OrHash
|
|
83
118
|
).returns(T.attached_class)
|
|
@@ -98,6 +133,11 @@ module ContextDev
|
|
|
98
133
|
type:,
|
|
99
134
|
# The URL that was scraped
|
|
100
135
|
url:,
|
|
136
|
+
# One verified outcome per requested browser action, in request order.
|
|
137
|
+
actions_applied: nil,
|
|
138
|
+
# True when an action was applied but the returned content could not be refreshed
|
|
139
|
+
# afterward.
|
|
140
|
+
actions_html_stale: nil,
|
|
101
141
|
# Metadata about the API key used for the request. Included in every response
|
|
102
142
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
103
143
|
key_metadata: nil
|
|
@@ -114,6 +154,11 @@ module ContextDev
|
|
|
114
154
|
type:
|
|
115
155
|
ContextDev::Models::WebWebScrapeHTMLResponse::Type::TaggedSymbol,
|
|
116
156
|
url: String,
|
|
157
|
+
actions_applied:
|
|
158
|
+
T::Array[
|
|
159
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied
|
|
160
|
+
],
|
|
161
|
+
actions_html_stale: T::Boolean,
|
|
117
162
|
key_metadata:
|
|
118
163
|
ContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata
|
|
119
164
|
}
|
|
@@ -705,6 +750,143 @@ module ContextDev
|
|
|
705
750
|
end
|
|
706
751
|
end
|
|
707
752
|
|
|
753
|
+
class ActionsApplied < ContextDev::Internal::Type::BaseModel
|
|
754
|
+
OrHash =
|
|
755
|
+
T.type_alias do
|
|
756
|
+
T.any(
|
|
757
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied,
|
|
758
|
+
ContextDev::Internal::AnyHash
|
|
759
|
+
)
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
sig { returns(String) }
|
|
763
|
+
attr_accessor :instruction
|
|
764
|
+
|
|
765
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
766
|
+
# not verified. Skipped means it was not attempted.
|
|
767
|
+
sig do
|
|
768
|
+
returns(
|
|
769
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status::TaggedSymbol
|
|
770
|
+
)
|
|
771
|
+
end
|
|
772
|
+
attr_accessor :status
|
|
773
|
+
|
|
774
|
+
# Visible page evidence used to verify an applied action.
|
|
775
|
+
sig { returns(T.nilable(String)) }
|
|
776
|
+
attr_reader :completion_evidence
|
|
777
|
+
|
|
778
|
+
sig { params(completion_evidence: String).void }
|
|
779
|
+
attr_writer :completion_evidence
|
|
780
|
+
|
|
781
|
+
sig { returns(T.nilable(Float)) }
|
|
782
|
+
attr_reader :duration_ms
|
|
783
|
+
|
|
784
|
+
sig { params(duration_ms: Float).void }
|
|
785
|
+
attr_writer :duration_ms
|
|
786
|
+
|
|
787
|
+
sig { returns(T.nilable(String)) }
|
|
788
|
+
attr_reader :error
|
|
789
|
+
|
|
790
|
+
sig { params(error: String).void }
|
|
791
|
+
attr_writer :error
|
|
792
|
+
|
|
793
|
+
sig { returns(T.nilable(String)) }
|
|
794
|
+
attr_reader :method_
|
|
795
|
+
|
|
796
|
+
sig { params(method_: String).void }
|
|
797
|
+
attr_writer :method_
|
|
798
|
+
|
|
799
|
+
sig { returns(T.nilable(String)) }
|
|
800
|
+
attr_reader :target_description
|
|
801
|
+
|
|
802
|
+
sig { params(target_description: String).void }
|
|
803
|
+
attr_writer :target_description
|
|
804
|
+
|
|
805
|
+
sig do
|
|
806
|
+
params(
|
|
807
|
+
instruction: String,
|
|
808
|
+
status:
|
|
809
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status::OrSymbol,
|
|
810
|
+
completion_evidence: String,
|
|
811
|
+
duration_ms: Float,
|
|
812
|
+
error: String,
|
|
813
|
+
method_: String,
|
|
814
|
+
target_description: String
|
|
815
|
+
).returns(T.attached_class)
|
|
816
|
+
end
|
|
817
|
+
def self.new(
|
|
818
|
+
instruction:,
|
|
819
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
820
|
+
# not verified. Skipped means it was not attempted.
|
|
821
|
+
status:,
|
|
822
|
+
# Visible page evidence used to verify an applied action.
|
|
823
|
+
completion_evidence: nil,
|
|
824
|
+
duration_ms: nil,
|
|
825
|
+
error: nil,
|
|
826
|
+
method_: nil,
|
|
827
|
+
target_description: nil
|
|
828
|
+
)
|
|
829
|
+
end
|
|
830
|
+
|
|
831
|
+
sig do
|
|
832
|
+
override.returns(
|
|
833
|
+
{
|
|
834
|
+
instruction: String,
|
|
835
|
+
status:
|
|
836
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status::TaggedSymbol,
|
|
837
|
+
completion_evidence: String,
|
|
838
|
+
duration_ms: Float,
|
|
839
|
+
error: String,
|
|
840
|
+
method_: String,
|
|
841
|
+
target_description: String
|
|
842
|
+
}
|
|
843
|
+
)
|
|
844
|
+
end
|
|
845
|
+
def to_hash
|
|
846
|
+
end
|
|
847
|
+
|
|
848
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
849
|
+
# not verified. Skipped means it was not attempted.
|
|
850
|
+
module Status
|
|
851
|
+
extend ContextDev::Internal::Type::Enum
|
|
852
|
+
|
|
853
|
+
TaggedSymbol =
|
|
854
|
+
T.type_alias do
|
|
855
|
+
T.all(
|
|
856
|
+
Symbol,
|
|
857
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status
|
|
858
|
+
)
|
|
859
|
+
end
|
|
860
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
861
|
+
|
|
862
|
+
APPLIED =
|
|
863
|
+
T.let(
|
|
864
|
+
:applied,
|
|
865
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status::TaggedSymbol
|
|
866
|
+
)
|
|
867
|
+
FAILED =
|
|
868
|
+
T.let(
|
|
869
|
+
:failed,
|
|
870
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status::TaggedSymbol
|
|
871
|
+
)
|
|
872
|
+
SKIPPED =
|
|
873
|
+
T.let(
|
|
874
|
+
:skipped,
|
|
875
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status::TaggedSymbol
|
|
876
|
+
)
|
|
877
|
+
|
|
878
|
+
sig do
|
|
879
|
+
override.returns(
|
|
880
|
+
T::Array[
|
|
881
|
+
ContextDev::Models::WebWebScrapeHTMLResponse::ActionsApplied::Status::TaggedSymbol
|
|
882
|
+
]
|
|
883
|
+
)
|
|
884
|
+
end
|
|
885
|
+
def self.values
|
|
886
|
+
end
|
|
887
|
+
end
|
|
888
|
+
end
|
|
889
|
+
|
|
708
890
|
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
709
891
|
OrHash =
|
|
710
892
|
T.type_alias do
|
|
@@ -33,9 +33,8 @@ module ContextDev
|
|
|
33
33
|
end
|
|
34
34
|
attr_accessor :actions
|
|
35
35
|
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
# countries. When provided, Context.dev fetches the target page from that country.
|
|
36
|
+
# Fetch the target page through a residential proxy in this country (ISO 3166-1
|
|
37
|
+
# alpha-2).
|
|
39
38
|
sig do
|
|
40
39
|
returns(T.nilable(ContextDev::WebWebScrapeMdParams::Country::OrSymbol))
|
|
41
40
|
end
|
|
@@ -328,9 +327,8 @@ module ContextDev
|
|
|
328
327
|
# content is captured. Requires a paid plan. Send a JSON array in the query
|
|
329
328
|
# parameter. Maximum: 5 actions.
|
|
330
329
|
actions: nil,
|
|
331
|
-
#
|
|
332
|
-
#
|
|
333
|
-
# countries. When provided, Context.dev fetches the target page from that country.
|
|
330
|
+
# Fetch the target page through a residential proxy in this country (ISO 3166-1
|
|
331
|
+
# alpha-2).
|
|
334
332
|
country: nil,
|
|
335
333
|
# CSS selectors to remove before conversion to Markdown. Applied after
|
|
336
334
|
# includeSelectors. Exclusion takes precedence: an element matching both is
|
|
@@ -520,9 +518,8 @@ module ContextDev
|
|
|
520
518
|
end
|
|
521
519
|
end
|
|
522
520
|
|
|
523
|
-
#
|
|
524
|
-
#
|
|
525
|
-
# countries. When provided, Context.dev fetches the target page from that country.
|
|
521
|
+
# Fetch the target page through a residential proxy in this country (ISO 3166-1
|
|
522
|
+
# alpha-2).
|
|
526
523
|
module Country
|
|
527
524
|
extend ContextDev::Internal::Type::Enum
|
|
528
525
|
|
|
@@ -44,6 +44,34 @@ module ContextDev
|
|
|
44
44
|
sig { returns(String) }
|
|
45
45
|
attr_accessor :url
|
|
46
46
|
|
|
47
|
+
# One verified outcome per requested browser action, in request order.
|
|
48
|
+
sig do
|
|
49
|
+
returns(
|
|
50
|
+
T.nilable(
|
|
51
|
+
T::Array[ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied]
|
|
52
|
+
)
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
attr_reader :actions_applied
|
|
56
|
+
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
actions_applied:
|
|
60
|
+
T::Array[
|
|
61
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::OrHash
|
|
62
|
+
]
|
|
63
|
+
).void
|
|
64
|
+
end
|
|
65
|
+
attr_writer :actions_applied
|
|
66
|
+
|
|
67
|
+
# True when an action was applied but the returned content could not be refreshed
|
|
68
|
+
# afterward.
|
|
69
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
70
|
+
attr_reader :actions_html_stale
|
|
71
|
+
|
|
72
|
+
sig { params(actions_html_stale: T::Boolean).void }
|
|
73
|
+
attr_writer :actions_html_stale
|
|
74
|
+
|
|
47
75
|
# Metadata about the API key used for the request. Included in every response
|
|
48
76
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
49
77
|
sig do
|
|
@@ -70,6 +98,11 @@ module ContextDev
|
|
|
70
98
|
success:
|
|
71
99
|
ContextDev::Models::WebWebScrapeMdResponse::Success::OrBoolean,
|
|
72
100
|
url: String,
|
|
101
|
+
actions_applied:
|
|
102
|
+
T::Array[
|
|
103
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::OrHash
|
|
104
|
+
],
|
|
105
|
+
actions_html_stale: T::Boolean,
|
|
73
106
|
key_metadata:
|
|
74
107
|
ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata::OrHash
|
|
75
108
|
).returns(T.attached_class)
|
|
@@ -87,6 +120,11 @@ module ContextDev
|
|
|
87
120
|
success:,
|
|
88
121
|
# The URL that was scraped
|
|
89
122
|
url:,
|
|
123
|
+
# One verified outcome per requested browser action, in request order.
|
|
124
|
+
actions_applied: nil,
|
|
125
|
+
# True when an action was applied but the returned content could not be refreshed
|
|
126
|
+
# afterward.
|
|
127
|
+
actions_html_stale: nil,
|
|
90
128
|
# Metadata about the API key used for the request. Included in every response
|
|
91
129
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
92
130
|
key_metadata: nil
|
|
@@ -102,6 +140,11 @@ module ContextDev
|
|
|
102
140
|
success:
|
|
103
141
|
ContextDev::Models::WebWebScrapeMdResponse::Success::TaggedBoolean,
|
|
104
142
|
url: String,
|
|
143
|
+
actions_applied:
|
|
144
|
+
T::Array[
|
|
145
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied
|
|
146
|
+
],
|
|
147
|
+
actions_html_stale: T::Boolean,
|
|
105
148
|
key_metadata:
|
|
106
149
|
ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata
|
|
107
150
|
}
|
|
@@ -598,6 +641,143 @@ module ContextDev
|
|
|
598
641
|
end
|
|
599
642
|
end
|
|
600
643
|
|
|
644
|
+
class ActionsApplied < ContextDev::Internal::Type::BaseModel
|
|
645
|
+
OrHash =
|
|
646
|
+
T.type_alias do
|
|
647
|
+
T.any(
|
|
648
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied,
|
|
649
|
+
ContextDev::Internal::AnyHash
|
|
650
|
+
)
|
|
651
|
+
end
|
|
652
|
+
|
|
653
|
+
sig { returns(String) }
|
|
654
|
+
attr_accessor :instruction
|
|
655
|
+
|
|
656
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
657
|
+
# not verified. Skipped means it was not attempted.
|
|
658
|
+
sig do
|
|
659
|
+
returns(
|
|
660
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status::TaggedSymbol
|
|
661
|
+
)
|
|
662
|
+
end
|
|
663
|
+
attr_accessor :status
|
|
664
|
+
|
|
665
|
+
# Visible page evidence used to verify an applied action.
|
|
666
|
+
sig { returns(T.nilable(String)) }
|
|
667
|
+
attr_reader :completion_evidence
|
|
668
|
+
|
|
669
|
+
sig { params(completion_evidence: String).void }
|
|
670
|
+
attr_writer :completion_evidence
|
|
671
|
+
|
|
672
|
+
sig { returns(T.nilable(Float)) }
|
|
673
|
+
attr_reader :duration_ms
|
|
674
|
+
|
|
675
|
+
sig { params(duration_ms: Float).void }
|
|
676
|
+
attr_writer :duration_ms
|
|
677
|
+
|
|
678
|
+
sig { returns(T.nilable(String)) }
|
|
679
|
+
attr_reader :error
|
|
680
|
+
|
|
681
|
+
sig { params(error: String).void }
|
|
682
|
+
attr_writer :error
|
|
683
|
+
|
|
684
|
+
sig { returns(T.nilable(String)) }
|
|
685
|
+
attr_reader :method_
|
|
686
|
+
|
|
687
|
+
sig { params(method_: String).void }
|
|
688
|
+
attr_writer :method_
|
|
689
|
+
|
|
690
|
+
sig { returns(T.nilable(String)) }
|
|
691
|
+
attr_reader :target_description
|
|
692
|
+
|
|
693
|
+
sig { params(target_description: String).void }
|
|
694
|
+
attr_writer :target_description
|
|
695
|
+
|
|
696
|
+
sig do
|
|
697
|
+
params(
|
|
698
|
+
instruction: String,
|
|
699
|
+
status:
|
|
700
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status::OrSymbol,
|
|
701
|
+
completion_evidence: String,
|
|
702
|
+
duration_ms: Float,
|
|
703
|
+
error: String,
|
|
704
|
+
method_: String,
|
|
705
|
+
target_description: String
|
|
706
|
+
).returns(T.attached_class)
|
|
707
|
+
end
|
|
708
|
+
def self.new(
|
|
709
|
+
instruction:,
|
|
710
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
711
|
+
# not verified. Skipped means it was not attempted.
|
|
712
|
+
status:,
|
|
713
|
+
# Visible page evidence used to verify an applied action.
|
|
714
|
+
completion_evidence: nil,
|
|
715
|
+
duration_ms: nil,
|
|
716
|
+
error: nil,
|
|
717
|
+
method_: nil,
|
|
718
|
+
target_description: nil
|
|
719
|
+
)
|
|
720
|
+
end
|
|
721
|
+
|
|
722
|
+
sig do
|
|
723
|
+
override.returns(
|
|
724
|
+
{
|
|
725
|
+
instruction: String,
|
|
726
|
+
status:
|
|
727
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status::TaggedSymbol,
|
|
728
|
+
completion_evidence: String,
|
|
729
|
+
duration_ms: Float,
|
|
730
|
+
error: String,
|
|
731
|
+
method_: String,
|
|
732
|
+
target_description: String
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
end
|
|
736
|
+
def to_hash
|
|
737
|
+
end
|
|
738
|
+
|
|
739
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
740
|
+
# not verified. Skipped means it was not attempted.
|
|
741
|
+
module Status
|
|
742
|
+
extend ContextDev::Internal::Type::Enum
|
|
743
|
+
|
|
744
|
+
TaggedSymbol =
|
|
745
|
+
T.type_alias do
|
|
746
|
+
T.all(
|
|
747
|
+
Symbol,
|
|
748
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status
|
|
749
|
+
)
|
|
750
|
+
end
|
|
751
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
752
|
+
|
|
753
|
+
APPLIED =
|
|
754
|
+
T.let(
|
|
755
|
+
:applied,
|
|
756
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status::TaggedSymbol
|
|
757
|
+
)
|
|
758
|
+
FAILED =
|
|
759
|
+
T.let(
|
|
760
|
+
:failed,
|
|
761
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status::TaggedSymbol
|
|
762
|
+
)
|
|
763
|
+
SKIPPED =
|
|
764
|
+
T.let(
|
|
765
|
+
:skipped,
|
|
766
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status::TaggedSymbol
|
|
767
|
+
)
|
|
768
|
+
|
|
769
|
+
sig do
|
|
770
|
+
override.returns(
|
|
771
|
+
T::Array[
|
|
772
|
+
ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status::TaggedSymbol
|
|
773
|
+
]
|
|
774
|
+
)
|
|
775
|
+
end
|
|
776
|
+
def self.values
|
|
777
|
+
end
|
|
778
|
+
end
|
|
779
|
+
end
|
|
780
|
+
|
|
601
781
|
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
602
782
|
OrHash =
|
|
603
783
|
T.type_alias do
|
data/rbi/context_dev/models.rbi
CHANGED
|
@@ -5,15 +5,31 @@ module ContextDev
|
|
|
5
5
|
|
|
6
6
|
AIExtractProductsParams = ContextDev::Models::AIExtractProductsParams
|
|
7
7
|
|
|
8
|
+
BatchCancelParams = ContextDev::Models::BatchCancelParams
|
|
9
|
+
|
|
10
|
+
BatchGetResultsParams = ContextDev::Models::BatchGetResultsParams
|
|
11
|
+
|
|
12
|
+
BatchListParams = ContextDev::Models::BatchListParams
|
|
13
|
+
|
|
14
|
+
BatchRetrieveParams = ContextDev::Models::BatchRetrieveParams
|
|
15
|
+
|
|
16
|
+
BatchSubmitParams = ContextDev::Models::BatchSubmitParams
|
|
17
|
+
|
|
8
18
|
BrandRetrieveParams = ContextDev::Models::BrandRetrieveParams
|
|
9
19
|
|
|
10
20
|
BrandRetrieveSimplifiedParams =
|
|
11
21
|
ContextDev::Models::BrandRetrieveSimplifiedParams
|
|
12
22
|
|
|
23
|
+
CrawlControls = ContextDev::Models::CrawlControls
|
|
24
|
+
|
|
25
|
+
Failure = ContextDev::Models::Failure
|
|
26
|
+
|
|
13
27
|
IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams
|
|
14
28
|
|
|
15
29
|
IndustryRetrieveSicParams = ContextDev::Models::IndustryRetrieveSicParams
|
|
16
30
|
|
|
31
|
+
Intake = ContextDev::Models::Intake
|
|
32
|
+
|
|
17
33
|
MonitorCreateParams = ContextDev::Models::MonitorCreateParams
|
|
18
34
|
|
|
19
35
|
MonitorDeleteParams = ContextDev::Models::MonitorDeleteParams
|
|
@@ -42,6 +58,8 @@ module ContextDev
|
|
|
42
58
|
|
|
43
59
|
MonitorUpdateParams = ContextDev::Models::MonitorUpdateParams
|
|
44
60
|
|
|
61
|
+
PageErrorCount = ContextDev::Models::PageErrorCount
|
|
62
|
+
|
|
45
63
|
ParseHandleParams = ContextDev::Models::ParseHandleParams
|
|
46
64
|
|
|
47
65
|
UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Resources
|
|
5
|
+
class Batch
|
|
6
|
+
# Check progress, and get download links once the batch finishes.
|
|
7
|
+
sig do
|
|
8
|
+
params(
|
|
9
|
+
batch_id: String,
|
|
10
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
11
|
+
).returns(ContextDev::Models::BatchRetrieveResponse)
|
|
12
|
+
end
|
|
13
|
+
def retrieve(
|
|
14
|
+
# ID of the batch to retrieve or cancel.
|
|
15
|
+
batch_id,
|
|
16
|
+
request_options: {}
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# List your batches from newest to oldest. Filter by status or continue with a
|
|
21
|
+
# cursor.
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
cursor: String,
|
|
25
|
+
limit: Integer,
|
|
26
|
+
q: String,
|
|
27
|
+
search_type: ContextDev::BatchListParams::SearchType::OrSymbol,
|
|
28
|
+
status: ContextDev::BatchListParams::Status::OrSymbol,
|
|
29
|
+
tags: String,
|
|
30
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
31
|
+
).returns(ContextDev::Models::BatchListResponse)
|
|
32
|
+
end
|
|
33
|
+
def list(
|
|
34
|
+
# Cursor from the previous page.
|
|
35
|
+
cursor: nil,
|
|
36
|
+
# Batches per page. Defaults to 25.
|
|
37
|
+
limit: nil,
|
|
38
|
+
# Free-text search term, matched against the batch id, crawl source (start URL or
|
|
39
|
+
# sitemap domain), and tags.
|
|
40
|
+
q: nil,
|
|
41
|
+
# `prefix` for as-you-type prefix matching (default), `exact` for full-token
|
|
42
|
+
# matching.
|
|
43
|
+
search_type: nil,
|
|
44
|
+
# Filter by status.
|
|
45
|
+
status: nil,
|
|
46
|
+
# Comma-separated list of tags to filter by (matches batches having any of them).
|
|
47
|
+
tags: nil,
|
|
48
|
+
request_options: {}
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Stop a batch from starting new pages. In-progress pages finish, and unused
|
|
53
|
+
# credits are refunded.
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
batch_id: String,
|
|
57
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
58
|
+
).returns(ContextDev::Models::BatchCancelResponse)
|
|
59
|
+
end
|
|
60
|
+
def cancel(
|
|
61
|
+
# ID of the batch to retrieve or cancel.
|
|
62
|
+
batch_id,
|
|
63
|
+
request_options: {}
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Page through a finished batch's results as JSON instead of downloading the
|
|
68
|
+
# NDJSON files.
|
|
69
|
+
sig do
|
|
70
|
+
params(
|
|
71
|
+
batch_id: String,
|
|
72
|
+
cursor: String,
|
|
73
|
+
limit: Integer,
|
|
74
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
75
|
+
).returns(ContextDev::Models::BatchGetResultsResponse)
|
|
76
|
+
end
|
|
77
|
+
def get_results(
|
|
78
|
+
# ID of the batch to retrieve or cancel.
|
|
79
|
+
batch_id,
|
|
80
|
+
# next_cursor from the previous page.
|
|
81
|
+
cursor: nil,
|
|
82
|
+
# Records per page. Defaults to 25. A page can close early so its payload stays
|
|
83
|
+
# under ~8 MB; rely on next_cursor rather than counting records.
|
|
84
|
+
limit: nil,
|
|
85
|
+
request_options: {}
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Retrieve and normalize a person profile from identifiers.
|
|
90
|
+
sig do
|
|
91
|
+
params(
|
|
92
|
+
identifiers: ContextDev::BatchSubmitParams::Identifiers::OrHash,
|
|
93
|
+
tags: T::Array[String],
|
|
94
|
+
timeout_ms: Integer,
|
|
95
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
96
|
+
).returns(ContextDev::Models::BatchSubmitResponse)
|
|
97
|
+
end
|
|
98
|
+
def submit(
|
|
99
|
+
# Known identifiers for the person. At least one identifier is required.
|
|
100
|
+
identifiers:,
|
|
101
|
+
# Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
102
|
+
tags: nil,
|
|
103
|
+
# Optional timeout in milliseconds for the request. If the request takes longer
|
|
104
|
+
# than this value, it will be aborted with a 408 status code. Maximum allowed
|
|
105
|
+
# value is 300000ms (5 minutes).
|
|
106
|
+
timeout_ms: nil,
|
|
107
|
+
request_options: {}
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @api private
|
|
112
|
+
sig { params(client: ContextDev::Client).returns(T.attached_class) }
|
|
113
|
+
def self.new(client:)
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
@@ -12,38 +12,38 @@ module ContextDev
|
|
|
12
12
|
# its initial baseline.
|
|
13
13
|
sig do
|
|
14
14
|
params(
|
|
15
|
-
change_detection:
|
|
16
|
-
T.any(
|
|
17
|
-
ContextDev::MonitorCreateParams::ChangeDetection::Exact::OrHash,
|
|
18
|
-
ContextDev::MonitorCreateParams::ChangeDetection::Semantic::OrHash
|
|
19
|
-
),
|
|
20
15
|
name: String,
|
|
21
|
-
schedule: ContextDev::MonitorCreateParams::Schedule::OrHash,
|
|
22
16
|
target:
|
|
23
17
|
T.any(
|
|
24
18
|
ContextDev::MonitorCreateParams::Target::Page::OrHash,
|
|
25
19
|
ContextDev::MonitorCreateParams::Target::Sitemap::OrHash,
|
|
26
20
|
ContextDev::MonitorCreateParams::Target::Extract::OrHash
|
|
27
21
|
),
|
|
22
|
+
change_detection:
|
|
23
|
+
T.any(
|
|
24
|
+
ContextDev::MonitorCreateParams::ChangeDetection::Exact::OrHash,
|
|
25
|
+
ContextDev::MonitorCreateParams::ChangeDetection::Semantic::OrHash
|
|
26
|
+
),
|
|
28
27
|
mode: ContextDev::MonitorCreateParams::Mode::OrSymbol,
|
|
28
|
+
schedule: ContextDev::MonitorCreateParams::Schedule::OrHash,
|
|
29
29
|
tags: T::Array[String],
|
|
30
30
|
webhook: T.nilable(ContextDev::MonitorCreateParams::Webhook::OrHash),
|
|
31
31
|
request_options: ContextDev::RequestOptions::OrHash
|
|
32
32
|
).returns(ContextDev::Models::MonitorCreateResponse)
|
|
33
33
|
end
|
|
34
34
|
def create(
|
|
35
|
-
# Discriminated union describing how changes are detected.
|
|
36
|
-
change_detection:,
|
|
37
35
|
name:,
|
|
38
|
-
# Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
|
|
39
|
-
# every 6 hours or every 2 days. The total interval (frequency × unit) must be
|
|
40
|
-
# between 10 minutes and 1 year.
|
|
41
|
-
schedule:,
|
|
42
36
|
# Discriminated union describing what the monitor watches.
|
|
43
37
|
target:,
|
|
38
|
+
# Discriminated union describing how changes are detected.
|
|
39
|
+
change_detection: nil,
|
|
44
40
|
# Top-level monitor category. Always `web` today; the concrete behavior is
|
|
45
41
|
# described by `target` and `change_detection`.
|
|
46
42
|
mode: nil,
|
|
43
|
+
# Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
|
|
44
|
+
# every 6 hours or every 2 days. The total interval (frequency × unit) must be
|
|
45
|
+
# between 10 minutes and 1 year.
|
|
46
|
+
schedule: nil,
|
|
47
47
|
# User-defined tags for grouping and filtering monitors and their changes.
|
|
48
48
|
# Duplicates are removed.
|
|
49
49
|
tags: nil,
|