solidus_api 3.1.6 → 3.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5842463fe19ad3ed6e40a17cec071ee0db35792d0a822a3c9fc947e1490852e6
4
- data.tar.gz: 48fb23dcdd1fd8698b89aff4d67817ad732215a98b72538693560c1fc35cc51d
3
+ metadata.gz: 5013de8740c49982532c209f0c13dd9b696ec0143fc2c77ee1cbef4733f5c536
4
+ data.tar.gz: f867390bfd7b2d7ec4b71af392db24f8b515e310eb545f0cc9c3be1516439b1d
5
5
  SHA512:
6
- metadata.gz: ca46b69dd611206ec1b01c23e1088a84ec42443dea0cb2a5608fa9eb44977d54f2997de358a4aa3816af163e12728a6ed2da633678af6f5b1453c21a5d4416b1
7
- data.tar.gz: 04c303d574cbe7884953ab08a1ea3b18e6804a1b2d0c0ee8fd1e82118866bcb81a37caa092c3223aba04a35c42a8282e27cb13ee26cebb644b0dfde30fc42291
6
+ metadata.gz: 12a41b53a78b71cb35a39c32f0b7851daf8954cf252398c3f28a4888182d55ded4ba8ffe77ce2e360e93b8bb0833dcd15ba1b073d775a698b46f21f676ebb374
7
+ data.tar.gz: b8107700365be3377a56d8afb6b8f341ed686346bbb9a9b4ad73a3bfcff1a099f91e344863a3bceb256fcaf513941ae948542d25f413477f7b64230027cbd3c6
data/README.md CHANGED
@@ -40,5 +40,5 @@ version is released.
40
40
  easily extend it with the endpoints provided by your Solidus extensions!
41
41
 
42
42
  [docs-dir]: https://github.com/solidusio/solidus/tree/master/api/openapi
43
- [live-docs]: https://solidus.docs.stoplight.io
43
+ [live-docs]: https://solidus.stoplight.io
44
44
  [studio]: https://stoplight.io/p/studio
@@ -13,11 +13,20 @@ module Spree
13
13
  end
14
14
 
15
15
  def show
16
+ warn_if_nested_member_route
17
+
16
18
  @option_value = scope.find(params[:id])
17
19
  respond_with(@option_value)
18
20
  end
19
21
 
20
22
  def create
23
+ Spree::Deprecation.warn <<~MSG unless request.path.include?('/option_types/')
24
+ This route is deprecated, as it'll be no longer possible to create an
25
+ option_value without an associated option_type. Please, use instead:
26
+
27
+ POST api/option_types/{option_type_id}/option_values
28
+ MSG
29
+
21
30
  authorize! :create, Spree::OptionValue
22
31
  @option_value = scope.new(option_value_params)
23
32
  if @option_value.save
@@ -28,6 +37,8 @@ module Spree
28
37
  end
29
38
 
30
39
  def update
40
+ warn_if_nested_member_route
41
+
31
42
  @option_value = scope.accessible_by(current_ability, :update).find(params[:id])
32
43
  if @option_value.update(option_value_params)
33
44
  render :show
@@ -37,6 +48,8 @@ module Spree
37
48
  end
38
49
 
39
50
  def destroy
51
+ warn_if_nested_member_route
52
+
40
53
  @option_value = scope.accessible_by(current_ability, :destroy).find(params[:id])
41
54
  @option_value.destroy
42
55
  render plain: nil, status: 204
@@ -55,6 +68,14 @@ module Spree
55
68
  def option_value_params
56
69
  params.require(:option_value).permit(permitted_option_value_attributes)
57
70
  end
71
+
72
+ def warn_if_nested_member_route
73
+ Spree::Deprecation.warn <<~MSG if request.path.include?('/option_types/')
74
+ This route is deprecated. Use shallow version instead:
75
+
76
+ #{request.method.upcase} api/option_values/:id
77
+ MSG
78
+ end
58
79
  end
59
80
  end
60
81
  end
@@ -1,8 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # @deprecated Inherit directly from Spree::Api::BaseController
3
4
  class Spree::Api::ResourceController < Spree::Api::BaseController
4
5
  before_action :load_resource, only: [:show, :update, :destroy]
5
6
 
7
+ def self.inherited(klass)
8
+ Spree::Deprecation.warn <<~MSG
9
+ Spree::Api::ResourceController is deprecated. Please, copy any logic you
10
+ need and inherit directly from Spree::Api::BaseController.
11
+ MSG
12
+ super
13
+ end
14
+
6
15
  def index
7
16
  collection_scope = model_class.accessible_by(current_ability)
8
17
  if params[:ids]
@@ -40,13 +40,31 @@ module Spree
40
40
 
41
41
  def create
42
42
  authorize! :create, Shipment
43
- quantity = params[:quantity].to_i
43
+
44
44
  @shipment = @order.shipments.create(stock_location_id: params.fetch(:stock_location_id))
45
- @order.contents.add(variant, quantity, { shipment: @shipment })
46
45
 
47
- @shipment.save!
46
+ if passing_deprecated_params_on_create?
47
+ Spree::Deprecation.warn <<~MSG
48
+ Passing `quantity` or `variant_id` to
48
49
 
49
- respond_with(@shipment.reload, default_template: :show)
50
+ POST /api/shipments
51
+
52
+ is deprecated and won't be allowed anymore starting from Solidus 4.0.
53
+ Instead, create an empty shipment and add items to it subsequently using
54
+ the dedicated endpoint:
55
+
56
+ PUT /api/shipments/{shipment_number}/add
57
+
58
+ MSG
59
+
60
+ quantity = params[:quantity].to_i
61
+ variant = Spree::Variant.unscoped.find(params[:variant_id])
62
+ @order.contents.add(variant, quantity, { shipment: @shipment })
63
+ @shipment.save!
64
+ @shipment.reload
65
+ end
66
+
67
+ respond_with(@shipment, default_template: :show)
50
68
  end
51
69
 
52
70
  def update
@@ -130,6 +148,10 @@ module Spree
130
148
  authorize! :create, Shipment
131
149
  end
132
150
 
151
+ def passing_deprecated_params_on_create?
152
+ params[:variant_id] || params[:quantity]
153
+ end
154
+
133
155
  def find_order_on_create
134
156
  @order = Spree::Order.find_by!(number: params[:shipment][:order_id])
135
157
  authorize! :show, @order
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Spree::Api::UsersController < Spree::Api::ResourceController
3
+ class Spree::Api::UsersController < Spree::Api::BaseController
4
+ before_action :load_resource, only: [:show, :update, :destroy]
5
+
4
6
  def index
5
- user_scope = model_class.accessible_by(current_ability, :show)
7
+ user_scope = user_class.accessible_by(current_ability, :show)
6
8
  if params[:ids]
7
9
  ids = params[:ids].split(",").flatten
8
10
  @users = user_scope.where(id: ids)
@@ -14,20 +16,71 @@ class Spree::Api::UsersController < Spree::Api::ResourceController
14
16
  respond_with(@users)
15
17
  end
16
18
 
17
- private
19
+ def show
20
+ respond_with(@user)
21
+ end
22
+
23
+ def new
24
+ authorize! :new, user_class
25
+ respond_with(user_class.new)
26
+ end
27
+
28
+ def create
29
+ authorize! :create, user_class
30
+
31
+ @user = user_class.new(permitted_user_params)
18
32
 
19
- attr_reader :user
33
+ if @user.save
34
+ respond_with(@user, status: 201, default_template: :show)
35
+ else
36
+ invalid_resource!(@user)
37
+ end
38
+ end
39
+
40
+ def update
41
+ authorize! :update, @user
20
42
 
21
- def model_class
43
+ if @user.update(permitted_user_params)
44
+ respond_with(@user, status: 200, default_template: :show)
45
+ else
46
+ invalid_resource!(@user)
47
+ end
48
+ end
49
+
50
+ def destroy
51
+ authorize! :destroy, @user
52
+
53
+ destroy_result = if @user.respond_to?(:discard)
54
+ @user.discard
55
+ else
56
+ @user.destroy
57
+ end
58
+
59
+ if destroy_result
60
+ respond_with(@user, status: 204)
61
+ else
62
+ invalid_resource!(@user)
63
+ end
64
+ rescue ActiveRecord::DeleteRestrictionError
65
+ render "spree/api/errors/delete_restriction", status: 422
66
+ end
67
+
68
+ private
69
+
70
+ def user_class
22
71
  Spree.user_class
23
72
  end
24
73
 
25
- def user_params
26
- permitted_resource_params
74
+ def load_resource
75
+ @user = user_class.accessible_by(current_ability, :show).find(params[:id])
76
+ end
77
+
78
+ def permitted_user_params
79
+ params.require(:user).permit(permitted_user_attributes)
27
80
  end
28
81
 
29
- def permitted_resource_attributes
30
- if action_name == "create" || can?(:update_email, user)
82
+ def permitted_user_attributes
83
+ if action_name == "create" || can?(:update_email, @user)
31
84
  super | [:email]
32
85
  else
33
86
  super
@@ -6,6 +6,12 @@ module Spree
6
6
  before_action :product
7
7
 
8
8
  def create
9
+ Spree::Deprecation.warn <<~MSG unless request.path.include?('/products/')
10
+ This route is deprecated. Use the route nested within the product resource:
11
+
12
+ POST api/products/{product_id}/variants
13
+ MSG
14
+
9
15
  authorize! :create, Variant
10
16
  @variant = scope.new(variant_params)
11
17
  if @variant.save
@@ -16,6 +22,8 @@ module Spree
16
22
  end
17
23
 
18
24
  def destroy
25
+ warn_if_nested_member_route
26
+
19
27
  @variant = scope.accessible_by(current_ability, :destroy).find(params[:id])
20
28
  @variant.discard
21
29
  respond_with(@variant, status: 204)
@@ -25,8 +33,14 @@ module Spree
25
33
  # we render on the view so we better update it any time a node is included
26
34
  # or removed from the views.
27
35
  def index
28
- @variants = scope.includes(include_list)
29
- .ransack(params[:q]).result
36
+ @variants =
37
+ if params[:variant_search_term]
38
+ Spree::Config.variant_search_class.new(
39
+ params[:variant_search_term], scope: scope
40
+ ).results.includes(include_list)
41
+ else
42
+ scope.includes(include_list).ransack(params[:q]).result
43
+ end
30
44
 
31
45
  @variants = paginate(@variants)
32
46
  respond_with(@variants)
@@ -36,12 +50,16 @@ module Spree
36
50
  end
37
51
 
38
52
  def show
53
+ warn_if_nested_member_route
54
+
39
55
  @variant = scope.includes(include_list)
40
56
  .find(params[:id])
41
57
  respond_with(@variant)
42
58
  end
43
59
 
44
60
  def update
61
+ warn_if_nested_member_route
62
+
45
63
  @variant = scope.accessible_by(current_ability, :update).find(params[:id])
46
64
  if @variant.update(variant_params)
47
65
  respond_with(@variant, status: 200, default_template: :show)
@@ -52,6 +70,14 @@ module Spree
52
70
 
53
71
  private
54
72
 
73
+ def warn_if_nested_member_route
74
+ Spree::Deprecation.warn <<~MSG if request.path.include?('/products/')
75
+ This route is deprecated. Use shallow version instead:
76
+
77
+ #{request.method.upcase} api/variants/:id
78
+ MSG
79
+ end
80
+
55
81
  def product
