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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e0b02058c12522318ebd603cf9df70336a10c24676e76ba58c52f7cb76557f3
4
- data.tar.gz: 52a4c6385266cfd6db60ea487872f563af1b6f5efd9cc6470f01ee654efb8a75
3
+ metadata.gz: f82c7be6c43499e9a1cc39406dba3536addda37b09e7d0633681a66a51df4e29
4
+ data.tar.gz: ed30ac1258dcc0725d88a125d2c66149d2e71ba3b004ff70c27caf7cd2f5198b
5
5
  SHA512:
6
- metadata.gz: 5d96047a3327bff2d71c72e9e19b9c0ee76caaa6bbd55342b6758c81c1df1059069ffd2e0f01ac04282f02231aebc12f5d217376a567446ae542f16dc006c73c
7
- data.tar.gz: c94076dddbe29e81f7635222dcfc0b001bc9d289e10f1fc244ce1f3d17bdcf78a5805d384c5f363163af9e8ac743b22152a9171cd9ffe433f21cace83e56d4e5
6
+ metadata.gz: 98a3991725770abe6c28746f4d172f6fce5b236301c05ad74b8df342902aec34564f2bc61f3e7aabc9a8daeabea0ca75de728d68a7461d9b06ab4e30332ebfe7
7
+ data.tar.gz: c319666f57917ec387936d0637c0162430b9f0cb93ffb4dc72e0de7767103a4d26e7690f60faae4bcb105ae062a95c5e40e4f77d19846665997bb6e7585a325d
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2017 Stream.io Inc, and individual contributors.
1
+ Copyright (c) 2014-2021, Stream.io Inc, and individual contributors.
2
2
 
3
3
  All rights reserved.
4
4
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # stream-ruby
2
2
 
3
- [![Build Status](https://travis-ci.org/GetStream/stream-ruby.svg?branch=master)](https://travis-ci.org/GetStream/stream-ruby) [![Gem Version](https://badge.fury.io/rb/stream-ruby.svg)](http://badge.fury.io/rb/stream-ruby)
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
- Copyright (c) 2014-2020 Stream.io Inc, and individual contributors. All rights reserved.
156
+ Project is licensed under the [BSD 3-Clause](LICENSE).
157
157
 
158
- See the file "LICENSE" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.
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).
@@ -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, '/activities/', signature, params)
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
- Hash[get_default_params.merge(params).sort_by { |k, _v| k.to_s }]
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
- 'foreign_id': foreign_id,
97
- 'time': time
103
+ foreign_id: foreign_id,
104
+ time: time
98
105
  }
99
106
 
100
107
  data['new_targets'] = new_targets unless new_targets.nil?
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Stream
2
- VERSION = '4.0.1'.freeze
2
+ VERSION = '4.3.0'.freeze
3
3
  end
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.1
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-01-05 00:00:00.000000000 Z
13
+ date: 2021-09-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday