slack-ruby-client 3.2.0 → 3.4.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/.coveralls.yml +0 -0
- data/.github/FUNDING.yml +0 -0
- data/.github/dependabot.yml +0 -0
- data/.github/prompts/changelog-entries.prompt.yml +32 -0
- data/.github/workflows/danger-comment.yml +11 -2
- data/.github/workflows/danger.yml +10 -2
- data/.github/workflows/lint.yml +21 -6
- data/.github/workflows/release.yml +27 -0
- data/.github/workflows/test.yml +0 -0
- data/.github/workflows/update_api.yml +86 -6
- data/.gitignore +1 -0
- data/.gitmodules +0 -0
- data/.rspec +0 -0
- data/.rubocop.yml +94 -1
- data/.rubocop_todo.yml +13 -2
- data/.ruby-version +0 -0
- data/.spellcheck.txt +256 -0
- data/AGENTS.md +12 -0
- data/CHANGELOG.md +50 -0
- data/CONTRIBUTING.md +59 -59
- data/Dangerfile +0 -0
- data/Gemfile +33 -5
- data/LICENSE.md +1 -1
- data/README.md +139 -104
- data/RELEASING.md +20 -58
- data/Rakefile +29 -3
- data/SECURITY.md +1 -1
- data/UPGRADING.md +48 -40
- data/benchmarks/events.rb +26 -0
- data/benchmarks/formatting.rb +17 -0
- data/benchmarks/support.rb +67 -0
- data/benchmarks/web_client.rb +28 -0
- data/bin/commands/admin_analytics.rb +0 -0
- data/bin/commands/admin_analytics_members.rb +39 -0
- data/bin/commands/admin_analytics_messages.rb +4 -4
- data/bin/commands/admin_analytics_slackbot.rb +33 -0
- data/bin/commands/admin_apps.rb +0 -0
- data/bin/commands/admin_apps_activities.rb +0 -0
- data/bin/commands/admin_apps_approved.rb +0 -0
- data/bin/commands/admin_apps_config.rb +0 -0
- data/bin/commands/admin_apps_mcp_servers.rb +21 -0
- data/bin/commands/admin_apps_mcp_servers_permissions.rb +33 -0
- data/bin/commands/admin_apps_permissions.rb +58 -0
- data/bin/commands/admin_apps_requests.rb +0 -0
- data/bin/commands/admin_apps_restricted.rb +0 -0
- data/bin/commands/admin_audit_anomaly_allow.rb +0 -0
- data/bin/commands/admin_auth_policy.rb +0 -0
- data/bin/commands/admin_barriers.rb +0 -0
- data/bin/commands/admin_conversations.rb +23 -3
- data/bin/commands/admin_conversations_ekm.rb +0 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +0 -0
- data/bin/commands/admin_emoji.rb +0 -0
- data/bin/commands/admin_functions.rb +1 -1
- data/bin/commands/admin_functions_permissions.rb +0 -0
- data/bin/commands/admin_inviteRequests.rb +0 -0
- data/bin/commands/admin_inviteRequests_approved.rb +0 -0
- data/bin/commands/admin_inviteRequests_denied.rb +0 -0
- data/bin/commands/admin_roles.rb +0 -0
- data/bin/commands/admin_slackbot_skills.rb +56 -0
- data/bin/commands/admin_teams.rb +0 -0
- data/bin/commands/admin_teams_admins.rb +0 -0
- data/bin/commands/admin_teams_owners.rb +0 -0
- data/bin/commands/admin_teams_settings.rb +0 -0
- data/bin/commands/admin_usergroups.rb +74 -0
- data/bin/commands/admin_users.rb +11 -2
- data/bin/commands/admin_users_access.rb +31 -0
- data/bin/commands/admin_users_session.rb +0 -1
- data/bin/commands/admin_users_unsupportedVersions.rb +0 -0
- data/bin/commands/admin_workflows.rb +0 -0
- data/bin/commands/admin_workflows_collaborators.rb +0 -0
- data/bin/commands/admin_workflows_permissions.rb +0 -0
- data/bin/commands/admin_workflows_triggers_types_permissions.rb +0 -0
- data/bin/commands/agents_conversations.rb +122 -0
- data/bin/commands/agents_sessions.rb +38 -0
- data/bin/commands/api.rb +0 -0
- data/bin/commands/apps.rb +0 -0
- data/bin/commands/apps_activities.rb +0 -0
- data/bin/commands/apps_auth_external.rb +0 -0
- data/bin/commands/apps_connections.rb +0 -0
- data/bin/commands/apps_datastore.rb +0 -0
- data/bin/commands/apps_event_authorizations.rb +0 -0
- data/bin/commands/apps_icon.rb +0 -0
- data/bin/commands/apps_managed_permissions.rb +21 -0
- data/bin/commands/apps_manifest.rb +0 -0
- data/bin/commands/apps_user_connection.rb +0 -0
- data/bin/commands/assistant_search.rb +0 -0
- data/bin/commands/assistant_threads.rb +1 -1
- data/bin/commands/auth.rb +0 -0
- data/bin/commands/auth_teams.rb +0 -0
- data/bin/commands/blocks.rb +0 -0
- data/bin/commands/bookmarks.rb +0 -0
- data/bin/commands/bots.rb +0 -0
- data/bin/commands/calls.rb +0 -0
- data/bin/commands/calls_participants.rb +0 -0
- data/bin/commands/canvases.rb +12 -2
- data/bin/commands/canvases_access.rb +0 -0
- data/bin/commands/canvases_sections.rb +0 -0
- data/bin/commands/chat.rb +10 -7
- data/bin/commands/chat_scheduledMessages.rb +0 -0
- data/bin/commands/conversations.rb +1 -1
- data/bin/commands/conversations_canvases.rb +1 -1
- data/bin/commands/conversations_externalInvitePermissions.rb +0 -0
- data/bin/commands/conversations_requestSharedInvite.rb +0 -0
- data/bin/commands/dialog.rb +0 -0
- data/bin/commands/dnd.rb +0 -0
- data/bin/commands/emoji.rb +0 -0
- data/bin/commands/entity.rb +27 -0
- data/bin/commands/files.rb +3 -0
- data/bin/commands/files_comments.rb +0 -0
- data/bin/commands/files_remote.rb +0 -0
- data/bin/commands/functions.rb +0 -0
- data/bin/commands/functions_distributions_permissions.rb +0 -0
- data/bin/commands/functions_workflows_steps.rb +0 -0
- data/bin/commands/functions_workflows_steps_responses.rb +0 -0
- data/bin/commands/migration.rb +0 -0
- data/bin/commands/oauth.rb +0 -0
- data/bin/commands/oauth_v2.rb +21 -0
- data/bin/commands/oauth_v2_user.rb +0 -0
- data/bin/commands/openid_connect.rb +0 -0
- data/bin/commands/pins.rb +1 -1
- data/bin/commands/reactions.rb +0 -0
- data/bin/commands/reminders.rb +0 -0
- data/bin/commands/rtm.rb +0 -0
- data/bin/commands/search.rb +0 -0
- data/bin/commands/slackLists.rb +0 -0
- data/bin/commands/slackLists_access.rb +0 -0
- data/bin/commands/slackLists_download.rb +7 -0
- data/bin/commands/slackLists_items.rb +2 -1
- data/bin/commands/slackbot_skills.rb +71 -0
- data/bin/commands/slackbot_skills_library.rb +29 -0
- data/bin/commands/stars.rb +0 -0
- data/bin/commands/team.rb +1 -0
- data/bin/commands/team_billing.rb +0 -0
- data/bin/commands/team_externalTeams.rb +1 -1
- data/bin/commands/team_preferences.rb +0 -0
- data/bin/commands/team_profile.rb +0 -0
- data/bin/commands/tooling_tokens.rb +0 -0
- data/bin/commands/usergroups.rb +0 -0
- data/bin/commands/usergroups_users.rb +0 -0
- data/bin/commands/users.rb +1 -0
- data/bin/commands/users_admin.rb +0 -0
- data/bin/commands/users_discoverableContacts.rb +0 -0
- data/bin/commands/users_prefs.rb +0 -0
- data/bin/commands/users_profile.rb +0 -0
- data/bin/commands/views.rb +0 -0
- data/bin/commands/workflows_featured.rb +0 -0
- data/bin/commands/workflows_triggers_permissions.rb +0 -0
- data/bin/slack +5 -1
- data/examples/files_upload_v2/.env.example +0 -0
- data/examples/files_upload_v2/Gemfile +0 -0
- data/examples/files_upload_v2/README.md +4 -3
- data/examples/files_upload_v2/files_upload_v2.rb +1 -1
- data/examples/hi_web/Gemfile +0 -0
- data/examples/hi_web/hi.gif +0 -0
- data/examples/hi_web/hi.rb +1 -1
- data/examples/new_ticket/Gemfile +0 -0
- data/examples/new_ticket/new_ticket.rb +1 -1
- data/examples/oauth_v2/.env.example +0 -0
- data/examples/oauth_v2/Gemfile +0 -0
- data/examples/oauth_v2/README.md +5 -4
- data/examples/oauth_v2/oauth_v2.rb +6 -6
- data/lib/slack/config.rb +0 -0
- data/lib/slack/events/config.rb +1 -1
- data/lib/slack/events/request.rb +2 -2
- data/lib/slack/logger.rb +0 -0
- data/lib/slack/messages/formatting.rb +29 -20
- data/lib/slack/messages/message.rb +0 -0
- data/lib/slack/utils/security.rb +0 -0
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_analytics.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_analytics_members.rb +66 -0
- data/lib/slack/web/api/endpoints/admin_analytics_messages.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_analytics_slackbot.rb +54 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_apps_activities.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_apps_approved.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_apps_config.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_apps_mcp_servers.rb +31 -0
- data/lib/slack/web/api/endpoints/admin_apps_mcp_servers_permissions.rb +46 -0
- data/lib/slack/web/api/endpoints/admin_apps_permissions.rb +83 -0
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_apps_restricted.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_barriers.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +32 -2
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_emoji.rb +0 -1
- data/lib/slack/web/api/endpoints/admin_functions.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_functions_permissions.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_approved.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_inviteRequests_denied.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_roles.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_slackbot_skills.rb +84 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +111 -0
- data/lib/slack/web/api/endpoints/admin_users.rb +14 -1
- data/lib/slack/web/api/endpoints/admin_users_access.rb +40 -0
- data/lib/slack/web/api/endpoints/admin_users_session.rb +0 -2
- data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_workflows.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_workflows_collaborators.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_workflows_permissions.rb +0 -0
- data/lib/slack/web/api/endpoints/admin_workflows_triggers_types_permissions.rb +0 -0
- data/lib/slack/web/api/endpoints/agents_conversations.rb +186 -0
- data/lib/slack/web/api/endpoints/agents_sessions.rb +54 -0
- data/lib/slack/web/api/endpoints/api.rb +0 -0
- data/lib/slack/web/api/endpoints/apps.rb +0 -0
- data/lib/slack/web/api/endpoints/apps_activities.rb +0 -0
- data/lib/slack/web/api/endpoints/apps_auth_external.rb +0 -0
- data/lib/slack/web/api/endpoints/apps_connections.rb +0 -0
- data/lib/slack/web/api/endpoints/apps_datastore.rb +0 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +0 -0
- data/lib/slack/web/api/endpoints/apps_icon.rb +0 -0
- data/lib/slack/web/api/endpoints/apps_managed_permissions.rb +27 -0
- data/lib/slack/web/api/endpoints/apps_manifest.rb +0 -0
- data/lib/slack/web/api/endpoints/apps_user_connection.rb +0 -0
- data/lib/slack/web/api/endpoints/assistant_search.rb +0 -0
- data/lib/slack/web/api/endpoints/assistant_threads.rb +1 -1
- data/lib/slack/web/api/endpoints/auth.rb +0 -0
- data/lib/slack/web/api/endpoints/auth_teams.rb +0 -0
- data/lib/slack/web/api/endpoints/blocks.rb +0 -0
- data/lib/slack/web/api/endpoints/bookmarks.rb +0 -0
- data/lib/slack/web/api/endpoints/bots.rb +0 -0
- data/lib/slack/web/api/endpoints/calls.rb +0 -0
- data/lib/slack/web/api/endpoints/calls_participants.rb +0 -0
- data/lib/slack/web/api/endpoints/canvases.rb +16 -2
- data/lib/slack/web/api/endpoints/canvases_access.rb +0 -0
- data/lib/slack/web/api/endpoints/canvases_sections.rb +0 -0
- data/lib/slack/web/api/endpoints/chat.rb +14 -10
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +0 -0
- data/lib/slack/web/api/endpoints/conversations.rb +1 -1
- data/lib/slack/web/api/endpoints/conversations_canvases.rb +1 -1
- data/lib/slack/web/api/endpoints/conversations_externalInvitePermissions.rb +0 -0
- data/lib/slack/web/api/endpoints/conversations_requestSharedInvite.rb +0 -0
- data/lib/slack/web/api/endpoints/dialog.rb +0 -0
- data/lib/slack/web/api/endpoints/dnd.rb +0 -0
- data/lib/slack/web/api/endpoints/emoji.rb +0 -0
- data/lib/slack/web/api/endpoints/entity.rb +48 -0
- data/lib/slack/web/api/endpoints/files.rb +7 -0
- data/lib/slack/web/api/endpoints/files_comments.rb +0 -0
- data/lib/slack/web/api/endpoints/files_remote.rb +0 -0
- data/lib/slack/web/api/endpoints/functions.rb +0 -0
- data/lib/slack/web/api/endpoints/functions_distributions_permissions.rb +0 -0
- data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +0 -0
- data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +0 -0
- data/lib/slack/web/api/endpoints/migration.rb +0 -0
- data/lib/slack/web/api/endpoints/oauth.rb +0 -0
- data/lib/slack/web/api/endpoints/oauth_v2.rb +33 -0
- data/lib/slack/web/api/endpoints/oauth_v2_user.rb +0 -0
- data/lib/slack/web/api/endpoints/openid_connect.rb +0 -0
- data/lib/slack/web/api/endpoints/pins.rb +1 -1
- data/lib/slack/web/api/endpoints/reactions.rb +0 -0
- data/lib/slack/web/api/endpoints/reminders.rb +0 -0
- data/lib/slack/web/api/endpoints/rtm.rb +0 -0
- data/lib/slack/web/api/endpoints/search.rb +0 -0
- data/lib/slack/web/api/endpoints/slackLists.rb +0 -0
- data/lib/slack/web/api/endpoints/slackLists_access.rb +0 -0
- data/lib/slack/web/api/endpoints/slackLists_download.rb +14 -0
- data/lib/slack/web/api/endpoints/slackLists_items.rb +3 -1
- data/lib/slack/web/api/endpoints/slackbot_skills.rb +107 -0
- data/lib/slack/web/api/endpoints/slackbot_skills_library.rb +36 -0
- data/lib/slack/web/api/endpoints/stars.rb +0 -0
- data/lib/slack/web/api/endpoints/team.rb +2 -0
- data/lib/slack/web/api/endpoints/team_billing.rb +0 -0
- data/lib/slack/web/api/endpoints/team_externalTeams.rb +1 -1
- data/lib/slack/web/api/endpoints/team_preferences.rb +0 -0
- data/lib/slack/web/api/endpoints/team_profile.rb +0 -0
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +0 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +0 -0
- data/lib/slack/web/api/endpoints/usergroups_users.rb +0 -0
- data/lib/slack/web/api/endpoints/users.rb +2 -1
- data/lib/slack/web/api/endpoints/users_admin.rb +0 -0
- data/lib/slack/web/api/endpoints/users_discoverableContacts.rb +0 -0
- data/lib/slack/web/api/endpoints/users_prefs.rb +0 -0
- data/lib/slack/web/api/endpoints/users_profile.rb +0 -0
- data/lib/slack/web/api/endpoints/views.rb +0 -0
- data/lib/slack/web/api/endpoints/workflows_featured.rb +0 -0
- data/lib/slack/web/api/endpoints/workflows_triggers_permissions.rb +0 -0
- data/lib/slack/web/api/endpoints.rb +24 -0
- data/lib/slack/web/api/error.rb +0 -0
- data/lib/slack/web/api/errors/server_error.rb +1 -1
- data/lib/slack/web/api/errors/slack_error.rb +1 -1
- data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -1
- data/lib/slack/web/api/errors.rb +384 -10
- data/lib/slack/web/api/helpers/files.rb +2 -2
- data/lib/slack/web/api/helpers.rb +0 -0
- data/lib/slack/web/api/mixins/conversations.id.rb +2 -1
- data/lib/slack/web/api/mixins/ids.id.rb +2 -1
- data/lib/slack/web/api/mixins/users.id.json +0 -0
- data/lib/slack/web/api/mixins/users.id.rb +2 -1
- data/lib/slack/web/api/mixins/users.search.json +0 -0
- data/lib/slack/web/api/mixins/users.search.rb +1 -1
- data/lib/slack/web/api/mixins.rb +0 -0
- data/lib/slack/web/api/options.rb +0 -0
- data/lib/slack/web/api/patches/.gitkeep +0 -0
- data/lib/slack/web/api/patches/files.default-filename.patch +12 -0
- data/lib/slack/web/api/schema/group.json +0 -0
- data/lib/slack/web/api/schema/method.json +0 -0
- data/lib/slack/web/api/templates/command.erb +0 -0
- data/lib/slack/web/api/templates/endpoints.erb +0 -0
- data/lib/slack/web/api/templates/errors.erb +0 -0
- data/lib/slack/web/api/templates/method.erb +0 -0
- data/lib/slack/web/api/templates/method_spec.erb +0 -0
- data/lib/slack/web/client.rb +29 -0
- data/lib/slack/web/config.rb +0 -0
- data/lib/slack/web/faraday/connection.rb +0 -0
- data/lib/slack/web/faraday/options.rb +0 -0
- data/lib/slack/web/faraday/request.rb +22 -2
- data/lib/slack/web/faraday/response/raise_error.rb +0 -0
- data/lib/slack/web/faraday/response/wrap_error.rb +0 -0
- data/lib/slack/web/pagination/cursor.rb +0 -0
- data/lib/slack-ruby-client.rb +0 -0
- data/lib/slack.rb +0 -0
- data/lib/slack_ruby_client.rb +0 -0
- data/lib/tasks/git.rake +0 -0
- data/lib/tasks/update.rake +0 -0
- data/lib/tasks/web.rake +0 -0
- data/script/release.rb +33 -0
- data/slack-ruby-client.gemspec +1 -3
- data/slack.png +0 -0
- metadata +41 -17
data/Rakefile
CHANGED
|
@@ -5,6 +5,18 @@ require 'bundler/gem_tasks'
|
|
|
5
5
|
|
|
6
6
|
Bundler.setup :default, :development
|
|
7
7
|
|
|
8
|
+
if RUBY_ENGINE == 'ruby' && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.3') &&
|
|
9
|
+
Gem.loaded_specs.key?('ruby-gem-release')
|
|
10
|
+
require_relative 'script/release'
|
|
11
|
+
SlackRubyClientRelease.workflow.install_tasks
|
|
12
|
+
|
|
13
|
+
%w[release release:rubygem_push release:source_control_push].each do |name|
|
|
14
|
+
Rake::Task[name].clear
|
|
15
|
+
desc 'Disabled; releases run through GitHub Actions, see RELEASING.md'
|
|
16
|
+
task(name) { abort "#{name} is disabled; releases run through GitHub Actions, see RELEASING.md" }
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
8
20
|
require 'rspec/core'
|
|
9
21
|
require 'rspec/core/rake_task'
|
|
10
22
|
|
|
@@ -12,10 +24,24 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
|
12
24
|
spec.pattern = FileList['spec/**/*_spec.rb']
|
|
13
25
|
end
|
|
14
26
|
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
desc 'Run RuboCop (Ruby 3.2+).'
|
|
28
|
+
task :rubocop do
|
|
29
|
+
abort 'RuboCop requires Ruby 3.2 or newer' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.2')
|
|
30
|
+
|
|
31
|
+
sh 'bundle exec rubocop'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
desc 'Lint Ruby, Markdown, YAML, and spelling (Ruby 3.2+).'
|
|
35
|
+
task lint: :rubocop
|
|
17
36
|
|
|
18
|
-
task default:
|
|
37
|
+
task default: :spec
|
|
38
|
+
|
|
39
|
+
desc 'Run the benchmarks in benchmarks/.'
|
|
40
|
+
task :benchmark do
|
|
41
|
+
FileList['benchmarks/*.rb'].exclude('benchmarks/support.rb').each do |file|
|
|
42
|
+
ruby file
|
|
43
|
+
end
|
|
44
|
+
end
|
|
19
45
|
|
|
20
46
|
load 'tasks/git.rake'
|
|
21
47
|
load 'tasks/web.rake'
|
data/SECURITY.md
CHANGED
|
@@ -6,4 +6,4 @@ Version 2.0 or newer is currently supported.
|
|
|
6
6
|
|
|
7
7
|
## Reporting a Vulnerability
|
|
8
8
|
|
|
9
|
-
Tidelift acts as the security contact for this open-source project. To make a report, please email the security team at [security@tidelift.com](mailto:security@tidelift.com). Please do not create a public GitHub issue. See [tidelift.com/security](https://tidelift.com/security) for details and more options.
|
|
9
|
+
Tidelift acts as the security contact for this open-source project. To make a report, please email the security team at [security@tidelift.com](mailto:security@tidelift.com). Please do not create a public GitHub issue. See [tidelift.com/security](https://tidelift.com/security) for details and more options.
|
data/UPGRADING.md
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
Upgrading Slack-Ruby-Client
|
|
2
|
-
===========================
|
|
1
|
+
# Upgrading Slack-Ruby-Client
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Upgrading to 3.3.0 or Later
|
|
4
|
+
|
|
5
|
+
### Command-Line Client Dependency
|
|
6
|
+
|
|
7
|
+
[#602](https://github.com/slack-ruby/slack-ruby-client/pull/602) removes [gli](https://github.com/davetron5000/gli) from slack-ruby-client's runtime dependencies. Only the `slack` command-line client uses it. If you use the command-line client, add `gem 'gli'` to your Gemfile or run `gem install gli`. Without it, `slack` exits with a message saying so. The library itself is unaffected.
|
|
8
|
+
|
|
9
|
+
### Exception Messages
|
|
10
|
+
|
|
11
|
+
[#603](https://github.com/slack-ruby/slack-ruby-client/pull/603) standardizes handwritten exception messages to start with lowercase letters and omit trailing periods. Some messages also quote argument names and values with backticks. For example, `TooManyRequestsError` now reports `retry after 3600 seconds` instead of `Retry after 3600 seconds`, and file-upload validation reports ``required argument :`filename` missing in file (`0`)`` instead of `Required argument :filename missing in file (0)`.
|
|
12
|
+
|
|
13
|
+
Update tests, regular expressions, or application logic that match these messages exactly. Exception classes and rescue behavior are unchanged; upstream Slack error codes (such as `invalid_auth`) and dynamically supplied messages are preserved. Prefer matching exception classes and structured error attributes rather than human-readable message text.
|
|
14
|
+
|
|
15
|
+
## Upgrading to 3.2.0 or Later
|
|
5
16
|
|
|
6
17
|
[#583](https://github.com/slack-ruby/slack-ruby-client/pull/583) modifies the error types raised when a nonexistent #channel-name or @user-handle is looked up. These will now raise `ChannelNotFound` and `UserNotFound` respectively, whereas they previously raised a `SlackError`. If your code relies on these types without accounting for inheritance, it will need to be migrated. Notably, `rescue SlackError` will continue to work as normal, since both error classes inherit from it.
|
|
7
18
|
|
|
8
|
-
|
|
19
|
+
## Upgrading to 3.0.0 or Later
|
|
9
20
|
|
|
10
21
|
Support for the [RTM API](https://docs.slack.dev/tools/java-slack-sdk/guides/rtm/) has been removed in [#573](https://github.com/slack-ruby/slack-ruby-client/pull/573). By now you should have [migrated your app to granular permissions](https://code.dblock.org/2020/11/30/migrating-classic-slack-ruby-bots-to-granular-permissions.html), and you should lock your slack-ruby-client to 2.x for those bots. Next, to remove RTM components we found it more effective to just [write a new version of a bot](https://code.dblock.org/2024/06/30/writing-a-channel-slack-bot.html) and avoid a complex migration.
|
|
11
22
|
|
|
12
|
-
|
|
23
|
+
## Upgrading to 2.0.0 or Later
|
|
13
24
|
|
|
14
25
|
[#416](https://github.com/slack-ruby/slack-ruby-client/pull/416) Removes default values for Faraday's SSL settings `ca_file` and `ca_path`.
|
|
15
26
|
|
|
@@ -28,24 +39,21 @@ or
|
|
|
28
39
|
client = Slack::Web::Client.new(ca_file: OpenSSL::X509::DEFAULT_CERT_FILE, ca_path: OpenSSL::X509::DEFAULT_CERT_DIR)
|
|
29
40
|
```
|
|
30
41
|
|
|
31
|
-
|
|
42
|
+
### RealTime Stores
|
|
32
43
|
|
|
33
|
-
Slack has deprecated the `rtm.start` method and [replaced its response](https://api.slack.com/changelog/2021-10-rtm-start-to-stop) with that of `rtm.connect`, so it has been removed from the library along with the `start_method` configuration ([#419](https://github.com/slack-ruby/slack-ruby-client/pull/419)) and `Slack::RealTime::Stores::Starter` is now the default store.
|
|
34
|
-
If your app still relies on the old `rtm.start` behavior, you can achieve a similar result with `Slack::RealTime::Stores::Store`, which initializes itself using Web API methods (see [README](README.md#slackrealtimestoresstore)).
|
|
44
|
+
Slack has deprecated the `rtm.start` method and [replaced its response](https://api.slack.com/changelog/2021-10-rtm-start-to-stop) with that of `rtm.connect`, so it has been removed from the library along with the `start_method` configuration ([#419](https://github.com/slack-ruby/slack-ruby-client/pull/419)) and `Slack::RealTime::Stores::Starter` is now the default store. If your app still relies on the old `rtm.start` behavior, you can achieve a similar result with `Slack::RealTime::Stores::Store`, which initializes itself using Web API methods (see [README](README.md#slackrealtimestoresstore)).
|
|
35
45
|
|
|
36
|
-
The names of the Store caches `channels` and `groups` have been changed to `public_channels` and `private_channels` to reflect their true meaning.
|
|
37
|
-
This is consistent with the [Slack Web API](https://api.slack.com/methods/conversations.list#arg_types), although [event types for private channels](https://api.slack.com/events?query=group) still use the term `group`.
|
|
38
|
-
In both cases, private channels consist of both [conversation types](https://api.slack.com/types/conversation) (`id: 'C...'', is_channel: true, is_group: false, is_private: true`) and [group types](https://api.slack.com/types/group) (`id: 'G...', is_channel: false, is_group: true, is_private: true`) depending whether the object was created before or after March 2021.
|
|
46
|
+
The names of the Store caches `channels` and `groups` have been changed to `public_channels` and `private_channels` to reflect their true meaning. This is consistent with the [Slack Web API](https://api.slack.com/methods/conversations.list#arg_types), although [event types for private channels](https://api.slack.com/events?query=group) still use the term `group`. In both cases, private channels consist of both [conversation types](https://api.slack.com/types/conversation) (`id: 'C...'', is_channel: true, is_group: false, is_private: true`) and [group types](https://api.slack.com/types/group) (`id: 'G...', is_channel: false, is_group: true, is_private: true`) depending whether the object was created before or after March 2021.
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
## Upgrading to 1.0.0 or Later
|
|
41
49
|
|
|
42
|
-
|
|
50
|
+
### Deprecated Methods
|
|
43
51
|
|
|
44
52
|
Slack has deprecated all `channel` and `group` methods, which have been removed from the library.
|
|
45
53
|
|
|
46
54
|
See [this announcement from Slack](https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api) for details.
|
|
47
55
|
|
|
48
|
-
|
|
56
|
+
### Error Handling
|
|
49
57
|
|
|
50
58
|
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`.
|
|
51
59
|
|
|
@@ -79,45 +87,45 @@ error.message
|
|
|
79
87
|
# => 'timeout_error'
|
|
80
88
|
```
|
|
81
89
|
|
|
82
|
-
|
|
90
|
+
## Upgrading to 0.16.0 or Later
|
|
83
91
|
|
|
84
|
-
|
|
92
|
+
### Removed Celluloid and Faye WebSocket Concurrency Support
|
|
85
93
|
|
|
86
94
|
Concurrency support for `celluloid-io` and `faye-websocket` has been removed. If you are running a RealTime bot on Celluloid or Faye, you must upgrade to `async-websocket`. Please note that RealTime bots are deprecated by Slack, and we generally recommend you [migrate your classic, RealTime bot, to granular permissions](https://code.dblock.org/2020/11/30/migrating-classic-slack-ruby-bots-to-granular-permissions.html).
|
|
87
95
|
|
|
88
96
|
See [#338](https://github.com/slack-ruby/slack-ruby-client/issues/338) for more information.
|
|
89
97
|
|
|
90
|
-
|
|
98
|
+
### Error Handling
|
|
91
99
|
|
|
92
100
|
As of 0.16.0 `Faraday::Error` exceptions sans `Faraday::ClientError` are wrapped into `Slack::Web::Api::Errors::ServerError`, so if you're rescuing `Faraday::Error` — you should adjust your code to use `Slack::Web::Api::Errors::ServerError` and use `exception.cause` if underlying `Faraday::Error` is needed.
|
|
93
101
|
|
|
94
102
|
See [README#other-errors](README.md#other-errors) and [#350](https://github.com/slack-ruby/slack-ruby-client/pull/350) for more information.
|
|
95
103
|
|
|
96
|
-
|
|
104
|
+
## Upgrading to 0.15.0 or Later
|
|
97
105
|
|
|
98
106
|
As of 0.15.0, `activesupport` is no longer required. Add `gem 'activesupport'` to your Gemfile if you required ActiveSupport via this library.
|
|
99
107
|
|
|
100
108
|
See [#325](https://github.com/slack-ruby/slack-ruby-client/pull/325) for more information.
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
## Upgrading to 0.14.0 or Later
|
|
103
111
|
|
|
104
112
|
If you are using async-websocket, lock down its version to 0.8.0 as newer versions are currently incompatible.
|
|
105
113
|
|
|
106
|
-
```
|
|
114
|
+
```ruby
|
|
107
115
|
gem 'async-websocket', '~> 0.8.0'
|
|
108
116
|
```
|
|
109
117
|
|
|
110
118
|
See [#282](https://github.com/slack-ruby/slack-ruby-client/issues/282) for more information.
|
|
111
119
|
|
|
112
|
-
|
|
120
|
+
## Upgrading to 0.13.0 or Later
|
|
113
121
|
|
|
114
|
-
|
|
122
|
+
### Recommended Async Library
|
|
115
123
|
|
|
116
124
|
The RealTime client now supports [async-websocket](https://github.com/socketry/async-websocket), which is actively maintained and is now the recommended library.
|
|
117
125
|
|
|
118
126
|
See [#219](https://github.com/slack-ruby/slack-ruby-client/pull/219) for implementation details.
|
|
119
127
|
|
|
120
|
-
|
|
128
|
+
### Async Library Threading and Reactor Changes
|
|
121
129
|
|
|
122
130
|
The RealTime celluloid-io implementation now uses a `Thread` per client. Previous versions used an `Actor`.
|
|
123
131
|
|
|
@@ -125,9 +133,9 @@ The faye-websocket implementation with EventMachine will attempt to shutdown Eve
|
|
|
125
133
|
|
|
126
134
|
See [#224](https://github.com/slack-ruby/slack-ruby-client/pull/224) for more information.
|
|
127
135
|
|
|
128
|
-
|
|
136
|
+
## Upgrading to 0.9.0 or Later
|
|
129
137
|
|
|
130
|
-
|
|
138
|
+
### Changes in How the RTM Client Connects
|
|
131
139
|
|
|
132
140
|
The RealTime client now automatically chooses either [rtm.start](https://api.slack.com/methods/rtm.start) or [rtm.connect](https://api.slack.com/methods/rtm.connect) to open a connection. The `rtm.connect` method is a newer, preferred method, which serves connection purposes and returns some basic team info. The `rtm.start` method additionally returns a lot of data about the team, its channels, and members, and is required to use the full `Slack::RealTime::Stores::Store` storage class.
|
|
133
141
|
|
|
@@ -141,7 +149,7 @@ end
|
|
|
141
149
|
|
|
142
150
|
See [#145](https://github.com/slack-ruby/slack-ruby-client/pull/145) for more information.
|
|
143
151
|
|
|
144
|
-
|
|
152
|
+
## Upgrading to 0.8.0 or Later
|
|
145
153
|
|
|
146
154
|
The default timeout for `rtm.start` has been increased from 60 to 180 seconds via `Slack::RealTime::Client.config.start_options[:request][:timeout]`. If you're explicitly setting `start_options` in your application, preserve the value by merging settings instead of replacing the entire `start_options` value.
|
|
147
155
|
|
|
@@ -163,9 +171,9 @@ end
|
|
|
163
171
|
|
|
164
172
|
See [#136](https://github.com/slack-ruby/slack-ruby-client/pull/136) for more information.
|
|
165
173
|
|
|
166
|
-
|
|
174
|
+
## Upgrading to 0.6.0 or Later
|
|
167
175
|
|
|
168
|
-
|
|
176
|
+
### Changes to API Response Data
|
|
169
177
|
|
|
170
178
|
API responses in both Web and RealTime clients are now instances of [Slack::Messages::Message](lib/slack/messages/message.rb), which provides method access to properties.
|
|
171
179
|
|
|
@@ -183,39 +191,39 @@ puts "Welcome #{client.self.name} to the #{client.team.name} team."
|
|
|
183
191
|
|
|
184
192
|
See [#56](https://github.com/slack-ruby/slack-ruby-client/issues/56) for more information.
|
|
185
193
|
|
|
186
|
-
|
|
194
|
+
### Changes to RealTime Local Store
|
|
187
195
|
|
|
188
196
|
Upon a successful `rtm.start` the RealTime client keeps a local cache of objects, including `self` or `users`. It will now also track changes to these objects. The following changes have been made to the data structures.
|
|
189
197
|
|
|
190
|
-
|
|
198
|
+
#### Self
|
|
191
199
|
|
|
192
200
|
The `client.self` object is now a `Slack::RealTime::Models::User`, which is a child of `Hashie::Mash`, so no code changes should be required.
|
|
193
201
|
|
|
194
|
-
|
|
202
|
+
#### Team
|
|
195
203
|
|
|
196
204
|
The `client.team` object is now a `Slack::RealTime::Models::Team`, which is a child of `Hashie::Mash`, so no code changes should be required.
|
|
197
205
|
|
|
198
|
-
|
|
206
|
+
#### Users, Channels, Groups, and IMs
|
|
199
207
|
|
|
200
|
-
The `client.users`, `.channels`, `.groups` and `.ims` collections have been changed from `Array` to `Hash`, with object ID as key. Replace any code iterating over the array,
|
|
208
|
+
The `client.users`, `.channels`, `.groups` and `.ims` collections have been changed from `Array` to `Hash`, with object ID as key. Replace any code iterating over the array, e.g. `client.users.values.each` or `client.channels.each_pair { |id, channel| ... }`.
|
|
201
209
|
|
|
202
210
|
See [#55](https://github.com/slack-ruby/slack-ruby-client/issues/55) for more information.
|
|
203
211
|
|
|
204
|
-
|
|
212
|
+
## Upgrading to 0.5.0 or Later
|
|
205
213
|
|
|
206
|
-
|
|
214
|
+
### Changes to Real Time Concurrency
|
|
207
215
|
|
|
208
|
-
Since 0.5.0 `Slack::RealTime::Client` supports [Celluloid](https://github.com/celluloid/celluloid) and no longer defaults to [Faye::WebSocket](https://github.com/faye/faye-websocket-ruby) with [
|
|
216
|
+
Since 0.5.0 `Slack::RealTime::Client` supports [Celluloid](https://github.com/celluloid/celluloid) and no longer defaults to [Faye::WebSocket](https://github.com/faye/faye-websocket-ruby) with [EventMachine](https://github.com/eventmachine/eventmachine). It will auto-detect one or the other depending on the gems in your Gemfile, which means you may need to add one or the other to your Gemfile.
|
|
209
217
|
|
|
210
|
-
|
|
218
|
+
#### Faye::WebSocket with EventMachine
|
|
211
219
|
|
|
212
|
-
```
|
|
220
|
+
```ruby
|
|
213
221
|
gem 'faye-websocket'
|
|
214
222
|
```
|
|
215
223
|
|
|
216
|
-
|
|
224
|
+
#### Celluloid
|
|
217
225
|
|
|
218
|
-
```
|
|
226
|
+
```ruby
|
|
219
227
|
gem 'celluloid-io'
|
|
220
228
|
```
|
|
221
229
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'support'
|
|
4
|
+
require 'rack'
|
|
5
|
+
require 'stringio'
|
|
6
|
+
|
|
7
|
+
secret = 'benchmark-signing-secret'
|
|
8
|
+
body = JSON.dump(token: 'x', team_id: 'T1', event: { type: 'message', text: 'hello' * 50 })
|
|
9
|
+
|
|
10
|
+
def signed_env(secret, body)
|
|
11
|
+
timestamp = Time.now.to_i.to_s
|
|
12
|
+
hex = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('SHA256'), secret, "v0:#{timestamp}:#{body}")
|
|
13
|
+
Rack::MockRequest.env_for(
|
|
14
|
+
'/events', method: 'POST', input: body,
|
|
15
|
+
'HTTP_X_SLACK_REQUEST_TIMESTAMP' => timestamp, 'HTTP_X_SLACK_SIGNATURE' => "v0=#{hex}"
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
env = signed_env(secret, body)
|
|
20
|
+
|
|
21
|
+
SlackBenchmarks.run('Slack::Events::Request') do |x|
|
|
22
|
+
x.report('verify!') do
|
|
23
|
+
env['rack.input'].rewind
|
|
24
|
+
Slack::Events::Request.new(Rack::Request.new(env), signing_secret: secret).verify!
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'support'
|
|
4
|
+
|
|
5
|
+
message = 'Hey <@U024BE7LH|bob>, did you see <#C1234|general>? “Quoted” ‘text’ & ' \
|
|
6
|
+
'<https://example.com|a link> > file.txt <!everyone>'
|
|
7
|
+
plain = 'A message without any special formatting, which is the most common case for unescape.' * 3
|
|
8
|
+
markdown = "**Bold**, *italic*, ***both***, ~~struck~~, and a [link](https://example.com).\n" * 5
|
|
9
|
+
escape = 'Hello & <world>, 1 < 2 && 3 > 2.' * 5
|
|
10
|
+
|
|
11
|
+
SlackBenchmarks.run('Slack::Messages::Formatting') do |x|
|
|
12
|
+
x.report('unescape (formatted)') { Slack::Messages::Formatting.unescape(message) }
|
|
13
|
+
x.report('unescape (plain)') { Slack::Messages::Formatting.unescape(plain) }
|
|
14
|
+
x.report('escape') { Slack::Messages::Formatting.escape(escape) }
|
|
15
|
+
x.report('markdown (formatted)') { Slack::Messages::Formatting.markdown(markdown) }
|
|
16
|
+
x.report('markdown (plain)') { Slack::Messages::Formatting.markdown(plain) }
|
|
17
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Shared setup for the benchmarks in this directory. Run one with
|
|
4
|
+
# `bundle exec ruby benchmarks/<name>.rb`, or all of them with `bundle exec rake benchmark`.
|
|
5
|
+
# Set BENCHMARK_TIME and BENCHMARK_WARMUP (seconds) to trade accuracy for speed.
|
|
6
|
+
|
|
7
|
+
require 'benchmark/ips'
|
|
8
|
+
require 'benchmark/memory'
|
|
9
|
+
require 'json'
|
|
10
|
+
|
|
11
|
+
require_relative '../lib/slack-ruby-client'
|
|
12
|
+
|
|
13
|
+
module SlackBenchmarks
|
|
14
|
+
# A Faraday adapter that answers every request in process from canned JSON,
|
|
15
|
+
# so benchmarks measure the client stack (middleware, JSON, Hashie::Mash, helpers) without network noise.
|
|
16
|
+
class Adapter < Faraday::Adapter
|
|
17
|
+
class << self
|
|
18
|
+
attr_accessor :responder
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def call(env)
|
|
22
|
+
super
|
|
23
|
+
body = self.class.responder.call(env)
|
|
24
|
+
save_response(env, 200, body, { 'Content-Type' => 'application/json; charset=utf-8' })
|
|
25
|
+
@app.call(env)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
module_function
|
|
30
|
+
|
|
31
|
+
def run(title, &block)
|
|
32
|
+
puts "== #{title} (Ruby #{RUBY_VERSION}, slack-ruby-client #{Slack::VERSION})"
|
|
33
|
+
time = Float(ENV.fetch('BENCHMARK_TIME', 2))
|
|
34
|
+
warmup = Float(ENV.fetch('BENCHMARK_WARMUP', 1))
|
|
35
|
+
Benchmark.ips do |x|
|
|
36
|
+
x.config(time: time, warmup: warmup)
|
|
37
|
+
yield x
|
|
38
|
+
end
|
|
39
|
+
Benchmark.memory(&block)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def client(&responder)
|
|
43
|
+
Adapter.responder = responder
|
|
44
|
+
Slack::Web::Client.new(token: 'benchmark-token', adapter: Adapter, logger: ::Logger.new(nil))
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def members(count, prefix: 'U')
|
|
48
|
+
Array.new(count) do |i|
|
|
49
|
+
{
|
|
50
|
+
id: "#{prefix}#{i.to_s.rjust(8, '0')}",
|
|
51
|
+
name: "user#{i}",
|
|
52
|
+
real_name: "User #{i}",
|
|
53
|
+
profile: { email: "user#{i}@example.com", display_name: "user#{i}", image: "https://example.com/#{i}.png" }
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Pages through `items` like a cursor-paginated Slack method, honoring `limit` and `cursor`.
|
|
59
|
+
def paginate(env, key, items)
|
|
60
|
+
params = env.method == :get ? Faraday::Utils.parse_query(env.url.query.to_s) : Faraday::Utils.parse_query(env.request_body.to_s)
|
|
61
|
+
limit = Integer(params['limit'] || 100)
|
|
62
|
+
offset = Integer(params['cursor'].to_s.empty? ? 0 : params['cursor'])
|
|
63
|
+
page = items[offset, limit] || []
|
|
64
|
+
next_cursor = offset + limit < items.size ? (offset + limit).to_s : ''
|
|
65
|
+
JSON.dump(ok: true, key => page, response_metadata: { next_cursor: next_cursor })
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'support'
|
|
4
|
+
|
|
5
|
+
members = SlackBenchmarks.members(1_000)
|
|
6
|
+
channels = Array.new(1_000) { |i| { id: format('C%08d', i), name: "channel-#{i}", is_channel: true } }
|
|
7
|
+
auth = JSON.dump(ok: true, url: 'https://example.slack.com/', team: 'Example', user: 'bot', team_id: 'T1', user_id: 'U1')
|
|
8
|
+
posted = JSON.dump(ok: true, channel: 'C1', ts: '1.000', message: { text: 'hello', type: 'message' })
|
|
9
|
+
|
|
10
|
+
client = SlackBenchmarks.client do |env|
|
|
11
|
+
case env.url.path
|
|
12
|
+
when '/api/auth.test' then auth
|
|
13
|
+
when '/api/chat.postMessage' then posted
|
|
14
|
+
when '/api/users.list' then SlackBenchmarks.paginate(env, :members, members)
|
|
15
|
+
when '/api/conversations.list' then SlackBenchmarks.paginate(env, :channels, channels)
|
|
16
|
+
else raise "unexpected request to #{env.url.path}"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
blocks = Array.new(10) { |i| { type: 'section', text: { type: 'mrkdwn', text: "Block #{i}" } } }
|
|
21
|
+
|
|
22
|
+
SlackBenchmarks.run('Slack::Web::Client') do |x|
|
|
23
|
+
x.report('auth_test') { client.auth_test }
|
|
24
|
+
x.report('chat_postMessage with blocks') { client.chat_postMessage(channel: 'C1', text: 'hello', blocks: blocks) }
|
|
25
|
+
x.report('users_list, 10 pages of 100') { client.users_list(limit: 100) { |_page| nil } }
|
|
26
|
+
x.report('users_id, last of 1000') { client.users_id(user: '@user999') }
|
|
27
|
+
x.report('conversations_id, last of 1000') { client.conversations_id(channel: '#channel-999') }
|
|
28
|
+
end
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
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 'AdminAnalyticsMembers methods.'
|
|
8
|
+
command 'admin_analytics_members' do |g|
|
|
9
|
+
g.desc 'Retrieves activity metrics for each member of an organization or workspace for one day. Returns the same metrics as the member analytics dashboard, sorted by user ID.'
|
|
10
|
+
g.long_desc %( Retrieves activity metrics for each member of an organization or workspace for one day. Returns the same metrics as the member analytics dashboard, sorted by user ID. )
|
|
11
|
+
g.command 'activity' do |c|
|
|
12
|
+
c.flag 'date', desc: "The day to report on, as YYYY-MM-DD in UTC. Each metric counts that day's activity. Defaults to the most recent day with data. The response's available_date_range gives the earliest and latest days you can request."
|
|
13
|
+
c.flag 'team_id', desc: 'Workspace ID to scope the results to. With an organization-level token, omit it for organization-wide results. A workspace-level token may only pass its own workspace.'
|
|
14
|
+
c.flag 'member_types', desc: 'Comma-separated list of member types to include. Omit to include every member type.'
|
|
15
|
+
c.flag 'user_ids', desc: 'Comma-separated list of user IDs to return. Use admin.analytics.members.metadata, which supports searching by name and email, to find them; this method never returns names or email addresses. Up to 500 IDs. Deactivated members may be included. Omit to return every member.'
|
|
16
|
+
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."
|
|
17
|
+
c.flag 'limit', desc: 'Maximum number of members to return. Max allowed is 500.'
|
|
18
|
+
c.action do |_global_options, options, _args|
|
|
19
|
+
puts JSON.dump(@client.admin_analytics_members_activity(options))
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
g.desc 'Retrieves profile metadata for each member of an organization or workspace. Returns the same profile fields as the member analytics dashboard, sorted by user ID, as the companion of admin.analytics.members.activity.'
|
|
24
|
+
g.long_desc %( Retrieves profile metadata for each member of an organization or workspace. Returns the same profile fields as the member analytics dashboard, sorted by user ID, as the companion of admin.analytics.members.activity. )
|
|
25
|
+
g.command 'metadata' do |c|
|
|
26
|
+
c.flag 'include_deactivated_since', desc: 'Also return members deactivated on or after this day, as YYYY-MM-DD in UTC. Without it, only active members are returned.'
|
|
27
|
+
c.flag 'team_id', desc: 'Workspace ID to scope the results to. With an organization-level token, omit it for organization-wide results. A workspace-level token may only pass its own workspace.'
|
|
28
|
+
c.flag 'member_types', desc: 'Comma-separated list of member types to include. Omit to include every member type.'
|
|
29
|
+
c.flag 'query', desc: 'Space-delimited search terms matched against member names, and against email addresses when the organization shows them. When the organization hides email addresses, or hides guest email addresses, the search does not match on email at all, so a hidden address cannot be recovered by searching for it. Only matching members are returned.'
|
|
30
|
+
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."
|
|
31
|
+
c.flag 'limit', desc: 'Maximum number of members to return. Max allowed is 500.'
|
|
32
|
+
c.action do |_global_options, options, _args|
|
|
33
|
+
puts JSON.dump(@client.admin_analytics_members_metadata(options))
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -6,14 +6,14 @@ module Slack
|
|
|
6
6
|
class App
|
|
7
7
|
desc 'AdminAnalyticsMessages methods.'
|
|
8
8
|
command 'admin_analytics_messages' do |g|
|
|
9
|
-
g.desc 'Retrieves activity metrics for messages from a given channel
|
|
10
|
-
g.long_desc %( Retrieves activity metrics for messages from a given channel
|
|
9
|
+
g.desc 'Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts'
|
|
10
|
+
g.long_desc %( Retrieves activity metrics for messages from a given channel, created between oldest_ts and latest_ts )
|
|
11
11
|
g.command 'activity' do |c|
|
|
12
12
|
c.flag 'channel', desc: 'Channel ID for channel of the message activity to query.'
|
|
13
13
|
c.flag 'oldest_ts', desc: 'Oldest timestamp to include in the results. Defaults to 7 days before current time. If not passed while still passing the latest_ts parameter, defaults to 7 days before latest_ts.'
|
|
14
14
|
c.flag 'latest_ts', desc: 'Most recent timestamp to include in results. Defaults to current time. If not passed while still passing the oldest_ts parameter, defaults to 7 days after oldest_ts.'
|
|
15
15
|
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."
|
|
16
|
-
c.flag 'limit', desc: 'Maximum number of entries to return.
|
|
16
|
+
c.flag 'limit', desc: 'Maximum number of entries to return. Defaults to 50 if not passed. Max allowed is 100.'
|
|
17
17
|
c.action do |_global_options, options, _args|
|
|
18
18
|
puts JSON.dump(@client.admin_analytics_messages_activity(options))
|
|
19
19
|
end
|
|
@@ -25,7 +25,7 @@ module Slack
|
|
|
25
25
|
c.flag 'channel', desc: 'Channel ID for channel containing the messages to query.'
|
|
26
26
|
c.flag 'oldest_ts', desc: 'Oldest timestamp to include in the results.'
|
|
27
27
|
c.flag 'latest_ts', desc: 'Most recent timestamp to include in the results. If not passed, defaults to current time.'
|
|
28
|
-
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
|
|
28
|
+
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."
|
|
29
29
|
c.action do |_global_options, options, _args|
|
|
30
30
|
puts JSON.dump(@client.admin_analytics_messages_metadata(options))
|
|
31
31
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
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 'AdminAnalyticsSlackbot methods.'
|
|
8
|
+
command 'admin_analytics_slackbot' do |g|
|
|
9
|
+
g.desc 'Retrieve per-user Slackbot skill usage for an Enterprise organization on a single date, returned as paginated JSON.'
|
|
10
|
+
g.long_desc %( Retrieve per-user Slackbot skill usage for an Enterprise organization on a single date, returned as paginated JSON. )
|
|
11
|
+
g.command 'skills' do |c|
|
|
12
|
+
c.flag 'date', desc: "The date to retrieve the analytics data for, expressed as YYYY-MM-DD in UTC. If not provided, defaults to the latest date with available data. The response's available_date_range gives the earliest and latest dates you can request."
|
|
13
|
+
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."
|
|
14
|
+
c.flag 'limit', desc: 'Maximum number of skill entries to return per page, counted across all rows. Defaults to 500. Max allowed is 1000.'
|
|
15
|
+
c.action do |_global_options, options, _args|
|
|
16
|
+
puts JSON.dump(@client.admin_analytics_slackbot_skills(options))
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
g.desc 'Retrieve per-user Slackbot tool usage for an Enterprise organization on a single date, returned as paginated JSON.'
|
|
21
|
+
g.long_desc %( Retrieve per-user Slackbot tool usage for an Enterprise organization on a single date, returned as paginated JSON. )
|
|
22
|
+
g.command 'tools' do |c|
|
|
23
|
+
c.flag 'date', desc: "The date to retrieve the analytics data for, expressed as YYYY-MM-DD in UTC. If not provided, defaults to the latest date with available data. The response's available_date_range gives the earliest and latest dates you can request."
|
|
24
|
+
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."
|
|
25
|
+
c.flag 'limit', desc: 'Maximum number of tool entries to return per page, counted across all rows. Defaults to 500. Max allowed is 1000.'
|
|
26
|
+
c.action do |_global_options, options, _args|
|
|
27
|
+
puts JSON.dump(@client.admin_analytics_slackbot_tools(options))
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
data/bin/commands/admin_apps.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
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 'AdminAppsMcpServers methods.'
|
|
8
|
+
command 'admin_apps_mcp_servers' do |g|
|
|
9
|
+
g.desc "List third-party app MCP servers approved for an organization, derived from the org's MCP server allowlist. Entries reflect allowlist state, not install/scope liveness: servers of apps that are uninstalled (but not deleted) are still listed."
|
|
10
|
+
g.long_desc %( List third-party app MCP servers approved for an organization, derived from the org's MCP server allowlist. Entries reflect allowlist state, not install/scope liveness: servers of apps that are uninstalled (but not deleted) are still listed. )
|
|
11
|
+
g.command 'list' do |c|
|
|
12
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
|
|
13
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
|
14
|
+
c.action do |_global_options, options, _args|
|
|
15
|
+
puts JSON.dump(@client.admin_apps_mcp_servers_list(options))
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
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 'AdminAppsMcpServersPermissions methods.'
|
|
8
|
+
command 'admin_apps_mcp_servers_permissions' do |g|
|
|
9
|
+
g.desc 'List MCP servers for an app with their access control permissions'
|
|
10
|
+
g.long_desc %( List MCP servers for an app with their access control permissions )
|
|
11
|
+
g.command 'list' do |c|
|
|
12
|
+
c.flag 'app_id', desc: 'Encoded ID of the app.'
|
|
13
|
+
c.action do |_global_options, options, _args|
|
|
14
|
+
puts JSON.dump(@client.admin_apps_mcp_servers_permissions_list(options))
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
g.desc 'Set the access control permission for who can use an MCP server'
|
|
19
|
+
g.long_desc %( Set the access control permission for who can use an MCP server )
|
|
20
|
+
g.command 'set' do |c|
|
|
21
|
+
c.flag 'app_id', desc: 'Encoded ID of the app.'
|
|
22
|
+
c.flag 'server_id', desc: 'Encoded ID of the MCP server.'
|
|
23
|
+
c.flag 'permission_type', desc: 'The type of permission that defines who can use this MCP server.'
|
|
24
|
+
c.flag 'user_ids', desc: 'List of user IDs to set for named_entities or named_entities_exclude.'
|
|
25
|
+
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.'
|
|
26
|
+
c.action do |_global_options, options, _args|
|
|
27
|
+
puts JSON.dump(@client.admin_apps_mcp_servers_permissions_set(options))
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
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 'AdminAppsPermissions methods.'
|
|
8
|
+
command 'admin_apps_permissions' do |g|
|
|
9
|
+
g.desc 'Grant permission for entities to access an app that has its permission type set to named_entities'
|
|
10
|
+
g.long_desc %( Grant permission for entities to access an app that has its permission type set to named_entities )
|
|
11
|
+
g.command 'add' do |c|
|
|
12
|
+
c.flag 'app_id', desc: 'Encoded ID of the app.'
|
|
13
|
+
c.flag 'user_ids', desc: 'List of user IDs to allow for named_entities visibility.'
|
|
14
|
+
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.'
|
|
15
|
+
c.flag 'channel_ids', desc: "List of encoded channel IDs to add to the channel restriction list. Interpretation depends on the app's channel_restriction_mode, which is configured via the admin.apps.permissions.set method."
|
|
16
|
+
c.action do |_global_options, options, _args|
|
|
17
|
+
puts JSON.dump(@client.admin_apps_permissions_add(options))
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
g.desc 'Returns the permission type of an app and if applicable, includes the entities that have been granted access'
|
|
22
|
+
g.long_desc %( Returns the permission type of an app and if applicable, includes the entities that have been granted access )
|
|
23
|
+
g.command 'list' do |c|
|
|
24
|
+
c.flag 'app_id', desc: 'Encoded ID of the app.'
|
|
25
|
+
c.action do |_global_options, options, _args|
|
|
26
|
+
puts JSON.dump(@client.admin_apps_permissions_list(options))
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
g.desc "Revoke an entity's access to an app that has its permission type set to named_entities"
|
|
31
|
+
g.long_desc %( Revoke an entity's access to an app that has its permission type set to named_entities )
|
|
32
|
+
g.command 'remove' do |c|
|
|
33
|
+
c.flag 'app_id', desc: 'Encoded ID of the app.'
|
|
34
|
+
c.flag 'user_ids', desc: 'List of user IDs whose named_entities access will be revoked.'
|
|
35
|
+
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs.'
|
|
36
|
+
c.flag 'channel_ids', desc: "List of encoded channel IDs to remove from the channel restriction list. Interpretation depends on the app's channel_restriction_mode, which is configured via the admin.apps.permissions.set method."
|
|
37
|
+
c.action do |_global_options, options, _args|
|
|
38
|
+
puts JSON.dump(@client.admin_apps_permissions_remove(options))
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
g.desc 'Set the permission type for who can access an app'
|
|
43
|
+
g.long_desc %( Set the permission type for who can access an app )
|
|
44
|
+
g.command 'set' do |c|
|
|
45
|
+
c.flag 'app_id', desc: 'Encoded ID of the app.'
|
|
46
|
+
c.flag 'permission_type', desc: 'The type of permission that defines who can access the app.'
|
|
47
|
+
c.flag 'user_ids', desc: 'List of user IDs to allow for named_entities visibility.'
|
|
48
|
+
c.flag 'usergroup_ids', desc: 'List of encoded usergroup IDs the permission applies to. With named_entities the listed groups may access the app; with named_entities_exclude they may not.'
|
|
49
|
+
c.flag 'channel_restriction_mode', desc: 'The mode that defines where the app can be used in channels.'
|
|
50
|
+
c.flag 'channel_ids', desc: 'List of encoded channel IDs for channel restrictions. Semantics depend on channel_restriction_mode: allowlist for specific_channels, exclusion list for all_channels_except.'
|
|
51
|
+
c.action do |_global_options, options, _args|
|
|
52
|
+
puts JSON.dump(@client.admin_apps_permissions_set(options))
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
File without changes
|