spree_api 4.3.0.rc1 → 4.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/spree/api/v2/caching.rb +33 -0
  3. data/app/controllers/spree/api/v2/base_controller.rb +3 -1
  4. data/app/controllers/spree/api/v2/platform/menu_items_controller.rb +2 -2
  5. data/app/controllers/spree/api/v2/platform/menus_controller.rb +4 -0
  6. data/app/controllers/spree/api/v2/platform/products_controller.rb +12 -0
  7. data/app/controllers/spree/api/v2/platform/resource_controller.rb +3 -0
  8. data/app/controllers/spree/api/v2/resource_controller.rb +6 -1
  9. data/app/controllers/spree/api/v2/storefront/account/addresses_controller.rb +3 -1
  10. data/app/controllers/spree/api/v2/storefront/account/orders_controller.rb +4 -0
  11. data/app/controllers/spree/api/v2/storefront/cart_controller.rb +39 -1
  12. data/app/controllers/spree/api/v2/storefront/countries_controller.rb +7 -0
  13. data/app/controllers/spree/api/v2/storefront/products_controller.rb +12 -0
  14. data/app/models/spree/api_configuration.rb +4 -2
  15. data/app/models/spree/api_dependencies.rb +6 -2
  16. data/app/presenters/spree/api/products/filters_presenter.rb +39 -0
  17. data/app/serializers/concerns/spree/api/v2/image_transformation_concern.rb +15 -0
  18. data/app/serializers/concerns/spree/api/v2/taxon_image_transformation_concern.rb +15 -0
  19. data/app/serializers/spree/api/v2/base_serializer.rb +1 -1
  20. data/app/serializers/spree/api/v2/platform/icon_serializer.rb +16 -0
  21. data/app/serializers/spree/api/v2/platform/image_serializer.rb +3 -1
  22. data/app/serializers/spree/api/v2/platform/menu_item_serializer.rb +28 -5
  23. data/app/serializers/spree/api/v2/platform/product_serializer.rb +11 -11
  24. data/app/serializers/spree/api/v2/platform/taxon_image_serializer.rb +3 -1
  25. data/app/serializers/spree/api/v2/platform/user_serializer.rb +16 -0
  26. data/app/serializers/spree/v2/storefront/icon_serializer.rb +14 -0
  27. data/app/serializers/spree/v2/storefront/image_serializer.rb +3 -1
  28. data/app/serializers/spree/v2/storefront/menu_item_serializer.rb +12 -6
  29. data/app/serializers/spree/v2/storefront/payment_method_serializer.rb +4 -0
  30. data/app/serializers/spree/v2/storefront/product_serializer.rb +18 -12
  31. data/app/serializers/spree/v2/storefront/taxon_image_serializer.rb +3 -1
  32. data/config/locales/en.yml +1 -1
  33. data/config/routes.rb +3 -1
  34. data/docs/oauth/index.yml +2 -2
  35. data/docs/v2/platform/index.yaml +2442 -244
  36. data/docs/v2/storefront/index.yaml +11541 -1152
  37. data/lib/spree/api/testing_support/v2/platform_contexts.rb +15 -5
  38. data/spree_api.gemspec +1 -1
  39. metadata +16 -10
@@ -50,12 +50,12 @@ JSON_API_FILTER_DESCRIPTION = ''
50
50
 
51
51
  def json_api_include_parameter(example = '')
52
52
  let(:include) { nil }
53
- parameter name: :include, in: :query, type: :string, descripton: JSON_API_INCLUDES_DESCRIPTION, example: example
53
+ parameter name: :include, in: :query, type: :string, description: JSON_API_INCLUDES_DESCRIPTION, example: example
54
54
  end
55
55
 
56
56
  def json_api_filter_parameter(example = '')
57
57
  let(:filter) { nil }
58
- parameter name: :filter, in: :query, type: :string, descripton: JSON_API_FILTER_DESCRIPTION, example: example
58
+ parameter name: :filter, in: :query, type: :string, description: JSON_API_FILTER_DESCRIPTION, example: example
59
59
  end
