slack-ruby-client 0.14.4 → 0.14.5
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/.rubocop.yml +19 -11
- data/.rubocop_todo.yml +66 -47
- data/CHANGELOG.md +8 -0
- data/Dangerfile +1 -0
- data/Gemfile +1 -0
- data/README.md +16 -9
- data/Rakefile +1 -0
- data/bin/commands.rb +6 -0
- data/bin/commands/admin_apps.rb +27 -0
- data/bin/commands/admin_apps_requests.rb +16 -0
- data/bin/commands/admin_users_session.rb +3 -2
- data/bin/commands/api.rb +3 -2
- data/bin/commands/apps.rb +3 -2
- data/bin/commands/apps_permissions.rb +5 -4
- data/bin/commands/apps_permissions_resources.rb +3 -2
- data/bin/commands/apps_permissions_scopes.rb +3 -2
- data/bin/commands/apps_permissions_users.rb +5 -4
- data/bin/commands/auth.rb +5 -4
- data/bin/commands/bots.rb +3 -2
- data/bin/commands/channels.rb +31 -30
- data/bin/commands/chat.rb +19 -18
- data/bin/commands/chat_scheduledMessages.rb +3 -2
- data/bin/commands/conversations.rb +35 -34
- data/bin/commands/dialog.rb +3 -2
- data/bin/commands/dnd.rb +9 -8
- data/bin/commands/emoji.rb +3 -2
- data/bin/commands/files.rb +13 -12
- data/bin/commands/files_comments.rb +3 -2
- data/bin/commands/files_remote.rb +78 -0
- data/bin/commands/groups.rb +33 -32
- data/bin/commands/im.rb +13 -12
- data/bin/commands/migration.rb +3 -2
- data/bin/commands/mpim.rb +11 -10
- data/bin/commands/oauth.rb +5 -4
- data/bin/commands/oauth_v2.rb +17 -0
- data/bin/commands/pins.rb +7 -8
- data/bin/commands/reactions.rb +10 -11
- data/bin/commands/reminders.rb +11 -10
- data/bin/commands/rtm.rb +5 -4
- data/bin/commands/search.rb +7 -6
- data/bin/commands/stars.rb +7 -6
- data/bin/commands/team.rb +9 -8
- data/bin/commands/team_profile.rb +3 -2
- data/bin/commands/usergroups.rb +11 -10
- data/bin/commands/usergroups_users.rb +5 -4
- data/bin/commands/users.rb +21 -20
- data/bin/commands/users_admin.rb +1 -0
- data/bin/commands/users_prefs.rb +1 -0
- data/bin/commands/users_profile.rb +5 -4
- data/bin/commands/views.rb +48 -0
- data/bin/slack +1 -2
- data/examples/hi_real_time/Gemfile +1 -0
- data/examples/hi_real_time/hi.rb +7 -3
- data/examples/hi_real_time_and_web/Gemfile +1 -0
- data/examples/hi_real_time_and_web/hi.rb +7 -3
- data/examples/hi_real_time_async_async/Gemfile +1 -0
- data/examples/hi_real_time_async_async/hi.rb +6 -2
- data/examples/hi_real_time_async_celluloid/Gemfile +1 -0
- data/examples/hi_real_time_async_celluloid/hi.rb +7 -3
- data/examples/hi_real_time_async_eventmachine/Gemfile +1 -0
- data/examples/hi_real_time_async_eventmachine/hi.rb +7 -3
- data/examples/hi_web/Gemfile +1 -0
- data/examples/hi_web/hi.rb +1 -0
- data/examples/new_ticket/Gemfile +1 -0
- data/examples/new_ticket/new_ticket.rb +1 -0
- data/lib/slack-ruby-client.rb +3 -2
- data/lib/slack.rb +1 -0
- data/lib/slack/config.rb +1 -0
- data/lib/slack/events/config.rb +1 -0
- data/lib/slack/events/request.rb +3 -1
- data/lib/slack/logger.rb +6 -5
- data/lib/slack/messages/formatting.rb +1 -0
- data/lib/slack/messages/message.rb +1 -0
- data/lib/slack/real_time/api/message.rb +3 -1
- data/lib/slack/real_time/api/message_id.rb +1 -0
- data/lib/slack/real_time/api/ping.rb +5 -2
- data/lib/slack/real_time/api/typing.rb +3 -1
- data/lib/slack/real_time/client.rb +19 -12
- data/lib/slack/real_time/concurrency.rb +1 -0
- data/lib/slack/real_time/concurrency/async.rb +15 -7
- data/lib/slack/real_time/concurrency/celluloid.rb +9 -3
- data/lib/slack/real_time/concurrency/eventmachine.rb +7 -4
- data/lib/slack/real_time/config.rb +6 -1
- data/lib/slack/real_time/models.rb +1 -0
- data/lib/slack/real_time/models/base.rb +1 -0
- data/lib/slack/real_time/models/bot.rb +1 -0
- data/lib/slack/real_time/models/channel.rb +1 -0
- data/lib/slack/real_time/models/group.rb +1 -0
- data/lib/slack/real_time/models/im.rb +1 -0
- data/lib/slack/real_time/models/team.rb +1 -0
- data/lib/slack/real_time/models/user.rb +1 -0
- data/lib/slack/real_time/socket.rb +14 -11
- data/lib/slack/real_time/stores.rb +1 -0
- data/lib/slack/real_time/stores/base.rb +1 -0
- data/lib/slack/real_time/stores/starter.rb +1 -0
- data/lib/slack/real_time/stores/store.rb +16 -25
- data/lib/slack/version.rb +2 -1
- data/lib/slack/web/api/endpoints.rb +11 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +42 -0
- data/lib/slack/web/api/endpoints/admin_apps_requests.rb +33 -0
- data/lib/slack/web/api/endpoints/admin_users_session.rb +2 -1
- data/lib/slack/web/api/endpoints/api.rb +2 -1
- data/lib/slack/web/api/endpoints/apps.rb +2 -1
- data/lib/slack/web/api/endpoints/apps_permissions.rb +3 -2
- data/lib/slack/web/api/endpoints/apps_permissions_resources.rb +2 -1
- data/lib/slack/web/api/endpoints/apps_permissions_scopes.rb +2 -1
- data/lib/slack/web/api/endpoints/apps_permissions_users.rb +3 -2
- data/lib/slack/web/api/endpoints/auth.rb +3 -2
- data/lib/slack/web/api/endpoints/bots.rb +2 -1
- data/lib/slack/web/api/endpoints/channels.rb +16 -16
- data/lib/slack/web/api/endpoints/chat.rb +10 -9
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -1
- data/lib/slack/web/api/endpoints/conversations.rb +18 -17
- data/lib/slack/web/api/endpoints/dialog.rb +2 -1
- data/lib/slack/web/api/endpoints/dnd.rb +5 -4
- data/lib/slack/web/api/endpoints/emoji.rb +2 -1
- data/lib/slack/web/api/endpoints/files.rb +7 -6
- data/lib/slack/web/api/endpoints/files_comments.rb +2 -1
- data/lib/slack/web/api/endpoints/files_remote.rb +127 -0
- data/lib/slack/web/api/endpoints/groups.rb +17 -22
- data/lib/slack/web/api/endpoints/im.rb +7 -8
- data/lib/slack/web/api/endpoints/migration.rb +2 -1
- data/lib/slack/web/api/endpoints/mpim.rb +6 -7
- data/lib/slack/web/api/endpoints/oauth.rb +3 -2
- data/lib/slack/web/api/endpoints/oauth_v2.rb +30 -0
- data/lib/slack/web/api/endpoints/pins.rb +5 -9
- data/lib/slack/web/api/endpoints/reactions.rb +9 -12
- data/lib/slack/web/api/endpoints/reminders.rb +6 -5
- data/lib/slack/web/api/endpoints/rtm.rb +3 -2
- data/lib/slack/web/api/endpoints/search.rb +4 -3
- data/lib/slack/web/api/endpoints/stars.rb +4 -5
- data/lib/slack/web/api/endpoints/team.rb +5 -5
- data/lib/slack/web/api/endpoints/team_profile.rb +2 -1
- data/lib/slack/web/api/endpoints/usergroups.rb +6 -5
- data/lib/slack/web/api/endpoints/usergroups_users.rb +3 -2
- data/lib/slack/web/api/endpoints/users.rb +11 -16
- data/lib/slack/web/api/endpoints/users_admin.rb +1 -0
- data/lib/slack/web/api/endpoints/users_prefs.rb +1 -0
- data/lib/slack/web/api/endpoints/users_profile.rb +3 -2
- data/lib/slack/web/api/endpoints/views.rb +97 -0
- data/lib/slack/web/api/error.rb +1 -0
- data/lib/slack/web/api/errors/slack_error.rb +2 -1
- data/lib/slack/web/api/errors/too_many_requests_error.rb +1 -0
- data/lib/slack/web/api/mixins.rb +1 -0
- data/lib/slack/web/api/mixins/channels.id.rb +1 -0
- data/lib/slack/web/api/mixins/groups.id.rb +1 -0
- data/lib/slack/web/api/mixins/ids.id.rb +4 -1
- data/lib/slack/web/api/mixins/users.id.rb +1 -0
- data/lib/slack/web/api/mixins/users.search.rb +1 -0
- data/lib/slack/web/api/patches/views.1.view-json.patch +40 -0
- data/lib/slack/web/api/patches/views.1.views-published.patch +16 -0
- data/lib/slack/web/api/templates/command.erb +1 -0
- data/lib/slack/web/api/templates/commands.erb +1 -0
- data/lib/slack/web/api/templates/endpoints.erb +1 -0
- data/lib/slack/web/api/templates/method.erb +1 -0
- data/lib/slack/web/api/templates/method_spec.erb +1 -0
- data/lib/slack/web/client.rb +1 -0
- data/lib/slack/web/config.rb +1 -0
- data/lib/slack/web/faraday/connection.rb +1 -0
- data/lib/slack/web/faraday/request.rb +1 -0
- data/lib/slack/web/faraday/response/raise_error.rb +7 -6
- data/lib/slack/web/pagination/cursor.rb +1 -0
- data/lib/slack_ruby_client.rb +1 -0
- data/lib/tasks/git.rake +1 -0
- data/lib/tasks/real_time.rake +12 -4
- data/lib/tasks/update.rake +1 -0
- data/lib/tasks/web.rake +17 -6
- data/screenshots/create-app.png +0 -0
- data/slack-ruby-client.gemspec +4 -1
- data/spec/integration/integration_spec.rb +16 -17
- data/spec/slack/config_spec.rb +2 -0
- data/spec/slack/events/config_spec.rb +8 -4
- data/spec/slack/events/request_spec.rb +67 -37
- data/spec/slack/messages/formatting_spec.rb +25 -13
- data/spec/slack/real_time/api/message_spec.rb +6 -1
- data/spec/slack/real_time/api/ping_spec.rb +2 -0
- data/spec/slack/real_time/api/typing_spec.rb +5 -1
- data/spec/slack/real_time/client_spec.rb +137 -39
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +11 -6
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +9 -1
- data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +2 -0
- data/spec/slack/real_time/event_handlers/bot_spec.rb +2 -1
- data/spec/slack/real_time/event_handlers/channel_spec.rb +9 -6
- data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +2 -1
- data/spec/slack/real_time/event_handlers/group_spec.rb +5 -4
- data/spec/slack/real_time/event_handlers/im_spec.rb +4 -3
- data/spec/slack/real_time/event_handlers/team_spec.rb +3 -1
- data/spec/slack/real_time/event_handlers/user_spec.rb +1 -0
- data/spec/slack/real_time/rtm_connect_spec.rb +1 -0
- data/spec/slack/real_time/rtm_start_spec.rb +1 -0
- data/spec/slack/real_time/store_spec.rb +2 -1
- data/spec/slack/slack_spec.rb +37 -5
- data/spec/slack/version_spec.rb +2 -1
- data/spec/slack/web/api/endpoints/admin_apps_requests_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/api_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_permissions_resources_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_permissions_scopes_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/apps_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/bots_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/conversations_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/custom_specs/auth_spec.rb +5 -1
- data/spec/slack/web/api/endpoints/custom_specs/channels_spec.rb +2 -0
- data/spec/slack/web/api/endpoints/custom_specs/chat_spec.rb +80 -25
- data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +12 -4
- data/spec/slack/web/api/endpoints/custom_specs/groups_spec.rb +2 -0
- data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +6 -1
- data/spec/slack/web/api/endpoints/custom_specs/views_spec.rb +95 -0
- data/spec/slack/web/api/endpoints/dnd_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/emoji_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +24 -0
- data/spec/slack/web/api/endpoints/files_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/im_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/migration_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/mpim_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/oauth_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/oauth_v2_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/pins_spec.rb +5 -1
- data/spec/slack/web/api/endpoints/reactions_spec.rb +8 -1
- data/spec/slack/web/api/endpoints/reminders_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/rtm_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/search_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/stars_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/team_profile_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/team_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/usergroups_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/users_admin_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/users_prefs_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/users_profile_spec.rb +1 -0
- data/spec/slack/web/api/endpoints/views_spec.rb +29 -0
- data/spec/slack/web/api/error_spec.rb +4 -2
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +6 -3
- data/spec/slack/web/api/errors/slack_error_spec.rb +4 -2
- data/spec/slack/web/api/mixins/channels_spec.rb +17 -7
- data/spec/slack/web/api/mixins/groups_spec.rb +17 -7
- data/spec/slack/web/api/mixins/users_spec.rb +17 -8
- data/spec/slack/web/api/pagination/cursor_spec.rb +40 -10
- data/spec/slack/web/client_spec.rb +45 -18
- data/spec/slack/web/faraday/response/raise_error_spec.rb +16 -5
- data/spec/spec_helper.rb +2 -1
- data/spec/support/queue_with_timeout.rb +1 -0
- data/spec/support/real_time/concurrency/mock.rb +1 -0
- data/spec/support/real_time/connected_client.rb +9 -3
- data/spec/support/real_time/event.rb +1 -0
- data/spec/support/token.rb +1 -0
- data/spec/support/vcr.rb +1 -0
- metadata +59 -7
- data/screenshots/register-bot.png +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 96288d9306b0d60b597f038d66aa5ffcfd2b643c0c85d4f0d974138462a47698
|
|
4
|
+
data.tar.gz: b41ec139a4543ba972c845b373cf8b5a304f0ad1ed128d8a7d2057ef507721a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f270c3ee301ecbfb6498b60b2e5d6d349f351cc0615156682a881e0b13b1a0a36dd574c45b37d69022da634865021cba4cb0f5dd0b2416c848e4ca9f1b5cb362
|
|
7
|
+
data.tar.gz: 418a7f3e2076d7bfd0dc275d08b4e1ed31cf673a1e82ba47a7f875404c3b9704181ae695ebe76b1ccb720ff0a1da9b7e9fd3d206d537730cf238ead2a55e513d
|
data/.rubocop.yml
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
|
2
|
+
|
|
3
|
+
require:
|
|
4
|
+
- rubocop-performance
|
|
5
|
+
- rubocop-rspec
|
|
6
|
+
|
|
1
7
|
AllCops:
|
|
8
|
+
DisplayCopNames: true
|
|
2
9
|
Exclude:
|
|
10
|
+
- bin/**/*
|
|
3
11
|
- vendor/**/*
|
|
4
12
|
- lib/slack/web/api/slack-api-ref/**/*
|
|
5
|
-
|
|
6
|
-
|
|
13
|
+
- lib/slack/web/api/endpoints/* # Auto-generated
|
|
14
|
+
- spec/slack/web/api/endpoints/* # Auto-generated
|
|
15
|
+
Layout/EmptyLineAfterMagicComment:
|
|
7
16
|
Enabled: false
|
|
8
|
-
|
|
17
|
+
Metrics/BlockLength:
|
|
18
|
+
Max: 250
|
|
19
|
+
Metrics/ClassLength:
|
|
20
|
+
Max: 250
|
|
9
21
|
Metrics/LineLength:
|
|
10
|
-
Max:
|
|
11
|
-
|
|
22
|
+
Max: 100
|
|
12
23
|
Style/Documentation:
|
|
13
24
|
Enabled: false
|
|
14
|
-
|
|
15
|
-
Naming/MethodName:
|
|
16
|
-
Enabled: false
|
|
17
|
-
|
|
18
25
|
Style/ModuleFunction:
|
|
19
26
|
Enabled: false
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
Naming/FileName:
|
|
28
|
+
Exclude:
|
|
29
|
+
- lib/slack-ruby-client.rb # Required to match gemspec name
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,75 +1,94 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2019-
|
|
3
|
+
# on 2019-12-23 15:50:03 -0500 using RuboCop version 0.73.0.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
10
|
-
# Configuration parameters:
|
|
11
|
-
Lint/AssignmentInCondition:
|
|
12
|
-
Exclude:
|
|
13
|
-
- 'lib/slack/real_time/concurrency/async.rb'
|
|
14
|
-
- 'lib/slack/real_time/socket.rb'
|
|
15
|
-
|
|
16
|
-
# Offense count: 5
|
|
9
|
+
# Offense count: 3
|
|
10
|
+
# Configuration parameters: AllowComments.
|
|
17
11
|
Lint/HandleExceptions:
|
|
18
12
|
Exclude:
|
|
19
|
-
- 'lib/slack-ruby-client.rb'
|
|
20
13
|
- 'lib/slack/real_time/concurrency/async.rb'
|
|
21
14
|
- 'spec/slack/real_time/concurrency/celluloid_spec.rb'
|
|
22
15
|
- 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
|
|
23
16
|
|
|
24
|
-
# Offense count:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Naming/FileName:
|
|
28
|
-
Exclude:
|
|
29
|
-
- 'bin/commands/chat_scheduledMessages.rb'
|
|
30
|
-
- 'lib/slack-ruby-client.rb'
|
|
31
|
-
- 'lib/slack/web/api/endpoints/chat_scheduledMessages.rb'
|
|
32
|
-
- 'spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb'
|
|
17
|
+
# Offense count: 10
|
|
18
|
+
Metrics/AbcSize:
|
|
19
|
+
Max: 39
|
|
33
20
|
|
|
34
21
|
# Offense count: 1
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
Metrics/CyclomaticComplexity:
|
|
23
|
+
Max: 9
|
|
24
|
+
|
|
25
|
+
# Offense count: 14
|
|
26
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
|
27
|
+
Metrics/MethodLength:
|
|
28
|
+
Max: 32
|
|
40
29
|
|
|
41
30
|
# Offense count: 1
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- 'lib/slack/real_time/client.rb'
|
|
31
|
+
Metrics/PerceivedComplexity:
|
|
32
|
+
Max: 9
|
|
45
33
|
|
|
46
|
-
# Offense count:
|
|
47
|
-
|
|
48
|
-
# SupportedStyles: inline, group
|
|
49
|
-
Style/AccessModifierDeclarations:
|
|
34
|
+
# Offense count: 1
|
|
35
|
+
RSpec/AnyInstance:
|
|
50
36
|
Exclude:
|
|
51
|
-
- '
|
|
52
|
-
- 'lib/slack/real_time/socket.rb'
|
|
37
|
+
- 'spec/slack/real_time/concurrency/celluloid_spec.rb'
|
|
53
38
|
|
|
54
|
-
# Offense count:
|
|
55
|
-
# Configuration parameters:
|
|
56
|
-
|
|
39
|
+
# Offense count: 70
|
|
40
|
+
# Configuration parameters: Prefixes.
|
|
41
|
+
# Prefixes: when, with, without
|
|
42
|
+
RSpec/ContextWording:
|
|
57
43
|
Enabled: false
|
|
58
44
|
|
|
59
|
-
# Offense count:
|
|
60
|
-
# Configuration parameters:
|
|
61
|
-
|
|
45
|
+
# Offense count: 64
|
|
46
|
+
# Configuration parameters: Max.
|
|
47
|
+
RSpec/ExampleLength:
|
|
48
|
+
Enabled: false
|
|
49
|
+
|
|
50
|
+
# Offense count: 17
|
|
51
|
+
# Configuration parameters: CustomTransform, IgnoreMethods.
|
|
52
|
+
RSpec/FilePath:
|
|
53
|
+
Enabled: false
|
|
54
|
+
|
|
55
|
+
# Offense count: 13
|
|
56
|
+
# Configuration parameters: AssignmentOnly.
|
|
57
|
+
RSpec/InstanceVariable:
|
|
62
58
|
Exclude:
|
|
63
|
-
- '
|
|
64
|
-
- '
|
|
65
|
-
- '
|
|
59
|
+
- 'spec/integration/integration_spec.rb'
|
|
60
|
+
- 'spec/slack/real_time/client_spec.rb'
|
|
61
|
+
- 'spec/slack/slack_spec.rb'
|
|
66
62
|
|
|
67
|
-
# Offense count:
|
|
68
|
-
|
|
63
|
+
# Offense count: 75
|
|
64
|
+
# Configuration parameters: .
|
|
65
|
+
# SupportedStyles: have_received, receive
|
|
66
|
+
RSpec/MessageSpies:
|
|
67
|
+
EnforcedStyle: receive
|
|
68
|
+
|
|
69
|
+
# Offense count: 93
|
|
70
|
+
# Configuration parameters: AggregateFailuresByDefault.
|
|
71
|
+
RSpec/MultipleExpectations:
|
|
72
|
+
Max: 5
|
|
73
|
+
|
|
74
|
+
# Offense count: 34
|
|
75
|
+
RSpec/NestedGroups:
|
|
76
|
+
Max: 6
|
|
77
|
+
|
|
78
|
+
# Offense count: 3
|
|
79
|
+
RSpec/SubjectStub:
|
|
69
80
|
Exclude:
|
|
70
|
-
- '
|
|
81
|
+
- 'spec/slack/web/api/mixins/channels_spec.rb'
|
|
82
|
+
- 'spec/slack/web/api/mixins/groups_spec.rb'
|
|
83
|
+
- 'spec/slack/web/api/mixins/users_spec.rb'
|
|
71
84
|
|
|
72
|
-
# Offense count:
|
|
73
|
-
|
|
85
|
+
# Offense count: 16
|
|
86
|
+
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
|
87
|
+
RSpec/VerifiedDoubles:
|
|
74
88
|
Exclude:
|
|
89
|
+
- 'spec/slack/events/request_spec.rb'
|
|
90
|
+
- 'spec/slack/real_time/client_spec.rb'
|
|
91
|
+
- 'spec/slack/real_time/concurrency/celluloid_spec.rb'
|
|
92
|
+
- 'spec/slack/real_time/concurrency/eventmachine_spec.rb'
|
|
93
|
+
- 'spec/slack/web/faraday/response/raise_error_spec.rb'
|
|
75
94
|
- 'spec/support/real_time/connected_client.rb'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
### 0.14.5 (2019/12/23)
|
|
2
|
+
|
|
3
|
+
* [#293](https://github.com/slack-ruby/slack-ruby-client/pull/293): Rubocop auto-correct and comprehensive todo - [@jcraigk](https://github.com/jcraigk).
|
|
4
|
+
* [#297](https://github.com/slack-ruby/slack-ruby-client/pull/297): Various Rubocop fixes - [@jcraigk](https://github.com/jcraigk).
|
|
5
|
+
* [#298](https://github.com/slack-ruby/slack-ruby-client/pull/298): Add `admin.apps`, `admin.app.requests` and `views` endpoints - [@jmanian](https://github.com/jmanian).
|
|
6
|
+
* [#302](https://github.com/slack-ruby/slack-ruby-client/pull/302): Add `oauth.v2.access` and `views.published` endpoints - [@jwright](https://github.com/jwright).
|
|
7
|
+
* [#309](https://github.com/slack-ruby/slack-ruby-client/pull/309): Stop ping on `inactive_account` and `invalid_auth` - [@dblock](https://github.com/dblock).
|
|
8
|
+
|
|
1
9
|
### 0.14.4 (2019/7/28)
|
|
2
10
|
|
|
3
11
|
* [#289](https://github.com/slack-ruby/slack-ruby-client/pull/289): Fix reconnects when ping timers under/overshoot - [@georgyangelov](https://github.com/georgyangelov).
|
data/Dangerfile
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -16,7 +16,8 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
|
16
16
|
- [Installation](#installation)
|
|
17
17
|
- [Usage](#usage)
|
|
18
18
|
- [Create a New Bot Integration](#create-a-new-bot-integration)
|
|
19
|
-
- [
|
|
19
|
+
- [OAuth Code Grant](#oauth-code-grant)
|
|
20
|
+
- [Using the Legacy API Token](#using-the-legacy-api-token)
|
|
20
21
|
- [Global Settings](#global-settings)
|
|
21
22
|
- [Web Client](#web-client)
|
|
22
23
|
- [Test Auth](#test-auth)
|
|
@@ -61,12 +62,12 @@ A Ruby client for the Slack [Web](https://api.slack.com/web), [RealTime Messagin
|
|
|
61
62
|
|
|
62
63
|
* This library will let you send messages to Slack via the Web API, send and receive messages via the Real Time Messaging API and facilitate integration with the Events API.
|
|
63
64
|
* To respond to slash commands, interactive components or events, implement a web application using your favorite web framework and use this library to call the Slack Web API and to verify that events are coming from Slack.
|
|
64
|
-
* To build a bot using the Real Time Messaging API, use [slack-ruby-bot](https://github.com/
|
|
65
|
-
* To roll out a complete service using the Real Time Messaging API with Slack button integration to multiple teams, check out [slack-ruby-bot-server](https://github.com/
|
|
65
|
+
* To build a bot using the Real Time Messaging API, use [slack-ruby-bot](https://github.com/slack-ruby/slack-ruby-bot), which uses this library.
|
|
66
|
+
* To roll out a complete service using the Real Time Messaging API with Slack button integration to multiple teams, check out [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server), which is built on top of slack-ruby-bot, which uses this library.
|
|
66
67
|
|
|
67
68
|
## Stable Release
|
|
68
69
|
|
|
69
|
-
You're reading the documentation for the **stable** release of slack-ruby-client, 0.14.
|
|
70
|
+
You're reading the documentation for the **stable** release of slack-ruby-client, 0.14.5. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
|
|
70
71
|
|
|
71
72
|
## Installation
|
|
72
73
|
|
|
@@ -88,11 +89,17 @@ Run `bundle install`.
|
|
|
88
89
|
|
|
89
90
|
### Create a New Bot Integration
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
To integrate your bot with Slack, you must first create a new [Slack App](https://api.slack.com/apps).
|
|
92
93
|
|
|
93
|
-

|
|
94
95
|
|
|
95
|
-
###
|
|
96
|
+
### OAuth Code Grant
|
|
97
|
+
|
|
98
|
+
Once created, go to the app's Basic Info tab and grab the Client ID and Client Secret. You'll need these in order complete an [OAuth code grant flow](https://api.slack.com/docs/oauth#flow) as described at [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server).
|
|
99
|
+
|
|
100
|
+
### Using the Legacy API Token
|
|
101
|
+
|
|
102
|
+
Although OAuth is recommended, you can still [generate a legacy API token](https://api.slack.com/custom-integrations/legacy-tokens) for your app and use it for some interactions.
|
|
96
103
|
|
|
97
104
|
```ruby
|
|
98
105
|
Slack.configure do |config|
|
|
@@ -440,7 +447,7 @@ Slack::RealTime.configure do |config|
|
|
|
440
447
|
end
|
|
441
448
|
```
|
|
442
449
|
|
|
443
|
-
Use `client.start_async` instead of `client.start!`. A good example of such application is [slack-bot-server](https://github.com/
|
|
450
|
+
Use `client.start_async` instead of `client.start!`. A good example of such application is [slack-ruby-bot-server](https://github.com/slack-ruby/slack-ruby-bot-server).
|
|
444
451
|
|
|
445
452
|
```ruby
|
|
446
453
|
client = Slack::RealTime::Client.new
|
|
@@ -515,7 +522,7 @@ Slack::Events::Request.new(http_request,
|
|
|
515
522
|
signature_expires_in: signature_expires_in)
|
|
516
523
|
```
|
|
517
524
|
|
|
518
|
-
The `verify!` call may raise `Slack::Events::MissingSigningSecret`, `Slack::Events::InvalidSignature` or `Slack::Events::TimestampExpired` errors.
|
|
525
|
+
The `verify!` call may raise `Slack::Events::Request::MissingSigningSecret`, `Slack::Events::Request::InvalidSignature` or `Slack::Events::Request::TimestampExpired` errors.
|
|
519
526
|
|
|
520
527
|
### Message Parsing
|
|
521
528
|
|
data/Rakefile
CHANGED
data/bin/commands.rb
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
2
3
|
|
|
4
|
+
require 'commands/admin_apps'
|
|
5
|
+
require 'commands/admin_apps_requests'
|
|
3
6
|
require 'commands/admin_users_session'
|
|
4
7
|
require 'commands/api'
|
|
5
8
|
require 'commands/apps'
|
|
@@ -18,11 +21,13 @@ require 'commands/dnd'
|
|
|
18
21
|
require 'commands/emoji'
|
|
19
22
|
require 'commands/files'
|
|
20
23
|
require 'commands/files_comments'
|
|
24
|
+
require 'commands/files_remote'
|
|
21
25
|
require 'commands/groups'
|
|
22
26
|
require 'commands/im'
|
|
23
27
|
require 'commands/migration'
|
|
24
28
|
require 'commands/mpim'
|
|
25
29
|
require 'commands/oauth'
|
|
30
|
+
require 'commands/oauth_v2'
|
|
26
31
|
require 'commands/pins'
|
|
27
32
|
require 'commands/reactions'
|
|
28
33
|
require 'commands/reminders'
|
|
@@ -37,3 +42,4 @@ require 'commands/users'
|
|
|
37
42
|
require 'commands/users_admin'
|
|
38
43
|
require 'commands/users_prefs'
|
|
39
44
|
require 'commands/users_profile'
|
|
45
|
+
require 'commands/views'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
|
3
|
+
|
|
4
|
+
desc 'AdminApps methods.'
|
|
5
|
+
command 'admin_apps' do |g|
|
|
6
|
+
g.desc 'Approve an app for installation on a workspace.'
|
|
7
|
+
g.long_desc %( Approve an app for installation on a workspace. )
|
|
8
|
+
g.command 'approve' do |c|
|
|
9
|
+
c.flag 'app_id', desc: 'The id of the app to approve.'
|
|
10
|
+
c.flag 'request_id', desc: 'The id of the request to approve.'
|
|
11
|
+
c.flag 'team_id', desc: '.'
|
|
12
|
+
c.action do |_global_options, options, _args|
|
|
13
|
+
puts JSON.dump($client.admin_apps_approve(options))
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
g.desc 'Restrict an app for installation on a workspace.'
|
|
18
|
+
g.long_desc %( Restrict an app for installation on a workspace. )
|
|
19
|
+
g.command 'restrict' do |c|
|
|
20
|
+
c.flag 'app_id', desc: 'The id of the app to restrict.'
|
|
21
|
+
c.flag 'request_id', desc: 'The id of the request to restrict.'
|
|
22
|
+
c.flag 'team_id', desc: '.'
|
|
23
|
+
c.action do |_global_options, options, _args|
|
|
24
|
+
puts JSON.dump($client.admin_apps_restrict(options))
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
|
3
|
+
|
|
4
|
+
desc 'AdminAppsRequests methods.'
|
|
5
|
+
command 'admin_apps_requests' do |g|
|
|
6
|
+
g.desc 'List app requests for a team/workspace.'
|
|
7
|
+
g.long_desc %( List app requests for a team/workspace. )
|
|
8
|
+
g.command 'list' do |c|
|
|
9
|
+
c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.'
|
|
10
|
+
c.flag 'limit', desc: 'The maximum number of items to return. Must be between 1 - 1000 both inclusive.'
|
|
11
|
+
c.flag 'team_id', desc: '.'
|
|
12
|
+
c.action do |_global_options, options, _args|
|
|
13
|
+
puts JSON.dump($client.admin_apps_requests_list(options))
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
2
3
|
|
|
3
4
|
desc 'AdminUsersSession methods.'
|
|
4
5
|
command 'admin_users_session' do |g|
|
|
5
|
-
g.desc
|
|
6
|
-
g.long_desc %(
|
|
6
|
+
g.desc 'Wipes all valid sessions on all devices for a given user'
|
|
7
|
+
g.long_desc %( Wipes all valid sessions on all devices for a given user )
|
|
7
8
|
g.command 'reset' do |c|
|
|
8
9
|
c.flag 'user_id', desc: 'The ID of the user to wipe sessions for.'
|
|
9
10
|
c.flag 'mobile_only', desc: 'Only expire mobile sessions (default: false).'
|
data/bin/commands/api.rb
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
2
3
|
|
|
3
4
|
desc 'Api methods.'
|
|
4
5
|
command 'api' do |g|
|
|
5
|
-
g.desc '
|
|
6
|
-
g.long_desc %(
|
|
6
|
+
g.desc 'Checks API calling code.'
|
|
7
|
+
g.long_desc %( Checks API calling code. )
|
|
7
8
|
g.command 'test' do |c|
|
|
8
9
|
c.flag 'error', desc: 'Error response to return.'
|
|
9
10
|
c.flag 'foo', desc: 'example property to return.'
|
data/bin/commands/apps.rb
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
2
3
|
|
|
3
4
|
desc 'Apps methods.'
|
|
4
5
|
command 'apps' do |g|
|
|
5
|
-
g.desc '
|
|
6
|
-
g.long_desc %(
|
|
6
|
+
g.desc 'Uninstalls your app from a workspace.'
|
|
7
|
+
g.long_desc %( Uninstalls your app from a workspace. )
|
|
7
8
|
g.command 'uninstall' do |c|
|
|
8
9
|
c.flag 'client_id', desc: 'Issued when you created your application.'
|
|
9
10
|
c.flag 'client_secret', desc: 'Issued when you created your application.'
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
2
3
|
|
|
3
4
|
desc 'AppsPermissions methods.'
|
|
4
5
|
command 'apps_permissions' do |g|
|
|
5
|
-
g.desc '
|
|
6
|
-
g.long_desc %(
|
|
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. )
|
|
7
8
|
g.command 'info' do |c|
|
|
8
9
|
c.action do |_global_options, options, _args|
|
|
9
10
|
puts JSON.dump($client.apps_permissions_info(options))
|
|
10
11
|
end
|
|
11
12
|
end
|
|
12
13
|
|
|
13
|
-
g.desc '
|
|
14
|
-
g.long_desc %(
|
|
14
|
+
g.desc 'Allows an app to request additional scopes'
|
|
15
|
+
g.long_desc %( Allows an app to request additional scopes )
|
|
15
16
|
g.command 'request' do |c|
|
|
16
17
|
c.flag 'scopes', desc: 'A comma separated list of scopes to request for.'
|
|
17
18
|
c.flag 'trigger_id', desc: 'Token used to trigger the permissions API.'
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# This file was auto-generated by lib/tasks/web.rake
|
|
2
3
|
|
|
3
4
|
desc 'AppsPermissionsResources methods.'
|
|
4
5
|
command 'apps_permissions_resources' do |g|
|
|
5
|
-
g.desc '
|
|
6
|
-
g.long_desc %(
|
|
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. )
|
|
7
8
|
g.command 'list' do |c|
|
|
8
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."
|
|
9
10
|
c.flag 'limit', desc: 'The maximum number of items to return.'
|