shopify_api 12.2.0 → 12.2.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: 2112fae23baafc5b3615a58d54d1c8a2b0a1bfcc4c9a9235b6d76bf80bcdff0e
4
- data.tar.gz: 438373f5072f981e9449daac622b55101002df6139cd24e6bff0cfa5601275ce
3
+ metadata.gz: 9061778f35348ae6c1013eed58d1d1d274e84ec63796d33296ac7205319aee40
4
+ data.tar.gz: 9e0ea6bd2543ad11963eab31617b2700383825471483ecef46793fc9e454fd34
5
5
  SHA512:
6
- metadata.gz: 700912ad225f507b09b1aef17c8df1f139eb9b951cc7c42115c0db95dd77b3dd4698fdd164744c5312730de7ecaae70b770b4f5b3370d7913150afcab44dfb28
7
- data.tar.gz: bfd499fc0c32a7e8fc6f523b74b77452ee7edb3581cf045982088d792cb45073846c7138b1c0035b61d1c9420b77500e1be8d2e0cbf89d1e2ff0f2d4f0ba8d90
6
+ metadata.gz: 05a97d69417a4192bd8e83e5eded057931640d700041f6b6d15459d85b3a463de049e5789153dfee75a9df6af8f287956dca4e51c8a230a816596a3e85a2a3b2
7
+ data.tar.gz: a7a1d5e77c69b85566c2484ca64aebb05cd6bfd3701f90aa17b9d8ab5b1f1db6e28ecdbb34dc0dc76cefd8813ab14e98e1fcf2bb8d41797d8f235b757e90f274
data/CHANGELOG.md CHANGED
@@ -4,6 +4,9 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## Version 12.2.1
8
+ - [#1045](https://github.com/Shopify/shopify-api-ruby/pull/1045) Fixes bug with host/host_name requirement.
9
+
7
10
  ## Version 12.2.0
8
11
 
9
12
  - [#1023](https://github.com/Shopify/shopify-api-ruby/pull/1023) Allow custom scopes during the OAuth process
data/Gemfile CHANGED
@@ -9,4 +9,5 @@ group :test do
9
9
  gem "fakefs", require: false
10
10
  gem "webmock"
11
11
  gem "mocha"
12
+ gem "pry-byebug"
12
13
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (12.2.0)
4
+ shopify_api (12.2.1)
5
5
  concurrent-ruby
6
6
  hash_diff
7
7
  httparty
@@ -23,6 +23,7 @@ GEM
23
23
  addressable (2.8.0)
24
24
  public_suffix (>= 2.0.2, < 5.0)
25
25
  ast (2.4.2)
26
+ byebug (11.1.3)
26
27
  coderay (1.1.3)
27
28
  concurrent-ruby (1.1.9)
28
29
  crack (0.4.5)
@@ -56,6 +57,9 @@ GEM
56
57
  pry (0.14.1)
57
58
  coderay (~> 1.1)
58
59
  method_source (~> 1.0)
60
+ pry-byebug (3.10.1)
61
+ byebug (~> 11.0)
62
+ pry (>= 0.13, < 0.15)
59
63
  public_suffix (4.0.6)
60
64
  rainbow (3.1.1)
61
65
  rake (13.0.6)
@@ -140,6 +144,7 @@ DEPENDENCIES
140
144
  fakefs
141
145
  minitest
142
146
  mocha
147
+ pry-byebug
143
148
  rake
144
149
  rubocop
145
150
  rubocop-shopify
data/README.md CHANGED
@@ -51,7 +51,7 @@ Start by initializing the `ShopifyAPI::Context` with the parameters of your app
51
51
  ShopifyAPI::Context.setup(
52
52
  api_key: "<api-key>",
53
53
  api_secret_key: "<api-secret-key>",
54
- host_name: "<application-host-name>",
54
+ host: "<https://application-host-name.com>",
55
55
  scope: "read_orders,read_products,etc",
56
56
  session_storage: ShopifyAPI::Auth::FileSessionStorage.new, # See more details below
57
57
  is_embedded: true, # Set to true if you are building an embedded app
@@ -8,7 +8,6 @@ module ShopifyAPI
8
8
  @api_key = T.let("", String)
9
9
  @api_secret_key = T.let("", String)
10
10
  @api_version = T.let(LATEST_SUPPORTED_ADMIN_VERSION, String)
11
- @host_name = T.let("", String)
12
11
  @scope = T.let(Auth::AuthScopes.new, Auth::AuthScopes)
13
12
  @session_storage = T.let(ShopifyAPI::Auth::FileSessionStorage.new, ShopifyAPI::Auth::SessionStorage)
14
13
  @is_private = T.let(false, T::Boolean)
@@ -30,12 +29,12 @@ module ShopifyAPI
30
29
  api_key: String,
31
30
  api_secret_key: String,
32
31
  api_version: String,
33
- host_name: String,
34
32
  scope: T.any(T::Array[String], String),
35
33
  is_private: T::Boolean,
36
34
  is_embedded: T::Boolean,
37
35
  session_storage: ShopifyAPI::Auth::SessionStorage,
38
36
  logger: Logger,
37
+ host_name: T.nilable(String),
39
38
  host: T.nilable(String),
40
39
  private_shop: T.nilable(String),
41
40
  user_agent_prefix: T.nilable(String),
@@ -46,12 +45,12 @@ module ShopifyAPI
46
45
  api_key:,
47
46
  api_secret_key:,
48
47
  api_version:,
49
- host_name:,
50
48
  scope:,
51
49
  is_private:,
52
50
  is_embedded:,
53
51
  session_storage:,
54
52
  logger: Logger.new($stdout),
53
+ host_name: nil,
55
54
  host: ENV["HOST"] || "https://#{host_name}",
56
55
  private_shop: nil,
57
56
  user_agent_prefix: nil,
@@ -65,7 +64,6 @@ module ShopifyAPI
65
64
  @api_key = api_key
66
65
  @api_secret_key = api_secret_key
67
66
  @api_version = api_version
68
- @host_name = host_name
69
67
  @host = T.let(host, T.nilable(String))
70
68
  @is_private = is_private
71
69
  @scope = Auth::AuthScopes.new(scope)
@@ -108,7 +106,7 @@ module ShopifyAPI
108
106
  end
109
107
 
110
108
  sig { returns(String) }
111
- attr_reader :api_key, :api_secret_key, :api_version, :host_name
109
+ attr_reader :api_key, :api_secret_key, :api_version
112
110
 
113
111
  sig { returns(Auth::AuthScopes) }
114
112
  attr_reader :scope
@@ -134,7 +132,7 @@ module ShopifyAPI
134
132
 
135
133
  sig { returns(T::Boolean) }
136
134
  def setup?
137
- [api_key, api_secret_key, host_name, T.must(host)].none?(&:empty?)
135
+ [api_key, api_secret_key, T.must(host)].none?(&:empty?)
138
136
  end
139
137
 
140
138
  sig { returns(T.nilable(Auth::Session)) }
@@ -158,6 +156,11 @@ module ShopifyAPI
158
156
  def host_scheme
159
157
  T.must(URI.parse(T.must(host)).scheme)
160
158
  end
159
+
160
+ sig { returns(String) }
161
+ def host_name
162
+ T.must(URI(T.must(host)).host)
163
+ end
161
164
  end
162
165
  end
163
166
  end
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module ShopifyAPI
5
- VERSION = "12.2.0"
5
+ VERSION = "12.2.1"
6
6
  end
data/shopify_api.gemspec CHANGED
@@ -43,6 +43,7 @@ Gem::Specification.new do |s|
43
43
  s.add_runtime_dependency("zeitwerk", "~> 2.5")
44
44
 
45
45
  s.add_development_dependency("activesupport")
46
+ s.add_development_dependency("pry-byebug")
46
47
  s.add_development_dependency("rake")
47
48
  s.add_development_dependency("rubocop")
48
49
  s.add_development_dependency("rubocop-shopify")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.2.0
4
+ version: 12.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: pry-byebug
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: rake
155
169
  requirement: !ruby/object:Gem::Requirement