stream-ruby 4.0.1 → 4.3.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/LICENSE +1 -1
- data/README.md +8 -3
- data/lib/stream/activities.rb +17 -1
- data/lib/stream/client.rb +1 -1
- data/lib/stream/feed.rb +10 -3
- data/lib/stream/reactions.rb +6 -4
- 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: f82c7be6c43499e9a1cc39406dba3536addda37b09e7d0633681a66a51df4e29
|
4
|
+
data.tar.gz: ed30ac1258dcc0725d88a125d2c66149d2e71ba3b004ff70c27caf7cd2f5198b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98a3991725770abe6c28746f4d172f6fce5b236301c05ad74b8df342902aec34564f2bc61f3e7aabc9a8daeabea0ca75de728d68a7461d9b06ab4e30332ebfe7
|
7
|
+
data.tar.gz: c319666f57917ec387936d0637c0162430b9f0cb93ffb4dc72e0de7767103a4d26e7690f60faae4bcb105ae062a95c5e40e4f77d19846665997bb6e7585a325d
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# stream-ruby
|
2
2
|
|
3
|
-
[](https://github.com/GetStream/stream-ruby/actions) [](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,24 @@ 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[:withRecentReactions] = true if params[:reactions][:recent]
|
44
|
+
params[:withReactionCounts] = true if params[:reactions][:counts]
|
45
|
+
params[:withOwnChildren] = true if params[:reactions][:children]
|
46
|
+
user_id = params[:reactions][:user_id]
|
47
|
+
params[:user_id] = user_id if user_id
|
48
|
+
kinds = params[:reactions][:kinds]
|
49
|
+
if kinds
|
50
|
+
params[:reactionKindsFilter] = kinds.is_a?(Array) ? kinds.join(',') : kinds
|
51
|
+
end
|
52
|
+
end
|
53
|
+
%i[enrich reactions].each { |k| params.delete(k) }
|
54
|
+
|
39
55
|
signature = Stream::Signer.create_jwt_token('activities', '*', @api_secret, '*')
|
40
|
-
make_request(:get,
|
56
|
+
make_request(:get, uri, signature, params)
|
41
57
|
end
|
42
58
|
|
43
59
|
#
|
data/lib/stream/client.rb
CHANGED
@@ -141,7 +141,7 @@ module Stream
|
|
141
141
|
end
|
142
142
|
|
143
143
|
def make_query_params(params)
|
144
|
-
|
144
|
+
get_default_params.merge(params).sort_by { |k, _v| k.to_s }.to_h
|
145
145
|
end
|
146
146
|
|
147
147
|
def make_request(method, relative_url, signature, params = {}, data = {}, headers = {})
|
data/lib/stream/feed.rb
CHANGED
@@ -44,6 +44,13 @@ module Stream
|
|
44
44
|
params[:withOwnReactions] = true if params[:reactions][:own]
|
45
45
|
params[:withRecentReactions] = true if params[:reactions][:recent]
|
46
46
|
params[:withReactionCounts] = true if params[:reactions][:counts]
|
47
|
+
params[:withOwnChildren] = true if params[:reactions][:children]
|
48
|
+
user_id = params[:reactions][:user_id]
|
49
|
+
params[:user_id] = user_id if user_id
|
50
|
+
kinds = params[:reactions][:kinds]
|
51
|
+
if kinds
|
52
|
+
params[:reactionKindsFilter] = kinds.is_a?(Array) ? kinds.join(',') : kinds
|
53
|
+
end
|
47
54
|
end
|
48
55
|
%i[enrich reactions].each { |k| params.delete(k) }
|
49
56
|
|
@@ -68,7 +75,7 @@ module Stream
|
|
68
75
|
end
|
69
76
|
|
70
77
|
def remove(activity_id, foreign_id: false)
|
71
|
-
remove_activity(activity_id, foreign_id)
|
78
|
+
remove_activity(activity_id, foreign_id: foreign_id)
|
72
79
|
end
|
73
80
|
|
74
81
|
def remove_activity(activity_id, foreign_id: false)
|
@@ -93,8 +100,8 @@ module Stream
|
|
93
100
|
def update_activity_to_targets(foreign_id, time, new_targets: nil, added_targets: nil, removed_targets: nil)
|
94
101
|
uri = "/feed_targets/#{@feed_url}/activity_to_targets/"
|
95
102
|
data = {
|
96
|
-
|
97
|
-
|
103
|
+
foreign_id: foreign_id,
|
104
|
+
time: time
|
98
105
|
}
|
99
106
|
|
100
107
|
data['new_targets'] = new_targets unless new_targets.nil?
|
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
|
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.3.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-09-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|