From f5684a355f24bf6a80aa904f09087a899f2121aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 01:22:38 +0000 Subject: [PATCH 01/13] feat(api): api update --- .stats.yml | 4 +- .../models/ai_extract_product_params.rb | 12 ++- .../models/ai_extract_products_params.rb | 24 ++++- .../models/brand_retrieve_params.rb | 72 ++++++++++++-- .../brand_retrieve_simplified_params.rb | 12 ++- .../models/industry_retrieve_naics_params.rb | 12 ++- .../models/industry_retrieve_sic_params.rb | 12 ++- lib/context_dev/models/parse_handle_params.rb | 12 ++- .../models/utility_prefetch_params.rb | 12 ++- .../models/web_extract_competitors_params.rb | 12 ++- .../models/web_extract_fonts_params.rb | 12 ++- lib/context_dev/models/web_extract_params.rb | 12 ++- .../models/web_extract_styleguide_params.rb | 12 ++- .../models/web_screenshot_params.rb | 12 ++- lib/context_dev/models/web_search_params.rb | 12 ++- .../models/web_web_crawl_md_params.rb | 12 ++- .../models/web_web_scrape_html_params.rb | 12 ++- .../models/web_web_scrape_images_params.rb | 12 ++- .../models/web_web_scrape_md_params.rb | 12 ++- .../models/web_web_scrape_sitemap_params.rb | 12 ++- lib/context_dev/resources/ai.rb | 4 +- lib/context_dev/resources/brand.rb | 4 +- lib/context_dev/resources/industry.rb | 8 +- lib/context_dev/resources/parse.rb | 4 +- lib/context_dev/resources/utility.rb | 4 +- lib/context_dev/resources/web.rb | 44 ++++++--- .../models/ai_extract_product_params.rbi | 15 +++ .../models/ai_extract_products_params.rbi | 30 ++++++ .../models/brand_retrieve_params.rbi | 96 ++++++++++++++++++- .../brand_retrieve_simplified_params.rbi | 15 +++ .../models/industry_retrieve_naics_params.rbi | 15 +++ .../models/industry_retrieve_sic_params.rbi | 15 +++ .../models/parse_handle_params.rbi | 15 +++ .../models/utility_prefetch_params.rbi | 15 +++ .../models/web_extract_competitors_params.rbi | 15 +++ .../models/web_extract_fonts_params.rbi | 15 +++ rbi/context_dev/models/web_extract_params.rbi | 15 +++ .../models/web_extract_styleguide_params.rbi | 15 +++ .../models/web_screenshot_params.rbi | 15 +++ rbi/context_dev/models/web_search_params.rbi | 15 +++ .../models/web_web_crawl_md_params.rbi | 15 +++ .../models/web_web_scrape_html_params.rbi | 15 +++ .../models/web_web_scrape_images_params.rbi | 15 +++ .../models/web_web_scrape_md_params.rbi | 15 +++ .../models/web_web_scrape_sitemap_params.rbi | 15 +++ rbi/context_dev/resources/ai.rbi | 5 + rbi/context_dev/resources/brand.rbi | 5 + rbi/context_dev/resources/industry.rbi | 10 ++ rbi/context_dev/resources/parse.rbi | 5 + rbi/context_dev/resources/utility.rbi | 5 + rbi/context_dev/resources/web.rbi | 55 +++++++++++ .../models/ai_extract_product_params.rbs | 13 ++- .../models/ai_extract_products_params.rbs | 14 +++ .../models/brand_retrieve_params.rbs | 48 +++++++++- .../brand_retrieve_simplified_params.rbs | 13 ++- .../models/industry_retrieve_naics_params.rbs | 7 ++ .../models/industry_retrieve_sic_params.rbs | 7 ++ .../models/parse_handle_params.rbs | 7 ++ .../models/utility_prefetch_params.rbs | 7 ++ .../models/web_extract_competitors_params.rbs | 13 ++- .../models/web_extract_fonts_params.rbs | 7 ++ sig/context_dev/models/web_extract_params.rbs | 7 ++ .../models/web_extract_styleguide_params.rbs | 7 ++ .../models/web_screenshot_params.rbs | 7 ++ sig/context_dev/models/web_search_params.rbs | 7 ++ .../models/web_web_crawl_md_params.rbs | 7 ++ .../models/web_web_scrape_html_params.rbs | 7 ++ .../models/web_web_scrape_images_params.rbs | 7 ++ .../models/web_web_scrape_md_params.rbs | 7 ++ .../models/web_web_scrape_sitemap_params.rbs | 7 ++ sig/context_dev/resources/ai.rbs | 1 + sig/context_dev/resources/brand.rbs | 1 + sig/context_dev/resources/industry.rbs | 2 + sig/context_dev/resources/parse.rbs | 1 + sig/context_dev/resources/utility.rbs | 1 + sig/context_dev/resources/web.rbs | 11 +++ 76 files changed, 1005 insertions(+), 49 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7cfdbbab..8e4b5605 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-fb56935a194e69348fecd985f7cf8b249795b46af2fb32f6c5c8ef648cf10c15.yml -openapi_spec_hash: 7260a560474283b7ad6ac5d426058ac9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-98c2abed2e726f7e5006cd4ef2ce9a56e84470d1fead500f7f3d46ed47f5af8b.yml +openapi_spec_hash: 921fc4db282f59e416e3c95d14d534f2 config_hash: daabb160675d86b354711da1e77e5129 diff --git a/lib/context_dev/models/ai_extract_product_params.rb b/lib/context_dev/models/ai_extract_product_params.rb index 8baeb3cb..35c26782 100644 --- a/lib/context_dev/models/ai_extract_product_params.rb +++ b/lib/context_dev/models/ai_extract_product_params.rb @@ -21,6 +21,14 @@ class AIExtractProductParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_age_ms, Integer, api_name: :maxAgeMs + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -29,7 +37,7 @@ class AIExtractProductParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(url:, max_age_ms: nil, timeout_ms: nil, request_options: {}) + # @!method initialize(url:, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::AIExtractProductParams} for more details. # @@ -37,6 +45,8 @@ class AIExtractProductParams < ContextDev::Internal::Type::BaseModel # # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/ai_extract_products_params.rb b/lib/context_dev/models/ai_extract_products_params.rb index 592a101a..3b45ca88 100644 --- a/lib/context_dev/models/ai_extract_products_params.rb +++ b/lib/context_dev/models/ai_extract_products_params.rb @@ -44,6 +44,14 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_products, Integer, api_name: :maxProducts + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -52,7 +60,7 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(domain:, max_age_ms: nil, max_products: nil, timeout_ms: nil) + # @!method initialize(domain:, max_age_ms: nil, max_products: nil, tags: nil, timeout_ms: nil) # Some parameter documentations has been truncated, see # {ContextDev::Models::AIExtractProductsParams::Body::ByDomain} for more details. # @@ -62,6 +70,8 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # # @param max_products [Integer] Maximum number of products to extract. # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th end @@ -87,6 +97,14 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_products, Integer, api_name: :maxProducts + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -95,7 +113,7 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(direct_url:, max_age_ms: nil, max_products: nil, timeout_ms: nil) + # @!method initialize(direct_url:, max_age_ms: nil, max_products: nil, tags: nil, timeout_ms: nil) # Some parameter documentations has been truncated, see # {ContextDev::Models::AIExtractProductsParams::Body::ByDirectURL} for more # details. @@ -106,6 +124,8 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # # @param max_products [Integer] Maximum number of products to extract. # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th end diff --git a/lib/context_dev/models/brand_retrieve_params.rb b/lib/context_dev/models/brand_retrieve_params.rb index fc3b3815..24f54f4b 100644 --- a/lib/context_dev/models/brand_retrieve_params.rb +++ b/lib/context_dev/models/brand_retrieve_params.rb @@ -77,6 +77,14 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -85,7 +93,7 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(domain:, force_language: nil, max_age_ms: nil, max_speed: nil, timeout_ms: nil, type: :by_domain) + # @!method initialize(domain:, force_language: nil, max_age_ms: nil, max_speed: nil, tags: nil, timeout_ms: nil, type: :by_domain) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveParams::Body::ByDomain} for more details. # @@ -99,6 +107,8 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param type [Symbol, :by_domain] Discriminator for domain-based brand retrieval. @@ -275,6 +285,14 @@ class ByName < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -283,7 +301,7 @@ class ByName < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(name:, country_gl: nil, force_language: nil, max_age_ms: nil, max_speed: nil, timeout_ms: nil, type: :by_name) + # @!method initialize(name:, country_gl: nil, force_language: nil, max_age_ms: nil, max_speed: nil, tags: nil, timeout_ms: nil, type: :by_name) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveParams::Body::ByName} for more details. # @@ -300,6 +318,8 @@ class ByName < ContextDev::Internal::Type::BaseModel # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param type [Symbol, :by_name] Discriminator for name-based brand retrieval. @@ -469,6 +489,14 @@ class ByEmail < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -477,7 +505,7 @@ class ByEmail < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(email:, force_language: nil, max_age_ms: nil, max_speed: nil, timeout_ms: nil, type: :by_email) + # @!method initialize(email:, force_language: nil, max_age_ms: nil, max_speed: nil, tags: nil, timeout_ms: nil, type: :by_email) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveParams::Body::ByEmail} for more details. # @@ -493,6 +521,8 @@ class ByEmail < ContextDev::Internal::Type::BaseModel # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param type [Symbol, :by_email] Discriminator for email-based brand retrieval. @@ -662,6 +692,14 @@ class ByTicker < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute ticker_exchange # Optional stock exchange for the ticker. Defaults to NASDAQ if not specified. # @@ -676,7 +714,7 @@ class ByTicker < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(ticker:, force_language: nil, max_age_ms: nil, max_speed: nil, ticker_exchange: nil, timeout_ms: nil, type: :by_ticker) + # @!method initialize(ticker:, force_language: nil, max_age_ms: nil, max_speed: nil, tags: nil, ticker_exchange: nil, timeout_ms: nil, type: :by_ticker) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveParams::Body::ByTicker} for more details. # @@ -691,6 +729,8 @@ class ByTicker < ContextDev::Internal::Type::BaseModel # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param ticker_exchange [String] Optional stock exchange for the ticker. Defaults to NASDAQ if not specified. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th @@ -842,6 +882,14 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # @return [Symbol, :by_direct_url] required :type, const: :by_direct_url + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -850,7 +898,7 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(direct_url:, timeout_ms: nil, type: :by_direct_url) + # @!method initialize(direct_url:, tags: nil, timeout_ms: nil, type: :by_direct_url) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveParams::Body::ByDirectURL} for more details. # @@ -862,6 +910,8 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # # @param direct_url [String] Full http(s) URL to fetch brand data from (e.g., 'https://stripe.com/enterprise' # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param type [Symbol, :by_direct_url] Discriminator for direct-URL-based brand retrieval. @@ -926,6 +976,14 @@ class ByTransaction < ContextDev::Internal::Type::BaseModel # @return [Float, nil] optional :phone, Float + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -934,7 +992,7 @@ class ByTransaction < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(transaction_info:, city: nil, country_gl: nil, force_language: nil, high_confidence_only: nil, max_speed: nil, mcc: nil, phone: nil, timeout_ms: nil, type: :by_transaction) + # @!method initialize(transaction_info:, city: nil, country_gl: nil, force_language: nil, high_confidence_only: nil, max_speed: nil, mcc: nil, phone: nil, tags: nil, timeout_ms: nil, type: :by_transaction) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveParams::Body::ByTransaction} for more details. # @@ -957,6 +1015,8 @@ class ByTransaction < ContextDev::Internal::Type::BaseModel # # @param phone [Float] Optional phone number from the transaction to help verify brand match. # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param type [Symbol, :by_transaction] Discriminator for transaction-based brand retrieval. diff --git a/lib/context_dev/models/brand_retrieve_simplified_params.rb b/lib/context_dev/models/brand_retrieve_simplified_params.rb index 102903d2..f1d92e7e 100644 --- a/lib/context_dev/models/brand_retrieve_simplified_params.rb +++ b/lib/context_dev/models/brand_retrieve_simplified_params.rb @@ -22,6 +22,14 @@ class BrandRetrieveSimplifiedParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_age_ms, Integer + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -30,7 +38,7 @@ class BrandRetrieveSimplifiedParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer - # @!method initialize(domain:, max_age_ms: nil, timeout_ms: nil, request_options: {}) + # @!method initialize(domain:, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveSimplifiedParams} for more details. # @@ -38,6 +46,8 @@ class BrandRetrieveSimplifiedParams < ContextDev::Internal::Type::BaseModel # # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/industry_retrieve_naics_params.rb b/lib/context_dev/models/industry_retrieve_naics_params.rb index 3738a90c..6069cc8e 100644 --- a/lib/context_dev/models/industry_retrieve_naics_params.rb +++ b/lib/context_dev/models/industry_retrieve_naics_params.rb @@ -28,6 +28,14 @@ class IndustryRetrieveNaicsParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :min_results, Integer + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -36,7 +44,7 @@ class IndustryRetrieveNaicsParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer - # @!method initialize(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {}) + # @!method initialize(input:, max_results: nil, min_results: nil, tags: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::IndustryRetrieveNaicsParams} for more details. # @@ -46,6 +54,8 @@ class IndustryRetrieveNaicsParams < ContextDev::Internal::Type::BaseModel # # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/industry_retrieve_sic_params.rb b/lib/context_dev/models/industry_retrieve_sic_params.rb index 0ea2f18f..5df2fec8 100644 --- a/lib/context_dev/models/industry_retrieve_sic_params.rb +++ b/lib/context_dev/models/industry_retrieve_sic_params.rb @@ -27,6 +27,14 @@ class IndustryRetrieveSicParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :min_results, Integer + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -43,7 +51,7 @@ class IndustryRetrieveSicParams < ContextDev::Internal::Type::BaseModel # @return [Symbol, ContextDev::Models::IndustryRetrieveSicParams::Type, nil] optional :type, enum: -> { ContextDev::IndustryRetrieveSicParams::Type } - # @!method initialize(input:, max_results: nil, min_results: nil, timeout_ms: nil, type: nil, request_options: {}) + # @!method initialize(input:, max_results: nil, min_results: nil, tags: nil, timeout_ms: nil, type: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::IndustryRetrieveSicParams} for more details. # @@ -53,6 +61,8 @@ class IndustryRetrieveSicParams < ContextDev::Internal::Type::BaseModel # # @param min_results [Integer] Minimum number of SIC codes to return. Must be at least 1. Defaults to 1. # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param type [Symbol, ContextDev::Models::IndustryRetrieveSicParams::Type] Which SIC dataset to classify against. `original_sic` uses the 1987 Standard Ind diff --git a/lib/context_dev/models/parse_handle_params.rb b/lib/context_dev/models/parse_handle_params.rb index 462218dc..b71161e3 100644 --- a/lib/context_dev/models/parse_handle_params.rb +++ b/lib/context_dev/models/parse_handle_params.rb @@ -56,13 +56,21 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :shorten_base64_images, ContextDev::Internal::Type::Boolean + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute use_main_content_only # Extract only the main content from HTML-like inputs # # @return [Boolean, nil] optional :use_main_content_only, ContextDev::Internal::Type::Boolean - # @!method initialize(body:, extension: nil, include_images: nil, include_links: nil, ocr: nil, pdf: nil, shorten_base64_images: nil, use_main_content_only: nil, request_options: {}) + # @!method initialize(body:, extension: nil, include_images: nil, include_links: nil, ocr: nil, pdf: nil, shorten_base64_images: nil, tags: nil, use_main_content_only: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::ParseHandleParams} for more details. # @@ -80,6 +88,8 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel # # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param use_main_content_only [Boolean] Extract only the main content from HTML-like inputs # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/utility_prefetch_params.rb b/lib/context_dev/models/utility_prefetch_params.rb index 86641066..6e1cbbf6 100644 --- a/lib/context_dev/models/utility_prefetch_params.rb +++ b/lib/context_dev/models/utility_prefetch_params.rb @@ -19,6 +19,14 @@ class UtilityPrefetchParams < ContextDev::Internal::Type::BaseModel # @return [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] required :type, enum: -> { ContextDev::UtilityPrefetchParams::Type } + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -27,7 +35,7 @@ class UtilityPrefetchParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(identifier:, type:, timeout_ms: nil, request_options: {}) + # @!method initialize(identifier:, type:, tags: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::UtilityPrefetchParams} for more details. # @@ -35,6 +43,8 @@ class UtilityPrefetchParams < ContextDev::Internal::Type::BaseModel # # @param type [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] What to prefetch. Currently only 'brand' is supported. # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/web_extract_competitors_params.rb b/lib/context_dev/models/web_extract_competitors_params.rb index 6a0939a9..ae7949db 100644 --- a/lib/context_dev/models/web_extract_competitors_params.rb +++ b/lib/context_dev/models/web_extract_competitors_params.rb @@ -20,6 +20,14 @@ class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :num_competitors, Integer + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -28,7 +36,7 @@ class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer - # @!method initialize(domain:, num_competitors: nil, timeout_ms: nil, request_options: {}) + # @!method initialize(domain:, num_competitors: nil, tags: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebExtractCompetitorsParams} for more details. # @@ -36,6 +44,8 @@ class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel # # @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5. # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/web_extract_fonts_params.rb b/lib/context_dev/models/web_extract_fonts_params.rb index 269a2949..cd5dce43 100644 --- a/lib/context_dev/models/web_extract_fonts_params.rb +++ b/lib/context_dev/models/web_extract_fonts_params.rb @@ -32,6 +32,14 @@ class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_age_ms, Integer + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -40,7 +48,7 @@ class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer - # @!method initialize(direct_url: nil, domain: nil, max_age_ms: nil, timeout_ms: nil, request_options: {}) + # @!method initialize(direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebExtractFontsParams} for more details. # @@ -50,6 +58,8 @@ class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel # # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/web_extract_params.rb b/lib/context_dev/models/web_extract_params.rb index 02fbfa30..f1ff45c8 100644 --- a/lib/context_dev/models/web_extract_params.rb +++ b/lib/context_dev/models/web_extract_params.rb @@ -84,6 +84,14 @@ class WebExtractParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :stop_after_ms, Integer, api_name: :stopAfterMs + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -99,7 +107,7 @@ class WebExtractParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer, api_name: :waitForMs - # @!method initialize(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, stop_after_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) + # @!method initialize(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebExtractParams} for more details. # @@ -125,6 +133,8 @@ class WebExtractParams < ContextDev::Internal::Type::BaseModel # # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (1 # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw diff --git a/lib/context_dev/models/web_extract_styleguide_params.rb b/lib/context_dev/models/web_extract_styleguide_params.rb index 42019b60..41cd8d56 100644 --- a/lib/context_dev/models/web_extract_styleguide_params.rb +++ b/lib/context_dev/models/web_extract_styleguide_params.rb @@ -40,6 +40,14 @@ class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_age_ms, Integer + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -48,7 +56,7 @@ class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer - # @!method initialize(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, timeout_ms: nil, request_options: {}) + # @!method initialize(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebExtractStyleguideParams} for more details. # @@ -60,6 +68,8 @@ class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel # # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/web_screenshot_params.rb b/lib/context_dev/models/web_screenshot_params.rb index f62c7569..b916d153 100644 --- a/lib/context_dev/models/web_screenshot_params.rb +++ b/lib/context_dev/models/web_screenshot_params.rb @@ -82,6 +82,14 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :scroll_offset, Integer + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -104,7 +112,7 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer - # @!method initialize(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {}) + # @!method initialize(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, tags: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebScreenshotParams} for more details. # @@ -126,6 +134,8 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # # @param scroll_offset [Integer] Optional vertical scroll offset in pixels for capturing a long page in viewport- # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. diff --git a/lib/context_dev/models/web_search_params.rb b/lib/context_dev/models/web_search_params.rb index 32960ea1..3e33d278 100644 --- a/lib/context_dev/models/web_search_params.rb +++ b/lib/context_dev/models/web_search_params.rb @@ -61,6 +61,14 @@ class WebSearchParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :query_fanout, ContextDev::Internal::Type::Boolean, api_name: :queryFanout + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -69,7 +77,7 @@ class WebSearchParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer, api_name: :timeoutMS - # @!method initialize(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, timeout_ms: nil, request_options: {}) + # @!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_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebSearchParams} for more details. # @@ -89,6 +97,8 @@ class WebSearchParams < ContextDev::Internal::Type::BaseModel # # @param query_fanout [Boolean] Expand the query into multiple parallel variants for broader recall. # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] diff --git a/lib/context_dev/models/web_web_crawl_md_params.rb b/lib/context_dev/models/web_web_crawl_md_params.rb index c1a62fc1..b422665e 100644 --- a/lib/context_dev/models/web_web_crawl_md_params.rb +++ b/lib/context_dev/models/web_web_crawl_md_params.rb @@ -115,6 +115,14 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :stop_after_ms, Integer, api_name: :stopAfterMs + # @!attribute tags + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -143,7 +151,7 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer, api_name: :waitForMs - # @!method initialize(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @!method initialize(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebCrawlMdParams} for more details. # @@ -177,6 +185,8 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. After each scrape, the crawler c # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped. diff --git a/lib/context_dev/models/web_web_scrape_html_params.rb b/lib/context_dev/models/web_web_scrape_html_params.rb index 3266d49d..2201eb4d 100644 --- a/lib/context_dev/models/web_web_scrape_html_params.rb +++ b/lib/context_dev/models/web_web_scrape_html_params.rb @@ -73,6 +73,14 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :settle_animations, ContextDev::Internal::Type::Boolean + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -95,7 +103,7 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer - # @!method initialize(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @!method initialize(url:, 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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeHTMLParams} for more details. # @@ -117,6 +125,8 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param use_main_content_only [Boolean] When true, return only the page's main content in the HTML response, excluding h diff --git a/lib/context_dev/models/web_web_scrape_images_params.rb b/lib/context_dev/models/web_web_scrape_images_params.rb index d8c6269e..77451c66 100644 --- a/lib/context_dev/models/web_web_scrape_images_params.rb +++ b/lib/context_dev/models/web_web_scrape_images_params.rb @@ -44,6 +44,14 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_age_ms, Integer + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -59,7 +67,7 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer - # @!method initialize(url:, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) + # @!method initialize(url:, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeImagesParams} for more details. # @@ -73,6 +81,8 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # # @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before collec diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index 15e70ac8..3a3404ba 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -92,6 +92,14 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :shorten_base64_images, ContextDev::Internal::Type::Boolean + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -114,7 +122,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer - # @!method initialize(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @!method initialize(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeMdParams} for more details. # @@ -142,6 +150,8 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, diff --git a/lib/context_dev/models/web_web_scrape_sitemap_params.rb b/lib/context_dev/models/web_web_scrape_sitemap_params.rb index c1f55578..0e9cacc2 100644 --- a/lib/context_dev/models/web_web_scrape_sitemap_params.rb +++ b/lib/context_dev/models/web_web_scrape_sitemap_params.rb @@ -28,6 +28,14 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_links, Integer + # @!attribute tags + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + # + # @return [Array, nil] + optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -43,7 +51,7 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [String, nil] optional :url_regex, String - # @!method initialize(domain:, headers: nil, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {}) + # @!method initialize(domain:, headers: nil, max_links: nil, tags: nil, timeout_ms: nil, url_regex: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} for more details. # @@ -53,6 +61,8 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur diff --git a/lib/context_dev/resources/ai.rb b/lib/context_dev/resources/ai.rb index 6fd8c181..f992823b 100644 --- a/lib/context_dev/resources/ai.rb +++ b/lib/context_dev/resources/ai.rb @@ -9,12 +9,14 @@ class AI # Given a single URL, determines if it is a product page and extracts the product # information. # - # @overload extract_product(url:, max_age_ms: nil, timeout_ms: nil, request_options: {}) + # @overload extract_product(url:, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) # # @param url [String] The product page URL to extract product data from. # # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/context_dev/resources/brand.rb b/lib/context_dev/resources/brand.rb index ff61691e..7c39d7d6 100644 --- a/lib/context_dev/resources/brand.rb +++ b/lib/context_dev/resources/brand.rb @@ -36,12 +36,14 @@ def retrieve(params) # information: domain, title, colors, logos, and backdrops. Optimized for faster # responses and reduced data transfer. # - # @overload retrieve_simplified(domain:, max_age_ms: nil, timeout_ms: nil, request_options: {}) + # @overload retrieve_simplified(domain:, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) # # @param domain [String] Domain name to retrieve simplified brand data for # # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/context_dev/resources/industry.rb b/lib/context_dev/resources/industry.rb index 614bc40d..be037aec 100644 --- a/lib/context_dev/resources/industry.rb +++ b/lib/context_dev/resources/industry.rb @@ -8,7 +8,7 @@ class Industry # # Classify any brand into 2022 NAICS industry codes from its domain or name. # - # @overload retrieve_naics(input:, max_results: nil, min_results: nil, timeout_ms: nil, request_options: {}) + # @overload retrieve_naics(input:, max_results: nil, min_results: nil, tags: nil, timeout_ms: nil, request_options: {}) # # @param input [String] Brand domain or title to retrieve NAICS code for. If a valid domain is provided, # @@ -16,6 +16,8 @@ class Industry # # @param min_results [Integer] Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -46,7 +48,7 @@ def retrieve_naics(params) # domain or name. Choose between the original SIC system (`original_sic`) or the # latest SIC list maintained by the SEC (`latest_sec`). # - # @overload retrieve_sic(input:, max_results: nil, min_results: nil, timeout_ms: nil, type: nil, request_options: {}) + # @overload retrieve_sic(input:, max_results: nil, min_results: nil, tags: nil, timeout_ms: nil, type: nil, request_options: {}) # # @param input [String] Brand domain or title to retrieve SIC code for. If a valid domain is provided, i # @@ -54,6 +56,8 @@ def retrieve_naics(params) # # @param min_results [Integer] Minimum number of SIC codes to return. Must be at least 1. Defaults to 1. # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param type [Symbol, ContextDev::Models::IndustryRetrieveSicParams::Type] Which SIC dataset to classify against. `original_sic` uses the 1987 Standard Ind diff --git a/lib/context_dev/resources/parse.rb b/lib/context_dev/resources/parse.rb index 6ffd13f7..9da45350 100644 --- a/lib/context_dev/resources/parse.rb +++ b/lib/context_dev/resources/parse.rb @@ -11,7 +11,7 @@ class Parse # (requires ocr=true), the entire call costs 5 credits; ocr=true requests where no # OCR ends up running still cost 1 credit. # - # @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: {}) + # @overload handle(body:, extension: nil, include_images: nil, include_links: nil, ocr: nil, pdf: nil, shorten_base64_images: nil, tags: nil, use_main_content_only: nil, request_options: {}) # # @param body [Pathname, StringIO, IO, String, ContextDev::FilePart] Body param # @@ -27,6 +27,8 @@ class Parse # # @param shorten_base64_images [Boolean] Query param: Shorten base64-encoded image data in the Markdown output # + # @param tags [Array] Query param: Optional comma-separated caller-defined tags for tracking this requ + # # @param use_main_content_only [Boolean] Query param: Extract only the main content from HTML-like inputs # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/context_dev/resources/utility.rb b/lib/context_dev/resources/utility.rb index dc3ae68a..46dd6b75 100644 --- a/lib/context_dev/resources/utility.rb +++ b/lib/context_dev/resources/utility.rb @@ -11,12 +11,14 @@ class Utility # one lookup key: a domain, or an email whose domain is extracted and validated # (free email providers and disposable email addresses are not allowed). # - # @overload prefetch(identifier:, type:, timeout_ms: nil, request_options: {}) + # @overload prefetch(identifier:, type:, tags: nil, timeout_ms: nil, request_options: {}) # # @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. # # @param type [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] What to prefetch. Currently only 'brand' is supported. # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index ceaf9e47..104a46a5 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -9,7 +9,7 @@ class Web # Crawl a website, use the provided JSON Schema and instructions to prioritize # relevant internal links, and extract structured data from the selected pages. # - # @overload extract(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, stop_after_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) + # @overload extract(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # # @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. TypeScript Zod users can pass a JSON S # @@ -33,6 +33,8 @@ class Web # # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (1 # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw @@ -59,12 +61,14 @@ def extract(params) # Analyze a company's landing page and web search evidence to return direct # competitors for the same product or market. # - # @overload extract_competitors(domain:, num_competitors: nil, timeout_ms: nil, request_options: {}) + # @overload extract_competitors(domain:, num_competitors: nil, tags: nil, timeout_ms: nil, request_options: {}) # # @param domain [String] Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted # # @param num_competitors [Integer] Exact number of direct competitors to return. Defaults to 5. # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -90,7 +94,7 @@ def extract_competitors(params) # Scrape font information from a website including font families, usage # statistics, fallbacks, and element/word counts. # - # @overload extract_fonts(direct_url: nil, domain: nil, max_age_ms: nil, timeout_ms: nil, request_options: {}) + # @overload extract_fonts(direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) # # @param direct_url [String] A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., # @@ -98,6 +102,8 @@ def extract_competitors(params) # # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -127,7 +133,7 @@ def extract_fonts(params = {}) # Extract a comprehensive design system from a website including colors, # typography, spacing, shadows, and UI components. # - # @overload extract_styleguide(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, timeout_ms: nil, request_options: {}) + # @overload extract_styleguide(color_scheme: nil, direct_url: nil, domain: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) # # @param color_scheme [Symbol, ContextDev::Models::WebExtractStyleguideParams::ColorScheme] Optional browser color scheme to emulate for websites that respond to prefers-co # @@ -137,6 +143,8 @@ def extract_fonts(params = {}) # # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -166,7 +174,7 @@ def extract_styleguide(params = {}) # # Capture a screenshot of a website. # - # @overload screenshot(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {}) + # @overload screenshot(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, tags: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {}) # # @param color_scheme [Symbol, ContextDev::Models::WebScreenshotParams::ColorScheme] Optional parameter to choose the site's visual theme in the screenshot. Use 'lig # @@ -186,6 +194,8 @@ def extract_styleguide(params = {}) # # @param scroll_offset [Integer] Optional vertical scroll offset in pixels for capturing a long page in viewport- # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. @@ -223,7 +233,7 @@ def screenshot(params = {}) # # Search the web and optionally scrape each result to Markdown in one round-trip. # - # @overload search(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, timeout_ms: nil, request_options: {}) + # @overload search(query:, country: nil, exclude_domains: nil, freshness: nil, include_domains: nil, markdown_options: nil, num_results: nil, query_fanout: nil, tags: nil, timeout_ms: nil, request_options: {}) # # @param query [String] Search query. Accepts natural language as well as Google-style search operators # @@ -241,6 +251,8 @@ def screenshot(params = {}) # # @param query_fanout [Boolean] Expand the query into multiple parallel variants for broader recall. # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -265,7 +277,7 @@ def search(params) # Performs a crawl starting from a given URL, extracts page content as Markdown, # and returns results for all crawled pages. # - # @overload web_crawl_md(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @overload web_crawl_md(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # # @param url [String] The starting URL for the crawl (must include http:// or https:// protocol) # @@ -297,6 +309,8 @@ def search(params) # # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. After each scrape, the crawler c # + # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped. @@ -326,7 +340,7 @@ def web_crawl_md(params) # # Scrapes the given URL and returns the raw HTML content of the page. # - # @overload web_scrape_html(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @overload web_scrape_html(url:, 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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # @@ -346,6 +360,8 @@ def web_crawl_md(params) # # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param use_main_content_only [Boolean] When true, return only the page's main content in the HTML response, excluding h @@ -386,7 +402,7 @@ def web_scrape_html(params) # embeds. The base request costs 1 credit. When enrichment is enabled, the entire # call costs 5 credits. # - # @overload web_scrape_images(url:, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) + # @overload web_scrape_images(url:, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # # @param url [String] Page URL to inspect. Must include http:// or https://. # @@ -398,6 +414,8 @@ def web_scrape_html(params) # # @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before collec @@ -443,7 +461,7 @@ def web_scrape_images(params) # | 429 | No | Per-minute rate limit exceeded; honor Retry-After | # | 500 | No | Internal error | # - # @overload web_scrape_md(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @overload web_scrape_md(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr # @@ -469,6 +487,8 @@ def web_scrape_images(params) # # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, @@ -509,7 +529,7 @@ def web_scrape_md(params) # # Crawl an entire website's sitemap and return all discovered page URLs. # - # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, timeout_ms: nil, url_regex: nil, request_options: {}) + # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, tags: nil, timeout_ms: nil, url_regex: nil, request_options: {}) # # @param domain [String] Domain to build a sitemap for # @@ -517,6 +537,8 @@ def web_scrape_md(params) # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur diff --git a/rbi/context_dev/models/ai_extract_product_params.rbi b/rbi/context_dev/models/ai_extract_product_params.rbi index ef6e788d..522492ce 100644 --- a/rbi/context_dev/models/ai_extract_product_params.rbi +++ b/rbi/context_dev/models/ai_extract_product_params.rbi @@ -27,6 +27,15 @@ module ContextDev sig { params(max_age_ms: Integer).void } attr_writer :max_age_ms + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -40,6 +49,7 @@ module ContextDev params( url: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -51,6 +61,10 @@ module ContextDev # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -64,6 +78,7 @@ module ContextDev { url: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/ai_extract_products_params.rbi b/rbi/context_dev/models/ai_extract_products_params.rbi index 3e81df18..6742af70 100644 --- a/rbi/context_dev/models/ai_extract_products_params.rbi +++ b/rbi/context_dev/models/ai_extract_products_params.rbi @@ -92,6 +92,15 @@ module ContextDev sig { params(max_products: Integer).void } attr_writer :max_products + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -106,6 +115,7 @@ module ContextDev domain: String, max_age_ms: Integer, max_products: Integer, + tags: T::Array[String], timeout_ms: Integer ).returns(T.attached_class) end @@ -118,6 +128,10 @@ module ContextDev max_age_ms: nil, # Maximum number of products to extract. max_products: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -131,6 +145,7 @@ module ContextDev domain: String, max_age_ms: Integer, max_products: Integer, + tags: T::Array[String], timeout_ms: Integer } ) @@ -169,6 +184,15 @@ module ContextDev sig { params(max_products: Integer).void } attr_writer :max_products + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -183,6 +207,7 @@ module ContextDev direct_url: String, max_age_ms: Integer, max_products: Integer, + tags: T::Array[String], timeout_ms: Integer ).returns(T.attached_class) end @@ -196,6 +221,10 @@ module ContextDev max_age_ms: nil, # Maximum number of products to extract. max_products: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -209,6 +238,7 @@ module ContextDev direct_url: String, max_age_ms: Integer, max_products: Integer, + tags: T::Array[String], timeout_ms: Integer } ) diff --git a/rbi/context_dev/models/brand_retrieve_params.rbi b/rbi/context_dev/models/brand_retrieve_params.rbi index 6dc2222f..8b4ddd60 100644 --- a/rbi/context_dev/models/brand_retrieve_params.rbi +++ b/rbi/context_dev/models/brand_retrieve_params.rbi @@ -135,6 +135,15 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -152,6 +161,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByDomain::ForceLanguage::OrSymbol, max_age_ms: Integer, max_speed: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, type: Symbol ).returns(T.attached_class) @@ -169,6 +179,10 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -187,6 +201,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByDomain::ForceLanguage::OrSymbol, max_age_ms: Integer, max_speed: T::Boolean, + tags: T::Array[String], timeout_ms: Integer } ) @@ -880,6 +895,15 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -899,6 +923,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByName::ForceLanguage::OrSymbol, max_age_ms: Integer, max_speed: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, type: Symbol ).returns(T.attached_class) @@ -919,6 +944,10 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -938,6 +967,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByName::ForceLanguage::OrSymbol, max_age_ms: Integer, max_speed: T::Boolean, + tags: T::Array[String], timeout_ms: Integer } ) @@ -1623,6 +1653,15 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -1642,6 +1681,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByEmail::ForceLanguage::OrSymbol, max_age_ms: Integer, max_speed: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, type: Symbol ).returns(T.attached_class) @@ -1659,6 +1699,10 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -1677,6 +1721,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByEmail::ForceLanguage::OrSymbol, max_age_ms: Integer, max_speed: T::Boolean, + tags: T::Array[String], timeout_ms: Integer } ) @@ -2362,6 +2407,15 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional stock exchange for the ticker. Defaults to NASDAQ if not specified. sig { returns(T.nilable(String)) } attr_reader :ticker_exchange @@ -2387,6 +2441,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByTicker::ForceLanguage::OrSymbol, max_age_ms: Integer, max_speed: T::Boolean, + tags: T::Array[String], ticker_exchange: String, timeout_ms: Integer, type: Symbol @@ -2405,6 +2460,10 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional stock exchange for the ticker. Defaults to NASDAQ if not specified. ticker_exchange: nil, # Optional timeout in milliseconds for the request. If the request takes longer @@ -2425,6 +2484,7 @@ module ContextDev ContextDev::BrandRetrieveParams::Body::ByTicker::ForceLanguage::OrSymbol, max_age_ms: Integer, max_speed: T::Boolean, + tags: T::Array[String], ticker_exchange: String, timeout_ms: Integer } @@ -3077,6 +3137,15 @@ module ContextDev sig { returns(Symbol) } attr_accessor :type + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -3094,6 +3163,7 @@ module ContextDev sig do params( direct_url: String, + tags: T::Array[String], timeout_ms: Integer, type: Symbol ).returns(T.attached_class) @@ -3103,6 +3173,10 @@ module ContextDev # 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire # internet. direct_url:, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -3114,7 +3188,12 @@ module ContextDev sig do override.returns( - { direct_url: String, type: Symbol, timeout_ms: Integer } + { + direct_url: String, + type: Symbol, + tags: T::Array[String], + timeout_ms: Integer + } ) end def to_hash @@ -3202,6 +3281,15 @@ module ContextDev sig { params(phone: Float).void } attr_writer :phone + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -3224,6 +3312,7 @@ module ContextDev max_speed: T::Boolean, mcc: Integer, phone: Float, + tags: T::Array[String], timeout_ms: Integer, type: Symbol ).returns(T.attached_class) @@ -3249,6 +3338,10 @@ module ContextDev mcc: nil, # Optional phone number from the transaction to help verify brand match. phone: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -3271,6 +3364,7 @@ module ContextDev max_speed: T::Boolean, mcc: Integer, phone: Float, + tags: T::Array[String], timeout_ms: Integer } ) diff --git a/rbi/context_dev/models/brand_retrieve_simplified_params.rbi b/rbi/context_dev/models/brand_retrieve_simplified_params.rbi index 25939714..a8c67937 100644 --- a/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +++ b/rbi/context_dev/models/brand_retrieve_simplified_params.rbi @@ -28,6 +28,15 @@ module ContextDev sig { params(max_age_ms: Integer).void } attr_writer :max_age_ms + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -41,6 +50,7 @@ module ContextDev params( domain: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -53,6 +63,10 @@ module ContextDev # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. max_age_ms: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -66,6 +80,7 @@ module ContextDev { domain: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/industry_retrieve_naics_params.rbi b/rbi/context_dev/models/industry_retrieve_naics_params.rbi index eaf0e28f..9918bd55 100644 --- a/rbi/context_dev/models/industry_retrieve_naics_params.rbi +++ b/rbi/context_dev/models/industry_retrieve_naics_params.rbi @@ -35,6 +35,15 @@ module ContextDev sig { params(min_results: Integer).void } attr_writer :min_results + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -49,6 +58,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -63,6 +73,10 @@ module ContextDev max_results: nil, # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. min_results: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -77,6 +91,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/industry_retrieve_sic_params.rbi b/rbi/context_dev/models/industry_retrieve_sic_params.rbi index 3f8c35b8..63b3d72e 100644 --- a/rbi/context_dev/models/industry_retrieve_sic_params.rbi +++ b/rbi/context_dev/models/industry_retrieve_sic_params.rbi @@ -34,6 +34,15 @@ module ContextDev sig { params(min_results: Integer).void } attr_writer :min_results + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -63,6 +72,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: T::Array[String], timeout_ms: Integer, type: ContextDev::IndustryRetrieveSicParams::Type::OrSymbol, request_options: ContextDev::RequestOptions::OrHash @@ -77,6 +87,10 @@ module ContextDev max_results: nil, # Minimum number of SIC codes to return. Must be at least 1. Defaults to 1. min_results: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -95,6 +109,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: T::Array[String], timeout_ms: Integer, type: ContextDev::IndustryRetrieveSicParams::Type::OrSymbol, request_options: ContextDev::RequestOptions diff --git a/rbi/context_dev/models/parse_handle_params.rbi b/rbi/context_dev/models/parse_handle_params.rbi index 23698860..0ab3c2bc 100644 --- a/rbi/context_dev/models/parse_handle_params.rbi +++ b/rbi/context_dev/models/parse_handle_params.rbi @@ -70,6 +70,15 @@ module ContextDev sig { params(shorten_base64_images: T::Boolean).void } attr_writer :shorten_base64_images + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Extract only the main content from HTML-like inputs sig { returns(T.nilable(T::Boolean)) } attr_reader :use_main_content_only @@ -86,6 +95,7 @@ module ContextDev ocr: T::Boolean, pdf: ContextDev::ParseHandleParams::Pdf::OrHash, shorten_base64_images: T::Boolean, + tags: T::Array[String], use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -112,6 +122,10 @@ module ContextDev pdf: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Extract only the main content from HTML-like inputs use_main_content_only: nil, request_options: {} @@ -128,6 +142,7 @@ module ContextDev ocr: T::Boolean, pdf: ContextDev::ParseHandleParams::Pdf, shorten_base64_images: T::Boolean, + tags: T::Array[String], use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/utility_prefetch_params.rbi b/rbi/context_dev/models/utility_prefetch_params.rbi index a8dcebf7..9586eada 100644 --- a/rbi/context_dev/models/utility_prefetch_params.rbi +++ b/rbi/context_dev/models/utility_prefetch_params.rbi @@ -29,6 +29,15 @@ module ContextDev sig { returns(ContextDev::UtilityPrefetchParams::Type::OrSymbol) } attr_accessor :type + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -46,6 +55,7 @@ module ContextDev ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier::OrHash ), type: ContextDev::UtilityPrefetchParams::Type::OrSymbol, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -55,6 +65,10 @@ module ContextDev identifier:, # What to prefetch. Currently only 'brand' is supported. type:, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -72,6 +86,7 @@ module ContextDev ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier ), type: ContextDev::UtilityPrefetchParams::Type::OrSymbol, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/web_extract_competitors_params.rbi b/rbi/context_dev/models/web_extract_competitors_params.rbi index 0e5d4a44..919c2e64 100644 --- a/rbi/context_dev/models/web_extract_competitors_params.rbi +++ b/rbi/context_dev/models/web_extract_competitors_params.rbi @@ -26,6 +26,15 @@ module ContextDev sig { params(num_competitors: Integer).void } attr_writer :num_competitors + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -39,6 +48,7 @@ module ContextDev params( domain: String, num_competitors: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -49,6 +59,10 @@ module ContextDev domain:, # Exact number of direct competitors to return. Defaults to 5. num_competitors: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -62,6 +76,7 @@ module ContextDev { domain: String, num_competitors: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/web_extract_fonts_params.rbi b/rbi/context_dev/models/web_extract_fonts_params.rbi index f606a601..027885da 100644 --- a/rbi/context_dev/models/web_extract_fonts_params.rbi +++ b/rbi/context_dev/models/web_extract_fonts_params.rbi @@ -42,6 +42,15 @@ module ContextDev sig { params(max_age_ms: Integer).void } attr_writer :max_age_ms + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -56,6 +65,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -74,6 +84,10 @@ module ContextDev # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. max_age_ms: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -88,6 +102,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/web_extract_params.rbi b/rbi/context_dev/models/web_extract_params.rbi index eb0a6fc7..07a13711 100644 --- a/rbi/context_dev/models/web_extract_params.rbi +++ b/rbi/context_dev/models/web_extract_params.rbi @@ -93,6 +93,15 @@ module ContextDev sig { params(stop_after_ms: Integer).void } attr_writer :stop_after_ms + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -123,6 +132,7 @@ module ContextDev max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf::OrHash, stop_after_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -162,6 +172,10 @@ module ContextDev # Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 # (110s). Default: 80000 (80s). stop_after_ms: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -187,6 +201,7 @@ module ContextDev max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf, stop_after_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, wait_for_ms: Integer, request_options: ContextDev::RequestOptions diff --git a/rbi/context_dev/models/web_extract_styleguide_params.rbi b/rbi/context_dev/models/web_extract_styleguide_params.rbi index 5279ad06..e3c0e544 100644 --- a/rbi/context_dev/models/web_extract_styleguide_params.rbi +++ b/rbi/context_dev/models/web_extract_styleguide_params.rbi @@ -62,6 +62,15 @@ module ContextDev sig { params(max_age_ms: Integer).void } attr_writer :max_age_ms + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -78,6 +87,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -100,6 +110,10 @@ module ContextDev # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. max_age_ms: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -116,6 +130,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/web_screenshot_params.rbi b/rbi/context_dev/models/web_screenshot_params.rbi index 8e58b4d7..0fd8f6c7 100644 --- a/rbi/context_dev/models/web_screenshot_params.rbi +++ b/rbi/context_dev/models/web_screenshot_params.rbi @@ -129,6 +129,15 @@ module ContextDev sig { params(scroll_offset: Integer).void } attr_writer :scroll_offset + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -169,6 +178,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::WebScreenshotParams::Page::OrSymbol, scroll_offset: Integer, + tags: T::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, wait_for_ms: Integer, @@ -215,6 +225,10 @@ module ContextDev # top to bottom). The final slice may be shorter than the viewport height. Takes # precedence over fullScreenshot. Max: 100000. scroll_offset: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -244,6 +258,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::WebScreenshotParams::Page::OrSymbol, scroll_offset: Integer, + tags: T::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, wait_for_ms: Integer, diff --git a/rbi/context_dev/models/web_search_params.rbi b/rbi/context_dev/models/web_search_params.rbi index 91089100..2bc1c7b9 100644 --- a/rbi/context_dev/models/web_search_params.rbi +++ b/rbi/context_dev/models/web_search_params.rbi @@ -78,6 +78,15 @@ module ContextDev sig { params(query_fanout: T::Boolean).void } attr_writer :query_fanout + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -98,6 +107,7 @@ module ContextDev ContextDev::WebSearchParams::MarkdownOptions::OrHash, num_results: Integer, query_fanout: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -123,6 +133,10 @@ module ContextDev num_results: nil, # Expand the query into multiple parallel variants for broader recall. query_fanout: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -142,6 +156,7 @@ module ContextDev markdown_options: ContextDev::WebSearchParams::MarkdownOptions, num_results: Integer, query_fanout: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/rbi/context_dev/models/web_web_crawl_md_params.rbi b/rbi/context_dev/models/web_web_crawl_md_params.rbi index 3539b987..f0d59fd3 100644 --- a/rbi/context_dev/models/web_web_crawl_md_params.rbi +++ b/rbi/context_dev/models/web_web_crawl_md_params.rbi @@ -135,6 +135,15 @@ module ContextDev sig { params(stop_after_ms: Integer).void } attr_writer :stop_after_ms + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -184,6 +193,7 @@ module ContextDev settle_animations: T::Boolean, shorten_base64_images: T::Boolean, stop_after_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, url_regex: String, use_main_content_only: T::Boolean, @@ -240,6 +250,10 @@ module ContextDev # instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 # (80s). stop_after_ms: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -274,6 +288,7 @@ module ContextDev settle_animations: T::Boolean, shorten_base64_images: T::Boolean, stop_after_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, url_regex: String, use_main_content_only: T::Boolean, diff --git a/rbi/context_dev/models/web_web_scrape_html_params.rbi b/rbi/context_dev/models/web_web_scrape_html_params.rbi index 97373bae..4db5a44e 100644 --- a/rbi/context_dev/models/web_web_scrape_html_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_html_params.rbi @@ -94,6 +94,15 @@ module ContextDev sig { params(settle_animations: T::Boolean).void } attr_writer :settle_animations + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -130,6 +139,7 @@ module ContextDev max_age_ms: Integer, pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash, settle_animations: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, use_main_content_only: T::Boolean, wait_for_ms: Integer, @@ -167,6 +177,10 @@ module ContextDev # extracting HTML. Defaults to false. This adds a bit of latency in exchange for # more stable output on animated pages. settle_animations: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -193,6 +207,7 @@ module ContextDev max_age_ms: Integer, pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, settle_animations: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, use_main_content_only: T::Boolean, wait_for_ms: Integer, diff --git a/rbi/context_dev/models/web_web_scrape_images_params.rbi b/rbi/context_dev/models/web_web_scrape_images_params.rbi index 7a00016e..d577fae2 100644 --- a/rbi/context_dev/models/web_web_scrape_images_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_images_params.rbi @@ -59,6 +59,15 @@ module ContextDev sig { params(max_age_ms: Integer).void } attr_writer :max_age_ms + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -83,6 +92,7 @@ module ContextDev enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash, headers: T::Hash[Symbol, String], max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -106,6 +116,10 @@ module ContextDev # Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). max_age_ms: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -125,6 +139,7 @@ module ContextDev enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, headers: T::Hash[Symbol, String], max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, wait_for_ms: Integer, request_options: ContextDev::RequestOptions diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index cf50f4e0..54af8cd8 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -111,6 +111,15 @@ module ContextDev sig { params(shorten_base64_images: T::Boolean).void } attr_writer :shorten_base64_images + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -150,6 +159,7 @@ module ContextDev pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash, settle_animations: T::Boolean, shorten_base64_images: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, use_main_content_only: T::Boolean, wait_for_ms: Integer, @@ -194,6 +204,10 @@ module ContextDev settle_animations: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -223,6 +237,7 @@ module ContextDev pdf: ContextDev::WebWebScrapeMdParams::Pdf, settle_animations: T::Boolean, shorten_base64_images: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, use_main_content_only: T::Boolean, wait_for_ms: Integer, diff --git a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi index 2e8daf89..c1066ed0 100644 --- a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi @@ -35,6 +35,15 @@ module ContextDev sig { params(max_links: Integer).void } attr_writer :max_links + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags + + sig { params(tags: T::Array[String]).void } + attr_writer :tags + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -57,6 +66,7 @@ module ContextDev domain: String, headers: T::Hash[Symbol, String], max_links: Integer, + tags: T::Array[String], timeout_ms: Integer, url_regex: String, request_options: ContextDev::RequestOptions::OrHash @@ -72,6 +82,10 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -89,6 +103,7 @@ module ContextDev domain: String, headers: T::Hash[Symbol, String], max_links: Integer, + tags: T::Array[String], timeout_ms: Integer, url_regex: String, request_options: ContextDev::RequestOptions diff --git a/rbi/context_dev/resources/ai.rbi b/rbi/context_dev/resources/ai.rbi index 94f6d182..424669bf 100644 --- a/rbi/context_dev/resources/ai.rbi +++ b/rbi/context_dev/resources/ai.rbi @@ -9,6 +9,7 @@ module ContextDev params( url: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::AIExtractProductResponse) @@ -20,6 +21,10 @@ module ContextDev # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). diff --git a/rbi/context_dev/resources/brand.rbi b/rbi/context_dev/resources/brand.rbi index d4e653e1..096138f4 100644 --- a/rbi/context_dev/resources/brand.rbi +++ b/rbi/context_dev/resources/brand.rbi @@ -36,6 +36,7 @@ module ContextDev params( domain: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::BrandRetrieveSimplifiedResponse) @@ -48,6 +49,10 @@ module ContextDev # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. max_age_ms: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). diff --git a/rbi/context_dev/resources/industry.rbi b/rbi/context_dev/resources/industry.rbi index cd30adbd..7ae8e362 100644 --- a/rbi/context_dev/resources/industry.rbi +++ b/rbi/context_dev/resources/industry.rbi @@ -9,6 +9,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::IndustryRetrieveNaicsResponse) @@ -23,6 +24,10 @@ module ContextDev max_results: nil, # Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1. min_results: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -39,6 +44,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: T::Array[String], timeout_ms: Integer, type: ContextDev::IndustryRetrieveSicParams::Type::OrSymbol, request_options: ContextDev::RequestOptions::OrHash @@ -53,6 +59,10 @@ module ContextDev max_results: nil, # Minimum number of SIC codes to return. Must be at least 1. Defaults to 1. min_results: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). diff --git a/rbi/context_dev/resources/parse.rbi b/rbi/context_dev/resources/parse.rbi index 983b26a0..383fa40c 100644 --- a/rbi/context_dev/resources/parse.rbi +++ b/rbi/context_dev/resources/parse.rbi @@ -16,6 +16,7 @@ module ContextDev ocr: T::Boolean, pdf: ContextDev::ParseHandleParams::Pdf::OrHash, shorten_base64_images: T::Boolean, + tags: T::Array[String], use_main_content_only: T::Boolean, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::ParseHandleResponse) @@ -43,6 +44,10 @@ module ContextDev pdf: nil, # Query param: Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, + # Query param: Optional comma-separated caller-defined tags for tracking this + # request. Tags are recorded on the request's usage log and can be used to filter + # usage on the dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Query param: Extract only the main content from HTML-like inputs use_main_content_only: nil, request_options: {} diff --git a/rbi/context_dev/resources/utility.rbi b/rbi/context_dev/resources/utility.rbi index f21a5ccb..a83323e1 100644 --- a/rbi/context_dev/resources/utility.rbi +++ b/rbi/context_dev/resources/utility.rbi @@ -15,6 +15,7 @@ module ContextDev ContextDev::UtilityPrefetchParams::Identifier::UtilityPrefetchEmailIdentifier::OrHash ), type: ContextDev::UtilityPrefetchParams::Type::OrSymbol, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::UtilityPrefetchResponse) @@ -24,6 +25,10 @@ module ContextDev identifier:, # What to prefetch. Currently only 'brand' is supported. type:, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index be31aac3..eaac16dc 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -18,6 +18,7 @@ module ContextDev max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf::OrHash, stop_after_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -57,6 +58,10 @@ module ContextDev # Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 # (110s). Default: 80000 (80s). stop_after_ms: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -74,6 +79,7 @@ module ContextDev params( domain: String, num_competitors: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebExtractCompetitorsResponse) @@ -84,6 +90,10 @@ module ContextDev domain:, # Exact number of direct competitors to return. Defaults to 5. num_competitors: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -99,6 +109,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebExtractFontsResponse) @@ -117,6 +128,10 @@ module ContextDev # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. max_age_ms: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -134,6 +149,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebExtractStyleguideResponse) @@ -156,6 +172,10 @@ module ContextDev # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. max_age_ms: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -178,6 +198,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::WebScreenshotParams::Page::OrSymbol, scroll_offset: Integer, + tags: T::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, wait_for_ms: Integer, @@ -224,6 +245,10 @@ module ContextDev # top to bottom). The final slice may be shorter than the viewport height. Takes # precedence over fullScreenshot. Max: 100000. scroll_offset: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -250,6 +275,7 @@ module ContextDev ContextDev::WebSearchParams::MarkdownOptions::OrHash, num_results: Integer, query_fanout: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebSearchResponse) @@ -275,6 +301,10 @@ module ContextDev num_results: nil, # Expand the query into multiple parallel variants for broader recall. query_fanout: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -302,6 +332,7 @@ module ContextDev settle_animations: T::Boolean, shorten_base64_images: T::Boolean, stop_after_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, url_regex: String, use_main_content_only: T::Boolean, @@ -358,6 +389,10 @@ module ContextDev # instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 # (80s). stop_after_ms: nil, + # Optional caller-defined tags for tracking this request. Tags are recorded on the + # request's usage log and can be used to filter usage on the dashboard usage page. + # Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -386,6 +421,7 @@ module ContextDev max_age_ms: Integer, pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash, settle_animations: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, use_main_content_only: T::Boolean, wait_for_ms: Integer, @@ -423,6 +459,10 @@ module ContextDev # extracting HTML. Defaults to false. This adds a bit of latency in exchange for # more stable output on animated pages. settle_animations: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -448,6 +488,7 @@ module ContextDev enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash, headers: T::Hash[Symbol, String], max_age_ms: Integer, + tags: T::Array[String], timeout_ms: Integer, wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -471,6 +512,10 @@ module ContextDev # Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). max_age_ms: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -512,6 +557,7 @@ module ContextDev pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash, settle_animations: T::Boolean, shorten_base64_images: T::Boolean, + tags: T::Array[String], timeout_ms: Integer, use_main_content_only: T::Boolean, wait_for_ms: Integer, @@ -556,6 +602,10 @@ module ContextDev settle_animations: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -576,6 +626,7 @@ module ContextDev domain: String, headers: T::Hash[Symbol, String], max_links: Integer, + tags: T::Array[String], timeout_ms: Integer, url_regex: String, request_options: ContextDev::RequestOptions::OrHash @@ -591,6 +642,10 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # Optional comma-separated caller-defined tags for tracking this request. Tags are + # recorded on the request's usage log and can be used to filter usage on the + # dashboard usage page. Up to 20 tags, each 1-50 characters. + tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). diff --git a/sig/context_dev/models/ai_extract_product_params.rbs b/sig/context_dev/models/ai_extract_product_params.rbs index 129edff6..198ef490 100644 --- a/sig/context_dev/models/ai_extract_product_params.rbs +++ b/sig/context_dev/models/ai_extract_product_params.rbs @@ -1,7 +1,12 @@ module ContextDev module Models type ai_extract_product_params = - { url: String, max_age_ms: Integer, timeout_ms: Integer } + { + url: String, + max_age_ms: Integer, + tags: ::Array[String], + timeout_ms: Integer + } & ContextDev::Internal::Type::request_parameters class AIExtractProductParams < ContextDev::Internal::Type::BaseModel @@ -14,6 +19,10 @@ module ContextDev def max_age_ms=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -21,6 +30,7 @@ module ContextDev def initialize: ( url: String, ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -28,6 +38,7 @@ module ContextDev def to_hash: -> { url: String, max_age_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/ai_extract_products_params.rbs b/sig/context_dev/models/ai_extract_products_params.rbs index db8ee3a7..94dd18b2 100644 --- a/sig/context_dev/models/ai_extract_products_params.rbs +++ b/sig/context_dev/models/ai_extract_products_params.rbs @@ -32,6 +32,7 @@ module ContextDev domain: String, max_age_ms: Integer, max_products: Integer, + tags: ::Array[String], timeout_ms: Integer } @@ -46,6 +47,10 @@ module ContextDev def max_products=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -54,6 +59,7 @@ module ContextDev domain: String, ?max_age_ms: Integer, ?max_products: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer ) -> void @@ -61,6 +67,7 @@ module ContextDev domain: String, max_age_ms: Integer, max_products: Integer, + tags: ::Array[String], timeout_ms: Integer } end @@ -70,6 +77,7 @@ module ContextDev direct_url: String, max_age_ms: Integer, max_products: Integer, + tags: ::Array[String], timeout_ms: Integer } @@ -84,6 +92,10 @@ module ContextDev def max_products=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -92,6 +104,7 @@ module ContextDev direct_url: String, ?max_age_ms: Integer, ?max_products: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer ) -> void @@ -99,6 +112,7 @@ module ContextDev direct_url: String, max_age_ms: Integer, max_products: Integer, + tags: ::Array[String], timeout_ms: Integer } end diff --git a/sig/context_dev/models/brand_retrieve_params.rbs b/sig/context_dev/models/brand_retrieve_params.rbs index 0316a417..c6f94fd5 100644 --- a/sig/context_dev/models/brand_retrieve_params.rbs +++ b/sig/context_dev/models/brand_retrieve_params.rbs @@ -38,6 +38,7 @@ module ContextDev force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language, max_age_ms: Integer, max_speed: bool, + tags: ::Array[String], timeout_ms: Integer } @@ -60,6 +61,10 @@ module ContextDev def max_speed=: (bool) -> bool + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -69,6 +74,7 @@ module ContextDev ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language, ?max_age_ms: Integer, ?max_speed: bool, + ?tags: ::Array[String], ?timeout_ms: Integer, ?type: :by_domain ) -> void @@ -79,6 +85,7 @@ module ContextDev force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language, max_age_ms: Integer, max_speed: bool, + tags: ::Array[String], timeout_ms: Integer } @@ -340,6 +347,7 @@ module ContextDev force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language, max_age_ms: Integer, max_speed: bool, + tags: ::Array[String], timeout_ms: Integer } @@ -366,6 +374,10 @@ module ContextDev def max_speed=: (bool) -> bool + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -376,6 +388,7 @@ module ContextDev ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language, ?max_age_ms: Integer, ?max_speed: bool, + ?tags: ::Array[String], ?timeout_ms: Integer, ?type: :by_name ) -> void @@ -387,6 +400,7 @@ module ContextDev force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language, max_age_ms: Integer, max_speed: bool, + tags: ::Array[String], timeout_ms: Integer } @@ -647,6 +661,7 @@ module ContextDev force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language, max_age_ms: Integer, max_speed: bool, + tags: ::Array[String], timeout_ms: Integer } @@ -669,6 +684,10 @@ module ContextDev def max_speed=: (bool) -> bool + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -678,6 +697,7 @@ module ContextDev ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language, ?max_age_ms: Integer, ?max_speed: bool, + ?tags: ::Array[String], ?timeout_ms: Integer, ?type: :by_email ) -> void @@ -688,6 +708,7 @@ module ContextDev force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language, max_age_ms: Integer, max_speed: bool, + tags: ::Array[String], timeout_ms: Integer } @@ -948,6 +969,7 @@ module ContextDev force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language, max_age_ms: Integer, max_speed: bool, + tags: ::Array[String], ticker_exchange: String, timeout_ms: Integer } @@ -971,6 +993,10 @@ module ContextDev def max_speed=: (bool) -> bool + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader ticker_exchange: String? def ticker_exchange=: (String) -> String @@ -984,6 +1010,7 @@ module ContextDev ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language, ?max_age_ms: Integer, ?max_speed: bool, + ?tags: ::Array[String], ?ticker_exchange: String, ?timeout_ms: Integer, ?type: :by_ticker @@ -995,6 +1022,7 @@ module ContextDev force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language, max_age_ms: Integer, max_speed: bool, + tags: ::Array[String], ticker_exchange: String, timeout_ms: Integer } @@ -1250,19 +1278,29 @@ module ContextDev end type by_direct_url = - { direct_url: String, type: :by_direct_url, timeout_ms: Integer } + { + direct_url: String, + type: :by_direct_url, + tags: ::Array[String], + timeout_ms: Integer + } class ByDirectURL < ContextDev::Internal::Type::BaseModel attr_accessor direct_url: String attr_accessor type: :by_direct_url + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer def initialize: ( direct_url: String, + ?tags: ::Array[String], ?timeout_ms: Integer, ?type: :by_direct_url ) -> void @@ -1270,6 +1308,7 @@ module ContextDev def to_hash: -> { direct_url: String, type: :by_direct_url, + tags: ::Array[String], timeout_ms: Integer } end @@ -1285,6 +1324,7 @@ module ContextDev max_speed: bool, mcc: Integer, phone: Float, + tags: ::Array[String], timeout_ms: Integer } @@ -1323,6 +1363,10 @@ module ContextDev def phone=: (Float) -> Float + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -1336,6 +1380,7 @@ module ContextDev ?max_speed: bool, ?mcc: Integer, ?phone: Float, + ?tags: ::Array[String], ?timeout_ms: Integer, ?type: :by_transaction ) -> void @@ -1350,6 +1395,7 @@ module ContextDev max_speed: bool, mcc: Integer, phone: Float, + tags: ::Array[String], timeout_ms: Integer } diff --git a/sig/context_dev/models/brand_retrieve_simplified_params.rbs b/sig/context_dev/models/brand_retrieve_simplified_params.rbs index a17bcabb..55cd5e37 100644 --- a/sig/context_dev/models/brand_retrieve_simplified_params.rbs +++ b/sig/context_dev/models/brand_retrieve_simplified_params.rbs @@ -1,7 +1,12 @@ module ContextDev module Models type brand_retrieve_simplified_params = - { domain: String, max_age_ms: Integer, timeout_ms: Integer } + { + domain: String, + max_age_ms: Integer, + tags: ::Array[String], + timeout_ms: Integer + } & ContextDev::Internal::Type::request_parameters class BrandRetrieveSimplifiedParams < ContextDev::Internal::Type::BaseModel @@ -14,6 +19,10 @@ module ContextDev def max_age_ms=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -21,6 +30,7 @@ module ContextDev def initialize: ( domain: String, ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -28,6 +38,7 @@ module ContextDev def to_hash: -> { domain: String, max_age_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/industry_retrieve_naics_params.rbs b/sig/context_dev/models/industry_retrieve_naics_params.rbs index 2d963c28..a8384433 100644 --- a/sig/context_dev/models/industry_retrieve_naics_params.rbs +++ b/sig/context_dev/models/industry_retrieve_naics_params.rbs @@ -5,6 +5,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: ::Array[String], timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -23,6 +24,10 @@ module ContextDev def min_results=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -31,6 +36,7 @@ module ContextDev input: String, ?max_results: Integer, ?min_results: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -39,6 +45,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/industry_retrieve_sic_params.rbs b/sig/context_dev/models/industry_retrieve_sic_params.rbs index 27129a68..f4140882 100644 --- a/sig/context_dev/models/industry_retrieve_sic_params.rbs +++ b/sig/context_dev/models/industry_retrieve_sic_params.rbs @@ -5,6 +5,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: ::Array[String], timeout_ms: Integer, type: ContextDev::Models::IndustryRetrieveSicParams::type_ } @@ -24,6 +25,10 @@ module ContextDev def min_results=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -38,6 +43,7 @@ module ContextDev input: String, ?max_results: Integer, ?min_results: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?type: ContextDev::Models::IndustryRetrieveSicParams::type_, ?request_options: ContextDev::request_opts @@ -47,6 +53,7 @@ module ContextDev input: String, max_results: Integer, min_results: Integer, + tags: ::Array[String], timeout_ms: Integer, type: ContextDev::Models::IndustryRetrieveSicParams::type_, request_options: ContextDev::RequestOptions diff --git a/sig/context_dev/models/parse_handle_params.rbs b/sig/context_dev/models/parse_handle_params.rbs index 6e3272f7..e04ff1f8 100644 --- a/sig/context_dev/models/parse_handle_params.rbs +++ b/sig/context_dev/models/parse_handle_params.rbs @@ -9,6 +9,7 @@ module ContextDev ocr: bool, pdf: ContextDev::ParseHandleParams::Pdf, :shorten_base64_images => bool, + tags: ::Array[String], use_main_content_only: bool } & ContextDev::Internal::Type::request_parameters @@ -47,6 +48,10 @@ module ContextDev def shorten_base64_images=: (bool) -> bool + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader use_main_content_only: bool? def use_main_content_only=: (bool) -> bool @@ -59,6 +64,7 @@ module ContextDev ?ocr: bool, ?pdf: ContextDev::ParseHandleParams::Pdf, ?shorten_base64_images: bool, + ?tags: ::Array[String], ?use_main_content_only: bool, ?request_options: ContextDev::request_opts ) -> void @@ -71,6 +77,7 @@ module ContextDev ocr: bool, pdf: ContextDev::ParseHandleParams::Pdf, :shorten_base64_images => bool, + tags: ::Array[String], use_main_content_only: bool, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/utility_prefetch_params.rbs b/sig/context_dev/models/utility_prefetch_params.rbs index 2f55b8f5..6b398dea 100644 --- a/sig/context_dev/models/utility_prefetch_params.rbs +++ b/sig/context_dev/models/utility_prefetch_params.rbs @@ -4,6 +4,7 @@ module ContextDev { identifier: ContextDev::Models::UtilityPrefetchParams::identifier, type: ContextDev::Models::UtilityPrefetchParams::type_, + tags: ::Array[String], timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -16,6 +17,10 @@ module ContextDev attr_accessor type: ContextDev::Models::UtilityPrefetchParams::type_ + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -23,6 +28,7 @@ module ContextDev def initialize: ( identifier: ContextDev::Models::UtilityPrefetchParams::identifier, type: ContextDev::Models::UtilityPrefetchParams::type_, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -30,6 +36,7 @@ module ContextDev def to_hash: -> { identifier: ContextDev::Models::UtilityPrefetchParams::identifier, type: ContextDev::Models::UtilityPrefetchParams::type_, + tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/web_extract_competitors_params.rbs b/sig/context_dev/models/web_extract_competitors_params.rbs index ddf1bf53..32653d7a 100644 --- a/sig/context_dev/models/web_extract_competitors_params.rbs +++ b/sig/context_dev/models/web_extract_competitors_params.rbs @@ -1,7 +1,12 @@ module ContextDev module Models type web_extract_competitors_params = - { domain: String, num_competitors: Integer, timeout_ms: Integer } + { + domain: String, + num_competitors: Integer, + tags: ::Array[String], + timeout_ms: Integer + } & ContextDev::Internal::Type::request_parameters class WebExtractCompetitorsParams < ContextDev::Internal::Type::BaseModel @@ -14,6 +19,10 @@ module ContextDev def num_competitors=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -21,6 +30,7 @@ module ContextDev def initialize: ( domain: String, ?num_competitors: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -28,6 +38,7 @@ module ContextDev def to_hash: -> { domain: String, num_competitors: Integer, + tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/web_extract_fonts_params.rbs b/sig/context_dev/models/web_extract_fonts_params.rbs index 7101e5cb..bd8e93fb 100644 --- a/sig/context_dev/models/web_extract_fonts_params.rbs +++ b/sig/context_dev/models/web_extract_fonts_params.rbs @@ -5,6 +5,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: ::Array[String], timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -25,6 +26,10 @@ module ContextDev def max_age_ms=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -33,6 +38,7 @@ module ContextDev ?direct_url: String, ?domain: String, ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -41,6 +47,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/web_extract_params.rbs b/sig/context_dev/models/web_extract_params.rbs index c185d714..dd5756c1 100644 --- a/sig/context_dev/models/web_extract_params.rbs +++ b/sig/context_dev/models/web_extract_params.rbs @@ -13,6 +13,7 @@ module ContextDev max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf, stop_after_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, wait_for_ms: Integer } @@ -64,6 +65,10 @@ module ContextDev def stop_after_ms=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -84,6 +89,7 @@ module ContextDev ?max_pages: Integer, ?pdf: ContextDev::WebExtractParams::Pdf, ?stop_after_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts @@ -101,6 +107,7 @@ module ContextDev max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf, stop_after_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, wait_for_ms: Integer, request_options: ContextDev::RequestOptions diff --git a/sig/context_dev/models/web_extract_styleguide_params.rbs b/sig/context_dev/models/web_extract_styleguide_params.rbs index 9b0b86ac..f1c598f3 100644 --- a/sig/context_dev/models/web_extract_styleguide_params.rbs +++ b/sig/context_dev/models/web_extract_styleguide_params.rbs @@ -6,6 +6,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: ::Array[String], timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -32,6 +33,10 @@ module ContextDev def max_age_ms=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -41,6 +46,7 @@ module ContextDev ?direct_url: String, ?domain: String, ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -50,6 +56,7 @@ module ContextDev direct_url: String, domain: String, max_age_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/web_screenshot_params.rbs b/sig/context_dev/models/web_screenshot_params.rbs index 8df117a5..06a6597c 100644 --- a/sig/context_dev/models/web_screenshot_params.rbs +++ b/sig/context_dev/models/web_screenshot_params.rbs @@ -11,6 +11,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::Models::WebScreenshotParams::page, scroll_offset: Integer, + tags: ::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, wait_for_ms: Integer @@ -67,6 +68,10 @@ module ContextDev def scroll_offset=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -91,6 +96,7 @@ module ContextDev ?max_age_ms: Integer, ?page: ContextDev::Models::WebScreenshotParams::page, ?scroll_offset: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, ?wait_for_ms: Integer, @@ -107,6 +113,7 @@ module ContextDev max_age_ms: Integer, page: ContextDev::Models::WebScreenshotParams::page, scroll_offset: Integer, + tags: ::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, wait_for_ms: Integer, diff --git a/sig/context_dev/models/web_search_params.rbs b/sig/context_dev/models/web_search_params.rbs index 43da2e65..22d042f6 100644 --- a/sig/context_dev/models/web_search_params.rbs +++ b/sig/context_dev/models/web_search_params.rbs @@ -10,6 +10,7 @@ module ContextDev markdown_options: ContextDev::WebSearchParams::MarkdownOptions, num_results: Integer, query_fanout: bool, + tags: ::Array[String], timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -54,6 +55,10 @@ module ContextDev def query_fanout=: (bool) -> bool + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -67,6 +72,7 @@ module ContextDev ?markdown_options: ContextDev::WebSearchParams::MarkdownOptions, ?num_results: Integer, ?query_fanout: bool, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void @@ -80,6 +86,7 @@ module ContextDev markdown_options: ContextDev::WebSearchParams::MarkdownOptions, num_results: Integer, query_fanout: bool, + tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/web_web_crawl_md_params.rbs b/sig/context_dev/models/web_web_crawl_md_params.rbs index 033fe072..5be0d4fa 100644 --- a/sig/context_dev/models/web_web_crawl_md_params.rbs +++ b/sig/context_dev/models/web_web_crawl_md_params.rbs @@ -17,6 +17,7 @@ module ContextDev settle_animations: bool, :shorten_base64_images => bool, stop_after_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, url_regex: String, use_main_content_only: bool, @@ -90,6 +91,10 @@ module ContextDev def stop_after_ms=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -122,6 +127,7 @@ module ContextDev ?settle_animations: bool, ?shorten_base64_images: bool, ?stop_after_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, ?use_main_content_only: bool, @@ -145,6 +151,7 @@ module ContextDev settle_animations: bool, :shorten_base64_images => bool, stop_after_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, url_regex: String, use_main_content_only: bool, diff --git a/sig/context_dev/models/web_web_scrape_html_params.rbs b/sig/context_dev/models/web_web_scrape_html_params.rbs index b58ef1ad..4b9b2cc7 100644 --- a/sig/context_dev/models/web_web_scrape_html_params.rbs +++ b/sig/context_dev/models/web_web_scrape_html_params.rbs @@ -11,6 +11,7 @@ module ContextDev max_age_ms: Integer, pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, settle_animations: bool, + tags: ::Array[String], timeout_ms: Integer, use_main_content_only: bool, wait_for_ms: Integer @@ -59,6 +60,10 @@ module ContextDev def settle_animations=: (bool) -> bool + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -81,6 +86,7 @@ module ContextDev ?max_age_ms: Integer, ?pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, ?settle_animations: bool, + ?tags: ::Array[String], ?timeout_ms: Integer, ?use_main_content_only: bool, ?wait_for_ms: Integer, @@ -97,6 +103,7 @@ module ContextDev max_age_ms: Integer, pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, settle_animations: bool, + tags: ::Array[String], timeout_ms: Integer, use_main_content_only: bool, wait_for_ms: Integer, diff --git a/sig/context_dev/models/web_web_scrape_images_params.rbs b/sig/context_dev/models/web_web_scrape_images_params.rbs index c5fa45f4..492b921f 100644 --- a/sig/context_dev/models/web_web_scrape_images_params.rbs +++ b/sig/context_dev/models/web_web_scrape_images_params.rbs @@ -7,6 +7,7 @@ module ContextDev enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, headers: ::Hash[Symbol, String], max_age_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, wait_for_ms: Integer } @@ -36,6 +37,10 @@ module ContextDev def max_age_ms=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -50,6 +55,7 @@ module ContextDev ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, ?headers: ::Hash[Symbol, String], ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts @@ -61,6 +67,7 @@ module ContextDev enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, headers: ::Hash[Symbol, String], max_age_ms: Integer, + tags: ::Array[String], timeout_ms: Integer, wait_for_ms: Integer, request_options: ContextDev::RequestOptions diff --git a/sig/context_dev/models/web_web_scrape_md_params.rbs b/sig/context_dev/models/web_web_scrape_md_params.rbs index 5df459cb..b2eada93 100644 --- a/sig/context_dev/models/web_web_scrape_md_params.rbs +++ b/sig/context_dev/models/web_web_scrape_md_params.rbs @@ -14,6 +14,7 @@ module ContextDev pdf: ContextDev::WebWebScrapeMdParams::Pdf, settle_animations: bool, :shorten_base64_images => bool, + tags: ::Array[String], timeout_ms: Integer, use_main_content_only: bool, wait_for_ms: Integer @@ -74,6 +75,10 @@ module ContextDev def shorten_base64_images=: (bool) -> bool + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -99,6 +104,7 @@ module ContextDev ?pdf: ContextDev::WebWebScrapeMdParams::Pdf, ?settle_animations: bool, ?shorten_base64_images: bool, + ?tags: ::Array[String], ?timeout_ms: Integer, ?use_main_content_only: bool, ?wait_for_ms: Integer, @@ -118,6 +124,7 @@ module ContextDev pdf: ContextDev::WebWebScrapeMdParams::Pdf, settle_animations: bool, :shorten_base64_images => bool, + tags: ::Array[String], timeout_ms: Integer, use_main_content_only: bool, wait_for_ms: Integer, diff --git a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs index 2a365074..b6d22a7b 100644 --- a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +++ b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs @@ -5,6 +5,7 @@ module ContextDev domain: String, headers: ::Hash[Symbol, String], max_links: Integer, + tags: ::Array[String], timeout_ms: Integer, url_regex: String } @@ -24,6 +25,10 @@ module ContextDev def max_links=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -36,6 +41,7 @@ module ContextDev domain: String, ?headers: ::Hash[Symbol, String], ?max_links: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, ?request_options: ContextDev::request_opts @@ -45,6 +51,7 @@ module ContextDev domain: String, headers: ::Hash[Symbol, String], max_links: Integer, + tags: ::Array[String], timeout_ms: Integer, url_regex: String, request_options: ContextDev::RequestOptions diff --git a/sig/context_dev/resources/ai.rbs b/sig/context_dev/resources/ai.rbs index 166ed13c..28db167e 100644 --- a/sig/context_dev/resources/ai.rbs +++ b/sig/context_dev/resources/ai.rbs @@ -4,6 +4,7 @@ module ContextDev def extract_product: ( url: String, ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::AIExtractProductResponse diff --git a/sig/context_dev/resources/brand.rbs b/sig/context_dev/resources/brand.rbs index 90c7da28..7fddce31 100644 --- a/sig/context_dev/resources/brand.rbs +++ b/sig/context_dev/resources/brand.rbs @@ -9,6 +9,7 @@ module ContextDev def retrieve_simplified: ( domain: String, ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::BrandRetrieveSimplifiedResponse diff --git a/sig/context_dev/resources/industry.rbs b/sig/context_dev/resources/industry.rbs index 1fbbe705..24c9bc46 100644 --- a/sig/context_dev/resources/industry.rbs +++ b/sig/context_dev/resources/industry.rbs @@ -5,6 +5,7 @@ module ContextDev input: String, ?max_results: Integer, ?min_results: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::IndustryRetrieveNaicsResponse @@ -13,6 +14,7 @@ module ContextDev input: String, ?max_results: Integer, ?min_results: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?type: ContextDev::Models::IndustryRetrieveSicParams::type_, ?request_options: ContextDev::request_opts diff --git a/sig/context_dev/resources/parse.rbs b/sig/context_dev/resources/parse.rbs index b2ff7061..57ec18f2 100644 --- a/sig/context_dev/resources/parse.rbs +++ b/sig/context_dev/resources/parse.rbs @@ -9,6 +9,7 @@ module ContextDev ?ocr: bool, ?pdf: ContextDev::ParseHandleParams::Pdf, ?shorten_base64_images: bool, + ?tags: ::Array[String], ?use_main_content_only: bool, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::ParseHandleResponse diff --git a/sig/context_dev/resources/utility.rbs b/sig/context_dev/resources/utility.rbs index 54a53a82..0069c540 100644 --- a/sig/context_dev/resources/utility.rbs +++ b/sig/context_dev/resources/utility.rbs @@ -4,6 +4,7 @@ module ContextDev def prefetch: ( identifier: ContextDev::Models::UtilityPrefetchParams::identifier, type: ContextDev::Models::UtilityPrefetchParams::type_, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::UtilityPrefetchResponse diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 77075c8e..cb4b9f63 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -13,6 +13,7 @@ module ContextDev ?max_pages: Integer, ?pdf: ContextDev::WebExtractParams::Pdf, ?stop_after_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts @@ -21,6 +22,7 @@ module ContextDev def extract_competitors: ( domain: String, ?num_competitors: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebExtractCompetitorsResponse @@ -29,6 +31,7 @@ module ContextDev ?direct_url: String, ?domain: String, ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebExtractFontsResponse @@ -38,6 +41,7 @@ module ContextDev ?direct_url: String, ?domain: String, ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebExtractStyleguideResponse @@ -52,6 +56,7 @@ module ContextDev ?max_age_ms: Integer, ?page: ContextDev::Models::WebScreenshotParams::page, ?scroll_offset: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, ?wait_for_ms: Integer, @@ -67,6 +72,7 @@ module ContextDev ?markdown_options: ContextDev::WebSearchParams::MarkdownOptions, ?num_results: Integer, ?query_fanout: bool, + ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebSearchResponse @@ -87,6 +93,7 @@ module ContextDev ?settle_animations: bool, ?shorten_base64_images: bool, ?stop_after_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, ?use_main_content_only: bool, @@ -104,6 +111,7 @@ module ContextDev ?max_age_ms: Integer, ?pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, ?settle_animations: bool, + ?tags: ::Array[String], ?timeout_ms: Integer, ?use_main_content_only: bool, ?wait_for_ms: Integer, @@ -116,6 +124,7 @@ module ContextDev ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, ?headers: ::Hash[Symbol, String], ?max_age_ms: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts @@ -134,6 +143,7 @@ module ContextDev ?pdf: ContextDev::WebWebScrapeMdParams::Pdf, ?settle_animations: bool, ?shorten_base64_images: bool, + ?tags: ::Array[String], ?timeout_ms: Integer, ?use_main_content_only: bool, ?wait_for_ms: Integer, @@ -144,6 +154,7 @@ module ContextDev domain: String, ?headers: ::Hash[Symbol, String], ?max_links: Integer, + ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, ?request_options: ContextDev::request_opts From 8fb7d29835d4ffe7eb53b1619d3da20fa45df52c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 00:11:04 +0000 Subject: [PATCH 02/13] feat(api): api update --- .stats.yml | 4 +- lib/context_dev.rb | 1 - lib/context_dev/models.rb | 2 - .../models/brand_retrieve_params.rb | 71 +- .../models/brand_retrieve_response.rb | 10 +- .../brand_retrieve_simplified_params.rb | 25 +- .../monitor_list_account_changes_params.rb | 23 +- .../monitor_list_account_runs_params.rb | 17 +- .../monitor_list_account_runs_response.rb | 123 +++- .../models/monitor_list_changes_params.rb | 12 +- lib/context_dev/models/monitor_list_params.rb | 37 +- .../models/monitor_list_runs_params.rb | 17 +- .../models/monitor_list_runs_response.rb | 120 +++- lib/context_dev/models/parse_handle_params.rb | 197 +++++- .../models/web_extract_fonts_params.rb | 6 +- .../models/web_extract_styleguide_params.rb | 6 +- .../models/web_screenshot_params.rb | 50 +- .../models/web_web_scrape_html_params.rb | 195 +++++- .../models/web_web_scrape_images_params.rb | 148 +++- .../models/web_web_scrape_md_params.rb | 288 +++++++- .../models/web_web_scrape_sitemap_params.rb | 11 +- lib/context_dev/models/webhook_delivery.rb | 109 --- lib/context_dev/resources/brand.rb | 6 +- lib/context_dev/resources/monitors.rb | 54 +- lib/context_dev/resources/parse.rb | 22 +- lib/context_dev/resources/web.rb | 71 +- rbi/context_dev/models.rbi | 2 - .../models/brand_retrieve_params.rbi | 167 +++-- .../models/brand_retrieve_response.rbi | 19 +- .../brand_retrieve_simplified_params.rbi | 60 +- .../monitor_list_account_changes_params.rbi | 16 + .../monitor_list_account_runs_params.rbi | 13 +- .../monitor_list_account_runs_response.rbi | 266 +++++++- .../models/monitor_list_changes_params.rbi | 8 + .../models/monitor_list_params.rbi | 54 +- .../models/monitor_list_runs_params.rbi | 13 +- .../models/monitor_list_runs_response.rbi | 266 +++++++- .../models/parse_handle_params.rbi | 389 +++++++++-- .../models/web_extract_fonts_params.rbi | 13 +- .../models/web_extract_styleguide_params.rbi | 13 +- .../models/web_screenshot_params.rbi | 92 +-- .../models/web_web_scrape_html_params.rbi | 426 ++++++++++-- .../models/web_web_scrape_images_params.rbi | 330 ++++++++- .../models/web_web_scrape_md_params.rbi | 633 ++++++++++++++++-- .../models/web_web_scrape_sitemap_params.rbi | 13 + rbi/context_dev/models/webhook_delivery.rbi | 172 ----- rbi/context_dev/resources/brand.rbi | 5 +- rbi/context_dev/resources/monitors.rbi | 37 +- rbi/context_dev/resources/parse.rbi | 53 +- rbi/context_dev/resources/web.rbi | 121 +++- sig/context_dev/models.rbs | 2 - .../models/brand_retrieve_params.rbs | 100 +-- .../models/brand_retrieve_response.rbs | 4 +- .../brand_retrieve_simplified_params.rbs | 30 +- .../monitor_list_account_runs_response.rbs | 102 ++- .../models/monitor_list_params.rbs | 22 +- .../models/monitor_list_runs_response.rbs | 102 ++- .../models/parse_handle_params.rbs | 122 +++- .../models/web_extract_fonts_params.rbs | 10 +- .../models/web_extract_styleguide_params.rbs | 10 +- .../models/web_screenshot_params.rbs | 38 +- .../models/web_web_scrape_html_params.rbs | 158 +++-- .../models/web_web_scrape_images_params.rbs | 124 ++-- .../models/web_web_scrape_md_params.rbs | 227 +++++-- .../models/web_web_scrape_sitemap_params.rbs | 7 + sig/context_dev/models/webhook_delivery.rbs | 81 --- sig/context_dev/resources/brand.rbs | 3 +- sig/context_dev/resources/monitors.rbs | 4 +- sig/context_dev/resources/parse.rbs | 11 +- sig/context_dev/resources/web.rbs | 53 +- test/context_dev/resources/brand_test.rb | 2 +- test/context_dev/resources/industry_test.rb | 4 +- test/context_dev/resources/utility_test.rb | 2 +- test/context_dev/resources/web_test.rb | 2 +- 74 files changed, 4559 insertions(+), 1467 deletions(-) delete mode 100644 lib/context_dev/models/webhook_delivery.rb delete mode 100644 rbi/context_dev/models/webhook_delivery.rbi delete mode 100644 sig/context_dev/models/webhook_delivery.rbs diff --git a/.stats.yml b/.stats.yml index 8e4b5605..b9d1d304 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-98c2abed2e726f7e5006cd4ef2ce9a56e84470d1fead500f7f3d46ed47f5af8b.yml -openapi_spec_hash: 921fc4db282f59e416e3c95d14d534f2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d49b84cf1125618f171698ff1ee4ff9a8d04151619cb4a56d650103869834465.yml +openapi_spec_hash: 49b7a6f59dcdff1e2bf88feb6474a562 config_hash: daabb160675d86b354711da1e77e5129 diff --git a/lib/context_dev.rb b/lib/context_dev.rb index fcf9547d..7ec780f3 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -98,7 +98,6 @@ require_relative "context_dev/models/web_extract_response" require_relative "context_dev/models/web_extract_styleguide_params" require_relative "context_dev/models/web_extract_styleguide_response" -require_relative "context_dev/models/webhook_delivery" require_relative "context_dev/models/web_screenshot_params" require_relative "context_dev/models/web_screenshot_response" require_relative "context_dev/models/web_search_params" diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index 1472ae90..5b26d88b 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -85,8 +85,6 @@ module ContextDev WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams - WebhookDelivery = ContextDev::Models::WebhookDelivery - WebScreenshotParams = ContextDev::Models::WebScreenshotParams WebSearchParams = ContextDev::Models::WebSearchParams diff --git a/lib/context_dev/models/brand_retrieve_params.rb b/lib/context_dev/models/brand_retrieve_params.rb index 24f54f4b..639ebc09 100644 --- a/lib/context_dev/models/brand_retrieve_params.rb +++ b/lib/context_dev/models/brand_retrieve_params.rb @@ -58,7 +58,9 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # @!attribute force_language # # @return [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByDomain::ForceLanguage, nil] - optional :force_language, enum: -> { ContextDev::BrandRetrieveParams::Body::ByDomain::ForceLanguage } + optional :force_language, + enum: -> { ContextDev::BrandRetrieveParams::Body::ByDomain::ForceLanguage }, + nil?: true # @!attribute max_age_ms # Maximum age in milliseconds for cached brand data before the API performs a hard @@ -101,7 +103,7 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # # @param domain [String] Domain name to retrieve brand data for (e.g., 'stripe.com'). # - # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByDomain::ForceLanguage] + # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByDomain::ForceLanguage, nil] # # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard # @@ -266,7 +268,9 @@ class ByName < ContextDev::Internal::Type::BaseModel # @!attribute force_language # # @return [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByName::ForceLanguage, nil] - optional :force_language, enum: -> { ContextDev::BrandRetrieveParams::Body::ByName::ForceLanguage } + optional :force_language, + enum: -> { ContextDev::BrandRetrieveParams::Body::ByName::ForceLanguage }, + nil?: true # @!attribute max_age_ms # Maximum age in milliseconds for cached brand data before the API performs a hard @@ -312,7 +316,7 @@ class ByName < ContextDev::Internal::Type::BaseModel # # @param country_gl [String] Optional country code hint (GL parameter) to specify the country when looking up # - # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByName::ForceLanguage] + # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByName::ForceLanguage, nil] # # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard # @@ -470,7 +474,9 @@ class ByEmail < ContextDev::Internal::Type::BaseModel # @!attribute force_language # # @return [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByEmail::ForceLanguage, nil] - optional :force_language, enum: -> { ContextDev::BrandRetrieveParams::Body::ByEmail::ForceLanguage } + optional :force_language, + enum: -> { ContextDev::BrandRetrieveParams::Body::ByEmail::ForceLanguage }, + nil?: true # @!attribute max_age_ms # Maximum age in milliseconds for cached brand data before the API performs a hard @@ -515,7 +521,7 @@ class ByEmail < ContextDev::Internal::Type::BaseModel # # @param email [String] Email address to retrieve brand data for (e.g., 'jane@stripe.com'). # - # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByEmail::ForceLanguage] + # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByEmail::ForceLanguage, nil] # # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard # @@ -673,7 +679,9 @@ class ByTicker < ContextDev::Internal::Type::BaseModel # @!attribute force_language # # @return [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByTicker::ForceLanguage, nil] - optional :force_language, enum: -> { ContextDev::BrandRetrieveParams::Body::ByTicker::ForceLanguage } + optional :force_language, + enum: -> { ContextDev::BrandRetrieveParams::Body::ByTicker::ForceLanguage }, + nil?: true # @!attribute max_age_ms # Maximum age in milliseconds for cached brand data before the API performs a hard @@ -723,7 +731,7 @@ class ByTicker < ContextDev::Internal::Type::BaseModel # # @param ticker [String] Stock ticker symbol to retrieve brand data for (e.g., 'AAPL'). # - # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByTicker::ForceLanguage] + # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByTicker::ForceLanguage, nil] # # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard # @@ -946,7 +954,9 @@ class ByTransaction < ContextDev::Internal::Type::BaseModel # @!attribute force_language # # @return [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::ForceLanguage, nil] - optional :force_language, enum: -> { ContextDev::BrandRetrieveParams::Body::ByTransaction::ForceLanguage } + optional :force_language, + enum: -> { ContextDev::BrandRetrieveParams::Body::ByTransaction::ForceLanguage }, + nil?: true # @!attribute high_confidence_only # When set to true, the API performs additional verification to ensure the @@ -967,14 +977,14 @@ class ByTransaction < ContextDev::Internal::Type::BaseModel # Optional Merchant Category Code (MCC) to help identify the business category or # industry. # - # @return [Integer, nil] - optional :mcc, Integer + # @return [String, Float, nil] + optional :mcc, union: -> { ContextDev::BrandRetrieveParams::Body::ByTransaction::Mcc } # @!attribute phone # Optional phone number from the transaction to help verify brand match. # - # @return [Float, nil] - optional :phone, Float + # @return [String, Float, nil] + optional :phone, union: -> { ContextDev::BrandRetrieveParams::Body::ByTransaction::Phone } # @!attribute tags # Optional caller-defined tags for tracking this request. Tags are recorded on the @@ -1005,15 +1015,15 @@ class ByTransaction < ContextDev::Internal::Type::BaseModel # # @param country_gl [String] Optional country code hint (GL parameter) to specify the country when identifyin # - # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::ForceLanguage] + # @param force_language [Symbol, ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::ForceLanguage, nil] # # @param high_confidence_only [Boolean] When set to true, the API performs additional verification to ensure the identif # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # - # @param mcc [Integer] Optional Merchant Category Code (MCC) to help identify the business category or + # @param mcc [String, Float] Optional Merchant Category Code (MCC) to help identify the business category or # - # @param phone [Float] Optional phone number from the transaction to help verify brand match. + # @param phone [String, Float] Optional phone number from the transaction to help verify brand match. # # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the # @@ -1149,6 +1159,35 @@ module ForceLanguage # @!method self.values # @return [Array] end + + # Optional Merchant Category Code (MCC) to help identify the business category or + # industry. + # + # @see ContextDev::Models::BrandRetrieveParams::Body::ByTransaction#mcc + module Mcc + extend ContextDev::Internal::Type::Union + + variant String + + variant Float + + # @!method self.variants + # @return [Array(String, Float)] + end + + # Optional phone number from the transaction to help verify brand match. + # + # @see ContextDev::Models::BrandRetrieveParams::Body::ByTransaction#phone + module Phone + extend ContextDev::Internal::Type::Union + + variant String + + variant Float + + # @!method self.variants + # @return [Array(String, Float)] + end end # @!method self.variants diff --git a/lib/context_dev/models/brand_retrieve_response.rb b/lib/context_dev/models/brand_retrieve_response.rb index d3e07497..0f967670 100644 --- a/lib/context_dev/models/brand_retrieve_response.rb +++ b/lib/context_dev/models/brand_retrieve_response.rb @@ -113,8 +113,7 @@ class Brand < ContextDev::Internal::Type::BaseModel optional :phone, String # @!attribute primary_language - # The primary language of the brand's website content. Detected from the HTML lang - # tag, page content analysis, or social media descriptions. + # Language to force for the retrieved brand data. # # @return [Symbol, ContextDev::Models::BrandRetrieveResponse::Brand::PrimaryLanguage, nil] optional :primary_language, @@ -175,7 +174,7 @@ class Brand < ContextDev::Internal::Type::BaseModel # # @param phone [String] Company phone number # - # @param primary_language [Symbol, ContextDev::Models::BrandRetrieveResponse::Brand::PrimaryLanguage, nil] The primary language of the brand's website content. Detected from the HTML lang + # @param primary_language [Symbol, ContextDev::Models::BrandRetrieveResponse::Brand::PrimaryLanguage, nil] Language to force for the retrieved brand data. # # @param slogan [String] The brand's slogan # @@ -468,7 +467,6 @@ module Subindustry STREAMING_PLATFORMS_VIDEO_MUSIC_AUDIO = :"Streaming Platforms (Video, Music, Audio)" GAMING_INTERACTIVE_ENTERTAINMENT = :"Gaming & Interactive Entertainment" CREATOR_ECONOMY_INFLUENCER_PLATFORMS = :"Creator Economy & Influencer Platforms" - ADVERTISING_ADTECH_MEDIA_BUYING = :"Advertising, Adtech & Media Buying" FILM_TV_PRODUCTION_STUDIOS = :"Film, TV & Production Studios" EVENTS_VENUES_LIVE_ENTERTAINMENT = :"Events, Venues & Live Entertainment" VIRTUAL_WORLDS_METAVERSE_EXPERIENCES = :"Virtual Worlds & Metaverse Experiences" @@ -529,6 +527,7 @@ module Subindustry STREETWEAR_EMERGING_LUXURY = :"Streetwear & Emerging Luxury" COUTURE_MADE_TO_MEASURE = :"Couture & Made-to-Measure" NEWS_PUBLISHING_JOURNALISM = :"News Publishing & Journalism" + ADVERTISING_ADTECH_MEDIA_BUYING = :"Advertising, Adtech & Media Buying" DIGITAL_MEDIA_CONTENT_PLATFORMS = :"Digital Media & Content Platforms" BROADCASTING_TV_RADIO = :"Broadcasting (TV & Radio)" PODCASTING_AUDIO_MEDIA = :"Podcasting & Audio Media" @@ -826,8 +825,7 @@ module Type end end - # The primary language of the brand's website content. Detected from the HTML lang - # tag, page content analysis, or social media descriptions. + # Language to force for the retrieved brand data. # # @see ContextDev::Models::BrandRetrieveResponse::Brand#primary_language module PrimaryLanguage diff --git a/lib/context_dev/models/brand_retrieve_simplified_params.rb b/lib/context_dev/models/brand_retrieve_simplified_params.rb index f1d92e7e..99afef22 100644 --- a/lib/context_dev/models/brand_retrieve_simplified_params.rb +++ b/lib/context_dev/models/brand_retrieve_simplified_params.rb @@ -20,7 +20,7 @@ class BrandRetrieveSimplifiedParams < ContextDev::Internal::Type::BaseModel # year. # # @return [Integer, nil] - optional :max_age_ms, Integer + optional :max_age_ms, Integer, nil?: true # @!attribute tags # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -30,6 +30,12 @@ class BrandRetrieveSimplifiedParams < ContextDev::Internal::Type::BaseModel # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] + # @!attribute theme + # Optional theme preference used when selecting brand assets. + # + # @return [Symbol, ContextDev::Models::BrandRetrieveSimplifiedParams::Theme, nil] + optional :theme, enum: -> { ContextDev::BrandRetrieveSimplifiedParams::Theme } + # @!attribute timeout_ms # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -38,19 +44,32 @@ class BrandRetrieveSimplifiedParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :timeout_ms, Integer - # @!method initialize(domain:, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) + # @!method initialize(domain:, max_age_ms: nil, tags: nil, theme: nil, timeout_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::BrandRetrieveSimplifiedParams} for more details. # # @param domain [String] Domain name to retrieve simplified brand data for # - # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard + # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # + # @param theme [Symbol, ContextDev::Models::BrandRetrieveSimplifiedParams::Theme] Optional theme preference used when selecting brand assets. + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + + # Optional theme preference used when selecting brand assets. + module Theme + extend ContextDev::Internal::Type::Enum + + LIGHT = :light + DARK = :dark + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/context_dev/models/monitor_list_account_changes_params.rb b/lib/context_dev/models/monitor_list_account_changes_params.rb index 3919e46f..654da4fd 100644 --- a/lib/context_dev/models/monitor_list_account_changes_params.rb +++ b/lib/context_dev/models/monitor_list_account_changes_params.rb @@ -8,27 +8,32 @@ class MonitorListAccountChangesParams < ContextDev::Internal::Type::BaseModel include ContextDev::Internal::Type::RequestParameters # @!attribute change_detection_type + # Filter by change detection type. # # @return [Symbol, ContextDev::Models::MonitorListAccountChangesParams::ChangeDetectionType, nil] optional :change_detection_type, enum: -> { ContextDev::MonitorListAccountChangesParams::ChangeDetectionType } # @!attribute cursor + # Opaque pagination cursor from a previous response. # # @return [String, nil] optional :cursor, String # @!attribute limit + # Maximum number of items to return per page (1-100). Defaults to 25. # # @return [Integer, nil] optional :limit, Integer # @!attribute monitor_id + # Filter changes to a single monitor. # # @return [String, nil] optional :monitor_id, String # @!attribute since + # Only include items at or after this ISO 8601 timestamp. # # @return [Time, nil] optional :since, Time @@ -40,34 +45,37 @@ class MonitorListAccountChangesParams < ContextDev::Internal::Type::BaseModel optional :tag, String # @!attribute target_type + # Filter by target type. # # @return [Symbol, ContextDev::Models::MonitorListAccountChangesParams::TargetType, nil] optional :target_type, enum: -> { ContextDev::MonitorListAccountChangesParams::TargetType } # @!attribute until_ + # Only include items before this ISO 8601 timestamp. # # @return [Time, nil] optional :until_, Time # @!method initialize(change_detection_type: nil, cursor: nil, limit: nil, monitor_id: nil, since: nil, tag: nil, target_type: nil, until_: nil, request_options: {}) - # @param change_detection_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::ChangeDetectionType] + # @param change_detection_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::ChangeDetectionType] Filter by change detection type. # - # @param cursor [String] + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # - # @param monitor_id [String] + # @param monitor_id [String] Filter changes to a single monitor. # - # @param since [Time] + # @param since [Time] Only include items at or after this ISO 8601 timestamp. # # @param tag [String] Filter to items that have this tag. # - # @param target_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::TargetType] + # @param target_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::TargetType] Filter by target type. # - # @param until_ [Time] + # @param until_ [Time] Only include items before this ISO 8601 timestamp. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + # Filter by change detection type. module ChangeDetectionType extend ContextDev::Internal::Type::Enum @@ -78,6 +86,7 @@ module ChangeDetectionType # @return [Array] end + # Filter by target type. module TargetType extend ContextDev::Internal::Type::Enum diff --git a/lib/context_dev/models/monitor_list_account_runs_params.rb b/lib/context_dev/models/monitor_list_account_runs_params.rb index df4c4e60..dd4587dd 100644 --- a/lib/context_dev/models/monitor_list_account_runs_params.rb +++ b/lib/context_dev/models/monitor_list_account_runs_params.rb @@ -8,36 +8,33 @@ class MonitorListAccountRunsParams < ContextDev::Internal::Type::BaseModel include ContextDev::Internal::Type::RequestParameters # @!attribute cursor + # Opaque pagination cursor from a previous response. # # @return [String, nil] optional :cursor, String # @!attribute limit + # Maximum number of items to return per page (1-100). Defaults to 25. # # @return [Integer, nil] optional :limit, Integer # @!attribute status - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. # # @return [Symbol, ContextDev::Models::MonitorListAccountRunsParams::Status, nil] optional :status, enum: -> { ContextDev::MonitorListAccountRunsParams::Status } # @!method initialize(cursor: nil, limit: nil, status: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::MonitorListAccountRunsParams} for more details. + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param cursor [String] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # - # @param limit [Integer] - # - # @param status [Symbol, ContextDev::Models::MonitorListAccountRunsParams::Status] Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (in + # @param status [Symbol, ContextDev::Models::MonitorListAccountRunsParams::Status] Filter runs by lifecycle status. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. module Status extend ContextDev::Internal::Type::Enum diff --git a/lib/context_dev/models/monitor_list_account_runs_response.rb b/lib/context_dev/models/monitor_list_account_runs_response.rb index 802167dc..455cfdc1 100644 --- a/lib/context_dev/models/monitor_list_account_runs_response.rb +++ b/lib/context_dev/models/monitor_list_account_runs_response.rb @@ -111,8 +111,9 @@ class Data < ContextDev::Internal::Type::BaseModel # fired. Omitted when no webhook was attempted, including runs created before # event selection was added. # - # @return [Array, nil] - optional :webhook_deliveries, -> { ContextDev::Internal::Type::ArrayOf[ContextDev::WebhookDelivery] } + # @return [Array, nil] + optional :webhook_deliveries, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery] } # @!attribute webhook_delivery # @deprecated @@ -121,8 +122,9 @@ class Data < ContextDev::Internal::Type::BaseModel # can deliver multiple events. Omitted when no webhook was attempted, including # historical runs created before delivery tracking was added. # - # @return [ContextDev::Models::WebhookDelivery, nil] - optional :webhook_delivery, -> { ContextDev::WebhookDelivery } + # @return [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery, nil] + optional :webhook_delivery, + -> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery } # @!method initialize(id:, baseline_created:, change_detected:, change_detection_type:, credits_charged:, monitor_id:, run_type:, status:, target_type:, change_id: nil, completed_at: nil, error: nil, skip_reason: nil, started_at: nil, webhook_deliveries: nil, webhook_delivery: nil) # Some parameter documentations has been truncated, see @@ -156,9 +158,9 @@ class Data < ContextDev::Internal::Type::BaseModel # # @param started_at [Time, nil] # - # @param webhook_deliveries [Array] All webhook deliveries attempted by this run — one per subscribed event that fir + # @param webhook_deliveries [Array] All webhook deliveries attempted by this run — one per subscribed event that fir # - # @param webhook_delivery [ContextDev::Models::WebhookDelivery] Deprecated: use `webhook_deliveries`, which records every attempt now that a run + # @param webhook_delivery [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery] Deprecated: use `webhook_deliveries`, which records every attempt now that a run # @see ContextDev::Models::MonitorListAccountRunsResponse::Data#change_detection_type module ChangeDetectionType @@ -243,6 +245,115 @@ module SkipReason # @!method self.values # @return [Array] end + + class WebhookDelivery < ContextDev::Internal::Type::BaseModel + # @!attribute attempted_at + # + # @return [Time] + required :attempted_at, Time + + # @!attribute error + # + # @return [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error, nil] + required :error, + -> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error }, + nil?: true + + # @!attribute event + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + # + # @return [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event] + required :event, + enum: -> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event } + + # @!attribute event_id + # Identifier sent in the X-Context-Id header. + # + # @return [String] + required :event_id, String + + # @!attribute http_status + # The endpoint's final HTTP response status, or null when no response was + # received. + # + # @return [Integer, nil] + required :http_status, Integer, nil?: true + + # @!attribute status + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + # + # @return [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status] + required :status, + enum: -> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status } + + # @!method initialize(attempted_at:, error:, event:, event_id:, http_status:, status:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery} for + # more details. + # + # @param attempted_at [Time] + # + # @param error [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error, nil] + # + # @param event [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event] The event this delivery carried. Deliveries recorded before event selection exis + # + # @param event_id [String] Identifier sent in the X-Context-Id header. + # + # @param http_status [Integer, nil] The endpoint's final HTTP response status, or null when no response was received + # + # @param status [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status] Delivery outcome. delivered means any 2xx response; rejected means a non-2xx res + + # @see ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery#error + class Error < ContextDev::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute message + # + # @return [String] + required :message, String + + # @!method initialize(code:, message:) + # @param code [String] + # @param message [String] + end + + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + # + # @see ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery#event + module Event + extend ContextDev::Internal::Type::Enum + + CHANGE_DETECTED = :"change.detected" + RUN_COMPLETED = :"run.completed" + + # @!method self.values + # @return [Array] + end + + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + # + # @see ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery#status + module Status + extend ContextDev::Internal::Type::Enum + + DELIVERED = :delivered + REJECTED = :rejected + FAILED = :failed + SKIPPED_UNSAFE_URL = :skipped_unsafe_url + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/context_dev/models/monitor_list_changes_params.rb b/lib/context_dev/models/monitor_list_changes_params.rb index bfa71405..2e02f5f8 100644 --- a/lib/context_dev/models/monitor_list_changes_params.rb +++ b/lib/context_dev/models/monitor_list_changes_params.rb @@ -13,16 +13,19 @@ class MonitorListChangesParams < ContextDev::Internal::Type::BaseModel required :monitor_id, String # @!attribute cursor + # Opaque pagination cursor from a previous response. # # @return [String, nil] optional :cursor, String # @!attribute limit + # Maximum number of items to return per page (1-100). Defaults to 25. # # @return [Integer, nil] optional :limit, Integer # @!attribute since + # Only include items at or after this ISO 8601 timestamp. # # @return [Time, nil] optional :since, Time @@ -34,6 +37,7 @@ class MonitorListChangesParams < ContextDev::Internal::Type::BaseModel optional :tag, String # @!attribute until_ + # Only include items before this ISO 8601 timestamp. # # @return [Time, nil] optional :until_, Time @@ -41,15 +45,15 @@ class MonitorListChangesParams < ContextDev::Internal::Type::BaseModel # @!method initialize(monitor_id:, cursor: nil, limit: nil, since: nil, tag: nil, until_: nil, request_options: {}) # @param monitor_id [String] # - # @param cursor [String] + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # - # @param since [Time] + # @param since [Time] Only include items at or after this ISO 8601 timestamp. # # @param tag [String] Filter to items that have this tag. # - # @param until_ [Time] + # @param until_ [Time] Only include items before this ISO 8601 timestamp. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/context_dev/models/monitor_list_params.rb b/lib/context_dev/models/monitor_list_params.rb index 079222c3..7e2b0a53 100644 --- a/lib/context_dev/models/monitor_list_params.rb +++ b/lib/context_dev/models/monitor_list_params.rb @@ -8,16 +8,19 @@ class MonitorListParams < ContextDev::Internal::Type::BaseModel include ContextDev::Internal::Type::RequestParameters # @!attribute change_detection_type + # Filter by change detection type. # # @return [Symbol, ContextDev::Models::MonitorListParams::ChangeDetectionType, nil] optional :change_detection_type, enum: -> { ContextDev::MonitorListParams::ChangeDetectionType } # @!attribute cursor + # Opaque pagination cursor from a previous response. # # @return [String, nil] optional :cursor, String # @!attribute limit + # Maximum number of items to return per page (1-100). Defaults to 25. # # @return [Integer, nil] optional :limit, Integer @@ -34,7 +37,8 @@ class MonitorListParams < ContextDev::Internal::Type::BaseModel # # @return [Array, nil] optional :search_by, - -> { ContextDev::Internal::Type::ArrayOf[enum: ContextDev::MonitorListParams::SearchBy] } + -> { ContextDev::Internal::Type::ArrayOf[enum: ContextDev::MonitorListParams::SearchBy] }, + nil?: true # @!attribute search_type # `prefix` for as-you-type prefix matching (default), `exact` for full-token @@ -44,11 +48,7 @@ class MonitorListParams < ContextDev::Internal::Type::BaseModel optional :search_type, enum: -> { ContextDev::MonitorListParams::SearchType } # @!attribute status - # Monitor lifecycle status. `failed` means the most recent run failed (see the - # monitor's `last_error`); failed monitors keep running on schedule and flip back - # to `active` on the next successful run. Monitors are auto-`paused` after - # repeated consecutive failures or insufficient-credit skips; resume by PATCHing - # status to `active`. + # Filter monitors by lifecycle status. # # @return [Symbol, ContextDev::Models::MonitorListParams::Status, nil] optional :status, enum: -> { ContextDev::MonitorListParams::Status } @@ -63,9 +63,10 @@ class MonitorListParams < ContextDev::Internal::Type::BaseModel # Comma-separated list of tags to filter by (matches monitors having any of them). # # @return [Array, nil] - optional :tags, ContextDev::Internal::Type::ArrayOf[String] + optional :tags, ContextDev::Internal::Type::ArrayOf[String], nil?: true # @!attribute target_type + # Filter by target type. # # @return [Symbol, ContextDev::Models::MonitorListParams::TargetType, nil] optional :target_type, enum: -> { ContextDev::MonitorListParams::TargetType } @@ -74,28 +75,29 @@ class MonitorListParams < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::MonitorListParams} for more details. # - # @param change_detection_type [Symbol, ContextDev::Models::MonitorListParams::ChangeDetectionType] + # @param change_detection_type [Symbol, ContextDev::Models::MonitorListParams::ChangeDetectionType] Filter by change detection type. # - # @param cursor [String] + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # # @param q [String] Free-text search term, matched against the fields named in `search_by`. # - # @param search_by [Array] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru + # @param search_by [Array, nil] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru # # @param search_type [Symbol, ContextDev::Models::MonitorListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match # - # @param status [Symbol, ContextDev::Models::MonitorListParams::Status] Monitor lifecycle status. `failed` means the most recent run failed (see the mon + # @param status [Symbol, ContextDev::Models::MonitorListParams::Status] Filter monitors by lifecycle status. # # @param tag [String] Filter to items that have this tag. # - # @param tags [Array] Comma-separated list of tags to filter by (matches monitors having any of them). + # @param tags [Array, nil] Comma-separated list of tags to filter by (matches monitors having any of them). # - # @param target_type [Symbol, ContextDev::Models::MonitorListParams::TargetType] + # @param target_type [Symbol, ContextDev::Models::MonitorListParams::TargetType] Filter by target type. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + # Filter by change detection type. module ChangeDetectionType extend ContextDev::Internal::Type::Enum @@ -130,11 +132,7 @@ module SearchType # @return [Array] end - # Monitor lifecycle status. `failed` means the most recent run failed (see the - # monitor's `last_error`); failed monitors keep running on schedule and flip back - # to `active` on the next successful run. Monitors are auto-`paused` after - # repeated consecutive failures or insufficient-credit skips; resume by PATCHing - # status to `active`. + # Filter monitors by lifecycle status. module Status extend ContextDev::Internal::Type::Enum @@ -146,6 +144,7 @@ module Status # @return [Array] end + # Filter by target type. module TargetType extend ContextDev::Internal::Type::Enum diff --git a/lib/context_dev/models/monitor_list_runs_params.rb b/lib/context_dev/models/monitor_list_runs_params.rb index eaffa14a..9dad52fb 100644 --- a/lib/context_dev/models/monitor_list_runs_params.rb +++ b/lib/context_dev/models/monitor_list_runs_params.rb @@ -13,38 +13,35 @@ class MonitorListRunsParams < ContextDev::Internal::Type::BaseModel required :monitor_id, String # @!attribute cursor + # Opaque pagination cursor from a previous response. # # @return [String, nil] optional :cursor, String # @!attribute limit + # Maximum number of items to return per page (1-100). Defaults to 25. # # @return [Integer, nil] optional :limit, Integer # @!attribute status - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. # # @return [Symbol, ContextDev::Models::MonitorListRunsParams::Status, nil] optional :status, enum: -> { ContextDev::MonitorListRunsParams::Status } # @!method initialize(monitor_id:, cursor: nil, limit: nil, status: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::MonitorListRunsParams} for more details. - # # @param monitor_id [String] # - # @param cursor [String] + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # - # @param status [Symbol, ContextDev::Models::MonitorListRunsParams::Status] Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (in + # @param status [Symbol, ContextDev::Models::MonitorListRunsParams::Status] Filter runs by lifecycle status. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. module Status extend ContextDev::Internal::Type::Enum diff --git a/lib/context_dev/models/monitor_list_runs_response.rb b/lib/context_dev/models/monitor_list_runs_response.rb index a4ce61d4..9a86e14a 100644 --- a/lib/context_dev/models/monitor_list_runs_response.rb +++ b/lib/context_dev/models/monitor_list_runs_response.rb @@ -111,8 +111,9 @@ class Data < ContextDev::Internal::Type::BaseModel # fired. Omitted when no webhook was attempted, including runs created before # event selection was added. # - # @return [Array, nil] - optional :webhook_deliveries, -> { ContextDev::Internal::Type::ArrayOf[ContextDev::WebhookDelivery] } + # @return [Array, nil] + optional :webhook_deliveries, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery] } # @!attribute webhook_delivery # @deprecated @@ -121,8 +122,8 @@ class Data < ContextDev::Internal::Type::BaseModel # can deliver multiple events. Omitted when no webhook was attempted, including # historical runs created before delivery tracking was added. # - # @return [ContextDev::Models::WebhookDelivery, nil] - optional :webhook_delivery, -> { ContextDev::WebhookDelivery } + # @return [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery, nil] + optional :webhook_delivery, -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery } # @!method initialize(id:, baseline_created:, change_detected:, change_detection_type:, credits_charged:, monitor_id:, run_type:, status:, target_type:, change_id: nil, completed_at: nil, error: nil, skip_reason: nil, started_at: nil, webhook_deliveries: nil, webhook_delivery: nil) # Some parameter documentations has been truncated, see @@ -156,9 +157,9 @@ class Data < ContextDev::Internal::Type::BaseModel # # @param started_at [Time, nil] # - # @param webhook_deliveries [Array] All webhook deliveries attempted by this run — one per subscribed event that fir + # @param webhook_deliveries [Array] All webhook deliveries attempted by this run — one per subscribed event that fir # - # @param webhook_delivery [ContextDev::Models::WebhookDelivery] Deprecated: use `webhook_deliveries`, which records every attempt now that a run + # @param webhook_delivery [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery] Deprecated: use `webhook_deliveries`, which records every attempt now that a run # @see ContextDev::Models::MonitorListRunsResponse::Data#change_detection_type module ChangeDetectionType @@ -243,6 +244,113 @@ module SkipReason # @!method self.values # @return [Array] end + + class WebhookDelivery < ContextDev::Internal::Type::BaseModel + # @!attribute attempted_at + # + # @return [Time] + required :attempted_at, Time + + # @!attribute error + # + # @return [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error, nil] + required :error, + -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error }, + nil?: true + + # @!attribute event + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + # + # @return [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event] + required :event, enum: -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event } + + # @!attribute event_id + # Identifier sent in the X-Context-Id header. + # + # @return [String] + required :event_id, String + + # @!attribute http_status + # The endpoint's final HTTP response status, or null when no response was + # received. + # + # @return [Integer, nil] + required :http_status, Integer, nil?: true + + # @!attribute status + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + # + # @return [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status] + required :status, enum: -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status } + + # @!method initialize(attempted_at:, error:, event:, event_id:, http_status:, status:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery} for more + # details. + # + # @param attempted_at [Time] + # + # @param error [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error, nil] + # + # @param event [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event] The event this delivery carried. Deliveries recorded before event selection exis + # + # @param event_id [String] Identifier sent in the X-Context-Id header. + # + # @param http_status [Integer, nil] The endpoint's final HTTP response status, or null when no response was received + # + # @param status [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status] Delivery outcome. delivered means any 2xx response; rejected means a non-2xx res + + # @see ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery#error + class Error < ContextDev::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute message + # + # @return [String] + required :message, String + + # @!method initialize(code:, message:) + # @param code [String] + # @param message [String] + end + + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + # + # @see ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery#event + module Event + extend ContextDev::Internal::Type::Enum + + CHANGE_DETECTED = :"change.detected" + RUN_COMPLETED = :"run.completed" + + # @!method self.values + # @return [Array] + end + + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + # + # @see ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery#status + module Status + extend ContextDev::Internal::Type::Enum + + DELIVERED = :delivered + REJECTED = :rejected + FAILED = :failed + SKIPPED_UNSAFE_URL = :skipped_unsafe_url + + # @!method self.values + # @return [Array] + end + end end end end diff --git a/lib/context_dev/models/parse_handle_params.rb b/lib/context_dev/models/parse_handle_params.rb index b71161e3..05367ade 100644 --- a/lib/context_dev/models/parse_handle_params.rb +++ b/lib/context_dev/models/parse_handle_params.rb @@ -12,9 +12,15 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel # @return [Pathname, StringIO, IO, String, ContextDev::FilePart] required :body, ContextDev::Internal::Type::FileInput + # @!attribute client + # Optional client identifier used for usage attribution. + # + # @return [String, nil] + optional :client, String + # @!attribute extension - # Optional file extension hint. Case-insensitive; a leading dot is accepted (e.g. - # ".pdf"). + # Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, + # md, py, rtf, jpg, png, or txt. # # @return [Symbol, ContextDev::Models::ParseHandleParams::Extension, nil] optional :extension, enum: -> { ContextDev::ParseHandleParams::Extension } @@ -22,30 +28,26 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel # @!attribute include_images # Include image references in Markdown output # - # @return [Boolean, nil] - optional :include_images, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeImages, nil] + optional :include_images, union: -> { ContextDev::ParseHandleParams::IncludeImages } # @!attribute include_links # Preserve hyperlinks in Markdown output # - # @return [Boolean, nil] - optional :include_links, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeLinks, nil] + optional :include_links, union: -> { ContextDev::ParseHandleParams::IncludeLinks } # @!attribute ocr - # Gates all OCR. When true, PDFs get embedded-image OCR (recognized text inserted - # at each image's position in page reading order, preserving the text layer; - # pdf.start/pdf.end limit the page range), scanned PDFs with no text layer get - # full-document OCR, and raster images get their visible text transcribed. When - # false, no OCR runs: scanned PDFs may yield no content and images return only - # format/dimension metadata. Calls where OCR actually runs cost 5 credits instead - # of 1. + # When true for PDF inputs, detect and OCR images embedded in the selected pages, + # inserting recognized text at each image's position in page reading order while + # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. + # When false, all OCR is disabled, including the automatic scanned-PDF fallback. # - # @return [Boolean, nil] - optional :ocr, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr, nil] + optional :ocr, union: -> { ContextDev::ParseHandleParams::Ocr } # @!attribute pdf - # PDF page-range controls. Use start/end to limit parsing (and OCR when ocr=true) - # to an inclusive 1-based page range. + # PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. # # @return [ContextDev::Models::ParseHandleParams::Pdf, nil] optional :pdf, -> { ContextDev::ParseHandleParams::Pdf } @@ -53,8 +55,8 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel # @!attribute shorten_base64_images # Shorten base64-encoded image data in the Markdown output # - # @return [Boolean, nil] - optional :shorten_base64_images, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::ShortenBase64Images, nil] + optional :shorten_base64_images, union: -> { ContextDev::ParseHandleParams::ShortenBase64Images } # @!attribute tags # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -67,35 +69,37 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel # @!attribute use_main_content_only # Extract only the main content from HTML-like inputs # - # @return [Boolean, nil] - optional :use_main_content_only, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly, nil] + optional :use_main_content_only, union: -> { ContextDev::ParseHandleParams::UseMainContentOnly } - # @!method initialize(body:, extension: nil, include_images: nil, include_links: nil, ocr: nil, pdf: nil, shorten_base64_images: nil, tags: nil, use_main_content_only: nil, request_options: {}) + # @!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, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::ParseHandleParams} for more details. # # @param body [Pathname, StringIO, IO, String, ContextDev::FilePart] # - # @param extension [Symbol, ContextDev::Models::ParseHandleParams::Extension] Optional file extension hint. Case-insensitive; a leading dot is accepted (e.g. + # @param client [String] Optional client identifier used for usage attribution. # - # @param include_images [Boolean] Include image references in Markdown output + # @param extension [Symbol, ContextDev::Models::ParseHandleParams::Extension] Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md # - # @param include_links [Boolean] Preserve hyperlinks in Markdown output + # @param include_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeImages] Include image references in Markdown output # - # @param ocr [Boolean] Gates all OCR. When true, PDFs get embedded-image OCR (recognized text inserted + # @param include_links [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeLinks] Preserve hyperlinks in Markdown output # - # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] PDF page-range controls. Use start/end to limit parsing (and OCR when ocr=true) + # @param ocr [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr] When true for PDF inputs, detect and OCR images embedded in the selected pages, # - # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output + # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. + # + # @param shorten_base64_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::ShortenBase64Images] Shorten base64-encoded image data in the Markdown output # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # - # @param use_main_content_only [Boolean] Extract only the main content from HTML-like inputs + # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly] Extract only the main content from HTML-like inputs # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - # Optional file extension hint. Case-insensitive; a leading dot is accepted (e.g. - # ".pdf"). + # Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, + # md, py, rtf, jpg, png, or txt. module Extension extend ContextDev::Internal::Type::Enum @@ -174,6 +178,84 @@ module Extension # @return [Array] end + # Include image references in Markdown output + module IncludeImages + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::ParseHandleParams::IncludeImages::TRUE } + + variant const: -> { ContextDev::Models::ParseHandleParams::IncludeImages::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::IncludeImages::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # Preserve hyperlinks in Markdown output + module IncludeLinks + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::ParseHandleParams::IncludeLinks::TRUE } + + variant const: -> { ContextDev::Models::ParseHandleParams::IncludeLinks::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::IncludeLinks::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # When true for PDF inputs, detect and OCR images embedded in the selected pages, + # inserting recognized text at each image's position in page reading order while + # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. + # When false, all OCR is disabled, including the automatic scanned-PDF fallback. + module Ocr + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::ParseHandleParams::Ocr::TRUE } + + variant const: -> { ContextDev::Models::ParseHandleParams::Ocr::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + class Pdf < ContextDev::Internal::Type::BaseModel # @!attribute end_ # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. @@ -192,13 +274,62 @@ class Pdf < ContextDev::Internal::Type::BaseModel # Some parameter documentations has been truncated, see # {ContextDev::Models::ParseHandleParams::Pdf} for more details. # - # PDF page-range controls. Use start/end to limit parsing (and OCR when ocr=true) - # to an inclusive 1-based page range. + # PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. # # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus # # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. end + + # Shorten base64-encoded image data in the Markdown output + module ShortenBase64Images + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::ParseHandleParams::ShortenBase64Images::TRUE } + + variant const: -> { ContextDev::Models::ParseHandleParams::ShortenBase64Images::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::ShortenBase64Images::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # Extract only the main content from HTML-like inputs + module UseMainContentOnly + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::ParseHandleParams::UseMainContentOnly::TRUE } + + variant const: -> { ContextDev::Models::ParseHandleParams::UseMainContentOnly::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::ParseHandleParams::UseMainContentOnly::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end end end end diff --git a/lib/context_dev/models/web_extract_fonts_params.rb b/lib/context_dev/models/web_extract_fonts_params.rb index cd5dce43..34fc38b1 100644 --- a/lib/context_dev/models/web_extract_fonts_params.rb +++ b/lib/context_dev/models/web_extract_fonts_params.rb @@ -24,13 +24,13 @@ class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel optional :domain, String # @!attribute max_age_ms - # Maximum age in milliseconds for cached data before the API performs a hard + # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. # # @return [Integer, nil] - optional :max_age_ms, Integer + optional :max_age_ms, Integer, nil?: true # @!attribute tags # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -56,7 +56,7 @@ class WebExtractFontsParams < ContextDev::Internal::Type::BaseModel # # @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai # - # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre + # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # diff --git a/lib/context_dev/models/web_extract_styleguide_params.rb b/lib/context_dev/models/web_extract_styleguide_params.rb index 41cd8d56..5aa80a70 100644 --- a/lib/context_dev/models/web_extract_styleguide_params.rb +++ b/lib/context_dev/models/web_extract_styleguide_params.rb @@ -32,13 +32,13 @@ class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel optional :domain, String # @!attribute max_age_ms - # Maximum age in milliseconds for cached data before the API performs a hard + # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. # # @return [Integer, nil] - optional :max_age_ms, Integer + optional :max_age_ms, Integer, nil?: true # @!attribute tags # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -66,7 +66,7 @@ class WebExtractStyleguideParams < ContextDev::Internal::Type::BaseModel # # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The # - # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre + # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # diff --git a/lib/context_dev/models/web_screenshot_params.rb b/lib/context_dev/models/web_screenshot_params.rb index b916d153..1dfd8915 100644 --- a/lib/context_dev/models/web_screenshot_params.rb +++ b/lib/context_dev/models/web_screenshot_params.rb @@ -15,8 +15,9 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel optional :color_scheme, enum: -> { ContextDev::WebScreenshotParams::ColorScheme } # @!attribute country - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. # # @return [Symbol, ContextDev::Models::WebScreenshotParams::Country, nil] optional :country, enum: -> { ContextDev::WebScreenshotParams::Country } @@ -50,8 +51,8 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # dismiss cookie banner before capture. If 'false' or not provided, captures the # page without that step. # - # @return [Symbol, ContextDev::Models::WebScreenshotParams::HandleCookiePopup, nil] - optional :handle_cookie_popup, enum: -> { ContextDev::WebScreenshotParams::HandleCookiePopup } + # @return [Boolean, Symbol, ContextDev::Models::WebScreenshotParams::HandleCookiePopup, nil] + optional :handle_cookie_popup, union: -> { ContextDev::WebScreenshotParams::HandleCookiePopup } # @!attribute max_age_ms # Return a cached screenshot if a prior screenshot for the same parameters exists @@ -59,7 +60,7 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh. # # @return [Integer, nil] - optional :max_age_ms, Integer + optional :max_age_ms, Integer, nil?: true # @!attribute page # Optional parameter to specify which page type to screenshot. If provided, the @@ -80,7 +81,7 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # precedence over fullScreenshot. Max: 100000. # # @return [Integer, nil] - optional :scroll_offset, Integer + optional :scroll_offset, Integer, nil?: true # @!attribute tags # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -110,7 +111,7 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # omitted. # # @return [Integer, nil] - optional :wait_for_ms, Integer + optional :wait_for_ms, Integer, nil?: true # @!method initialize(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, tags: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see @@ -118,7 +119,7 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # # @param color_scheme [Symbol, ContextDev::Models::WebScreenshotParams::ColorScheme] Optional parameter to choose the site's visual theme in the screenshot. Use 'lig # - # @param country [Symbol, ContextDev::Models::WebScreenshotParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @param country [Symbol, ContextDev::Models::WebScreenshotParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https # @@ -126,13 +127,13 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # # @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc # - # @param handle_cookie_popup [Symbol, ContextDev::Models::WebScreenshotParams::HandleCookiePopup] Optional parameter to control cookie/consent popup handling. If 'true', we dismi + # @param handle_cookie_popup [Boolean, Symbol, ContextDev::Models::WebScreenshotParams::HandleCookiePopup] Optional parameter to control cookie/consent popup handling. If 'true', we dismi # - # @param max_age_ms [Integer] Return a cached screenshot if a prior screenshot for the same parameters exists + # @param max_age_ms [Integer, nil] Return a cached screenshot if a prior screenshot for the same parameters exists # # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy # - # @param scroll_offset [Integer] Optional vertical scroll offset in pixels for capturing a long page in viewport- + # @param scroll_offset [Integer, nil] Optional vertical scroll offset in pixels for capturing a long page in viewport- # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # @@ -140,7 +141,7 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. # - # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before taking + # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before taking # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] @@ -156,8 +157,9 @@ module ColorScheme # @return [Array] end - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. module Country extend ContextDev::Internal::Type::Enum @@ -387,13 +389,27 @@ module FullScreenshot # dismiss cookie banner before capture. If 'false' or not provided, captures the # page without that step. module HandleCookiePopup - extend ContextDev::Internal::Type::Enum + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebScreenshotParams::HandleCookiePopup::TRUE } + + variant const: -> { ContextDev::Models::WebScreenshotParams::HandleCookiePopup::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebScreenshotParams::HandleCookiePopup::TaggedSymbol) } + end + + # @!group TRUE = :true FALSE = :false - # @!method self.values - # @return [Array] + # @!endgroup end # Optional parameter to specify which page type to screenshot. If provided, the diff --git a/lib/context_dev/models/web_web_scrape_html_params.rb b/lib/context_dev/models/web_web_scrape_html_params.rb index 2201eb4d..8da85ed4 100644 --- a/lib/context_dev/models/web_web_scrape_html_params.rb +++ b/lib/context_dev/models/web_web_scrape_html_params.rb @@ -14,8 +14,9 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel required :url, String # @!attribute country - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. # # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country, nil] optional :country, enum: -> { ContextDev::WebWebScrapeHTMLParams::Country } @@ -26,7 +27,7 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # "nav", "footer", ".ad-banner", "[aria-hidden=true]". # # @return [Array, nil] - optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String] + optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true # @!attribute headers # Optional outbound HTTP headers forwarded only to the target URL, sent as @@ -39,8 +40,8 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @!attribute include_frames # When true, iframes are rendered inline into the returned HTML. # - # @return [Boolean, nil] - optional :include_frames, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames, nil] + optional :include_frames, union: -> { ContextDev::WebWebScrapeHTMLParams::IncludeFrames } # @!attribute include_selectors # CSS selectors. When provided, only matching subtrees (and their descendants) are @@ -48,7 +49,7 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # Examples: "article.main", "#content", "[role=main]". # # @return [Array, nil] - optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String] + optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true # @!attribute max_age_ms # Return a cached result if a prior scrape for the same parameters exists and is @@ -56,7 +57,7 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. # # @return [Integer, nil] - optional :max_age_ms, Integer + optional :max_age_ms, Integer, nil?: true # @!attribute pdf # PDF parsing controls. Use start/end to limit text extraction and embedded-image @@ -70,8 +71,8 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # extracting HTML. Defaults to false. This adds a bit of latency in exchange for # more stable output on animated pages. # - # @return [Boolean, nil] - optional :settle_animations, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations, nil] + optional :settle_animations, union: -> { ContextDev::WebWebScrapeHTMLParams::SettleAnimations } # @!attribute tags # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -93,15 +94,15 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # When true, return only the page's main content in the HTML response, excluding # headers, footers, sidebars, and navigation when detectable. # - # @return [Boolean, nil] - optional :use_main_content_only, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly, nil] + optional :use_main_content_only, union: -> { ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly } # @!attribute wait_for_ms # Optional browser wait time in milliseconds after initial page load. Min: 0. Max: # 30000 (30 seconds). # # @return [Integer, nil] - optional :wait_for_ms, Integer + optional :wait_for_ms, Integer, nil?: true # @!method initialize(url:, 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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see @@ -109,34 +110,35 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # - # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # - # @param exclude_selectors [Array] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi + # @param exclude_selectors [Array, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi # # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob # - # @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML. + # @param include_frames [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames] When true, iframes are rendered inline into the returned HTML. # - # @param include_selectors [Array] CSS selectors. When provided, only matching subtrees (and their descendants) are + # @param include_selectors [Array, nil] CSS selectors. When provided, only matching subtrees (and their descendants) are # - # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y # # @param pdf [ContextDev::Models::WebWebScrapeHTMLParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image # - # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr + # @param settle_animations [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations] When true, waits briefly for CSS and transition animations to settle before extr # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # - # @param use_main_content_only [Boolean] When true, return only the page's main content in the HTML response, excluding h + # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly] When true, return only the page's main content in the HTML response, excluding h # - # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load. Min: 0. Max: + # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load. Min: 0. Max: # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. module Country extend ContextDev::Internal::Type::Enum @@ -349,6 +351,31 @@ module Country # @return [Array] end + # When true, iframes are rendered inline into the returned HTML. + module IncludeFrames + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::IncludeFrames::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + class Pdf < ContextDev::Internal::Type::BaseModel # @!attribute end_ # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. @@ -362,15 +389,17 @@ class Pdf < ContextDev::Internal::Type::BaseModel # recognized text at each image's position in page reading order while preserving # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. # - # @return [Boolean, nil] - optional :ocr, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr, nil] + optional :ocr, union: -> { ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr } # @!attribute should_parse # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and # a 400 WEBSITE_ACCESS_ERROR is returned. # - # @return [Boolean, nil] - optional :should_parse, ContextDev::Internal::Type::Boolean, api_name: :shouldParse + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse, nil] + optional :should_parse, + union: -> { ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse }, + api_name: :shouldParse # @!attribute start # First 1-based PDF page to parse. When omitted, parsing starts at the first page. @@ -387,11 +416,121 @@ class Pdf < ContextDev::Internal::Type::BaseModel # # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus # - # @param ocr [Boolean] When true, detect and OCR images embedded in the selected PDF pages, inserting r + # @param ocr [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr] When true, detect and OCR images embedded in the selected PDF pages, inserting r # - # @param should_parse [Boolean] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # @param should_parse [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and # # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. + + # When true, detect and OCR images embedded in the selected PDF pages, inserting + # recognized text at each image's position in page reading order while preserving + # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # + # @see ContextDev::Models::WebWebScrapeHTMLParams::Pdf#ocr + module Ocr + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::Ocr::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 WEBSITE_ACCESS_ERROR is returned. + # + # @see ContextDev::Models::WebWebScrapeHTMLParams::Pdf#should_parse + module ShouldParse + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ShouldParse::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + end + + # When true, waits briefly for CSS and transition animations to settle before + # extracting HTML. Defaults to false. This adds a bit of latency in exchange for + # more stable output on animated pages. + module SettleAnimations + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::SettleAnimations::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # When true, return only the page's main content in the HTML response, excluding + # headers, footers, sidebars, and navigation when detectable. + module UseMainContentOnly + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup end end end diff --git a/lib/context_dev/models/web_web_scrape_images_params.rb b/lib/context_dev/models/web_web_scrape_images_params.rb index 77451c66..0e739593 100644 --- a/lib/context_dev/models/web_web_scrape_images_params.rb +++ b/lib/context_dev/models/web_web_scrape_images_params.rb @@ -19,15 +19,15 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # group is kept. Images that cannot be downloaded or hashed are kept. Default: # false. # - # @return [Boolean, nil] - optional :dedupe, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Dedupe, nil] + optional :dedupe, union: -> { ContextDev::WebWebScrapeImagesParams::Dedupe } # @!attribute enrichment # Optional per-image processing, sent as deep-object query params such as # enrichment[resolution]=true. # # @return [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil] - optional :enrichment, -> { ContextDev::WebWebScrapeImagesParams::Enrichment } + optional :enrichment, -> { ContextDev::WebWebScrapeImagesParams::Enrichment }, nil?: true # @!attribute headers # Optional outbound HTTP headers forwarded only to the target URL, sent as @@ -42,7 +42,7 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). # # @return [Integer, nil] - optional :max_age_ms, Integer + optional :max_age_ms, Integer, nil?: true # @!attribute tags # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -65,7 +65,7 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # collecting images. Min: 0. Max: 30000 (30 seconds). # # @return [Integer, nil] - optional :wait_for_ms, Integer + optional :wait_for_ms, Integer, nil?: true # @!method initialize(url:, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see @@ -73,35 +73,65 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # # @param url [String] Page URL to inspect. Must include http:// or https://. # - # @param dedupe [Boolean] When true, visually duplicate images are removed: every image is loaded and perc + # @param dedupe [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Dedupe] When true, visually duplicate images are removed: every image is loaded and perc # - # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment] Optional per-image processing, sent as deep-object query params such as enrichme + # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil] Optional per-image processing, sent as deep-object query params such as enrichme # # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob # - # @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 + # @param max_age_ms [Integer, nil] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # - # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before collec + # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before collec # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + # When true, visually duplicate images are removed: every image is loaded and + # perceptually hashed, and only the highest-resolution copy of each duplicate + # group is kept. Images that cannot be downloaded or hashed are kept. Default: + # false. + module Dedupe + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Dedupe::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Dedupe::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeImagesParams::Dedupe::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + class Enrichment < ContextDev::Internal::Type::BaseModel # @!attribute classification # Classify each image by visual asset type. # - # @return [Boolean, nil] - optional :classification, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Enrichment::Classification, nil] + optional :classification, union: -> { ContextDev::WebWebScrapeImagesParams::Enrichment::Classification } # @!attribute hosted_url # Host materializable images on the Brand.dev CDN and return their URL and MIME # type. # - # @return [Boolean, nil] - optional :hosted_url, ContextDev::Internal::Type::Boolean, api_name: :hostedUrl + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Enrichment::HostedURL, nil] + optional :hosted_url, + union: -> { ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL }, + api_name: :hostedUrl # @!attribute max_time_per_ms # Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000. @@ -112,8 +142,8 @@ class Enrichment < ContextDev::Internal::Type::BaseModel # @!attribute resolution # Measure image width and height when possible. # - # @return [Boolean, nil] - optional :resolution, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Enrichment::Resolution, nil] + optional :resolution, union: -> { ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution } # @!method initialize(classification: nil, hosted_url: nil, max_time_per_ms: nil, resolution: nil) # Some parameter documentations has been truncated, see @@ -122,13 +152,95 @@ class Enrichment < ContextDev::Internal::Type::BaseModel # Optional per-image processing, sent as deep-object query params such as # enrichment[resolution]=true. # - # @param classification [Boolean] Classify each image by visual asset type. + # @param classification [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Enrichment::Classification] Classify each image by visual asset type. # - # @param hosted_url [Boolean] Host materializable images on the Brand.dev CDN and return their URL and MIME ty + # @param hosted_url [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Enrichment::HostedURL] Host materializable images on the Brand.dev CDN and return their URL and MIME ty # # @param max_time_per_ms [Integer] Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000. # - # @param resolution [Boolean] Measure image width and height when possible. + # @param resolution [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Enrichment::Resolution] Measure image width and height when possible. + + # Classify each image by visual asset type. + # + # @see ContextDev::Models::WebWebScrapeImagesParams::Enrichment#classification + module Classification + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Enrichment::Classification::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Enrichment::Classification::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # Host materializable images on the Brand.dev CDN and return their URL and MIME + # type. + # + # @see ContextDev::Models::WebWebScrapeImagesParams::Enrichment#hosted_url + module HostedURL + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Enrichment::HostedURL::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Enrichment::HostedURL::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # Measure image width and height when possible. + # + # @see ContextDev::Models::WebWebScrapeImagesParams::Enrichment#resolution + module Resolution + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Enrichment::Resolution::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeImagesParams::Enrichment::Resolution::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end end end end diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index 3a3404ba..8a3d34a8 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -15,8 +15,9 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel required :url, String # @!attribute country - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. # # @return [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country, nil] optional :country, enum: -> { ContextDev::WebWebScrapeMdParams::Country } @@ -27,7 +28,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]". # # @return [Array, nil] - optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String] + optional :exclude_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true # @!attribute headers # Optional outbound HTTP headers forwarded only to the target URL, sent as @@ -40,20 +41,20 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @!attribute include_frames # When true, the contents of iframes are rendered to Markdown. # - # @return [Boolean, nil] - optional :include_frames, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeFrames, nil] + optional :include_frames, union: -> { ContextDev::WebWebScrapeMdParams::IncludeFrames } # @!attribute include_images # Include image references in Markdown output # - # @return [Boolean, nil] - optional :include_images, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeImages, nil] + optional :include_images, union: -> { ContextDev::WebWebScrapeMdParams::IncludeImages } # @!attribute include_links # Preserve hyperlinks in Markdown output # - # @return [Boolean, nil] - optional :include_links, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeLinks, nil] + optional :include_links, union: -> { ContextDev::WebWebScrapeMdParams::IncludeLinks } # @!attribute include_selectors # CSS selectors. When provided, only matching HTML subtrees (and their @@ -61,7 +62,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # document is kept. Examples: "article.main", "#content", "[role=main]". # # @return [Array, nil] - optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String] + optional :include_selectors, ContextDev::Internal::Type::ArrayOf[String], nil?: true # @!attribute max_age_ms # Return a cached result if a prior scrape for the same parameters exists and is @@ -69,7 +70,7 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. # # @return [Integer, nil] - optional :max_age_ms, Integer + optional :max_age_ms, Integer, nil?: true # @!attribute pdf # PDF parsing controls. Use start/end to limit text extraction and embedded-image @@ -83,14 +84,14 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # converting to Markdown. Defaults to false. This adds a bit of latency in # exchange for more stable output on animated pages. # - # @return [Boolean, nil] - optional :settle_animations, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::SettleAnimations, nil] + optional :settle_animations, union: -> { ContextDev::WebWebScrapeMdParams::SettleAnimations } # @!attribute shorten_base64_images # Shorten base64-encoded image data in the Markdown output # - # @return [Boolean, nil] - optional :shorten_base64_images, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images, nil] + optional :shorten_base64_images, union: -> { ContextDev::WebWebScrapeMdParams::ShortenBase64Images } # @!attribute tags # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -112,15 +113,15 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # Extract only the main content of the page, excluding headers, footers, sidebars, # and navigation # - # @return [Boolean, nil] - optional :use_main_content_only, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly, nil] + optional :use_main_content_only, union: -> { ContextDev::WebWebScrapeMdParams::UseMainContentOnly } # @!attribute wait_for_ms # Optional browser wait time in milliseconds after initial page load before # converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). # # @return [Integer, nil] - optional :wait_for_ms, Integer + optional :wait_for_ms, Integer, nil?: true # @!method initialize(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see @@ -128,40 +129,41 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr # - # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # - # @param exclude_selectors [Array] CSS selectors to remove before conversion to Markdown. Applied after includeSele + # @param exclude_selectors [Array, nil] CSS selectors to remove before conversion to Markdown. Applied after includeSele # # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob # - # @param include_frames [Boolean] When true, the contents of iframes are rendered to Markdown. + # @param include_frames [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeFrames] When true, the contents of iframes are rendered to Markdown. # - # @param include_images [Boolean] Include image references in Markdown output + # @param include_images [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeImages] Include image references in Markdown output # - # @param include_links [Boolean] Preserve hyperlinks in Markdown output + # @param include_links [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeLinks] Preserve hyperlinks in Markdown output # - # @param include_selectors [Array] CSS selectors. When provided, only matching HTML subtrees (and their descendants + # @param include_selectors [Array, nil] CSS selectors. When provided, only matching HTML subtrees (and their descendants # - # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y # # @param pdf [ContextDev::Models::WebWebScrapeMdParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image # - # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before conv + # @param settle_animations [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::SettleAnimations] When true, waits briefly for CSS and transition animations to settle before conv # - # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output + # @param shorten_base64_images [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images] Shorten base64-encoded image data in the Markdown output # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # - # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, + # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly] Extract only the main content of the page, excluding headers, footers, sidebars, # - # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before conver + # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before conver # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. module Country extend ContextDev::Internal::Type::Enum @@ -374,6 +376,81 @@ module Country # @return [Array] end + # When true, the contents of iframes are rendered to Markdown. + module IncludeFrames + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeFrames::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeFrames::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # Include image references in Markdown output + module IncludeImages + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeImages::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeImages::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # Preserve hyperlinks in Markdown output + module IncludeLinks + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeLinks::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::IncludeLinks::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + class Pdf < ContextDev::Internal::Type::BaseModel # @!attribute end_ # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. @@ -387,15 +464,17 @@ class Pdf < ContextDev::Internal::Type::BaseModel # recognized text at each image's position in page reading order while preserving # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. # - # @return [Boolean, nil] - optional :ocr, ContextDev::Internal::Type::Boolean + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr, nil] + optional :ocr, union: -> { ContextDev::WebWebScrapeMdParams::Pdf::Ocr } # @!attribute should_parse # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and # a 400 WEBSITE_ACCESS_ERROR is returned. # - # @return [Boolean, nil] - optional :should_parse, ContextDev::Internal::Type::Boolean, api_name: :shouldParse + # @return [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse, nil] + optional :should_parse, + union: -> { ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse }, + api_name: :shouldParse # @!attribute start # First 1-based PDF page to parse. When omitted, parsing starts at the first page. @@ -412,11 +491,146 @@ class Pdf < ContextDev::Internal::Type::BaseModel # # @param end_ [Integer] Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Mus # - # @param ocr [Boolean] When true, detect and OCR images embedded in the selected PDF pages, inserting r + # @param ocr [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr] When true, detect and OCR images embedded in the selected PDF pages, inserting r # - # @param should_parse [Boolean] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # @param should_parse [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse] When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and # # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. + + # When true, detect and OCR images embedded in the selected PDF pages, inserting + # recognized text at each image's position in page reading order while preserving + # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + # + # @see ContextDev::Models::WebWebScrapeMdParams::Pdf#ocr + module Ocr + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Pdf::Ocr::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 WEBSITE_ACCESS_ERROR is returned. + # + # @see ContextDev::Models::WebWebScrapeMdParams::Pdf#should_parse + module ShouldParse + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::Pdf::ShouldParse::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + end + + # When true, waits briefly for CSS and transition animations to settle before + # converting to Markdown. Defaults to false. This adds a bit of latency in + # exchange for more stable output on animated pages. + module SettleAnimations + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::SettleAnimations::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::SettleAnimations::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # Shorten base64-encoded image data in the Markdown output + module ShortenBase64Images + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup + end + + # Extract only the main content of the page, excluding headers, footers, sidebars, + # and navigation + module UseMainContentOnly + extend ContextDev::Internal::Type::Union + + variant ContextDev::Internal::Type::Boolean + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly::TRUE } + + variant const: -> { ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly::FALSE } + + # @!method self.variants + # @return [Array(Boolean, Symbol)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(T::Boolean, ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol) } + end + + # @!group + + TRUE = :true + FALSE = :false + + # @!endgroup end end end diff --git a/lib/context_dev/models/web_web_scrape_sitemap_params.rb b/lib/context_dev/models/web_web_scrape_sitemap_params.rb index 0e9cacc2..67874f4c 100644 --- a/lib/context_dev/models/web_web_scrape_sitemap_params.rb +++ b/lib/context_dev/models/web_web_scrape_sitemap_params.rb @@ -28,6 +28,13 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_links, Integer + # @!attribute sitemap_url + # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled + # instead of discovering the domain's sitemaps. + # + # @return [String, nil] + optional :sitemap_url, String + # @!attribute tags # Optional comma-separated caller-defined tags for tracking this request. Tags are # recorded on the request's usage log and can be used to filter usage on the @@ -51,7 +58,7 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [String, nil] optional :url_regex, String - # @!method initialize(domain:, headers: nil, max_links: nil, tags: nil, timeout_ms: nil, url_regex: nil, request_options: {}) + # @!method initialize(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} for more details. # @@ -61,6 +68,8 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # + # @param sitemap_url [String] Optional explicit sitemap URL. When provided, exactly this sitemap is crawled in + # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th diff --git a/lib/context_dev/models/webhook_delivery.rb b/lib/context_dev/models/webhook_delivery.rb deleted file mode 100644 index b52e80b6..00000000 --- a/lib/context_dev/models/webhook_delivery.rb +++ /dev/null @@ -1,109 +0,0 @@ -# frozen_string_literal: true - -module ContextDev - module Models - class WebhookDelivery < ContextDev::Internal::Type::BaseModel - # @!attribute attempted_at - # - # @return [Time] - required :attempted_at, Time - - # @!attribute error - # - # @return [ContextDev::Models::WebhookDelivery::Error, nil] - required :error, -> { ContextDev::WebhookDelivery::Error }, nil?: true - - # @!attribute event - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - # - # @return [Symbol, ContextDev::Models::WebhookDelivery::Event] - required :event, enum: -> { ContextDev::WebhookDelivery::Event } - - # @!attribute event_id - # Identifier sent in the X-Context-Id header. - # - # @return [String] - required :event_id, String - - # @!attribute http_status - # The endpoint's final HTTP response status, or null when no response was - # received. - # - # @return [Integer, nil] - required :http_status, Integer, nil?: true - - # @!attribute status - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - # - # @return [Symbol, ContextDev::Models::WebhookDelivery::Status] - required :status, enum: -> { ContextDev::WebhookDelivery::Status } - - # @!method initialize(attempted_at:, error:, event:, event_id:, http_status:, status:) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::WebhookDelivery} for more details. - # - # @param attempted_at [Time] - # - # @param error [ContextDev::Models::WebhookDelivery::Error, nil] - # - # @param event [Symbol, ContextDev::Models::WebhookDelivery::Event] The event this delivery carried. Deliveries recorded before event selection exis - # - # @param event_id [String] Identifier sent in the X-Context-Id header. - # - # @param http_status [Integer, nil] The endpoint's final HTTP response status, or null when no response was received - # - # @param status [Symbol, ContextDev::Models::WebhookDelivery::Status] Delivery outcome. delivered means any 2xx response; rejected means a non-2xx res - - # @see ContextDev::Models::WebhookDelivery#error - class Error < ContextDev::Internal::Type::BaseModel - # @!attribute code - # - # @return [String] - required :code, String - - # @!attribute message - # - # @return [String] - required :message, String - - # @!method initialize(code:, message:) - # @param code [String] - # @param message [String] - end - - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - # - # @see ContextDev::Models::WebhookDelivery#event - module Event - extend ContextDev::Internal::Type::Enum - - CHANGE_DETECTED = :"change.detected" - RUN_COMPLETED = :"run.completed" - - # @!method self.values - # @return [Array] - end - - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - # - # @see ContextDev::Models::WebhookDelivery#status - module Status - extend ContextDev::Internal::Type::Enum - - DELIVERED = :delivered - REJECTED = :rejected - FAILED = :failed - SKIPPED_UNSAFE_URL = :skipped_unsafe_url - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/context_dev/resources/brand.rb b/lib/context_dev/resources/brand.rb index 7c39d7d6..d51da45a 100644 --- a/lib/context_dev/resources/brand.rb +++ b/lib/context_dev/resources/brand.rb @@ -36,14 +36,16 @@ def retrieve(params) # information: domain, title, colors, logos, and backdrops. Optimized for faster # responses and reduced data transfer. # - # @overload retrieve_simplified(domain:, max_age_ms: nil, tags: nil, timeout_ms: nil, request_options: {}) + # @overload retrieve_simplified(domain:, max_age_ms: nil, tags: nil, theme: nil, timeout_ms: nil, request_options: {}) # # @param domain [String] Domain name to retrieve simplified brand data for # - # @param max_age_ms [Integer] Maximum age in milliseconds for cached brand data before the API performs a hard + # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # + # @param theme [Symbol, ContextDev::Models::BrandRetrieveSimplifiedParams::Theme] Optional theme preference used when selecting brand assets. + # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] diff --git a/lib/context_dev/resources/monitors.rb b/lib/context_dev/resources/monitors.rb index f5263907..aeda3782 100644 --- a/lib/context_dev/resources/monitors.rb +++ b/lib/context_dev/resources/monitors.rb @@ -115,25 +115,25 @@ def update(monitor_id, params = {}) # # @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: {}) # - # @param change_detection_type [Symbol, ContextDev::Models::MonitorListParams::ChangeDetectionType] + # @param change_detection_type [Symbol, ContextDev::Models::MonitorListParams::ChangeDetectionType] Filter by change detection type. # - # @param cursor [String] + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # # @param q [String] Free-text search term, matched against the fields named in `search_by`. # - # @param search_by [Array] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru + # @param search_by [Array, nil] Comma-separated fields to search with `q`. Defaults to all of them. Note `instru # # @param search_type [Symbol, ContextDev::Models::MonitorListParams::SearchType] `prefix` for as-you-type prefix matching (default), `exact` for full-token match # - # @param status [Symbol, ContextDev::Models::MonitorListParams::Status] Monitor lifecycle status. `failed` means the most recent run failed (see the mon + # @param status [Symbol, ContextDev::Models::MonitorListParams::Status] Filter monitors by lifecycle status. # # @param tag [String] Filter to items that have this tag. # - # @param tags [Array] Comma-separated list of tags to filter by (matches monitors having any of them). + # @param tags [Array, nil] Comma-separated list of tags to filter by (matches monitors having any of them). # - # @param target_type [Symbol, ContextDev::Models::MonitorListParams::TargetType] + # @param target_type [Symbol, ContextDev::Models::MonitorListParams::TargetType] Filter by target type. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -175,21 +175,21 @@ def delete(monitor_id, params = {}) # # @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: {}) # - # @param change_detection_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::ChangeDetectionType] + # @param change_detection_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::ChangeDetectionType] Filter by change detection type. # - # @param cursor [String] + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # - # @param monitor_id [String] + # @param monitor_id [String] Filter changes to a single monitor. # - # @param since [Time] + # @param since [Time] Only include items at or after this ISO 8601 timestamp. # # @param tag [String] Filter to items that have this tag. # - # @param target_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::TargetType] + # @param target_type [Symbol, ContextDev::Models::MonitorListAccountChangesParams::TargetType] Filter by target type. # - # @param until_ [Time] + # @param until_ [Time] Only include items before this ISO 8601 timestamp. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -208,18 +208,15 @@ def list_account_changes(params = {}) ) end - # Some parameter documentations has been truncated, see - # {ContextDev::Models::MonitorListAccountRunsParams} for more details. - # # Returns an account-wide feed of monitor runs across all monitors. # # @overload list_account_runs(cursor: nil, limit: nil, status: nil, request_options: {}) # - # @param cursor [String] + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # - # @param status [Symbol, ContextDev::Models::MonitorListAccountRunsParams::Status] Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (in + # @param status [Symbol, ContextDev::Models::MonitorListAccountRunsParams::Status] Filter runs by lifecycle status. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -244,15 +241,15 @@ def list_account_runs(params = {}) # # @param monitor_id [String] # - # @param cursor [String] + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # - # @param since [Time] + # @param since [Time] Only include items at or after this ISO 8601 timestamp. # # @param tag [String] Filter to items that have this tag. # - # @param until_ [Time] + # @param until_ [Time] Only include items before this ISO 8601 timestamp. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -271,20 +268,17 @@ def list_changes(monitor_id, params = {}) ) end - # Some parameter documentations has been truncated, see - # {ContextDev::Models::MonitorListRunsParams} for more details. - # # List monitor runs # # @overload list_runs(monitor_id, cursor: nil, limit: nil, status: nil, request_options: {}) # # @param monitor_id [String] # - # @param cursor [String] + # @param cursor [String] Opaque pagination cursor from a previous response. # - # @param limit [Integer] + # @param limit [Integer] Maximum number of items to return per page (1-100). Defaults to 25. # - # @param status [Symbol, ContextDev::Models::MonitorListRunsParams::Status] Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (in + # @param status [Symbol, ContextDev::Models::MonitorListRunsParams::Status] Filter runs by lifecycle status. # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/context_dev/resources/parse.rb b/lib/context_dev/resources/parse.rb index 9da45350..7ff5d4c1 100644 --- a/lib/context_dev/resources/parse.rb +++ b/lib/context_dev/resources/parse.rb @@ -7,29 +7,29 @@ class Parse # {ContextDev::Models::ParseHandleParams} for more details. # # Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes - # into LLM-usable Markdown. The base request costs 1 credit. When OCR runs - # (requires ocr=true), the entire call costs 5 credits; ocr=true requests where no - # OCR ends up running still cost 1 credit. + # into LLM-usable Markdown. # - # @overload handle(body:, extension: nil, include_images: nil, include_links: nil, ocr: nil, pdf: nil, shorten_base64_images: nil, tags: nil, use_main_content_only: nil, request_options: {}) + # @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, request_options: {}) # # @param body [Pathname, StringIO, IO, String, ContextDev::FilePart] Body param # - # @param extension [Symbol, ContextDev::Models::ParseHandleParams::Extension] Query param: Optional file extension hint. Case-insensitive; a leading dot is ac + # @param client [String] Query param: Optional client identifier used for usage attribution. # - # @param include_images [Boolean] Query param: Include image references in Markdown output + # @param extension [Symbol, ContextDev::Models::ParseHandleParams::Extension] Query param: Optional file extension hint, such as pdf, docx, xlsx, pptx, html, # - # @param include_links [Boolean] Query param: Preserve hyperlinks in Markdown output + # @param include_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeImages] Query param: Include image references in Markdown output # - # @param ocr [Boolean] Query param: Gates all OCR. When true, PDFs get embedded-image OCR (recognized t + # @param include_links [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeLinks] Query param: Preserve hyperlinks in Markdown output # - # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] Query param: PDF page-range controls. Use start/end to limit parsing (and OCR wh + # @param ocr [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr] Query param: When true for PDF inputs, detect and OCR images embedded in the sel # - # @param shorten_base64_images [Boolean] Query param: Shorten base64-encoded image data in the Markdown output + # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] Query param: PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5 + # + # @param shorten_base64_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::ShortenBase64Images] Query param: Shorten base64-encoded image data in the Markdown output # # @param tags [Array] Query param: Optional comma-separated caller-defined tags for tracking this requ # - # @param use_main_content_only [Boolean] Query param: Extract only the main content from HTML-like inputs + # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly] Query param: Extract only the main content from HTML-like inputs # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 104a46a5..2fa263ca 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -100,7 +100,7 @@ def extract_competitors(params) # # @param domain [String] Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domai # - # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre + # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # @@ -141,7 +141,7 @@ def extract_fonts(params = {}) # # @param domain [String] Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The # - # @param max_age_ms [Integer] Maximum age in milliseconds for cached data before the API performs a hard refre + # @param max_age_ms [Integer, nil] Maximum age in milliseconds for cached brand data before the API performs a hard # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # @@ -178,7 +178,7 @@ def extract_styleguide(params = {}) # # @param color_scheme [Symbol, ContextDev::Models::WebScreenshotParams::ColorScheme] Optional parameter to choose the site's visual theme in the screenshot. Use 'lig # - # @param country [Symbol, ContextDev::Models::WebScreenshotParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @param country [Symbol, ContextDev::Models::WebScreenshotParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # # @param direct_url [String] A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https # @@ -186,13 +186,13 @@ def extract_styleguide(params = {}) # # @param full_screenshot [Symbol, ContextDev::Models::WebScreenshotParams::FullScreenshot] Optional parameter to determine screenshot type. If 'true', takes a full page sc # - # @param handle_cookie_popup [Symbol, ContextDev::Models::WebScreenshotParams::HandleCookiePopup] Optional parameter to control cookie/consent popup handling. If 'true', we dismi + # @param handle_cookie_popup [Boolean, Symbol, ContextDev::Models::WebScreenshotParams::HandleCookiePopup] Optional parameter to control cookie/consent popup handling. If 'true', we dismi # - # @param max_age_ms [Integer] Return a cached screenshot if a prior screenshot for the same parameters exists + # @param max_age_ms [Integer, nil] Return a cached screenshot if a prior screenshot for the same parameters exists # # @param page [Symbol, ContextDev::Models::WebScreenshotParams::Page] Optional parameter to specify which page type to screenshot. If provided, the sy # - # @param scroll_offset [Integer] Optional vertical scroll offset in pixels for capturing a long page in viewport- + # @param scroll_offset [Integer, nil] Optional vertical scroll offset in pixels for capturing a long page in viewport- # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # @@ -200,7 +200,7 @@ def extract_styleguide(params = {}) # # @param viewport [ContextDev::Models::WebScreenshotParams::Viewport] Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080. # - # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before taking + # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before taking # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -344,29 +344,29 @@ def web_crawl_md(params) # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # - # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # - # @param exclude_selectors [Array] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi + # @param exclude_selectors [Array, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi # # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob # - # @param include_frames [Boolean] When true, iframes are rendered inline into the returned HTML. + # @param include_frames [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::IncludeFrames] When true, iframes are rendered inline into the returned HTML. # - # @param include_selectors [Array] CSS selectors. When provided, only matching subtrees (and their descendants) are + # @param include_selectors [Array, nil] CSS selectors. When provided, only matching subtrees (and their descendants) are # - # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y # # @param pdf [ContextDev::Models::WebWebScrapeHTMLParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image # - # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr + # @param settle_animations [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::SettleAnimations] When true, waits briefly for CSS and transition animations to settle before extr # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # - # @param use_main_content_only [Boolean] When true, return only the page's main content in the HTML response, excluding h + # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::WebWebScrapeHTMLParams::UseMainContentOnly] When true, return only the page's main content in the HTML response, excluding h # - # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load. Min: 0. Max: + # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load. Min: 0. Max: # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -406,19 +406,19 @@ def web_scrape_html(params) # # @param url [String] Page URL to inspect. Must include http:// or https://. # - # @param dedupe [Boolean] When true, visually duplicate images are removed: every image is loaded and perc + # @param dedupe [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Dedupe] When true, visually duplicate images are removed: every image is loaded and perc # - # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment] Optional per-image processing, sent as deep-object query params such as enrichme + # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil] Optional per-image processing, sent as deep-object query params such as enrichme # # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob # - # @param max_age_ms [Integer] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 + # @param max_age_ms [Integer, nil] Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # - # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before collec + # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before collec # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -465,35 +465,35 @@ def web_scrape_images(params) # # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr # - # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # - # @param exclude_selectors [Array] CSS selectors to remove before conversion to Markdown. Applied after includeSele + # @param exclude_selectors [Array, nil] CSS selectors to remove before conversion to Markdown. Applied after includeSele # # @param headers [Hash{Symbol=>String}] Optional outbound HTTP headers forwarded only to the target URL, sent as deep-ob # - # @param include_frames [Boolean] When true, the contents of iframes are rendered to Markdown. + # @param include_frames [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeFrames] When true, the contents of iframes are rendered to Markdown. # - # @param include_images [Boolean] Include image references in Markdown output + # @param include_images [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeImages] Include image references in Markdown output # - # @param include_links [Boolean] Preserve hyperlinks in Markdown output + # @param include_links [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::IncludeLinks] Preserve hyperlinks in Markdown output # - # @param include_selectors [Array] CSS selectors. When provided, only matching HTML subtrees (and their descendants + # @param include_selectors [Array, nil] CSS selectors. When provided, only matching HTML subtrees (and their descendants # - # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y + # @param max_age_ms [Integer, nil] Return a cached result if a prior scrape for the same parameters exists and is y # # @param pdf [ContextDev::Models::WebWebScrapeMdParams::Pdf] PDF parsing controls. Use start/end to limit text extraction and embedded-image # - # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before conv + # @param settle_animations [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::SettleAnimations] When true, waits briefly for CSS and transition animations to settle before conv # - # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output + # @param shorten_base64_images [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images] Shorten base64-encoded image data in the Markdown output # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # - # @param use_main_content_only [Boolean] Extract only the main content of the page, excluding headers, footers, sidebars, + # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::WebWebScrapeMdParams::UseMainContentOnly] Extract only the main content of the page, excluding headers, footers, sidebars, # - # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load before conver + # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before conver # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # @@ -529,7 +529,7 @@ def web_scrape_md(params) # # Crawl an entire website's sitemap and return all discovered page URLs. # - # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, tags: nil, timeout_ms: nil, url_regex: nil, request_options: {}) + # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, request_options: {}) # # @param domain [String] Domain to build a sitemap for # @@ -537,6 +537,8 @@ def web_scrape_md(params) # # @param max_links [Integer] Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Mi # + # @param sitemap_url [String] Optional explicit sitemap URL. When provided, exactly this sitemap is crawled in + # # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th @@ -554,7 +556,12 @@ def web_scrape_sitemap(params) @client.request( method: :get, path: "web/scrape/sitemap", - query: query.transform_keys(max_links: "maxLinks", timeout_ms: "timeoutMS", url_regex: "urlRegex"), + query: query.transform_keys( + max_links: "maxLinks", + sitemap_url: "sitemapUrl", + timeout_ms: "timeoutMS", + url_regex: "urlRegex" + ), model: ContextDev::Models::WebWebScrapeSitemapResponse, options: options ) diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index a5523d3d..52a5e321 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -50,8 +50,6 @@ module ContextDev WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams - WebhookDelivery = ContextDev::Models::WebhookDelivery - WebScreenshotParams = ContextDev::Models::WebScreenshotParams WebSearchParams = ContextDev::Models::WebSearchParams diff --git a/rbi/context_dev/models/brand_retrieve_params.rbi b/rbi/context_dev/models/brand_retrieve_params.rbi index 8b4ddd60..da889614 100644 --- a/rbi/context_dev/models/brand_retrieve_params.rbi +++ b/rbi/context_dev/models/brand_retrieve_params.rbi @@ -106,15 +106,7 @@ module ContextDev ) ) end - attr_reader :force_language - - sig do - params( - force_language: - ContextDev::BrandRetrieveParams::Body::ByDomain::ForceLanguage::OrSymbol - ).void - end - attr_writer :force_language + attr_accessor :force_language # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) @@ -158,7 +150,9 @@ module ContextDev params( domain: String, force_language: - ContextDev::BrandRetrieveParams::Body::ByDomain::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByDomain::ForceLanguage::OrSymbol + ), max_age_ms: Integer, max_speed: T::Boolean, tags: T::Array[String], @@ -198,7 +192,9 @@ module ContextDev domain: String, type: Symbol, force_language: - ContextDev::BrandRetrieveParams::Body::ByDomain::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByDomain::ForceLanguage::OrSymbol + ), max_age_ms: Integer, max_speed: T::Boolean, tags: T::Array[String], @@ -866,15 +862,7 @@ module ContextDev ) ) end - attr_reader :force_language - - sig do - params( - force_language: - ContextDev::BrandRetrieveParams::Body::ByName::ForceLanguage::OrSymbol - ).void - end - attr_writer :force_language + attr_accessor :force_language # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) @@ -920,7 +908,9 @@ module ContextDev name: String, country_gl: String, force_language: - ContextDev::BrandRetrieveParams::Body::ByName::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByName::ForceLanguage::OrSymbol + ), max_age_ms: Integer, max_speed: T::Boolean, tags: T::Array[String], @@ -964,7 +954,9 @@ module ContextDev type: Symbol, country_gl: String, force_language: - ContextDev::BrandRetrieveParams::Body::ByName::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByName::ForceLanguage::OrSymbol + ), max_age_ms: Integer, max_speed: T::Boolean, tags: T::Array[String], @@ -1624,15 +1616,7 @@ module ContextDev ) ) end - attr_reader :force_language - - sig do - params( - force_language: - ContextDev::BrandRetrieveParams::Body::ByEmail::ForceLanguage::OrSymbol - ).void - end - attr_writer :force_language + attr_accessor :force_language # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) @@ -1678,7 +1662,9 @@ module ContextDev params( email: String, force_language: - ContextDev::BrandRetrieveParams::Body::ByEmail::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByEmail::ForceLanguage::OrSymbol + ), max_age_ms: Integer, max_speed: T::Boolean, tags: T::Array[String], @@ -1718,7 +1704,9 @@ module ContextDev email: String, type: Symbol, force_language: - ContextDev::BrandRetrieveParams::Body::ByEmail::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByEmail::ForceLanguage::OrSymbol + ), max_age_ms: Integer, max_speed: T::Boolean, tags: T::Array[String], @@ -2378,15 +2366,7 @@ module ContextDev ) ) end - attr_reader :force_language - - sig do - params( - force_language: - ContextDev::BrandRetrieveParams::Body::ByTicker::ForceLanguage::OrSymbol - ).void - end - attr_writer :force_language + attr_accessor :force_language # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) @@ -2438,7 +2418,9 @@ module ContextDev params( ticker: String, force_language: - ContextDev::BrandRetrieveParams::Body::ByTicker::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByTicker::ForceLanguage::OrSymbol + ), max_age_ms: Integer, max_speed: T::Boolean, tags: T::Array[String], @@ -2481,7 +2463,9 @@ module ContextDev ticker: String, type: Symbol, force_language: - ContextDev::BrandRetrieveParams::Body::ByTicker::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByTicker::ForceLanguage::OrSymbol + ), max_age_ms: Integer, max_speed: T::Boolean, tags: T::Array[String], @@ -3239,15 +3223,7 @@ module ContextDev ) ) end - attr_reader :force_language - - sig do - params( - force_language: - ContextDev::BrandRetrieveParams::Body::ByTransaction::ForceLanguage::OrSymbol - ).void - end - attr_writer :force_language + attr_accessor :force_language # When set to true, the API performs additional verification to ensure the # identified brand matches the transaction with high confidence. @@ -3268,17 +3244,39 @@ module ContextDev # Optional Merchant Category Code (MCC) to help identify the business category or # industry. - sig { returns(T.nilable(Integer)) } + sig do + returns( + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByTransaction::Mcc::Variants + ) + ) + end attr_reader :mcc - sig { params(mcc: Integer).void } + sig do + params( + mcc: + ContextDev::BrandRetrieveParams::Body::ByTransaction::Mcc::Variants + ).void + end attr_writer :mcc # Optional phone number from the transaction to help verify brand match. - sig { returns(T.nilable(Float)) } + sig do + returns( + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByTransaction::Phone::Variants + ) + ) + end attr_reader :phone - sig { params(phone: Float).void } + sig do + params( + phone: + ContextDev::BrandRetrieveParams::Body::ByTransaction::Phone::Variants + ).void + end attr_writer :phone # Optional caller-defined tags for tracking this request. Tags are recorded on the @@ -3307,11 +3305,15 @@ module ContextDev city: String, country_gl: String, force_language: - ContextDev::BrandRetrieveParams::Body::ByTransaction::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByTransaction::ForceLanguage::OrSymbol + ), high_confidence_only: T::Boolean, max_speed: T::Boolean, - mcc: Integer, - phone: Float, + mcc: + ContextDev::BrandRetrieveParams::Body::ByTransaction::Mcc::Variants, + phone: + ContextDev::BrandRetrieveParams::Body::ByTransaction::Phone::Variants, tags: T::Array[String], timeout_ms: Integer, type: Symbol @@ -3359,11 +3361,15 @@ module ContextDev city: String, country_gl: String, force_language: - ContextDev::BrandRetrieveParams::Body::ByTransaction::ForceLanguage::OrSymbol, + T.nilable( + ContextDev::BrandRetrieveParams::Body::ByTransaction::ForceLanguage::OrSymbol + ), high_confidence_only: T::Boolean, max_speed: T::Boolean, - mcc: Integer, - phone: Float, + mcc: + ContextDev::BrandRetrieveParams::Body::ByTransaction::Mcc::Variants, + phone: + ContextDev::BrandRetrieveParams::Body::ByTransaction::Phone::Variants, tags: T::Array[String], timeout_ms: Integer } @@ -3995,6 +4001,41 @@ module ContextDev def self.values end end + + # Optional Merchant Category Code (MCC) to help identify the business category or + # industry. + module Mcc + extend ContextDev::Internal::Type::Union + + Variants = T.type_alias { T.any(String, Float) } + + sig do + override.returns( + T::Array[ + ContextDev::BrandRetrieveParams::Body::ByTransaction::Mcc::Variants + ] + ) + end + def self.variants + end + end + + # Optional phone number from the transaction to help verify brand match. + module Phone + extend ContextDev::Internal::Type::Union + + Variants = T.type_alias { T.any(String, Float) } + + sig do + override.returns( + T::Array[ + ContextDev::BrandRetrieveParams::Body::ByTransaction::Phone::Variants + ] + ) + end + def self.variants + end + end end sig do diff --git a/rbi/context_dev/models/brand_retrieve_response.rbi b/rbi/context_dev/models/brand_retrieve_response.rbi index c44d0b76..af130880 100644 --- a/rbi/context_dev/models/brand_retrieve_response.rbi +++ b/rbi/context_dev/models/brand_retrieve_response.rbi @@ -247,8 +247,7 @@ module ContextDev sig { params(phone: String).void } attr_writer :phone - # The primary language of the brand's website content. Detected from the HTML lang - # tag, page content analysis, or social media descriptions. + # Language to force for the retrieved brand data. sig do returns( T.nilable( @@ -372,8 +371,7 @@ module ContextDev logos: nil, # Company phone number phone: nil, - # The primary language of the brand's website content. Detected from the HTML lang - # tag, page content analysis, or social media descriptions. + # Language to force for the retrieved brand data. primary_language: nil, # The brand's slogan slogan: nil, @@ -1280,11 +1278,6 @@ module ContextDev :"Creator Economy & Influencer Platforms", ContextDev::Models::BrandRetrieveResponse::Brand::Industries::Eic::Subindustry::TaggedSymbol ) - ADVERTISING_ADTECH_MEDIA_BUYING = - T.let( - :"Advertising, Adtech & Media Buying", - ContextDev::Models::BrandRetrieveResponse::Brand::Industries::Eic::Subindustry::TaggedSymbol - ) FILM_TV_PRODUCTION_STUDIOS = T.let( :"Film, TV & Production Studios", @@ -1585,6 +1578,11 @@ module ContextDev :"News Publishing & Journalism", ContextDev::Models::BrandRetrieveResponse::Brand::Industries::Eic::Subindustry::TaggedSymbol ) + ADVERTISING_ADTECH_MEDIA_BUYING = + T.let( + :"Advertising, Adtech & Media Buying", + ContextDev::Models::BrandRetrieveResponse::Brand::Industries::Eic::Subindustry::TaggedSymbol + ) DIGITAL_MEDIA_CONTENT_PLATFORMS = T.let( :"Digital Media & Content Platforms", @@ -2537,8 +2535,7 @@ module ContextDev end end - # The primary language of the brand's website content. Detected from the HTML lang - # tag, page content analysis, or social media descriptions. + # Language to force for the retrieved brand data. module PrimaryLanguage extend ContextDev::Internal::Type::Enum diff --git a/rbi/context_dev/models/brand_retrieve_simplified_params.rbi b/rbi/context_dev/models/brand_retrieve_simplified_params.rbi index a8c67937..7616dfb1 100644 --- a/rbi/context_dev/models/brand_retrieve_simplified_params.rbi +++ b/rbi/context_dev/models/brand_retrieve_simplified_params.rbi @@ -23,10 +23,7 @@ module ContextDev # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. sig { returns(T.nilable(Integer)) } - attr_reader :max_age_ms - - sig { params(max_age_ms: Integer).void } - attr_writer :max_age_ms + attr_accessor :max_age_ms # Optional comma-separated caller-defined tags for tracking this request. Tags are # recorded on the request's usage log and can be used to filter usage on the @@ -37,6 +34,21 @@ module ContextDev sig { params(tags: T::Array[String]).void } attr_writer :tags + # Optional theme preference used when selecting brand assets. + sig do + returns( + T.nilable(ContextDev::BrandRetrieveSimplifiedParams::Theme::OrSymbol) + ) + end + attr_reader :theme + + sig do + params( + theme: ContextDev::BrandRetrieveSimplifiedParams::Theme::OrSymbol + ).void + end + attr_writer :theme + # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -49,8 +61,9 @@ module ContextDev sig do params( domain: String, - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], + theme: ContextDev::BrandRetrieveSimplifiedParams::Theme::OrSymbol, timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) @@ -67,6 +80,8 @@ module ContextDev # recorded on the request's usage log and can be used to filter usage on the # dashboard usage page. Up to 20 tags, each 1-50 characters. tags: nil, + # Optional theme preference used when selecting brand assets. + theme: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). @@ -79,8 +94,9 @@ module ContextDev override.returns( { domain: String, - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], + theme: ContextDev::BrandRetrieveSimplifiedParams::Theme::OrSymbol, timeout_ms: Integer, request_options: ContextDev::RequestOptions } @@ -88,6 +104,38 @@ module ContextDev end def to_hash end + + # Optional theme preference used when selecting brand assets. + module Theme + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::BrandRetrieveSimplifiedParams::Theme) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIGHT = + T.let( + :light, + ContextDev::BrandRetrieveSimplifiedParams::Theme::TaggedSymbol + ) + DARK = + T.let( + :dark, + ContextDev::BrandRetrieveSimplifiedParams::Theme::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::BrandRetrieveSimplifiedParams::Theme::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/context_dev/models/monitor_list_account_changes_params.rbi b/rbi/context_dev/models/monitor_list_account_changes_params.rbi index ebdf5a72..79549167 100644 --- a/rbi/context_dev/models/monitor_list_account_changes_params.rbi +++ b/rbi/context_dev/models/monitor_list_account_changes_params.rbi @@ -14,6 +14,7 @@ module ContextDev ) end + # Filter by change detection type. sig do returns( T.nilable( @@ -31,24 +32,28 @@ module ContextDev end attr_writer :change_detection_type + # Opaque pagination cursor from a previous response. sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor + # Maximum number of items to return per page (1-100). Defaults to 25. sig { returns(T.nilable(Integer)) } attr_reader :limit sig { params(limit: Integer).void } attr_writer :limit + # Filter changes to a single monitor. sig { returns(T.nilable(String)) } attr_reader :monitor_id sig { params(monitor_id: String).void } attr_writer :monitor_id + # Only include items at or after this ISO 8601 timestamp. sig { returns(T.nilable(Time)) } attr_reader :since @@ -62,6 +67,7 @@ module ContextDev sig { params(tag: String).void } attr_writer :tag + # Filter by target type. sig do returns( T.nilable( @@ -79,6 +85,7 @@ module ContextDev end attr_writer :target_type + # Only include items before this ISO 8601 timestamp. sig { returns(T.nilable(Time)) } attr_reader :until_ @@ -101,14 +108,21 @@ module ContextDev ).returns(T.attached_class) end def self.new( + # Filter by change detection type. change_detection_type: nil, + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, + # Filter changes to a single monitor. monitor_id: nil, + # Only include items at or after this ISO 8601 timestamp. since: nil, # Filter to items that have this tag. tag: nil, + # Filter by target type. target_type: nil, + # Only include items before this ISO 8601 timestamp. until_: nil, request_options: {} ) @@ -134,6 +148,7 @@ module ContextDev def to_hash end + # Filter by change detection type. module ChangeDetectionType extend ContextDev::Internal::Type::Enum @@ -168,6 +183,7 @@ module ContextDev end end + # Filter by target type. module TargetType extend ContextDev::Internal::Type::Enum diff --git a/rbi/context_dev/models/monitor_list_account_runs_params.rbi b/rbi/context_dev/models/monitor_list_account_runs_params.rbi index 60f5016b..582b244b 100644 --- a/rbi/context_dev/models/monitor_list_account_runs_params.rbi +++ b/rbi/context_dev/models/monitor_list_account_runs_params.rbi @@ -14,20 +14,21 @@ module ContextDev ) end + # Opaque pagination cursor from a previous response. sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor + # Maximum number of items to return per page (1-100). Defaults to 25. sig { returns(T.nilable(Integer)) } attr_reader :limit sig { params(limit: Integer).void } attr_writer :limit - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. sig do returns( T.nilable(ContextDev::MonitorListAccountRunsParams::Status::OrSymbol) @@ -51,10 +52,11 @@ module ContextDev ).returns(T.attached_class) end def self.new( + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. status: nil, request_options: {} ) @@ -73,8 +75,7 @@ module ContextDev def to_hash end - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. module Status extend ContextDev::Internal::Type::Enum diff --git a/rbi/context_dev/models/monitor_list_account_runs_response.rbi b/rbi/context_dev/models/monitor_list_account_runs_response.rbi index 51275f7b..3ce6f16d 100644 --- a/rbi/context_dev/models/monitor_list_account_runs_response.rbi +++ b/rbi/context_dev/models/monitor_list_account_runs_response.rbi @@ -151,12 +151,23 @@ module ContextDev # All webhook deliveries attempted by this run — one per subscribed event that # fired. Omitted when no webhook was attempted, including runs created before # event selection was added. - sig { returns(T.nilable(T::Array[ContextDev::WebhookDelivery])) } + sig do + returns( + T.nilable( + T::Array[ + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery + ] + ) + ) + end attr_reader :webhook_deliveries sig do params( - webhook_deliveries: T::Array[ContextDev::WebhookDelivery::OrHash] + webhook_deliveries: + T::Array[ + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::OrHash + ] ).void end attr_writer :webhook_deliveries @@ -164,11 +175,20 @@ module ContextDev # Deprecated: use `webhook_deliveries`, which records every attempt now that a run # can deliver multiple events. Omitted when no webhook was attempted, including # historical runs created before delivery tracking was added. - sig { returns(T.nilable(ContextDev::WebhookDelivery)) } + sig do + returns( + T.nilable( + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery + ) + ) + end attr_reader :webhook_delivery sig do - params(webhook_delivery: ContextDev::WebhookDelivery::OrHash).void + params( + webhook_delivery: + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::OrHash + ).void end attr_writer :webhook_delivery @@ -198,8 +218,12 @@ module ContextDev ContextDev::Models::MonitorListAccountRunsResponse::Data::SkipReason::OrSymbol ), started_at: T.nilable(Time), - webhook_deliveries: T::Array[ContextDev::WebhookDelivery::OrHash], - webhook_delivery: ContextDev::WebhookDelivery::OrHash + webhook_deliveries: + T::Array[ + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::OrHash + ], + webhook_delivery: + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::OrHash ).returns(T.attached_class) end def self.new( @@ -262,8 +286,12 @@ module ContextDev ContextDev::Models::MonitorListAccountRunsResponse::Data::SkipReason::TaggedSymbol ), started_at: T.nilable(Time), - webhook_deliveries: T::Array[ContextDev::WebhookDelivery], - webhook_delivery: ContextDev::WebhookDelivery + webhook_deliveries: + T::Array[ + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery + ], + webhook_delivery: + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery } ) end @@ -494,6 +522,228 @@ module ContextDev def self.values end end + + class WebhookDelivery < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Time) } + attr_accessor :attempted_at + + sig do + returns( + T.nilable( + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error + ) + ) + end + attr_reader :error + + sig do + params( + error: + T.nilable( + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error::OrHash + ) + ).void + end + attr_writer :error + + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + sig do + returns( + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol + ) + end + attr_accessor :event + + # Identifier sent in the X-Context-Id header. + sig { returns(String) } + attr_accessor :event_id + + # The endpoint's final HTTP response status, or null when no response was + # received. + sig { returns(T.nilable(Integer)) } + attr_accessor :http_status + + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + sig do + returns( + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig do + params( + attempted_at: Time, + error: + T.nilable( + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error::OrHash + ), + event: + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::OrSymbol, + event_id: String, + http_status: T.nilable(Integer), + status: + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + attempted_at:, + error:, + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + event:, + # Identifier sent in the X-Context-Id header. + event_id:, + # The endpoint's final HTTP response status, or null when no response was + # received. + http_status:, + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + status: + ) + end + + sig do + override.returns( + { + attempted_at: Time, + error: + T.nilable( + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error + ), + event: + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol, + event_id: String, + http_status: T.nilable(Integer), + status: + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + } + ) + end + def to_hash + end + + class Error < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :message + + sig do + params(code: String, message: String).returns(T.attached_class) + end + def self.new(code:, message:) + end + + sig { override.returns({ code: String, message: String }) } + def to_hash + end + end + + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + module Event + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHANGE_DETECTED = + T.let( + :"change.detected", + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol + ) + RUN_COMPLETED = + T.let( + :"run.completed", + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + module Status + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DELIVERED = + T.let( + :delivered, + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + SKIPPED_UNSAFE_URL = + T.let( + :skipped_unsafe_url, + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/context_dev/models/monitor_list_changes_params.rbi b/rbi/context_dev/models/monitor_list_changes_params.rbi index 263fc62c..97f0b655 100644 --- a/rbi/context_dev/models/monitor_list_changes_params.rbi +++ b/rbi/context_dev/models/monitor_list_changes_params.rbi @@ -17,18 +17,21 @@ module ContextDev sig { returns(String) } attr_accessor :monitor_id + # Opaque pagination cursor from a previous response. sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor + # Maximum number of items to return per page (1-100). Defaults to 25. sig { returns(T.nilable(Integer)) } attr_reader :limit sig { params(limit: Integer).void } attr_writer :limit + # Only include items at or after this ISO 8601 timestamp. sig { returns(T.nilable(Time)) } attr_reader :since @@ -42,6 +45,7 @@ module ContextDev sig { params(tag: String).void } attr_writer :tag + # Only include items before this ISO 8601 timestamp. sig { returns(T.nilable(Time)) } attr_reader :until_ @@ -61,11 +65,15 @@ module ContextDev end def self.new( monitor_id:, + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, + # Only include items at or after this ISO 8601 timestamp. since: nil, # Filter to items that have this tag. tag: nil, + # Only include items before this ISO 8601 timestamp. until_: nil, request_options: {} ) diff --git a/rbi/context_dev/models/monitor_list_params.rbi b/rbi/context_dev/models/monitor_list_params.rbi index dfabf2cf..5545f7c0 100644 --- a/rbi/context_dev/models/monitor_list_params.rbi +++ b/rbi/context_dev/models/monitor_list_params.rbi @@ -11,6 +11,7 @@ module ContextDev T.any(ContextDev::MonitorListParams, ContextDev::Internal::AnyHash) end + # Filter by change detection type. sig do returns( T.nilable( @@ -28,12 +29,14 @@ module ContextDev end attr_writer :change_detection_type + # Opaque pagination cursor from a previous response. sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor + # Maximum number of items to return per page (1-100). Defaults to 25. sig { returns(T.nilable(Integer)) } attr_reader :limit @@ -54,14 +57,7 @@ module ContextDev T.nilable(T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol]) ) end - attr_reader :search_by - - sig do - params( - search_by: T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol] - ).void - end - attr_writer :search_by + attr_accessor :search_by # `prefix` for as-you-type prefix matching (default), `exact` for full-token # matching. @@ -77,11 +73,7 @@ module ContextDev end attr_writer :search_type - # Monitor lifecycle status. `failed` means the most recent run failed (see the - # monitor's `last_error`); failed monitors keep running on schedule and flip back - # to `active` on the next successful run. Monitors are auto-`paused` after - # repeated consecutive failures or insufficient-credit skips; resume by PATCHing - # status to `active`. + # Filter monitors by lifecycle status. sig do returns(T.nilable(ContextDev::MonitorListParams::Status::OrSymbol)) end @@ -101,11 +93,9 @@ module ContextDev # Comma-separated list of tags to filter by (matches monitors having any of them). sig { returns(T.nilable(T::Array[String])) } - attr_reader :tags - - sig { params(tags: T::Array[String]).void } - attr_writer :tags + attr_accessor :tags + # Filter by target type. sig do returns(T.nilable(ContextDev::MonitorListParams::TargetType::OrSymbol)) end @@ -126,18 +116,23 @@ module ContextDev limit: Integer, q: String, search_by: - T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol], + T.nilable( + T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol] + ), search_type: ContextDev::MonitorListParams::SearchType::OrSymbol, status: ContextDev::MonitorListParams::Status::OrSymbol, tag: String, - tags: T::Array[String], + tags: T.nilable(T::Array[String]), target_type: ContextDev::MonitorListParams::TargetType::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( + # Filter by change detection type. change_detection_type: nil, + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, # Free-text search term, matched against the fields named in `search_by`. q: nil, @@ -147,16 +142,13 @@ module ContextDev # `prefix` for as-you-type prefix matching (default), `exact` for full-token # matching. search_type: nil, - # Monitor lifecycle status. `failed` means the most recent run failed (see the - # monitor's `last_error`); failed monitors keep running on schedule and flip back - # to `active` on the next successful run. Monitors are auto-`paused` after - # repeated consecutive failures or insufficient-credit skips; resume by PATCHing - # status to `active`. + # Filter monitors by lifecycle status. status: nil, # Filter to items that have this tag. tag: nil, # Comma-separated list of tags to filter by (matches monitors having any of them). tags: nil, + # Filter by target type. target_type: nil, request_options: {} ) @@ -171,11 +163,13 @@ module ContextDev limit: Integer, q: String, search_by: - T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol], + T.nilable( + T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol] + ), search_type: ContextDev::MonitorListParams::SearchType::OrSymbol, status: ContextDev::MonitorListParams::Status::OrSymbol, tag: String, - tags: T::Array[String], + tags: T.nilable(T::Array[String]), target_type: ContextDev::MonitorListParams::TargetType::OrSymbol, request_options: ContextDev::RequestOptions } @@ -184,6 +178,7 @@ module ContextDev def to_hash end + # Filter by change detection type. module ChangeDetectionType extend ContextDev::Internal::Type::Enum @@ -272,11 +267,7 @@ module ContextDev end end - # Monitor lifecycle status. `failed` means the most recent run failed (see the - # monitor's `last_error`); failed monitors keep running on schedule and flip back - # to `active` on the next successful run. Monitors are auto-`paused` after - # repeated consecutive failures or insufficient-credit skips; resume by PATCHing - # status to `active`. + # Filter monitors by lifecycle status. module Status extend ContextDev::Internal::Type::Enum @@ -300,6 +291,7 @@ module ContextDev end end + # Filter by target type. module TargetType extend ContextDev::Internal::Type::Enum diff --git a/rbi/context_dev/models/monitor_list_runs_params.rbi b/rbi/context_dev/models/monitor_list_runs_params.rbi index 3ae68c16..0b949114 100644 --- a/rbi/context_dev/models/monitor_list_runs_params.rbi +++ b/rbi/context_dev/models/monitor_list_runs_params.rbi @@ -17,20 +17,21 @@ module ContextDev sig { returns(String) } attr_accessor :monitor_id + # Opaque pagination cursor from a previous response. sig { returns(T.nilable(String)) } attr_reader :cursor sig { params(cursor: String).void } attr_writer :cursor + # Maximum number of items to return per page (1-100). Defaults to 25. sig { returns(T.nilable(Integer)) } attr_reader :limit sig { params(limit: Integer).void } attr_writer :limit - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. sig do returns(T.nilable(ContextDev::MonitorListRunsParams::Status::OrSymbol)) end @@ -52,10 +53,11 @@ module ContextDev end def self.new( monitor_id:, + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. status: nil, request_options: {} ) @@ -75,8 +77,7 @@ module ContextDev def to_hash end - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. module Status extend ContextDev::Internal::Type::Enum diff --git a/rbi/context_dev/models/monitor_list_runs_response.rbi b/rbi/context_dev/models/monitor_list_runs_response.rbi index 7d2def95..0c43c1a6 100644 --- a/rbi/context_dev/models/monitor_list_runs_response.rbi +++ b/rbi/context_dev/models/monitor_list_runs_response.rbi @@ -142,12 +142,23 @@ module ContextDev # All webhook deliveries attempted by this run — one per subscribed event that # fired. Omitted when no webhook was attempted, including runs created before # event selection was added. - sig { returns(T.nilable(T::Array[ContextDev::WebhookDelivery])) } + sig do + returns( + T.nilable( + T::Array[ + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery + ] + ) + ) + end attr_reader :webhook_deliveries sig do params( - webhook_deliveries: T::Array[ContextDev::WebhookDelivery::OrHash] + webhook_deliveries: + T::Array[ + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::OrHash + ] ).void end attr_writer :webhook_deliveries @@ -155,11 +166,20 @@ module ContextDev # Deprecated: use `webhook_deliveries`, which records every attempt now that a run # can deliver multiple events. Omitted when no webhook was attempted, including # historical runs created before delivery tracking was added. - sig { returns(T.nilable(ContextDev::WebhookDelivery)) } + sig do + returns( + T.nilable( + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery + ) + ) + end attr_reader :webhook_delivery sig do - params(webhook_delivery: ContextDev::WebhookDelivery::OrHash).void + params( + webhook_delivery: + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::OrHash + ).void end attr_writer :webhook_delivery @@ -189,8 +209,12 @@ module ContextDev ContextDev::Models::MonitorListRunsResponse::Data::SkipReason::OrSymbol ), started_at: T.nilable(Time), - webhook_deliveries: T::Array[ContextDev::WebhookDelivery::OrHash], - webhook_delivery: ContextDev::WebhookDelivery::OrHash + webhook_deliveries: + T::Array[ + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::OrHash + ], + webhook_delivery: + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::OrHash ).returns(T.attached_class) end def self.new( @@ -253,8 +277,12 @@ module ContextDev ContextDev::Models::MonitorListRunsResponse::Data::SkipReason::TaggedSymbol ), started_at: T.nilable(Time), - webhook_deliveries: T::Array[ContextDev::WebhookDelivery], - webhook_delivery: ContextDev::WebhookDelivery + webhook_deliveries: + T::Array[ + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery + ], + webhook_delivery: + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery } ) end @@ -485,6 +513,228 @@ module ContextDev def self.values end end + + class WebhookDelivery < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Time) } + attr_accessor :attempted_at + + sig do + returns( + T.nilable( + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error + ) + ) + end + attr_reader :error + + sig do + params( + error: + T.nilable( + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error::OrHash + ) + ).void + end + attr_writer :error + + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + sig do + returns( + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol + ) + end + attr_accessor :event + + # Identifier sent in the X-Context-Id header. + sig { returns(String) } + attr_accessor :event_id + + # The endpoint's final HTTP response status, or null when no response was + # received. + sig { returns(T.nilable(Integer)) } + attr_accessor :http_status + + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + sig do + returns( + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig do + params( + attempted_at: Time, + error: + T.nilable( + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error::OrHash + ), + event: + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::OrSymbol, + event_id: String, + http_status: T.nilable(Integer), + status: + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + attempted_at:, + error:, + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + event:, + # Identifier sent in the X-Context-Id header. + event_id:, + # The endpoint's final HTTP response status, or null when no response was + # received. + http_status:, + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + status: + ) + end + + sig do + override.returns( + { + attempted_at: Time, + error: + T.nilable( + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error + ), + event: + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol, + event_id: String, + http_status: T.nilable(Integer), + status: + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + } + ) + end + def to_hash + end + + class Error < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :message + + sig do + params(code: String, message: String).returns(T.attached_class) + end + def self.new(code:, message:) + end + + sig { override.returns({ code: String, message: String }) } + def to_hash + end + end + + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + module Event + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHANGE_DETECTED = + T.let( + :"change.detected", + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol + ) + RUN_COMPLETED = + T.let( + :"run.completed", + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + module Status + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DELIVERED = + T.let( + :delivered, + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + SKIPPED_UNSAFE_URL = + T.let( + :skipped_unsafe_url, + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end end end end diff --git a/rbi/context_dev/models/parse_handle_params.rbi b/rbi/context_dev/models/parse_handle_params.rbi index 0ab3c2bc..07573ba4 100644 --- a/rbi/context_dev/models/parse_handle_params.rbi +++ b/rbi/context_dev/models/parse_handle_params.rbi @@ -14,8 +14,15 @@ module ContextDev sig { returns(ContextDev::Internal::FileInput) } attr_accessor :body - # Optional file extension hint. Case-insensitive; a leading dot is accepted (e.g. - # ".pdf"). + # Optional client identifier used for usage attribution. + sig { returns(T.nilable(String)) } + attr_reader :client + + sig { params(client: String).void } + attr_writer :client + + # Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, + # md, py, rtf, jpg, png, or txt. sig do returns(T.nilable(ContextDev::ParseHandleParams::Extension::OrSymbol)) end @@ -29,34 +36,74 @@ module ContextDev attr_writer :extension # Include image references in Markdown output - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeImages::OrSymbol + ) + ) + ) + end attr_reader :include_images - sig { params(include_images: T::Boolean).void } + sig do + params( + include_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeImages::OrSymbol + ) + ).void + end attr_writer :include_images # Preserve hyperlinks in Markdown output - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeLinks::OrSymbol + ) + ) + ) + end attr_reader :include_links - sig { params(include_links: T::Boolean).void } + sig do + params( + include_links: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeLinks::OrSymbol + ) + ).void + end attr_writer :include_links - # Gates all OCR. When true, PDFs get embedded-image OCR (recognized text inserted - # at each image's position in page reading order, preserving the text layer; - # pdf.start/pdf.end limit the page range), scanned PDFs with no text layer get - # full-document OCR, and raster images get their visible text transcribed. When - # false, no OCR runs: scanned PDFs may yield no content and images return only - # format/dimension metadata. Calls where OCR actually runs cost 5 credits instead - # of 1. - sig { returns(T.nilable(T::Boolean)) } + # When true for PDF inputs, detect and OCR images embedded in the selected pages, + # inserting recognized text at each image's position in page reading order while + # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. + # When false, all OCR is disabled, including the automatic scanned-PDF fallback. + sig do + returns( + T.nilable( + T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::OrSymbol) + ) + ) + end attr_reader :ocr - sig { params(ocr: T::Boolean).void } + sig do + params( + ocr: T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::OrSymbol) + ).void + end attr_writer :ocr - # PDF page-range controls. Use start/end to limit parsing (and OCR when ocr=true) - # to an inclusive 1-based page range. + # PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. sig { returns(T.nilable(ContextDev::ParseHandleParams::Pdf)) } attr_reader :pdf @@ -64,10 +111,27 @@ module ContextDev attr_writer :pdf # Shorten base64-encoded image data in the Markdown output - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol + ) + ) + ) + end attr_reader :shorten_base64_images - sig { params(shorten_base64_images: T::Boolean).void } + sig do + params( + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol + ) + ).void + end attr_writer :shorten_base64_images # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -80,45 +144,77 @@ module ContextDev attr_writer :tags # Extract only the main content from HTML-like inputs - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol + ) + ) + ) + end attr_reader :use_main_content_only - sig { params(use_main_content_only: T::Boolean).void } + sig do + params( + use_main_content_only: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol + ) + ).void + end attr_writer :use_main_content_only sig do params( body: ContextDev::Internal::FileInput, + client: String, extension: ContextDev::ParseHandleParams::Extension::OrSymbol, - include_images: T::Boolean, - include_links: T::Boolean, - ocr: T::Boolean, + include_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeImages::OrSymbol + ), + include_links: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeLinks::OrSymbol + ), + ocr: T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::OrSymbol), pdf: ContextDev::ParseHandleParams::Pdf::OrHash, - shorten_base64_images: T::Boolean, + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol + ), tags: T::Array[String], - use_main_content_only: T::Boolean, + use_main_content_only: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol + ), request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( body:, - # Optional file extension hint. Case-insensitive; a leading dot is accepted (e.g. - # ".pdf"). + # Optional client identifier used for usage attribution. + client: nil, + # Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, + # md, py, rtf, jpg, png, or txt. extension: nil, # Include image references in Markdown output include_images: nil, # Preserve hyperlinks in Markdown output include_links: nil, - # Gates all OCR. When true, PDFs get embedded-image OCR (recognized text inserted - # at each image's position in page reading order, preserving the text layer; - # pdf.start/pdf.end limit the page range), scanned PDFs with no text layer get - # full-document OCR, and raster images get their visible text transcribed. When - # false, no OCR runs: scanned PDFs may yield no content and images return only - # format/dimension metadata. Calls where OCR actually runs cost 5 credits instead - # of 1. + # When true for PDF inputs, detect and OCR images embedded in the selected pages, + # inserting recognized text at each image's position in page reading order while + # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. + # When false, all OCR is disabled, including the automatic scanned-PDF fallback. ocr: nil, - # PDF page-range controls. Use start/end to limit parsing (and OCR when ocr=true) - # to an inclusive 1-based page range. + # PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. pdf: nil, # Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, @@ -136,14 +232,32 @@ module ContextDev override.returns( { body: ContextDev::Internal::FileInput, + client: String, extension: ContextDev::ParseHandleParams::Extension::OrSymbol, - include_images: T::Boolean, - include_links: T::Boolean, - ocr: T::Boolean, + include_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeImages::OrSymbol + ), + include_links: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeLinks::OrSymbol + ), + ocr: + T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::OrSymbol), pdf: ContextDev::ParseHandleParams::Pdf, - shorten_base64_images: T::Boolean, + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol + ), tags: T::Array[String], - use_main_content_only: T::Boolean, + use_main_content_only: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol + ), request_options: ContextDev::RequestOptions } ) @@ -151,8 +265,8 @@ module ContextDev def to_hash end - # Optional file extension hint. Case-insensitive; a leading dot is accepted (e.g. - # ".pdf"). + # Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, + # md, py, rtf, jpg, png, or txt. module Extension extend ContextDev::Internal::Type::Enum @@ -309,6 +423,110 @@ module ContextDev end end + # Include image references in Markdown output + module IncludeImages + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeImages::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ContextDev::ParseHandleParams::IncludeImages::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::ParseHandleParams::IncludeImages) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::ParseHandleParams::IncludeImages::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::ParseHandleParams::IncludeImages::TaggedSymbol + ) + end + + # Preserve hyperlinks in Markdown output + module IncludeLinks + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeLinks::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ContextDev::ParseHandleParams::IncludeLinks::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::ParseHandleParams::IncludeLinks) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::ParseHandleParams::IncludeLinks::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::ParseHandleParams::IncludeLinks::TaggedSymbol + ) + end + + # When true for PDF inputs, detect and OCR images embedded in the selected pages, + # inserting recognized text at each image's position in page reading order while + # preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. + # When false, all OCR is disabled, including the automatic scanned-PDF fallback. + module Ocr + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::TaggedSymbol) + end + + sig do + override.returns( + T::Array[ContextDev::ParseHandleParams::Ocr::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias { T.all(Symbol, ContextDev::ParseHandleParams::Ocr) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = T.let(:true, ContextDev::ParseHandleParams::Ocr::TaggedSymbol) + FALSE = T.let(:false, ContextDev::ParseHandleParams::Ocr::TaggedSymbol) + end + class Pdf < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do @@ -333,8 +551,7 @@ module ContextDev sig { params(start: Integer).void } attr_writer :start - # PDF page-range controls. Use start/end to limit parsing (and OCR when ocr=true) - # to an inclusive 1-based page range. + # PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. sig { params(end_: Integer, start: Integer).returns(T.attached_class) } def self.new( # Last 1-based PDF page to parse. When omitted, parsing ends at the last page. @@ -349,6 +566,86 @@ module ContextDev def to_hash end end + + # Shorten base64-encoded image data in the Markdown output + module ShortenBase64Images + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::ParseHandleParams::ShortenBase64Images::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::ParseHandleParams::ShortenBase64Images::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::ParseHandleParams::ShortenBase64Images) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::ParseHandleParams::ShortenBase64Images::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::ParseHandleParams::ShortenBase64Images::TaggedSymbol + ) + end + + # Extract only the main content from HTML-like inputs + module UseMainContentOnly + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::ParseHandleParams::UseMainContentOnly::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::ParseHandleParams::UseMainContentOnly::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::ParseHandleParams::UseMainContentOnly) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::ParseHandleParams::UseMainContentOnly::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::ParseHandleParams::UseMainContentOnly::TaggedSymbol + ) + end end end end diff --git a/rbi/context_dev/models/web_extract_fonts_params.rbi b/rbi/context_dev/models/web_extract_fonts_params.rbi index 027885da..22447e19 100644 --- a/rbi/context_dev/models/web_extract_fonts_params.rbi +++ b/rbi/context_dev/models/web_extract_fonts_params.rbi @@ -32,15 +32,12 @@ module ContextDev sig { params(domain: String).void } attr_writer :domain - # Maximum age in milliseconds for cached data before the API performs a hard + # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. sig { returns(T.nilable(Integer)) } - attr_reader :max_age_ms - - sig { params(max_age_ms: Integer).void } - attr_writer :max_age_ms + attr_accessor :max_age_ms # Optional comma-separated caller-defined tags for tracking this request. Tags are # recorded on the request's usage log and can be used to filter usage on the @@ -64,7 +61,7 @@ module ContextDev params( direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -79,7 +76,7 @@ module ContextDev # domain will be automatically normalized and validated. You must provide either # 'domain' or 'directUrl', but not both. domain: nil, - # Maximum age in milliseconds for cached data before the API performs a hard + # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. @@ -101,7 +98,7 @@ module ContextDev { direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions diff --git a/rbi/context_dev/models/web_extract_styleguide_params.rbi b/rbi/context_dev/models/web_extract_styleguide_params.rbi index e3c0e544..53958f9d 100644 --- a/rbi/context_dev/models/web_extract_styleguide_params.rbi +++ b/rbi/context_dev/models/web_extract_styleguide_params.rbi @@ -52,15 +52,12 @@ module ContextDev sig { params(domain: String).void } attr_writer :domain - # Maximum age in milliseconds for cached data before the API performs a hard + # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. sig { returns(T.nilable(Integer)) } - attr_reader :max_age_ms - - sig { params(max_age_ms: Integer).void } - attr_writer :max_age_ms + attr_accessor :max_age_ms # Optional comma-separated caller-defined tags for tracking this request. Tags are # recorded on the request's usage log and can be used to filter usage on the @@ -86,7 +83,7 @@ module ContextDev ContextDev::WebExtractStyleguideParams::ColorScheme::OrSymbol, direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -105,7 +102,7 @@ module ContextDev # domain will be automatically normalized and validated. You must provide either # 'domain' or 'directUrl', but not both. domain: nil, - # Maximum age in milliseconds for cached data before the API performs a hard + # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. @@ -129,7 +126,7 @@ module ContextDev ContextDev::WebExtractStyleguideParams::ColorScheme::OrSymbol, direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions diff --git a/rbi/context_dev/models/web_screenshot_params.rbi b/rbi/context_dev/models/web_screenshot_params.rbi index 0fd8f6c7..47f2168e 100644 --- a/rbi/context_dev/models/web_screenshot_params.rbi +++ b/rbi/context_dev/models/web_screenshot_params.rbi @@ -27,8 +27,9 @@ module ContextDev end attr_writer :color_scheme - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. sig do returns(T.nilable(ContextDev::WebScreenshotParams::Country::OrSymbol)) end @@ -81,7 +82,10 @@ module ContextDev sig do returns( T.nilable( - ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol + T.any( + T::Boolean, + ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol + ) ) ) end @@ -90,7 +94,10 @@ module ContextDev sig do params( handle_cookie_popup: - ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol + T.any( + T::Boolean, + ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol + ) ).void end attr_writer :handle_cookie_popup @@ -99,10 +106,7 @@ module ContextDev # and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when # omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh. sig { returns(T.nilable(Integer)) } - attr_reader :max_age_ms - - sig { params(max_age_ms: Integer).void } - attr_writer :max_age_ms + attr_accessor :max_age_ms # Optional parameter to specify which page type to screenshot. If provided, the # system will scrape the domain's links and use heuristics to find the most @@ -124,10 +128,7 @@ module ContextDev # top to bottom). The final slice may be shorter than the viewport height. Takes # precedence over fullScreenshot. Max: 100000. sig { returns(T.nilable(Integer)) } - attr_reader :scroll_offset - - sig { params(scroll_offset: Integer).void } - attr_writer :scroll_offset + attr_accessor :scroll_offset # Optional comma-separated caller-defined tags for tracking this request. Tags are # recorded on the request's usage log and can be used to filter usage on the @@ -160,10 +161,7 @@ module ContextDev # the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when # omitted. sig { returns(T.nilable(Integer)) } - attr_reader :wait_for_ms - - sig { params(wait_for_ms: Integer).void } - attr_writer :wait_for_ms + attr_accessor :wait_for_ms sig do params( @@ -174,14 +172,17 @@ module ContextDev full_screenshot: ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, handle_cookie_popup: - ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol, - max_age_ms: Integer, + T.any( + T::Boolean, + ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol + ), + max_age_ms: T.nilable(Integer), page: ContextDev::WebScreenshotParams::Page::OrSymbol, - scroll_offset: Integer, + scroll_offset: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, - wait_for_ms: Integer, + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -189,8 +190,9 @@ module ContextDev # Optional parameter to choose the site's visual theme in the screenshot. Use # 'light' or 'dark' when the site offers both appearances. color_scheme: nil, - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. country: nil, # A specific URL to screenshot directly, bypassing domain resolution (e.g., # 'https://example.com/pricing'). When provided, the screenshot is taken of this @@ -254,14 +256,17 @@ module ContextDev full_screenshot: ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, handle_cookie_popup: - ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol, - max_age_ms: Integer, + T.any( + T::Boolean, + ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol + ), + max_age_ms: T.nilable(Integer), page: ContextDev::WebScreenshotParams::Page::OrSymbol, - scroll_offset: Integer, + scroll_offset: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, - wait_for_ms: Integer, + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions } ) @@ -300,8 +305,9 @@ module ContextDev end end - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. module Country extend ContextDev::Internal::Type::Enum @@ -563,7 +569,25 @@ module ContextDev # dismiss cookie banner before capture. If 'false' or not provided, captures the # page without that step. module HandleCookiePopup - extend ContextDev::Internal::Type::Enum + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebScreenshotParams::HandleCookiePopup::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebScreenshotParams::HandleCookiePopup::Variants + ] + ) + end + def self.variants + end TaggedSymbol = T.type_alias do @@ -581,16 +605,6 @@ module ContextDev :false, ContextDev::WebScreenshotParams::HandleCookiePopup::TaggedSymbol ) - - sig do - override.returns( - T::Array[ - ContextDev::WebScreenshotParams::HandleCookiePopup::TaggedSymbol - ] - ) - end - def self.values - end end # Optional parameter to specify which page type to screenshot. If provided, the diff --git a/rbi/context_dev/models/web_web_scrape_html_params.rbi b/rbi/context_dev/models/web_web_scrape_html_params.rbi index 4db5a44e..87c251e2 100644 --- a/rbi/context_dev/models/web_web_scrape_html_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_html_params.rbi @@ -18,8 +18,9 @@ module ContextDev sig { returns(String) } attr_accessor :url - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. sig do returns( T.nilable(ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol) @@ -38,10 +39,7 @@ module ContextDev # Exclusion takes precedence: an element matching both is removed. Examples: # "nav", "footer", ".ad-banner", "[aria-hidden=true]". sig { returns(T.nilable(T::Array[String])) } - attr_reader :exclude_selectors - - sig { params(exclude_selectors: T::Array[String]).void } - attr_writer :exclude_selectors + attr_accessor :exclude_selectors # Optional outbound HTTP headers forwarded only to the target URL, sent as # deep-object query params such as headers[X-Custom]=value. When provided, caching @@ -53,29 +51,40 @@ module ContextDev attr_writer :headers # When true, iframes are rendered inline into the returned HTML. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::IncludeFrames::OrSymbol + ) + ) + ) + end attr_reader :include_frames - sig { params(include_frames: T::Boolean).void } + sig do + params( + include_frames: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::IncludeFrames::OrSymbol + ) + ).void + end attr_writer :include_frames # CSS selectors. When provided, only matching subtrees (and their descendants) are # kept and everything else is dropped. When omitted, the entire document is kept. # Examples: "article.main", "#content", "[role=main]". sig { returns(T.nilable(T::Array[String])) } - attr_reader :include_selectors - - sig { params(include_selectors: T::Array[String]).void } - attr_writer :include_selectors + attr_accessor :include_selectors # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. sig { returns(T.nilable(Integer)) } - attr_reader :max_age_ms - - sig { params(max_age_ms: Integer).void } - attr_writer :max_age_ms + attr_accessor :max_age_ms # PDF parsing controls. Use start/end to limit text extraction and embedded-image # detection/OCR to an inclusive 1-based page range. @@ -88,10 +97,27 @@ module ContextDev # When true, waits briefly for CSS and transition animations to settle before # extracting HTML. Defaults to false. This adds a bit of latency in exchange for # more stable output on animated pages. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::SettleAnimations::OrSymbol + ) + ) + ) + end attr_reader :settle_animations - sig { params(settle_animations: T::Boolean).void } + sig do + params( + settle_animations: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::SettleAnimations::OrSymbol + ) + ).void + end attr_writer :settle_animations # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -114,43 +140,70 @@ module ContextDev # When true, return only the page's main content in the HTML response, excluding # headers, footers, sidebars, and navigation when detectable. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol + ) + ) + ) + end attr_reader :use_main_content_only - sig { params(use_main_content_only: T::Boolean).void } + sig do + params( + use_main_content_only: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol + ) + ).void + end attr_writer :use_main_content_only # Optional browser wait time in milliseconds after initial page load. Min: 0. Max: # 30000 (30 seconds). sig { returns(T.nilable(Integer)) } - attr_reader :wait_for_ms - - sig { params(wait_for_ms: Integer).void } - attr_writer :wait_for_ms + attr_accessor :wait_for_ms sig do params( url: String, country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol, - exclude_selectors: T::Array[String], + exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], - include_frames: T::Boolean, - include_selectors: T::Array[String], - max_age_ms: Integer, + include_frames: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::IncludeFrames::OrSymbol + ), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash, - settle_animations: T::Boolean, + settle_animations: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::SettleAnimations::OrSymbol + ), tags: T::Array[String], timeout_ms: Integer, - use_main_content_only: T::Boolean, - wait_for_ms: Integer, + use_main_content_only: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol + ), + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( # Full URL to scrape (must include http:// or https:// protocol) url:, - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. country: nil, # CSS selectors to remove from the result. Applied after includeSelectors. # Exclusion takes precedence: an element matching both is removed. Examples: @@ -200,17 +253,29 @@ module ContextDev { url: String, country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol, - exclude_selectors: T::Array[String], + exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], - include_frames: T::Boolean, - include_selectors: T::Array[String], - max_age_ms: Integer, + include_frames: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::IncludeFrames::OrSymbol + ), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, - settle_animations: T::Boolean, + settle_animations: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::SettleAnimations::OrSymbol + ), tags: T::Array[String], timeout_ms: Integer, - use_main_content_only: T::Boolean, - wait_for_ms: Integer, + use_main_content_only: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol + ), + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions } ) @@ -218,8 +283,9 @@ module ContextDev def to_hash end - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. module Country extend ContextDev::Internal::Type::Enum @@ -647,6 +713,46 @@ module ContextDev end end + # When true, iframes are rendered inline into the returned HTML. + module IncludeFrames + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::IncludeFrames::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeHTMLParams::IncludeFrames::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeHTMLParams::IncludeFrames) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeHTMLParams::IncludeFrames::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeHTMLParams::IncludeFrames::TaggedSymbol + ) + end + class Pdf < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do @@ -667,18 +773,52 @@ module ContextDev # When true, detect and OCR images embedded in the selected PDF pages, inserting # recognized text at each image's position in page reading order while preserving # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::OrSymbol + ) + ) + ) + end attr_reader :ocr - sig { params(ocr: T::Boolean).void } + sig do + params( + ocr: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::OrSymbol + ) + ).void + end attr_writer :ocr # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and # a 400 WEBSITE_ACCESS_ERROR is returned. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::OrSymbol + ) + ) + ) + end attr_reader :should_parse - sig { params(should_parse: T::Boolean).void } + sig do + params( + should_parse: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::OrSymbol + ) + ).void + end attr_writer :should_parse # First 1-based PDF page to parse. When omitted, parsing starts at the first page. @@ -693,8 +833,16 @@ module ContextDev sig do params( end_: Integer, - ocr: T::Boolean, - should_parse: T::Boolean, + ocr: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::OrSymbol + ), start: Integer ).returns(T.attached_class) end @@ -718,14 +866,192 @@ module ContextDev override.returns( { end_: Integer, - ocr: T::Boolean, - should_parse: T::Boolean, + ocr: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::OrSymbol + ), start: Integer } ) end def to_hash end + + # When true, detect and OCR images embedded in the selected PDF pages, inserting + # recognized text at each image's position in page reading order while preserving + # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + module Ocr + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeHTMLParams::Pdf::Ocr::TaggedSymbol + ) + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 WEBSITE_ACCESS_ERROR is returned. + module ShouldParse + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeHTMLParams::Pdf::ShouldParse::TaggedSymbol + ) + end + end + + # When true, waits briefly for CSS and transition animations to settle before + # extracting HTML. Defaults to false. This adds a bit of latency in exchange for + # more stable output on animated pages. + module SettleAnimations + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::SettleAnimations::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeHTMLParams::SettleAnimations::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeHTMLParams::SettleAnimations) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeHTMLParams::SettleAnimations::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeHTMLParams::SettleAnimations::TaggedSymbol + ) + end + + # When true, return only the page's main content in the HTML response, excluding + # headers, footers, sidebars, and navigation when detectable. + module UseMainContentOnly + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::TaggedSymbol + ) end end end diff --git a/rbi/context_dev/models/web_web_scrape_images_params.rbi b/rbi/context_dev/models/web_web_scrape_images_params.rbi index d577fae2..0e16f6c7 100644 --- a/rbi/context_dev/models/web_web_scrape_images_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_images_params.rbi @@ -22,10 +22,27 @@ module ContextDev # perceptually hashed, and only the highest-resolution copy of each duplicate # group is kept. Images that cannot be downloaded or hashed are kept. Default: # false. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol + ) + ) + ) + end attr_reader :dedupe - sig { params(dedupe: T::Boolean).void } + sig do + params( + dedupe: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol + ) + ).void + end attr_writer :dedupe # Optional per-image processing, sent as deep-object query params such as @@ -37,7 +54,8 @@ module ContextDev sig do params( - enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash + enrichment: + T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash) ).void end attr_writer :enrichment @@ -54,10 +72,7 @@ module ContextDev # Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 # day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days). sig { returns(T.nilable(Integer)) } - attr_reader :max_age_ms - - sig { params(max_age_ms: Integer).void } - attr_writer :max_age_ms + attr_accessor :max_age_ms # Optional comma-separated caller-defined tags for tracking this request. Tags are # recorded on the request's usage log and can be used to filter usage on the @@ -80,21 +95,23 @@ module ContextDev # Optional browser wait time in milliseconds after initial page load before # collecting images. Min: 0. Max: 30000 (30 seconds). sig { returns(T.nilable(Integer)) } - attr_reader :wait_for_ms - - sig { params(wait_for_ms: Integer).void } - attr_writer :wait_for_ms + attr_accessor :wait_for_ms sig do params( url: String, - dedupe: T::Boolean, - enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash, + dedupe: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol + ), + enrichment: + T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash), headers: T::Hash[Symbol, String], - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, - wait_for_ms: Integer, + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -135,13 +152,18 @@ module ContextDev override.returns( { url: String, - dedupe: T::Boolean, - enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, + dedupe: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol + ), + enrichment: + T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment), headers: T::Hash[Symbol, String], - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, - wait_for_ms: Integer, + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions } ) @@ -149,6 +171,47 @@ module ContextDev def to_hash end + # When true, visually duplicate images are removed: every image is loaded and + # perceptually hashed, and only the highest-resolution copy of each duplicate + # group is kept. Images that cannot be downloaded or hashed are kept. Default: + # false. + module Dedupe + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Dedupe::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeImagesParams::Dedupe::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeImagesParams::Dedupe) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeImagesParams::Dedupe::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeImagesParams::Dedupe::TaggedSymbol + ) + end + class Enrichment < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do @@ -159,18 +222,52 @@ module ContextDev end # Classify each image by visual asset type. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::OrSymbol + ) + ) + ) + end attr_reader :classification - sig { params(classification: T::Boolean).void } + sig do + params( + classification: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::OrSymbol + ) + ).void + end attr_writer :classification # Host materializable images on the Brand.dev CDN and return their URL and MIME # type. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::OrSymbol + ) + ) + ) + end attr_reader :hosted_url - sig { params(hosted_url: T::Boolean).void } + sig do + params( + hosted_url: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::OrSymbol + ) + ).void + end attr_writer :hosted_url # Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000. @@ -181,20 +278,49 @@ module ContextDev attr_writer :max_time_per_ms # Measure image width and height when possible. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::OrSymbol + ) + ) + ) + end attr_reader :resolution - sig { params(resolution: T::Boolean).void } + sig do + params( + resolution: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::OrSymbol + ) + ).void + end attr_writer :resolution # Optional per-image processing, sent as deep-object query params such as # enrichment[resolution]=true. sig do params( - classification: T::Boolean, - hosted_url: T::Boolean, + classification: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::OrSymbol + ), + hosted_url: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::OrSymbol + ), max_time_per_ms: Integer, - resolution: T::Boolean + resolution: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::OrSymbol + ) ).returns(T.attached_class) end def self.new( @@ -213,15 +339,157 @@ module ContextDev sig do override.returns( { - classification: T::Boolean, - hosted_url: T::Boolean, + classification: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::OrSymbol + ), + hosted_url: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::OrSymbol + ), max_time_per_ms: Integer, - resolution: T::Boolean + resolution: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::OrSymbol + ) } ) end def to_hash end + + # Classify each image by visual asset type. + module Classification + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::WebWebScrapeImagesParams::Enrichment::Classification + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeImagesParams::Enrichment::Classification::TaggedSymbol + ) + end + + # Host materializable images on the Brand.dev CDN and return their URL and MIME + # type. + module HostedURL + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeImagesParams::Enrichment::HostedURL::TaggedSymbol + ) + end + + # Measure image width and height when possible. + module Resolution + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeImagesParams::Enrichment::Resolution::TaggedSymbol + ) + end end end end diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index 54af8cd8..28507c3c 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -16,8 +16,9 @@ module ContextDev sig { returns(String) } attr_accessor :url - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. sig do returns(T.nilable(ContextDev::WebWebScrapeMdParams::Country::OrSymbol)) end @@ -34,10 +35,7 @@ module ContextDev # includeSelectors. Exclusion takes precedence: an element matching both is # removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]". sig { returns(T.nilable(T::Array[String])) } - attr_reader :exclude_selectors - - sig { params(exclude_selectors: T::Array[String]).void } - attr_writer :exclude_selectors + attr_accessor :exclude_selectors # Optional outbound HTTP headers forwarded only to the target URL, sent as # deep-object query params such as headers[X-Custom]=value. When provided, caching @@ -49,43 +47,88 @@ module ContextDev attr_writer :headers # When true, the contents of iframes are rendered to Markdown. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol + ) + ) + ) + end attr_reader :include_frames - sig { params(include_frames: T::Boolean).void } + sig do + params( + include_frames: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol + ) + ).void + end attr_writer :include_frames # Include image references in Markdown output - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol + ) + ) + ) + end attr_reader :include_images - sig { params(include_images: T::Boolean).void } + sig do + params( + include_images: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol + ) + ).void + end attr_writer :include_images # Preserve hyperlinks in Markdown output - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol + ) + ) + ) + end attr_reader :include_links - sig { params(include_links: T::Boolean).void } + sig do + params( + include_links: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol + ) + ).void + end attr_writer :include_links # CSS selectors. When provided, only matching HTML subtrees (and their # descendants) are kept before conversion to Markdown. When omitted, the entire # document is kept. Examples: "article.main", "#content", "[role=main]". sig { returns(T.nilable(T::Array[String])) } - attr_reader :include_selectors - - sig { params(include_selectors: T::Array[String]).void } - attr_writer :include_selectors + attr_accessor :include_selectors # Return a cached result if a prior scrape for the same parameters exists and is # younger than this many milliseconds. Defaults to 1 day (86400000 ms) when # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. sig { returns(T.nilable(Integer)) } - attr_reader :max_age_ms - - sig { params(max_age_ms: Integer).void } - attr_writer :max_age_ms + attr_accessor :max_age_ms # PDF parsing controls. Use start/end to limit text extraction and embedded-image # detection/OCR to an inclusive 1-based page range. @@ -98,17 +141,51 @@ module ContextDev # When true, waits briefly for CSS and transition animations to settle before # converting to Markdown. Defaults to false. This adds a bit of latency in # exchange for more stable output on animated pages. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol + ) + ) + ) + end attr_reader :settle_animations - sig { params(settle_animations: T::Boolean).void } + sig do + params( + settle_animations: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol + ) + ).void + end attr_writer :settle_animations # Shorten base64-encoded image data in the Markdown output - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol + ) + ) + ) + end attr_reader :shorten_base64_images - sig { params(shorten_base64_images: T::Boolean).void } + sig do + params( + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol + ) + ).void + end attr_writer :shorten_base64_images # Optional comma-separated caller-defined tags for tracking this request. Tags are @@ -131,38 +208,76 @@ module ContextDev # Extract only the main content of the page, excluding headers, footers, sidebars, # and navigation - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol + ) + ) + ) + end attr_reader :use_main_content_only - sig { params(use_main_content_only: T::Boolean).void } + sig do + params( + use_main_content_only: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol + ) + ).void + end attr_writer :use_main_content_only # Optional browser wait time in milliseconds after initial page load before # converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). sig { returns(T.nilable(Integer)) } - attr_reader :wait_for_ms - - sig { params(wait_for_ms: Integer).void } - attr_writer :wait_for_ms + attr_accessor :wait_for_ms sig do params( url: String, country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol, - exclude_selectors: T::Array[String], + exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], - include_frames: T::Boolean, - include_images: T::Boolean, - include_links: T::Boolean, - include_selectors: T::Array[String], - max_age_ms: Integer, + include_frames: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol + ), + include_images: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol + ), + include_links: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol + ), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash, - settle_animations: T::Boolean, - shorten_base64_images: T::Boolean, + settle_animations: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol + ), + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol + ), tags: T::Array[String], timeout_ms: Integer, - use_main_content_only: T::Boolean, - wait_for_ms: Integer, + use_main_content_only: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol + ), + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -170,8 +285,9 @@ module ContextDev # Full URL to scrape into LLM usable Markdown (must include http:// or https:// # protocol) url:, - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. country: nil, # CSS selectors to remove before conversion to Markdown. Applied after # includeSelectors. Exclusion takes precedence: an element matching both is @@ -227,20 +343,44 @@ module ContextDev { url: String, country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol, - exclude_selectors: T::Array[String], + exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], - include_frames: T::Boolean, - include_images: T::Boolean, - include_links: T::Boolean, - include_selectors: T::Array[String], - max_age_ms: Integer, + include_frames: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol + ), + include_images: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol + ), + include_links: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol + ), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), pdf: ContextDev::WebWebScrapeMdParams::Pdf, - settle_animations: T::Boolean, - shorten_base64_images: T::Boolean, + settle_animations: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol + ), + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol + ), tags: T::Array[String], timeout_ms: Integer, - use_main_content_only: T::Boolean, - wait_for_ms: Integer, + use_main_content_only: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol + ), + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions } ) @@ -248,8 +388,9 @@ module ContextDev def to_hash end - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. module Country extend ContextDev::Internal::Type::Enum @@ -473,6 +614,120 @@ module ContextDev end end + # When true, the contents of iframes are rendered to Markdown. + module IncludeFrames + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeMdParams::IncludeFrames::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeMdParams::IncludeFrames) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeMdParams::IncludeFrames::TaggedSymbol + ) + end + + # Include image references in Markdown output + module IncludeImages + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeMdParams::IncludeImages::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeMdParams::IncludeImages) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeMdParams::IncludeImages::TaggedSymbol + ) + end + + # Preserve hyperlinks in Markdown output + module IncludeLinks + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeMdParams::IncludeLinks::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeMdParams::IncludeLinks) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeMdParams::IncludeLinks::TaggedSymbol + ) + end + class Pdf < ContextDev::Internal::Type::BaseModel OrHash = T.type_alias do @@ -493,18 +748,52 @@ module ContextDev # When true, detect and OCR images embedded in the selected PDF pages, inserting # recognized text at each image's position in page reading order while preserving # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol + ) + ) + ) + end attr_reader :ocr - sig { params(ocr: T::Boolean).void } + sig do + params( + ocr: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol + ) + ).void + end attr_writer :ocr # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and # a 400 WEBSITE_ACCESS_ERROR is returned. - sig { returns(T.nilable(T::Boolean)) } + sig do + returns( + T.nilable( + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol + ) + ) + ) + end attr_reader :should_parse - sig { params(should_parse: T::Boolean).void } + sig do + params( + should_parse: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol + ) + ).void + end attr_writer :should_parse # First 1-based PDF page to parse. When omitted, parsing starts at the first page. @@ -519,8 +808,16 @@ module ContextDev sig do params( end_: Integer, - ocr: T::Boolean, - should_parse: T::Boolean, + ocr: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol + ), start: Integer ).returns(T.attached_class) end @@ -544,14 +841,226 @@ module ContextDev override.returns( { end_: Integer, - ocr: T::Boolean, - should_parse: T::Boolean, + ocr: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::Ocr::OrSymbol + ), + should_parse: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::OrSymbol + ), start: Integer } ) end def to_hash end + + # When true, detect and OCR images embedded in the selected PDF pages, inserting + # recognized text at each image's position in page reading order while preserving + # the PDF text layer. This is separate from automatic scanned-PDF OCR fallback. + module Ocr + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeMdParams::Pdf::Ocr::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeMdParams::Pdf::Ocr) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeMdParams::Pdf::Ocr::TaggedSymbol + ) + end + + # When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and + # a 400 WEBSITE_ACCESS_ERROR is returned. + module ShouldParse + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeMdParams::Pdf::ShouldParse::TaggedSymbol + ) + end + end + + # When true, waits briefly for CSS and transition animations to settle before + # converting to Markdown. Defaults to false. This adds a bit of latency in + # exchange for more stable output on animated pages. + module SettleAnimations + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeMdParams::SettleAnimations::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeMdParams::SettleAnimations) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeMdParams::SettleAnimations::TaggedSymbol + ) + end + + # Shorten base64-encoded image data in the Markdown output + module ShortenBase64Images + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeMdParams::ShortenBase64Images::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeMdParams::ShortenBase64Images) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeMdParams::ShortenBase64Images::TaggedSymbol + ) + end + + # Extract only the main content of the page, excluding headers, footers, sidebars, + # and navigation + module UseMainContentOnly + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol + ) + end + + sig do + override.returns( + T::Array[ + ContextDev::WebWebScrapeMdParams::UseMainContentOnly::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeMdParams::UseMainContentOnly) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol + ) + FALSE = + T.let( + :false, + ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol + ) end end end diff --git a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi index c1066ed0..0e759326 100644 --- a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi @@ -35,6 +35,14 @@ module ContextDev sig { params(max_links: Integer).void } attr_writer :max_links + # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled + # instead of discovering the domain's sitemaps. + sig { returns(T.nilable(String)) } + attr_reader :sitemap_url + + sig { params(sitemap_url: String).void } + attr_writer :sitemap_url + # Optional comma-separated caller-defined tags for tracking this request. Tags are # recorded on the request's usage log and can be used to filter usage on the # dashboard usage page. Up to 20 tags, each 1-50 characters. @@ -66,6 +74,7 @@ module ContextDev domain: String, headers: T::Hash[Symbol, String], max_links: Integer, + sitemap_url: String, tags: T::Array[String], timeout_ms: Integer, url_regex: String, @@ -82,6 +91,9 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled + # instead of discovering the domain's sitemaps. + sitemap_url: nil, # Optional comma-separated caller-defined tags for tracking this request. Tags are # recorded on the request's usage log and can be used to filter usage on the # dashboard usage page. Up to 20 tags, each 1-50 characters. @@ -103,6 +115,7 @@ module ContextDev domain: String, headers: T::Hash[Symbol, String], max_links: Integer, + sitemap_url: String, tags: T::Array[String], timeout_ms: Integer, url_regex: String, diff --git a/rbi/context_dev/models/webhook_delivery.rbi b/rbi/context_dev/models/webhook_delivery.rbi deleted file mode 100644 index c80e0859..00000000 --- a/rbi/context_dev/models/webhook_delivery.rbi +++ /dev/null @@ -1,172 +0,0 @@ -# typed: strong - -module ContextDev - module Models - class WebhookDelivery < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(ContextDev::WebhookDelivery, ContextDev::Internal::AnyHash) - end - - sig { returns(Time) } - attr_accessor :attempted_at - - sig { returns(T.nilable(ContextDev::WebhookDelivery::Error)) } - attr_reader :error - - sig do - params( - error: T.nilable(ContextDev::WebhookDelivery::Error::OrHash) - ).void - end - attr_writer :error - - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - sig { returns(ContextDev::WebhookDelivery::Event::TaggedSymbol) } - attr_accessor :event - - # Identifier sent in the X-Context-Id header. - sig { returns(String) } - attr_accessor :event_id - - # The endpoint's final HTTP response status, or null when no response was - # received. - sig { returns(T.nilable(Integer)) } - attr_accessor :http_status - - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - sig { returns(ContextDev::WebhookDelivery::Status::TaggedSymbol) } - attr_accessor :status - - sig do - params( - attempted_at: Time, - error: T.nilable(ContextDev::WebhookDelivery::Error::OrHash), - event: ContextDev::WebhookDelivery::Event::OrSymbol, - event_id: String, - http_status: T.nilable(Integer), - status: ContextDev::WebhookDelivery::Status::OrSymbol - ).returns(T.attached_class) - end - def self.new( - attempted_at:, - error:, - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - event:, - # Identifier sent in the X-Context-Id header. - event_id:, - # The endpoint's final HTTP response status, or null when no response was - # received. - http_status:, - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - status: - ) - end - - sig do - override.returns( - { - attempted_at: Time, - error: T.nilable(ContextDev::WebhookDelivery::Error), - event: ContextDev::WebhookDelivery::Event::TaggedSymbol, - event_id: String, - http_status: T.nilable(Integer), - status: ContextDev::WebhookDelivery::Status::TaggedSymbol - } - ) - end - def to_hash - end - - class Error < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::WebhookDelivery::Error, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :code - - sig { returns(String) } - attr_accessor :message - - sig { params(code: String, message: String).returns(T.attached_class) } - def self.new(code:, message:) - end - - sig { override.returns({ code: String, message: String }) } - def to_hash - end - end - - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - module Event - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, ContextDev::WebhookDelivery::Event) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CHANGE_DETECTED = - T.let( - :"change.detected", - ContextDev::WebhookDelivery::Event::TaggedSymbol - ) - RUN_COMPLETED = - T.let( - :"run.completed", - ContextDev::WebhookDelivery::Event::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ContextDev::WebhookDelivery::Event::TaggedSymbol] - ) - end - def self.values - end - end - - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - module Status - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias { T.all(Symbol, ContextDev::WebhookDelivery::Status) } - OrSymbol = T.type_alias { T.any(Symbol, String) } - - DELIVERED = - T.let(:delivered, ContextDev::WebhookDelivery::Status::TaggedSymbol) - REJECTED = - T.let(:rejected, ContextDev::WebhookDelivery::Status::TaggedSymbol) - FAILED = - T.let(:failed, ContextDev::WebhookDelivery::Status::TaggedSymbol) - SKIPPED_UNSAFE_URL = - T.let( - :skipped_unsafe_url, - ContextDev::WebhookDelivery::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ContextDev::WebhookDelivery::Status::TaggedSymbol] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/context_dev/resources/brand.rbi b/rbi/context_dev/resources/brand.rbi index 096138f4..d4a83387 100644 --- a/rbi/context_dev/resources/brand.rbi +++ b/rbi/context_dev/resources/brand.rbi @@ -35,8 +35,9 @@ module ContextDev sig do params( domain: String, - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], + theme: ContextDev::BrandRetrieveSimplifiedParams::Theme::OrSymbol, timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::BrandRetrieveSimplifiedResponse) @@ -53,6 +54,8 @@ module ContextDev # recorded on the request's usage log and can be used to filter usage on the # dashboard usage page. Up to 20 tags, each 1-50 characters. tags: nil, + # Optional theme preference used when selecting brand assets. + theme: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed # value is 300000ms (5 minutes). diff --git a/rbi/context_dev/resources/monitors.rbi b/rbi/context_dev/resources/monitors.rbi index f5aa5393..634ad5a6 100644 --- a/rbi/context_dev/resources/monitors.rbi +++ b/rbi/context_dev/resources/monitors.rbi @@ -117,18 +117,23 @@ module ContextDev limit: Integer, q: String, search_by: - T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol], + T.nilable( + T::Array[ContextDev::MonitorListParams::SearchBy::OrSymbol] + ), search_type: ContextDev::MonitorListParams::SearchType::OrSymbol, status: ContextDev::MonitorListParams::Status::OrSymbol, tag: String, - tags: T::Array[String], + tags: T.nilable(T::Array[String]), target_type: ContextDev::MonitorListParams::TargetType::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::MonitorListResponse) end def list( + # Filter by change detection type. change_detection_type: nil, + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, # Free-text search term, matched against the fields named in `search_by`. q: nil, @@ -138,16 +143,13 @@ module ContextDev # `prefix` for as-you-type prefix matching (default), `exact` for full-token # matching. search_type: nil, - # Monitor lifecycle status. `failed` means the most recent run failed (see the - # monitor's `last_error`); failed monitors keep running on schedule and flip back - # to `active` on the next successful run. Monitors are auto-`paused` after - # repeated consecutive failures or insufficient-credit skips; resume by PATCHing - # status to `active`. + # Filter monitors by lifecycle status. status: nil, # Filter to items that have this tag. tag: nil, # Comma-separated list of tags to filter by (matches monitors having any of them). tags: nil, + # Filter by target type. target_type: nil, request_options: {} ) @@ -180,14 +182,21 @@ module ContextDev ).returns(ContextDev::Models::MonitorListAccountChangesResponse) end def list_account_changes( + # Filter by change detection type. change_detection_type: nil, + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, + # Filter changes to a single monitor. monitor_id: nil, + # Only include items at or after this ISO 8601 timestamp. since: nil, # Filter to items that have this tag. tag: nil, + # Filter by target type. target_type: nil, + # Only include items before this ISO 8601 timestamp. until_: nil, request_options: {} ) @@ -203,10 +212,11 @@ module ContextDev ).returns(ContextDev::Models::MonitorListAccountRunsResponse) end def list_account_runs( + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. status: nil, request_options: {} ) @@ -226,11 +236,15 @@ module ContextDev end def list_changes( monitor_id, + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, + # Only include items at or after this ISO 8601 timestamp. since: nil, # Filter to items that have this tag. tag: nil, + # Only include items before this ISO 8601 timestamp. until_: nil, request_options: {} ) @@ -248,10 +262,11 @@ module ContextDev end def list_runs( monitor_id, + # Opaque pagination cursor from a previous response. cursor: nil, + # Maximum number of items to return per page (1-100). Defaults to 25. limit: nil, - # Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` - # (insufficient credits, monitor paused, or superseded by a concurrent run). + # Filter runs by lifecycle status. status: nil, request_options: {} ) diff --git a/rbi/context_dev/resources/parse.rbi b/rbi/context_dev/resources/parse.rbi index 383fa40c..0947d0b8 100644 --- a/rbi/context_dev/resources/parse.rbi +++ b/rbi/context_dev/resources/parse.rbi @@ -4,43 +4,58 @@ module ContextDev module Resources class Parse # Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes - # into LLM-usable Markdown. The base request costs 1 credit. When OCR runs - # (requires ocr=true), the entire call costs 5 credits; ocr=true requests where no - # OCR ends up running still cost 1 credit. + # into LLM-usable Markdown. sig do params( body: ContextDev::Internal::FileInput, + client: String, extension: ContextDev::ParseHandleParams::Extension::OrSymbol, - include_images: T::Boolean, - include_links: T::Boolean, - ocr: T::Boolean, + include_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeImages::OrSymbol + ), + include_links: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::IncludeLinks::OrSymbol + ), + ocr: T.any(T::Boolean, ContextDev::ParseHandleParams::Ocr::OrSymbol), pdf: ContextDev::ParseHandleParams::Pdf::OrHash, - shorten_base64_images: T::Boolean, + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol + ), tags: T::Array[String], - use_main_content_only: T::Boolean, + use_main_content_only: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol + ), request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::ParseHandleResponse) end def handle( # Body param body:, - # Query param: Optional file extension hint. Case-insensitive; a leading dot is - # accepted (e.g. ".pdf"). + # Query param: Optional client identifier used for usage attribution. + client: nil, + # Query param: Optional file extension hint, such as pdf, docx, xlsx, pptx, html, + # json, csv, md, py, rtf, jpg, png, or txt. extension: nil, # Query param: Include image references in Markdown output include_images: nil, # Query param: Preserve hyperlinks in Markdown output include_links: nil, - # Query param: Gates all OCR. When true, PDFs get embedded-image OCR (recognized - # text inserted at each image's position in page reading order, preserving the - # text layer; pdf.start/pdf.end limit the page range), scanned PDFs with no text - # layer get full-document OCR, and raster images get their visible text - # transcribed. When false, no OCR runs: scanned PDFs may yield no content and - # images return only format/dimension metadata. Calls where OCR actually runs cost - # 5 credits instead of 1. + # Query param: When true for PDF inputs, detect and OCR images embedded in the + # selected pages, inserting recognized text at each image's position in page + # reading order while preserving the PDF text layer. pdf.start/pdf.end limit the + # inclusive page range. When false, all OCR is disabled, including the automatic + # scanned-PDF fallback. ocr: nil, - # Query param: PDF page-range controls. Use start/end to limit parsing (and OCR - # when ocr=true) to an inclusive 1-based page range. + # Query param: PDF page-range options as a JSON object, e.g. {"start": 2, "end": + # 5}. pdf: nil, # Query param: Shorten base64-encoded image data in the Markdown output shorten_base64_images: nil, diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index eaac16dc..722a2c97 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -108,7 +108,7 @@ module ContextDev params( direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -123,7 +123,7 @@ module ContextDev # domain will be automatically normalized and validated. You must provide either # 'domain' or 'directUrl', but not both. domain: nil, - # Maximum age in milliseconds for cached data before the API performs a hard + # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. @@ -148,7 +148,7 @@ module ContextDev ContextDev::WebExtractStyleguideParams::ColorScheme::OrSymbol, direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -167,7 +167,7 @@ module ContextDev # domain will be automatically normalized and validated. You must provide either # 'domain' or 'directUrl', but not both. domain: nil, - # Maximum age in milliseconds for cached data before the API performs a hard + # Maximum age in milliseconds for cached brand data before the API performs a hard # refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) # are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 # year. @@ -194,14 +194,17 @@ module ContextDev full_screenshot: ContextDev::WebScreenshotParams::FullScreenshot::OrSymbol, handle_cookie_popup: - ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol, - max_age_ms: Integer, + T.any( + T::Boolean, + ContextDev::WebScreenshotParams::HandleCookiePopup::OrSymbol + ), + max_age_ms: T.nilable(Integer), page: ContextDev::WebScreenshotParams::Page::OrSymbol, - scroll_offset: Integer, + scroll_offset: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, - wait_for_ms: Integer, + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebScreenshotResponse) end @@ -209,8 +212,9 @@ module ContextDev # Optional parameter to choose the site's visual theme in the screenshot. Use # 'light' or 'dark' when the site offers both appearances. color_scheme: nil, - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. country: nil, # A specific URL to screenshot directly, bypassing domain resolution (e.g., # 'https://example.com/pricing'). When provided, the screenshot is taken of this @@ -414,25 +418,38 @@ module ContextDev params( url: String, country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol, - exclude_selectors: T::Array[String], + exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], - include_frames: T::Boolean, - include_selectors: T::Array[String], - max_age_ms: Integer, + include_frames: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::IncludeFrames::OrSymbol + ), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), pdf: ContextDev::WebWebScrapeHTMLParams::Pdf::OrHash, - settle_animations: T::Boolean, + settle_animations: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::SettleAnimations::OrSymbol + ), tags: T::Array[String], timeout_ms: Integer, - use_main_content_only: T::Boolean, - wait_for_ms: Integer, + use_main_content_only: + T.any( + T::Boolean, + ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol + ), + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeHTMLResponse) end def web_scrape_html( # Full URL to scrape (must include http:// or https:// protocol) url:, - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. country: nil, # CSS selectors to remove from the result. Applied after includeSelectors. # Exclusion takes precedence: an element matching both is removed. Examples: @@ -484,13 +501,18 @@ module ContextDev sig do params( url: String, - dedupe: T::Boolean, - enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash, + dedupe: + T.any( + T::Boolean, + ContextDev::WebWebScrapeImagesParams::Dedupe::OrSymbol + ), + enrichment: + T.nilable(ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash), headers: T::Hash[Symbol, String], - max_age_ms: Integer, + max_age_ms: T.nilable(Integer), tags: T::Array[String], timeout_ms: Integer, - wait_for_ms: Integer, + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeImagesResponse) end @@ -547,20 +569,44 @@ module ContextDev params( url: String, country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol, - exclude_selectors: T::Array[String], + exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], - include_frames: T::Boolean, - include_images: T::Boolean, - include_links: T::Boolean, - include_selectors: T::Array[String], - max_age_ms: Integer, + include_frames: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeFrames::OrSymbol + ), + include_images: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeImages::OrSymbol + ), + include_links: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::IncludeLinks::OrSymbol + ), + include_selectors: T.nilable(T::Array[String]), + max_age_ms: T.nilable(Integer), pdf: ContextDev::WebWebScrapeMdParams::Pdf::OrHash, - settle_animations: T::Boolean, - shorten_base64_images: T::Boolean, + settle_animations: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::SettleAnimations::OrSymbol + ), + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::ShortenBase64Images::OrSymbol + ), tags: T::Array[String], timeout_ms: Integer, - use_main_content_only: T::Boolean, - wait_for_ms: Integer, + use_main_content_only: + T.any( + T::Boolean, + ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol + ), + wait_for_ms: T.nilable(Integer), request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeMdResponse) end @@ -568,8 +614,9 @@ module ContextDev # Full URL to scrape into LLM usable Markdown (must include http:// or https:// # protocol) url:, - # Two-letter ISO 3166-1 alpha-2 country code for the website request location. - # When provided, Context.dev fetches the target page from that country. + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev + # residential proxy exit location. Must be one of Context.dev's supported + # countries. When provided, Context.dev fetches the target page from that country. country: nil, # CSS selectors to remove before conversion to Markdown. Applied after # includeSelectors. Exclusion takes precedence: an element matching both is @@ -626,6 +673,7 @@ module ContextDev domain: String, headers: T::Hash[Symbol, String], max_links: Integer, + sitemap_url: String, tags: T::Array[String], timeout_ms: Integer, url_regex: String, @@ -642,6 +690,9 @@ module ContextDev # Maximum number of links to return from the sitemap crawl. Defaults to 10,000. # Minimum is 1, maximum is 100,000. max_links: nil, + # Optional explicit sitemap URL. When provided, exactly this sitemap is crawled + # instead of discovering the domain's sitemaps. + sitemap_url: nil, # Optional comma-separated caller-defined tags for tracking this request. Tags are # recorded on the request's usage log and can be used to filter usage on the # dashboard usage page. Up to 20 tags, each 1-50 characters. diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index 41201247..6665a1de 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -45,8 +45,6 @@ module ContextDev class WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams - class WebhookDelivery = ContextDev::Models::WebhookDelivery - class WebScreenshotParams = ContextDev::Models::WebScreenshotParams class WebSearchParams = ContextDev::Models::WebSearchParams diff --git a/sig/context_dev/models/brand_retrieve_params.rbs b/sig/context_dev/models/brand_retrieve_params.rbs index c6f94fd5..b992af34 100644 --- a/sig/context_dev/models/brand_retrieve_params.rbs +++ b/sig/context_dev/models/brand_retrieve_params.rbs @@ -35,7 +35,7 @@ module ContextDev { domain: String, type: :by_domain, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language?, max_age_ms: Integer, max_speed: bool, tags: ::Array[String], @@ -47,11 +47,7 @@ module ContextDev attr_accessor type: :by_domain - attr_reader force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language? - - def force_language=: ( - ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language - ) -> ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language + attr_accessor force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language? attr_reader max_age_ms: Integer? @@ -71,7 +67,7 @@ module ContextDev def initialize: ( domain: String, - ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language, + ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language?, ?max_age_ms: Integer, ?max_speed: bool, ?tags: ::Array[String], @@ -82,7 +78,7 @@ module ContextDev def to_hash: -> { domain: String, type: :by_domain, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByDomain::force_language?, max_age_ms: Integer, max_speed: bool, tags: ::Array[String], @@ -344,7 +340,7 @@ module ContextDev name: String, type: :by_name, country_gl: String, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language?, max_age_ms: Integer, max_speed: bool, tags: ::Array[String], @@ -360,11 +356,7 @@ module ContextDev def country_gl=: (String) -> String - attr_reader force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language? - - def force_language=: ( - ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language - ) -> ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language + attr_accessor force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language? attr_reader max_age_ms: Integer? @@ -385,7 +377,7 @@ module ContextDev def initialize: ( name: String, ?country_gl: String, - ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language, + ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language?, ?max_age_ms: Integer, ?max_speed: bool, ?tags: ::Array[String], @@ -397,7 +389,7 @@ module ContextDev name: String, type: :by_name, country_gl: String, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByName::force_language?, max_age_ms: Integer, max_speed: bool, tags: ::Array[String], @@ -658,7 +650,7 @@ module ContextDev { email: String, type: :by_email, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language?, max_age_ms: Integer, max_speed: bool, tags: ::Array[String], @@ -670,11 +662,7 @@ module ContextDev attr_accessor type: :by_email - attr_reader force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language? - - def force_language=: ( - ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language - ) -> ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language + attr_accessor force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language? attr_reader max_age_ms: Integer? @@ -694,7 +682,7 @@ module ContextDev def initialize: ( email: String, - ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language, + ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language?, ?max_age_ms: Integer, ?max_speed: bool, ?tags: ::Array[String], @@ -705,7 +693,7 @@ module ContextDev def to_hash: -> { email: String, type: :by_email, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByEmail::force_language?, max_age_ms: Integer, max_speed: bool, tags: ::Array[String], @@ -966,7 +954,7 @@ module ContextDev { ticker: String, type: :by_ticker, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language?, max_age_ms: Integer, max_speed: bool, tags: ::Array[String], @@ -979,11 +967,7 @@ module ContextDev attr_accessor type: :by_ticker - attr_reader force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language? - - def force_language=: ( - ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language - ) -> ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language + attr_accessor force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language? attr_reader max_age_ms: Integer? @@ -1007,7 +991,7 @@ module ContextDev def initialize: ( ticker: String, - ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language, + ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language?, ?max_age_ms: Integer, ?max_speed: bool, ?tags: ::Array[String], @@ -1019,7 +1003,7 @@ module ContextDev def to_hash: -> { ticker: String, type: :by_ticker, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTicker::force_language?, max_age_ms: Integer, max_speed: bool, tags: ::Array[String], @@ -1319,11 +1303,11 @@ module ContextDev type: :by_transaction, city: String, country_gl: String, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language?, high_confidence_only: bool, max_speed: bool, - mcc: Integer, - phone: Float, + mcc: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc, + phone: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone, tags: ::Array[String], timeout_ms: Integer } @@ -1341,11 +1325,7 @@ module ContextDev def country_gl=: (String) -> String - attr_reader force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language? - - def force_language=: ( - ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language - ) -> ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language + attr_accessor force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language? attr_reader high_confidence_only: bool? @@ -1355,13 +1335,17 @@ module ContextDev def max_speed=: (bool) -> bool - attr_reader mcc: Integer? + attr_reader mcc: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc? - def mcc=: (Integer) -> Integer + def mcc=: ( + ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc + ) -> ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc - attr_reader phone: Float? + attr_reader phone: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone? - def phone=: (Float) -> Float + def phone=: ( + ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone + ) -> ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone attr_reader tags: ::Array[String]? @@ -1375,11 +1359,11 @@ module ContextDev transaction_info: String, ?city: String, ?country_gl: String, - ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language, + ?force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language?, ?high_confidence_only: bool, ?max_speed: bool, - ?mcc: Integer, - ?phone: Float, + ?mcc: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc, + ?phone: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone, ?tags: ::Array[String], ?timeout_ms: Integer, ?type: :by_transaction @@ -1390,11 +1374,11 @@ module ContextDev type: :by_transaction, city: String, country_gl: String, - force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language, + force_language: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language?, high_confidence_only: bool, max_speed: bool, - mcc: Integer, - phone: Float, + mcc: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc, + phone: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone, tags: ::Array[String], timeout_ms: Integer } @@ -1647,6 +1631,22 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::force_language] end + + type mcc = String | Float + + module Mcc + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc] + end + + type phone = String | Float + + module Phone + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone] + end end def self?.variants: -> ::Array[ContextDev::Models::BrandRetrieveParams::body] diff --git a/sig/context_dev/models/brand_retrieve_response.rbs b/sig/context_dev/models/brand_retrieve_response.rbs index e39f975d..014b09bb 100644 --- a/sig/context_dev/models/brand_retrieve_response.rbs +++ b/sig/context_dev/models/brand_retrieve_response.rbs @@ -488,7 +488,6 @@ module ContextDev | :"Streaming Platforms (Video, Music, Audio)" | :"Gaming & Interactive Entertainment" | :"Creator Economy & Influencer Platforms" - | :"Advertising, Adtech & Media Buying" | :"Film, TV & Production Studios" | :"Events, Venues & Live Entertainment" | :"Virtual Worlds & Metaverse Experiences" @@ -549,6 +548,7 @@ module ContextDev | :"Streetwear & Emerging Luxury" | :"Couture & Made-to-Measure" | :"News Publishing & Journalism" + | :"Advertising, Adtech & Media Buying" | :"Digital Media & Content Platforms" | :"Broadcasting (TV & Radio)" | :"Podcasting & Audio Media" @@ -712,7 +712,6 @@ module ContextDev STREAMING_PLATFORMS_VIDEO_MUSIC_AUDIO: :"Streaming Platforms (Video, Music, Audio)" GAMING_INTERACTIVE_ENTERTAINMENT: :"Gaming & Interactive Entertainment" CREATOR_ECONOMY_INFLUENCER_PLATFORMS: :"Creator Economy & Influencer Platforms" - ADVERTISING_ADTECH_MEDIA_BUYING: :"Advertising, Adtech & Media Buying" FILM_TV_PRODUCTION_STUDIOS: :"Film, TV & Production Studios" EVENTS_VENUES_LIVE_ENTERTAINMENT: :"Events, Venues & Live Entertainment" VIRTUAL_WORLDS_METAVERSE_EXPERIENCES: :"Virtual Worlds & Metaverse Experiences" @@ -773,6 +772,7 @@ module ContextDev STREETWEAR_EMERGING_LUXURY: :"Streetwear & Emerging Luxury" COUTURE_MADE_TO_MEASURE: :"Couture & Made-to-Measure" NEWS_PUBLISHING_JOURNALISM: :"News Publishing & Journalism" + ADVERTISING_ADTECH_MEDIA_BUYING: :"Advertising, Adtech & Media Buying" DIGITAL_MEDIA_CONTENT_PLATFORMS: :"Digital Media & Content Platforms" BROADCASTING_TV_RADIO: :"Broadcasting (TV & Radio)" PODCASTING_AUDIO_MEDIA: :"Podcasting & Audio Media" diff --git a/sig/context_dev/models/brand_retrieve_simplified_params.rbs b/sig/context_dev/models/brand_retrieve_simplified_params.rbs index 55cd5e37..28dc7381 100644 --- a/sig/context_dev/models/brand_retrieve_simplified_params.rbs +++ b/sig/context_dev/models/brand_retrieve_simplified_params.rbs @@ -3,8 +3,9 @@ module ContextDev type brand_retrieve_simplified_params = { domain: String, - max_age_ms: Integer, + max_age_ms: Integer?, tags: ::Array[String], + theme: ContextDev::Models::BrandRetrieveSimplifiedParams::theme, timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -15,33 +16,50 @@ module ContextDev attr_accessor domain: String - attr_reader max_age_ms: Integer? - - def max_age_ms=: (Integer) -> Integer + attr_accessor max_age_ms: Integer? attr_reader tags: ::Array[String]? def tags=: (::Array[String]) -> ::Array[String] + attr_reader theme: ContextDev::Models::BrandRetrieveSimplifiedParams::theme? + + def theme=: ( + ContextDev::Models::BrandRetrieveSimplifiedParams::theme + ) -> ContextDev::Models::BrandRetrieveSimplifiedParams::theme + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer def initialize: ( domain: String, - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?tags: ::Array[String], + ?theme: ContextDev::Models::BrandRetrieveSimplifiedParams::theme, ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { domain: String, - max_age_ms: Integer, + max_age_ms: Integer?, tags: ::Array[String], + theme: ContextDev::Models::BrandRetrieveSimplifiedParams::theme, timeout_ms: Integer, request_options: ContextDev::RequestOptions } + + type theme = :light | :dark + + module Theme + extend ContextDev::Internal::Type::Enum + + LIGHT: :light + DARK: :dark + + def self?.values: -> ::Array[ContextDev::Models::BrandRetrieveSimplifiedParams::theme] + end end end end diff --git a/sig/context_dev/models/monitor_list_account_runs_response.rbs b/sig/context_dev/models/monitor_list_account_runs_response.rbs index 0fa3d57a..8952e25b 100644 --- a/sig/context_dev/models/monitor_list_account_runs_response.rbs +++ b/sig/context_dev/models/monitor_list_account_runs_response.rbs @@ -42,8 +42,8 @@ module ContextDev error: ContextDev::Models::MonitorListAccountRunsResponse::Data::Error?, skip_reason: ContextDev::Models::MonitorListAccountRunsResponse::Data::skip_reason?, started_at: Time?, - webhook_deliveries: ::Array[ContextDev::WebhookDelivery], - webhook_delivery: ContextDev::WebhookDelivery + webhook_deliveries: ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery], + webhook_delivery: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery } class Data < ContextDev::Internal::Type::BaseModel @@ -75,17 +75,17 @@ module ContextDev attr_accessor started_at: Time? - attr_reader webhook_deliveries: ::Array[ContextDev::WebhookDelivery]? + attr_reader webhook_deliveries: ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery]? def webhook_deliveries=: ( - ::Array[ContextDev::WebhookDelivery] - ) -> ::Array[ContextDev::WebhookDelivery] + ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery] + ) -> ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery] - attr_reader webhook_delivery: ContextDev::WebhookDelivery? + attr_reader webhook_delivery: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery? def webhook_delivery=: ( - ContextDev::WebhookDelivery - ) -> ContextDev::WebhookDelivery + ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery + ) -> ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery def initialize: ( id: String, @@ -102,8 +102,8 @@ module ContextDev ?error: ContextDev::Models::MonitorListAccountRunsResponse::Data::Error?, ?skip_reason: ContextDev::Models::MonitorListAccountRunsResponse::Data::skip_reason?, ?started_at: Time?, - ?webhook_deliveries: ::Array[ContextDev::WebhookDelivery], - ?webhook_delivery: ContextDev::WebhookDelivery + ?webhook_deliveries: ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery], + ?webhook_delivery: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery ) -> void def to_hash: -> { @@ -121,8 +121,8 @@ module ContextDev error: ContextDev::Models::MonitorListAccountRunsResponse::Data::Error?, skip_reason: ContextDev::Models::MonitorListAccountRunsResponse::Data::skip_reason?, started_at: Time?, - webhook_deliveries: ::Array[ContextDev::WebhookDelivery], - webhook_delivery: ContextDev::WebhookDelivery + webhook_deliveries: ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery], + webhook_delivery: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery } type change_detection_type = :exact | :semantic @@ -196,6 +196,84 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::skip_reason] end + + type webhook_delivery = + { + attempted_at: Time, + error: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error?, + event: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event, + event_id: String, + http_status: Integer?, + status: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status + } + + class WebhookDelivery < ContextDev::Internal::Type::BaseModel + attr_accessor attempted_at: Time + + attr_accessor error: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error? + + attr_accessor event: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event + + attr_accessor event_id: String + + attr_accessor http_status: Integer? + + attr_accessor status: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status + + def initialize: ( + attempted_at: Time, + error: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error?, + event: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event, + event_id: String, + http_status: Integer?, + status: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status + ) -> void + + def to_hash: -> { + attempted_at: Time, + error: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error?, + event: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event, + event_id: String, + http_status: Integer?, + status: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status + } + + type error = { code: String, message: String } + + class Error < ContextDev::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor message: String + + def initialize: (code: String, message: String) -> void + + def to_hash: -> { code: String, message: String } + end + + type event = :"change.detected" | :"run.completed" + + module Event + extend ContextDev::Internal::Type::Enum + + CHANGE_DETECTED: :"change.detected" + RUN_COMPLETED: :"run.completed" + + def self?.values: -> ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event] + end + + type status = :delivered | :rejected | :failed | :skipped_unsafe_url + + module Status + extend ContextDev::Internal::Type::Enum + + DELIVERED: :delivered + REJECTED: :rejected + FAILED: :failed + SKIPPED_UNSAFE_URL: :skipped_unsafe_url + + def self?.values: -> ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status] + end + end end end end diff --git a/sig/context_dev/models/monitor_list_params.rbs b/sig/context_dev/models/monitor_list_params.rbs index 25fc6296..2b8aaa3d 100644 --- a/sig/context_dev/models/monitor_list_params.rbs +++ b/sig/context_dev/models/monitor_list_params.rbs @@ -6,11 +6,11 @@ module ContextDev cursor: String, limit: Integer, q: String, - search_by: ::Array[ContextDev::Models::MonitorListParams::search_by], + search_by: ::Array[ContextDev::Models::MonitorListParams::search_by]?, search_type: ContextDev::Models::MonitorListParams::search_type, status: ContextDev::Models::MonitorListParams::status, tag: String, - tags: ::Array[String], + tags: ::Array[String]?, target_type: ContextDev::Models::MonitorListParams::target_type } & ContextDev::Internal::Type::request_parameters @@ -37,11 +37,7 @@ module ContextDev def q=: (String) -> String - attr_reader search_by: ::Array[ContextDev::Models::MonitorListParams::search_by]? - - def search_by=: ( - ::Array[ContextDev::Models::MonitorListParams::search_by] - ) -> ::Array[ContextDev::Models::MonitorListParams::search_by] + attr_accessor search_by: ::Array[ContextDev::Models::MonitorListParams::search_by]? attr_reader search_type: ContextDev::Models::MonitorListParams::search_type? @@ -59,9 +55,7 @@ module ContextDev def tag=: (String) -> String - attr_reader tags: ::Array[String]? - - def tags=: (::Array[String]) -> ::Array[String] + attr_accessor tags: ::Array[String]? attr_reader target_type: ContextDev::Models::MonitorListParams::target_type? @@ -74,11 +68,11 @@ module ContextDev ?cursor: String, ?limit: Integer, ?q: String, - ?search_by: ::Array[ContextDev::Models::MonitorListParams::search_by], + ?search_by: ::Array[ContextDev::Models::MonitorListParams::search_by]?, ?search_type: ContextDev::Models::MonitorListParams::search_type, ?status: ContextDev::Models::MonitorListParams::status, ?tag: String, - ?tags: ::Array[String], + ?tags: ::Array[String]?, ?target_type: ContextDev::Models::MonitorListParams::target_type, ?request_options: ContextDev::request_opts ) -> void @@ -88,11 +82,11 @@ module ContextDev cursor: String, limit: Integer, q: String, - search_by: ::Array[ContextDev::Models::MonitorListParams::search_by], + search_by: ::Array[ContextDev::Models::MonitorListParams::search_by]?, search_type: ContextDev::Models::MonitorListParams::search_type, status: ContextDev::Models::MonitorListParams::status, tag: String, - tags: ::Array[String], + tags: ::Array[String]?, target_type: ContextDev::Models::MonitorListParams::target_type, request_options: ContextDev::RequestOptions } diff --git a/sig/context_dev/models/monitor_list_runs_response.rbs b/sig/context_dev/models/monitor_list_runs_response.rbs index ee5bdcf4..6bf77e09 100644 --- a/sig/context_dev/models/monitor_list_runs_response.rbs +++ b/sig/context_dev/models/monitor_list_runs_response.rbs @@ -42,8 +42,8 @@ module ContextDev error: ContextDev::Models::MonitorListRunsResponse::Data::Error?, skip_reason: ContextDev::Models::MonitorListRunsResponse::Data::skip_reason?, started_at: Time?, - webhook_deliveries: ::Array[ContextDev::WebhookDelivery], - webhook_delivery: ContextDev::WebhookDelivery + webhook_deliveries: ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery], + webhook_delivery: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery } class Data < ContextDev::Internal::Type::BaseModel @@ -75,17 +75,17 @@ module ContextDev attr_accessor started_at: Time? - attr_reader webhook_deliveries: ::Array[ContextDev::WebhookDelivery]? + attr_reader webhook_deliveries: ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery]? def webhook_deliveries=: ( - ::Array[ContextDev::WebhookDelivery] - ) -> ::Array[ContextDev::WebhookDelivery] + ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery] + ) -> ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery] - attr_reader webhook_delivery: ContextDev::WebhookDelivery? + attr_reader webhook_delivery: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery? def webhook_delivery=: ( - ContextDev::WebhookDelivery - ) -> ContextDev::WebhookDelivery + ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery + ) -> ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery def initialize: ( id: String, @@ -102,8 +102,8 @@ module ContextDev ?error: ContextDev::Models::MonitorListRunsResponse::Data::Error?, ?skip_reason: ContextDev::Models::MonitorListRunsResponse::Data::skip_reason?, ?started_at: Time?, - ?webhook_deliveries: ::Array[ContextDev::WebhookDelivery], - ?webhook_delivery: ContextDev::WebhookDelivery + ?webhook_deliveries: ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery], + ?webhook_delivery: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery ) -> void def to_hash: -> { @@ -121,8 +121,8 @@ module ContextDev error: ContextDev::Models::MonitorListRunsResponse::Data::Error?, skip_reason: ContextDev::Models::MonitorListRunsResponse::Data::skip_reason?, started_at: Time?, - webhook_deliveries: ::Array[ContextDev::WebhookDelivery], - webhook_delivery: ContextDev::WebhookDelivery + webhook_deliveries: ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery], + webhook_delivery: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery } type change_detection_type = :exact | :semantic @@ -196,6 +196,84 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::MonitorListRunsResponse::Data::skip_reason] end + + type webhook_delivery = + { + attempted_at: Time, + error: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error?, + event: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event, + event_id: String, + http_status: Integer?, + status: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status + } + + class WebhookDelivery < ContextDev::Internal::Type::BaseModel + attr_accessor attempted_at: Time + + attr_accessor error: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error? + + attr_accessor event: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event + + attr_accessor event_id: String + + attr_accessor http_status: Integer? + + attr_accessor status: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status + + def initialize: ( + attempted_at: Time, + error: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error?, + event: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event, + event_id: String, + http_status: Integer?, + status: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status + ) -> void + + def to_hash: -> { + attempted_at: Time, + error: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error?, + event: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event, + event_id: String, + http_status: Integer?, + status: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status + } + + type error = { code: String, message: String } + + class Error < ContextDev::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor message: String + + def initialize: (code: String, message: String) -> void + + def to_hash: -> { code: String, message: String } + end + + type event = :"change.detected" | :"run.completed" + + module Event + extend ContextDev::Internal::Type::Enum + + CHANGE_DETECTED: :"change.detected" + RUN_COMPLETED: :"run.completed" + + def self?.values: -> ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event] + end + + type status = :delivered | :rejected | :failed | :skipped_unsafe_url + + module Status + extend ContextDev::Internal::Type::Enum + + DELIVERED: :delivered + REJECTED: :rejected + FAILED: :failed + SKIPPED_UNSAFE_URL: :skipped_unsafe_url + + def self?.values: -> ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status] + end + end end end end diff --git a/sig/context_dev/models/parse_handle_params.rbs b/sig/context_dev/models/parse_handle_params.rbs index e04ff1f8..2c7e030f 100644 --- a/sig/context_dev/models/parse_handle_params.rbs +++ b/sig/context_dev/models/parse_handle_params.rbs @@ -3,14 +3,15 @@ module ContextDev type parse_handle_params = { body: ContextDev::Internal::file_input, + client: String, extension: ContextDev::Models::ParseHandleParams::extension, - include_images: bool, - include_links: bool, - ocr: bool, + include_images: ContextDev::Models::ParseHandleParams::include_images, + include_links: ContextDev::Models::ParseHandleParams::include_links, + ocr: ContextDev::Models::ParseHandleParams::ocr, pdf: ContextDev::ParseHandleParams::Pdf, - :shorten_base64_images => bool, + :shorten_base64_images => ContextDev::Models::ParseHandleParams::shorten_base64_images, tags: ::Array[String], - use_main_content_only: bool + use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only } & ContextDev::Internal::Type::request_parameters @@ -20,23 +21,33 @@ module ContextDev attr_accessor body: ContextDev::Internal::file_input + attr_reader client: String? + + def client=: (String) -> String + attr_reader extension: ContextDev::Models::ParseHandleParams::extension? def extension=: ( ContextDev::Models::ParseHandleParams::extension ) -> ContextDev::Models::ParseHandleParams::extension - attr_reader include_images: bool? + attr_reader include_images: ContextDev::Models::ParseHandleParams::include_images? - def include_images=: (bool) -> bool + def include_images=: ( + ContextDev::Models::ParseHandleParams::include_images + ) -> ContextDev::Models::ParseHandleParams::include_images - attr_reader include_links: bool? + attr_reader include_links: ContextDev::Models::ParseHandleParams::include_links? - def include_links=: (bool) -> bool + def include_links=: ( + ContextDev::Models::ParseHandleParams::include_links + ) -> ContextDev::Models::ParseHandleParams::include_links - attr_reader ocr: bool? + attr_reader ocr: ContextDev::Models::ParseHandleParams::ocr? - def ocr=: (bool) -> bool + def ocr=: ( + ContextDev::Models::ParseHandleParams::ocr + ) -> ContextDev::Models::ParseHandleParams::ocr attr_reader pdf: ContextDev::ParseHandleParams::Pdf? @@ -44,41 +55,47 @@ module ContextDev ContextDev::ParseHandleParams::Pdf ) -> ContextDev::ParseHandleParams::Pdf - attr_reader shorten_base64_images: bool? + attr_reader shorten_base64_images: ContextDev::Models::ParseHandleParams::shorten_base64_images? - def shorten_base64_images=: (bool) -> bool + def shorten_base64_images=: ( + ContextDev::Models::ParseHandleParams::shorten_base64_images + ) -> ContextDev::Models::ParseHandleParams::shorten_base64_images attr_reader tags: ::Array[String]? def tags=: (::Array[String]) -> ::Array[String] - attr_reader use_main_content_only: bool? + attr_reader use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only? - def use_main_content_only=: (bool) -> bool + def use_main_content_only=: ( + ContextDev::Models::ParseHandleParams::use_main_content_only + ) -> ContextDev::Models::ParseHandleParams::use_main_content_only def initialize: ( body: ContextDev::Internal::file_input, + ?client: String, ?extension: ContextDev::Models::ParseHandleParams::extension, - ?include_images: bool, - ?include_links: bool, - ?ocr: bool, + ?include_images: ContextDev::Models::ParseHandleParams::include_images, + ?include_links: ContextDev::Models::ParseHandleParams::include_links, + ?ocr: ContextDev::Models::ParseHandleParams::ocr, ?pdf: ContextDev::ParseHandleParams::Pdf, - ?shorten_base64_images: bool, + ?shorten_base64_images: ContextDev::Models::ParseHandleParams::shorten_base64_images, ?tags: ::Array[String], - ?use_main_content_only: bool, + ?use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { body: ContextDev::Internal::file_input, + client: String, extension: ContextDev::Models::ParseHandleParams::extension, - include_images: bool, - include_links: bool, - ocr: bool, + include_images: ContextDev::Models::ParseHandleParams::include_images, + include_links: ContextDev::Models::ParseHandleParams::include_links, + ocr: ContextDev::Models::ParseHandleParams::ocr, pdf: ContextDev::ParseHandleParams::Pdf, - :shorten_base64_images => bool, + :shorten_base64_images => ContextDev::Models::ParseHandleParams::shorten_base64_images, tags: ::Array[String], - use_main_content_only: bool, + use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only, request_options: ContextDev::RequestOptions } @@ -231,6 +248,39 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::ParseHandleParams::extension] end + type include_images = bool | :true | :false + + module IncludeImages + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::ParseHandleParams::include_images] + + TRUE: :true + FALSE: :false + end + + type include_links = bool | :true | :false + + module IncludeLinks + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::ParseHandleParams::include_links] + + TRUE: :true + FALSE: :false + end + + type ocr = bool | :true | :false + + module Ocr + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::ParseHandleParams::ocr] + + TRUE: :true + FALSE: :false + end + type pdf = { end_: Integer, start: Integer } class Pdf < ContextDev::Internal::Type::BaseModel @@ -246,6 +296,28 @@ module ContextDev def to_hash: -> { end_: Integer, start: Integer } end + + type shorten_base64_images = bool | :true | :false + + module ShortenBase64Images + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::ParseHandleParams::shorten_base64_images] + + TRUE: :true + FALSE: :false + end + + type use_main_content_only = bool | :true | :false + + module UseMainContentOnly + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::ParseHandleParams::use_main_content_only] + + TRUE: :true + FALSE: :false + end end end end diff --git a/sig/context_dev/models/web_extract_fonts_params.rbs b/sig/context_dev/models/web_extract_fonts_params.rbs index bd8e93fb..620e70c9 100644 --- a/sig/context_dev/models/web_extract_fonts_params.rbs +++ b/sig/context_dev/models/web_extract_fonts_params.rbs @@ -4,7 +4,7 @@ module ContextDev { direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: Integer?, tags: ::Array[String], timeout_ms: Integer } @@ -22,9 +22,7 @@ module ContextDev def domain=: (String) -> String - attr_reader max_age_ms: Integer? - - def max_age_ms=: (Integer) -> Integer + attr_accessor max_age_ms: Integer? attr_reader tags: ::Array[String]? @@ -37,7 +35,7 @@ module ContextDev def initialize: ( ?direct_url: String, ?domain: String, - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts @@ -46,7 +44,7 @@ module ContextDev def to_hash: -> { direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: Integer?, tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions diff --git a/sig/context_dev/models/web_extract_styleguide_params.rbs b/sig/context_dev/models/web_extract_styleguide_params.rbs index f1c598f3..8964a619 100644 --- a/sig/context_dev/models/web_extract_styleguide_params.rbs +++ b/sig/context_dev/models/web_extract_styleguide_params.rbs @@ -5,7 +5,7 @@ module ContextDev color_scheme: ContextDev::Models::WebExtractStyleguideParams::color_scheme, direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: Integer?, tags: ::Array[String], timeout_ms: Integer } @@ -29,9 +29,7 @@ module ContextDev def domain=: (String) -> String - attr_reader max_age_ms: Integer? - - def max_age_ms=: (Integer) -> Integer + attr_accessor max_age_ms: Integer? attr_reader tags: ::Array[String]? @@ -45,7 +43,7 @@ module ContextDev ?color_scheme: ContextDev::Models::WebExtractStyleguideParams::color_scheme, ?direct_url: String, ?domain: String, - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts @@ -55,7 +53,7 @@ module ContextDev color_scheme: ContextDev::Models::WebExtractStyleguideParams::color_scheme, direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: Integer?, tags: ::Array[String], timeout_ms: Integer, request_options: ContextDev::RequestOptions diff --git a/sig/context_dev/models/web_screenshot_params.rbs b/sig/context_dev/models/web_screenshot_params.rbs index 06a6597c..a0487d8c 100644 --- a/sig/context_dev/models/web_screenshot_params.rbs +++ b/sig/context_dev/models/web_screenshot_params.rbs @@ -8,13 +8,13 @@ module ContextDev domain: String, full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, handle_cookie_popup: ContextDev::Models::WebScreenshotParams::handle_cookie_popup, - max_age_ms: Integer, + max_age_ms: Integer?, page: ContextDev::Models::WebScreenshotParams::page, - scroll_offset: Integer, + scroll_offset: Integer?, tags: ::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, - wait_for_ms: Integer + wait_for_ms: Integer? } & ContextDev::Internal::Type::request_parameters @@ -54,9 +54,7 @@ module ContextDev ContextDev::Models::WebScreenshotParams::handle_cookie_popup ) -> ContextDev::Models::WebScreenshotParams::handle_cookie_popup - attr_reader max_age_ms: Integer? - - def max_age_ms=: (Integer) -> Integer + attr_accessor max_age_ms: Integer? attr_reader page: ContextDev::Models::WebScreenshotParams::page? @@ -64,9 +62,7 @@ module ContextDev ContextDev::Models::WebScreenshotParams::page ) -> ContextDev::Models::WebScreenshotParams::page - attr_reader scroll_offset: Integer? - - def scroll_offset=: (Integer) -> Integer + attr_accessor scroll_offset: Integer? attr_reader tags: ::Array[String]? @@ -82,9 +78,7 @@ module ContextDev ContextDev::WebScreenshotParams::Viewport ) -> ContextDev::WebScreenshotParams::Viewport - attr_reader wait_for_ms: Integer? - - def wait_for_ms=: (Integer) -> Integer + attr_accessor wait_for_ms: Integer? def initialize: ( ?color_scheme: ContextDev::Models::WebScreenshotParams::color_scheme, @@ -93,13 +87,13 @@ module ContextDev ?domain: String, ?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, ?handle_cookie_popup: ContextDev::Models::WebScreenshotParams::handle_cookie_popup, - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?page: ContextDev::Models::WebScreenshotParams::page, - ?scroll_offset: Integer, + ?scroll_offset: Integer?, ?tags: ::Array[String], ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, - ?wait_for_ms: Integer, + ?wait_for_ms: Integer?, ?request_options: ContextDev::request_opts ) -> void @@ -110,13 +104,13 @@ module ContextDev domain: String, full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, handle_cookie_popup: ContextDev::Models::WebScreenshotParams::handle_cookie_popup, - max_age_ms: Integer, + max_age_ms: Integer?, page: ContextDev::Models::WebScreenshotParams::page, - scroll_offset: Integer, + scroll_offset: Integer?, tags: ::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, - wait_for_ms: Integer, + wait_for_ms: Integer?, request_options: ContextDev::RequestOptions } @@ -559,15 +553,15 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::full_screenshot] end - type handle_cookie_popup = :true | :false + type handle_cookie_popup = bool | :true | :false module HandleCookiePopup - extend ContextDev::Internal::Type::Enum + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebScreenshotParams::handle_cookie_popup] TRUE: :true FALSE: :false - - def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::handle_cookie_popup] end type page = diff --git a/sig/context_dev/models/web_web_scrape_html_params.rbs b/sig/context_dev/models/web_web_scrape_html_params.rbs index 4b9b2cc7..4758d897 100644 --- a/sig/context_dev/models/web_web_scrape_html_params.rbs +++ b/sig/context_dev/models/web_web_scrape_html_params.rbs @@ -4,17 +4,17 @@ module ContextDev { url: String, country: ContextDev::Models::WebWebScrapeHTMLParams::country, - exclude_selectors: ::Array[String], + exclude_selectors: ::Array[String]?, headers: ::Hash[Symbol, String], - include_frames: bool, - include_selectors: ::Array[String], - max_age_ms: Integer, + include_frames: ContextDev::Models::WebWebScrapeHTMLParams::include_frames, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, - settle_animations: bool, + settle_animations: ContextDev::Models::WebWebScrapeHTMLParams::settle_animations, tags: ::Array[String], timeout_ms: Integer, - use_main_content_only: bool, - wait_for_ms: Integer + use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only, + wait_for_ms: Integer? } & ContextDev::Internal::Type::request_parameters @@ -30,25 +30,21 @@ module ContextDev ContextDev::Models::WebWebScrapeHTMLParams::country ) -> ContextDev::Models::WebWebScrapeHTMLParams::country - attr_reader exclude_selectors: ::Array[String]? - - def exclude_selectors=: (::Array[String]) -> ::Array[String] + attr_accessor exclude_selectors: ::Array[String]? attr_reader headers: ::Hash[Symbol, String]? def headers=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] - attr_reader include_frames: bool? - - def include_frames=: (bool) -> bool + attr_reader include_frames: ContextDev::Models::WebWebScrapeHTMLParams::include_frames? - attr_reader include_selectors: ::Array[String]? + def include_frames=: ( + ContextDev::Models::WebWebScrapeHTMLParams::include_frames + ) -> ContextDev::Models::WebWebScrapeHTMLParams::include_frames - def include_selectors=: (::Array[String]) -> ::Array[String] + attr_accessor include_selectors: ::Array[String]? - attr_reader max_age_ms: Integer? - - def max_age_ms=: (Integer) -> Integer + attr_accessor max_age_ms: Integer? attr_reader pdf: ContextDev::WebWebScrapeHTMLParams::Pdf? @@ -56,9 +52,11 @@ module ContextDev ContextDev::WebWebScrapeHTMLParams::Pdf ) -> ContextDev::WebWebScrapeHTMLParams::Pdf - attr_reader settle_animations: bool? + attr_reader settle_animations: ContextDev::Models::WebWebScrapeHTMLParams::settle_animations? - def settle_animations=: (bool) -> bool + def settle_animations=: ( + ContextDev::Models::WebWebScrapeHTMLParams::settle_animations + ) -> ContextDev::Models::WebWebScrapeHTMLParams::settle_animations attr_reader tags: ::Array[String]? @@ -68,45 +66,45 @@ module ContextDev def timeout_ms=: (Integer) -> Integer - attr_reader use_main_content_only: bool? - - def use_main_content_only=: (bool) -> bool + attr_reader use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only? - attr_reader wait_for_ms: Integer? + def use_main_content_only=: ( + ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only + ) -> ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only - def wait_for_ms=: (Integer) -> Integer + attr_accessor wait_for_ms: Integer? def initialize: ( url: String, ?country: ContextDev::Models::WebWebScrapeHTMLParams::country, - ?exclude_selectors: ::Array[String], + ?exclude_selectors: ::Array[String]?, ?headers: ::Hash[Symbol, String], - ?include_frames: bool, - ?include_selectors: ::Array[String], - ?max_age_ms: Integer, + ?include_frames: ContextDev::Models::WebWebScrapeHTMLParams::include_frames, + ?include_selectors: ::Array[String]?, + ?max_age_ms: Integer?, ?pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, - ?settle_animations: bool, + ?settle_animations: ContextDev::Models::WebWebScrapeHTMLParams::settle_animations, ?tags: ::Array[String], ?timeout_ms: Integer, - ?use_main_content_only: bool, - ?wait_for_ms: Integer, + ?use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only, + ?wait_for_ms: Integer?, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { url: String, country: ContextDev::Models::WebWebScrapeHTMLParams::country, - exclude_selectors: ::Array[String], + exclude_selectors: ::Array[String]?, headers: ::Hash[Symbol, String], - include_frames: bool, - include_selectors: ::Array[String], - max_age_ms: Integer, + include_frames: ContextDev::Models::WebWebScrapeHTMLParams::include_frames, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, - settle_animations: bool, + settle_animations: ContextDev::Models::WebWebScrapeHTMLParams::settle_animations, tags: ::Array[String], timeout_ms: Integer, - use_main_content_only: bool, - wait_for_ms: Integer, + use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only, + wait_for_ms: Integer?, request_options: ContextDev::RequestOptions } @@ -527,21 +525,41 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::WebWebScrapeHTMLParams::country] end + type include_frames = bool | :true | :false + + module IncludeFrames + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeHTMLParams::include_frames] + + TRUE: :true + FALSE: :false + end + type pdf = - { end_: Integer, ocr: bool, should_parse: bool, start: Integer } + { + end_: Integer, + ocr: ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ocr, + should_parse: ContextDev::Models::WebWebScrapeHTMLParams::Pdf::should_parse, + start: Integer + } class Pdf < ContextDev::Internal::Type::BaseModel attr_reader end_: Integer? def end_=: (Integer) -> Integer - attr_reader ocr: bool? + attr_reader ocr: ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ocr? - def ocr=: (bool) -> bool + def ocr=: ( + ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ocr + ) -> ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ocr - attr_reader should_parse: bool? + attr_reader should_parse: ContextDev::Models::WebWebScrapeHTMLParams::Pdf::should_parse? - def should_parse=: (bool) -> bool + def should_parse=: ( + ContextDev::Models::WebWebScrapeHTMLParams::Pdf::should_parse + ) -> ContextDev::Models::WebWebScrapeHTMLParams::Pdf::should_parse attr_reader start: Integer? @@ -549,17 +567,61 @@ module ContextDev def initialize: ( ?end_: Integer, - ?ocr: bool, - ?should_parse: bool, + ?ocr: ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ocr, + ?should_parse: ContextDev::Models::WebWebScrapeHTMLParams::Pdf::should_parse, ?start: Integer ) -> void def to_hash: -> { end_: Integer, - ocr: bool, - should_parse: bool, + ocr: ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ocr, + should_parse: ContextDev::Models::WebWebScrapeHTMLParams::Pdf::should_parse, start: Integer } + + type ocr = bool | :true | :false + + module Ocr + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeHTMLParams::Pdf::ocr] + + TRUE: :true + FALSE: :false + end + + type should_parse = bool | :true | :false + + module ShouldParse + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeHTMLParams::Pdf::should_parse] + + TRUE: :true + FALSE: :false + end + end + + type settle_animations = bool | :true | :false + + module SettleAnimations + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeHTMLParams::settle_animations] + + TRUE: :true + FALSE: :false + end + + type use_main_content_only = bool | :true | :false + + module UseMainContentOnly + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only] + + TRUE: :true + FALSE: :false end end end diff --git a/sig/context_dev/models/web_web_scrape_images_params.rbs b/sig/context_dev/models/web_web_scrape_images_params.rbs index 492b921f..7648fb36 100644 --- a/sig/context_dev/models/web_web_scrape_images_params.rbs +++ b/sig/context_dev/models/web_web_scrape_images_params.rbs @@ -3,13 +3,13 @@ module ContextDev type web_web_scrape_images_params = { url: String, - dedupe: bool, - enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, + dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe, + enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment?, headers: ::Hash[Symbol, String], - max_age_ms: Integer, + max_age_ms: Integer?, tags: ::Array[String], timeout_ms: Integer, - wait_for_ms: Integer + wait_for_ms: Integer? } & ContextDev::Internal::Type::request_parameters @@ -19,23 +19,19 @@ module ContextDev attr_accessor url: String - attr_reader dedupe: bool? + attr_reader dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe? - def dedupe=: (bool) -> bool + def dedupe=: ( + ContextDev::Models::WebWebScrapeImagesParams::dedupe + ) -> ContextDev::Models::WebWebScrapeImagesParams::dedupe - attr_reader enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment? - - def enrichment=: ( - ContextDev::WebWebScrapeImagesParams::Enrichment - ) -> ContextDev::WebWebScrapeImagesParams::Enrichment + attr_accessor enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment? attr_reader headers: ::Hash[Symbol, String]? def headers=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] - attr_reader max_age_ms: Integer? - - def max_age_ms=: (Integer) -> Integer + attr_accessor max_age_ms: Integer? attr_reader tags: ::Array[String]? @@ -45,72 +41,120 @@ module ContextDev def timeout_ms=: (Integer) -> Integer - attr_reader wait_for_ms: Integer? - - def wait_for_ms=: (Integer) -> Integer + attr_accessor wait_for_ms: Integer? def initialize: ( url: String, - ?dedupe: bool, - ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, + ?dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe, + ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment?, ?headers: ::Hash[Symbol, String], - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?tags: ::Array[String], ?timeout_ms: Integer, - ?wait_for_ms: Integer, + ?wait_for_ms: Integer?, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { url: String, - dedupe: bool, - enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, + dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe, + enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment?, headers: ::Hash[Symbol, String], - max_age_ms: Integer, + max_age_ms: Integer?, tags: ::Array[String], timeout_ms: Integer, - wait_for_ms: Integer, + wait_for_ms: Integer?, request_options: ContextDev::RequestOptions } + type dedupe = bool | :true | :false + + module Dedupe + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeImagesParams::dedupe] + + TRUE: :true + FALSE: :false + end + type enrichment = { - classification: bool, - hosted_url: bool, + classification: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::classification, + hosted_url: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::hosted_url, max_time_per_ms: Integer, - resolution: bool + resolution: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::resolution } class Enrichment < ContextDev::Internal::Type::BaseModel - attr_reader classification: bool? + attr_reader classification: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::classification? - def classification=: (bool) -> bool + def classification=: ( + ContextDev::Models::WebWebScrapeImagesParams::Enrichment::classification + ) -> ContextDev::Models::WebWebScrapeImagesParams::Enrichment::classification - attr_reader hosted_url: bool? + attr_reader hosted_url: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::hosted_url? - def hosted_url=: (bool) -> bool + def hosted_url=: ( + ContextDev::Models::WebWebScrapeImagesParams::Enrichment::hosted_url + ) -> ContextDev::Models::WebWebScrapeImagesParams::Enrichment::hosted_url attr_reader max_time_per_ms: Integer? def max_time_per_ms=: (Integer) -> Integer - attr_reader resolution: bool? + attr_reader resolution: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::resolution? - def resolution=: (bool) -> bool + def resolution=: ( + ContextDev::Models::WebWebScrapeImagesParams::Enrichment::resolution + ) -> ContextDev::Models::WebWebScrapeImagesParams::Enrichment::resolution def initialize: ( - ?classification: bool, - ?hosted_url: bool, + ?classification: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::classification, + ?hosted_url: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::hosted_url, ?max_time_per_ms: Integer, - ?resolution: bool + ?resolution: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::resolution ) -> void def to_hash: -> { - classification: bool, - hosted_url: bool, + classification: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::classification, + hosted_url: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::hosted_url, max_time_per_ms: Integer, - resolution: bool + resolution: ContextDev::Models::WebWebScrapeImagesParams::Enrichment::resolution } + + type classification = bool | :true | :false + + module Classification + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeImagesParams::Enrichment::classification] + + TRUE: :true + FALSE: :false + end + + type hosted_url = bool | :true | :false + + module HostedURL + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeImagesParams::Enrichment::hosted_url] + + TRUE: :true + FALSE: :false + end + + type resolution = bool | :true | :false + + module Resolution + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeImagesParams::Enrichment::resolution] + + TRUE: :true + FALSE: :false + end end end end diff --git a/sig/context_dev/models/web_web_scrape_md_params.rbs b/sig/context_dev/models/web_web_scrape_md_params.rbs index b2eada93..0cf17831 100644 --- a/sig/context_dev/models/web_web_scrape_md_params.rbs +++ b/sig/context_dev/models/web_web_scrape_md_params.rbs @@ -4,20 +4,20 @@ module ContextDev { url: String, country: ContextDev::Models::WebWebScrapeMdParams::country, - exclude_selectors: ::Array[String], + exclude_selectors: ::Array[String]?, headers: ::Hash[Symbol, String], - include_frames: bool, - include_images: bool, - include_links: bool, - include_selectors: ::Array[String], - max_age_ms: Integer, + include_frames: ContextDev::Models::WebWebScrapeMdParams::include_frames, + include_images: ContextDev::Models::WebWebScrapeMdParams::include_images, + include_links: ContextDev::Models::WebWebScrapeMdParams::include_links, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, pdf: ContextDev::WebWebScrapeMdParams::Pdf, - settle_animations: bool, - :shorten_base64_images => bool, + settle_animations: ContextDev::Models::WebWebScrapeMdParams::settle_animations, + :shorten_base64_images => ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images, tags: ::Array[String], timeout_ms: Integer, - use_main_content_only: bool, - wait_for_ms: Integer + use_main_content_only: ContextDev::Models::WebWebScrapeMdParams::use_main_content_only, + wait_for_ms: Integer? } & ContextDev::Internal::Type::request_parameters @@ -33,33 +33,33 @@ module ContextDev ContextDev::Models::WebWebScrapeMdParams::country ) -> ContextDev::Models::WebWebScrapeMdParams::country - attr_reader exclude_selectors: ::Array[String]? - - def exclude_selectors=: (::Array[String]) -> ::Array[String] + attr_accessor exclude_selectors: ::Array[String]? attr_reader headers: ::Hash[Symbol, String]? def headers=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] - attr_reader include_frames: bool? - - def include_frames=: (bool) -> bool - - attr_reader include_images: bool? + attr_reader include_frames: ContextDev::Models::WebWebScrapeMdParams::include_frames? - def include_images=: (bool) -> bool + def include_frames=: ( + ContextDev::Models::WebWebScrapeMdParams::include_frames + ) -> ContextDev::Models::WebWebScrapeMdParams::include_frames - attr_reader include_links: bool? + attr_reader include_images: ContextDev::Models::WebWebScrapeMdParams::include_images? - def include_links=: (bool) -> bool + def include_images=: ( + ContextDev::Models::WebWebScrapeMdParams::include_images + ) -> ContextDev::Models::WebWebScrapeMdParams::include_images - attr_reader include_selectors: ::Array[String]? + attr_reader include_links: ContextDev::Models::WebWebScrapeMdParams::include_links? - def include_selectors=: (::Array[String]) -> ::Array[String] + def include_links=: ( + ContextDev::Models::WebWebScrapeMdParams::include_links + ) -> ContextDev::Models::WebWebScrapeMdParams::include_links - attr_reader max_age_ms: Integer? + attr_accessor include_selectors: ::Array[String]? - def max_age_ms=: (Integer) -> Integer + attr_accessor max_age_ms: Integer? attr_reader pdf: ContextDev::WebWebScrapeMdParams::Pdf? @@ -67,13 +67,17 @@ module ContextDev ContextDev::WebWebScrapeMdParams::Pdf ) -> ContextDev::WebWebScrapeMdParams::Pdf - attr_reader settle_animations: bool? + attr_reader settle_animations: ContextDev::Models::WebWebScrapeMdParams::settle_animations? - def settle_animations=: (bool) -> bool + def settle_animations=: ( + ContextDev::Models::WebWebScrapeMdParams::settle_animations + ) -> ContextDev::Models::WebWebScrapeMdParams::settle_animations - attr_reader shorten_base64_images: bool? + attr_reader shorten_base64_images: ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images? - def shorten_base64_images=: (bool) -> bool + def shorten_base64_images=: ( + ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images + ) -> ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images attr_reader tags: ::Array[String]? @@ -83,51 +87,51 @@ module ContextDev def timeout_ms=: (Integer) -> Integer - attr_reader use_main_content_only: bool? + attr_reader use_main_content_only: ContextDev::Models::WebWebScrapeMdParams::use_main_content_only? - def use_main_content_only=: (bool) -> bool + def use_main_content_only=: ( + ContextDev::Models::WebWebScrapeMdParams::use_main_content_only + ) -> ContextDev::Models::WebWebScrapeMdParams::use_main_content_only - attr_reader wait_for_ms: Integer? - - def wait_for_ms=: (Integer) -> Integer + attr_accessor wait_for_ms: Integer? def initialize: ( url: String, ?country: ContextDev::Models::WebWebScrapeMdParams::country, - ?exclude_selectors: ::Array[String], + ?exclude_selectors: ::Array[String]?, ?headers: ::Hash[Symbol, String], - ?include_frames: bool, - ?include_images: bool, - ?include_links: bool, - ?include_selectors: ::Array[String], - ?max_age_ms: Integer, + ?include_frames: ContextDev::Models::WebWebScrapeMdParams::include_frames, + ?include_images: ContextDev::Models::WebWebScrapeMdParams::include_images, + ?include_links: ContextDev::Models::WebWebScrapeMdParams::include_links, + ?include_selectors: ::Array[String]?, + ?max_age_ms: Integer?, ?pdf: ContextDev::WebWebScrapeMdParams::Pdf, - ?settle_animations: bool, - ?shorten_base64_images: bool, + ?settle_animations: ContextDev::Models::WebWebScrapeMdParams::settle_animations, + ?shorten_base64_images: ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images, ?tags: ::Array[String], ?timeout_ms: Integer, - ?use_main_content_only: bool, - ?wait_for_ms: Integer, + ?use_main_content_only: ContextDev::Models::WebWebScrapeMdParams::use_main_content_only, + ?wait_for_ms: Integer?, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { url: String, country: ContextDev::Models::WebWebScrapeMdParams::country, - exclude_selectors: ::Array[String], + exclude_selectors: ::Array[String]?, headers: ::Hash[Symbol, String], - include_frames: bool, - include_images: bool, - include_links: bool, - include_selectors: ::Array[String], - max_age_ms: Integer, + include_frames: ContextDev::Models::WebWebScrapeMdParams::include_frames, + include_images: ContextDev::Models::WebWebScrapeMdParams::include_images, + include_links: ContextDev::Models::WebWebScrapeMdParams::include_links, + include_selectors: ::Array[String]?, + max_age_ms: Integer?, pdf: ContextDev::WebWebScrapeMdParams::Pdf, - settle_animations: bool, - :shorten_base64_images => bool, + settle_animations: ContextDev::Models::WebWebScrapeMdParams::settle_animations, + :shorten_base64_images => ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images, tags: ::Array[String], timeout_ms: Integer, - use_main_content_only: bool, - wait_for_ms: Integer, + use_main_content_only: ContextDev::Models::WebWebScrapeMdParams::use_main_content_only, + wait_for_ms: Integer?, request_options: ContextDev::RequestOptions } @@ -548,21 +552,63 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::country] end + type include_frames = bool | :true | :false + + module IncludeFrames + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::include_frames] + + TRUE: :true + FALSE: :false + end + + type include_images = bool | :true | :false + + module IncludeImages + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::include_images] + + TRUE: :true + FALSE: :false + end + + type include_links = bool | :true | :false + + module IncludeLinks + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::include_links] + + TRUE: :true + FALSE: :false + end + type pdf = - { end_: Integer, ocr: bool, should_parse: bool, start: Integer } + { + end_: Integer, + ocr: ContextDev::Models::WebWebScrapeMdParams::Pdf::ocr, + should_parse: ContextDev::Models::WebWebScrapeMdParams::Pdf::should_parse, + start: Integer + } class Pdf < ContextDev::Internal::Type::BaseModel attr_reader end_: Integer? def end_=: (Integer) -> Integer - attr_reader ocr: bool? + attr_reader ocr: ContextDev::Models::WebWebScrapeMdParams::Pdf::ocr? - def ocr=: (bool) -> bool + def ocr=: ( + ContextDev::Models::WebWebScrapeMdParams::Pdf::ocr + ) -> ContextDev::Models::WebWebScrapeMdParams::Pdf::ocr - attr_reader should_parse: bool? + attr_reader should_parse: ContextDev::Models::WebWebScrapeMdParams::Pdf::should_parse? - def should_parse=: (bool) -> bool + def should_parse=: ( + ContextDev::Models::WebWebScrapeMdParams::Pdf::should_parse + ) -> ContextDev::Models::WebWebScrapeMdParams::Pdf::should_parse attr_reader start: Integer? @@ -570,17 +616,72 @@ module ContextDev def initialize: ( ?end_: Integer, - ?ocr: bool, - ?should_parse: bool, + ?ocr: ContextDev::Models::WebWebScrapeMdParams::Pdf::ocr, + ?should_parse: ContextDev::Models::WebWebScrapeMdParams::Pdf::should_parse, ?start: Integer ) -> void def to_hash: -> { end_: Integer, - ocr: bool, - should_parse: bool, + ocr: ContextDev::Models::WebWebScrapeMdParams::Pdf::ocr, + should_parse: ContextDev::Models::WebWebScrapeMdParams::Pdf::should_parse, start: Integer } + + type ocr = bool | :true | :false + + module Ocr + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::Pdf::ocr] + + TRUE: :true + FALSE: :false + end + + type should_parse = bool | :true | :false + + module ShouldParse + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::Pdf::should_parse] + + TRUE: :true + FALSE: :false + end + end + + type settle_animations = bool | :true | :false + + module SettleAnimations + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::settle_animations] + + TRUE: :true + FALSE: :false + end + + type shorten_base64_images = bool | :true | :false + + module ShortenBase64Images + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images] + + TRUE: :true + FALSE: :false + end + + type use_main_content_only = bool | :true | :false + + module UseMainContentOnly + extend ContextDev::Internal::Type::Union + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::use_main_content_only] + + TRUE: :true + FALSE: :false end end end diff --git a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs index b6d22a7b..1b0a28d7 100644 --- a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +++ b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs @@ -5,6 +5,7 @@ module ContextDev domain: String, headers: ::Hash[Symbol, String], max_links: Integer, + sitemap_url: String, tags: ::Array[String], timeout_ms: Integer, url_regex: String @@ -25,6 +26,10 @@ module ContextDev def max_links=: (Integer) -> Integer + attr_reader sitemap_url: String? + + def sitemap_url=: (String) -> String + attr_reader tags: ::Array[String]? def tags=: (::Array[String]) -> ::Array[String] @@ -41,6 +46,7 @@ module ContextDev domain: String, ?headers: ::Hash[Symbol, String], ?max_links: Integer, + ?sitemap_url: String, ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, @@ -51,6 +57,7 @@ module ContextDev domain: String, headers: ::Hash[Symbol, String], max_links: Integer, + sitemap_url: String, tags: ::Array[String], timeout_ms: Integer, url_regex: String, diff --git a/sig/context_dev/models/webhook_delivery.rbs b/sig/context_dev/models/webhook_delivery.rbs deleted file mode 100644 index 7120f647..00000000 --- a/sig/context_dev/models/webhook_delivery.rbs +++ /dev/null @@ -1,81 +0,0 @@ -module ContextDev - module Models - type webhook_delivery = - { - attempted_at: Time, - error: ContextDev::WebhookDelivery::Error?, - event: ContextDev::Models::WebhookDelivery::event, - event_id: String, - http_status: Integer?, - status: ContextDev::Models::WebhookDelivery::status - } - - class WebhookDelivery < ContextDev::Internal::Type::BaseModel - attr_accessor attempted_at: Time - - attr_accessor error: ContextDev::WebhookDelivery::Error? - - attr_accessor event: ContextDev::Models::WebhookDelivery::event - - attr_accessor event_id: String - - attr_accessor http_status: Integer? - - attr_accessor status: ContextDev::Models::WebhookDelivery::status - - def initialize: ( - attempted_at: Time, - error: ContextDev::WebhookDelivery::Error?, - event: ContextDev::Models::WebhookDelivery::event, - event_id: String, - http_status: Integer?, - status: ContextDev::Models::WebhookDelivery::status - ) -> void - - def to_hash: -> { - attempted_at: Time, - error: ContextDev::WebhookDelivery::Error?, - event: ContextDev::Models::WebhookDelivery::event, - event_id: String, - http_status: Integer?, - status: ContextDev::Models::WebhookDelivery::status - } - - type error = { code: String, message: String } - - class Error < ContextDev::Internal::Type::BaseModel - attr_accessor code: String - - attr_accessor message: String - - def initialize: (code: String, message: String) -> void - - def to_hash: -> { code: String, message: String } - end - - type event = :"change.detected" | :"run.completed" - - module Event - extend ContextDev::Internal::Type::Enum - - CHANGE_DETECTED: :"change.detected" - RUN_COMPLETED: :"run.completed" - - def self?.values: -> ::Array[ContextDev::Models::WebhookDelivery::event] - end - - type status = :delivered | :rejected | :failed | :skipped_unsafe_url - - module Status - extend ContextDev::Internal::Type::Enum - - DELIVERED: :delivered - REJECTED: :rejected - FAILED: :failed - SKIPPED_UNSAFE_URL: :skipped_unsafe_url - - def self?.values: -> ::Array[ContextDev::Models::WebhookDelivery::status] - end - end - end -end diff --git a/sig/context_dev/resources/brand.rbs b/sig/context_dev/resources/brand.rbs index 7fddce31..5da33e16 100644 --- a/sig/context_dev/resources/brand.rbs +++ b/sig/context_dev/resources/brand.rbs @@ -8,8 +8,9 @@ module ContextDev def retrieve_simplified: ( domain: String, - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?tags: ::Array[String], + ?theme: ContextDev::Models::BrandRetrieveSimplifiedParams::theme, ?timeout_ms: Integer, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::BrandRetrieveSimplifiedResponse diff --git a/sig/context_dev/resources/monitors.rbs b/sig/context_dev/resources/monitors.rbs index 62c1ed9a..0273ebff 100644 --- a/sig/context_dev/resources/monitors.rbs +++ b/sig/context_dev/resources/monitors.rbs @@ -34,11 +34,11 @@ module ContextDev ?cursor: String, ?limit: Integer, ?q: String, - ?search_by: ::Array[ContextDev::Models::MonitorListParams::search_by], + ?search_by: ::Array[ContextDev::Models::MonitorListParams::search_by]?, ?search_type: ContextDev::Models::MonitorListParams::search_type, ?status: ContextDev::Models::MonitorListParams::status, ?tag: String, - ?tags: ::Array[String], + ?tags: ::Array[String]?, ?target_type: ContextDev::Models::MonitorListParams::target_type, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::MonitorListResponse diff --git a/sig/context_dev/resources/parse.rbs b/sig/context_dev/resources/parse.rbs index 57ec18f2..02188b49 100644 --- a/sig/context_dev/resources/parse.rbs +++ b/sig/context_dev/resources/parse.rbs @@ -3,14 +3,15 @@ module ContextDev class Parse def handle: ( body: ContextDev::Internal::file_input, + ?client: String, ?extension: ContextDev::Models::ParseHandleParams::extension, - ?include_images: bool, - ?include_links: bool, - ?ocr: bool, + ?include_images: ContextDev::Models::ParseHandleParams::include_images, + ?include_links: ContextDev::Models::ParseHandleParams::include_links, + ?ocr: ContextDev::Models::ParseHandleParams::ocr, ?pdf: ContextDev::ParseHandleParams::Pdf, - ?shorten_base64_images: bool, + ?shorten_base64_images: ContextDev::Models::ParseHandleParams::shorten_base64_images, ?tags: ::Array[String], - ?use_main_content_only: bool, + ?use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::ParseHandleResponse diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index cb4b9f63..8b6be7fa 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -30,7 +30,7 @@ module ContextDev def extract_fonts: ( ?direct_url: String, ?domain: String, - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts @@ -40,7 +40,7 @@ module ContextDev ?color_scheme: ContextDev::Models::WebExtractStyleguideParams::color_scheme, ?direct_url: String, ?domain: String, - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?tags: ::Array[String], ?timeout_ms: Integer, ?request_options: ContextDev::request_opts @@ -53,13 +53,13 @@ module ContextDev ?domain: String, ?full_screenshot: ContextDev::Models::WebScreenshotParams::full_screenshot, ?handle_cookie_popup: ContextDev::Models::WebScreenshotParams::handle_cookie_popup, - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?page: ContextDev::Models::WebScreenshotParams::page, - ?scroll_offset: Integer, + ?scroll_offset: Integer?, ?tags: ::Array[String], ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, - ?wait_for_ms: Integer, + ?wait_for_ms: Integer?, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebScreenshotResponse @@ -104,49 +104,49 @@ module ContextDev def web_scrape_html: ( url: String, ?country: ContextDev::Models::WebWebScrapeHTMLParams::country, - ?exclude_selectors: ::Array[String], + ?exclude_selectors: ::Array[String]?, ?headers: ::Hash[Symbol, String], - ?include_frames: bool, - ?include_selectors: ::Array[String], - ?max_age_ms: Integer, + ?include_frames: ContextDev::Models::WebWebScrapeHTMLParams::include_frames, + ?include_selectors: ::Array[String]?, + ?max_age_ms: Integer?, ?pdf: ContextDev::WebWebScrapeHTMLParams::Pdf, - ?settle_animations: bool, + ?settle_animations: ContextDev::Models::WebWebScrapeHTMLParams::settle_animations, ?tags: ::Array[String], ?timeout_ms: Integer, - ?use_main_content_only: bool, - ?wait_for_ms: Integer, + ?use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only, + ?wait_for_ms: Integer?, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeHTMLResponse def web_scrape_images: ( url: String, - ?dedupe: bool, - ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, + ?dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe, + ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment?, ?headers: ::Hash[Symbol, String], - ?max_age_ms: Integer, + ?max_age_ms: Integer?, ?tags: ::Array[String], ?timeout_ms: Integer, - ?wait_for_ms: Integer, + ?wait_for_ms: Integer?, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeImagesResponse def web_scrape_md: ( url: String, ?country: ContextDev::Models::WebWebScrapeMdParams::country, - ?exclude_selectors: ::Array[String], + ?exclude_selectors: ::Array[String]?, ?headers: ::Hash[Symbol, String], - ?include_frames: bool, - ?include_images: bool, - ?include_links: bool, - ?include_selectors: ::Array[String], - ?max_age_ms: Integer, + ?include_frames: ContextDev::Models::WebWebScrapeMdParams::include_frames, + ?include_images: ContextDev::Models::WebWebScrapeMdParams::include_images, + ?include_links: ContextDev::Models::WebWebScrapeMdParams::include_links, + ?include_selectors: ::Array[String]?, + ?max_age_ms: Integer?, ?pdf: ContextDev::WebWebScrapeMdParams::Pdf, - ?settle_animations: bool, - ?shorten_base64_images: bool, + ?settle_animations: ContextDev::Models::WebWebScrapeMdParams::settle_animations, + ?shorten_base64_images: ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images, ?tags: ::Array[String], ?timeout_ms: Integer, - ?use_main_content_only: bool, - ?wait_for_ms: Integer, + ?use_main_content_only: ContextDev::Models::WebWebScrapeMdParams::use_main_content_only, + ?wait_for_ms: Integer?, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeMdResponse @@ -154,6 +154,7 @@ module ContextDev domain: String, ?headers: ::Hash[Symbol, String], ?max_links: Integer, + ?sitemap_url: String, ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, diff --git a/test/context_dev/resources/brand_test.rb b/test/context_dev/resources/brand_test.rb index 8d64400b..e382ff84 100644 --- a/test/context_dev/resources/brand_test.rb +++ b/test/context_dev/resources/brand_test.rb @@ -25,7 +25,7 @@ def test_retrieve_required_params def test_retrieve_simplified_required_params skip("Mock server tests are disabled") - response = @context_dev.brand.retrieve_simplified(domain: "domain") + response = @context_dev.brand.retrieve_simplified(domain: "xxx") assert_pattern do response => ContextDev::Models::BrandRetrieveSimplifiedResponse diff --git a/test/context_dev/resources/industry_test.rb b/test/context_dev/resources/industry_test.rb index 68c71272..6928b57e 100644 --- a/test/context_dev/resources/industry_test.rb +++ b/test/context_dev/resources/industry_test.rb @@ -6,7 +6,7 @@ class ContextDev::Test::Resources::IndustryTest < ContextDev::Test::ResourceTest def test_retrieve_naics_required_params skip("Mock server tests are disabled") - response = @context_dev.industry.retrieve_naics(input: "input") + response = @context_dev.industry.retrieve_naics(input: "xxxx") assert_pattern do response => ContextDev::Models::IndustryRetrieveNaicsResponse @@ -26,7 +26,7 @@ def test_retrieve_naics_required_params def test_retrieve_sic_required_params skip("Mock server tests are disabled") - response = @context_dev.industry.retrieve_sic(input: "input") + response = @context_dev.industry.retrieve_sic(input: "xxxx") assert_pattern do response => ContextDev::Models::IndustryRetrieveSicResponse diff --git a/test/context_dev/resources/utility_test.rb b/test/context_dev/resources/utility_test.rb index fe3c1eff..3c7d8d2b 100644 --- a/test/context_dev/resources/utility_test.rb +++ b/test/context_dev/resources/utility_test.rb @@ -6,7 +6,7 @@ class ContextDev::Test::Resources::UtilityTest < ContextDev::Test::ResourceTest def test_prefetch_required_params skip("Mock server tests are disabled") - response = @context_dev.utility.prefetch(identifier: {domain: "domain"}, type: :brand) + response = @context_dev.utility.prefetch(identifier: {domain: "xxx"}, type: :brand) assert_pattern do response => ContextDev::Models::UtilityPrefetchResponse diff --git a/test/context_dev/resources/web_test.rb b/test/context_dev/resources/web_test.rb index 8b35a29a..e905e9a6 100644 --- a/test/context_dev/resources/web_test.rb +++ b/test/context_dev/resources/web_test.rb @@ -212,7 +212,7 @@ def test_web_scrape_md_required_params def test_web_scrape_sitemap_required_params skip("Mock server tests are disabled") - response = @context_dev.web.web_scrape_sitemap(domain: "domain") + response = @context_dev.web.web_scrape_sitemap(domain: "xxx") assert_pattern do response => ContextDev::Models::WebWebScrapeSitemapResponse From f1c36e95f04eb617aa1769ba9cd21e3dad7bc5ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2026 02:03:16 +0000 Subject: [PATCH 03/13] feat(stlc): configurable CI runner and private-production-repo support in workflow templates --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 597ba0f1..d2cfb520 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: permissions: contents: read id-token: write - runs-on: ${{ github.repository == 'stainless-sdks/context.dev-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: |- github.repository == 'stainless-sdks/context.dev-ruby' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') @@ -56,7 +56,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/context.dev-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: @@ -73,7 +73,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/context.dev-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 From 2574f7db809d8480db2b7ae2705fd2de6a1ce2ff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 19 Jul 2026 19:36:12 +0000 Subject: [PATCH 04/13] feat(api): api update --- .stats.yml | 4 +- .../models/ai_extract_product_params.rb | 6 +-- .../models/ai_extract_products_params.rb | 12 ++--- .../models/brand_retrieve_params.rb | 36 +++++--------- .../models/utility_prefetch_params.rb | 6 +-- lib/context_dev/models/web_extract_params.rb | 18 +++++-- lib/context_dev/models/web_search_params.rb | 6 +-- .../models/web_web_crawl_md_params.rb | 6 +-- lib/context_dev/resources/ai.rb | 2 +- lib/context_dev/resources/utility.rb | 2 +- lib/context_dev/resources/web.rb | 10 ++-- .../models/ai_extract_product_params.rbi | 8 +--- .../models/ai_extract_products_params.rbi | 16 ++----- .../models/brand_retrieve_params.rbi | 48 +++++-------------- .../models/utility_prefetch_params.rbi | 8 +--- rbi/context_dev/models/web_extract_params.rbi | 23 ++++++--- rbi/context_dev/models/web_search_params.rbi | 8 +--- .../models/web_web_crawl_md_params.rbi | 8 +--- rbi/context_dev/resources/ai.rbi | 4 +- rbi/context_dev/resources/utility.rbi | 4 +- rbi/context_dev/resources/web.rbi | 17 ++++--- sig/context_dev/models/web_extract_params.rbs | 7 +++ sig/context_dev/resources/web.rbs | 1 + 23 files changed, 106 insertions(+), 154 deletions(-) diff --git a/.stats.yml b/.stats.yml index b9d1d304..91b45dcb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d49b84cf1125618f171698ff1ee4ff9a8d04151619cb4a56d650103869834465.yml -openapi_spec_hash: 49b7a6f59dcdff1e2bf88feb6474a562 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-8cd70a2b5bd380b75e5f94dc376bd8c704ee0431bdfe8af1b017facc2b883097.yml +openapi_spec_hash: bb1d32ae5c46be85ee8bb3b13f5b1150 config_hash: daabb160675d86b354711da1e77e5129 diff --git a/lib/context_dev/models/ai_extract_product_params.rb b/lib/context_dev/models/ai_extract_product_params.rb index 35c26782..23ebb9b3 100644 --- a/lib/context_dev/models/ai_extract_product_params.rb +++ b/lib/context_dev/models/ai_extract_product_params.rb @@ -22,9 +22,7 @@ class AIExtractProductParams < ContextDev::Internal::Type::BaseModel optional :max_age_ms, Integer, api_name: :maxAgeMs # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -45,7 +43,7 @@ class AIExtractProductParams < ContextDev::Internal::Type::BaseModel # # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # diff --git a/lib/context_dev/models/ai_extract_products_params.rb b/lib/context_dev/models/ai_extract_products_params.rb index 3b45ca88..d9509ff6 100644 --- a/lib/context_dev/models/ai_extract_products_params.rb +++ b/lib/context_dev/models/ai_extract_products_params.rb @@ -45,9 +45,7 @@ class ByDomain < ContextDev::Internal::Type::BaseModel optional :max_products, Integer, api_name: :maxProducts # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -70,7 +68,7 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # # @param max_products [Integer] Maximum number of products to extract. # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th end @@ -98,9 +96,7 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel optional :max_products, Integer, api_name: :maxProducts # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -124,7 +120,7 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # # @param max_products [Integer] Maximum number of products to extract. # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th end diff --git a/lib/context_dev/models/brand_retrieve_params.rb b/lib/context_dev/models/brand_retrieve_params.rb index 639ebc09..3e89650e 100644 --- a/lib/context_dev/models/brand_retrieve_params.rb +++ b/lib/context_dev/models/brand_retrieve_params.rb @@ -80,9 +80,7 @@ class ByDomain < ContextDev::Internal::Type::BaseModel optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -109,7 +107,7 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # @@ -290,9 +288,7 @@ class ByName < ContextDev::Internal::Type::BaseModel optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -322,7 +318,7 @@ class ByName < ContextDev::Internal::Type::BaseModel # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # @@ -496,9 +492,7 @@ class ByEmail < ContextDev::Internal::Type::BaseModel optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -527,7 +521,7 @@ class ByEmail < ContextDev::Internal::Type::BaseModel # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # @@ -701,9 +695,7 @@ class ByTicker < ContextDev::Internal::Type::BaseModel optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -737,7 +729,7 @@ class ByTicker < ContextDev::Internal::Type::BaseModel # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param ticker_exchange [String] Optional stock exchange for the ticker. Defaults to NASDAQ if not specified. # @@ -891,9 +883,7 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel required :type, const: :by_direct_url # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -918,7 +908,7 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # # @param direct_url [String] Full http(s) URL to fetch brand data from (e.g., 'https://stripe.com/enterprise' # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # @@ -987,9 +977,7 @@ class ByTransaction < ContextDev::Internal::Type::BaseModel optional :phone, union: -> { ContextDev::BrandRetrieveParams::Body::ByTransaction::Phone } # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -1025,7 +1013,7 @@ class ByTransaction < ContextDev::Internal::Type::BaseModel # # @param phone [String, Float] Optional phone number from the transaction to help verify brand match. # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # diff --git a/lib/context_dev/models/utility_prefetch_params.rb b/lib/context_dev/models/utility_prefetch_params.rb index 6e1cbbf6..e9aad7cb 100644 --- a/lib/context_dev/models/utility_prefetch_params.rb +++ b/lib/context_dev/models/utility_prefetch_params.rb @@ -20,9 +20,7 @@ class UtilityPrefetchParams < ContextDev::Internal::Type::BaseModel required :type, enum: -> { ContextDev::UtilityPrefetchParams::Type } # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -43,7 +41,7 @@ class UtilityPrefetchParams < ContextDev::Internal::Type::BaseModel # # @param type [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] What to prefetch. Currently only 'brand' is supported. # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # diff --git a/lib/context_dev/models/web_extract_params.rb b/lib/context_dev/models/web_extract_params.rb index f1ff45c8..cce22e2d 100644 --- a/lib/context_dev/models/web_extract_params.rb +++ b/lib/context_dev/models/web_extract_params.rb @@ -77,6 +77,14 @@ class WebExtractParams < ContextDev::Internal::Type::BaseModel # @return [ContextDev::Models::WebExtractParams::Pdf, nil] optional :pdf, -> { ContextDev::WebExtractParams::Pdf } + # @!attribute settle_animations + # When true, waits briefly for CSS and transition animations to settle before + # extracting each crawled page. Defaults to false. This adds a bit of latency in + # exchange for more stable output on animated pages. + # + # @return [Boolean, nil] + optional :settle_animations, ContextDev::Internal::Type::Boolean, api_name: :settleAnimations + # @!attribute stop_after_ms # Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 # (110s). Default: 80000 (80s). @@ -85,9 +93,7 @@ class WebExtractParams < ContextDev::Internal::Type::BaseModel optional :stop_after_ms, Integer, api_name: :stopAfterMs # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -107,7 +113,7 @@ class WebExtractParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer, api_name: :waitForMs - # @!method initialize(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) + # @!method initialize(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebExtractParams} for more details. # @@ -131,9 +137,11 @@ class WebExtractParams < ContextDev::Internal::Type::BaseModel # # @param pdf [ContextDev::Models::WebExtractParams::Pdf] # + # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr + # # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (1 # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # diff --git a/lib/context_dev/models/web_search_params.rb b/lib/context_dev/models/web_search_params.rb index 3e33d278..0625a7aa 100644 --- a/lib/context_dev/models/web_search_params.rb +++ b/lib/context_dev/models/web_search_params.rb @@ -62,9 +62,7 @@ class WebSearchParams < ContextDev::Internal::Type::BaseModel optional :query_fanout, ContextDev::Internal::Type::Boolean, api_name: :queryFanout # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -97,7 +95,7 @@ class WebSearchParams < ContextDev::Internal::Type::BaseModel # # @param query_fanout [Boolean] Expand the query into multiple parallel variants for broader recall. # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # diff --git a/lib/context_dev/models/web_web_crawl_md_params.rb b/lib/context_dev/models/web_web_crawl_md_params.rb index b422665e..30bb7f8a 100644 --- a/lib/context_dev/models/web_web_crawl_md_params.rb +++ b/lib/context_dev/models/web_web_crawl_md_params.rb @@ -116,9 +116,7 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel optional :stop_after_ms, Integer, api_name: :stopAfterMs # @!attribute tags - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -185,7 +183,7 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. After each scrape, the crawler c # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # diff --git a/lib/context_dev/resources/ai.rb b/lib/context_dev/resources/ai.rb index f992823b..85b54470 100644 --- a/lib/context_dev/resources/ai.rb +++ b/lib/context_dev/resources/ai.rb @@ -15,7 +15,7 @@ class AI # # @param max_age_ms [Integer] Return a cached result if a prior scrape for the same parameters exists and is y # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # diff --git a/lib/context_dev/resources/utility.rb b/lib/context_dev/resources/utility.rb index 46dd6b75..9e50987f 100644 --- a/lib/context_dev/resources/utility.rb +++ b/lib/context_dev/resources/utility.rb @@ -17,7 +17,7 @@ class Utility # # @param type [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] What to prefetch. Currently only 'brand' is supported. # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 2fa263ca..ac53de33 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -9,7 +9,7 @@ class Web # Crawl a website, use the provided JSON Schema and instructions to prioritize # relevant internal links, and extract structured data from the selected pages. # - # @overload extract(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) + # @overload extract(schema:, url:, fact_check: nil, follow_subdomains: nil, include_frames: nil, instructions: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # # @param schema [Hash{Symbol=>Object}] JSON Schema for the returned data object. TypeScript Zod users can pass a JSON S # @@ -31,9 +31,11 @@ class Web # # @param pdf [ContextDev::Models::WebExtractParams::Pdf] # + # @param settle_animations [Boolean] When true, waits briefly for CSS and transition animations to settle before extr + # # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (1 # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # @@ -251,7 +253,7 @@ def screenshot(params = {}) # # @param query_fanout [Boolean] Expand the query into multiple parallel variants for broader recall. # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # @@ -309,7 +311,7 @@ def search(params) # # @param stop_after_ms [Integer] Soft time budget for the crawl in milliseconds. After each scrape, the crawler c # - # @param tags [Array] Optional caller-defined tags for tracking this request. Tags are recorded on the + # @param tags [Array] Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # diff --git a/rbi/context_dev/models/ai_extract_product_params.rbi b/rbi/context_dev/models/ai_extract_product_params.rbi index 522492ce..3c78efbe 100644 --- a/rbi/context_dev/models/ai_extract_product_params.rbi +++ b/rbi/context_dev/models/ai_extract_product_params.rbi @@ -27,9 +27,7 @@ module ContextDev sig { params(max_age_ms: Integer).void } attr_writer :max_age_ms - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -61,9 +59,7 @@ module ContextDev # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed diff --git a/rbi/context_dev/models/ai_extract_products_params.rbi b/rbi/context_dev/models/ai_extract_products_params.rbi index 6742af70..f00517f6 100644 --- a/rbi/context_dev/models/ai_extract_products_params.rbi +++ b/rbi/context_dev/models/ai_extract_products_params.rbi @@ -92,9 +92,7 @@ module ContextDev sig { params(max_products: Integer).void } attr_writer :max_products - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -128,9 +126,7 @@ module ContextDev max_age_ms: nil, # Maximum number of products to extract. max_products: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -184,9 +180,7 @@ module ContextDev sig { params(max_products: Integer).void } attr_writer :max_products - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -221,9 +215,7 @@ module ContextDev max_age_ms: nil, # Maximum number of products to extract. max_products: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed diff --git a/rbi/context_dev/models/brand_retrieve_params.rbi b/rbi/context_dev/models/brand_retrieve_params.rbi index da889614..d74de8bc 100644 --- a/rbi/context_dev/models/brand_retrieve_params.rbi +++ b/rbi/context_dev/models/brand_retrieve_params.rbi @@ -127,9 +127,7 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -173,9 +171,7 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -883,9 +879,7 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -934,9 +928,7 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -1637,9 +1629,7 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -1685,9 +1675,7 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -2387,9 +2375,7 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -2442,9 +2428,7 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional stock exchange for the ticker. Defaults to NASDAQ if not specified. ticker_exchange: nil, @@ -3121,9 +3105,7 @@ module ContextDev sig { returns(Symbol) } attr_accessor :type - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -3157,9 +3139,7 @@ module ContextDev # 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire # internet. direct_url:, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -3279,9 +3259,7 @@ module ContextDev end attr_writer :phone - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -3340,9 +3318,7 @@ module ContextDev mcc: nil, # Optional phone number from the transaction to help verify brand match. phone: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed diff --git a/rbi/context_dev/models/utility_prefetch_params.rbi b/rbi/context_dev/models/utility_prefetch_params.rbi index 9586eada..fd5ed61f 100644 --- a/rbi/context_dev/models/utility_prefetch_params.rbi +++ b/rbi/context_dev/models/utility_prefetch_params.rbi @@ -29,9 +29,7 @@ module ContextDev sig { returns(ContextDev::UtilityPrefetchParams::Type::OrSymbol) } attr_accessor :type - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -65,9 +63,7 @@ module ContextDev identifier:, # What to prefetch. Currently only 'brand' is supported. type:, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed diff --git a/rbi/context_dev/models/web_extract_params.rbi b/rbi/context_dev/models/web_extract_params.rbi index 07a13711..ed351d32 100644 --- a/rbi/context_dev/models/web_extract_params.rbi +++ b/rbi/context_dev/models/web_extract_params.rbi @@ -85,6 +85,15 @@ module ContextDev sig { params(pdf: ContextDev::WebExtractParams::Pdf::OrHash).void } attr_writer :pdf + # When true, waits briefly for CSS and transition animations to settle before + # extracting each crawled page. Defaults to false. This adds a bit of latency in + # exchange for more stable output on animated pages. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :settle_animations + + sig { params(settle_animations: T::Boolean).void } + attr_writer :settle_animations + # Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 # (110s). Default: 80000 (80s). sig { returns(T.nilable(Integer)) } @@ -93,9 +102,7 @@ module ContextDev sig { params(stop_after_ms: Integer).void } attr_writer :stop_after_ms - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -131,6 +138,7 @@ module ContextDev max_depth: Integer, max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf::OrHash, + settle_animations: T::Boolean, stop_after_ms: Integer, tags: T::Array[String], timeout_ms: Integer, @@ -169,12 +177,14 @@ module ContextDev # Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5. max_pages: nil, pdf: nil, + # When true, waits briefly for CSS and transition animations to settle before + # extracting each crawled page. Defaults to false. This adds a bit of latency in + # exchange for more stable output on animated pages. + settle_animations: nil, # Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 # (110s). Default: 80000 (80s). stop_after_ms: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -200,6 +210,7 @@ module ContextDev max_depth: Integer, max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf, + settle_animations: T::Boolean, stop_after_ms: Integer, tags: T::Array[String], timeout_ms: Integer, diff --git a/rbi/context_dev/models/web_search_params.rbi b/rbi/context_dev/models/web_search_params.rbi index 2bc1c7b9..32996cc8 100644 --- a/rbi/context_dev/models/web_search_params.rbi +++ b/rbi/context_dev/models/web_search_params.rbi @@ -78,9 +78,7 @@ module ContextDev sig { params(query_fanout: T::Boolean).void } attr_writer :query_fanout - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -133,9 +131,7 @@ module ContextDev num_results: nil, # Expand the query into multiple parallel variants for broader recall. query_fanout: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed diff --git a/rbi/context_dev/models/web_web_crawl_md_params.rbi b/rbi/context_dev/models/web_web_crawl_md_params.rbi index f0d59fd3..32d82e26 100644 --- a/rbi/context_dev/models/web_web_crawl_md_params.rbi +++ b/rbi/context_dev/models/web_web_crawl_md_params.rbi @@ -135,9 +135,7 @@ module ContextDev sig { params(stop_after_ms: Integer).void } attr_writer :stop_after_ms - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -250,9 +248,7 @@ module ContextDev # instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 # (80s). stop_after_ms: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed diff --git a/rbi/context_dev/resources/ai.rbi b/rbi/context_dev/resources/ai.rbi index 424669bf..27608cac 100644 --- a/rbi/context_dev/resources/ai.rbi +++ b/rbi/context_dev/resources/ai.rbi @@ -21,9 +21,7 @@ module ContextDev # younger than this many milliseconds. Defaults to 7 days (604800000 ms) when # omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh. max_age_ms: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed diff --git a/rbi/context_dev/resources/utility.rbi b/rbi/context_dev/resources/utility.rbi index a83323e1..a9937a5f 100644 --- a/rbi/context_dev/resources/utility.rbi +++ b/rbi/context_dev/resources/utility.rbi @@ -25,9 +25,7 @@ module ContextDev identifier:, # What to prefetch. Currently only 'brand' is supported. type:, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 722a2c97..4789eb99 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -17,6 +17,7 @@ module ContextDev max_depth: Integer, max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf::OrHash, + settle_animations: T::Boolean, stop_after_ms: Integer, tags: T::Array[String], timeout_ms: Integer, @@ -55,12 +56,14 @@ module ContextDev # Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5. max_pages: nil, pdf: nil, + # When true, waits briefly for CSS and transition animations to settle before + # extracting each crawled page. Defaults to false. This adds a bit of latency in + # exchange for more stable output on animated pages. + settle_animations: nil, # Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 # (110s). Default: 80000 (80s). stop_after_ms: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -305,9 +308,7 @@ module ContextDev num_results: nil, # Expand the query into multiple parallel variants for broader recall. query_fanout: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed @@ -393,9 +394,7 @@ module ContextDev # instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 # (80s). stop_after_ms: nil, - # Optional caller-defined tags for tracking this request. Tags are recorded on the - # request's usage log and can be used to filter usage on the dashboard usage page. - # Up to 20 tags, each 1-50 characters. + # Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters. tags: nil, # Optional timeout in milliseconds for the request. If the request takes longer # than this value, it will be aborted with a 408 status code. Maximum allowed diff --git a/sig/context_dev/models/web_extract_params.rbs b/sig/context_dev/models/web_extract_params.rbs index dd5756c1..e04099ae 100644 --- a/sig/context_dev/models/web_extract_params.rbs +++ b/sig/context_dev/models/web_extract_params.rbs @@ -12,6 +12,7 @@ module ContextDev max_depth: Integer, max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf, + settle_animations: bool, stop_after_ms: Integer, tags: ::Array[String], timeout_ms: Integer, @@ -61,6 +62,10 @@ module ContextDev ContextDev::WebExtractParams::Pdf ) -> ContextDev::WebExtractParams::Pdf + attr_reader settle_animations: bool? + + def settle_animations=: (bool) -> bool + attr_reader stop_after_ms: Integer? def stop_after_ms=: (Integer) -> Integer @@ -88,6 +93,7 @@ module ContextDev ?max_depth: Integer, ?max_pages: Integer, ?pdf: ContextDev::WebExtractParams::Pdf, + ?settle_animations: bool, ?stop_after_ms: Integer, ?tags: ::Array[String], ?timeout_ms: Integer, @@ -106,6 +112,7 @@ module ContextDev max_depth: Integer, max_pages: Integer, pdf: ContextDev::WebExtractParams::Pdf, + settle_animations: bool, stop_after_ms: Integer, tags: ::Array[String], timeout_ms: Integer, diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 8b6be7fa..b0a0dd71 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -12,6 +12,7 @@ module ContextDev ?max_depth: Integer, ?max_pages: Integer, ?pdf: ContextDev::WebExtractParams::Pdf, + ?settle_animations: bool, ?stop_after_ms: Integer, ?tags: ::Array[String], ?timeout_ms: Integer, From 72e6d90baaeeb9181482488e7b49e511597d2175 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 17:28:30 +0000 Subject: [PATCH 05/13] feat(api): api update --- .stats.yml | 4 +- lib/context_dev/models/parse_handle_params.rb | 27 +++++++++- .../models/web_screenshot_params.rb | 27 +++++++++- .../models/web_screenshot_response.rb | 5 +- .../models/web_web_crawl_md_params.rb | 27 +++++++++- .../models/web_web_scrape_html_params.rb | 27 +++++++++- .../models/web_web_scrape_md_params.rb | 27 +++++++++- .../models/web_web_scrape_sitemap_params.rb | 27 +++++++++- lib/context_dev/resources/parse.rb | 4 +- lib/context_dev/resources/web.rb | 20 +++++-- .../models/parse_handle_params.rbi | 42 +++++++++++++++ .../models/web_screenshot_params.rbi | 42 +++++++++++++++ .../models/web_screenshot_response.rbi | 6 ++- .../models/web_web_crawl_md_params.rbi | 42 +++++++++++++++ .../models/web_web_scrape_html_params.rbi | 51 ++++++++++++++++++ .../models/web_web_scrape_md_params.rbi | 44 +++++++++++++++ .../models/web_web_scrape_sitemap_params.rbi | 54 +++++++++++++++++++ rbi/context_dev/resources/parse.rbi | 7 +++ rbi/context_dev/resources/web.rbi | 30 +++++++++++ .../models/parse_handle_params.rbs | 22 +++++++- .../models/web_screenshot_params.rbs | 22 +++++++- .../models/web_web_crawl_md_params.rbs | 22 +++++++- .../models/web_web_scrape_html_params.rbs | 22 +++++++- .../models/web_web_scrape_md_params.rbs | 22 +++++++- .../models/web_web_scrape_sitemap_params.rbs | 22 +++++++- sig/context_dev/resources/parse.rbs | 1 + sig/context_dev/resources/web.rbs | 5 ++ 27 files changed, 627 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index 91b45dcb..231a6da1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-8cd70a2b5bd380b75e5f94dc376bd8c704ee0431bdfe8af1b017facc2b883097.yml -openapi_spec_hash: bb1d32ae5c46be85ee8bb3b13f5b1150 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-42c531dcf60b5d35e3996c1a669a3fe2de19d8caedf2bfd69e4864a1041c9bfa.yml +openapi_spec_hash: e43dd84c75e6d710c7346b9f12c34738 config_hash: daabb160675d86b354711da1e77e5129 diff --git a/lib/context_dev/models/parse_handle_params.rb b/lib/context_dev/models/parse_handle_params.rb index 05367ade..1c98b649 100644 --- a/lib/context_dev/models/parse_handle_params.rb +++ b/lib/context_dev/models/parse_handle_params.rb @@ -72,7 +72,16 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly, nil] optional :use_main_content_only, union: -> { ContextDev::ParseHandleParams::UseMainContentOnly } - # @!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, request_options: {}) + # @!attribute zdr + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + # + # @return [Symbol, ContextDev::Models::ParseHandleParams::Zdr, nil] + optional :zdr, enum: -> { ContextDev::ParseHandleParams::Zdr } + + # @!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: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::ParseHandleParams} for more details. # @@ -96,6 +105,8 @@ class ParseHandleParams < ContextDev::Internal::Type::BaseModel # # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly] Extract only the main content from HTML-like inputs # + # @param zdr [Symbol, ContextDev::Models::ParseHandleParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] # Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, @@ -330,6 +341,20 @@ module UseMainContentOnly # @!endgroup end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED = :enabled + DISABLED = :disabled + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/context_dev/models/web_screenshot_params.rb b/lib/context_dev/models/web_screenshot_params.rb index 1dfd8915..5cc71b29 100644 --- a/lib/context_dev/models/web_screenshot_params.rb +++ b/lib/context_dev/models/web_screenshot_params.rb @@ -113,7 +113,16 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer, nil?: true - # @!method initialize(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, tags: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {}) + # @!attribute zdr + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + # + # @return [Symbol, ContextDev::Models::WebScreenshotParams::Zdr, nil] + optional :zdr, enum: -> { ContextDev::WebScreenshotParams::Zdr } + + # @!method initialize(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, tags: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebScreenshotParams} for more details. # @@ -143,6 +152,8 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before taking # + # @param zdr [Symbol, ContextDev::Models::WebScreenshotParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] # Optional parameter to choose the site's visual theme in the screenshot. Use @@ -453,6 +464,20 @@ class Viewport < ContextDev::Internal::Type::BaseModel # # @param width [Integer] Viewport width in pixels. end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED = :enabled + DISABLED = :disabled + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/context_dev/models/web_screenshot_response.rb b/lib/context_dev/models/web_screenshot_response.rb index d446463f..bfec9c69 100644 --- a/lib/context_dev/models/web_screenshot_response.rb +++ b/lib/context_dev/models/web_screenshot_response.rb @@ -30,7 +30,8 @@ class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel optional :key_metadata, -> { ContextDev::Models::WebScreenshotResponse::KeyMetadata } # @!attribute screenshot - # Public URL of the uploaded screenshot image + # Public image URL for standard requests, or an in-memory data URL when ZDR is + # enabled. # # @return [String, nil] optional :screenshot, String @@ -67,7 +68,7 @@ class WebScreenshotResponse < ContextDev::Internal::Type::BaseModel # # @param key_metadata [ContextDev::Models::WebScreenshotResponse::KeyMetadata] Metadata about the API key used for the request. Included in every response when # - # @param screenshot [String] Public URL of the uploaded screenshot image + # @param screenshot [String] Public image URL for standard requests, or an in-memory data URL when ZDR is ena # # @param screenshot_type [Symbol, ContextDev::Models::WebScreenshotResponse::ScreenshotType] Type of screenshot that was captured # diff --git a/lib/context_dev/models/web_web_crawl_md_params.rb b/lib/context_dev/models/web_web_crawl_md_params.rb index 30bb7f8a..90cc8b61 100644 --- a/lib/context_dev/models/web_web_crawl_md_params.rb +++ b/lib/context_dev/models/web_web_crawl_md_params.rb @@ -149,7 +149,16 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer, api_name: :waitForMs - # @!method initialize(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @!attribute zdr + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + # + # @return [Symbol, ContextDev::Models::WebWebCrawlMdParams::Zdr, nil] + optional :zdr, enum: -> { ContextDev::WebWebCrawlMdParams::Zdr } + + # @!method initialize(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebCrawlMdParams} for more details. # @@ -193,6 +202,8 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw # + # @param zdr [Symbol, ContextDev::Models::WebWebCrawlMdParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev @@ -454,6 +465,20 @@ class Pdf < ContextDev::Internal::Type::BaseModel # # @param start [Integer] First 1-based PDF page to parse. When omitted, parsing starts at the first page. end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED = :enabled + DISABLED = :disabled + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/context_dev/models/web_web_scrape_html_params.rb b/lib/context_dev/models/web_web_scrape_html_params.rb index 8da85ed4..90f87943 100644 --- a/lib/context_dev/models/web_web_scrape_html_params.rb +++ b/lib/context_dev/models/web_web_scrape_html_params.rb @@ -104,7 +104,16 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer, nil?: true - # @!method initialize(url:, 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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @!attribute zdr + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + # + # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr, nil] + optional :zdr, enum: -> { ContextDev::WebWebScrapeHTMLParams::Zdr } + + # @!method initialize(url:, 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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeHTMLParams} for more details. # @@ -134,6 +143,8 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load. Min: 0. Max: # + # @param zdr [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev @@ -532,6 +543,20 @@ module UseMainContentOnly # @!endgroup end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED = :enabled + DISABLED = :disabled + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index 8a3d34a8..353fb5ea 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -123,7 +123,16 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer, nil?: true - # @!method initialize(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @!attribute zdr + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + # + # @return [Symbol, ContextDev::Models::WebWebScrapeMdParams::Zdr, nil] + optional :zdr, enum: -> { ContextDev::WebWebScrapeMdParams::Zdr } + + # @!method initialize(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeMdParams} for more details. # @@ -159,6 +168,8 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before conver # + # @param zdr [Symbol, ContextDev::Models::WebWebScrapeMdParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev @@ -632,6 +643,20 @@ module UseMainContentOnly # @!endgroup end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED = :enabled + DISABLED = :disabled + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/context_dev/models/web_web_scrape_sitemap_params.rb b/lib/context_dev/models/web_web_scrape_sitemap_params.rb index 67874f4c..84a20a5c 100644 --- a/lib/context_dev/models/web_web_scrape_sitemap_params.rb +++ b/lib/context_dev/models/web_web_scrape_sitemap_params.rb @@ -58,7 +58,16 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # @return [String, nil] optional :url_regex, String - # @!method initialize(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, request_options: {}) + # @!attribute zdr + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + # + # @return [Symbol, ContextDev::Models::WebWebScrapeSitemapParams::Zdr, nil] + optional :zdr, enum: -> { ContextDev::WebWebScrapeSitemapParams::Zdr } + + # @!method initialize(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeSitemapParams} for more details. # @@ -76,7 +85,23 @@ class WebWebScrapeSitemapParams < ContextDev::Internal::Type::BaseModel # # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur # + # @param zdr [Symbol, ContextDev::Models::WebWebScrapeSitemapParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED = :enabled + DISABLED = :disabled + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/context_dev/resources/parse.rb b/lib/context_dev/resources/parse.rb index 7ff5d4c1..fd80da71 100644 --- a/lib/context_dev/resources/parse.rb +++ b/lib/context_dev/resources/parse.rb @@ -9,7 +9,7 @@ class Parse # Converts raw text, source code, web/data, PDF, Microsoft Office, and image bytes # into LLM-usable Markdown. # - # @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, request_options: {}) + # @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: {}) # # @param body [Pathname, StringIO, IO, String, ContextDev::FilePart] Body param # @@ -31,6 +31,8 @@ class Parse # # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly] Query param: Extract only the main content from HTML-like inputs # + # @param zdr [Symbol, ContextDev::Models::ParseHandleParams::Zdr] Query param: Set to enabled to bypass shared caches and omit request and respons + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::ParseHandleResponse] diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index ac53de33..7e2fae37 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -176,7 +176,7 @@ def extract_styleguide(params = {}) # # Capture a screenshot of a website. # - # @overload screenshot(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, tags: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, request_options: {}) + # @overload screenshot(color_scheme: nil, country: nil, direct_url: nil, domain: nil, full_screenshot: nil, handle_cookie_popup: nil, max_age_ms: nil, page: nil, scroll_offset: nil, tags: nil, timeout_ms: nil, viewport: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # # @param color_scheme [Symbol, ContextDev::Models::WebScreenshotParams::ColorScheme] Optional parameter to choose the site's visual theme in the screenshot. Use 'lig # @@ -204,6 +204,8 @@ def extract_styleguide(params = {}) # # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before taking # + # @param zdr [Symbol, ContextDev::Models::WebScreenshotParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebScreenshotResponse] @@ -279,7 +281,7 @@ def search(params) # Performs a crawl starting from a given URL, extracts page content as Markdown, # and returns results for all crawled pages. # - # @overload web_crawl_md(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @overload web_crawl_md(url:, country: nil, exclude_selectors: nil, follow_subdomains: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, max_depth: nil, max_pages: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, stop_after_ms: nil, tags: nil, timeout_ms: nil, url_regex: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # # @param url [String] The starting URL for the crawl (must include http:// or https:// protocol) # @@ -321,6 +323,8 @@ def search(params) # # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw # + # @param zdr [Symbol, ContextDev::Models::WebWebCrawlMdParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebCrawlMdResponse] @@ -342,7 +346,7 @@ def web_crawl_md(params) # # Scrapes the given URL and returns the raw HTML content of the page. # - # @overload web_scrape_html(url:, 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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @overload web_scrape_html(url:, 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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # @@ -370,6 +374,8 @@ def web_crawl_md(params) # # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load. Min: 0. Max: # + # @param zdr [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeHTMLResponse] @@ -463,7 +469,7 @@ def web_scrape_images(params) # | 429 | No | Per-minute rate limit exceeded; honor Retry-After | # | 500 | No | Internal error | # - # @overload web_scrape_md(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, request_options: {}) + # @overload web_scrape_md(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr # @@ -497,6 +503,8 @@ def web_scrape_images(params) # # @param wait_for_ms [Integer, nil] Optional browser wait time in milliseconds after initial page load before conver # + # @param zdr [Symbol, ContextDev::Models::WebWebScrapeMdParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeMdResponse] @@ -531,7 +539,7 @@ def web_scrape_md(params) # # Crawl an entire website's sitemap and return all discovered page URLs. # - # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, request_options: {}) + # @overload web_scrape_sitemap(domain:, headers: nil, max_links: nil, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {}) # # @param domain [String] Domain to build a sitemap for # @@ -547,6 +555,8 @@ def web_scrape_md(params) # # @param url_regex [String] Optional RE2-compatible regex pattern. Only URLs matching this pattern are retur # + # @param zdr [Symbol, ContextDev::Models::WebWebScrapeSitemapParams::Zdr] Set to enabled to bypass shared caches and omit request and response content fro + # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [ContextDev::Models::WebWebScrapeSitemapResponse] diff --git a/rbi/context_dev/models/parse_handle_params.rbi b/rbi/context_dev/models/parse_handle_params.rbi index 07573ba4..4b74f53f 100644 --- a/rbi/context_dev/models/parse_handle_params.rbi +++ b/rbi/context_dev/models/parse_handle_params.rbi @@ -167,6 +167,16 @@ module ContextDev end attr_writer :use_main_content_only + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + sig { returns(T.nilable(ContextDev::ParseHandleParams::Zdr::OrSymbol)) } + attr_reader :zdr + + sig { params(zdr: ContextDev::ParseHandleParams::Zdr::OrSymbol).void } + attr_writer :zdr + sig do params( body: ContextDev::Internal::FileInput, @@ -195,6 +205,7 @@ module ContextDev T::Boolean, ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol ), + zdr: ContextDev::ParseHandleParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -224,6 +235,11 @@ module ContextDev tags: nil, # Extract only the main content from HTML-like inputs use_main_content_only: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -258,6 +274,7 @@ module ContextDev T::Boolean, ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol ), + zdr: ContextDev::ParseHandleParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -646,6 +663,31 @@ module ContextDev ContextDev::ParseHandleParams::UseMainContentOnly::TaggedSymbol ) end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, ContextDev::ParseHandleParams::Zdr) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let(:enabled, ContextDev::ParseHandleParams::Zdr::TaggedSymbol) + DISABLED = + T.let(:disabled, ContextDev::ParseHandleParams::Zdr::TaggedSymbol) + + sig do + override.returns( + T::Array[ContextDev::ParseHandleParams::Zdr::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/context_dev/models/web_screenshot_params.rbi b/rbi/context_dev/models/web_screenshot_params.rbi index 47f2168e..2e8c9ff2 100644 --- a/rbi/context_dev/models/web_screenshot_params.rbi +++ b/rbi/context_dev/models/web_screenshot_params.rbi @@ -163,6 +163,16 @@ module ContextDev sig { returns(T.nilable(Integer)) } attr_accessor :wait_for_ms + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + sig { returns(T.nilable(ContextDev::WebScreenshotParams::Zdr::OrSymbol)) } + attr_reader :zdr + + sig { params(zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol).void } + attr_writer :zdr + sig do params( color_scheme: ContextDev::WebScreenshotParams::ColorScheme::OrSymbol, @@ -183,6 +193,7 @@ module ContextDev timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, wait_for_ms: T.nilable(Integer), + zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -241,6 +252,11 @@ module ContextDev # the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when # omitted. wait_for_ms: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -267,6 +283,7 @@ module ContextDev timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, wait_for_ms: T.nilable(Integer), + zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -683,6 +700,31 @@ module ContextDev def to_hash end end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, ContextDev::WebScreenshotParams::Zdr) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let(:enabled, ContextDev::WebScreenshotParams::Zdr::TaggedSymbol) + DISABLED = + T.let(:disabled, ContextDev::WebScreenshotParams::Zdr::TaggedSymbol) + + sig do + override.returns( + T::Array[ContextDev::WebScreenshotParams::Zdr::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/context_dev/models/web_screenshot_response.rbi b/rbi/context_dev/models/web_screenshot_response.rbi index 443821b7..42f8dec3 100644 --- a/rbi/context_dev/models/web_screenshot_response.rbi +++ b/rbi/context_dev/models/web_screenshot_response.rbi @@ -49,7 +49,8 @@ module ContextDev end attr_writer :key_metadata - # Public URL of the uploaded screenshot image + # Public image URL for standard requests, or an in-memory data URL when ZDR is + # enabled. sig { returns(T.nilable(String)) } attr_reader :screenshot @@ -112,7 +113,8 @@ module ContextDev # Metadata about the API key used for the request. Included in every response # whenever a valid API key is provided, even when the response status is not 200. key_metadata: nil, - # Public URL of the uploaded screenshot image + # Public image URL for standard requests, or an in-memory data URL when ZDR is + # enabled. screenshot: nil, # Type of screenshot that was captured screenshot_type: nil, diff --git a/rbi/context_dev/models/web_web_crawl_md_params.rbi b/rbi/context_dev/models/web_web_crawl_md_params.rbi index 32d82e26..baa72ffc 100644 --- a/rbi/context_dev/models/web_web_crawl_md_params.rbi +++ b/rbi/context_dev/models/web_web_crawl_md_params.rbi @@ -174,6 +174,16 @@ module ContextDev sig { params(wait_for_ms: Integer).void } attr_writer :wait_for_ms + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + sig { returns(T.nilable(ContextDev::WebWebCrawlMdParams::Zdr::OrSymbol)) } + attr_reader :zdr + + sig { params(zdr: ContextDev::WebWebCrawlMdParams::Zdr::OrSymbol).void } + attr_writer :zdr + sig do params( url: String, @@ -196,6 +206,7 @@ module ContextDev url_regex: String, use_main_content_only: T::Boolean, wait_for_ms: Integer, + zdr: ContextDev::WebWebCrawlMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -262,6 +273,11 @@ module ContextDev # Optional browser wait time in milliseconds after initial page load for each # crawled page. Min: 0. Max: 30000 (30 seconds). wait_for_ms: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -289,6 +305,7 @@ module ContextDev url_regex: String, use_main_content_only: T::Boolean, wait_for_ms: Integer, + zdr: ContextDev::WebWebCrawlMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -602,6 +619,31 @@ module ContextDev def to_hash end end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, ContextDev::WebWebCrawlMdParams::Zdr) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let(:enabled, ContextDev::WebWebCrawlMdParams::Zdr::TaggedSymbol) + DISABLED = + T.let(:disabled, ContextDev::WebWebCrawlMdParams::Zdr::TaggedSymbol) + + sig do + override.returns( + T::Array[ContextDev::WebWebCrawlMdParams::Zdr::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/context_dev/models/web_web_scrape_html_params.rbi b/rbi/context_dev/models/web_web_scrape_html_params.rbi index 87c251e2..6759174d 100644 --- a/rbi/context_dev/models/web_web_scrape_html_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_html_params.rbi @@ -168,6 +168,20 @@ module ContextDev sig { returns(T.nilable(Integer)) } attr_accessor :wait_for_ms + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + sig do + returns(T.nilable(ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol)) + end + attr_reader :zdr + + sig do + params(zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol).void + end + attr_writer :zdr + sig do params( url: String, @@ -195,6 +209,7 @@ module ContextDev ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol ), wait_for_ms: T.nilable(Integer), + zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -244,6 +259,11 @@ module ContextDev # Optional browser wait time in milliseconds after initial page load. Min: 0. Max: # 30000 (30 seconds). wait_for_ms: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -276,6 +296,7 @@ module ContextDev ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol ), wait_for_ms: T.nilable(Integer), + zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -1053,6 +1074,36 @@ module ContextDev ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::TaggedSymbol ) end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeHTMLParams::Zdr) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let(:enabled, ContextDev::WebWebScrapeHTMLParams::Zdr::TaggedSymbol) + DISABLED = + T.let( + :disabled, + ContextDev::WebWebScrapeHTMLParams::Zdr::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeHTMLParams::Zdr::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index 28507c3c..6db290eb 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -236,6 +236,18 @@ module ContextDev sig { returns(T.nilable(Integer)) } attr_accessor :wait_for_ms + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + sig do + returns(T.nilable(ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol)) + end + attr_reader :zdr + + sig { params(zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol).void } + attr_writer :zdr + sig do params( url: String, @@ -278,6 +290,7 @@ module ContextDev ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol ), wait_for_ms: T.nilable(Integer), + zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -334,6 +347,11 @@ module ContextDev # Optional browser wait time in milliseconds after initial page load before # converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). wait_for_ms: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -381,6 +399,7 @@ module ContextDev ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol ), wait_for_ms: T.nilable(Integer), + zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -1062,6 +1081,31 @@ module ContextDev ContextDev::WebWebScrapeMdParams::UseMainContentOnly::TaggedSymbol ) end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, ContextDev::WebWebScrapeMdParams::Zdr) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let(:enabled, ContextDev::WebWebScrapeMdParams::Zdr::TaggedSymbol) + DISABLED = + T.let(:disabled, ContextDev::WebWebScrapeMdParams::Zdr::TaggedSymbol) + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeMdParams::Zdr::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi index 0e759326..a4cbec1f 100644 --- a/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_sitemap_params.rbi @@ -69,6 +69,20 @@ module ContextDev sig { params(url_regex: String).void } attr_writer :url_regex + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + sig do + returns(T.nilable(ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol)) + end + attr_reader :zdr + + sig do + params(zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol).void + end + attr_writer :zdr + sig do params( domain: String, @@ -78,6 +92,7 @@ module ContextDev tags: T::Array[String], timeout_ms: Integer, url_regex: String, + zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -105,6 +120,11 @@ module ContextDev # Optional RE2-compatible regex pattern. Only URLs matching this pattern are # returned and counted against maxLinks. url_regex: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -119,12 +139,46 @@ module ContextDev tags: T::Array[String], timeout_ms: Integer, url_regex: String, + zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) end def to_hash end + + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + module Zdr + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::WebWebScrapeSitemapParams::Zdr) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let( + :enabled, + ContextDev::WebWebScrapeSitemapParams::Zdr::TaggedSymbol + ) + DISABLED = + T.let( + :disabled, + ContextDev::WebWebScrapeSitemapParams::Zdr::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeSitemapParams::Zdr::TaggedSymbol] + ) + end + def self.values + end + end end end end diff --git a/rbi/context_dev/resources/parse.rbi b/rbi/context_dev/resources/parse.rbi index 0947d0b8..7a7dac46 100644 --- a/rbi/context_dev/resources/parse.rbi +++ b/rbi/context_dev/resources/parse.rbi @@ -33,6 +33,7 @@ module ContextDev T::Boolean, ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol ), + zdr: ContextDev::ParseHandleParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::ParseHandleResponse) end @@ -65,6 +66,12 @@ module ContextDev tags: nil, # Query param: Extract only the main content from HTML-like inputs use_main_content_only: nil, + # Query param: Set to enabled to bypass shared caches and omit request and + # response content from retained usage logs. Requires zero data retention to be + # enabled for your organization (contact support@context.dev), otherwise the + # request fails with ZDR_NOT_ENABLED. Successful ZDR responses include + # X-Context-ZDR: true. + zdr: nil, request_options: {} ) end diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index 4789eb99..c398fcb1 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -208,6 +208,7 @@ module ContextDev timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport::OrHash, wait_for_ms: T.nilable(Integer), + zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebScreenshotResponse) end @@ -266,6 +267,11 @@ module ContextDev # the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when # omitted. wait_for_ms: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -342,6 +348,7 @@ module ContextDev url_regex: String, use_main_content_only: T::Boolean, wait_for_ms: Integer, + zdr: ContextDev::WebWebCrawlMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebCrawlMdResponse) end @@ -408,6 +415,11 @@ module ContextDev # Optional browser wait time in milliseconds after initial page load for each # crawled page. Min: 0. Max: 30000 (30 seconds). wait_for_ms: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -440,6 +452,7 @@ module ContextDev ContextDev::WebWebScrapeHTMLParams::UseMainContentOnly::OrSymbol ), wait_for_ms: T.nilable(Integer), + zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeHTMLResponse) end @@ -489,6 +502,11 @@ module ContextDev # Optional browser wait time in milliseconds after initial page load. Min: 0. Max: # 30000 (30 seconds). wait_for_ms: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -606,6 +624,7 @@ module ContextDev ContextDev::WebWebScrapeMdParams::UseMainContentOnly::OrSymbol ), wait_for_ms: T.nilable(Integer), + zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeMdResponse) end @@ -662,6 +681,11 @@ module ContextDev # Optional browser wait time in milliseconds after initial page load before # converting the page to Markdown. Min: 0. Max: 30000 (30 seconds). wait_for_ms: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end @@ -676,6 +700,7 @@ module ContextDev tags: T::Array[String], timeout_ms: Integer, url_regex: String, + zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeSitemapResponse) end @@ -703,6 +728,11 @@ module ContextDev # Optional RE2-compatible regex pattern. Only URLs matching this pattern are # returned and counted against maxLinks. url_regex: nil, + # Set to enabled to bypass shared caches and omit request and response content + # from retained usage logs. Requires zero data retention to be enabled for your + # organization (contact support@context.dev), otherwise the request fails with + # ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true. + zdr: nil, request_options: {} ) end diff --git a/sig/context_dev/models/parse_handle_params.rbs b/sig/context_dev/models/parse_handle_params.rbs index 2c7e030f..e754d54b 100644 --- a/sig/context_dev/models/parse_handle_params.rbs +++ b/sig/context_dev/models/parse_handle_params.rbs @@ -11,7 +11,8 @@ module ContextDev pdf: ContextDev::ParseHandleParams::Pdf, :shorten_base64_images => ContextDev::Models::ParseHandleParams::shorten_base64_images, tags: ::Array[String], - use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only + use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only, + zdr: ContextDev::Models::ParseHandleParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -71,6 +72,12 @@ module ContextDev ContextDev::Models::ParseHandleParams::use_main_content_only ) -> ContextDev::Models::ParseHandleParams::use_main_content_only + attr_reader zdr: ContextDev::Models::ParseHandleParams::zdr? + + def zdr=: ( + ContextDev::Models::ParseHandleParams::zdr + ) -> ContextDev::Models::ParseHandleParams::zdr + def initialize: ( body: ContextDev::Internal::file_input, ?client: String, @@ -82,6 +89,7 @@ module ContextDev ?shorten_base64_images: ContextDev::Models::ParseHandleParams::shorten_base64_images, ?tags: ::Array[String], ?use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only, + ?zdr: ContextDev::Models::ParseHandleParams::zdr, ?request_options: ContextDev::request_opts ) -> void @@ -96,6 +104,7 @@ module ContextDev :shorten_base64_images => ContextDev::Models::ParseHandleParams::shorten_base64_images, tags: ::Array[String], use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only, + zdr: ContextDev::Models::ParseHandleParams::zdr, request_options: ContextDev::RequestOptions } @@ -318,6 +327,17 @@ module ContextDev TRUE: :true FALSE: :false end + + type zdr = :enabled | :disabled + + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED: :enabled + DISABLED: :disabled + + def self?.values: -> ::Array[ContextDev::Models::ParseHandleParams::zdr] + end end end end diff --git a/sig/context_dev/models/web_screenshot_params.rbs b/sig/context_dev/models/web_screenshot_params.rbs index a0487d8c..e6e0538c 100644 --- a/sig/context_dev/models/web_screenshot_params.rbs +++ b/sig/context_dev/models/web_screenshot_params.rbs @@ -14,7 +14,8 @@ module ContextDev tags: ::Array[String], timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, - wait_for_ms: Integer? + wait_for_ms: Integer?, + zdr: ContextDev::Models::WebScreenshotParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -80,6 +81,12 @@ module ContextDev attr_accessor wait_for_ms: Integer? + attr_reader zdr: ContextDev::Models::WebScreenshotParams::zdr? + + def zdr=: ( + ContextDev::Models::WebScreenshotParams::zdr + ) -> ContextDev::Models::WebScreenshotParams::zdr + def initialize: ( ?color_scheme: ContextDev::Models::WebScreenshotParams::color_scheme, ?country: ContextDev::Models::WebScreenshotParams::country, @@ -94,6 +101,7 @@ module ContextDev ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, ?wait_for_ms: Integer?, + ?zdr: ContextDev::Models::WebScreenshotParams::zdr, ?request_options: ContextDev::request_opts ) -> void @@ -111,6 +119,7 @@ module ContextDev timeout_ms: Integer, viewport: ContextDev::WebScreenshotParams::Viewport, wait_for_ms: Integer?, + zdr: ContextDev::Models::WebScreenshotParams::zdr, request_options: ContextDev::RequestOptions } @@ -604,6 +613,17 @@ module ContextDev def to_hash: -> { height: Integer, width: Integer } end + + type zdr = :enabled | :disabled + + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED: :enabled + DISABLED: :disabled + + def self?.values: -> ::Array[ContextDev::Models::WebScreenshotParams::zdr] + end end end end diff --git a/sig/context_dev/models/web_web_crawl_md_params.rbs b/sig/context_dev/models/web_web_crawl_md_params.rbs index 5be0d4fa..078f9236 100644 --- a/sig/context_dev/models/web_web_crawl_md_params.rbs +++ b/sig/context_dev/models/web_web_crawl_md_params.rbs @@ -21,7 +21,8 @@ module ContextDev timeout_ms: Integer, url_regex: String, use_main_content_only: bool, - wait_for_ms: Integer + wait_for_ms: Integer, + zdr: ContextDev::Models::WebWebCrawlMdParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -111,6 +112,12 @@ module ContextDev def wait_for_ms=: (Integer) -> Integer + attr_reader zdr: ContextDev::Models::WebWebCrawlMdParams::zdr? + + def zdr=: ( + ContextDev::Models::WebWebCrawlMdParams::zdr + ) -> ContextDev::Models::WebWebCrawlMdParams::zdr + def initialize: ( url: String, ?country: ContextDev::Models::WebWebCrawlMdParams::country, @@ -132,6 +139,7 @@ module ContextDev ?url_regex: String, ?use_main_content_only: bool, ?wait_for_ms: Integer, + ?zdr: ContextDev::Models::WebWebCrawlMdParams::zdr, ?request_options: ContextDev::request_opts ) -> void @@ -156,6 +164,7 @@ module ContextDev url_regex: String, use_main_content_only: bool, wait_for_ms: Integer, + zdr: ContextDev::Models::WebWebCrawlMdParams::zdr, request_options: ContextDev::RequestOptions } @@ -610,6 +619,17 @@ module ContextDev start: Integer } end + + type zdr = :enabled | :disabled + + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED: :enabled + DISABLED: :disabled + + def self?.values: -> ::Array[ContextDev::Models::WebWebCrawlMdParams::zdr] + end end end end diff --git a/sig/context_dev/models/web_web_scrape_html_params.rbs b/sig/context_dev/models/web_web_scrape_html_params.rbs index 4758d897..9ecbe770 100644 --- a/sig/context_dev/models/web_web_scrape_html_params.rbs +++ b/sig/context_dev/models/web_web_scrape_html_params.rbs @@ -14,7 +14,8 @@ module ContextDev tags: ::Array[String], timeout_ms: Integer, use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only, - wait_for_ms: Integer? + wait_for_ms: Integer?, + zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -74,6 +75,12 @@ module ContextDev attr_accessor wait_for_ms: Integer? + attr_reader zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr? + + def zdr=: ( + ContextDev::Models::WebWebScrapeHTMLParams::zdr + ) -> ContextDev::Models::WebWebScrapeHTMLParams::zdr + def initialize: ( url: String, ?country: ContextDev::Models::WebWebScrapeHTMLParams::country, @@ -88,6 +95,7 @@ module ContextDev ?timeout_ms: Integer, ?use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only, ?wait_for_ms: Integer?, + ?zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr, ?request_options: ContextDev::request_opts ) -> void @@ -105,6 +113,7 @@ module ContextDev timeout_ms: Integer, use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only, wait_for_ms: Integer?, + zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr, request_options: ContextDev::RequestOptions } @@ -623,6 +632,17 @@ module ContextDev TRUE: :true FALSE: :false end + + type zdr = :enabled | :disabled + + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED: :enabled + DISABLED: :disabled + + def self?.values: -> ::Array[ContextDev::Models::WebWebScrapeHTMLParams::zdr] + end end end end diff --git a/sig/context_dev/models/web_web_scrape_md_params.rbs b/sig/context_dev/models/web_web_scrape_md_params.rbs index 0cf17831..579453c7 100644 --- a/sig/context_dev/models/web_web_scrape_md_params.rbs +++ b/sig/context_dev/models/web_web_scrape_md_params.rbs @@ -17,7 +17,8 @@ module ContextDev tags: ::Array[String], timeout_ms: Integer, use_main_content_only: ContextDev::Models::WebWebScrapeMdParams::use_main_content_only, - wait_for_ms: Integer? + wait_for_ms: Integer?, + zdr: ContextDev::Models::WebWebScrapeMdParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -95,6 +96,12 @@ module ContextDev attr_accessor wait_for_ms: Integer? + attr_reader zdr: ContextDev::Models::WebWebScrapeMdParams::zdr? + + def zdr=: ( + ContextDev::Models::WebWebScrapeMdParams::zdr + ) -> ContextDev::Models::WebWebScrapeMdParams::zdr + def initialize: ( url: String, ?country: ContextDev::Models::WebWebScrapeMdParams::country, @@ -112,6 +119,7 @@ module ContextDev ?timeout_ms: Integer, ?use_main_content_only: ContextDev::Models::WebWebScrapeMdParams::use_main_content_only, ?wait_for_ms: Integer?, + ?zdr: ContextDev::Models::WebWebScrapeMdParams::zdr, ?request_options: ContextDev::request_opts ) -> void @@ -132,6 +140,7 @@ module ContextDev timeout_ms: Integer, use_main_content_only: ContextDev::Models::WebWebScrapeMdParams::use_main_content_only, wait_for_ms: Integer?, + zdr: ContextDev::Models::WebWebScrapeMdParams::zdr, request_options: ContextDev::RequestOptions } @@ -683,6 +692,17 @@ module ContextDev TRUE: :true FALSE: :false end + + type zdr = :enabled | :disabled + + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED: :enabled + DISABLED: :disabled + + def self?.values: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::zdr] + end end end end diff --git a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs index 1b0a28d7..aae1007c 100644 --- a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +++ b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs @@ -8,7 +8,8 @@ module ContextDev sitemap_url: String, tags: ::Array[String], timeout_ms: Integer, - url_regex: String + url_regex: String, + zdr: ContextDev::Models::WebWebScrapeSitemapParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -42,6 +43,12 @@ module ContextDev def url_regex=: (String) -> String + attr_reader zdr: ContextDev::Models::WebWebScrapeSitemapParams::zdr? + + def zdr=: ( + ContextDev::Models::WebWebScrapeSitemapParams::zdr + ) -> ContextDev::Models::WebWebScrapeSitemapParams::zdr + def initialize: ( domain: String, ?headers: ::Hash[Symbol, String], @@ -50,6 +57,7 @@ module ContextDev ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, + ?zdr: ContextDev::Models::WebWebScrapeSitemapParams::zdr, ?request_options: ContextDev::request_opts ) -> void @@ -61,8 +69,20 @@ module ContextDev tags: ::Array[String], timeout_ms: Integer, url_regex: String, + zdr: ContextDev::Models::WebWebScrapeSitemapParams::zdr, request_options: ContextDev::RequestOptions } + + type zdr = :enabled | :disabled + + module Zdr + extend ContextDev::Internal::Type::Enum + + ENABLED: :enabled + DISABLED: :disabled + + def self?.values: -> ::Array[ContextDev::Models::WebWebScrapeSitemapParams::zdr] + end end end end diff --git a/sig/context_dev/resources/parse.rbs b/sig/context_dev/resources/parse.rbs index 02188b49..38e6deeb 100644 --- a/sig/context_dev/resources/parse.rbs +++ b/sig/context_dev/resources/parse.rbs @@ -12,6 +12,7 @@ module ContextDev ?shorten_base64_images: ContextDev::Models::ParseHandleParams::shorten_base64_images, ?tags: ::Array[String], ?use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only, + ?zdr: ContextDev::Models::ParseHandleParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::ParseHandleResponse diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index b0a0dd71..47499323 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -61,6 +61,7 @@ module ContextDev ?timeout_ms: Integer, ?viewport: ContextDev::WebScreenshotParams::Viewport, ?wait_for_ms: Integer?, + ?zdr: ContextDev::Models::WebScreenshotParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebScreenshotResponse @@ -99,6 +100,7 @@ module ContextDev ?url_regex: String, ?use_main_content_only: bool, ?wait_for_ms: Integer, + ?zdr: ContextDev::Models::WebWebCrawlMdParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebCrawlMdResponse @@ -116,6 +118,7 @@ module ContextDev ?timeout_ms: Integer, ?use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only, ?wait_for_ms: Integer?, + ?zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeHTMLResponse @@ -148,6 +151,7 @@ module ContextDev ?timeout_ms: Integer, ?use_main_content_only: ContextDev::Models::WebWebScrapeMdParams::use_main_content_only, ?wait_for_ms: Integer?, + ?zdr: ContextDev::Models::WebWebScrapeMdParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeMdResponse @@ -159,6 +163,7 @@ module ContextDev ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, + ?zdr: ContextDev::Models::WebWebScrapeSitemapParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeSitemapResponse From 2a83a5f976bf2b75964ea56ff07f99872acd5022 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 08:05:49 +0000 Subject: [PATCH 06/13] feat(api): manual updates --- .stats.yml | 6 +- lib/context_dev.rb | 4 + lib/context_dev/models.rb | 4 + .../models/monitor_get_credit_usage_params.rb | 30 +++++ .../monitor_get_credit_usage_response.rb | 59 ++++++++++ .../models/monitor_get_limits_params.rb | 14 +++ .../models/monitor_get_limits_response.rb | 52 ++++++++ lib/context_dev/resources/monitors.rb | 44 +++++++ rbi/context_dev/models.rbi | 4 + .../monitor_get_credit_usage_params.rbi | 60 ++++++++++ .../monitor_get_credit_usage_response.rbi | 111 ++++++++++++++++++ .../models/monitor_get_limits_params.rbi | 30 +++++ .../models/monitor_get_limits_response.rbi | 105 +++++++++++++++++ rbi/context_dev/resources/monitors.rbi | 27 +++++ sig/context_dev/models.rbs | 4 + .../monitor_get_credit_usage_params.rbs | 32 +++++ .../monitor_get_credit_usage_response.rbs | 52 ++++++++ .../models/monitor_get_limits_params.rbs | 15 +++ .../models/monitor_get_limits_response.rbs | 43 +++++++ sig/context_dev/resources/monitors.rbs | 10 ++ test/context_dev/resources/monitors_test.rb | 35 ++++++ 21 files changed, 738 insertions(+), 3 deletions(-) create mode 100644 lib/context_dev/models/monitor_get_credit_usage_params.rb create mode 100644 lib/context_dev/models/monitor_get_credit_usage_response.rb create mode 100644 lib/context_dev/models/monitor_get_limits_params.rb create mode 100644 lib/context_dev/models/monitor_get_limits_response.rb create mode 100644 rbi/context_dev/models/monitor_get_credit_usage_params.rbi create mode 100644 rbi/context_dev/models/monitor_get_credit_usage_response.rbi create mode 100644 rbi/context_dev/models/monitor_get_limits_params.rbi create mode 100644 rbi/context_dev/models/monitor_get_limits_response.rbi create mode 100644 sig/context_dev/models/monitor_get_credit_usage_params.rbs create mode 100644 sig/context_dev/models/monitor_get_credit_usage_response.rbs create mode 100644 sig/context_dev/models/monitor_get_limits_params.rbs create mode 100644 sig/context_dev/models/monitor_get_limits_response.rbs diff --git a/.stats.yml b/.stats.yml index 231a6da1..674523c1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-42c531dcf60b5d35e3996c1a669a3fe2de19d8caedf2bfd69e4864a1041c9bfa.yml +configured_endpoints: 32 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d25300a20809f87d2069c1f4417b158b2e2d1cef3ca9b6bf7653e02233deba2c.yml openapi_spec_hash: e43dd84c75e6d710c7346b9f12c34738 -config_hash: daabb160675d86b354711da1e77e5129 +config_hash: 70e7e80b5e87f94981bee396c6cd41e8 diff --git a/lib/context_dev.rb b/lib/context_dev.rb index 7ec780f3..fa7703cb 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -68,6 +68,10 @@ require_relative "context_dev/models/monitor_create_response" require_relative "context_dev/models/monitor_delete_params" require_relative "context_dev/models/monitor_delete_response" +require_relative "context_dev/models/monitor_get_credit_usage_params" +require_relative "context_dev/models/monitor_get_credit_usage_response" +require_relative "context_dev/models/monitor_get_limits_params" +require_relative "context_dev/models/monitor_get_limits_response" require_relative "context_dev/models/monitor_list_account_changes_params" require_relative "context_dev/models/monitor_list_account_changes_response" require_relative "context_dev/models/monitor_list_account_runs_params" diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index 5b26d88b..99d2b1aa 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -55,6 +55,10 @@ module ContextDev MonitorDeleteParams = ContextDev::Models::MonitorDeleteParams + MonitorGetCreditUsageParams = ContextDev::Models::MonitorGetCreditUsageParams + + MonitorGetLimitsParams = ContextDev::Models::MonitorGetLimitsParams + MonitorListAccountChangesParams = ContextDev::Models::MonitorListAccountChangesParams MonitorListAccountRunsParams = ContextDev::Models::MonitorListAccountRunsParams diff --git a/lib/context_dev/models/monitor_get_credit_usage_params.rb b/lib/context_dev/models/monitor_get_credit_usage_params.rb new file mode 100644 index 00000000..daad4795 --- /dev/null +++ b/lib/context_dev/models/monitor_get_credit_usage_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Monitors#get_credit_usage + class MonitorGetCreditUsageParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + # @!attribute since + # Only include items at or after this ISO 8601 timestamp. + # + # @return [Time, nil] + optional :since, Time + + # @!attribute until_ + # Only include items before this ISO 8601 timestamp. + # + # @return [Time, nil] + optional :until_, Time + + # @!method initialize(since: nil, until_: nil, request_options: {}) + # @param since [Time] Only include items at or after this ISO 8601 timestamp. + # + # @param until_ [Time] Only include items before this ISO 8601 timestamp. + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/context_dev/models/monitor_get_credit_usage_response.rb b/lib/context_dev/models/monitor_get_credit_usage_response.rb new file mode 100644 index 00000000..681c1997 --- /dev/null +++ b/lib/context_dev/models/monitor_get_credit_usage_response.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Monitors#get_credit_usage + class MonitorGetCreditUsageResponse < ContextDev::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, + -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::MonitorGetCreditUsageResponse::Data] } + + # @!attribute total_credits + # Sum of credits across all monitors in the window. + # + # @return [Integer] + required :total_credits, Integer + + # @!method initialize(data:, total_credits:) + # @param data [Array] + # + # @param total_credits [Integer] Sum of credits across all monitors in the window. + + class Data < ContextDev::Internal::Type::BaseModel + # @!attribute credits + # Credits charged to this monitor over the window. + # + # @return [Integer] + required :credits, Integer + + # @!attribute monitor_id + # + # @return [String] + required :monitor_id, String + + # @!attribute name + # Monitor name (falls back to the id when the monitor was deleted). + # + # @return [String] + required :name, String + + # @!attribute runs + # Number of billed runs over the window. + # + # @return [Integer] + required :runs, Integer + + # @!method initialize(credits:, monitor_id:, name:, runs:) + # @param credits [Integer] Credits charged to this monitor over the window. + # + # @param monitor_id [String] + # + # @param name [String] Monitor name (falls back to the id when the monitor was deleted). + # + # @param runs [Integer] Number of billed runs over the window. + end + end + end +end diff --git a/lib/context_dev/models/monitor_get_limits_params.rb b/lib/context_dev/models/monitor_get_limits_params.rb new file mode 100644 index 00000000..0d1c3193 --- /dev/null +++ b/lib/context_dev/models/monitor_get_limits_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Monitors#get_limits + class MonitorGetLimitsParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/context_dev/models/monitor_get_limits_response.rb b/lib/context_dev/models/monitor_get_limits_response.rb new file mode 100644 index 00000000..128c5b41 --- /dev/null +++ b/lib/context_dev/models/monitor_get_limits_response.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module ContextDev + module Models + # @see ContextDev::Resources::Monitors#get_limits + class MonitorGetLimitsResponse < ContextDev::Internal::Type::BaseModel + # @!attribute monitors_limit + # Maximum number of monitors allowed for the account. Defaults to the plan + # allowance unless a custom limit is set for the organization. + # + # @return [Integer] + required :monitors_limit, Integer + + # @!attribute monitors_used + # Number of monitors the account currently has. + # + # @return [Integer] + required :monitors_used, Integer + + # @!attribute plan + # The plan tier the limit was resolved from. + # + # @return [Symbol, ContextDev::Models::MonitorGetLimitsResponse::Plan] + required :plan, enum: -> { ContextDev::Models::MonitorGetLimitsResponse::Plan } + + # @!method initialize(monitors_limit:, monitors_used:, plan:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::MonitorGetLimitsResponse} for more details. + # + # @param monitors_limit [Integer] Maximum number of monitors allowed for the account. Defaults to the plan allowan + # + # @param monitors_used [Integer] Number of monitors the account currently has. + # + # @param plan [Symbol, ContextDev::Models::MonitorGetLimitsResponse::Plan] The plan tier the limit was resolved from. + + # The plan tier the limit was resolved from. + # + # @see ContextDev::Models::MonitorGetLimitsResponse#plan + module Plan + extend ContextDev::Internal::Type::Enum + + FREE = :free + STARTER = :starter + PRO = :pro + SCALE = :scale + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/context_dev/resources/monitors.rb b/lib/context_dev/resources/monitors.rb index aeda3782..2a076f5a 100644 --- a/lib/context_dev/resources/monitors.rb +++ b/lib/context_dev/resources/monitors.rb @@ -171,6 +171,50 @@ def delete(monitor_id, params = {}) ) end + # Returns credits charged per monitor over an optional [since, until] window, + # newest spenders first. + # + # @overload get_credit_usage(since: nil, until_: nil, request_options: {}) + # + # @param since [Time] Only include items at or after this ISO 8601 timestamp. + # + # @param until_ [Time] Only include items before this ISO 8601 timestamp. + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [ContextDev::Models::MonitorGetCreditUsageResponse] + # + # @see ContextDev::Models::MonitorGetCreditUsageParams + def get_credit_usage(params = {}) + parsed, options = ContextDev::MonitorGetCreditUsageParams.dump_request(params) + query = ContextDev::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "monitors/credit-usage", + query: query.transform_keys(until_: "until"), + model: ContextDev::Models::MonitorGetCreditUsageResponse, + options: options + ) + end + + # Returns how many monitors the account has and the maximum it allows. + # + # @overload get_limits(request_options: {}) + # + # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [ContextDev::Models::MonitorGetLimitsResponse] + # + # @see ContextDev::Models::MonitorGetLimitsParams + def get_limits(params = {}) + @client.request( + method: :get, + path: "monitors/limits", + model: ContextDev::Models::MonitorGetLimitsResponse, + options: params[:request_options] + ) + end + # Returns an account-wide feed of detected changes across monitors. # # @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: {}) diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index 52a5e321..26347f11 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -18,6 +18,10 @@ module ContextDev MonitorDeleteParams = ContextDev::Models::MonitorDeleteParams + MonitorGetCreditUsageParams = ContextDev::Models::MonitorGetCreditUsageParams + + MonitorGetLimitsParams = ContextDev::Models::MonitorGetLimitsParams + MonitorListAccountChangesParams = ContextDev::Models::MonitorListAccountChangesParams diff --git a/rbi/context_dev/models/monitor_get_credit_usage_params.rbi b/rbi/context_dev/models/monitor_get_credit_usage_params.rbi new file mode 100644 index 00000000..1c55b0ea --- /dev/null +++ b/rbi/context_dev/models/monitor_get_credit_usage_params.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module ContextDev + module Models + class MonitorGetCreditUsageParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + ContextDev::MonitorGetCreditUsageParams, + ContextDev::Internal::AnyHash + ) + end + + # Only include items at or after this ISO 8601 timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :since + + sig { params(since: Time).void } + attr_writer :since + + # Only include items before this ISO 8601 timestamp. + sig { returns(T.nilable(Time)) } + attr_reader :until_ + + sig { params(until_: Time).void } + attr_writer :until_ + + sig do + params( + since: Time, + until_: Time, + request_options: ContextDev::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Only include items at or after this ISO 8601 timestamp. + since: nil, + # Only include items before this ISO 8601 timestamp. + until_: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + since: Time, + until_: Time, + request_options: ContextDev::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/context_dev/models/monitor_get_credit_usage_response.rbi b/rbi/context_dev/models/monitor_get_credit_usage_response.rbi new file mode 100644 index 00000000..0d9854cc --- /dev/null +++ b/rbi/context_dev/models/monitor_get_credit_usage_response.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module ContextDev + module Models + class MonitorGetCreditUsageResponse < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorGetCreditUsageResponse, + ContextDev::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[ContextDev::Models::MonitorGetCreditUsageResponse::Data] + ) + end + attr_accessor :data + + # Sum of credits across all monitors in the window. + sig { returns(Integer) } + attr_accessor :total_credits + + sig do + params( + data: + T::Array[ + ContextDev::Models::MonitorGetCreditUsageResponse::Data::OrHash + ], + total_credits: Integer + ).returns(T.attached_class) + end + def self.new( + data:, + # Sum of credits across all monitors in the window. + total_credits: + ) + end + + sig do + override.returns( + { + data: + T::Array[ContextDev::Models::MonitorGetCreditUsageResponse::Data], + total_credits: Integer + } + ) + end + def to_hash + end + + class Data < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorGetCreditUsageResponse::Data, + ContextDev::Internal::AnyHash + ) + end + + # Credits charged to this monitor over the window. + sig { returns(Integer) } + attr_accessor :credits + + sig { returns(String) } + attr_accessor :monitor_id + + # Monitor name (falls back to the id when the monitor was deleted). + sig { returns(String) } + attr_accessor :name + + # Number of billed runs over the window. + sig { returns(Integer) } + attr_accessor :runs + + sig do + params( + credits: Integer, + monitor_id: String, + name: String, + runs: Integer + ).returns(T.attached_class) + end + def self.new( + # Credits charged to this monitor over the window. + credits:, + monitor_id:, + # Monitor name (falls back to the id when the monitor was deleted). + name:, + # Number of billed runs over the window. + runs: + ) + end + + sig do + override.returns( + { + credits: Integer, + monitor_id: String, + name: String, + runs: Integer + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/context_dev/models/monitor_get_limits_params.rbi b/rbi/context_dev/models/monitor_get_limits_params.rbi new file mode 100644 index 00000000..df4ffe50 --- /dev/null +++ b/rbi/context_dev/models/monitor_get_limits_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module ContextDev + module Models + class MonitorGetLimitsParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + ContextDev::MonitorGetLimitsParams, + ContextDev::Internal::AnyHash + ) + end + + sig do + params(request_options: ContextDev::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: ContextDev::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/context_dev/models/monitor_get_limits_response.rbi b/rbi/context_dev/models/monitor_get_limits_response.rbi new file mode 100644 index 00000000..1067e34b --- /dev/null +++ b/rbi/context_dev/models/monitor_get_limits_response.rbi @@ -0,0 +1,105 @@ +# typed: strong + +module ContextDev + module Models + class MonitorGetLimitsResponse < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::Models::MonitorGetLimitsResponse, + ContextDev::Internal::AnyHash + ) + end + + # Maximum number of monitors allowed for the account. Defaults to the plan + # allowance unless a custom limit is set for the organization. + sig { returns(Integer) } + attr_accessor :monitors_limit + + # Number of monitors the account currently has. + sig { returns(Integer) } + attr_accessor :monitors_used + + # The plan tier the limit was resolved from. + sig do + returns( + ContextDev::Models::MonitorGetLimitsResponse::Plan::TaggedSymbol + ) + end + attr_accessor :plan + + sig do + params( + monitors_limit: Integer, + monitors_used: Integer, + plan: ContextDev::Models::MonitorGetLimitsResponse::Plan::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Maximum number of monitors allowed for the account. Defaults to the plan + # allowance unless a custom limit is set for the organization. + monitors_limit:, + # Number of monitors the account currently has. + monitors_used:, + # The plan tier the limit was resolved from. + plan: + ) + end + + sig do + override.returns( + { + monitors_limit: Integer, + monitors_used: Integer, + plan: + ContextDev::Models::MonitorGetLimitsResponse::Plan::TaggedSymbol + } + ) + end + def to_hash + end + + # The plan tier the limit was resolved from. + module Plan + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, ContextDev::Models::MonitorGetLimitsResponse::Plan) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FREE = + T.let( + :free, + ContextDev::Models::MonitorGetLimitsResponse::Plan::TaggedSymbol + ) + STARTER = + T.let( + :starter, + ContextDev::Models::MonitorGetLimitsResponse::Plan::TaggedSymbol + ) + PRO = + T.let( + :pro, + ContextDev::Models::MonitorGetLimitsResponse::Plan::TaggedSymbol + ) + SCALE = + T.let( + :scale, + ContextDev::Models::MonitorGetLimitsResponse::Plan::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + ContextDev::Models::MonitorGetLimitsResponse::Plan::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/context_dev/resources/monitors.rbi b/rbi/context_dev/resources/monitors.rbi index 634ad5a6..96e57bd2 100644 --- a/rbi/context_dev/resources/monitors.rbi +++ b/rbi/context_dev/resources/monitors.rbi @@ -165,6 +165,33 @@ module ContextDev def delete(monitor_id, request_options: {}) end + # Returns credits charged per monitor over an optional [since, until] window, + # newest spenders first. + sig do + params( + since: Time, + until_: Time, + request_options: ContextDev::RequestOptions::OrHash + ).returns(ContextDev::Models::MonitorGetCreditUsageResponse) + end + def get_credit_usage( + # Only include items at or after this ISO 8601 timestamp. + since: nil, + # Only include items before this ISO 8601 timestamp. + until_: nil, + request_options: {} + ) + end + + # Returns how many monitors the account has and the maximum it allows. + sig do + params(request_options: ContextDev::RequestOptions::OrHash).returns( + ContextDev::Models::MonitorGetLimitsResponse + ) + end + def get_limits(request_options: {}) + end + # Returns an account-wide feed of detected changes across monitors. sig do params( diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index 6665a1de..fc61341d 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -15,6 +15,10 @@ module ContextDev class MonitorDeleteParams = ContextDev::Models::MonitorDeleteParams + class MonitorGetCreditUsageParams = ContextDev::Models::MonitorGetCreditUsageParams + + class MonitorGetLimitsParams = ContextDev::Models::MonitorGetLimitsParams + class MonitorListAccountChangesParams = ContextDev::Models::MonitorListAccountChangesParams class MonitorListAccountRunsParams = ContextDev::Models::MonitorListAccountRunsParams diff --git a/sig/context_dev/models/monitor_get_credit_usage_params.rbs b/sig/context_dev/models/monitor_get_credit_usage_params.rbs new file mode 100644 index 00000000..bbcfc3f1 --- /dev/null +++ b/sig/context_dev/models/monitor_get_credit_usage_params.rbs @@ -0,0 +1,32 @@ +module ContextDev + module Models + type monitor_get_credit_usage_params = + { since: Time, until_: Time } + & ContextDev::Internal::Type::request_parameters + + class MonitorGetCreditUsageParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + attr_reader since: Time? + + def since=: (Time) -> Time + + attr_reader until_: Time? + + def until_=: (Time) -> Time + + def initialize: ( + ?since: Time, + ?until_: Time, + ?request_options: ContextDev::request_opts + ) -> void + + def to_hash: -> { + since: Time, + until_: Time, + request_options: ContextDev::RequestOptions + } + end + end +end diff --git a/sig/context_dev/models/monitor_get_credit_usage_response.rbs b/sig/context_dev/models/monitor_get_credit_usage_response.rbs new file mode 100644 index 00000000..e2789235 --- /dev/null +++ b/sig/context_dev/models/monitor_get_credit_usage_response.rbs @@ -0,0 +1,52 @@ +module ContextDev + module Models + type monitor_get_credit_usage_response = + { + data: ::Array[ContextDev::Models::MonitorGetCreditUsageResponse::Data], + total_credits: Integer + } + + class MonitorGetCreditUsageResponse < ContextDev::Internal::Type::BaseModel + attr_accessor data: ::Array[ContextDev::Models::MonitorGetCreditUsageResponse::Data] + + attr_accessor total_credits: Integer + + def initialize: ( + data: ::Array[ContextDev::Models::MonitorGetCreditUsageResponse::Data], + total_credits: Integer + ) -> void + + def to_hash: -> { + data: ::Array[ContextDev::Models::MonitorGetCreditUsageResponse::Data], + total_credits: Integer + } + + type data = + { credits: Integer, monitor_id: String, name: String, runs: Integer } + + class Data < ContextDev::Internal::Type::BaseModel + attr_accessor credits: Integer + + attr_accessor monitor_id: String + + attr_accessor name: String + + attr_accessor runs: Integer + + def initialize: ( + credits: Integer, + monitor_id: String, + name: String, + runs: Integer + ) -> void + + def to_hash: -> { + credits: Integer, + monitor_id: String, + name: String, + runs: Integer + } + end + end + end +end diff --git a/sig/context_dev/models/monitor_get_limits_params.rbs b/sig/context_dev/models/monitor_get_limits_params.rbs new file mode 100644 index 00000000..cc062508 --- /dev/null +++ b/sig/context_dev/models/monitor_get_limits_params.rbs @@ -0,0 +1,15 @@ +module ContextDev + module Models + type monitor_get_limits_params = + { } & ContextDev::Internal::Type::request_parameters + + class MonitorGetLimitsParams < ContextDev::Internal::Type::BaseModel + extend ContextDev::Internal::Type::RequestParameters::Converter + include ContextDev::Internal::Type::RequestParameters + + def initialize: (?request_options: ContextDev::request_opts) -> void + + def to_hash: -> { request_options: ContextDev::RequestOptions } + end + end +end diff --git a/sig/context_dev/models/monitor_get_limits_response.rbs b/sig/context_dev/models/monitor_get_limits_response.rbs new file mode 100644 index 00000000..b2b01a1a --- /dev/null +++ b/sig/context_dev/models/monitor_get_limits_response.rbs @@ -0,0 +1,43 @@ +module ContextDev + module Models + type monitor_get_limits_response = + { + monitors_limit: Integer, + monitors_used: Integer, + plan: ContextDev::Models::MonitorGetLimitsResponse::plan + } + + class MonitorGetLimitsResponse < ContextDev::Internal::Type::BaseModel + attr_accessor monitors_limit: Integer + + attr_accessor monitors_used: Integer + + attr_accessor plan: ContextDev::Models::MonitorGetLimitsResponse::plan + + def initialize: ( + monitors_limit: Integer, + monitors_used: Integer, + plan: ContextDev::Models::MonitorGetLimitsResponse::plan + ) -> void + + def to_hash: -> { + monitors_limit: Integer, + monitors_used: Integer, + plan: ContextDev::Models::MonitorGetLimitsResponse::plan + } + + type plan = :free | :starter | :pro | :scale + + module Plan + extend ContextDev::Internal::Type::Enum + + FREE: :free + STARTER: :starter + PRO: :pro + SCALE: :scale + + def self?.values: -> ::Array[ContextDev::Models::MonitorGetLimitsResponse::plan] + end + end + end +end diff --git a/sig/context_dev/resources/monitors.rbs b/sig/context_dev/resources/monitors.rbs index 0273ebff..8a439864 100644 --- a/sig/context_dev/resources/monitors.rbs +++ b/sig/context_dev/resources/monitors.rbs @@ -48,6 +48,16 @@ module ContextDev ?request_options: ContextDev::request_opts ) -> ContextDev::Models::MonitorDeleteResponse + def get_credit_usage: ( + ?since: Time, + ?until_: Time, + ?request_options: ContextDev::request_opts + ) -> ContextDev::Models::MonitorGetCreditUsageResponse + + def get_limits: ( + ?request_options: ContextDev::request_opts + ) -> ContextDev::Models::MonitorGetLimitsResponse + def list_account_changes: ( ?change_detection_type: ContextDev::Models::MonitorListAccountChangesParams::change_detection_type, ?cursor: String, diff --git a/test/context_dev/resources/monitors_test.rb b/test/context_dev/resources/monitors_test.rb index 453607b9..c3c39bdf 100644 --- a/test/context_dev/resources/monitors_test.rb +++ b/test/context_dev/resources/monitors_test.rb @@ -140,6 +140,41 @@ def test_delete end end + def test_get_credit_usage + skip("Mock server tests are disabled") + + response = @context_dev.monitors.get_credit_usage + + assert_pattern do + response => ContextDev::Models::MonitorGetCreditUsageResponse + end + + assert_pattern do + response => { + data: ^(ContextDev::Internal::Type::ArrayOf[ContextDev::Models::MonitorGetCreditUsageResponse::Data]), + total_credits: Integer + } + end + end + + def test_get_limits + skip("Mock server tests are disabled") + + response = @context_dev.monitors.get_limits + + assert_pattern do + response => ContextDev::Models::MonitorGetLimitsResponse + end + + assert_pattern do + response => { + monitors_limit: Integer, + monitors_used: Integer, + plan: ContextDev::Models::MonitorGetLimitsResponse::Plan + } + end + end + def test_list_account_changes skip("Mock server tests are disabled") From 752389bd872bd1d514d593da34ed41a8f6d4f809 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 08:18:26 +0000 Subject: [PATCH 07/13] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 674523c1..1a4b8983 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-d25300a20809f87d2069c1f4417b158b2e2d1cef3ca9b6bf7653e02233deba2c.yml -openapi_spec_hash: e43dd84c75e6d710c7346b9f12c34738 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-65d8d9d461368f72da68cd7606e0498cde07b586235769d8e3e04b7a3c42858d.yml +openapi_spec_hash: 048da2b1bfe8095b6c2e805c515e20e2 config_hash: 70e7e80b5e87f94981bee396c6cd41e8 From c9c447554772879c742d72ac88174a75fbff599a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 08:32:15 +0000 Subject: [PATCH 08/13] feat(api): api update --- .stats.yml | 4 ++-- lib/context_dev/models/monitor_create_params.rb | 11 ++++++----- lib/context_dev/models/monitor_create_response.rb | 11 ++++++----- .../models/monitor_list_account_changes_response.rb | 3 ++- .../models/monitor_list_changes_response.rb | 3 ++- lib/context_dev/models/monitor_list_response.rb | 11 ++++++----- .../models/monitor_retrieve_change_response.rb | 3 ++- lib/context_dev/models/monitor_retrieve_response.rb | 11 ++++++----- lib/context_dev/models/monitor_update_params.rb | 11 ++++++----- lib/context_dev/models/monitor_update_response.rb | 11 ++++++----- lib/context_dev/resources/monitors.rb | 4 ++-- rbi/context_dev/models/monitor_create_params.rbi | 10 ++++++---- rbi/context_dev/models/monitor_create_response.rbi | 10 ++++++---- .../models/monitor_list_account_changes_response.rbi | 2 ++ .../models/monitor_list_changes_response.rbi | 2 ++ rbi/context_dev/models/monitor_list_response.rbi | 10 ++++++---- .../models/monitor_retrieve_change_response.rbi | 2 ++ rbi/context_dev/models/monitor_retrieve_response.rbi | 10 ++++++---- rbi/context_dev/models/monitor_update_params.rbi | 10 ++++++---- rbi/context_dev/models/monitor_update_response.rbi | 10 ++++++---- rbi/context_dev/resources/monitors.rbi | 2 ++ 21 files changed, 90 insertions(+), 61 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1a4b8983..d1ed301b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-65d8d9d461368f72da68cd7606e0498cde07b586235769d8e3e04b7a3c42858d.yml -openapi_spec_hash: 048da2b1bfe8095b6c2e805c515e20e2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-48449a9e476c712dc65557934c8b97ac9708b06b7f96fa5c22d135037eeb9ce5.yml +openapi_spec_hash: 6a0575b3dc2ea3e5d47c4961f0251213 config_hash: 70e7e80b5e87f94981bee396c6cd41e8 diff --git a/lib/context_dev/models/monitor_create_params.rb b/lib/context_dev/models/monitor_create_params.rb index e3452982..0f80b661 100644 --- a/lib/context_dev/models/monitor_create_params.rb +++ b/lib/context_dev/models/monitor_create_params.rb @@ -41,6 +41,7 @@ class MonitorCreateParams < ContextDev::Internal::Type::BaseModel # @!attribute tags # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -64,7 +65,7 @@ class MonitorCreateParams < ContextDev::Internal::Type::BaseModel # # @param mode [Symbol, ContextDev::Models::MonitorCreateParams::Mode] Top-level monitor category. Always `web` today; the concrete behavior is describ # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # # @param webhook [ContextDev::Models::MonitorCreateParams::Webhook, nil] # @@ -230,13 +231,13 @@ class Sitemap < ContextDev::Internal::Type::BaseModel required :url, String # @!attribute exclude - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). # # @return [Array, nil] optional :exclude, ContextDev::Internal::Type::ArrayOf[String] # @!attribute include - # URL path patterns to include. + # URL path patterns to include (max 50). # # @return [Array, nil] optional :include, ContextDev::Internal::Type::ArrayOf[String] @@ -256,9 +257,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # # @param url [String] Sitemap URL to monitor. # - # @param exclude [Array] URL path patterns to exclude. + # @param exclude [Array] URL path patterns to exclude (max 50). # - # @param include [Array] URL path patterns to include. + # @param include [Array] URL path patterns to include (max 50). # # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000). # diff --git a/lib/context_dev/models/monitor_create_response.rb b/lib/context_dev/models/monitor_create_response.rb index 2187983a..168c3a02 100644 --- a/lib/context_dev/models/monitor_create_response.rb +++ b/lib/context_dev/models/monitor_create_response.rb @@ -94,6 +94,7 @@ class MonitorCreateResponse < ContextDev::Internal::Type::BaseModel # @!attribute tags # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -146,7 +147,7 @@ class MonitorCreateResponse < ContextDev::Internal::Type::BaseModel # # @param next_run_at [Time, nil] When the next scheduled run is due. # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # # @param webhook [ContextDev::Models::MonitorCreateResponse::Webhook, nil] # @@ -348,13 +349,13 @@ class Sitemap < ContextDev::Internal::Type::BaseModel required :url, String # @!attribute exclude - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). # # @return [Array, nil] optional :exclude, ContextDev::Internal::Type::ArrayOf[String] # @!attribute include - # URL path patterns to include. + # URL path patterns to include (max 50). # # @return [Array, nil] optional :include, ContextDev::Internal::Type::ArrayOf[String] @@ -374,9 +375,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # # @param url [String] Sitemap URL to monitor. # - # @param exclude [Array] URL path patterns to exclude. + # @param exclude [Array] URL path patterns to exclude (max 50). # - # @param include [Array] URL path patterns to include. + # @param include [Array] URL path patterns to include (max 50). # # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000). # diff --git a/lib/context_dev/models/monitor_list_account_changes_response.rb b/lib/context_dev/models/monitor_list_account_changes_response.rb index f4b26b37..15b5e9ee 100644 --- a/lib/context_dev/models/monitor_list_account_changes_response.rb +++ b/lib/context_dev/models/monitor_list_account_changes_response.rb @@ -102,6 +102,7 @@ class Data < ContextDev::Internal::Type::BaseModel # @!attribute tags # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -144,7 +145,7 @@ class Data < ContextDev::Internal::Type::BaseModel # # @param removed_url_count [Integer] # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # @see ContextDev::Models::MonitorListAccountChangesResponse::Data#change_detection_type module ChangeDetectionType diff --git a/lib/context_dev/models/monitor_list_changes_response.rb b/lib/context_dev/models/monitor_list_changes_response.rb index 99a53f21..5a08e0bb 100644 --- a/lib/context_dev/models/monitor_list_changes_response.rb +++ b/lib/context_dev/models/monitor_list_changes_response.rb @@ -101,6 +101,7 @@ class Data < ContextDev::Internal::Type::BaseModel # @!attribute tags # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -143,7 +144,7 @@ class Data < ContextDev::Internal::Type::BaseModel # # @param removed_url_count [Integer] # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # @see ContextDev::Models::MonitorListChangesResponse::Data#change_detection_type module ChangeDetectionType diff --git a/lib/context_dev/models/monitor_list_response.rb b/lib/context_dev/models/monitor_list_response.rb index 988b5853..a5df5a10 100644 --- a/lib/context_dev/models/monitor_list_response.rb +++ b/lib/context_dev/models/monitor_list_response.rb @@ -115,6 +115,7 @@ class Data < ContextDev::Internal::Type::BaseModel # @!attribute tags # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -169,7 +170,7 @@ class Data < ContextDev::Internal::Type::BaseModel # # @param next_run_at [Time, nil] When the next scheduled run is due. # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # # @param webhook [ContextDev::Models::MonitorListResponse::Data::Webhook, nil] # @@ -371,13 +372,13 @@ class Sitemap < ContextDev::Internal::Type::BaseModel required :url, String # @!attribute exclude - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). # # @return [Array, nil] optional :exclude, ContextDev::Internal::Type::ArrayOf[String] # @!attribute include - # URL path patterns to include. + # URL path patterns to include (max 50). # # @return [Array, nil] optional :include, ContextDev::Internal::Type::ArrayOf[String] @@ -397,9 +398,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # # @param url [String] Sitemap URL to monitor. # - # @param exclude [Array] URL path patterns to exclude. + # @param exclude [Array] URL path patterns to exclude (max 50). # - # @param include [Array] URL path patterns to include. + # @param include [Array] URL path patterns to include (max 50). # # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000). # diff --git a/lib/context_dev/models/monitor_retrieve_change_response.rb b/lib/context_dev/models/monitor_retrieve_change_response.rb index 6b8ba7a6..c5b0caf4 100644 --- a/lib/context_dev/models/monitor_retrieve_change_response.rb +++ b/lib/context_dev/models/monitor_retrieve_change_response.rb @@ -45,6 +45,7 @@ class MonitorRetrieveChangeResponse < ContextDev::Internal::Type::BaseModel # @!attribute tags # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. # # @return [Array] required :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -153,7 +154,7 @@ class MonitorRetrieveChangeResponse < ContextDev::Internal::Type::BaseModel # # @param summary [String] # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # # @param target_type [Symbol, ContextDev::Models::MonitorRetrieveChangeResponse::TargetType] # diff --git a/lib/context_dev/models/monitor_retrieve_response.rb b/lib/context_dev/models/monitor_retrieve_response.rb index 3ce485af..e77d1f0b 100644 --- a/lib/context_dev/models/monitor_retrieve_response.rb +++ b/lib/context_dev/models/monitor_retrieve_response.rb @@ -94,6 +94,7 @@ class MonitorRetrieveResponse < ContextDev::Internal::Type::BaseModel # @!attribute tags # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -146,7 +147,7 @@ class MonitorRetrieveResponse < ContextDev::Internal::Type::BaseModel # # @param next_run_at [Time, nil] When the next scheduled run is due. # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # # @param webhook [ContextDev::Models::MonitorRetrieveResponse::Webhook, nil] # @@ -348,13 +349,13 @@ class Sitemap < ContextDev::Internal::Type::BaseModel required :url, String # @!attribute exclude - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). # # @return [Array, nil] optional :exclude, ContextDev::Internal::Type::ArrayOf[String] # @!attribute include - # URL path patterns to include. + # URL path patterns to include (max 50). # # @return [Array, nil] optional :include, ContextDev::Internal::Type::ArrayOf[String] @@ -374,9 +375,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # # @param url [String] Sitemap URL to monitor. # - # @param exclude [Array] URL path patterns to exclude. + # @param exclude [Array] URL path patterns to exclude (max 50). # - # @param include [Array] URL path patterns to include. + # @param include [Array] URL path patterns to include (max 50). # # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000). # diff --git a/lib/context_dev/models/monitor_update_params.rb b/lib/context_dev/models/monitor_update_params.rb index 35c1f9e1..395abeb4 100644 --- a/lib/context_dev/models/monitor_update_params.rb +++ b/lib/context_dev/models/monitor_update_params.rb @@ -38,6 +38,7 @@ class MonitorUpdateParams < ContextDev::Internal::Type::BaseModel # @!attribute tags # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -68,7 +69,7 @@ class MonitorUpdateParams < ContextDev::Internal::Type::BaseModel # # @param status [Symbol, ContextDev::Models::MonitorUpdateParams::Status] # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # # @param target [ContextDev::Models::MonitorUpdateParams::Target::Page, ContextDev::Models::MonitorUpdateParams::Target::Sitemap, ContextDev::Models::MonitorUpdateParams::Target::Extract] Discriminated union describing what the monitor watches. # @@ -246,13 +247,13 @@ class Sitemap < ContextDev::Internal::Type::BaseModel required :url, String # @!attribute exclude - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). # # @return [Array, nil] optional :exclude, ContextDev::Internal::Type::ArrayOf[String] # @!attribute include - # URL path patterns to include. + # URL path patterns to include (max 50). # # @return [Array, nil] optional :include, ContextDev::Internal::Type::ArrayOf[String] @@ -272,9 +273,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # # @param url [String] Sitemap URL to monitor. # - # @param exclude [Array] URL path patterns to exclude. + # @param exclude [Array] URL path patterns to exclude (max 50). # - # @param include [Array] URL path patterns to include. + # @param include [Array] URL path patterns to include (max 50). # # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000). # diff --git a/lib/context_dev/models/monitor_update_response.rb b/lib/context_dev/models/monitor_update_response.rb index 027fe36b..996bfd0e 100644 --- a/lib/context_dev/models/monitor_update_response.rb +++ b/lib/context_dev/models/monitor_update_response.rb @@ -94,6 +94,7 @@ class MonitorUpdateResponse < ContextDev::Internal::Type::BaseModel # @!attribute tags # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. # # @return [Array, nil] optional :tags, ContextDev::Internal::Type::ArrayOf[String] @@ -146,7 +147,7 @@ class MonitorUpdateResponse < ContextDev::Internal::Type::BaseModel # # @param next_run_at [Time, nil] When the next scheduled run is due. # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # # @param webhook [ContextDev::Models::MonitorUpdateResponse::Webhook, nil] # @@ -348,13 +349,13 @@ class Sitemap < ContextDev::Internal::Type::BaseModel required :url, String # @!attribute exclude - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). # # @return [Array, nil] optional :exclude, ContextDev::Internal::Type::ArrayOf[String] # @!attribute include - # URL path patterns to include. + # URL path patterns to include (max 50). # # @return [Array, nil] optional :include, ContextDev::Internal::Type::ArrayOf[String] @@ -374,9 +375,9 @@ class Sitemap < ContextDev::Internal::Type::BaseModel # # @param url [String] Sitemap URL to monitor. # - # @param exclude [Array] URL path patterns to exclude. + # @param exclude [Array] URL path patterns to exclude (max 50). # - # @param include [Array] URL path patterns to include. + # @param include [Array] URL path patterns to include (max 50). # # @param max_urls [Integer] Maximum number of sitemap URLs to track (capped at 10,000). # diff --git a/lib/context_dev/resources/monitors.rb b/lib/context_dev/resources/monitors.rb index 2a076f5a..5f860309 100644 --- a/lib/context_dev/resources/monitors.rb +++ b/lib/context_dev/resources/monitors.rb @@ -26,7 +26,7 @@ class Monitors # # @param mode [Symbol, ContextDev::Models::MonitorCreateParams::Mode] Top-level monitor category. Always `web` today; the concrete behavior is describ # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # # @param webhook [ContextDev::Models::MonitorCreateParams::Webhook, nil] # @@ -84,7 +84,7 @@ def retrieve(monitor_id, params = {}) # # @param status [Symbol, ContextDev::Models::MonitorUpdateParams::Status] # - # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. + # @param tags [Array] User-defined tags for grouping and filtering monitors and their changes. Duplica # # @param target [ContextDev::Models::MonitorUpdateParams::Target::Page, ContextDev::Models::MonitorUpdateParams::Target::Sitemap, ContextDev::Models::MonitorUpdateParams::Target::Extract] Discriminated union describing what the monitor watches. # diff --git a/rbi/context_dev/models/monitor_create_params.rbi b/rbi/context_dev/models/monitor_create_params.rbi index ec99f358..04e76352 100644 --- a/rbi/context_dev/models/monitor_create_params.rbi +++ b/rbi/context_dev/models/monitor_create_params.rbi @@ -59,6 +59,7 @@ module ContextDev attr_writer :mode # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -110,6 +111,7 @@ module ContextDev # described by `target` and `change_detection`. mode: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil, webhook: nil, request_options: {} @@ -418,14 +420,14 @@ module ContextDev sig { returns(String) } attr_accessor :url - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :exclude sig { params(exclude: T::Array[String]).void } attr_writer :exclude - # URL path patterns to include. + # URL path patterns to include (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :include @@ -456,9 +458,9 @@ module ContextDev def self.new( # Sitemap URL to monitor. url:, - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). exclude: nil, - # URL path patterns to include. + # URL path patterns to include (max 50). include: nil, # Maximum number of sitemap URLs to track (capped at 10,000). max_urls: nil, diff --git a/rbi/context_dev/models/monitor_create_response.rbi b/rbi/context_dev/models/monitor_create_response.rbi index 29a3ae33..c75c7668 100644 --- a/rbi/context_dev/models/monitor_create_response.rbi +++ b/rbi/context_dev/models/monitor_create_response.rbi @@ -107,6 +107,7 @@ module ContextDev attr_accessor :next_run_at # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -230,6 +231,7 @@ module ContextDev # When the next scheduled run is due. next_run_at: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil, webhook: nil, # Present while webhook deliveries are failing consecutively; null when deliveries @@ -636,14 +638,14 @@ module ContextDev sig { returns(String) } attr_accessor :url - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :exclude sig { params(exclude: T::Array[String]).void } attr_writer :exclude - # URL path patterns to include. + # URL path patterns to include (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :include @@ -674,9 +676,9 @@ module ContextDev def self.new( # Sitemap URL to monitor. url:, - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). exclude: nil, - # URL path patterns to include. + # URL path patterns to include (max 50). include: nil, # Maximum number of sitemap URLs to track (capped at 10,000). max_urls: nil, diff --git a/rbi/context_dev/models/monitor_list_account_changes_response.rbi b/rbi/context_dev/models/monitor_list_account_changes_response.rbi index b0542dac..3d514393 100644 --- a/rbi/context_dev/models/monitor_list_account_changes_response.rbi +++ b/rbi/context_dev/models/monitor_list_account_changes_response.rbi @@ -144,6 +144,7 @@ module ContextDev attr_writer :removed_url_count # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -196,6 +197,7 @@ module ContextDev matched_url_count: nil, removed_url_count: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil ) end diff --git a/rbi/context_dev/models/monitor_list_changes_response.rbi b/rbi/context_dev/models/monitor_list_changes_response.rbi index 153b5bea..a92c6802 100644 --- a/rbi/context_dev/models/monitor_list_changes_response.rbi +++ b/rbi/context_dev/models/monitor_list_changes_response.rbi @@ -140,6 +140,7 @@ module ContextDev attr_writer :removed_url_count # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -192,6 +193,7 @@ module ContextDev matched_url_count: nil, removed_url_count: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil ) end diff --git a/rbi/context_dev/models/monitor_list_response.rbi b/rbi/context_dev/models/monitor_list_response.rbi index 6ac31ca8..2bb0f64f 100644 --- a/rbi/context_dev/models/monitor_list_response.rbi +++ b/rbi/context_dev/models/monitor_list_response.rbi @@ -156,6 +156,7 @@ module ContextDev attr_accessor :next_run_at # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -285,6 +286,7 @@ module ContextDev # When the next scheduled run is due. next_run_at: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil, webhook: nil, # Present while webhook deliveries are failing consecutively; null when deliveries @@ -700,14 +702,14 @@ module ContextDev sig { returns(String) } attr_accessor :url - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :exclude sig { params(exclude: T::Array[String]).void } attr_writer :exclude - # URL path patterns to include. + # URL path patterns to include (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :include @@ -738,9 +740,9 @@ module ContextDev def self.new( # Sitemap URL to monitor. url:, - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). exclude: nil, - # URL path patterns to include. + # URL path patterns to include (max 50). include: nil, # Maximum number of sitemap URLs to track (capped at 10,000). max_urls: nil, diff --git a/rbi/context_dev/models/monitor_retrieve_change_response.rbi b/rbi/context_dev/models/monitor_retrieve_change_response.rbi index c6e43212..bf907e5d 100644 --- a/rbi/context_dev/models/monitor_retrieve_change_response.rbi +++ b/rbi/context_dev/models/monitor_retrieve_change_response.rbi @@ -44,6 +44,7 @@ module ContextDev attr_accessor :summary # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. sig { returns(T::Array[String]) } attr_accessor :tags @@ -213,6 +214,7 @@ module ContextDev run_id:, summary:, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags:, target_type:, title:, diff --git a/rbi/context_dev/models/monitor_retrieve_response.rbi b/rbi/context_dev/models/monitor_retrieve_response.rbi index 4756f83a..09f6757b 100644 --- a/rbi/context_dev/models/monitor_retrieve_response.rbi +++ b/rbi/context_dev/models/monitor_retrieve_response.rbi @@ -112,6 +112,7 @@ module ContextDev attr_accessor :next_run_at # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -236,6 +237,7 @@ module ContextDev # When the next scheduled run is due. next_run_at: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil, webhook: nil, # Present while webhook deliveries are failing consecutively; null when deliveries @@ -644,14 +646,14 @@ module ContextDev sig { returns(String) } attr_accessor :url - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :exclude sig { params(exclude: T::Array[String]).void } attr_writer :exclude - # URL path patterns to include. + # URL path patterns to include (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :include @@ -682,9 +684,9 @@ module ContextDev def self.new( # Sitemap URL to monitor. url:, - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). exclude: nil, - # URL path patterns to include. + # URL path patterns to include (max 50). include: nil, # Maximum number of sitemap URLs to track (capped at 10,000). max_urls: nil, diff --git a/rbi/context_dev/models/monitor_update_params.rbi b/rbi/context_dev/models/monitor_update_params.rbi index 50248015..fb9240b0 100644 --- a/rbi/context_dev/models/monitor_update_params.rbi +++ b/rbi/context_dev/models/monitor_update_params.rbi @@ -66,6 +66,7 @@ module ContextDev attr_writer :status # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -142,6 +143,7 @@ module ContextDev schedule: nil, status: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil, # Discriminated union describing what the monitor watches. target: nil, @@ -477,14 +479,14 @@ module ContextDev sig { returns(String) } attr_accessor :url - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :exclude sig { params(exclude: T::Array[String]).void } attr_writer :exclude - # URL path patterns to include. + # URL path patterns to include (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :include @@ -515,9 +517,9 @@ module ContextDev def self.new( # Sitemap URL to monitor. url:, - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). exclude: nil, - # URL path patterns to include. + # URL path patterns to include (max 50). include: nil, # Maximum number of sitemap URLs to track (capped at 10,000). max_urls: nil, diff --git a/rbi/context_dev/models/monitor_update_response.rbi b/rbi/context_dev/models/monitor_update_response.rbi index 773c94bd..823d0515 100644 --- a/rbi/context_dev/models/monitor_update_response.rbi +++ b/rbi/context_dev/models/monitor_update_response.rbi @@ -107,6 +107,7 @@ module ContextDev attr_accessor :next_run_at # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. sig { returns(T.nilable(T::Array[String])) } attr_reader :tags @@ -230,6 +231,7 @@ module ContextDev # When the next scheduled run is due. next_run_at: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil, webhook: nil, # Present while webhook deliveries are failing consecutively; null when deliveries @@ -636,14 +638,14 @@ module ContextDev sig { returns(String) } attr_accessor :url - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :exclude sig { params(exclude: T::Array[String]).void } attr_writer :exclude - # URL path patterns to include. + # URL path patterns to include (max 50). sig { returns(T.nilable(T::Array[String])) } attr_reader :include @@ -674,9 +676,9 @@ module ContextDev def self.new( # Sitemap URL to monitor. url:, - # URL path patterns to exclude. + # URL path patterns to exclude (max 50). exclude: nil, - # URL path patterns to include. + # URL path patterns to include (max 50). include: nil, # Maximum number of sitemap URLs to track (capped at 10,000). max_urls: nil, diff --git a/rbi/context_dev/resources/monitors.rbi b/rbi/context_dev/resources/monitors.rbi index 96e57bd2..cf0a3cd3 100644 --- a/rbi/context_dev/resources/monitors.rbi +++ b/rbi/context_dev/resources/monitors.rbi @@ -45,6 +45,7 @@ module ContextDev # described by `target` and `change_detection`. mode: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil, webhook: nil, request_options: {} @@ -97,6 +98,7 @@ module ContextDev schedule: nil, status: nil, # User-defined tags for grouping and filtering monitors and their changes. + # Duplicates are removed. tags: nil, # Discriminated union describing what the monitor watches. target: nil, From 28793d84ed93dcf457aaf3f346056f2480f37724 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 08:56:11 +0000 Subject: [PATCH 09/13] feat(api): api update --- .stats.yml | 4 +- .../models/web_web_scrape_html_params.rb | 67 ++++++++++- .../models/web_web_scrape_images_params.rb | 69 ++++++++++- .../models/web_web_scrape_md_params.rb | 67 ++++++++++- lib/context_dev/resources/web.rb | 40 ++++--- .../models/web_web_scrape_html_params.rbi | 113 ++++++++++++++++++ .../models/web_web_scrape_images_params.rbi | 113 ++++++++++++++++++ .../models/web_web_scrape_md_params.rbi | 113 ++++++++++++++++++ rbi/context_dev/resources/web.rbi | 67 +++++++++-- .../models/web_web_scrape_html_params.rbs | 39 ++++++ .../models/web_web_scrape_images_params.rbs | 39 ++++++ .../models/web_web_scrape_md_params.rbs | 39 ++++++ sig/context_dev/resources/web.rbs | 3 + 13 files changed, 739 insertions(+), 34 deletions(-) diff --git a/.stats.yml b/.stats.yml index d1ed301b..f41ab2ed 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-48449a9e476c712dc65557934c8b97ac9708b06b7f96fa5c22d135037eeb9ce5.yml -openapi_spec_hash: 6a0575b3dc2ea3e5d47c4961f0251213 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-1ad134d4ef2ddefee790dc464dd2da3e4c0614652620b25fbb1379d8f5676526.yml +openapi_spec_hash: 24809b018c6869838112f064e5558509 config_hash: 70e7e80b5e87f94981bee396c6cd41e8 diff --git a/lib/context_dev/models/web_web_scrape_html_params.rb b/lib/context_dev/models/web_web_scrape_html_params.rb index 90f87943..78b191ff 100644 --- a/lib/context_dev/models/web_web_scrape_html_params.rb +++ b/lib/context_dev/models/web_web_scrape_html_params.rb @@ -13,6 +13,16 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @return [String] required :url, String + # @!attribute actions + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + # + # @return [Array, nil] + optional :actions, + -> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeHTMLParams::Action] }, + nil?: true + # @!attribute country # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported @@ -113,12 +123,14 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # @return [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Zdr, nil] optional :zdr, enum: -> { ContextDev::WebWebScrapeHTMLParams::Zdr } - # @!method initialize(url:, 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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) + # @!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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeHTMLParams} for more details. # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # + # @param actions [Array, nil] Optional browser actions executed in array order after the page loads and before + # # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # # @param exclude_selectors [Array, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi @@ -147,6 +159,59 @@ class WebWebScrapeHTMLParams < ContextDev::Internal::Type::BaseModel # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + # Browser action discriminated by `do`. Each variant exposes only its applicable + # fields. + module Action + extend ContextDev::Internal::Type::Union + + discriminator :do + + # Pause for a fixed number of milliseconds before continuing to the next action. + variant :wait, -> { ContextDev::WebWebScrapeHTMLParams::Action::Wait } + + # Resolve and perform one natural-language browser action. + variant :perform, -> { ContextDev::WebWebScrapeHTMLParams::Action::Perform } + + class Wait < ContextDev::Internal::Type::BaseModel + # @!attribute do_ + # + # @return [Symbol, :wait] + required :do_, const: :wait, api_name: :do + + # @!attribute time_ms + # + # @return [Integer] + required :time_ms, Integer, api_name: :timeMs + + # @!method initialize(time_ms:, do_: :wait) + # Pause for a fixed number of milliseconds before continuing to the next action. + # + # @param time_ms [Integer] + # @param do_ [Symbol, :wait] + end + + class Perform < ContextDev::Internal::Type::BaseModel + # @!attribute action + # + # @return [String] + required :action, String + + # @!attribute do_ + # + # @return [Symbol, :perform] + required :do_, const: :perform, api_name: :do + + # @!method initialize(action:, do_: :perform) + # Resolve and perform one natural-language browser action. + # + # @param action [String] + # @param do_ [Symbol, :perform] + end + + # @!method self.variants + # @return [Array(ContextDev::Models::WebWebScrapeHTMLParams::Action::Wait, ContextDev::Models::WebWebScrapeHTMLParams::Action::Perform)] + end + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. diff --git a/lib/context_dev/models/web_web_scrape_images_params.rb b/lib/context_dev/models/web_web_scrape_images_params.rb index 0e739593..95df9651 100644 --- a/lib/context_dev/models/web_web_scrape_images_params.rb +++ b/lib/context_dev/models/web_web_scrape_images_params.rb @@ -13,6 +13,18 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # @return [String] required :url, String + # @!attribute actions + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + # + # @return [Array, nil] + optional :actions, + -> { + ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeImagesParams::Action] + }, + nil?: true + # @!attribute dedupe # When true, visually duplicate images are removed: every image is loaded and # perceptually hashed, and only the highest-resolution copy of each duplicate @@ -67,12 +79,14 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :wait_for_ms, Integer, nil?: true - # @!method initialize(url:, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) + # @!method initialize(url:, actions: nil, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeImagesParams} for more details. # # @param url [String] Page URL to inspect. Must include http:// or https://. # + # @param actions [Array, nil] Optional browser actions executed in array order after the page loads and before + # # @param dedupe [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Dedupe] When true, visually duplicate images are removed: every image is loaded and perc # # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil] Optional per-image processing, sent as deep-object query params such as enrichme @@ -89,6 +103,59 @@ class WebWebScrapeImagesParams < ContextDev::Internal::Type::BaseModel # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + # Browser action discriminated by `do`. Each variant exposes only its applicable + # fields. + module Action + extend ContextDev::Internal::Type::Union + + discriminator :do + + # Pause for a fixed number of milliseconds before continuing to the next action. + variant :wait, -> { ContextDev::WebWebScrapeImagesParams::Action::Wait } + + # Resolve and perform one natural-language browser action. + variant :perform, -> { ContextDev::WebWebScrapeImagesParams::Action::Perform } + + class Wait < ContextDev::Internal::Type::BaseModel + # @!attribute do_ + # + # @return [Symbol, :wait] + required :do_, const: :wait, api_name: :do + + # @!attribute time_ms + # + # @return [Integer] + required :time_ms, Integer, api_name: :timeMs + + # @!method initialize(time_ms:, do_: :wait) + # Pause for a fixed number of milliseconds before continuing to the next action. + # + # @param time_ms [Integer] + # @param do_ [Symbol, :wait] + end + + class Perform < ContextDev::Internal::Type::BaseModel + # @!attribute action + # + # @return [String] + required :action, String + + # @!attribute do_ + # + # @return [Symbol, :perform] + required :do_, const: :perform, api_name: :do + + # @!method initialize(action:, do_: :perform) + # Resolve and perform one natural-language browser action. + # + # @param action [String] + # @param do_ [Symbol, :perform] + end + + # @!method self.variants + # @return [Array(ContextDev::Models::WebWebScrapeImagesParams::Action::Wait, ContextDev::Models::WebWebScrapeImagesParams::Action::Perform)] + end + # When true, visually duplicate images are removed: every image is loaded and # perceptually hashed, and only the highest-resolution copy of each duplicate # group is kept. Images that cannot be downloaded or hashed are kept. Default: diff --git a/lib/context_dev/models/web_web_scrape_md_params.rb b/lib/context_dev/models/web_web_scrape_md_params.rb index 353fb5ea..8cc66b78 100644 --- a/lib/context_dev/models/web_web_scrape_md_params.rb +++ b/lib/context_dev/models/web_web_scrape_md_params.rb @@ -14,6 +14,16 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [String] required :url, String + # @!attribute actions + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + # + # @return [Array, nil] + optional :actions, + -> { ContextDev::Internal::Type::ArrayOf[union: ContextDev::WebWebScrapeMdParams::Action] }, + nil?: true + # @!attribute country # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported @@ -132,12 +142,14 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # @return [Symbol, ContextDev::Models::WebWebScrapeMdParams::Zdr, nil] optional :zdr, enum: -> { ContextDev::WebWebScrapeMdParams::Zdr } - # @!method initialize(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) + # @!method initialize(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeMdParams} for more details. # # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr # + # @param actions [Array, nil] Optional browser actions executed in array order after the page loads and before + # # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # # @param exclude_selectors [Array, nil] CSS selectors to remove before conversion to Markdown. Applied after includeSele @@ -172,6 +184,59 @@ class WebWebScrapeMdParams < ContextDev::Internal::Type::BaseModel # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}] + # Browser action discriminated by `do`. Each variant exposes only its applicable + # fields. + module Action + extend ContextDev::Internal::Type::Union + + discriminator :do + + # Pause for a fixed number of milliseconds before continuing to the next action. + variant :wait, -> { ContextDev::WebWebScrapeMdParams::Action::Wait } + + # Resolve and perform one natural-language browser action. + variant :perform, -> { ContextDev::WebWebScrapeMdParams::Action::Perform } + + class Wait < ContextDev::Internal::Type::BaseModel + # @!attribute do_ + # + # @return [Symbol, :wait] + required :do_, const: :wait, api_name: :do + + # @!attribute time_ms + # + # @return [Integer] + required :time_ms, Integer, api_name: :timeMs + + # @!method initialize(time_ms:, do_: :wait) + # Pause for a fixed number of milliseconds before continuing to the next action. + # + # @param time_ms [Integer] + # @param do_ [Symbol, :wait] + end + + class Perform < ContextDev::Internal::Type::BaseModel + # @!attribute action + # + # @return [String] + required :action, String + + # @!attribute do_ + # + # @return [Symbol, :perform] + required :do_, const: :perform, api_name: :do + + # @!method initialize(action:, do_: :perform) + # Resolve and perform one natural-language browser action. + # + # @param action [String] + # @param do_ [Symbol, :perform] + end + + # @!method self.variants + # @return [Array(ContextDev::Models::WebWebScrapeMdParams::Action::Wait, ContextDev::Models::WebWebScrapeMdParams::Action::Perform)] + end + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. diff --git a/lib/context_dev/resources/web.rb b/lib/context_dev/resources/web.rb index 7e2fae37..a76d7491 100644 --- a/lib/context_dev/resources/web.rb +++ b/lib/context_dev/resources/web.rb @@ -344,12 +344,15 @@ def web_crawl_md(params) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebWebScrapeHTMLParams} for more details. # - # Scrapes the given URL and returns the raw HTML content of the page. + # Scrapes the given URL and returns the raw HTML content of the page. The base + # request costs 1 credit; requests with browser actions cost 2 credits. # - # @overload web_scrape_html(url:, 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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) + # @overload web_scrape_html(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_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # # @param url [String] Full URL to scrape (must include http:// or https:// protocol) # + # @param actions [Array, nil] Optional browser actions executed in array order after the page loads and before + # # @param country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # # @param exclude_selectors [Array, nil] CSS selectors to remove from the result. Applied after includeSelectors. Exclusi @@ -407,13 +410,16 @@ def web_scrape_html(params) # # Extract image assets from a web page, including standard URLs, inline SVGs, data # URIs, responsive image sources, metadata, CSS backgrounds, video posters, and - # embeds. The base request costs 1 credit. When enrichment is enabled, the entire - # call costs 5 credits. + # embeds. The base request costs 1 credit, or 2 credits with browser actions. When + # enrichment is enabled, the entire call costs 5 credits, including requests that + # also use actions. # - # @overload web_scrape_images(url:, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) + # @overload web_scrape_images(url:, actions: nil, dedupe: nil, enrichment: nil, headers: nil, max_age_ms: nil, tags: nil, timeout_ms: nil, wait_for_ms: nil, request_options: {}) # # @param url [String] Page URL to inspect. Must include http:// or https://. # + # @param actions [Array, nil] Optional browser actions executed in array order after the page loads and before + # # @param dedupe [Boolean, Symbol, ContextDev::Models::WebWebScrapeImagesParams::Dedupe] When true, visually duplicate images are removed: every image is loaded and perc # # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment, nil] Optional per-image processing, sent as deep-object query params such as enrichme @@ -458,21 +464,23 @@ def web_scrape_images(params) # # ### Billing & errors # - # | HTTP status | Billed? | Meaning | - # | ----------- | -------------- | ---------------------------------------------------------------------------------------- | - # | 200 | Yes — 1 credit | Successful scrape, including a zero-length result when includeSelectors matched nothing | - # | 400 | No | Invalid input, skipped PDF, or the page could not be scraped | - # | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code | - # | 404 | No | Target page returned or fingerprinted as not found | - # | 408 | No | Request timed out | - # | 415 | No | Unsupported content type | - # | 429 | No | Per-minute rate limit exceeded; honor Retry-After | - # | 500 | No | Internal error | + # | HTTP status | Billed? | Meaning | + # | ----------- | ----------------------------------------- | ---------------------------------------------------------------------------------------- | + # | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing | + # | 400 | No | Invalid input, skipped PDF, or the page could not be scraped | + # | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code | + # | 404 | No | Target page returned or fingerprinted as not found | + # | 408 | No | Request timed out | + # | 415 | No | Unsupported content type | + # | 429 | No | Per-minute rate limit exceeded; honor Retry-After | + # | 500 | No | Internal error | # - # @overload web_scrape_md(url:, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) + # @overload web_scrape_md(url:, actions: nil, country: nil, exclude_selectors: nil, headers: nil, include_frames: nil, include_images: nil, include_links: nil, include_selectors: nil, max_age_ms: nil, pdf: nil, settle_animations: nil, shorten_base64_images: nil, tags: nil, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: nil, zdr: nil, request_options: {}) # # @param url [String] Full URL to scrape into LLM usable Markdown (must include http:// or https:// pr # + # @param actions [Array, nil] Optional browser actions executed in array order after the page loads and before + # # @param country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev r # # @param exclude_selectors [Array, nil] CSS selectors to remove before conversion to Markdown. Applied after includeSele diff --git a/rbi/context_dev/models/web_web_scrape_html_params.rbi b/rbi/context_dev/models/web_web_scrape_html_params.rbi index 6759174d..263f7d6a 100644 --- a/rbi/context_dev/models/web_web_scrape_html_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_html_params.rbi @@ -18,6 +18,23 @@ module ContextDev sig { returns(String) } attr_accessor :url + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + sig do + returns( + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeHTMLParams::Action::Wait, + ContextDev::WebWebScrapeHTMLParams::Action::Perform + ) + ] + ) + ) + end + attr_accessor :actions + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. @@ -185,6 +202,15 @@ module ContextDev sig do params( url: String, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeHTMLParams::Action::Wait::OrHash, + ContextDev::WebWebScrapeHTMLParams::Action::Perform::OrHash + ) + ] + ), country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol, exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], @@ -216,6 +242,10 @@ module ContextDev def self.new( # Full URL to scrape (must include http:// or https:// protocol) url:, + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + actions: nil, # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. @@ -272,6 +302,15 @@ module ContextDev override.returns( { url: String, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeHTMLParams::Action::Wait, + ContextDev::WebWebScrapeHTMLParams::Action::Perform + ) + ] + ), country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol, exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], @@ -304,6 +343,80 @@ module ContextDev def to_hash end + # Browser action discriminated by `do`. Each variant exposes only its applicable + # fields. + module Action + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::WebWebScrapeHTMLParams::Action::Wait, + ContextDev::WebWebScrapeHTMLParams::Action::Perform + ) + end + + class Wait < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::WebWebScrapeHTMLParams::Action::Wait, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :do_ + + sig { returns(Integer) } + attr_accessor :time_ms + + # Pause for a fixed number of milliseconds before continuing to the next action. + sig do + params(time_ms: Integer, do_: Symbol).returns(T.attached_class) + end + def self.new(time_ms:, do_: :wait) + end + + sig { override.returns({ do_: Symbol, time_ms: Integer }) } + def to_hash + end + end + + class Perform < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::WebWebScrapeHTMLParams::Action::Perform, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :action + + sig { returns(Symbol) } + attr_accessor :do_ + + # Resolve and perform one natural-language browser action. + sig { params(action: String, do_: Symbol).returns(T.attached_class) } + def self.new(action:, do_: :perform) + end + + sig { override.returns({ action: String, do_: Symbol }) } + def to_hash + end + end + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeHTMLParams::Action::Variants] + ) + end + def self.variants + end + end + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. diff --git a/rbi/context_dev/models/web_web_scrape_images_params.rbi b/rbi/context_dev/models/web_web_scrape_images_params.rbi index 0e16f6c7..8ca13d87 100644 --- a/rbi/context_dev/models/web_web_scrape_images_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_images_params.rbi @@ -18,6 +18,23 @@ module ContextDev sig { returns(String) } attr_accessor :url + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + sig do + returns( + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Wait, + ContextDev::WebWebScrapeImagesParams::Action::Perform + ) + ] + ) + ) + end + attr_accessor :actions + # When true, visually duplicate images are removed: every image is loaded and # perceptually hashed, and only the highest-resolution copy of each duplicate # group is kept. Images that cannot be downloaded or hashed are kept. Default: @@ -100,6 +117,15 @@ module ContextDev sig do params( url: String, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Wait::OrHash, + ContextDev::WebWebScrapeImagesParams::Action::Perform::OrHash + ) + ] + ), dedupe: T.any( T::Boolean, @@ -118,6 +144,10 @@ module ContextDev def self.new( # Page URL to inspect. Must include http:// or https://. url:, + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + actions: nil, # When true, visually duplicate images are removed: every image is loaded and # perceptually hashed, and only the highest-resolution copy of each duplicate # group is kept. Images that cannot be downloaded or hashed are kept. Default: @@ -152,6 +182,15 @@ module ContextDev override.returns( { url: String, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Wait, + ContextDev::WebWebScrapeImagesParams::Action::Perform + ) + ] + ), dedupe: T.any( T::Boolean, @@ -171,6 +210,80 @@ module ContextDev def to_hash end + # Browser action discriminated by `do`. Each variant exposes only its applicable + # fields. + module Action + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Wait, + ContextDev::WebWebScrapeImagesParams::Action::Perform + ) + end + + class Wait < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Wait, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :do_ + + sig { returns(Integer) } + attr_accessor :time_ms + + # Pause for a fixed number of milliseconds before continuing to the next action. + sig do + params(time_ms: Integer, do_: Symbol).returns(T.attached_class) + end + def self.new(time_ms:, do_: :wait) + end + + sig { override.returns({ do_: Symbol, time_ms: Integer }) } + def to_hash + end + end + + class Perform < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Perform, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :action + + sig { returns(Symbol) } + attr_accessor :do_ + + # Resolve and perform one natural-language browser action. + sig { params(action: String, do_: Symbol).returns(T.attached_class) } + def self.new(action:, do_: :perform) + end + + sig { override.returns({ action: String, do_: Symbol }) } + def to_hash + end + end + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeImagesParams::Action::Variants] + ) + end + def self.variants + end + end + # When true, visually duplicate images are removed: every image is loaded and # perceptually hashed, and only the highest-resolution copy of each duplicate # group is kept. Images that cannot be downloaded or hashed are kept. Default: diff --git a/rbi/context_dev/models/web_web_scrape_md_params.rbi b/rbi/context_dev/models/web_web_scrape_md_params.rbi index 6db290eb..bc3998d6 100644 --- a/rbi/context_dev/models/web_web_scrape_md_params.rbi +++ b/rbi/context_dev/models/web_web_scrape_md_params.rbi @@ -16,6 +16,23 @@ module ContextDev sig { returns(String) } attr_accessor :url + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + sig do + returns( + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeMdParams::Action::Wait, + ContextDev::WebWebScrapeMdParams::Action::Perform + ) + ] + ) + ) + end + attr_accessor :actions + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. @@ -251,6 +268,15 @@ module ContextDev sig do params( url: String, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeMdParams::Action::Wait::OrHash, + ContextDev::WebWebScrapeMdParams::Action::Perform::OrHash + ) + ] + ), country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol, exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], @@ -298,6 +324,10 @@ module ContextDev # Full URL to scrape into LLM usable Markdown (must include http:// or https:// # protocol) url:, + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + actions: nil, # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. @@ -360,6 +390,15 @@ module ContextDev override.returns( { url: String, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeMdParams::Action::Wait, + ContextDev::WebWebScrapeMdParams::Action::Perform + ) + ] + ), country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol, exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], @@ -407,6 +446,80 @@ module ContextDev def to_hash end + # Browser action discriminated by `do`. Each variant exposes only its applicable + # fields. + module Action + extend ContextDev::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + ContextDev::WebWebScrapeMdParams::Action::Wait, + ContextDev::WebWebScrapeMdParams::Action::Perform + ) + end + + class Wait < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::WebWebScrapeMdParams::Action::Wait, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :do_ + + sig { returns(Integer) } + attr_accessor :time_ms + + # Pause for a fixed number of milliseconds before continuing to the next action. + sig do + params(time_ms: Integer, do_: Symbol).returns(T.attached_class) + end + def self.new(time_ms:, do_: :wait) + end + + sig { override.returns({ do_: Symbol, time_ms: Integer }) } + def to_hash + end + end + + class Perform < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::WebWebScrapeMdParams::Action::Perform, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :action + + sig { returns(Symbol) } + attr_accessor :do_ + + # Resolve and perform one natural-language browser action. + sig { params(action: String, do_: Symbol).returns(T.attached_class) } + def self.new(action:, do_: :perform) + end + + sig { override.returns({ action: String, do_: Symbol }) } + def to_hash + end + end + + sig do + override.returns( + T::Array[ContextDev::WebWebScrapeMdParams::Action::Variants] + ) + end + def self.variants + end + end + # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index c398fcb1..9c1a6cb1 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -424,10 +424,20 @@ module ContextDev ) end - # Scrapes the given URL and returns the raw HTML content of the page. + # Scrapes the given URL and returns the raw HTML content of the page. The base + # request costs 1 credit; requests with browser actions cost 2 credits. sig do params( url: String, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeHTMLParams::Action::Wait::OrHash, + ContextDev::WebWebScrapeHTMLParams::Action::Perform::OrHash + ) + ] + ), country: ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol, exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], @@ -459,6 +469,10 @@ module ContextDev def web_scrape_html( # Full URL to scrape (must include http:// or https:// protocol) url:, + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + actions: nil, # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. @@ -513,11 +527,21 @@ module ContextDev # Extract image assets from a web page, including standard URLs, inline SVGs, data # URIs, responsive image sources, metadata, CSS backgrounds, video posters, and - # embeds. The base request costs 1 credit. When enrichment is enabled, the entire - # call costs 5 credits. + # embeds. The base request costs 1 credit, or 2 credits with browser actions. When + # enrichment is enabled, the entire call costs 5 credits, including requests that + # also use actions. sig do params( url: String, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Wait::OrHash, + ContextDev::WebWebScrapeImagesParams::Action::Perform::OrHash + ) + ] + ), dedupe: T.any( T::Boolean, @@ -536,6 +560,10 @@ module ContextDev def web_scrape_images( # Page URL to inspect. Must include http:// or https://. url:, + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + actions: nil, # When true, visually duplicate images are removed: every image is loaded and # perceptually hashed, and only the highest-resolution copy of each duplicate # group is kept. Images that cannot be downloaded or hashed are kept. Default: @@ -572,19 +600,28 @@ module ContextDev # # ### Billing & errors # - # | HTTP status | Billed? | Meaning | - # | ----------- | -------------- | ---------------------------------------------------------------------------------------- | - # | 200 | Yes — 1 credit | Successful scrape, including a zero-length result when includeSelectors matched nothing | - # | 400 | No | Invalid input, skipped PDF, or the page could not be scraped | - # | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code | - # | 404 | No | Target page returned or fingerprinted as not found | - # | 408 | No | Request timed out | - # | 415 | No | Unsupported content type | - # | 429 | No | Per-minute rate limit exceeded; honor Retry-After | - # | 500 | No | Internal error | + # | HTTP status | Billed? | Meaning | + # | ----------- | ----------------------------------------- | ---------------------------------------------------------------------------------------- | + # | 200 | Yes — 1 credit, or 2 credits with actions | Successful scrape, including a zero-length result when includeSelectors matched nothing | + # | 400 | No | Invalid input, skipped PDF, or the page could not be scraped | + # | 401 / 403 | No | Invalid/disabled key, insufficient permissions, or credits exhausted; inspect error_code | + # | 404 | No | Target page returned or fingerprinted as not found | + # | 408 | No | Request timed out | + # | 415 | No | Unsupported content type | + # | 429 | No | Per-minute rate limit exceeded; honor Retry-After | + # | 500 | No | Internal error | sig do params( url: String, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeMdParams::Action::Wait::OrHash, + ContextDev::WebWebScrapeMdParams::Action::Perform::OrHash + ) + ] + ), country: ContextDev::WebWebScrapeMdParams::Country::OrSymbol, exclude_selectors: T.nilable(T::Array[String]), headers: T::Hash[Symbol, String], @@ -632,6 +669,10 @@ module ContextDev # Full URL to scrape into LLM usable Markdown (must include http:// or https:// # protocol) url:, + # Optional browser actions executed in array order after the page loads and before + # content is captured. Requires a paid plan. Send a JSON array in the query + # parameter. Maximum: 5 actions. + actions: nil, # Two-letter ISO 3166-1 alpha-2 country code identifying a supported Context.dev # residential proxy exit location. Must be one of Context.dev's supported # countries. When provided, Context.dev fetches the target page from that country. diff --git a/sig/context_dev/models/web_web_scrape_html_params.rbs b/sig/context_dev/models/web_web_scrape_html_params.rbs index 9ecbe770..0eec60ff 100644 --- a/sig/context_dev/models/web_web_scrape_html_params.rbs +++ b/sig/context_dev/models/web_web_scrape_html_params.rbs @@ -3,6 +3,7 @@ module ContextDev type web_web_scrape_html_params = { url: String, + actions: ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action]?, country: ContextDev::Models::WebWebScrapeHTMLParams::country, exclude_selectors: ::Array[String]?, headers: ::Hash[Symbol, String], @@ -25,6 +26,8 @@ module ContextDev attr_accessor url: String + attr_accessor actions: ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action]? + attr_reader country: ContextDev::Models::WebWebScrapeHTMLParams::country? def country=: ( @@ -83,6 +86,7 @@ module ContextDev def initialize: ( url: String, + ?actions: ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action]?, ?country: ContextDev::Models::WebWebScrapeHTMLParams::country, ?exclude_selectors: ::Array[String]?, ?headers: ::Hash[Symbol, String], @@ -101,6 +105,7 @@ module ContextDev def to_hash: -> { url: String, + actions: ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action]?, country: ContextDev::Models::WebWebScrapeHTMLParams::country, exclude_selectors: ::Array[String]?, headers: ::Hash[Symbol, String], @@ -117,6 +122,40 @@ module ContextDev request_options: ContextDev::RequestOptions } + type action = + ContextDev::WebWebScrapeHTMLParams::Action::Wait + | ContextDev::WebWebScrapeHTMLParams::Action::Perform + + module Action + extend ContextDev::Internal::Type::Union + + type wait = { do_: :wait, time_ms: Integer } + + class Wait < ContextDev::Internal::Type::BaseModel + attr_accessor do_: :wait + + attr_accessor time_ms: Integer + + def initialize: (time_ms: Integer, ?do_: :wait) -> void + + def to_hash: -> { do_: :wait, time_ms: Integer } + end + + type perform = { action: String, do_: :perform } + + class Perform < ContextDev::Internal::Type::BaseModel + attr_accessor action: String + + attr_accessor do_: :perform + + def initialize: (action: String, ?do_: :perform) -> void + + def to_hash: -> { action: String, do_: :perform } + end + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action] + end + type country = :ad | :ae diff --git a/sig/context_dev/models/web_web_scrape_images_params.rbs b/sig/context_dev/models/web_web_scrape_images_params.rbs index 7648fb36..4995f382 100644 --- a/sig/context_dev/models/web_web_scrape_images_params.rbs +++ b/sig/context_dev/models/web_web_scrape_images_params.rbs @@ -3,6 +3,7 @@ module ContextDev type web_web_scrape_images_params = { url: String, + actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]?, dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe, enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment?, headers: ::Hash[Symbol, String], @@ -19,6 +20,8 @@ module ContextDev attr_accessor url: String + attr_accessor actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]? + attr_reader dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe? def dedupe=: ( @@ -45,6 +48,7 @@ module ContextDev def initialize: ( url: String, + ?actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]?, ?dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe, ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment?, ?headers: ::Hash[Symbol, String], @@ -57,6 +61,7 @@ module ContextDev def to_hash: -> { url: String, + actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]?, dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe, enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment?, headers: ::Hash[Symbol, String], @@ -67,6 +72,40 @@ module ContextDev request_options: ContextDev::RequestOptions } + type action = + ContextDev::WebWebScrapeImagesParams::Action::Wait + | ContextDev::WebWebScrapeImagesParams::Action::Perform + + module Action + extend ContextDev::Internal::Type::Union + + type wait = { do_: :wait, time_ms: Integer } + + class Wait < ContextDev::Internal::Type::BaseModel + attr_accessor do_: :wait + + attr_accessor time_ms: Integer + + def initialize: (time_ms: Integer, ?do_: :wait) -> void + + def to_hash: -> { do_: :wait, time_ms: Integer } + end + + type perform = { action: String, do_: :perform } + + class Perform < ContextDev::Internal::Type::BaseModel + attr_accessor action: String + + attr_accessor do_: :perform + + def initialize: (action: String, ?do_: :perform) -> void + + def to_hash: -> { action: String, do_: :perform } + end + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeImagesParams::action] + end + type dedupe = bool | :true | :false module Dedupe diff --git a/sig/context_dev/models/web_web_scrape_md_params.rbs b/sig/context_dev/models/web_web_scrape_md_params.rbs index 579453c7..ba54f9af 100644 --- a/sig/context_dev/models/web_web_scrape_md_params.rbs +++ b/sig/context_dev/models/web_web_scrape_md_params.rbs @@ -3,6 +3,7 @@ module ContextDev type web_web_scrape_md_params = { url: String, + actions: ::Array[ContextDev::Models::WebWebScrapeMdParams::action]?, country: ContextDev::Models::WebWebScrapeMdParams::country, exclude_selectors: ::Array[String]?, headers: ::Hash[Symbol, String], @@ -28,6 +29,8 @@ module ContextDev attr_accessor url: String + attr_accessor actions: ::Array[ContextDev::Models::WebWebScrapeMdParams::action]? + attr_reader country: ContextDev::Models::WebWebScrapeMdParams::country? def country=: ( @@ -104,6 +107,7 @@ module ContextDev def initialize: ( url: String, + ?actions: ::Array[ContextDev::Models::WebWebScrapeMdParams::action]?, ?country: ContextDev::Models::WebWebScrapeMdParams::country, ?exclude_selectors: ::Array[String]?, ?headers: ::Hash[Symbol, String], @@ -125,6 +129,7 @@ module ContextDev def to_hash: -> { url: String, + actions: ::Array[ContextDev::Models::WebWebScrapeMdParams::action]?, country: ContextDev::Models::WebWebScrapeMdParams::country, exclude_selectors: ::Array[String]?, headers: ::Hash[Symbol, String], @@ -144,6 +149,40 @@ module ContextDev request_options: ContextDev::RequestOptions } + type action = + ContextDev::WebWebScrapeMdParams::Action::Wait + | ContextDev::WebWebScrapeMdParams::Action::Perform + + module Action + extend ContextDev::Internal::Type::Union + + type wait = { do_: :wait, time_ms: Integer } + + class Wait < ContextDev::Internal::Type::BaseModel + attr_accessor do_: :wait + + attr_accessor time_ms: Integer + + def initialize: (time_ms: Integer, ?do_: :wait) -> void + + def to_hash: -> { do_: :wait, time_ms: Integer } + end + + type perform = { action: String, do_: :perform } + + class Perform < ContextDev::Internal::Type::BaseModel + attr_accessor action: String + + attr_accessor do_: :perform + + def initialize: (action: String, ?do_: :perform) -> void + + def to_hash: -> { action: String, do_: :perform } + end + + def self?.variants: -> ::Array[ContextDev::Models::WebWebScrapeMdParams::action] + end + type country = :ad | :ae diff --git a/sig/context_dev/resources/web.rbs b/sig/context_dev/resources/web.rbs index 47499323..1b16a230 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -106,6 +106,7 @@ module ContextDev def web_scrape_html: ( url: String, + ?actions: ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action]?, ?country: ContextDev::Models::WebWebScrapeHTMLParams::country, ?exclude_selectors: ::Array[String]?, ?headers: ::Hash[Symbol, String], @@ -124,6 +125,7 @@ module ContextDev def web_scrape_images: ( url: String, + ?actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]?, ?dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe, ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment?, ?headers: ::Hash[Symbol, String], @@ -136,6 +138,7 @@ module ContextDev def web_scrape_md: ( url: String, + ?actions: ::Array[ContextDev::Models::WebWebScrapeMdParams::action]?, ?country: ContextDev::Models::WebWebScrapeMdParams::country, ?exclude_selectors: ::Array[String]?, ?headers: ::Hash[Symbol, String], From dc69d9ba100180647171b7b2c1a17e05d73331e9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 09:18:25 +0000 Subject: [PATCH 10/13] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f41ab2ed..dd88a667 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-1ad134d4ef2ddefee790dc464dd2da3e4c0614652620b25fbb1379d8f5676526.yml -openapi_spec_hash: 24809b018c6869838112f064e5558509 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-4dea765de04ef16556290055d83312b58e0dc16586e9a717d378dc451f068113.yml +openapi_spec_hash: e4c702985962f8e35fffffcc821700b6 config_hash: 70e7e80b5e87f94981bee396c6cd41e8 From 65c55c5a2e3bdca1bf6bd07722550ed6278c4dfe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 18:06:34 +0000 Subject: [PATCH 11/13] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index dd88a667..53999f48 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-4dea765de04ef16556290055d83312b58e0dc16586e9a717d378dc451f068113.yml -openapi_spec_hash: e4c702985962f8e35fffffcc821700b6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-ce19e3abfe1f07d4a615d2fb35666e99f7918b821dfc270b38bfd9c0de39fc4e.yml +openapi_spec_hash: 71623548f792037a7f13fb693b41e217 config_hash: 70e7e80b5e87f94981bee396c6cd41e8 From 5af0d4b1954673356f6200967dbea5ea61685025 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 18:45:57 +0000 Subject: [PATCH 12/13] feat(api): api update --- .stats.yml | 4 +- lib/context_dev.rb | 1 + lib/context_dev/models.rb | 2 + .../monitor_list_account_runs_response.rb | 123 +------- .../models/monitor_list_runs_response.rb | 120 +------- lib/context_dev/models/webhook_delivery.rb | 109 +++++++ rbi/context_dev/models.rbi | 2 + .../monitor_list_account_runs_response.rbi | 266 +----------------- .../models/monitor_list_runs_response.rbi | 266 +----------------- rbi/context_dev/models/webhook_delivery.rbi | 172 +++++++++++ sig/context_dev/models.rbs | 2 + .../monitor_list_account_runs_response.rbs | 102 +------ .../models/monitor_list_runs_response.rbs | 102 +------ sig/context_dev/models/webhook_delivery.rbs | 81 ++++++ 14 files changed, 423 insertions(+), 929 deletions(-) create mode 100644 lib/context_dev/models/webhook_delivery.rb create mode 100644 rbi/context_dev/models/webhook_delivery.rbi create mode 100644 sig/context_dev/models/webhook_delivery.rbs diff --git a/.stats.yml b/.stats.yml index 53999f48..0ac1eb3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-ce19e3abfe1f07d4a615d2fb35666e99f7918b821dfc270b38bfd9c0de39fc4e.yml -openapi_spec_hash: 71623548f792037a7f13fb693b41e217 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-242450ea46eb8c3e843fd6c4bf87e73192b5f62f6da697cd091d13c6aa7a991b.yml +openapi_spec_hash: c1c561976de1abcacede71fd5ab9b3d9 config_hash: 70e7e80b5e87f94981bee396c6cd41e8 diff --git a/lib/context_dev.rb b/lib/context_dev.rb index fa7703cb..db04657e 100644 --- a/lib/context_dev.rb +++ b/lib/context_dev.rb @@ -102,6 +102,7 @@ require_relative "context_dev/models/web_extract_response" require_relative "context_dev/models/web_extract_styleguide_params" require_relative "context_dev/models/web_extract_styleguide_response" +require_relative "context_dev/models/webhook_delivery" require_relative "context_dev/models/web_screenshot_params" require_relative "context_dev/models/web_screenshot_response" require_relative "context_dev/models/web_search_params" diff --git a/lib/context_dev/models.rb b/lib/context_dev/models.rb index 99d2b1aa..1fba5578 100644 --- a/lib/context_dev/models.rb +++ b/lib/context_dev/models.rb @@ -89,6 +89,8 @@ module ContextDev WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams + WebhookDelivery = ContextDev::Models::WebhookDelivery + WebScreenshotParams = ContextDev::Models::WebScreenshotParams WebSearchParams = ContextDev::Models::WebSearchParams diff --git a/lib/context_dev/models/monitor_list_account_runs_response.rb b/lib/context_dev/models/monitor_list_account_runs_response.rb index 455cfdc1..802167dc 100644 --- a/lib/context_dev/models/monitor_list_account_runs_response.rb +++ b/lib/context_dev/models/monitor_list_account_runs_response.rb @@ -111,9 +111,8 @@ class Data < ContextDev::Internal::Type::BaseModel # fired. Omitted when no webhook was attempted, including runs created before # event selection was added. # - # @return [Array, nil] - optional :webhook_deliveries, - -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery] } + # @return [Array, nil] + optional :webhook_deliveries, -> { ContextDev::Internal::Type::ArrayOf[ContextDev::WebhookDelivery] } # @!attribute webhook_delivery # @deprecated @@ -122,9 +121,8 @@ class Data < ContextDev::Internal::Type::BaseModel # can deliver multiple events. Omitted when no webhook was attempted, including # historical runs created before delivery tracking was added. # - # @return [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery, nil] - optional :webhook_delivery, - -> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery } + # @return [ContextDev::Models::WebhookDelivery, nil] + optional :webhook_delivery, -> { ContextDev::WebhookDelivery } # @!method initialize(id:, baseline_created:, change_detected:, change_detection_type:, credits_charged:, monitor_id:, run_type:, status:, target_type:, change_id: nil, completed_at: nil, error: nil, skip_reason: nil, started_at: nil, webhook_deliveries: nil, webhook_delivery: nil) # Some parameter documentations has been truncated, see @@ -158,9 +156,9 @@ class Data < ContextDev::Internal::Type::BaseModel # # @param started_at [Time, nil] # - # @param webhook_deliveries [Array] All webhook deliveries attempted by this run — one per subscribed event that fir + # @param webhook_deliveries [Array] All webhook deliveries attempted by this run — one per subscribed event that fir # - # @param webhook_delivery [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery] Deprecated: use `webhook_deliveries`, which records every attempt now that a run + # @param webhook_delivery [ContextDev::Models::WebhookDelivery] Deprecated: use `webhook_deliveries`, which records every attempt now that a run # @see ContextDev::Models::MonitorListAccountRunsResponse::Data#change_detection_type module ChangeDetectionType @@ -245,115 +243,6 @@ module SkipReason # @!method self.values # @return [Array] end - - class WebhookDelivery < ContextDev::Internal::Type::BaseModel - # @!attribute attempted_at - # - # @return [Time] - required :attempted_at, Time - - # @!attribute error - # - # @return [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error, nil] - required :error, - -> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error }, - nil?: true - - # @!attribute event - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - # - # @return [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event] - required :event, - enum: -> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event } - - # @!attribute event_id - # Identifier sent in the X-Context-Id header. - # - # @return [String] - required :event_id, String - - # @!attribute http_status - # The endpoint's final HTTP response status, or null when no response was - # received. - # - # @return [Integer, nil] - required :http_status, Integer, nil?: true - - # @!attribute status - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - # - # @return [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status] - required :status, - enum: -> { ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status } - - # @!method initialize(attempted_at:, error:, event:, event_id:, http_status:, status:) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery} for - # more details. - # - # @param attempted_at [Time] - # - # @param error [ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error, nil] - # - # @param event [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event] The event this delivery carried. Deliveries recorded before event selection exis - # - # @param event_id [String] Identifier sent in the X-Context-Id header. - # - # @param http_status [Integer, nil] The endpoint's final HTTP response status, or null when no response was received - # - # @param status [Symbol, ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status] Delivery outcome. delivered means any 2xx response; rejected means a non-2xx res - - # @see ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery#error - class Error < ContextDev::Internal::Type::BaseModel - # @!attribute code - # - # @return [String] - required :code, String - - # @!attribute message - # - # @return [String] - required :message, String - - # @!method initialize(code:, message:) - # @param code [String] - # @param message [String] - end - - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - # - # @see ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery#event - module Event - extend ContextDev::Internal::Type::Enum - - CHANGE_DETECTED = :"change.detected" - RUN_COMPLETED = :"run.completed" - - # @!method self.values - # @return [Array] - end - - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - # - # @see ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery#status - module Status - extend ContextDev::Internal::Type::Enum - - DELIVERED = :delivered - REJECTED = :rejected - FAILED = :failed - SKIPPED_UNSAFE_URL = :skipped_unsafe_url - - # @!method self.values - # @return [Array] - end - end end end end diff --git a/lib/context_dev/models/monitor_list_runs_response.rb b/lib/context_dev/models/monitor_list_runs_response.rb index 9a86e14a..a4ce61d4 100644 --- a/lib/context_dev/models/monitor_list_runs_response.rb +++ b/lib/context_dev/models/monitor_list_runs_response.rb @@ -111,9 +111,8 @@ class Data < ContextDev::Internal::Type::BaseModel # fired. Omitted when no webhook was attempted, including runs created before # event selection was added. # - # @return [Array, nil] - optional :webhook_deliveries, - -> { ContextDev::Internal::Type::ArrayOf[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery] } + # @return [Array, nil] + optional :webhook_deliveries, -> { ContextDev::Internal::Type::ArrayOf[ContextDev::WebhookDelivery] } # @!attribute webhook_delivery # @deprecated @@ -122,8 +121,8 @@ class Data < ContextDev::Internal::Type::BaseModel # can deliver multiple events. Omitted when no webhook was attempted, including # historical runs created before delivery tracking was added. # - # @return [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery, nil] - optional :webhook_delivery, -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery } + # @return [ContextDev::Models::WebhookDelivery, nil] + optional :webhook_delivery, -> { ContextDev::WebhookDelivery } # @!method initialize(id:, baseline_created:, change_detected:, change_detection_type:, credits_charged:, monitor_id:, run_type:, status:, target_type:, change_id: nil, completed_at: nil, error: nil, skip_reason: nil, started_at: nil, webhook_deliveries: nil, webhook_delivery: nil) # Some parameter documentations has been truncated, see @@ -157,9 +156,9 @@ class Data < ContextDev::Internal::Type::BaseModel # # @param started_at [Time, nil] # - # @param webhook_deliveries [Array] All webhook deliveries attempted by this run — one per subscribed event that fir + # @param webhook_deliveries [Array] All webhook deliveries attempted by this run — one per subscribed event that fir # - # @param webhook_delivery [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery] Deprecated: use `webhook_deliveries`, which records every attempt now that a run + # @param webhook_delivery [ContextDev::Models::WebhookDelivery] Deprecated: use `webhook_deliveries`, which records every attempt now that a run # @see ContextDev::Models::MonitorListRunsResponse::Data#change_detection_type module ChangeDetectionType @@ -244,113 +243,6 @@ module SkipReason # @!method self.values # @return [Array] end - - class WebhookDelivery < ContextDev::Internal::Type::BaseModel - # @!attribute attempted_at - # - # @return [Time] - required :attempted_at, Time - - # @!attribute error - # - # @return [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error, nil] - required :error, - -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error }, - nil?: true - - # @!attribute event - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - # - # @return [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event] - required :event, enum: -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event } - - # @!attribute event_id - # Identifier sent in the X-Context-Id header. - # - # @return [String] - required :event_id, String - - # @!attribute http_status - # The endpoint's final HTTP response status, or null when no response was - # received. - # - # @return [Integer, nil] - required :http_status, Integer, nil?: true - - # @!attribute status - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - # - # @return [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status] - required :status, enum: -> { ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status } - - # @!method initialize(attempted_at:, error:, event:, event_id:, http_status:, status:) - # Some parameter documentations has been truncated, see - # {ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery} for more - # details. - # - # @param attempted_at [Time] - # - # @param error [ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error, nil] - # - # @param event [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event] The event this delivery carried. Deliveries recorded before event selection exis - # - # @param event_id [String] Identifier sent in the X-Context-Id header. - # - # @param http_status [Integer, nil] The endpoint's final HTTP response status, or null when no response was received - # - # @param status [Symbol, ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status] Delivery outcome. delivered means any 2xx response; rejected means a non-2xx res - - # @see ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery#error - class Error < ContextDev::Internal::Type::BaseModel - # @!attribute code - # - # @return [String] - required :code, String - - # @!attribute message - # - # @return [String] - required :message, String - - # @!method initialize(code:, message:) - # @param code [String] - # @param message [String] - end - - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - # - # @see ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery#event - module Event - extend ContextDev::Internal::Type::Enum - - CHANGE_DETECTED = :"change.detected" - RUN_COMPLETED = :"run.completed" - - # @!method self.values - # @return [Array] - end - - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - # - # @see ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery#status - module Status - extend ContextDev::Internal::Type::Enum - - DELIVERED = :delivered - REJECTED = :rejected - FAILED = :failed - SKIPPED_UNSAFE_URL = :skipped_unsafe_url - - # @!method self.values - # @return [Array] - end - end end end end diff --git a/lib/context_dev/models/webhook_delivery.rb b/lib/context_dev/models/webhook_delivery.rb new file mode 100644 index 00000000..b52e80b6 --- /dev/null +++ b/lib/context_dev/models/webhook_delivery.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +module ContextDev + module Models + class WebhookDelivery < ContextDev::Internal::Type::BaseModel + # @!attribute attempted_at + # + # @return [Time] + required :attempted_at, Time + + # @!attribute error + # + # @return [ContextDev::Models::WebhookDelivery::Error, nil] + required :error, -> { ContextDev::WebhookDelivery::Error }, nil?: true + + # @!attribute event + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + # + # @return [Symbol, ContextDev::Models::WebhookDelivery::Event] + required :event, enum: -> { ContextDev::WebhookDelivery::Event } + + # @!attribute event_id + # Identifier sent in the X-Context-Id header. + # + # @return [String] + required :event_id, String + + # @!attribute http_status + # The endpoint's final HTTP response status, or null when no response was + # received. + # + # @return [Integer, nil] + required :http_status, Integer, nil?: true + + # @!attribute status + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + # + # @return [Symbol, ContextDev::Models::WebhookDelivery::Status] + required :status, enum: -> { ContextDev::WebhookDelivery::Status } + + # @!method initialize(attempted_at:, error:, event:, event_id:, http_status:, status:) + # Some parameter documentations has been truncated, see + # {ContextDev::Models::WebhookDelivery} for more details. + # + # @param attempted_at [Time] + # + # @param error [ContextDev::Models::WebhookDelivery::Error, nil] + # + # @param event [Symbol, ContextDev::Models::WebhookDelivery::Event] The event this delivery carried. Deliveries recorded before event selection exis + # + # @param event_id [String] Identifier sent in the X-Context-Id header. + # + # @param http_status [Integer, nil] The endpoint's final HTTP response status, or null when no response was received + # + # @param status [Symbol, ContextDev::Models::WebhookDelivery::Status] Delivery outcome. delivered means any 2xx response; rejected means a non-2xx res + + # @see ContextDev::Models::WebhookDelivery#error + class Error < ContextDev::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute message + # + # @return [String] + required :message, String + + # @!method initialize(code:, message:) + # @param code [String] + # @param message [String] + end + + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + # + # @see ContextDev::Models::WebhookDelivery#event + module Event + extend ContextDev::Internal::Type::Enum + + CHANGE_DETECTED = :"change.detected" + RUN_COMPLETED = :"run.completed" + + # @!method self.values + # @return [Array] + end + + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + # + # @see ContextDev::Models::WebhookDelivery#status + module Status + extend ContextDev::Internal::Type::Enum + + DELIVERED = :delivered + REJECTED = :rejected + FAILED = :failed + SKIPPED_UNSAFE_URL = :skipped_unsafe_url + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index 26347f11..fe3d2d12 100644 --- a/rbi/context_dev/models.rbi +++ b/rbi/context_dev/models.rbi @@ -54,6 +54,8 @@ module ContextDev WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams + WebhookDelivery = ContextDev::Models::WebhookDelivery + WebScreenshotParams = ContextDev::Models::WebScreenshotParams WebSearchParams = ContextDev::Models::WebSearchParams diff --git a/rbi/context_dev/models/monitor_list_account_runs_response.rbi b/rbi/context_dev/models/monitor_list_account_runs_response.rbi index 3ce6f16d..51275f7b 100644 --- a/rbi/context_dev/models/monitor_list_account_runs_response.rbi +++ b/rbi/context_dev/models/monitor_list_account_runs_response.rbi @@ -151,23 +151,12 @@ module ContextDev # All webhook deliveries attempted by this run — one per subscribed event that # fired. Omitted when no webhook was attempted, including runs created before # event selection was added. - sig do - returns( - T.nilable( - T::Array[ - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery - ] - ) - ) - end + sig { returns(T.nilable(T::Array[ContextDev::WebhookDelivery])) } attr_reader :webhook_deliveries sig do params( - webhook_deliveries: - T::Array[ - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::OrHash - ] + webhook_deliveries: T::Array[ContextDev::WebhookDelivery::OrHash] ).void end attr_writer :webhook_deliveries @@ -175,20 +164,11 @@ module ContextDev # Deprecated: use `webhook_deliveries`, which records every attempt now that a run # can deliver multiple events. Omitted when no webhook was attempted, including # historical runs created before delivery tracking was added. - sig do - returns( - T.nilable( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery - ) - ) - end + sig { returns(T.nilable(ContextDev::WebhookDelivery)) } attr_reader :webhook_delivery sig do - params( - webhook_delivery: - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::OrHash - ).void + params(webhook_delivery: ContextDev::WebhookDelivery::OrHash).void end attr_writer :webhook_delivery @@ -218,12 +198,8 @@ module ContextDev ContextDev::Models::MonitorListAccountRunsResponse::Data::SkipReason::OrSymbol ), started_at: T.nilable(Time), - webhook_deliveries: - T::Array[ - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::OrHash - ], - webhook_delivery: - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::OrHash + webhook_deliveries: T::Array[ContextDev::WebhookDelivery::OrHash], + webhook_delivery: ContextDev::WebhookDelivery::OrHash ).returns(T.attached_class) end def self.new( @@ -286,12 +262,8 @@ module ContextDev ContextDev::Models::MonitorListAccountRunsResponse::Data::SkipReason::TaggedSymbol ), started_at: T.nilable(Time), - webhook_deliveries: - T::Array[ - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery - ], - webhook_delivery: - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery + webhook_deliveries: T::Array[ContextDev::WebhookDelivery], + webhook_delivery: ContextDev::WebhookDelivery } ) end @@ -522,228 +494,6 @@ module ContextDev def self.values end end - - class WebhookDelivery < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(Time) } - attr_accessor :attempted_at - - sig do - returns( - T.nilable( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error - ) - ) - end - attr_reader :error - - sig do - params( - error: - T.nilable( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error::OrHash - ) - ).void - end - attr_writer :error - - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - sig do - returns( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol - ) - end - attr_accessor :event - - # Identifier sent in the X-Context-Id header. - sig { returns(String) } - attr_accessor :event_id - - # The endpoint's final HTTP response status, or null when no response was - # received. - sig { returns(T.nilable(Integer)) } - attr_accessor :http_status - - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - sig do - returns( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - end - attr_accessor :status - - sig do - params( - attempted_at: Time, - error: - T.nilable( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error::OrHash - ), - event: - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::OrSymbol, - event_id: String, - http_status: T.nilable(Integer), - status: - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::OrSymbol - ).returns(T.attached_class) - end - def self.new( - attempted_at:, - error:, - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - event:, - # Identifier sent in the X-Context-Id header. - event_id:, - # The endpoint's final HTTP response status, or null when no response was - # received. - http_status:, - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - status: - ) - end - - sig do - override.returns( - { - attempted_at: Time, - error: - T.nilable( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error - ), - event: - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol, - event_id: String, - http_status: T.nilable(Integer), - status: - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - } - ) - end - def to_hash - end - - class Error < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :code - - sig { returns(String) } - attr_accessor :message - - sig do - params(code: String, message: String).returns(T.attached_class) - end - def self.new(code:, message:) - end - - sig { override.returns({ code: String, message: String }) } - def to_hash - end - end - - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - module Event - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CHANGE_DETECTED = - T.let( - :"change.detected", - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol - ) - RUN_COMPLETED = - T.let( - :"run.completed", - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - module Status - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - DELIVERED = - T.let( - :delivered, - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - REJECTED = - T.let( - :rejected, - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - FAILED = - T.let( - :failed, - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - SKIPPED_UNSAFE_URL = - T.let( - :skipped_unsafe_url, - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - end end end end diff --git a/rbi/context_dev/models/monitor_list_runs_response.rbi b/rbi/context_dev/models/monitor_list_runs_response.rbi index 0c43c1a6..7d2def95 100644 --- a/rbi/context_dev/models/monitor_list_runs_response.rbi +++ b/rbi/context_dev/models/monitor_list_runs_response.rbi @@ -142,23 +142,12 @@ module ContextDev # All webhook deliveries attempted by this run — one per subscribed event that # fired. Omitted when no webhook was attempted, including runs created before # event selection was added. - sig do - returns( - T.nilable( - T::Array[ - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery - ] - ) - ) - end + sig { returns(T.nilable(T::Array[ContextDev::WebhookDelivery])) } attr_reader :webhook_deliveries sig do params( - webhook_deliveries: - T::Array[ - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::OrHash - ] + webhook_deliveries: T::Array[ContextDev::WebhookDelivery::OrHash] ).void end attr_writer :webhook_deliveries @@ -166,20 +155,11 @@ module ContextDev # Deprecated: use `webhook_deliveries`, which records every attempt now that a run # can deliver multiple events. Omitted when no webhook was attempted, including # historical runs created before delivery tracking was added. - sig do - returns( - T.nilable( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery - ) - ) - end + sig { returns(T.nilable(ContextDev::WebhookDelivery)) } attr_reader :webhook_delivery sig do - params( - webhook_delivery: - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::OrHash - ).void + params(webhook_delivery: ContextDev::WebhookDelivery::OrHash).void end attr_writer :webhook_delivery @@ -209,12 +189,8 @@ module ContextDev ContextDev::Models::MonitorListRunsResponse::Data::SkipReason::OrSymbol ), started_at: T.nilable(Time), - webhook_deliveries: - T::Array[ - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::OrHash - ], - webhook_delivery: - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::OrHash + webhook_deliveries: T::Array[ContextDev::WebhookDelivery::OrHash], + webhook_delivery: ContextDev::WebhookDelivery::OrHash ).returns(T.attached_class) end def self.new( @@ -277,12 +253,8 @@ module ContextDev ContextDev::Models::MonitorListRunsResponse::Data::SkipReason::TaggedSymbol ), started_at: T.nilable(Time), - webhook_deliveries: - T::Array[ - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery - ], - webhook_delivery: - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery + webhook_deliveries: T::Array[ContextDev::WebhookDelivery], + webhook_delivery: ContextDev::WebhookDelivery } ) end @@ -513,228 +485,6 @@ module ContextDev def self.values end end - - class WebhookDelivery < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(Time) } - attr_accessor :attempted_at - - sig do - returns( - T.nilable( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error - ) - ) - end - attr_reader :error - - sig do - params( - error: - T.nilable( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error::OrHash - ) - ).void - end - attr_writer :error - - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - sig do - returns( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol - ) - end - attr_accessor :event - - # Identifier sent in the X-Context-Id header. - sig { returns(String) } - attr_accessor :event_id - - # The endpoint's final HTTP response status, or null when no response was - # received. - sig { returns(T.nilable(Integer)) } - attr_accessor :http_status - - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - sig do - returns( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - end - attr_accessor :status - - sig do - params( - attempted_at: Time, - error: - T.nilable( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error::OrHash - ), - event: - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::OrSymbol, - event_id: String, - http_status: T.nilable(Integer), - status: - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::OrSymbol - ).returns(T.attached_class) - end - def self.new( - attempted_at:, - error:, - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - event:, - # Identifier sent in the X-Context-Id header. - event_id:, - # The endpoint's final HTTP response status, or null when no response was - # received. - http_status:, - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - status: - ) - end - - sig do - override.returns( - { - attempted_at: Time, - error: - T.nilable( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error - ), - event: - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol, - event_id: String, - http_status: T.nilable(Integer), - status: - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - } - ) - end - def to_hash - end - - class Error < ContextDev::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error, - ContextDev::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :code - - sig { returns(String) } - attr_accessor :message - - sig do - params(code: String, message: String).returns(T.attached_class) - end - def self.new(code:, message:) - end - - sig { override.returns({ code: String, message: String }) } - def to_hash - end - end - - # The event this delivery carried. Deliveries recorded before event selection - # existed report change.detected. - module Event - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CHANGE_DETECTED = - T.let( - :"change.detected", - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol - ) - RUN_COMPLETED = - T.let( - :"run.completed", - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Event::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx - # response; failed means no HTTP response was received; skipped_unsafe_url means - # the URL failed the public-endpoint safety check. - module Status - extend ContextDev::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - DELIVERED = - T.let( - :delivered, - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - REJECTED = - T.let( - :rejected, - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - FAILED = - T.let( - :failed, - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - SKIPPED_UNSAFE_URL = - T.let( - :skipped_unsafe_url, - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - end end end end diff --git a/rbi/context_dev/models/webhook_delivery.rbi b/rbi/context_dev/models/webhook_delivery.rbi new file mode 100644 index 00000000..c80e0859 --- /dev/null +++ b/rbi/context_dev/models/webhook_delivery.rbi @@ -0,0 +1,172 @@ +# typed: strong + +module ContextDev + module Models + class WebhookDelivery < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(ContextDev::WebhookDelivery, ContextDev::Internal::AnyHash) + end + + sig { returns(Time) } + attr_accessor :attempted_at + + sig { returns(T.nilable(ContextDev::WebhookDelivery::Error)) } + attr_reader :error + + sig do + params( + error: T.nilable(ContextDev::WebhookDelivery::Error::OrHash) + ).void + end + attr_writer :error + + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + sig { returns(ContextDev::WebhookDelivery::Event::TaggedSymbol) } + attr_accessor :event + + # Identifier sent in the X-Context-Id header. + sig { returns(String) } + attr_accessor :event_id + + # The endpoint's final HTTP response status, or null when no response was + # received. + sig { returns(T.nilable(Integer)) } + attr_accessor :http_status + + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + sig { returns(ContextDev::WebhookDelivery::Status::TaggedSymbol) } + attr_accessor :status + + sig do + params( + attempted_at: Time, + error: T.nilable(ContextDev::WebhookDelivery::Error::OrHash), + event: ContextDev::WebhookDelivery::Event::OrSymbol, + event_id: String, + http_status: T.nilable(Integer), + status: ContextDev::WebhookDelivery::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + attempted_at:, + error:, + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + event:, + # Identifier sent in the X-Context-Id header. + event_id:, + # The endpoint's final HTTP response status, or null when no response was + # received. + http_status:, + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + status: + ) + end + + sig do + override.returns( + { + attempted_at: Time, + error: T.nilable(ContextDev::WebhookDelivery::Error), + event: ContextDev::WebhookDelivery::Event::TaggedSymbol, + event_id: String, + http_status: T.nilable(Integer), + status: ContextDev::WebhookDelivery::Status::TaggedSymbol + } + ) + end + def to_hash + end + + class Error < ContextDev::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + ContextDev::WebhookDelivery::Error, + ContextDev::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :message + + sig { params(code: String, message: String).returns(T.attached_class) } + def self.new(code:, message:) + end + + sig { override.returns({ code: String, message: String }) } + def to_hash + end + end + + # The event this delivery carried. Deliveries recorded before event selection + # existed report change.detected. + module Event + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, ContextDev::WebhookDelivery::Event) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHANGE_DETECTED = + T.let( + :"change.detected", + ContextDev::WebhookDelivery::Event::TaggedSymbol + ) + RUN_COMPLETED = + T.let( + :"run.completed", + ContextDev::WebhookDelivery::Event::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ContextDev::WebhookDelivery::Event::TaggedSymbol] + ) + end + def self.values + end + end + + # Delivery outcome. delivered means any 2xx response; rejected means a non-2xx + # response; failed means no HTTP response was received; skipped_unsafe_url means + # the URL failed the public-endpoint safety check. + module Status + extend ContextDev::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, ContextDev::WebhookDelivery::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DELIVERED = + T.let(:delivered, ContextDev::WebhookDelivery::Status::TaggedSymbol) + REJECTED = + T.let(:rejected, ContextDev::WebhookDelivery::Status::TaggedSymbol) + FAILED = + T.let(:failed, ContextDev::WebhookDelivery::Status::TaggedSymbol) + SKIPPED_UNSAFE_URL = + T.let( + :skipped_unsafe_url, + ContextDev::WebhookDelivery::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ContextDev::WebhookDelivery::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/sig/context_dev/models.rbs b/sig/context_dev/models.rbs index fc61341d..835bb06b 100644 --- a/sig/context_dev/models.rbs +++ b/sig/context_dev/models.rbs @@ -49,6 +49,8 @@ module ContextDev class WebExtractStyleguideParams = ContextDev::Models::WebExtractStyleguideParams + class WebhookDelivery = ContextDev::Models::WebhookDelivery + class WebScreenshotParams = ContextDev::Models::WebScreenshotParams class WebSearchParams = ContextDev::Models::WebSearchParams diff --git a/sig/context_dev/models/monitor_list_account_runs_response.rbs b/sig/context_dev/models/monitor_list_account_runs_response.rbs index 8952e25b..0fa3d57a 100644 --- a/sig/context_dev/models/monitor_list_account_runs_response.rbs +++ b/sig/context_dev/models/monitor_list_account_runs_response.rbs @@ -42,8 +42,8 @@ module ContextDev error: ContextDev::Models::MonitorListAccountRunsResponse::Data::Error?, skip_reason: ContextDev::Models::MonitorListAccountRunsResponse::Data::skip_reason?, started_at: Time?, - webhook_deliveries: ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery], - webhook_delivery: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery + webhook_deliveries: ::Array[ContextDev::WebhookDelivery], + webhook_delivery: ContextDev::WebhookDelivery } class Data < ContextDev::Internal::Type::BaseModel @@ -75,17 +75,17 @@ module ContextDev attr_accessor started_at: Time? - attr_reader webhook_deliveries: ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery]? + attr_reader webhook_deliveries: ::Array[ContextDev::WebhookDelivery]? def webhook_deliveries=: ( - ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery] - ) -> ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery] + ::Array[ContextDev::WebhookDelivery] + ) -> ::Array[ContextDev::WebhookDelivery] - attr_reader webhook_delivery: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery? + attr_reader webhook_delivery: ContextDev::WebhookDelivery? def webhook_delivery=: ( - ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery - ) -> ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery + ContextDev::WebhookDelivery + ) -> ContextDev::WebhookDelivery def initialize: ( id: String, @@ -102,8 +102,8 @@ module ContextDev ?error: ContextDev::Models::MonitorListAccountRunsResponse::Data::Error?, ?skip_reason: ContextDev::Models::MonitorListAccountRunsResponse::Data::skip_reason?, ?started_at: Time?, - ?webhook_deliveries: ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery], - ?webhook_delivery: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery + ?webhook_deliveries: ::Array[ContextDev::WebhookDelivery], + ?webhook_delivery: ContextDev::WebhookDelivery ) -> void def to_hash: -> { @@ -121,8 +121,8 @@ module ContextDev error: ContextDev::Models::MonitorListAccountRunsResponse::Data::Error?, skip_reason: ContextDev::Models::MonitorListAccountRunsResponse::Data::skip_reason?, started_at: Time?, - webhook_deliveries: ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery], - webhook_delivery: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery + webhook_deliveries: ::Array[ContextDev::WebhookDelivery], + webhook_delivery: ContextDev::WebhookDelivery } type change_detection_type = :exact | :semantic @@ -196,84 +196,6 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::skip_reason] end - - type webhook_delivery = - { - attempted_at: Time, - error: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error?, - event: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event, - event_id: String, - http_status: Integer?, - status: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status - } - - class WebhookDelivery < ContextDev::Internal::Type::BaseModel - attr_accessor attempted_at: Time - - attr_accessor error: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error? - - attr_accessor event: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event - - attr_accessor event_id: String - - attr_accessor http_status: Integer? - - attr_accessor status: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status - - def initialize: ( - attempted_at: Time, - error: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error?, - event: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event, - event_id: String, - http_status: Integer?, - status: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status - ) -> void - - def to_hash: -> { - attempted_at: Time, - error: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::Error?, - event: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event, - event_id: String, - http_status: Integer?, - status: ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status - } - - type error = { code: String, message: String } - - class Error < ContextDev::Internal::Type::BaseModel - attr_accessor code: String - - attr_accessor message: String - - def initialize: (code: String, message: String) -> void - - def to_hash: -> { code: String, message: String } - end - - type event = :"change.detected" | :"run.completed" - - module Event - extend ContextDev::Internal::Type::Enum - - CHANGE_DETECTED: :"change.detected" - RUN_COMPLETED: :"run.completed" - - def self?.values: -> ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::event] - end - - type status = :delivered | :rejected | :failed | :skipped_unsafe_url - - module Status - extend ContextDev::Internal::Type::Enum - - DELIVERED: :delivered - REJECTED: :rejected - FAILED: :failed - SKIPPED_UNSAFE_URL: :skipped_unsafe_url - - def self?.values: -> ::Array[ContextDev::Models::MonitorListAccountRunsResponse::Data::WebhookDelivery::status] - end - end end end end diff --git a/sig/context_dev/models/monitor_list_runs_response.rbs b/sig/context_dev/models/monitor_list_runs_response.rbs index 6bf77e09..ee5bdcf4 100644 --- a/sig/context_dev/models/monitor_list_runs_response.rbs +++ b/sig/context_dev/models/monitor_list_runs_response.rbs @@ -42,8 +42,8 @@ module ContextDev error: ContextDev::Models::MonitorListRunsResponse::Data::Error?, skip_reason: ContextDev::Models::MonitorListRunsResponse::Data::skip_reason?, started_at: Time?, - webhook_deliveries: ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery], - webhook_delivery: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery + webhook_deliveries: ::Array[ContextDev::WebhookDelivery], + webhook_delivery: ContextDev::WebhookDelivery } class Data < ContextDev::Internal::Type::BaseModel @@ -75,17 +75,17 @@ module ContextDev attr_accessor started_at: Time? - attr_reader webhook_deliveries: ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery]? + attr_reader webhook_deliveries: ::Array[ContextDev::WebhookDelivery]? def webhook_deliveries=: ( - ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery] - ) -> ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery] + ::Array[ContextDev::WebhookDelivery] + ) -> ::Array[ContextDev::WebhookDelivery] - attr_reader webhook_delivery: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery? + attr_reader webhook_delivery: ContextDev::WebhookDelivery? def webhook_delivery=: ( - ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery - ) -> ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery + ContextDev::WebhookDelivery + ) -> ContextDev::WebhookDelivery def initialize: ( id: String, @@ -102,8 +102,8 @@ module ContextDev ?error: ContextDev::Models::MonitorListRunsResponse::Data::Error?, ?skip_reason: ContextDev::Models::MonitorListRunsResponse::Data::skip_reason?, ?started_at: Time?, - ?webhook_deliveries: ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery], - ?webhook_delivery: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery + ?webhook_deliveries: ::Array[ContextDev::WebhookDelivery], + ?webhook_delivery: ContextDev::WebhookDelivery ) -> void def to_hash: -> { @@ -121,8 +121,8 @@ module ContextDev error: ContextDev::Models::MonitorListRunsResponse::Data::Error?, skip_reason: ContextDev::Models::MonitorListRunsResponse::Data::skip_reason?, started_at: Time?, - webhook_deliveries: ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery], - webhook_delivery: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery + webhook_deliveries: ::Array[ContextDev::WebhookDelivery], + webhook_delivery: ContextDev::WebhookDelivery } type change_detection_type = :exact | :semantic @@ -196,84 +196,6 @@ module ContextDev def self?.values: -> ::Array[ContextDev::Models::MonitorListRunsResponse::Data::skip_reason] end - - type webhook_delivery = - { - attempted_at: Time, - error: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error?, - event: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event, - event_id: String, - http_status: Integer?, - status: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status - } - - class WebhookDelivery < ContextDev::Internal::Type::BaseModel - attr_accessor attempted_at: Time - - attr_accessor error: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error? - - attr_accessor event: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event - - attr_accessor event_id: String - - attr_accessor http_status: Integer? - - attr_accessor status: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status - - def initialize: ( - attempted_at: Time, - error: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error?, - event: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event, - event_id: String, - http_status: Integer?, - status: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status - ) -> void - - def to_hash: -> { - attempted_at: Time, - error: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::Error?, - event: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event, - event_id: String, - http_status: Integer?, - status: ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status - } - - type error = { code: String, message: String } - - class Error < ContextDev::Internal::Type::BaseModel - attr_accessor code: String - - attr_accessor message: String - - def initialize: (code: String, message: String) -> void - - def to_hash: -> { code: String, message: String } - end - - type event = :"change.detected" | :"run.completed" - - module Event - extend ContextDev::Internal::Type::Enum - - CHANGE_DETECTED: :"change.detected" - RUN_COMPLETED: :"run.completed" - - def self?.values: -> ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::event] - end - - type status = :delivered | :rejected | :failed | :skipped_unsafe_url - - module Status - extend ContextDev::Internal::Type::Enum - - DELIVERED: :delivered - REJECTED: :rejected - FAILED: :failed - SKIPPED_UNSAFE_URL: :skipped_unsafe_url - - def self?.values: -> ::Array[ContextDev::Models::MonitorListRunsResponse::Data::WebhookDelivery::status] - end - end end end end diff --git a/sig/context_dev/models/webhook_delivery.rbs b/sig/context_dev/models/webhook_delivery.rbs new file mode 100644 index 00000000..7120f647 --- /dev/null +++ b/sig/context_dev/models/webhook_delivery.rbs @@ -0,0 +1,81 @@ +module ContextDev + module Models + type webhook_delivery = + { + attempted_at: Time, + error: ContextDev::WebhookDelivery::Error?, + event: ContextDev::Models::WebhookDelivery::event, + event_id: String, + http_status: Integer?, + status: ContextDev::Models::WebhookDelivery::status + } + + class WebhookDelivery < ContextDev::Internal::Type::BaseModel + attr_accessor attempted_at: Time + + attr_accessor error: ContextDev::WebhookDelivery::Error? + + attr_accessor event: ContextDev::Models::WebhookDelivery::event + + attr_accessor event_id: String + + attr_accessor http_status: Integer? + + attr_accessor status: ContextDev::Models::WebhookDelivery::status + + def initialize: ( + attempted_at: Time, + error: ContextDev::WebhookDelivery::Error?, + event: ContextDev::Models::WebhookDelivery::event, + event_id: String, + http_status: Integer?, + status: ContextDev::Models::WebhookDelivery::status + ) -> void + + def to_hash: -> { + attempted_at: Time, + error: ContextDev::WebhookDelivery::Error?, + event: ContextDev::Models::WebhookDelivery::event, + event_id: String, + http_status: Integer?, + status: ContextDev::Models::WebhookDelivery::status + } + + type error = { code: String, message: String } + + class Error < ContextDev::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor message: String + + def initialize: (code: String, message: String) -> void + + def to_hash: -> { code: String, message: String } + end + + type event = :"change.detected" | :"run.completed" + + module Event + extend ContextDev::Internal::Type::Enum + + CHANGE_DETECTED: :"change.detected" + RUN_COMPLETED: :"run.completed" + + def self?.values: -> ::Array[ContextDev::Models::WebhookDelivery::event] + end + + type status = :delivered | :rejected | :failed | :skipped_unsafe_url + + module Status + extend ContextDev::Internal::Type::Enum + + DELIVERED: :delivered + REJECTED: :rejected + FAILED: :failed + SKIPPED_UNSAFE_URL: :skipped_unsafe_url + + def self?.values: -> ::Array[ContextDev::Models::WebhookDelivery::status] + end + end + end +end From 07dc0217550547521c1529fb82009f3e2060b14c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 18:46:25 +0000 Subject: [PATCH 13/13] release: 2.5.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/context_dev/version.rb | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b44b2870..4dedeaeb 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.4.0" + ".": "2.5.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index da98ff0a..1ecb46e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 2.5.0 (2026-07-22) + +Full Changelog: [v2.4.0...v2.5.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.4.0...v2.5.0) + +### Features + +* **api:** api update ([5af0d4b](https://github.com/context-dot-dev/context-ruby-sdk/commit/5af0d4b1954673356f6200967dbea5ea61685025)) +* **api:** api update ([28793d8](https://github.com/context-dot-dev/context-ruby-sdk/commit/28793d84ed93dcf457aaf3f346056f2480f37724)) +* **api:** api update ([c9c4475](https://github.com/context-dot-dev/context-ruby-sdk/commit/c9c447554772879c742d72ac88174a75fbff599a)) +* **api:** api update ([72e6d90](https://github.com/context-dot-dev/context-ruby-sdk/commit/72e6d90baaeeb9181482488e7b49e511597d2175)) +* **api:** api update ([2574f7d](https://github.com/context-dot-dev/context-ruby-sdk/commit/2574f7db809d8480db2b7ae2705fd2de6a1ce2ff)) +* **api:** api update ([8fb7d29](https://github.com/context-dot-dev/context-ruby-sdk/commit/8fb7d29835d4ffe7eb53b1619d3da20fa45df52c)) +* **api:** api update ([f5684a3](https://github.com/context-dot-dev/context-ruby-sdk/commit/f5684a355f24bf6a80aa904f09087a899f2121aa)) +* **api:** manual updates ([2a83a5f](https://github.com/context-dot-dev/context-ruby-sdk/commit/2a83a5f976bf2b75964ea56ff07f99872acd5022)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([f1c36e9](https://github.com/context-dot-dev/context-ruby-sdk/commit/f1c36e95f04eb617aa1769ba9cd21e3dad7bc5ee)) + ## 2.4.0 (2026-07-12) Full Changelog: [v2.3.0...v2.4.0](https://github.com/context-dot-dev/context-ruby-sdk/compare/v2.3.0...v2.4.0) diff --git a/Gemfile.lock b/Gemfile.lock index 3825ad29..432df4de 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - context.dev (2.4.0) + context.dev (2.5.0) cgi connection_pool diff --git a/README.md b/README.md index 97485332..9ecfef20 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "context.dev", "~> 2.4.0" +gem "context.dev", "~> 2.5.0" ``` diff --git a/lib/context_dev/version.rb b/lib/context_dev/version.rb index 56391e07..1b2239ad 100644 --- a/lib/context_dev/version.rb +++ b/lib/context_dev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ContextDev - VERSION = "2.4.0" + VERSION = "2.5.0" end