shopify_api 10.0.0 → 10.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.github/pull_request_template.md +2 -2
  3. data/.github/workflows/build.yml +1 -0
  4. data/CHANGELOG.md +238 -212
  5. data/Gemfile.lock +6 -6
  6. data/README.md +2 -6
  7. data/RELEASING.md +18 -0
  8. data/Rakefile +1 -1
  9. data/docs/usage/rest.md +5 -5
  10. data/lib/shopify_api/admin_versions.rb +14 -9
  11. data/lib/shopify_api/auth/jwt_payload.rb +6 -3
  12. data/lib/shopify_api/context.rb +2 -2
  13. data/lib/shopify_api/rest/base.rb +73 -31
  14. data/lib/shopify_api/rest/resources/2021_07/abandoned_checkout.rb +3 -4
  15. data/lib/shopify_api/rest/resources/2021_07/article.rb +9 -2
  16. data/lib/shopify_api/rest/resources/2021_07/gift_card_adjustment.rb +1 -1
  17. data/lib/shopify_api/rest/resources/2021_07/variant.rb +6 -2
  18. data/lib/shopify_api/rest/resources/2021_10/abandoned_checkout.rb +3 -4
  19. data/lib/shopify_api/rest/resources/2021_10/article.rb +9 -2
  20. data/lib/shopify_api/rest/resources/2021_10/gift_card_adjustment.rb +1 -1
  21. data/lib/shopify_api/rest/resources/2021_10/variant.rb +6 -2
  22. data/lib/shopify_api/rest/resources/2022_01/abandoned_checkout.rb +3 -4
  23. data/lib/shopify_api/rest/resources/2022_01/article.rb +9 -2
  24. data/lib/shopify_api/rest/resources/2022_01/gift_card_adjustment.rb +1 -1
  25. data/lib/shopify_api/rest/resources/2022_01/variant.rb +6 -2
  26. data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +3 -4
  27. data/lib/shopify_api/rest/resources/2022_04/article.rb +9 -2
  28. data/lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb +1 -1
  29. data/lib/shopify_api/rest/resources/2022_04/variant.rb +6 -2
  30. data/lib/shopify_api/version.rb +1 -1
  31. metadata +3 -3
  32. data/RELEASING +0 -17
@@ -41,6 +41,7 @@ module ShopifyAPI
41
41
  {http_method: :get, operation: :get, ids: [:blog_id], path: "blogs/<blog_id>/articles.json"},
42
42
  {http_method: :get, operation: :get, ids: [:blog_id, :id], path: "blogs/<blog_id>/articles/<id>.json"},
43
43
  {http_method: :get, operation: :tags, ids: [], path: "articles/tags.json"},
44
+ {http_method: :get, operation: :tags, ids: [:blog_id], path: "blogs/<blog_id>/articles/tags.json"},
44
45
  {http_method: :post, operation: :post, ids: [:blog_id], path: "blogs/<blog_id>/articles.json"},
45
46
  {http_method: :put, operation: :put, ids: [:blog_id, :id], path: "blogs/<blog_id>/articles/<id>.json"}
46
47
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
@@ -229,11 +230,17 @@ module ShopifyAPI
229
230
 
230
231
  sig do
231
232
  params(
233
+ blog_id: T.nilable(T.any(Integer, String)),
234
+ limit: T.untyped,
235
+ popular: T.untyped,
232
236
  session: Auth::Session,
233
237
  kwargs: T.untyped
234
238
  ).returns(T.untyped)
235
239
  end
236
240
  def tags(
241
+ blog_id: nil,
242
+ limit: nil,
243
+ popular: nil,
237
244
  session: ShopifyAPI::Context.active_session,
238
245
  **kwargs
239
246
  )
@@ -241,8 +248,8 @@ module ShopifyAPI
241
248
  http_method: :get,
242
249
  operation: :tags,
243
250
  session: session,
244
- ids: {},
245
- params: {}.merge(kwargs).compact,
251
+ ids: {blog_id: blog_id},
252
+ params: {limit: limit, popular: popular}.merge(kwargs).compact,
246
253
  body: {},
247
254
  entity: nil,
248
255
  )
@@ -30,7 +30,7 @@ module ShopifyAPI
30
30
  @has_many = T.let({}, T::Hash[Symbol, Class])
