shopify_app 21.8.1 → 21.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36bbee7b9808abae0813b1177ebd8bf8102be7fd81984e5aae8cd9c6d78aca20
4
- data.tar.gz: c1d239928719eb000562a1fbfd0df83ef48db41baf17e923f9968ede0e57466b
3
+ metadata.gz: 0235c0e9ef88bf1ffa1b0fde1d62f2af79c3d2bd2a0e45dfd454f9d26dc30b53
4
+ data.tar.gz: 1f00756ed0f26034b996b24db4cc2297e56afeffd0b3f28b6d22ecdc7f78dbe9
5
5
  SHA512:
6
- metadata.gz: 9b3ef76d79690b330e874dde1a11a837c3c85e5db67fe7d3b453e9543cee3291ad22d1794576b2985a3f9601b15156d6b9f476d0b9e9c09932346dcdcf0d759a
7
- data.tar.gz: 2faa1c6bf1691020a0b75728bf85c0483d237b4e0f5ff5cca3d3f0876744828af10228625c1d0426beadc87efebe6f93ae65ec6be37f3ab5d9b7c544af5b7755
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.8.1)
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.3)
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.3)
18
- actionpack (= 6.1.7.3)
19
- activesupport (= 6.1.7.3)
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.3)
23
- actionpack (= 6.1.7.3)
24
- activejob (= 6.1.7.3)
25
- activerecord (= 6.1.7.3)
26
- activestorage (= 6.1.7.3)
27
- activesupport (= 6.1.7.3)
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.3)
30
- actionpack (= 6.1.7.3)
31
- actionview (= 6.1.7.3)
32
- activejob (= 6.1.7.3)
33
- activesupport (= 6.1.7.3)
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.3)
37
- actionview (= 6.1.7.3)
38
- activesupport (= 6.1.7.3)
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.3)
44
- actionpack (= 6.1.7.3)
45
- activerecord (= 6.1.7.3)
46
- activestorage (= 6.1.7.3)
47
- activesupport (= 6.1.7.3)
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.3)
50
- activesupport (= 6.1.7.3)
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.3)
56
- activesupport (= 6.1.7.3)
55
+ activejob (6.1.7.6)
56
+ activesupport (= 6.1.7.6)
57
57
  globalid (>= 0.3.6)
58
- activemodel (6.1.7.3)
59
- activesupport (= 6.1.7.3)
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.3)
65
- activemodel (= 6.1.7.3)
66
- activesupport (= 6.1.7.3)
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.3)
72
- actionpack (= 6.1.7.3)
73
- activejob (= 6.1.7.3)
74
- activerecord (= 6.1.7.3)
75
- activesupport (= 6.1.7.3)
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.3)
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.3)
163
- actioncable (= 6.1.7.3)
164
- actionmailbox (= 6.1.7.3)
165
- actionmailer (= 6.1.7.3)
166
- actionpack (= 6.1.7.3)
167
- actiontext (= 6.1.7.3)
168
- actionview (= 6.1.7.3)
169
- activejob (= 6.1.7.3)
170
- activemodel (= 6.1.7.3)
171
- activerecord (= 6.1.7.3)
172
- activestorage (= 6.1.7.3)
173
- activesupport (= 6.1.7.3)
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.3)
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.3)
187
- actionpack (= 6.1.7.3)
188
- activesupport (= 6.1.7.3)
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.3.1)
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
- @job_file_name = job_file_name + "_job"
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.content_type == "text/javascript" ||
284
- request.content_type == "application/javascript"
283
+ request.media_type == "text/javascript" ||
284
+ request.media_type == "application/javascript"
285
285
  end
286
286
  end
287
287
  end
@@ -52,6 +52,7 @@ module ShopifyApp
52
52
  path: webhook_path,
53
53
  handler: delivery_method == :http ? webhook_job_klass(webhook_path) : nil,
54
54
  fields: attributes[:fields],
55
+ metafield_namespaces: attributes[:metafield_namespaces],
55
56
  )
56
57
  end
57
58
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShopifyApp
4
- VERSION = "21.8.1"
4
+ VERSION = "21.9.0"
5
5
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shopify_app",
3
- "version": "21.8.1",
3
+ "version": "21.9.0",
4
4
  "repository": "git@github.com:Shopify/shopify_app.git",
5
5
  "author": "Shopify",
6
6
  "license": "MIT",
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.3")
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.3"
2044
- resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
2045
- integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==
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.8.1
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: 2023-12-06 00:00:00.000000000 Z
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.3'
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.3'
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.22
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