shopify_api 14.0.0 → 14.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/BUG_REPORT.md +23 -17
  3. data/.github/workflows/build.yml +2 -0
  4. data/.rubocop.yml +0 -1
  5. data/.ruby-version +1 -0
  6. data/CHANGELOG.md +13 -0
  7. data/Gemfile +13 -1
  8. data/Gemfile.lock +24 -22
  9. data/dev.yml +1 -1
  10. data/docs/usage/custom_apps.md +3 -3
  11. data/docs/usage/graphql_storefront.md +13 -6
  12. data/docs/usage/rest.md +1 -1
  13. data/docs/usage/webhooks.md +2 -2
  14. data/lib/shopify_api/admin_versions.rb +2 -1
  15. data/lib/shopify_api/auth/session.rb +3 -3
  16. data/lib/shopify_api/clients/graphql/storefront.rb +26 -4
  17. data/lib/shopify_api/logger.rb +1 -1
  18. data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +5 -8
  19. data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +2 -2
  20. data/lib/shopify_api/rest/resources/2022_04/variant.rb +6 -6
  21. data/lib/shopify_api/rest/resources/2022_07/fulfillment_event.rb +5 -8
  22. data/lib/shopify_api/rest/resources/2022_07/inventory_item.rb +2 -2
  23. data/lib/shopify_api/rest/resources/2022_07/variant.rb +6 -6
  24. data/lib/shopify_api/rest/resources/2022_10/fulfillment_event.rb +5 -8
  25. data/lib/shopify_api/rest/resources/2022_10/inventory_item.rb +2 -2
  26. data/lib/shopify_api/rest/resources/2022_10/variant.rb +4 -4
  27. data/lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb +5 -8
  28. data/lib/shopify_api/rest/resources/2023_01/inventory_item.rb +2 -2
  29. data/lib/shopify_api/rest/resources/2023_01/variant.rb +4 -4
  30. data/lib/shopify_api/rest/resources/2023_04/fulfillment_event.rb +5 -8
  31. data/lib/shopify_api/rest/resources/2023_04/inventory_item.rb +2 -2
  32. data/lib/shopify_api/rest/resources/2023_04/variant.rb +4 -4
  33. data/lib/shopify_api/rest/resources/2023_07/fulfillment_event.rb +5 -8
  34. data/lib/shopify_api/rest/resources/2023_07/inventory_item.rb +2 -2
  35. data/lib/shopify_api/rest/resources/2023_07/variant.rb +4 -4
  36. data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +5 -8
  37. data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +2 -2
  38. data/lib/shopify_api/rest/resources/2023_10/variant.rb +4 -4
  39. data/lib/shopify_api/rest/resources/2024_01/fulfillment_event.rb +5 -8
  40. data/lib/shopify_api/rest/resources/2024_01/inventory_item.rb +2 -2
  41. data/lib/shopify_api/rest/resources/2024_01/variant.rb +4 -4
  42. data/lib/shopify_api/rest/resources/2024_04/abandoned_checkout.rb +194 -0
  43. data/lib/shopify_api/rest/resources/2024_04/access_scope.rb +62 -0
  44. data/lib/shopify_api/rest/resources/2024_04/apple_pay_certificate.rb +109 -0
  45. data/lib/shopify_api/rest/resources/2024_04/application_charge.rb +113 -0
  46. data/lib/shopify_api/rest/resources/2024_04/application_credit.rb +95 -0
  47. data/lib/shopify_api/rest/resources/2024_04/article.rb +269 -0
  48. data/lib/shopify_api/rest/resources/2024_04/asset.rb +122 -0
  49. data/lib/shopify_api/rest/resources/2024_04/assigned_fulfillment_order.rb +92 -0
  50. data/lib/shopify_api/rest/resources/2024_04/balance.rb +58 -0
  51. data/lib/shopify_api/rest/resources/2024_04/blog.rb +166 -0
  52. data/lib/shopify_api/rest/resources/2024_04/cancellation_request.rb +87 -0
  53. data/lib/shopify_api/rest/resources/2024_04/carrier_service.rb +120 -0
  54. data/lib/shopify_api/rest/resources/2024_04/checkout.rb +213 -0
  55. data/lib/shopify_api/rest/resources/2024_04/collect.rb +146 -0
  56. data/lib/shopify_api/rest/resources/2024_04/collection.rb +114 -0
  57. data/lib/shopify_api/rest/resources/2024_04/collection_listing.rb +159 -0
  58. data/lib/shopify_api/rest/resources/2024_04/comment.rb +287 -0
  59. data/lib/shopify_api/rest/resources/2024_04/country.rb +141 -0
  60. data/lib/shopify_api/rest/resources/2024_04/currency.rb +61 -0
  61. data/lib/shopify_api/rest/resources/2024_04/custom_collection.rb +191 -0
  62. data/lib/shopify_api/rest/resources/2024_04/customer.rb +333 -0
  63. data/lib/shopify_api/rest/resources/2024_04/customer_address.rb +215 -0
  64. data/lib/shopify_api/rest/resources/2024_04/deprecated_api_call.rb +61 -0
  65. data/lib/shopify_api/rest/resources/2024_04/discount_code.rb +226 -0
  66. data/lib/shopify_api/rest/resources/2024_04/dispute.rb +115 -0
  67. data/lib/shopify_api/rest/resources/2024_04/dispute_evidence.rb +121 -0
  68. data/lib/shopify_api/rest/resources/2024_04/dispute_file_upload.rb +85 -0
  69. data/lib/shopify_api/rest/resources/2024_04/draft_order.rb +279 -0
  70. data/lib/shopify_api/rest/resources/2024_04/event.rb +152 -0
  71. data/lib/shopify_api/rest/resources/2024_04/fulfillment.rb +235 -0
  72. data/lib/shopify_api/rest/resources/2024_04/fulfillment_event.rb +167 -0
  73. data/lib/shopify_api/rest/resources/2024_04/fulfillment_order.rb +326 -0
  74. data/lib/shopify_api/rest/resources/2024_04/fulfillment_request.rb +101 -0
  75. data/lib/shopify_api/rest/resources/2024_04/fulfillment_service.rb +134 -0
  76. data/lib/shopify_api/rest/resources/2024_04/gift_card.rb +222 -0
  77. data/lib/shopify_api/rest/resources/2024_04/gift_card_adjustment.rb +122 -0
  78. data/lib/shopify_api/rest/resources/2024_04/image.rb +161 -0
  79. data/lib/shopify_api/rest/resources/2024_04/inventory_item.rb +112 -0
  80. data/lib/shopify_api/rest/resources/2024_04/inventory_level.rb +183 -0
  81. data/lib/shopify_api/rest/resources/2024_04/location.rb +171 -0
  82. data/lib/shopify_api/rest/resources/2024_04/locations_for_move.rb +60 -0
  83. data/lib/shopify_api/rest/resources/2024_04/marketing_event.rb +213 -0
  84. data/lib/shopify_api/rest/resources/2024_04/metafield.rb +348 -0
  85. data/lib/shopify_api/rest/resources/2024_04/mobile_platform_application.rb +114 -0
  86. data/lib/shopify_api/rest/resources/2024_04/order.rb +489 -0
  87. data/lib/shopify_api/rest/resources/2024_04/order_risk.rb +148 -0
  88. data/lib/shopify_api/rest/resources/2024_04/page.rb +198 -0
  89. data/lib/shopify_api/rest/resources/2024_04/payment.rb +144 -0
  90. data/lib/shopify_api/rest/resources/2024_04/payment_gateway.rb +147 -0
  91. data/lib/shopify_api/rest/resources/2024_04/payment_transaction.rb +114 -0
  92. data/lib/shopify_api/rest/resources/2024_04/payout.rb +101 -0
  93. data/lib/shopify_api/rest/resources/2024_04/policy.rb +73 -0
  94. data/lib/shopify_api/rest/resources/2024_04/price_rule.rb +227 -0
  95. data/lib/shopify_api/rest/resources/2024_04/product.rb +227 -0
  96. data/lib/shopify_api/rest/resources/2024_04/product_listing.rb +200 -0
  97. data/lib/shopify_api/rest/resources/2024_04/product_resource_feedback.rb +92 -0
  98. data/lib/shopify_api/rest/resources/2024_04/province.rb +136 -0
  99. data/lib/shopify_api/rest/resources/2024_04/recurring_application_charge.rb +176 -0
  100. data/lib/shopify_api/rest/resources/2024_04/redirect.rb +143 -0
  101. data/lib/shopify_api/rest/resources/2024_04/refund.rb +155 -0
  102. data/lib/shopify_api/rest/resources/2024_04/resource_feedback.rb +77 -0
  103. data/lib/shopify_api/rest/resources/2024_04/script_tag.rb +159 -0
  104. data/lib/shopify_api/rest/resources/2024_04/shipping_zone.rb +87 -0
  105. data/lib/shopify_api/rest/resources/2024_04/shop.rb +222 -0
  106. data/lib/shopify_api/rest/resources/2024_04/smart_collection.rb +220 -0
  107. data/lib/shopify_api/rest/resources/2024_04/storefront_access_token.rb +91 -0
  108. data/lib/shopify_api/rest/resources/2024_04/tender_transaction.rb +97 -0
  109. data/lib/shopify_api/rest/resources/2024_04/theme.rb +127 -0
  110. data/lib/shopify_api/rest/resources/2024_04/transaction.rb +188 -0
  111. data/lib/shopify_api/rest/resources/2024_04/usage_charge.rb +106 -0
  112. data/lib/shopify_api/rest/resources/2024_04/user.rb +142 -0
  113. data/lib/shopify_api/rest/resources/2024_04/variant.rb +212 -0
  114. data/lib/shopify_api/rest/resources/2024_04/webhook.rb +172 -0
  115. data/lib/shopify_api/version.rb +1 -1
  116. data/lib/shopify_api/webhooks/registry.rb +6 -6
  117. data/lib/shopify_api.rb +1 -0
  118. data/shopify_api.gemspec +0 -8
  119. metadata +77 -101
@@ -0,0 +1,212 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class Variant < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @barcode = T.let(nil, T.nilable(String))
22
+ @compare_at_price = T.let(nil, T.nilable(String))
23
+ @created_at = T.let(nil, T.nilable(String))
24
+ @fulfillment_service = T.let(nil, T.nilable(String))
25
+ @grams = T.let(nil, T.nilable(Integer))
26
+ @id = T.let(nil, T.nilable(Integer))
27
+ @image_id = T.let(nil, T.nilable(Integer))
28
+ @inventory_item_id = T.let(nil, T.nilable(Integer))
29
+ @inventory_management = T.let(nil, T.nilable(String))
30
+ @inventory_policy = T.let(nil, T.nilable(String))
31
+ @inventory_quantity = T.let(nil, T.nilable(T.any(Integer, String)))
32
+ @old_inventory_quantity = T.let(nil, T.nilable(T.any(Integer, String)))
33
+ @option = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
34
+ @position = T.let(nil, T.nilable(Integer))
35
+ @presentment_prices = T.let(nil, T.nilable(T::Array[T.untyped]))
36
+ @price = T.let(nil, T.nilable(String))
37
+ @product_id = T.let(nil, T.nilable(Integer))
38
+ @requires_shipping = T.let(nil, T.nilable(T::Boolean))
39
+ @sku = T.let(nil, T.nilable(String))
40
+ @tax_code = T.let(nil, T.nilable(String))
41
+ @taxable = T.let(nil, T.nilable(T::Boolean))
42
+ @title = T.let(nil, T.nilable(String))
43
+ @updated_at = T.let(nil, T.nilable(String))
44
+ @weight = T.let(nil, T.nilable(Float))
45
+ @weight_unit = T.let(nil, T.nilable(String))
46
+
47
+ super(session: session, from_hash: from_hash)
48
+ end
49
+
50
+ @has_one = T.let({}, T::Hash[Symbol, Class])
51
+ @has_many = T.let({}, T::Hash[Symbol, Class])
52
+ @paths = T.let([
53
+ {http_method: :delete, operation: :delete, ids: [:product_id, :id], path: "products/<product_id>/variants/<id>.json"},
54
+ {http_method: :get, operation: :count, ids: [:product_id], path: "products/<product_id>/variants/count.json"},
55
+ {http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/variants.json"},
56
+ {http_method: :get, operation: :get, ids: [:id], path: "variants/<id>.json"},
57
+ {http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/variants.json"},
58
+ {http_method: :put, operation: :put, ids: [:id], path: "variants/<id>.json"}
59
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
60
+ @read_only_attributes = T.let([
61
+ :inventory_quantity
62
+ ], T::Array[Symbol])
63
+
64
+ sig { returns(T.nilable(String)) }
65
+ attr_reader :barcode
66
+ sig { returns(T.nilable(String)) }
67
+ attr_reader :compare_at_price
68
+ sig { returns(T.nilable(String)) }
69
+ attr_reader :created_at
70
+ sig { returns(T.nilable(String)) }
71
+ attr_reader :fulfillment_service
72
+ sig { returns(T.nilable(Integer)) }
73
+ attr_reader :grams
74
+ sig { returns(T.nilable(Integer)) }
75
+ attr_reader :id
76
+ sig { returns(T.nilable(Integer)) }
77
+ attr_reader :image_id
78
+ sig { returns(T.nilable(Integer)) }
79
+ attr_reader :inventory_item_id
80
+ sig { returns(T.nilable(String)) }
81
+ attr_reader :inventory_management
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :inventory_policy
84
+ sig { returns(T.nilable(T.any(Integer, String))) }
85
+ attr_reader :inventory_quantity
86
+ sig { returns(T.nilable(T.any(Integer, String))) }
87
+ attr_reader :old_inventory_quantity
88
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
89
+ attr_reader :option
90
+ sig { returns(T.nilable(Integer)) }
91
+ attr_reader :position
92
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
93
+ attr_reader :presentment_prices
94
+ sig { returns(T.nilable(String)) }
95
+ attr_reader :price
96
+ sig { returns(T.nilable(Integer)) }
97
+ attr_reader :product_id
98
+ sig { returns(T.nilable(T::Boolean)) }
99
+ attr_reader :requires_shipping
100
+ sig { returns(T.nilable(String)) }
101
+ attr_reader :sku
102
+ sig { returns(T.nilable(String)) }
103
+ attr_reader :tax_code
104
+ sig { returns(T.nilable(T::Boolean)) }
105
+ attr_reader :taxable
106
+ sig { returns(T.nilable(String)) }
107
+ attr_reader :title
108
+ sig { returns(T.nilable(String)) }
109
+ attr_reader :updated_at
110
+ sig { returns(T.nilable(Float)) }
111
+ attr_reader :weight
112
+ sig { returns(T.nilable(String)) }
113
+ attr_reader :weight_unit
114
+
115
+ class << self
116
+ sig do
117
+ params(
118
+ id: T.any(Integer, String),
119
+ fields: T.untyped,
120
+ session: Auth::Session
121
+ ).returns(T.nilable(Variant))
122
+ end
123
+ def find(
124
+ id:,
125
+ fields: nil,
126
+ session: ShopifyAPI::Context.active_session
127
+ )
128
+ result = base_find(
129
+ session: session,
130
+ ids: {id: id},
131
+ params: {fields: fields},
132
+ )
133
+ T.cast(result[0], T.nilable(Variant))
134
+ end
135
+
136
+ sig do
137
+ params(
138
+ id: T.any(Integer, String),
139
+ product_id: T.nilable(T.any(Integer, String)),
140
+ session: Auth::Session
141
+ ).returns(T.untyped)
142
+ end
143
+ def delete(
144
+ id:,
145
+ product_id: nil,
146
+ session: ShopifyAPI::Context.active_session
147
+ )
148
+ request(
149
+ http_method: :delete,
150
+ operation: :delete,
151
+ session: session,
152
+ ids: {id: id, product_id: product_id},
153
+ params: {},
154
+ )
155
+ end
156
+
157
+ sig do
158
+ params(
159
+ product_id: T.nilable(T.any(Integer, String)),
160
+ limit: T.untyped,
161
+ presentment_currencies: T.untyped,
162
+ since_id: T.untyped,
163
+ fields: T.untyped,
164
+ session: Auth::Session,
165
+ kwargs: T.untyped
166
+ ).returns(T::Array[Variant])
167
+ end
168
+ def all(
169
+ product_id: nil,
170
+ limit: nil,
171
+ presentment_currencies: nil,
172
+ since_id: nil,
173
+ fields: nil,
174
+ session: ShopifyAPI::Context.active_session,
175
+ **kwargs
176
+ )
177
+ response = base_find(
178
+ session: session,
179
+ ids: {product_id: product_id},
180
+ params: {limit: limit, presentment_currencies: presentment_currencies, since_id: since_id, fields: fields}.merge(kwargs).compact,
181
+ )
182
+
183
+ T.cast(response, T::Array[Variant])
184
+ end
185
+
186
+ sig do
187
+ params(
188
+ product_id: T.nilable(T.any(Integer, String)),
189
+ session: Auth::Session,
190
+ kwargs: T.untyped
191
+ ).returns(T.untyped)
192
+ end
193
+ def count(
194
+ product_id: nil,
195
+ session: ShopifyAPI::Context.active_session,
196
+ **kwargs
197
+ )
198
+ request(
199
+ http_method: :get,
200
+ operation: :count,
201
+ session: session,
202
+ ids: {product_id: product_id},
203
+ params: {}.merge(kwargs).compact,
204
+ body: {},
205
+ entity: nil,
206
+ )
207
+ end
208
+
209
+ end
210
+
211
+ end
212
+ end
@@ -0,0 +1,172 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class Webhook < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @address = T.let(nil, T.nilable(String))
22
+ @topic = T.let(nil, T.nilable(String))
23
+ @api_version = T.let(nil, T.nilable(String))
24
+ @created_at = T.let(nil, T.nilable(String))
25
+ @fields = T.let(nil, T.nilable(T::Array[T.untyped]))
26
+ @format = T.let(nil, T.nilable(String))
27
+ @id = T.let(nil, T.nilable(Integer))
28
+ @metafield_namespaces = T.let(nil, T.nilable(T::Array[T.untyped]))
29
+ @private_metafield_namespaces = T.let(nil, T.nilable(T::Array[T.untyped]))
30
+ @updated_at = T.let(nil, T.nilable(String))
31
+
32
+ super(session: session, from_hash: from_hash)
33
+ end
34
+
35
+ @has_one = T.let({}, T::Hash[Symbol, Class])
36
+ @has_many = T.let({}, T::Hash[Symbol, Class])
37
+ @paths = T.let([
38
+ {http_method: :delete, operation: :delete, ids: [:id], path: "webhooks/<id>.json"},
39
+ {http_method: :get, operation: :count, ids: [], path: "webhooks/count.json"},
40
+ {http_method: :get, operation: :get, ids: [], path: "webhooks.json"},
41
+ {http_method: :get, operation: :get, ids: [:id], path: "webhooks/<id>.json"},
42
+ {http_method: :post, operation: :post, ids: [], path: "webhooks.json"},
43
+ {http_method: :put, operation: :put, ids: [:id], path: "webhooks/<id>.json"}
44
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
45
+
46
+ sig { returns(T.nilable(String)) }
47
+ attr_reader :address
48
+ sig { returns(T.nilable(String)) }
49
+ attr_reader :topic
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :api_version
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :created_at
54
+ sig { returns(T.nilable(T::Array[String])) }
55
+ attr_reader :fields
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :format
58
+ sig { returns(T.nilable(Integer)) }
59
+ attr_reader :id
60
+ sig { returns(T.nilable(T::Array[String])) }
61
+ attr_reader :metafield_namespaces
62
+ sig { returns(T.nilable(T::Array[String])) }
63
+ attr_reader :private_metafield_namespaces
64
+ sig { returns(T.nilable(String)) }
65
+ attr_reader :updated_at
66
+
67
+ class << self
68
+ sig do
69
+ params(
70
+ id: T.any(Integer, String),
71
+ fields: T.untyped,
72
+ session: Auth::Session
73
+ ).returns(T.nilable(Webhook))
74
+ end
75
+ def find(
76
+ id:,
77
+ fields: nil,
78
+ session: ShopifyAPI::Context.active_session
79
+ )
80
+ result = base_find(
81
+ session: session,
82
+ ids: {id: id},
83
+ params: {fields: fields},
84
+ )
85
+ T.cast(result[0], T.nilable(Webhook))
86
+ end
87
+
88
+ sig do
89
+ params(
90
+ id: T.any(Integer, String),
91
+ session: Auth::Session
92
+ ).returns(T.untyped)
93
+ end
94
+ def delete(
95
+ id:,
96
+ session: ShopifyAPI::Context.active_session
97
+ )
98
+ request(
99
+ http_method: :delete,
100
+ operation: :delete,
101
+ session: session,
102
+ ids: {id: id},
103
+ params: {},
104
+ )
105
+ end
106
+
107
+ sig do
108
+ params(
109
+ address: T.untyped,
110
+ created_at_max: T.untyped,
111
+ created_at_min: T.untyped,
112
+ fields: T.untyped,
113
+ limit: T.untyped,
114
+ since_id: T.untyped,
115
+ topic: T.untyped,
116
+ updated_at_min: T.untyped,
117
+ updated_at_max: T.untyped,
118
+ session: Auth::Session,
119
+ kwargs: T.untyped
120
+ ).returns(T::Array[Webhook])
121
+ end
122
+ def all(
123
+ address: nil,
124
+ created_at_max: nil,
125
+ created_at_min: nil,
126
+ fields: nil,
127
+ limit: nil,
128
+ since_id: nil,
129
+ topic: nil,
130
+ updated_at_min: nil,
131
+ updated_at_max: nil,
132
+ session: ShopifyAPI::Context.active_session,
133
+ **kwargs
134
+ )
135
+ response = base_find(
136
+ session: session,
137
+ ids: {},
138
+ params: {address: address, created_at_max: created_at_max, created_at_min: created_at_min, fields: fields, limit: limit, since_id: since_id, topic: topic, updated_at_min: updated_at_min, updated_at_max: updated_at_max}.merge(kwargs).compact,
139
+ )
140
+
141
+ T.cast(response, T::Array[Webhook])
142
+ end
143
+
144
+ sig do
145
+ params(
146
+ address: T.untyped,
147
+ topic: T.untyped,
148
+ session: Auth::Session,
149
+ kwargs: T.untyped
150
+ ).returns(T.untyped)
151
+ end
152
+ def count(
153
+ address: nil,
154
+ topic: nil,
155
+ session: ShopifyAPI::Context.active_session,
156
+ **kwargs
157
+ )
158
+ request(
159
+ http_method: :get,
160
+ operation: :count,
161
+ session: session,
162
+ ids: {},
163
+ params: {address: address, topic: topic}.merge(kwargs).compact,
164
+ body: {},
165
+ entity: nil,
166
+ )
167
+ end
168
+
169
+ end
170
+
171
+ end
172
+ end
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module ShopifyAPI
5
- VERSION = "14.0.0"
5
+ VERSION = "14.1.0"
6
6
  end
@@ -198,12 +198,12 @@ module ShopifyAPI
198
198
  body: request.parsed_body, api_version: request.api_version, webhook_id: request.webhook_id))
199
199
  else
200
200
  handler.handle(topic: request.topic, shop: request.shop, body: request.parsed_body)
201
- ShopifyAPI::Logger.deprecated(
202
- "DEPRECATED: Use ShopifyAPI::Webhooks::WebhookHandler#handle \
203
- instead of ShopifyAPI::Webhooks::Handler#handle.
204
- https://github.com/Shopify/shopify-api-ruby/blob/main/docs/usage/webhooks.md#create-a-webhook-handler",
205
- "14.0.0",
206
- )
201
+ warning = <<~WARNING
202
+ DEPRECATED: Use ShopifyAPI::Webhooks::WebhookHandler#handle instead of
203
+ ShopifyAPI::Webhooks::Handler#handle.
204
+ https://github.com/Shopify/shopify-api-ruby/blob/main/docs/usage/webhooks.md#create-a-webhook-handler
205
+ WARNING
206
+ ShopifyAPI::Logger.deprecated(warning, "15.0.0")
207
207
  end
208
208
  end
209
209
 
data/lib/shopify_api.rb CHANGED
@@ -16,6 +16,7 @@ require "concurrent"
16
16
 
17
17
  require_relative "shopify_api/inflector"
18
18
  require_relative "shopify_api/admin_versions"
19
+ require_relative "shopify_api/webhooks/handler"
19
20
 
20
21
  loader = Zeitwerk::Loader.for_gem
21
22
  loader.inflector = ShopifyAPI::Inflector.new(__FILE__)
data/shopify_api.gemspec CHANGED
@@ -42,12 +42,4 @@ Gem::Specification.new do |s|
42
42
  s.add_runtime_dependency("securerandom")
43
43
  s.add_runtime_dependency("sorbet-runtime")
44
44
  s.add_runtime_dependency("zeitwerk", "~> 2.5")
45
-
46
- s.add_development_dependency("pry-byebug")
47
- s.add_development_dependency("rake")
48
- s.add_development_dependency("rubocop")
49
- s.add_development_dependency("rubocop-shopify")
50
- s.add_development_dependency("rubocop-sorbet")
51
- s.add_development_dependency("sorbet")
52
- s.add_development_dependency("tapioca")
53
45
  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: 14.0.0
4
+ version: 14.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-26 00:00:00.000000000 Z
11
+ date: 2024-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -150,104 +150,6 @@ dependencies:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '2.5'
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'
167
- - !ruby/object:Gem::Dependency
168
- name: rake
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: rubocop
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: rubocop-shopify
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
- - !ruby/object:Gem::Dependency
210
- name: rubocop-sorbet
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- version: '0'
216
- type: :development
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - ">="
221
- - !ruby/object:Gem::Version
222
- version: '0'
223
- - !ruby/object:Gem::Dependency
224
- name: sorbet
225
- requirement: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - ">="
228
- - !ruby/object:Gem::Version
229
- version: '0'
230
- type: :development
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- requirements:
234
- - - ">="
235
- - !ruby/object:Gem::Version
236
- version: '0'
237
- - !ruby/object:Gem::Dependency
238
- name: tapioca
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - ">="
242
- - !ruby/object:Gem::Version
243
- version: '0'
244
- type: :development
245
- prerelease: false
246
- version_requirements: !ruby/object:Gem::Requirement
247
- requirements:
248
- - - ">="
249
- - !ruby/object:Gem::Version
250
- version: '0'
251
153
  description: |
252
154
  This gem allows Ruby developers to programmatically access the admin
253
155
  section of Shopify stores.
@@ -273,6 +175,7 @@ files:
273
175
  - ".github/workflows/close-waiting-for-response-issues.yml"
274
176
  - ".github/workflows/remove-labels-on-activity.yml"
275
177
  - ".rubocop.yml"
178
+ - ".ruby-version"
276
179
  - BREAKING_CHANGES_FOR_OLDER_VERSIONS.md
277
180
  - BREAKING_CHANGES_FOR_V10.md
278
181
  - CHANGELOG.md
@@ -941,6 +844,79 @@ files:
941
844
  - lib/shopify_api/rest/resources/2024_01/user.rb
942
845
  - lib/shopify_api/rest/resources/2024_01/variant.rb
943
846
  - lib/shopify_api/rest/resources/2024_01/webhook.rb
847
+ - lib/shopify_api/rest/resources/2024_04/abandoned_checkout.rb
848
+ - lib/shopify_api/rest/resources/2024_04/access_scope.rb
849
+ - lib/shopify_api/rest/resources/2024_04/apple_pay_certificate.rb
850
+ - lib/shopify_api/rest/resources/2024_04/application_charge.rb
851
+ - lib/shopify_api/rest/resources/2024_04/application_credit.rb
852
+ - lib/shopify_api/rest/resources/2024_04/article.rb
853
+ - lib/shopify_api/rest/resources/2024_04/asset.rb
854
+ - lib/shopify_api/rest/resources/2024_04/assigned_fulfillment_order.rb
855
+ - lib/shopify_api/rest/resources/2024_04/balance.rb
856
+ - lib/shopify_api/rest/resources/2024_04/blog.rb
857
+ - lib/shopify_api/rest/resources/2024_04/cancellation_request.rb
858
+ - lib/shopify_api/rest/resources/2024_04/carrier_service.rb
859
+ - lib/shopify_api/rest/resources/2024_04/checkout.rb
860
+ - lib/shopify_api/rest/resources/2024_04/collect.rb
861
+ - lib/shopify_api/rest/resources/2024_04/collection.rb
862
+ - lib/shopify_api/rest/resources/2024_04/collection_listing.rb
863
+ - lib/shopify_api/rest/resources/2024_04/comment.rb
864
+ - lib/shopify_api/rest/resources/2024_04/country.rb
865
+ - lib/shopify_api/rest/resources/2024_04/currency.rb
866
+ - lib/shopify_api/rest/resources/2024_04/custom_collection.rb
867
+ - lib/shopify_api/rest/resources/2024_04/customer.rb
868
+ - lib/shopify_api/rest/resources/2024_04/customer_address.rb
869
+ - lib/shopify_api/rest/resources/2024_04/deprecated_api_call.rb
870
+ - lib/shopify_api/rest/resources/2024_04/discount_code.rb
871
+ - lib/shopify_api/rest/resources/2024_04/dispute.rb
872
+ - lib/shopify_api/rest/resources/2024_04/dispute_evidence.rb
873
+ - lib/shopify_api/rest/resources/2024_04/dispute_file_upload.rb
874
+ - lib/shopify_api/rest/resources/2024_04/draft_order.rb
875
+ - lib/shopify_api/rest/resources/2024_04/event.rb
876
+ - lib/shopify_api/rest/resources/2024_04/fulfillment.rb
877
+ - lib/shopify_api/rest/resources/2024_04/fulfillment_event.rb
878
+ - lib/shopify_api/rest/resources/2024_04/fulfillment_order.rb
879
+ - lib/shopify_api/rest/resources/2024_04/fulfillment_request.rb
880
+ - lib/shopify_api/rest/resources/2024_04/fulfillment_service.rb
881
+ - lib/shopify_api/rest/resources/2024_04/gift_card.rb
882
+ - lib/shopify_api/rest/resources/2024_04/gift_card_adjustment.rb
883
+ - lib/shopify_api/rest/resources/2024_04/image.rb
884
+ - lib/shopify_api/rest/resources/2024_04/inventory_item.rb
885
+ - lib/shopify_api/rest/resources/2024_04/inventory_level.rb
886
+ - lib/shopify_api/rest/resources/2024_04/location.rb
887
+ - lib/shopify_api/rest/resources/2024_04/locations_for_move.rb
888
+ - lib/shopify_api/rest/resources/2024_04/marketing_event.rb
889
+ - lib/shopify_api/rest/resources/2024_04/metafield.rb
890
+ - lib/shopify_api/rest/resources/2024_04/mobile_platform_application.rb
891
+ - lib/shopify_api/rest/resources/2024_04/order.rb
892
+ - lib/shopify_api/rest/resources/2024_04/order_risk.rb
893
+ - lib/shopify_api/rest/resources/2024_04/page.rb
894
+ - lib/shopify_api/rest/resources/2024_04/payment.rb
895
+ - lib/shopify_api/rest/resources/2024_04/payment_gateway.rb
896
+ - lib/shopify_api/rest/resources/2024_04/payment_transaction.rb
897
+ - lib/shopify_api/rest/resources/2024_04/payout.rb
898
+ - lib/shopify_api/rest/resources/2024_04/policy.rb
899
+ - lib/shopify_api/rest/resources/2024_04/price_rule.rb
900
+ - lib/shopify_api/rest/resources/2024_04/product.rb
901
+ - lib/shopify_api/rest/resources/2024_04/product_listing.rb
902
+ - lib/shopify_api/rest/resources/2024_04/product_resource_feedback.rb
903
+ - lib/shopify_api/rest/resources/2024_04/province.rb
904
+ - lib/shopify_api/rest/resources/2024_04/recurring_application_charge.rb
905
+ - lib/shopify_api/rest/resources/2024_04/redirect.rb
906
+ - lib/shopify_api/rest/resources/2024_04/refund.rb
907
+ - lib/shopify_api/rest/resources/2024_04/resource_feedback.rb
908
+ - lib/shopify_api/rest/resources/2024_04/script_tag.rb
909
+ - lib/shopify_api/rest/resources/2024_04/shipping_zone.rb
910
+ - lib/shopify_api/rest/resources/2024_04/shop.rb
911
+ - lib/shopify_api/rest/resources/2024_04/smart_collection.rb
912
+ - lib/shopify_api/rest/resources/2024_04/storefront_access_token.rb
913
+ - lib/shopify_api/rest/resources/2024_04/tender_transaction.rb
914
+ - lib/shopify_api/rest/resources/2024_04/theme.rb
915
+ - lib/shopify_api/rest/resources/2024_04/transaction.rb
916
+ - lib/shopify_api/rest/resources/2024_04/usage_charge.rb
917
+ - lib/shopify_api/rest/resources/2024_04/user.rb
918
+ - lib/shopify_api/rest/resources/2024_04/variant.rb
919
+ - lib/shopify_api/rest/resources/2024_04/webhook.rb
944
920
  - lib/shopify_api/utils/attributes_comparator.rb
945
921
  - lib/shopify_api/utils/graphql_proxy.rb
946
922
  - lib/shopify_api/utils/hmac_validator.rb
@@ -1033,7 +1009,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1033
1009
  - !ruby/object:Gem::Version
1034
1010
  version: '0'
1035
1011
  requirements: []
1036
- rubygems_version: 3.5.6
1012
+ rubygems_version: 3.5.7
1037
1013
  signing_key:
1038
1014
  specification_version: 4
1039
1015
  summary: The gem for accessing the Shopify API