peoplegroup-connectors 0.1.95 → 0.1.96
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/peoplegroup/connectors/slack.rb +34 -5
- data/lib/peoplegroup/connectors/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bf603701e7dc27da76fcc61f2a8a4047133e7933ea58ec0f2549efb1d709afe
|
4
|
+
data.tar.gz: 8e600b62d801d284c831fb69fd55430d9322594b355ce5a65fe1cca335c387ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abd0763536f8eeeb9769e8ee5c2996e27ea459194613ab3e8bb6db249feb9620fc0a283f01e791adb9ecb04638775dd75ff33a37fbc7a957dfd38dff5d449a76
|
7
|
+
data.tar.gz: 07d010c5b8c01fbcfa8e2bc84e741280034974ce4e7499027f488c2af4ea0b190bfbffe55a61073a6db3a673d24a5a23c41a4209ed4cac708821c732fe74e174
|
@@ -32,33 +32,62 @@ module PeopleGroup
|
|
32
32
|
nil
|
33
33
|
end
|
34
34
|
|
35
|
+
# https://www.rubydoc.info/gems/slack-ruby-client/0.17.0/Slack%2FWeb%2FApi%2FEndpoints%2FConversations:conversations_list
|
36
|
+
# Defaults to only show public channels.
|
35
37
|
def list_public_channels
|
36
|
-
|
37
|
-
channels.
|
38
|
+
response = @client.conversations_list(exclude_archived: true)
|
39
|
+
response['channels'].map { |channel| channel['name'] }
|
38
40
|
end
|
39
41
|
|
42
|
+
# https://www.rubydoc.info/gems/slack-ruby-client/0.17.0/Slack%2FWeb%2FApi%2FEndpoints%2FChat:chat_getPermalink
|
40
43
|
def link_for_message(channel:, timestamp:)
|
41
44
|
@client.chat_getPermalink(channel: channel, message_ts: timestamp)
|
42
45
|
end
|
43
46
|
|
47
|
+
# https://www.rubydoc.info/gems/slack-ruby-client/0.17.0/Slack%2FWeb%2FApi%2FEndpoints%2FChat:chat_postMessage
|
44
48
|
def send_message(channel:, text: '', as_user: true, attachments: [], thread_ts: nil, reply_broadcast: false, formatted_message: [])
|
45
|
-
|
49
|
+
options = {
|
50
|
+
channel: channel,
|
51
|
+
text: text,
|
52
|
+
as_user: true,
|
53
|
+
attachments: attachments,
|
54
|
+
unfurl_links: false,
|
55
|
+
thread_ts: thread_ts,
|
56
|
+
reply_broadcast: reply_broadcast,
|
57
|
+
blocks: formatted_message
|
58
|
+
}
|
59
|
+
|
60
|
+
@client.chat_postMessage(options)
|
46
61
|
end
|
47
62
|
|
63
|
+
# https://www.rubydoc.info/gems/slack-ruby-client/0.17.0/Slack%2FWeb%2FApi%2FEndpoints%2FChat:chat_update
|
48
64
|
def update_message(channel:, timestamp:, text: '', attachments: [], formatted_message: [])
|
49
|
-
|
65
|
+
options = {
|
66
|
+
channel: channel,
|
67
|
+
text: text,
|
68
|
+
ts: timestamp,
|
69
|
+
as_user: true,
|
70
|
+
attachments: attachments,
|
71
|
+
blocks: formatted_message
|
72
|
+
}
|
73
|
+
|
74
|
+
@client.chat_update(options)
|
50
75
|
end
|
51
76
|
|
77
|
+
# https://www.rubydoc.info/gems/slack-ruby-client/0.17.0/Slack%2FWeb%2FApi%2FEndpoints%2FViews:views_open
|
52
78
|
def send_modal_message(trigger:, view:)
|
53
79
|
@client.views_open(trigger_id: trigger, view: view)
|
54
80
|
end
|
55
81
|
|
82
|
+
# https://www.rubydoc.info/gems/slack-ruby-client/0.17.0/Slack%2FWeb%2FApi%2FEndpoints%2FViews:views_publish
|
56
83
|
def publish_view(user_id:, trigger:, view:)
|
57
84
|
@client.views_publish(user_id: user_id, trigger_id: trigger, view: view)
|
58
85
|
end
|
59
86
|
|
87
|
+
# https://www.rubydoc.info/gems/slack-ruby-client/0.17.0/Slack%2FWeb%2FApi%2FEndpoints%2FConversations:conversations_history
|
60
88
|
def get_message(channel:, timestamp:)
|
61
|
-
|
89
|
+
options = { channel: channel, latest: timestamp, limit: 1, inclusive: true }
|
90
|
+
@client.conversations_history(options)&.messages&.first
|
62
91
|
end
|
63
92
|
end
|
64
93
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peoplegroup-connectors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.96
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lien van den steen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0
|
47
|
+
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0
|
54
|
+
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: splinter-pto
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|