31
31
  @paths = T.let([
32
32
  {http_method: :get, operation: :get, ids: [:gift_card_id], path: "gift_cards/<gift_card_id>/adjustments.json"},
33
- {http_method: :get, operation: :get, ids: [:gift_card_id, :id], path: "gift_cards/<gift_card_id>/adjustments/2.json"},
33
+ {http_method: :get, operation: :get, ids: [:gift_card_id, :id], path: "gift_cards/<gift_card_id>/adjustments/<id>.json"},
34
34
  {http_method: :post, operation: :post, ids: [:gift_card_id], path: "gift_cards/<gift_card_id>/adjustments.json"}
35
35
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
36
36
 
@@ -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
 
@@ -50,6 +50,10 @@ module ShopifyAPI
50
50
  {http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/variants.json"},
51
51
  {http_method: :put, operation: :put, ids: [:id], path: "variants/<id>.json"}
52
52
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
53
+ @read_only_attributes = T.let([
54
+ :inventory_quantity,
55
+ :inventory_quantity_adjustment
56
+ ], T::Array[Symbol])
53
57
 
54
58
  sig { returns(T.nilable(String)) }
55
59
  attr_reader :barcode
@@ -99,7 +103,7 @@ module ShopifyAPI
99
103
  attr_reader :title
100
104
  sig { returns(T.nilable(String)) }
101
105
  attr_reader :updated_at
102
- sig { returns(T.nilable(Integer)) }
106
+ sig { returns(T.nilable(Float)) }
103
107
  attr_reader :weight
104
108
  sig { returns(T.nilable(String)) }
105
109
  attr_reader :weight_unit
@@ -61,7 +61,6 @@ module ShopifyAPI
61
61
  discount_codes: DiscountCode
62
62
  }, T::Hash[Symbol, Class])
63
63
  @paths = T.let([
64
- {http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"},
65
64
  {http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"}
66
65
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
67
66
 
@@ -147,25 +146,25 @@ module ShopifyAPI
147
146
  class << self
148
147
  sig do
149
148
  params(
149
+ limit: T.untyped,
150
150
  since_id: T.untyped,
151
151
  created_at_min: T.untyped,
152
152
  created_at_max: T.untyped,
153
153
  updated_at_min: T.untyped,
154
154
  updated_at_max: T.untyped,
155
155
  status: T.untyped,
156
- limit: T.untyped,
157
156
  session: Auth::Session,
158
157
  kwargs: T.untyped
159
158
  ).returns(T.untyped)
160
159
  end
161
160
  def checkouts(
161
+ limit: nil,
162
162
  since_id: nil,
163
163
  created_at_min: nil,
164
164
  created_at_max: nil,
165
165
  updated_at_min: nil,
166
166
  updated_at_max: nil,
167
167
  status: nil,
168
- limit: nil,
169
168
  session: ShopifyAPI::Context.active_session,
170
169
  **kwargs
171
170
  )
@@ -174,7 +173,7 @@ module ShopifyAPI
174
173
  operation: :checkouts,
175
174
  session: session,
176
175
  ids: {},
177
- params: {since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, status: status, limit: limit}.merge(kwargs).compact,
176
+ params: {limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, status: status}.merge(kwargs).compact,
178
177
  body: {},
179
178
  entity: nil,
180
179
  )
@@ -41,6 +41,7 @@ module ShopifyAPI
41
41
  {http_method: :get, operation: :get, ids: [:blog_id], path: "blogs/<blog_id>/articles.json"},
42
42
  {http_method: :get, operation: :get, ids: [:blog_id, :id], path: "blogs/<blog_id>/articles/<id>.json"},
43
43
  {http_method: :get, operation: :tags, ids: [], path: "articles/tags.json"},
44
+ {http_method: :get, operation: :tags, ids: [:blog_id], path: "blogs/<blog_id>/articles/tags.json"},
44
45
  {http_method: :post, operation: :post, ids: [:blog_id], path: "blogs/<blog_id>/articles.json"},
45
46
  {http_method: :put, operation: :put, ids: [:blog_id, :id], path: "blogs/<blog_id>/articles/<id>.json"}
46
47
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
@@ -229,11 +230,17 @@ module ShopifyAPI
229
230
 
230
231
  sig do
231
232
  params(
233
+ blog_id: T.nilable(T.any(Integer, String)),
234
+ limit: T.untyped,
235
+ popular: T.untyped,
232
236
  session: Auth::Session,
233
237
  kwargs: T.untyped
234
238
  ).returns(T.untyped)
235
239
  end
236
240
  def tags(
241
+ blog_id: nil,
242
+ limit: nil,
243
+ popular: nil,
237
244
  session: ShopifyAPI::Context.active_session,
238
245
  **kwargs
239
246
  )
@@ -241,8 +248,8 @@ module ShopifyAPI
241
248
  http_method: :get,
242
249
  operation: :tags,
243
250
  session: session,
244
- ids: {},
245
- params: {}.merge(kwargs).compact,
251
+ ids: {blog_id: blog_id},
252
+ params: {limit: limit, popular: popular}.merge(kwargs).compact,
246
253
  body: {},
247
254
  entity: nil,
248
255
  )
@@ -30,7 +30,7 @@ module ShopifyAPI
30
30
  @has_many = T.let({}, T::Hash[Symbol, Class])
31
31
  @paths = T.let([
32
32
  {http_method: :get, operation: :get, ids: [:gift_card_id], path: "gift_cards/<gift_card_id>/adjustments.json"},
33
- {http_method: :get, operation: :get, ids: [:gift_card_id, :id], path: "gift_cards/<gift_card_id>/adjustments/2.json"},
33
+ {http_method: :get, operation: :get, ids: [:gift_card_id, :id], path: "gift_cards/<gift_card_id>/adjustments/<id>.json"},
34
34
  {http_method: :post, operation: :post, ids: [:gift_card_id], path: "gift_cards/<gift_card_id>/adjustments.json"}
35
35
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
36
36
 
@@ -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
 
@@ -50,6 +50,10 @@ module ShopifyAPI
50
50
  {http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/variants.json"},
51
51
  {http_method: :put, operation: :put, ids: [:id], path: "variants/<id>.json"}
52
52
  ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
53
+ @read_only_attributes = T.let([
54
+ :inventory_quantity,
55
+ :inventory_quantity_adjustment
56
+ ], T::Array[Symbol])
53
57
 
54
58
  sig { returns(T.nilable(String)) }
55
59
  attr_reader :barcode
@@ -99,7 +103,7 @@ module ShopifyAPI
99
103
  attr_reader :title
100
104
  sig { returns(T.nilable(String)) }
101
105
  attr_reader :updated_at
102
- sig { returns(T.nilable(Integer)) }
106
+ sig { returns(T.nilable(Float)) }
103
107
  attr_reader :weight
104
108
  sig { returns(T.nilable(String)) }
105
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.0"
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.0
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-04 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.