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 +4 -4
- data/README.md +1 -0
- data/lib/lucid_shopify/config.rb +4 -1
- data/lib/lucid_shopify/request.rb +12 -1
- data/lib/lucid_shopify/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb8b3ecd73fd9e12fc148790485c15bdace31de28a5dd168ea51141daa4279f1
|
4
|
+
data.tar.gz: b918ec9c86e12b7e6381ffa1c82539c24b2280146ebe9556d28e89a6bf2f4705
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c97f7ba46b6f9fa0ea82ec1453cc869eb0dd384cf1cbe1e65128d95bf3ea89e0b8d7cc2a04d8184d6a003c372e8b7b2426193873c81dd43df39c47bd67c8a2c2
|
7
|
+
data.tar.gz: de2fba1da82f397bf9e68bdbaf65a182790d8a72858a93aa9dd21cc58ee00779399ec66e4f9738b71c5b7255cf397d3b63b77bbfe9a1a848edeaadb361d5b1b3
|
data/README.md
CHANGED
data/lib/lucid_shopify/config.rb
CHANGED
@@ -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
|
-
|
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
|