beyond_api 0.16.1.pre → 0.17.0.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e21d3e55d80fdab110e763b80945554aaa37db10d9cd1d6420e1048992990442
4
- data.tar.gz: abfb64188b9e2b04a223b7cbc839eec16b2f6307ecccf0a8c6b484ab55259231
3
+ metadata.gz: 121cdb5fc26eaefb6eb20ccad546c70508ed15517e159227b973ab95333ec30f
4
+ data.tar.gz: 42bc3c28f1696e588c2ed9cd405e32ddee90b2d716299d9354773f70b18613dd
5
5
  SHA512:
6
- metadata.gz: 9a51c07ca44a5f137e8c2cea3e3249e607323ec9a58a661895d4541ccd573d234c72fae261632341e8e44077a8eca1f34e0748cad693961e4195e0c6b881089a
7
- data.tar.gz: 64b13f1fa84d4292c6f414071dd64beed61acddcefff7c8aa952cc089e53bf519d8823e7ad9ebf98cfb779fb60855411c603c435b07a5c74caa07a9a243a3ac3
6
+ metadata.gz: fbd457331b5d3939a81590f983eb27e2c0ef754f8d4f5cb75c25299d4fd0db0f0c206766463f3918542ef74c3db652a7f5a2b61c677addb63071091c0ed8a397
7
+ data.tar.gz: 659cc4f40f38f5f36c4c0ab476720cb1a1fc7ef1a6d518b7f0d5f71d8ad3219983e8304c07c5ad8c28d20d0baa2d0225ffe0c6b8324f575f43b0f14fbc3bffb0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### v0.17.0.pre
2
+
3
+ * enhancements
4
+ * Add customizable pagination size when sending `paginated: false` parameter to `#all` requests.
5
+
1
6
  ### v0.16.1.pre
2
7
 
3
8
  * bug-fixes
@@ -26,7 +31,7 @@
26
31
 
27
32
  * features
28
33
  * Add `Products#assign_variation_attribute_as_differentiator`
29
-
34
+
30
35
  ### v0.13.0.pre
31
36
 
32
37
  * features
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- beyond_api (0.16.1.pre)
4
+ beyond_api (0.17.0.pre)
5
5
  faraday (~> 0.15)
6
6
 
7
7
  GEM
data/beyond_api.gemspec CHANGED
@@ -6,7 +6,7 @@ require "beyond_api/version"
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "beyond_api"
8
8
  spec.version = BeyondApi::VERSION
9
- spec.authors = ["Unai Abrisketa", "Kathia Salazar", "German San Emeterio"]
9
+ spec.authors = ["Unai Abrisketa", "Kathia Salazar", "German San Emeterio", "Kenneth Gallego"]
10
10
 
11
11
  spec.summary = "Ruby client to access the Beyond API"
12
12
  spec.homepage = "https://github.com/ePages-de/beyond_api-ruby_client"
data/lib/beyond_api.rb CHANGED
@@ -27,7 +27,7 @@ module BeyondApi
27
27
  class Configuration
28
28
  attr_accessor :client_id, :client_secret, :open_timeout, :timeout, :remove_response_links,
29
29
  :remove_response_key_underscores, :object_struct_responses, :raise_error_requests,
30
- :log_headers, :log_bodies, :log_level
30
+ :log_headers, :log_bodies, :log_level, :all_pagination_size
31
31
 
32
32
  def initialize
33
33
  @client_id = nil
@@ -42,6 +42,8 @@ module BeyondApi
42
42
  @log_level = :info
43
43
  @log_headers = false
44
44
  @log_bodies = false
45
+
46
+ @all_pagination_size = 200
45
47
  end
46
48
  end
47
49
  end
@@ -45,12 +45,13 @@ module BeyondApi
45
45
  end
46
46
 
47
47
  def handle_all_request(url, resource, params = {})
48
+ paginated_size = BeyondApi.configuration.all_pagination_size
48
49
 
49
50
  if params[:paginated] == false
50
- result = all_paginated(url, params.merge(page: 0, size: 1000))
51
+ result = all_paginated(url, params.merge(page: 0, size: paginated_size))
51
52
 
52
53
  (1..result[:page][:total_pages] - 1).each do |page|
53
- result[:embedded][resource].concat(all_paginated(url, params.merge(page: page, size: 1000))[:embedded][resource])
54
+ result[:embedded][resource].concat(all_paginated(url, params.merge(page: page, size: paginated_size))[:embedded][resource])
54
55
  end
55
56
 
56
57
  result[:page][:size] = result[:page][:total_elements]
@@ -1,3 +1,3 @@
1
1
  module BeyondApi
2
- VERSION = "0.16.1.pre".freeze
2
+ VERSION = "0.17.0.pre".freeze
3
3
  end
@@ -12,6 +12,9 @@ BeyondApi.setup do |config|
12
12
  # Configure the request timeout in seconds. Default is 5 seconds.
13
13
  # config.timeout = 5.seconds
14
14
 
15
+ # Configure the pagination size when `paginated: false` is sent on `.all()` requests. Value must be between 1 and 1000.
16
+ # config.all_pagination_size = 200
17
+
15
18
  # ==> Log configuration
16
19
 
17
20
  # Configure the log level. Must be one of :debug, :info, :warn, :error,
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1.pre
4
+ version: 0.17.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
8
8
  - Kathia Salazar
9
9
  - German San Emeterio
10
- autorequire:
10
+ - Kenneth Gallego
11
+ autorequire:
11
12
  bindir: exe
12
13
  cert_chain: []
13
- date: 2021-07-16 00:00:00.000000000 Z
14
+ date: 2021-08-12 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: bundler
@@ -110,8 +111,8 @@ dependencies:
110
111
  - - "~>"
111
112
  - !ruby/object:Gem::Version
112
113
  version: '0.15'
113
- description:
114
- email:
114
+ description:
115
+ email:
115
116
  executables: []
116
117
  extensions: []
117
118
  extra_rdoc_files: []
@@ -183,7 +184,7 @@ files:
183
184
  homepage: https://github.com/ePages-de/beyond_api-ruby_client
184
185
  licenses: []
185
186
  metadata: {}
186
- post_install_message:
187
+ post_install_message:
187
188
  rdoc_options: []
188
189
  require_paths:
189
190
  - lib
@@ -198,8 +199,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
199
  - !ruby/object:Gem::Version
199
200
  version: 1.3.1
200
201
  requirements: []
201
- rubygems_version: 3.0.3
202
- signing_key:
202
+ rubygems_version: 3.1.2
203
+ signing_key:
203
204
  specification_version: 4
204
205
  summary: Ruby client to access the Beyond API
205
206
  test_files: []