stream-ruby 4.0.2 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +8 -3
- data/lib/stream/activities.rb +18 -1
- data/lib/stream/feed.rb +8 -0
- data/lib/stream/reactions.rb +7 -5
- data/lib/stream/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: 45db9a7a90e49d324f2dbbd689708e746c6568b2782719752b31edfe2179c83f
|
4
|
+
data.tar.gz: 0455ef9b94b2416d12b41ef8193d1c849ef433386b7d33d1c6f2832ba4e94d08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3be8cebeaeff425c71151891d29881f15745619bcf231f5a91241864ea87387edc5ab87522b539490f0c305016e9d0c8f7062f1bf9c17912a340c1b9fa9b966b
|
7
|
+
data.tar.gz: 5054648ea28fa389fc0e097271b4184e84514c70a8f9ce2f17df85db373b71caf956eeadafe70ba74f49121136af81576afc798cb99edb50c1ec074afaca46cb
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# stream-ruby
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![build](https://github.com/GetStream/stream-ruby/workflows/build/badge.svg)](https://github.com/GetStream/stream-ruby/actions) [![Gem Version](https://badge.fury.io/rb/stream-ruby.svg)](http://badge.fury.io/rb/stream-ruby)
|
4
4
|
|
5
5
|
[stream-ruby](https://github.com/GetStream/stream-ruby) is the official Ruby client for [Stream](https://getstream.io/), a web service for building scalable newsfeeds and activity streams.
|
6
6
|
|
@@ -153,6 +153,11 @@ client.og('https://google.com')
|
|
153
153
|
|
154
154
|
### Copyright and License Information
|
155
155
|
|
156
|
-
|
156
|
+
Project is licensed under the [BSD 3-Clause](LICENSE).
|
157
157
|
|
158
|
-
|
158
|
+
## We are hiring!
|
159
|
+
|
160
|
+
We've recently closed a [$38 million Series B funding round](https://techcrunch.com/2021/03/04/stream-raises-38m-as-its-chat-and-activity-feed-apis-power-communications-for-1b-users/) and we keep actively growing.
|
161
|
+
Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.
|
162
|
+
|
163
|
+
Check out our current openings and apply via [Stream's website](https://getstream.io/team/#jobs).
|
data/lib/stream/activities.rb
CHANGED
@@ -36,8 +36,25 @@ module Stream
|
|
36
36
|
timestamps: timestamps
|
37
37
|
}
|
38
38
|
end
|
39
|
+
|
40
|
+
uri = params[:enrich] || params[:reactions] ? '/enrich/activities/' : '/activities/'
|
41
|
+
if params[:reactions].respond_to?(:keys)
|
42
|
+
params[:withOwnReactions] = true if params[:reactions][:own]
|
43
|
+
params[:withFirstReactions] = true if params[:reactions][:first]
|
44
|
+
params[:withRecentReactions] = true if params[:reactions][:recent]
|
45
|
+
params[:withReactionCounts] = true if params[:reactions][:counts]
|
46
|
+
params[:withOwnChildren] = true if params[:reactions][:children]
|
47
|
+
user_id = params[:reactions][:user_id]
|
48
|
+
params[:user_id] = user_id if user_id
|
49
|
+
kinds = params[:reactions][:kinds]
|
50
|
+
if kinds
|
51
|
+
params[:reactionKindsFilter] = kinds.is_a?(Array) ? kinds.join(',') : kinds
|
52
|
+
end
|
53
|
+
end
|
54
|
+
%i[enrich reactions].each { |k| params.delete(k) }
|
55
|
+
|
39
56
|
signature = Stream::Signer.create_jwt_token('activities', '*', @api_secret, '*')
|
40
|
-
make_request(:get,
|
57
|
+
make_request(:get, uri, signature, params)
|
41
58
|
end
|
42
59
|
|
43
60
|
#
|
data/lib/stream/feed.rb
CHANGED
@@ -42,8 +42,16 @@ module Stream
|
|
42
42
|
params[:mark_seen] = params[:mark_seen].join(',') if params[:mark_seen]&.is_a?(Array)
|
43
43
|
if params[:reactions].respond_to?(:keys)
|
44
44
|
params[:withOwnReactions] = true if params[:reactions][:own]
|
45
|
+
params[:withFirstReactions] = true if params[:reactions][:first]
|
45
46
|
params[:withRecentReactions] = true if params[:reactions][:recent]
|
46
47
|
params[:withReactionCounts] = true if params[:reactions][:counts]
|
48
|
+
params[:withOwnChildren] = true if params[:reactions][:children]
|
49
|
+
user_id = params[:reactions][:user_id]
|
50
|
+
params[:user_id] = user_id if user_id
|
51
|
+
kinds = params[:reactions][:kinds]
|
52
|
+
if kinds
|
53
|
+
params[:reactionKindsFilter] = kinds.is_a?(Array) ? kinds.join(',') : kinds
|
54
|
+
end
|
47
55
|
end
|
48
56
|
%i[enrich reactions].each { |k| params.delete(k) }
|
49
57
|
|
data/lib/stream/reactions.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
module Stream
|
2
2
|
class ReactionsClient < Client
|
3
|
-
def add(kind, activity_id, user_id, data: nil, target_feeds: nil)
|
3
|
+
def add(kind, activity_id, user_id, data: nil, target_feeds: nil, target_feeds_extra_data: nil)
|
4
4
|
data = {
|
5
5
|
kind: kind,
|
6
6
|
activity_id: activity_id,
|
7
7
|
user_id: user_id,
|
8
8
|
data: data,
|
9
|
-
target_feeds: target_feeds
|
9
|
+
target_feeds: target_feeds,
|
10
|
+
target_feeds_extra_data: target_feeds_extra_data
|
10
11
|
}
|
11
12
|
make_reaction_request(:post, {}, data)
|
12
13
|
end
|
@@ -30,13 +31,14 @@ module Stream
|
|
30
31
|
make_reaction_request(:delete, {}, {}, endpoint: uri)
|
31
32
|
end
|
32
33
|
|
33
|
-
def add_child(kind, parent_id, user_id, data: nil, target_feeds: nil)
|
34
|
+
def add_child(kind, parent_id, user_id, data: nil, target_feeds: nil, target_feeds_extra_data: nil)
|
34
35
|
data = {
|
35
36
|
kind: kind,
|
36
37
|
parent: parent_id,
|
37
38
|
user_id: user_id,
|
38
39
|
data: data,
|
39
|
-
target_feeds: target_feeds
|
40
|
+
target_feeds: target_feeds,
|
41
|
+
target_feeds_extra_data: target_feeds_extra_data
|
40
42
|
}
|
41
43
|
make_reaction_request(:post, {}, data)
|
42
44
|
end
|
@@ -55,7 +57,7 @@ module Stream
|
|
55
57
|
field = 'user_id'
|
56
58
|
value = params[:user_id]
|
57
59
|
end
|
58
|
-
params.delete(field.to_sym) unless field.empty?
|
60
|
+
params.delete(field.to_sym) unless field.empty? && field != 'user_id'
|
59
61
|
uri = if kind.nil? || kind.empty?
|
60
62
|
"/reaction/#{field}/#{value}/"
|
61
63
|
else
|
data/lib/stream/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stream-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tommaso Barbugli
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-10-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|