56
82
  @product ||= Spree::Product.accessible_by(current_ability, :show).friendly.find(params[:product_id]) if params[:product_id]
57
83
  end
@@ -0,0 +1,134 @@
1
+ # i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
2
+
3
+ # The "main" locale.
4
+ base_locale: en
5
+ ## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
6
+ # locales: [es, fr]
7
+ ## Reporting locale, default: en. Available: en, ru.
8
+ # internal_locale: en
9
+
10
+ # Read and write translations.
11
+ data:
12
+ ## Translations are read from the file system. Supported format: YAML, JSON.
13
+ ## Provide a custom adapter:
14
+ # adapter: I18n::Tasks::Data::FileSystem
15
+
16
+ # Locale files or `File.find` patterns where translations are read from:
17
+ read:
18
+ ## Default:
19
+ # - config/locales/%{locale}.yml
20
+ ## More files:
21
+ # - config/locales/**/*.%{locale}.yml
22
+
23
+ # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
24
+ # `i18n-tasks normalize -p` will force move the keys according to these rules
25
+ write:
26
+ ## For example, write devise and simple form keys to their respective files:
27
+ # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
28
+ ## Catch-all default:
29
+ # - config/locales/%{locale}.yml
30
+
31
+ # External locale data (e.g. gems).
32
+ # This data is not considered unused and is never written to.
33
+ external:
34
+ ## Example (replace %#= with %=):
35
+ # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml"
36
+
37
+ ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
38
+ # router: conservative_router
39
+
40
+ yaml:
41
+ write:
42
+ # do not wrap lines at 80 characters
43
+ line_width: -1
44
+
45
+ ## Pretty-print JSON:
46
+ # json:
47
+ # write:
48
+ # indent: ' '
49
+ # space: ' '
50
+ # object_nl: "\n"
51
+ # array_nl: "\n"
52
+
53
+ # Find translate calls
54
+ search:
55
+ ## Paths or `File.find` patterns to search in:
56
+ # paths:
57
+ # - app/
58
+
59
+ ## Root directories for relative keys resolution.
60
+ # relative_roots:
61
+ # - app/controllers
62
+ # - app/helpers
63
+ # - app/mailers
64
+ # - app/presenters
65
+ # - app/views
66
+
67
+ ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
68
+ ## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json)
69
+ exclude:
70
+ - app/assets/images
71
+ - app/assets/fonts
72
+ - app/assets/videos
73
+
74
+ ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
75
+ ## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
76
+ # only: ["*.rb", "*.html.slim"]
77
+
78
+ ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
79
+ # strict: true
80
+
81
+ ## Multiple scanners can be used. Their results are merged.
82
+ ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
83
+ ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
84
+
85
+ ## Translation Services
86
+ # translation:
87
+ # # Google Translate
88
+ # # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
89
+ # google_translate_api_key: "AbC-dEf5"
90
+ # # DeepL Pro Translate
91
+ # # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
92
+ # deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
93
+
94
+ ## Do not consider these keys missing:
95
+ #ignore_missing:
96
+ # - 'number.currency.format.separator'
97
+ # - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
98
+ # - '{devise,simple_form}.*'
99
+
100
+ ## Consider these keys used:
101
+ ignore_unused:
102
+ # - 'activerecord.attributes.*'
103
+ # - '{devise,kaminari,will_paginate}.*'
104
+ # - 'simple_form.{yes,no}'
105
+ # - 'simple_form.{placeholders,hints,labels}.*'
106
+ # - 'simple_form.{error_notification,required}.:'
107
+
108
+ ## Exclude these keys from the `i18n-tasks eq-base' report:
109
+ # ignore_eq_base:
110
+ # all:
111
+ # - common.ok
112
+ # fr,es:
113
+ # - common.brand
114
+
115
+ ## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
116
+ # ignore_inconsistent_interpolations:
117
+ # - 'activerecord.attributes.*'
118
+
119
+ ## Ignore these keys completely:
120
+ # ignore:
121
+ # - kaminari.*
122
+
123
+ ## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
124
+ ## e.g. in case of a relative key defined in a helper method.
125
+ ## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
126
+ #
127
+ # <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
128
+ # only: %w(*.html.haml *.html.slim),
129
+ # patterns: [['= title\b', '.page_title']] %>
130
+ #
131
+ # The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
132
+ #
133
+ # <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
134
+ # patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
@@ -2,23 +2,19 @@
2
2
  en:
3
3
  spree:
4
4
  api:
5
+ could_not_transition: The %{resource} could not be transitioned. Please fix the errors and try again.
5
6
  delete_restriction_error: Cannot delete record.
6
7
  gateway_error: 'There was a problem with the payment gateway: %{text}'
7
8
  invalid_api_key: Invalid API key (%{key}) specified.
8
9
  invalid_resource: Invalid resource. Please fix errors and try again.
9
10
  invalid_taxonomy_id: Invalid taxonomy id.
10
11
  must_specify_api_key: You must specify an API key.
11
- could_not_transition: The %{resource} could not be transitioned. Please fix the
12
- errors and try again.
13
12
  order:
14
- could_not_transition: The order could not be transitioned. Please fix the
15
- errors and try again.
16
13
  expected_total_mismatch: Expected total does not match actual total.
17
14
  invalid_shipping_method: Invalid shipping method specified.
18
15
  quantity_is_not_available: Quantity is not available for items in your order
19
16
  payment:
20
- credit_over_limit: This payment can only be credited up to %{limit}. Please
21
- specify an amount less than or equal to this number.
17
+ credit_over_limit: This payment can only be credited up to %{limit}. Please specify an amount less than or equal to this number.
22
18
  update_forbidden: This payment cannot be updated because it is %{state}.
23
19
  resource_not_found: The resource you were looking for could not be found.
24
20
  shipment:
data/config/routes.rb CHANGED
@@ -12,10 +12,16 @@ Spree::Core::Engine.routes.draw do
12
12
 
13
13
  resources :products do
14
14
  resources :images
15
+ # TODO: Use shallow option on Solidus v4.0
15
16
  resources :variants
16
17
  resources :product_properties
17
18
  end
18
19
 
20
+ # TODO: Use only: :index on Solidus v4.0
21
+ resources :variants do
22
+ resources :images
23
+ end
24
+
19
25
  concern :order_routes do
20
26
  resources :line_items
21
27
  resources :payments do
@@ -47,13 +53,12 @@ Spree::Core::Engine.routes.draw do
47
53
  end
48
54
  end
49
55
 
50
- resources :variants do
51
- resources :images
52
- end
53
-
54
56
  resources :option_types do
57
+ # TODO: Use shallow option on Solidus v4.0
55
58
  resources :option_values
56
59
  end
60
+ # TODO: Use only: :index on Solidus v4.0 and use shallow option on the nested routes
61
+ # within option_types
57
62
  resources :option_values
58
63
 
59
64
  get '/orders/mine', to: 'orders#mine', as: 'my_orders'
@@ -47,7 +47,7 @@ module Spree
47
47
  end
48
48
 
49
49
  def upload_image(filename)
50
- Rack::Test::UploadedFile.new(File.open(image(filename).path), 'image/jpg')
50
+ Rack::Test::UploadedFile.new(File.open(image(filename).path), 'image/jpeg')
51
51
  end
52
52
  end
53
53
  end
@@ -682,7 +682,10 @@ paths:
682
682
  '404':
683
683
  $ref: '#/components/responses/not-found'
684
684
  summary: Get product variant
685
- description: Retrieves a product's variant.
685
+ description: |-
686
+ **Deprecation Warning**: Use [shallow version](/docs/solidus/87df124706c5f-get-variant) instead
687
+
688
+ Retrieves a product's variant.
686
689
  operationId: get-product-variant
687
690
  tags:
688
691
  - Variants
@@ -714,7 +717,10 @@ paths:
714
717
  '422':
715
718
  $ref: '#/components/responses/delete-restriction'
716
719
  summary: Delete product variant
717
- description: Deletes a product's variant.
720
+ description: |-
721
+ **Deprecation Warning**: Use [shallow version](/docs/solidus/82ccaada99139-delete-variant) instead
722
+
723
+ Deletes a product's variant.
718
724
  operationId: delete-product-variant
719
725
  tags:
720
726
  - Variants
@@ -735,7 +741,10 @@ paths:
735
741
  '422':
736
742
  $ref: '#/components/responses/unprocessable-entity'
737
743
  summary: Update product variant
738
- description: Updates a product's variant.
744
+ description: |-
745
+ **Deprecation Warning**: Use [shallow version](/docs/solidus/ce338b5f3b940-update-variant) instead
746
+
747
+ Updates a product's variant.
739
748
  operationId: update-product-variant
740
749
  tags:
741
750
  - Variants
@@ -857,7 +866,10 @@ paths:
857
866
  '422':
858
867
  $ref: '#/components/responses/unprocessable-entity'
859
868
  summary: Create variant
860
- description: 'Creates a variant. Only users with `can :create, Variant` permissions can perform this action.'
869
+ description: |-
870
+ **Deprecation Warning**: Use [nested version](/docs/solidus/681aa6cb75b1e-create-product-variant) instead
871
+
872
+ Creates a variant. Only users with `can :create, Variant` permissions can perform this action.
861
873
  operationId: create-variant
862
874
  tags:
863
875
  - Variants
@@ -2544,6 +2556,8 @@ paths:
2544
2556
  $ref: '#/components/responses/unprocessable-entity'
2545
2557
  summary: Create option value
2546
2558
  description: |-
2559
+ **Deprecation Warning**: Use [nested version](/docs/solidus/810154673c613-create-option-type-value) instead
2560
+
2547
2561
  Creates an option value.
2548
2562
 
2549
2563
  Only users with the `create` permission on `Spree::OptionValue` can perform this action.
@@ -2715,7 +2729,10 @@ paths:
2715
2729
  '404':
2716
2730
  $ref: '#/components/responses/not-found'
2717
2731
  summary: Get option type value
2718
- description: Retrieves an option type's value.
2732
+ description: |-
2733
+ **Deprecation Warning**: Use [shallow version](/docs/solidus/cbbc403ed08a3-get-option-value) instead
2734
+
2735
+ Retrieves an option type's value.
2719
2736
  operationId: get-option-type-value
2720
2737
  tags:
2721
2738
  - Option values
@@ -2749,7 +2766,10 @@ paths:
2749
2766
  '422':
2750
2767
  $ref: '#/components/responses/delete-restriction'
2751
2768
  summary: Delete option type value
2752
- description: Deletes an option type's value.
2769
+ description: |-
2770
+ **Deprecation Warning**: Use [shallow version](/docs/solidus/0742e63219b1f-delete-option-value) instead
2771
+
2772
+ Deletes an option type's value.
2753
2773
  operationId: delete-option-type-value
2754
2774
  tags:
2755
2775
  - Option values
@@ -2771,6 +2791,8 @@ paths:
2771
2791
  $ref: '#/components/responses/unprocessable-entity'
2772
2792
  summary: Update option type value
2773
2793
  description: |-
2794
+ **Deprecation Warning**: Use [shallow version](/docs/solidus/b43f889175ebb-update-option-value) instead
2795
+
2774
2796
  Updates an option type's value.
2775
2797
 
2776
2798
  Only users with the `update` permission on the option value can perform this action.
@@ -5569,6 +5591,10 @@ paths:
5569
5591
  Creates a shipment.
