slack-ruby-client 0.16.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/danger.yml +19 -0
  3. data/.github/workflows/integtest.yml +25 -0
  4. data/.github/workflows/rubocop.yml +13 -0
  5. data/.github/workflows/test.yml +34 -0
  6. data/.gitignore +5 -3
  7. data/.rubocop.yml +6 -0
  8. data/.rubocop_todo.yml +137 -43
  9. data/CHANGELOG.md +34 -3
  10. data/CONTRIBUTING.md +4 -4
  11. data/Gemfile +18 -1
  12. data/Gemfile.danger +6 -0
  13. data/LICENSE.md +1 -1
  14. data/README.md +13 -12
  15. data/RELEASING.md +1 -1
  16. data/UPGRADING.md +42 -0
  17. data/bin/commands/admin_analytics.rb +2 -1
  18. data/bin/commands/admin_apps.rb +11 -0
  19. data/bin/commands/admin_apps_requests.rb +12 -0
  20. data/bin/commands/admin_auth_policy.rb +39 -0
  21. data/bin/commands/admin_conversations.rb +2 -1
  22. data/bin/commands/admin_conversations_restrictAccess.rb +1 -1
  23. data/bin/commands/admin_emoji.rb +2 -2
  24. data/bin/commands/admin_teams.rb +1 -1
  25. data/bin/commands/admin_users.rb +1 -0
  26. data/bin/commands/admin_users_session.rb +40 -0
  27. data/bin/commands/admin_users_unsupportedVersions.rb +15 -0
  28. data/bin/commands/apps_manifest.rb +52 -0
  29. data/bin/commands/bookmarks.rb +52 -0
  30. data/bin/commands/channels.rb +0 -157
  31. data/bin/commands/chat.rb +14 -9
  32. data/bin/commands/conversations.rb +61 -4
  33. data/bin/commands/dnd.rb +3 -1
  34. data/bin/commands/files.rb +2 -1
  35. data/bin/commands/groups.rb +0 -163
  36. data/bin/commands/im.rb +0 -62
  37. data/bin/commands/mpim.rb +0 -60
  38. data/bin/commands/oauth.rb +0 -13
  39. data/bin/commands/oauth_v2.rb +13 -1
  40. data/bin/commands/openid_connect.rb +27 -0
  41. data/bin/commands/pins.rb +2 -2
  42. data/bin/commands/reminders.rb +6 -0
  43. data/bin/commands/rtm.rb +2 -2
  44. data/bin/commands/search.rb +2 -1
  45. data/bin/commands/stars.rb +7 -6
  46. data/bin/commands/team.rb +1 -0
  47. data/bin/commands/team_billing.rb +13 -0
  48. data/bin/commands/team_preferences.rb +13 -0
  49. data/bin/commands/tooling_tokens.rb +14 -0
  50. data/bin/commands/usergroups.rb +1 -1
  51. data/bin/commands/users.rb +1 -1
  52. data/bin/commands/views.rb +1 -1
  53. data/bin/commands.rb +8 -9
  54. data/lib/slack/config.rb +1 -2
  55. data/lib/slack/events/request.rb +5 -3
  56. data/lib/slack/real_time/client.rb +6 -7
  57. data/lib/slack/real_time/concurrency/async.rb +6 -8
  58. data/lib/slack/real_time/config.rb +3 -13
  59. data/lib/slack/real_time/socket.rb +1 -2
  60. data/lib/slack/real_time/stores/base.rb +1 -6
  61. data/lib/slack/real_time/stores/starter.rb +6 -3
  62. data/lib/slack/real_time/stores/store.rb +5 -0
  63. data/lib/slack/version.rb +1 -1
  64. data/lib/slack/web/api/endpoints/admin_analytics.rb +5 -3
  65. data/lib/slack/web/api/endpoints/admin_apps.rb +21 -5
  66. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  67. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +20 -2
  68. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  69. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  70. data/lib/slack/web/api/endpoints/admin_barriers.rb +6 -6
  71. data/lib/slack/web/api/endpoints/admin_conversations.rb +28 -26
  72. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +4 -4
  73. data/lib/slack/web/api/endpoints/admin_emoji.rb +11 -11
  74. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  75. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  76. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  77. data/lib/slack/web/api/endpoints/admin_teams.rb +7 -7
  78. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  79. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  80. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  81. data/lib/slack/web/api/endpoints/admin_usergroups.rb +10 -10
  82. data/lib/slack/web/api/endpoints/admin_users.rb +20 -18
  83. data/lib/slack/web/api/endpoints/admin_users_session.rb +65 -9
  84. data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
  85. data/lib/slack/web/api/endpoints/api.rb +1 -1
  86. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  87. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +3 -3
  88. data/lib/slack/web/api/endpoints/apps_manifest.rb +77 -0
  89. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  90. data/lib/slack/web/api/endpoints/auth_teams.rb +3 -3
  91. data/lib/slack/web/api/endpoints/bookmarks.rb +86 -0
  92. data/lib/slack/web/api/endpoints/bots.rb +2 -2
  93. data/lib/slack/web/api/endpoints/calls.rb +15 -15
  94. data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
  95. data/lib/slack/web/api/endpoints/channels.rb +0 -265
  96. data/lib/slack/web/api/endpoints/chat.rb +67 -57
  97. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -3
  98. data/lib/slack/web/api/endpoints/conversations.rb +117 -27
  99. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  100. data/lib/slack/web/api/endpoints/dnd.rb +6 -3
  101. data/lib/slack/web/api/endpoints/files.rb +16 -14
  102. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  103. data/lib/slack/web/api/endpoints/files_remote.rb +20 -20
  104. data/lib/slack/web/api/endpoints/groups.rb +0 -273
  105. data/lib/slack/web/api/endpoints/im.rb +0 -107
  106. data/lib/slack/web/api/endpoints/migration.rb +3 -3
  107. data/lib/slack/web/api/endpoints/mpim.rb +0 -102
  108. data/lib/slack/web/api/endpoints/oauth.rb +5 -27
  109. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  110. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  111. data/lib/slack/web/api/endpoints/pins.rb +4 -4
  112. data/lib/slack/web/api/endpoints/reactions.rb +12 -12
  113. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  114. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  115. data/lib/slack/web/api/endpoints/search.rb +24 -16
  116. data/lib/slack/web/api/endpoints/stars.rb +11 -9
  117. data/lib/slack/web/api/endpoints/team.rb +10 -8
  118. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  119. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  120. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  121. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  122. data/lib/slack/web/api/endpoints/usergroups.rb +19 -19
  123. data/lib/slack/web/api/endpoints/usergroups_users.rb +7 -7
  124. data/lib/slack/web/api/endpoints/users.rb +16 -16
  125. data/lib/slack/web/api/endpoints/users_profile.rb +4 -4
  126. data/lib/slack/web/api/endpoints/views.rb +12 -12
  127. data/lib/slack/web/api/endpoints/workflows.rb +9 -9
  128. data/lib/slack/web/api/endpoints.rb +16 -20
  129. data/lib/slack/web/api/errors/server_error.rb +37 -0
  130. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  131. data/lib/slack/web/api/errors.rb +232 -16
  132. data/lib/slack/web/api/mixins.rb +0 -2
  133. data/lib/slack/web/api/patches/chat.1.patch +7 -9
  134. data/lib/slack/web/api/templates/endpoints.erb +0 -2
  135. data/lib/slack/web/faraday/connection.rb +5 -5
  136. data/lib/slack/web/faraday/request.rb +4 -1
  137. data/lib/slack/web/faraday/response/raise_error.rb +2 -14
  138. data/lib/slack/web/faraday/response/wrap_error.rb +11 -5
  139. data/lib/slack/web/pagination/cursor.rb +1 -5
  140. data/lib/slack-ruby-client.rb +3 -2
  141. data/lib/tasks/real_time.rake +1 -3
  142. data/lib/tasks/web.rake +4 -0
  143. data/slack-ruby-client.gemspec +5 -14
  144. data/spec/fixtures/slack/web/429_error.yml +50 -54
  145. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  146. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  147. data/spec/fixtures/slack/web/conversations_info.yml +167 -0
  148. data/spec/fixtures/slack/web/conversations_setTopic.yml +42 -27
  149. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +89 -59
  150. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +131 -86
  151. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  152. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  153. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  154. data/spec/fixtures/slack/web/users_info.yml +153 -69
  155. data/spec/fixtures/slack/web/users_list.yml +102 -41
  156. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  157. data/spec/integration/integration_spec.rb +1 -1
  158. data/spec/slack/events/request_spec.rb +7 -6
  159. data/spec/slack/real_time/client_spec.rb +37 -39
  160. data/spec/slack/real_time/concurrency/with_concurrency_spec.rb +10 -0
  161. data/spec/slack/real_time/concurrency/without_concurrency_spec.rb +10 -0
  162. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  163. data/spec/slack/real_time/event_handlers/channel_spec.rb +9 -9
  164. data/spec/slack/real_time/event_handlers/group_spec.rb +2 -2
  165. data/spec/slack/real_time/event_handlers/im_spec.rb +7 -7
  166. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  167. data/spec/slack/real_time/rtm_connect_spec.rb +1 -1
  168. data/spec/slack/real_time/rtm_start_spec.rb +1 -1
  169. data/spec/slack/real_time/store_spec.rb +2 -2
  170. data/spec/slack/slack_spec.rb +7 -5
  171. data/spec/slack/version_spec.rb +1 -1
  172. data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +5 -0
  173. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
  174. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  175. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +9 -9
  176. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +1 -1
  177. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
  178. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +22 -2
  179. data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
  180. data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
  181. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  182. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  183. data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
  184. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
  185. data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
  186. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  187. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +28 -16
  188. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +13 -0
  189. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +4 -2
  190. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  191. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +22 -14
  192. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  193. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  194. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  195. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
  196. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  197. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → openid_connect_spec.rb} +1 -1
  198. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  199. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  200. data/spec/slack/web/api/endpoints/{apps_permissions_resources_spec.rb → team_billing_spec.rb} +1 -1
  201. data/spec/slack/web/api/endpoints/team_preferences_spec.rb +8 -0
  202. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  203. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  204. data/spec/slack/web/api/error_spec.rb +5 -7
  205. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  206. data/spec/slack/web/api/mixins/conversations_list_spec.rb +1 -1
  207. data/spec/slack/web/api/pagination/cursor_spec.rb +8 -10
  208. data/spec/slack/web/client_spec.rb +46 -32
  209. data/spec/slack/web/faraday/request_spec.rb +80 -0
  210. data/spec/slack/web/faraday/response/raise_error_spec.rb +2 -1
  211. data/spec/spec_helper.rb +1 -1
  212. data/spec/support/real_time/connected_client.rb +2 -8
  213. data/spec/support/vcr.rb +33 -2
  214. metadata +50 -297
  215. data/.travis.yml +0 -28
  216. data/lib/slack/web/api/errors/internal_error.rb +0 -14
  217. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  218. data/lib/slack/web/api/mixins/channels.id.rb +0 -25
  219. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  220. data/lib/slack/web/api/mixins/groups.id.rb +0 -25
  221. data/spec/fixtures/slack/web/503_error.yml +0 -14
  222. data/spec/fixtures/slack/web/channels_info.yml +0 -139
  223. data/spec/fixtures/slack/web/groups_info.yml +0 -43
  224. data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +0 -32
  225. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  226. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  227. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -109
  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/im_spec.rb +0 -39
  231. data/spec/slack/web/api/endpoints/mpim_spec.rb +0 -39
  232. data/spec/slack/web/api/endpoints/views_spec.rb +0 -29
  233. data/spec/slack/web/api/mixins/channels_spec.rb +0 -43
  234. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
