context.dev 2.4.0 → 2.6.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.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/client.rb +4 -0
  5. data/lib/context_dev/models/ai_extract_product_params.rb +9 -1
  6. data/lib/context_dev/models/ai_extract_products_params.rb +18 -2
  7. data/lib/context_dev/models/batch_cancel_params.rb +22 -0
  8. data/lib/context_dev/models/batch_cancel_response.rb +354 -0
  9. data/lib/context_dev/models/batch_get_results_params.rb +42 -0
  10. data/lib/context_dev/models/batch_get_results_response.rb +463 -0
  11. data/lib/context_dev/models/batch_list_params.rb +94 -0
  12. data/lib/context_dev/models/batch_list_response.rb +388 -0
  13. data/lib/context_dev/models/batch_retrieve_params.rb +22 -0
  14. data/lib/context_dev/models/batch_retrieve_response.rb +390 -0
  15. data/lib/context_dev/models/batch_submit_params.rb +56 -0
  16. data/lib/context_dev/models/batch_submit_response.rb +614 -0
  17. data/lib/context_dev/models/brand_retrieve_params.rb +109 -22
  18. data/lib/context_dev/models/brand_retrieve_response.rb +4 -6
  19. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +32 -3
  20. data/lib/context_dev/models/error.rb +26 -0
  21. data/lib/context_dev/models/error_count.rb +26 -0
  22. data/lib/context_dev/models/industry_retrieve_naics_params.rb +11 -1
  23. data/lib/context_dev/models/industry_retrieve_sic_params.rb +11 -1
  24. data/lib/context_dev/models/monitor_create_params.rb +147 -132
  25. data/lib/context_dev/models/monitor_create_response.rb +40 -15
  26. data/lib/context_dev/models/monitor_get_credit_usage_params.rb +30 -0
  27. data/lib/context_dev/models/monitor_get_credit_usage_response.rb +59 -0
  28. data/lib/context_dev/models/monitor_get_limits_params.rb +14 -0
  29. data/lib/context_dev/models/monitor_get_limits_response.rb +52 -0
  30. data/lib/context_dev/models/monitor_list_account_changes_params.rb +16 -7
  31. data/lib/context_dev/models/monitor_list_account_changes_response.rb +2 -1
  32. data/lib/context_dev/models/monitor_list_account_runs_params.rb +7 -10
  33. data/lib/context_dev/models/monitor_list_changes_params.rb +8 -4
  34. data/lib/context_dev/models/monitor_list_changes_response.rb +2 -1
  35. data/lib/context_dev/models/monitor_list_params.rb +18 -19
  36. data/lib/context_dev/models/monitor_list_response.rb +27 -12
  37. data/lib/context_dev/models/monitor_list_runs_params.rb +7 -10
  38. data/lib/context_dev/models/monitor_retrieve_change_response.rb +2 -1
  39. data/lib/context_dev/models/monitor_retrieve_response.rb +27 -12
  40. data/lib/context_dev/models/monitor_update_params.rb +27 -12
  41. data/lib/context_dev/models/monitor_update_response.rb +27 -12
  42. data/lib/context_dev/models/parse_handle_params.rb +199 -33
  43. data/lib/context_dev/models/utility_prefetch_params.rb +9 -1
  44. data/lib/context_dev/models/web_extract_competitors_params.rb +11 -1
  45. data/lib/context_dev/models/web_extract_fonts_params.rb +14 -4
  46. data/lib/context_dev/models/web_extract_params.rb +19 -1
  47. data/lib/context_dev/models/web_extract_styleguide_params.rb +14 -4
  48. data/lib/context_dev/models/web_screenshot_params.rb +69 -18
  49. data/lib/context_dev/models/web_screenshot_response.rb +3 -2
  50. data/lib/context_dev/models/web_search_params.rb +9 -1
  51. data/lib/context_dev/models/web_web_crawl_md_params.rb +34 -1
  52. data/lib/context_dev/models/web_web_scrape_html_params.rb +268 -29
  53. data/lib/context_dev/models/web_web_scrape_html_response.rb +93 -1
  54. data/lib/context_dev/models/web_web_scrape_images_params.rb +208 -19
  55. data/lib/context_dev/models/web_web_scrape_md_params.rb +352 -38
  56. data/lib/context_dev/models/web_web_scrape_md_response.rb +93 -1
  57. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +45 -1
  58. data/lib/context_dev/models.rb +18 -0
  59. data/lib/context_dev/resources/ai.rb +3 -1
  60. data/lib/context_dev/resources/batch.rb +155 -0
  61. data/lib/context_dev/resources/brand.rb +6 -2
  62. data/lib/context_dev/resources/industry.rb +6 -2
  63. data/lib/context_dev/resources/monitors.rb +75 -37
  64. data/lib/context_dev/resources/parse.rb +15 -11
  65. data/lib/context_dev/resources/utility.rb +3 -1
  66. data/lib/context_dev/resources/web.rb +104 -55
  67. data/lib/context_dev/version.rb +1 -1
  68. data/lib/context_dev.rb +17 -0
  69. data/rbi/context_dev/client.rbi +3 -0
  70. data/rbi/context_dev/models/ai_extract_product_params.rbi +11 -0
  71. data/rbi/context_dev/models/ai_extract_products_params.rbi +22 -0
  72. data/rbi/context_dev/models/batch_cancel_params.rbi +40 -0
  73. data/rbi/context_dev/models/batch_cancel_response.rbi +642 -0
  74. data/rbi/context_dev/models/batch_get_results_params.rbi +70 -0
  75. data/rbi/context_dev/models/batch_get_results_response.rbi +848 -0
  76. data/rbi/context_dev/models/batch_list_params.rbi +166 -0
  77. data/rbi/context_dev/models/batch_list_response.rbi +738 -0
  78. data/rbi/context_dev/models/batch_retrieve_params.rbi +40 -0
  79. data/rbi/context_dev/models/batch_retrieve_response.rbi +707 -0
  80. data/rbi/context_dev/models/batch_submit_params.rbi +105 -0
  81. data/rbi/context_dev/models/batch_submit_response.rbi +1330 -0
  82. data/rbi/context_dev/models/brand_retrieve_params.rbi +175 -64
  83. data/rbi/context_dev/models/brand_retrieve_response.rbi +8 -11
  84. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +68 -5
  85. data/rbi/context_dev/models/error.rbi +32 -0
  86. data/rbi/context_dev/models/error_count.rbi +34 -0
  87. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +15 -0
  88. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +15 -0
  89. data/rbi/context_dev/models/monitor_create_params.rbi +280 -246
  90. data/rbi/context_dev/models/monitor_create_response.rbi +44 -11
  91. data/rbi/context_dev/models/monitor_get_credit_usage_params.rbi +60 -0
  92. data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +111 -0
  93. data/rbi/context_dev/models/monitor_get_limits_params.rbi +30 -0
  94. data/rbi/context_dev/models/monitor_get_limits_response.rbi +105 -0
  95. data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +16 -0
  96. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +2 -0
  97. data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +7 -6
  98. data/rbi/context_dev/models/monitor_list_changes_params.rbi +8 -0
  99. data/rbi/context_dev/models/monitor_list_changes_response.rbi +2 -0
  100. data/rbi/context_dev/models/monitor_list_params.rbi +23 -31
  101. data/rbi/context_dev/models/monitor_list_response.rbi +30 -9
  102. data/rbi/context_dev/models/monitor_list_runs_params.rbi +7 -6
  103. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +2 -0
  104. data/rbi/context_dev/models/monitor_retrieve_response.rbi +30 -9
  105. data/rbi/context_dev/models/monitor_update_params.rbi +30 -9
  106. data/rbi/context_dev/models/monitor_update_response.rbi +30 -9
  107. data/rbi/context_dev/models/parse_handle_params.rbi +400 -46
  108. data/rbi/context_dev/models/utility_prefetch_params.rbi +11 -0
  109. data/rbi/context_dev/models/web_extract_competitors_params.rbi +15 -0
  110. data/rbi/context_dev/models/web_extract_fonts_params.rbi +19 -7
  111. data/rbi/context_dev/models/web_extract_params.rbi +26 -0
  112. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +19 -7
  113. data/rbi/context_dev/models/web_screenshot_params.rbi +108 -37
  114. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -2
  115. data/rbi/context_dev/models/web_search_params.rbi +11 -0
  116. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +53 -0
  117. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +554 -49
  118. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +182 -0
  119. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +426 -30
  120. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +742 -61
  121. data/rbi/context_dev/models/web_web_scrape_md_response.rbi +180 -0
  122. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +82 -0
  123. data/rbi/context_dev/models.rbi +18 -0
  124. data/rbi/context_dev/resources/ai.rbi +3 -0
  125. data/rbi/context_dev/resources/batch.rbi +120 -0
  126. data/rbi/context_dev/resources/brand.rbi +9 -1
  127. data/rbi/context_dev/resources/industry.rbi +10 -0
  128. data/rbi/context_dev/resources/monitors.rbi +67 -23
  129. data/rbi/context_dev/resources/parse.rbi +46 -19
  130. data/rbi/context_dev/resources/utility.rbi +3 -0
  131. data/rbi/context_dev/resources/web.rbi +224 -48
  132. data/sig/context_dev/client.rbs +2 -0
  133. data/sig/context_dev/models/ai_extract_product_params.rbs +12 -1
  134. data/sig/context_dev/models/ai_extract_products_params.rbs +14 -0
  135. data/sig/context_dev/models/batch_cancel_params.rbs +23 -0
  136. data/sig/context_dev/models/batch_cancel_response.rbs +266 -0
  137. data/sig/context_dev/models/batch_get_results_params.rbs +36 -0
  138. data/sig/context_dev/models/batch_get_results_response.rbs +399 -0
  139. data/sig/context_dev/models/batch_list_params.rbs +94 -0
  140. data/sig/context_dev/models/batch_list_response.rbs +304 -0
  141. data/sig/context_dev/models/batch_retrieve_params.rbs +23 -0
  142. data/sig/context_dev/models/batch_retrieve_response.rbs +290 -0
  143. data/sig/context_dev/models/batch_submit_params.rbs +52 -0
  144. data/sig/context_dev/models/batch_submit_response.rbs +542 -0
  145. data/sig/context_dev/models/brand_retrieve_params.rbs +97 -51
  146. data/sig/context_dev/models/brand_retrieve_response.rbs +2 -2
  147. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +34 -5
  148. data/sig/context_dev/models/error.rbs +15 -0
  149. data/sig/context_dev/models/error_count.rbs +15 -0
  150. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +7 -0
  151. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +7 -0
  152. data/sig/context_dev/models/monitor_create_params.rbs +117 -97
  153. data/sig/context_dev/models/monitor_create_response.rbs +18 -1
  154. data/sig/context_dev/models/monitor_get_credit_usage_params.rbs +32 -0
  155. data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +52 -0
  156. data/sig/context_dev/models/monitor_get_limits_params.rbs +15 -0
  157. data/sig/context_dev/models/monitor_get_limits_response.rbs +43 -0
  158. data/sig/context_dev/models/monitor_list_params.rbs +8 -14
  159. data/sig/context_dev/models/monitor_list_response.rbs +13 -1
  160. data/sig/context_dev/models/monitor_retrieve_response.rbs +13 -1
  161. data/sig/context_dev/models/monitor_update_params.rbs +13 -1
  162. data/sig/context_dev/models/monitor_update_response.rbs +13 -1
  163. data/sig/context_dev/models/parse_handle_params.rbs +124 -25
  164. data/sig/context_dev/models/utility_prefetch_params.rbs +7 -0
  165. data/sig/context_dev/models/web_extract_competitors_params.rbs +12 -1
  166. data/sig/context_dev/models/web_extract_fonts_params.rbs +10 -5
  167. data/sig/context_dev/models/web_extract_params.rbs +14 -0
  168. data/sig/context_dev/models/web_extract_styleguide_params.rbs +10 -5
  169. data/sig/context_dev/models/web_screenshot_params.rbs +41 -20
  170. data/sig/context_dev/models/web_search_params.rbs +7 -0
  171. data/sig/context_dev/models/web_web_crawl_md_params.rbs +28 -1
  172. data/sig/context_dev/models/web_web_scrape_html_params.rbs +175 -47
  173. data/sig/context_dev/models/web_web_scrape_html_response.rbs +85 -0
  174. data/sig/context_dev/models/web_web_scrape_images_params.rbs +128 -38
  175. data/sig/context_dev/models/web_web_scrape_md_params.rbs +229 -62
  176. data/sig/context_dev/models/web_web_scrape_md_response.rbs +85 -0
  177. data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +35 -1
  178. data/sig/context_dev/models.rbs +18 -0
  179. data/sig/context_dev/resources/ai.rbs +1 -0
  180. data/sig/context_dev/resources/batch.rbs +41 -0
  181. data/sig/context_dev/resources/brand.rbs +3 -1
  182. data/sig/context_dev/resources/industry.rbs +2 -0
  183. data/sig/context_dev/resources/monitors.rbs +14 -4
  184. data/sig/context_dev/resources/parse.rbs +8 -5
  185. data/sig/context_dev/resources/utility.rbs +1 -0
  186. data/sig/context_dev/resources/web.rbs +47 -26
  187. metadata +53 -2
@@ -28,6 +28,21 @@ module ContextDev
28
28
  # @return [Integer, nil]
29
29
  optional :max_links, Integer
30
30
 
31
+ # @!attribute sitemap_url
32
+ # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled
33
+ # instead of discovering the domain's sitemaps.
34
+ #
35
+ # @return [String, nil]
36
+ optional :sitemap_url, String
37
+
38
+ # @!attribute tags
39
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
40
+ # recorded on the request's usage log and can be used to filter usage on the
41
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
42
+ #
43
+ # @return [Array<String>, nil]
44
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
45
+
31
46
  # @!attribute timeout_ms
32
47
  # Optional timeout in milliseconds for the request. If the request takes longer
33
48
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -43,7 +58,16 @@ module ContextDev
43
58
  # @return [String, nil]
44
59
  optional :url_regex, String
45
60
 
46
- # @!method initialize(domain:, headers: nil, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {})
61
+ # @!attribute zdr
62
+ # Set to enabled to bypass shared caches and omit request and response content
63
+ # from retained usage logs. Requires zero data retention to be enabled for your
64
+ # organization (contact support@context.dev), otherwise the request fails with
65
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
66
+ #
67
+ # @return [Symbol, ContextDev::Models::WebWebScrapeSitemapParams::Zdr, nil]
68
+ optional :zdr, enum: -> { ContextDev::WebWebScrapeSitemapParams::Zdr }
69
+
70
+ # @!method initialize(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {})
47
71
  # Some parameter documentations has been truncated, see
48
72
  # {ContextDev::Models::WebWebScrapeSitemapParams} for more details.
49
73
  #
@@ -53,11 +77,31 @@ module ContextDev
53
77
  #
54
78
  # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi
55
79
  #
80
+ # @param sitemap_url [String] Optional explicit sitemap URL. When provided, exactly this sitemap is crawled in
81
+ #
82
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
83
+ #
56
84
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
57
85
  #
58
86
  # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur
59
87
  #
88
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeSitemapParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
89
+ #
60
90
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
91
+
92
+ # Set to enabled to bypass shared caches and omit request and response content
93
+ # from retained usage logs. Requires zero data retention to be enabled for your
94
+ # organization (contact support@context.dev), otherwise the request fails with
95
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
96
+ module Zdr
97
+ extend ContextDev::Internal::Type::Enum
98
+
99
+ ENABLED = :enabled
100
+ DISABLED = :disabled
101
+
102
+ # @!method self.values
103
+ # @return [Array<Symbol>]
104
+ end
61
105
  end
62
106
  end
63
107
  end
@@ -43,10 +43,24 @@ 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
+ Error = ContextDev::Models::Error
61
+
62
+ ErrorCount = ContextDev::Models::ErrorCount
63
+
50
64
  IndustryRetrieveNaicsParams = ContextDev::Models::IndustryRetrieveNaicsParams
51
65
 
52
66
  IndustryRetrieveSicParams = ContextDev::Models::IndustryRetrieveSicParams
@@ -55,6 +69,10 @@ module ContextDev
55
69
 
56
70
  MonitorDeleteParams = ContextDev::Models::MonitorDeleteParams
57
71
 
72
+ MonitorGetCreditUsageParams = ContextDev::Models::MonitorGetCreditUsageParams
73
+
74
+ MonitorGetLimitsParams = ContextDev::Models::MonitorGetLimitsParams
75
+
58
76
  MonitorListAccountChangesParams = ContextDev::Models::MonitorListAccountChangesParams
59
77
 
60
78
  MonitorListAccountRunsParams = ContextDev::Models::MonitorListAccountRunsParams
@@ -9,12 +9,14 @@ module ContextDev
9
9
  # Given a single URL, determines if it is a product page and extracts the product
10
10
  # information.
11
11
  #
12
- # @overload extract_product(url:, max_age_ms: nil, timeout_ms: nil, request_options: {})
12
+ # @overload extract_product(url:, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {})
13
13
  #
14
14
  # @param url [String] The product page URL to extract product data from.
15
15
  #
16
16
  # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y
17
17
  #
18
+ # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
19
+ #
18
20
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
19
21
  #
20
22
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -0,0 +1,155 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContextDev
4
+ module Resources
5
+ class Batch
6
+ # Check progress and get download links when the batch finishes. Also returns the
7
+ # rejected-URL list and webhook signing secret from submission, so nothing is lost
8
+ # if the submit response was dropped.
9
+ #
10
+ # @overload retrieve(batch_id, request_options: {})
11
+ #
12
+ # @param batch_id [String] ID of the batch to retrieve or cancel.
13
+ #
14
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
15
+ #
16
+ # @return [ContextDev::Models::BatchRetrieveResponse]
17
+ #
18
+ # @see ContextDev::Models::BatchRetrieveParams
19
+ def retrieve(batch_id, params = {})
20
+ @client.request(
21
+ method: :get,
22
+ path: ["batch/%1$s", batch_id],
23
+ model: ContextDev::Models::BatchRetrieveResponse,
24
+ options: params[:request_options]
25
+ )
26
+ end
27
+
28
+ # Some parameter documentations has been truncated, see
29
+ # {ContextDev::Models::BatchListParams} for more details.
30
+ #
31
+ # List your batches from newest to oldest. Filter by status or continue with a
32
+ # cursor.
33
+ #
34
+ # @overload list(cursor: nil, limit: nil, q: nil, search_type: nil, status: nil, tags: nil, request_options: {})
35
+ #
36
+ # @param cursor [String] Cursor from the previous page.
37
+ #
38
+ # @param limit [Integer] Batches per page. Defaults to 25.
39
+ #
40
+ # @param q [String] Free-text search term, matched against the batch id, crawl source (start URL or
41
+ #
42
+ # @param search_type [Symbol, ContextDev::Models::BatchListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match
43
+ #
44
+ # @param status [Symbol, ContextDev::Models::BatchListParams::Status] Filter by status.
45
+ #
46
+ # @param tags [String] Comma-separated list of tags to filter by (matches batches having any of them).
47
+ #
48
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
49
+ #
50
+ # @return [ContextDev::Models::BatchListResponse]
51
+ #
52
+ # @see ContextDev::Models::BatchListParams
53
+ def list(params = {})
54
+ parsed, options = ContextDev::BatchListParams.dump_request(params)
55
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
56
+ @client.request(
57
+ method: :get,
58
+ path: "batch/list",
59
+ query: query,
60
+ model: ContextDev::Models::BatchListResponse,
61
+ options: options
62
+ )
63
+ end
64
+
65
+ # Stop a batch from starting new pages. In-progress pages finish, and unused
66
+ # credits are refunded.
67
+ #
68
+ # @overload cancel(batch_id, request_options: {})
69
+ #
70
+ # @param batch_id [String] ID of the batch to retrieve or cancel.
71
+ #
72
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
73
+ #
74
+ # @return [ContextDev::Models::BatchCancelResponse]
75
+ #
76
+ # @see ContextDev::Models::BatchCancelParams
77
+ def cancel(batch_id, params = {})
78
+ @client.request(
79
+ method: :post,
80
+ path: ["batch/%1$s/cancel", batch_id],
81
+ model: ContextDev::Models::BatchCancelResponse,
82
+ options: params[:request_options]
83
+ )
84
+ end
85
+
86
+ # Some parameter documentations has been truncated, see
87
+ # {ContextDev::Models::BatchGetResultsParams} for more details.
88
+ #
89
+ # Page through the result records of a finished batch as JSON, in the same order
90
+ # as the downloadable result files. Use this instead of downloading and parsing
91
+ # the NDJSON files yourself.
92
+ #
93
+ # @overload get_results(batch_id, cursor: nil, limit: nil, request_options: {})
94
+ #
95
+ # @param batch_id [String] ID of the batch to retrieve or cancel.
96
+ #
97
+ # @param cursor [String] next_cursor from the previous page.
98
+ #
99
+ # @param limit [Integer] Records per page. Defaults to 25. A page can close early so its payload stays un
100
+ #
101
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
102
+ #
103
+ # @return [ContextDev::Models::BatchGetResultsResponse]
104
+ #
105
+ # @see ContextDev::Models::BatchGetResultsParams
106
+ def get_results(batch_id, params = {})
107
+ parsed, options = ContextDev::BatchGetResultsParams.dump_request(params)
108
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
109
+ @client.request(
110
+ method: :get,
111
+ path: ["batch/%1$s/results", batch_id],
112
+ query: query,
113
+ model: ContextDev::Models::BatchGetResultsResponse,
114
+ options: options
115
+ )
116
+ end
117
+
118
+ # Some parameter documentations has been truncated, see
119
+ # {ContextDev::Models::BatchSubmitParams} for more details.
120
+ #
121
+ # Retrieve and normalize a person profile from identifiers.
122
+ #
123
+ # @overload submit(identifiers:, tags: nil, timeout_ms: nil, request_options: {})
124
+ #
125
+ # @param identifiers [ContextDev::Models::BatchSubmitParams::Identifiers] Known identifiers for the person. At least one identifier is required.
126
+ #
127
+ # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
128
+ #
129
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
130
+ #
131
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
132
+ #
133
+ # @return [ContextDev::Models::BatchSubmitResponse]
134
+ #
135
+ # @see ContextDev::Models::BatchSubmitParams
136
+ def submit(params)
137
+ parsed, options = ContextDev::BatchSubmitParams.dump_request(params)
138
+ @client.request(
139
+ method: :post,
140
+ path: "people/retrieve",
141
+ body: parsed,
142
+ model: ContextDev::Models::BatchSubmitResponse,
143
+ options: options
144
+ )
145
+ end
146
+
147
+ # @api private
148
+ #
149
+ # @param client [ContextDev::Client]
150
+ def initialize(client:)
151
+ @client = client
152
+ end
153
+ end
154
+ end
155
+ end
@@ -36,11 +36,15 @@ module ContextDev
36
36
  # information: domain, title, colors, logos, and backdrops. Optimized for faster
37
37
  # responses and reduced data transfer.
38
38
  #
39
- # @overload retrieve_simplified(domain:, max_age_ms: nil, timeout_ms: nil, request_options: {})
39
+ # @overload retrieve_simplified(domain:, max_age_ms: nil, tags: nil, theme: nil, timeout_ms: nil, request_options: {})
40
40
  #
41
41
  # @param domain [String] Domain name to retrieve simplified brand data for
42
42
  #
43
- # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard
43
+ # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard
44
+ #
45
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
46
+ #
47
+ # @param theme [Symbol, ContextDev::Models::BrandRetrieveSimplifiedParams::Theme] Optional theme preference used when selecting brand assets.
44
48
  #
45
49
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
46
50
  #
@@ -8,7 +8,7 @@ module ContextDev
8
8
  #
9
9
  # Classify any brand into 2022 NAICS industry codes from its domain or name.
10
10
  #
11
- # @overload retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {})
11
+ # @overload retrieve_naics(input:, max_results: nil, min_results: nil, tags: nil, timeout_ms: nil, request_options: {})
12
12
  #
13
13
  # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
14
14
  #
@@ -16,6 +16,8 @@ module ContextDev
16
16
  #
17
17
  # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
18
18
  #
19
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
20
+ #
19
21
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
20
22
  #
21
23
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -46,7 +48,7 @@ module ContextDev
46
48
  # domain or name. Choose between the original SIC system (`original_sic`) or the
47
49
  # latest SIC list maintained by the SEC (`latest_sec`).
48
50
  #
49
- # @overload retrieve_sic(input:, max_results: nil, min_results: nil, timeout_ms: nil, type: nil, request_options: {})
51
+ # @overload retrieve_sic(input:, max_results: nil, min_results: nil, tags: nil, timeout_ms: nil, type: nil, request_options: {})
50
52
  #
51
53
  # @param input [String] Brand domain or title to retrieve SIC code for. If a valid domain is provided, i
52
54
  #
@@ -54,6 +56,8 @@ module ContextDev
54
56
  #
55
57
  # @param min_results [Integer] Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.
56
58
  #
59
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
60
+ #
57
61
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
58
62
  #
59
63
  # @param type [Symbol, ContextDev::Models::IndustryRetrieveSicParams::Type] Which SIC dataset to classify against. `original_sic` uses the 1987 Standard Ind
@@ -14,19 +14,19 @@ module ContextDev
14
14
  # detection combinations. The monitor runs immediately after creation to create
15
15
  # its initial baseline.
16
16
  #
17
- # @overload create(change_detection:, name:, schedule:, target:, mode: nil, tags: nil, webhook: nil, request_options: {})
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
  #
29
- # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
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
+ # @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]
32
32
  #
@@ -84,7 +84,7 @@ module ContextDev
84
84
  #
85
85
  # @param status [Symbol, ContextDev::Models::MonitorUpdateParams::Status]
86
86
  #
87
- # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
87
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes. Duplica
88
88
  #
89
89
  # @param target [ContextDev::Models::MonitorUpdateParams::Target::Page, ContextDev::Models::MonitorUpdateParams::Target::Sitemap, ContextDev::Models::MonitorUpdateParams::Target::Extract] Discriminated union describing what the monitor watches.
90
90
  #
@@ -115,25 +115,25 @@ module ContextDev
115
115
  #
116
116
  # @overload list(change_detection_type: nil, cursor: nil, limit: nil, q: nil, search_by: nil, search_type: nil, status: nil, tag: nil, tags: nil, target_type: nil, request_options: {})
117
117
  #
118
- # @param change_detection_type [Symbol, ContextDev::Models::MonitorListParams::ChangeDetectionType]
118
+ # @param change_detection_type [Symbol, ContextDev::Models::MonitorListParams::ChangeDetectionType] Filter by change detection type.
119
119
  #
120
- # @param cursor [String]
120
+ # @param cursor [String] Opaque pagination cursor from a previous response.
121
121
  #
122
- # @param limit [Integer]
122
+ # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25.
123
123
  #
124
124
  # @param q [String] Free-text search term, matched against the fields named in `search_by`.
125
125
  #
126
- # @param search_by [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru
126
+ # @param search_by [Array<Symbol, ContextDev::Models::MonitorListParams::SearchBy>, nil] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru
127
127
  #
128
128
  # @param search_type [Symbol, ContextDev::Models::MonitorListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match
129
129
  #
130
- # @param status [Symbol, ContextDev::Models::MonitorListParams::Status] Monitor lifecycle status. `failed` means the most recent run failed (see the mon
130
+ # @param status [Symbol, ContextDev::Models::MonitorListParams::Status] Filter monitors by lifecycle status.
131
131
  #
132
132
  # @param tag [String] Filter to items that have this tag.
133
133
  #
134
- # @param tags [Array<String>] Comma-separated list of tags to filter by (matches monitors having any of them).
134
+ # @param tags [Array<String>, nil] Comma-separated list of tags to filter by (matches monitors having any of them).
135
135
  #
136
- # @param target_type [Symbol, ContextDev::Models::MonitorListParams::TargetType]
136
+ # @param target_type [Symbol, ContextDev::Models::MonitorListParams::TargetType] Filter by target type.
137
137
  #
138
138
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
139
139
  #
@@ -171,25 +171,69 @@ module ContextDev
171
171
  )
172
172
  end
173
173
 
174
+ # Returns credits charged per monitor over an optional [since, until] window,
175
+ # newest spenders first.
176
+ #
177
+ # @overload get_credit_usage(since: nil, until_: nil, request_options: {})
178
+ #
179
+ # @param since [Time] Only include items at or after this ISO 8601 timestamp.
180
+ #
181
+ # @param until_ [Time] Only include items before this ISO 8601 timestamp.
182
+ #
183
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
184
+ #
185
+ # @return [ContextDev::Models::MonitorGetCreditUsageResponse]
186
+ #
187
+ # @see ContextDev::Models::MonitorGetCreditUsageParams
188
+ def get_credit_usage(params = {})
189
+ parsed, options = ContextDev::MonitorGetCreditUsageParams.dump_request(params)
190
+ query = ContextDev::Internal::Util.encode_query_params(parsed)
191
+ @client.request(
192
+ method: :get,
193
+ path: "monitors/credit-usage",
194
+ query: query.transform_keys(until_: "until"),
195
+ model: ContextDev::Models::MonitorGetCreditUsageResponse,
196
+ options: options
197
+ )
198
+ end
199
+
200
+ # Returns how many monitors the account has and the maximum it allows.
201
+ #
202
+ # @overload get_limits(request_options: {})
203
+ #
204
+ # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
205
+ #
206
+ # @return [ContextDev::Models::MonitorGetLimitsResponse]
207
+ #
208
+ # @see ContextDev::Models::MonitorGetLimitsParams
209
+ def get_limits(params = {})
210
+ @client.request(
211
+ method: :get,
212
+ path: "monitors/limits",
213
+ model: ContextDev::Models::MonitorGetLimitsResponse,
214
+ options: params[:request_options]
215
+ )
216
+ end
217
+
174
218
  # Returns an account-wide feed of detected changes across monitors.
175
219
  #
176
220
  # @overload list_account_changes(change_detection_type: nil, cursor: nil, limit: nil, monitor_id: nil, since: nil, tag: nil, target_type: nil, until_: nil, request_options: {})
177
221
  #
178
- # @param change_detection_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::ChangeDetectionType]
222
+ # @param change_detection_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::ChangeDetectionType] Filter by change detection type.
179
223
  #
180
- # @param cursor [String]
224
+ # @param cursor [String] Opaque pagination cursor from a previous response.
181
225
  #
182
- # @param limit [Integer]
226
+ # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25.
183
227
  #
184
- # @param monitor_id [String]
228
+ # @param monitor_id [String] Filter changes to a single monitor.
185
229
  #
186
- # @param since [Time]
230
+ # @param since [Time] Only include items at or after this ISO 8601 timestamp.
187
231
  #
188
232
  # @param tag [String] Filter to items that have this tag.
189
233
  #
190
- # @param target_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::TargetType]
234
+ # @param target_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::TargetType] Filter by target type.
191
235
  #
192
- # @param until_ [Time]
236
+ # @param until_ [Time] Only include items before this ISO 8601 timestamp.
193
237
  #
194
238
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
195
239
  #
@@ -208,18 +252,15 @@ module ContextDev
208
252
  )
209
253
  end
210
254
 
211
- # Some parameter documentations has been truncated, see
212
- # {ContextDev::Models::MonitorListAccountRunsParams} for more details.
213
- #
214
255
  # Returns an account-wide feed of monitor runs across all monitors.
215
256
  #
216
257
  # @overload list_account_runs(cursor: nil, limit: nil, status: nil, request_options: {})
217
258
  #
218
- # @param cursor [String]
259
+ # @param cursor [String] Opaque pagination cursor from a previous response.
219
260
  #
220
- # @param limit [Integer]
261
+ # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25.
221
262
  #
222
- # @param status [Symbol, ContextDev::Models::MonitorListAccountRunsParams::Status] Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (in
263
+ # @param status [Symbol, ContextDev::Models::MonitorListAccountRunsParams::Status] Filter runs by lifecycle status.
223
264
  #
224
265
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
225
266
  #
@@ -244,15 +285,15 @@ module ContextDev
244
285
  #
245
286
  # @param monitor_id [String]
246
287
  #
247
- # @param cursor [String]
288
+ # @param cursor [String] Opaque pagination cursor from a previous response.
248
289
  #
249
- # @param limit [Integer]
290
+ # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25.
250
291
  #
251
- # @param since [Time]
292
+ # @param since [Time] Only include items at or after this ISO 8601 timestamp.
252
293
  #
253
294
  # @param tag [String] Filter to items that have this tag.
254
295
  #
255
- # @param until_ [Time]
296
+ # @param until_ [Time] Only include items before this ISO 8601 timestamp.
256
297
  #
257
298
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
258
299
  #
