frontapp 0.0.3 → 0.0.4
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 +4 -4
- data/lib/frontapp/client.rb +3 -2
- data/lib/frontapp/client/contacts.rb +14 -10
- data/lib/frontapp/client/messages.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30c294b8a64f472bccb85eaa37ce15f5a4faf3f1
|
4
|
+
data.tar.gz: 5a6238b190bb7b819513d3f566cc91b84b66aa21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 582723123712778cb32bb9646072d8b3e36cee516d4ae98f97b38ac5df43c09dd5290a8a878372a59219beb021e34b838f132e59d0f7e8f1af3bc197aa328022
|
7
|
+
data.tar.gz: cca450fe1e520dae490052adba3f514c250a07e6b3a4ac3a3747ecfc0d434259e232f9cd45d02a018f5a1ecfe4c1268b306b6c76b17a330441c22453a41dd0d9
|
data/lib/frontapp/client.rb
CHANGED
@@ -37,8 +37,9 @@ module Frontapp
|
|
37
37
|
def initialize(options={})
|
38
38
|
auth_token = options[:auth_token]
|
39
39
|
@headers = HTTP.headers({
|
40
|
-
Accept
|
41
|
-
Authorization
|
40
|
+
"Accept" => "application/json",
|
41
|
+
"Authorization" => "Bearer #{auth_token}",
|
42
|
+
"Content-Type" => "multipart/form-data; boundary=----BoundaryString"
|
42
43
|
})
|
43
44
|
end
|
44
45
|
|
@@ -24,12 +24,13 @@ module Frontapp
|
|
24
24
|
# Allowed attributes:
|
25
25
|
# Name Type Description
|
26
26
|
# --------------------------------------------
|
27
|
-
# name
|
28
|
-
# description
|
29
|
-
# avatar_url
|
30
|
-
# is_spammer
|
31
|
-
# links
|
32
|
-
# group_names
|
27
|
+
# name string (optional) Contact name
|
28
|
+
# description string (optional) Contact description
|
29
|
+
# avatar_url string (optional) URL of the contact’s avatar
|
30
|
+
# is_spammer boolean (optional) Whether or not the contact is marked as a spammer
|
31
|
+
# links array (optional) List of all the links of the contact
|
32
|
+
# group_names array (optional) List of all the group names the contact belongs to. It will automatically create missing groups.
|
33
|
+
# custom_fields object (optional) Custom field attributes for this contact. Leave empty if you do not wish to update the attributes. Not sending existing attributes will automatically remove them.
|
33
34
|
# --------------------------------------------
|
34
35
|
def update_contact!(contact_id, params = {})
|
35
36
|
cleaned = params.permit(:name,
|
@@ -37,7 +38,8 @@ module Frontapp
|
|
37
38
|
:avatar_url,
|
38
39
|
:is_spammer,
|
39
40
|
:links,
|
40
|
-
:group_names
|
41
|
+
:group_names,
|
42
|
+
:custom_fields)
|
41
43
|
update("contacts/#{contact_id}", cleaned)
|
42
44
|
end
|
43
45
|
|
@@ -50,7 +52,8 @@ module Frontapp
|
|
50
52
|
# is_spammer boolean (optional) Whether or not the contact is marked as a spammer
|
51
53
|
# links array (optional) List of all the links of the contact
|
52
54
|
# group_names array (optional) List of all the group names the contact belongs to. It will automatically create missing groups.
|
53
|
-
# handles array List
|
55
|
+
# handles array List of the contact handles
|
56
|
+
# custom_fields object (optional) Custom field attributes for this contact. Leave empty if you do not wish to update the attributes. Not sending existing attributes will automatically remove them.
|
54
57
|
# --------------------------------------------
|
55
58
|
def create_contact!(params = {})
|
56
59
|
cleaned = params.permit(:name,
|
@@ -59,7 +62,8 @@ module Frontapp
|
|
59
62
|
:is_spammer,
|
60
63
|
:links,
|
61
64
|
:group_names,
|
62
|
-
:handles
|
65
|
+
:handles,
|
66
|
+
:custom_fields)
|
63
67
|
create("contacts", cleaned)
|
64
68
|
end
|
65
69
|
|
@@ -151,4 +155,4 @@ module Frontapp
|
|
151
155
|
|
152
156
|
end
|
153
157
|
end
|
154
|
-
end
|
158
|
+
end
|
@@ -25,6 +25,7 @@ module Frontapp
|
|
25
25
|
# subject string (optional) Subject of the message for email message
|
26
26
|
# body string Body of the message
|
27
27
|
# text string (optional) Text version of the body for messages with non-text body
|
28
|
+
# attachments array (optional) Binary data of the attached files. Available only for multipart request.
|
28
29
|
# options object (optional) Sending options
|
29
30
|
# options.tags array (optional) List of tag names to add to the conversation (unknown tags will automatically be created)
|
30
31
|
# options.archive boolean (optional) Archive the conversation right when sending the reply (Default: true)
|
@@ -38,6 +39,7 @@ module Frontapp
|
|
38
39
|
:subject,
|
39
40
|
:body,
|
40
41
|
:text,
|
42
|
+
:attachments,
|
41
43
|
{ options: [:tags, :archive] },
|
42
44
|
:to,
|
43
45
|
:cc,
|
@@ -59,6 +61,7 @@ module Frontapp
|
|
59
61
|
# subject string (optional) Subject of the message for email message
|
60
62
|
# body string Body of the message
|
61
63
|
# text string (optional) Text version of the body for messages with non-text body
|
64
|
+
# attachments array (optional) Binary data of the attached files. Available only for multipart request.
|
62
65
|
# options object (optional) Sending options
|
63
66
|
# options.tags array (optional) List of tag names to add to the conversation (unknown tags will automatically be created)
|
64
67
|
# options.archive boolean (optional) Archive the conversation right when sending the reply (Default: true)
|
@@ -73,6 +76,7 @@ module Frontapp
|
|
73
76
|
:subject,
|
74
77
|
:body,
|
75
78
|
:text,
|
79
|
+
:attachments,
|
76
80
|
{ options: [:tags, :archive] },
|
77
81
|
:channel_id,
|
78
82
|
:to,
|
@@ -97,6 +101,7 @@ module Frontapp
|
|
97
101
|
# subject string (optional) Subject of the message
|
98
102
|
# body string Body of the message
|
99
103
|
# body_format enum (optional) Format of the message body. (Default: 'markdown')
|
104
|
+
# attachments array (optional) Binary data of the attached files. Available only for multipart request.
|
100
105
|
# metadata object (optional)
|
101
106
|
# metadata.thread_ref string (optional) Custom reference which will be used to thread messages. If you ommit this field, we’ll thread by sender instead
|
102
107
|
# metadata.headers object (optional) Custom object where any internal information can be stored
|
@@ -106,6 +111,7 @@ module Frontapp
|
|
106
111
|
:subject,
|
107
112
|
:body,
|
108
113
|
:body_format,
|
114
|
+
:attachments,
|
109
115
|
{ metadata: [:thread_ref, :headers] })
|
110
116
|
create("channels/#{channel_id}/incoming_messages", cleaned)
|
111
117
|
end
|
@@ -129,6 +135,7 @@ module Frontapp
|
|
129
135
|
# subject string (optional) Subject of the message.
|
130
136
|
# body string Body of the message.
|
131
137
|
# body_format enum (optional) Format of the message body. Ignored if the message type is not email. (Default: 'markdown')
|
138
|
+
# attachments array (optional) Binary data of the attached files. Available only for multipart request.
|
132
139
|
# external_id string External identifier of the message. Front won’t import two messages with the same external ID.
|
133
140
|
# created_at number Date at which the message as been sent or received.
|
134
141
|
# type enum (optional) Type of the message to import. (Default: 'email')
|
@@ -148,6 +155,7 @@ module Frontapp
|
|
148
155
|
:subject,
|
149
156
|
:body,
|
150
157
|
:body_format,
|
158
|
+
:attachments,
|
151
159
|
:external_id,
|
152
160
|
:created_at,
|
153
161
|
:type,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frontapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niels van der Zanden
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|