data/UPGRADING.md CHANGED
@@ -1,6 +1,48 @@
1
1
  Upgrading Slack-Ruby-Client
2
2
  ===========================
3
3
 
4
+ ### Upgrading to >= 1.0.0
5
+
6
+ #### Deprecated Methods
7
+
8
+ Slack has deprecated all `channel` and `group` methods, which have been removed from the library.
9
+
10
+ See [this announcement from Slack](https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api) for details.
11
+
12
+ #### Error Handling
13
+
14
+ As of 1.0.0 `Slack::Web::Api::Errors::ServerError` and its subclasses (introduced in 0.16.0) no longer extend `Slack::Web::Api::Errors::InternalError` or its parent `Slack::Web::Api::Errors::SlackError`. If you are rescuing `SlackError` or `InternalError` with the intention of including `ServerError` and its subclasses you should adjust your code to explicitly rescue `Slack::Web::Api::Errors::ServerError`.
15
+
16
+ ```ruby
17
+ # Before
18
+ begin
19
+ client.auth_test
20
+ rescue Slack::Web::Api::Errors::SlackError
21
+ # Includes all server errors
22
+ end
23
+
24
+ # After
25
+ begin
26
+ client.auth_test
27
+ rescue Slack::Web::Api::Errors::SlackError, Slack::Web::Api::Errors::ServerError
28
+ # Need to rescue the server errors separately from SlackError
29
+ end
30
+ ```
31
+
32
+ Additionally the `initialize` method for `ParsingError`, `TimeoutError`, and `UnavailableError` have changed from `new(message, response)` to `new(response)`. The `message` is now built into the definition of these classes. If you are instantiating or raising these errors in your code (perhaps in tests) you will need to update your code.
33
+
34
+ ```ruby
35
+ # Before
36
+ error = Slack::Web::Api::Errors::TimeoutError.new('timeout_error', response)
37
+ error.message
38
+ # => 'timeout_error'
39
+
40
+ # After
41
+ error = Slack::Web::Api::Errors::TimeoutError.new(response)
42
+ error.message
43
+ # => 'timeout_error'
44
+ ```
45
+
4
46
  ### Upgrading to >= 0.16.0
