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
|
@@ -36,6 +36,21 @@ module ContextDev
|
|
|
36
36
|
# @return [String]
|
|
37
37
|
required :url, String
|
|
38
38
|
|
|
39
|
+
# @!attribute actions_applied
|
|
40
|
+
# One verified outcome per requested browser action, in request order.
|
|
41
|
+
#
|
|
42
|
+
# @return [Array<ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied>, nil]
|
|
43
|
+
optional :actions_applied,
|
|
44
|
+
-> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied] },
|
|
45
|
+
api_name: :actionsApplied
|
|
46
|
+
|
|
47
|
+
# @!attribute actions_html_stale
|
|
48
|
+
# True when an action was applied but the returned content could not be refreshed
|
|
49
|
+
# afterward.
|
|
50
|
+
#
|
|
51
|
+
# @return [Boolean, nil]
|
|
52
|
+
optional :actions_html_stale, ContextDev::Internal::Type::Boolean, api_name: :actionsHtmlStale
|
|
53
|
+
|
|
39
54
|
# @!attribute key_metadata
|
|
40
55
|
# Metadata about the API key used for the request. Included in every response
|
|
41
56
|
# whenever a valid API key is provided, even when the response status is not 200.
|
|
@@ -43,7 +58,7 @@ module ContextDev
|
|
|
43
58
|
# @return [ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata, nil]
|
|
44
59
|
optional :key_metadata, -> { ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata }
|
|
45
60
|
|
|
46
|
-
# @!method initialize(content_length:, markdown:, metadata:, success:, url:, key_metadata: nil)
|
|
61
|
+
# @!method initialize(content_length:, markdown:, metadata:, success:, url:, actions_applied: nil, actions_html_stale: nil, key_metadata: nil)
|
|
47
62
|
# Some parameter documentations has been truncated, see
|
|
48
63
|
# {ContextDev::Models::WebWebScrapeMdResponse} for more details.
|
|
49
64
|
#
|
|
@@ -57,6 +72,10 @@ module ContextDev
|
|
|
57
72
|
#
|
|
58
73
|
# @param url [String] The URL that was scraped
|
|
59
74
|
#
|
|
75
|
+
# @param actions_applied [Array<ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied>] One verified outcome per requested browser action, in request order.
|
|
76
|
+
#
|
|
77
|
+
# @param actions_html_stale [Boolean] True when an action was applied but the returned content could not be refreshed
|
|
78
|
+
#
|
|
60
79
|
# @param key_metadata [ContextDev::Models::WebWebScrapeMdResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when
|
|
61
80
|
|
|
62
81
|
# @see ContextDev::Models::WebWebScrapeMdResponse#metadata
|
|
@@ -318,6 +337,79 @@ module ContextDev
|
|
|
318
337
|
# @return [Array<Boolean>]
|
|
319
338
|
end
|
|
320
339
|
|
|
340
|
+
class ActionsApplied < ContextDev::Internal::Type::BaseModel
|
|
341
|
+
# @!attribute instruction
|
|
342
|
+
#
|
|
343
|
+
# @return [String]
|
|
344
|
+
required :instruction, String
|
|
345
|
+
|
|
346
|
+
# @!attribute status
|
|
347
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
348
|
+
# not verified. Skipped means it was not attempted.
|
|
349
|
+
#
|
|
350
|
+
# @return [Symbol, ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status]
|
|
351
|
+
required :status, enum: -> { ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status }
|
|
352
|
+
|
|
353
|
+
# @!attribute completion_evidence
|
|
354
|
+
# Visible page evidence used to verify an applied action.
|
|
355
|
+
#
|
|
356
|
+
# @return [String, nil]
|
|
357
|
+
optional :completion_evidence, String, api_name: :completionEvidence
|
|
358
|
+
|
|
359
|
+
# @!attribute duration_ms
|
|
360
|
+
#
|
|
361
|
+
# @return [Float, nil]
|
|
362
|
+
optional :duration_ms, Float, api_name: :durationMs
|
|
363
|
+
|
|
364
|
+
# @!attribute error
|
|
365
|
+
#
|
|
366
|
+
# @return [String, nil]
|
|
367
|
+
optional :error, String
|
|
368
|
+
|
|
369
|
+
# @!attribute method_
|
|
370
|
+
#
|
|
371
|
+
# @return [String, nil]
|
|
372
|
+
optional :method_, String, api_name: :method
|
|
373
|
+
|
|
374
|
+
# @!attribute target_description
|
|
375
|
+
#
|
|
376
|
+
# @return [String, nil]
|
|
377
|
+
optional :target_description, String, api_name: :targetDescription
|
|
378
|
+
|
|
379
|
+
# @!method initialize(instruction:, status:, completion_evidence: nil, duration_ms: nil, error: nil, method_: nil, target_description: nil)
|
|
380
|
+
# Some parameter documentations has been truncated, see
|
|
381
|
+
# {ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied} for more details.
|
|
382
|
+
#
|
|
383
|
+
# @param instruction [String]
|
|
384
|
+
#
|
|
385
|
+
# @param status [Symbol, ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied::Status] Applied means the requested page state was visibly verified. Failed means it was
|
|
386
|
+
#
|
|
387
|
+
# @param completion_evidence [String] Visible page evidence used to verify an applied action.
|
|
388
|
+
#
|
|
389
|
+
# @param duration_ms [Float]
|
|
390
|
+
#
|
|
391
|
+
# @param error [String]
|
|
392
|
+
#
|
|
393
|
+
# @param method_ [String]
|
|
394
|
+
#
|
|
395
|
+
# @param target_description [String]
|
|
396
|
+
|
|
397
|
+
# Applied means the requested page state was visibly verified. Failed means it was
|
|
398
|
+
# not verified. Skipped means it was not attempted.
|
|
399
|
+
#
|
|
400
|
+
# @see ContextDev::Models::WebWebScrapeMdResponse::ActionsApplied#status
|
|
401
|
+
module Status
|
|
402
|
+
extend ContextDev::Internal::Type::Enum
|
|
403
|
+
|
|
404
|
+
APPLIED = :applied
|
|
405
|
+
FAILED = :failed
|
|
406
|
+
SKIPPED = :skipped
|
|
407
|
+
|
|
408
|
+
# @!method self.values
|
|
409
|
+
# @return [Array<Symbol>]
|
|
410
|
+
end
|
|
411
|
+
end
|
|
412
|
+
|
|
321
413
|
# @see ContextDev::Models::WebWebScrapeMdResponse#key_metadata
|
|
322
414
|
class KeyMetadata < ContextDev::Internal::Type::BaseModel
|
|
323
415
|
# @!attribute credits_consumed
|
data/lib/context_dev/models.rb
CHANGED
|
@@ -43,14 +43,30 @@ module ContextDev
|
|
|
43
43
|
|
|
44
44
|
AIExtractProductsParams = ContextDev::Models::AIExtractProductsParams
|
|
45
45
|
|
|
46
|
+
BatchCancelParams = ContextDev::Models::BatchCancelParams
|
|
47
|
+
|
|
48
|
+
BatchGetResultsParams = ContextDev::Models::BatchGetResultsParams
|
|
49
|
+
|
|
50
|
+
BatchListParams = ContextDev::Models::BatchListParams
|
|
51
|
+
|
|
52
|
+
BatchRetrieveParams = ContextDev::Models::BatchRetrieveParams
|
|
53
|
+
|
|
54
|
+
BatchSubmitParams = ContextDev::Models::BatchSubmitParams
|
|
55
|
+
|
|
46
56
|
BrandRetrieveParams = ContextDev::Models::BrandRetrieveParams
|
|
47
57
|
|
|
48
58
|
BrandRetrieveSimplifiedParams = ContextDev::Models::BrandRetrieveSimplifiedParams
|
|
49
59
|
|
|
60
|
+
CrawlControls = ContextDev::Models::CrawlControls
|
|
61
|
+
|
|
62
|
+
Failure = ContextDev::Models::Failure
|
|
63
|
+
|
|
50
64
|
IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams
|
|
51
65
|
|
|
52
66
|
IndustryRetrieveSicParams = ContextDev::Models::IndustryRetrieveSicParams
|
|
53
67
|
|
|
68
|
+
Intake = ContextDev::Models::Intake
|
|
69
|
+
|
|
54
70
|
MonitorCreateParams = ContextDev::Models::MonitorCreateParams
|
|
55
71
|
|
|
56
72
|
MonitorDeleteParams = ContextDev::Models::MonitorDeleteParams
|
|
@@ -77,6 +93,8 @@ module ContextDev
|
|
|
77
93
|
|
|
78
94
|
MonitorUpdateParams = ContextDev::Models::MonitorUpdateParams
|
|
79
95
|
|
|
96
|
+
PageErrorCount = ContextDev::Models::PageErrorCount
|
|
97
|
+
|
|
80
98
|
ParseHandleParams = ContextDev::Models::ParseHandleParams
|
|
81
99
|
|
|
82
100
|
UtilityPrefetchParams = ContextDev::Models::UtilityPrefetchParams
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Resources
|
|
5
|
+
class Batch
|
|
6
|
+
# Check progress, and get download links once the batch finishes.
|
|
7
|
+
#
|
|
8
|
+
# @overload retrieve(batch_id, request_options: {})
|
|
9
|
+
#
|
|
10
|
+
# @param batch_id [String] ID of the batch to retrieve or cancel.
|
|
11
|
+
#
|
|
12
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
13
|
+
#
|
|
14
|
+
# @return [ContextDev::Models::BatchRetrieveResponse]
|
|
15
|
+
#
|
|
16
|
+
# @see ContextDev::Models::BatchRetrieveParams
|
|
17
|
+
def retrieve(batch_id, params = {})
|
|
18
|
+
@client.request(
|
|
19
|
+
method: :get,
|
|
20
|
+
path: ["batch/%1$s", batch_id],
|
|
21
|
+
model: ContextDev::Models::BatchRetrieveResponse,
|
|
22
|
+
options: params[:request_options]
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Some parameter documentations has been truncated, see
|
|
27
|
+
# {ContextDev::Models::BatchListParams} for more details.
|
|
28
|
+
#
|
|
29
|
+
# List your batches from newest to oldest. Filter by status or continue with a
|
|
30
|
+
# cursor.
|
|
31
|
+
#
|
|
32
|
+
# @overload list(cursor: nil, limit: nil, q: nil, search_type: nil, status: nil, tags: nil, request_options: {})
|
|
33
|
+
#
|
|
34
|
+
# @param cursor [String] Cursor from the previous page.
|
|
35
|
+
#
|
|
36
|
+
# @param limit [Integer] Batches per page. Defaults to 25.
|
|
37
|
+
#
|
|
38
|
+
# @param q [String] Free-text search term, matched against the batch id, crawl source (start URL or
|
|
39
|
+
#
|
|
40
|
+
# @param search_type [Symbol, ContextDev::Models::BatchListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match
|
|
41
|
+
#
|
|
42
|
+
# @param status [Symbol, ContextDev::Models::BatchListParams::Status] Filter by status.
|
|
43
|
+
#
|
|
44
|
+
# @param tags [String] Comma-separated list of tags to filter by (matches batches having any of them).
|
|
45
|
+
#
|
|
46
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
47
|
+
#
|
|
48
|
+
# @return [ContextDev::Models::BatchListResponse]
|
|
49
|
+
#
|
|
50
|
+
# @see ContextDev::Models::BatchListParams
|
|
51
|
+
def list(params = {})
|
|
52
|
+
parsed, options = ContextDev::BatchListParams.dump_request(params)
|
|
53
|
+
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
54
|
+
@client.request(
|
|
55
|
+
method: :get,
|
|
56
|
+
path: "batch/list",
|
|
57
|
+
query: query,
|
|
58
|
+
model: ContextDev::Models::BatchListResponse,
|
|
59
|
+
options: options
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Stop a batch from starting new pages. In-progress pages finish, and unused
|
|
64
|
+
# credits are refunded.
|
|
65
|
+
#
|
|
66
|
+
# @overload cancel(batch_id, request_options: {})
|
|
67
|
+
#
|
|
68
|
+
# @param batch_id [String] ID of the batch to retrieve or cancel.
|
|
69
|
+
#
|
|
70
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
71
|
+
#
|
|
72
|
+
# @return [ContextDev::Models::BatchCancelResponse]
|
|
73
|
+
#
|
|
74
|
+
# @see ContextDev::Models::BatchCancelParams
|
|
75
|
+
def cancel(batch_id, params = {})
|
|
76
|
+
@client.request(
|
|
77
|
+
method: :post,
|
|
78
|
+
path: ["batch/%1$s/cancel", batch_id],
|
|
79
|
+
model: ContextDev::Models::BatchCancelResponse,
|
|
80
|
+
options: params[:request_options]
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Some parameter documentations has been truncated, see
|
|
85
|
+
# {ContextDev::Models::BatchGetResultsParams} for more details.
|
|
86
|
+
#
|
|
87
|
+
# Page through a finished batch's results as JSON instead of downloading the
|
|
88
|
+
# NDJSON files.
|
|
89
|
+
#
|
|
90
|
+
# @overload get_results(batch_id, cursor: nil, limit: nil, request_options: {})
|
|
91
|
+
#
|
|
92
|
+
# @param batch_id [String] ID of the batch to retrieve or cancel.
|
|
93
|
+
#
|
|
94
|
+
# @param cursor [String] next_cursor from the previous page.
|
|
95
|
+
#
|
|
96
|
+
# @param limit [Integer] Records per page. Defaults to 25. A page can close early so its payload stays un
|
|
97
|
+
#
|
|
98
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
99
|
+
#
|
|
100
|
+
# @return [ContextDev::Models::BatchGetResultsResponse]
|
|
101
|
+
#
|
|
102
|
+
# @see ContextDev::Models::BatchGetResultsParams
|
|
103
|
+
def get_results(batch_id, params = {})
|
|
104
|
+
parsed, options = ContextDev::BatchGetResultsParams.dump_request(params)
|
|
105
|
+
query = ContextDev::Internal::Util.encode_query_params(parsed)
|
|
106
|
+
@client.request(
|
|
107
|
+
method: :get,
|
|
108
|
+
path: ["batch/%1$s/results", batch_id],
|
|
109
|
+
query: query,
|
|
110
|
+
model: ContextDev::Models::BatchGetResultsResponse,
|
|
111
|
+
options: options
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Some parameter documentations has been truncated, see
|
|
116
|
+
# {ContextDev::Models::BatchSubmitParams} for more details.
|
|
117
|
+
#
|
|
118
|
+
# Retrieve and normalize a person profile from identifiers.
|
|
119
|
+
#
|
|
120
|
+
# @overload submit(identifiers:, tags: nil, timeout_ms: nil, request_options: {})
|
|
121
|
+
#
|
|
122
|
+
# @param identifiers [ContextDev::Models::BatchSubmitParams::Identifiers] Known identifiers for the person. At least one identifier is required.
|
|
123
|
+
#
|
|
124
|
+
# @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
|
|
125
|
+
#
|
|
126
|
+
# @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
|
|
127
|
+
#
|
|
128
|
+
# @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
129
|
+
#
|
|
130
|
+
# @return [ContextDev::Models::BatchSubmitResponse]
|
|
131
|
+
#
|
|
132
|
+
# @see ContextDev::Models::BatchSubmitParams
|
|
133
|
+
def submit(params)
|
|
134
|
+
parsed, options = ContextDev::BatchSubmitParams.dump_request(params)
|
|
135
|
+
@client.request(
|
|
136
|
+
method: :post,
|
|
137
|
+
path: "people/retrieve",
|
|
138
|
+
body: parsed,
|
|
139
|
+
model: ContextDev::Models::BatchSubmitResponse,
|
|
140
|
+
options: options
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# @api private
|
|
145
|
+
#
|
|
146
|
+
# @param client [ContextDev::Client]
|
|
147
|
+
def initialize(client:)
|
|
148
|
+
@client = client
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
@@ -14,18 +14,18 @@ module ContextDev
|
|
|
14
14
|
# detection combinations. The monitor runs immediately after creation to create
|
|
15
15
|
# its initial baseline.
|
|
16
16
|
#
|
|
17
|
-
# @overload create(
|
|
18
|
-
#
|
|
19
|
-
# @param change_detection [ContextDev::Models::MonitorCreateParams::ChangeDetection::Exact, ContextDev::Models::MonitorCreateParams::ChangeDetection::Semantic] Discriminated union describing how changes are detected.
|
|
17
|
+
# @overload create(name:, target:, change_detection: nil, mode: nil, schedule: nil, tags: nil, webhook: nil, request_options: {})
|
|
20
18
|
#
|
|
21
19
|
# @param name [String]
|
|
22
20
|
#
|
|
23
|
-
# @param schedule [ContextDev::Models::MonitorCreateParams::Schedule] Run the monitor on a fixed interval defined by a frequency and a unit, e.g. ever
|
|
24
|
-
#
|
|
25
21
|
# @param target [ContextDev::Models::MonitorCreateParams::Target::Page, ContextDev::Models::MonitorCreateParams::Target::Sitemap, ContextDev::Models::MonitorCreateParams::Target::Extract] Discriminated union describing what the monitor watches.
|
|
26
22
|
#
|
|
23
|
+
# @param change_detection [ContextDev::Models::MonitorCreateParams::ChangeDetection::Exact, ContextDev::Models::MonitorCreateParams::ChangeDetection::Semantic] Discriminated union describing how changes are detected.
|
|
24
|
+
#
|
|
27
25
|
# @param mode [Symbol, ContextDev::Models::MonitorCreateParams::Mode] Top-level monitor category. Always `web` today; the concrete behavior is describ
|
|
28
26
|
#
|
|
27
|
+
# @param schedule [ContextDev::Models::MonitorCreateParams::Schedule] Run the monitor on a fixed interval defined by a frequency and a unit, e.g. ever
|
|
28
|
+
#
|
|
29
29
|
# @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes. Duplica
|
|
30
30
|
#
|
|
31
31
|
# @param webhook [ContextDev::Models::MonitorCreateParams::Webhook, nil]
|
|
@@ -180,7 +180,7 @@ module ContextDev
|
|
|
180
180
|
#
|
|
181
181
|
# @param color_scheme [Symbol, ContextDev::Models::WebScreenshotParams::ColorScheme] Optional parameter to choose the site's visual theme in the screenshot. Use 'lig
|
|
182
182
|
#
|
|
183
|
-
# @param country [Symbol, ContextDev::Models::WebScreenshotParams::Country]
|
|
183
|
+
# @param country [Symbol, ContextDev::Models::WebScreenshotParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
|
|
184
184
|
#
|
|
185
185
|
# @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https
|
|
186
186
|
#
|
|
@@ -285,7 +285,7 @@ module ContextDev
|
|
|
285
285
|
#
|
|
286
286
|
# @param url [String] The starting URL for the crawl (must include http:// or https:// protocol)
|
|
287
287
|
#
|
|
288
|
-
# @param country [Symbol, ContextDev::Models::WebWebCrawlMdParams::Country]
|
|
288
|
+
# @param country [Symbol, ContextDev::Models::WebWebCrawlMdParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
|
|
289
289
|
#
|
|
290
290
|
# @param exclude_selectors [Array<String>] CSS selectors to remove before each crawled page is converted to Markdown. Appli
|
|
291
291
|
#
|
|
@@ -353,7 +353,7 @@ module ContextDev
|
|
|
353
353
|
#
|
|
354
354
|
# @param actions [Array<ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform>, nil] Optional browser actions executed in array order after the page loads and before
|
|
355
355
|
#
|
|
356
|
-
# @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country]
|
|
356
|
+
# @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
|
|
357
357
|
#
|
|
358
358
|
# @param exclude_selectors [Array<String>, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi
|
|
359
359
|
#
|
|
@@ -481,7 +481,7 @@ module ContextDev
|
|
|
481
481
|
#
|
|
482
482
|
# @param actions [Array<ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform>, nil] Optional browser actions executed in array order after the page loads and before
|
|
483
483
|
#
|
|
484
|
-
# @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country]
|
|
484
|
+
# @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Fetch the target page through a residential proxy in this country (ISO 3166-1 al
|
|
485
485
|
#
|
|
486
486
|
# @param exclude_selectors [Array<String>, nil] CSS selectors to remove before conversion to Markdown. Applied after includeSele
|
|
487
487
|
#
|
data/lib/context_dev/version.rb
CHANGED
data/lib/context_dev.rb
CHANGED
|
@@ -56,14 +56,27 @@ require_relative "context_dev/models/ai_extract_product_params"
|
|
|
56
56
|
require_relative "context_dev/models/ai_extract_product_response"
|
|
57
57
|
require_relative "context_dev/models/ai_extract_products_params"
|
|
58
58
|
require_relative "context_dev/models/ai_extract_products_response"
|
|
59
|
+
require_relative "context_dev/models/batch_cancel_params"
|
|
60
|
+
require_relative "context_dev/models/batch_cancel_response"
|
|
61
|
+
require_relative "context_dev/models/batch_get_results_params"
|
|
62
|
+
require_relative "context_dev/models/batch_get_results_response"
|
|
63
|
+
require_relative "context_dev/models/batch_list_params"
|
|
64
|
+
require_relative "context_dev/models/batch_list_response"
|
|
65
|
+
require_relative "context_dev/models/batch_retrieve_params"
|
|
66
|
+
require_relative "context_dev/models/batch_retrieve_response"
|
|
67
|
+
require_relative "context_dev/models/batch_submit_params"
|
|
68
|
+
require_relative "context_dev/models/batch_submit_response"
|
|
59
69
|
require_relative "context_dev/models/brand_retrieve_params"
|
|
60
70
|
require_relative "context_dev/models/brand_retrieve_response"
|
|
61
71
|
require_relative "context_dev/models/brand_retrieve_simplified_params"
|
|
62
72
|
require_relative "context_dev/models/brand_retrieve_simplified_response"
|
|
73
|
+
require_relative "context_dev/models/crawl_controls"
|
|
74
|
+
require_relative "context_dev/models/failure"
|
|
63
75
|
require_relative "context_dev/models/industry_retrieve_naics_params"
|
|
64
76
|
require_relative "context_dev/models/industry_retrieve_naics_response"
|
|
65
77
|
require_relative "context_dev/models/industry_retrieve_sic_params"
|
|
66
78
|
require_relative "context_dev/models/industry_retrieve_sic_response"
|
|
79
|
+
require_relative "context_dev/models/intake"
|
|
67
80
|
require_relative "context_dev/models/monitor_create_params"
|
|
68
81
|
require_relative "context_dev/models/monitor_create_response"
|
|
69
82
|
require_relative "context_dev/models/monitor_delete_params"
|
|
@@ -90,6 +103,7 @@ require_relative "context_dev/models/monitor_run_params"
|
|
|
90
103
|
require_relative "context_dev/models/monitor_run_response"
|
|
91
104
|
require_relative "context_dev/models/monitor_update_params"
|
|
92
105
|
require_relative "context_dev/models/monitor_update_response"
|
|
106
|
+
require_relative "context_dev/models/page_error_count"
|
|
93
107
|
require_relative "context_dev/models/parse_handle_params"
|
|
94
108
|
require_relative "context_dev/models/parse_handle_response"
|
|
95
109
|
require_relative "context_dev/models/utility_prefetch_params"
|
|
@@ -119,6 +133,7 @@ require_relative "context_dev/models/web_web_scrape_sitemap_params"
|
|
|
119
133
|
require_relative "context_dev/models/web_web_scrape_sitemap_response"
|
|
120
134
|
require_relative "context_dev/models"
|
|
121
135
|
require_relative "context_dev/resources/ai"
|
|
136
|
+
require_relative "context_dev/resources/batch"
|
|
122
137
|
require_relative "context_dev/resources/brand"
|
|
123
138
|
require_relative "context_dev/resources/industry"
|
|
124
139
|
require_relative "context_dev/resources/monitors"
|
data/rbi/context_dev/client.rbi
CHANGED
|
@@ -38,6 +38,9 @@ module ContextDev
|
|
|
38
38
|
sig { returns(ContextDev::Resources::Monitors) }
|
|
39
39
|
attr_reader :monitors
|
|
40
40
|
|
|
41
|
+
sig { returns(ContextDev::Resources::Batch) }
|
|
42
|
+
attr_reader :batch
|
|
43
|
+
|
|
41
44
|
# @api private
|
|
42
45
|
sig { override.returns(T::Hash[String, String]) }
|
|
43
46
|
private def auth_headers
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ContextDev
|
|
4
|
+
module Models
|
|
5
|
+
class BatchCancelParams < ContextDev::Internal::Type::BaseModel
|
|
6
|
+
extend ContextDev::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include ContextDev::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(ContextDev::BatchCancelParams, ContextDev::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# ID of the batch to retrieve or cancel.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :batch_id
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
batch_id: String,
|
|
21
|
+
request_options: ContextDev::RequestOptions::OrHash
|
|
22
|
+
).returns(T.attached_class)
|
|
23
|
+
end
|
|
24
|
+
def self.new(
|
|
25
|
+
# ID of the batch to retrieve or cancel.
|
|
26
|
+
batch_id:,
|
|
27
|
+
request_options: {}
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
sig do
|
|
32
|
+
override.returns(
|
|
33
|
+
{ batch_id: String, request_options: ContextDev::RequestOptions }
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
def to_hash
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|