context.dev 2.17.1 → 2.18.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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +1 -1
  4. data/lib/context_dev/models/ai_extract_product_params.rb +28 -1
  5. data/lib/context_dev/models/ai_extract_product_response.rb +51 -1
  6. data/lib/context_dev/models/ai_extract_products_response.rb +51 -1
  7. data/lib/context_dev/models/industry_retrieve_naics_params.rb +28 -1
  8. data/lib/context_dev/models/industry_retrieve_sic_params.rb +28 -1
  9. data/lib/context_dev/models/parse_handle_params.rb +8 -6
  10. data/lib/context_dev/models/person_enrich_params.rb +28 -1
  11. data/lib/context_dev/models/web_answers_params.rb +28 -1
  12. data/lib/context_dev/models/web_extract_competitors_params.rb +28 -1
  13. data/lib/context_dev/models/web_extract_fonts_params.rb +2 -2
  14. data/lib/context_dev/models/web_extract_params.rb +28 -1
  15. data/lib/context_dev/models/web_extract_styleguide_params.rb +30 -3
  16. data/lib/context_dev/models/web_screenshot_params.rb +10 -8
  17. data/lib/context_dev/models/web_search_params.rb +30 -3
  18. data/lib/context_dev/models/web_web_scrape_bytes_params.rb +8 -6
  19. data/lib/context_dev/models/web_web_scrape_html_params.rb +188 -9
  20. data/lib/context_dev/models/web_web_scrape_html_response.rb +41 -1
  21. data/lib/context_dev/models/web_web_scrape_images_params.rb +31 -4
  22. data/lib/context_dev/models/web_web_scrape_md_params.rb +10 -8
  23. data/lib/context_dev/models/web_web_scrape_screenshot_params.rb +471 -0
  24. data/lib/context_dev/models/web_web_scrape_screenshot_response.rb +169 -0
  25. data/lib/context_dev/models/web_web_scrape_sitemap_params.rb +8 -6
  26. data/lib/context_dev/models.rb +2 -0
  27. data/lib/context_dev/resources/ai.rb +3 -1
  28. data/lib/context_dev/resources/industry.rb +6 -2
  29. data/lib/context_dev/resources/people.rb +3 -1
  30. data/lib/context_dev/resources/web.rb +96 -13
  31. data/lib/context_dev/version.rb +1 -1
  32. data/lib/context_dev.rb +2 -0
  33. data/rbi/context_dev/models/ai_extract_product_params.rbi +54 -0
  34. data/rbi/context_dev/models/ai_extract_product_response.rbi +98 -3
  35. data/rbi/context_dev/models/ai_extract_products_response.rbi +98 -3
  36. data/rbi/context_dev/models/industry_retrieve_naics_params.rbi +59 -0
  37. data/rbi/context_dev/models/industry_retrieve_sic_params.rbi +57 -0
  38. data/rbi/context_dev/models/parse_handle_params.rbi +12 -9
  39. data/rbi/context_dev/models/person_enrich_params.rbi +45 -0
  40. data/rbi/context_dev/models/web_answers_params.rbi +45 -0
  41. data/rbi/context_dev/models/web_extract_competitors_params.rbi +59 -0
  42. data/rbi/context_dev/models/web_extract_fonts_params.rbi +3 -3
  43. data/rbi/context_dev/models/web_extract_params.rbi +45 -0
  44. data/rbi/context_dev/models/web_extract_styleguide_params.rbi +62 -3
  45. data/rbi/context_dev/models/web_screenshot_params.rbi +15 -12
  46. data/rbi/context_dev/models/web_search_params.rbi +48 -3
  47. data/rbi/context_dev/models/web_web_scrape_bytes_params.rbi +12 -9
  48. data/rbi/context_dev/models/web_web_scrape_html_params.rbi +485 -12
  49. data/rbi/context_dev/models/web_web_scrape_html_response.rbi +103 -0
  50. data/rbi/context_dev/models/web_web_scrape_images_params.rbi +62 -5
  51. data/rbi/context_dev/models/web_web_scrape_md_params.rbi +15 -12
  52. data/rbi/context_dev/models/web_web_scrape_screenshot_params.rbi +1580 -0
  53. data/rbi/context_dev/models/web_web_scrape_screenshot_response.rbi +332 -0
  54. data/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +12 -9
  55. data/rbi/context_dev/models.rbi +3 -0
  56. data/rbi/context_dev/resources/ai.rbi +7 -0
  57. data/rbi/context_dev/resources/industry.rbi +14 -0
  58. data/rbi/context_dev/resources/parse.rbi +4 -4
  59. data/rbi/context_dev/resources/people.rbi +7 -0
  60. data/rbi/context_dev/resources/web.rbi +173 -21
  61. data/sig/context_dev/models/ai_extract_product_params.rbs +21 -1
  62. data/sig/context_dev/models/ai_extract_product_response.rbs +44 -3
  63. data/sig/context_dev/models/ai_extract_products_response.rbs +44 -3
  64. data/sig/context_dev/models/industry_retrieve_naics_params.rbs +21 -1
  65. data/sig/context_dev/models/industry_retrieve_sic_params.rbs +21 -1
  66. data/sig/context_dev/models/person_enrich_params.rbs +21 -1
  67. data/sig/context_dev/models/web_answers_params.rbs +21 -1
  68. data/sig/context_dev/models/web_extract_competitors_params.rbs +21 -1
  69. data/sig/context_dev/models/web_extract_params.rbs +21 -1
  70. data/sig/context_dev/models/web_extract_styleguide_params.rbs +21 -1
  71. data/sig/context_dev/models/web_search_params.rbs +21 -1
  72. data/sig/context_dev/models/web_web_scrape_html_params.rbs +148 -0
  73. data/sig/context_dev/models/web_web_scrape_html_response.rbs +30 -0
  74. data/sig/context_dev/models/web_web_scrape_images_params.rbs +21 -1
  75. data/sig/context_dev/models/web_web_scrape_screenshot_params.rbs +619 -0
  76. data/sig/context_dev/models/web_web_scrape_screenshot_response.rbs +127 -0
  77. data/sig/context_dev/models.rbs +2 -0
  78. data/sig/context_dev/resources/ai.rbs +1 -0
  79. data/sig/context_dev/resources/industry.rbs +2 -0
  80. data/sig/context_dev/resources/people.rbs +1 -0
  81. data/sig/context_dev/resources/web.rbs +24 -0
  82. metadata +8 -2
@@ -125,9 +125,10 @@ module ContextDev
125
125
 
126
126
  # @!attribute zdr
127
127
  # Set to enabled to bypass shared caches and omit request and response content
128
- # from retained usage logs. Requires zero data retention to be enabled for your
129
- # organization (contact support@context.dev), otherwise the request fails with
130
- # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
128
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
129
+ # omitted. Requires zero data retention to be enabled for your organization
130
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
131
+ # Successful ZDR responses include X-Context-ZDR: true.
131
132
  #
132
133
  # @return [Symbol, ContextDev::Models::WebScreenshotParams::Zdr, nil]
133
134
  optional :zdr, enum: -> { ContextDev::WebScreenshotParams::Zdr }
@@ -440,7 +441,7 @@ module ContextDev
440
441
  # credits. "return-partial" returns usable results collected so far; if none are
441
442
  # available, the request still fails without charging credits. Partial results are
442
443
  # not cached as complete results. "return-partial" requires milliseconds of at
443
- # least 15000.
444
+ # least 5000.
444
445
  #
445
446
  # @return [Symbol, ContextDev::Models::WebScreenshotParams::TimeoutOpts::Behavior, nil]
446
447
  optional :behavior, enum: -> { ContextDev::WebScreenshotParams::TimeoutOpts::Behavior }
@@ -461,7 +462,7 @@ module ContextDev
461
462
  # credits. "return-partial" returns usable results collected so far; if none are
462
463
  # available, the request still fails without charging credits. Partial results are
463
464
  # not cached as complete results. "return-partial" requires milliseconds of at
464
- # least 15000.
465
+ # least 5000.
465
466
  #
466
467
  # @see ContextDev::Models::WebScreenshotParams::TimeoutOpts#behavior
