spree_api 5.0.6 → 5.1.0.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/concerns/spree/api/v2/product_list_includes.rb +16 -10
- data/app/controllers/concerns/spree/api/v2/storefront/order_concern.rb +1 -1
- data/app/controllers/spree/api/v2/base_controller.rb +6 -1
- data/app/controllers/spree/api/v2/platform/users_controller.rb +0 -5
- data/app/helpers/spree/api/v2/store_media_serializer_images_concern.rb +1 -0
- data/app/serializers/spree/api/v2/base_serializer.rb +0 -4
- data/app/serializers/spree/api/v2/platform/digital_serializer.rb +1 -0
- data/app/serializers/spree/api/v2/platform/taxon_serializer.rb +1 -1
- data/app/serializers/spree/v2/storefront/taxon_serializer.rb +1 -1
- data/app/serializers/spree/v2/storefront/variant_serializer.rb +1 -1
- data/config/initializers/doorkeeper.rb +1 -1
- metadata +6 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 135a1dc5140d807b83dd4a366141eede834c6d7e3c03979c881c3a5551f750b8
         | 
| 4 | 
            +
              data.tar.gz: fe206c574f166d016107b1d9c1c32000d5b6ff825ee35fd65233adfe9284a87d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 5d77511e3dae8752352fd0124339a8f7737ecb834266bbc136c499c8e55004c93161a0f452a81641db5fb93e684eb3c0820d31a8ede262c2c26a79e4af6fcb1e
         | 
| 7 | 
            +
              data.tar.gz: 24c4f966a8c57d89fc29e5c757a5f831bfc89b8f8d32f054f301027fb3f0fec3bd875d6a3f00681f08d0fdddf313370c0a9a7000e64b5e7b83e688e2233fa31e
         | 
| @@ -3,22 +3,28 @@ module Spree | |
| 3 3 | 
             
                module V2
         | 
| 4 4 | 
             
                  module ProductListIncludes
         | 
| 5 5 | 
             
                    def product_list_includes
         | 
| 6 | 
            -
                      {
         | 
| 7 | 
            -
                         | 
| 8 | 
            -
                         | 
| 9 | 
            -
                         | 
| 10 | 
            -
                        master: product_variant_includes,
         | 
| 11 | 
            -
                        variants: product_variant_includes,
         | 
| 12 | 
            -
                        translations: []
         | 
| 6 | 
            +
                      @product_list_includes ||= {
         | 
| 7 | 
            +
                        taggings: [:tag],
         | 
| 8 | 
            +
                        variants: [],
         | 
| 9 | 
            +
                        master: [:prices]
         | 
| 13 10 | 
             
                      }
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                      @product_list_includes[:variant_images] = [] if params[:include]&.match('images')
         | 
| 13 | 
            +
                      @product_list_includes[:option_types] = [] if params[:include]&.match('option_types')
         | 
| 14 | 
            +
                      @product_list_includes[:product_properties] = [:property] if params[:include]&.match('product_properties')
         | 
| 15 | 
            +
                      @product_list_includes[:master] = variant_includes if params[:include]&.match(/master|default_variant/)
         | 
| 16 | 
            +
                      @product_list_includes[:variants] = variant_includes if params[:include]&.match(/variants|default_variant/)
         | 
| 17 | 
            +
                      @product_list_includes[:taxons] = [:taxonomy, :icon, :store, :rich_text_translations, image_attachment: :blob] if params[:include]&.match('taxons')
         | 
| 18 | 
            +
                      @product_list_includes
         | 
| 14 19 | 
             
                    end
         | 
| 15 20 |  | 
| 16 | 
            -
                    def  | 
| 17 | 
            -
                      {
         | 
| 21 | 
            +
                    def variant_includes
         | 
| 22 | 
            +
                      variant_includes = {
         | 
| 18 23 | 
             
                        prices: [],
         | 
| 19 24 | 
             
                        option_values: :option_type,
         | 
| 20 | 
            -
                        images: []
         | 
| 21 25 | 
             
                      }
         | 
| 26 | 
            +
                      variant_includes[:images] = [] if params[:include]&.match(/images/)
         | 
| 27 | 
            +
                      variant_includes
         | 
| 22 28 | 
             
                    end
         | 
| 23 29 | 
             
                  end
         | 
| 24 30 | 
             
                end
         | 
| @@ -96,7 +96,12 @@ module Spree | |
| 96 96 |  | 
| 97 97 | 
             
                    # Needs to be overridden so that we use Spree's Ability rather than anyone else's.
         | 
| 98 98 | 
             
                    def current_ability
         | 
| 99 | 
            -
                      @current_ability ||= Spree::Dependencies.ability_class.constantize.new(spree_current_user)
         | 
| 99 | 
            +
                      @current_ability ||= Spree::Dependencies.ability_class.constantize.new(spree_current_user, ability_options)
         | 
| 100 | 
            +
                    end
         | 
| 101 | 
            +
             | 
| 102 | 
            +
                    # this method can be extended in extensions or developer applications
         | 
| 103 | 
            +
                    def ability_options
         | 
| 104 | 
            +
                      { store: current_store }
         | 
| 100 105 | 
             
                    end
         | 
| 101 106 |  | 
| 102 107 | 
             
                    def request_includes
         | 
| @@ -25,11 +25,6 @@ module Spree | |
| 25 25 | 
             
                      def spree_permitted_attributes
         | 
| 26 26 | 
             
                        super + [:password, :password_confirmation]
         | 
| 27 27 | 
             
                      end
         | 
| 28 | 
            -
             | 
| 29 | 
            -
                      # we need to override this method to avoid trying to create user role when creating a user
         | 
| 30 | 
            -
                      def ensure_current_store(_resource)
         | 
| 31 | 
            -
                        # do nothing
         | 
| 32 | 
            -
                      end
         | 
| 33 28 | 
             
                    end
         | 
| 34 29 | 
             
                  end
         | 
| 35 30 | 
             
                end
         | 
| @@ -6,7 +6,7 @@ module Spree | |
| 6 6 |  | 
| 7 7 | 
             
                    set_type :variant
         | 
| 8 8 |  | 
| 9 | 
            -
                    attributes :sku, :barcode, :weight, :height, :width, :depth, :is_master, :options_text, : | 
| 9 | 
            +
                    attributes :sku, :barcode, :weight, :height, :width, :depth, :is_master, :options_text, :public_metadata
         | 
| 10 10 |  | 
| 11 11 | 
             
                    attribute :purchasable do |variant|
         | 
| 12 12 | 
             
                      variant.purchasable?
         | 
| @@ -25,7 +25,7 @@ Doorkeeper.configure do | |
| 25 25 | 
             
              end
         | 
| 26 26 |  | 
| 27 27 | 
             
              admin_authenticator do |routes|
         | 
| 28 | 
            -
                current_spree_user&.spree_admin? || redirect_to(routes.root_url)
         | 
| 28 | 
            +
                current_spree_user&.spree_admin?(Spree::Store.current) || redirect_to(routes.root_url)
         | 
| 29 29 | 
             
              end
         | 
| 30 30 |  | 
| 31 31 | 
             
              grant_flows %w[password client_credentials]
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: spree_api
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 5.0. | 
| 4 | 
            +
              version: 5.1.0.beta
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ryan Bigg
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire:
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date: 2025- | 
| 13 | 
            +
            date: 2025-05-20 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: jsonapi-rspec
         | 
| @@ -102,14 +102,14 @@ dependencies: | |
| 102 102 | 
             
                requirements:
         | 
| 103 103 | 
             
                - - '='
         | 
| 104 104 | 
             
                  - !ruby/object:Gem::Version
         | 
| 105 | 
            -
                    version: 5.0. | 
| 105 | 
            +
                    version: 5.1.0.beta
         | 
| 106 106 | 
             
              type: :runtime
         | 
| 107 107 | 
             
              prerelease: false
         | 
| 108 108 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 109 109 | 
             
                requirements:
         | 
| 110 110 | 
             
                - - '='
         | 
| 111 111 | 
             
                  - !ruby/object:Gem::Version
         | 
| 112 | 
            -
                    version: 5.0. | 
| 112 | 
            +
                    version: 5.1.0.beta
         | 
| 113 113 | 
             
            description: Spree's API
         | 
| 114 114 | 
             
            email:
         | 
| 115 115 | 
             
            - hello@spreecommerce.org
         | 
| @@ -364,9 +364,9 @@ licenses: | |
| 364 364 | 
             
            - BSD-3-Clause
         | 
| 365 365 | 
             
            metadata:
         | 
| 366 366 | 
             
              bug_tracker_uri: https://github.com/spree/spree/issues
         | 
| 367 | 
            -
              changelog_uri: https://github.com/spree/spree/releases/tag/v5.0. | 
| 367 | 
            +
              changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta
         | 
| 368 368 | 
             
              documentation_uri: https://docs.spreecommerce.org/
         | 
| 369 | 
            -
              source_code_uri: https://github.com/spree/spree/tree/v5.0. | 
| 369 | 
            +
              source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta
         | 
| 370 370 | 
             
            post_install_message:
         | 
| 371 371 | 
             
            rdoc_options: []
         | 
| 372 372 | 
             
            require_paths:
         |