spree_api 4.7.3 → 4.8.1

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: 87dfb93dfa884ec7ba0f07f1a9f860de85631b3664e2e7f2a3d389ae8588c82c
4
- data.tar.gz: d210dd331f76c9430efa91320b842a64dad09af01b87825425382e3758111918
3
+ metadata.gz: e1ac77eeee4025f96db3a6ee83d33ed806ae99c4027376a62b573ef32805441a
4
+ data.tar.gz: 46b2d47aab26b3f13115f31dc1cb22969ab198f18b4d5c3d6851967faa55005e
5
5
  SHA512:
6
- metadata.gz: 957fe1293e1ca10fe1b6e3cc5fedf5acf3ee4cde53b251d27e1e1cbcb0f4742fd4f44a2c66d833c71f713fd125669bc7bc60de43eba3d43f17f355b787526c75
7
- data.tar.gz: 54e0ba173ffb39e7bac523db7fff5d12a391a017551af2002c2b6f79c5916a1ed8e035a6d6091e7c81706d03d6c161f7edf07f58f45ceba19b59765f76869015
6
+ metadata.gz: 266408d6ebc64ffd71161d6ff6cc95533c4dbdaa02edc7a46e45cfca445fe0a064a54c2d306ecb6dc41529fc935e5804f3470cb0b870c5bf6a8a08163dbddd00
7
+ data.tar.gz: 645980441f43e18839d16c86933f1607d89c364aec469fe4f8e28fbeb56ed5a68ff03740c92223abe48e85342d834d7247631fb053b73d61ee5d54ff4b0ea30d
@@ -10,6 +10,7 @@ module Spree
10
10
 
11
11
  def queue_webhooks_requests!(event_name)
12
12
  return if disable_spree_webhooks?
13
+ return if Spree::Webhooks::Subscriber.none?
13
14
  return if Spree::Webhooks::Subscriber.active.with_urls_for(event_name).none?
14
15
  return if update_event?(event_name) && updating_only_ignored_attributes?
15
16
  return if webhook_payload_body.blank?
@@ -32,6 +32,8 @@ module Spree
32
32
  ["('*' MEMBER OF(subscriptions) OR ? MEMBER OF(subscriptions))", event]
33
33
  when 'PostgreSQL'
34
34
  ["subscriptions @> '[\"*\"]' OR subscriptions @> ?", [event].to_json]
35
+ when 'SQLite'
36
+ ["subscriptions LIKE '%\"*\"%' OR subscriptions LIKE ?", "%#{event}%"]
35
37
  end
36
38
  )
37
39
  end
data/spree_api.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.metadata = {
14
14
  'bug_tracker_uri' => 'https://github.com/spree/spree/issues',
15
15
  'changelog_uri' => "https://github.com/spree/spree/releases/tag/v#{s.version}",
16
- 'documentation_uri' => 'https://dev-docs.spreecommerce.org/',
16
+ 'documentation_uri' => 'https://docs.spreecommerce.org/',
17
17
  'source_code_uri' => "https://github.com/spree/spree/tree/v#{s.version}",
18
18
  }
19
19
 
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.7.3
4
+ version: 4.8.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: 2024-04-24 00:00:00.000000000 Z
11
+ date: 2024-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n-tasks
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 4.7.3
117
+ version: 4.8.1
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 4.7.3
124
+ version: 4.8.1
125
125
  description: Spree's API
126
126
  email:
127
127
  - ryan@spreecommerce.com
@@ -353,7 +353,6 @@ files:
353
353
  - app/serializers/spree/v2/storefront/wished_item_serializer.rb
354
354
  - app/serializers/spree/v2/storefront/wishlist_serializer.rb
355
355
  - app/services/spree/api/error_handler.rb
356
- - app/services/spree/webhooks.rb
357
356
  - app/services/spree/webhooks/subscribers/handle_request.rb
358
357
  - app/services/spree/webhooks/subscribers/make_request.rb
359
358
  - app/services/spree/webhooks/subscribers/queue_requests.rb
@@ -376,9 +375,6 @@ files:
376
375
  - db/migrate/20221221122100_add_secret_key_to_spree_webhooks_subscribers.rb
377
376
  - db/migrate/20230116204600_backfill_secret_key_for_spree_webhooks_subscribers.rb
378
377
  - db/migrate/20230116205000_change_secret_key_to_non_null_column.rb
379
- - docs/oauth/index.yml
380
- - docs/v2/platform/index.yaml
381
- - docs/v2/storefront/index.yaml
382
378
  - lib/spree/api.rb
383
379
  - lib/spree/api/configuration.rb
384
380
  - lib/spree/api/dependencies.rb
@@ -406,9 +402,9 @@ licenses:
406
402
  - BSD-3-Clause
407
403
  metadata:
408
404
  bug_tracker_uri: https://github.com/spree/spree/issues
409
- changelog_uri: https://github.com/spree/spree/releases/tag/v4.7.3
410
- documentation_uri: https://dev-docs.spreecommerce.org/
411
- source_code_uri: https://github.com/spree/spree/tree/v4.7.3
405
+ changelog_uri: https://github.com/spree/spree/releases/tag/v4.8.1
406
+ documentation_uri: https://docs.spreecommerce.org/
407
+ source_code_uri: https://github.com/spree/spree/tree/v4.8.1
412
408
  post_install_message:
413
409
  rdoc_options: []
414
410
  require_paths:
@@ -1,13 +0,0 @@
1
- module Spree
2
- module Webhooks
3
- def self.disable_webhooks
4
- webhooks_disabled_previously = ENV['DISABLE_SPREE_WEBHOOKS']
5
- begin
6
- ENV['DISABLE_SPREE_WEBHOOKS'] = 'true'
7
- yield
8
- ensure
9
- ENV['DISABLE_SPREE_WEBHOOKS'] = webhooks_disabled_previously
10
- end
11
- end
12
- end
13
- end
data/docs/oauth/index.yml DELETED
@@ -1,233 +0,0 @@
1
- openapi: 3.0.3
2
- servers:
3
- - url: 'https://demo.spreecommerce.org'
4
- description: demo
5
- - url: 'http://localhost:4000'
6
- description: localhost
7
- info:
8
- version: 1.0.0
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
- contact:
12
- name: Spark Solutions
13
- url: 'https://sparksolutions.co'
14
- email: we@sparksolutions.co
15
- license:
16
- url: 'https://github.com/spree/spree/blob/master/license.md'
17
- name: BSD-3-Clause
18
- paths:
19
- /spree_oauth/token:
20
- post:
21
- description: |-
22
- This endpoint creates a new Bearer Token or refreshes an existing Bearer Token.
23
-
24
- The `token` found in the response body is required to authorize API calls.
25
- operationId: create-or-refresh-token
26
- responses:
27
- '200':
28
- description: Token was successfully created or refreshed.
29
- content:
30
- application/json:
31
- schema:
32
- $ref: '#/components/schemas/Token'
33
- examples:
34
- Storefront User Token:
35
- value:
36
- access_token: SfM3k8kq5Wkc6xz6rgMlsl-mbygJ1ptq4DR0Ah51vjA
37
- token_type: Bearer
38
- expires_in: 7200
39
- refresh_token: SqJDIwX00fehqHxS6xmb-kzqAlrYe_0EHgekMexVT8k
40
- created_at: 1581873931
41
- Platform User Token:
42
- value:
43
- access_token: 2480c16561d1391ea81ca5336b651e9a29f4524f6dee8c7f3f02a600159189c3
44
- token_type: Bearer
45
- expires_in: 7200
46
- refresh_token: f5d78642252eeb3f3001f67b196ac21a27afc030462a54060b0ebbdae2b8dc9c
47
- scope: admin
48
- created_at: 1539863418
49
- Refreshed Token:
50
- value:
51
- access_token: Es9lLPW2mVaDB80I-I_OdQCw3JfOT1s19YN1naFWx98
52
- token_type: Bearer
53
- expires_in: 7200
54
- refresh_token: j92BxulqIIYtiiaBsuAM1TzGsGSVxaykT4kk8OYHGNY
55
- created_at: 1581876572
56
- requestBody:
57
- required: true
58
- content:
59
- application/json:
60
- schema:
61
- oneOf:
62
- - $ref: '#/components/schemas/CreateTokenBody'
63
- - $ref: '#/components/schemas/ClientTokenBody'
64
- - $ref: '#/components/schemas/RefreshTokenBody'
65
- examples:
66
- Create Storefront API User Token:
67
- value:
68
- grant_type: password
69
- username: spree@example.com
70
- password: spree123
71
- Create Platform API User Token:
72
- value:
73
- client_id: 7ZY15L7crVZul8i3PZPrnpOkEURK7xnXEWRZdE6K39M
74
- client_secret: cxMZ0tbe604qj_13hibNmc3GDsXUQfpzHt9PvweihFc
75
- grant_type: password
76
- username: spree@example.com
77
- password: spree123
78
- scope: admin
79
- Create Platform API Application Token:
80
- value:
81
- grant_type: client_credentials
82
- client_id: 7ZY15L7crVZul8i3PZPrnpOkEURK7xnXEWRZdE6K39M
83
- client_secret: cxMZ0tbe604qj_13hibNmc3GDsXUQfpzHt9PvweihFc
84
- scope: admin
85
- Refresh a Token:
86
- value:
87
- grant_type: refresh_token
88
- refresh_token: SqJDIwX00fehqHxS6xmb-kzqAlrYe_0EHgekMexVT8k
89
- application/xml:
90
- schema:
91
- type: object
92
- properties: {}
93
- description: ''
94
- summary: Create or Refresh a Token
95
- tags:
96
- - Token
97
- components:
98
- schemas:
99
- Token:
100
- x-examples:
101
- create token:
102
- access_token: SfM3k8kq5Wkc6xz6rgMlsl-mbygJ1ptq4DR0Ah51vjA
103
- token_type: Bearer
104
- expires_in: 7200
105
- refresh_token: SqJDIwX00fehqHxS6xmb-kzqAlrYe_0EHgekMexVT8k
106
- created_at: 1581873931
107
- refresh token:
108
- access_token: Es9lLPW2mVaDB80I-I_OdQCw3JfOT1s19YN1naFWx98
109
- token_type: Bearer
110
- expires_in: 7200
111
- refresh_token: j92BxulqIIYtiiaBsuAM1TzGsGSVxaykT4kk8OYHGNY
112
- created_at: 1581876572
113
- type: object
114
- properties:
115
- access_token:
116
- type: string
117
- example: 2480c16561d1391ea81ca5336b651e9a29f4524f6dee8c7f3f02a600159189c3
118
- token_type:
119
- type: string
120
- example: Bearer
121
- default: Bearer
122
- expires_in:
123
- type: integer
124
- example: 7200
125
- description: Time (in seconds) after which the access token will expire
126
- refresh_token:
127
- type: string
128
- example: f5d78642252eeb3f3001f67b196ac21a27afc030462a54060b0ebbdae2b8dc9c
129
- scope:
130
- type: string
131
- example: admin
132
- default: admin
133
- created_at:
134
- type: integer
135
- example: 1539863418
136
- required:
137
- - access_token
138
- - token_type
139
- - expires_in
140
- - refresh_token
141
- - created_at
142
- x-internal: false
143
- CreateTokenBody:
144
- type: object
145
- x-examples:
146
- User Token:
147
- grant_type: password
148
- username: spree@example.com
149
- password: spree123
150
- Application Token:
151
- grant_type: password
152
- username: spree@example.com
153
- password: spree123
154
- scope: admin
155
- x-internal: false
156
- title: 'Create a new token (grant_type: password)'
157
- description: ''
158
- properties:
159
- grant_type:
160
- type: string
161
- description: ''
162
- example: password
163
- enum:
164
- - password
165
- username:
166
- type: string
167
- description: User email address
168
- example: spree@example.com
169
- password:
170
- type: string
171
- description: User password
172
- example: spree123
173
- scope:
174
- type: string
175
- enum:
176
- - admin
177
- description: 'Pass the value `admin` to create a Platform User Token, allowing access to the Platform API.'
178
- nullable: true
179
- required:
180
- - grant_type
181
- - username
182
- - password
183
- ClientTokenBody:
184
- type: object
185
- x-examples:
186
- example-1:
187
- grant_type: refresh_token
188
- refresh_token: SqJDIwX00fehqHxS6xmb-kzqAlrYe_0EHgekMexVT8k
189
- x-internal: false
190
- title: 'Create a new token (grant_type: client_credentials)'
191
- description: ''
192
- properties:
193
- grant_type:
194
- type: string
195
- example: client_credentials
196
- enum:
197
- - client_credentials
198
- client_id:
199
- type: string
200
- description: Use the client id
201
- example: 27af95fd57a424e5d01aaf5eab
202
- client_secret:
203
- type: string
204
- example: 1324a8d5c0ca57daf384fae39f811a5144330143301'
205
- description: Client secret key.
206
- required:
207
- - grant_type
208
- - client_id
209
- - client_secret
210
- RefreshTokenBody:
211
- type: object
212
- x-examples:
213
- example-1:
214
- grant_type: refresh_token
215
- refresh_token: SqJDIwX00fehqHxS6xmb-kzqAlrYe_0EHgekMexVT8k
216
- x-internal: false
217
- title: 'Refresh an existing token (grant_type: refresh_token)'
218
- description: ''
219
- properties:
220
- grant_type:
221
- type: string
222
- example: refresh_token
223
- enum:
224
- - refresh_token
225
- refresh_token:
226
- type: string
227
- description: Refresh token obtained from the create token response
228
- example: 27af95fd57a424e5d01aaf5eab1324a8d5c0ca57daf384fae39f811a5144330143301'
229
- required:
230
- - grant_type
231
- - refresh_token
232
- tags:
233
- - name: Token