diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d2d60a3..a36746b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.24.0" + ".": "0.25.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index a831e36..d2dca25 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-f6fec0ae4fa4572aefa111e660f98f6acfb6149c22cbd413bd3defad6c100478.yml -openapi_spec_hash: a82bf07982eae3814e8a60eb368e0ce5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-98ef96cef5b06ad7a29dadba48258da7d9ea0a2b3938dc9e714ae06eb9afa1a3.yml +openapi_spec_hash: 9e957a30999dff7d4ada925e437bd202 config_hash: c3aaaa9794dba44d524c06591ab17894 diff --git a/CHANGELOG.md b/CHANGELOG.md index ba40918..9769c21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.25.0 (2026-02-22) + +Full Changelog: [v0.24.0...v0.25.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.24.0...v0.25.0) + +### Features + +* **api:** api update ([a8001da](https://github.com/brand-dot-dev/ruby-sdk/commit/a8001da388a5bf764a6fe19b7df7bc3572ae3dce)) + + +### Chores + +* **internal:** remove mock server code ([106d37c](https://github.com/brand-dot-dev/ruby-sdk/commit/106d37c53f7459910a897b4f675b97a003b73f7c)) +* update mock server docs ([e60e130](https://github.com/brand-dot-dev/ruby-sdk/commit/e60e13027cec2ae0282f1ca4c4785d3586efe304)) + ## 0.24.0 (2026-02-09) Full Changelog: [v0.23.0...v0.24.0](https://github.com/brand-dot-dev/ruby-sdk/compare/v0.23.0...v0.24.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 931427a..5a4601b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,12 +66,6 @@ $ bundle exec rake ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. - -```bash -$ npx prism mock path/to/your/openapi.yml -``` - ```bash $ bundle exec rake test ``` diff --git a/Gemfile.lock b/Gemfile.lock index b8d2626..b751cd3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - brand.dev (0.24.0) + brand.dev (0.25.0) cgi connection_pool diff --git a/README.md b/README.md index e090c66..4b89fde 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 "brand.dev", "~> 0.24.0" +gem "brand.dev", "~> 0.25.0" ``` diff --git a/lib/brand_dev/models/brand_ai_product_response.rb b/lib/brand_dev/models/brand_ai_product_response.rb index b35730f..b55be6d 100644 --- a/lib/brand_dev/models/brand_ai_product_response.rb +++ b/lib/brand_dev/models/brand_ai_product_response.rb @@ -58,6 +58,12 @@ class Product < BrandDev::Internal::Type::BaseModel # @return [Array] required :features, BrandDev::Internal::Type::ArrayOf[String] + # @!attribute images + # URLs to product images on the page (up to 7) + # + # @return [Array] + required :images, BrandDev::Internal::Type::ArrayOf[String] + # @!attribute name # Name of the product # @@ -122,13 +128,15 @@ class Product < BrandDev::Internal::Type::BaseModel # @return [String, nil] optional :url, String, nil?: true - # @!method initialize(description:, features:, name:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil) + # @!method initialize(description:, features:, images:, name:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil) # The extracted product data, or null if not a product page # # @param description [String] Description of the product # # @param features [Array] List of product features # + # @param images [Array] URLs to product images on the page (up to 7) + # # @param name [String] Name of the product # # @param tags [Array] Tags associated with the product diff --git a/lib/brand_dev/models/brand_ai_products_response.rb b/lib/brand_dev/models/brand_ai_products_response.rb index fc96781..217e1b5 100644 --- a/lib/brand_dev/models/brand_ai_products_response.rb +++ b/lib/brand_dev/models/brand_ai_products_response.rb @@ -27,6 +27,12 @@ class Product < BrandDev::Internal::Type::BaseModel # @return [Array] required :features, BrandDev::Internal::Type::ArrayOf[String] + # @!attribute images + # URLs to product images on the page (up to 7) + # + # @return [Array] + required :images, BrandDev::Internal::Type::ArrayOf[String] + # @!attribute name # Name of the product # @@ -91,11 +97,13 @@ class Product < BrandDev::Internal::Type::BaseModel # @return [String, nil] optional :url, String, nil?: true - # @!method initialize(description:, features:, name:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil) + # @!method initialize(description:, features:, images:, name:, tags:, target_audience:, billing_frequency: nil, category: nil, currency: nil, image_url: nil, price: nil, pricing_model: nil, url: nil) # @param description [String] Description of the product # # @param features [Array] List of product features # + # @param images [Array] URLs to product images on the page (up to 7) + # # @param name [String] Name of the product # # @param tags [Array] Tags associated with the product diff --git a/lib/brand_dev/version.rb b/lib/brand_dev/version.rb index 65adf76..5967e71 100644 --- a/lib/brand_dev/version.rb +++ b/lib/brand_dev/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module BrandDev - VERSION = "0.24.0" + VERSION = "0.25.0" end diff --git a/rbi/brand_dev/models/brand_ai_product_response.rbi b/rbi/brand_dev/models/brand_ai_product_response.rbi index c9f718d..4eadc37 100644 --- a/rbi/brand_dev/models/brand_ai_product_response.rbi +++ b/rbi/brand_dev/models/brand_ai_product_response.rbi @@ -138,6 +138,10 @@ module BrandDev sig { returns(T::Array[String]) } attr_accessor :features + # URLs to product images on the page (up to 7) + sig { returns(T::Array[String]) } + attr_accessor :images + # Name of the product sig { returns(String) } attr_accessor :name @@ -195,6 +199,7 @@ module BrandDev params( description: String, features: T::Array[String], + images: T::Array[String], name: String, tags: T::Array[String], target_audience: T::Array[String], @@ -218,6 +223,8 @@ module BrandDev description:, # List of product features features:, + # URLs to product images on the page (up to 7) + images:, # Name of the product name:, # Tags associated with the product @@ -246,6 +253,7 @@ module BrandDev { description: String, features: T::Array[String], + images: T::Array[String], name: String, tags: T::Array[String], target_audience: T::Array[String], diff --git a/rbi/brand_dev/models/brand_ai_products_response.rbi b/rbi/brand_dev/models/brand_ai_products_response.rbi index 1559159..1aa1dfc 100644 --- a/rbi/brand_dev/models/brand_ai_products_response.rbi +++ b/rbi/brand_dev/models/brand_ai_products_response.rbi @@ -69,6 +69,10 @@ module BrandDev sig { returns(T::Array[String]) } attr_accessor :features + # URLs to product images on the page (up to 7) + sig { returns(T::Array[String]) } + attr_accessor :images + # Name of the product sig { returns(String) } attr_accessor :name @@ -125,6 +129,7 @@ module BrandDev params( description: String, features: T::Array[String], + images: T::Array[String], name: String, tags: T::Array[String], target_audience: T::Array[String], @@ -148,6 +153,8 @@ module BrandDev description:, # List of product features features:, + # URLs to product images on the page (up to 7) + images:, # Name of the product name:, # Tags associated with the product @@ -176,6 +183,7 @@ module BrandDev { description: String, features: T::Array[String], + images: T::Array[String], name: String, tags: T::Array[String], target_audience: T::Array[String], diff --git a/scripts/mock b/scripts/mock deleted file mode 100755 index 0b28f6e..0000000 --- a/scripts/mock +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -if [[ -n "$1" && "$1" != '--'* ]]; then - URL="$1" - shift -else - URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" -fi - -# Check if the URL is empty -if [ -z "$URL" ]; then - echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" - exit 1 -fi - -echo "==> Starting mock server with URL ${URL}" - -# Run prism mock on the given spec -if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - - # Wait for server to come online - echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do - echo -n "." - sleep 0.1 - done - - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - - echo -else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" -fi diff --git a/scripts/test b/scripts/test index e0dc137..df8caf9 100755 --- a/scripts/test +++ b/scripts/test @@ -4,53 +4,7 @@ set -e cd -- "$(dirname -- "$0")/.." -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -kill_server_on_port() { - pids=$(lsof -t -i tcp:"$1" || echo "") - if [ "$pids" != "" ]; then - kill "$pids" - echo "Stopped $pids." - fi -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if ! is_overriding_api_base_url && ! prism_is_running ; then - # When we exit this script, make sure to kill the background mock server process - trap 'kill_server_on_port 4010' EXIT - - # Start the dev server - ./scripts/mock --daemon -fi - -if is_overriding_api_base_url ; then - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" - echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo -fi echo "==> Running tests" bundle exec rake test "$@" diff --git a/sig/brand_dev/models/brand_ai_product_response.rbs b/sig/brand_dev/models/brand_ai_product_response.rbs index c1878d9..4524a38 100644 --- a/sig/brand_dev/models/brand_ai_product_response.rbs +++ b/sig/brand_dev/models/brand_ai_product_response.rbs @@ -45,6 +45,7 @@ module BrandDev { description: String, features: ::Array[String], + images: ::Array[String], name: String, tags: ::Array[String], target_audience: ::Array[String], @@ -62,6 +63,8 @@ module BrandDev attr_accessor features: ::Array[String] + attr_accessor images: ::Array[String] + attr_accessor name: String attr_accessor tags: ::Array[String] @@ -85,6 +88,7 @@ module BrandDev def initialize: ( description: String, features: ::Array[String], + images: ::Array[String], name: String, tags: ::Array[String], target_audience: ::Array[String], @@ -100,6 +104,7 @@ module BrandDev def to_hash: -> { description: String, features: ::Array[String], + images: ::Array[String], name: String, tags: ::Array[String], target_audience: ::Array[String], diff --git a/sig/brand_dev/models/brand_ai_products_response.rbs b/sig/brand_dev/models/brand_ai_products_response.rbs index 5e71e9d..6023ca2 100644 --- a/sig/brand_dev/models/brand_ai_products_response.rbs +++ b/sig/brand_dev/models/brand_ai_products_response.rbs @@ -22,6 +22,7 @@ module BrandDev { description: String, features: ::Array[String], + images: ::Array[String], name: String, tags: ::Array[String], target_audience: ::Array[String], @@ -39,6 +40,8 @@ module BrandDev attr_accessor features: ::Array[String] + attr_accessor images: ::Array[String] + attr_accessor name: String attr_accessor tags: ::Array[String] @@ -62,6 +65,7 @@ module BrandDev def initialize: ( description: String, features: ::Array[String], + images: ::Array[String], name: String, tags: ::Array[String], target_audience: ::Array[String], @@ -77,6 +81,7 @@ module BrandDev def to_hash: -> { description: String, features: ::Array[String], + images: ::Array[String], name: String, tags: ::Array[String], target_audience: ::Array[String], diff --git a/test/brand_dev/resources/brand_test.rb b/test/brand_dev/resources/brand_test.rb index 225d605..00a8b5c 100644 --- a/test/brand_dev/resources/brand_test.rb +++ b/test/brand_dev/resources/brand_test.rb @@ -4,7 +4,7 @@ class BrandDev::Test::Resources::BrandTest < BrandDev::Test::ResourceTest def test_retrieve_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.retrieve(domain: "domain") @@ -22,7 +22,7 @@ def test_retrieve_required_params end def test_ai_product_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.ai_product(url: "https://example.com") @@ -40,7 +40,7 @@ def test_ai_product_required_params end def test_ai_products_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.ai_products(domain: "domain") @@ -56,7 +56,7 @@ def test_ai_products_required_params end def test_ai_query_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.ai_query( @@ -86,7 +86,7 @@ def test_ai_query_required_params end def test_fonts_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.fonts(domain: "domain") @@ -105,7 +105,7 @@ def test_fonts_required_params end def test_identify_from_transaction_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.identify_from_transaction(transaction_info: "transaction_info") @@ -123,7 +123,7 @@ def test_identify_from_transaction_required_params end def test_prefetch_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.prefetch(domain: "domain") @@ -141,7 +141,7 @@ def test_prefetch_required_params end def test_prefetch_by_email_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.prefetch_by_email(email: "dev@stainless.com") @@ -159,7 +159,7 @@ def test_prefetch_by_email_required_params end def test_retrieve_by_email_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.retrieve_by_email(email: "dev@stainless.com") @@ -177,7 +177,7 @@ def test_retrieve_by_email_required_params end def test_retrieve_by_isin_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.retrieve_by_isin(isin: "SE60513A9993") @@ -195,7 +195,7 @@ def test_retrieve_by_isin_required_params end def test_retrieve_by_name_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.retrieve_by_name(name: "xxx") @@ -213,7 +213,7 @@ def test_retrieve_by_name_required_params end def test_retrieve_by_ticker_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.retrieve_by_ticker(ticker: "ticker") @@ -231,7 +231,7 @@ def test_retrieve_by_ticker_required_params end def test_retrieve_naics_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.retrieve_naics(input: "input") @@ -250,7 +250,7 @@ def test_retrieve_naics_required_params end def test_retrieve_simplified_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.retrieve_simplified(domain: "domain") @@ -268,7 +268,7 @@ def test_retrieve_simplified_required_params end def test_screenshot_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.screenshot(domain: "domain") @@ -288,7 +288,7 @@ def test_screenshot_required_params end def test_styleguide_required_params - skip("Prism tests are disabled") + skip("Mock server tests are disabled") response = @brand_dev.brand.styleguide(domain: "domain")