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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0be7c675b0111f44ac068ea7760213db4a1185f274ee5ce7013cb7d2523c9da
4
- data.tar.gz: 9f476d18190ea653d7ea95fc94ca2ab09a694825e08d6d0bd754d9fdcd065e9d
3
+ metadata.gz: 8bf603701e7dc27da76fcc61f2a8a4047133e7933ea58ec0f2549efb1d709afe
4
+ data.tar.gz: 8e600b62d801d284c831fb69fd55430d9322594b355ce5a65fe1cca335c387ff
5
5
  SHA512:
6
- metadata.gz: 919075595ea9748646157b40c678d460f33ce644281766815366f8f4917299afcb783cfd037ab9a8901bf3e61cf4c3ad555d6d53c7542cb1b6ad8de2aad92c98
7
- data.tar.gz: 46eb40d8499e675bced2e0b84a71a93c849174fc81d9a328cb36a6df668af561a3794864f9d3410bc85e8bad102f873a0f2523ebfcff4ab49eab0acc13982ea0
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
- channels = @client.channels_list(exclude_archived: true).channels
37
- channels.reject(&:is_private)&.map(:name)
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
- @client.chat_postMessage(channel: channel, text: text, as_user: true, attachments: attachments, unfurl_links: false, thread_ts: thread_ts, reply_broadcast: reply_broadcast, blocks: formatted_message)
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
- @client.chat_update(channel: channel, text: text, ts: timestamp, as_user: true, attachments: attachments, blocks: formatted_message)
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
- @client.conversations_history(channel: channel, latest: timestamp, limit: 1, inclusive: true)&.messages&.first
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PeopleGroup
4
4
  module Connectors
5
- VERSION = '0.1.95'
5
+ VERSION = '0.1.96'
6
6
  end
7
7
  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.95
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-30 00:00:00.000000000 Z
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.14'
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.14'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: splinter-pto
57
57
  requirement: !ruby/object:Gem::Requirement