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.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/.rubocop_todo.yml +0 -14
  4. data/.travis.yml +1 -4
  5. data/CHANGELOG.md +8 -0
  6. data/CONTRIBUTING.md +3 -10
  7. data/README.md +9 -27
  8. data/UPGRADING.md +14 -2
  9. data/bin/commands.rb +7 -0
  10. data/bin/commands/admin_analytics.rb +15 -0
  11. data/bin/commands/admin_apps.rb +15 -2
  12. data/bin/commands/admin_barriers.rb +47 -0
  13. data/bin/commands/admin_conversations.rb +154 -2
  14. data/bin/commands/admin_conversations_ekm.rb +17 -0
  15. data/bin/commands/admin_conversations_restrictAccess.rb +4 -4
  16. data/bin/commands/admin_conversations_whitelist.rb +1 -1
  17. data/bin/commands/admin_emoji.rb +1 -1
  18. data/bin/commands/admin_usergroups.rb +2 -2
  19. data/bin/commands/admin_users.rb +2 -2
  20. data/bin/commands/admin_users_session.rb +22 -0
  21. data/bin/commands/api.rb +0 -1
  22. data/bin/commands/apps_connections.rb +13 -0
  23. data/bin/commands/apps_event_authorizations.rb +16 -0
  24. data/bin/commands/auth_teams.rb +16 -0
  25. data/bin/commands/bots.rb +1 -0
  26. data/bin/commands/channels.rb +6 -3
  27. data/bin/commands/chat.rb +4 -4
  28. data/bin/commands/chat_scheduledMessages.rb +1 -0
  29. data/bin/commands/conversations.rb +14 -2
  30. data/bin/commands/dnd.rb +1 -1
  31. data/bin/commands/files.rb +6 -5
  32. data/bin/commands/files_remote.rb +2 -2
  33. data/bin/commands/groups.rb +5 -3
  34. data/bin/commands/im.rb +1 -1
  35. data/bin/commands/migration.rb +1 -0
  36. data/bin/commands/mpim.rb +3 -3
  37. data/bin/commands/pins.rb +0 -2
  38. data/bin/commands/reactions.rb +1 -0
  39. data/bin/commands/search.rb +4 -1
  40. data/bin/commands/team.rb +3 -0
  41. data/bin/commands/usergroups.rb +6 -1
  42. data/bin/commands/usergroups_users.rb +2 -0
  43. data/bin/commands/users.rb +5 -3
  44. data/bin/commands/users_profile.rb +5 -5
  45. data/bin/commands/views.rb +1 -1
  46. data/bin/commands/workflows.rb +38 -0
  47. data/lib/slack-ruby-client.rb +2 -0
  48. data/lib/slack/events/request.rb +5 -1
  49. data/lib/slack/real_time/client.rb +0 -1
  50. data/lib/slack/real_time/concurrency.rb +0 -2
  51. data/lib/slack/real_time/config.rb +5 -4
  52. data/lib/slack/version.rb +1 -1
  53. data/lib/slack/web/api/endpoints.rb +14 -0
  54. data/lib/slack/web/api/endpoints/admin_analytics.rb +26 -0
  55. data/lib/slack/web/api/endpoints/admin_apps.rb +22 -2
  56. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  57. data/lib/slack/web/api/endpoints/admin_conversations.rb +231 -1
  58. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  59. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +3 -3
  60. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +3 -3
  61. data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
  62. data/lib/slack/web/api/endpoints/admin_usergroups.rb +1 -1
  63. data/lib/slack/web/api/endpoints/admin_users.rb +4 -6
  64. data/lib/slack/web/api/endpoints/admin_users_session.rb +38 -0
  65. data/lib/slack/web/api/endpoints/api.rb +0 -2
  66. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  67. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  68. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  69. data/lib/slack/web/api/endpoints/bots.rb +2 -0
  70. data/lib/slack/web/api/endpoints/channels.rb +9 -3
  71. data/lib/slack/web/api/endpoints/chat.rb +3 -3
  72. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -0
  73. data/lib/slack/web/api/endpoints/conversations.rb +21 -1
  74. data/lib/slack/web/api/endpoints/files.rb +4 -2
  75. data/lib/slack/web/api/endpoints/files_remote.rb +2 -2
  76. data/lib/slack/web/api/endpoints/groups.rb +7 -3
  77. data/lib/slack/web/api/endpoints/im.rb +1 -1
  78. data/lib/slack/web/api/endpoints/migration.rb +2 -0
  79. data/lib/slack/web/api/endpoints/mpim.rb +3 -3
  80. data/lib/slack/web/api/endpoints/pins.rb +0 -5
  81. data/lib/slack/web/api/endpoints/reactions.rb +2 -0
  82. data/lib/slack/web/api/endpoints/search.rb +6 -0
  83. data/lib/slack/web/api/endpoints/team.rb +6 -0
  84. data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
  85. data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
  86. data/lib/slack/web/api/endpoints/users.rb +7 -5
  87. data/lib/slack/web/api/endpoints/users_profile.rb +3 -3
  88. data/lib/slack/web/api/endpoints/views.rb +1 -1
  89. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  90. data/lib/slack/web/api/errors.rb +194 -0
  91. data/lib/slack/web/api/errors/internal_error.rb +14 -0
  92. data/lib/slack/web/api/templates/endpoints.erb +1 -0
  93. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  94. data/lib/slack/web/faraday/connection.rb +1 -1
  95. data/lib/slack/web/faraday/response/raise_error.rb +16 -1
  96. data/lib/slack/web/faraday/response/wrap_error.rb +18 -0
  97. data/lib/tasks/web.rake +7 -3
  98. data/spec/slack/events/request_spec.rb +7 -3
  99. data/spec/slack/real_time/client_spec.rb +1 -1
  100. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  101. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
  102. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  103. data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +8 -0
  104. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +5 -5
  105. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
  106. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +5 -5
  107. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
  108. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
  109. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
  110. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
  111. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +8 -0
  112. data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
  113. data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
  114. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  115. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +2 -2
  116. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +3 -3
  117. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  118. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
  119. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
  120. data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
  121. data/spec/slack/web/api/endpoints/conversations_spec.rb +20 -12
  122. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  123. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  124. data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
  125. data/spec/slack/web/api/endpoints/im_spec.rb +4 -4
  126. data/spec/slack/web/api/endpoints/mpim_spec.rb +4 -4
  127. data/spec/slack/web/api/endpoints/oauth_spec.rb +3 -3
  128. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
  129. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  130. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  131. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  132. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  133. data/spec/slack/web/client_spec.rb +56 -0
  134. data/spec/slack/web/faraday/response/raise_error_spec.rb +7 -6
  135. metadata +32 -19
  136. data/examples/hi_real_time/Gemfile +0 -6
  137. data/examples/hi_real_time/hi.gif +0 -0
  138. data/examples/hi_real_time/hi.rb +0 -41
  139. data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
  140. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  141. data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
  142. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
  143. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  144. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
  145. data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
  146. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
  147. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
  148. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
  149. data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AdminConversationsEkm methods.'
5
+ command 'admin_conversations_ekm' do |g|
6
+ g.desc 'List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM.'
7
+ g.long_desc %( List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM. )
8
+ g.command 'listOriginalConnectedChannelInfo' do |c|
9
+ c.flag 'channel_ids', desc: 'A comma-separated list of channels to filter to.'
10
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
11
+ c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
12
+ c.flag 'team_ids', desc: 'A comma-separated list of the workspaces to which the channels you would like returned belong.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump($client.admin_conversations_ekm_listOriginalConnectedChannelInfo(options))
15
+ end
16
+ end
17
+ end
@@ -1,14 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'AdminConversationsRestrictaccess methods.'
4
+ desc 'Add and remove user groups from conversations.'
5
5
  command 'admin_conversations_restrictAccess' do |g|
6
6
  g.desc 'Add an allowlist of IDP groups for accessing a channel'
7
7
  g.long_desc %( Add an allowlist of IDP groups for accessing a channel )
8
8
  g.command 'addGroup' do |c|
9
9
  c.flag 'channel_id', desc: 'The channel to link this group to.'
10
10
  c.flag 'group_id', desc: 'The IDP Group ID to be an allowlist for the private channel.'
11
- c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
11
+ c.flag 'team_id', desc: 'The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
12
12
  c.action do |_global_options, options, _args|
13
13
  puts JSON.dump($client.admin_conversations_restrictAccess_addGroup(options))
14
14
  end
@@ -18,7 +18,7 @@ command 'admin_conversations_restrictAccess' do |g|
18
18
  g.long_desc %( List all IDP Groups linked to a channel )
19
19
  g.command 'listGroups' do |c|
20
20
  c.flag 'channel_id', desc: '.'
21
- c.flag 'team_id', desc: 'The workspace where the channele exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
21
+ c.flag 'team_id', desc: 'The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
22
22
  c.action do |_global_options, options, _args|
23
23
  puts JSON.dump($client.admin_conversations_restrictAccess_listGroups(options))
24
24
  end
@@ -29,7 +29,7 @@ command 'admin_conversations_restrictAccess' do |g|
29
29
  g.command 'removeGroup' do |c|
30
30
  c.flag 'channel_id', desc: 'The channel to remove the linked group from.'
31
31
  c.flag 'group_id', desc: 'The IDP Group ID to remove from the private channel.'
32
- c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
32
+ c.flag 'team_id', desc: 'The workspace where the channel exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
33
33
  c.action do |_global_options, options, _args|
34
34
  puts JSON.dump($client.admin_conversations_restrictAccess_removeGroup(options))
35
35
  end
@@ -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 'AdminConversationsWhitelist methods.'
4
+ desc 'Add and remove user groups from conversations. Use admin.conversations.* equivalents instead.'
5
5
  command 'admin_conversations_whitelist' do |g|
6
6
  g.desc 'Add an allowlist of IDP groups for accessing a channel'
7
7
  g.long_desc %( Add an allowlist of IDP groups for accessing a channel )
@@ -6,7 +6,7 @@ command 'admin_emoji' do |g|
6
6
  g.desc 'Add an emoji.'
7
7
  g.long_desc %( Add an emoji. )
8
8
  g.command 'add' do |c|
9
- c.flag 'name', desc: 'The name of the emoji to be removed. Colons (:myemoji:) around the value are not required, although they may be included.'
9
+ c.flag 'name', desc: 'The name of the emoji to be added. Colons (:myemoji:) around the value are not required, although they may be included.'
10
10
  c.flag 'url', desc: 'The URL of a file to use as an image for the emoji. Square images under 128KB and with transparent backgrounds work best.'
11
11
  c.action do |_global_options, options, _args|
12
12
  puts JSON.dump($client.admin_emoji_add(options))
@@ -3,8 +3,8 @@
3
3
 
4
4
  desc 'AdminUsergroups methods.'
5
5
  command 'admin_usergroups' do |g|
6
- g.desc 'Add one or more default channels to an IDP group.'
7
- g.long_desc %( Add one or more default channels to an IDP group. )
6
+ g.desc 'Add up to one hundred default channels to an IDP group.'
7
+ g.long_desc %( Add up to one hundred default channels to an IDP group. )
8
8
  g.command 'addChannels' do |c|
9
9
  c.flag 'channel_ids', desc: 'Comma separated string of channel IDs.'
10
10
  c.flag 'usergroup_id', desc: 'ID of the IDP group to add default channels for.'
@@ -36,9 +36,9 @@ command 'admin_users' do |g|
36
36
  g.desc 'List users on a workspace'
37
37
  g.long_desc %( List users on a workspace )
38
38
  g.command 'list' do |c|
39
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
40
39
  c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
41
40
  c.flag 'limit', desc: 'Limit for how many users to be retrieved per page.'
41
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
42
42
  c.action do |_global_options, options, _args|
43
43
  puts JSON.dump($client.admin_users_list(options))
44
44
  end
@@ -68,8 +68,8 @@ command 'admin_users' do |g|
68
68
  g.long_desc %( Set an expiration for a guest user )
69
69
  g.command 'setExpiration' do |c|
70
70
  c.flag 'expiration_ts', desc: 'Timestamp when guest account should be disabled.'
71
- c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
72
71
  c.flag 'user_id', desc: 'The ID of the user to set an expiration for.'
72
+ c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
73
73
  c.action do |_global_options, options, _args|
74
74
  puts JSON.dump($client.admin_users_setExpiration(options))
75
75
  end
@@ -3,6 +3,28 @@
3
3
 
4
4
  desc 'AdminUsersSession methods.'
5
5
  command 'admin_users_session' do |g|
6
+ g.desc 'Revoke a single session for a user. The user will be forced to login to Slack.'
7
+ g.long_desc %( Revoke a single session for a user. The user will be forced to login to Slack. )
8
+ g.command 'invalidate' do |c|
9
+ c.flag 'session_id', desc: 'ID of the session to invalidate.'
10
+ c.flag 'team_id', desc: 'ID of the workspace that the session belongs to.'
11
+ c.action do |_global_options, options, _args|
12
+ puts JSON.dump($client.admin_users_session_invalidate(options))
13
+ end
14
+ end
15
+
16
+ g.desc 'List active user sessions for an organization'
17
+ g.long_desc %( List active user sessions for an organization )
18
+ g.command 'list' do |c|
19
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
20
+ c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
21
+ c.flag 'team_id', desc: "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."
22
+ c.flag 'user_id', desc: "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."
23
+ c.action do |_global_options, options, _args|
24
+ puts JSON.dump($client.admin_users_session_list(options))
25
+ end
26
+ end
27
+
6
28
  g.desc 'Wipes all valid sessions on all devices for a given user'
7
29
  g.long_desc %( Wipes all valid sessions on all devices for a given user )
8
30
  g.command 'reset' do |c|
@@ -7,7 +7,6 @@ command 'api' do |g|
7
7
  g.long_desc %( Checks API calling code. )
8
8
  g.command 'test' do |c|
9
9
  c.flag 'error', desc: 'Error response to return.'
10
- c.flag 'foo', desc: 'example property to return.'
11
10
  c.action do |_global_options, options, _args|
12
11
  puts JSON.dump($client.api_test(options))
13
12
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AppsConnections methods.'
5
+ command 'apps_connections' do |g|
6
+ g.desc 'Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over,'
7
+ g.long_desc %( Generate a temporary Socket Mode WebSocket URL that your app can connect to in order to receive events and interactive payloads over, )
8
+ g.command 'open' do |c|
9
+ c.action do |_global_options, options, _args|
10
+ puts JSON.dump($client.apps_connections_open(options))
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AppsEventAuthorizations methods.'
5
+ command 'apps_event_authorizations' do |g|
6
+ g.desc 'Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to.'
7
+ g.long_desc %( Get a list of authorizations for the given event context. Each authorization represents an app installation that the event is visible to. )
8
+ g.command 'list' do |c|
9
+ c.flag 'event_context', desc: '.'
10
+ c.flag 'cursor', desc: '.'
11
+ c.flag 'limit', desc: '.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.apps_event_authorizations_list(options))
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AuthTeams methods.'
5
+ command 'auth_teams' do |g|
6
+ g.desc 'List the workspaces a token can access.'
7
+ g.long_desc %( List the workspaces a token can access. )
8
+ g.command 'list' do |c|
9
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
10
+ c.flag 'include_icon', desc: 'Whether to return icon paths for each workspace. An icon path represents a URI pointing to the image signifying the workspace.'
11
+ c.flag 'limit', desc: 'The maximum number of workspaces to return. Must be a positive integer no larger than 1000.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.auth_teams_list(options))
14
+ end
15
+ end
16
+ end
@@ -7,6 +7,7 @@ command 'bots' do |g|
7
7
  g.long_desc %( Gets information about a bot user. )
8
8
  g.command 'info' do |c|
9
9
  c.flag 'bot', desc: 'Bot user to get info on.'
10
+ c.flag 'team_id', desc: 'encoded team id or enterprise id where the bot exists, required if org token is used.'
10
11
  c.action do |_global_options, options, _args|
11
12
  puts JSON.dump($client.bots_info(options))
12
13
  end
@@ -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 'Channels methods.'
4
+ desc "Get info on your team's Slack channels, create or archive channels, invite users, set the topic and purpose, and mark a channel as read."
5
5
  command 'channels' do |g|
6
6
  g.desc 'Archives a channel.'
7
7
  g.long_desc %( Archives a channel. )
@@ -16,6 +16,7 @@ command 'channels' do |g|
16
16
  g.long_desc %( Creates a channel. )
17
17
  g.command 'create' do |c|
18
18
  c.flag 'name', desc: 'Name of channel to create.'
19
+ c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
19
20
  c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
20
21
  c.action do |_global_options, options, _args|
21
22
  puts JSON.dump($client.channels_create(options))
@@ -77,6 +78,7 @@ command 'channels' do |g|
77
78
  g.long_desc %( Joins a channel, creating it if needed. )
78
79
  g.command 'join' do |c|
79
80
  c.flag 'name', desc: 'Name of channel to join.'
81
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
80
82
  c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
81
83
  c.action do |_global_options, options, _args|
82
84
  puts JSON.dump($client.channels_join(options))
@@ -109,6 +111,7 @@ command 'channels' do |g|
109
111
  c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.'
110
112
  c.flag 'exclude_members', desc: 'Exclude the members collection from each channel.'
111
113
  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."
114
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
112
115
  c.action do |_global_options, options, _args|
113
116
  puts JSON.dump($client.channels_list(options))
114
117
  end
@@ -117,8 +120,8 @@ command 'channels' do |g|
117
120
  g.desc 'Sets the read cursor in a channel.'
118
121
  g.long_desc %( Sets the read cursor in a channel. )
119
122
  g.command 'mark' do |c|
120
- c.flag 'channel', desc: 'Channel to set reading cursor in.'
121
- c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
123
+ c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
124
+ c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
122
125
  c.action do |_global_options, options, _args|
123
126
  puts JSON.dump($client.channels_mark(options))
124
127
  end
@@ -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 'Chat methods.'
4
+ desc 'Post chat messages to Slack.'
5
5
  command 'chat' do |g|
6
6
  g.desc 'Execute a slash command in a public channel (undocumented)'
7
7
  g.long_desc %( Execute a slash command in a public channel )
@@ -84,8 +84,8 @@ command 'chat' do |g|
84
84
  c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below. This argument may not be used with newer bot tokens.'
85
85
  c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
86
86
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
87
- c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens.'
88
- c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below. This argument may not be used with newer bot tokens.'
87
+ c.flag 'icon_emoji', desc: 'Emoji to use as the icon for this message. Overrides icon_url. See authorship below. Use with bot tokens requires chat:write.customize.'
88
+ c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message. See authorship below. Use with bot tokens requires chat:write.customize.'
89
89
  c.flag 'link_names', desc: 'Find and link channel names and usernames.'
90
90
  c.flag 'mrkdwn', desc: 'Disable Slack markup parsing by setting to false. Enabled by default.'
91
91
  c.flag 'parse', desc: 'Change how messages are treated. Defaults to none. See below.'
@@ -93,7 +93,7 @@ command 'chat' do |g|
93
93
  c.flag 'thread_ts', desc: "Provide another message's ts value to make this message a reply. Avoid using a reply's ts value; use its parent instead."
94
94
  c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
95
95
  c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
96
- c.flag 'username', desc: "Set your bot's user name. Must be used in conjunction with as_user set to false, otherwise ignored. See authorship below."
96
+ c.flag 'username', desc: "Set your bot's user name. See authorship below. Use with bot tokens requires chat:write.customize."
97
97
  c.action do |_global_options, options, _args|
98
98
  puts JSON.dump($client.chat_postMessage(options))
99
99
  end
@@ -11,6 +11,7 @@ command 'chat_scheduledMessages' do |g|
11
11
  c.flag 'latest', desc: 'A UNIX timestamp of the latest value in the time range.'
12
12
  c.flag 'limit', desc: 'Maximum number of original entries to return.'
13
13
  c.flag 'oldest', desc: 'A UNIX timestamp of the oldest value in the time range.'
14
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
14
15
  c.action do |_global_options, options, _args|
15
16
  puts JSON.dump($client.chat_scheduledMessages_list(options))
16
17
  end
@@ -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 'Conversations methods.'
4
+ desc "Interface with all kinds of conversations the same way, whether they're public or private channels, direct messages, or otherwise."
5
5
  command 'conversations' do |g|
6
6
  g.desc 'Archives a conversation.'
7
7
  g.long_desc %( Archives a conversation. )
@@ -26,6 +26,7 @@ command 'conversations' do |g|
26
26
  g.command 'create' do |c|
27
27
  c.flag 'name', desc: 'Name of the public or private channel to create.'
28
28
  c.flag 'is_private', desc: 'Create a private channel instead of a public one.'
29
+ c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
29
30
  c.action do |_global_options, options, _args|
30
31
  puts JSON.dump($client.conversations_create(options))
31
32
  end
@@ -100,12 +101,23 @@ command 'conversations' do |g|
100
101
  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."
101
102
  c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
102
103
  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. Must be an integer no larger than 1000."
104
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
103
105
  c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
104
106
  c.action do |_global_options, options, _args|
105
107
  puts JSON.dump($client.conversations_list(options))
106
108
  end
107
109
  end
108
110
 
111
+ g.desc 'Sets the read cursor in a channel.'
112
+ g.long_desc %( Sets the read cursor in a channel. )
113
+ g.command 'mark' do |c|
114
+ c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
115
+ c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
116
+ c.action do |_global_options, options, _args|
117
+ puts JSON.dump($client.conversations_mark(options))
118
+ end
119
+ end
120
+
109
121
  g.desc 'Retrieve members of a conversation.'
110
122
  g.long_desc %( Retrieve members of a conversation. )
111
123
  g.command 'members' do |c|
@@ -142,7 +154,7 @@ command 'conversations' do |g|
142
154
  g.long_desc %( Retrieve a thread of messages posted to a conversation )
143
155
  g.command 'replies' do |c|
144
156
  c.flag 'channel', desc: 'Conversation ID to fetch thread from.'
145
- c.flag 'ts', desc: "Unique identifier of a thread's parent message."
157
+ c.flag 'ts', desc: "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."
146
158
  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."
147
159
  c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results only when either timestamp is specified.'
148
160
  c.flag 'latest', desc: 'End of time range of messages to include in results.'
@@ -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 'Dnd methods.'
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. )
@@ -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 'Files methods.'
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 team file.'
27
- g.long_desc %( Gets information about a team file. )
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,11 +34,12 @@ command 'files' do |g|
34
34
  end
35
35
  end
36
36
 
37
- g.desc 'Lists & filters team files.'
38
- g.long_desc %( Lists & filters team files. )
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
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.'
42
43
  c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
43
44
  c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
44
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.'
@@ -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: 'Creator defined GUID for the file.'
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
@@ -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 'Groups methods.'
4
+ desc "Get info on your team's private channels."
5
5
  command 'groups' do |g|
6
6
  g.desc 'Archives a private channel.'
7
7
  g.long_desc %( Archives a private channel. )
@@ -16,6 +16,7 @@ command 'groups' do |g|
16
16
  g.long_desc %( Creates a private channel. )
17
17
  g.command 'create' do |c|
18
18
  c.flag 'name', desc: 'Name of private channel to create.'
19
+ c.flag 'team_id', desc: 'encoded team id to create the channel in, required if org token is used.'
19
20
  c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
20
21
  c.action do |_global_options, options, _args|
21
22
  puts JSON.dump($client.groups_create(options))
@@ -99,6 +100,7 @@ command 'groups' do |g|
99
100
  c.flag 'exclude_archived', desc: "Don't return archived private channels."
100
101
  c.flag 'exclude_members', desc: 'Exclude the members from each group.'
101
102
  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."
103
+ c.flag 'team_id', desc: 'encoded team id to list channels in, required if org token is used.'
102
104
  c.action do |_global_options, options, _args|
103
105
  puts JSON.dump($client.groups_list(options))
104
106
  end
@@ -107,8 +109,8 @@ command 'groups' do |g|
107
109
  g.desc 'Sets the read cursor in a private channel.'
108
110
  g.long_desc %( Sets the read cursor in a private channel. )
109
111
  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.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
113
+ c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
112
114
  c.action do |_global_options, options, _args|
113
115
  puts JSON.dump($client.groups_mark(options))
114
116
  end
@@ -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 'Im methods.'
4
+ desc 'Get info on your direct messages.'
5
5
  command 'im' do |g|
6
6
  g.desc 'Close a direct message channel.'
7
7
  g.long_desc %( Close a direct message channel. )
@@ -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))
@@ -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 'Mpim methods.'
4
+ desc 'Get info on your multiparty direct messages.'
5
5
  command 'mpim' do |g|
6
6
  g.desc 'Closes a multiparty direct message channel.'
7
7
  g.long_desc %( Closes a multiparty direct message channel. )
@@ -38,8 +38,8 @@ command 'mpim' do |g|
38
38
  g.desc 'Sets the read cursor in a multiparty direct message channel.'
39
39
  g.long_desc %( Sets the read cursor in a multiparty direct message channel. )
40
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.'
41
+ c.flag 'channel', desc: 'Channel or conversation to set the read cursor for.'
42
+ c.flag 'ts', desc: 'Unique identifier of message you want marked as most recently seen in this conversation.'
43
43
  c.action do |_global_options, options, _args|
44
44
  puts JSON.dump($client.mpim_mark(options))
45
45
  end