intercom 3.6.1 → 3.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/changes.txt +22 -0
- data/lib/intercom/service/conversation.rb +5 -0
- data/lib/intercom/version.rb +1 -1
- data/spec/spec_helper.rb +5 -0
- data/spec/unit/intercom/conversation_spec.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb279cee47b8721db490a1cc48254cd0c77ce2f5
|
4
|
+
data.tar.gz: 7c4692eec6c02dff011cc59a3c59e8cbed2623f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff17f1177da16e8d48d932ff27c48bec548a9e7d6ce2183657d1d8e5e21156826674d30557d644e5249f2f2c9f3151018ba1e69223e99a2b591d66a21f75ca66
|
7
|
+
data.tar.gz: e38a41bf57b2c4714197a4812458eb13080e4ef7acfec8c574feb10139d4a64f6fec737bb55f3979125c3c8e66d8d93179c8aa1f0f7112f97655a6e9e9975172
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ This version of the gem is compatible with `Ruby 2.1` and above.
|
|
22
22
|
|
23
23
|
Using bundler:
|
24
24
|
|
25
|
-
gem 'intercom', '~> 3.6.
|
25
|
+
gem 'intercom', '~> 3.6.1'
|
26
26
|
|
27
27
|
## Basic Usage
|
28
28
|
|
@@ -228,8 +228,13 @@ intercom.conversations.open(id: conversation.id, admin_id: '123')
|
|
228
228
|
intercom.conversations.close(id: conversation.id, admin_id: '123')
|
229
229
|
|
230
230
|
# Assign
|
231
|
+
# Note: Conversations can be assigned to teams. However, the entity that performs the operation of assigning the conversation has to be an existing teammate.
|
232
|
+
# You can use `intercom.admins.all.each {|a| puts a.inspect if a.type == 'admin' }` to list all of your teammates.
|
231
233
|
intercom.conversations.assign(id: conversation.id, admin_id: '123', assignee_id: '124')
|
232
234
|
|
235
|
+
# Snooze
|
236
|
+
intercom.conversations.snooze(id: conversation.id, admin_id: '123', snoozed_until: 9999999999)
|
237
|
+
|
233
238
|
# Reply and Open
|
234
239
|
intercom.conversations.reply(id: conversation.id, type: 'admin', admin_id: '123', message_type: 'open', body: 'bar')
|
235
240
|
|
data/changes.txt
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
3.6.1
|
2
|
+
#430 Allow all conversations to be listed
|
3
|
+
You can now iterate over all conversations for your app via:
|
4
|
+
intercom.conversations.all.each { |convo| ... }
|
5
|
+
|
6
|
+
3.6.0
|
7
|
+
BREAKING CHANGE companies
|
8
|
+
We updated companies to be able to list users via company_id as well as id (#428 )
|
9
|
+
Note that this is a breaking change as we had to remove the old way of listing users via company.
|
10
|
+
|
11
|
+
Previously it was:
|
12
|
+
intercom.companies.users(company.id)
|
13
|
+
|
14
|
+
Now you get a list of users in a company by Intercom Company ID
|
15
|
+
intercom.companies.users_by_intercom_company_id(company.id)
|
16
|
+
|
17
|
+
Now you get a list of users in a company by external company_id
|
18
|
+
intercom.companies.users_by_company_id(company.company_id)
|
19
|
+
|
20
|
+
Rate limit handling
|
21
|
+
We also improved the way we handle rate limits in PR #409 which was related to issue #405
|
22
|
+
|
1
23
|
3.5.23
|
2
24
|
- New type of error (ResourceNotUniqueError). Thrown when trying to create a resource that already exists in Intercom
|
3
25
|
|
@@ -37,6 +37,11 @@ module Intercom
|
|
37
37
|
reply reply_data.merge(message_type: 'close', type: 'admin')
|
38
38
|
end
|
39
39
|
|
40
|
+
def snooze(reply_data)
|
41
|
+
snoozed_until = reply_data.fetch(:snoozed_until) { fail 'snoozed_until field is required' }
|
42
|
+
reply reply_data.merge(message_type: 'snoozed', type: 'admin')
|
43
|
+
end
|
44
|
+
|
40
45
|
def assign(reply_data)
|
41
46
|
assignee_id = reply_data.fetch(:assignee_id) { fail 'assignee_id is required' }
|
42
47
|
reply reply_data.merge(message_type: 'assignment', assignee_id: assignee_id, type: 'admin')
|
data/lib/intercom/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -2,6 +2,7 @@ require 'intercom'
|
|
2
2
|
require 'minitest/autorun'
|
3
3
|
require 'mocha/setup'
|
4
4
|
require 'webmock'
|
5
|
+
require 'time'
|
5
6
|
include WebMock::API
|
6
7
|
|
7
8
|
def test_user(email="bob@example.com")
|
@@ -625,6 +626,10 @@ def test_event_list
|
|
625
626
|
}
|
626
627
|
end
|
627
628
|
|
629
|
+
def tomorrow
|
630
|
+
(DateTime.now.to_time + 1).to_i
|
631
|
+
end
|
632
|
+
|
628
633
|
def page_of_events(include_next_link=false)
|
629
634
|
{
|
630
635
|
"type" => "event.list",
|
@@ -43,6 +43,11 @@ describe "Intercom::Conversation" do
|
|
43
43
|
client.conversations.assign(id: '147', admin_id: '123', assignee_id: '124')
|
44
44
|
end
|
45
45
|
|
46
|
+
it 'snoozes a conversation' do
|
47
|
+
client.expects(:post).with('/conversations/147/reply', { type: 'admin', message_type: 'snoozed', conversation_id: '147', admin_id: '123', snoozed_until: tomorrow}).returns(test_conversation)
|
48
|
+
client.conversations.snooze(id: '147', admin_id: '123', snoozed_until: tomorrow)
|
49
|
+
end
|
50
|
+
|
46
51
|
# it "creates a subscription" do
|
47
52
|
# client.expects(:post).with("/subscriptions", {'url' => "http://example.com", 'topics' => ["user.created"]}).returns(test_subscription)
|
48
53
|
# subscription = client.subscriptions.create(:url => "http://example.com", :topics => ["user.created"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intercom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben McRedmond
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2018-10-
|
18
|
+
date: 2018-10-05 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: minitest
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
229
|
version: '0'
|
230
230
|
requirements: []
|
231
231
|
rubyforge_project: intercom
|
232
|
-
rubygems_version: 2.6.14
|
232
|
+
rubygems_version: 2.6.14
|
233
233
|
signing_key:
|
234
234
|
specification_version: 4
|
235
235
|
summary: Ruby bindings for the Intercom API
|