slack-ruby-client 0.15.1 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +0 -14
- data/.travis.yml +1 -4
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTING.md +3 -10
- data/README.md +9 -27
- data/UPGRADING.md +14 -2
- data/bin/commands.rb +7 -0
- data/bin/commands/admin_analytics.rb +15 -0
- data/bin/commands/admin_apps.rb +15 -2
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +154 -2
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +4 -4
- data/bin/commands/admin_conversations_whitelist.rb +1 -1
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_usergroups.rb +2 -2
- data/bin/commands/admin_users.rb +2 -2
- data/bin/commands/admin_users_session.rb +22 -0
- data/bin/commands/api.rb +0 -1
- data/bin/commands/apps_connections.rb +13 -0
- data/bin/commands/apps_event_authorizations.rb +16 -0
- data/bin/commands/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +1 -0
- data/bin/commands/channels.rb +6 -3
- data/bin/commands/chat.rb +4 -4
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +14 -2
- data/bin/commands/dnd.rb +1 -1
- data/bin/commands/files.rb +6 -5
- data/bin/commands/files_remote.rb +2 -2
- data/bin/commands/groups.rb +5 -3
- data/bin/commands/im.rb +1 -1
- data/bin/commands/migration.rb +1 -0
- data/bin/commands/mpim.rb +3 -3
- data/bin/commands/pins.rb +0 -2
- data/bin/commands/reactions.rb +1 -0
- data/bin/commands/search.rb +4 -1
- data/bin/commands/team.rb +3 -0
- data/bin/commands/usergroups.rb +6 -1
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users.rb +5 -3
- data/bin/commands/users_profile.rb +5 -5
- data/bin/commands/views.rb +1 -1
- data/bin/commands/workflows.rb +38 -0
- data/lib/slack-ruby-client.rb +2 -0
- data/lib/slack/events/request.rb +5 -1
- data/lib/slack/real_time/client.rb +0 -1
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/config.rb +5 -4
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +14 -0
- data/lib/slack/web/api/endpoints/admin_analytics.rb +26 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +22 -2
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +231 -1
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +4 -6
- data/lib/slack/web/api/endpoints/admin_users_session.rb +38 -0
- data/lib/slack/web/api/endpoints/api.rb +0 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +2 -0
- data/lib/slack/web/api/endpoints/channels.rb +9 -3
- data/lib/slack/web/api/endpoints/chat.rb +3 -3
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -0
- data/lib/slack/web/api/endpoints/conversations.rb +21 -1
- data/lib/slack/web/api/endpoints/files.rb +4 -2
- data/lib/slack/web/api/endpoints/files_remote.rb +2 -2
- data/lib/slack/web/api/endpoints/groups.rb +7 -3
- data/lib/slack/web/api/endpoints/im.rb +1 -1
- data/lib/slack/web/api/endpoints/migration.rb +2 -0
- data/lib/slack/web/api/endpoints/mpim.rb +3 -3
- data/lib/slack/web/api/endpoints/pins.rb +0 -5
- data/lib/slack/web/api/endpoints/reactions.rb +2 -0
- data/lib/slack/web/api/endpoints/search.rb +6 -0
- data/lib/slack/web/api/endpoints/team.rb +6 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
- data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
- data/lib/slack/web/api/endpoints/users.rb +7 -5
- data/lib/slack/web/api/endpoints/users_profile.rb +3 -3
- data/lib/slack/web/api/endpoints/views.rb +1 -1
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/errors.rb +194 -0
- data/lib/slack/web/api/errors/internal_error.rb +14 -0
- data/lib/slack/web/api/templates/endpoints.erb +1 -0
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/faraday/connection.rb +1 -1
- data/lib/slack/web/faraday/response/raise_error.rb +16 -1
- data/lib/slack/web/faraday/response/wrap_error.rb +18 -0
- data/lib/tasks/web.rake +7 -3
- data/spec/slack/events/request_spec.rb +7 -3
- data/spec/slack/real_time/client_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +5 -5
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
- data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +5 -5
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
- data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/conversations_spec.rb +20 -12
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/im_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/mpim_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/oauth_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/client_spec.rb +56 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +7 -6
- metadata +32 -19
- data/examples/hi_real_time/Gemfile +0 -6
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -41
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
- data/examples/hi_real_time_async_celluloid/Procfile +0 -2
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
@@ -6,6 +6,44 @@ module Slack
|
|
6
6
|
module Api
|
7
7
|
module Endpoints
|
8
8
|
module AdminUsersSession
|
9
|
+
#
|
10
|
+
# Revoke a single session for a user. The user will be forced to login to Slack.
|
11
|
+
#
|
12
|
+
# @option options [Object] :session_id
|
13
|
+
# ID of the session to invalidate.
|
14
|
+
# @option options [Object] :team_id
|
15
|
+
# ID of the workspace that the session belongs to.
|
16
|
+
# @see https://api.slack.com/methods/admin.users.session.invalidate
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.invalidate.json
|
18
|
+
def admin_users_session_invalidate(options = {})
|
19
|
+
throw ArgumentError.new('Required arguments :session_id missing') if options[:session_id].nil?
|
20
|
+
throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
|
21
|
+
post('admin.users.session.invalidate', options)
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# List active user sessions for an organization
|
26
|
+
#
|
27
|
+
# @option options [Object] :cursor
|
28
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
29
|
+
# @option options [Object] :limit
|
30
|
+
# The maximum number of items to return. Must be between 1 - 1000 both inclusive.
|
31
|
+
# @option options [Object] :team_id
|
32
|
+
# The ID of the workspace you'd like active sessions for. If you pass a team_id, you'll need to pass a user_id as well.
|
33
|
+
# @option options [Object] :user_id
|
34
|
+
# The ID of user you'd like active sessions for. If you pass a user_id, you'll need to pass a team_id as well.
|
35
|
+
# @see https://api.slack.com/methods/admin.users.session.list
|
36
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.users.session/admin.users.session.list.json
|
37
|
+
def admin_users_session_list(options = {})
|
38
|
+
if block_given?
|
39
|
+
Pagination::Cursor.new(self, :admin_users_session_list, options).each do |page|
|
40
|
+
yield page
|
41
|
+
end
|
42
|
+
else
|
43
|
+
post('admin.users.session.list', options)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
9
47
|
#
|
10
48
|
# Wipes all valid sessions on all devices for a given user
|
11
49
|
#
|
@@ -11,8 +11,6 @@ module Slack
|
|
11
11
|
#
|
12
12
|
# @option options [Object] :error
|
13
13
|
# Error response to return.
|
14
|
-
# @option options [Object] :foo
|
15
|
-
# example property to return.
|
16
14
|
# @see https://api.slack.com/methods/api.test
|
17
15
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/api/api.test.json
|
18
16
|
def api_test(options = {})
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AppsConnections
|
9
|
+
#
|
10
|
+
# Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over,
|
11
|
+
#
|
12
|
+
# @see https://api.slack.com/methods/apps.connections.open
|
13
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.connections/apps.connections.open.json
|
14
|
+
def apps_connections_open(options = {})
|
15
|
+
post('apps.connections.open', options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AppsEventAuthorizations
|
9
|
+
#
|
10
|
+
# Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.
|
11
|
+
#
|
12
|
+
# @option options [Object] :event_context
|
13
|
+
# .
|
14
|
+
# @option options [Object] :cursor
|
15
|
+
# .
|
16
|
+
# @option options [Object] :limit
|
17
|
+
# .
|
18
|
+
# @see https://api.slack.com/methods/apps.event.authorizations.list
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.event.authorizations/apps.event.authorizations.list.json
|
20
|
+
def apps_event_authorizations_list(options = {})
|
21
|
+
throw ArgumentError.new('Required arguments :event_context missing') if options[:event_context].nil?
|
22
|
+
if block_given?
|
23
|
+
Pagination::Cursor.new(self, :apps_event_authorizations_list, options).each do |page|
|
24
|
+
yield page
|
25
|
+
end
|
26
|
+
else
|
27
|
+
post('apps.event.authorizations.list', options)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
module Slack
|
5
|
+
module Web
|
6
|
+
module Api
|
7
|
+
module Endpoints
|
8
|
+
module AuthTeams
|
9
|
+
#
|
10
|
+
# List the workspaces a token can access.
|
11
|
+
#
|
12
|
+
# @option options [Object] :cursor
|
13
|
+
# Set cursor to next_cursor returned by the previous call to list items in the next page.
|
14
|
+
# @option options [Object] :include_icon
|
15
|
+
# Whether to return icon paths for each workspace. An icon path represents a URI pointing to the image signifying the workspace.
|
16
|
+
# @option options [Object] :limit
|
17
|
+
# The maximum number of workspaces to return. Must be a positive integer no larger than 1000.
|
18
|
+
# @see https://api.slack.com/methods/auth.teams.list
|
19
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/auth.teams/auth.teams.list.json
|
20
|
+
def auth_teams_list(options = {})
|
21
|
+
if block_given?
|
22
|
+
Pagination::Cursor.new(self, :auth_teams_list, options).each do |page|
|
23
|
+
yield page
|
24
|
+
end
|
25
|
+
else
|
26
|
+
post('auth.teams.list', options)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -11,6 +11,8 @@ module Slack
|
|
11
11
|
#
|
12
12
|
# @option options [Object] :bot
|
13
13
|
# Bot user to get info on.
|
14
|
+
# @option options [Object] :team_id
|
15
|
+
# encoded team id or enterprise id where the bot exists, required if org token is used.
|
14
16
|
# @see https://api.slack.com/methods/bots.info
|
15
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/bots/bots.info.json
|
16
18
|
def bots_info(options = {})
|
@@ -25,6 +25,8 @@ module Slack
|
|
25
25
|
#
|
26
26
|
# @option options [Object] :name
|
27
27
|
# Name of channel to create.
|
28
|
+
# @option options [Object] :team_id
|
29
|
+
# encoded team id to create the channel in, required if org token is used.
|
28
30
|
# @option options [Object] :validate
|
29
31
|
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
|
30
32
|
# @see https://api.slack.com/methods/channels.create
|
@@ -109,6 +111,8 @@ module Slack
|
|
109
111
|
#
|
110
112
|
# @option options [Object] :name
|
111
113
|
# Name of channel to join.
|
114
|
+
# @option options [Object] :team_id
|
115
|
+
# encoded team id to list channels in, required if org token is used.
|
112
116
|
# @option options [Object] :validate
|
113
117
|
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
|
114
118
|
# @see https://api.slack.com/methods/channels.join
|
@@ -162,6 +166,8 @@ module Slack
|
|
162
166
|
# Exclude the members collection from each channel.
|
163
167
|
# @option options [Object] :limit
|
164
168
|
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached.
|
169
|
+
# @option options [Object] :team_id
|
170
|
+
# encoded team id to list channels in, required if org token is used.
|
165
171
|
# @see https://api.slack.com/methods/channels.list
|
166
172
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.list.json
|
167
173
|
def channels_list(options = {})
|
@@ -179,16 +185,16 @@ module Slack
|
|
179
185
|
# Sets the read cursor in a channel.
|
180
186
|
#
|
181
187
|
# @option options [channel] :channel
|
182
|
-
# Channel to set
|
188
|
+
# Channel or conversation to set the read cursor for.
|
183
189
|
# @option options [timestamp] :ts
|
184
|
-
#
|
190
|
+
# Unique identifier of message you want marked as most recently seen in this conversation.
|
185
191
|
# @see https://api.slack.com/methods/channels.mark
|
186
192
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/channels/channels.mark.json
|
187
193
|
def channels_mark(options = {})
|
188
194
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
189
195
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
190
196
|
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
191
|
-
logger.warn('channels.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
|
197
|
+
logger.warn('channels.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.mark.')
|
192
198
|
post('channels.mark', options)
|
193
199
|
end
|
194
200
|
|
@@ -154,9 +154,9 @@ module Slack
|
|
154
154
|
# @option options [Object] :blocks
|
155
155
|
# A JSON-based array of structured blocks, presented as a URL-encoded string.
|
156
156
|
# @option options [Object] :icon_emoji
|
157
|
-
# Emoji to use as the icon for this message. Overrides icon_url.
|
157
|
+
# Emoji to use as the icon for this message. Overrides icon_url. See authorship below. Use with bot tokens requires chat:write.customize.
|
158
158
|
# @option options [Object] :icon_url
|
159
|
-
# URL to an image to use as the icon for this message.
|
159
|
+
# URL to an image to use as the icon for this message. See authorship below. Use with bot tokens requires chat:write.customize.
|
160
160
|
# @option options [Object] :link_names
|
161
161
|
# Find and link channel names and usernames.
|
162
162
|
# @option options [Object] :mrkdwn
|
@@ -172,7 +172,7 @@ module Slack
|
|
172
172
|
# @option options [Object] :unfurl_media
|
173
173
|
# Pass false to disable unfurling of media content.
|
174
174
|
# @option options [Object] :username
|
175
|
-
# Set your bot's user name.
|
175
|
+
# Set your bot's user name. See authorship below. Use with bot tokens requires chat:write.customize.
|
176
176
|
# @see https://api.slack.com/methods/chat.postMessage
|
177
177
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
|
178
178
|
def chat_postMessage(options = {})
|
@@ -19,6 +19,8 @@ module Slack
|
|
19
19
|
# Maximum number of original entries to return.
|
20
20
|
# @option options [timestamp] :oldest
|
21
21
|
# A UNIX timestamp of the oldest value in the time range.
|
22
|
+
# @option options [Object] :team_id
|
23
|
+
# encoded team id to list channels in, required if org token is used.
|
22
24
|
# @see https://api.slack.com/methods/chat.scheduledMessages.list
|
23
25
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat.scheduledMessages/chat.scheduledMessages.list.json
|
24
26
|
def chat_scheduledMessages_list(options = {})
|
@@ -39,6 +39,8 @@ module Slack
|
|
39
39
|
# Name of the public or private channel to create.
|
40
40
|
# @option options [Object] :is_private
|
41
41
|
# Create a private channel instead of a public one.
|
42
|
+
# @option options [Object] :team_id
|
43
|
+
# encoded team id to create the channel in, required if org token is used.
|
42
44
|
# @see https://api.slack.com/methods/conversations.create
|
43
45
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.create.json
|
44
46
|
def conversations_create(options = {})
|
@@ -160,6 +162,8 @@ module Slack
|
|
160
162
|
# Set to true to exclude archived channels from the list.
|
161
163
|
# @option options [Object] :limit
|
162
164
|
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000.
|
165
|
+
# @option options [Object] :team_id
|
166
|
+
# encoded team id to list channels in, required if org token is used.
|
163
167
|
# @option options [Object] :types
|
164
168
|
# Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.
|
165
169
|
# @see https://api.slack.com/methods/conversations.list
|
@@ -174,6 +178,22 @@ module Slack
|
|
174
178
|
end
|
175
179
|
end
|
176
180
|
|
181
|
+
#
|
182
|
+
# Sets the read cursor in a channel.
|
183
|
+
#
|
184
|
+
# @option options [channel] :channel
|
185
|
+
# Channel or conversation to set the read cursor for.
|
186
|
+
# @option options [timestamp] :ts
|
187
|
+
# Unique identifier of message you want marked as most recently seen in this conversation.
|
188
|
+
# @see https://api.slack.com/methods/conversations.mark
|
189
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/conversations/conversations.mark.json
|
190
|
+
def conversations_mark(options = {})
|
191
|
+
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
192
|
+
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
193
|
+
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
194
|
+
post('conversations.mark', options)
|
195
|
+
end
|
196
|
+
|
177
197
|
#
|
178
198
|
# Retrieve members of a conversation.
|
179
199
|
#
|
@@ -235,7 +255,7 @@ module Slack
|
|
235
255
|
# @option options [channel] :channel
|
236
256
|
# Conversation ID to fetch thread from.
|
237
257
|
# @option options [timestamp] :ts
|
238
|
-
# Unique identifier of a thread's parent message.
|
258
|
+
# Unique identifier of a thread's parent message. ts must be the timestamp of an existing message with 0 or more replies. If there are no replies then just the single message referenced by ts will return - it is just an ordinary, unthreaded message.
|
239
259
|
# @option options [Object] :cursor
|
240
260
|
# Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first "page" of the collection. See pagination for more detail.
|
241
261
|
# @option options [Object] :inclusive
|
@@ -36,7 +36,7 @@ module Slack
|
|
36
36
|
end
|
37
37
|
|
38
38
|
#
|
39
|
-
# Gets information about a
|
39
|
+
# Gets information about a file.
|
40
40
|
#
|
41
41
|
# @option options [file] :file
|
42
42
|
# Specify a file by providing its ID.
|
@@ -58,12 +58,14 @@ module Slack
|
|
58
58
|
end
|
59
59
|
|
60
60
|
#
|
61
|
-
#
|
61
|
+
# List for a team, in a channel, or from a user with applied filters.
|
62
62
|
#
|
63
63
|
# @option options [channel] :channel
|
64
64
|
# Filter files appearing in a specific channel, indicated by its ID.
|
65
65
|
# @option options [Object] :show_files_hidden_by_limit
|
66
66
|
# Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.
|
67
|
+
# @option options [Object] :team_id
|
68
|
+
# encoded team id to list files in, required if org token is used.
|
67
69
|
# @option options [Object] :ts_from
|
68
70
|
# Filter files created after this timestamp (inclusive).
|
69
71
|
# @option options [Object] :ts_to
|
@@ -88,9 +88,9 @@ module Slack
|
|
88
88
|
# @option options [Object] :channels
|
89
89
|
# Comma-separated list of channel IDs where the file will be shared.
|
90
90
|
# @option options [Object] :external_id
|
91
|
-
#
|
91
|
+
# The globally unique identifier (GUID) for the file, as set by the app registering the file with Slack. Either this field or file or both are required.
|
92
92
|
# @option options [file] :file
|
93
|
-
# Specify a file by providing its ID.
|
93
|
+
# Specify a file registered with Slack by providing its ID. Either this field or external_id or both are required.
|
94
94
|
# @see https://api.slack.com/methods/files.remote.share
|
95
95
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/files.remote/files.remote.share.json
|
96
96
|
def files_remote_share(options = {})
|
@@ -25,6 +25,8 @@ module Slack
|
|
25
25
|
#
|
26
26
|
# @option options [Object] :name
|
27
27
|
# Name of private channel to create.
|
28
|
+
# @option options [Object] :team_id
|
29
|
+
# encoded team id to create the channel in, required if org token is used.
|
28
30
|
# @option options [Object] :validate
|
29
31
|
# Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.
|
30
32
|
# @see https://api.slack.com/methods/groups.create
|
@@ -148,6 +150,8 @@ module Slack
|
|
148
150
|
# Exclude the members from each group.
|
149
151
|
# @option options [Object] :limit
|
150
152
|
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.
|
153
|
+
# @option options [Object] :team_id
|
154
|
+
# encoded team id to list channels in, required if org token is used.
|
151
155
|
# @see https://api.slack.com/methods/groups.list
|
152
156
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.list.json
|
153
157
|
def groups_list(options = {})
|
@@ -165,16 +169,16 @@ module Slack
|
|
165
169
|
# Sets the read cursor in a private channel.
|
166
170
|
#
|
167
171
|
# @option options [group] :channel
|
168
|
-
#
|
172
|
+
# Channel or conversation to set the read cursor for.
|
169
173
|
# @option options [timestamp] :ts
|
170
|
-
#
|
174
|
+
# Unique identifier of message you want marked as most recently seen in this conversation.
|
171
175
|
# @see https://api.slack.com/methods/groups.mark
|
172
176
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/groups/groups.mark.json
|
173
177
|
def groups_mark(options = {})
|
174
178
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
175
179
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
176
180
|
options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]
|
177
|
-
logger.warn('groups.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
|
181
|
+
logger.warn('groups.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.mark.')
|
178
182
|
post('groups.mark', options)
|
179
183
|
end
|
180
184
|
|
@@ -75,7 +75,7 @@ module Slack
|
|
75
75
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
76
76
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
77
77
|
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
78
|
-
logger.warn('im.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
|
78
|
+
logger.warn('im.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.mark.')
|
79
79
|
post('im.mark', options)
|
80
80
|
end
|
81
81
|
|
@@ -11,6 +11,8 @@ module Slack
|
|
11
11
|
#
|
12
12
|
# @option options [Object] :users
|
13
13
|
# A comma-separated list of user ids, up to 400 per request.
|
14
|
+
# @option options [Object] :team_id
|
15
|
+
# Specify team_id starts with T in case of Org Token.
|
14
16
|
# @option options [Object] :to_old
|
15
17
|
# Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.
|
16
18
|
# @see https://api.slack.com/methods/migration.exchange
|
@@ -66,16 +66,16 @@ module Slack
|
|
66
66
|
# Sets the read cursor in a multiparty direct message channel.
|
67
67
|
#
|
68
68
|
# @option options [channel] :channel
|
69
|
-
#
|
69
|
+
# Channel or conversation to set the read cursor for.
|
70
70
|
# @option options [timestamp] :ts
|
71
|
-
#
|
71
|
+
# Unique identifier of message you want marked as most recently seen in this conversation.
|
72
72
|
# @see https://api.slack.com/methods/mpim.mark
|
73
73
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/mpim/mpim.mark.json
|
74
74
|
def mpim_mark(options = {})
|
75
75
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
76
76
|
throw ArgumentError.new('Required arguments :ts missing') if options[:ts].nil?
|
77
77
|
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
78
|
-
logger.warn('mpim.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: .')
|
78
|
+
logger.warn('mpim.mark: This method is deprecated. It will stop functioning in February 2021 and will not work with newly created apps after June 10th, 2020. Alternative methods: conversations.mark.')
|
79
79
|
post('mpim.mark', options)
|
80
80
|
end
|
81
81
|
|
@@ -17,7 +17,6 @@ module Slack
|
|
17
17
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/pins/pins.add.json
|
18
18
|
def pins_add(options = {})
|
19
19
|
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
20
|
-
throw ArgumentError.new('Required arguments :timestamp missing') if options[:timestamp].nil?
|
21
20
|
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
22
21
|
post('pins.add', options)
|
23
22
|
end
|
@@ -40,10 +39,6 @@ module Slack
|
|
40
39
|
#
|
41
40
|
# @option options [channel] :channel
|
42
41
|
# Channel where the item is pinned to.
|
43
|
-
# @option options [file] :file
|
44
|
-
# File to un-pin.
|
45
|
-
# @option options [Object] :file_comment
|
46
|
-
# File comment to un-pin.
|
47
42
|
# @option options [Object] :timestamp
|
48
43
|
# Timestamp of the message to un-pin.
|
49
44
|
# @see https://api.slack.com/methods/pins.remove
|
@@ -54,6 +54,8 @@ module Slack
|
|
54
54
|
# If true always return the complete reaction list.
|
55
55
|
# @option options [Object] :limit
|
56
56
|
# The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached.
|
57
|
+
# @option options [Object] :team_id
|
58
|
+
# encoded team id to list reactions in, required if org token is used.
|
57
59
|
# @option options [user] :user
|
58
60
|
# Show reactions made by this user. Defaults to the authed user.
|
59
61
|
# @see https://api.slack.com/methods/reactions.list
|
@@ -17,6 +17,8 @@ module Slack
|
|
17
17
|
# Return matches sorted by either score or timestamp.
|
18
18
|
# @option options [Object] :sort_dir
|
19
19
|
# Change sort direction to ascending (asc) or descending (desc).
|
20
|
+
# @option options [Object] :team_id
|
21
|
+
# encoded team id to search in, required if org token is used.
|
20
22
|
# @see https://api.slack.com/methods/search.all
|
21
23
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.all.json
|
22
24
|
def search_all(options = {})
|
@@ -35,6 +37,8 @@ module Slack
|
|
35
37
|
# Return matches sorted by either score or timestamp.
|
36
38
|
# @option options [Object] :sort_dir
|
37
39
|
# Change sort direction to ascending (asc) or descending (desc).
|
40
|
+
# @option options [Object] :team_id
|
41
|
+
# encoded team id to search in, required if org token is used.
|
38
42
|
# @see https://api.slack.com/methods/search.files
|
39
43
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.files.json
|
40
44
|
def search_files(options = {})
|
@@ -53,6 +57,8 @@ module Slack
|
|
53
57
|
# Return matches sorted by either score or timestamp.
|
54
58
|
# @option options [Object] :sort_dir
|
55
59
|
# Change sort direction to ascending (asc) or descending (desc).
|
60
|
+
# @option options [Object] :team_id
|
61
|
+
# encoded team id to search in, required if org token is used.
|
56
62
|
# @see https://api.slack.com/methods/search.messages
|
57
63
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/search/search.messages.json
|
58
64
|
def search_messages(options = {})
|