lucid_shopify 0.23.0 → 0.24.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: c225c729d5ced22978539c22523dc007e1e4219fe7333784aff780022d969999
4
- data.tar.gz: af1375251a30898d6f025b849749482b976a25223e563666d055e4edc7fcc0d7
3
+ metadata.gz: eb8b3ecd73fd9e12fc148790485c15bdace31de28a5dd168ea51141daa4279f1
4
+ data.tar.gz: b918ec9c86e12b7e6381ffa1c82539c24b2280146ebe9556d28e89a6bf2f4705
5
5
  SHA512:
6
- metadata.gz: 2125841d6a8aebaad6170d5474b1796ce348d65d16261425b3dde750456eecb4c0a2a3355738951c3707422dd15e276e00b3a0021af6d832958c555704e458d2
7
- data.tar.gz: 8c675d75398adf165686cea0531ae9bb31154b98cc880c8303416262bb8b27a343ac9d285225287a2c3fc7d7aec955fb2e2631c1d3df5501724f0a7e61de1469
6
+ metadata.gz: c97f7ba46b6f9fa0ea82ec1453cc869eb0dd384cf1cbe1e65128d95bf3ea89e0b8d7cc2a04d8184d6a003c372e8b7b2426193873c81dd43df39c47bd67c8a2c2
7
+ data.tar.gz: de2fba1da82f397bf9e68bdbaf65a182790d8a72858a93aa9dd21cc58ee00779399ec66e4f9738b71c5b7255cf397d3b63b77bbfe9a1a848edeaadb361d5b1b3
data/README.md CHANGED
@@ -15,6 +15,7 @@ Usage
15
15
  ### Configure the default API client
16
16
 
17
17
  LucidShopify.config = LucidShopify::Config.new(
18
+ '...', # api_version, e.g. '2019-04'
18
19
  '...', # api_key
19
20
  '...', # shared_secret
20
21
  '...', # scope
@@ -13,6 +13,7 @@ module LucidShopify
13
13
 
14
14
  def_delegators(
15
15
  :config,
16
+ :api_version,
16
17
  :api_key,
17
18
  :shared_secret,
18
19
  :scope,
@@ -39,6 +40,8 @@ module LucidShopify
39
40
  class Config
40
41
  extend Dry::Initializer
41
42
 
43
+ # @return [String]
44
+ param :api_version
42
45
  # @return [String]
43
46
  param :api_key
44
47
  # @return [String]
@@ -68,7 +71,7 @@ module LucidShopify
68
71
  @logger = new_logger
69
72
  end
70
73
 
71
- PRIVATE_APP = new('', '', '', '', '', '')
74
+ PRIVATE_APP = new(ENV.fetch('SHOPIFY_API_VERSION', '2019-04'), '', '', '', '', '', '') # 2019-04 was the first versioned API
72
75
  end
73
76
 
74
77
  self.config = Config::PRIVATE_APP
@@ -27,7 +27,11 @@ module LucidShopify
27
27
  # @return [String]
28
28
  #
29
29
  private def build_url
30
- admin_url = "https://#{credentials.myshopify_domain}/admin"
30
+ unless path.match?(/oauth/)
31
+ admin_url = "https://#{credentials.myshopify_domain}/admin/api/#{api_version}"
32
+ else
33
+ admin_url = "https://#{credentials.myshopify_domain}/admin"
34
+ end
31
35
 
32
36
  normalised_path = path.sub(/^\//, '')
33
37
  normalised_path = path.sub(/\.json$/, '')
@@ -46,5 +50,12 @@ module LucidShopify
46
50
  headers['X-Shopify-Access-Token'] = access_token if access_token
47
51
  end
48
52
  end
53
+
54
+ #
55
+ # @return [String]
56
+ #
57
+ private def api_version
58
+ ENV.fetch('SHOPIFY_API_VERSION', LucidShopify.config.api_version)
59
+ end
49
60
  end
50
61
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucidShopify
4
- VERSION = '0.23.0'
4
+ VERSION = '0.24.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid_shopify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelsey Judson