shopify_api 10.0.2 → 10.0.3

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: 5ee0632a9922b5545aa35982111686fe4296040ef7277fd2a94f4cd2b0d355d3
4
- data.tar.gz: 616678196beefce5c6ada1cac1d96c06bf4d01beec431c2606a36792c1280154
3
+ metadata.gz: 81babe6da64bc6c8b0e413213fff00c818778c5bc5cf9bd79b1acb25fd3ea3d1
4
+ data.tar.gz: b9dda7bb0992365df524d1e22d70ee34fee776a68c5dc9e958b826d49c6c0541
5
5
  SHA512:
6
- metadata.gz: '0428496927f7d0f77c79e22457385c084f8c7a2aa05839cb0bd2c7e43b85d7e830d78995994af4a843ac9339a2a4ff64132f19054372a600e2af4d22c649b8b3'
7
- data.tar.gz: 7d72d4177e0d8abd8a4dd6b1bcf1706e13b2325cf383021e12751a35adb02ecbfdf020e1ccc37ef94f47b753e5c95d71d22b1aab8cb47cf188190bdb23768c08
6
+ metadata.gz: cb1eeacedfe1a0fdd8f0262e0bb63ea52996aa6a98f1ffee803481a2ce38424f31d8aa0658108f53a376fef29d5a65acf7bb1384d6d87ce21e52eabdc4926da8
7
+ data.tar.gz: 03c666d05fc413b5da1951a0693818ca97c48064bb2735facb019a4e04a55581525ee061e19dc1c1406e4c67a0949ded89ffec69ef5cab1f1d8866f8d514277f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## Version 10.0.3
6
+
7
+ ### Fixed
8
+
9
+ - [#935](https://github.com/Shopify/shopify_api/pull/935) Fix issue [#931](https://github.com/Shopify/shopify_api/pull/931), weight of variant should be float
10
+ - [#944](https://github.com/Shopify/shopify_api/pull/944) Deprecated the `validate_shop` method from the JWT class since we can trust the token payload, since it comes from Shopify.
11
+
5
12
  ## Version 10.0.2
6
13
 
7
14
  - [#929](https://github.com/Shopify/shopify_api/pull/929) Aligning sorbet dependencies
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (10.0.2)
4
+ shopify_api (10.0.3)
5
5
  concurrent-ruby
6
6
  hash_diff
7
7
  httparty
@@ -79,11 +79,11 @@ GEM
79
79
  rubocop (>= 0.90.0)
80
80
  ruby-progressbar (1.11.0)
81
81
  securerandom (0.2.0)
82
- sorbet (0.5.9874)
83
- sorbet-static (= 0.5.9874)
84
- sorbet-runtime (0.5.9874)
85
- sorbet-static (0.5.9874-universal-darwin-21)
86
- sorbet-static (0.5.9874-x86_64-linux)
82
+ sorbet (0.5.9924)
83
+ sorbet-static (= 0.5.9924)
84
+ sorbet-runtime (0.5.9924)
85
+ sorbet-static (0.5.9924-universal-darwin-21)
86
+ sorbet-static (0.5.9924-x86_64-linux)
87
87
  spoom (1.1.8)
88
88
  sorbet (>= 0.5.9204)
89
89
  sorbet-runtime (>= 0.5.9204)
data/RELEASING.md ADDED
@@ -0,0 +1,18 @@
1
+ # Releasing ShopifyAPI
2
+
3
+ 1. Before releasing, make sure `sorbet` and `sorbet-runtime` are up to date
4
+ 1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
5
+ 1. Update the version of ShopifyAPI in lib/shopify_api/version.rb
6
+ 1. Run `bundle`
7
+ 1. Add a CHANGELOG entry for the new release
8
+ 1. Commit the changes with a commit message like "Packaging for release X.Y.Z"
9
+ 1. Tag the release with the version (Leave REV blank for HEAD or provide a SHA)
10
+ $ git tag vX.Y.Z REV
11
+ 1. Push out the changes
12
+ $ git push
13
+ 1. Push out the tags
14
+ $ git push --tags
15
+ 1. Publish the gem using Shipit
16
+ 1. Consider if the dependency in Shopify/shopify needs updated. It's used only by the tests so is a low risk change.
17
+ Also consider Shopify/shopify_app whose gemspec depends on this.
18
+ We don't need to do this for every release, but we should try to keep them relatively up to date.
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ namespace :test do
11
11
 
12
12
  Rake::TestTask.new(:rest_wrappers) do |t|
13
13
  pattern = if ENV.key?("API_VERSION")
14
- "test/rest/**/#{ENV["API_VERSION"]}/*.rb"
14
+ "test/rest/**/#{ENV.fetch("API_VERSION")}/*.rb"
15
15
  else
16
16
  "test/rest/**/*.rb"
17
17
  end
@@ -35,8 +35,6 @@ module ShopifyAPI
35
35
 
36
36
  raise ShopifyAPI::Errors::InvalidJwtTokenError,
37
37
  "Session token had invalid API key" unless @aud == Context.api_key
38
- raise ShopifyAPI::Errors::InvalidJwtTokenError,
39
- "Session token had invalid shop" unless validate_shop(shop)
40
38
  end
41
39
 
42
40
  sig { returns(String) }
@@ -44,9 +42,14 @@ module ShopifyAPI
44
42
  @dest.gsub("https://", "")
45
43
  end
46
44
 
45
+ # TODO: Remove before releasing v11
47
46
  sig { params(shop: String).returns(T::Boolean) }
48
47
  def validate_shop(shop)
49
- /\A[a-z0-9]+[a-z0-9\-]*[a-z0-9]+\.myshopify\.(io|com)\z/.match?(shop)
48
+ Context.logger.warn(
49
+ "Deprecation notice: ShopifyAPI::Auth::JwtPayload.validate_shop no longer checks the given shop and always " \
50
+ "returns true. It will be removed in v11."
51
+ )
52
+ true
50
53
  end
51
54
 
52
55
  alias_method :eql?, :==
@@ -36,7 +36,7 @@ module ShopifyAPI
36
36
  @taxable = T.let(nil, T.nilable(T::Boolean))
37
37
  @title = T.let(nil, T.nilable(String))
38
38
  @updated_at = T.let(nil, T.nilable(String))
39
- @weight = T.let(nil, T.nilable(Integer))
39
+ @weight = T.let(nil, T.nilable(Float))
40
40
  @weight_unit = T.let(nil, T.nilable(String))
41
41
  end
42
42
 
@@ -103,7 +103,7 @@ module ShopifyAPI
103
103
  attr_reader :title
104
104
  sig { returns(T.nilable(String)) }
105
105
  attr_reader :updated_at
106
- sig { returns(T.nilable(Integer)) }
106
+ sig { returns(T.nilable(Float)) }
107
107
  attr_reader :weight
108
108
  sig { returns(T.nilable(String)) }
109
109
  attr_reader :weight_unit
@@ -36,7 +36,7 @@ module ShopifyAPI
36
36
  @taxable = T.let(nil, T.nilable(T::Boolean))
37
37
  @title = T.let(nil, T.nilable(String))
38
38
  @updated_at = T.let(nil, T.nilable(String))
39
- @weight = T.let(nil, T.nilable(Integer))
39
+ @weight = T.let(nil, T.nilable(Float))
40
40
  @weight_unit = T.let(nil, T.nilable(String))
41
41
  end
42
42
 
@@ -103,7 +103,7 @@ module ShopifyAPI
103
103
  attr_reader :title
104
104
  sig { returns(T.nilable(String)) }
105
105
  attr_reader :updated_at
106
- sig { returns(T.nilable(Integer)) }
106
+ sig { returns(T.nilable(Float)) }
107
107
  attr_reader :weight
108
108
  sig { returns(T.nilable(String)) }
109
109
  attr_reader :weight_unit
@@ -36,7 +36,7 @@ module ShopifyAPI
36
36
  @taxable = T.let(nil, T.nilable(T::Boolean))
37
37
  @title = T.let(nil, T.nilable(String))
38
38
  @updated_at = T.let(nil, T.nilable(String))
39
- @weight = T.let(nil, T.nilable(Integer))
39
+ @weight = T.let(nil, T.nilable(Float))
40
40
  @weight_unit = T.let(nil, T.nilable(String))
41
41
  end
42
42
 
@@ -103,7 +103,7 @@ module ShopifyAPI
103
103
  attr_reader :title
104
104
  sig { returns(T.nilable(String)) }
105
105
  attr_reader :updated_at
106
- sig { returns(T.nilable(Integer)) }
106
+ sig { returns(T.nilable(Float)) }
107
107
  attr_reader :weight
108
108
  sig { returns(T.nilable(String)) }
109
109
  attr_reader :weight_unit
@@ -36,7 +36,7 @@ module ShopifyAPI
36
36
  @taxable = T.let(nil, T.nilable(T::Boolean))
37
37
  @title = T.let(nil, T.nilable(String))
38
38
  @updated_at = T.let(nil, T.nilable(String))
39
- @weight = T.let(nil, T.nilable(Integer))
39
+ @weight = T.let(nil, T.nilable(Float))
40
40
  @weight_unit = T.let(nil, T.nilable(String))
41
41
  end
42
42
 
@@ -103,7 +103,7 @@ module ShopifyAPI
103
103
  attr_reader :title
104
104
  sig { returns(T.nilable(String)) }
105
105
  attr_reader :updated_at
106
- sig { returns(T.nilable(Integer)) }
106
+ sig { returns(T.nilable(Float)) }
107
107
  attr_reader :weight
108
108
  sig { returns(T.nilable(String)) }
109
109
  attr_reader :weight_unit
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module ShopifyAPI
5
- VERSION = "10.0.2"
5
+ VERSION = "10.0.3"
6
6
  end
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: 10.0.2
4
+ version: 10.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-11 00:00:00.000000000 Z
11
+ date: 2022-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -257,7 +257,7 @@ files:
257
257
  - Gemfile.lock
258
258
  - LICENSE
259
259
  - README.md
260
- - RELEASING
260
+ - RELEASING.md
261
261
  - Rakefile
262
262
  - SECURITY.md
263
263
  - bin/tapioca
data/RELEASING DELETED
@@ -1,17 +0,0 @@
1
- Releasing ShopifyAPI
2
-
3
- 1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
4
- 2. Update the version of ShopifyAPI in lib/shopify_api/version.rb
5
- 3. Run `bundle`
6
- 4. Add a CHANGELOG entry for the new release
7
- 5. Commit the changes with a commit message like "Packaging for release X.Y.Z"
8
- 6. Tag the release with the version (Leave REV blank for HEAD or provide a SHA)
9
- $ git tag vX.Y.Z REV
10
- 7. Push out the changes
11
- $ git push
12
- 8. Push out the tags
13
- $ git push --tags
14
- 9. Publish the gem using Shipit
15
- 10. Consider if the dependency in Shopify/shopify needs updated. It's used only by the tests so is a low risk change.
16
- Also consider Shopify/shopify_app whose gemspec depends on this.
17
- We don't need to do this for every release, but we should try to keep them relatively up to date.