467
468
  module Behavior
@@ -497,9 +498,10 @@ module ContextDev
497
498
  end
498
499
 
499
500
  # Set to enabled to bypass shared caches and omit request and response content
500
- # from retained usage logs. Requires zero data retention to be enabled for your
501
- # organization (contact support@context.dev), otherwise the request fails with
502
- # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
501
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
502
+ # omitted. Requires zero data retention to be enabled for your organization
503
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
504
+ # Successful ZDR responses include X-Context-ZDR: true.
503
505
  module Zdr
504
506
  extend ContextDev::Internal::Type::Enum
505
507
 
@@ -75,7 +75,17 @@ module ContextDev
75
75
  # @return [ContextDev::Models::WebSearchParams::TimeoutOpts, nil]
76
76
  optional :timeout_opts, -> { ContextDev::WebSearchParams::TimeoutOpts }, api_name: :timeoutOpts
77
77
 
78
- # @!method initialize(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, tags: nil, timeout_opts: nil, request_options: {})
78
+ # @!attribute zdr
79
+ # Set to enabled to bypass shared caches and omit request and response content
80
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
81
+ # omitted. Requires zero data retention to be enabled for your organization
82
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
83
+ # Successful ZDR responses include X-Context-ZDR: true.
84
+ #
85
+ # @return [Symbol, ContextDev::Models::WebSearchParams::Zdr, nil]
86
+ optional :zdr, enum: -> { ContextDev::WebSearchParams::Zdr }
87
+
88
+ # @!method initialize(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, tags: nil, timeout_opts: nil, zdr: nil, request_options: {})
79
89
  # Some parameter documentations has been truncated, see
80
90
  # {ContextDev::Models::WebSearchParams} for more details.
81
91
  #
@@ -99,6 +109,8 @@ module ContextDev
99
109
  #
100
110
  # @param timeout_opts [ContextDev::Models::WebSearchParams::TimeoutOpts] Optional request deadline and behavior on timeout. For GET requests, use timeout
101
111
  #
112
+ # @param zdr [Symbol, ContextDev::Models::WebSearchParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
113
+ #
102
114
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
103
115
 
104
116
  # Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific
@@ -503,7 +515,7 @@ module ContextDev
503
515
  # credits. "return-partial" returns usable results collected so far; if none are
504
516
  # available, the request still fails without charging credits. Partial results are
505
517
  # not cached as complete results. "return-partial" requires milliseconds of at
506
- # least 15000.
518
+ # least 5000.
507
519
  #
508
520
  # @return [Symbol, ContextDev::Models::WebSearchParams::MarkdownOptions::TimeoutOpts::Behavior, nil]
509
521
  optional :behavior, enum: -> { ContextDev::WebSearchParams::MarkdownOptions::TimeoutOpts::Behavior }
@@ -525,7 +537,7 @@ module ContextDev
525
537
  # credits. "return-partial" returns usable results collected so far; if none are
526
538
  # available, the request still fails without charging credits. Partial results are
527
539
  # not cached as complete results. "return-partial" requires milliseconds of at
528
- # least 15000.
540
+ # least 5000.
529
541
  #
530
542
  # @see ContextDev::Models::WebSearchParams::MarkdownOptions::TimeoutOpts#behavior
531
543
  module Behavior
@@ -584,6 +596,21 @@ module ContextDev
584
596
  # @return [Array<Symbol>]
585
597
  end
586
598
  end
599
+
600
+ # Set to enabled to bypass shared caches and omit request and response content
601
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
602
+ # omitted. Requires zero data retention to be enabled for your organization
603
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
604
+ # Successful ZDR responses include X-Context-ZDR: true.
605
+ module Zdr
606
+ extend ContextDev::Internal::Type::Enum
607
+
608
+ ENABLED = :enabled
609
+ DISABLED = :disabled
610
+
611
+ # @!method self.values
612
+ # @return [Array<Symbol>]
613
+ end
587
614
  end
588
615
  end
589
616
  end
@@ -47,9 +47,10 @@ module ContextDev
47
47
 
48
48
  # @!attribute zdr
49
49
  # Set to enabled to bypass shared caches and omit request and response content
50
- # from retained usage logs. Requires zero data retention to be enabled for your
51
- # organization (contact support@context.dev), otherwise the request fails with
52
- # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
50
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
51
+ # omitted. Requires zero data retention to be enabled for your organization
52
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
53
+ # Successful ZDR responses include X-Context-ZDR: true.
53
54
  #
54
55
  # @return [Symbol, ContextDev::Models::WebWebScrapeBytesParams::Zdr, nil]
55
56
  optional :zdr, enum: -> { ContextDev::WebWebScrapeBytesParams::Zdr }
@@ -327,9 +328,10 @@ module ContextDev
327
328
  end
328
329
 
329
330
  # Set to enabled to bypass shared caches and omit request and response content
330
- # from retained usage logs. Requires zero data retention to be enabled for your
331
- # organization (contact support@context.dev), otherwise the request fails with
332
- # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
331
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
332
+ # omitted. Requires zero data retention to be enabled for your organization
333
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
334
+ # Successful ZDR responses include X-Context-ZDR: true.
333
335
  module Zdr
334
336
  extend ContextDev::Internal::Type::Enum
335
337
 
@@ -38,6 +38,19 @@ module ContextDev
38
38
  # @return [Array<String>, nil]
39
39
  optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true
40
40
 
41
+ # @!attribute extract_rules
42
+ # Optional CSS extraction rules applied to the returned HTML after selector and
43
+ # main-content filtering. Use selector strings ("h1", "a@href") or objects with
44
+ # selector, type (item or list), and output (text, html, @attribute, or nested
45
+ # rules). Text whitespace is normalized; html includes the matched element;
46
+ # attributes are returned as written. Missing items are null and missing lists are
47
+ # empty. CSS only; XPath is not supported. Maximum: 100 fields across 5 levels.
48
+ # Send a JSON-encoded string in the extractRules query parameter.
49
+ #
50
+ # @return [Hash{Symbol=>String, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1}, nil]
51
+ optional :extract_rules,
52
+ -> { ContextDev::Internal::Type::HashOf[union: ContextDev::WebWebScrapeHTMLParams::ExtractRule] }
53
+
41
54
  # @!attribute headers
42
55
  # Optional outbound HTTP headers forwarded only to the target URL, sent as
43
56
  # deep-object query params such as headers[X-Custom]=value. When provided, caching
@@ -116,14 +129,15 @@ module ContextDev
116
129
 
117
130
  # @!attribute zdr
118
131
  # Set to enabled to bypass shared caches and omit request and response content
119
- # from retained usage logs. Requires zero data retention to be enabled for your
120
- # organization (contact support@context.dev), otherwise the request fails with
121
- # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
132
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
133
+ # omitted. Requires zero data retention to be enabled for your organization
134
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
135
+ # Successful ZDR responses include X-Context-ZDR: true.
122
136
  #
123
137
  # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr, nil]
124
138
  optional :zdr, enum: -> { ContextDev::WebWebScrapeHTMLParams::Zdr }
125
139
 
126
- # @!method initialize(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, tags: nil, timeout_opts: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
140
+ # @!method initialize(url:, actions: nil, country: nil, exclude_selectors: nil, extract_rules: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, tags: nil, timeout_opts: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {})
127
141
  # Some parameter documentations has been truncated, see
128
142
  # {ContextDev::Models::WebWebScrapeHTMLParams} for more details.
129
143
  #
@@ -135,6 +149,8 @@ module ContextDev
135
149
  #
136
150
  # @param exclude_selectors [Array<String>, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi
137
151
  #
152
+ # @param extract_rules [Hash{Symbol=>String, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1}] Optional CSS extraction rules applied to the returned HTML after selector and ma
153
+ #
138
154
  # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob
139
155
  #
140
156
  # @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML.
@@ -522,6 +538,168 @@ module ContextDev
522
538
  # @return [Array<Symbol>]
523
539
  end
524
540
 
