getstream-ruby 2.0.0 → 2.1.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 608825ba6bd6cdfbf3cc039d8fd5ec5ff35c8318b535f8447993e101b573cb3c
|
|
4
|
+
data.tar.gz: 46a144bca324f064474a6ee57dfcec5806b0cbffa38621ea1ed78ebf83eab015
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25b54e636a69165815fa736e8630642b9f2ecc9384f08feeb87ad2094881a279728b44e96416c864b1c22bac4de49812a750f8bccc37ef9599330d44aa9f7ed5
|
|
7
|
+
data.tar.gz: 86eecd2994dc136de478bb290b086e5bc3a191abdeddc7b226db5dae0ecb94e925671052a7851ab92c02aaa3f8ba9987b8ab852a161cbbd549f1d6642bef4e0d
|
|
@@ -9,6 +9,7 @@ require_relative 'generated/base_model'
|
|
|
9
9
|
require_relative 'generated/common_client'
|
|
10
10
|
require_relative 'generated/feeds_client'
|
|
11
11
|
require_relative 'generated/moderation_client'
|
|
12
|
+
require_relative 'extensions/moderation_extensions'
|
|
12
13
|
require_relative 'generated/feed'
|
|
13
14
|
require_relative 'stream_response'
|
|
14
15
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GetStream
|
|
4
|
+
|
|
5
|
+
module Generated
|
|
6
|
+
|
|
7
|
+
class ModerationClient
|
|
8
|
+
|
|
9
|
+
# Experimental: Check user profile
|
|
10
|
+
#
|
|
11
|
+
# Warning: This is an experimental feature and the API is subject to change.
|
|
12
|
+
#
|
|
13
|
+
# This function is used to check a user profile for moderation.
|
|
14
|
+
# This will not create any review queue items for the user profile.
|
|
15
|
+
# You can just use this to check whether to allow a certain user profile
|
|
16
|
+
# to be created or not.
|
|
17
|
+
#
|
|
18
|
+
# @param user_id [String] User ID to be checked
|
|
19
|
+
# @param profile [Hash] Profile data to be checked
|
|
20
|
+
# @option profile [String] :username Username to be checked
|
|
21
|
+
# @option profile [String] :image Image URL to be checked
|
|
22
|
+
# @return [Models::CheckResponse]
|
|
23
|
+
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.moderation.check_user_profile('user-id',
|
|
26
|
+
# { username: 'bad_username', image: 'https://example.com/profile.jpg' })
|
|
27
|
+
def check_user_profile(user_id, profile)
|
|
28
|
+
if profile[:username].nil? && profile[:image].nil?
|
|
29
|
+
raise ArgumentError, 'Either username or image must be provided'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
moderation_payload = Models::ModerationPayload.new
|
|
33
|
+
moderation_payload.texts = [profile[:username]] if profile[:username]
|
|
34
|
+
moderation_payload.images = [profile[:image]] if profile[:image]
|
|
35
|
+
|
|
36
|
+
check_request = Models::CheckRequest.new(
|
|
37
|
+
entity_type: 'userprofile',
|
|
38
|
+
entity_id: user_id,
|
|
39
|
+
entity_creator_id: user_id,
|
|
40
|
+
moderation_payload: moderation_payload,
|
|
41
|
+
config_key: 'user_profile:default',
|
|
42
|
+
options: { force_sync: true, test_mode: true },
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
check(check_request)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: getstream-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GetStream
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dotenv
|
|
@@ -106,6 +106,7 @@ files:
|
|
|
106
106
|
- lib/getstream_ruby/client.rb
|
|
107
107
|
- lib/getstream_ruby/configuration.rb
|
|
108
108
|
- lib/getstream_ruby/errors.rb
|
|
109
|
+
- lib/getstream_ruby/extensions/moderation_extensions.rb
|
|
109
110
|
- lib/getstream_ruby/generated/base_model.rb
|
|
110
111
|
- lib/getstream_ruby/generated/common_client.rb
|
|
111
112
|
- lib/getstream_ruby/generated/feed.rb
|