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 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/.stats.yml b/.stats.yml index 7cfdbbab..0ac1eb3a 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 -config_hash: daabb160675d86b354711da1e77e5129 +configured_endpoints: 32 +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/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.rb b/lib/context_dev.rb index fcf9547d..db04657e 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 1472ae90..1fba5578 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/ai_extract_product_params.rb b/lib/context_dev/models/ai_extract_product_params.rb index 8baeb3cb..23ebb9b3 100644 --- a/lib/context_dev/models/ai_extract_product_params.rb +++ b/lib/context_dev/models/ai_extract_product_params.rb @@ -21,6 +21,12 @@ class AIExtractProductParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_age_ms, Integer, api_name: :maxAgeMs + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +35,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 +43,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 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 # # @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..d9509ff6 100644 --- a/lib/context_dev/models/ai_extract_products_params.rb +++ b/lib/context_dev/models/ai_extract_products_params.rb @@ -44,6 +44,12 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_products, Integer, api_name: :maxProducts + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +58,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 +68,8 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # # @param max_products [Integer] Maximum number of products to extract. # + # @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 @@ -87,6 +95,12 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :max_products, Integer, api_name: :maxProducts + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +109,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 +120,8 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # # @param max_products [Integer] Maximum number of products to extract. # + # @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 fc3b3815..3e89650e 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 @@ -77,6 +79,12 @@ class ByDomain < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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. # @@ -93,12 +101,14 @@ 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 # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # + # @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 # # @param type [Symbol, :by_domain] Discriminator for domain-based brand retrieval. @@ -256,7 +266,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 @@ -275,6 +287,12 @@ class ByName < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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. # @@ -294,12 +312,14 @@ 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 # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # + # @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 # # @param type [Symbol, :by_name] Discriminator for name-based brand retrieval. @@ -450,7 +470,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 @@ -469,6 +491,12 @@ class ByEmail < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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. # @@ -487,12 +515,14 @@ 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 # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # + # @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 # # @param type [Symbol, :by_email] Discriminator for email-based brand retrieval. @@ -643,7 +673,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 @@ -662,6 +694,12 @@ class ByTicker < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :max_speed, ContextDev::Internal::Type::Boolean, api_name: :maxSpeed + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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. # @@ -685,12 +723,14 @@ 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 # # @param max_speed [Boolean] Optional parameter to optimize the API call for maximum speed. When set to true, # + # @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. # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th @@ -842,6 +882,12 @@ class ByDirectURL < ContextDev::Internal::Type::BaseModel # @return [Symbol, :by_direct_url] required :type, const: :by_direct_url + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +896,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 +908,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 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 # # @param type [Symbol, :by_direct_url] Discriminator for direct-URL-based brand retrieval. @@ -896,7 +944,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 @@ -917,14 +967,20 @@ 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 tags for tracking usage. Up to 20 tags, each 1 to 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 @@ -934,7 +990,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. # @@ -947,15 +1003,17 @@ 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 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 # @@ -1089,6 +1147,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 102903d2..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,21 @@ 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 + # 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 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 @@ -30,17 +44,32 @@ 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, 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/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/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_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/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_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_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_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_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_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_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_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_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/models/parse_handle_params.rb b/lib/context_dev/models/parse_handle_params.rb index 462218dc..1c98b649 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,39 +55,62 @@ 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 + # 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 + # @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, 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. # # @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 extension [Symbol, ContextDev::Models::ParseHandleParams::Extension] Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md + # + # @param include_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeImages] Include image references in Markdown output + # + # @param include_links [Boolean, Symbol, ContextDev::Models::ParseHandleParams::IncludeLinks] Preserve hyperlinks in Markdown output # - # @param include_images [Boolean] Include image references in Markdown output + # @param ocr [Boolean, Symbol, ContextDev::Models::ParseHandleParams::Ocr] When true for PDF inputs, detect and OCR images embedded in the selected pages, # - # @param include_links [Boolean] Preserve hyperlinks in Markdown output + # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}. # - # @param ocr [Boolean] Gates all OCR. When true, PDFs get embedded-image OCR (recognized text inserted + # @param shorten_base64_images [Boolean, Symbol, ContextDev::Models::ParseHandleParams::ShortenBase64Images] Shorten base64-encoded image data in the Markdown output # - # @param pdf [ContextDev::Models::ParseHandleParams::Pdf] PDF page-range controls. Use start/end to limit parsing (and OCR when ocr=true) + # @param tags [Array] Optional comma-separated caller-defined tags for tracking this request. Tags are # - # @param shorten_base64_images [Boolean] Shorten base64-encoded image data in the Markdown output + # @param use_main_content_only [Boolean, Symbol, ContextDev::Models::ParseHandleParams::UseMainContentOnly] Extract only the main content from HTML-like inputs # - # @param use_main_content_only [Boolean] 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. 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 @@ -164,6 +189,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. @@ -182,13 +285,76 @@ 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 + + # 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/utility_prefetch_params.rb b/lib/context_dev/models/utility_prefetch_params.rb index 86641066..e9aad7cb 100644 --- a/lib/context_dev/models/utility_prefetch_params.rb +++ b/lib/context_dev/models/utility_prefetch_params.rb @@ -19,6 +19,12 @@ class UtilityPrefetchParams < ContextDev::Internal::Type::BaseModel # @return [Symbol, ContextDev::Models::UtilityPrefetchParams::Type] required :type, enum: -> { ContextDev::UtilityPrefetchParams::Type } + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +33,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 +41,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 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 # # @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..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,21 @@ 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 + # 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 @@ -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. # @@ -48,7 +56,9 @@ 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 # # @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 02fbfa30..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). @@ -84,6 +92,12 @@ class WebExtractParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :stop_after_ms, Integer, api_name: :stopAfterMs + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +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, 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. # @@ -123,8 +137,12 @@ 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 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 # # @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..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,21 @@ 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 + # 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 @@ -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. # @@ -58,7 +66,9 @@ 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 # # @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_screenshot_params.rb b/lib/context_dev/models/web_screenshot_params.rb index f62c7569..5cc71b29 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,15 @@ 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 + # 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 @@ -102,15 +111,24 @@ class WebScreenshotParams < ContextDev::Internal::Type::BaseModel # omitted. # # @return [Integer, nil] - optional :wait_for_ms, Integer + optional :wait_for_ms, Integer, nil?: true + + # @!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, 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, zdr: nil, request_options: {}) # Some parameter documentations has been truncated, see # {ContextDev::Models::WebScreenshotParams} for more details. # # @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 # @@ -118,19 +136,23 @@ 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 # # @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. # - # @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 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}] @@ -146,8 +168,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 @@ -377,13 +400,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 @@ -427,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_search_params.rb b/lib/context_dev/models/web_search_params.rb index 32960ea1..0625a7aa 100644 --- a/lib/context_dev/models/web_search_params.rb +++ b/lib/context_dev/models/web_search_params.rb @@ -61,6 +61,12 @@ class WebSearchParams < ContextDev::Internal::Type::BaseModel # @return [Boolean, nil] optional :query_fanout, ContextDev::Internal::Type::Boolean, api_name: :queryFanout + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +75,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 +95,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 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 # # @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..90cc8b61 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,12 @@ class WebWebCrawlMdParams < ContextDev::Internal::Type::BaseModel # @return [Integer, nil] optional :stop_after_ms, Integer, api_name: :stopAfterMs + # @!attribute tags + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +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, 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. # @@ -177,6 +192,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 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 # # @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped. @@ -185,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 @@ -446,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 3266d49d..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,9 +13,20 @@ 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 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 +37,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 +50,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 +59,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 +67,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 +81,16 @@ 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 + # 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 @@ -85,48 +104,117 @@ 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, 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:, 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 country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @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] 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, nil] Optional browser wait time in milliseconds after initial page load. Min: 0. Max: # - # @param wait_for_ms [Integer] 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 for the website request location. - # When provided, Context.dev fetches the target page from that country. + # 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. module Country extend ContextDev::Internal::Type::Enum @@ -339,6 +427,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. @@ -352,15 +465,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. @@ -377,11 +492,135 @@ 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 + + # 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 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..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,21 +13,33 @@ 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 # 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 +54,15 @@ 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 + # 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 @@ -57,41 +77,128 @@ 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, 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 dedupe [Boolean] When true, visually duplicate images are removed: every image is loaded and perc + # @param actions [Array, nil] Optional browser actions executed in array order after the page loads and before # - # @param enrichment [ContextDev::Models::WebWebScrapeImagesParams::Enrichment] Optional per-image processing, sent as deep-object query params such as enrichme + # @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 # # @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}] + # 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: + # 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. @@ -102,8 +209,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 @@ -112,13 +219,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 15e70ac8..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,9 +14,20 @@ 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 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 +38,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 +51,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 +72,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 +80,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 +94,22 @@ 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 + # 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 @@ -104,54 +123,123 @@ 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 + + # @!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, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: 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 country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @param actions [Array, nil] Optional browser actions executed in array order after the page loads and before # - # @param exclude_selectors [Array] CSS selectors to remove before conversion to Markdown. Applied after includeSele + # @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 # # @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, Symbol, ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images] Shorten base64-encoded image data in the Markdown output # - # @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, + # @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 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 for the website request location. - # When provided, Context.dev fetches the target page from that country. + # 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. module Country extend ContextDev::Internal::Type::Enum @@ -364,6 +452,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. @@ -377,15 +540,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. @@ -402,11 +567,160 @@ 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 + + # 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 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..84a20a5c 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,21 @@ 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 + # 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 +58,16 @@ 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: {}) + # @!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. # @@ -53,11 +77,31 @@ 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 # # @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/ai.rb b/lib/context_dev/resources/ai.rb index 6fd8c181..85b54470 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 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 # # @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..d51da45a 100644 --- a/lib/context_dev/resources/brand.rb +++ b/lib/context_dev/resources/brand.rb @@ -36,11 +36,15 @@ 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, 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 # 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/monitors.rb b/lib/context_dev/resources/monitors.rb index f5263907..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. # @@ -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] # @@ -171,25 +171,69 @@ 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: {}) # - # @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 +252,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 +285,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 +312,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 6ffd13f7..fd80da71 100644 --- a/lib/context_dev/resources/parse.rb +++ b/lib/context_dev/resources/parse.rb @@ -7,27 +7,31 @@ 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, 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 # - # @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 use_main_content_only [Boolean] Query param: Extract only the main content from HTML-like inputs + # @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, 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] # diff --git a/lib/context_dev/resources/utility.rb b/lib/context_dev/resources/utility.rb index dc3ae68a..9e50987f 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 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 # # @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..a76d7491 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, 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,8 +31,12 @@ 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 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 # # @param wait_for_ms [Integer] Optional browser wait time in milliseconds after initial page load for each craw @@ -59,12 +63,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,13 +96,15 @@ 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., # # @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 # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # @@ -127,7 +135,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 # @@ -135,7 +143,9 @@ 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 # # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th # @@ -166,11 +176,11 @@ 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, 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 # - # @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 # @@ -178,19 +188,23 @@ 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 # # @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. # - # @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 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] # @@ -223,7 +237,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 +255,8 @@ def screenshot(params = {}) # # @param query_fanout [Boolean] Expand the query into multiple parallel variants for broader recall. # + # @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 # # @param request_options [ContextDev::RequestOptions, Hash{Symbol=>Object}, nil] @@ -265,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, 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) # @@ -297,6 +313,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 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 # # @param url_regex [String] Regex pattern. Only URLs matching this pattern will be followed and scraped. @@ -305,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] @@ -324,33 +344,40 @@ 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, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: 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 country [Symbol, ContextDev::Models::WebWebScrapeHTMLParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @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] 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 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] # @@ -383,24 +410,29 @@ 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, 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 dedupe [Boolean] When true, visually duplicate images are removed: every image is loaded and perc + # @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] 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] # @@ -432,48 +464,54 @@ 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, timeout_ms: nil, use_main_content_only: nil, wait_for_ms: 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 country [Symbol, ContextDev::Models::WebWebScrapeMdParams::Country] Two-letter ISO 3166-1 alpha-2 country code for the website request location. Whe + # @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] 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, Symbol, ContextDev::Models::WebWebScrapeMdParams::ShortenBase64Images] Shorten base64-encoded image data in the Markdown output # - # @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, + # @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 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] # @@ -509,7 +547,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, sitemap_url: nil, tags: nil, timeout_ms: nil, url_regex: nil, zdr: nil, request_options: {}) # # @param domain [String] Domain to build a sitemap for # @@ -517,10 +555,16 @@ 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 # # @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] @@ -532,7 +576,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/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 diff --git a/rbi/context_dev/models.rbi b/rbi/context_dev/models.rbi index a5523d3d..fe3d2d12 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/ai_extract_product_params.rbi b/rbi/context_dev/models/ai_extract_product_params.rbi index ef6e788d..3c78efbe 100644 --- a/rbi/context_dev/models/ai_extract_product_params.rbi +++ b/rbi/context_dev/models/ai_extract_product_params.rbi @@ -27,6 +27,13 @@ module ContextDev sig { params(max_age_ms: Integer).void } attr_writer :max_age_ms + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +47,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 +59,8 @@ 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 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 # value is 300000ms (5 minutes). @@ -64,6 +74,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..f00517f6 100644 --- a/rbi/context_dev/models/ai_extract_products_params.rbi +++ b/rbi/context_dev/models/ai_extract_products_params.rbi @@ -92,6 +92,13 @@ module ContextDev sig { params(max_products: Integer).void } attr_writer :max_products + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +113,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 +126,8 @@ module ContextDev max_age_ms: nil, # Maximum number of products to extract. max_products: nil, + # 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 # value is 300000ms (5 minutes). @@ -131,6 +141,7 @@ module ContextDev domain: String, max_age_ms: Integer, max_products: Integer, + tags: T::Array[String], timeout_ms: Integer } ) @@ -169,6 +180,13 @@ module ContextDev sig { params(max_products: Integer).void } attr_writer :max_products + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +201,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 +215,8 @@ module ContextDev max_age_ms: nil, # Maximum number of products to extract. max_products: nil, + # 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 # value is 300000ms (5 minutes). @@ -209,6 +230,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..d74de8bc 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) @@ -135,6 +127,13 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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). @@ -149,9 +148,12 @@ 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], timeout_ms: Integer, type: Symbol ).returns(T.attached_class) @@ -169,6 +171,8 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, + # 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 # value is 300000ms (5 minutes). @@ -184,9 +188,12 @@ 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], timeout_ms: Integer } ) @@ -851,15 +858,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) @@ -880,6 +879,13 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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). @@ -896,9 +902,12 @@ 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], timeout_ms: Integer, type: Symbol ).returns(T.attached_class) @@ -919,6 +928,8 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, + # 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 # value is 300000ms (5 minutes). @@ -935,9 +946,12 @@ 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], timeout_ms: Integer } ) @@ -1594,15 +1608,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) @@ -1623,6 +1629,13 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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). @@ -1639,9 +1652,12 @@ 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], timeout_ms: Integer, type: Symbol ).returns(T.attached_class) @@ -1659,6 +1675,8 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, + # 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 # value is 300000ms (5 minutes). @@ -1674,9 +1692,12 @@ 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], timeout_ms: Integer } ) @@ -2333,15 +2354,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) @@ -2362,6 +2375,13 @@ module ContextDev sig { params(max_speed: T::Boolean).void } attr_writer :max_speed + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 @@ -2384,9 +2404,12 @@ 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], ticker_exchange: String, timeout_ms: Integer, type: Symbol @@ -2405,6 +2428,8 @@ module ContextDev # the API will skip time-consuming operations for faster response at the cost of # less comprehensive data. max_speed: nil, + # 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, # Optional timeout in milliseconds for the request. If the request takes longer @@ -2422,9 +2447,12 @@ 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], ticker_exchange: String, timeout_ms: Integer } @@ -3077,6 +3105,13 @@ module ContextDev sig { returns(Symbol) } attr_accessor :type + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +3129,7 @@ module ContextDev sig do params( direct_url: String, + tags: T::Array[String], timeout_ms: Integer, type: Symbol ).returns(T.attached_class) @@ -3103,6 +3139,8 @@ module ContextDev # 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire # internet. direct_url:, + # 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 # value is 300000ms (5 minutes). @@ -3114,7 +3152,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 @@ -3160,15 +3203,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. @@ -3189,19 +3224,48 @@ 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 tags for tracking usage. Up to 20 tags, each 1 to 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). @@ -3219,11 +3283,16 @@ 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 ).returns(T.attached_class) @@ -3249,6 +3318,8 @@ module ContextDev mcc: nil, # Optional phone number from the transaction to help verify brand match. phone: nil, + # 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 # value is 300000ms (5 minutes). @@ -3266,11 +3337,16 @@ 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 } ) @@ -3901,6 +3977,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 25939714..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,31 @@ 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 + attr_accessor :max_age_ms - 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 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 @@ -40,7 +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) @@ -53,6 +76,12 @@ 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 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). @@ -65,7 +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 } @@ -73,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/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/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_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/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_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_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_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_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_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_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_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_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/models/parse_handle_params.rbi b/rbi/context_dev/models/parse_handle_params.rbi index 23698860..4b74f53f 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,56 +111,135 @@ 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 + # 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)) } + 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 + # 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, + 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, - use_main_content_only: T::Boolean, + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol + ), + tags: T::Array[String], + use_main_content_only: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol + ), + zdr: ContextDev::ParseHandleParams::Zdr::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, + # 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, + # 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 @@ -122,13 +248,33 @@ 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, - use_main_content_only: T::Boolean, + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol + ), + tags: T::Array[String], + use_main_content_only: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol + ), + zdr: ContextDev::ParseHandleParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -136,8 +282,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 @@ -294,6 +440,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 @@ -318,8 +568,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. @@ -334,6 +583,111 @@ 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 + + # 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/utility_prefetch_params.rbi b/rbi/context_dev/models/utility_prefetch_params.rbi index a8dcebf7..fd5ed61f 100644 --- a/rbi/context_dev/models/utility_prefetch_params.rbi +++ b/rbi/context_dev/models/utility_prefetch_params.rbi @@ -29,6 +29,13 @@ module ContextDev sig { returns(ContextDev::UtilityPrefetchParams::Type::OrSymbol) } attr_accessor :type + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +53,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 +63,8 @@ module ContextDev identifier:, # What to prefetch. Currently only 'brand' is supported. type:, + # 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 # value is 300000ms (5 minutes). @@ -72,6 +82,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..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,21 @@ 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 + attr_accessor :max_age_ms - 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 @@ -55,7 +61,8 @@ 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 ).returns(T.attached_class) @@ -69,11 +76,15 @@ 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. 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). @@ -87,7 +98,8 @@ 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_params.rbi b/rbi/context_dev/models/web_extract_params.rbi index eb0a6fc7..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,6 +102,13 @@ module ContextDev sig { params(stop_after_ms: Integer).void } attr_writer :stop_after_ms + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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). @@ -122,7 +138,9 @@ 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, wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -159,9 +177,15 @@ 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 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 # value is 300000ms (5 minutes). @@ -186,7 +210,9 @@ 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, 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..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,21 @@ 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 + attr_accessor :max_age_ms - 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 @@ -77,7 +83,8 @@ 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 ).returns(T.attached_class) @@ -95,11 +102,15 @@ 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. 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). @@ -115,7 +126,8 @@ 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 8e58b4d7..2e8c9ff2 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,16 @@ 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 + 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 + # dashboard usage page. Up to 20 tags, each 1-50 characters. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :tags - sig { params(scroll_offset: Integer).void } - attr_writer :scroll_offset + 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 @@ -151,10 +161,17 @@ 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 + attr_accessor :wait_for_ms - 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::WebScreenshotParams::Zdr::OrSymbol)) } + attr_reader :zdr + + sig { params(zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol).void } + attr_writer :zdr sig do params( @@ -165,13 +182,18 @@ 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), + zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -179,8 +201,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 @@ -215,6 +238,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). @@ -225,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 @@ -240,13 +272,18 @@ 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), + zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -285,8 +322,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 @@ -548,7 +586,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 @@ -566,16 +622,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 @@ -654,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_search_params.rbi b/rbi/context_dev/models/web_search_params.rbi index 91089100..32996cc8 100644 --- a/rbi/context_dev/models/web_search_params.rbi +++ b/rbi/context_dev/models/web_search_params.rbi @@ -78,6 +78,13 @@ module ContextDev sig { params(query_fanout: T::Boolean).void } attr_writer :query_fanout + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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 +105,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 +131,8 @@ module ContextDev num_results: nil, # Expand the query into multiple parallel variants for broader recall. query_fanout: nil, + # 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 # value is 300000ms (5 minutes). @@ -142,6 +152,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..baa72ffc 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,13 @@ module ContextDev sig { params(stop_after_ms: Integer).void } attr_writer :stop_after_ms + # Optional tags for tracking usage. Up to 20 tags, each 1 to 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). @@ -167,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, @@ -184,10 +201,12 @@ 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, wait_for_ms: Integer, + zdr: ContextDev::WebWebCrawlMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -240,6 +259,8 @@ module ContextDev # instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 # (80s). stop_after_ms: nil, + # 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 # value is 300000ms (5 minutes). @@ -252,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 @@ -274,10 +300,12 @@ 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, wait_for_ms: Integer, + zdr: ContextDev::WebWebCrawlMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -591,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 97373bae..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,8 +18,26 @@ 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. + # 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. sig do returns( T.nilable(ContextDev::WebWebScrapeHTMLParams::Country::OrSymbol) @@ -38,10 +56,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 +68,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,12 +114,38 @@ 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 + # 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). @@ -105,42 +157,98 @@ 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 + attr_accessor :wait_for_ms - 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 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, + 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::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), + zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol, 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. + # 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. country: nil, # CSS selectors to remove from the result. Applied after includeSelectors. # Exclusion takes precedence: an element matching both is removed. Examples: @@ -167,6 +275,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). @@ -177,6 +289,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 @@ -185,17 +302,40 @@ 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::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), + zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -203,8 +343,83 @@ 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. + # 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. module Country extend ContextDev::Internal::Type::Enum @@ -632,6 +847,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 @@ -652,18 +907,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. @@ -678,8 +967,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 @@ -703,14 +1000,222 @@ 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 + + # 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 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..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,14 +18,48 @@ 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: # 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 +71,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 +89,16 @@ 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 + attr_accessor :max_age_ms - 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 @@ -71,26 +112,42 @@ 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, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Wait::OrHash, + ContextDev::WebWebScrapeImagesParams::Action::Perform::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 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: @@ -106,6 +163,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). @@ -121,12 +182,27 @@ module ContextDev override.returns( { url: String, - dedupe: T::Boolean, - enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Wait, + ContextDev::WebWebScrapeImagesParams::Action::Perform + ) + ] + ), + 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 } ) @@ -134,6 +210,121 @@ 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: + # 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 @@ -144,18 +335,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. @@ -166,20 +391,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( @@ -198,15 +452,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 cf50f4e0..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,8 +16,26 @@ 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. + # 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. sig do returns(T.nilable(ContextDev::WebWebScrapeMdParams::Country::OrSymbol)) end @@ -34,10 +52,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 +64,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,19 +158,62 @@ 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 + # 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). @@ -122,37 +225,98 @@ 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 + attr_accessor :wait_for_ms - 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 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, + 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::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), + zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(T.attached_class) end @@ -160,8 +324,13 @@ 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. + # 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. country: nil, # CSS selectors to remove before conversion to Markdown. Applied after # includeSelectors. Exclusion takes precedence: an element matching both is @@ -194,6 +363,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). @@ -204,6 +377,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 @@ -212,20 +390,55 @@ 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::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), + zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions } ) @@ -233,8 +446,83 @@ 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. + # 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. module Country extend ContextDev::Internal::Type::Enum @@ -458,6 +746,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 @@ -478,18 +880,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. @@ -504,8 +940,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 @@ -529,14 +973,251 @@ 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 + + # 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 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..a4cbec1f 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,23 @@ 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. + 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). @@ -52,13 +69,30 @@ 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, headers: T::Hash[Symbol, String], max_links: Integer, + sitemap_url: String, + 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 @@ -72,6 +106,13 @@ 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. + 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). @@ -79,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 @@ -89,14 +135,50 @@ 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, + 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/ai.rbi b/rbi/context_dev/resources/ai.rbi index 94f6d182..27608cac 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,8 @@ 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 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 # value is 300000ms (5 minutes). diff --git a/rbi/context_dev/resources/brand.rbi b/rbi/context_dev/resources/brand.rbi index d4e653e1..d4a83387 100644 --- a/rbi/context_dev/resources/brand.rbi +++ b/rbi/context_dev/resources/brand.rbi @@ -35,7 +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) @@ -48,6 +50,12 @@ 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 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/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/monitors.rbi b/rbi/context_dev/resources/monitors.rbi index f5aa5393..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, @@ -117,18 +119,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 +145,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: {} ) @@ -163,6 +167,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( @@ -180,14 +211,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 +241,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 +265,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 +291,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 983b26a0..7a7dac46 100644 --- a/rbi/context_dev/resources/parse.rbi +++ b/rbi/context_dev/resources/parse.rbi @@ -4,47 +4,74 @@ 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, - use_main_content_only: T::Boolean, + shorten_base64_images: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::ShortenBase64Images::OrSymbol + ), + tags: T::Array[String], + use_main_content_only: + T.any( + T::Boolean, + ContextDev::ParseHandleParams::UseMainContentOnly::OrSymbol + ), + zdr: ContextDev::ParseHandleParams::Zdr::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, + # 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, + # 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/utility.rbi b/rbi/context_dev/resources/utility.rbi index f21a5ccb..a9937a5f 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,8 @@ module ContextDev identifier:, # What to prefetch. Currently only 'brand' is supported. type:, + # 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 # value is 300000ms (5 minutes). diff --git a/rbi/context_dev/resources/web.rbi b/rbi/context_dev/resources/web.rbi index be31aac3..9c1a6cb1 100644 --- a/rbi/context_dev/resources/web.rbi +++ b/rbi/context_dev/resources/web.rbi @@ -17,7 +17,9 @@ 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, wait_for_ms: Integer, request_options: ContextDev::RequestOptions::OrHash @@ -54,9 +56,15 @@ 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 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 # value is 300000ms (5 minutes). @@ -74,6 +82,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 +93,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). @@ -98,7 +111,8 @@ 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 ).returns(ContextDev::Models::WebExtractFontsResponse) @@ -112,11 +126,15 @@ 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. 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). @@ -133,7 +151,8 @@ 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 ).returns(ContextDev::Models::WebExtractStyleguideResponse) @@ -151,11 +170,15 @@ 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. 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). @@ -174,13 +197,18 @@ 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), + zdr: ContextDev::WebScreenshotParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebScreenshotResponse) end @@ -188,8 +216,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 @@ -224,6 +253,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). @@ -234,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 @@ -250,6 +288,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 +314,8 @@ module ContextDev num_results: nil, # Expand the query into multiple parallel variants for broader recall. query_fanout: nil, + # 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 # value is 300000ms (5 minutes). @@ -302,10 +343,12 @@ 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, wait_for_ms: Integer, + zdr: ContextDev::WebWebCrawlMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebCrawlMdResponse) end @@ -358,6 +401,8 @@ module ContextDev # instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 # (80s). stop_after_ms: nil, + # 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 # value is 300000ms (5 minutes). @@ -370,33 +415,67 @@ 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 - # 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::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), + zdr: ContextDev::WebWebScrapeHTMLParams::Zdr::OrSymbol, 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. + # 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. country: nil, # CSS selectors to remove from the result. Applied after includeSelectors. # Exclusion takes precedence: an element matching both is removed. Examples: @@ -423,6 +502,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). @@ -433,29 +516,54 @@ 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 # 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, - dedupe: T::Boolean, - enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment::OrHash, + actions: + T.nilable( + T::Array[ + T.any( + ContextDev::WebWebScrapeImagesParams::Action::Wait::OrHash, + ContextDev::WebWebScrapeImagesParams::Action::Perform::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 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: @@ -471,6 +579,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). @@ -488,33 +600,68 @@ 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::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), + zdr: ContextDev::WebWebScrapeMdParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeMdResponse) end @@ -522,8 +669,13 @@ 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. + # 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. country: nil, # CSS selectors to remove before conversion to Markdown. Applied after # includeSelectors. Exclusion takes precedence: an element matching both is @@ -556,6 +708,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). @@ -566,6 +722,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 @@ -576,8 +737,11 @@ 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, + zdr: ContextDev::WebWebScrapeSitemapParams::Zdr::OrSymbol, request_options: ContextDev::RequestOptions::OrHash ).returns(ContextDev::Models::WebWebScrapeSitemapResponse) end @@ -591,6 +755,13 @@ 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. + 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). @@ -598,6 +769,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.rbs b/sig/context_dev/models.rbs index 41201247..835bb06b 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/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..b992af34 100644 --- a/sig/context_dev/models/brand_retrieve_params.rbs +++ b/sig/context_dev/models/brand_retrieve_params.rbs @@ -35,9 +35,10 @@ 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], timeout_ms: Integer } @@ -46,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? @@ -60,15 +57,20 @@ 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 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], ?timeout_ms: Integer, ?type: :by_domain ) -> void @@ -76,9 +78,10 @@ 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], timeout_ms: Integer } @@ -337,9 +340,10 @@ 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], timeout_ms: Integer } @@ -352,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? @@ -366,6 +366,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 @@ -373,9 +377,10 @@ 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], ?timeout_ms: Integer, ?type: :by_name ) -> void @@ -384,9 +389,10 @@ 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], timeout_ms: Integer } @@ -644,9 +650,10 @@ 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], timeout_ms: Integer } @@ -655,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? @@ -669,15 +672,20 @@ 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 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], ?timeout_ms: Integer, ?type: :by_email ) -> void @@ -685,9 +693,10 @@ 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], timeout_ms: Integer } @@ -945,9 +954,10 @@ 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], ticker_exchange: String, timeout_ms: Integer } @@ -957,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? @@ -971,6 +977,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 @@ -981,9 +991,10 @@ 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], ?ticker_exchange: String, ?timeout_ms: Integer, ?type: :by_ticker @@ -992,9 +1003,10 @@ 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], ticker_exchange: String, timeout_ms: Integer } @@ -1250,19 +1262,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 +1292,7 @@ module ContextDev def to_hash: -> { direct_url: String, type: :by_direct_url, + tags: ::Array[String], timeout_ms: Integer } end @@ -1280,11 +1303,12 @@ 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 } @@ -1301,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? @@ -1315,13 +1335,21 @@ module ContextDev def max_speed=: (bool) -> bool - attr_reader mcc: Integer? + attr_reader mcc: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc? + + def mcc=: ( + ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc + ) -> ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::mcc - def mcc=: (Integer) -> Integer + attr_reader phone: ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone? - attr_reader phone: Float? + def phone=: ( + ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone + ) -> ContextDev::Models::BrandRetrieveParams::Body::ByTransaction::phone - def phone=: (Float) -> Float + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] attr_reader timeout_ms: Integer? @@ -1331,11 +1359,12 @@ 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 ) -> void @@ -1345,11 +1374,12 @@ 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 } @@ -1601,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 a17bcabb..28dc7381 100644 --- a/sig/context_dev/models/brand_retrieve_simplified_params.rbs +++ b/sig/context_dev/models/brand_retrieve_simplified_params.rbs @@ -1,7 +1,13 @@ 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], + theme: ContextDev::Models::BrandRetrieveSimplifiedParams::theme, + timeout_ms: Integer + } & ContextDev::Internal::Type::request_parameters class BrandRetrieveSimplifiedParams < ContextDev::Internal::Type::BaseModel @@ -10,9 +16,17 @@ module ContextDev attr_accessor domain: String - attr_reader max_age_ms: 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 max_age_ms=: (Integer) -> Integer + def theme=: ( + ContextDev::Models::BrandRetrieveSimplifiedParams::theme + ) -> ContextDev::Models::BrandRetrieveSimplifiedParams::theme attr_reader timeout_ms: Integer? @@ -20,17 +34,32 @@ module ContextDev 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/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/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/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/parse_handle_params.rbs b/sig/context_dev/models/parse_handle_params.rbs index 6e3272f7..e754d54b 100644 --- a/sig/context_dev/models/parse_handle_params.rbs +++ b/sig/context_dev/models/parse_handle_params.rbs @@ -3,13 +3,16 @@ 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, - use_main_content_only: bool + :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 } & ContextDev::Internal::Type::request_parameters @@ -19,23 +22,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? @@ -43,35 +56,55 @@ 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=: ( + ContextDev::Models::ParseHandleParams::shorten_base64_images + ) -> ContextDev::Models::ParseHandleParams::shorten_base64_images + + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] - def shorten_base64_images=: (bool) -> bool + attr_reader use_main_content_only: ContextDev::Models::ParseHandleParams::use_main_content_only? - attr_reader use_main_content_only: bool? + def use_main_content_only=: ( + ContextDev::Models::ParseHandleParams::use_main_content_only + ) -> ContextDev::Models::ParseHandleParams::use_main_content_only - def use_main_content_only=: (bool) -> bool + 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, ?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, - ?use_main_content_only: bool, + ?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 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, - use_main_content_only: bool, + :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 } @@ -224,6 +257,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 @@ -239,6 +305,39 @@ 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 + + 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/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..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,8 @@ module ContextDev { direct_url: String, domain: String, - max_age_ms: Integer, + max_age_ms: Integer?, + tags: ::Array[String], timeout_ms: Integer } & ContextDev::Internal::Type::request_parameters @@ -21,9 +22,11 @@ module ContextDev def domain=: (String) -> String - attr_reader max_age_ms: Integer? + attr_accessor max_age_ms: Integer? - def max_age_ms=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] attr_reader timeout_ms: Integer? @@ -32,7 +35,8 @@ 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 ) -> void @@ -40,7 +44,8 @@ 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_params.rbs b/sig/context_dev/models/web_extract_params.rbs index c185d714..e04099ae 100644 --- a/sig/context_dev/models/web_extract_params.rbs +++ b/sig/context_dev/models/web_extract_params.rbs @@ -12,7 +12,9 @@ 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, wait_for_ms: Integer } @@ -60,10 +62,18 @@ 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 + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -83,7 +93,9 @@ 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, ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts @@ -100,7 +112,9 @@ 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, 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..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,8 @@ 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 } & ContextDev::Internal::Type::request_parameters @@ -28,9 +29,11 @@ module ContextDev def domain=: (String) -> String - attr_reader max_age_ms: Integer? + attr_accessor max_age_ms: Integer? - def max_age_ms=: (Integer) -> Integer + attr_reader tags: ::Array[String]? + + def tags=: (::Array[String]) -> ::Array[String] attr_reader timeout_ms: Integer? @@ -40,7 +43,8 @@ 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 ) -> void @@ -49,7 +53,8 @@ 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 8df117a5..e6e0538c 100644 --- a/sig/context_dev/models/web_screenshot_params.rbs +++ b/sig/context_dev/models/web_screenshot_params.rbs @@ -8,12 +8,14 @@ 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?, + zdr: ContextDev::Models::WebScreenshotParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -53,9 +55,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? @@ -63,9 +63,11 @@ module ContextDev ContextDev::Models::WebScreenshotParams::page ) -> ContextDev::Models::WebScreenshotParams::page - attr_reader scroll_offset: Integer? + attr_accessor scroll_offset: Integer? + + attr_reader tags: ::Array[String]? - def scroll_offset=: (Integer) -> Integer + def tags=: (::Array[String]) -> ::Array[String] attr_reader timeout_ms: Integer? @@ -77,9 +79,13 @@ module ContextDev ContextDev::WebScreenshotParams::Viewport ) -> ContextDev::WebScreenshotParams::Viewport - attr_reader wait_for_ms: Integer? + attr_accessor wait_for_ms: Integer? + + attr_reader zdr: ContextDev::Models::WebScreenshotParams::zdr? - def wait_for_ms=: (Integer) -> Integer + def zdr=: ( + ContextDev::Models::WebScreenshotParams::zdr + ) -> ContextDev::Models::WebScreenshotParams::zdr def initialize: ( ?color_scheme: ContextDev::Models::WebScreenshotParams::color_scheme, @@ -88,12 +94,14 @@ 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?, + ?zdr: ContextDev::Models::WebScreenshotParams::zdr, ?request_options: ContextDev::request_opts ) -> void @@ -104,12 +112,14 @@ 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?, + zdr: ContextDev::Models::WebScreenshotParams::zdr, request_options: ContextDev::RequestOptions } @@ -552,15 +562,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 = @@ -603,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_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..078f9236 100644 --- a/sig/context_dev/models/web_web_crawl_md_params.rbs +++ b/sig/context_dev/models/web_web_crawl_md_params.rbs @@ -17,10 +17,12 @@ 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, - wait_for_ms: Integer + wait_for_ms: Integer, + zdr: ContextDev::Models::WebWebCrawlMdParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -90,6 +92,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 @@ -106,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, @@ -122,10 +134,12 @@ 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, ?wait_for_ms: Integer, + ?zdr: ContextDev::Models::WebWebCrawlMdParams::zdr, ?request_options: ContextDev::request_opts ) -> void @@ -145,10 +159,12 @@ 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, wait_for_ms: Integer, + zdr: ContextDev::Models::WebWebCrawlMdParams::zdr, request_options: ContextDev::RequestOptions } @@ -603,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 b58ef1ad..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,17 +3,20 @@ 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], + 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?, + zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -23,31 +26,29 @@ module ContextDev attr_accessor url: String + attr_accessor actions: ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action]? + attr_reader country: ContextDev::Models::WebWebScrapeHTMLParams::country? def country=: ( 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_selectors: ::Array[String]? + attr_reader include_frames: ContextDev::Models::WebWebScrapeHTMLParams::include_frames? - def include_selectors=: (::Array[String]) -> ::Array[String] + def include_frames=: ( + ContextDev::Models::WebWebScrapeHTMLParams::include_frames + ) -> ContextDev::Models::WebWebScrapeHTMLParams::include_frames - 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::WebWebScrapeHTMLParams::Pdf? @@ -55,54 +56,106 @@ 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]? + + def tags=: (::Array[String]) -> ::Array[String] attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer - attr_reader use_main_content_only: bool? + attr_reader use_main_content_only: ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only? + + def use_main_content_only=: ( + ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only + ) -> ContextDev::Models::WebWebScrapeHTMLParams::use_main_content_only - def use_main_content_only=: (bool) -> bool + attr_accessor wait_for_ms: Integer? - attr_reader wait_for_ms: Integer? + attr_reader zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr? - def wait_for_ms=: (Integer) -> Integer + def zdr=: ( + ContextDev::Models::WebWebScrapeHTMLParams::zdr + ) -> ContextDev::Models::WebWebScrapeHTMLParams::zdr def initialize: ( url: String, + ?actions: ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action]?, ?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?, + ?zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { url: String, + actions: ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action]?, 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?, + zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr, 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 @@ -520,21 +573,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? @@ -542,17 +615,72 @@ 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 + + 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 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..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,12 +3,14 @@ module ContextDev type web_web_scrape_images_params = { url: String, - dedupe: bool, - enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, + actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]?, + 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 @@ -18,92 +20,180 @@ module ContextDev attr_accessor url: String - attr_reader dedupe: bool? + attr_accessor actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]? - def dedupe=: (bool) -> bool + attr_reader dedupe: ContextDev::Models::WebWebScrapeImagesParams::dedupe? - attr_reader enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment? + def dedupe=: ( + ContextDev::Models::WebWebScrapeImagesParams::dedupe + ) -> ContextDev::Models::WebWebScrapeImagesParams::dedupe - 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? + attr_accessor max_age_ms: Integer? - 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 - 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, + ?actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]?, + ?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, + actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]?, + 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 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 + 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 5df459cb..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,20 +3,23 @@ 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], + 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?, + zdr: ContextDev::Models::WebWebScrapeMdParams::zdr } & ContextDev::Internal::Type::request_parameters @@ -26,39 +29,41 @@ module ContextDev attr_accessor url: String + attr_accessor actions: ::Array[ContextDev::Models::WebWebScrapeMdParams::action]? + attr_reader country: ContextDev::Models::WebWebScrapeMdParams::country? def country=: ( 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_frames: ContextDev::Models::WebWebScrapeMdParams::include_frames? - attr_reader include_images: bool? + def include_frames=: ( + ContextDev::Models::WebWebScrapeMdParams::include_frames + ) -> ContextDev::Models::WebWebScrapeMdParams::include_frames - def include_images=: (bool) -> bool + attr_reader include_images: ContextDev::Models::WebWebScrapeMdParams::include_images? - attr_reader include_links: bool? + def include_images=: ( + ContextDev::Models::WebWebScrapeMdParams::include_images + ) -> ContextDev::Models::WebWebScrapeMdParams::include_images - def include_links=: (bool) -> bool + attr_reader include_links: ContextDev::Models::WebWebScrapeMdParams::include_links? - attr_reader include_selectors: ::Array[String]? + def include_links=: ( + ContextDev::Models::WebWebScrapeMdParams::include_links + ) -> ContextDev::Models::WebWebScrapeMdParams::include_links - 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::WebWebScrapeMdParams::Pdf? @@ -66,64 +71,118 @@ 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=: ( + ContextDev::Models::WebWebScrapeMdParams::settle_animations + ) -> ContextDev::Models::WebWebScrapeMdParams::settle_animations - def settle_animations=: (bool) -> bool + attr_reader shorten_base64_images: ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images? - attr_reader shorten_base64_images: bool? + def shorten_base64_images=: ( + ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images + ) -> ContextDev::Models::WebWebScrapeMdParams::shorten_base64_images - 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 - 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=: ( + ContextDev::Models::WebWebScrapeMdParams::use_main_content_only + ) -> ContextDev::Models::WebWebScrapeMdParams::use_main_content_only - def use_main_content_only=: (bool) -> bool + attr_accessor wait_for_ms: Integer? - attr_reader wait_for_ms: Integer? + attr_reader zdr: ContextDev::Models::WebWebScrapeMdParams::zdr? - def wait_for_ms=: (Integer) -> Integer + def zdr=: ( + ContextDev::Models::WebWebScrapeMdParams::zdr + ) -> ContextDev::Models::WebWebScrapeMdParams::zdr def initialize: ( url: String, + ?actions: ::Array[ContextDev::Models::WebWebScrapeMdParams::action]?, ?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?, + ?zdr: ContextDev::Models::WebWebScrapeMdParams::zdr, ?request_options: ContextDev::request_opts ) -> void def to_hash: -> { url: String, + actions: ::Array[ContextDev::Models::WebWebScrapeMdParams::action]?, 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?, + zdr: ContextDev::Models::WebWebScrapeMdParams::zdr, 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 @@ -541,21 +600,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? @@ -563,17 +664,83 @@ 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 + + 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 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..aae1007c 100644 --- a/sig/context_dev/models/web_web_scrape_sitemap_params.rbs +++ b/sig/context_dev/models/web_web_scrape_sitemap_params.rbs @@ -5,8 +5,11 @@ module ContextDev domain: String, headers: ::Hash[Symbol, String], max_links: Integer, + 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 @@ -24,6 +27,14 @@ 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] + attr_reader timeout_ms: Integer? def timeout_ms=: (Integer) -> Integer @@ -32,12 +43,21 @@ 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], ?max_links: Integer, + ?sitemap_url: String, + ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, + ?zdr: ContextDev::Models::WebWebScrapeSitemapParams::zdr, ?request_options: ContextDev::request_opts ) -> void @@ -45,10 +65,24 @@ module ContextDev domain: String, headers: ::Hash[Symbol, String], max_links: Integer, + sitemap_url: String, + 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/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..5da33e16 100644 --- a/sig/context_dev/resources/brand.rbs +++ b/sig/context_dev/resources/brand.rbs @@ -8,7 +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/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/monitors.rbs b/sig/context_dev/resources/monitors.rbs index 62c1ed9a..8a439864 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 @@ -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/sig/context_dev/resources/parse.rbs b/sig/context_dev/resources/parse.rbs index b2ff7061..38e6deeb 100644 --- a/sig/context_dev/resources/parse.rbs +++ b/sig/context_dev/resources/parse.rbs @@ -3,13 +3,16 @@ 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, - ?use_main_content_only: bool, + ?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/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..1b16a230 100644 --- a/sig/context_dev/resources/web.rbs +++ b/sig/context_dev/resources/web.rbs @@ -12,7 +12,9 @@ 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, ?wait_for_ms: Integer, ?request_options: ContextDev::request_opts @@ -21,6 +23,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 @@ -28,7 +31,8 @@ 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 ) -> ContextDev::Models::WebExtractFontsResponse @@ -37,7 +41,8 @@ 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 ) -> ContextDev::Models::WebExtractStyleguideResponse @@ -49,12 +54,14 @@ 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?, + ?zdr: ContextDev::Models::WebScreenshotParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebScreenshotResponse @@ -67,6 +74,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,56 +95,66 @@ 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, ?wait_for_ms: Integer, + ?zdr: ContextDev::Models::WebWebCrawlMdParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebCrawlMdResponse def web_scrape_html: ( url: String, + ?actions: ::Array[ContextDev::Models::WebWebScrapeHTMLParams::action]?, ?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?, + ?zdr: ContextDev::Models::WebWebScrapeHTMLParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeHTMLResponse def web_scrape_images: ( url: String, - ?dedupe: bool, - ?enrichment: ContextDev::WebWebScrapeImagesParams::Enrichment, + ?actions: ::Array[ContextDev::Models::WebWebScrapeImagesParams::action]?, + ?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, + ?actions: ::Array[ContextDev::Models::WebWebScrapeMdParams::action]?, ?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?, + ?zdr: ContextDev::Models::WebWebScrapeMdParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeMdResponse @@ -144,8 +162,11 @@ module ContextDev domain: String, ?headers: ::Hash[Symbol, String], ?max_links: Integer, + ?sitemap_url: String, + ?tags: ::Array[String], ?timeout_ms: Integer, ?url_regex: String, + ?zdr: ContextDev::Models::WebWebScrapeSitemapParams::zdr, ?request_options: ContextDev::request_opts ) -> ContextDev::Models::WebWebScrapeSitemapResponse 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/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") 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