solidus_api 2.3.1 → 2.4.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_api might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/spree/api/base_controller.rb +9 -12
- data/app/controllers/spree/api/checkouts_controller.rb +3 -5
- data/app/controllers/spree/api/orders_controller.rb +2 -12
- data/app/controllers/spree/api/payments_controller.rb +0 -1
- data/app/controllers/spree/api/resource_controller.rb +2 -0
- data/app/controllers/spree/api/shipments_controller.rb +17 -6
- data/app/controllers/spree/api/stock_items_controller.rb +6 -0
- data/app/helpers/spree/api/api_helpers.rb +3 -4
- data/app/views/.rubocop.yml +4 -0
- data/app/views/spree/api/address_books/show.json.jbuilder +11 -0
- data/app/views/spree/api/addresses/_address.json.jbuilder +17 -0
- data/app/views/spree/api/addresses/show.json.jbuilder +1 -0
- data/app/views/spree/api/adjustments/_adjustment.json.jbuilder +4 -0
- data/app/views/spree/api/config/money.json.jbuilder +1 -0
- data/app/views/spree/api/config/show.json.jbuilder +2 -0
- data/app/views/spree/api/countries/index.json.jbuilder +2 -0
- data/app/views/spree/api/countries/show.json.jbuilder +4 -0
- data/app/views/spree/api/credit_cards/_credit_card.json.jbuilder +10 -0
- data/app/views/spree/api/credit_cards/index.json.jbuilder +4 -0
- data/app/views/spree/api/credit_cards/show.json.jbuilder +1 -0
- data/app/views/spree/api/errors/delete_restriction.json.jbuilder +1 -0
- data/app/views/spree/api/errors/gateway_error.json.jbuilder +1 -0
- data/app/views/spree/api/errors/invalid_api_key.json.jbuilder +1 -0
- data/app/views/spree/api/errors/invalid_resource.json.jbuilder +2 -0
- data/app/views/spree/api/errors/must_specify_api_key.json.jbuilder +1 -0
- data/app/views/spree/api/errors/not_found.json.jbuilder +1 -0
- data/app/views/spree/api/errors/unauthorized.json.jbuilder +1 -0
- data/app/views/spree/api/errors/variant_not_in_stock_transfer.json.jbuilder +1 -0
- data/app/views/spree/api/images/_image.json.jbuilder +5 -0
- data/app/views/spree/api/images/index.json.jbuilder +3 -0
- data/app/views/spree/api/images/show.json.jbuilder +1 -0
- data/app/views/spree/api/inventory_units/show.json.jbuilder +1 -0
- data/app/views/spree/api/line_items/_line_item.json.jbuilder +16 -0
- data/app/views/spree/api/line_items/new.json.jbuilder +2 -0
- data/app/views/spree/api/line_items/show.json.jbuilder +1 -0
- data/app/views/spree/api/option_types/_option_type.json.jbuilder +4 -0
- data/app/views/spree/api/option_types/index.json.jbuilder +3 -0
- data/app/views/spree/api/option_types/show.json.jbuilder +1 -0
- data/app/views/spree/api/option_values/_option_value.json.jbuilder +1 -0
- data/app/views/spree/api/option_values/index.json.jbuilder +3 -0
- data/app/views/spree/api/option_values/show.json.jbuilder +1 -0
- data/app/views/spree/api/orders/_big.json.jbuilder +49 -0
- data/app/views/spree/api/orders/_order.json.jbuilder +10 -0
- data/app/views/spree/api/orders/could_not_apply_coupon.json.jbuilder +1 -0
- data/app/views/spree/api/orders/could_not_transition.json.jbuilder +2 -0
- data/app/views/spree/api/orders/expected_total_mismatch.json.jbuilder +1 -0
- data/app/views/spree/api/orders/index.json.jbuilder +4 -0
- data/app/views/spree/api/orders/invalid_shipping_method.json.jbuilder +1 -0
- data/app/views/spree/api/orders/mine.json.jbuilder +4 -0
- data/app/views/spree/api/orders/show.json.jbuilder +1 -0
- data/app/views/spree/api/payments/credit_over_limit.json.jbuilder +1 -0
- data/app/views/spree/api/payments/index.json.jbuilder +2 -0
- data/app/views/spree/api/payments/new.json.jbuilder +4 -0
- data/app/views/spree/api/payments/show.json.jbuilder +1 -0
- data/app/views/spree/api/payments/update_forbidden.json.jbuilder +1 -0
- data/app/views/spree/api/product_properties/index.json.jbuilder +4 -0
- data/app/views/spree/api/product_properties/new.json.jbuilder +2 -0
- data/app/views/spree/api/product_properties/show.json.jbuilder +1 -0
- data/app/views/spree/api/products/_product.json.jbuilder +34 -0
- data/app/views/spree/api/products/index.json.jbuilder +4 -0
- data/app/views/spree/api/products/new.json.jbuilder +2 -0
- data/app/views/spree/api/products/show.json.jbuilder +1 -0
- data/app/views/spree/api/promotions/handler.json.jbuilder +4 -0
- data/app/views/spree/api/promotions/show.json.jbuilder +1 -0
- data/app/views/spree/api/properties/index.json.jbuilder +4 -0
- data/app/views/spree/api/properties/new.json.jbuilder +2 -0
- data/app/views/spree/api/properties/show.json.jbuilder +1 -0
- data/app/views/spree/api/return_authorizations/index.json.jbuilder +4 -0
- data/app/views/spree/api/return_authorizations/new.json.jbuilder +2 -0
- data/app/views/spree/api/return_authorizations/show.json.jbuilder +1 -0
- data/app/views/spree/api/shared/_pagination.json.jbuilder +5 -0
- data/app/views/spree/api/shipments/_big.json.jbuilder +51 -0
- data/app/views/spree/api/shipments/_small.json.jbuilder +32 -0
- data/app/views/spree/api/shipments/cannot_ready_shipment.json.jbuilder +1 -0
- data/app/views/spree/api/shipments/mine.json.jbuilder +4 -0
- data/app/views/spree/api/shipments/show.json.jbuilder +31 -0
- data/app/views/spree/api/shipping_rates/_shipping_rate.json.jbuilder +2 -0
- data/app/views/spree/api/states/index.json.jbuilder +5 -0
- data/app/views/spree/api/states/show.json.jbuilder +1 -0
- data/app/views/spree/api/stock_items/_stock_item.json.jbuilder +4 -0
- data/app/views/spree/api/stock_items/index.json.jbuilder +4 -0
- data/app/views/spree/api/stock_items/show.json.jbuilder +1 -0
- data/app/views/spree/api/stock_locations/_stock_location.json.jbuilder +15 -0
- data/app/views/spree/api/stock_locations/index.json.jbuilder +4 -0
- data/app/views/spree/api/stock_locations/show.json.jbuilder +1 -0
- data/app/views/spree/api/stock_movements/_stock_movement.json.jbuilder +4 -0
- data/app/views/spree/api/stock_movements/index.json.jbuilder +4 -0
- data/app/views/spree/api/stock_movements/show.json.jbuilder +1 -0
- data/app/views/spree/api/stock_transfers/receive.json.jbuilder +4 -0
- data/app/views/spree/api/store_credit_events/mine.json.jbuilder +5 -0
- data/app/views/spree/api/stores/index.json.jbuilder +1 -0
- data/app/views/spree/api/stores/show.json.jbuilder +1 -0
- data/app/views/spree/api/taxonomies/_nested.json.jbuilder +8 -0
- data/app/views/spree/api/taxonomies/_taxonomy.json.jbuilder +11 -0
- data/app/views/spree/api/taxonomies/index.json.jbuilder +4 -0
- data/app/views/spree/api/taxonomies/jstree.json.jbuilder +6 -0
- data/app/views/spree/api/taxonomies/new.json.jbuilder +2 -0
- data/app/views/spree/api/taxonomies/show.json.jbuilder +1 -0
- data/app/views/spree/api/taxons/_taxon.json.jbuilder +2 -0
- data/app/views/spree/api/taxons/_taxons.json.jbuilder +4 -0
- data/app/views/spree/api/taxons/index.json.jbuilder +7 -0
- data/app/views/spree/api/taxons/jstree.json.jbuilder +8 -0
- data/app/views/spree/api/taxons/new.json.jbuilder +2 -0
- data/app/views/spree/api/taxons/show.json.jbuilder +1 -0
- data/app/views/spree/api/transfer_items/_transfer_item.json.jbuilder +5 -0
- data/app/views/spree/api/transfer_items/show.json.jbuilder +1 -0
- data/app/views/spree/api/users/_user.json.jbuilder +15 -0
- data/app/views/spree/api/users/index.json.jbuilder +4 -0
- data/app/views/spree/api/users/new.json.jbuilder +2 -0
- data/app/views/spree/api/users/show.json.jbuilder +1 -0
- data/app/views/spree/api/variants/_big.json.jbuilder +13 -0
- data/app/views/spree/api/variants/_small.json.jbuilder +16 -0
- data/app/views/spree/api/variants/index.json.jbuilder +4 -0
- data/app/views/spree/api/variants/new.json.jbuilder +2 -0
- data/app/views/spree/api/variants/show.json.jbuilder +1 -0
- data/app/views/spree/api/zones/_zone.json.jbuilder +4 -0
- data/app/views/spree/api/zones/index.json.jbuilder +4 -0
- data/app/views/spree/api/zones/show.json.jbuilder +1 -0
- data/config/locales/en.yml +1 -0
- data/lib/spree/api/engine.rb +0 -14
- data/lib/spree/api.rb +1 -1
- data/lib/spree_api.rb +1 -0
- data/solidus_api.gemspec +3 -1
- data/spec/controllers/spree/api/base_controller_spec.rb +0 -56
- data/spec/requests/spree/api/checkouts_controller_spec.rb +8 -13
- data/spec/requests/spree/api/orders_controller_spec.rb +7 -60
- data/spec/requests/spree/api/payments_controller_spec.rb +0 -11
- data/spec/requests/spree/api/shipments_controller_spec.rb +16 -1
- data/spec/requests/spree/api/states_controller_spec.rb +1 -0
- data/spec/requests/spree/api/taxons_controller_spec.rb +25 -0
- data/spec/requests/spree/api/users_controller_spec.rb +1 -1
- data/spec/support/be_paginated_matcher.rb +7 -0
- data/spec/test_views/spree/api/widgets/_widget.json.jbuilder +1 -0
- data/spec/test_views/spree/api/widgets/index.json.jbuilder +7 -0
- data/spec/test_views/spree/api/widgets/new.json.jbuilder +1 -0
- data/spec/test_views/spree/api/widgets/show.json.jbuilder +1 -0
- metadata +166 -111
- data/app/views/spree/api/address_books/show.v1.rabl +0 -7
- data/app/views/spree/api/addresses/show.v1.rabl +0 -10
- data/app/views/spree/api/adjustments/show.v1.rabl +0 -4
- data/app/views/spree/api/config/money.v1.rabl +0 -2
- data/app/views/spree/api/config/show.v1.rabl +0 -3
- data/app/views/spree/api/countries/index.v1.rabl +0 -7
- data/app/views/spree/api/countries/show.v1.rabl +0 -5
- data/app/views/spree/api/credit_cards/index.v1.rabl +0 -7
- data/app/views/spree/api/credit_cards/show.v1.rabl +0 -7
- data/app/views/spree/api/errors/gateway_error.v1.rabl +0 -2
- data/app/views/spree/api/errors/invalid_api_key.v1.rabl +0 -2
- data/app/views/spree/api/errors/invalid_resource.v1.rabl +0 -3
- data/app/views/spree/api/errors/must_specify_api_key.v1.rabl +0 -2
- data/app/views/spree/api/errors/not_found.v1.rabl +0 -2
- data/app/views/spree/api/errors/unauthorized.v1.rabl +0 -2
- data/app/views/spree/api/errors/variant_not_in_stock_transfer.v1.rabl +0 -2
- data/app/views/spree/api/images/index.v1.rabl +0 -4
- data/app/views/spree/api/images/show.v1.rabl +0 -6
- data/app/views/spree/api/inventory_units/show.rabl +0 -2
- data/app/views/spree/api/line_items/new.v1.rabl +0 -3
- data/app/views/spree/api/line_items/show.v1.rabl +0 -15
- data/app/views/spree/api/option_types/index.v1.rabl +0 -3
- data/app/views/spree/api/option_types/show.v1.rabl +0 -5
- data/app/views/spree/api/option_values/index.v1.rabl +0 -3
- data/app/views/spree/api/option_values/show.v1.rabl +0 -2
- data/app/views/spree/api/orders/could_not_apply_coupon.v1.rabl +0 -2
- data/app/views/spree/api/orders/could_not_transition.v1.rabl +0 -3
- data/app/views/spree/api/orders/expected_total_mismatch.v1.rabl +0 -2
- data/app/views/spree/api/orders/index.v1.rabl +0 -7
- data/app/views/spree/api/orders/invalid_shipping_method.v1.rabl +0 -2
- data/app/views/spree/api/orders/mine.v1.rabl +0 -9
- data/app/views/spree/api/orders/order.v1.rabl +0 -9
- data/app/views/spree/api/orders/show.v1.rabl +0 -53
- data/app/views/spree/api/payments/credit_over_limit.v1.rabl +0 -2
- data/app/views/spree/api/payments/index.v1.rabl +0 -7
- data/app/views/spree/api/payments/new.v1.rabl +0 -5
- data/app/views/spree/api/payments/show.v1.rabl +0 -2
- data/app/views/spree/api/payments/update_forbidden.v1.rabl +0 -2
- data/app/views/spree/api/product_properties/index.v1.rabl +0 -7
- data/app/views/spree/api/product_properties/new.v1.rabl +0 -2
- data/app/views/spree/api/product_properties/show.v1.rabl +0 -2
- data/app/views/spree/api/products/index.v1.rabl +0 -9
- data/app/views/spree/api/products/new.v1.rabl +0 -3
- data/app/views/spree/api/products/product.v1.rabl +0 -1
- data/app/views/spree/api/products/show.v1.rabl +0 -42
- data/app/views/spree/api/promotions/handler.v1.rabl +0 -5
- data/app/views/spree/api/promotions/show.v1.rabl +0 -2
- data/app/views/spree/api/properties/index.v1.rabl +0 -7
- data/app/views/spree/api/properties/new.v1.rabl +0 -2
- data/app/views/spree/api/properties/show.v1.rabl +0 -2
- data/app/views/spree/api/return_authorizations/index.v1.rabl +0 -7
- data/app/views/spree/api/return_authorizations/new.v1.rabl +0 -3
- data/app/views/spree/api/return_authorizations/show.v1.rabl +0 -2
- data/app/views/spree/api/shipments/big.v1.rabl +0 -55
- data/app/views/spree/api/shipments/cannot_ready_shipment.v1.rabl +0 -2
- data/app/views/spree/api/shipments/mine.v1.rabl +0 -9
- data/app/views/spree/api/shipments/show.v1.rabl +0 -32
- data/app/views/spree/api/shipments/small.v1.rabl +0 -37
- data/app/views/spree/api/shipping_rates/show.v1.rabl +0 -2
- data/app/views/spree/api/states/index.v1.rabl +0 -14
- data/app/views/spree/api/states/show.v1.rabl +0 -2
- data/app/views/spree/api/stock_items/index.v1.rabl +0 -7
- data/app/views/spree/api/stock_items/show.v1.rabl +0 -5
- data/app/views/spree/api/stock_locations/index.v1.rabl +0 -7
- data/app/views/spree/api/stock_locations/show.v1.rabl +0 -8
- data/app/views/spree/api/stock_movements/index.v1.rabl +0 -7
- data/app/views/spree/api/stock_movements/show.v1.rabl +0 -5
- data/app/views/spree/api/stock_transfers/receive.v1.rabl +0 -5
- data/app/views/spree/api/store_credit_events/mine.v1.rabl +0 -10
- data/app/views/spree/api/stores/index.v1.rabl +0 -4
- data/app/views/spree/api/stores/show.v1.rabl +0 -2
- data/app/views/spree/api/taxonomies/index.v1.rabl +0 -7
- data/app/views/spree/api/taxonomies/jstree.rabl +0 -8
- data/app/views/spree/api/taxonomies/nested.v1.rabl +0 -11
- data/app/views/spree/api/taxonomies/new.v1.rabl +0 -3
- data/app/views/spree/api/taxonomies/show.v1.rabl +0 -15
- data/app/views/spree/api/taxons/index.v1.rabl +0 -12
- data/app/views/spree/api/taxons/jstree.rabl +0 -8
- data/app/views/spree/api/taxons/new.v1.rabl +0 -3
- data/app/views/spree/api/taxons/show.v1.rabl +0 -6
- data/app/views/spree/api/taxons/taxons.v1.rabl +0 -5
- data/app/views/spree/api/transfer_items/show.v1.rabl +0 -6
- data/app/views/spree/api/users/index.v1.rabl +0 -7
- data/app/views/spree/api/users/new.v1.rabl +0 -3
- data/app/views/spree/api/users/show.v1.rabl +0 -10
- data/app/views/spree/api/variants/big.v1.rabl +0 -20
- data/app/views/spree/api/variants/index.v1.rabl +0 -9
- data/app/views/spree/api/variants/new.v1.rabl +0 -2
- data/app/views/spree/api/variants/show.v1.rabl +0 -3
- data/app/views/spree/api/variants/small.v1.rabl +0 -17
- data/app/views/spree/api/zones/index.v1.rabl +0 -7
- data/app/views/spree/api/zones/show.v1.rabl +0 -6
- data/config/initializers/rails5_rabl_hacks.rb +0 -12
- data/spec/test_views/spree/api/widgets/index.v1.rabl +0 -7
- data/spec/test_views/spree/api/widgets/new.v1.rabl +0 -2
- data/spec/test_views/spree/api/widgets/show.v1.rabl +0 -2
@@ -1,15 +0,0 @@
|
|
1
|
-
object @taxonomy
|
2
|
-
|
3
|
-
if params[:set] == 'nested'
|
4
|
-
extends "spree/api/taxonomies/nested"
|
5
|
-
else
|
6
|
-
attributes *taxonomy_attributes
|
7
|
-
|
8
|
-
child :root => :root do
|
9
|
-
attributes *taxon_attributes
|
10
|
-
|
11
|
-
child :children => :taxons do
|
12
|
-
attributes *taxon_attributes
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
object false
|
2
|
-
node(:count) { @taxons.count }
|
3
|
-
node(:total_count) { @taxons.total_count }
|
4
|
-
node(:current_page) { @taxons.current_page }
|
5
|
-
node(:per_page) { @taxons.limit_value }
|
6
|
-
node(:pages) { @taxons.total_pages }
|
7
|
-
child @taxons => :taxons do
|
8
|
-
attributes *taxon_attributes
|
9
|
-
unless params[:without_children]
|
10
|
-
extends "spree/api/taxons/taxons"
|
11
|
-
end
|
12
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
object @variant
|
2
|
-
attributes *variant_attributes
|
3
|
-
|
4
|
-
cache [I18n.locale, Spree::StockLocation.accessible_by(current_ability).pluck(:id).sort.join(":"), 'big_variant', root_object]
|
5
|
-
|
6
|
-
extends "spree/api/variants/small"
|
7
|
-
|
8
|
-
node :total_on_hand do
|
9
|
-
root_object.total_on_hand
|
10
|
-
end
|
11
|
-
|
12
|
-
child :variant_properties => :variant_properties do
|
13
|
-
attributes *variant_property_attributes
|
14
|
-
end
|
15
|
-
|
16
|
-
child(root_object.stock_items.accessible_by(current_ability) => :stock_items) do
|
17
|
-
attributes :id, :count_on_hand, :stock_location_id, :backorderable
|
18
|
-
attribute :available? => :available
|
19
|
-
node(:stock_location_name) { |si| si.stock_location.name }
|
20
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
cache [I18n.locale, 'small_variant', root_object]
|
2
|
-
|
3
|
-
attributes *variant_attributes
|
4
|
-
|
5
|
-
node(:display_price) { |p| p.display_price.to_s }
|
6
|
-
node(:options_text) { |v| v.options_text }
|
7
|
-
node(:track_inventory) { |v| v.should_track_inventory? }
|
8
|
-
node(:in_stock) { |v| v.in_stock? }
|
9
|
-
node(:is_backorderable) { |v| v.is_backorderable? }
|
10
|
-
node(:total_on_hand) { |v| v.total_on_hand }
|
11
|
-
node(:is_destroyed) { |v| v.destroyed? }
|
12
|
-
|
13
|
-
child :option_values => :option_values do
|
14
|
-
attributes *option_value_attributes
|
15
|
-
end
|
16
|
-
|
17
|
-
child(:images => :images) { extends "spree/api/images/show" }
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# As of 2016-08-17 rabl is broken on rails 5.
|
2
|
-
# This prevents errors when caching is enabled
|
3
|
-
if Rabl::VERSION == "0.13.0"
|
4
|
-
# Remove the broken redefinition of digest
|
5
|
-
Rabl::Digestor.class_eval do
|
6
|
-
class << self
|
7
|
-
remove_method :digest
|
8
|
-
end
|
9
|
-
end
|
10
|
-
else
|
11
|
-
raise "Remove this monkey patch"
|
12
|
-
end
|