algolia 3.10.1 → 3.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f82021f2d31e75f1397a47f600dff3afd13a8a56abf48cb7262f4ec310e3b5d
4
- data.tar.gz: 17579ca61f3d73d5966c80c70d7013e3881194eff166c3935c6c69f929bce150
3
+ metadata.gz: cd4fd82006d6c1d476f2a5990f20e71863de4daab0b1d34e8ed60f73db4863e8
4
+ data.tar.gz: f35d07b8971f883cefde61736b1e5e083ab100668b6cc52c721767ed70c8033a
5
5
  SHA512:
6
- metadata.gz: d47e0f3298ab4b2147630956290d964698b257f64a826442dfa45dcc8acff56f521cf37225a34acaad75621a70262086614a093723209897694842b27c96ed98
7
- data.tar.gz: 23cac9419c2d97abafccacfa181ec386e068b9330cc367185259dcdb644536139e12161d742e59104460cc16816807525c13c0af8a35f9dc70c1f6df16fdfd05
6
+ metadata.gz: 31d4c9f1d4cc7c4dc5b837f023b20dd1d6fbbb34397dd2bdb58519630af04e3189350d400b68fdca4b415d963615038ee61804f6093a45b7b93c5ef425eaaec4
7
+ data.tar.gz: 3294d75374a89dadde273ddaffb85c97509134a416eb145a9cdd054792ff94df08e0f393b2c9db15f419346208ca5b338ea3c75d341b8659bda2b0aaf66abbb8
@@ -1,7 +1,7 @@
1
1
  name: Do not edit files in this repository
2
2
 
3
3
  on:
4
- pull_request:
4
+ pull_request_target:
5
5
  types:
6
6
  - opened
7
7
  - synchronize
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.10.2](https://github.com/algolia/algoliasearch-client-ruby/compare/3.10.1...3.10.2)
2
+
3
+ - [0481473fe0](https://github.com/algolia/api-clients-automation/commit/0481473fe0) chore: trigger auto close pr ([#4250](https://github.com/algolia/api-clients-automation/pull/4250)) by [@shortcuts](https://github.com/shortcuts/)
4
+ - [2856fa34a3](https://github.com/algolia/api-clients-automation/commit/2856fa34a3) fix(ruby): Set default hits_per_page for SearchClient#browse_objects using accessor ([#4253](https://github.com/algolia/api-clients-automation/pull/4253)) by [@dtyoung](https://github.com/dtyoung/)
5
+ - [bc8939f542](https://github.com/algolia/api-clients-automation/commit/bc8939f542) fix(clients): support dict in helpers ([#4254](https://github.com/algolia/api-clients-automation/pull/4254)) by [@shortcuts](https://github.com/shortcuts/)
6
+ - [679a8cdb60](https://github.com/algolia/api-clients-automation/commit/679a8cdb60) fix(specs): endpoint level timeout for ingestion ([#4251](https://github.com/algolia/api-clients-automation/pull/4251)) by [@shortcuts](https://github.com/shortcuts/)
7
+
1
8
  ## [3.10.1](https://github.com/algolia/algoliasearch-client-ruby/compare/3.10.0...3.10.1)
2
9
 
3
10
  - [6fb57f9ba](https://github.com/algolia/api-clients-automation/commit/6fb57f9ba) fix(clients): lock version ([#4228](https://github.com/algolia/api-clients-automation/pull/4228)) by [@millotp](https://github.com/millotp/)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- algolia (3.10.1)
4
+ algolia (3.10.2)
5
5
  base64 (>= 0.2.0, < 1)
6
6
  faraday (>= 1.0.1, < 3.0)
7
7
  faraday-net_http_persistent (>= 0.15, < 3)
@@ -2151,6 +2151,7 @@ module Algolia
2151
2151
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2152
2152
  header_params = {}
2153
2153
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2154
+ request_options[:timeout] ||= 180000
2154
2155
 
2155
2156
  post_body = request_options[:debug_body] || @api_client.object_to_http_body(push_task_payload)
2156
2157
 
@@ -2635,6 +2636,7 @@ module Algolia
2635
2636
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
2636
2637
  header_params = {}
2637
2638
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
2639
+ request_options[:timeout] ||= 180000
2638
2640
 
2639
2641
  post_body = request_options[:debug_body]
2640
2642
 
@@ -3113,6 +3115,7 @@ module Algolia
3113
3115
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
3114
3116
  header_params = {}
3115
3117
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
3118
+ request_options[:timeout] ||= 180000
3116
3119
 
3117
3120
  post_body = request_options[:debug_body] || @api_client.object_to_http_body(source_create)
3118
3121
 
@@ -3166,6 +3169,7 @@ module Algolia
3166
3169
  query_params = query_params.merge(request_options[:query_params]) unless request_options[:query_params].nil?
3167
3170
  header_params = {}
3168
3171
  header_params = header_params.merge(request_options[:header_params]) unless request_options[:header_params].nil?
3172
+ request_options[:timeout] ||= 180000
3169
3173
 
3170
3174
  post_body = request_options[:debug_body] || @api_client.object_to_http_body(source_update)
3171
3175
 
@@ -3150,11 +3150,13 @@ module Algolia
3150
3150
  def wait_for_api_key(
3151
3151
  key,
3152
3152
  operation,
3153
- api_key = {},
3153
+ api_key = Search::ApiKey.new,
3154
3154
  max_retries = 50,
3155
3155
  timeout = -> (retry_count) { [retry_count * 200, 5000].min },
3156
3156
  request_options = {}
3157
3157
  )
3158
+ api_key = api_client.object_to_hash(api_key)
3159
+
3158
3160
  retries = 0
3159
3161
  if operation == "update"
3160
3162
  raise ArgumentError, "`api_key` is required when waiting for an `update` operation." if api_key.nil?
@@ -3162,7 +3164,7 @@ module Algolia
3162
3164
  updated_key = get_api_key(key, request_options)
3163
3165
  updated_key_hash = updated_key.to_hash
3164
3166
  equals = true
3165
- api_key.to_hash.each do |k, v|
3167
+ api_key.each do |k, v|
3166
3168
  equals &&= updated_key_hash[k] == v
3167
3169
  end
3168
3170
 
@@ -3201,7 +3203,9 @@ module Algolia
3201
3203
  # @param request_options [Hash] the requestOptions to send along with the query, they will be forwarded to the `browse` method.
3202
3204
  # @param block [Proc] the block to execute on each object of the index.
3203
3205
  def browse_objects(index_name, browse_params = Search::BrowseParamsObject.new, request_options = {}, &block)
3204
- browse_params[:hits_per_page] = browse_params[:hits_per_page] || 1000
3206
+ browse_params = api_client.object_to_hash(browse_params)
3207
+
3208
+ browse_params[:hitsPerPage] = 1000 unless browse_params.key?(:hitsPerPage)
3205
3209
 
3206
3210
  hits = []
3207
3211
  loop do
@@ -3214,8 +3218,8 @@ module Algolia
3214
3218
  hits.concat(res.hits)
3215
3219
  end
3216
3220
 
3217
- browse_params.cursor = res.cursor
3218
- break if browse_params.cursor.nil?
3221
+ browse_params[:cursor] = res.cursor
3222
+ break if browse_params[:cursor].nil?
3219
3223
  end
3220
3224
 
3221
3225
  hits unless block_given?
@@ -3227,12 +3231,11 @@ module Algolia
3227
3231
  # @param search_rules_params [SearchRulesParams] the parameters to send along with the query, they will be forwarded to the `searchRules` method.
3228
3232
  # @param request_options [Hash] the requestOptions to send along with the query, they will be forwarded to the `searchRules` method.
3229
3233
  # @param block [Proc] the block to execute on each rule of the index.
3230
- def browse_rules(
3231
- index_name,
3232
- search_rules_params = Search::SearchRulesParams.new(hits_per_page: 1000, page: 0),
3233
- request_options = {},
3234
- &block
3235
- )
3234
+ def browse_rules(index_name, search_rules_params = Search::SearchRulesParams.new, request_options = {}, &block)
3235
+ search_rules_params = api_client.object_to_hash(search_rules_params)
3236
+
3237
+ search_rules_params[:hitsPerPage] = 1000 unless search_rules_params.key?(:hitsPerPage)
3238
+
3236
3239
  rules = []
3237
3240
  loop do
3238
3241
  res = search_rules(index_name, search_rules_params, request_options)
@@ -3244,8 +3247,8 @@ module Algolia
3244
3247
  rules.concat(res.hits)
3245
3248
  end
3246
3249
 
3247
- search_rules_params.page += 1
3248
- break if res.hits.length < search_rules_params.hits_per_page
3250
+ search_rules_params[:page] += 1
3251
+ break if res.hits.length < search_rules_params[:hitsPerPage]
3249
3252
  end
3250
3253
 
3251
3254
  rules unless block_given?
@@ -3259,10 +3262,14 @@ module Algolia
3259
3262
  # @param block [Proc] the block to execute on each synonym of the index.
3260
3263
  def browse_synonyms(
3261
3264
  index_name,
3262
- search_synonyms_params = Search::SearchSynonymsParams.new(hits_per_page: 1000, page: 0),
3265
+ search_synonyms_params = Search::SearchSynonymsParams.new,
3263
3266
  request_options = {},
3264
3267
  &block
3265
3268
  )
3269
+ search_synonyms_params = api_client.object_to_hash(search_synonyms_params)
3270
+
3271
+ search_synonyms_params[:hitsPerPage] = 1000 unless search_synonyms_params.key?(:hitsPerPage)
3272
+
3266
3273
  synonyms = []
3267
3274
  loop do
3268
3275
  res = search_synonyms(index_name, search_synonyms_params, request_options)
@@ -3274,8 +3281,8 @@ module Algolia
3274
3281
  synonyms.concat(res.hits)
3275
3282
  end
3276
3283
 
3277
- search_synonyms_params.page += 1
3278
- break if res.hits.length < search_synonyms_params.hits_per_page
3284
+ search_synonyms_params[:page] += 1
3285
+ break if res.hits.length < search_synonyms_params[:hitsPerPage]
3279
3286
  end
3280
3287
 
3281
3288
  synonyms unless block_given?
@@ -3543,6 +3550,5 @@ module Algolia
3543
3550
 
3544
3551
  true
3545
3552
  end
3546
-
3547
3553
  end
3548
3554
  end
@@ -1,5 +1,5 @@
1
1
  # Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2
2
 
3
3
  module Algolia
4
- VERSION = "3.10.1".freeze
4
+ VERSION = "3.10.2".freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algolia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.1
4
+ version: 3.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://alg.li/support
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-12 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday