shopify_api 13.1.0 → 13.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/BREAKING_CHANGES_FOR_V10.md +231 -0
  3. data/CHANGELOG.md +8 -1
  4. data/Gemfile.lock +5 -5
  5. data/README.md +10 -34
  6. data/docs/README.md +0 -1
  7. data/docs/getting_started.md +20 -3
  8. data/docs/usage/custom_apps.md +75 -0
  9. data/docs/usage/graphql.md +63 -18
  10. data/docs/usage/oauth.md +160 -27
  11. data/docs/usage/rest.md +204 -62
  12. data/docs/usage/webhooks.md +22 -4
  13. data/lib/shopify_api/admin_versions.rb +2 -1
  14. data/lib/shopify_api/context.rb +5 -3
  15. data/lib/shopify_api/rest/base.rb +22 -14
  16. data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +5 -3
  17. data/lib/shopify_api/rest/resources/2022_10/customer_address.rb +10 -0
  18. data/lib/shopify_api/rest/resources/2022_10/fulfillment_request.rb +10 -0
  19. data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +5 -3
  20. data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +5 -3
  21. data/lib/shopify_api/rest/resources/2023_01/balance.rb +4 -0
  22. data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +10 -0
  23. data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +10 -0
  24. data/lib/shopify_api/rest/resources/2023_01/order.rb +3 -0
  25. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +5 -3
  26. data/lib/shopify_api/rest/resources/2023_01/shop.rb +0 -3
  27. data/lib/shopify_api/rest/resources/2023_01/variant.rb +1 -5
  28. data/lib/shopify_api/rest/resources/2023_04/assigned_fulfillment_order.rb +5 -3
  29. data/lib/shopify_api/rest/resources/2023_04/balance.rb +4 -0
  30. data/lib/shopify_api/rest/resources/2023_04/customer_address.rb +10 -0
  31. data/lib/shopify_api/rest/resources/2023_04/fulfillment_request.rb +10 -0
  32. data/lib/shopify_api/rest/resources/2023_04/order.rb +3 -0
  33. data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +5 -3
  34. data/lib/shopify_api/rest/resources/2023_04/shop.rb +0 -3
  35. data/lib/shopify_api/rest/resources/2023_04/variant.rb +1 -5
  36. data/lib/shopify_api/rest/resources/2023_07/assigned_fulfillment_order.rb +5 -3
  37. data/lib/shopify_api/rest/resources/2023_07/balance.rb +4 -0
  38. data/lib/shopify_api/rest/resources/2023_07/customer_address.rb +10 -0
  39. data/lib/shopify_api/rest/resources/2023_07/fulfillment_request.rb +10 -0
  40. data/lib/shopify_api/rest/resources/2023_07/order.rb +3 -0
  41. data/lib/shopify_api/rest/resources/2023_07/order_risk.rb +5 -3
  42. data/lib/shopify_api/rest/resources/2023_07/report.rb +121 -0
  43. data/lib/shopify_api/rest/resources/2023_07/shop.rb +0 -3
  44. data/lib/shopify_api/rest/resources/2023_07/variant.rb +1 -5
  45. data/lib/shopify_api/rest/resources/2023_10/abandoned_checkout.rb +190 -0
  46. data/lib/shopify_api/rest/resources/2023_10/access_scope.rb +58 -0
  47. data/lib/shopify_api/rest/resources/2023_10/apple_pay_certificate.rb +105 -0
  48. data/lib/shopify_api/rest/resources/2023_10/application_charge.rb +109 -0
  49. data/lib/shopify_api/rest/resources/2023_10/application_credit.rb +91 -0
  50. data/lib/shopify_api/rest/resources/2023_10/article.rb +265 -0
  51. data/lib/shopify_api/rest/resources/2023_10/asset.rb +118 -0
  52. data/lib/shopify_api/rest/resources/2023_10/assigned_fulfillment_order.rb +88 -0
  53. data/lib/shopify_api/rest/resources/2023_10/balance.rb +54 -0
  54. data/lib/shopify_api/rest/resources/2023_10/blog.rb +162 -0
  55. data/lib/shopify_api/rest/resources/2023_10/cancellation_request.rb +83 -0
  56. data/lib/shopify_api/rest/resources/2023_10/carrier_service.rb +116 -0
  57. data/lib/shopify_api/rest/resources/2023_10/checkout.rb +209 -0
  58. data/lib/shopify_api/rest/resources/2023_10/collect.rb +142 -0
  59. data/lib/shopify_api/rest/resources/2023_10/collection.rb +110 -0
  60. data/lib/shopify_api/rest/resources/2023_10/collection_listing.rb +155 -0
  61. data/lib/shopify_api/rest/resources/2023_10/comment.rb +283 -0
  62. data/lib/shopify_api/rest/resources/2023_10/country.rb +137 -0
  63. data/lib/shopify_api/rest/resources/2023_10/currency.rb +57 -0
  64. data/lib/shopify_api/rest/resources/2023_10/custom_collection.rb +187 -0
  65. data/lib/shopify_api/rest/resources/2023_10/customer.rb +329 -0
  66. data/lib/shopify_api/rest/resources/2023_10/customer_address.rb +211 -0
  67. data/lib/shopify_api/rest/resources/2023_10/deprecated_api_call.rb +57 -0
  68. data/lib/shopify_api/rest/resources/2023_10/discount_code.rb +222 -0
  69. data/lib/shopify_api/rest/resources/2023_10/dispute.rb +111 -0
  70. data/lib/shopify_api/rest/resources/2023_10/dispute_evidence.rb +117 -0
  71. data/lib/shopify_api/rest/resources/2023_10/dispute_file_upload.rb +81 -0
  72. data/lib/shopify_api/rest/resources/2023_10/draft_order.rb +275 -0
  73. data/lib/shopify_api/rest/resources/2023_10/event.rb +148 -0
  74. data/lib/shopify_api/rest/resources/2023_10/fulfillment.rb +231 -0
  75. data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +166 -0
  76. data/lib/shopify_api/rest/resources/2023_10/fulfillment_order.rb +312 -0
  77. data/lib/shopify_api/rest/resources/2023_10/fulfillment_request.rb +97 -0
  78. data/lib/shopify_api/rest/resources/2023_10/fulfillment_service.rb +130 -0
  79. data/lib/shopify_api/rest/resources/2023_10/gift_card.rb +218 -0
  80. data/lib/shopify_api/rest/resources/2023_10/gift_card_adjustment.rb +118 -0
  81. data/lib/shopify_api/rest/resources/2023_10/image.rb +157 -0
  82. data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +108 -0
  83. data/lib/shopify_api/rest/resources/2023_10/inventory_level.rb +179 -0
  84. data/lib/shopify_api/rest/resources/2023_10/location.rb +167 -0
  85. data/lib/shopify_api/rest/resources/2023_10/locations_for_move.rb +56 -0
  86. data/lib/shopify_api/rest/resources/2023_10/marketing_event.rb +209 -0
  87. data/lib/shopify_api/rest/resources/2023_10/metafield.rb +344 -0
  88. data/lib/shopify_api/rest/resources/2023_10/mobile_platform_application.rb +110 -0
  89. data/lib/shopify_api/rest/resources/2023_10/order.rb +491 -0
  90. data/lib/shopify_api/rest/resources/2023_10/order_risk.rb +144 -0
  91. data/lib/shopify_api/rest/resources/2023_10/page.rb +194 -0
  92. data/lib/shopify_api/rest/resources/2023_10/payment.rb +140 -0
  93. data/lib/shopify_api/rest/resources/2023_10/payment_gateway.rb +143 -0
  94. data/lib/shopify_api/rest/resources/2023_10/payment_transaction.rb +107 -0
  95. data/lib/shopify_api/rest/resources/2023_10/payout.rb +97 -0
  96. data/lib/shopify_api/rest/resources/2023_10/policy.rb +69 -0
  97. data/lib/shopify_api/rest/resources/2023_10/price_rule.rb +223 -0
  98. data/lib/shopify_api/rest/resources/2023_10/product.rb +223 -0
  99. data/lib/shopify_api/rest/resources/2023_10/product_listing.rb +196 -0
  100. data/lib/shopify_api/rest/resources/2023_10/product_resource_feedback.rb +88 -0
  101. data/lib/shopify_api/rest/resources/2023_10/province.rb +132 -0
  102. data/lib/shopify_api/rest/resources/2023_10/recurring_application_charge.rb +172 -0
  103. data/lib/shopify_api/rest/resources/2023_10/redirect.rb +139 -0
  104. data/lib/shopify_api/rest/resources/2023_10/refund.rb +151 -0
  105. data/lib/shopify_api/rest/resources/2023_10/report.rb +121 -0
  106. data/lib/shopify_api/rest/resources/2023_10/resource_feedback.rb +73 -0
  107. data/lib/shopify_api/rest/resources/2023_10/script_tag.rb +155 -0
  108. data/lib/shopify_api/rest/resources/2023_10/shipping_zone.rb +83 -0
  109. data/lib/shopify_api/rest/resources/2023_10/shop.rb +218 -0
  110. data/lib/shopify_api/rest/resources/2023_10/smart_collection.rb +216 -0
  111. data/lib/shopify_api/rest/resources/2023_10/storefront_access_token.rb +87 -0
  112. data/lib/shopify_api/rest/resources/2023_10/tender_transaction.rb +93 -0
  113. data/lib/shopify_api/rest/resources/2023_10/theme.rb +123 -0
  114. data/lib/shopify_api/rest/resources/2023_10/transaction.rb +184 -0
  115. data/lib/shopify_api/rest/resources/2023_10/usage_charge.rb +102 -0
  116. data/lib/shopify_api/rest/resources/2023_10/user.rb +138 -0
  117. data/lib/shopify_api/rest/resources/2023_10/variant.rb +208 -0
  118. data/lib/shopify_api/rest/resources/2023_10/webhook.rb +168 -0
  119. data/lib/shopify_api/version.rb +1 -1
  120. data/lib/shopify_api/webhooks/registration.rb +19 -4
  121. data/lib/shopify_api/webhooks/registrations/event_bridge.rb +1 -1
  122. data/lib/shopify_api/webhooks/registrations/http.rb +1 -1
  123. data/lib/shopify_api/webhooks/registrations/pub_sub.rb +2 -1
  124. data/lib/shopify_api/webhooks/registry.rb +9 -5
  125. metadata +80 -6
  126. data/.github/workflows/stale.yml +0 -43
  127. data/docs/issues.md +0 -39
  128. data/docs/usage/session_storage.md +0 -46
@@ -1,43 +0,0 @@
1
- name: Close inactive issues / prs
2
- on:
3
- schedule:
4
- - cron: "30 1 * * *"
5
-
6
- jobs:
7
- stale:
8
- runs-on: ubuntu-latest
9
- permissions:
10
- issues: write
11
- pull-requests: write
12
- steps:
13
- - uses: actions/stale@v7
14
- with:
15
- days-before-issue-stale: 60
16
- days-before-issue-close: 14
17
- days-before-pr-stale: 60
18
- days-before-pr-close: 14
19
- operations-per-run: 1000
20
- stale-issue-label: "Stale"
21
- stale-pr-label: "Stale"
22
- stale-issue-message: >
23
- 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.
24
- close-issue-message: |
25
- We are closing this issue because it has been inactive for a few months.
26
- This probably means that it is not reproducible or it has been fixed in a newer version.
27
- If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.
28
-
29
- 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
30
-
31
- Thank you!
32
- stale-pr-message: >
33
- This pull request 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.
34
- close-pr-message: |
35
- We are closing this pull request because it has been inactive for a few months.
36
- This probably means that it is not reproducible or it has been fixed in a newer version.
37
- If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.
38
-
39
- If you still encounter this pull request with the latest stable version, please reopen using the pull request 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
40
-
41
- Thank you!
42
- repo-token: ${{ github.token }}
43
- close-issue-reason: "not_planned"
data/docs/issues.md DELETED
@@ -1,39 +0,0 @@
1
- # Known issues and caveats
2
-
3
- By following this guide, you will have a fully functional Shopify app. However, there are some things you should be aware of before using your new app in a production environment.
4
-
5
- ## Notes on session handling
6
-
7
- Before you start writing your application, please note that the Shopify library needs to store some information for OAuth in sessions. Since each application may choose a different strategy to store information, the library cannot dictate any specific storage strategy. When calling `ShopifyAPI::Context.setup`, you'll need to provide an instance of a class that implements the `ShopifyAPI::Auth::SessionStorage` interface.
8
-
9
- This library provides a very simple implementation of that interface which stores sessions in files, `ShopifyAPI::Auth::FileSessionStorage` ([source code](../lib/shopify_api/auth/file_session_storage.rb)). This class is meant to speed up development with this library, but it is not suitable for production use, because it will lead to disk build-up as old sessions are not cleaned up.
10
-
11
- Before you deploy your app to production, it should use your selected storage method for sessions. You can do that by creating a class that implements the `SessionStorage` interface and pass that in your `Context.setup` call. Your class will need to implement the methods below.
12
-
13
- **Note**: After you create your implementation of `SessionStorage`, you should make sure to clean up old sessions periodically in your data storage. The library will delete some sessions when they are no longer useful, but it cannot guarantee that expired sessions are deleted automatically.
14
-
15
- #### `SessionStorage.storeSession`
16
-
17
- Creates **or updates** a `Session` object in your storage. This function should return a `bool` indicating whether the operation was successful.
18
-
19
- | Param | Type | Notes |
20
- | --------- | --------- | --------------------------- |
21
- | `session` | `Session` | The session object to store |
22
-
23
- #### `SessionStorage.loadSession`
24
-
25
- Fetches a `Session` object from your storage. This function should return a `Session` object, or `null` if it was not found.
26
-
27
- | Param | Type | Notes |
28
- | ----------- | -------- | ----------------------------- |
29
- | `sessionId` | `string` | The id of the session to load |
30
-
31
- #### `SessionStorage.deleteSession`
32
-
33
- Deletes a session from your storage. This function should return a `bool` indicating whether the operation was successful.
34
-
35
- | Param | Type | Notes |
36
- | ----------- | -------- | ------------------------------- |
37
- | `sessionId` | `string` | The id of the session to delete |
38
-
39
- [Back to guide index](README.md)
@@ -1,46 +0,0 @@
1
-
2
- # Create a Session Storage Implementation
3
-
4
- The implementation of session storage that you pass in `ShopifyAPI::Context.setup` is what the Shopify gem will use to store and load sessions. [Shopify::Auth::FileSessionStorage](../../lib/shopify_api/auth/file_session_storage.rb) can be used for testing purposes and as an example of how to make an implementation in your app. This is not recommended for production, we recommend you implement a solution that will store and load serialized sessions from a more ideal store such as a database like MySQL or MongoDB.
5
-
6
- ## Create a New Session Storage Class
7
-
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
-
10
- | Method Name | Input Type | Return Type |
11
- | ---------------------- | --------------------------------- | ------------------------------ |
12
- | `store_session` | `ShopifyAPI::Auth::Session` | `Boolean` (true if successful) |
13
- | `load_session` | `String` (session id) | `ShopifyAPI::Auth::Session` |
14
- | `delete_session` | `String` (session id) | `Boolean` (true if successful) |
15
-
16
-
17
- ```ruby
18
- class CustomSessionStorage
19
- include ShopifyAPI::Auth::SessionStorage
20
-
21
- def initialize
22
- # Initialize as needed
23
- end
24
-
25
- def store_session(session)
26
- # Implement a store function
27
- some_store_function(id: session.id, session_data: session.serialize)
28
- end
29
-
30
- def load_session(id)
31
- # Implement a fetch function
32
- session_data = some_fetch_function(id)
33
- ShopifyAPI::Auth::Session.deserialize(session_data)
34
- end
35
-
36
- def delete_session(id)
37
- # Implement a delete function
38
- some_delete_function(id)
39
- true
40
- end
41
- end
42
- ```
43
-
44
- **Note:** We recommend utilizing the Session `serialize` and `deserialize` functions to make storing and loading sessions easier.
45
-
46
- Once this is complete you can pass an instance of this session storage class as `session_storage` in `ShopifyAPI::Context.setup`