frontapp 0.0.11 → 0.0.13

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
- SHA1:
3
- metadata.gz: 39e2a2ed37f421a9e27a5d093b6b8edfabefe858
4
- data.tar.gz: 11239032440cc8d9d85fc008944180325ed8c0f0
2
+ SHA256:
3
+ metadata.gz: d508c522d8a0f3b5b811c7b30dd5ed9b242e760a27a8ea9d953d6ced1f805604
4
+ data.tar.gz: 988168ffe4d27acbc8a2330b7b810a94cff1c50586e69cfe0bd16b2412f6a37a
5
5
  SHA512:
6
- metadata.gz: 4dcb5247a8e1efc3b367fe0f71852eb4c1676a7544446f640abe791d6c0b5b33c0f5ae26208d9f320ac9b95bd015b9f0ea2d08928952485f19eb1cf010b7f40e
7
- data.tar.gz: 026dad6c0c6fd6ad2f5cfab7cf943f8dcf17174704f3f9b261e8ce4256eb41aeb3141c53017f53ad672bc1400233d39fb5f47031d642183a8e8cf18f02cb0ffe
6
+ metadata.gz: eadf7a561eeddab591e292c4c2d2712043ca77bf01a9dba506d2034998b8cc11d2bc72f91c8533ae1746436740917b32bf83b5a4b163202a85808dff0b2f13c6
7
+ data.tar.gz: 569ddc2fcbb3e51e0dd8cdee34241b940aebcdec25c2236e6f8bd0afe1dbd84dadd58b73e461a4e463bbc02cbacbd16c4422919bb5f4023dc2728f77bf2fcc22
@@ -2,8 +2,8 @@ module Frontapp
2
2
  class Client
3
3
  module Conversations
4
4
 
5
- def conversations(params = {})
6
- list("conversations", params)
5
+ def conversations(params = {}, &block)
6
+ list("conversations", params, &block)
7
7
  end
8
8
 
9
9
  # Parameters
@@ -93,6 +93,28 @@ module Frontapp
93
93
  cleaned = params.permit(:link_ids)
94
94
  delete("conversations/#{conversation_id}/links", cleaned)
95
95
  end
96
+
97
+ # Parameters
98
+ # Name Type Description
99
+ # ----------------------------------------------
100
+ # conversation_id string The conversation Id
101
+ # teammate_ids array of strings follower IDs to remove
102
+ # ----------------------------------------------
103
+ def remove_conversation_followers!(conversation_id, params = {})
104
+ cleaned = params.permit(:teammate_ids)
105
+ delete("conversations/#{conversation_id}/followers", cleaned)
106
+ end
107
+
108
+ # Parameters
109
+ # Name Type Description
110
+ # ----------------------------------------------
111
+ # conversation_id string The conversation Id
112
+ # teammate_ids array of strings follower IDs to add
113
+ # ----------------------------------------------
114
+ def add_conversation_followers!(conversation_id, params = {})
115
+ cleaned = params.permit(:teammate_ids)
116
+ create_without_response("conversations/#{conversation_id}/followers", cleaned)
117
+ end
96
118
  end
97
119
  end
98
120
  end
@@ -61,7 +61,13 @@ module Frontapp
61
61
  raise Error.from_response(res)
62
62
  end
63
63
  response = JSON.parse(res.to_s)
64
- items.concat(response["_results"]) if response["_results"]
64
+
65
+ if block_given?
66
+ yield(response["_results"])
67
+ else
68
+ items.concat(response["_results"]) if response["_results"]
69
+ end
70
+
65
71
  pagination = response["_pagination"]
66
72
  if pagination.nil? || pagination["next"].nil?
67
73
  last_page = true
@@ -136,15 +142,15 @@ module Frontapp
136
142
  res << q.map do |k, v|
137
143
  case v
138
144
  when Symbol, String
139
- "q[#{k}]=#{URI.encode(v)}"
145
+ "q[#{k}]=#{URI.encode_uri_component(v)}"
140
146
  when Array then
141
- v.map { |c| "q[#{k}][]=#{URI.encode(c.to_s)}" }.join("&")
147
+ v.map { |c| "q[#{k}][]=#{URI.encode_uri_component(c.to_s)}" }.join("&")
142
148
  else
143
- "q[#{k}]=#{URI.encode(v.to_s)}"
149
+ "q[#{k}]=#{URI.encode_uri_component(v.to_s)}"
144
150
  end
145
151
  end
146
152
  end
147
- res << params.map {|k,v| "#{k}=#{URI.encode(v.to_s)}"}
153
+ res << params.map {|k,v| "#{k}=#{URI.encode_uri_component(v.to_s)}"}
148
154
  res.join("&")
149
155
  end
150
156
 
@@ -1,3 +1,3 @@
1
1
  module Frontapp
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frontapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niels van der Zanden
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2018-10-15 00:00:00.000000000 Z
@@ -97,7 +97,7 @@ homepage: https://github.com/phusion/frontapp
97
97
  licenses:
98
98
  - MIT
99
99
  metadata: {}
100
- post_install_message:
100
+ post_install_message:
101
101
  rdoc_options: []
102
102
  require_paths:
103
103
  - lib
@@ -112,9 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
114
  requirements: []
115
- rubyforge_project:
116
- rubygems_version: 2.5.2.1
117
- signing_key:
115
+ rubygems_version: 3.5.22
116
+ signing_key:
118
117
  specification_version: 4
119
118
  summary: Ruby client for Frontapp API
120
119
  test_files: []