spree_api 4.2.7 → 4.3.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +14 -1
- data/app/controllers/concerns/spree/api/v2/product_list_includes.rb +23 -0
- data/app/controllers/spree/api/v1/classifications_controller.rb +4 -3
- data/app/controllers/spree/api/v1/orders_controller.rb +5 -1
- data/app/controllers/spree/api/v1/products_controller.rb +2 -2
- data/app/controllers/spree/api/v1/taxonomies_controller.rb +1 -1
- data/app/controllers/spree/api/v2/base_controller.rb +29 -6
- data/app/controllers/spree/api/v2/platform/addresses_controller.rb +19 -0
- data/app/controllers/spree/api/v2/platform/classifications_controller.rb +43 -0
- data/app/controllers/spree/api/v2/platform/cms_pages_controller.rb +15 -0
- data/app/controllers/spree/api/v2/platform/cms_sections_controller.rb +34 -0
- data/app/controllers/spree/api/v2/platform/countries_controller.rb +19 -0
- data/app/controllers/spree/api/v2/platform/menu_items_controller.rb +35 -0
- data/app/controllers/spree/api/v2/platform/menus_controller.rb +19 -0
- data/app/controllers/spree/api/v2/platform/option_types_controller.rb +15 -0
- data/app/controllers/spree/api/v2/platform/option_values_controller.rb +19 -0
- data/app/controllers/spree/api/v2/platform/products_controller.rb +21 -0
- data/app/controllers/spree/api/v2/platform/resource_controller.rb +112 -0
- data/app/controllers/spree/api/v2/platform/taxons_controller.rb +30 -0
- data/app/controllers/spree/api/v2/platform/users_controller.rb +28 -0
- data/app/controllers/spree/api/v2/resource_controller.rb +18 -6
- data/app/controllers/spree/api/v2/storefront/account/addresses_controller.rb +2 -14
- data/app/controllers/spree/api/v2/storefront/account/credit_cards_controller.rb +13 -11
- data/app/controllers/spree/api/v2/storefront/account/orders_controller.rb +2 -2
- data/app/controllers/spree/api/v2/storefront/account_controller.rb +32 -1
- data/app/controllers/spree/api/v2/storefront/cart_controller.rb +28 -6
- data/app/controllers/spree/api/v2/storefront/checkout_controller.rb +2 -1
- data/app/controllers/spree/api/v2/storefront/cms_pages_controller.rb +41 -0
- data/app/controllers/spree/api/v2/storefront/countries_controller.rb +9 -14
- data/app/controllers/spree/api/v2/storefront/menus_controller.rb +35 -0
- data/app/controllers/spree/api/v2/storefront/order_status_controller.rb +1 -1
- data/app/controllers/spree/api/v2/storefront/products_controller.rb +6 -12
- data/app/controllers/spree/api/v2/storefront/stores_controller.rb +1 -1
- data/app/controllers/spree/api/v2/storefront/taxons_controller.rb +7 -8
- data/app/helpers/spree/api/v2/display_money_helper.rb +2 -2
- data/app/models/spree/api_configuration.rb +1 -0
- data/app/models/spree/api_dependencies.rb +19 -5
- data/app/serializers/concerns/spree/api/v2/resource_serializer_concern.rb +16 -0
- data/app/serializers/spree/api/v2/base_serializer.rb +32 -0
- data/app/serializers/spree/api/v2/platform/address_serializer.rb +15 -0
- data/app/serializers/spree/api/v2/platform/base_serializer.rb +10 -0
- data/app/serializers/spree/api/v2/platform/classification_serializer.rb +14 -0
- data/app/serializers/spree/api/v2/platform/cms_page_serializer.rb +13 -0
- data/app/serializers/spree/api/v2/platform/cms_section_serializer.rb +11 -0
- data/app/serializers/spree/api/v2/platform/country_serializer.rb +13 -0
- data/app/serializers/spree/api/v2/platform/image_serializer.rb +15 -0
- data/app/serializers/spree/api/v2/platform/menu_item_serializer.rb +22 -0
- data/app/serializers/spree/api/v2/platform/menu_serializer.rb +13 -0
- data/app/serializers/spree/api/v2/platform/option_type_serializer.rb +13 -0
- data/app/serializers/spree/api/v2/platform/option_value_serializer.rb +13 -0
- data/app/serializers/spree/api/v2/platform/product_property_serializer.rb +11 -0
- data/app/serializers/spree/api/v2/platform/product_serializer.rb +78 -0
- data/app/serializers/spree/api/v2/platform/state_serializer.rb +13 -0
- data/app/serializers/spree/api/v2/platform/stock_item_serializer.rb +20 -0
- data/app/serializers/spree/api/v2/platform/stock_location_serializer.rb +16 -0
- data/app/serializers/spree/api/v2/platform/store_serializer.rb +14 -0
- data/app/serializers/spree/api/v2/platform/tax_category_serializer.rb +13 -0
- data/app/serializers/spree/api/v2/platform/taxon_image_serializer.rb +13 -0
- data/app/serializers/spree/api/v2/platform/taxon_serializer.rb +38 -0
- data/app/serializers/spree/api/v2/platform/taxonomy_serializer.rb +14 -0
- data/app/serializers/spree/api/v2/platform/user_serializer.rb +21 -0
- data/app/serializers/spree/api/v2/platform/variant_serializer.rb +57 -0
- data/app/serializers/spree/v2/storefront/base_serializer.rb +3 -2
- data/app/serializers/spree/v2/storefront/cms_page_serializer.rb +14 -0
- data/app/serializers/spree/v2/storefront/cms_section_serializer.rb +28 -0
- data/app/serializers/spree/v2/storefront/country_serializer.rb +4 -4
- data/app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb +2 -0
- data/app/serializers/spree/v2/storefront/menu_item_serializer.rb +37 -0
- data/app/serializers/spree/v2/storefront/menu_serializer.rb +13 -0
- data/app/serializers/spree/v2/storefront/product_property_serializer.rb +1 -1
- data/app/serializers/spree/v2/storefront/product_serializer.rb +4 -1
- data/app/serializers/spree/v2/storefront/store_serializer.rb +10 -0
- data/app/serializers/spree/v2/storefront/taxon_serializer.rb +6 -5
- data/config/initializers/doorkeeper.rb +8 -1
- data/config/initializers/rabl.rb +9 -0
- data/config/routes.rb +115 -3
- data/db/migrate/20210727102516_change_integer_id_columns_type.rb +9 -0
- data/docs/oauth/index.yml +2 -2
- data/docs/v2/platform/index.yaml +1501 -0
- data/docs/v2/storefront/index.yaml +48 -2
- data/lib/spree/api/engine.rb +6 -17
- data/lib/spree/api/testing_support/v2/base.rb +1 -1
- data/lib/spree/api/testing_support/v2/platform_contexts.rb +214 -0
- data/lib/spree/api/testing_support/v2/serializers_params.rb +14 -0
- data/lib/spree/api.rb +1 -0
- data/spree_api.gemspec +3 -0
- metadata +101 -11
- data/app/assets/javascripts/spree/api/main.js +0 -36
- data/app/assets/javascripts/spree/api/storefront/cart.js +0 -49
data/config/routes.rb
CHANGED
@@ -128,7 +128,7 @@ Spree::Core::Engine.add_routes do
|
|
128
128
|
|
129
129
|
namespace :v2 do
|
130
130
|
namespace :storefront do
|
131
|
-
resource :cart, controller: :cart, only: %i[show create] do
|
131
|
+
resource :cart, controller: :cart, only: %i[show create destroy] do
|
132
132
|
post :add_item
|
133
133
|
patch :empty
|
134
134
|
delete 'remove_line_item/:line_item_id', to: 'cart#remove_line_item', as: :cart_remove_line_item
|
@@ -149,11 +149,11 @@ Spree::Core::Engine.add_routes do
|
|
149
149
|
get :shipping_rates
|
150
150
|
end
|
151
151
|
|
152
|
-
resource :account, controller: :account, only: %i[show]
|
152
|
+
resource :account, controller: :account, only: %i[show create update]
|
153
153
|
|
154
154
|
namespace :account do
|
155
155
|
resources :addresses, controller: :addresses
|
156
|
-
resources :credit_cards, controller: :credit_cards, only: %i[index show]
|
156
|
+
resources :credit_cards, controller: :credit_cards, only: %i[index show destroy]
|
157
157
|
resources :orders, controller: :orders, only: %i[index show]
|
158
158
|
end
|
159
159
|
|
@@ -163,6 +163,118 @@ Spree::Core::Engine.add_routes do
|
|
163
163
|
resources :products, only: %i[index show]
|
164
164
|
resources :taxons, only: %i[index show], id: /.+/
|
165
165
|
get '/stores/:code', to: 'stores#show', as: :store
|
166
|
+
|
167
|
+
resources :menus, only: %i[index show]
|
168
|
+
resources :cms_pages, only: %i[index show]
|
169
|
+
end
|
170
|
+
|
171
|
+
namespace :platform do
|
172
|
+
# Promotions API
|
173
|
+
resources :promotions
|
174
|
+
|
175
|
+
# Returns API
|
176
|
+
resources :customer_returns
|
177
|
+
resources :reimbursements
|
178
|
+
resources :return_authorizations do
|
179
|
+
member do
|
180
|
+
put :add
|
181
|
+
put :cancel
|
182
|
+
put :receive
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Product Catalog API
|
187
|
+
resources :products
|
188
|
+
resources :taxonomies
|
189
|
+
resources :taxons
|
190
|
+
resources :classifications do
|
191
|
+
member do
|
192
|
+
put :reposition
|
193
|
+
end
|
194
|
+
end
|
195
|
+
resources :images
|
196
|
+
resources :variants
|
197
|
+
resources :properties
|
198
|
+
resources :product_properties
|
199
|
+
resources :option_types
|
200
|
+
resources :option_values
|
201
|
+
|
202
|
+
# Order API
|
203
|
+
resources :orders do
|
204
|
+
member do
|
205
|
+
put :next
|
206
|
+
put :advance
|
207
|
+
put :approve
|
208
|
+
put :cancel
|
209
|
+
put :empty
|
210
|
+
put :apply_coupon_code
|
211
|
+
put :remove_coupon_code
|
212
|
+
end
|
213
|
+
end
|
214
|
+
resources :line_items
|
215
|
+
resources :payments do
|
216
|
+
member do
|
217
|
+
put :authorize
|
218
|
+
put :capture
|
219
|
+
put :purchase
|
220
|
+
put :void
|
221
|
+
put :credit
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Geo API
|
226
|
+
resources :zones
|
227
|
+
resources :countries, only: [:index, :show]
|
228
|
+
resources :states, only: [:index, :show]
|
229
|
+
|
230
|
+
# Shipment API
|
231
|
+
resources :shipments do
|
232
|
+
collection do
|
233
|
+
post 'transfer_to_location'
|
234
|
+
post 'transfer_to_shipment'
|
235
|
+
end
|
236
|
+
member do
|
237
|
+
put :ready
|
238
|
+
put :ship
|
239
|
+
put :add
|
240
|
+
put :remove
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
# Inventory API
|
245
|
+
resources :inventory_units
|
246
|
+
resources :stock_items
|
247
|
+
resources :stock_locations
|
248
|
+
resources :stock_movements
|
249
|
+
|
250
|
+
# User API
|
251
|
+
resources :users
|
252
|
+
resources :credit_cards
|
253
|
+
resources :addresses
|
254
|
+
|
255
|
+
# Menu API
|
256
|
+
resources :menus
|
257
|
+
resource :menu_items do
|
258
|
+
member do
|
259
|
+
patch :reposition
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
# CMS Pages API
|
264
|
+
resources :cms_pages do
|
265
|
+
member do
|
266
|
+
patch :toggle_visibility
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
resource :cms_sections do
|
271
|
+
member do
|
272
|
+
patch :reposition
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
276
|
+
# Store API
|
277
|
+
resources :stores
|
166
278
|
end
|
167
279
|
end
|
168
280
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class ChangeIntegerIdColumnsType < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
change_column :spree_oauth_access_grants, :resource_owner_id, :bigint
|
4
|
+
change_column :spree_oauth_access_grants, :application_id, :bigint
|
5
|
+
|
6
|
+
change_column :spree_oauth_access_tokens, :resource_owner_id, :bigint
|
7
|
+
change_column :spree_oauth_access_tokens, :application_id, :bigint
|
8
|
+
end
|
9
|
+
end
|
data/docs/oauth/index.yml
CHANGED
@@ -6,8 +6,8 @@ servers:
|
|
6
6
|
description: localhost
|
7
7
|
info:
|
8
8
|
version: 1.0.0
|
9
|
-
title:
|
10
|
-
description: "
|
9
|
+
title: Authentication
|
10
|
+
description: "Spree uses oAuth based Authentication via short-lived Bearer tokens. You can either create a new one or refresh existing token."
|
11
11
|
contact:
|
12
12
|
name: Spark Solutions
|
13
13
|
url: 'https://sparksolutions.co'
|