shopify_api 10.1.0 → 11.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +0 -1
  3. data/.github/workflows/cla.yml +22 -0
  4. data/.rubocop.yml +1 -1
  5. data/BREAKING_CHANGES_FOR_OLDER_VERSIONS.md +110 -0
  6. data/CHANGELOG.md +63 -49
  7. data/Gemfile.lock +26 -21
  8. data/README.md +5 -108
  9. data/RELEASING.md +2 -1
  10. data/docs/usage/graphql.md +1 -1
  11. data/lib/shopify_api/admin_versions.rb +2 -3
  12. data/lib/shopify_api/auth/file_session_storage.rb +2 -0
  13. data/lib/shopify_api/auth/jwt_payload.rb +16 -5
  14. data/lib/shopify_api/auth/session.rb +6 -6
  15. data/lib/shopify_api/auth.rb +26 -0
  16. data/lib/shopify_api/context.rb +6 -2
  17. data/lib/shopify_api/errors/missing_required_argument_error.rb +9 -0
  18. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/abandoned_checkout.rb +0 -0
  19. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/access_scope.rb +0 -0
  20. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/android_pay_key.rb +0 -0
  21. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/apple_pay_certificate.rb +0 -0
  22. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_charge.rb +0 -0
  23. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_credit.rb +0 -0
  24. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/article.rb +0 -0
  25. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/asset.rb +0 -0
  26. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/assigned_fulfillment_order.rb +0 -0
  27. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/balance.rb +0 -0
  28. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/blog.rb +0 -0
  29. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/cancellation_request.rb +0 -0
  30. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/carrier_service.rb +0 -3
  31. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/checkout.rb +0 -0
  32. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collect.rb +0 -0
  33. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection.rb +0 -0
  34. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection_listing.rb +0 -0
  35. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/comment.rb +0 -0
  36. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/country.rb +0 -0
  37. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/currency.rb +0 -0
  38. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/custom_collection.rb +0 -0
  39. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer.rb +12 -0
  40. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_address.rb +0 -0
  41. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_saved_search.rb +0 -0
  42. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/deprecated_api_call.rb +0 -0
  43. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/discount_code.rb +0 -0
  44. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/dispute.rb +0 -0
  45. data/lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb +117 -0
  46. data/lib/shopify_api/rest/resources/2022_07/dispute_file_upload.rb +81 -0
  47. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/draft_order.rb +6 -1
  48. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/event.rb +0 -0
  49. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment.rb +5 -49
  50. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_event.rb +0 -0
  51. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_order.rb +83 -1
  52. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_request.rb +5 -1
  53. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_service.rb +3 -3
  54. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card.rb +0 -0
  55. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card_adjustment.rb +0 -0
  56. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/image.rb +0 -0
  57. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_item.rb +0 -0
  58. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_level.rb +0 -0
  59. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/location.rb +0 -0
  60. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/locations_for_move.rb +0 -0
  61. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/marketing_event.rb +0 -0
  62. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/metafield.rb +0 -0
  63. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/mobile_platform_application.rb +0 -0
  64. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order.rb +3 -0
  65. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order_risk.rb +0 -0
  66. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/page.rb +0 -0
  67. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment.rb +0 -0
  68. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_gateway.rb +0 -0
  69. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_transaction.rb +0 -0
  70. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payout.rb +0 -0
  71. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/policy.rb +0 -0
  72. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/price_rule.rb +3 -3
  73. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product.rb +0 -0
  74. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_listing.rb +0 -0
  75. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_resource_feedback.rb +0 -0
  76. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/province.rb +0 -0
  77. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/recurring_application_charge.rb +0 -0
  78. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/redirect.rb +0 -0
  79. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/refund.rb +0 -0
  80. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/report.rb +0 -0
  81. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/resource_feedback.rb +0 -0
  82. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/script_tag.rb +0 -0
  83. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shipping_zone.rb +0 -0
  84. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shop.rb +0 -0
  85. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/smart_collection.rb +0 -0
  86. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/storefront_access_token.rb +0 -0
  87. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/tender_transaction.rb +0 -0
  88. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/theme.rb +0 -0
  89. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/transaction.rb +3 -0
  90. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/usage_charge.rb +0 -0
  91. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/user.rb +0 -0
  92. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/variant.rb +0 -0
  93. data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/webhook.rb +0 -0
  94. data/lib/shopify_api/utils/hmac_validator.rb +16 -6
  95. data/lib/shopify_api/version.rb +1 -1
  96. data/lib/shopify_api/webhooks/request.rb +1 -1
  97. data/sorbet/rbi/todo.rbi +0 -1
  98. metadata +83 -78
  99. data/.github/probots.yml +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc4cfe78db0e88c911424f8d3e2b3ed88b41a3bb91db59beea5a250222a784af
4
- data.tar.gz: c2f3d45bf47d0b0e5d8da086895c59145b0c84ef4b70f04acee72188278f4b74
3
+ metadata.gz: 2d1425c7556a52cb215845c0706990664207eb78bf0e42f5ef555f16ebb3398b
4
+ data.tar.gz: 8fbe1be46b5ebdfaac394195cbf44ae6bcd69fc90b6c8dc0709c417936f9dc2d
5
5
  SHA512:
6
- metadata.gz: f5fdbadb1ba50cf494e3eee2e08c6e2ee29085093821d24da8965d3215c1197ddadbaf0c1b2fb979ba59a3e3fad315691a85658ba970dd8f58b0a5f4b23456ab
7
- data.tar.gz: b71d5ec832995ae090aa52ee61c5fe3a67c05ad04d78a3e8f34cfee2fa8565f221ce5229a354f981c1de2d9eed25e2fd341919c6474695a973b7052b71db72df
6
+ metadata.gz: 0efde28dd28d29310a940a27d081e1979e44c8b32d282e845af4caaa93352a2d8a213b644b8868cc4416aece4a4867126b03c6e6f13b5bc36da0e2e3605caf26
7
+ data.tar.gz: 3c82238434799b244e9106eaa4c3736944bc4792c7e7794604d4c68ab9ba3587dae5b4573a5dd586c8087253726bed56dc87c257f1cd4d124c149ce3637f6c32
@@ -11,7 +11,6 @@ jobs:
11
11
  strategy:
12
12
  matrix:
13
13
  version:
14
- - 2.6
15
14
  - 2.7
16
15
  - 3.0
17
16
  - 3.1
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
data/.rubocop.yml CHANGED
@@ -5,7 +5,7 @@ require:
5
5
  - rubocop-sorbet
6
6
 
7
7
  AllCops:
8
- TargetRubyVersion: 2.6
8
+ TargetRubyVersion: 2.7
9
9
  NewCops: enable
10
10
  Exclude:
11
11
  - "sorbet/**/*"
