slack-ruby-client 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/{integtest.yml → integration_test.yml} +6 -5
  3. data/.github/workflows/{rubocop.yml → lint.yml} +5 -4
  4. data/.github/workflows/{danger.yml → pr_lint.yml} +8 -6
  5. data/.github/workflows/test.yml +4 -2
  6. data/.gitignore +0 -1
  7. data/.rubocop.yml +4 -0
  8. data/.rubocop_todo.yml +8 -14
  9. data/.ruby-version +1 -0
  10. data/CHANGELOG.md +14 -0
  11. data/CONTRIBUTING.md +5 -4
  12. data/Gemfile +1 -6
  13. data/README.md +60 -63
  14. data/RELEASING.md +1 -1
  15. data/UPGRADING.md +28 -0
  16. data/bin/commands/admin_audit_anomaly_allow.rb +23 -0
  17. data/bin/commands/admin_conversations.rb +12 -11
  18. data/bin/commands/admin_users.rb +1 -1
  19. data/bin/commands/admin_users_session.rb +1 -1
  20. data/bin/commands/apps_connections.rb +2 -2
  21. data/bin/commands/bookmarks.rb +1 -0
  22. data/bin/commands/chat.rb +9 -6
  23. data/bin/commands/conversations.rb +8 -6
  24. data/bin/commands/files.rb +24 -0
  25. data/bin/commands/rtm.rb +0 -15
  26. data/bin/commands/views.rb +4 -2
  27. data/bin/commands.rb +1 -0
  28. data/bin/slack +1 -1
  29. data/lib/slack/real_time/api/message.rb +3 -2
  30. data/lib/slack/real_time/api/templates/event_handler.erb +5 -1
  31. data/lib/slack/real_time/api/typing.rb +2 -1
  32. data/lib/slack/real_time/client.rb +8 -26
  33. data/lib/slack/real_time/config.rb +3 -3
  34. data/lib/slack/real_time/models/channel.rb +4 -0
  35. data/lib/slack/real_time/models/{group.rb → mpim.rb} +1 -1
  36. data/lib/slack/real_time/models.rb +2 -1
  37. data/lib/slack/real_time/stores/base.rb +25 -9
  38. data/lib/slack/real_time/stores/starter.rb +323 -309
  39. data/lib/slack/real_time/stores/store.rb +265 -198
  40. data/lib/slack/real_time/stores.rb +1 -7
  41. data/lib/slack/version.rb +1 -1
  42. data/lib/slack/web/api/endpoints/admin_analytics.rb +1 -1
  43. data/lib/slack/web/api/endpoints/admin_apps.rb +2 -2
  44. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +1 -1
  45. data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +34 -0
  46. data/lib/slack/web/api/endpoints/admin_auth_policy.rb +7 -7
  47. data/lib/slack/web/api/endpoints/admin_barriers.rb +8 -8
  48. data/lib/slack/web/api/endpoints/admin_conversations.rb +30 -28
  49. data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +6 -6
  50. data/lib/slack/web/api/endpoints/admin_emoji.rb +7 -7
  51. data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +2 -2
  52. data/lib/slack/web/api/endpoints/admin_teams.rb +2 -2
  53. data/lib/slack/web/api/endpoints/admin_teams_admins.rb +1 -1
  54. data/lib/slack/web/api/endpoints/admin_teams_owners.rb +1 -1
  55. data/lib/slack/web/api/endpoints/admin_teams_settings.rb +11 -11
  56. data/lib/slack/web/api/endpoints/admin_usergroups.rb +7 -7
  57. data/lib/slack/web/api/endpoints/admin_users.rb +16 -16
  58. data/lib/slack/web/api/endpoints/admin_users_session.rb +8 -8
  59. data/lib/slack/web/api/endpoints/apps.rb +2 -2
  60. data/lib/slack/web/api/endpoints/apps_connections.rb +1 -1
  61. data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +1 -1
  62. data/lib/slack/web/api/endpoints/apps_manifest.rb +6 -6
  63. data/lib/slack/web/api/endpoints/bookmarks.rb +10 -8
  64. data/lib/slack/web/api/endpoints/bots.rb +1 -1
  65. data/lib/slack/web/api/endpoints/calls.rb +5 -5
  66. data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
  67. data/lib/slack/web/api/endpoints/chat.rb +36 -30
  68. data/lib/slack/web/api/endpoints/conversations.rb +37 -33
  69. data/lib/slack/web/api/endpoints/dialog.rb +2 -2
  70. data/lib/slack/web/api/endpoints/dnd.rb +1 -1
  71. data/lib/slack/web/api/endpoints/files.rb +45 -8
  72. data/lib/slack/web/api/endpoints/files_comments.rb +2 -2
  73. data/lib/slack/web/api/endpoints/files_remote.rb +8 -8
  74. data/lib/slack/web/api/endpoints/migration.rb +1 -1
  75. data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
  76. data/lib/slack/web/api/endpoints/pins.rb +3 -3
  77. data/lib/slack/web/api/endpoints/reactions.rb +4 -4
  78. data/lib/slack/web/api/endpoints/reminders.rb +5 -5
  79. data/lib/slack/web/api/endpoints/rtm.rb +0 -23
  80. data/lib/slack/web/api/endpoints/search.rb +3 -3
  81. data/lib/slack/web/api/endpoints/tooling_tokens.rb +1 -1
  82. data/lib/slack/web/api/endpoints/usergroups.rb +4 -4
  83. data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -3
  84. data/lib/slack/web/api/endpoints/users.rb +4 -4
  85. data/lib/slack/web/api/endpoints/users_admin.rb +2 -2
  86. data/lib/slack/web/api/endpoints/views.rb +16 -11
  87. data/lib/slack/web/api/endpoints/workflows.rb +4 -4
  88. data/lib/slack/web/api/endpoints.rb +2 -0
  89. data/lib/slack/web/api/errors.rb +56 -6
  90. data/lib/slack/web/api/mixins/conversations.id.rb +1 -1
  91. data/lib/slack/web/api/mixins/users.id.rb +1 -1
  92. data/lib/slack/web/api/mixins/users.search.rb +2 -1
  93. data/lib/slack/web/api/patches/{chat.1.patch → chat.attachments-blocks.patch} +13 -14
  94. data/lib/slack/web/api/patches/{dialog.1.open-json-support.patch → dialog.encoded-json.patch} +4 -4
  95. data/lib/slack/web/api/patches/views.view-json.patch +55 -0
  96. data/lib/slack/web/api/templates/method.erb +1 -1
  97. data/lib/slack/web/config.rb +2 -2
  98. data/lib/tasks/real_time.rake +44 -22
  99. data/lib/tasks/web.rake +9 -2
  100. data/spec/fixtures/slack/web/rtm_connect.yml +85 -1
  101. data/spec/slack/events/config_spec.rb +2 -0
  102. data/spec/slack/events/request_spec.rb +4 -0
  103. data/spec/slack/messages/formatting_spec.rb +10 -0
  104. data/spec/slack/real_time/api/message_spec.rb +1 -1
  105. data/spec/slack/real_time/api/ping_spec.rb +1 -1
  106. data/spec/slack/real_time/api/typing_spec.rb +1 -1
  107. data/spec/slack/real_time/client_spec.rb +73 -111
  108. data/spec/slack/real_time/event_handlers/bot_spec.rb +19 -17
  109. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
  110. data/spec/slack/real_time/event_handlers/im_spec.rb +28 -25
  111. data/spec/slack/real_time/event_handlers/{group_spec.rb → private_channel_spec.rb} +35 -27
  112. data/spec/slack/real_time/event_handlers/{channel_spec.rb → public_channel_spec.rb} +24 -20
  113. data/spec/slack/real_time/event_handlers/team_spec.rb +7 -8
  114. data/spec/slack/real_time/event_handlers/user_spec.rb +6 -5
  115. data/spec/slack/real_time/stores/store_spec.rb +50 -0
  116. data/spec/slack/slack_spec.rb +1 -0
  117. data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +8 -0
  118. data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +17 -1
  119. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +2 -0
  120. data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +13 -4
  121. data/spec/slack/web/api/endpoints/files_spec.rb +13 -0
  122. data/spec/slack/web/api/mixins/conversations_spec.rb +2 -0
  123. data/spec/slack/web/api/mixins/users_spec.rb +2 -0
  124. data/spec/slack/web/api/pagination/cursor_spec.rb +4 -0
  125. data/spec/slack/web/client_spec.rb +14 -4
  126. data/spec/support/real_time/loaded_client.rb +120 -0
  127. metadata +18 -35
  128. data/bin/commands/admin_conversations_whitelist.rb +0 -37
  129. data/bin/commands/apps_permissions.rb +0 -23
  130. data/bin/commands/apps_permissions_resources.rb +0 -15
  131. data/bin/commands/apps_permissions_scopes.rb +0 -13
  132. data/bin/commands/apps_permissions_users.rb +0 -26
  133. data/bin/commands/channels.rb +0 -23
  134. data/bin/commands/groups.rb +0 -14
  135. data/bin/commands/im.rb +0 -6
  136. data/bin/commands/mpim.rb +0 -6
  137. data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +0 -64
  138. data/lib/slack/web/api/endpoints/apps_permissions.rb +0 -36
  139. data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +0 -31
  140. data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +0 -21
  141. data/lib/slack/web/api/endpoints/apps_permissions_users.rb +0 -50
  142. data/lib/slack/web/api/endpoints/channels.rb +0 -25
  143. data/lib/slack/web/api/endpoints/groups.rb +0 -13
  144. data/lib/slack/web/api/endpoints/im.rb +0 -13
  145. data/lib/slack/web/api/endpoints/mpim.rb +0 -13
  146. data/lib/slack/web/api/endpoints/presence.rb +0 -23
  147. data/lib/slack/web/api/patches/views.1.view-json.patch +0 -40
  148. data/lib/slack/web/api/patches/views.1.views-published.patch +0 -16
  149. data/spec/fixtures/slack/web/rtm_start.yml +0 -815
  150. data/spec/slack/real_time/rtm_start_spec.rb +0 -14
  151. data/spec/slack/real_time/store_spec.rb +0 -12
@@ -0,0 +1,120 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.shared_context 'loaded client' do
4
+ before do
5
+ client.users['U07KECJ77'] = Slack::RealTime::Models::User.new(
6
+ id: 'U07KECJ77',
7
+ team_id: 'T04KB5WQH',
8
+ name: 'aws',
9
+ deleted: true,
10
+ profile: { title: '', real_name: 'AWS Cloud', display_name: 'aws' },
11
+ is_bot: true,
12
+ is_app_user: false,
13
+ updated: 1504224679,
14
+ presence: 'away'
15
+ )
16
+ client.users['U0J1GAHN1'] = Slack::RealTime::Models::User.new(
17
+ id: 'U0J1GAHN1',
18
+ team_id: 'T04KB5WQH',
19
+ name: 'travis-ci',
20
+ deleted: false,
21
+ color: '5a4592',
22
+ presence: 'away',
23
+ real_name: 'travis-ci',
24
+ tz: 'America\/Los_Angeles',
25
+ tz_label: 'Pacific Standard Time',
26
+ profile: {
27
+ title: 'Used for Travis-CI integration tests on https://github.com/dblock/slack-ruby-client.',
28
+ real_name: 'travis-ci',
29
+ bot_id: 'B0J1L75DY',
30
+ team: 'T04KB5WQH'
31
+ }
32
+ )
33
+
34
+ client.bots['B0751JU2H'] = Slack::RealTime::Models::Bot.new(
35
+ id: 'B0751JU2H',
36
+ name: 'bot',
37
+ deleted: false,
38
+ updated: 1435864714
39
+ )
40
+
41
+ client.public_channels['C0HNTD0CW'] = Slack::RealTime::Models::Channel.new(
42
+ id: 'C0HNTD0CW',
43
+ name: 'chess',
44
+ is_channel: true,
45
+ is_group: false,
46
+ is_im: false,
47
+ is_mpim: false,
48
+ is_private: false,
49
+ created: 1452005790,
50
+ is_archived: false,
51
+ is_general: false,
52
+ unlinked: 0,
53
+ name_normalized: 'chess',
54
+ is_shared: false,
55
+ is_org_shared: false,
56
+ is_pending_ext_shared: false,
57
+ pending_shared: [],
58
+ parent_conversation: nil,
59
+ creator: 'U04KB5WQR',
60
+ is_ext_shared: false,
61
+ shared_team_ids: ['T04KB5WQH'],
62
+ pending_connected_team_ids: [],
63
+ has_pins: false,
64
+ is_member: false,
65
+ previous_names: [],
66
+ priority: 0
67
+ )
68
+ client.public_channels['C0HLE0BBL'] = Slack::RealTime::Models::Channel.new(
69
+ id: 'C0HLE0BBL',
70
+ name: 'gifs',
71
+ is_channel: true,
72
+ is_group: false,
73
+ is_im: false,
74
+ is_mpim: false,
75
+ is_private: false,
76
+ created: 1451913914,
77
+ is_archived: true,
78
+ is_general: false
79
+ )
80
+ client.public_channels['C0JHNAB5H'] = Slack::RealTime::Models::Channel.new(
81
+ id: 'C0JHNAB5H',
82
+ name: 'rubybot-test',
83
+ is_channel: true,
84
+ is_group: false,
85
+ is_private: false,
86
+ members: %w[U0J1GAHN1 U07518DTL]
87
+ )
88
+
89
+ client.public_channels['C0BTNJI59'] = Slack::RealTime::Models::Channel.new(
90
+ id: 'C0BTNJI59',
91
+ name: 'recent-priv-chan',
92
+ is_channel: true,
93
+ is_group: false,
94
+ is_private: true,
95
+ members: %w[U0J1GAHN1 U07518DTL]
96
+ )
97
+ client.private_channels['G0K7EV5A7'] = Slack::RealTime::Models::Channel.new(
98
+ id: 'G0K7EV5A7',
99
+ name: 'mpdm-dblock--rubybot--player1-1',
100
+ is_channel: false,
101
+ is_group: true,
102
+ is_im: false,
103
+ is_mpim: true,
104
+ is_private: true,
105
+ is_archived: false,
106
+ members: %w[U04KB5WQR U0J1GAHN1 U07518DTL],
107
+ created: 1453561861,
108
+ creator: 'U04KB5WQR'
109
+ )
110
+
111
+ client.ims['D0J1H6QTV'] = Slack::RealTime::Models::Im.new(
112
+ id: 'D0J1H6QTV',
113
+ is_im: true,
114
+ is_archived: false,
115
+ is_open: true,
116
+ user: 'U04KB5WQR',
117
+ created: 1452270861
118
+ )
119
+ end
120
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-05 00:00:00.000000000 Z
11
+ date: 2022-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -102,15 +102,16 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".github/FUNDING.yml"
105
- - ".github/workflows/danger.yml"
106
- - ".github/workflows/integtest.yml"
107
- - ".github/workflows/rubocop.yml"
105
+ - ".github/workflows/integration_test.yml"
106
+ - ".github/workflows/lint.yml"
107
+ - ".github/workflows/pr_lint.yml"
108
108
  - ".github/workflows/test.yml"
109
109
  - ".gitignore"
110
110
  - ".gitmodules"
111
111
  - ".rspec"
112
112
  - ".rubocop.yml"
113
113
  - ".rubocop_todo.yml"
114
+ - ".ruby-version"
114
115
  - CHANGELOG.md
115
116
  - CONTRIBUTING.md
116
117
  - Dangerfile
@@ -127,12 +128,12 @@ files:
127
128
  - bin/commands/admin_apps_approved.rb
128
129
  - bin/commands/admin_apps_requests.rb
129
130
  - bin/commands/admin_apps_restricted.rb
131
+ - bin/commands/admin_audit_anomaly_allow.rb
130
132
  - bin/commands/admin_auth_policy.rb
131
133
  - bin/commands/admin_barriers.rb
132
134
  - bin/commands/admin_conversations.rb
133
135
  - bin/commands/admin_conversations_ekm.rb
134
136
  - bin/commands/admin_conversations_restrictAccess.rb
135
- - bin/commands/admin_conversations_whitelist.rb
136
137
  - bin/commands/admin_emoji.rb
137
138
  - bin/commands/admin_inviteRequests.rb
138
139
  - bin/commands/admin_inviteRequests_approved.rb
@@ -150,17 +151,12 @@ files:
150
151
  - bin/commands/apps_connections.rb
151
152
  - bin/commands/apps_event_authorizations.rb
152
153
  - bin/commands/apps_manifest.rb
153
- - bin/commands/apps_permissions.rb
154
- - bin/commands/apps_permissions_resources.rb
155
- - bin/commands/apps_permissions_scopes.rb
156
- - bin/commands/apps_permissions_users.rb
157
154
  - bin/commands/auth.rb
158
155
  - bin/commands/auth_teams.rb
159
156
  - bin/commands/bookmarks.rb
160
157
  - bin/commands/bots.rb
161
158
  - bin/commands/calls.rb
162
159
  - bin/commands/calls_participants.rb
163
- - bin/commands/channels.rb
164
160
  - bin/commands/chat.rb
165
161
  - bin/commands/chat_scheduledMessages.rb
166
162
  - bin/commands/conversations.rb
@@ -170,10 +166,7 @@ files:
170
166
  - bin/commands/files.rb
171
167
  - bin/commands/files_comments.rb
172
168
  - bin/commands/files_remote.rb
173
- - bin/commands/groups.rb
174
- - bin/commands/im.rb
175
169
  - bin/commands/migration.rb
176
- - bin/commands/mpim.rb
177
170
  - bin/commands/oauth.rb
178
171
  - bin/commands/oauth_v2.rb
179
172
  - bin/commands/openid_connect.rb
@@ -230,8 +223,8 @@ files:
230
223
  - lib/slack/real_time/models/base.rb
231
224
  - lib/slack/real_time/models/bot.rb
232
225
  - lib/slack/real_time/models/channel.rb
233
- - lib/slack/real_time/models/group.rb
234
226
  - lib/slack/real_time/models/im.rb
227
+ - lib/slack/real_time/models/mpim.rb
235
228
  - lib/slack/real_time/models/team.rb
236
229
  - lib/slack/real_time/models/user.rb
237
230
  - lib/slack/real_time/socket.rb
@@ -246,12 +239,12 @@ files:
246
239
  - lib/slack/web/api/endpoints/admin_apps_approved.rb
247
240
  - lib/slack/web/api/endpoints/admin_apps_requests.rb
248
241
  - lib/slack/web/api/endpoints/admin_apps_restricted.rb
242
+ - lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb
249
243
  - lib/slack/web/api/endpoints/admin_auth_policy.rb
250
244
  - lib/slack/web/api/endpoints/admin_barriers.rb
251
245
  - lib/slack/web/api/endpoints/admin_conversations.rb
252
246
  - lib/slack/web/api/endpoints/admin_conversations_ekm.rb
253
247
  - lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb
254
- - lib/slack/web/api/endpoints/admin_conversations_whitelist.rb
255
248
  - lib/slack/web/api/endpoints/admin_emoji.rb
256
249
  - lib/slack/web/api/endpoints/admin_inviteRequests.rb
257
250
  - lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb
@@ -269,17 +262,12 @@ files:
269
262
  - lib/slack/web/api/endpoints/apps_connections.rb
270
263
  - lib/slack/web/api/endpoints/apps_event_authorizations.rb
271
264
  - lib/slack/web/api/endpoints/apps_manifest.rb
272
- - lib/slack/web/api/endpoints/apps_permissions.rb
273
- - lib/slack/web/api/endpoints/apps_permissions_resources.rb
274
- - lib/slack/web/api/endpoints/apps_permissions_scopes.rb
275
- - lib/slack/web/api/endpoints/apps_permissions_users.rb
276
265
  - lib/slack/web/api/endpoints/auth.rb
277
266
  - lib/slack/web/api/endpoints/auth_teams.rb
278
267
  - lib/slack/web/api/endpoints/bookmarks.rb
279
268
  - lib/slack/web/api/endpoints/bots.rb
280
269
  - lib/slack/web/api/endpoints/calls.rb
281
270
  - lib/slack/web/api/endpoints/calls_participants.rb
282
- - lib/slack/web/api/endpoints/channels.rb
283
271
  - lib/slack/web/api/endpoints/chat.rb
284
272
  - lib/slack/web/api/endpoints/chat_scheduledMessages.rb
285
273
  - lib/slack/web/api/endpoints/conversations.rb
@@ -289,15 +277,11 @@ files:
289
277
  - lib/slack/web/api/endpoints/files.rb
290
278
  - lib/slack/web/api/endpoints/files_comments.rb
291
279
  - lib/slack/web/api/endpoints/files_remote.rb
292
- - lib/slack/web/api/endpoints/groups.rb
293
- - lib/slack/web/api/endpoints/im.rb
294
280
  - lib/slack/web/api/endpoints/migration.rb
295
- - lib/slack/web/api/endpoints/mpim.rb
296
281
  - lib/slack/web/api/endpoints/oauth.rb
297
282
  - lib/slack/web/api/endpoints/oauth_v2.rb
298
283
  - lib/slack/web/api/endpoints/openid_connect.rb
299
284
  - lib/slack/web/api/endpoints/pins.rb
300
- - lib/slack/web/api/endpoints/presence.rb
301
285
  - lib/slack/web/api/endpoints/reactions.rb
302
286
  - lib/slack/web/api/endpoints/reminders.rb
303
287
  - lib/slack/web/api/endpoints/rtm.rb
@@ -328,10 +312,9 @@ files:
328
312
  - lib/slack/web/api/mixins/users.id.rb
329
313
  - lib/slack/web/api/mixins/users.search.json
330
314
  - lib/slack/web/api/mixins/users.search.rb
331
- - lib/slack/web/api/patches/chat.1.patch
332
- - lib/slack/web/api/patches/dialog.1.open-json-support.patch
333
- - lib/slack/web/api/patches/views.1.view-json.patch
334
- - lib/slack/web/api/patches/views.1.views-published.patch
315
+ - lib/slack/web/api/patches/chat.attachments-blocks.patch
316
+ - lib/slack/web/api/patches/dialog.encoded-json.patch
317
+ - lib/slack/web/api/patches/views.view-json.patch
335
318
  - lib/slack/web/api/schema/group.json
336
319
  - lib/slack/web/api/schema/method.json
337
320
  - lib/slack/web/api/templates/command.erb
@@ -364,7 +347,6 @@ files:
364
347
  - spec/fixtures/slack/web/conversations_setTopic_paginated.yml
365
348
  - spec/fixtures/slack/web/paginated_users_list.yml
366
349
  - spec/fixtures/slack/web/rtm_connect.yml
367
- - spec/fixtures/slack/web/rtm_start.yml
368
350
  - spec/fixtures/slack/web/users_info.yml
369
351
  - spec/fixtures/slack/web/users_list.yml
370
352
  - spec/fixtures/slack/web/views_open_error.yml
@@ -381,15 +363,14 @@ files:
381
363
  - spec/slack/real_time/concurrency/with_concurrency_spec.rb
382
364
  - spec/slack/real_time/concurrency/without_concurrency_spec.rb
383
365
  - spec/slack/real_time/event_handlers/bot_spec.rb
384
- - spec/slack/real_time/event_handlers/channel_spec.rb
385
366
  - spec/slack/real_time/event_handlers/event_handlers_spec.rb
386
- - spec/slack/real_time/event_handlers/group_spec.rb
387
367
  - spec/slack/real_time/event_handlers/im_spec.rb
368
+ - spec/slack/real_time/event_handlers/private_channel_spec.rb
369
+ - spec/slack/real_time/event_handlers/public_channel_spec.rb
388
370
  - spec/slack/real_time/event_handlers/team_spec.rb
389
371
  - spec/slack/real_time/event_handlers/user_spec.rb
390
372
  - spec/slack/real_time/rtm_connect_spec.rb
391
- - spec/slack/real_time/rtm_start_spec.rb
392
- - spec/slack/real_time/store_spec.rb
373
+ - spec/slack/real_time/stores/store_spec.rb
393
374
  - spec/slack/slack_spec.rb
394
375
  - spec/slack/version_spec.rb
395
376
  - spec/slack/web/api/endpoints/admin_analytics_spec.rb
@@ -397,6 +378,7 @@ files:
397
378
  - spec/slack/web/api/endpoints/admin_apps_requests_spec.rb
398
379
  - spec/slack/web/api/endpoints/admin_apps_restricted_spec.rb
399
380
  - spec/slack/web/api/endpoints/admin_apps_spec.rb
381
+ - spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb
400
382
  - spec/slack/web/api/endpoints/admin_auth_policy_spec.rb
401
383
  - spec/slack/web/api/endpoints/admin_barriers_spec.rb
402
384
  - spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb
@@ -471,6 +453,7 @@ files:
471
453
  - spec/support/real_time/concurrency/mock.rb
472
454
  - spec/support/real_time/connected_client.rb
473
455
  - spec/support/real_time/event.rb
456
+ - spec/support/real_time/loaded_client.rb
474
457
  - spec/support/token.rb
475
458
  - spec/support/vcr.rb
476
459
  homepage: http://github.com/slack-ruby/slack-ruby-client
@@ -493,7 +476,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
493
476
  - !ruby/object:Gem::Version
494
477
  version: 1.3.6
495
478
  requirements: []
496
- rubygems_version: 3.1.6
479
+ rubygems_version: 3.3.23
497
480
  signing_key:
498
481
  specification_version: 4
499
482
  summary: Slack Web and RealTime API client.
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- desc 'Add and remove user groups from conversations. Use admin.conversations.* equivalents instead.'
5
- command 'admin_conversations_whitelist' do |g|
6
- g.desc 'Add an allowlist of IDP groups for accessing a channel'
7
- g.long_desc %( Add an allowlist of IDP groups for accessing a channel )
8
- g.command 'add' do |c|
9
- c.flag 'channel_id', desc: 'The channel to whitelist a group for.'
10
- c.flag 'group_id', desc: 'The IDP Group ID to whitelist for the private channel.'
11
- c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.admin_conversations_whitelist_add(options))
14
- end
15
- end
16
-
17
- g.desc 'List all IDP Groups linked to a channel'
18
- g.long_desc %( List all IDP Groups linked to a channel )
19
- g.command 'listGroupsLinkedToChannel' do |c|
20
- c.flag 'channel_id', desc: '.'
21
- c.flag 'team_id', desc: 'The workspace where the channele exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.'
22
- c.action do |_global_options, options, _args|
23
- puts JSON.dump($client.admin_conversations_whitelist_listGroupsLinkedToChannel(options))
24
- end
25
- end
26
-
27
- g.desc 'Remove an allowlisted IDP group linked to a private channel'
28
- g.long_desc %( Remove an allowlisted IDP group linked to a private channel )
29
- g.command 'remove' do |c|
30
- c.flag 'channel_id', desc: 'The channel to remove a whitelisted group for.'
31
- c.flag 'group_id', desc: 'The IDP Group ID to remove from the private channel whitelist.'
32
- c.flag 'team_id', desc: 'The workspace where the IDP Group and channel exist.'
33
- c.action do |_global_options, options, _args|
34
- puts JSON.dump($client.admin_conversations_whitelist_remove(options))
35
- end
36
- end
37
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- desc 'AppsPermissions methods.'
5
- command 'apps_permissions' do |g|
6
- g.desc 'Returns list of permissions this app has on a team.'
7
- g.long_desc %( Returns list of permissions this app has on a team. )
8
- g.command 'info' do |c|
9
- c.action do |_global_options, options, _args|
10
- puts JSON.dump($client.apps_permissions_info(options))
11
- end
12
- end
13
-
14
- g.desc 'Allows an app to request additional scopes'
15
- g.long_desc %( Allows an app to request additional scopes )
16
- g.command 'request' do |c|
17
- c.flag 'scopes', desc: 'A comma separated list of scopes to request for.'
18
- c.flag 'trigger_id', desc: 'Token used to trigger the permissions API.'
19
- c.action do |_global_options, options, _args|
20
- puts JSON.dump($client.apps_permissions_request(options))
21
- end
22
- end
23
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- desc 'AppsPermissionsResources methods.'
5
- command 'apps_permissions_resources' do |g|
6
- g.desc 'Returns list of resource grants this app has on a team.'
7
- g.long_desc %( Returns list of resource grants this app has on a team. )
8
- g.command 'list' do |c|
9
- 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."
10
- c.flag 'limit', desc: 'The maximum number of items to return.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.apps_permissions_resources_list(options))
13
- end
14
- end
15
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- desc 'AppsPermissionsScopes methods.'
5
- command 'apps_permissions_scopes' do |g|
6
- g.desc 'Returns list of scopes this app has on a team.'
7
- g.long_desc %( Returns list of scopes this app has on a team. )
8
- g.command 'list' do |c|
9
- c.action do |_global_options, options, _args|
10
- puts JSON.dump($client.apps_permissions_scopes_list(options))
11
- end
12
- end
13
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- desc 'AppsPermissionsUsers methods.'
5
- command 'apps_permissions_users' do |g|
6
- g.desc 'Returns list of user grants and corresponding scopes this app has on a team.'
7
- g.long_desc %( Returns list of user grants and corresponding scopes this app has on a team. )
8
- g.command 'list' do |c|
9
- 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."
10
- c.flag 'limit', desc: 'The maximum number of items to return.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.apps_permissions_users_list(options))
13
- end
14
- end
15
-
16
- g.desc 'Enables an app to trigger a permissions modal to grant an app access to a user access scope.'
17
- g.long_desc %( Enables an app to trigger a permissions modal to grant an app access to a user access scope. )
18
- g.command 'request' do |c|
19
- c.flag 'scopes', desc: 'A comma separated list of user scopes to request for.'
20
- c.flag 'trigger_id', desc: 'Token used to trigger the request.'
21
- c.flag 'user', desc: 'The user this scope is being requested for.'
22
- c.action do |_global_options, options, _args|
23
- puts JSON.dump($client.apps_permissions_users_request(options))
24
- end
25
- end
26
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
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
- command 'channels' do |g|
6
- g.desc 'Delete a channel (undocumented)'
7
- g.long_desc %( Delete a channel )
8
- g.command 'delete' do |c|
9
- c.flag 'channel', desc: 'Channel to delete.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.channels_delete(options))
12
- end
13
- end
14
-
15
- g.desc 'This method returns the ID of a team channel.'
16
- g.long_desc %( This method returns the ID of a team channel. )
17
- g.command 'id' do |c|
18
- c.flag 'channel', desc: 'Channel to get ID for, prefixed with #.'
19
- c.action do |_global_options, options, _args|
20
- puts JSON.dump($client.channels_id(options))
21
- end
22
- end
23
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- desc "Get info on your team's private channels."
5
- command 'groups' do |g|
6
- g.desc 'This method returns the ID of a group.'
7
- g.long_desc %( This method returns the ID of a group. )
8
- g.command 'id' do |c|
9
- c.flag 'channel', desc: 'Group channel to get ID for, prefixed with #.'
10
- c.action do |_global_options, options, _args|
11
- puts JSON.dump($client.groups_id(options))
12
- end
13
- end
14
- end
data/bin/commands/im.rb DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- desc 'Get info on your direct messages.'
5
- command 'im' do |g|
6
- end
data/bin/commands/mpim.rb DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- desc 'Get info on your multiparty direct messages.'
5
- command 'mpim' do |g|
6
- end
@@ -1,64 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- module Slack
5
- module Web
6
- module Api
7
- module Endpoints
8
- module AdminConversationsWhitelist
9
- #
10
- # Add an allowlist of IDP groups for accessing a channel
11
- #
12
- # @option options [Object] :channel_id
13
- # The channel to whitelist a group for.
14
- # @option options [Object] :group_id
15
- # The IDP Group ID to whitelist for the private channel.
16
- # @option options [Object] :team_id
17
- # The workspace where the IDP Group and channel exist.
18
- # @see https://api.slack.com/methods/admin.conversations.whitelist.add
19
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.whitelist/admin.conversations.whitelist.add.json
20
- def admin_conversations_whitelist_add(options = {})
21
- throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
22
- throw ArgumentError.new('Required arguments :group_id missing') if options[:group_id].nil?
23
- logger.warn('admin.conversations.whitelist.add: This method is deprecated Alternative methods: .')
24
- post('admin.conversations.whitelist.add', options)
25
- end
26
-
27
- #
28
- # List all IDP Groups linked to a channel
29
- #
30
- # @option options [Object] :channel_id
31
- # .
32
- # @option options [Object] :team_id
33
- # The workspace where the channele exists. This argument is required for channels only tied to one workspace, and optional for channels that are shared across an organization.
34
- # @see https://api.slack.com/methods/admin.conversations.whitelist.listGroupsLinkedToChannel
35
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.whitelist/admin.conversations.whitelist.listGroupsLinkedToChannel.json
36
- def admin_conversations_whitelist_listGroupsLinkedToChannel(options = {})
37
- throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
38
- logger.warn('admin.conversations.whitelist.listGroupsLinkedToChannel: This method is deprecated Alternative methods: .')
39
- post('admin.conversations.whitelist.listGroupsLinkedToChannel', options)
40
- end
41
-
42
- #
43
- # Remove an allowlisted IDP group linked to a private channel
44
- #
45
- # @option options [Object] :channel_id
46
- # The channel to remove a whitelisted group for.
47
- # @option options [Object] :group_id
48
- # The IDP Group ID to remove from the private channel whitelist.
49
- # @option options [Object] :team_id
50
- # The workspace where the IDP Group and channel exist.
51
- # @see https://api.slack.com/methods/admin.conversations.whitelist.remove
52
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.conversations.whitelist/admin.conversations.whitelist.remove.json
53
- def admin_conversations_whitelist_remove(options = {})
54
- throw ArgumentError.new('Required arguments :channel_id missing') if options[:channel_id].nil?
55
- throw ArgumentError.new('Required arguments :group_id missing') if options[:group_id].nil?
56
- throw ArgumentError.new('Required arguments :team_id missing') if options[:team_id].nil?
57
- logger.warn('admin.conversations.whitelist.remove: This method is deprecated Alternative methods: .')
58
- post('admin.conversations.whitelist.remove', options)
59
- end
60
- end
61
- end
62
- end
63
- end
64
- end
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- module Slack
5
- module Web
6
- module Api
7
- module Endpoints
8
- module AppsPermissions
9
- #
10
- # Returns list of permissions this app has on a team.
11
- #
12
- # @see https://api.slack.com/methods/apps.permissions.info
13
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.info.json
14
- def apps_permissions_info(options = {})
15
- post('apps.permissions.info', options)
16
- end
17
-
18
- #
19
- # Allows an app to request additional scopes
20
- #
21
- # @option options [Object] :scopes
22
- # A comma separated list of scopes to request for.
23
- # @option options [Object] :trigger_id
24
- # Token used to trigger the permissions API.
25
- # @see https://api.slack.com/methods/apps.permissions.request
26
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions/apps.permissions.request.json
27
- def apps_permissions_request(options = {})
28
- throw ArgumentError.new('Required arguments :scopes missing') if options[:scopes].nil?
29
- throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
30
- post('apps.permissions.request', options)
31
- end
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- module Slack
5
- module Web
6
- module Api
7
- module Endpoints
8
- module AppsPermissionsResources
9
- #
10
- # Returns list of resource grants this app has on a team.
11
- #
12
- # @option options [Object] :cursor
13
- # 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.
14
- # @option options [Object] :limit
15
- # The maximum number of items to return.
16
- # @see https://api.slack.com/methods/apps.permissions.resources.list
17
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions.resources/apps.permissions.resources.list.json
18
- def apps_permissions_resources_list(options = {})
19
- if block_given?
20
- Pagination::Cursor.new(self, :apps_permissions_resources_list, options).each do |page|
21
- yield page
22
- end
23
- else
24
- post('apps.permissions.resources.list', options)
25
- end
26
- end
27
- end
28
- end
29
- end
30
- end
31
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
- # This file was auto-generated by lib/tasks/web.rake
3
-
4
- module Slack
5
- module Web
6
- module Api
7
- module Endpoints
8
- module AppsPermissionsScopes
9
- #
10
- # Returns list of scopes this app has on a team.
11
- #
12
- # @see https://api.slack.com/methods/apps.permissions.scopes.list
13
- # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions.scopes/apps.permissions.scopes.list.json
14
- def apps_permissions_scopes_list(options = {})
15
- post('apps.permissions.scopes.list', options)
16
- end
17
- end
18
- end
19
- end
20
- end
21
- end