bigcommerce 1.0.0 → 1.1.0
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 +5 -5
- data/README.md +54 -21
- data/bigcommerce.gemspec +10 -10
- data/lib/bigcommerce/config.rb +16 -2
- data/lib/bigcommerce/connection.rb +8 -3
- data/lib/bigcommerce/exception.rb +13 -11
- data/lib/bigcommerce/middleware/auth.rb +8 -2
- data/lib/bigcommerce/middleware/http_exception.rb +2 -0
- data/lib/bigcommerce/path_builder.rb +44 -0
- data/lib/bigcommerce/request.rb +9 -29
- data/lib/bigcommerce/resource_actions.rb +8 -0
- data/lib/bigcommerce/resources/content/blog_post.rb +2 -0
- data/lib/bigcommerce/resources/content/blog_tag.rb +2 -0
- data/lib/bigcommerce/resources/content/redirect.rb +2 -0
- data/lib/bigcommerce/resources/customers/customer.rb +23 -0
- data/lib/bigcommerce/resources/customers/customer_address.rb +2 -0
- data/lib/bigcommerce/resources/customers/customer_group.rb +2 -0
- data/lib/bigcommerce/resources/geography/country.rb +3 -1
- data/lib/bigcommerce/resources/geography/state.rb +3 -1
- data/lib/bigcommerce/resources/marketing/banner.rb +2 -0
- data/lib/bigcommerce/resources/marketing/coupon.rb +2 -0
- data/lib/bigcommerce/resources/marketing/gift_certificates.rb +2 -0
- data/lib/bigcommerce/resources/orders/order.rb +10 -0
- data/lib/bigcommerce/resources/orders/order_coupon.rb +3 -1
- data/lib/bigcommerce/resources/orders/order_message.rb +3 -1
- data/lib/bigcommerce/resources/orders/order_product.rb +3 -1
- data/lib/bigcommerce/resources/orders/order_shipping_address.rb +3 -1
- data/lib/bigcommerce/resources/orders/order_status.rb +3 -1
- data/lib/bigcommerce/resources/orders/order_tax.rb +3 -1
- data/lib/bigcommerce/resources/orders/shipment.rb +2 -0
- data/lib/bigcommerce/resources/payments/payment_method.rb +2 -0
- data/lib/bigcommerce/resources/products/brand.rb +2 -0
- data/lib/bigcommerce/resources/products/bulk_pricing_rule.rb +2 -0
- data/lib/bigcommerce/resources/products/category.rb +2 -0
- data/lib/bigcommerce/resources/products/configurable_field.rb +3 -1
- data/lib/bigcommerce/resources/products/custom_field.rb +2 -0
- data/lib/bigcommerce/resources/products/google_product_search_mapping.rb +2 -0
- data/lib/bigcommerce/resources/products/option.rb +2 -0
- data/lib/bigcommerce/resources/products/option_set.rb +2 -0
- data/lib/bigcommerce/resources/products/option_set_option.rb +2 -0
- data/lib/bigcommerce/resources/products/option_value.rb +2 -0
- data/lib/bigcommerce/resources/products/product.rb +2 -0
- data/lib/bigcommerce/resources/products/product_image.rb +2 -0
- data/lib/bigcommerce/resources/products/product_option.rb +3 -1
- data/lib/bigcommerce/resources/products/product_review.rb +2 -0
- data/lib/bigcommerce/resources/products/product_rule.rb +2 -0
- data/lib/bigcommerce/resources/products/product_video.rb +2 -0
- data/lib/bigcommerce/resources/products/sku.rb +2 -0
- data/lib/bigcommerce/resources/resource.rb +2 -0
- data/lib/bigcommerce/resources/shipping/shipping_method.rb +3 -1
- data/lib/bigcommerce/resources/store/store_information.rb +2 -0
- data/lib/bigcommerce/resources/system/time.rb +2 -0
- data/lib/bigcommerce/resources/tax/tax_class.rb +3 -1
- data/lib/bigcommerce/resources/webhooks/webhook.rb +2 -0
- data/lib/bigcommerce/subresource_actions.rb +8 -0
- data/lib/bigcommerce/version.rb +3 -1
- data/lib/bigcommerce.rb +17 -9
- metadata +35 -40
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 91c155920d961947d4e7a2184fa2ffad660590d636bd70723d9eec87d4709f3b
|
|
4
|
+
data.tar.gz: dc8618135e2e88f8b2fa39954179d24ff56f435fa50185f4dd85baceb11684ef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3790b83072b92e5477bcdf2dffe1d13ca0da2beb501706dac775307701b68efc39c5168852309990f5255501d87c8178674820b0e6072ffe4208b439081ec2a
|
|
7
|
+
data.tar.gz: 411c3da75158d702890e5f764e44e708dabf2a713880f36af0283a40b05fff5b158eeea016a39b9253f1429dbb7322ec8c8737963696c3671fa960b65bcb394d
|
data/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# BigCommerce API Ruby
|
|
2
2
|
|
|
3
3
|
[](https://rubygems.org/gems/bigcommerce)
|
|
4
|
-
[](https://circleci.com/gh/bigcommerce/bigcommerce-api-ruby/tree/master)
|
|
5
|
+
[](https://codeclimate.com/github/bigcommerce/bigcommerce-api-ruby/test_coverage)
|
|
6
|
+
[](https://codeclimate.com/github/bigcommerce/bigcommerce-api-ruby/maintainability)
|
|
6
7
|
|
|
7
|
-
This is the official BigCommerce API client to support our Stores API. You can find more information about becoming a
|
|
8
|
+
This is the official BigCommerce API client to support our Stores API. You can find more information about becoming a
|
|
9
|
+
BigCommerce developer here: [developer.bigcommerce.com](http://developer.bigcommerce.com).
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
## Installation
|
|
@@ -17,22 +19,26 @@ gem install bigcommerce
|
|
|
17
19
|
You can also add it to your Gemfile.
|
|
18
20
|
|
|
19
21
|
```rb
|
|
20
|
-
gem 'bigcommerce', '~> 1.0
|
|
22
|
+
gem 'bigcommerce', '~> 1.0'
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
## Requirements
|
|
24
|
-
|
|
26
|
+
|
|
27
|
+
- Ruby 2.7.5 or newer (Ruby 3.0+ is preferred)
|
|
25
28
|
|
|
26
29
|
## Getting Started
|
|
27
|
-
|
|
30
|
+
To make requests to our API, you must register as a developer and have your credentials ready.
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
Also very important: For the OAuth authentication mechanism, the resources to which you have acccess depend on the
|
|
33
|
+
scopes that the merchant has granted to your application. For more information about Store API scopes,
|
|
34
|
+
see: [OAuth Scopes](https://developer.bigcommerce.com/api/scopes).
|
|
30
35
|
|
|
31
36
|
## Authentication
|
|
32
|
-
We currently have two different authentication schemes you can
|
|
37
|
+
We currently have two different authentication schemes that you can select, depending on your use case.
|
|
33
38
|
|
|
34
39
|
### OAuth
|
|
35
|
-
OAuth apps can be submitted to [BigCommerce App Store](https://www.bigcommerce.com/apps), allowing other merchants to install
|
|
40
|
+
OAuth apps can be submitted to [BigCommerce App Store](https://www.bigcommerce.com/apps), allowing other merchants to install these apps in their
|
|
41
|
+
BigCommerce stores.
|
|
36
42
|
|
|
37
43
|
__[More Information](https://developer.bigcommerce.com/api/using-oauth-intro)__
|
|
38
44
|
|
|
@@ -42,11 +48,11 @@ To develop a custom integration for one store, your app needs to use Basic Authe
|
|
|
42
48
|
__[More Information](https://developer.bigcommerce.com/api/legacy/basic-auth)__
|
|
43
49
|
|
|
44
50
|
## Configuration
|
|
45
|
-
|
|
51
|
+
To authenticate your API client, you will need to configure the client like the following examples.
|
|
46
52
|
|
|
47
53
|
### OAuth App
|
|
48
54
|
|
|
49
|
-
- ```client_id```: Obtained from the
|
|
55
|
+
- ```client_id```: Obtained from the on the BigCommerce [Developer Portal's](http://developer.bigcommerce.com) "My Apps" section.
|
|
50
56
|
- ```access_token```: Obtained after a token exchange in the auth callback.
|
|
51
57
|
- ```store_hash```: Also obtained after the token exchange.
|
|
52
58
|
|
|
@@ -60,7 +66,9 @@ end
|
|
|
60
66
|
|
|
61
67
|
### Basic Authentication (Legacy)
|
|
62
68
|
|
|
63
|
-
To get all the basic auth credentials, simply visit your store admin page and navigate to the
|
|
69
|
+
To get all the basic auth credentials, simply visit your store admin page, and navigate to the
|
|
70
|
+
`Advanced Settings` > `Legacy API Settings`. Once there, you can create a new legacy API account on which to authenticate.
|
|
71
|
+
|
|
64
72
|
|
|
65
73
|
```rb
|
|
66
74
|
Bigcommerce.configure do |config|
|
|
@@ -73,7 +81,8 @@ end
|
|
|
73
81
|
|
|
74
82
|
__SSL Configuration__
|
|
75
83
|
|
|
76
|
-
If you are using your own self-signed certificate, you can pass SSL options to Faraday. This is not required, but
|
|
84
|
+
If you are using your own, self-signed, certificate, you can pass SSL options to Faraday. This is not required, but
|
|
85
|
+
might be useful in special edge cases.
|
|
77
86
|
|
|
78
87
|
```rb
|
|
79
88
|
Bigcommerce.configure do |config|
|
|
@@ -90,11 +99,27 @@ end
|
|
|
90
99
|
For more information about configuring SSL with Faraday, please see the following:
|
|
91
100
|
|
|
92
101
|
- [Faraday SSL example](https://gist.github.com/mislav/938183)
|
|
93
|
-
- [Setting up SSL certificates](https://github.com/lostisland/faraday/wiki/Setting-up-SSL-certificates)
|
|
102
|
+
- [Faraday: Setting up SSL certificates](https://github.com/lostisland/faraday/wiki/Setting-up-SSL-certificates)
|
|
103
|
+
|
|
104
|
+
### Customer Login API
|
|
105
|
+
If you want to generate tokens for storefront login using the Customer Login API, you need to configure your app's
|
|
106
|
+
client secret.
|
|
94
107
|
|
|
108
|
+
- ```store_hash```: The store hash of the store you are operating against.
|
|
109
|
+
- ```client_id```: Obtained from the on the BigCommerce [Developer Portal's](http://developer.bigcommerce.com) "My Apps" section.
|
|
110
|
+
- ```client_secret```: Obtained from the on the BigCommerce [Developer Portal's](http://developer.bigcommerce.com) "My Apps" section.
|
|
111
|
+
|
|
112
|
+
```rb
|
|
113
|
+
Bigcommerce.configure do |config|
|
|
114
|
+
config.store_hash = ENV['BC_STORE_HASH']
|
|
115
|
+
config.client_id = ENV['BC_CLIENT_ID']
|
|
116
|
+
config.client_secret = ENV['BC_CLIENT_SECRET']
|
|
117
|
+
end
|
|
118
|
+
```
|
|
95
119
|
|
|
96
120
|
## Usage
|
|
97
|
-
For full examples
|
|
121
|
+
For full examples of using the API client, please see the [examples folder](examples) and refer to
|
|
122
|
+
BigCommerce's [developer documentation](https://developer.bigcommerce.com/api).
|
|
98
123
|
|
|
99
124
|
Example:
|
|
100
125
|
|
|
@@ -113,19 +138,24 @@ Bigcommerce::System.time
|
|
|
113
138
|
|
|
114
139
|
### Thread Safety
|
|
115
140
|
|
|
116
|
-
The `Bigcommerce.configure` method is NOT thread
|
|
141
|
+
The `Bigcommerce.configure` method is NOT thread-safe. This mechanism is designed for applications or
|
|
142
|
+
CLIs (command-line interfaces) where thread safety is not a concern. If you need to guarantee thread safety, we support
|
|
143
|
+
this alternative mechanism to make thread-safe API requests:
|
|
117
144
|
|
|
118
|
-
Rather then setting up a single `connection` for all API requests,
|
|
145
|
+
Rather then setting up a single `connection` for all API requests, construct a new connection for each thread.
|
|
146
|
+
If you can ensure that each of these connections is stored in a thread-safe manner, you can pass the `connection` as
|
|
147
|
+
you query the resource.
|
|
119
148
|
|
|
120
|
-
This connection is nothing more than a `Faraday::Connection` so if you want to write your own, or use your own
|
|
149
|
+
This connection is nothing more than a `Faraday::Connection` – so if you want to write your own, or to use your own
|
|
150
|
+
adapters, you can feel free. Please refer to this gem's [connection class](https://github.com/bigcommerce/bigcommerce-api-ruby/blob/master/lib/bigcommerce/connection.rb) for more details.
|
|
121
151
|
|
|
122
152
|
##### OAuth
|
|
123
153
|
|
|
124
154
|
```rb
|
|
125
155
|
connection = Bigcommerce::Connection.build(
|
|
126
156
|
Bigcommerce::Config.new(
|
|
127
|
-
store_hash: ENV['BC_STORE_HASH'],
|
|
128
|
-
client_id: ENV['BC_CLIENT_ID'],
|
|
157
|
+
store_hash: ENV['BC_STORE_HASH'],
|
|
158
|
+
client_id: ENV['BC_CLIENT_ID'],
|
|
129
159
|
access_token: ENV['BC_ACCESS_TOKEN']
|
|
130
160
|
)
|
|
131
161
|
)
|
|
@@ -143,7 +173,7 @@ Bigcommerce::System.raw_request(:get, 'time', connection: connection)
|
|
|
143
173
|
```rb
|
|
144
174
|
connection_legacy = Bigcommerce::Connection.build(
|
|
145
175
|
Bigcommerce::Config.new(
|
|
146
|
-
auth: 'legacy',
|
|
176
|
+
auth: 'legacy',
|
|
147
177
|
url: ENV['BC_API_ENDPOINT_LEGACY'],
|
|
148
178
|
username: ENV['BC_USERNAME'],
|
|
149
179
|
api_key: ENV['BC_API_KEY']
|
|
@@ -160,3 +190,6 @@ Bigcommerce::System.raw_request(:get, 'time', connection: connection_legacy)
|
|
|
160
190
|
|
|
161
191
|
## Contributing
|
|
162
192
|
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
193
|
+
|
|
194
|
+
## License
|
|
195
|
+
See [LICENSE.md](LICENSE.md)
|
data/bigcommerce.gemspec
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
$LOAD_PATH.unshift(File.expand_path('lib', __dir__))
|
|
3
4
|
require 'bigcommerce/version'
|
|
4
5
|
|
|
5
6
|
Gem::Specification.new do |s|
|
|
6
7
|
s.name = 'bigcommerce'
|
|
7
8
|
s.version = Bigcommerce::VERSION
|
|
8
9
|
s.platform = Gem::Platform::RUBY
|
|
9
|
-
s.required_ruby_version = '>= 2.
|
|
10
|
+
s.required_ruby_version = '>= 2.7.5'
|
|
10
11
|
s.license = 'MIT'
|
|
11
12
|
|
|
12
|
-
s.authors = ['
|
|
13
|
+
s.authors = ['BigCommerce Engineering']
|
|
13
14
|
s.homepage = 'https://github.com/bigcommerce/bigcommerce-api-ruby'
|
|
14
15
|
s.summary = 'Ruby client library for the BigCommerce API'
|
|
15
16
|
s.description = s.summary
|
|
17
|
+
s.metadata['rubygems_mfa_required'] = 'true'
|
|
16
18
|
|
|
17
19
|
s.require_paths = ['lib']
|
|
18
20
|
s.files = Dir['README.md', 'lib/**/*', 'bigcommerce.gemspec']
|
|
19
21
|
|
|
20
|
-
s.
|
|
21
|
-
s.
|
|
22
|
-
|
|
23
|
-
s.add_dependency '
|
|
24
|
-
s.add_dependency 'faraday_middleware', '~> 0.10.0'
|
|
25
|
-
s.add_dependency 'hashie', '~> 3.4'
|
|
22
|
+
s.add_dependency 'faraday', '~> 1.1.0'
|
|
23
|
+
s.add_dependency 'faraday_middleware', '~> 1.0'
|
|
24
|
+
s.add_dependency 'hashie', '>= 3.4', '~> 4'
|
|
25
|
+
s.add_dependency 'jwt', '>= 1.5.4', '~> 2'
|
|
26
26
|
end
|
data/lib/bigcommerce/config.rb
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Bigcommerce
|
|
2
4
|
class Config < Hashie::Mash
|
|
5
|
+
BC_API_ENDPOINT_ENV_KEY = 'BC_API_ENDPOINT'
|
|
3
6
|
DEFAULTS = {
|
|
4
7
|
base_url: 'https://api.bigcommerce.com'
|
|
5
8
|
}.freeze
|
|
6
9
|
|
|
10
|
+
##
|
|
11
|
+
# @return [String]
|
|
12
|
+
#
|
|
7
13
|
def api_url
|
|
8
14
|
return url if auth == 'legacy'
|
|
9
15
|
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
"#{base_url}/stores/#{store_hash}/v2"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
##
|
|
22
|
+
# @return [String]
|
|
23
|
+
#
|
|
24
|
+
def base_url
|
|
25
|
+
ENV[BC_API_ENDPOINT_ENV_KEY].to_s.empty? ? DEFAULTS[:base_url] : ENV.fetch(BC_API_ENDPOINT_ENV_KEY, nil)
|
|
12
26
|
end
|
|
13
27
|
end
|
|
14
28
|
end
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Bigcommerce
|
|
2
4
|
module Connection
|
|
5
|
+
LEGACY_AUTH_MODE = 'legacy'
|
|
3
6
|
HEADERS = {
|
|
4
7
|
'accept' => 'application/json',
|
|
5
8
|
'content-type' => 'application/json',
|
|
6
|
-
'user-agent' => 'bigcommerce-api-ruby'
|
|
9
|
+
'user-agent' => 'bigcommerce-api-ruby',
|
|
10
|
+
'accept-encoding' => 'gzip'
|
|
7
11
|
}.freeze
|
|
8
12
|
|
|
9
13
|
def self.build(config)
|
|
10
|
-
ssl_options = config.ssl
|
|
14
|
+
ssl_options = config.ssl || {}
|
|
11
15
|
Faraday.new(url: config.api_url, ssl: ssl_options) do |conn|
|
|
12
16
|
conn.request :json
|
|
13
17
|
conn.headers = HEADERS
|
|
14
|
-
if config.auth ==
|
|
18
|
+
if config.auth == LEGACY_AUTH_MODE
|
|
15
19
|
conn.use Faraday::Request::BasicAuthentication, config.username, config.api_key
|
|
16
20
|
else
|
|
17
21
|
conn.use Bigcommerce::Middleware::Auth, config
|
|
18
22
|
end
|
|
19
23
|
conn.use Bigcommerce::Middleware::HttpException
|
|
24
|
+
conn.use FaradayMiddleware::Gzip
|
|
20
25
|
conn.adapter Faraday.default_adapter
|
|
21
26
|
end
|
|
22
27
|
end
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Bigcommerce
|
|
2
4
|
class HttpError < StandardError
|
|
3
5
|
attr_accessor :response_headers
|
|
6
|
+
|
|
4
7
|
def initialize(headers)
|
|
5
8
|
@response_headers = headers
|
|
9
|
+
super()
|
|
6
10
|
end
|
|
7
11
|
end
|
|
8
12
|
|
|
@@ -39,19 +43,17 @@ module Bigcommerce
|
|
|
39
43
|
509 => Bigcommerce::BandwidthLimitExceeded
|
|
40
44
|
}.freeze
|
|
41
45
|
|
|
46
|
+
X_RETRY_AFTER_HEADER_KEY = 'x-retry-after'
|
|
47
|
+
|
|
42
48
|
def throw_http_exception!(code, env)
|
|
43
|
-
return unless ERRORS.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{}
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
unless env[:response_headers] && env[:response_headers]['X-Retry-After'].nil?
|
|
53
|
-
response_headers[:retry_after] = env[:response_headers]['X-Retry-After'].to_i
|
|
49
|
+
return unless ERRORS.key?(code)
|
|
50
|
+
|
|
51
|
+
response_headers = Faraday::Utils::Headers.new(env.response_headers)
|
|
52
|
+
|
|
53
|
+
unless response_headers[X_RETRY_AFTER_HEADER_KEY].nil?
|
|
54
|
+
response_headers[:retry_after] = response_headers[X_RETRY_AFTER_HEADER_KEY].to_i
|
|
54
55
|
end
|
|
56
|
+
|
|
55
57
|
raise ERRORS[code].new(response_headers), env.body
|
|
56
58
|
end
|
|
57
59
|
end
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Bigcommerce
|
|
2
4
|
module Middleware
|
|
3
5
|
class Auth < Faraday::Middleware
|
|
6
|
+
X_AUTH_CLIENT_HEADER = 'X-Auth-Client'
|
|
7
|
+
X_AUTH_TOKEN_HEADER = 'X-Auth-Token'
|
|
8
|
+
|
|
4
9
|
def initialize(app, options = {})
|
|
5
10
|
@app = app
|
|
6
11
|
@options = options
|
|
12
|
+
super(app)
|
|
7
13
|
end
|
|
8
14
|
|
|
9
15
|
def call(env)
|
|
10
|
-
env[:request_headers][
|
|
11
|
-
env[:request_headers][
|
|
16
|
+
env[:request_headers][X_AUTH_CLIENT_HEADER] = @options[:client_id]
|
|
17
|
+
env[:request_headers][X_AUTH_TOKEN_HEADER] = @options[:access_token]
|
|
12
18
|
@app.call env
|
|
13
19
|
end
|
|
14
20
|
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Bigcommerce
|
|
4
|
+
class PathBuilder
|
|
5
|
+
# @!attribute [r] uri
|
|
6
|
+
# @return [String] The URI of the path to build
|
|
7
|
+
attr_reader :uri
|
|
8
|
+
|
|
9
|
+
##
|
|
10
|
+
# @param [String] uri
|
|
11
|
+
#
|
|
12
|
+
def initialize(uri)
|
|
13
|
+
@uri = uri
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
##
|
|
17
|
+
# This takes the @uri and inserts the keys to form a path.
|
|
18
|
+
# To start we make sure that for nil/numeric values, we wrap those into an
|
|
19
|
+
# array. We then scan the string for %d and %s to find the number of times
|
|
20
|
+
# we possibly need to insert keys into the URI. Next, we check the size of
|
|
21
|
+
# the keys array, if the keys size is less than the number of possible keys
|
|
22
|
+
# in the URI, we will remove the trailing %d or %s, then remove the
|
|
23
|
+
# trailing /. We then pass the keys into the uri to form the path.
|
|
24
|
+
# ex. foo/%d/bar/%d => foo/1/bar/2
|
|
25
|
+
#
|
|
26
|
+
# @param [Array] keys
|
|
27
|
+
# @return [String]
|
|
28
|
+
#
|
|
29
|
+
def build(keys = [])
|
|
30
|
+
keys = [] if keys.nil?
|
|
31
|
+
keys = [keys] if keys.is_a? Numeric
|
|
32
|
+
ids = uri.scan('%d').count + uri.scan('%s').count
|
|
33
|
+
str = ids > keys.size ? uri.chomp('%d').chomp('%s').chomp('/') : uri
|
|
34
|
+
(str % keys).chomp('/')
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
##
|
|
38
|
+
# @return [String]
|
|
39
|
+
#
|
|
40
|
+
def to_s
|
|
41
|
+
@uri
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
data/lib/bigcommerce/request.rb
CHANGED
|
@@ -1,42 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'json'
|
|
2
4
|
|
|
3
5
|
module Bigcommerce
|
|
4
|
-
class PathBuilder
|
|
5
|
-
attr_reader :uri
|
|
6
|
-
|
|
7
|
-
def initialize(uri)
|
|
8
|
-
@uri = uri
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
# This takes the @uri and inserts the keys to form a path.
|
|
12
|
-
# To start we make sure that for nil/numeric values, we wrap those into an
|
|
13
|
-
# array. We then scan the string for %d and %s to find the number of times
|
|
14
|
-
# we possibly need to insert keys into the URI. Next, we check the size of
|
|
15
|
-
# the keys array, if the keys size is less than the number of possible keys
|
|
16
|
-
# in the URI, we will remove the trailing %d or %s, then remove the
|
|
17
|
-
# trailing /. We then pass the keys into the uri to form the path.
|
|
18
|
-
# ex. foo/%d/bar/%d => foo/1/bar/2
|
|
19
|
-
def build(keys = [])
|
|
20
|
-
keys = [] if keys.nil?
|
|
21
|
-
keys = [keys] if keys.is_a? Numeric
|
|
22
|
-
ids = uri.scan('%d').count + uri.scan('%s').count
|
|
23
|
-
str = ids > keys.size ? uri.chomp('%d').chomp('%s').chomp('/') : uri
|
|
24
|
-
(str % keys).chomp('/')
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def to_s
|
|
28
|
-
@uri
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
6
|
class Request < Module
|
|
33
7
|
def initialize(uri)
|
|
34
8
|
@uri = uri
|
|
9
|
+
super()
|
|
35
10
|
end
|
|
36
11
|
|
|
37
12
|
def included(base)
|
|
38
13
|
base.extend ClassMethods
|
|
39
|
-
path_builder = PathBuilder.new
|
|
14
|
+
path_builder = ::Bigcommerce::PathBuilder.new(@uri)
|
|
40
15
|
base.define_singleton_method :path do
|
|
41
16
|
path_builder
|
|
42
17
|
end
|
|
@@ -79,8 +54,13 @@ module Bigcommerce
|
|
|
79
54
|
end
|
|
80
55
|
end
|
|
81
56
|
|
|
57
|
+
##
|
|
58
|
+
# @return [Hash]
|
|
59
|
+
# @return [Array]
|
|
60
|
+
#
|
|
82
61
|
def parse(json)
|
|
83
62
|
return [] if json.empty?
|
|
63
|
+
|
|
84
64
|
JSON.parse(json, symbolize_names: true)
|
|
85
65
|
end
|
|
86
66
|
end
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Bigcommerce
|
|
2
4
|
class ResourceActions < Module
|
|
5
|
+
# @!attribute [r] options
|
|
6
|
+
# @return [Hash] Options passed to this module
|
|
3
7
|
attr_reader :options
|
|
4
8
|
|
|
5
9
|
def initialize(options = {})
|
|
@@ -9,6 +13,7 @@ module Bigcommerce
|
|
|
9
13
|
mod.options
|
|
10
14
|
end
|
|
11
15
|
end
|
|
16
|
+
super()
|
|
12
17
|
end
|
|
13
18
|
|
|
14
19
|
def included(base)
|
|
@@ -26,6 +31,7 @@ module Bigcommerce
|
|
|
26
31
|
|
|
27
32
|
def find(resource_id, params = {})
|
|
28
33
|
raise ArgumentError if resource_id.nil?
|
|
34
|
+
|
|
29
35
|
get path.build(resource_id), params
|
|
30
36
|
end
|
|
31
37
|
|
|
@@ -35,11 +41,13 @@ module Bigcommerce
|
|
|
35
41
|
|
|
36
42
|
def update(resource_id, params = {})
|
|
37
43
|
raise ArgumentError if resource_id.nil?
|
|
44
|
+
|
|
38
45
|
put path.build(resource_id), params
|
|
39
46
|
end
|
|
40
47
|
|
|
41
48
|
def destroy(resource_id, params = {})
|
|
42
49
|
raise ArgumentError if resource_id.nil?
|
|
50
|
+
|
|
43
51
|
delete path.build(resource_id), params
|
|
44
52
|
end
|
|
45
53
|
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'jwt'
|
|
4
|
+
require 'securerandom'
|
|
5
|
+
|
|
1
6
|
# Customer
|
|
2
7
|
# Identity and account details for customers shopping at a Bigcommerce store.
|
|
3
8
|
# https://developer.bigcommerce.com/api/stores/v2/customers
|
|
@@ -22,9 +27,27 @@ module Bigcommerce
|
|
|
22
27
|
property :notes
|
|
23
28
|
property :addresses
|
|
24
29
|
property :tax_exempt_category
|
|
30
|
+
property :accepts_marketing
|
|
25
31
|
|
|
26
32
|
def self.count(params = {})
|
|
27
33
|
get 'customers/count', params
|
|
28
34
|
end
|
|
35
|
+
|
|
36
|
+
# Generate a token that can be used to log the customer into the storefront.
|
|
37
|
+
# This requires your app to have the store_v2_customers_login scope and to
|
|
38
|
+
# be installed in the store.
|
|
39
|
+
def login_token(config: Bigcommerce.config, redirect_to: '/')
|
|
40
|
+
payload = {
|
|
41
|
+
'iss' => config.client_id,
|
|
42
|
+
'iat' => Time.now.to_i,
|
|
43
|
+
'jti' => SecureRandom.uuid,
|
|
44
|
+
'operation' => 'customer_login',
|
|
45
|
+
'store_hash' => config.store_hash,
|
|
46
|
+
'customer_id' => id,
|
|
47
|
+
'redirect_to' => redirect_to
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
JWT.encode(payload, config.client_secret, 'HS256', { typ: 'JWT' })
|
|
51
|
+
end
|
|
29
52
|
end
|
|
30
53
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Country
|
|
2
4
|
# Countries and territories, identified by their ISO 3166 country codes.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/countries
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class Country < Resource
|
|
7
9
|
include Bigcommerce::ResourceActions.new(
|
|
8
10
|
uri: 'countries/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update destroy destroy_all]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# State
|
|
2
4
|
# States and subdivisions belonging to countries.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/countries/states
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class State < Resource
|
|
7
9
|
include Bigcommerce::SubresourceActions.new(
|
|
8
10
|
uri: 'countries/%d/states/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update destroy destroy_all]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Order
|
|
2
4
|
# Purchases from a store.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/orders
|
|
@@ -67,6 +69,14 @@ module Bigcommerce
|
|
|
67
69
|
property :shipping_cost_tax_class_id
|
|
68
70
|
property :wrapping_cost_tax_class_id
|
|
69
71
|
property :count
|
|
72
|
+
property :cart_id
|
|
73
|
+
property :channel_id
|
|
74
|
+
property :custom_status
|
|
75
|
+
property :external_id
|
|
76
|
+
property :external_merchant_id
|
|
77
|
+
property :store_default_currency_code
|
|
78
|
+
property :store_default_to_transactional_exchange_rate
|
|
79
|
+
property :tax_provider_id
|
|
70
80
|
|
|
71
81
|
def self.count(params = {})
|
|
72
82
|
get 'orders/count', params
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Order Coupon
|
|
2
4
|
# Coupons applied to an order.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/orders/coupons
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class OrderCoupon < Resource
|
|
7
9
|
include Bigcommerce::SubresourceActions.new(
|
|
8
10
|
uri: 'orders/%d/coupons/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update destroy destroy_all]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Order Message
|
|
2
4
|
# Messages associated with an order.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/orders/messages
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class OrderMessage < Resource
|
|
7
9
|
include Bigcommerce::SubresourceActions.new(
|
|
8
10
|
uri: 'orders/%d/messages/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update destroy destroy_all]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Order Product
|
|
2
4
|
# Product line items associated with an order.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/orders/products
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class OrderProduct < Resource
|
|
7
9
|
include Bigcommerce::SubresourceActions.new(
|
|
8
10
|
uri: 'orders/%d/products/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update destroy destroy_all]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Order Shipping Addresses
|
|
2
4
|
# Shipping addresses associated with an order.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/orders/shipping_addresses
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class OrderShippingAddress < Resource
|
|
7
9
|
include Bigcommerce::SubresourceActions.new(
|
|
8
10
|
uri: 'orders/%d/shipping_addresses/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update destroy destroy_all]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Order Status
|
|
2
4
|
# Statuses that can be assigned to orders. Each status represents a state in
|
|
3
5
|
# the fulfilment workflow.
|
|
@@ -7,7 +9,7 @@ module Bigcommerce
|
|
|
7
9
|
class OrderStatus < Resource
|
|
8
10
|
include Bigcommerce::ResourceActions.new(
|
|
9
11
|
uri: 'order_statuses/%d',
|
|
10
|
-
disable: [
|
|
12
|
+
disable: %i[create update destroy destroy_all]
|
|
11
13
|
)
|
|
12
14
|
|
|
13
15
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Order Shipping Addresses
|
|
2
4
|
# Shipping addresses associated with an order.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/orders/shipping_addresses
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class OrderTax < Resource
|
|
7
9
|
include Bigcommerce::SubresourceActions.new(
|
|
8
10
|
uri: 'orders/%d/taxes/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update destroy destroy_all]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Configurable Field
|
|
2
4
|
# Configurable fields associated with a product.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/products/configurable_fields
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class ConfigurableField < Resource
|
|
7
9
|
include Bigcommerce::SubresourceActions.new(
|
|
8
10
|
uri: 'products/%d/configurable_fields/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Product Option
|
|
2
4
|
# Options associated directly with a product.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/products/options
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class ProductOption < Resource
|
|
7
9
|
include Bigcommerce::SubresourceActions.new(
|
|
8
10
|
uri: 'products/%d/options/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update destroy destroy_all]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Shipping Method
|
|
2
4
|
# List of enabled shipping methods.
|
|
3
5
|
# https://developer.bigcommerce.com/api/stores/v2/shipping/methods
|
|
@@ -6,7 +8,7 @@ module Bigcommerce
|
|
|
6
8
|
class ShippingMethod < Resource
|
|
7
9
|
include Bigcommerce::ResourceActions.new(
|
|
8
10
|
uri: 'shipping/methods/%d',
|
|
9
|
-
disable: [
|
|
11
|
+
disable: %i[create update destroy destroy_all]
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Tax Class
|
|
2
4
|
# Tax classes are used to apply different tax rates for specific types
|
|
3
5
|
# of products and orders.
|
|
@@ -7,7 +9,7 @@ module Bigcommerce
|
|
|
7
9
|
class TaxClass < Resource
|
|
8
10
|
include Bigcommerce::ResourceActions.new(
|
|
9
11
|
uri: 'tax_classes/%d',
|
|
10
|
-
disable: [
|
|
12
|
+
disable: %i[create update destroy destroy_all]
|
|
11
13
|
)
|
|
12
14
|
|
|
13
15
|
property :id
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Bigcommerce
|
|
2
4
|
class SubresourceActions < ResourceActions
|
|
3
5
|
def included(base)
|
|
@@ -11,31 +13,37 @@ module Bigcommerce
|
|
|
11
13
|
module ClassMethods
|
|
12
14
|
def all(parent_id, params = {})
|
|
13
15
|
raise ArgumentError if parent_id.nil?
|
|
16
|
+
|
|
14
17
|
get path.build(parent_id), params
|
|
15
18
|
end
|
|
16
19
|
|
|
17
20
|
def find(parent_id, resource_id, params = {})
|
|
18
21
|
raise ArgumentError if [parent_id, resource_id].any?(&:nil?)
|
|
22
|
+
|
|
19
23
|
get path.build([parent_id, resource_id]), params
|
|
20
24
|
end
|
|
21
25
|
|
|
22
26
|
def create(parent_id, params = {})
|
|
23
27
|
raise ArgumentError if parent_id.nil?
|
|
28
|
+
|
|
24
29
|
post path.build(parent_id), params
|
|
25
30
|
end
|
|
26
31
|
|
|
27
32
|
def update(parent_id, resource_id, params = {})
|
|
28
33
|
raise ArgumentError if [parent_id, resource_id].any?(&:nil?)
|
|
34
|
+
|
|
29
35
|
put path.build([parent_id, resource_id]), params
|
|
30
36
|
end
|
|
31
37
|
|
|
32
38
|
def destroy(parent_id, resource_id, params = {})
|
|
33
39
|
raise ArgumentError if [parent_id, resource_id].any?(&:nil?)
|
|
40
|
+
|
|
34
41
|
delete path.build([parent_id, resource_id]), params
|
|
35
42
|
end
|
|
36
43
|
|
|
37
44
|
def destroy_all(parent_id, params = {})
|
|
38
45
|
raise ArgumentError if parent_id.nil?
|
|
46
|
+
|
|
39
47
|
delete path.build(parent_id), params
|
|
40
48
|
end
|
|
41
49
|
end
|
data/lib/bigcommerce/version.rb
CHANGED
data/lib/bigcommerce.rb
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'hashie'
|
|
2
4
|
require 'faraday_middleware'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
require_relative 'bigcommerce/version'
|
|
6
|
+
require_relative 'bigcommerce/config'
|
|
7
|
+
require_relative 'bigcommerce/connection'
|
|
8
|
+
require_relative 'bigcommerce/path_builder'
|
|
9
|
+
require_relative 'bigcommerce/middleware/auth'
|
|
10
|
+
require_relative 'bigcommerce/middleware/http_exception'
|
|
11
|
+
require_relative 'bigcommerce/resources/resource'
|
|
9
12
|
|
|
10
13
|
module Bigcommerce
|
|
11
14
|
resources = File.join(File.dirname(__FILE__), 'bigcommerce', 'resources', '**', '*.rb')
|
|
12
|
-
Dir.glob(resources
|
|
15
|
+
Dir.glob(resources).sort.each { |r| require r }
|
|
13
16
|
|
|
14
17
|
class << self
|
|
18
|
+
# @!attribute [r] api
|
|
19
|
+
# @return [::Faraday::Connection]
|
|
15
20
|
attr_reader :api
|
|
21
|
+
# @!attribute [r] config
|
|
22
|
+
# @return [::Bigcommerce::Config]
|
|
23
|
+
attr_reader :config
|
|
16
24
|
|
|
17
|
-
def configure
|
|
18
|
-
@config = Bigcommerce::Config.new.tap
|
|
25
|
+
def configure(&block)
|
|
26
|
+
@config = Bigcommerce::Config.new.tap(&block)
|
|
19
27
|
@api = Bigcommerce::Connection.build(@config)
|
|
20
28
|
end
|
|
21
29
|
end
|
metadata
CHANGED
|
@@ -1,87 +1,83 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bigcommerce
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
autorequire:
|
|
7
|
+
- BigCommerce Engineering
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - ">="
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - ">="
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: rake
|
|
13
|
+
name: faraday
|
|
29
14
|
requirement: !ruby/object:Gem::Requirement
|
|
30
15
|
requirements:
|
|
31
|
-
- - "
|
|
16
|
+
- - "~>"
|
|
32
17
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
34
|
-
type: :
|
|
18
|
+
version: 1.1.0
|
|
19
|
+
type: :runtime
|
|
35
20
|
prerelease: false
|
|
36
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
22
|
requirements:
|
|
38
|
-
- - "
|
|
23
|
+
- - "~>"
|
|
39
24
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
25
|
+
version: 1.1.0
|
|
41
26
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
27
|
+
name: faraday_middleware
|
|
43
28
|
requirement: !ruby/object:Gem::Requirement
|
|
44
29
|
requirements:
|
|
45
30
|
- - "~>"
|
|
46
31
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '0
|
|
32
|
+
version: '1.0'
|
|
48
33
|
type: :runtime
|
|
49
34
|
prerelease: false
|
|
50
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
36
|
requirements:
|
|
52
37
|
- - "~>"
|
|
53
38
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '0
|
|
39
|
+
version: '1.0'
|
|
55
40
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
41
|
+
name: hashie
|
|
57
42
|
requirement: !ruby/object:Gem::Requirement
|
|
58
43
|
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '3.4'
|
|
59
47
|
- - "~>"
|
|
60
48
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
49
|
+
version: '4'
|
|
62
50
|
type: :runtime
|
|
63
51
|
prerelease: false
|
|
64
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
53
|
requirements:
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: '3.4'
|
|
66
57
|
- - "~>"
|
|
67
58
|
- !ruby/object:Gem::Version
|
|
68
|
-
version:
|
|
59
|
+
version: '4'
|
|
69
60
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
61
|
+
name: jwt
|
|
71
62
|
requirement: !ruby/object:Gem::Requirement
|
|
72
63
|
requirements:
|
|
64
|
+
- - ">="
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: 1.5.4
|
|
73
67
|
- - "~>"
|
|
74
68
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
69
|
+
version: '2'
|
|
76
70
|
type: :runtime
|
|
77
71
|
prerelease: false
|
|
78
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
73
|
requirements:
|
|
74
|
+
- - ">="
|
|
75
|
+
- !ruby/object:Gem::Version
|
|
76
|
+
version: 1.5.4
|
|
80
77
|
- - "~>"
|
|
81
78
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '
|
|
79
|
+
version: '2'
|
|
83
80
|
description: Ruby client library for the BigCommerce API
|
|
84
|
-
email:
|
|
85
81
|
executables: []
|
|
86
82
|
extensions: []
|
|
87
83
|
extra_rdoc_files: []
|
|
@@ -94,6 +90,7 @@ files:
|
|
|
94
90
|
- lib/bigcommerce/exception.rb
|
|
95
91
|
- lib/bigcommerce/middleware/auth.rb
|
|
96
92
|
- lib/bigcommerce/middleware/http_exception.rb
|
|
93
|
+
- lib/bigcommerce/path_builder.rb
|
|
97
94
|
- lib/bigcommerce/request.rb
|
|
98
95
|
- lib/bigcommerce/resource_actions.rb
|
|
99
96
|
- lib/bigcommerce/resources/content/blog_post.rb
|
|
@@ -144,8 +141,8 @@ files:
|
|
|
144
141
|
homepage: https://github.com/bigcommerce/bigcommerce-api-ruby
|
|
145
142
|
licenses:
|
|
146
143
|
- MIT
|
|
147
|
-
metadata:
|
|
148
|
-
|
|
144
|
+
metadata:
|
|
145
|
+
rubygems_mfa_required: 'true'
|
|
149
146
|
rdoc_options: []
|
|
150
147
|
require_paths:
|
|
151
148
|
- lib
|
|
@@ -153,16 +150,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
153
150
|
requirements:
|
|
154
151
|
- - ">="
|
|
155
152
|
- !ruby/object:Gem::Version
|
|
156
|
-
version: 2.
|
|
153
|
+
version: 2.7.5
|
|
157
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
155
|
requirements:
|
|
159
156
|
- - ">="
|
|
160
157
|
- !ruby/object:Gem::Version
|
|
161
158
|
version: '0'
|
|
162
159
|
requirements: []
|
|
163
|
-
|
|
164
|
-
rubygems_version: 2.4.5.1
|
|
165
|
-
signing_key:
|
|
160
|
+
rubygems_version: 3.6.9
|
|
166
161
|
specification_version: 4
|
|
167
162
|
summary: Ruby client library for the BigCommerce API
|
|
168
163
|
test_files: []
|