5
47
 
6
48
  #### Removed Celluloid and Faye-Websocket Concurrency Support
@@ -6,8 +6,9 @@ command 'admin_analytics' do |g|
6
6
  g.desc 'Retrieve analytics data for a given date, presented as a compressed JSON file'
7
7
  g.long_desc %( Retrieve analytics data for a given date, presented as a compressed JSON file )
8
8
  g.command 'getFile' do |c|
9
- c.flag 'type', desc: 'The type of analytics to retrieve. The options are currently limited to member.'
9
+ c.flag 'type', desc: 'The type of analytics to retrieve. The options are currently limited to member (for grid member analytics) and public_channel (for public channel analytics).'
10
10
  c.flag 'date', desc: 'Date to retrieve the analytics data for, expressed as YYYY-MM-DD in UTC.'
11
+ c.flag 'metadata_only', desc: 'Retrieve metadata for the type of analytics indicated. Can be used only with type set to public_channel analytics. See detail below. Omit the date parameter when using this argument.'
11
12
  c.action do |_global_options, options, _args|
12
13
  puts JSON.dump($client.admin_analytics_getFile(options))
13
14
  end
@@ -37,4 +37,15 @@ command 'admin_apps' do |g|
37
37
  puts JSON.dump($client.admin_apps_restrict(options))
38
38
  end
39
39
  end
40
+
41
+ g.desc 'Uninstall an app from one or many workspaces, or an entire enterprise organization.'
42
+ g.long_desc %( Uninstall an app from one or many workspaces, or an entire enterprise organization. )
43
+ g.command 'uninstall' do |c|
44
+ c.flag 'app_id', desc: 'The ID of the app to uninstall.'
45
+ c.flag 'enterprise_id', desc: 'The enterprise to completely uninstall the application from (across all workspaces). With an org-level token, this or team_ids is required.'
46
+ c.flag 'team_ids', desc: 'IDs of the teams to uninstall from (max 100). With an org-level token, this or enterprise_id is required.'
47
+ c.action do |_global_options, options, _args|
48
+ puts JSON.dump($client.admin_apps_uninstall(options))
49
+ end
50
+ end
40
51
  end
@@ -3,10 +3,22 @@
3
3
 
4
4
  desc 'AdminAppsRequests methods.'
5
5
  command 'admin_apps_requests' do |g|
6
+ g.desc 'Cancel approval request for team'
7
+ g.long_desc %( Cancel approval request for team )
8
+ g.command 'cancel' do |c|
9
+ c.flag 'request_id', desc: 'The id of the request to cancel.'
10
+ c.flag 'enterprise_id', desc: 'The ID of the enterprise where this request belongs.'
11
+ c.flag 'team_id', desc: 'The ID of the workspace where this request belongs.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.admin_apps_requests_cancel(options))
14
+ end
15
+ end
16
+
6
17
  g.desc 'List app requests for a team/workspace.'
7
18
  g.long_desc %( List app requests for a team/workspace. )
8
19
  g.command 'list' do |c|
9
20
  c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
21
+ c.flag 'enterprise_id', desc: '.'
10
22
  c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
11
23
  c.flag 'team_id', desc: '.'
12
24
  c.action do |_global_options, options, _args|
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AdminAuthPolicy methods.'
5
+ command 'admin_auth_policy' do |g|
6
+ g.desc 'Assign entities to a particular authentication policy.'
7
+ g.long_desc %( Assign entities to a particular authentication policy. )
8
+ g.command 'assignEntities' do |c|
9
+ c.flag 'entity_ids', desc: 'Array of IDs to assign to the policy.'
10
+ c.flag 'entity_type', desc: 'The type of entity to assign to the policy. Currently, USER is supported.'
11
+ c.flag 'policy_name', desc: 'The name of the authentication policy to assign the entities to. Currently, email_password is the only policy that may be used with this method.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.admin_auth_policy_assignEntities(options))
14
+ end
15
+ end
16
+
17
+ g.desc 'Fetch all the entities assigned to a particular authentication policy by name.'
18
+ g.long_desc %( Fetch all the entities assigned to a particular authentication policy by name. )
19
+ g.command 'getEntities' do |c|
20
+ c.flag 'policy_name', desc: 'The name of the policy to fetch entities for. Currently, email_password is the only policy that may be used with this method.'
21
+ c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
22
+ c.flag 'entity_type', desc: 'The type of entity to assign to the policy. Currently, USER is supported.'
23
+ c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 and 1000, both inclusive.'
24
+ c.action do |_global_options, options, _args|
25
+ puts JSON.dump($client.admin_auth_policy_getEntities(options))
26
+ end
27
+ end
28
+
29
+ g.desc 'Remove specified entities from a specified authentication policy.'
30
+ g.long_desc %( Remove specified entities from a specified authentication policy. )
31
+ g.command 'removeEntities' do |c|
32
+ c.flag 'entity_ids', desc: "Encoded IDs of the entities you'd like to remove from the policy."
33
+ c.flag 'entity_type', desc: 'The type of entity to assign to the policy. Currently, USER is supported.'
34
+ c.flag 'policy_name', desc: 'The name of the policy to remove entities from. Currently, email_password is the only policy that may be used with this method.'
35
+ c.action do |_global_options, options, _args|
36
+ puts JSON.dump($client.admin_auth_policy_removeEntities(options))
37
+ end
38
+ end
39
+ end
@@ -16,6 +16,7 @@ command 'admin_conversations' do |g|
16
16
  g.long_desc %( Convert a public channel to a private channel. )
17
17
  g.command 'convertToPrivate' do |c|
18
18
  c.flag 'channel_id', desc: 'The channel to convert to private.'
19
+ c.flag 'name', desc: 'Name of private channel to create. Only respected when converting an MPIM.'
19
20
  c.action do |_global_options, options, _args|
20
21
  puts JSON.dump($client.admin_conversations_convertToPrivate(options))
21
22
  end
@@ -47,7 +48,7 @@ command 'admin_conversations' do |g|
47
48
  g.long_desc %( Disconnect a connected channel from one or more workspaces. )
48
49
  g.command 'disconnectShared' do |c|
49
50
  c.flag 'channel_id', desc: 'The channel to be disconnected from some workspaces.'
50
- c.flag 'leaving_team_ids', desc: 'The team to be removed from the channel. Currently only a single team id can be specified.'
51
+ c.flag 'leaving_team_ids', desc: 'team IDs getting removed from the channel, optional if there are only two teams in the channel.'
51
52
  c.action do |_global_options, options, _args|
52
53
  puts JSON.dump($client.admin_conversations_disconnectShared(options))
53
54
  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 'Add and remove user groups from conversations.'
4
+ desc 'AdminConversationsRestrictaccess methods.'
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 )
@@ -16,8 +16,8 @@ command 'admin_emoji' do |g|
16
16
  g.desc 'Add an emoji alias.'
17
17
  g.long_desc %( Add an emoji alias. )
18
18
  g.command 'addAlias' do |c|
19
- c.flag 'alias_for', desc: 'The alias of the emoji.'
20
- c.flag 'name', desc: 'The name of the emoji to be aliased. Colons (:myemoji:) around the value are not required, although they may be included.'
19
+ c.flag 'alias_for', desc: 'Name of the emoji for which the alias is being made. Any wrapping whitespace or colons will be automatically trimmed.'
20
+ c.flag 'name', desc: 'The new alias for the specified emoji. Any wrapping whitespace or colons will be automatically trimmed.'
21
21
  c.action do |_global_options, options, _args|
