shopify_api 11.1.0 → 12.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/BUG_REPORT.md +40 -0
  3. data/.github/ISSUE_TEMPLATE/ENHANCEMENT.md +9 -0
  4. data/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +9 -0
  5. data/.github/workflows/build.yml +0 -3
  6. data/.github/workflows/close-waiting-for-response-issues.yml +20 -0
  7. data/.github/workflows/remove-labels-on-activity.yml +16 -0
  8. data/.github/workflows/stale.yml +33 -0
  9. data/CHANGELOG.md +30 -0
  10. data/Gemfile +1 -0
  11. data/Gemfile.lock +55 -39
  12. data/README.md +12 -14
  13. data/docs/getting_started.md +1 -1
  14. data/docs/usage/oauth.md +3 -4
  15. data/docs/usage/session_storage.md +1 -1
  16. data/lib/shopify_api/admin_versions.rb +3 -2
  17. data/lib/shopify_api/auth/jwt_payload.rb +2 -2
  18. data/lib/shopify_api/auth/oauth/auth_query.rb +1 -1
  19. data/lib/shopify_api/auth/oauth.rb +18 -12
  20. data/lib/shopify_api/auth/session.rb +1 -1
  21. data/lib/shopify_api/clients/graphql/client.rb +3 -3
  22. data/lib/shopify_api/clients/graphql/storefront.rb +2 -2
  23. data/lib/shopify_api/clients/http_client.rb +4 -4
  24. data/lib/shopify_api/clients/rest/admin.rb +10 -10
  25. data/lib/shopify_api/context.rb +57 -16
  26. data/lib/shopify_api/errors/feature_deprecated_error.rb +9 -0
  27. data/lib/shopify_api/errors/http_response_error.rb +7 -3
  28. data/lib/shopify_api/errors/log_level_not_found_error.rb +9 -0
  29. data/lib/shopify_api/logger.rb +82 -0
  30. data/lib/shopify_api/rest/base.rb +14 -7
  31. data/lib/shopify_api/rest/resources/2022_01/abandoned_checkout.rb +4 -3
  32. data/lib/shopify_api/rest/resources/2022_01/assigned_fulfillment_order.rb +7 -0
  33. data/lib/shopify_api/rest/resources/2022_01/customer.rb +35 -1
  34. data/lib/shopify_api/rest/resources/2022_01/draft_order.rb +3 -1
  35. data/lib/shopify_api/rest/resources/2022_01/fulfillment.rb +5 -1
  36. data/lib/shopify_api/rest/resources/2022_01/fulfillment_order.rb +3 -3
  37. data/lib/shopify_api/rest/resources/2022_01/fulfillment_request.rb +5 -1
  38. data/lib/shopify_api/rest/resources/2022_01/gift_card.rb +9 -1
  39. data/lib/shopify_api/rest/resources/2022_01/metafield.rb +12 -5
  40. data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +4 -3
  41. data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +7 -0
  42. data/lib/shopify_api/rest/resources/2022_04/customer.rb +35 -1
  43. data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +3 -1
  44. data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +5 -1
  45. data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +3 -3
  46. data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +5 -1
  47. data/lib/shopify_api/rest/resources/2022_04/gift_card.rb +9 -1
  48. data/lib/shopify_api/rest/resources/2022_04/metafield.rb +10 -8
  49. data/lib/shopify_api/rest/resources/2022_07/abandoned_checkout.rb +4 -3
  50. data/lib/shopify_api/rest/resources/2022_07/assigned_fulfillment_order.rb +7 -0
  51. data/lib/shopify_api/rest/resources/2022_07/customer.rb +29 -1
  52. data/lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb +2 -2
  53. data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +5 -1
  54. data/lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb +3 -3
  55. data/lib/shopify_api/rest/resources/2022_07/gift_card.rb +9 -1
  56. data/lib/shopify_api/rest/resources/2022_07/metafield.rb +10 -8
  57. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/abandoned_checkout.rb +4 -3
  58. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/assigned_fulfillment_order.rb +7 -0
  59. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/carrier_service.rb +0 -3
  60. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/customer.rb +38 -1
  61. data/lib/shopify_api/rest/resources/2022_10/dispute_evidence.rb +117 -0
  62. data/lib/shopify_api/rest/resources/2022_10/dispute_file_upload.rb +81 -0
  63. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/draft_order.rb +3 -1
  64. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment.rb +7 -50
  65. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_order.rb +33 -4
  66. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_request.rb +5 -1
  67. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_service.rb +3 -3
  68. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/gift_card.rb +9 -1
  69. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/metafield.rb +10 -8
  70. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/order.rb +3 -0
  71. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/price_rule.rb +3 -3
  72. data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/shop.rb +3 -0
  73. data/lib/shopify_api/rest/resources/2023_01/abandoned_checkout.rb +190 -0
  74. data/lib/shopify_api/rest/resources/2023_01/access_scope.rb +58 -0
  75. data/lib/shopify_api/rest/resources/2023_01/apple_pay_certificate.rb +105 -0
  76. data/lib/shopify_api/rest/resources/2023_01/application_charge.rb +104 -0
  77. data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +87 -0
  78. data/lib/shopify_api/rest/resources/2023_01/article.rb +265 -0
  79. data/lib/shopify_api/rest/resources/2023_01/asset.rb +118 -0
  80. data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +86 -0
  81. data/lib/shopify_api/rest/resources/2023_01/balance.rb +50 -0
  82. data/lib/shopify_api/rest/resources/2023_01/blog.rb +162 -0
  83. data/lib/shopify_api/rest/resources/2023_01/cancellation_request.rb +83 -0
  84. data/lib/shopify_api/rest/resources/2023_01/carrier_service.rb +113 -0
  85. data/lib/shopify_api/rest/resources/2023_01/checkout.rb +209 -0
  86. data/lib/shopify_api/rest/resources/2023_01/collect.rb +142 -0
  87. data/lib/shopify_api/rest/resources/2023_01/collection.rb +110 -0
  88. data/lib/shopify_api/rest/resources/2023_01/collection_listing.rb +155 -0
  89. data/lib/shopify_api/rest/resources/2023_01/comment.rb +283 -0
  90. data/lib/shopify_api/rest/resources/2023_01/country.rb +137 -0
  91. data/lib/shopify_api/rest/resources/2023_01/currency.rb +57 -0
  92. data/lib/shopify_api/rest/resources/2023_01/custom_collection.rb +187 -0
  93. data/lib/shopify_api/rest/resources/2023_01/customer.rb +329 -0
  94. data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +201 -0
  95. data/lib/shopify_api/rest/resources/2023_01/customer_saved_search.rb +169 -0
  96. data/lib/shopify_api/rest/resources/2023_01/deprecated_api_call.rb +57 -0
  97. data/lib/shopify_api/rest/resources/2023_01/discount_code.rb +219 -0
  98. data/lib/shopify_api/rest/resources/2023_01/dispute.rb +111 -0
  99. data/lib/shopify_api/rest/resources/2023_01/draft_order.rb +275 -0
  100. data/lib/shopify_api/rest/resources/2023_01/event.rb +148 -0
  101. data/lib/shopify_api/rest/resources/2023_01/fulfillment.rb +225 -0
  102. data/lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb +166 -0
  103. data/lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb +316 -0
  104. data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +87 -0
  105. data/lib/shopify_api/rest/resources/2023_01/fulfillment_service.rb +130 -0
  106. data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +215 -0
  107. data/lib/shopify_api/rest/resources/2023_01/gift_card_adjustment.rb +118 -0
  108. data/lib/shopify_api/rest/resources/2023_01/image.rb +157 -0
  109. data/lib/shopify_api/rest/resources/2023_01/inventory_item.rb +108 -0
  110. data/lib/shopify_api/rest/resources/2023_01/inventory_level.rb +179 -0
  111. data/lib/shopify_api/rest/resources/2023_01/location.rb +167 -0
  112. data/lib/shopify_api/rest/resources/2023_01/locations_for_move.rb +56 -0
  113. data/lib/shopify_api/rest/resources/2023_01/marketing_event.rb +209 -0
  114. data/lib/shopify_api/rest/resources/2023_01/metafield.rb +344 -0
  115. data/lib/shopify_api/rest/resources/2023_01/mobile_platform_application.rb +110 -0
  116. data/lib/shopify_api/rest/resources/2023_01/order.rb +479 -0
  117. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +135 -0
  118. data/lib/shopify_api/rest/resources/2023_01/page.rb +194 -0
  119. data/lib/shopify_api/rest/resources/2023_01/payment.rb +140 -0
  120. data/lib/shopify_api/rest/resources/2023_01/payment_gateway.rb +143 -0
  121. data/lib/shopify_api/rest/resources/2023_01/payment_transaction.rb +107 -0
  122. data/lib/shopify_api/rest/resources/2023_01/payout.rb +97 -0
  123. data/lib/shopify_api/rest/resources/2023_01/policy.rb +69 -0
  124. data/lib/shopify_api/rest/resources/2023_01/price_rule.rb +223 -0
  125. data/lib/shopify_api/rest/resources/2023_01/product.rb +223 -0
  126. data/lib/shopify_api/rest/resources/2023_01/product_listing.rb +196 -0
  127. data/lib/shopify_api/rest/resources/2023_01/product_resource_feedback.rb +88 -0
  128. data/lib/shopify_api/rest/resources/2023_01/province.rb +132 -0
  129. data/lib/shopify_api/rest/resources/2023_01/recurring_application_charge.rb +167 -0
  130. data/lib/shopify_api/rest/resources/2023_01/redirect.rb +139 -0
  131. data/lib/shopify_api/rest/resources/2023_01/refund.rb +151 -0
  132. data/lib/shopify_api/rest/resources/2023_01/report.rb +121 -0
  133. data/lib/shopify_api/rest/resources/2023_01/resource_feedback.rb +73 -0
  134. data/lib/shopify_api/rest/resources/2023_01/script_tag.rb +155 -0
  135. data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +83 -0
  136. data/lib/shopify_api/rest/resources/2023_01/shop.rb +221 -0
  137. data/lib/shopify_api/rest/resources/2023_01/smart_collection.rb +216 -0
  138. data/lib/shopify_api/rest/resources/2023_01/storefront_access_token.rb +87 -0
  139. data/lib/shopify_api/rest/resources/2023_01/tender_transaction.rb +93 -0
  140. data/lib/shopify_api/rest/resources/2023_01/theme.rb +120 -0
  141. data/lib/shopify_api/rest/resources/2023_01/transaction.rb +181 -0
  142. data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +97 -0
  143. data/lib/shopify_api/rest/resources/2023_01/user.rb +138 -0
  144. data/lib/shopify_api/rest/resources/2023_01/variant.rb +212 -0
  145. data/lib/shopify_api/rest/resources/2023_01/webhook.rb +168 -0
  146. data/lib/shopify_api/utils/graphql_proxy.rb +2 -2
  147. data/lib/shopify_api/utils/session_utils.rb +42 -25
  148. data/lib/shopify_api/version.rb +1 -1
  149. data/lib/shopify_api/webhooks/registrations/http.rb +7 -1
  150. data/lib/shopify_api/webhooks/registry.rb +8 -8
  151. data/service.yml +0 -1
  152. data/shopify_api.gemspec +4 -2
  153. metadata +195 -78
  154. data/.github/ISSUE_TEMPLATE.md +0 -35
  155. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/access_scope.rb +0 -0
  156. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/android_pay_key.rb +0 -0
  157. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/apple_pay_certificate.rb +0 -0
  158. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/application_charge.rb +0 -0
  159. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/application_credit.rb +0 -0
  160. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/article.rb +0 -0
  161. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/asset.rb +0 -0
  162. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/balance.rb +0 -0
  163. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/blog.rb +0 -0
  164. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/cancellation_request.rb +0 -0
  165. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/checkout.rb +0 -0
  166. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/collect.rb +0 -0
  167. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/collection.rb +0 -0
  168. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/collection_listing.rb +0 -0
  169. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/comment.rb +0 -0
  170. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/country.rb +0 -0
  171. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/currency.rb +0 -0
  172. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/custom_collection.rb +0 -0
  173. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/customer_address.rb +0 -0
  174. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/customer_saved_search.rb +0 -0
  175. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/deprecated_api_call.rb +0 -0
  176. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/discount_code.rb +0 -0
  177. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/dispute.rb +0 -0
  178. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/event.rb +0 -0
  179. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/fulfillment_event.rb +0 -0
  180. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/gift_card_adjustment.rb +0 -0
  181. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/image.rb +0 -0
  182. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/inventory_item.rb +0 -0
  183. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/inventory_level.rb +0 -0
  184. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/location.rb +0 -0
  185. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/locations_for_move.rb +0 -0
  186. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/marketing_event.rb +0 -0
  187. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/mobile_platform_application.rb +0 -0
  188. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/order_risk.rb +0 -0
  189. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/page.rb +0 -0
  190. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payment.rb +0 -0
  191. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payment_gateway.rb +0 -0
  192. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payment_transaction.rb +0 -0
  193. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/payout.rb +0 -0
  194. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/policy.rb +0 -0
  195. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/product.rb +0 -0
  196. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/product_listing.rb +0 -0
  197. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/product_resource_feedback.rb +0 -0
  198. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/province.rb +0 -0
  199. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/recurring_application_charge.rb +0 -0
  200. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/redirect.rb +0 -0
  201. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/refund.rb +0 -0
  202. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/report.rb +0 -0
  203. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/resource_feedback.rb +0 -0
  204. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/script_tag.rb +0 -0
  205. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/shipping_zone.rb +0 -0
  206. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/smart_collection.rb +0 -0
  207. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/storefront_access_token.rb +0 -0
  208. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/tender_transaction.rb +0 -0
  209. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/theme.rb +0 -0
  210. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/transaction.rb +0 -0
  211. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/usage_charge.rb +0 -0
  212. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/user.rb +0 -0
  213. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/variant.rb +0 -0
  214. /data/lib/shopify_api/rest/resources/{2021_10 → 2022_10}/webhook.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d1425c7556a52cb215845c0706990664207eb78bf0e42f5ef555f16ebb3398b
4
- data.tar.gz: 8fbe1be46b5ebdfaac394195cbf44ae6bcd69fc90b6c8dc0709c417936f9dc2d
3
+ metadata.gz: f87e892122968b0fc410c734d089ec03952c3b5bbf2793fcca078730ac280233
4
+ data.tar.gz: 928a01df0d1bc4312fee18e768d84c3585e1d72b39871e63b473080ee35943ed
5
5
  SHA512:
6
- metadata.gz: 0efde28dd28d29310a940a27d081e1979e44c8b32d282e845af4caaa93352a2d8a213b644b8868cc4416aece4a4867126b03c6e6f13b5bc36da0e2e3605caf26
7
- data.tar.gz: 3c82238434799b244e9106eaa4c3736944bc4792c7e7794604d4c68ab9ba3587dae5b4573a5dd586c8087253726bed56dc87c257f1cd4d124c149ce3637f6c32
6
+ metadata.gz: dd43ee271006e1ca390d151c002ad9a65439ad2cbe2a9350bd20e2756797dd38697eaf1c3437f243d3d478fd55d116eebb991be148913d2b0c48293fcd572496
7
+ data.tar.gz: 295e7ec37443a12589fe3bd2a8edd18fdba3cc76016d1fa829a6334378547a017f326f798f318eb833da33f75361921553843cb1207139edf33e426636ef2c6c
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: "🐛 Bug Report"
3
+ about: Something isn't working
4
+ labels: "Type: Bug 🐛"
5
+ ---
6
+
7
+ # Issue summary
8
+
9
+ <!--
10
+
11
+ Write a short description of the issue here. Please provide any details or logs that
12
+ can help us debug it.
13
+
14
+ Increase the logs as described in the README by setting log_level to :debug, and paste the relevant portion here.
15
+
16
+ Learn more: https://github.com/Shopify/shopify-api-ruby#setup-shopify-context
17
+
18
+ -->
19
+
20
+ - `shopify_api` version:
21
+ - Ruby version:
22
+ - Operating system:
23
+
24
+ ```
25
+ // Paste any relevant logs here
26
+ ```
27
+
28
+ ## Expected behavior
29
+
30
+ <!-- What do you think should happen? -->
31
+
32
+ ## Actual behavior
33
+
34
+ <!-- What actually happens? -->
35
+
36
+ ## Steps to reproduce the problem
37
+
38
+ 1.
39
+ 1.
40
+ 1.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: '📈 Enhancement'
3
+ about: Enhancement to our codebase that isn't a adding or changing a feature
4
+ labels: 'Type: Enhancement 📈'
5
+ ---
6
+
7
+ ## Overview/summary
8
+
9
+ <!-- Write a short description of the enhancement here ↓ -->
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: "🙌 Feature Request"
3
+ about: Suggest a new feature, or changes to an existing one
4
+ labels: "Type: Feature Request :raised_hands:"
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ <!-- Write a short description of the request here ↓ -->
@@ -16,9 +16,6 @@ jobs:
16
16
  - 3.1
17
17
  steps:
18
18
  - uses: actions/checkout@v2
19
- - name: Remove Gemfile.lock
20
- run: |
21
- rm -f ${GITHUB_WORKSPACE}/Gemfile.lock
22
19
  - name: Set up Ruby ${{ matrix.version }}
23
20
  uses: ruby/setup-ruby@v1
24
21
  with:
@@ -0,0 +1,20 @@
1
+ name: Close Waiting for Response Issues
2
+ on:
3
+ schedule:
4
+ - cron: "30 1 * * *"
5
+ workflow_dispatch:
6
+ jobs:
7
+ check-need-info:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: close-issues
11
+ uses: actions-cool/issues-helper@v3
12
+ with:
13
+ actions: 'close-issues'
14
+ token: ${{ secrets.GITHUB_TOKEN }}
15
+ labels: 'Waiting for Response'
16
+ inactive-day: 7
17
+ body: |
18
+ We are closing this issue because we did not hear back regarding additional details we needed to resolve this issue. If the issue persists and you are able to provide the missing clarification we need, feel free to respond and reopen this issue.
19
+
20
+ We appreciate your understanding as we try to manage our number of open issues.
@@ -0,0 +1,16 @@
1
+ name: Remove Stale or Waiting Labels
2
+ on:
3
+ issue_comment:
4
+ types: [created]
5
+ workflow_dispatch:
6
+ jobs:
7
+ remove-labels-on-activity:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: actions-ecosystem/action-remove-labels@v1
12
+ if: contains(github.event.issue.labels.*.name, 'Waiting for Response')
13
+ with:
14
+ labels: |
15
+ Waiting for Response
16
+
@@ -0,0 +1,33 @@
1
+ name: Close inactive issues
2
+ on:
3
+ schedule:
4
+ - cron: "30 1 * * *"
5
+
6
+ jobs:
7
+ close-issues:
8
+ runs-on: ubuntu-latest
9
+ permissions:
10
+ issues: write
11
+ pull-requests: write
12
+ steps:
13
+ - uses: actions/stale@v5
14
+ with:
15
+ days-before-issue-stale: 60
16
+ days-before-issue-close: 14
17
+ operations-per-run: 1000
18
+ stale-issue-label: "Stale"
19
+ stale-issue-message: >
20
+ This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
21
+ close-issue-message: |
22
+ We are closing this issue because it has been inactive for a few months.
23
+ This probably means that it is not reproducible or it has been fixed in a newer version.
24
+ If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.
25
+
26
+ If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the [CONTRIBUTING.md](https://github.com/Shopify/shopify-api-ruby/blob/main/CONTRIBUTING.md) file for guidelines
27
+
28
+ Thank you!
29
+ days-before-pr-stale: -1
30
+ days-before-pr-close: -1
31
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
32
+ exempt-issue-labels: "feature request"
33
+ close-issue-reason: "not_planned"
data/CHANGELOG.md CHANGED
@@ -4,9 +4,39 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## Version 12.4.0
8
+
9
+ - [#1092](https://github.com/Shopify/shopify-api-ruby/pull/1092) Add support for 2023-01 API version.
10
+ - [#1081](https://github.com/Shopify/shopify-api-ruby/pull/1081) Fixed an error when parsing the JSON response body for the AssignedFulfillmentOrder resource.
11
+
12
+ ## Version 12.3.0
13
+
14
+ - [#1040](https://github.com/Shopify/shopify-api-ruby/pull/1040) `ShopifyAPI::Clients::HttpResponse` as argument for `ShopifyAPI::Errors::HttpResponseError`
15
+ - [#1055](https://github.com/Shopify/shopify-api-ruby/pull/1055) Makes session_storage optional. Configuring the API with session_storage is now deprecated. Session persistence is handled by the [shopify_app gem](https://github.com/Shopify/shopify_app) if using Rails.
16
+ - [#1063](https://github.com/Shopify/shopify-api-ruby/pull/1063) Fix ActiveSupport inflector dependency
17
+ - [#1069](https://github.com/Shopify/shopify-api-ruby/pull/1069) Adds a custom Logger to help write uniform logs across the api and the [shopify_app gem](https://github.com/Shopify/shopify_app)
18
+
19
+ ## Version 12.2.1
20
+
21
+ - [#1045](https://github.com/Shopify/shopify-api-ruby/pull/1045) Fixes bug with host/host_name requirement.
22
+
23
+ ## Version 12.2.0
24
+
25
+ - [#1023](https://github.com/Shopify/shopify-api-ruby/pull/1023) Allow custom scopes during the OAuth process
26
+
27
+ ## Version 12.1.0
28
+
29
+ - [#1017](https://github.com/Shopify/shopify-api-ruby/pull/1017) Add support for `http` with localhost development without using a TLS tunnel
30
+
31
+ ## Version 12.0.0
32
+
33
+ - [#1027](https://github.com/Shopify/shopify-api-ruby/pull/1027) ⚠️ [Breaking] Remove support for deprecated API version `2021-10` and added support for version `2022-10`
34
+ - [#1008](https://github.com/Shopify/shopify-api-ruby/pull/1008) Increase session token JWT validation leeway from 5s to 10s
35
+
7
36
  ## Version 11.1.0
8
37
 
9
38
  - [#1002](https://github.com/Shopify/shopify-api-ruby/pull/1002) Add new method to construct the host app URL for an embedded app, allowing for safer redirect to app inside appropriate shop admin
39
+ - [#1004](https://github.com/Shopify/shopify-api-ruby/pull/1004) Support full URL and scheme-less URL when registering HTTP webhooks
10
40
 
11
41
  ## Version 11.0.1
12
42
 
data/Gemfile CHANGED
@@ -9,4 +9,5 @@ group :test do
9
9
  gem "fakefs", require: false
10
10
  gem "webmock"
11
11
  gem "mocha"
12
+ gem "pry-byebug"
12
13
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (11.1.0)
4
+ shopify_api (12.4.0)
5
+ activesupport
5
6
  concurrent-ruby
6
7
  hash_diff
7
8
  httparty
@@ -10,12 +11,12 @@ PATH
10
11
  openssl
11
12
  securerandom
12
13
  sorbet-runtime
13
- zeitwerk (~> 2.5)
14
+ zeitwerk (~> 2.5, < 2.6.5)
14
15
 
15
16
  GEM
16
17
  remote: https://rubygems.org/
17
18
  specs:
18
- activesupport (7.0.1)
19
+ activesupport (7.0.4)
19
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
21
  i18n (>= 1.6, < 2)
21
22
  minitest (>= 5.1)
@@ -23,36 +24,41 @@ GEM
23
24
  addressable (2.8.0)
24
25
  public_suffix (>= 2.0.2, < 5.0)
25
26
  ast (2.4.2)
27
+ byebug (11.1.3)
26
28
  coderay (1.1.3)
27
- concurrent-ruby (1.1.9)
29
+ concurrent-ruby (1.1.10)
28
30
  crack (0.4.5)
29
31
  rexml
30
32
  diff-lcs (1.5.0)
31
33
  fakefs (1.4.1)
32
- hash_diff (1.0.0)
34
+ hash_diff (1.1.1)
33
35
  hashdiff (1.0.1)
34
- httparty (0.20.0)
35
- mime-types (~> 3.0)
36
+ httparty (0.21.0)
37
+ mini_mime (>= 1.0.0)
36
38
  multi_xml (>= 0.5.2)
37
- i18n (1.8.11)
39
+ i18n (1.12.0)
38
40
  concurrent-ruby (~> 1.0)
39
- jwt (2.4.1)
41
+ json (2.6.2)
42
+ jwt (2.6.0)
43
+ language_server-protocol (3.17.0.1)
40
44
  method_source (1.0.0)
41
- mime-types (3.4.1)
42
- mime-types-data (~> 3.2015)
43
- mime-types-data (3.2022.0105)
45
+ mini_mime (1.1.2)
44
46
  minitest (5.15.0)
45
47
  mocha (1.13.0)
46
48
  multi_xml (0.6.0)
47
49
  netrc (0.11.0)
48
- oj (3.13.20)
49
- openssl (3.0.0)
50
+ oj (3.13.23)
51
+ openssl (3.1.0)
50
52
  parallel (1.22.1)
51
53
  parser (3.1.2.1)
52
54
  ast (~> 2.4.1)
55
+ prettier_print (0.1.0)
53
56
  pry (0.14.1)
54
57
  coderay (~> 1.1)
55
58
  method_source (~> 1.0)
59
+ pry-byebug (3.10.1)
60
+ byebug (~> 11.0)
61
+ pry (>= 0.13, < 0.15)
56
62
  public_suffix (4.0.6)
57
63
  rainbow (3.1.1)
58
64
  rake (13.0.6)
@@ -61,38 +67,46 @@ GEM
61
67
  parser (>= 2.6.4.0)
62
68
  sorbet-runtime (>= 0.5.9204)
63
69
  unparser
64
- regexp_parser (2.2.0)
70
+ regexp_parser (2.5.0)
65
71
  rexml (3.2.5)
66
- rubocop (1.25.1)
72
+ rubocop (1.36.0)
73
+ json (~> 2.3)
67
74
  parallel (~> 1.10)
68
- parser (>= 3.1.0.0)
75
+ parser (>= 3.1.2.1)
69
76
  rainbow (>= 2.2.2, < 4.0)
70
77
  regexp_parser (>= 1.8, < 3.0)
71
- rexml
72
- rubocop-ast (>= 1.15.1, < 2.0)
78
+ rexml (>= 3.2.5, < 4.0)
79
+ rubocop-ast (>= 1.20.1, < 2.0)
73
80
  ruby-progressbar (~> 1.7)
74
81
  unicode-display_width (>= 1.4.0, < 3.0)
75
- rubocop-ast (1.15.1)
76
- parser (>= 3.0.1.1)
77
- rubocop-shopify (2.4.0)
78
- rubocop (~> 1.24)
79
- rubocop-sorbet (0.6.5)
82
+ rubocop-ast (1.21.0)
83
+ parser (>= 3.1.1.0)
84
+ rubocop-shopify (2.10.1)
85
+ rubocop (~> 1.35)
86
+ rubocop-sorbet (0.6.11)
80
87
  rubocop (>= 0.90.0)
88
+ ruby-lsp (0.3.2)
89
+ language_server-protocol (~> 3.17.0)
90
+ sorbet-runtime
91
+ syntax_tree (>= 3.4)
81
92
  ruby-progressbar (1.11.0)
82
- securerandom (0.2.0)
83
- sorbet (0.5.10297)
84
- sorbet-static (= 0.5.10297)
85
- sorbet-runtime (0.5.10297)
86
- sorbet-static (0.5.10297-universal-darwin-21)
87
- sorbet-static (0.5.10297-x86_64-linux)
88
- sorbet-static-and-runtime (0.5.10297)
89
- sorbet (= 0.5.10297)
90
- sorbet-runtime (= 0.5.10297)
93
+ securerandom (0.2.2)
94
+ sorbet (0.5.10438)
95
+ sorbet-static (= 0.5.10438)
96
+ sorbet-runtime (0.5.10438)
97
+ sorbet-static (0.5.10438-universal-darwin-21)
98
+ sorbet-static (0.5.10438-universal-darwin-22)
99
+ sorbet-static (0.5.10438-x86_64-linux)
100
+ sorbet-static-and-runtime (0.5.10438)
101
+ sorbet (= 0.5.10438)
102
+ sorbet-runtime (= 0.5.10438)
91
103
  spoom (1.1.11)
92
104
  sorbet (>= 0.5.9204)
93
105
  sorbet-runtime (>= 0.5.9204)
94
106
  thor (>= 0.19.2)
95
- tapioca (0.9.2)
107
+ syntax_tree (3.6.1)
108
+ prettier_print
109
+ tapioca (0.10.2)
96
110
  bundler (>= 1.17.3)
97
111
  netrc (>= 0.11.0)
98
112
  parallel (>= 1.21.0)
@@ -103,9 +117,9 @@ GEM
103
117
  thor (>= 1.2.0)
104
118
  yard-sorbet
105
119
  thor (1.2.1)
106
- tzinfo (2.0.4)
120
+ tzinfo (2.0.5)
107
121
  concurrent-ruby (~> 1.0)
108
- unicode-display_width (2.1.0)
122
+ unicode-display_width (2.3.0)
109
123
  unparser (0.6.5)
110
124
  diff-lcs (~> 1.3)
111
125
  parser (>= 3.1.0)
@@ -116,24 +130,26 @@ GEM
116
130
  webrick (1.7.0)
117
131
  yard (0.9.28)
118
132
  webrick (~> 1.7.0)
119
- yard-sorbet (0.6.1)
133
+ yard-sorbet (0.7.0)
120
134
  sorbet-runtime (>= 0.5)
121
135
  yard (>= 0.9)
122
- zeitwerk (2.6.0)
136
+ zeitwerk (2.6.4)
123
137
 
124
138
  PLATFORMS
125
139
  arm64-darwin-21
140
+ universal-darwin-22
126
141
  x86_64-linux
127
142
 
128
143
  DEPENDENCIES
129
- activesupport
130
144
  fakefs
131
145
  minitest
132
146
  mocha
147
+ pry-byebug
133
148
  rake
134
149
  rubocop
135
150
  rubocop-shopify
136
151
  rubocop-sorbet
152
+ ruby-lsp
137
153
  shopify_api!
138
154
  sorbet
139
155
  tapioca
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  This library provides support for Ruby [Shopify apps](https://apps.shopify.com/) to access the [Shopify Admin API](https://shopify.dev/api/admin), by making it easier to perform the following actions:
8
8
 
9
- - Creating [online](https://shopify.dev/concepts/about-apis/authentication#online-access) or [offline](https://shopify.dev/concepts/about-apis/authentication#offline-access) access tokens for the Admin API via OAuth
9
+ - Creating [online](https://shopify.dev/apps/auth/oauth/access-modes#online-access) or [offline](https://shopify.dev/apps/auth/oauth/access-modes#offline-access) access tokens for the Admin API via OAuth
10
10
  - Making requests to the [REST API](https://shopify.dev/api/admin-rest)
11
11
  - Making requests to the [GraphQL API](https://shopify.dev/api/admin-graphql)
12
12
  - Registering/processing webhooks
@@ -23,10 +23,8 @@ To follow these usage guides, you will need to:
23
23
 
24
24
  - have a working knowledge of ruby and a web framework such as Rails or Sinatra
25
25
  - have a Shopify Partner account and development store
26
- - _OR_ have a test store where you can create a private app
27
26
  - have an app already set up in your test store or partner account
28
- - use [ngrok](https://ngrok.com/download) to create a secure tunnel to your app running on your localhost
29
- - add the `ngrok` URL and the appropriate redirect for your OAuth callback route to your app settings
27
+ - add the URL and the appropriate redirect for your OAuth callback route to your app settings
30
28
 
31
29
  ## Installation
32
30
 
@@ -52,12 +50,12 @@ Start by initializing the `ShopifyAPI::Context` with the parameters of your app
52
50
  ShopifyAPI::Context.setup(
53
51
  api_key: "<api-key>",
54
52
  api_secret_key: "<api-secret-key>",
55
- host_name: "<application-host-name>",
53
+ host: "<https://application-host-name.com>",
56
54
  scope: "read_orders,read_products,etc",
57
55
  session_storage: ShopifyAPI::Auth::FileSessionStorage.new, # See more details below
58
56
  is_embedded: true, # Set to true if you are building an embedded app
59
- is_private: false, # Set to true if you are building a private app
60
57
  api_version: "2022-01" # The version of the API you would like to use
58
+ is_private: false, # Set to true if you have an existing private app
61
59
  )
62
60
  ```
63
61
 
@@ -69,7 +67,7 @@ Session information would is typically stored in cookies on the browser. However
69
67
 
70
68
  ### Performing OAuth
71
69
 
72
- Next, unless you are making a private app, you need to go through OAuth as described [here](https://shopify.dev/apps/auth/oauth) to create sessions for shops using your app.
70
+ You need to go through OAuth as described [here](https://shopify.dev/apps/auth/oauth) to create sessions for shops using your app.
73
71
  The Shopify API gem tries to make this easy by providing functions to begin and complete the OAuth process. See the [Oauth doc](docs/usage/oauth.md) for instructions on how to use these.
74
72
 
75
73
  ### Register Webhooks and a Webhook Handler
@@ -84,7 +82,7 @@ Once your app can perform OAuth, it can now make authenticated Shopify API calls
84
82
 
85
83
  ### Breaking change notice for version 10.0.0
86
84
 
87
- We've rewritten this library for v10, so that it provides all essential features for a Shopify app without requiring any other packages.
85
+ We've rewritten this library for v10, so that it provides all essential features for a Shopify app without depending on the [Active Resource](https://github.com/rails/activeresource) or [graphql-client](https://github.com/github/graphql-client) libraries.
88
86
 
89
87
  Here are the main features it provides:
90
88
 
@@ -108,12 +106,12 @@ With this, a lot changed in how apps access the library. Here are the updates yo
108
106
 
109
107
  Please see below a (non-exhaustive) list of common replacements to guide you in your updates, using the `Order` resource as an example.
110
108
 
111
- | Before | After |
112
- | --- | --- |
113
- | `Order.find(:all, params: {param1: value1})` | `Order.all(param1: value1, session:)` |
114
- | `Order.find(<id>)` | `Order.find(id: <id>, session:)` |
115
- | `order = Order.new(<id>)`<br/>`order.post(:close)` | `order = Order.new(session:)`<br/>`order.close()` |
116
- | `order = Order.new(<id>)`<br/>`order.delete` | `Order.delete(id: <id>, session:)` |
109
+ | Before | After |
110
+ | --- | --- |
111
+ | `Order.find(:all, params: {param1: value1})` | `Order.all(param1: value1)` |
112
+ | `Order.find(<id>)` | `Order.find(id: <id>)` |
113
+ | `order = Order.new(<id>)`<br/>`order.post(:close)` | `order = Order.new`<br/>`order.close` |
114
+ | `order = Order.new(<id>)`<br/>`order.delete` | `Order.delete(id: <id>)` |
117
115
 
118
116
  ## Breaking changes for older versions
119
117
 
@@ -5,7 +5,7 @@ This page will outline everything you need to know and the steps you need to fol
5
5
  ## Requirements
6
6
 
7
7
  - A working knowledge of ruby and a web framework such as Rails or Sinatra
8
- - A private or custom app already set up in your test store or partner account
8
+ - A custom app already set up in your test store or partner account
9
9
  - We recommend `ngrok` to tunnel traffic to your localhost for testing
10
10
 
11
11
  ## Installation
data/docs/usage/oauth.md CHANGED
@@ -3,8 +3,7 @@
3
3
  Once the library is set up for your project, you'll be able to use it to start adding functionality to your app. The first thing your app will need to do is to obtain an access token to the Admin API by performing the OAuth process.
4
4
 
5
5
  To do this, you can follow the steps below.
6
-
7
- **Note:** You do not need to go through the OAuth process if you are creating a private app. In this case you can simply set your `<key+password>` as the `api_secret_key` in `ShopifyAPI::Context.setup`. For more information on authenticating a Shopify app please see the [Types of Authentication](https://shopify.dev/apps/auth#types-of-authentication) page.
6
+ For more information on authenticating a Shopify app please see the [Types of Authentication](https://shopify.dev/apps/auth#types-of-authentication) page.
8
7
 
9
8
  ## Add a route to start OAuth
10
9
 
@@ -53,7 +52,7 @@ def callback
53
52
  cookies: cookies.to_h,
54
53
  auth_query: ShopifyAPI::Auth::Oauth::AuthQuery.new(request.parameters.symbolize_keys.except(:controller, :action))
55
54
  )
56
-
55
+
57
56
  cookies[auth_result[:cookie].name] = {
58
57
  expires: auth_result[:cookie].expires,
59
58
  secure: true,
@@ -66,7 +65,7 @@ def callback
66
65
  head 307
67
66
  response.set_header("Location", "<some-redirect-url>")
68
67
  rescue => e
69
- puts(e.message)
68
+ puts(e.message)
70
69
  head 500
71
70
  end
72
71
  end
@@ -5,7 +5,7 @@ The implementation of session storage that you pass in `ShopifyAPI::Context.setu
5
5
 
6
6
  ## Create a New Session Storage Class
7
7
 
8
- You can create a session storage class that includes `ShopifyAPI::Auth::SessionStore` and override the methods as shown in the table and example below:
8
+ You can create a session storage class that includes `ShopifyAPI::Auth::SessionStorage` and override the methods as shown in the table and example below:
9
9
 
10
10
  | Method Name | Input Type | Return Type |
11
11
  | ---------------------- | --------------------------------- | ------------------------------ |
@@ -5,13 +5,14 @@ module ShopifyAPI
5
5
  module AdminVersions
6
6
  SUPPORTED_ADMIN_VERSIONS = T.let([
7
7
  "unstable",
8
+ "2023-01",
9
+ "2022-10",
8
10
  "2022-07",
9
11
  "2022-04",
10
12
  "2022-01",
11
- "2021-10",
12
13
  ], T::Array[String])
13
14
 
14
- LATEST_SUPPORTED_ADMIN_VERSION = T.let("2022-07", String)
15
+ LATEST_SUPPORTED_ADMIN_VERSION = T.let("2023-01", String)
15
16
  end
16
17
 
17
18
  SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
@@ -6,7 +6,7 @@ module ShopifyAPI
6
6
  class JwtPayload
7
7
  extend T::Sig
8
8
 
9
- JWT_EXPIRATION_LEEWAY = 5
9
+ JWT_EXPIRATION_LEEWAY = 10
10
10
 
11
11
  sig { returns(String) }
12
12
  attr_reader :iss, :dest, :aud, :sub, :jti, :sid
@@ -48,7 +48,7 @@ module ShopifyAPI
48
48
  def validate_shop(shop)
49
49
  Context.logger.warn(
50
50
  "Deprecation notice: ShopifyAPI::Auth::JwtPayload.validate_shop no longer checks the given shop and always " \
51
- "returns true. It will be removed in v11."
51
+ "returns true. It will be removed in v11.",
52
52
  )
53
53
  true
54
54
  end
@@ -18,7 +18,7 @@ module ShopifyAPI
18
18
  timestamp: String,
19
19
  state: String,
20
20
  host: String,
21
- hmac: String
21
+ hmac: String,
22
22
  ).void
23
23
  end
24
24
  def initialize(code:, shop:, timestamp:, state:, host:, hmac:)
@@ -15,10 +15,19 @@ module ShopifyAPI
15
15
  params(
16
16
  shop: String,
17
17
  redirect_path: String,
18
- is_online: T.nilable(T::Boolean)
18
+ is_online: T.nilable(T::Boolean),
19
+ scope_override: T.nilable(T.any(ShopifyAPI::Auth::AuthScopes, T::Array[String], String)),
19
20
  ).returns(T::Hash[Symbol, T.any(String, SessionCookie)])
20
21
  end
21
- def begin_auth(shop:, redirect_path:, is_online: true)
22
+ def begin_auth(shop:, redirect_path:, is_online: true, scope_override: nil)
23
+ scope = if scope_override.nil?
24
+ ShopifyAPI::Context.scope
25
+ elsif scope_override.is_a?(ShopifyAPI::Auth::AuthScopes)
26
+ scope_override
27
+ else
28
+ ShopifyAPI::Auth::AuthScopes.new(scope_override)
29
+ end
30
+
22
31
  unless Context.setup?
23
32
  raise Errors::ContextNotSetupError, "ShopifyAPI::Context not setup, please call ShopifyAPI::Context.setup"
24
33
  end
@@ -30,8 +39,8 @@ module ShopifyAPI
30
39
 
31
40
  query = {
32
41
  client_id: ShopifyAPI::Context.api_key,
33
- scope: ShopifyAPI::Context.scope.to_s,
34
- redirect_uri: "https://#{ShopifyAPI::Context.host_name}#{redirect_path}",
42
+ scope: scope.to_s,
43
+ redirect_uri: "#{ShopifyAPI::Context.host}#{redirect_path}",
35
44
  state: state,
36
45
  "grant_options[]": is_online ? "per-user" : "",
37
46
  }
@@ -45,7 +54,7 @@ module ShopifyAPI
45
54
  sig do
46
55
  params(
47
56
  cookies: T::Hash[String, String],
48
- auth_query: AuthQuery
57
+ auth_query: AuthQuery,
49
58
  ).returns(T::Hash[Symbol, T.any(Session, SessionCookie)])
50
59
  end
51
60
  def validate_auth_callback(cookies:, auth_query:)
@@ -75,19 +84,16 @@ module ShopifyAPI
75
84
  cookie = if Context.embedded?
76
85
  SessionCookie.new(
77
86
  value: "",
78
- expires: Time.now
87
+ expires: Time.now,
79
88
  )
80
89
  else
81
90
  SessionCookie.new(
82
91
  value: session.id,
83
- expires: session.online? ? session.expires : nil
92
+ expires: session.online? ? session.expires : nil,
84
93
  )
85
94
  end
86
95
 
87
- unless Context.session_storage.store_session(session)
88
- raise Errors::SessionStorageError,
89
- "Session could not be saved. Please check your session storage implementation."
90
- end
96
+ Context.session_storage&.store_session(session)
91
97
 
92
98
  { session: session, cookie: cookie }
93
99
  end
@@ -120,7 +126,7 @@ module ShopifyAPI
120
126
  associated_user_scope: associated_user_scope,
121
127
  associated_user: associated_user,
122
128
  expires: expires,
123
- shopify_session_id: session_params[:session]
129
+ shopify_session_id: session_params[:session],
124
130
  )
125
131
  end
126
132
  end
@@ -46,7 +46,7 @@ module ShopifyAPI
46
46
  expires: T.nilable(Time),
47
47
  is_online: T.nilable(T::Boolean),
48
48
  associated_user: T.nilable(AssociatedUser),
49
- shopify_session_id: T.nilable(String)
49
+ shopify_session_id: T.nilable(String),
50
50
  ).void
51
51
  end
52
52
  def initialize(shop:, id: nil, state: nil, access_token: "", scope: [], associated_user_scope: nil, expires: nil,
@@ -17,7 +17,7 @@ module ShopifyAPI
17
17
  query: String,
18
18
  variables: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
19
19
  headers: T.nilable(T::Hash[T.any(Symbol, String), T.untyped]),
20
- tries: Integer
20
+ tries: Integer,
21
21
  ).returns(HttpResponse)
22
22
  end
23
23
  def query(query:, variables: nil, headers: nil, tries: 1)
@@ -30,8 +30,8 @@ module ShopifyAPI
30
30
  query: nil,
31
31
  extra_headers: headers,
32
32
  body_type: "application/json",
33
- tries: tries
34
- )
33
+ tries: tries,
34
+ ),
35
35
  )
36
36
  end
37
37
  end