solidus_api 3.3.4 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a182483bb4316706abeabf33d4edc60a128dfdc32765f9c637e1a46f67aba85b
4
- data.tar.gz: 8c279ed0daeeaacec566c63e572db03838574f1a7836fac953d1c18e99fe29ca
3
+ metadata.gz: c2e97aae9b9a89da9adc6ccb4aff753d8226089a4567042aca7d1bc5abb3ffd9
4
+ data.tar.gz: c4f276a907bcc0f33e38df478f5f092118440d048740ee8cf94c95a70339e4db
5
5
  SHA512:
6
- metadata.gz: a40c60e2f38aebd01156f3869580aff5ba6fc11d3aa3084e614737b6c422f3f8de8e5ed102690801f1ba7cbd03e966630307613eb4710cacd50d3381d64c3e46
7
- data.tar.gz: dddb0e1ead11d14a27a91d1bdd1d9c1d61b7a7367f07dfaa89e7c582493290a070e299df638e0d55be36a67cac299aa28161007a99b399c85bac912894341ba2
6
+ metadata.gz: b1cccc0ea3b020ec33d3cf583c37f175b434c9b0f052c7f946624512b667d2b5beaec0151c84e65c5ad9dd8b6639cf1e09d8aeb0ffd6e35b0b7050a77ba387c5
7
+ data.tar.gz: bb950c56a91378c8dbe7ea0d5a78589038755ba832ba7ecf2384454921acde6ac9c43170a13ae3aa292faee3311773bef76d2933eed2d461d0fada6ffda96cd2
@@ -42,7 +42,7 @@ module Spree
42
42
  def update
43
43
  authorize! :update, @order, order_token
44
44
 
45
- if OrderUpdateAttributes.new(@order, update_params, request_env: request.headers.env).apply
45
+ if Spree::Config.order_update_attributes_class.new(@order, update_params, request_env: request.headers.env).call
46
46
  if can?(:admin, @order) && user_id.present?
47
47
  @order.associate_user!(Spree.user_class.find(user_id))
48
48
  end
@@ -127,7 +127,8 @@ module Spree
127
127
  current_shipment: @original_shipment,
128
128
  desired_shipment: @desired_shipment,
129
129
  variant: @variant,
130
- quantity: @quantity
130
+ quantity: @quantity,
131
+ track_inventory: Spree::Config.track_inventory_levels
131
132
  )
132
133
 
133
134
  if fulfilment_changer.run!
@@ -10,6 +10,8 @@ You can use your API key to access all resources in the API. The API key must be
10
10
  Authorization: Bearer API_KEY
11
11
  ```
12
12
 
13
+ For a client to obtain the API key for a user, you'll first need to implement a custom sign-in strategy. It might depend on your setup, but a common approach is leveraging solidus_auth_devise, as [explained in our guides](https://guides.solidus.io/how-tos/how-to-sign-in-to-the-solidus-api-using-solidus_auth_devise).
14
+
13
15
  As an admin, you can find your API token in the admin section under Users > Your e-email > API Access (at `admin/users/<user_id>/edit`)
14
16
 
15
17
  Example:
@@ -20,6 +22,8 @@ curl --header "Authorization: Bearer 1a6a9936ad150a2ee345c65331da7a3ccc2de" http
20
22
 
21
23
  By default, API keys are only generated for admins, but you can easily customize Solidus to generate them for all users, which is useful for instance if you want users to be able to sign in and manage their profile via the API.
22
24
 
25
+ The `API key` is mandatory for each endpoint by default. You can change this configuration [with the Spree::Api::Config.requires_authentication preference](https://github.com/solidusio/solidus/blob/2b79f72aa53f5caa850c587888fff46c1c91f7b7/api/lib/spree/api_configuration.rb#L5) to avoid the default behavior and expose some endpoints without an API key. An example could be the [GET product list](https://solidus.stoplight.io/docs/solidus/08307f3d809e7-list-products) endpoint.
26
+
23
27
  ### Order token
24
28
 
25
29
  For allowing guests to manage their cart and place their order, you can use the order's guest token. This token is contained in the `guest_token` property of the order, and it allows you to perform certain checkout-related operations on the order such as managing line items, completing the checkout flow etc.
@@ -1,4 +1,7 @@
1
1
  openapi: 3.0.3
2
+ x-stoplight:
3
+ docs:
4
+ showModels: false
2
5
  info:
3
6
  title: Solidus API
4
7
  version: '1.0'
@@ -8,9 +11,6 @@ info:
8
11
  url: 'https://solidus.io'
9
12
  license:
10
13
  name: ''
11
- x-stoplight:
12
- docs:
13
- showModels: false
14
14
  paths:
15
15
  /products:
16
16
  get:
@@ -229,7 +229,6 @@ paths:
229
229
  - Orders
230
230
  security:
231
231
  - api-key: []
232
- - order-token: []
233
232
  /countries:
234
233
  get:
235
234
  responses:
@@ -5925,9 +5924,9 @@ components:
5925
5924
  type: integer
5926
5925
  securitySchemes:
5927
5926
  api-key:
5928
- type: apiKey
5929
- name: Authorization
5930
- in: header
5927
+ type: http
5928
+ scheme: bearer
5929
+ description: 'The `API key` is mandatory for each endpoint by default. You can change this configuration [with the Spree::Api::Config.requires_authentication preference](https://github.com/solidusio/solidus/blob/2b79f72aa53f5caa850c587888fff46c1c91f7b7/api/lib/spree/api_configuration.rb#L5) to avoid the default behavior and expose some endpoints without an API key. An example could be the [GET product list](https://solidus.stoplight.io/docs/solidus/08307f3d809e7-list-products) endpoint.'
5931
5930
  order-token:
5932
5931
  type: apiKey
5933
5932
  name: X-Spree-Order-Token
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.3.4
4
+ version: 3.4.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: 2023-08-14 00:00:00.000000000 Z
11
+ date: 2023-04-21 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.3.4
61
+ version: 3.4.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.3.4
68
+ version: 3.4.0
69
69
  description: REST API for the Solidus e-commerce framework.
70
70
  email: contact@solidus.io
71
71
  executables: []