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.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +0 -1
- data/.github/workflows/cla.yml +22 -0
- data/.rubocop.yml +1 -1
- data/BREAKING_CHANGES_FOR_OLDER_VERSIONS.md +110 -0
- data/CHANGELOG.md +63 -49
- data/Gemfile.lock +26 -21
- data/README.md +5 -108
- data/RELEASING.md +2 -1
- data/docs/usage/graphql.md +1 -1
- data/lib/shopify_api/admin_versions.rb +2 -3
- data/lib/shopify_api/auth/file_session_storage.rb +2 -0
- data/lib/shopify_api/auth/jwt_payload.rb +16 -5
- data/lib/shopify_api/auth/session.rb +6 -6
- data/lib/shopify_api/auth.rb +26 -0
- data/lib/shopify_api/context.rb +6 -2
- data/lib/shopify_api/errors/missing_required_argument_error.rb +9 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/abandoned_checkout.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/access_scope.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/android_pay_key.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/apple_pay_certificate.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_charge.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/application_credit.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/article.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/asset.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/assigned_fulfillment_order.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/balance.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/blog.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/cancellation_request.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/carrier_service.rb +0 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/checkout.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collect.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/collection_listing.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/comment.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/country.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/currency.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/custom_collection.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer.rb +12 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_address.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/customer_saved_search.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/deprecated_api_call.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/discount_code.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/dispute.rb +0 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb +117 -0
- data/lib/shopify_api/rest/resources/2022_07/dispute_file_upload.rb +81 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/draft_order.rb +6 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/event.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment.rb +5 -49
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_event.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_order.rb +83 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_request.rb +5 -1
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/fulfillment_service.rb +3 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/gift_card_adjustment.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/image.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_item.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/inventory_level.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/location.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/locations_for_move.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/marketing_event.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/metafield.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/mobile_platform_application.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order.rb +3 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/order_risk.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/page.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_gateway.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payment_transaction.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/payout.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/policy.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/price_rule.rb +3 -3
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_listing.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/product_resource_feedback.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/province.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/recurring_application_charge.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/redirect.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/refund.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/report.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/resource_feedback.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/script_tag.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shipping_zone.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/shop.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/smart_collection.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/storefront_access_token.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/tender_transaction.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/theme.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/transaction.rb +3 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/usage_charge.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/user.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/variant.rb +0 -0
- data/lib/shopify_api/rest/resources/{2021_07 → 2022_07}/webhook.rb +0 -0
- data/lib/shopify_api/utils/hmac_validator.rb +16 -6
- data/lib/shopify_api/version.rb +1 -1
- data/lib/shopify_api/webhooks/request.rb +1 -1
- data/sorbet/rbi/todo.rbi +0 -1
- metadata +83 -78
- data/.github/probots.yml +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d1425c7556a52cb215845c0706990664207eb78bf0e42f5ef555f16ebb3398b
|
4
|
+
data.tar.gz: 8fbe1be46b5ebdfaac394195cbf44ae6bcd69fc90b6c8dc0709c417936f9dc2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0efde28dd28d29310a940a27d081e1979e44c8b32d282e845af4caaa93352a2d8a213b644b8868cc4416aece4a4867126b03c6e6f13b5bc36da0e2e3605caf26
|
7
|
+
data.tar.gz: 3c82238434799b244e9106eaa4c3736944bc4792c7e7794604d4c68ab9ba3587dae5b4573a5dd586c8087253726bed56dc87c257f1cd4d124c149ce3637f6c32
|
data/.github/workflows/build.yml
CHANGED
@@ -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
@@ -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/
|
10
|
-
- [#941](https://github.com/Shopify/
|
11
|
-
- [#959](https://github.com/Shopify/
|
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/
|
18
|
-
- [#944](https://github.com/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/
|
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/
|
29
|
-
- [#920](https://github.com/Shopify/
|
30
|
-
- [#927](https://github.com/Shopify/
|
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/
|
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/
|
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/
|
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/
|
47
|
-
- [#852](https://github.com/Shopify/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
104
|
-
- Take into account "errors" messages from response body [#677](https://github.com/Shopify/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
136
|
-
- Release new Endpoint `collection.products` and `collection.find()` in 2020-01 REST API version [#657](https://github.com/Shopify/
|
137
|
-
- Enrich 4xx errors with error message from response body [#647](https://github.com/Shopify/
|
138
|
-
- Make relative cursor based pagination work across page loads [#625](https://github.com/Shopify/
|
139
|
-
- Small ruby compat fix [#623](https://github.com/Shopify/
|
140
|
-
- Small consistency change [#621](https://github.com/Shopify/
|
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/
|
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/
|
150
|
-
- Introduces new Collection endpoint for looking up products without knowing collection type. Only available if ApiVersion is `:unstable` [#609](https://github.com/Shopify/
|
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/
|
156
|
-
[#611](https://github.com/Shopify/
|
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/
|
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/
|
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 (
|
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.
|
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
|
-
|
47
|
+
netrc (0.11.0)
|
48
|
+
oj (3.13.20)
|
48
49
|
openssl (3.0.0)
|
49
|
-
parallel (1.
|
50
|
-
parser (3.1.
|
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.
|
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.
|
83
|
-
sorbet-static (= 0.5.
|
84
|
-
sorbet-runtime (0.5.
|
85
|
-
sorbet-static (0.5.
|
86
|
-
sorbet-static (0.5.
|
87
|
-
|
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.
|
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.
|
95
|
-
sorbet-runtime (>= 0.5.9204)
|
96
|
-
|
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.
|
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.
|
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.
|
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/
|
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/
|
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](
|
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
|
-
|
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
|
|