Skip to content

Commit

Permalink
rake slack:api:update
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Apr 10, 2019
1 parent c46c5d4 commit 77af58f
Show file tree
Hide file tree
Showing 74 changed files with 603 additions and 530 deletions.
9 changes: 6 additions & 3 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-04-07 11:03:29 -0400 using RuboCop version 0.61.1.
# on 2019-04-09 22:16:03 -0500 using RuboCop version 0.61.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -20,12 +20,15 @@ Lint/HandleExceptions:
- 'spec/slack/real_time/concurrency/celluloid_spec.rb'
- 'spec/slack/real_time/concurrency/eventmachine_spec.rb'

# Offense count: 1
# Offense count: 4
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
Naming/FileName:
Exclude:
- 'bin/commands/chat_scheduledMessages.rb'
- 'lib/slack-ruby-client.rb'
- 'lib/slack/web/api/endpoints/chat_scheduledMessages.rb'
- 'spec/slack/web/api/endpoints/chat_scheduledMessages_spec.rb'

# Offense count: 1
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
Expand All @@ -47,7 +50,7 @@ Style/AccessModifierDeclarations:
- 'lib/slack/real_time/concurrency/eventmachine.rb'
- 'lib/slack/real_time/socket.rb'

# Offense count: 153
# Offense count: 154
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Enabled: false
Expand Down
1 change: 1 addition & 0 deletions bin/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
require 'commands/bots'
require 'commands/channels'
require 'commands/chat'
require 'commands/chat_scheduledMessages'
require 'commands/conversations'
require 'commands/dialog'
require 'commands/dnd'
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

desc 'Api methods.'
command 'api' do |g|
g.desc 'Checks API calling code.'
g.long_desc %( Checks API calling code. )
g.desc 'This method helps you test your calling code.'
g.long_desc %( This method helps you test your calling code. )
g.command 'test' do |c|
c.flag 'error', desc: 'Error response to return.'
c.flag 'foo', desc: 'example property to return.'
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/apps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

desc 'Apps methods.'
command 'apps' do |g|
g.desc 'Uninstalls your app from a workspace.'
g.long_desc %( Uninstalls your app from a workspace. )
g.desc 'This method uninstalls a workspace app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of a workspace app.'
g.long_desc %( This method uninstalls a workspace app. Unlike auth.revoke, which revokes a single token, this method revokes all tokens associated with a single installation of a workspace app. )
g.command 'uninstall' do |c|
c.flag 'client_id', desc: 'Issued when you created your application.'
c.flag 'client_secret', desc: 'Issued when you created your application.'
Expand Down
8 changes: 4 additions & 4 deletions bin/commands/apps_permissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

desc 'AppsPermissions methods.'
command 'apps_permissions' do |g|
g.desc 'Returns list of permissions this app has on a team.'
g.long_desc %( Returns list of permissions this app has on a team. )
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.'
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. )
g.command 'info' do |c|
c.action do |_global_options, options, _args|
puts JSON.dump($client.apps_permissions_info(options))
end
end

g.desc 'Allows an app to request additional scopes'
g.long_desc %( Allows an app to request additional scopes )
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.'
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. )
g.command 'request' do |c|
c.flag 'scopes', desc: 'A comma separated list of scopes to request for.'
c.flag 'trigger_id', desc: 'Token used to trigger the permissions API.'
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/apps_permissions_resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

desc 'AppsPermissionsResources methods.'
command 'apps_permissions_resources' do |g|
g.desc 'Returns list of resource grants this app has on a team.'
g.long_desc %( Returns list of resource grants this app has on a team. )
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.'
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. )
g.command 'list' do |c|
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."
c.flag 'limit', desc: 'The maximum number of items to return.'
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/apps_permissions_scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

desc 'AppsPermissionsScopes methods.'
command 'apps_permissions_scopes' do |g|
g.desc 'Returns list of scopes this app has on a team.'
g.long_desc %( Returns list of scopes this app has on a team. )
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.'
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. )
g.command 'list' do |c|
c.action do |_global_options, options, _args|
puts JSON.dump($client.apps_permissions_scopes_list(options))
Expand Down
8 changes: 4 additions & 4 deletions bin/commands/apps_permissions_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

desc 'AppsPermissionsUsers methods.'
command 'apps_permissions_users' do |g|
g.desc 'Returns list of user grants and corresponding scopes this app has on a team.'
g.long_desc %( Returns list of user grants and corresponding scopes this app has on a team. )
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.'
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. )
g.command 'list' do |c|
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."
c.flag 'limit', desc: 'The maximum number of items to return.'
Expand All @@ -12,8 +12,8 @@
end
end

g.desc 'Enables an app to trigger a permissions modal to grant an app access to a user access scope.'
g.long_desc %( Enables an app to trigger a permissions modal to grant an app access to a user access scope. )
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.'
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. )
g.command 'request' do |c|
c.flag 'scopes', desc: 'A comma separated list of user scopes to request for.'
c.flag 'trigger_id', desc: 'Token used to trigger the request.'
Expand Down
8 changes: 4 additions & 4 deletions bin/commands/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

desc 'Auth methods.'
command 'auth' do |g|
g.desc 'Revokes a token.'
g.long_desc %( Revokes a token. )
g.desc 'This method revokes an access token. Use it when you no longer need a token. For example, with a Sign In With Slack app, call this to log a user out.'
g.long_desc %( This method revokes an access token. Use it when you no longer need a token. For example, with a Sign In With Slack app, call this to log a user out. )
g.command 'revoke' do |c|
c.flag 'test', desc: 'Setting this parameter to 1 triggers a testing mode where the specified token will not actually be revoked.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.auth_revoke(options))
end
end

g.desc 'Checks authentication & identity.'
g.long_desc %( Checks authentication & identity. )
g.desc 'This method checks authentication and tells "you" who you are, even if you might be a bot.'
g.long_desc %( This method checks authentication and tells "you" who you are, even if you might be a bot. )
g.command 'test' do |c|
c.action do |_global_options, options, _args|
puts JSON.dump($client.auth_test(options))
Expand Down
4 changes: 2 additions & 2 deletions bin/commands/bots.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

desc 'Bots methods.'
command 'bots' do |g|
g.desc 'Gets information about a bot user.'
g.long_desc %( Gets information about a bot user. )
g.desc 'This method returns extended information about a bot user.'
g.long_desc %( This method returns extended information about a bot user. )
g.command 'info' do |c|
c.flag 'bot', desc: 'Bot user to get info on.'
c.action do |_global_options, options, _args|
Expand Down
63 changes: 32 additions & 31 deletions bin/commands/channels.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# This file was auto-generated by lib/tasks/web.rake

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."
desc 'Channels methods.'
command 'channels' do |g|
g.desc 'Archives a channel.'
g.long_desc %( Archives a channel. )
g.desc 'This method archives a channel.'
g.long_desc %( This method archives a channel. )
g.command 'archive' do |c|
c.flag 'channel', desc: 'Channel to archive.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.channels_archive(options))
end
end

g.desc 'Creates a channel.'
g.long_desc %( Creates a channel. )
g.desc 'This method is used to create a channel.'
g.long_desc %( This method is used to create a channel. )
g.command 'create' do |c|
c.flag 'name', desc: 'Name of channel to create.'
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
Expand All @@ -30,8 +30,8 @@
end
end

g.desc 'Fetches history of messages and events from a channel.'
g.long_desc %( Fetches history of messages and events from a channel. )
g.desc 'This method returns a portion of message events from the specified public channel.'
g.long_desc %( This method returns a portion of message events from the specified public channel. )
g.command 'history' do |c|
c.flag 'channel', desc: 'Channel to fetch history for.'
c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
Expand All @@ -52,8 +52,8 @@
end
end

g.desc 'Gets information about a channel.'
g.long_desc %( Gets information about a channel. )
g.desc 'This method returns information about a team channel.'
g.long_desc %( This method returns information about a team channel. )
g.command 'info' do |c|
c.flag 'channel', desc: 'Channel to get info on.'
c.flag 'include_locale', desc: 'Set this to true to receive the locale for this channel. Defaults to false.'
Expand All @@ -62,8 +62,8 @@
end
end

g.desc 'Invites a user to a channel.'
g.long_desc %( Invites a user to a channel. )
g.desc 'This method is used to invite a user to a channel. The calling user must be a member of the channel.'
g.long_desc %( This method is used to invite a user to a channel. The calling user must be a member of the channel. )
g.command 'invite' do |c|
c.flag 'channel', desc: 'Channel to invite user to.'
c.flag 'user', desc: 'User to invite to channel.'
Expand All @@ -72,8 +72,8 @@
end
end

g.desc 'Joins a channel, creating it if needed.'
g.long_desc %( Joins a channel, creating it if needed. )
g.desc 'This method is used to join a channel. If the channel does not exist, it is'
g.long_desc %( This method is used to join a channel. If the channel does not exist, it is created. )
g.command 'join' do |c|
c.flag 'name', desc: 'Name of channel to join.'
c.flag 'validate', desc: 'Whether to return errors on invalid channel name instead of modifying it to meet the specified criteria.'
Expand All @@ -82,8 +82,8 @@
end
end

g.desc 'Removes a user from a channel.'
g.long_desc %( Removes a user from a channel. )
g.desc 'This method allows a user to remove another member from a team channel.'
g.long_desc %( This method allows a user to remove another member from a team channel. )
g.command 'kick' do |c|
c.flag 'channel', desc: 'Channel to remove user from.'
c.flag 'user', desc: 'User to remove from channel.'
Expand All @@ -92,17 +92,17 @@
end
end

g.desc 'Leaves a channel.'
g.long_desc %( Leaves a channel. )
g.desc 'This method is used to leave a channel.'
g.long_desc %( This method is used to leave a channel. )
g.command 'leave' do |c|
c.flag 'channel', desc: 'Channel to leave.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.channels_leave(options))
end
end

g.desc 'Lists all channels in a Slack team.'
g.long_desc %( Lists all channels in a Slack team. )
g.desc "Don't use this method. Use conversations.list instead."
g.long_desc %( Don't use this method. Use conversations.list instead. )
g.command 'list' do |c|
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."
c.flag 'exclude_archived', desc: 'Exclude archived channels from the list.'
Expand All @@ -113,8 +113,8 @@
end
end

g.desc 'Sets the read cursor in a channel.'
g.long_desc %( Sets the read cursor in a channel. )
g.desc 'This method moves the read cursor in a channel.'
g.long_desc %( This method moves the read cursor in a channel. )
g.command 'mark' do |c|
c.flag 'channel', desc: 'Channel to set reading cursor in.'
c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
Expand All @@ -123,8 +123,8 @@
end
end

g.desc 'Renames a channel.'
g.long_desc %( Renames a channel. )
g.desc 'This method renames a team channel.'
g.long_desc %( This method renames a team channel. )
g.command 'rename' do |c|
c.flag 'channel', desc: 'Channel to rename.'
c.flag 'name', desc: 'New name for channel.'
Expand All @@ -134,8 +134,8 @@
end
end

g.desc 'Retrieve a thread of messages posted to a channel'
g.long_desc %( Retrieve a thread of messages posted to a channel )
g.desc 'This method returns an entire thread (a message plus all the messages in reply to it).'
g.long_desc %( This method returns an entire thread (a message plus all the messages in reply to it). )
g.command 'replies' do |c|
c.flag 'channel', desc: 'Channel to fetch thread from.'
c.flag 'thread_ts', desc: "Unique identifier of a thread's parent message."
Expand All @@ -144,18 +144,19 @@
end
end

g.desc 'Sets the purpose for a channel.'
g.long_desc %( Sets the purpose for a channel. )
g.desc 'This method is used to change the purpose of a channel. The calling user must be a member of the channel.'
g.long_desc %( This method is used to change the purpose of a channel. The calling user must be a member of the channel. )
g.command 'setPurpose' do |c|
c.flag 'channel', desc: 'Channel to set the purpose of.'
c.flag 'purpose', desc: 'The new purpose.'
c.flag 'name_tagging', desc: 'if it is true, treat this like a message and not an unescaped thing.'
c.action do |_global_options, options, _args|
puts JSON.dump($client.channels_setPurpose(options))
end
end

g.desc 'Sets the topic for a channel.'
g.long_desc %( Sets the topic for a channel. )
g.desc 'This method is used to change the topic of a channel. The calling user must be a member of the channel.'
g.long_desc %( This method is used to change the topic of a channel. The calling user must be a member of the channel. )
g.command 'setTopic' do |c|
c.flag 'channel', desc: 'Channel to set the topic of.'
c.flag 'topic', desc: 'The new topic.'
Expand All @@ -164,8 +165,8 @@
end
end

g.desc 'Unarchives a channel.'
g.long_desc %( Unarchives a channel. )
g.desc 'This method unarchives a channel. The calling user is added to the channel.'
g.long_desc %( This method unarchives a channel. The calling user is added to the channel. )
g.command 'unarchive' do |c|
c.flag 'channel', desc: 'Channel to unarchive.'
c.action do |_global_options, options, _args|
Expand Down
Loading

0 comments on commit 77af58f

Please sign in to comment.