@@ -271,20 +312,17 @@ module ContextDev
271
312
  )
272
313
  end
273
314
 
274
- # Some parameter documentations has been truncated, see
275
- # {ContextDev::Models::MonitorListRunsParams} for more details.
276
- #
277
315
  # List monitor runs
278
316
  #
279
317
  # @overload list_runs(monitor_id, cursor: nil, limit: nil, status: nil, request_options: {})
280
318
  #
281
319
  # @param monitor_id [String]
282
320
  #
283
- # @param cursor [String]
321
+ # @param cursor [String] Opaque pagination cursor from a previous response.
284
322
  #
285
- # @param limit [Integer]
323
+ # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25.
286
324
  #
287
- # @param status [Symbol, ContextDev::Models::MonitorListRunsParams::Status] Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (in
325
+ # @param status [Symbol, ContextDev::Models::MonitorListRunsParams::Status] Filter runs by lifecycle status.
288
326
  #
289
327
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
290
328
  #
@@ -7,27 +7,31 @@ module ContextDev
7
7
  # {ContextDev::Models::ParseHandleParams} for more details.
8
8
  #
9
9
  # Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes
10
- # into LLM-usable Markdown. The base request costs 1 credit. When OCR runs
11
- # (requires ocr=true), the entire call costs 5 credits; ocr=true requests where no
12
- # OCR ends up running still cost 1 credit.
10
+ # into LLM-usable Markdown.
13
11
  #
14
- # @overload handle(body:, extension: nil, include_images: nil, include_links: nil, ocr: nil, pdf: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
12
+ # @overload handle(body:, client: nil, extension: nil, include_images: nil, include_links: nil, ocr: nil, pdf: nil, shorten_base64_images: nil, tags: nil, use_main_content_only: nil, zdr: nil, request_options: {})
15
13
  #
16
14
  # @param body [Pathname, StringIO, IO, String, ContextDev::FilePart] Body param
17
15
  #
18
- # @param extension [Symbol, ContextDev::Models::ParseHandleParams::Extension] Query param: Optional file extension hint. Case-insensitive; a leading dot is ac
16
+ # @param client [String] Query param: Optional client identifier used for usage attribution.
19
17
  #
20
- # @param include_images [Boolean] Query param: Include image references in Markdown output
18
+ # @param extension [Symbol, ContextDev::Models::ParseHandleParams::Extension] Query param: Optional file extension hint, such as pdf, docx, xlsx, pptx, html,
21
19
  #
22
- # @param include_links [Boolean] Query param: Preserve hyperlinks in Markdown output
20
+ # @param include_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeImages] Query param: Include image references in Markdown output
23
21
  #
24
- # @param ocr [Boolean] Query param: Gates all OCR. When true, PDFs get embedded-image OCR (recognized t
22
+ # @param include_links [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeLinks] Query param: Preserve hyperlinks in Markdown output
25
23
  #
26
- # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] Query param: PDF page-range controls. Use start/end to limit parsing (and OCR wh
24
+ # @param ocr [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr] Query param: When true for PDF inputs, detect and OCR images embedded in the sel
27
25
  #
28
- # @param shorten_base64_images [Boolean] Query param: Shorten base64-encoded image data in the Markdown output
26
+ # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] Query param: PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5
29
27
  #
30
- # @param use_main_content_only [Boolean] Query param: Extract only the main content from HTML-like inputs
28
+ # @param shorten_base64_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::ShortenBase64Images] Query param: Shorten base64-encoded image data in the Markdown output
29
+ #
30
+ # @param tags [Array<String>] Query param: Optional comma-separated caller-defined tags for tracking this requ
31
+ #
32
+ # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly] Query param: Extract only the main content from HTML-like inputs
33
+ #
34
+ # @param zdr [Symbol, ContextDev::Models::ParseHandleParams::Zdr] Query param: Set to enabled to bypass shared caches and omit request and respons
31
35
  #
32
36
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]
33
37
  #
@@ -11,12 +11,14 @@ module ContextDev
11
11
  # one lookup key: a domain, or an email whose domain is extracted and validated
12
12
  # (free email providers and disposable email addresses are not allowed).
13
13
  #
14
- # @overload prefetch(identifier:, type:, timeout_ms: nil, request_options: {})
14
+ # @overload prefetch(identifier:, type:, tags: nil, timeout_ms: nil, request_options: {})
15
15
  #
16
16
  # @param identifier [ContextDev::Models::UtilityPrefetchParams::Identifier::UtilityPrefetchDomainIdentifier, ContextDev::Models::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier] Identifier of the brand to prefetch. Provide exactly one of domain or email.
17
17
  #
18
18
  # @param type [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] What to prefetch. Currently only 'brand' is supported.
19
19
  #
20
+ # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
21
+ #
20
22
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
21
23
  #
22
24
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil]