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.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +54 -21
  3. data/bigcommerce.gemspec +10 -10
  4. data/lib/bigcommerce/config.rb +16 -2
  5. data/lib/bigcommerce/connection.rb +8 -3
  6. data/lib/bigcommerce/exception.rb +13 -11
  7. data/lib/bigcommerce/middleware/auth.rb +8 -2
  8. data/lib/bigcommerce/middleware/http_exception.rb +2 -0
  9. data/lib/bigcommerce/path_builder.rb +44 -0
  10. data/lib/bigcommerce/request.rb +9 -29
  11. data/lib/bigcommerce/resource_actions.rb +8 -0
  12. data/lib/bigcommerce/resources/content/blog_post.rb +2 -0
  13. data/lib/bigcommerce/resources/content/blog_tag.rb +2 -0
  14. data/lib/bigcommerce/resources/content/redirect.rb +2 -0
  15. data/lib/bigcommerce/resources/customers/customer.rb +23 -0
  16. data/lib/bigcommerce/resources/customers/customer_address.rb +2 -0
  17. data/lib/bigcommerce/resources/customers/customer_group.rb +2 -0
  18. data/lib/bigcommerce/resources/geography/country.rb +3 -1
  19. data/lib/bigcommerce/resources/geography/state.rb +3 -1
  20. data/lib/bigcommerce/resources/marketing/banner.rb +2 -0
  21. data/lib/bigcommerce/resources/marketing/coupon.rb +2 -0
  22. data/lib/bigcommerce/resources/marketing/gift_certificates.rb +2 -0
  23. data/lib/bigcommerce/resources/orders/order.rb +10 -0
  24. data/lib/bigcommerce/resources/orders/order_coupon.rb +3 -1
  25. data/lib/bigcommerce/resources/orders/order_message.rb +3 -1
  26. data/lib/bigcommerce/resources/orders/order_product.rb +3 -1
  27. data/lib/bigcommerce/resources/orders/order_shipping_address.rb +3 -1
  28. data/lib/bigcommerce/resources/orders/order_status.rb +3 -1
  29. data/lib/bigcommerce/resources/orders/order_tax.rb +3 -1
  30. data/lib/bigcommerce/resources/orders/shipment.rb +2 -0
  31. data/lib/bigcommerce/resources/payments/payment_method.rb +2 -0
  32. data/lib/bigcommerce/resources/products/brand.rb +2 -0
  33. data/lib/bigcommerce/resources/products/bulk_pricing_rule.rb +2 -0
  34. data/lib/bigcommerce/resources/products/category.rb +2 -0
  35. data/lib/bigcommerce/resources/products/configurable_field.rb +3 -1
  36. data/lib/bigcommerce/resources/products/custom_field.rb +2 -0
  37. data/lib/bigcommerce/resources/products/google_product_search_mapping.rb +2 -0
  38. data/lib/bigcommerce/resources/products/option.rb +2 -0
  39. data/lib/bigcommerce/resources/products/option_set.rb +2 -0
  40. data/lib/bigcommerce/resources/products/option_set_option.rb +2 -0
  41. data/lib/bigcommerce/resources/products/option_value.rb +2 -0
  42. data/lib/bigcommerce/resources/products/product.rb +2 -0
  43. data/lib/bigcommerce/resources/products/product_image.rb +2 -0
  44. data/lib/bigcommerce/resources/products/product_option.rb +3 -1
  45. data/lib/bigcommerce/resources/products/product_review.rb +2 -0
  46. data/lib/bigcommerce/resources/products/product_rule.rb +2 -0
  47. data/lib/bigcommerce/resources/products/product_video.rb +2 -0
  48. data/lib/bigcommerce/resources/products/sku.rb +2 -0
  49. data/lib/bigcommerce/resources/resource.rb +2 -0
  50. data/lib/bigcommerce/resources/shipping/shipping_method.rb +3 -1
  51. data/lib/bigcommerce/resources/store/store_information.rb +2 -0
  52. data/lib/bigcommerce/resources/system/time.rb +2 -0
  53. data/lib/bigcommerce/resources/tax/tax_class.rb +3 -1
  54. data/lib/bigcommerce/resources/webhooks/webhook.rb +2 -0
  55. data/lib/bigcommerce/subresource_actions.rb +8 -0
  56. data/lib/bigcommerce/version.rb +3 -1
  57. data/lib/bigcommerce.rb +17 -9
  58. metadata +35 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 699fc230ea09d9242c9cbfb7e1d2183891127627
4
- data.tar.gz: 94e9e4eeb4a9b8cdf53ff2bd26f78612d8457d25
2
+ SHA256:
3
+ metadata.gz: 91c155920d961947d4e7a2184fa2ffad660590d636bd70723d9eec87d4709f3b
4
+ data.tar.gz: dc8618135e2e88f8b2fa39954179d24ff56f435fa50185f4dd85baceb11684ef
5
5
  SHA512:
6
- metadata.gz: 131581aaa53a9933c978f7649530128857e7a46e467c091b77effc27828ca895388bc78edfdd0cf5bb58bb14f8041a55417b90f52af98aab82480c3748563cc0
7
- data.tar.gz: 88d65c0fa84ad4d4968e58b7780eaac14408d5ad123eafe1c1b158c04822ade1007cbf3c460c95235765efdb548baa0c34a4778b9a60283b8f45c4efa07479a1
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
  [![Gem Version](https://badge.fury.io/rb/bigcommerce.svg)](https://rubygems.org/gems/bigcommerce)
4
- [![Build Status](https://travis-ci.org/bigcommerce/bigcommerce-api-ruby.svg?branch=master)](https://travis-ci.org/bigcommerce/bigcommerce-api-ruby)
5
- [![Dependency Status](https://gemnasium.com/bigcommerce/bigcommerce-api-ruby.svg?travis)](https://gemnasium.com/bigcommerce/bigcommerce-api-ruby)
4
+ [![CircleCI](https://circleci.com/gh/bigcommerce/bigcommerce-api-ruby/tree/master.svg?style=svg)](https://circleci.com/gh/bigcommerce/bigcommerce-api-ruby/tree/master)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/d1ba1b74a2a74a26e8b4/test_coverage)](https://codeclimate.com/github/bigcommerce/bigcommerce-api-ruby/test_coverage)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/d1ba1b74a2a74a26e8b4/maintainability)](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 BigCommerce developer here: [developer.bigcommerce.com](http://developer.bigcommerce.com).
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.0'
22
+ gem 'bigcommerce', '~> 1.0'
21
23
  ```
22
24
 
23
25
  ## Requirements
24
- - Ruby 2.0.0 or newer. Please refer to the `.travis.yml` to see which versions we officially support.
26
+
27
+ - Ruby 2.7.5 or newer (Ruby 3.0+ is preferred)
25
28
 
26
29
  ## Getting Started
27
- In order to make requests to our API, you must register as a developer and have your credentials ready.
30
+ To make requests to our API, you must register as a developer and have your credentials ready.
28
31
 
29
- Its also very important to note that for the OAuth authentication mechanism, the resources you have acccess to depend on the scopes which your application has been granted by the merchant. For more information about the Store API scopes, see: [OAuth Scopes](https://developer.bigcommerce.com/api/scopes).
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 use depending on your use case.
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 it in their BigCommerce store.
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
- In order to authenticate the API client, you will need to configure the client like the following.
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 "My Apps" section on the [developer portal](http://developer.bigcommerce.com).
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 `Advanced Settings > Legacy API Settings`. Once there, you can create a new legacy api account to authenticate with.
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 may be useful in special edge cases.
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 on using the API client, please see the [examples folder](examples) and refer to the [developer documentation](https://developer.bigcommerce.com/api).
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 safe. This mechanism is designed for applications or cli where thread safety is not a concern. If you need to guarantee thread safety, we support another mechanism to make threadsafe API requests.
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, you will want to construct a new connection for each thread. If you can make sure that each of these connections is stored in a thread safe manner, you can pass the `connection` as you query the resource.
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 adapers, you can feel free. Please refer to the [connection class](https://github.com/bigcommerce/bigcommerce-api-ruby/blob/master/lib/bigcommerce/connection.rb) for more details.
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
- lib = File.expand_path('../lib', __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
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.0.0'
10
+ s.required_ruby_version = '>= 2.7.5'
10
11
  s.license = 'MIT'
11
12
 
12
- s.authors = ['Patrick Edelman']
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.add_development_dependency 'bundler'
21
- s.add_development_dependency 'rake'
22
-
23
- s.add_dependency 'faraday', '~> 0.9'
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
@@ -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
- base = ENV['BC_API_ENDPOINT'].to_s.empty? ? DEFAULTS[:base_url] : ENV['BC_API_ENDPOINT']
11
- "#{base}/stores/#{store_hash}/v2"
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 if config.auth == 'legacy'
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 == 'legacy'
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.keys.include? code
44
- response_headers = {}
45
- unless env.body.empty?
46
- response_headers = begin
47
- JSON.parse(env.body, symbolize_names: true)
48
- rescue
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]['X-Auth-Client'] = @options[:client_id]
11
- env[:request_headers]['X-Auth-Token'] = @options[:access_token]
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bigcommerce/exception'
2
4
 
3
5
  module Bigcommerce
@@ -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
@@ -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 @uri
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,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Blog Post
2
4
  # Content entries in the store's blog.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/blog/posts
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Blog Tag
2
4
  # Index of tags used on the store's blog.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/blog/tags
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Redirect
2
4
  # Redirects are used to create custom URL paths that map to resources on the
3
5
  # storefront (such as products, categories, brands, etc.) or manually defined
@@ -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
  # Customer Address
2
4
  # Postal addresses belonging to a customer.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/customers/addresses
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Customer Group
2
4
  # Groups of customers who share the same level of access and discounts
3
5
  # at a store.
@@ -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: [:create, :update, :destroy, :destroy_all]
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: [:create, :update, :destroy, :destroy_all]
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
  # Banner
2
4
  # HTML element on webpages to advertise discounts or other content relevant to shoppers.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/banners
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Coupon
2
4
  # Category or product discounts that can be applied to orders for customers
3
5
  # who enter a given code.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Gift Certificates
2
4
  # Code that can be applied by customers to their order to provide full or partial payment.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/gift_certificates
@@ -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: [:create, :update, :destroy, :destroy_all]
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: [:create, :update, :destroy, :destroy_all]
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: [:create, :update, :destroy, :destroy_all]
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: [:create, :update, :destroy, :destroy_all]
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: [:create, :update, :destroy, :destroy_all]
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: [:create, :update, :destroy, :destroy_all]
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 Shipment
2
4
  # Shipping package consignments tracked from an order.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/orders/shipments
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Payment Method
2
4
  # Enabled payment methods.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/payments/methods
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Brand
2
4
  # Brand facets for identifying and categorising products according
3
5
  # to their manufacturer or company metonym.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Bulk Pricing Rule
2
4
  # Bulk pricing rules applied to a product.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/products/discount_rules
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Category
2
4
  # Index of hierarchical categories used to organise and group products.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/categories
@@ -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: [:create, :update]
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
  # Custom Field
2
4
  # Custom fields associated with a product.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/products/custom_fields
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Google Product Search Mapping
2
4
  # Google Product Search mappings for a product.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/products/googleproductsearch
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Option
2
4
  # Shared attributes that control value facets on a product.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/options
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Option Set
2
4
  # A reusable set of option facets that can be applied to products.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/options_sets
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Option Set Option
2
4
  # Options belonging to an option set.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/option_sets/options
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Option Value
2
4
  # Values that can be selected for an option.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/options/values
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Product
2
4
  # Catalog of saleable items in the store.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/products
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Product Image
2
4
  # Images associated with a product.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/products/images
@@ -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: [:create, :update, :destroy, :destroy_all]
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
  # Product Review
2
4
  # Options associated directly with a product.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/products/reviews
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Product Rule
2
4
  # Rules that modify the default behaviour of products.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/products/rules
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Product Video
2
4
  # Embedded videos displayed on product listings.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/products/videos
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # SKU
2
4
  # Stock Keeping Unit identifiers associated with products.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/products/skus
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bigcommerce/request'
2
4
  require 'bigcommerce/resource_actions'
3
5
  require 'bigcommerce/subresource_actions'
@@ -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: [:create, :update, :destroy, :destroy_all]
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
  # Store Information
2
4
  # Metadata that describes the store.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/store_information
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Time
2
4
  # Timestamp ping to check the system status.
3
5
  # https://developer.bigcommerce.com/api/stores/v2/time
@@ -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: [:create, :update, :destroy, :destroy_all]
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
  # Webhook
2
4
  # Register and manage webhooks that connect events from a store to
3
5
  # external URLs.
@@ -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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bigcommerce
2
- VERSION = '1.0.0'.freeze
4
+ VERSION = '1.1.0'
3
5
  end
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
- require 'bigcommerce/version'
4
- require 'bigcommerce/config'
5
- require 'bigcommerce/connection'
6
- require 'bigcommerce/middleware/auth'
7
- require 'bigcommerce/middleware/http_exception'
8
- require 'bigcommerce/resources/resource'
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, &method(:require))
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 { |h| yield(h) }
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.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Patrick Edelman
8
- autorequire:
7
+ - BigCommerce Engineering
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2016-06-24 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: bundler
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: '0'
34
- type: :development
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: '0'
25
+ version: 1.1.0
41
26
  - !ruby/object:Gem::Dependency
42
- name: faraday
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.9'
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.9'
39
+ version: '1.0'
55
40
  - !ruby/object:Gem::Dependency
56
- name: faraday_middleware
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: 0.10.0
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: 0.10.0
59
+ version: '4'
69
60
  - !ruby/object:Gem::Dependency
70
- name: hashie
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: '3.4'
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: '3.4'
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
- post_install_message:
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.0.0
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
- rubyforge_project:
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: []