frontapp 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/frontapp/client.rb +2 -0
- data/lib/frontapp/client/conversations.rb +24 -1
- data/lib/frontapp/client/links.rb +64 -0
- data/lib/frontapp/client/topics.rb +4 -3
- data/lib/frontapp/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39e2a2ed37f421a9e27a5d093b6b8edfabefe858
|
4
|
+
data.tar.gz: 11239032440cc8d9d85fc008944180325ed8c0f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dcb5247a8e1efc3b367fe0f71852eb4c1676a7544446f640abe791d6c0b5b33c0f5ae26208d9f320ac9b95bd015b9f0ea2d08928952485f19eb1cf010b7f40e
|
7
|
+
data.tar.gz: 026dad6c0c6fd6ad2f5cfab7cf943f8dcf17174704f3f9b261e8ce4256eb41aeb3141c53017f53ad672bc1400233d39fb5f47031d642183a8e8cf18f02cb0ffe
|
data/lib/frontapp/client.rb
CHANGED
@@ -15,6 +15,7 @@ require_relative 'client/tags.rb'
|
|
15
15
|
require_relative 'client/teammates.rb'
|
16
16
|
require_relative 'client/teams.rb'
|
17
17
|
require_relative 'client/topics.rb'
|
18
|
+
require_relative 'client/links.rb'
|
18
19
|
require_relative 'client/exports.rb'
|
19
20
|
require_relative 'error'
|
20
21
|
require_relative 'version'
|
@@ -36,6 +37,7 @@ module Frontapp
|
|
36
37
|
include Frontapp::Client::Teammates
|
37
38
|
include Frontapp::Client::Teams
|
38
39
|
include Frontapp::Client::Topics
|
40
|
+
include Frontapp::Client::Links
|
39
41
|
include Frontapp::Client::Exports
|
40
42
|
|
41
43
|
def initialize(options={})
|
@@ -70,6 +70,29 @@ module Frontapp
|
|
70
70
|
def get_conversation_messages(conversation_id)
|
71
71
|
list("conversations/#{conversation_id}/messages")
|
72
72
|
end
|
73
|
+
|
74
|
+
# Parameters
|
75
|
+
# Name Type Description
|
76
|
+
# ----------------------------------------------
|
77
|
+
# conversation_id string The conversation Id
|
78
|
+
# link_ids array (optional) Link IDs to add Either link_ids or link_external_urls must be specified but not both
|
79
|
+
# link_external_urls array (optional) Link external urls to add. Creates links if necessary. Either link_ids or link_external_urls must be specified but not both
|
80
|
+
# ----------------------------------------------
|
81
|
+
def add_conversation_links!(conversation_id, params = {})
|
82
|
+
cleaned = params.permit(:link_ids, :link_external_urls)
|
83
|
+
create_without_response("conversations/#{conversation_id}/links", cleaned)
|
84
|
+
end
|
85
|
+
|
86
|
+
# Parameters
|
87
|
+
# Name Type Description
|
88
|
+
# ----------------------------------------------
|
89
|
+
# conversation_id string The conversation Id
|
90
|
+
# link_ids array of strings link IDs to remove
|
91
|
+
# ----------------------------------------------
|
92
|
+
def remove_conversation_links!(conversation_id, params = {})
|
93
|
+
cleaned = params.permit(:link_ids)
|
94
|
+
delete("conversations/#{conversation_id}/links", cleaned)
|
95
|
+
end
|
73
96
|
end
|
74
97
|
end
|
75
|
-
end
|
98
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module Frontapp
|
2
|
+
class Client
|
3
|
+
module Links
|
4
|
+
|
5
|
+
def links(params = {})
|
6
|
+
cleaned = params.permit({ q: [:statuses] })
|
7
|
+
list("links", cleaned)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Parameters
|
11
|
+
# Name Type Description
|
12
|
+
# -------------------------------
|
13
|
+
# link_id string Id of the requested link
|
14
|
+
# -------------------------------
|
15
|
+
def get_link(link_id)
|
16
|
+
get("links/#{link_id}")
|
17
|
+
end
|
18
|
+
|
19
|
+
# Allowed attributes:
|
20
|
+
# Name Type Description
|
21
|
+
# ------------------------------------
|
22
|
+
# name string (optional) Name of the link. If none is specified, the external_url is used as a default
|
23
|
+
# external_url string Underlying identifying link/url of the link
|
24
|
+
# ------------------------------------
|
25
|
+
def create_link!(params = {})
|
26
|
+
cleaned = params.permit(:name, :external_url)
|
27
|
+
create("links", cleaned)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Parameters
|
31
|
+
# Name Type Description
|
32
|
+
# -----------------------------
|
33
|
+
# link_id string Id of the requested link
|
34
|
+
# -----------------------------
|
35
|
+
#
|
36
|
+
# Allowed attributes:
|
37
|
+
# Name Type Description
|
38
|
+
# ------------------------------------
|
39
|
+
# name string New name of the link
|
40
|
+
# ------------------------------------
|
41
|
+
def update_link!(link_id, params = {})
|
42
|
+
cleaned = params.permit(:name)
|
43
|
+
update("links/#{link_id}", cleaned)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Parameters
|
47
|
+
# Name Type Description
|
48
|
+
# -----------------------------
|
49
|
+
# link_id string Id of the requested link
|
50
|
+
# -----------------------------
|
51
|
+
#
|
52
|
+
# Allowed params:
|
53
|
+
# Name Type Description
|
54
|
+
# ------------------------------------------
|
55
|
+
# q object (optional) Search query.
|
56
|
+
# q.statuses array (optional) List of the statuses of the conversations you want to list
|
57
|
+
# ------------------------------------------
|
58
|
+
def get_link_conversations(link_id, params = {})
|
59
|
+
cleaned = params.permit({ q: [:statuses] })
|
60
|
+
list("links/#{link_id}/conversations", cleaned)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -15,9 +15,10 @@ module Frontapp
|
|
15
15
|
# q.statuses array (optional) List of the statuses of the conversations you want to list
|
16
16
|
# ------------------------------------------
|
17
17
|
def get_topic_conversations(topic_id, params = {})
|
18
|
-
|
19
|
-
|
18
|
+
warn "[DEPRECATION] `Topics` is deprecated. Please use `Links` instead."
|
19
|
+
|
20
|
+
get_link_conversations(topic_id, params)
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
23
|
-
end
|
24
|
+
end
|
data/lib/frontapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niels van der Zanden
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- lib/frontapp/client/events.rb
|
84
84
|
- lib/frontapp/client/exports.rb
|
85
85
|
- lib/frontapp/client/inboxes.rb
|
86
|
+
- lib/frontapp/client/links.rb
|
86
87
|
- lib/frontapp/client/messages.rb
|
87
88
|
- lib/frontapp/client/rules.rb
|
88
89
|
- lib/frontapp/client/tags.rb
|