22
22
  puts JSON.dump($client.admin_emoji_addAlias(options))
23
23
  end
@@ -6,7 +6,7 @@ command 'admin_teams' do |g|
6
6
  g.desc 'Create an Enterprise team.'
7
7
  g.long_desc %( Create an Enterprise team. )
8
8
  g.command 'create' do |c|
9
- c.flag 'team_domain', desc: 'Team domain (for example, slacksoftballteam).'
9
+ c.flag 'team_domain', desc: 'Team domain (for example, slacksoftballteam). Domains are limited to 21 characters.'
10
10
  c.flag 'team_name', desc: 'Team name (for example, Slack Softball Team).'
11
11
  c.flag 'team_description', desc: 'Description for the team.'
12
12
  c.flag 'team_discoverability', desc: "Who can join the team. A team's discoverability can be open, closed, invite_only, or unlisted."
@@ -23,6 +23,7 @@ command 'admin_users' do |g|
23
23
  c.flag 'email', desc: 'The email address of the person to invite.'
24
24
  c.flag 'team_id', desc: 'The ID (T1234) of the workspace.'
25
25
  c.flag 'custom_message', desc: 'An optional message to send to the user in the invite email.'
26
+ c.flag 'email_password_policy_enabled', desc: 'Allow invited user to sign in via email and password. Only available for Enterprise Grid teams via admin invite.'
26
27
  c.flag 'guest_expiration_ts', desc: 'Timestamp when guest account should be disabled. Only include this timestamp if you are inviting a guest user and you want their account to expire on a certain date.'
27
28
  c.flag 'is_restricted', desc: 'Is this user a multi-channel guest user? (default: false).'
28
29
  c.flag 'is_ultra_restricted', desc: 'Is this user a single channel guest user? (default: false).'
@@ -3,6 +3,24 @@
3
3
 
4
4
  desc 'AdminUsersSession methods.'
5
5
  command 'admin_users_session' do |g|
6
+ g.desc 'Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users.'
7
+ g.long_desc %( Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users. )
8
+ g.command 'clearSettings' do |c|
9
+ c.flag 'user_ids', desc: "The IDs of users you'd like to clear session settings for."
10
+ c.action do |_global_options, options, _args|
11
+ puts JSON.dump($client.admin_users_session_clearSettings(options))
12
+ end
13
+ end
14
+
15
+ g.desc 'Get user-specific session settings—the session duration and what happens when the client closes—given a list of users.'
16
+ g.long_desc %( Get user-specific session settings—the session duration and what happens when the client closes—given a list of users. )
17
+ g.command 'getSettings' do |c|
18
+ c.flag 'user_ids', desc: "The IDs of users you'd like to fetch session settings for. Note: if a user does not have any active sessions, they will not be returned in the response."
19
+ c.action do |_global_options, options, _args|
20
+ puts JSON.dump($client.admin_users_session_getSettings(options))
21
+ end
22
+ end
23
+
6
24
  g.desc 'Revoke a single session for a user. The user will be forced to login to Slack.'
7
25
  g.long_desc %( Revoke a single session for a user. The user will be forced to login to Slack. )
8
26
  g.command 'invalidate' do |c|
@@ -35,4 +53,26 @@ command 'admin_users_session' do |g|
35
53
  puts JSON.dump($client.admin_users_session_reset(options))
36
54
  end
37
55
  end
56
+
57
+ g.desc 'Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users'
58
+ g.long_desc %( Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users )
59
+ g.command 'resetBulk' do |c|
60
+ c.flag 'user_ids', desc: 'The ID of the user to wipe sessions for.'
61
+ c.flag 'mobile_only', desc: 'Only expire mobile sessions (default: false).'
62
+ c.flag 'web_only', desc: 'Only expire web sessions (default: false).'
63
+ c.action do |_global_options, options, _args|
64
+ puts JSON.dump($client.admin_users_session_resetBulk(options))
65
+ end
66
+ end
67
+
68
+ g.desc 'Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users.'
69
+ g.long_desc %( Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users. )
70
+ g.command 'setSettings' do |c|
71
+ c.flag 'user_ids', desc: 'The list of user IDs to apply the session settings for.'
72
+ c.flag 'desktop_app_browser_quit', desc: 'Terminate the session when the client—either the desktop app or a browser window—is closed.'
73
+ c.flag 'duration', desc: "The session duration, in seconds. The minimum value is 28800, which represents 8 hours; the max value is 315569520 or 10 years (that's a long Slack session)."
74
+ c.action do |_global_options, options, _args|
75
+ puts JSON.dump($client.admin_users_session_setSettings(options))
76
+ end
77
+ end
38
78
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AdminUsersUnsupportedversions methods.'
5
+ command 'admin_users_unsupportedVersions' do |g|
6
+ g.desc 'Ask Slackbot to send you an export listing all workspace members using unsupported software, presented as a zipped CSV file.'
7
+ g.long_desc %( Ask Slackbot to send you an export listing all workspace members using unsupported software, presented as a zipped CSV file. )
8
+ g.command 'export' do |c|
9
+ c.flag 'date_end_of_support', desc: 'Unix timestamp of the date of past or upcoming end of support cycles. If not provided will include all announced end of support cycles.'
10
+ c.flag 'date_sessions_started', desc: 'Unix timestamp of a date to start looking for user sessions. If not provided will start six months ago.'
11
+ c.action do |_global_options, options, _args|
12
+ puts JSON.dump($client.admin_users_unsupportedVersions_export(options))
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'AppsManifest methods.'
5
+ command 'apps_manifest' do |g|
6
+ g.desc 'Create an app from an app manifest.'
7
+ g.long_desc %( Create an app from an app manifest. )
8
+ g.command 'create' do |c|
9
+ c.flag 'manifest', desc: 'A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one.'
10
+ c.action do |_global_options, options, _args|
11
+ puts JSON.dump($client.apps_manifest_create(options))
12
+ end
13
+ end
14
+
15
+ g.desc 'Permanently deletes an app created through app manifests'
16
+ g.long_desc %( Permanently deletes an app created through app manifests )
17
+ g.command 'delete' do |c|
18
+ c.flag 'app_id', desc: 'The ID of the app you want to delete.'
19
+ c.action do |_global_options, options, _args|
20
+ puts JSON.dump($client.apps_manifest_delete(options))
21
+ end
22
+ end
23
+
24
+ g.desc 'Export an app manifest from an existing app'
25
+ g.long_desc %( Export an app manifest from an existing app )
26
+ g.command 'export' do |c|
27
+ c.flag 'app_id', desc: 'The ID of the app whose configuration you want to export as a manifest.'
28
+ c.action do |_global_options, options, _args|
29
+ puts JSON.dump($client.apps_manifest_export(options))
30
+ end
31
+ end
32
+
33
+ g.desc 'Update an app from an app manifest'
34
+ g.long_desc %( Update an app from an app manifest )
35
+ g.command 'update' do |c|
36
+ c.flag 'app_id', desc: 'The ID of the app whose configuration you want to update.'
37
+ c.flag 'manifest', desc: 'A JSON app manifest encoded as a string. This manifest must use a valid app manifest schema - read our guide to creating one. As this method entirely replaces any previous configuration, manifest must contain both unmodified and modified fields.'
38
+ c.action do |_global_options, options, _args|
39
+ puts JSON.dump($client.apps_manifest_update(options))
40
+ end
41
+ end
42
+
43
+ g.desc 'Validate an app manifest'
44
+ g.long_desc %( Validate an app manifest )
45
+ g.command 'validate' do |c|
46
+ c.flag 'manifest', desc: 'The manifest to be validated. Will be validated against the app manifest schema - read our guide.'
47
+ c.flag 'app_id', desc: 'The ID of the app whose configuration you want to validate.'
48
+ c.action do |_global_options, options, _args|
49
+ puts JSON.dump($client.apps_manifest_validate(options))
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # This file was auto-generated by lib/tasks/web.rake
3
+
4
+ desc 'Bookmarks methods.'
5
+ command 'bookmarks' do |g|
6
+ g.desc 'Add bookmark to a channel.'
7
+ g.long_desc %( Add bookmark to a channel. )
8
+ g.command 'add' do |c|
9
+ c.flag 'channel_id', desc: 'Channel to add bookmark in.'
10
+ c.flag 'title', desc: 'Title for the bookmark.'
11
+ c.flag 'type', desc: 'Type of the bookmark i.e link.'
12
+ c.flag 'emoji', desc: 'Emoji tag to apply to the link.'
13
+ c.flag 'entity_id', desc: 'ID of the entity being bookmarked. Only applies to message and file types.'
14
+ c.flag 'link', desc: 'Link to bookmark.'
15
+ c.flag 'parent_id', desc: "Id of this bookmark's parent."
16
+ c.action do |_global_options, options, _args|
17
+ puts JSON.dump($client.bookmarks_add(options))
18
+ end
19
+ end
20
+
21
+ g.desc 'Edit bookmark.'
22
+ g.long_desc %( Edit bookmark. )
23
+ g.command 'edit' do |c|
24
+ c.flag 'bookmark_id', desc: 'Bookmark to update.'
25
+ c.flag 'channel_id', desc: 'Channel to update bookmark in.'
26
+ c.flag 'emoji', desc: 'Emoji tag to apply to the link.'
27
+ c.flag 'link', desc: 'Link to bookmark.'
28
+ c.flag 'title', desc: 'Title for the bookmark.'
29
+ c.action do |_global_options, options, _args|
30
+ puts JSON.dump($client.bookmarks_edit(options))
31
+ end
32
+ end
33
+
34
+ g.desc 'List bookmark for the channel.'
35
+ g.long_desc %( List bookmark for the channel. )
36
+ g.command 'list' do |c|
37
+ c.flag 'channel_id', desc: 'Channel to list bookmarks in.'
38
+ c.action do |_global_options, options, _args|
39
+ puts JSON.dump($client.bookmarks_list(options))
40
+ end
41
+ end
42
+
43
+ g.desc 'Remove bookmark from the channel.'
44
+ g.long_desc %( Remove bookmark from the channel. )
45
+ g.command 'remove' do |c|
46
+ c.flag 'bookmark_id', desc: 'Bookmark to remove.'
47
+ c.flag 'channel_id', desc: 'Channel to remove bookmark.'
48
+ c.action do |_global_options, options, _args|
49
+ puts JSON.dump($client.bookmarks_remove(options))
50
+ end
51
+ end
52
+ end
@@ -3,26 +3,6 @@
3
3
 
4
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
- g.desc 'Archives a channel.'
7
- g.long_desc %( Archives a channel. )
8
- g.command 'archive' do |c|
9
- c.flag 'channel', desc: 'Channel to archive.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.channels_archive(options))
12
- end
13
- end
14
-
15
- g.desc 'Creates a channel.'
16
- g.long_desc %( Creates a channel. )
17
- g.command 'create' do |c|
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.'
20
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
21
- c.action do |_global_options, options, _args|
22
- puts JSON.dump($client.channels_create(options))
23
- end
24
- end
25
-
26
6
  g.desc 'Delete a channel (undocumented)'
27
7
  g.long_desc %( Delete a channel )
28
8
  g.command 'delete' do |c|
@@ -32,19 +12,6 @@ command 'channels' do |g|
32
12
  end
33
13
  end
34
14
 
35
- g.desc 'Fetches history of messages and events from a channel.'
36
- g.long_desc %( Fetches history of messages and events from a channel. )
37
- g.command 'history' do |c|
38
- c.flag 'channel', desc: 'Channel to fetch history for.'
39
- c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
40
- c.flag 'latest', desc: 'End of time range of messages to include in results.'
41
- c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
42
- c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
43
- c.action do |_global_options, options, _args|
44
- puts JSON.dump($client.channels_history(options))
45
- end
46
- end
47
-
48
15
  g.desc 'This method returns the ID of a team channel.'
49
16
  g.long_desc %( This method returns the ID of a team channel. )
50
17
  g.command 'id' do |c|
@@ -53,128 +20,4 @@ command 'channels' do |g|
53
20
  puts JSON.dump($client.channels_id(options))
54
21
  end
55
22
  end
56
-
57
- g.desc 'Gets information about a channel.'
58
- g.long_desc %( Gets information about a channel. )
59
- g.command 'info' do |c|
60
- c.flag 'channel', desc: 'Channel to get info on.'
61
- c.flag 'include_locale', desc: 'Set this to true to receive the locale for this channel. Defaults to false.'
62
- c.action do |_global_options, options, _args|
63
- puts JSON.dump($client.channels_info(options))
64
- end
65
- end
66
-
67
- g.desc 'Invites a user to a channel.'
68
- g.long_desc %( Invites a user to a channel. )
69
- g.command 'invite' do |c|
70
- c.flag 'channel', desc: 'Channel to invite user to.'
71
- c.flag 'user', desc: 'User to invite to channel.'
72
- c.action do |_global_options, options, _args|
73
- puts JSON.dump($client.channels_invite(options))
74
- end
75
- end
76
-
77
- g.desc 'Joins a channel, creating it if needed.'
78
- g.long_desc %( Joins a channel, creating it if needed. )
79
- g.command 'join' do |c|
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.'
82
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
83
- c.action do |_global_options, options, _args|
84
- puts JSON.dump($client.channels_join(options))
85
- end
86
- end
87
-
88
- g.desc 'Removes a user from a channel.'
89
- g.long_desc %( Removes a user from a channel. )
90
- g.command 'kick' do |c|
91
- c.flag 'channel', desc: 'Channel to remove user from.'
92
- c.flag 'user', desc: 'User to remove from channel.'
93
- c.action do |_global_options, options, _args|
94
- puts JSON.dump($client.channels_kick(options))
95
- end
96
- end
97
-
98
- g.desc 'Leaves a channel.'
99
- g.long_desc %( Leaves a channel. )
100
- g.command 'leave' do |c|
101
- c.flag 'channel', desc: 'Channel to leave.'
102
- c.action do |_global_options, options, _args|
103
- puts JSON.dump($client.channels_leave(options))
104
- end
105
- end
106
-
107
- g.desc 'Lists all channels in a Slack team.'
108
- g.long_desc %( Lists all channels in a Slack team. )
109
- g.command 'list' do |c|
110
- 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."
111
- c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.'
112
- c.flag 'exclude_members', desc: 'Exclude the members collection from each channel.'
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.'
115
- c.action do |_global_options, options, _args|
116
- puts JSON.dump($client.channels_list(options))
117
- end
118
- end
119
-
120
- g.desc 'Sets the read cursor in a channel.'
121
- g.long_desc %( Sets the read cursor in a channel. )
122
- g.command 'mark' do |c|
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.'
125
- c.action do |_global_options, options, _args|
126
- puts JSON.dump($client.channels_mark(options))
127
- end
128
- end
129
-
130
- g.desc 'Renames a channel.'
131
- g.long_desc %( Renames a channel. )
132
- g.command 'rename' do |c|
133
- c.flag 'channel', desc: 'Channel to rename.'
134
- c.flag 'name', desc: 'New name for channel.'
135
- c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
136
- c.action do |_global_options, options, _args|
137
- puts JSON.dump($client.channels_rename(options))
138
- end
139
- end
140
-
141
- g.desc 'Retrieve a thread of messages posted to a channel'
142
- g.long_desc %( Retrieve a thread of messages posted to a channel )
143
- g.command 'replies' do |c|
144
- c.flag 'channel', desc: 'Channel to fetch thread from.'
145
- c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
146
- c.action do |_global_options, options, _args|
147
- puts JSON.dump($client.channels_replies(options))
148
- end
149
- end
150
-
151
- g.desc 'Sets the purpose for a channel.'
152
- g.long_desc %( Sets the purpose for a channel. )
153
- g.command 'setPurpose' do |c|
154
- c.flag 'channel', desc: 'Channel to set the purpose of.'
155
- c.flag 'purpose', desc: 'The new purpose.'
156
- c.flag 'name_tagging', desc: 'if it is true, treat this like a message and not an unescaped thing.'
157
- c.action do |_global_options, options, _args|
158
- puts JSON.dump($client.channels_setPurpose(options))
159
- end
160
- end
161
-
162
- g.desc 'Sets the topic for a channel.'
163
- g.long_desc %( Sets the topic for a channel. )
164
- g.command 'setTopic' do |c|
165
- c.flag 'channel', desc: 'Channel to set the topic of.'
166
- c.flag 'topic', desc: 'The new topic.'
167
- c.action do |_global_options, options, _args|
168
- puts JSON.dump($client.channels_setTopic(options))
169
- end
170
- end
171
-
172
- g.desc 'Unarchives a channel.'
173
- g.long_desc %( Unarchives a channel. )
174
- g.command 'unarchive' do |c|
175
- c.flag 'channel', desc: 'Channel to unarchive.'
176
- c.action do |_global_options, options, _args|
177
- puts JSON.dump($client.channels_unarchive(options))
178
- end
179
- end
180
23
  end
data/bin/commands/chat.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 'Post chat messages to Slack.'
4
+ desc 'Chat methods.'
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 )
@@ -59,11 +59,11 @@ command 'chat' do |g|
59
59
  g.desc 'Sends an ephemeral message to a user in a channel.'
60
60
  g.long_desc %( Sends an ephemeral message to a user in a channel. )
61
61
  g.command 'postEphemeral' do |c|
62
- c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
63
62
  c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.'
64
63
  c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
65
64
  c.flag 'user', desc: 'id of the user who will receive the ephemeral message. The user should be in the channel specified by the channel argument.'
66
65
  c.flag 'as_user', desc: 'Pass true to post the message as the authed user. Defaults to true if the chat:write:bot scope is not included. Otherwise, defaults to false.'
66
+ c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
67
67
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
68
68
  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.'
69
69
  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.'
@@ -80,12 +80,12 @@ command 'chat' do |g|
80
80
  g.long_desc %( Sends a message to a channel. )
81
81
  g.command 'postMessage' do |c|
82
82
  c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
83
- c.flag 'text', desc: 'How this field works and whether it is required depends on other fields you use in your API call. See below for more detail.'
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
83
  c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
86
84
  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. 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.'
85
+ c.flag 'text', desc: 'The formatted text of the message to be published. If blocks are included, this will become the fallback text used in notifications.'
86
+ 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.'
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.'
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.'
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. See authorship below. Use with bot tokens requires chat:write.customize."
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."
97
97
  c.action do |_global_options, options, _args|
98
98
  puts JSON.dump($client.chat_postMessage(options))
99
99
  end
@@ -122,10 +122,13 @@ command 'chat' do |g|
122
122
  g.desc 'Provide custom unfurl behavior for user-posted URLs'
123
123
  g.long_desc %( Provide custom unfurl behavior for user-posted URLs )
124
124
  g.command 'unfurl' do |c|
125
- c.flag 'channel', desc: 'Channel ID of the message.'
125
+ c.flag 'channel', desc: 'Channel ID of the message. Both channel and ts must be provided together, or unfurl_id and source must be provided together.'
126
126
  c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
127
127
  c.flag 'unfurls', desc: 'URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments.'
128
- c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
128
+ c.flag 'source', desc: 'The source of the link to unfurl. The source may either be composer, when the link is inside the message composer, or conversations_history, when the link has been posted to a conversation.'
129
+ c.flag 'unfurl_id', desc: 'The ID of the link to unfurl. Both unfurl_id and source must be provided together, or channel and ts must be provided together.'
130
+ c.flag 'user_auth_blocks', desc: 'Provide a JSON based array of structured blocks presented as URL-encoded string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior.'
131
+ c.flag 'user_auth_message', desc: 'Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior. Provides two buttons, Not now or Never ask me again.'
129
132
  c.flag 'user_auth_required', desc: 'Set to true or 1 to indicate the user must install your Slack app to trigger unfurls for this domain.'
130
133
  c.flag 'user_auth_url', desc: 'Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.'
131
134
  c.action do |_global_options, options, _args|
@@ -141,8 +144,10 @@ command 'chat' do |g|
141
144
  c.flag 'as_user', desc: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.'
142
145
  c.flag 'attachments', desc: "A JSON-based array of structured attachments, presented as a URL-encoded string. This field is required when not presenting text. If you don't include this field, the message's previous attachments will be retained. To remove previous attachments, include an empty array for this field."
143
146
  c.flag 'blocks', desc: "A JSON-based array of structured blocks, presented as a URL-encoded string. If you don't include this field, the message's previous blocks will be retained. To remove previous blocks, include an empty array for this field."
147
+ c.flag 'file_ids', desc: 'Array of new file ids that will be sent with this message.'
144
148
  c.flag 'link_names', desc: 'Find and link channel names and usernames. Defaults to none. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, none.'
145
149
  c.flag 'parse', desc: 'Change how messages are treated. Defaults to client, unlike chat.postMessage. Accepts either none or full. If you do not specify a value for this field, the original value set for the message will be overwritten with the default, client.'
150
+ c.flag 'reply_broadcast', desc: 'Broadcast an existing thread reply to make it visible to everyone in the channel or conversation.'
146
151
  c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments."
147
152
  c.action do |_global_options, options, _args|
148
153
  puts JSON.dump($client.chat_update(options))