context.dev 2.3.0 → 2.5.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 (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +9 -9
  4. data/lib/context_dev/models/ai_extract_product_params.rb +9 -1
  5. data/lib/context_dev/models/ai_extract_products_params.rb +18 -2
  6. data/lib/context_dev/models/brand_retrieve_params.rb +109 -22
  7. data/lib/context_dev/models/brand_retrieve_response.rb +4 -6
  8. data/lib/context_dev/models/brand_retrieve_simplified_params.rb +32 -3
  9. data/lib/context_dev/models/industry_retrieve_naics_params.rb +11 -1
  10. data/lib/context_dev/models/industry_retrieve_sic_params.rb +11 -1
  11. data/lib/context_dev/models/monitor_create_params.rb +6 -5
  12. data/lib/context_dev/models/monitor_create_response.rb +6 -5
  13. data/lib/context_dev/models/monitor_get_credit_usage_params.rb +30 -0
  14. data/lib/context_dev/models/monitor_get_credit_usage_response.rb +59 -0
  15. data/lib/context_dev/models/monitor_get_limits_params.rb +14 -0
  16. data/lib/context_dev/models/monitor_get_limits_response.rb +52 -0
  17. data/lib/context_dev/models/monitor_list_account_changes_params.rb +16 -7
  18. data/lib/context_dev/models/monitor_list_account_changes_response.rb +2 -1
  19. data/lib/context_dev/models/monitor_list_account_runs_params.rb +7 -10
  20. data/lib/context_dev/models/monitor_list_changes_params.rb +8 -4
  21. data/lib/context_dev/models/monitor_list_changes_response.rb +2 -1
  22. data/lib/context_dev/models/monitor_list_params.rb +18 -19
  23. data/lib/context_dev/models/monitor_list_response.rb +6 -5
  24. data/lib/context_dev/models/monitor_list_runs_params.rb +7 -10
  25. data/lib/context_dev/models/monitor_retrieve_change_response.rb +2 -1
  26. data/lib/context_dev/models/monitor_retrieve_response.rb +6 -5
  27. data/lib/context_dev/models/monitor_update_params.rb +6 -5
  28. data/lib/context_dev/models/monitor_update_response.rb +6 -5
  29. data/lib/context_dev/models/parse_handle_params.rb +296 -46
  30. data/lib/context_dev/models/utility_prefetch_params.rb +9 -1
  31. data/lib/context_dev/models/web_extract_competitors_params.rb +11 -1
  32. data/lib/context_dev/models/web_extract_fonts_params.rb +14 -4
  33. data/lib/context_dev/models/web_extract_params.rb +19 -1
  34. data/lib/context_dev/models/web_extract_styleguide_params.rb +14 -4
  35. data/lib/context_dev/models/web_screenshot_params.rb +69 -18
  36. data/lib/context_dev/models/web_screenshot_response.rb +3 -2
  37. data/lib/context_dev/models/web_search_params.rb +9 -1
  38. data/lib/context_dev/models/web_web_crawl_md_params.rb +34 -1
  39. data/lib/context_dev/models/web_web_scrape_html_params.rb +268 -29
  40. data/lib/context_dev/models/web_web_scrape_images_params.rb +208 -19
  41. data/lib/context_dev/models/web_web_scrape_md_params.rb +352 -38
  42. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +45 -1
  43. data/lib/context_dev/models.rb +4 -0
  44. data/lib/context_dev/resources/ai.rb +3 -1
  45. data/lib/context_dev/resources/brand.rb +6 -2
  46. data/lib/context_dev/resources/industry.rb +6 -2
  47. data/lib/context_dev/resources/monitors.rb +70 -32
  48. data/lib/context_dev/resources/parse.rb +11 -11
  49. data/lib/context_dev/resources/utility.rb +3 -1
  50. data/lib/context_dev/resources/web.rb +104 -55
  51. data/lib/context_dev/version.rb +1 -1
  52. data/lib/context_dev.rb +4 -0
  53. data/rbi/context_dev/models/ai_extract_product_params.rbi +11 -0
  54. data/rbi/context_dev/models/ai_extract_products_params.rbi +22 -0
  55. data/rbi/context_dev/models/brand_retrieve_params.rbi +175 -64
  56. data/rbi/context_dev/models/brand_retrieve_response.rbi +8 -11
  57. data/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +68 -5
  58. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +15 -0
  59. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +15 -0
  60. data/rbi/context_dev/models/monitor_create_params.rbi +6 -4
  61. data/rbi/context_dev/models/monitor_create_response.rbi +6 -4
  62. data/rbi/context_dev/models/monitor_get_credit_usage_params.rbi +60 -0
  63. data/rbi/context_dev/models/monitor_get_credit_usage_response.rbi +111 -0
  64. data/rbi/context_dev/models/monitor_get_limits_params.rbi +30 -0
  65. data/rbi/context_dev/models/monitor_get_limits_response.rbi +105 -0
  66. data/rbi/context_dev/models/monitor_list_account_changes_params.rbi +16 -0
  67. data/rbi/context_dev/models/monitor_list_account_changes_response.rbi +2 -0
  68. data/rbi/context_dev/models/monitor_list_account_runs_params.rbi +7 -6
  69. data/rbi/context_dev/models/monitor_list_changes_params.rbi +8 -0
  70. data/rbi/context_dev/models/monitor_list_changes_response.rbi +2 -0
  71. data/rbi/context_dev/models/monitor_list_params.rbi +23 -31
  72. data/rbi/context_dev/models/monitor_list_response.rbi +6 -4
  73. data/rbi/context_dev/models/monitor_list_runs_params.rbi +7 -6
  74. data/rbi/context_dev/models/monitor_retrieve_change_response.rbi +2 -0
  75. data/rbi/context_dev/models/monitor_retrieve_response.rbi +6 -4
  76. data/rbi/context_dev/models/monitor_update_params.rbi +6 -4
  77. data/rbi/context_dev/models/monitor_update_response.rbi +6 -4
  78. data/rbi/context_dev/models/parse_handle_params.rbi +601 -71
  79. data/rbi/context_dev/models/utility_prefetch_params.rbi +11 -0
  80. data/rbi/context_dev/models/web_extract_competitors_params.rbi +15 -0
  81. data/rbi/context_dev/models/web_extract_fonts_params.rbi +19 -7
  82. data/rbi/context_dev/models/web_extract_params.rbi +26 -0
  83. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +19 -7
  84. data/rbi/context_dev/models/web_screenshot_params.rbi +108 -37
  85. data/rbi/context_dev/models/web_screenshot_response.rbi +4 -2
  86. data/rbi/context_dev/models/web_search_params.rbi +11 -0
  87. data/rbi/context_dev/models/web_web_crawl_md_params.rbi +53 -0
  88. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +554 -49
  89. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +426 -30
  90. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +742 -61
  91. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +82 -0
  92. data/rbi/context_dev/models.rbi +4 -0
  93. data/rbi/context_dev/resources/ai.rbi +3 -0
  94. data/rbi/context_dev/resources/brand.rbi +9 -1
  95. data/rbi/context_dev/resources/industry.rbi +10 -0
  96. data/rbi/context_dev/resources/monitors.rbi +55 -11
  97. data/rbi/context_dev/resources/parse.rbi +44 -24
  98. data/rbi/context_dev/resources/utility.rbi +3 -0
  99. data/rbi/context_dev/resources/web.rbi +224 -48
  100. data/sig/context_dev/models/ai_extract_product_params.rbs +12 -1
  101. data/sig/context_dev/models/ai_extract_products_params.rbs +14 -0
  102. data/sig/context_dev/models/brand_retrieve_params.rbs +97 -51
  103. data/sig/context_dev/models/brand_retrieve_response.rbs +2 -2
  104. data/sig/context_dev/models/brand_retrieve_simplified_params.rbs +34 -5
  105. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +7 -0
  106. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +7 -0
  107. data/sig/context_dev/models/monitor_get_credit_usage_params.rbs +32 -0
  108. data/sig/context_dev/models/monitor_get_credit_usage_response.rbs +52 -0
  109. data/sig/context_dev/models/monitor_get_limits_params.rbs +15 -0
  110. data/sig/context_dev/models/monitor_get_limits_response.rbs +43 -0
  111. data/sig/context_dev/models/monitor_list_params.rbs +8 -14
  112. data/sig/context_dev/models/parse_handle_params.rbs +297 -50
  113. data/sig/context_dev/models/utility_prefetch_params.rbs +7 -0
  114. data/sig/context_dev/models/web_extract_competitors_params.rbs +12 -1
  115. data/sig/context_dev/models/web_extract_fonts_params.rbs +10 -5
  116. data/sig/context_dev/models/web_extract_params.rbs +14 -0
  117. data/sig/context_dev/models/web_extract_styleguide_params.rbs +10 -5
  118. data/sig/context_dev/models/web_screenshot_params.rbs +41 -20
  119. data/sig/context_dev/models/web_search_params.rbs +7 -0
  120. data/sig/context_dev/models/web_web_crawl_md_params.rbs +28 -1
  121. data/sig/context_dev/models/web_web_scrape_html_params.rbs +175 -47
  122. data/sig/context_dev/models/web_web_scrape_images_params.rbs +128 -38
  123. data/sig/context_dev/models/web_web_scrape_md_params.rbs +229 -62
  124. data/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +35 -1
  125. data/sig/context_dev/models.rbs +4 -0
  126. data/sig/context_dev/resources/ai.rbs +1 -0
  127. data/sig/context_dev/resources/brand.rbs +3 -1
  128. data/sig/context_dev/resources/industry.rbs +2 -0
  129. data/sig/context_dev/resources/monitors.rbs +12 -2
  130. data/sig/context_dev/resources/parse.rbs +10 -10
  131. data/sig/context_dev/resources/utility.rbs +1 -0
  132. data/sig/context_dev/resources/web.rbs +47 -26
  133. metadata +14 -2
@@ -13,38 +13,35 @@ module ContextDev
13
13
  required :monitor_id, String
14
14
 
15
15
  # @!attribute cursor
16
+ # Opaque pagination cursor from a previous response.
16
17
  #
17
18
  # @return [String, nil]
18
19
  optional :cursor, String
19
20
 
20
21
  # @!attribute limit
22
+ # Maximum number of items to return per page (1-100). Defaults to 25.
21
23
  #
22
24
  # @return [Integer, nil]
23
25
  optional :limit, Integer
24
26
 
25
27
  # @!attribute status
26
- # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
27
- # (insufficient credits, monitor paused, or superseded by a concurrent run).
28
+ # Filter runs by lifecycle status.
28
29
  #
29
30
  # @return [Symbol, ContextDev::Models::MonitorListRunsParams::Status, nil]
30
31
  optional :status, enum: -> { ContextDev::MonitorListRunsParams::Status }
31
32
 
32
33
  # @!method initialize(monitor_id:, cursor: nil, limit: nil, status: nil, request_options: {})
33
- # Some parameter documentations has been truncated, see
34
- # {ContextDev::Models::MonitorListRunsParams} for more details.
35
- #
36
34
  # @param monitor_id [String]
37
35
  #
38
- # @param cursor [String]
36
+ # @param cursor [String] Opaque pagination cursor from a previous response.
39
37
  #
40
- # @param limit [Integer]
38
+ # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25.
41
39
  #
42
- # @param status [Symbol, ContextDev::Models::MonitorListRunsParams::Status] Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (in
40
+ # @param status [Symbol, ContextDev::Models::MonitorListRunsParams::Status] Filter runs by lifecycle status.
43
41
  #
44
42
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
45
43
 
46
- # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
47
- # (insufficient credits, monitor paused, or superseded by a concurrent run).
44
+ # Filter runs by lifecycle status.
48
45
  module Status
49
46
  extend ContextDev::Internal::Type::Enum
50
47
 
@@ -45,6 +45,7 @@ module ContextDev
45
45
 
46
46
  # @!attribute tags
47
47
  # User-defined tags for grouping and filtering monitors and their changes.
48
+ # Duplicates are removed.
48
49
  #
49
50
  # @return [Array<String>]
50
51
  required :tags, ContextDev::Internal::Type::ArrayOf[String]
@@ -153,7 +154,7 @@ module ContextDev
153
154
  #
154
155
  # @param summary [String]
155
156
  #
156
- # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
157
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes. Duplica
157
158
  #
158
159
  # @param target_type [Symbol, ContextDev::Models::MonitorRetrieveChangeResponse::TargetType]
159
160
  #
@@ -94,6 +94,7 @@ module ContextDev
94
94
 
95
95
  # @!attribute tags
96
96
  # User-defined tags for grouping and filtering monitors and their changes.
97
+ # Duplicates are removed.
97
98
  #
98
99
  # @return [Array<String>, nil]
99
100
  optional :tags, ContextDev::Internal::Type::ArrayOf[String]
@@ -146,7 +147,7 @@ module ContextDev
146
147
  #
147
148
  # @param next_run_at [Time, nil] When the next scheduled run is due.
148
149
  #
149
- # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
150
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes. Duplica
150
151
  #
151
152
  # @param webhook [ContextDev::Models::MonitorRetrieveResponse::Webhook, nil]
152
153
  #
@@ -348,13 +349,13 @@ module ContextDev
348
349
  required :url, String
349
350
 
350
351
  # @!attribute exclude
351
- # URL path patterns to exclude.
352
+ # URL path patterns to exclude (max 50).
352
353
  #
353
354
  # @return [Array<String>, nil]
354
355
  optional :exclude, ContextDev::Internal::Type::ArrayOf[String]
355
356
 
356
357
  # @!attribute include
357
- # URL path patterns to include.
358
+ # URL path patterns to include (max 50).
358
359
  #
359
360
  # @return [Array<String>, nil]
360
361
  optional :include, ContextDev::Internal::Type::ArrayOf[String]
@@ -374,9 +375,9 @@ module ContextDev
374
375
  #
375
376
  # @param url [String] Sitemap URL to monitor.
376
377
  #
377
- # @param exclude [Array<String>] URL path patterns to exclude.
378
+ # @param exclude [Array<String>] URL path patterns to exclude (max 50).
378
379
  #
379
- # @param include [Array<String>] URL path patterns to include.
380
+ # @param include [Array<String>] URL path patterns to include (max 50).
380
381
  #
381
382
  # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000).
382
383
  #
@@ -38,6 +38,7 @@ module ContextDev
38
38
 
39
39
  # @!attribute tags
40
40
  # User-defined tags for grouping and filtering monitors and their changes.
41
+ # Duplicates are removed.
41
42
  #
42
43
  # @return [Array<String>, nil]
43
44
  optional :tags, ContextDev::Internal::Type::ArrayOf[String]
@@ -68,7 +69,7 @@ module ContextDev
68
69
  #
69
70
  # @param status [Symbol, ContextDev::Models::MonitorUpdateParams::Status]
70
71
  #
71
- # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
72
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes. Duplica
72
73
  #
73
74
  # @param target [ContextDev::Models::MonitorUpdateParams::Target::Page, ContextDev::Models::MonitorUpdateParams::Target::Sitemap, ContextDev::Models::MonitorUpdateParams::Target::Extract] Discriminated union describing what the monitor watches.
74
75
  #
@@ -246,13 +247,13 @@ module ContextDev
246
247
  required :url, String
247
248
 
248
249
  # @!attribute exclude
249
- # URL path patterns to exclude.
250
+ # URL path patterns to exclude (max 50).
250
251
  #
251
252
  # @return [Array<String>, nil]
252
253
  optional :exclude, ContextDev::Internal::Type::ArrayOf[String]
253
254
 
254
255
  # @!attribute include
255
- # URL path patterns to include.
256
+ # URL path patterns to include (max 50).
256
257
  #
257
258
  # @return [Array<String>, nil]
258
259
  optional :include, ContextDev::Internal::Type::ArrayOf[String]
@@ -272,9 +273,9 @@ module ContextDev
272
273
  #
273
274
  # @param url [String] Sitemap URL to monitor.
274
275
  #
275
- # @param exclude [Array<String>] URL path patterns to exclude.
276
+ # @param exclude [Array<String>] URL path patterns to exclude (max 50).
276
277
  #
277
- # @param include [Array<String>] URL path patterns to include.
278
+ # @param include [Array<String>] URL path patterns to include (max 50).
278
279
  #
279
280
  # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000).
280
281
  #
@@ -94,6 +94,7 @@ module ContextDev
94
94
 
95
95
  # @!attribute tags
96
96
  # User-defined tags for grouping and filtering monitors and their changes.
97
+ # Duplicates are removed.
97
98
  #
98
99
  # @return [Array<String>, nil]
99
100
  optional :tags, ContextDev::Internal::Type::ArrayOf[String]
@@ -146,7 +147,7 @@ module ContextDev
146
147
  #
147
148
  # @param next_run_at [Time, nil] When the next scheduled run is due.
148
149
  #
149
- # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes.
150
+ # @param tags [Array<String>] User-defined tags for grouping and filtering monitors and their changes. Duplica
150
151
  #
151
152
  # @param webhook [ContextDev::Models::MonitorUpdateResponse::Webhook, nil]
152
153
  #
@@ -348,13 +349,13 @@ module ContextDev
348
349
  required :url, String
349
350
 
350
351
  # @!attribute exclude
351
- # URL path patterns to exclude.
352
+ # URL path patterns to exclude (max 50).
352
353
  #
353
354
  # @return [Array<String>, nil]
354
355
  optional :exclude, ContextDev::Internal::Type::ArrayOf[String]
355
356
 
356
357
  # @!attribute include
357
- # URL path patterns to include.
358
+ # URL path patterns to include (max 50).
358
359
  #
359
360
  # @return [Array<String>, nil]
360
361
  optional :include, ContextDev::Internal::Type::ArrayOf[String]
@@ -374,9 +375,9 @@ module ContextDev
374
375
  #
375
376
  # @param url [String] Sitemap URL to monitor.
376
377
  #
377
- # @param exclude [Array<String>] URL path patterns to exclude.
378
+ # @param exclude [Array<String>] URL path patterns to exclude (max 50).
378
379
  #
379
- # @param include [Array<String>] URL path patterns to include.
380
+ # @param include [Array<String>] URL path patterns to include (max 50).
380
381
  #
381
382
  # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000).
382
383
  #
@@ -12,99 +12,349 @@ module ContextDev
12
12
  # @return [Pathname, StringIO, IO, String, ContextDev::FilePart]
13
13
  required :body, ContextDev::Internal::Type::FileInput
14
14
 
15
- # @!attribute base_url
16
- # Optional HTTP(S) source document URL used to resolve relative links and image
17
- # references. Relative references remain relative when omitted.
15
+ # @!attribute client
16
+ # Optional client identifier used for usage attribution.
18
17
  #
19
18
  # @return [String, nil]
20
- optional :base_url, String
19
+ optional :client, String
21
20
 
22
21
  # @!attribute extension
23
22
  # Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv,
24
23
  # md, py, rtf, jpg, png, or txt.
25
24
  #
26
- # @return [String, nil]
27
- optional :extension, String
28
-
29
- # @!attribute filename
30
- # Optional filename hint used to infer the extension when extension is omitted.
31
- #
32
- # @return [String, nil]
33
- optional :filename, String
25
+ # @return [Symbol, ContextDev::Models::ParseHandleParams::Extension, nil]
26
+ optional :extension, enum: -> { ContextDev::ParseHandleParams::Extension }
34
27
 
35
28
  # @!attribute include_images
36
29
  # Include image references in Markdown output
37
30
  #
38
- # @return [Boolean, nil]
39
- optional :include_images, ContextDev::Internal::Type::Boolean
31
+ # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeImages, nil]
32
+ optional :include_images, union: -> { ContextDev::ParseHandleParams::IncludeImages }
40
33
 
41
34
  # @!attribute include_links
42
35
  # Preserve hyperlinks in Markdown output
43
36
  #
44
- # @return [Boolean, nil]
45
- optional :include_links, ContextDev::Internal::Type::Boolean
37
+ # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeLinks, nil]
38
+ optional :include_links, union: -> { ContextDev::ParseHandleParams::IncludeLinks }
46
39
 
47
40
  # @!attribute ocr
48
41
  # When true for PDF inputs, detect and OCR images embedded in the selected pages,
49
42
  # inserting recognized text at each image's position in page reading order while
50
- # preserving the PDF text layer. pdfStart/pdfEnd limit the inclusive page range.
51
- # This is separate from automatic scanned-PDF OCR fallback.
43
+ # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range.
44
+ # When false, all OCR is disabled, including the automatic scanned-PDF fallback.
52
45
  #
53
- # @return [Boolean, nil]
54
- optional :ocr, ContextDev::Internal::Type::Boolean
46
+ # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr, nil]
47
+ optional :ocr, union: -> { ContextDev::ParseHandleParams::Ocr }
55
48
 
56
- # @!attribute pdf_end
57
- # Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
58
- # Must be greater than or equal to pdfStart when both are provided.
49
+ # @!attribute pdf
50
+ # PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.
59
51
  #
60
- # @return [Integer, nil]
61
- optional :pdf_end, Integer
62
-
63
- # @!attribute pdf_start
64
- # First 1-based PDF page to parse. When omitted, parsing starts at the first page.
65
- #
66
- # @return [Integer, nil]
67
- optional :pdf_start, Integer
52
+ # @return [ContextDev::Models::ParseHandleParams::Pdf, nil]
53
+ optional :pdf, -> { ContextDev::ParseHandleParams::Pdf }
68
54
 
69
55
  # @!attribute shorten_base64_images
70
56
  # Shorten base64-encoded image data in the Markdown output
71
57
  #
72
- # @return [Boolean, nil]
73
- optional :shorten_base64_images, ContextDev::Internal::Type::Boolean
58
+ # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::ShortenBase64Images, nil]
59
+ optional :shorten_base64_images, union: -> { ContextDev::ParseHandleParams::ShortenBase64Images }
60
+
61
+ # @!attribute tags
62
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
63
+ # recorded on the request's usage log and can be used to filter usage on the
64
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
65
+ #
66
+ # @return [Array<String>, nil]
67
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
74
68
 
75
69
  # @!attribute use_main_content_only
76
70
  # Extract only the main content from HTML-like inputs
77
71
  #
78
- # @return [Boolean, nil]
79
- optional :use_main_content_only, ContextDev::Internal::Type::Boolean
72
+ # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly, nil]
73
+ optional :use_main_content_only, union: -> { ContextDev::ParseHandleParams::UseMainContentOnly }
80
74
 
81
- # @!method initialize(body:, base_url: nil, extension: nil, filename: nil, include_images: nil, include_links: nil, ocr: nil, pdf_end: nil, pdf_start: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {})
75
+ # @!attribute zdr
76
+ # Set to enabled to bypass shared caches and omit request and response content
77
+ # from retained usage logs. Requires zero data retention to be enabled for your
78
+ # organization (contact support@context.dev), otherwise the request fails with
79
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
80
+ #
81
+ # @return [Symbol, ContextDev::Models::ParseHandleParams::Zdr, nil]
82
+ optional :zdr, enum: -> { ContextDev::ParseHandleParams::Zdr }
83
+
84
+ # @!method initialize(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: {})
82
85
  # Some parameter documentations has been truncated, see
83
86
  # {ContextDev::Models::ParseHandleParams} for more details.
84
87
  #
85
88
  # @param body [Pathname, StringIO, IO, String, ContextDev::FilePart]
86
89
  #
87
- # @param base_url [String] Optional HTTP(S) source document URL used to resolve relative links and image re
90
+ # @param client [String] Optional client identifier used for usage attribution.
88
91
  #
89
- # @param extension [String] Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md
92
+ # @param extension [Symbol, ContextDev::Models::ParseHandleParams::Extension] Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md
90
93
  #
91
- # @param filename [String] Optional filename hint used to infer the extension when extension is omitted.
94
+ # @param include_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeImages] Include image references in Markdown output
92
95
  #
93
- # @param include_images [Boolean] Include image references in Markdown output
96
+ # @param include_links [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeLinks] Preserve hyperlinks in Markdown output
94
97
  #
95
- # @param include_links [Boolean] Preserve hyperlinks in Markdown output
98
+ # @param ocr [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr] When true for PDF inputs, detect and OCR images embedded in the selected pages,
96
99
  #
97
- # @param ocr [Boolean] When true for PDF inputs, detect and OCR images embedded in the selected pages,
100
+ # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.
98
101
  #
99
- # @param pdf_end [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus
102
+ # @param shorten_base64_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::ShortenBase64Images] Shorten base64-encoded image data in the Markdown output
100
103
  #
101
- # @param pdf_start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page.
104
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
102
105
  #
103
- # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output
106
+ # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly] Extract only the main content from HTML-like inputs
104
107
  #
105
- # @param use_main_content_only [Boolean] Extract only the main content from HTML-like inputs
108
+ # @param zdr [Symbol, ContextDev::Models::ParseHandleParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
106
109
  #
107
110
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
111
+
112
+ # Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv,
113
+ # md, py, rtf, jpg, png, or txt.
114
+ module Extension
115
+ extend ContextDev::Internal::Type::Enum
116
+
117
+ TXT = :txt
118
+ TEXT = :text
119
+ MD = :md
120
+ MARKDOWN = :markdown
121
+ HTML = :html
122
+ HTM = :htm
123
+ XHTML = :xhtml
124
+ XML = :xml
125
+ RSS = :rss
126
+ ATOM = :atom
127
+ CSV = :csv
128
+ TSV = :tsv
129
+ YAML = :yaml
130
+ YML = :yml
131
+ PY = :py
132
+ JAVA = :java
133
+ JS = :js
134
+ JSX = :jsx
135
+ MJS = :mjs
136
+ CJS = :cjs
137
+ JSON = :json
138
+ JSONL = :jsonl
139
+ NDJSON = :ndjson
140
+ PHP = :php
141
+ SH = :sh
142
+ BASH = :bash
143
+ ZSH = :zsh
144
+ FISH = :fish
145
+ RB = :rb
146
+ TS = :ts
147
+ TSX = :tsx
148
+ RTF = :rtf
149
+ SRT = :srt
150
+ CSS = :css
151
+ SCSS = :scss
152
+ LESS = :less
153
+ STYL = :styl
154
+ SASS = :sass
155
+ SVG = :svg
156
+ PDF = :pdf
157
+ DOCX = :docx
158
+ DOC = :doc
159
+ XLSX = :xlsx
160
+ XLSM = :xlsm
161
+ XLSB = :xlsb
162
+ XLTX = :xltx
163
+ XLTM = :xltm
164
+ XLS = :xls
165
+ PPTX = :pptx
166
+ PPTM = :pptm
167
+ PPSX = :ppsx
168
+ PPSM = :ppsm
169
+ POTX = :potx
170
+ POTM = :potm
171
+ PPT = :ppt
172
+ PPS = :pps
173
+ POT = :pot
174
+ JPG = :jpg
175
+ JPEG = :jpeg
176
+ JPE = :jpe
177
+ PNG = :png
178
+ GIF = :gif
179
+ BMP = :bmp
180
+ TIFF = :tiff
181
+ TIF = :tif
182
+ WEBP = :webp
183
+ PPM = :ppm
184
+ PBM = :pbm
185
+ PGM = :pgm
186
+ PNM = :pnm
187
+
188
+ # @!method self.values
189
+ # @return [Array<Symbol>]
190
+ end
191
+
192
+ # Include image references in Markdown output
193
+ module IncludeImages
194
+ extend ContextDev::Internal::Type::Union
195
+
196
+ variant ContextDev::Internal::Type::Boolean
197
+
198
+ variant const: -> { ContextDev::Models::ParseHandleParams::IncludeImages::TRUE }
199
+
200
+ variant const: -> { ContextDev::Models::ParseHandleParams::IncludeImages::FALSE }
201
+
202
+ # @!method self.variants
203
+ # @return [Array(Boolean, Symbol)]
204
+
205
+ define_sorbet_constant!(:Variants) do
206
+ T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::IncludeImages::TaggedSymbol) }
207
+ end
208
+
209
+ # @!group
210
+
211
+ TRUE = :true
212
+ FALSE = :false
213
+
214
+ # @!endgroup
215
+ end
216
+
217
+ # Preserve hyperlinks in Markdown output
218
+ module IncludeLinks
219
+ extend ContextDev::Internal::Type::Union
220
+
221
+ variant ContextDev::Internal::Type::Boolean
222
+
223
+ variant const: -> { ContextDev::Models::ParseHandleParams::IncludeLinks::TRUE }
224
+
225
+ variant const: -> { ContextDev::Models::ParseHandleParams::IncludeLinks::FALSE }
226
+
227
+ # @!method self.variants
228
+ # @return [Array(Boolean, Symbol)]
229
+
230
+ define_sorbet_constant!(:Variants) do
231
+ T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::IncludeLinks::TaggedSymbol) }
232
+ end
233
+
234
+ # @!group
235
+
236
+ TRUE = :true
237
+ FALSE = :false
238
+
239
+ # @!endgroup
240
+ end
241
+
242
+ # When true for PDF inputs, detect and OCR images embedded in the selected pages,
243
+ # inserting recognized text at each image's position in page reading order while
244
+ # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range.
245
+ # When false, all OCR is disabled, including the automatic scanned-PDF fallback.
246
+ module Ocr
247
+ extend ContextDev::Internal::Type::Union
248
+
249
+ variant ContextDev::Internal::Type::Boolean
250
+
251
+ variant const: -> { ContextDev::Models::ParseHandleParams::Ocr::TRUE }
252
+
253
+ variant const: -> { ContextDev::Models::ParseHandleParams::Ocr::FALSE }
254
+
255
+ # @!method self.variants
256
+ # @return [Array(Boolean, Symbol)]
257
+
258
+ define_sorbet_constant!(:Variants) do
259
+ T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::TaggedSymbol) }
260
+ end
261
+
262
+ # @!group
263
+
264
+ TRUE = :true
265
+ FALSE = :false
266
+
267
+ # @!endgroup
268
+ end
269
+
270
+ class Pdf < ContextDev::Internal::Type::BaseModel
271
+ # @!attribute end_
272
+ # Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
273
+ # Must be greater than or equal to start when both are provided.
274
+ #
275
+ # @return [Integer, nil]
276
+ optional :end_, Integer, api_name: :end
277
+
278
+ # @!attribute start
279
+ # First 1-based PDF page to parse. When omitted, parsing starts at the first page.
280
+ #
281
+ # @return [Integer, nil]
282
+ optional :start, Integer
283
+
284
+ # @!method initialize(end_: nil, start: nil)
285
+ # Some parameter documentations has been truncated, see
286
+ # {ContextDev::Models::ParseHandleParams::Pdf} for more details.
287
+ #
288
+ # PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.
289
+ #
290
+ # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus
291
+ #
292
+ # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page.
293
+ end
294
+
295
+ # Shorten base64-encoded image data in the Markdown output
296
+ module ShortenBase64Images
297
+ extend ContextDev::Internal::Type::Union
298
+
299
+ variant ContextDev::Internal::Type::Boolean
300
+
301
+ variant const: -> { ContextDev::Models::ParseHandleParams::ShortenBase64Images::TRUE }
302
+
303
+ variant const: -> { ContextDev::Models::ParseHandleParams::ShortenBase64Images::FALSE }
304
+
305
+ # @!method self.variants
306
+ # @return [Array(Boolean, Symbol)]
307
+
308
+ define_sorbet_constant!(:Variants) do
309
+ T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::ShortenBase64Images::TaggedSymbol) }
310
+ end
311
+
312
+ # @!group
313
+
314
+ TRUE = :true
315
+ FALSE = :false
316
+
317
+ # @!endgroup
318
+ end
319
+
320
+ # Extract only the main content from HTML-like inputs
321
+ module UseMainContentOnly
322
+ extend ContextDev::Internal::Type::Union
323
+
324
+ variant ContextDev::Internal::Type::Boolean
325
+
326
+ variant const: -> { ContextDev::Models::ParseHandleParams::UseMainContentOnly::TRUE }
327
+
328
+ variant const: -> { ContextDev::Models::ParseHandleParams::UseMainContentOnly::FALSE }
329
+
330
+ # @!method self.variants
331
+ # @return [Array(Boolean, Symbol)]
332
+
333
+ define_sorbet_constant!(:Variants) do
334
+ T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::UseMainContentOnly::TaggedSymbol) }
335
+ end
336
+
337
+ # @!group
338
+
339
+ TRUE = :true
340
+ FALSE = :false
341
+
342
+ # @!endgroup
343
+ end
344
+
345
+ # Set to enabled to bypass shared caches and omit request and response content
346
+ # from retained usage logs. Requires zero data retention to be enabled for your
347
+ # organization (contact support@context.dev), otherwise the request fails with
348
+ # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
349
+ module Zdr
350
+ extend ContextDev::Internal::Type::Enum
351
+
352
+ ENABLED = :enabled
353
+ DISABLED = :disabled
354
+
355
+ # @!method self.values
356
+ # @return [Array<Symbol>]
357
+ end
108
358
  end
109
359
  end
110
360
  end
@@ -19,6 +19,12 @@ module ContextDev
19
19
  # @return [Symbol, ContextDev::Models::UtilityPrefetchParams::Type]
20
20
  required :type, enum: -> { ContextDev::UtilityPrefetchParams::Type }
21
21
 
22
+ # @!attribute tags
23
+ # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
24
+ #
25
+ # @return [Array<String>, nil]
26
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
27
+
22
28
  # @!attribute timeout_ms
23
29
  # Optional timeout in milliseconds for the request. If the request takes longer
24
30
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -27,7 +33,7 @@ module ContextDev
27
33
  # @return [Integer, nil]
28
34
  optional :timeout_ms, Integer, api_name: :timeoutMS
29
35
 
30
- # @!method initialize(identifier:, type:, timeout_ms: nil, request_options: {})
36
+ # @!method initialize(identifier:, type:, tags: nil, timeout_ms: nil, request_options: {})
31
37
  # Some parameter documentations has been truncated, see
32
38
  # {ContextDev::Models::UtilityPrefetchParams} for more details.
33
39
  #
@@ -35,6 +41,8 @@ module ContextDev
35
41
  #
36
42
  # @param type [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] What to prefetch. Currently only 'brand' is supported.
37
43
  #
44
+ # @param tags [Array<String>] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
45
+ #
38
46
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
39
47
  #
40
48
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
@@ -20,6 +20,14 @@ module ContextDev
20
20
  # @return [Integer, nil]
21
21
  optional :num_competitors, Integer
22
22
 
23
+ # @!attribute tags
24
+ # Optional comma-separated caller-defined tags for tracking this request. Tags are
25
+ # recorded on the request's usage log and can be used to filter usage on the
26
+ # dashboard usage page. Up to 20 tags, each 1-50 characters.
27
+ #
28
+ # @return [Array<String>, nil]
29
+ optional :tags, ContextDev::Internal::Type::ArrayOf[String]
30
+
23
31
  # @!attribute timeout_ms
24
32
  # Optional timeout in milliseconds for the request. If the request takes longer
25
33
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -28,7 +36,7 @@ module ContextDev
28
36
  # @return [Integer, nil]
29
37
  optional :timeout_ms, Integer
30
38
 
31
- # @!method initialize(domain:, num_competitors: nil, timeout_ms: nil, request_options: {})
39
+ # @!method initialize(domain:, num_competitors: nil, tags: nil, timeout_ms: nil, request_options: {})
32
40
  # Some parameter documentations has been truncated, see
33
41
  # {ContextDev::Models::WebExtractCompetitorsParams} for more details.
34
42
  #
@@ -36,6 +44,8 @@ module ContextDev
36
44
  #
37
45
  # @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5.
38
46
  #
47
+ # @param tags [Array<String>] Optional comma-separated caller-defined tags for tracking this request. Tags are
48
+ #
39
49
  # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
40
50
  #
41
51
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]