stream-ruby 4.2.0 → 4.3.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: 2972e7e742f31f333f433daeedd19dbe28b8778ed76e65ef8627fec52bfee589
4
- data.tar.gz: eff63599f1fafb19d4e905a1286bc74570ade5b9bd26754fb2babe0792bd6410
3
+ metadata.gz: f82c7be6c43499e9a1cc39406dba3536addda37b09e7d0633681a66a51df4e29
4
+ data.tar.gz: ed30ac1258dcc0725d88a125d2c66149d2e71ba3b004ff70c27caf7cd2f5198b
5
5
  SHA512:
6
- metadata.gz: 6698774ebabe5b08638f96d1b01001d5b9809c5a21265f9ae400a8213c75a96c0600eef32c7a467b2690623ea789ed9aa7c8ec3a0bd49cc858bea2a8ada51997
7
- data.tar.gz: a22782a9ba528f900174b727c76b0eaddf783a2d34d7a5ff17856ddad19a1af7b319bbf48050bb35e980a20e0adeb8822ef6d9f1ca67fc025aa69c2dde775b67
6
+ metadata.gz: 98a3991725770abe6c28746f4d172f6fce5b236301c05ad74b8df342902aec34564f2bc61f3e7aabc9a8daeabea0ca75de728d68a7461d9b06ab4e30332ebfe7
7
+ data.tar.gz: c319666f57917ec387936d0637c0162430b9f0cb93ffb4dc72e0de7767103a4d26e7690f60faae4bcb105ae062a95c5e40e4f77d19846665997bb6e7585a325d
@@ -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/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
 
@@ -1,3 +1,3 @@
1
1
  module Stream
2
- VERSION = '4.2.0'.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.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommaso Barbugli