541
+ module ExtractRule
542
+ extend ContextDev::Internal::Type::Union
543
+
544
+ variant String
545
+
546
+ variant -> { ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1 }
547
+
548
+ class UnionMember1 < ContextDev::Internal::Type::BaseModel
549
+ # @!attribute selector
550
+ #
551
+ # @return [String]
552
+ required :selector, String
553
+
554
+ # @!attribute output
555
+ #
556
+ # @return [Symbol, String, Hash{Symbol=>String, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1}, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output, nil]
557
+ optional :output, union: -> { ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output }
558
+
559
+ # @!attribute type
560
+ #
561
+ # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type, nil]
562
+ optional :type, enum: -> { ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type }
563
+
564
+ # @!method initialize(selector:, output: nil, type: nil)
565
+ # @param selector [String]
566
+ # @param output [Symbol, String, Hash{Symbol=>String, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1}, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output]
567
+ # @param type [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Type]
568
+
569
+ # @see ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1#output
570
+ module Output
571
+ extend ContextDev::Internal::Type::Union
572
+
573
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::TEXT }
574
+
575
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTML }
576
+
577
+ variant String
578
+
579
+ variant -> { ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRuleMap }
580
+
581
+ module HTMLExtractionRule
582
+ extend ContextDev::Internal::Type::Union
583
+
584
+ variant String
585
+
586
+ variant -> { ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1 }
587
+
588
+ class UnionMember1 < ContextDev::Internal::Type::BaseModel
589
+ # @!attribute selector
590
+ #
591
+ # @return [String]
592
+ required :selector, String
593
+
594
+ # @!attribute output
595
+ #
596
+ # @return [Symbol, String, Object, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output, nil]
597
+ optional :output,
598
+ union: -> { ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output }
599
+
600
+ # @!attribute type
601
+ #
602
+ # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type, nil]
603
+ optional :type,
604
+ enum: -> { ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type }
605
+
606
+ # @!method initialize(selector:, output: nil, type: nil)
607
+ # @param selector [String]
608
+ # @param output [Symbol, String, Object, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output]
609
+ # @param type [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Type]
610
+
611
+ # @see ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1#output
612
+ module Output
613
+ extend ContextDev::Internal::Type::Union
614
+
615
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::TEXT }
616
+
617
+ variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::HTML }
618
+
619
+ variant String
620
+
621
+ variant ContextDev::Internal::Type::Unknown
622
+
623
+ # @!method self.variants
624
+ # @return [Array(Symbol, String, Object)]
625
+
626
+ define_sorbet_constant!(:Variants) do
627
+ T.type_alias do
628
+ T.any(
629
+ ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1::Output::TaggedSymbol,
630
+ String,
631
+ T.anything
632
+ )
633
+ end
634
+ end
635
+
636
+ # @!group
637
+
638
+ TEXT = :text
639
+ HTML = :html
640
+
641
+ # @!endgroup
642
+ end
643
+
644
+ # @see ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1#type
645
+ module Type
646
+ extend ContextDev::Internal::Type::Enum
647
+
648
+ ITEM = :item
649
+ LIST = :list
650
+
651
+ # @!method self.values
652
+ # @return [Array<Symbol>]
653
+ end
654
+ end
655
+
656
+ # @!method self.variants
657
+ # @return [Array(String, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1)]
658
+ end
659
+
660
+ # @!method self.variants
661
+ # @return [Array(Symbol, String, Hash{Symbol=>String, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::UnionMember1})]
662
+
663
+ define_sorbet_constant!(:Variants) do
664
+ T.type_alias do
665
+ T.any(
666
+ ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::TaggedSymbol,
667
+ String,
668
+ T::Hash[Symbol, ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule::Variants]
669
+ )
670
+ end
671
+ end
672
+
673
+ # @!group
674
+
675
+ TEXT = :text
676
+ HTML = :html
677
+
678
+ # @!endgroup
679
+
680
+ # @type [ContextDev::Internal::Type::Converter]
681
+ HTMLExtractionRuleMap =
682
+ ContextDev::Internal::Type::HashOf[union: -> {
683
+ ContextDev::WebWebScrapeHTMLParams::ExtractRule::UnionMember1::Output::HTMLExtractionRule
684
+ }]
685
+ end
686
+
687
+ # @see ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1#type
688
+ module Type
689
+ extend ContextDev::Internal::Type::Enum
690
+
691
+ ITEM = :item
692
+ LIST = :list
693
+
694
+ # @!method self.values
695
+ # @return [Array<Symbol>]
696
+ end
697
+ end
698
+
699
+ # @!method self.variants
700
+ # @return [Array(String, ContextDev::Models::WebWebScrapeHTMLParams::ExtractRule::UnionMember1)]
701
+ end
702
+
525
703
  class Pdf < ContextDev::Internal::Type::BaseModel
526
704
  # @!attribute end_
527
705
  # Last 1-based PDF page to parse. When omitted, parsing ends at the last page.
@@ -580,7 +758,7 @@ module ContextDev
580
758
  # credits. "return-partial" returns usable results collected so far; if none are
581
759
  # available, the request still fails without charging credits. Partial results are
582
760
  # not cached as complete results. "return-partial" requires milliseconds of at
583
- # least 15000.
761
+ # least 5000.
584
762
  #
585
763
  # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::TimeoutOpts::Behavior, nil]
586
764
  optional :behavior, enum: -> { ContextDev::WebWebScrapeHTMLParams::TimeoutOpts::Behavior }
@@ -601,7 +779,7 @@ module ContextDev
601
779
  # credits. "return-partial" returns usable results collected so far; if none are
602
780
  # available, the request still fails without charging credits. Partial results are
603
781
  # not cached as complete results. "return-partial" requires milliseconds of at
604
- # least 15000.
782
+ # least 5000.
605
783
  #
606
784
  # @see ContextDev::Models::WebWebScrapeHTMLParams::TimeoutOpts#behavior
607
785
  module Behavior
@@ -616,9 +794,10 @@ module ContextDev
616
794
  end
617
795
 
618
796
  # Set to enabled to bypass shared caches and omit request and response content
619
- # from retained usage logs. Requires zero data retention to be enabled for your
620
- # organization (contact support@context.dev), otherwise the request fails with
621
- # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
797
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
798
+ # omitted. Requires zero data retention to be enabled for your organization
799
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
800
+ # Successful ZDR responses include X-Context-ZDR: true.
622
801
  module Zdr
623
802
  extend ContextDev::Internal::Type::Enum
624
803
 
@@ -81,13 +81,23 @@ module ContextDev
81
81
  # @return [Boolean, nil]
82
82
  optional :actions_html_stale, ContextDev::Internal::Type::Boolean, api_name: :actionsHtmlStale
83
83
 
84
+ # @!attribute extracted
85
+ # Present only when extractRules is supplied. Keys match the requested fields.
86
+ # Values are normalized text, raw attribute strings, outer HTML, nested objects,
87
+ # or lists. Missing items are null; lists with no matches are empty. Rules run on
88
+ # the returned HTML after filtering.
89
+ #
90
+ # @return [Hash{Symbol=>String, Object, Array<String, Object, nil>, nil}, nil]
91
+ optional :extracted,
92
+ -> { ContextDev::Internal::Type::HashOf[union: ContextDev::Models::WebWebScrapeHTMLResponse::Extracted, nil?: true] }
93
+
84
94
  # @!attribute key_metadata
85
95
  # Credit usage, included whenever a valid API key is provided.
86
96
  #
87
97
  # @return [ContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata, nil]
88
98
  optional :key_metadata, -> { ContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata }
89
99
 
90
- # @!method initialize(cache_metadata:, final_dom_state:, html:, metadata:, request_id:, success:, type:, url:, actions_applied: nil, actions_html_stale: nil, key_metadata: nil)
100
+ # @!method initialize(cache_metadata:, final_dom_state:, html:, metadata:, request_id:, success:, type:, url:, actions_applied: nil, actions_html_stale: nil, extracted: nil, key_metadata: nil)
91
101
  # Some parameter documentations has been truncated, see
92
102
  # {ContextDev::Models::WebWebScrapeHTMLResponse} for more details.
93
103
  #
@@ -111,6 +121,8 @@ module ContextDev
111
121
  #
112
122
  # @param actions_html_stale [Boolean] True when an action was applied but the returned content could not be refreshed
113
123
  #
124
+ # @param extracted [Hash{Symbol=>String, Object, Array<String, Object, nil>, nil}] Present only when extractRules is supplied. Keys match the requested fields. Val
125
+ #
114
126
  # @param key_metadata [ContextDev::Models::WebWebScrapeHTMLResponse::KeyMetadata] Credit usage, included whenever a valid API key is provided.
115
127
 
116
128
  # @see ContextDev::Models::WebWebScrapeHTMLResponse#cache_metadata
@@ -562,6 +574,34 @@ module ContextDev
562
574
  end
563
575
  end
564
576
 
577
+ module Extracted
578
+ extend ContextDev::Internal::Type::Union
579
+
580
+ variant String
581
+
582
+ variant ContextDev::Internal::Type::Unknown
583
+
584
+ variant -> { ContextDev::Models::WebWebScrapeHTMLResponse::Extracted::UnionMember2Array }
585
+
586
+ module UnionMember2
587
+ extend ContextDev::Internal::Type::Union
588
+
589
+ variant String
590
+
591
+ variant ContextDev::Internal::Type::Unknown
592
+
593
+ # @!method self.variants
594
+ # @return [Array(String, Object)]
595
+ end
596
+
597
+ # @!method self.variants
598
+ # @return [Array(String, Object, Array<String, Object, nil>)]
599
+
600
+ # @type [ContextDev::Internal::Type::Converter]
601
+ UnionMember2Array =
602
+ ContextDev::Internal::Type::ArrayOf[union: -> { ContextDev::Models::WebWebScrapeHTMLResponse::Extracted::UnionMember2 }, nil?: true]
603
+ end
604
+
565
605
  # @see ContextDev::Models::WebWebScrapeHTMLResponse#key_metadata
566
606
  class KeyMetadata < ContextDev::Internal::Type::BaseModel
567
607
  # @!attribute credits_consumed
@@ -80,7 +80,17 @@ module ContextDev
80
80
  # @return [Integer, nil]
81
81
  optional :wait_for_ms, Integer, nil?: true
82
82
 
83
- # @!method initialize(url:, actions: nil, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, wait_for_ms: nil, request_options: {})
83
+ # @!attribute zdr
84
+ # Set to enabled to bypass shared caches and omit request and response content
85
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
86
+ # omitted. Requires zero data retention to be enabled for your organization
87
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
88
+ # Successful ZDR responses include X-Context-ZDR: true.
89
+ #
90
+ # @return [Symbol, ContextDev::Models::WebWebScrapeImagesParams::Zdr, nil]
91
+ optional :zdr, enum: -> { ContextDev::WebWebScrapeImagesParams::Zdr }
92
+
93
+ # @!method initialize(url:, actions: nil, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_opts: nil, wait_for_ms: nil, zdr: nil, request_options: {})
84
94
  # Some parameter documentations has been truncated, see
85
95
  # {ContextDev::Models::WebWebScrapeImagesParams} for more details.
86
96
  #
@@ -102,6 +112,8 @@ module ContextDev
102
112
  #
103
113
  # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before collec
104
114
  #
115
+ # @param zdr [Symbol, ContextDev::Models::WebWebScrapeImagesParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro
116
+ #
105
117
  # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}]
106
118
 
107
119
  # Browser action discriminated by `do`. Each variant exposes only its applicable
@@ -262,7 +274,7 @@ module ContextDev
262
274
 
263
275
  # @!attribute hosted_url
264
276
  # Host materializable images on the Brand.dev CDN and return their URL and MIME
265
- # type.
277
+ # type. Ignored when zero data retention is enabled.
266
278
  #
267
279
  # @return [Boolean, nil]
268
280
  optional :hosted_url, ContextDev::Internal::Type::Boolean, api_name: :hostedUrl
@@ -307,7 +319,7 @@ module ContextDev
307
319
  # credits. "return-partial" returns usable results collected so far; if none are
308
320
  # available, the request still fails without charging credits. Partial results are
309
321
  # not cached as complete results. "return-partial" requires milliseconds of at
310
- # least 15000.
322
+ # least 5000.
311
323
  #
312
324
  # @return [Symbol, ContextDev::Models::WebWebScrapeImagesParams::TimeoutOpts::Behavior, nil]
313
325
  optional :behavior, enum: -> { ContextDev::WebWebScrapeImagesParams::TimeoutOpts::Behavior }
@@ -328,7 +340,7 @@ module ContextDev
328
340
  # credits. "return-partial" returns usable results collected so far; if none are
329
341
  # available, the request still fails without charging credits. Partial results are
330
342
  # not cached as complete results. "return-partial" requires milliseconds of at
331
- # least 15000.
343
+ # least 5000.
332
344
  #
333
345
  # @see ContextDev::Models::WebWebScrapeImagesParams::TimeoutOpts#behavior
334
346
  module Behavior
@@ -341,6 +353,21 @@ module ContextDev
341
353
  # @return [Array<Symbol>]
342
354
  end
343
355
  end
356
+
357
+ # Set to enabled to bypass shared caches and omit request and response content
358
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
359
+ # omitted. Requires zero data retention to be enabled for your organization
360
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
361
+ # Successful ZDR responses include X-Context-ZDR: true.
362
+ module Zdr
363
+ extend ContextDev::Internal::Type::Enum
364
+
365
+ ENABLED = :enabled
366
+ DISABLED = :disabled
367
+
368
+ # @!method self.values
369
+ # @return [Array<Symbol>]
370
+ end
344
371
  end
345
372
  end
346
373
  end
@@ -143,9 +143,10 @@ module ContextDev
143
143
 
144
144
  # @!attribute zdr
145
145
  # Set to enabled to bypass shared caches and omit request and response content
146
- # from retained usage logs. Requires zero data retention to be enabled for your
147
- # organization (contact support@context.dev), otherwise the request fails with
148
- # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
146
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
147
+ # omitted. Requires zero data retention to be enabled for your organization
148
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
149
+ # Successful ZDR responses include X-Context-ZDR: true.
149
150
  #
150
151
  # @return [Symbol, ContextDev::Models::WebWebScrapeMdParams::Zdr, nil]
151
152
  optional :zdr, enum: -> { ContextDev::WebWebScrapeMdParams::Zdr }
@@ -615,7 +616,7 @@ module ContextDev
615
616
  # credits. "return-partial" returns usable results collected so far; if none are
616
617
  # available, the request still fails without charging credits. Partial results are
617
618
  # not cached as complete results. "return-partial" requires milliseconds of at
618
- # least 15000.
619
+ # least 5000.
619
620
  #
620
621
  # @return [Symbol, ContextDev::Models::WebWebScrapeMdParams::TimeoutOpts::Behavior, nil]
621
622
  optional :behavior, enum: -> { ContextDev::WebWebScrapeMdParams::TimeoutOpts::Behavior }
@@ -636,7 +637,7 @@ module ContextDev
636
637
  # credits. "return-partial" returns usable results collected so far; if none are
637
638
  # available, the request still fails without charging credits. Partial results are
638
639
  # not cached as complete results. "return-partial" requires milliseconds of at
639
- # least 15000.
640
+ # least 5000.
640
641
  #
641
642
  # @see ContextDev::Models::WebWebScrapeMdParams::TimeoutOpts#behavior
642
643
  module Behavior
@@ -651,9 +652,10 @@ module ContextDev
651
652
  end
652
653
 
653
654
  # Set to enabled to bypass shared caches and omit request and response content
654
- # from retained usage logs. Requires zero data retention to be enabled for your
655
- # organization (contact support@context.dev), otherwise the request fails with
656
- # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.
655
+ # from retained usage logs. Asset uploads are skipped, so hosted image URLs are
656
+ # omitted. Requires zero data retention to be enabled for your organization
657
+ # (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED.
658
+ # Successful ZDR responses include X-Context-ZDR: true.
657
659
  module Zdr
658
660
  extend ContextDev::Internal::Type::Enum
659
661