slack-ruby-client 0.15.1 → 0.16.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/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +0 -14
- data/.travis.yml +1 -4
- data/CHANGELOG.md +8 -0
- data/CONTRIBUTING.md +3 -10
- data/README.md +9 -27
- data/UPGRADING.md +14 -2
- data/bin/commands.rb +7 -0
- data/bin/commands/admin_analytics.rb +15 -0
- data/bin/commands/admin_apps.rb +15 -2
- data/bin/commands/admin_barriers.rb +47 -0
- data/bin/commands/admin_conversations.rb +154 -2
- data/bin/commands/admin_conversations_ekm.rb +17 -0
- data/bin/commands/admin_conversations_restrictAccess.rb +4 -4
- data/bin/commands/admin_conversations_whitelist.rb +1 -1
- data/bin/commands/admin_emoji.rb +1 -1
- data/bin/commands/admin_usergroups.rb +2 -2
- data/bin/commands/admin_users.rb +2 -2
- data/bin/commands/admin_users_session.rb +22 -0
- data/bin/commands/api.rb +0 -1
- data/bin/commands/apps_connections.rb +13 -0
- data/bin/commands/apps_event_authorizations.rb +16 -0
- data/bin/commands/auth_teams.rb +16 -0
- data/bin/commands/bots.rb +1 -0
- data/bin/commands/channels.rb +6 -3
- data/bin/commands/chat.rb +4 -4
- data/bin/commands/chat_scheduledMessages.rb +1 -0
- data/bin/commands/conversations.rb +14 -2
- data/bin/commands/dnd.rb +1 -1
- data/bin/commands/files.rb +6 -5
- data/bin/commands/files_remote.rb +2 -2
- data/bin/commands/groups.rb +5 -3
- data/bin/commands/im.rb +1 -1
- data/bin/commands/migration.rb +1 -0
- data/bin/commands/mpim.rb +3 -3
- data/bin/commands/pins.rb +0 -2
- data/bin/commands/reactions.rb +1 -0
- data/bin/commands/search.rb +4 -1
- data/bin/commands/team.rb +3 -0
- data/bin/commands/usergroups.rb +6 -1
- data/bin/commands/usergroups_users.rb +2 -0
- data/bin/commands/users.rb +5 -3
- data/bin/commands/users_profile.rb +5 -5
- data/bin/commands/views.rb +1 -1
- data/bin/commands/workflows.rb +38 -0
- data/lib/slack-ruby-client.rb +2 -0
- data/lib/slack/events/request.rb +5 -1
- data/lib/slack/real_time/client.rb +0 -1
- data/lib/slack/real_time/concurrency.rb +0 -2
- data/lib/slack/real_time/config.rb +5 -4
- data/lib/slack/version.rb +1 -1
- data/lib/slack/web/api/endpoints.rb +14 -0
- data/lib/slack/web/api/endpoints/admin_analytics.rb +26 -0
- data/lib/slack/web/api/endpoints/admin_apps.rb +22 -2
- data/lib/slack/web/api/endpoints/admin_barriers.rb +82 -0
- data/lib/slack/web/api/endpoints/admin_conversations.rb +231 -1
- data/lib/slack/web/api/endpoints/admin_conversations_ekm.rb +35 -0
- data/lib/slack/web/api/endpoints/admin_conversations_restrictAccess.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_conversations_whitelist.rb +3 -3
- data/lib/slack/web/api/endpoints/admin_emoji.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_usergroups.rb +1 -1
- data/lib/slack/web/api/endpoints/admin_users.rb +4 -6
- data/lib/slack/web/api/endpoints/admin_users_session.rb +38 -0
- data/lib/slack/web/api/endpoints/api.rb +0 -2
- data/lib/slack/web/api/endpoints/apps_connections.rb +21 -0
- data/lib/slack/web/api/endpoints/apps_event_authorizations.rb +34 -0
- data/lib/slack/web/api/endpoints/auth_teams.rb +33 -0
- data/lib/slack/web/api/endpoints/bots.rb +2 -0
- data/lib/slack/web/api/endpoints/channels.rb +9 -3
- data/lib/slack/web/api/endpoints/chat.rb +3 -3
- data/lib/slack/web/api/endpoints/chat_scheduledMessages.rb +2 -0
- data/lib/slack/web/api/endpoints/conversations.rb +21 -1
- data/lib/slack/web/api/endpoints/files.rb +4 -2
- data/lib/slack/web/api/endpoints/files_remote.rb +2 -2
- data/lib/slack/web/api/endpoints/groups.rb +7 -3
- data/lib/slack/web/api/endpoints/im.rb +1 -1
- data/lib/slack/web/api/endpoints/migration.rb +2 -0
- data/lib/slack/web/api/endpoints/mpim.rb +3 -3
- data/lib/slack/web/api/endpoints/pins.rb +0 -5
- data/lib/slack/web/api/endpoints/reactions.rb +2 -0
- data/lib/slack/web/api/endpoints/search.rb +6 -0
- data/lib/slack/web/api/endpoints/team.rb +6 -0
- data/lib/slack/web/api/endpoints/usergroups.rb +10 -0
- data/lib/slack/web/api/endpoints/usergroups_users.rb +4 -0
- data/lib/slack/web/api/endpoints/users.rb +7 -5
- data/lib/slack/web/api/endpoints/users_profile.rb +3 -3
- data/lib/slack/web/api/endpoints/views.rb +1 -1
- data/lib/slack/web/api/endpoints/workflows.rb +61 -0
- data/lib/slack/web/api/errors.rb +194 -0
- data/lib/slack/web/api/errors/internal_error.rb +14 -0
- data/lib/slack/web/api/templates/endpoints.erb +1 -0
- data/lib/slack/web/api/templates/method_spec.erb +1 -1
- data/lib/slack/web/faraday/connection.rb +1 -1
- data/lib/slack/web/faraday/response/raise_error.rb +16 -1
- data/lib/slack/web/faraday/response/wrap_error.rb +18 -0
- data/lib/tasks/web.rake +7 -3
- data/spec/slack/events/request_spec.rb +7 -3
- data/spec/slack/real_time/client_spec.rb +1 -1
- data/spec/slack/web/api/endpoints/admin_analytics_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/admin_apps_spec.rb +5 -0
- data/spec/slack/web/api/endpoints/admin_barriers_spec.rb +38 -0
- data/spec/slack/web/api/endpoints/admin_conversations_ekm_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_conversations_restrictAccess_spec.rb +5 -5
- data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +85 -0
- data/spec/slack/web/api/endpoints/admin_conversations_whitelist_spec.rb +5 -5
- data/spec/slack/web/api/endpoints/admin_emoji_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_teams_settings_spec.rb +10 -10
- data/spec/slack/web/api/endpoints/admin_teams_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/admin_usergroups_spec.rb +6 -6
- data/spec/slack/web/api/endpoints/admin_users_session_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/admin_users_spec.rb +15 -23
- data/spec/slack/web/api/endpoints/apps_connections_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/apps_event_authorizations_spec.rb +13 -0
- data/spec/slack/web/api/endpoints/apps_permissions_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/apps_permissions_users_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/apps_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/auth_teams_spec.rb +8 -0
- data/spec/slack/web/api/endpoints/calls_participants_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/calls_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/conversations_spec.rb +20 -12
- data/spec/slack/web/api/endpoints/files_comments_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/files_remote_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/files_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/im_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/mpim_spec.rb +4 -4
- data/spec/slack/web/api/endpoints/oauth_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/pins_spec.rb +1 -4
- data/spec/slack/web/api/endpoints/reactions_spec.rb +3 -3
- data/spec/slack/web/api/endpoints/reminders_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/usergroups_users_spec.rb +2 -2
- data/spec/slack/web/api/endpoints/workflows_spec.rb +26 -0
- data/spec/slack/web/client_spec.rb +56 -0
- data/spec/slack/web/faraday/response/raise_error_spec.rb +7 -6
- metadata +32 -19
- data/examples/hi_real_time/Gemfile +0 -6
- data/examples/hi_real_time/hi.gif +0 -0
- data/examples/hi_real_time/hi.rb +0 -41
- data/examples/hi_real_time_async_celluloid/Gemfile +0 -7
- data/examples/hi_real_time_async_celluloid/Procfile +0 -2
- data/examples/hi_real_time_async_celluloid/hi.rb +0 -39
- data/examples/hi_real_time_async_eventmachine/Gemfile +0 -7
- data/examples/hi_real_time_async_eventmachine/Procfile +0 -2
- data/examples/hi_real_time_async_eventmachine/hi.rb +0 -39
- data/lib/slack/real_time/concurrency/celluloid.rb +0 -142
- data/lib/slack/real_time/concurrency/eventmachine.rb +0 -85
- data/spec/slack/real_time/concurrency/celluloid_spec.rb +0 -116
- data/spec/slack/real_time/concurrency/eventmachine_spec.rb +0 -57
- data/spec/slack/web/api/errors/service_unavailable_spec.rb +0 -17
data/bin/commands/pins.rb
CHANGED
@@ -26,8 +26,6 @@ command 'pins' do |g|
|
|
26
26
|
g.long_desc %( Un-pins an item from a channel. )
|
27
27
|
g.command 'remove' do |c|
|
28
28
|
c.flag 'channel', desc: 'Channel where the item is pinned to.'
|
29
|
-
c.flag 'file', desc: 'File to un-pin.'
|
30
|
-
c.flag 'file_comment', desc: 'File comment to un-pin.'
|
31
29
|
c.flag 'timestamp', desc: 'Timestamp of the message to un-pin.'
|
32
30
|
c.action do |_global_options, options, _args|
|
33
31
|
puts JSON.dump($client.pins_remove(options))
|
data/bin/commands/reactions.rb
CHANGED
@@ -33,6 +33,7 @@ command 'reactions' do |g|
|
|
33
33
|
c.flag 'cursor', desc: "Parameter for pagination. Set cursor equal to the next_cursor attribute returned by the previous request's response_metadata. This parameter is optional, but pagination is mandatory: the default value simply fetches the first 'page' of the collection. See pagination for more details."
|
34
34
|
c.flag 'full', desc: 'If true always return the complete reaction list.'
|
35
35
|
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached."
|
36
|
+
c.flag 'team_id', desc: 'encoded team id to list reactions in, required if org token is used.'
|
36
37
|
c.flag 'user', desc: 'Show reactions made by this user. Defaults to the authed user.'
|
37
38
|
c.action do |_global_options, options, _args|
|
38
39
|
puts JSON.dump($client.reactions_list(options))
|
data/bin/commands/search.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
desc
|
4
|
+
desc "Search your team's files and messages."
|
5
5
|
command 'search' do |g|
|
6
6
|
g.desc 'Searches for messages and files matching a query.'
|
7
7
|
g.long_desc %( Searches for messages and files matching a query. )
|
@@ -10,6 +10,7 @@ command 'search' do |g|
|
|
10
10
|
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
11
11
|
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
|
12
12
|
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
|
13
|
+
c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
|
13
14
|
c.action do |_global_options, options, _args|
|
14
15
|
puts JSON.dump($client.search_all(options))
|
15
16
|
end
|
@@ -22,6 +23,7 @@ command 'search' do |g|
|
|
22
23
|
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
23
24
|
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
|
24
25
|
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
|
26
|
+
c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
|
25
27
|
c.action do |_global_options, options, _args|
|
26
28
|
puts JSON.dump($client.search_files(options))
|
27
29
|
end
|
@@ -34,6 +36,7 @@ command 'search' do |g|
|
|
34
36
|
c.flag 'highlight', desc: 'Pass a value of true to enable query highlight markers (see below).'
|
35
37
|
c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
|
36
38
|
c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
|
39
|
+
c.flag 'team_id', desc: 'encoded team id to search in, required if org token is used.'
|
37
40
|
c.action do |_global_options, options, _args|
|
38
41
|
puts JSON.dump($client.search_messages(options))
|
39
42
|
end
|
data/bin/commands/team.rb
CHANGED
@@ -7,6 +7,7 @@ command 'team' do |g|
|
|
7
7
|
g.long_desc %( Gets the access logs for the current team. )
|
8
8
|
g.command 'accessLogs' do |c|
|
9
9
|
c.flag 'before', desc: 'End of time range of logs to include in results (inclusive).'
|
10
|
+
c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.'
|
10
11
|
c.action do |_global_options, options, _args|
|
11
12
|
puts JSON.dump($client.team_accessLogs(options))
|
12
13
|
end
|
@@ -15,6 +16,7 @@ command 'team' do |g|
|
|
15
16
|
g.desc 'Gets billable users information for the current team.'
|
16
17
|
g.long_desc %( Gets billable users information for the current team. )
|
17
18
|
g.command 'billableInfo' do |c|
|
19
|
+
c.flag 'team_id', desc: 'encoded team id to get the billable information from, required if org token is used.'
|
18
20
|
c.flag 'user', desc: 'A user to retrieve the billable information for. Defaults to all users.'
|
19
21
|
c.action do |_global_options, options, _args|
|
20
22
|
puts JSON.dump($client.team_billableInfo(options))
|
@@ -36,6 +38,7 @@ command 'team' do |g|
|
|
36
38
|
c.flag 'app_id', desc: 'Filter logs to this Slack app. Defaults to all logs.'
|
37
39
|
c.flag 'change_type', desc: 'Filter logs with this change type. Defaults to all logs.'
|
38
40
|
c.flag 'service_id', desc: 'Filter logs to this service. Defaults to all logs.'
|
41
|
+
c.flag 'team_id', desc: 'encoded team id to get logs from, required if org token is used.'
|
39
42
|
c.flag 'user', desc: "Filter logs generated by this user's actions. Defaults to all logs."
|
40
43
|
c.action do |_global_options, options, _args|
|
41
44
|
puts JSON.dump($client.team_integrationLogs(options))
|
data/bin/commands/usergroups.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
desc '
|
4
|
+
desc "Get info on your team's User Groups."
|
5
5
|
command 'usergroups' do |g|
|
6
6
|
g.desc 'Create a User Group'
|
7
7
|
g.long_desc %( Create a User Group )
|
@@ -11,6 +11,7 @@ command 'usergroups' do |g|
|
|
11
11
|
c.flag 'description', desc: 'A short description of the User Group.'
|
12
12
|
c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.'
|
13
13
|
c.flag 'include_count', desc: 'Include the number of users in each User Group.'
|
14
|
+
c.flag 'team_id', desc: 'Encoded team id where the user group has to be created, required if org token is used.'
|
14
15
|
c.action do |_global_options, options, _args|
|
15
16
|
puts JSON.dump($client.usergroups_create(options))
|
16
17
|
end
|
@@ -21,6 +22,7 @@ command 'usergroups' do |g|
|
|
21
22
|
g.command 'disable' do |c|
|
22
23
|
c.flag 'usergroup', desc: 'The encoded ID of the User Group to disable.'
|
23
24
|
c.flag 'include_count', desc: 'Include the number of users in the User Group.'
|
25
|
+
c.flag 'team_id', desc: 'Encoded team id where the user group is, required if org token is used.'
|
24
26
|
c.action do |_global_options, options, _args|
|
25
27
|
puts JSON.dump($client.usergroups_disable(options))
|
26
28
|
end
|
@@ -31,6 +33,7 @@ command 'usergroups' do |g|
|
|
31
33
|
g.command 'enable' do |c|
|
32
34
|
c.flag 'usergroup', desc: 'The encoded ID of the User Group to enable.'
|
33
35
|
c.flag 'include_count', desc: 'Include the number of users in the User Group.'
|
36
|
+
c.flag 'team_id', desc: 'Encoded team id where the user group is, required if org token is used.'
|
34
37
|
c.action do |_global_options, options, _args|
|
35
38
|
puts JSON.dump($client.usergroups_enable(options))
|
36
39
|
end
|
@@ -42,6 +45,7 @@ command 'usergroups' do |g|
|
|
42
45
|
c.flag 'include_count', desc: 'Include the number of users in each User Group.'
|
43
46
|
c.flag 'include_disabled', desc: 'Include disabled User Groups.'
|
44
47
|
c.flag 'include_users', desc: 'Include the list of users for each User Group.'
|
48
|
+
c.flag 'team_id', desc: 'encoded team id to list user groups in, required if org token is used.'
|
45
49
|
c.action do |_global_options, options, _args|
|
46
50
|
puts JSON.dump($client.usergroups_list(options))
|
47
51
|
end
|
@@ -56,6 +60,7 @@ command 'usergroups' do |g|
|
|
56
60
|
c.flag 'handle', desc: 'A mention handle. Must be unique among channels, users and User Groups.'
|
57
61
|
c.flag 'include_count', desc: 'Include the number of users in the User Group.'
|
58
62
|
c.flag 'name', desc: 'A name for the User Group. Must be unique among User Groups.'
|
63
|
+
c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
|
59
64
|
c.action do |_global_options, options, _args|
|
60
65
|
puts JSON.dump($client.usergroups_update(options))
|
61
66
|
end
|
@@ -8,6 +8,7 @@ command 'usergroups_users' do |g|
|
|
8
8
|
g.command 'list' do |c|
|
9
9
|
c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
|
10
10
|
c.flag 'include_disabled', desc: 'Allow results that involve disabled User Groups.'
|
11
|
+
c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
|
11
12
|
c.action do |_global_options, options, _args|
|
12
13
|
puts JSON.dump($client.usergroups_users_list(options))
|
13
14
|
end
|
@@ -19,6 +20,7 @@ command 'usergroups_users' do |g|
|
|
19
20
|
c.flag 'usergroup', desc: 'The encoded ID of the User Group to update.'
|
20
21
|
c.flag 'users', desc: 'A comma separated string of encoded user IDs that represent the entire list of users for the User Group.'
|
21
22
|
c.flag 'include_count', desc: 'Include the number of users in the User Group.'
|
23
|
+
c.flag 'team_id', desc: 'encoded team id where the user group exists, required if org token is used.'
|
22
24
|
c.action do |_global_options, options, _args|
|
23
25
|
puts JSON.dump($client.usergroups_users_update(options))
|
24
26
|
end
|
data/bin/commands/users.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
-
desc '
|
4
|
+
desc 'Get info on members of your Slack team.'
|
5
5
|
command 'users' do |g|
|
6
6
|
g.desc 'List conversations the calling user may access.'
|
7
7
|
g.long_desc %( List conversations the calling user may access. )
|
@@ -9,6 +9,7 @@ command 'users' do |g|
|
|
9
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
10
|
c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
|
11
11
|
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000."
|
12
|
+
c.flag 'team_id', desc: 'encoded team id to list conversations in, required if org token is used.'
|
12
13
|
c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
|
13
14
|
c.flag 'user', desc: "Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership."
|
14
15
|
c.action do |_global_options, options, _args|
|
@@ -65,7 +66,8 @@ command 'users' do |g|
|
|
65
66
|
g.command 'list' do |c|
|
66
67
|
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."
|
67
68
|
c.flag 'include_locale', desc: 'Set this to true to receive the locale for users. Defaults to false.'
|
68
|
-
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached."
|
69
|
+
c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no limit value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience limit_required or HTTP 500 errors."
|
70
|
+
c.flag 'team_id', desc: 'encoded team id to list users in, required if org token is used.'
|
69
71
|
c.action do |_global_options, options, _args|
|
70
72
|
puts JSON.dump($client.users_list(options))
|
71
73
|
end
|
@@ -100,10 +102,10 @@ command 'users' do |g|
|
|
100
102
|
g.desc 'Set the user profile photo'
|
101
103
|
g.long_desc %( Set the user profile photo )
|
102
104
|
g.command 'setPhoto' do |c|
|
103
|
-
c.flag 'image', desc: 'File contents via multipart/form-data.'
|
104
105
|
c.flag 'crop_w', desc: 'Width/height of crop box (always square).'
|
105
106
|
c.flag 'crop_x', desc: 'X coordinate of top-left corner of crop box.'
|
106
107
|
c.flag 'crop_y', desc: 'Y coordinate of top-left corner of crop box.'
|
108
|
+
c.flag 'image', desc: 'File contents via multipart/form-data.'
|
107
109
|
c.action do |_global_options, options, _args|
|
108
110
|
puts JSON.dump($client.users_setPhoto(options))
|
109
111
|
end
|
@@ -3,18 +3,18 @@
|
|
3
3
|
|
4
4
|
desc 'UsersProfile methods.'
|
5
5
|
command 'users_profile' do |g|
|
6
|
-
g.desc "
|
7
|
-
g.long_desc %(
|
6
|
+
g.desc "Retrieve a user's profile information, including their custom status."
|
7
|
+
g.long_desc %( Retrieve a user's profile information, including their custom status. )
|
8
8
|
g.command 'get' do |c|
|
9
|
-
c.flag 'include_labels', desc: 'Include labels for each ID in custom profile fields.'
|
9
|
+
c.flag 'include_labels', desc: 'Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended.'
|
10
10
|
c.flag 'user', desc: 'User to retrieve profile info for.'
|
11
11
|
c.action do |_global_options, options, _args|
|
12
12
|
puts JSON.dump($client.users_profile_get(options))
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
g.desc
|
17
|
-
g.long_desc %( Set
|
16
|
+
g.desc "Set a user's profile information, including custom status."
|
17
|
+
g.long_desc %( Set a user's profile information, including custom status. )
|
18
18
|
g.command 'set' do |c|
|
19
19
|
c.flag 'name', desc: 'Name of a single key to set. Usable only if profile is not passed.'
|
20
20
|
c.flag 'profile', desc: 'Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters.'
|
data/bin/commands/views.rb
CHANGED
@@ -37,7 +37,7 @@ command 'views' do |g|
|
|
37
37
|
g.desc 'Update an existing view.'
|
38
38
|
g.long_desc %( Update an existing view. )
|
39
39
|
g.command 'update' do |c|
|
40
|
-
c.flag 'view', desc: 'A view
|
40
|
+
c.flag 'view', desc: 'A view object. This must be a JSON-encoded string.'
|
41
41
|
c.flag 'external_id', desc: 'A unique identifier of the view set by the developer. Must be unique for all views on a team. Max length of 255 characters. Either view_id or external_id is required.'
|
42
42
|
c.flag 'hash', desc: 'A string that represents view state to protect against possible race conditions.'
|
43
43
|
c.flag 'view_id', desc: 'A unique identifier of the view to be updated. Either view_id or external_id is required.'
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# This file was auto-generated by lib/tasks/web.rake
|
3
|
+
|
4
|
+
desc 'Workflows methods.'
|
5
|
+
command 'workflows' do |g|
|
6
|
+
g.desc "Indicate that an app's step in a workflow completed execution."
|
7
|
+
g.long_desc %( Indicate that an app's step in a workflow completed execution. )
|
8
|
+
g.command 'stepCompleted' do |c|
|
9
|
+
c.flag 'workflow_step_execute_id', desc: 'Context identifier that maps to the correct workflow step execution.'
|
10
|
+
c.flag 'outputs', desc: 'Key-value object of outputs from your step. Keys of this object reflect the configured key properties of your outputs array from your workflow_step object.'
|
11
|
+
c.action do |_global_options, options, _args|
|
12
|
+
puts JSON.dump($client.workflows_stepCompleted(options))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
g.desc "Indicate that an app's step in a workflow failed to execute."
|
17
|
+
g.long_desc %( Indicate that an app's step in a workflow failed to execute. )
|
18
|
+
g.command 'stepFailed' do |c|
|
19
|
+
c.flag 'error', desc: 'A JSON-based object with a message property that should contain a human readable error message.'
|
20
|
+
c.flag 'workflow_step_execute_id', desc: 'Context identifier that maps to the correct workflow step execution.'
|
21
|
+
c.action do |_global_options, options, _args|
|
22
|
+
puts JSON.dump($client.workflows_stepFailed(options))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
g.desc 'Update the configuration for a workflow step.'
|
27
|
+
g.long_desc %( Update the configuration for a workflow step. )
|
28
|
+
g.command 'updateStep' do |c|
|
29
|
+
c.flag 'workflow_step_edit_id', desc: 'A context identifier provided with view_submission payloads used to call back to workflows.updateStep.'
|
30
|
+
c.flag 'inputs', desc: 'A JSON key-value map of inputs required from a user during configuration. This is the data your app expects to receive when the workflow step starts. Please note: the embedded variable format is set and replaced by the workflow system. You cannot create custom variables that will be replaced at runtime. Read more about variables in workflow steps here.'
|
31
|
+
c.flag 'outputs', desc: 'An JSON array of output objects used during step execution. This is the data your app agrees to provide when your workflow step was executed.'
|
32
|
+
c.flag 'step_image_url', desc: 'An optional field that can be used to override app image that is shown in the Workflow Builder.'
|
33
|
+
c.flag 'step_name', desc: 'An optional field that can be used to override the step name that is shown in the Workflow Builder.'
|
34
|
+
c.action do |_global_options, options, _args|
|
35
|
+
puts JSON.dump($client.workflows_updateStep(options))
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/slack-ruby-client.rb
CHANGED
@@ -28,7 +28,9 @@ require_relative 'slack/web/api/errors/slack_error'
|
|
28
28
|
require_relative 'slack/web/api/errors/too_many_requests_error'
|
29
29
|
require_relative 'slack/web/api/error'
|
30
30
|
require_relative 'slack/web/api/errors'
|
31
|
+
require_relative 'slack/web/api/errors/internal_error'
|
31
32
|
require_relative 'slack/web/faraday/response/raise_error'
|
33
|
+
require_relative 'slack/web/faraday/response/wrap_error'
|
32
34
|
require_relative 'slack/web/faraday/connection'
|
33
35
|
require_relative 'slack/web/faraday/request'
|
34
36
|
require_relative 'slack/web/api/mixins'
|
data/lib/slack/events/request.rb
CHANGED
@@ -35,7 +35,11 @@ module Slack
|
|
35
35
|
|
36
36
|
# Request body.
|
37
37
|
def body
|
38
|
-
@body ||=
|
38
|
+
@body ||= begin
|
39
|
+
body = http_request.body.read
|
40
|
+
http_request.body.rewind
|
41
|
+
body
|
42
|
+
end
|
39
43
|
end
|
40
44
|
|
41
45
|
# Returns true if the signature coming from Slack has expired.
|
@@ -17,7 +17,8 @@ module Slack
|
|
17
17
|
logger
|
18
18
|
].freeze
|
19
19
|
|
20
|
-
attr_accessor(*Config::ATTRIBUTES)
|
20
|
+
attr_accessor(*Config::ATTRIBUTES - [:concurrency])
|
21
|
+
attr_writer :concurrency
|
21
22
|
|
22
23
|
def reset
|
23
24
|
self.websocket_ping = 30
|
@@ -37,7 +38,7 @@ module Slack
|
|
37
38
|
private
|
38
39
|
|
39
40
|
def detect_concurrency
|
40
|
-
%i[Async
|
41
|
+
%i[Async].each do |concurrency|
|
41
42
|
begin
|
42
43
|
return Slack::RealTime::Concurrency.const_get(concurrency)
|
43
44
|
rescue LoadError, NameError
|
@@ -47,8 +48,8 @@ module Slack
|
|
47
48
|
|
48
49
|
raise(
|
49
50
|
NoConcurrencyError,
|
50
|
-
'Missing concurrency. Add async-websocket
|
51
|
-
'
|
51
|
+
'Missing concurrency. Add async-websocket or faye-websocket ' \
|
52
|
+
'to your Gemfile.'
|
52
53
|
)
|
53
54
|
end
|
54
55
|
end
|
data/lib/slack/version.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# This file was auto-generated by lib/tasks/web.rake
|
3
3
|
|
4
|
+
require_relative 'endpoints/admin_analytics'
|
4
5
|
require_relative 'endpoints/admin_apps'
|
5
6
|
require_relative 'endpoints/admin_apps_approved'
|
6
7
|
require_relative 'endpoints/admin_apps_requests'
|
7
8
|
require_relative 'endpoints/admin_apps_restricted'
|
9
|
+
require_relative 'endpoints/admin_barriers'
|
8
10
|
require_relative 'endpoints/admin_conversations'
|
11
|
+
require_relative 'endpoints/admin_conversations_ekm'
|
9
12
|
require_relative 'endpoints/admin_conversations_restrictAccess'
|
10
13
|
require_relative 'endpoints/admin_conversations_whitelist'
|
11
14
|
require_relative 'endpoints/admin_emoji'
|
@@ -21,11 +24,14 @@ require_relative 'endpoints/admin_users'
|
|
21
24
|
require_relative 'endpoints/admin_users_session'
|
22
25
|
require_relative 'endpoints/api'
|
23
26
|
require_relative 'endpoints/apps'
|
27
|
+
require_relative 'endpoints/apps_connections'
|
28
|
+
require_relative 'endpoints/apps_event_authorizations'
|
24
29
|
require_relative 'endpoints/apps_permissions'
|
25
30
|
require_relative 'endpoints/apps_permissions_resources'
|
26
31
|
require_relative 'endpoints/apps_permissions_scopes'
|
27
32
|
require_relative 'endpoints/apps_permissions_users'
|
28
33
|
require_relative 'endpoints/auth'
|
34
|
+
require_relative 'endpoints/auth_teams'
|
29
35
|
require_relative 'endpoints/bots'
|
30
36
|
require_relative 'endpoints/calls'
|
31
37
|
require_relative 'endpoints/calls_participants'
|
@@ -60,6 +66,7 @@ require_relative 'endpoints/users_admin'
|
|
60
66
|
require_relative 'endpoints/users_prefs'
|
61
67
|
require_relative 'endpoints/users_profile'
|
62
68
|
require_relative 'endpoints/views'
|
69
|
+
require_relative 'endpoints/workflows'
|
63
70
|
|
64
71
|
module Slack
|
65
72
|
module Web
|
@@ -70,11 +77,14 @@ module Slack
|
|
70
77
|
include Slack::Web::Api::Mixins::Users
|
71
78
|
include Slack::Web::Api::Mixins::Groups
|
72
79
|
|
80
|
+
include AdminAnalytics
|
73
81
|
include AdminApps
|
74
82
|
include AdminAppsApproved
|
75
83
|
include AdminAppsRequests
|
76
84
|
include AdminAppsRestricted
|
85
|
+
include AdminBarriers
|
77
86
|
include AdminConversations
|
87
|
+
include AdminConversationsEkm
|
78
88
|
include AdminConversationsRestrictaccess
|
79
89
|
include AdminConversationsWhitelist
|
80
90
|
include AdminEmoji
|
@@ -90,11 +100,14 @@ module Slack
|
|
90
100
|
include AdminUsersSession
|
91
101
|
include Api
|
92
102
|
include Apps
|
103
|
+
include AppsConnections
|
104
|
+
include AppsEventAuthorizations
|
93
105
|
include AppsPermissions
|
94
106
|
include AppsPermissionsResources
|
95
107
|
include AppsPermissionsScopes
|
96
108
|
include AppsPermissionsUsers
|
97
109
|
include Auth
|
110
|
+
include AuthTeams
|
98
111
|
include Bots
|
99
112
|
include Calls
|
100
113
|
include CallsParticipants
|
@@ -129,6 +142,7 @@ module Slack
|
|
129
142
|
include UsersPrefs
|
130
143
|
include UsersProfile
|
131
144
|
include Views
|
145
|
+
include Workflows
|
132
146
|
end
|
133
147
|
end
|
134
148
|
end
|
@@ -0,0 +1,26 @@
|
|
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 AdminAnalytics
|
9
|
+
#
|
10
|
+
# Retrieve analytics data for a given date, presented as a compressed JSON file
|
11
|
+
#
|
12
|
+
# @option options [Object] :type
|
13
|
+
# The type of analytics to retrieve. The options are currently limited to member.
|
14
|
+
# @option options [Object] :date
|
15
|
+
# Date to retrieve the analytics data for, expressed as YYYY-MM-DD in UTC.
|
16
|
+
# @see https://api.slack.com/methods/admin.analytics.getFile
|
17
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.analytics/admin.analytics.getFile.json
|
18
|
+
def admin_analytics_getFile(options = {})
|
19
|
+
throw ArgumentError.new('Required arguments :type missing') if options[:type].nil?
|
20
|
+
post('admin.analytics.getFile', options)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -11,25 +11,45 @@ module Slack
|
|
11
11
|
#
|
12
12
|
# @option options [Object] :app_id
|
13
13
|
# The id of the app to approve.
|
14
|
+
# @option options [Object] :enterprise_id
|
15
|
+
# The ID of the enterprise to approve the app on.
|
14
16
|
# @option options [Object] :request_id
|
15
17
|
# The id of the request to approve.
|
16
18
|
# @option options [Object] :team_id
|
17
|
-
# .
|
19
|
+
# The ID of the workspace to approve the app on.
|
18
20
|
# @see https://api.slack.com/methods/admin.apps.approve
|
19
21
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps/admin.apps.approve.json
|
20
22
|
def admin_apps_approve(options = {})
|
21
23
|
post('admin.apps.approve', options)
|
22
24
|
end
|
23
25
|
|
26
|
+
#
|
27
|
+
# Clear an app resolution
|
28
|
+
#
|
29
|
+
# @option options [Object] :app_id
|
30
|
+
# The id of the app whose resolution you want to clear/undo.
|
31
|
+
# @option options [Object] :enterprise_id
|
32
|
+
# The enterprise to clear the app resolution from.
|
33
|
+
# @option options [Object] :team_id
|
34
|
+
# The workspace to clear the app resolution from.
|
35
|
+
# @see https://api.slack.com/methods/admin.apps.clearResolution
|
36
|
+
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps/admin.apps.clearResolution.json
|
37
|
+
def admin_apps_clearResolution(options = {})
|
38
|
+
throw ArgumentError.new('Required arguments :app_id missing') if options[:app_id].nil?
|
39
|
+
post('admin.apps.clearResolution', options)
|
40
|
+
end
|
41
|
+
|
24
42
|
#
|
25
43
|
# Restrict an app for installation on a workspace.
|
26
44
|
#
|
27
45
|
# @option options [Object] :app_id
|
28
46
|
# The id of the app to restrict.
|
47
|
+
# @option options [Object] :enterprise_id
|
48
|
+
# The ID of the enterprise to approve the app on.
|
29
49
|
# @option options [Object] :request_id
|
30
50
|
# The id of the request to restrict.
|
31
51
|
# @option options [Object] :team_id
|
32
|
-
# .
|
52
|
+
# The ID of the workspace to approve the app on.
|
33
53
|
# @see https://api.slack.com/methods/admin.apps.restrict
|
34
54
|
# @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/admin.apps/admin.apps.restrict.json
|
35
55
|
def admin_apps_restrict(options = {})
|