slack-ruby-client 1.0.0 → 2.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/FUNDING.yml +1 -0
- data/.github/workflows/integration_test.yml +45 -0
- data/.github/workflows/lint.yml +14 -0
- data/.github/workflows/pr_lint.yml +21 -0
- data/.github/workflows/test.yml +37 -0
- data/.gitignore +4 -3
- data/.rubocop.yml +6 -1
- data/.rubocop_todo.yml +88 -34
- data/.ruby-version +1 -0
- data/CHANGELOG.md +36 -0
- data/CONTRIBUTING.md +6 -5
- data/Gemfile +13 -1
- data/Gemfile.danger +6 -0
- data/README.md +78 -76
- data/RELEASING.md +2 -2
- data/SECURITY.md +9 -0
- data/UPGRADING.md +28 -0
- data/bin/commands/admin_analytics.rb +16 -10
- data/bin/commands/admin_apps.rb +48 -42
- data/bin/commands/admin_apps_approved.rb +17 -11
- data/bin/commands/admin_apps_requests.rb +28 -11
- data/bin/commands/admin_apps_restricted.rb +17 -11
- data/bin/commands/admin_audit_anomaly_allow.rb +29 -0
- data/bin/commands/admin_auth_policy.rb +37 -31
- data/bin/commands/admin_barriers.rb +44 -38
- data/bin/commands/admin_conversations.rb +221 -163
- data/bin/commands/admin_conversations_ekm.rb +17 -11
- data/bin/commands/admin_conversations_restrictAccess.rb +35 -29
- data/bin/commands/admin_emoji.rb +50 -44
- data/bin/commands/admin_inviteRequests.rb +34 -28
- data/bin/commands/admin_inviteRequests_approved.rb +16 -10
- data/bin/commands/admin_inviteRequests_denied.rb +16 -10
- data/bin/commands/admin_roles.rb +46 -0
- data/bin/commands/admin_teams.rb +26 -20
- data/bin/commands/admin_teams_admins.rb +16 -10
- data/bin/commands/admin_teams_owners.rb +16 -10
- data/bin/commands/admin_teams_settings.rb +59 -53
- data/bin/commands/admin_usergroups.rb +45 -39
- data/bin/commands/admin_users.rb +91 -85
- data/bin/commands/admin_users_session.rb +72 -66
- data/bin/commands/admin_users_unsupportedVersions.rb +21 -0
- data/bin/commands/api.rb +14 -8
- data/bin/commands/apps.rb +15 -9
- data/bin/commands/apps_connections.rb +13 -7
- data/bin/commands/apps_event_authorizations.rb +16 -10
- data/bin/commands/apps_manifest.rb +48 -41
- data/bin/commands/auth.rb +21 -15
- data/bin/commands/auth_teams.rb +16 -10
- data/bin/commands/bookmarks.rb +59 -0
- data/bin/commands/bots.rb +15 -9
- data/bin/commands/calls.rb +49 -43
- data/bin/commands/calls_participants.rb +24 -18
- data/bin/commands/chat.rb +150 -141
- data/bin/commands/chat_scheduledMessages.rb +19 -13
- data/bin/commands/conversations.rb +233 -225
- data/bin/commands/dialog.rb +15 -9
- data/bin/commands/dnd.rb +46 -40
- data/bin/commands/emoji.rb +14 -7
- data/bin/commands/files.rb +112 -83
- data/bin/commands/files_comments.rb +15 -9
- data/bin/commands/files_remote.rb +73 -67
- data/bin/commands/functions_workflows_steps.rb +22 -0
- data/bin/commands/functions_workflows_steps_responses.rb +22 -0
- data/bin/commands/migration.rb +16 -10
- data/bin/commands/oauth.rb +18 -12
- data/bin/commands/oauth_v2.rb +28 -22
- data/bin/commands/openid_connect.rb +26 -20
- data/bin/commands/pins.rb +33 -26
- data/bin/commands/reactions.rb +52 -46
- data/bin/commands/reminders.rb +53 -47
- data/bin/commands/rtm.rb +15 -24
- data/bin/commands/search.rb +43 -37
- data/bin/commands/stars.rb +38 -32
- data/bin/commands/team.rb +47 -38
- data/bin/commands/team_billing.rb +13 -7
- data/bin/commands/team_preferences.rb +13 -7
- data/bin/commands/team_profile.rb +14 -8
- data/bin/commands/tooling_tokens.rb +14 -8
- data/bin/commands/usergroups.rb +64 -58
- data/bin/commands/usergroups_users.rb +27 -21
- data/bin/commands/users.rb +111 -105
- data/bin/commands/users_admin.rb +28 -22
- data/bin/commands/users_prefs.rb +13 -7
- data/bin/commands/users_profile.rb +26 -20
- data/bin/commands/views.rb +47 -39
- data/bin/commands/workflows.rb +36 -30
- data/bin/slack +48 -43
- data/lib/slack/real_time/api/message.rb +3 -2
- data/lib/slack/real_time/api/templates/event_handler.erb +5 -1
- data/lib/slack/real_time/api/typing.rb +2 -1
- data/lib/slack/real_time/client.rb +10 -28
- data/lib/slack/real_time/config.rb +3 -3
- data/lib/slack/real_time/models/channel.rb +4 -0
- data/lib/slack/real_time/models/{group.rb → mpim.rb} +1 -1
- data/lib/slack/real_time/models.rb +2 -1
- data/lib/slack/real_time/stores/base.rb +25 -9
- data/lib/slack/real_time/stores/starter.rb +323 -309
- data/lib/slack/real_time/stores/store.rb +265 -198
- data/lib/slack/real_time/stores.rb +1 -7
- 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 +2 -2
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +16 -0
- data/lib/slack/web/api/endpoints/admin_audit_anomaly_allow.rb +34 -0
- data/lib/slack/web/api/endpoints/admin_auth_policy.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_barriers.rb +8 -8
- data/lib/slack/web/api/endpoints/admin_conversations.rb +110 -28
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +6 -6
- data/lib/slack/web/api/endpoints/admin_emoji.rb +9 -9
- data/lib/slack/web/api/endpoints/admin_inviteRequests.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
- data/lib/slack/web/api/endpoints/admin_teams.rb +2 -2
- data/lib/slack/web/api/endpoints/admin_teams_admins.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams_owners.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_teams_settings.rb +11 -11
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +7 -7
- data/lib/slack/web/api/endpoints/admin_users.rb +16 -16
- data/lib/slack/web/api/endpoints/admin_users_session.rb +8 -8
- data/lib/slack/web/api/endpoints/admin_users_unsupportedVersions.rb +25 -0
- data/lib/slack/web/api/endpoints/apps.rb +2 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +1 -1
- data/lib/slack/web/api/endpoints/apps_manifest.rb +8 -6
- data/lib/slack/web/api/endpoints/bookmarks.rb +88 -0
- data/lib/slack/web/api/endpoints/bots.rb +1 -1
- data/lib/slack/web/api/endpoints/calls.rb +5 -5
- data/lib/slack/web/api/endpoints/calls_participants.rb +4 -4
- data/lib/slack/web/api/endpoints/chat.rb +37 -31
- data/lib/slack/web/api/endpoints/conversations.rb +38 -34
- data/lib/slack/web/api/endpoints/dialog.rb +2 -2
- data/lib/slack/web/api/endpoints/dnd.rb +1 -1
- data/lib/slack/web/api/endpoints/emoji.rb +2 -0
- data/lib/slack/web/api/endpoints/files.rb +45 -10
- data/lib/slack/web/api/endpoints/files_comments.rb +2 -2
- data/lib/slack/web/api/endpoints/files_remote.rb +8 -8
- data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +28 -0
- data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +28 -0
- data/lib/slack/web/api/endpoints/migration.rb +1 -1
- data/lib/slack/web/api/endpoints/oauth_v2.rb +2 -2
- data/lib/slack/web/api/endpoints/pins.rb +5 -3
- data/lib/slack/web/api/endpoints/reactions.rb +4 -4
- data/lib/slack/web/api/endpoints/reminders.rb +5 -5
- data/lib/slack/web/api/endpoints/rtm.rb +0 -23
- data/lib/slack/web/api/endpoints/search.rb +3 -3
- data/lib/slack/web/api/endpoints/team.rb +13 -1
- data/lib/slack/web/api/endpoints/tooling_tokens.rb +1 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
- data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -3
- data/lib/slack/web/api/endpoints/users.rb +4 -4
- data/lib/slack/web/api/endpoints/users_admin.rb +2 -2
- data/lib/slack/web/api/endpoints/users_profile.rb +1 -1
- data/lib/slack/web/api/endpoints/views.rb +16 -11
- data/lib/slack/web/api/endpoints/workflows.rb +4 -4
- data/lib/slack/web/api/endpoints.rb +12 -0
- data/lib/slack/web/api/errors.rb +146 -8
- data/lib/slack/web/api/mixins/conversations.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.id.rb +1 -1
- data/lib/slack/web/api/mixins/users.search.rb +2 -1
- data/lib/slack/web/api/patches/{chat.1.patch → chat.attachments-blocks.patch} +13 -14
- data/lib/slack/web/api/patches/{dialog.1.open-json-support.patch → dialog.encoded-json.patch} +4 -4
- data/lib/slack/web/api/patches/views.view-json.patch +55 -0
- data/lib/slack/web/api/templates/command.erb +18 -12
- data/lib/slack/web/api/templates/method.erb +1 -1
- data/lib/slack/web/config.rb +2 -2
- data/lib/slack/web/faraday/connection.rb +4 -4
- data/lib/slack/web/faraday/request.rb +2 -0
- data/lib/slack/web/faraday/response/raise_error.rb +2 -10
- data/lib/slack/web/faraday/response/wrap_error.rb +1 -1
- data/lib/slack-ruby-client.rb +2 -1
- data/lib/tasks/real_time.rake +44 -24
- data/lib/tasks/web.rake +9 -8
- data/slack-ruby-client.gemspec +5 -14
- data/spec/fixtures/slack/web/rtm_connect.yml +85 -1
- data/spec/integration/integration_spec.rb +1 -1
- data/spec/slack/events/config_spec.rb +2 -0
- data/spec/slack/events/request_spec.rb +5 -1
- data/spec/slack/messages/formatting_spec.rb +10 -0
- data/spec/slack/real_time/api/message_spec.rb +1 -1
- data/spec/slack/real_time/api/ping_spec.rb +1 -1
- data/spec/slack/real_time/api/typing_spec.rb +1 -1
- data/spec/slack/real_time/client_spec.rb +91 -127
- data/spec/slack/real_time/event_handlers/bot_spec.rb +19 -17
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
- data/spec/slack/real_time/event_handlers/im_spec.rb +30 -27
- data/spec/slack/real_time/event_handlers/{group_spec.rb → private_channel_spec.rb} +35 -27
- data/spec/slack/real_time/event_handlers/{channel_spec.rb → public_channel_spec.rb} +27 -23
- data/spec/slack/real_time/event_handlers/team_spec.rb +7 -8
- data/spec/slack/real_time/event_handlers/user_spec.rb +6 -5
- data/spec/slack/real_time/stores/store_spec.rb +50 -0
- data/spec/slack/slack_spec.rb +5 -4
- data/spec/slack/version_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_audit_anomaly_allow_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +31 -0
- data/spec/slack/web/api/endpoints/admin_roles_spec.rb +30 -0
- data/spec/slack/web/api/endpoints/admin_users_unsupportedVersions_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/bookmarks_spec.rb +40 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +45 -17
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +6 -2
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +33 -16
- data/spec/slack/web/api/endpoints/files_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +13 -0
- data/spec/slack/web/api/mixins/conversations_spec.rb +2 -0
- data/spec/slack/web/api/mixins/users_spec.rb +2 -0
- data/spec/slack/web/api/pagination/cursor_spec.rb +11 -7
- data/spec/slack/web/client_spec.rb +39 -11
- data/spec/slack/web/faraday/response/raise_error_spec.rb +1 -1
- data/spec/support/real_time/connected_client.rb +1 -1
- data/spec/support/real_time/loaded_client.rb +120 -0
- metadata +45 -197
- data/.travis.yml +0 -29
- data/bin/commands/admin_conversations_whitelist.rb +0 -37
- data/bin/commands/apps_permissions.rb +0 -23
- data/bin/commands/apps_permissions_resources.rb +0 -15
- data/bin/commands/apps_permissions_scopes.rb +0 -13
- data/bin/commands/apps_permissions_users.rb +0 -26
- data/bin/commands/channels.rb +0 -23
- data/bin/commands/groups.rb +0 -14
- data/bin/commands/im.rb +0 -6
- data/bin/commands/mpim.rb +0 -6
- data/bin/commands.rb +0 -66
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +0 -64
- data/lib/slack/web/api/endpoints/apps_permissions.rb +0 -36
- data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +0 -31
- data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +0 -21
- data/lib/slack/web/api/endpoints/apps_permissions_users.rb +0 -50
- data/lib/slack/web/api/endpoints/channels.rb +0 -25
- data/lib/slack/web/api/endpoints/groups.rb +0 -13
- data/lib/slack/web/api/endpoints/im.rb +0 -13
- data/lib/slack/web/api/endpoints/mpim.rb +0 -13
- data/lib/slack/web/api/endpoints/presence.rb +0 -23
- data/lib/slack/web/api/patches/views.1.view-json.patch +0 -40
- data/lib/slack/web/api/patches/views.1.views-published.patch +0 -16
- data/lib/slack/web/api/templates/commands.erb +0 -6
- data/spec/fixtures/slack/web/rtm_start.yml +0 -815
- data/spec/slack/real_time/rtm_start_spec.rb +0 -14
- data/spec/slack/real_time/store_spec.rb +0 -12
|
@@ -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
|
data/bin/commands/channels.rb
DELETED
|
@@ -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
|
data/bin/commands/groups.rb
DELETED
|
@@ -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
data/bin/commands/mpim.rb
DELETED
data/bin/commands.rb
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# This file was auto-generated by lib/tasks/web.rake
|
|
3
|
-
|
|
4
|
-
require 'commands/admin_analytics'
|
|
5
|
-
require 'commands/admin_apps'
|
|
6
|
-
require 'commands/admin_apps_approved'
|
|
7
|
-
require 'commands/admin_apps_requests'
|
|
8
|
-
require 'commands/admin_apps_restricted'
|
|
9
|
-
require 'commands/admin_auth_policy'
|
|
10
|
-
require 'commands/admin_barriers'
|
|
11
|
-
require 'commands/admin_conversations'
|
|
12
|
-
require 'commands/admin_conversations_ekm'
|
|
13
|
-
require 'commands/admin_conversations_restrictAccess'
|
|
14
|
-
require 'commands/admin_emoji'
|
|
15
|
-
require 'commands/admin_inviteRequests'
|
|
16
|
-
require 'commands/admin_inviteRequests_approved'
|
|
17
|
-
require 'commands/admin_inviteRequests_denied'
|
|
18
|
-
require 'commands/admin_teams'
|
|
19
|
-
require 'commands/admin_teams_admins'
|
|
20
|
-
require 'commands/admin_teams_owners'
|
|
21
|
-
require 'commands/admin_teams_settings'
|
|
22
|
-
require 'commands/admin_usergroups'
|
|
23
|
-
require 'commands/admin_users'
|
|
24
|
-
require 'commands/admin_users_session'
|
|
25
|
-
require 'commands/api'
|
|
26
|
-
require 'commands/apps'
|
|
27
|
-
require 'commands/apps_connections'
|
|
28
|
-
require 'commands/apps_event_authorizations'
|
|
29
|
-
require 'commands/apps_manifest'
|
|
30
|
-
require 'commands/auth'
|
|
31
|
-
require 'commands/auth_teams'
|
|
32
|
-
require 'commands/bots'
|
|
33
|
-
require 'commands/calls'
|
|
34
|
-
require 'commands/calls_participants'
|
|
35
|
-
require 'commands/chat'
|
|
36
|
-
require 'commands/chat_scheduledMessages'
|
|
37
|
-
require 'commands/conversations'
|
|
38
|
-
require 'commands/dialog'
|
|
39
|
-
require 'commands/dnd'
|
|
40
|
-
require 'commands/emoji'
|
|
41
|
-
require 'commands/files'
|
|
42
|
-
require 'commands/files_comments'
|
|
43
|
-
require 'commands/files_remote'
|
|
44
|
-
require 'commands/migration'
|
|
45
|
-
require 'commands/oauth'
|
|
46
|
-
require 'commands/oauth_v2'
|
|
47
|
-
require 'commands/openid_connect'
|
|
48
|
-
require 'commands/pins'
|
|
49
|
-
require 'commands/reactions'
|
|
50
|
-
require 'commands/reminders'
|
|
51
|
-
require 'commands/rtm'
|
|
52
|
-
require 'commands/search'
|
|
53
|
-
require 'commands/stars'
|
|
54
|
-
require 'commands/team'
|
|
55
|
-
require 'commands/team_billing'
|
|
56
|
-
require 'commands/team_preferences'
|
|
57
|
-
require 'commands/team_profile'
|
|
58
|
-
require 'commands/tooling_tokens'
|
|
59
|
-
require 'commands/usergroups'
|
|
60
|
-
require 'commands/usergroups_users'
|
|
61
|
-
require 'commands/users'
|
|
62
|
-
require 'commands/users_admin'
|
|
63
|
-
require 'commands/users_prefs'
|
|
64
|
-
require 'commands/users_profile'
|
|
65
|
-
require 'commands/views'
|
|
66
|
-
require 'commands/workflows'
|
|
@@ -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
|
|
@@ -1,50 +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 AppsPermissionsUsers
|
|
9
|
-
#
|
|
10
|
-
# Returns list of user grants and corresponding scopes 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.users.list
|
|
17
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions.users/apps.permissions.users.list.json
|
|
18
|
-
def apps_permissions_users_list(options = {})
|
|
19
|
-
if block_given?
|
|
20
|
-
Pagination::Cursor.new(self, :apps_permissions_users_list, options).each do |page|
|
|
21
|
-
yield page
|
|
22
|
-
end
|
|
23
|
-
else
|
|
24
|
-
post('apps.permissions.users.list', options)
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
#
|
|
29
|
-
# Enables an app to trigger a permissions modal to grant an app access to a user access scope.
|
|
30
|
-
#
|
|
31
|
-
# @option options [Object] :scopes
|
|
32
|
-
# A comma separated list of user scopes to request for.
|
|
33
|
-
# @option options [Object] :trigger_id
|
|
34
|
-
# Token used to trigger the request.
|
|
35
|
-
# @option options [user] :user
|
|
36
|
-
# The user this scope is being requested for.
|
|
37
|
-
# @see https://api.slack.com/methods/apps.permissions.users.request
|
|
38
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.permissions.users/apps.permissions.users.request.json
|
|
39
|
-
def apps_permissions_users_request(options = {})
|
|
40
|
-
throw ArgumentError.new('Required arguments :scopes missing') if options[:scopes].nil?
|
|
41
|
-
throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
|
|
42
|
-
throw ArgumentError.new('Required arguments :user missing') if options[:user].nil?
|
|
43
|
-
options = options.merge(user: users_id(options)['user']['id']) if options[:user]
|
|
44
|
-
post('apps.permissions.users.request', options)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
end
|
|
@@ -1,25 +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 Channels
|
|
9
|
-
#
|
|
10
|
-
# Delete a channel (undocumented)
|
|
11
|
-
#
|
|
12
|
-
# @option options [channel] :channel
|
|
13
|
-
# Channel to delete.
|
|
14
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/channels/channels.delete.json
|
|
15
|
-
def channels_delete(options = {})
|
|
16
|
-
throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
|
|
17
|
-
options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]
|
|
18
|
-
logger.warn('The channels.delete method is undocumented.')
|
|
19
|
-
post('channels.delete', options)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by lib/slack/web/api/tasks/generate.rake
|
|
2
|
-
|
|
3
|
-
module Slack
|
|
4
|
-
module Web
|
|
5
|
-
module Api
|
|
6
|
-
module Endpoints
|
|
7
|
-
module Presence
|
|
8
|
-
#
|
|
9
|
-
# Manually set user presence.
|
|
10
|
-
#
|
|
11
|
-
# @option options [Object] :presence
|
|
12
|
-
# Either `active` or `away`.
|
|
13
|
-
# @see https://api.slack.com/methods/presence.set
|
|
14
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/presence.set.json
|
|
15
|
-
def presence_set(options = {})
|
|
16
|
-
throw ArgumentError.new('Required arguments :presence missing') if options[:presence].nil?
|
|
17
|
-
post('presence.set', options)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
diff --git a/lib/slack/web/api/endpoints/views.rb b/lib/slack/web/api/endpoints/views.rb
|
|
2
|
-
index 3d7ac8e..10de15c 100644
|
|
3
|
-
--- a/lib/slack/web/api/endpoints/views.rb
|
|
4
|
-
+++ b/lib/slack/web/api/endpoints/views.rb
|
|
5
|
-
@@ -18,6 +18,11 @@ module Slack
|
|
6
|
-
def views_open(options = {})
|
|
7
|
-
throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
|
|
8
|
-
throw ArgumentError.new('Required arguments :view missing') if options[:view].nil?
|
|
9
|
-
+ if options.key?(:view)
|
|
10
|
-
+ view = options[:view]
|
|
11
|
-
+ view = JSON.dump(view) unless view.is_a?(String)
|
|
12
|
-
+ options = options.merge(view: view)
|
|
13
|
-
+ end
|
|
14
|
-
post('views.open', options)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
@@ -33,6 +38,11 @@ module Slack
|
|
18
|
-
def views_push(options = {})
|
|
19
|
-
throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
|
|
20
|
-
throw ArgumentError.new('Required arguments :view missing') if options[:view].nil?
|
|
21
|
-
+ if options.key?(:view)
|
|
22
|
-
+ view = options[:view]
|
|
23
|
-
+ view = JSON.dump(view) unless view.is_a?(String)
|
|
24
|
-
+ options = options.merge(view: view)
|
|
25
|
-
+ end
|
|
26
|
-
post('views.push', options)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
@@ -51,6 +61,11 @@ module Slack
|
|
30
|
-
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/views/views.update.json
|
|
31
|
-
def views_update(options = {})
|
|
32
|
-
throw ArgumentError.new('Required arguments :view missing') if options[:view].nil?
|
|
33
|
-
+ if options.key?(:view)
|
|
34
|
-
+ view = options[:view]
|
|
35
|
-
+ view = JSON.dump(view) unless view.is_a?(String)
|
|
36
|
-
+ options = options.merge(view: view)
|
|
37
|
-
+ end
|
|
38
|
-
post('views.update', options)
|
|
39
|
-
end
|
|
40
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
diff --git a/lib/slack/web/api/endpoints/views.rb b/lib/slack/web/api/endpoints/views.rb
|
|
2
|
-
index 31626b9..8182a9c 100644
|
|
3
|
-
--- a/lib/slack/web/api/endpoints/views.rb
|
|
4
|
-
+++ b/lib/slack/web/api/endpoints/views.rb
|
|
5
|
-
@@ -40,6 +40,11 @@ module Slack
|
|
6
|
-
def views_publish(options = {})
|
|
7
|
-
throw ArgumentError.new('Required arguments :user_id missing') if options[:user_id].nil?
|
|
8
|
-
throw ArgumentError.new('Required arguments :view missing') if options[:view].nil?
|
|
9
|
-
+ if options.key?(:view)
|
|
10
|
-
+ view = options[:view]
|
|
11
|
-
+ view = JSON.dump(view) unless view.is_a?(String)
|
|
12
|
-
+ options = options.merge(view: view)
|
|
13
|
-
+ end
|
|
14
|
-
post('views.publish', options)
|
|
15
|
-
end
|
|
16
|
-
|