shopify_api 7.0.1 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +22 -11
- data/Rakefile +5 -0
- data/docker-compose.yml +13 -0
- data/lib/shopify_api.rb +1 -0
- data/lib/shopify_api/api_version.rb +2 -5
- data/lib/shopify_api/defined_versions.rb +10 -0
- data/lib/shopify_api/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 536ae3dc24da93a37f8338cea6686c4018073f54b2a1dc4e8bbd4fdb25eb2c5f
|
4
|
+
data.tar.gz: 7ef36dd0517a77a70e5634d7fb359ef23f2f48622e44257514461400ffa367fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a76419a2c85136fd952596744c842c2a0bab63b7aae938b38c923537ea4560c741eb78a58af7d9fb042fcd700400766b430ce59fd47f5d06cb7b39a42c1794b
|
7
|
+
data.tar.gz: 65dc3afe191f8007b4b41d824b4e00bdf6256c01392399d0aac63363a412def433f376e8448d819504c88ba7014a8afe9ec9ccc5e4725093be1cf5797216f101
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -38,7 +38,7 @@ ShopifyAPI::Session.temp(domain: domain, token: token, api_version: api_version)
|
|
38
38
|
end
|
39
39
|
```
|
40
40
|
|
41
|
-
The `api_version` attribute can take the string or symbol name of any known version and correctly coerce it to a `ShopifyAPI::ApiVersion`. You can find the currently defined versions [here](https://github.com/Shopify/shopify_api/blob/master/lib/shopify_api/
|
41
|
+
The `api_version` attribute can take the string or symbol name of any known version and correctly coerce it to a `ShopifyAPI::ApiVersion`. You can find the currently defined versions [here](https://github.com/Shopify/shopify_api/blob/master/lib/shopify_api/defined_versions.rb), follow these [instructions](#adding-additional-api-versions) to add additional version definitions if needed.
|
42
42
|
|
43
43
|
For example if you want to use the `2019-04` version you would create a session like this:
|
44
44
|
```ruby
|
@@ -105,7 +105,7 @@ For more information and detailed documentation about the API visit https://deve
|
|
105
105
|
|
106
106
|
#### Ruby version
|
107
107
|
|
108
|
-
This gem requires Ruby 2.
|
108
|
+
This gem requires Ruby 2.4 as of version 7.0.
|
109
109
|
|
110
110
|
### Installation
|
111
111
|
|
@@ -290,20 +290,20 @@ ShopifyAPI uses ActiveResource to communicate with the REST web service. ActiveR
|
|
290
290
|
|
291
291
|
### Console
|
292
292
|
|
293
|
-
This package also supports the ``shopify-
|
293
|
+
This package also supports the ``shopify-api`` executable to make it easy to open up an interactive console to use the API with a shop.
|
294
294
|
|
295
|
-
1. Install the ``
|
295
|
+
1. Install the ``shopify_api_console`` gem.
|
296
296
|
|
297
297
|
```bash
|
298
|
-
gem install
|
298
|
+
gem install shopify_api_console
|
299
299
|
```
|
300
300
|
|
301
301
|
2. Obtain a private API key and password to use with your shop (step 2 in "Getting Started")
|
302
302
|
|
303
|
-
3. Use the ``shopify-
|
303
|
+
3. Use the ``shopify-api`` script to save the credentials for the shop to quickly log in.
|
304
304
|
|
305
305
|
```bash
|
306
|
-
shopify-
|
306
|
+
shopify-api add yourshopname
|
307
307
|
```
|
308
308
|
|
309
309
|
Follow the prompts for the shop domain, API key and password.
|
@@ -311,13 +311,13 @@ gem install shopify_cli
|
|
311
311
|
4. Start the console for the connection.
|
312
312
|
|
313
313
|
```bash
|
314
|
-
shopify-
|
314
|
+
shopify-api console
|
315
315
|
```
|
316
316
|
|
317
317
|
5. To see the full list of commands, type:
|
318
318
|
|
319
319
|
```bash
|
320
|
-
shopify-
|
320
|
+
shopify-api help
|
321
321
|
```
|
322
322
|
|
323
323
|
## GraphQL
|
@@ -344,13 +344,13 @@ result = client.query(SHOP_NAME_QUERY)
|
|
344
344
|
result.data.shop.name
|
345
345
|
```
|
346
346
|
|
347
|
-
## Adding
|
347
|
+
## Adding additional API versions
|
348
348
|
We will release a gem update every time we release a new version of the API. Most of the time upgrading the gem will be all you need to do.
|
349
349
|
|
350
350
|
If you want access to a newer version without upgrading you can define an api version.
|
351
351
|
For example if you wanted to add an `ApiVersion` '2022-03', you would add the following to the initialization of your application:
|
352
352
|
```ruby
|
353
|
-
ShopifyAPI::ApiVersion.define_version(ShopifyAPI::ApiVersion::Release.new('2022-03')
|
353
|
+
ShopifyAPI::ApiVersion.define_version(ShopifyAPI::ApiVersion::Release.new('2022-03'))
|
354
354
|
```
|
355
355
|
Once you have done that you can now set this version in a Sesssion like this:
|
356
356
|
|
@@ -374,6 +374,17 @@ bundle install
|
|
374
374
|
bundle exec rake test
|
375
375
|
```
|
376
376
|
|
377
|
+
or if you'd rather use docker just run:
|
378
|
+
```bash
|
379
|
+
docker run -it --name shopify_api -v "$PWD:/shopify_api" -w="/shopify_api" ruby:2.6 bundle install
|
380
|
+
docker exec -it shopify_api bash
|
381
|
+
```
|
382
|
+
|
383
|
+
or you can even use our automated rake task for docker:
|
384
|
+
```bash
|
385
|
+
bundle exec rake docker
|
386
|
+
```
|
387
|
+
|
377
388
|
## Additional Resources
|
378
389
|
|
379
390
|
* [API Reference](https://help.shopify.com/api/reference)
|
data/Rakefile
CHANGED
data/docker-compose.yml
ADDED
data/lib/shopify_api.rb
CHANGED
@@ -6,6 +6,7 @@ require 'digest/md5'
|
|
6
6
|
require 'base64'
|
7
7
|
require 'active_resource/detailed_log_subscriber'
|
8
8
|
require 'shopify_api/limits'
|
9
|
+
require 'shopify_api/defined_versions'
|
9
10
|
require 'shopify_api/api_version'
|
10
11
|
require 'active_resource/json_errors'
|
11
12
|
require 'shopify_api/disable_prefix_check'
|
@@ -4,6 +4,8 @@ module ShopifyAPI
|
|
4
4
|
class UnknownVersion < StandardError; end
|
5
5
|
class InvalidVersion < StandardError; end
|
6
6
|
|
7
|
+
extend DefinedVersions
|
8
|
+
|
7
9
|
include Comparable
|
8
10
|
|
9
11
|
def self.coerce_to_version(version_or_name)
|
@@ -25,11 +27,6 @@ module ShopifyAPI
|
|
25
27
|
@versions = {}
|
26
28
|
end
|
27
29
|
|
28
|
-
def self.define_known_versions
|
29
|
-
define_version(Unstable.new)
|
30
|
-
define_version(Release.new('2019-04'))
|
31
|
-
end
|
32
|
-
|
33
30
|
def self.latest_stable_version
|
34
31
|
@versions.values.select(&:stable?).sort.last
|
35
32
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module ShopifyAPI
|
3
|
+
module DefinedVersions
|
4
|
+
def define_known_versions
|
5
|
+
define_version(ShopifyAPI::ApiVersion::Unstable.new)
|
6
|
+
define_version(ShopifyAPI::ApiVersion::Release.new('2019-04'))
|
7
|
+
define_version(ShopifyAPI::ApiVersion::Release.new('2019-07'))
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
data/lib/shopify_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- RELEASING
|
202
202
|
- Rakefile
|
203
203
|
- bin/shopify
|
204
|
+
- docker-compose.yml
|
204
205
|
- lib/active_resource/connection_ext.rb
|
205
206
|
- lib/active_resource/detailed_log_subscriber.rb
|
206
207
|
- lib/active_resource/json_errors.rb
|
@@ -208,6 +209,7 @@ files:
|
|
208
209
|
- lib/shopify_api/api_version.rb
|
209
210
|
- lib/shopify_api/connection.rb
|
210
211
|
- lib/shopify_api/countable.rb
|
212
|
+
- lib/shopify_api/defined_versions.rb
|
211
213
|
- lib/shopify_api/disable_prefix_check.rb
|
212
214
|
- lib/shopify_api/events.rb
|
213
215
|
- lib/shopify_api/limits.rb
|