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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8ee833ff83deaf55551133933e1b4c76a36ae027e2a170d8fe56466fa13f6f6
4
- data.tar.gz: 8697ed9741c4c2061188558be6cc899ad08cc40ed5ae63bcbe5049b892b5c568
3
+ metadata.gz: 45db9a7a90e49d324f2dbbd689708e746c6568b2782719752b31edfe2179c83f
4
+ data.tar.gz: 0455ef9b94b2416d12b41ef8193d1c849ef433386b7d33d1c6f2832ba4e94d08
5
5
  SHA512:
6
- metadata.gz: fd527b909f85484837ca54ca811e90d1e755fb0718610432b3c356f2a259b192eb43faa1f67f1af7ad869974848a28794ab80c89a31a3ac3c55b37e3a5984336
7
- data.tar.gz: 82f991a73b26a61cd9a8e9015fefb66ef397e79429f904dc6688c081eaaa80ecb139c2d437a4fa71fab2f397d2145f116f7f1cb088c8c71c8990d4f51097272f
6
+ metadata.gz: 3be8cebeaeff425c71151891d29881f15745619bcf231f5a91241864ea87387edc5ab87522b539490f0c305016e9d0c8f7062f1bf9c17912a340c1b9fa9b966b
7
+ data.tar.gz: 5054648ea28fa389fc0e097271b4184e84514c70a8f9ce2f17df85db373b71caf956eeadafe70ba74f49121136af81576afc798cb99edb50c1ec074afaca46cb
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,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, '/activities/', signature, params)
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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Stream
2
- VERSION = '4.0.2'.freeze
2
+ VERSION = '4.4.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.2
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-03-15 00:00:00.000000000 Z
13
+ date: 2021-10-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday