slack-ruby-client 0.17.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -0
  3. data/.rubocop_todo.yml +65 -31
  4. data/.travis.yml +1 -0
  5. data/CHANGELOG.md +10 -0
  6. data/CONTRIBUTING.md +3 -3
  7. data/README.md +5 -5
  8. data/RELEASING.md +1 -1
  9. data/UPGRADING.md +42 -0
  10. data/bin/commands/admin_apps.rb +11 -0
  11. data/bin/commands/admin_apps_requests.rb +1 -0
  12. data/bin/commands/admin_auth_policy.rb +39 -0
  13. data/bin/commands/admin_conversations.rb +10 -0
  14. data/bin/commands/admin_conversations_restrictAccess.rb +1 -1
  15. data/bin/commands/admin_users.rb +1 -0
  16. data/bin/commands/admin_users_session.rb +40 -0
  17. data/bin/commands/apps_manifest.rb +51 -0
  18. data/bin/commands/chat.rb +9 -6
  19. data/bin/commands/conversations.rb +59 -2
  20. data/bin/commands/dnd.rb +1 -1
  21. data/bin/commands/files.rb +2 -1
  22. data/bin/commands/oauth.rb +0 -13
  23. data/bin/commands/oauth_v2.rb +13 -1
  24. data/bin/commands/openid_connect.rb +27 -0
  25. data/bin/commands/pins.rb +2 -2
  26. data/bin/commands/reminders.rb +6 -0
  27. data/bin/commands/rtm.rb +2 -2
  28. data/bin/commands/search.rb +2 -1
  29. data/bin/commands/stars.rb +7 -6
  30. data/bin/commands/team_billing.rb +13 -0
  31. data/bin/commands/team_preferences.rb +13 -0
  32. data/bin/commands/tooling_tokens.rb +14 -0
  33. data/bin/commands/usergroups.rb +1 -1
  34. data/bin/commands/users.rb +1 -1
  35. data/bin/commands/views.rb +1 -1
  36. data/bin/commands.rb +6 -8
  37. data/lib/slack/config.rb +1 -2
  38. data/lib/slack/events/request.rb +3 -1
  39. data/lib/slack/real_time/client.rb +4 -5
  40. data/lib/slack/real_time/concurrency/async.rb +6 -8
  41. data/lib/slack/real_time/socket.rb +1 -2
  42. data/lib/slack/real_time/stores/base.rb +1 -6
  43. data/lib/slack/real_time/stores/starter.rb +6 -3
  44. data/lib/slack/real_time/stores/store.rb +5 -0
  45. data/lib/slack/version.rb +1 -1
  46. data/lib/slack/web/api/endpoints/admin_analytics.rb +3 -3
  47. data/lib/slack/web/api/endpoints/admin_apps.rb +21 -5
  48. data/lib/slack/web/api/endpoints/admin_apps_approved.rb +2 -2
  49. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +4 -2
  50. data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +2 -2
  51. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +72 -0
  52. data/lib/slack/web/api/endpoints/admin_barriers.rb +6 -6
  53. data/lib/slack/web/api/endpoints/admin_conversations.rb +38 -24
  54. data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +4 -4
  55. data/lib/slack/web/api/endpoints/admin_emoji.rb +9 -9
  56. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +7 -7
  57. data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +3 -3
  58. data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
  59. data/lib/slack/web/api/endpoints/admin_teams.rb +6 -6
  60. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +2 -2
  61. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -2
  62. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +5 -5
  63. data/lib/slack/web/api/endpoints/admin_usergroups.rb +10 -10
  64. data/lib/slack/web/api/endpoints/admin_users.rb +20 -18
  65. data/lib/slack/web/api/endpoints/admin_users_session.rb +65 -9
  66. data/lib/slack/web/api/endpoints/api.rb +1 -1
  67. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  68. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +3 -3
  69. data/lib/slack/web/api/endpoints/apps_manifest.rb +75 -0
  70. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  71. data/lib/slack/web/api/endpoints/auth_teams.rb +3 -3
  72. data/lib/slack/web/api/endpoints/bots.rb +2 -2
  73. data/lib/slack/web/api/endpoints/calls.rb +15 -15
  74. data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
  75. data/lib/slack/web/api/endpoints/chat.rb +60 -54
  76. data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +3 -3
  77. data/lib/slack/web/api/endpoints/conversations.rb +115 -25
  78. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  79. data/lib/slack/web/api/endpoints/dnd.rb +4 -5
  80. data/lib/slack/web/api/endpoints/files.rb +16 -14
  81. data/lib/slack/web/api/endpoints/files_comments.rb +1 -1
  82. data/lib/slack/web/api/endpoints/files_remote.rb +20 -20
  83. data/lib/slack/web/api/endpoints/migration.rb +3 -3
  84. data/lib/slack/web/api/endpoints/oauth.rb +5 -27
  85. data/lib/slack/web/api/endpoints/oauth_v2.rb +24 -6
  86. data/lib/slack/web/api/endpoints/openid_connect.rb +42 -0
  87. data/lib/slack/web/api/endpoints/pins.rb +4 -4
  88. data/lib/slack/web/api/endpoints/reactions.rb +12 -12
  89. data/lib/slack/web/api/endpoints/reminders.rb +17 -5
  90. data/lib/slack/web/api/endpoints/rtm.rb +10 -10
  91. data/lib/slack/web/api/endpoints/search.rb +24 -16
  92. data/lib/slack/web/api/endpoints/stars.rb +11 -9
  93. data/lib/slack/web/api/endpoints/team.rb +8 -8
  94. data/lib/slack/web/api/endpoints/team_billing.rb +21 -0
  95. data/lib/slack/web/api/endpoints/team_preferences.rb +21 -0
  96. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  97. data/lib/slack/web/api/endpoints/tooling_tokens.rb +24 -0
  98. data/lib/slack/web/api/endpoints/usergroups.rb +19 -19
  99. data/lib/slack/web/api/endpoints/usergroups_users.rb +7 -7
  100. data/lib/slack/web/api/endpoints/users.rb +16 -16
  101. data/lib/slack/web/api/endpoints/users_profile.rb +4 -4
  102. data/lib/slack/web/api/endpoints/views.rb +12 -12
  103. data/lib/slack/web/api/endpoints/workflows.rb +9 -9
  104. data/lib/slack/web/api/endpoints.rb +12 -18
  105. data/lib/slack/web/api/errors/server_error.rb +37 -0
  106. data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -4
  107. data/lib/slack/web/api/errors.rb +200 -8
  108. data/lib/slack/web/api/mixins.rb +0 -2
  109. data/lib/slack/web/api/patches/chat.1.patch +1 -2
  110. data/lib/slack/web/api/templates/endpoints.erb +0 -2
  111. data/lib/slack/web/faraday/request.rb +2 -1
  112. data/lib/slack/web/faraday/response/raise_error.rb +1 -1
  113. data/lib/slack/web/faraday/response/wrap_error.rb +2 -2
  114. data/lib/slack/web/pagination/cursor.rb +1 -5
  115. data/lib/slack-ruby-client.rb +1 -1
  116. data/slack-ruby-client.gemspec +2 -3
  117. data/spec/fixtures/slack/web/429_error.yml +50 -54
  118. data/spec/fixtures/slack/web/auth_test_error.yml +51 -18
  119. data/spec/fixtures/slack/web/auth_test_success.yml +50 -26
  120. data/spec/fixtures/slack/web/conversations_info.yml +133 -9
  121. data/spec/fixtures/slack/web/conversations_setTopic.yml +42 -27
  122. data/spec/fixtures/slack/web/conversations_setTopic_one_page.yml +89 -59
  123. data/spec/fixtures/slack/web/conversations_setTopic_paginated.yml +131 -86
  124. data/spec/fixtures/slack/web/paginated_users_list.yml +501 -69
  125. data/spec/fixtures/slack/web/rtm_connect.yml +267 -30
  126. data/spec/fixtures/slack/web/rtm_start.yml +771 -60
  127. data/spec/fixtures/slack/web/users_info.yml +153 -69
  128. data/spec/fixtures/slack/web/users_list.yml +102 -41
  129. data/spec/fixtures/slack/web/views_open_error.yml +49 -42
  130. data/spec/slack/real_time/client_spec.rb +17 -21
  131. data/spec/slack/real_time/event_handlers/bot_spec.rb +1 -1
  132. data/spec/slack/real_time/event_handlers/channel_spec.rb +1 -1
  133. data/spec/slack/real_time/event_handlers/im_spec.rb +5 -5
  134. data/spec/slack/real_time/event_handlers/user_spec.rb +2 -2
  135. data/spec/slack/slack_spec.rb +3 -1
  136. data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
  137. data/spec/slack/web/api/endpoints/admin_auth_policy_spec.rb +35 -0
  138. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +14 -9
  139. data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +1 -1
  140. data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
  141. data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +22 -2
  142. data/spec/slack/web/api/endpoints/admin_users_spec.rb +8 -8
  143. data/spec/slack/web/api/endpoints/apps_manifest_spec.rb +36 -0
  144. data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
  145. data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
  146. data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
  147. data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +4 -6
  148. data/spec/slack/web/api/endpoints/custom_specs/conversations_spec.rb +1 -1
  149. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +2 -2
  150. data/spec/slack/web/api/endpoints/dnd_spec.rb +0 -5
  151. data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
  152. data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
  153. data/spec/slack/web/api/endpoints/oauth_spec.rb +0 -11
  154. data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +6 -3
  155. data/spec/slack/web/api/endpoints/{im_spec.rb → openid_connect_spec.rb} +1 -1
  156. data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
  157. data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
  158. data/spec/slack/web/api/endpoints/{mpim_spec.rb → team_billing_spec.rb} +1 -1
  159. data/spec/slack/web/api/endpoints/{apps_permissions_scopes_spec.rb → team_preferences_spec.rb} +1 -1
  160. data/spec/slack/web/api/endpoints/tooling_tokens_spec.rb +13 -0
  161. data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
  162. data/spec/slack/web/api/error_spec.rb +5 -7
  163. data/spec/slack/web/api/errors/slack_error_spec.rb +21 -26
  164. data/spec/slack/web/api/mixins/conversations_list_spec.rb +1 -1
  165. data/spec/slack/web/api/pagination/cursor_spec.rb +1 -3
  166. data/spec/slack/web/client_spec.rb +7 -6
  167. data/spec/slack/web/faraday/request_spec.rb +80 -0
  168. data/spec/slack/web/faraday/response/raise_error_spec.rb +1 -0
  169. data/spec/spec_helper.rb +1 -1
  170. data/spec/support/real_time/connected_client.rb +1 -7
  171. data/spec/support/vcr.rb +33 -2
  172. metadata +28 -144
  173. data/lib/slack/web/api/errors/internal_error.rb +0 -14
  174. data/lib/slack/web/api/mixins/channels.id.json +0 -20
  175. data/lib/slack/web/api/mixins/channels.id.rb +0 -25
  176. data/lib/slack/web/api/mixins/groups.id.json +0 -20
  177. data/lib/slack/web/api/mixins/groups.id.rb +0 -25
  178. data/spec/fixtures/slack/web/503_error.yml +0 -14
  179. data/spec/fixtures/slack/web/channels_info.yml +0 -139
  180. data/spec/slack/web/api/endpoints/apps_permissions_resources_spec.rb +0 -8
  181. data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +0 -16
  182. data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +0 -19
  183. data/spec/slack/web/api/endpoints/conversations_spec.rb +0 -109
  184. data/spec/slack/web/api/mixins/channels_spec.rb +0 -43
  185. data/spec/slack/web/api/mixins/groups_spec.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 568ad92dd27f6edd04fc00905af2a928c9f03f2d08105637b9ffc9f01319eaa3
4
- data.tar.gz: 579f9004c9b1b9e3608bb2b59e55f0d09f0dbcba6761ad8035e367d4b9f06f4f
3
+ metadata.gz: 5fa18d8339ff27661d942ef4d0cee003ff8e1146db504063a736374c5f5bf940
4
+ data.tar.gz: fc3bca990c3ad938a23db950b2008932a29518363360ada378856e71f2c1b477
5
5
  SHA512:
6
- metadata.gz: ab4943fb7a0bf3e1a75141943ee97324dfded3c6e5d691fc1ffa939c43c82f105f4763fed7496f45a1bf1b2b119ffeefa272df484d0e46bcb6f000cbd0906a78
7
- data.tar.gz: '0857c64cf4544b3c0b744662ba38f94daad70b38069334a7b59beb4cf0999a47c9ec19e225a899f01e9cfd6c2336823e26b97ba0fce1ebbd498585952fec305d'
6
+ metadata.gz: 932b6be224f16a7873a24907074944eea9ac8fcb47e35f7f9ef876d11df396197771c44727738b63267e4da45cd5c2050084972844a76fa6134fc54e2a9aa0d6
7
+ data.tar.gz: 8a5904155cd7b3d52fbeca8c9a0887bca7eabe4bb4b668174aa4accb5cfefb7784ec91f3e3d9182fef44d6a994168b72c4530c36a74cf2d7564eec6a0e204ea5
data/.rubocop.yml CHANGED
@@ -5,6 +5,8 @@ require:
5
5
  - rubocop-rspec
6
6
 
7
7
  AllCops:
8
+ TargetRubyVersion: 2.5
9
+ NewCops: enable
8
10
  DisplayCopNames: true
9
11
  Exclude:
10
12
  - bin/**/*
@@ -32,6 +34,9 @@ Style/Documentation:
32
34
  Style/ModuleFunction:
33
35
  Enabled: false
34
36
 
37
+ RSpec/InstanceVariable:
38
+ Enabled: false
39
+
35
40
  Naming/FileName:
36
41
  Exclude:
37
42
  - lib/slack-ruby-client.rb # Required to match gemspec name
data/.rubocop_todo.yml CHANGED
@@ -1,11 +1,29 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-08-24 10:08:11 -0400 using RuboCop version 0.82.0.
3
+ # on 2021-12-21 14:31:33 UTC using RuboCop version 0.93.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 1
10
+ # Configuration parameters: Include.
11
+ # Include: **/*.gemspec
12
+ Gemspec/RequiredRubyVersion:
13
+ Exclude:
14
+ - 'slack-ruby-client.gemspec'
15
+
16
+ # Offense count: 1
17
+ Lint/ConstantDefinitionInBlock:
18
+ Exclude:
19
+ - 'lib/tasks/real_time.rake'
20
+
21
+ # Offense count: 2
22
+ Lint/MissingSuper:
23
+ Exclude:
24
+ - 'lib/slack/real_time/stores/starter.rb'
25
+ - 'lib/slack/real_time/stores/store.rb'
26
+
9
27
  # Offense count: 1
10
28
  # Cop supports --auto-correct.
11
29
  Lint/NonDeterministicRequireOrder:
@@ -18,18 +36,18 @@ Lint/RedundantCopDisableDirective:
18
36
  Exclude:
19
37
  - 'lib/slack-ruby-client.rb'
20
38
 
21
- # Offense count: 11
39
+ # Offense count: 12
22
40
  # Configuration parameters: IgnoredMethods.
23
41
  Metrics/AbcSize:
24
- Max: 39
42
+ Max: 48
25
43
 
26
- # Offense count: 2
44
+ # Offense count: 4
27
45
  # Configuration parameters: IgnoredMethods.
28
46
  Metrics/CyclomaticComplexity:
29
- Max: 9
47
+ Max: 14
30
48
 
31
- # Offense count: 14
32
- # Configuration parameters: CountComments, ExcludedMethods.
49
+ # Offense count: 12
50
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
33
51
  Metrics/MethodLength:
34
52
  Max: 32
35
53
 
@@ -38,10 +56,10 @@ Metrics/MethodLength:
38
56
  Metrics/ParameterLists:
39
57
  Max: 6
40
58
 
41
- # Offense count: 1
59
+ # Offense count: 2
42
60
  # Configuration parameters: IgnoredMethods.
43
61
  Metrics/PerceivedComplexity:
44
- Max: 9
62
+ Max: 16
45
63
 
46
64
  # Offense count: 2
47
65
  # Cop supports --auto-correct.
@@ -49,46 +67,36 @@ Performance/RegexpMatch:
49
67
  Exclude:
50
68
  - 'lib/tasks/web.rake'
51
69
 
52
- # Offense count: 5
70
+ # Offense count: 3
53
71
  # Cop supports --auto-correct.
54
72
  RSpec/ContextMethod:
55
73
  Exclude:
56
74
  - 'spec/slack/messages/formatting_spec.rb'
57
- - 'spec/slack/web/api/mixins/channels_spec.rb'
58
- - 'spec/slack/web/api/mixins/groups_spec.rb'
59
75
  - 'spec/slack/web/api/mixins/users_spec.rb'
60
76
 
61
- # Offense count: 72
77
+ # Offense count: 77
62
78
  # Configuration parameters: Prefixes.
63
79
  # Prefixes: when, with, without
64
80
  RSpec/ContextWording:
65
81
  Enabled: false
66
82
 
67
- # Offense count: 131
83
+ # Offense count: 127
68
84
  # Cop supports --auto-correct.
69
85
  # Configuration parameters: AllowConsecutiveOneLiners.
70
86
  RSpec/EmptyLineAfterExample:
71
87
  Enabled: false
72
88
 
73
- # Offense count: 66
89
+ # Offense count: 62
74
90
  # Configuration parameters: Max.
75
91
  RSpec/ExampleLength:
76
92
  Enabled: false
77
93
 
78
- # Offense count: 18
94
+ # Offense count: 16
79
95
  # Configuration parameters: CustomTransform, IgnoreMethods.
80
96
  RSpec/FilePath:
81
97
  Enabled: false
82
98
 
83
- # Offense count: 14
84
- # Configuration parameters: AssignmentOnly.
85
- RSpec/InstanceVariable:
86
- Exclude:
87
- - 'spec/integration/integration_spec.rb'
88
- - 'spec/slack/real_time/client_spec.rb'
89
- - 'spec/slack/slack_spec.rb'
90
-
91
- # Offense count: 77
99
+ # Offense count: 65
92
100
  # Configuration parameters: .
93
101
  # SupportedStyles: have_received, receive
94
102
  RSpec/MessageSpies:
@@ -98,25 +106,23 @@ RSpec/MessageSpies:
98
106
  RSpec/MultipleExpectations:
99
107
  Max: 5
100
108
 
101
- # Offense count: 2
109
+ # Offense count: 3
102
110
  # Configuration parameters: IgnoreSharedExamples.
103
111
  RSpec/NamedSubject:
104
112
  Exclude:
105
113
  - 'spec/slack/web/api/mixins/conversations_list_spec.rb'
106
114
 
107
- # Offense count: 37
115
+ # Offense count: 48
108
116
  RSpec/NestedGroups:
109
117
  Max: 6
110
118
 
111
- # Offense count: 4
119
+ # Offense count: 2
112
120
  RSpec/SubjectStub:
113
121
  Exclude:
114
- - 'spec/slack/web/api/mixins/channels_spec.rb'
115
122
  - 'spec/slack/web/api/mixins/conversations_spec.rb'
116
- - 'spec/slack/web/api/mixins/groups_spec.rb'
117
123
  - 'spec/slack/web/api/mixins/users_spec.rb'
118
124
 
119
- # Offense count: 16
125
+ # Offense count: 12
120
126
  # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
121
127
  RSpec/VerifiedDoubles:
122
128
  Exclude:
@@ -130,3 +136,31 @@ RSpec/VerifiedDoubles:
130
136
  # SupportedStyles: annotated, template, unannotated
131
137
  Style/FormatStringToken:
132
138
  EnforcedStyle: unannotated
139
+
140
+ # Offense count: 6
141
+ # Cop supports --auto-correct.
142
+ Style/GlobalStdStream:
143
+ Exclude:
144
+ - 'lib/slack/logger.rb'
145
+ - 'lib/tasks/real_time.rake'
146
+ - 'spec/integration/integration_spec.rb'
147
+ - 'spec/slack/web/client_spec.rb'
148
+
149
+ # Offense count: 1
150
+ # Cop supports --auto-correct.
151
+ Style/MultilineTernaryOperator:
152
+ Exclude:
153
+ - 'spec/support/vcr.rb'
154
+
155
+ # Offense count: 1
156
+ # Configuration parameters: AllowedMethods.
157
+ # AllowedMethods: respond_to_missing?
158
+ Style/OptionalBooleanParameter:
159
+ Exclude:
160
+ - 'spec/support/queue_with_timeout.rb'
161
+
162
+ # Offense count: 1
163
+ # Cop supports --auto-correct.
164
+ Style/StringConcatenation:
165
+ Exclude:
166
+ - 'lib/tasks/real_time.rake'
data/.travis.yml CHANGED
@@ -6,6 +6,7 @@ rvm:
6
6
  - 2.5.3
7
7
  - 2.6.0
8
8
  - 2.7.1
9
+ - 3.0.2
9
10
  - ruby-head
10
11
  - jruby-head
11
12
 
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### 1.0.0 (2021/12/21)
2
+
3
+ * [#394](https://github.com/slack-ruby/slack-ruby-client/pull/394): Added support for Ruby 3.0 - [@dblock](https://github.com/dblock).
4
+ * [#394](https://github.com/slack-ruby/slack-ruby-client/pull/394): Upgraded to RuboCop 0.93.1 - [@dblock](https://github.com/dblock).
5
+ * [#393](https://github.com/slack-ruby/slack-ruby-client/pull/393): Removed deprecated `oauth_token`, and leftover traces of `channels` and `groups` APIs - [@dblock](https://github.com/dblock).
6
+ * [#393](https://github.com/slack-ruby/slack-ruby-client/pull/393): Added `admin_auth_policy_assignEntities`, `admin_auth_policy_getEntities` and `admin_auth_policy_removeEntities` `admin_conversations_disconnectShared`, `admin_users_session_clearSettings`, `admin_users_session_getSettings`, `admin_users_session_resetBulk`, `admin_users_session_setSettings`, `apps_manifest_create`, `apps_manifest_delete`, `apps_manifest_export`, `apps_manifest_update`, `apps_manifest_validate`, `conversations_acceptSharedInvite`, `conversations_approveSharedInvite`, `conversations_declineSharedInvite`, `conversations_inviteShared`, `conversations_listConnectInvites`, `oauth_v2_exchange`, `openid_connect_token`, `openid_connect_userInfo`, `team_billing_info`, `team_preferences_list`, `tooling_tokens_rotate` - [@dblock](https://github.com/dblock).
7
+ * [#386](https://github.com/slack-ruby/slack-ruby-client/pull/386): Gemspec: drop unused `test_files` directive - [@olleolleolle](https://github.com/olleolleolle).
8
+ * [#380](https://github.com/slack-ruby/slack-ruby-client/pull/380): Updates to server error classes and hierarchy - [@jmanian](https://github.com/jmanian).
9
+ * [#387](https://github.com/slack-ruby/slack-ruby-client/pull/387): Send token in Authorization header - [@chrisbloom7](https://github.com/chrisbloom7).
10
+
1
11
  ### 0.17.0 (2021/03/07)
2
12
 
3
13
  * [#370](https://github.com/slack-ruby/slack-ruby-client/pull/370): Removed deprecated `im_`, `mpim_`, `channels_`, and `groups_` methods - [@dblock](https://github.com/dblock).
data/CONTRIBUTING.md CHANGED
@@ -29,9 +29,9 @@ bundle exec rake
29
29
 
30
30
  Sign up for Slack, create a private slack group for yourself.
31
31
 
32
- Create a new Bot Integration under [services/new/bot](http://slack.com/services/new/bot).
32
+ Create a new App under [https://api.slack.com/apps](https://api.slack.com/apps).
33
33
 
34
- ![](screenshots/register-bot.png)
34
+ ![](screenshots/create-app.png)
35
35
 
36
36
  On the next screen, note the API token.
37
37
 
@@ -68,7 +68,7 @@ Make sure that `bundle exec rake` completes without errors.
68
68
  Slack Web API is updated from https://github.com/slack-ruby/slack-api-ref, a maintained, machine-readable version of Slack API Docs, generated by scraping [api.slack.com](https://api.slack.com). To update the Web API from the latest definition run the following Rake task.
69
69
 
70
70
  ```
71
- rake slack:api:update
71
+ bundle exec rake slack:api:update
72
72
  ```
73
73
 
74
74
  #### Patching Slack Web API
data/README.md CHANGED
@@ -2,14 +2,14 @@ Slack Ruby Client
2
2
  =================
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/slack-ruby-client.svg)](http://badge.fury.io/rb/slack-ruby-client)
5
- [![Build Status](https://travis-ci.org/slack-ruby/slack-ruby-client.svg?branch=master)](https://travis-ci.org/slack-ruby/slack-ruby-client)
5
+ [![Build Status](https://app.travis-ci.com/slack-ruby/slack-ruby-client.svg?branch=master)](https://app.travis-ci.com/slack-ruby/slack-ruby-client)
6
6
  [![Code Climate](https://codeclimate.com/github/slack-ruby/slack-ruby-client/badges/gpa.svg)](https://codeclimate.com/github/slack-ruby/slack-ruby-client)
7
7
 
8
8
  A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messaging](https://api.slack.com/rtm) and [Events](https://api.slack.com/events-api) APIs. Comes with a handy command-line client, too. If you are not familiar with these concepts, you might want to watch [this video](http://code.dblock.org/2016/03/11/your-first-slack-bot-service-video.html).
9
9
 
10
10
  ![](slack.png)
11
11
 
12
- ## Table of Contents
12
+ # Table of Contents
13
13
 
14
14
  - [Useful to Me?](#useful-to-me)
15
15
  - [Stable Release](#stable-release)
@@ -70,7 +70,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
70
70
 
71
71
  ## Stable Release
72
72
 
73
- You're reading the documentation for the **stable** release of slack-ruby-client, 0.17.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
73
+ You're reading the documentation for the **stable** release of slack-ruby-client, v1.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
74
74
 
75
75
  ## Installation
76
76
 
@@ -324,9 +324,9 @@ If you exceed [Slack’s rate limits](https://api.slack.com/docs/rate-limits), a
324
324
 
325
325
  ##### Other Errors
326
326
 
327
- In case of Slack temporarily unavailability a `Slack::Web::Api::Errors::ServerError` (`Slack::Web::Api::Errors::SlackError` subclass) subclasses will be raised and original `Faraday::Error` will be accesible via `exception.cause`.
327
+ When Slack is temporarily unavailable a subclass of `Slack::Web::Api::Errors::ServerError` will be raised and the original `Faraday::Error` will be accesible via `exception.cause`. (Starting with 0.18.0 this is no longer a subclass of `Slack::Web::Api::Errors::SlackError`.)
328
328
 
329
- Specifically `Slack::Web::Api::Errors::ParsingError` will be raised on non-json response (i. e. 200 OK with `Slack unavailable` HTML page) and `Slack::Web::Api::Errors::HttpRequestError` subclasses for connection failures (`Slack::Web::Api::Errors::TimeoutError` for read/open timeouts & `Slack::Web::Api::Errors::UnavailableError` for 5xx HTTP responses).
329
+ Specifically `Slack::Web::Api::Errors::ParsingError` will be raised on non-json response (i.e. 200 OK with `Slack unavailable` HTML page) and `Slack::Web::Api::Errors::HttpRequestError` subclasses for connection failures (`Slack::Web::Api::Errors::TimeoutError` for read/open timeouts & `Slack::Web::Api::Errors::UnavailableError` for 5xx HTTP responses).
330
330
 
331
331
  In any other case, a `Faraday::ClientError` will be raised.
332
332
 
data/RELEASING.md CHANGED
@@ -11,7 +11,7 @@ bundle install
11
11
  rake
12
12
  ```
13
13
 
14
- Check that the last build succeeded in [Travis CI](https://travis-ci.org/slack-ruby/slack-ruby-client) for all supported platforms.
14
+ Check that the last build succeeded in [Travis CI](https://app.travis-ci.com/github/slack-ruby/slack-ruby-client) for all supported platforms.
15
15
 
16
16
  Change "Next" in [CHANGELOG.md](CHANGELOG.md) to the current date.
17
17
 
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
@@ -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
@@ -7,6 +7,7 @@ command 'admin_apps_requests' do |g|
7
7
  g.long_desc %( List app requests for a team/workspace. )
8
8
  g.command 'list' do |c|
9
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 'enterprise_id', desc: '.'
10
11
  c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
11
12
  c.flag 'team_id', desc: '.'
12
13
  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
@@ -43,6 +43,16 @@ command 'admin_conversations' do |g|
43
43
  end
44
44
  end
45
45
 
46
+ g.desc 'Disconnect a connected channel from one or more workspaces.'
47
+ g.long_desc %( Disconnect a connected channel from one or more workspaces. )
48
+ g.command 'disconnectShared' do |c|
49
+ c.flag 'channel_id', desc: 'The channel to be disconnected from some workspaces.'
50
+ c.flag 'leaving_team_ids', desc: 'team IDs getting removed from the channel, optional if there are only two teams in the channel.'
51
+ c.action do |_global_options, options, _args|
52
+ puts JSON.dump($client.admin_conversations_disconnectShared(options))
53
+ end
54
+ end
55
+
46
56
  g.desc 'Get conversation preferences for a public or private channel.'
47
57
  g.long_desc %( Get conversation preferences for a public or private channel. )
48
58
  g.command 'getConversationPrefs' do |c|
@@ -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 )
@@ -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,51 @@
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.action do |_global_options, options, _args|
48
+ puts JSON.dump($client.apps_manifest_validate(options))
49
+ end
50
+ end
51
+ 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,17 +80,16 @@ 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 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot. Defaults to false. See authorship below.'
84
83
  c.flag 'attachments', desc: 'A JSON-based array of structured attachments, presented as a URL-encoded string.'
85
84
  c.flag 'blocks', desc: 'A JSON-based array of structured blocks, presented as a URL-encoded string.'
86
- c.flag 'draft_id', desc: 'The id of the draft associated with the message.'
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
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
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.'
92
92
  c.flag 'reply_broadcast', desc: 'Used in conjunction with thread_ts and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to false.'
93
- 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.'
94
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."
95
94
  c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
96
95
  c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
@@ -123,9 +122,11 @@ command 'chat' do |g|
123
122
  g.desc 'Provide custom unfurl behavior for user-posted URLs'
124
123
  g.long_desc %( Provide custom unfurl behavior for user-posted URLs )
125
124
  g.command 'unfurl' do |c|
126
- 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.'
127
126
  c.flag 'ts', desc: 'Timestamp of the message to add unfurl behavior to.'
128
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 '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.'
129
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.'
130
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.'
131
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.'
@@ -143,8 +144,10 @@ command 'chat' do |g|
143
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.'
144
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."
145
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.'
146
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.'
147
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.'
148
151
  c.flag 'text', desc: "New text for the message, using the default formatting rules. It's not required when presenting blocks or attachments."
149
152
  c.action do |_global_options, options, _args|
150
153
  puts JSON.dump($client.chat_update(options))