stream-chat-ruby 3.14.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 +4 -4
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +2 -0
- data/lib/stream-chat/client.rb +10 -0
- data/lib/stream-chat/moderation.rb +44 -1
- data/lib/stream-chat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cbaf42294dbe5ae2578a02f9b2a18e60dda4dd92906607b472537c201bd025f
|
4
|
+
data.tar.gz: 66f27459befeb6529b367fa469aaf506f7d4a2919edea05823e994835b2b0588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 346d166b21cdf6165993718d05a063cdbdc3f393b844fe72c5830923eb36f9db4e48838bd1181cde7418275ce22819f59245dd0677d84ce48147b2198cb2d829
|
7
|
+
data.tar.gz: 30b643a68dd9de1c3fa4f3056712e58083bb1c5913c75f51a550050a03b8bdc7643ea27751c2051679f1611a981653ed88657926caec8ce2dbf9de20ff18960c
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,8 @@
|
|
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
|
+
|
5
7
|
## [3.14.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.13.0...v3.14.0) (2025-04-07)
|
6
8
|
|
7
9
|
## [3.13.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.12.0...v3.13.0) (2025-04-04)
|
data/lib/stream-chat/client.rb
CHANGED
@@ -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
|
data/lib/stream-chat/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2025-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|