5570
5592
 
5571
5593
  Please note that this request can be only performed by users with the `create` permission on the shipment.
5594
+
5595
+ **Deprecation Warning**: Adding items to the shipment via this endpoint
5596
+ is deprecated. Instead, create an empty shipment and populate it with
5597
+ the dedicated endpoint [to add items to the shipment](/docs/solidus/7078dbcf415ac-add-shipment-item).
5572
5598
  operationId: create-shipment
5573
5599
  tags:
5574
5600
  - Shipments
@@ -5584,8 +5610,10 @@ paths:
5584
5610
  type: integer
5585
5611
  variant_id:
5586
5612
  type: integer
5613
+ deprecated: true
5587
5614
  quantity:
5588
5615
  type: integer
5616
+ deprecated: true
5589
5617
  examples:
5590
5618
  Example:
5591
5619
  value:
@@ -7141,6 +7169,8 @@ components:
7141
7169
  type: boolean
7142
7170
  product_id:
7143
7171
  type: integer
7172
+ tax_category_id:
7173
+ type: integer
7144
7174
  weight:
7145
7175
  type: string
7146
7176
  height:
@@ -7161,6 +7191,23 @@ components:
7161
7191
  type: array
7162
7192
  items:
7163
7193
  $ref: '#/components/schemas/option-value-input'
7194
+ options:
7195
+ weight:
7196
+ type: string
7197
+ height:
7198
+ type: string
7199
+ width:
7200
+ type: string
7201
+ depth:
7202
+ type: string
7203
+ sku:
7204
+ type: string
7205
+ cost_currency:
7206
+ type: string
7207
+ option_value_ids:
7208
+ type: array
7209
+ items:
7210
+ type: integer
7164
7211
  options:
7165
7212
  type: object
7166
7213
  description: '`Name` will be the name/presentation of the option type and `Value` will be the name/presentation of the option value. They will be created if not exist.'
data/solidus_api.gemspec CHANGED
@@ -14,6 +14,8 @@ Gem::Specification.new do |s|
14
14
  s.homepage = 'http://solidus.io'
15
15
  s.license = 'BSD-3-Clause'
16
16
 
17
+ s.metadata['rubygems_mfa_required'] = 'true'
18
+
17
19
  s.files = `git ls-files -z`.split("\x0").reject do |f|
18
20
  f.match(%r{^(spec|script)/})
19
21
  end
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: 3.1.6
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-01 00:00:00.000000000 Z
11
+ date: 2022-08-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: 3.1.6
61
+ version: 3.2.0
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: 3.1.6
68
+ version: 3.2.0
69
69
  description: REST API for the Solidus e-commerce framework.
70
70
  email: contact@solidus.io
71
71
  executables: []
@@ -225,6 +225,7 @@ files:
225
225
  - app/views/spree/api/zones/_zone.json.jbuilder
226
226
  - app/views/spree/api/zones/index.json.jbuilder
227
227
  - app/views/spree/api/zones/show.json.jbuilder
228
+ - config/i18n-tasks.yml
228
229
  - config/locales/en.yml
229
230
  - config/routes.rb
230
231
  - db/migrate/20100107141738_add_api_key_to_spree_users.rb
@@ -255,7 +256,8 @@ files:
255
256
  homepage: http://solidus.io
256
257
  licenses:
257
258
  - BSD-3-Clause
258
- metadata: {}
259
+ metadata:
260
+ rubygems_mfa_required: 'true'
259
261
  post_install_message:
260
262
  rdoc_options: []
261
263
  require_paths:
@@ -271,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
273
  - !ruby/object:Gem::Version
272
274
  version: 1.8.23
273
275
  requirements: []
274
- rubygems_version: 3.2.31
276
+ rubygems_version: 3.1.2
275
277
  signing_key:
276
278
  specification_version: 4
277
279
  summary: REST API for the Solidus e-commerce framework.