slack-ruby-client 0.14.5 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.rubocop.yml +11 -3
  4. data/.rubocop_todo.yml +61 -23
  5. data/.travis.yml +1 -5
  6. data/CHANGELOG.md +43 -4
  7. data/CONTRIBUTING.md +17 -6
  8. data/Dangerfile +1 -1
  9. data/Gemfile +1 -2
  10. data/LICENSE.md +1 -1
  11. data/README.md +86 -52
  12. data/UPGRADING.md +20 -2
  13. data/bin/commands.rb +23 -0
  14. data/bin/commands/admin_analytics.rb +16 -0
  15. data/bin/commands/admin_apps.rb +15 -2
  16. data/bin/commands/admin_apps_approved.rb +17 -0
  17. data/bin/commands/admin_apps_restricted.rb +17 -0
  18. data/bin/commands/admin_barriers.rb +47 -0
  19. data/bin/commands/admin_conversations.rb +159 -0
  20. data/bin/commands/admin_conversations_ekm.rb +17 -0
  21. data/bin/commands/admin_conversations_restrictAccess.rb +37 -0
  22. data/bin/commands/admin_conversations_whitelist.rb +37 -0
  23. data/bin/commands/admin_emoji.rb +54 -0
  24. data/bin/commands/admin_inviteRequests.rb +36 -0
  25. data/bin/commands/admin_inviteRequests_approved.rb +16 -0
  26. data/bin/commands/admin_inviteRequests_denied.rb +16 -0
  27. data/bin/commands/admin_teams.rb +27 -0
  28. data/bin/commands/admin_teams_admins.rb +16 -0
  29. data/bin/commands/admin_teams_owners.rb +16 -0
  30. data/bin/commands/admin_teams_settings.rb +64 -0
  31. data/bin/commands/admin_usergroups.rb +48 -0
  32. data/bin/commands/admin_users.rb +97 -0
  33. data/bin/commands/admin_users_session.rb +22 -0
  34. data/bin/commands/api.rb +0 -1
  35. data/bin/commands/apps_connections.rb +13 -0
  36. data/bin/commands/apps_event_authorizations.rb +16 -0
  37. data/bin/commands/auth_teams.rb +16 -0
  38. data/bin/commands/bots.rb +1 -0
  39. data/bin/commands/calls.rb +52 -0
  40. data/bin/commands/calls_participants.rb +25 -0
  41. data/bin/commands/channels.rb +1 -155
  42. data/bin/commands/chat.rb +14 -12
  43. data/bin/commands/chat_scheduledMessages.rb +1 -0
  44. data/bin/commands/conversations.rb +15 -4
  45. data/bin/commands/dnd.rb +3 -1
  46. data/bin/commands/files.rb +7 -5
  47. data/bin/commands/files_remote.rb +3 -3
  48. data/bin/commands/groups.rb +1 -162
  49. data/bin/commands/im.rb +1 -63
  50. data/bin/commands/migration.rb +1 -0
  51. data/bin/commands/mpim.rb +1 -61
  52. data/bin/commands/oauth.rb +1 -1
  53. data/bin/commands/pins.rb +0 -2
  54. data/bin/commands/reactions.rb +1 -0
  55. data/bin/commands/search.rb +4 -1
  56. data/bin/commands/team.rb +3 -0
  57. data/bin/commands/usergroups.rb +6 -1
  58. data/bin/commands/usergroups_users.rb +2 -0
  59. data/bin/commands/users.rb +5 -3
  60. data/bin/commands/users_profile.rb +5 -5
  61. data/bin/commands/views.rb +1 -1
  62. data/bin/commands/workflows.rb +38 -0
  63. data/lib/slack-ruby-client.rb +5 -4
  64. data/lib/slack/events/request.rb +7 -3
  65. data/lib/slack/messages/message.rb +0 -4
  66. data/lib/slack/real_time/client.rb +2 -1
  67. data/lib/slack/real_time/concurrency.rb +0 -2
  68. data/lib/slack/real_time/concurrency/async.rb +1 -3
  69. data/lib/slack/real_time/config.rb +5 -14
  70. data/lib/slack/real_time/models/base.rb +0 -4
  71. data/lib/slack/real_time/socket.rb +2 -2
  72. data/lib/slack/real_time/stores/base.rb +3 -1
  73. data/lib/slack/version.rb +1 -1
  74. data/lib/slack/web/api/endpoints.rb +47 -0
  75. data/lib/slack/web/api/endpoints/admin_analytics.rb +28 -0
  76. data/lib/slack/web/api/endpoints/admin_apps.rb +22 -2
  77. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +35 -0
  78. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +35 -0
  79. data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
  80. data/lib/slack/web/api/endpoints/admin_conversations.rb +246 -0
  81. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
  82. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +61 -0
  83. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +64 -0
  84. data/lib/slack/web/api/endpoints/admin_emoji.rb +88 -0
  85. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +61 -0
  86. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +33 -0
  87. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +33 -0
  88. data/lib/slack/web/api/endpoints/admin_teams.rb +50 -0
  89. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +34 -0
  90. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +34 -0
  91. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +99 -0
  92. data/lib/slack/web/api/endpoints/admin_usergroups.rb +77 -0
  93. data/lib/slack/web/api/endpoints/admin_users.rb +161 -0
  94. data/lib/slack/web/api/endpoints/admin_users_session.rb +38 -0
  95. data/lib/slack/web/api/endpoints/api.rb +0 -2
  96. data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
  97. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
  98. data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
  99. data/lib/slack/web/api/endpoints/bots.rb +2 -0
  100. data/lib/slack/web/api/endpoints/calls.rb +83 -0
  101. data/lib/slack/web/api/endpoints/calls_participants.rb +42 -0
  102. data/lib/slack/web/api/endpoints/channels.rb +1 -245
  103. data/lib/slack/web/api/endpoints/chat.rb +23 -19
  104. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -1
  105. data/lib/slack/web/api/endpoints/conversations.rb +37 -19
  106. data/lib/slack/web/api/endpoints/dnd.rb +4 -0
  107. data/lib/slack/web/api/endpoints/files.rb +8 -4
  108. data/lib/slack/web/api/endpoints/files_remote.rb +4 -4
  109. data/lib/slack/web/api/endpoints/groups.rb +0 -253
  110. data/lib/slack/web/api/endpoints/im.rb +0 -101
  111. data/lib/slack/web/api/endpoints/migration.rb +2 -0
  112. data/lib/slack/web/api/endpoints/mpim.rb +0 -96
  113. data/lib/slack/web/api/endpoints/oauth.rb +1 -4
  114. data/lib/slack/web/api/endpoints/pins.rb +3 -8
  115. data/lib/slack/web/api/endpoints/reactions.rb +5 -3
  116. data/lib/slack/web/api/endpoints/search.rb +6 -0
  117. data/lib/slack/web/api/endpoints/stars.rb +2 -2
  118. data/lib/slack/web/api/endpoints/team.rb +6 -0
  119. data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
  120. data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
  121. data/lib/slack/web/api/endpoints/users.rb +7 -5
  122. data/lib/slack/web/api/endpoints/users_profile.rb +3 -3
  123. data/lib/slack/web/api/endpoints/views.rb +1 -1
  124. data/lib/slack/web/api/endpoints/workflows.rb +61 -0
  125. data/lib/slack/web/api/errors.rb +848 -0
  126. data/lib/slack/web/api/errors/internal_error.rb +14 -0
  127. data/lib/slack/web/api/errors/slack_error.rb +12 -0
  128. data/lib/slack/web/api/mixins.rb +1 -0
  129. data/lib/slack/web/api/mixins/channels.id.rb +1 -3
  130. data/lib/slack/web/api/mixins/conversations.id.rb +25 -0
  131. data/lib/slack/web/api/mixins/groups.id.rb +1 -3
  132. data/lib/slack/web/api/mixins/ids.id.rb +3 -5
  133. data/lib/slack/web/api/mixins/users.id.rb +1 -3
  134. data/lib/slack/web/api/patches/{chat.6.block-kit-support.patch → chat.1.patch} +26 -24
  135. data/lib/slack/web/api/templates/endpoints.erb +1 -0
  136. data/lib/slack/web/api/templates/errors.erb +20 -0
  137. data/lib/slack/web/api/templates/method.erb +4 -1
  138. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  139. data/lib/slack/web/client.rb +1 -1
  140. data/lib/slack/web/config.rb +2 -0
  141. data/lib/slack/web/faraday/connection.rb +23 -20
  142. data/lib/slack/web/faraday/response/raise_error.rb +16 -2
  143. data/lib/slack/web/faraday/response/wrap_error.rb +24 -0
  144. data/lib/slack/web/pagination/cursor.rb +2 -2
  145. data/lib/tasks/real_time.rake +1 -1
  146. data/lib/tasks/web.rake +21 -4
  147. data/slack-ruby-client.gemspec +5 -5
  148. data/spec/fixtures/slack/web/channels_info.yml +108 -15
  149. data/spec/fixtures/slack/web/{groups_info.yml → conversations_info.yml} +4 -4
  150. data/spec/fixtures/slack/web/conversations_setTopic.yml +69 -0
  151. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +142 -0
  152. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +208 -0
  153. data/spec/fixtures/slack/web/views_open_error.yml +76 -0
  154. data/spec/slack/events/request_spec.rb +13 -8
  155. data/spec/slack/real_time/client_spec.rb +18 -1
  156. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  157. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  158. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  159. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  160. data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
  161. data/spec/slack/web/api/endpoints/admin_apps_approved_spec.rb +8 -0
  162. data/spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb +8 -0
  163. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
  164. data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
  165. data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +8 -0
  166. data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +32 -0
  167. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +93 -0
  168. data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +37 -0
  169. data/spec/slack/web/api/endpoints/admin_inviteRequests_approved_spec.rb +8 -0
  170. data/spec/slack/web/api/endpoints/admin_inviteRequests_denied_spec.rb +8 -0
  171. data/spec/slack/web/api/endpoints/admin_inviteRequests_spec.rb +18 -0
  172. data/spec/slack/web/api/endpoints/admin_teams_admins_spec.rb +13 -0
  173. data/spec/slack/web/api/endpoints/admin_teams_owners_spec.rb +13 -0
  174. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +53 -0
  175. data/spec/slack/web/api/endpoints/admin_teams_spec.rb +16 -0
  176. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +37 -0
  177. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +8 -0
  178. data/spec/slack/web/api/endpoints/admin_users_spec.rb +67 -0
  179. data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
  180. data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
  181. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +2 -2
  182. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +3 -3
  183. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  184. data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
  185. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +24 -0
  186. data/spec/slack/web/api/endpoints/calls_spec.rb +31 -0
  187. data/spec/slack/web/api/endpoints/conversations_spec.rb +20 -12
  188. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  189. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  190. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  191. data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
  192. data/spec/slack/web/api/endpoints/im_spec.rb +0 -31
  193. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -31
  194. data/spec/slack/web/api/endpoints/oauth_spec.rb +3 -14
  195. data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
  196. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  197. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  198. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  199. data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
  200. data/spec/slack/web/api/errors/slack_error_spec.rb +22 -0
  201. data/spec/slack/web/api/mixins/channels_spec.rb +1 -1
  202. data/spec/slack/web/api/mixins/conversations_list_spec.rb +21 -0
  203. data/spec/slack/web/api/mixins/conversations_spec.rb +43 -0
  204. data/spec/slack/web/api/mixins/groups_spec.rb +1 -1
  205. data/spec/slack/web/api/mixins/users_spec.rb +1 -1
  206. data/spec/slack/web/client_spec.rb +121 -0
  207. data/spec/slack/web/faraday/response/raise_error_spec.rb +33 -9
  208. data/spec/support/vcr.rb +4 -0
  209. metadata +145 -55
  210. data/examples/hi_real_time/Gemfile +0 -6
  211. data/examples/hi_real_time/hi.gif +0 -0
  212. data/examples/hi_real_time/hi.rb +0 -41
  213. data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
  214. data/examples/hi_real_time_async_celluloid/Procfile +0 -2
  215. data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
  216. data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
  217. data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
  218. data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
  219. data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
  220. data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
  221. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +0 -13
  222. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +0 -17
  223. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +0 -21
  224. data/lib/slack/web/api/patches/chat.4.postEphemeral-attachments-support.patch +0 -17
  225. data/lib/slack/web/api/patches/chat.5.postEphemeral-text-or-attachments.patch +0 -15
  226. data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
  227. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
  228. data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +0 -13
  229. data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +0 -13
  230. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
  231. 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 '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. )
@@ -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
@@ -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,10 +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
+ 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: 'File containing contents that can be used to improve searchability for the remote file.'
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: '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,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 'Groups methods.'
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 'Im methods.'
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
@@ -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 'Mpim methods.'
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
@@ -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))
@@ -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))
@@ -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 'Search methods.'
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