slack-ruby-client 0.14.5 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.rubocop.yml +11 -3
- data/.rubocop_todo.yml +61 -23
- data/.travis.yml +1 -5
- data/CHANGELOG.md +43 -4
- data/CONTRIBUTING.md +17 -6
- data/Dangerfile +1 -1
- data/Gemfile +1 -2
- data/LICENSE.md +1 -1
- data/README.md +86 -52
- data/UPGRADING.md +20 -2
- data/bin/commands.rb +23 -0
- data/bin/commands/admin_analytics.rb +16 -0
- data/bin/commands/admin_apps.rb +15 -2
- data/bin/commands/admin_apps_approved.rb +17 -0
- data/bin/commands/admin_apps_restricted.rb +17 -0
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +159 -0
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
- data/bin/commands/admin_conversations_whitelist.rb +37 -0
- data/bin/commands/admin_emoji.rb +54 -0
- data/bin/commands/admin_inviteRequests.rb +36 -0
- data/bin/commands/admin_inviteRequests_approved.rb +16 -0
- data/bin/commands/admin_inviteRequests_denied.rb +16 -0
- data/bin/commands/admin_teams.rb +27 -0
- data/bin/commands/admin_teams_admins.rb +16 -0
- data/bin/commands/admin_teams_owners.rb +16 -0
- data/bin/commands/admin_teams_settings.rb +64 -0
- data/bin/commands/admin_usergroups.rb +48 -0
- data/bin/commands/admin_users.rb +97 -0
- 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/calls.rb +52 -0
- data/bin/commands/calls_participants.rb +25 -0
- data/bin/commands/channels.rb +1 -155
- data/bin/commands/chat.rb +14 -12
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +15 -4
- data/bin/commands/dnd.rb +3 -1
- data/bin/commands/files.rb +7 -5
- data/bin/commands/files_remote.rb +3 -3
- data/bin/commands/groups.rb +1 -162
- data/bin/commands/im.rb +1 -63
- data/bin/commands/migration.rb +1 -0
- data/bin/commands/mpim.rb +1 -61
- data/bin/commands/oauth.rb +1 -1
- 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 +5 -4
- data/lib/slack/events/request.rb +7 -3
- data/lib/slack/messages/message.rb +0 -4
- data/lib/slack/real_time/client.rb +2 -1
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/concurrency/async.rb +1 -3
- data/lib/slack/real_time/config.rb +5 -14
- data/lib/slack/real_time/models/base.rb +0 -4
- data/lib/slack/real_time/socket.rb +2 -2
- data/lib/slack/real_time/stores/base.rb +3 -1
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +47 -0
- data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +22 -2
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +246 -0
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +161 -0
- 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/calls.rb +83 -0
- data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
- data/lib/slack/web/api/endpoints/channels.rb +1 -245
- data/lib/slack/web/api/endpoints/chat.rb +23 -19
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -1
- data/lib/slack/web/api/endpoints/conversations.rb +37 -19
- data/lib/slack/web/api/endpoints/dnd.rb +4 -0
- data/lib/slack/web/api/endpoints/files.rb +8 -4
- data/lib/slack/web/api/endpoints/files_remote.rb +4 -4
- data/lib/slack/web/api/endpoints/groups.rb +0 -253
- data/lib/slack/web/api/endpoints/im.rb +0 -101
- data/lib/slack/web/api/endpoints/migration.rb +2 -0
- data/lib/slack/web/api/endpoints/mpim.rb +0 -96
- data/lib/slack/web/api/endpoints/oauth.rb +1 -4
- data/lib/slack/web/api/endpoints/pins.rb +3 -8
- data/lib/slack/web/api/endpoints/reactions.rb +5 -3
- data/lib/slack/web/api/endpoints/search.rb +6 -0
- data/lib/slack/web/api/endpoints/stars.rb +2 -2
- 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 +848 -0
- data/lib/slack/web/api/errors/internal_error.rb +14 -0
- data/lib/slack/web/api/errors/slack_error.rb +12 -0
- data/lib/slack/web/api/mixins.rb +1 -0
- data/lib/slack/web/api/mixins/channels.id.rb +1 -3
- data/lib/slack/web/api/mixins/conversations.id.rb +25 -0
- data/lib/slack/web/api/mixins/groups.id.rb +1 -3
- data/lib/slack/web/api/mixins/ids.id.rb +3 -5
- data/lib/slack/web/api/mixins/users.id.rb +1 -3
- data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +26 -24
- data/lib/slack/web/api/templates/endpoints.erb +1 -0
- data/lib/slack/web/api/templates/errors.erb +20 -0
- data/lib/slack/web/api/templates/method.erb +4 -1
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/client.rb +1 -1
- data/lib/slack/web/config.rb +2 -0
- data/lib/slack/web/faraday/connection.rb +23 -20
- data/lib/slack/web/faraday/response/raise_error.rb +16 -2
- data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
- data/lib/slack/web/pagination/cursor.rb +2 -2
- data/lib/tasks/real_time.rake +1 -1
- data/lib/tasks/web.rake +21 -4
- data/slack-ruby-client.gemspec +5 -5
- data/spec/fixtures/slack/web/channels_info.yml +108 -15
- data/spec/fixtures/slack/web/{groups_info.yml → conversations_info.yml} +4 -4
- data/spec/fixtures/slack/web/conversations_setTopic.yml +69 -0
- data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +142 -0
- data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +208 -0
- data/spec/fixtures/slack/web/views_open_error.yml +76 -0
- data/spec/slack/events/request_spec.rb +13 -8
- data/spec/slack/real_time/client_spec.rb +18 -1
- data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
- data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
- data/spec/slack/real_time/rtm_start_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -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 +32 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +93 -0
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
- data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +67 -0
- 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 +24 -0
- data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +20 -12
- data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
- 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 +0 -31
- data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -31
- data/spec/slack/web/api/endpoints/oauth_spec.rb +3 -14
- 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/api/errors/slack_error_spec.rb +22 -0
- data/spec/slack/web/api/mixins/channels_spec.rb +1 -1
- data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +43 -0
- data/spec/slack/web/api/mixins/groups_spec.rb +1 -1
- data/spec/slack/web/api/mixins/users_spec.rb +1 -1
- data/spec/slack/web/client_spec.rb +121 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +33 -9
- data/spec/support/vcr.rb +4 -0
- metadata +145 -55
- 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/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
- data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
- data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
- data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
- data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
- 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/endpoints/custom_specs/channels_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
- data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
data/bin/commands/dnd.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
desc '
|
4
|
+
desc 'Adjust and view Do Not Disturb settings for team members.'
|
5
5
|
command 'dnd' do |g|
|
6
6
|
g.desc "Ends the current user's Do Not Disturb session immediately."
|
7
7
|
g.long_desc %( Ends the current user's Do Not Disturb session immediately. )
|
@@ -22,6 +22,7 @@ command 'dnd' do |g|
|
|
22
22
|
g.desc "Retrieves a user's current Do Not Disturb status."
|
23
23
|
g.long_desc %( Retrieves a user's current Do Not Disturb status. )
|
24
24
|
g.command 'info' do |c|
|
25
|
+
c.flag 'team_id', desc: 'Encoded team id where passed in user param belongs, required if org token is used. If no user param is passed, then a team which has access to the app should be passed.'
|
25
26
|
c.flag 'user', desc: 'User to fetch status for (defaults to current user).'
|
26
27
|
c.action do |_global_options, options, _args|
|
27
28
|
puts JSON.dump($client.dnd_info(options))
|
@@ -41,6 +42,7 @@ command 'dnd' do |g|
|
|
41
42
|
g.long_desc %( Retrieves the Do Not Disturb status for up to 50 users on a team. )
|
42
43
|
g.command 'teamInfo' do |c|
|
43
44
|
c.flag 'users', desc: 'Comma-separated list of users to fetch Do Not Disturb status for.'
|
45
|
+
c.flag 'team_id', desc: 'Encoded team id where passed in users belong, required if org token is used.'
|
44
46
|
c.action do |_global_options, options, _args|
|
45
47
|
puts JSON.dump($client.dnd_teamInfo(options))
|
46
48
|
end
|
data/bin/commands/files.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
desc '
|
4
|
+
desc 'Get info on files uploaded to Slack, upload new files to Slack.'
|
5
5
|
command 'files' do |g|
|
6
6
|
g.desc 'Deletes a file.'
|
7
7
|
g.long_desc %( Deletes a file. )
|
@@ -23,8 +23,8 @@ command 'files' do |g|
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
g.desc 'Gets information about a
|
27
|
-
g.long_desc %( Gets information about a
|
26
|
+
g.desc 'Gets information about a file.'
|
27
|
+
g.long_desc %( Gets information about a file. )
|
28
28
|
g.command 'info' do |c|
|
29
29
|
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
30
30
|
c.flag 'cursor', desc: "Parameter for pagination. File comments are paginated for a single file. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection of comments. See pagination for more details."
|
@@ -34,10 +34,12 @@ command 'files' do |g|
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
g.desc '
|
38
|
-
g.long_desc %(
|
37
|
+
g.desc 'List for a team, in a channel, or from a user with applied filters.'
|
38
|
+
g.long_desc %( List for a team, in a channel, or from a user with applied filters. )
|
39
39
|
g.command 'list' do |c|
|
40
40
|
c.flag 'channel', desc: 'Filter files appearing in a specific channel, indicated by its ID.'
|
41
|
+
c.flag 'show_files_hidden_by_limit', desc: 'Show truncated file info for files hidden due to being too old, and the team who owns the file being over the file limit.'
|
42
|
+
c.flag 'team_id', desc: 'encoded team id to list files in, required if org token is used.'
|
41
43
|
c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
|
42
44
|
c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
|
43
45
|
c.flag 'types', desc: 'Filter files by type (see below). You can pass multiple values in the types argument, like types=spaces,snippets.The default value is all, which does not filter the list.'
|
@@ -10,7 +10,7 @@ command 'files_remote' do |g|
|
|
10
10
|
c.flag 'external_url', desc: 'URL of the remote file.'
|
11
11
|
c.flag 'title', desc: 'Title of the file being shared.'
|
12
12
|
c.flag 'filetype', desc: 'type of file.'
|
13
|
-
c.flag 'indexable_file_contents', desc: '
|
13
|
+
c.flag 'indexable_file_contents', desc: 'A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file.'
|
14
14
|
c.flag 'preview_image', desc: 'Preview of the document via multipart/form-data.'
|
15
15
|
c.action do |_global_options, options, _args|
|
16
16
|
puts JSON.dump($client.files_remote_add(options))
|
@@ -54,8 +54,8 @@ command 'files_remote' do |g|
|
|
54
54
|
g.long_desc %( Share a remote file into a channel. )
|
55
55
|
g.command 'share' do |c|
|
56
56
|
c.flag 'channels', desc: 'Comma-separated list of channel IDs where the file will be shared.'
|
57
|
-
c.flag 'external_id', desc: '
|
58
|
-
c.flag 'file', desc: 'Specify a file by providing its ID.'
|
57
|
+
c.flag 'external_id', desc: '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.'
|
58
|
+
c.flag 'file', desc: 'Specify a file registered with Slack by providing its ID. Either this field or external_id or both are required.'
|
59
59
|
c.action do |_global_options, options, _args|
|
60
60
|
puts JSON.dump($client.files_remote_share(options))
|
61
61
|
end
|
data/bin/commands/groups.rb
CHANGED
@@ -1,49 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
desc '
|
4
|
+
desc "Get info on your team's private channels."
|
5
5
|
command 'groups' do |g|
|
6
|
-
g.desc 'Archives a private channel.'
|
7
|
-
g.long_desc %( Archives a private channel. )
|
8
|
-
g.command 'archive' do |c|
|
9
|
-
c.flag 'channel', desc: 'Private channel to archive.'
|
10
|
-
c.action do |_global_options, options, _args|
|
11
|
-
puts JSON.dump($client.groups_archive(options))
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
g.desc 'Creates a private channel.'
|
16
|
-
g.long_desc %( Creates a private channel. )
|
17
|
-
g.command 'create' do |c|
|
18
|
-
c.flag 'name', desc: 'Name of private channel to create.'
|
19
|
-
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
|
20
|
-
c.action do |_global_options, options, _args|
|
21
|
-
puts JSON.dump($client.groups_create(options))
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
g.desc 'Clones and archives a private channel.'
|
26
|
-
g.long_desc %( Clones and archives a private channel. )
|
27
|
-
g.command 'createChild' do |c|
|
28
|
-
c.flag 'channel', desc: 'Private channel to clone and archive.'
|
29
|
-
c.action do |_global_options, options, _args|
|
30
|
-
puts JSON.dump($client.groups_createChild(options))
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
g.desc 'Fetches history of messages and events from a private channel.'
|
35
|
-
g.long_desc %( Fetches history of messages and events from a private channel. )
|
36
|
-
g.command 'history' do |c|
|
37
|
-
c.flag 'channel', desc: 'Private channel to fetch history for.'
|
38
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
39
|
-
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
40
|
-
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
41
|
-
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
42
|
-
c.action do |_global_options, options, _args|
|
43
|
-
puts JSON.dump($client.groups_history(options))
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
6
|
g.desc 'This method returns the ID of a group.'
|
48
7
|
g.long_desc %( This method returns the ID of a group. )
|
49
8
|
g.command 'id' do |c|
|
@@ -52,124 +11,4 @@ command 'groups' do |g|
|
|
52
11
|
puts JSON.dump($client.groups_id(options))
|
53
12
|
end
|
54
13
|
end
|
55
|
-
|
56
|
-
g.desc 'Gets information about a private channel.'
|
57
|
-
g.long_desc %( Gets information about a private channel. )
|
58
|
-
g.command 'info' do |c|
|
59
|
-
c.flag 'channel', desc: 'Private channel to get info on.'
|
60
|
-
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this group. Defaults to false.'
|
61
|
-
c.action do |_global_options, options, _args|
|
62
|
-
puts JSON.dump($client.groups_info(options))
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
g.desc 'Invites a user to a private channel.'
|
67
|
-
g.long_desc %( Invites a user to a private channel. )
|
68
|
-
g.command 'invite' do |c|
|
69
|
-
c.flag 'channel', desc: 'Private channel to invite user to.'
|
70
|
-
c.flag 'user', desc: 'User to invite.'
|
71
|
-
c.action do |_global_options, options, _args|
|
72
|
-
puts JSON.dump($client.groups_invite(options))
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
g.desc 'Removes a user from a private channel.'
|
77
|
-
g.long_desc %( Removes a user from a private channel. )
|
78
|
-
g.command 'kick' do |c|
|
79
|
-
c.flag 'channel', desc: 'Private channel to remove user from.'
|
80
|
-
c.flag 'user', desc: 'User to remove from private channel.'
|
81
|
-
c.action do |_global_options, options, _args|
|
82
|
-
puts JSON.dump($client.groups_kick(options))
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
g.desc 'Leaves a private channel.'
|
87
|
-
g.long_desc %( Leaves a private channel. )
|
88
|
-
g.command 'leave' do |c|
|
89
|
-
c.flag 'channel', desc: 'Private channel to leave.'
|
90
|
-
c.action do |_global_options, options, _args|
|
91
|
-
puts JSON.dump($client.groups_leave(options))
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
g.desc 'Lists private channels that the calling user has access to.'
|
96
|
-
g.long_desc %( Lists private channels that the calling user has access to. )
|
97
|
-
g.command 'list' do |c|
|
98
|
-
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
|
99
|
-
c.flag 'exclude_archived', desc: "Don't return archived private channels."
|
100
|
-
c.flag 'exclude_members', desc: 'Exclude the members from each group.'
|
101
|
-
c.flag 'limit', desc: "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."
|
102
|
-
c.action do |_global_options, options, _args|
|
103
|
-
puts JSON.dump($client.groups_list(options))
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
g.desc 'Sets the read cursor in a private channel.'
|
108
|
-
g.long_desc %( Sets the read cursor in a private channel. )
|
109
|
-
g.command 'mark' do |c|
|
110
|
-
c.flag 'channel', desc: 'Private channel to set reading cursor in.'
|
111
|
-
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
112
|
-
c.action do |_global_options, options, _args|
|
113
|
-
puts JSON.dump($client.groups_mark(options))
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
g.desc 'Opens a private channel.'
|
118
|
-
g.long_desc %( Opens a private channel. )
|
119
|
-
g.command 'open' do |c|
|
120
|
-
c.flag 'channel', desc: 'Private channel to open.'
|
121
|
-
c.action do |_global_options, options, _args|
|
122
|
-
puts JSON.dump($client.groups_open(options))
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
g.desc 'Renames a private channel.'
|
127
|
-
g.long_desc %( Renames a private channel. )
|
128
|
-
g.command 'rename' do |c|
|
129
|
-
c.flag 'channel', desc: 'Private channel to rename.'
|
130
|
-
c.flag 'name', desc: 'New name for private channel.'
|
131
|
-
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
|
132
|
-
c.action do |_global_options, options, _args|
|
133
|
-
puts JSON.dump($client.groups_rename(options))
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
|
-
g.desc 'Retrieve a thread of messages posted to a private channel'
|
138
|
-
g.long_desc %( Retrieve a thread of messages posted to a private channel )
|
139
|
-
g.command 'replies' do |c|
|
140
|
-
c.flag 'channel', desc: 'Private channel to fetch thread from.'
|
141
|
-
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
142
|
-
c.action do |_global_options, options, _args|
|
143
|
-
puts JSON.dump($client.groups_replies(options))
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
g.desc 'Sets the purpose for a private channel.'
|
148
|
-
g.long_desc %( Sets the purpose for a private channel. )
|
149
|
-
g.command 'setPurpose' do |c|
|
150
|
-
c.flag 'channel', desc: 'Private channel to set the purpose of.'
|
151
|
-
c.flag 'purpose', desc: 'The new purpose.'
|
152
|
-
c.action do |_global_options, options, _args|
|
153
|
-
puts JSON.dump($client.groups_setPurpose(options))
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
g.desc 'Sets the topic for a private channel.'
|
158
|
-
g.long_desc %( Sets the topic for a private channel. )
|
159
|
-
g.command 'setTopic' do |c|
|
160
|
-
c.flag 'channel', desc: 'Private channel to set the topic of.'
|
161
|
-
c.flag 'topic', desc: 'The new topic.'
|
162
|
-
c.action do |_global_options, options, _args|
|
163
|
-
puts JSON.dump($client.groups_setTopic(options))
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
g.desc 'Unarchives a private channel.'
|
168
|
-
g.long_desc %( Unarchives a private channel. )
|
169
|
-
g.command 'unarchive' do |c|
|
170
|
-
c.flag 'channel', desc: 'Private channel to unarchive.'
|
171
|
-
c.action do |_global_options, options, _args|
|
172
|
-
puts JSON.dump($client.groups_unarchive(options))
|
173
|
-
end
|
174
|
-
end
|
175
14
|
end
|
data/bin/commands/im.rb
CHANGED
@@ -1,68 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
desc '
|
4
|
+
desc 'Get info on your direct messages.'
|
5
5
|
command 'im' do |g|
|
6
|
-
g.desc 'Close a direct message channel.'
|
7
|
-
g.long_desc %( Close a direct message channel. )
|
8
|
-
g.command 'close' do |c|
|
9
|
-
c.flag 'channel', desc: 'Direct message channel to close.'
|
10
|
-
c.action do |_global_options, options, _args|
|
11
|
-
puts JSON.dump($client.im_close(options))
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
g.desc 'Fetches history of messages and events from direct message channel.'
|
16
|
-
g.long_desc %( Fetches history of messages and events from direct message channel. )
|
17
|
-
g.command 'history' do |c|
|
18
|
-
c.flag 'channel', desc: 'Direct message channel to fetch history for.'
|
19
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
20
|
-
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
21
|
-
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
22
|
-
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
23
|
-
c.action do |_global_options, options, _args|
|
24
|
-
puts JSON.dump($client.im_history(options))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
g.desc 'Lists direct message channels for the calling user.'
|
29
|
-
g.long_desc %( Lists direct message channels for the calling user. )
|
30
|
-
g.command 'list' do |c|
|
31
|
-
c.flag 'cursor', desc: "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."
|
32
|
-
c.flag 'limit', desc: "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."
|
33
|
-
c.action do |_global_options, options, _args|
|
34
|
-
puts JSON.dump($client.im_list(options))
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
g.desc 'Sets the read cursor in a direct message channel.'
|
39
|
-
g.long_desc %( Sets the read cursor in a direct message channel. )
|
40
|
-
g.command 'mark' do |c|
|
41
|
-
c.flag 'channel', desc: 'Direct message channel to set reading cursor in.'
|
42
|
-
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
43
|
-
c.action do |_global_options, options, _args|
|
44
|
-
puts JSON.dump($client.im_mark(options))
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
g.desc 'Opens a direct message channel.'
|
49
|
-
g.long_desc %( Opens a direct message channel. )
|
50
|
-
g.command 'open' do |c|
|
51
|
-
c.flag 'user', desc: 'User to open a direct message channel with.'
|
52
|
-
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this im. Defaults to false.'
|
53
|
-
c.flag 'return_im', desc: 'Boolean, indicates you want the full IM channel definition in the response.'
|
54
|
-
c.action do |_global_options, options, _args|
|
55
|
-
puts JSON.dump($client.im_open(options))
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
g.desc 'Retrieve a thread of messages posted to a direct message conversation'
|
60
|
-
g.long_desc %( Retrieve a thread of messages posted to a direct message conversation )
|
61
|
-
g.command 'replies' do |c|
|
62
|
-
c.flag 'channel', desc: 'Direct message channel to fetch thread from.'
|
63
|
-
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
64
|
-
c.action do |_global_options, options, _args|
|
65
|
-
puts JSON.dump($client.im_replies(options))
|
66
|
-
end
|
67
|
-
end
|
68
6
|
end
|
data/bin/commands/migration.rb
CHANGED
@@ -7,6 +7,7 @@ command 'migration' do |g|
|
|
7
7
|
g.long_desc %( For Enterprise Grid workspaces, map local user IDs to global user IDs )
|
8
8
|
g.command 'exchange' do |c|
|
9
9
|
c.flag 'users', desc: 'A comma-separated list of user ids, up to 400 per request.'
|
10
|
+
c.flag 'team_id', desc: 'Specify team_id starts with T in case of Org Token.'
|
10
11
|
c.flag 'to_old', desc: 'Specify true to convert W global user IDs to workspace-specific U IDs. Defaults to false.'
|
11
12
|
c.action do |_global_options, options, _args|
|
12
13
|
puts JSON.dump($client.migration_exchange(options))
|
data/bin/commands/mpim.rb
CHANGED
@@ -1,66 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
desc '
|
4
|
+
desc 'Get info on your multiparty direct messages.'
|
5
5
|
command 'mpim' do |g|
|
6
|
-
g.desc 'Closes a multiparty direct message channel.'
|
7
|
-
g.long_desc %( Closes a multiparty direct message channel. )
|
8
|
-
g.command 'close' do |c|
|
9
|
-
c.flag 'channel', desc: 'MPIM to close.'
|
10
|
-
c.action do |_global_options, options, _args|
|
11
|
-
puts JSON.dump($client.mpim_close(options))
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
g.desc 'Fetches history of messages and events from a multiparty direct message.'
|
16
|
-
g.long_desc %( Fetches history of messages and events from a multiparty direct message. )
|
17
|
-
g.command 'history' do |c|
|
18
|
-
c.flag 'channel', desc: 'Multiparty direct message to fetch history for.'
|
19
|
-
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
|
20
|
-
c.flag 'latest', desc: 'End of time range of messages to include in results.'
|
21
|
-
c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
|
22
|
-
c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
|
23
|
-
c.action do |_global_options, options, _args|
|
24
|
-
puts JSON.dump($client.mpim_history(options))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
g.desc 'Lists multiparty direct message channels for the calling user.'
|
29
|
-
g.long_desc %( Lists multiparty direct message channels for the calling user. )
|
30
|
-
g.command 'list' do |c|
|
31
|
-
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
|
32
|
-
c.flag 'limit', desc: "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."
|
33
|
-
c.action do |_global_options, options, _args|
|
34
|
-
puts JSON.dump($client.mpim_list(options))
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
g.desc 'Sets the read cursor in a multiparty direct message channel.'
|
39
|
-
g.long_desc %( Sets the read cursor in a multiparty direct message channel. )
|
40
|
-
g.command 'mark' do |c|
|
41
|
-
c.flag 'channel', desc: 'multiparty direct message channel to set reading cursor in.'
|
42
|
-
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
|
43
|
-
c.action do |_global_options, options, _args|
|
44
|
-
puts JSON.dump($client.mpim_mark(options))
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
g.desc 'This method opens a multiparty direct message.'
|
49
|
-
g.long_desc %( This method opens a multiparty direct message. )
|
50
|
-
g.command 'open' do |c|
|
51
|
-
c.flag 'users', desc: 'Comma separated lists of users. The ordering of the users is preserved whenever a MPIM group is returned.'
|
52
|
-
c.action do |_global_options, options, _args|
|
53
|
-
puts JSON.dump($client.mpim_open(options))
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
g.desc 'Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message.'
|
58
|
-
g.long_desc %( Retrieve a thread of messages posted to a direct message conversation from a multiparty direct message. )
|
59
|
-
g.command 'replies' do |c|
|
60
|
-
c.flag 'channel', desc: 'Multiparty direct message channel to fetch thread from.'
|
61
|
-
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
|
62
|
-
c.action do |_global_options, options, _args|
|
63
|
-
puts JSON.dump($client.mpim_replies(options))
|
64
|
-
end
|
65
|
-
end
|
66
6
|
end
|
data/bin/commands/oauth.rb
CHANGED
@@ -10,7 +10,7 @@ command 'oauth' do |g|
|
|
10
10
|
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
11
11
|
c.flag 'code', desc: 'The code param returned via the OAuth callback.'
|
12
12
|
c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
|
13
|
-
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel.'
|
13
|
+
c.flag 'single_channel', desc: 'Request the user to add your app only to a single channel. Only valid with a legacy workspace app.'
|
14
14
|
c.action do |_global_options, options, _args|
|
15
15
|
puts JSON.dump($client.oauth_access(options))
|
16
16
|
end
|
data/bin/commands/pins.rb
CHANGED
@@ -26,8 +26,6 @@ command 'pins' do |g|
|
|
26
26
|
g.long_desc %( Un-pins an item from a channel. )
|
27
27
|
g.command 'remove' do |c|
|
28
28
|
c.flag 'channel', desc: 'Channel where the item is pinned to.'
|
29
|
-
c.flag 'file', desc: 'File to un-pin.'
|
30
|
-
c.flag 'file_comment', desc: 'File comment to un-pin.'
|
31
29
|
c.flag 'timestamp', desc: 'Timestamp of the message to un-pin.'
|
32
30
|
c.action do |_global_options, options, _args|
|
33
31
|
puts JSON.dump($client.pins_remove(options))
|
data/bin/commands/reactions.rb
CHANGED
@@ -33,6 +33,7 @@ command 'reactions' do |g|
|
|
33
33
|
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
|
34
34
|
c.flag 'full', desc: 'If true always return the complete reaction list.'
|
35
35
|
c.flag 'limit', desc: "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."
|
36
|
+
c.flag 'team_id', desc: 'encoded team id to list reactions in, required if org token is used.'
|
36
37
|
c.flag 'user', desc: 'Show reactions made by this user. Defaults to the authed user.'
|
37
38
|
c.action do |_global_options, options, _args|
|
38
39
|
puts JSON.dump($client.reactions_list(options))
|
data/bin/commands/search.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
desc
|
4
|
+
desc "Search your team's files and messages."
|
5
5
|
command 'search' do |g|
|
6
6
|
g.desc 'Searches for messages and files matching a query.'
|
7
7
|
g.long_desc %( Searches for messages and files matching a query. )
|
@@ -10,6 +10,7 @@ command 'search' do |g|
|
|
10
10
|
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
11
11
|
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
|
12
12
|
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
|
13
|
+
c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
|
13
14
|
c.action do |_global_options, options, _args|
|
14
15
|
puts JSON.dump($client.search_all(options))
|
15
16
|
end
|
@@ -22,6 +23,7 @@ command 'search' do |g|
|
|
22
23
|
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
23
24
|
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
|
24
25
|
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
|
26
|
+
c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
|
25
27
|
c.action do |_global_options, options, _args|
|
26
28
|
puts JSON.dump($client.search_files(options))
|
27
29
|
end
|
@@ -34,6 +36,7 @@ command 'search' do |g|
|
|
34
36
|
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
35
37
|
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
|
36
38
|
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
|
39
|
+
c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
|
37
40
|
c.action do |_global_options, options, _args|
|
38
41
|
puts JSON.dump($client.search_messages(options))
|
39
42
|
end
|