stream-chat-ruby 3.13.0 → 3.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f242a964e26ae0d7150830f886e9e1b96b8a3f0a203421c0f8b8b439a455146
4
- data.tar.gz: 5ade6ec19923342d9508b1b2b139c68e107ae0458e38edd41773e9c8e41d088b
3
+ metadata.gz: 3cbaf42294dbe5ae2578a02f9b2a18e60dda4dd92906607b472537c201bd025f
4
+ data.tar.gz: 66f27459befeb6529b367fa469aaf506f7d4a2919edea05823e994835b2b0588
5
5
  SHA512:
6
- metadata.gz: f1f4a36a5c7d9bc92cbd0ca7503fda1c18c67fac83e6cbbab46885703de71dd8aeac9b3312aba7c68b71ac4dcbba25ecb7b9eb7800ed3cdb7e6767a93c22ae93
7
- data.tar.gz: d71f1a32e0e30f78a23bbd4bcd048215b15432f65645bd68d985d1d6650705f735d9ef3e8c36313903206e03366c5f71144c9faa6af042299e737bfc9367d112
6
+ metadata.gz: 346d166b21cdf6165993718d05a063cdbdc3f393b844fe72c5830923eb36f9db4e48838bd1181cde7418275ce22819f59245dd0677d84ce48147b2198cb2d829
7
+ data.tar.gz: 30b643a68dd9de1c3fa4f3056712e58083bb1c5913c75f51a550050a03b8bdc7643ea27751c2051679f1611a981653ed88657926caec8ce2dbf9de20ff18960c
data/.rubocop.yml CHANGED
@@ -35,3 +35,5 @@ Style/FrozenStringLiteralComment:
35
35
 
36
36
  Gemspec/RequireMFA:
37
37
  Enabled: false
38
+ Naming/PredicateMethod:
39
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [3.15.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.14.0...v3.15.0) (2025-06-06)
6
+
7
+ ## [3.14.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.13.0...v3.14.0) (2025-04-07)
8
+
5
9
  ## [3.13.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.12.0...v3.13.0) (2025-04-04)
6
10
 
7
11
 
@@ -929,6 +929,16 @@ module StreamChat
929
929
  get('imports', params: options)
930
930
  end
931
931
 
932
+ sig { params(filter: StringKeyHash, sort: T.nilable(T::Hash[String, Integer]), options: T.untyped).returns(StreamChat::StreamResponse) }
933
+ def query_threads(filter, sort: nil, **options)
934
+ params = {}.merge(options).merge({
935
+ filter: filter,
936
+ sort: StreamChat.get_sort_fields(sort)
937
+ })
938
+
939
+ post('threads', data: params)
940
+ end
941
+
932
942
  private
933
943
 
934
944
  sig { returns(T::Hash[String, String]) }
@@ -14,7 +14,8 @@ module StreamChat
14
14
  MODERATION_ENTITY_TYPES = T.let(
15
15
  {
16
16
  user: 'stream:user',
17
- message: 'stream:chat:v1:message'
17
+ message: 'stream:chat:v1:message',
18
+ userprofile: 'stream:v1:user_profile'
18
19
  }.freeze,
19
20
  T::Hash[Symbol, String]
20
21
  )
@@ -24,6 +25,48 @@ module StreamChat
24
25
  @client = client
25
26
  end
26
27
 
28
+ # Experimental: Check user profile
29
+ #
30
+ # Warning: This is an experimental feature and the API is subject to change.
31
+ #
32
+ # This function is used to check a user profile for moderation.
33
+ # This will not create any review queue items for the user profile.
34
+ # You can just use this to check whether to allow a certain user profile to be created or not.
35
+ #
36
+ # @param [string] user_id User ID to be checked
37
+ # @param [Hash] profile Profile data to be checked
38
+ # @option profile [String] :username Username to be checked
39
+ # @option profile [String] :image Image URL to be checked
40
+ # @return [StreamChat::StreamResponse]
41
+ #
42
+ # example:
43
+ # client.moderation.check_user_profile('user-id', {username: 'bad_username', image: 'https://example.com/profile.jpg'})
44
+ sig do
45
+ params(
46
+ user_id: String,
47
+ profile: T::Hash[Symbol, T.nilable(String)]
48
+ ).returns(StreamChat::StreamResponse)
49
+ end
50
+ def check_user_profile(user_id, profile)
51
+ raise ArgumentError, 'Either username or image must be provided' if profile[:username].nil? && profile[:image].nil?
52
+
53
+ moderation_payload = {}
54
+ moderation_payload[:texts] = [profile[:username]] if profile[:username]
55
+ moderation_payload[:images] = [profile[:image]] if profile[:image]
56
+
57
+ check(
58
+ T.must(MODERATION_ENTITY_TYPES[:userprofile]),
59
+ user_id,
60
+ moderation_payload,
61
+ 'user_profile:default',
62
+ entity_creator_id: user_id,
63
+ options: {
64
+ force_sync: true,
65
+ test_mode: true
66
+ }
67
+ )
68
+ end
69
+
27
70
  # Flags a user with a reason
28
71
  #
29
72
  # @param [string] flagged_user_id User ID to be flagged
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module StreamChat
5
- VERSION = '3.13.0'
5
+ VERSION = '3.15.0'
6
6
  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: 3.13.0
4
+ version: 3.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - getstream.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-04 00:00:00.000000000 Z
11
+ date: 2025-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday