shopify_app 21.8.1 → 21.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +56 -56
- data/docs/shopify_app/webhooks.md +16 -2
- data/lib/generators/shopify_app/add_webhook/add_webhook_generator.rb +6 -1
- data/lib/shopify_app/controller_concerns/login_protection.rb +2 -2
- data/lib/shopify_app/managers/webhooks_manager.rb +1 -0
- data/lib/shopify_app/version.rb +1 -1
- data/package.json +1 -1
- data/shopify_app.gemspec +1 -1
- data/yarn.lock +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0235c0e9ef88bf1ffa1b0fde1d62f2af79c3d2bd2a0e45dfd454f9d26dc30b53
|
4
|
+
data.tar.gz: 1f00756ed0f26034b996b24db4cc2297e56afeffd0b3f28b6d22ecdc7f78dbe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8c1116442619ef12195cf15ef38307f720640eb6993d2bfa174fb842878ff9af890a663271bf03aa556ee1fa86a7311956d6d29a8188e26276993c0d5e83057
|
7
|
+
data.tar.gz: c6d78960aeba7353bea99a234adf87d772bf371f43d027dfcd32bb8e89d38aef00879b5a31aa655fcabe3f348a8d50c3553d87b845f8ac4b1e8f12eab8bb0385
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
Unreleased
|
2
2
|
----------
|
3
3
|
|
4
|
+
21.9.0 (January 16, 2023)
|
5
|
+
----------
|
6
|
+
* Fix `add_webhook` generator to create the webhook jobs under the correct directory[#1748](https://github.com/Shopify/shopify_app/pull/1748)
|
7
|
+
* Add support for metafield_namespaces in webhook registration [#1745](https://github.com/Shopify/shopify_app/pull/1745)
|
8
|
+
* Bumps `shopify_api` to latest version (13.4.0), adds support for 2024-01 API version [#1776](https://github.com/Shopify/shopify_app/pull/1776)
|
9
|
+
|
4
10
|
21.8.1 (December 6, 2023)
|
11
|
+
----------
|
5
12
|
* Bump `shopify_api` to 13.3.1 [1763](https://github.com/Shopify/shopify-api-ruby/blob/main/CHANGELOG.md#1331)
|
6
13
|
|
7
14
|
21.8.0 (Dec 1, 2023)
|
data/Gemfile.lock
CHANGED
@@ -1,81 +1,81 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
shopify_app (21.
|
4
|
+
shopify_app (21.9.0)
|
5
5
|
activeresource
|
6
6
|
addressable (~> 2.7)
|
7
7
|
browser_sniffer (~> 2.0)
|
8
8
|
jwt (>= 2.2.3)
|
9
9
|
rails (> 5.2.1)
|
10
10
|
redirect_safely (~> 1.0)
|
11
|
-
shopify_api (~> 13.
|
11
|
+
shopify_api (~> 13.4)
|
12
12
|
sprockets-rails (>= 2.0.0)
|
13
13
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
actioncable (6.1.7.
|
18
|
-
actionpack (= 6.1.7.
|
19
|
-
activesupport (= 6.1.7.
|
17
|
+
actioncable (6.1.7.6)
|
18
|
+
actionpack (= 6.1.7.6)
|
19
|
+
activesupport (= 6.1.7.6)
|
20
20
|
nio4r (~> 2.0)
|
21
21
|
websocket-driver (>= 0.6.1)
|
22
|
-
actionmailbox (6.1.7.
|
23
|
-
actionpack (= 6.1.7.
|
24
|
-
activejob (= 6.1.7.
|
25
|
-
activerecord (= 6.1.7.
|
26
|
-
activestorage (= 6.1.7.
|
27
|
-
activesupport (= 6.1.7.
|
22
|
+
actionmailbox (6.1.7.6)
|
23
|
+
actionpack (= 6.1.7.6)
|
24
|
+
activejob (= 6.1.7.6)
|
25
|
+
activerecord (= 6.1.7.6)
|
26
|
+
activestorage (= 6.1.7.6)
|
27
|
+
activesupport (= 6.1.7.6)
|
28
28
|
mail (>= 2.7.1)
|
29
|
-
actionmailer (6.1.7.
|
30
|
-
actionpack (= 6.1.7.
|
31
|
-
actionview (= 6.1.7.
|
32
|
-
activejob (= 6.1.7.
|
33
|
-
activesupport (= 6.1.7.
|
29
|
+
actionmailer (6.1.7.6)
|
30
|
+
actionpack (= 6.1.7.6)
|
31
|
+
actionview (= 6.1.7.6)
|
32
|
+
activejob (= 6.1.7.6)
|
33
|
+
activesupport (= 6.1.7.6)
|
34
34
|
mail (~> 2.5, >= 2.5.4)
|
35
35
|
rails-dom-testing (~> 2.0)
|
36
|
-
actionpack (6.1.7.
|
37
|
-
actionview (= 6.1.7.
|
38
|
-
activesupport (= 6.1.7.
|
36
|
+
actionpack (6.1.7.6)
|
37
|
+
actionview (= 6.1.7.6)
|
38
|
+
activesupport (= 6.1.7.6)
|
39
39
|
rack (~> 2.0, >= 2.0.9)
|
40
40
|
rack-test (>= 0.6.3)
|
41
41
|
rails-dom-testing (~> 2.0)
|
42
42
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
43
|
-
actiontext (6.1.7.
|
44
|
-
actionpack (= 6.1.7.
|
45
|
-
activerecord (= 6.1.7.
|
46
|
-
activestorage (= 6.1.7.
|
47
|
-
activesupport (= 6.1.7.
|
43
|
+
actiontext (6.1.7.6)
|
44
|
+
actionpack (= 6.1.7.6)
|
45
|
+
activerecord (= 6.1.7.6)
|
46
|
+
activestorage (= 6.1.7.6)
|
47
|
+
activesupport (= 6.1.7.6)
|
48
48
|
nokogiri (>= 1.8.5)
|
49
|
-
actionview (6.1.7.
|
50
|
-
activesupport (= 6.1.7.
|
49
|
+
actionview (6.1.7.6)
|
50
|
+
activesupport (= 6.1.7.6)
|
51
51
|
builder (~> 3.1)
|
52
52
|
erubi (~> 1.4)
|
53
53
|
rails-dom-testing (~> 2.0)
|
54
54
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
55
|
-
activejob (6.1.7.
|
56
|
-
activesupport (= 6.1.7.
|
55
|
+
activejob (6.1.7.6)
|
56
|
+
activesupport (= 6.1.7.6)
|
57
57
|
globalid (>= 0.3.6)
|
58
|
-
activemodel (6.1.7.
|
59
|
-
activesupport (= 6.1.7.
|
58
|
+
activemodel (6.1.7.6)
|
59
|
+
activesupport (= 6.1.7.6)
|
60
60
|
activemodel-serializers-xml (1.0.2)
|
61
61
|
activemodel (> 5.x)
|
62
62
|
activesupport (> 5.x)
|
63
63
|
builder (~> 3.1)
|
64
|
-
activerecord (6.1.7.
|
65
|
-
activemodel (= 6.1.7.
|
66
|
-
activesupport (= 6.1.7.
|
64
|
+
activerecord (6.1.7.6)
|
65
|
+
activemodel (= 6.1.7.6)
|
66
|
+
activesupport (= 6.1.7.6)
|
67
67
|
activeresource (6.0.0)
|
68
68
|
activemodel (>= 6.0)
|
69
69
|
activemodel-serializers-xml (~> 1.0)
|
70
70
|
activesupport (>= 6.0)
|
71
|
-
activestorage (6.1.7.
|
72
|
-
actionpack (= 6.1.7.
|
73
|
-
activejob (= 6.1.7.
|
74
|
-
activerecord (= 6.1.7.
|
75
|
-
activesupport (= 6.1.7.
|
71
|
+
activestorage (6.1.7.6)
|
72
|
+
actionpack (= 6.1.7.6)
|
73
|
+
activejob (= 6.1.7.6)
|
74
|
+
activerecord (= 6.1.7.6)
|
75
|
+
activesupport (= 6.1.7.6)
|
76
76
|
marcel (~> 1.0)
|
77
77
|
mini_mime (>= 1.1.0)
|
78
|
-
activesupport (6.1.7.
|
78
|
+
activesupport (6.1.7.6)
|
79
79
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
80
80
|
i18n (>= 1.6, < 2)
|
81
81
|
minitest (>= 5.1)
|
@@ -159,20 +159,20 @@ GEM
|
|
159
159
|
rack (2.2.7)
|
160
160
|
rack-test (2.1.0)
|
161
161
|
rack (>= 1.3)
|
162
|
-
rails (6.1.7.
|
163
|
-
actioncable (= 6.1.7.
|
164
|
-
actionmailbox (= 6.1.7.
|
165
|
-
actionmailer (= 6.1.7.
|
166
|
-
actionpack (= 6.1.7.
|
167
|
-
actiontext (= 6.1.7.
|
168
|
-
actionview (= 6.1.7.
|
169
|
-
activejob (= 6.1.7.
|
170
|
-
activemodel (= 6.1.7.
|
171
|
-
activerecord (= 6.1.7.
|
172
|
-
activestorage (= 6.1.7.
|
173
|
-
activesupport (= 6.1.7.
|
162
|
+
rails (6.1.7.6)
|
163
|
+
actioncable (= 6.1.7.6)
|
164
|
+
actionmailbox (= 6.1.7.6)
|
165
|
+
actionmailer (= 6.1.7.6)
|
166
|
+
actionpack (= 6.1.7.6)
|
167
|
+
actiontext (= 6.1.7.6)
|
168
|
+
actionview (= 6.1.7.6)
|
169
|
+
activejob (= 6.1.7.6)
|
170
|
+
activemodel (= 6.1.7.6)
|
171
|
+
activerecord (= 6.1.7.6)
|
172
|
+
activestorage (= 6.1.7.6)
|
173
|
+
activesupport (= 6.1.7.6)
|
174
174
|
bundler (>= 1.15.0)
|
175
|
-
railties (= 6.1.7.
|
175
|
+
railties (= 6.1.7.6)
|
176
176
|
sprockets-rails (>= 2.0.0)
|
177
177
|
rails-controller-testing (1.0.5)
|
178
178
|
actionpack (>= 5.0.1.rc1)
|
@@ -183,9 +183,9 @@ GEM
|
|
183
183
|
nokogiri (>= 1.6)
|
184
184
|
rails-html-sanitizer (1.5.0)
|
185
185
|
loofah (~> 2.19, >= 2.19.1)
|
186
|
-
railties (6.1.7.
|
187
|
-
actionpack (= 6.1.7.
|
188
|
-
activesupport (= 6.1.7.
|
186
|
+
railties (6.1.7.6)
|
187
|
+
actionpack (= 6.1.7.6)
|
188
|
+
activesupport (= 6.1.7.6)
|
189
189
|
method_source
|
190
190
|
rake (>= 12.2)
|
191
191
|
thor (~> 1.0)
|
@@ -217,7 +217,7 @@ GEM
|
|
217
217
|
ruby-progressbar (1.13.0)
|
218
218
|
ruby2_keywords (0.0.5)
|
219
219
|
securerandom (0.2.2)
|
220
|
-
shopify_api (13.
|
220
|
+
shopify_api (13.4.0)
|
221
221
|
activesupport
|
222
222
|
concurrent-ruby
|
223
223
|
hash_diff
|
@@ -13,7 +13,7 @@ ShopifyApp can manage your app's webhooks for you if you set which webhooks you
|
|
13
13
|
```ruby
|
14
14
|
ShopifyApp.configure do |config|
|
15
15
|
config.webhooks = [
|
16
|
-
{topic: 'carts/update', path: 'webhooks/carts_update'}
|
16
|
+
{topic: 'carts/update', path: 'api/webhooks/carts_update'}
|
17
17
|
]
|
18
18
|
end
|
19
19
|
```
|
@@ -35,7 +35,21 @@ If you are only interested in particular fields, you can optionally filter the d
|
|
35
35
|
```ruby
|
36
36
|
ShopifyApp.configure do |config|
|
37
37
|
config.webhooks = [
|
38
|
-
{topic: 'products/update', path: 'webhooks/products_update', fields: ['title', 'vendor']}
|
38
|
+
{topic: 'products/update', path: 'api/webhooks/products_update', fields: ['title', 'vendor']}
|
39
|
+
]
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
If you need to read metafields, you can pass in the `metafield_namespaces` parameter in `config/webhooks`. Note if you are also using the `fields` parameter you will need to add `metafields` into that as well. Shopify documentation on metafields in webhooks can be found [here](https://shopify.dev/docs/api/admin-rest/2023-10/resources/webhook#resource-object).
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
ShopifyApp.configure do |config|
|
47
|
+
config.webhooks = [
|
48
|
+
{
|
49
|
+
topic: 'orders/create',
|
50
|
+
path: 'api/webhooks/order_create',
|
51
|
+
metafield_namespaces: ['app-namespace'],
|
52
|
+
},
|
39
53
|
]
|
40
54
|
end
|
41
55
|
```
|
@@ -39,7 +39,12 @@ module ShopifyApp
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def add_webhook_job
|
42
|
-
|
42
|
+
namespace = ShopifyApp.configuration.webhook_jobs_namespace
|
43
|
+
@job_file_name = if namespace.present?
|
44
|
+
"#{namespace}/#{job_file_name}_job"
|
45
|
+
else
|
46
|
+
"#{job_file_name}_job"
|
47
|
+
end
|
43
48
|
@job_class_name = @job_file_name.classify
|
44
49
|
template("webhook_job.rb", "app/jobs/#{@job_file_name}.rb")
|
45
50
|
end
|
@@ -280,8 +280,8 @@ module ShopifyApp
|
|
280
280
|
|
281
281
|
def requested_by_javascript?
|
282
282
|
request.xhr? ||
|
283
|
-
request.
|
284
|
-
request.
|
283
|
+
request.media_type == "text/javascript" ||
|
284
|
+
request.media_type == "application/javascript"
|
285
285
|
end
|
286
286
|
end
|
287
287
|
end
|
data/lib/shopify_app/version.rb
CHANGED
data/package.json
CHANGED
data/shopify_app.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_runtime_dependency("jwt", ">= 2.2.3")
|
21
21
|
s.add_runtime_dependency("rails", "> 5.2.1")
|
22
22
|
s.add_runtime_dependency("redirect_safely", "~> 1.0")
|
23
|
-
s.add_runtime_dependency("shopify_api", "~> 13.
|
23
|
+
s.add_runtime_dependency("shopify_api", "~> 13.4")
|
24
24
|
s.add_runtime_dependency("sprockets-rails", ">= 2.0.0")
|
25
25
|
|
26
26
|
s.add_development_dependency("byebug")
|
data/yarn.lock
CHANGED
@@ -2040,9 +2040,9 @@ flatted@^3.2.7:
|
|
2040
2040
|
integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==
|
2041
2041
|
|
2042
2042
|
follow-redirects@^1.0.0:
|
2043
|
-
version "1.15.
|
2044
|
-
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.
|
2045
|
-
integrity sha512-
|
2043
|
+
version "1.15.4"
|
2044
|
+
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf"
|
2045
|
+
integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==
|
2046
2046
|
|
2047
2047
|
fs-extra@^8.1.0:
|
2048
2048
|
version "8.1.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 21.
|
4
|
+
version: 21.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '13.
|
103
|
+
version: '13.4'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '13.
|
110
|
+
version: '13.4'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: sprockets-rails
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -488,7 +488,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
488
488
|
- !ruby/object:Gem::Version
|
489
489
|
version: '0'
|
490
490
|
requirements: []
|
491
|
-
rubygems_version: 3.4
|
491
|
+
rubygems_version: 3.5.4
|
492
492
|
signing_key:
|
493
493
|
specification_version: 4
|
494
494
|
summary: This gem is used to get quickly started with the Shopify API
|