stream-chat-ruby 2.10.0 → 2.11.0

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: e9f49f20f526f3ddd42becd925d877020fea2b4afdca80327a1d31beeafcdd76
4
- data.tar.gz: d38e3c3390338c96f30ff692459aebd0c54addab98071130e089b9aed9a5ec13
3
+ metadata.gz: 99eb51b056c6265c10b7452897fef2ac5691def3e80819692c7755574b7e7672
4
+ data.tar.gz: 644d0384df490767e94588f1f76b0f0f0bd5012a1dfb9b2490c375e67dd6eacf
5
5
  SHA512:
6
- metadata.gz: a58994964df76b94ef804b25372acdf6cfe2d142f32fdfed54be0bcff81d5203ec5d8e38e5c0a0f216e43b2ba4713a35e722fa8eff92204f95e458a5ce3644a7
7
- data.tar.gz: 721e797d9968d088e90578548794457812e483c50ff12d138fbbbda37af3f5328d7290fb97103ea82b164462182a45a18bb64185c1d0df27e06cd3e6064befdf
6
+ metadata.gz: f172bdeebb0ddde0b55827be7f20ab72af074782ea2af5db7ad0bbda97f6d6abbc8b83e3098fdb34eb5b4312018320df42463a9a7ecc20afec370c8daefb0c0b
7
+ data.tar.gz: 70e907012a5fe56e57b5ec52a76a5ab24dfef914afe27e82eee6c47f22d701354ee2ba1bd057cb00da0dcc39f71d4a0edfcf70a60020aa3215f3aa6fa2907923
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## June 25th, 2021 - 2.11.0
2
+
3
+ - Add support for improved search
4
+
1
5
  ## June 4th, 2021 - 2.10.0
2
6
 
3
7
  - Add custom command CRUD support
@@ -92,13 +92,21 @@ module StreamChat
92
92
  get("messages/#{id}")
93
93
  end
94
94
 
95
- def search(filter_conditions, query, **options)
96
- params = options.merge({
97
- filter_conditions: filter_conditions,
98
- query: query
99
- })
100
-
101
- get('search', params: { payload: params.to_json })
95
+ def search(filter_conditions, query, sort: nil, **options)
96
+ offset = options[:offset]
97
+ next_value = options[:next]
98
+ raise ArgumentError, 'cannot use offset with next or sort parameters' if offset&.positive? && (next_value || (!sort.nil? && !sort.empty?))
99
+
100
+ to_merge = {
101
+ filter_conditions: filter_conditions,
102
+ sort: get_sort_fields(sort)
103
+ }
104
+ if query.is_a? String
105
+ to_merge[:query] = query
106
+ else
107
+ to_merge[:message_filter_conditions] = query
108
+ end
109
+ get('search', params: { payload: options.merge(to_merge).to_json })
102
110
  end
103
111
 
104
112
  def update_users(users)
@@ -3,5 +3,5 @@
3
3
  # lib/version.rb
4
4
 
5
5
  module StreamChat
6
- VERSION = '2.10.0'
6
+ VERSION = '2.11.0'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stream-chat-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mircea Cosbuc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-04 00:00:00.000000000 Z
11
+ date: 2021-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday