slack-ruby-client 2.7.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +1 -1
- data/.github/workflows/pr_lint.yml +1 -1
- data/.github/workflows/test.yml +4 -11
- data/.github/workflows/update_api.yml +1 -1
- data/.rubocop_todo.yml +45 -67
- data/CHANGELOG.md +12 -0
- data/Gemfile +0 -9
- data/LICENSE.md +1 -1
- data/README.md +16 -219
- data/Rakefile +0 -1
- data/UPGRADING.md +4 -0
- data/bin/commands/admin_analytics.rb +1 -1
- data/bin/commands/admin_apps.rb +4 -4
- data/bin/commands/admin_apps_activities.rb +7 -7
- data/bin/commands/admin_apps_approved.rb +4 -4
- data/bin/commands/admin_apps_config.rb +3 -1
- data/bin/commands/admin_apps_requests.rb +5 -5
- data/bin/commands/admin_apps_restricted.rb +4 -4
- data/bin/commands/admin_audit_anomaly_allow.rb +6 -6
- data/bin/commands/admin_auth_policy.rb +5 -5
- data/bin/commands/admin_barriers.rb +3 -3
- data/bin/commands/admin_conversations.rb +15 -15
- data/bin/commands/admin_conversations_ekm.rb +2 -2
- data/bin/commands/admin_conversations_restrictAccess.rb +5 -5
- data/bin/commands/admin_emoji.rb +5 -5
- data/bin/commands/admin_functions.rb +4 -3
- data/bin/commands/admin_functions_permissions.rb +2 -2
- data/bin/commands/admin_inviteRequests.rb +3 -3
- data/bin/commands/admin_inviteRequests_approved.rb +1 -1
- data/bin/commands/admin_inviteRequests_denied.rb +1 -1
- data/bin/commands/admin_roles.rb +3 -3
- data/bin/commands/admin_teams.rb +3 -3
- data/bin/commands/admin_teams_admins.rb +2 -2
- data/bin/commands/admin_teams_owners.rb +2 -2
- data/bin/commands/admin_teams_settings.rb +5 -5
- data/bin/commands/admin_usergroups.rb +4 -4
- data/bin/commands/admin_users.rb +22 -11
- data/bin/commands/admin_users_session.rb +6 -5
- data/bin/commands/admin_users_unsupportedVersions.rb +1 -1
- data/bin/commands/admin_workflows.rb +6 -6
- data/bin/commands/admin_workflows_collaborators.rb +2 -2
- data/bin/commands/apps_activities.rb +7 -7
- data/bin/commands/apps_auth_external.rb +1 -1
- data/bin/commands/apps_datastore.rb +12 -12
- data/bin/commands/apps_event_authorizations.rb +3 -3
- data/bin/commands/apps_manifest.rb +1 -1
- data/bin/commands/assistant_search.rb +22 -3
- data/bin/commands/assistant_threads.rb +3 -2
- data/bin/commands/auth.rb +1 -1
- data/bin/commands/auth_teams.rb +1 -1
- data/bin/commands/bookmarks.rb +6 -6
- data/bin/commands/calls.rb +5 -5
- data/bin/commands/canvases.rb +2 -2
- data/bin/commands/canvases_access.rb +1 -1
- data/bin/commands/chat.rb +63 -25
- data/bin/commands/conversations.rb +8 -8
- data/bin/commands/conversations_canvases.rb +1 -1
- data/bin/commands/conversations_externalInvitePermissions.rb +1 -1
- data/bin/commands/conversations_requestSharedInvite.rb +4 -4
- data/bin/commands/dnd.rb +1 -1
- data/bin/commands/entity.rb +24 -0
- data/bin/commands/files.rb +6 -6
- data/bin/commands/files_remote.rb +1 -1
- data/bin/commands/functions.rb +1 -1
- data/bin/commands/functions_distributions_permissions.rb +15 -15
- data/bin/commands/functions_workflows_steps.rb +2 -2
- data/bin/commands/functions_workflows_steps_responses.rb +2 -2
- data/bin/commands/migration.rb +2 -2
- data/bin/commands/oauth_v2.rb +2 -1
- data/bin/commands/openid_connect.rb +1 -1
- data/bin/commands/reactions.rb +3 -3
- data/bin/commands/reminders.rb +2 -2
- data/bin/commands/rtm.rb +15 -0
- data/bin/commands/search.rb +4 -4
- data/bin/commands/slackLists.rb +37 -0
- data/bin/commands/slackLists_access.rb +34 -0
- data/bin/commands/slackLists_download.rb +31 -0
- data/bin/commands/slackLists_items.rb +76 -0
- data/bin/commands/team.rb +1 -1
- data/bin/commands/team_externalTeams.rb +4 -4
- data/bin/commands/usergroups.rb +10 -10
- data/bin/commands/usergroups_users.rb +5 -5
- data/bin/commands/users.rb +1 -1
- data/bin/commands/users_discoverableContacts.rb +1 -1
- data/bin/commands/views.rb +4 -4
- data/bin/commands/workflows_featured.rb +50 -0
- data/bin/commands/workflows_triggers_permissions.rb +7 -7
- data/examples/oauth_v2/README.md +3 -3
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_apps.rb +8 -8
- data/lib/slack/web/api/endpoints/admin_apps_activities.rb +14 -14
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +5 -7
- data/lib/slack/web/api/endpoints/admin_apps_config.rb +6 -3
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +7 -9
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +5 -7
- data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +5 -5
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +14 -14
- data/lib/slack/web/api/endpoints/admin_barriers.rb +8 -8
- data/lib/slack/web/api/endpoints/admin_conversations.rb +27 -28
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +4 -4
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +11 -12
- data/lib/slack/web/api/endpoints/admin_emoji.rb +5 -5
- data/lib/slack/web/api/endpoints/admin_functions.rb +5 -3
- data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +6 -6
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_roles.rb +8 -8
- data/lib/slack/web/api/endpoints/admin_teams.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +3 -4
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +2 -3
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +12 -13
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +11 -11
- data/lib/slack/web/api/endpoints/admin_users.rb +40 -25
- data/lib/slack/web/api/endpoints/admin_users_session.rb +12 -9
- data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_workflows.rb +12 -12
- data/lib/slack/web/api/endpoints/admin_workflows_collaborators.rb +6 -6
- data/lib/slack/web/api/endpoints/apps_activities.rb +14 -14
- data/lib/slack/web/api/endpoints/apps_auth_external.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_datastore.rb +8 -15
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +0 -3
- data/lib/slack/web/api/endpoints/apps_manifest.rb +5 -5
- data/lib/slack/web/api/endpoints/assistant_search.rb +35 -4
- data/lib/slack/web/api/endpoints/assistant_threads.rb +9 -7
- data/lib/slack/web/api/endpoints/auth.rb +1 -1
- data/lib/slack/web/api/endpoints/auth_teams.rb +2 -2
- data/lib/slack/web/api/endpoints/bookmarks.rb +14 -14
- data/lib/slack/web/api/endpoints/calls.rb +10 -10
- data/lib/slack/web/api/endpoints/canvases.rb +4 -4
- data/lib/slack/web/api/endpoints/canvases_access.rb +3 -3
- data/lib/slack/web/api/endpoints/chat.rb +123 -60
- data/lib/slack/web/api/endpoints/conversations.rb +16 -16
- data/lib/slack/web/api/endpoints/conversations_canvases.rb +1 -1
- data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +3 -3
- data/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb +8 -8
- data/lib/slack/web/api/endpoints/dnd.rb +2 -2
- data/lib/slack/web/api/endpoints/entity.rb +32 -0
- data/lib/slack/web/api/endpoints/files.rb +12 -12
- data/lib/slack/web/api/endpoints/files_remote.rb +2 -2
- data/lib/slack/web/api/endpoints/functions.rb +3 -3
- data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +24 -24
- data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +4 -4
- data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +4 -4
- data/lib/slack/web/api/endpoints/migration.rb +1 -1
- data/lib/slack/web/api/endpoints/oauth_v2.rb +4 -2
- data/lib/slack/web/api/endpoints/openid_connect.rb +2 -2
- data/lib/slack/web/api/endpoints/reactions.rb +6 -6
- data/lib/slack/web/api/endpoints/reminders.rb +4 -4
- data/lib/slack/web/api/endpoints/rtm.rb +23 -0
- data/lib/slack/web/api/endpoints/search.rb +8 -8
- data/lib/slack/web/api/endpoints/slackLists.rb +52 -0
- data/lib/slack/web/api/endpoints/slackLists_access.rb +47 -0
- data/lib/slack/web/api/endpoints/slackLists_download.rb +40 -0
- data/lib/slack/web/api/endpoints/slackLists_items.rb +116 -0
- data/lib/slack/web/api/endpoints/team.rb +3 -3
- data/lib/slack/web/api/endpoints/team_externalTeams.rb +8 -8
- data/lib/slack/web/api/endpoints/usergroups.rb +18 -18
- data/lib/slack/web/api/endpoints/usergroups_users.rb +8 -8
- data/lib/slack/web/api/endpoints/users.rb +2 -2
- data/lib/slack/web/api/endpoints/users_discoverableContacts.rb +0 -1
- data/lib/slack/web/api/endpoints/views.rb +9 -9
- data/lib/slack/web/api/endpoints/workflows_featured.rb +69 -0
- data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +15 -15
- data/lib/slack/web/api/endpoints.rb +12 -2
- data/lib/slack/web/api/errors.rb +126 -16
- data/lib/slack/web/api/helpers/files.rb +4 -1
- data/lib/slack/web/faraday/response/raise_error.rb +20 -2
- data/lib/slack-ruby-client.rb +0 -12
- data/lib/tasks/update.rake +0 -1
- data/lib/tasks/web.rake +2 -4
- metadata +15 -40
- data/.github/workflows/integration_test.yml +0 -45
- data/bin/commands/workflows.rb +0 -44
- data/examples/hi_real_time_and_web/Gemfile +0 -6
- data/examples/hi_real_time_and_web/hi.gif +0 -0
- data/examples/hi_real_time_and_web/hi.rb +0 -28
- data/examples/hi_real_time_async_async/Gemfile +0 -7
- data/examples/hi_real_time_async_async/Procfile +0 -2
- data/examples/hi_real_time_async_async/hi.rb +0 -41
- data/lib/slack/real_time/api/message.rb +0 -23
- data/lib/slack/real_time/api/message_id.rb +0 -15
- data/lib/slack/real_time/api/ping.rb +0 -19
- data/lib/slack/real_time/api/schema/event.json +0 -23
- data/lib/slack/real_time/api/templates/event_handler.erb +0 -8
- data/lib/slack/real_time/api/typing.rb +0 -20
- data/lib/slack/real_time/client.rb +0 -271
- data/lib/slack/real_time/concurrency/async.rb +0 -142
- data/lib/slack/real_time/concurrency.rb +0 -8
- data/lib/slack/real_time/config.rb +0 -62
- data/lib/slack/real_time/models/base.rb +0 -11
- data/lib/slack/real_time/models/bot.rb +0 -9
- data/lib/slack/real_time/models/channel.rb +0 -13
- data/lib/slack/real_time/models/im.rb +0 -9
- data/lib/slack/real_time/models/mpim.rb +0 -9
- data/lib/slack/real_time/models/team.rb +0 -9
- data/lib/slack/real_time/models/user.rb +0 -9
- data/lib/slack/real_time/models.rb +0 -9
- data/lib/slack/real_time/socket.rb +0 -118
- data/lib/slack/real_time/stores/base.rb +0 -47
- data/lib/slack/real_time/stores/starter.rb +0 -449
- data/lib/slack/real_time/stores/store.rb +0 -624
- data/lib/slack/real_time/stores.rb +0 -5
- data/lib/slack/web/api/endpoints/workflows.rb +0 -63
- data/lib/tasks/real_time.rake +0 -81
|
@@ -5,7 +5,7 @@ module Slack
|
|
|
5
5
|
module Response
|
|
6
6
|
class RaiseError < ::Faraday::Middleware
|
|
7
7
|
def on_complete(env)
|
|
8
|
-
raise Slack::Web::Api::Errors::TooManyRequestsError, env.response if env.status == 429
|
|
8
|
+
raise Slack::Web::Api::Errors::TooManyRequestsError, redact_response(env.response) if env.status == 429
|
|
9
9
|
|
|
10
10
|
return unless env.success?
|
|
11
11
|
|
|
@@ -16,7 +16,25 @@ module Slack
|
|
|
16
16
|
error_message = body['error'] || body['errors'].map { |message| message['error'] }.join(',')
|
|
17
17
|
error_class = Slack::Web::Api::Errors::ERROR_CLASSES[error_message]
|
|
18
18
|
error_class ||= Slack::Web::Api::Errors::SlackError
|
|
19
|
-
raise error_class.new(error_message, env.response)
|
|
19
|
+
raise error_class.new(error_message, redact_response(env.response))
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
def redact_response(response)
|
|
25
|
+
return response unless response&.env
|
|
26
|
+
|
|
27
|
+
redacted_env = response.env.dup
|
|
28
|
+
|
|
29
|
+
# redact Authorization header if it exists
|
|
30
|
+
if redacted_env[:request_headers]&.key?('Authorization')
|
|
31
|
+
redacted_env[:request_headers] = redacted_env[:request_headers].dup
|
|
32
|
+
redacted_env[:request_headers]['Authorization'] = '[REDACTED]'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
redacted_response = ::Faraday::Response.new(redacted_env)
|
|
36
|
+
redacted_response.env[:response] = redacted_response
|
|
37
|
+
redacted_response
|
|
20
38
|
end
|
|
21
39
|
end
|
|
22
40
|
end
|
data/lib/slack-ruby-client.rb
CHANGED
|
@@ -42,18 +42,6 @@ require_relative 'slack/web/api/helpers'
|
|
|
42
42
|
require_relative 'slack/web/pagination/cursor'
|
|
43
43
|
require_relative 'slack/web/client'
|
|
44
44
|
|
|
45
|
-
# RealTime API
|
|
46
|
-
require_relative 'slack/real_time/concurrency'
|
|
47
|
-
require_relative 'slack/real_time/socket'
|
|
48
|
-
require_relative 'slack/real_time/api/message_id'
|
|
49
|
-
require_relative 'slack/real_time/api/ping'
|
|
50
|
-
require_relative 'slack/real_time/api/message'
|
|
51
|
-
require_relative 'slack/real_time/api/typing'
|
|
52
|
-
require_relative 'slack/real_time/models'
|
|
53
|
-
require_relative 'slack/real_time/stores'
|
|
54
|
-
require_relative 'slack/real_time/config'
|
|
55
|
-
require_relative 'slack/real_time/client'
|
|
56
|
-
|
|
57
45
|
# Events API
|
|
58
46
|
require_relative 'slack/events/config'
|
|
59
47
|
require_relative 'slack/events/request'
|
data/lib/tasks/update.rake
CHANGED
data/lib/tasks/web.rake
CHANGED
|
@@ -27,16 +27,14 @@ namespace :slack do
|
|
|
27
27
|
Dir.glob('lib/slack/web/api/mixins/**/*.json')
|
|
28
28
|
].flatten.each_with_object({}) do |path, result|
|
|
29
29
|
file_name = File.basename(path, '.json')
|
|
30
|
+
next if File.dirname(path).split('/').last.start_with?('_') # skip _common, _errors, etc.
|
|
31
|
+
|
|
30
32
|
prefix = file_name.split('.')[0..-2].join('.')
|
|
31
33
|
name = file_name.split('.')[-1]
|
|
32
34
|
result[prefix] ||= {}
|
|
33
35
|
parsed = JSON.parse(File.read(path))
|
|
34
36
|
parsed['undocumented'] = true if path =~ /undocumented/
|
|
35
37
|
JSON::Validator.validate(method_schema, parsed, insert_defaults: true)
|
|
36
|
-
if parsed['deprecated'] && parsed['deprecation']['deprecation_warning'] =~ /It will stop functioning in February 2021/
|
|
37
|
-
next
|
|
38
|
-
end
|
|
39
|
-
|
|
40
38
|
result[prefix][name] = parsed
|
|
41
39
|
end
|
|
42
40
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: slack-ruby-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Doubrovkine
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: faraday
|
|
@@ -94,7 +93,6 @@ dependencies:
|
|
|
94
93
|
- - ">="
|
|
95
94
|
- !ruby/object:Gem::Version
|
|
96
95
|
version: '0'
|
|
97
|
-
description:
|
|
98
96
|
email: dblock@dblock.org
|
|
99
97
|
executables:
|
|
100
98
|
- slack
|
|
@@ -104,7 +102,6 @@ files:
|
|
|
104
102
|
- ".coveralls.yml"
|
|
105
103
|
- ".github/FUNDING.yml"
|
|
106
104
|
- ".github/dependabot.yml"
|
|
107
|
-
- ".github/workflows/integration_test.yml"
|
|
108
105
|
- ".github/workflows/lint.yml"
|
|
109
106
|
- ".github/workflows/pr_lint.yml"
|
|
110
107
|
- ".github/workflows/test.yml"
|
|
@@ -186,6 +183,7 @@ files:
|
|
|
186
183
|
- bin/commands/dialog.rb
|
|
187
184
|
- bin/commands/dnd.rb
|
|
188
185
|
- bin/commands/emoji.rb
|
|
186
|
+
- bin/commands/entity.rb
|
|
189
187
|
- bin/commands/files.rb
|
|
190
188
|
- bin/commands/files_comments.rb
|
|
191
189
|
- bin/commands/files_remote.rb
|
|
@@ -202,6 +200,10 @@ files:
|
|
|
202
200
|
- bin/commands/reminders.rb
|
|
203
201
|
- bin/commands/rtm.rb
|
|
204
202
|
- bin/commands/search.rb
|
|
203
|
+
- bin/commands/slackLists.rb
|
|
204
|
+
- bin/commands/slackLists_access.rb
|
|
205
|
+
- bin/commands/slackLists_download.rb
|
|
206
|
+
- bin/commands/slackLists_items.rb
|
|
205
207
|
- bin/commands/stars.rb
|
|
206
208
|
- bin/commands/team.rb
|
|
207
209
|
- bin/commands/team_billing.rb
|
|
@@ -217,19 +219,13 @@ files:
|
|
|
217
219
|
- bin/commands/users_prefs.rb
|
|
218
220
|
- bin/commands/users_profile.rb
|
|
219
221
|
- bin/commands/views.rb
|
|
220
|
-
- bin/commands/
|
|
222
|
+
- bin/commands/workflows_featured.rb
|
|
221
223
|
- bin/commands/workflows_triggers_permissions.rb
|
|
222
224
|
- bin/slack
|
|
223
225
|
- examples/files_upload_v2/.env.example
|
|
224
226
|
- examples/files_upload_v2/Gemfile
|
|
225
227
|
- examples/files_upload_v2/README.md
|
|
226
228
|
- examples/files_upload_v2/files_upload_v2.rb
|
|
227
|
-
- examples/hi_real_time_and_web/Gemfile
|
|
228
|
-
- examples/hi_real_time_and_web/hi.gif
|
|
229
|
-
- examples/hi_real_time_and_web/hi.rb
|
|
230
|
-
- examples/hi_real_time_async_async/Gemfile
|
|
231
|
-
- examples/hi_real_time_async_async/Procfile
|
|
232
|
-
- examples/hi_real_time_async_async/hi.rb
|
|
233
229
|
- examples/hi_web/Gemfile
|
|
234
230
|
- examples/hi_web/hi.gif
|
|
235
231
|
- examples/hi_web/hi.rb
|
|
@@ -247,29 +243,6 @@ files:
|
|
|
247
243
|
- lib/slack/logger.rb
|
|
248
244
|
- lib/slack/messages/formatting.rb
|
|
249
245
|
- lib/slack/messages/message.rb
|
|
250
|
-
- lib/slack/real_time/api/message.rb
|
|
251
|
-
- lib/slack/real_time/api/message_id.rb
|
|
252
|
-
- lib/slack/real_time/api/ping.rb
|
|
253
|
-
- lib/slack/real_time/api/schema/event.json
|
|
254
|
-
- lib/slack/real_time/api/templates/event_handler.erb
|
|
255
|
-
- lib/slack/real_time/api/typing.rb
|
|
256
|
-
- lib/slack/real_time/client.rb
|
|
257
|
-
- lib/slack/real_time/concurrency.rb
|
|
258
|
-
- lib/slack/real_time/concurrency/async.rb
|
|
259
|
-
- lib/slack/real_time/config.rb
|
|
260
|
-
- lib/slack/real_time/models.rb
|
|
261
|
-
- lib/slack/real_time/models/base.rb
|
|
262
|
-
- lib/slack/real_time/models/bot.rb
|
|
263
|
-
- lib/slack/real_time/models/channel.rb
|
|
264
|
-
- lib/slack/real_time/models/im.rb
|
|
265
|
-
- lib/slack/real_time/models/mpim.rb
|
|
266
|
-
- lib/slack/real_time/models/team.rb
|
|
267
|
-
- lib/slack/real_time/models/user.rb
|
|
268
|
-
- lib/slack/real_time/socket.rb
|
|
269
|
-
- lib/slack/real_time/stores.rb
|
|
270
|
-
- lib/slack/real_time/stores/base.rb
|
|
271
|
-
- lib/slack/real_time/stores/starter.rb
|
|
272
|
-
- lib/slack/real_time/stores/store.rb
|
|
273
246
|
- lib/slack/utils/security.rb
|
|
274
247
|
- lib/slack/version.rb
|
|
275
248
|
- lib/slack/web/api/endpoints.rb
|
|
@@ -333,6 +306,7 @@ files:
|
|
|
333
306
|
- lib/slack/web/api/endpoints/dialog.rb
|
|
334
307
|
- lib/slack/web/api/endpoints/dnd.rb
|
|
335
308
|
- lib/slack/web/api/endpoints/emoji.rb
|
|
309
|
+
- lib/slack/web/api/endpoints/entity.rb
|
|
336
310
|
- lib/slack/web/api/endpoints/files.rb
|
|
337
311
|
- lib/slack/web/api/endpoints/files_comments.rb
|
|
338
312
|
- lib/slack/web/api/endpoints/files_remote.rb
|
|
@@ -349,6 +323,10 @@ files:
|
|
|
349
323
|
- lib/slack/web/api/endpoints/reminders.rb
|
|
350
324
|
- lib/slack/web/api/endpoints/rtm.rb
|
|
351
325
|
- lib/slack/web/api/endpoints/search.rb
|
|
326
|
+
- lib/slack/web/api/endpoints/slackLists.rb
|
|
327
|
+
- lib/slack/web/api/endpoints/slackLists_access.rb
|
|
328
|
+
- lib/slack/web/api/endpoints/slackLists_download.rb
|
|
329
|
+
- lib/slack/web/api/endpoints/slackLists_items.rb
|
|
352
330
|
- lib/slack/web/api/endpoints/stars.rb
|
|
353
331
|
- lib/slack/web/api/endpoints/team.rb
|
|
354
332
|
- lib/slack/web/api/endpoints/team_billing.rb
|
|
@@ -364,7 +342,7 @@ files:
|
|
|
364
342
|
- lib/slack/web/api/endpoints/users_prefs.rb
|
|
365
343
|
- lib/slack/web/api/endpoints/users_profile.rb
|
|
366
344
|
- lib/slack/web/api/endpoints/views.rb
|
|
367
|
-
- lib/slack/web/api/endpoints/
|
|
345
|
+
- lib/slack/web/api/endpoints/workflows_featured.rb
|
|
368
346
|
- lib/slack/web/api/endpoints/workflows_triggers_permissions.rb
|
|
369
347
|
- lib/slack/web/api/error.rb
|
|
370
348
|
- lib/slack/web/api/errors.rb
|
|
@@ -399,7 +377,6 @@ files:
|
|
|
399
377
|
- lib/slack/web/pagination/cursor.rb
|
|
400
378
|
- lib/slack_ruby_client.rb
|
|
401
379
|
- lib/tasks/git.rake
|
|
402
|
-
- lib/tasks/real_time.rake
|
|
403
380
|
- lib/tasks/update.rake
|
|
404
381
|
- lib/tasks/web.rake
|
|
405
382
|
- slack-ruby-client.gemspec
|
|
@@ -410,7 +387,6 @@ licenses:
|
|
|
410
387
|
metadata:
|
|
411
388
|
rubygems_mfa_required: 'true'
|
|
412
389
|
changelog_uri: https://github.com/slack-ruby/slack-ruby-client/blob/master/CHANGELOG.md
|
|
413
|
-
post_install_message:
|
|
414
390
|
rdoc_options: []
|
|
415
391
|
require_paths:
|
|
416
392
|
- lib
|
|
@@ -425,8 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
425
401
|
- !ruby/object:Gem::Version
|
|
426
402
|
version: 1.3.6
|
|
427
403
|
requirements: []
|
|
428
|
-
rubygems_version: 3.
|
|
429
|
-
signing_key:
|
|
404
|
+
rubygems_version: 3.6.9
|
|
430
405
|
specification_version: 4
|
|
431
406
|
summary: Slack Web and RealTime API client.
|
|
432
407
|
test_files: []
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
name: Integration Tests
|
|
2
|
-
on: push
|
|
3
|
-
jobs:
|
|
4
|
-
check-slack-api-token:
|
|
5
|
-
runs-on: ubuntu-latest
|
|
6
|
-
outputs:
|
|
7
|
-
SLACK_API_TOKEN_EXISTS: ${{ steps.check-slack-api-token.outputs.SLACK_API_TOKEN_EXISTS }}
|
|
8
|
-
steps:
|
|
9
|
-
- name: Check for SLACK_API_TOKEN availability
|
|
10
|
-
id: check-slack-api-token
|
|
11
|
-
shell: bash
|
|
12
|
-
run: |
|
|
13
|
-
if [ "${{ secrets.SLACK_API_TOKEN }}" != '' ]; then
|
|
14
|
-
echo "SLACK_API_TOKEN_EXISTS=true" >> $GITHUB_OUTPUT;
|
|
15
|
-
else
|
|
16
|
-
echo "SLACK_API_TOKEN_EXISTS=false" >> $GITHUB_OUTPUT;
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
test:
|
|
20
|
-
runs-on: ubuntu-latest
|
|
21
|
-
needs: [check-slack-api-token]
|
|
22
|
-
if: needs.check-slack-api-token.outputs.SLACK_API_TOKEN_EXISTS == 'true'
|
|
23
|
-
strategy:
|
|
24
|
-
matrix:
|
|
25
|
-
entry:
|
|
26
|
-
- { ruby: 2.7, concurrency: async-websocket }
|
|
27
|
-
name: test (ruby=${{ matrix.entry.ruby }}, concurrency=${{ matrix.entry.concurrency || 'none' }})
|
|
28
|
-
steps:
|
|
29
|
-
- name: Checkout
|
|
30
|
-
uses: actions/checkout@v4
|
|
31
|
-
- name: Set up Ruby
|
|
32
|
-
uses: ruby/setup-ruby@v1
|
|
33
|
-
with:
|
|
34
|
-
ruby-version: ${{ matrix.entry.ruby }}
|
|
35
|
-
bundler-cache: true
|
|
36
|
-
- name: Run Tests
|
|
37
|
-
env:
|
|
38
|
-
CONCURRENCY: ${{ matrix.entry.concurrency }}
|
|
39
|
-
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
|
|
40
|
-
RACK_ENV: test
|
|
41
|
-
SPEC: "--pattern spec/**/integration/*_spec.rb"
|
|
42
|
-
SPEC_OPTS: "--pattern spec/**/integration/*_spec.rb"
|
|
43
|
-
run: |
|
|
44
|
-
bundle install
|
|
45
|
-
bundle exec rake
|
data/bin/commands/workflows.rb
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# This file was auto-generated by lib/tasks/web.rake
|
|
3
|
-
|
|
4
|
-
module Slack
|
|
5
|
-
module Cli
|
|
6
|
-
class App
|
|
7
|
-
desc 'Workflows methods.'
|
|
8
|
-
command 'workflows' do |g|
|
|
9
|
-
g.desc "Indicate that an app's step in a workflow completed execution."
|
|
10
|
-
g.long_desc %( Indicate that an app's step in a workflow completed execution. )
|
|
11
|
-
g.command 'stepCompleted' do |c|
|
|
12
|
-
c.flag 'workflow_step_execute_id', desc: 'Context identifier that maps to the correct workflow step execution.'
|
|
13
|
-
c.flag 'outputs', desc: 'Key-value object of outputs from your step. Keys of this object reflect the configured key properties of your outputs array from your workflow_step object.'
|
|
14
|
-
c.action do |_global_options, options, _args|
|
|
15
|
-
puts JSON.dump(@client.workflows_stepCompleted(options))
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
g.desc "Indicate that an app's step in a workflow failed to execute."
|
|
20
|
-
g.long_desc %( Indicate that an app's step in a workflow failed to execute. )
|
|
21
|
-
g.command 'stepFailed' do |c|
|
|
22
|
-
c.flag 'error', desc: 'A JSON-based object with a message property that should contain a human readable error message.'
|
|
23
|
-
c.flag 'workflow_step_execute_id', desc: 'Context identifier that maps to the correct workflow step execution.'
|
|
24
|
-
c.action do |_global_options, options, _args|
|
|
25
|
-
puts JSON.dump(@client.workflows_stepFailed(options))
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
g.desc 'Update the configuration for a workflow step.'
|
|
30
|
-
g.long_desc %( Update the configuration for a workflow step. )
|
|
31
|
-
g.command 'updateStep' do |c|
|
|
32
|
-
c.flag 'workflow_step_edit_id', desc: 'A context identifier provided with view_submission payloads used to call back to workflows.updateStep.'
|
|
33
|
-
c.flag 'inputs', desc: 'A JSON key-value map of inputs required from a user during configuration. This is the data your app expects to receive when the workflow step starts. Please note: the embedded variable format is set and replaced by the workflow system. You cannot create custom variables that will be replaced at runtime. Read more about variables in workflow steps here.'
|
|
34
|
-
c.flag 'outputs', desc: 'An JSON array of output objects used during step execution. This is the data your app agrees to provide when your workflow step was executed.'
|
|
35
|
-
c.flag 'step_image_url', desc: 'An optional field that can be used to override app image that is shown in the Workflow Builder.'
|
|
36
|
-
c.flag 'step_name', desc: 'An optional field that can be used to override the step name that is shown in the Workflow Builder.'
|
|
37
|
-
c.action do |_global_options, options, _args|
|
|
38
|
-
puts JSON.dump(@client.workflows_updateStep(options))
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
Binary file
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
require 'slack-ruby-client'
|
|
3
|
-
|
|
4
|
-
Slack.configure do |config|
|
|
5
|
-
config.token = ENV['SLACK_API_TOKEN']
|
|
6
|
-
raise 'Missing ENV[SLACK_API_TOKEN]!' unless config.token
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
client = Slack::RealTime::Client.new
|
|
10
|
-
|
|
11
|
-
client.on :hello do
|
|
12
|
-
puts(
|
|
13
|
-
"Successfully connected, welcome '#{client.self.name}' " \
|
|
14
|
-
"to the '#{client.team.name}' team at https://#{client.team.domain}.slack.com."
|
|
15
|
-
)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
client.on :message do |data|
|
|
19
|
-
puts data
|
|
20
|
-
case data.text
|
|
21
|
-
when 'bot hi'
|
|
22
|
-
client.web_client.chat_postMessage channel: data.channel, text: "Hi <@#{data.user}>!"
|
|
23
|
-
when /^bot/
|
|
24
|
-
client.web_client.chat_postMessage channel: data.channel, text: "Sorry <@#{data.user}>, what?"
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
client.start!
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
require 'slack-ruby-client'
|
|
3
|
-
require 'async'
|
|
4
|
-
|
|
5
|
-
raise 'Missing ENV[SLACK_API_TOKENS]!' unless ENV.key?('SLACK_API_TOKENS')
|
|
6
|
-
|
|
7
|
-
$stdout.sync = true
|
|
8
|
-
logger = Logger.new($stdout)
|
|
9
|
-
logger.level = Logger::DEBUG
|
|
10
|
-
|
|
11
|
-
threads = []
|
|
12
|
-
|
|
13
|
-
ENV['SLACK_API_TOKENS'].split.each do |token|
|
|
14
|
-
logger.info "Starting #{token[0..12]} ..."
|
|
15
|
-
|
|
16
|
-
client = Slack::RealTime::Client.new(token: token)
|
|
17
|
-
|
|
18
|
-
client.on :hello do
|
|
19
|
-
logger.info(
|
|
20
|
-
"Successfully connected, welcome '#{client.self.name}' to " \
|
|
21
|
-
"the '#{client.team.name}' team at https://#{client.team.domain}.slack.com."
|
|
22
|
-
)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
client.on :message do |data|
|
|
26
|
-
logger.info data
|
|
27
|
-
|
|
28
|
-
client.typing channel: data.channel
|
|
29
|
-
|
|
30
|
-
case data.text
|
|
31
|
-
when /hi/
|
|
32
|
-
client.message channel: data.channel, text: "Hi <@#{data.user}>!"
|
|
33
|
-
else
|
|
34
|
-
client.message channel: data.channel, text: "Sorry <@#{data.user}>, what?"
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
threads << client.start_async
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
threads.each(&:join)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
module Slack
|
|
3
|
-
module RealTime
|
|
4
|
-
module Api
|
|
5
|
-
module Message
|
|
6
|
-
#
|
|
7
|
-
# Sends a message to a channel.
|
|
8
|
-
#
|
|
9
|
-
# @option options [channel] :channel
|
|
10
|
-
# Channel to send message to. Can be a public channel, private group or IM channel.
|
|
11
|
-
# Can be an encoded ID, or a name.
|
|
12
|
-
# @option options [Object] :text
|
|
13
|
-
# Text of the message to send. See below for an explanation of formatting.
|
|
14
|
-
def message(options = {})
|
|
15
|
-
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
|
16
|
-
raise ArgumentError, 'Required arguments :text missing' if options[:text].nil?
|
|
17
|
-
|
|
18
|
-
send_json({ type: 'message', id: next_id }.merge(options))
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
module Slack
|
|
3
|
-
module RealTime
|
|
4
|
-
module Api
|
|
5
|
-
module Ping
|
|
6
|
-
#
|
|
7
|
-
# Clients should try to quickly detect disconnections, even in idle periods, so that users
|
|
8
|
-
# can easily tell the
|
|
9
|
-
# difference between being disconnected and everyone being quiet. Not all web browsers
|
|
10
|
-
# support the WebSocket
|
|
11
|
-
# ping spec, so the RTM protocol also supports ping/pong messages.
|
|
12
|
-
#
|
|
13
|
-
def ping(options = {})
|
|
14
|
-
send_json({ type: 'ping', id: next_id }.merge(options))
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "object",
|
|
3
|
-
"required": [
|
|
4
|
-
"name",
|
|
5
|
-
"desc"
|
|
6
|
-
],
|
|
7
|
-
"properties": {
|
|
8
|
-
"name": {
|
|
9
|
-
"type": "string"
|
|
10
|
-
},
|
|
11
|
-
"desc": {
|
|
12
|
-
"type": "string"
|
|
13
|
-
},
|
|
14
|
-
"long_desc": {
|
|
15
|
-
"type": "string"
|
|
16
|
-
},
|
|
17
|
-
"example": {
|
|
18
|
-
"type": "object",
|
|
19
|
-
"default": {}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
module Slack
|
|
3
|
-
module RealTime
|
|
4
|
-
module Api
|
|
5
|
-
module Typing
|
|
6
|
-
#
|
|
7
|
-
# Send a typing indicator to indicate that the user is currently writing a message.
|
|
8
|
-
#
|
|
9
|
-
# @option options [channel] :channel
|
|
10
|
-
# Channel to send message to. Can be a public channel, private group or IM channel.
|
|
11
|
-
# Can be an encoded ID, or a name.
|
|
12
|
-
def typing(options = {})
|
|
13
|
-
raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?
|
|
14
|
-
|
|
15
|
-
send_json({ type: 'typing', id: next_id }.merge(options))
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|