60
60
 
61
61
  shared_examples 'authentication failed' do
@@ -121,6 +121,8 @@ shared_examples 'GET records list' do |resource_name, include_example, filter_ex
121
121
  get "Returns a list of #{resource_name.pluralize}" do
122
122
  tags resource_name.pluralize
123
123
  security [ bearer_auth: [] ]
124
+ description "Returns a list of #{resource_name.pluralize}"
125
+ operationId "#{resource_name.parameterize.pluralize.to_sym}-list"
124
126
  include_context 'jsonapi pagination'
125
127
  json_api_include_parameter(include_example)
126
128
  json_api_filter_parameter(filter_example)
@@ -137,6 +139,8 @@ shared_examples 'GET record' do |resource_name, include_example|
137
139
  get "Returns #{resource_name.articleize}" do
138
140
  tags resource_name.pluralize
139
141
  security [ bearer_auth: [] ]
142
+ description "Returns #{resource_name.articleize}"
143
+ operationId "show-#{resource_name.parameterize.to_sym}"
140
144
  parameter name: :id, in: :path, type: :string
141
145
  json_api_include_parameter(include_example)
142
146
 
@@ -148,12 +152,14 @@ end
148
152
 
149
153
  # create
150
154
  shared_examples 'POST create record' do |resource_name, include_example|
151
- param_name = resource_name.parameterize.to_sym
155
+ param_name = resource_name.parameterize(separator: '_').to_sym
152
156
 
153
157
  post "Creates #{resource_name.articleize}" do
154
158
  tags resource_name.pluralize
155
159
  consumes 'application/json'
156
160
  security [ bearer_auth: [] ]
161
+ description "Creates #{resource_name.articleize}"
162
+ operationId "create-#{resource_name.parameterize.to_sym}"
157
163
  parameter name: param_name, in: :body, schema: { '$ref' => "#/components/schemas/#{param_name}_params" }
158
164
  json_api_include_parameter(include_example)
159
165
 
@@ -166,11 +172,13 @@ end
166
172
 
167
173
  # update
168
174
  shared_examples 'PUT update record' do |resource_name, include_example|
169
- param_name = resource_name.parameterize.to_sym
175
+ param_name = resource_name.parameterize(separator: '_').to_sym
170
176
 
171
177
  put "Updates #{resource_name.articleize}" do
172
178
  tags resource_name.pluralize
173
179
  security [ bearer_auth: [] ]
180
+ description "Updates #{resource_name.articleize}"
181
+ operationId "update-#{resource_name.parameterize.to_sym}"
174
182
  consumes 'application/json'
175
183
  parameter name: :id, in: :path, type: :string
176
184
  parameter name: param_name, in: :body, schema: { '$ref' => "#/components/schemas/#{param_name}_params" }
@@ -190,6 +198,8 @@ shared_examples 'DELETE record' do |resource_name|
190
198
  delete "Deletes #{resource_name.articleize}" do
191
199
  tags resource_name.pluralize
192
200
  security [ bearer_auth: [] ]
201
+ description "Deletes #{resource_name.articleize}"
202
+ operationId "delete-#{resource_name.parameterize.to_sym}"
193
203
  parameter name: :id, in: :path, type: :string
194
204
 
195
205
  it_behaves_like 'record deleted'
@@ -199,7 +209,7 @@ shared_examples 'DELETE record' do |resource_name|
199
209
  end
200
210
 
201
211
  shared_examples 'CRUD examples' do |resource_name, include_example, filter_example|
202
- resource_path = resource_name.pluralize.parameterize
212
+ resource_path = resource_name.parameterize(separator: '_').pluralize
203
213
 
204
214
  path "/api/v2/platform/#{resource_path}" do
205
215
  include_examples 'GET records list', resource_name, include_example, filter_example
data/spree_api.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.metadata = {
15
15
  "bug_tracker_uri" => "https://github.com/spree/spree/issues",
16
16
  "changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
17
- "documentation_uri" => "https://guides.spreecommerce.org/",
17
+ "documentation_uri" => "https://dev-docs.spreecommerce.org/",
18
18
  "source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
19
19
  }
20
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0.rc1
4
+ version: 4.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bigg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2022-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jsonapi-rspec
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 4.3.0.rc1
61
+ version: 4.3.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.3.0.rc1
68
+ version: 4.3.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rabl
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -145,6 +145,7 @@ files:
145
145
  - Gemfile
146
146
  - LICENSE
147
147
  - Rakefile
148
+ - app/controllers/concerns/spree/api/v2/caching.rb
148
149
  - app/controllers/concerns/spree/api/v2/product_list_includes.rb
149
150
  - app/controllers/concerns/spree/api/v2/storefront/order_concern.rb
150
151
  - app/controllers/spree/api/base_controller.rb
@@ -214,7 +215,10 @@ files:
214
215
  - app/models/concerns/spree/user_api_methods.rb
215
216
  - app/models/spree/api_configuration.rb
216
217
  - app/models/spree/api_dependencies.rb
218
+ - app/presenters/spree/api/products/filters_presenter.rb
219
+ - app/serializers/concerns/spree/api/v2/image_transformation_concern.rb
217
220
  - app/serializers/concerns/spree/api/v2/resource_serializer_concern.rb
221
+ - app/serializers/concerns/spree/api/v2/taxon_image_transformation_concern.rb
218
222
  - app/serializers/spree/api/v2/base_serializer.rb
219
223
  - app/serializers/spree/api/v2/platform/address_serializer.rb
220
224
  - app/serializers/spree/api/v2/platform/base_serializer.rb
@@ -222,6 +226,7 @@ files:
222
226
  - app/serializers/spree/api/v2/platform/cms_page_serializer.rb
223
227
  - app/serializers/spree/api/v2/platform/cms_section_serializer.rb
224
228
  - app/serializers/spree/api/v2/platform/country_serializer.rb
229
+ - app/serializers/spree/api/v2/platform/icon_serializer.rb
225
230
  - app/serializers/spree/api/v2/platform/image_serializer.rb
226
231
  - app/serializers/spree/api/v2/platform/menu_item_serializer.rb
227
232
  - app/serializers/spree/api/v2/platform/menu_serializer.rb
@@ -247,6 +252,7 @@ files:
247
252
  - app/serializers/spree/v2/storefront/country_serializer.rb
248
253
  - app/serializers/spree/v2/storefront/credit_card_serializer.rb
249
254
  - app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb
255
+ - app/serializers/spree/v2/storefront/icon_serializer.rb
250
256
  - app/serializers/spree/v2/storefront/image_serializer.rb
251
257
  - app/serializers/spree/v2/storefront/line_item_serializer.rb
252
258
  - app/serializers/spree/v2/storefront/menu_item_serializer.rb
@@ -406,9 +412,9 @@ licenses:
406
412
  - BSD-3-Clause
407
413
  metadata:
408
414
  bug_tracker_uri: https://github.com/spree/spree/issues
409
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.3.0.rc1
410
- documentation_uri: https://guides.spreecommerce.org/
411
- source_code_uri: https://github.com/spree/spree/tree/v4.3.0.rc1
415
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.3.1
416
+ documentation_uri: https://dev-docs.spreecommerce.org/
417
+ source_code_uri: https://github.com/spree/spree/tree/v4.3.1
412
418
  post_install_message:
413
419
  rdoc_options: []
414
420
  require_paths:
@@ -420,11 +426,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
420
426
  version: '2.5'
421
427
  required_rubygems_version: !ruby/object:Gem::Requirement
422
428
  requirements:
423
- - - ">"
429
+ - - ">="
424
430
  - !ruby/object:Gem::Version
425
- version: 1.3.1
431
+ version: '0'
426
432
  requirements: []
427
- rubygems_version: 3.2.3
433
+ rubygems_version: 3.2.22
428
434
  signing_key:
429
435
  specification_version: 4
430
436
  summary: Spree's API