shopify_api 6.0.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -19
- data/CHANGELOG +11 -0
- data/Gemfile +1 -2
- data/Gemfile_ar41 +5 -0
- data/Gemfile_ar50 +5 -0
- data/Gemfile_ar51 +5 -0
- data/Gemfile_ar_master +0 -1
- data/README.md +116 -9
- data/RELEASING +2 -5
- data/lib/shopify_api.rb +4 -4
- data/lib/shopify_api/api_version.rb +116 -0
- data/lib/shopify_api/disable_prefix_check.rb +31 -0
- data/lib/shopify_api/limits.rb +5 -5
- data/lib/shopify_api/resources/access_scope.rb +6 -1
- data/lib/shopify_api/resources/asset.rb +15 -11
- data/lib/shopify_api/resources/base.rb +63 -1
- data/lib/shopify_api/resources/fulfillment_event.rb +1 -1
- data/lib/shopify_api/resources/graphql.rb +1 -1
- data/lib/shopify_api/resources/inventory_level.rb +2 -2
- data/lib/shopify_api/resources/location.rb +1 -1
- data/lib/shopify_api/resources/marketing_event.rb +2 -0
- data/lib/shopify_api/resources/payment.rb +1 -1
- data/lib/shopify_api/resources/refund.rb +4 -3
- data/lib/shopify_api/resources/shipping_rate.rb +1 -1
- data/lib/shopify_api/resources/shop.rb +4 -2
- data/lib/shopify_api/resources/smart_collection.rb +1 -1
- data/lib/shopify_api/session.rb +45 -16
- data/lib/shopify_api/version.rb +1 -1
- data/shopify_api.gemspec +3 -2
- data/test/access_scope_test.rb +23 -0
- data/test/api_version_test.rb +144 -0
- data/test/base_test.rb +75 -32
- data/test/detailed_log_subscriber_test.rb +51 -12
- data/test/fixtures/access_scopes.json +10 -0
- data/test/limits_test.rb +2 -2
- data/test/marketing_event_test.rb +1 -1
- data/test/recurring_application_charge_test.rb +3 -9
- data/test/session_test.rb +158 -32
- data/test/test_helper.rb +27 -11
- metadata +33 -21
- data/Gemfile_ar30 +0 -6
- data/Gemfile_ar31 +0 -6
- data/Gemfile_ar32 +0 -6
- data/Gemfile_ar40 +0 -6
- data/lib/active_resource/base_ext.rb +0 -21
- data/lib/active_resource/disable_prefix_check.rb +0 -36
- data/lib/active_resource/to_query.rb +0 -10
- data/lib/shopify_api/json_format.rb +0 -18
- data/lib/shopify_api/resources/o_auth.rb +0 -17
- data/lib/shopify_api/resources/ping/conversation.rb +0 -42
- data/lib/shopify_api/resources/ping/delivery_confirmation_details.rb +0 -10
- data/lib/shopify_api/resources/ping/message.rb +0 -8
- data/test/fixtures/o_auth_revoke.json +0 -5
- data/test/o_auth_test.rb +0 -8
- data/test/ping/conversation_test.rb +0 -71
- data/test/ping/message_test.rb +0 -23
data/test/session_test.rb
CHANGED
@@ -9,43 +9,62 @@ class SessionTest < Test::Unit::TestCase
|
|
9
9
|
end
|
10
10
|
|
11
11
|
test "not be valid without a url" do
|
12
|
-
session = ShopifyAPI::Session.new(nil, "any-token")
|
12
|
+
session = ShopifyAPI::Session.new(domain: nil, token: "any-token", api_version: any_api_version)
|
13
13
|
assert_not session.valid?
|
14
14
|
end
|
15
15
|
|
16
16
|
test "not be valid without token" do
|
17
|
-
session = ShopifyAPI::Session.new("testshop.myshopify.com")
|
17
|
+
session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: nil, api_version: any_api_version)
|
18
18
|
assert_not session.valid?
|
19
19
|
end
|
20
20
|
|
21
|
-
test "be valid
|
22
|
-
session = ShopifyAPI::Session.new("testshop.myshopify.com", "any-token")
|
21
|
+
test "not be valid without an api version" do
|
22
|
+
session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: "any-token", api_version: nil)
|
23
|
+
assert_not session.valid?
|
24
|
+
end
|
25
|
+
|
26
|
+
test "be valid with any token, any url and version" do
|
27
|
+
session = ShopifyAPI::Session.new(
|
28
|
+
domain: "testshop.myshopify.com",
|
29
|
+
token: "any-token",
|
30
|
+
api_version: any_api_version
|
31
|
+
)
|
23
32
|
assert session.valid?
|
24
33
|
end
|
25
34
|
|
26
35
|
test "not raise error without params" do
|
27
36
|
assert_nothing_raised do
|
28
|
-
|
37
|
+
ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: "any-token", api_version: any_api_version)
|
29
38
|
end
|
30
39
|
end
|
31
40
|
|
32
41
|
test "ignore everything but the subdomain in the shop" do
|
33
|
-
assert_equal
|
42
|
+
assert_equal(
|
43
|
+
"https://testshop.myshopify.com",
|
44
|
+
ShopifyAPI::Session.new(
|
45
|
+
domain: "http://user:pass@testshop.notshopify.net/path",
|
46
|
+
token: "any-token",
|
47
|
+
api_version: any_api_version
|
48
|
+
).site
|
49
|
+
)
|
34
50
|
end
|
35
51
|
|
36
52
|
test "append the myshopify domain if not given" do
|
37
|
-
assert_equal
|
53
|
+
assert_equal(
|
54
|
+
"https://testshop.myshopify.com",
|
55
|
+
ShopifyAPI::Session.new(domain: "testshop", token: "any-token", api_version: any_api_version).site
|
56
|
+
)
|
38
57
|
end
|
39
58
|
|
40
59
|
test "not raise error without params" do
|
41
60
|
assert_nothing_raised do
|
42
|
-
|
61
|
+
ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: "any-token", api_version: any_api_version)
|
43
62
|
end
|
44
63
|
end
|
45
64
|
|
46
65
|
test "raise error if params passed but signature omitted" do
|
47
66
|
assert_raises(ShopifyAPI::ValidationException) do
|
48
|
-
session = ShopifyAPI::Session.new("testshop.myshopify.com")
|
67
|
+
session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: nil, api_version: any_api_version)
|
49
68
|
session.request_token({'code' => 'any-code'})
|
50
69
|
end
|
51
70
|
end
|
@@ -57,21 +76,84 @@ class SessionTest < Test::Unit::TestCase
|
|
57
76
|
end
|
58
77
|
|
59
78
|
test "#temp reset ShopifyAPI::Base.site to original value" do
|
79
|
+
session1 = ShopifyAPI::Session.new(domain: 'fakeshop.myshopify.com', token: 'token1', api_version: '2019-01')
|
80
|
+
ShopifyAPI::Base.activate_session(session1)
|
81
|
+
|
82
|
+
ShopifyAPI::Session.temp(domain: "testshop.myshopify.com", token: "any-token", api_version: :unstable) do
|
83
|
+
@assigned_site = ShopifyAPI::Base.site
|
84
|
+
@assigned_version = ShopifyAPI::Base.api_version
|
85
|
+
end
|
86
|
+
|
87
|
+
assert_equal('https://testshop.myshopify.com', @assigned_site.to_s)
|
88
|
+
assert_equal('https://fakeshop.myshopify.com', ShopifyAPI::Base.site.to_s)
|
89
|
+
|
90
|
+
assert_equal(ShopifyAPI::ApiVersion::Unstable.new, @assigned_version)
|
91
|
+
assert_equal(ShopifyAPI::ApiVersion::Release.new('2019-01'), ShopifyAPI::Base.api_version)
|
92
|
+
end
|
60
93
|
|
61
|
-
|
62
|
-
session1 = ShopifyAPI::Session.new('fakeshop.myshopify.com', 'token1')
|
94
|
+
test "#with_session activates the session for the duration of the block" do
|
95
|
+
session1 = ShopifyAPI::Session.new(domain: 'fakeshop.myshopify.com', token: 'token1', api_version: '2019-01')
|
63
96
|
ShopifyAPI::Base.activate_session(session1)
|
64
97
|
|
65
|
-
ShopifyAPI::Session.
|
98
|
+
other_session = ShopifyAPI::Session.new(
|
99
|
+
domain: "testshop.myshopify.com",
|
100
|
+
token: "any-token",
|
101
|
+
api_version: :unstable
|
102
|
+
)
|
103
|
+
|
104
|
+
ShopifyAPI::Session.with_session(other_session) do
|
66
105
|
@assigned_site = ShopifyAPI::Base.site
|
67
|
-
|
68
|
-
|
69
|
-
|
106
|
+
@assigned_version = ShopifyAPI::Base.api_version
|
107
|
+
end
|
108
|
+
|
109
|
+
assert_equal('https://testshop.myshopify.com', @assigned_site.to_s)
|
110
|
+
assert_equal('https://fakeshop.myshopify.com', ShopifyAPI::Base.site.to_s)
|
111
|
+
|
112
|
+
assert_equal(ShopifyAPI::ApiVersion::Unstable.new, @assigned_version)
|
113
|
+
assert_equal(ShopifyAPI::ApiVersion::Release.new('2019-01'), ShopifyAPI::Base.api_version)
|
114
|
+
end
|
115
|
+
|
116
|
+
test "#with_session resets the activated session even if there an exception during the block" do
|
117
|
+
session1 = ShopifyAPI::Session.new(domain: 'fakeshop.myshopify.com', token: 'token1', api_version: '2019-01')
|
118
|
+
ShopifyAPI::Base.activate_session(session1)
|
119
|
+
|
120
|
+
other_session = ShopifyAPI::Session.new(
|
121
|
+
domain: "testshop.myshopify.com",
|
122
|
+
token: "any-token",
|
123
|
+
api_version: :unstable
|
124
|
+
)
|
125
|
+
|
126
|
+
assert_raises StandardError do
|
127
|
+
ShopifyAPI::Session.with_session(other_session) { raise StandardError, "" }
|
128
|
+
end
|
129
|
+
|
130
|
+
assert_equal('https://fakeshop.myshopify.com', ShopifyAPI::Base.site.to_s)
|
131
|
+
assert_equal(ShopifyAPI::ApiVersion::Release.new('2019-01'), ShopifyAPI::Base.api_version)
|
132
|
+
end
|
133
|
+
|
134
|
+
test "#with_version will adjust the actvated api version for the duration of the block" do
|
135
|
+
session1 = ShopifyAPI::Session.new(domain: 'fakeshop.myshopify.com', token: 'token1', api_version: '2019-01')
|
136
|
+
ShopifyAPI::Base.activate_session(session1)
|
137
|
+
|
138
|
+
ShopifyAPI::Session.with_version(:unstable) do
|
139
|
+
@assigned_site = ShopifyAPI::Base.site
|
140
|
+
@assigned_version = ShopifyAPI::Base.api_version
|
141
|
+
end
|
142
|
+
|
143
|
+
assert_equal('https://fakeshop.myshopify.com', @assigned_site.to_s)
|
144
|
+
assert_equal('https://fakeshop.myshopify.com', ShopifyAPI::Base.site.to_s)
|
145
|
+
|
146
|
+
assert_equal(ShopifyAPI::ApiVersion::Unstable.new, @assigned_version)
|
147
|
+
assert_equal(ShopifyAPI::ApiVersion::Release.new('2019-01'), ShopifyAPI::Base.api_version)
|
70
148
|
end
|
71
149
|
|
72
150
|
test "create_permission_url returns correct url with single scope no redirect uri" do
|
73
151
|
ShopifyAPI::Session.setup(:api_key => "My_test_key", :secret => "My test secret")
|
74
|
-
session = ShopifyAPI::Session.new(
|
152
|
+
session = ShopifyAPI::Session.new(
|
153
|
+
domain: 'http://localhost.myshopify.com',
|
154
|
+
token: 'any-token',
|
155
|
+
api_version: any_api_version
|
156
|
+
)
|
75
157
|
scope = ["write_products"]
|
76
158
|
permission_url = session.create_permission_url(scope)
|
77
159
|
assert_equal "https://localhost.myshopify.com/admin/oauth/authorize?client_id=My_test_key&scope=write_products", permission_url
|
@@ -79,7 +161,11 @@ class SessionTest < Test::Unit::TestCase
|
|
79
161
|
|
80
162
|
test "create_permission_url returns correct url with single scope and redirect uri" do
|
81
163
|
ShopifyAPI::Session.setup(:api_key => "My_test_key", :secret => "My test secret")
|
82
|
-
session = ShopifyAPI::Session.new(
|
164
|
+
session = ShopifyAPI::Session.new(
|
165
|
+
domain: 'http://localhost.myshopify.com',
|
166
|
+
token: 'any-token',
|
167
|
+
api_version: any_api_version
|
168
|
+
)
|
83
169
|
scope = ["write_products"]
|
84
170
|
permission_url = session.create_permission_url(scope, "http://my_redirect_uri.com")
|
85
171
|
assert_equal "https://localhost.myshopify.com/admin/oauth/authorize?client_id=My_test_key&scope=write_products&redirect_uri=http://my_redirect_uri.com", permission_url
|
@@ -87,7 +173,11 @@ class SessionTest < Test::Unit::TestCase
|
|
87
173
|
|
88
174
|
test "create_permission_url returns correct url with dual scope no redirect uri" do
|
89
175
|
ShopifyAPI::Session.setup(:api_key => "My_test_key", :secret => "My test secret")
|
90
|
-
session = ShopifyAPI::Session.new(
|
176
|
+
session = ShopifyAPI::Session.new(
|
177
|
+
domain: 'http://localhost.myshopify.com',
|
178
|
+
token: 'any-token',
|
179
|
+
api_version: any_api_version
|
180
|
+
)
|
91
181
|
scope = ["write_products","write_customers"]
|
92
182
|
permission_url = session.create_permission_url(scope)
|
93
183
|
assert_equal "https://localhost.myshopify.com/admin/oauth/authorize?client_id=My_test_key&scope=write_products,write_customers", permission_url
|
@@ -95,7 +185,11 @@ class SessionTest < Test::Unit::TestCase
|
|
95
185
|
|
96
186
|
test "create_permission_url returns correct url with no scope no redirect uri" do
|
97
187
|
ShopifyAPI::Session.setup(:api_key => "My_test_key", :secret => "My test secret")
|
98
|
-
session = ShopifyAPI::Session.new(
|
188
|
+
session = ShopifyAPI::Session.new(
|
189
|
+
domain: 'http://localhost.myshopify.com',
|
190
|
+
token: 'any-token',
|
191
|
+
api_version: any_api_version
|
192
|
+
)
|
99
193
|
scope = []
|
100
194
|
permission_url = session.create_permission_url(scope)
|
101
195
|
assert_equal "https://localhost.myshopify.com/admin/oauth/authorize?client_id=My_test_key&scope=", permission_url
|
@@ -103,25 +197,40 @@ class SessionTest < Test::Unit::TestCase
|
|
103
197
|
|
104
198
|
test "raise exception if code invalid in request token" do
|
105
199
|
ShopifyAPI::Session.setup(:api_key => "My test key", :secret => "My test secret")
|
106
|
-
session = ShopifyAPI::Session.new(
|
107
|
-
|
200
|
+
session = ShopifyAPI::Session.new(
|
201
|
+
domain: 'http://localhost.myshopify.com',
|
202
|
+
token: nil,
|
203
|
+
api_version: any_api_version
|
204
|
+
)
|
205
|
+
fake(
|
206
|
+
nil,
|
207
|
+
url: 'https://localhost.myshopify.com/admin/oauth/access_token',
|
208
|
+
method: :post,
|
209
|
+
status: 404,
|
210
|
+
body: '{"error" : "invalid_request"}'
|
211
|
+
)
|
108
212
|
assert_raises(ShopifyAPI::ValidationException) do
|
109
|
-
session.request_token(
|
213
|
+
session.request_token(code: "bad-code")
|
110
214
|
end
|
111
215
|
assert_equal false, session.valid?
|
112
216
|
end
|
113
217
|
|
114
218
|
test "return site for session" do
|
115
|
-
session = ShopifyAPI::Session.new(
|
116
|
-
|
219
|
+
session = ShopifyAPI::Session.new(
|
220
|
+
domain: "testshop.myshopify.com",
|
221
|
+
token: "any-token",
|
222
|
+
api_version: any_api_version
|
223
|
+
)
|
224
|
+
assert_equal "https://testshop.myshopify.com", session.site
|
117
225
|
end
|
118
226
|
|
119
227
|
test "return_token_if_signature_is_valid" do
|
228
|
+
api_version = any_api_version
|
120
229
|
fake nil,
|
121
|
-
url:
|
230
|
+
url: "https://testshop.myshopify.com/admin/oauth/access_token",
|
122
231
|
method: :post,
|
123
232
|
body: '{"access_token":"any-token"}'
|
124
|
-
session = ShopifyAPI::Session.new("testshop.myshopify.com")
|
233
|
+
session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: nil, api_version: api_version)
|
125
234
|
|
126
235
|
params = { code: 'any-code', timestamp: Time.now }
|
127
236
|
token = session.request_token(params.merge(hmac: generate_signature(params)))
|
@@ -131,11 +240,12 @@ class SessionTest < Test::Unit::TestCase
|
|
131
240
|
end
|
132
241
|
|
133
242
|
test "extra parameters are stored in session" do
|
243
|
+
api_version = ShopifyAPI::ApiVersion::Unstable.new
|
134
244
|
fake nil,
|
135
|
-
url:
|
245
|
+
url: "https://testshop.myshopify.com/admin/oauth/access_token",
|
136
246
|
method: :post,
|
137
247
|
body: '{"access_token":"any-token","foo":"example"}'
|
138
|
-
session = ShopifyAPI::Session.new("testshop.myshopify.com")
|
248
|
+
session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: nil, api_version: api_version)
|
139
249
|
|
140
250
|
params = { code: 'any-code', timestamp: Time.now }
|
141
251
|
assert session.request_token(params.merge(hmac: generate_signature(params)))
|
@@ -144,11 +254,12 @@ class SessionTest < Test::Unit::TestCase
|
|
144
254
|
end
|
145
255
|
|
146
256
|
test "expires_in is automatically converted in expires_at" do
|
257
|
+
api_version = any_api_version
|
147
258
|
fake nil,
|
148
|
-
url:
|
259
|
+
url: "https://testshop.myshopify.com/admin/oauth/access_token",
|
149
260
|
method: :post,
|
150
261
|
body: '{"access_token":"any-token","expires_in":86393}'
|
151
|
-
session = ShopifyAPI::Session.new("testshop.myshopify.com")
|
262
|
+
session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: nil, api_version: api_version)
|
152
263
|
|
153
264
|
Timecop.freeze do
|
154
265
|
params = { code: 'any-code', timestamp: Time.now }
|
@@ -172,7 +283,7 @@ class SessionTest < Test::Unit::TestCase
|
|
172
283
|
signature = generate_signature(params)
|
173
284
|
params[:foo] = 'world'
|
174
285
|
assert_raises(ShopifyAPI::ValidationException) do
|
175
|
-
session = ShopifyAPI::Session.new("testshop.myshopify.com")
|
286
|
+
session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: nil, api_version: any_api_version)
|
176
287
|
session.request_token(params.merge(:hmac => signature))
|
177
288
|
end
|
178
289
|
end
|
@@ -182,7 +293,7 @@ class SessionTest < Test::Unit::TestCase
|
|
182
293
|
signature = generate_signature(params)
|
183
294
|
params[:foo] = 'world'
|
184
295
|
assert_raises(ShopifyAPI::ValidationException) do
|
185
|
-
session = ShopifyAPI::Session.new("testshop.myshopify.com")
|
296
|
+
session = ShopifyAPI::Session.new(domain: "testshop.myshopify.com", token: nil, api_version: any_api_version)
|
186
297
|
session.request_token(params.merge(:hmac => signature))
|
187
298
|
end
|
188
299
|
end
|
@@ -209,6 +320,16 @@ class SessionTest < Test::Unit::TestCase
|
|
209
320
|
assert_equal true, ShopifyAPI::Session.validate_signature(params)
|
210
321
|
end
|
211
322
|
|
323
|
+
test "url is aliased to domain to minimize the upgrade changes" do
|
324
|
+
session = ShopifyAPI::Session.new(
|
325
|
+
domain: "http://testshop.myshopify.com",
|
326
|
+
token: "any-token",
|
327
|
+
api_version: any_api_version
|
328
|
+
)
|
329
|
+
|
330
|
+
assert_equal('testshop.myshopify.com', session.url)
|
331
|
+
end
|
332
|
+
|
212
333
|
private
|
213
334
|
|
214
335
|
def make_sorted_params(params)
|
@@ -221,4 +342,9 @@ class SessionTest < Test::Unit::TestCase
|
|
221
342
|
params = make_sorted_params(params) if params.is_a?(Hash)
|
222
343
|
OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA256.new, ShopifyAPI::Session.secret, params)
|
223
344
|
end
|
345
|
+
|
346
|
+
def any_api_version
|
347
|
+
version_name = ['2019-01', :unstable].sample(1).first
|
348
|
+
ShopifyAPI::ApiVersion.coerce_to_version(version_name)
|
349
|
+
end
|
224
350
|
end
|
data/test/test_helper.rb
CHANGED
@@ -31,20 +31,24 @@ class Test::Unit::TestCase < Minitest::Unit::TestCase
|
|
31
31
|
|
32
32
|
def setup
|
33
33
|
ActiveResource::Base.format = :json
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
rescue NameError
|
40
|
-
end
|
34
|
+
ShopifyAPI.constants.each do |const|
|
35
|
+
begin
|
36
|
+
const = mod.const_get(const)
|
37
|
+
const.format = :json if const.respond_to?(:format=)
|
38
|
+
rescue NameError
|
41
39
|
end
|
42
40
|
end
|
43
41
|
|
42
|
+
ShopifyAPI::ApiVersion.define_version(ShopifyAPI::ApiVersion::Release.new('2019-01'))
|
43
|
+
|
44
44
|
ShopifyAPI::Base.clear_session
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
session = ShopifyAPI::Session.new(
|
46
|
+
domain: "https://this-is-my-test-shop.myshopify.com",
|
47
|
+
token: "token_test_helper",
|
48
|
+
api_version: '2019-01',
|
49
|
+
)
|
50
|
+
|
51
|
+
ShopifyAPI::Base.activate_session(session)
|
48
52
|
end
|
49
53
|
|
50
54
|
def teardown
|
@@ -54,6 +58,9 @@ class Test::Unit::TestCase < Minitest::Unit::TestCase
|
|
54
58
|
ShopifyAPI::Base.site = nil
|
55
59
|
ShopifyAPI::Base.password = nil
|
56
60
|
ShopifyAPI::Base.user = nil
|
61
|
+
|
62
|
+
ShopifyAPI::ApiVersion.clear_defined_versions
|
63
|
+
ShopifyAPI::ApiVersion.define_known_versions
|
57
64
|
end
|
58
65
|
|
59
66
|
# Custom Assertions
|
@@ -85,14 +92,23 @@ class Test::Unit::TestCase < Minitest::Unit::TestCase
|
|
85
92
|
body = options.has_key?(:body) ? options.delete(:body) : load_fixture(endpoint)
|
86
93
|
format = options.delete(:format) || :json
|
87
94
|
method = options.delete(:method) || :get
|
95
|
+
api_version = options.delete(:api_version) || ShopifyAPI::ApiVersion.coerce_to_version('2019-01')
|
88
96
|
extension = ".#{options.delete(:extension)||'json'}" unless options[:extension]==false
|
89
97
|
|
90
98
|
url = if options.has_key?(:url)
|
91
99
|
options[:url]
|
92
100
|
else
|
93
|
-
"https://this-is-my-test-shop.myshopify.com
|
101
|
+
"https://this-is-my-test-shop.myshopify.com#{api_version.construct_api_path("#{endpoint}#{extension}")}"
|
94
102
|
end
|
95
103
|
|
96
104
|
FakeWeb.register_uri(method, url, {:body => body, :status => 200, :content_type => "text/#{format}", :content_length => 1}.merge(options))
|
97
105
|
end
|
106
|
+
|
107
|
+
def ar_version_before?(version_string)
|
108
|
+
Gem::Version.new(ActiveResource::VERSION::STRING) < Gem::Version.new(version_string)
|
109
|
+
end
|
110
|
+
|
111
|
+
def ar_version_after?(version_string)
|
112
|
+
Gem::Version.new(version_string) < Gem::Version.new(ActiveResource::VERSION::STRING)
|
113
|
+
end
|
98
114
|
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:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -16,14 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.1.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 6.0.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
29
|
+
version: 4.1.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 6.0.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rack
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,6 +128,20 @@ dependencies:
|
|
122
128
|
- - ">="
|
123
129
|
- !ruby/object:Gem::Version
|
124
130
|
version: '0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: rubocop
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
125
145
|
- !ruby/object:Gem::Dependency
|
126
146
|
name: pry
|
127
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -172,27 +192,24 @@ files:
|
|
172
192
|
- CONTRIBUTING.md
|
173
193
|
- CONTRIBUTORS
|
174
194
|
- Gemfile
|
175
|
-
-
|
176
|
-
-
|
177
|
-
-
|
178
|
-
- Gemfile_ar40
|
195
|
+
- Gemfile_ar41
|
196
|
+
- Gemfile_ar50
|
197
|
+
- Gemfile_ar51
|
179
198
|
- Gemfile_ar_master
|
180
199
|
- LICENSE
|
181
200
|
- README.md
|
182
201
|
- RELEASING
|
183
202
|
- Rakefile
|
184
203
|
- bin/shopify
|
185
|
-
- lib/active_resource/base_ext.rb
|
186
204
|
- lib/active_resource/connection_ext.rb
|
187
205
|
- lib/active_resource/detailed_log_subscriber.rb
|
188
|
-
- lib/active_resource/disable_prefix_check.rb
|
189
206
|
- lib/active_resource/json_errors.rb
|
190
|
-
- lib/active_resource/to_query.rb
|
191
207
|
- lib/shopify_api.rb
|
208
|
+
- lib/shopify_api/api_version.rb
|
192
209
|
- lib/shopify_api/connection.rb
|
193
210
|
- lib/shopify_api/countable.rb
|
211
|
+
- lib/shopify_api/disable_prefix_check.rb
|
194
212
|
- lib/shopify_api/events.rb
|
195
|
-
- lib/shopify_api/json_format.rb
|
196
213
|
- lib/shopify_api/limits.rb
|
197
214
|
- lib/shopify_api/metafields.rb
|
198
215
|
- lib/shopify_api/resources.rb
|
@@ -241,7 +258,6 @@ files:
|
|
241
258
|
- lib/shopify_api/resources/marketing_event.rb
|
242
259
|
- lib/shopify_api/resources/metafield.rb
|
243
260
|
- lib/shopify_api/resources/note_attribute.rb
|
244
|
-
- lib/shopify_api/resources/o_auth.rb
|
245
261
|
- lib/shopify_api/resources/option.rb
|
246
262
|
- lib/shopify_api/resources/order.rb
|
247
263
|
- lib/shopify_api/resources/order_risk.rb
|
@@ -249,9 +265,6 @@ files:
|
|
249
265
|
- lib/shopify_api/resources/payment.rb
|
250
266
|
- lib/shopify_api/resources/payment_details.rb
|
251
267
|
- lib/shopify_api/resources/ping.rb
|
252
|
-
- lib/shopify_api/resources/ping/conversation.rb
|
253
|
-
- lib/shopify_api/resources/ping/delivery_confirmation_details.rb
|
254
|
-
- lib/shopify_api/resources/ping/message.rb
|
255
268
|
- lib/shopify_api/resources/policy.rb
|
256
269
|
- lib/shopify_api/resources/price_rule.rb
|
257
270
|
- lib/shopify_api/resources/product.rb
|
@@ -289,9 +302,11 @@ files:
|
|
289
302
|
- shipit.rubygems.yml
|
290
303
|
- shopify_api.gemspec
|
291
304
|
- test/abandoned_checkouts_test.rb
|
305
|
+
- test/access_scope_test.rb
|
292
306
|
- test/access_token_test.rb
|
293
307
|
- test/active_resource/json_errors_test.rb
|
294
308
|
- test/api_permission_test.rb
|
309
|
+
- test/api_version_test.rb
|
295
310
|
- test/application_charge_test.rb
|
296
311
|
- test/application_credit_test.rb
|
297
312
|
- test/article_test.rb
|
@@ -314,6 +329,7 @@ files:
|
|
314
329
|
- test/draft_order_test.rb
|
315
330
|
- test/fixtures/abandoned_checkout.json
|
316
331
|
- test/fixtures/abandoned_checkouts.json
|
332
|
+
- test/fixtures/access_scopes.json
|
317
333
|
- test/fixtures/access_token_delegate.json
|
318
334
|
- test/fixtures/application_charge.json
|
319
335
|
- test/fixtures/application_charges.json
|
@@ -366,7 +382,6 @@ files:
|
|
366
382
|
- test/fixtures/marketing_events.json
|
367
383
|
- test/fixtures/metafield.json
|
368
384
|
- test/fixtures/metafields.json
|
369
|
-
- test/fixtures/o_auth_revoke.json
|
370
385
|
- test/fixtures/order.json
|
371
386
|
- test/fixtures/order_risk.json
|
372
387
|
- test/fixtures/order_risks.json
|
@@ -427,12 +442,9 @@ files:
|
|
427
442
|
- test/location_test.rb
|
428
443
|
- test/marketing_event_test.rb
|
429
444
|
- test/metafield_test.rb
|
430
|
-
- test/o_auth_test.rb
|
431
445
|
- test/order_risk_test.rb
|
432
446
|
- test/order_test.rb
|
433
447
|
- test/payment_test.rb
|
434
|
-
- test/ping/conversation_test.rb
|
435
|
-
- test/ping/message_test.rb
|
436
448
|
- test/policy_test.rb
|
437
449
|
- test/price_rule_test.rb
|
438
450
|
- test/product_listing_test.rb
|
@@ -472,7 +484,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
472
484
|
requirements:
|
473
485
|
- - ">="
|
474
486
|
- !ruby/object:Gem::Version
|
475
|
-
version: '2.
|
487
|
+
version: '2.4'
|
476
488
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
477
489
|
requirements:
|
478
490
|
- - ">="
|