shopify_api 13.3.0 → 13.3.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: 3242835d9dedea2805ab36b498f6fc5b1e778584b6edf05d07c894cf87bf1dec
4
- data.tar.gz: 6953d7096849c3ee5b685ec708ef3d0191252f6c48adaa97c163487c73c52687
3
+ metadata.gz: b06b6f5bbea4f3ec2bfc6362e689d9323dff226bce6e89df9ad3678b07f5ccd1
4
+ data.tar.gz: 4aa27ed36ac0734941ad377a814ea13c9015ab44f7644bcfae61b69dabd749b3
5
5
  SHA512:
6
- metadata.gz: c407661dca2a62ba8815cc42371471eccc5a6cf4a1633aac95b9506ade343e89b5d4831376ff8a994093a7a721b2f4ac1708f736b1c4f8df7c17a978407188c0
7
- data.tar.gz: c7eb834293eb3c5101b6fe17fb2ee4bc7771e8e9cf9f747c77f2cdb5ba123346cad392eef52b1c4cf323270ee9e26bdc60e475a38512d4d7b097f54744d93caa
6
+ metadata.gz: aa6dde76b4b48dfefa13708a232354dfa8877befee6d9c83f6dc7e55dc9c7f9c3da0109e3a91b3aeb9b5bca954bc19d46b01e8f77c0c630e7eb140edf15b1c9e
7
+ data.tar.gz: 10527f74a2c026c49875e6c0a7caafd6c53e1137b8ee655a00b2524067e83439abebc47ac1f640cd6d74cd195c08dd8884243cebefdb270f1bced10e92ee100d
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 13.3.1
8
+
9
+ - [#1244](https://github.com/Shopify/shopify-api-ruby/pull/1244) Add `expired?` to `ShopifyAPI::Auth::Session` to check if the session is expired (mainly for user sessions)
10
+ - [#1249](https://github.com/Shopify/shopify-api-ruby/pull/1249) Fix bug where mandatory webhooks could not be processed
11
+ - [#1250](https://github.com/Shopify/shopify-api-ruby/pull/1250) Remove rails methods .empty? .present? that were breaking CI
12
+
7
13
  ## 13.3.0
8
14
 
9
15
  - [#1241](https://github.com/Shopify/shopify-api-ruby/pull/1241) Add `api_host` to `ShopifyAPI::Context.setup`, allowing the API host to be overridden in `ShopifyAPI::Clients::HttpClient`. This context option is intended for internal Shopify use only.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (13.3.0)
4
+ shopify_api (13.3.1)
5
5
  activesupport
6
6
  concurrent-ruby
7
7
  hash_diff
@@ -16,20 +16,30 @@ PATH
16
16
  GEM
17
17
  remote: https://rubygems.org/
18
18
  specs:
19
- activesupport (7.0.7.2)
19
+ activesupport (7.1.2)
20
+ base64
21
+ bigdecimal
20
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
+ connection_pool (>= 2.2.5)
24
+ drb
21
25
  i18n (>= 1.6, < 2)
22
26
  minitest (>= 5.1)
27
+ mutex_m
23
28
  tzinfo (~> 2.0)
24
29
  addressable (2.8.0)
25
30
  public_suffix (>= 2.0.2, < 5.0)
26
31
  ast (2.4.2)
32
+ base64 (0.2.0)
33
+ bigdecimal (3.1.4)
27
34
  byebug (11.1.3)
28
35
  coderay (1.1.3)
29
36
  concurrent-ruby (1.2.2)
37
+ connection_pool (2.4.1)
30
38
  crack (0.4.5)
31
39
  rexml
32
40
  diff-lcs (1.5.0)
41
+ drb (2.2.0)
42
+ ruby2_keywords
33
43
  fakefs (1.4.1)
34
44
  hash_diff (1.1.1)
35
45
  hashdiff (1.0.1)
@@ -45,9 +55,10 @@ GEM
45
55
  minitest (5.15.0)
46
56
  mocha (1.13.0)
47
57
  multi_xml (0.6.0)
58
+ mutex_m (0.2.0)
48
59
  netrc (0.11.0)
49
- oj (3.16.0)
50
- openssl (3.1.0)
60
+ oj (3.16.1)
61
+ openssl (3.2.0)
51
62
  parallel (1.22.1)
52
63
  parser (3.2.2.4)
53
64
  ast (~> 2.4.1)
@@ -86,7 +97,8 @@ GEM
86
97
  rubocop-sorbet (0.6.11)
87
98
  rubocop (>= 0.90.0)
88
99
  ruby-progressbar (1.11.0)
89
- securerandom (0.2.2)
100
+ ruby2_keywords (0.0.5)
101
+ securerandom (0.3.0)
90
102
  sorbet (0.5.10438)
91
103
  sorbet-static (= 0.5.10438)
92
104
  sorbet-runtime (0.5.10438)
@@ -127,7 +139,7 @@ GEM
127
139
  yard-sorbet (0.7.0)
128
140
  sorbet-runtime (>= 0.5)
129
141
  yard (>= 0.9)
130
- zeitwerk (2.6.11)
142
+ zeitwerk (2.6.12)
131
143
 
132
144
  PLATFORMS
133
145
  arm64-darwin-21
@@ -35,6 +35,11 @@ module ShopifyAPI
35
35
  @is_online
36
36
  end
37
37
 
38
+ sig { returns(T::Boolean) }
39
+ def expired?
40
+ @expires ? @expires < Time.now : false
41
+ end
42
+
38
43
  sig do
39
44
  params(
40
45
  shop: String,
@@ -14,7 +14,7 @@ module ShopifyAPI
14
14
  return false unless verifiable_query.hmac
15
15
 
16
16
  result = validate_signature(verifiable_query, Context.api_secret_key)
17
- if result || Context.old_api_secret_key.blank?
17
+ if result || Context.old_api_secret_key.nil? || T.must(Context.old_api_secret_key).empty?
18
18
  result
19
19
  else
20
20
  validate_signature(verifiable_query, T.must(Context.old_api_secret_key))
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module ShopifyAPI
5
- VERSION = "13.3.0"
5
+ VERSION = "13.3.1"
6
6
  end
@@ -22,8 +22,6 @@ module ShopifyAPI
22
22
  metafield_namespaces: T.nilable(T::Array[String])).void
23
23
  end
24
24
  def add_registration(topic:, delivery_method:, path:, handler: nil, fields: nil, metafield_namespaces: nil)
25
- return if mandatory_webhook_topic?(topic)
26
-
27
25
  @registry[topic] = case delivery_method
28
26
  when :pub_sub
29
27
  Registrations::PubSub.new(topic: topic, path: path, fields: fields,
@@ -56,6 +54,8 @@ module ShopifyAPI
56
54
  ).returns(RegisterResult)
57
55
  end
58
56
  def register(topic:, session:)
57
+ return mandatory_registration_result(topic) if mandatory_webhook_topic?(topic)
58
+
59
59
  registration = @registry[topic]
60
60
 
61
61
  unless registration
@@ -83,6 +83,17 @@ module ShopifyAPI
83
83
  RegisterResult.new(topic: topic, success: registered, body: register_body)
84
84
  end
85
85
 
86
+ sig do
87
+ params(topic: String).returns(RegisterResult)
88
+ end
89
+ def mandatory_registration_result(topic)
90
+ RegisterResult.new(
91
+ topic: topic,
92
+ success: false,
93
+ body: "Mandatory webhooks are to be registered in the partners dashboard",
94
+ )
95
+ end
96
+
86
97
  sig do
87
98
  params(
88
99
  session: Auth::Session,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.3.0
4
+ version: 13.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-13 00:00:00.000000000 Z
11
+ date: 2023-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport