Skip to content

Commit 6b559c3

Browse files
jmaniandblock
authored andcommitted
update Slack Web API with new methods (#298)
* update Web API * convert view option to JSON * add custom spec for views endpoint * update changelog * changes for rubocop
1 parent 499c4ba commit 6b559c3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+835
-473
lines changed

.rubocop_todo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ RSpec/FilePath:
136136
- 'spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb'
137137
- 'spec/slack/web/api/endpoints/custom_specs/groups_spec.rb'
138138
- 'spec/slack/web/api/endpoints/custom_specs/users_spec.rb'
139+
- 'spec/slack/web/api/endpoints/custom_specs/views_spec.rb'
139140
- 'spec/slack/web/api/errors/service_unavailable_spec.rb'
140141

141142
# Offense count: 13

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
* [#293](https://github.com/slack-ruby/slack-ruby-client/pull/293): Rubocop auto-correct and comprehensive todo - [@jcraigk](https://github.com/jcraigk).
44
* [#297](https://github.com/slack-ruby/slack-ruby-client/pull/297): Various Rubocop fixes - [@jcraigk](https://github.com/jcraigk).
5-
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).
66
* Your contribution here.
77

88
### 0.14.4 (2019/7/28)

bin/commands.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# frozen_string_literal: true
22
# This file was auto-generated by lib/tasks/web.rake
33

4+
require 'commands/admin_apps'
5+
require 'commands/admin_apps_requests'
46
require 'commands/admin_users_session'
57
require 'commands/api'
68
require 'commands/apps'
@@ -39,3 +41,4 @@
3941
require 'commands/users_admin'
4042
require 'commands/users_prefs'
4143
require 'commands/users_profile'
44+
require 'commands/views'

bin/commands/admin_apps.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

bin/commands/admin_users_session.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
desc 'AdminUsersSession methods.'
55
command 'admin_users_session' do |g|
6-
g.desc "This method wipes a user session, leaving the user unauthenticated. The user's Slack client will reset its local cache."
7-
g.long_desc %( This method wipes a user session, leaving the user unauthenticated. The user's Slack client will reset its local cache. )
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 )
88
g.command 'reset' do |c|
99
c.flag 'user_id', desc: 'The ID of the user to wipe sessions for.'
1010
c.flag 'mobile_only', desc: 'Only expire mobile sessions (default: false).'

bin/commands/api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
desc 'Api methods.'
55
command 'api' do |g|
6-
g.desc 'This method helps you test your calling code.'
7-
g.long_desc %( This method helps you test your calling code. )
6+
g.desc 'Checks API calling code.'
7+
g.long_desc %( Checks API calling code. )
88
g.command 'test' do |c|
99
c.flag 'error', desc: 'Error response to return.'
1010
c.flag 'foo', desc: 'example property to return.'

bin/commands/apps.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
desc 'Apps methods.'
55
command 'apps' do |g|
6-
g.desc 'This method uninstalls an app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of an app.'
7-
g.long_desc %( This method uninstalls an app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of an app. )
6+
g.desc 'Uninstalls your app from a workspace.'
7+
g.long_desc %( Uninstalls your app from a workspace. )
88
g.command 'uninstall' do |c|
99
c.flag 'client_id', desc: 'Issued when you created your application.'
1010
c.flag 'client_secret', desc: 'Issued when you created your application.'

bin/commands/apps_permissions.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33

44
desc 'AppsPermissions methods.'
55
command 'apps_permissions' do |g|
6-
g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.'
7-
g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. )
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. )
88
g.command 'info' do |c|
99
c.action do |_global_options, options, _args|
1010
puts JSON.dump($client.apps_permissions_info(options))
1111
end
1212
end
1313

14-
g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.'
15-
g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. )
14+
g.desc 'Allows an app to request additional scopes'
15+
g.long_desc %( Allows an app to request additional scopes )
1616
g.command 'request' do |c|
1717
c.flag 'scopes', desc: 'A comma separated list of scopes to request for.'
1818
c.flag 'trigger_id', desc: 'Token used to trigger the permissions API.'

bin/commands/apps_permissions_resources.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
desc 'AppsPermissionsResources methods.'
55
command 'apps_permissions_resources' do |g|
6-
g.desc 'This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months.'
7-
g.long_desc %( This feature was exclusive to our workspace apps developer preview. The preview has now ended, but fan-favorite features such as token rotation and the Conversations API will become available to classic Slack apps over the coming months. )
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. )
88
g.command 'list' do |c|
99
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."
1010
c.flag 'limit', desc: 'The maximum number of items to return.'

0 commit comments

Comments
 (0)