@@ -0,0 +1,110 @@
1
+ # Breaking changes for older versions
2
+
3
+ The breaking changes for the previous major release are listed in the main [README](README.md).
4
+ The breaking changes for older major releases are listed below.
5
+
6
+ ### Breaking change notice for version 8.0.0
7
+
8
+ Version 7.0.0 introduced ApiVersion, and known versions were hardcoded into the gem. Manually defining API versions is no longer required for versions not listed in the gem. Version 8.0.0 removes the following:
9
+ * `ShopifyAPI::ApiVersion::Unstable`
10
+ * `ShopifyAPI::ApiVersion::Release`
11
+ * `ShopifyAPI::ApiVersion.define_version`
12
+
13
+ The following methods on `ApiVersion` have been deprecated:
14
+ - `.coerce_to_version` deprecated. use `.find_version`
15
+ - `.define_known_versions` deprecated. Use `.fetch_known_versions`
16
+ - `.clear_defined_versions` deprecated. Use. `.clear_known_versions`
17
+ - `.latest_stable_version` deprecated. Use `ShopifyAPI::Meta.admin_versions.find(&:latest_supported)` (this fetches info from Shopify servers. No authentication required.)
18
+ - `#name` deprecated. Use `#handle`
19
+ - `#stable?` deprecated. Use `#supported?`
20
+
21
+ Version 8.0.0 introduces a _version lookup mode_. By default, `ShopifyAPI::ApiVersion.version_lookup_mode` is `:define_on_unknown`. When setting the api_version on `Session` or `Base`, the `api_version` attribute takes a version handle (i.e. `'2019-07'` or `:unstable`) and sets an instance of `ShopifyAPI::ApiVersion` matching the handle. When the version_lookup_mode is set to `:define_on_unknown`, any handle will naïvely create a new `ApiVersion` if the version is not in the known versions returned by `ShopifyAPI::ApiVersion.versions`.
22
+
23
+ To ensure you're setting only known and active versions, call :
24
+
25
+ ```ruby
26
+ ShopifyAPI::ApiVersion.version_lookup_mode = :raise_on_unknown
27
+ ShopifyAPI::ApiVersion.fetch_known_versions
28
+ ```
29
+
30
+ Known and active versions are fetched from https://app.shopify.com/services/apis.json and cached. Trying to use a version outside this cached set will raise an error. To switch back to naïve lookup and create a version if one is not found, call `ShopifyAPI::ApiVersion.version_lookup_mode = :define_on_unknown`.
31
+
32
+ ### Breaking change notice for version 7.0.0
33
+
34
+ #### Changes to ShopifyAPI::Session
35
+ When creating sessions, `api_version`is now required and uses keyword arguments.
36
+
37
+ To upgrade your use of ShopifyAPI you will need to make the following changes.
38
+
39
+ ```ruby
40
+ ShopifyAPI::Session.new(domain, token, extras)
41
+ ```
42
+ is now
43
+ ```ruby
44
+ ShopifyAPI::Session.new(domain: domain, token: token, api_version: api_version, extras: extras)
45
+ ```
46
+ Note `extras` is still optional. The other arguments are required.
47
+
48
+ ```ruby
49
+ ShopifyAPI::Session.temp(domain, token, extras) do
50
+ ...
51
+ end
52
+ ```
53
+ is now
54
+ ```ruby
55
+ ShopifyAPI::Session.temp(domain: domain, token: token, api_version: api_version) do
56
+ ...
57
+ end
58
+ ```
59
+
60
+ For example, if you want to use the `2019-04` version, you will create a session like this:
61
+ ```ruby
62
+ session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: '2019-04')
63
+ ```
64
+ if you want to use the `unstable` version, you will create a session like this:
65
+ ```ruby
66
+ session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: :unstable)
67
+ ```
68
+
69
+ #### Changes to how to define resources
70
+
71
+ If you have defined or customized Resources, classes that extend `ShopifyAPI::Base`:
72
+ The use of `self.prefix =` has been deprecated; you should now use `self.resource =` and not include `/admin`.
73
+ For example, if you specified a prefix like this before:
74
+ ```ruby
75
+ class MyResource < ShopifyAPI::Base
76
+ self.prefix = '/admin/shop/'
77
+ end
78
+ ```
79
+ You will update this to:
80
+ ```ruby
81
+ class MyResource < ShopifyAPI::Base
82
+ self.resource_prefix = 'shop/'
83
+ end
84
+ ```
85
+
86
+ #### URL construction
87
+
88
+ If you have specified any full paths for API calls in find
89
+ ```ruby
90
+ def self.current(options={})
91
+ find(:one, options.merge(from: "/admin/shop.#{format.extension}"))
92
+ end
93
+ ```
94
+ would be changed to
95
+
96
+ ```ruby
97
+ def self.current(options = {})
98
+ find(:one, options.merge(
99
+ from: api_version.construct_api_path("shop.#{format.extension}")
100
+ ))
101
+ end
102
+ ```
103
+
104
+ #### URLs that have not changed
105
+
106
+ - OAuth URLs for `authorize`, getting the `access_token` from a code, `access_scopes`, and using a `refresh_token` have _not_ changed.
107
+ - get: `/admin/oauth/authorize`
108
+ - post: `/admin/oauth/access_token`
109
+ - get: `/admin/oauth/access_scopes`
110
+ - URLs for the merchant’s web admin have _not_ changed. For example: to send the merchant to the product page the url is still `/admin/product/<id>`
data/CHANGELOG.md CHANGED
@@ -4,67 +4,81 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## Version 11.1.0
8
+
9
+ - [#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
10
+
11
+ ## Version 11.0.1
12
+
13
+ - [#990](https://github.com/Shopify/shopify-api-ruby/pull/991) Validate `hmac` signature of OAuth callback using both old and new API secrets
14
+
15
+ ## Version 11.0.0
16
+
17
+ - [#987](https://github.com/Shopify/shopify-api-ruby/pull/987) ⚠️ [Breaking] Add REST resources for July 2022 API version, remove support and REST resources for July 2021 (`2021-07`) API version
18
+ - [#979](https://github.com/Shopify/shopify-api-ruby/pull/979) Update `ShopifyAPI::Context.setup` to take `old_api_secret_key` to support API credentials rotation
19
+ - [#977](https://github.com/Shopify/shopify-api-ruby/pull/977) Fix webhook requests when a header is present having a symbol key (e.g. `:clearance`)
20
+
7
21
  ## Version 10.1.0
8
22
 
9
- - [#933](https://github.com/Shopify/shopify_api/pull/933) Fix syntax of GraphQL query in `Webhooks.get_webhook_id` method by removing extra curly brace
10
- - [#941](https://github.com/Shopify/shopify_api/pull/941) Fix `to_hash` to return readonly attributes, unless being used for serialize the object for saving - fix issue [#930](https://github.com/Shopify/shopify_api/issues/930)
11
- - [#959](https://github.com/Shopify/shopify_api/pull/959) Update `LATEST_SUPPORTED_ADMIN_VERSION` to `2022-04` to align it with the current value
23
+ - [#933](https://github.com/Shopify/shopify-api-ruby/pull/933) Fix syntax of GraphQL query in `Webhooks.get_webhook_id` method by removing extra curly brace
24
+ - [#941](https://github.com/Shopify/shopify-api-ruby/pull/941) Fix `to_hash` to return readonly attributes, unless being used for serialize the object for saving - fix issue [#930](https://github.com/Shopify/shopify-api-ruby/issues/930)
25
+ - [#959](https://github.com/Shopify/shopify-api-ruby/pull/959) Update `LATEST_SUPPORTED_ADMIN_VERSION` to `2022-04` to align it with the current value
12
26
 
13
27
  ## Version 10.0.3
14
28
 
15
29
  ### Fixed
16
30
 
17
- - [#935](https://github.com/Shopify/shopify_api/pull/935) Fix issue [#931](https://github.com/Shopify/shopify_api/pull/931), weight of variant should be float
18
- - [#944](https://github.com/Shopify/shopify_api/pull/944) Deprecated the `validate_shop` method from the JWT class since we can trust the token payload, since it comes from Shopify.
31
+ - [#935](https://github.com/Shopify/shopify-api-ruby/pull/935) Fix issue [#931](https://github.com/Shopify/shopify-api-ruby/pull/931), weight of variant should be float
32
+ - [#944](https://github.com/Shopify/shopify-api-ruby/pull/944) Deprecated the `validate_shop` method from the JWT class since we can trust the token payload, since it comes from Shopify.
19
33
 
20
34
  ## Version 10.0.2
21
35
 
22
- - [#929](https://github.com/Shopify/shopify_api/pull/929) Aligning sorbet dependencies
36
+ - [#929](https://github.com/Shopify/shopify-api-ruby/pull/929) Aligning sorbet dependencies
23
37
 
24
38
  ## Version 10.0.1
25
39
 
26
40
  ### Fixed
27
41
 
28
- - [#919](https://github.com/Shopify/shopify_api/pull/919) Allow REST resources to configure a deny list of attributes to be excluded when saving
29
- - [#920](https://github.com/Shopify/shopify_api/pull/920) Set all values received from the API response to REST resource objects, and allow setting / getting attributes with special characters (such as `?`)
30
- - [#927](https://github.com/Shopify/shopify_api/pull/927) Fix the `ShopifyAPI::AdminVersions` module for backward compatibility
42
+ - [#919](https://github.com/Shopify/shopify-api-ruby/pull/919) Allow REST resources to configure a deny list of attributes to be excluded when saving
43
+ - [#920](https://github.com/Shopify/shopify-api-ruby/pull/920) Set all values received from the API response to REST resource objects, and allow setting / getting attributes with special characters (such as `?`)
44
+ - [#927](https://github.com/Shopify/shopify-api-ruby/pull/927) Fix the `ShopifyAPI::AdminVersions` module for backward compatibility
31
45
 
32
46
  ## Version 10.0.0
33
47
 
34
- - Major update to the library to provide _all_ essential functions needed for a Shopify app, supporting embedded apps with session tokens. See the [full list of changes](https://github.com/Shopify/shopify_api#breaking-change-notice-for-version-1000) here
48
+ - Major update to the library to provide _all_ essential functions needed for a Shopify app, supporting embedded apps with session tokens. See the [full list of changes](https://github.com/Shopify/shopify-api-ruby#breaking-change-notice-for-version-1000) here
35
49
 
36
50
  ## Version 9.5.1
37
51
 
38
- - [#891](https://github.com/Shopify/shopify_api/pull/891) Removed the upper bound on the `activeresource` dependency to allow apps to use the latest version
52
+ - [#891](https://github.com/Shopify/shopify-api-ruby/pull/891) Removed the upper bound on the `activeresource` dependency to allow apps to use the latest version
39
53
 
40
54
  ## Version 9.5
41
55
 
42
- - [#883](https://github.com/Shopify/shopify_api/pull/883) Add support for Ruby 3.0
56
+ - [#883](https://github.com/Shopify/shopify-api-ruby/pull/883) Add support for Ruby 3.0
43
57
 
44
58
  ## Version 9.4.1
45
59
 
46
- - [#847](https://github.com/Shopify/shopify_api/pull/847) Update `create_permission_url` method to use grant_options
47
- - [#852](https://github.com/Shopify/shopify_api/pull/852) Bumping kramdown to fix a security vulnerability
60
+ - [#847](https://github.com/Shopify/shopify-api-ruby/pull/847) Update `create_permission_url` method to use grant_options
61
+ - [#852](https://github.com/Shopify/shopify-api-ruby/pull/852) Bumping kramdown to fix a security vulnerability
48
62
 
49
63
  ## Version 9.4.0
50
64
 
51
- - [#843](https://github.com/Shopify/shopify_api/pull/843) Introduce a new `access_scopes` attribute on the Session class.
65
+ - [#843](https://github.com/Shopify/shopify-api-ruby/pull/843) Introduce a new `access_scopes` attribute on the Session class.
52
66
  - Specifying this in the Session constructor is optional. By default, this attribute returns `nil`.
53
67
 
54
68
  ## Version 9.3.0
55
69
 
56
- - [#797](https://github.com/Shopify/shopify_api/pull/797) Release new Endpoint `fulfillment_order.open` and `fulfillment_order.reschedule`.
70
+ - [#797](https://github.com/Shopify/shopify-api-ruby/pull/797) Release new Endpoint `fulfillment_order.open` and `fulfillment_order.reschedule`.
57
71
 
58
- - [#818](https://github.com/Shopify/shopify_api/pull/818) Avoid depending on ActiveSupport in Sesssion class.
72
+ - [#818](https://github.com/Shopify/shopify-api-ruby/pull/818) Avoid depending on ActiveSupport in Sesssion class.
59
73
 
60
74
  - Freeze all string literals. This should have no impact unless your application is modifying ('monkeypatching') the internals of the library in an unusual way.
61
75
 
62
- - [#802](https://github.com/Shopify/shopify_api/pull/802) Made `inventory_quantity` a read-only field in Variant
76
+ - [#802](https://github.com/Shopify/shopify-api-ruby/pull/802) Made `inventory_quantity` a read-only field in Variant
63
77
 
64
- - [#821](https://github.com/Shopify/shopify_api/pull/821) Add logging based on environment variable, move log subscriber out of `detailed_log_subscriber`.
78
+ - [#821](https://github.com/Shopify/shopify-api-ruby/pull/821) Add logging based on environment variable, move log subscriber out of `detailed_log_subscriber`.
65
79
  The `ActiveResource::DetailedLogSubscriber` no longer automatically attaches when the class is loaded. If you were previously relying on that behaviour, you'll now need to call `ActiveResource::DetailedLogSubscriber.attach_to(:active_resource_detailed)`. (If using the new `SHOPIFY_LOG_PATH` environment setting then this is handled for you).
66
80
 
67
- - Provide `ApiAccess` value object to encapsulate scope operations [#829](https://github.com/Shopify/shopify_api/pull/829)
81
+ - Provide `ApiAccess` value object to encapsulate scope operations [#829](https://github.com/Shopify/shopify-api-ruby/pull/829)
68
82
 
69
83
  ## Version 9.2.0
70
84
 
@@ -72,52 +86,52 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
72
86
 
73
87
  ## Version 9.1.1
74
88
 
75
- - Make cursor based pagination return relative uri's when fetching next and previous pages. [#726](https://github.com/Shopify/shopify_api/pull/726)
89
+ - Make cursor based pagination return relative uri's when fetching next and previous pages. [#726](https://github.com/Shopify/shopify-api-ruby/pull/726)
76
90
 
77
91
  ## Version 9.1.0
78
92
 
79
- - Implements equality operator on `Session` [#714](https://github.com/Shopify/shopify_api/pull/714)
93
+ - Implements equality operator on `Session` [#714](https://github.com/Shopify/shopify-api-ruby/pull/714)
80
94
 
81
95
  ## Version 9.0.4
82
96
 
83
- - Contains [#708](https://github.com/Shopify/shopify_api/pull/708) which is a revert for [#655](https://github.com/shopify/shopify_api/pull/655) due to the deprecated inventory parameters not being removed correctly in some cases
97
+ - Contains [#708](https://github.com/Shopify/shopify-api-ruby/pull/708) which is a revert for [#655](https://github.com/Shopify/shopify-api-ruby/pull/655) due to the deprecated inventory parameters not being removed correctly in some cases
84
98
 
85
99
  ## Version 9.0.3
86
100
 
87
- - We now raise a `ShopifyAPI::ValidationException` exception when clients try to use `Product` and `Variant` with deprecated inventory-related fields in API version `2019-10` or later. [#655](https://github.com/shopify/shopify_api/pull/655) Deprecation and migration information can be found in the following documents:
101
+ - We now raise a `ShopifyAPI::ValidationException` exception when clients try to use `Product` and `Variant` with deprecated inventory-related fields in API version `2019-10` or later. [#655](https://github.com/Shopify/shopify-api-ruby/pull/655) Deprecation and migration information can be found in the following documents:
88
102
  - [Product Variant REST API Reference](https://shopify.dev/docs/admin-api/rest/reference/products/product-variant)
89
103
  - [Migrate your app to support multiple locations](https://shopify.dev/tutorials/migrate-your-app-to-support-multiple-locations)
90
104
  - [Manage product inventory with the Admin API](https://shopify.dev/tutorials/manage-product-inventory-with-admin-api)
91
- - Added support for the Discount Code API batch endpoints [#701](https://github.com/shopify/shopify_api/pull/701)
105
+ - Added support for the Discount Code API batch endpoints [#701](https://github.com/Shopify/shopify-api-ruby/pull/701)
92
106
  - [Create](https://shopify.dev/docs/admin-api/rest/reference/discounts/discountcode#batch_create-2020-01)
93
107
  - [Show](https://shopify.dev/docs/admin-api/rest/reference/discounts/discountcode#batch_show-2020-01)
94
108
  - [List](https://shopify.dev/docs/admin-api/rest/reference/discounts/discountcode#batch_discount_codes_index-2020-01)
95
- - Fix issue in the README to explicitly say clients need to require the `shopify_api` gem [#700](https://github.com/Shopify/shopify_api/pull/700)
109
+ - Fix issue in the README to explicitly say clients need to require the `shopify_api` gem [#700](https://github.com/Shopify/shopify-api-ruby/pull/700)
96
110
 
97
111
  ## Version 9.0.2
98
112
 
99
- - Added optional flag passed to `initialize_clients` to prevent from raising the `InvalidSchema` exception [#693](https://github.com/Shopify/shopify_api/pull/693)
113
+ - Added optional flag passed to `initialize_clients` to prevent from raising the `InvalidSchema` exception [#693](https://github.com/Shopify/shopify-api-ruby/pull/693)
100
114
 
101
115
  ## Version 9.0.1
102
116
 
103
- - Added warning message if API version used is unsupported or soon to be unsupported [#685](https://github.com/Shopify/shopify_api/pull/685)
104
- - Take into account "errors" messages from response body [#677](https://github.com/Shopify/shopify_api/pull/677)
117
+ - Added warning message if API version used is unsupported or soon to be unsupported [#685](https://github.com/Shopify/shopify-api-ruby/pull/685)
118
+ - Take into account "errors" messages from response body [#677](https://github.com/Shopify/shopify-api-ruby/pull/677)
105
119
 
106
120
  ## Version 9.0.0
107
121
 
108
- - Breaking change: Improved GraphQL client [#672](https://github.com/Shopify/shopify_api/pull/672). See the [client docs](docs/graphql.md) for usage and a migration guide.
122
+ - Breaking change: Improved GraphQL client [#672](https://github.com/Shopify/shopify-api-ruby/pull/672). See the [client docs](docs/graphql.md) for usage and a migration guide.
109
123
 
110
- - Added options hash to create_permission_url and makes redirect_uri required [#670](https://github.com/Shopify/shopify_api/pull/670)
124
+ - Added options hash to create_permission_url and makes redirect_uri required [#670](https://github.com/Shopify/shopify-api-ruby/pull/670)
111
125
 
112
- - Release new Endpoint `fulfillment_order.locations_for_move` in 2020-01 REST API version [#669](https://github.com/Shopify/shopify_api/pull/669)
126
+ - Release new Endpoint `fulfillment_order.locations_for_move` in 2020-01 REST API version [#669](https://github.com/Shopify/shopify-api-ruby/pull/669)
113
127
 
114
- - Release new Endpoints for `fulfillment` in 2020-01 REST API version [#639](https://github.com/Shopify/shopify_api/pull/639):
128
+ - Release new Endpoints for `fulfillment` in 2020-01 REST API version [#639](https://github.com/Shopify/shopify-api-ruby/pull/639):
115
129
 
116
130
  - `fulfillment.create` with `line_items_by_fulfillment_order`
117
131
  - `fulfillment.update_tracking`
118
132
  - `fulfillment.cancel`
119
133
 
120
- - Release new Endpoints for `fulfillment_order` in 2020-01 REST API version [#637](https://github.com/Shopify/shopify_api/pull/637):
134
+ - Release new Endpoints for `fulfillment_order` in 2020-01 REST API version [#637](https://github.com/Shopify/shopify-api-ruby/pull/637):
121
135
 
122
136
  - `fulfillment_order.fulfillment_request`
123
137
  - `fulfillment_order.fulfillment_request.accept`
@@ -126,35 +140,35 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
126
140
  - `fulfillment_order.cancellation_request.accept`
127
141
  - `fulfillment_order.cancellation_request.reject`
128
142
 
129
- - Release new Endpoints `fulfillment_order.move`, `fulfillment_order.cancel` and `fulfillment_order.close` in 2020-01 REST API version [#635](https://github.com/Shopify/shopify_api/pull/635)
143
+ - Release new Endpoints `fulfillment_order.move`, `fulfillment_order.cancel` and `fulfillment_order.close` in 2020-01 REST API version [#635](https://github.com/Shopify/shopify-api-ruby/pull/635)
130
144
 
131
- - Release new Endpoint `order.fulfillment_orders`, and active resources `AssignedFulfillmentOrder` and `FulfillmentOrder` in 2020-01 REST API version [#633](https://github.com/Shopify/shopify_api/pull/633)
145
+ - Release new Endpoint `order.fulfillment_orders`, and active resources `AssignedFulfillmentOrder` and `FulfillmentOrder` in 2020-01 REST API version [#633](https://github.com/Shopify/shopify-api-ruby/pull/633)
132
146
 
133
147
  ## Version 8.1.0
134
148
 
135
- - Release 2020-01 REST ADMIN API VERSION [#656](https://github.com/Shopify/shopify_api/pull/656)
136
- - Release new Endpoint `collection.products` and `collection.find()` in 2020-01 REST API version [#657](https://github.com/Shopify/shopify_api/pull/657)
137
- - Enrich 4xx errors with error message from response body [#647](https://github.com/Shopify/shopify_api/pull/647)
138
- - Make relative cursor based pagination work across page loads [#625](https://github.com/Shopify/shopify_api/pull/625)
139
- - Small ruby compat fix [#623](https://github.com/Shopify/shopify_api/pull/623)
140
- - Small consistency change [#621](https://github.com/Shopify/shopify_api/pull/621)
149
+ - Release 2020-01 REST ADMIN API VERSION [#656](https://github.com/Shopify/shopify-api-ruby/pull/656)
150
+ - Release new Endpoint `collection.products` and `collection.find()` in 2020-01 REST API version [#657](https://github.com/Shopify/shopify-api-ruby/pull/657)
151
+ - Enrich 4xx errors with error message from response body [#647](https://github.com/Shopify/shopify-api-ruby/pull/647)
152
+ - Make relative cursor based pagination work across page loads [#625](https://github.com/Shopify/shopify-api-ruby/pull/625)
153
+ - Small ruby compat fix [#623](https://github.com/Shopify/shopify-api-ruby/pull/623)
154
+ - Small consistency change [#621](https://github.com/Shopify/shopify-api-ruby/pull/621)
141
155
 
142
156
  ## Version 8.0.0
143
157
 
144
- - Api Version changes [#600](https://github.com/Shopify/shopify_api/pull/600)
158
+ - Api Version changes [#600](https://github.com/Shopify/shopify-api-ruby/pull/600)
145
159
  - Remove static Api Version definitions.
146
160
  - Introduces Api Version lookup modes: `:define_on_unknown` and `:raise_on_unknown`
147
161
  - See [migration notes](README.md#-breaking-change-notice-for-version-800-)
148
162
  - `Session.valid?` checks that api_version `is_a?(ApiVersion)` instead of `present?`
149
- - `ApiVersion::NullVersion` cannot be instantiated and now has a `match?` method [#615](https://github.com/Shopify/shopify_api/pull/615/files)
150
- - Introduces new Collection endpoint for looking up products without knowing collection type. Only available if ApiVersion is `:unstable` [#609](https://github.com/Shopify/shopify_api/pull/609)
163
+ - `ApiVersion::NullVersion` cannot be instantiated and now has a `match?` method [#615](https://github.com/Shopify/shopify-api-ruby/pull/615/files)
164
+ - Introduces new Collection endpoint for looking up products without knowing collection type. Only available if ApiVersion is `:unstable` [#609](https://github.com/Shopify/shopify-api-ruby/pull/609)
151
165
 
152
166
  ## Version 7.1.0
153
167
 
154
168
  - Add 2019-10 to known API versions
155
- - Add support for cursor pagination [#594](https://github.com/Shopify/shopify_api/pull/594) and
156
- [#611](https://github.com/Shopify/shopify_api/pull/611)
157
- - `ShopifyAPI::Base.api_version` now defaults to `ShopifyAPI::ApiVersion::NullVersion` instead of `nil`. Making requests without first setting an ApiVersion raises `ApiVersionNotSetError` instead of `NoMethodError: undefined method 'construct_api_path' for nil:NilClass'` [#605](https://github.com/Shopify/shopify_api/pull/605)
169
+ - Add support for cursor pagination [#594](https://github.com/Shopify/shopify-api-ruby/pull/594) and
170
+ [#611](https://github.com/Shopify/shopify-api-ruby/pull/611)
171
+ - `ShopifyAPI::Base.api_version` now defaults to `ShopifyAPI::ApiVersion::NullVersion` instead of `nil`. Making requests without first setting an ApiVersion raises `ApiVersionNotSetError` instead of `NoMethodError: undefined method 'construct_api_path' for nil:NilClass'` [#605](https://github.com/Shopify/shopify-api-ruby/pull/605)
158
172
 
159
173
  ## Version 7.0.2
160
174
 
@@ -162,7 +176,7 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
162
176
 
163
177
  ## Version 7.0.1
164
178
 
165
- - Support passing version string to `ShopifyAPI::Base.api_version` [#563](https://github.com/Shopify/shopify_api/pull/563)
179
+ - Support passing version string to `ShopifyAPI::Base.api_version` [#563](https://github.com/Shopify/shopify-api-ruby/pull/563)
166
180
 
167
181
  ## Version 7.0.0
168
182
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (10.1.0)
4
+ shopify_api (11.1.0)
5
5
  concurrent-ruby
6
6
  hash_diff
7
7
  httparty
@@ -36,7 +36,7 @@ GEM
36
36
  multi_xml (>= 0.5.2)
37
37
  i18n (1.8.11)
38
38
  concurrent-ruby (~> 1.0)
39
- jwt (2.3.0)
39
+ jwt (2.4.1)
40
40
  method_source (1.0.0)
41
41
  mime-types (3.4.1)
42
42
  mime-types-data (~> 3.2015)
@@ -44,10 +44,11 @@ GEM
44
44
  minitest (5.15.0)
45
45
  mocha (1.13.0)
46
46
  multi_xml (0.6.0)
47
- oj (3.13.11)
47
+ netrc (0.11.0)
48
+ oj (3.13.20)
48
49
  openssl (3.0.0)
49
- parallel (1.21.0)
50
- parser (3.1.0.0)
50
+ parallel (1.22.1)
51
+ parser (3.1.2.1)
51
52
  ast (~> 2.4.1)
52
53
  pry (0.14.1)
53
54
  coderay (~> 1.1)
@@ -55,9 +56,9 @@ GEM
55
56
  public_suffix (4.0.6)
56
57
  rainbow (3.1.1)
57
58
  rake (13.0.6)
58
- rbi (0.0.11)
59
+ rbi (0.0.15)
59
60
  ast
60
- parser
61
+ parser (>= 2.6.4.0)
61
62
  sorbet-runtime (>= 0.5.9204)
62
63
  unparser
63
64
  regexp_parser (2.2.0)
@@ -79,29 +80,33 @@ GEM
79
80
  rubocop (>= 0.90.0)
80
81
  ruby-progressbar (1.11.0)
81
82
  securerandom (0.2.0)
82
- sorbet (0.5.10016)
83
- sorbet-static (= 0.5.10016)
84
- sorbet-runtime (0.5.10016)
85
- sorbet-static (0.5.10016-universal-darwin-21)
86
- sorbet-static (0.5.10016-x86_64-linux)
87
- spoom (1.1.8)
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)
91
+ spoom (1.1.11)
88
92
  sorbet (>= 0.5.9204)
89
93
  sorbet-runtime (>= 0.5.9204)
90
94
  thor (>= 0.19.2)
91
- tapioca (0.6.4)
95
+ tapioca (0.9.2)
92
96
  bundler (>= 1.17.3)
97
+ netrc (>= 0.11.0)
98
+ parallel (>= 1.21.0)
93
99
  pry (>= 0.12.2)
94
- rbi (~> 0.0.0, >= 0.0.9)
95
- sorbet-runtime (>= 0.5.9204)
96
- sorbet-static (>= 0.5.9204)
97
- spoom (~> 1.1.0, >= 1.1.4)
100
+ rbi (~> 0.0.0, >= 0.0.14)
101
+ sorbet-static-and-runtime (>= 0.5.9204)
102
+ spoom (~> 1.1.0, >= 1.1.11)
98
103
  thor (>= 1.2.0)
99
104
  yard-sorbet
100
105
  thor (1.2.1)
101
106
  tzinfo (2.0.4)
102
107
  concurrent-ruby (~> 1.0)
103
108
  unicode-display_width (2.1.0)
104
- unparser (0.6.3)
109
+ unparser (0.6.5)
105
110
  diff-lcs (~> 1.3)
106
111
  parser (>= 3.1.0)
107
112
  webmock (3.14.0)
@@ -109,12 +114,12 @@ GEM
109
114
  crack (>= 0.3.2)
110
115
  hashdiff (>= 0.4.0, < 2.0.0)
111
116
  webrick (1.7.0)
112
- yard (0.9.27)
117
+ yard (0.9.28)
113
118
  webrick (~> 1.7.0)
114
119
  yard-sorbet (0.6.1)
115
120
  sorbet-runtime (>= 0.5)
116
121
  yard (>= 0.9)
117
- zeitwerk (2.5.4)
122
+ zeitwerk (2.6.0)
118
123
 
119
124
  PLATFORMS
120
125
  arm64-darwin-21
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <!-- ![Build Status]() -->
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
5
- ![Build Status](https://github.com/Shopify/shopify_api/workflows/CI/badge.svg?branch=main)
5
+ ![Build Status](https://github.com/Shopify/shopify-api-ruby/workflows/CI/badge.svg?branch=main)
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
 
@@ -15,7 +15,7 @@ In addition to the Admin API, this library also allows querying the [Storefront
15
15
 
16
16
  You can use this library in any application that has a Ruby backend, since it doesn't rely on any specific framework — you can include it alongside your preferred stack and use the features that you need to build your app.
17
17
 
18
- **Note**: These instructions apply to v10 or later of this package. If you're running v9 in your app, you can find the documentation [in this branch](https://github.com/Shopify/shopify_api/tree/v9).
18
+ **Note**: These instructions apply to v10 or later of this package. If you're running v9 in your app, you can find the documentation [in this branch](https://github.com/Shopify/shopify-api-ruby/tree/v9).
19
19
 
20
20
  ## Requirements
21
21
 
@@ -97,7 +97,7 @@ Here are the main features it provides:
97
97
  - Webhook management, with features for adding handlers and registering them with Shopify.
98
98
  - Storefront GraphQL API support
99
99
 
100
- Please refer to [the documentation](https://github.com/Shopify/shopify_api/blob/main/docs/getting_started.md) in this repository for instructions on how to use each of these components.
100
+ Please refer to [the documentation](docs/getting_started.md) in this repository for instructions on how to use each of these components.
101
101
 
102
102
  With this, a lot changed in how apps access the library. Here are the updates you should make when migrating to v10:
103
103
 
@@ -115,112 +115,9 @@ With this, a lot changed in how apps access the library. Here are the updates yo
115
115
  | `order = Order.new(<id>)`<br/>`order.post(:close)` | `order = Order.new(session:)`<br/>`order.close()` |
116
116
  | `order = Order.new(<id>)`<br/>`order.delete` | `Order.delete(id: <id>, session:)` |
117
117
 
118
- ### Breaking change notice for version 8.0.0
119
-
120
- Version 7.0.0 introduced ApiVersion, and known versions were hardcoded into the gem. Manually defining API versions is no longer required for versions not listed in the gem. Version 8.0.0 removes the following:
121
- * `ShopifyAPI::ApiVersion::Unstable`
122
- * `ShopifyAPI::ApiVersion::Release`
123
- * `ShopifyAPI::ApiVersion.define_version`
124
-
125
- The following methods on `ApiVersion` have been deprecated:
126
- - `.coerce_to_version` deprecated. use `.find_version`
127
- - `.define_known_versions` deprecated. Use `.fetch_known_versions`
128
- - `.clear_defined_versions` deprecated. Use. `.clear_known_versions`
129
- - `.latest_stable_version` deprecated. Use `ShopifyAPI::Meta.admin_versions.find(&:latest_supported)` (this fetches info from Shopify servers. No authentication required.)
130
- - `#name` deprecated. Use `#handle`
131
- - `#stable?` deprecated. Use `#supported?`
132
-
133
- Version 8.0.0 introduces a _version lookup mode_. By default, `ShopifyAPI::ApiVersion.version_lookup_mode` is `:define_on_unknown`. When setting the api_version on `Session` or `Base`, the `api_version` attribute takes a version handle (i.e. `'2019-07'` or `:unstable`) and sets an instance of `ShopifyAPI::ApiVersion` matching the handle. When the version_lookup_mode is set to `:define_on_unknown`, any handle will naïvely create a new `ApiVersion` if the version is not in the known versions returned by `ShopifyAPI::ApiVersion.versions`.
134
-
135
- To ensure you're setting only known and active versions, call :
136
-
137
- ```ruby
138
- ShopifyAPI::ApiVersion.version_lookup_mode = :raise_on_unknown
139
- ShopifyAPI::ApiVersion.fetch_known_versions
140
- ```
141
-
142
- Known and active versions are fetched from https://app.shopify.com/services/apis.json and cached. Trying to use a version outside this cached set will raise an error. To switch back to naïve lookup and create a version if one is not found, call `ShopifyAPI::ApiVersion.version_lookup_mode = :define_on_unknown`.
143
-
144
- ### Breaking change notice for version 7.0.0
145
-
146
- #### Changes to ShopifyAPI::Session
147
- When creating sessions, `api_version`is now required and uses keyword arguments.
148
-
149
- To upgrade your use of ShopifyAPI you will need to make the following changes.
150
-
151
- ```ruby
152
- ShopifyAPI::Session.new(domain, token, extras)
153
- ```
154
- is now
155
- ```ruby
156
- ShopifyAPI::Session.new(domain: domain, token: token, api_version: api_version, extras: extras)
157
- ```
158
- Note `extras` is still optional. The other arguments are required.
159
-
160
- ```ruby
161
- ShopifyAPI::Session.temp(domain, token, extras) do
162
- ...
163
- end
164
- ```
165
- is now
166
- ```ruby
167
- ShopifyAPI::Session.temp(domain: domain, token: token, api_version: api_version) do
168
- ...
169
- end
170
- ```
171
-
172
- For example, if you want to use the `2019-04` version, you will create a session like this:
173
- ```ruby
174
- session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: '2019-04')
175
- ```
176
- if you want to use the `unstable` version, you will create a session like this:
177
- ```ruby
178
- session = ShopifyAPI::Session.new(domain: domain, token: token, api_version: :unstable)
179
- ```
180
-
181
- #### Changes to how to define resources
182
-
183
- If you have defined or customized Resources, classes that extend `ShopifyAPI::Base`:
184
- The use of `self.prefix =` has been deprecated; you should now use `self.resource =` and not include `/admin`.
185
- For example, if you specified a prefix like this before:
186
- ```ruby
187
- class MyResource < ShopifyAPI::Base
188
- self.prefix = '/admin/shop/'
189
- end
190
- ```
191
- You will update this to:
192
- ```ruby
193
- class MyResource < ShopifyAPI::Base
194
- self.resource_prefix = 'shop/'
195
- end
196
- ```
197
-
198
- #### URL construction
199
-
200
- If you have specified any full paths for API calls in find
201
- ```ruby
202
- def self.current(options={})
203
- find(:one, options.merge(from: "/admin/shop.#{format.extension}"))
204
- end
205
- ```
206
- would be changed to
207
-
208
- ```ruby
209
- def self.current(options = {})
210
- find(:one, options.merge(
211
- from: api_version.construct_api_path("shop.#{format.extension}")
212
- ))
213
- end
214
- ```
215
-
216
- #### URLs that have not changed
217
-
218
- - OAuth URLs for `authorize`, getting the `access_token` from a code, `access_scopes`, and using a `refresh_token` have _not_ changed.
219
- - get: `/admin/oauth/authorize`
220
- - post: `/admin/oauth/access_token`
221
- - get: `/admin/oauth/access_scopes`
222
- - URLs for the merchant’s web admin have _not_ changed. For example: to send the merchant to the product page the url is still `/admin/product/<id>`
118
+ ## Breaking changes for older versions
223
119
 
120
+ See [BREAKING_CHANGES_FOR_OLDER_VERSIONS](BREAKING_CHANGES_FOR_OLDER_VERSIONS.md)
224
121
 
225
122
  ## Developing this gem
226
123