solidus_api 4.3.5 → 4.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/spree/api/coupon_codes_controller.rb +2 -2
- data/app/controllers/spree/api/orders_controller.rb +7 -2
- data/app/controllers/spree/api/promotions_controller.rb +1 -1
- data/app/controllers/spree/api/variants_controller.rb +1 -1
- data/app/views/spree/api/credit_cards/index.json.jbuilder +1 -1
- data/app/views/spree/api/images/index.json.jbuilder +1 -1
- data/app/views/spree/api/line_items/_line_item.json.jbuilder +2 -2
- data/app/views/spree/api/option_types/index.json.jbuilder +1 -1
- data/app/views/spree/api/option_values/index.json.jbuilder +1 -1
- data/app/views/spree/api/orders/_big.json.jbuilder +6 -6
- data/app/views/spree/api/orders/index.json.jbuilder +1 -1
- data/app/views/spree/api/orders/mine.json.jbuilder +1 -1
- data/app/views/spree/api/products/_product.json.jbuilder +1 -1
- data/app/views/spree/api/products/index.json.jbuilder +1 -1
- data/app/views/spree/api/shipments/_big.json.jbuilder +2 -2
- data/app/views/spree/api/shipments/_small.json.jbuilder +2 -2
- data/app/views/spree/api/shipments/mine.json.jbuilder +1 -1
- data/app/views/spree/api/shipments/show.json.jbuilder +1 -1
- data/app/views/spree/api/stock_items/index.json.jbuilder +1 -1
- data/app/views/spree/api/stock_locations/index.json.jbuilder +1 -1
- data/app/views/spree/api/stock_movements/index.json.jbuilder +1 -1
- data/app/views/spree/api/taxonomies/_nested.json.jbuilder +1 -1
- data/app/views/spree/api/taxonomies/_taxonomy.json.jbuilder +1 -1
- data/app/views/spree/api/taxonomies/index.json.jbuilder +1 -1
- data/app/views/spree/api/taxons/_taxons.json.jbuilder +1 -1
- data/app/views/spree/api/taxons/index.json.jbuilder +1 -1
- data/app/views/spree/api/users/index.json.jbuilder +1 -1
- data/app/views/spree/api/variants/_big.json.jbuilder +1 -1
- data/app/views/spree/api/variants/_small.json.jbuilder +1 -1
- data/app/views/spree/api/variants/index.json.jbuilder +1 -1
- data/app/views/spree/api/zones/index.json.jbuilder +1 -1
- data/lib/spree/api_configuration.rb +13 -6
- data/openapi/solidus-api.oas.yml +0 -4
- data/solidus_api.gemspec +2 -2
- metadata +6 -7
- data/bin/rails +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 465e94668f9d4569b0d86d62018781833b2b3aaa5cd9054b7cb08fbc3e427527
|
4
|
+
data.tar.gz: 8941c7f042864c2bdc06fb71c8fa029dec79928620a21f359b2d197b5b0bfdbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20203cff2aca2b4560995700e128e9a3fcb5f366fe82e4248bacc23d0513285b6378c7c50fde4bf837a2934ba7cc4633ee992200efb1db3f3300b32a394df8c8
|
7
|
+
data.tar.gz: c372bf3b4539959ed54452df5e79d97d76dc57510584b20206a5909de2d86cbeac940344cbeb2afcb40546ee96b0700ac2688748c22d3490d7eb0d9ff2d3d933
|
@@ -10,7 +10,7 @@ module Spree
|
|
10
10
|
authorize! :update, @order, order_token
|
11
11
|
|
12
12
|
@order.coupon_code = params[:coupon_code]
|
13
|
-
@handler = Spree::Config.coupon_code_handler_class.new(@order).apply
|
13
|
+
@handler = Spree::Config.promotions.coupon_code_handler_class.new(@order).apply
|
14
14
|
|
15
15
|
if @handler.successful?
|
16
16
|
render 'spree/api/promotions/handler', status: 200
|
@@ -24,7 +24,7 @@ module Spree
|
|
24
24
|
authorize! :update, @order, order_token
|
25
25
|
|
26
26
|
@order.coupon_code = params[:id]
|
27
|
-
@handler = Spree::Config.coupon_code_handler_class.new(@order).remove
|
27
|
+
@handler = Spree::Config.promotions.coupon_code_handler_class.new(@order).remove
|
28
28
|
|
29
29
|
if @handler.successful?
|
30
30
|
render 'spree/api/promotions/handler', status: 200
|
@@ -46,8 +46,13 @@ module Spree
|
|
46
46
|
|
47
47
|
def empty
|
48
48
|
authorize! :update, @order, order_token
|
49
|
-
|
50
|
-
|
49
|
+
|
50
|
+
if @order.complete?
|
51
|
+
invalid_resource!(@order)
|
52
|
+
else
|
53
|
+
@order.empty!
|
54
|
+
respond_with(@order, default_template: :show)
|
55
|
+
end
|
51
56
|
end
|
52
57
|
|
53
58
|
def index
|
@@ -13,7 +13,7 @@ module Spree
|
|
13
13
|
private
|
14
14
|
|
15
15
|
def load_promotion
|
16
|
-
@promotion = Spree::
|
16
|
+
@promotion = Spree::Config.promotions.promotion_finder_class.by_code_or_id(params[:id])
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -28,7 +28,7 @@ module Spree
|
|
28
28
|
@variants =
|
29
29
|
if params[:variant_search_term]
|
30
30
|
Spree::Config.variant_search_class.new(
|
31
|
-
params[:variant_search_term], scope:
|
31
|
+
params[:variant_search_term], scope:
|
32
32
|
).results.includes(include_list)
|
33
33
|
else
|
34
34
|
scope.includes(include_list).ransack(params[:q]).result
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
json.credit_cards(@credit_cards) do |credit_card|
|
4
|
-
json.partial!("spree/api/credit_cards/credit_card", credit_card:
|
4
|
+
json.partial!("spree/api/credit_cards/credit_card", credit_card:)
|
5
5
|
end
|
6
6
|
json.partial! 'spree/api/shared/pagination', pagination: @credit_cards
|
@@ -9,10 +9,10 @@ json.cache! [I18n.locale, line_item] do
|
|
9
9
|
json.partial!("spree/api/variants/small", variant: line_item.variant)
|
10
10
|
json.(line_item.variant, :product_id)
|
11
11
|
json.images(line_item.variant.gallery.images) do |image|
|
12
|
-
json.partial!("spree/api/images/image", image:
|
12
|
+
json.partial!("spree/api/images/image", image:)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
json.adjustments(line_item.adjustments) do |adjustment|
|
16
|
-
json.partial!("spree/api/adjustments/adjustment", adjustment:
|
16
|
+
json.partial!("spree/api/adjustments/adjustment", adjustment:)
|
17
17
|
end
|
18
18
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
json.partial!("spree/api/orders/order", order:
|
3
|
+
json.partial!("spree/api/orders/order", order:)
|
4
4
|
json.payment_methods(order.available_payment_methods) do |payment_method|
|
5
5
|
json.(payment_method, :id, :name, :partial_name)
|
6
6
|
json.method_type payment_method.partial_name
|
@@ -20,7 +20,7 @@ json.ship_address do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
json.line_items(order.line_items) do |line_item|
|
23
|
-
json.partial!("spree/api/line_items/line_item", line_item:
|
23
|
+
json.partial!("spree/api/line_items/line_item", line_item:)
|
24
24
|
end
|
25
25
|
json.payments(order.payments) do |payment|
|
26
26
|
json.(payment, *payment_attributes)
|
@@ -36,7 +36,7 @@ json.payments(order.payments) do |payment|
|
|
36
36
|
if payment_source
|
37
37
|
json.partial!(
|
38
38
|
"spree/api/payments/source_views/#{payment.payment_method.partial_name}",
|
39
|
-
payment_source:
|
39
|
+
payment_source:
|
40
40
|
)
|
41
41
|
else
|
42
42
|
json.nil!
|
@@ -44,14 +44,14 @@ json.payments(order.payments) do |payment|
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
json.shipments(order.shipments) do |shipment|
|
47
|
-
json.partial!("spree/api/shipments/small", shipment:
|
47
|
+
json.partial!("spree/api/shipments/small", shipment:)
|
48
48
|
end
|
49
49
|
json.adjustments(order.adjustments) do |adjustment|
|
50
|
-
json.partial!("spree/api/adjustments/adjustment", adjustment:
|
50
|
+
json.partial!("spree/api/adjustments/adjustment", adjustment:)
|
51
51
|
end
|
52
52
|
json.permissions do
|
53
53
|
json.can_update current_ability.can?(:update, order)
|
54
54
|
end
|
55
55
|
json.credit_cards(order.valid_credit_cards) do |credit_card|
|
56
|
-
json.partial!("spree/api/credit_cards/credit_card", credit_card:
|
56
|
+
json.partial!("spree/api/credit_cards/credit_card", credit_card:)
|
57
57
|
end
|
@@ -14,7 +14,7 @@ json.cache! [I18n.locale, @current_user_roles.include?('admin'), current_pricing
|
|
14
14
|
json.partial!("spree/api/variants/small", variant: product.master)
|
15
15
|
end
|
16
16
|
json.variants(product.variants) do |variant|
|
17
|
-
json.partial!("spree/api/variants/small", variant:
|
17
|
+
json.partial!("spree/api/variants/small", variant:)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
unless @exclude_data[:option_types]
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
json.cache! [I18n.locale, shipment] do
|
4
4
|
json.(shipment, *shipment_attributes)
|
5
|
-
json.partial!("spree/api/shipments/small", shipment:
|
5
|
+
json.partial!("spree/api/shipments/small", shipment:)
|
6
6
|
json.inventory_units(shipment.inventory_units) do |inventory_unit|
|
7
7
|
json.(inventory_unit, *inventory_unit_attributes)
|
8
8
|
json.variant do
|
9
9
|
json.partial!("spree/api/variants/small", variant: inventory_unit.variant)
|
10
10
|
json.(inventory_unit.variant, :product_id)
|
11
11
|
json.images(inventory_unit.variant.gallery.images) do |image|
|
12
|
-
json.partial!("spree/api/images/image", image:
|
12
|
+
json.partial!("spree/api/images/image", image:)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
json.line_item do
|
@@ -5,7 +5,7 @@ json.cache! [I18n.locale, shipment] do
|
|
5
5
|
json.order_id(shipment.order.number)
|
6
6
|
json.stock_location_name(shipment.stock_location.name)
|
7
7
|
json.shipping_rates(shipment.shipping_rates) do |shipping_rate|
|
8
|
-
json.partial!("spree/api/shipping_rates/shipping_rate", shipping_rate:
|
8
|
+
json.partial!("spree/api/shipping_rates/shipping_rate", shipping_rate:)
|
9
9
|
end
|
10
10
|
json.selected_shipping_rate do
|
11
11
|
if shipment.selected_shipping_rate
|
@@ -29,6 +29,6 @@ json.cache! [I18n.locale, shipment] do
|
|
29
29
|
json.states(manifest_item.states)
|
30
30
|
end
|
31
31
|
json.adjustments(shipment.adjustments) do |adjustment|
|
32
|
-
json.partial!("spree/api/adjustments/adjustment", adjustment:
|
32
|
+
json.partial!("spree/api/adjustments/adjustment", adjustment:)
|
33
33
|
end
|
34
34
|
end
|
@@ -5,7 +5,7 @@ json.cache! [I18n.locale, @shipment] do
|
|
5
5
|
json.order_id(@shipment.order.number)
|
6
6
|
json.stock_location_name(@shipment.stock_location.name)
|
7
7
|
json.shipping_rates(@shipment.shipping_rates) do |shipping_rate|
|
8
|
-
json.partial!("spree/api/shipping_rates/shipping_rate", shipping_rate:
|
8
|
+
json.partial!("spree/api/shipping_rates/shipping_rate", shipping_rate:)
|
9
9
|
end
|
10
10
|
json.selected_shipping_rate do
|
11
11
|
if @shipment.selected_shipping_rate
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
json.stock_items(@stock_items) do |stock_item|
|
4
|
-
json.partial!("spree/api/stock_items/stock_item", stock_item:
|
4
|
+
json.partial!("spree/api/stock_items/stock_item", stock_item:)
|
5
5
|
end
|
6
6
|
json.partial! 'spree/api/shared/pagination', pagination: @stock_items
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
json.stock_locations(@stock_locations) do |stock_location|
|
4
|
-
json.partial!("spree/api/stock_locations/stock_location", stock_location:
|
4
|
+
json.partial!("spree/api/stock_locations/stock_location", stock_location:)
|
5
5
|
end
|
6
6
|
json.partial! 'spree/api/shared/pagination', pagination: @stock_locations
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
json.stock_movements(@stock_movements) do |stock_movement|
|
4
|
-
json.partial!("spree/api/stock_movements/stock_movement", stock_movement:
|
4
|
+
json.partial!("spree/api/stock_movements/stock_movement", stock_movement:)
|
5
5
|
end
|
6
6
|
json.partial! 'spree/api/shared/pagination', pagination: @stock_movements
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
json.taxonomies(@taxonomies) do |taxonomy|
|
4
|
-
json.partial!("spree/api/taxonomies/taxonomy", taxonomy:
|
4
|
+
json.partial!("spree/api/taxonomies/taxonomy", taxonomy:)
|
5
5
|
end
|
6
6
|
json.partial! 'spree/api/shared/pagination', pagination: @taxonomies
|
@@ -4,6 +4,6 @@ json.partial! 'spree/api/shared/pagination', pagination: @taxons
|
|
4
4
|
json.taxons(@taxons) do |taxon|
|
5
5
|
json.(taxon, *taxon_attributes)
|
6
6
|
unless params[:without_children]
|
7
|
-
json.partial!("spree/api/taxons/taxons", taxon:
|
7
|
+
json.partial!("spree/api/taxons/taxons", taxon:)
|
8
8
|
end
|
9
9
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
json.cache! [I18n.locale, Spree::StockLocation.accessible_by(current_ability), variant] do
|
4
4
|
json.(variant, *variant_attributes)
|
5
|
-
json.partial!("spree/api/variants/small", variant:
|
5
|
+
json.partial!("spree/api/variants/small", variant:)
|
6
6
|
json.variant_properties(variant.variant_properties) do |variant_property|
|
7
7
|
json.(variant_property, *variant_property_attributes)
|
8
8
|
end
|
@@ -16,6 +16,6 @@ json.cache! [I18n.locale, current_pricing_options, variant] do
|
|
16
16
|
json.(option_value, *option_value_attributes)
|
17
17
|
end
|
18
18
|
json.images(variant.gallery.images) do |image|
|
19
|
-
json.partial!("spree/api/images/image", image:
|
19
|
+
json.partial!("spree/api/images/image", image:)
|
20
20
|
end
|
21
21
|
end
|
@@ -72,8 +72,8 @@ module Spree
|
|
72
72
|
|
73
73
|
preference :adjustment_attributes, :array, default: [
|
74
74
|
:id, :source_type, :source_id, :adjustable_type, :adjustable_id,
|
75
|
-
:amount, :label,
|
76
|
-
:finalized, :
|
75
|
+
:amount, :label,
|
76
|
+
:finalized, :created_at, :updated_at
|
77
77
|
]
|
78
78
|
|
79
79
|
preference :inventory_unit_attributes, :array, default: [
|
@@ -112,10 +112,17 @@ module Spree
|
|
112
112
|
:variant_id
|
113
113
|
]
|
114
114
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
115
|
+
def promotion_attributes
|
116
|
+
Spree::Config.promotions.promotion_api_attributes
|
117
|
+
end
|
118
|
+
alias_method :preferred_promotion_attributes, :promotion_attributes
|
119
|
+
|
120
|
+
def promotion_attributes=(value)
|
121
|
+
Spree::Config.promotions.promotion_api_attributes = value
|
122
|
+
end
|
123
|
+
alias_method :preferred_promotion_attributes=, :promotion_attributes=
|
124
|
+
promotion_attributes_deprecation_message = "Spree::ApiConfiguration#promotion_attributes= is deprecated. Please use Spree::Config.promotions.promotion_api_attributes= instead."
|
125
|
+
deprecate "promotion_attributes=" => promotion_attributes_deprecation_message, deprecator: Spree.deprecator
|
119
126
|
|
120
127
|
preference :store_attributes, :array, default: [
|
121
128
|
:id, :name, :url, :meta_description, :meta_keywords, :seo_title,
|
data/openapi/solidus-api.oas.yml
CHANGED
@@ -6118,16 +6118,12 @@ components:
|
|
6118
6118
|
type: string
|
6119
6119
|
display_amount:
|
6120
6120
|
type: string
|
6121
|
-
eligible:
|
6122
|
-
type: boolean
|
6123
6121
|
finalized:
|
6124
6122
|
type: boolean
|
6125
6123
|
id:
|
6126
6124
|
type: integer
|
6127
6125
|
label:
|
6128
6126
|
type: string
|
6129
|
-
promotion_code_id:
|
6130
|
-
type: integer
|
6131
6127
|
source_id:
|
6132
6128
|
type: integer
|
6133
6129
|
source_type:
|
data/solidus_api.gemspec
CHANGED
@@ -17,10 +17,10 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.metadata['rubygems_mfa_required'] = 'true'
|
18
18
|
|
19
19
|
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
20
|
-
f.match(%r{^(spec|
|
20
|
+
f.match(%r{^(spec|bin)/})
|
21
21
|
end
|
22
22
|
|
23
|
-
s.required_ruby_version = '>= 3.
|
23
|
+
s.required_ruby_version = '>= 3.1.0'
|
24
24
|
s.required_rubygems_version = '>= 1.8.23'
|
25
25
|
|
26
26
|
s.add_dependency 'jbuilder', '~> 2.8'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jbuilder
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.
|
61
|
+
version: 4.4.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.
|
68
|
+
version: 4.4.1
|
69
69
|
description: REST API for the Solidus e-commerce framework.
|
70
70
|
email: contact@solidus.io
|
71
71
|
executables: []
|
@@ -224,7 +224,6 @@ files:
|
|
224
224
|
- app/views/spree/api/zones/_zone.json.jbuilder
|
225
225
|
- app/views/spree/api/zones/index.json.jbuilder
|
226
226
|
- app/views/spree/api/zones/show.json.jbuilder
|
227
|
-
- bin/rails
|
228
227
|
- config/i18n-tasks.yml
|
229
228
|
- config/locales/en.yml
|
230
229
|
- config/routes.rb
|
@@ -266,14 +265,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
266
265
|
requirements:
|
267
266
|
- - ">="
|
268
267
|
- !ruby/object:Gem::Version
|
269
|
-
version: 3.
|
268
|
+
version: 3.1.0
|
270
269
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
271
270
|
requirements:
|
272
271
|
- - ">="
|
273
272
|
- !ruby/object:Gem::Version
|
274
273
|
version: 1.8.23
|
275
274
|
requirements: []
|
276
|
-
rubygems_version: 3.5.
|
275
|
+
rubygems_version: 3.5.22
|
277
276
|
signing_key:
|
278
277
|
specification_version: 4
|
279
278
|
summary: REST API for the Solidus e-commerce framework.
|
data/bin/rails
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails gems
|
3
|
-
# installed from the root of your application.
|
4
|
-
|
5
|
-
ENGINE_ROOT = File.expand_path('..', __dir__)
|
6
|
-
ENGINE_PATH = File.expand_path('../lib/spree/api/engine', __dir__)
|
7
|
-
|
8
|
-
# Set up gems listed in the Gemfile.
|
9
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
|
10
|
-
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
11
|
-
|
12
|
-
require "rails/all"
|
13
|
-
require "rails/engine/commands"
|